@azure-tools/typespec-azure-resource-manager 0.74.0-dev.8 → 0.74.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 (56) hide show
  1. package/README.md +10 -2
  2. package/dist/src/linter.d.ts.map +1 -1
  3. package/dist/src/linter.js +16 -0
  4. package/dist/src/linter.js.map +1 -1
  5. package/dist/src/resource.d.ts.map +1 -1
  6. package/dist/src/resource.js +38 -79
  7. package/dist/src/resource.js.map +1 -1
  8. package/dist/src/rules/arm-custom-resource-usage-discourage.js +3 -20
  9. package/dist/src/rules/arm-custom-resource-usage-discourage.js.map +1 -1
  10. package/dist/src/rules/arm-resource-invalid-envelope-property.d.ts.map +1 -1
  11. package/dist/src/rules/arm-resource-invalid-envelope-property.js +12 -3
  12. package/dist/src/rules/arm-resource-invalid-envelope-property.js.map +1 -1
  13. package/dist/src/rules/lro-missing-polling-metadata.d.ts +4 -0
  14. package/dist/src/rules/lro-missing-polling-metadata.d.ts.map +1 -0
  15. package/dist/src/rules/lro-missing-polling-metadata.js +59 -0
  16. package/dist/src/rules/lro-missing-polling-metadata.js.map +1 -0
  17. package/dist/src/rules/no-empty-post-response.d.ts +4 -0
  18. package/dist/src/rules/no-empty-post-response.d.ts.map +1 -0
  19. package/dist/src/rules/no-empty-post-response.js +38 -0
  20. package/dist/src/rules/no-empty-post-response.js.map +1 -0
  21. package/dist/src/rules/no-repeated-path-info.d.ts +4 -0
  22. package/dist/src/rules/no-repeated-path-info.d.ts.map +1 -0
  23. package/dist/src/rules/no-repeated-path-info.js +63 -0
  24. package/dist/src/rules/no-repeated-path-info.js.map +1 -0
  25. package/dist/src/rules/no-reserved-resource-property.d.ts.map +1 -1
  26. package/dist/src/rules/no-reserved-resource-property.js +2 -1
  27. package/dist/src/rules/no-reserved-resource-property.js.map +1 -1
  28. package/dist/src/rules/no-resource-duplicates.d.ts +4 -0
  29. package/dist/src/rules/no-resource-duplicates.d.ts.map +1 -0
  30. package/dist/src/rules/no-resource-duplicates.js +48 -0
  31. package/dist/src/rules/no-resource-duplicates.js.map +1 -0
  32. package/dist/src/rules/no-resource-name-conflict.d.ts +4 -0
  33. package/dist/src/rules/no-resource-name-conflict.d.ts.map +1 -0
  34. package/dist/src/rules/no-resource-name-conflict.js +52 -0
  35. package/dist/src/rules/no-resource-name-conflict.js.map +1 -0
  36. package/dist/src/rules/no-response-body.d.ts +2 -1
  37. package/dist/src/rules/no-response-body.d.ts.map +1 -1
  38. package/dist/src/rules/no-response-body.js +20 -13
  39. package/dist/src/rules/no-response-body.js.map +1 -1
  40. package/dist/src/rules/private-endpoint-apis-missing.d.ts +4 -0
  41. package/dist/src/rules/private-endpoint-apis-missing.d.ts.map +1 -0
  42. package/dist/src/rules/private-endpoint-apis-missing.js +90 -0
  43. package/dist/src/rules/private-endpoint-apis-missing.js.map +1 -0
  44. package/dist/src/rules/use-scope-path-standard-name.d.ts +5 -0
  45. package/dist/src/rules/use-scope-path-standard-name.d.ts.map +1 -0
  46. package/dist/src/rules/use-scope-path-standard-name.js +46 -0
  47. package/dist/src/rules/use-scope-path-standard-name.js.map +1 -0
  48. package/dist/src/rules/use-standard-error.d.ts +5 -0
  49. package/dist/src/rules/use-standard-error.d.ts.map +1 -0
  50. package/dist/src/rules/use-standard-error.js +66 -0
  51. package/dist/src/rules/use-standard-error.js.map +1 -0
  52. package/dist/src/rules/utils.d.ts +2 -0
  53. package/dist/src/rules/utils.d.ts.map +1 -1
  54. package/dist/src/rules/utils.js +16 -0
  55. package/dist/src/rules/utils.js.map +1 -1
  56. package/package.json +19 -19
@@ -8,6 +8,7 @@ import { getProperties } from "./utils.js";
8
8
  */
9
9
  const reservedProperties = new Map([
10
10
  ["billingData", "platform billing integration"],
11
+ ["systemData", "resource system metadata"],
11
12
  ]);
