-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ns-workflows-1): add support for Failure Action Object (#3429)
Refs #3392
- Loading branch information
1 parent
6033c84
commit 7cb6980
Showing
14 changed files
with
355 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
packages/apidom-ns-workflows-1/src/elements/FailureAction.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { | ||
ObjectElement, | ||
ArrayElement, | ||
StringElement, | ||
NumberElement, | ||
Attributes, | ||
Meta, | ||
} from '@swagger-api/apidom-core'; | ||
|
||
class FailureAction extends ObjectElement { | ||
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) { | ||
super(content, meta, attributes); | ||
this.element = 'failureAction'; | ||
} | ||
|
||
get type(): StringElement | undefined { | ||
return this.get('type'); | ||
} | ||
|
||
set type(type: StringElement | undefined) { | ||
this.set('type', type); | ||
} | ||
|
||
get workflowId(): StringElement | undefined { | ||
return this.get('workflowId'); | ||
} | ||
|
||
set workflowId(workflowId: StringElement | undefined) { | ||
this.set('workflowId', workflowId); | ||
} | ||
|
||
get stepId(): StringElement | undefined { | ||
return this.get('stepId'); | ||
} | ||
|
||
set stepId(stepId: StringElement | undefined) { | ||
this.set('stepId', stepId); | ||
} | ||
|
||
get retryAfter(): NumberElement | undefined { | ||
return this.get('retryAfter'); | ||
} | ||
|
||
set retryAfter(retryAfter: NumberElement | undefined) { | ||
this.set('retryAfter', retryAfter); | ||
} | ||
|
||
get retryLimit(): NumberElement | undefined { | ||
return this.get('retryLimit'); | ||
} | ||
|
||
set retryLimit(retryLimit: NumberElement | undefined) { | ||
this.set('retryLimit', retryLimit); | ||
} | ||
|
||
get criteria(): ArrayElement | undefined { | ||
return this.get('criteria'); | ||
} | ||
|
||
set criteria(criteria: ArrayElement | undefined) { | ||
this.set('criteria', criteria); | ||
} | ||
} | ||
|
||
export default FailureAction; |
13 changes: 13 additions & 0 deletions
13
packages/apidom-ns-workflows-1/src/elements/nces/FailureActionCriteria.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ArrayElement, Attributes, Meta } from '@swagger-api/apidom-core'; | ||
|
||
class FailureActionCriteria extends ArrayElement { | ||
static primaryClass = 'failure-action-criteria'; | ||
|
||
constructor(content?: Array<unknown>, meta?: Meta, attributes?: Attributes) { | ||
super(content, meta, attributes); | ||
this.classes.push(FailureActionCriteria.primaryClass); | ||
this.classes.push('criteria'); | ||
} | ||
} | ||
|
||
export default FailureActionCriteria; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
.../apidom-ns-workflows-1/src/refractor/visitors/workflows-1/FailureActionCriteriaVisitor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import stampit from 'stampit'; | ||
import { ArrayElement, Element, BREAK } from '@swagger-api/apidom-core'; | ||
|
||
import FailureActionCriteriaElement from '../../../elements/nces/FailureActionCriteria'; | ||
import SpecificationVisitor from '../SpecificationVisitor'; | ||
import FallbackVisitor from '../FallbackVisitor'; | ||
|
||
const FailureActionCriteriaVisitor = stampit(SpecificationVisitor, FallbackVisitor, { | ||
init() { | ||
this.element = new FailureActionCriteriaElement(); | ||
}, | ||
methods: { | ||
ArrayElement(arrayElement: ArrayElement) { | ||
arrayElement.forEach((item: Element): void => { | ||
const specPath = ['document', 'objects', 'Criterion']; | ||
const element = this.toRefractedElement(specPath, item); | ||
|
||
this.element.push(element); | ||
}); | ||
|
||
this.copyMetaAndAttributes(arrayElement, this.element); | ||
|
||
return BREAK; | ||
}, | ||
}, | ||
}); | ||
|
||
export default FailureActionCriteriaVisitor; |
18 changes: 18 additions & 0 deletions
18
packages/apidom-ns-workflows-1/src/refractor/visitors/workflows-1/failure-action/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import stampit from 'stampit'; | ||
import { always } from 'ramda'; | ||
|
||
import FailureActionElement from '../../../../elements/FailureAction'; | ||
import FallbackVisitor from '../../FallbackVisitor'; | ||
import FixedFieldsVisitor from '../../generics/FixedFieldsVisitor'; | ||
|
||
const FailureActionVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, { | ||
props: { | ||
specPath: always(['document', 'objects', 'FailureAction']), | ||
canSupportSpecificationExtensions: true, | ||
}, | ||
init() { | ||
this.element = new FailureActionElement(); | ||
}, | ||
}); | ||
|
||
export default FailureActionVisitor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.