Skip to main content

@terascope/job-components / builtin/collect/schema / default

Class: default

Defined in: packages/job-components/src/builtin/collect/schema.ts:4

A base class for supporting convict "Schema" definitions

Extends

Constructors

new default()

new default(context, opType): default

Defined in: packages/job-components/src/operations/convict-schema.ts:21

Parameters

ParameterTypeDefault value
contextContextundefined
opTypeOpType'operation'

Returns

default

Inherited from

default.constructor

Properties

PropertyModifierTypeInherited fromDefined in
contextprotectedContextdefault.contextpackages/job-components/src/operations/core/schema-core.ts:8
opTypereadonlyOpTypedefault.opTypepackages/job-components/src/operations/core/schema-core.ts:9
schemapublicSchema<any>default.schemapackages/job-components/src/operations/convict-schema.ts:19

Methods

build()

build(): Record<string, any>

Defined in: packages/job-components/src/builtin/collect/schema.ts:5

Returns

Record<string, any>

Overrides

default.build


ensureAPIFromConfig()

ensureAPIFromConfig(apiName, job, config): void

Defined in: packages/job-components/src/operations/convict-schema.ts:65

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

ParameterType
apiNamestring
jobValidatedJobConfig
configRecord<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' },
]
}

Inherited from

default.ensureAPIFromConfig


validate()

Call Signature

validate(inputConfig): APIConfig & CollectConfig

Defined in: packages/job-components/src/operations/convict-schema.ts:26

Parameters
ParameterType
inputConfigRecord<string, any>
Returns

APIConfig & CollectConfig

Inherited from

default.validate

Call Signature

validate(inputConfig): OpConfig & CollectConfig

Defined in: packages/job-components/src/operations/convict-schema.ts:27

Parameters
ParameterType
inputConfigRecord<string, any>
Returns

OpConfig & CollectConfig

Inherited from

default.validate


validateJob()

validateJob(_job): void

Defined in: packages/job-components/src/operations/convict-schema.ts:36

Parameters

ParameterType
_jobValidatedJobConfig

Returns

void

Inherited from

default.validateJob


type()

static type(): string

Defined in: packages/job-components/src/operations/convict-schema.ts:98

Returns

string

Inherited from

default.type