@skmtc/core 0.0.338 → 0.0.340
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/context/CoreContext.d.ts +2 -2
- package/esm/context/CoreContext.d.ts.map +1 -1
- package/esm/context/CoreContext.js +4 -4
- package/esm/context/GenerateContext.d.ts +5 -5
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +64 -32
- package/esm/context/ParseContext.d.ts +1 -1
- package/esm/context/ParseContext.d.ts.map +1 -1
- package/esm/context/ParseContext.js +11 -11
- package/esm/dsl/GeneratorBase.d.ts +6 -0
- package/esm/dsl/GeneratorBase.d.ts.map +1 -0
- package/esm/dsl/GeneratorBase.js +11 -0
- package/esm/dsl/model/ModelBase.d.ts +21 -0
- package/esm/dsl/model/ModelBase.d.ts.map +1 -0
- package/esm/dsl/model/ModelBase.js +34 -0
- package/esm/dsl/{ModelDriver.d.ts → model/ModelDriver.d.ts} +5 -5
- package/esm/dsl/model/ModelDriver.d.ts.map +1 -0
- package/esm/dsl/{ModelDriver.js → model/ModelDriver.js} +4 -4
- package/{script/dsl → esm/dsl/model}/ModelInsertable.d.ts +18 -12
- package/esm/dsl/model/ModelInsertable.d.ts.map +1 -0
- package/esm/dsl/model/toModelConfig.d.ts +47 -0
- package/esm/dsl/model/toModelConfig.d.ts.map +1 -0
- package/esm/dsl/model/toModelConfig.js +92 -0
- package/esm/dsl/operation/OperationBase.d.ts +34 -0
- package/esm/dsl/operation/OperationBase.d.ts.map +1 -0
- package/esm/dsl/{base.js → operation/OperationBase.js} +4 -35
- package/esm/dsl/{OperationDriver.d.ts → operation/OperationDriver.d.ts} +5 -5
- package/esm/dsl/operation/OperationDriver.d.ts.map +1 -0
- package/esm/dsl/{OperationDriver.js → operation/OperationDriver.js} +4 -4
- package/{script/dsl → esm/dsl/operation}/OperationInsertable.d.ts +12 -8
- package/esm/dsl/operation/OperationInsertable.d.ts.map +1 -0
- package/esm/dsl/operation/toOperationConfig.d.ts +61 -0
- package/esm/dsl/operation/toOperationConfig.d.ts.map +1 -0
- package/esm/dsl/operation/toOperationConfig.js +116 -0
- package/esm/mod.d.ts +13 -10
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +13 -10
- package/esm/oas/components/Components.d.ts +1 -0
- package/esm/oas/components/Components.d.ts.map +1 -1
- package/esm/oas/components/Components.js +3 -0
- package/esm/oas/document/toDocumentFieldsV3.d.ts +2 -2
- package/esm/oas/document/toDocumentFieldsV3.d.ts.map +1 -1
- package/esm/oas/document/toDocumentFieldsV3.js +2 -2
- package/esm/oas/ref/Ref.d.ts +2 -2
- package/esm/oas/ref/Ref.d.ts.map +1 -1
- package/esm/oas/ref/Ref.js +8 -8
- package/esm/oas/ref/toRefV31.js +1 -1
- package/esm/server/createServer.d.ts +2 -2
- package/esm/server/createServer.d.ts.map +1 -1
- package/esm/transform/transform.d.ts +2 -2
- package/esm/transform/transform.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/context/CoreContext.d.ts +2 -2
- package/script/context/CoreContext.d.ts.map +1 -1
- package/script/context/CoreContext.js +4 -4
- package/script/context/GenerateContext.d.ts +5 -5
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +64 -32
- package/script/context/ParseContext.d.ts +1 -1
- package/script/context/ParseContext.d.ts.map +1 -1
- package/script/context/ParseContext.js +11 -11
- package/script/dsl/GeneratorBase.d.ts +6 -0
- package/script/dsl/GeneratorBase.d.ts.map +1 -0
- package/script/dsl/GeneratorBase.js +15 -0
- package/script/dsl/model/ModelBase.d.ts +21 -0
- package/script/dsl/model/ModelBase.d.ts.map +1 -0
- package/script/dsl/model/ModelBase.js +38 -0
- package/script/dsl/{ModelDriver.d.ts → model/ModelDriver.d.ts} +5 -5
- package/script/dsl/model/ModelDriver.d.ts.map +1 -0
- package/script/dsl/{ModelDriver.js → model/ModelDriver.js} +4 -4
- package/{esm/dsl → script/dsl/model}/ModelInsertable.d.ts +18 -12
- package/script/dsl/model/ModelInsertable.d.ts.map +1 -0
- package/script/dsl/model/toModelConfig.d.ts +47 -0
- package/script/dsl/model/toModelConfig.d.ts.map +1 -0
- package/script/dsl/model/toModelConfig.js +96 -0
- package/script/dsl/operation/OperationBase.d.ts +34 -0
- package/script/dsl/operation/OperationBase.d.ts.map +1 -0
- package/script/dsl/{base.js → operation/OperationBase.js} +5 -37
- package/script/dsl/{OperationDriver.d.ts → operation/OperationDriver.d.ts} +5 -5
- package/script/dsl/operation/OperationDriver.d.ts.map +1 -0
- package/script/dsl/{OperationDriver.js → operation/OperationDriver.js} +4 -4
- package/{esm/dsl → script/dsl/operation}/OperationInsertable.d.ts +12 -8
- package/script/dsl/operation/OperationInsertable.d.ts.map +1 -0
- package/script/dsl/operation/toOperationConfig.d.ts +61 -0
- package/script/dsl/operation/toOperationConfig.d.ts.map +1 -0
- package/script/dsl/operation/toOperationConfig.js +120 -0
- package/script/mod.d.ts +13 -10
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +13 -10
- package/script/oas/components/Components.d.ts +1 -0
- package/script/oas/components/Components.d.ts.map +1 -1
- package/script/oas/components/Components.js +3 -0
- package/script/oas/document/toDocumentFieldsV3.d.ts +2 -2
- package/script/oas/document/toDocumentFieldsV3.d.ts.map +1 -1
- package/script/oas/document/toDocumentFieldsV3.js +2 -2
- package/script/oas/ref/Ref.d.ts +2 -2
- package/script/oas/ref/Ref.d.ts.map +1 -1
- package/script/oas/ref/Ref.js +8 -8
- package/script/oas/ref/toRefV31.js +1 -1
- package/script/server/createServer.d.ts +2 -2
- package/script/server/createServer.d.ts.map +1 -1
- package/script/transform/transform.d.ts +2 -2
- package/script/transform/transform.d.ts.map +1 -1
- package/esm/dsl/ModelDriver.d.ts.map +0 -1
- package/esm/dsl/ModelInsertable.d.ts.map +0 -1
- package/esm/dsl/OperationDriver.d.ts.map +0 -1
- package/esm/dsl/OperationInsertable.d.ts.map +0 -1
- package/esm/dsl/base.d.ts +0 -56
- package/esm/dsl/base.d.ts.map +0 -1
- package/esm/dsl/withConfig.d.ts +0 -115
- package/esm/dsl/withConfig.d.ts.map +0 -1
- package/esm/dsl/withConfig.js +0 -138
- package/script/dsl/ModelDriver.d.ts.map +0 -1
- package/script/dsl/ModelInsertable.d.ts.map +0 -1
- package/script/dsl/OperationDriver.d.ts.map +0 -1
- package/script/dsl/OperationInsertable.d.ts.map +0 -1
- package/script/dsl/base.d.ts +0 -56
- package/script/dsl/base.d.ts.map +0 -1
- package/script/dsl/withConfig.d.ts +0 -115
- package/script/dsl/withConfig.d.ts.map +0 -1
- package/script/dsl/withConfig.js +0 -144
- /package/esm/dsl/{ModelInsertable.js → model/ModelInsertable.js} +0 -0
- /package/esm/dsl/{OperationInsertable.js → operation/OperationInsertable.js} +0 -0
- /package/script/dsl/{ModelInsertable.js → model/ModelInsertable.js} +0 -0
- /package/script/dsl/{OperationInsertable.js → operation/OperationInsertable.js} +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
2
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
3
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
4
|
+
};
|
|
5
|
+
import { toModelGeneratorKey } from '../../types/GeneratorKeys.js';
|
|
6
|
+
import { EntityType } from '../EntityType.js';
|
|
7
|
+
import { GeneratorBase } from '../GeneratorBase.js';
|
|
8
|
+
import { ModelBase } from './ModelBase.js';
|
|
9
|
+
export const toModelConfig = ({ id, entityType, toName, toExportPath, isSelected }) => {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const ModelInsertable = (_a = class extends ModelBase {
|
|
12
|
+
constructor(args) {
|
|
13
|
+
super({
|
|
14
|
+
...args,
|
|
15
|
+
generatorKey: toModelGeneratorKey({
|
|
16
|
+
generatorId: id,
|
|
17
|
+
refName: args.refName
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
__setFunctionName(_a, "ModelInsertable"),
|
|
23
|
+
Object.defineProperty(_a, "id", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: id
|
|
28
|
+
}),
|
|
29
|
+
Object.defineProperty(_a, "type", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: 'model'
|
|
34
|
+
}),
|
|
35
|
+
Object.defineProperty(_a, "entityType", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true,
|
|
39
|
+
value: entityType ?? new EntityType('variable')
|
|
40
|
+
}),
|
|
41
|
+
Object.defineProperty(_a, "toName", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
configurable: true,
|
|
44
|
+
writable: true,
|
|
45
|
+
value: toName
|
|
46
|
+
}),
|
|
47
|
+
Object.defineProperty(_a, "toExportPath", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
configurable: true,
|
|
50
|
+
writable: true,
|
|
51
|
+
value: toExportPath
|
|
52
|
+
}),
|
|
53
|
+
Object.defineProperty(_a, "isSelected", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
configurable: true,
|
|
56
|
+
writable: true,
|
|
57
|
+
value: isSelected
|
|
58
|
+
}),
|
|
59
|
+
Object.defineProperty(_a, "pinnable", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true,
|
|
62
|
+
writable: true,
|
|
63
|
+
value: false
|
|
64
|
+
}),
|
|
65
|
+
_a);
|
|
66
|
+
const ModelGenerator = (_b = class extends GeneratorBase {
|
|
67
|
+
constructor(context) {
|
|
68
|
+
super(context);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
__setFunctionName(_b, "ModelGenerator"),
|
|
72
|
+
Object.defineProperty(_b, "id", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
configurable: true,
|
|
75
|
+
writable: true,
|
|
76
|
+
value: id
|
|
77
|
+
}),
|
|
78
|
+
Object.defineProperty(_b, "type", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
configurable: true,
|
|
81
|
+
writable: true,
|
|
82
|
+
value: 'model'
|
|
83
|
+
}),
|
|
84
|
+
Object.defineProperty(_b, "pinnable", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
configurable: true,
|
|
87
|
+
writable: true,
|
|
88
|
+
value: false
|
|
89
|
+
}),
|
|
90
|
+
_b);
|
|
91
|
+
return { ModelInsertable, ModelGenerator };
|
|
92
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { OperationInsertable } from './OperationInsertable.js';
|
|
2
|
+
import type { OasOperation } from '../../oas/operation/Operation.js';
|
|
3
|
+
import type { ContentSettings } from '../ContentSettings.js';
|
|
4
|
+
import type { GenerateContext, RegisterArgs } from '../../context/GenerateContext.js';
|
|
5
|
+
import type { GeneratedValue } from '../../types/GeneratedValue.js';
|
|
6
|
+
import type { GeneratorKey } from '../../types/GeneratorKeys.js';
|
|
7
|
+
import { ValueBase } from '../ValueBase.js';
|
|
8
|
+
import type { Definition } from '../Definition.js';
|
|
9
|
+
import type { Identifier } from '../Identifier.js';
|
|
10
|
+
import type { SchemaToValueFn, SchemaType, TypeSystemOutput } from '../../types/TypeSystem.js';
|
|
11
|
+
export type OperationBaseArgs = {
|
|
12
|
+
context: GenerateContext;
|
|
13
|
+
settings: ContentSettings;
|
|
14
|
+
generatorKey: GeneratorKey;
|
|
15
|
+
operation: OasOperation;
|
|
16
|
+
};
|
|
17
|
+
type CreateAndRegisterDefinition<Schema extends SchemaType> = {
|
|
18
|
+
schema: Schema;
|
|
19
|
+
identifier: Identifier;
|
|
20
|
+
schemaToValueFn: SchemaToValueFn;
|
|
21
|
+
};
|
|
22
|
+
export declare class OperationBase extends ValueBase {
|
|
23
|
+
settings: ContentSettings;
|
|
24
|
+
operation: OasOperation;
|
|
25
|
+
constructor({ context, generatorKey, settings, operation }: OperationBaseArgs);
|
|
26
|
+
insert<V extends GeneratedValue>(insertable: OperationInsertable<V>, operation: OasOperation): {
|
|
27
|
+
settings: ContentSettings;
|
|
28
|
+
definition: Definition<V>;
|
|
29
|
+
};
|
|
30
|
+
createAndRegisterDefinition<Schema extends SchemaType>({ schema, identifier, schemaToValueFn }: CreateAndRegisterDefinition<Schema>): Definition<TypeSystemOutput<Schema['type']>>;
|
|
31
|
+
register(args: Partial<RegisterArgs>): void;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=OperationBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationBase.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,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,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,gBAAgB,EACjB,MAAM,2BAA2B,CAAA;AAElC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE,eAAe,CAAA;IACzB,YAAY,EAAE,YAAY,CAAA;IAC1B,SAAS,EAAE,YAAY,CAAA;CACxB,CAAA;AAED,KAAK,2BAA2B,CAAC,MAAM,SAAS,UAAU,IAAI;IAC5D,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,UAAU,CAAA;IACtB,eAAe,EAAE,eAAe,CAAA;CACjC,CAAA;AAED,qBAAa,aAAc,SAAQ,SAAS;IAC1C,QAAQ,EAAE,eAAe,CAAA;IACzB,SAAS,EAAE,YAAY,CAAA;gBAEX,EACV,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,SAAS,EACV,EAAE,iBAAiB;IAOpB,MAAM,CAAC,CAAC,SAAS,cAAc,EAC7B,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC,EAClC,SAAS,EAAE,YAAY,GACtB;QAAE,QAAQ,EAAE,eAAe,CAAC;QAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,CAAA;KAAE;IAa3D,2BAA2B,CAAC,MAAM,SAAS,UAAU,EAAE,EACrD,MAAM,EACN,UAAU,EACV,eAAe,EAChB,EAAE,2BAA2B,CAAC,MAAM,CAAC,GAAG,UAAU,CACjD,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CACjC;IASD,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC;CAMrC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValueBase } from '
|
|
1
|
+
import { ValueBase } from '../ValueBase.js';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
export class OperationBase extends ValueBase {
|
|
4
4
|
constructor({ context, generatorKey, settings, operation }) {
|
|
@@ -18,9 +18,10 @@ export class OperationBase extends ValueBase {
|
|
|
18
18
|
this.operation = operation;
|
|
19
19
|
this.settings = settings;
|
|
20
20
|
}
|
|
21
|
-
insert(
|
|
21
|
+
insert(insertable, operation) {
|
|
22
22
|
const { settings, definition } = this.context.insert({
|
|
23
|
-
|
|
23
|
+
insertable,
|
|
24
|
+
operation,
|
|
24
25
|
generation: 'force',
|
|
25
26
|
destinationPath: this.settings.exportPath
|
|
26
27
|
});
|
|
@@ -42,35 +43,3 @@ export class OperationBase extends ValueBase {
|
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
|
-
export class ModelBase extends ValueBase {
|
|
46
|
-
constructor({ context, settings, generatorKey, refName }) {
|
|
47
|
-
super({ context, generatorKey });
|
|
48
|
-
Object.defineProperty(this, "settings", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
configurable: true,
|
|
51
|
-
writable: true,
|
|
52
|
-
value: void 0
|
|
53
|
-
});
|
|
54
|
-
Object.defineProperty(this, "refName", {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
configurable: true,
|
|
57
|
-
writable: true,
|
|
58
|
-
value: void 0
|
|
59
|
-
});
|
|
60
|
-
this.refName = refName;
|
|
61
|
-
this.settings = settings;
|
|
62
|
-
}
|
|
63
|
-
transform(args) {
|
|
64
|
-
this.context.insert({
|
|
65
|
-
...args,
|
|
66
|
-
generation: 'force',
|
|
67
|
-
destinationPath: this.settings.exportPath
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
register(args) {
|
|
71
|
-
this.context.register({
|
|
72
|
-
...args,
|
|
73
|
-
destinationPath: args.destinationPath ?? this.settings.exportPath
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { OperationInsertable } from './OperationInsertable.js';
|
|
2
|
-
import type { OasOperation } from '
|
|
3
|
-
import type { ContentSettings } from '
|
|
4
|
-
import type { GeneratedDefintion, GenerationType } from '
|
|
5
|
-
import type { GeneratedValue } from '
|
|
6
|
-
import type { GenerateContext } from '
|
|
2
|
+
import type { OasOperation } from '../../oas/operation/Operation.js';
|
|
3
|
+
import type { ContentSettings } from '../ContentSettings.js';
|
|
4
|
+
import type { GeneratedDefintion, GenerationType } from '../../types/GeneratedValue.js';
|
|
5
|
+
import type { GeneratedValue } from '../../types/GeneratedValue.js';
|
|
6
|
+
import type { GenerateContext } from '../../context/GenerateContext.js';
|
|
7
7
|
type CreateOperationArgs<V extends GeneratedValue, T extends GenerationType> = {
|
|
8
8
|
context: GenerateContext;
|
|
9
9
|
insertable: OperationInsertable<V>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationDriver.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationDriver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAI5D,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACf,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAGnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE,KAAK,mBAAmB,CAAC,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,cAAc,IAAI;IAC7E,OAAO,EAAE,eAAe,CAAA;IACxB,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;IAClC,SAAS,EAAE,YAAY,CAAA;IACvB,UAAU,CAAC,EAAE,CAAC,CAAA;IACd,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AAYD,qBAAa,eAAe,CAC1B,CAAC,SAAS,cAAc,EACxB,CAAC,SAAS,cAAc;IAExB,OAAO,EAAE,eAAe,CAAA;IACxB,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;IAClC,SAAS,EAAE,YAAY,CAAA;IACvB,QAAQ,EAAE,eAAe,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;gBAExB,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EAChB,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC;IAc5B,IAAI,KAAK,IAAI,CAAC,CAQb;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,OAAO,CAAC,KAAK;IAyBb,OAAO,CAAC,aAAa;IAyCrB,OAAO,CAAC,gBAAgB;CAoBzB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { normalize } from '
|
|
2
|
-
import { Definition } from '
|
|
3
|
-
import { Identifier } from '
|
|
1
|
+
import { normalize } from '../../deps/jsr.io/@std/path/1.0.0/mod.js';
|
|
2
|
+
import { Definition } from '../Definition.js';
|
|
3
|
+
import { Identifier } from '../Identifier.js';
|
|
4
4
|
import { match } from 'ts-pattern';
|
|
5
|
-
import { toOperationGeneratorKey } from '
|
|
5
|
+
import { toOperationGeneratorKey } from '../../types/GeneratorKeys.js';
|
|
6
6
|
export class OperationDriver {
|
|
7
7
|
constructor({ context, insertable, operation, generation, destinationPath }) {
|
|
8
8
|
Object.defineProperty(this, "context", {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { OasOperation } from '
|
|
2
|
-
import type { ContentSettings } from '
|
|
3
|
-
import type { BaseSettings } from '
|
|
4
|
-
import type { EntityType } from '
|
|
5
|
-
import type { GenerateContext } from '
|
|
6
|
-
type
|
|
1
|
+
import type { OasOperation } from '../../oas/operation/Operation.js';
|
|
2
|
+
import type { ContentSettings } from '../ContentSettings.js';
|
|
3
|
+
import type { BaseSettings } from '../../types/Settings.js';
|
|
4
|
+
import type { EntityType } from '../EntityType.js';
|
|
5
|
+
import type { GenerateContext } from '../../context/GenerateContext.js';
|
|
6
|
+
type OperationInsertableConstructorArgs = {
|
|
7
7
|
context: GenerateContext;
|
|
8
8
|
settings: ContentSettings;
|
|
9
9
|
operation: OasOperation;
|
|
@@ -27,18 +27,22 @@ export type OperationGenerator = {
|
|
|
27
27
|
new (context: GenerateContext): WithTransformOperation;
|
|
28
28
|
id: string;
|
|
29
29
|
type: 'operation';
|
|
30
|
-
|
|
30
|
+
_class: 'OperationGenerator';
|
|
31
|
+
pinnable: boolean;
|
|
31
32
|
isSupported: (operation: OasOperation) => boolean;
|
|
32
33
|
};
|
|
33
34
|
export type OperationInsertable<V> = {
|
|
34
35
|
prototype: V;
|
|
35
36
|
} & {
|
|
37
|
+
new ({ context, settings, operation }: OperationInsertableConstructorArgs): V;
|
|
36
38
|
id: string;
|
|
37
|
-
|
|
39
|
+
type: 'operation';
|
|
40
|
+
_class: 'OperationInsertable';
|
|
38
41
|
entityType: EntityType;
|
|
39
42
|
toName: ({ operation, baseSettings }: ToOperationNameArgs) => string;
|
|
40
43
|
toExportPath: ({ operation, baseSettings }: ToOperationExportPathArgs) => string;
|
|
41
44
|
isSelected: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
|
|
45
|
+
isSupported: (operation: OasOperation) => boolean;
|
|
42
46
|
} & Function;
|
|
43
47
|
export {};
|
|
44
48
|
//# sourceMappingURL=OperationInsertable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationInsertable.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/OperationInsertable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAEvE,KAAK,kCAAkC,GAAG;IACxC,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE,eAAe,CAAA;IACzB,SAAS,EAAE,YAAY,C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AAE,EAAE,uBAAuB,KAAK,OAAO,CAAA;IAC7E,WAAW,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,OAAO,CAAA;CAElD,GAAG,QAAQ,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { EntityType } from '../EntityType.js';
|
|
2
|
+
import type { GenerateContext } from '../../context/GenerateContext.js';
|
|
3
|
+
import type { OasOperation } from '../../oas/operation/Operation.js';
|
|
4
|
+
import type { ContentSettings } from '../ContentSettings.js';
|
|
5
|
+
import type { ToOperationNameArgs, ToOperationExportPathArgs, IsOperationSelectedArgs } from './OperationInsertable.js';
|
|
6
|
+
export type OperationInsertableArgs = {
|
|
7
|
+
context: GenerateContext;
|
|
8
|
+
settings: ContentSettings;
|
|
9
|
+
operation: OasOperation;
|
|
10
|
+
};
|
|
11
|
+
type ToOperationConfigArgs = {
|
|
12
|
+
id: string;
|
|
13
|
+
entityType?: EntityType;
|
|
14
|
+
toName: ({ operation, baseSettings }: ToOperationNameArgs) => string;
|
|
15
|
+
toExportPath: ({ operation, baseSettings }: ToOperationExportPathArgs) => string;
|
|
16
|
+
isSelected?: ({ operation, baseSettings }: IsOperationSelectedArgs) => boolean;
|
|
17
|
+
isSupported?: (operation: OasOperation) => boolean;
|
|
18
|
+
pinnable?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare const toOperationConfig: ({ id, entityType, toName, toExportPath, isSelected, isSupported, pinnable }: ToOperationConfigArgs) => {
|
|
21
|
+
OperationInsertable: {
|
|
22
|
+
new (args: OperationInsertableArgs): {
|
|
23
|
+
settings: ContentSettings;
|
|
24
|
+
operation: OasOperation;
|
|
25
|
+
insert<V extends import("../../mod.js").GeneratedValue>(insertable: import("./OperationInsertable.js").OperationInsertable<V>, operation: OasOperation): {
|
|
26
|
+
settings: ContentSettings;
|
|
27
|
+
definition: import("../Definition.js").Definition<V>;
|
|
28
|
+
};
|
|
29
|
+
createAndRegisterDefinition<Schema extends import("../../mod.js").SchemaType>({ schema, identifier, schemaToValueFn }: {
|
|
30
|
+
schema: Schema;
|
|
31
|
+
identifier: import("../Identifier.js").Identifier;
|
|
32
|
+
schemaToValueFn: import("../../mod.js").SchemaToValueFn;
|
|
33
|
+
}): import("../Definition.js").Definition<import("../../mod.js").TypeSystemOutput<Schema["type"]>>;
|
|
34
|
+
register(args: Partial<import("../../context/GenerateContext.js").RegisterArgs>): void;
|
|
35
|
+
context: GenerateContext;
|
|
36
|
+
skipped: boolean;
|
|
37
|
+
generatorKey: import("../../types/GeneratorKeys.js").GeneratorKey | undefined;
|
|
38
|
+
};
|
|
39
|
+
id: string;
|
|
40
|
+
type: string;
|
|
41
|
+
_class: string;
|
|
42
|
+
entityType: EntityType;
|
|
43
|
+
toName: ({ operation, baseSettings }: ToOperationNameArgs) => string;
|
|
44
|
+
toExportPath: ({ operation, baseSettings }: ToOperationExportPathArgs) => string;
|
|
45
|
+
isSelected: (({ operation, baseSettings }: IsOperationSelectedArgs) => boolean) | undefined;
|
|
46
|
+
isSupported: (operation: OasOperation) => boolean;
|
|
47
|
+
pinnable: boolean;
|
|
48
|
+
};
|
|
49
|
+
OperationGenerator: {
|
|
50
|
+
new (context: GenerateContext): {
|
|
51
|
+
context: GenerateContext;
|
|
52
|
+
};
|
|
53
|
+
id: string;
|
|
54
|
+
type: string;
|
|
55
|
+
_class: string;
|
|
56
|
+
isSupported: (operation: OasOperation) => boolean;
|
|
57
|
+
pinnable: boolean;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=toOperationConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toOperationConfig.d.ts","sourceRoot":"","sources":["../../../src/dsl/operation/toOperationConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,0BAA0B,CAAA;AAIjC,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAE,eAAe,CAAA;IACzB,SAAS,EAAE,YAAY,CAAA;CACxB,CAAA;AAED,KAAK,qBAAqB,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,mBAAmB,KAAK,MAAM,CAAA;IACpE,YAAY,EAAE,CAAC,EACb,SAAS,EACT,YAAY,EACb,EAAE,yBAAyB,KAAK,MAAM,CAAA;IACvC,UAAU,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,uBAAuB,KAAK,OAAO,CAAA;IAC9E,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,KAAK,OAAO,CAAA;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,iBAAiB,gFAQ3B,qBAAqB;;mBAYF,uBAAuB;;;;;;;;;;;;;;;;;;;;;8CA9BL,mBAAmB,KAAK,MAAM;oDAIjE,yBAAyB,KAAK,MAAM;mDACI,uBAAuB,KAAK,OAAO;iCACpD,YAAY,KAAK,OAAO;;;;sBA0C3B,eAAe;;;;;;iCA1CZ,YAAY,KAAK,OAAO;;;CAgDnD,CAAA"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
2
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
3
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
4
|
+
};
|
|
5
|
+
import { EntityType } from '../EntityType.js';
|
|
6
|
+
import { toOperationGeneratorKey } from '../../types/GeneratorKeys.js';
|
|
7
|
+
import { OperationBase } from './OperationBase.js';
|
|
8
|
+
import { GeneratorBase } from '../GeneratorBase.js';
|
|
9
|
+
export const toOperationConfig = ({ id, entityType, toName, toExportPath, isSelected, isSupported, pinnable }) => {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const OperationInsertable = (_a = class extends OperationBase {
|
|
12
|
+
constructor(args) {
|
|
13
|
+
super({
|
|
14
|
+
...args,
|
|
15
|
+
generatorKey: toOperationGeneratorKey({
|
|
16
|
+
generatorId: id,
|
|
17
|
+
operation: args.operation
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
__setFunctionName(_a, "OperationInsertable"),
|
|
23
|
+
Object.defineProperty(_a, "id", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true,
|
|
27
|
+
value: id
|
|
28
|
+
}),
|
|
29
|
+
Object.defineProperty(_a, "type", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true,
|
|
33
|
+
value: 'operation'
|
|
34
|
+
}),
|
|
35
|
+
Object.defineProperty(_a, "_class", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true,
|
|
39
|
+
value: 'OperationInsertable'
|
|
40
|
+
}),
|
|
41
|
+
Object.defineProperty(_a, "entityType", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
configurable: true,
|
|
44
|
+
writable: true,
|
|
45
|
+
value: entityType ?? new EntityType('variable')
|
|
46
|
+
}),
|
|
47
|
+
Object.defineProperty(_a, "toName", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
configurable: true,
|
|
50
|
+
writable: true,
|
|
51
|
+
value: toName
|
|
52
|
+
}),
|
|
53
|
+
Object.defineProperty(_a, "toExportPath", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
configurable: true,
|
|
56
|
+
writable: true,
|
|
57
|
+
value: toExportPath
|
|
58
|
+
}),
|
|
59
|
+
Object.defineProperty(_a, "isSelected", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true,
|
|
62
|
+
writable: true,
|
|
63
|
+
value: isSelected
|
|
64
|
+
}),
|
|
65
|
+
Object.defineProperty(_a, "isSupported", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
configurable: true,
|
|
68
|
+
writable: true,
|
|
69
|
+
value: isSupported ?? (() => true)
|
|
70
|
+
}),
|
|
71
|
+
Object.defineProperty(_a, "pinnable", {
|
|
72
|
+
enumerable: true,
|
|
73
|
+
configurable: true,
|
|
74
|
+
writable: true,
|
|
75
|
+
value: pinnable ?? false
|
|
76
|
+
}),
|
|
77
|
+
_a);
|
|
78
|
+
const OperationGenerator = (_b = class extends GeneratorBase {
|
|
79
|
+
constructor(context) {
|
|
80
|
+
super(context);
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
__setFunctionName(_b, "OperationGenerator"),
|
|
84
|
+
Object.defineProperty(_b, "id", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
configurable: true,
|
|
87
|
+
writable: true,
|
|
88
|
+
value: id
|
|
89
|
+
}),
|
|
90
|
+
Object.defineProperty(_b, "type", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
configurable: true,
|
|
93
|
+
writable: true,
|
|
94
|
+
value: 'operation'
|
|
95
|
+
}),
|
|
96
|
+
Object.defineProperty(_b, "_class", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
configurable: true,
|
|
99
|
+
writable: true,
|
|
100
|
+
value: 'OperationGenerator'
|
|
101
|
+
}),
|
|
102
|
+
Object.defineProperty(_b, "isSupported", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
configurable: true,
|
|
105
|
+
writable: true,
|
|
106
|
+
value: isSupported ?? (() => true)
|
|
107
|
+
}),
|
|
108
|
+
Object.defineProperty(_b, "pinnable", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
configurable: true,
|
|
111
|
+
writable: true,
|
|
112
|
+
value: pinnable ?? false
|
|
113
|
+
}),
|
|
114
|
+
_b);
|
|
115
|
+
return { OperationInsertable, OperationGenerator };
|
|
116
|
+
};
|
package/esm/mod.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import "./_dnt.polyfills.js";
|
|
2
2
|
export * from './context/CoreContext.js';
|
|
3
|
-
export * from './context/ParseContext.js';
|
|
4
3
|
export * from './context/GenerateContext.js';
|
|
5
|
-
export * from './
|
|
4
|
+
export * from './context/ParseContext.js';
|
|
6
5
|
export * from './dsl/constants.js';
|
|
7
6
|
export * from './dsl/ContentSettings.js';
|
|
8
7
|
export * from './dsl/ContentSettings.js';
|
|
@@ -11,19 +10,22 @@ export * from './dsl/EntityType.js';
|
|
|
11
10
|
export * from './dsl/GeneratedValueList.js';
|
|
12
11
|
export * from './dsl/Identifier.js';
|
|
13
12
|
export * from './dsl/Import.js';
|
|
14
|
-
export * from './dsl/
|
|
15
|
-
export * from './dsl/ModelDriver.js';
|
|
16
|
-
export * from './dsl/
|
|
17
|
-
export * from './dsl/
|
|
13
|
+
export * from './dsl/model/ModelBase.js';
|
|
14
|
+
export * from './dsl/model/ModelDriver.js';
|
|
15
|
+
export * from './dsl/model/ModelInsertable.js';
|
|
16
|
+
export * from './dsl/model/toModelConfig.js';
|
|
17
|
+
export * from './dsl/operation/OperationBase.js';
|
|
18
|
+
export * from './dsl/operation/OperationBase.js';
|
|
19
|
+
export * from './dsl/operation/OperationDriver.js';
|
|
20
|
+
export * from './dsl/operation/OperationInsertable.js';
|
|
21
|
+
export * from './dsl/operation/toOperationConfig.js';
|
|
18
22
|
export * from './dsl/Stringable.js';
|
|
19
23
|
export * from './dsl/ValueBase.js';
|
|
20
|
-
export * from './dsl/withConfig.js';
|
|
21
|
-
export * from './transform/transform.js';
|
|
22
24
|
export * from './helpers/isImported.js';
|
|
23
25
|
export * from './helpers/naming.js';
|
|
24
26
|
export * from './helpers/refFns.js';
|
|
25
|
-
export * from './helpers/toResolvedArtifactPath.js';
|
|
26
27
|
export * from './helpers/strings.js';
|
|
28
|
+
export * from './helpers/toResolvedArtifactPath.js';
|
|
27
29
|
export * from './oas/discriminator/Discriminator.js';
|
|
28
30
|
export * from './oas/document/Document.js';
|
|
29
31
|
export * from './oas/integer/Integer.js';
|
|
@@ -37,6 +39,7 @@ export * from './oas/string/String.js';
|
|
|
37
39
|
export * from './oas/tag/Tag.js';
|
|
38
40
|
export * from './oas/void/Void.js';
|
|
39
41
|
export * from './server/createServer.js';
|
|
42
|
+
export * from './transform/transform.js';
|
|
40
43
|
export * from './types/CustomValue.js';
|
|
41
44
|
export * from './types/GeneratedValue.js';
|
|
42
45
|
export * from './types/GeneratorKeys.js';
|
|
@@ -47,10 +50,10 @@ export * from './types/RefName.js';
|
|
|
47
50
|
export * from './types/Settings.js';
|
|
48
51
|
export * from './types/Settings.js';
|
|
49
52
|
export * from './types/TypeSystem.js';
|
|
50
|
-
export * from './typescript/List.js';
|
|
51
53
|
export * from './typescript/FunctionParameter.js';
|
|
52
54
|
export * from './typescript/identifiers.js';
|
|
53
55
|
export * from './typescript/keyValues.js';
|
|
56
|
+
export * from './typescript/List.js';
|
|
54
57
|
export * from './typescript/PathParams.js';
|
|
55
58
|
export * from './typescript/ReactRouterPathParams.js';
|
|
56
59
|
export * from './typescript/toPathTemplate.js';
|
package/esm/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAC7B,cAAc,0BAA0B,CAAA;AACxC,cAAc,
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,C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A;AACpC,cAAc,2BAA2B,CAAA;AACzC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,mCAAmC,CAAA;AACjD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,sBAAsB,CAAA;AACpC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,uCAAuC,CAAA;AACrD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,iCAAiC,CAAA"}
|
package/esm/mod.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import "./_dnt.polyfills.js";
|
|
2
2
|
export * from './context/CoreContext.js';
|
|
3
|
-
export * from './context/ParseContext.js';
|
|
4
3
|
export * from './context/GenerateContext.js';
|
|
5
|
-
export * from './
|
|
4
|
+
export * from './context/ParseContext.js';
|
|
6
5
|
export * from './dsl/constants.js';
|
|
7
6
|
export * from './dsl/ContentSettings.js';
|
|
8
7
|
export * from './dsl/ContentSettings.js';
|
|
@@ -11,19 +10,22 @@ export * from './dsl/EntityType.js';
|
|
|
11
10
|
export * from './dsl/GeneratedValueList.js';
|
|
12
11
|
export * from './dsl/Identifier.js';
|
|
13
12
|
export * from './dsl/Import.js';
|
|
14
|
-
export * from './dsl/
|
|
15
|
-
export * from './dsl/ModelDriver.js';
|
|
16
|
-
export * from './dsl/
|
|
17
|
-
export * from './dsl/
|
|
13
|
+
export * from './dsl/model/ModelBase.js';
|
|
14
|
+
export * from './dsl/model/ModelDriver.js';
|
|
15
|
+
export * from './dsl/model/ModelInsertable.js';
|
|
16
|
+
export * from './dsl/model/toModelConfig.js';
|
|
17
|
+
export * from './dsl/operation/OperationBase.js';
|
|
18
|
+
export * from './dsl/operation/OperationBase.js';
|
|
19
|
+
export * from './dsl/operation/OperationDriver.js';
|
|
20
|
+
export * from './dsl/operation/OperationInsertable.js';
|
|
21
|
+
export * from './dsl/operation/toOperationConfig.js';
|
|
18
22
|
export * from './dsl/Stringable.js';
|
|
19
23
|
export * from './dsl/ValueBase.js';
|
|
20
|
-
export * from './dsl/withConfig.js';
|
|
21
|
-
export * from './transform/transform.js';
|
|
22
24
|
export * from './helpers/isImported.js';
|
|
23
25
|
export * from './helpers/naming.js';
|
|
24
26
|
export * from './helpers/refFns.js';
|
|
25
|
-
export * from './helpers/toResolvedArtifactPath.js';
|
|
26
27
|
export * from './helpers/strings.js';
|
|
28
|
+
export * from './helpers/toResolvedArtifactPath.js';
|
|
27
29
|
export * from './oas/discriminator/Discriminator.js';
|
|
28
30
|
export * from './oas/document/Document.js';
|
|
29
31
|
export * from './oas/integer/Integer.js';
|
|
@@ -37,6 +39,7 @@ export * from './oas/string/String.js';
|
|
|
37
39
|
export * from './oas/tag/Tag.js';
|
|
38
40
|
export * from './oas/void/Void.js';
|
|
39
41
|
export * from './server/createServer.js';
|
|
42
|
+
export * from './transform/transform.js';
|
|
40
43
|
export * from './types/CustomValue.js';
|
|
41
44
|
export * from './types/GeneratedValue.js';
|
|
42
45
|
export * from './types/GeneratorKeys.js';
|
|
@@ -47,10 +50,10 @@ export * from './types/RefName.js';
|
|
|
47
50
|
export * from './types/Settings.js';
|
|
48
51
|
export * from './types/Settings.js';
|
|
49
52
|
export * from './types/TypeSystem.js';
|
|
50
|
-
export * from './typescript/List.js';
|
|
51
53
|
export * from './typescript/FunctionParameter.js';
|
|
52
54
|
export * from './typescript/identifiers.js';
|
|
53
55
|
export * from './typescript/keyValues.js';
|
|
56
|
+
export * from './typescript/List.js';
|
|
54
57
|
export * from './typescript/PathParams.js';
|
|
55
58
|
export * from './typescript/ReactRouterPathParams.js';
|
|
56
59
|
export * from './typescript/toPathTemplate.js';
|
|
@@ -23,6 +23,7 @@ export declare class OasComponents {
|
|
|
23
23
|
/** Static identifier property for OasComponents */
|
|
24
24
|
oasType: 'components';
|
|
25
25
|
constructor(fields: ComponentsFields);
|
|
26
|
+
toSchemasRefNames(): RefName[];
|
|
26
27
|
/** Record holding re-usable {@link OasSchema} objects or Refs */
|
|
27
28
|
get schemas(): Record<RefName, OasSchema | OasRef<'schema'>> | undefined;
|
|
28
29
|
/** Record holding re-usable {@link OasResponse} objects or Refs */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Components.d.ts","sourceRoot":"","sources":["../../../src/oas/components/Components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAErD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAA;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAA;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAA;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAA;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,CAAA;IACvE,OAAO,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,UAAU,CAAC,CAAC,GACjD,SAAS,CAEZ;IAED,qEAAqE;IACrE,IAAI,UAAU,IACV,MAAM,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,GACnD,SAAS,CAEZ;IAED,mEAAmE;IACnE,IAAI,QAAQ,IAAI,MAAM,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,SAAS,CAE1E;IAED,uEAAuE;IACvE,IAAI,aAAa,IACb,MAAM,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,GACvD,SAAS,CAEZ;IAED,kEAAkE;IAClE,IAAI,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS,CAEvE;CACF"}
|
|
@@ -27,6 +27,9 @@ export class OasComponents {
|
|
|
27
27
|
_OasComponents_fields.set(this, void 0);
|
|
28
28
|
__classPrivateFieldSet(this, _OasComponents_fields, fields, "f");
|
|
29
29
|
}
|
|
30
|
+
toSchemasRefNames() {
|
|
31
|
+
return Object.keys(__classPrivateFieldGet(this, _OasComponents_fields, "f").schemas ?? {});
|
|
32
|
+
}
|
|
30
33
|
/** Record holding re-usable {@link OasSchema} objects or Refs */
|
|
31
34
|
get schemas() {
|
|
32
35
|
return __classPrivateFieldGet(this, _OasComponents_fields, "f").schemas;
|
|
@@ -2,9 +2,9 @@ import type { OpenAPIV3 } from 'openapi-types';
|
|
|
2
2
|
import type { ParseContext } from '../../context/ParseContext.js';
|
|
3
3
|
import type { DocumentFields } from './Document.js';
|
|
4
4
|
type ToDocumentV3Args = {
|
|
5
|
-
|
|
5
|
+
documentObject: OpenAPIV3.Document;
|
|
6
6
|
context: ParseContext;
|
|
7
7
|
};
|
|
8
|
-
export declare const toDocumentFieldsV3: ({
|
|
8
|
+
export declare const toDocumentFieldsV3: ({ documentObject, context }: ToDocumentV3Args) => DocumentFields;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=toDocumentFieldsV3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDocumentFieldsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/document/toDocumentFieldsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAKjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,KAAK,gBAAgB,GAAG;IACtB,
|
|
1
|
+
{"version":3,"file":"toDocumentFieldsV3.d.ts","sourceRoot":"","sources":["../../../src/oas/document/toDocumentFieldsV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAKjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,KAAK,gBAAgB,GAAG;IACtB,cAAc,EAAE,SAAS,CAAC,QAAQ,CAAA;IAClC,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,kBAAkB,gCAG5B,gBAAgB,KAAG,cAkBrB,CAAA"}
|
|
@@ -2,8 +2,8 @@ import { toTagsV3 } from '../tag/toTagsV3.js';
|
|
|
2
2
|
import { toOperationsV3 } from '../operation/toOperationsV3.js';
|
|
3
3
|
import { toComponentsV3 } from '../components/toComponentsV3.js';
|
|
4
4
|
import { toInfoV3 } from '../info/toInfoV3.js';
|
|
5
|
-
export const toDocumentFieldsV3 = ({
|
|
6
|
-
const { openapi, info, paths, components, tags, ...skipped } =
|
|
5
|
+
export const toDocumentFieldsV3 = ({ documentObject, context }) => {
|
|
6
|
+
const { openapi, info, paths, components, tags, ...skipped } = documentObject;
|
|
7
7
|
context.logSkippedFields(skipped);
|
|
8
8
|
const fields = {
|
|
9
9
|
openapi,
|