@microsoft/typespec-msgraph 0.0.1-Preview.20 → 0.0.1-Preview.22
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.js +2 -2
- package/dist/src/components/entity-container-element.d.ts.map +1 -1
- package/dist/src/components/entity-container-element.js +6 -2
- package/dist/src/components/entity-container-element.js.map +1 -1
- package/dist/src/components/enum-type-element.js +1 -1
- package/dist/src/components/enum-type-element.js.map +1 -1
- package/dist/src/components/property-element.d.ts.map +1 -1
- package/dist/src/components/property-element.js +2 -2
- package/dist/src/components/property-element.js.map +1 -1
- package/dist/src/components/schema-element.d.ts.map +1 -1
- package/dist/src/components/schema-element.js +4 -1
- package/dist/src/components/schema-element.js.map +1 -1
- package/dist/src/decorators/abstract.d.ts +2 -0
- package/dist/src/decorators/abstract.d.ts.map +1 -1
- package/dist/src/decorators/abstract.js +2 -0
- package/dist/src/decorators/abstract.js.map +1 -1
- package/dist/src/decorators/action.d.ts +2 -0
- package/dist/src/decorators/action.d.ts.map +1 -1
- package/dist/src/decorators/action.js +2 -0
- package/dist/src/decorators/action.js.map +1 -1
- package/dist/src/decorators/additional-query-parameters.d.ts +2 -0
- package/dist/src/decorators/additional-query-parameters.d.ts.map +1 -1
- package/dist/src/decorators/additional-query-parameters.js +2 -0
- package/dist/src/decorators/additional-query-parameters.js.map +1 -1
- package/dist/src/decorators/address-url-msa.d.ts +2 -0
- package/dist/src/decorators/address-url-msa.d.ts.map +1 -1
- package/dist/src/decorators/address-url-msa.js +2 -0
- package/dist/src/decorators/address-url-msa.js.map +1 -1
- package/dist/src/decorators/ags-attribute.d.ts +2 -2
- package/dist/src/decorators/ags-attribute.d.ts.map +1 -1
- package/dist/src/decorators/ags-attribute.js +24 -23
- package/dist/src/decorators/ags-attribute.js.map +1 -1
- package/dist/src/decorators/contains.d.ts +2 -0
- package/dist/src/decorators/contains.d.ts.map +1 -1
- package/dist/src/decorators/contains.js +2 -0
- package/dist/src/decorators/contains.js.map +1 -1
- package/dist/src/decorators/deprecated-definition.d.ts +2 -0
- package/dist/src/decorators/deprecated-definition.d.ts.map +1 -1
- package/dist/src/decorators/deprecated-definition.js.map +1 -1
- package/dist/src/decorators/expand.d.ts +2 -0
- package/dist/src/decorators/expand.d.ts.map +1 -1
- package/dist/src/decorators/expand.js +2 -0
- package/dist/src/decorators/expand.js.map +1 -1
- package/dist/src/decorators/experimental.d.ts +2 -0
- package/dist/src/decorators/experimental.d.ts.map +1 -1
- package/dist/src/decorators/experimental.js +2 -0
- package/dist/src/decorators/experimental.js.map +1 -1
- package/dist/src/decorators/function.d.ts +2 -0
- package/dist/src/decorators/function.d.ts.map +1 -1
- package/dist/src/decorators/function.js +3 -1
- package/dist/src/decorators/function.js.map +1 -1
- package/dist/src/decorators/global-operation.d.ts +2 -0
- package/dist/src/decorators/global-operation.d.ts.map +1 -1
- package/dist/src/decorators/global-operation.js +2 -0
- package/dist/src/decorators/global-operation.js.map +1 -1
- package/dist/src/decorators/graph-deprecated.d.ts +2 -0
- package/dist/src/decorators/graph-deprecated.d.ts.map +1 -1
- package/dist/src/decorators/graph-deprecated.js +2 -0
- package/dist/src/decorators/graph-deprecated.js.map +1 -1
- package/dist/src/decorators/graph-route.d.ts +2 -0
- package/dist/src/decorators/graph-route.d.ts.map +1 -1
- package/dist/src/decorators/graph-route.js +33 -1
- package/dist/src/decorators/graph-route.js.map +1 -1
- package/dist/src/decorators/graphFlags.d.ts +11 -0
- package/dist/src/decorators/graphFlags.d.ts.map +1 -0
- package/dist/src/decorators/graphFlags.js +15 -0
- package/dist/src/decorators/graphFlags.js.map +1 -0
- package/dist/src/decorators/immutable.d.ts +2 -0
- package/dist/src/decorators/immutable.d.ts.map +1 -1
- package/dist/src/decorators/immutable.js +2 -0
- package/dist/src/decorators/immutable.js.map +1 -1
- package/dist/src/decorators/index.d.ts +2 -1
- package/dist/src/decorators/index.d.ts.map +1 -1
- package/dist/src/decorators/index.js +2 -1
- package/dist/src/decorators/index.js.map +1 -1
- package/dist/src/decorators/is-owner.d.ts +2 -0
- package/dist/src/decorators/is-owner.d.ts.map +1 -1
- package/dist/src/decorators/is-owner.js +2 -0
- package/dist/src/decorators/is-owner.js.map +1 -1
- package/dist/src/decorators/limited-charset.d.ts +2 -0
- package/dist/src/decorators/limited-charset.d.ts.map +1 -1
- package/dist/src/decorators/limited-charset.js +2 -0
- package/dist/src/decorators/limited-charset.js.map +1 -1
- package/dist/src/decorators/media.d.ts +2 -0
- package/dist/src/decorators/media.d.ts.map +1 -1
- package/dist/src/decorators/media.js +2 -0
- package/dist/src/decorators/media.js.map +1 -1
- package/dist/src/decorators/open.d.ts +2 -0
- package/dist/src/decorators/open.d.ts.map +1 -1
- package/dist/src/decorators/open.js +2 -0
- package/dist/src/decorators/open.js.map +1 -1
- package/dist/src/decorators/operation-parameters.d.ts +2 -0
- package/dist/src/decorators/operation-parameters.d.ts.map +1 -1
- package/dist/src/decorators/operation-parameters.js +2 -0
- package/dist/src/decorators/operation-parameters.js.map +1 -1
- package/dist/src/decorators/ownerless.d.ts +2 -0
- package/dist/src/decorators/ownerless.d.ts.map +1 -1
- package/dist/src/decorators/ownerless.js +2 -0
- package/dist/src/decorators/ownerless.js.map +1 -1
- package/dist/src/decorators/passthrough-address-url-msa.d.ts +4 -1
- package/dist/src/decorators/passthrough-address-url-msa.d.ts.map +1 -1
- package/dist/src/decorators/passthrough-address-url-msa.js +4 -1
- package/dist/src/decorators/passthrough-address-url-msa.js.map +1 -1
- package/dist/src/decorators/passthrough-address-url.d.ts +4 -1
- package/dist/src/decorators/passthrough-address-url.d.ts.map +1 -1
- package/dist/src/decorators/passthrough-address-url.js +4 -1
- package/dist/src/decorators/passthrough-address-url.js.map +1 -1
- package/dist/src/decorators/prefixed-graph-routes.d.ts +10 -0
- package/dist/src/decorators/prefixed-graph-routes.d.ts.map +1 -0
- package/dist/src/decorators/prefixed-graph-routes.js +27 -0
- package/dist/src/decorators/prefixed-graph-routes.js.map +1 -0
- package/dist/src/decorators/private-preview.d.ts +2 -2
- package/dist/src/decorators/private-preview.d.ts.map +1 -1
- package/dist/src/decorators/private-preview.js.map +1 -1
- package/dist/src/decorators/privileged.d.ts +2 -0
- package/dist/src/decorators/privileged.d.ts.map +1 -1
- package/dist/src/decorators/privileged.js +2 -0
- package/dist/src/decorators/privileged.js.map +1 -1
- package/dist/src/decorators/read-only.d.ts +2 -0
- package/dist/src/decorators/read-only.d.ts.map +1 -1
- package/dist/src/decorators/read-only.js +2 -0
- package/dist/src/decorators/read-only.js.map +1 -1
- package/dist/src/decorators/reference-target.d.ts +1 -0
- package/dist/src/decorators/reference-target.d.ts.map +1 -1
- package/dist/src/decorators/reference-target.js +1 -0
- package/dist/src/decorators/reference-target.js.map +1 -1
- package/dist/src/decorators/references.d.ts +2 -0
- package/dist/src/decorators/references.d.ts.map +1 -1
- package/dist/src/decorators/references.js +2 -0
- package/dist/src/decorators/references.js.map +1 -1
- package/dist/src/decorators/return-source.d.ts +2 -0
- package/dist/src/decorators/return-source.d.ts.map +1 -1
- package/dist/src/decorators/return-source.js +2 -0
- package/dist/src/decorators/return-source.js.map +1 -1
- package/dist/src/decorators/select.d.ts +2 -0
- package/dist/src/decorators/select.d.ts.map +1 -1
- package/dist/src/decorators/select.js +2 -0
- package/dist/src/decorators/select.js.map +1 -1
- package/dist/src/decorators/workload-name-msa.d.ts +2 -0
- package/dist/src/decorators/workload-name-msa.d.ts.map +1 -1
- package/dist/src/decorators/workload-name-msa.js +2 -0
- package/dist/src/decorators/workload-name-msa.js.map +1 -1
- package/dist/src/decorators/workload-name.d.ts +2 -0
- package/dist/src/decorators/workload-name.d.ts.map +1 -1
- package/dist/src/decorators/workload-name.js +2 -0
- package/dist/src/decorators/workload-name.js.map +1 -1
- package/dist/src/decorators/workload-namespace.d.ts +2 -0
- package/dist/src/decorators/workload-namespace.d.ts.map +1 -1
- package/dist/src/decorators/workload-namespace.js +2 -0
- package/dist/src/decorators/workload-namespace.js.map +1 -1
- package/dist/src/decorators/write-only.d.ts +2 -0
- package/dist/src/decorators/write-only.d.ts.map +1 -1
- package/dist/src/decorators/write-only.js +2 -0
- package/dist/src/decorators/write-only.js.map +1 -1
- package/dist/src/emitter.d.ts.map +1 -1
- package/dist/src/emitter.js +9 -6
- package/dist/src/emitter.js.map +1 -1
- package/dist/src/entities/address-url.js +2 -2
- package/dist/src/entities/address-url.js.map +1 -1
- package/dist/src/entities/annotations.d.ts +2 -2
- package/dist/src/entities/annotations.d.ts.map +1 -1
- package/dist/src/entities/annotations.js +15 -15
- package/dist/src/entities/annotations.js.map +1 -1
- package/dist/src/entities/entity-container.d.ts +3 -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.d.ts +1 -1
- package/dist/src/entities/enum.d.ts.map +1 -1
- package/dist/src/entities/enum.js +8 -6
- package/dist/src/entities/enum.js.map +1 -1
- package/dist/src/entities/model.d.ts +19 -11
- package/dist/src/entities/model.d.ts.map +1 -1
- package/dist/src/entities/model.js +100 -34
- package/dist/src/entities/model.js.map +1 -1
- package/dist/src/entities/ms-graph-route.d.ts.map +1 -1
- package/dist/src/entities/ms-graph-route.js +6 -9
- package/dist/src/entities/ms-graph-route.js.map +1 -1
- package/dist/src/entities/namespace.d.ts +12 -0
- package/dist/src/entities/namespace.d.ts.map +1 -1
- package/dist/src/entities/namespace.js +176 -17
- package/dist/src/entities/namespace.js.map +1 -1
- package/dist/src/entities/operation.d.ts +5 -0
- package/dist/src/entities/operation.d.ts.map +1 -1
- package/dist/src/entities/operation.js +59 -3
- package/dist/src/entities/operation.js.map +1 -1
- package/dist/src/entities/revision-definition.d.ts +2 -2
- package/dist/src/entities/revision-definition.d.ts.map +1 -1
- package/dist/src/entities/revision-definition.js +14 -3
- package/dist/src/entities/revision-definition.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +11 -0
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +10 -2
- package/dist/src/lib.js.map +1 -1
- package/dist/src/linter.d.ts.map +1 -1
- package/dist/src/linter.js +14 -2
- package/dist/src/linter.js.map +1 -1
- package/dist/src/rules/address-url.d.ts +1 -0
- package/dist/src/rules/address-url.d.ts.map +1 -1
- package/dist/src/rules/address-url.js +85 -3
- package/dist/src/rules/address-url.js.map +1 -1
- package/dist/src/rules/delta.d.ts.map +1 -1
- package/dist/src/rules/delta.js +6 -7
- package/dist/src/rules/delta.js.map +1 -1
- package/dist/src/rules/documentation.d.ts +4 -0
- package/dist/src/rules/documentation.d.ts.map +1 -0
- package/dist/src/rules/documentation.js +88 -0
- package/dist/src/rules/documentation.js.map +1 -0
- package/dist/src/rules/entity.d.ts +3 -0
- package/dist/src/rules/entity.d.ts.map +1 -1
- package/dist/src/rules/entity.js +32 -5
- 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 -1
- package/dist/src/rules/enum.js +27 -1
- package/dist/src/rules/enum.js.map +1 -1
- package/dist/src/rules/expand.d.ts.map +1 -1
- package/dist/src/rules/expand.js +3 -6
- package/dist/src/rules/expand.js.map +1 -1
- package/dist/src/rules/filter.js +7 -7
- package/dist/src/rules/filter.js.map +1 -1
- package/dist/src/rules/function.d.ts +1 -0
- package/dist/src/rules/function.d.ts.map +1 -1
- package/dist/src/rules/function.js +39 -0
- package/dist/src/rules/function.js.map +1 -1
- package/dist/src/rules/graph-route.d.ts +1 -0
- package/dist/src/rules/graph-route.d.ts.map +1 -1
- package/dist/src/rules/graph-route.js +72 -1
- package/dist/src/rules/graph-route.js.map +1 -1
- package/dist/src/rules/index.d.ts +1 -0
- package/dist/src/rules/index.d.ts.map +1 -1
- package/dist/src/rules/index.js +1 -0
- package/dist/src/rules/index.js.map +1 -1
- package/dist/src/rules/model.d.ts +5 -0
- package/dist/src/rules/model.d.ts.map +1 -1
- package/dist/src/rules/model.js +73 -3
- package/dist/src/rules/model.js.map +1 -1
- package/dist/src/rules/operation-inside-interface.d.ts +3 -0
- package/dist/src/rules/operation-inside-interface.d.ts.map +1 -1
- package/dist/src/rules/operation-inside-interface.js +36 -2
- package/dist/src/rules/operation-inside-interface.js.map +1 -1
- package/dist/src/rules/order-by.js +3 -3
- package/dist/src/rules/order-by.js.map +1 -1
- package/dist/src/rules/ownerless.d.ts.map +1 -1
- package/dist/src/rules/ownerless.js +3 -6
- package/dist/src/rules/ownerless.js.map +1 -1
- package/dist/src/rules/record-t.d.ts +6 -0
- package/dist/src/rules/record-t.d.ts.map +1 -1
- package/dist/src/rules/record-t.js +48 -1
- package/dist/src/rules/record-t.js.map +1 -1
- package/dist/src/rules/required-for-create.d.ts.map +1 -1
- package/dist/src/rules/required-for-create.js +4 -5
- package/dist/src/rules/required-for-create.js.map +1 -1
- package/dist/src/utils.d.ts +20 -4
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +222 -113
- package/dist/src/utils.js.map +1 -1
- package/dist/src/validate.d.ts.map +1 -1
- package/dist/src/validate.js +5 -0
- package/dist/src/validate.js.map +1 -1
- package/lib/decorators.tsp +24 -12
- package/lib/shared-models.tsp +5 -0
- package/package.json +4 -5
- package/dist/src/decorators/flags.d.ts +0 -9
- package/dist/src/decorators/flags.d.ts.map +0 -1
- package/dist/src/decorators/flags.js +0 -13
- package/dist/src/decorators/flags.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getDoc, walkPropertiesInherited } from "@typespec/compiler";
|
|
2
|
-
import { getInterfaceNavigationSourceType,
|
|
3
|
-
import { getAction, getExpand, getFilter, getFunction, getOrderBy, isAction,
|
|
2
|
+
import { getInterfaceNavigationSourceType, getModelStructuralPropertyNames, isInterfaceBindingTypeOwned, isRouteIndexOfACollection, isNavigationProperty } from "../utils.js";
|
|
3
|
+
import { getAction, getExpand, getFilter, getFunction, getOrderBy, isAction, isCount, isExpand, isFilter, isFunction, isOrderBy, isRequiredForCreate, isSearch, isSelect, isSkip, isTop } from "../index.js";
|
|
4
4
|
export function GetResourceAnnotations(program, namespaceName, navigationSources) {
|
|
5
5
|
const annotations = new Map();
|
|
6
6
|
navigationSources.forEach((entity, routePath) => {
|
|
@@ -18,7 +18,7 @@ export function GetResourceAnnotations(program, namespaceName, navigationSources
|
|
|
18
18
|
function getResourceAnnotations(program, namespaceName, routePath, entity) {
|
|
19
19
|
const resource = entity.theInterface;
|
|
20
20
|
const type = getInterfaceNavigationSourceType(program, resource);
|
|
21
|
-
const
|
|
21
|
+
const hasNavigationProperties = [...walkPropertiesInherited(type)].some((property) => isNavigationProperty(program, property));
|
|
22
22
|
const [hasExpandOnCollectionOrResource, nonExpandableProperties] = getExpandProperties(program, type, entity.operations);
|
|
23
23
|
const explicitBindingOperationNames = getExplicitBindingOperationNames(program, entity);
|
|
24
24
|
const isSelectable = entity.operations.some(o => isSelect(program, o.theOperation));
|
|
@@ -31,7 +31,7 @@ function getResourceAnnotations(program, namespaceName, routePath, entity) {
|
|
|
31
31
|
HasExpandOnCollectionOrResource: hasExpandOnCollectionOrResource,
|
|
32
32
|
NonExpandableProperties: nonExpandableProperties,
|
|
33
33
|
Description: getDoc(program, resource),
|
|
34
|
-
|
|
34
|
+
HasNavigationProperties: hasNavigationProperties,
|
|
35
35
|
ExplicitBindingOperationNames: explicitBindingOperationNames,
|
|
36
36
|
IsSelectable: isSelectable,
|
|
37
37
|
};
|
|
@@ -67,7 +67,7 @@ export function GetCollectionAnnotations(program, namespaceName, sources) {
|
|
|
67
67
|
function getCollectionAnnotations(program, namespaceName, routePath, entity) {
|
|
68
68
|
const collection = entity.theInterface;
|
|
69
69
|
const type = getInterfaceNavigationSourceType(program, collection);
|
|
70
|
-
const
|
|
70
|
+
const hasNavigationProperties = [...walkPropertiesInherited(type)].some((property) => isNavigationProperty(program, property));
|
|
71
71
|
const [hasFilterOperation, nonFilterableProperties] = getFilterProperties(program, type, entity.operations);
|
|
72
72
|
const [hasExpandOnCollectionOrResource, nonExpandableProperties] = getExpandProperties(program, type, entity.operations);
|
|
73
73
|
const [hasSortOnCollection, nonSortableProperties] = getSortProperties(program, type, entity.operations);
|
|
@@ -95,7 +95,7 @@ function getCollectionAnnotations(program, namespaceName, routePath, entity) {
|
|
|
95
95
|
NonSortableProperties: nonSortableProperties,
|
|
96
96
|
HasTopOnCollection: entity.operations.some(o => isTop(program, o.theOperation)),
|
|
97
97
|
Description: getDoc(program, collection),
|
|
98
|
-
|
|
98
|
+
HasNavigationProperties: hasNavigationProperties,
|
|
99
99
|
ExplicitBindingOperationNames: explicitBindingOperationNames,
|
|
100
100
|
IsSelectable: isSelectable,
|
|
101
101
|
};
|
|
@@ -106,7 +106,7 @@ function getExpandProperties(program, type, operations) {
|
|
|
106
106
|
if (expandOperation) {
|
|
107
107
|
const expandableProperties = getExpand(program, expandOperation.theOperation);
|
|
108
108
|
const navigationProperties = [...walkPropertiesInherited(type)]
|
|
109
|
-
.filter((property) =>
|
|
109
|
+
.filter((property) => isNavigationProperty(program, property))
|
|
110
110
|
.map((property) => property.name);
|
|
111
111
|
const nonExpandableProperties = navigationProperties.filter((property) => { var _a; return (_a = !(expandableProperties === null || expandableProperties === void 0 ? void 0 : expandableProperties.includes(property))) !== null && _a !== void 0 ? _a : false; });
|
|
112
112
|
return [true, nonExpandableProperties];
|
|
@@ -116,13 +116,13 @@ function getExpandProperties(program, type, operations) {
|
|
|
116
116
|
function getFilterProperties(program, type, operations) {
|
|
117
117
|
const filterOperation = operations.find(o => o.verb === "get" && isFilter(program, o.theOperation));
|
|
118
118
|
if (filterOperation) {
|
|
119
|
-
const
|
|
120
|
-
if (
|
|
119
|
+
const filterablePropertyNames = getFilter(program, filterOperation.theOperation);
|
|
120
|
+
if (filterablePropertyNames.length === 1 && filterablePropertyNames[0] === "*") {
|
|
121
121
|
return [true, undefined];
|
|
122
122
|
}
|
|
123
|
-
const
|
|
124
|
-
const
|
|
125
|
-
return [true,
|
|
123
|
+
const structuralPropertyNames = getModelStructuralPropertyNames(program, type);
|
|
124
|
+
const nonFilterablePropertyNames = structuralPropertyNames.filter(p => !filterablePropertyNames.includes(p));
|
|
125
|
+
return [true, nonFilterablePropertyNames];
|
|
126
126
|
}
|
|
127
127
|
return [false, undefined];
|
|
128
128
|
}
|
|
@@ -131,7 +131,7 @@ function getSortProperties(program, type, operations) {
|
|
|
131
131
|
if (sortOperationMethod) {
|
|
132
132
|
const sortableProperties = getOrderBy(program, sortOperationMethod.theOperation);
|
|
133
133
|
const nonNavigationProperties = [...walkPropertiesInherited(type)]
|
|
134
|
-
.filter((property) => !
|
|
134
|
+
.filter((property) => !isNavigationProperty(program, property))
|
|
135
135
|
.map((property) => property.name);
|
|
136
136
|
const nonSortableProperties = nonNavigationProperties.filter((property) => !sortableProperties.includes(property));
|
|
137
137
|
return [true, nonSortableProperties];
|
|
@@ -151,10 +151,10 @@ export function GetAllowedValuesAnnotations(program, namespaceName, models) {
|
|
|
151
151
|
if ((properties === null || properties === void 0 ? void 0 : properties.length) > 0) {
|
|
152
152
|
properties.forEach(property => {
|
|
153
153
|
var _a, _b;
|
|
154
|
-
if (((_b = (_a = property === null || property === void 0 ? void 0 : property.
|
|
154
|
+
if (((_b = (_a = property === null || property === void 0 ? void 0 : property.AllowedValues) === null || _a === void 0 ? void 0 : _a.values) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
155
155
|
annotations.set(`${namespaceName}/${value.Name}/${property.Name}`, {
|
|
156
156
|
Target: `${namespaceName}/${value.Name}/${property.Name}`,
|
|
157
|
-
allowedValues: property.
|
|
157
|
+
allowedValues: property.AllowedValues,
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotations.js","sourceRoot":"","sources":["../../../src/entities/annotations.ts"],"names":[],"mappings":"AAAA,OA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AAM,WAAW,GAAG,IAAI,GAAG,EAAoC,CAAC;IAEhE,KAAI,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,EAAE,CAAC;QAClC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;QACpC,IAAG,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,IAAG,CAAC,EAAC,CAAC;YACzB,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;;gBAC5B,IAAG,CAAA,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,aAAa,0CAAE,MAAM,0CAAE,MAAM,IAAG,CAAC,EAAE,CAAC;oBAC/C,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;gBACJ,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAAA,CAAC;IACF,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { Program } from "@typespec/compiler";
|
|
|
2
2
|
import { MsGraphInterface } from "../utils.js";
|
|
3
3
|
import { MsGraphAddressUrl } from "./address-url.js";
|
|
4
4
|
import { DeltaProperties } from "./model.js";
|
|
5
|
+
import { RevisionDefinition } from "./revision-definition.js";
|
|
5
6
|
interface NavigationPropertyBinding {
|
|
6
7
|
Path: string;
|
|
7
8
|
Target: string;
|
|
@@ -15,6 +16,7 @@ export interface Singleton {
|
|
|
15
16
|
AddressUrlMsa: MsGraphAddressUrl | undefined;
|
|
16
17
|
PassThroughAddressUrl: MsGraphAddressUrl | undefined;
|
|
17
18
|
PassThroughAddressUrlMsa: MsGraphAddressUrl | undefined;
|
|
19
|
+
RevisionDefinition?: RevisionDefinition | undefined;
|
|
18
20
|
}
|
|
19
21
|
export interface EntitySet {
|
|
20
22
|
Name: string | undefined;
|
|
@@ -26,6 +28,7 @@ export interface EntitySet {
|
|
|
26
28
|
PassThroughAddressUrl: MsGraphAddressUrl | undefined;
|
|
27
29
|
PassThroughAddressUrlMsa: MsGraphAddressUrl | undefined;
|
|
28
30
|
DeltaProperties: DeltaProperties | undefined;
|
|
31
|
+
RevisionDefinition?: RevisionDefinition | undefined;
|
|
29
32
|
}
|
|
30
33
|
export declare function GetSingletons(program: Program, sources: Map<string, MsGraphInterface>): Map<string, Singleton>;
|
|
31
34
|
export declare function GetEntitySets(program: Program, sources: Map<string, MsGraphInterface>): Map<string, EntitySet>;
|
|
@@ -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,EAGjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAsH,MAAM,kBAAkB,CAAC;AAEzK,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,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,EAGjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAsH,MAAM,kBAAkB,CAAC;AAEzK,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAyB,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAErF,UAAU,yBAAyB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,S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9G"}
|
|
@@ -2,6 +2,7 @@ import { buildAttributes } from "../decorators/ags-attribute.js";
|
|
|
2
2
|
import { getPropertyTypeName, getInterfaceNavigationSourceType, getDeltaProperties, } from "../utils.js";
|
|
3
3
|
import { getMsGraphAddressUrl, getMsGraphAddressUrlMsa, getMsGraphPassthroughAddressUrl, getMsGraphPassthroughAddressUrlMsa } from "./address-url.js";
|
|
4
4
|
import { isDelta } from "../index.js";
|
|
5
|
+
import { GetRevisionDefinition } from "./revision-definition.js";
|
|
5
6
|
export function GetSingletons(program, sources) {
|
|
6
7
|
const singletons = new Map();
|
|
7
8
|
sources.forEach((entity, routePath) => {
|
|
@@ -21,6 +22,7 @@ function getSingleton(program, routePath, entity) {
|
|
|
21
22
|
AddressUrlMsa: getMsGraphAddressUrlMsa(program, singleton),
|
|
22
23
|
PassThroughAddressUrl: getMsGraphPassthroughAddressUrl(program, singleton),
|
|
23
24
|
PassThroughAddressUrlMsa: getMsGraphPassthroughAddressUrlMsa(program, singleton),
|
|
25
|
+
RevisionDefinition: GetRevisionDefinition(program, singleton, singleton.namespace)
|
|
24
26
|
};
|
|
25
27
|
return entry;
|
|
26
28
|
}
|
|
@@ -45,6 +47,7 @@ function getEntitySet(program, routePath, entity) {
|
|
|
45
47
|
PassThroughAddressUrl: getMsGraphPassthroughAddressUrl(program, entitySet),
|
|
46
48
|
PassThroughAddressUrlMsa: getMsGraphPassthroughAddressUrlMsa(program, entitySet),
|
|
47
49
|
DeltaProperties: deltaProperties,
|
|
50
|
+
RevisionDefinition: GetRevisionDefinition(program, entitySet, entitySet.namespace)
|
|
48
51
|
};
|
|
49
52
|
return entry;
|
|
50
53
|
}
|
|
@@ -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,EAGhC,kB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EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAErJ,MAAM,KAAK,GAAc;QACvB,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC;QAC5C,aAAa,EAAE,aAAa;QAC5B,UAAU,EAAE,oBAAoB,CAAC,OAAO,EAAE,SAAS,CAAC;QACpD,aAAa,EAAE,uBAAuB,CAAC,OAAO,EAAE,SAAS,CAAC;QAC1D,qBAAqB,EAAE,+BAA+B,CAAC,OAAO,EAAE,SAAS,CAAC;QAC1E,wBAAwB,EAAE,kCAAkC,CAAC,OAAO,EAAE,SAAS,CAAC;QAChF,eAAe,EAAE,eAAe;QAChC,kBAAkB,EAAE,qBAAqB,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC;KACnF,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,yBAAyB,CAChC,OAAgB,EAChB,UAA4B;IAE5B,OAAO,UAAU;SACd,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC;SAC1C,MAAM,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -5,7 +5,7 @@ export interface MsGraphEnum {
|
|
|
5
5
|
AgsAttributes: Record<string, string>;
|
|
6
6
|
RevisionDefinition: RevisionDefinition | undefined;
|
|
7
7
|
Elements: MsGraphEnumMember[];
|
|
8
|
-
|
|
8
|
+
IsGraphFlags: boolean | undefined;
|
|
9
9
|
Description?: string;
|
|
10
10
|
}
|
|
11
11
|
export interface MsGraphEnumMember {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../src/entities/enum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAsB,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAyB,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAIrF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACnD,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,
|
|
1
|
+
{"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../src/entities/enum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAsB,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAyB,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAIrF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACnD,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,GAAG,WAAW,CAWvF"}
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import { getDoc } from "@typespec/compiler";
|
|
2
2
|
import { GetRevisionDefinition } from "./revision-definition.js";
|
|
3
3
|
import { buildAttributes } from "../decorators/ags-attribute.js";
|
|
4
|
-
import {
|
|
4
|
+
import { isGraphFlags } from "../index.js";
|
|
5
5
|
export function GetMsGraphEnumTypeElement(program, enumType) {
|
|
6
6
|
const element = {
|
|
7
7
|
Name: enumType.name,
|
|
8
8
|
AgsAttributes: buildAttributes(program, enumType),
|
|
9
9
|
RevisionDefinition: GetRevisionDefinition(program, enumType, enumType === null || enumType === void 0 ? void 0 : enumType.namespace),
|
|
10
10
|
Elements: [...enumType.members].map(([_, m]) => getMsGraphEnumMember(program, m)),
|
|
11
|
-
|
|
11
|
+
IsGraphFlags: isGraphFlags(program, enumType),
|
|
12
12
|
Description: getDoc(program, enumType),
|
|
13
13
|
};
|
|
14
14
|
return element;
|
|
15
15
|
}
|
|
16
16
|
function getMsGraphEnumMember(program, member) {
|
|
17
|
-
var _a;
|
|
17
|
+
var _a, _b;
|
|
18
18
|
const element = {
|
|
19
19
|
Name: member.name,
|
|
20
|
-
Value: member.value,
|
|
20
|
+
Value: (_a = member.value) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
21
21
|
AgsAttributes: buildAttributes(program, member),
|
|
22
|
-
RevisionDefinition: GetRevisionDefinition(program, member, (
|
|
23
|
-
Description:
|
|
22
|
+
RevisionDefinition: GetRevisionDefinition(program, member, (_b = member.enum) === null || _b === void 0 ? void 0 : _b.namespace),
|
|
23
|
+
Description: member.name === "unknownFutureValue"
|
|
24
|
+
? "A marker value for members added after the release of this API."
|
|
25
|
+
: getDoc(program, member),
|
|
24
26
|
};
|
|
25
27
|
return element;
|
|
26
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../src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AA,MAAM,CAAC,KAAK,0CAAE,QAAQ,EAAE;QAC/B,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;QAClF,WAAW,EAAG,MAAM,CAAC,IAAI,KAAK,oBAAoB;YAChD,CAAC,CAAC,iEAAiE;YACnE,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -31,32 +31,40 @@ export interface DeltaProperties {
|
|
|
31
31
|
FilterProperties: string[] | undefined;
|
|
32
32
|
ExpandProperties: string[] | undefined;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
interface PropertyAttributes {
|
|
35
35
|
Name: string;
|
|
36
|
-
|
|
36
|
+
Description: string | undefined;
|
|
37
|
+
PropertyTypeName: string;
|
|
37
38
|
IsNullable: boolean;
|
|
39
|
+
IsNavigation: boolean;
|
|
40
|
+
IsUrl?: boolean | undefined;
|
|
38
41
|
AgsAttributes: Record<string, string>;
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
RevisionDefinition: RevisionDefinition | undefined;
|
|
43
|
+
}
|
|
44
|
+
export interface MsGraphStructuralProperty extends PropertyAttributes {
|
|
41
45
|
IsComputed: boolean;
|
|
46
|
+
IsImmutable: boolean;
|
|
47
|
+
DefaultValue?: string;
|
|
48
|
+
MaxLength?: number;
|
|
49
|
+
SupportsLimitedCharset: boolean;
|
|
50
|
+
AllowedValues: AllowedValues;
|
|
42
51
|
Permission: "Read" | "Write" | null;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
allowedValues: AllowedValues;
|
|
52
|
+
}
|
|
53
|
+
export interface MsGraphNavigationProperty extends PropertyAttributes {
|
|
54
|
+
IsContained: boolean;
|
|
47
55
|
IsCollection: boolean;
|
|
48
56
|
AddressUrl: MsGraphAddressUrl | undefined;
|
|
49
57
|
AddressUrlMsa: MsGraphAddressUrl | undefined;
|
|
50
58
|
PassthroughAddressUrl: MsGraphPassthroughAddressUrl | undefined;
|
|
51
59
|
PassthroughAddressUrlMsa: MsGraphPassthroughAddressUrl | undefined;
|
|
52
|
-
SupportsLimitedCharset: boolean;
|
|
53
|
-
DefaultValue?: string;
|
|
54
|
-
IsUrl?: boolean | undefined;
|
|
55
60
|
DeltaProperties: DeltaProperties | undefined;
|
|
56
61
|
}
|
|
62
|
+
export interface MsGraphModelProperty extends MsGraphStructuralProperty, MsGraphNavigationProperty {
|
|
63
|
+
}
|
|
57
64
|
export interface AlternateKeyProperty {
|
|
58
65
|
IsModel: boolean;
|
|
59
66
|
ModelProperty: ModelProperty;
|
|
60
67
|
}
|
|
61
68
|
export declare function GetMsGraphModels(program: Program, models: Map<string, Model>): Map<string, MsGraphModel>;
|
|
69
|
+
export {};
|
|
62
70
|
//# sourceMappingURL=model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/entities/model.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/entities/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAiE,MAAM,oBAAoB,CAAC;AAClI,OAAO,EAAyB,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAwCrF,OAAO,EAAE,iBAAiB,EAAE,4BAA4B,EAAsH,MAAM,kBAAkB,CAAC;AAKvM,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,O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AAC;IACnB,sBAAsB,EAAE,OAAO,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB;IACnE,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC1C,aAAa,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC7C,qBAAqB,EAAE,4BAA4B,GAAG,SAAS,CAAC;IAChE,wBAAwB,EAAE,4BAA4B,GAAG,SAAS,CAAC;IACnE,eAAe,EAAE,eAAe,GAAG,SAAS,CAAC;CAC9C;AAED,MAAM,WAAW,oBAAqB,SAAQ,yBAAyB,EAAE,yBAAyB;CAAI;AAEtG,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAoCxG"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { getDoc, getLocationContext, isKey } from "@typespec/compiler";
|
|
1
|
+
import { getDoc, getLocationContext, getMaxLength, isKey } from "@typespec/compiler";
|
|
2
2
|
import { GetRevisionDefinition } from "./revision-definition.js";
|
|
3
|
-
import { isContains, isComputed, isReadOnly, isWriteOnly, isAlternateKey, isComplex, getMediaTypes, isEntity, isOpen, isMedia, isAbstract, isImmutable, hasAllowedValues, getAllowedValues, hasAddressUrl, hasAddressUrlMsa, hasPassthroughAddressUrl, } from "../index.js";
|
|
4
|
-
import { isNavigationProperty, isTypeNullable, getPropertyTypeName, getIdForType, isTypeCollection, extractTypesFromUnion, removeReferencePrefixFromType, getNameForModelType, isDictionaryType, generateDictionaryBaseType, getSchemaNamespaceName, getNestedComplexTypes,
|
|
3
|
+
import { isContains, isComputed, isReadOnly, isWriteOnly, isAlternateKey, isComplex, getMediaTypes, isEntity, isOpen, isMedia, isAbstract, isImmutable, hasAllowedValues, getAllowedValues, hasAddressUrl, hasAddressUrlMsa, hasPassthroughAddressUrl, hasWorkloadNamespace, } from "../index.js";
|
|
4
|
+
import { isNavigationProperty, isTypeNullable, getPropertyTypeName, getIdForType, isTypeCollection, extractTypesFromUnion, removeReferencePrefixFromType, getNameForModelType, isDictionaryType, generateDictionaryBaseType, getSchemaNamespaceName, getNestedComplexTypes, generateDeltaPropertiesForNavigationProperties, getTypeModel, } from "../utils.js";
|
|
5
5
|
import { buildAttributes } from "../decorators/ags-attribute.js";
|
|
6
|
-
import { usedLibraryTypesKey, usedStandardEntityBaseTypeKey } from "./namespace.js";
|
|
6
|
+
import { usedDictionaryTypeKey, usedLibraryTypesKey, usedStandardEntityBaseTypeKey, NamespaceType, modelsOrderingKey } from "./namespace.js";
|
|
7
7
|
import { isPartial } from "../decorators/partial.js";
|
|
8
8
|
import { getMsGraphAddressUrl, getMsGraphAddressUrlMsa, getMsGraphPassthroughAddressUrl, getMsGraphPassthroughAddressUrlMsa } from "./address-url.js";
|
|
9
9
|
import { GetMsGraphRoutes } from "./ms-graph-route.js";
|
|
@@ -18,33 +18,38 @@ export var MsGraphModelKind;
|
|
|
18
18
|
export function GetMsGraphModels(program, models) {
|
|
19
19
|
const map = new Map();
|
|
20
20
|
models.forEach((m, key) => {
|
|
21
|
-
var _a;
|
|
21
|
+
var _a, _b, _c;
|
|
22
|
+
addPositionToStateMap(program, m);
|
|
22
23
|
if (isPartial(program, m)) {
|
|
23
24
|
if ((_a = m.baseModel) === null || _a === void 0 ? void 0 : _a.name) { // meaning there is an extends clause
|
|
24
|
-
const baseModel =
|
|
25
|
+
const baseModel = ((_b = m.baseModel) === null || _b === void 0 ? void 0 : _b.name) === 'entity'
|
|
26
|
+
? getMsGraphModel(program, m.baseModel)
|
|
27
|
+
: getMsGraphModel(program, m.baseModel, false);
|
|
25
28
|
if (baseModel) {
|
|
26
29
|
baseModel.IsOpenType = false;
|
|
27
30
|
baseModel.BaseType = undefined;
|
|
28
|
-
map.set(baseModel.Name
|
|
31
|
+
map.set(baseModel.Name, baseModel);
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
const partialModel = getMsGraphModel(program, m);
|
|
32
35
|
if (partialModel) {
|
|
33
36
|
partialModel.IsOpenType = false;
|
|
34
37
|
partialModel.BaseType = undefined;
|
|
35
|
-
map.set(partialModel.Name
|
|
38
|
+
map.set(partialModel.Name, partialModel);
|
|
36
39
|
}
|
|
37
40
|
return;
|
|
38
41
|
}
|
|
39
42
|
populateImportedModelType(program, m);
|
|
40
|
-
// Removes properties and inheritance information from imported entity types
|
|
41
|
-
|
|
43
|
+
// Removes properties and inheritance information from imported entity types
|
|
44
|
+
if (((_c = m.namespace) === null || _c === void 0 ? void 0 : _c.name) !== "SharedModels") {
|
|
45
|
+
m = removePropertiesAndInheritanceFromImportedType(program, m);
|
|
46
|
+
}
|
|
42
47
|
const model = getMsGraphModel(program, m);
|
|
43
48
|
if (model) {
|
|
44
49
|
map.set(key, model);
|
|
45
50
|
}
|
|
46
51
|
});
|
|
47
|
-
return map;
|
|
52
|
+
return getOrderedModels(program, map);
|
|
48
53
|
}
|
|
49
54
|
function removePropertiesAndInheritanceFromImportedType(program, model) {
|
|
50
55
|
if (model.baseModel) {
|
|
@@ -61,11 +66,12 @@ function removePropertiesAndInheritanceFromImportedType(program, model) {
|
|
|
61
66
|
}
|
|
62
67
|
function populateImportedModelType(program, m) {
|
|
63
68
|
if (m.baseModel && getLocationContext(program, m.baseModel).type !== "project" && getLocationContext(program, m).type !== "library") {
|
|
69
|
+
addPositionToStateMap(program, m.baseModel);
|
|
64
70
|
program.stateSet(usedLibraryTypesKey).add(m.baseModel);
|
|
65
71
|
}
|
|
66
72
|
}
|
|
67
73
|
function getMsGraphModel(program, model, generateProperties = true) {
|
|
68
|
-
var _a;
|
|
74
|
+
var _a, _b;
|
|
69
75
|
let kind = MsGraphModelKind.Unknown;
|
|
70
76
|
if (isEntity(program, model)) {
|
|
71
77
|
kind = MsGraphModelKind.Entity;
|
|
@@ -79,12 +85,31 @@ function getMsGraphModel(program, model, generateProperties = true) {
|
|
|
79
85
|
// Record when we have a raw entity base type, so we can be sure to emit it later.
|
|
80
86
|
if (((_a = model.baseModel) === null || _a === void 0 ? void 0 : _a.name) === "entity") {
|
|
81
87
|
program.stateSet(usedStandardEntityBaseTypeKey).add(model);
|
|
88
|
+
const namespace = model.namespace;
|
|
89
|
+
if (namespace) {
|
|
90
|
+
const namespaceName = (_b = getSchemaNamespaceName(program, namespace)) !== null && _b !== void 0 ? _b : "";
|
|
91
|
+
let namespaceType = NamespaceType.Unknown;
|
|
92
|
+
if (hasWorkloadNamespace(program, namespace)) {
|
|
93
|
+
namespaceType = NamespaceType.Workload;
|
|
94
|
+
}
|
|
95
|
+
else if (namespaceName === "microsoft.graph") {
|
|
96
|
+
namespaceType = NamespaceType.Public;
|
|
97
|
+
}
|
|
98
|
+
else if (namespaceName.includes("microsoft.graph")) {
|
|
99
|
+
namespaceType = NamespaceType.SubNamespace;
|
|
100
|
+
}
|
|
101
|
+
program.stateMap(usedStandardEntityBaseTypeKey).set(namespace, namespaceType);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const shouldGenerateDictionaryBaseType = isDictionaryType(program, model);
|
|
105
|
+
if (!model.baseModel && shouldGenerateDictionaryBaseType) {
|
|
106
|
+
program.stateSet(usedDictionaryTypeKey).add(model);
|
|
82
107
|
}
|
|
83
108
|
return {
|
|
84
109
|
Kind: kind,
|
|
85
110
|
Name: model.name,
|
|
86
111
|
IsAbstract: isAbstract(program, model),
|
|
87
|
-
BaseType: model.baseModel ? getIdForType(program, model.baseModel) : (
|
|
112
|
+
BaseType: model.baseModel ? getIdForType(program, model.baseModel) : (shouldGenerateDictionaryBaseType ? generateDictionaryBaseType(program, model) : undefined),
|
|
88
113
|
IsOpenType: isOpen(program, model) || isDictionaryType(program, model),
|
|
89
114
|
IsMedia: isMedia(program, model),
|
|
90
115
|
AgsAttributes: buildAttributes(program, model, kind),
|
|
@@ -116,10 +141,6 @@ function getModelProperties(program, properties) {
|
|
|
116
141
|
return [...properties].map(([_, v]) => {
|
|
117
142
|
var _a;
|
|
118
143
|
populateUsedTypeModel(program, v);
|
|
119
|
-
let bindingInterface = undefined;
|
|
120
|
-
if (v.type.kind === "Model") {
|
|
121
|
-
bindingInterface = getInterface(program, (v.type));
|
|
122
|
-
}
|
|
123
144
|
return {
|
|
124
145
|
Name: v.name,
|
|
125
146
|
IsNavigation: isNavigationProperty(program, v),
|
|
@@ -135,8 +156,8 @@ function getModelProperties(program, properties) {
|
|
|
135
156
|
: null,
|
|
136
157
|
RevisionDefinition: GetRevisionDefinition(program, v, (_a = v.model) === null || _a === void 0 ? void 0 : _a.namespace),
|
|
137
158
|
Description: getDoc(program, v),
|
|
138
|
-
|
|
139
|
-
|
|
159
|
+
IsImmutable: isImmutable(program, v),
|
|
160
|
+
AllowedValues: hasAllowedValues(program, v) ? getAllowedValues(program, v) : [],
|
|
140
161
|
IsCollection: isTypeCollection(program, v.type),
|
|
141
162
|
AddressUrl: isNavigationProperty(program, v) ? getNavigationPropertyAddressUrl(program, v) : undefined,
|
|
142
163
|
AddressUrlMsa: isNavigationProperty(program, v) ? getNavigationPropertyAddressUrlMsa(program, v) : undefined,
|
|
@@ -145,23 +166,11 @@ function getModelProperties(program, properties) {
|
|
|
145
166
|
SupportsLimitedCharset: supportsLimitedCharset(program, v),
|
|
146
167
|
DefaultValue: getDefaultValue(program, v),
|
|
147
168
|
IsUrl: getIsUrl(program, v),
|
|
148
|
-
DeltaProperties: isNavigationProperty(program, v)
|
|
169
|
+
DeltaProperties: isNavigationProperty(program, v) ? generateDeltaPropertiesForNavigationProperties(program, v) : undefined,
|
|
170
|
+
MaxLength: getMaxLength(program, v),
|
|
149
171
|
};
|
|
150
172
|
});
|
|
151
173
|
}
|
|
152
|
-
function getInterface(program, model) {
|
|
153
|
-
const namespace = model.namespace;
|
|
154
|
-
const theInterfaces = namespace === null || namespace === void 0 ? void 0 : namespace.interfaces;
|
|
155
|
-
if (theInterfaces) {
|
|
156
|
-
for (const [_, theInterface] of theInterfaces.entries()) {
|
|
157
|
-
const navigationBindingType = getInterfaceNavigationSourceType(program, theInterface);
|
|
158
|
-
if (navigationBindingType && navigationBindingType.name === model.name) {
|
|
159
|
-
return theInterface;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
return undefined;
|
|
164
|
-
}
|
|
165
174
|
function getIsUrl(program, property) {
|
|
166
175
|
if (property.type.kind === "Scalar" && isODataUrl(property.type)) {
|
|
167
176
|
return true;
|
|
@@ -189,7 +198,10 @@ function populateUsedTypeModel(program, v) {
|
|
|
189
198
|
const isNavProperty = isNavigationProperty(program, v);
|
|
190
199
|
if (v.type.kind === "Model" && isComplex(program, v.type) && getLocationContext(program, v.type).type === "library") {
|
|
191
200
|
const nestedTypes = getNestedComplexTypes(program, v.type);
|
|
192
|
-
nestedTypes.forEach(type => {
|
|
201
|
+
nestedTypes.forEach(type => {
|
|
202
|
+
program.stateSet(usedLibraryTypesKey).add(type);
|
|
203
|
+
addPositionToStateMap(program, type);
|
|
204
|
+
});
|
|
193
205
|
}
|
|
194
206
|
if (isNavProperty && getLocationContext(program, v.type).type === "library") {
|
|
195
207
|
/**
|
|
@@ -198,10 +210,12 @@ function populateUsedTypeModel(program, v) {
|
|
|
198
210
|
* The type added to stateSet is reference.microsoft.graph.someType
|
|
199
211
|
*/
|
|
200
212
|
program.stateSet(usedLibraryTypesKey).add(v.type);
|
|
213
|
+
addPositionToStateMap(program, v.type);
|
|
201
214
|
}
|
|
202
215
|
// Takes care of complex types
|
|
203
216
|
if (v.type.kind === "Model" && getLocationContext(program, v.type).type === "library") {
|
|
204
217
|
program.stateSet(usedLibraryTypesKey).add(v.type);
|
|
218
|
+
addPositionToStateMap(program, v.type);
|
|
205
219
|
}
|
|
206
220
|
if (v.type.kind === "Enum" && getLocationContext(program, v.type).type === "library") {
|
|
207
221
|
program.stateSet(usedLibraryTypesKey).add(v.type);
|
|
@@ -211,6 +225,10 @@ function populateUsedTypeModel(program, v) {
|
|
|
211
225
|
unionTypes.forEach(type => {
|
|
212
226
|
if (getLocationContext(program, type).type === "library") {
|
|
213
227
|
program.stateSet(usedLibraryTypesKey).add(type);
|
|
228
|
+
const typeModel = getTypeModel(program, type);
|
|
229
|
+
if (typeModel) {
|
|
230
|
+
addPositionToStateMap(program, typeModel);
|
|
231
|
+
}
|
|
214
232
|
}
|
|
215
233
|
});
|
|
216
234
|
}
|
|
@@ -263,4 +281,52 @@ function getNavigationPropertyPassthroughAddressUrlMsa(program, property) {
|
|
|
263
281
|
}
|
|
264
282
|
return undefined;
|
|
265
283
|
}
|
|
284
|
+
// TODO: Replace this method once core TypeSpec provides this functionality
|
|
285
|
+
function getOrderedModels(program, models) {
|
|
286
|
+
const unOrderedTypes = program.stateMap(modelsOrderingKey);
|
|
287
|
+
const orderedTypes = getOrderedTypes(unOrderedTypes);
|
|
288
|
+
const emittedLibraryMsGraphModels = getEmittedLibraryMsGraphModels(models);
|
|
289
|
+
const orderedMsGraphModels = new Map();
|
|
290
|
+
orderedTypes.forEach((_, type) => {
|
|
291
|
+
if (type.kind === "Model") {
|
|
292
|
+
const model = models.get(type.name);
|
|
293
|
+
if (model) {
|
|
294
|
+
orderedMsGraphModels.set(type.name, model);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
program.stateMap(modelsOrderingKey).clear();
|
|
299
|
+
emittedLibraryMsGraphModels.forEach((model) => {
|
|
300
|
+
orderedMsGraphModels.set(model.Name, model);
|
|
301
|
+
});
|
|
302
|
+
return orderedMsGraphModels;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Orders the types based on their value which is the position of the type in the file
|
|
306
|
+
* @param unOrderedTypes
|
|
307
|
+
* @returns orderedTypes
|
|
308
|
+
*/
|
|
309
|
+
function getOrderedTypes(unOrderedTypes) {
|
|
310
|
+
let typeTuples = Array.from(unOrderedTypes.entries());
|
|
311
|
+
typeTuples = typeTuples.sort((a, b) => a[1] - b[1]);
|
|
312
|
+
return new Map(typeTuples);
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* This function gets all models that are emitted from an external library but emitted in the current namespace
|
|
316
|
+
* @param models
|
|
317
|
+
* @returns MsGraphModels: These are types that are emitted when a library type is used as a base type in a model
|
|
318
|
+
*/
|
|
319
|
+
function getEmittedLibraryMsGraphModels(models) {
|
|
320
|
+
const emittedLibraryMsGraphModel = new Map();
|
|
321
|
+
models.forEach((model) => {
|
|
322
|
+
if (model.Properties.length === 0 && model.Kind === MsGraphModelKind.Entity) {
|
|
323
|
+
emittedLibraryMsGraphModel.set(model.Name, model);
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
return emittedLibraryMsGraphModel;
|
|
327
|
+
}
|
|
328
|
+
function addPositionToStateMap(program, type) {
|
|
329
|
+
var _a;
|
|
330
|
+
program.stateMap(modelsOrderingKey).set(type, (_a = type.node) === null || _a === void 0 ? void 0 : _a.pos);
|
|
331
|
+
}
|
|
266
332
|
//# sourceMappingURL=model.js.map
|