@azure-tools/typespec-azure-resource-manager 0.57.0 → 0.57.2
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 +45 -12
- package/dist/generated-defs/Azure.ResourceManager.Extension.Private.d.ts +25 -0
- package/dist/generated-defs/Azure.ResourceManager.Extension.Private.d.ts.map +1 -0
- package/dist/generated-defs/Azure.ResourceManager.Extension.Private.js +2 -0
- package/dist/generated-defs/Azure.ResourceManager.Extension.Private.js.map +1 -0
- package/dist/generated-defs/Azure.ResourceManager.Legacy.d.ts +14 -1
- package/dist/generated-defs/Azure.ResourceManager.Legacy.d.ts.map +1 -1
- package/dist/generated-defs/Azure.ResourceManager.Private.d.ts +8 -0
- package/dist/generated-defs/Azure.ResourceManager.Private.d.ts.map +1 -1
- package/dist/generated-defs/Azure.ResourceManager.d.ts +20 -6
- package/dist/generated-defs/Azure.ResourceManager.d.ts.map +1 -1
- package/dist/src/lib.d.ts +17 -2
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +6 -0
- package/dist/src/lib.js.map +1 -1
- package/dist/src/linter.d.ts.map +1 -1
- package/dist/src/linter.js +2 -0
- package/dist/src/linter.js.map +1 -1
- package/dist/src/namespace.d.ts.map +1 -1
- package/dist/src/namespace.js +14 -7
- package/dist/src/namespace.js.map +1 -1
- package/dist/src/operations.d.ts +3 -0
- package/dist/src/operations.d.ts.map +1 -1
- package/dist/src/operations.js +37 -2
- package/dist/src/operations.js.map +1 -1
- package/dist/src/private.decorators.d.ts.map +1 -1
- package/dist/src/private.decorators.js +61 -7
- package/dist/src/private.decorators.js.map +1 -1
- package/dist/src/resource.d.ts +16 -1
- package/dist/src/resource.d.ts.map +1 -1
- package/dist/src/resource.js +68 -14
- package/dist/src/resource.js.map +1 -1
- package/dist/src/rules/arm-custom-resource-no-key.d.ts +4 -0
- package/dist/src/rules/arm-custom-resource-no-key.d.ts.map +1 -0
- package/dist/src/rules/arm-custom-resource-no-key.js +28 -0
- package/dist/src/rules/arm-custom-resource-no-key.js.map +1 -0
- package/dist/src/rules/arm-resource-interfaces.d.ts.map +1 -1
- package/dist/src/rules/arm-resource-interfaces.js +2 -1
- package/dist/src/rules/arm-resource-interfaces.js.map +1 -1
- package/dist/src/rules/list-operation.js +1 -1
- package/dist/src/rules/list-operation.js.map +1 -1
- package/dist/src/state.d.ts +2 -0
- package/dist/src/state.d.ts.map +1 -1
- package/dist/src/state.js +2 -0
- package/dist/src/state.js.map +1 -1
- package/dist/src/tsp-index.d.ts.map +1 -1
- package/dist/src/tsp-index.js +2 -1
- package/dist/src/tsp-index.js.map +1 -1
- package/lib/Legacy/arm.legacy.tsp +4 -0
- package/lib/Legacy/decorator.tsp +18 -0
- package/lib/Legacy/extension.tsp +343 -0
- package/lib/Legacy/interfaces.tsp +38 -0
- package/lib/Legacy/operations.tsp +130 -32
- package/lib/arm.tsp +1 -0
- package/lib/common-types/internal.tsp +9 -0
- package/lib/common-types/types-ref.tsp +12 -3
- package/lib/decorators.tsp +38 -6
- package/lib/extension/extension.tsp +6 -0
- package/lib/extension/operations.tsp +507 -0
- package/lib/extension/parameters.tsp +223 -0
- package/lib/extension/private.decorators.tsp +24 -0
- package/lib/private.decorators.tsp +5 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -42,6 +42,7 @@ Available ruleSets:
|
|
|
42
42
|
| `@azure-tools/typespec-azure-resource-manager/arm-resource-operation-response` | [RPC 008]: PUT, GET, PATCH & LIST must return the same resource schema. |
|
|
43
43
|
| `@azure-tools/typespec-azure-resource-manager/arm-resource-path-segment-invalid-chars` | Arm resource name must contain only alphanumeric characters. |
|
|
44
44
|
| `@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state` | Check for properly configured provisioningState property. |
|
|
45
|
+
| [`@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key`](https://azure.github.io/typespec-azure/docs/libraries/azure-core/rules/arm-custom-resource-no-key) | Validate that custom resource contains a key property. |
|
|
45
46
|
| `@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage` | Verify the usage of @customAzureResource decorator. |
|
|
46
47
|
| `@azure-tools/typespec-azure-resource-manager/beyond-nesting-levels` | Tracked Resources must use 3 or fewer levels of nesting. |
|
|
47
48
|
| `@azure-tools/typespec-azure-resource-manager/arm-resource-operation` | Validate ARM Resource operations. |
|
|
@@ -261,16 +262,25 @@ None
|
|
|
261
262
|
#### `@armResourceOperations`
|
|
262
263
|
|
|
263
264
|
This decorator is used to identify interfaces containing resource operations.
|
|
264
|
-
|
|
265
|
+
By default, it marks the interface with the `@autoRoute` decorator so that
|
|
265
266
|
all of its contained operations will have their routes generated
|
|
266
267
|
automatically.
|
|
267
268
|
|
|
268
|
-
|
|
269
|
+
The decorator also adds a `@tag` decorator bearing the name of the interface so that all
|
|
269
270
|
of the operations will be grouped based on the interface name in generated
|
|
270
271
|
clients.
|
|
271
272
|
|
|
273
|
+
The optional `resourceOperationOptions` parameter provides additional options.
|
|
274
|
+
`allowStaticRoutes` turns off autoRout for the interface, so individual operations can
|
|
275
|
+
choose static (`@route`) or automatic (`@autoRoute`) routing.
|
|
276
|
+
|
|
277
|
+
`resourceType: Model` specifies the resource type for the operations in the interface
|
|
278
|
+
|
|
279
|
+
`omitTags: true`: turns off the default tagging of operations in the interface, so that individual operations must be
|
|
280
|
+
individually tagged
|
|
281
|
+
|
|
272
282
|
```typespec
|
|
273
|
-
@Azure.ResourceManager.armResourceOperations(
|
|
283
|
+
@Azure.ResourceManager.armResourceOperations(resourceOperationOptions?: unknown | valueof Azure.ResourceManager.ResourceOperationOptions)
|
|
274
284
|
```
|
|
275
285
|
|
|
276
286
|
##### Target
|
|
@@ -279,9 +289,9 @@ clients.
|
|
|
279
289
|
|
|
280
290
|
##### Parameters
|
|
281
291
|
|
|
282
|
-
| Name
|
|
283
|
-
|
|
|
284
|
-
|
|
|
292
|
+
| Name | Type | Description |
|
|
293
|
+
| ------------------------ | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
|
294
|
+
| resourceOperationOptions | `unknown` \| [valueof `ResourceOperationOptions`](#resourceoperationoptions) | Options for routing the operations in the interface and associating them with a specific resource |
|
|
285
295
|
|
|
286
296
|
#### `@armResourceRead`
|
|
287
297
|
|
|
@@ -321,7 +331,7 @@ This decorator is used on Azure Resource Manager resources that are not based on
|
|
|
321
331
|
Azure.ResourceManager common types.
|
|
322
332
|
|
|
323
333
|
```typespec
|
|
324
|
-
@Azure.ResourceManager.armVirtualResource
|
|
334
|
+
@Azure.ResourceManager.armVirtualResource(provider?: valueof string)
|
|
325
335
|
```
|
|
326
336
|
|
|
327
337
|
##### Target
|
|
@@ -330,7 +340,9 @@ Azure.ResourceManager common types.
|
|
|
330
340
|
|
|
331
341
|
##### Parameters
|
|
332
342
|
|
|
333
|
-
|
|
343
|
+
| Name | Type | Description |
|
|
344
|
+
| -------- | ---------------- | ----------- |
|
|
345
|
+
| provider | `valueof string` | |
|
|
334
346
|
|
|
335
347
|
#### `@extensionResource`
|
|
336
348
|
|
|
@@ -408,7 +420,7 @@ None
|
|
|
408
420
|
This decorator sets the base type of the given resource.
|
|
409
421
|
|
|
410
422
|
```typespec
|
|
411
|
-
@Azure.ResourceManager.resourceBaseType(
|
|
423
|
+
@Azure.ResourceManager.resourceBaseType(baseTypeIt: "Tenant" | "Subscription" | "ResourceGroup" | "Location" | "Extension")
|
|
412
424
|
```
|
|
413
425
|
|
|
414
426
|
##### Target
|
|
@@ -417,9 +429,9 @@ This decorator sets the base type of the given resource.
|
|
|
417
429
|
|
|
418
430
|
##### Parameters
|
|
419
431
|
|
|
420
|
-
| Name
|
|
421
|
-
|
|
|
422
|
-
|
|
|
432
|
+
| Name | Type | Description |
|
|
433
|
+
| ---------- | ---------------------------------------------------------------------------- | ----------- |
|
|
434
|
+
| baseTypeIt | `"Tenant" \| "Subscription" \| "ResourceGroup" \| "Location" \| "Extension"` | |
|
|
423
435
|
|
|
424
436
|
#### `@resourceGroupResource`
|
|
425
437
|
|
|
@@ -529,9 +541,30 @@ This allows sharing Azure Resource Manager resource types across specifications
|
|
|
529
541
|
|
|
530
542
|
### Azure.ResourceManager.Legacy
|
|
531
543
|
|
|
544
|
+
- [`@armOperationRoute`](#@armoperationroute)
|
|
532
545
|
- [`@customAzureResource`](#@customazureresource)
|
|
533
546
|
- [`@externalTypeRef`](#@externaltyperef)
|
|
534
547
|
|
|
548
|
+
#### `@armOperationRoute`
|
|
549
|
+
|
|
550
|
+
Signifies that an operation is an Azure Resource Manager operation
|
|
551
|
+
and optionally associates the operation with a route template.
|
|
552
|
+
|
|
553
|
+
```typespec
|
|
554
|
+
@Azure.ResourceManager.Legacy.armOperationRoute(route?: valueof Azure.ResourceManager.Legacy.ArmOperationOptions)
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
##### Target
|
|
558
|
+
|
|
559
|
+
The operation to associate the model with
|
|
560
|
+
`Operation`
|
|
561
|
+
|
|
562
|
+
##### Parameters
|
|
563
|
+
|
|
564
|
+
| Name | Type | Description |
|
|
565
|
+
| ----- | ----------------------------------------------------- | ---------------------------------------------- |
|
|
566
|
+
| route | [valueof `ArmOperationOptions`](#armoperationoptions) | Optional route to associate with the operation |
|
|
567
|
+
|
|
535
568
|
#### `@customAzureResource`
|
|
536
569
|
|
|
537
570
|
This decorator is used on resources that do not satisfy the definition of a resource
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { DecoratorContext, Model } from "@typespec/compiler";
|
|
2
|
+
/**
|
|
3
|
+
* `@builtInResource` marks a model as built-in to Azure ResourceManager at the tenant level
|
|
4
|
+
*
|
|
5
|
+
* @param target The model that is marked as built-in.
|
|
6
|
+
*/
|
|
7
|
+
export type BuiltInResourceDecorator = (context: DecoratorContext, target: Model) => void;
|
|
8
|
+
/**
|
|
9
|
+
* `@builtInSubscriptionResource` marks a model as built-in to Azure ResourceManager at the Subscription level
|
|
10
|
+
*
|
|
11
|
+
* @param target The model that is marked as built-in.
|
|
12
|
+
*/
|
|
13
|
+
export type BuiltInSubscriptionResourceDecorator = (context: DecoratorContext, target: Model) => void;
|
|
14
|
+
/**
|
|
15
|
+
* `@builtInResourceGroupResource` marks a model as built-in to Azure ResourceManager at the ResourceGroup level
|
|
16
|
+
*
|
|
17
|
+
* @param target The model that is marked as built-in.
|
|
18
|
+
*/
|
|
19
|
+
export type BuiltInResourceGroupResourceDecorator = (context: DecoratorContext, target: Model) => void;
|
|
20
|
+
export type AzureResourceManagerExtensionPrivateDecorators = {
|
|
21
|
+
builtInResource: BuiltInResourceDecorator;
|
|
22
|
+
builtInSubscriptionResource: BuiltInSubscriptionResourceDecorator;
|
|
23
|
+
builtInResourceGroupResource: BuiltInResourceGroupResourceDecorator;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=Azure.ResourceManager.Extension.Private.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Azure.ResourceManager.Extension.Private.d.ts","sourceRoot":"","sources":["../../generated-defs/Azure.ResourceManager.Extension.Private.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAElE;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,KAAK,IAAI,CAAC;AAE1F;;;;GAIG;AACH,MAAM,MAAM,oCAAoC,GAAG,CACjD,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,KAAK,KACV,IAAI,CAAC;AAEV;;;;GAIG;AACH,MAAM,MAAM,qCAAqC,GAAG,CAClD,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,KAAK,KACV,IAAI,CAAC;AAEV,MAAM,MAAM,8CAA8C,GAAG;IAC3D,eAAe,EAAE,wBAAwB,CAAC;IAC1C,2BAA2B,EAAE,oCAAoC,CAAC;IAClE,4BAA4B,EAAE,qCAAqC,CAAC;CACrE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Azure.ResourceManager.Extension.Private.js","sourceRoot":"","sources":["../../generated-defs/Azure.ResourceManager.Extension.Private.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type { DecoratorContext, Model, ModelProperty } from "@typespec/compiler";
|
|
1
|
+
import type { DecoratorContext, Model, ModelProperty, Operation } from "@typespec/compiler";
|
|
2
|
+
export interface ArmOperationOptions {
|
|
3
|
+
readonly useStaticRoute?: boolean;
|
|
4
|
+
readonly route?: string;
|
|
5
|
+
}
|
|
2
6
|
/**
|
|
3
7
|
* This decorator is used on resources that do not satisfy the definition of a resource
|
|
4
8
|
* but need to be identified as such.
|
|
@@ -10,8 +14,17 @@ export type CustomAzureResourceDecorator = (context: DecoratorContext, target: M
|
|
|
10
14
|
* @param jsonRef External reference(e.g. "../../common.json#/definitions/Foo")
|
|
11
15
|
*/
|
|
12
16
|
export type ExternalTypeRefDecorator = (context: DecoratorContext, entity: Model | ModelProperty, jsonRef: string) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Signifies that an operation is an Azure Resource Manager operation
|
|
19
|
+
* and optionally associates the operation with a route template.
|
|
20
|
+
*
|
|
21
|
+
* @param target The operation to associate the model with
|
|
22
|
+
* @param route Optional route to associate with the operation
|
|
23
|
+
*/
|
|
24
|
+
export type ArmOperationRouteDecorator = (context: DecoratorContext, target: Operation, route?: ArmOperationOptions) => void;
|
|
13
25
|
export type AzureResourceManagerLegacyDecorators = {
|
|
14
26
|
customAzureResource: CustomAzureResourceDecorator;
|
|
15
27
|
externalTypeRef: ExternalTypeRefDecorator;
|
|
28
|
+
armOperationRoute: ArmOperationRouteDecorator;
|
|
16
29
|
};
|
|
17
30
|
//# sourceMappingURL=Azure.ResourceManager.Legacy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Azure.ResourceManager.Legacy.d.ts","sourceRoot":"","sources":["../../generated-defs/Azure.ResourceManager.Legacy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"Azure.ResourceManager.Legacy.d.ts","sourceRoot":"","sources":["../../generated-defs/Azure.ResourceManager.Legacy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE5F,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,KAAK,IAAI,CAAC;AAE9F;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACrC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,KAAK,GAAG,aAAa,EAC7B,OAAO,EAAE,MAAM,KACZ,IAAI,CAAC;AAEV;;;;;;GAMG;AACH,MAAM,MAAM,0BAA0B,GAAG,CACvC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,KAAK,CAAC,EAAE,mBAAmB,KACxB,IAAI,CAAC;AAEV,MAAM,MAAM,oCAAoC,GAAG;IACjD,mBAAmB,EAAE,4BAA4B,CAAC;IAClD,eAAe,EAAE,wBAAwB,CAAC;IAC1C,iBAAiB,EAAE,0BAA0B,CAAC;CAC/C,CAAC"}
|
|
@@ -40,6 +40,13 @@ export type AzureResourceBaseDecorator = (context: DecoratorContext, target: Mod
|
|
|
40
40
|
* Update the Azure Resource Manager provider namespace for a given entity.
|
|
41
41
|
*/
|
|
42
42
|
export type ArmUpdateProviderNamespaceDecorator = (context: DecoratorContext, target: Operation) => void;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
*
|
|
46
|
+
*
|
|
47
|
+
* @param resource Resource model
|
|
48
|
+
*/
|
|
49
|
+
export type AssignUniqueProviderNameValueDecorator = (context: DecoratorContext, target: ModelProperty, resource: Model) => void;
|
|
43
50
|
/**
|
|
44
51
|
* This decorator is used to identify Azure Resource Manager resource types and extract their
|
|
45
52
|
* metadata. It is *not* meant to be used directly by a spec author, it instead
|
|
@@ -95,6 +102,7 @@ export type AzureResourceManagerPrivateDecorators = {
|
|
|
95
102
|
assignProviderNameValue: AssignProviderNameValueDecorator;
|
|
96
103
|
azureResourceBase: AzureResourceBaseDecorator;
|
|
97
104
|
armUpdateProviderNamespace: ArmUpdateProviderNamespaceDecorator;
|
|
105
|
+
assignUniqueProviderNameValue: AssignUniqueProviderNameValueDecorator;
|
|
98
106
|
armResourceInternal: ArmResourceInternalDecorator;
|
|
99
107
|
defaultResourceKeySegmentName: DefaultResourceKeySegmentNameDecorator;
|
|
100
108
|
enforceConstraint: EnforceConstraintDecorator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Azure.ResourceManager.Private.d.ts","sourceRoot":"","sources":["../../generated-defs/Azure.ResourceManager.Private.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAElG;;;;;GAKG;AACH,MAAM,MAAM,iCAAiC,GAAG,CAC9C,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,IAAI,KACT,IAAI,CAAC;AAEV;;;;;GAKG;AACH,MAAM,MAAM,iCAAiC,GAAG,CAC9C,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,KAAK,EACb,YAAY,EAAE,KAAK,KAChB,IAAI,CAAC;AAEV;;;;;;;GAOG;AACH,MAAM,MAAM,iCAAiC,GAAG,CAC9C,OAAO,EAAE,gBAAgB,EACzB,MAA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,EACzB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,OAAO,KAChB,IAAI,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CACjC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,OAAO,KAChB,IAAI,CAAC;AAEV,MAAM,MAAM,qCAAqC,GAAG;IAClD,wBAAwB,EAAE,iCAAiC,CAAC;IAC5D,wBAAwB,EAAE,iCAAiC,CAAC;IAC5D,wBAAwB,EAAE,iCAAiC,CAAC;IAC5D,WAAW,EAAE,oBAAoB,CAAC;IAClC,uBAAuB,EAAE,gCAAgC,CAAC;IAC1D,iBAAiB,EAAE,0BAA0B,CAAC;IAC9C,0BAA0B,EAAE,mCAAmC,CAAC;IAChE,mBAAmB,EAAE,4BAA4B,CAAC;IAClD,6BAA6B,EAAE,sCAAsC,CAAC;IACtE,iBAAiB,EAAE,0BAA0B,CAAC;IAC9C,wBAAwB,EAAE,iCAAiC,CAAC;IAC5D,gCAAgC,EAAE,yCAAyC,CAAC;IAC5E,WAAW,EAAE,oBAAoB,CAAC;CACnC,CAAC"}
|
|
1
|
+
{"version":3,"file":"Azure.ResourceManager.Private.d.ts","sourceRoot":"","sources":["../../generated-defs/Azure.ResourceManager.Private.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAElG;;;;;GAKG;AACH,MAAM,MAAM,iCAAiC,GAAG,CAC9C,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,IAAI,KACT,IAAI,CAAC;AAEV;;;;;GAKG;AACH,MAAM,MAAM,iCAAiC,GAAG,CAC9C,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,KAAK,EACb,YAAY,EAAE,KAAK,KAChB,IAAI,CAAC;AAEV;;;;;;;GAOG;AACH,MA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AAY,EAAE,KAAK,EACnB,cAAc,CAAC,EAAE,MAAM,EACvB,sBAAsB,CAAC,EAAE,MAAM,EAC/B,oBAAoB,CAAC,EAAE,OAAO,KAC3B,IAAI,CAAC;AAEV;;;GAGG;AACH,MAAM,MAAM,yCAAyC,GAAG,CACtD,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,OAAO,KAChB,IAAI,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CACjC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,OAAO,KAChB,IAAI,CAAC;AAEV,MAAM,MAAM,qCAAqC,GAAG;IAClD,wBAAwB,EAAE,iCAAiC,CAAC;IAC5D,wBAAwB,EAAE,iCAAiC,CAAC;IAC5D,wBAAwB,EAAE,iCAAiC,CAAC;IAC5D,WAAW,EAAE,oBAAoB,CAAC;IAClC,uBAAuB,EAAE,gCAAgC,CAAC;IAC1D,iBAAiB,EAAE,0BAA0B,CAAC;IAC9C,0BAA0B,EAAE,mCAAmC,CAAC;IAChE,6BAA6B,EAAE,sCAAsC,CAAC;IACtE,mBAAmB,EAAE,4BAA4B,CAAC;IAClD,6BAA6B,EAAE,sCAAsC,CAAC;IACtE,iBAAiB,EAAE,0BAA0B,CAAC;IAC9C,wBAAwB,EAAE,iCAAiC,CAAC;IAC5D,gCAAgC,EAAE,yCAAyC,CAAC;IAC5E,WAAW,EAAE,oBAAoB,CAAC;CACnC,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { DecoratorContext, EnumMember, EnumValue, Interface, Model, ModelProperty, Namespace, Operation, Type } from "@typespec/compiler";
|
|
2
|
+
export interface ResourceOperationOptions {
|
|
3
|
+
readonly resourceType?: Record<string, unknown>;
|
|
4
|
+
readonly allowStaticRoutes?: boolean;
|
|
5
|
+
readonly omitTags?: boolean;
|
|
6
|
+
}
|
|
2
7
|
/**
|
|
3
8
|
* Marks the operation as being a collection action
|
|
4
9
|
*/
|
|
@@ -147,17 +152,26 @@ export type ArmResourceDeleteDecorator = (context: DecoratorContext, target: Ope
|
|
|
147
152
|
export type ArmResourceListDecorator = (context: DecoratorContext, target: Operation, resourceType: Model) => void;
|
|
148
153
|
/**
|
|
149
154
|
* This decorator is used to identify interfaces containing resource operations.
|
|
150
|
-
*
|
|
155
|
+
* By default, it marks the interface with the `@autoRoute` decorator so that
|
|
151
156
|
* all of its contained operations will have their routes generated
|
|
152
157
|
* automatically.
|
|
153
158
|
*
|
|
154
|
-
*
|
|
159
|
+
* The decorator also adds a `@tag` decorator bearing the name of the interface so that all
|
|
155
160
|
* of the operations will be grouped based on the interface name in generated
|
|
156
161
|
* clients.
|
|
157
162
|
*
|
|
158
|
-
*
|
|
163
|
+
* The optional `resourceOperationOptions` parameter provides additional options.
|
|
164
|
+
* `allowStaticRoutes` turns off autoRout for the interface, so individual operations can
|
|
165
|
+
* choose static (`@route`) or automatic (`@autoRoute`) routing.
|
|
166
|
+
*
|
|
167
|
+
* `resourceType: Model` specifies the resource type for the operations in the interface
|
|
168
|
+
*
|
|
169
|
+
* `omitTags: true`: turns off the default tagging of operations in the interface, so that individual operations must be
|
|
170
|
+
* individually tagged
|
|
171
|
+
*
|
|
172
|
+
* @param resourceOperationOptions Options for routing the operations in the interface and associating them with a specific resource
|
|
159
173
|
*/
|
|
160
|
-
export type ArmResourceOperationsDecorator = (context: DecoratorContext, target: Interface,
|
|
174
|
+
export type ArmResourceOperationsDecorator = (context: DecoratorContext, target: Interface, resourceOperationOptions?: Type | ResourceOperationOptions) => void;
|
|
161
175
|
/**
|
|
162
176
|
* This decorator is used either on a namespace or a version enum value to indicate
|
|
163
177
|
* the version of the Azure Resource Manager common-types to use for refs in emitted Swagger files.
|
|
@@ -171,13 +185,13 @@ export type ArmCommonTypesVersionDecorator = (context: DecoratorContext, target:
|
|
|
171
185
|
*
|
|
172
186
|
* @param propertiesType : The type of the resource properties.
|
|
173
187
|
*/
|
|
174
|
-
export type ArmVirtualResourceDecorator = (context: DecoratorContext, target: Model) => void;
|
|
188
|
+
export type ArmVirtualResourceDecorator = (context: DecoratorContext, target: Model, provider?: string) => void;
|
|
175
189
|
/**
|
|
176
190
|
* This decorator sets the base type of the given resource.
|
|
177
191
|
*
|
|
178
192
|
* @param baseType The built-in parent of the resource, this can be "Tenant", "Subscription", "ResourceGroup", "Location", or "Extension"
|
|
179
193
|
*/
|
|
180
|
-
export type ResourceBaseTypeDecorator = (context: DecoratorContext, target: Model,
|
|
194
|
+
export type ResourceBaseTypeDecorator = (context: DecoratorContext, target: Model, baseTypeIt: Type) => void;
|
|
181
195
|
/**
|
|
182
196
|
* This decorator is used to indicate the identifying properties of objects in the array, e.g. size
|
|
183
197
|
* The properties that are used as identifiers for the object needs to be provided as a list of strings.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Azure.ResourceManager.d.ts","sourceRoot":"","sources":["../../generated-defs/Azure.ResourceManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,SAAS,EACT,KAAK,EACL,aAAa,EACb,SAAS,EACT,SAAS,EACT,IAAI,EACL,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,oCAAoC,GAAG,CACjD,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,KACd,IAAI,CAAC;AAEV;;;;;GAKG;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;AAEnG;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,6BAA6B,GAAG,CAC1C,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,iBAAiB,CAAC,EAAE,MAAM,KACvB,IAAI,CAAC;AAEV;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG,CACzC,OAAO,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Y,EAAE,KAAK,KAChB,IAAI,CAAC;AAEV;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACrC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,YAAY,EAAE,KAAK,KAChB,IAAI,CAAC;AAEV;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,GAAG,CACvC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,YAAY,EAAE,KAAK,KAChB,IAAI,CAAC;AAEV;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,GAAG,CACvC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,YAAY,EAAE,KAAK,KAChB,IAAI,CAAC;AAEV;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG,CACrC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,YAAY,EAAE,KAAK,KAChB,IAAI,CAAC;AAEV
|
|
1
|
+
{"version":3,"file":"Azure.ResourceManager.d.ts","sourceRoot":"","sources":["../../generated-defs/Azure.ResourceManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,SAAS,EACT,KAAK,EACL,aAAa,EACb,SAAS,EACT,SAAS,EACT,IAAI,EACL,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChD,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,MAAM,oCAAoC,GAAG,CACjD,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,KACd,IAAI,CAAC;AAEV;;;;;GAKG;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,OAAO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BAAoB,CAAC;CACnC,CAAC"}
|
package/dist/src/lib.d.ts
CHANGED
|
@@ -46,11 +46,14 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
|
46
46
|
"resource-without-path-and-segment": {
|
|
47
47
|
readonly default: "Resource types must have a property with '@path` and '@segment' decorators.";
|
|
48
48
|
};
|
|
49
|
+
"resource-without-provider-namespace": {
|
|
50
|
+
readonly default: import("@typespec/compiler").CallableMessage<["resourceName"]>;
|
|
51
|
+
};
|
|
49
52
|
"template-type-constraint-no-met": {
|
|
50
53
|
readonly default: import("@typespec/compiler").CallableMessage<["sourceType", "entity", "constraintType", "actionMessage"]>;
|
|
51
54
|
};
|
|
52
55
|
}, Record<string, any>, never>;
|
|
53
|
-
export declare const reportDiagnostic: <C extends "single-arm-provider" | "decorator-param-wrong-type" | "arm-resource-circular-ancestry" | "arm-resource-duplicate-base-parameter" | "arm-resource-missing-name-property" | "arm-resource-missing-name-key-decorator" | "arm-resource-missing-name-segment-decorator" | "arm-resource-missing-arm-namespace" | "arm-resource-invalid-base-type" | "arm-resource-missing" | "arm-common-types-incompatible-version" | "arm-common-types-invalid-version" | "decorator-in-namespace" | "parent-type" | "resource-without-path-and-segment" | "template-type-constraint-no-met", M extends keyof {
|
|
56
|
+
export declare const reportDiagnostic: <C extends "single-arm-provider" | "decorator-param-wrong-type" | "arm-resource-circular-ancestry" | "arm-resource-duplicate-base-parameter" | "arm-resource-missing-name-property" | "arm-resource-missing-name-key-decorator" | "arm-resource-missing-name-segment-decorator" | "arm-resource-missing-arm-namespace" | "arm-resource-invalid-base-type" | "arm-resource-missing" | "arm-common-types-incompatible-version" | "arm-common-types-invalid-version" | "decorator-in-namespace" | "parent-type" | "resource-without-path-and-segment" | "resource-without-provider-namespace" | "template-type-constraint-no-met", M extends keyof {
|
|
54
57
|
"single-arm-provider": {
|
|
55
58
|
readonly default: "Only one @armProviderNamespace can be declared in a typespec spec at once.";
|
|
56
59
|
};
|
|
@@ -98,6 +101,9 @@ export declare const reportDiagnostic: <C extends "single-arm-provider" | "decor
|
|
|
98
101
|
"resource-without-path-and-segment": {
|
|
99
102
|
readonly default: "Resource types must have a property with '@path` and '@segment' decorators.";
|
|
100
103
|
};
|
|
104
|
+
"resource-without-provider-namespace": {
|
|
105
|
+
readonly default: import("@typespec/compiler").CallableMessage<["resourceName"]>;
|
|
106
|
+
};
|
|
101
107
|
"template-type-constraint-no-met": {
|
|
102
108
|
readonly default: import("@typespec/compiler").CallableMessage<["sourceType", "entity", "constraintType", "actionMessage"]>;
|
|
103
109
|
};
|
|
@@ -149,10 +155,13 @@ export declare const reportDiagnostic: <C extends "single-arm-provider" | "decor
|
|
|
149
155
|
"resource-without-path-and-segment": {
|
|
150
156
|
readonly default: "Resource types must have a property with '@path` and '@segment' decorators.";
|
|
151
157
|
};
|
|
158
|
+
"resource-without-provider-namespace": {
|
|
159
|
+
readonly default: import("@typespec/compiler").CallableMessage<["resourceName"]>;
|
|
160
|
+
};
|
|
152
161
|
"template-type-constraint-no-met": {
|
|
153
162
|
readonly default: import("@typespec/compiler").CallableMessage<["sourceType", "entity", "constraintType", "actionMessage"]>;
|
|
154
163
|
};
|
|
155
|
-
}, C, M>) => void, createDiagnostic: <C extends "single-arm-provider" | "decorator-param-wrong-type" | "arm-resource-circular-ancestry" | "arm-resource-duplicate-base-parameter" | "arm-resource-missing-name-property" | "arm-resource-missing-name-key-decorator" | "arm-resource-missing-name-segment-decorator" | "arm-resource-missing-arm-namespace" | "arm-resource-invalid-base-type" | "arm-resource-missing" | "arm-common-types-incompatible-version" | "arm-common-types-invalid-version" | "decorator-in-namespace" | "parent-type" | "resource-without-path-and-segment" | "template-type-constraint-no-met", M extends keyof {
|
|
164
|
+
}, C, M>) => void, createDiagnostic: <C extends "single-arm-provider" | "decorator-param-wrong-type" | "arm-resource-circular-ancestry" | "arm-resource-duplicate-base-parameter" | "arm-resource-missing-name-property" | "arm-resource-missing-name-key-decorator" | "arm-resource-missing-name-segment-decorator" | "arm-resource-missing-arm-namespace" | "arm-resource-invalid-base-type" | "arm-resource-missing" | "arm-common-types-incompatible-version" | "arm-common-types-invalid-version" | "decorator-in-namespace" | "parent-type" | "resource-without-path-and-segment" | "resource-without-provider-namespace" | "template-type-constraint-no-met", M extends keyof {
|
|
156
165
|
"single-arm-provider": {
|
|
157
166
|
readonly default: "Only one @armProviderNamespace can be declared in a typespec spec at once.";
|
|
158
167
|
};
|
|
@@ -200,6 +209,9 @@ export declare const reportDiagnostic: <C extends "single-arm-provider" | "decor
|
|
|
200
209
|
"resource-without-path-and-segment": {
|
|
201
210
|
readonly default: "Resource types must have a property with '@path` and '@segment' decorators.";
|
|
202
211
|
};
|
|
212
|
+
"resource-without-provider-namespace": {
|
|
213
|
+
readonly default: import("@typespec/compiler").CallableMessage<["resourceName"]>;
|
|
214
|
+
};
|
|
203
215
|
"template-type-constraint-no-met": {
|
|
204
216
|
readonly default: import("@typespec/compiler").CallableMessage<["sourceType", "entity", "constraintType", "actionMessage"]>;
|
|
205
217
|
};
|
|
@@ -251,6 +263,9 @@ export declare const reportDiagnostic: <C extends "single-arm-provider" | "decor
|
|
|
251
263
|
"resource-without-path-and-segment": {
|
|
252
264
|
readonly default: "Resource types must have a property with '@path` and '@segment' decorators.";
|
|
253
265
|
};
|
|
266
|
+
"resource-without-provider-namespace": {
|
|
267
|
+
readonly default: import("@typespec/compiler").CallableMessage<["resourceName"]>;
|
|
268
|
+
};
|
|
254
269
|
"template-type-constraint-no-met": {
|
|
255
270
|
readonly default: import("@typespec/compiler").CallableMessage<["sourceType", "entity", "constraintType", "actionMessage"]>;
|
|
256
271
|
};
|
package/dist/src/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAqHf,CAAC;AAEH,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAAS,CAAC"}
|
package/dist/src/lib.js
CHANGED
|
@@ -94,6 +94,12 @@ export const $lib = createTypeSpecLibrary({
|
|
|
94
94
|
default: "Resource types must have a property with '@path` and '@segment' decorators.",
|
|
95
95
|
},
|
|
96
96
|
},
|
|
97
|
+
"resource-without-provider-namespace": {
|
|
98
|
+
severity: "warning",
|
|
99
|
+
messages: {
|
|
100
|
+
default: paramMessage `The resource "${"resourceName"}" does not have a provider namespace. Please use a resource in a namespace marked with '@armProviderNamespace' or a virtual resource with a specific namespace`,
|
|
101
|
+
},
|
|
102
|
+
},
|
|
97
103
|
"template-type-constraint-no-met": {
|
|
98
104
|
severity: "error",
|
|
99
105
|
messages: {
|
package/dist/src/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEzE,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAC;IACxC,IAAI,EAAE,8CAA8C;IACpD,WAAW,EAAE;QACX,qBAAqB,EAAE;YACrB,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,4EAA4E;aACtF;SACF;QACD,4BAA4B,EAAE;YAC5B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;gBACR,eAAe,EAAE,YAAY,CAAA,eAAe,QAAQ,OAAO,MAAM,6CAA6C;aAC/G;SACF;QACD,mCAAmC,EAAE;YACnC,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,6EAA6E;aACvF;SACF;QACD,qCAAqC,EAAE;YACrC,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,iBAAiB,cAAc,iKAAiK;aACtN;SACF;QACD,iCAAiC,EAAE;YACjC,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,2BAA2B,YAAY,UAAU,QAAQ,0CAA0C,gBAAgB,MAAM,eAAe,EAAE;aAChK;SACF;KACF;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC"}
|
package/dist/src/linter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAuEA,eAAO,MAAM,OAAO,+CAElB,CAAC"}
|
package/dist/src/linter.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineLinter } from "@typespec/compiler";
|
|
2
2
|
import { armCommonTypesVersionRule } from "./rules/arm-common-types-version.js";
|
|
3
|
+
import { armCustomResourceNoKey } from "./rules/arm-custom-resource-no-key.js";
|
|
3
4
|
import { armCustomResourceUsageDiscourage } from "./rules/arm-custom-resource-usage-discourage.js";
|
|
4
5
|
import { armDeleteResponseCodesRule } from "./rules/arm-delete-response-codes.js";
|
|
5
6
|
import { armNoRecordRule } from "./rules/arm-no-record.js";
|
|
@@ -46,6 +47,7 @@ const rules = [
|
|
|
46
47
|
armResourceOperationsRule,
|
|
47
48
|
armResourcePathInvalidCharsRule,
|
|
48
49
|
armResourceProvisioningStateRule,
|
|
50
|
+
armCustomResourceNoKey,
|
|
49
51
|
armCustomResourceUsageDiscourage,
|
|
50
52
|
beyondNestingRule,
|
|
51
53
|
coreOperationsRule,
|
package/dist/src/linter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linter.js","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAE,gCAAgC,EAAE,MAAM,iDAAiD,CAAC;AACnG,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,kCAAkC,EAAE,MAAM,4CAA4C,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAC;AAC/F,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAClG,OAAO,EAAE,mCAAmC,EAAE,MAAM,gDAAgD,CAAC;AACrG,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,+BAA+B,EAAE,MAAM,4CAA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B,gBAAgB;IAChB,cAAc;IACd,mBAAmB;IACnB,YAAY;CACb,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAC;IAClC,KAAK;CACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../../src/namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,EAEL,SAAS,EAET,OAAO,EAGR,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EACL,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,4CAA4C,CAAC;AA8BpD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,4BASlC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAG,OAAO,CAErF;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,GAAG,SAAS,GAC/B,OAAO,CAIT;AASD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,4BAalC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,GACnB,SAAS,EAAE,GAAG,SAAS,CAEzB;AAQD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,6BA0HnC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,GAAG,KAAK,GACxB,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../../src/namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,EAEL,SAAS,EAET,OAAO,EAGR,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EACL,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,4CAA4C,CAAC;AA8BpD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,4BASlC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAG,OAAO,CAErF;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,GAAG,SAAS,GAC/B,OAAO,CAIT;AASD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,4BAalC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,GACnB,SAAS,EAAE,GAAG,SAAS,CAEzB;AAQD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,6BA0HnC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,GAAG,KAAK,GACxB,MAAM,GAAG,SAAS,CAWpB"}
|
package/dist/src/namespace.js
CHANGED
|
@@ -6,7 +6,7 @@ import { unsafe_setRouteOptionsForNamespace as setRouteOptionsForNamespace } fro
|
|
|
6
6
|
import { getResourceTypeForKeyParam } from "@typespec/rest";
|
|
7
7
|
import { $armCommonTypesVersion } from "./common-types.js";
|
|
8
8
|
import { reportDiagnostic } from "./lib.js";
|
|
9
|
-
import { getSingletonResourceKey } from "./resource.js";
|
|
9
|
+
import { getArmVirtualResourceDetails, getSingletonResourceKey } from "./resource.js";
|
|
10
10
|
import { ArmStateKeys } from "./state.js";
|
|
11
11
|
function getArmCommonTypesVersion(context, entity) {
|
|
12
12
|
return entity.decorators.find((x) => x.definition?.name === "@armCommonTypesVersion")?.args[0]
|
|
@@ -190,16 +190,23 @@ export const $armProviderNamespace = (context, entity, armProviderNamespace) =>
|
|
|
190
190
|
* @returns {string | undefined} ARM provider namespace
|
|
191
191
|
*/
|
|
192
192
|
export function getArmProviderNamespace(program, entity) {
|
|
193
|
-
|
|
193
|
+
if (entity.kind === "Model") {
|
|
194
|
+
const details = getArmVirtualResourceDetails(program, entity);
|
|
195
|
+
if (details?.provider !== undefined) {
|
|
196
|
+
return details.provider;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
const currentNamespace = entity.kind === "Namespace" ? entity : entity.namespace;
|
|
200
|
+
return getArmProviderFromNamespace(program, currentNamespace);
|
|
201
|
+
}
|
|
202
|
+
function getArmProviderFromNamespace(program, ns) {
|
|
194
203
|
let armProviderNamespace;
|
|
195
|
-
while (
|
|
196
|
-
armProviderNamespace = program
|
|
197
|
-
.stateMap(ArmStateKeys.armProviderNamespaces)
|
|
198
|
-
.get(currentNamespace);
|
|
204
|
+
while (ns) {
|
|
205
|
+
armProviderNamespace = program.stateMap(ArmStateKeys.armProviderNamespaces).get(ns);
|
|
199
206
|
if (armProviderNamespace) {
|
|
200
207
|
return armProviderNamespace;
|
|
201
208
|
}
|
|
202
|
-
|
|
209
|
+
ns = ns.namespace;
|
|
203
210
|
}
|
|
204
211
|
return undefined;
|
|
205
212
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"namespace.js","sourceRoot":"","sources":["../../src/namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,UAAU,EACV,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,kCAAkC,IAAI,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAChH,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAM5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,O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AG,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACpF,IAAI,oBAAoB,EAAE,CAAC;YACzB,OAAO,oBAAoB,CAAC;QAC9B,CAAC;QAED,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC;IACpB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/src/operations.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DecoratorContext, Model, Operation, Program } from "@typespec/compiler";
|
|
2
2
|
import { HttpOperation } from "@typespec/http";
|
|
3
3
|
import { ArmResourceActionDecorator, ArmResourceCollectionActionDecorator, ArmResourceCreateOrUpdateDecorator, ArmResourceDeleteDecorator, ArmResourceListDecorator, ArmResourceReadDecorator, ArmResourceUpdateDecorator } from "../generated-defs/Azure.ResourceManager.js";
|
|
4
|
+
import { ArmOperationOptions, ArmOperationRouteDecorator } from "../generated-defs/Azure.ResourceManager.Legacy.js";
|
|
4
5
|
export type ArmLifecycleOperationKind = "read" | "createOrUpdate" | "update" | "delete";
|
|
5
6
|
export type ArmOperationKind = ArmLifecycleOperationKind | "list" | "action";
|
|
6
7
|
export interface ArmResourceOperation extends ArmResourceOperationData {
|
|
@@ -38,5 +39,7 @@ export declare function armRenameListByOperationInternal(context: DecoratorConte
|
|
|
38
39
|
export declare const $armResourceAction: ArmResourceActionDecorator;
|
|
39
40
|
export declare const $armResourceCollectionAction: ArmResourceCollectionActionDecorator;
|
|
40
41
|
export declare function isArmCollectionAction(program: Program, target: Operation): boolean;
|
|
42
|
+
export declare const $armOperationRoute: ArmOperationRouteDecorator;
|
|
43
|
+
export declare function getRouteOptions(program: Program, target: Operation): ArmOperationOptions;
|
|
41
44
|
export {};
|
|
42
45
|
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/operations.ts"],"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,wBAAwB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,gBAAgB,CAAC;IACvB,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB;AA8CD,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,KAAK,GAClB,qBAAqB,CAYvB;AA+BD,eAAO,MAAM,gBAAgB,EAAE,wBAO9B,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,kCAaxC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,0BAOhC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,0BAOhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,wBAyB9B,CAAC;AAEF,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,YAAY,EAAE,KAAK,EACnB,cAAc,CAAC,EAAE,MAAM,EACvB,sBAAsB,CAAC,EAAE,MAAM,EAC/B,oBAAoB,CAAC,EAAE,OAAO,QAuD/B;AA6BD,eAAO,MAAM,kBAAkB,EAAE,0BAiChC,CAAC;AASF,eAAO,MAAM,4BAA4B,EAAE,oCAK1C,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAElF;AAED,eAAO,MAAM,kBAAkB,EAAE,0BAchC,CAAC;AAEF,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,mBAAmB,CAuBxF"}
|
package/dist/src/operations.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $doc, getFriendlyName, ignoreDiagnostics, } from "@typespec/compiler";
|
|
2
|
-
import { getHttpOperation } from "@typespec/http";
|
|
3
|
-
import { $actionSegment, $createsOrReplacesResource, $deletesResource, $readsResource, $updatesResource, getActionSegment, getParentResource, getSegment, } from "@typespec/rest";
|
|
2
|
+
import { $route, getHttpOperation } from "@typespec/http";
|
|
3
|
+
import { $actionSegment, $autoRoute, $createsOrReplacesResource, $deletesResource, $readsResource, $updatesResource, getActionSegment, getParentResource, getSegment, } from "@typespec/rest";
|
|
4
4
|
import { reportDiagnostic } from "./lib.js";
|
|
5
5
|
import { isArmLibraryNamespace } from "./namespace.js";
|
|
6
6
|
import { getArmResourceInfo, getResourceBaseType, isArmVirtualResource, isCustomAzureResource, ResourceBaseType, } from "./resource.js";
|
|
@@ -187,4 +187,39 @@ export const $armResourceCollectionAction = (context, target) => {
|
|
|
187
187
|
export function isArmCollectionAction(program, target) {
|
|
188
188
|
return program.stateMap(ArmStateKeys.armResourceCollectionAction).get(target) === true;
|
|
189
189
|
}
|
|
190
|
+
export const $armOperationRoute = (context, target, options) => {
|
|
191
|
+
const route = options?.route;
|
|
192
|
+
if (!route && !options?.useStaticRoute) {
|
|
193
|
+
context.call($autoRoute, target);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (route && route.length > 0) {
|
|
197
|
+
context.call($route, target, route);
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
export function getRouteOptions(program, target) {
|
|
201
|
+
let options = undefined;
|
|
202
|
+
if (target.interface) {
|
|
203
|
+
options = options || program.stateMap(ArmStateKeys.armResourceRoute).get(target.interface);
|
|
204
|
+
if (options)
|
|
205
|
+
return options;
|
|
206
|
+
}
|
|
207
|
+
if (target.sourceOperation?.interface) {
|
|
208
|
+
options =
|
|
209
|
+
options ||
|
|
210
|
+
program.stateMap(ArmStateKeys.armResourceRoute).get(target.sourceOperation.interface);
|
|
211
|
+
}
|
|
212
|
+
if (target.sourceOperation?.interface?.sourceInterfaces[0]) {
|
|
213
|
+
options =
|
|
214
|
+
options ||
|
|
215
|
+
program
|
|
216
|
+
.stateMap(ArmStateKeys.armResourceRoute)
|
|
217
|
+
.get(target.sourceOperation.interface.sourceInterfaces[0]);
|
|
218
|
+
}
|
|
219
|
+
if (options)
|
|
220
|
+
return options;
|
|
221
|
+
return {
|
|
222
|
+
useStaticRoute: false,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
190
225
|
//# sourceMappingURL=operations.js.map
|