Skip to content

Commit a35ac5b

Browse files
authored
feat(ns-arazzo-1): add support for Arazzo 1.1.0 (#498)
Arazzo 1.1.0 renames Criterion Expression Type Object to Expression Type Object, as it is now shared by Criterion Object and Selector Object. Deprecated aliases are kept for backward compatibility. Refs #297 Signed-off-by: Vladimir Gorej <vladimir.gorej@gmail.com>
1 parent aaf3063 commit a35ac5b

65 files changed

Lines changed: 3707 additions & 251 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/apidom-ns-arazzo-1/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- [Arazzo 1.0.0](https://spec.openapis.org/arazzo/v1.0.0.html)
66
- [Arazzo 1.0.1](https://spec.openapis.org/arazzo/v1.0.1.html)
7+
- [Arazzo 1.1.0](https://spec.openapis.org/arazzo/v1.1.0.html)
78

89
## Installation
910

@@ -13,9 +14,9 @@ You can install this package via [npm CLI](https://docs.npmjs.com/cli) by runnin
1314
$ npm install @speclynx/apidom-ns-arazzo-1
1415
```
1516

16-
## Arazzo 1.0.1 namespace
17+
## Arazzo 1.1.0 namespace
1718

18-
Arazzo 1.0.1 namespace consists of [number of elements](https://github.com/speclynx/apidom/tree/main/packages/apidom-ns-arazzo-1/src/elements) implemented on top
19+
Arazzo 1.1.0 namespace consists of [number of elements](https://github.com/speclynx/apidom/tree/main/packages/apidom-ns-arazzo-1/src/elements) implemented on top
1920
of [primitive ones](https://github.com/speclynx/apidom/tree/main/packages/apidom-datamodel/src/primitives).
2021

2122
```js
@@ -157,7 +158,7 @@ import { parse } from '@speclynx/apidom-parser-adapter-yaml-1-2';
157158
import { refractorPluginReplaceEmptyElement, refractArazzoSpecification1 } from '@speclynx/apidom-ns-arazzo-1';
158159

159160
const yamlDefinition = `
160-
arazzo: 1.0.1
161+
arazzo: 1.1.0
161162
info:
162163
`;
163164
const apiDOM = await parse(yamlDefinition);
@@ -199,7 +200,8 @@ Only fully implemented specification objects should be checked here.
199200
- [x] [Components Object](https://spec.openapis.org/arazzo/latest.html#components-object)
200201
- [x] [Reusable Object](https://spec.openapis.org/arazzo/latest.html#reusable-object)
201202
- [x] [Criterion Object](https://spec.openapis.org/arazzo/latest.html#criterion-object)
202-
- [x] [Criterion Expression Type Object](https://spec.openapis.org/arazzo/latest.html#criterion-expression-type-object)
203+
- [x] [Expression Type Object](https://spec.openapis.org/arazzo/latest.html#expression-type-object)
204+
- [x] [Selector Object](https://spec.openapis.org/arazzo/latest.html#selector-object)
203205
- [x] [Request Body Object](https://spec.openapis.org/arazzo/latest.html#request-body-object)
204206
- [x] [Payload Replacement Object](https://spec.openapis.org/arazzo/latest.html#payload-replacement-object)
205207
- [x] [JSON Schema](https://json-schema.org/specification-links#2020-12)

packages/apidom-ns-arazzo-1/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@speclynx/apidom-ns-arazzo-1",
33
"version": "5.1.1",
4-
"description": "Arazzo Specification 1.0.1 namespace for ApiDOM.",
4+
"description": "Arazzo Specification 1.1.0 namespace for ApiDOM.",
55
"keywords": [
66
"apidom",
77
"api",

packages/apidom-ns-arazzo-1/src/elements/ArazzoSpecification1.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { ObjectElement, type Attributes, type Meta } from '@speclynx/apidom-datamodel';
1+
import {
2+
ObjectElement,
3+
StringElement,
4+
type Attributes,
5+
type Meta,
6+
} from '@speclynx/apidom-datamodel';
27

38
import ArazzoElement from './Arazzo.ts';
49
import InfoElement from './Info.ts';
@@ -24,6 +29,14 @@ class ArazzoSpecification1 extends ObjectElement {
2429
this.set('arazzo', arazzo);
2530
}
2631

32+
get $self(): StringElement | undefined {
33+
return this.get('$self') as StringElement | undefined;
34+
}
35+
36+
set $self($self: StringElement | undefined) {
37+
this.set('$self', $self);
38+
}
39+
2740
get info(): InfoElement | undefined {
2841
return this.get('info') as InfoElement | undefined;
2942
}

packages/apidom-ns-arazzo-1/src/elements/Criterion.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
type Meta,
66
} from '@speclynx/apidom-datamodel';
77

8-
import CriterionExpressionTypeElement from './CriterionExpressionType.ts';
8+
import ExpressionTypeElement from './ExpressionType.ts';
99

1010
/**
1111
* @public
@@ -32,11 +32,11 @@ class Criterion extends ObjectElement {
3232
this.set('condition', condition);
3333
}
3434

35-
get type(): StringElement | CriterionExpressionTypeElement | undefined {
36-
return this.get('type') as StringElement | CriterionExpressionTypeElement | undefined;
35+
get type(): StringElement | ExpressionTypeElement | undefined {
36+
return this.get('type') as StringElement | ExpressionTypeElement | undefined;
3737
}
3838

39-
set type(type: StringElement | CriterionExpressionTypeElement | undefined) {
39+
set type(type: StringElement | ExpressionTypeElement | undefined) {
4040
this.set('type', type);
4141
}
4242
}

packages/apidom-ns-arazzo-1/src/elements/CriterionExpressionType.ts renamed to packages/apidom-ns-arazzo-1/src/elements/ExpressionType.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import {
88
/**
99
* @public
1010
*/
11-
class CriterionExpressionType extends ObjectElement {
11+
class ExpressionType extends ObjectElement {
1212
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
1313
super(content, meta, attributes);
14-
this.element = 'criterionExpressionType';
14+
this.element = 'expressionType';
1515
}
1616

1717
get type(): StringElement | undefined {
@@ -31,4 +31,4 @@ class CriterionExpressionType extends ObjectElement {
3131
}
3232
}
3333

34-
export default CriterionExpressionType;
34+
export default ExpressionType;

packages/apidom-ns-arazzo-1/src/elements/FailureAction.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
type Meta,
77
} from '@speclynx/apidom-datamodel';
88

9+
import FailureActionParametersElement from './nces/FailureActionParameters.ts';
910
import FailureActionCriteriaElement from './nces/FailureActionCriteria.ts';
1011

1112
/**
@@ -65,6 +66,14 @@ class FailureAction extends ObjectElement {
6566
this.set('retryLimit', retryLimit);
6667
}
6768

69+
get parameters(): FailureActionParametersElement | undefined {
70+
return this.get('parameters') as FailureActionParametersElement | undefined;
71+
}
72+
73+
set parameters(parameters: FailureActionParametersElement | undefined) {
74+
this.set('parameters', parameters);
75+
}
76+
6877
get criteria(): FailureActionCriteriaElement | undefined {
6978
return this.get('criteria') as FailureActionCriteriaElement | undefined;
7079
}

packages/apidom-ns-arazzo-1/src/elements/PayloadReplacement.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import {
66
type Meta,
77
} from '@speclynx/apidom-datamodel';
88

9+
import ExpressionTypeElement from './ExpressionType.ts';
10+
911
/**
1012
* @public
1113
*/
@@ -23,6 +25,14 @@ class PayloadReplacement extends ObjectElement {
2325
this.set('target', target);
2426
}
2527

28+
get targetSelectorType(): StringElement | ExpressionTypeElement | undefined {
29+
return this.get('targetSelectorType') as StringElement | ExpressionTypeElement | undefined;
30+
}
31+
32+
set targetSelectorType(targetSelectorType: StringElement | ExpressionTypeElement | undefined) {
33+
this.set('targetSelectorType', targetSelectorType);
34+
}
35+
2636
get value(): Element | undefined {
2737
return this.get('value') as Element | undefined;
2838
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import {
2+
StringElement,
3+
ObjectElement,
4+
type Attributes,
5+
type Meta,
6+
} from '@speclynx/apidom-datamodel';
7+
8+
import ExpressionTypeElement from './ExpressionType.ts';
9+
10+
/**
11+
* @public
12+
*/
13+
class Selector extends ObjectElement {
14+
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
15+
super(content, meta, attributes);
16+
this.element = 'selector';
17+
}
18+
19+
get context(): StringElement | undefined {
20+
return this.get('context') as StringElement | undefined;
21+
}
22+
23+
set context(context: StringElement | undefined) {
24+
this.set('context', context);
25+
}
26+
27+
get selector(): StringElement | undefined {
28+
return this.get('selector') as StringElement | undefined;
29+
}
30+
31+
set selector(selector: StringElement | undefined) {
32+
this.set('selector', selector);
33+
}
34+
35+
get type(): StringElement | ExpressionTypeElement | undefined {
36+
return this.get('type') as StringElement | ExpressionTypeElement | undefined;
37+
}
38+
39+
set type(type: StringElement | ExpressionTypeElement | undefined) {
40+
this.set('type', type);
41+
}
42+
}
43+
44+
export default Selector;

packages/apidom-ns-arazzo-1/src/elements/Step.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
ObjectElement,
33
StringElement,
4+
NumberElement,
45
type Attributes,
56
type Meta,
67
} from '@speclynx/apidom-datamodel';
@@ -11,6 +12,7 @@ import StepSuccessCriteriaElement from './nces/StepSuccessCriteria.ts';
1112
import StepOnSuccessElement from './nces/StepOnSuccess.ts';
1213
import StepOnFailureElement from './nces/StepOnFailure.ts';
1314
import StepOutputsElement from './nces/StepOutputs.ts';
15+
import StepDependsOnElement from './nces/StepDependsOn.ts';
1416

1517
/**
1618
* @public
@@ -53,6 +55,14 @@ class Step extends ObjectElement {
5355
this.set('operationPath', operationPath);
5456
}
5557

58+
get channelPath(): StringElement | undefined {
59+
return this.get('channelPath') as StringElement | undefined;
60+
}
61+
62+
set channelPath(channelPath: StringElement | undefined) {
63+
this.set('channelPath', channelPath);
64+
}
65+
5666
get workflowId(): StringElement | undefined {
5767
return this.get('workflowId') as StringElement | undefined;
5868
}
@@ -108,6 +118,38 @@ class Step extends ObjectElement {
108118
set outputs(outputs: StepOutputsElement | undefined) {
109119
this.set('outputs', outputs);
110120
}
121+
122+
get timeout(): NumberElement | undefined {
123+
return this.get('timeout') as NumberElement | undefined;
124+
}
125+
126+
set timeout(timeout: NumberElement | undefined) {
127+
this.set('timeout', timeout);
128+
}
129+
130+
get correlationId(): StringElement | undefined {
131+
return this.get('correlationId') as StringElement | undefined;
132+
}
133+
134+
set correlationId(correlationId: StringElement | undefined) {
135+
this.set('correlationId', correlationId);
136+
}
137+
138+
get action(): StringElement | undefined {
139+
return this.get('action') as StringElement | undefined;
140+
}
141+
142+
set action(action: StringElement | undefined) {
143+
this.set('action', action);
144+
}
145+
146+
get dependsOn(): StepDependsOnElement | undefined {
147+
return this.get('dependsOn') as StepDependsOnElement | undefined;
148+
}
149+
150+
set dependsOn(dependsOn: StepDependsOnElement | undefined) {
151+
this.set('dependsOn', dependsOn);
152+
}
111153
}
112154

113155
export default Step;

packages/apidom-ns-arazzo-1/src/elements/SuccessAction.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
type Meta,
66
} from '@speclynx/apidom-datamodel';
77

8+
import SuccessActionParametersElement from './nces/SuccessActionParameters.ts';
89
import SuccessActionCriteriaElement from './nces/SuccessActionCriteria.ts';
910

1011
/**
@@ -48,6 +49,14 @@ class SuccessAction extends ObjectElement {
4849
this.set('stepId', stepId);
4950
}
5051

52+
get parameters(): SuccessActionParametersElement | undefined {
53+
return this.get('parameters') as SuccessActionParametersElement | undefined;
54+
}
55+
56+
set parameters(parameters: SuccessActionParametersElement | undefined) {
57+
this.set('parameters', parameters);
58+
}
59+
5160
get criteria(): SuccessActionCriteriaElement | undefined {
5261
return this.get('criteria') as SuccessActionCriteriaElement | undefined;
5362
}

0 commit comments

Comments
 (0)