Job Components: `Operations Convict Schema Default`
operations/convict-schema.default
A base class for supporting convict "Schema" definitions
Type parameters
Name | Type |
---|---|
T | extends Record <string , any > |
S | any |
Hierarchy
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new default<T
, S
>(context
, opType?
): default
<T
, S
>
Type parameters
Name | Type |
---|---|
T | extends Record <string , any > |
S | any |
Parameters
Name | Type | Default value |
---|---|---|
context | Context | undefined |
opType | OpType | 'operation' |
Returns
default
<T
, S
>
Overrides
Defined in
packages/job-components/src/operations/convict-schema.ts:25
Properties
context
• Protected
context: Context
Inherited from
Defined in
packages/job-components/src/operations/core/schema-core.ts:8
opType
• Readonly
opType: OpType
Inherited from
Defined in
packages/job-components/src/operations/core/schema-core.ts:9
schema
• schema: Schema
<S
>
Defined in
packages/job-components/src/operations/convict-schema.ts:23
Methods
build
▸ build<U
>(context?
): Schema
<S
& U
>
Type parameters
Name | Type |
---|---|
U | any |
Parameters
Name | Type |
---|---|
context? | Context |
Returns
Schema
<S
& U
>
Overrides
Defined in
packages/job-components/src/operations/convict-schema.ts:106
ensureAPIFromConfig
▸ ensureAPIFromConfig(apiName
, job
, config
): void
This method will make sure that the api exists on the job, if it does not then it will inject it using apiName provided and with the config key/values provided. If the api does exist it will compare the apiConfig against the provided config. If the key/values do not match, then it will throw
Parameters
Name | Type |
---|---|
apiName | string |
job | ValidatedJobConfig |
config | Record <string , any > |
Returns
void
Example
const job = newTestJobConfig({
operations: [
{ _op: 'test-reader' },
{ _op: 'noop' },
]
});
schema.ensureAPIFromConfig('someApi', job, { some: 'configs' });
job === {
apis: [{ _name: 'someApi', some: 'configs' }],
operations: [
{ _op: 'test-reader' },
{ _op: 'noop' },
]
}
Defined in
packages/job-components/src/operations/convict-schema.ts:69
validate
▸ validate(inputConfig
): APIConfig
& T
Parameters
Name | Type |
---|---|
inputConfig | Record <string , any > |
Returns
APIConfig
& T
Overrides
Defined in
packages/job-components/src/operations/convict-schema.ts:30
▸ validate(inputConfig
): OpConfig
& T
Parameters
Name | Type |
---|---|
inputConfig | Record <string , any > |
Returns
OpConfig
& T
Overrides
SchemaCore.validate
Defined in
packages/job-components/src/operations/convict-schema.ts:31
validateJob
▸ validateJob(_job
): void
Parameters
Name | Type |
---|---|
_job | ValidatedJobConfig |
Returns
void
Overrides
Defined in
packages/job-components/src/operations/convict-schema.ts:40
type
▸ type(): string
Returns
string
Defined in
packages/job-components/src/operations/convict-schema.ts:102