@microsoft/typespec-msgraph 0.0.1-Preview.11 → 0.0.1-Preview.13

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.
Files changed (218) hide show
  1. package/dist/src/components/annotations.js +21 -3
  2. package/dist/src/components/annotations.js.map +1 -1
  3. package/dist/src/components/operation-element.d.ts.map +1 -1
  4. package/dist/src/components/operation-element.js +16 -5
  5. package/dist/src/components/operation-element.js.map +1 -1
  6. package/dist/src/components/property-element.js +1 -1
  7. package/dist/src/components/property-element.js.map +1 -1
  8. package/dist/src/components/revisions-annotation.d.ts.map +1 -1
  9. package/dist/src/components/revisions-annotation.js +2 -1
  10. package/dist/src/components/revisions-annotation.js.map +1 -1
  11. package/dist/src/components/schema-element.d.ts.map +1 -1
  12. package/dist/src/components/schema-element.js +5 -3
  13. package/dist/src/components/schema-element.js.map +1 -1
  14. package/dist/src/components/term-element.d.ts +9 -0
  15. package/dist/src/components/term-element.d.ts.map +1 -0
  16. package/dist/src/components/term-element.js +8 -0
  17. package/dist/src/components/term-element.js.map +1 -0
  18. package/dist/src/decorators/ags-attribute.d.ts +2 -1
  19. package/dist/src/decorators/ags-attribute.d.ts.map +1 -1
  20. package/dist/src/decorators/ags-attribute.js +37 -1
  21. package/dist/src/decorators/ags-attribute.js.map +1 -1
  22. package/dist/src/decorators/experimental.d.ts +9 -0
  23. package/dist/src/decorators/experimental.d.ts.map +1 -0
  24. package/dist/src/decorators/experimental.js +13 -0
  25. package/dist/src/decorators/experimental.js.map +1 -0
  26. package/dist/src/decorators/global-operation.d.ts +9 -0
  27. package/dist/src/decorators/global-operation.d.ts.map +1 -0
  28. package/dist/src/decorators/global-operation.js +13 -0
  29. package/dist/src/decorators/global-operation.js.map +1 -0
  30. package/dist/src/decorators/graph-deprecated.d.ts +11 -0
  31. package/dist/src/decorators/graph-deprecated.d.ts.map +1 -0
  32. package/dist/src/decorators/graph-deprecated.js +19 -0
  33. package/dist/src/decorators/graph-deprecated.js.map +1 -0
  34. package/dist/src/decorators/index.d.ts +5 -0
  35. package/dist/src/decorators/index.d.ts.map +1 -1
  36. package/dist/src/decorators/index.js +5 -0
  37. package/dist/src/decorators/index.js.map +1 -1
  38. package/dist/src/decorators/is-owner.js +1 -1
  39. package/dist/src/decorators/ownerless.d.ts +8 -0
  40. package/dist/src/decorators/ownerless.d.ts.map +1 -0
  41. package/dist/src/decorators/ownerless.js +12 -0
  42. package/dist/src/decorators/ownerless.js.map +1 -0
  43. package/dist/src/decorators/public-namespace.d.ts.map +1 -1
  44. package/dist/src/decorators/public-namespace.js +4 -1
  45. package/dist/src/decorators/public-namespace.js.map +1 -1
  46. package/dist/src/decorators/term.d.ts +13 -0
  47. package/dist/src/decorators/term.d.ts.map +1 -0
  48. package/dist/src/decorators/term.js +14 -0
  49. package/dist/src/decorators/term.js.map +1 -0
  50. package/dist/src/emitter.d.ts.map +1 -1
  51. package/dist/src/emitter.js +2 -0
  52. package/dist/src/emitter.js.map +1 -1
  53. package/dist/src/entities/annotations.d.ts +4 -0
  54. package/dist/src/entities/annotations.d.ts.map +1 -1
  55. package/dist/src/entities/annotations.js +15 -0
  56. package/dist/src/entities/annotations.js.map +1 -1
  57. package/dist/src/entities/enum.js.map +1 -1
  58. package/dist/src/entities/model.d.ts +1 -0
  59. package/dist/src/entities/model.d.ts.map +1 -1
  60. package/dist/src/entities/model.js +54 -4
  61. package/dist/src/entities/model.js.map +1 -1
  62. package/dist/src/entities/namespace.d.ts +6 -1
  63. package/dist/src/entities/namespace.d.ts.map +1 -1
  64. package/dist/src/entities/namespace.js +93 -6
  65. package/dist/src/entities/namespace.js.map +1 -1
  66. package/dist/src/entities/operation.d.ts +5 -0
  67. package/dist/src/entities/operation.d.ts.map +1 -1
  68. package/dist/src/entities/operation.js +32 -8
  69. package/dist/src/entities/operation.js.map +1 -1
  70. package/dist/src/entities/revision-definition.d.ts +1 -0
  71. package/dist/src/entities/revision-definition.d.ts.map +1 -1
  72. package/dist/src/entities/revision-definition.js +3 -3
  73. package/dist/src/entities/revision-definition.js.map +1 -1
  74. package/dist/src/entities/term.d.ts +8 -0
  75. package/dist/src/entities/term.d.ts.map +1 -0
  76. package/dist/src/entities/term.js +14 -0
  77. package/dist/src/entities/term.js.map +1 -0
  78. package/dist/src/index.d.ts +1 -1
  79. package/dist/src/index.d.ts.map +1 -1
  80. package/dist/src/index.js +1 -1
  81. package/dist/src/index.js.map +1 -1
  82. package/dist/src/lib.d.ts +59 -142
  83. package/dist/src/lib.d.ts.map +1 -1
  84. package/dist/src/lib.js +20 -10
  85. package/dist/src/lib.js.map +1 -1
  86. package/dist/src/rules/allowed-values.d.ts +2 -1
  87. package/dist/src/rules/allowed-values.d.ts.map +1 -1
  88. package/dist/src/rules/allowed-values.js +7 -7
  89. package/dist/src/rules/allowed-values.js.map +1 -1
  90. package/dist/src/rules/alternate-key.d.ts +4 -3
  91. package/dist/src/rules/alternate-key.d.ts.map +1 -1
  92. package/dist/src/rules/alternate-key.js +23 -23
  93. package/dist/src/rules/alternate-key.js.map +1 -1
  94. package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts +2 -1
  95. package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts.map +1 -1
  96. package/dist/src/rules/collection-navigation-properties-not-nullable.js +9 -9
  97. package/dist/src/rules/collection-navigation-properties-not-nullable.js.map +1 -1
  98. package/dist/src/rules/computed.d.ts +2 -1
  99. package/dist/src/rules/computed.d.ts.map +1 -1
  100. package/dist/src/rules/computed.js +9 -8
  101. package/dist/src/rules/computed.js.map +1 -1
  102. package/dist/src/rules/contains.d.ts +2 -1
  103. package/dist/src/rules/contains.d.ts.map +1 -1
  104. package/dist/src/rules/contains.js +9 -8
  105. package/dist/src/rules/contains.js.map +1 -1
  106. package/dist/src/rules/count.d.ts +2 -1
  107. package/dist/src/rules/count.d.ts.map +1 -1
  108. package/dist/src/rules/count.js +9 -8
  109. package/dist/src/rules/count.js.map +1 -1
  110. package/dist/src/rules/disallowed-typespec-decorators.d.ts +2 -1
  111. package/dist/src/rules/disallowed-typespec-decorators.d.ts.map +1 -1
  112. package/dist/src/rules/disallowed-typespec-decorators.js +29 -25
  113. package/dist/src/rules/disallowed-typespec-decorators.js.map +1 -1
  114. package/dist/src/rules/entity.d.ts +5 -2
  115. package/dist/src/rules/entity.d.ts.map +1 -1
  116. package/dist/src/rules/entity.js +102 -19
  117. package/dist/src/rules/entity.js.map +1 -1
  118. package/dist/src/rules/enum.d.ts +3 -1
  119. package/dist/src/rules/enum.d.ts.map +1 -1
  120. package/dist/src/rules/enum.js +9 -6
  121. package/dist/src/rules/enum.js.map +1 -1
  122. package/dist/src/rules/expand.d.ts +3 -2
  123. package/dist/src/rules/expand.d.ts.map +1 -1
  124. package/dist/src/rules/expand.js +16 -16
  125. package/dist/src/rules/expand.js.map +1 -1
  126. package/dist/src/rules/extends-on-same-type.d.ts +2 -1
  127. package/dist/src/rules/extends-on-same-type.d.ts.map +1 -1
  128. package/dist/src/rules/extends-on-same-type.js +9 -8
  129. package/dist/src/rules/extends-on-same-type.js.map +1 -1
  130. package/dist/src/rules/filter.d.ts +4 -3
  131. package/dist/src/rules/filter.d.ts.map +1 -1
  132. package/dist/src/rules/filter.js +23 -23
  133. package/dist/src/rules/filter.js.map +1 -1
  134. package/dist/src/rules/function.d.ts +2 -1
  135. package/dist/src/rules/function.d.ts.map +1 -1
  136. package/dist/src/rules/function.js +9 -9
  137. package/dist/src/rules/function.js.map +1 -1
  138. package/dist/src/rules/global-operation.d.ts +4 -0
  139. package/dist/src/rules/global-operation.d.ts.map +1 -0
  140. package/dist/src/rules/global-operation.js +60 -0
  141. package/dist/src/rules/global-operation.js.map +1 -0
  142. package/dist/src/rules/graph-deprecated.d.ts +8 -0
  143. package/dist/src/rules/graph-deprecated.d.ts.map +1 -0
  144. package/dist/src/rules/graph-deprecated.js +152 -0
  145. package/dist/src/rules/graph-deprecated.js.map +1 -0
  146. package/dist/src/rules/graph-route.d.ts +4 -2
  147. package/dist/src/rules/graph-route.d.ts.map +1 -1
  148. package/dist/src/rules/graph-route.js +55 -15
  149. package/dist/src/rules/graph-route.js.map +1 -1
  150. package/dist/src/rules/has-stream.d.ts +2 -1
  151. package/dist/src/rules/has-stream.d.ts.map +1 -1
  152. package/dist/src/rules/has-stream.js +9 -8
  153. package/dist/src/rules/has-stream.js.map +1 -1
  154. package/dist/src/rules/index.d.ts +3 -0
  155. package/dist/src/rules/index.d.ts.map +1 -1
  156. package/dist/src/rules/index.js +3 -0
  157. package/dist/src/rules/index.js.map +1 -1
  158. package/dist/src/rules/namespace.d.ts +4 -2
  159. package/dist/src/rules/namespace.d.ts.map +1 -1
  160. package/dist/src/rules/namespace.js +66 -35
  161. package/dist/src/rules/namespace.js.map +1 -1
  162. package/dist/src/rules/open.d.ts +2 -1
  163. package/dist/src/rules/open.d.ts.map +1 -1
  164. package/dist/src/rules/open.js +9 -8
  165. package/dist/src/rules/open.js.map +1 -1
  166. package/dist/src/rules/operation-inside-interface.d.ts +2 -1
  167. package/dist/src/rules/operation-inside-interface.d.ts.map +1 -1
  168. package/dist/src/rules/operation-inside-interface.js +9 -8
  169. package/dist/src/rules/operation-inside-interface.js.map +1 -1
  170. package/dist/src/rules/order-by.d.ts +3 -2
  171. package/dist/src/rules/order-by.d.ts.map +1 -1
  172. package/dist/src/rules/order-by.js +16 -16
  173. package/dist/src/rules/order-by.js.map +1 -1
  174. package/dist/src/rules/ownerless.d.ts +10 -0
  175. package/dist/src/rules/ownerless.d.ts.map +1 -0
  176. package/dist/src/rules/ownerless.js +155 -0
  177. package/dist/src/rules/ownerless.js.map +1 -0
  178. package/dist/src/rules/partial.d.ts +2 -1
  179. package/dist/src/rules/partial.d.ts.map +1 -1
  180. package/dist/src/rules/partial.js +9 -8
  181. package/dist/src/rules/partial.js.map +1 -1
  182. package/dist/src/rules/references.d.ts +2 -1
  183. package/dist/src/rules/references.d.ts.map +1 -1
  184. package/dist/src/rules/references.js +9 -8
  185. package/dist/src/rules/references.js.map +1 -1
  186. package/dist/src/rules/required-for-create.d.ts +2 -1
  187. package/dist/src/rules/required-for-create.d.ts.map +1 -1
  188. package/dist/src/rules/required-for-create.js +9 -8
  189. package/dist/src/rules/required-for-create.js.map +1 -1
  190. package/dist/src/rules/search.d.ts +2 -1
  191. package/dist/src/rules/search.d.ts.map +1 -1
  192. package/dist/src/rules/search.js +9 -8
  193. package/dist/src/rules/search.js.map +1 -1
  194. package/dist/src/rules/skip.d.ts +2 -1
  195. package/dist/src/rules/skip.d.ts.map +1 -1
  196. package/dist/src/rules/skip.js +9 -8
  197. package/dist/src/rules/skip.js.map +1 -1
  198. package/dist/src/rules/top.d.ts +2 -1
  199. package/dist/src/rules/top.d.ts.map +1 -1
  200. package/dist/src/rules/top.js +9 -8
  201. package/dist/src/rules/top.js.map +1 -1
  202. package/dist/src/testing/index.d.ts +1 -0
  203. package/dist/src/testing/index.d.ts.map +1 -1
  204. package/dist/src/testing/index.js +21 -0
  205. package/dist/src/testing/index.js.map +1 -1
  206. package/dist/src/utils.d.ts +4 -0
  207. package/dist/src/utils.d.ts.map +1 -1
  208. package/dist/src/utils.js +68 -20
  209. package/dist/src/utils.js.map +1 -1
  210. package/dist/src/{linter.d.ts → validate.d.ts} +1 -1
  211. package/dist/src/validate.d.ts.map +1 -0
  212. package/dist/src/validate.js +51 -0
  213. package/dist/src/validate.js.map +1 -0
  214. package/lib/decorators.tsp +35 -0
  215. package/package.json +5 -7
  216. package/dist/src/linter.d.ts.map +0 -1
  217. package/dist/src/linter.js +0 -44
  218. package/dist/src/linter.js.map +0 -1
