@microsoft/typespec-msgraph 0.0.1-Preview.2 → 0.0.1-Preview.20
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 +28 -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 +44 -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.map +1 -1
- package/dist/src/decorators/abstract.js +0 -6
- package/dist/src/decorators/abstract.js.map +1 -1
- package/dist/src/decorators/action.d.ts +10 -0
- package/dist/src/decorators/action.d.ts.map +1 -0
- package/dist/src/decorators/action.js +16 -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} +3 -1
- package/dist/src/decorators/additional-query-parameters.d.ts.map +1 -0
- package/dist/src/decorators/additional-query-parameters.js +21 -0
- package/dist/src/decorators/additional-query-parameters.js.map +1 -0
- package/dist/src/decorators/address-url-msa.d.ts +12 -0
- package/dist/src/decorators/address-url-msa.d.ts.map +1 -0
- package/dist/src/decorators/address-url-msa.js +19 -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 +153 -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/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/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 +1 -0
- package/dist/src/decorators/expand.d.ts.map +1 -1
- package/dist/src/decorators/expand.js +5 -1
- package/dist/src/decorators/expand.js.map +1 -1
- package/dist/src/decorators/experimental.d.ts +9 -0
- package/dist/src/decorators/experimental.d.ts.map +1 -0
- package/dist/src/decorators/experimental.js +13 -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 +9 -0
- package/dist/src/decorators/flags.d.ts.map +1 -0
- package/dist/src/decorators/flags.js +13 -0
- package/dist/src/decorators/flags.js.map +1 -0
- package/dist/src/decorators/function.d.ts +15 -0
- package/dist/src/decorators/function.d.ts.map +1 -0
- package/dist/src/decorators/function.js +19 -0
- package/dist/src/decorators/function.js.map +1 -0
- package/dist/src/decorators/global-operation.d.ts +9 -0
- package/dist/src/decorators/global-operation.d.ts.map +1 -0
- package/dist/src/decorators/global-operation.js +13 -0
- package/dist/src/decorators/global-operation.js.map +1 -0
- package/dist/src/decorators/graph-deprecated.d.ts +11 -0
- package/dist/src/decorators/graph-deprecated.d.ts.map +1 -0
- package/dist/src/decorators/graph-deprecated.js +19 -0
- package/dist/src/decorators/graph-deprecated.js.map +1 -0
- package/dist/src/decorators/graph-route.d.ts +18 -0
- package/dist/src/decorators/graph-route.d.ts.map +1 -0
- package/dist/src/decorators/graph-route.js +109 -0
- package/dist/src/decorators/graph-route.js.map +1 -0
- package/dist/src/decorators/immutable.d.ts +8 -0
- package/dist/src/decorators/immutable.d.ts.map +1 -0
- package/dist/src/decorators/immutable.js +12 -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 +10 -0
- package/dist/src/decorators/is-owner.d.ts.map +1 -0
- package/dist/src/decorators/is-owner.js +17 -0
- package/dist/src/decorators/is-owner.js.map +1 -0
- package/dist/src/decorators/limited-charset.d.ts +9 -0
- package/dist/src/decorators/limited-charset.d.ts.map +1 -0
- package/dist/src/decorators/limited-charset.js +13 -0
- package/dist/src/decorators/limited-charset.js.map +1 -0
- package/dist/src/decorators/media.d.ts +10 -0
- package/dist/src/decorators/media.d.ts.map +1 -0
- package/dist/src/decorators/media.js +16 -0
- package/dist/src/decorators/media.js.map +1 -0
- package/dist/src/decorators/open.d.ts.map +1 -1
- package/dist/src/decorators/open.js +0 -6
- package/dist/src/decorators/open.js.map +1 -1
- package/dist/src/decorators/{routed-interfaces.d.ts → operation-parameters.d.ts} +3 -11
- package/dist/src/decorators/operation-parameters.d.ts.map +1 -0
- package/dist/src/decorators/operation-parameters.js +15 -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 +8 -0
- package/dist/src/decorators/ownerless.d.ts.map +1 -0
- package/dist/src/decorators/ownerless.js +12 -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 +11 -0
- package/dist/src/decorators/passthrough-address-url-msa.d.ts.map +1 -0
- package/dist/src/decorators/passthrough-address-url-msa.js +17 -0
- package/dist/src/decorators/passthrough-address-url-msa.js.map +1 -0
- package/dist/src/decorators/passthrough-address-url.d.ts +11 -0
- package/dist/src/decorators/passthrough-address-url.d.ts.map +1 -0
- package/dist/src/decorators/passthrough-address-url.js +17 -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 +2 -0
- 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 +9 -0
- package/dist/src/decorators/privileged.d.ts.map +1 -0
- package/dist/src/decorators/privileged.js +13 -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/reference-target.d.ts +16 -0
- package/dist/src/decorators/reference-target.d.ts.map +1 -0
- package/dist/src/decorators/reference-target.js +58 -0
- package/dist/src/decorators/reference-target.js.map +1 -0
- 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 +9 -0
- package/dist/src/decorators/return-source.d.ts.map +1 -0
- package/dist/src/decorators/return-source.js +26 -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 +9 -0
- package/dist/src/decorators/select.d.ts.map +1 -0
- package/dist/src/decorators/select.js +13 -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 +9 -0
- package/dist/src/decorators/workload-name-msa.d.ts.map +1 -0
- package/dist/src/decorators/workload-name-msa.js +13 -0
- package/dist/src/decorators/workload-name-msa.js.map +1 -0
- package/dist/src/decorators/workload-name.d.ts +9 -0
- package/dist/src/decorators/workload-name.d.ts.map +1 -0
- package/dist/src/decorators/workload-name.js +13 -0
- package/dist/src/decorators/workload-name.js.map +1 -0
- package/dist/src/decorators/workload-namespace.d.ts +10 -0
- package/dist/src/decorators/workload-namespace.d.ts.map +1 -0
- package/dist/src/decorators/workload-namespace.js +19 -0
- package/dist/src/decorators/workload-namespace.js.map +1 -0
- 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 +33 -0
- package/dist/src/entities/entity-container.d.ts.map +1 -0
- package/dist/src/entities/entity-container.js +56 -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 +62 -0
- package/dist/src/entities/model.d.ts.map +1 -0
- package/dist/src/entities/model.js +266 -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 +70 -0
- package/dist/src/entities/ms-graph-route.js.map +1 -0
- package/dist/src/entities/namespace.d.ts +29 -0
- package/dist/src/entities/namespace.d.ts.map +1 -0
- package/dist/src/entities/namespace.js +218 -0
- package/dist/src/entities/namespace.js.map +1 -0
- package/dist/src/entities/operation.d.ts +36 -0
- package/dist/src/entities/operation.d.ts.map +1 -0
- package/dist/src/entities/operation.js +146 -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 +42 -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 +128 -106
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +70 -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 +16 -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 +204 -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 +29 -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 +3 -0
- package/dist/src/rules/function.d.ts.map +1 -0
- package/dist/src/rules/function.js +26 -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 +14 -0
- package/dist/src/rules/graph-route.d.ts.map +1 -0
- package/dist/src/rules/graph-route.js +225 -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 +4 -0
- package/dist/src/rules/operation-inside-interface.d.ts.map +1 -0
- package/dist/src/rules/operation-inside-interface.js +62 -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 +5 -0
- package/dist/src/rules/record-t.d.ts.map +1 -0
- package/dist/src/rules/record-t.js +78 -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 +59 -2
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +535 -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 +81 -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 +25 -0
- package/package.json +42 -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
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Program } from "@typespec/compiler";
|
|
2
|
+
/**
|
|
3
|
+
* @graphRoute should not have a leading forward slash
|
|
4
|
+
*/
|
|
5
|
+
export declare function validateGraphRouteLeadingSlash(program: Program): void;
|
|
6
|
+
export declare function validateOperationParametersMatchGraphRouteParameters(program: Program): void;
|
|
7
|
+
export declare function validateGraphRouteAndInterfaceExtendsMatchForCollections(program: Program): void;
|
|
8
|
+
/**
|
|
9
|
+
* A interface decorated with @graphRoute must ultimately extend one of the standard graph interface i.e Resource<T> or Collection<T>.
|
|
10
|
+
*/
|
|
11
|
+
export declare function validateGraphRouteInterfaceExtendsGraphStandardInterface(program: Program): void;
|
|
12
|
+
export declare function validateDuplicateGraphRoutesNotAllowed(program: Program): void;
|
|
13
|
+
export declare function validateGraphRouteParametersMustBeUnique(program: Program): void;
|
|
14
|
+
//# sourceMappingURL=graph-route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-route.d.ts","sourceRoot":"","sources":["../../../src/rules/graph-route.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwB,OAAO,EAAkC,MAAM,oBAAoB,CAAC;AAInG;;GAEG;AAEH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,OAAO,QAW9D;AAyBD,wBAAgB,oDAAoD,CAAC,OAAO,EAAE,OAAO,QAWpF;AAqDD,wBAAgB,wDAAwD,CAAC,OAAO,EAAE,OAAO,QA2BxF;AAeD;;GAEG;AACH,wBAAgB,wDAAwD,CAAC,OAAO,EAAE,OAAO,QA0BxF;AAED,wBAAgB,sCAAsC,CAAC,OAAO,EAAE,OAAO,QAwBtE;AAgBD,wBAAgB,wCAAwC,CAAC,OAAO,EAAE,OAAO,QA6BxE"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { reportDiagnostic } from "../lib.js";
|
|
2
|
+
import { extractParamsFromPath, getGraphRoutePaths, getGraphRoutes, hasGraphRoute } from "../index.js";
|
|
3
|
+
import { navigateTypesInNamespace } from "@typespec/compiler";
|
|
4
|
+
import { getIdForType, getSourceInterfaces } from "../utils.js";
|
|
5
|
+
import { GetDeclaredNamespaces } from "../entities/namespace.js";
|
|
6
|
+
/**
|
|
7
|
+
* @graphRoute should not have a leading forward slash
|
|
8
|
+
*/
|
|
9
|
+
export function validateGraphRouteLeadingSlash(program) {
|
|
10
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
11
|
+
navigateTypesInNamespace(namespace, {
|
|
12
|
+
interface: (interface_) => {
|
|
13
|
+
applyDiagnostics(program, interface_);
|
|
14
|
+
},
|
|
15
|
+
operation: (operation) => {
|
|
16
|
+
applyDiagnostics(program, operation);
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
;
|
|
22
|
+
const applyDiagnostics = (program, target) => {
|
|
23
|
+
if (!hasGraphRoute(program, target)) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const paths = getGraphRoutePaths(program, target);
|
|
27
|
+
if (paths === undefined) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
for (const path of paths) {
|
|
31
|
+
if (path.startsWith("/")) {
|
|
32
|
+
reportDiagnostic(program, {
|
|
33
|
+
code: "decorator-invalid-use",
|
|
34
|
+
target: target,
|
|
35
|
+
messageId: "graphRoute",
|
|
36
|
+
format: {
|
|
37
|
+
decorator: "@graphRoute",
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
export function validateOperationParametersMatchGraphRouteParameters(program) {
|
|
44
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
45
|
+
navigateTypesInNamespace(namespace, {
|
|
46
|
+
operation: (operation) => {
|
|
47
|
+
validateParametersForGraphRoute(program, operation);
|
|
48
|
+
},
|
|
49
|
+
interface: (theInterface) => {
|
|
50
|
+
validateParametersForGraphRoute(program, theInterface);
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
;
|
|
56
|
+
function validateParametersForGraphRoute(program, target) {
|
|
57
|
+
if (!hasGraphRoute(program, target)) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const routePaths = getGraphRoutePaths(program, target);
|
|
61
|
+
if (routePaths === undefined) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const operations = [];
|
|
65
|
+
if (target.kind === "Operation") {
|
|
66
|
+
operations.push(target);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
target.operations.forEach((operation) => operations.push(operation));
|
|
70
|
+
}
|
|
71
|
+
for (const operation of operations) {
|
|
72
|
+
if (isOperationUsingPorcelainSyntax(program, operation)) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (operation.parameters.properties.has("graphRouteParams")) {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
for (const path of routePaths) {
|
|
79
|
+
const graphRouteParameters = extractParamsFromPath(path);
|
|
80
|
+
const missingParameters = graphRouteParameters.filter((param) => !operation.parameters.properties.has(param));
|
|
81
|
+
if (missingParameters.length) {
|
|
82
|
+
reportDiagnostic(program, {
|
|
83
|
+
code: "element-missing-dependencies",
|
|
84
|
+
target: operation,
|
|
85
|
+
messageId: "operationParameterMismatch",
|
|
86
|
+
format: {
|
|
87
|
+
operation: getIdForType(program, operation),
|
|
88
|
+
parameters: missingParameters.join(", "),
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function isOperationUsingPorcelainSyntax(program, operation) {
|
|
96
|
+
return operation.sourceOperation ? isOperationUsingPorcelainSyntax(program, operation.sourceOperation) : getIdForType(program, operation) === "MsGraph.Foundations.Operation";
|
|
97
|
+
}
|
|
98
|
+
export function validateGraphRouteAndInterfaceExtendsMatchForCollections(program) {
|
|
99
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
100
|
+
navigateTypesInNamespace(namespace, {
|
|
101
|
+
interface: ($interface) => {
|
|
102
|
+
getSourceInterfaces($interface).forEach(sourceInterface => {
|
|
103
|
+
if (sourceInterface.name === "Collection") {
|
|
104
|
+
const graphRoutePaths = getGraphRoutePaths(program, $interface);
|
|
105
|
+
if (graphRoutePaths === undefined) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
for (const graphRoute of graphRoutePaths) {
|
|
109
|
+
if (isLastSegmentAnIdentifier(graphRoute)) {
|
|
110
|
+
reportDiagnostic(program, {
|
|
111
|
+
code: "decorator-invalid-use",
|
|
112
|
+
target: $interface,
|
|
113
|
+
messageId: "graphRouteWithRoutingParameterAsFinalSegment",
|
|
114
|
+
format: {
|
|
115
|
+
graphRoute: graphRoute,
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function isLastSegmentAnIdentifier(graphRoutePath) {
|
|
127
|
+
const parts = graphRoutePath.split("/");
|
|
128
|
+
if (parts.length) {
|
|
129
|
+
const lastSegment = parts[parts.length - 1];
|
|
130
|
+
const routingParameterPattern = /\{[\w-]+}/i;
|
|
131
|
+
if (routingParameterPattern.test(lastSegment)) {
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* A interface decorated with @graphRoute must ultimately extend one of the standard graph interface i.e Resource<T> or Collection<T>.
|
|
139
|
+
*/
|
|
140
|
+
export function validateGraphRouteInterfaceExtendsGraphStandardInterface(program) {
|
|
141
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
142
|
+
navigateTypesInNamespace(namespace, {
|
|
143
|
+
interface: (theInterface) => {
|
|
144
|
+
if (!hasGraphRoute(program, theInterface)) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const standardGraphBaseInterfaces = ["Resource", "Collection"];
|
|
148
|
+
if (getSourceInterfaces(theInterface).some((sourceInterface) => standardGraphBaseInterfaces.includes(sourceInterface.name))) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
reportDiagnostic(program, {
|
|
152
|
+
code: "decorator-invalid-use",
|
|
153
|
+
target: theInterface,
|
|
154
|
+
messageId: "interfaceWithGraphRouteMustExtendGraphStandardBaseInterface",
|
|
155
|
+
format: {},
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
export function validateDuplicateGraphRoutesNotAllowed(program) {
|
|
162
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
163
|
+
navigateTypesInNamespace(namespace, {
|
|
164
|
+
interface: ($interface) => {
|
|
165
|
+
if (!hasGraphRoute(program, $interface)) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const existingRoutes = getGraphRoutes(program);
|
|
169
|
+
const graphRoutePaths = getGraphRoutePaths(program, $interface);
|
|
170
|
+
const uniqueGraphRoutePaths = new Set(graphRoutePaths);
|
|
171
|
+
if (graphRoutePaths.length !== uniqueGraphRoutePaths.size) {
|
|
172
|
+
const duplicates = graphRoutePaths.filter((path, index) => graphRoutePaths.indexOf(path) !== index);
|
|
173
|
+
reportDuplicateRouteDiagnostics(program, $interface, duplicates[0], existingRoutes);
|
|
174
|
+
}
|
|
175
|
+
for (const graphRoutePath of graphRoutePaths) {
|
|
176
|
+
if (existingRoutes.has(graphRoutePath) && existingRoutes.get(graphRoutePath) !== $interface) {
|
|
177
|
+
reportDuplicateRouteDiagnostics(program, $interface, graphRoutePath, existingRoutes);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function reportDuplicateRouteDiagnostics(program, $interface, graphRoutePath, existingRoutes) {
|
|
185
|
+
reportDiagnostic(program, {
|
|
186
|
+
code: "decorator-invalid-use",
|
|
187
|
+
target: $interface,
|
|
188
|
+
messageId: "duplicateGraphRouteNotAllowed",
|
|
189
|
+
format: {
|
|
190
|
+
target: getIdForType(program, $interface),
|
|
191
|
+
graphRoute: graphRoutePath,
|
|
192
|
+
existing: getIdForType(program, existingRoutes.get(graphRoutePath))
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
export function validateGraphRouteParametersMustBeUnique(program) {
|
|
197
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
198
|
+
navigateTypesInNamespace(namespace, {
|
|
199
|
+
interface: ($interface) => {
|
|
200
|
+
if (!hasGraphRoute(program, $interface)) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const graphRoutePaths = getGraphRoutePaths(program, $interface);
|
|
204
|
+
for (const graphRoutePath of graphRoutePaths) {
|
|
205
|
+
const params = extractParamsFromPath(graphRoutePath);
|
|
206
|
+
const uniqueParams = new Set(params);
|
|
207
|
+
const duplicateParameters = params.filter(param => params.indexOf(param) !== params.lastIndexOf(param));
|
|
208
|
+
if (params.length !== uniqueParams.size) {
|
|
209
|
+
reportDiagnostic(program, {
|
|
210
|
+
code: "decorator-invalid-use",
|
|
211
|
+
target: $interface,
|
|
212
|
+
messageId: "duplicateParametersAreNotAllowedInGraphRoute",
|
|
213
|
+
format: {
|
|
214
|
+
graphRoute: graphRoutePath,
|
|
215
|
+
target: $interface.name,
|
|
216
|
+
parameters: duplicateParameters.join(", ")
|
|
217
|
+
},
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
//# sourceMappingURL=graph-route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-route.js","sourceRoot":"","sources":["../../../src/rules/graph-route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACvG,OAAO,EAAuC,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE;;GAEG;AAEH,MAAM,UAAU,8BAA8B,CAAC,OAAgB;IAC7D,KAAK,MAAM,SAAS,IAAI,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC;QACvD,wBAAwB,CAAC,SAAS,EAAE;YAClC,SAAS,EAAE,CAAC,UAAU,EAAE,EAAE;gBACxB,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YACxC,CAAC;YACD,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;gBACvB,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YACvC,CAAC;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAAA,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,OAAgB,EAAE,MAAY,E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;IACvE,KAAK,MAAM,SAAS,IAAI,qBAAqB,CAAC,OAAO,CAAC,EAAC,CAAC;QACtD,wBAAwB,CAAC,SAAS,EAAE;YAClC,SAAS,EAAE,CAAC,UAAU,EAAE,EAAE;gBACxB,IAAG,CAAC,aAAa,CAAC,OAAO,EAAE,UAAU,CAAC,EAAC,CAAC;oBACtC,OAAO;gBACT,CAAC;gBAED,MAAM,eAAe,GAAG,kBAAkB,CAAC,OAAO,EAAE,UAAU,CAAE,CAAC;gBACjE,KAAI,MAAM,cAAc,IAAI,eAAe,EAAC,CAAC;oBAC3C,MAAM,MAAM,GAAG,qBAAqB,CAAC,cAAc,CAAC,CAAC;oBACrD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;oBACrC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;oBACxG,IAAG,MAAM,CAAC,MAAM,KAAK,YAAY,CAAC,IAAI,EAAC,CAAC;wBACtC,gBAAgB,CAAC,OAAO,EAAE;4BACxB,IAAI,EAAE,uBAAuB;4BAC7B,MAAM,EAAE,UAAU;4BAClB,SAAS,EAAE,8CAA8C;4BACzD,MAAM,EAAE;gCACN,UAAU,EAAE,cAAc;gCAC1B,MAAM,EAAE,UAAU,CAAC,IAAI;gCACvB,UAAU,EAAE,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC;6BAC3C;yBACF,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,21 +1,39 @@
|
|
|
1
1
|
export * from "./abstract.js";
|
|
2
|
+
export * from "./address-url.js";
|
|
2
3
|
export * from "./alternate-key.js";
|
|
4
|
+
export * from "./collection-navigation-properties-not-nullable.js";
|
|
5
|
+
export * from "./complex.js";
|
|
3
6
|
export * from "./computed.js";
|
|
4
7
|
export * from "./contains.js";
|
|
5
8
|
export * from "./count.js";
|
|
9
|
+
export * from "./delta.js";
|
|
10
|
+
export * from "./disallowed-typespec-decorators.js";
|
|
6
11
|
export * from "./entity.js";
|
|
12
|
+
export * from "./enum.js";
|
|
7
13
|
export * from "./expand.js";
|
|
8
|
-
export * from "./
|
|
14
|
+
export * from "./extends-on-same-type.js";
|
|
15
|
+
export * from "./filter.js";
|
|
16
|
+
export * from "./function.js";
|
|
17
|
+
export * from "./graph-route.js";
|
|
18
|
+
export * from "./limited-charset.js";
|
|
19
|
+
export * from "./media.js";
|
|
20
|
+
export * from "./namespace.js";
|
|
9
21
|
export * from "./open.js";
|
|
22
|
+
export * from "./operation-inside-interface.js";
|
|
10
23
|
export * from "./order-by.js";
|
|
11
24
|
export * from "./references.js";
|
|
25
|
+
export * from "./required-for-create.js";
|
|
26
|
+
export * from "./return-source.js";
|
|
12
27
|
export * from "./search.js";
|
|
13
28
|
export * from "./skip.js";
|
|
14
29
|
export * from "./top.js";
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
30
|
+
export * from "./allowed-values.js";
|
|
31
|
+
export * from "./graph-route.js";
|
|
32
|
+
export * from "./partial.js";
|
|
33
|
+
export * from "./graph-deprecated.js";
|
|
34
|
+
export * from "./ownerless.js";
|
|
35
|
+
export * from "./global-operation.js";
|
|
36
|
+
export * from "./reference-target.js";
|
|
37
|
+
export * from "./record-t.js";
|
|
38
|
+
export * from "./model.js";
|
|
21
39
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oDAAoD,CAAC;AACnE,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,qCAAqC,CAAC;AACpD,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,iCAAiC,CAAC;AAChD,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
|
package/dist/src/rules/index.js
CHANGED
|
@@ -1,176 +1,39 @@
|
|
|
1
|
-
import { isKey, isVoidType } from "@typespec/compiler";
|
|
2
|
-
import { createRule } from "@typespec/lint";
|
|
3
|
-
import { isComplex, isEntity, isFunction } from "../decorators/index.js";
|
|
4
|
-
import { reportDiagnostic } from "../lib.js";
|
|
5
|
-
import { isExcludedCoreType, isTypeNullable } from "../utils.js";
|
|
6
1
|
export * from "./abstract.js";
|
|
2
|
+
export * from "./address-url.js";
|
|
7
3
|
export * from "./alternate-key.js";
|
|
4
|
+
export * from "./collection-navigation-properties-not-nullable.js";
|
|
5
|
+
export * from "./complex.js";
|
|
8
6
|
export * from "./computed.js";
|
|
9
7
|
export * from "./contains.js";
|
|
10
8
|
export * from "./count.js";
|
|
9
|
+
export * from "./delta.js";
|
|
10
|
+
export * from "./disallowed-typespec-decorators.js";
|
|
11
11
|
export * from "./entity.js";
|
|
12
|
+
export * from "./enum.js";
|
|
12
13
|
export * from "./expand.js";
|
|
13
|
-
export * from "./
|
|
14
|
+
export * from "./extends-on-same-type.js";
|
|
15
|
+
export * from "./filter.js";
|
|
16
|
+
export * from "./function.js";
|
|
17
|
+
export * from "./graph-route.js";
|
|
18
|
+
export * from "./limited-charset.js";
|
|
19
|
+
export * from "./media.js";
|
|
20
|
+
export * from "./namespace.js";
|
|
14
21
|
export * from "./open.js";
|
|
22
|
+
export * from "./operation-inside-interface.js";
|
|
15
23
|
export * from "./order-by.js";
|
|
16
24
|
export * from "./references.js";
|
|
25
|
+
export * from "./required-for-create.js";
|
|
26
|
+
export * from "./return-source.js";
|
|
17
27
|
export * from "./search.js";
|
|
18
28
|
export * from "./skip.js";
|
|
19
29
|
export * from "./top.js";
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
reportDiagnostic(program, {
|
|
30
|
-
code: "extends-invalid-use",
|
|
31
|
-
target: model,
|
|
32
|
-
format: {
|
|
33
|
-
type: "@entity",
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
if (isComplex(program, model) && !isComplex(program, model.baseModel)) {
|
|
38
|
-
reportDiagnostic(program, {
|
|
39
|
-
code: "extends-invalid-use",
|
|
40
|
-
target: model,
|
|
41
|
-
format: {
|
|
42
|
-
type: "@complex",
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
export const keyOnlyOnEntityNonNullablePrimitivePropertyRule = createRule({
|
|
51
|
-
name: "key-only-on-entity-non-nullable-primitive-property",
|
|
52
|
-
create({ program }) {
|
|
53
|
-
return {
|
|
54
|
-
modelProperty: (property) => {
|
|
55
|
-
if (!property.model || !isKey(program, property)) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (!isEntity(program, property.model)) {
|
|
59
|
-
reportDiagnostic(program, {
|
|
60
|
-
code: "decorator-missing-dependencies",
|
|
61
|
-
target: property,
|
|
62
|
-
format: {
|
|
63
|
-
decorator: "@key",
|
|
64
|
-
required: "@entity",
|
|
65
|
-
location: "entity model",
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (isTypeNullable(program, property.type) ||
|
|
71
|
-
property.type.kind !== "Scalar" ||
|
|
72
|
-
property.name === "Array") {
|
|
73
|
-
reportDiagnostic(program, {
|
|
74
|
-
code: "decorator-invalid-use",
|
|
75
|
-
target: property,
|
|
76
|
-
messageId: "key",
|
|
77
|
-
format: {},
|
|
78
|
-
});
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
export const operationInsideInterfaceRule = createRule({
|
|
86
|
-
name: "operation-inside-interface",
|
|
87
|
-
create({ program }) {
|
|
88
|
-
return {
|
|
89
|
-
operation: (operation) => {
|
|
90
|
-
if (operation.interface) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
reportDiagnostic(program, {
|
|
94
|
-
code: "element-missing-dependencies",
|
|
95
|
-
target: operation,
|
|
96
|
-
messageId: "operation",
|
|
97
|
-
format: {},
|
|
98
|
-
});
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
},
|
|
102
|
-
});
|
|
103
|
-
export const voidFunctionRule = createRule({
|
|
104
|
-
name: "void-function",
|
|
105
|
-
create({ program }) {
|
|
106
|
-
return {
|
|
107
|
-
operation: (operation) => {
|
|
108
|
-
if (!isFunction(program, operation)) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
if (!isVoidType(operation.returnType)) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
reportDiagnostic(program, {
|
|
115
|
-
code: "decorator-missing-dependencies",
|
|
116
|
-
target: operation,
|
|
117
|
-
messageId: "function",
|
|
118
|
-
format: {},
|
|
119
|
-
});
|
|
120
|
-
},
|
|
121
|
-
};
|
|
122
|
-
},
|
|
123
|
-
});
|
|
124
|
-
export const disallowedTypeSpecDecoratorsRule = createRule({
|
|
125
|
-
name: "disallowed-typespec-decorators",
|
|
126
|
-
create({ program }) {
|
|
127
|
-
return {
|
|
128
|
-
decorator: (decorator) => {
|
|
129
|
-
const denyList = [
|
|
130
|
-
"@friendlyName",
|
|
131
|
-
"@secret",
|
|
132
|
-
"@summary",
|
|
133
|
-
"@tag",
|
|
134
|
-
"@visibility",
|
|
135
|
-
"@withVisibility",
|
|
136
|
-
"@withUpdateableProperties",
|
|
137
|
-
"@withDefaultKeyVisibility",
|
|
138
|
-
];
|
|
139
|
-
if (denyList.indexOf(decorator.name) < 0) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
reportDiagnostic(program, {
|
|
143
|
-
code: "decorator-invalid-use",
|
|
144
|
-
target: decorator.target,
|
|
145
|
-
messageId: "disallowedTypeSpecDecorators",
|
|
146
|
-
format: {
|
|
147
|
-
decorator: decorator.name,
|
|
148
|
-
},
|
|
149
|
-
});
|
|
150
|
-
},
|
|
151
|
-
};
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
export const useEvolvableEnumRule = createRule({
|
|
155
|
-
name: "use-evolvable-enum",
|
|
156
|
-
create({ program }) {
|
|
157
|
-
return {
|
|
158
|
-
enum: (enumType) => {
|
|
159
|
-
if (isExcludedCoreType(program, enumType)) {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
if (enumType.members.has("unknownFutureValue")) {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
reportDiagnostic(program, {
|
|
166
|
-
code: "use-evolvable-enum",
|
|
167
|
-
target: enumType,
|
|
168
|
-
format: {
|
|
169
|
-
enum: enumType.name,
|
|
170
|
-
},
|
|
171
|
-
});
|
|
172
|
-
},
|
|
173
|
-
};
|
|
174
|
-
},
|
|
175
|
-
});
|
|
30
|
+
export * from "./allowed-values.js";
|
|
31
|
+
export * from "./graph-route.js";
|
|
32
|
+
export * from "./partial.js";
|
|
33
|
+
export * from "./graph-deprecated.js";
|
|
34
|
+
export * from "./ownerless.js";
|
|
35
|
+
export * from "./global-operation.js";
|
|
36
|
+
export * from "./reference-target.js";
|
|
37
|
+
export * from "./record-t.js";
|
|
38
|
+
export * from "./model.js";
|
|
176
39
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oDAAoD,CAAC;AACnE,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,qCAAqC,CAAC;AACpD,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,iCAAiC,CAAC;AAChD,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limited-charset.d.ts","sourceRoot":"","sources":["../../../src/rules/limited-charset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA0C,MAAM,oBAAoB,CAAC;AAMrF,eAAO,MAAM,gEAAgE,YAClE,OAAO,SA0CjB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { isStringType, navigateTypesInNamespace } from "@typespec/compiler";
|
|
2
|
+
import { GetDeclaredNamespaces } from "../entities/namespace.js";
|
|
3
|
+
import { supportsLimitedCharset } from "../index.js";
|
|
4
|
+
import { reportDiagnostic } from "../lib.js";
|
|
5
|
+
import { extractTypesFromUnion } from "../utils.js";
|
|
6
|
+
export const validatedLimitedCharsetOnlyAppliesToStringPropertiesOrParameters = (program) => {
|
|
7
|
+
for (const namespace of GetDeclaredNamespaces(program)) {
|
|
8
|
+
navigateTypesInNamespace(namespace, {
|
|
9
|
+
modelProperty: (property) => {
|
|
10
|
+
if (!supportsLimitedCharset(program, property)) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (isStringType(program, property.type)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
// Nullable Properties and Parameters
|
|
17
|
+
if (property.type.kind === "Union") {
|
|
18
|
+
const types = extractTypesFromUnion(property.type);
|
|
19
|
+
if (types.some((type) => isStringType(program, type))) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
// Arrays of strings
|
|
24
|
+
if (property.type.kind === "Model" &&
|
|
25
|
+
property.type.name === "Array" &&
|
|
26
|
+
isStringType(program, property.type.indexer.value)) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
reportDiagnostic(program, {
|
|
30
|
+
code: "decorator-invalid-use",
|
|
31
|
+
target: property,
|
|
32
|
+
messageId: "wrongType",
|
|
33
|
+
format: {
|
|
34
|
+
decorator: "@limitedCharset",
|
|
35
|
+
target: "string model property, parameter or their collections",
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=limited-charset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limited-charset.js","sourceRoot":"","sources":["../../../src/rules/limited-charset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEpD,MAAM,CAAC,MAAM,gEAAgE,GAAG,CAC9E,OAAgB,EAChB,EAAE;IACF,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,sBAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC;oBAC/C,OAAO;gBACT,CAAC;gBAED,IAAI,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;oBACzC,OAAO;gBACT,CAAC;gBAED,qCAAqC;gBACrC,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;oBACnC,MAAM,KAAK,GAAG,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;oBACnD,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC;wBACtD,OAAO;oBACT,CAAC;gBACH,CAAC;gBAED,oBAAoB;gBACpB,IACE,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO;oBAC9B,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO;oBAC9B,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAQ,CAAC,KAAK,CAAC,EACnD,CAAC;oBACD,OAAO;gBACT,CAAC;gBAED,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,uBAAuB;oBAC7B,MAAM,EAAE,QAAQ;oBAChB,SAAS,EAAE,WAAW;oBACtB,MAAM,EAAE;wBACN,SAAS,EAAE,iBAAiB;wBAC5B,MAAM,EAAE,uDAAuD;qBAChE;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Program } from "@typespec/compiler";
|
|
2
|
+
export declare function validateIsMediaOnlyOnEntity(program: Program): void;
|
|
3
|
+
export declare const mediaTypeValuesShouldBeMinimallyFormattedForMIMETypes: import("@typespec/compiler").LinterRuleDefinition<"media-type-values-should-be-minimally-formatted", {
|
|
4
|
+
readonly default: import("@typespec/compiler").CallableMessage<[string]>;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const interfaceNavigationSourceShouldHaveMediaIf$ValueIsSpecified: import("@typespec/compiler").LinterRuleDefinition<"navigation-source-should-have-media-if-value-is-specified", {
|
|
7
|
+
readonly interfaceNavigationSourceShouldHaveMediaIf$ValueIsSpecifiedInRoute: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
8
|
+
readonly interfaceNavigationSourceShouldHaveMediaIf$ValueIsSpecifiedInParameters: import("@typespec/compiler").CallableMessage<[string]>;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=media.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src/rules/media.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAsD,MAAM,oBAAoB,CAAC;AAIjG,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,QAsB3D;AAED,eAAO,MAAM,qDAAqD;;EA6BhE,CAAA;AAEF,eAAO,MAAM,2DAA2D;;;EA4DtE,CAAA"}
|