@microsoft/typespec-msgraph 0.0.1-Preview.1
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/LICENSE +21 -0
- package/README.md +7 -0
- package/dist/src/components/acceptable-media-types-annotation.d.ts +6 -0
- package/dist/src/components/acceptable-media-types-annotation.d.ts.map +1 -0
- package/dist/src/components/acceptable-media-types-annotation.js +15 -0
- package/dist/src/components/acceptable-media-types-annotation.js.map +1 -0
- package/dist/src/components/alternate-keys-annotation.d.ts +6 -0
- package/dist/src/components/alternate-keys-annotation.d.ts.map +1 -0
- package/dist/src/components/alternate-keys-annotation.js +30 -0
- package/dist/src/components/alternate-keys-annotation.js.map +1 -0
- package/dist/src/components/common-elements.d.ts +128 -0
- package/dist/src/components/common-elements.d.ts.map +1 -0
- package/dist/src/components/common-elements.js +38 -0
- package/dist/src/components/common-elements.js.map +1 -0
- package/dist/src/components/computed-annotation.d.ts +6 -0
- package/dist/src/components/computed-annotation.d.ts.map +1 -0
- package/dist/src/components/computed-annotation.js +12 -0
- package/dist/src/components/computed-annotation.js.map +1 -0
- package/dist/src/components/count-restrictions-annotation.d.ts +6 -0
- package/dist/src/components/count-restrictions-annotation.d.ts.map +1 -0
- package/dist/src/components/count-restrictions-annotation.js +15 -0
- package/dist/src/components/count-restrictions-annotation.js.map +1 -0
- package/dist/src/components/description-annotation.d.ts +6 -0
- package/dist/src/components/description-annotation.d.ts.map +1 -0
- package/dist/src/components/description-annotation.js +13 -0
- package/dist/src/components/description-annotation.js.map +1 -0
- package/dist/src/components/expand-restrictions-annotation.d.ts +7 -0
- package/dist/src/components/expand-restrictions-annotation.d.ts.map +1 -0
- package/dist/src/components/expand-restrictions-annotation.js +31 -0
- package/dist/src/components/expand-restrictions-annotation.js.map +1 -0
- package/dist/src/components/index.d.ts +15 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/components/index.js +15 -0
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/components/permissions-annotation.d.ts +6 -0
- package/dist/src/components/permissions-annotation.d.ts.map +1 -0
- package/dist/src/components/permissions-annotation.js +20 -0
- package/dist/src/components/permissions-annotation.js.map +1 -0
- package/dist/src/components/program-context.d.ts +4 -0
- package/dist/src/components/program-context.d.ts.map +1 -0
- package/dist/src/components/program-context.js +3 -0
- package/dist/src/components/program-context.js.map +1 -0
- package/dist/src/components/property-element.d.ts +6 -0
- package/dist/src/components/property-element.d.ts.map +1 -0
- package/dist/src/components/property-element.js +41 -0
- package/dist/src/components/property-element.js.map +1 -0
- package/dist/src/components/revisions-annotation.d.ts +7 -0
- package/dist/src/components/revisions-annotation.d.ts.map +1 -0
- package/dist/src/components/revisions-annotation.js +60 -0
- package/dist/src/components/revisions-annotation.js.map +1 -0
- package/dist/src/components/search-restrictions-annotation.d.ts +6 -0
- package/dist/src/components/search-restrictions-annotation.d.ts.map +1 -0
- package/dist/src/components/search-restrictions-annotation.js +15 -0
- package/dist/src/components/search-restrictions-annotation.js.map +1 -0
- package/dist/src/components/skip-supported-annotation.d.ts +6 -0
- package/dist/src/components/skip-supported-annotation.d.ts.map +1 -0
- package/dist/src/components/skip-supported-annotation.js +13 -0
- package/dist/src/components/skip-supported-annotation.js.map +1 -0
- package/dist/src/components/sort-restrictions-annotation.d.ts +7 -0
- package/dist/src/components/sort-restrictions-annotation.d.ts.map +1 -0
- package/dist/src/components/sort-restrictions-annotation.js +31 -0
- package/dist/src/components/sort-restrictions-annotation.js.map +1 -0
- package/dist/src/components/structured-type-element.d.ts +6 -0
- package/dist/src/components/structured-type-element.d.ts.map +1 -0
- package/dist/src/components/structured-type-element.js +77 -0
- package/dist/src/components/structured-type-element.js.map +1 -0
- package/dist/src/components/top-supported-annotation.d.ts +6 -0
- package/dist/src/components/top-supported-annotation.d.ts.map +1 -0
- package/dist/src/components/top-supported-annotation.js +13 -0
- package/dist/src/components/top-supported-annotation.js.map +1 -0
- package/dist/src/csdl.d.ts +8 -0
- package/dist/src/csdl.d.ts.map +1 -0
- package/dist/src/csdl.js +298 -0
- package/dist/src/csdl.js.map +1 -0
- package/dist/src/decorators/abstract.d.ts +9 -0
- package/dist/src/decorators/abstract.d.ts.map +1 -0
- package/dist/src/decorators/abstract.js +19 -0
- package/dist/src/decorators/abstract.js.map +1 -0
- package/dist/src/decorators/alternate-key.d.ts +9 -0
- package/dist/src/decorators/alternate-key.d.ts.map +1 -0
- package/dist/src/decorators/alternate-key.js +13 -0
- package/dist/src/decorators/alternate-key.js.map +1 -0
- package/dist/src/decorators/attribute-builder.d.ts +2 -0
- package/dist/src/decorators/attribute-builder.d.ts.map +1 -0
- package/dist/src/decorators/attribute-builder.js +166 -0
- package/dist/src/decorators/attribute-builder.js.map +1 -0
- package/dist/src/decorators/attributes.d.ts +57 -0
- package/dist/src/decorators/attributes.d.ts.map +1 -0
- package/dist/src/decorators/attributes.js +50 -0
- package/dist/src/decorators/attributes.js.map +1 -0
- package/dist/src/decorators/complex.d.ts +9 -0
- package/dist/src/decorators/complex.d.ts.map +1 -0
- package/dist/src/decorators/complex.js +19 -0
- package/dist/src/decorators/complex.js.map +1 -0
- package/dist/src/decorators/computed.d.ts +9 -0
- package/dist/src/decorators/computed.d.ts.map +1 -0
- package/dist/src/decorators/computed.js +13 -0
- package/dist/src/decorators/computed.js.map +1 -0
- package/dist/src/decorators/contains.d.ts +9 -0
- package/dist/src/decorators/contains.d.ts.map +1 -0
- package/dist/src/decorators/contains.js +13 -0
- package/dist/src/decorators/contains.js.map +1 -0
- package/dist/src/decorators/count.d.ts +9 -0
- package/dist/src/decorators/count.d.ts.map +1 -0
- package/dist/src/decorators/count.js +13 -0
- package/dist/src/decorators/count.js.map +1 -0
- package/dist/src/decorators/deprecated-definition.d.ts +21 -0
- package/dist/src/decorators/deprecated-definition.d.ts.map +1 -0
- package/dist/src/decorators/deprecated-definition.js +18 -0
- package/dist/src/decorators/deprecated-definition.js.map +1 -0
- package/dist/src/decorators/entity.d.ts +10 -0
- package/dist/src/decorators/entity.d.ts.map +1 -0
- package/dist/src/decorators/entity.js +23 -0
- package/dist/src/decorators/entity.js.map +1 -0
- package/dist/src/decorators/expand.d.ts +11 -0
- package/dist/src/decorators/expand.d.ts.map +1 -0
- package/dist/src/decorators/expand.js +17 -0
- package/dist/src/decorators/expand.js.map +1 -0
- package/dist/src/decorators/handlers/custom/additional-query-parameters.d.ts +14 -0
- package/dist/src/decorators/handlers/custom/additional-query-parameters.d.ts.map +1 -0
- package/dist/src/decorators/handlers/custom/additional-query-parameters.js +36 -0
- package/dist/src/decorators/handlers/custom/additional-query-parameters.js.map +1 -0
- package/dist/src/decorators/handlers/custom/ags-attribute.d.ts +7 -0
- package/dist/src/decorators/handlers/custom/ags-attribute.d.ts.map +1 -0
- package/dist/src/decorators/handlers/custom/ags-attribute.js +36 -0
- package/dist/src/decorators/handlers/custom/ags-attribute.js.map +1 -0
- package/dist/src/decorators/handlers/custom/index.d.ts +3 -0
- package/dist/src/decorators/handlers/custom/index.d.ts.map +1 -0
- package/dist/src/decorators/handlers/custom/index.js +3 -0
- package/dist/src/decorators/handlers/custom/index.js.map +1 -0
- package/dist/src/decorators/handlers/index.d.ts +30 -0
- package/dist/src/decorators/handlers/index.d.ts.map +1 -0
- package/dist/src/decorators/handlers/index.js +121 -0
- package/dist/src/decorators/handlers/index.js.map +1 -0
- package/dist/src/decorators/has-stream.d.ts +11 -0
- package/dist/src/decorators/has-stream.d.ts.map +1 -0
- package/dist/src/decorators/has-stream.js +30 -0
- package/dist/src/decorators/has-stream.js.map +1 -0
- package/dist/src/decorators/index.d.ts +21 -0
- package/dist/src/decorators/index.d.ts.map +1 -0
- package/dist/src/decorators/index.js +21 -0
- package/dist/src/decorators/index.js.map +1 -0
- package/dist/src/decorators/open.d.ts +9 -0
- package/dist/src/decorators/open.d.ts.map +1 -0
- package/dist/src/decorators/open.js +19 -0
- package/dist/src/decorators/open.js.map +1 -0
- package/dist/src/decorators/order-by.d.ts +11 -0
- package/dist/src/decorators/order-by.d.ts.map +1 -0
- package/dist/src/decorators/order-by.js +17 -0
- package/dist/src/decorators/order-by.js.map +1 -0
- package/dist/src/decorators/private-preview-definition.d.ts +19 -0
- package/dist/src/decorators/private-preview-definition.d.ts.map +1 -0
- package/dist/src/decorators/private-preview-definition.js +15 -0
- package/dist/src/decorators/private-preview-definition.js.map +1 -0
- package/dist/src/decorators/private-preview.d.ts +9 -0
- package/dist/src/decorators/private-preview.d.ts.map +1 -0
- package/dist/src/decorators/private-preview.js +25 -0
- package/dist/src/decorators/private-preview.js.map +1 -0
- package/dist/src/decorators/read-only.d.ts +9 -0
- package/dist/src/decorators/read-only.d.ts.map +1 -0
- package/dist/src/decorators/read-only.js +13 -0
- package/dist/src/decorators/read-only.js.map +1 -0
- package/dist/src/decorators/references.d.ts +9 -0
- package/dist/src/decorators/references.d.ts.map +1 -0
- package/dist/src/decorators/references.js +13 -0
- package/dist/src/decorators/references.js.map +1 -0
- package/dist/src/decorators/routed-interfaces.d.ts +19 -0
- package/dist/src/decorators/routed-interfaces.d.ts.map +1 -0
- package/dist/src/decorators/routed-interfaces.js +43 -0
- package/dist/src/decorators/routed-interfaces.js.map +1 -0
- package/dist/src/decorators/search.d.ts +8 -0
- package/dist/src/decorators/search.d.ts.map +1 -0
- package/dist/src/decorators/search.js +12 -0
- package/dist/src/decorators/search.js.map +1 -0
- package/dist/src/decorators/skip.d.ts +8 -0
- package/dist/src/decorators/skip.d.ts.map +1 -0
- package/dist/src/decorators/skip.js +12 -0
- package/dist/src/decorators/skip.js.map +1 -0
- package/dist/src/decorators/top.d.ts +8 -0
- package/dist/src/decorators/top.d.ts.map +1 -0
- package/dist/src/decorators/top.js +12 -0
- package/dist/src/decorators/top.js.map +1 -0
- package/dist/src/decorators/write-only.d.ts +9 -0
- package/dist/src/decorators/write-only.d.ts.map +1 -0
- package/dist/src/decorators/write-only.js +13 -0
- package/dist/src/decorators/write-only.js.map +1 -0
- package/dist/src/dom/reconciler.d.ts +10 -0
- package/dist/src/dom/reconciler.d.ts.map +1 -0
- package/dist/src/dom/reconciler.js +95 -0
- package/dist/src/dom/reconciler.js.map +1 -0
- package/dist/src/dom/renderer.d.ts +6 -0
- package/dist/src/dom/renderer.d.ts.map +1 -0
- package/dist/src/dom/renderer.js +33 -0
- package/dist/src/dom/renderer.js.map +1 -0
- package/dist/src/dom/types.d.ts +33 -0
- package/dist/src/dom/types.d.ts.map +1 -0
- package/dist/src/dom/types.js +2 -0
- package/dist/src/dom/types.js.map +1 -0
- package/dist/src/emitter.d.ts +4 -0
- package/dist/src/emitter.d.ts.map +1 -0
- package/dist/src/emitter.js +11 -0
- package/dist/src/emitter.js.map +1 -0
- package/dist/src/index.d.ts +7 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +7 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib.d.ts +138 -0
- package/dist/src/lib.d.ts.map +1 -0
- package/dist/src/lib.js +55 -0
- package/dist/src/lib.js.map +1 -0
- package/dist/src/linter.d.ts +3 -0
- package/dist/src/linter.d.ts.map +1 -0
- package/dist/src/linter.js +35 -0
- package/dist/src/linter.js.map +1 -0
- package/dist/src/rules/abstract.d.ts +5 -0
- package/dist/src/rules/abstract.d.ts.map +1 -0
- package/dist/src/rules/abstract.js +31 -0
- package/dist/src/rules/abstract.js.map +1 -0
- package/dist/src/rules/alternate-key.d.ts +4 -0
- package/dist/src/rules/alternate-key.d.ts.map +1 -0
- package/dist/src/rules/alternate-key.js +81 -0
- package/dist/src/rules/alternate-key.js.map +1 -0
- package/dist/src/rules/computed.d.ts +7 -0
- package/dist/src/rules/computed.d.ts.map +1 -0
- package/dist/src/rules/computed.js +47 -0
- package/dist/src/rules/computed.js.map +1 -0
- package/dist/src/rules/contains.d.ts +5 -0
- package/dist/src/rules/contains.d.ts.map +1 -0
- package/dist/src/rules/contains.js +32 -0
- package/dist/src/rules/contains.js.map +1 -0
- package/dist/src/rules/count.d.ts +5 -0
- package/dist/src/rules/count.d.ts.map +1 -0
- package/dist/src/rules/count.js +35 -0
- package/dist/src/rules/count.js.map +1 -0
- package/dist/src/rules/entity.d.ts +2 -0
- package/dist/src/rules/entity.d.ts.map +1 -0
- package/dist/src/rules/entity.js +31 -0
- package/dist/src/rules/entity.js.map +1 -0
- package/dist/src/rules/expand.d.ts +3 -0
- package/dist/src/rules/expand.d.ts.map +1 -0
- package/dist/src/rules/expand.js +69 -0
- package/dist/src/rules/expand.js.map +1 -0
- package/dist/src/rules/has-stream.d.ts +2 -0
- package/dist/src/rules/has-stream.d.ts.map +1 -0
- package/dist/src/rules/has-stream.js +29 -0
- package/dist/src/rules/has-stream.js.map +1 -0
- package/dist/src/rules/index.d.ts +21 -0
- package/dist/src/rules/index.d.ts.map +1 -0
- package/dist/src/rules/index.js +176 -0
- package/dist/src/rules/index.js.map +1 -0
- package/dist/src/rules/open.d.ts +5 -0
- package/dist/src/rules/open.d.ts.map +1 -0
- package/dist/src/rules/open.js +31 -0
- package/dist/src/rules/open.js.map +1 -0
- package/dist/src/rules/order-by.d.ts +3 -0
- package/dist/src/rules/order-by.d.ts.map +1 -0
- package/dist/src/rules/order-by.js +69 -0
- package/dist/src/rules/order-by.js.map +1 -0
- package/dist/src/rules/references.d.ts +5 -0
- package/dist/src/rules/references.d.ts.map +1 -0
- package/dist/src/rules/references.js +32 -0
- package/dist/src/rules/references.js.map +1 -0
- package/dist/src/rules/search.d.ts +5 -0
- package/dist/src/rules/search.d.ts.map +1 -0
- package/dist/src/rules/search.js +35 -0
- package/dist/src/rules/search.js.map +1 -0
- package/dist/src/rules/skip.d.ts +5 -0
- package/dist/src/rules/skip.d.ts.map +1 -0
- package/dist/src/rules/skip.js +35 -0
- package/dist/src/rules/skip.js.map +1 -0
- package/dist/src/rules/top.d.ts +5 -0
- package/dist/src/rules/top.d.ts.map +1 -0
- package/dist/src/rules/top.js +35 -0
- package/dist/src/rules/top.js.map +1 -0
- package/dist/src/testing/index.d.ts +3 -0
- package/dist/src/testing/index.d.ts.map +1 -0
- package/dist/src/testing/index.js +24 -0
- package/dist/src/testing/index.js.map +1 -0
- package/dist/src/utils.d.ts +27 -0
- package/dist/src/utils.d.ts.map +1 -0
- package/dist/src/utils.js +186 -0
- package/dist/src/utils.js.map +1 -0
- package/lib/decorators.tsp +164 -0
- package/lib/lib.tsp +35 -0
- package/lib/msgraph.tsp +2 -0
- package/package.json +68 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE
|
package/README.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# TypeSpec MSGraph Csdl emitter
|
|
2
|
+
|
|
3
|
+
## See also
|
|
4
|
+
|
|
5
|
+
- [TypeSpec Getting Started](https://github.com/microsoft/typespec#getting-started)
|
|
6
|
+
- [TypeSpec Tutorial](https://github.com/microsoft/typespec/blob/main/docs/tutorial.md)
|
|
7
|
+
- [TypeSpec for the OpenAPI Developer](https://github.com/microsoft/typespec/blob/main/docs/typespec-for-openapi-dev.md)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acceptable-media-types-annotation.d.ts","sourceRoot":"","sources":["../../../src/components/acceptable-media-types-annotation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAc,EAAE,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAK7D,eAAO,MAAM,8BAA8B,EAAE,iBAAiB,CAAC;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAkB7E,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { getStreamTypes } from "../index.js";
|
|
3
|
+
import { AnnotationElement, CollectionElement, StringElement } from "./common-elements.js";
|
|
4
|
+
import { ProgramContext } from "./program-context.js";
|
|
5
|
+
export const AcceptableMediaTypesAnnotation = ({ item }) => {
|
|
6
|
+
const program = useContext(ProgramContext);
|
|
7
|
+
const streamTypes = getStreamTypes(program, item);
|
|
8
|
+
if (!streamTypes.length) {
|
|
9
|
+
return React.createElement(React.Fragment, null);
|
|
10
|
+
}
|
|
11
|
+
return (React.createElement(AnnotationElement, { Term: "Org.OData.Core.V1.AcceptableMediaTypes" },
|
|
12
|
+
React.createElement(CollectionElement, null, streamTypes.map((type, index) => (React.createElement(StringElement, { key: index },
|
|
13
|
+
React.createElement(React.Fragment, null, type)))))));
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=acceptable-media-types-annotation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acceptable-media-types-annotation.js","sourceRoot":"","sources":["../../../src/components/acceptable-media-types-annotation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAqB,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,CAAC,MAAM,8BAA8B,GAAuC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAC7F,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC3C,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAElD,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;QACvB,OAAO,yCAAK,CAAC;KACd;IACD,OAAO,CACL,oBAAC,iBAAiB,IAAC,IAAI,EAAC,wCAAwC;QAC9D,oBAAC,iBAAiB,QACf,WAAW,CAAC,GAAG,CAAC,CAAC,IAAY,EAAE,KAAa,EAAE,EAAE,CAAC,CAChD,oBAAC,aAAa,IAAC,GAAG,EAAE,KAAK;YACvB,0CAAG,IAAI,CAAI,CACG,CACjB,CAAC,CACgB,CACF,CACrB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alternate-keys-annotation.d.ts","sourceRoot":"","sources":["../../../src/components/alternate-keys-annotation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAiB,MAAM,oBAAoB,CAAC;AAC1D,OAAc,EAAE,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAU7D,eAAO,MAAM,uBAAuB,EAAE,iBAAiB,CAAC;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CA0BvE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { isAlternateKey, isComplex } from "../index.js";
|
|
3
|
+
import { AnnotationElement, CollectionElement, PropertyValueElement, RecordElement, } from "./common-elements.js";
|
|
4
|
+
import { ProgramContext } from "./program-context.js";
|
|
5
|
+
export const AlternateKeysAnnotation = ({ model }) => {
|
|
6
|
+
const program = useContext(ProgramContext);
|
|
7
|
+
const alternateKeys = [...model.properties.entries()]
|
|
8
|
+
.filter(([_, v]) => isAlternateKey(program, v))
|
|
9
|
+
.reduce((prev, [_, prop]) => [...prev, prop], []);
|
|
10
|
+
if (!alternateKeys.length) {
|
|
11
|
+
return React.createElement(React.Fragment, null);
|
|
12
|
+
}
|
|
13
|
+
return (React.createElement(AnnotationElement, { Term: "Org.OData.Core.V1.AlternateKeys" },
|
|
14
|
+
React.createElement(CollectionElement, null, alternateKeys.map((key) => (React.createElement(RecordElement, { Type: "Org.OData.Core.V1.AlternateKey", key: key.name },
|
|
15
|
+
React.createElement(PropertyValueElement, { Property: "Key" },
|
|
16
|
+
React.createElement(CollectionElement, null,
|
|
17
|
+
React.createElement(AlternateKeyRecord, { property: key })))))))));
|
|
18
|
+
};
|
|
19
|
+
const AlternateKeyRecord = ({ property }) => {
|
|
20
|
+
const program = useContext(ProgramContext);
|
|
21
|
+
if (property.type.kind !== "Model" || !isComplex(program, property.type)) {
|
|
22
|
+
return (React.createElement(RecordElement, { Type: "Org.OData.Core.V1.PropertyRef" },
|
|
23
|
+
React.createElement(PropertyValueElement, { Property: "Name", PropertyPath: property.name })));
|
|
24
|
+
}
|
|
25
|
+
const props = [...property.type.properties.entries()].reduce((prev, [_, prop]) => [...prev, prop], []);
|
|
26
|
+
return (React.createElement(React.Fragment, null, props.map((prop) => (React.createElement(RecordElement, { Type: "Org.OData.Core.V1.PropertyRef", key: prop.name },
|
|
27
|
+
React.createElement(PropertyValueElement, { Property: "Name", PropertyPath: `${property.name}/${prop.name}` }),
|
|
28
|
+
React.createElement(PropertyValueElement, { Property: "Alias", String: prop.name }))))));
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=alternate-keys-annotation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alternate-keys-annotation.js","sourceRoot":"","sources":["../../../src/components/alternate-keys-annotation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAqB,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,CAAC,MAAM,uBAAuB,GAAwC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACxF,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAE3C,MAAM,aAAa,GAAG,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;SAClD,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;SAC9C,MAAM,CAAkB,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAErE,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE;QACzB,OAAO,yCAAK,CAAC;KACd;IAED,OAAO,CACL,oBAAC,iBAAiB,IAAC,IAAI,EAAC,iCAAiC;QACvD,oBAAC,iBAAiB,QACf,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAC1B,oBAAC,aAAa,IAAC,IAAI,EAAC,gCAAgC,EAAC,GAAG,EAAE,GAAG,CAAC,IAAI;YAChE,oBAAC,oBAAoB,IAAC,QAAQ,EAAC,KAAK;gBAClC,o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,128 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
interface AnnotationProps {
|
|
3
|
+
Term: string;
|
|
4
|
+
String?: string;
|
|
5
|
+
Bool?: string;
|
|
6
|
+
children?: any;
|
|
7
|
+
}
|
|
8
|
+
export declare const AnnotationElement: (props: AnnotationProps) => React.DOMElement<AnnotationProps, Element>;
|
|
9
|
+
export declare const AnnotationEnumMemberElement: (props: {
|
|
10
|
+
children?: any;
|
|
11
|
+
}) => React.DOMElement<{
|
|
12
|
+
children?: any;
|
|
13
|
+
}, Element>;
|
|
14
|
+
export declare const CollectionElement: (props: {
|
|
15
|
+
children: any;
|
|
16
|
+
}) => React.DOMElement<{
|
|
17
|
+
children: any;
|
|
18
|
+
}, Element>;
|
|
19
|
+
export declare const RecordElement: (props: {
|
|
20
|
+
Type?: string;
|
|
21
|
+
children: any;
|
|
22
|
+
}) => React.DOMElement<{
|
|
23
|
+
Type?: string | undefined;
|
|
24
|
+
children: any;
|
|
25
|
+
}, Element>;
|
|
26
|
+
export declare const StringElement: (props: {
|
|
27
|
+
children: any;
|
|
28
|
+
}) => React.DOMElement<{
|
|
29
|
+
children: any;
|
|
30
|
+
}, Element>;
|
|
31
|
+
export declare const NavigationPropertyPathElement: (props: {
|
|
32
|
+
children: any;
|
|
33
|
+
}) => React.DOMElement<{
|
|
34
|
+
children: any;
|
|
35
|
+
}, Element>;
|
|
36
|
+
export declare const PropertyPathElement: (props: {
|
|
37
|
+
children: any;
|
|
38
|
+
}) => React.DOMElement<{
|
|
39
|
+
children: any;
|
|
40
|
+
}, Element>;
|
|
41
|
+
interface PropertyValueProps {
|
|
42
|
+
Property: string;
|
|
43
|
+
Date?: string;
|
|
44
|
+
EnumMember?: string;
|
|
45
|
+
String?: string;
|
|
46
|
+
Bool?: string;
|
|
47
|
+
PropertyPath?: string;
|
|
48
|
+
children?: any;
|
|
49
|
+
}
|
|
50
|
+
export declare const PropertyValueElement: (props: PropertyValueProps) => React.DOMElement<PropertyValueProps, Element>;
|
|
51
|
+
interface EnumMemberProps {
|
|
52
|
+
Name: string;
|
|
53
|
+
Value?: string | number | undefined;
|
|
54
|
+
children?: any;
|
|
55
|
+
}
|
|
56
|
+
export declare const EnumMemberElement: (props: EnumMemberProps) => React.DOMElement<EnumMemberProps, Element>;
|
|
57
|
+
interface EnumTypeProps {
|
|
58
|
+
Name: string;
|
|
59
|
+
children: any;
|
|
60
|
+
}
|
|
61
|
+
export declare const EnumTypeElement: (props: EnumTypeProps) => React.DOMElement<EnumTypeProps, Element>;
|
|
62
|
+
export declare const PropertyRefElement: (props: {
|
|
63
|
+
Name: string;
|
|
64
|
+
}) => React.ReactElement<{
|
|
65
|
+
Name: string;
|
|
66
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
67
|
+
interface ActionProps {
|
|
68
|
+
Name: string;
|
|
69
|
+
IsBound: string;
|
|
70
|
+
children: any;
|
|
71
|
+
}
|
|
72
|
+
export declare const ActionElement: (props: ActionProps) => React.DOMElement<ActionProps, Element>;
|
|
73
|
+
interface FunctionProps {
|
|
74
|
+
Name: string;
|
|
75
|
+
IsBound: string;
|
|
76
|
+
children: any;
|
|
77
|
+
}
|
|
78
|
+
export declare const FunctionElement: (props: FunctionProps) => React.DOMElement<FunctionProps, Element>;
|
|
79
|
+
interface ParameterProps {
|
|
80
|
+
Name: string;
|
|
81
|
+
Type: string;
|
|
82
|
+
Nullable?: string;
|
|
83
|
+
children?: any;
|
|
84
|
+
}
|
|
85
|
+
export declare const ParameterElement: (props: ParameterProps) => React.DOMElement<ParameterProps, Element>;
|
|
86
|
+
export declare const ReturnTypeElement: (props: {
|
|
87
|
+
Type: string;
|
|
88
|
+
Nullable?: string;
|
|
89
|
+
}) => React.ReactElement<{
|
|
90
|
+
Type: string;
|
|
91
|
+
Nullable?: string | undefined;
|
|
92
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
93
|
+
interface EntityContainerProps {
|
|
94
|
+
Name?: string;
|
|
95
|
+
children: any;
|
|
96
|
+
}
|
|
97
|
+
export declare const EntityContainerElement: (props: EntityContainerProps) => React.DOMElement<EntityContainerProps, Element>;
|
|
98
|
+
interface SingletonProps {
|
|
99
|
+
Name: string;
|
|
100
|
+
Type: string;
|
|
101
|
+
children?: any;
|
|
102
|
+
}
|
|
103
|
+
export declare const SingletonElement: (props: SingletonProps) => React.DOMElement<SingletonProps, Element>;
|
|
104
|
+
interface EntitySetProps {
|
|
105
|
+
Name: string;
|
|
106
|
+
EntityType: string;
|
|
107
|
+
children?: any;
|
|
108
|
+
}
|
|
109
|
+
export declare const EntitySetElement: (props: EntitySetProps) => React.DOMElement<EntitySetProps, Element>;
|
|
110
|
+
interface SchemaProps {
|
|
111
|
+
Namespace: string;
|
|
112
|
+
Alias?: string;
|
|
113
|
+
children: any;
|
|
114
|
+
}
|
|
115
|
+
export declare const SchemaElement: (props: SchemaProps) => React.DOMElement<{
|
|
116
|
+
xmlns: string;
|
|
117
|
+
"xmlns:ags": string;
|
|
118
|
+
Namespace: string;
|
|
119
|
+
Alias?: string | undefined;
|
|
120
|
+
children: any;
|
|
121
|
+
}, Element>;
|
|
122
|
+
interface ItemListProps<T> {
|
|
123
|
+
items: Map<string, T> | T[];
|
|
124
|
+
render: (t: T) => ReactElement<any, any> | null;
|
|
125
|
+
}
|
|
126
|
+
export declare const ItemList: <T extends object>(props: ItemListProps<T>) => JSX.Element;
|
|
127
|
+
export {};
|
|
128
|
+
//# sourceMappingURL=common-elements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-elements.d.ts","sourceRoot":"","sources":["../../../src/components/common-elements.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE5C,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,GAAG,CAAC;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UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB;AACD,eAAO,MAAM,gBAAgB,UAAW,cAAc,8CAA4C,CAAC;AAEnG,UAAU,WAAW;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;CACf;AAED,eAAO,MAAM,aAAa,UAAW,WAAW;;;eALnC,MAAM;;cAEP,GAAG;WAQX,CAAC;AAEL,UAAU,aAAa,CAAC,CAAC;IACvB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAC5B,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;CACjD;AAED,eAAO,MAAM,QAAQ,4DAiBpB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export const AnnotationElement = (props) => React.createElement("Annotation", props);
|
|
3
|
+
export const AnnotationEnumMemberElement = (props) => React.createElement("EnumMember", props);
|
|
4
|
+
export const CollectionElement = (props) => React.createElement("Collection", props);
|
|
5
|
+
export const RecordElement = (props) => React.createElement("Record", props);
|
|
6
|
+
export const StringElement = (props) => React.createElement("String", props);
|
|
7
|
+
export const NavigationPropertyPathElement = (props) => React.createElement("NavigationPropertyPath", props);
|
|
8
|
+
export const PropertyPathElement = (props) => React.createElement("PropertyPath", props);
|
|
9
|
+
export const PropertyValueElement = (props) => React.createElement("PropertyValue", props);
|
|
10
|
+
export const EnumMemberElement = (props) => React.createElement("Member", props);
|
|
11
|
+
export const EnumTypeElement = (props) => React.createElement("EnumType", props);
|
|
12
|
+
export const PropertyRefElement = (props) => React.createElement("PropertyRef", props);
|
|
13
|
+
export const ActionElement = (props) => React.createElement("Action", props);
|
|
14
|
+
export const FunctionElement = (props) => React.createElement("Function", props);
|
|
15
|
+
export const ParameterElement = (props) => React.createElement("Parameter", props);
|
|
16
|
+
export const ReturnTypeElement = (props) => React.createElement("ReturnType", props);
|
|
17
|
+
export const EntityContainerElement = (props) => React.createElement("EntityContainer", props);
|
|
18
|
+
export const SingletonElement = (props) => React.createElement("Singleton", props);
|
|
19
|
+
export const EntitySetElement = (props) => React.createElement("EntitySet", props);
|
|
20
|
+
export const SchemaElement = (props) => React.createElement("Schema", {
|
|
21
|
+
...props,
|
|
22
|
+
xmlns: "http://docs.oasis-open.org/odata/ns/edm",
|
|
23
|
+
"xmlns:ags": "http://aggregator.microsoft.com/internal",
|
|
24
|
+
});
|
|
25
|
+
export const ItemList = (props) => {
|
|
26
|
+
if (Array.isArray(props.items)) {
|
|
27
|
+
if (props.items.length === 0) {
|
|
28
|
+
return React.createElement(React.Fragment, null);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
if (props.items.size === 0) {
|
|
33
|
+
return React.createElement(React.Fragment, null);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return (React.createElement(React.Fragment, null, [...props.items.entries()].map(([k, v]) => (React.createElement(React.Fragment, { key: k }, props.render(v))))));
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=common-elements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-elements.js","sourceRoot":"","sources":["../../../src/components/common-elements.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuB,MAAM,OAAO,CAAC;AAQ5C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAsB,EAAE,EAAE,CAC1D,KAAK,CAAC,aAAa,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AAE3C,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,KAAyB,EAAE,EAAE,CACvE,KAAK,CAAC,aAAa,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAA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AAC;SACd;KACF;IACD,OAAO,CACL,0CACG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAC1C,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,CAAC,IAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAkB,CAC3D,CAAC,CACD,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computed-annotation.d.ts","sourceRoot":"","sources":["../../../src/components/computed-annotation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAc,EAAE,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAK7D,eAAO,MAAM,kBAAkB,EAAE,iBAAiB,CAAC;IAAE,QAAQ,EAAE,aAAa,CAAA;CAAE,CAS7E,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { ProgramContext } from "./program-context.js";
|
|
3
|
+
import { AnnotationElement } from "./common-elements.js";
|
|
4
|
+
import { isComputed } from "../index.js";
|
|
5
|
+
export const ComputedAnnotation = ({ property: prop, }) => {
|
|
6
|
+
const program = useContext(ProgramContext);
|
|
7
|
+
if (!isComputed(program, prop)) {
|
|
8
|
+
return React.createElement(React.Fragment, null);
|
|
9
|
+
}
|
|
10
|
+
return React.createElement(AnnotationElement, { Term: "Org.OData.Core.V1.Computed", Bool: "true" });
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=computed-annotation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computed-annotation.js","sourceRoot":"","sources":["../../../src/components/computed-annotation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAqB,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,CAAC,MAAM,kBAAkB,GAAmD,CAAC,EACjF,QAAQ,EAAE,IAAI,GACf,EAAE,EAAE;IACH,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE;QAC9B,OAAO,yCAAK,CAAC;KACd;IAED,OAAO,oBAAC,iBAAiB,IAAC,IAAI,EAAC,4BAA4B,EAAC,IAAI,EAAC,MAAM,GAAG,CAAC;AAC7E,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"count-restrictions-annotation.d.ts","sourceRoot":"","sources":["../../../src/components/count-restrictions-annotation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAc,EAAE,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAK7D,eAAO,MAAM,2BAA2B,EAAE,iBAAiB,CAAC;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,CAiBnF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { isCount } from "../index.js";
|
|
3
|
+
import { AnnotationElement, PropertyValueElement, RecordElement } from "./common-elements.js";
|
|
4
|
+
import { ProgramContext } from "./program-context.js";
|
|
5
|
+
export const CountRestrictionsAnnotation = (props) => {
|
|
6
|
+
const program = useContext(ProgramContext);
|
|
7
|
+
const hasCountOperation = [...props.interface.operations].some(([_, operation]) => isCount(program, operation));
|
|
8
|
+
if (hasCountOperation) {
|
|
9
|
+
return React.createElement(React.Fragment, null);
|
|
10
|
+
}
|
|
11
|
+
return (React.createElement(AnnotationElement, { Term: "Org.OData.Core.V1.CountRestrictions" },
|
|
12
|
+
React.createElement(RecordElement, null,
|
|
13
|
+
React.createElement(PropertyValueElement, { Property: "Countable", Bool: "false" }))));
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=count-restrictions-annotation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"count-restrictions-annotation.js","sourceRoot":"","sources":["../../../src/components/count-restrictions-annotation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAqB,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,CAAC,MAAM,2BAA2B,GAAgD,CAAC,KAAK,EAAE,EAAE;IAChG,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC3C,MAAM,iBAAiB,GAAG,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,EAAE,CAChF,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAC5B,CAAC;IAEF,IAAI,iBAAiB,EAAE;QACrB,OAAO,yCAAK,CAAC;KACd;IAED,OAAO,CACL,oBAAC,iBAAiB,IAAC,IAAI,EAAC,qCAAqC;QAC3D,oBAAC,aAAa;YACZ,oBAAC,oBAAoB,IAAC,QAAQ,EAAC,WAAW,EAAC,IAAI,EAAC,OAAO,GAAG,CAC5C,CACE,CACrB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description-annotation.d.ts","sourceRoot":"","sources":["../../../src/components/description-annotation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,oBAAoB,CAAC;AAClD,OAAc,EAAE,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAI7D,eAAO,MAAM,qBAAqB,EAAE,iBAAiB,CAAC;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAOnE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getDoc } from "@typespec/compiler";
|
|
2
|
+
import React, { useContext } from "react";
|
|
3
|
+
import { AnnotationElement } from "./common-elements.js";
|
|
4
|
+
import { ProgramContext } from "./program-context.js";
|
|
5
|
+
export const DescriptionAnnotation = ({ type }) => {
|
|
6
|
+
const program = useContext(ProgramContext);
|
|
7
|
+
const text = getDoc(program, type);
|
|
8
|
+
if (text) {
|
|
9
|
+
return React.createElement(AnnotationElement, { Term: "Org.OData.Core.V1.Description", String: text });
|
|
10
|
+
}
|
|
11
|
+
return React.createElement(React.Fragment, null);
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=description-annotation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description-annotation.js","sourceRoot":"","sources":["../../../src/components/description-annotation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,EAAqB,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,CAAC,MAAM,qBAAqB,GAAsC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IACnF,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC3C,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACnC,IAAI,IAAI,EAAE;QACR,OAAO,oBAAC,iBAAiB,IAAC,IAAI,EAAC,+BAA+B,EAAC,MAAM,EAAE,IAAI,GAAI,CAAC;KACjF;IACD,OAAO,yCAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Interface, Model } from "@typespec/compiler";
|
|
2
|
+
import { FunctionComponent } from "react";
|
|
3
|
+
export declare const ExpandRestrictionsAnnotation: FunctionComponent<{
|
|
4
|
+
interface: Interface;
|
|
5
|
+
model: Model;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=expand-restrictions-annotation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expand-restrictions-annotation.d.ts","sourceRoot":"","sources":["../../../src/components/expand-restrictions-annotation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAA2B,MAAM,oBAAoB,CAAC;AAE/E,OAAc,EAAE,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAa7D,eAAO,MAAM,4BAA4B,EAAE,iBAAiB,CAAC;IAC3D,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;CACd,CAgDA,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { walkPropertiesInherited } from "@typespec/compiler";
|
|
2
|
+
import { getOperationVerb } from "@typespec/http";
|
|
3
|
+
import React, { useContext } from "react";
|
|
4
|
+
import { ProgramContext } from "./program-context.js";
|
|
5
|
+
import { getExpand, isContains, isExpand, isReferences } from "../index.js";
|
|
6
|
+
import { AnnotationElement, CollectionElement, NavigationPropertyPathElement, PropertyValueElement, RecordElement, } from "./common-elements.js";
|
|
7
|
+
export const ExpandRestrictionsAnnotation = (props) => {
|
|
8
|
+
const program = useContext(ProgramContext);
|
|
9
|
+
const expandedOperation = [...props.interface.operations].find(([_, operation]) => getOperationVerb(program, operation) === "get" &&
|
|
10
|
+
operation.parameters.properties.size === 0 &&
|
|
11
|
+
isExpand(program, operation));
|
|
12
|
+
if (!expandedOperation) {
|
|
13
|
+
return (React.createElement(AnnotationElement, { Term: "Org.OData.Capabilities.V1.ExpandRestrictions" },
|
|
14
|
+
React.createElement(RecordElement, null,
|
|
15
|
+
React.createElement(PropertyValueElement, { Property: "Expandable", Bool: "false" }))));
|
|
16
|
+
}
|
|
17
|
+
// Destructuring to get the operation from the [string, Operation] expandedOperation tuple
|
|
18
|
+
const [_, operation] = expandedOperation;
|
|
19
|
+
const expandableProperties = getExpand(program, operation);
|
|
20
|
+
const navigationProperties = [...walkPropertiesInherited(props.model)]
|
|
21
|
+
.filter((property) => isContains(program, property) || isReferences(program, property))
|
|
22
|
+
.map((property) => property.name);
|
|
23
|
+
const nonExpandableProperties = navigationProperties.filter((property) => !expandableProperties.includes(property));
|
|
24
|
+
return (React.createElement(AnnotationElement, { Term: "Org.OData.Capabilities.V1.ExpandRestrictions" },
|
|
25
|
+
React.createElement(RecordElement, null,
|
|
26
|
+
React.createElement(PropertyValueElement, { Property: "Expandable", Bool: "true" }),
|
|
27
|
+
React.createElement(PropertyValueElement, { Property: "NonExpandableProperties" },
|
|
28
|
+
React.createElement(CollectionElement, null, nonExpandableProperties.map((property) => (React.createElement(NavigationPropertyPathElement, { key: property },
|
|
29
|
+
React.createElement(React.Fragment, null, property)))))))));
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=expand-restrictions-annotation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expand-restrictions-annotation.js","sourceRoot":"","sources":["../../../src/components/expand-restrictions-annotation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,EAAqB,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,E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IAEpC,MAAM,uBAAuB,GAAG,oBAAoB,CAAC,MAAM,CACzD,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,oBAAoB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CACvD,CAAC;IAEF,OAAO,CACL,oBAAC,iBAAiB,IAAC,IAAI,EAAC,8CAA8C;QACpE,oBAAC,aAAa;YACZ,oBAAC,oBAAoB,IAAC,QAAQ,EAAC,YAAY,EAAC,IAAI,EAAC,MAAM,GAAG;YAC1D,oBAAC,oBAAoB,IAAC,QAAQ,EAAC,yBAAyB;gBACtD,oBAAC,iBAAiB,QACf,uBAAuB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CACzC,oBAAC,6BAA6B,IAAC,GAAG,EAAE,QAAQ;oBAC1C,0CAAG,QAAQ,CAAI,CACe,CACjC,CAAC,CACgB,CACC,CACT,CACE,CACrB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from "./acceptable-media-types-annotation.js";
|
|
2
|
+
export * from "./alternate-keys-annotation.js";
|
|
3
|
+
export * from "./common-elements.js";
|
|
4
|
+
export * from "./computed-annotation.js";
|
|
5
|
+
export * from "./count-restrictions-annotation.js";
|
|
6
|
+
export * from "./description-annotation.js";
|
|
7
|
+
export * from "./expand-restrictions-annotation.js";
|
|
8
|
+
export * from "./permissions-annotation.js";
|
|
9
|
+
export * from "./revisions-annotation.js";
|
|
10
|
+
export * from "./search-restrictions-annotation.js";
|
|
11
|
+
export * from "./skip-supported-annotation.js";
|
|
12
|
+
export * from "./sort-restrictions-annotation.js";
|
|
13
|
+
export * from "./structured-type-element.js";
|
|
14
|
+
export * from "./top-supported-annotation.js";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC;AACvD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from "./acceptable-media-types-annotation.js";
|
|
2
|
+
export * from "./alternate-keys-annotation.js";
|
|
3
|
+
export * from "./common-elements.js";
|
|
4
|
+
export * from "./computed-annotation.js";
|
|
5
|
+
export * from "./count-restrictions-annotation.js";
|
|
6
|
+
export * from "./description-annotation.js";
|
|
7
|
+
export * from "./expand-restrictions-annotation.js";
|
|
8
|
+
export * from "./permissions-annotation.js";
|
|
9
|
+
export * from "./revisions-annotation.js";
|
|
10
|
+
export * from "./search-restrictions-annotation.js";
|
|
11
|
+
export * from "./skip-supported-annotation.js";
|
|
12
|
+
export * from "./sort-restrictions-annotation.js";
|
|
13
|
+
export * from "./structured-type-element.js";
|
|
14
|
+
export * from "./top-supported-annotation.js";
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC;AACvD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions-annotation.d.ts","sourceRoot":"","sources":["../../../src/components/permissions-annotation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAc,EAAE,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAK7D,eAAO,MAAM,qBAAqB,EAAE,iBAAiB,CAAC;IAAE,QAAQ,EAAE,aAAa,CAAA;CAAE,CAsBhF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { isReadOnly, isWriteOnly } from "../index.js";
|
|
3
|
+
import { AnnotationElement, AnnotationEnumMemberElement } from "./common-elements.js";
|
|
4
|
+
import { ProgramContext } from "./program-context.js";
|
|
5
|
+
export const PermissionsAnnotation = ({ property, }) => {
|
|
6
|
+
const program = useContext(ProgramContext);
|
|
7
|
+
const permission = isReadOnly(program, property)
|
|
8
|
+
? "Read"
|
|
9
|
+
: isWriteOnly(program, property)
|
|
10
|
+
? "Write"
|
|
11
|
+
: null;
|
|
12
|
+
if (!permission) {
|
|
13
|
+
return React.createElement(React.Fragment, null);
|
|
14
|
+
}
|
|
15
|
+
return (React.createElement(AnnotationElement, { Term: "Org.OData.Core.V1.Permissions" },
|
|
16
|
+
React.createElement(AnnotationEnumMemberElement, null,
|
|
17
|
+
"Org.OData.Core.V1.Permission/",
|
|
18
|
+
permission)));
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=permissions-annotation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions-annotation.js","sourceRoot":"","sources":["../../../src/components/permissions-annotation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAqB,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,CAAC,MAAM,qBAAqB,GAAmD,CAAC,EACpF,QAAQ,GACT,EAAE,EAAE;IACH,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAE3C,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC;QAC9C,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC;YAChC,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,IAAI,CAAC;IAET,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,yCAAK,CAAC;KACd;IAED,OAAO,CACL,oBAAC,iBAAiB,IAAC,IAAI,EAAC,+BAA+B;QACrD,oBAAC,2BAA2B;;YACI,UAAU,CACZ,CACZ,CACrB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program-context.d.ts","sourceRoot":"","sources":["../../../src/components/program-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,cAAc,wBAA0C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program-context.js","sourceRoot":"","sources":["../../../src/components/program-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,aAAa,CAAU,EAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-element.d.ts","sourceRoot":"","sources":["../../../src/components/property-element.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAc,EAAE,iBAAiB,EAAc,MAAM,OAAO,CAAC;AA0B7D,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC;IAAE,QAAQ,EAAE,aAAa,CAAA;CAAE,CAS1E,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { buildAttributes, isContains } from "../index.js";
|
|
3
|
+
import { getPropertyTypeName, isNavigationProperty, isTypeNullable } from "../utils.js";
|
|
4
|
+
import { ComputedAnnotation } from "./computed-annotation.js";
|
|
5
|
+
import { DescriptionAnnotation } from "./description-annotation.js";
|
|
6
|
+
import { PermissionsAnnotation } from "./permissions-annotation.js";
|
|
7
|
+
import { ProgramContext } from "./program-context.js";
|
|
8
|
+
import { RevisionsAnnotation } from "./revisions-annotation.js";
|
|
9
|
+
const Property = (props) => React.createElement("Property", props);
|
|
10
|
+
const NavigationProperty = (props) => React.createElement("NavigationProperty", props);
|
|
11
|
+
export const PropertyElement = ({ property }) => {
|
|
12
|
+
const program = useContext(ProgramContext);
|
|
13
|
+
const isNavigation = isNavigationProperty(program, property);
|
|
14
|
+
if (isNavigation) {
|
|
15
|
+
return React.createElement(NavigationPropertyElement, { property: property });
|
|
16
|
+
}
|
|
17
|
+
return React.createElement(StructuralPropertyElement, { property: property });
|
|
18
|
+
};
|
|
19
|
+
const NavigationPropertyElement = ({ property, }) => {
|
|
20
|
+
var _a;
|
|
21
|
+
const program = useContext(ProgramContext);
|
|
22
|
+
const isContained = isContains(program, property);
|
|
23
|
+
const agsAttributes = buildAttributes(program, property);
|
|
24
|
+
const propType = getPropertyTypeName(program, property.type);
|
|
25
|
+
return (React.createElement(NavigationProperty, { Name: property.name, Type: propType, ...(isContained ? { ContainsTarget: "true" } : {}), ...agsAttributes },
|
|
26
|
+
React.createElement(RevisionsAnnotation, { item: property, namespace: (_a = property.model) === null || _a === void 0 ? void 0 : _a.namespace }),
|
|
27
|
+
React.createElement(DescriptionAnnotation, { type: property })));
|
|
28
|
+
};
|
|
29
|
+
const StructuralPropertyElement = ({ property, }) => {
|
|
30
|
+
var _a;
|
|
31
|
+
const program = useContext(ProgramContext);
|
|
32
|
+
const isNullable = isTypeNullable(program, property.type);
|
|
33
|
+
const agsAttributes = buildAttributes(program, property);
|
|
34
|
+
const propType = getPropertyTypeName(program, property.type);
|
|
35
|
+
return (React.createElement(Property, { Name: property.name, Type: propType, ...(isNullable ? {} : { Nullable: "false" }), ...agsAttributes },
|
|
36
|
+
React.createElement(ComputedAnnotation, { property: property }),
|
|
37
|
+
React.createElement(PermissionsAnnotation, { property: property }),
|
|
38
|
+
React.createElement(RevisionsAnnotation, { item: property, namespace: (_a = property.model) === null || _a === void 0 ? void 0 : _a.namespace }),
|
|
39
|
+
React.createElement(DescriptionAnnotation, { type: property })));
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=property-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-element.js","sourceRoot":"","sources":["../../../src/components/property-element.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAqB,UAAU,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAQhE,MAAM,Q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,0CAAE,SAAS,GAAI;QAC7E,oBAAC,qBAAqB,IAAC,IAAI,EAAE,QAAQ,GAAI,CACtB,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAmD,CAAC,EACjF,QAAQ,GACT,EAAE,EAAE;;IACH,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC3C,MAAM,UAAU,GAAG,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC1D,MAAM,aAAa,GAAG,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAG,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE7D,OAAO,CACL,oBAAC,QAAQ,IACP,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,IAAI,EAAE,QAAQ,KACV,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,KACzC,aAAa;QAEjB,oBAAC,kBAAkB,IAAC,QAAQ,EAAE,QAAQ,GAAI;QAC1C,oBAAC,qBAAqB,IAAC,QAAQ,EAAE,QAAQ,GAAI;QAC7C,oBAAC,mBAAmB,IAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAA,QAAQ,CAAC,KAAK,0CAAE,SAAS,GAAI;QAC7E,oBAAC,qBAAqB,IAAC,IAAI,EAAE,QAAQ,GAAI,CAChC,CACZ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Enum, EnumMember, Model, ModelProperty, Namespace, Operation } from "@typespec/compiler";
|
|
2
|
+
import { FunctionComponent } from "react";
|
|
3
|
+
export declare const RevisionsAnnotation: FunctionComponent<{
|
|
4
|
+
item: Model | ModelProperty | EnumMember | Enum | Operation | Namespace;
|
|
5
|
+
namespace: Namespace | undefined;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=revisions-annotation.d.ts.map
|