@azure-tools/typespec-azure-resource-manager 0.43.0-dev.1 → 0.43.0-dev.10

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.
Files changed (59) hide show
  1. package/README.md +35 -35
  2. package/dist/src/common-types.d.ts +13 -2
  3. package/dist/src/common-types.d.ts.map +1 -1
  4. package/dist/src/common-types.js +133 -3
  5. package/dist/src/common-types.js.map +1 -1
  6. package/dist/src/commontypes.private.decorators.d.ts +44 -0
  7. package/dist/src/commontypes.private.decorators.d.ts.map +1 -0
  8. package/dist/src/commontypes.private.decorators.js +77 -0
  9. package/dist/src/commontypes.private.decorators.js.map +1 -0
  10. package/dist/src/index.d.ts +1 -1
  11. package/dist/src/index.d.ts.map +1 -1
  12. package/dist/src/index.js +1 -1
  13. package/dist/src/index.js.map +1 -1
  14. package/dist/src/lib.d.ts +17 -2
  15. package/dist/src/lib.d.ts.map +1 -1
  16. package/dist/src/lib.js +6 -0
  17. package/dist/src/lib.js.map +1 -1
  18. package/dist/src/namespace.d.ts.map +1 -1
  19. package/dist/src/namespace.js +35 -0
  20. package/dist/src/namespace.js.map +1 -1
  21. package/dist/src/private.decorators.d.ts +1 -27
  22. package/dist/src/private.decorators.d.ts.map +1 -1
  23. package/dist/src/private.decorators.js +0 -149
  24. package/dist/src/private.decorators.js.map +1 -1
  25. package/dist/src/rules/arm-common-types-version.d.ts.map +1 -1
  26. package/dist/src/rules/arm-common-types-version.js +2 -3
  27. package/dist/src/rules/arm-common-types-version.js.map +1 -1
  28. package/dist/src/rules/arm-post-response-codes.d.ts.map +1 -1
  29. package/dist/src/rules/arm-post-response-codes.js.map +1 -1
  30. package/dist/src/rules/core-operations.js +1 -1
  31. package/dist/src/rules/core-operations.js.map +1 -1
  32. package/dist/src/rules/missing-x-ms-identifiers.js +1 -1
  33. package/dist/src/rules/missing-x-ms-identifiers.js.map +1 -1
  34. package/lib/arm.tsp +2 -9
  35. package/lib/backcompat.tsp +27 -0
  36. package/lib/common-types/common-types.tsp +11 -1
  37. package/lib/common-types/commontypes.private.decorators.tsp +43 -0
  38. package/lib/common-types/customer-managed-keys-ref.tsp +27 -0
  39. package/lib/common-types/customer-managed-keys.tsp +37 -46
  40. package/lib/common-types/extended-location-ref.tsp +1 -0
  41. package/lib/common-types/extended-location.tsp +15 -16
  42. package/lib/common-types/internal.tsp +24 -0
  43. package/lib/common-types/managed-identity-ref.tsp +79 -0
  44. package/lib/common-types/managed-identity.tsp +50 -66
  45. package/lib/common-types/private-links-ref.tsp +159 -0
  46. package/lib/common-types/private-links.tsp +55 -102
  47. package/lib/common-types/types-ref.tsp +414 -0
  48. package/lib/common-types/types.tsp +324 -202
  49. package/lib/decorators.tsp +1 -1
  50. package/lib/{arm.foundations.tsp → foundations/arm.foundations.tsp} +23 -21
  51. package/lib/foundations/backcompat.tsp +39 -0
  52. package/lib/{common-types/backcompat.tsp → foundations/deprecation.tsp} +11 -0
  53. package/lib/interfaces.tsp +0 -1
  54. package/lib/models.tsp +25 -2
  55. package/lib/operations.tsp +5 -32
  56. package/lib/parameters.tsp +14 -67
  57. package/lib/private.decorators.tsp +0 -38
  58. package/lib/responses.tsp +8 -17
  59. package/package.json +5 -7
package/README.md CHANGED
@@ -28,38 +28,38 @@ Available ruleSets:
28
28
 
29
29
  ### Rules
30
30
 