12
13
  /**
13
14
  * Case-insensitive lookup keyed by the lowercased reserved name. Both the reserved names and the
@@ -18,7 +19,7 @@ const reservedPropertiesByLowerName = new Map([...reservedProperties].map(([name
18
19
  export const noReservedResourcePropertyRule = createRule({
19
20
  name: "no-reserved-resource-property",
20
21
  docs: fileRef.fromPackageRoot("src/rules/no-reserved-resource-property.md"),
21
- description: "Reserved property names (for example 'billingData') must not be present in a resource's property bag. The property name is matched case-insensitively.",
22
+ description: "Reserved property names must not be present in a resource's property bag. The property name is matched case-insensitively.",
22
23
  severity: "warning",
23
24
  url: "https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/no-reserved-resource-property",
24
25
  messages: {
@@ -1 +1 @@
1
- {"version":3,"file":"no-reserved-resource-property.js","sourceRoot":"","sources":["../../../src/rules/no-reserved-resource-property.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEhG,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAiB;IACjD,CAAC,aAAa,EAAE,8BAA8B,CAAC;CAChD,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,6BAA6B,GAAG,IAAI,GAAG,CAC3C,CAAC,GAAG,kBAAkB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CACxF,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG,UAAU,CAAC;IACvD,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,4CAA4C,CAAC;IAC3E,WAAW,EACT,wJAAwJ;IAC1J,QAAQ,EAAE,SAAS;IACnB,GAAG,EAAE,kHAAkH;IACvH,QAAQ,EAAE;QACR,OAAO,EAAE,YAAY,CAAA,aAAa,cAAc,qFAAqF,QAAQ,GAAG;KACjJ;IACD,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,KAAK,EAAE,CAAC,KAAY,EAAE,EAAE;gBACtB,MAAM,aAAa,GAAG,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;gBAC7D,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;oBAChC,OAAO;gBACT,CAAC;gBAED,MAAM,kBAAkB,GAAG,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,IAAI,CAAC;gBAClE,IAAI,kBAAkB,KAAK,SAAS,IAAI,kBAAkB,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;oBAC5E,OAAO;gBACT,CAAC;gBAED,KAAK,MAAM,QAAQ,IAAI,aAAa,CAAC,kBAAkB,CAAC,EAAE,CAAC;oBACzD,MAAM,QAAQ,GAAG,6BAA6B,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;oBAChF,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;wBAC3B,OAAO,CAAC,gBAAgB,CAAC;4BACvB,MAAM,EAAE,EAAE,YAAY,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE;4BAChE,MAAM,EAAE,QAAQ;yBACjB,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"no-reserved-resource-property.js","sourceRoot":"","sources":["../../../src/rules/no-reserved-resource-property.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEhG,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;GAIG;AACH,MAAM,kB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IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;oBAChF,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;wBAC3B,OAAO,CAAC,gBAAgB,CAAC;4BACvB,MAAM,EAAE,EAAE,YAAY,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE;4BAChE,MAAM,EAAE,QAAQ;yBACjB,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const noResourceDuplicatesRule: import("@typespec/compiler").LinterRuleDefinition<"no-resource-duplicates", {
2
+ readonly default: import("@typespec/compiler").CallableMessage<["name", "resourceType", "path", "firstName"]>;
3
+ }, Record<string, never>>;
4
+ //# sourceMappingURL=no-resource-duplicates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-resource-duplicates.d.ts","sourceRoot":"","sources":["../../../src/rules/no-resource-duplicates.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,wBAAwB;;yBA+CnC,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { createRule, fileRef, paramMessage } from "@typespec/compiler";
2
+ import { resolveArmResources } from "../resource.js";
3
+ import { isInternalTypeSpec } from "./utils.js";
4
+ export const noResourceDuplicatesRule = createRule({
5
+ name: "no-resource-duplicates",
6
+ description: "ARM resource instances must resolve to a single resource per resource type and instance path.",
7
+ severity: "warning",
8
+ url: "https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/no-resource-duplicates",
9
+ docs: fileRef.fromPackageRoot("src/rules/no-resource-duplicates.md"),
10
+ messages: {
11
+ default: paramMessage `Resource '${"name"}' resolves to the same resource type '${"resourceType"}' and instance path '${"path"}' as resource '${"firstName"}'. Use consistent resource names and operation templates so this instance resolves to a single resource.`,
12
+ },
13
+ create(context) {
14
+ return {
15
+ root(program) {
16
+ const firstResources = new Map();
17
+ for (const resource of resolveArmResources(program).resources ?? []) {
18
+ const lifecycle = resource.operations.lifecycle;
19
+ const target = [...(lifecycle.read ?? []), ...(lifecycle.createOrUpdate ?? [])].find(({ operation }) => !isInternalTypeSpec(program, operation))?.operation;
20
+ // Synthetic ancestors have no identity operation of their own.
21
+ if (target === undefined)
22
+ continue;
23
+ const resourceType = `${resource.resourceType.provider}/${resource.resourceType.types.join("/")}`;
24
+ // Retain parameter names; the resolver's structural normalizer removes them.
25
+ const key = JSON.stringify([
26
+ resourceType.toLowerCase(),
27
+ resource.resourceInstancePath.toLowerCase(),
28
+ ]);
29
+ const first = firstResources.get(key);
30
+ if (first === undefined) {
31
+ firstResources.set(key, resource);
32
+ continue;
33
+ }
34
+ context.reportDiagnostic({
35
+ target,
36
+ format: {
37
+ name: resource.resourceName,
38
+ firstName: first.resourceName,
39
+ resourceType,
40
+ path: resource.resourceInstancePath,
41
+ },
42
+ });
43
+ }
44
+ },
45
+ };
46
+ },
47
+ });
48
+ //# sourceMappingURL=no-resource-duplicates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-resource-duplicates.js","sourceRoot":"","sources":["../../../src/rules/no-resource-duplicates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAyB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,CAAC,MAAM,wBAAwB,GAAG,UAAU,CAAC;IACjD,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EACT,+FAA+F;IACjG,QAAQ,EAAE,SAAS;IACnB,GAAG,EAAE,2GAA2G;IAChH,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,qCAAqC,CAAC;IACpE,QAAQ,EAAE;QACR,OAAO,EAAE,YAAY,CAAA,aAAa,MAAM,yCAAyC,cAAc,wBAAwB,MAAM,kBAAkB,WAAW,0GAA0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E,KAAK,CAAC,YAAY;4BAC7B,YAAY;4BACZ,IAAI,EAAE,QAAQ,CAAC,oBAAoB;yBACpC;qBACF,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const noResourceNameConflictRule: import("@typespec/compiler").LinterRuleDefinition<"no-resource-name-conflict", {
2
+ readonly default: import("@typespec/compiler").CallableMessage<["name", "firstPath", "secondPath"]>;
3
+ }, Record<string, never>>;
4
+ //# sourceMappingURL=no-resource-name-conflict.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-resource-name-conflict.d.ts","sourceRoot":"","sources":["../../../src/rules/no-resource-name-conflict.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,0BAA0B;;yBAgDrC,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { createRule, fileRef, listServices, paramMessage } from "@typespec/compiler";
2
+ import { isArmProviderNamespace } from "../namespace.js";
3
+ import { resolveArmResources } from "../resource.js";
4
+ import { isInternalTypeSpec } from "./utils.js";
5
+ export const noResourceNameConflictRule = createRule({
6
+ name: "no-resource-name-conflict",
7
+ description: "ARM resources must have unique logical resource names.",
8
+ severity: "warning",
9
+ url: "https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/no-resource-name-conflict",
10
+ docs: fileRef.fromPackageRoot("src/rules/no-resource-name-conflict.md"),
11
+ messages: {
12
+ default: paramMessage `Resources must have unique names. Resource name '${"name"}' is used by both '${"firstPath"}' and '${"secondPath"}'. Provide a unique resource name when instantiating the resource operations.`,
13
+ },
14
+ create(context) {
15
+ return {
16
+ root(program) {
17
+ const services = new Set(listServices(program)
18
+ .filter(({ type }) => isArmProviderNamespace(program, type))
19
+ .map(({ type }) => type));
20
+ const names = new Map();
21
+ for (const resource of resolveArmResources(program).resources ?? []) {
22
+ const operation = resource.operations.lifecycle.read?.[0]?.operation ??
23
+ resource.operations.lifecycle.createOrUpdate?.[0]?.operation;
24
+ // Synthetic parents have no identity operation and no author-controlled template name.
25
+ if (operation === undefined || isInternalTypeSpec(program, operation))
26
+ continue;
27
+ let namespace = operation.namespace;
28
+ while (namespace !== undefined && !services.has(namespace)) {
29
+ namespace = namespace.namespace;
30
+ }
31
+ if (namespace === undefined)
32
+ continue;
33
+ const first = names.get(resource.resourceName);
34
+ if (first === undefined) {
35
+ names.set(resource.resourceName, resource);
36
+ }
37
+ else {
38
+ context.reportDiagnostic({
39
+ target: operation,
40
+ format: {
41
+ name: resource.resourceName,
42
+ firstPath: first.resourceInstancePath,
43
+ secondPath: resource.resourceInstancePath,
44
+ },
45
+ });
46
+ }
47
+ }
48
+ },
49
+ };
50
+ },
51
+ });
52
+ //# sourceMappingURL=no-resource-name-conflict.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-resource-name-conflict.js","sourceRoot":"","sources":["../../../src/rules/no-resource-name-conflict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAyB,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAAC;IACnD,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,wDAAwD;IACrE,QAAQ,EAAE,SAAS;IACnB,GAAG,EAAE,8GAA8G;IACnH,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,wCAAwC,CAAC;IACvE,QAAQ,EAAE;QACR,OAAO,EAAE,YAAY,CAAA,oDAAoD,MAAM,sBAAsB,WAAW,UAAU,YAAY,+EAA+E;KACtN;IACD,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,IAAI,CAAC,OAAO;gBACV,MAAM,QAAQ,GAAG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E;gCACN,IAAI,EAAE,QAAQ,CAAC,YAAY;gCAC3B,SAAS,EAAE,KAAK,CAAC,oBAAoB;gCACrC,UAAU,EAAE,QAAQ,CAAC,oBAAoB;6BAC1C;yBACF,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -1,9 +1,10 @@
1
1
  /**
2
- * verify that 202 or 204 responses do not contain a response body.
2
+ * verify that 202, 204 and DELETE 200 responses do not contain a response body.
3
3
  * verify that success (2XX) responses other than 202 and 204 contain a response body.
4
4
  */
