@azure-tools/typespec-azure-resource-manager 0.74.0-dev.2 → 0.74.0-dev.21
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 +14 -2
- package/dist/generated-defs/Azure.ResourceManager.BaseTypes.d.ts +11 -0
- package/dist/generated-defs/Azure.ResourceManager.BaseTypes.d.ts.map +1 -1
- package/dist/generated-defs/Azure.ResourceManager.Legacy.d.ts +33 -0
- package/dist/generated-defs/Azure.ResourceManager.Legacy.d.ts.map +1 -1
- package/dist/generated-defs/Azure.ResourceManager.d.ts +33 -0
- package/dist/generated-defs/Azure.ResourceManager.d.ts.map +1 -1
- package/dist/src/codefixes/delete-property.d.ts +4 -0
- package/dist/src/codefixes/delete-property.d.ts.map +1 -0
- package/dist/src/codefixes/delete-property.js +17 -0
- package/dist/src/codefixes/delete-property.js.map +1 -0
- package/dist/src/lib.d.ts +167 -2
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +66 -0
- package/dist/src/lib.js.map +1 -1
- package/dist/src/linter.d.ts.map +1 -1
- package/dist/src/linter.js +32 -0
- package/dist/src/linter.js.map +1 -1
- package/dist/src/operations.d.ts +1 -2
- package/dist/src/operations.d.ts.map +1 -1
- package/dist/src/operations.js +19 -43
- package/dist/src/operations.js.map +1 -1
- package/dist/src/private.decorators.d.ts +2 -1
- package/dist/src/private.decorators.d.ts.map +1 -1
- package/dist/src/private.decorators.js +40 -10
- package/dist/src/private.decorators.js.map +1 -1
- package/dist/src/resource-name.d.ts +27 -0
- package/dist/src/resource-name.d.ts.map +1 -0
- package/dist/src/resource-name.js +82 -0
- package/dist/src/resource-name.js.map +1 -0
- package/dist/src/resource.d.ts +128 -11
- package/dist/src/resource.d.ts.map +1 -1
- package/dist/src/resource.js +415 -109
- package/dist/src/resource.js.map +1 -1
- package/dist/src/rules/arm-custom-resource-usage-discourage.js +3 -20
- package/dist/src/rules/arm-custom-resource-usage-discourage.js.map +1 -1
- package/dist/src/rules/arm-resource-invalid-envelope-property.d.ts.map +1 -1
- package/dist/src/rules/arm-resource-invalid-envelope-property.js +12 -3
- package/dist/src/rules/arm-resource-invalid-envelope-property.js.map +1 -1
- package/dist/src/rules/http-response-utils.d.ts +16 -0
- package/dist/src/rules/http-response-utils.d.ts.map +1 -0
- package/dist/src/rules/http-response-utils.js +31 -0
- package/dist/src/rules/http-response-utils.js.map +1 -0
- package/dist/src/rules/lro-missing-polling-metadata.d.ts +4 -0
- package/dist/src/rules/lro-missing-polling-metadata.d.ts.map +1 -0
- package/dist/src/rules/lro-missing-polling-metadata.js +59 -0
- package/dist/src/rules/lro-missing-polling-metadata.js.map +1 -0
- package/dist/src/rules/model-utils.d.ts +4 -0
- package/dist/src/rules/model-utils.d.ts.map +1 -0
- package/dist/src/rules/model-utils.js +18 -0
- package/dist/src/rules/model-utils.js.map +1 -0
- package/dist/src/rules/no-empty-post-response.d.ts +4 -0
- package/dist/src/rules/no-empty-post-response.d.ts.map +1 -0
- package/dist/src/rules/no-empty-post-response.js +38 -0
- package/dist/src/rules/no-empty-post-response.js.map +1 -0
- package/dist/src/rules/no-repeated-path-info.d.ts +4 -0
- package/dist/src/rules/no-repeated-path-info.d.ts.map +1 -0
- package/dist/src/rules/no-repeated-path-info.js +63 -0
- package/dist/src/rules/no-repeated-path-info.js.map +1 -0
- package/dist/src/rules/no-reserved-resource-property.d.ts.map +1 -1
- package/dist/src/rules/no-reserved-resource-property.js +2 -1
- package/dist/src/rules/no-reserved-resource-property.js.map +1 -1
- package/dist/src/rules/no-resource-name-conflict.d.ts +4 -0
- package/dist/src/rules/no-resource-name-conflict.d.ts.map +1 -0
- package/dist/src/rules/no-resource-name-conflict.js +52 -0
- package/dist/src/rules/no-resource-name-conflict.js.map +1 -0
- package/dist/src/rules/no-response-body.d.ts +2 -1
- package/dist/src/rules/no-response-body.d.ts.map +1 -1
- package/dist/src/rules/no-response-body.js +20 -13
- package/dist/src/rules/no-response-body.js.map +1 -1
- package/dist/src/rules/no-tags-on-proxy-resource.d.ts +4 -0
- package/dist/src/rules/no-tags-on-proxy-resource.d.ts.map +1 -0
- package/dist/src/rules/no-tags-on-proxy-resource.js +58 -0
- package/dist/src/rules/no-tags-on-proxy-resource.js.map +1 -0
- package/dist/src/rules/private-endpoint-apis-missing.d.ts +4 -0
- package/dist/src/rules/private-endpoint-apis-missing.d.ts.map +1 -0
- package/dist/src/rules/private-endpoint-apis-missing.js +90 -0
- package/dist/src/rules/private-endpoint-apis-missing.js.map +1 -0
- package/dist/src/rules/resource-missing-read.d.ts +4 -0
- package/dist/src/rules/resource-missing-read.d.ts.map +1 -0
- package/dist/src/rules/resource-missing-read.js +55 -0
- package/dist/src/rules/resource-missing-read.js.map +1 -0
- package/dist/src/rules/use-resource-path-for-put.d.ts +4 -0
- package/dist/src/rules/use-resource-path-for-put.d.ts.map +1 -0
- package/dist/src/rules/use-resource-path-for-put.js +35 -0
- package/dist/src/rules/use-resource-path-for-put.js.map +1 -0
- package/dist/src/rules/use-scope-for-extension-routing.d.ts +4 -0
- package/dist/src/rules/use-scope-for-extension-routing.d.ts.map +1 -0
- package/dist/src/rules/use-scope-for-extension-routing.js +37 -0
- package/dist/src/rules/use-scope-for-extension-routing.js.map +1 -0
- package/dist/src/rules/use-scope-path-standard-name.d.ts +5 -0
- package/dist/src/rules/use-scope-path-standard-name.d.ts.map +1 -0
- package/dist/src/rules/use-scope-path-standard-name.js +46 -0
- package/dist/src/rules/use-scope-path-standard-name.js.map +1 -0
- package/dist/src/rules/use-standard-error.d.ts +5 -0
- package/dist/src/rules/use-standard-error.d.ts.map +1 -0
- package/dist/src/rules/use-standard-error.js +66 -0
- package/dist/src/rules/use-standard-error.js.map +1 -0
- package/dist/src/rules/use-standard-response-codes.d.ts +6 -0
- package/dist/src/rules/use-standard-response-codes.d.ts.map +1 -0
- package/dist/src/rules/use-standard-response-codes.js +67 -0
- package/dist/src/rules/use-standard-response-codes.js.map +1 -0
- package/dist/src/rules/utils.d.ts +2 -0
- package/dist/src/rules/utils.d.ts.map +1 -1
- package/dist/src/rules/utils.js +16 -0
- package/dist/src/rules/utils.js.map +1 -1
- package/dist/src/state.d.ts +1 -0
- package/dist/src/state.d.ts.map +1 -1
- package/dist/src/state.js +1 -0
- package/dist/src/state.js.map +1 -1
- package/package.json +11 -11
package/dist/src/resource.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { getAllProperties } from "@azure-tools/typespec-azure-core";
|
|
2
|
-
import { $tag, getProperty as compilerGetProperty, getKeyName, getNamespaceFullName, getTags, isArrayModelType, isGlobalNamespace, isNeverType, isTemplateDeclaration, isTemplateDeclarationOrInstance, isTemplateInstance, } from "@typespec/compiler";
|
|
2
|
+
import { $tag, getProperty as compilerGetProperty, getKeyName, getNamespaceFullName, getTags, isArrayModelType, isGlobalNamespace, isNeverType, isTemplateDeclaration, isTemplateDeclarationOrInstance, isTemplateInstance, NoTarget, } from "@typespec/compiler";
|
|
3
|
+
import { unsafe_mutateSubgraphWithNamespace, unsafe_Realm } from "@typespec/compiler/experimental";
|
|
3
4
|
import { useStateMap } from "@typespec/compiler/utils";
|
|
4
5
|
import { getHttpOperation, isPathParam } from "@typespec/http";
|
|
5
6
|
import { $autoRoute, getParentResource, getSegment } from "@typespec/rest";
|
|
7
|
+
import { getAllVersions, getVersioningMutators } from "@typespec/versioning";
|
|
6
8
|
import { camelCase, pascalCase } from "change-case";
|
|
7
9
|
import { reportDiagnostic } from "./lib.js";
|
|
8
|
-
import { getArmProviderNamespace, isArmLibraryNamespace, resolveProviderNamespace, } from "./namespace.js";
|
|
9
|
-
import { getArmResourceOperationData, getArmResourceOperationList,
|
|
10
|
+
import { getArmProviderNamespace, isArmLibraryNamespace, isArmProviderNamespace, resolveProviderNamespace, } from "./namespace.js";
|
|
11
|
+
import { getArmResourceOperationData, getArmResourceOperationList, resolveResourceOperations, } from "./operations.js";
|
|
10
12
|
import { getArmResource, listArmResources, registerArmResource } from "./private.decorators.js";
|
|
13
|
+
import { evaluateResourceNameExpression, getResourceNameExpression, getResourceNameExpressionModels, } from "./resource-name.js";
|
|
11
14
|
import { ArmStateKeys } from "./state.js";
|
|
12
15
|
export const [isArmExternalType, setArmExternalType] = useStateMap(ArmStateKeys.armExternalType);
|
|
13
16
|
export const $armExternalType = (context, entity) => {
|
|
@@ -228,23 +231,218 @@ function mapResourceKind(kind, hasOperations) {
|
|
|
228
231
|
return hasOperations ? "Tracked" : "Other";
|
|
229
232
|
}
|
|
230
233
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
+
function getResolvedResourceKind(kind) {
|
|
235
|
+
return kind === "Tracked" ? "Tracked" : "Proxy";
|
|
236
|
+
}
|
|
237
|
+
const armResourceVersionSnapshots = new WeakMap();
|
|
238
|
+
const structuralProviders = new WeakMap();
|
|
239
|
+
const syntheticResources = new WeakSet();
|
|
240
|
+
/**
|
|
241
|
+
* Resolves ARM resources and operations.
|
|
242
|
+
*
|
|
243
|
+
* With no options, this returns the multi-version declaration view and preserves the original
|
|
244
|
+
* resolver behavior. A single exact API version or several service namespace/version selections
|
|
245
|
+
* project the returned TypeSpec references with `@typespec/versioning` to reflect availability,
|
|
246
|
+
* renames, and type changes.
|
|
247
|
+
*/
|
|
248
|
+
export function resolveArmResources(program, options = {}) {
|
|
249
|
+
if (options.serviceVersions !== undefined) {
|
|
250
|
+
if (options.version !== undefined) {
|
|
251
|
+
reportDiagnostic(program, {
|
|
252
|
+
code: "arm-resource-service-options-conflict",
|
|
253
|
+
target: NoTarget,
|
|
254
|
+
});
|
|
255
|
+
return {};
|
|
256
|
+
}
|
|
257
|
+
return resolveArmResourcesForServiceVersions(program, options);
|
|
258
|
+
}
|
|
259
|
+
const providerNamespace = resolveProviderNamespace(program);
|
|
260
|
+
if (providerNamespace === undefined)
|
|
234
261
|
return {};
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
262
|
+
const context = options.version === undefined
|
|
263
|
+
? { program, providerNamespace }
|
|
264
|
+
: resolveArmResourceVersionContext(program, providerNamespace, options.version);
|
|
265
|
+
if (context === undefined)
|
|
266
|
+
return {};
|
|
267
|
+
return resolveArmResourcesForResolvedContext(context, options);
|
|
268
|
+
}
|
|
269
|
+
function resolveArmResourcesForServiceVersions(program, options) {
|
|
270
|
+
const selections = validateArmServiceVersionSelections(program, options.serviceVersions);
|
|
271
|
+
if (selections === undefined)
|
|
272
|
+
return {};
|
|
273
|
+
const contexts = [];
|
|
274
|
+
for (const selection of selections) {
|
|
275
|
+
const context = resolveArmResourceVersionContext(program, selection.namespace, selection.version);
|
|
276
|
+
if (context === undefined)
|
|
277
|
+
return {};
|
|
278
|
+
contexts.push({ context, version: selection.version });
|
|
279
|
+
}
|
|
280
|
+
const providers = contexts.map(({ context, version }) => resolveArmResourcesForResolvedContext(context, {
|
|
281
|
+
version: version.value,
|
|
282
|
+
nameResolver: options.nameResolver,
|
|
283
|
+
}));
|
|
284
|
+
return {
|
|
285
|
+
resources: providers.flatMap((provider) => provider.resources),
|
|
286
|
+
providerOperations: providers.flatMap((provider) => provider.providerOperations),
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
function validateArmServiceVersionSelections(program, selections) {
|
|
290
|
+
if (selections.length === 0) {
|
|
291
|
+
reportDiagnostic(program, {
|
|
292
|
+
code: "arm-resource-service-versions-empty",
|
|
293
|
+
target: NoTarget,
|
|
294
|
+
});
|
|
295
|
+
return undefined;
|
|
296
|
+
}
|
|
297
|
+
const namespaces = new Set();
|
|
298
|
+
for (const selection of selections) {
|
|
299
|
+
const namespaceName = getNamespaceFullName(selection.namespace);
|
|
300
|
+
if (namespaces.has(selection.namespace)) {
|
|
301
|
+
reportDiagnostic(program, {
|
|
302
|
+
code: "arm-resource-service-duplicate",
|
|
303
|
+
format: { namespace: namespaceName },
|
|
304
|
+
target: selection.namespace,
|
|
305
|
+
});
|
|
306
|
+
return undefined;
|
|
307
|
+
}
|
|
308
|
+
namespaces.add(selection.namespace);
|
|
309
|
+
if (!isArmProviderNamespace(program, selection.namespace)) {
|
|
310
|
+
reportDiagnostic(program, {
|
|
311
|
+
code: "arm-resource-service-not-arm",
|
|
312
|
+
format: { namespace: namespaceName },
|
|
313
|
+
target: selection.namespace,
|
|
314
|
+
});
|
|
315
|
+
return undefined;
|
|
316
|
+
}
|
|
317
|
+
if (selection.version.namespace !== selection.namespace) {
|
|
318
|
+
reportDiagnostic(program, {
|
|
319
|
+
code: "arm-resource-service-version-mismatch",
|
|
320
|
+
format: {
|
|
321
|
+
version: selection.version.value,
|
|
322
|
+
versionNamespace: getNamespaceFullName(selection.version.namespace),
|
|
323
|
+
selectedNamespace: namespaceName,
|
|
324
|
+
},
|
|
325
|
+
target: selection.version.enumMember,
|
|
326
|
+
});
|
|
327
|
+
return undefined;
|
|
328
|
+
}
|
|
329
|
+
const registeredVersions = getAllVersions(program, selection.namespace);
|
|
330
|
+
if (registeredVersions?.includes(selection.version) !== true) {
|
|
331
|
+
reportDiagnostic(program, {
|
|
332
|
+
code: "arm-resource-service-version-invalid",
|
|
333
|
+
format: {
|
|
334
|
+
version: selection.version.value,
|
|
335
|
+
namespace: namespaceName,
|
|
336
|
+
},
|
|
337
|
+
target: selection.namespace,
|
|
338
|
+
});
|
|
339
|
+
return undefined;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return selections;
|
|
343
|
+
}
|
|
344
|
+
function resolveArmResourcesForResolvedContext(context, options) {
|
|
345
|
+
const { program } = context;
|
|
346
|
+
const source = resolveArmResourcesForContext(context);
|
|
347
|
+
if (options.nameResolver === undefined) {
|
|
348
|
+
const cached = getResolvedResources(program, context.providerNamespace);
|
|
349
|
+
if (cached !== undefined)
|
|
350
|
+
return cached;
|
|
351
|
+
const provider = finalizeArmProvider(program, source, options);
|
|
352
|
+
setResolvedResources(program, context.providerNamespace, provider);
|
|
353
|
+
return provider;
|
|
354
|
+
}
|
|
355
|
+
return finalizeArmProvider(program, source, options);
|
|
356
|
+
}
|
|
357
|
+
function resolveArmResourceVersionContext(program, providerNamespace, version) {
|
|
358
|
+
const versionValue = typeof version === "string" ? version : version.value;
|
|
359
|
+
let providerSnapshots = armResourceVersionSnapshots.get(program);
|
|
360
|
+
if (providerSnapshots === undefined) {
|
|
361
|
+
providerSnapshots = new Map();
|
|
362
|
+
armResourceVersionSnapshots.set(program, providerSnapshots);
|
|
363
|
+
}
|
|
364
|
+
let versionSnapshots = providerSnapshots.get(providerNamespace);
|
|
365
|
+
if (versionSnapshots === undefined) {
|
|
366
|
+
versionSnapshots = new Map();
|
|
367
|
+
providerSnapshots.set(providerNamespace, versionSnapshots);
|
|
368
|
+
}
|
|
369
|
+
const cached = versionSnapshots.get(versionValue);
|
|
370
|
+
if (cached !== undefined) {
|
|
371
|
+
return { program, ...cached };
|
|
372
|
+
}
|
|
373
|
+
const versioning = getVersioningMutators(program, providerNamespace);
|
|
374
|
+
if (versioning === undefined) {
|
|
375
|
+
reportDiagnostic(program, {
|
|
376
|
+
code: "arm-resource-version-not-supported",
|
|
377
|
+
format: { version: versionValue },
|
|
378
|
+
target: providerNamespace,
|
|
379
|
+
});
|
|
380
|
+
return undefined;
|
|
381
|
+
}
|
|
382
|
+
if (versioning.kind === "transient") {
|
|
383
|
+
reportDiagnostic(program, {
|
|
384
|
+
code: "arm-resource-version-transient",
|
|
385
|
+
format: { version: versionValue },
|
|
386
|
+
target: providerNamespace,
|
|
387
|
+
});
|
|
388
|
+
return undefined;
|
|
239
389
|
}
|
|
390
|
+
const snapshot = versioning.snapshots.find((x) => typeof version === "string" ? x.version.value === version : x.version === version);
|
|
391
|
+
if (snapshot === undefined) {
|
|
392
|
+
reportDiagnostic(program, {
|
|
393
|
+
code: "arm-resource-version-not-found",
|
|
394
|
+
format: {
|
|
395
|
+
version: versionValue,
|
|
396
|
+
availableVersions: versioning.snapshots.map((x) => x.version.value).join(", "),
|
|
397
|
+
},
|
|
398
|
+
target: providerNamespace,
|
|
399
|
+
});
|
|
400
|
+
return undefined;
|
|
401
|
+
}
|
|
402
|
+
const projection = unsafe_mutateSubgraphWithNamespace(program, [snapshot.mutator], providerNamespace);
|
|
403
|
+
if (projection.realm === null || projection.type.kind !== "Namespace") {
|
|
404
|
+
reportDiagnostic(program, {
|
|
405
|
+
code: "arm-resource-version-projection-failed",
|
|
406
|
+
format: { version: versionValue },
|
|
407
|
+
target: providerNamespace,
|
|
408
|
+
});
|
|
409
|
+
return undefined;
|
|
410
|
+
}
|
|
411
|
+
const resolvedSnapshot = {
|
|
412
|
+
providerNamespace: projection.type,
|
|
413
|
+
realm: projection.realm,
|
|
414
|
+
};
|
|
415
|
+
versionSnapshots.set(versionValue, resolvedSnapshot);
|
|
416
|
+
return { program, ...resolvedSnapshot };
|
|
417
|
+
}
|
|
418
|
+
function resolveArmResourcesForContext(context) {
|
|
419
|
+
const { program, providerNamespace, realm } = context;
|
|
420
|
+
let programProviders = structuralProviders.get(program);
|
|
421
|
+
if (programProviders === undefined) {
|
|
422
|
+
programProviders = new Map();
|
|
423
|
+
structuralProviders.set(program, programProviders);
|
|
424
|
+
}
|
|
425
|
+
const cached = programProviders.get(providerNamespace);
|
|
426
|
+
if (cached !== undefined)
|
|
427
|
+
return cached;
|
|
240
428
|
// We haven't generated the full resource details yet
|
|
241
429
|
const resources = [];
|
|
242
|
-
|
|
243
|
-
|
|
430
|
+
const unmatchedLists = new Map();
|
|
431
|
+
for (const resource of listArmResources(program, realm)) {
|
|
432
|
+
if (realm !== undefined &&
|
|
433
|
+
!isTypeDeclaredInNamespace(resource.typespecType, providerNamespace)) {
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
const { resources: operations, unmatchedLists: resourceLists } = resolveResourceOperationsWithLists(program, resource.typespecType);
|
|
437
|
+
for (const list of resourceLists) {
|
|
438
|
+
unmatchedLists.set(list.operation, list);
|
|
439
|
+
}
|
|
244
440
|
const singletonKeyValues = getSingletonKeyValues(program, resource.typespecType);
|
|
245
441
|
for (const op of operations) {
|
|
246
442
|
const fullResource = {
|
|
247
443
|
...op,
|
|
444
|
+
parent: undefined,
|
|
445
|
+
scope: undefined,
|
|
248
446
|
type: resource.typespecType,
|
|
249
447
|
kind: getPublicResourceKind(resource.typespecType) ??
|
|
250
448
|
mapResourceKind(resource.kind, operations.length > 0),
|
|
@@ -265,11 +463,149 @@ export function resolveArmResources(program) {
|
|
|
265
463
|
// Add the unmarked operations
|
|
266
464
|
const resolved = {
|
|
267
465
|
resources: resources,
|
|
268
|
-
providerOperations:
|
|
466
|
+
providerOperations: [
|
|
467
|
+
...getUnassociatedOperationsForContainer(program, providerNamespace),
|
|
468
|
+
...[...unmatchedLists.values()].filter((list) => isTypeDeclaredInNamespace(list.operation, providerNamespace) &&
|
|
469
|
+
!resources.some((resource) => resource.operations.lists.some((operation) => operation.operation === list.operation))),
|
|
470
|
+
],
|
|
269
471
|
};
|
|
270
|
-
|
|
472
|
+
programProviders.set(providerNamespace, resolved);
|
|
271
473
|
return resolved;
|
|
272
474
|
}
|
|
475
|
+
function isTypeDeclaredInNamespace(type, namespace) {
|
|
476
|
+
let current = type.namespace;
|
|
477
|
+
while (current !== undefined) {
|
|
478
|
+
if (current === namespace)
|
|
479
|
+
return true;
|
|
480
|
+
current = current.namespace;
|
|
481
|
+
}
|
|
482
|
+
return false;
|
|
483
|
+
}
|
|
484
|
+
function finalizeArmProvider(program, provider, options) {
|
|
485
|
+
const nameResolver = options.nameResolver;
|
|
486
|
+
const resourceCopies = new Map();
|
|
487
|
+
const resources = provider.resources.map((resource) => {
|
|
488
|
+
const { kind, resourceNameExpression, resourceNameIsExplicit, ...resourceMetadata } = resource;
|
|
489
|
+
const copy = {
|
|
490
|
+
...resourceMetadata,
|
|
491
|
+
kind: getResolvedResourceKind(kind),
|
|
492
|
+
operations: { lifecycle: {}, lists: [], actions: [] },
|
|
493
|
+
associatedOperations: undefined,
|
|
494
|
+
parent: undefined,
|
|
495
|
+
scope: undefined,
|
|
496
|
+
};
|
|
497
|
+
resourceCopies.set(resource, copy);
|
|
498
|
+
return copy;
|
|
499
|
+
});
|
|
500
|
+
for (let i = 0; i < provider.resources.length; i++) {
|
|
501
|
+
const source = provider.resources[i];
|
|
502
|
+
const target = resources[i];
|
|
503
|
+
const requestContext = {
|
|
504
|
+
program,
|
|
505
|
+
version: options.version,
|
|
506
|
+
resourceType: formatResourceType(source.resourceType),
|
|
507
|
+
resourceInstancePath: source.resourceInstancePath,
|
|
508
|
+
};
|
|
509
|
+
const modelNames = new Map();
|
|
510
|
+
for (const model of getResourceNameExpressionModels(source.resourceNameExpression)) {
|
|
511
|
+
modelNames.set(model, resolveArmMetadataName(program, nameResolver, {
|
|
512
|
+
...requestContext,
|
|
513
|
+
kind: "resource-model",
|
|
514
|
+
defaultName: model.name,
|
|
515
|
+
type: model,
|
|
516
|
+
}));
|
|
517
|
+
}
|
|
518
|
+
const defaultName = evaluateResourceNameExpression(source.resourceNameExpression, source.resourceInstancePath, (model) => modelNames.get(model));
|
|
519
|
+
target.resourceName = resolveArmMetadataName(program, nameResolver, {
|
|
520
|
+
...requestContext,
|
|
521
|
+
kind: "resource",
|
|
522
|
+
defaultName,
|
|
523
|
+
type: syntheticResources.has(source) ? undefined : source.type,
|
|
524
|
+
});
|
|
525
|
+
target.operations = copyResolvedOperations(program, nameResolver, source.operations, target, target.resourceName, options.version);
|
|
526
|
+
target.associatedOperations = source.associatedOperations?.map((operation) => copyArmResourceOperation(program, nameResolver, operation, target, target.resourceName, options.version));
|
|
527
|
+
target.parent = source.parent === undefined ? undefined : resourceCopies.get(source.parent);
|
|
528
|
+
target.scope =
|
|
529
|
+
typeof source.scope === "object" ? resourceCopies.get(source.scope) : source.scope;
|
|
530
|
+
}
|
|
531
|
+
return {
|
|
532
|
+
resources,
|
|
533
|
+
providerOperations: provider.providerOperations.map((operation) => copyArmResourceOperation(program, nameResolver, operation, undefined, undefined, options.version)),
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
function copyResolvedOperations(program, nameResolver, operations, resource, resourceName, version) {
|
|
537
|
+
const lifecycle = {};
|
|
538
|
+
const lifecycleKinds = [
|
|
539
|
+
"read",
|
|
540
|
+
"createOrUpdate",
|
|
541
|
+
"update",
|
|
542
|
+
"delete",
|
|
543
|
+
"checkExistence",
|
|
544
|
+
];
|
|
545
|
+
for (const kind of lifecycleKinds) {
|
|
546
|
+
const operationList = operations.lifecycle[kind];
|
|
547
|
+
if (operationList !== undefined) {
|
|
548
|
+
lifecycle[kind] = operationList.map((operation) => copyArmResourceOperation(program, nameResolver, operation, resource, resourceName, version));
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
return {
|
|
552
|
+
lifecycle,
|
|
553
|
+
lists: operations.lists.map((operation) => copyArmResourceOperation(program, nameResolver, operation, resource, resourceName, version)),
|
|
554
|
+
actions: operations.actions.map((operation) => copyArmResourceOperation(program, nameResolver, operation, resource, resourceName, version)),
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
function copyArmResourceOperation(program, nameResolver, operation, resource, resourceName, version) {
|
|
558
|
+
const requestContext = {
|
|
559
|
+
program,
|
|
560
|
+
version,
|
|
561
|
+
resourceModel: resource?.type,
|
|
562
|
+
resourceType: resource === undefined ? undefined : formatResourceType(resource.resourceType),
|
|
563
|
+
resourceInstancePath: resource?.resourceInstancePath,
|
|
564
|
+
};
|
|
565
|
+
const name = resolveArmMetadataName(program, nameResolver, {
|
|
566
|
+
...requestContext,
|
|
567
|
+
kind: "operation",
|
|
568
|
+
defaultName: operation.name,
|
|
569
|
+
type: operation.operation,
|
|
570
|
+
});
|
|
571
|
+
const operationGroup = operation.operation.interface === undefined
|
|
572
|
+
? operation.operationGroup
|
|
573
|
+
: resolveArmMetadataName(program, nameResolver, {
|
|
574
|
+
...requestContext,
|
|
575
|
+
kind: "operation-group",
|
|
576
|
+
defaultName: operation.operationGroup,
|
|
577
|
+
type: operation.operation.interface,
|
|
578
|
+
});
|
|
579
|
+
return {
|
|
580
|
+
...operation,
|
|
581
|
+
name,
|
|
582
|
+
operationGroup,
|
|
583
|
+
...(resourceName === undefined
|
|
584
|
+
? {}
|
|
585
|
+
: {
|
|
586
|
+
resourceName,
|
|
587
|
+
resourceModelName: resourceName,
|
|
588
|
+
}),
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
function resolveArmMetadataName(program, nameResolver, request) {
|
|
592
|
+
if (nameResolver === undefined)
|
|
593
|
+
return request.defaultName;
|
|
594
|
+
const name = nameResolver(request);
|
|
595
|
+
if (name === undefined)
|
|
596
|
+
return request.defaultName;
|
|
597
|
+
if (name.length > 0)
|
|
598
|
+
return name;
|
|
599
|
+
reportDiagnostic(program, {
|
|
600
|
+
code: "arm-resource-invalid-metadata-name",
|
|
601
|
+
format: { kind: request.kind, name: request.defaultName },
|
|
602
|
+
target: request.type ?? NoTarget,
|
|
603
|
+
});
|
|
604
|
+
return request.defaultName;
|
|
605
|
+
}
|
|
606
|
+
function formatResourceType(resourceType) {
|
|
607
|
+
return `${resourceType.provider}/${resourceType.types.join("/")}`;
|
|
608
|
+
}
|
|
273
609
|
function getResourceParent(knownResources, child, resourcesToProcess) {
|
|
274
610
|
if (child.resourceType.types.length < 2)
|
|
275
611
|
return undefined;
|
|
@@ -280,6 +616,7 @@ function getResourceParent(knownResources, child, resourcesToProcess) {
|
|
|
280
616
|
return resource;
|
|
281
617
|
}
|
|
282
618
|
}
|
|
619
|
+
const resourceName = getParentName(child.resourceType.types[child.resourceType.types.length - 2]);
|
|
283
620
|
const parent = {
|
|
284
621
|
type: child.type,
|
|
285
622
|
kind: "Other",
|
|
@@ -288,7 +625,9 @@ function getResourceParent(knownResources, child, resourcesToProcess) {
|
|
|
288
625
|
provider: child.resourceType.provider,
|
|
289
626
|
types: child.resourceType.types.slice(0, -1),
|
|
290
627
|
},
|
|
291
|
-
resourceName
|
|
628
|
+
resourceName,
|
|
629
|
+
resourceNameExpression: { kind: "literal", value: resourceName },
|
|
630
|
+
resourceNameIsExplicit: false,
|
|
292
631
|
resourceInstancePath: `/${child.resourceInstancePath
|
|
293
632
|
.split("/")
|
|
294
633
|
.filter((s) => s.length > 0)
|
|
@@ -296,6 +635,7 @@ function getResourceParent(knownResources, child, resourcesToProcess) {
|
|
|
296
635
|
.join("/")}`,
|
|
297
636
|
operations: { lifecycle: {}, actions: [], lists: [] },
|
|
298
637
|
};
|
|
638
|
+
syntheticResources.add(parent);
|
|
299
639
|
knownResources.push(parent);
|
|
300
640
|
resourcesToProcess.push(parent);
|
|
301
641
|
return parent;
|
|
@@ -366,6 +706,7 @@ function getResourceScope(knownResources, resource, resourcesToProcess) {
|
|
|
366
706
|
return "ExternalResource";
|
|
367
707
|
}
|
|
368
708
|
}
|
|
709
|
+
const resourceName = getParentName(types[types.length - 1]);
|
|
369
710
|
const parent = {
|
|
370
711
|
type: resource.type,
|
|
371
712
|
kind: "Other",
|
|
@@ -374,10 +715,13 @@ function getResourceScope(knownResources, resource, resourcesToProcess) {
|
|
|
374
715
|
provider: provider,
|
|
375
716
|
types: types,
|
|
376
717
|
},
|
|
377
|
-
resourceName
|
|
718
|
+
resourceName,
|
|
719
|
+
resourceNameExpression: { kind: "literal", value: resourceName },
|
|
720
|
+
resourceNameIsExplicit: false,
|
|
378
721
|
resourceInstancePath: `/${segments.join("/")}`,
|
|
379
722
|
operations: { lifecycle: {}, actions: [], lists: [] },
|
|
380
723
|
};
|
|
724
|
+
syntheticResources.add(parent);
|
|
381
725
|
for (const knownResource of knownResources) {
|
|
382
726
|
if (parent.resourceType.provider.toLowerCase() ===
|
|
383
727
|
knownResource.resourceType.provider.toLowerCase() &&
|
|
@@ -424,10 +768,6 @@ function normalizePathForResourceIdentity(path) {
|
|
|
424
768
|
.map((s) => (isVariableSegment(s) ? "{}" : s.toLowerCase()))
|
|
425
769
|
.join("/");
|
|
426
770
|
}
|
|
427
|
-
function trimScopePrefix(path) {
|
|
428
|
-
const scopePrefix = getScopePrefix(path);
|
|
429
|
-
return scopePrefix === "" ? path : path.slice(scopePrefix.length);
|
|
430
|
-
}
|
|
431
771
|
function isResourceIdentityOperation(kind) {
|
|
432
772
|
return kind === "read" || kind === "createOrUpdate";
|
|
433
773
|
}
|
|
@@ -532,75 +872,19 @@ function parseKnownProviderlessResourcePath(path, segments) {
|
|
|
532
872
|
}
|
|
533
873
|
return undefined;
|
|
534
874
|
}
|
|
535
|
-
function
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
return resourcePath.startsWith(`${operationPath}/`);
|
|
539
|
-
}
|
|
540
|
-
function isListOperationResourceTypeMatch(operation, resource) {
|
|
541
|
-
const operationPath = normalizePathForResourceIdentity(operation.httpOperation.path);
|
|
542
|
-
const resourcePath = normalizePathForResourceIdentity(resource.resourceInstancePath);
|
|
543
|
-
return isSameResourceTypePath(operationPath, resourcePath);
|
|
544
|
-
}
|
|
545
|
-
function getListMatchDistance(operation, resource) {
|
|
546
|
-
const operationPath = trimScopePrefix(normalizePathForResourceIdentity(operation.httpOperation.path));
|
|
547
|
-
const resourcePath = trimScopePrefix(normalizePathForResourceIdentity(resource.resourceInstancePath));
|
|
548
|
-
return resourcePath.length - operationPath.length;
|
|
549
|
-
}
|
|
550
|
-
function isSameResourceTypePath(leftPath, rightPath) {
|
|
551
|
-
const left = parseArmResourceCollectionPath(leftPath);
|
|
552
|
-
const right = parseArmResourceInstancePath(rightPath)?.resourceType;
|
|
553
|
-
if (left === undefined || right === undefined)
|
|
554
|
-
return false;
|
|
555
|
-
return (left.provider.toLowerCase() === right.provider.toLowerCase() &&
|
|
556
|
-
left.types.map((x) => x.toLowerCase()).join("/") ===
|
|
557
|
-
right.types.map((x) => x.toLowerCase()).join("/"));
|
|
558
|
-
}
|
|
559
|
-
function parseArmResourceCollectionPath(path) {
|
|
560
|
-
const segments = path.split("/").filter((s) => s.length > 0);
|
|
561
|
-
const providerIndex = segments.findLastIndex((s) => s.toLowerCase() === "providers");
|
|
562
|
-
if (providerIndex === -1 || providerIndex === segments.length - 1)
|
|
563
|
-
return undefined;
|
|
564
|
-
const provider = segments[providerIndex + 1];
|
|
565
|
-
if (isVariableSegment(provider))
|
|
566
|
-
return undefined;
|
|
567
|
-
const resourceSegments = segments.slice(providerIndex + 2);
|
|
568
|
-
if (resourceSegments.length === 0)
|
|
569
|
-
return undefined;
|
|
570
|
-
const types = [];
|
|
571
|
-
for (let i = 0; i < resourceSegments.length; i += 2) {
|
|
572
|
-
const typeSegment = resourceSegments[i];
|
|
573
|
-
if (typeSegment === undefined || isVariableSegment(typeSegment))
|
|
574
|
-
return undefined;
|
|
575
|
-
types.push(typeSegment);
|
|
576
|
-
}
|
|
577
|
-
return { provider, types };
|
|
578
|
-
}
|
|
579
|
-
function getBestListOperationTarget(operation, resources) {
|
|
580
|
-
let best;
|
|
581
|
-
let bestDistance = Number.POSITIVE_INFINITY;
|
|
582
|
-
for (const resource of resources) {
|
|
583
|
-
if (!isListOperationPrefixMatch(operation, resource))
|
|
584
|
-
continue;
|
|
585
|
-
const distance = getListMatchDistance(operation, resource);
|
|
586
|
-
if (distance < bestDistance) {
|
|
587
|
-
best = resource;
|
|
588
|
-
bestDistance = distance;
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
if (best !== undefined)
|
|
592
|
-
return best;
|
|
593
|
-
// TODO: https://github.com/Azure/typespec-azure/issues/5080
|
|
594
|
-
// Define the complete rule for associating list operations with detected resources.
|
|
595
|
-
// Some ARM resources expose list operations at scopes different from the resource identity,
|
|
596
|
-
// e.g. a resource-group-scoped resource can have subscription- or tenant-level list operations.
|
|
597
|
-
// Direct prefix matching handles list-by-parent paths; concrete provider/type equality handles
|
|
598
|
-
// cross-scope list paths without letting list operations create resource identities.
|
|
599
|
-
for (const resource of resources) {
|
|
600
|
-
if (isListOperationResourceTypeMatch(operation, resource))
|
|
601
|
-
return resource;
|
|
875
|
+
function isListOperationMatch(candidate, resource, isTracked) {
|
|
876
|
+
if (candidate.resourceNameIsExplicit) {
|
|
877
|
+
return (candidate.armOperation.resourceName?.toLowerCase() === resource.resourceName.toLowerCase());
|
|
602
878
|
}
|
|
603
|
-
|
|
879
|
+
const operationPath = normalizePathForResourceIdentity(candidate.armOperation.path);
|
|
880
|
+
const resourcePath = normalizePathForResourceIdentity(resource.resourceInstancePath);
|
|
881
|
+
const collectionPath = resourcePath.slice(0, resourcePath.lastIndexOf("/"));
|
|
882
|
+
if (operationPath === collectionPath)
|
|
883
|
+
return true;
|
|
884
|
+
const resourceGroupScope = "/subscriptions/{}/resourcegroups/{}";
|
|
885
|
+
return (isTracked &&
|
|
886
|
+
getScopePrefix(resourcePath) === resourceGroupScope &&
|
|
887
|
+
operationPath === collectionPath.replace(resourceGroupScope, "/subscriptions/{}"));
|
|
604
888
|
}
|
|
605
889
|
function isActionOperationMatch(operation, resource) {
|
|
606
890
|
const operationPath = normalizePathForResourceIdentity(operation.httpOperation.path);
|
|
@@ -706,7 +990,13 @@ function isResourceIdentityMatch(source, target) {
|
|
|
706
990
|
normalizePathForResourceIdentity(target.resourceInstancePath));
|
|
707
991
|
}
|
|
708
992
|
export function getUnassociatedOperations(program) {
|
|
709
|
-
|
|
993
|
+
const providerNamespace = resolveProviderNamespace(program);
|
|
994
|
+
if (providerNamespace === undefined)
|
|
995
|
+
return [];
|
|
996
|
+
return getUnassociatedOperationsForContainer(program, providerNamespace);
|
|
997
|
+
}
|
|
998
|
+
function getUnassociatedOperationsForContainer(program, container) {
|
|
999
|
+
return getAllOperations(program, container)
|
|
710
1000
|
.map((op) => getResourceOperation(program, op))
|
|
711
1001
|
.filter((op) => op !== undefined);
|
|
712
1002
|
}
|
|
@@ -740,10 +1030,6 @@ function isArmResourceOperation(program, operation) {
|
|
|
740
1030
|
return getArmResourceOperationData(program, operation) !== undefined;
|
|
741
1031
|
}
|
|
742
1032
|
function getAllOperations(program, container) {
|
|
743
|
-
container = container || resolveProviderNamespace(program);
|
|
744
|
-
if (!container) {
|
|
745
|
-
return [];
|
|
746
|
-
}
|
|
747
1033
|
const operations = [];
|
|
748
1034
|
for (const op of container.operations.values()) {
|
|
749
1035
|
if (op.kind === "Operation" &&
|
|
@@ -770,11 +1056,16 @@ function addUniqueOperation(operation, operations) {
|
|
|
770
1056
|
}
|
|
771
1057
|
}
|
|
772
1058
|
export function resolveArmResourceOperations(program, resourceType) {
|
|
1059
|
+
return resolveResourceOperationsWithLists(program, resourceType).resources;
|
|
1060
|
+
}
|
|
1061
|
+
function resolveResourceOperationsWithLists(program, resourceType) {
|
|
773
1062
|
const resolvedOperations = new Set();
|
|
1063
|
+
const unmatchedLists = [];
|
|
1064
|
+
const isTracked = getArmResource(program, resourceType)?.kind === "Tracked";
|
|
774
1065
|
const candidates = [...getArmResourceOperationList(program, resourceType)]
|
|
775
1066
|
.map((operation) => resolveArmResourceOperationCandidate(program, resourceType, operation))
|
|
776
1067
|
.filter((operation) => operation !== undefined);
|
|
777
|
-
for (const { armOperation, resourceInfo, resourceNameIsExplicit } of candidates) {
|
|
1068
|
+
for (const { armOperation, resourceInfo, resourceNameExpression, resourceNameIsExplicit, } of candidates) {
|
|
778
1069
|
if (!isResourceIdentityOperation(armOperation.kind))
|
|
779
1070
|
continue;
|
|
780
1071
|
if (resourceInfo === undefined)
|
|
@@ -783,13 +1074,17 @@ export function resolveArmResourceOperations(program, resourceType) {
|
|
|
783
1074
|
for (const resolvedOp of resolvedOperations) {
|
|
784
1075
|
if (isResourceIdentityMatch(resourceInfo, resolvedOp)) {
|
|
785
1076
|
matched = true;
|
|
1077
|
+
resolvedOp.resourceNameIsExplicit ||= resourceNameIsExplicit;
|
|
1078
|
+
if (resourceNameIsExplicit) {
|
|
1079
|
+
resolvedOp.resourceNameExpression = resourceNameExpression;
|
|
1080
|
+
}
|
|
786
1081
|
tryAddLifecycleOperation(resourceInfo.resourceType, armOperation, resolvedOp);
|
|
787
1082
|
continue;
|
|
788
1083
|
}
|
|
789
1084
|
}
|
|
790
1085
|
if (matched)
|
|
791
1086
|
continue;
|
|
792
|
-
const newResource = createResolvedResourceOperations(resourceInfo, resourceNameIsExplicit);
|
|
1087
|
+
const newResource = createResolvedResourceOperations(resourceInfo, resourceNameExpression, resourceNameIsExplicit);
|
|
793
1088
|
tryAddLifecycleOperation(resourceInfo.resourceType, armOperation, newResource);
|
|
794
1089
|
resolvedOperations.add(newResource);
|
|
795
1090
|
}
|
|
@@ -797,18 +1092,23 @@ export function resolveArmResourceOperations(program, resourceType) {
|
|
|
797
1092
|
if (isResourceIdentityOperation(candidate.armOperation.kind))
|
|
798
1093
|
continue;
|
|
799
1094
|
if (candidate.armOperation.kind === "list") {
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
1095
|
+
let matched = false;
|
|
1096
|
+
for (const target of resolvedOperations) {
|
|
1097
|
+
if (isListOperationMatch(candidate, target, isTracked)) {
|
|
1098
|
+
tryAddLifecycleOperation(target.resourceType, candidate.armOperation, target);
|
|
1099
|
+
matched = true;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
if (!matched) {
|
|
1103
|
+
unmatchedLists.push(candidate.armOperation);
|
|
803
1104
|
}
|
|
804
|
-
// TODO: Define how non-prefix list paths should map to detected resource identities.
|
|
805
1105
|
continue;
|
|
806
1106
|
}
|
|
807
1107
|
for (const resolvedOp of resolvedOperations) {
|
|
808
1108
|
tryAddOperationToResolvedResource(candidate, resolvedOp);
|
|
809
1109
|
}
|
|
810
1110
|
}
|
|
811
|
-
|
|
1111
|
+
const resources = [...resolvedOperations.values()].toSorted((a, b) => {
|
|
812
1112
|
// Sort by provider, type, then instance path
|
|
813
1113
|
if (a.resourceType.types.length < b.resourceType.types.length)
|
|
814
1114
|
return -1;
|
|
@@ -826,6 +1126,7 @@ export function resolveArmResourceOperations(program, resourceType) {
|
|
|
826
1126
|
return 1;
|
|
827
1127
|
return 0;
|
|
828
1128
|
});
|
|
1129
|
+
return { resources, unmatchedLists };
|
|
829
1130
|
}
|
|
830
1131
|
function resolveArmResourceOperationCandidate(program, resourceType, operation) {
|
|
831
1132
|
const armOperation = getResourceOperation(program, operation.operation);
|
|
@@ -838,25 +1139,30 @@ function resolveArmResourceOperationCandidate(program, resourceType, operation)
|
|
|
838
1139
|
return undefined;
|
|
839
1140
|
armOperation.name = operation.name;
|
|
840
1141
|
armOperation.resourceKind = operation.resourceKind;
|
|
841
|
-
const
|
|
1142
|
+
const resourceNameExpression = getResourceNameExpression(program, operation.operation) ??
|
|
1143
|
+
(operation.resourceName !== undefined && operation.resourceName.length > 0
|
|
1144
|
+
? { kind: "explicit", value: operation.resourceName }
|
|
1145
|
+
: operation.resourceKind === "legacy-extension"
|
|
1146
|
+
? { kind: "legacy-extension", model: operation.resource ?? resourceType }
|
|
1147
|
+
: operation.resourceKind === "legacy"
|
|
1148
|
+
? { kind: "legacy-resource", model: operation.resource ?? resourceType }
|
|
1149
|
+
: { kind: "model", model: operation.resource ?? resourceType });
|
|
1150
|
+
const resourceNameIsExplicit = resourceNameExpression.kind === "explicit";
|
|
842
1151
|
if (resourceInfo !== undefined) {
|
|
843
|
-
resourceInfo.resourceName =
|
|
844
|
-
operation.resourceName ??
|
|
845
|
-
getResourceNameForOperation(program, armOperation, resourceInfo.resourceInstancePath) ??
|
|
846
|
-
armOperation.resourceModelName;
|
|
847
|
-
resourceInfo.resourceNameIsExplicit = resourceNameIsExplicit;
|
|
1152
|
+
resourceInfo.resourceName = evaluateResourceNameExpression(resourceNameExpression, resourceInfo.resourceInstancePath);
|
|
848
1153
|
armOperation.resourceName = resourceInfo.resourceName;
|
|
849
1154
|
}
|
|
850
1155
|
else {
|
|
851
|
-
armOperation.resourceName =
|
|
1156
|
+
armOperation.resourceName = evaluateResourceNameExpression(resourceNameExpression, armOperation.path);
|
|
852
1157
|
}
|
|
853
|
-
return { armOperation, resourceInfo, resourceNameIsExplicit };
|
|
1158
|
+
return { armOperation, resourceInfo, resourceNameExpression, resourceNameIsExplicit };
|
|
854
1159
|
}
|
|
855
|
-
function createResolvedResourceOperations(resourceInfo, resourceNameIsExplicit) {
|
|
1160
|
+
function createResolvedResourceOperations(resourceInfo, resourceNameExpression, resourceNameIsExplicit) {
|
|
856
1161
|
return {
|
|
857
1162
|
resourceType: resourceInfo.resourceType,
|
|
858
1163
|
resourceInstancePath: resourceInfo.resourceInstancePath,
|
|
859
1164
|
resourceName: resourceInfo.resourceName,
|
|
1165
|
+
resourceNameExpression,
|
|
860
1166
|
resourceNameIsExplicit: resourceNameIsExplicit,
|
|
861
1167
|
operations: {
|
|
862
1168
|
lifecycle: {
|