package/dist/src/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getNamespaceFullName, isArrayModelType, } from "@typespec/compiler";
1
+ import { getLocationContext, getNamespaceFullName, isArrayModelType, } from "@typespec/compiler";
2
2
  import { getEntity, getGraphRoutePaths, getPublicNamespaceName, hasPublicNamespace, isEntity } from "./decorators/index.js";
3
3
  export function getNameForType(program, type) {
4
4
  switch (type.kind) {
@@ -139,31 +139,65 @@ export function getInterfacesOfKinds(program, navigationSources, kinds) {
139
139
  return;
140
140
  }
141
141
  const graphRoutePaths = getGraphRoutePaths(program, theInterface);
142
- if (!graphRoutePaths) {
143
- return;
144
- }
145
- if (!graphRoutePaths.length) {
142
+ if (!graphRoutePaths || !graphRoutePaths.length) {
146
143
  return;
147
144
  }
148
145
  graphRoutePaths.forEach((graphRoute) => {
149
- const path = removeRoutePathParams(graphRoute);
150
- if (!path) {
146
+ // skip two-segment resources as they are collections
147
+ if (isTwoSegmentResource(theInterface, graphRoute)) {
151
148
  return;
152
149
  }
153
- let operations = [...theInterface.operations.values()].map((operation) => ({ theOperation: operation, graphRoute: graphRoute }));
154
- if (interfaces.has(path)) {
155
- const existing = interfaces.get(path);
156
- operations = [...operations, ...existing.operations];
150
+ processGraphRoute(graphRoute, interfaces, theInterface);
151
+ });
152
+ });
153
+ return interfaces;
154
+ }
155
+ function isTwoSegmentResource(theInterface, graphRoute) {
156
+ const pathParts = graphRoute.split("/");
157
+ if (pathParts.length && pathParts.length === 2) {
158
+ const pattern = /\{[^}]*id[^}]*\}/i;
159
+ if (pattern.test(pathParts[1]) && theInterface.sourceInterfaces.some((s) => s.name === "Resource")) {
160
+ return true;
161
+ }
162
+ }
163
+ return false;
164
+ }
165
+ // Generate an interface for a resource that has a root path and an index like /users/{id}. Note that this is a collection.
166
+ // Resources with two-segment paths like /users/{id} are essentially collections
167
+ export function getTwoSegmentResourceInterface(program, navigationSources) {
168
+ const interfaces = new Map();
169
+ navigationSources.forEach((theInterface) => {
170
+ if (!theInterface.sourceInterfaces.some((s) => ["Resource"].includes(s.name))) {
171
+ return;
172
+ }
173
+ const graphRoutePaths = getGraphRoutePaths(program, theInterface);
174
+ if (!graphRoutePaths || !graphRoutePaths.length) {
175
+ return;
176
+ }
177
+ graphRoutePaths.forEach((graphRoute) => {
178
+ if (isTwoSegmentResource(theInterface, graphRoute)) {
179
+ processGraphRoute(graphRoute, interfaces, theInterface);
157
180
  }
158
- interfaces.set(path, {
159
- theInterface: theInterface,
160
- operations: operations,
161
- path: graphRoute
162
- });
163
181
  });
164
182
  });
165
183
  return interfaces;
166
184
  }
