@azure-tools/typespec-ts 0.50.2 → 0.50.3
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/CHANGELOG.md +6 -0
- package/dist/src/framework/hooks/binder.d.ts +1 -1
- package/dist/src/framework/hooks/binder.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.js +11 -3
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/load-static-helpers.d.ts +3 -0
- package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
- package/dist/src/framework/load-static-helpers.js +49 -38
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +19 -10
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +7 -0
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +5 -0
- package/dist/src/lib.js.map +1 -1
- package/dist/src/modular/buildOperations.d.ts.map +1 -1
- package/dist/src/modular/buildOperations.js +1 -1
- package/dist/src/modular/buildOperations.js.map +1 -1
- package/dist/src/modular/emitModels.d.ts +8 -0
- package/dist/src/modular/emitModels.d.ts.map +1 -1
- package/dist/src/modular/emitModels.js +32 -2
- package/dist/src/modular/emitModels.js.map +1 -1
- package/dist/src/modular/emitSamples.js +9 -4
- package/dist/src/modular/emitSamples.js.map +1 -1
- package/dist/src/modular/emitTests.d.ts +7 -0
- package/dist/src/modular/emitTests.d.ts.map +1 -0
- package/dist/src/modular/emitTests.js +160 -0
- package/dist/src/modular/emitTests.js.map +1 -0
- package/dist/src/modular/external-dependencies.d.ts +42 -0
- package/dist/src/modular/external-dependencies.d.ts.map +1 -1
- package/dist/src/modular/external-dependencies.js +42 -0
- package/dist/src/modular/external-dependencies.js.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts +83 -0
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/exampleValueHelpers.js +631 -0
- package/dist/src/modular/helpers/exampleValueHelpers.js.map +1 -0
- package/dist/src/modular/helpers/operationHelpers.d.ts +22 -2
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.js +178 -9
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
- package/dist/src/modular/static-helpers-metadata.d.ts +12 -0
- package/dist/src/modular/static-helpers-metadata.d.ts.map +1 -1
- package/dist/src/modular/static-helpers-metadata.js +12 -0
- package/dist/src/modular/static-helpers-metadata.js.map +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -1
- package/dist/src/transform/transfromRLCOptions.js +10 -0
- package/dist/src/transform/transfromRLCOptions.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/framework/hooks/binder.ts +15 -5
- package/src/framework/load-static-helpers.ts +79 -51
- package/src/index.ts +22 -7
- package/src/lib.ts +13 -0
- package/src/modular/buildOperations.ts +2 -1
- package/src/modular/emitModels.ts +47 -2
- package/src/modular/emitSamples.ts +7 -1
- package/src/modular/emitTests.ts +227 -0
- package/src/modular/external-dependencies.ts +43 -0
- package/src/modular/helpers/exampleValueHelpers.ts +940 -0
- package/src/modular/helpers/operationHelpers.ts +229 -17
- package/src/modular/static-helpers-metadata.ts +13 -0
- package/src/transform/transfromRLCOptions.ts +14 -0
- package/static/static-helpers/serialization/get-binary-response-body-browser.mts +22 -0
- package/static/static-helpers/serialization/get-binary-response-body.ts +24 -0
- package/static/test-helpers/recordedClient.ts +30 -0
|
@@ -0,0 +1,631 @@
|
|
|
1
|
+
import { isReadOnly } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
+
import { isAzurePackage, NameType, normalizeName } from "@azure-tools/rlc-common";
|
|
3
|
+
import { resolveReference } from "../../framework/reference.js";
|
|
4
|
+
import { AzureIdentityDependencies, AzureTestDependencies } from "../external-dependencies.js";
|
|
5
|
+
import { hasKeyCredential, hasTokenCredential } from "../../utils/credentialUtils.js";
|
|
6
|
+
import { isSpreadBodyParameter } from "./typeHelpers.js";
|
|
7
|
+
import { getClassicalClientName } from "./namingHelpers.js";
|
|
8
|
+
import { getMethodHierarchiesMap } from "../../utils/operationUtil.js";
|
|
9
|
+
import { getSubscriptionId } from "../../transform/transfromRLCOptions.js";
|
|
10
|
+
import { useContext } from "../../contextManager.js";
|
|
11
|
+
import { join } from "path";
|
|
12
|
+
import { getOperationFunction } from "./operationHelpers.js";
|
|
13
|
+
import { getClientParametersDeclaration } from "./clientHelpers.js";
|
|
14
|
+
/**
|
|
15
|
+
* Build parameter value map from example
|
|
16
|
+
*/
|
|
17
|
+
export function buildParameterValueMap(example) {
|
|
18
|
+
const parameterMap = {};
|
|
19
|
+
example.parameters.forEach((param) => (parameterMap[param.parameter.serializedName] = param));
|
|
20
|
+
return parameterMap;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Prepare a common value for tests
|
|
24
|
+
*/
|
|
25
|
+
export function prepareCommonValue(name, value, isOptional, onClient) {
|
|
26
|
+
return {
|
|
27
|
+
name: normalizeName(name, NameType.Parameter),
|
|
28
|
+
value: typeof value === "string" ? value : serializeExampleValue(value),
|
|
29
|
+
isOptional: Boolean(isOptional),
|
|
30
|
+
onClient: Boolean(onClient)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get credential value for samples
|
|
35
|
+
*/
|
|
36
|
+
export function getCredentialSampleValue(dpgContext, initialization) {
|
|
37
|
+
const keyCredential = hasKeyCredential(initialization), tokenCredential = hasTokenCredential(initialization);
|
|
38
|
+
const defaultSetting = {
|
|
39
|
+
isOptional: false,
|
|
40
|
+
onClient: true,
|
|
41
|
+
name: "credential"
|
|
42
|
+
};
|
|
43
|
+
if (keyCredential || tokenCredential) {
|
|
44
|
+
if (isAzurePackage({ options: dpgContext.rlcOptions })) {
|
|
45
|
+
// Support DefaultAzureCredential for Azure packages
|
|
46
|
+
return {
|
|
47
|
+
...defaultSetting,
|
|
48
|
+
value: `new ${resolveReference(AzureIdentityDependencies.DefaultAzureCredential)}()`
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
else if (keyCredential) {
|
|
52
|
+
// Support ApiKeyCredential for non-Azure packages
|
|
53
|
+
return {
|
|
54
|
+
...defaultSetting,
|
|
55
|
+
value: `{ key: "INPUT_YOUR_KEY_HERE" }`
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
else if (tokenCredential) {
|
|
59
|
+
// Support TokenCredential for non-Azure packages
|
|
60
|
+
return {
|
|
61
|
+
...defaultSetting,
|
|
62
|
+
value: `{ getToken: async () => {
|
|
63
|
+
return { token: "INPUT_YOUR_TOKEN_HERE", expiresOnTimestamp: Date.now() }; } }`
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Get credential value for tests
|
|
71
|
+
*/
|
|
72
|
+
export function getCredentialTestValue(dpgContext, initialization) {
|
|
73
|
+
const createTestCredentialType = resolveReference(AzureTestDependencies.createTestCredential);
|
|
74
|
+
const keyCredential = hasKeyCredential(initialization), tokenCredential = hasTokenCredential(initialization);
|
|
75
|
+
const defaultSetting = {
|
|
76
|
+
isOptional: false,
|
|
77
|
+
onClient: true,
|
|
78
|
+
name: "credential"
|
|
79
|
+
};
|
|
80
|
+
if (keyCredential || tokenCredential) {
|
|
81
|
+
if (dpgContext.arm || hasTokenCredential(initialization)) {
|
|
82
|
+
// Support createTestCredential for ARM/Azure packages
|
|
83
|
+
return {
|
|
84
|
+
...defaultSetting,
|
|
85
|
+
value: `${createTestCredentialType}()`
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
else if (keyCredential) {
|
|
89
|
+
// Support ApiKeyCredential for non-Azure packages
|
|
90
|
+
return {
|
|
91
|
+
...defaultSetting,
|
|
92
|
+
value: `{ key: "INPUT_YOUR_KEY_HERE" } `
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
else if (tokenCredential) {
|
|
96
|
+
// Support TokenCredential for non-Azure packages
|
|
97
|
+
return {
|
|
98
|
+
...defaultSetting,
|
|
99
|
+
value: `{
|
|
100
|
+
getToken: async () => {
|
|
101
|
+
return { token: "INPUT_YOUR_TOKEN_HERE", expiresOnTimestamp: Date.now() };
|
|
102
|
+
}
|
|
103
|
+
} `
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Serialize example value to string representation for tests.
|
|
111
|
+
* Note: This is a simplified serializer for tests that does NOT handle plainDate
|
|
112
|
+
* as Date objects (it stays as string), which is the expected behavior for tests.
|
|
113
|
+
*/
|
|
114
|
+
export function serializeExampleValue(value) {
|
|
115
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
116
|
+
let retValue = `{} as any`;
|
|
117
|
+
switch (value.kind) {
|
|
118
|
+
case "string": {
|
|
119
|
+
switch (value.type.kind) {
|
|
120
|
+
case "utcDateTime":
|
|
121
|
+
retValue = `new Date("${value.value}")`;
|
|
122
|
+
break;
|
|
123
|
+
case "bytes": {
|
|
124
|
+
const encode = (_a = value.type.encode) !== null && _a !== void 0 ? _a : "base64";
|
|
125
|
+
// TODO: add check for un-supported encode
|
|
126
|
+
retValue = `Buffer.from("${value.value}", "${encode}")`;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
default:
|
|
130
|
+
retValue = `"${(_b = value.value) === null || _b === void 0 ? void 0 : _b.toString().replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t").replace(/\f/g, "\\f").replace(/>/g, ">").replace(/</g, "<")}"`;
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
case "boolean":
|
|
136
|
+
case "number":
|
|
137
|
+
case "null":
|
|
138
|
+
case "unknown":
|
|
139
|
+
case "union":
|
|
140
|
+
retValue = `${JSON.stringify(value.value)}`;
|
|
141
|
+
break;
|
|
142
|
+
case "dict":
|
|
143
|
+
case "model": {
|
|
144
|
+
const mapper = buildTestPropertyNameMapper(value.type);
|
|
145
|
+
const values = [];
|
|
146
|
+
const additionalPropertiesValue = value.kind === "model" ? ((_c = value.additionalPropertiesValue) !== null && _c !== void 0 ? _c : {}) : {};
|
|
147
|
+
for (const propName in {
|
|
148
|
+
...value.value
|
|
149
|
+
}) {
|
|
150
|
+
let property;
|
|
151
|
+
if (value.type.kind === "model") {
|
|
152
|
+
property = value.type.properties.find((p) => p.name === propName);
|
|
153
|
+
}
|
|
154
|
+
const propValue = value.value[propName];
|
|
155
|
+
if (propValue === undefined || propValue === null) {
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
// Skip readonly properties as they cannot be set by users
|
|
159
|
+
if (property && isReadOnly(property)) {
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
// Handle flattened properties: inline inner model properties at current level
|
|
163
|
+
if ((property === null || property === void 0 ? void 0 : property.flatten) &&
|
|
164
|
+
property.type.kind === "model" &&
|
|
165
|
+
propValue.kind === "model") {
|
|
166
|
+
const innerMapper = buildTestPropertyNameMapper(property.type);
|
|
167
|
+
for (const innerPropName in (_d = propValue.value) !== null && _d !== void 0 ? _d : {}) {
|
|
168
|
+
const innerPropValue = propValue.value[innerPropName];
|
|
169
|
+
if (innerPropValue === undefined || innerPropValue === null) {
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
const innerProperty = property.type.properties.find((p) => p.name === innerPropName);
|
|
173
|
+
if (innerProperty &&
|
|
174
|
+
isReadOnly(innerProperty)) {
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
values.push(`"${(_e = innerMapper.get(innerPropName)) !== null && _e !== void 0 ? _e : innerPropName}": ` +
|
|
178
|
+
serializeExampleValue(innerPropValue));
|
|
179
|
+
}
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
const propRetValue = `"${(_f = mapper.get(propName)) !== null && _f !== void 0 ? _f : propName}": ` +
|
|
183
|
+
serializeExampleValue(propValue);
|
|
184
|
+
values.push(propRetValue);
|
|
185
|
+
}
|
|
186
|
+
const additionalBags = [];
|
|
187
|
+
for (const propName in {
|
|
188
|
+
...additionalPropertiesValue
|
|
189
|
+
}) {
|
|
190
|
+
const propValue = additionalPropertiesValue[propName];
|
|
191
|
+
if (propValue === undefined || propValue === null) {
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
const propRetValue = `"${(_g = mapper.get(propName)) !== null && _g !== void 0 ? _g : propName}": ` +
|
|
195
|
+
serializeExampleValue(propValue);
|
|
196
|
+
additionalBags.push(propRetValue);
|
|
197
|
+
}
|
|
198
|
+
if (additionalBags.length > 0) {
|
|
199
|
+
const name = mapper.get("additionalProperties")
|
|
200
|
+
? "additionalPropertiesBag"
|
|
201
|
+
: "additionalProperties";
|
|
202
|
+
values.push(`"${name}": {
|
|
203
|
+
${additionalBags.join(", ")}
|
|
204
|
+
}`);
|
|
205
|
+
}
|
|
206
|
+
retValue = `{${values.join(", ")}}`;
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
case "array": {
|
|
210
|
+
const valuesArr = value.value.map(serializeExampleValue);
|
|
211
|
+
retValue = `[${valuesArr.join(", ")}]`;
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
default:
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
return retValue;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Build a simple property name mapper for tests (does not require context).
|
|
221
|
+
* Maps serialized property names to their TypeScript/JavaScript client names.
|
|
222
|
+
*/
|
|
223
|
+
function buildTestPropertyNameMapper(type) {
|
|
224
|
+
var _a;
|
|
225
|
+
const mapper = new Map();
|
|
226
|
+
if (!type || type.kind !== "model") {
|
|
227
|
+
return mapper;
|
|
228
|
+
}
|
|
229
|
+
for (const prop of type.properties) {
|
|
230
|
+
if (prop.kind !== "property") {
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
mapper.set(((_a = prop.serializationOptions.json) === null || _a === void 0 ? void 0 : _a.name) || prop.name, normalizeName(prop.name, NameType.Property));
|
|
234
|
+
}
|
|
235
|
+
return mapper;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Escape special characters to spaces (for samples)
|
|
239
|
+
*/
|
|
240
|
+
export function escapeSpecialCharToSpace(str) {
|
|
241
|
+
if (!str) {
|
|
242
|
+
return str;
|
|
243
|
+
}
|
|
244
|
+
return str.replace(/_|,|\.|\(|\)|'s |\[|\]/g, " ").replace(/\//g, " Or ");
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Generate descriptive names based on operation names
|
|
248
|
+
*/
|
|
249
|
+
export function getDescriptiveName(method, exampleName, type) {
|
|
250
|
+
var _a, _b;
|
|
251
|
+
const description = (_a = method.doc) !== null && _a !== void 0 ? _a : `execute ${(_b = method.oriName) !== null && _b !== void 0 ? _b : method.name}`;
|
|
252
|
+
let descriptiveName = description.charAt(0).toLowerCase() + description.slice(1);
|
|
253
|
+
// Only remove trailing dots for test names to avoid redundancy
|
|
254
|
+
if (type === "test") {
|
|
255
|
+
descriptiveName = descriptiveName.replace(/\.$/, "");
|
|
256
|
+
// Include the example name to ensure uniqueness for multiple test cases
|
|
257
|
+
const functionName = normalizeName(exampleName, NameType.Method);
|
|
258
|
+
return `${descriptiveName} for ${functionName}`;
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
// For samples, preserve the original formatting including periods
|
|
262
|
+
return descriptiveName;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Common logic for preparing parameters for tests
|
|
267
|
+
*/
|
|
268
|
+
export function prepareCommonParameters(dpgContext, method, parameterMap, topLevelClient) {
|
|
269
|
+
const envType = resolveReference(AzureTestDependencies.env);
|
|
270
|
+
const result = [];
|
|
271
|
+
const clientParams = getClientParametersDeclaration(topLevelClient, dpgContext, {
|
|
272
|
+
onClientOnly: true
|
|
273
|
+
});
|
|
274
|
+
for (const param of clientParams) {
|
|
275
|
+
if (param.name === "options" || param.name === "credential") {
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
const exampleValue = {
|
|
279
|
+
name: param.name === "endpointParam" ? "endpoint" : param.name,
|
|
280
|
+
value: getEnvironmentVariableName(param.name, getClassicalClientName(topLevelClient)),
|
|
281
|
+
isOptional: Boolean(param.hasQuestionToken),
|
|
282
|
+
onClient: true
|
|
283
|
+
};
|
|
284
|
+
result.push(exampleValue);
|
|
285
|
+
}
|
|
286
|
+
// Handle credentials for tests
|
|
287
|
+
const credentialValue = getCredentialTestValue(dpgContext, topLevelClient.clientInitialization);
|
|
288
|
+
if (credentialValue) {
|
|
289
|
+
result.push(credentialValue);
|
|
290
|
+
}
|
|
291
|
+
let subscriptionIdValue = `${envType}.SUBSCRIPTION_ID || "<SUBSCRIPTION_ID>"`;
|
|
292
|
+
let isSubscriptionIdAdded = false;
|
|
293
|
+
// Process required parameters
|
|
294
|
+
for (const param of method.operation.parameters) {
|
|
295
|
+
if (param.optional === true ||
|
|
296
|
+
param.type.kind === "constant" ||
|
|
297
|
+
param.clientDefaultValue) {
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
const exampleValue = parameterMap[param.serializedName];
|
|
301
|
+
// Handle subscriptionId parameter separately for ARM clients
|
|
302
|
+
if (param.name.toLowerCase() === "subscriptionid" && dpgContext.arm) {
|
|
303
|
+
isSubscriptionIdAdded = true;
|
|
304
|
+
// For tests, always use env variable
|
|
305
|
+
result.push(prepareCommonValue("subscriptionId", subscriptionIdValue, false, true));
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
if (!exampleValue || !exampleValue.value) {
|
|
309
|
+
if (!param.optional) {
|
|
310
|
+
// Generate default values for required parameters without examples in tests
|
|
311
|
+
result.push(prepareCommonValue(param.name, `"{Your ${param.name}}"`, false, param.onClient));
|
|
312
|
+
}
|
|
313
|
+
continue;
|
|
314
|
+
}
|
|
315
|
+
result.push(prepareCommonValue(exampleValue.parameter.name, exampleValue.value, param.optional, param.onClient));
|
|
316
|
+
}
|
|
317
|
+
// Add subscriptionId for ARM clients if needed
|
|
318
|
+
if (dpgContext.arm &&
|
|
319
|
+
getSubscriptionId(dpgContext) &&
|
|
320
|
+
!isSubscriptionIdAdded) {
|
|
321
|
+
result.push(prepareCommonValue("subscriptionId", subscriptionIdValue, false, true));
|
|
322
|
+
}
|
|
323
|
+
// Handle body parameters
|
|
324
|
+
const bodyParam = method.operation.bodyParam;
|
|
325
|
+
const bodySerializeName = bodyParam === null || bodyParam === void 0 ? void 0 : bodyParam.serializedName;
|
|
326
|
+
const bodyExample = parameterMap[bodySerializeName !== null && bodySerializeName !== void 0 ? bodySerializeName : ""];
|
|
327
|
+
if (bodyParam && bodyExample && bodyExample.value) {
|
|
328
|
+
if (isSpreadBodyParameter(bodyParam) &&
|
|
329
|
+
bodyParam.type.kind === "model" &&
|
|
330
|
+
bodyExample.value.kind === "model") {
|
|
331
|
+
for (const prop of bodyParam.type.properties) {
|
|
332
|
+
const propExample = bodyExample.value.value[prop.name];
|
|
333
|
+
if (!propExample) {
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
// Skip readonly properties as they cannot be set by users
|
|
337
|
+
if (isReadOnly(prop)) {
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
result.push(prepareCommonValue(prop.name, propExample, prop.optional, prop.onClient));
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
result.push(prepareCommonValue(bodyParam.name, bodyExample.value, bodyParam.optional, bodyParam.onClient));
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
// Handle optional parameters that have examples
|
|
348
|
+
method.operation.parameters
|
|
349
|
+
.filter((param) => param.optional === true &&
|
|
350
|
+
parameterMap[param.serializedName] &&
|
|
351
|
+
!param.clientDefaultValue)
|
|
352
|
+
.forEach((param) => {
|
|
353
|
+
const exampleValue = parameterMap[param.serializedName];
|
|
354
|
+
if (exampleValue && exampleValue.value) {
|
|
355
|
+
result.push(prepareCommonValue(param.name, exampleValue.value, true, param.onClient));
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
return result;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Common client and method iteration logic
|
|
362
|
+
*/
|
|
363
|
+
export function iterateClientsAndMethods(dpgContext, callback) {
|
|
364
|
+
const generatedFiles = [];
|
|
365
|
+
const clients = dpgContext.sdkPackage.clients;
|
|
366
|
+
for (const client of clients) {
|
|
367
|
+
const methodMap = getMethodHierarchiesMap(dpgContext, client);
|
|
368
|
+
for (const [prefixKey, methods] of methodMap) {
|
|
369
|
+
const hierarchies = prefixKey ? prefixKey.split("/") : [];
|
|
370
|
+
const prefix = hierarchies
|
|
371
|
+
.map((name) => {
|
|
372
|
+
return normalizeName(name, NameType.Property);
|
|
373
|
+
})
|
|
374
|
+
.join(".");
|
|
375
|
+
for (const method of methods) {
|
|
376
|
+
callback(dpgContext, method, {
|
|
377
|
+
client,
|
|
378
|
+
generatedFiles,
|
|
379
|
+
classicalMethodPrefix: prefix,
|
|
380
|
+
subFolder: clients.length > 1
|
|
381
|
+
? normalizeName(getClassicalClientName(client), NameType.File)
|
|
382
|
+
: undefined,
|
|
383
|
+
hierarchies: hierarchies
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
return generatedFiles;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Generate common method call logic
|
|
392
|
+
*/
|
|
393
|
+
export function generateMethodCall(method, parameters, options, dpgContext) {
|
|
394
|
+
var _a, _b, _c, _d;
|
|
395
|
+
// Prepare client-level parameters
|
|
396
|
+
const clientParamValues = parameters.filter((p) => p.onClient);
|
|
397
|
+
const clientParams = clientParamValues
|
|
398
|
+
.filter((p) => !p.isOptional)
|
|
399
|
+
.map((param) => param.name);
|
|
400
|
+
const clientParamDefs = clientParamValues
|
|
401
|
+
.filter((p) => !p.isOptional)
|
|
402
|
+
.map((param) => `const ${param.name} = ${param.value};`);
|
|
403
|
+
// Prepare operation-level parameters
|
|
404
|
+
const methodParamValues = parameters.filter((p) => !p.onClient);
|
|
405
|
+
let methodParams = [];
|
|
406
|
+
// If dpgContext is provided, reorder parameters according to function signature
|
|
407
|
+
if (dpgContext) {
|
|
408
|
+
// Get the actual function signature parameter order
|
|
409
|
+
const operationFunction = getOperationFunction(dpgContext, [(_a = options.hierarchies) !== null && _a !== void 0 ? _a : [], method], "Client");
|
|
410
|
+
// Extract parameter names from the function signature (excluding context and options)
|
|
411
|
+
const signatureParamNames = (_c = (_b = operationFunction.parameters) === null || _b === void 0 ? void 0 : _b.filter((p) => {
|
|
412
|
+
var _a;
|
|
413
|
+
return p.name !== "context" &&
|
|
414
|
+
!((_a = p.type) === null || _a === void 0 ? void 0 : _a.toString().includes("OptionalParams"));
|
|
415
|
+
}).map((p) => p.name)) !== null && _c !== void 0 ? _c : [];
|
|
416
|
+
// Create a map for quick lookup of parameter values by name
|
|
417
|
+
const paramValueMap = new Map(methodParamValues.map((p) => [p.name, p]));
|
|
418
|
+
// Reorder methodParamValues according to the signature order
|
|
419
|
+
const orderedRequiredParams = signatureParamNames
|
|
420
|
+
.map((name) => paramValueMap.get(name))
|
|
421
|
+
.filter((p) => p !== undefined && !p.isOptional);
|
|
422
|
+
methodParams = orderedRequiredParams.map((p) => `${p.value}`);
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
// Original logic when dpgContext is not provided
|
|
426
|
+
methodParams = methodParamValues
|
|
427
|
+
.filter((p) => !p.isOptional)
|
|
428
|
+
.map((p) => `${p.value}`);
|
|
429
|
+
}
|
|
430
|
+
const optionalParams = methodParamValues
|
|
431
|
+
.filter((p) => p.isOptional)
|
|
432
|
+
.map((param) => `${param.name}: ${param.value}`);
|
|
433
|
+
if (optionalParams.length > 0) {
|
|
434
|
+
methodParams.push(`{${optionalParams.join(", ")}}`);
|
|
435
|
+
}
|
|
436
|
+
const prefix = options.classicalMethodPrefix
|
|
437
|
+
? `${options.classicalMethodPrefix}.`
|
|
438
|
+
: "";
|
|
439
|
+
const methodCall = `client.${prefix}${normalizeName((_d = method.oriName) !== null && _d !== void 0 ? _d : method.name, NameType.Property)}(${methodParams.join(", ")})`;
|
|
440
|
+
return { methodCall, clientParams, clientParamDefs };
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Common source file creation logic
|
|
444
|
+
*/
|
|
445
|
+
export function createSourceFile(dpgContext, method, options, type, fileName) {
|
|
446
|
+
var _a, _b, _c, _d, _e;
|
|
447
|
+
const project = useContext("outputProject");
|
|
448
|
+
const operationPrefix = `${(_a = options.classicalMethodPrefix) !== null && _a !== void 0 ? _a : ""} ${(_b = method.oriName) !== null && _b !== void 0 ? _b : method.name}`;
|
|
449
|
+
const baseFolder = type === "sample" ? "samples-dev" : join("test", "generated");
|
|
450
|
+
const folder = join((_d = (_c = dpgContext.generationPathDetail) === null || _c === void 0 ? void 0 : _c.rootDir) !== null && _d !== void 0 ? _d : "", baseFolder, (_e = options.subFolder) !== null && _e !== void 0 ? _e : "");
|
|
451
|
+
const fileExtension = type === "sample" ? ".ts" : ".spec.ts";
|
|
452
|
+
const normalizedFileName = normalizeName(fileName || `${operationPrefix} ${type}`, NameType.File);
|
|
453
|
+
return project.createSourceFile(join(folder, `${normalizedFileName}${fileExtension}`), "", { overwrite: true });
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Generate assertions for a specific value (recursive for nested objects)
|
|
457
|
+
*/
|
|
458
|
+
export function generateAssertionsForValue(value, path, maxDepth = 3, currentDepth = 0) {
|
|
459
|
+
var _a, _b;
|
|
460
|
+
const assertions = [];
|
|
461
|
+
// Prevent infinite recursion for deeply nested objects
|
|
462
|
+
if (currentDepth >= maxDepth) {
|
|
463
|
+
return assertions;
|
|
464
|
+
}
|
|
465
|
+
switch (value.kind) {
|
|
466
|
+
case "string": {
|
|
467
|
+
switch (value.type.kind) {
|
|
468
|
+
case "utcDateTime":
|
|
469
|
+
assertions.push(`assert.strictEqual(${path}.getTime(), new Date("${value.value}").getTime());`);
|
|
470
|
+
break;
|
|
471
|
+
case "bytes": {
|
|
472
|
+
const encode = (_a = value.type.encode) !== null && _a !== void 0 ? _a : "base64";
|
|
473
|
+
assertions.push(`assert.deepEqual(${path}, Buffer.from("${value.value}", "${encode}"));`);
|
|
474
|
+
break;
|
|
475
|
+
}
|
|
476
|
+
default: {
|
|
477
|
+
const retValue = `"${(_b = value.value) === null || _b === void 0 ? void 0 : _b.toString().replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t").replace(/\f/g, "\\f").replace(/>/g, ">").replace(/</g, "<")}"`;
|
|
478
|
+
assertions.push(`assert.strictEqual(${path}, ${retValue});`);
|
|
479
|
+
break;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
case "boolean":
|
|
485
|
+
case "number":
|
|
486
|
+
assertions.push(`assert.strictEqual(${path}, ${JSON.stringify(value.value)});`);
|
|
487
|
+
break;
|
|
488
|
+
case "unknown":
|
|
489
|
+
// for unknown type we fall back to assert.isDefined to avoid false positives in tests, so we can't assert on the exact value. But we can still check that the payload is defined.
|
|
490
|
+
assertions.push(`assert.isDefined(${path});`);
|
|
491
|
+
break;
|
|
492
|
+
case "array":
|
|
493
|
+
if (value.value && value.value.length > 0) {
|
|
494
|
+
assertions.push(`assert.ok(Array.isArray(${path}));`);
|
|
495
|
+
assertions.push(`assert.strictEqual(${path}.length, ${value.value.length});`);
|
|
496
|
+
// Assert on first few items to avoid overly verbose tests
|
|
497
|
+
const itemsToCheck = Math.min(value.value.length, 2);
|
|
498
|
+
for (let i = 0; i < itemsToCheck; i++) {
|
|
499
|
+
const item = value.value[i];
|
|
500
|
+
if (item) {
|
|
501
|
+
const itemAssertions = generateAssertionsForValue(item, `${path}[${i}]`, maxDepth, currentDepth + 1);
|
|
502
|
+
assertions.push(...itemAssertions);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
break;
|
|
507
|
+
case "model":
|
|
508
|
+
case "dict":
|
|
509
|
+
if (value.value && typeof value.value === "object") {
|
|
510
|
+
const entries = Object.entries(value.value);
|
|
511
|
+
for (const [key, val] of entries) {
|
|
512
|
+
if (val && typeof val === "object" && "kind" in val) {
|
|
513
|
+
// Check if this property is flattened in the model type
|
|
514
|
+
let property;
|
|
515
|
+
if (value.kind === "model" && value.type.kind === "model") {
|
|
516
|
+
property = value.type.properties.find((p) => p.kind === "property" && p.name === key);
|
|
517
|
+
}
|
|
518
|
+
if ((property === null || property === void 0 ? void 0 : property.flatten) &&
|
|
519
|
+
val.kind === "model") {
|
|
520
|
+
// For flattened properties, recurse using the parent path so
|
|
521
|
+
// assertions reference result.xxx instead of result.properties.xxx
|
|
522
|
+
const innerAssertions = generateAssertionsForValue(val, path, maxDepth, currentDepth + 1);
|
|
523
|
+
assertions.push(...innerAssertions);
|
|
524
|
+
}
|
|
525
|
+
else {
|
|
526
|
+
const propPath = `${path}.${key}`;
|
|
527
|
+
const nestedVal = val;
|
|
528
|
+
// For nested model/dict values, append "?" to the path so child
|
|
529
|
+
// property accesses use optional chaining (e.g. result.systemData?.createdBy)
|
|
530
|
+
const recursePath = nestedVal.kind === "model" || nestedVal.kind === "dict"
|
|
531
|
+
? `${propPath}?`
|
|
532
|
+
: propPath;
|
|
533
|
+
const propAssertions = generateAssertionsForValue(nestedVal, recursePath, maxDepth, currentDepth + 1);
|
|
534
|
+
assertions.push(...propAssertions);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
break;
|
|
540
|
+
case "null":
|
|
541
|
+
assertions.push(`assert.strictEqual(${path}, null);`);
|
|
542
|
+
break;
|
|
543
|
+
case "union":
|
|
544
|
+
// For unions, generate assertions for the actual value
|
|
545
|
+
if (value.value) {
|
|
546
|
+
const unionAssertions = generateAssertionsForValue(value.value, path, maxDepth, currentDepth);
|
|
547
|
+
assertions.push(...unionAssertions);
|
|
548
|
+
}
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
551
|
+
return assertions;
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Generate response assertions based on the example responses
|
|
555
|
+
*/
|
|
556
|
+
export function generateResponseAssertions(example, resultVariableName, isPaging = false) {
|
|
557
|
+
const assertions = [];
|
|
558
|
+
// Get the responses
|
|
559
|
+
const responses = example.responses;
|
|
560
|
+
if (!responses || Object.keys(responses).length === 0) {
|
|
561
|
+
return assertions;
|
|
562
|
+
}
|
|
563
|
+
// TypeSpec SDK uses numeric indices for responses, get the first response
|
|
564
|
+
const responseKeys = Object.keys(responses);
|
|
565
|
+
if (responseKeys.length === 0) {
|
|
566
|
+
return assertions;
|
|
567
|
+
}
|
|
568
|
+
const firstResponseKey = responseKeys[0];
|
|
569
|
+
if (!firstResponseKey) {
|
|
570
|
+
return assertions;
|
|
571
|
+
}
|
|
572
|
+
const firstResponse = responses[firstResponseKey];
|
|
573
|
+
const responseBody = firstResponse === null || firstResponse === void 0 ? void 0 : firstResponse.bodyValue;
|
|
574
|
+
if (!responseBody) {
|
|
575
|
+
return assertions;
|
|
576
|
+
}
|
|
577
|
+
if (isPaging) {
|
|
578
|
+
// For paging operations, the response body should have a 'value' array
|
|
579
|
+
if (responseBody.kind === "model" || responseBody.kind === "dict") {
|
|
580
|
+
const responseValue = responseBody.value;
|
|
581
|
+
const valueArray = responseValue === null || responseValue === void 0 ? void 0 : responseValue["value"];
|
|
582
|
+
if (valueArray && valueArray.kind === "array" && valueArray.value) {
|
|
583
|
+
// Assert on the length of the collected results
|
|
584
|
+
assertions.push(`assert.strictEqual(${resultVariableName}.length, ${valueArray.value.length});`);
|
|
585
|
+
// Assert on the first item if available
|
|
586
|
+
if (valueArray.value.length > 0) {
|
|
587
|
+
const firstItem = valueArray.value[0];
|
|
588
|
+
if (firstItem) {
|
|
589
|
+
const itemAssertions = generateAssertionsForValue(firstItem, `${resultVariableName}[0]`, 2, // Limit depth for paging items
|
|
590
|
+
0);
|
|
591
|
+
assertions.push(...itemAssertions);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
else {
|
|
598
|
+
// Generate assertions based on response body structure
|
|
599
|
+
const responseAssertions = generateAssertionsForValue(responseBody, resultVariableName);
|
|
600
|
+
assertions.push(...responseAssertions);
|
|
601
|
+
}
|
|
602
|
+
return assertions;
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* Get the environment variable name for a client parameter.
|
|
606
|
+
* Converts camelCase parameter names to UPPER_SNAKE_CASE with optional client name prefix.
|
|
607
|
+
* @param paramName - The parameter name to convert
|
|
608
|
+
* @param clientName - Optional client name to use as prefix
|
|
609
|
+
* @returns The environment variable expression string
|
|
610
|
+
*/
|
|
611
|
+
function getEnvironmentVariableName(paramName, clientName) {
|
|
612
|
+
// Remove "Param" suffix if present
|
|
613
|
+
const cleanName = paramName.replace(/Param$/, "");
|
|
614
|
+
// Remove "Client" suffix from client name if present and convert to UPPER_SNAKE_CASE
|
|
615
|
+
let prefix = "";
|
|
616
|
+
if (clientName) {
|
|
617
|
+
const cleanClientName = clientName.replace(/Client$/, "");
|
|
618
|
+
prefix =
|
|
619
|
+
cleanClientName
|
|
620
|
+
.replace(/([A-Z])/g, "_$1")
|
|
621
|
+
.toUpperCase()
|
|
622
|
+
.replace(/^_/, "") + "_";
|
|
623
|
+
}
|
|
624
|
+
// Convert camelCase to UPPER_SNAKE_CASE
|
|
625
|
+
const envVarName = cleanName
|
|
626
|
+
.replace(/([A-Z])/g, "_$1")
|
|
627
|
+
.toUpperCase()
|
|
628
|
+
.replace(/^_/, "");
|
|
629
|
+
return `process.env.${prefix}${envVarName} || ""`;
|
|
630
|
+
}
|
|
631
|
+
//# sourceMappingURL=exampleValueHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exampleValueHelpers.js","sourceRoot":"","sources":["../../../../src/modular/helpers/exampleValueHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,UAAU,EACX,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,cAAc,EACd,QAAQ,EACR,aAAa,EACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EACL,uBAAuB,EAExB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE3E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAoBpE;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAAgC;IAEhC,MAAM,YAAY,GAAiD,EAAE,CAAC;IACtE,OAAO,CAAC,UAAU,CAAC,OAAO,CACxB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,KAAK,CAAC,CAClE,CAAC;IACF,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;GA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