@nestia/sdk 14.0.0 → 14.0.1
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/README.md +1 -1
- package/assets/bundle/distribute/package.json +2 -2
- package/assets/bundle/distribute/tsconfig.json +15 -105
- package/lib/INestiaConfig.d.ts +19 -10
- package/lib/NestiaSdkApplication.js +58 -27
- package/lib/NestiaSdkApplication.js.map +1 -1
- package/lib/NestiaSwaggerComposer.js +11 -10
- package/lib/NestiaSwaggerComposer.js.map +1 -1
- package/lib/analyses/ConfigAnalyzer.js +4 -4
- package/lib/analyses/ConfigAnalyzer.js.map +1 -1
- package/lib/analyses/ParameterNameAnalyzer.d.ts +20 -0
- package/lib/analyses/ParameterNameAnalyzer.js +48 -0
- package/lib/analyses/ParameterNameAnalyzer.js.map +1 -0
- package/lib/analyses/PathAnalyzer.d.ts +30 -0
- package/lib/analyses/PathAnalyzer.js +108 -16
- package/lib/analyses/PathAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectControllerAnalyzer.js +2 -1
- package/lib/analyses/ReflectControllerAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationAnalyzer.js +7 -7
- package/lib/analyses/ReflectHttpOperationAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js +122 -23
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js +5 -2
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectMcpOperationAnalyzer.js +5 -2
- package/lib/analyses/ReflectMcpOperationAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.js +6 -3
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.js.map +1 -1
- package/lib/analyses/SecurityAnalyzer.d.ts +10 -0
- package/lib/analyses/SecurityAnalyzer.js +24 -19
- package/lib/analyses/SecurityAnalyzer.js.map +1 -1
- package/lib/analyses/SwaggerExampleAnalyzer.d.ts +15 -0
- package/lib/analyses/SwaggerExampleAnalyzer.js +20 -0
- package/lib/analyses/SwaggerExampleAnalyzer.js.map +1 -0
- package/lib/analyses/TypedHttpRouteAnalyzer.js +30 -21
- package/lib/analyses/TypedHttpRouteAnalyzer.js.map +1 -1
- package/lib/analyses/TypedWebSocketRouteAnalyzer.js +1 -1
- package/lib/analyses/TypedWebSocketRouteAnalyzer.js.map +1 -1
- package/lib/executable/internal/NestiaSdkWatcher.js +3 -3
- package/lib/executable/internal/NestiaSdkWatcher.js.map +1 -1
- package/lib/executable/sdk.js +16 -1
- package/lib/executable/sdk.js.map +1 -1
- package/lib/factories/ExpressionFactory.d.ts +3 -0
- package/lib/factories/ExpressionFactory.js +6 -2
- package/lib/factories/ExpressionFactory.js.map +1 -1
- package/lib/factories/LiteralFactory.js +3 -1
- package/lib/factories/LiteralFactory.js.map +1 -1
- package/lib/generates/SdkGenerator.js +3 -3
- package/lib/generates/SdkGenerator.js.map +1 -1
- package/lib/generates/SwaggerGenerator.js +135 -27
- package/lib/generates/SwaggerGenerator.js.map +1 -1
- package/lib/generates/internal/FilePrinter.d.ts +14 -0
- package/lib/generates/internal/FilePrinter.js +31 -0
- package/lib/generates/internal/FilePrinter.js.map +1 -1
- package/lib/generates/internal/ImportDictionary.d.ts +2 -0
- package/lib/generates/internal/ImportDictionary.js +13 -0
- package/lib/generates/internal/ImportDictionary.js.map +1 -1
- package/lib/generates/internal/SdkAliasCollection.d.ts +2 -1
- package/lib/generates/internal/SdkAliasCollection.js +8 -4
- package/lib/generates/internal/SdkAliasCollection.js.map +1 -1
- package/lib/generates/internal/SdkDistributionComposer.js +72 -14
- package/lib/generates/internal/SdkDistributionComposer.js.map +1 -1
- package/lib/generates/internal/SdkFileProgrammer.js +83 -12
- package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpFunctionProgrammer.js +21 -23
- package/lib/generates/internal/SdkHttpFunctionProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js +27 -34
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpParameterProgrammer.d.ts +40 -1
- package/lib/generates/internal/SdkHttpParameterProgrammer.js +105 -6
- package/lib/generates/internal/SdkHttpParameterProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpRouteProgrammer.js +16 -32
- package/lib/generates/internal/SdkHttpRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js +18 -14
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkMcpRouteProgrammer.js +39 -11
- package/lib/generates/internal/SdkMcpRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkPathTemplate.d.ts +21 -0
- package/lib/generates/internal/SdkPathTemplate.js +50 -0
- package/lib/generates/internal/SdkPathTemplate.js.map +1 -0
- package/lib/generates/internal/SdkTypeProgrammer.js +15 -15
- package/lib/generates/internal/SdkTypeProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkTypeTagProgrammer.d.ts +20 -1
- package/lib/generates/internal/SdkTypeTagProgrammer.js +386 -67
- package/lib/generates/internal/SdkTypeTagProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js +27 -36
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketParameterProgrammer.d.ts +35 -1
- package/lib/generates/internal/SdkWebSocketParameterProgrammer.js +72 -5
- package/lib/generates/internal/SdkWebSocketParameterProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js +57 -33
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SwaggerOperationComposer.js +19 -8
- package/lib/generates/internal/SwaggerOperationComposer.js.map +1 -1
- package/lib/generates/internal/SwaggerOperationParameterComposer.d.ts +1 -1
- package/lib/generates/internal/SwaggerOperationParameterComposer.js +201 -19
- package/lib/generates/internal/SwaggerOperationParameterComposer.js.map +1 -1
- package/lib/generates/internal/SwaggerOperationResponseComposer.d.ts +2 -0
- package/lib/generates/internal/SwaggerOperationResponseComposer.js +39 -7
- package/lib/generates/internal/SwaggerOperationResponseComposer.js.map +1 -1
- package/lib/internal/legacy.d.ts +49 -18
- package/lib/internal/legacy.js +84 -25
- package/lib/internal/legacy.js.map +1 -1
- package/lib/structures/IOperationMetadata.d.ts +22 -0
- package/lib/structures/IReflectHttpOperationException.d.ts +3 -2
- package/lib/structures/IReflectHttpOperationParameter.d.ts +8 -3
- package/lib/structures/IReflectHttpOperationSuccess.d.ts +4 -3
- package/lib/structures/ITypedHttpRoute.d.ts +8 -0
- package/lib/structures/ITypedHttpRouteException.d.ts +3 -1
- package/lib/structures/ITypedHttpRouteParameter.d.ts +3 -1
- package/lib/structures/ITypedHttpRouteSuccess.d.ts +3 -1
- package/lib/structures/ITypedWebSocketRoute.d.ts +8 -0
- package/lib/utils/SourceFinder.d.ts +10 -0
- package/lib/utils/SourceFinder.js +27 -4
- package/lib/utils/SourceFinder.js.map +1 -1
- package/lib/utils/VersioningStrategy.d.ts +13 -1
- package/lib/utils/VersioningStrategy.js +24 -12
- package/lib/utils/VersioningStrategy.js.map +1 -1
- package/native/go.mod +1 -1
- package/native/go.sum +2 -2
- package/native/sdk/sdk_http_rules.go +210 -0
- package/native/sdk/sdk_metadata_json.go +73 -3
- package/native/sdk/sdk_transform.go +801 -49
- package/package.json +6 -6
- package/src/INestiaConfig.ts +19 -10
- package/src/NestiaSdkApplication.ts +63 -34
- package/src/NestiaSwaggerComposer.ts +11 -8
- package/src/analyses/ConfigAnalyzer.ts +3 -3
- package/src/analyses/ParameterNameAnalyzer.ts +51 -0
- package/src/analyses/PathAnalyzer.ts +106 -14
- package/src/analyses/ReflectControllerAnalyzer.ts +2 -1
- package/src/analyses/ReflectHttpOperationAnalyzer.ts +4 -4
- package/src/analyses/ReflectHttpOperationParameterAnalyzer.ts +122 -39
- package/src/analyses/ReflectHttpOperationResponseAnalyzer.ts +6 -7
- package/src/analyses/ReflectMcpOperationAnalyzer.ts +6 -2
- package/src/analyses/ReflectWebSocketOperationAnalyzer.ts +7 -3
- package/src/analyses/SecurityAnalyzer.ts +30 -20
- package/src/analyses/SwaggerExampleAnalyzer.ts +23 -0
- package/src/analyses/TypedHttpRouteAnalyzer.ts +29 -20
- package/src/analyses/TypedWebSocketRouteAnalyzer.ts +1 -0
- package/src/executable/internal/NestiaSdkWatcher.ts +2 -2
- package/src/executable/sdk.ts +24 -1
- package/src/factories/ExpressionFactory.ts +8 -2
- package/src/factories/LiteralFactory.ts +7 -2
- package/src/generates/SdkGenerator.ts +3 -3
- package/src/generates/SwaggerGenerator.ts +173 -32
- package/src/generates/internal/FilePrinter.ts +28 -0
- package/src/generates/internal/ImportDictionary.ts +11 -0
- package/src/generates/internal/SdkAliasCollection.ts +11 -4
- package/src/generates/internal/SdkDistributionComposer.ts +89 -15
- package/src/generates/internal/SdkFileProgrammer.ts +108 -16
- package/src/generates/internal/SdkHttpFunctionProgrammer.ts +28 -30
- package/src/generates/internal/SdkHttpNamespaceProgrammer.ts +34 -64
- package/src/generates/internal/SdkHttpParameterProgrammer.ts +193 -13
- package/src/generates/internal/SdkHttpRouteProgrammer.ts +17 -31
- package/src/generates/internal/SdkHttpSimulationProgrammer.ts +51 -14
- package/src/generates/internal/SdkMcpRouteProgrammer.ts +112 -15
- package/src/generates/internal/SdkPathTemplate.ts +73 -0
- package/src/generates/internal/SdkTypeProgrammer.ts +19 -22
- package/src/generates/internal/SdkTypeTagProgrammer.ts +506 -78
- package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +43 -68
- package/src/generates/internal/SdkWebSocketParameterProgrammer.ts +126 -5
- package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +71 -48
- package/src/generates/internal/SwaggerOperationComposer.ts +20 -6
- package/src/generates/internal/SwaggerOperationParameterComposer.ts +279 -30
- package/src/generates/internal/SwaggerOperationResponseComposer.ts +55 -11
- package/src/internal/legacy.ts +114 -26
- package/src/structures/IOperationMetadata.ts +28 -0
- package/src/structures/IReflectHttpOperationException.ts +7 -2
- package/src/structures/IReflectHttpOperationParameter.ts +9 -2
- package/src/structures/IReflectHttpOperationSuccess.ts +8 -3
- package/src/structures/ITypedHttpRoute.ts +8 -0
- package/src/structures/ITypedHttpRouteException.ts +4 -1
- package/src/structures/ITypedHttpRouteParameter.ts +3 -1
- package/src/structures/ITypedHttpRouteSuccess.ts +4 -1
- package/src/structures/ITypedWebSocketRoute.ts +8 -0
- package/src/utils/SourceFinder.ts +25 -4
- package/src/utils/VersioningStrategy.ts +28 -13
- package/lib/validators/HttpHeadersValidator.d.ts +0 -11
- package/lib/validators/HttpHeadersValidator.js +0 -15
- package/lib/validators/HttpHeadersValidator.js.map +0 -1
- package/lib/validators/HttpQueryValidator.d.ts +0 -10
- package/lib/validators/HttpQueryValidator.js +0 -14
- package/lib/validators/HttpQueryValidator.js.map +0 -1
- package/src/validators/HttpHeadersValidator.ts +0 -12
- package/src/validators/HttpQueryValidator.ts +0 -11
|
@@ -3,86 +3,405 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SdkTypeTagProgrammer = void 0;
|
|
4
4
|
const factory_1 = require("@ttsc/factory");
|
|
5
5
|
const LiteralFactory_1 = require("../../factories/LiteralFactory");
|
|
6
|
+
const legacy_1 = require("../../internal/legacy");
|
|
6
7
|
var SdkTypeTagProgrammer;
|
|
7
8
|
(function (SdkTypeTagProgrammer) {
|
|
9
|
+
/**
|
|
10
|
+
* Writes a type tag of a cloned DTO.
|
|
11
|
+
*
|
|
12
|
+
* A tag prints as the predefined typia tag it matches, `tags.Minimum<3>`,
|
|
13
|
+
* only when that tag accepts the argument and, given it, expands to exactly
|
|
14
|
+
* the tag the metadata carries; then the two are the same type. Anything else
|
|
15
|
+
* prints in the generic `tags.TagBase<{ ... }>` form, which is always the
|
|
16
|
+
* same type.
|
|
17
|
+
*
|
|
18
|
+
* The tag's name cannot decide it. The SDK names a tag after its object type
|
|
19
|
+
* with the brackets and quotes a component name drops, `Minimum3` or
|
|
20
|
+
* `Formatuuid`, so a name no longer tells `tags.Minimum<3>` from a user's own
|
|
21
|
+
* tag named alike (#1662). The expansion can: it is typia's declaration of
|
|
22
|
+
* each predefined tag, and should typia change one, the tag only falls back
|
|
23
|
+
* to the `TagBase` form.
|
|
24
|
+
*/
|
|
8
25
|
SdkTypeTagProgrammer.write = (importer, from, tag) => {
|
|
9
26
|
var _a;
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
type: "element",
|
|
16
|
-
name: "tags",
|
|
17
|
-
})), factory_1.factory.createIdentifier(name)), [factory_1.factory.createLiteralTypeNode(LiteralFactory_1.LiteralFactory.write(tag.value))]);
|
|
18
|
-
return factory_1.factory.createTypeReferenceNode(factory_1.factory.createQualifiedName(factory_1.factory.createIdentifier(importer.external({
|
|
19
|
-
declaration: true,
|
|
20
|
-
file: `typia`,
|
|
21
|
-
type: "element",
|
|
22
|
-
name: "tags",
|
|
23
|
-
})), factory_1.factory.createIdentifier("TagBase")), [
|
|
27
|
+
const predefined = (_a = comment(from, tag)) !== null && _a !== void 0 ? _a : recognize(from, tag);
|
|
28
|
+
if (predefined !== null)
|
|
29
|
+
return SdkTypeTagProgrammer.writePredefined(importer, predefined.name, predefined.argument);
|
|
30
|
+
const value = (0, legacy_1.decodeTagValue)(tag);
|
|
31
|
+
return factory_1.factory.createTypeReferenceNode(factory_1.factory.createQualifiedName(factory_1.factory.createIdentifier(tagsOf(importer)), factory_1.factory.createIdentifier("TagBase")), [
|
|
24
32
|
factory_1.factory.createLiteralTypeNode(LiteralFactory_1.LiteralFactory.write({
|
|
25
33
|
target: from,
|
|
26
34
|
kind: tag.kind,
|
|
27
|
-
value:
|
|
35
|
+
value: Number.isNaN(value) ? null : value,
|
|
28
36
|
validate: tag.validate,
|
|
29
37
|
exclusive: tag.exclusive,
|
|
30
38
|
schema: tag.schema,
|
|
31
39
|
})),
|
|
32
40
|
]);
|
|
33
41
|
};
|
|
42
|
+
/** Writes the predefined typia tag `tags.<name><argument>`. */
|
|
43
|
+
SdkTypeTagProgrammer.writePredefined = (importer, name, argument) => factory_1.factory.createTypeReferenceNode(factory_1.factory.createQualifiedName(factory_1.factory.createIdentifier(tagsOf(importer)), factory_1.factory.createIdentifier(name)), [factory_1.factory.createLiteralTypeNode(LiteralFactory_1.LiteralFactory.write(argument))]);
|
|
44
|
+
const tagsOf = (importer) => importer.external({
|
|
45
|
+
declaration: true,
|
|
46
|
+
file: `typia`,
|
|
47
|
+
type: "element",
|
|
48
|
+
name: "tags",
|
|
49
|
+
});
|
|
34
50
|
})(SdkTypeTagProgrammer || (exports.SdkTypeTagProgrammer = SdkTypeTagProgrammer = {}));
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
])
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
51
|
+
/**
|
|
52
|
+
* The predefined tag a JSDoc comment tag stands for.
|
|
53
|
+
*
|
|
54
|
+
* Typia names a comment tag, `@format uri`, after that tag with its brackets,
|
|
55
|
+
* `Format<"uri">`, while a type tag's name has none, as the SDK's component
|
|
56
|
+
* names drop them. The source has no type tag to equal, and a comment tag may
|
|
57
|
+
* validate its own way, such as a format's inlined expression, so it prints as
|
|
58
|
+
* the tag the comment names whenever the argument suits the tagged type.
|
|
59
|
+
*/
|
|
60
|
+
const comment = (from, tag) => {
|
|
61
|
+
if (tag.name.includes("<") === false)
|
|
62
|
+
return null;
|
|
63
|
+
const definition = DEFINITIONS[tag.kind];
|
|
64
|
+
if (definition === undefined || tag.name.split("<")[0] !== definition.name)
|
|
65
|
+
return null;
|
|
66
|
+
const argument = argumentOf(definition, tag);
|
|
67
|
+
return argument !== undefined && definition.expand(from, argument) !== null
|
|
68
|
+
? { name: definition.name, argument }
|
|
69
|
+
: null;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* The typia tag the metadata's type tag is, with the argument that makes it, or
|
|
73
|
+
* `null` when no predefined tag expands to it exactly.
|
|
74
|
+
*/
|
|
75
|
+
const recognize = (from, tag) => {
|
|
76
|
+
const definition = DEFINITIONS[tag.kind];
|
|
77
|
+
if (definition === undefined)
|
|
78
|
+
return null;
|
|
79
|
+
const argument = argumentOf(definition, tag);
|
|
80
|
+
if (argument === undefined)
|
|
81
|
+
return null;
|
|
82
|
+
const expected = definition.expand(from, argument);
|
|
83
|
+
if (expected === null)
|
|
84
|
+
return null;
|
|
85
|
+
// the metadata holds the schema as JSON holds it
|
|
86
|
+
return equals(expected.validate, tag.validate) &&
|
|
87
|
+
equals(expected.exclusive, tag.exclusive) &&
|
|
88
|
+
equals(json(expected.schema), tag.schema)
|
|
89
|
+
? { name: definition.name, argument }
|
|
90
|
+
: null;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* The type argument a tag was written with: its value, or, for a tag whose
|
|
94
|
+
* value is no literal, the schema member holding it. NaN has no literal type to
|
|
95
|
+
* write, so it gives none.
|
|
96
|
+
*/
|
|
97
|
+
const argumentOf = (definition, tag) => {
|
|
98
|
+
var _a;
|
|
99
|
+
const value = (0, legacy_1.decodeTagValue)(tag);
|
|
100
|
+
const argument = value === null || value === undefined
|
|
101
|
+
? (_a = definition.fallback) === null || _a === void 0 ? void 0 : _a.call(definition, tag.schema)
|
|
102
|
+
: value;
|
|
103
|
+
return Number.isNaN(argument) ? undefined : argument;
|
|
104
|
+
};
|
|
105
|
+
/** `${Value}` of a numeric type argument, as a TypeScript template prints it. */
|
|
106
|
+
const numeral = (value) => typeof value === "bigint" ? `BigInt(${value})` : String(value);
|
|
107
|
+
const isNumeric = (value) => typeof value === "number" || typeof value === "bigint";
|
|
108
|
+
/**
|
|
109
|
+
* A value as JSON holds it: a bigint as its number, as typia's `Numeric<Value>`
|
|
110
|
+
* does, and a non-finite number as null, as `JSON.stringify` writes it.
|
|
111
|
+
*/
|
|
112
|
+
const json = (value) => typeof value === "bigint"
|
|
113
|
+
? Number(value)
|
|
114
|
+
: typeof value === "number" && Number.isFinite(value) === false
|
|
115
|
+
? null
|
|
116
|
+
: Array.isArray(value)
|
|
117
|
+
? value.map(json)
|
|
118
|
+
: typeof value === "object" && value !== null
|
|
119
|
+
? Object.fromEntries(Object.entries(value).map(([key, v]) => [key, json(v)]))
|
|
120
|
+
: value;
|
|
121
|
+
const bound = (kind, exclusive, validate) => (from, argument) => isNumeric(argument) &&
|
|
122
|
+
from === (typeof argument === "bigint" ? "bigint" : "number")
|
|
123
|
+
? {
|
|
124
|
+
validate: validate(numeral(argument)),
|
|
125
|
+
exclusive,
|
|
126
|
+
schema: { [kind]: json(argument) },
|
|
127
|
+
}
|
|
128
|
+
: null;
|
|
129
|
+
const TYPE_VALIDATE = {
|
|
130
|
+
int8: `$importInternal("isTypeInt8")($input)`,
|
|
131
|
+
uint8: `$importInternal("isTypeUint8")($input)`,
|
|
132
|
+
int16: `$importInternal("isTypeInt16")($input)`,
|
|
133
|
+
uint16: `$importInternal("isTypeUint16")($input)`,
|
|
134
|
+
int32: `$importInternal("isTypeInt32")($input)`,
|
|
135
|
+
uint32: `$importInternal("isTypeUint32")($input)`,
|
|
136
|
+
int64: {
|
|
137
|
+
number: `$importInternal("isTypeInt64")($input)`,
|
|
138
|
+
bigint: `$importInternal("isTypeInt64Bigint")($input)`,
|
|
139
|
+
},
|
|
140
|
+
uint64: {
|
|
141
|
+
number: `$importInternal("isTypeUint64")($input)`,
|
|
142
|
+
bigint: `$importInternal("isTypeUint64Bigint")($input)`,
|
|
143
|
+
},
|
|
144
|
+
float: `$importInternal("isTypeFloat")($input)`,
|
|
145
|
+
double: `true`,
|
|
146
|
+
};
|
|
147
|
+
/** `Format.Value` of typia's `Format` tag. */
|
|
148
|
+
const FORMATS = new Set([
|
|
149
|
+
"byte",
|
|
150
|
+
"password",
|
|
151
|
+
"regex",
|
|
152
|
+
"uuid",
|
|
153
|
+
"email",
|
|
154
|
+
"hostname",
|
|
155
|
+
"idn-email",
|
|
156
|
+
"idn-hostname",
|
|
157
|
+
"iri",
|
|
158
|
+
"iri-reference",
|
|
159
|
+
"ipv4",
|
|
160
|
+
"ipv6",
|
|
161
|
+
"uri",
|
|
162
|
+
"uri-reference",
|
|
163
|
+
"uri-template",
|
|
164
|
+
"url",
|
|
165
|
+
"date-time",
|
|
166
|
+
"date",
|
|
167
|
+
"time",
|
|
168
|
+
"duration",
|
|
169
|
+
"json-pointer",
|
|
170
|
+
"relative-json-pointer",
|
|
171
|
+
]);
|
|
172
|
+
/** `DefaultAtomic` of typia's `Default` tag. */
|
|
173
|
+
const isDefaultAtomic = (value) => typeof value === "boolean" ||
|
|
174
|
+
typeof value === "bigint" ||
|
|
175
|
+
typeof value === "number" ||
|
|
176
|
+
typeof value === "string";
|
|
177
|
+
/** `PascalizeString` of typia's `Format` tag: `date-time` as `DateTime`. */
|
|
178
|
+
const pascalize = (value) => value.includes("-")
|
|
179
|
+
? value
|
|
180
|
+
.split("-")
|
|
181
|
+
.filter((word) => word.length !== 0)
|
|
182
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
183
|
+
.join("")
|
|
184
|
+
: value.charAt(0).toUpperCase() + value.slice(1);
|
|
185
|
+
/** `Serialize` of typia's `Pattern` tag, escaping as a string literal. */
|
|
186
|
+
const serialize = (value) => value.replace(/["\\\b\f\n\r\t]/g, (char) => ({
|
|
187
|
+
'"': '\\"',
|
|
188
|
+
"\\": "\\\\",
|
|
189
|
+
"\b": "\\b",
|
|
190
|
+
"\f": "\\f",
|
|
191
|
+
"\n": "\\n",
|
|
192
|
+
"\r": "\\r",
|
|
193
|
+
"\t": "\\t",
|
|
194
|
+
})[char]);
|
|
195
|
+
/**
|
|
196
|
+
* Every predefined typia tag, keyed by its kind, as `@typia/interface` declares
|
|
197
|
+
* it.
|
|
198
|
+
*/
|
|
199
|
+
const DEFINITIONS = {
|
|
200
|
+
minimum: {
|
|
201
|
+
name: "Minimum",
|
|
202
|
+
expand: bound("minimum", ["minimum", "exclusiveMinimum"], (v) => `${v} <= $input`),
|
|
203
|
+
},
|
|
204
|
+
maximum: {
|
|
205
|
+
name: "Maximum",
|
|
206
|
+
expand: bound("maximum", ["maximum", "exclusiveMaximum"], (v) => `$input <= ${v}`),
|
|
207
|
+
},
|
|
208
|
+
exclusiveMinimum: {
|
|
209
|
+
name: "ExclusiveMinimum",
|
|
210
|
+
expand: bound("exclusiveMinimum", ["exclusiveMinimum", "minimum"], (v) => `${v} < $input`),
|
|
211
|
+
},
|
|
212
|
+
exclusiveMaximum: {
|
|
213
|
+
name: "ExclusiveMaximum",
|
|
214
|
+
expand: bound("exclusiveMaximum", ["exclusiveMaximum", "maximum"], (v) => `$input < ${v}`),
|
|
215
|
+
},
|
|
216
|
+
multipleOf: {
|
|
217
|
+
name: "MultipleOf",
|
|
218
|
+
expand: (from, argument) => isNumeric(argument) &&
|
|
219
|
+
from === (typeof argument === "bigint" ? "bigint" : "number")
|
|
220
|
+
? {
|
|
221
|
+
validate: typeof argument === "bigint"
|
|
222
|
+
? `$input % ${numeral(argument)} === ${numeral(BigInt(0))}`
|
|
223
|
+
: `$importInternal("_isMultipleOf")($input, ${argument})`,
|
|
224
|
+
exclusive: true,
|
|
225
|
+
schema: { multipleOf: json(argument) },
|
|
226
|
+
}
|
|
227
|
+
: null,
|
|
228
|
+
},
|
|
229
|
+
type: {
|
|
230
|
+
name: "Type",
|
|
231
|
+
expand: (from, argument) => {
|
|
232
|
+
if (typeof argument !== "string")
|
|
233
|
+
return null;
|
|
234
|
+
const validate = TYPE_VALIDATE[argument];
|
|
235
|
+
if (validate === undefined)
|
|
236
|
+
return null;
|
|
237
|
+
const wide = argument === "int64" || argument === "uint64";
|
|
238
|
+
if (from !== "number" && (wide === false || from !== "bigint"))
|
|
239
|
+
return null;
|
|
240
|
+
return {
|
|
241
|
+
validate: typeof validate === "string" ? validate : validate[from],
|
|
242
|
+
exclusive: true,
|
|
243
|
+
schema: argument.startsWith("uint")
|
|
244
|
+
? { type: "integer", minimum: 0 }
|
|
245
|
+
: { type: argument.startsWith("int") ? "integer" : "number" },
|
|
246
|
+
};
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
format: {
|
|
250
|
+
name: "Format",
|
|
251
|
+
expand: (from, argument) => from === "string" && typeof argument === "string" && FORMATS.has(argument)
|
|
252
|
+
? {
|
|
253
|
+
validate: `$importInternal("isFormat${pascalize(argument)}")($input)`,
|
|
254
|
+
exclusive: ["format", "pattern"],
|
|
255
|
+
schema: { format: argument },
|
|
256
|
+
}
|
|
257
|
+
: null,
|
|
258
|
+
},
|
|
259
|
+
pattern: {
|
|
260
|
+
name: "Pattern",
|
|
261
|
+
expand: (from, argument) => from === "string" && typeof argument === "string"
|
|
262
|
+
? {
|
|
263
|
+
validate: `RegExp("${serialize(argument)}").test($input)`,
|
|
264
|
+
exclusive: ["format", "pattern"],
|
|
265
|
+
schema: { pattern: argument },
|
|
266
|
+
}
|
|
267
|
+
: null,
|
|
268
|
+
},
|
|
269
|
+
minLength: {
|
|
270
|
+
name: "MinLength",
|
|
271
|
+
expand: (from, argument) => from === "string" && typeof argument === "number"
|
|
272
|
+
? {
|
|
273
|
+
validate: `$importInternal("_stringLengthGte")($input, ${argument})`,
|
|
274
|
+
exclusive: true,
|
|
275
|
+
schema: { minLength: argument },
|
|
276
|
+
}
|
|
277
|
+
: null,
|
|
278
|
+
},
|
|
279
|
+
maxLength: {
|
|
280
|
+
name: "MaxLength",
|
|
281
|
+
expand: (from, argument) => from === "string" && typeof argument === "number"
|
|
282
|
+
? {
|
|
283
|
+
validate: `$importInternal("_stringLengthLte")($input, ${argument})`,
|
|
284
|
+
exclusive: true,
|
|
285
|
+
schema: { maxLength: argument },
|
|
286
|
+
}
|
|
287
|
+
: null,
|
|
288
|
+
},
|
|
289
|
+
minItems: {
|
|
290
|
+
name: "MinItems",
|
|
291
|
+
expand: (from, argument) => from === "array" && typeof argument === "number"
|
|
292
|
+
? {
|
|
293
|
+
validate: `${argument} <= $input.length`,
|
|
294
|
+
exclusive: true,
|
|
295
|
+
schema: { minItems: argument },
|
|
296
|
+
}
|
|
297
|
+
: null,
|
|
298
|
+
},
|
|
299
|
+
maxItems: {
|
|
300
|
+
name: "MaxItems",
|
|
301
|
+
expand: (from, argument) => from === "array" && typeof argument === "number"
|
|
302
|
+
? {
|
|
303
|
+
validate: `$input.length <= ${argument}`,
|
|
304
|
+
exclusive: true,
|
|
305
|
+
schema: { maxItems: argument },
|
|
306
|
+
}
|
|
307
|
+
: null,
|
|
308
|
+
},
|
|
309
|
+
uniqueItems: {
|
|
310
|
+
name: "UniqueItems",
|
|
311
|
+
expand: (from, argument) => from === "array" && typeof argument === "boolean"
|
|
312
|
+
? {
|
|
313
|
+
validate: argument
|
|
314
|
+
? `$importInternal("isUniqueItems")($input)`
|
|
315
|
+
: undefined,
|
|
316
|
+
exclusive: true,
|
|
317
|
+
schema: { uniqueItems: true },
|
|
318
|
+
}
|
|
319
|
+
: null,
|
|
320
|
+
},
|
|
321
|
+
contentMediaType: {
|
|
322
|
+
name: "ContentMediaType",
|
|
323
|
+
expand: (from, argument) => from === "string" && typeof argument === "string"
|
|
324
|
+
? {
|
|
325
|
+
validate: undefined,
|
|
326
|
+
exclusive: false,
|
|
327
|
+
schema: { contentMediaType: argument },
|
|
328
|
+
}
|
|
329
|
+
: null,
|
|
330
|
+
fallback: (schema) => schema === null || schema === void 0 ? void 0 : schema.contentMediaType,
|
|
331
|
+
},
|
|
332
|
+
default: {
|
|
333
|
+
name: "Default",
|
|
334
|
+
expand: (from, argument) => from ===
|
|
335
|
+
(Array.isArray(argument)
|
|
336
|
+
? argument.every(isDefaultAtomic)
|
|
337
|
+
? "array"
|
|
338
|
+
: null
|
|
339
|
+
: typeof argument === "boolean"
|
|
340
|
+
? "boolean"
|
|
341
|
+
: typeof argument === "bigint"
|
|
342
|
+
? "bigint"
|
|
343
|
+
: typeof argument === "number"
|
|
344
|
+
? "number"
|
|
345
|
+
: typeof argument === "string"
|
|
346
|
+
? "string"
|
|
347
|
+
: null)
|
|
348
|
+
? {
|
|
349
|
+
validate: undefined,
|
|
350
|
+
exclusive: true,
|
|
351
|
+
schema: { default: json(argument) },
|
|
352
|
+
}
|
|
353
|
+
: null,
|
|
354
|
+
fallback: (schema) => schema === null || schema === void 0 ? void 0 : schema.default,
|
|
355
|
+
},
|
|
356
|
+
example: {
|
|
357
|
+
name: "Example",
|
|
358
|
+
expand: (_from, argument) => ({
|
|
359
|
+
validate: undefined,
|
|
360
|
+
exclusive: true,
|
|
361
|
+
schema: {
|
|
362
|
+
example: typeof argument === "bigint" ? Number(argument) : argument,
|
|
363
|
+
},
|
|
364
|
+
}),
|
|
365
|
+
fallback: (schema) => schema === null || schema === void 0 ? void 0 : schema.example,
|
|
366
|
+
},
|
|
367
|
+
examples: {
|
|
368
|
+
name: "Examples",
|
|
369
|
+
expand: (_from, argument) => typeof argument === "object" &&
|
|
370
|
+
argument !== null &&
|
|
371
|
+
Array.isArray(argument) === false &&
|
|
372
|
+
Object.values(argument).every((value) => value !== undefined)
|
|
373
|
+
? {
|
|
374
|
+
validate: undefined,
|
|
375
|
+
exclusive: true,
|
|
376
|
+
schema: { examples: argument },
|
|
377
|
+
}
|
|
378
|
+
: null,
|
|
379
|
+
fallback: (schema) => schema === null || schema === void 0 ? void 0 : schema.examples,
|
|
380
|
+
},
|
|
381
|
+
sequence: {
|
|
382
|
+
name: "Sequence",
|
|
383
|
+
expand: (_from, argument) => typeof argument === "number"
|
|
384
|
+
? {
|
|
385
|
+
validate: undefined,
|
|
386
|
+
exclusive: false,
|
|
387
|
+
schema: { "x-protobuf-sequence": argument },
|
|
388
|
+
}
|
|
389
|
+
: null,
|
|
390
|
+
},
|
|
391
|
+
};
|
|
392
|
+
/** Structural equality of metadata values, which hold bigints. */
|
|
393
|
+
const equals = (x, y) => {
|
|
394
|
+
if (x === y)
|
|
395
|
+
return true;
|
|
396
|
+
if (typeof x !== "object" || typeof y !== "object")
|
|
397
|
+
return false;
|
|
398
|
+
if (x === null || y === null)
|
|
399
|
+
return false;
|
|
400
|
+
if (Array.isArray(x) !== Array.isArray(y))
|
|
401
|
+
return false;
|
|
402
|
+
const xKeys = Object.keys(x).filter((key) => x[key] !== undefined);
|
|
403
|
+
const yKeys = Object.keys(y).filter((key) => y[key] !== undefined);
|
|
404
|
+
return (xKeys.length === yKeys.length &&
|
|
405
|
+
xKeys.every((key) => equals(x[key], y[key])));
|
|
66
406
|
};
|
|
67
|
-
// export * from "./Constant";
|
|
68
|
-
// export * from "./ContentMediaType";
|
|
69
|
-
// export * from "./Default";
|
|
70
|
-
// export * from "./Example";
|
|
71
|
-
// export * from "./Examples";
|
|
72
|
-
// export * from "./ExclusiveMaximum";
|
|
73
|
-
// export * from "./ExclusiveMinimum";
|
|
74
|
-
// export * from "./Format";
|
|
75
|
-
// export * from "./JsonSchemaPlugin";
|
|
76
|
-
// export * from "./Maximum";
|
|
77
|
-
// export * from "./MaxItems";
|
|
78
|
-
// export * from "./MaxLength";
|
|
79
|
-
// export * from "./Minimum";
|
|
80
|
-
// export * from "./MinItems";
|
|
81
|
-
// export * from "./MinLength";
|
|
82
|
-
// export * from "./MultipleOf";
|
|
83
|
-
// export * from "./Pattern";
|
|
84
|
-
// export * from "./Sequence";
|
|
85
|
-
// export * from "./TagBase";
|
|
86
|
-
// export * from "./Type";
|
|
87
|
-
// export * from "./UniqueItems";
|
|
88
407
|
//# sourceMappingURL=SdkTypeTagProgrammer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SdkTypeTagProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkTypeTagProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AAGvD,mEAAgE;AAGhE,IAAiB,oBAAoB,CAgDpC;AAhDD,WAAiB,oBAAoB;IACtB,0BAAK,GAAG,CACnB,QAA0B,EAC1B,IAAqE,EACrE,GAAqB,EACX,EAAE;;QACZ,MAAM,IAAI,GAAW,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;QAC7C,IAAI,CAAA,MAAA,UAAU,CAAC,IAAI,CAAC,0CAAE,GAAG,CAAC,IAAI,CAAC,MAAK,IAAI;YACtC,OAAO,iBAAO,CAAC,uBAAuB,CACpC,iBAAO,CAAC,mBAAmB,CACzB,iBAAO,CAAC,gBAAgB,CACtB,QAAQ,CAAC,QAAQ,CAAC;gBAChB,WAAW,EAAE,IAAI;gBACjB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,MAAM;aACb,CAAC,CACH,EACD,iBAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAC/B,EACD,CAAC,iBAAO,CAAC,qBAAqB,CAAC,+BAAc,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAQ,CAAC,CAAC,CACxE,CAAC;QACJ,OAAO,iBAAO,CAAC,uBAAuB,CACpC,iBAAO,CAAC,mBAAmB,CACzB,iBAAO,CAAC,gBAAgB,CACtB,QAAQ,CAAC,QAAQ,CAAC;YAChB,WAAW,EAAE,IAAI;YACjB,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,MAAM;SACb,CAAC,CACH,EACD,iBAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,CACpC,EACD;YAC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,KAAK,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACxD,MAAM,KAAK,GAAa,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAC3C,CAAC,GAAG,EAAE,EAAE,CAAE,CAA6B,CAAC,GAAG,CAAC,KAAK,SAAS,CAC3D,CAAC;IACF,MAAM,KAAK,GAAa,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAC3C,CAAC,GAAG,EAAE,EAAE,CAAE,CAA6B,CAAC,GAAG,CAAC,KAAK,SAAS,CAC3D,CAAC;IACF,OAAO,CACL,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;QAC7B,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAClB,MAAM,CACH,CAA6B,CAAC,GAAG,CAAC,EAClC,CAA6B,CAAC,GAAG,CAAC,CACpC,CACF,CACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -7,13 +7,14 @@ const IdentifierFactory_1 = require("../../factories/IdentifierFactory");
|
|
|
7
7
|
const TypeFactory_1 = require("../../factories/TypeFactory");
|
|
8
8
|
const FilePrinter_1 = require("./FilePrinter");
|
|
9
9
|
const SdkAliasCollection_1 = require("./SdkAliasCollection");
|
|
10
|
+
const SdkPathTemplate_1 = require("./SdkPathTemplate");
|
|
10
11
|
const SdkWebSocketParameterProgrammer_1 = require("./SdkWebSocketParameterProgrammer");
|
|
11
12
|
var SdkWebSocketNamespaceProgrammer;
|
|
12
13
|
(function (SdkWebSocketNamespaceProgrammer) {
|
|
13
14
|
SdkWebSocketNamespaceProgrammer.write = (project) => (importer) => (route) => factory_1.factory.createModuleDeclaration([factory_1.factory.createToken(factory_1.SyntaxKind.ExportKeyword)], factory_1.factory.createIdentifier(route.name), factory_1.factory.createModuleBlock([
|
|
14
15
|
...writeTypes(project)(importer)(route),
|
|
15
16
|
FilePrinter_1.FilePrinter.enter(),
|
|
16
|
-
writePath(project)(route),
|
|
17
|
+
writePath(project)(importer)(route),
|
|
17
18
|
]), factory_1.NodeFlags.Namespace);
|
|
18
19
|
const writeTypes = (project) => (importer) => (route) => {
|
|
19
20
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -21,7 +22,7 @@ var SdkWebSocketNamespaceProgrammer;
|
|
|
21
22
|
const output = [];
|
|
22
23
|
const declare = (name, type) => output.push(factory_1.factory.createTypeAliasDeclaration([factory_1.factory.createModifier(factory_1.SyntaxKind.ExportKeyword)], name, undefined, type));
|
|
23
24
|
if (project.config.keyword === true)
|
|
24
|
-
declare("Props", SdkAliasCollection_1.SdkAliasCollection.websocketProps(route));
|
|
25
|
+
declare("Props", SdkAliasCollection_1.SdkAliasCollection.websocketProps(route, SdkWebSocketParameterProgrammer_1.SdkWebSocketParameterProgrammer.getNames({ project, route })));
|
|
25
26
|
declare("Output", factory_1.factory.createTypeLiteralNode([
|
|
26
27
|
factory_1.factory.createPropertySignature(undefined, "connector", undefined, factory_1.factory.createTypeReferenceNode(importer.external({
|
|
27
28
|
declaration: false,
|
|
@@ -54,7 +55,7 @@ var SdkWebSocketNamespaceProgrammer;
|
|
|
54
55
|
declare("Query", SdkAliasCollection_1.SdkAliasCollection.name(route.query));
|
|
55
56
|
return output;
|
|
56
57
|
};
|
|
57
|
-
const writePath = (project) => (route) => {
|
|
58
|
+
const writePath = (project) => (importer) => (route) => {
|
|
58
59
|
const out = (body) => constant("path")(factory_1.factory.createArrowFunction([], [], SdkWebSocketParameterProgrammer_1.SdkWebSocketParameterProgrammer.getParameterDeclarations({
|
|
59
60
|
project,
|
|
60
61
|
route,
|
|
@@ -62,55 +63,45 @@ var SdkWebSocketNamespaceProgrammer;
|
|
|
62
63
|
prefix: false,
|
|
63
64
|
}), undefined, undefined, body));
|
|
64
65
|
if (route.pathParameters.length === 0 && route.query === null)
|
|
65
|
-
return out(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const template = () => {
|
|
70
|
-
const split = route.path.split(":");
|
|
71
|
-
if (split.length === 1)
|
|
72
|
-
return factory_1.factory.createStringLiteral(route.path);
|
|
73
|
-
return factory_1.factory.createTemplateExpression(factory_1.factory.createTemplateHead(split[0]), split.slice(1).map((s, i, arr) => {
|
|
74
|
-
const name = s.split("/")[0];
|
|
75
|
-
return factory_1.factory.createTemplateSpan(factory_1.factory.createCallExpression(factory_1.factory.createIdentifier("encodeURIComponent"), undefined, [
|
|
76
|
-
factory_1.factory.createBinaryExpression(factory_1.factory.createCallChain(factory_1.factory.createPropertyAccessChain(access(route.pathParameters.find((p) => p.field === name)
|
|
77
|
-
.name), factory_1.factory.createToken(factory_1.SyntaxKind.QuestionDotToken), "toString"), undefined, undefined, []), factory_1.factory.createToken(factory_1.SyntaxKind.QuestionQuestionToken), factory_1.factory.createStringLiteral("null")),
|
|
78
|
-
]), (i !== arr.length - 1
|
|
79
|
-
? factory_1.factory.createTemplateMiddle
|
|
80
|
-
: factory_1.factory.createTemplateTail)(s.substring(name.length)));
|
|
66
|
+
return out(SdkPathTemplate_1.SdkPathTemplate.compose({
|
|
67
|
+
importer,
|
|
68
|
+
path: route.path,
|
|
69
|
+
argument: () => factory_1.factory.createIdentifier("undefined"),
|
|
81
70
|
}));
|
|
82
|
-
};
|
|
71
|
+
const names = SdkWebSocketParameterProgrammer_1.SdkWebSocketParameterProgrammer.getNames({ project, route });
|
|
72
|
+
const template = () => SdkPathTemplate_1.SdkPathTemplate.compose({
|
|
73
|
+
importer,
|
|
74
|
+
path: route.path,
|
|
75
|
+
argument: (name) => names.access(names.parameter(route.pathParameters.find((p) => p.field === name))),
|
|
76
|
+
});
|
|
83
77
|
if (route.query === null)
|
|
84
78
|
return out(template());
|
|
85
79
|
const block = (expr) => {
|
|
86
|
-
const
|
|
87
|
-
? computeName("_" + str)
|
|
88
|
-
: str;
|
|
89
|
-
const variables = computeName("variables");
|
|
80
|
+
const variables = names.variables;
|
|
90
81
|
return factory_1.factory.createBlock([
|
|
91
82
|
local(variables)("URLSearchParams")(factory_1.factory.createNewExpression(factory_1.factory.createIdentifier("URLSearchParams"), [], [])),
|
|
92
83
|
factory_1.factory.createForOfStatement(undefined, factory_1.factory.createVariableDeclarationList([
|
|
93
84
|
factory_1.factory.createVariableDeclaration(factory_1.factory.createArrayBindingPattern([
|
|
94
|
-
factory_1.factory.createBindingElement(undefined, undefined, factory_1.factory.createIdentifier(
|
|
95
|
-
factory_1.factory.createBindingElement(undefined, undefined, factory_1.factory.createIdentifier(
|
|
85
|
+
factory_1.factory.createBindingElement(undefined, undefined, factory_1.factory.createIdentifier(names.key), undefined),
|
|
86
|
+
factory_1.factory.createBindingElement(undefined, undefined, factory_1.factory.createIdentifier(names.value), undefined),
|
|
96
87
|
]), undefined, undefined, undefined),
|
|
97
|
-
], factory_1.NodeFlags.Const), factory_1.factory.createCallExpression(factory_1.factory.createIdentifier("Object.entries"), undefined, [factory_1.factory.createAsExpression(expr, TypeFactory_1.TypeFactory.keyword("any"))]), factory_1.factory.createIfStatement(factory_1.factory.createStrictEquality(factory_1.factory.createIdentifier("undefined"), factory_1.factory.createIdentifier(
|
|
98
|
-
factory_1.factory.createArrowFunction(undefined, undefined, [IdentifierFactory_1.IdentifierFactory.parameter(
|
|
99
|
-
factory_1.factory.createIdentifier(
|
|
100
|
-
factory_1.factory.createCallExpression(factory_1.factory.createIdentifier("String"), undefined, [factory_1.factory.createIdentifier(
|
|
88
|
+
], factory_1.NodeFlags.Const), factory_1.factory.createCallExpression(factory_1.factory.createIdentifier("Object.entries"), undefined, [factory_1.factory.createAsExpression(expr, TypeFactory_1.TypeFactory.keyword("any"))]), factory_1.factory.createIfStatement(factory_1.factory.createStrictEquality(factory_1.factory.createIdentifier("undefined"), factory_1.factory.createIdentifier(names.value)), factory_1.factory.createContinueStatement(), factory_1.factory.createIfStatement(factory_1.factory.createCallExpression(factory_1.factory.createIdentifier("Array.isArray"), undefined, [factory_1.factory.createIdentifier(names.value)]), factory_1.factory.createExpressionStatement(factory_1.factory.createCallExpression(factory_1.factory.createPropertyAccessExpression(factory_1.factory.createIdentifier(names.value), factory_1.factory.createIdentifier("forEach")), undefined, [
|
|
89
|
+
factory_1.factory.createArrowFunction(undefined, undefined, [IdentifierFactory_1.IdentifierFactory.parameter(names.elem)], undefined, undefined, factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(variables), "append"), undefined, [
|
|
90
|
+
factory_1.factory.createIdentifier(names.key),
|
|
91
|
+
factory_1.factory.createCallExpression(factory_1.factory.createIdentifier("String"), undefined, [factory_1.factory.createIdentifier(names.elem)]),
|
|
101
92
|
])),
|
|
102
93
|
])), factory_1.factory.createExpressionStatement(factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(variables), "set"), undefined, [
|
|
103
|
-
factory_1.factory.createIdentifier(
|
|
104
|
-
factory_1.factory.createCallExpression(factory_1.factory.createIdentifier("String"), undefined, [factory_1.factory.createIdentifier(
|
|
94
|
+
factory_1.factory.createIdentifier(names.key),
|
|
95
|
+
factory_1.factory.createCallExpression(factory_1.factory.createIdentifier("String"), undefined, [factory_1.factory.createIdentifier(names.value)]),
|
|
105
96
|
]))))),
|
|
106
|
-
local(
|
|
107
|
-
factory_1.factory.createReturnStatement(factory_1.factory.createConditionalExpression(factory_1.factory.createStrictEquality(ExpressionFactory_1.ExpressionFactory.number(0), IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(variables), "size")), undefined, factory_1.factory.createIdentifier(
|
|
108
|
-
factory_1.factory.createTemplateSpan(factory_1.factory.createIdentifier(
|
|
97
|
+
local(names.location)("string")(template()),
|
|
98
|
+
factory_1.factory.createReturnStatement(factory_1.factory.createConditionalExpression(factory_1.factory.createStrictEquality(ExpressionFactory_1.ExpressionFactory.number(0), IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(variables), "size")), undefined, factory_1.factory.createIdentifier(names.location), undefined, factory_1.factory.createTemplateExpression(factory_1.factory.createTemplateHead(""), [
|
|
99
|
+
factory_1.factory.createTemplateSpan(factory_1.factory.createIdentifier(names.location), factory_1.factory.createTemplateMiddle("?")),
|
|
109
100
|
factory_1.factory.createTemplateSpan(factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(variables), "toString"), undefined, undefined), factory_1.factory.createTemplateTail("")),
|
|
110
101
|
]))),
|
|
111
102
|
], true);
|
|
112
103
|
};
|
|
113
|
-
return out(block(access(
|
|
104
|
+
return out(block(names.access(names.query)));
|
|
114
105
|
};
|
|
115
106
|
})(SdkWebSocketNamespaceProgrammer || (exports.SdkWebSocketNamespaceProgrammer = SdkWebSocketNamespaceProgrammer = {}));
|
|
116
107
|
const local = (name) => (type) => (expression) => factory_1.factory.createVariableStatement([], factory_1.factory.createVariableDeclarationList([
|