@microsoft/typespec-msgraph 0.0.1-Preview.1 → 0.0.1-Preview.10
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 +8 -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 +63 -0
- package/dist/src/components/annotations.js.map +1 -0
- package/dist/src/components/common-elements.d.ts +15 -73
- 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/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 +22 -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 +17 -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/operation-element.d.ts +6 -0
- package/dist/src/components/operation-element.d.ts.map +1 -0
- package/dist/src/components/operation-element.js +70 -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 +16 -32
- package/dist/src/components/property-element.js.map +1 -1
- 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 +7 -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 +42 -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/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 +24 -66
- package/dist/src/components/structured-type-element.js.map +1 -1
- 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 +5 -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/ags-attribute.d.ts +14 -0
- package/dist/src/decorators/ags-attribute.d.ts.map +1 -0
- package/dist/src/decorators/ags-attribute.js +115 -0
- package/dist/src/decorators/ags-attribute.js.map +1 -0
- package/dist/src/decorators/allowed-values.d.ts +13 -0
- package/dist/src/decorators/allowed-values.d.ts.map +1 -0
- package/dist/src/decorators/allowed-values.js +35 -0
- package/dist/src/decorators/allowed-values.js.map +1 -0
- package/dist/src/decorators/complex.d.ts.map +1 -1
- package/dist/src/decorators/complex.js +0 -6
- package/dist/src/decorators/complex.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/entity.d.ts.map +1 -1
- package/dist/src/decorators/entity.js +0 -6
- package/dist/src/decorators/entity.js.map +1 -1
- package/dist/src/decorators/filter.d.ts +11 -0
- package/dist/src/decorators/filter.d.ts.map +1 -0
- package/dist/src/decorators/filter.js +27 -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 +10 -0
- package/dist/src/decorators/function.d.ts.map +1 -0
- package/dist/src/decorators/function.js +16 -0
- package/dist/src/decorators/function.js.map +1 -0
- package/dist/src/decorators/graph-route.d.ts +16 -0
- package/dist/src/decorators/graph-route.d.ts.map +1 -0
- package/dist/src/decorators/graph-route.js +98 -0
- package/dist/src/decorators/graph-route.js.map +1 -0
- package/dist/src/decorators/has-stream.d.ts +1 -2
- package/dist/src/decorators/has-stream.d.ts.map +1 -1
- package/dist/src/decorators/has-stream.js +1 -14
- package/dist/src/decorators/has-stream.js.map +1 -1
- 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 +20 -1
- package/dist/src/decorators/index.d.ts.map +1 -1
- package/dist/src/decorators/index.js +20 -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/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/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 +10 -0
- package/dist/src/decorators/partial.d.ts.map +1 -0
- package/dist/src/decorators/partial.js +16 -0
- package/dist/src/decorators/partial.js.map +1 -0
- package/dist/src/decorators/private-preview.d.ts.map +1 -1
- package/dist/src/decorators/private-preview.js +0 -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 +10 -0
- package/dist/src/decorators/public-namespace.d.ts.map +1 -0
- package/dist/src/decorators/public-namespace.js +16 -0
- package/dist/src/decorators/public-namespace.js.map +1 -0
- package/dist/src/decorators/required-for-create.d.ts +10 -0
- package/dist/src/decorators/required-for-create.d.ts.map +1 -0
- package/dist/src/decorators/required-for-create.js +14 -0
- package/dist/src/decorators/required-for-create.js.map +1 -0
- 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/emitter.d.ts +2 -1
- package/dist/src/emitter.d.ts.map +1 -1
- package/dist/src/emitter.js +7 -3
- package/dist/src/emitter.js.map +1 -1
- package/dist/src/entities/annotations.d.ts +40 -0
- package/dist/src/entities/annotations.d.ts.map +1 -0
- package/dist/src/entities/annotations.js +139 -0
- package/dist/src/entities/annotations.js.map +1 -0
- package/dist/src/entities/entity-container.d.ts +15 -0
- package/dist/src/entities/entity-container.d.ts.map +1 -0
- package/dist/src/entities/entity-container.js +42 -0
- package/dist/src/entities/entity-container.js.map +1 -0
- package/dist/src/entities/enum.d.ts +17 -0
- package/dist/src/entities/enum.d.ts.map +1 -0
- package/dist/src/entities/enum.js +24 -0
- package/dist/src/entities/enum.js.map +1 -0
- package/dist/src/entities/model.d.ts +47 -0
- package/dist/src/entities/model.d.ts.map +1 -0
- package/dist/src/entities/model.js +104 -0
- package/dist/src/entities/model.js.map +1 -0
- package/dist/src/entities/namespace.d.ts +21 -0
- package/dist/src/entities/namespace.d.ts.map +1 -0
- package/dist/src/entities/namespace.js +81 -0
- package/dist/src/entities/namespace.js.map +1 -0
- package/dist/src/entities/operation.d.ts +28 -0
- package/dist/src/entities/operation.d.ts.map +1 -0
- package/dist/src/entities/operation.js +103 -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 +9 -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/index.d.ts +0 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +0 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +53 -2
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +25 -1
- package/dist/src/lib.js.map +1 -1
- package/dist/src/linter.d.ts.map +1 -1
- package/dist/src/linter.js +34 -25
- package/dist/src/linter.js.map +1 -1
- package/dist/src/rules/allowed-values.d.ts +6 -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/collection-navigation-properties-not-nullable.d.ts +2 -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/count.d.ts.map +1 -1
- package/dist/src/rules/count.js +3 -1
- package/dist/src/rules/count.js.map +1 -1
- package/dist/src/rules/disallowed-typespec-decorators.d.ts +2 -0
- package/dist/src/rules/disallowed-typespec-decorators.d.ts.map +1 -0
- package/dist/src/rules/disallowed-typespec-decorators.js +33 -0
- package/dist/src/rules/disallowed-typespec-decorators.js.map +1 -0
- package/dist/src/rules/entity.d.ts +1 -0
- package/dist/src/rules/entity.d.ts.map +1 -1
- package/dist/src/rules/entity.js +43 -1
- package/dist/src/rules/entity.js.map +1 -1
- package/dist/src/rules/enum.d.ts +2 -0
- package/dist/src/rules/enum.d.ts.map +1 -0
- package/dist/src/rules/enum.js +26 -0
- package/dist/src/rules/enum.js.map +1 -0
- package/dist/src/rules/expand.d.ts.map +1 -1
- package/dist/src/rules/expand.js +5 -7
- package/dist/src/rules/expand.js.map +1 -1
- package/dist/src/rules/extends-on-same-type.d.ts +2 -0
- package/dist/src/rules/extends-on-same-type.d.ts.map +1 -0
- package/dist/src/rules/extends-on-same-type.js +38 -0
- package/dist/src/rules/extends-on-same-type.js.map +1 -0
- package/dist/src/rules/filter.d.ts +4 -0
- package/dist/src/rules/filter.d.ts.map +1 -0
- package/dist/src/rules/filter.js +92 -0
- package/dist/src/rules/filter.js.map +1 -0
- package/dist/src/rules/function.d.ts +2 -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/graph-route.d.ts +6 -0
- package/dist/src/rules/graph-route.d.ts.map +1 -0
- package/dist/src/rules/graph-route.js +88 -0
- package/dist/src/rules/graph-route.js.map +1 -0
- package/dist/src/rules/index.d.ts +13 -6
- package/dist/src/rules/index.d.ts.map +1 -1
- package/dist/src/rules/index.js +13 -161
- package/dist/src/rules/index.js.map +1 -1
- package/dist/src/rules/namespace.d.ts +3 -0
- package/dist/src/rules/namespace.d.ts.map +1 -0
- package/dist/src/rules/namespace.js +58 -0
- package/dist/src/rules/namespace.js.map +1 -0
- package/dist/src/rules/operation-inside-interface.d.ts +2 -0
- package/dist/src/rules/operation-inside-interface.d.ts.map +1 -0
- package/dist/src/rules/operation-inside-interface.js +25 -0
- package/dist/src/rules/operation-inside-interface.js.map +1 -0
- package/dist/src/rules/order-by.d.ts +1 -1
- package/dist/src/rules/order-by.d.ts.map +1 -1
- package/dist/src/rules/order-by.js +11 -10
- package/dist/src/rules/order-by.js.map +1 -1
- package/dist/src/rules/partial.d.ts +5 -0
- package/dist/src/rules/partial.d.ts.map +1 -0
- package/dist/src/rules/partial.js +35 -0
- package/dist/src/rules/partial.js.map +1 -0
- package/dist/src/rules/required-for-create.d.ts +2 -0
- package/dist/src/rules/required-for-create.d.ts.map +1 -0
- package/dist/src/rules/required-for-create.js +40 -0
- package/dist/src/rules/required-for-create.js.map +1 -0
- package/dist/src/rules/search.d.ts.map +1 -1
- package/dist/src/rules/search.js +3 -1
- package/dist/src/rules/search.js.map +1 -1
- package/dist/src/rules/skip.d.ts.map +1 -1
- package/dist/src/rules/skip.js +3 -1
- package/dist/src/rules/skip.js.map +1 -1
- package/dist/src/rules/top.d.ts.map +1 -1
- package/dist/src/rules/top.js +3 -1
- package/dist/src/rules/top.js.map +1 -1
- package/dist/src/utils.d.ts +18 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +160 -4
- package/dist/src/utils.js.map +1 -1
- package/lib/decorators.tsp +182 -39
- package/lib/deployment.tsp +18 -0
- package/lib/lib.tsp +6 -22
- package/lib/msgraph.tsp +4 -0
- package/lib/porcelain.tsp +135 -0
- package/lib/responses.tsp +82 -0
- package/lib/shared-models.tsp +75 -0
- package/package.json +31 -20
- 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/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
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { isVoidType, getDoc } from "@typespec/compiler";
|
|
2
|
+
import { isPathParam } from "@typespec/http";
|
|
3
|
+
import { getAction, getFunction, isOperationParameters } from "../index.js";
|
|
4
|
+
import { isTypeNullable, getPropertyTypeName, extractTypesFromUnion, getInterfaceNavigationSourceType } from "../utils.js";
|
|
5
|
+
import { getDefaultPropertyValue } from "./property.js";
|
|
6
|
+
import { buildAttributes } from "../decorators/ags-attribute.js";
|
|
7
|
+
export var OperationKind;
|
|
8
|
+
(function (OperationKind) {
|
|
9
|
+
OperationKind[OperationKind["Unknown"] = 0] = "Unknown";
|
|
10
|
+
OperationKind[OperationKind["Action"] = 1] = "Action";
|
|
11
|
+
OperationKind[OperationKind["Function"] = 2] = "Function";
|
|
12
|
+
})(OperationKind || (OperationKind = {}));
|
|
13
|
+
export function GetMsGraphOperations(program, interfaces) {
|
|
14
|
+
const operations = new Array();
|
|
15
|
+
[...interfaces].flatMap(([_, $interface]) => [...$interface.operations].filter(([_, $operation]) => [...$operation.decorators].filter(($decoratorApplication) => {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
return ((_a = $decoratorApplication.definition) === null || _a === void 0 ? void 0 : _a.name) === "@function" ||
|
|
18
|
+
((_b = $decoratorApplication.definition) === null || _b === void 0 ? void 0 : _b.name) === "@action";
|
|
19
|
+
}).length))
|
|
20
|
+
.forEach(([_, operation]) => {
|
|
21
|
+
const bindingTypeName = getBindingTypeName(program, operation);
|
|
22
|
+
if (!bindingTypeName) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
operations.push(GetMsGraphOperation(program, bindingTypeName, operation));
|
|
26
|
+
});
|
|
27
|
+
return operations;
|
|
28
|
+
}
|
|
29
|
+
function GetMsGraphOperation(program, bindingTypeName, operation) {
|
|
30
|
+
const element = {
|
|
31
|
+
Name: "",
|
|
32
|
+
Kind: OperationKind.Unknown,
|
|
33
|
+
BindingTypeName: bindingTypeName,
|
|
34
|
+
AgsAttributes: buildAttributes(program, operation),
|
|
35
|
+
Properties: getParameterProperties(program, operation.parameters.properties),
|
|
36
|
+
UnionProperties: new Array(),
|
|
37
|
+
IsVoid: isVoidType(operation.returnType),
|
|
38
|
+
IsNullable: false,
|
|
39
|
+
ReturnTypeName: "",
|
|
40
|
+
Description: getDoc(program, operation),
|
|
41
|
+
};
|
|
42
|
+
if (!element.IsVoid) {
|
|
43
|
+
const returnType = operation.returnType.kind === "Model" &&
|
|
44
|
+
!!operation.returnType.templateMapper &&
|
|
45
|
+
!!operation.returnType.templateMapper.args.length
|
|
46
|
+
? operation.returnType.templateMapper.args[0]
|
|
47
|
+
: operation.returnType;
|
|
48
|
+
if (!returnType || isVoidType(returnType)) {
|
|
49
|
+
element.IsVoid = true;
|
|
50
|
+
}
|
|
51
|
+
element.IsNullable = isTypeNullable(program, operation.returnType);
|
|
52
|
+
element.ReturnTypeName = getPropertyTypeName(program, returnType);
|
|
53
|
+
}
|
|
54
|
+
const actionName = getAction(program, operation);
|
|
55
|
+
if (actionName) {
|
|
56
|
+
element.Name = actionName;
|
|
57
|
+
element.Kind = OperationKind.Action;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
const functionName = getFunction(program, operation);
|
|
61
|
+
if (functionName) {
|
|
62
|
+
element.Name = functionName;
|
|
63
|
+
element.Kind = OperationKind.Function;
|
|
64
|
+
const parameterProperty = operation.parameters.properties.get("parameters");
|
|
65
|
+
if (parameterProperty && parameterProperty.type.kind === "Union") {
|
|
66
|
+
const parameterProperties = extractTypesFromUnion(parameterProperty.type)
|
|
67
|
+
.filter((type) => type.kind === "Model")
|
|
68
|
+
.map((m) => getParameterProperties(program, m.properties));
|
|
69
|
+
element.UnionProperties.push(...parameterProperties);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return element;
|
|
74
|
+
}
|
|
75
|
+
function getBindingTypeName(program, operation) {
|
|
76
|
+
const bindingType = getInterfaceNavigationSourceType(program, operation.interface);
|
|
77
|
+
if (!bindingType) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
return getPropertyTypeName(program, bindingType);
|
|
81
|
+
}
|
|
82
|
+
function getParameterProperties(program, parameters) {
|
|
83
|
+
const properties = [...parameters].flatMap(([, property]) => {
|
|
84
|
+
if (isPathParam(program, property)) {
|
|
85
|
+
return [];
|
|
86
|
+
}
|
|
87
|
+
if (property.type.kind === "Model" && isOperationParameters(program, property.type)) {
|
|
88
|
+
return getParameterProperties(program, property.type.properties);
|
|
89
|
+
}
|
|
90
|
+
return [
|
|
91
|
+
{
|
|
92
|
+
Name: property.name,
|
|
93
|
+
IsNullable: isTypeNullable(program, property.type),
|
|
94
|
+
PropertyTypeName: getPropertyTypeName(program, property.type),
|
|
95
|
+
IsOptional: property.optional,
|
|
96
|
+
DefaultValue: getDefaultPropertyValue(program, property),
|
|
97
|
+
Description: getDoc(program, property),
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
});
|
|
101
|
+
return properties;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../src/entities/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,UAAU,EAAE,MAAM,EAAmC,MAAM,oBAAoB,CAAC;AAC7G,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AAC3H,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,uDAAO,CAAA;IACP,qDAAM,CAAA;IACN,yDAAQ,CAAA;AACV,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAyBD,MAAM,UAAU,oBAAoB,CAAC,OAAgB,EAAE,UAAkC;IACvF,MAAM,UAAU,GAAG,IAAI,KAAK,EAAoB,CAAC;IAEjD,CAAC,GAAG,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,EAAE,CACxC,CAAC,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC,MAAM,CAC/B,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,EAAE,CAClB,CAAC,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC,MAAM,CAC/B,CAAC,qBAAqB,EAAE,EAAE;;QACxB,OAAA,CAAA,MAAA,qBAAqB,CAAC,UAAU,0CAAE,IAAI,MAAK,WAAW;YACtD,CAAA,MAAA,qBAAqB,CAAC,UAAU,0CAAE,IAAI,MAAK,SAAS,CAAA;KAA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AAE,aAAa,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG5D,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,aAAa,GACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CA0DrC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { getPropertyTypeName } from "../utils.js";
|
|
2
|
+
export function getDefaultPropertyValue(program, property) {
|
|
3
|
+
if (!property.default) {
|
|
4
|
+
return undefined;
|
|
5
|
+
}
|
|
6
|
+
let defaultValueValue = undefined;
|
|
7
|
+
switch (property.default.kind) {
|
|
8
|
+
case "String":
|
|
9
|
+
case "Boolean":
|
|
10
|
+
case "Number":
|
|
11
|
+
defaultValueValue = property.default.value;
|
|
12
|
+
break;
|
|
13
|
+
default:
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
const propType = getPropertyTypeName(program, property.type);
|
|
17
|
+
let defaultValueKey = "String";
|
|
18
|
+
switch (propType) {
|
|
19
|
+
case "Edm.String":
|
|
20
|
+
defaultValueKey = "String";
|
|
21
|
+
break;
|
|
22
|
+
case "Collection(Edm.Byte)":
|
|
23
|
+
defaultValueKey = "Binary";
|
|
24
|
+
break;
|
|
25
|
+
case "Edm.Byte":
|
|
26
|
+
case "Edm.Int16":
|
|
27
|
+
case "Edm.Int32":
|
|
28
|
+
case "Edm.Int64":
|
|
29
|
+
defaultValueKey = "Int";
|
|
30
|
+
break;
|
|
31
|
+
case "Edm.Single":
|
|
32
|
+
case "Edm.Double":
|
|
33
|
+
defaultValueKey = "Single";
|
|
34
|
+
break;
|
|
35
|
+
case "Edm.Date":
|
|
36
|
+
defaultValueKey = "Date";
|
|
37
|
+
break;
|
|
38
|
+
case "Edm.DateTimeOffset":
|
|
39
|
+
defaultValueKey = "DateTimeOffset";
|
|
40
|
+
break;
|
|
41
|
+
case "Edm.Boolean":
|
|
42
|
+
defaultValueKey = "Boolean";
|
|
43
|
+
break;
|
|
44
|
+
case "Edm.Stream":
|
|
45
|
+
defaultValueKey = "Binary";
|
|
46
|
+
break;
|
|
47
|
+
case "Edm.Guid":
|
|
48
|
+
defaultValueKey = "Guid";
|
|
49
|
+
break;
|
|
50
|
+
case "Edm.Duration":
|
|
51
|
+
case "Edm.TimeOfDay":
|
|
52
|
+
default:
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
return { [defaultValueKey]: defaultValueValue };
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=property.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property.js","sourceRoot":"","sources":["../../../src/entities/property.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,UAAU,uBAAuB,CACrC,OAAgB,EAChB,QAAuB;IAEvB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;QACrB,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,iBAAiB,GAAQ,SAAS,CAAC;IACvC,QAAQ,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE;QAC7B,KAAK,QAAQ,CAAC;QACd,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ;YACX,iBAAiB,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC;YAC3C,MAAM;QACR;YACE,OAAO,SAAS,CAAC;KACpB;IAED,MAAM,QAAQ,GAAG,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE7D,IAAI,eAAe,GAAG,QAAQ,CAAC;IAC/B,QAAQ,QAAQ,EAAE;QAChB,KAAK,YAAY;YACf,eAAe,GAAG,QAAQ,CAAC;YAC3B,MAAM;QACR,KAAK,sBAAsB;YACzB,eAAe,GAAG,QAAQ,CAAC;YAC3B,MAAM;QACR,KAAK,UAAU,CAAC;QAChB,KAAK,WAAW,CAAC;QACjB,KAAK,WAAW,CAAC;QACjB,KAAK,WAAW;YACd,eAAe,GAAG,KAAK,CAAC;YACxB,MAAM;QACR,KAAK,YAAY,CAAC;QAClB,KAAK,YAAY;YACf,eAAe,GAAG,QAAQ,CAAC;YAC3B,MAAM;QACR,KAAK,UAAU;YACb,eAAe,GAAG,MAAM,CAAC;YACzB,MAAM;QACR,KAAK,oBAAoB;YACvB,eAAe,GAAG,gBAAgB,CAAC;YACnC,MAAM;QACR,KAAK,aAAa;YAChB,eAAe,GAAG,SAAS,CAAC;YAC5B,MAAM;QACR,KAAK,YAAY;YACf,eAAe,GAAG,QAAQ,CAAC;YAC3B,MAAM;QACR,KAAK,UAAU;YACb,eAAe,GAAG,MAAM,CAAC;YACzB,MAAM;QACR,KAAK,cAAc,CAAC;QACpB,KAAK,eAAe,CAAC;QACrB;YACE,OAAO,SAAS,CAAC;KACpB;IAED,OAAO,EAAE,CAAC,eAAe,CAAC,EAAE,iBAAiB,EAAE,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Enum, EnumMember, Model, ModelProperty, Namespace, Operation, Program } from "@typespec/compiler";
|
|
2
|
+
export interface RevisionDefinition {
|
|
3
|
+
Date: string;
|
|
4
|
+
Version: string;
|
|
5
|
+
Description?: string;
|
|
6
|
+
RemovalDate: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function GetRevisionDefinition(program: Program, type: Model | ModelProperty | EnumMember | Enum | Operation | Namespace, namespace: Namespace | undefined): RevisionDefinition | undefined;
|
|
9
|
+
//# sourceMappingURL=revision-definition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revision-definition.d.ts","sourceRoot":"","sources":["../../../src/entities/revision-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAiB,MAAM,oBAAoB,CAAC;AAG1H,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,KAAK,GAAG,aAAa,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,EACvE,SAAS,EAAE,SAAS,GAAG,SAAS,GAC/B,kBAAkB,GAAG,SAAS,CAgBhC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getDeprecated } from "@typespec/compiler";
|
|
2
|
+
import { getPrivatePreview, getDeprecatedDefinitions, getPrivatePreviewDefinitions } from "../index.js";
|
|
3
|
+
export function GetRevisionDefinition(program, type, namespace) {
|
|
4
|
+
if (!namespace) {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
const deprecated = getDeprecated(program, type);
|
|
8
|
+
if (deprecated) {
|
|
9
|
+
return getRevisionDefinitionFromDeprecation(program, namespace, deprecated);
|
|
10
|
+
}
|
|
11
|
+
const privatePreview = getPrivatePreview(program, type);
|
|
12
|
+
if (privatePreview) {
|
|
13
|
+
return getRevisionDefinitionFromPrivatePreview(program, namespace, privatePreview);
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
function getRevisionDefinitionFromDeprecation(program, namespace, deprecated) {
|
|
18
|
+
const deprecatedDefinitions = getDeprecatedDefinitions(program, namespace);
|
|
19
|
+
const definition = deprecatedDefinitions.get(deprecated);
|
|
20
|
+
if (!definition) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
Date: definition.announcementDate,
|
|
25
|
+
RemovalDate: definition.removalDate,
|
|
26
|
+
Version: `${definition.announcementDate.substring(0, 7)}/${definition.category}`,
|
|
27
|
+
Description: definition.description,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function getRevisionDefinitionFromPrivatePreview(program, namespace, deprecated) {
|
|
31
|
+
const privatePreviewDefinitions = getPrivatePreviewDefinitions(program, namespace);
|
|
32
|
+
const definition = privatePreviewDefinitions.get(deprecated);
|
|
33
|
+
if (!definition) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
Date: definition.announcementDate,
|
|
38
|
+
RemovalDate: definition.removalDate,
|
|
39
|
+
Version: `${definition.announcementDate.substring(0, 7)}/PrivatePreview:${definition.name}`,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=revision-definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revision-definition.js","sourceRoot":"","sources":["../../../src/entities/revision-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC1H,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AASxG,MAAM,UAAU,qBAAqB,CACnC,OAAgB,EAChB,IAAuE,EACvE,SAAgC;IAEhC,IAAI,CAAC,SAAS,EAAE;QACd,OAAO,SAAS,CAAA;KACjB;IAED,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAChD,IAAI,UAAU,EAAE;QACd,OAAO,oCAAoC,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;KAC7E;IAED,MAAM,cAAc,GAAG,iBAAiB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACxD,IAAI,cAAc,EAAE;QAClB,OAAO,uCAAuC,CAAC,OAAO,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;KACpF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,oCAAoC,CAC3C,OAAgB,EAChB,SAAoB,EACpB,UAAkB;IAElB,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC3E,MAAM,UAAU,GAAG,qBAAqB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACzD,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,gBAAgB;QACjC,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,OAAO,EAAE,GAAG,UAAU,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,UAAU,CAAC,QAAQ,EAAE;QAChF,WAAW,EAAE,UAAU,CAAC,WAAW;KACpC,CAAC;AACJ,CAAC;AAED,SAAS,uCAAuC,CAC9C,OAAgB,EAChB,SAAoB,EACpB,UAAkB;IAElB,MAAM,yBAAyB,GAAG,4BAA4B,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACnF,MAAM,UAAU,GAAG,yBAAyB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC7D,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,gBAAgB;QACjC,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,OAAO,EAAE,GAAG,UAAU,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,mBAAmB,UAAU,CAAC,IAAI,EAAE;KAC5F,CAAC;AACJ,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
package/dist/src/index.js
CHANGED
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
package/dist/src/lib.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { JSONSchemaType } from "@typespec/compiler";
|
|
2
|
+
export declare const namespace = "MsGraph";
|
|
3
|
+
export interface MsGraphEmitterOptions {
|
|
4
|
+
filename?: string;
|
|
5
|
+
}
|
|
2
6
|
export declare const libDef: {
|
|
3
7
|
readonly name: "@microsoft/typespec-msgraph";
|
|
4
8
|
readonly diagnostics: {
|
|
@@ -14,6 +18,10 @@ export declare const libDef: {
|
|
|
14
18
|
readonly messages: {
|
|
15
19
|
readonly default: import("@typespec/compiler").CallableMessage<["element", "other", "location"]>;
|
|
16
20
|
readonly operation: import("@typespec/compiler").CallableMessage<[]>;
|
|
21
|
+
readonly collectionNavigationPropertiesNotNullable: "Collection-valued navigation properties cannot be nullable.";
|
|
22
|
+
readonly propertyRequiredForCreate: import("@typespec/compiler").CallableMessage<["property", "model"]>;
|
|
23
|
+
readonly modelMissingNamespace: import("@typespec/compiler").CallableMessage<["model"]>;
|
|
24
|
+
readonly operationParameterMismatch: import("@typespec/compiler").CallableMessage<["operation", "parameters"]>;
|
|
17
25
|
};
|
|
18
26
|
};
|
|
19
27
|
readonly "decorator-invalid-use": {
|
|
@@ -23,10 +31,17 @@ export declare const libDef: {
|
|
|
23
31
|
readonly alternateKey: import("@typespec/compiler").CallableMessage<[]>;
|
|
24
32
|
readonly disallowedTypeSpecDecorators: import("@typespec/compiler").CallableMessage<["decorator"]>;
|
|
25
33
|
readonly expandProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
34
|
+
readonly filterProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
26
35
|
readonly key: import("@typespec/compiler").CallableMessage<[]>;
|
|
27
36
|
readonly orderByProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
28
37
|
readonly required: import("@typespec/compiler").CallableMessage<["decorator", "parameters"]>;
|
|
29
38
|
readonly wrongType: import("@typespec/compiler").CallableMessage<["decorator", "target"]>;
|
|
39
|
+
readonly graphRoute: import("@typespec/compiler").CallableMessage<[]>;
|
|
40
|
+
readonly allowedValues: import("@typespec/compiler").CallableMessage<[]>;
|
|
41
|
+
readonly allowedValuesTypeHomogeinity: import("@typespec/compiler").CallableMessage<[]>;
|
|
42
|
+
readonly allowedValuesInvalidType: import("@typespec/compiler").CallableMessage<[]>;
|
|
43
|
+
readonly invalidPublicNamespaceName: import("@typespec/compiler").CallableMessage<["namespace"]>;
|
|
44
|
+
readonly partial: import("@typespec/compiler").CallableMessage<[]>;
|
|
30
45
|
};
|
|
31
46
|
};
|
|
32
47
|
readonly "singleton-invalid-name": {
|
|
@@ -48,6 +63,9 @@ export declare const libDef: {
|
|
|
48
63
|
};
|
|
49
64
|
};
|
|
50
65
|
};
|
|
66
|
+
readonly emitter: {
|
|
67
|
+
readonly options: JSONSchemaType<MsGraphEmitterOptions>;
|
|
68
|
+
};
|
|
51
69
|
};
|
|
52
70
|
export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
53
71
|
"decorator-missing-dependencies": {
|
|
@@ -57,16 +75,27 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
|
57
75
|
"element-missing-dependencies": {
|
|
58
76
|
readonly default: import("@typespec/compiler").CallableMessage<["element", "other", "location"]>;
|
|
59
77
|
readonly operation: import("@typespec/compiler").CallableMessage<[]>;
|
|
78
|
+
readonly collectionNavigationPropertiesNotNullable: "Collection-valued navigation properties cannot be nullable.";
|
|
79
|
+
readonly propertyRequiredForCreate: import("@typespec/compiler").CallableMessage<["property", "model"]>;
|
|
80
|
+
readonly modelMissingNamespace: import("@typespec/compiler").CallableMessage<["model"]>;
|
|
81
|
+
readonly operationParameterMismatch: import("@typespec/compiler").CallableMessage<["operation", "parameters"]>;
|
|
60
82
|
};
|
|
61
83
|
"decorator-invalid-use": {
|
|
62
84
|
readonly default: import("@typespec/compiler").CallableMessage<["decorator", "other", "location"]>;
|
|
63
85
|
readonly alternateKey: import("@typespec/compiler").CallableMessage<[]>;
|
|
64
86
|
readonly disallowedTypeSpecDecorators: import("@typespec/compiler").CallableMessage<["decorator"]>;
|
|
65
87
|
readonly expandProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
88
|
+
readonly filterProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
66
89
|
readonly key: import("@typespec/compiler").CallableMessage<[]>;
|
|
67
90
|
readonly orderByProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
68
91
|
readonly required: import("@typespec/compiler").CallableMessage<["decorator", "parameters"]>;
|
|
69
92
|
readonly wrongType: import("@typespec/compiler").CallableMessage<["decorator", "target"]>;
|
|
93
|
+
readonly graphRoute: import("@typespec/compiler").CallableMessage<[]>;
|
|
94
|
+
readonly allowedValues: import("@typespec/compiler").CallableMessage<[]>;
|
|
95
|
+
readonly allowedValuesTypeHomogeinity: import("@typespec/compiler").CallableMessage<[]>;
|
|
96
|
+
readonly allowedValuesInvalidType: import("@typespec/compiler").CallableMessage<[]>;
|
|
97
|
+
readonly invalidPublicNamespaceName: import("@typespec/compiler").CallableMessage<["namespace"]>;
|
|
98
|
+
readonly partial: import("@typespec/compiler").CallableMessage<[]>;
|
|
70
99
|
};
|
|
71
100
|
"singleton-invalid-name": {
|
|
72
101
|
readonly default: import("@typespec/compiler").CallableMessage<["value"]>;
|
|
@@ -77,7 +106,7 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
|
|
77
106
|
"use-evolvable-enum": {
|
|
78
107
|
readonly default: import("@typespec/compiler").CallableMessage<["enum"]>;
|
|
79
108
|
};
|
|
80
|
-
},
|
|
109
|
+
}, MsGraphEmitterOptions>;
|
|
81
110
|
export declare const reportDiagnostic: <C extends "decorator-missing-dependencies" | "element-missing-dependencies" | "decorator-invalid-use" | "singleton-invalid-name" | "extends-invalid-use" | "use-evolvable-enum", M extends keyof {
|
|
82
111
|
"decorator-missing-dependencies": {
|
|
83
112
|
readonly default: import("@typespec/compiler").CallableMessage<["decorator", "required", "location"]>;
|
|
@@ -86,16 +115,27 @@ export declare const reportDiagnostic: <C extends "decorator-missing-dependencie
|
|
|
86
115
|
"element-missing-dependencies": {
|
|
87
116
|
readonly default: import("@typespec/compiler").CallableMessage<["element", "other", "location"]>;
|
|
88
117
|
readonly operation: import("@typespec/compiler").CallableMessage<[]>;
|
|
118
|
+
readonly collectionNavigationPropertiesNotNullable: "Collection-valued navigation properties cannot be nullable.";
|
|
119
|
+
readonly propertyRequiredForCreate: import("@typespec/compiler").CallableMessage<["property", "model"]>;
|
|
120
|
+
readonly modelMissingNamespace: import("@typespec/compiler").CallableMessage<["model"]>;
|
|
121
|
+
readonly operationParameterMismatch: import("@typespec/compiler").CallableMessage<["operation", "parameters"]>;
|
|
89
122
|
};
|
|
90
123
|
"decorator-invalid-use": {
|
|
91
124
|
readonly default: import("@typespec/compiler").CallableMessage<["decorator", "other", "location"]>;
|
|
92
125
|
readonly alternateKey: import("@typespec/compiler").CallableMessage<[]>;
|
|
93
126
|
readonly disallowedTypeSpecDecorators: import("@typespec/compiler").CallableMessage<["decorator"]>;
|
|
94
127
|
readonly expandProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
128
|
+
readonly filterProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
95
129
|
readonly key: import("@typespec/compiler").CallableMessage<[]>;
|
|
96
130
|
readonly orderByProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
97
131
|
readonly required: import("@typespec/compiler").CallableMessage<["decorator", "parameters"]>;
|
|
98
132
|
readonly wrongType: import("@typespec/compiler").CallableMessage<["decorator", "target"]>;
|
|
133
|
+
readonly graphRoute: import("@typespec/compiler").CallableMessage<[]>;
|
|
134
|
+
readonly allowedValues: import("@typespec/compiler").CallableMessage<[]>;
|
|
135
|
+
readonly allowedValuesTypeHomogeinity: import("@typespec/compiler").CallableMessage<[]>;
|
|
136
|
+
readonly allowedValuesInvalidType: import("@typespec/compiler").CallableMessage<[]>;
|
|
137
|
+
readonly invalidPublicNamespaceName: import("@typespec/compiler").CallableMessage<["namespace"]>;
|
|
138
|
+
readonly partial: import("@typespec/compiler").CallableMessage<[]>;
|
|
99
139
|
};
|
|
100
140
|
"singleton-invalid-name": {
|
|
101
141
|
readonly default: import("@typespec/compiler").CallableMessage<["value"]>;
|
|
@@ -114,16 +154,27 @@ export declare const reportDiagnostic: <C extends "decorator-missing-dependencie
|
|
|
114
154
|
"element-missing-dependencies": {
|
|
115
155
|
readonly default: import("@typespec/compiler").CallableMessage<["element", "other", "location"]>;
|
|
116
156
|
readonly operation: import("@typespec/compiler").CallableMessage<[]>;
|
|
157
|
+
readonly collectionNavigationPropertiesNotNullable: "Collection-valued navigation properties cannot be nullable.";
|
|
158
|
+
readonly propertyRequiredForCreate: import("@typespec/compiler").CallableMessage<["property", "model"]>;
|
|
159
|
+
readonly modelMissingNamespace: import("@typespec/compiler").CallableMessage<["model"]>;
|
|
160
|
+
readonly operationParameterMismatch: import("@typespec/compiler").CallableMessage<["operation", "parameters"]>;
|
|
117
161
|
};
|
|
118
162
|
"decorator-invalid-use": {
|
|
119
163
|
readonly default: import("@typespec/compiler").CallableMessage<["decorator", "other", "location"]>;
|
|
120
164
|
readonly alternateKey: import("@typespec/compiler").CallableMessage<[]>;
|
|
121
165
|
readonly disallowedTypeSpecDecorators: import("@typespec/compiler").CallableMessage<["decorator"]>;
|
|
122
166
|
readonly expandProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
167
|
+
readonly filterProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
123
168
|
readonly key: import("@typespec/compiler").CallableMessage<[]>;
|
|
124
169
|
readonly orderByProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
|
|
125
170
|
readonly required: import("@typespec/compiler").CallableMessage<["decorator", "parameters"]>;
|
|
126
171
|
readonly wrongType: import("@typespec/compiler").CallableMessage<["decorator", "target"]>;
|
|
172
|
+
readonly graphRoute: import("@typespec/compiler").CallableMessage<[]>;
|
|
173
|
+
readonly allowedValues: import("@typespec/compiler").CallableMessage<[]>;
|
|
174
|
+
readonly allowedValuesTypeHomogeinity: import("@typespec/compiler").CallableMessage<[]>;
|
|
175
|
+
readonly allowedValuesInvalidType: import("@typespec/compiler").CallableMessage<[]>;
|
|
176
|
+
readonly invalidPublicNamespaceName: import("@typespec/compiler").CallableMessage<["namespace"]>;
|
|
177
|
+
readonly partial: import("@typespec/compiler").CallableMessage<[]>;
|
|
127
178
|
};
|
|
128
179
|
"singleton-invalid-name": {
|
|
129
180
|
readonly default: import("@typespec/compiler").CallableMessage<["value"]>;
|
package/dist/src/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAuC,MAAM,oBAAoB,CAAC;AAEzF,eAAO,MAAM,SAAS,YAAY,CAAC;AAEnC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAeD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DT,CAAC;AAEX,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAgC,CAAC;AAClD,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAS,CAAC"}
|
package/dist/src/lib.js
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { createTypeSpecLibrary, paramMessage } from "@typespec/compiler";
|
|
2
|
-
export const namespace = "
|
|
2
|
+
export const namespace = "MsGraph";
|
|
3
|
+
const EmitterOptionsSchema = {
|
|
4
|
+
type: "object",
|
|
5
|
+
additionalProperties: false,
|
|
6
|
+
properties: {
|
|
7
|
+
filename: {
|
|
8
|
+
type: "string",
|
|
9
|
+
nullable: true,
|
|
10
|
+
description: "The name of the generated CSDL file. If not specified, it defaults to `workload.csdl`."
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
required: [],
|
|
14
|
+
};
|
|
3
15
|
export const libDef = {
|
|
4
16
|
name: "@microsoft/typespec-msgraph",
|
|
5
17
|
diagnostics: {
|
|
@@ -15,6 +27,10 @@ export const libDef = {
|
|
|
15
27
|
messages: {
|
|
16
28
|
default: paramMessage `The ${"element"} must be used together with ${"other"} on a ${"location"}.`,
|
|
17
29
|
operation: paramMessage `Operations must be used inside interfaces.`,
|
|
30
|
+
collectionNavigationPropertiesNotNullable: `Collection-valued navigation properties cannot be nullable.`,
|
|
31
|
+
propertyRequiredForCreate: paramMessage `The property "${"property"}" on "${"model"}" must be nullable, computed, have a default value or be annotated with @requiredForCreate.`,
|
|
32
|
+
modelMissingNamespace: paramMessage `The model "${"model"}" must be defined in a namespace.`,
|
|
33
|
+
operationParameterMismatch: paramMessage `The operation "${"operation"}" must declare the parameters "${"parameters"}", have a "graphRouteParams" parameter or use the porcelain syntax.`,
|
|
18
34
|
},
|
|
19
35
|
},
|
|
20
36
|
"decorator-invalid-use": {
|
|
@@ -24,10 +40,17 @@ export const libDef = {
|
|
|
24
40
|
alternateKey: paramMessage `The @alternateKey decorator can only be attached to a non-nullable primitive-typed property.`,
|
|
25
41
|
disallowedTypeSpecDecorators: paramMessage `The decorator ${"decorator"} may not be used in MSGraph TypeSpec.`,
|
|
26
42
|
expandProperties: paramMessage `The properties "${"properties"}" defined in the @expand decorator must be defined with @references or @contains in the referenced model "${"model"}" or its inheritance hierarchy.`,
|
|
43
|
+
filterProperties: paramMessage `The properties "${"properties"}" defined in the @filter decorator must be defined in the referenced model "${"model"}" or its inheritance hierarchy.`,
|
|
27
44
|
key: paramMessage `The @key decorator can only be attached to a non-nullable primitive type.`,
|
|
28
45
|
orderByProperties: paramMessage `The properties "${"properties"}" defined in the @orderBy decorator must not be defined with @references or @contains in the referenced model "${"model"}" or its inheritance hierarchy.`,
|
|
29
46
|
required: paramMessage `The ${"decorator"} decorator must define required ${"parameters"}.`,
|
|
30
47
|
wrongType: paramMessage `The ${"decorator"} decorator can only be applied to a ${"target"}.`,
|
|
48
|
+
graphRoute: paramMessage `@graphRoutes paths must not start with a /`,
|
|
49
|
+
allowedValues: paramMessage `The @allowedValues decorator cannot be empty.`,
|
|
50
|
+
allowedValuesTypeHomogeinity: paramMessage `The types of values passed to @allowedValues must be homegeneous.`,
|
|
51
|
+
allowedValuesInvalidType: paramMessage `The @allowedValues decorator can only be applied with primitive types.`,
|
|
52
|
+
invalidPublicNamespaceName: paramMessage `The @publicNamespace decorator value on namespace "${"namespace"}" should start with "microsoft.graph".`,
|
|
53
|
+
partial: paramMessage `The base model in the extended clause must match the base class of the referenced entity in the @partial decorator.`,
|
|
31
54
|
},
|
|
32
55
|
},
|
|
33
56
|
"singleton-invalid-name": {
|
|
@@ -49,6 +72,7 @@ export const libDef = {
|
|
|
49
72
|
},
|
|
50
73
|
},
|
|
51
74
|
},
|
|
75
|
+
emitter: { options: EmitterOptionsSchema },
|
|
52
76
|
};
|
|
53
77
|
export const $lib = createTypeSpecLibrary(libDef);
|
|
54
78
|
export const { reportDiagnostic } = $lib;
|
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":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,qBAAqB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEzF,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC;AAMnC,MAAM,oBAAoB,GAA0C;IAClE,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,wFAAwF;SACtG;KACF;IACD,QAAQ,EAAE,EAAE;CACb,CAAA;AAED,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI,EAAE,6BAA6B;IACnC,WAAW,EAAE;QACX,gCAAgC,EAAE;YAChC,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,OAAO,WAAW,sDAAsD,UAAU,qBAAqB,UAAU,GAAG;gBACzI,QAAQ,EAAE,YAAY,CAAA,oFAAoF;aAC3G;SACF;QACD,8BAA8B,EAAE;YAC9B,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,OAAO,SAAS,+BAA+B,OAAO,SAAS,UAAU,GAAG;gBACjG,SAAS,EAAE,YAAY,CAAA,4CAA4C;gBACnE,yCAAyC,EAAE,6DAA6D;gBACxG,yBAAyB,EAAE,YAAY,CAAA,iBAAiB,UAAU,SAAS,OAAO,6FAA6F;gBAC/K,qBAAqB,EAAE,YAAY,CAAA,cAAc,OAAO,mCAAmC;gBAC3F,0BAA0B,EAAE,YAAY,CAAA,kBAAkB,WAAW,kCAAkC,YAAY,qEAAqE;aACzL;SACF;QACD,uBAAuB,EAAE;YACvB,QAAQ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BAAgB,MAAM,2EAA2E;aACvH;SACF;KACF;IACD,OAAO,EAAE,EAAE,OAAO,EAAE,oBAA6D,EAAE;CAC3E,CAAC;AAEX,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAClD,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC"}
|
package/dist/src/linter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AA6C7C,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,QAG3C"}
|
package/dist/src/linter.js
CHANGED
|
@@ -1,32 +1,41 @@
|
|
|
1
1
|
import { getLinter } from "@typespec/lint";
|
|
2
2
|
import { $lib } from "./lib.js";
|
|
3
|
-
import
|
|
3
|
+
import * as theRules from "./rules/index.js";
|
|
4
4
|
const linter = getLinter($lib);
|
|
5
5
|
linter.registerRules([
|
|
6
|
-
abstractOnlyAppliesToStructuredTypeRule,
|
|
7
|
-
alternateKeyOnKeyRule,
|
|
8
|
-
alternateKeyOnPrimitivePropertyRule,
|
|
9
|
-
alternateKeyRequiresKeyRule,
|
|
10
|
-
computedCannotBeCombinedWithRule,
|
|
11
|
-
containsOnlyAppliesToNavigationPropertyRule,
|
|
12
|
-
countAppliesToGetOperationsThatReturnCollectionsRule,
|
|
13
|
-
disallowedTypeSpecDecoratorsRule,
|
|
14
|
-
entityMustHaveKeyRule,
|
|
15
|
-
expandOnlyNavigationPropertiesRule,
|
|
16
|
-
expandOnlyOnGetNavigationSourceRule,
|
|
17
|
-
extendsOnSameTypeRule,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
6
|
+
theRules.abstractOnlyAppliesToStructuredTypeRule,
|
|
7
|
+
theRules.alternateKeyOnKeyRule,
|
|
8
|
+
theRules.alternateKeyOnPrimitivePropertyRule,
|
|
9
|
+
theRules.alternateKeyRequiresKeyRule,
|
|
10
|
+
theRules.computedCannotBeCombinedWithRule,
|
|
11
|
+
theRules.containsOnlyAppliesToNavigationPropertyRule,
|
|
12
|
+
theRules.countAppliesToGetOperationsThatReturnCollectionsRule,
|
|
13
|
+
theRules.disallowedTypeSpecDecoratorsRule,
|
|
14
|
+
theRules.entityMustHaveKeyRule,
|
|
15
|
+
theRules.expandOnlyNavigationPropertiesRule,
|
|
16
|
+
theRules.expandOnlyOnGetNavigationSourceRule,
|
|
17
|
+
theRules.extendsOnSameTypeRule,
|
|
18
|
+
theRules.filterAppliesToGetOperationsThatReturnCollectionsRule,
|
|
19
|
+
theRules.filterOnlyAppliesToModelPropertiesRule,
|
|
20
|
+
theRules.filterPropertiesMustNotBeEmptyRule,
|
|
21
|
+
theRules.hasStreamOnlyOnEntity,
|
|
22
|
+
theRules.invalidPublicNamespaceNameRule,
|
|
23
|
+
theRules.keyOnlyOnEntityNonNullablePrimitivePropertyRule,
|
|
24
|
+
theRules.namespaceIsRequiredRule,
|
|
25
|
+
theRules.openOnlyAppliesToStructuredType,
|
|
26
|
+
theRules.operationInsideInterfaceRule,
|
|
27
|
+
theRules.operationParametersMatchGraphRouteParametersRule,
|
|
28
|
+
theRules.orderByOnlyNonNavigationPropertiesRule,
|
|
29
|
+
theRules.orderByAppliesToGetOperationsThatReturnCollectionsRule,
|
|
30
|
+
theRules.referencesOnlyAppliesToNavigationPropertyRule,
|
|
31
|
+
theRules.searchAppliesToGetOperationsThatReturnCollectionsRule,
|
|
32
|
+
theRules.skipAppliesToGetOperationsThatReturnCollectionsRule,
|
|
33
|
+
theRules.topAppliesToGetOperationsThatReturnCollectionsRule,
|
|
34
|
+
theRules.useEvolvableEnumRule,
|
|
35
|
+
theRules.voidFunctionRule,
|
|
36
|
+
theRules.allowedValuesCannotBeEmptyRule,
|
|
37
|
+
theRules.graphRouteLeadingSlashRule,
|
|
38
|
+
theRules.extendedModelBaseShouldMatchPartialBaseModel,
|
|
30
39
|
], { autoEnable: true });
|
|
31
40
|
export function $onValidate(program) {
|
|
32
41
|
linter.autoEnableRules();
|
package/dist/src/linter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linter.js","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,
|
|
1
|
+
{"version":3,"file":"linter.js","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAQ,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE9C,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAC/B,MAAM,CAAC,aAAa,CAClB;IACE,QAAQ,CAAC,uCAAuC;IAChD,QAAQ,CAAC,qBAAqB;IAC9B,QAAQ,CAAC,mCAAmC;IAC5C,QAAQ,CAAC,2BAA2B;IACpC,QAAQ,CAAC,gCAAgC;IACzC,QAAQ,CAAC,2CAA2C;IACpD,QAAQ,CAAC,oDAAoD;IAC7D,QAAQ,CAAC,gCAAgC;IACzC,QAAQ,CAAC,qBAAqB;IAC9B,QAAQ,CAAC,kCAAkC;IAC3C,QAAQ,CAAC,mCAAmC;IAC5C,QAAQ,CAAC,qBAAqB;IAC9B,QAAQ,CAAC,qDAAqD;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