@microsoft/typespec-msgraph 0.0.1-Preview.3 → 0.0.1-Preview.30
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 +5 -4
- package/dist/src/components/alternate-keys-annotation.js.map +1 -1
- package/dist/src/components/annotations.d.ts +12 -0
- package/dist/src/components/annotations.d.ts.map +1 -0
- package/dist/src/components/annotations.js +106 -0
- package/dist/src/components/annotations.js.map +1 -0
- package/dist/src/components/common-elements.d.ts +19 -6
- package/dist/src/components/common-elements.d.ts.map +1 -1
- package/dist/src/components/common-elements.js +2 -2
- package/dist/src/components/common-elements.js.map +1 -1
- package/dist/src/components/computed-annotation.js +1 -1
- package/dist/src/components/computed-annotation.js.map +1 -1
- package/dist/src/components/count-restrictions-annotation.d.ts +1 -1
- package/dist/src/components/count-restrictions-annotation.d.ts.map +1 -1
- package/dist/src/components/count-restrictions-annotation.js +3 -8
- package/dist/src/components/count-restrictions-annotation.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/description-annotation.d.ts.map +1 -1
- package/dist/src/components/description-annotation.js +1 -0
- package/dist/src/components/description-annotation.js.map +1 -1
- package/dist/src/components/entity-container-element.d.ts +18 -3
- package/dist/src/components/entity-container-element.d.ts.map +1 -1
- package/dist/src/components/entity-container-element.js +16 -42
- 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/expand-restrictions-annotation.d.ts +1 -1
- package/dist/src/components/expand-restrictions-annotation.d.ts.map +1 -1
- package/dist/src/components/expand-restrictions-annotation.js +7 -13
- package/dist/src/components/expand-restrictions-annotation.js.map +1 -1
- package/dist/src/components/filter-restrictions-annotation.d.ts +6 -0
- package/dist/src/components/filter-restrictions-annotation.d.ts.map +1 -0
- package/dist/src/components/filter-restrictions-annotation.js +10 -0
- package/dist/src/components/filter-restrictions-annotation.js.map +1 -0
- package/dist/src/components/immutable-annotation.d.ts +5 -0
- package/dist/src/components/immutable-annotation.d.ts.map +1 -0
- package/dist/src/components/immutable-annotation.js +6 -0
- package/dist/src/components/immutable-annotation.js.map +1 -0
- package/dist/src/components/index.js +3 -3
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/components/insert-restrictions-annotation.d.ts +6 -0
- package/dist/src/components/insert-restrictions-annotation.d.ts.map +1 -0
- package/dist/src/components/insert-restrictions-annotation.js +10 -0
- package/dist/src/components/insert-restrictions-annotation.js.map +1 -0
- 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 +33 -18
- 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 +10 -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 +15 -6
- package/dist/src/components/schema-element.js.map +1 -1
- package/dist/src/components/search-restrictions-annotation.d.ts +1 -1
- package/dist/src/components/search-restrictions-annotation.d.ts.map +1 -1
- package/dist/src/components/search-restrictions-annotation.js +3 -8
- package/dist/src/components/search-restrictions-annotation.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/skip-supported-annotation.d.ts +1 -1
- package/dist/src/components/skip-supported-annotation.d.ts.map +1 -1
- package/dist/src/components/skip-supported-annotation.js +1 -6
- package/dist/src/components/skip-supported-annotation.js.map +1 -1
- package/dist/src/components/sort-restrictions-annotation.d.ts +1 -1
- package/dist/src/components/sort-restrictions-annotation.d.ts.map +1 -1
- package/dist/src/components/sort-restrictions-annotation.js +7 -13
- package/dist/src/components/sort-restrictions-annotation.js.map +1 -1
- package/dist/src/components/structured-type-element.d.ts +4 -7
- package/dist/src/components/structured-type-element.d.ts.map +1 -1
- package/dist/src/components/structured-type-element.js +23 -23
- 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.d.ts +1 -1
- package/dist/src/components/top-supported-annotation.d.ts.map +1 -1
- package/dist/src/components/top-supported-annotation.js +2 -5
- package/dist/src/components/top-supported-annotation.js.map +1 -1
- package/dist/src/components/update-restrictions-annotation.d.ts +6 -0
- package/dist/src/components/update-restrictions-annotation.d.ts.map +1 -0
- package/dist/src/components/update-restrictions-annotation.js +8 -0
- package/dist/src/components/update-restrictions-annotation.js.map +1 -0
- 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 +12 -0
- package/dist/src/decorators/action.d.ts.map +1 -0
- package/dist/src/decorators/action.js +18 -0
- package/dist/src/decorators/action.js.map +1 -0
- package/dist/src/decorators/additional-query-parameters.d.ts +18 -0
- package/dist/src/decorators/additional-query-parameters.d.ts.map +1 -0
- package/dist/src/decorators/additional-query-parameters.js +23 -0
- package/dist/src/decorators/additional-query-parameters.js.map +1 -0
- 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 +17 -0
- package/dist/src/decorators/ags-attribute.d.ts.map +1 -0
- package/dist/src/decorators/ags-attribute.js +167 -0
- package/dist/src/decorators/ags-attribute.js.map +1 -0
- 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-collection.d.ts +8 -0
- package/dist/src/decorators/delta-collection.d.ts.map +1 -0
- package/dist/src/decorators/delta-collection.js +12 -0
- package/dist/src/decorators/delta-collection.js.map +1 -0
- 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 +5 -4
- package/dist/src/decorators/deprecated-definition.d.ts.map +1 -1
- package/dist/src/decorators/deprecated-definition.js +1 -7
- 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 +4 -2
- 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 +13 -0
- package/dist/src/decorators/filter.d.ts.map +1 -0
- package/dist/src/decorators/filter.js +29 -0
- package/dist/src/decorators/filter.js.map +1 -0
- package/dist/src/decorators/function.d.ts +9 -3
- 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-route.d.ts +20 -0
- package/dist/src/decorators/graph-route.d.ts.map +1 -0
- package/dist/src/decorators/graph-route.js +141 -0
- package/dist/src/decorators/graph-route.js.map +1 -0
- 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 +10 -0
- package/dist/src/decorators/immutable.d.ts.map +1 -0
- package/dist/src/decorators/immutable.js +14 -0
- package/dist/src/decorators/immutable.js.map +1 -0
- package/dist/src/decorators/index.d.ts +35 -3
- package/dist/src/decorators/index.d.ts.map +1 -1
- package/dist/src/decorators/index.js +35 -3
- package/dist/src/decorators/index.js.map +1 -1
- package/dist/src/decorators/is-owner.d.ts +12 -0
- package/dist/src/decorators/is-owner.d.ts.map +1 -0
- package/dist/src/decorators/is-owner.js +19 -0
- package/dist/src/decorators/is-owner.js.map +1 -0
- 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 +3 -2
- package/dist/src/decorators/order-by.d.ts.map +1 -1
- package/dist/src/decorators/order-by.js +3 -1
- 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/paged-collection.d.ts +8 -0
- package/dist/src/decorators/paged-collection.d.ts.map +1 -0
- package/dist/src/decorators/paged-collection.js +12 -0
- package/dist/src/decorators/paged-collection.js.map +1 -0
- package/dist/src/decorators/partial.d.ts +12 -0
- package/dist/src/decorators/partial.d.ts.map +1 -0
- package/dist/src/decorators/partial.js +18 -0
- package/dist/src/decorators/partial.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 +5 -4
- package/dist/src/decorators/private-preview-definition.d.ts.map +1 -1
- package/dist/src/decorators/private-preview-definition.js +3 -6
- package/dist/src/decorators/private-preview-definition.js.map +1 -1
- package/dist/src/decorators/private-preview.d.ts +4 -3
- package/dist/src/decorators/private-preview.d.ts.map +1 -1
- package/dist/src/decorators/private-preview.js +3 -1
- package/dist/src/decorators/private-preview.js.map +1 -1
- package/dist/src/decorators/privileged.d.ts +11 -0
- package/dist/src/decorators/privileged.d.ts.map +1 -0
- package/dist/src/decorators/privileged.js +15 -0
- package/dist/src/decorators/privileged.js.map +1 -0
- 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 +12 -0
- package/dist/src/decorators/required-for-create.d.ts.map +1 -0
- package/dist/src/decorators/required-for-create.js +16 -0
- package/dist/src/decorators/required-for-create.js.map +1 -0
- 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 +11 -0
- package/dist/src/decorators/workload-name-msa.d.ts.map +1 -0
- package/dist/src/decorators/workload-name-msa.js +15 -0
- package/dist/src/decorators/workload-name-msa.js.map +1 -0
- package/dist/src/decorators/workload-name.d.ts +11 -0
- package/dist/src/decorators/workload-name.d.ts.map +1 -0
- package/dist/src/decorators/workload-name.js +15 -0
- package/dist/src/decorators/workload-name.js.map +1 -0
- 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 +53 -0
- package/dist/src/entities/annotations.d.ts.map +1 -0
- package/dist/src/entities/annotations.js +185 -0
- package/dist/src/entities/annotations.js.map +1 -0
- package/dist/src/entities/entity-container.d.ts +24 -23
- package/dist/src/entities/entity-container.d.ts.map +1 -1
- package/dist/src/entities/entity-container.js +58 -119
- package/dist/src/entities/entity-container.js.map +1 -1
- package/dist/src/entities/enum.d.ts +3 -0
- package/dist/src/entities/enum.d.ts.map +1 -1
- package/dist/src/entities/enum.js +12 -5
- package/dist/src/entities/enum.js.map +1 -1
- package/dist/src/entities/model.d.ts +47 -27
- package/dist/src/entities/model.d.ts.map +1 -1
- package/dist/src/entities/model.js +357 -96
- 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 +32 -4
- package/dist/src/entities/namespace.d.ts.map +1 -1
- package/dist/src/entities/namespace.js +354 -18
- package/dist/src/entities/namespace.js.map +1 -1
- package/dist/src/entities/operation.d.ts +20 -2
- package/dist/src/entities/operation.d.ts.map +1 -1
- package/dist/src/entities/operation.js +162 -25
- 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 +10 -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 +18 -7
- 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 +141 -86
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +90 -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 +34 -34
- 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 +3 -0
- package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts.map +1 -0
- package/dist/src/rules/collection-navigation-properties-not-nullable.js +28 -0
- package/dist/src/rules/collection-navigation-properties-not-nullable.js.map +1 -0
- 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 +12 -9
- 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 +3 -0
- package/dist/src/rules/disallowed-typespec-decorators.d.ts.map +1 -0
- package/dist/src/rules/disallowed-typespec-decorators.js +37 -0
- package/dist/src/rules/disallowed-typespec-decorators.js.map +1 -0
- 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 +9 -2
- package/dist/src/rules/entity.d.ts.map +1 -1
- package/dist/src/rules/entity.js +173 -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 +27 -24
- package/dist/src/rules/expand.js.map +1 -1
- package/dist/src/rules/extends-on-same-type.d.ts +3 -0
- package/dist/src/rules/extends-on-same-type.d.ts.map +1 -0
- package/dist/src/rules/extends-on-same-type.js +39 -0
- package/dist/src/rules/extends-on-same-type.js.map +1 -0
- package/dist/src/rules/filter.d.ts +7 -0
- package/dist/src/rules/filter.d.ts.map +1 -0
- package/dist/src/rules/filter.js +160 -0
- package/dist/src/rules/filter.js.map +1 -0
- 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-route.d.ts +17 -0
- package/dist/src/rules/graph-route.d.ts.map +1 -0
- package/dist/src/rules/graph-route.js +395 -0
- package/dist/src/rules/graph-route.js.map +1 -0
- package/dist/src/rules/index.d.ts +24 -4
- package/dist/src/rules/index.d.ts.map +1 -1
- package/dist/src/rules/index.js +24 -89
- 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 +12 -0
- package/dist/src/rules/model.d.ts.map +1 -0
- package/dist/src/rules/model.js +135 -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 +7 -0
- package/dist/src/rules/operation-inside-interface.d.ts.map +1 -0
- package/dist/src/rules/operation-inside-interface.js +96 -0
- package/dist/src/rules/operation-inside-interface.js.map +1 -0
- 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 +27 -26
- 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/partial.d.ts +9 -0
- package/dist/src/rules/partial.d.ts.map +1 -0
- package/dist/src/rules/partial.js +84 -0
- package/dist/src/rules/partial.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 +3 -0
- package/dist/src/rules/required-for-create.d.ts.map +1 -0
- package/dist/src/rules/required-for-create.js +41 -0
- package/dist/src/rules/required-for-create.js.map +1 -0
- 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 +12 -9
- 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 +12 -9
- 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 +12 -9
- 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 +86 -2
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +733 -22
- 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 +97 -0
- package/dist/src/validate.js.map +1 -0
- package/lib/bodies.tsp +71 -0
- package/lib/decorators.tsp +345 -23
- package/lib/deployment.tsp +18 -0
- package/lib/lib.tsp +9 -23
- package/lib/msgraph.tsp +5 -0
- package/lib/porcelain.tsp +190 -0
- package/lib/responses.tsp +59 -0
- package/lib/shared-models.tsp +30 -0
- package/package.json +24 -31
- package/dist/src/decorators/attribute-builder.d.ts +0 -2
- package/dist/src/decorators/attribute-builder.d.ts.map +0 -1
- package/dist/src/decorators/attribute-builder.js +0 -166
- package/dist/src/decorators/attribute-builder.js.map +0 -1
- package/dist/src/decorators/attributes.d.ts +0 -57
- package/dist/src/decorators/attributes.d.ts.map +0 -1
- package/dist/src/decorators/attributes.js +0 -50
- package/dist/src/decorators/attributes.js.map +0 -1
- package/dist/src/decorators/decorator-parameter.d.ts +0 -4
- package/dist/src/decorators/decorator-parameter.d.ts.map +0 -1
- package/dist/src/decorators/decorator-parameter.js +0 -2
- package/dist/src/decorators/decorator-parameter.js.map +0 -1
- package/dist/src/decorators/handlers/custom/additional-query-parameters.d.ts +0 -15
- package/dist/src/decorators/handlers/custom/additional-query-parameters.d.ts.map +0 -1
- package/dist/src/decorators/handlers/custom/additional-query-parameters.js +0 -38
- package/dist/src/decorators/handlers/custom/additional-query-parameters.js.map +0 -1
- package/dist/src/decorators/handlers/custom/ags-attribute.d.ts +0 -8
- package/dist/src/decorators/handlers/custom/ags-attribute.d.ts.map +0 -1
- package/dist/src/decorators/handlers/custom/ags-attribute.js +0 -36
- package/dist/src/decorators/handlers/custom/ags-attribute.js.map +0 -1
- package/dist/src/decorators/handlers/custom/index.d.ts +0 -3
- package/dist/src/decorators/handlers/custom/index.d.ts.map +0 -1
- package/dist/src/decorators/handlers/custom/index.js +0 -3
- package/dist/src/decorators/handlers/custom/index.js.map +0 -1
- package/dist/src/decorators/handlers/index.d.ts +0 -31
- package/dist/src/decorators/handlers/index.d.ts.map +0 -1
- package/dist/src/decorators/handlers/index.js +0 -121
- package/dist/src/decorators/handlers/index.js.map +0 -1
- package/dist/src/decorators/has-stream.d.ts +0 -11
- 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
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { unpackAdditionalQueryParameters } from "./additional-query-parameters.js";
|
|
2
|
+
import { getIsOwnerAttribute, hasIsOwner } from "./is-owner.js";
|
|
3
|
+
import { isPrivileged } from "./privileged.js";
|
|
4
|
+
import { getWorkloadNameMsa } from "./workload-name-msa.js";
|
|
5
|
+
import { getWorkloadName } from "./workload-name.js";
|
|
6
|
+
import { isContains, isExperimental, isOwnerless, isPartial, isSharedEntity } from "../index.js";
|
|
7
|
+
import { MsGraphModelKind } from "../entities/model.js";
|
|
8
|
+
import { isPrivatePreview } from "./private-preview.js";
|
|
9
|
+
import { getInterfaceNavigationSourceType, isNavigationProperty, isTypeDefinedInExternalLibrary, isTypeDefinedInLocalProject } from "../utils.js";
|
|
10
|
+
const agsAttributeKey = Symbol("agsAttribute");
|
|
11
|
+
/**
|
|
12
|
+
* `@agsAttribute` - Allows all AGS CSDL extensions that are not yet modelled explicitly in TypeSpec to be maintained
|
|
13
|
+
*
|
|
14
|
+
* `@agsAttribute` - Applies to models.
|
|
15
|
+
*
|
|
16
|
+
* [See documentation](https://eng.ms/cid/8de40593-4e2f-4f27-b24b-9f1895402243/fid/60673be93bd1791123d0be02d346f76f8494b8c87c9ece257f3e7bba63302d28)
|
|
17
|
+
*/
|
|
18
|
+
export function $agsAttribute(context, target, name, value) {
|
|
19
|
+
const agsAttributes = getAgsAttributes(context.program, target);
|
|
20
|
+
agsAttributes.set(name, value);
|
|
21
|
+
context.program.stateMap(agsAttributeKey).set(target, agsAttributes);
|
|
22
|
+
}
|
|
23
|
+
export function getAgsAttributes(program, target) {
|
|
24
|
+
return program.stateMap(agsAttributeKey).get(target) || new Map();
|
|
25
|
+
}
|
|
26
|
+
export function unpackAgsAttributes(program, target) {
|
|
27
|
+
const attributes = getAgsAttributes(program, target);
|
|
28
|
+
let params = {};
|
|
29
|
+
attributes.forEach((value, name) => (params = { ...params, ...{ [`ags:${name}`]: value } }));
|
|
30
|
+
return params;
|
|
31
|
+
}
|
|
32
|
+
const decoratorToMethodMapper = {
|
|
33
|
+
isOwner: hasIsOwner,
|
|
34
|
+
privileged: isPrivileged,
|
|
35
|
+
workloadName: getWorkloadName,
|
|
36
|
+
workloadNameMsa: getWorkloadNameMsa,
|
|
37
|
+
additionalQueryParameters: unpackAdditionalQueryParameters,
|
|
38
|
+
agsAttribute: unpackAgsAttributes,
|
|
39
|
+
experimental: isExperimental,
|
|
40
|
+
};
|
|
41
|
+
const decoratorToAgsAttributeMapper = {
|
|
42
|
+
isOwner: "ags:IsOwner",
|
|
43
|
+
privileged: "ags:IsHidden",
|
|
44
|
+
workloadName: "ags:WorkloadName",
|
|
45
|
+
workloadNameMsa: "ags:WorkloadNameMsa",
|
|
46
|
+
experimental: "ags:IsHidden",
|
|
47
|
+
};
|
|
48
|
+
export function buildAttributes(program, type, kind) {
|
|
49
|
+
const declaredDecorators = [
|
|
50
|
+
"isOwner",
|
|
51
|
+
"privileged",
|
|
52
|
+
"workloadName",
|
|
53
|
+
"workloadNameMsa",
|
|
54
|
+
"additionalQueryParameters",
|
|
55
|
+
"agsAttribute",
|
|
56
|
+
"experimental",
|
|
57
|
+
];
|
|
58
|
+
let attrs = {};
|
|
59
|
+
type.decorators
|
|
60
|
+
// only handle declared decorators
|
|
61
|
+
.filter((d) => declaredDecorators.some((s) => s === d.decorator.name.substring(1)))
|
|
62
|
+
.forEach((d) => {
|
|
63
|
+
const attrName = d.decorator.name.substring(1); // name prefixed with $
|
|
64
|
+
let key = attrName;
|
|
65
|
+
const agsAttrParams = decoratorToMethodMapper[key](program, type);
|
|
66
|
+
if (typeof agsAttrParams === "object") {
|
|
67
|
+
attrs = { ...attrs, ...agsAttrParams };
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
key = attrName;
|
|
71
|
+
const agsAttr = decoratorToAgsAttributeMapper[key];
|
|
72
|
+
attrs = { ...attrs, ...{ [agsAttr]: agsAttrParams } };
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
attrs = enrichAttributesWithIsSharedEntity(program, type, attrs);
|
|
76
|
+
attrs = enrichAttributesWithIsOwner(program, type, attrs, kind);
|
|
77
|
+
attrs = enrichAttributesWithIsHidden(program, type, attrs);
|
|
78
|
+
if (attrs["ags:IsHidden"] && type.kind === "Namespace") {
|
|
79
|
+
delete attrs["ags:IsHidden"];
|
|
80
|
+
}
|
|
81
|
+
return attrs;
|
|
82
|
+
}
|
|
83
|
+
function enrichAttributesWithIsOwner(program, type, attrs, kind) {
|
|
84
|
+
if (kind === MsGraphModelKind.Complex) {
|
|
85
|
+
return attrs;
|
|
86
|
+
}
|
|
87
|
+
if (type.kind === "Model" && isSharedEntity(program, type)) {
|
|
88
|
+
return attrs;
|
|
89
|
+
}
|
|
90
|
+
if (type.kind === "Model" || type.kind === "ModelProperty") {
|
|
91
|
+
if (type.kind === "ModelProperty" && !isNavigationProperty(program, type)) {
|
|
92
|
+
return attrs;
|
|
93
|
+
}
|
|
94
|
+
const isOwnerAttribute = getIsOwnerAttribute(program, type);
|
|
95
|
+
if (isOwnerAttribute === false) {
|
|
96
|
+
attrs["ags:IsOwner"] = "false";
|
|
97
|
+
return attrs;
|
|
98
|
+
}
|
|
99
|
+
else if (isOwnerAttribute === true) {
|
|
100
|
+
attrs["ags:IsOwner"] = "true";
|
|
101
|
+
return attrs;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
const isOwner = isTypeDefinedInLocalProject(program, type);
|
|
105
|
+
if (type.kind === "Model" && isOwner && isPartial(program, type)) {
|
|
106
|
+
attrs["ags:IsOwner"] = "false";
|
|
107
|
+
return attrs;
|
|
108
|
+
}
|
|
109
|
+
else if (type.kind === "ModelProperty" && isContains(program, type)
|
|
110
|
+
&& isTypeDefinedInExternalLibrary(program, type.type) && !isSharedEntity(program, type.type)) {
|
|
111
|
+
attrs["ags:IsOwner"] = "false";
|
|
112
|
+
return attrs;
|
|
113
|
+
}
|
|
114
|
+
attrs = { ...attrs, ...{ "ags:IsOwner": `${isOwner}` } };
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return attrs;
|
|
118
|
+
}
|
|
119
|
+
function enrichAttributesWithIsHidden(program, type, attrs) {
|
|
120
|
+
const hiddenStatusChecks = [isPrivatePreview, isPrivileged, isExperimental];
|
|
121
|
+
let isHidden = hiddenStatusChecks.some(check => check(program, type) || namespaceHasDecorator(program, type, check));
|
|
122
|
+
if (isHidden && !attrs.hasOwnProperty("ags:IsHidden")) {
|
|
123
|
+
attrs = { ...attrs, "ags:IsHidden": "true" };
|
|
124
|
+
}
|
|
125
|
+
return attrs;
|
|
126
|
+
}
|
|
127
|
+
function enrichAttributesWithIsSharedEntity(program, type, attrs) {
|
|
128
|
+
if (type.kind === 'Model' && isSharedEntity(program, type)) {
|
|
129
|
+
attrs = { ...attrs, "ags:IsSharedEntity": "true" };
|
|
130
|
+
}
|
|
131
|
+
return attrs;
|
|
132
|
+
}
|
|
133
|
+
function namespaceHasDecorator(program, type, isDecoratorPresent) {
|
|
134
|
+
switch (type.kind) {
|
|
135
|
+
case "Model":
|
|
136
|
+
case "Enum":
|
|
137
|
+
case "Interface":
|
|
138
|
+
case "Operation":
|
|
139
|
+
const namespace = type.namespace;
|
|
140
|
+
if (isDecoratorPresent(program, namespace)) {
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
export function applyOwnerlessAttributeToInterfaceBindingType(program, interfaces, models) {
|
|
148
|
+
if (interfaces.size === 0) {
|
|
149
|
+
return models;
|
|
150
|
+
}
|
|
151
|
+
interfaces.forEach((theInterface, key) => {
|
|
152
|
+
if (isOwnerless(program, theInterface)) {
|
|
153
|
+
const bindingType = getInterfaceNavigationSourceType(program, theInterface);
|
|
154
|
+
if (bindingType) {
|
|
155
|
+
const model = models.get(bindingType.name);
|
|
156
|
+
if (model) {
|
|
157
|
+
const modelAttributes = model === null || model === void 0 ? void 0 : model.AgsAttributes;
|
|
158
|
+
modelAttributes["ags:IsOwner"] = "false";
|
|
159
|
+
modelAttributes["ags:IsOwnerlessSingleton"] = "true";
|
|
160
|
+
model.AgsAttributes = modelAttributes;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
return models;
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=ags-attribute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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,SAAiB,CAAC,EAAE,CAAC;gBACnD,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM;IACV,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,6CAA6C,CAAC,OAAgB,EAAE,UAAkC,EAAE,MAAiC;IACnJ,IAAG,UAAU,CAAC,IAAI,KAAK,CAAC,EAAC,CAAC;QAAC,OAAO,MAAM,CAAC;IAAC,CAAC;IAE3C,UAAU,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,GAAG,EAAE,EAAE;QACvC,IAAI,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE,CAAC;YACvC,MAAM,WAAW,GAAG,gCAAgC,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YAC5E,IAAI,WAAW,EAAE,CAAC;gBAChB,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBAC3C,IAAI,KAAK,EAAE,CAAC;oBACV,MAAM,eAAe,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,CAAC;oBAC7C,eAAe,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC;oBACzC,eAAe,CAAC,0BAA0B,CAAC,GAAG,MAAM,CAAC;oBACrD,KAAK,CAAC,aAAa,GAAG,eAAe,CAAC;gBACxC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DecoratorContext, ModelProperty, Program } from "@typespec/compiler";
|
|
2
|
+
import { AllowedValues } from "../entities/model.js";
|
|
3
|
+
/**
|
|
4
|
+
* `@allowedValues` - mark a model property with allowedValues
|
|
5
|
+
*
|
|
6
|
+
* `@allowedValues` can only be applied to model properties.
|
|
7
|
+
*
|
|
8
|
+
* [See documentation](https://eng.ms/cid/8de40593-4e2f-4f27-b24b-9f1895402243/fid/b18d69318f896779f1f4a68cb77892a708aac8cfca5e7178d617592581256f40)
|
|
9
|
+
*/
|
|
10
|
+
export declare function $allowedValues(context: DecoratorContext, target: ModelProperty, ...values: unknown[]): void;
|
|
11
|
+
export declare function hasAllowedValues(program: Program, target: ModelProperty): boolean;
|
|
12
|
+
export declare function getAllowedValues(program: Program, target: ModelProperty): AllowedValues;
|
|
13
|
+
export declare function isAllowedValuesArgumentsEmpty(program: Program, target: ModelProperty): boolean;
|
|
14
|
+
export declare function isAllowedValuesPrimitive(program: Program, target: ModelProperty): boolean;
|
|
15
|
+
//# sourceMappingURL=allowed-values.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowed-values.d.ts","sourceRoot":"","sources":["../../../src/decorators/allowed-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;;;;;GAMG;AAEH,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,QAEpG;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,WAEvE;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,aAAa,CAOvF;AAED,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,WAEpF;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAQzF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const allowedValuesKey = Symbol("allowedValues");
|
|
2
|
+
/**
|
|
3
|
+
* `@allowedValues` - mark a model property with allowedValues
|
|
4
|
+
*
|
|
5
|
+
* `@allowedValues` can only be applied to model properties.
|
|
6
|
+
*
|
|
7
|
+
* [See documentation](https://eng.ms/cid/8de40593-4e2f-4f27-b24b-9f1895402243/fid/b18d69318f896779f1f4a68cb77892a708aac8cfca5e7178d617592581256f40)
|
|
8
|
+
*/
|
|
9
|
+
export function $allowedValues(context, target, ...values) {
|
|
10
|
+
context.program.stateMap(allowedValuesKey).set(target, values);
|
|
11
|
+
}
|
|
12
|
+
export function hasAllowedValues(program, target) {
|
|
13
|
+
return program.stateMap(allowedValuesKey).has(target);
|
|
14
|
+
}
|
|
15
|
+
export function getAllowedValues(program, target) {
|
|
16
|
+
var _a;
|
|
17
|
+
const values = program.stateMap(allowedValuesKey).get(target);
|
|
18
|
+
const type = (_a = target.type.node) === null || _a === void 0 ? void 0 : _a.symbol.name;
|
|
19
|
+
return {
|
|
20
|
+
type: type,
|
|
21
|
+
values: values
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export function isAllowedValuesArgumentsEmpty(program, target) {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
return ((_b = (_a = getAllowedValues(program, target)) === null || _a === void 0 ? void 0 : _a.values) === null || _b === void 0 ? void 0 : _b.length) === 0;
|
|
27
|
+
}
|
|
28
|
+
export function isAllowedValuesPrimitive(program, target) {
|
|
29
|
+
const values = program.stateMap(allowedValuesKey).get(target);
|
|
30
|
+
for (let i = 0; i < (values === null || values === void 0 ? void 0 : values.length); i++) {
|
|
31
|
+
if (typeof values[i] === 'object' || values[i] === null || Array.isArray(values[i]) || typeof values[i] === 'function') {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=allowed-values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowed-values.js","sourceRoot":"","sources":["../../../src/decorators/allowed-values.ts"],"names":[],"mappings":"AAGA,MAAM,gBAAgB,GAAG,MAAM,CAAC,e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,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,UAAU,EAAC,CAAC;YACrH,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -3,6 +3,8 @@ import { DecoratorContext, Model, Program } from "@typespec/compiler";
|
|
|
3
3
|
* `@complex` - mark a model as a complex type
|
|
4
4
|
*
|
|
5
5
|
* `@complex` can only be applied to models.
|
|
6
|
+
*
|
|
7
|
+
* [See documentation](https://eng.ms/cid/8de40593-4e2f-4f27-b24b-9f1895402243/fid/d24f257c6583a27871c8fb867cdea330c0965dcd5816ef06f205d864c78f0043)
|
|
6
8
|
*/
|
|
7
9
|
export declare function $complex(context: DecoratorContext, complex: Model): void;
|
|
8
10
|
export declare function isComplex(program: Program, complex: Model): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"complex.d.ts","sourceRoot":"","sources":["../../../src/decorators/complex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAItE
|
|
1
|
+
{"version":3,"file":"complex.d.ts","sourceRoot":"","sources":["../../../src/decorators/complex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAItE;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,KAAK,QAEjE;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,WAEzD"}
|
|
@@ -3,6 +3,8 @@ const complexKey = Symbol("complex");
|
|
|
3
3
|
* `@complex` - mark a model as a complex type
|
|
4
4
|
*
|
|
5
5
|
* `@complex` can only be applied to models.
|
|
6
|
+
*
|
|
7
|
+
* [See documentation](https://eng.ms/cid/8de40593-4e2f-4f27-b24b-9f1895402243/fid/d24f257c6583a27871c8fb867cdea330c0965dcd5816ef06f205d864c78f0043)
|
|
6
8
|
*/
|
|
7
9
|
export function $complex(context, complex) {
|
|
8
10
|
context.program.stateSet(complexKey).add(complex);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"complex.js","sourceRoot":"","sources":["../../../src/decorators/complex.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAErC
|
|
1
|
+
{"version":3,"file":"complex.js","sourceRoot":"","sources":["../../../src/decorators/complex.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAyB,EAAE,OAAc;IAChE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,OAAgB,EAAE,OAAc;IACxD,OAAO,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -3,6 +3,8 @@ import { DecoratorContext, ModelProperty, Program } from "@typespec/compiler";
|
|
|
3
3
|
* `@computed` - mark a model property as a computed property
|
|
4
4
|
*
|
|
5
5
|
* `@computed` can only be applied to model properties.
|
|
6
|
+
*
|
|
7
|
+
* [See documentation](https://eng.ms/cid/8de40593-4e2f-4f27-b24b-9f1895402243/fid/04971597afc3166f2ad3dafc8497494d49e3f855e64b82136c65fa65f7515acd)
|
|
6
8
|
*/
|
|
7
9
|
export declare function $computed(context: DecoratorContext, property: ModelProperty): void;
|
|
8
10
|
export declare function isComputed(program: Program, property: ModelProperty): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computed.d.ts","sourceRoot":"","sources":["../../../src/decorators/computed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG9E
|
|
1
|
+
{"version":3,"file":"computed.d.ts","sourceRoot":"","sources":["../../../src/decorators/computed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG9E;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,aAAa,QAE3E;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,WAEnE"}
|
|
@@ -3,6 +3,8 @@ const computedKey = Symbol("computed");
|
|
|
3
3
|
* `@computed` - mark a model property as a computed property
|
|
4
4
|
*
|
|
5
5
|
* `@computed` can only be applied to model properties.
|
|
6
|
+
*
|
|
7
|
+
* [See documentation](https://eng.ms/cid/8de40593-4e2f-4f27-b24b-9f1895402243/fid/04971597afc3166f2ad3dafc8497494d49e3f855e64b82136c65fa65f7515acd)
|
|
6
8
|
*/
|
|
7
9
|
export function $computed(context, property) {
|
|
8
10
|
context.program.stateSet(computedKey).add(property);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computed.js","sourceRoot":"","sources":["../../../src/decorators/computed.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AACvC
|
|
1
|
+
{"version":3,"file":"computed.js","sourceRoot":"","sources":["../../../src/decorators/computed.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AACvC;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,OAAyB,EAAE,QAAuB;IAC1E,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAAgB,EAAE,QAAuB;IAClE,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -3,6 +3,8 @@ import { DecoratorContext, ModelProperty, Program } from "@typespec/compiler";
|
|
|
3
3
|
* `@contains` - mark a model property as a contained navigation property
|
|
4
4
|
*
|
|
5
5
|
* `@contains` can only be applied to navigation model properties.
|
|
6
|
+
*
|
|
7
|
+
* [See documentation](https://eng.ms/cid/8de40593-4e2f-4f27-b24b-9f1895402243/fid/f67194dbd2961ad9e812c57eb1fbe005913e68408ff732d50aac327103c12c34)
|
|
6
8
|
*/
|
|
7
9
|
export declare function $contains(context: DecoratorContext, entity: ModelProperty): void;
|
|
8
10
|
export declare function isContains(program: Program, property: ModelProperty): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contains.d.ts","sourceRoot":"","sources":["../../../src/decorators/contains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAI9E
|
|
1
|
+
{"version":3,"file":"contains.d.ts","sourceRoot":"","sources":["../../../src/decorators/contains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAI9E;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,QAEzE;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,WAEnE"}
|
|
@@ -3,6 +3,8 @@ const containsKey = Symbol("contains");
|
|
|
3
3
|
* `@contains` - mark a model property as a contained navigation property
|
|
4
4
|
*
|
|
5
5
|
* `@contains` can only be applied to navigation model properties.
|
|
6
|
+
*
|
|
7
|
+
* [See documentation](https://eng.ms/cid/8de40593-4e2f-4f27-b24b-9f1895402243/fid/f67194dbd2961ad9e812c57eb1fbe005913e68408ff732d50aac327103c12c34)
|
|
6
8
|
*/
|
|
7
9
|
export function $contains(context, entity) {
|
|
8
10
|
context.program.stateSet(containsKey).add(entity);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contains.js","sourceRoot":"","sources":["../../../src/decorators/contains.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAEvC
|
|
1
|
+
{"version":3,"file":"contains.js","sourceRoot":"","sources":["../../../src/decorators/contains.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,OAAyB,EAAE,MAAqB;IACxE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAAgB,EAAE,QAAuB;IAClE,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -3,6 +3,8 @@ import { DecoratorContext, Operation, Program } from "@typespec/compiler";
|
|
|
3
3
|
* `@count` - Applies to: get operations that return collections.
|
|
4
4
|
* Indicates that the get operation supports both the OData $count query parameter and the $count trailing segment added to the collection route.
|
|
5
5
|
* These are indivisible for the sake of customer simplicity.
|
|
6
|
+
*
|
|
7
|
+
* [See documentation](https://eng.ms/cid/8de40593-4e2f-4f27-b24b-9f1895402243/fid/c5da2774c9e957e156baa1b28a836b4ad24f1c999c0a2eccfcaca6ed549ab2c6)
|
|
6
8
|
*/
|
|
7
9
|
export declare function $count(context: DecoratorContext, target: Operation): void;
|
|
8
10
|
export declare function isCount(program: Program, target: Operation): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"count.d.ts","sourceRoot":"","sources":["../../../src/decorators/count.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAI1E
|
|
1
|
+
{"version":3,"file":"count.d.ts","sourceRoot":"","sources":["../../../src/decorators/count.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAI1E;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,QAElE;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,WAE1D"}
|
|
@@ -3,6 +3,8 @@ const countKey = Symbol("count");
|
|
|
3
3
|
* `@count` - Applies to: get operations that return collections.
|
|
4
4
|
* Indicates that the get operation supports both the OData $count query parameter and the $count trailing segment added to the collection route.
|
|
5
5
|
* These are indivisible for the sake of customer simplicity.
|
|
6
|
+
*
|
|
7
|
+
* [See documentation](https://eng.ms/cid/8de40593-4e2f-4f27-b24b-9f1895402243/fid/c5da2774c9e957e156baa1b28a836b4ad24f1c999c0a2eccfcaca6ed549ab2c6)
|
|
6
8
|
*/
|
|
7
9
|
export function $count(context, target) {
|
|
8
10
|
context.program.stateSet(countKey).add(target);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"count.js","sourceRoot":"","sources":["../../../src/decorators/count.ts"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAEjC
|
|
1
|
+
{"version":3,"file":"count.js","sourceRoot":"","sources":["../../../src/decorators/count.ts"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAEjC;;;;;;GAMG;AACH,MAAM,UAAU,MAAM,CAAC,OAAyB,EAAE,MAAiB;IACjE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,OAAgB,EAAE,MAAiB;IACzD,OAAO,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DecoratorContext, Model, Program } from "@typespec/compiler";
|
|
2
|
+
/**
|
|
3
|
+
* `@deltaCollection` - Applies to: models.
|
|
4
|
+
* Indicates that the model is a body response containing a delta paged collection.
|
|
5
|
+
*/
|
|
6
|
+
export declare function $deltaCollection(context: DecoratorContext, target: Model): void;
|
|
7
|
+
export declare function isDeltaCollection(program: Program, target: Model): boolean;
|
|
8
|
+
//# sourceMappingURL=delta-collection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delta-collection.d.ts","sourceRoot":"","sources":["../../../src/decorators/delta-collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAItE;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,QAExE;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,WAEhE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const deltaCollectionKey = Symbol("deltaCollection");
|
|
2
|
+
/**
|
|
3
|
+
* `@deltaCollection` - Applies to: models.
|
|
4
|
+
* Indicates that the model is a body response containing a delta paged collection.
|
|
5
|
+
*/
|
|
6
|
+
export function $deltaCollection(context, target) {
|
|
7
|
+
context.program.stateSet(deltaCollectionKey).add(target);
|
|
8
|
+
}
|
|
9
|
+
export function isDeltaCollection(program, target) {
|
|
10
|
+
return program.stateSet(deltaCollectionKey).has(target);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=delta-collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delta-collection.js","sourceRoot":"","sources":["../../../src/decorators/delta-collection.ts"],"names":[],"mappings":"AAEA,MAAM,kBAAkB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAErD;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAyB,EAAE,MAAa;IACvE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAgB,EAAE,MAAa;IAC/D,OAAO,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DecoratorContext, Operation, Program } from "@typespec/compiler";
|
|
2
|
+
/**
|
|
3
|
+
* Marks a @function operation as a delta operation.
|
|
4
|
+
* Can only be applied to @function operations.
|
|
5
|
+
* @param context
|
|
6
|
+
* @param target
|
|
7
|
+
*/
|
|
8
|
+
export declare function $delta(context: DecoratorContext, target: Operation): void;
|
|
9
|
+
export declare function isDelta(program: Program, target: Operation): boolean;
|
|
10
|
+
//# sourceMappingURL=delta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delta.d.ts","sourceRoot":"","sources":["../../../src/decorators/delta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAI1E;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,QAElE;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,WAE1D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const deltaKey = Symbol('delta');
|
|
2
|
+
/**
|
|
3
|
+
* Marks a @function operation as a delta operation.
|
|
4
|
+
* Can only be applied to @function operations.
|
|
5
|
+
* @param context
|
|
6
|
+
* @param target
|
|
7
|
+
*/
|
|
8
|
+
export function $delta(context, target) {
|
|
9
|
+
context.program.stateSet(deltaKey).add(target);
|
|
10
|
+
}
|
|
11
|
+
export function isDelta(program, target) {
|
|
12
|
+
return program.stateSet(deltaKey).has(target);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=delta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delta.js","sourceRoot":"","sources":["../../../src/decorators/delta.ts"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,OAAyB,EAAE,MAAiB;IACjE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,OAAgB,EAAE,MAAiB;IACzD,OAAO,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { DecoratorContext, Namespace, Program } from "@typespec/compiler";
|
|
2
|
-
import { DecoratorParameter } from "./decorator-parameter.js";
|
|
3
2
|
/**
|
|
4
3
|
* `@deprecatedDefinition` - create a reusable deprecation definition.
|
|
5
4
|
*
|
|
6
5
|
* `@deprecatedDefinition` can only be applied to namespaces.
|
|
6
|
+
*
|
|
7
|
+
* [See documentation](https://eng.ms/cid/8de40593-4e2f-4f27-b24b-9f1895402243/fid/4f9dd3c25cc40429ef717fb0d984be99492fea1d16dae579e3bfea92de188598)
|
|
7
8
|
*/
|
|
8
|
-
export interface
|
|
9
|
+
export interface DeprecatedDefinitionParameters {
|
|
9
10
|
name: string;
|
|
10
11
|
category: string;
|
|
11
12
|
announcementDate: string;
|
|
@@ -16,7 +17,7 @@ export interface DeprecatedDecoratorParameters {
|
|
|
16
17
|
* `@deprecatedDefinition` - Allow us create a reusable deprecation definition.
|
|
17
18
|
* `@deprecatedDefinition` - Applies only to namespaces.
|
|
18
19
|
*/
|
|
19
|
-
export declare function $deprecatedDefinition(context: DecoratorContext, target: Namespace, name:
|
|
20
|
+
export declare function $deprecatedDefinition(context: DecoratorContext, target: Namespace, name: string, category: string, announcementDate: string, removalDate: string, description: string): void;
|
|
20
21
|
export declare function hasDeprecatedDefinitions(program: Program, target: Namespace): boolean;
|
|
21
|
-
export declare function getDeprecatedDefinitions(program: Program, target: Namespace): Map<string,
|
|
22
|
+
export declare function getDeprecatedDefinitions(program: Program, target: Namespace): Map<string, DeprecatedDefinitionParameters>;
|
|
22
23
|
//# sourceMappingURL=deprecated-definition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated-definition.d.ts","sourceRoot":"","sources":["../../../src/decorators/deprecated-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"deprecated-definition.d.ts","sourceRoot":"","sources":["../../../src/decorators/deprecated-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAID;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,QAMpB;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAErF;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,GAChB,GAAG,CAAC,MAAM,EAAE,8BAA8B,CAAC,CAK7C"}
|
|
@@ -5,13 +5,7 @@ const deprecatedDefinitionKey = Symbol("deprecatedDefinition");
|
|
|
5
5
|
*/
|
|
6
6
|
export function $deprecatedDefinition(context, target, name, category, announcementDate, removalDate, description) {
|
|
7
7
|
const definitions = getDeprecatedDefinitions(context.program, target);
|
|
8
|
-
definitions.set(name
|
|
9
|
-
name: name.value,
|
|
10
|
-
category: category.value,
|
|
11
|
-
announcementDate: announcementDate.value,
|
|
12
|
-
removalDate: removalDate.value,
|
|
13
|
-
description: description.value,
|
|
14
|
-
});
|
|
8
|
+
definitions.set(name, { name, category, announcementDate, removalDate, description });
|
|
15
9
|
context.program.stateMap(deprecatedDefinitionKey).set(target, definitions);
|
|
16
10
|
}
|
|
17
11
|
export function hasDeprecatedDefinitions(program, target) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated-definition.js","sourceRoot":"","sources":["../../../src/decorators/deprecated-definition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deprecated-definition.js","sourceRoot":"","sources":["../../../src/decorators/deprecated-definition.ts"],"names":[],"mappings":"AAiBA,MAAM,uBAAuB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAE/D;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAAyB,EACzB,MAAiB,EACjB,IAAY,EACZ,QAAgB,EAChB,gBAAwB,EACxB,WAAmB,EACnB,WAAmB;IAEnB,MAAM,WAAW,GAAG,wBAAwB,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACtE,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC;IAEtF,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,OAAgB,EAAE,MAAiB;IAC1E,OAAO,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,OAAgB,EAChB,MAAiB;IAEjB,OAAO,CACL,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;QACrD,IAAI,GAAG,EAA0C,CAClD,CAAC;AACJ,CAAC"}
|
|
@@ -3,8 +3,11 @@ import { DecoratorContext, Model, Program } from "@typespec/compiler";
|
|
|
3
3
|
* `@entity` - mark a model as an entity type
|
|
4
4
|
*
|
|
5
5
|
* `@entity` can only be applied to models.
|
|
6
|
+
*
|
|
7
|
+
* [See documentation](https://eng.ms/cid/8de40593-4e2f-4f27-b24b-9f1895402243/fid/2d1797d7ed936752383ce3c9c1313afbd37aeb159a34048d0442b8ba02ef1e7a)
|
|
6
8
|
*/
|
|
7
9
|
export declare function $entity(context: DecoratorContext, entity: Model): void;
|
|
10
|
+
export declare function isDirectEntity(program: Program, entity: Model): boolean;
|
|
8
11
|
export declare function isEntity(program: Program, entity: Model): boolean;
|
|
9
12
|
export declare function getEntity(program: Program, name: string): Model | undefined;
|
|
10
13
|
//# sourceMappingURL=entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/decorators/entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/decorators/entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAKtE;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,QAE/D;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,WAE7D;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,WAEvD;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAM3E"}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
import { isSharedEntity } from "./shared-entity.js";
|
|
1
2
|
const entityKey = Symbol("entity");
|
|
2
3
|
/**
|
|
3
4
|
* `@entity` - mark a model as an entity type
|
|
4
5
|
*
|
|
5
6
|
* `@entity` can only be applied to models.
|
|
7
|
+
*
|
|
8
|
+
* [See documentation](https://eng.ms/cid/8de40593-4e2f-4f27-b24b-9f1895402243/fid/2d1797d7ed936752383ce3c9c1313afbd37aeb159a34048d0442b8ba02ef1e7a)
|
|
6
9
|
*/
|
|
7
10
|
export function $entity(context, entity) {
|
|
8
11
|
context.program.stateSet(entityKey).add(entity);
|
|
9
12
|
}
|
|
10
|
-
export function
|
|
13
|
+
export function isDirectEntity(program, entity) {
|
|
11
14
|
return program.stateSet(entityKey).has(entity);
|
|
12
15
|
}
|
|
16
|
+
export function isEntity(program, entity) {
|
|
17
|
+
return isDirectEntity(program, entity) || isSharedEntity(program, entity);
|
|
18
|
+
}
|
|
13
19
|
export function getEntity(program, name) {
|
|
14
20
|
const matches = [...program.stateSet(entityKey)].filter((type) => type.kind === "Model" && type.name === name);
|
|
15
21
|
return matches.length ? matches[0] : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/decorators/entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/decorators/entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAEnC;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,OAAyB,EAAE,MAAa;IAC9D,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,OAAgB,EAAE,MAAa;IAC5D,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,OAAgB,EAAE,MAAa;IACtD,OAAO,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,OAAgB,EAAE,IAAY;IACtD,MAAM,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CACrD,CAAC,IAAI,EAAiB,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CACrE,CAAC;IAEF,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACjD,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { DecoratorContext, Operation, Program } from "@typespec/compiler";
|
|
2
|
-
import { DecoratorParameter } from "./decorator-parameter.js";
|
|
3
2
|
/**
|
|
4
3
|
* `@expand` - Applies to: get operations that return collections or individual instances of models that contain @contains or @references properties.
|
|
5
4
|
* Indicates that the get operation supports the OData $expand query parameter.
|
|
6
5
|
*
|
|
7
6
|
* `properties` - Property names in the model returned from the get operation that can be used in a $expand query parameter.
|
|
7
|
+
*
|
|
8
|
+
* [See documentation](https://eng.ms/cid/8de40593-4e2f-4f27-b24b-9f1895402243/fid/93bb7e256a1fc0221a42ac770ee7cbaba8375f07d675ddcc754509cf14767d44)
|
|
8
9
|
*/
|
|
9
|
-
export declare function $expand(context: DecoratorContext, target: Operation, ...properties:
|
|
10
|
+
export declare function $expand(context: DecoratorContext, target: Operation, ...properties: string[]): void;
|
|
10
11
|
export declare function getExpand(program: Program, target: Operation): string[];
|
|
11
12
|
export declare function isExpand(program: Program, target: Operation): boolean;
|
|
13
|
+
export declare function sanitizeExpandProperties(expandProps: string[]): string[];
|
|
12
14
|
//# sourceMappingURL=expand.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expand.d.ts","sourceRoot":"","sources":["../../../src/decorators/expand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"expand.d.ts","sourceRoot":"","sources":["../../../src/decorators/expand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAI1E;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE,QAG5F;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,EAAE,CAEvE;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAErE;AAED,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAExE"}
|
|
@@ -4,9 +4,12 @@ const expandKey = Symbol("expand");
|
|
|
4
4
|
* Indicates that the get operation supports the OData $expand query parameter.
|
|
5
5
|
*
|
|
6
6
|
* `properties` - Property names in the model returned from the get operation that can be used in a $expand query parameter.
|
|
7
|
+
*
|
|
8
|
+
* [See documentation](https://eng.ms/cid/8de40593-4e2f-4f27-b24b-9f1895402243/fid/93bb7e256a1fc0221a42ac770ee7cbaba8375f07d675ddcc754509cf14767d44)
|
|
7
9
|
*/
|
|
8
10
|
export function $expand(context, target, ...properties) {
|
|
9
|
-
|
|
11
|
+
const sanitizedProperties = sanitizeExpandProperties(properties);
|
|
12
|
+
context.program.stateMap(expandKey).set(target, sanitizedProperties);
|
|
10
13
|
}
|
|
11
14
|
export function getExpand(program, target) {
|
|
12
15
|
return program.stateMap(expandKey).get(target) || [];
|
|
@@ -14,4 +17,7 @@ export function getExpand(program, target) {
|
|
|
14
17
|
export function isExpand(program, target) {
|
|
15
18
|
return program.stateMap(expandKey).has(target);
|
|
16
19
|
}
|
|
20
|
+
export function sanitizeExpandProperties(expandProps) {
|
|
21
|
+
return expandProps ? expandProps.filter((prop) => prop.trim() !== "") : [];
|
|
22
|
+
}
|
|
17
23
|
//# sourceMappingURL=expand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expand.js","sourceRoot":"","sources":["../../../src/decorators/expand.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"expand.js","sourceRoot":"","sources":["../../../src/decorators/expand.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAEnC;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,OAAyB,EAAE,MAAiB,EAAE,GAAG,UAAoB;IAC3F,MAAM,mBAAmB,GAAG,wBAAwB,CAAC,UAAU,CAAC,CAAC;IACjE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AACvE,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,OAAgB,EAAE,MAAiB;IAC3D,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,OAAgB,EAAE,MAAiB;IAC1D,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,WAAqB;IAC5D,OAAO,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC7E,CAAC"}
|