@skmtc/core 0.0.368 → 0.0.370
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/GenerateContext.d.ts +79 -4
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.js +113 -33
- package/esm/deps/jsr.io/@std/io/{0.224.7 → 0.224.8}/types.d.ts +56 -5
- package/esm/deps/jsr.io/@std/io/0.224.8/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/io/0.224.8/types.js +15 -0
- package/esm/deps/jsr.io/@std/io/{0.224.7 → 0.224.8}/write_all.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/log/0.224.7/file_handler.js +1 -1
- package/esm/oas/array/Array.d.ts +32 -8
- package/esm/oas/array/Array.d.ts.map +1 -1
- package/esm/oas/array/Array.js +60 -30
- package/esm/oas/boolean/Boolean.d.ts +24 -6
- package/esm/oas/boolean/Boolean.d.ts.map +1 -1
- package/esm/oas/boolean/Boolean.js +40 -24
- package/esm/oas/integer/Integer.d.ts +29 -8
- package/esm/oas/integer/Integer.d.ts.map +1 -1
- package/esm/oas/integer/Integer.js +57 -30
- package/esm/oas/number/Number.d.ts +24 -6
- package/esm/oas/number/Number.d.ts.map +1 -1
- package/esm/oas/number/Number.js +40 -24
- package/esm/oas/object/Object.d.ts +56 -12
- package/esm/oas/object/Object.d.ts.map +1 -1
- package/esm/oas/object/Object.js +52 -5
- package/esm/oas/string/String.d.ts +32 -8
- package/esm/oas/string/String.d.ts.map +1 -1
- package/esm/oas/string/String.js +63 -33
- package/esm/oas/union/Union.d.ts +38 -8
- package/esm/oas/union/Union.d.ts.map +1 -1
- package/esm/oas/union/Union.js +66 -30
- package/esm/oas/unknown/Unknown.d.ts +24 -5
- package/esm/oas/unknown/Unknown.d.ts.map +1 -1
- package/esm/oas/unknown/Unknown.js +34 -21
- package/esm/oas/void/Void.d.ts +22 -5
- package/esm/oas/void/Void.d.ts.map +1 -1
- package/esm/oas/void/Void.js +32 -21
- package/esm/server/createServer.d.ts.map +1 -1
- package/esm/server/createServer.js +9 -6
- package/package.json +1 -1
- package/script/context/GenerateContext.d.ts +79 -4
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/GenerateContext.js +113 -33
- package/script/deps/jsr.io/@std/io/{0.224.7 → 0.224.8}/types.d.ts +56 -5
- package/script/deps/jsr.io/@std/io/0.224.8/types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/io/0.224.8/types.js +18 -0
- package/script/deps/jsr.io/@std/io/{0.224.7 → 0.224.8}/write_all.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/log/0.224.7/file_handler.js +1 -1
- package/script/oas/array/Array.d.ts +32 -8
- package/script/oas/array/Array.d.ts.map +1 -1
- package/script/oas/array/Array.js +60 -30
- package/script/oas/boolean/Boolean.d.ts +24 -6
- package/script/oas/boolean/Boolean.d.ts.map +1 -1
- package/script/oas/boolean/Boolean.js +40 -24
- package/script/oas/integer/Integer.d.ts +29 -8
- package/script/oas/integer/Integer.d.ts.map +1 -1
- package/script/oas/integer/Integer.js +57 -30
- package/script/oas/number/Number.d.ts +24 -6
- package/script/oas/number/Number.d.ts.map +1 -1
- package/script/oas/number/Number.js +40 -24
- package/script/oas/object/Object.d.ts +56 -12
- package/script/oas/object/Object.d.ts.map +1 -1
- package/script/oas/object/Object.js +52 -5
- package/script/oas/string/String.d.ts +32 -8
- package/script/oas/string/String.d.ts.map +1 -1
- package/script/oas/string/String.js +63 -33
- package/script/oas/union/Union.d.ts +38 -8
- package/script/oas/union/Union.d.ts.map +1 -1
- package/script/oas/union/Union.js +66 -30
- package/script/oas/unknown/Unknown.d.ts +24 -5
- package/script/oas/unknown/Unknown.d.ts.map +1 -1
- package/script/oas/unknown/Unknown.js +34 -21
- package/script/oas/void/Void.d.ts +22 -5
- package/script/oas/void/Void.d.ts.map +1 -1
- package/script/oas/void/Void.js +32 -21
- package/script/server/createServer.d.ts.map +1 -1
- package/script/server/createServer.js +9 -6
- package/esm/deps/jsr.io/@std/io/0.224.7/types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/io/0.224.7/types.js +0 -3
- package/script/deps/jsr.io/@std/io/0.224.7/types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/io/0.224.7/types.js +0 -4
- /package/esm/deps/jsr.io/@std/io/{0.224.7 → 0.224.8}/write_all.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/io/{0.224.7 → 0.224.8}/write_all.js +0 -0
- /package/script/deps/jsr.io/@std/io/{0.224.7 → 0.224.8}/write_all.d.ts +0 -0
- /package/script/deps/jsr.io/@std/io/{0.224.7 → 0.224.8}/write_all.js +0 -0
|
@@ -9,28 +9,72 @@ export type OasObjectFields = {
|
|
|
9
9
|
additionalProperties?: boolean | OasSchema | OasRef<'schema'> | undefined;
|
|
10
10
|
nullable?: boolean | undefined;
|
|
11
11
|
};
|
|
12
|
-
export type RemovePropertyArgs = {
|
|
13
|
-
name: string;
|
|
14
|
-
};
|
|
15
12
|
export type AddPropertyArgs = {
|
|
16
13
|
name: string;
|
|
17
14
|
schema: OasSchema | OasRef<'schema'> | CustomValue | undefined;
|
|
18
15
|
required?: boolean;
|
|
19
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Object representing an object and/or a record in the OpenAPI Specification.
|
|
19
|
+
*
|
|
20
|
+
* Objects have fixed, named fields. Records have any number of fields that do not have predefined names.
|
|
21
|
+
*/
|
|
20
22
|
export declare class OasObject {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Object is part the 'schema' set which is used
|
|
25
|
+
* to define data types in an OpenAPI document.
|
|
26
|
+
*/
|
|
27
|
+
oasType: "schema";
|
|
28
|
+
/**
|
|
29
|
+
* Constant value 'object' useful for type narrowing and tagged unions.
|
|
30
|
+
*/
|
|
31
|
+
type: "object";
|
|
32
|
+
/**
|
|
33
|
+
* A short summary of the object.
|
|
34
|
+
*/
|
|
35
|
+
title: string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* A description of the object.
|
|
38
|
+
*/
|
|
39
|
+
description: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Indicates whether value can be null.
|
|
42
|
+
*/
|
|
43
|
+
nullable: boolean | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* A record which maps property names of the object to their schemas.
|
|
46
|
+
*/
|
|
47
|
+
properties: Record<string, OasSchema | OasRef<'schema'> | CustomValue> | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* An array of required property names.
|
|
50
|
+
*/
|
|
51
|
+
required: string[] | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Indicates whether additional properties are allowed.
|
|
54
|
+
*
|
|
55
|
+
* This is equivalent to a Record type in TypeScript.
|
|
56
|
+
*/
|
|
57
|
+
additionalProperties: boolean | OasSchema | OasRef<'schema'> | undefined;
|
|
29
58
|
constructor(fields: OasObjectFields);
|
|
30
59
|
/** Creates new empty OasObject */
|
|
31
60
|
static empty(): OasObject;
|
|
61
|
+
/**
|
|
62
|
+
* Adds a new property to the object.
|
|
63
|
+
*
|
|
64
|
+
* @param {AddPropertyArgs} args - The arguments for adding a property.
|
|
65
|
+
* @param {string} args.name - The name of the property to add.
|
|
66
|
+
* @param {OasSchema | OasRef<'schema'> | CustomValue | undefined} args.schema - The schema of the property to add.
|
|
67
|
+
* @param {boolean} args.required - Whether the property is required.
|
|
68
|
+
* @returns {OasObject} A new OasObject with the added property.
|
|
69
|
+
*/
|
|
32
70
|
addProperty({ name, schema, required }: AddPropertyArgs): OasObject;
|
|
33
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Removes a property from the object.
|
|
73
|
+
*
|
|
74
|
+
* @param {string} name - The name of the property to remove.
|
|
75
|
+
* @returns {OasObject} A new OasObject with the removed property.
|
|
76
|
+
*/
|
|
77
|
+
removeProperty(name: string): OasObject;
|
|
34
78
|
isRef(): this is OasRef<'schema'>;
|
|
35
79
|
resolve(): OasObject;
|
|
36
80
|
resolveOnce(): OasObject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Object.d.ts","sourceRoot":"","sources":["../../../src/oas/object/Object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE7D,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EACP,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,WAAW,CAAC,GAC1D,SAAS,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IAC/B,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAA;IACzE,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Object.d.ts","sourceRoot":"","sources":["../../../src/oas/object/Object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE7D,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EACP,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,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AAE,MAAM,GAAG,SAAS;IAiBvC,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC;IAIjC,OAAO,IAAI,SAAS;IAIpB,WAAW,IAAI,SAAS;CAGzB"}
|
|
@@ -1,51 +1,83 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OasObject = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Object representing an object and/or a record in the OpenAPI Specification.
|
|
6
|
+
*
|
|
7
|
+
* Objects have fixed, named fields. Records have any number of fields that do not have predefined names.
|
|
8
|
+
*/
|
|
4
9
|
class OasObject {
|
|
5
10
|
constructor(fields) {
|
|
11
|
+
/**
|
|
12
|
+
* Object is part the 'schema' set which is used
|
|
13
|
+
* to define data types in an OpenAPI document.
|
|
14
|
+
*/
|
|
6
15
|
Object.defineProperty(this, "oasType", {
|
|
7
16
|
enumerable: true,
|
|
8
17
|
configurable: true,
|
|
9
18
|
writable: true,
|
|
10
19
|
value: 'schema'
|
|
11
20
|
});
|
|
21
|
+
/**
|
|
22
|
+
* Constant value 'object' useful for type narrowing and tagged unions.
|
|
23
|
+
*/
|
|
12
24
|
Object.defineProperty(this, "type", {
|
|
13
25
|
enumerable: true,
|
|
14
26
|
configurable: true,
|
|
15
27
|
writable: true,
|
|
16
28
|
value: 'object'
|
|
17
29
|
});
|
|
30
|
+
/**
|
|
31
|
+
* A short summary of the object.
|
|
32
|
+
*/
|
|
18
33
|
Object.defineProperty(this, "title", {
|
|
19
34
|
enumerable: true,
|
|
20
35
|
configurable: true,
|
|
21
36
|
writable: true,
|
|
22
37
|
value: void 0
|
|
23
38
|
});
|
|
39
|
+
/**
|
|
40
|
+
* A description of the object.
|
|
41
|
+
*/
|
|
24
42
|
Object.defineProperty(this, "description", {
|
|
25
43
|
enumerable: true,
|
|
26
44
|
configurable: true,
|
|
27
45
|
writable: true,
|
|
28
46
|
value: void 0
|
|
29
47
|
});
|
|
30
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Indicates whether value can be null.
|
|
50
|
+
*/
|
|
51
|
+
Object.defineProperty(this, "nullable", {
|
|
31
52
|
enumerable: true,
|
|
32
53
|
configurable: true,
|
|
33
54
|
writable: true,
|
|
34
55
|
value: void 0
|
|
35
56
|
});
|
|
36
|
-
|
|
57
|
+
/**
|
|
58
|
+
* A record which maps property names of the object to their schemas.
|
|
59
|
+
*/
|
|
60
|
+
Object.defineProperty(this, "properties", {
|
|
37
61
|
enumerable: true,
|
|
38
62
|
configurable: true,
|
|
39
63
|
writable: true,
|
|
40
64
|
value: void 0
|
|
41
65
|
});
|
|
42
|
-
|
|
66
|
+
/**
|
|
67
|
+
* An array of required property names.
|
|
68
|
+
*/
|
|
69
|
+
Object.defineProperty(this, "required", {
|
|
43
70
|
enumerable: true,
|
|
44
71
|
configurable: true,
|
|
45
72
|
writable: true,
|
|
46
73
|
value: void 0
|
|
47
74
|
});
|
|
48
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Indicates whether additional properties are allowed.
|
|
77
|
+
*
|
|
78
|
+
* This is equivalent to a Record type in TypeScript.
|
|
79
|
+
*/
|
|
80
|
+
Object.defineProperty(this, "additionalProperties", {
|
|
49
81
|
enumerable: true,
|
|
50
82
|
configurable: true,
|
|
51
83
|
writable: true,
|
|
@@ -65,6 +97,15 @@ class OasObject {
|
|
|
65
97
|
required: []
|
|
66
98
|
});
|
|
67
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Adds a new property to the object.
|
|
102
|
+
*
|
|
103
|
+
* @param {AddPropertyArgs} args - The arguments for adding a property.
|
|
104
|
+
* @param {string} args.name - The name of the property to add.
|
|
105
|
+
* @param {OasSchema | OasRef<'schema'> | CustomValue | undefined} args.schema - The schema of the property to add.
|
|
106
|
+
* @param {boolean} args.required - Whether the property is required.
|
|
107
|
+
* @returns {OasObject} A new OasObject with the added property.
|
|
108
|
+
*/
|
|
68
109
|
addProperty({ name, schema, required }) {
|
|
69
110
|
if (!schema) {
|
|
70
111
|
return this;
|
|
@@ -81,7 +122,13 @@ class OasObject {
|
|
|
81
122
|
nullable: this.nullable
|
|
82
123
|
});
|
|
83
124
|
}
|
|
84
|
-
|
|
125
|
+
/**
|
|
126
|
+
* Removes a property from the object.
|
|
127
|
+
*
|
|
128
|
+
* @param {string} name - The name of the property to remove.
|
|
129
|
+
* @returns {OasObject} A new OasObject with the removed property.
|
|
130
|
+
*/
|
|
131
|
+
removeProperty(name) {
|
|
85
132
|
if (!this.properties?.[name]) {
|
|
86
133
|
return this;
|
|
87
134
|
}
|
|
@@ -6,18 +6,42 @@ export type StringFields = {
|
|
|
6
6
|
enums?: string[];
|
|
7
7
|
nullable?: boolean;
|
|
8
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* Object representing a string in the OpenAPI Specification.
|
|
11
|
+
*/
|
|
9
12
|
export declare class OasString {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Object is part the 'schema' set which is used
|
|
15
|
+
* to define data types in an OpenAPI document.
|
|
16
|
+
*/
|
|
17
|
+
oasType: "schema";
|
|
18
|
+
/**
|
|
19
|
+
* Constant value 'string' useful for type narrowing and tagged unions.
|
|
20
|
+
*/
|
|
21
|
+
type: "string";
|
|
22
|
+
/**
|
|
23
|
+
* A short summary of the string.
|
|
24
|
+
*/
|
|
25
|
+
title: string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* A description of the string.
|
|
28
|
+
*/
|
|
29
|
+
description: string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* The format of the string.
|
|
32
|
+
*/
|
|
33
|
+
format: string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* An array of allowed values for the string.
|
|
36
|
+
*/
|
|
37
|
+
enums: string[] | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Indicates whether value can be null.
|
|
40
|
+
*/
|
|
41
|
+
nullable: boolean | undefined;
|
|
13
42
|
constructor(fields: StringFields);
|
|
14
|
-
get title(): string | undefined;
|
|
15
|
-
get description(): string | undefined;
|
|
16
|
-
get nullable(): boolean | undefined;
|
|
17
43
|
isRef(): this is OasRef<'schema'>;
|
|
18
44
|
resolve(): OasString;
|
|
19
45
|
resolveOnce(): OasString;
|
|
20
|
-
get format(): string | undefined;
|
|
21
|
-
get enums(): string[] | undefined;
|
|
22
46
|
}
|
|
23
47
|
//# sourceMappingURL=String.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"String.d.ts","sourceRoot":"","sources":["../../../src/oas/string/String.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,qBAAa,SAAS
|
|
1
|
+
{"version":3,"file":"String.d.ts","sourceRoot":"","sources":["../../../src/oas/string/String.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED;;GAEG;AACH,qBAAa,SAAS;IACpB;;;OAGG;IACH,OAAO,WAAoB;IAC3B;;OAEG;IACH,IAAI,WAAoB;IACxB;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IAC3B;;OAEG;IACH,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;gBAEjB,MAAM,EAAE,YAAY;IAYhC,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC;IAIjC,OAAO,IAAI,SAAS;IAIpB,WAAW,IAAI,SAAS;CAGzB"}
|
|
@@ -1,44 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
-
};
|
|
8
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
-
};
|
|
13
|
-
var _OasString_fields;
|
|
14
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
3
|
exports.OasString = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Object representing a string in the OpenAPI Specification.
|
|
6
|
+
*/
|
|
16
7
|
class OasString {
|
|
17
8
|
constructor(fields) {
|
|
9
|
+
/**
|
|
10
|
+
* Object is part the 'schema' set which is used
|
|
11
|
+
* to define data types in an OpenAPI document.
|
|
12
|
+
*/
|
|
18
13
|
Object.defineProperty(this, "oasType", {
|
|
19
14
|
enumerable: true,
|
|
20
15
|
configurable: true,
|
|
21
16
|
writable: true,
|
|
22
17
|
value: 'schema'
|
|
23
18
|
});
|
|
19
|
+
/**
|
|
20
|
+
* Constant value 'string' useful for type narrowing and tagged unions.
|
|
21
|
+
*/
|
|
24
22
|
Object.defineProperty(this, "type", {
|
|
25
23
|
enumerable: true,
|
|
26
24
|
configurable: true,
|
|
27
25
|
writable: true,
|
|
28
26
|
value: 'string'
|
|
29
27
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
/**
|
|
29
|
+
* A short summary of the string.
|
|
30
|
+
*/
|
|
31
|
+
Object.defineProperty(this, "title", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
configurable: true,
|
|
34
|
+
writable: true,
|
|
35
|
+
value: void 0
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* A description of the string.
|
|
39
|
+
*/
|
|
40
|
+
Object.defineProperty(this, "description", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
configurable: true,
|
|
43
|
+
writable: true,
|
|
44
|
+
value: void 0
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* The format of the string.
|
|
48
|
+
*/
|
|
49
|
+
Object.defineProperty(this, "format", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
configurable: true,
|
|
52
|
+
writable: true,
|
|
53
|
+
value: void 0
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* An array of allowed values for the string.
|
|
57
|
+
*/
|
|
58
|
+
Object.defineProperty(this, "enums", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
configurable: true,
|
|
61
|
+
writable: true,
|
|
62
|
+
value: void 0
|
|
63
|
+
});
|
|
64
|
+
/**
|
|
65
|
+
* Indicates whether value can be null.
|
|
66
|
+
*/
|
|
67
|
+
Object.defineProperty(this, "nullable", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
configurable: true,
|
|
70
|
+
writable: true,
|
|
71
|
+
value: void 0
|
|
72
|
+
});
|
|
73
|
+
this.title = fields.title;
|
|
74
|
+
this.description = fields.description;
|
|
75
|
+
this.format = fields.format;
|
|
76
|
+
this.enums = fields.enums;
|
|
77
|
+
this.nullable = fields.nullable;
|
|
41
78
|
}
|
|
79
|
+
// get pattern() {
|
|
80
|
+
// return this.fields.pattern
|
|
81
|
+
// }
|
|
42
82
|
isRef() {
|
|
43
83
|
return false;
|
|
44
84
|
}
|
|
@@ -48,15 +88,5 @@ class OasString {
|
|
|
48
88
|
resolveOnce() {
|
|
49
89
|
return this;
|
|
50
90
|
}
|
|
51
|
-
get format() {
|
|
52
|
-
return __classPrivateFieldGet(this, _OasString_fields, "f").format;
|
|
53
|
-
}
|
|
54
|
-
// get pattern() {
|
|
55
|
-
// return this.fields.pattern
|
|
56
|
-
// }
|
|
57
|
-
get enums() {
|
|
58
|
-
return __classPrivateFieldGet(this, _OasString_fields, "f").enums;
|
|
59
|
-
}
|
|
60
91
|
}
|
|
61
92
|
exports.OasString = OasString;
|
|
62
|
-
_OasString_fields = new WeakMap();
|
|
@@ -8,16 +8,46 @@ export type UnionFields = {
|
|
|
8
8
|
discriminator?: OasDiscriminator;
|
|
9
9
|
members: (OasSchema | OasRef<'schema'>)[];
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Object representing a 'oneOf' or 'anyOf' in the OpenAPI Specification.
|
|
13
|
+
*
|
|
14
|
+
* In the context of TypeScript 'anyOf' is not helpful since it implies
|
|
15
|
+
* a union that consists of all possible combinations of member types.
|
|
16
|
+
*
|
|
17
|
+
* Generating such combination types would not be useful and we map both
|
|
18
|
+
* 'oneOf' and 'anyOf' to a TypeScript union type.
|
|
19
|
+
*/
|
|
11
20
|
export declare class OasUnion {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Object is part the 'schema' set which is used
|
|
23
|
+
* to define data types in an OpenAPI document.
|
|
24
|
+
*/
|
|
25
|
+
oasType: "schema";
|
|
26
|
+
/**
|
|
27
|
+
* Constant value 'union' useful for type narrowing and tagged unions.
|
|
28
|
+
*/
|
|
29
|
+
type: "union";
|
|
30
|
+
/**
|
|
31
|
+
* A short summary of the union.
|
|
32
|
+
*/
|
|
33
|
+
title: string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* A description of the union.
|
|
36
|
+
*/
|
|
37
|
+
description: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Indicates whether value can be null.
|
|
40
|
+
*/
|
|
41
|
+
nullable: boolean | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Discriminator object used to tag member types and make the union a tagged union.
|
|
44
|
+
*/
|
|
45
|
+
discriminator: OasDiscriminator | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Array of schemas or references to schemas that are part of the union.
|
|
48
|
+
*/
|
|
49
|
+
members: (OasSchema | OasRef<'schema'>)[];
|
|
15
50
|
constructor(fields: UnionFields);
|
|
16
|
-
get title(): string | undefined;
|
|
17
|
-
get description(): string | undefined;
|
|
18
|
-
get discriminator(): OasDiscriminator | undefined;
|
|
19
|
-
get members(): (OasSchema | OasRef<'schema'>)[];
|
|
20
|
-
get nullable(): boolean | undefined;
|
|
21
51
|
isRef(): this is OasRef<'schema'>;
|
|
22
52
|
resolve(): OasUnion;
|
|
23
53
|
resolveOnce(): OasUnion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Union.d.ts","sourceRoot":"","sources":["../../../src/oas/union/Union.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,KAAK,EAAE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QAAQ,CAAC,CAAC,EAAE,CAAA;gBAE7B,MAAM,EAAE,WAAW;IAQ/B,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC;IAIjC,OAAO,IAAI,QAAQ;IAInB,WAAW,IAAI,QAAQ;CAGxB"}
|
|
@@ -1,49 +1,86 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
-
};
|
|
8
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
-
};
|
|
13
|
-
var _OasUnion_fields;
|
|
14
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
3
|
exports.OasUnion = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Object representing a 'oneOf' or 'anyOf' in the OpenAPI Specification.
|
|
6
|
+
*
|
|
7
|
+
* In the context of TypeScript 'anyOf' is not helpful since it implies
|
|
8
|
+
* a union that consists of all possible combinations of member types.
|
|
9
|
+
*
|
|
10
|
+
* Generating such combination types would not be useful and we map both
|
|
11
|
+
* 'oneOf' and 'anyOf' to a TypeScript union type.
|
|
12
|
+
*/
|
|
16
13
|
class OasUnion {
|
|
17
14
|
constructor(fields) {
|
|
15
|
+
/**
|
|
16
|
+
* Object is part the 'schema' set which is used
|
|
17
|
+
* to define data types in an OpenAPI document.
|
|
18
|
+
*/
|
|
18
19
|
Object.defineProperty(this, "oasType", {
|
|
19
20
|
enumerable: true,
|
|
20
21
|
configurable: true,
|
|
21
22
|
writable: true,
|
|
22
23
|
value: 'schema'
|
|
23
24
|
});
|
|
25
|
+
/**
|
|
26
|
+
* Constant value 'union' useful for type narrowing and tagged unions.
|
|
27
|
+
*/
|
|
24
28
|
Object.defineProperty(this, "type", {
|
|
25
29
|
enumerable: true,
|
|
26
30
|
configurable: true,
|
|
27
31
|
writable: true,
|
|
28
32
|
value: 'union'
|
|
29
33
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
/**
|
|
35
|
+
* A short summary of the union.
|
|
36
|
+
*/
|
|
37
|
+
Object.defineProperty(this, "title", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true,
|
|
41
|
+
value: void 0
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* A description of the union.
|
|
45
|
+
*/
|
|
46
|
+
Object.defineProperty(this, "description", {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
configurable: true,
|
|
49
|
+
writable: true,
|
|
50
|
+
value: void 0
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* Indicates whether value can be null.
|
|
54
|
+
*/
|
|
55
|
+
Object.defineProperty(this, "nullable", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
configurable: true,
|
|
58
|
+
writable: true,
|
|
59
|
+
value: void 0
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* Discriminator object used to tag member types and make the union a tagged union.
|
|
63
|
+
*/
|
|
64
|
+
Object.defineProperty(this, "discriminator", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
configurable: true,
|
|
67
|
+
writable: true,
|
|
68
|
+
value: void 0
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* Array of schemas or references to schemas that are part of the union.
|
|
72
|
+
*/
|
|
73
|
+
Object.defineProperty(this, "members", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
configurable: true,
|
|
76
|
+
writable: true,
|
|
77
|
+
value: void 0
|
|
78
|
+
});
|
|
79
|
+
this.title = fields.title;
|
|
80
|
+
this.description = fields.description;
|
|
81
|
+
this.nullable = fields.nullable;
|
|
82
|
+
this.discriminator = fields.discriminator;
|
|
83
|
+
this.members = fields.members;
|
|
47
84
|
}
|
|
48
85
|
isRef() {
|
|
49
86
|
return false;
|
|
@@ -56,4 +93,3 @@ class OasUnion {
|
|
|
56
93
|
}
|
|
57
94
|
}
|
|
58
95
|
exports.OasUnion = OasUnion;
|
|
59
|
-
_OasUnion_fields = new WeakMap();
|
|
@@ -3,13 +3,32 @@ export type UnknownFields = {
|
|
|
3
3
|
title?: string;
|
|
4
4
|
description?: string;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Object representing an unknown type in the OpenAPI Specification.
|
|
8
|
+
*
|
|
9
|
+
* JSON schema treats a definition without any type information as 'any'.
|
|
10
|
+
* Since this is not useful in an API context, we use OasUnknown to
|
|
11
|
+
* represent types that are not specified.
|
|
12
|
+
*/
|
|
6
13
|
export declare class OasUnknown {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Object is part the 'schema' set which is used
|
|
16
|
+
* to define data types in an OpenAPI document.
|
|
17
|
+
*/
|
|
18
|
+
oasType: "schema";
|
|
19
|
+
/**
|
|
20
|
+
* Constant value 'unknown' useful for type narrowing and tagged unions.
|
|
21
|
+
*/
|
|
22
|
+
type: "unknown";
|
|
23
|
+
/**
|
|
24
|
+
* A short summary of the unknown type.
|
|
25
|
+
*/
|
|
26
|
+
title: string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* A description of the unknown type.
|
|
29
|
+
*/
|
|
30
|
+
description: string | undefined;
|
|
10
31
|
constructor(fields: UnknownFields);
|
|
11
|
-
get title(): string | undefined;
|
|
12
|
-
get description(): string | undefined;
|
|
13
32
|
isRef(): this is OasRef<'schema'>;
|
|
14
33
|
resolve(): OasUnknown;
|
|
15
34
|
resolveOnce(): OasUnknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Unknown.d.ts","sourceRoot":"","sources":["../../../src/oas/unknown/Unknown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,qBAAa,UAAU
|
|
1
|
+
{"version":3,"file":"Unknown.d.ts","sourceRoot":"","sources":["../../../src/oas/unknown/Unknown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED;;;;;;GAMG;AACH,qBAAa,UAAU;IACrB;;;OAGG;IACH,OAAO,WAAoB;IAC3B;;OAEG;IACH,IAAI,YAAqB;IACzB;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;gBAEnB,MAAM,EAAE,aAAa;IAKjC,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC;IAIjC,OAAO,IAAI,UAAU;IAIrB,WAAW,IAAI,UAAU;CAG1B"}
|