@microsoft/typespec-msgraph 0.0.1-Preview.14 → 0.0.1-Preview.16
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/annotations.js.map +1 -1
- package/dist/src/components/entity-container-element.js +2 -6
- package/dist/src/components/entity-container-element.js.map +1 -1
- package/dist/src/components/open-property-type-constraint-annotation-element.d.ts +5 -0
- package/dist/src/components/open-property-type-constraint-annotation-element.d.ts.map +1 -0
- package/dist/src/components/open-property-type-constraint-annotation-element.js +7 -0
- package/dist/src/components/open-property-type-constraint-annotation-element.js.map +1 -0
- package/dist/src/components/operation-element.js +2 -2
- 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/structured-type-element.d.ts.map +1 -1
- package/dist/src/components/structured-type-element.js +7 -5
- package/dist/src/components/structured-type-element.js.map +1 -1
- package/dist/src/components/update-restrictions-annotation.d.ts +2 -1
- package/dist/src/components/update-restrictions-annotation.d.ts.map +1 -1
- package/dist/src/components/update-restrictions-annotation.js +6 -4
- package/dist/src/components/update-restrictions-annotation.js.map +1 -1
- package/dist/src/decorators/address-url-msa.d.ts +12 -0
- package/dist/src/decorators/address-url-msa.d.ts.map +1 -0
- package/dist/src/decorators/address-url-msa.js +19 -0
- package/dist/src/decorators/address-url-msa.js.map +1 -0
- package/dist/src/decorators/address-url.d.ts.map +1 -1
- package/dist/src/decorators/function.d.ts +7 -2
- package/dist/src/decorators/function.d.ts.map +1 -1
- package/dist/src/decorators/function.js +2 -2
- package/dist/src/decorators/function.js.map +1 -1
- package/dist/src/decorators/graph-route.d.ts +1 -0
- package/dist/src/decorators/graph-route.d.ts.map +1 -1
- package/dist/src/decorators/graph-route.js +17 -0
- package/dist/src/decorators/graph-route.js.map +1 -1
- package/dist/src/decorators/index.d.ts +13 -10
- package/dist/src/decorators/index.d.ts.map +1 -1
- package/dist/src/decorators/index.js +13 -10
- package/dist/src/decorators/index.js.map +1 -1
- package/dist/src/decorators/media.d.ts +10 -0
- package/dist/src/decorators/media.d.ts.map +1 -0
- package/dist/src/decorators/media.js +16 -0
- package/dist/src/decorators/media.js.map +1 -0
- package/dist/src/decorators/passthrough-address-url-msa.d.ts +11 -0
- package/dist/src/decorators/passthrough-address-url-msa.d.ts.map +1 -0
- package/dist/src/decorators/passthrough-address-url-msa.js +17 -0
- package/dist/src/decorators/passthrough-address-url-msa.js.map +1 -0
- package/dist/src/decorators/passthrough-address-url.d.ts +11 -0
- package/dist/src/decorators/passthrough-address-url.d.ts.map +1 -0
- package/dist/src/decorators/passthrough-address-url.js +17 -0
- package/dist/src/decorators/passthrough-address-url.js.map +1 -0
- package/dist/src/dom/error-interceptor.d.ts +2 -0
- package/dist/src/dom/error-interceptor.d.ts.map +1 -0
- package/dist/src/dom/error-interceptor.js +13 -0
- package/dist/src/dom/error-interceptor.js.map +1 -0
- package/dist/src/dom/renderer.d.ts +1 -0
- package/dist/src/dom/renderer.d.ts.map +1 -1
- package/dist/src/dom/renderer.js +1 -0
- package/dist/src/dom/renderer.js.map +1 -1
- package/dist/src/entities/address-url.d.ts +4 -0
- package/dist/src/entities/address-url.d.ts.map +1 -1
- package/dist/src/entities/address-url.js +40 -11
- package/dist/src/entities/address-url.js.map +1 -1
- package/dist/src/entities/annotations.d.ts +9 -2
- package/dist/src/entities/annotations.d.ts.map +1 -1
- package/dist/src/entities/annotations.js +34 -3
- package/dist/src/entities/annotations.js.map +1 -1
- package/dist/src/entities/entity-container.d.ts +6 -0
- package/dist/src/entities/entity-container.d.ts.map +1 -1
- package/dist/src/entities/entity-container.js +7 -1
- package/dist/src/entities/entity-container.js.map +1 -1
- package/dist/src/entities/model.d.ts +8 -4
- package/dist/src/entities/model.d.ts.map +1 -1
- package/dist/src/entities/model.js +54 -8
- 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 +15 -15
- package/dist/src/entities/ms-graph-route.js.map +1 -1
- package/dist/src/entities/operation.d.ts +1 -0
- package/dist/src/entities/operation.d.ts.map +1 -1
- package/dist/src/entities/operation.js +11 -5
- package/dist/src/entities/operation.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 +17 -3
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +11 -5
- package/dist/src/lib.js.map +1 -1
- package/dist/src/linter.d.ts +2 -0
- package/dist/src/linter.d.ts.map +1 -0
- package/dist/src/linter.js +17 -0
- package/dist/src/linter.js.map +1 -0
- package/dist/src/rules/address-url.d.ts +13 -0
- package/dist/src/rules/address-url.d.ts.map +1 -1
- package/dist/src/rules/address-url.js +128 -7
- package/dist/src/rules/address-url.js.map +1 -1
- package/dist/src/rules/contains.d.ts +1 -1
- package/dist/src/rules/contains.js +1 -1
- package/dist/src/rules/expand.d.ts.map +1 -1
- package/dist/src/rules/expand.js +3 -1
- package/dist/src/rules/expand.js.map +1 -1
- package/dist/src/rules/graph-route.d.ts +2 -0
- package/dist/src/rules/graph-route.d.ts.map +1 -1
- package/dist/src/rules/graph-route.js +65 -1
- package/dist/src/rules/graph-route.js.map +1 -1
- package/dist/src/rules/index.d.ts +3 -1
- package/dist/src/rules/index.d.ts.map +1 -1
- package/dist/src/rules/index.js +3 -1
- package/dist/src/rules/index.js.map +1 -1
- package/dist/src/rules/media.d.ts +10 -0
- package/dist/src/rules/media.d.ts.map +1 -0
- package/dist/src/rules/media.js +122 -0
- package/dist/src/rules/media.js.map +1 -0
- package/dist/src/rules/model.d.ts +4 -0
- package/dist/src/rules/model.d.ts.map +1 -0
- package/dist/src/rules/model.js +36 -0
- package/dist/src/rules/model.js.map +1 -0
- package/dist/src/rules/record-t.d.ts +5 -0
- package/dist/src/rules/record-t.d.ts.map +1 -0
- package/dist/src/rules/record-t.js +78 -0
- package/dist/src/rules/record-t.js.map +1 -0
- package/dist/src/rules/reference-target.d.ts +1 -1
- package/dist/src/rules/reference-target.d.ts.map +1 -1
- package/dist/src/rules/reference-target.js +11 -12
- package/dist/src/rules/reference-target.js.map +1 -1
- package/dist/src/utils.d.ts +3 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +24 -5
- package/dist/src/utils.js.map +1 -1
- package/dist/src/validate.d.ts.map +1 -1
- package/dist/src/validate.js +12 -3
- package/dist/src/validate.js.map +1 -1
- package/lib/bodies.tsp +71 -0
- package/lib/decorators.tsp +39 -4
- package/lib/msgraph.tsp +1 -0
- package/lib/porcelain.tsp +43 -18
- package/lib/responses.tsp +4 -52
- package/lib/shared-models.tsp +2 -2
- package/package.json +4 -4
- package/dist/src/decorators/has-stream.d.ts +0 -10
- package/dist/src/decorators/has-stream.d.ts.map +0 -1
- package/dist/src/decorators/has-stream.js +0 -17
- package/dist/src/decorators/has-stream.js.map +0 -1
- package/dist/src/rules/has-stream.d.ts +0 -3
- package/dist/src/rules/has-stream.d.ts.map +0 -1
- package/dist/src/rules/has-stream.js +0 -30
- package/dist/src/rules/has-stream.js.map +0 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { getDoc, getLocationContext, isKey } from "@typespec/compiler";
|
|
2
2
|
import { GetRevisionDefinition } from "./revision-definition.js";
|
|
3
|
-
import { isContains, isComputed, isReadOnly, isWriteOnly, isAlternateKey, isComplex,
|
|
4
|
-
import { isNavigationProperty, isTypeNullable, getPropertyTypeName, getIdForType, isTypeCollection, extractTypesFromUnion, removeReferencePrefixFromType, } from "../utils.js";
|
|
3
|
+
import { isContains, isComputed, isReadOnly, isWriteOnly, isAlternateKey, isComplex, getMediaTypes, isEntity, isOpen, isMedia, isAbstract, isImmutable, hasAllowedValues, getAllowedValues, hasAddressUrl, getPublicNamespaceName, hasAddressUrlMsa, hasPassthroughAddressUrl, } from "../index.js";
|
|
4
|
+
import { isNavigationProperty, isTypeNullable, getPropertyTypeName, getIdForType, isTypeCollection, extractTypesFromUnion, removeReferencePrefixFromType, getNameForModelType, isDictionaryType, generateDictionaryBaseType, } from "../utils.js";
|
|
5
5
|
import { buildAttributes } from "../decorators/ags-attribute.js";
|
|
6
6
|
import { usedLibraryTypesKey } from "./namespace.js";
|
|
7
7
|
import { isPartial } from "../decorators/partial.js";
|
|
8
|
-
import { getMsGraphAddressUrl } from "./address-url.js";
|
|
8
|
+
import { getMsGraphAddressUrl, getMsGraphAddressUrlMsa, getMsGraphPassthroughAddressUrl, getMsGraphPassthroughAddressUrlMsa } from "./address-url.js";
|
|
9
9
|
import { GetMsGraphRoutes } from "./ms-graph-route.js";
|
|
10
|
+
import { hasPassthroughAddressUrlMsa } from "../decorators/passthrough-address-url-msa.js";
|
|
10
11
|
export var MsGraphModelKind;
|
|
11
12
|
(function (MsGraphModelKind) {
|
|
12
13
|
MsGraphModelKind[MsGraphModelKind["Unknown"] = 0] = "Unknown";
|
|
@@ -77,19 +78,34 @@ function getMsGraphModel(program, model, generateProperties = true) {
|
|
|
77
78
|
Kind: kind,
|
|
78
79
|
Name: model.name,
|
|
79
80
|
IsAbstract: isAbstract(program, model),
|
|
80
|
-
BaseType: model.baseModel ? getIdForType(program, model.baseModel) : undefined,
|
|
81
|
-
IsOpenType: isOpen(program, model),
|
|
82
|
-
|
|
81
|
+
BaseType: model.baseModel ? getIdForType(program, model.baseModel) : (isDictionaryType(program, model) ? generateDictionaryBaseType(program, model) : undefined),
|
|
82
|
+
IsOpenType: isOpen(program, model) || isDictionaryType(program, model),
|
|
83
|
+
IsMedia: isMedia(program, model),
|
|
83
84
|
AgsAttributes: buildAttributes(program, model, kind),
|
|
84
85
|
RevisionDefinition: GetRevisionDefinition(program, model, model.namespace),
|
|
85
86
|
Description: getDoc(program, model),
|
|
86
87
|
KeyProperty: kind === MsGraphModelKind.Entity ? [...model.properties].find(([_, property]) => isKey(program, property)) : undefined,
|
|
87
88
|
AlternateKeys: kind === MsGraphModelKind.Entity ? getAlternateKeys(program, model.properties) : [],
|
|
88
|
-
|
|
89
|
+
MediaTypes: kind === MsGraphModelKind.Entity ? getMediaTypes(program, model) : [],
|
|
89
90
|
Properties: generateProperties ? getModelProperties(program, model.properties) : [],
|
|
90
|
-
|
|
91
|
+
IsPartial: isPartial(program, model),
|
|
92
|
+
RecordType: getRecordType(program, model)
|
|
91
93
|
};
|
|
92
94
|
}
|
|
95
|
+
function getRecordType(program, model) {
|
|
96
|
+
var _a;
|
|
97
|
+
const indexer = (_a = model.indexer) === null || _a === void 0 ? void 0 : _a.value;
|
|
98
|
+
if (!indexer)
|
|
99
|
+
return undefined;
|
|
100
|
+
if (indexer.kind === "Model") {
|
|
101
|
+
const namespaceName = getPublicNamespaceName(program, model.namespace);
|
|
102
|
+
return namespaceName === null || namespaceName === void 0 ? void 0 : namespaceName.concat(".", indexer.name);
|
|
103
|
+
}
|
|
104
|
+
if (indexer.kind === "Scalar") {
|
|
105
|
+
return getNameForModelType(program, indexer);
|
|
106
|
+
}
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
93
109
|
function getModelProperties(program, properties) {
|
|
94
110
|
return [...properties].map(([_, v]) => {
|
|
95
111
|
var _a;
|
|
@@ -113,6 +129,9 @@ function getModelProperties(program, properties) {
|
|
|
113
129
|
allowedValues: hasAllowedValues(program, v) ? getAllowedValues(program, v) : [],
|
|
114
130
|
IsCollection: isTypeCollection(program, v.type),
|
|
115
131
|
AddressUrl: isNavigationProperty(program, v) ? getNavigationPropertyAddressUrl(program, v) : undefined,
|
|
132
|
+
AddressUrlMsa: isNavigationProperty(program, v) ? getNavigationPropertyAddressUrlMsa(program, v) : undefined,
|
|
133
|
+
PassthroughAddressUrl: isNavigationProperty(program, v) ? getNavigationPropertyPassthroughAddressUrl(program, v) : undefined,
|
|
134
|
+
PassthroughAddressUrlMsa: isNavigationProperty(program, v) ? getNavigationPropertyPassthroughAddressUrlMsa(program, v) : undefined,
|
|
116
135
|
};
|
|
117
136
|
});
|
|
118
137
|
}
|
|
@@ -163,4 +182,31 @@ function getNavigationPropertyAddressUrl(program, property) {
|
|
|
163
182
|
}
|
|
164
183
|
return undefined;
|
|
165
184
|
}
|
|
185
|
+
function getNavigationPropertyAddressUrlMsa(program, property) {
|
|
186
|
+
const msGraphRoutes = GetMsGraphRoutes(program);
|
|
187
|
+
for (const [_, msGraphRoute] of msGraphRoutes.entries()) {
|
|
188
|
+
if (msGraphRoute.resource === property && hasAddressUrlMsa(program, msGraphRoute.theInterface)) {
|
|
189
|
+
return getMsGraphAddressUrlMsa(program, msGraphRoute.theInterface);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return undefined;
|
|
193
|
+
}
|
|
194
|
+
function getNavigationPropertyPassthroughAddressUrl(program, property) {
|
|
195
|
+
const msGraphRoutes = GetMsGraphRoutes(program);
|
|
196
|
+
for (const [_, msGraphRoute] of msGraphRoutes.entries()) {
|
|
197
|
+
if (msGraphRoute.resource === property && hasPassthroughAddressUrl(program, msGraphRoute.theInterface)) {
|
|
198
|
+
return getMsGraphPassthroughAddressUrl(program, msGraphRoute.theInterface);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return undefined;
|
|
202
|
+
}
|
|
203
|
+
function getNavigationPropertyPassthroughAddressUrlMsa(program, property) {
|
|
204
|
+
const msGraphRoutes = GetMsGraphRoutes(program);
|
|
205
|
+
for (const [_, msGraphRoute] of msGraphRoutes.entries()) {
|
|
206
|
+
if (msGraphRoute.resource === property && hasPassthroughAddressUrlMsa(program, msGraphRoute.theInterface)) {
|
|
207
|
+
return getMsGraphPassthroughAddressUrlMsa(program, msGraphRoute.theInterface);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return undefined;
|
|
211
|
+
}
|
|
166
212
|
//# sourceMappingURL=model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/entities/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACtG,OAAO,EAAE,qBAAqB,EAAsB,MAAM,0BAA0B,CAAC;AACrF,OAAO,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/entities/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACtG,OAAO,EAAE,qBAAqB,EAAsB,MAAM,0BAA0B,CAAC;AACrF,OAAO,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,SAAS,EACT,aAAa,EACb,QAAQ,EACR,MAAM,EACN,OAAO,EACP,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,GAEzB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,6BAA6B,EAC7B,mBAAmB,EACnB,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAmD,oBAAoB,EAAE,uBAAuB,EAAE,+BAA+B,EAAE,kCAAkC,EAAE,MAAM,kBAAkB,CAAC;AACvM,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAoB3F,MAAM,CAAN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graph-route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAI9E,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,KAAK,GAAG,aAAa,CAAC;IAChC,SAAS,EAAE,gBAAgB,CAAC;IAC5B,YAAY,EAAE,SAAS,CAAC;CACzB;AAED,oBAAY,gBAAgB;IAC1B,SAAS,IAAA;IACT,SAAS,IAAA;IACT,kBAAkB,IAAA;CACnB;
|
|
1
|
+
{"version":3,"file":"ms-graph-route.d.ts","sourceRoot":"","sources":["../../../src/entities/ms-graph-route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAI9E,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,KAAK,GAAG,aAAa,CAAC;IAChC,SAAS,EAAE,gBAAgB,CAAC;IAC5B,YAAY,EAAE,SAAS,CAAC;CACzB;AAED,oBAAY,gBAAgB;IAC1B,SAAS,IAAA;IACT,SAAS,IAAA;IACT,kBAAkB,IAAA;CACnB;AAGD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CA4D5E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getInterfaceNavigationSourceType, getInterfacesOfKinds, getSourceInterfaces, isNavigationProperty, isTopLevelNavigationSource } from "../utils.js";
|
|
1
|
+
import { extractTypesFromUnion, getInterfaceNavigationSourceType, getInterfacesOfKinds, getSourceInterfaces, isNavigationProperty, isNullType, isTopLevelNavigationSource } from "../utils.js";
|
|
2
2
|
import { GetDeclaredNamespaces, getNavigationSources } from "./namespace.js";
|
|
3
3
|
export var MsGraphRouteType;
|
|
4
4
|
(function (MsGraphRouteType) {
|
|
@@ -6,31 +6,25 @@ export var MsGraphRouteType;
|
|
|
6
6
|
MsGraphRouteType[MsGraphRouteType["Singleton"] = 1] = "Singleton";
|
|
7
7
|
MsGraphRouteType[MsGraphRouteType["NavigationProperty"] = 2] = "NavigationProperty";
|
|
8
8
|
})(MsGraphRouteType || (MsGraphRouteType = {}));
|
|
9
|
-
let graphRoutesCache = undefined;
|
|
10
9
|
export function GetMsGraphRoutes(program) {
|
|
11
|
-
|
|
12
|
-
return graphRoutesCache;
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
graphRoutesCache = new Map();
|
|
16
|
-
}
|
|
10
|
+
const graphRoutes = new Map();
|
|
17
11
|
const namespaces = GetDeclaredNamespaces(program);
|
|
18
12
|
for (const namespace of namespaces) {
|
|
19
13
|
const sources = getNavigationSources(namespace.interfaces);
|
|
20
14
|
const navigationSources = getInterfacesOfKinds(program, sources, ["Resource", "Collection"]);
|
|
21
|
-
// Populate cache with
|
|
15
|
+
// Populate cache with entity sets and singletons
|
|
22
16
|
navigationSources.forEach((msGraphInterface, graphRoute) => {
|
|
23
17
|
if (isTopLevelNavigationSource(program, msGraphInterface)) {
|
|
24
18
|
const navigationSourceType = getInterfaceNavigationSourceType(program, msGraphInterface.theInterface);
|
|
25
19
|
if (getSourceInterfaces(msGraphInterface.theInterface).some((baseInterface) => baseInterface.name === "Collection")) {
|
|
26
|
-
|
|
20
|
+
graphRoutes.set(graphRoute, {
|
|
27
21
|
resource: navigationSourceType,
|
|
28
22
|
routeType: MsGraphRouteType.EntitySet,
|
|
29
23
|
theInterface: msGraphInterface.theInterface
|
|
30
24
|
});
|
|
31
25
|
}
|
|
32
26
|
else {
|
|
33
|
-
|
|
27
|
+
graphRoutes.set(graphRoute, {
|
|
34
28
|
resource: navigationSourceType,
|
|
35
29
|
routeType: MsGraphRouteType.Singleton,
|
|
36
30
|
theInterface: msGraphInterface.theInterface
|
|
@@ -42,21 +36,27 @@ export function GetMsGraphRoutes(program) {
|
|
|
42
36
|
navigationSources.forEach((msGraphInterface, graphRoute) => {
|
|
43
37
|
if (!isTopLevelNavigationSource(program, msGraphInterface)) {
|
|
44
38
|
const routeSegments = graphRoute.split("/");
|
|
45
|
-
const topLevelGraphRoute =
|
|
39
|
+
const topLevelGraphRoute = graphRoutes.get(routeSegments[0]);
|
|
46
40
|
if (topLevelGraphRoute) {
|
|
47
41
|
let model = topLevelGraphRoute === null || topLevelGraphRoute === void 0 ? void 0 : topLevelGraphRoute.resource;
|
|
48
42
|
for (let i = 1; i < routeSegments.length; i++) {
|
|
49
43
|
model.properties.forEach((property) => {
|
|
50
44
|
if (property.name === routeSegments[i] && isNavigationProperty(program, property)) {
|
|
51
45
|
if (i === routeSegments.length - 1) {
|
|
52
|
-
|
|
46
|
+
graphRoutes.set(graphRoute, {
|
|
53
47
|
resource: property,
|
|
54
48
|
routeType: MsGraphRouteType.NavigationProperty,
|
|
55
49
|
theInterface: msGraphInterface.theInterface
|
|
56
50
|
});
|
|
57
51
|
}
|
|
58
52
|
else {
|
|
59
|
-
|
|
53
|
+
if (property.type.kind === "Union") {
|
|
54
|
+
const nonNullUnionTypes = extractTypesFromUnion(property.type).filter(t => !isNullType(property.type));
|
|
55
|
+
model = nonNullUnionTypes[0];
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
model = property.type;
|
|
59
|
+
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
});
|
|
@@ -65,6 +65,6 @@ export function GetMsGraphRoutes(program) {
|
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
return
|
|
68
|
+
return graphRoutes;
|
|
69
69
|
}
|
|
70
70
|
//# sourceMappingURL=ms-graph-route.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ms-graph-route.js","sourceRoot":"","sources":["../../../src/entities/ms-graph-route.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;
|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AAkB;wCAC9C,YAAY,EAAE,gBAAgB,CAAC,YAAY;qCAC5C,CAAC,CAAA;iCACH;qCAAM;oCACL,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE;wCAClC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;wCACvG,KAAK,GAAG,iBAAiB,CAAC,CAAC,CAAU,CAAC;qCACvC;yCAAM;wCACL,KAAK,GAAG,QAAQ,CAAC,IAAa,CAAC;qCAChC;iCACF;6BACF;wBACH,CAAC,CAAC,CAAC;qBACJ;iBACF;aACF;QACH,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -14,6 +14,7 @@ export interface MsGraphOperation {
|
|
|
14
14
|
UnionProperties: MsGraphOperationProperty[][];
|
|
15
15
|
IsVoid: boolean;
|
|
16
16
|
IsNullable: boolean;
|
|
17
|
+
IsComposable: boolean | undefined;
|
|
17
18
|
ReturnTypeName: string;
|
|
18
19
|
Description: string | undefined;
|
|
19
20
|
RevisionDefinition: RevisionDefinition | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../src/entities/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA8D,SAAS,EAAsB,MAAM,oBAAoB,CAAC;AAMxI,OAAO,EAAyB,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGrF,oBAAY,aAAa;IACvB,OAAO,IAAA;IACP,MAAM,IAAA;IACN,QAAQ,IAAA;CACT;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MA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MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,UAAU,EAAE,wBAAwB,EAAE,CAAC;IACvC,eAAe,EAAE,wBAAwB,EAAE,EAAE,CAAC;IAC9C,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACnD,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,wBAAwB;IAEvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAClD,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,CAAC;CACpD;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,gBAAgB,EAAE,CAuB7G"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isVoidType, getDoc, getLocationContext } from "@typespec/compiler";
|
|
2
2
|
import { isPathParam } from "@typespec/http";
|
|
3
3
|
import { extractParamsFromPath, getAction, getFunction, getGraphRoutePaths, isGlobalOperation, isOperationParameters } from "../index.js";
|
|
4
|
-
import { isTypeNullable, getPropertyTypeName, extractTypesFromUnion, getInterfaceNavigationSourceType } from "../utils.js";
|
|
4
|
+
import { isTypeNullable, getPropertyTypeName, extractTypesFromUnion, getInterfaceNavigationSourceType, getSourceInterfaces } from "../utils.js";
|
|
5
5
|
import { getDefaultPropertyValue } from "./property.js";
|
|
6
6
|
import { buildAttributes } from "../decorators/ags-attribute.js";
|
|
7
7
|
import { GetRevisionDefinition } from "./revision-definition.js";
|
|
@@ -39,6 +39,7 @@ function GetMsGraphOperation(program, bindingTypeName, operation) {
|
|
|
39
39
|
UnionProperties: new Array(),
|
|
40
40
|
IsVoid: isVoidType(operation.returnType),
|
|
41
41
|
IsNullable: false,
|
|
42
|
+
IsComposable: undefined,
|
|
42
43
|
ReturnTypeName: "",
|
|
43
44
|
Description: getDoc(program, operation),
|
|
44
45
|
RevisionDefinition: GetRevisionDefinition(program, operation, operation.namespace),
|
|
@@ -72,9 +73,10 @@ function GetMsGraphOperation(program, bindingTypeName, operation) {
|
|
|
72
73
|
element.Kind = OperationKind.Action;
|
|
73
74
|
}
|
|
74
75
|
else {
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
element.Name =
|
|
76
|
+
const theFunction = getFunction(program, operation);
|
|
77
|
+
if (theFunction) {
|
|
78
|
+
element.Name = theFunction.name;
|
|
79
|
+
element.IsComposable = theFunction.isComposable;
|
|
78
80
|
element.Kind = OperationKind.Function;
|
|
79
81
|
const parameterProperty = operation.parameters.properties.get("parameters");
|
|
80
82
|
if (parameterProperty && parameterProperty.type.kind === "Union") {
|
|
@@ -105,7 +107,11 @@ function getBindingTypeName(program, operation) {
|
|
|
105
107
|
if (!bindingType) {
|
|
106
108
|
return undefined;
|
|
107
109
|
}
|
|
108
|
-
|
|
110
|
+
const propertyTypeName = getPropertyTypeName(program, bindingType);
|
|
111
|
+
if (getSourceInterfaces(operation.interface).some((theInterface) => theInterface.name === "Collection")) {
|
|
112
|
+
return `Collection(${propertyTypeName})`;
|
|
113
|
+
}
|
|
114
|
+
return propertyTypeName;
|
|
109
115
|
}
|
|
110
116
|
function getParameterProperties(program, parameters) {
|
|
111
117
|
const properties = [...parameters].flatMap(([, property]) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../src/entities/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,UAAU,EAAE,MAAM,EAAmC,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxI,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,WAAW,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC1I,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../src/entities/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,UAAU,EAAE,MAAM,EAAmC,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxI,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,WAAW,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC1I,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,gCAAgC,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAChJ,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAsB,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,uDAAO,CAAA;IACP,qDAAM,CAAA;IACN,yDAAQ,CAAA;AACV,CAAC,EAJW,aAAa,KAAb,aAAa,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ources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
package/dist/src/index.js
CHANGED
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
package/dist/src/lib.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare const namespace = "MsGraph";
|
|
|
2
2
|
export interface MsGraphEmitterOptions {
|
|
3
3
|
filename?: string;
|
|
4
4
|
}
|
|
5
|
-
export declare const reportDiagnostic: <C extends "decorator-missing-dependencies" | "element-missing-dependencies" | "decorator-invalid-use" | "singleton-invalid-name" | "extends-invalid-use", M extends keyof {
|
|
5
|
+
export declare const reportDiagnostic: <C extends "decorator-missing-dependencies" | "element-missing-dependencies" | "decorator-invalid-use" | "singleton-invalid-name" | "extends-invalid-use" | "type-invalid-use", M extends keyof {
|
|
6
6
|
"decorator-missing-dependencies": {
|
|
7
7
|
readonly default: import("@typespec/compiler").CallableMessage<[string, string, string]>;
|
|
8
8
|
readonly function: import("@typespec/compiler").CallableMessage<[]>;
|
|
@@ -47,8 +47,9 @@ export declare const reportDiagnostic: <C extends "decorator-missing-dependencie
|
|
|
47
47
|
readonly referenceTargetInterfaceMustHaveGraphRoute: import("@typespec/compiler").CallableMessage<[]>;
|
|
48
48
|
readonly referenceTargetMustOnlyBeUsedOnceOnInterface: import("@typespec/compiler").CallableMessage<[]>;
|
|
49
49
|
readonly referenceTargetPathShouldNotHaveParameters: import("@typespec/compiler").CallableMessage<[string]>;
|
|
50
|
-
readonly singletonOrEntitySetHostingBindingsShouldExist: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
51
50
|
readonly interfaceWithGraphRouteMustExtendGraphStandardBaseInterface: import("@typespec/compiler").CallableMessage<[]>;
|
|
51
|
+
readonly duplicateGraphRouteNotAllowed: import("@typespec/compiler").CallableMessage<[string, string, string]>;
|
|
52
|
+
readonly duplicateParametersAreNotAllowedInGraphRoute: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
52
53
|
};
|
|
53
54
|
"singleton-invalid-name": {
|
|
54
55
|
readonly default: import("@typespec/compiler").CallableMessage<[string]>;
|
|
@@ -57,6 +58,12 @@ export declare const reportDiagnostic: <C extends "decorator-missing-dependencie
|
|
|
57
58
|
readonly default: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
58
59
|
readonly namespaces: "A model can only extend other models in a different logical namespace. Use @partial instead.";
|
|
59
60
|
};
|
|
61
|
+
"type-invalid-use": {
|
|
62
|
+
readonly default: import("@typespec/compiler").CallableMessage<[string]>;
|
|
63
|
+
readonly recordTypeCannotBePrepopulated: import("@typespec/compiler").CallableMessage<[string]>;
|
|
64
|
+
readonly recordTypeCannotBeNull: import("@typespec/compiler").CallableMessage<[string]>;
|
|
65
|
+
readonly recordTypeCannotBeUsedInLine: import("@typespec/compiler").CallableMessage<[string]>;
|
|
66
|
+
};
|
|
60
67
|
}[C]>(program: import("@typespec/compiler").Program, diag: import("@typespec/compiler").DiagnosticReport<{
|
|
61
68
|
"decorator-missing-dependencies": {
|
|
62
69
|
readonly default: import("@typespec/compiler").CallableMessage<[string, string, string]>;
|
|
@@ -102,8 +109,9 @@ export declare const reportDiagnostic: <C extends "decorator-missing-dependencie
|
|
|
102
109
|
readonly referenceTargetInterfaceMustHaveGraphRoute: import("@typespec/compiler").CallableMessage<[]>;
|
|
103
110
|
readonly referenceTargetMustOnlyBeUsedOnceOnInterface: import("@typespec/compiler").CallableMessage<[]>;
|
|
104
111
|
readonly referenceTargetPathShouldNotHaveParameters: import("@typespec/compiler").CallableMessage<[string]>;
|
|
105
|
-
readonly singletonOrEntitySetHostingBindingsShouldExist: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
106
112
|
readonly interfaceWithGraphRouteMustExtendGraphStandardBaseInterface: import("@typespec/compiler").CallableMessage<[]>;
|
|
113
|
+
readonly duplicateGraphRouteNotAllowed: import("@typespec/compiler").CallableMessage<[string, string, string]>;
|
|
114
|
+
readonly duplicateParametersAreNotAllowedInGraphRoute: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
107
115
|
};
|
|
108
116
|
"singleton-invalid-name": {
|
|
109
117
|
readonly default: import("@typespec/compiler").CallableMessage<[string]>;
|
|
@@ -112,5 +120,11 @@ export declare const reportDiagnostic: <C extends "decorator-missing-dependencie
|
|
|
112
120
|
readonly default: import("@typespec/compiler").CallableMessage<[string, string]>;
|
|
113
121
|
readonly namespaces: "A model can only extend other models in a different logical namespace. Use @partial instead.";
|
|
114
122
|
};
|
|
123
|
+
"type-invalid-use": {
|
|
124
|
+
readonly default: import("@typespec/compiler").CallableMessage<[string]>;
|
|
125
|
+
readonly recordTypeCannotBePrepopulated: import("@typespec/compiler").CallableMessage<[string]>;
|
|
126
|
+
readonly recordTypeCannotBeNull: import("@typespec/compiler").CallableMessage<[string]>;
|
|
127
|
+
readonly recordTypeCannotBeUsedInLine: import("@typespec/compiler").CallableMessage<[string]>;
|
|
128
|
+
};
|
|
115
129
|
}, C, M>) => void;
|
|
116
130
|
//# sourceMappingURL=lib.d.ts.map
|
package/dist/src/lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,YAAY,CAAC;AAEnC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAeD,eAAO,MAAQ,gBAAgB
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,YAAY,CAAC;AAEnC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAeD,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoFpB,CAAC"}
|
package/dist/src/lib.js
CHANGED
|
@@ -67,8 +67,9 @@ export const { reportDiagnostic } = createTypeSpecLibrary({
|
|
|
67
67
|
referenceTargetInterfaceMustHaveGraphRoute: paramMessage `The @referenceTarget decorator must be used on an interface with a @graphRoute decorator.`,
|
|
68
68
|
referenceTargetMustOnlyBeUsedOnceOnInterface: paramMessage `The @referenceTarget decorator can only be used once on an interface.`,
|
|
69
69
|
referenceTargetPathShouldNotHaveParameters: paramMessage `The @referenceTarget path "${"target"}" cannot have parameters {}.`,
|
|
70
|
-
singletonOrEntitySetHostingBindingsShouldExist: paramMessage `A singleton or entityset definition should exist to bind "${"firstSegment"}" to "${"target"}"`,
|
|
71
70
|
interfaceWithGraphRouteMustExtendGraphStandardBaseInterface: paramMessage `The @graphRoute decorator can only be used on an interface that ultimately extends a Graph standard base interface i.e. Resource<T> or Collection<T>.`,
|
|
71
|
+
duplicateGraphRouteNotAllowed: paramMessage `The @graphRoute "${"graphRoute"}" on "${"target"}" is already defined on another interface "${"existing"}".`,
|
|
72
|
+
duplicateParametersAreNotAllowedInGraphRoute: paramMessage `The parameters "${"parameters"}" on the @graphRoute "${"graphRoute"}" must have unique names.`,
|
|
72
73
|
},
|
|
73
74
|
},
|
|
74
75
|
"singleton-invalid-name": {
|
|
@@ -84,11 +85,16 @@ export const { reportDiagnostic } = createTypeSpecLibrary({
|
|
|
84
85
|
namespaces: 'A model can only extend other models in a different logical namespace. Use @partial instead.'
|
|
85
86
|
},
|
|
86
87
|
},
|
|
88
|
+
"type-invalid-use": {
|
|
89
|
+
severity: "error",
|
|
90
|
+
messages: {
|
|
91
|
+
default: paramMessage `The ${"type"} has been wrongly used. Refer to Typespec documentation`,
|
|
92
|
+
recordTypeCannotBePrepopulated: paramMessage `The record type "${"type"}" cannot be prepopulated.`,
|
|
93
|
+
recordTypeCannotBeNull: paramMessage `The record type "${"type"}" cannot be null.`,
|
|
94
|
+
recordTypeCannotBeUsedInLine: paramMessage `Using inline record as type on ${"type"} is not supported. Create a complex entity to represent it.`,
|
|
95
|
+
}
|
|
96
|
+
}
|
|
87
97
|
},
|
|
88
|
-
// TODO: Enable the linter rule
|
|
89
|
-
// linter: {
|
|
90
|
-
// rules: [useEvolvableEnumRule, singletonOrEntitySetHostingBindingsShouldExist],
|
|
91
|
-
// },
|
|
92
98
|
emitter: { options: EmitterOptionsSchema },
|
|
93
99
|
});
|
|
94
100
|
//# sourceMappingURL=lib.js.map
|
package/dist/src/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,qBAAqB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEzF,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC;AAMnC,MAAM,oBAAoB,GAA0C;IAClE,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,QAAQ,EAA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,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,+CAalB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineLinter } from "@typespec/compiler";
|
|
2
|
+
import { modelShouldBeEntityOrComplexType, singletonOrEntitySetHostingBindingsShouldExist, useEvolvableEnumRule, mediaTypeValuesShouldBeMinimallyFormattedForMIMETypes, interfaceNavigationSourceShouldHaveMediaIf$ValueIsSpecified } from "./rules/index.js";
|
|
3
|
+
export const $linter = defineLinter({
|
|
4
|
+
rules: [useEvolvableEnumRule, singletonOrEntitySetHostingBindingsShouldExist, modelShouldBeEntityOrComplexType, mediaTypeValuesShouldBeMinimallyFormattedForMIMETypes, interfaceNavigationSourceShouldHaveMediaIf$ValueIsSpecified],
|
|
5
|
+
ruleSets: {
|
|
6
|
+
recommended: {
|
|
7
|
+
enable: {
|
|
8
|
+
[`@microsoft/typespec-msgraph/${useEvolvableEnumRule.name}`]: true,
|
|
9
|
+
[`@microsoft/typespec-msgraph/${singletonOrEntitySetHostingBindingsShouldExist.name}`]: true,
|
|
10
|
+
[`@microsoft/typespec-msgraph/${modelShouldBeEntityOrComplexType.name}`]: true,
|
|
11
|
+
[`@microsoft/typespec-msgraph/${mediaTypeValuesShouldBeMinimallyFormattedForMIMETypes.name}`]: true,
|
|
12
|
+
[`@microsoft/typespec-msgraph/${interfaceNavigationSourceShouldHaveMediaIf$ValueIsSpecified.name}`]: true,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=linter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linter.js","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gCAAgC,EAAE,8CAA8C,EAAE,oBAAoB,EAAE,qDAAqD,EAAE,2DAA2D,EAAE,MAAM,kBAAkB,CAAC;AAE9P,MAAM,CAAC,MAAM,OAAO,GAAG,YAAY,CAAC;IAClC,KAAK,EAAE,CAAC,oBAAoB,EAAE,8CAA8C,EAAE,gCAAgC,EAAE,qDAAqD,EAAE,2DAA2D,CAAC;IACnO,QAAQ,EAAE;QACR,WAAW,EAAE;YACX,MAAM,EAAE;gBACN,CAAC,+BAA+B,oBAAoB,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBAClE,CAAC,+BAA+B,8CAA8C,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBAC5F,CAAC,+BAA+B,gCAAgC,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBAC9E,CAAC,+BAA+B,qDAAqD,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;gBACnG,CAAC,+BAA+B,2DAA2D,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;aAC1G;SACF;KACF;CACF,CAAC,CAAA"}
|
|
@@ -3,4 +3,17 @@ import { Program } from "@typespec/compiler";
|
|
|
3
3
|
* @addressUrl only applies to either routed interfaces (entity sets, singletons and navigation properties) or action operations.
|
|
4
4
|
*/
|
|
5
5
|
export declare function validateAddressUrlOnlyAppliesToRoutedInterfacesOrActionOperations(program: Program): void;
|
|
6
|
+
/**
|
|
7
|
+
* @addressUrlMsa only applies to either routed interfaces (entity sets, singletons and navigation properties) or action operations.
|
|
8
|
+
*/
|
|
9
|
+
export declare function validateAddressUrlMsaOnlyAppliesToRoutedInterfacesOrActionOperations(program: Program): void;
|
|
10
|
+
/**
|
|
11
|
+
* @passthroughAddressUrl only applies to either routed interfaces (entity sets, singletons and navigation properties) or action operations.
|
|
12
|
+
*/
|
|
13
|
+
export declare function validatePassthroughAddressUrlOnlyAppliesToRoutedInterfacesOrActionOperations(program: Program): void;
|
|
14
|
+
/**
|
|
15
|
+
* @passthroughAddressUrlMsa only applies to either routed interfaces (entity sets, singletons and navigation properties) or action operations.
|
|
16
|
+
*/
|
|
17
|
+
export declare function validatePassthroughAddressUrlMsaOnlyAppliesToRoutedInterfacesOrActionOperations(program: Program): void;
|
|
18
|
+
export declare function validatePassthroughAddressUrlDecoratorIsUsedTogetherWithAddressUrlDecorator(program: Program): void;
|
|
6
19
|
//# sourceMappingURL=address-url.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-url.d.ts","sourceRoot":"","sources":["../../../src/rules/address-url.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"address-url.d.ts","sourceRoot":"","sources":["../../../src/rules/address-url.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAkD,MAAM,oBAAoB,CAAC;AAK7F;;GAEG;AACH,wBAAgB,iEAAiE,CAC/E,OAAO,EAAE,OAAO,QAgBjB;AAED;;GAEG;AACH,wBAAgB,oEAAoE,CAClF,OAAO,EAAE,OAAO,QAgBjB;AAED;;GAEG;AACH,wBAAgB,4EAA4E,CAC1F,OAAO,EAAE,OAAO,QAgBjB;AAED;;GAEG;AACH,wBAAgB,+EAA+E,CAC7F,OAAO,EAAE,OAAO,QAgBjB;AAED,wBAAgB,2EAA2E,CACzF,OAAO,EAAE,OAAO,QAqEjB"}
|