@skmtc/core 0.0.686 → 0.0.688
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/dsl/operation/OperationBase.d.ts +10 -6
- package/esm/dsl/operation/OperationBase.d.ts.map +1 -1
- package/esm/dsl/operation/OperationBase.js +22 -0
- package/esm/dsl/operation/toOperationBase.d.ts +5 -4
- package/esm/dsl/operation/toOperationBase.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/dsl/operation/OperationBase.d.ts +10 -6
- package/script/dsl/operation/OperationBase.d.ts.map +1 -1
- package/script/dsl/operation/OperationBase.js +22 -0
- package/script/dsl/operation/toOperationBase.d.ts +5 -4
- package/script/dsl/operation/toOperationBase.d.ts.map +1 -1
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import type { OperationInsertable } from './types.js';
|
|
2
2
|
import type { OasOperation } from '../../oas/operation/Operation.js';
|
|
3
3
|
import type { ContentSettings } from '../ContentSettings.js';
|
|
4
|
-
import type { BaseRegisterArgs, GenerateContext } from '../../context/GenerateContext.js';
|
|
4
|
+
import type { BaseRegisterArgs, GenerateContext, CreateAndRegisterDefinition, DefineAndRegisterArgs } from '../../context/GenerateContext.js';
|
|
5
5
|
import type { GeneratedValue } from '../../types/GeneratedValue.js';
|
|
6
6
|
import type { GeneratorKey } from '../../types/GeneratorKeys.js';
|
|
7
7
|
import { ContentBase } from '../ContentBase.js';
|
|
8
8
|
import type { Definition } from '../Definition.js';
|
|
9
|
-
import type { Identifier } from '../Identifier.js';
|
|
10
9
|
import type { SchemaToValueFn, SchemaType, TypeSystemOutput } from '../../types/TypeSystem.js';
|
|
11
10
|
import type { Inserted } from '../Inserted.js';
|
|
12
11
|
import type { ModelInsertable } from '../model/types.js';
|
|
13
12
|
import type { RefName } from '../../types/RefName.js';
|
|
13
|
+
import type { Identifier } from '../Identifier.js';
|
|
14
14
|
export type OperationBaseArgs<EnrichmentType = undefined> = {
|
|
15
15
|
context: GenerateContext;
|
|
16
16
|
settings: ContentSettings<EnrichmentType>;
|
|
17
17
|
generatorKey: GeneratorKey;
|
|
18
18
|
operation: OasOperation;
|
|
19
19
|
};
|
|
20
|
-
type
|
|
20
|
+
type CreateAndRegisterCannonicalArgs<Schema extends SchemaType> = {
|
|
21
21
|
schema: Schema;
|
|
22
|
-
|
|
22
|
+
fallbackIdentifier: Identifier;
|
|
23
23
|
schemaToValueFn: SchemaToValueFn;
|
|
24
|
-
rootRef?: RefName;
|
|
25
24
|
};
|
|
26
25
|
export declare class OperationBase<EnrichmentType = undefined> extends ContentBase {
|
|
27
26
|
settings: ContentSettings<EnrichmentType>;
|
|
@@ -30,7 +29,12 @@ export declare class OperationBase<EnrichmentType = undefined> extends ContentBa
|
|
|
30
29
|
constructor({ context, generatorKey, settings, operation }: OperationBaseArgs<EnrichmentType>);
|
|
31
30
|
insertOperation<V extends GeneratedValue, EnrichmentType = undefined>(insertable: OperationInsertable<V, EnrichmentType>, operation: OasOperation): Inserted<V, 'force', EnrichmentType>;
|
|
32
31
|
insertModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName): Inserted<V, 'force', EnrichmentType>;
|
|
33
|
-
|
|
32
|
+
/** @experimental */
|
|
33
|
+
createAndRegisterCannonical<Schema extends SchemaType>({ schema, fallbackIdentifier, schemaToValueFn }: CreateAndRegisterCannonicalArgs<Schema>): TypeSystemOutput<Schema['type']>;
|
|
34
|
+
/** @experimental */
|
|
35
|
+
defineAndRegister<V extends GeneratedValue>({ identifier, value }: Omit<DefineAndRegisterArgs<V>, 'destinationPath'>): Definition<V>;
|
|
36
|
+
/** @experimental */
|
|
37
|
+
createAndRegisterDefinition<Schema extends SchemaType>({ schema, identifier, schemaToValueFn, rootRef }: Omit<CreateAndRegisterDefinition<Schema>, 'destinationPath'>): Definition<TypeSystemOutput<Schema['type']>>;
|
|
34
38
|
register(args: BaseRegisterArgs): void;
|
|
35
39
|
}
|
|
36
40
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"OperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,2BAA2B,EAC3B,qBAAqB,EACtB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC9F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,MAAM,MAAM,iBAAiB,CAA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Ac,EAAE,EAC1C,UAAU,EACV,KAAK,EACN,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;IAQpE,oBAAoB;IACpB,2BAA2B,CAAC,MAAM,SAAS,UAAU,EAAE,EACrD,MAAM,EACN,UAAU,EACV,eAAe,EACf,OAAO,EACR,EAAE,IAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC,GAAG,UAAU,CAC1E,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CACjC;IAUQ,QAAQ,CAAC,IAAI,EAAE,gBAAgB;CAMzC"}
|
|
@@ -36,6 +36,28 @@ export class OperationBase extends ContentBase {
|
|
|
36
36
|
destinationPath: this.settings.exportPath
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
+
/** @experimental */
|
|
40
|
+
createAndRegisterCannonical({ schema, fallbackIdentifier, schemaToValueFn }) {
|
|
41
|
+
const value = schemaToValueFn({
|
|
42
|
+
context: this.context,
|
|
43
|
+
schema,
|
|
44
|
+
destinationPath: this.settings.exportPath,
|
|
45
|
+
required: true,
|
|
46
|
+
rootRef: schema.isRef() ? schema.toRefName() : undefined
|
|
47
|
+
});
|
|
48
|
+
return schema.isRef()
|
|
49
|
+
? value
|
|
50
|
+
: this.defineAndRegister({ identifier: fallbackIdentifier, value }).value;
|
|
51
|
+
}
|
|
52
|
+
/** @experimental */
|
|
53
|
+
defineAndRegister({ identifier, value }) {
|
|
54
|
+
return this.context.defineAndRegister({
|
|
55
|
+
identifier,
|
|
56
|
+
value,
|
|
57
|
+
destinationPath: this.settings.exportPath
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/** @experimental */
|
|
39
61
|
createAndRegisterDefinition({ schema, identifier, schemaToValueFn, rootRef }) {
|
|
40
62
|
return this.context.createAndRegisterDefinition({
|
|
41
63
|
schema,
|
|
@@ -20,12 +20,13 @@ export declare const toOperationBase: <EnrichmentType = undefined>(config: BaseO
|
|
|
20
20
|
generatorKey: import("../../mod.js").GeneratorKey;
|
|
21
21
|
insertOperation<V extends import("../../mod.js").GeneratedValue, EnrichmentType_1 = undefined>(insertable: import("./types.js").OperationInsertable<V, EnrichmentType_1>, operation: OasOperation): import("../Inserted.js").Inserted<V, "force", EnrichmentType_1>;
|
|
22
22
|
insertModel<V extends import("../../mod.js").GeneratedValue, EnrichmentType_2 = undefined>(insertable: import("../model/types.js").ModelInsertable<V, EnrichmentType_2>, refName: import("../../mod.js").RefName): import("../Inserted.js").Inserted<V, "force", EnrichmentType_2>;
|
|
23
|
-
|
|
23
|
+
createAndRegisterCannonical<Schema extends import("../../mod.js").SchemaType>({ schema, fallbackIdentifier, schemaToValueFn }: {
|
|
24
24
|
schema: Schema;
|
|
25
|
-
|
|
25
|
+
fallbackIdentifier: Identifier;
|
|
26
26
|
schemaToValueFn: import("../../mod.js").SchemaToValueFn;
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
}): import("../../mod.js").TypeSystemOutput<Schema["type"]>;
|
|
28
|
+
defineAndRegister<V extends import("../../mod.js").GeneratedValue>({ identifier, value }: Omit<import("../../mod.js").DefineAndRegisterArgs<V>, "destinationPath">): import("../Definition.js").Definition<V>;
|
|
29
|
+
createAndRegisterDefinition<Schema extends import("../../mod.js").SchemaType>({ schema, identifier, schemaToValueFn, rootRef }: Omit<import("../../mod.js").CreateAndRegisterDefinition<Schema>, "destinationPath">): import("../Definition.js").Definition<import("../../mod.js").TypeSystemOutput<Schema["type"]>>;
|
|
29
30
|
register(args: import("../../mod.js").BaseRegisterArgs): void;
|
|
30
31
|
context: GenerateContext;
|
|
31
32
|
skipped: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationBase.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE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V,YAAY,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,UAAU,CAAA;IACrD,YAAY,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,MAAM,CAAA;IACjD,kBAAkB,CAAC,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;CAC9F,CAAA;AAED,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,YAAY,CAAA;IACvB,OAAO,EAAE,eAAe,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,cAAc,GAAG,SAAS,EACxD,QAAQ,mBAAmB,CAAC,cAAc,CAAC;eAoBvB,uBAAuB,CAAC,cAAc,CAAC;;;;;;;;;;;;;;;;;;UAhB3C,WAAW;8BAfD,YAAY,KAAK,UAAU;8BAC3B,YAAY,KAAK,MAAM;oBAmBvB,wBAAwB,iBAAiB,KAAG,cAAc;CAqBrF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import type { OperationInsertable } from './types.js';
|
|
2
2
|
import type { OasOperation } from '../../oas/operation/Operation.js';
|
|
3
3
|
import type { ContentSettings } from '../ContentSettings.js';
|
|
4
|
-
import type { BaseRegisterArgs, GenerateContext } from '../../context/GenerateContext.js';
|
|
4
|
+
import type { BaseRegisterArgs, GenerateContext, CreateAndRegisterDefinition, DefineAndRegisterArgs } from '../../context/GenerateContext.js';
|
|
5
5
|
import type { GeneratedValue } from '../../types/GeneratedValue.js';
|
|
6
6
|
import type { GeneratorKey } from '../../types/GeneratorKeys.js';
|
|
7
7
|
import { ContentBase } from '../ContentBase.js';
|
|
8
8
|
import type { Definition } from '../Definition.js';
|
|
9
|
-
import type { Identifier } from '../Identifier.js';
|
|
10
9
|
import type { SchemaToValueFn, SchemaType, TypeSystemOutput } from '../../types/TypeSystem.js';
|
|
11
10
|
import type { Inserted } from '../Inserted.js';
|
|
12
11
|
import type { ModelInsertable } from '../model/types.js';
|
|
13
12
|
import type { RefName } from '../../types/RefName.js';
|
|
13
|
+
import type { Identifier } from '../Identifier.js';
|
|
14
14
|
export type OperationBaseArgs<EnrichmentType = undefined> = {
|
|
15
15
|
context: GenerateContext;
|
|
16
16
|
settings: ContentSettings<EnrichmentType>;
|
|
17
17
|
generatorKey: GeneratorKey;
|
|
18
18
|
operation: OasOperation;
|
|
19
19
|
};
|
|
20
|
-
type
|
|
20
|
+
type CreateAndRegisterCannonicalArgs<Schema extends SchemaType> = {
|
|
21
21
|
schema: Schema;
|
|
22
|
-
|
|
22
|
+
fallbackIdentifier: Identifier;
|
|
23
23
|
schemaToValueFn: SchemaToValueFn;
|
|
24
|
-
rootRef?: RefName;
|
|
25
24
|
};
|
|
26
25
|
export declare class OperationBase<EnrichmentType = undefined> extends ContentBase {
|
|
27
26
|
settings: ContentSettings<EnrichmentType>;
|
|
@@ -30,7 +29,12 @@ export declare class OperationBase<EnrichmentType = undefined> extends ContentBa
|
|
|
30
29
|
constructor({ context, generatorKey, settings, operation }: OperationBaseArgs<EnrichmentType>);
|
|
31
30
|
insertOperation<V extends GeneratedValue, EnrichmentType = undefined>(insertable: OperationInsertable<V, EnrichmentType>, operation: OasOperation): Inserted<V, 'force', EnrichmentType>;
|
|
32
31
|
insertModel<V extends GeneratedValue, EnrichmentType = undefined>(insertable: ModelInsertable<V, EnrichmentType>, refName: RefName): Inserted<V, 'force', EnrichmentType>;
|
|
33
|
-
|
|
32
|
+
/** @experimental */
|
|
33
|
+
createAndRegisterCannonical<Schema extends SchemaType>({ schema, fallbackIdentifier, schemaToValueFn }: CreateAndRegisterCannonicalArgs<Schema>): TypeSystemOutput<Schema['type']>;
|
|
34
|
+
/** @experimental */
|
|
35
|
+
defineAndRegister<V extends GeneratedValue>({ identifier, value }: Omit<DefineAndRegisterArgs<V>, 'destinationPath'>): Definition<V>;
|
|
36
|
+
/** @experimental */
|
|
37
|
+
createAndRegisterDefinition<Schema extends SchemaType>({ schema, identifier, schemaToValueFn, rootRef }: Omit<CreateAndRegisterDefinition<Schema>, 'destinationPath'>): Definition<TypeSystemOutput<Schema['type']>>;
|
|
34
38
|
register(args: BaseRegisterArgs): void;
|
|
35
39
|
}
|
|
36
40
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"OperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,2BAA2B,EAC3B,qBAAqB,EACtB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC9F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,M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N,kBAAkB,EAClB,eAAe,EAChB,EAAE,+BAA+B,CAAC,MAAM,CAAC,GAAG,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAc7E,oBAAoB;IACpB,iBAAiB,CAAC,CAAC,SAAS,cAAc,EAAE,EAC1C,UAAU,EACV,KAAK,EACN,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,iBAAiB,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;IAQpE,oBAAoB;IACpB,2BAA2B,CAAC,MAAM,SAAS,UAAU,EAAE,EACrD,MAAM,EACN,UAAU,EACV,eAAe,EACf,OAAO,EACR,EAAE,IAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC,GAAG,UAAU,CAC1E,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CACjC;IAUQ,QAAQ,CAAC,IAAI,EAAE,gBAAgB;CAMzC"}
|
|
@@ -39,6 +39,28 @@ class OperationBase extends ContentBase_js_1.ContentBase {
|
|
|
39
39
|
destinationPath: this.settings.exportPath
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
+
/** @experimental */
|
|
43
|
+
createAndRegisterCannonical({ schema, fallbackIdentifier, schemaToValueFn }) {
|
|
44
|
+
const value = schemaToValueFn({
|
|
45
|
+
context: this.context,
|
|
46
|
+
schema,
|
|
47
|
+
destinationPath: this.settings.exportPath,
|
|
48
|
+
required: true,
|
|
49
|
+
rootRef: schema.isRef() ? schema.toRefName() : undefined
|
|
50
|
+
});
|
|
51
|
+
return schema.isRef()
|
|
52
|
+
? value
|
|
53
|
+
: this.defineAndRegister({ identifier: fallbackIdentifier, value }).value;
|
|
54
|
+
}
|
|
55
|
+
/** @experimental */
|
|
56
|
+
defineAndRegister({ identifier, value }) {
|
|
57
|
+
return this.context.defineAndRegister({
|
|
58
|
+
identifier,
|
|
59
|
+
value,
|
|
60
|
+
destinationPath: this.settings.exportPath
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/** @experimental */
|
|
42
64
|
createAndRegisterDefinition({ schema, identifier, schemaToValueFn, rootRef }) {
|
|
43
65
|
return this.context.createAndRegisterDefinition({
|
|
44
66
|
schema,
|
|
@@ -20,12 +20,13 @@ export declare const toOperationBase: <EnrichmentType = undefined>(config: BaseO
|
|
|
20
20
|
generatorKey: import("../../types/GeneratorKeys.js").GeneratorKey;
|
|
21
21
|
insertOperation<V extends import("../../mod.js").GeneratedValue, EnrichmentType_1 = undefined>(insertable: import("./types.js").OperationInsertable<V, EnrichmentType_1>, operation: OasOperation): import("../Inserted.js").Inserted<V, "force", EnrichmentType_1>;
|
|
22
22
|
insertModel<V extends import("../../mod.js").GeneratedValue, EnrichmentType_2 = undefined>(insertable: import("../model/types.js").ModelInsertable<V, EnrichmentType_2>, refName: import("../../mod.js").RefName): import("../Inserted.js").Inserted<V, "force", EnrichmentType_2>;
|
|
23
|
-
|
|
23
|
+
createAndRegisterCannonical<Schema extends import("../../mod.js").SchemaType>({ schema, fallbackIdentifier, schemaToValueFn }: {
|
|
24
24
|
schema: Schema;
|
|
25
|
-
|
|
25
|
+
fallbackIdentifier: Identifier;
|
|
26
26
|
schemaToValueFn: import("../../mod.js").SchemaToValueFn;
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
}): import("../../mod.js").TypeSystemOutput<Schema["type"]>;
|
|
28
|
+
defineAndRegister<V extends import("../../mod.js").GeneratedValue>({ identifier, value }: Omit<import("../../context/GenerateContext.js").DefineAndRegisterArgs<V>, "destinationPath">): import("../Definition.js").Definition<V>;
|
|
29
|
+
createAndRegisterDefinition<Schema extends import("../../mod.js").SchemaType>({ schema, identifier, schemaToValueFn, rootRef }: Omit<import("../../context/GenerateContext.js").CreateAndRegisterDefinition<Schema>, "destinationPath">): import("../Definition.js").Definition<import("../../mod.js").TypeSystemOutput<Schema["type"]>>;
|
|
29
30
|
register(args: import("../../context/GenerateContext.js").BaseRegisterArgs): void;
|
|
30
31
|
context: GenerateContext;
|
|
31
32
|
skipped: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationBase.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAEpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAI5B,MAAM,MAAM,mBAAmB,CAAC,cAAc,GAAG,SAAS,IAAI;IAC5D,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,UAAU,CAAA;IACrD,YAAY,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,MAAM,CAAA;IACjD,kBAAkB,CAAC,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,cAAc,EAAE,cAAc,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;CAC9F,CAAA;AAED,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,YAAY,CAAA;IACvB,OAAO,EAAE,eAAe,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,cAAc,GAAG,SAAS,EACxD,QAAQ,mBAAmB,CAAC,cAAc,CAAC;eAoBvB,uBAAuB,CAAC,cAAc,CAAC
|
|
1
|
+
{"version":3,"file":"toOperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationBase.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAEpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,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