@microsoft/typespec-msgraph 0.0.1-Preview.12 → 0.0.1-Preview.14
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/annotations.d.ts.map +1 -1
- package/dist/src/components/annotations.js +24 -3
- package/dist/src/components/annotations.js.map +1 -1
- package/dist/src/components/entity-container-element.d.ts.map +1 -1
- package/dist/src/components/entity-container-element.js +13 -6
- package/dist/src/components/entity-container-element.js.map +1 -1
- package/dist/src/components/operation-element.d.ts.map +1 -1
- package/dist/src/components/operation-element.js +15 -4
- package/dist/src/components/operation-element.js.map +1 -1
- package/dist/src/components/property-element.js +1 -1
- package/dist/src/components/property-element.js.map +1 -1
- package/dist/src/components/reference-target-element.d.ts +9 -0
- package/dist/src/components/reference-target-element.d.ts.map +1 -0
- package/dist/src/components/reference-target-element.js +3 -0
- package/dist/src/components/reference-target-element.js.map +1 -0
- package/dist/src/components/revisions-annotation.d.ts.map +1 -1
- package/dist/src/components/revisions-annotation.js +2 -1
- package/dist/src/components/revisions-annotation.js.map +1 -1
- package/dist/src/components/schema-element.d.ts.map +1 -1
- package/dist/src/components/schema-element.js +5 -3
- package/dist/src/components/schema-element.js.map +1 -1
- package/dist/src/components/select-supported-annotation.d.ts +5 -0
- package/dist/src/components/select-supported-annotation.d.ts.map +1 -0
- package/dist/src/components/select-supported-annotation.js +6 -0
- package/dist/src/components/select-supported-annotation.js.map +1 -0
- package/dist/src/components/term-element.d.ts +9 -0
- package/dist/src/components/term-element.d.ts.map +1 -0
- package/dist/src/components/term-element.js +8 -0
- package/dist/src/components/term-element.js.map +1 -0
- package/dist/src/decorators/address-url.d.ts +16 -0
- package/dist/src/decorators/address-url.d.ts.map +1 -0
- package/dist/src/decorators/address-url.js +19 -0
- package/dist/src/decorators/address-url.js.map +1 -0
- package/dist/src/decorators/ags-attribute.d.ts +2 -1
- package/dist/src/decorators/ags-attribute.d.ts.map +1 -1
- package/dist/src/decorators/ags-attribute.js +34 -1
- package/dist/src/decorators/ags-attribute.js.map +1 -1
- package/dist/src/decorators/global-operation.d.ts +9 -0
- package/dist/src/decorators/global-operation.d.ts.map +1 -0
- package/dist/src/decorators/global-operation.js +13 -0
- package/dist/src/decorators/global-operation.js.map +1 -0
- package/dist/src/decorators/graph-deprecated.d.ts +11 -0
- package/dist/src/decorators/graph-deprecated.d.ts.map +1 -0
- package/dist/src/decorators/graph-deprecated.js +19 -0
- package/dist/src/decorators/graph-deprecated.js.map +1 -0
- package/dist/src/decorators/index.d.ts +7 -0
- package/dist/src/decorators/index.d.ts.map +1 -1
- package/dist/src/decorators/index.js +7 -0
- package/dist/src/decorators/index.js.map +1 -1
- package/dist/src/decorators/is-owner.js +1 -1
- package/dist/src/decorators/ownerless.d.ts +8 -0
- package/dist/src/decorators/ownerless.d.ts.map +1 -0
- package/dist/src/decorators/ownerless.js +12 -0
- package/dist/src/decorators/ownerless.js.map +1 -0
- package/dist/src/decorators/public-namespace.d.ts.map +1 -1
- package/dist/src/decorators/public-namespace.js +4 -1
- package/dist/src/decorators/public-namespace.js.map +1 -1
- package/dist/src/decorators/reference-target.d.ts +16 -0
- package/dist/src/decorators/reference-target.d.ts.map +1 -0
- package/dist/src/decorators/reference-target.js +52 -0
- package/dist/src/decorators/reference-target.js.map +1 -0
- package/dist/src/decorators/select.d.ts +9 -0
- package/dist/src/decorators/select.d.ts.map +1 -0
- package/dist/src/decorators/select.js +13 -0
- package/dist/src/decorators/select.js.map +1 -0
- package/dist/src/decorators/term.d.ts +13 -0
- package/dist/src/decorators/term.d.ts.map +1 -0
- package/dist/src/decorators/term.js +14 -0
- package/dist/src/decorators/term.js.map +1 -0
- package/dist/src/entities/address-url.d.ts +4 -0
- package/dist/src/entities/address-url.d.ts.map +1 -0
- package/dist/src/entities/address-url.js +18 -0
- package/dist/src/entities/address-url.js.map +1 -0
- package/dist/src/entities/annotations.d.ts +6 -0
- package/dist/src/entities/annotations.d.ts.map +1 -1
- package/dist/src/entities/annotations.js +25 -1
- package/dist/src/entities/annotations.js.map +1 -1
- package/dist/src/entities/entity-container.d.ts +10 -0
- package/dist/src/entities/entity-container.d.ts.map +1 -1
- package/dist/src/entities/entity-container.js +3 -0
- package/dist/src/entities/entity-container.js.map +1 -1
- package/dist/src/entities/enum.js.map +1 -1
- package/dist/src/entities/model.d.ts +2 -0
- package/dist/src/entities/model.d.ts.map +1 -1
- package/dist/src/entities/model.js +66 -5
- package/dist/src/entities/model.js.map +1 -1
- package/dist/src/entities/ms-graph-route.d.ts +13 -0
- package/dist/src/entities/ms-graph-route.d.ts.map +1 -0
- package/dist/src/entities/ms-graph-route.js +70 -0
- package/dist/src/entities/ms-graph-route.js.map +1 -0
- package/dist/src/entities/namespace.d.ts +6 -1
- package/dist/src/entities/namespace.d.ts.map +1 -1
- package/dist/src/entities/namespace.js +107 -11
- package/dist/src/entities/namespace.js.map +1 -1
- package/dist/src/entities/operation.d.ts +4 -0
- package/dist/src/entities/operation.d.ts.map +1 -1
- package/dist/src/entities/operation.js +28 -8
- package/dist/src/entities/operation.js.map +1 -1
- package/dist/src/entities/revision-definition.d.ts +1 -0
- package/dist/src/entities/revision-definition.d.ts.map +1 -1
- package/dist/src/entities/revision-definition.js +3 -3
- package/dist/src/entities/revision-definition.js.map +1 -1
- package/dist/src/entities/term.d.ts +8 -0
- package/dist/src/entities/term.d.ts.map +1 -0
- package/dist/src/entities/term.js +14 -0
- package/dist/src/entities/term.js.map +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +69 -146
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +24 -10
- package/dist/src/lib.js.map +1 -1
- package/dist/src/rules/address-url.d.ts +6 -0
- package/dist/src/rules/address-url.d.ts.map +1 -0
- package/dist/src/rules/address-url.js +40 -0
- package/dist/src/rules/address-url.js.map +1 -0
- package/dist/src/rules/allowed-values.d.ts +2 -1
- package/dist/src/rules/allowed-values.d.ts.map +1 -1
- package/dist/src/rules/allowed-values.js +7 -7
- package/dist/src/rules/allowed-values.js.map +1 -1
- package/dist/src/rules/alternate-key.d.ts +4 -3
- package/dist/src/rules/alternate-key.d.ts.map +1 -1
- package/dist/src/rules/alternate-key.js +23 -23
- package/dist/src/rules/alternate-key.js.map +1 -1
- package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts +2 -1
- package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts.map +1 -1
- package/dist/src/rules/collection-navigation-properties-not-nullable.js +9 -9
- package/dist/src/rules/collection-navigation-properties-not-nullable.js.map +1 -1
- package/dist/src/rules/computed.d.ts +2 -1
- package/dist/src/rules/computed.d.ts.map +1 -1
- package/dist/src/rules/computed.js +9 -8
- package/dist/src/rules/computed.js.map +1 -1
- package/dist/src/rules/contains.d.ts +2 -1
- package/dist/src/rules/contains.d.ts.map +1 -1
- package/dist/src/rules/contains.js +9 -8
- package/dist/src/rules/contains.js.map +1 -1
- package/dist/src/rules/count.d.ts +2 -1
- package/dist/src/rules/count.d.ts.map +1 -1
- package/dist/src/rules/count.js +9 -8
- package/dist/src/rules/count.js.map +1 -1
- package/dist/src/rules/disallowed-typespec-decorators.d.ts +2 -1
- package/dist/src/rules/disallowed-typespec-decorators.d.ts.map +1 -1
- package/dist/src/rules/disallowed-typespec-decorators.js +29 -25
- package/dist/src/rules/disallowed-typespec-decorators.js.map +1 -1
- package/dist/src/rules/entity.d.ts +5 -2
- package/dist/src/rules/entity.d.ts.map +1 -1
- package/dist/src/rules/entity.js +102 -19
- package/dist/src/rules/entity.js.map +1 -1
- package/dist/src/rules/enum.d.ts +3 -1
- package/dist/src/rules/enum.d.ts.map +1 -1
- package/dist/src/rules/enum.js +9 -6
- package/dist/src/rules/enum.js.map +1 -1
- package/dist/src/rules/expand.d.ts +3 -2
- package/dist/src/rules/expand.d.ts.map +1 -1
- package/dist/src/rules/expand.js +16 -16
- package/dist/src/rules/expand.js.map +1 -1
- package/dist/src/rules/extends-on-same-type.d.ts +2 -1
- package/dist/src/rules/extends-on-same-type.d.ts.map +1 -1
- package/dist/src/rules/extends-on-same-type.js +9 -8
- package/dist/src/rules/extends-on-same-type.js.map +1 -1
- package/dist/src/rules/filter.d.ts +4 -3
- package/dist/src/rules/filter.d.ts.map +1 -1
- package/dist/src/rules/filter.js +23 -23
- package/dist/src/rules/filter.js.map +1 -1
- package/dist/src/rules/function.d.ts +2 -1
- package/dist/src/rules/function.d.ts.map +1 -1
- package/dist/src/rules/function.js +9 -9
- package/dist/src/rules/function.js.map +1 -1
- package/dist/src/rules/global-operation.d.ts +4 -0
- package/dist/src/rules/global-operation.d.ts.map +1 -0
- package/dist/src/rules/global-operation.js +60 -0
- package/dist/src/rules/global-operation.js.map +1 -0
- package/dist/src/rules/graph-deprecated.d.ts +8 -0
- package/dist/src/rules/graph-deprecated.d.ts.map +1 -0
- package/dist/src/rules/graph-deprecated.js +152 -0
- package/dist/src/rules/graph-deprecated.js.map +1 -0
- package/dist/src/rules/graph-route.d.ts +8 -2
- package/dist/src/rules/graph-route.d.ts.map +1 -1
- package/dist/src/rules/graph-route.js +80 -16
- package/dist/src/rules/graph-route.js.map +1 -1
- package/dist/src/rules/has-stream.d.ts +2 -1
- package/dist/src/rules/has-stream.d.ts.map +1 -1
- package/dist/src/rules/has-stream.js +9 -8
- package/dist/src/rules/has-stream.js.map +1 -1
- package/dist/src/rules/index.d.ts +5 -0
- package/dist/src/rules/index.d.ts.map +1 -1
- package/dist/src/rules/index.js +5 -0
- package/dist/src/rules/index.js.map +1 -1
- package/dist/src/rules/namespace.d.ts +4 -3
- package/dist/src/rules/namespace.d.ts.map +1 -1
- package/dist/src/rules/namespace.js +58 -73
- package/dist/src/rules/namespace.js.map +1 -1
- package/dist/src/rules/open.d.ts +2 -1
- package/dist/src/rules/open.d.ts.map +1 -1
- package/dist/src/rules/open.js +9 -8
- package/dist/src/rules/open.js.map +1 -1
- package/dist/src/rules/operation-inside-interface.d.ts +2 -1
- package/dist/src/rules/operation-inside-interface.d.ts.map +1 -1
- package/dist/src/rules/operation-inside-interface.js +9 -8
- package/dist/src/rules/operation-inside-interface.js.map +1 -1
- package/dist/src/rules/order-by.d.ts +3 -2
- package/dist/src/rules/order-by.d.ts.map +1 -1
- package/dist/src/rules/order-by.js +16 -16
- package/dist/src/rules/order-by.js.map +1 -1
- package/dist/src/rules/ownerless.d.ts +10 -0
- package/dist/src/rules/ownerless.d.ts.map +1 -0
- package/dist/src/rules/ownerless.js +155 -0
- package/dist/src/rules/ownerless.js.map +1 -0
- package/dist/src/rules/partial.d.ts +2 -1
- package/dist/src/rules/partial.d.ts.map +1 -1
- package/dist/src/rules/partial.js +9 -8
- package/dist/src/rules/partial.js.map +1 -1
- package/dist/src/rules/reference-target.d.ts +8 -0
- package/dist/src/rules/reference-target.d.ts.map +1 -0
- package/dist/src/rules/reference-target.js +119 -0
- package/dist/src/rules/reference-target.js.map +1 -0
- package/dist/src/rules/references.d.ts +2 -1
- package/dist/src/rules/references.d.ts.map +1 -1
- package/dist/src/rules/references.js +9 -8
- package/dist/src/rules/references.js.map +1 -1
- package/dist/src/rules/required-for-create.d.ts +2 -1
- package/dist/src/rules/required-for-create.d.ts.map +1 -1
- package/dist/src/rules/required-for-create.js +9 -8
- package/dist/src/rules/required-for-create.js.map +1 -1
- package/dist/src/rules/search.d.ts +2 -1
- package/dist/src/rules/search.d.ts.map +1 -1
- package/dist/src/rules/search.js +9 -8
- package/dist/src/rules/search.js.map +1 -1
- package/dist/src/rules/skip.d.ts +2 -1
- package/dist/src/rules/skip.d.ts.map +1 -1
- package/dist/src/rules/skip.js +9 -8
- package/dist/src/rules/skip.js.map +1 -1
- package/dist/src/rules/top.d.ts +2 -1
- package/dist/src/rules/top.d.ts.map +1 -1
- package/dist/src/rules/top.js +9 -8
- package/dist/src/rules/top.js.map +1 -1
- package/dist/src/testing/index.d.ts +1 -0
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +21 -0
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/utils.d.ts +19 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +44 -21
- package/dist/src/utils.js.map +1 -1
- package/dist/src/{linter.d.ts → validate.d.ts} +1 -1
- package/dist/src/validate.d.ts.map +1 -0
- package/dist/src/validate.js +56 -0
- package/dist/src/validate.js.map +1 -0
- package/lib/decorators.tsp +114 -17
- package/lib/porcelain.tsp +18 -7
- package/lib/responses.tsp +32 -7
- package/lib/shared-models.tsp +0 -50
- package/package.json +5 -7
- package/dist/src/linter.d.ts.map +0 -1
- package/dist/src/linter.js +0 -44
- package/dist/src/linter.js.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DecoratorContext, Enum, EnumMember, Model, ModelProperty, Namespace, Operation, Program, Type } from "@typespec/compiler";
|
|
2
|
+
/**
|
|
3
|
+
* `@graphDeprecated` - Allow us to deprecate a defined element.
|
|
4
|
+
* `@graphDeprecated` - Applies to models, model properties, enums, enum members, namespaces, actions, action parameters
|
|
5
|
+
* functions, routing interfaces and operations.
|
|
6
|
+
*/
|
|
7
|
+
export declare function $graphDeprecated(context: DecoratorContext, target: Model | ModelProperty | EnumMember | Enum | Operation | Namespace, name: string): void;
|
|
8
|
+
export declare function getGraphDeprecated(program: Program, target: Type): string;
|
|
9
|
+
export declare function isGraphDeprecated(program: Program, target: Type): boolean;
|
|
10
|
+
export declare function hasGraphDeprecated(program: Program, target: Type): boolean;
|
|
11
|
+
//# sourceMappingURL=graph-deprecated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-deprecated.d.ts","sourceRoot":"","sources":["../../../src/decorators/graph-deprecated.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,IAAI,EACJ,UAAU,EACV,KAAK,EACL,aAAa,EACb,SAAS,EACT,SAAS,EACT,OAAO,EACP,IAAI,EACL,MAAM,oBAAoB,CAAC;AAI5B;;;;GAIG;AAEH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,KAAK,GAAG,aAAa,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,EACzE,IAAI,EAAE,MAAM,QAGb;AAGD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,GAAG,MAAM,CAEzE;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,WAE/D;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,WAEhE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const graphDeprecatedKey = Symbol("graphDeprecated");
|
|
2
|
+
/**
|
|
3
|
+
* `@graphDeprecated` - Allow us to deprecate a defined element.
|
|
4
|
+
* `@graphDeprecated` - Applies to models, model properties, enums, enum members, namespaces, actions, action parameters
|
|
5
|
+
* functions, routing interfaces and operations.
|
|
6
|
+
*/
|
|
7
|
+
export function $graphDeprecated(context, target, name) {
|
|
8
|
+
context.program.stateMap(graphDeprecatedKey).set(target, name);
|
|
9
|
+
}
|
|
10
|
+
export function getGraphDeprecated(program, target) {
|
|
11
|
+
return program.stateMap(graphDeprecatedKey).get(target);
|
|
12
|
+
}
|
|
13
|
+
export function isGraphDeprecated(program, target) {
|
|
14
|
+
return program.stateMap(graphDeprecatedKey).has(target);
|
|
15
|
+
}
|
|
16
|
+
export function hasGraphDeprecated(program, target) {
|
|
17
|
+
return program.stateMap(graphDeprecatedKey).has(target);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=graph-deprecated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-deprecated.js","sourceRoot":"","sources":["../../../src/decorators/graph-deprecated.ts"],"names":[],"mappings":"AAYA,MAAM,kBAAkB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAErD;;;;GAIG;AAEH,MAAM,UAAU,gBAAgB,CAC9B,OAAyB,EACzB,MAAyE,EACzE,IAAY;IAEZ,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACjE,CAAC;AAGD,MAAM,UAAU,kBAAkB,CAAC,OAAgB,EAAE,MAAY;IAC/D,OAAO,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAgB,EAAE,MAAY;IAC9D,OAAO,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAgB,EAAE,MAAY;IAC/D,OAAO,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./abstract.js";
|
|
2
2
|
export * from "./action.js";
|
|
3
3
|
export * from "./additional-query-parameters.js";
|
|
4
|
+
export * from "./address-url.js";
|
|
4
5
|
export * from "./ags-attribute.js";
|
|
5
6
|
export * from "./alternate-key.js";
|
|
6
7
|
export * from "./complex.js";
|
|
@@ -30,6 +31,7 @@ export * from "./references.js";
|
|
|
30
31
|
export * from "./required-for-create.js";
|
|
31
32
|
export * from "./search.js";
|
|
32
33
|
export * from "./skip.js";
|
|
34
|
+
export * from "./term.js";
|
|
33
35
|
export * from "./top.js";
|
|
34
36
|
export * from "./workload-name-msa.js";
|
|
35
37
|
export * from "./workload-name.js";
|
|
@@ -38,4 +40,9 @@ export * from "./immutable.js";
|
|
|
38
40
|
export * from "./allowed-values.js";
|
|
39
41
|
export * from "./partial.js";
|
|
40
42
|
export * from "./experimental.js";
|
|
43
|
+
export * from "./graph-deprecated.js";
|
|
44
|
+
export * from "./ownerless.js";
|
|
45
|
+
export * from "./global-operation.js";
|
|
46
|
+
export * from "./reference-target.js";
|
|
47
|
+
export * from "./select.js";
|
|
41
48
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,kCAAkC,CAAC;AACjD,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,g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,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./abstract.js";
|
|
2
2
|
export * from "./action.js";
|
|
3
3
|
export * from "./additional-query-parameters.js";
|
|
4
|
+
export * from "./address-url.js";
|
|
4
5
|
export * from "./ags-attribute.js";
|
|
5
6
|
export * from "./alternate-key.js";
|
|
6
7
|
export * from "./complex.js";
|
|
@@ -30,6 +31,7 @@ export * from "./references.js";
|
|
|
30
31
|
export * from "./required-for-create.js";
|
|
31
32
|
export * from "./search.js";
|
|
32
33
|
export * from "./skip.js";
|
|
34
|
+
export * from "./term.js";
|
|
33
35
|
export * from "./top.js";
|
|
34
36
|
export * from "./workload-name-msa.js";
|
|
35
37
|
export * from "./workload-name.js";
|
|
@@ -38,4 +40,9 @@ export * from "./immutable.js";
|
|
|
38
40
|
export * from "./allowed-values.js";
|
|
39
41
|
export * from "./partial.js";
|
|
40
42
|
export * from "./experimental.js";
|
|
43
|
+
export * from "./graph-deprecated.js";
|
|
44
|
+
export * from "./ownerless.js";
|
|
45
|
+
export * from "./global-operation.js";
|
|
46
|
+
export * from "./reference-target.js";
|
|
47
|
+
export * from "./select.js";
|
|
41
48
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,kCAAkC,CAAC;AACjD,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;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cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC"}
|
|
@@ -9,7 +9,7 @@ export function $isOwner(context, target, value) {
|
|
|
9
9
|
context.program.stateMap(isOwnerKey).set(target, value);
|
|
10
10
|
}
|
|
11
11
|
export function hasIsOwner(program, target) {
|
|
12
|
-
return program.
|
|
12
|
+
return program.stateMap(isOwnerKey).has(target);
|
|
13
13
|
}
|
|
14
14
|
export function getIsOwnerAttribute(program, target) {
|
|
15
15
|
return program.stateMap(isOwnerKey).get(target);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DecoratorContext, Interface, Program } from "@typespec/compiler";
|
|
2
|
+
/**
|
|
3
|
+
* `@ownerless` - mark an interface as ownerless
|
|
4
|
+
* '@ownerless' can only be applied to Interfaces.
|
|
5
|
+
*/
|
|
6
|
+
export declare function $ownerless(context: DecoratorContext, target: Interface): void;
|
|
7
|
+
export declare function isOwnerless(program: Program, target: Interface): boolean;
|
|
8
|
+
//# sourceMappingURL=ownerless.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ownerless.d.ts","sourceRoot":"","sources":["../../../src/decorators/ownerless.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAI1E;;;GAGG;AAEH,wBAAgB,UAAU,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CAE7E;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,WAE9D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const ownerlessKey = Symbol("ownerless");
|
|
2
|
+
/**
|
|
3
|
+
* `@ownerless` - mark an interface as ownerless
|
|
4
|
+
* '@ownerless' can only be applied to Interfaces.
|
|
5
|
+
*/
|
|
6
|
+
export function $ownerless(context, target) {
|
|
7
|
+
context.program.stateSet(ownerlessKey).add(target);
|
|
8
|
+
}
|
|
9
|
+
export function isOwnerless(program, target) {
|
|
10
|
+
return program.stateSet(ownerlessKey).has(target);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ownerless.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ownerless.js","sourceRoot":"","sources":["../../../src/decorators/ownerless.ts"],"names":[],"mappings":"AAEA,MAAM,YAAY,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AAEzC;;;GAGG;AAEH,MAAM,UAAU,UAAU,CAAC,OAAyB,EAAE,MAAiB;IACrE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAAgB,EAAE,MAAiB;IAC7D,OAAO,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-namespace.d.ts","sourceRoot":"","sources":["../../../src/decorators/public-namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI1E;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,QAE7F;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,WAExE;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"public-namespace.d.ts","sourceRoot":"","sources":["../../../src/decorators/public-namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI1E;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,QAE7F;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,WAExE;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAKjG"}
|
|
@@ -11,6 +11,9 @@ export function hasPublicNamespace(program, namespace) {
|
|
|
11
11
|
return program.stateMap(publicNamespaceKey).has(namespace);
|
|
12
12
|
}
|
|
13
13
|
export function getPublicNamespaceName(program, namespace) {
|
|
14
|
-
|
|
14
|
+
if (hasPublicNamespace(program, namespace)) {
|
|
15
|
+
return program.stateMap(publicNamespaceKey).get(namespace);
|
|
16
|
+
}
|
|
17
|
+
return namespace.namespace ? getPublicNamespaceName(program, namespace.namespace) : undefined;
|
|
15
18
|
}
|
|
16
19
|
//# sourceMappingURL=public-namespace.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-namespace.js","sourceRoot":"","sources":["../../../src/decorators/public-namespace.ts"],"names":[],"mappings":"AAEA,MAAM,kBAAkB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAErD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAyB,EAAE,SAAoB,EAAE,IAAY;IAC5F,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAgB,EAAE,SAAoB;IACvE,OAAO,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,OAAgB,EAAE,SAAoB;IAC3E,OAAO,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"public-namespace.js","sourceRoot":"","sources":["../../../src/decorators/public-namespace.ts"],"names":[],"mappings":"AAEA,MAAM,kBAAkB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAErD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAyB,EAAE,SAAoB,EAAE,IAAY;IAC5F,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAgB,EAAE,SAAoB;IACvE,OAAO,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,OAAgB,EAAE,SAAoB;IAC3E,IAAG,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,EAAC;QACxC,OAAO,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;KAC5D;IACD,OAAO,SAAS,CAAC,SAAS,CAAA,CAAC,CAAC,sBAAsB,CAAC,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/F,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DecoratorContext, Interface, Program } from "@typespec/compiler";
|
|
2
|
+
/**
|
|
3
|
+
* @referenceTarget - Allows us to have non-contained navigation properties that reuse data contained in a different location
|
|
4
|
+
*
|
|
5
|
+
* @referenceTarget - Applies to interfaces
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export declare function $referenceTarget(context: DecoratorContext, target: Interface, value: string): void;
|
|
9
|
+
export declare function hasReferenceTarget(program: Program, target: Interface): boolean;
|
|
10
|
+
export declare function getReferenceTarget(program: Program, target: Interface): string;
|
|
11
|
+
export interface NavigationPropertyBinding {
|
|
12
|
+
Path: string;
|
|
13
|
+
Target: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function getNavigationPropertyBindingProperties(program: Program, $interface: Interface, graphRoute: string, collectionName: string): NavigationPropertyBinding | undefined;
|
|
16
|
+
//# sourceMappingURL=reference-target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-target.d.ts","sourceRoot":"","sources":["../../../src/decorators/reference-target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAI1E;;;;;GAKG;AAEH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,QAE3F;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAE/E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,CAE9E;AAGD,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,sCAAsC,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,yBAAyB,GAAG,SAAS,CAUjL"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { removeRoutePathParams } from "../utils.js";
|
|
2
|
+
const referenceTargetKey = Symbol("referenceTarget");
|
|
3
|
+
/**
|
|
4
|
+
* @referenceTarget - Allows us to have non-contained navigation properties that reuse data contained in a different location
|
|
5
|
+
*
|
|
6
|
+
* @referenceTarget - Applies to interfaces
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export function $referenceTarget(context, target, value) {
|
|
10
|
+
context.program.stateMap(referenceTargetKey).set(target, value);
|
|
11
|
+
}
|
|
12
|
+
export function hasReferenceTarget(program, target) {
|
|
13
|
+
return program.stateMap(referenceTargetKey).has(target);
|
|
14
|
+
}
|
|
15
|
+
export function getReferenceTarget(program, target) {
|
|
16
|
+
return program.stateMap(referenceTargetKey).get(target);
|
|
17
|
+
}
|
|
18
|
+
export function getNavigationPropertyBindingProperties(program, $interface, graphRoute, collectionName) {
|
|
19
|
+
const target = getReferenceTarget(program, $interface);
|
|
20
|
+
const path = getReferencePath(graphRoute, target, collectionName);
|
|
21
|
+
if (target && path) {
|
|
22
|
+
return {
|
|
23
|
+
Path: path,
|
|
24
|
+
Target: target
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
function getReferencePath(graphRoute, targetPath, collectionName) {
|
|
30
|
+
const targetPathSegments = targetPath.split('/');
|
|
31
|
+
let currentBestIndex = 0;
|
|
32
|
+
let finalPath = '';
|
|
33
|
+
const graphRouteSegments = removeRoutePathParams(graphRoute).split('/');
|
|
34
|
+
let index = 0;
|
|
35
|
+
while (index < graphRouteSegments.length && index < targetPathSegments.length) {
|
|
36
|
+
if (graphRouteSegments[index] === targetPathSegments[index]) {
|
|
37
|
+
index++;
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (index >= currentBestIndex) {
|
|
41
|
+
currentBestIndex = index;
|
|
42
|
+
finalPath = graphRouteSegments.slice(currentBestIndex).join('/');
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
// Removes the entityset/singleton name
|
|
47
|
+
if (finalPath.startsWith(collectionName + '/')) {
|
|
48
|
+
finalPath = finalPath.slice(collectionName.length + 1);
|
|
49
|
+
}
|
|
50
|
+
return finalPath;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=reference-target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-target.js","sourceRoot":"","sources":["../../../src/decorators/reference-target.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEpD,MAAM,kBAAkB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AACrD;;;;;GAKG;AAEH,MAAM,UAAU,gBAAgB,CAAC,OAAyB,EAAE,MAAiB,EAAE,KAAa;IAC1F,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,kBAAkB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,EAAC;YACzD,KAAK,EAAE,CAAC;YACR,SAAQ;SACT;QACD,IAAG,KAAK,IAAI,gBAAgB,EAAC;YAC3B,gBAAgB,GAAG,KAAK,CAAC;YACzB,SAAS,GAAG,kBAAkB,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAClE;QACD,MAAM;KACP;IAED,uCAAuC;IACvC,IAAG,SAAS,CAAC,UAAU,CAAC,cAAc,GAAC,GAAG,CAAC,EAAC;QAC1C,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;KACvD;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DecoratorContext, Operation, Program } from "@typespec/compiler";
|
|
2
|
+
/**
|
|
3
|
+
* `@select` - mark an operation as supporting the $select query parameter
|
|
4
|
+
*
|
|
5
|
+
* `@select` can only be applied to operations.
|
|
6
|
+
*/
|
|
7
|
+
export declare function $select(context: DecoratorContext, operation: Operation): void;
|
|
8
|
+
export declare function isSelect(program: Program, operation: Operation): boolean;
|
|
9
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/decorators/select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAI1E;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,QAEtE;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,WAE9D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const selectKey = Symbol("select");
|
|
2
|
+
/**
|
|
3
|
+
* `@select` - mark an operation as supporting the $select query parameter
|
|
4
|
+
*
|
|
5
|
+
* `@select` can only be applied to operations.
|
|
6
|
+
*/
|
|
7
|
+
export function $select(context, operation) {
|
|
8
|
+
context.program.stateSet(selectKey).add(operation);
|
|
9
|
+
}
|
|
10
|
+
export function isSelect(program, operation) {
|
|
11
|
+
return program.stateSet(selectKey).has(operation);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/decorators/select.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAEnC;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,OAAyB,EAAE,SAAoB;IACrE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,OAAgB,EAAE,SAAoB;IAC7D,OAAO,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DecoratorContext, Namespace, Program, Scalar } from "@typespec/compiler";
|
|
2
|
+
export interface TermParameters {
|
|
3
|
+
name: string;
|
|
4
|
+
type: Scalar;
|
|
5
|
+
description: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* `@term` - Applies to: namespaces.
|
|
9
|
+
* Indicates that a workload wishes to require or return instance annotations in their request / response packets at runtime.
|
|
10
|
+
*/
|
|
11
|
+
export declare function $term(context: DecoratorContext, target: Namespace, name: string, type: Scalar, description: string): void;
|
|
12
|
+
export declare function getTerms(program: Program, target: Namespace): Map<string, TermParameters>;
|
|
13
|
+
//# sourceMappingURL=term.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"term.d.ts","sourceRoot":"","sources":["../../../src/decorators/term.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAIlF,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,KAAK,CACnB,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,QAMpB;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAEzF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const termKey = Symbol("term");
|
|
2
|
+
/**
|
|
3
|
+
* `@term` - Applies to: namespaces.
|
|
4
|
+
* Indicates that a workload wishes to require or return instance annotations in their request / response packets at runtime.
|
|
5
|
+
*/
|
|
6
|
+
export function $term(context, target, name, type, description) {
|
|
7
|
+
const terms = getTerms(context.program, target);
|
|
8
|
+
terms.set(name, { name, type, description });
|
|
9
|
+
context.program.stateMap(termKey).set(target, terms);
|
|
10
|
+
}
|
|
11
|
+
export function getTerms(program, target) {
|
|
12
|
+
return program.stateMap(termKey).get(target) || new Map();
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=term.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"term.js","sourceRoot":"","sources":["../../../src/decorators/term.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAQ/B;;;GAGG;AACH,MAAM,UAAU,KAAK,CACnB,OAAyB,EACzB,MAAiB,EACjB,IAAY,EACZ,IAAY,EACZ,WAAmB;IAEnB,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAChD,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;IAE7C,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,OAAgB,EAAE,MAAiB;IAC1D,OAAO,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,EAA0B,CAAC;AACpF,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Program, Interface } from "@typespec/compiler";
|
|
2
|
+
export type MsGraphAddressUrl = Record<string, string | boolean>;
|
|
3
|
+
export declare function getMsGraphAddressUrl(program: Program, target: Interface): MsGraphAddressUrl | undefined;
|
|
4
|
+
//# sourceMappingURL=address-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address-url.d.ts","sourceRoot":"","sources":["../../../src/entities/address-url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGxD,MAAM,MAAO,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAEnE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,iBAAiB,GAAG,SAAS,CAevG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getAddressUrl, hasAddressUrl } from "../index.js";
|
|
2
|
+
export function getMsGraphAddressUrl(program, target) {
|
|
3
|
+
if (hasAddressUrl(program, target)) {
|
|
4
|
+
const addressUrl = getAddressUrl(program, target);
|
|
5
|
+
const msGraphAddressUrl = {
|
|
6
|
+
"ags:AddressUrl": addressUrl.url,
|
|
7
|
+
};
|
|
8
|
+
if (addressUrl.omitRootNavigationSegment) {
|
|
9
|
+
msGraphAddressUrl["ags:AddressContainsEntitySetSegment"] = true;
|
|
10
|
+
}
|
|
11
|
+
if (addressUrl.appendSegmentNameToAddress) {
|
|
12
|
+
msGraphAddressUrl["ags:AppendSegmentNameToAddress"] = true;
|
|
13
|
+
}
|
|
14
|
+
return msGraphAddressUrl;
|
|
15
|
+
}
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=address-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address-url.js","sourceRoot":"","sources":["../../../src/entities/address-url.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAI3D,MAAM,UAAU,oBAAoB,CAAC,OAAgB,EAAE,MAAiB;IACtE,IAAG,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;QACjC,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,EAAE,MAAM,CAAE,CAAC;QACnD,MAAM,iBAAiB,GAAsB;YAC3C,gBAAgB,EAAE,UAAU,CAAC,GAAG;SACjC,CAAA;QACD,IAAI,UAAU,CAAC,yBAAyB,EAAE;YACxC,iBAAiB,CAAC,qCAAqC,CAAC,GAAG,IAAI,CAAC;SACjE;QACD,IAAI,UAAU,CAAC,0BAA0B,EAAE;YACzC,iBAAiB,CAAC,gCAAgC,CAAC,GAAG,IAAI,CAAC;SAC5D;QACD,OAAO,iBAAiB,CAAC;KAC1B;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -9,6 +9,9 @@ export interface ResourceAnnotations {
|
|
|
9
9
|
HasExpandOnCollectionOrResource: boolean;
|
|
10
10
|
NonExpandableProperties: string[] | undefined;
|
|
11
11
|
Description: string | undefined;
|
|
12
|
+
HasContainsOrReferences: boolean;
|
|
13
|
+
ExplicitBindingOperationNames: string[];
|
|
14
|
+
IsSelectable: boolean;
|
|
12
15
|
}
|
|
13
16
|
export interface CollectionAnnotations {
|
|
14
17
|
Target: string | undefined;
|
|
@@ -29,6 +32,9 @@ export interface CollectionAnnotations {
|
|
|
29
32
|
NonSortableProperties: string[] | undefined;
|
|
30
33
|
HasTopOnCollection: boolean;
|
|
31
34
|
Description: string | undefined;
|
|
35
|
+
HasContainsOrReferences: boolean;
|
|
36
|
+
ExplicitBindingOperationNames: string[];
|
|
37
|
+
IsSelectable: boolean;
|
|
32
38
|
}
|
|
33
39
|
export interface AllowedValuesAnnotations {
|
|
34
40
|
Target: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../../src/entities/annotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAmC,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAoC,MAAM,aAAa,CAAC;AAGjF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,+BAA+B,EAAE,OAAO,CAAC;IACzC,uBAAuB,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC9C,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../../src/entities/annotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAmC,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAoC,MAAM,aAAa,CAAC;AAGjF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEzD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AAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,aAAa,CAAC;CAC9B;AAQD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAQlK;AAwDD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAQ5J;AAkID,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAiB7J"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getDoc, walkPropertiesInherited } from "@typespec/compiler";
|
|
2
2
|
import { getInterfaceNavigationSourceType } from "../utils.js";
|
|
3
3
|
import { getOperationVerb } from "@typespec/http";
|
|
4
|
-
import { getExpand, getFilter, getOrderBy, isContains, isCount, isExpand, isFilter, isOrderBy, isReferences, isRequiredForCreate, isSearch, isSkip, isTop, resolveOperationParametersForGraphRoute } from "../index.js";
|
|
4
|
+
import { getAction, getExpand, getFilter, getFunction, getOrderBy, isAction, isContains, isCount, isExpand, isFilter, isFunction, isOrderBy, isReferences, isRequiredForCreate, isSearch, isSelect, isSkip, isTop, resolveOperationParametersForGraphRoute } from "../index.js";
|
|
5
5
|
export function GetResourceAnnotations(program, namespaceName, navigationSources) {
|
|
6
6
|
const annotations = new Map();
|
|
7
7
|
navigationSources.forEach((entity, routePath) => {
|
|
@@ -12,6 +12,7 @@ export function GetResourceAnnotations(program, namespaceName, navigationSources
|
|
|
12
12
|
function getResourceAnnotations(program, namespaceName, routePath, entity) {
|
|
13
13
|
const resource = entity.theInterface;
|
|
14
14
|
const type = getInterfaceNavigationSourceType(program, resource);
|
|
15
|
+
const hasContainsOrReferences = [...walkPropertiesInherited(type)].some((property) => isContains(program, property) || isReferences(program, property));
|
|
15
16
|
const minimumParameters = routePath.split('/').length - 1;
|
|
16
17
|
const operationMethods = [...entity.operations].map(({ theOperation, graphRoute }) => ({
|
|
17
18
|
operation: theOperation,
|
|
@@ -19,6 +20,8 @@ function getResourceAnnotations(program, namespaceName, routePath, entity) {
|
|
|
19
20
|
hasMinimumParameters: resolveOperationParametersForGraphRoute(theOperation, graphRoute).size === minimumParameters,
|
|
20
21
|
}));
|
|
21
22
|
const [hasExpandOnCollectionOrResource, nonExpandableProperties] = getExpandProperties(program, type, operationMethods);
|
|
23
|
+
const explicitBindingOperationNames = getExplicitBindingOperationNames(program, entity);
|
|
24
|
+
const isSelectable = operationMethods.some(({ operation }) => isSelect(program, operation));
|
|
22
25
|
const annotations = {
|
|
23
26
|
Target: `${namespaceName}.container/${routePath}`,
|
|
24
27
|
HasGetOnResource: operationMethods.some(({ verb }) => verb === "get"),
|
|
@@ -27,9 +30,24 @@ function getResourceAnnotations(program, namespaceName, routePath, entity) {
|
|
|
27
30
|
HasExpandOnCollectionOrResource: hasExpandOnCollectionOrResource,
|
|
28
31
|
NonExpandableProperties: nonExpandableProperties,
|
|
29
32
|
Description: getDoc(program, resource),
|
|
33
|
+
HasContainsOrReferences: hasContainsOrReferences,
|
|
34
|
+
ExplicitBindingOperationNames: explicitBindingOperationNames,
|
|
35
|
+
IsSelectable: isSelectable,
|
|
30
36
|
};
|
|
31
37
|
return annotations;
|
|
32
38
|
}
|
|
39
|
+
function getExplicitBindingOperationNames(program, entity) {
|
|
40
|
+
const actionAndFunctionOperations = Object.values(entity.operations).
|
|
41
|
+
filter(({ theOperation }) => isAction(program, theOperation) || isFunction(program, theOperation));
|
|
42
|
+
return actionAndFunctionOperations.
|
|
43
|
+
map(({ theOperation }) => {
|
|
44
|
+
if (isAction(program, theOperation)) {
|
|
45
|
+
return getAction(program, theOperation) || '';
|
|
46
|
+
}
|
|
47
|
+
return getFunction(program, theOperation) || '';
|
|
48
|
+
}).
|
|
49
|
+
map(value => 'microsoft.graph.' + value);
|
|
50
|
+
}
|
|
33
51
|
export function GetCollectionAnnotations(program, namespaceName, sources) {
|
|
34
52
|
const annotations = new Map();
|
|
35
53
|
sources.forEach((entity, routePath) => {
|
|
@@ -40,6 +58,7 @@ export function GetCollectionAnnotations(program, namespaceName, sources) {
|
|
|
40
58
|
function getCollectionAnnotations(program, namespaceName, routePath, entity) {
|
|
41
59
|
const collection = entity.theInterface;
|
|
42
60
|
const type = getInterfaceNavigationSourceType(program, collection);
|
|
61
|
+
const hasContainsOrReferences = [...walkPropertiesInherited(type)].some((property) => isContains(program, property) || isReferences(program, property));
|
|
43
62
|
const minimumParameters = routePath.split('/').length - 1;
|
|
44
63
|
const operationMethods = entity.operations.map(({ theOperation, graphRoute }) => ({
|
|
45
64
|
operation: theOperation,
|
|
@@ -49,6 +68,8 @@ function getCollectionAnnotations(program, namespaceName, routePath, entity) {
|
|
|
49
68
|
const [hasFilterOperation, nonFilterableProperties] = getFilterProperties(program, type, operationMethods);
|
|
50
69
|
const [hasExpandOnCollectionOrResource, nonExpandableProperties] = getExpandProperties(program, type, operationMethods);
|
|
51
70
|
const [hasSortOnCollection, nonSortableProperties] = getSortProperties(program, type, operationMethods);
|
|
71
|
+
const explicitBindingOperationNames = getExplicitBindingOperationNames(program, entity);
|
|
72
|
+
const isSelectable = operationMethods.some(({ operation }) => isSelect(program, operation));
|
|
52
73
|
const annotations = {
|
|
53
74
|
Target: `${namespaceName}.container/${routePath}`,
|
|
54
75
|
HasGetOnCollection: operationMethods.some(m => m.hasMinimumParameters && m.verb === "get"),
|
|
@@ -68,6 +89,9 @@ function getCollectionAnnotations(program, namespaceName, routePath, entity) {
|
|
|
68
89
|
NonSortableProperties: nonSortableProperties,
|
|
69
90
|
HasTopOnCollection: operationMethods.some(m => isTop(program, m.operation)),
|
|
70
91
|
Description: getDoc(program, collection),
|
|
92
|
+
HasContainsOrReferences: hasContainsOrReferences,
|
|
93
|
+
ExplicitBindingOperationNames: explicitBindingOperationNames,
|
|
94
|
+
IsSelectable: isSelectable,
|
|
71
95
|
};
|
|
72
96
|
return annotations;
|
|
73
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotations.js","sourceRoot":"","sources":["../../../src/entities/annotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,MAAM,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAoB,gCAAgC,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAY,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,uCAAuC,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"annotations.js","sourceRoot":"","sources":["../../../src/entities/annotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,MAAM,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAoB,gCAAgC,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAY,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,KA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G,CAAA,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,aAAa,0CAAE,MAAM,0CAAE,MAAM,IAAG,CAAC,EAAE;oBAC9C,WAAW,CAAC,GAAG,CAAC,GAAG,aAAa,IAAI,KAAK,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE;wBACjE,MAAM,EAAE,GAAG,aAAa,IAAI,KAAK,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,EAAE;wBACzD,aAAa,EAAE,QAAQ,CAAC,aAAa;qBACtC,CAAC,CAAA;iBACH;YACH,CAAC,CAAC,CAAA;SACH;KACF;IAAA,CAAC;IACF,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import { Program } from "@typespec/compiler";
|
|
2
2
|
import { MsGraphInterface } from "../utils.js";
|
|
3
|
+
import { MsGraphAddressUrl } from "./address-url.js";
|
|
4
|
+
interface NavigationPropertyBinding {
|
|
5
|
+
Path: string;
|
|
6
|
+
Target: string;
|
|
7
|
+
}
|
|
3
8
|
export interface Singleton {
|
|
4
9
|
Name: string | undefined;
|
|
5
10
|
TypeName: string;
|
|
6
11
|
AgsAttributes: Record<string, string>;
|
|
12
|
+
NavigationPropertyBindingProperties?: NavigationPropertyBinding;
|
|
13
|
+
AddressUrl: MsGraphAddressUrl | undefined;
|
|
7
14
|
}
|
|
8
15
|
export interface EntitySet {
|
|
9
16
|
Name: string | undefined;
|
|
10
17
|
TypeName: string;
|
|
11
18
|
AgsAttributes: Record<string, string | boolean | undefined>;
|
|
19
|
+
NavigationPropertyBindingProperties?: NavigationPropertyBinding;
|
|
20
|
+
AddressUrl: MsGraphAddressUrl | undefined;
|
|
12
21
|
}
|
|
13
22
|
export declare function GetSingletons(program: Program, sources: Map<string, MsGraphInterface>): Map<string, Singleton>;
|
|
14
23
|
export declare function GetEntitySets(program: Program, sources: Map<string, MsGraphInterface>): Map<string, EntitySet>;
|
|
24
|
+
export {};
|
|
15
25
|
//# sourceMappingURL=entity-container.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-container.d.ts","sourceRoot":"","sources":["../../../src/entities/entity-container.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACR,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAGL,gBAAgB,EAEjB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"entity-container.d.ts","sourceRoot":"","sources":["../../../src/entities/entity-container.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACR,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAGL,gBAAgB,EAEjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAwB,MAAM,kBAAkB,CAAC;AAE3E,UAAU,yBAAyB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,mCAAmC,CAAC,EAAE,yBAAyB,CAAC;IAChE,UAAU,EAAE,iBAAiB,GAAG,SAAS,CAAC;CAC3C;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;IAC5D,mCAAmC,CAAC,EAAE,yBAAyB,CAAC;IAChE,UAAU,EAAE,iBAAiB,GAAG,SAAS,CAAC;CAC3C;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAQ9G;AAmBD,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAQ9G"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { buildAttributes } from "../decorators/ags-attribute.js";
|
|
2
2
|
import { getPropertyTypeName, getInterfaceNavigationSourceType, } from "../utils.js";
|
|
3
|
+
import { getMsGraphAddressUrl } from "./address-url.js";
|
|
3
4
|
export function GetSingletons(program, sources) {
|
|
4
5
|
const singletons = new Map();
|
|
5
6
|
sources.forEach((entity, routePath) => {
|
|
@@ -15,6 +16,7 @@ function getSingleton(program, routePath, entity) {
|
|
|
15
16
|
Name: routePath,
|
|
16
17
|
TypeName: getPropertyTypeName(program, type),
|
|
17
18
|
AgsAttributes: agsAttributes,
|
|
19
|
+
AddressUrl: getMsGraphAddressUrl(program, singleton),
|
|
18
20
|
};
|
|
19
21
|
return entry;
|
|
20
22
|
}
|
|
@@ -33,6 +35,7 @@ function getEntitySet(program, routePath, entity) {
|
|
|
33
35
|
Name: routePath,
|
|
34
36
|
TypeName: getPropertyTypeName(program, type),
|
|
35
37
|
AgsAttributes: agsAttributes,
|
|
38
|
+
AddressUrl: getMsGraphAddressUrl(program, entitySet),
|
|
36
39
|
};
|
|
37
40
|
return entry;
|
|
38
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-container.js","sourceRoot":"","sources":["../../../src/entities/entity-container.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EACL,mBAAmB,EACnB,gCAAgC,GAGjC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"entity-container.js","sourceRoot":"","sources":["../../../src/entities/entity-container.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MA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,CAAC,IAAI;QACnB,aAAa,EAAE,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC;QACjD,kBAAkB,EAAE,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,SAAS,CAAC;QACjF,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACjF,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC;KACpC,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,oBAAoB,CAAC,OAAgB,EAAE,MAAkB;;IAChE,MAAM,OAAO,GAAsB;QACjC,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,aAAa,EAAE,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC;QAC/C,kBAAkB,EAAE,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAA,MAAM,CAAC,IAAI,0CAAE,SAAS,CAAC;KACnF,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Model, ModelProperty, Program } from "@typespec/compiler";
|
|
2
2
|
import { RevisionDefinition } from "./revision-definition.js";
|
|
3
|
+
import { MsGraphAddressUrl } from "./address-url.js";
|
|
3
4
|
export interface MsGraphModel {
|
|
4
5
|
Kind: MsGraphModelKind;
|
|
5
6
|
Name: string;
|
|
@@ -39,6 +40,7 @@ export interface MsGraphModelProperty {
|
|
|
39
40
|
isImmutable: boolean;
|
|
40
41
|
allowedValues: AllowedValues;
|
|
41
42
|
IsCollection: boolean;
|
|
43
|
+
AddressUrl: MsGraphAddressUrl | undefined;
|
|
42
44
|
}
|
|
43
45
|
export interface AlternateKeyProperty {
|
|
44
46
|
IsModel: boolean;
|