31
- | Name | Description |
32
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
33
- | [`@azure-tools/typespec-azure-resource-manager/arm-no-record`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/no-record) | Don't use Record types for ARM resources. |
34
- | `@azure-tools/typespec-azure-resource-manager/arm-common-types-version` | Specify the ARM common-types version using @armCommonTypesVersion. |
35
- | [`@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/delete-operation-response-codes) | Ensure delete operations have the appropriate status codes. |
36
- | [`@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/put-operation-response-codes) | Ensure put operations have the appropriate status codes. |
37
- | [`@azure-tools/typespec-azure-resource-manager/arm-post-operation-response-codes`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/post-operation-response-codes) | Ensure post operations have the appropriate status codes. |
38
- | `@azure-tools/typespec-azure-resource-manager/arm-resource-action-no-segment` | `@armResourceAction` should not be used with `@segment`. |
39
- | `@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property` | Warn about duplicate properties in resources. |
40
- | `@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property` | Check for invalid resource envelope properties. |
41
- | `@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-version-format` | Check for valid versions. |
42
- | `@azure-tools/typespec-azure-resource-manager/arm-resource-key-invalid-chars` | Arm resource key must contain only alphanumeric characters. |
43
- | [`@azure-tools/typespec-azure-resource-manager/arm-resource-name-pattern`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/resource-name-pattern) | The resource name parameter should be defined with a 'pattern' restriction. |
44
- | `@azure-tools/typespec-azure-resource-manager/arm-resource-operation-response` | [RPC 008]: PUT, GET, PATCH & LIST must return the same resource schema. |
45
- | `@azure-tools/typespec-azure-resource-manager/arm-resource-path-segment-invalid-chars` | Arm resource name must contain only alphanumeric characters. |
46
- | `@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state` | Check for properly configured provisioningState property. |
47
- | `@azure-tools/typespec-azure-resource-manager/beyond-nesting-levels` | Tracked Resources must use 3 or fewer levels of nesting. |
48
- | `@azure-tools/typespec-azure-resource-manager/arm-resource-operation` | Validate ARM Resource operations. |
49
- | `@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation` | Check for resources that must have a delete operation. |
50
- | `@azure-tools/typespec-azure-resource-manager/empty-updateable-properties` | Should have updateable properties. |
51
- | `@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator` | Each resource interface must have an @armResourceOperations decorator. |
52
- | `@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-action-verb` | Actions must be HTTP Post operations. |
53
- | `@azure-tools/typespec-azure-resource-manager/improper-subscription-list-operation` | Tenant and Extension resources should not define a list by subscription operation. |
54
- | [`@azure-tools/typespec-azure-resource-manager/lro-location-header`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/lro-location-header) | A 202 response should include a Location response header. |
55
- | [`@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/missing-x-ms-identifiers) | Azure services should not use enums. |
56
- | `@azure-tools/typespec-azure-resource-manager/no-response-body` | The body of 202 response should be empty. |
57
- | `@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint` | Check for missing Operations interface. |
58
- | `@azure-tools/typespec-azure-resource-manager/patch-envelope` | Patch envelope properties should match the resource properties. |
59
- | `@azure-tools/typespec-azure-resource-manager/arm-resource-patch` | Validate ARM PATCH operations. |
60
- | `@azure-tools/typespec-azure-resource-manager/resource-name` | Check the resource name. |
61
- | `@azure-tools/typespec-azure-resource-manager/retry-after` | Check if retry-after header appears in response body. |
62
- | [`@azure-tools/typespec-azure-resource-manager/unsupported-type`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/unsupported-type) | Check for unsupported ARM types. |
31
+ | Name | Description |
32
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
33
+ | [`@azure-tools/typespec-azure-resource-manager/arm-no-record`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/no-record) | Don't use Record types for ARM resources. |
34
+ | `@azure-tools/typespec-azure-resource-manager/arm-common-types-version` | Specify the ARM common-types version using @armCommonTypesVersion. |
35
+ | [`@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/delete-operation-response-codes) | Ensure delete operations have the appropriate status codes. |
36
+ | [`@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/put-operation-response-codes) | Ensure put operations have the appropriate status codes. |
37
+ | [`@azure-tools/typespec-azure-resource-manager/arm-post-operation-response-codes`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/post-operation-response-codes) | Ensure post operations have the appropriate status codes. |
38
+ | `@azure-tools/typespec-azure-resource-manager/arm-resource-action-no-segment` | `@armResourceAction` should not be used with `@segment`. |
39
+ | `@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property` | Warn about duplicate properties in resources. |
40
+ | `@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property` | Check for invalid resource envelope properties. |
41
+ | `@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-version-format` | Check for valid versions. |
42
+ | `@azure-tools/typespec-azure-resource-manager/arm-resource-key-invalid-chars` | Arm resource key must contain only alphanumeric characters. |
43
+ | [`@azure-tools/typespec-azure-resource-manager/arm-resource-name-pattern`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/resource-name-pattern) | The resource name parameter should be defined with a 'pattern' restriction. |
44
+ | `@azure-tools/typespec-azure-resource-manager/arm-resource-operation-response` | [RPC 008]: PUT, GET, PATCH & LIST must return the same resource schema. |
45
+ | `@azure-tools/typespec-azure-resource-manager/arm-resource-path-segment-invalid-chars` | Arm resource name must contain only alphanumeric characters. |
46
+ | `@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state` | Check for properly configured provisioningState property. |
47
+ | `@azure-tools/typespec-azure-resource-manager/beyond-nesting-levels` | Tracked Resources must use 3 or fewer levels of nesting. |
48
+ | `@azure-tools/typespec-azure-resource-manager/arm-resource-operation` | Validate ARM Resource operations. |
49
+ | `@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation` | Check for resources that must have a delete operation. |
50
+ | `@azure-tools/typespec-azure-resource-manager/empty-updateable-properties` | Should have updateable properties. |
51
+ | `@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator` | Each resource interface must have an @armResourceOperations decorator. |
52
+ | `@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-action-verb` | Actions must be HTTP Post operations. |
53
+ | `@azure-tools/typespec-azure-resource-manager/improper-subscription-list-operation` | Tenant and Extension resources should not define a list by subscription operation. |
54
+ | [`@azure-tools/typespec-azure-resource-manager/lro-location-header`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/lro-location-header) | A 202 response should include a Location response header. |
55
+ | [`@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/missing-x-ms-identifiers) | Array properties should describe their identifying properties with x-ms-identifiers. Decorate the property with @OpenAPI.extension("x-ms-identifiers", [id-prop]) where "id-prop" is a list of the names of identifying properties in the item type. |
56
+ | `@azure-tools/typespec-azure-resource-manager/no-response-body` | The body of 202 response should be empty. |
57
+ | `@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint` | Check for missing Operations interface. |
58
+ | `@azure-tools/typespec-azure-resource-manager/patch-envelope` | Patch envelope properties should match the resource properties. |
59
+ | `@azure-tools/typespec-azure-resource-manager/arm-resource-patch` | Validate ARM PATCH operations. |
60
+ | `@azure-tools/typespec-azure-resource-manager/resource-name` | Check the resource name. |
61
+ | `@azure-tools/typespec-azure-resource-manager/retry-after` | Check if retry-after header appears in response body. |
62
+ | [`@azure-tools/typespec-azure-resource-manager/unsupported-type`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/unsupported-type) | Check for unsupported ARM types. |
63
63
 
