@azure-tools/typespec-azure-resource-manager 0.74.0-dev.9 → 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.
- package/README.md +9 -2
- package/dist/src/linter.d.ts.map +1 -1
- package/dist/src/linter.js +14 -0
- package/dist/src/linter.js.map +1 -1
- package/dist/src/resource.d.ts.map +1 -1
- package/dist/src/resource.js +38 -79
- package/dist/src/resource.js.map +1 -1
- package/dist/src/rules/arm-custom-resource-usage-discourage.js +3 -20
- package/dist/src/rules/arm-custom-resource-usage-discourage.js.map +1 -1
- package/dist/src/rules/arm-resource-invalid-envelope-property.d.ts.map +1 -1
- package/dist/src/rules/arm-resource-invalid-envelope-property.js +12 -3
- package/dist/src/rules/arm-resource-invalid-envelope-property.js.map +1 -1
- package/dist/src/rules/lro-missing-polling-metadata.d.ts +4 -0
- package/dist/src/rules/lro-missing-polling-metadata.d.ts.map +1 -0
- package/dist/src/rules/lro-missing-polling-metadata.js +59 -0
- package/dist/src/rules/lro-missing-polling-metadata.js.map +1 -0
- package/dist/src/rules/no-repeated-path-info.d.ts +4 -0
- package/dist/src/rules/no-repeated-path-info.d.ts.map +1 -0
- package/dist/src/rules/no-repeated-path-info.js +63 -0
- package/dist/src/rules/no-repeated-path-info.js.map +1 -0
- package/dist/src/rules/no-reserved-resource-property.d.ts.map +1 -1
- package/dist/src/rules/no-reserved-resource-property.js +2 -1
- package/dist/src/rules/no-reserved-resource-property.js.map +1 -1
- package/dist/src/rules/no-resource-duplicates.d.ts +4 -0
- package/dist/src/rules/no-resource-duplicates.d.ts.map +1 -0
- package/dist/src/rules/no-resource-duplicates.js +48 -0
- package/dist/src/rules/no-resource-duplicates.js.map +1 -0
- package/dist/src/rules/no-resource-name-conflict.d.ts +4 -0
- package/dist/src/rules/no-resource-name-conflict.d.ts.map +1 -0
- package/dist/src/rules/no-resource-name-conflict.js +52 -0
- package/dist/src/rules/no-resource-name-conflict.js.map +1 -0
- package/dist/src/rules/no-response-body.d.ts +2 -1
- package/dist/src/rules/no-response-body.d.ts.map +1 -1
- package/dist/src/rules/no-response-body.js +20 -13
- package/dist/src/rules/no-response-body.js.map +1 -1
- package/dist/src/rules/private-endpoint-apis-missing.d.ts +4 -0
- package/dist/src/rules/private-endpoint-apis-missing.d.ts.map +1 -0
- package/dist/src/rules/private-endpoint-apis-missing.js +90 -0
- package/dist/src/rules/private-endpoint-apis-missing.js.map +1 -0
- package/dist/src/rules/use-scope-path-standard-name.d.ts +5 -0
- package/dist/src/rules/use-scope-path-standard-name.d.ts.map +1 -0
- package/dist/src/rules/use-scope-path-standard-name.js +46 -0
- package/dist/src/rules/use-scope-path-standard-name.js.map +1 -0
- package/dist/src/rules/use-standard-error.d.ts +5 -0
- package/dist/src/rules/use-standard-error.d.ts.map +1 -0
- package/dist/src/rules/use-standard-error.js +66 -0
- package/dist/src/rules/use-standard-error.js.map +1 -0
- package/dist/src/rules/utils.d.ts +2 -0
- package/dist/src/rules/utils.d.ts.map +1 -1
- package/dist/src/rules/utils.js +16 -0
- package/dist/src/rules/utils.js.map +1 -1
- package/package.json +16 -16
|
@@ -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;AAC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,CAAC,oBAAoB,CAAC,WAAW,EAAE;qBAC5C,CAAC,CAAC;oBACH,MAAM,KAAK,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;oBACtC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;wBACxB,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;wBAClC,SAAS;oBACX,CAAC;oBAED,OAAO,CAAC,gBAAgB,CAAC;wBACvB,MAAM;wBACN,MAAM,EAAE;4BACN,IAAI,EAAE,QAAQ,CAAC,YAAY;4BAC3B,SAAS,EAAE,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,IAAI,GAAG,CACtB,YAAY,CAAC,OAAO,CAAC;qBAClB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,sBAAsB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;qBAC3D,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAC3B,CAAC;gBACF,MAAM,KAAK,GAAG,IAAI,GAAG,EAA4B,CAAC;gBAClD,KAAK,MAAM,QAAQ,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,CAAC;oBACpE,MAAM,SAAS,GACb,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS;wBAClD,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC;oBAC/D,uFAAuF;oBACvF,IAAI,SAAS,KAAK,SAAS,IAAI,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC;wBAAE,SAAS;oBAEhF,IAAI,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;oBACpC,OAAO,SAAS,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;wBAC3D,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;oBAClC,CAAC;oBACD,IAAI,SAAS,KAAK,SAAS;wBAAE,SAAS;oBAEtC,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;oBAC/C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;wBACxB,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;oBAC7C,CAAC;yBAAM,CAAC;wBACN,OAAO,CAAC,gBAAgB,CAAC;4BACvB,MAAM,EAAE,SAAS;4BACjB,MAAM,EAAE;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
|
|
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":"
|
|
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
|
|
2
|
+
import { getHttpOperation } from "@typespec/http";
|
|
3
3
|
import { isTemplatedInterfaceOperation } from "./utils.js";
|
|
4
4
|
/**
|
|
5
|
-
* verify that 202
|
|
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
|
|
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 (
|
|
24
|
-
isTemplatedInterfaceOperation(op) ||
|
|
25
|
-
httpOperation.verb === "head")
|
|
26
|
+
if (httpOperation.verb === "head")
|
|
26
27
|
return;
|
|
27
|
-
const responses =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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,
|
|
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,
|
|
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,
|
|
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,EAAE,gBAAgB,EAA8B,MAAM,gBAAgB,CAAC;AAC9E,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,wIAAwI;IAC1I,GAAG,EAAE,qGAAqG;IAC1G,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE;QACR,OAAO,EAAE,mGAAmG;QAC5G,gBAAgB,EAAE,sDAAsD;QACxE,gBAAgB,EAAE,2CAA2C;QAC7D,gBAAgB,EAAE,2CAA2C;KAC9D;IACD,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,SAAS,EAAE,CAAC,EAAa,EAAE,EAAE;gBAC3B,IAAI,kBAAkB,CAAC,EAAE,CAAC,IAAI,6BAA6B,CAAC,EAAE,CAAC;oBAAE,OAAO;gBAExE,MAAM,CAAC,aAAa,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAC9D,IAAI,aAAa,CAAC,IAAI,KAAK,MAAM;oBAAE,OAAO;gBAE1C,MAAM,SAAS,GAAG,aAAa,CAAC,SAAS,CAAC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,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,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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,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,Y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AC,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;
|
|
1
|
+
{"version":3,"file":"utils.d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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,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,KAAK,GAAG,aAAa,EAC3B,IAAI,EAAE,MAAM,GACX,iBAAiB,GAAG,SAAS,CAK/B"}
|
package/dist/src/rules/utils.js
CHANGED
|
@@ -70,6 +70,22 @@ export function getSourceProperty(property) {
|
|
|
70
70
|
}
|
|
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":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CAAC,MAAM,KAAK,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,YAAY,CAAC,IAA2B,EAAE,IAAY;IAC7D,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,MAAM,EAAE,KAAK,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACnF,IAAI,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;IAC7D,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,IAA2B,EAC3B,IAAY;IAEZ,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACtC,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACzC,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3D,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-tools/typespec-azure-resource-manager",
|
|
3
|
-
"version": "0.74.0
|
|
3
|
+
"version": "0.74.0",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec Azure Resource Manager library",
|
|
6
6
|
"homepage": "https://azure.github.io/typespec-azure",
|
|
@@ -47,29 +47,29 @@
|
|
|
47
47
|
"pluralize": "^8.0.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@
|
|
51
|
-
"@typespec/compiler": "^1.
|
|
52
|
-
"@typespec
|
|
53
|
-
"@typespec/
|
|
54
|
-
"@typespec/
|
|
55
|
-
"@typespec/versioning": "^0.
|
|
50
|
+
"@typespec/http": "^1.18.0",
|
|
51
|
+
"@typespec/compiler": "^1.18.0",
|
|
52
|
+
"@azure-tools/typespec-azure-core": "^0.74.0",
|
|
53
|
+
"@typespec/rest": "^0.88.0",
|
|
54
|
+
"@typespec/openapi": "^1.18.0",
|
|
55
|
+
"@typespec/versioning": "^0.88.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@
|
|
59
|
-
"@types/node": "^26.6.4",
|
|
58
|
+
"@types/node": "^26.6.5",
|
|
60
59
|
"@types/pluralize": "^0.0.33",
|
|
61
60
|
"@vitest/coverage-v8": "^5.0.5",
|
|
62
61
|
"@vitest/ui": "^5.0.5",
|
|
63
62
|
"rimraf": "^6.1.3",
|
|
64
63
|
"typescript": "npm:@typescript/typescript6@~6.0.2",
|
|
65
64
|
"vitest": "^5.0.5",
|
|
66
|
-
"@typespec
|
|
67
|
-
"@typespec/
|
|
68
|
-
"@typespec/
|
|
69
|
-
"@typespec/tspd": "^0.
|
|
70
|
-
"@typespec/
|
|
71
|
-
"@typespec/
|
|
72
|
-
"@typespec/
|
|
65
|
+
"@azure-tools/typespec-azure-core": "^0.74.0",
|
|
66
|
+
"@typespec/library-linter": "^0.88.0",
|
|
67
|
+
"@typespec/rest": "^0.88.0",
|
|
68
|
+
"@typespec/tspd": "^0.78.0",
|
|
69
|
+
"@typespec/http": "^1.18.0",
|
|
70
|
+
"@typespec/compiler": "^1.18.0",
|
|
71
|
+
"@typespec/versioning": "^0.88.0",
|
|
72
|
+
"@typespec/openapi": "^1.18.0"
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
75
75
|
"clean": "rimraf ./dist ./temp",
|