185
+ function processGraphRoute(graphRoute, interfaces, theInterface) {
186
+ const path = removeRoutePathParams(graphRoute);
187
+ if (!path) {
188
+ return;
189
+ }
190
+ let operations = [...theInterface.operations.values()].map((operation) => ({ theOperation: operation, graphRoute: graphRoute }));
191
+ if (interfaces.has(path)) {
192
+ const existing = interfaces.get(path);
193
+ operations = [...operations, ...existing.operations];
194
+ }
195
+ interfaces.set(path, {
196
+ theInterface: theInterface,
197
+ operations: operations,
198
+ path: graphRoute
199
+ });
200
+ }
167
201
  export function getPropertyTypeName(program, type) {
168
202
  var _a;
169
203
  if (type.kind === "Union") {
@@ -172,12 +206,15 @@ export function getPropertyTypeName(program, type) {
172
206
  if (!nonNullTypes.length) {
173
207
  return "undefined.";
174
208
  }
175
- return getPropertyTypeName(program, nonNullTypes[0]);
209
+ return removeReferencePrefixFromType(getPropertyTypeName(program, nonNullTypes[0]));
176
210
  }
177
211
  if ((type.kind === "Model" || type.kind === "Scalar") && ((_a = type.namespace) === null || _a === void 0 ? void 0 : _a.name) === "TypeSpec") {
178
- return getNameForType(program, type);
212
+ return removeReferencePrefixFromType(getNameForType(program, type));
179
213
  }
180
- return getIdForType(program, type);
214
+ return removeReferencePrefixFromType(getIdForType(program, type));
215
+ }
216
+ export function removeReferencePrefixFromType(typeName) {
217
+ return typeName.replace(/^reference\./, "");
181
218
  }
182
219
  export function isTypeNullable(program, type) {
183
220
  if (type.kind !== "Union") {
@@ -335,8 +372,19 @@ function findNavigationSource(theInterface) {
335
372
  * Examples:
336
373
  * - user/{id}/manager -> user/manager
337
374
  * - user/{id}/friends/{friendId}/hobbies -> user/friends/hobbies
375
+ * - user/{user-id}/friends/{friend-id}/hobbies -> user/friends/hobbies
338
376
  */
339
377
  function removeRoutePathParams(routePath) {
340
- return routePath.replace(/\/\{\w+\}/g, "");
378
+ return routePath.replace(/\/\{[\w-]+\}/g, "");
379
+ }
380
+ export function isSameNamespace(program, model, baseModel) {
381
+ if (!baseModel) {
382
+ return false;
383
+ }
384
+ return getNamespaceName(program, model) === getNamespaceName(program, baseModel);
385
+ }
386
+ export function isTypeDefinedInExternalLibrary(program, type) {
387
+ const locationContext = getLocationContext(program, type);
388
+ return locationContext.type === "library";
341
389
  }
342
390
  //# sourceMappingURL=utils.js.map
@@ -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,kBAAkB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAc5H,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,mBAAmB;YACtB,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QACzB,KAAK,QAAQ,CAAC;QACd,KAAK,QAAQ,CAAC;QACd,KAAK,SAAS;YACZ,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QACzB,KAAK,WAAW,CAAC;QACjB,KAAK,WAAW,CAAC;QACjB,KAAK,WAAW,CAAC;QACjB,KAAK,MAAM;YACT,OAAO,IAAI,CAAC,IAAI,CAAC;QACnB,KAAK,OAAO,CAAC;QACb,KAAK,QAAQ;YACX,OAAO,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC5C;YACE,OAAO,IAAI,CAAC,IAAI,CA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AA;AAC/C,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,OAAgB,EAAE,KAAY,EAAE,SAAiB;IAC/E,IAAG,CAAC,SAAS,EAAC;QACZ,OAAO,KAAK,CAAC;KACd;IACD,OAAO,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACnF,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,OAAgB,EAAE,IAAU;IACzE,MAAM,eAAe,GAAG,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC1D,OAAO,eAAe,CAAC,IAAI,KAAK,SAAS,CAAC;AAC5C,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import { Program } from "@typespec/compiler";
2
2
  export declare function $onValidate(program: Program): void;
3
- //# sourceMappingURL=linter.d.ts.map
3
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG7C,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,QAiD3C"}
@@ -0,0 +1,51 @@
1
+ import * as theRules from "./rules/index.js";
2
+ export function $onValidate(program) {
3
+ theRules.validateNamespaceIsRequired(program);
4
+ theRules.validatePublicNamespaceName(program);
5
+ theRules.validateTopLevelNamespaceMustHavePublicNamespace(program);
6
+ theRules.validateAbstractOnlyAppliesToStructuredTypes(program);
7
+ theRules.validateAllowedValuesCannotBeEmpty(program);
8
+ theRules.validateAlternateKeyOnKey(program);
9
+ theRules.validateAlternateKeyOnPrimitiveProperty(program);
10
+ theRules.validateAlternateKeyRequiresKey(program);
11
+ theRules.validateKeyOnlyOnEntityNonNullablePrimitiveProperty(program);
12
+ theRules.validateComputedCannotBeCombined(program);
13
+ theRules.validatecontainsOnlyAppliesToNavigationProperty(program);
14
+ theRules.validateCountAppliesToGetOperationsThatReturnCollections(program);
15
+ theRules.validateDisallowedTypeSpecDecorators(program);
16
+ theRules.validateCollectionValuedNavigationPropertiesCannotBeNullable(program);
17
+ theRules.validateRequiredRequestParameters(program);
18
+ theRules.validateEntityMustHaveKey(program);
19
+ theRules.validateExpandOnlyOnGetNavigationSource(program);
20
+ theRules.validateExpandOnlyNavigationProperties(program);
21
+ theRules.validateExtendsOnSameType(program);
22
+ theRules.validateFilterAppliesToGetOperationsThatReturnCollections(program);
23
+ theRules.validateFilterOnlyAppliesToModelProperties(program);
24
+ theRules.validateFilterPropertiesMustNotBeEmpty(program);
25
+ theRules.validateHasStreamOnlyOnEntity(program);
26
+ theRules.validateOpenOnlyAppliesToStructuredType(program);
27
+ theRules.validateOperationInsideInterface(program);
28
+ theRules.validateOrderByAppliesToGetOperationsThatReturnCollections(program);
29
+ theRules.validateOrderByOnlyNonNavigationProperties(program);
30
+ theRules.validateReferencesOnlyAppliesToNavigationProperty(program);
31
+ theRules.validateSearchAppliesToGetOperationsThatReturnCollections(program);
32
+ theRules.validateSkipAppliesToGetOperationsThatReturnCollections(program);
33
+ theRules.validateTopAppliesToGetOperationsThatReturnCollections(program);
34
+ theRules.validateVoidFunction(program);
35
+ theRules.validateGraphRouteLeadingSlash(program);
36
+ theRules.validateOperationParametersMatchGraphRouteParameters(program);
37
+ theRules.validateExtendedModelBaseShouldMatchPartialBaseModel(program);
38
+ theRules.validateGraphDeprecatedMustBeAccompaniedByDefinition(program);
39
+ theRules.validateGraphDeprecatedValueMustBeDefinedInDeprecatedDefinition(program);
40
+ theRules.validateExtendOnlyAppliesOnDifferentNamespaces(program);
41
+ theRules.validateOwnerlessMustOnlyBeAppliedToInterfacesWithSingleSegmentGraphRoute(program);
42
+ theRules.validateOwnerlessEntityModelReferencedMustOnlyHaveNavigationPropertiesRule(program);
43
+ theRules.validateOwnerlessInterfaceMustNotHaveAnyOperations(program);
44
+ theRules.validateOwnerlessDecoratorCannotBeUsedWithIsOwner(program);
45
+ theRules.validateEntityTypeInOwnerlessExtendsClauseCannotBeUsedInOtherInterfaces(program);
46
+ theRules.validatePropertyTypeOfEntityTypeMustHaveContainsOrReferences(program);
47
+ theRules.validateGlobalOperationMustBeUsedWithNonRoutedInterface(program);
48
+ theRules.validateGlobalOperationMustBeUsedWithProjectBindingType(program);
49
+ theRules.validateGraphRouteAndInterfaceExtendsMatchForCollections(program);
50
+ }
51
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/validate.ts"],"names":[],"mappings":"AACA,OAAQ,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE9C,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,QAAQ,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAC9C,QAAQ,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAC9C,QAAQ,CAAC,gDAAgD,CAAC,OAAO,CAAC,CAAC;IACnE,QAAQ,CAAC,4CAA4C,CAAC,OAAO,CAAC,CAAC;IAC/D,QAAQ,CAAC,kCAAkC,CAAC,OAAO,CAAC,CAAC;IACrD,QAAQ,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAC5C,QAAQ,CAAC,uCAAuC,CAAC,OAAO,CAAC,CAAC;IAC1D,QAAQ,CAAC,+BAA+B,CAAC,OAAO,CAAC,CAAC;IAClD,QAAQ,CAAC,mDAAmD,CAAC,OAAO,CAAC,CAAC;IACtE,QAAQ,CAAC,gCAAgC,CAAC,OAAO,CAAC,CAAC;IACnD,QAAQ,CAAC,+CAA+C,CAAC,OAAO,CAAC,CAAC;IAClE,QAAQ,CAAC,wDAAwD,CAAC,OAAO,CAAC,CAAC;IAC3E,QAAQ,CAAC,oCAAoC,CAAC,OAAO,CAAC,CAAC;IACvD,QAAQ,CAAC,4DAA4D,CAAC,OAAO,CAAC,CAAC;IAC/E,QAAQ,CAAC,iCAAiC,CAAC,OAAO,CAAC,CA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,CAAC,OAAO,CAAC,CAAC;IAC5F,QAAQ,CAAC,0EAA0E,CAAC,OAAO,CAAC,CAAC;IAC7F,QAAQ,CAAC,kDAAkD,CAAC,OAAO,CAAC,CAAC;IACrE,QAAQ,CAAC,iDAAiD,CAAC,OAAO,CAAC,CAAC;IACpE,QAAQ,CAAC,uEAAuE,CAAC,OAAO,CAAC,CAAC;IAC1F,QAAQ,CAAC,4DAA4D,CAAC,OAAO,CAAC,CAAC;IAC/E,QAAQ,CAAC,uDAAuD,CAAC,OAAO,CAAC,CAAC;IAC1E,QAAQ,CAAC,uDAAuD,CAAC,OAAO,CAAC,CAAC;IAC1E,QAAQ,CAAC,wDAAwD,CAAC,OAAO,CAAC,CAAC;AAE7E,CAAC"}
@@ -81,6 +81,13 @@ extern dec count(target: Operation);
81
81
  */
82
82
  extern dec deltaCollection(target: Model);
83
83
 
84
+ /**
85
+ * `@graphDeprecated` - mark an entity as graphDeprecated.
86
+ *
87
+ * `@graphDeprecated` can be applied to Model, ModelProperty, Enum, EnumMember, Operation, Namespace, Interface.
88
+ */
89
+ extern dec graphDeprecated(target: Model | ModelProperty | Enum | EnumMember | Operation | Namespace | Interface, name: valueof string);
90
+
84
91
  /**
85
92
  * `@deprecatedDefinition` - Allow us create a reusable deprecation definition.
86
93
  * `@deprecatedDefinition` - Applies only to namespaces.
@@ -110,6 +117,13 @@ extern dec entity(target: Model);
110
117
  */
111
118
  extern dec expand(target: Operation, property: valueof string, ...otherProperties: valueof string[]);
112
119
 
120
+ /**
121
+ * `@experimental` - mark the entity as experimental
122
+ *
123
+ * `@experimental` can be applied to Model, ModelProperty, Enum, EnumMember, Operation, Namespace, Interface.
124
+ */
125
+ extern dec experimental(target: Model | ModelProperty | Enum | EnumMember | Operation | Namespace | Interface);
126
+
113
127
  /**
114
128
  * `@filter` - Applies to: get operations that return collections of @entity or @complex models.
115
129
  * Indicates that the get operation supports OData $filter query parameter.
@@ -134,6 +148,14 @@ extern dec flags(target: Enum);
134
148
  */
135
149
  extern dec function(target: Operation, name?: valueof string);
136
150
 
151
+ /**
152
+ * `@globalOperation` - mark an operation as a globalOperation
153
+ *
154
+ * `@globalOperation` can only be applied to operations.
155
+ */
156
+ extern dec globalOperation(target: Operation);
157
+
158
+
137
159
  /**
138
160
  * `@graphRoute` - mark an interface or operation with an HTTP route.
139
161
  *
@@ -158,6 +180,13 @@ extern dec hasStream(target: Model, ...mediaTypes: valueof string[]);
158
180
  */
159
181
  extern dec immutable(target: ModelProperty);
160
182
 
183
+ /**
184
+ * `@ownerless` - mark an interface as ownerless.
185
+ *
186
+ * `@ownerless` can only be applied to interfaces.
187
+ */
188
+ extern dec ownerless(target: Interface);
189
+
161
190
  /**
162
191
  * `@open` - mark a model type as open
163
192
  *
@@ -266,6 +295,12 @@ extern dec search(target: Operation);
266
295
  */
267
296
  extern dec skip(target: Operation);
268
297
 
298
+ /**
299
+ * `@term` - Applies to: namespaces.
300
+ * Indicates that a workload wishes to require or return instance annotations in their request / response packets at runtime.
301
+ */
302
+ extern dec term(target: Namespace, name: valueof string, type: Scalar, description: valueof string);
303
+
269
304
  /**
270
305
  * `@top` - Applies to: get operations that return collections.
271
306
  * Indicates that the get operation supports the OData $top query parameter.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/typespec-msgraph",
3
- "version": "0.0.1-Preview.11",
3
+ "version": "0.0.1-Preview.13",
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",
@@ -53,10 +53,9 @@
53
53
  ],
54
54
  "dependencies": {
55
55
  "@xmldom/xmldom": "~0.8.4",
56
- "@typespec/compiler": "~0.49.0",
57
- "@typespec/http": "~0.49.0",
58
- "@typespec/lint": "~0.49.0",
59
- "prettier": "~2.8.7",
56
+ "@typespec/compiler": "~0.51.0",
57
+ "@typespec/http": "~0.51.0",
58
+ "prettier": "~3.1.1",
60
59
  "react-dom": "~18.2.0",
61
60
  "react": "~18.2.0",
62
61
  "react-reconciler": "~0.27.0"
@@ -64,10 +63,9 @@
64
63
  "devDependencies": {
65
64
  "@types/mocha": "~10.0.1",
66
65
  "@types/node": "~18.11.9",
67
- "@types/prettier": "2.6.0",
68
66
  "@types/react": "~18.0.5",
69
67
  "@types/react-reconciler": "~0.28.0",
70
- "@typespec/eslint-config-typespec": "~0.49.0",
68
+ "@typespec/eslint-config-typespec": "~0.51.0",
71
69
  "c8": "~8.0.1",
72
70
  "eslint": "^8.49.0",
73
71
  "mocha": "~10.2.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AA4C7C,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,QAM3C"}
@@ -1,44 +0,0 @@
1
- import { getLinter } from "@typespec/lint";
2
- import { $lib } from "./lib.js";
3
- import * as theRules from "./rules/index.js";
4
- const linter = getLinter($lib);
5
- linter.registerRules([
6
- theRules.alternateKeyOnKeyRule,
7
- theRules.alternateKeyOnPrimitivePropertyRule,
8
- theRules.alternateKeyRequiresKeyRule,
9
- theRules.computedCannotBeCombinedWithRule,
10
- theRules.containsOnlyAppliesToNavigationPropertyRule,
11
- theRules.countAppliesToGetOperationsThatReturnCollectionsRule,
12
- theRules.disallowedTypeSpecDecoratorsRule,
13
- theRules.entityMustHaveKeyRule,
14
- theRules.expandOnlyNavigationPropertiesRule,
15
- theRules.expandOnlyOnGetNavigationSourceRule,
16
- theRules.extendsOnSameTypeRule,
17
- theRules.filterAppliesToGetOperationsThatReturnCollectionsRule,
18
- theRules.filterOnlyAppliesToModelPropertiesRule,
19
- theRules.filterPropertiesMustNotBeEmptyRule,
20
- theRules.hasStreamOnlyOnEntity,
21
- theRules.invalidPublicNamespaceNameRule,
22
- theRules.keyOnlyOnEntityNonNullablePrimitivePropertyRule,
23
- theRules.namespaceIsRequiredRule,
24
- theRules.openOnlyAppliesToStructuredType,
25
- theRules.operationInsideInterfaceRule,
26
- theRules.operationParametersMatchGraphRouteParametersRule,
27
- theRules.orderByOnlyNonNavigationPropertiesRule,
28
- theRules.orderByAppliesToGetOperationsThatReturnCollectionsRule,
29
- theRules.referencesOnlyAppliesToNavigationPropertyRule,
30
- theRules.searchAppliesToGetOperationsThatReturnCollectionsRule,
31
- theRules.skipAppliesToGetOperationsThatReturnCollectionsRule,
32
- theRules.topAppliesToGetOperationsThatReturnCollectionsRule,
33
- theRules.useEvolvableEnumRule,
34
- theRules.voidFunctionRule,
35
- theRules.allowedValuesCannotBeEmptyRule,
36
- theRules.graphRouteLeadingSlashRule,
37
- theRules.extendedModelBaseShouldMatchPartialBaseModel,
38
- ], { autoEnable: true });
39
- export function $onValidate(program) {
40
- linter.autoEnableRules();
41
- linter.lintOnValidate(program);
42
- theRules.validateAbstractOnlyAppliesToStructuredTypes(program);
43
- }
44
- //# sourceMappingURL=linter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"linter.js","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAQ,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE9C,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAC/B,MAAM,CAAC,aAAa,CAClB;IACE,QAAQ,CAAC,qBAAqB;IAC9B,QAAQ,CAAC,mCAAmC;IAC5C,QAAQ,CAAC,2BAA2B;IACpC,QAAQ,CAAC,gCAAgC;IACzC,QAAQ,CAAC,2CAA2C;IACpD,QAAQ,CAAC,oDAAoD;IAC7D,QAAQ,CAAC,gCAAgC;IACzC,QAAQ,CAAC,qBAAqB;IAC9B,QAAQ,CAAC,kC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