64
64
  ## Decorators
65
65
 
@@ -103,9 +103,9 @@ the version of the Azure Resource Manager common-types to use for refs in emitte
103
103
 
104
104
  ##### Parameters
105
105
 
106
- | Name | Type | Description |
107
- | ------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
108
- | version | `valueof string \| EnumMember` | The Azure.ResourceManager.CommonTypes.Versions for the desired common-types version or an equivalent string value. |
106
+ | Name | Type | Description |
107
+ | ------- | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
108
+ | version | `valueof string \| EnumMember` | The Azure.ResourceManager.CommonTypes.Versions for the desired common-types version or an equivalent string value like "v5". |
109
109
 
110
110
  #### `@armLibraryNamespace`
111
111
 
@@ -1,9 +1,11 @@
1
- import { DecoratorContext, Enum, EnumMember, EnumValue, Namespace, Program, Type } from "@typespec/compiler";
1
+ import { DecoratorContext, Diagnostic, Enum, EnumMember, EnumValue, Model, ModelProperty, Namespace, Program, Service, Type } from "@typespec/compiler";
2
+ import { ArmCommonTypeRecord } from "./commontypes.private.decorators.js";
2
3
  export interface ArmCommonTypeVersions {
3
4
  type: Enum;
4
5
  allVersions: EnumMember[];
5
6
  }
6
- export declare function getArmCommonTypesVersions(program: Program): ArmCommonTypeVersions | undefined;
7
+ export declare function getArmCommonTypesVersions(program: Program): ArmCommonTypeVersions;
8
+ export declare function getArmCommonTypesVersionFromString(program: Program, entity: Namespace | EnumMember, versionStr: string): [EnumMember | undefined, readonly Diagnostic[]];
7
9
  /**
8
10
  * Check if a given model or model property is an ARM common type.
9
11
  * @param {Type} entity - The entity to be checked.
@@ -22,4 +24,13 @@ export declare function $armCommonTypesVersion(context: DecoratorContext, entity
22
24
  * @param {type} entity Target of the decorator. Must be `Namespace` or `EnumMember` type
23
25
  */
24
26
  export declare function getArmCommonTypesVersion(program: Program, entity: Namespace | EnumMember): string | undefined;
27
+ /**
28
+ * Get the common-types.json ref for the given common type.
29
+ */
30
+ export declare function getArmCommonTypeOpenAPIRef(program: Program, entity: Model | ModelProperty, params: ArmCommonTypesResolutionOptions): string | undefined;
31
+ export interface ArmCommonTypesResolutionOptions {
32
+ readonly service: Service;
33
+ readonly version?: string;
34
+ }
35
+ export declare function findArmCommonTypeRecord(program: Program, entity: Model | ModelProperty, params: ArmCommonTypesResolutionOptions): [ArmCommonTypeRecord | undefined, readonly Diagnostic[]];
25
36
  //# sourceMappingURL=common-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common-types.d.ts","sourceRoot":"","sources":["../../src/common-types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,IAAI,EACJ,UAAU,EACV,SAAS,EACT,SAAS,EACT,OAAO,EACP,IAAI,EAEL,MAAM,oBAAoB,CAAC;AAG5B,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,qBAAqB,GAAG,SAAS,CAK7F;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,CAQrD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,GAAG,UAAU,EAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,QAK5B;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,GAAG,UAAU,GAC7B,MAAM,GAAG,SAAS,CAEpB"}
