@microsoft/typespec-msgraph 0.0.1-Preview.8 → 1.0.0-Preview.2
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/acceptable-media-types-annotation.js.map +1 -1
- package/dist/src/components/alternate-keys-annotation.js +2 -1
- package/dist/src/components/alternate-keys-annotation.js.map +1 -1
- package/dist/src/components/annotations.d.ts +6 -3
- package/dist/src/components/annotations.d.ts.map +1 -1
- package/dist/src/components/annotations.js +67 -7
- package/dist/src/components/annotations.js.map +1 -1
- package/dist/src/components/common-elements.d.ts +7 -7
- package/dist/src/components/common-elements.d.ts.map +1 -1
- package/dist/src/components/common-elements.js.map +1 -1
- package/dist/src/components/delta-annotation.d.ts +6 -0
- package/dist/src/components/delta-annotation.d.ts.map +1 -0
- package/dist/src/components/delta-annotation.js +18 -0
- package/dist/src/components/delta-annotation.js.map +1 -0
- package/dist/src/components/entity-container-element.d.ts.map +1 -1
- package/dist/src/components/entity-container-element.js +16 -6
- package/dist/src/components/entity-container-element.js.map +1 -1
- package/dist/src/components/enum-type-element.d.ts.map +1 -1
- package/dist/src/components/enum-type-element.js +6 -3
- package/dist/src/components/enum-type-element.js.map +1 -1
- package/dist/src/components/filter-restrictions-annotation.js +1 -1
- package/dist/src/components/filter-restrictions-annotation.js.map +1 -1
- package/dist/src/components/index.js +3 -3
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/components/is-url-annotation.d.ts +5 -0
- package/dist/src/components/is-url-annotation.d.ts.map +1 -0
- package/dist/src/components/is-url-annotation.js +6 -0
- package/dist/src/components/is-url-annotation.js.map +1 -0
- package/dist/src/components/open-property-type-constraint-annotation-element.d.ts +5 -0
- package/dist/src/components/open-property-type-constraint-annotation-element.d.ts.map +1 -0
- package/dist/src/components/open-property-type-constraint-annotation-element.js +7 -0
- package/dist/src/components/open-property-type-constraint-annotation-element.js.map +1 -0
- package/dist/src/components/operation-element.d.ts.map +1 -1
- package/dist/src/components/operation-element.js +30 -15
- package/dist/src/components/operation-element.js.map +1 -1
- package/dist/src/components/permissions-annotation.js.map +1 -1
- package/dist/src/components/property-element.d.ts.map +1 -1
- package/dist/src/components/property-element.js +8 -4
- package/dist/src/components/property-element.js.map +1 -1
- package/dist/src/components/reference-target-element.d.ts +9 -0
- package/dist/src/components/reference-target-element.d.ts.map +1 -0
- package/dist/src/components/reference-target-element.js +3 -0
- package/dist/src/components/reference-target-element.js.map +1 -0
- package/dist/src/components/revisions-annotation.d.ts.map +1 -1
- package/dist/src/components/revisions-annotation.js +2 -1
- package/dist/src/components/revisions-annotation.js.map +1 -1
- package/dist/src/components/schema-element.d.ts.map +1 -1
- package/dist/src/components/schema-element.js +9 -3
- package/dist/src/components/schema-element.js.map +1 -1
- package/dist/src/components/select-supported-annotation.d.ts +5 -0
- package/dist/src/components/select-supported-annotation.d.ts.map +1 -0
- package/dist/src/components/select-supported-annotation.js +6 -0
- package/dist/src/components/select-supported-annotation.js.map +1 -0
- package/dist/src/components/structured-type-element.d.ts.map +1 -1
- package/dist/src/components/structured-type-element.js +8 -6
- package/dist/src/components/structured-type-element.js.map +1 -1
- package/dist/src/components/term-element.d.ts +9 -0
- package/dist/src/components/term-element.d.ts.map +1 -0
- package/dist/src/components/term-element.js +8 -0
- package/dist/src/components/term-element.js.map +1 -0
- package/dist/src/components/top-supported-annotation.js +1 -1
- package/dist/src/components/top-supported-annotation.js.map +1 -1
- package/dist/src/components/update-restrictions-annotation.d.ts +2 -1
- package/dist/src/components/update-restrictions-annotation.d.ts.map +1 -1
- package/dist/src/components/update-restrictions-annotation.js +4 -4
- package/dist/src/components/update-restrictions-annotation.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 +14 -0
- package/dist/src/decorators/address-url-msa.d.ts.map +1 -0
- package/dist/src/decorators/address-url-msa.js +21 -0
- package/dist/src/decorators/address-url-msa.js.map +1 -0
- package/dist/src/decorators/address-url.d.ts +18 -0
- package/dist/src/decorators/address-url.d.ts.map +1 -0
- package/dist/src/decorators/address-url.js +21 -0
- package/dist/src/decorators/address-url.js.map +1 -0
- package/dist/src/decorators/ags-attribute.d.ts +7 -3
- package/dist/src/decorators/ags-attribute.d.ts.map +1 -1
- package/dist/src/decorators/ags-attribute.js +102 -3
- package/dist/src/decorators/ags-attribute.js.map +1 -1
- package/dist/src/decorators/allowed-values.d.ts +15 -0
- package/dist/src/decorators/allowed-values.d.ts.map +1 -0
- package/dist/src/decorators/allowed-values.js +37 -0
- package/dist/src/decorators/allowed-values.js.map +1 -0
- package/dist/src/decorators/complex.d.ts +2 -0
- package/dist/src/decorators/complex.d.ts.map +1 -1
- package/dist/src/decorators/complex.js +2 -0
- package/dist/src/decorators/complex.js.map +1 -1
- package/dist/src/decorators/computed.d.ts +2 -0
- package/dist/src/decorators/computed.d.ts.map +1 -1
- package/dist/src/decorators/computed.js +2 -0
- package/dist/src/decorators/computed.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/count.d.ts +2 -0
- package/dist/src/decorators/count.d.ts.map +1 -1
- package/dist/src/decorators/count.js +2 -0
- package/dist/src/decorators/count.js.map +1 -1
- package/dist/src/decorators/delta.d.ts +10 -0
- package/dist/src/decorators/delta.d.ts.map +1 -0
- package/dist/src/decorators/delta.js +14 -0
- package/dist/src/decorators/delta.js.map +1 -0
- 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/entity.d.ts +3 -0
- package/dist/src/decorators/entity.d.ts.map +1 -1
- package/dist/src/decorators/entity.js +7 -1
- package/dist/src/decorators/entity.js.map +1 -1
- package/dist/src/decorators/expand.d.ts +3 -0
- package/dist/src/decorators/expand.d.ts.map +1 -1
- package/dist/src/decorators/expand.js +7 -1
- package/dist/src/decorators/expand.js.map +1 -1
- package/dist/src/decorators/experimental.d.ts +11 -0
- package/dist/src/decorators/experimental.d.ts.map +1 -0
- package/dist/src/decorators/experimental.js +15 -0
- package/dist/src/decorators/experimental.js.map +1 -0
- package/dist/src/decorators/filter.d.ts +3 -1
- package/dist/src/decorators/filter.d.ts.map +1 -1
- package/dist/src/decorators/filter.js +9 -7
- package/dist/src/decorators/filter.js.map +1 -1
- package/dist/src/decorators/function.d.ts +9 -2
- package/dist/src/decorators/function.d.ts.map +1 -1
- package/dist/src/decorators/function.js +7 -2
- package/dist/src/decorators/function.js.map +1 -1
- package/dist/src/decorators/global-operation.d.ts +11 -0
- package/dist/src/decorators/global-operation.d.ts.map +1 -0
- package/dist/src/decorators/global-operation.js +15 -0
- package/dist/src/decorators/global-operation.js.map +1 -0
- package/dist/src/decorators/graph-deprecated.d.ts +13 -0
- package/dist/src/decorators/graph-deprecated.d.ts.map +1 -0
- package/dist/src/decorators/graph-deprecated.js +21 -0
- package/dist/src/decorators/graph-deprecated.js.map +1 -0
- package/dist/src/decorators/graph-partial.d.ts +12 -0
- package/dist/src/decorators/graph-partial.d.ts.map +1 -0
- package/dist/src/decorators/graph-partial.js +18 -0
- package/dist/src/decorators/graph-partial.js.map +1 -0
- package/dist/src/decorators/graph-route.d.ts +13 -2
- package/dist/src/decorators/graph-route.d.ts.map +1 -1
- package/dist/src/decorators/graph-route.js +67 -15
- 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 +23 -3
- package/dist/src/decorators/index.d.ts.map +1 -1
- package/dist/src/decorators/index.js +23 -3
- package/dist/src/decorators/index.js.map +1 -1
- package/dist/src/decorators/is-owner.d.ts +5 -2
- package/dist/src/decorators/is-owner.d.ts.map +1 -1
- package/dist/src/decorators/is-owner.js +9 -4
- package/dist/src/decorators/is-owner.js.map +1 -1
- package/dist/src/decorators/limited-charset.d.ts +11 -0
- package/dist/src/decorators/limited-charset.d.ts.map +1 -0
- package/dist/src/decorators/limited-charset.js +15 -0
- package/dist/src/decorators/limited-charset.js.map +1 -0
- package/dist/src/decorators/media.d.ts +12 -0
- package/dist/src/decorators/media.d.ts.map +1 -0
- package/dist/src/decorators/media.js +18 -0
- package/dist/src/decorators/media.js.map +1 -0
- 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/order-by.d.ts +2 -0
- package/dist/src/decorators/order-by.d.ts.map +1 -1
- package/dist/src/decorators/order-by.js +2 -0
- package/dist/src/decorators/order-by.js.map +1 -1
- package/dist/src/decorators/ownerless.d.ts +10 -0
- package/dist/src/decorators/ownerless.d.ts.map +1 -0
- package/dist/src/decorators/ownerless.js +14 -0
- package/dist/src/decorators/ownerless.js.map +1 -0
- package/dist/src/decorators/passthrough-address-url-msa.d.ts +14 -0
- package/dist/src/decorators/passthrough-address-url-msa.d.ts.map +1 -0
- package/dist/src/decorators/passthrough-address-url-msa.js +20 -0
- package/dist/src/decorators/passthrough-address-url-msa.js.map +1 -0
- package/dist/src/decorators/passthrough-address-url.d.ts +14 -0
- package/dist/src/decorators/passthrough-address-url.d.ts.map +1 -0
- package/dist/src/decorators/passthrough-address-url.js +20 -0
- package/dist/src/decorators/passthrough-address-url.js.map +1 -0
- 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-definition.d.ts +2 -0
- package/dist/src/decorators/private-preview-definition.d.ts.map +1 -1
- package/dist/src/decorators/private-preview-definition.js +2 -0
- package/dist/src/decorators/private-preview-definition.js.map +1 -1
- package/dist/src/decorators/private-preview.d.ts +4 -2
- package/dist/src/decorators/private-preview.d.ts.map +1 -1
- package/dist/src/decorators/private-preview.js +2 -0
- 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/public-namespace.d.ts +12 -0
- package/dist/src/decorators/public-namespace.d.ts.map +1 -0
- package/dist/src/decorators/public-namespace.js +21 -0
- package/dist/src/decorators/public-namespace.js.map +1 -0
- 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 +17 -0
- package/dist/src/decorators/reference-target.d.ts.map +1 -0
- package/dist/src/decorators/reference-target.js +59 -0
- package/dist/src/decorators/reference-target.js.map +1 -0
- 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/required-for-create.d.ts +2 -0
- package/dist/src/decorators/required-for-create.d.ts.map +1 -1
- package/dist/src/decorators/required-for-create.js +2 -0
- package/dist/src/decorators/required-for-create.js.map +1 -1
- package/dist/src/decorators/return-source.d.ts +11 -0
- package/dist/src/decorators/return-source.d.ts.map +1 -0
- package/dist/src/decorators/return-source.js +28 -0
- package/dist/src/decorators/return-source.js.map +1 -0
- package/dist/src/decorators/search.d.ts +2 -0
- package/dist/src/decorators/search.d.ts.map +1 -1
- package/dist/src/decorators/search.js +2 -0
- package/dist/src/decorators/search.js.map +1 -1
- package/dist/src/decorators/select.d.ts +11 -0
- package/dist/src/decorators/select.d.ts.map +1 -0
- package/dist/src/decorators/select.js +15 -0
- package/dist/src/decorators/select.js.map +1 -0
- package/dist/src/decorators/shared-entity.d.ts +9 -0
- package/dist/src/decorators/shared-entity.d.ts.map +1 -0
- package/dist/src/decorators/shared-entity.js +15 -0
- package/dist/src/decorators/shared-entity.js.map +1 -0
- package/dist/src/decorators/skip.d.ts +2 -0
- package/dist/src/decorators/skip.d.ts.map +1 -1
- package/dist/src/decorators/skip.js +2 -0
- package/dist/src/decorators/skip.js.map +1 -1
- package/dist/src/decorators/term.d.ts +13 -0
- package/dist/src/decorators/term.d.ts.map +1 -0
- package/dist/src/decorators/term.js +14 -0
- package/dist/src/decorators/term.js.map +1 -0
- package/dist/src/decorators/top.d.ts +2 -0
- package/dist/src/decorators/top.d.ts.map +1 -1
- package/dist/src/decorators/top.js +2 -0
- package/dist/src/decorators/top.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 +12 -0
- package/dist/src/decorators/workload-namespace.d.ts.map +1 -0
- package/dist/src/decorators/workload-namespace.js +21 -0
- package/dist/src/decorators/workload-namespace.js.map +1 -0
- 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/dom/error-interceptor.d.ts +2 -0
- package/dist/src/dom/error-interceptor.d.ts.map +1 -0
- package/dist/src/dom/error-interceptor.js +13 -0
- package/dist/src/dom/error-interceptor.js.map +1 -0
- package/dist/src/dom/reconciler.js.map +1 -1
- package/dist/src/dom/renderer.d.ts +1 -0
- package/dist/src/dom/renderer.d.ts.map +1 -1
- package/dist/src/dom/renderer.js +1 -0
- package/dist/src/dom/renderer.js.map +1 -1
- package/dist/src/emitter.d.ts +2 -1
- package/dist/src/emitter.d.ts.map +1 -1
- package/dist/src/emitter.js +31 -2
- package/dist/src/emitter.js.map +1 -1
- package/dist/src/entities/address-url.d.ts +8 -0
- package/dist/src/entities/address-url.d.ts.map +1 -0
- package/dist/src/entities/address-url.js +47 -0
- package/dist/src/entities/address-url.js.map +1 -0
- package/dist/src/entities/annotations.d.ts +23 -4
- package/dist/src/entities/annotations.d.ts.map +1 -1
- package/dist/src/entities/annotations.js +137 -72
- package/dist/src/entities/annotations.js.map +1 -1
- package/dist/src/entities/entity-container.d.ts +21 -0
- package/dist/src/entities/entity-container.d.ts.map +1 -1
- package/dist/src/entities/entity-container.js +33 -4
- package/dist/src/entities/entity-container.js.map +1 -1
- package/dist/src/entities/enum.d.ts +3 -1
- package/dist/src/entities/enum.d.ts.map +1 -1
- package/dist/src/entities/enum.js +10 -5
- package/dist/src/entities/enum.js.map +1 -1
- package/dist/src/entities/model.d.ts +38 -9
- package/dist/src/entities/model.d.ts.map +1 -1
- package/dist/src/entities/model.js +311 -14
- package/dist/src/entities/model.js.map +1 -1
- package/dist/src/entities/ms-graph-route.d.ts +13 -0
- package/dist/src/entities/ms-graph-route.d.ts.map +1 -0
- package/dist/src/entities/ms-graph-route.js +67 -0
- package/dist/src/entities/ms-graph-route.js.map +1 -0
- package/dist/src/entities/namespace.d.ts +27 -4
- package/dist/src/entities/namespace.d.ts.map +1 -1
- package/dist/src/entities/namespace.js +321 -29
- package/dist/src/entities/namespace.js.map +1 -1
- package/dist/src/entities/operation.d.ts +18 -0
- package/dist/src/entities/operation.d.ts.map +1 -1
- package/dist/src/entities/operation.js +143 -21
- package/dist/src/entities/operation.js.map +1 -1
- package/dist/src/entities/property.d.ts.map +1 -1
- package/dist/src/entities/property.js +7 -0
- package/dist/src/entities/property.js.map +1 -1
- package/dist/src/entities/revision-definition.d.ts +3 -2
- package/dist/src/entities/revision-definition.d.ts.map +1 -1
- package/dist/src/entities/revision-definition.js +17 -6
- package/dist/src/entities/revision-definition.js.map +1 -1
- package/dist/src/entities/term.d.ts +8 -0
- package/dist/src/entities/term.d.ts.map +1 -0
- package/dist/src/entities/term.js +14 -0
- package/dist/src/entities/term.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +139 -94
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +92 -11
- package/dist/src/lib.js.map +1 -1
- package/dist/src/linter.d.ts +1 -2
- package/dist/src/linter.d.ts.map +1 -1
- package/dist/src/linter.js +32 -38
- package/dist/src/linter.js.map +1 -1
- package/dist/src/path-tree.d.ts +16 -0
- package/dist/src/path-tree.d.ts.map +1 -0
- package/dist/src/path-tree.js +76 -0
- package/dist/src/path-tree.js.map +1 -0
- package/dist/src/rules/abstract.d.ts +2 -1
- package/dist/src/rules/abstract.d.ts.map +1 -1
- package/dist/src/rules/abstract.js +8 -8
- package/dist/src/rules/abstract.js.map +1 -1
- package/dist/src/rules/address-url.d.ts +20 -0
- package/dist/src/rules/address-url.d.ts.map +1 -0
- package/dist/src/rules/address-url.js +248 -0
- package/dist/src/rules/address-url.js.map +1 -0
- package/dist/src/rules/allowed-values.d.ts +7 -0
- package/dist/src/rules/allowed-values.d.ts.map +1 -0
- package/dist/src/rules/allowed-values.js +59 -0
- package/dist/src/rules/allowed-values.js.map +1 -0
- package/dist/src/rules/alternate-key.d.ts +4 -3
- package/dist/src/rules/alternate-key.d.ts.map +1 -1
- package/dist/src/rules/alternate-key.js +23 -23
- package/dist/src/rules/alternate-key.js.map +1 -1
- package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts +2 -1
- package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts.map +1 -1
- package/dist/src/rules/collection-navigation-properties-not-nullable.js +9 -9
- package/dist/src/rules/collection-navigation-properties-not-nullable.js.map +1 -1
- package/dist/src/rules/complex.d.ts +3 -0
- package/dist/src/rules/complex.d.ts.map +1 -0
- package/dist/src/rules/complex.js +27 -0
- package/dist/src/rules/complex.js.map +1 -0
- package/dist/src/rules/computed.d.ts +2 -3
- package/dist/src/rules/computed.d.ts.map +1 -1
- package/dist/src/rules/computed.js +14 -16
- package/dist/src/rules/computed.js.map +1 -1
- package/dist/src/rules/contains.d.ts +2 -1
- package/dist/src/rules/contains.d.ts.map +1 -1
- package/dist/src/rules/contains.js +9 -8
- package/dist/src/rules/contains.js.map +1 -1
- package/dist/src/rules/count.d.ts +2 -1
- package/dist/src/rules/count.d.ts.map +1 -1
- package/dist/src/rules/count.js +9 -8
- package/dist/src/rules/count.js.map +1 -1
- package/dist/src/rules/delta.d.ts +8 -0
- package/dist/src/rules/delta.d.ts.map +1 -0
- package/dist/src/rules/delta.js +208 -0
- package/dist/src/rules/delta.js.map +1 -0
- package/dist/src/rules/disallowed-typespec-decorators.d.ts +2 -1
- package/dist/src/rules/disallowed-typespec-decorators.d.ts.map +1 -1
- package/dist/src/rules/disallowed-typespec-decorators.js +29 -25
- package/dist/src/rules/disallowed-typespec-decorators.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 +91 -0
- package/dist/src/rules/documentation.js.map +1 -0
- package/dist/src/rules/entity.d.ts +9 -2
- package/dist/src/rules/entity.d.ts.map +1 -1
- package/dist/src/rules/entity.js +170 -17
- package/dist/src/rules/entity.js.map +1 -1
- package/dist/src/rules/enum.d.ts +5 -1
- package/dist/src/rules/enum.d.ts.map +1 -1
- package/dist/src/rules/enum.js +35 -6
- package/dist/src/rules/enum.js.map +1 -1
- package/dist/src/rules/expand.d.ts +3 -2
- package/dist/src/rules/expand.d.ts.map +1 -1
- package/dist/src/rules/expand.js +25 -20
- package/dist/src/rules/expand.js.map +1 -1
- package/dist/src/rules/extends-on-same-type.d.ts +2 -1
- package/dist/src/rules/extends-on-same-type.d.ts.map +1 -1
- package/dist/src/rules/extends-on-same-type.js +9 -8
- package/dist/src/rules/extends-on-same-type.js.map +1 -1
- package/dist/src/rules/filter.d.ts +6 -3
- package/dist/src/rules/filter.d.ts.map +1 -1
- package/dist/src/rules/filter.js +100 -32
- package/dist/src/rules/filter.js.map +1 -1
- package/dist/src/rules/function.d.ts +3 -1
- package/dist/src/rules/function.d.ts.map +1 -1
- package/dist/src/rules/function.js +48 -9
- package/dist/src/rules/function.js.map +1 -1
- package/dist/src/rules/global-operation.d.ts +4 -0
- package/dist/src/rules/global-operation.d.ts.map +1 -0
- package/dist/src/rules/global-operation.js +60 -0
- package/dist/src/rules/global-operation.js.map +1 -0
- package/dist/src/rules/graph-deprecated.d.ts +8 -0
- package/dist/src/rules/graph-deprecated.d.ts.map +1 -0
- package/dist/src/rules/graph-deprecated.js +152 -0
- package/dist/src/rules/graph-deprecated.js.map +1 -0
- package/dist/src/rules/graph-partial.d.ts +9 -0
- package/dist/src/rules/graph-partial.d.ts.map +1 -0
- package/dist/src/rules/graph-partial.js +84 -0
- package/dist/src/rules/graph-partial.js.map +1 -0
- package/dist/src/rules/graph-route.d.ts +13 -1
- package/dist/src/rules/graph-route.d.ts.map +1 -1
- package/dist/src/rules/graph-route.js +375 -19
- package/dist/src/rules/graph-route.js.map +1 -1
- package/dist/src/rules/index.d.ts +18 -2
- package/dist/src/rules/index.d.ts.map +1 -1
- package/dist/src/rules/index.js +18 -2
- package/dist/src/rules/index.js.map +1 -1
- package/dist/src/rules/limited-charset.d.ts +3 -0
- package/dist/src/rules/limited-charset.d.ts.map +1 -0
- package/dist/src/rules/limited-charset.js +42 -0
- package/dist/src/rules/limited-charset.js.map +1 -0
- package/dist/src/rules/media.d.ts +10 -0
- package/dist/src/rules/media.d.ts.map +1 -0
- package/dist/src/rules/media.js +122 -0
- package/dist/src/rules/media.js.map +1 -0
- package/dist/src/rules/model.d.ts +10 -0
- package/dist/src/rules/model.d.ts.map +1 -0
- package/dist/src/rules/model.js +131 -0
- package/dist/src/rules/model.js.map +1 -0
- package/dist/src/rules/namespace.d.ts +6 -0
- package/dist/src/rules/namespace.d.ts.map +1 -0
- package/dist/src/rules/namespace.js +110 -0
- package/dist/src/rules/namespace.js.map +1 -0
- package/dist/src/rules/open.d.ts +2 -1
- package/dist/src/rules/open.d.ts.map +1 -1
- package/dist/src/rules/open.js +9 -8
- package/dist/src/rules/open.js.map +1 -1
- package/dist/src/rules/operation-inside-interface.d.ts +6 -1
- package/dist/src/rules/operation-inside-interface.d.ts.map +1 -1
- package/dist/src/rules/operation-inside-interface.js +78 -7
- package/dist/src/rules/operation-inside-interface.js.map +1 -1
- package/dist/src/rules/order-by.d.ts +3 -2
- package/dist/src/rules/order-by.d.ts.map +1 -1
- package/dist/src/rules/order-by.js +19 -19
- package/dist/src/rules/order-by.js.map +1 -1
- package/dist/src/rules/ownerless.d.ts +11 -0
- package/dist/src/rules/ownerless.d.ts.map +1 -0
- package/dist/src/rules/ownerless.js +170 -0
- package/dist/src/rules/ownerless.js.map +1 -0
- package/dist/src/rules/record-t.d.ts +11 -0
- package/dist/src/rules/record-t.d.ts.map +1 -0
- package/dist/src/rules/record-t.js +129 -0
- package/dist/src/rules/record-t.js.map +1 -0
- package/dist/src/rules/reference-target.d.ts +6 -0
- package/dist/src/rules/reference-target.d.ts.map +1 -0
- package/dist/src/rules/reference-target.js +113 -0
- package/dist/src/rules/reference-target.js.map +1 -0
- package/dist/src/rules/references.d.ts +2 -1
- package/dist/src/rules/references.d.ts.map +1 -1
- package/dist/src/rules/references.js +9 -8
- package/dist/src/rules/references.js.map +1 -1
- package/dist/src/rules/required-for-create.d.ts +2 -1
- package/dist/src/rules/required-for-create.d.ts.map +1 -1
- package/dist/src/rules/required-for-create.js +11 -10
- package/dist/src/rules/required-for-create.js.map +1 -1
- package/dist/src/rules/return-source.d.ts +3 -0
- package/dist/src/rules/return-source.d.ts.map +1 -0
- package/dist/src/rules/return-source.js +27 -0
- package/dist/src/rules/return-source.js.map +1 -0
- package/dist/src/rules/search.d.ts +2 -1
- package/dist/src/rules/search.d.ts.map +1 -1
- package/dist/src/rules/search.js +9 -8
- package/dist/src/rules/search.js.map +1 -1
- package/dist/src/rules/shared-entity.d.ts +8 -0
- package/dist/src/rules/shared-entity.d.ts.map +1 -0
- package/dist/src/rules/shared-entity.js +176 -0
- package/dist/src/rules/shared-entity.js.map +1 -0
- package/dist/src/rules/skip.d.ts +2 -1
- package/dist/src/rules/skip.d.ts.map +1 -1
- package/dist/src/rules/skip.js +9 -8
- package/dist/src/rules/skip.js.map +1 -1
- package/dist/src/rules/top.d.ts +2 -1
- package/dist/src/rules/top.d.ts.map +1 -1
- package/dist/src/rules/top.js +9 -8
- package/dist/src/rules/top.js.map +1 -1
- package/dist/src/testing/index.d.ts +1 -0
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +21 -0
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/utils.d.ts +69 -13
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +651 -76
- package/dist/src/utils.js.map +1 -1
- package/dist/src/validate.d.ts +3 -0
- package/dist/src/validate.d.ts.map +1 -0
- package/dist/src/validate.js +98 -0
- package/dist/src/validate.js.map +1 -0
- package/lib/bodies.tsp +71 -0
- package/lib/decorators.tsp +282 -75
- package/lib/deployment.tsp +1 -1
- package/lib/lib.tsp +4 -2
- package/lib/msgraph.tsp +1 -0
- package/lib/porcelain.tsp +82 -27
- package/lib/responses.tsp +20 -43
- package/lib/shared-models.tsp +10 -54
- package/package.json +24 -26
- 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
- package/dist/src/decorators/has-stream.d.ts +0 -10
- package/dist/src/decorators/has-stream.d.ts.map +0 -1
- package/dist/src/decorators/has-stream.js +0 -17
- package/dist/src/decorators/has-stream.js.map +0 -1
- package/dist/src/rules/has-stream.d.ts +0 -2
- package/dist/src/rules/has-stream.d.ts.map +0 -1
- package/dist/src/rules/has-stream.js +0 -29
- package/dist/src/rules/has-stream.js.map +0 -1
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { buildAttributes } from "../decorators/ags-attribute.js";
|
|
2
|
-
import { getPropertyTypeName, getInterfaceNavigationSourceType, } from "../utils.js";
|
|
2
|
+
import { getPropertyTypeName, getInterfaceNavigationSourceType, getDeltaProperties, } from "../utils.js";
|
|
3
|
+
import { getMsGraphAddressUrl, getMsGraphAddressUrlMsa, getMsGraphPassthroughAddressUrl, getMsGraphPassthroughAddressUrlMsa } from "./address-url.js";
|
|
4
|
+
import { isDelta, isPartial } from "../index.js";
|
|
5
|
+
import { GetRevisionDefinition } from "./revision-definition.js";
|
|
3
6
|
export function GetSingletons(program, sources) {
|
|
4
7
|
const singletons = new Map();
|
|
5
8
|
sources.forEach((entity, routePath) => {
|
|
@@ -10,11 +13,22 @@ export function GetSingletons(program, sources) {
|
|
|
10
13
|
function getSingleton(program, routePath, entity) {
|
|
11
14
|
const singleton = entity.theInterface;
|
|
12
15
|
const type = getInterfaceNavigationSourceType(program, singleton);
|
|
13
|
-
|
|
16
|
+
let agsAttributes = {};
|
|
17
|
+
if (isPartial(program, type)) {
|
|
18
|
+
agsAttributes = { ...buildAttributes(program, singleton) };
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
agsAttributes = { ...getOperationAgsAttributes(program, entity.operations), ...buildAttributes(program, singleton) };
|
|
22
|
+
}
|
|
14
23
|
const entry = {
|
|
15
24
|
Name: routePath,
|
|
16
25
|
TypeName: getPropertyTypeName(program, type),
|
|
17
26
|
AgsAttributes: agsAttributes,
|
|
27
|
+
AddressUrl: getMsGraphAddressUrl(program, singleton),
|
|
28
|
+
AddressUrlMsa: getMsGraphAddressUrlMsa(program, singleton),
|
|
29
|
+
PassThroughAddressUrl: getMsGraphPassthroughAddressUrl(program, singleton),
|
|
30
|
+
PassThroughAddressUrlMsa: getMsGraphPassthroughAddressUrlMsa(program, singleton),
|
|
31
|
+
RevisionDefinition: GetRevisionDefinition(program, singleton, singleton.namespace)
|
|
18
32
|
};
|
|
19
33
|
return entry;
|
|
20
34
|
}
|
|
@@ -28,15 +42,30 @@ export function GetEntitySets(program, sources) {
|
|
|
28
42
|
function getEntitySet(program, routePath, entity) {
|
|
29
43
|
const entitySet = entity.theInterface;
|
|
30
44
|
const type = getInterfaceNavigationSourceType(program, entitySet);
|
|
31
|
-
|
|
45
|
+
let agsAttributes = {};
|
|
46
|
+
if (isPartial(program, type)) {
|
|
47
|
+
agsAttributes = { ...buildAttributes(program, entitySet) };
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
agsAttributes = { ...getOperationAgsAttributes(program, entity.operations), ...buildAttributes(program, entitySet) };
|
|
51
|
+
}
|
|
52
|
+
const deltaProperties = entity.operations.some(o => isDelta(program, o.theOperation)) ? getDeltaProperties(program, entity.theInterface) : undefined;
|
|
32
53
|
const entry = {
|
|
33
54
|
Name: routePath,
|
|
34
55
|
TypeName: getPropertyTypeName(program, type),
|
|
35
56
|
AgsAttributes: agsAttributes,
|
|
57
|
+
AddressUrl: getMsGraphAddressUrl(program, entitySet),
|
|
58
|
+
AddressUrlMsa: getMsGraphAddressUrlMsa(program, entitySet),
|
|
59
|
+
PassThroughAddressUrl: getMsGraphPassthroughAddressUrl(program, entitySet),
|
|
60
|
+
PassThroughAddressUrlMsa: getMsGraphPassthroughAddressUrlMsa(program, entitySet),
|
|
61
|
+
DeltaProperties: deltaProperties,
|
|
62
|
+
RevisionDefinition: GetRevisionDefinition(program, entitySet, entitySet.namespace)
|
|
36
63
|
};
|
|
37
64
|
return entry;
|
|
38
65
|
}
|
|
39
66
|
function getOperationAgsAttributes(program, operations) {
|
|
40
|
-
return operations
|
|
67
|
+
return operations
|
|
68
|
+
.map((operation) => operation.theOperation)
|
|
69
|
+
.reduce((attr, operation) => ({ ...attr, ...buildAttributes(program, operation) }), {});
|
|
41
70
|
}
|
|
42
71
|
//# sourceMappingURL=entity-container.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-container.js","sourceRoot":"","sources":["../../../src/entities/entity-container.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entity-container.js","sourceRoot":"","sources":["../../../src/entities/entity-container.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EACL,mBAAmB,EACnB,gCAAgC,EAGhC,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAqB,oBAAoB,EAAE,uBAAuB,EAAE,+BAA+B,EAAE,kCAAkC,EAAE,MAAM,kBAAkB,CAAC;AACzK,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAA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AAC,CAAC,SAAS,CAAC;IAErJ,MAAM,KAAK,GAAc;QACvB,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC;QAC5C,aAAa,EAAE,aAAa;QAC5B,UAAU,EAAE,oBAAoB,CAAC,OAAO,EAAE,SAAS,CAAC;QACpD,aAAa,EAAE,uBAAuB,CAAC,OAAO,EAAE,SAAS,CAAC;QAC1D,qBAAqB,EAAE,+BAA+B,CAAC,OAAO,EAAE,SAAS,CAAC;QAC1E,wBAAwB,EAAE,kCAAkC,CAAC,OAAO,EAAE,SAAS,CAAC;QAChF,eAAe,EAAE,eAAe;QAChC,kBAAkB,EAAE,qBAAqB,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC;KACnF,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,yBAAyB,CAChC,OAAgB,EAChB,UAA4B;IAE5B,OAAO,UAAU;SACd,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC;SAC1C,MAAM,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -5,13 +5,15 @@ export interface MsGraphEnum {
|
|
|
5
5
|
AgsAttributes: Record<string, string>;
|
|
6
6
|
RevisionDefinition: RevisionDefinition | undefined;
|
|
7
7
|
Elements: MsGraphEnumMember[];
|
|
8
|
-
|
|
8
|
+
IsGraphFlags: boolean | undefined;
|
|
9
|
+
Description?: string;
|
|
9
10
|
}
|
|
10
11
|
export interface MsGraphEnumMember {
|
|
11
12
|
Name: string;
|
|
12
13
|
Value: string | number | undefined;
|
|
13
14
|
AgsAttributes: Record<string, string>;
|
|
14
15
|
RevisionDefinition: RevisionDefinition | undefined;
|
|
16
|
+
Description?: string;
|
|
15
17
|
}
|
|
16
18
|
export declare function GetMsGraphEnumTypeElement(program: Program, enumType: Enum): MsGraphEnum;
|
|
17
19
|
//# sourceMappingURL=enum.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../src/entities/enum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../src/entities/enum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAsB,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAyB,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAIrF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACnD,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,GAAG,WAAW,CAWvF"}
|
|
@@ -1,23 +1,28 @@
|
|
|
1
|
+
import { getDoc } from "@typespec/compiler";
|
|
1
2
|
import { GetRevisionDefinition } from "./revision-definition.js";
|
|
2
3
|
import { buildAttributes } from "../decorators/ags-attribute.js";
|
|
3
|
-
import {
|
|
4
|
+
import { isGraphFlags } from "../index.js";
|
|
4
5
|
export function GetMsGraphEnumTypeElement(program, enumType) {
|
|
5
6
|
const element = {
|
|
6
7
|
Name: enumType.name,
|
|
7
8
|
AgsAttributes: buildAttributes(program, enumType),
|
|
8
9
|
RevisionDefinition: GetRevisionDefinition(program, enumType, enumType === null || enumType === void 0 ? void 0 : enumType.namespace),
|
|
9
10
|
Elements: [...enumType.members].map(([_, m]) => getMsGraphEnumMember(program, m)),
|
|
10
|
-
|
|
11
|
+
IsGraphFlags: isGraphFlags(program, enumType),
|
|
12
|
+
Description: getDoc(program, enumType),
|
|
11
13
|
};
|
|
12
14
|
return element;
|
|
13
15
|
}
|
|
14
16
|
function getMsGraphEnumMember(program, member) {
|
|
15
|
-
var _a;
|
|
17
|
+
var _a, _b;
|
|
16
18
|
const element = {
|
|
17
19
|
Name: member.name,
|
|
18
|
-
Value: member.value,
|
|
20
|
+
Value: (_a = member.value) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
19
21
|
AgsAttributes: buildAttributes(program, member),
|
|
20
|
-
RevisionDefinition: GetRevisionDefinition(program, member, (
|
|
22
|
+
RevisionDefinition: GetRevisionDefinition(program, member, (_b = member.enum) === null || _b === void 0 ? void 0 : _b.namespace),
|
|
23
|
+
Description: member.name === "unknownFutureValue"
|
|
24
|
+
? "A marker value for members added after the release of this API."
|
|
25
|
+
: getDoc(program, member),
|
|
21
26
|
};
|
|
22
27
|
return element;
|
|
23
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../src/entities/enum.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../src/entities/enum.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAsB,MAAM,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jB,CAAC"}
|
|
@@ -1,41 +1,70 @@
|
|
|
1
1
|
import { Model, ModelProperty, Program } from "@typespec/compiler";
|
|
2
2
|
import { RevisionDefinition } from "./revision-definition.js";
|
|
3
|
+
import { MsGraphAddressUrl, MsGraphPassthroughAddressUrl } from "./address-url.js";
|
|
3
4
|
export interface MsGraphModel {
|
|
4
5
|
Kind: MsGraphModelKind;
|
|
5
6
|
Name: string;
|
|
6
7
|
IsAbstract: boolean;
|
|
7
8
|
BaseType: string | undefined;
|
|
8
9
|
IsOpenType: boolean;
|
|
9
|
-
|
|
10
|
+
IsMedia: boolean;
|
|
10
11
|
AgsAttributes: Record<string, string>;
|
|
11
12
|
Properties: MsGraphModelProperty[];
|
|
12
13
|
RevisionDefinition: RevisionDefinition | undefined;
|
|
13
14
|
Description: string | undefined;
|
|
14
15
|
KeyProperty: [string, ModelProperty] | undefined;
|
|
15
16
|
AlternateKeys: AlternateKeyProperty[];
|
|
16
|
-
|
|
17
|
+
MediaTypes: string[];
|
|
18
|
+
IsPartial: boolean;
|
|
19
|
+
RecordType?: string;
|
|
17
20
|
}
|
|
18
21
|
export declare enum MsGraphModelKind {
|
|
19
22
|
Unknown = 0,
|
|
20
23
|
Entity = 1,
|
|
21
24
|
Complex = 2
|
|
22
25
|
}
|
|
23
|
-
export interface
|
|
26
|
+
export interface AllowedValues {
|
|
27
|
+
type: string;
|
|
28
|
+
values: unknown[];
|
|
29
|
+
}
|
|
30
|
+
export interface DeltaProperties {
|
|
31
|
+
FilterProperties: string[] | undefined;
|
|
32
|
+
ExpandProperties: string[] | undefined;
|
|
33
|
+
}
|
|
34
|
+
interface PropertyAttributes {
|
|
24
35
|
Name: string;
|
|
25
|
-
|
|
36
|
+
Description: string | undefined;
|
|
37
|
+
PropertyTypeName: string;
|
|
26
38
|
IsNullable: boolean;
|
|
39
|
+
IsNavigation: boolean;
|
|
40
|
+
IsUrl?: boolean | undefined;
|
|
27
41
|
AgsAttributes: Record<string, string>;
|
|
28
|
-
|
|
29
|
-
|
|
42
|
+
RevisionDefinition: RevisionDefinition | undefined;
|
|
43
|
+
}
|
|
44
|
+
export interface MsGraphStructuralProperty extends PropertyAttributes {
|
|
30
45
|
IsComputed: boolean;
|
|
46
|
+
IsImmutable: boolean;
|
|
47
|
+
DefaultValue?: string;
|
|
48
|
+
MaxLength?: number;
|
|
49
|
+
SupportsLimitedCharset: boolean;
|
|
50
|
+
AllowedValues: AllowedValues;
|
|
31
51
|
Permission: "Read" | "Write" | null;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
52
|
+
}
|
|
53
|
+
export interface MsGraphNavigationProperty extends PropertyAttributes {
|
|
54
|
+
IsContained: boolean;
|
|
55
|
+
IsCollection: boolean;
|
|
56
|
+
AddressUrl: MsGraphAddressUrl | undefined;
|
|
57
|
+
AddressUrlMsa: MsGraphAddressUrl | undefined;
|
|
58
|
+
PassthroughAddressUrl: MsGraphPassthroughAddressUrl | undefined;
|
|
59
|
+
PassthroughAddressUrlMsa: MsGraphPassthroughAddressUrl | undefined;
|
|
60
|
+
DeltaProperties: DeltaProperties | undefined;
|
|
61
|
+
}
|
|
62
|
+
export interface MsGraphModelProperty extends MsGraphStructuralProperty, MsGraphNavigationProperty {
|
|
35
63
|
}
|
|
36
64
|
export interface AlternateKeyProperty {
|
|
37
65
|
IsModel: boolean;
|
|
38
66
|
ModelProperty: ModelProperty;
|
|
39
67
|
}
|
|
40
68
|
export declare function GetMsGraphModels(program: Program, models: Map<string, Model>): Map<string, MsGraphModel>;
|
|
69
|
+
export {};
|
|
41
70
|
//# sourceMappingURL=model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/entities/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/entities/model.ts"],"names":[],"mappings":"AAAA,OAAO,EA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/compiler";
|
|
1
|
+
import { getDoc, getMaxLength, isKey } from "@typespec/compiler";
|
|
2
2
|
import { GetRevisionDefinition } from "./revision-definition.js";
|
|
3
|
-
import { isContains, isComputed, isReadOnly, isWriteOnly, isAlternateKey, isComplex,
|
|
4
|
-
import { isNavigationProperty, isTypeNullable, getPropertyTypeName, getIdForType, } from "../utils.js";
|
|
3
|
+
import { isContains, isComputed, isReadOnly, isWriteOnly, isAlternateKey, isComplex, getMediaTypes, isEntity, isOpen, isMedia, isAbstract, isImmutable, hasAllowedValues, getAllowedValues, hasAddressUrl, hasAddressUrlMsa, hasPassthroughAddressUrl, hasWorkloadNamespace, getPartialReferenceModel, getPublicNamespaceName, isSharedEntity, } from "../index.js";
|
|
4
|
+
import { isNavigationProperty, isTypeNullable, getPropertyTypeName, getIdForType, isTypeCollection, extractTypesFromUnion, removeReferencePrefixFromType, getNameForModelType, isDictionaryType, generateDictionaryBaseType, getSchemaNamespaceName, generateDeltaPropertiesForNavigationProperties, getTypeModel, getModelProperties, isTypeDefinedInExternalLibrary, buildPathTree, isTypeDefinedInLocalProject, isParentSharedEntity, } from "../utils.js";
|
|
5
5
|
import { buildAttributes } from "../decorators/ags-attribute.js";
|
|
6
|
+
import { usedDictionaryTypeKey, usedLibraryTypesKey, usedStandardEntityBaseTypeKey, NamespaceType, modelsOrderingKey, GetDeclaredNamespaces, DEFAULT_MSGRAPH_NAMESPACE } from "./namespace.js";
|
|
7
|
+
import { isPartial } from "../decorators/graph-partial.js";
|
|
8
|
+
import { getMsGraphAddressUrl, getMsGraphAddressUrlMsa, getMsGraphPassthroughAddressUrl, getMsGraphPassthroughAddressUrlMsa } from "./address-url.js";
|
|
9
|
+
import { GetMsGraphRoutes } from "./ms-graph-route.js";
|
|
10
|
+
import { hasPassthroughAddressUrlMsa } from "../decorators/passthrough-address-url-msa.js";
|
|
11
|
+
import { supportsLimitedCharset } from "../decorators/limited-charset.js";
|
|
6
12
|
export var MsGraphModelKind;
|
|
7
13
|
(function (MsGraphModelKind) {
|
|
8
14
|
MsGraphModelKind[MsGraphModelKind["Unknown"] = 0] = "Unknown";
|
|
9
15
|
MsGraphModelKind[MsGraphModelKind["Entity"] = 1] = "Entity";
|
|
10
16
|
MsGraphModelKind[MsGraphModelKind["Complex"] = 2] = "Complex";
|
|
11
|
-
})(MsGraphModelKind
|
|
17
|
+
})(MsGraphModelKind || (MsGraphModelKind = {}));
|
|
12
18
|
export function GetMsGraphModels(program, models) {
|
|
13
19
|
const map = new Map();
|
|
20
|
+
const pathTree = buildPathTree(program);
|
|
14
21
|
models.forEach((m, key) => {
|
|
22
|
+
var _a;
|
|
23
|
+
addPositionToStateMap(program, m);
|
|
24
|
+
if (isPartial(program, m)) {
|
|
25
|
+
// Check against the Tree Node and add missing navigation properties to the model
|
|
26
|
+
const nodesWithContainingEntity = pathTree.getAllNodesWithContainingEntityType(m.name);
|
|
27
|
+
if (nodesWithContainingEntity) {
|
|
28
|
+
const propertiesArray = Array.from(m.properties.values());
|
|
29
|
+
const navigationProperties = propertiesArray.filter(property => isNavigationProperty(program, property));
|
|
30
|
+
for (const node of nodesWithContainingEntity) {
|
|
31
|
+
if (!navigationProperties.find(property => property.name === node.name)) {
|
|
32
|
+
// Retrieve missing navigation properties from the partial reference model
|
|
33
|
+
const partialModel = getPartialReferenceModel(program, node.containingEntityType);
|
|
34
|
+
const navigationProperty = partialModel === null || partialModel === void 0 ? void 0 : partialModel.properties.get(node.name);
|
|
35
|
+
if (navigationProperty) {
|
|
36
|
+
m.properties.set(node.name, navigationProperty);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const partialModel = getMsGraphModel(program, m);
|
|
42
|
+
if (partialModel) {
|
|
43
|
+
partialModel.IsOpenType = false;
|
|
44
|
+
partialModel.BaseType = undefined;
|
|
45
|
+
map.set(partialModel.Name, partialModel);
|
|
46
|
+
}
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
populateImportedModelType(program, m);
|
|
50
|
+
if (isSharedEntity(program, m)) {
|
|
51
|
+
populateSharedEntityProperties(program, m);
|
|
52
|
+
}
|
|
53
|
+
// Removes properties and inheritance information from imported entity types
|
|
54
|
+
if (((_a = m.namespace) === null || _a === void 0 ? void 0 : _a.name) !== "SharedModels") {
|
|
55
|
+
m = removePropertiesAndInheritanceFromImportedType(program, m);
|
|
56
|
+
}
|
|
15
57
|
const model = getMsGraphModel(program, m);
|
|
16
58
|
if (model) {
|
|
17
59
|
map.set(key, model);
|
|
60
|
+
if (m.baseModel && m.baseModel.name !== 'entity') {
|
|
61
|
+
const baseModel = getMsGraphModel(program, m.baseModel);
|
|
62
|
+
if (baseModel) {
|
|
63
|
+
map.set(baseModel.Name, baseModel);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
return getOrderedModels(program, map);
|
|
69
|
+
}
|
|
70
|
+
function removePropertiesAndInheritanceFromImportedType(program, model) {
|
|
71
|
+
if (model.baseModel) {
|
|
72
|
+
model.baseModel.name = removeReferencePrefixFromType(model.baseModel.name);
|
|
73
|
+
}
|
|
74
|
+
if (isComplex(program, model)) {
|
|
75
|
+
return model;
|
|
76
|
+
}
|
|
77
|
+
if (isTypeDefinedInExternalLibrary(program, model) && !isSharedEntity(program, model)) {
|
|
78
|
+
model.properties.clear();
|
|
79
|
+
model.baseModel = undefined;
|
|
80
|
+
}
|
|
81
|
+
return model;
|
|
82
|
+
}
|
|
83
|
+
function populateImportedModelType(program, m) {
|
|
84
|
+
if (m.baseModel && !isTypeDefinedInLocalProject(program, m.baseModel) && !isTypeDefinedInExternalLibrary(program, m)) {
|
|
85
|
+
addPositionToStateMap(program, m.baseModel);
|
|
86
|
+
program.stateSet(usedLibraryTypesKey).add(m.baseModel);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function populateSharedEntityProperties(program, model) {
|
|
90
|
+
var _a;
|
|
91
|
+
if (isParentSharedEntity(program, model)) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const publicLibraryNamespaces = GetDeclaredNamespaces(program).filter(namespace => isTypeDefinedInExternalLibrary(program, namespace) &&
|
|
95
|
+
getPublicNamespaceName(program, namespace) === DEFAULT_MSGRAPH_NAMESPACE);
|
|
96
|
+
const parentSharedEntity = (_a = publicLibraryNamespaces.find(ns => ns.models.has(model.name))) === null || _a === void 0 ? void 0 : _a.models.get(model.name);
|
|
97
|
+
if (!parentSharedEntity) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
parentSharedEntity.properties.forEach((property) => {
|
|
101
|
+
if (!model.properties.has(property.name)) {
|
|
102
|
+
model.properties.set(property.name, property);
|
|
18
103
|
}
|
|
19
104
|
});
|
|
20
|
-
return map;
|
|
21
105
|
}
|
|
22
|
-
function getMsGraphModel(program, model) {
|
|
106
|
+
function getMsGraphModel(program, model, generateProperties = true) {
|
|
107
|
+
var _a, _b, _c;
|
|
23
108
|
let kind = MsGraphModelKind.Unknown;
|
|
24
109
|
if (isEntity(program, model)) {
|
|
25
110
|
kind = MsGraphModelKind.Entity;
|
|
@@ -30,25 +115,77 @@ function getMsGraphModel(program, model) {
|
|
|
30
115
|
else {
|
|
31
116
|
return undefined;
|
|
32
117
|
}
|
|
118
|
+
// Record when we have a raw entity base type, so we can be sure to emit it later.
|
|
119
|
+
if (((_a = model.baseModel) === null || _a === void 0 ? void 0 : _a.name) === "entity") {
|
|
120
|
+
program.stateSet(usedStandardEntityBaseTypeKey).add(model);
|
|
121
|
+
const namespace = model.namespace;
|
|
122
|
+
if (namespace) {
|
|
123
|
+
const namespaceName = (_b = getSchemaNamespaceName(program, namespace)) !== null && _b !== void 0 ? _b : "";
|
|
124
|
+
let namespaceType = NamespaceType.Unknown;
|
|
125
|
+
if (hasWorkloadNamespace(program, namespace)) {
|
|
126
|
+
namespaceType = NamespaceType.Workload;
|
|
127
|
+
}
|
|
128
|
+
else if (namespaceName === DEFAULT_MSGRAPH_NAMESPACE) {
|
|
129
|
+
namespaceType = NamespaceType.Public;
|
|
130
|
+
}
|
|
131
|
+
else if (namespaceName.includes(DEFAULT_MSGRAPH_NAMESPACE)) {
|
|
132
|
+
namespaceType = NamespaceType.SubNamespace;
|
|
133
|
+
}
|
|
134
|
+
program.stateMap(usedStandardEntityBaseTypeKey).set(namespace, namespaceType);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
const shouldGenerateDictionaryBaseType = isDictionaryType(program, model);
|
|
138
|
+
if (!model.baseModel && shouldGenerateDictionaryBaseType) {
|
|
139
|
+
program.stateSet(usedDictionaryTypeKey).add(model);
|
|
140
|
+
}
|
|
141
|
+
let baseType = undefined;
|
|
142
|
+
if (model.baseModel) {
|
|
143
|
+
if (model.namespace &&
|
|
144
|
+
(hasWorkloadNamespace(program, model.namespace) ||
|
|
145
|
+
(((_c = getPublicNamespaceName(program, model.namespace)) === null || _c === void 0 ? void 0 : _c.includes("microsoft.graph.")) &&
|
|
146
|
+
model.baseModel.name !== "entity"))) {
|
|
147
|
+
baseType = `${getIdForType(program, model.namespace)}.${model.baseModel.name}`;
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
baseType = getIdForType(program, model.baseModel);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
33
153
|
return {
|
|
34
154
|
Kind: kind,
|
|
35
155
|
Name: model.name,
|
|
36
156
|
IsAbstract: isAbstract(program, model),
|
|
37
|
-
BaseType: model.baseModel ?
|
|
38
|
-
IsOpenType: isOpen(program, model),
|
|
39
|
-
|
|
40
|
-
AgsAttributes: buildAttributes(program, model),
|
|
157
|
+
BaseType: model.baseModel ? baseType : (shouldGenerateDictionaryBaseType ? generateDictionaryBaseType(program, model) : undefined),
|
|
158
|
+
IsOpenType: !(isTypeDefinedInExternalLibrary(program, model) && isEntity(program, model)) && (isOpen(program, model) || isDictionaryType(program, model)),
|
|
159
|
+
IsMedia: isMedia(program, model),
|
|
160
|
+
AgsAttributes: buildAttributes(program, model, kind),
|
|
41
161
|
RevisionDefinition: GetRevisionDefinition(program, model, model.namespace),
|
|
42
162
|
Description: getDoc(program, model),
|
|
43
163
|
KeyProperty: kind === MsGraphModelKind.Entity ? [...model.properties].find(([_, property]) => isKey(program, property)) : undefined,
|
|
44
164
|
AlternateKeys: kind === MsGraphModelKind.Entity ? getAlternateKeys(program, model.properties) : [],
|
|
45
|
-
|
|
46
|
-
Properties:
|
|
165
|
+
MediaTypes: kind === MsGraphModelKind.Entity ? getMediaTypes(program, model) : [],
|
|
166
|
+
Properties: generateProperties ? getMsGraphModelProperties(program, model.properties) : [],
|
|
167
|
+
IsPartial: isPartial(program, model),
|
|
168
|
+
RecordType: getRecordType(program, model)
|
|
47
169
|
};
|
|
48
170
|
}
|
|
49
|
-
function
|
|
171
|
+
function getRecordType(program, model) {
|
|
172
|
+
var _a;
|
|
173
|
+
const indexer = (_a = model.indexer) === null || _a === void 0 ? void 0 : _a.value;
|
|
174
|
+
if (!indexer)
|
|
175
|
+
return undefined;
|
|
176
|
+
if (indexer.kind === "Model") {
|
|
177
|
+
const namespaceName = getSchemaNamespaceName(program, model.namespace);
|
|
178
|
+
return namespaceName === null || namespaceName === void 0 ? void 0 : namespaceName.concat(".", indexer.name);
|
|
179
|
+
}
|
|
180
|
+
if (indexer.kind === "Scalar") {
|
|
181
|
+
return getNameForModelType(program, indexer);
|
|
182
|
+
}
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
185
|
+
function getMsGraphModelProperties(program, properties) {
|
|
50
186
|
return [...properties].map(([_, v]) => {
|
|
51
187
|
var _a;
|
|
188
|
+
populateUsedTypeModel(program, v);
|
|
52
189
|
return {
|
|
53
190
|
Name: v.name,
|
|
54
191
|
IsNavigation: isNavigationProperty(program, v),
|
|
@@ -64,10 +201,86 @@ function getModelProperties(program, properties) {
|
|
|
64
201
|
: null,
|
|
65
202
|
RevisionDefinition: GetRevisionDefinition(program, v, (_a = v.model) === null || _a === void 0 ? void 0 : _a.namespace),
|
|
66
203
|
Description: getDoc(program, v),
|
|
67
|
-
|
|
204
|
+
IsImmutable: isImmutable(program, v),
|
|
205
|
+
AllowedValues: hasAllowedValues(program, v) ? getAllowedValues(program, v) : [],
|
|
206
|
+
IsCollection: isTypeCollection(program, v.type),
|
|
207
|
+
AddressUrl: isNavigationProperty(program, v) ? getNavigationPropertyAddressUrl(program, v) : undefined,
|
|
208
|
+
AddressUrlMsa: isNavigationProperty(program, v) ? getNavigationPropertyAddressUrlMsa(program, v) : undefined,
|
|
209
|
+
PassthroughAddressUrl: isNavigationProperty(program, v) ? getNavigationPropertyPassthroughAddressUrl(program, v) : undefined,
|
|
210
|
+
PassthroughAddressUrlMsa: isNavigationProperty(program, v) ? getNavigationPropertyPassthroughAddressUrlMsa(program, v) : undefined,
|
|
211
|
+
SupportsLimitedCharset: supportsLimitedCharset(program, v),
|
|
212
|
+
DefaultValue: getDefaultValue(program, v),
|
|
213
|
+
IsUrl: getIsUrl(program, v),
|
|
214
|
+
DeltaProperties: isNavigationProperty(program, v) ? generateDeltaPropertiesForNavigationProperties(program, v) : undefined,
|
|
215
|
+
MaxLength: getMaxLength(program, v),
|
|
68
216
|
};
|
|
69
217
|
});
|
|
70
218
|
}
|
|
219
|
+
function getIsUrl(program, property) {
|
|
220
|
+
if (property.type.kind === "Scalar" && isODataUrl(property.type)) {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
if (property.type.kind === "Union") {
|
|
224
|
+
const unionTypes = extractTypesFromUnion(property.type);
|
|
225
|
+
for (const type of unionTypes) {
|
|
226
|
+
if (type.kind === "Scalar" && isODataUrl(type)) {
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return undefined;
|
|
232
|
+
}
|
|
233
|
+
function isODataUrl(scalar) {
|
|
234
|
+
return ["url", "webUrl", "graphUrl"].includes(scalar.name);
|
|
235
|
+
}
|
|
236
|
+
function getDefaultValue(program, property) {
|
|
237
|
+
if (property.default) {
|
|
238
|
+
return getIdForType(program, property.default);
|
|
239
|
+
}
|
|
240
|
+
return undefined;
|
|
241
|
+
}
|
|
242
|
+
function populateUsedTypeModel(program, v) {
|
|
243
|
+
var _a, _b;
|
|
244
|
+
const model = getTypeModel(program, v.type);
|
|
245
|
+
// Handles Model types
|
|
246
|
+
if (model) {
|
|
247
|
+
if (isTypeDefinedInExternalLibrary(program, model)) {
|
|
248
|
+
if (isComplex(program, model)) {
|
|
249
|
+
program.stateSet(usedLibraryTypesKey).add(model);
|
|
250
|
+
addPositionToStateMap(program, model);
|
|
251
|
+
getModelProperties(program, model, false)
|
|
252
|
+
.forEach(prop => populateUsedTypeModel(program, prop));
|
|
253
|
+
}
|
|
254
|
+
const isNavProperty = isNavigationProperty(program, v);
|
|
255
|
+
if (isNavProperty) {
|
|
256
|
+
/**
|
|
257
|
+
* we add the type of the property like:
|
|
258
|
+
* someProperty: reference.microsoft.graph.someType
|
|
259
|
+
* The type added to stateSet is reference.microsoft.graph.someType
|
|
260
|
+
*/
|
|
261
|
+
program.stateSet(usedLibraryTypesKey).add(model);
|
|
262
|
+
addPositionToStateMap(program, model);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
// Handles Enum types
|
|
267
|
+
if (((_a = v.type) === null || _a === void 0 ? void 0 : _a.kind) === "Enum" && isTypeDefinedInExternalLibrary(program, v.type)) {
|
|
268
|
+
program.stateSet(usedLibraryTypesKey).add(v.type);
|
|
269
|
+
}
|
|
270
|
+
// Handles Union types
|
|
271
|
+
if (((_b = v.type) === null || _b === void 0 ? void 0 : _b.kind) === "Union") {
|
|
272
|
+
const unionTypes = extractTypesFromUnion(v.type);
|
|
273
|
+
unionTypes.forEach(type => {
|
|
274
|
+
if (isTypeDefinedInExternalLibrary(program, type)) {
|
|
275
|
+
program.stateSet(usedLibraryTypesKey).add(type);
|
|
276
|
+
const typeModel = getTypeModel(program, type);
|
|
277
|
+
if (typeModel) {
|
|
278
|
+
addPositionToStateMap(program, typeModel);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
}
|
|
71
284
|
function getAlternateKeys(program, properties) {
|
|
72
285
|
const result = new Array();
|
|
73
286
|
properties.forEach(v => {
|
|
@@ -80,4 +293,88 @@ function getAlternateKeys(program, properties) {
|
|
|
80
293
|
});
|
|
81
294
|
return result;
|
|
82
295
|
}
|
|
296
|
+
function getNavigationPropertyAddressUrl(program, property) {
|
|
297
|
+
const msGraphRoutes = GetMsGraphRoutes(program);
|
|
298
|
+
for (const [_, msGraphRoute] of msGraphRoutes.entries()) {
|
|
299
|
+
if (msGraphRoute.resource === property && hasAddressUrl(program, msGraphRoute.theInterface)) {
|
|
300
|
+
return getMsGraphAddressUrl(program, msGraphRoute.theInterface);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
return undefined;
|
|
304
|
+
}
|
|
305
|
+
function getNavigationPropertyAddressUrlMsa(program, property) {
|
|
306
|
+
const msGraphRoutes = GetMsGraphRoutes(program);
|
|
307
|
+
for (const [_, msGraphRoute] of msGraphRoutes.entries()) {
|
|
308
|
+
if (msGraphRoute.resource === property && hasAddressUrlMsa(program, msGraphRoute.theInterface)) {
|
|
309
|
+
return getMsGraphAddressUrlMsa(program, msGraphRoute.theInterface);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
return undefined;
|
|
313
|
+
}
|
|
314
|
+
function getNavigationPropertyPassthroughAddressUrl(program, property) {
|
|
315
|
+
const msGraphRoutes = GetMsGraphRoutes(program);
|
|
316
|
+
for (const [_, msGraphRoute] of msGraphRoutes.entries()) {
|
|
317
|
+
if (msGraphRoute.resource === property && hasPassthroughAddressUrl(program, msGraphRoute.theInterface)) {
|
|
318
|
+
return getMsGraphPassthroughAddressUrl(program, msGraphRoute.theInterface);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return undefined;
|
|
322
|
+
}
|
|
323
|
+
function getNavigationPropertyPassthroughAddressUrlMsa(program, property) {
|
|
324
|
+
const msGraphRoutes = GetMsGraphRoutes(program);
|
|
325
|
+
for (const [_, msGraphRoute] of msGraphRoutes.entries()) {
|
|
326
|
+
if (msGraphRoute.resource === property && hasPassthroughAddressUrlMsa(program, msGraphRoute.theInterface)) {
|
|
327
|
+
return getMsGraphPassthroughAddressUrlMsa(program, msGraphRoute.theInterface);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return undefined;
|
|
331
|
+
}
|
|
332
|
+
// TODO: Replace this method once core TypeSpec provides this functionality
|
|
333
|
+
function getOrderedModels(program, models) {
|
|
334
|
+
const unOrderedTypes = program.stateMap(modelsOrderingKey);
|
|
335
|
+
const orderedTypes = getOrderedTypes(unOrderedTypes);
|
|
336
|
+
const emittedLibraryMsGraphModels = getEmittedLibraryMsGraphModels(models);
|
|
337
|
+
const orderedMsGraphModels = new Map();
|
|
338
|
+
orderedTypes.forEach((_, type) => {
|
|
339
|
+
if (type.kind === "Model") {
|
|
340
|
+
const model = models.get(type.name);
|
|
341
|
+
if (model) {
|
|
342
|
+
orderedMsGraphModels.set(type.name, model);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
program.stateMap(modelsOrderingKey).clear();
|
|
347
|
+
emittedLibraryMsGraphModels.forEach((model) => {
|
|
348
|
+
orderedMsGraphModels.set(model.Name, model);
|
|
349
|
+
});
|
|
350
|
+
return orderedMsGraphModels;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Orders the types based on their value which is the position of the type in the file
|
|
354
|
+
* @param unOrderedTypes
|
|
355
|
+
* @returns orderedTypes
|
|
356
|
+
*/
|
|
357
|
+
function getOrderedTypes(unOrderedTypes) {
|
|
358
|
+
let typeTuples = Array.from(unOrderedTypes.entries());
|
|
359
|
+
typeTuples = typeTuples.sort((a, b) => a[1] - b[1]);
|
|
360
|
+
return new Map(typeTuples);
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* This function gets all models that are emitted from an external library but emitted in the current namespace
|
|
364
|
+
* @param models
|
|
365
|
+
* @returns MsGraphModels: These are types that are emitted when a library type is used as a base type in a model
|
|
366
|
+
*/
|
|
367
|
+
function getEmittedLibraryMsGraphModels(models) {
|
|
368
|
+
const emittedLibraryMsGraphModel = new Map();
|
|
369
|
+
models.forEach((model) => {
|
|
370
|
+
if (model.Properties.length === 0 && model.Kind === MsGraphModelKind.Entity) {
|
|
371
|
+
emittedLibraryMsGraphModel.set(model.Name, model);
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
return emittedLibraryMsGraphModel;
|
|
375
|
+
}
|
|
376
|
+
function addPositionToStateMap(program, type) {
|
|
377
|
+
var _a;
|
|
378
|
+
program.stateMap(modelsOrderingKey).set(type, (_a = type.node) === null || _a === void 0 ? void 0 : _a.pos);
|
|
379
|
+
}
|
|
83
380
|
//# sourceMappingURL=model.js.map
|