@azure-tools/typespec-ts 0.28.0 → 0.29.0
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 +12 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +24 -18
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +14 -4
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +9 -2
- package/dist/src/lib.js.map +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.js +2 -0
- package/dist/src/modular/buildClassicalClient.js.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.js +3 -0
- package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
- package/dist/src/modular/buildCodeModel.d.ts.map +1 -1
- package/dist/src/modular/buildCodeModel.js +80 -83
- package/dist/src/modular/buildCodeModel.js.map +1 -1
- package/dist/src/modular/buildLroFiles.d.ts +24 -0
- package/dist/src/modular/buildLroFiles.d.ts.map +1 -0
- package/dist/src/modular/buildLroFiles.js +399 -0
- package/dist/src/modular/buildLroFiles.js.map +1 -0
- package/dist/src/modular/buildOperations.d.ts +6 -0
- package/dist/src/modular/buildOperations.d.ts.map +1 -1
- package/dist/src/modular/buildOperations.js +64 -5
- package/dist/src/modular/buildOperations.js.map +1 -1
- package/dist/src/modular/buildPagingFiles.js +3 -3
- package/dist/src/modular/buildPagingFiles.js.map +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts +0 -3
- package/dist/src/modular/buildProjectFiles.d.ts.map +1 -1
- package/dist/src/modular/buildProjectFiles.js +0 -399
- package/dist/src/modular/buildProjectFiles.js.map +1 -1
- package/dist/src/modular/buildRootIndex.d.ts.map +1 -1
- package/dist/src/modular/buildRootIndex.js +20 -0
- package/dist/src/modular/buildRootIndex.js.map +1 -1
- package/dist/src/modular/buildSubpathIndex.js +4 -3
- package/dist/src/modular/buildSubpathIndex.js.map +1 -1
- package/dist/src/modular/emitModels.d.ts +2 -0
- package/dist/src/modular/emitModels.d.ts.map +1 -1
- package/dist/src/modular/emitModels.js +73 -11
- package/dist/src/modular/emitModels.js.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts +5 -5
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.js +171 -55
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.js +6 -1
- package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
- package/dist/src/modular/interfaces.d.ts +5 -0
- package/dist/src/modular/interfaces.d.ts.map +1 -1
- package/dist/src/modular/modularCodeModel.d.ts +9 -1
- package/dist/src/modular/modularCodeModel.d.ts.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.js +1 -1
- package/dist/src/transform/transformParameters.js +2 -2
- package/dist/src/transform/transformParameters.js.map +1 -1
- package/dist/src/transform/transformPaths.js +1 -1
- package/dist/src/transform/transformPaths.js.map +1 -1
- package/dist/src/transform/transformResponses.js +2 -2
- package/dist/src/transform/transformResponses.js.map +1 -1
- package/dist/src/transform/transformSchemas.d.ts.map +1 -1
- package/dist/src/transform/transformSchemas.js +23 -31
- package/dist/src/transform/transformSchemas.js.map +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -1
- package/dist/src/transform/transfromRLCOptions.js +8 -1
- package/dist/src/transform/transfromRLCOptions.js.map +1 -1
- package/dist/src/utils/modelUtils.d.ts +12 -2
- package/dist/src/utils/modelUtils.d.ts.map +1 -1
- package/dist/src/utils/modelUtils.js +88 -49
- package/dist/src/utils/modelUtils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -18
- package/src/index.ts +36 -22
- package/src/lib.ts +10 -2
- package/src/modular/buildClassicalClient.ts +2 -0
- package/src/modular/buildClassicalOperationGroups.ts +4 -0
- package/src/modular/buildCodeModel.ts +100 -155
- package/src/modular/buildLroFiles.ts +433 -0
- package/src/modular/buildOperations.ts +91 -10
- package/src/modular/buildPagingFiles.ts +4 -4
- package/src/modular/buildProjectFiles.ts +0 -471
- package/src/modular/buildRootIndex.ts +49 -0
- package/src/modular/buildSubpathIndex.ts +4 -4
- package/src/modular/emitModels.ts +102 -15
- package/src/modular/helpers/operationHelpers.ts +207 -72
- package/src/modular/helpers/typeHelpers.ts +6 -2
- package/src/modular/interfaces.ts +6 -0
- package/src/modular/modularCodeModel.ts +10 -1
- package/src/transform/transformHelperFunctionDetails.ts +1 -1
- package/src/transform/transformParameters.ts +2 -2
- package/src/transform/transformPaths.ts +1 -1
- package/src/transform/transformResponses.ts +2 -2
- package/src/transform/transformSchemas.ts +22 -33
- package/src/transform/transfromRLCOptions.ts +10 -1
- package/src/utils/modelUtils.ts +107 -46
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import { getClientName } from "./helpers/namingHelpers.js";
|
|
2
|
+
import { isLroOnlyOperation } from "./helpers/operationHelpers.js";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { buildLroDeserDetailMap } from "./buildOperations.js";
|
|
5
|
+
import { NameType, normalizeName } from "@azure-tools/rlc-common";
|
|
6
|
+
/**
|
|
7
|
+
* Always import LRO dependencies and remember to remove if unused.
|
|
8
|
+
* @param clientFile - The file to add the imports to.
|
|
9
|
+
*/
|
|
10
|
+
export function importLroCoreDependencies(clientFile) {
|
|
11
|
+
clientFile.addImportDeclaration({
|
|
12
|
+
moduleSpecifier: `@azure/core-lro`,
|
|
13
|
+
namedImports: [
|
|
14
|
+
"PollerLike",
|
|
15
|
+
"OperationState",
|
|
16
|
+
"deserializeState",
|
|
17
|
+
"ResourceLocationConfig",
|
|
18
|
+
"LongRunningOperation",
|
|
19
|
+
"createHttpPoller",
|
|
20
|
+
"OperationResponse"
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Generate `restorePollerHelpers.ts` file
|
|
26
|
+
* @param codeModel - The code model.
|
|
27
|
+
* @param client - The client.
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
export function buildRestorePollerHelper(codeModel, client) {
|
|
31
|
+
var _a;
|
|
32
|
+
const lros = client.operationGroups
|
|
33
|
+
.flatMap((op) => op.operations)
|
|
34
|
+
.filter(isLroOnlyOperation);
|
|
35
|
+
if (lros.length === 0) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const srcPath = codeModel.modularOptions.sourceRoot;
|
|
39
|
+
const subfolder = (_a = client.subfolder) !== null && _a !== void 0 ? _a : "";
|
|
40
|
+
const filePath = path.join(`${srcPath}/${subfolder !== "" ? subfolder + "/" : ""}restorePollerHelpers.ts`);
|
|
41
|
+
const restorePollerFile = codeModel.project.createSourceFile(filePath, undefined, {
|
|
42
|
+
overwrite: true
|
|
43
|
+
});
|
|
44
|
+
importLroCoreDependencies(restorePollerFile);
|
|
45
|
+
const clientNames = importClientContext(client, restorePollerFile);
|
|
46
|
+
importGetPollerHelper(restorePollerFile);
|
|
47
|
+
const deserializeMap = importDeserializeHelpers(client, restorePollerFile);
|
|
48
|
+
const restorePollerHelperContent = `import {
|
|
49
|
+
PathUncheckedResponse,
|
|
50
|
+
OperationOptions
|
|
51
|
+
} from "@azure-rest/core-client";
|
|
52
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
53
|
+
|
|
54
|
+
export interface RestorePollerOptions<
|
|
55
|
+
TResult,
|
|
56
|
+
TResponse extends PathUncheckedResponse = PathUncheckedResponse
|
|
57
|
+
> extends OperationOptions {
|
|
58
|
+
/** Delay to wait until next poll, in milliseconds. */
|
|
59
|
+
updateIntervalInMs?: number;
|
|
60
|
+
/**
|
|
61
|
+
* The signal which can be used to abort requests.
|
|
62
|
+
*/
|
|
63
|
+
abortSignal?: AbortSignalLike;
|
|
64
|
+
/** Deserialization function for raw response body */
|
|
65
|
+
processResponseBody?: (result: TResponse) => PromiseLike<TResult>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Creates a poller from the serialized state of another poller. This can be
|
|
70
|
+
* useful when you want to create pollers on a different host or a poller
|
|
71
|
+
* needs to be constructed after the original one is not in scope.
|
|
72
|
+
*/
|
|
73
|
+
export function restorePoller<TResponse extends PathUncheckedResponse, TResult>(
|
|
74
|
+
client: ${clientNames.join(" | ")},
|
|
75
|
+
serializedState: string,
|
|
76
|
+
sourceOperation: (
|
|
77
|
+
...args: any[]
|
|
78
|
+
) => PollerLike<OperationState<TResult>, TResult>,
|
|
79
|
+
options?: RestorePollerOptions<TResult>
|
|
80
|
+
): PollerLike<OperationState<TResult>, TResult> {
|
|
81
|
+
const pollerConfig = deserializeState(serializedState).config;
|
|
82
|
+
const { initialUrl, requestMethod, metadata } = pollerConfig;
|
|
83
|
+
if (!initialUrl || !requestMethod) {
|
|
84
|
+
throw new Error(
|
|
85
|
+
\`Invalid serialized state: \${serializedState} for sourceOperation \${sourceOperation?.name}\`
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
const resourceLocationConfig = metadata?.["resourceLocationConfig"] as
|
|
89
|
+
| ResourceLocationConfig
|
|
90
|
+
| undefined;
|
|
91
|
+
const deserializeHelper =
|
|
92
|
+
options?.processResponseBody ??
|
|
93
|
+
getDeserializationHelper(initialUrl, requestMethod);
|
|
94
|
+
if (!deserializeHelper) {
|
|
95
|
+
throw new Error(
|
|
96
|
+
\`Please ensure the operation is in this client! We can't find its deserializeHelper for \${sourceOperation?.name}.\`
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
return getLongRunningPoller(
|
|
100
|
+
(client as any)["_client"] ?? client,
|
|
101
|
+
deserializeHelper as (result: TResponse) => PromiseLike<TResult>,
|
|
102
|
+
{
|
|
103
|
+
updateIntervalInMs: options?.updateIntervalInMs,
|
|
104
|
+
abortSignal: options?.abortSignal,
|
|
105
|
+
resourceLocationConfig,
|
|
106
|
+
restoreFrom: serializedState,
|
|
107
|
+
initialUrl
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const deserializeMap: Record<string, Function> = {
|
|
113
|
+
${deserializeMap.join(",\n")}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
function getDeserializationHelper(
|
|
117
|
+
urlStr: string,
|
|
118
|
+
method: string
|
|
119
|
+
): ((result: unknown) => PromiseLike<unknown>) | undefined {
|
|
120
|
+
const path = new URL(urlStr).pathname;
|
|
121
|
+
const pathParts = path.split("/");
|
|
122
|
+
|
|
123
|
+
// Traverse list to match the longest candidate
|
|
124
|
+
// matchedLen: the length of candidate path
|
|
125
|
+
// matchedValue: the matched status code array
|
|
126
|
+
let matchedLen = -1,
|
|
127
|
+
matchedValue: ((result: unknown) => PromiseLike<unknown>) | undefined;
|
|
128
|
+
|
|
129
|
+
// Iterate the responseMap to find a match
|
|
130
|
+
for (const [key, value] of Object.entries(deserializeMap)) {
|
|
131
|
+
// Extracting the path from the map key which is in format
|
|
132
|
+
// GET /path/foo
|
|
133
|
+
if (!key.startsWith(method)) {
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
const candidatePath = getPathFromMapKey(key);
|
|
137
|
+
// Get each part of the url path
|
|
138
|
+
const candidateParts = candidatePath.split("/");
|
|
139
|
+
|
|
140
|
+
// track if we have found a match to return the values found.
|
|
141
|
+
let found = true;
|
|
142
|
+
for (
|
|
143
|
+
let i = candidateParts.length - 1, j = pathParts.length - 1;
|
|
144
|
+
i >= 1 && j >= 1;
|
|
145
|
+
i--, j--
|
|
146
|
+
) {
|
|
147
|
+
if (
|
|
148
|
+
candidateParts[i]?.startsWith("{") &&
|
|
149
|
+
candidateParts[i]?.indexOf("}") !== -1
|
|
150
|
+
) {
|
|
151
|
+
const start = candidateParts[i]!.indexOf("}") + 1,
|
|
152
|
+
end = candidateParts[i]?.length;
|
|
153
|
+
// If the current part of the candidate is a "template" part
|
|
154
|
+
// Try to use the suffix of pattern to match the path
|
|
155
|
+
// {guid} ==> $
|
|
156
|
+
// {guid}:export ==> :export$
|
|
157
|
+
const isMatched = new RegExp(
|
|
158
|
+
\`\${candidateParts[i]?.slice(start, end)}\`
|
|
159
|
+
).test(pathParts[j] || "");
|
|
160
|
+
|
|
161
|
+
if (!isMatched) {
|
|
162
|
+
found = false;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// If the candidate part is not a template and
|
|
169
|
+
// the parts don't match mark the candidate as not found
|
|
170
|
+
// to move on with the next candidate path.
|
|
171
|
+
if (candidateParts[i] !== pathParts[j]) {
|
|
172
|
+
found = false;
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// We finished evaluating the current candidate parts
|
|
178
|
+
// Update the matched value if and only if we found the longer pattern
|
|
179
|
+
if (found && candidatePath.length > matchedLen) {
|
|
180
|
+
matchedLen = candidatePath.length;
|
|
181
|
+
matchedValue = value as (result: unknown) => PromiseLike<unknown>;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return matchedValue;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function getPathFromMapKey(mapKey: string): string {
|
|
189
|
+
const pathStart = mapKey.indexOf("/");
|
|
190
|
+
return mapKey.slice(pathStart);
|
|
191
|
+
}
|
|
192
|
+
`;
|
|
193
|
+
restorePollerFile.addStatements(restorePollerHelperContent);
|
|
194
|
+
restorePollerFile.fixMissingImports();
|
|
195
|
+
restorePollerFile.fixUnusedIdentifiers();
|
|
196
|
+
}
|
|
197
|
+
function importClientContext(client, sourceFile) {
|
|
198
|
+
const name = getClientName(client);
|
|
199
|
+
const classicalClientname = `${getClientName(client)}Client`;
|
|
200
|
+
const clientContextName = client.rlcClientName;
|
|
201
|
+
sourceFile.addImportDeclaration({
|
|
202
|
+
namedImports: [`${clientContextName}`],
|
|
203
|
+
moduleSpecifier: `./api/${normalizeName(name, NameType.File)}Context.js`
|
|
204
|
+
});
|
|
205
|
+
sourceFile.addImportDeclaration({
|
|
206
|
+
namedImports: [`${classicalClientname}`],
|
|
207
|
+
moduleSpecifier: `./${normalizeName(classicalClientname, NameType.File)}.js`
|
|
208
|
+
});
|
|
209
|
+
return [clientContextName, classicalClientname];
|
|
210
|
+
}
|
|
211
|
+
function importGetPollerHelper(sourceFile) {
|
|
212
|
+
sourceFile.addImportDeclaration({
|
|
213
|
+
namedImports: [`getLongRunningPoller`],
|
|
214
|
+
moduleSpecifier: `./api/pollingHelpers.js`
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
function importDeserializeHelpers(client, sourceFile) {
|
|
218
|
+
const deserializeDetails = buildLroDeserDetailMap(client);
|
|
219
|
+
const deserializeMap = [];
|
|
220
|
+
for (const [key, value] of deserializeDetails.entries()) {
|
|
221
|
+
sourceFile.addImportDeclaration({
|
|
222
|
+
namedImports: value.map((detail) => detail.renamedDeserName
|
|
223
|
+
? `${detail.deserName} as ${detail.renamedDeserName}`
|
|
224
|
+
: detail.deserName),
|
|
225
|
+
moduleSpecifier: key
|
|
226
|
+
});
|
|
227
|
+
value.forEach((detail) => {
|
|
228
|
+
var _a;
|
|
229
|
+
deserializeMap.push(`"${detail.path}": ${(_a = detail.renamedDeserName) !== null && _a !== void 0 ? _a : detail.deserName}`);
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
return deserializeMap;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Generate `api/pollingHelpers.ts` file
|
|
236
|
+
* @param codeModel - The code model.
|
|
237
|
+
* @param client - The client.
|
|
238
|
+
* @param needUnexpectedHelper - Whether need to import unexpected helper.
|
|
239
|
+
* @param isMultiClients - Whether the client is multi-clients.
|
|
240
|
+
* @returns
|
|
241
|
+
*/
|
|
242
|
+
export function buildGetPollerHelper(codeModel, client, needUnexpectedHelper = true, isMultiClients = false) {
|
|
243
|
+
var _a;
|
|
244
|
+
const lroOperstions = client.operationGroups
|
|
245
|
+
.flatMap((op) => op.operations)
|
|
246
|
+
.filter(isLroOnlyOperation);
|
|
247
|
+
if (lroOperstions.length === 0) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const checkResponseStatus = needUnexpectedHelper
|
|
251
|
+
? `if (isUnexpected(response as PathUncheckedResponse)) {
|
|
252
|
+
throw createRestError(response);
|
|
253
|
+
}`
|
|
254
|
+
: `if (Number.isNaN(response.status)) {
|
|
255
|
+
throw createRestError(
|
|
256
|
+
\`Status code of the response is not a number. Value: \${response.status}\`,
|
|
257
|
+
response
|
|
258
|
+
);
|
|
259
|
+
}`;
|
|
260
|
+
const unexpectedHelperImport = needUnexpectedHelper
|
|
261
|
+
? `import { isUnexpected } from "${isMultiClients ? "../" : ""}../rest/index.js";`
|
|
262
|
+
: "";
|
|
263
|
+
const getLroPollerContent = `
|
|
264
|
+
import {
|
|
265
|
+
Client,
|
|
266
|
+
PathUncheckedResponse,
|
|
267
|
+
createRestError
|
|
268
|
+
} from "@azure-rest/core-client";
|
|
269
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
270
|
+
${unexpectedHelperImport}
|
|
271
|
+
|
|
272
|
+
export interface GetLongRunningPollerOptions<TResponse> {
|
|
273
|
+
/** Delay to wait until next poll, in milliseconds. */
|
|
274
|
+
updateIntervalInMs?: number;
|
|
275
|
+
/**
|
|
276
|
+
* The signal which can be used to abort requests.
|
|
277
|
+
*/
|
|
278
|
+
abortSignal?: AbortSignalLike;
|
|
279
|
+
/**
|
|
280
|
+
* The potential location of the result of the LRO if specified by the LRO extension in the swagger.
|
|
281
|
+
*/
|
|
282
|
+
resourceLocationConfig?: ResourceLocationConfig;
|
|
283
|
+
/**
|
|
284
|
+
* The original url of the LRO
|
|
285
|
+
* Should not be null when restoreFrom is set
|
|
286
|
+
*/
|
|
287
|
+
initialUrl?: string;
|
|
288
|
+
/**
|
|
289
|
+
* A serialized poller which can be used to resume an existing paused Long-Running-Operation.
|
|
290
|
+
*/
|
|
291
|
+
restoreFrom?: string;
|
|
292
|
+
/**
|
|
293
|
+
* The function to get the initial response
|
|
294
|
+
*/
|
|
295
|
+
getInitialResponse?: () => PromiseLike<TResponse>;
|
|
296
|
+
}
|
|
297
|
+
export function getLongRunningPoller<
|
|
298
|
+
TResponse extends PathUncheckedResponse,
|
|
299
|
+
TResult = void
|
|
300
|
+
>(
|
|
301
|
+
client: Client,
|
|
302
|
+
processResponseBody: (result: TResponse) => PromiseLike<TResult>,
|
|
303
|
+
options: GetLongRunningPollerOptions<TResponse>
|
|
304
|
+
): PollerLike<OperationState<TResult>, TResult> {
|
|
305
|
+
const { restoreFrom, getInitialResponse } = options;
|
|
306
|
+
if (!restoreFrom && !getInitialResponse) {
|
|
307
|
+
throw new Error(
|
|
308
|
+
"Either restoreFrom or getInitialResponse must be specified"
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
let initialResponse: TResponse | undefined = undefined;
|
|
312
|
+
const pollAbortController = new AbortController();
|
|
313
|
+
const poller: LongRunningOperation<TResponse> = {
|
|
314
|
+
sendInitialRequest: async () => {
|
|
315
|
+
if (!getInitialResponse) {
|
|
316
|
+
throw new Error(
|
|
317
|
+
"getInitialResponse is required when initializing a new poller"
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
initialResponse = await getInitialResponse();
|
|
321
|
+
return getLroResponse(initialResponse);
|
|
322
|
+
},
|
|
323
|
+
sendPollRequest: async (
|
|
324
|
+
path: string,
|
|
325
|
+
pollOptions?: {
|
|
326
|
+
abortSignal?: AbortSignalLike;
|
|
327
|
+
}
|
|
328
|
+
) => {
|
|
329
|
+
// The poll request would both listen to the user provided abort signal and the poller's own abort signal
|
|
330
|
+
function abortListener(): void {
|
|
331
|
+
pollAbortController.abort();
|
|
332
|
+
}
|
|
333
|
+
const abortSignal = pollAbortController.signal;
|
|
334
|
+
if (options.abortSignal?.aborted) {
|
|
335
|
+
pollAbortController.abort();
|
|
336
|
+
} else if (pollOptions?.abortSignal?.aborted) {
|
|
337
|
+
pollAbortController.abort();
|
|
338
|
+
} else if (!abortSignal.aborted) {
|
|
339
|
+
options.abortSignal?.addEventListener("abort", abortListener, {
|
|
340
|
+
once: true
|
|
341
|
+
});
|
|
342
|
+
pollOptions?.abortSignal?.addEventListener("abort", abortListener, {
|
|
343
|
+
once: true
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
let response;
|
|
347
|
+
try {
|
|
348
|
+
response = await client.pathUnchecked(path).get({ abortSignal });
|
|
349
|
+
} finally {
|
|
350
|
+
options.abortSignal?.removeEventListener("abort", abortListener);
|
|
351
|
+
pollOptions?.abortSignal?.removeEventListener("abort", abortListener);
|
|
352
|
+
}
|
|
353
|
+
if (options.initialUrl || initialResponse) {
|
|
354
|
+
response.headers["x-ms-original-url"] =
|
|
355
|
+
options.initialUrl ?? initialResponse!.request.url;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
return getLroResponse(response as TResponse);
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
return createHttpPoller(poller, {
|
|
362
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
363
|
+
resourceLocationConfig: options?.resourceLocationConfig,
|
|
364
|
+
restoreFrom: options?.restoreFrom,
|
|
365
|
+
processResult: (result: unknown) => {
|
|
366
|
+
return processResponseBody(result as TResponse) as TResult;
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Converts a Rest Client response to a response that the LRO implementation understands
|
|
372
|
+
* @param response - a rest client http response
|
|
373
|
+
* @param deserializeFn - deserialize function to convert Rest response to modular output
|
|
374
|
+
* @returns - An LRO response that the LRO implementation understands
|
|
375
|
+
*/
|
|
376
|
+
function getLroResponse<TResponse extends PathUncheckedResponse>(
|
|
377
|
+
response: TResponse
|
|
378
|
+
): OperationResponse<TResponse> {
|
|
379
|
+
${checkResponseStatus}
|
|
380
|
+
return {
|
|
381
|
+
flatResponse: response,
|
|
382
|
+
rawResponse: {
|
|
383
|
+
...response,
|
|
384
|
+
statusCode: Number.parseInt(response.status),
|
|
385
|
+
body: response.body
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
`;
|
|
390
|
+
const filePath = path.join(codeModel.modularOptions.sourceRoot, (_a = client.subfolder) !== null && _a !== void 0 ? _a : "", `api/pollingHelpers.ts`);
|
|
391
|
+
const fileContent = codeModel.project.createSourceFile(filePath, undefined, {
|
|
392
|
+
overwrite: true
|
|
393
|
+
});
|
|
394
|
+
importLroCoreDependencies(fileContent);
|
|
395
|
+
fileContent.addStatements(getLroPollerContent);
|
|
396
|
+
fileContent.fixMissingImports();
|
|
397
|
+
fileContent.fixUnusedIdentifiers();
|
|
398
|
+
}
|
|
399
|
+
//# sourceMappingURL=buildLroFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildLroFiles.js","sourceRoot":"","sources":["../../../src/modular/buildLroFiles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAElE;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,UAAsB;IAC9D,UAAU,CAAC,oBAAoB,CAAC;QAC9B,eAAe,EAAE,iBAAiB;QAClC,YAAY,EAAE;YACZ,YAAY;YACZ,gBAAgB;YAChB,kBAAkB;YAClB,wBAAwB;YACxB,sBAAsB;YACtB,kBAAkB;YAClB,mBAAmB;SACpB;KACF,CAAC,CAAC;AACL,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6GpB,mBAAmB;;;;;;;;;;GAUtB,CAAC;IACF,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CACxB,SAAS,CAAC,cAAc,CAAC,UAAU,EACnC,MAAA,MAAM,CAAC,SAAS,mCAAI,EAAE,EACtB,uBAAuB,CACxB,CAAC;IAEF,MAAM,WAAW,GAAG,SAAS,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,EAAE;QAC1E,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;IACH,yBAAyB,CAAC,WAAW,CAAC,CAAC;IACvC,WAAW,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAC/C,WAAW,CAAC,iBAAiB,EAAE,CAAC;IAChC,WAAW,CAAC,oBAAoB,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Project, SourceFile } from "ts-morph";
|
|
2
2
|
import { Client, ModularCodeModel, Operation } from "./modularCodeModel.js";
|
|
3
3
|
import { SdkContext } from "../utils/interfaces.js";
|
|
4
|
+
import { OperationPathAndDeserDetails } from "./interfaces.js";
|
|
4
5
|
/**
|
|
5
6
|
* This function creates a file under /api for each operation group.
|
|
6
7
|
* If there is no operation group in the TypeSpec program, we create a single
|
|
@@ -10,8 +11,13 @@ export declare function buildOperationFiles(client: Client, dpgContext: SdkConte
|
|
|
10
11
|
export declare function importModels(srcPath: string, sourceFile: SourceFile, project: Project, subfolder?: string, importLayer?: number): void;
|
|
11
12
|
export declare function importDeserializeUtils(srcPath: string, sourceFile: SourceFile, project: Project, serializeType: string, subfolder?: string, importLayer?: number): void;
|
|
12
13
|
export declare function importPagingDependencies(srcPath: string, sourceFile: SourceFile, project: Project, subfolder?: string, importLayer?: number): void;
|
|
14
|
+
export declare function importLroDependencies(sourceFile: SourceFile, importLayer?: number): void;
|
|
13
15
|
/**
|
|
14
16
|
* This function generates the interfaces for each operation options
|
|
15
17
|
*/
|
|
16
18
|
export declare function buildOperationOptions(operation: Operation, sourceFile: SourceFile): void;
|
|
19
|
+
/**
|
|
20
|
+
* This function creates a map of operation file path to operation names.
|
|
21
|
+
*/
|
|
22
|
+
export declare function buildLroDeserDetailMap(client: Client): Map<string, OperationPathAndDeserDetails[]>;
|
|
17
23
|
//# sourceMappingURL=buildOperations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildOperations.d.ts","sourceRoot":"","sources":["../../../src/modular/buildOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"buildOperations.d.ts","sourceRoot":"","sources":["../../../src/modular/buildOperations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAU/C,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAG5E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAOpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAG/D;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,gBAAgB,EAC3B,oBAAoB,GAAE,OAAc,gBA6IrC;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,SAAS,GAAE,MAAW,EACtB,WAAW,GAAE,MAAU,QA0BxB;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,EACrB,SAAS,GAAE,MAAW,EACtB,WAAW,GAAE,MAAU,QAwBxB;AAID,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,SAAS,GAAE,MAAW,EACtB,WAAW,GAAE,MAAU,QAmCxB;AAED,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,UAAU,EACtB,WAAW,GAAE,MAAU,QAUxB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,QA6BvB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,+CA6CpD"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { NameType, normalizeName } from "@azure-tools/rlc-common";
|
|
2
2
|
import { buildType } from "./helpers/typeHelpers.js";
|
|
3
|
-
import { getOperationFunction, getSendPrivateFunction, getDeserializePrivateFunction, getOperationOptionsName } from "./helpers/operationHelpers.js";
|
|
3
|
+
import { getOperationFunction, getSendPrivateFunction, getDeserializePrivateFunction, getOperationOptionsName, isLroOnlyOperation } from "./helpers/operationHelpers.js";
|
|
4
4
|
import { isRLCMultiEndpoint } from "../utils/clientUtils.js";
|
|
5
5
|
import { getDocsFromDescription } from "./helpers/docsHelpers.js";
|
|
6
6
|
import { getImportSpecifier, addImportsToFiles, clearImportSets } from "@azure-tools/rlc-common";
|
|
7
|
+
import { importLroCoreDependencies } from "./buildLroFiles.js";
|
|
8
|
+
import { getOperationName } from "./helpers/namingHelpers.js";
|
|
7
9
|
/**
|
|
8
10
|
* This function creates a file under /api for each operation group.
|
|
9
11
|
* If there is no operation group in the TypeSpec program, we create a single
|
|
@@ -25,6 +27,8 @@ export function buildOperationFiles(client, dpgContext, codeModel, needUnexpecte
|
|
|
25
27
|
const subfolder = client.subfolder;
|
|
26
28
|
const srcPath = codeModel.modularOptions.sourceRoot;
|
|
27
29
|
const operationGroupFile = codeModel.project.createSourceFile(`${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}api/${operationFileName}.ts`);
|
|
30
|
+
// We need to import the lro helpers and types explicitly because ts-morph may not be able to find correct ones.
|
|
31
|
+
importLroDependencies(operationGroupFile, operationGroup.namespaceHierarchies.length);
|
|
28
32
|
// Import models used from ./models.ts
|
|
29
33
|
// We SHOULD keep this because otherwise ts-morph will "helpfully" try to import models from the rest layer when we call fixMissingImports().
|
|
30
34
|
importModels(srcPath, operationGroupFile, codeModel.project, subfolder, operationGroup.namespaceHierarchies.length);
|
|
@@ -96,8 +100,8 @@ export function importModels(srcPath, sourceFile, project, subfolder = "", impor
|
|
|
96
100
|
});
|
|
97
101
|
const modelsFile = project.getSourceFile(`${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}models/models.ts`);
|
|
98
102
|
const models = [];
|
|
99
|
-
for (const
|
|
100
|
-
models.push(
|
|
103
|
+
for (const [name] of (_a = modelsFile === null || modelsFile === void 0 ? void 0 : modelsFile.getExportedDeclarations().entries()) !== null && _a !== void 0 ? _a : []) {
|
|
104
|
+
models.push(name);
|
|
101
105
|
}
|
|
102
106
|
if (models.length > 0 && !hasModelsImport) {
|
|
103
107
|
sourceFile.addImportDeclaration({
|
|
@@ -151,6 +155,13 @@ export function importPagingDependencies(srcPath, sourceFile, project, subfolder
|
|
|
151
155
|
namedImports: exportedPaingHelpers
|
|
152
156
|
});
|
|
153
157
|
}
|
|
158
|
+
export function importLroDependencies(sourceFile, importLayer = 0) {
|
|
159
|
+
sourceFile.addImportDeclaration({
|
|
160
|
+
moduleSpecifier: `${importLayer === 0 ? "./" : "../".repeat(importLayer)}pollingHelpers.js`,
|
|
161
|
+
namedImports: ["getLongRunningPoller"]
|
|
162
|
+
});
|
|
163
|
+
importLroCoreDependencies(sourceFile);
|
|
164
|
+
}
|
|
154
165
|
/**
|
|
155
166
|
* This function generates the interfaces for each operation options
|
|
156
167
|
*/
|
|
@@ -160,17 +171,65 @@ export function buildOperationOptions(operation, sourceFile) {
|
|
|
160
171
|
.filter((p) => p.optional || p.clientDefaultValue);
|
|
161
172
|
const options = [...optionalParameters];
|
|
162
173
|
const name = getOperationOptionsName(operation, true);
|
|
174
|
+
const lroOptions = {
|
|
175
|
+
name: "updateIntervalInMs",
|
|
176
|
+
type: "number",
|
|
177
|
+
hasQuestionToken: true,
|
|
178
|
+
docs: ["Delay to wait until next poll, in milliseconds."]
|
|
179
|
+
};
|
|
163
180
|
sourceFile.addInterface({
|
|
164
181
|
name,
|
|
165
182
|
isExported: true,
|
|
166
183
|
extends: ["OperationOptions"],
|
|
167
|
-
properties: options.map((p) => {
|
|
184
|
+
properties: (isLroOnlyOperation(operation) ? [lroOptions] : []).concat(options.map((p) => {
|
|
168
185
|
return {
|
|
169
186
|
docs: getDocsFromDescription(p.description),
|
|
170
187
|
hasQuestionToken: true,
|
|
171
188
|
...buildType(p.clientName, p.type, p.format)
|
|
172
189
|
};
|
|
173
|
-
})
|
|
190
|
+
}))
|
|
174
191
|
});
|
|
175
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* This function creates a map of operation file path to operation names.
|
|
195
|
+
*/
|
|
196
|
+
export function buildLroDeserDetailMap(client) {
|
|
197
|
+
const map = new Map();
|
|
198
|
+
const existingNames = new Set();
|
|
199
|
+
for (const operationGroup of client.operationGroups) {
|
|
200
|
+
const operations = operationGroup.operations.filter((o) => isLroOnlyOperation(o));
|
|
201
|
+
// skip this operation group if it has no LRO operations
|
|
202
|
+
if (operations.length === 0) {
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
const operationFileName = operationGroup.className && operationGroup.namespaceHierarchies.length > 0
|
|
206
|
+
? `${operationGroup.namespaceHierarchies
|
|
207
|
+
.map((hierarchy) => {
|
|
208
|
+
return normalizeName(hierarchy, NameType.File);
|
|
209
|
+
})
|
|
210
|
+
.join("/")}/index`
|
|
211
|
+
: // When the program has no operation groups defined all operations are put
|
|
212
|
+
// into a nameless operation group. We'll call this operations.
|
|
213
|
+
"operations";
|
|
214
|
+
map.set(`./api/${operationFileName}.js`, operations.map((o) => {
|
|
215
|
+
const { name } = getOperationName(o);
|
|
216
|
+
const deserName = `_${name}Deserialize`;
|
|
217
|
+
let renamedDeserName = undefined;
|
|
218
|
+
if (existingNames.has(deserName)) {
|
|
219
|
+
const newName = `${name}Deserialize_${operationFileName
|
|
220
|
+
.split("/")
|
|
221
|
+
.slice(0, -1)
|
|
222
|
+
.join("_")}`;
|
|
223
|
+
renamedDeserName = `_${normalizeName(newName, NameType.Method)}`;
|
|
224
|
+
}
|
|
225
|
+
existingNames.add(deserName);
|
|
226
|
+
return {
|
|
227
|
+
path: `${o.method.toUpperCase()} ${o.url}`,
|
|
228
|
+
deserName,
|
|
229
|
+
renamedDeserName
|
|
230
|
+
};
|
|
231
|
+
}));
|
|
232
|
+
}
|
|
233
|
+
return map;
|
|
234
|
+
}
|
|
176
235
|
//# sourceMappingURL=buildOperations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildOperations.js","sourceRoot":"","sources":["../../../src/modular/buildOperations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,6BAA6B,EAC7B,uBAAuB,
|
|
1
|
+
{"version":3,"file":"buildOperations.js","sourceRoot":"","sources":["../../../src/modular/buildOperations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,6BAA6B,EAC7B,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MA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CAAC,SAAS,CAAC,CAAC;YAC7B,OAAO;gBACL,IAAI,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE;gBAC1C,SAAS;gBACT,gBAAgB;aACjB,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from "path";
|
|
2
|
-
import {
|
|
2
|
+
import { hasPagingOnlyOperation, isPagingOnlyOperation } from "./helpers/operationHelpers.js";
|
|
3
3
|
export function buildPagingTypes(client, codeModel) {
|
|
4
4
|
var _a;
|
|
5
|
-
if (!
|
|
5
|
+
if (!hasPagingOnlyOperation(client)) {
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
8
8
|
const filePath = path.join(codeModel.modularOptions.sourceRoot, (_a = client.subfolder) !== null && _a !== void 0 ? _a : "", `models/pagingTypes.ts`);
|
|
@@ -105,7 +105,7 @@ export function buildPagingHelpers(client, codeModel, needUnexpectedHelper = tru
|
|
|
105
105
|
var _a;
|
|
106
106
|
const pagingOperstions = client.operationGroups
|
|
107
107
|
.flatMap((op) => op.operations)
|
|
108
|
-
.filter(
|
|
108
|
+
.filter(isPagingOnlyOperation);
|
|
109
109
|
if (!pagingOperstions || pagingOperstions.length === 0) {
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildPagingFiles.js","sourceRoot":"","sources":["../../../src/modular/buildPagingFiles.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"buildPagingFiles.js","sourceRoot":"","sources":["../../../src/modular/buildPagingFiles.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,+BAA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AAC;IACP,MAAM,eAAe,GAAG,0BAA0B,CAAC;IACnD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CACxB,SAAS,CAAC,cAAc,CAAC,UAAU,EACnC,MAAA,MAAM,CAAC,SAAS,mCAAI,EAAE,EACtB,sBAAsB,CACvB,CAAC;IAEF,MAAM,WAAW,GAAG,SAAS,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,EAAE;QAC1E,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;IAEH,WAAW,CAAC,aAAa,CAAC;QACxB;;;;;;;;;;;;;cAaU,eAAe;MACvB,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAwKlB,4BAA4B;;KAEjC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { Project } from "ts-morph";
|
|
2
1
|
import { ModularCodeModel } from "./modularCodeModel.js";
|
|
3
2
|
export declare function getModuleExports(codeModel: ModularCodeModel): any;
|
|
4
|
-
export declare function emitPackage(project: Project, metadataDir: string, codeModel: ModularCodeModel): import("ts-morph").SourceFile;
|
|
5
|
-
export declare function emitTsConfig(project: Project, srcPath: string, codeModel: ModularCodeModel): import("ts-morph").SourceFile;
|
|
6
3
|
//# sourceMappingURL=buildProjectFiles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildProjectFiles.d.ts","sourceRoot":"","sources":["../../../src/modular/buildProjectFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"buildProjectFiles.d.ts","sourceRoot":"","sources":["../../../src/modular/buildProjectFiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAiDzD,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,OAU3D"}
|