@terascope/job-components / builtin/test-reader/schema / default
Class: default
A base class for supporting convict "Schema" definitions
Extends
Constructors
new default()
new default(
context
,opType
):default
Parameters
Parameter | Type | Default value |
---|---|---|
context | Context | undefined |
opType | OpType | 'operation' |
Returns
Inherited from
Source
packages/job-components/src/operations/convict-schema.ts:21
Properties
context
protected
context:Context
Inherited from
Source
packages/job-components/src/operations/core/schema-core.ts:8
opType
readonly
opType:OpType
Inherited from
Source
packages/job-components/src/operations/core/schema-core.ts:9
schema
schema:
Schema
<any
>
Inherited from
Source
packages/job-components/src/operations/convict-schema.ts:19
Methods
build()
build():
Record
<string
,any
>
Returns
Record
<string
, any
>
Overrides
Source
packages/job-components/src/builtin/test-reader/schema.ts:5
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
Parameter | Type |
---|---|
apiName | string |
job | ValidatedJobConfig |
config | Record <string , any > |
Returns
void
Inherited from
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' },
]
}
Source
packages/job-components/src/operations/convict-schema.ts:65
validate()
validate(inputConfig)
validate(
inputConfig
):APIConfig
&TestReaderConfig
Parameters
Parameter | Type |
---|---|
inputConfig | Record <string , any > |
Returns
Inherited from
Source
packages/job-components/src/operations/convict-schema.ts:26
validate(inputConfig)
validate(
inputConfig
):OpConfig
&TestReaderConfig
Parameters
Parameter | Type |
---|---|
inputConfig | Record <string , any > |
Returns
Inherited from
Source
packages/job-components/src/operations/convict-schema.ts:27
validateJob()
validateJob(
_job
):void
Parameters
Parameter | Type |
---|---|
_job | ValidatedJobConfig |
Returns
void
Inherited from
Source
packages/job-components/src/operations/convict-schema.ts:36
type()
static
type():string
Returns
string