@azure-tools/typespec-azure-resource-manager 0.71.0-dev.8 → 0.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.md +4 -2
  2. package/dist/generated-defs/Azure.ResourceManager.BaseTypes.d.ts +1 -1
  3. package/dist/src/base-types.d.ts +1 -1
  4. package/dist/src/base-types.d.ts.map +1 -1
  5. package/dist/src/common-types.d.ts +4 -4
  6. package/dist/src/common-types.d.ts.map +1 -1
  7. package/dist/src/commontypes.private.decorators.d.ts +2 -2
  8. package/dist/src/commontypes.private.decorators.d.ts.map +1 -1
  9. package/dist/src/linter.d.ts.map +1 -1
  10. package/dist/src/linter.js +6 -2
  11. package/dist/src/linter.js.map +1 -1
  12. package/dist/src/namespace.d.ts +2 -2
  13. package/dist/src/namespace.d.ts.map +1 -1
  14. package/dist/src/operations.d.ts +4 -4
  15. package/dist/src/operations.d.ts.map +1 -1
  16. package/dist/src/operations.js.map +1 -1
  17. package/dist/src/private.decorators.d.ts +2 -2
  18. package/dist/src/private.decorators.d.ts.map +1 -1
  19. package/dist/src/private.decorators.js +17 -6
  20. package/dist/src/private.decorators.js.map +1 -1
  21. package/dist/src/resource.d.ts +4 -4
  22. package/dist/src/resource.d.ts.map +1 -1
  23. package/dist/src/rules/arm-agent-base-type-child-resources.js.map +1 -1
  24. package/dist/src/rules/arm-agent-base-type-lifecycle-operations.js.map +1 -1
  25. package/dist/src/rules/arm-common-types-version.js.map +1 -1
  26. package/dist/src/rules/arm-custom-resource-no-key.js.map +1 -1
  27. package/dist/src/rules/arm-custom-resource-usage-discourage.d.ts.map +1 -1
  28. package/dist/src/rules/arm-custom-resource-usage-discourage.js +1 -1
  29. package/dist/src/rules/arm-custom-resource-usage-discourage.js.map +1 -1
  30. package/dist/src/rules/arm-delete-response-codes.js.map +1 -1
  31. package/dist/src/rules/arm-feature-file-usage-discourage.js.map +1 -1
  32. package/dist/src/rules/arm-legacy-operations-discourage.js.map +1 -1
  33. package/dist/src/rules/arm-post-response-codes.js.map +1 -1
  34. package/dist/src/rules/arm-put-response-codes.js.map +1 -1
  35. package/dist/src/rules/arm-resource-action-no-segment.js.map +1 -1
  36. package/dist/src/rules/arm-resource-interfaces.js.map +1 -1
  37. package/dist/src/rules/arm-resource-invalid-action-verb.js.map +1 -1
  38. package/dist/src/rules/arm-resource-invalid-envelope-property.d.ts.map +1 -1
  39. package/dist/src/rules/arm-resource-invalid-envelope-property.js +1 -1
  40. package/dist/src/rules/arm-resource-invalid-envelope-property.js.map +1 -1
  41. package/dist/src/rules/arm-resource-invalid-version-format.js.map +1 -1
  42. package/dist/src/rules/arm-resource-operation-response.js.map +1 -1
  43. package/dist/src/rules/arm-resource-path-invalid-chars.d.ts.map +1 -1
  44. package/dist/src/rules/arm-resource-path-invalid-chars.js +1 -1
  45. package/dist/src/rules/arm-resource-path-invalid-chars.js.map +1 -1
  46. package/dist/src/rules/arm-resource-provisioning-state-rule.d.ts.map +1 -1
  47. package/dist/src/rules/arm-resource-provisioning-state-rule.js +1 -1
  48. package/dist/src/rules/arm-resource-provisioning-state-rule.js.map +1 -1
  49. package/dist/src/rules/beyond-nesting-levels.js.map +1 -1
  50. package/dist/src/rules/envelope-properties.js.map +1 -1
  51. package/dist/src/rules/improper-subscription-list-operation.js.map +1 -1
  52. package/dist/src/rules/lro-location-header.js.map +1 -1
  53. package/dist/src/rules/no-empty-model.js.map +1 -1
  54. package/dist/src/rules/no-reserved-resource-property.js.map +1 -1
  55. package/dist/src/rules/no-resource-delete-operation.js.map +1 -1
  56. package/dist/src/rules/no-response-body.d.ts.map +1 -1
  57. package/dist/src/rules/no-response-body.js +1 -1
  58. package/dist/src/rules/no-response-body.js.map +1 -1
  59. package/dist/src/rules/patch-envelope-properties.d.ts.map +1 -1
  60. package/dist/src/rules/patch-envelope-properties.js +1 -1
  61. package/dist/src/rules/patch-envelope-properties.js.map +1 -1
  62. package/dist/src/rules/retry-after.js.map +1 -1
  63. package/dist/src/rules/use-api-version.d.ts +4 -0
  64. package/dist/src/rules/use-api-version.d.ts.map +1 -0
  65. package/dist/src/rules/use-api-version.js +45 -0
  66. package/dist/src/rules/use-api-version.js.map +1 -0
  67. package/dist/src/rules/use-interface.d.ts +4 -0
  68. package/dist/src/rules/use-interface.d.ts.map +1 -0
  69. package/dist/src/rules/use-interface.js +29 -0
  70. package/dist/src/rules/use-interface.js.map +1 -0
  71. package/dist/src/rules/use-operation-decorator.d.ts +5 -0
  72. package/dist/src/rules/use-operation-decorator.d.ts.map +1 -0
  73. package/dist/src/rules/use-operation-decorator.js +133 -0
  74. package/dist/src/rules/use-operation-decorator.js.map +1 -0
  75. package/dist/src/rules/use-relationship-required-properties.d.ts.map +1 -1
  76. package/dist/src/rules/use-relationship-required-properties.js +1 -1
  77. package/dist/src/rules/use-relationship-required-properties.js.map +1 -1
  78. package/dist/src/rules/utils.d.ts +2 -2
  79. package/dist/src/rules/utils.d.ts.map +1 -1
  80. package/dist/src/rules/utils.js.map +1 -1
  81. package/dist/src/rules/version-progression.d.ts.map +1 -1
  82. package/dist/src/rules/version-progression.js +1 -1
  83. package/dist/src/rules/version-progression.js.map +1 -1
  84. package/dist/src/testing/index.d.ts +1 -1
  85. package/dist/src/testing/index.d.ts.map +1 -1
  86. package/lib/base-types/agent.tsp +3 -10
  87. package/lib/base-types/base-types.tsp +1 -1
  88. package/lib/common-types/billing-data.tsp +211 -0
  89. package/lib/common-types/common-types.tsp +1 -1
  90. package/lib/common-types/managed-identity-with-delegation.tsp +1 -0
  91. package/lib/common-types/network-security-perimeter.tsp +29 -0
  92. package/lib/common-types/types.tsp +5 -0
  93. package/lib/extension/parameters.tsp +2 -0
  94. package/lib/foundations/arm.foundations.tsp +1 -0
  95. package/lib/interfaces.tsp +2 -24
  96. package/lib/legacy-types/resource.tsp +1 -0
  97. package/lib/models.tsp +19 -1
  98. package/lib/private-endpoints.tsp +0 -2
  99. package/lib/private-links.tsp +0 -5
  100. package/package.json +15 -15
  101. package/dist/src/rules/core-operations.d.ts +0 -6
  102. package/dist/src/rules/core-operations.d.ts.map +0 -1
  103. package/dist/src/rules/core-operations.js +0 -105
  104. package/dist/src/rules/core-operations.js.map +0 -1
