@microsoft/typespec-msgraph 0.0.1-Preview.2 → 0.0.1-Preview.4
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 +5 -13
- package/dist/src/components/alternate-keys-annotation.js.map +1 -1
- package/dist/src/components/common-elements.d.ts +0 -71
- package/dist/src/components/common-elements.d.ts.map +1 -1
- package/dist/src/components/common-elements.js +10 -24
- 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 +2 -6
- 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 +4 -11
- package/dist/src/components/description-annotation.js.map +1 -1
- package/dist/src/components/entity-container-element.d.ts +6 -0
- package/dist/src/components/entity-container-element.d.ts.map +1 -0
- package/dist/src/components/entity-container-element.js +58 -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 +5 -20
- package/dist/src/components/expand-restrictions-annotation.js.map +1 -1
- 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/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 +14 -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 +38 -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 +2 -6
- 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 -6
- 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 +5 -20
- package/dist/src/components/sort-restrictions-annotation.js.map +1 -1
- package/dist/src/components/structured-type-element.d.ts +10 -4
- package/dist/src/components/structured-type-element.d.ts.map +1 -1
- package/dist/src/components/structured-type-element.js +18 -58
- 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 +2 -6
- package/dist/src/components/top-supported-annotation.js.map +1 -1
- 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/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/decorator-parameter.d.ts +4 -0
- package/dist/src/decorators/decorator-parameter.d.ts.map +1 -0
- package/dist/src/decorators/decorator-parameter.js +2 -0
- package/dist/src/decorators/decorator-parameter.js.map +1 -0
- package/dist/src/decorators/deprecated-definition.d.ts +4 -3
- package/dist/src/decorators/deprecated-definition.d.ts.map +1 -1
- package/dist/src/decorators/deprecated-definition.js +7 -1
- package/dist/src/decorators/deprecated-definition.js.map +1 -1
- 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/expand.d.ts +2 -1
- package/dist/src/decorators/expand.d.ts.map +1 -1
- package/dist/src/decorators/expand.js +1 -1
- package/dist/src/decorators/expand.js.map +1 -1
- package/dist/src/decorators/function.d.ts +11 -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/handlers/custom/additional-query-parameters.d.ts +2 -1
- package/dist/src/decorators/handlers/custom/additional-query-parameters.d.ts.map +1 -1
- package/dist/src/decorators/handlers/custom/additional-query-parameters.js +3 -1
- package/dist/src/decorators/handlers/custom/additional-query-parameters.js.map +1 -1
- package/dist/src/decorators/handlers/custom/ags-attribute.d.ts +2 -1
- package/dist/src/decorators/handlers/custom/ags-attribute.d.ts.map +1 -1
- package/dist/src/decorators/handlers/custom/ags-attribute.js +3 -3
- package/dist/src/decorators/handlers/custom/ags-attribute.js.map +1 -1
- package/dist/src/decorators/handlers/index.d.ts +4 -3
- package/dist/src/decorators/handlers/index.d.ts.map +1 -1
- package/dist/src/decorators/handlers/index.js +4 -4
- package/dist/src/decorators/handlers/index.js.map +1 -1
- package/dist/src/decorators/has-stream.d.ts +3 -3
- package/dist/src/decorators/has-stream.d.ts.map +1 -1
- package/dist/src/decorators/has-stream.js +2 -15
- package/dist/src/decorators/has-stream.js.map +1 -1
- package/dist/src/decorators/index.d.ts +5 -1
- package/dist/src/decorators/index.d.ts.map +1 -1
- package/dist/src/decorators/index.js +5 -1
- package/dist/src/decorators/index.js.map +1 -1
- package/dist/src/decorators/open.d.ts.map +1 -1
- package/dist/src/decorators/open.js +0 -6
- package/dist/src/decorators/open.js.map +1 -1
- package/dist/src/decorators/{routed-interfaces.d.ts → operation-parameters.d.ts} +3 -11
- package/dist/src/decorators/operation-parameters.d.ts.map +1 -0
- package/dist/src/decorators/operation-parameters.js +15 -0
- package/dist/src/decorators/operation-parameters.js.map +1 -0
- package/dist/src/decorators/order-by.d.ts +2 -1
- package/dist/src/decorators/order-by.d.ts.map +1 -1
- package/dist/src/decorators/order-by.js +1 -1
- package/dist/src/decorators/order-by.js.map +1 -1
- package/dist/src/decorators/private-preview-definition.d.ts +4 -3
- package/dist/src/decorators/private-preview-definition.d.ts.map +1 -1
- package/dist/src/decorators/private-preview-definition.js +6 -1
- package/dist/src/decorators/private-preview-definition.js.map +1 -1
- package/dist/src/decorators/private-preview.d.ts +2 -1
- package/dist/src/decorators/private-preview.d.ts.map +1 -1
- package/dist/src/decorators/private-preview.js +1 -11
- package/dist/src/decorators/private-preview.js.map +1 -1
- package/dist/src/emitter.d.ts.map +1 -1
- package/dist/src/emitter.js +4 -2
- package/dist/src/emitter.js.map +1 -1
- package/dist/src/entities/entity-container.d.ts +35 -0
- package/dist/src/entities/entity-container.d.ts.map +1 -0
- package/dist/src/entities/entity-container.js +132 -0
- package/dist/src/entities/entity-container.js.map +1 -0
- package/dist/src/entities/enum.d.ts +16 -0
- package/dist/src/entities/enum.d.ts.map +1 -0
- package/dist/src/entities/enum.js +22 -0
- package/dist/src/entities/enum.js.map +1 -0
- package/dist/src/entities/model.d.ts +50 -0
- package/dist/src/entities/model.d.ts.map +1 -0
- package/dist/src/entities/model.js +119 -0
- package/dist/src/entities/model.js.map +1 -0
- package/dist/src/entities/namespace.d.ts +14 -0
- package/dist/src/entities/namespace.d.ts.map +1 -0
- package/dist/src/entities/namespace.js +41 -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 +88 -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 +54 -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/rules/entity.d.ts +1 -0
- package/dist/src/rules/entity.d.ts.map +1 -1
- package/dist/src/rules/entity.js +36 -0
- 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/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/index.d.ts +3 -4
- package/dist/src/rules/index.d.ts.map +1 -1
- package/dist/src/rules/index.js +40 -111
- package/dist/src/rules/index.js.map +1 -1
- package/lib/decorators.tsp +29 -22
- package/package.json +27 -14
- 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/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
|
@@ -1,77 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { useContext } from "react";
|
|
3
|
-
import { buildAttributes, hasStream, isAbstract, isComplex, isEntity, isOpen } from "../index.js";
|
|
4
|
-
import { getIdForType } from "../utils.js";
|
|
1
|
+
import React from "react";
|
|
5
2
|
import { AcceptableMediaTypesAnnotation } from "./acceptable-media-types-annotation.js";
|
|
6
3
|
import { AlternateKeysAnnotation } from "./alternate-keys-annotation.js";
|
|
7
|
-
import { ItemList
|
|
4
|
+
import { ItemList } from "./common-elements.js";
|
|
8
5
|
import { DescriptionAnnotation } from "./description-annotation.js";
|
|
9
|
-
import { ProgramContext } from "./program-context.js";
|
|
10
6
|
import { PropertyElement } from "./property-element.js";
|
|
11
7
|
import { RevisionsAnnotation } from "./revisions-annotation.js";
|
|
12
8
|
const EntityType = (props) => React.createElement("EntityType", props);
|
|
13
9
|
const ComplexType = (props) => React.createElement("ComplexType", props);
|
|
14
10
|
const Key = (props) => React.createElement("Key", props);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
return React.createElement(React.Fragment, null);
|
|
11
|
+
const PropertyRef = (props) => React.createElement("PropertyRef", props);
|
|
12
|
+
export const EntityTypeElement = ({ props }) => {
|
|
13
|
+
return (React.createElement(EntityType, { ...props.StructuredType },
|
|
14
|
+
React.createElement(KeyPropertyElement, { keyProperty: props.KeyProperty }),
|
|
15
|
+
React.createElement(PropertyList, { properties: props.Properties }),
|
|
16
|
+
React.createElement(AlternateKeysAnnotation, { alternateKeys: props.AlternateKeys }),
|
|
17
|
+
React.createElement(AcceptableMediaTypesAnnotation, { streamTypes: props.StreamTypes }),
|
|
18
|
+
React.createElement(RevisionsAnnotation, { definition: props.RevisionDefinition }),
|
|
19
|
+
React.createElement(DescriptionAnnotation, { description: props.Description })));
|
|
26
20
|
};
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
React.createElement(
|
|
32
|
-
React.createElement(PropertyList, { properties: model.properties }),
|
|
33
|
-
React.createElement(AlternateKeysAnnotation, { model: model }),
|
|
34
|
-
React.createElement(AcceptableMediaTypesAnnotation, { item: model }),
|
|
35
|
-
React.createElement(RevisionsAnnotation, { item: model, namespace: model.namespace }),
|
|
36
|
-
React.createElement(DescriptionAnnotation, { type: model })));
|
|
21
|
+
export const ComplexTypeElement = ({ props }) => {
|
|
22
|
+
return (React.createElement(ComplexType, { ...props.StructuredType },
|
|
23
|
+
React.createElement(PropertyList, { properties: props.Properties }),
|
|
24
|
+
React.createElement(RevisionsAnnotation, { definition: props.RevisionDefinition }),
|
|
25
|
+
React.createElement(DescriptionAnnotation, { description: props.Description })));
|
|
37
26
|
};
|
|
38
|
-
const
|
|
39
|
-
const program = useContext(ProgramContext);
|
|
40
|
-
const props = getStructuredTypeProps(program, model);
|
|
41
|
-
return (React.createElement(ComplexType, { ...props },
|
|
42
|
-
React.createElement(PropertyList, { properties: model.properties }),
|
|
43
|
-
React.createElement(RevisionsAnnotation, { item: model, namespace: model.namespace }),
|
|
44
|
-
React.createElement(DescriptionAnnotation, { type: model })));
|
|
45
|
-
};
|
|
46
|
-
const KeyPropertyElement = ({ model }) => {
|
|
47
|
-
const program = useContext(ProgramContext);
|
|
48
|
-
const keyProperty = [...model.properties.entries()].find(([k, property]) => isKey(program, property));
|
|
27
|
+
const KeyPropertyElement = ({ keyProperty }) => {
|
|
49
28
|
if (!keyProperty) {
|
|
50
29
|
return React.createElement(React.Fragment, null);
|
|
51
30
|
}
|
|
52
31
|
return (React.createElement(Key, null,
|
|
53
|
-
React.createElement(
|
|
32
|
+
React.createElement(PropertyRef, { Name: keyProperty[0] })));
|
|
54
33
|
};
|
|
55
34
|
const PropertyList = (props) => {
|
|
56
35
|
return (React.createElement(ItemList, { items: props.properties, render: (property) => React.createElement(PropertyElement, { property: property }) }));
|
|
57
36
|
};
|
|
58
|
-
function getStructuredTypeProps(program, model) {
|
|
59
|
-
const props = {
|
|
60
|
-
Name: model.name,
|
|
61
|
-
};
|
|
62
|
-
if (isOpen(program, model)) {
|
|
63
|
-
props.OpenType = "true";
|
|
64
|
-
}
|
|
65
|
-
if (hasStream(program, model)) {
|
|
66
|
-
props.HasStream = "true";
|
|
67
|
-
}
|
|
68
|
-
if (model.baseModel) {
|
|
69
|
-
props.BaseType = getIdForType(program, model.baseModel);
|
|
70
|
-
}
|
|
71
|
-
if (isAbstract(program, model)) {
|
|
72
|
-
props.Abstract = "true";
|
|
73
|
-
}
|
|
74
|
-
const agsAttributes = buildAttributes(program, model);
|
|
75
|
-
return Object.assign(props, agsAttributes);
|
|
76
|
-
}
|
|
77
37
|
//# sourceMappingURL=structured-type-element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structured-type-element.js","sourceRoot":"","sources":["../../../src/components/structured-type-element.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"structured-type-element.js","sourceRoot":"","sources":["../../../src/components/structured-type-element.tsx"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AAK,CAAC,kBAAkB,GAAI;QAC7D,oBAAC,qBAAqB,IAAC,WAAW,EAAE,KAAK,CAAC,WAAW,GAAI,CAC9C,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAA+B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC1E,OAAO,CACL,oBAAC,WAAW,OAAK,KAAK,CAAC,cAAc;QACnC,oBAAC,YAAY,IAAC,UAAU,EAAE,KAAK,CAAC,UAAU,GAAI;QAC9C,oBAAC,mBAAmB,IAAC,UAAU,EAAE,KAAK,CAAC,kBAAkB,GAAI;QAC7D,oBAAC,qBAAqB,IAAC,WAAW,EAAE,KAAK,CAAC,WAAW,GAAI,CAC7C,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAA6D,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE;IACvG,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,yCAAK,CAAC;KACd;IAED,OAAO,CACL,oBAAC,GAAG;QACF,oBAAC,WAAW,IAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GAAI,CACjC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,YAAY,GAA+C,CAAC,KAAK,EAAE,EAAE;IACzE,OAAO,CACL,oBAAC,QAAQ,IACP,KAAK,EAAE,KAAK,CAAC,UAAU,EACvB,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,oBAAC,eAAe,IAAC,QAAQ,EAAE,QAAQ,GAAI,GAC7D,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
interface: Interface;
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
export declare const TopSupportedAnnotation: FC<{
|
|
3
|
+
hasTopOperation: boolean;
|
|
5
4
|
}>;
|
|
6
5
|
//# sourceMappingURL=top-supported-annotation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"top-supported-annotation.d.ts","sourceRoot":"","sources":["../../../src/components/top-supported-annotation.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"top-supported-annotation.d.ts","sourceRoot":"","sources":["../../../src/components/top-supported-annotation.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGlC,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC;IAAE,eAAe,EAAE,OAAO,CAAA;CAAE,CAMnE,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { isTop } from "../index.js";
|
|
1
|
+
import React from "react";
|
|
3
2
|
import { AnnotationElement } from "./common-elements.js";
|
|
4
|
-
|
|
5
|
-
export const TopSupportedAnnotation = (props) => {
|
|
6
|
-
const program = useContext(ProgramContext);
|
|
7
|
-
const hasTopOperation = [...props.interface.operations].some(([_, operation]) => isTop(program, operation));
|
|
3
|
+
export const TopSupportedAnnotation = ({ hasTopOperation }) => {
|
|
8
4
|
if (hasTopOperation) {
|
|
9
5
|
return React.createElement(React.Fragment, null);
|
|
10
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"top-supported-annotation.js","sourceRoot":"","sources":["../../../src/components/top-supported-annotation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"top-supported-annotation.js","sourceRoot":"","sources":["../../../src/components/top-supported-annotation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,CAAC,MAAM,sBAAsB,GAAqC,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE;IAC9F,IAAI,eAAe,EAAE;QACnB,OAAO,yCAAK,CAAC;KACd;IAED,OAAO,oBAAC,iBAAiB,IAAC,IAAI,EAAC,gCAAgC,EAAC,IAAI,EAAC,OAAO,GAAG,CAAC;AAClF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract.d.ts","sourceRoot":"","sources":["../../../src/decorators/abstract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"abstract.d.ts","sourceRoot":"","sources":["../../../src/decorators/abstract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGtE;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,QAEjE;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,WAE3D"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// -- @open decorator
|
|
2
|
-
import { validateDecoratorTarget } from "@typespec/compiler";
|
|
3
1
|
const abstractKey = Symbol("abstract");
|
|
4
2
|
/**
|
|
5
3
|
* `@abstract` - mark a model type as abstract
|
|
@@ -7,10 +5,6 @@ const abstractKey = Symbol("abstract");
|
|
|
7
5
|
* `@abstract` can only be applied to models.
|
|
8
6
|
*/
|
|
9
7
|
export function $abstract(context, entity) {
|
|
10
|
-
// TODO: Remove this and move to extern dec once Model type is defined in TypeSpec.Reflection https://github.com/microsoft/typespec/issues/1655
|
|
11
|
-
if (!validateDecoratorTarget(context, entity, "@abstract", "Model")) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
8
|
context.program.stateSet(abstractKey).add(entity);
|
|
15
9
|
}
|
|
16
10
|
export function isAbstract(program, property) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract.js","sourceRoot":"","sources":["../../../src/decorators/abstract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"abstract.js","sourceRoot":"","sources":["../../../src/decorators/abstract.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AACvC;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,OAAyB,EAAE,MAAa;IAChE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAAgB,EAAE,QAAe;IAC1D,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"complex.d.ts","sourceRoot":"","sources":["../../../src/decorators/complex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"complex.d.ts","sourceRoot":"","sources":["../../../src/decorators/complex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAItE;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,KAAK,QAEjE;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,WAEzD"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { validateDecoratorTarget } from "@typespec/compiler";
|
|
2
1
|
const complexKey = Symbol("complex");
|
|
3
2
|
/**
|
|
4
3
|
* `@complex` - mark a model as a complex type
|
|
@@ -6,11 +5,6 @@ const complexKey = Symbol("complex");
|
|
|
6
5
|
* `@complex` can only be applied to models.
|
|
7
6
|
*/
|
|
8
7
|
export function $complex(context, complex) {
|
|
9
|
-
// TODO: Remove this and move to extern dec once Model type is defined in TypeSpec.Reflection https://github.com/microsoft/typespec/issues/1655
|
|
10
|
-
if (!validateDecoratorTarget(context, complex, "@complex", "Model")) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
// Register the complex property
|
|
14
8
|
context.program.stateSet(complexKey).add(complex);
|
|
15
9
|
}
|
|
16
10
|
export function isComplex(program, complex) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"complex.js","sourceRoot":"","sources":["../../../src/decorators/complex.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"complex.js","sourceRoot":"","sources":["../../../src/decorators/complex.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAErC;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAyB,EAAE,OAAc;IAChE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,OAAgB,EAAE,OAAc;IACxD,OAAO,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorator-parameter.d.ts","sourceRoot":"","sources":["../../../src/decorators/decorator-parameter.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAA;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorator-parameter.js","sourceRoot":"","sources":["../../../src/decorators/decorator-parameter.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { DecoratorContext, Namespace, Program } from "@typespec/compiler";
|
|
2
|
+
import { DecoratorParameter } from "./decorator-parameter.js";
|
|
2
3
|
/**
|
|
3
4
|
* `@deprecatedDefinition` - create a reusable deprecation definition.
|
|
4
5
|
*
|
|
5
6
|
* `@deprecatedDefinition` can only be applied to namespaces.
|
|
6
7
|
*/
|
|
7
|
-
export interface
|
|
8
|
+
export interface DeprecatedDecoratorParameters {
|
|
8
9
|
name: string;
|
|
9
10
|
category: string;
|
|
10
11
|
announcementDate: string;
|
|
@@ -15,7 +16,7 @@ export interface DeprecatedDefinitionParameters {
|
|
|
15
16
|
* `@deprecatedDefinition` - Allow us create a reusable deprecation definition.
|
|
16
17
|
* `@deprecatedDefinition` - Applies only to namespaces.
|
|
17
18
|
*/
|
|
18
|
-
export declare function $deprecatedDefinition(context: DecoratorContext, target: Namespace, name:
|
|
19
|
+
export declare function $deprecatedDefinition(context: DecoratorContext, target: Namespace, name: DecoratorParameter, category: DecoratorParameter, announcementDate: DecoratorParameter, removalDate: DecoratorParameter, description: DecoratorParameter): void;
|
|
19
20
|
export declare function hasDeprecatedDefinitions(program: Program, target: Namespace): boolean;
|
|
20
|
-
export declare function getDeprecatedDefinitions(program: Program, target: Namespace): Map<string,
|
|
21
|
+
export declare function getDeprecatedDefinitions(program: Program, target: Namespace): Map<string, DeprecatedDecoratorParameters>;
|
|
21
22
|
//# sourceMappingURL=deprecated-definition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated-definition.d.ts","sourceRoot":"","sources":["../../../src/decorators/deprecated-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"deprecated-definition.d.ts","sourceRoot":"","sources":["../../../src/decorators/deprecated-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAID;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,kBAAkB,EACxB,QAAQ,EAAE,kBAAkB,EAC5B,gBAAgB,EAAE,kBAAkB,EACpC,WAAW,EAAE,kBAAkB,EAC/B,WAAW,EAAE,kBAAkB,QAYhC;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAErF;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,GAChB,GAAG,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAK5C"}
|
|
@@ -5,7 +5,13 @@ const deprecatedDefinitionKey = Symbol("deprecatedDefinition");
|
|
|
5
5
|
*/
|
|
6
6
|
export function $deprecatedDefinition(context, target, name, category, announcementDate, removalDate, description) {
|
|
7
7
|
const definitions = getDeprecatedDefinitions(context.program, target);
|
|
8
|
-
definitions.set(name, {
|
|
8
|
+
definitions.set(name.value, {
|
|
9
|
+
name: name.value,
|
|
10
|
+
category: category.value,
|
|
11
|
+
announcementDate: announcementDate.value,
|
|
12
|
+
removalDate: removalDate.value,
|
|
13
|
+
description: description.value,
|
|
14
|
+
});
|
|
9
15
|
context.program.stateMap(deprecatedDefinitionKey).set(target, definitions);
|
|
10
16
|
}
|
|
11
17
|
export function hasDeprecatedDefinitions(program, target) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated-definition.js","sourceRoot":"","sources":["../../../src/decorators/deprecated-definition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deprecated-definition.js","sourceRoot":"","sources":["../../../src/decorators/deprecated-definition.ts"],"names":[],"mappings":"AAgBA,MAAM,uBAAuB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAE/D;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAAyB,EACzB,MAAiB,EACjB,IAAwB,EACxB,QAA4B,EAC5B,gBAAoC,EACpC,WAA+B,EAC/B,WAA+B;IAE/B,MAAM,WAAW,GAAG,wBAAwB,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACtE,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE;QAC1B,IAAI,EAAE,IAAI,CAAC,KAAK;QAChB,QAAQ,EAAE,QAAQ,CAAC,KAAK;QACxB,gBAAgB,EAAE,gBAAgB,CAAC,KAAK;QACxC,WAAW,EAAE,WAAW,CAAC,KAAK;QAC9B,WAAW,EAAE,WAAW,CAAC,KAAK;KAC/B,CAAC,CAAC;IAEH,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,OAAgB,EAAE,MAAiB;IAC1E,OAAO,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,OAAgB,EAChB,MAAiB;IAEjB,OAAO,CACL,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;QACrD,IAAI,GAAG,EAAyC,CACjD,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/decorators/entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../../src/decorators/entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAItE;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,QAE/D;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,WAEvD;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAM3E"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { validateDecoratorTarget } from "@typespec/compiler";
|
|
2
1
|
const entityKey = Symbol("entity");
|
|
3
2
|
/**
|
|
4
3
|
* `@entity` - mark a model as an entity type
|
|
@@ -6,11 +5,6 @@ const entityKey = Symbol("entity");
|
|
|
6
5
|
* `@entity` can only be applied to models.
|
|
7
6
|
*/
|
|
8
7
|
export function $entity(context, entity) {
|
|
9
|
-
// TODO: Remove this and move to extern dec once Model type is defined in TypeSpec.Reflection https://github.com/microsoft/typespec/issues/1655
|
|
10
|
-
if (!validateDecoratorTarget(context, entity, "@entity", "Model")) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
// Register the entity property
|
|
14
8
|
context.program.stateSet(entityKey).add(entity);
|
|
15
9
|
}
|
|
16
10
|
export function isEntity(program, entity) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/decorators/entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/decorators/entity.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAEnC;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,OAAyB,EAAE,MAAa;IAC9D,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,OAAgB,EAAE,MAAa;IACtD,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,OAAgB,EAAE,IAAY;IACtD,MAAM,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CACrD,CAAC,IAAI,EAAiB,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CACrE,CAAC;IAEF,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACjD,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { DecoratorContext, Operation, Program } from "@typespec/compiler";
|
|
2
|
+
import { DecoratorParameter } from "./decorator-parameter.js";
|
|
2
3
|
/**
|
|
3
4
|
* `@expand` - Applies to: get operations that return collections or individual instances of models that contain @contains or @references properties.
|
|
4
5
|
* Indicates that the get operation supports the OData $expand query parameter.
|
|
5
6
|
*
|
|
6
7
|
* `properties` - Property names in the model returned from the get operation that can be used in a $expand query parameter.
|
|
7
8
|
*/
|
|
8
|
-
export declare function $expand(context: DecoratorContext, target: Operation, ...properties:
|
|
9
|
+
export declare function $expand(context: DecoratorContext, target: Operation, ...properties: DecoratorParameter[]): void;
|
|
9
10
|
export declare function getExpand(program: Program, target: Operation): string[];
|
|
10
11
|
export declare function isExpand(program: Program, target: Operation): boolean;
|
|
11
12
|
//# sourceMappingURL=expand.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expand.d.ts","sourceRoot":"","sources":["../../../src/decorators/expand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"expand.d.ts","sourceRoot":"","sources":["../../../src/decorators/expand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAI9D;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,UAAU,EAAE,kBAAkB,EAAE,QAExG;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,EAAE,CAEvE;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAErE"}
|
|
@@ -6,7 +6,7 @@ const expandKey = Symbol("expand");
|
|
|
6
6
|
* `properties` - Property names in the model returned from the get operation that can be used in a $expand query parameter.
|
|
7
7
|
*/
|
|
8
8
|
export function $expand(context, target, ...properties) {
|
|
9
|
-
context.program.stateMap(expandKey).set(target, properties);
|
|
9
|
+
context.program.stateMap(expandKey).set(target, properties.map(p => p.value));
|
|
10
10
|
}
|
|
11
11
|
export function getExpand(program, target) {
|
|
12
12
|
return program.stateMap(expandKey).get(target) || [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expand.js","sourceRoot":"","sources":["../../../src/decorators/expand.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"expand.js","sourceRoot":"","sources":["../../../src/decorators/expand.ts"],"names":[],"mappings":"AAGA,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,OAAyB,EAAE,MAAiB,EAAE,GAAG,UAAgC;IACvG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,OAAgB,EAAE,MAAiB;IAC3D,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,OAAgB,EAAE,MAAiB;IAC1D,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DecoratorContext, Operation, Program } from "@typespec/compiler";
|
|
2
|
+
import { DecoratorParameter } from "./decorator-parameter.js";
|
|
3
|
+
/**
|
|
4
|
+
* `@function` - mark an operation as a function
|
|
5
|
+
*
|
|
6
|
+
* `@function` can only be applied to operations.
|
|
7
|
+
*/
|
|
8
|
+
export declare function $function(context: DecoratorContext, target: Operation, name?: DecoratorParameter): void;
|
|
9
|
+
export declare function isFunction(program: Program, target: Operation): boolean;
|
|
10
|
+
export declare function getFunction(program: Program, target: Operation): string | undefined;
|
|
11
|
+
//# sourceMappingURL=function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../../src/decorators/function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAI9D;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,kBAAkB,QAEhG;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,WAE7D;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAEnF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const functionKey = Symbol("function");
|
|
2
|
+
/**
|
|
3
|
+
* `@function` - mark an operation as a function
|
|
4
|
+
*
|
|
5
|
+
* `@function` can only be applied to operations.
|
|
6
|
+
*/
|
|
7
|
+
export function $function(context, target, name) {
|
|
8
|
+
context.program.stateMap(functionKey).set(target, (name === null || name === void 0 ? void 0 : name.value) || target.name);
|
|
9
|
+
}
|
|
10
|
+
export function isFunction(program, target) {
|
|
11
|
+
return program.stateMap(functionKey).has(target);
|
|
12
|
+
}
|
|
13
|
+
export function getFunction(program, target) {
|
|
14
|
+
return program.stateMap(functionKey).get(target);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function.js","sourceRoot":"","sources":["../../../src/decorators/function.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAEvC;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,OAAyB,EAAE,MAAiB,EAAE,IAAyB;IAC/F,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,KAAI,MAAM,CAAC,IAAI,CAAC,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAAgB,EAAE,MAAiB;IAC5D,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAAgB,EAAE,MAAiB;IAC7D,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DecoratorContext, Namespace, Program, Type } from "@typespec/compiler";
|
|
2
|
+
import { DecoratorParameter } from "../../decorator-parameter.js";
|
|
2
3
|
export interface QueryParameter {
|
|
3
4
|
name: string;
|
|
4
5
|
value: string;
|
|
@@ -6,7 +7,7 @@ export interface QueryParameter {
|
|
|
6
7
|
/**
|
|
7
8
|
* \`@additionalQueryParameters\` - Appends a key=value pair to the query string of the mapped internal URL for all models defined within the namespace..
|
|
8
9
|
*/
|
|
9
|
-
export declare function $additionalQueryParameters(context: DecoratorContext, target: Namespace,
|
|
10
|
+
export declare function $additionalQueryParameters(context: DecoratorContext, target: Namespace, nameParam: DecoratorParameter | undefined, valueParam: DecoratorParameter | undefined): void;
|
|
10
11
|
export declare function getAdditionalQueryParameters(program: Program, target: Namespace): QueryParameter[];
|
|
11
12
|
export declare function unpackAdditionalQueryParameters(program: Program, target: Type): {
|
|
12
13
|
[key: string]: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"additional-query-parameters.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/handlers/custom/additional-query-parameters.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAChB,SAAS,EACT,OAAO,EACP,IAAI,EACL,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"additional-query-parameters.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/handlers/custom/additional-query-parameters.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAChB,SAAS,EACT,OAAO,EACP,IAAI,EACL,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AASD;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,kBAAkB,GAAG,SAAS,EACzC,UAAU,EAAE,kBAAkB,GAAG,SAAS,QAqB3C;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,GAChB,cAAc,EAAE,CAElB;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,IAAI,GACX;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAM3B"}
|
|
@@ -8,7 +8,9 @@ const additionalQueryParametersDecorator = createDecoratorDefinition({
|
|
|
8
8
|
/**
|
|
9
9
|
* \`@additionalQueryParameters\` - Appends a key=value pair to the query string of the mapped internal URL for all models defined within the namespace..
|
|
10
10
|
*/
|
|
11
|
-
export function $additionalQueryParameters(context, target,
|
|
11
|
+
export function $additionalQueryParameters(context, target, nameParam, valueParam) {
|
|
12
|
+
const name = nameParam === undefined ? "" : nameParam.value;
|
|
13
|
+
const value = valueParam === undefined ? "" : valueParam.value;
|
|
12
14
|
if (!additionalQueryParametersDecorator.validate(context, target, [name, value])) {
|
|
13
15
|
return;
|
|
14
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"additional-query-parameters.js","sourceRoot":"","sources":["../../../../../src/decorators/handlers/custom/additional-query-parameters.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,GAK1B,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"additional-query-parameters.js","sourceRoot":"","sources":["../../../../../src/decorators/handlers/custom/additional-query-parameters.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,GAK1B,MAAM,oBAAoB,CAAC;AAO5B,MAAM,4BAA4B,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAEzE,MAAM,kCAAkC,GAAG,y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GAAG,4BAA4B,CAAC,OAAO,EAAE,MAAmB,CAAC,CAAC;IAC7F,MAAM,eAAe,GACnB,yBAAyB;QACzB,yBAAyB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzE,OAAO,EAAE,+BAA+B,EAAE,eAAe,EAAE,CAAC;AAC9D,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DecoratorContext, Enum, EnumMember, Interface, Model, ModelProperty, Operation, Program, Type } from "@typespec/compiler";
|
|
2
|
-
|
|
2
|
+
import { DecoratorParameter } from "../../decorator-parameter.js";
|
|
3
|
+
export declare function $agsAttribute(context: DecoratorContext, target: Model | ModelProperty | Enum | EnumMember | Operation | Interface, name: DecoratorParameter, value: DecoratorParameter): void;
|
|
3
4
|
export declare function getAgsAttributes(program: Program, target: Model | ModelProperty | Enum | EnumMember | Operation | Interface): Map<string, string> | undefined;
|
|
4
5
|
export declare function unpackAgsAttributes(program: Program, target: Type): {
|
|
5
6
|
[key: string]: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ags-attribute.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/handlers/custom/ags-attribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAChB,IAAI,EACJ,UAAU,EACV,SAAS,EACT,KAAK,EACL,aAAa,EACb,SAAS,EACT,OAAO,EACP,IAAI,EACL,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"ags-attribute.d.ts","sourceRoot":"","sources":["../../../../../src/decorators/handlers/custom/ags-attribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAChB,IAAI,EACJ,UAAU,EACV,SAAS,EACT,KAAK,EACL,aAAa,EACb,SAAS,EACT,OAAO,EACP,IAAI,EACL,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAelE,wBAAgB,aAAa,CAC3B,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,KAAK,GAAG,aAAa,GAAG,IAAI,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,EACzE,IAAI,EAAE,kBAAkB,EACxB,KAAK,EAAE,kBAAkB,QAiB1B;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,KAAK,GAAG,aAAa,GAAG,IAAI,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GACxE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAEjC;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAK7F"}
|
|
@@ -10,17 +10,17 @@ const agsAttributeDecorator = createDecoratorDefinition({
|
|
|
10
10
|
args: [{ kind: "String" }, { kind: "String" }],
|
|
11
11
|
});
|
|
12
12
|
export function $agsAttribute(context, target, name, value) {
|
|
13
|
-
if (!agsAttributeDecorator.validate(context, target, [name, value])) {
|
|
13
|
+
if (!agsAttributeDecorator.validate(context, target, [name.value, value.value])) {
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
let attributeParameters = context.program
|
|
17
17
|
.stateMap(agsAttributeKey)
|
|
18
18
|
.get(target);
|
|
19
19
|
if (attributeParameters) {
|
|
20
|
-
attributeParameters.set(name, value);
|
|
20
|
+
attributeParameters.set(name.value, value.value);
|
|
21
21
|
}
|
|
22
22
|
else {
|
|
23
|
-
attributeParameters = new Map([[name, value]]);
|
|
23
|
+
attributeParameters = new Map([[name.value, value.value]]);
|
|
24
24
|
}
|
|
25
25
|
context.program.stateMap(agsAttributeKey).set(target, attributeParameters);
|
|
26
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ags-attribute.js","sourceRoot":"","sources":["../../../../../src/decorators/handlers/custom/ags-attribute.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,GAU1B,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"ags-attribute.js","sourceRoot":"","sources":["../../../../../src/decorators/handlers/custom/ags-attribute.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,GAU1B,MAAM,oBAAoB,CAAC;AAG5B;;;GAGG;AAEH,MAAM,eAAe,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAE/C,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;IACtD,IAAI,EAAE,eAAe;IACrB,MAAM,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,CAAC;IAClF,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;CACtC,CAAC,CAAC;AAEZ,MAAM,UAAU,aAAa,CAC3B,OAAyB,EACzB,MAAyE,EACzE,IAAwB,EACxB,KAAyB;IAEzB,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE;QAC/E,OAAO;KACR;IAED,IAAI,mBAAmB,GAAwB,OAAO,CAAC,OAAO;SAC3D,QAAQ,CAAC,eAAe,CAAC;SACzB,GAAG,CAAC,MAAM,CAAC,CAAC;IAEf,IAAI,mBAAmB,EAAE;QACvB,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;KAClD;SAAM;QACL,mBAAmB,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KAC5D;IAED,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,OAAgB,EAChB,MAAyE;IAEzE,OAAO,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAAgB,EAAE,MAAY;IAChE,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,EAAE,MAA2E,CAAC,CAAC;IAC1H,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;IAC9F,OAAO,MAAM,IAAI,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* NOTICE: This is an autogenerated file and should not be edited directly.
|
|
3
3
|
*/
|
|
4
4
|
import { DecoratorContext, EnumMember, Enum, Interface, Model, ModelProperty, Namespace, Operation, Program, Type } from "@typespec/compiler";
|
|
5
|
+
import { DecoratorParameter } from "../decorator-parameter.js";
|
|
5
6
|
/**
|
|
6
7
|
* `@isOwner` - specify the name of the workload associated with the model
|
|
7
8
|
* `@isOwner` can be applied to Model, ModelProperty, Enum, EnumMember.
|
|
@@ -18,13 +19,13 @@ export declare function isPrivileged(program: Program, target: Type): boolean;
|
|
|
18
19
|
*
|
|
19
20
|
* `@workloadName` can be applied to Model, ModelProperty, Enum, EnumMember.
|
|
20
21
|
*/
|
|
21
|
-
export declare function $workloadName(context: DecoratorContext, target: Model | ModelProperty | Enum | EnumMember, workloadName:
|
|
22
|
+
export declare function $workloadName(context: DecoratorContext, target: Model | ModelProperty | Enum | EnumMember, workloadName: DecoratorParameter): void;
|
|
22
23
|
export declare function getWorkloadName(program: Program, target: Type): string | undefined;
|
|
23
24
|
/**
|
|
24
25
|
*
|
|
25
26
|
* `@workloadNameMsa` can be applied to Model, ModelProperty, Enum, EnumMember.
|
|
26
27
|
*/
|
|
27
|
-
export declare function $workloadNameMsa(context: DecoratorContext, target: Model | ModelProperty | Enum | EnumMember, workloadNameMsa:
|
|
28
|
+
export declare function $workloadNameMsa(context: DecoratorContext, target: Model | ModelProperty | Enum | EnumMember, workloadNameMsa: DecoratorParameter): void;
|
|
28
29
|
export declare function getWorkloadNameMsa(program: Program, target: Type): string | undefined;
|
|
29
|
-
export declare function buildAttributes(program: Program, type: Model | ModelProperty | Namespace | Interface | Operation | Enum | EnumMember):
|
|
30
|
+
export declare function buildAttributes(program: Program, type: Model | ModelProperty | Namespace | Interface | Operation | Enum | EnumMember): Record<string, string>;
|
|
30
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/decorators/handlers/index.ts"],"names":[],"mappings":"AACE;;GAEG;AAEL,OAAO,EAEL,gBAAgB,EAChB,UAAU,EACV,IAAI,EACJ,SAAS,EACT,KAAK,EACL,aAAa,EACb,SAAS,EACT,SAAS,EACT,OAAO,EACP,IAAI,EACL,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/decorators/handlers/index.ts"],"names":[],"mappings":"AACE;;GAEG;AAEL,OAAO,EAEL,gBAAgB,EAChB,UAAU,EACV,IAAI,EACJ,SAAS,EACT,KAAK,EACL,aAAa,EACb,SAAS,EACT,SAAS,EACT,OAAO,EACP,IAAI,EACL,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BA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55
55
|
* `@workloadName` can be applied to Model, ModelProperty, Enum, EnumMember.
|
|
56
56
|
*/
|
|
57
57
|
export function $workloadName(context, target, workloadName) {
|
|
58
|
-
if (!workloadNameDecorator.validate(context, target, [workloadName])) {
|
|
58
|
+
if (!workloadNameDecorator.validate(context, target, [workloadName.value])) {
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
-
context.program.stateMap(workloadNameKey).set(target, workloadName);
|
|
61
|
+
context.program.stateMap(workloadNameKey).set(target, workloadName.value);
|
|
62
62
|
}
|
|
63
63
|
export function getWorkloadName(program, target) {
|
|
64
64
|
return program.stateMap(workloadNameKey).get(target);
|
|
@@ -75,10 +75,10 @@ const workloadNameMsaDecorator = createDecoratorDefinition({
|
|
|
75
75
|
* `@workloadNameMsa` can be applied to Model, ModelProperty, Enum, EnumMember.
|
|
76
76
|
*/
|
|
77
77
|
export function $workloadNameMsa(context, target, workloadNameMsa) {
|
|
78
|
-
if (!workloadNameMsaDecorator.validate(context, target, [workloadNameMsa])) {
|
|
78
|
+
if (!workloadNameMsaDecorator.validate(context, target, [workloadNameMsa.value])) {
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
context.program.stateMap(workloadNameMsaKey).set(target, workloadNameMsa);
|
|
81
|
+
context.program.stateMap(workloadNameMsaKey).set(target, workloadNameMsa.value);
|
|
82
82
|
}
|
|
83
83
|
export function getWorkloadNameMsa(program, target) {
|
|
84
84
|
return program.stateMap(workloadNameMsaKey).get(target);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/decorators/handlers/index.ts"],"names":[],"mappings":"AACE;;GAEG;AAEL,OAAO,EACL,yBAAyB,GAW1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,aAAa,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/decorators/handlers/index.ts"],"names":[],"mappings":"AACE;;GAEG;AAEL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,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;SAClF,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;QACb,MAAM,QAAQ,GAAG,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,uBAAuB;QACvE,IAAI,GAAG,GAAG,QAAgD,CAAC;QAC3D,MAAM,aAAa,GAAG,uBAAuB,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAClE,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;YACrC,KAAK,GAAG,EAAE,GAAG,KAAK,EAAE,GAAG,aAAa,EAAE,CAAC;SACxC;aAAM;YACL,GAAG,GAAG,QAAsD,CAAC;YAC7D,MAAM,OAAO,GAAG,6BAA6B,CAAC,GAAG,CAAC,CAAC;YACnD,KAAK,GAAG,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE,EAAE,CAAC;SACvD;IACH,CAAC,CAAC,CAAC;IACL,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DecoratorContext, Model, Program } from "@typespec/compiler";
|
|
2
|
+
import { DecoratorParameter } from "./decorator-parameter.js";
|
|
2
3
|
/**
|
|
3
4
|
* `@hasStream` - indicates that an `@entity` model has a stream.
|
|
4
5
|
*
|
|
5
|
-
* `mediaTypes` - list of media types supported by the stream.
|
|
6
|
-
* If not specified, the stream supports any media type.
|
|
6
|
+
* `mediaTypes` - list of media types supported by the stream. If not specified, the stream supports any media type.
|
|
7
7
|
*/
|
|
8
|
-
export declare function $hasStream(context: DecoratorContext, target: Model, args?:
|
|
8
|
+
export declare function $hasStream(context: DecoratorContext, target: Model, args?: DecoratorParameter, ...mediaTypes: DecoratorParameter[]): void;
|
|
9
9
|
export declare function hasStream(program: Program, target: Model): boolean;
|
|
10
10
|
export declare function getStreamTypes(program: Program, target: Model): string[];
|
|
11
11
|
//# sourceMappingURL=has-stream.d.ts.map
|