1
+ {"version":3,"file":"common-types.d.ts","sourceRoot":"","sources":["../../src/common-types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,IAAI,EACJ,UAAU,EACV,SAAS,EACT,KAAK,EACL,aAAa,EACb,SAAS,EACT,OAAO,EACP,OAAO,EACP,IAAI,EAEL,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,mBAAmB,EAGpB,MAAM,qCAAqC,CAAC;AAI7C,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,qBAAqB,CAKjF;AAED,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,GAAG,UAAU,EAC9B,UAAU,EAAE,MAAM,GACjB,CAAC,UAAU,GAAG,SAAS,EAAE,SAAS,UAAU,EAAE,CAAC,CAuBjD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,CAQrD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,GAAG,UAAU,EAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,QA8B5B;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,GAAG,UAAU,GAC7B,MAAM,GAAG,SAAS,CAEpB;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,KAAK,GAAG,aAAa,EAC7B,MAAM,EAAE,+BAA+B,GACtC,MAAM,GAAG,SAAS,CAWpB;AAOD,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,KAAK,GAAG,aAAa,EAC7B,MAAM,EAAE,+BAA+B,GACtC,CAAC,mBAAmB,GAAG,SAAS,EAAE,SAAS,UAAU,EAAE,CAAC,CA8C1D"}
@@ -1,4 +1,7 @@
1
1
  import { isTypeSpecValueTypeOf, } from "@typespec/compiler";
2
+ import { $useDependency, getVersion } from "@typespec/versioning";
3
+ import { ArmCommonTypesDefaultVersion, getCommonTypeRecords, } from "./commontypes.private.decorators.js";
4
+ import { createDiagnostic } from "./lib.js";
2
5
  import { ArmStateKeys } from "./state.js";
3
6
  export function getArmCommonTypesVersions(program) {
4
7
  // There is a single instance of ArmCommonTypeVersions stored inside of the
@@ -6,6 +9,27 @@ export function getArmCommonTypesVersions(program) {
6
9
  const map = program.stateMap(ArmStateKeys.armCommonTypesVersions);
7
10
  return map?.values().next().value;
8
11
  }
12
+ export function getArmCommonTypesVersionFromString(program, entity, versionStr) {
13
+ const commonTypeVersionEnum = program.resolveTypeReference(`Azure.ResourceManager.CommonTypes.Versions.${versionStr}`)[0];
14
+ if (commonTypeVersionEnum === undefined) {
15
+ return [
16
+ undefined,
17
+ [
18
+ createDiagnostic({
19
+ code: "arm-common-types-invalid-version",
20
+ target: entity,
21
+ format: {
22
+ versionString: versionStr,
23
+ supportedVersions: [...getArmCommonTypesVersions(program).type.members.keys()].join(", "),
24
+ },
25
+ }),
26
+ ],
27
+ ];
28
+ }
29
+ else {
30
+ return [commonTypeVersionEnum, []];
31
+ }
32
+ }
9
33
  /**
10
34
  * Check if a given model or model property is an ARM common type.
11
35
  * @param {Type} entity - The entity to be checked.
@@ -24,9 +48,29 @@ export function isArmCommonType(entity) {
24
48
  * @param {type} entity Target of the decorator. Must be `Namespace` or `EnumMember` type
25
49
  */
26
50
  export function $armCommonTypesVersion(context, entity, version) {
27
- context.program
28
- .stateMap(ArmStateKeys.armCommonTypesVersion)
29
- .set(entity, typeof version === "string" ? version : version.value.name);
51
+ // try convert string to EnumMember
52
+ let versionEnum;
53
+ if (typeof version === "string") {
54
+ const [foundEnumMember, diagnostics] = getArmCommonTypesVersionFromString(context.program, entity, version);
55
+ if (!foundEnumMember) {
56
+ context.program.reportDiagnostics(diagnostics);
57
+ return;
58
+ }
59
+ versionEnum = foundEnumMember;
60
+ }
61
+ else {
62
+ versionEnum = version.value;
63
+ }
64
+ context.program.stateMap(ArmStateKeys.armCommonTypesVersion).set(entity, versionEnum.name);
65
+ if (entity.kind === "Namespace") {
66
+ const versioned = entity.decorators.find((x) => x.definition?.name === "@versioned");
67
+ // If it is versioned namespace, we will skip adding @useDependency to namespace
68
+ if (versioned) {
69
+ return;
70
+ }
71
+ }
72
+ // Add @useDependency on version enum members or on unversioned namespace
73
+ context.call($useDependency, entity, versionEnum);
30
74
  }
31
75
  /**
32
76
  * Returns the ARM common-types version used by the service.
@@ -36,4 +80,90 @@ export function $armCommonTypesVersion(context, entity, version) {
36
80
  export function getArmCommonTypesVersion(program, entity) {
37
81
  return program.stateMap(ArmStateKeys.armCommonTypesVersion).get(entity);
38
82
  }
83
+ /**
84
+ * Get the common-types.json ref for the given common type.
85
+ */
86
+ export function getArmCommonTypeOpenAPIRef(program, entity, params) {
87
+ const [record, diagnostics] = findArmCommonTypeRecord(program, entity, params);
88
+ if (record) {
89
+ return record.basePath.endsWith(".json")
90
+ ? `${record.basePath}#/${record.kind}/${record.name}`
91
+ : `${record.basePath}/${record.version}/${record.referenceFile}#/${record.kind}/${record.name}`;
92
+ }
93
+ else {
94
+ program.reportDiagnostics(diagnostics);
95
+ return undefined;
96
+ }
97
+ }
98
+ export function findArmCommonTypeRecord(program, entity, params) {
99
+ const { records, defaultKey } = getCommonTypeRecords(program, entity);
100
+ const commonTypes = resolveCommonTypesVersion(program, params);
101
+ const selectedVersion = commonTypes.selectedVersion;
102
+ // Find closest version that matches the dependency (based on version enum order)
103
+ let record;
104
+ if (selectedVersion) {
105
+ let foundSelectedVersion = false;
106
+ for (const version of commonTypes.allVersions) {
107
+ if (!foundSelectedVersion) {
108
+ if (selectedVersion !== version.name) {
109
+ continue;
110
+ }
111
+ foundSelectedVersion = true;
112
+ }
113
+ const maybeRecord = records[version.name];
114
+ if (maybeRecord) {
115
+ record = maybeRecord;
116
+ break;
117
+ }
118
+ }
119
+ }
120
+ else {
121
+ // If no version was found, use the default version
122
+ record = records[defaultKey ?? ArmCommonTypesDefaultVersion];
123
+ }
124
+ if (record === undefined) {
125
+ return [
126
+ undefined,
127
+ [
128
+ createDiagnostic({
129
+ code: "arm-common-types-incompatible-version",
130
+ target: entity,
131
+ format: {
132
+ selectedVersion: selectedVersion ?? ArmCommonTypesDefaultVersion,
133
+ supportedVersions: Object.keys(records).join(", "),
134
+ },
135
+ }),
136
+ ],
137
+ ];
138
+ }
139
+ else {
140
+ return [record, []];
141
+ }
142
+ }
143
+ /**
144
+ * Resolve which version of the Common Types to use.
145
+ */
146
+ function resolveCommonTypesVersion(program, params) {
147
+ let selectedVersion;
148
+ const { allVersions } = getArmCommonTypesVersions(program) ?? {};
149
+ const versionMap = getVersion(program, params.service.type);
150
+ // If the service is versioned, extract the common-types version from the
151
+ // service version enum
152
+ if (params.version && versionMap) {
153
+ const versionEnumMember = versionMap
154
+ .getVersions()
155
+ .find((x) => x.value === params.version)?.enumMember;
156
+ if (versionEnumMember) {
157
+ selectedVersion = getArmCommonTypesVersion(program, versionEnumMember);
158
+ }
159
+ }
160
+ // Extract the version from the service namespace instead
161
+ if (selectedVersion === undefined) {
162
+ selectedVersion = getArmCommonTypesVersion(program, params.service.type);
163
+ }
164
+ return {
165
+ selectedVersion,
166
+ allVersions: allVersions ?? [],
167
+ };
168
+ }
39
169
  //# sourceMappingURL=common-types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"common-types.js","sourceRoot":"","sources":["../../src/common-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAO1C,MAAM,UAAU,yBAAyB,CAAC,OAAgB;IACxD,2EAA2E;IAC3E,6DAA6D;IAC7D,MAAM,GAAG,GAAmB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAC;IAClF,OAAO,GAAG,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAY,CAAC;AAC3C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,MAAY;IAC1C,MAAM,gBAAgB,GAAG,CAAC,sBAAsB,EAAE,qBAAqB,CAAC,C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AAiB,EAAE,CAAC;YACtB,eAAe,GAAG,wBAAwB,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED,yDAAyD;IACzD,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QAClC,eAAe,GAAG,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO;QACL,eAAe;QACf,WAAW,EAAE,WAAW,IAAI,EAAE;KAC/B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { DecoratorContext, Enum, EnumValue, Model, ModelProperty, Program } from "@typespec/compiler";
2
+ export declare const namespace = "Azure.ResourceManager.CommonTypes.Private";
3
+ export declare const ArmCommonTypesDefaultVersion = "v3";
4
+ export interface ArmCommonTypeRecord {
5
+ name: string;
6
+ kind: "definitions" | "parameters";
7
+ version: string;
8
+ basePath: string;
9
+ referenceFile?: string;
10
+ }
11
+ export interface ArmCommonTypeRecords {
12
+ records: {
13
+ [key: string]: ArmCommonTypeRecord;
14
+ };
15
+ defaultKey?: string;
16
+ }
17
+ export declare function getCommonTypeRecords(program: Program, entity: Model | ModelProperty): ArmCommonTypeRecords;
18
+ interface ArmCommonTypeVersionSpec {
19
+ version: string | EnumValue;
20
+ isDefault: boolean;
21
+ }
22
+ /**
23
+ * Refer an model property to be a common ARM parameter
24
+ * @param {DecoratorContext} context DecoratorContext object
25
+ * @param {Type} entity Decorator target type. Must be `Model`
26
+ * @param {string?} definitionName Optional definition name
27
+ * @param {string?} version Optional version
28
+ * @param {string?} referenceFile Optional common file path
29
+ * @returns void
30
+ */
31
+ export declare function $armCommonParameter(context: DecoratorContext, entity: ModelProperty, parameterName?: string, version?: string | EnumValue | ArmCommonTypeVersionSpec, referenceFile?: string): void;
32
+ /**
33
+ * Using ARM common definition for a Model
34
+ * @param {DecoratorContext} context DecoratorContext object
35
+ * @param {Type} entity Decorator target type. Must be `Model`
36
+ * @param {string?} definitionName Optional definition name
37
+ * @param {string?} version Optional version
38
+ * @param {string?} referenceFile Optional common file path
39
+ * @returns {void}
40
+ */
41
+ export declare function $armCommonDefinition(context: DecoratorContext, entity: Model, definitionName?: string, version?: string | EnumValue | ArmCommonTypeVersionSpec, referenceFile?: string): void;
42
+ export declare function $armCommonTypesVersions(context: DecoratorContext, enumType: Enum): void;
43
+ export {};
44
+ //# sourceMappingURL=commontypes.private.decorators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commontypes.private.decorators.d.ts","sourceRoot":"","sources":["../../src/commontypes.private.decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,IAAI,EACJ,SAAS,EACT,KAAK,EACL,aAAa,EACb,OAAO,EACR,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,SAAS,8CAA8C,CAAC;AAErE,eAAO,MAAM,4BAA4B,OAAO,CAAC;AA4CjD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,GAAG,YAAY,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAA;KAAE,CAAC;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,KAAK,GAAG,aAAa,GAC5B,oBAAoB,CAEtB;AAED,UAAU,wBAAwB;IAChC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,aAAa,EACrB,aAAa,CAAC,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,wBAAwB,EACvD,aAAa,CAAC,EAAE,MAAM,GACrB,IAAI,CAON;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,KAAK,EACb,cAAc,CAAC,EAAE,MAAM,EACvB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,wBAAwB,EACvD,aAAa,CAAC,EAAE,MAAM,GACrB,IAAI,CAON;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,IAAI,QAKhF"}
@@ -0,0 +1,77 @@
1
+ import { ArmStateKeys } from "./state.js";
2
+ export const namespace = "Azure.ResourceManager.CommonTypes.Private";
3
+ export const ArmCommonTypesDefaultVersion = "v3";
4
+ function getArmTypesPath(program) {
5
+ return program.getOption("arm-types-path") || "{arm-types-dir}";
6
+ }
7
+ function storeCommonTypeRecord(context, entity, kind, name, version, referenceFile) {
8
+ const basePath = getArmTypesPath(context.program).trim();
9
+ // NOTE: Right now we don't try to prevent multiple versions from declaring that they are the default
10
+ let isDefault = false;
11
+ if (version && typeof version !== "string" && !("valueKind" in version)) {
12
+ isDefault = !!version.isDefault;
13
+ version = version.version;
14
+ }
15
+ // for backward compatibility, skip if we are trying to access a non-default file and emit the type
16
+ if ((version || referenceFile) && basePath.endsWith(".json"))
17
+ return;
18
+ if (!version)
19
+ version = ArmCommonTypesDefaultVersion;
20
+ if (!referenceFile)
21
+ referenceFile = "types.json";
22
+ const versionStr = typeof version === "string" ? version : version.value.name;
23
+ const records = getCommonTypeRecords(context.program, entity);
24
+ records.records[versionStr] = {
25
+ name,
26
+ kind,
27
+ version: versionStr,
28
+ basePath,
29
+ referenceFile,
30
+ };
31
+ if (isDefault) {
32
+ records.defaultKey = versionStr;
33
+ }
34
+ context.program.stateMap(ArmStateKeys.armCommonDefinitions).set(entity, records);
35
+ }
36
+ export function getCommonTypeRecords(program, entity) {
37
+ return program.stateMap(ArmStateKeys.armCommonDefinitions).get(entity) ?? { records: {} };
38
+ }
39
+ /**
40
+ * Refer an model property to be a common ARM parameter
41
+ * @param {DecoratorContext} context DecoratorContext object
42
+ * @param {Type} entity Decorator target type. Must be `Model`
43
+ * @param {string?} definitionName Optional definition name
44
+ * @param {string?} version Optional version
45
+ * @param {string?} referenceFile Optional common file path
46
+ * @returns void
47
+ */
48
+ export function $armCommonParameter(context, entity, parameterName, version, referenceFile) {
49
+ // Use the name of the model type if not specified
50
+ if (!parameterName) {
51
+ parameterName = entity.name;
52
+ }
53
+ storeCommonTypeRecord(context, entity, "parameters", parameterName, version, referenceFile);
54
+ }
55
+ /**
56
+ * Using ARM common definition for a Model
57
+ * @param {DecoratorContext} context DecoratorContext object
58
+ * @param {Type} entity Decorator target type. Must be `Model`
59
+ * @param {string?} definitionName Optional definition name
60
+ * @param {string?} version Optional version
61
+ * @param {string?} referenceFile Optional common file path
62
+ * @returns {void}
63
+ */
64
+ export function $armCommonDefinition(context, entity, definitionName, version, referenceFile) {
65
+ // Use the name of the model type if not specified
66
+ if (!definitionName) {
67
+ definitionName = entity.name;
68
+ }
69
+ storeCommonTypeRecord(context, entity, "definitions", definitionName, version, referenceFile);
70
+ }
71
+ export function $armCommonTypesVersions(context, enumType) {
72
+ context.program.stateMap(ArmStateKeys.armCommonTypesVersions).set(enumType, {
73
+ type: enumType,
74
+ allVersions: Array.from(enumType.members.values()).reverse(),
75
+ });
76
+ }
77
+ //# sourceMappingURL=commontypes.private.decorators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commontypes.private.decorators.js","sourceRoot":"","sources":["../../src/commontypes.private.decorators.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,CAAC,MAAM,SAAS,GAAG,2CAA2C,CAAC;AAErE,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAA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AE,CAAC,CAAC,OAAO,EAAE;KAC7D,CAAC,CAAC;AACL,CAAC"}
@@ -1,5 +1,5 @@
1
1
  export declare const namespace = "Azure.ResourceManager";
2
- export * from "./common-types.js";
2
+ export { $armCommonTypesVersion, getArmCommonTypeOpenAPIRef, getArmCommonTypesVersion, getArmCommonTypesVersions, isArmCommonType, type ArmCommonTypeVersions, type ArmCommonTypesResolutionOptions, } from "./common-types.js";
3
3
  export * from "./namespace.js";
4
4
  export * from "./operations.js";
5
5
  export * from "./resource.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,0BAA0B,CAAC;AAEjD,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,eAAO,MAAM,MAAM,2CAEjB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,0BAA0B,CAAC;AAEjD,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,eAAe,EACf,KAAK,qBAAqB,EAC1B,KAAK,+BAA+B,GACrC,MAAM,mBAAmB,CAAC;AAE3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,eAAO,MAAM,MAAM,2CAEjB,CAAC"}
package/dist/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { definePackageFlags } from "@typespec/compiler";
2
2
  export const namespace = "Azure.ResourceManager";
3
- export * from "./common-types.js";
3
+ export { $armCommonTypesVersion, getArmCommonTypeOpenAPIRef, getArmCommonTypesVersion, getArmCommonTypesVersions, isArmCommonType, } from "./common-types.js";
4
4
  export * from "./namespace.js";
5
5
  export * from "./operations.js";
6
6
  export * from "./resource.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,CAAC,MAAM,SAAS,GAAG,uBAAuB,CAAC;AAEjD,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC;IACvC,uBAAuB,EAAE,KAAK;CAC/B,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,CAAC,MAAM,SAAS,GAAG,uBAAuB,CAAC;AAEjD,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,eAAe,GAGhB,MAAM,mBAAmB,CAAC;AAE3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC;IACvC,uBAAuB,EAAE,KAAK;CAC/B,CAAC,CAAC"}