@@ -0,0 +1,133 @@
1
+ import { createRule, isTemplateInstance, paramMessage } from "@typespec/compiler";
2
+ import { getOperationVerb } from "@typespec/http";
3
+ import { getSegment } from "@typespec/rest";
4
+ import { isSourceOperationResourceManagerInternal, isTemplatedInterfaceOperation, } from "./utils.js";
5
+ export const useOperationDecoratorRule = createRule({
6
+ name: "use-operation-decorator",
7
+ severity: "warning",
8
+ description: "Validate ARM Resource operations use the correct decorator for the HTTP verb.",
9
+ url: "https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/use-operation-decorator",
10
+ messages: {
11
+ default: paramMessage `Resource ${"verb"} operation must be decorated with ${"decorator"}.`,
12
+ invalidOperationType: paramMessage `Resource ${"verb"} operation decorator ${"decorator"} must use operationType ${"operationType"}.`,
13
+ },
14
+ create(context) {
15
+ return {
16
+ operation: (operation) => {
17
+ if (!isSourceOperationResourceManagerInternal(operation) &&
18
+ !isTemplateInstance(operation)) {
19
+ const verb = getOperationVerb(context.program, operation);
20
+ if (verb && isTemplatedInterfaceOperation(operation) === false) {
21
+ const requiredDecorators = resourceOperationDecorators[verb];
22
+ if (requiredDecorators?.length > 0) {
23
+ const decorator = operation.decorators.find((d) => requiredDecorators.indexOf(d.decorator.name) >= 0);
24
+ if (!decorator && !isArmProviderOperation(context.program, operation)) {
25
+ context.reportDiagnostic({
26
+ messageId: "default",
27
+ target: operation,
28
+ format: {
29
+ verb: verb.toUpperCase(),
30
+ decorator: requiredDecorators.map((d) => `@${d.substring(1)}`).join(" or "),
31
+ },
32
+ });
33
+ }
34
+ else if (decorator) {
35
+ const allowedOperationTypes = operationTypesByVerb[verb];
36
+ const operationType = getGenericDecoratorOperationType(decorator);
37
+ if (allowedOperationTypes !== undefined &&
38
+ operationType !== undefined &&
39
+ !allowedOperationTypes.includes(operationType)) {
40
+ context.reportDiagnostic({
41
+ messageId: "invalidOperationType",
42
+ target: operation,
43
+ format: {
44
+ verb: verb.toUpperCase(),
45
+ decorator: `@${decorator.decorator.name.substring(1)}`,
46
+ operationType: allowedOperationTypes.map((x) => `"${x}"`).join(" or "),
47
+ },
48
+ });
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ },
55
+ };
56
+ },
57
+ });
58
+ // These private ARM decorators cover all operation types and serve as valid alternatives
59
+ // to the public per-verb decorators (e.g. in extension resource, legacy, and built-in operations).
60
+ const genericArmResourceDecorators = [
61
+ "$extensionResourceOperation",
62
+ "$legacyResourceOperation",
63
+ "$builtInResourceOperation",
64
+ "$legacyExtensionResourceOperation",
65
+ ];
66
+ // operationType argument position per decorator signature:
67
+ // - extensionResourceOperation(targetResourceType, extensionResourceType, operationType, ...)
68
+ // - legacyResourceOperation(resourceType, operationType, ...)
69
+ // - builtInResourceOperation(parentResourceType, builtInResourceType, operationType, ...)
70
+ // - legacyExtensionResourceOperation(resourceType, operationType, ...)
71
+ const operationTypeArgIndexByDecorator = {
72
+ $extensionResourceOperation: 2,
73
+ $legacyResourceOperation: 1,
74
+ $builtInResourceOperation: 2,
75
+ $legacyExtensionResourceOperation: 1,
76
+ };
77
+ const resourceOperationDecorators = {
78
+ put: ["$armResourceCreateOrUpdate", ...genericArmResourceDecorators],
79
+ get: ["$armResourceRead", "$armResourceList", ...genericArmResourceDecorators],
80
+ patch: ["$armResourceUpdate", ...genericArmResourceDecorators],
81
+ delete: ["$armResourceDelete", ...genericArmResourceDecorators],
82
+ post: ["$armResourceAction", "$armResourceCollectionAction", ...genericArmResourceDecorators],
83
+ head: [],
84
+ };
85
+ // ARM operationType conventions:
86
+ // - PUT => createOrUpdate
87
+ // - GET => read or list
88
+ // - PATCH => update
89
+ // - DELETE => delete
90
+ // - POST => action
91
+ // This map is used only for generic private decorators that encode operation type as an argument.
92
+ const operationTypesByVerb = {
93
+ put: ["createOrUpdate"],
94
+ get: ["read", "list"],
95
+ patch: ["update"],
96
+ delete: ["delete"],
97
+ post: ["action"],
98
+ };
99
+ function isGenericArmResourceDecorator(name) {
100
+ return genericArmResourceDecorators.includes(name);
101
+ }
102
+ function getGenericDecoratorOperationType(decorator) {
103
+ const decoratorName = decorator.decorator.name;
104
+ if (!isGenericArmResourceDecorator(decoratorName)) {
105
+ return undefined;
106
+ }
107
+ const operationTypeArg = decorator.args[operationTypeArgIndexByDecorator[decoratorName]];
108
+ return getDecoratorArgumentStringValue(operationTypeArg);
109
+ }
110
+ function getDecoratorArgumentStringValue(arg) {
111
+ return typeof arg?.jsValue === "string" ? arg.jsValue : undefined;
112
+ }
113
+ function isStaticSegment(segment) {
114
+ return segment === undefined || segment === "locations";
115
+ }
116
+ function isArmProviderOperation(program, operation) {
117
+ let isProviderAction = false;
118
+ for (const [index, [, property]] of [...operation.parameters.properties].entries()) {
119
+ const segment = getSegment(program, property);
120
+ if (segment === "providers") {
121
+ isProviderAction = true;
122
+ }
123
+ else if (isProviderAction && !isStaticSegment(segment)) {
124
+ return false;
125
+ }
126
+ const isLastSegment = index === operation.parameters.properties.size - 1;
127
+ if (isLastSegment && !segment) {
128
+ return true;
129
+ }
130
+ }
131
+ return false;
132
+ }
133
+ //# sourceMappingURL=use-operation-decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-operation-decorator.js","sourceRoot":"","sources":["../../../src/rules/use-operation-decorator.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EACL,wCAAwC,EACxC,6BAA6B,GAC9B,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAU,CAAC;IAClD,IAAI,EAAE,yBAA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,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACpE,CAAC;AAED,SAAS,eAAe,CAAC,OAA2B;IAClD,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,WAAW,CAAC;AAC1D,CAAC;AAED,SAAS,sBAAsB,CAAC,OAAgB,EAAE,SAAoB;IACpE,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAE7B,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;QACnF,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAE9C,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;YAC5B,gBAAgB,GAAG,IAAI,CAAC;QAC1B,CAAC;aAAM,IAAI,gBAAgB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;YACzD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,aAAa,GAAG,KAAK,KAAK,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC;QACzE,IAAI,aAAa,IAAI,CAAC,OAAO,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-relationship-required-properties.d.ts","sourceRoot":"","sources":["../../../src/rules/use-relationship-required-properties.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qCAAqC;;;yBAqFhD,CAAC"}
1
+ {"version":3,"file":"use-relationship-required-properties.d.ts","sourceRoot":"","sources":["../../../src/rules/use-relationship-required-properties.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,qCAAqC;;;yBAqFhD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { createRule, getProperty, paramMessage } from "@typespec/compiler";
1
+ import { createRule, getProperty, paramMessage, } from "@typespec/compiler";
2
2
  import { getAzureBaseTypes } from "../base-types.js";
3
3
  import { getArmResources } from "../resource.js";
4
4
  export const useRelationshipRequiredPropertiesRule = createRule({
@@ -1 +1 @@
1
- {"version":3,"file":"use-relationship-required-properties.js","sourceRoot":"","sources":["../../../src/rules/use-relationship-required-properties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE3F,OAAO,EAAqB,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,MAAM,CAAC,MAAM,qCAAqC,GAAG,UAAU,CAAC;IAC9D,IAAI,EAAE,sCAAsC;IAC5C,QAAQ,EAAE,SAAS;IACnB,WAAW,EACT,2IAA2I;IAC7I,GAAG,EAAE,yHAAyH;IAC9H,QAAQ,EAAE;QACR,iBAAiB,EAAE,YAAY,CAAA,4DAA4D,SAAS,GAAG;QACvG,YAAY,EAAE,qDAAqD;KACpE;IACD,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,IAAI,EAAE,CAAC,OAAgB,EAAE,EAAE;gBACzB,MAAM,qBAAqB,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAClE,uBAAuB,CAAC,CAAC,CAAC,YAAY,CAAC,CACxC,CAAC;gBAEF,KAAK,MAAM,oBAAoB,IAAI,qBAAqB,EAAE,CAAC;oBACzD,IAAI,oBAAoB,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;wBAC9C,OAAO,CAAC,gBAAgB,CAAC;4BACvB,SAAS,EAAE,cAAc;4BACzB,MAAM,EAAE,oBAAoB,CAAC,YAAY;yBAC1C,CAAC,CAAC;oBACL,CAAC;oBAED,MAAM,UAAU,GAAG,WAAW,CAAC,o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AAC,WAAW,CAAC;gBAAE,OAAO,IAAI,CAAC;YAE5D,IAAI,KAAK,CAAC,SAAS,IAAI,+BAA+B,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC;gBACjF,OAAO,IAAI,CAAC;YACd,CAAC;YAED,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;gBACvB,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;oBACxC,IAAI,+BAA+B,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC;wBAAE,OAAO,IAAI,CAAC;gBAC1E,CAAC;YACH,CAAC;YAED,OAAO,KAAK,CAAC;QACf,CAAC;QAED,SAAS,cAAc,CAAC,KAA0B;YAChD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,KAAK,cAAc,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"use-relationship-required-properties.js","sourceRoot":"","sources":["../../../src/rules/use-relationship-required-properties.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACV,WAAW,EACX,YAAY,GACb,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAA0B,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,MAAM,CAAC,MAAM,qCAAqC,GAAG,UAAU,CAAC;IAC9D,IAAI,EAAE,sCAAsC;IAC5C,QAAQ,EAAE,SAAS;IACnB,WAAW,EACT,2IAA2I;IAC7I,GAAG,EAAE,yHAAyH;IAC9H,QAAQ,EAAE;QACR,iBAAiB,EAAE,YAAY,CAAA,4DAA4D,SAAS,GAAG;QACvG,YAAY,EAAE,qDAAqD;KACpE;IACD,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,IAAI,EAAE,CAAC,OAAgB,EAAE,EAAE;gBACzB,MAAM,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uBAAuB,CAAC,KAAY;YAC3C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAS,CAAC;YACjC,OAAO,+BAA+B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACzD,CAAC;QAED,SAAS,+BAA+B,CAAC,KAAY,EAAE,OAAmB;YACxE,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;gBAAE,OAAO,KAAK,CAAC;YACrC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAEnB,MAAM,WAAW,GAAG,iBAAiB,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC9D,IAAI,WAAW,IAAI,cAAc,CAAC,WAAW,CAAC;gBAAE,OAAO,IAAI,CAAC;YAE5D,IAAI,KAAK,CAAC,SAAS,IAAI,+BAA+B,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC;gBACjF,OAAO,IAAI,CAAC;YACd,CAAC;YAED,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;gBACvB,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;oBACxC,IAAI,+BAA+B,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC;wBAAE,OAAO,IAAI,CAAC;gBAC1E,CAAC;YACH,CAAC;YAED,OAAO,KAAK,CAAC;QACf,CAAC;QAED,SAAS,cAAc,CAAC,KAA0B;YAChD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,KAAK,cAAc,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
- import { DecoratorArgument, Interface, Model, ModelProperty, Namespace, Operation, Program } from "@typespec/compiler";
2
- import { ArmResourceDetails } from "../resource.js";
1
+ import { type DecoratorArgument, type Interface, type Model, type ModelProperty, type Namespace, type Operation, type Program } from "@typespec/compiler";
2
+ import { type ArmResourceDetails } from "../resource.js";
3
3
  /**
4
4
  *
5
5
  *@param target
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/rules/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,SAAS,EAET,KAAK,EACL,aAAa,EACb,SAAS,EACT,SAAS,EACT,OAAO,EACR,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAE,kBAAkB,EAAsB,MAAM,gBAAgB,CAAC;AAExE;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,SAAS,uBAM9D;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,KAAK,WAGpD;AAED,wBAAgB,UAAU,CAAC,YAAY,EAAE,KAAK,WAG7C;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,WAElE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,mBAOzC;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,kBAAkB,yBAUnD;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,aAAa,GAAG,KAAK,GAAG,SAAS,CAOzE;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,aAAa,GAAG,aAAa,CAOxE;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,KAAK,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,GAC9D,OAAO,CAOT;AAED,wBAAgB,wCAAwC,CACtD,SAAS,EAAE,SAAS,GAAG,SAAS,GAC/B,OAAO,CAOT;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,KAAK,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAC1E,MAAM,CAMR;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAG/C;AAQD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ression.ts"],"names":[],"mappings":"AAqBA;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB;;;yBA8CjC,CAAC"}
1
+ {"version":3,"file":"version-progression.d.ts","sourceRoot":"","sources":["../../../src/rules/version-progression.ts"],"names":[],"mappings":"AA2BA;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB;;;yBA8CjC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { createRule, fileRef, paramMessage } from "@typespec/compiler";
1
+ import { createRule, fileRef, paramMessage, } from "@typespec/compiler";
2
2
  import { getVersion } from "@typespec/versioning";
3
3
  /**
4
4
  * Parse a version string of the form "YYYY-MM-DD[-suffix[.N]]" and return its
@@ -1 +1 @@
1
- {"version":3,"file":"version-progression.js","sourceRoot":"","sources":["../../../src/rules/version-progression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE9F,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAQlD;;;;;GAKG;AACH,SAAS,gBAAgB,CAAC,KAAa;IACrC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;IAC5E,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACtC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,UAAU,CAAC;IAC/C,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,kCAAkC,CAAC;IACjE,QAAQ,EAAE,SAAS;IACnB,WAAW,EACT,sHAAsH;IACxH,GAAG,EAAE,wGAAwG;IAC7G,QAAQ,EAAE;QACR,YAAY,EAAE,YAAY,CAAA,YAAY,SAAS,wBAAwB,UAAU,uHAAuH;QACxM,aAAa,EAAE,YAAY,CAAA,YAAY,SAAS,2BAA2B,UAAU,mHAAmH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AM,IAAI,OAAO,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;wBACxC,OAAO,CAAC,gBAAgB,CAAC;4BACvB,SAAS,EAAE,cAAc;4BACzB,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAAG,EAAE;4BACxD,MAAM,EAAE,OAAO,CAAC,UAAU;yBAC3B,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"version-progression.js","sourceRoot":"","sources":["../../../src/rules/version-progression.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EACV,OAAO,EACP,YAAY,GACb,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAQlD;;;;;GAKG;AACH,SAAS,gBAAgB,CAAC,KAAa;IACrC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;IAC5E,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACtC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,UAAU,CAAC;IAC/C,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,kCAAkC,CAAC;IACjE,QAAQ,EAAE,SAAS;IACnB,WAAW,EACT,sHAAsH;IACxH,GAAG,EAAE,wGAAwG;IAC7G,QAAQ,EAAE;QACR,YAAY,EAAE,YAAY,CAAA,YAAY,SAAS,wBAAwB,UAAU,uHAAuH;QACxM,aAAa,EAAE,YAAY,CAAA,YAAY,SAAS,2BAA2B,UAAU,mHAAmH;KACzM;IACD,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,SAAS,EAAE,CAAC,SAAoB,EAAE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,CAAC,gBAAgB,CAAC;4BACvB,SAAS,EAAE,cAAc;4BACzB,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAAG,EAAE;4BACxD,MAAM,EAAE,OAAO,CAAC,UAAU;yBAC3B,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { TypeSpecTestLibrary } from "@typespec/compiler/testing";
1
+ import { type TypeSpecTestLibrary } from "@typespec/compiler/testing";
2
2
  /** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */
3
3
  export declare const AzureResourceManagerTestLibrary: TypeSpecTestLibrary;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAGpB,MAAM,4BAA4B,CAAC;AAEpC,+EAA+E;AAE/E,eAAO,MAAM,+BAA+B,EAAE,mBAG5C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EAGzB,MAAM,4BAA4B,CAAC;AAEpC,+EAA+E;AAE/E,eAAO,MAAM,+BAA+B,EAAE,mBAG5C,CAAC"}
@@ -56,14 +56,11 @@ internal model AgentDefinition {
56
56
  /**
57
57
  * Appliance deployment model of AgentDefinition.
58
58
  * Properties controlled by `@baseTypeOptional` are invisible when the corresponding
59
- * template parameter is false, or read-only when present.
60
- * @template HasModelDeploymentRef Whether the modelDeploymentRef property is present.
59
+ * template parameter is false, or read-only when present. The appliance owns the whole
60
+ * agent definition, so there is no `modelDeploymentRef` property in this deployment model.
61
61
  * @template HasInstructions Whether the instructions property is present.
62
62
  */
63
- model AgentDefinitionAppliance<
64
- HasModelDeploymentRef extends valueof boolean = false,
65
- HasInstructions extends valueof boolean = false
66
- > {
63
+ model AgentDefinitionAppliance<HasInstructions extends valueof boolean = false> {
67
64
  /** Model identifier (RP-defined). */
68
65
  @visibility(Lifecycle.Read)
69
66
  `model`: string;
@@ -71,10 +68,6 @@ model AgentDefinitionAppliance<
71
68
  /** System prompt / behavioral instructions for the agent. */
72
69
  @baseTypeOptional(HasInstructions, true)
73
70
  instructions: string;
74
-
75
- /** Optional RP-specific reference to an underlying model deployment. */
76
- @baseTypeOptional(HasModelDeploymentRef, true)
77
- modelDeploymentRef?: string;
78
71
  }
79
72
 
80
73
  /**
@@ -44,7 +44,7 @@ model BaseTypeInfo {
44
44
  *
45
45
  * ```typespec
46
46
  * // Agent definition and properties using the Appliance deployment model
47
- * model ContosoApplianceDefinition is AgentDefinitionAppliance<true, true>;
47
+ * model ContosoApplianceDefinition is AgentDefinitionAppliance<true>;
48
48
  * model ContosoApplianceProperties is AgentPropertiesAppliance<ContosoApplianceDefinition> {
49
49
  * ...DefaultProvisioningStateProperty;
50
50
  * }
@@ -0,0 +1,211 @@
1
+ using Azure.Core;
2
+ using Versioning;
3
+
4
+ namespace Azure.ResourceManager.CommonTypes;
5
+
6
+ /**
7
+ * Billing Data
8
+ */
9
+ @added(Versions.v6)
10
+ model BillingData {
11
+ /**
12
+ * The system ID of the resource. Globally unique per cloud.
13
+ */
14
+ @visibility(Lifecycle.Read)
15
+ systemId?: uuid;
16
+
17
+ /**
18
+ * Indicates the billing state of the resource.
19
+ */
20
+ @visibility(Lifecycle.Read)
21
+ state?: BillingState = BillingState.Pending;
22
+
23
+ /**
24
+ * Indicates reason(s) for the current billing state of the resource.
25
+ */
26
+ @visibility(Lifecycle.Read)
27
+ reasons?: BillingStateReason[];
28
+
29
+ /**
30
+ * The product identifier referencing a product in the catalog.
31
+ */
32
+ productCode: uuid;
33
+
34
+ /**
35
+ * Product token (JWT) identifying a specific version of the product.
36
+ */
37
+ @visibility(Lifecycle.Create, Lifecycle.Update)
38
+ productToken?: string;
39
+
40
+ /**
41
+ * The number of instances of the product.
42
+ */
43
+ quantity: int64 = 1;
44
+
45
+ /**
46
+ * Start date indicating the beginning of the term for which the resource is committed.
47
+ */
48
+ startDate?: utcDateTime;
49
+
50
+ /**
51
+ * End date indicating the end of the term for which the resource is committed.
52
+ */
53
+ endDate?: utcDateTime;
54
+
55
+ /**
56
+ * Billing token (JWT) representing additional billing context.
57
+ */
58
+ @visibility(Lifecycle.Create, Lifecycle.Update)
59
+ billingToken?: string;
60
+
61
+ /**
62
+ * The resource's billing schedule.
63
+ */
64
+ schedule?: BillingSchedule;
65
+ }
66
+
67
+ /**
68
+ * Billing schedule.
69
+ */
70
+ @added(Versions.v6)
71
+ model BillingSchedule {
72
+ /**
73
+ * Indicates the renewal behavior of this resource.
74
+ */
75
+ renewal: BillingRenewalType = BillingRenewalType.Automatic;
76
+
77
+ /**
78
+ * Schedules billing changes for this resource.
79
+ */
80
+ changes?: BillingScheduleChange[];
81
+ }
82
+
83
+ /**
84
+ * Billing schedule change.
85
+ */
86
+ @added(Versions.v6)
87
+ model BillingScheduleChange {
88
+ /**
89
+ * Indicates when the change is expected to become effective.
90
+ */
91
+ effective: BillingScheduleChangeEffectiveType = BillingScheduleChangeEffectiveType.Renewal;
92
+
93
+ /**
94
+ * The absolute date when the change is expected to become effective. Required when `effective` = `AbsoluteDate`.
95
+ */
96
+ effectiveDate?: utcDateTime;
97
+
98
+ /**
99
+ * The kind of change.
100
+ */
101
+ kind: BillingScheduleChangeKind = BillingScheduleChangeKind.Update;
102
+
103
+ /**
104
+ * The new product identifier. When not specified, the resource's product code remains unchanged.
105
+ */
106
+ productCode?: uuid;
107
+
108
+ /**
109
+ * Product token (JWT) identifying a specific version of the scheduled product. Can only be
110
+ * specified when productCode is specified also.
111
+ */
112
+ @visibility(Lifecycle.Create, Lifecycle.Update)
113
+ productToken?: string;
114
+
115
+ /**
116
+ * The new number of instances of the product. When not specified, the resource's quantity remains unchanged.
117
+ */
118
+ quantity?: int64;
119
+
120
+ /**
121
+ * The new (coterminous) end date of the product. Can only be specified when effective = renewal.
122
+ * When not specified, the resource's end date is calculated based on the renewal date and the
123
+ * product's term duration.
124
+ */
125
+ endDate?: utcDateTime;
126
+
127
+ /**
128
+ * Billing token (JWT) representing additional billing context.
129
+ */
130
+ @visibility(Lifecycle.Create, Lifecycle.Update)
131
+ billingToken?: string;
132
+ }
133
+
134
+ /**
135
+ * Billing state.
136
+ */
137
+ @added(Versions.v6)
138
+ union BillingState {
139
+ /** Resource's billing has not yet started. */
140
+ Pending: "Pending",
141
+
142
+ /** Resource's billing is activate. */
143
+ Active: "Active",
144
+
145
+ /** Resource's billing is in a warning state. */
146
+ Warned: "Warned",
147
+
148
+ /** Resource's billing is inactive. */
149
+ Inactive: "Inactive",
150
+
151
+ string,
152
+ }
153
+
154
+ /**
155
+ * Billing state reason.
156
+ */
157
+ @added(Versions.v6)
158
+ union BillingStateReason {
159
+ /** Resource's billing has been suspended by Microsoft. */
160
+ Suspended: "Suspended",
161
+
162
+ /** Resource has been canceled by the customer. */
163
+ Canceled: "Canceled",
164
+
165
+ /** Resource's billing has expired. */
166
+ Expired: "Expired",
167
+
168
+ string,
169
+ }
170
+
171
+ /**
172
+ * Type of renewal.
173
+ */
174
+ @added(Versions.v6)
175
+ union BillingRenewalType {
176
+ /** Automatically renew the product when its term ends. */
177
+ Automatic: "Automatic",
178
+
179
+ /** Don't automatically renew the product. */
180
+ None: "None",
181
+
182
+ string,
183
+ }
184
+
185
+ /**
186
+ * When a scheduled change is expected to become effective.
187
+ */
188
+ @added(Versions.v6)
189
+ union BillingScheduleChangeEffectiveType {
190
+ /** At a specified date. */
191
+ AbsoluteDate: "AbsoluteDate",
192
+
193
+ /** At time of term renewal. */
194
+ Renewal: "Renewal",
195
+
196
+ string,
197
+ }
198
+
199
+ /**
200
+ * Type of scheduled change.
201
+ */
202
+ @added(Versions.v6)
203
+ union BillingScheduleChangeKind {
204
+ /** Update the resource. */
205
+ Update: "Update",
206
+
207
+ /** Cancel the resource. */
208
+ Cancel: "Cancel",
209
+
210
+ string,
211
+ }
@@ -12,5 +12,5 @@ import "./versions.tsp";
12
12
  import "./mobo-ref.tsp";
13
13
  import "./network-security-perimeter-ref.tsp";
14
14
  import "./nsp-operations.tsp";
15
-
15
+ import "./billing-data.tsp";
16
16
  namespace Azure.ResourceManager.CommonTypes;
@@ -6,6 +6,7 @@ namespace Azure.ResourceManager.CommonTypes;
6
6
  /** Managed service identity (system assigned and/or user assigned identities and/or delegated identities) - internal use only. */
7
7
  @added(Versions.v4)
8
8
  model ManagedServiceIdentityWithDelegation extends ManagedServiceIdentity {
9
+ /** The delegated resources of the identity - internal use only. */
9
10
  delegatedResources?: DelegatedResources;
10
11
  }
11
12
 
@@ -24,12 +24,26 @@ union AccessRuleDirection {
24
24
  @added(Versions.v5)
25
25
  union NetworkSecurityPerimeterConfigurationProvisioningState {
26
26
  string,
27
+
28
+ /** The configuration was provisioned successfully. */
27
29
  Succeeded: "Succeeded",
30
+
31
+ /** The configuration is being created. */
28
32
  Creating: "Creating",
33
+
34
+ /** The configuration is being updated. */
29
35
  Updating: "Updating",
36
+
37
+ /** The configuration is being deleted. */
30
38
  Deleting: "Deleting",
39
+
40
+ /** The configuration request was accepted and provisioning has not started yet. */
31
41
  Accepted: "Accepted",
42
+
43
+ /** The configuration failed to provision. */
32
44
  Failed: "Failed",
45
+
46
+ /** The configuration provisioning was canceled. */
33
47
  Canceled: "Canceled",
34
48
  }
35
49
 
@@ -55,7 +69,11 @@ union IssueType {
55
69
  @added(Versions.v5)
56
70
  union Severity {
57
71
  string,
72
+
73
+ /** The issue is a warning and does not prevent the configuration from being applied. */
58
74
  Warning: "Warning",
75
+
76
+ /** The issue is an error and prevents the configuration from being applied. */
59
77
  Error: "Error",
60
78
  }
61
79
 
@@ -95,12 +113,14 @@ model AccessRule {
95
113
  /** Name of the access rule */
96
114
  name?: string;
97
115
 
116
+ /** Properties of the access rule */
98
117
  properties?: AccessRuleProperties;
99
118
  }
100
119
 
101
120
  /** Properties of Access Rule */
102
121
  @added(Versions.v5)
103
122
  model AccessRuleProperties {
123
+ /** Direction of the access rule */
104
124
  direction?: AccessRuleDirection;
105
125
 
106
126
  /** Address prefixes in the CIDR format for inbound rules */
@@ -146,12 +166,14 @@ model NetworkSecurityPerimeter {
146
166
  /** Network security perimeter (NSP) configuration resource */
147
167
  @added(Versions.v5)
148
168
  model NetworkSecurityPerimeterConfiguration extends ProxyResource {
169
+ /** Network security configuration properties. */
149
170
  properties?: NetworkSecurityPerimeterConfigurationProperties;
150
171
  }
151
172
 
152
173
  /** Network security configuration properties. */
153
174
  @added(Versions.v5)
154
175
  model NetworkSecurityPerimeterConfigurationProperties {
176
+ /** Provisioning state of the network security perimeter configuration */
155
177
  @visibility(Lifecycle.Read)
156
178
  provisioningState?: NetworkSecurityPerimeterConfigurationProvisioningState;
157
179
 
@@ -160,8 +182,13 @@ model NetworkSecurityPerimeterConfigurationProperties {
160
182
  @Azure.ResourceManager.identifiers(#[])
161
183
  provisioningIssues?: ProvisioningIssue[];
162
184
 
185
+ /** Information about the network security perimeter (NSP) */
163
186
  networkSecurityPerimeter?: NetworkSecurityPerimeter;
187
+
188
+ /** Information about the resource association */
164
189
  resourceAssociation?: ResourceAssociation;
190
+
191
+ /** Network security perimeter configuration profile */
165
192
  profile?: NetworkSecurityProfile;
166
193
  }
167
194
 
@@ -172,6 +199,7 @@ model ProvisioningIssue {
172
199
  @visibility(Lifecycle.Read)
173
200
  name?: string;
174
201
 
202
+ /** Details of the provisioning issue */
175
203
  @visibility(Lifecycle.Read)
176
204
  properties?: ProvisioningIssueProperties;
177
205
  }
@@ -207,6 +235,7 @@ model ResourceAssociation {
207
235
  /** Name of the resource association */
208
236
  name?: string;
209
237
 
238
+ /** Access mode of the resource association */
210
239
  accessMode?: ResourceAssociationAccessMode;
211
240
  }
212
241
 
@@ -80,10 +80,14 @@ model ResourceModelWithAllowedPropertySet extends TrackedResource {
80
80
  @visibility(Lifecycle.Read)
81
81
  etag?: string;
82
82
 
83
+ /** The identity of the resource. */
83
84
  @typeChangedFrom(Versions.v6, Identity)
84
85
  identity?: ManagedServiceIdentity;
85
86
 
87
+ /** The SKU of the resource. */
86
88
  sku?: Sku;
89
+
90
+ /** The plan of the resource. */
87
91
  plan?: Plan;
88
92
  }
89
93
 
@@ -346,6 +350,7 @@ union createdByType {
346
350
 
347
351
  /** Resource Identity Type */
348
352
  union ResourceIdentityType {
353
+ /** The identity is assigned by the system. */
349
354
  SystemAssigned: "SystemAssigned",
350
355
  }
351
356
 
@@ -173,6 +173,7 @@ model ExternalResource<
173
173
  Description extends valueof string = "The name of the resource",
174
174
  ParentType extends valueof "Tenant" | "Subscription" | "ResourceGroup" = "ResourceGroup"
175
175
  > {
176
+ /** The name of the resource. */
176
177
  @doc(Description)
177
178
  @visibility(Lifecycle.Read)
178
179
  @path
@@ -223,6 +224,7 @@ model ExternalChildResource<
223
224
  NameType extends string = string,
224
225
  Description extends valueof string = "The name of the resource"
225
226
  > {
227
+ /** The name of the resource. */
226
228
  @doc(Description)
227
229
  @visibility(Lifecycle.Read)
228
230
  @path
@@ -190,6 +190,7 @@ model ProxyResourceUpdateModel<
190
190
  Resource extends Foundations.SimpleResource,
191
191
  Properties extends TypeSpec.Reflection.Model
192
192
  > {
193
+ /** The resource-specific properties for this resource. */
193
194
  properties?: ResourceUpdateModelProperties<Resource, Properties>;
194
195
  }
195
196