@microsoft/typespec-msgraph 0.0.1-Preview.2 → 0.0.1-Preview.21
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.d.ts +3 -4
- package/dist/src/components/acceptable-media-types-annotation.d.ts.map +1 -1
- package/dist/src/components/acceptable-media-types-annotation.js +2 -6
- package/dist/src/components/acceptable-media-types-annotation.js.map +1 -1
- package/dist/src/components/alternate-keys-annotation.d.ts +4 -4
- package/dist/src/components/alternate-keys-annotation.d.ts.map +1 -1
- package/dist/src/components/alternate-keys-annotation.js +9 -16
- 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 +84 -0
- package/dist/src/components/annotations.js.map +1 -0
- package/dist/src/components/common-elements.d.ts +16 -74
- package/dist/src/components/common-elements.d.ts.map +1 -1
- package/dist/src/components/common-elements.js +12 -26
- package/dist/src/components/common-elements.js.map +1 -1
- package/dist/src/components/computed-annotation.d.ts +3 -4
- package/dist/src/components/computed-annotation.d.ts.map +1 -1
- package/dist/src/components/computed-annotation.js +4 -10
- package/dist/src/components/computed-annotation.js.map +1 -1
- package/dist/src/components/count-restrictions-annotation.d.ts +3 -4
- package/dist/src/components/count-restrictions-annotation.d.ts.map +1 -1
- package/dist/src/components/count-restrictions-annotation.js +4 -13
- 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 +3 -4
- package/dist/src/components/description-annotation.d.ts.map +1 -1
- package/dist/src/components/description-annotation.js +5 -11
- package/dist/src/components/description-annotation.js.map +1 -1
- package/dist/src/components/entity-container-element.d.ts +21 -0
- package/dist/src/components/entity-container-element.d.ts.map +1 -0
- package/dist/src/components/entity-container-element.js +32 -0
- package/dist/src/components/entity-container-element.js.map +1 -0
- package/dist/src/components/enum-type-element.d.ts +6 -0
- package/dist/src/components/enum-type-element.d.ts.map +1 -0
- package/dist/src/components/enum-type-element.js +20 -0
- package/dist/src/components/enum-type-element.js.map +1 -0
- package/dist/src/components/expand-restrictions-annotation.d.ts +4 -5
- package/dist/src/components/expand-restrictions-annotation.d.ts.map +1 -1
- package/dist/src/components/expand-restrictions-annotation.js +9 -30
- 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.d.ts +2 -14
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +9 -14
- 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 +6 -0
- package/dist/src/components/operation-element.d.ts.map +1 -0
- package/dist/src/components/operation-element.js +83 -0
- package/dist/src/components/operation-element.js.map +1 -0
- package/dist/src/components/permissions-annotation.d.ts +3 -4
- package/dist/src/components/permissions-annotation.d.ts.map +1 -1
- package/dist/src/components/permissions-annotation.js +2 -10
- package/dist/src/components/permissions-annotation.js.map +1 -1
- package/dist/src/components/property-element.d.ts +4 -4
- package/dist/src/components/property-element.d.ts.map +1 -1
- package/dist/src/components/property-element.js +20 -32
- 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 +4 -5
- package/dist/src/components/revisions-annotation.d.ts.map +1 -1
- package/dist/src/components/revisions-annotation.js +8 -51
- package/dist/src/components/revisions-annotation.js.map +1 -1
- package/dist/src/components/schema-element.d.ts +6 -0
- package/dist/src/components/schema-element.d.ts.map +1 -0
- package/dist/src/components/schema-element.js +47 -0
- package/dist/src/components/schema-element.js.map +1 -0
- package/dist/src/components/search-restrictions-annotation.d.ts +3 -4
- package/dist/src/components/search-restrictions-annotation.d.ts.map +1 -1
- package/dist/src/components/search-restrictions-annotation.js +4 -13
- 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 +3 -4
- package/dist/src/components/skip-supported-annotation.d.ts.map +1 -1
- package/dist/src/components/skip-supported-annotation.js +2 -11
- package/dist/src/components/skip-supported-annotation.js.map +1 -1
- package/dist/src/components/sort-restrictions-annotation.d.ts +4 -5
- package/dist/src/components/sort-restrictions-annotation.d.ts.map +1 -1
- package/dist/src/components/sort-restrictions-annotation.js +9 -30
- package/dist/src/components/sort-restrictions-annotation.js.map +1 -1
- package/dist/src/components/structured-type-element.d.ts +7 -4
- package/dist/src/components/structured-type-element.d.ts.map +1 -1
- package/dist/src/components/structured-type-element.js +26 -66
- 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 +3 -4
- package/dist/src/components/top-supported-annotation.d.ts.map +1 -1
- package/dist/src/components/top-supported-annotation.js +3 -10
- 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 -6
- 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/{handlers/custom/additional-query-parameters.d.ts → additional-query-parameters.d.ts} +5 -1
- 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 +156 -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 -6
- 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 +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 +2 -0
- package/dist/src/decorators/entity.d.ts.map +1 -1
- package/dist/src/decorators/entity.js +2 -6
- 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 +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/flags.d.ts +11 -0
- package/dist/src/decorators/flags.d.ts.map +1 -0
- package/dist/src/decorators/flags.js +15 -0
- package/dist/src/decorators/flags.js.map +1 -0
- package/dist/src/decorators/function.d.ts +17 -0
- package/dist/src/decorators/function.d.ts.map +1 -0
- package/dist/src/decorators/function.js +21 -0
- package/dist/src/decorators/function.js.map +1 -0
- 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/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 -1
- package/dist/src/decorators/index.d.ts.map +1 -1
- package/dist/src/decorators/index.js +35 -1
- 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 -6
- package/dist/src/decorators/open.js.map +1 -1
- package/dist/src/decorators/{routed-interfaces.d.ts → operation-parameters.d.ts} +5 -11
- package/dist/src/decorators/operation-parameters.d.ts.map +1 -0
- package/dist/src/decorators/operation-parameters.js +17 -0
- package/dist/src/decorators/operation-parameters.js.map +1 -0
- 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/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 +13 -0
- package/dist/src/decorators/passthrough-address-url-msa.d.ts.map +1 -0
- package/dist/src/decorators/passthrough-address-url-msa.js +19 -0
- package/dist/src/decorators/passthrough-address-url-msa.js.map +1 -0
- package/dist/src/decorators/passthrough-address-url.d.ts +13 -0
- package/dist/src/decorators/passthrough-address-url.d.ts.map +1 -0
- package/dist/src/decorators/passthrough-address-url.js +19 -0
- package/dist/src/decorators/passthrough-address-url.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 -10
- 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/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 +28 -3
- 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 +48 -0
- package/dist/src/entities/annotations.d.ts.map +1 -0
- package/dist/src/entities/annotations.js +166 -0
- package/dist/src/entities/annotations.js.map +1 -0
- package/dist/src/entities/entity-container.d.ts +36 -0
- package/dist/src/entities/entity-container.d.ts.map +1 -0
- package/dist/src/entities/entity-container.js +59 -0
- package/dist/src/entities/entity-container.js.map +1 -0
- package/dist/src/entities/enum.d.ts +19 -0
- package/dist/src/entities/enum.d.ts.map +1 -0
- package/dist/src/entities/enum.js +27 -0
- package/dist/src/entities/enum.js.map +1 -0
- package/dist/src/entities/model.d.ts +63 -0
- package/dist/src/entities/model.d.ts.map +1 -0
- package/dist/src/entities/model.js +273 -0
- package/dist/src/entities/model.js.map +1 -0
- 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 +40 -0
- package/dist/src/entities/namespace.d.ts.map +1 -0
- package/dist/src/entities/namespace.js +351 -0
- package/dist/src/entities/namespace.js.map +1 -0
- package/dist/src/entities/operation.d.ts +41 -0
- package/dist/src/entities/operation.d.ts.map +1 -0
- package/dist/src/entities/operation.js +202 -0
- package/dist/src/entities/operation.js.map +1 -0
- package/dist/src/entities/property.d.ts +3 -0
- package/dist/src/entities/property.d.ts.map +1 -0
- package/dist/src/entities/property.js +57 -0
- package/dist/src/entities/property.js.map +1 -0
- package/dist/src/entities/revision-definition.d.ts +10 -0
- package/dist/src/entities/revision-definition.d.ts.map +1 -0
- package/dist/src/entities/revision-definition.js +53 -0
- package/dist/src/entities/revision-definition.js.map +1 -0
- 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 +1 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +132 -106
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +72 -10
- 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 +23 -34
- package/dist/src/linter.js.map +1 -1
- 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 +19 -0
- package/dist/src/rules/address-url.d.ts.map +1 -0
- package/dist/src/rules/address-url.js +161 -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 +203 -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/entity.d.ts +6 -1
- package/dist/src/rules/entity.d.ts.map +1 -1
- package/dist/src/rules/entity.js +177 -11
- package/dist/src/rules/entity.js.map +1 -1
- package/dist/src/rules/enum.d.ts +4 -0
- package/dist/src/rules/enum.d.ts.map +1 -0
- package/dist/src/rules/enum.js +29 -0
- package/dist/src/rules/enum.js.map +1 -0
- 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 +26 -23
- 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 +4 -0
- package/dist/src/rules/function.d.ts.map +1 -0
- package/dist/src/rules/function.js +65 -0
- package/dist/src/rules/function.js.map +1 -0
- 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 +15 -0
- package/dist/src/rules/graph-route.d.ts.map +1 -0
- package/dist/src/rules/graph-route.js +296 -0
- package/dist/src/rules/graph-route.js.map +1 -0
- package/dist/src/rules/index.d.ts +25 -7
- package/dist/src/rules/index.d.ts.map +1 -1
- package/dist/src/rules/index.js +25 -162
- 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 +4 -0
- package/dist/src/rules/model.d.ts.map +1 -0
- package/dist/src/rules/model.js +36 -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 +25 -24
- 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 +171 -0
- package/dist/src/rules/ownerless.js.map +1 -0
- package/dist/src/rules/partial.d.ts +7 -0
- package/dist/src/rules/partial.d.ts.map +1 -0
- package/dist/src/rules/partial.js +52 -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 +125 -0
- package/dist/src/rules/record-t.js.map +1 -0
- package/dist/src/rules/reference-target.d.ts +8 -0
- package/dist/src/rules/reference-target.d.ts.map +1 -0
- package/dist/src/rules/reference-target.js +118 -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 +42 -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/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 +75 -2
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +706 -12
- 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 +83 -0
- package/dist/src/validate.js.map +1 -0
- package/lib/bodies.tsp +71 -0
- package/lib/decorators.tsp +350 -40
- 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 +41 -32
- package/dist/src/components/program-context.d.ts +0 -4
- package/dist/src/components/program-context.d.ts.map +0 -1
- package/dist/src/components/program-context.js +0 -3
- package/dist/src/components/program-context.js.map +0 -1
- package/dist/src/csdl.d.ts +0 -8
- package/dist/src/csdl.d.ts.map +0 -1
- package/dist/src/csdl.js +0 -298
- package/dist/src/csdl.js.map +0 -1
- 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/handlers/custom/additional-query-parameters.d.ts.map +0 -1
- package/dist/src/decorators/handlers/custom/additional-query-parameters.js +0 -36
- package/dist/src/decorators/handlers/custom/additional-query-parameters.js.map +0 -1
- package/dist/src/decorators/handlers/custom/ags-attribute.d.ts +0 -7
- 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 -30
- 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 -30
- package/dist/src/decorators/has-stream.js.map +0 -1
- package/dist/src/decorators/routed-interfaces.d.ts.map +0 -1
- package/dist/src/decorators/routed-interfaces.js +0 -43
- package/dist/src/decorators/routed-interfaces.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
package/dist/src/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","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BAC1I,uCAAuC,EAAE,YAAY,CAAA,qBAAqB,aAAa,iCAAiC,WAAW,sBAAsB;aAC1J;SACF;QACD,wBAAwB,EAAE;YACxB,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,wCAAwC,OAAO,uEAAuE;aAC5I;SACF;QACD,qBAAqB,EAAE;YACrB,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,KAAK,MAAM,4BAA4B,MAAM,YAAY;gBAC9E,UAAU,EAAE,8FAA8F;aAC3G;SACF;QACD,kBAAkB,EAAE;YAClB,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,OAAO,MAAM,yDAAyD;gBAC3F,8BAA8B,EAAE,YAAY,CAAA,oBAAoB,MAAM,2BAA2B;gBACjG,sBAAsB,EAAE,YAAY,CAAA,oBAAoB,MAAM,mBAAmB;gBACjF,4BAA4B,EAAE,YAAY,CAAA,kCAAkC,MAAM,6DAA6D;gBAC/I,+BAA+B,EAAE,YAAY,CAAA,kBAAkB,WAAW,0CAA0C,MAAM,0CAA0C;aACrK;SACF;KACF;IACD,OAAO,EAAE,EAAE,OAAO,EAAE,oBAA6D,EAAE;CAC3E,CAAC,CAAC"}
|
package/dist/src/linter.d.ts
CHANGED
package/dist/src/linter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,OAAO,+CAoBlB,CAAA"}
|
package/dist/src/linter.js
CHANGED
|
@@ -1,35 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
referencesOnlyAppliesToNavigationPropertyRule,
|
|
25
|
-
searchAppliesToGetOperationsThatReturnCollectionsRule,
|
|
26
|
-
skipAppliesToGetOperationsThatReturnCollectionsRule,
|
|
27
|
-
topAppliesToGetOperationsThatReturnCollectionsRule,
|
|
28
|
-
useEvolvableEnumRule,
|
|
29
|
-
voidFunctionRule,
|
|
30
|
-
], { autoEnable: true });
|
|
31
|
-
export function $onValidate(program) {
|
|
32
|
-
linter.autoEnableRules();
|
|
33
|
-
linter.lintOnValidate(program);
|
|
34
|
-
}
|
|
1
|
+
import { defineLinter } from "@typespec/compiler";
|
|
2
|
+
import { modelShouldBeEntityOrComplexType, singletonOrEntitySetHostingBindingsShouldExist, useEvolvableEnumRule, mediaTypeValuesShouldBeMinimallyFormattedForMIMETypes, interfaceNavigationSourceShouldHaveMediaIf$ValueIsSpecified, getPutPostAndPatchOperationsShouldHaveSelectDecorator, useRecordTypeInsteadOfDictionary, dictionaryTypeIsMostlyUsedWithRecordType } from "./rules/index.js";
|
|
3
|
+
export const $linter = defineLinter({
|
|
4
|
+
rules: [useEvolvableEnumRule, singletonOrEntitySetHostingBindingsShouldExist,
|
|
5
|
+
modelShouldBeEntityOrComplexType, mediaTypeValuesShouldBeMinimallyFormattedForMIMETypes,
|
|
6
|
+
interfaceNavigationSourceShouldHaveMediaIf$ValueIsSpecified, getPutPostAndPatchOperationsShouldHaveSelectDecorator,
|
|
7
|
+
useRecordTypeInsteadOfDictionary, dictionaryTypeIsMostlyUsedWithRecordType
|
|
8
|
+
],
|
|
9
|
+
ruleSets: {
|
|
10
|
+
recommended: {
|
|
11
|
+
enable: {
|
|
12
|
+
[`@microsoft/typespec-msgraph/${useEvolvableEnumRule.name}`]: true,
|
|
13
|
+
[`@microsoft/typespec-msgraph/${singletonOrEntitySetHostingBindingsShouldExist.name}`]: true,
|
|
14
|
+
[`@microsoft/typespec-msgraph/${modelShouldBeEntityOrComplexType.name}`]: true,
|
|
15
|
+
[`@microsoft/typespec-msgraph/${mediaTypeValuesShouldBeMinimallyFormattedForMIMETypes.name}`]: true,
|
|
16
|
+
[`@microsoft/typespec-msgraph/${interfaceNavigationSourceShouldHaveMediaIf$ValueIsSpecified.name}`]: true,
|
|
17
|
+
[`@microsoft/typespec-msgraph/${getPutPostAndPatchOperationsShouldHaveSelectDecorator.name}`]: true,
|
|
18
|
+
[`@microsoft/typespec-msgraph/${useRecordTypeInsteadOfDictionary.name}`]: true,
|
|
19
|
+
[`@microsoft/typespec-msgraph/${dictionaryTypeIsMostlyUsedWithRecordType.name}`]: true,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
});
|
|
35
24
|
//# sourceMappingURL=linter.js.map
|
package/dist/src/linter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linter.js","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"linter.js","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gCAAgC,EAAE,8CAA8C,EACvF,oBAAoB,EAAE,qDAAqD,EAC3E,2DAA2D,EAAE,qDAAqD,EAClH,gCAAgC,EAAE,wCAAwC,EAC1E,MAAM,kBAAkB,CAAC;AAE3B,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAC;IAClC,KAAK,EAAE,CAAC,oBAAoB,EAAE,8CAA8C;QAC1E,gCAAgC,EAAE,qDAAqD;QACvF,2DAA2D,EAAE,qDAAqD;QAClH,gCAAgC,EAAE,wCAAwC;KAC3E;IACD,QAAQ,EAAE;QACR,WAAW,EAAE;YACX,MAAM,EAAE;gBACN,CAAC,+BAA+B,oBAAoB,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBAClE,CAAC,+BAA+B,8CAA8C,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBAC5F,CAAC,+BAA+B,gCAAgC,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBAC9E,CAAC,+BAA+B,qDAAqD,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBACnG,CAAC,+BAA+B,2DAA2D,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBACzG,CAAC,+BAA+B,qDAAqD,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBACnG,CAAC,+BAA+B,gCAAgC,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBAC9E,CAAC,+BAA+B,wCAAwC,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;aACvF;SACF;KACF;CACF,CAAC,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Program } from "@typespec/compiler";
|
|
1
2
|
/**
|
|
2
3
|
* @abstract applies to either an entity or a complex type.
|
|
3
4
|
*/
|
|
4
|
-
export declare
|
|
5
|
+
export declare function validateAbstractOnlyAppliesToStructuredTypes(program: Program): void;
|
|
5
6
|
//# sourceMappingURL=abstract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract.d.ts","sourceRoot":"","sources":["../../../src/rules/abstract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"abstract.d.ts","sourceRoot":"","sources":["../../../src/rules/abstract.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAA4B,MAAM,oBAAoB,CAAC;AAGvE;;GAEG;AACH,wBAAgB,4CAA4C,CAAC,OAAO,EAAE,OAAO,QAwB5E"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { createRule } from "@typespec/lint";
|
|
2
1
|
import { isAbstract, isComplex, isEntity } from "../index.js";
|
|
3
2
|
import { reportDiagnostic } from "../lib.js";
|
|
3
|
+
import { navigateTypesInNamespace } from "@typespec/compiler";
|
|
4
|
+
import { GetDeclaredNamespaces } from "../entities/namespace.js";
|
|
4
5
|
/**
|
|
5
6
|
* @abstract applies to either an entity or a complex type.
|
|
6
7
|
*/
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return {
|
|
8
|
+
export function validateAbstractOnlyAppliesToStructuredTypes(program) {
|
|
9
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
10
|
+
navigateTypesInNamespace(namespace, {
|
|
11
11
|
model: (model) => {
|
|
12
12
|
if (!isAbstract(program, model)) {
|
|
13
13
|
return;
|
|
@@ -25,7 +25,7 @@ export const abstractOnlyAppliesToStructuredTypeRule = createRule({
|
|
|
25
25
|
},
|
|
26
26
|
});
|
|
27
27
|
},
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
31
|
//# sourceMappingURL=abstract.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract.js","sourceRoot":"","sources":["../../../src/rules/abstract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"abstract.js","sourceRoot":"","sources":["../../../src/rules/abstract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAW,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE;;GAEG;AACH,MAAM,UAAU,4CAA4C,CAAC,OAAgB;IAC3E,KAAK,MAAM,SAAS,IAAI,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC;QACvD,wBAAwB,CAAC,SAAS,EAAE;YAClC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;gBACf,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC;oBAChC,OAAO;gBACT,CAAC;gBAED,IAAI,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC;oBAC1D,OAAO;gBACT,CAAC;gBAED,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,uBAAuB;oBAC7B,MAAM,EAAE,KAAK;oBACb,SAAS,EAAE,WAAW;oBACtB,MAAM,EAAE;wBACN,SAAS,EAAE,WAAW;wBACtB,MAAM,EAAE,gCAAgC;qBACzC;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Program } from "@typespec/compiler";
|
|
2
|
+
/**
|
|
3
|
+
* @addressUrl only applies to either routed interfaces (entity sets, singletons and navigation properties) or action operations.
|
|
4
|
+
*/
|
|
5
|
+
export declare function validateAddressUrlOnlyAppliesToRoutedInterfacesOrActionOperations(program: Program): void;
|
|
6
|
+
/**
|
|
7
|
+
* @addressUrlMsa only applies to either routed interfaces (entity sets, singletons and navigation properties) or action operations.
|
|
8
|
+
*/
|
|
9
|
+
export declare function validateAddressUrlMsaOnlyAppliesToRoutedInterfacesOrActionOperations(program: Program): void;
|
|
10
|
+
/**
|
|
11
|
+
* @passthroughAddressUrl only applies to either routed interfaces (entity sets, singletons and navigation properties) or action operations.
|
|
12
|
+
*/
|
|
13
|
+
export declare function validatePassthroughAddressUrlOnlyAppliesToRoutedInterfacesOrActionOperations(program: Program): void;
|
|
14
|
+
/**
|
|
15
|
+
* @passthroughAddressUrlMsa only applies to either routed interfaces (entity sets, singletons and navigation properties) or action operations.
|
|
16
|
+
*/
|
|
17
|
+
export declare function validatePassthroughAddressUrlMsaOnlyAppliesToRoutedInterfacesOrActionOperations(program: Program): void;
|
|
18
|
+
export declare function validatePassthroughAddressUrlDecoratorIsUsedTogetherWithAddressUrlDecorator(program: Program): void;
|
|
19
|
+
//# sourceMappingURL=address-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address-url.d.ts","sourceRoot":"","sources":["../../../src/rules/address-url.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAkD,MAAM,oBAAoB,CAAC;AAK7F;;GAEG;AACH,wBAAgB,iEAAiE,CAC/E,OAAO,EAAE,OAAO,QAgBjB;AAED;;GAEG;AACH,wBAAgB,oEAAoE,CAClF,OAAO,EAAE,OAAO,QAgBjB;AAED;;GAEG;AACH,wBAAgB,4EAA4E,CAC1F,OAAO,EAAE,OAAO,QAgBjB;AAED;;GAEG;AACH,wBAAgB,+EAA+E,CAC7F,OAAO,EAAE,OAAO,QAgBjB;AAED,wBAAgB,2EAA2E,CACzF,OAAO,EAAE,OAAO,QAqEjB"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { hasAddressUrl, hasAddressUrlMsa, hasGraphRoute, hasPassthroughAddressUrl, isAction, } from "../index.js";
|
|
2
|
+
import { reportDiagnostic } from "../lib.js";
|
|
3
|
+
import { navigateTypesInNamespace } from "@typespec/compiler";
|
|
4
|
+
import { GetDeclaredNamespaces } from "../entities/namespace.js";
|
|
5
|
+
import { hasPassthroughAddressUrlMsa } from "../decorators/passthrough-address-url-msa.js";
|
|
6
|
+
import { getIdForType } from "../utils.js";
|
|
7
|
+
/**
|
|
8
|
+
* @addressUrl only applies to either routed interfaces (entity sets, singletons and navigation properties) or action operations.
|
|
9
|
+
*/
|
|
10
|
+
export function validateAddressUrlOnlyAppliesToRoutedInterfacesOrActionOperations(program) {
|
|
11
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
12
|
+
navigateTypesInNamespace(namespace, {
|
|
13
|
+
interface: (theInterface) => {
|
|
14
|
+
if (hasAddressUrl(program, theInterface)) {
|
|
15
|
+
validateAddressUrlApplication(program, theInterface, "@addressUrl");
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
operation: (operation) => {
|
|
19
|
+
if (hasAddressUrl(program, operation)) {
|
|
20
|
+
validateAddressUrlApplication(program, operation, "@addressUrl");
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @addressUrlMsa only applies to either routed interfaces (entity sets, singletons and navigation properties) or action operations.
|
|
28
|
+
*/
|
|
29
|
+
export function validateAddressUrlMsaOnlyAppliesToRoutedInterfacesOrActionOperations(program) {
|
|
30
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
31
|
+
navigateTypesInNamespace(namespace, {
|
|
32
|
+
interface: (theInterface) => {
|
|
33
|
+
if (hasAddressUrlMsa(program, theInterface)) {
|
|
34
|
+
validateAddressUrlApplication(program, theInterface, "@addressUrlMsa");
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
operation: (operation) => {
|
|
38
|
+
if (hasAddressUrlMsa(program, operation)) {
|
|
39
|
+
validateAddressUrlApplication(program, operation, "@addressUrlMsa");
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @passthroughAddressUrl only applies to either routed interfaces (entity sets, singletons and navigation properties) or action operations.
|
|
47
|
+
*/
|
|
48
|
+
export function validatePassthroughAddressUrlOnlyAppliesToRoutedInterfacesOrActionOperations(program) {
|
|
49
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
50
|
+
navigateTypesInNamespace(namespace, {
|
|
51
|
+
interface: (theInterface) => {
|
|
52
|
+
if (hasPassthroughAddressUrl(program, theInterface)) {
|
|
53
|
+
validateAddressUrlApplication(program, theInterface, "@passthroughAddressUrl");
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
operation: (operation) => {
|
|
57
|
+
if (hasPassthroughAddressUrl(program, operation)) {
|
|
58
|
+
validateAddressUrlApplication(program, operation, "@passthroughAddressUrl");
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @passthroughAddressUrlMsa only applies to either routed interfaces (entity sets, singletons and navigation properties) or action operations.
|
|
66
|
+
*/
|
|
67
|
+
export function validatePassthroughAddressUrlMsaOnlyAppliesToRoutedInterfacesOrActionOperations(program) {
|
|
68
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
69
|
+
navigateTypesInNamespace(namespace, {
|
|
70
|
+
interface: (theInterface) => {
|
|
71
|
+
if (hasPassthroughAddressUrlMsa(program, theInterface)) {
|
|
72
|
+
validateAddressUrlApplication(program, theInterface, "@passthroughAddressUrlMsa");
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
operation: (operation) => {
|
|
76
|
+
if (hasPassthroughAddressUrlMsa(program, operation)) {
|
|
77
|
+
validateAddressUrlApplication(program, operation, "@passthroughAddressUrlMsa");
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export function validatePassthroughAddressUrlDecoratorIsUsedTogetherWithAddressUrlDecorator(program) {
|
|
84
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
85
|
+
navigateTypesInNamespace(namespace, {
|
|
86
|
+
interface: (theInterface) => {
|
|
87
|
+
if (hasPassthroughAddressUrl(program, theInterface) &&
|
|
88
|
+
!hasAddressUrl(program, theInterface)) {
|
|
89
|
+
reportDiagnostic(program, {
|
|
90
|
+
code: "decorator-missing-dependencies",
|
|
91
|
+
target: theInterface,
|
|
92
|
+
messageId: "default",
|
|
93
|
+
format: {
|
|
94
|
+
decorator: "@passthroughAddressUrl",
|
|
95
|
+
required: "@addressUrl",
|
|
96
|
+
location: `interface "${getIdForType(program, theInterface)}"`,
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (hasPassthroughAddressUrlMsa(program, theInterface) &&
|
|
101
|
+
!hasAddressUrlMsa(program, theInterface)) {
|
|
102
|
+
reportDiagnostic(program, {
|
|
103
|
+
code: "decorator-missing-dependencies",
|
|
104
|
+
target: theInterface,
|
|
105
|
+
messageId: "default",
|
|
106
|
+
format: {
|
|
107
|
+
decorator: "@passthroughAddressUrlMsa",
|
|
108
|
+
required: "@addressUrlMsa",
|
|
109
|
+
location: `interface "${getIdForType(program, theInterface)}"`,
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
operation: (operation) => {
|
|
115
|
+
if (hasPassthroughAddressUrl(program, operation) && !hasAddressUrl(program, operation)) {
|
|
116
|
+
reportDiagnostic(program, {
|
|
117
|
+
code: "decorator-missing-dependencies",
|
|
118
|
+
target: operation,
|
|
119
|
+
messageId: "default",
|
|
120
|
+
format: {
|
|
121
|
+
decorator: "@passthroughAddressUrl",
|
|
122
|
+
required: "@addressUrl",
|
|
123
|
+
location: `operation "${getIdForType(program, operation)}"`,
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (hasPassthroughAddressUrlMsa(program, operation) &&
|
|
128
|
+
!hasAddressUrlMsa(program, operation)) {
|
|
129
|
+
reportDiagnostic(program, {
|
|
130
|
+
code: "decorator-missing-dependencies",
|
|
131
|
+
target: operation,
|
|
132
|
+
messageId: "default",
|
|
133
|
+
format: {
|
|
134
|
+
decorator: "@passthroughAddressUrlMsa",
|
|
135
|
+
required: "@addressUrlMsa",
|
|
136
|
+
location: `operation "${getIdForType(program, operation)}"`,
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
function validateAddressUrlApplication(program, target, decorator) {
|
|
145
|
+
if (target.kind === "Interface" && hasGraphRoute(program, target)) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (target.kind === "Operation" && isAction(program, target)) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
reportDiagnostic(program, {
|
|
152
|
+
code: "decorator-invalid-use",
|
|
153
|
+
target: target,
|
|
154
|
+
messageId: "wrongType",
|
|
155
|
+
format: {
|
|
156
|
+
decorator: decorator,
|
|
157
|
+
target: "routed interface (entityset, singleton or navigation property) or an action operation",
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=address-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address-url.js","sourceRoot":"","sources":["../../../src/rules/address-url.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,wBAAwB,EACxB,QAAQ,GACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAiC,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AACH,MAAM,UAAU,iEAAiE,CAC/E,OAAgB;IAEhB,KAAK,MAAM,SAAS,IAAI,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC;QACvD,wBAAwB,CAAC,SAAS,EAAE;YAClC,SAAS,EAAE,CAAC,YAAY,EAAE,EAAE;gBAC1B,IAAI,aAAa,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE,CAAC;oBACzC,6BAA6B,CAAC,OAAO,EAAE,YAAY,EAAE,aAAa,CAAC,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AAM,EAAE;4BACN,SAAS,EAAE,2BAA2B;4BACtC,QAAQ,EAAE,gBAAgB;4BAC1B,QAAQ,EAAE,cAAc,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG;yBAC5D;qBACF,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,SAAS,6BAA6B,CACpC,OAAgB,EAChB,MAA6B,EAC7B,SAI+B;IAE/B,IAAI,MAAM,CAAC,IAAI,KAAK,WAAW,IAAI,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;QAClE,OAAO;IACT,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,KAAK,WAAW,IAAI,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;QAC7D,OAAO;IACT,CAAC;IAED,gBAAgB,CAAC,OAAO,EAAE;QACxB,IAAI,EAAE,uBAAuB;QAC7B,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,WAAW;QACtB,MAAM,EAAE;YACN,SAAS,EAAE,SAAS;YACpB,MAAM,EACJ,uFAAuF;SAC1F;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Program } from "@typespec/compiler";
|
|
2
|
+
/***
|
|
3
|
+
* @allowedValues can only be applied to string model properties
|
|
4
|
+
* @allowedValues cannot have empty values
|
|
5
|
+
*/
|
|
6
|
+
export declare function validateAllowedValuesCannotBeEmpty(program: Program): void;
|
|
7
|
+
//# sourceMappingURL=allowed-values.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowed-values.d.ts","sourceRoot":"","sources":["../../../src/rules/allowed-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA4B,MAAM,oBAAoB,CAAC;AAKvE;;;GAGG;AACH,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,OAAO,QAmDlE"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { navigateTypesInNamespace } from "@typespec/compiler";
|
|
2
|
+
import { GetDeclaredNamespaces } from "../entities/namespace.js";
|
|
3
|
+
import { getAllowedValues, hasAllowedValues, isAllowedValuesArgumentsEmpty, isAllowedValuesPrimitive } from "../index.js";
|
|
4
|
+
import { reportDiagnostic } from "../lib.js";
|
|
5
|
+
/***
|
|
6
|
+
* @allowedValues can only be applied to string model properties
|
|
7
|
+
* @allowedValues cannot have empty values
|
|
8
|
+
*/
|
|
9
|
+
export function validateAllowedValuesCannotBeEmpty(program) {
|
|
10
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
11
|
+
navigateTypesInNamespace(namespace, {
|
|
12
|
+
modelProperty: (property) => {
|
|
13
|
+
var _a;
|
|
14
|
+
if (!hasAllowedValues(program, property)) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (isAllowedValuesArgumentsEmpty(program, property)) {
|
|
18
|
+
reportDiagnostic(program, {
|
|
19
|
+
code: "decorator-invalid-use",
|
|
20
|
+
target: property,
|
|
21
|
+
messageId: "allowedValues",
|
|
22
|
+
format: {
|
|
23
|
+
decorator: "@allowedValues"
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
const allowedValues = getAllowedValues(program, property);
|
|
28
|
+
if (((_a = allowedValues === null || allowedValues === void 0 ? void 0 : allowedValues.values) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
29
|
+
const values = allowedValues.values;
|
|
30
|
+
const expectedType = typeof values[0];
|
|
31
|
+
for (let i = 1; i < values.length; i++) {
|
|
32
|
+
if (typeof values[i] !== expectedType) {
|
|
33
|
+
reportDiagnostic(program, {
|
|
34
|
+
code: 'decorator-invalid-use',
|
|
35
|
+
target: property,
|
|
36
|
+
messageId: 'allowedValuesTypeHomogeinity',
|
|
37
|
+
format: {
|
|
38
|
+
decorator: '@allowedValues'
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (!isAllowedValuesPrimitive(program, property)) {
|
|
46
|
+
reportDiagnostic(program, {
|
|
47
|
+
code: "decorator-invalid-use",
|
|
48
|
+
target: property,
|
|
49
|
+
messageId: "allowedValuesInvalidType",
|
|
50
|
+
format: {
|
|
51
|
+
decorator: "@allowedValues"
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=allowed-values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowed-values.js","sourceRoot":"","sources":["../../../src/rules/allowed-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC1H,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C;;;GAGG;AACH,MAAM,UAAU,kCAAkC,CAAC,OAAgB;IACjE,KAAK,MAAM,SAAS,IAAI,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC;QACvD,wBAAwB,CAAC,SAAS,EAAE;YAClC,aAAa,EAAE,CAAC,QAAQ,EAAE,EAAE;;gBAC1B,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC;oBACzC,OAAO;gBACT,CAAC;gBAED,IAAG,6BAA6B,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAC,CAAC;oBACnD,gBAAgB,CAAC,OAAO,EAAE;wBACxB,IAAI,EAAE,uBAAuB;wBAC7B,MAAM,EAAE,QAAQ;wBAChB,SAAS,EAAE,eAAe;wBAC1B,MAAM,EAAE;4BACN,SAAS,EAAE,gBAAgB;yBAC5B;qBACF,CAAC,CAAC;gBACL,CAAC;gBAED,MAAM,aAAa,GAAG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;gBAC1D,IAAG,CAAA,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,0CAAE,MAAM,IAAG,CAAC,EAAC,CAAC;oBACpC,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;oBACpC,MAAM,YAAY,GAAG,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;oBACtC,KAAI,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAC,CAAC;wBACjC,IAAG,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,YAAY,EAAC,CAAC;4BACpC,gBAAgB,CAAC,OAAO,EAAE;gCACxB,IAAI,EAAE,uBAAuB;gCAC7B,MAAM,EAAE,QAAQ;gCAChB,SAAS,EAAE,8BAA8B;gCACzC,MAAM,EAAE;oCACN,SAAS,EAAE,gBAAgB;iCAC5B;6BACF,CAAC,CAAC;4BACH,MAAM;wBACR,CAAC;oBACH,CAAC;gBACH,CAAC;gBAED,IAAI,CAAC,wBAAwB,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC;oBACjD,gBAAgB,CAAC,OAAO,EAAE;wBACxB,IAAI,EAAE,uBAAuB;wBAC7B,MAAM,EAAE,QAAQ;wBAChB,SAAS,EAAE,0BAA0B;wBACrC,MAAM,EAAE;4BACN,SAAS,EAAE,gBAAgB;yBAC5B;qBACF,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export declare
|
|
3
|
-
export declare
|
|
1
|
+
import { Program } from "@typespec/compiler";
|
|
2
|
+
export declare function validateAlternateKeyOnPrimitiveProperty(program: Program): void;
|
|
3
|
+
export declare function validateAlternateKeyOnKey(program: Program): void;
|
|
4
|
+
export declare function validateAlternateKeyRequiresKey(program: Program): void;
|
|
4
5
|
//# sourceMappingURL=alternate-key.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alternate-key.d.ts","sourceRoot":"","sources":["../../../src/rules/alternate-key.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alternate-key.d.ts","sourceRoot":"","sources":["../../../src/rules/alternate-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA4D,MAAM,oBAAoB,CAAC;AAMvG,wBAAgB,uCAAuC,CAAC,OAAO,EAAE,OAAO,QAyBvE;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,QA2BzD;AAED,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,OAAO,QA0B/D"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { isKey, walkPropertiesInherited } from "@typespec/compiler";
|
|
2
|
-
import { createRule } from "@typespec/lint";
|
|
1
|
+
import { isKey, navigateTypesInNamespace, walkPropertiesInherited } from "@typespec/compiler";
|
|
3
2
|
import { isAlternateKey } from "../index.js";
|
|
4
3
|
import { reportDiagnostic } from "../lib.js";
|
|
5
4
|
import { isTypeNullable } from "../utils.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { GetDeclaredNamespaces } from "../entities/namespace.js";
|
|
6
|
+
export function validateAlternateKeyOnPrimitiveProperty(program) {
|
|
7
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
8
|
+
navigateTypesInNamespace(namespace, {
|
|
10
9
|
modelProperty: (property) => {
|
|
11
10
|
if (!property.model || !isAlternateKey(program, property)) {
|
|
12
11
|
return;
|
|
@@ -23,13 +22,13 @@ export const alternateKeyOnPrimitivePropertyRule = createRule({
|
|
|
23
22
|
return;
|
|
24
23
|
}
|
|
25
24
|
},
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
;
|
|
29
|
+
export function validateAlternateKeyOnKey(program) {
|
|
30
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
31
|
+
navigateTypesInNamespace(namespace, {
|
|
33
32
|
modelProperty: (property) => {
|
|
34
33
|
if (!property.model || !isAlternateKey(program, property)) {
|
|
35
34
|
return;
|
|
@@ -49,13 +48,13 @@ export const alternateKeyOnKeyRule = createRule({
|
|
|
49
48
|
});
|
|
50
49
|
return;
|
|
51
50
|
},
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
;
|
|
55
|
+
export function validateAlternateKeyRequiresKey(program) {
|
|
56
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
57
|
+
navigateTypesInNamespace(namespace, {
|
|
59
58
|
modelProperty: (property) => {
|
|
60
59
|
if (!property.model || !isAlternateKey(program, property)) {
|
|
61
60
|
return;
|
|
@@ -75,7 +74,8 @@ export const alternateKeyRequiresKeyRule = createRule({
|
|
|
75
74
|
},
|
|
76
75
|
});
|
|
77
76
|
},
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
;
|
|
81
81
|
//# sourceMappingURL=alternate-key.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alternate-key.js","sourceRoot":"","sources":["../../../src/rules/alternate-key.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"alternate-key.js","sourceRoot":"","sources":["../../../src/rules/alternate-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-navigation-properties-not-nullable.d.ts","sourceRoot":"","sources":["../../../src/rules/collection-navigation-properties-not-nullable.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAA4B,MAAM,oBAAoB,CAAC;AAGvE,wBAAgB,4DAA4D,CAAC,OAAO,EAAE,OAAO,QAyB5F"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { isTypeCollection, isNavigationProperty, isTypeNullable } from "../utils.js";
|
|
2
|
+
import { reportDiagnostic } from "../lib.js";
|
|
3
|
+
import { navigateTypesInNamespace } from "@typespec/compiler";
|
|
4
|
+
import { GetDeclaredNamespaces } from "../entities/namespace.js";
|
|
5
|
+
export function validateCollectionValuedNavigationPropertiesCannotBeNullable(program) {
|
|
6
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
7
|
+
navigateTypesInNamespace(namespace, {
|
|
8
|
+
modelProperty: (property) => {
|
|
9
|
+
if (!isNavigationProperty(program, property)) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (!isTypeCollection(program, property.type)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (!isTypeNullable(program, property.type)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
reportDiagnostic(program, {
|
|
19
|
+
code: "element-missing-dependencies",
|
|
20
|
+
target: property,
|
|
21
|
+
messageId: "collectionNavigationPropertiesNotNullable",
|
|
22
|
+
format: {},
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=collection-navigation-properties-not-nullable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-navigation-properties-not-nullable.js","sourceRoot":"","sources":["../../../src/rules/collection-navigation-properties-not-nullable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAW,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,MAAM,UAAU,4DAA4D,CAAC,OAAgB;IAC3F,KAAK,MAAM,SAAS,IAAI,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC;QACvD,wBAAwB,CAAC,SAAS,EAAE;YAClC,aAAa,EAAE,CAAC,QAAQ,EAAE,EAAE;gBAC1B,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC;oBAC7C,OAAO;gBACT,CAAC;gBAED,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC9C,OAAO;gBACT,CAAC;gBAED,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC5C,OAAO;gBACT,CAAC;gBAED,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,8BAA8B;oBACpC,MAAM,EAAE,QAAQ;oBAChB,SAAS,EAAE,2CAA2C;oBACtD,MAAM,EAAE,EAAE;iBACX,CAAC,CAAC;YACL,CAAC;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complex.d.ts","sourceRoot":"","sources":["../../../src/rules/complex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA4B,MAAM,oBAAoB,CAAC;AAMvE,wBAAgB,sDAAsD,CAAC,OAAO,EAAE,OAAO,QAoBtF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { navigateTypesInNamespace } from "@typespec/compiler";
|
|
2
|
+
import { GetDeclaredNamespaces } from "../entities/namespace.js";
|
|
3
|
+
import { getInterfaceNavigationSourceType } from "../utils.js";
|
|
4
|
+
import { isComplex } from "../index.js";
|
|
5
|
+
import { reportDiagnostic } from "../lib.js";
|
|
6
|
+
export function validateComplexTypesAreNotAddressableThroughUniqueUrls(program) {
|
|
7
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
8
|
+
navigateTypesInNamespace(namespace, {
|
|
9
|
+
interface: (theInterface) => {
|
|
10
|
+
const interfaceBindingType = getInterfaceNavigationSourceType(program, theInterface);
|
|
11
|
+
if (interfaceBindingType) {
|
|
12
|
+
if (isComplex(program, interfaceBindingType)) {
|
|
13
|
+
reportDiagnostic(program, {
|
|
14
|
+
code: "decorator-invalid-use",
|
|
15
|
+
target: theInterface,
|
|
16
|
+
messageId: "complexTypesAreNotAddressableThroughUniqueUrls",
|
|
17
|
+
format: {
|
|
18
|
+
complexType: interfaceBindingType.name,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=complex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complex.js","sourceRoot":"","sources":["../../../src/rules/complex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,UAAU,sDAAsD,CAAC,OAAgB;IACrF,KAAI,MAAM,SAAS,IAAI,qBAAqB,CAAC,OAAO,CAAC,EAAC,CAAC;QACrD,wBAAwB,CAAC,SAAS,EAAE;YAClC,SAAS,EAAE,CAAC,YAAY,EAAE,EAAE;gBAC1B,MAAM,oBAAoB,GAAG,gCAAgC,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;gBACrF,IAAG,oBAAoB,EAAC,CAAC;oBACvB,IAAG,SAAS,CAAC,OAAO,EAAE,oBAAoB,CAAC,EAAC,CAAC;wBAC3C,gBAAgB,CAAC,OAAO,EAAE;4BACxB,IAAI,EAAE,uBAAuB;4BAC7B,MAAM,EAAE,YAAY;4BACpB,SAAS,EAAE,gDAAgD;4BAC3D,MAAM,EAAE;gCACN,WAAW,EAAE,oBAAoB,CAAC,IAAI;6BACvC;yBACF,CAAC,CAAA;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC"}
|