@microsoft/typespec-msgraph 0.0.1-Preview.5 → 0.0.1-Preview.7
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 +5 -5
- package/dist/src/components/annotations.d.ts.map +1 -1
- package/dist/src/components/annotations.js +18 -23
- package/dist/src/components/annotations.js.map +1 -1
- package/dist/src/components/count-restrictions-annotation.d.ts +1 -1
- package/dist/src/components/count-restrictions-annotation.d.ts.map +1 -1
- package/dist/src/components/count-restrictions-annotation.js +2 -2
- package/dist/src/components/count-restrictions-annotation.js.map +1 -1
- package/dist/src/components/entity-container-element.d.ts +2 -2
- package/dist/src/components/entity-container-element.d.ts.map +1 -1
- 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/expand-restrictions-annotation.d.ts +1 -1
- package/dist/src/components/expand-restrictions-annotation.d.ts.map +1 -1
- package/dist/src/components/expand-restrictions-annotation.js +3 -3
- package/dist/src/components/expand-restrictions-annotation.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/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/search-restrictions-annotation.d.ts +1 -1
- package/dist/src/components/search-restrictions-annotation.d.ts.map +1 -1
- package/dist/src/components/search-restrictions-annotation.js +2 -2
- package/dist/src/components/search-restrictions-annotation.js.map +1 -1
- package/dist/src/components/skip-supported-annotation.d.ts +1 -1
- package/dist/src/components/skip-supported-annotation.d.ts.map +1 -1
- package/dist/src/components/skip-supported-annotation.js +1 -1
- package/dist/src/components/skip-supported-annotation.js.map +1 -1
- package/dist/src/components/sort-restrictions-annotation.d.ts +1 -1
- package/dist/src/components/sort-restrictions-annotation.d.ts.map +1 -1
- package/dist/src/components/sort-restrictions-annotation.js +3 -3
- package/dist/src/components/sort-restrictions-annotation.js.map +1 -1
- package/dist/src/components/structured-type-element.js +2 -2
- package/dist/src/components/structured-type-element.js.map +1 -1
- package/dist/src/components/top-supported-annotation.d.ts +1 -1
- package/dist/src/components/top-supported-annotation.d.ts.map +1 -1
- package/dist/src/components/top-supported-annotation.js +2 -2
- package/dist/src/components/top-supported-annotation.js.map +1 -1
- package/dist/src/components/update-restrictions-annotation.d.ts +5 -0
- package/dist/src/components/update-restrictions-annotation.d.ts.map +1 -0
- package/dist/src/components/update-restrictions-annotation.js +8 -0
- package/dist/src/components/update-restrictions-annotation.js.map +1 -0
- package/dist/src/decorators/flags.d.ts +9 -0
- package/dist/src/decorators/flags.d.ts.map +1 -0
- package/dist/src/decorators/flags.js +13 -0
- package/dist/src/decorators/flags.js.map +1 -0
- package/dist/src/decorators/index.d.ts +1 -0
- package/dist/src/decorators/index.d.ts.map +1 -1
- package/dist/src/decorators/index.js +1 -0
- package/dist/src/decorators/index.js.map +1 -1
- package/dist/src/entities/annotations.d.ts +19 -18
- package/dist/src/entities/annotations.d.ts.map +1 -1
- package/dist/src/entities/annotations.js +55 -54
- package/dist/src/entities/annotations.js.map +1 -1
- package/dist/src/entities/entity-container.d.ts +4 -3
- package/dist/src/entities/entity-container.d.ts.map +1 -1
- package/dist/src/entities/entity-container.js +14 -10
- package/dist/src/entities/entity-container.js.map +1 -1
- package/dist/src/entities/enum.d.ts +1 -0
- package/dist/src/entities/enum.d.ts.map +1 -1
- package/dist/src/entities/enum.js +2 -0
- package/dist/src/entities/enum.js.map +1 -1
- package/dist/src/entities/model.d.ts +4 -4
- package/dist/src/entities/model.d.ts.map +1 -1
- package/dist/src/entities/model.js +7 -7
- package/dist/src/entities/model.js.map +1 -1
- package/dist/src/entities/namespace.d.ts +8 -6
- package/dist/src/entities/namespace.d.ts.map +1 -1
- package/dist/src/entities/namespace.js +25 -8
- package/dist/src/entities/namespace.js.map +1 -1
- package/dist/src/entities/revision-definition.d.ts +1 -1
- package/dist/src/entities/revision-definition.js +3 -3
- package/dist/src/lib.d.ts +4 -0
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +1 -0
- package/dist/src/lib.js.map +1 -1
- package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts +2 -0
- package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts.map +1 -0
- package/dist/src/rules/collection-navigation-properties-not-nullable.js +28 -0
- package/dist/src/rules/collection-navigation-properties-not-nullable.js.map +1 -0
- package/dist/src/rules/count.js +2 -2
- package/dist/src/rules/count.js.map +1 -1
- package/dist/src/rules/disallowed-typespec-decorators.d.ts +2 -0
- package/dist/src/rules/disallowed-typespec-decorators.d.ts.map +1 -0
- package/dist/src/rules/disallowed-typespec-decorators.js +33 -0
- package/dist/src/rules/disallowed-typespec-decorators.js.map +1 -0
- package/dist/src/rules/extends-on-same-type.d.ts +2 -0
- package/dist/src/rules/extends-on-same-type.d.ts.map +1 -0
- package/dist/src/rules/extends-on-same-type.js +38 -0
- package/dist/src/rules/extends-on-same-type.js.map +1 -0
- package/dist/src/rules/index.d.ts +4 -3
- package/dist/src/rules/index.d.ts.map +1 -1
- package/dist/src/rules/index.js +4 -89
- package/dist/src/rules/index.js.map +1 -1
- package/dist/src/rules/operation-inside-interface.d.ts +2 -0
- package/dist/src/rules/operation-inside-interface.d.ts.map +1 -0
- package/dist/src/rules/operation-inside-interface.js +25 -0
- package/dist/src/rules/operation-inside-interface.js.map +1 -0
- package/dist/src/rules/order-by.js +2 -2
- package/dist/src/rules/order-by.js.map +1 -1
- package/dist/src/rules/search.js +2 -2
- package/dist/src/rules/search.js.map +1 -1
- package/dist/src/rules/skip.js +2 -2
- package/dist/src/rules/skip.js.map +1 -1
- package/dist/src/rules/top.js +2 -2
- package/dist/src/rules/top.js.map +1 -1
- package/dist/src/utils.d.ts +4 -5
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +41 -25
- package/dist/src/utils.js.map +1 -1
- package/lib/decorators.tsp +7 -0
- package/lib/porcelain.tsp +1 -1
- package/package.json +1 -1
package/dist/src/utils.js
CHANGED
|
@@ -89,28 +89,31 @@ export function getNavigationTypeId(program, getOperation) {
|
|
|
89
89
|
return getIdForType(program, returnType.templateArguments[0]);
|
|
90
90
|
}
|
|
91
91
|
export function getInterfacesOfKinds(program, navigationSources, kinds) {
|
|
92
|
-
const
|
|
93
|
-
navigationSources.forEach(theInterface => {
|
|
94
|
-
var _a;
|
|
92
|
+
const interfaces = new Map();
|
|
93
|
+
navigationSources.forEach((theInterface) => {
|
|
95
94
|
if (!theInterface.sourceInterfaces.some(s => kinds.includes(s.name))) {
|
|
96
95
|
// if source interfaces DO NOT have the kinds.
|
|
97
96
|
return;
|
|
98
97
|
}
|
|
99
|
-
const routePath =
|
|
98
|
+
const routePath = getRoutePath(program, theInterface);
|
|
100
99
|
if (!routePath) {
|
|
101
100
|
return;
|
|
102
101
|
}
|
|
102
|
+
const path = removeRoutePathParams(routePath.path);
|
|
103
|
+
if (!path) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
103
106
|
let operations = [...theInterface.operations.values()];
|
|
104
|
-
if (
|
|
105
|
-
const existing =
|
|
107
|
+
if (interfaces.has(path)) {
|
|
108
|
+
const existing = interfaces.get(path);
|
|
106
109
|
operations = [...operations, ...existing.operations];
|
|
107
110
|
}
|
|
108
|
-
|
|
111
|
+
interfaces.set(path, {
|
|
109
112
|
theInterface: theInterface,
|
|
110
113
|
operations: operations,
|
|
111
114
|
});
|
|
112
115
|
});
|
|
113
|
-
return
|
|
116
|
+
return interfaces;
|
|
114
117
|
}
|
|
115
118
|
export function getPropertyTypeName(program, type) {
|
|
116
119
|
var _a;
|
|
@@ -156,26 +159,24 @@ export function getSingletonTypeId(program, singletonType, getOperation) {
|
|
|
156
159
|
return getOperation && getNavigationTypeId(program, getOperation);
|
|
157
160
|
}
|
|
158
161
|
/**
|
|
159
|
-
* Returns whether a type
|
|
162
|
+
* Returns whether a type matches Graph's definition of a collection
|
|
160
163
|
* @param program
|
|
161
|
-
* @param
|
|
164
|
+
* @param type
|
|
162
165
|
*/
|
|
163
|
-
export function
|
|
164
|
-
let
|
|
165
|
-
if (
|
|
166
|
-
|
|
166
|
+
export function isTypeCollection(Program, type) {
|
|
167
|
+
let modelTypes = [];
|
|
168
|
+
if (type.kind === "Union") {
|
|
169
|
+
const extracted = (extractTypesFromUnion(type).filter((t) => t.kind === "Model"));
|
|
170
|
+
modelTypes = modelTypes.concat(extracted);
|
|
167
171
|
}
|
|
168
|
-
else if (
|
|
169
|
-
|
|
170
|
-
returnTypes = returnTypes.concat(extracted);
|
|
172
|
+
else if (type.kind === "Model") {
|
|
173
|
+
modelTypes.push(type);
|
|
171
174
|
}
|
|
172
|
-
if (
|
|
175
|
+
if (modelTypes.length === 0) {
|
|
173
176
|
return false;
|
|
174
177
|
}
|
|
175
|
-
return
|
|
176
|
-
|
|
177
|
-
function isTypeCollection(type) {
|
|
178
|
-
return type.kind === "Model" && (type.name === "Array" || type.name.includes("Collection"));
|
|
178
|
+
return modelTypes.some((t) => t.kind === "Model" &&
|
|
179
|
+
(t.name === "Array" || t.name.includes("Collection")));
|
|
179
180
|
}
|
|
180
181
|
/**
|
|
181
182
|
* Imported from typespec-azure
|
|
@@ -224,6 +225,14 @@ export function isExcludedLibraryType(program, type) {
|
|
|
224
225
|
}
|
|
225
226
|
export function isNavigationProperty(program, property) {
|
|
226
227
|
let propertyType = property.type;
|
|
228
|
+
if (propertyType.kind === "Union") {
|
|
229
|
+
const unionTypes = extractTypesFromUnion(propertyType);
|
|
230
|
+
const nonNullTypes = unionTypes.filter((t) => !isNullType(program, t));
|
|
231
|
+
if (!nonNullTypes.length) {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
propertyType = nonNullTypes[0];
|
|
235
|
+
}
|
|
227
236
|
if (propertyType.kind !== "Model") {
|
|
228
237
|
return false;
|
|
229
238
|
}
|
|
@@ -235,9 +244,6 @@ export function isNavigationProperty(program, property) {
|
|
|
235
244
|
}
|
|
236
245
|
return isEntity(program, propertyType);
|
|
237
246
|
}
|
|
238
|
-
export function getNavigationSources(program, namespace) {
|
|
239
|
-
return [...namespace.interfaces.values()].filter(theInterface => isNavigationSource(theInterface));
|
|
240
|
-
}
|
|
241
247
|
export function isNavigationSource(theInterface) {
|
|
242
248
|
return findNavigationSource(theInterface) !== undefined;
|
|
243
249
|
}
|
|
@@ -271,4 +277,14 @@ function findNavigationSource(theInterface) {
|
|
|
271
277
|
}
|
|
272
278
|
return undefined;
|
|
273
279
|
}
|
|
280
|
+
/**
|
|
281
|
+
* Removes route path params from a route path
|
|
282
|
+
*
|
|
283
|
+
* Examples:
|
|
284
|
+
* - user/{id}/manager -> user/manager
|
|
285
|
+
* - user/{id}/friends/{friendId}/hobbies -> user/friends/hobbies
|
|
286
|
+
*/
|
|
287
|
+
function removeRoutePathParams(routePath) {
|
|
288
|
+
return routePath.replace(/\/\{\w+\}/g, "");
|
|
289
|
+
}
|
|
274
290
|
//# sourceMappingURL=utils.js.map
|
package/dist/src/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EAEpB,gBAAgB,GASjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAO9C,MAAM,UAAU,cAAc,CAAC,OAAgB,EAAE,IAAU;IACzD,QAAQ,IAAI,CAAC,IAAI,EAAE;QACjB,KAAK,OAAO;YACV,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5E,KAAK,m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"}
|
package/lib/decorators.tsp
CHANGED
|
@@ -71,6 +71,13 @@ extern dec entity(target: Model);
|
|
|
71
71
|
*/
|
|
72
72
|
extern dec expand(target: Operation, property: valueof string, ...otherProperties: valueof string[]);
|
|
73
73
|
|
|
74
|
+
/**
|
|
75
|
+
* `@flags` - mark an enumeration type as a flag.
|
|
76
|
+
*
|
|
77
|
+
* `@flags` can only be applied to enums.
|
|
78
|
+
*/
|
|
79
|
+
extern dec flags(target: Enum);
|
|
80
|
+
|
|
74
81
|
/**
|
|
75
82
|
* `@function` - mark an operation as a function
|
|
76
83
|
*
|
package/lib/porcelain.tsp
CHANGED
|
@@ -72,7 +72,7 @@ namespace TypeSpec.MsGraph;
|
|
|
72
72
|
TResource, TParams, TResponse, TErrorResponse>;
|
|
73
73
|
|
|
74
74
|
// @select("*")
|
|
75
|
-
@get op
|
|
75
|
+
@get op GetResource<
|
|
76
76
|
TResource extends {} = Automatic.CalculatedResourceType,
|
|
77
77
|
TParams = {... Automatic.GraphRouteParams},
|
|
78
78
|
TResponse = ResourceResponse<TResource>,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/typespec-msgraph",
|
|
3
|
-
"version": "0.0.1-Preview.
|
|
3
|
+
"version": "0.0.1-Preview.7",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec for Microsoft Graph provides a description of the Microsoft Graph APIs. It is used for generating API description languages, client and service code, documentation, and other assets.",
|
|
6
6
|
"homepage": "https://github.com/microsoftgraph/typespec-msgraph",
|