@microsoft/typespec-msgraph 0.0.1-Preview.20 → 0.0.1-Preview.22
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/dist/src/components/annotations.js +2 -2
- package/dist/src/components/entity-container-element.d.ts.map +1 -1
- package/dist/src/components/entity-container-element.js +6 -2
- package/dist/src/components/entity-container-element.js.map +1 -1
- package/dist/src/components/enum-type-element.js +1 -1
- package/dist/src/components/enum-type-element.js.map +1 -1
- package/dist/src/components/property-element.d.ts.map +1 -1
- package/dist/src/components/property-element.js +2 -2
- package/dist/src/components/property-element.js.map +1 -1
- package/dist/src/components/schema-element.d.ts.map +1 -1
- package/dist/src/components/schema-element.js +4 -1
- package/dist/src/components/schema-element.js.map +1 -1
- package/dist/src/decorators/abstract.d.ts +2 -0
- package/dist/src/decorators/abstract.d.ts.map +1 -1
- package/dist/src/decorators/abstract.js +2 -0
- package/dist/src/decorators/abstract.js.map +1 -1
- package/dist/src/decorators/action.d.ts +2 -0
- package/dist/src/decorators/action.d.ts.map +1 -1
- package/dist/src/decorators/action.js +2 -0
- package/dist/src/decorators/action.js.map +1 -1
- package/dist/src/decorators/additional-query-parameters.d.ts +2 -0
- package/dist/src/decorators/additional-query-parameters.d.ts.map +1 -1
- package/dist/src/decorators/additional-query-parameters.js +2 -0
- package/dist/src/decorators/additional-query-parameters.js.map +1 -1
- package/dist/src/decorators/address-url-msa.d.ts +2 -0
- package/dist/src/decorators/address-url-msa.d.ts.map +1 -1
- package/dist/src/decorators/address-url-msa.js +2 -0
- package/dist/src/decorators/address-url-msa.js.map +1 -1
- package/dist/src/decorators/ags-attribute.d.ts +2 -2
- package/dist/src/decorators/ags-attribute.d.ts.map +1 -1
- package/dist/src/decorators/ags-attribute.js +24 -23
- package/dist/src/decorators/ags-attribute.js.map +1 -1
- package/dist/src/decorators/contains.d.ts +2 -0
- package/dist/src/decorators/contains.d.ts.map +1 -1
- package/dist/src/decorators/contains.js +2 -0
- package/dist/src/decorators/contains.js.map +1 -1
- package/dist/src/decorators/deprecated-definition.d.ts +2 -0
- package/dist/src/decorators/deprecated-definition.d.ts.map +1 -1
- package/dist/src/decorators/deprecated-definition.js.map +1 -1
- package/dist/src/decorators/expand.d.ts +2 -0
- package/dist/src/decorators/expand.d.ts.map +1 -1
- package/dist/src/decorators/expand.js +2 -0
- package/dist/src/decorators/expand.js.map +1 -1
- package/dist/src/decorators/experimental.d.ts +2 -0
- package/dist/src/decorators/experimental.d.ts.map +1 -1
- package/dist/src/decorators/experimental.js +2 -0
- package/dist/src/decorators/experimental.js.map +1 -1
- package/dist/src/decorators/function.d.ts +2 -0
- package/dist/src/decorators/function.d.ts.map +1 -1
- package/dist/src/decorators/function.js +3 -1
- package/dist/src/decorators/function.js.map +1 -1
- package/dist/src/decorators/global-operation.d.ts +2 -0
- package/dist/src/decorators/global-operation.d.ts.map +1 -1
- package/dist/src/decorators/global-operation.js +2 -0
- package/dist/src/decorators/global-operation.js.map +1 -1
- package/dist/src/decorators/graph-deprecated.d.ts +2 -0
- package/dist/src/decorators/graph-deprecated.d.ts.map +1 -1
- package/dist/src/decorators/graph-deprecated.js +2 -0
- package/dist/src/decorators/graph-deprecated.js.map +1 -1
- package/dist/src/decorators/graph-route.d.ts +2 -0
- package/dist/src/decorators/graph-route.d.ts.map +1 -1
- package/dist/src/decorators/graph-route.js +33 -1
- package/dist/src/decorators/graph-route.js.map +1 -1
- package/dist/src/decorators/graphFlags.d.ts +11 -0
- package/dist/src/decorators/graphFlags.d.ts.map +1 -0
- package/dist/src/decorators/graphFlags.js +15 -0
- package/dist/src/decorators/graphFlags.js.map +1 -0
- package/dist/src/decorators/immutable.d.ts +2 -0
- package/dist/src/decorators/immutable.d.ts.map +1 -1
- package/dist/src/decorators/immutable.js +2 -0
- package/dist/src/decorators/immutable.js.map +1 -1
- package/dist/src/decorators/index.d.ts +2 -1
- package/dist/src/decorators/index.d.ts.map +1 -1
- package/dist/src/decorators/index.js +2 -1
- package/dist/src/decorators/index.js.map +1 -1
- package/dist/src/decorators/is-owner.d.ts +2 -0
- package/dist/src/decorators/is-owner.d.ts.map +1 -1
- package/dist/src/decorators/is-owner.js +2 -0
- package/dist/src/decorators/is-owner.js.map +1 -1
- package/dist/src/decorators/limited-charset.d.ts +2 -0
- package/dist/src/decorators/limited-charset.d.ts.map +1 -1
- package/dist/src/decorators/limited-charset.js +2 -0
- package/dist/src/decorators/limited-charset.js.map +1 -1
- package/dist/src/decorators/media.d.ts +2 -0
- package/dist/src/decorators/media.d.ts.map +1 -1
- package/dist/src/decorators/media.js +2 -0
- package/dist/src/decorators/media.js.map +1 -1
- package/dist/src/decorators/open.d.ts +2 -0
- package/dist/src/decorators/open.d.ts.map +1 -1
- package/dist/src/decorators/open.js +2 -0
- package/dist/src/decorators/open.js.map +1 -1
- package/dist/src/decorators/operation-parameters.d.ts +2 -0
- package/dist/src/decorators/operation-parameters.d.ts.map +1 -1
- package/dist/src/decorators/operation-parameters.js +2 -0
- package/dist/src/decorators/operation-parameters.js.map +1 -1
- package/dist/src/decorators/ownerless.d.ts +2 -0
- package/dist/src/decorators/ownerless.d.ts.map +1 -1
- package/dist/src/decorators/ownerless.js +2 -0
- package/dist/src/decorators/ownerless.js.map +1 -1
- package/dist/src/decorators/passthrough-address-url-msa.d.ts +4 -1
- package/dist/src/decorators/passthrough-address-url-msa.d.ts.map +1 -1
- package/dist/src/decorators/passthrough-address-url-msa.js +4 -1
- package/dist/src/decorators/passthrough-address-url-msa.js.map +1 -1
- package/dist/src/decorators/passthrough-address-url.d.ts +4 -1
- package/dist/src/decorators/passthrough-address-url.d.ts.map +1 -1
- package/dist/src/decorators/passthrough-address-url.js +4 -1
- package/dist/src/decorators/passthrough-address-url.js.map +1 -1
- package/dist/src/decorators/prefixed-graph-routes.d.ts +10 -0
- package/dist/src/decorators/prefixed-graph-routes.d.ts.map +1 -0
- package/dist/src/decorators/prefixed-graph-routes.js +27 -0
- package/dist/src/decorators/prefixed-graph-routes.js.map +1 -0
- package/dist/src/decorators/private-preview.d.ts +2 -2
- package/dist/src/decorators/private-preview.d.ts.map +1 -1
- package/dist/src/decorators/private-preview.js.map +1 -1
- package/dist/src/decorators/privileged.d.ts +2 -0
- package/dist/src/decorators/privileged.d.ts.map +1 -1
- package/dist/src/decorators/privileged.js +2 -0
- package/dist/src/decorators/privileged.js.map +1 -1
- package/dist/src/decorators/read-only.d.ts +2 -0
- package/dist/src/decorators/read-only.d.ts.map +1 -1
- package/dist/src/decorators/read-only.js +2 -0
- package/dist/src/decorators/read-only.js.map +1 -1
- package/dist/src/decorators/reference-target.d.ts +1 -0
- package/dist/src/decorators/reference-target.d.ts.map +1 -1
- package/dist/src/decorators/reference-target.js +1 -0
- package/dist/src/decorators/reference-target.js.map +1 -1
- package/dist/src/decorators/references.d.ts +2 -0
- package/dist/src/decorators/references.d.ts.map +1 -1
- package/dist/src/decorators/references.js +2 -0
- package/dist/src/decorators/references.js.map +1 -1
- package/dist/src/decorators/return-source.d.ts +2 -0
- package/dist/src/decorators/return-source.d.ts.map +1 -1
- package/dist/src/decorators/return-source.js +2 -0
- package/dist/src/decorators/return-source.js.map +1 -1
- package/dist/src/decorators/select.d.ts +2 -0
- package/dist/src/decorators/select.d.ts.map +1 -1
- package/dist/src/decorators/select.js +2 -0
- package/dist/src/decorators/select.js.map +1 -1
- package/dist/src/decorators/workload-name-msa.d.ts +2 -0
- package/dist/src/decorators/workload-name-msa.d.ts.map +1 -1
- package/dist/src/decorators/workload-name-msa.js +2 -0
- package/dist/src/decorators/workload-name-msa.js.map +1 -1
- package/dist/src/decorators/workload-name.d.ts +2 -0
- package/dist/src/decorators/workload-name.d.ts.map +1 -1
- package/dist/src/decorators/workload-name.js +2 -0
- package/dist/src/decorators/workload-name.js.map +1 -1
- package/dist/src/decorators/workload-namespace.d.ts +2 -0
- package/dist/src/decorators/workload-namespace.d.ts.map +1 -1
- package/dist/src/decorators/workload-namespace.js +2 -0
- package/dist/src/decorators/workload-namespace.js.map +1 -1
- package/dist/src/decorators/write-only.d.ts +2 -0
- package/dist/src/decorators/write-only.d.ts.map +1 -1
- package/dist/src/decorators/write-only.js +2 -0
- package/dist/src/decorators/write-only.js.map +1 -1
- package/dist/src/emitter.d.ts.map +1 -1
- package/dist/src/emitter.js +9 -6
- package/dist/src/emitter.js.map +1 -1
- package/dist/src/entities/address-url.js +2 -2
- package/dist/src/entities/address-url.js.map +1 -1
- package/dist/src/entities/annotations.d.ts +2 -2
- package/dist/src/entities/annotations.d.ts.map +1 -1
- package/dist/src/entities/annotations.js +15 -15
- package/dist/src/entities/annotations.js.map +1 -1
- package/dist/src/entities/entity-container.d.ts +3 -0
- package/dist/src/entities/entity-container.d.ts.map +1 -1
- package/dist/src/entities/entity-container.js +3 -0
- package/dist/src/entities/entity-container.js.map +1 -1
- package/dist/src/entities/enum.d.ts +1 -1
- package/dist/src/entities/enum.d.ts.map +1 -1
- package/dist/src/entities/enum.js +8 -6
- package/dist/src/entities/enum.js.map +1 -1
- package/dist/src/entities/model.d.ts +19 -11
- package/dist/src/entities/model.d.ts.map +1 -1
- package/dist/src/entities/model.js +100 -34
- package/dist/src/entities/model.js.map +1 -1
- package/dist/src/entities/ms-graph-route.d.ts.map +1 -1
- package/dist/src/entities/ms-graph-route.js +6 -9
- package/dist/src/entities/ms-graph-route.js.map +1 -1
- package/dist/src/entities/namespace.d.ts +12 -0
- package/dist/src/entities/namespace.d.ts.map +1 -1
- package/dist/src/entities/namespace.js +176 -17
- package/dist/src/entities/namespace.js.map +1 -1
- package/dist/src/entities/operation.d.ts +5 -0
- package/dist/src/entities/operation.d.ts.map +1 -1
- package/dist/src/entities/operation.js +59 -3
- package/dist/src/entities/operation.js.map +1 -1
- package/dist/src/entities/revision-definition.d.ts +2 -2
- package/dist/src/entities/revision-definition.d.ts.map +1 -1
- package/dist/src/entities/revision-definition.js +14 -3
- package/dist/src/entities/revision-definition.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +11 -0
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +10 -2
- package/dist/src/lib.js.map +1 -1
- package/dist/src/linter.d.ts.map +1 -1
- package/dist/src/linter.js +14 -2
- package/dist/src/linter.js.map +1 -1
- package/dist/src/rules/address-url.d.ts +1 -0
- package/dist/src/rules/address-url.d.ts.map +1 -1
- package/dist/src/rules/address-url.js +85 -3
- package/dist/src/rules/address-url.js.map +1 -1
- package/dist/src/rules/delta.d.ts.map +1 -1
- package/dist/src/rules/delta.js +6 -7
- package/dist/src/rules/delta.js.map +1 -1
- package/dist/src/rules/documentation.d.ts +4 -0
- package/dist/src/rules/documentation.d.ts.map +1 -0
- package/dist/src/rules/documentation.js +88 -0
- package/dist/src/rules/documentation.js.map +1 -0
- package/dist/src/rules/entity.d.ts +3 -0
- package/dist/src/rules/entity.d.ts.map +1 -1
- package/dist/src/rules/entity.js +32 -5
- package/dist/src/rules/entity.js.map +1 -1
- package/dist/src/rules/enum.d.ts +2 -0
- package/dist/src/rules/enum.d.ts.map +1 -1
- package/dist/src/rules/enum.js +27 -1
- package/dist/src/rules/enum.js.map +1 -1
- package/dist/src/rules/expand.d.ts.map +1 -1
- package/dist/src/rules/expand.js +3 -6
- package/dist/src/rules/expand.js.map +1 -1
- package/dist/src/rules/filter.js +7 -7
- package/dist/src/rules/filter.js.map +1 -1
- package/dist/src/rules/function.d.ts +1 -0
- package/dist/src/rules/function.d.ts.map +1 -1
- package/dist/src/rules/function.js +39 -0
- package/dist/src/rules/function.js.map +1 -1
- package/dist/src/rules/graph-route.d.ts +1 -0
- package/dist/src/rules/graph-route.d.ts.map +1 -1
- package/dist/src/rules/graph-route.js +72 -1
- package/dist/src/rules/graph-route.js.map +1 -1
- package/dist/src/rules/index.d.ts +1 -0
- package/dist/src/rules/index.d.ts.map +1 -1
- package/dist/src/rules/index.js +1 -0
- package/dist/src/rules/index.js.map +1 -1
- package/dist/src/rules/model.d.ts +5 -0
- package/dist/src/rules/model.d.ts.map +1 -1
- package/dist/src/rules/model.js +73 -3
- package/dist/src/rules/model.js.map +1 -1
- package/dist/src/rules/operation-inside-interface.d.ts +3 -0
- package/dist/src/rules/operation-inside-interface.d.ts.map +1 -1
- package/dist/src/rules/operation-inside-interface.js +36 -2
- package/dist/src/rules/operation-inside-interface.js.map +1 -1
- package/dist/src/rules/order-by.js +3 -3
- package/dist/src/rules/order-by.js.map +1 -1
- package/dist/src/rules/ownerless.d.ts.map +1 -1
- package/dist/src/rules/ownerless.js +3 -6
- package/dist/src/rules/ownerless.js.map +1 -1
- package/dist/src/rules/record-t.d.ts +6 -0
- package/dist/src/rules/record-t.d.ts.map +1 -1
- package/dist/src/rules/record-t.js +48 -1
- package/dist/src/rules/record-t.js.map +1 -1
- package/dist/src/rules/required-for-create.d.ts.map +1 -1
- package/dist/src/rules/required-for-create.js +4 -5
- package/dist/src/rules/required-for-create.js.map +1 -1
- package/dist/src/utils.d.ts +20 -4
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +222 -113
- package/dist/src/utils.js.map +1 -1
- package/dist/src/validate.d.ts.map +1 -1
- package/dist/src/validate.js +5 -0
- package/dist/src/validate.js.map +1 -1
- package/lib/decorators.tsp +24 -12
- package/lib/shared-models.tsp +5 -0
- package/package.json +4 -5
- package/dist/src/decorators/flags.d.ts +0 -9
- package/dist/src/decorators/flags.d.ts.map +0 -1
- package/dist/src/decorators/flags.js +0 -13
- package/dist/src/decorators/flags.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../src/entities/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,UAAU,EAAE,MAAM,EAAmC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../src/entities/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,UAAU,EAAE,MAAM,E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AQ,CAAC;aAClE;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Enum, EnumMember, Model, ModelProperty, Namespace, Operation, Program } from "@typespec/compiler";
|
|
1
|
+
import { Enum, EnumMember, Interface, Model, ModelProperty, Namespace, Operation, Program } from "@typespec/compiler";
|
|
2
2
|
export interface RevisionDefinition {
|
|
3
3
|
Date: string;
|
|
4
4
|
Version: string;
|
|
@@ -6,5 +6,5 @@ export interface RevisionDefinition {
|
|
|
6
6
|
RemovalDate: string;
|
|
7
7
|
Category?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare function GetRevisionDefinition(program: Program, type: Model | ModelProperty | EnumMember | Enum | Operation | Namespace, namespace: Namespace | undefined): RevisionDefinition | undefined;
|
|
9
|
+
export declare function GetRevisionDefinition(program: Program, type: Model | ModelProperty | EnumMember | Enum | Operation | Namespace | Interface, namespace: Namespace | undefined): RevisionDefinition | undefined;
|
|
10
10
|
//# sourceMappingURL=revision-definition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revision-definition.d.ts","sourceRoot":"","sources":["../../../src/entities/revision-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"revision-definition.d.ts","sourceRoot":"","sources":["../../../src/entities/revision-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAQ,MAAM,oBAAoB,CAAC;AAG5H,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,KAAK,GAAG,aAAa,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,EACnF,SAAS,EAAE,SAAS,GAAG,SAAS,GAC/B,kBAAkB,GAAG,SAAS,CAiBhC"}
|
|
@@ -7,9 +7,20 @@ export function GetRevisionDefinition(program, type, namespace) {
|
|
|
7
7
|
if (deprecated) {
|
|
8
8
|
return getRevisionDefinitionFromDeprecation(program, namespace, deprecated);
|
|
9
9
|
}
|
|
10
|
-
const privatePreview = getPrivatePreview(program, type)
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const privatePreview = getPrivatePreview(program, type)
|
|
11
|
+
|| getPrivatePreviewFromNamespace(program, type)
|
|
12
|
+
|| undefined;
|
|
13
|
+
return privatePreview
|
|
14
|
+
? getRevisionDefinitionFromPrivatePreview(program, namespace, privatePreview)
|
|
15
|
+
: undefined;
|
|
16
|
+
}
|
|
17
|
+
function getPrivatePreviewFromNamespace(program, type) {
|
|
18
|
+
switch (type.kind) {
|
|
19
|
+
case 'Model':
|
|
20
|
+
case "Enum":
|
|
21
|
+
case "Interface":
|
|
22
|
+
case "Operation":
|
|
23
|
+
return getPrivatePreview(program, type.namespace);
|
|
13
24
|
}
|
|
14
25
|
return undefined;
|
|
15
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revision-definition.js","sourceRoot":"","sources":["../../../src/entities/revision-definition.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAU5H,MAAM,UAAU,qBAAqB,CACnC,OAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"revision-definition.js","sourceRoot":"","sources":["../../../src/entities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,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,gBAAgB;QACjC,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,OAAO,EAAE,GAAG,UAAU,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,UAAU,CAAC,QAAQ,EAAE;QAChF,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,QAAQ,EAAE,UAAU,CAAC,QAAQ;KAC9B,CAAC;AACJ,CAAC;AAED,SAAS,uCAAuC,CAC9C,OAAgB,EAChB,SAAoB,EACpB,UAAkB;IAElB,MAAM,yBAAyB,GAAG,4BAA4B,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACnF,MAAM,UAAU,GAAG,yBAAyB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC7D,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,gBAAgB;QACjC,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,OAAO,EAAE,GAAG,UAAU,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,mBAAmB,UAAU,CAAC,IAAI,EAAE;KAC5F,CAAC;AACJ,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/src/index.js
CHANGED
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/src/lib.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export declare const namespace = "MsGraph";
|
|
|
2
2
|
export interface MsGraphEmitterOptions {
|
|
3
3
|
filename?: string;
|
|
4
4
|
}
|
|
5
|
+
export declare const $flags: import("@typespec/compiler").PackageFlags;
|
|
5
6
|
export declare const reportDiagnostic: <C extends "decorator-missing-dependencies" | "element-missing-dependencies" | "decorator-invalid-use" | "singleton-invalid-name" | "extends-invalid-use" | "type-invalid-use", M extends keyof {
|
|
6
7
|
"decorator-missing-dependencies": {
|
|
7
8
|
readonly default: import("@typespec/compiler").CallableMessage<[string, string, string]>;
|
|
@@ -64,6 +65,10 @@ export declare const reportDiagnostic: <C extends "decorator-missing-dependencie
|
|
|
64
65
|
readonly entityAndComplexAreMutuallyExclusive: import("@typespec/compiler").CallableMessage<[string]>;
|
|
65
66
|
readonly filterPropertiesShouldBeSimple: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
66
67
|
readonly navigationPropertyShouldBeTargettedWithOneInterface: import("@typespec/compiler").CallableMessage<[string]>;
|
|
68
|
+
readonly graphRouteMustMatchModelStructure: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
69
|
+
readonly overloadedFunctionReturnTypesMustBeSame: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
70
|
+
readonly enumMemberUnknownFutureValueCannotHaveDocString: import("@typespec/compiler").CallableMessage<[string]>;
|
|
71
|
+
readonly addressUrlsAreNotEqual: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
67
72
|
};
|
|
68
73
|
"singleton-invalid-name": {
|
|
69
74
|
readonly default: import("@typespec/compiler").CallableMessage<[string]>;
|
|
@@ -78,6 +83,7 @@ export declare const reportDiagnostic: <C extends "decorator-missing-dependencie
|
|
|
78
83
|
readonly recordTypeCannotBeNull: import("@typespec/compiler").CallableMessage<[string]>;
|
|
79
84
|
readonly recordTypeCannotBeUsedInLine: import("@typespec/compiler").CallableMessage<[string]>;
|
|
80
85
|
readonly interfaceWithPartialBindingType: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
86
|
+
readonly propertyTypeCannotBeStringLiteral: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
81
87
|
};
|
|
82
88
|
}[C]>(program: import("@typespec/compiler").Program, diag: import("@typespec/compiler").DiagnosticReport<{
|
|
83
89
|
"decorator-missing-dependencies": {
|
|
@@ -141,6 +147,10 @@ export declare const reportDiagnostic: <C extends "decorator-missing-dependencie
|
|
|
141
147
|
readonly entityAndComplexAreMutuallyExclusive: import("@typespec/compiler").CallableMessage<[string]>;
|
|
142
148
|
readonly filterPropertiesShouldBeSimple: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
143
149
|
readonly navigationPropertyShouldBeTargettedWithOneInterface: import("@typespec/compiler").CallableMessage<[string]>;
|
|
150
|
+
readonly graphRouteMustMatchModelStructure: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
151
|
+
readonly overloadedFunctionReturnTypesMustBeSame: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
152
|
+
readonly enumMemberUnknownFutureValueCannotHaveDocString: import("@typespec/compiler").CallableMessage<[string]>;
|
|
153
|
+
readonly addressUrlsAreNotEqual: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
144
154
|
};
|
|
145
155
|
"singleton-invalid-name": {
|
|
146
156
|
readonly default: import("@typespec/compiler").CallableMessage<[string]>;
|
|
@@ -155,6 +165,7 @@ export declare const reportDiagnostic: <C extends "decorator-missing-dependencie
|
|
|
155
165
|
readonly recordTypeCannotBeNull: import("@typespec/compiler").CallableMessage<[string]>;
|
|
156
166
|
readonly recordTypeCannotBeUsedInLine: import("@typespec/compiler").CallableMessage<[string]>;
|
|
157
167
|
readonly interfaceWithPartialBindingType: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
168
|
+
readonly propertyTypeCannotBeStringLiteral: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
158
169
|
};
|
|
159
170
|
}, C, M>) => void;
|
|
160
171
|
//# sourceMappingURL=lib.d.ts.map
|
package/dist/src/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,YAAY,CAAC;AAEnC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAeD,eAAO,MAAQ,gBAAgB
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,YAAY,CAAC;AAEnC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAeD,eAAO,MAAM,MAAM,2CAEjB,CAAC;AAEH,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwGpB,CAAC"}
|
package/dist/src/lib.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createTypeSpecLibrary, paramMessage } from "@typespec/compiler";
|
|
1
|
+
import { createTypeSpecLibrary, definePackageFlags, paramMessage } from "@typespec/compiler";
|
|
2
2
|
export const namespace = "MsGraph";
|
|
3
3
|
const EmitterOptionsSchema = {
|
|
4
4
|
type: "object",
|
|
@@ -12,6 +12,9 @@ const EmitterOptionsSchema = {
|
|
|
12
12
|
},
|
|
13
13
|
required: [],
|
|
14
14
|
};
|
|
15
|
+
export const $flags = definePackageFlags({
|
|
16
|
+
decoratorArgMarshalling: "new",
|
|
17
|
+
});
|
|
15
18
|
export const { reportDiagnostic } = createTypeSpecLibrary({
|
|
16
19
|
name: "@microsoft/typespec-msgraph",
|
|
17
20
|
diagnostics: {
|
|
@@ -84,6 +87,10 @@ export const { reportDiagnostic } = createTypeSpecLibrary({
|
|
|
84
87
|
entityAndComplexAreMutuallyExclusive: paramMessage `The @entity and @complex decorators are mutually exclusive and cannot be used together on "${"model"}" model.`,
|
|
85
88
|
filterPropertiesShouldBeSimple: paramMessage `The property "${"property"}" defined in the @filter decorator must be a simple property in the model "${"model"}".`,
|
|
86
89
|
navigationPropertyShouldBeTargettedWithOneInterface: paramMessage `The navigation properties "${"models"}" should not be targetted by more than one interface with @delta. Please choose one interface for each navigation property.`,
|
|
90
|
+
graphRouteMustMatchModelStructure: paramMessage `The @graphRoute "${"graphRoute"}" must match a navigation path in the model "${"model"}".`,
|
|
91
|
+
overloadedFunctionReturnTypesMustBeSame: paramMessage `The return types "${"returnTypes"}" of the overloaded function "${"operation"}" must be identical.`,
|
|
92
|
+
enumMemberUnknownFutureValueCannotHaveDocString: paramMessage `Description is not allowed on "${"member"}" because it will be auto-generated.`,
|
|
93
|
+
addressUrlsAreNotEqual: paramMessage `The decorator values (string and booleans) of "${"decorator"}" applied to multiple interfaces that point to the same navigation property "${"target"}" must be identical.`,
|
|
87
94
|
},
|
|
88
95
|
},
|
|
89
96
|
"singleton-invalid-name": {
|
|
@@ -106,7 +113,8 @@ export const { reportDiagnostic } = createTypeSpecLibrary({
|
|
|
106
113
|
recordTypeCannotBePrepopulated: paramMessage `The record type "${"type"}" cannot be prepopulated.`,
|
|
107
114
|
recordTypeCannotBeNull: paramMessage `The record type "${"type"}" cannot be null.`,
|
|
108
115
|
recordTypeCannotBeUsedInLine: paramMessage `Using inline record as type on ${"type"} is not supported. Create a complex entity to represent it.`,
|
|
109
|
-
interfaceWithPartialBindingType: paramMessage `The interface "${"interface"}" targets a partial type "${"type"}" and as such cannot declare operations.`,
|
|
116
|
+
interfaceWithPartialBindingType: paramMessage `The interface "${"interface"}" targets a partial or non-owned type "${"type"}" and as such cannot declare operations.`,
|
|
117
|
+
propertyTypeCannotBeStringLiteral: paramMessage `The type for "${"property"}" cannot be a ${"type"} literal.`
|
|
110
118
|
}
|
|
111
119
|
}
|
|
112
120
|
},
|
package/dist/src/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,qBAAqB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,qBAAqB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE7G,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC;AAMnC,MAAM,oBAAoB,GAA0C;IAClE,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,wFAAwF;SACtG;KACF;IACD,QAAQ,EAAE,EAA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AAE;gBACR,OAAO,EAAE,YAAY,CAAA,wCAAwC,OAAO,uEAAuE;aAC5I;SACF;QACD,qBAAqB,EAAE;YACrB,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,KAAK,MAAM,4BAA4B,MAAM,YAAY;gBAC9E,UAAU,EAAE,8FAA8F;aAC3G;SACF;QACD,kBAAkB,EAAE;YAClB,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,OAAO,MAAM,yDAAyD;gBAC3F,8BAA8B,EAAE,YAAY,CAAA,oBAAoB,MAAM,2BAA2B;gBACjG,sBAAsB,EAAE,YAAY,CAAA,oBAAoB,MAAM,mBAAmB;gBACjF,4BAA4B,EAAE,YAAY,CAAA,kCAAkC,MAAM,6DAA6D;gBAC/I,+BAA+B,EAAE,YAAY,CAAA,kBAAkB,WAAW,0CAA0C,MAAM,0CAA0C;gBACpK,iCAAiC,EAAE,YAAY,CAAA,iBAAiB,UAAU,iBAAiB,MAAM,WAAW;aAC7G;SACF;KACF;IACD,OAAO,EAAE,EAAE,OAAO,EAAE,oBAA6D,EAAE;CAC3E,CAAC,CAAC"}
|
package/dist/src/linter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,OAAO,+CAyBlB,CAAA"}
|
package/dist/src/linter.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { defineLinter } from "@typespec/compiler";
|
|
2
|
-
import { modelShouldBeEntityOrComplexType, singletonOrEntitySetHostingBindingsShouldExist, useEvolvableEnumRule, mediaTypeValuesShouldBeMinimallyFormattedForMIMETypes, interfaceNavigationSourceShouldHaveMediaIf$ValueIsSpecified } from "./rules/index.js";
|
|
2
|
+
import { modelShouldBeEntityOrComplexType, singletonOrEntitySetHostingBindingsShouldExist, useEvolvableEnumRule, mediaTypeValuesShouldBeMinimallyFormattedForMIMETypes, interfaceNavigationSourceShouldHaveMediaIf$ValueIsSpecified, getPutPostAndPatchOperationsShouldHaveSelectDecorator, useRecordTypeInsteadOfDictionary, dictionaryTypeIsMostlyUsedWithRecordType, containedNavigationPropertyTypeShouldNotBeExternallyReferenced, entityAndComplexPropertyNameShouldNotBeName, validateCoreElementsHaveDocString } from "./rules/index.js";
|
|
3
3
|
export const $linter = defineLinter({
|
|
4
|
-
rules: [useEvolvableEnumRule, singletonOrEntitySetHostingBindingsShouldExist,
|
|
4
|
+
rules: [useEvolvableEnumRule, singletonOrEntitySetHostingBindingsShouldExist,
|
|
5
|
+
modelShouldBeEntityOrComplexType, mediaTypeValuesShouldBeMinimallyFormattedForMIMETypes,
|
|
6
|
+
interfaceNavigationSourceShouldHaveMediaIf$ValueIsSpecified, getPutPostAndPatchOperationsShouldHaveSelectDecorator,
|
|
7
|
+
useRecordTypeInsteadOfDictionary, dictionaryTypeIsMostlyUsedWithRecordType,
|
|
8
|
+
containedNavigationPropertyTypeShouldNotBeExternallyReferenced, entityAndComplexPropertyNameShouldNotBeName,
|
|
9
|
+
validateCoreElementsHaveDocString
|
|
10
|
+
],
|
|
5
11
|
ruleSets: {
|
|
6
12
|
recommended: {
|
|
7
13
|
enable: {
|
|
@@ -10,6 +16,12 @@ export const $linter = defineLinter({
|
|
|
10
16
|
[`@microsoft/typespec-msgraph/${modelShouldBeEntityOrComplexType.name}`]: true,
|
|
11
17
|
[`@microsoft/typespec-msgraph/${mediaTypeValuesShouldBeMinimallyFormattedForMIMETypes.name}`]: true,
|
|
12
18
|
[`@microsoft/typespec-msgraph/${interfaceNavigationSourceShouldHaveMediaIf$ValueIsSpecified.name}`]: true,
|
|
19
|
+
[`@microsoft/typespec-msgraph/${getPutPostAndPatchOperationsShouldHaveSelectDecorator.name}`]: true,
|
|
20
|
+
[`@microsoft/typespec-msgraph/${useRecordTypeInsteadOfDictionary.name}`]: true,
|
|
21
|
+
[`@microsoft/typespec-msgraph/${dictionaryTypeIsMostlyUsedWithRecordType.name}`]: true,
|
|
22
|
+
[`@microsoft/typespec-msgraph/${containedNavigationPropertyTypeShouldNotBeExternallyReferenced.name}`]: true,
|
|
23
|
+
[`@microsoft/typespec-msgraph/${entityAndComplexPropertyNameShouldNotBeName.name}`]: true,
|
|
24
|
+
[`@microsoft/typespec-msgraph/${validateCoreElementsHaveDocString.name}`]: true,
|
|
13
25
|
},
|
|
14
26
|
},
|
|
15
27
|
}
|
package/dist/src/linter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linter.js","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gCAAgC,EAAE,8CAA8C,
|
|
1
|
+
{"version":3,"file":"linter.js","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gCAAgC,EAAE,8CAA8C,EACvF,oBAAoB,EAAE,qDAAqD,EAC3E,2DAA2D,EAAE,qDAAqD,EAClH,gCAAgC,EAAE,wCAAwC,EAC1E,8DAA8D,EAAE,2CAA2C,EAC3G,iCAAiC,EACjC,MAAM,kBAAkB,CAAC;AAE3B,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAC;IAClC,KAAK,EAAE,CAAC,oBAAoB,EAAE,8CAA8C;QAC1E,gCAAgC,EAAE,qDAAqD;QACvF,2DAA2D,EAAE,qDAAqD;QAClH,gCAAgC,EAAE,wCAAwC;QAC1E,8DAA8D,EAAE,2CAA2C;QAC3G,iCAAiC;KAClC;IACD,QAAQ,EAAE;QACR,WAAW,EAAE;YACX,MAAM,EAAE;gBACN,CAAC,+BAA+B,oBAAoB,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBAClE,CAAC,+BAA+B,8CAA8C,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBAC5F,CAAC,+BAA+B,gCAAgC,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBAC9E,CAAC,+BAA+B,qDAAqD,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBACnG,CAAC,+BAA+B,2DAA2D,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBACzG,CAAC,+BAA+B,qDAAqD,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBACnG,CAAC,+BAA+B,gCAAgC,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBAC9E,CAAC,+BAA+B,wCAAwC,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBACtF,CAAC,+BAA+B,8DAA8D,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBAC5G,CAAC,+BAA+B,2CAA2C,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBACzF,CAAC,+BAA+B,iCAAiC,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;aAChF;SACF;KACF;CACF,CAAC,CAAA"}
|
|
@@ -16,4 +16,5 @@ export declare function validatePassthroughAddressUrlOnlyAppliesToRoutedInterfac
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function validatePassthroughAddressUrlMsaOnlyAppliesToRoutedInterfacesOrActionOperations(program: Program): void;
|
|
18
18
|
export declare function validatePassthroughAddressUrlDecoratorIsUsedTogetherWithAddressUrlDecorator(program: Program): void;
|
|
19
|
+
export declare function validateAddressUrlTargetingSameNavigationPropertyMustBeSimilar(program: Program): void;
|
|
19
20
|
//# sourceMappingURL=address-url.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-url.d.ts","sourceRoot":"","sources":["../../../src/rules/address-url.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"address-url.d.ts","sourceRoot":"","sources":["../../../src/rules/address-url.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,OAAO,EAAkD,MAAM,oBAAoB,CAAC;AAM7F;;GAEG;AACH,wBAAgB,iEAAiE,CAC/E,OAAO,EAAE,OAAO,QAgBjB;AAED;;GAEG;AACH,wBAAgB,oEAAoE,CAClF,OAAO,EAAE,OAAO,QAgBjB;AAED;;GAEG;AACH,wBAAgB,4EAA4E,CAC1F,OAAO,EAAE,OAAO,QAgBjB;AAED;;GAEG;AACH,wBAAgB,+EAA+E,CAC7F,OAAO,EAAE,OAAO,QAgBjB;AAED,wBAAgB,2EAA2E,CACzF,OAAO,EAAE,OAAO,QAqEjB;AAoCD,wBAAgB,8DAA8D,CAAC,OAAO,EAAE,OAAO,QAa9F"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { hasAddressUrl, hasAddressUrlMsa, hasGraphRoute, hasPassthroughAddressUrl, isAction, } from "../index.js";
|
|
1
|
+
import { getAddressUrl, getAddressUrlMsa, getGraphRoutePaths, getPassthroughAddressUrl, hasAddressUrl, hasAddressUrlMsa, hasGraphRoute, hasPassthroughAddressUrl, isAction, } from "../index.js";
|
|
2
2
|
import { reportDiagnostic } from "../lib.js";
|
|
3
3
|
import { navigateTypesInNamespace } from "@typespec/compiler";
|
|
4
4
|
import { GetDeclaredNamespaces } from "../entities/namespace.js";
|
|
5
|
-
import { hasPassthroughAddressUrlMsa } from "../decorators/passthrough-address-url-msa.js";
|
|
6
|
-
import { getIdForType } from "../utils.js";
|
|
5
|
+
import { getPassthroughAddressUrlMsa, hasPassthroughAddressUrlMsa } from "../decorators/passthrough-address-url-msa.js";
|
|
6
|
+
import { getIdForType, isEqual } from "../utils.js";
|
|
7
7
|
/**
|
|
8
8
|
* @addressUrl only applies to either routed interfaces (entity sets, singletons and navigation properties) or action operations.
|
|
9
9
|
*/
|
|
@@ -158,4 +158,86 @@ function validateAddressUrlApplication(program, target, decorator) {
|
|
|
158
158
|
},
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
|
+
export function validateAddressUrlTargetingSameNavigationPropertyMustBeSimilar(program) {
|
|
162
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
163
|
+
const interfaces = namespace.interfaces;
|
|
164
|
+
const addressUrlGroup = filterInterfaces(program, interfaces, hasAddressUrl);
|
|
165
|
+
const addressUrlMsaGroup = filterInterfaces(program, interfaces, hasAddressUrlMsa);
|
|
166
|
+
const passthroughAddressUrlGroup = filterInterfaces(program, interfaces, hasPassthroughAddressUrl);
|
|
167
|
+
const passthroughAddressUrlMsaGroup = filterInterfaces(program, interfaces, hasPassthroughAddressUrlMsa);
|
|
168
|
+
validateAddressUrlParameters(program, addressUrlGroup, '@addressUrl', getAddressUrl);
|
|
169
|
+
validateAddressUrlParameters(program, addressUrlMsaGroup, '@addressUrlMsa', getAddressUrlMsa);
|
|
170
|
+
validateAddressUrlParameters(program, passthroughAddressUrlGroup, '@passthroughAddressUrl', getPassthroughAddressUrl);
|
|
171
|
+
validateAddressUrlParameters(program, passthroughAddressUrlMsaGroup, '@passthroughAddressUrlMsa', getPassthroughAddressUrlMsa);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function validateAddressUrlParameters(program, interfaces, target, getParameter) {
|
|
175
|
+
const interfacesWithSameSource = getInterfacesWithSameNavSource(program, interfaces);
|
|
176
|
+
for (const [_, group] of interfacesWithSameSource) {
|
|
177
|
+
const interfaces = group.interfaces;
|
|
178
|
+
const addressUrls = [];
|
|
179
|
+
for (const theInterface of interfaces) {
|
|
180
|
+
const addressUrl = getParameter(program, theInterface);
|
|
181
|
+
if (!addressUrl) {
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
addressUrls.push(addressUrl);
|
|
185
|
+
}
|
|
186
|
+
if (addressUrls.length > 1 && !addressUrlParametersAreEqual(addressUrls)) {
|
|
187
|
+
interfaces.forEach(theInterface => {
|
|
188
|
+
reportInvalidUseDiagnostic(program, theInterface, target, group.navigationPropertyName);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
function getInterfacesWithSameNavSource(program, interfaces) {
|
|
194
|
+
let interfacesWithSameSource = new Map();
|
|
195
|
+
for (const [_, theInterface] of interfaces) {
|
|
196
|
+
const graphRoutes = getGraphRoutePaths(program, theInterface);
|
|
197
|
+
graphRoutes === null || graphRoutes === void 0 ? void 0 : graphRoutes.forEach(route => {
|
|
198
|
+
var _a;
|
|
199
|
+
const lastSegment = route.split("/").pop();
|
|
200
|
+
if (lastSegment) {
|
|
201
|
+
if (interfacesWithSameSource.has(lastSegment)) {
|
|
202
|
+
(_a = interfacesWithSameSource.get(lastSegment)) === null || _a === void 0 ? void 0 : _a.interfaces.push(theInterface);
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
interfacesWithSameSource.set(lastSegment, { navigationPropertyName: lastSegment, interfaces: [theInterface] });
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
return interfacesWithSameSource;
|
|
211
|
+
}
|
|
212
|
+
function filterInterfaces(program, interfaces, filter) {
|
|
213
|
+
let group = new Map();
|
|
214
|
+
for (const [_, theInterface] of interfaces) {
|
|
215
|
+
if (filter(program, theInterface)) {
|
|
216
|
+
let key = theInterface.name;
|
|
217
|
+
if (!group.has(key)) {
|
|
218
|
+
group.set(key, theInterface);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return group;
|
|
223
|
+
}
|
|
224
|
+
function reportInvalidUseDiagnostic(program, theInterface, decorator, navigationProperty) {
|
|
225
|
+
reportDiagnostic(program, {
|
|
226
|
+
code: "decorator-invalid-use",
|
|
227
|
+
target: theInterface,
|
|
228
|
+
messageId: "addressUrlsAreNotEqual",
|
|
229
|
+
format: {
|
|
230
|
+
decorator: decorator,
|
|
231
|
+
target: navigationProperty,
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
function addressUrlParametersAreEqual(addressUrlParameterItems) {
|
|
236
|
+
for (let i = 1; i < addressUrlParameterItems.length; i++) {
|
|
237
|
+
if (isEqual(addressUrlParameterItems[0], addressUrlParameterItems[i])) {
|
|
238
|
+
return true;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
161
243
|
//# sourceMappingURL=address-url.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-url.js","sourceRoot":"","sources":["../../../src/rules/address-url.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"address-url.js","sourceRoot":"","sources":["../../../src/rules/address-url.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAElB,wBAAwB,EACxB,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,wBAAwB,EACxB,QAAQ,GACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAiC,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AACxH,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGpD;;GAEG;AACH,MAAM,UAAU,iEAAiE,CAC/E,OAAgB;IAEhB,KAAK,MAAM,SAAS,IAAI,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC;QACvD,wBAAwB,CAAC,SAAS,EAAE;YAClC,SAAS,EAAE,CAAC,YAAY,EAAE,EAAE;gBAC1B,IAAI,aAAa,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE,CAAC;oBACzC,6BAA6B,CAAC,OAAO,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;gBACtE,CAAC;YACH,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C;AACd,CAAC;AAED,SAAS,0BAA0B,CAAC,OAAgB,EAAE,YAAiB,EAAE,SAAiB,EAAE,kBAA0B;IACpH,gBAAgB,CAAC,OAAO,EAAE;QACxB,IAAI,EAAE,uBAAuB;QAC7B,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,wBAAwB;QACnC,MAAM,EAAE;YACN,SAAS,EAAE,SAAS;YACpB,MAAM,EAAE,kBAAkB;SAC3B;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAS,4BAA4B,CAAC,wBAA+C;IACnF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,wBAAwB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACzD,IAAI,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACtE,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delta.d.ts","sourceRoot":"","sources":["../../../src/rules/delta.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8C,OAAO,
|
|
1
|
+
{"version":3,"file":"delta.d.ts","sourceRoot":"","sources":["../../../src/rules/delta.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8C,OAAO,EAA0D,MAAM,oBAAoB,CAAC;AAOjJ,wBAAgB,kDAAkD,CAAC,OAAO,EAAE,OAAO,QAmBlF;AAED,wBAAgB,uCAAuC,CAAC,OAAO,EAAE,OAAO,QAkBvE;AAED,wBAAgB,qEAAqE,CAAC,OAAO,EAAE,OAAO,QAwBrG;AAED,wBAAgB,4DAA4D,CAAC,OAAO,EAAE,OAAO,QA2B5F;AAED,wBAAgB,2DAA2D,CAAC,OAAO,EAAE,OAAO,QAiC3F;AAED,wBAAgB,kEAAkE,CAAC,OAAO,EAAE,OAAO,QA8BlG"}
|
package/dist/src/rules/delta.js
CHANGED
|
@@ -2,7 +2,7 @@ import { getPropertyType, navigateTypesInNamespace } from "@typespec/compiler";
|
|
|
2
2
|
import { GetDeclaredNamespaces } from "../entities/namespace.js";
|
|
3
3
|
import { isDelta, isEntity, isFunction } from "../index.js";
|
|
4
4
|
import { reportDiagnostic } from "../lib.js";
|
|
5
|
-
import { extractTypesFromUnion, filterMapByIdenticalValues, getNavigationSourceType, getSourceInterfaces, isCollection, isNavigationProperty } from "../utils.js";
|
|
5
|
+
import { extractTypesFromUnion, filterMapByIdenticalValues, getInterfaceNavigationSourceType, getNavigationSourceType, getSourceInterfaces, isCollection, isNavigationProperty } from "../utils.js";
|
|
6
6
|
import { getOperationVerb } from "@typespec/http";
|
|
7
7
|
export function validateDeltaCanOnlyBeAppliedToFunctionsNamedDelta(program) {
|
|
8
8
|
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
@@ -130,17 +130,16 @@ export function validateNavigationPropertyShouldBeTargettedByOneInterfaceWithDel
|
|
|
130
130
|
const deltaInterfacesWithSameNavigationSource = getInterfacesWithNavigationSources(program, namespace.interfaces);
|
|
131
131
|
const allRepeatedNavigationSources = [...deltaInterfacesWithSameNavigationSource.values()];
|
|
132
132
|
// Get all navigation properties that are used in the models
|
|
133
|
-
const navigationPropertyTypes =
|
|
133
|
+
const navigationPropertyTypes = getNavigationProperties(program, namespace);
|
|
134
134
|
// Check if the navigation source type is used as a navigation property in the models and add them to a list to report all at once
|
|
135
135
|
let modelPropertiesToReport = [];
|
|
136
136
|
for (let i = 0; i < navigationPropertyTypes.length; i++) {
|
|
137
|
-
if (allRepeatedNavigationSources.includes(navigationPropertyTypes[i].name)) {
|
|
137
|
+
if (allRepeatedNavigationSources.includes(navigationPropertyTypes[i].type.name)) {
|
|
138
138
|
modelPropertiesToReport.push(navigationPropertyTypes[i].name);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
modelPropertiesToReport = [...new Set(modelPropertiesToReport)];
|
|
142
142
|
if (modelPropertiesToReport.length > 0) {
|
|
143
|
-
console.log("reporting");
|
|
144
143
|
reportDiagnostic(program, {
|
|
145
144
|
code: "decorator-invalid-use",
|
|
146
145
|
target: navigationPropertyTypes.find((model) => model.name === modelPropertiesToReport[0]), // Because we cannot target more than one at a time
|
|
@@ -152,14 +151,14 @@ export function validateNavigationPropertyShouldBeTargettedByOneInterfaceWithDel
|
|
|
152
151
|
}
|
|
153
152
|
}
|
|
154
153
|
}
|
|
155
|
-
function
|
|
154
|
+
function getNavigationProperties(program, namespace) {
|
|
156
155
|
const modelsInNamespace = [...namespace.models].map(([_, model]) => model);
|
|
157
156
|
const allModelProperties = modelsInNamespace.flatMap((model) => model.properties);
|
|
158
157
|
let navigationPropertyTypes = [];
|
|
159
158
|
for (const properties of allModelProperties) {
|
|
160
159
|
for (const [_, property] of properties) {
|
|
161
160
|
if (isNavigationProperty(program, property) && getPropertyType(property).kind === "Model") {
|
|
162
|
-
navigationPropertyTypes.push(property
|
|
161
|
+
navigationPropertyTypes.push((property));
|
|
163
162
|
}
|
|
164
163
|
}
|
|
165
164
|
}
|
|
@@ -171,7 +170,7 @@ function getInterfacesWithNavigationSources(program, interfaces) {
|
|
|
171
170
|
const theOperations = theInterface.operations;
|
|
172
171
|
for (const [_, theOperation] of theOperations) {
|
|
173
172
|
if (isDelta(program, theOperation)) {
|
|
174
|
-
const navigationSourceType =
|
|
173
|
+
const navigationSourceType = getInterfaceNavigationSourceType(program, theInterface);
|
|
175
174
|
if (navigationSourceType) {
|
|
176
175
|
interfacesWithNavigationSourceType.set(theInterface, navigationSourceType.name);
|
|
177
176
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delta.js","sourceRoot":"","sources":["../../../src/rules/delta.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"delta.js","sourceRoot":"","sources":["../../../src/rules/delta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoE,eAAe,EAAE,wBAAwB,EAAE,MAAM,oBAAo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KAAK,WAAW,EAAC,CAAC;QAClC,OAAO,oBAAoB,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentation.d.ts","sourceRoot":"","sources":["../../../src/rules/documentation.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iCAAiC;;EA2F5C,CAAA"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { createRule, getDoc, paramMessage } from "@typespec/compiler";
|
|
2
|
+
import { isComplex, isEntity } from "../index.js";
|
|
3
|
+
import { isExcludedCoreType } from "../utils.js";
|
|
4
|
+
export const validateCoreElementsHaveDocString = createRule({
|
|
5
|
+
name: "require-documentation-for-core-elements",
|
|
6
|
+
severity: "warning",
|
|
7
|
+
description: "Require documentation for models, model properties, enums, enum members, actions and functions",
|
|
8
|
+
messages: {
|
|
9
|
+
default: paramMessage `Models, model properties, enums, enum members, actions and functions must have documentation`
|
|
10
|
+
},
|
|
11
|
+
create(context) {
|
|
12
|
+
return {
|
|
13
|
+
model: (model) => {
|
|
14
|
+
if (isExcludedCoreType(context.program, model)) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (!isEntity(context.program, model) && !isComplex(context.program, model))
|
|
18
|
+
return;
|
|
19
|
+
const doc = getDoc(context.program, model);
|
|
20
|
+
if (!doc || doc.trim().length === 0) {
|
|
21
|
+
context.reportDiagnostic({
|
|
22
|
+
target: model,
|
|
23
|
+
format: {
|
|
24
|
+
target: model.name
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
for (const property of model.properties.values()) {
|
|
29
|
+
if (isExcludedCoreType(context.program, property)) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
const propDoc = getDoc(context.program, property);
|
|
33
|
+
if (!propDoc || propDoc.trim().length === 0) {
|
|
34
|
+
context.reportDiagnostic({
|
|
35
|
+
target: property,
|
|
36
|
+
format: {
|
|
37
|
+
target: property.name
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
enum: (enumType) => {
|
|
44
|
+
if (isExcludedCoreType(context.program, enumType)) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const doc = getDoc(context.program, enumType);
|
|
48
|
+
if (!doc || doc.trim().length === 0) {
|
|
49
|
+
context.reportDiagnostic({
|
|
50
|
+
target: enumType,
|
|
51
|
+
format: {
|
|
52
|
+
target: enumType.name
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
for (const member of enumType.members.values()) {
|
|
57
|
+
if (member.name === "unknownFutureValue") {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const memberDoc = getDoc(context.program, member);
|
|
61
|
+
if (!memberDoc || memberDoc.trim().length === 0) {
|
|
62
|
+
context.reportDiagnostic({
|
|
63
|
+
target: member,
|
|
64
|
+
format: {
|
|
65
|
+
target: member.name
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
operation: (operation) => {
|
|
72
|
+
if (isExcludedCoreType(context.program, operation) || operation.kind !== "Operation") {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const doc = getDoc(context.program, operation);
|
|
76
|
+
if (!doc || doc.trim().length === 0) {
|
|
77
|
+
context.reportDiagnostic({
|
|
78
|
+
target: operation,
|
|
79
|
+
format: {
|
|
80
|
+
target: operation.name
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=documentation.js.map
|