package/dist/src/lib.d.ts CHANGED
@@ -32,6 +32,9 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
32
32
  "arm-common-types-incompatible-version": {
33
33
  default: import("@typespec/compiler").CallableMessage<[string, string]>;
34
34
  };
35
+ "arm-common-types-invalid-version": {
36
+ default: import("@typespec/compiler").CallableMessage<[string, string]>;
37
+ };
35
38
  "decorator-in-namespace": {
36
39
  default: import("@typespec/compiler").CallableMessage<[string]>;
37
40
  };
@@ -45,7 +48,7 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
45
48
  default: import("@typespec/compiler").CallableMessage<[string, string, string, string]>;
46
49
  };
47
50
  }, Record<string, any>, never>;
48
- 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" | "decorator-in-namespace" | "parent-type" | "resource-without-path-and-segment" | "template-type-constraint-no-met", M extends keyof {
51
+ 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 {
49
52
  "single-arm-provider": {
50
53
  default: string;
51
54
  };
@@ -79,6 +82,9 @@ export declare const reportDiagnostic: <C extends "single-arm-provider" | "decor
79
82
  "arm-common-types-incompatible-version": {
80
83
  default: import("@typespec/compiler").CallableMessage<[string, string]>;
81
84
  };
85
+ "arm-common-types-invalid-version": {
86
+ default: import("@typespec/compiler").CallableMessage<[string, string]>;
87
+ };
82
88
  "decorator-in-namespace": {
83
89
  default: import("@typespec/compiler").CallableMessage<[string]>;
84
90
  };
@@ -125,6 +131,9 @@ export declare const reportDiagnostic: <C extends "single-arm-provider" | "decor
125
131
  "arm-common-types-incompatible-version": {
126
132
  default: import("@typespec/compiler").CallableMessage<[string, string]>;
127
133
  };
134
+ "arm-common-types-invalid-version": {
135
+ default: import("@typespec/compiler").CallableMessage<[string, string]>;
136
+ };
128
137
  "decorator-in-namespace": {
129
138
  default: import("@typespec/compiler").CallableMessage<[string]>;
130
139
  };
@@ -137,7 +146,7 @@ export declare const reportDiagnostic: <C extends "single-arm-provider" | "decor
137
146
  "template-type-constraint-no-met": {
138
147
  default: import("@typespec/compiler").CallableMessage<[string, string, string, string]>;
139
148
  };
140
- }, 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" | "decorator-in-namespace" | "parent-type" | "resource-without-path-and-segment" | "template-type-constraint-no-met", M extends keyof {
149
+ }, 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 {
141
150
  "single-arm-provider": {
142
151
  default: string;
143
152
  };
@@ -171,6 +180,9 @@ export declare const reportDiagnostic: <C extends "single-arm-provider" | "decor
171
180
  "arm-common-types-incompatible-version": {
172
181
  default: import("@typespec/compiler").CallableMessage<[string, string]>;
173
182
  };
183
+ "arm-common-types-invalid-version": {
184
+ default: import("@typespec/compiler").CallableMessage<[string, string]>;
185
+ };
174
186
  "decorator-in-namespace": {
175
187
  default: import("@typespec/compiler").CallableMessage<[string]>;
176
188
  };
@@ -217,6 +229,9 @@ export declare const reportDiagnostic: <C extends "single-arm-provider" | "decor
217
229
  "arm-common-types-incompatible-version": {
218
230
  default: import("@typespec/compiler").CallableMessage<[string, string]>;
219
231
  };
232
+ "arm-common-types-invalid-version": {
233
+ default: import("@typespec/compiler").CallableMessage<[string, string]>;
234
+ };
220
235
  "decorator-in-namespace": {
221
236
  default: import("@typespec/compiler").CallableMessage<[string]>;
222
237
  };
@@ -1 +1 @@
1
- {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAqGf,CAAC;AAEH,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAAS,CAAC"}
1
+ {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BA2Gf,CAAC;AAEH,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAAS,CAAC"}
package/dist/src/lib.js CHANGED
@@ -68,6 +68,12 @@ export const $lib = createTypeSpecLibrary({
68
68
  default: paramMessage `No ARM common-types version for this type satisfies the expected version ${"selectedVersion"}. This type only supports the following version(s): ${"supportedVersions"}`,
69
69
  },
70
70
  },
71
+ "arm-common-types-invalid-version": {
72
+ severity: "error",
73
+ messages: {
74
+ default: paramMessage `No ARM common-types version matches the version string ${"versionString"}. The following versions are supported: ${"supportedVersions"}`,
75
+ },
76
+ },
71
77
  "decorator-in-namespace": {
72
78
  severity: "error",
73
79
  messages: {
@@ -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,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,0BAA0B,EACxB,gGAAgG;aACnG;SACF;QACD,gCAAgC,EAAE;YAChC,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE;gBACR,OAAO,EACL,oLAAoL;aACvL;SACF;QACD,uCAAuC,EAAE;YACvC,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE;gBACR,OAAO,EACL,uNAAuN;aAC1N;SACF;QACD,oCAAoC,EAAE;YACpC,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gB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