5
5
  export declare const noResponseBodyRule: import("@typespec/compiler").LinterRuleDefinition<"no-response-body", {
6
6
  readonly default: "The body of responses with success (2xx) status codes other than 202 and 204 should not be empty.";
7
+ readonly shouldBeEmpty200: "The body of 200 response for DELETE should be empty.";
7
8
  readonly shouldBeEmpty202: "The body of 202 response should be empty.";
8
9
  readonly shouldBeEmpty204: "The body of 204 response should be empty.";
9
10
  }, Record<string, never>>;
@@ -1 +1 @@
1
- {"version":3,"file":"no-response-body.d.ts","sourceRoot":"","sources":["../../../src/rules/no-response-body.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;yBAqD7B,CAAC"}
1
+ {"version":3,"file":"no-response-body.d.ts","sourceRoot":"","sources":["../../../src/rules/no-response-body.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;yBAyD7B,CAAC"}
@@ -1,45 +1,52 @@
1
1
  import { createRule, fileRef, isTemplateInstance } from "@typespec/compiler";
2
- import { getHttpOperation, getResponsesForOperation, } from "@typespec/http";
2
+ import { getHttpOperation } from "@typespec/http";
3
3
  import { isTemplatedInterfaceOperation } from "./utils.js";
4
4
  /**
5
- * verify that 202 or 204 responses do not contain a response body.
5
+ * verify that 202, 204 and DELETE 200 responses do not contain a response body.
6
6
  * verify that success (2XX) responses other than 202 and 204 contain a response body.
7
7
  */
8
8
  export const noResponseBodyRule = createRule({
9
9
  name: "no-response-body",
10
10
  docs: fileRef.fromPackageRoot("src/rules/no-response-body.md"),
11
- description: "Check that the body is empty for 202 and 204 responses, and not empty for other success (2xx) responses.",
11
+ description: "Check that 202, 204 and DELETE 200 responses have no body, and other success (2xx) responses have a body except for HEAD and POST 200.",
12
12
  url: "https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/no-response-body",
13
13
  severity: "warning",
14
14
  messages: {
15
15
  default: `The body of responses with success (2xx) status codes other than 202 and 204 should not be empty.`,
16
+ shouldBeEmpty200: `The body of 200 response for DELETE should be empty.`,
16
17
  shouldBeEmpty202: `The body of 202 response should be empty.`,
17
18
  shouldBeEmpty204: `The body of 204 response should be empty.`,
18
19
  },
19
20
  create(context) {
20
21
  return {
21
22
  operation: (op) => {
23
+ if (isTemplateInstance(op) || isTemplatedInterfaceOperation(op))
24
+ return;
22
25
  const [httpOperation] = getHttpOperation(context.program, op);
23
- if (isTemplateInstance(op) ||
24
- isTemplatedInterfaceOperation(op) ||
25
- httpOperation.verb === "head")
26
+ if (httpOperation.verb === "head")
26
27
  return;
27
- const responses = getResponsesForOperation(context.program, op)[0].find((v) => v.statusCodes !== 204 && v.statusCodes !== 202);
28
- if (responses && !responses.responses.every((v) => v.body)) {
29
- if (["delete", "post"].includes(httpOperation.verb) && responses.statusCodes === 200) {
30
- return;
31
- }
28
+ const responses = httpOperation.responses;
29
+ const response = responses.find((v) => v.statusCodes !== 204 && v.statusCodes !== 202);
30
+ if (response &&
31
+ !response.responses.every((v) => v.body) &&
32
+ !(["delete", "post"].includes(httpOperation.verb) && response.statusCodes === 200)) {
33
+ context.reportDiagnostic({
34
+ target: op,
35
+ });
36
+ }
37
+ if (httpOperation.verb === "delete" && hasResponseBodyForCode(200, responses)) {
32
38
  context.reportDiagnostic({
33
39
  target: op,
40
+ messageId: "shouldBeEmpty200",
34
41
  });
35
42
  }
36
- if (hasResponseBodyForCode(202, getResponsesForOperation(context.program, op)[0])) {
43
+ if (hasResponseBodyForCode(202, responses)) {
37
44
  context.reportDiagnostic({
38
45
  target: op,
39
46
  messageId: "shouldBeEmpty202",
40
47
  });
41
48
  }
42
- if (hasResponseBodyForCode(204, getResponsesForOperation(context.program, op)[0])) {
49
+ if (hasResponseBodyForCode(204, responses)) {
43
50
  context.reportDiagnostic({
44
51
  target: op,
45
52
  messageId: "shouldBeEmpty204",
@@ -1 +1 @@
1
- {"version":3,"file":"no-response-body.js","sourceRoot":"","sources":["../../../src/rules/no-response-body.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,kBAAkB,EAAkB,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EACL,gBAAgB,EAChB,wBAAwB,GAEzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAC3D;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC;IAC3C,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,+BAA+B,CAAC;IAC9D,WAAW,EACT,0GAA0G;IAC5G,GAAG,EAAE,qGAAqG;IAC1G,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE;QACR,OAAO,EAAE,mGAAmG;QAC5G,gBAAgB,EAAE,2CAA2C;QAC7D,gBAAgB,EAAE,2CAA2C;KAC9D;IACD,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,SAAS,EAAE,CAAC,EAAa,EAAE,EAAE;gBAC3B,MAAM,CAAC,aAAa,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAC9D,IACE,kBAAkB,CAAC,EAAE,CAAC;oBACtB,6BAA6B,CAAC,EAAE,CAAC;oBACjC,aAAa,CAAC,IAAI,KAAK,MAAM;oBAE7B,OAAO;gBAET,MAAM,SAAS,GAAG,wBAAwB,CAAC,OAAO,CAAC,OAAO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,CAAC,WAAW,KAAK,UAAU,CAAC,CAAC;IACtE,OAAO,CAAC,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAChE,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const privateEndpointApisMissingRule: import("@typespec/compiler").LinterRuleDefinition<"private-endpoint-apis-missing", {
2
+ readonly default: import("@typespec/compiler").CallableMessage<["apiPath"]>;
3
+ }, Record<string, never>>;
4
+ //# sourceMappingURL=private-endpoint-apis-missing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private-endpoint-apis-missing.d.ts","sourceRoot":"","sources":["../../../src/rules/private-endpoint-apis-missing.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,8BAA8B;;yBAyDzC,CAAC"}
@@ -0,0 +1,90 @@
1
+ import { createRule, fileRef, paramMessage, } from "@typespec/compiler";
2
+ import { getArmResourceOperationData } from "../operations.js";
3
+ import { getResourceOperation } from "../resource.js";
4
+ const privateEndpointConnectionPathRegExp = /^(.*)\/privateEndpointConnections\/\{[^/]+\}$/i;
5
+ const privateEndpointConnectionsPathRegExp = /^(.*)\/privateEndpointConnections$/i;
6
+ const privateLinkResourcesPathRegExp = /^(.*)\/privateLinkResources$/i;
7
+ export const privateEndpointApisMissingRule = createRule({
8
+ name: "private-endpoint-apis-missing",
9
+ docs: fileRef.fromPackageRoot("src/rules/private-endpoint-apis-missing.md"),
10
+ url: "https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/private-endpoint-apis-missing",
11
+ description: "Services that expose private endpoint APIs must implement the private endpoint connection collection, point, and private link resource collection APIs together.",
12
+ severity: "warning",
13
+ messages: {
14
+ default: paramMessage `The private endpoint API: ${"apiPath"} is missing.`,
15
+ },
16
+ create(context) {
17
+ const supportedResources = new Map();
18
+ return {
19
+ operation(operation) {
20
+ if (getArmResourceOperationData(context.program, operation) === undefined) {
21
+ return;
22
+ }
23
+ const resourceOperation = getResourceOperation(context.program, operation);
24
+ if (resourceOperation !== undefined) {
25
+ collectPath(supportedResources, resourceOperation);
26
+ }
27
+ },
28
+ exit() {
29
+ for (const [basePath, apiSet] of supportedResources.entries()) {
30
+ const target = getDiagnosticTarget(apiSet);
31
+ if (!apiSet.privateEndpointConnectionPath) {
32
+ context.reportDiagnostic({
33
+ target,
34
+ format: {
35
+ apiPath: `${basePath}/privateEndpointConnections/{privateEndpointConnectionName}`,
36
+ },
37
+ });
38
+ }
39
+ if (!apiSet.privateEndpointConnectionsPath) {
40
+ context.reportDiagnostic({
41
+ target,
42
+ format: {
43
+ apiPath: `${basePath}/privateEndpointConnections`,
44
+ },
45
+ });
46
+ }
47
+ if (!apiSet.privateLinkResourcesPath) {
48
+ context.reportDiagnostic({
49
+ target,
50
+ format: {
51
+ apiPath: `${basePath}/privateLinkResources`,
52
+ },
53
+ });
54
+ }
55
+ }
56
+ },
57
+ };
58
+ },
59
+ });
60
+ function collectPath(supportedResources, operation) {
61
+ const target = operation.operation.interface ?? operation.operation;
62
+ const pointPath = operation.path.match(privateEndpointConnectionPathRegExp);
63
+ if (pointPath !== null) {
64
+ getOrCreateApiSet(supportedResources, pointPath[1]).privateEndpointConnectionPath ??= target;
65
+ return;
66
+ }
67
+ const listPath = operation.path.match(privateEndpointConnectionsPathRegExp);
68
+ if (listPath !== null) {
69
+ getOrCreateApiSet(supportedResources, listPath[1]).privateEndpointConnectionsPath ??= target;
70
+ return;
71
+ }
72
+ const privateLinkPath = operation.path.match(privateLinkResourcesPathRegExp);
73
+ if (privateLinkPath !== null) {
74
+ getOrCreateApiSet(supportedResources, privateLinkPath[1]).privateLinkResourcesPath ??= target;
75
+ }
76
+ }
77
+ function getOrCreateApiSet(supportedResources, key) {
78
+ let apiSet = supportedResources.get(key);
79
+ if (apiSet === undefined) {
80
+ apiSet = {};
81
+ supportedResources.set(key, apiSet);
82
+ }
83
+ return apiSet;
84
+ }
85
+ function getDiagnosticTarget(apiSet) {
86
+ return (apiSet.privateEndpointConnectionPath ??
87
+ apiSet.privateEndpointConnectionsPath ??
88
+ apiSet.privateLinkResourcesPath);
89
+ }
90
+ //# sourceMappingURL=private-endpoint-apis-missing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private-endpoint-apis-missing.js","sourceRoot":"","sources":["../../../src/rules/private-endpoint-apis-missing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,OAAO,EACP,YAAY,GAGb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,2BAA2B,EAA6B,MAAM,kBAAkB,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,mCAAmC,GAAG,gDAAgD,CAAC;AAC7F,MAAM,oCAAoC,GAAG,qCAAqC,CAAC;AACnF,MAAM,8BAA8B,GAAG,+BAA+B,CAAC;AAEvE,MAAM,CAAC,MAAM,8BAA8B,GAAG,UAAU,CAAC;IACvD,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,4CAA4C,CAAC;IAC3E,GAAG,EAAE,kHAAkH;IACvH,WAAW,EACT,kKAAkK;IACpK,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE;QACR,OAAO,EAAE,YAAY,CAAA,6BAA6B,SAAS,cAAc;KAC1E;IACD,MAAM,CAAC,OAAO;QACZ,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAiC,CAAC;QAEpE,OAAO;YACL,SAAS,CAAC,SAAS;gBACjB,IAAI,2BAA2B,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,SAAS,EAAE,CAAC;oBAC1E,OAAO;gBACT,CAAC;gBAED,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;gBAC3E,IAAI,iBAAiB,KAAK,SAAS,EAAE,CAAC;oBACpC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C;QAC7F,OAAO;IACT,CAAC;IAED,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAC5E,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,iBAAiB,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,8BAA8B,KAAK,MAAM,CAAC;QAC7F,OAAO;IACT,CAAC;IAED,MAAM,eAAe,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAC7E,IAAI,eAAe,KAAK,IAAI,EAAE,CAAC;QAC7B,iBAAiB,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,wBAAwB,KAAK,MAAM,CAAC;IAChG,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CACxB,kBAAsD,EACtD,GAAW;IAEX,IAAI,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,GAAG,EAAE,CAAC;QACZ,kBAAkB,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,mBAAmB,CAAC,MAA6B;IACxD,OAAO,CACL,MAAM,CAAC,6BAA6B;QACpC,MAAM,CAAC,8BAA8B;QACrC,MAAM,CAAC,wBAAyB,CACjC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const useScopePathStandardNameRule: import("@typespec/compiler").LinterRuleDefinition<"use-scope-path-standard-name", {
2
+ readonly resourceGroup: "Resource-group paths must include '/resourceGroups/{resourceGroupName}'.";
3
+ readonly subscription: "Subscription paths must include '/subscriptions/{subscriptionId}'.";
4
+ }, Record<string, never>>;
5
+ //# sourceMappingURL=use-scope-path-standard-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-scope-path-standard-name.d.ts","sourceRoot":"","sources":["../../../src/rules/use-scope-path-standard-name.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,4BAA4B;;;yBAmDvC,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { createRule, fileRef, isTemplateDeclarationOrInstance } from "@typespec/compiler";
2
+ import { getHttpOperation } from "@typespec/http";
3
+ import { getArmProviderNamespace } from "../namespace.js";
4
+ import { isTemplatedInterfaceOperation } from "./utils.js";
5
+ export const useScopePathStandardNameRule = createRule({
6
+ name: "use-scope-path-standard-name",
7
+ description: "ARM scope paths must use the resourceGroupName and subscriptionId path parameters.",
8
+ severity: "warning",
9
+ url: "https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/use-scope-path-standard-name",
10
+ docs: fileRef.fromPackageRoot("src/rules/use-scope-path-standard-name.md"),
11
+ messages: {
12
+ resourceGroup: "Resource-group paths must include '/resourceGroups/{resourceGroupName}'.",
13
+ subscription: "Subscription paths must include '/subscriptions/{subscriptionId}'.",
14
+ },
15
+ create(context) {
16
+ return {
17
+ operation: (operation) => {
18
+ if (isTemplateDeclarationOrInstance(operation) ||
19
+ isTemplatedInterfaceOperation(operation)) {
20
+ return;
21
+ }
22
+ const namespace = operation.interface?.namespace ?? operation.namespace;
23
+ if (namespace === undefined ||
24
+ getArmProviderNamespace(context.program, namespace) === undefined) {
25
+ return;
26
+ }
27
+ const [httpOperation] = getHttpOperation(context.program, operation);
28
+ if (httpOperation.verb !== "get" &&
29
+ httpOperation.verb !== "put" &&
30
+ httpOperation.verb !== "patch" &&
31
+ httpOperation.verb !== "delete") {
32
+ return;
33
+ }
34
+ const path = httpOperation.path.toLowerCase();
35
+ if (path.includes("/resourcegroups/") &&
36
+ !path.includes("/resourcegroups/{resourcegroupname}")) {
37
+ context.reportDiagnostic({ target: operation, messageId: "resourceGroup" });
38
+ }
39
+ if (path.includes("/subscriptions/") && !path.includes("/subscriptions/{subscriptionid}")) {
40
+ context.reportDiagnostic({ target: operation, messageId: "subscription" });
41
+ }
42
+ },
43
+ };
44
+ },
45
+ });
46
+ //# sourceMappingURL=use-scope-path-standard-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-scope-path-standard-name.js","sourceRoot":"","sources":["../../../src/rules/use-scope-path-standard-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAE3D,MAAM,CAAC,MAAM,4BAA4B,GAAG,UAAU,CAAC;IACrD,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,oFAAoF;IACjG,QAAQ,EAAE,SAAS;IACnB,GAAG,EAAE,iHAAiH;IACtH,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,2CAA2C,CAAC;IAC1E,QAAQ,EAAE;QACR,aAAa,EAAE,0EAA0E;QACzF,YAAY,EAAE,oEAAoE;KACnF;IACD,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;gBACvB,IACE,+BAA+B,CAAC,SAAS,CAAC;oBAC1C,6BAA6B,CAAC,SAAS,CAAC,EACxC,CAAC;oBACD,OAAO;gBACT,CAAC;gBAED,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,EAAE,SAAS,IAAI,SAAS,CAAC,SAAS,CAAC;gBACxE,IACE,SAAS,KAAK,SAAS;oBACvB,uBAAuB,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,SAAS,EACjE,CAAC;oBACD,OAAO;gBACT,CAAC;gBAED,MAAM,CAAC,aAAa,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;gBACrE,IACE,aAAa,CAAC,IAAI,KAAK,KAAK;oBAC5B,aAAa,CAAC,IAAI,KAAK,KAAK;oBAC5B,aAAa,CAAC,IAAI,KAAK,OAAO;oBAC9B,aAAa,CAAC,IAAI,KAAK,QAAQ,EAC/B,CAAC;oBACD,OAAO;gBACT,CAAC;gBAED,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;gBAC9C,IACE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC;oBACjC,CAAC,IAAI,CAAC,QAAQ,CAAC,qCAAqC,CAAC,EACrD,CAAC;oBACD,OAAO,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC;gBAC9E,CAAC;gBACD,IAAI,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,iCAAiC,CAAC,EAAE,CAAC;oBAC1F,OAAO,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC,CAAC;gBAC7E,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const useStandardErrorRule: import("@typespec/compiler").LinterRuleDefinition<"use-standard-error", {
2
+ readonly default: "Error responses must have a body using `Azure.ResourceManager.CommonTypes.ErrorResponse` instead of a custom error payload.";
3
+ readonly missingErrorResponse: "Operations must define at least one response marked with `@error`.";
4
+ }, Record<string, never>>;
5
+ //# sourceMappingURL=use-standard-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-standard-error.d.ts","sourceRoot":"","sources":["../../../src/rules/use-standard-error.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,oBAAoB;;;yBAsD/B,CAAC"}
@@ -0,0 +1,66 @@
1
+ import { createRule, fileRef, getDiscriminatedUnion, getNamespaceFullName, isErrorModel, isTemplateDeclarationOrInstance, } from "@typespec/compiler";
2
+ import { getOperationVerb, getResponsesForOperation } from "@typespec/http";
3
+ import { getSingleNonNullMember } from "./model-utils.js";
4
+ import { isTemplatedInterfaceOperation } from "./utils.js";
5
+ export const useStandardErrorRule = createRule({
6
+ name: "use-standard-error",
7
+ docs: fileRef.fromPackageRoot("src/rules/use-standard-error.md"),
8
+ url: "https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/use-standard-error",
9
+ description: "Non-HEAD operations must define a response marked with @error and use ErrorResponse from ARM common types for marked error payloads.",
10
+ severity: "warning",
11
+ messages: {
12
+ default: "Error responses must have a body using `Azure.ResourceManager.CommonTypes.ErrorResponse` instead of a custom error payload.",
13
+ missingErrorResponse: "Operations must define at least one response marked with `@error`.",
14
+ },
15
+ create(context) {
16
+ const program = context.program;
17
+ const reported = new Set();
18
+ return {
19
+ operation(operation) {
20
+ const source = operation.node ?? operation;
21
+ if (reported.has(source) ||
22
+ isTemplateDeclarationOrInstance(operation) ||
23
+ isTemplatedInterfaceOperation(operation) ||
24
+ getOperationVerb(program, operation) === "head") {
25
+ return;
26
+ }
27
+ const errorTypes = [...getResponseTypes(program, operation.returnType)].filter((type) => isErrorModel(program, type));
28
+ if (errorTypes.length === 0) {
29
+ context.reportDiagnostic({ target: operation, messageId: "missingErrorResponse" });
30
+ reported.add(source);
31
+ return;
32
+ }
33
+ const invalidBody = errorTypes.some((type) => {
34
+ // Resolve each marked variant separately: status groups retain only their first type.
35
+ const [responses] = getResponsesForOperation(program, { ...operation, returnType: type });
36
+ return responses.some((response) => response.responses.some(({ body }) => body === undefined || body.bodyKind !== "single" || !isStandardError(body.type)));
37
+ });
38
+ if (invalidBody) {
39
+ context.reportDiagnostic({ target: operation });
40
+ reported.add(source);
41
+ }
42
+ },
43
+ };
44
+ },
45
+ });
46
+ function isStandardError(type) {
47
+ if (type.kind === "Union") {
48
+ const member = getSingleNonNullMember(type);
49
+ return member !== undefined && isStandardError(member);
50
+ }
51
+ return (type.kind === "Model" &&
52
+ type.name === "ErrorResponse" &&
53
+ type.namespace !== undefined &&
54
+ getNamespaceFullName(type.namespace) === "Azure.ResourceManager.CommonTypes");
55
+ }
56
+ function* getResponseTypes(program, type) {
57
+ if (type.kind === "Union" && getDiscriminatedUnion(program, type)[0] === undefined) {
58
+ for (const variant of type.variants.values()) {
59
+ yield* getResponseTypes(program, variant.type);
60
+ }
61
+ }
62
+ else {
63
+ yield type;
64
+ }
65
+ }
66
+ //# sourceMappingURL=use-standard-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-standard-error.js","sourceRoot":"","sources":["../../../src/rules/use-standard-error.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,OAAO,EACP,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,EACZ,+BAA+B,GAIhC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAE3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;IAC7C,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,iCAAiC,CAAC;IAChE,GAAG,EAAE,uGAAuG;IAC5G,WAAW,EACT,sIAAsI;IACxI,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE;QACR,OAAO,EACL,6HAA6H;QAC/H,oBAAoB,EAAE,oEAAoE;KAC3F;IACD,MAAM,CAAC,OAAO;QACZ,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAiC,CAAC;QAE1D,OAAO;YACL,SAAS,CAAC,SAAS;gBACjB,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,IAA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AM,EAAE,SAAS,EAAE,CAAC,CAAC;oBAChD,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,SAAS,eAAe,CAAC,IAAU;IACjC,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC;QAC5C,OAAO,MAAM,KAAK,SAAS,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,CACL,IAAI,CAAC,IAAI,KAAK,OAAO;QACrB,IAAI,CAAC,IAAI,KAAK,eAAe;QAC7B,IAAI,CAAC,SAAS,KAAK,SAAS;QAC5B,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,mCAAmC,CAC7E,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,CAAC,gBAAgB,CAAC,OAAgB,EAAE,IAAU;IACrD,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,qBAAqB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;QACnF,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;YAC7C,KAAK,CAAC,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,CAAC;IACb,CAAC;AACH,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { type DecoratorArgument, type Interface, type Model, type ModelProperty, type Namespace, type Operation, type Program } from "@typespec/compiler";
2
+ import { type Node } from "@typespec/compiler/ast";
2
3
  import { type ArmResourceDetails } from "../resource.js";
3
4
  /**
4
5
  *
@@ -18,6 +19,7 @@ export declare function getProperties(model: Model): ModelProperty[];
18
19
  export declare function getInterface(res: ArmResourceDetails): Interface | undefined;
19
20
  export declare function getSourceModel(property: ModelProperty): Model | undefined;
20
21
  export declare function getSourceProperty(property: ModelProperty): ModelProperty;
22
+ export declare function hasSuppression(node: Node | undefined, code: string): boolean;
21
23
  export declare function isInternalTypeSpec(program: Program, type: Model | Operation | ModelProperty | Interface | Namespace): boolean;
22
24
  export declare function isSourceOperationResourceManagerInternal(operation: Operation | undefined): boolean;
23
25
  export declare function getNamespaceName(program: Program, type: Model | Operation | ModelProperty | Interface | Namespace | undefined): string;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/rules/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EAEtB,KAAK,SAAS,EAEd,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,OAAO,EACb,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,gBAAgB,CAAC;AAE7E;;;;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,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IACP,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,qBAAqB,CAAC,EAAE,OAAO,CAAC;CAC5B,GACL,OAAO,CAeT;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,mBAOzC;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,kBAAkB,yBAUnD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}
71
71
  return currProperty ?? property;
72
72
  }
73
+ export function hasSuppression(node, code) {
74
+ let current = node;
75
+ while (current !== undefined) {
76
+ for (const directive of current.directives ?? []) {
77
+ const firstArgument = directive.arguments[0];
78
+ if (directive.target.sv === "suppress" &&
79
+ firstArgument !== undefined &&
80
+ ((firstArgument.kind === SyntaxKind.StringLiteral && firstArgument.value === code) ||
81
+ (firstArgument.kind === SyntaxKind.Identifier && firstArgument.sv === code))) {
82
+ return true;
83
+ }
84
+ }
85
+ current = current.parent;
86
+ }
87
+ return false;
88
+ }
73
89
  export function isInternalTypeSpec(program, type) {
74
90
  const namespace = getNamespaceName(program, type);
75
91
  return (namespace.startsWith("TypeSpec") ||
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/rules/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,oBAAoB,EAEpB,qBAAqB,GAMtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAA2B,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAE7E;;;;GAIG;AACH,MAAM,UAAU,6BAA6B,CAAC,MAAiB;IAC7D,OAAO,CACL,MAAM,CAAC,IAAI,EAAE,IAAI,KAAK,UAAU,CAAC,kBAAkB;QACnD,MAAM,CAAC,SAAS;QAChB,qBAAqB,CAAC,MAAM,CAAC,SAAS,CAAC,CACxC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,YAAmB;IACnD,MAAM,UAAU,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC;IACpD,OAAO,UAAU,KAAK,SAAS,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,YAAmB;IAC5C,MAAM,UAAU,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC;IACpD,OAAO,CAAC,CAAC,UAA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