@microsoft/typespec-msgraph 0.0.1-Preview.12 → 0.0.1-Preview.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/dist/src/components/annotations.d.ts.map +1 -1
  2. package/dist/src/components/annotations.js +24 -3
  3. package/dist/src/components/annotations.js.map +1 -1
  4. package/dist/src/components/entity-container-element.d.ts.map +1 -1
  5. package/dist/src/components/entity-container-element.js +13 -6
  6. package/dist/src/components/entity-container-element.js.map +1 -1
  7. package/dist/src/components/operation-element.d.ts.map +1 -1
  8. package/dist/src/components/operation-element.js +15 -4
  9. package/dist/src/components/operation-element.js.map +1 -1
  10. package/dist/src/components/property-element.js +1 -1
  11. package/dist/src/components/property-element.js.map +1 -1
  12. package/dist/src/components/reference-target-element.d.ts +9 -0
  13. package/dist/src/components/reference-target-element.d.ts.map +1 -0
  14. package/dist/src/components/reference-target-element.js +3 -0
  15. package/dist/src/components/reference-target-element.js.map +1 -0
  16. package/dist/src/components/revisions-annotation.d.ts.map +1 -1
  17. package/dist/src/components/revisions-annotation.js +2 -1
  18. package/dist/src/components/revisions-annotation.js.map +1 -1
  19. package/dist/src/components/schema-element.d.ts.map +1 -1
  20. package/dist/src/components/schema-element.js +5 -3
  21. package/dist/src/components/schema-element.js.map +1 -1
  22. package/dist/src/components/select-supported-annotation.d.ts +5 -0
  23. package/dist/src/components/select-supported-annotation.d.ts.map +1 -0
  24. package/dist/src/components/select-supported-annotation.js +6 -0
  25. package/dist/src/components/select-supported-annotation.js.map +1 -0
  26. package/dist/src/components/term-element.d.ts +9 -0
  27. package/dist/src/components/term-element.d.ts.map +1 -0
  28. package/dist/src/components/term-element.js +8 -0
  29. package/dist/src/components/term-element.js.map +1 -0
  30. package/dist/src/decorators/address-url.d.ts +16 -0
  31. package/dist/src/decorators/address-url.d.ts.map +1 -0
  32. package/dist/src/decorators/address-url.js +19 -0
  33. package/dist/src/decorators/address-url.js.map +1 -0
  34. package/dist/src/decorators/ags-attribute.d.ts +2 -1
  35. package/dist/src/decorators/ags-attribute.d.ts.map +1 -1
  36. package/dist/src/decorators/ags-attribute.js +34 -1
  37. package/dist/src/decorators/ags-attribute.js.map +1 -1
  38. package/dist/src/decorators/global-operation.d.ts +9 -0
  39. package/dist/src/decorators/global-operation.d.ts.map +1 -0
  40. package/dist/src/decorators/global-operation.js +13 -0
  41. package/dist/src/decorators/global-operation.js.map +1 -0
  42. package/dist/src/decorators/graph-deprecated.d.ts +11 -0
  43. package/dist/src/decorators/graph-deprecated.d.ts.map +1 -0
  44. package/dist/src/decorators/graph-deprecated.js +19 -0
  45. package/dist/src/decorators/graph-deprecated.js.map +1 -0
  46. package/dist/src/decorators/index.d.ts +7 -0
  47. package/dist/src/decorators/index.d.ts.map +1 -1
  48. package/dist/src/decorators/index.js +7 -0
  49. package/dist/src/decorators/index.js.map +1 -1
  50. package/dist/src/decorators/is-owner.js +1 -1
  51. package/dist/src/decorators/ownerless.d.ts +8 -0
  52. package/dist/src/decorators/ownerless.d.ts.map +1 -0
  53. package/dist/src/decorators/ownerless.js +12 -0
  54. package/dist/src/decorators/ownerless.js.map +1 -0
  55. package/dist/src/decorators/public-namespace.d.ts.map +1 -1
  56. package/dist/src/decorators/public-namespace.js +4 -1
  57. package/dist/src/decorators/public-namespace.js.map +1 -1
  58. package/dist/src/decorators/reference-target.d.ts +16 -0
  59. package/dist/src/decorators/reference-target.d.ts.map +1 -0
  60. package/dist/src/decorators/reference-target.js +52 -0
  61. package/dist/src/decorators/reference-target.js.map +1 -0
  62. package/dist/src/decorators/select.d.ts +9 -0
  63. package/dist/src/decorators/select.d.ts.map +1 -0
  64. package/dist/src/decorators/select.js +13 -0
  65. package/dist/src/decorators/select.js.map +1 -0
  66. package/dist/src/decorators/term.d.ts +13 -0
  67. package/dist/src/decorators/term.d.ts.map +1 -0
  68. package/dist/src/decorators/term.js +14 -0
  69. package/dist/src/decorators/term.js.map +1 -0
  70. package/dist/src/entities/address-url.d.ts +4 -0
  71. package/dist/src/entities/address-url.d.ts.map +1 -0
  72. package/dist/src/entities/address-url.js +18 -0
  73. package/dist/src/entities/address-url.js.map +1 -0
  74. package/dist/src/entities/annotations.d.ts +6 -0
  75. package/dist/src/entities/annotations.d.ts.map +1 -1
  76. package/dist/src/entities/annotations.js +25 -1
  77. package/dist/src/entities/annotations.js.map +1 -1
  78. package/dist/src/entities/entity-container.d.ts +10 -0
  79. package/dist/src/entities/entity-container.d.ts.map +1 -1
  80. package/dist/src/entities/entity-container.js +3 -0
  81. package/dist/src/entities/entity-container.js.map +1 -1
  82. package/dist/src/entities/enum.js.map +1 -1
  83. package/dist/src/entities/model.d.ts +2 -0
  84. package/dist/src/entities/model.d.ts.map +1 -1
  85. package/dist/src/entities/model.js +66 -5
  86. package/dist/src/entities/model.js.map +1 -1
  87. package/dist/src/entities/ms-graph-route.d.ts +13 -0
  88. package/dist/src/entities/ms-graph-route.d.ts.map +1 -0
  89. package/dist/src/entities/ms-graph-route.js +70 -0
  90. package/dist/src/entities/ms-graph-route.js.map +1 -0
  91. package/dist/src/entities/namespace.d.ts +6 -1
  92. package/dist/src/entities/namespace.d.ts.map +1 -1
  93. package/dist/src/entities/namespace.js +107 -11
  94. package/dist/src/entities/namespace.js.map +1 -1
  95. package/dist/src/entities/operation.d.ts +4 -0
  96. package/dist/src/entities/operation.d.ts.map +1 -1
  97. package/dist/src/entities/operation.js +28 -8
  98. package/dist/src/entities/operation.js.map +1 -1
  99. package/dist/src/entities/revision-definition.d.ts +1 -0
  100. package/dist/src/entities/revision-definition.d.ts.map +1 -1
  101. package/dist/src/entities/revision-definition.js +3 -3
  102. package/dist/src/entities/revision-definition.js.map +1 -1
  103. package/dist/src/entities/term.d.ts +8 -0
  104. package/dist/src/entities/term.d.ts.map +1 -0
  105. package/dist/src/entities/term.js +14 -0
  106. package/dist/src/entities/term.js.map +1 -0
  107. package/dist/src/index.d.ts +1 -1
  108. package/dist/src/index.d.ts.map +1 -1
  109. package/dist/src/index.js +1 -1
  110. package/dist/src/index.js.map +1 -1
  111. package/dist/src/lib.d.ts +69 -146
  112. package/dist/src/lib.d.ts.map +1 -1
  113. package/dist/src/lib.js +24 -10
  114. package/dist/src/lib.js.map +1 -1
  115. package/dist/src/rules/address-url.d.ts +6 -0
  116. package/dist/src/rules/address-url.d.ts.map +1 -0
  117. package/dist/src/rules/address-url.js +40 -0
  118. package/dist/src/rules/address-url.js.map +1 -0
  119. package/dist/src/rules/allowed-values.d.ts +2 -1
  120. package/dist/src/rules/allowed-values.d.ts.map +1 -1
  121. package/dist/src/rules/allowed-values.js +7 -7
  122. package/dist/src/rules/allowed-values.js.map +1 -1
  123. package/dist/src/rules/alternate-key.d.ts +4 -3
  124. package/dist/src/rules/alternate-key.d.ts.map +1 -1
  125. package/dist/src/rules/alternate-key.js +23 -23
  126. package/dist/src/rules/alternate-key.js.map +1 -1
  127. package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts +2 -1
  128. package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts.map +1 -1
  129. package/dist/src/rules/collection-navigation-properties-not-nullable.js +9 -9
  130. package/dist/src/rules/collection-navigation-properties-not-nullable.js.map +1 -1
  131. package/dist/src/rules/computed.d.ts +2 -1
  132. package/dist/src/rules/computed.d.ts.map +1 -1
  133. package/dist/src/rules/computed.js +9 -8
  134. package/dist/src/rules/computed.js.map +1 -1
  135. package/dist/src/rules/contains.d.ts +2 -1
  136. package/dist/src/rules/contains.d.ts.map +1 -1
  137. package/dist/src/rules/contains.js +9 -8
  138. package/dist/src/rules/contains.js.map +1 -1
  139. package/dist/src/rules/count.d.ts +2 -1
  140. package/dist/src/rules/count.d.ts.map +1 -1
  141. package/dist/src/rules/count.js +9 -8
  142. package/dist/src/rules/count.js.map +1 -1
  143. package/dist/src/rules/disallowed-typespec-decorators.d.ts +2 -1
  144. package/dist/src/rules/disallowed-typespec-decorators.d.ts.map +1 -1
  145. package/dist/src/rules/disallowed-typespec-decorators.js +29 -25
  146. package/dist/src/rules/disallowed-typespec-decorators.js.map +1 -1
  147. package/dist/src/rules/entity.d.ts +5 -2
  148. package/dist/src/rules/entity.d.ts.map +1 -1
  149. package/dist/src/rules/entity.js +102 -19
  150. package/dist/src/rules/entity.js.map +1 -1
  151. package/dist/src/rules/enum.d.ts +3 -1
  152. package/dist/src/rules/enum.d.ts.map +1 -1
  153. package/dist/src/rules/enum.js +9 -6
  154. package/dist/src/rules/enum.js.map +1 -1
  155. package/dist/src/rules/expand.d.ts +3 -2
  156. package/dist/src/rules/expand.d.ts.map +1 -1
  157. package/dist/src/rules/expand.js +16 -16
  158. package/dist/src/rules/expand.js.map +1 -1
  159. package/dist/src/rules/extends-on-same-type.d.ts +2 -1
  160. package/dist/src/rules/extends-on-same-type.d.ts.map +1 -1
  161. package/dist/src/rules/extends-on-same-type.js +9 -8
  162. package/dist/src/rules/extends-on-same-type.js.map +1 -1
  163. package/dist/src/rules/filter.d.ts +4 -3
  164. package/dist/src/rules/filter.d.ts.map +1 -1
  165. package/dist/src/rules/filter.js +23 -23
  166. package/dist/src/rules/filter.js.map +1 -1
  167. package/dist/src/rules/function.d.ts +2 -1
  168. package/dist/src/rules/function.d.ts.map +1 -1
  169. package/dist/src/rules/function.js +9 -9
  170. package/dist/src/rules/function.js.map +1 -1
  171. package/dist/src/rules/global-operation.d.ts +4 -0
  172. package/dist/src/rules/global-operation.d.ts.map +1 -0
  173. package/dist/src/rules/global-operation.js +60 -0
  174. package/dist/src/rules/global-operation.js.map +1 -0
  175. package/dist/src/rules/graph-deprecated.d.ts +8 -0
  176. package/dist/src/rules/graph-deprecated.d.ts.map +1 -0
  177. package/dist/src/rules/graph-deprecated.js +152 -0
  178. package/dist/src/rules/graph-deprecated.js.map +1 -0
  179. package/dist/src/rules/graph-route.d.ts +8 -2
  180. package/dist/src/rules/graph-route.d.ts.map +1 -1
  181. package/dist/src/rules/graph-route.js +80 -16
  182. package/dist/src/rules/graph-route.js.map +1 -1
  183. package/dist/src/rules/has-stream.d.ts +2 -1
  184. package/dist/src/rules/has-stream.d.ts.map +1 -1
  185. package/dist/src/rules/has-stream.js +9 -8
  186. package/dist/src/rules/has-stream.js.map +1 -1
  187. package/dist/src/rules/index.d.ts +5 -0
  188. package/dist/src/rules/index.d.ts.map +1 -1
  189. package/dist/src/rules/index.js +5 -0
  190. package/dist/src/rules/index.js.map +1 -1
  191. package/dist/src/rules/namespace.d.ts +4 -3
  192. package/dist/src/rules/namespace.d.ts.map +1 -1
  193. package/dist/src/rules/namespace.js +58 -73
  194. package/dist/src/rules/namespace.js.map +1 -1
  195. package/dist/src/rules/open.d.ts +2 -1
  196. package/dist/src/rules/open.d.ts.map +1 -1
  197. package/dist/src/rules/open.js +9 -8
  198. package/dist/src/rules/open.js.map +1 -1
  199. package/dist/src/rules/operation-inside-interface.d.ts +2 -1
  200. package/dist/src/rules/operation-inside-interface.d.ts.map +1 -1
  201. package/dist/src/rules/operation-inside-interface.js +9 -8
  202. package/dist/src/rules/operation-inside-interface.js.map +1 -1
  203. package/dist/src/rules/order-by.d.ts +3 -2
  204. package/dist/src/rules/order-by.d.ts.map +1 -1
  205. package/dist/src/rules/order-by.js +16 -16
  206. package/dist/src/rules/order-by.js.map +1 -1
  207. package/dist/src/rules/ownerless.d.ts +10 -0
  208. package/dist/src/rules/ownerless.d.ts.map +1 -0
  209. package/dist/src/rules/ownerless.js +155 -0
  210. package/dist/src/rules/ownerless.js.map +1 -0
  211. package/dist/src/rules/partial.d.ts +2 -1
  212. package/dist/src/rules/partial.d.ts.map +1 -1
  213. package/dist/src/rules/partial.js +9 -8
  214. package/dist/src/rules/partial.js.map +1 -1
  215. package/dist/src/rules/reference-target.d.ts +8 -0
  216. package/dist/src/rules/reference-target.d.ts.map +1 -0
  217. package/dist/src/rules/reference-target.js +119 -0
  218. package/dist/src/rules/reference-target.js.map +1 -0
  219. package/dist/src/rules/references.d.ts +2 -1
  220. package/dist/src/rules/references.d.ts.map +1 -1
  221. package/dist/src/rules/references.js +9 -8
  222. package/dist/src/rules/references.js.map +1 -1
  223. package/dist/src/rules/required-for-create.d.ts +2 -1
  224. package/dist/src/rules/required-for-create.d.ts.map +1 -1
  225. package/dist/src/rules/required-for-create.js +9 -8
  226. package/dist/src/rules/required-for-create.js.map +1 -1
  227. package/dist/src/rules/search.d.ts +2 -1
  228. package/dist/src/rules/search.d.ts.map +1 -1
  229. package/dist/src/rules/search.js +9 -8
  230. package/dist/src/rules/search.js.map +1 -1
  231. package/dist/src/rules/skip.d.ts +2 -1
  232. package/dist/src/rules/skip.d.ts.map +1 -1
  233. package/dist/src/rules/skip.js +9 -8
  234. package/dist/src/rules/skip.js.map +1 -1
  235. package/dist/src/rules/top.d.ts +2 -1
  236. package/dist/src/rules/top.d.ts.map +1 -1
  237. package/dist/src/rules/top.js +9 -8
  238. package/dist/src/rules/top.js.map +1 -1
  239. package/dist/src/testing/index.d.ts +1 -0
  240. package/dist/src/testing/index.d.ts.map +1 -1
  241. package/dist/src/testing/index.js +21 -0
  242. package/dist/src/testing/index.js.map +1 -1
  243. package/dist/src/utils.d.ts +19 -1
  244. package/dist/src/utils.d.ts.map +1 -1
  245. package/dist/src/utils.js +44 -21
  246. package/dist/src/utils.js.map +1 -1
  247. package/dist/src/{linter.d.ts → validate.d.ts} +1 -1
  248. package/dist/src/validate.d.ts.map +1 -0
  249. package/dist/src/validate.js +56 -0
  250. package/dist/src/validate.js.map +1 -0
  251. package/lib/decorators.tsp +114 -17
  252. package/lib/porcelain.tsp +18 -7
  253. package/lib/responses.tsp +32 -7
  254. package/lib/shared-models.tsp +0 -50
  255. package/package.json +5 -7
  256. package/dist/src/linter.d.ts.map +0 -1
  257. package/dist/src/linter.js +0 -44
  258. package/dist/src/linter.js.map +0 -1
@@ -1,15 +1,15 @@
1
- import { createRule } from "@typespec/lint";
1
+ import { navigateTypesInNamespace } from "@typespec/compiler";
2
2
  import { getOperationVerb } from "@typespec/http";
3
3
  import { isTop } from "../index.js";
4
4
  import { isTypeCollection } from "../utils.js";
5
5
  import { reportDiagnostic } from "../lib.js";
6
+ import { GetDeclaredNamespaces } from "../entities/namespace.js";
6
7
  /**
7
8
  * @top applies to get operations that return collections.
8
9
  */
9
- export const topAppliesToGetOperationsThatReturnCollectionsRule = createRule({
10
- name: "top-applies-to-get-operations-that-return-collections",
11
- create({ program }) {
12
- return {
10
+ export function validateTopAppliesToGetOperationsThatReturnCollections(program) {
11
+ for (const namespace of GetDeclaredNamespaces(program)) {
12
+ navigateTypesInNamespace(namespace, {
13
13
  operation: (operation) => {
14
14
  if (!isTop(program, operation)) {
15
15
  return;
@@ -31,7 +31,8 @@ export const topAppliesToGetOperationsThatReturnCollectionsRule = createRule({
31
31
  },
32
32
  });
33
33
  },
34
- };
35
- },
36
- });
34
+ });
35
+ }
36
+ }
37
+ ;
37
38
  //# sourceMappingURL=top.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"top.js","sourceRoot":"","sources":["../../../src/rules/top.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,kDAAkD,GAAG,UAAU,CAAC;IAC3E,IAAI,EAAE,uDAAuD;IAC7D,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;gBACvB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;oBAC9B,OAAO;iBACR;gBAED,IAAI,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,KAAK,EAAE;oBAClD,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;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I,YAAY,EAAE;wBAChB,OAAO;qBACR;iBACF;gBAED,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,uBAAuB;oBAC7B,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,WAAW;oBACtB,MAAM,EAAE;wBACN,SAAS,EAAE,MAAM;wBACjB,MAAM,EAAE,yCAAyC;qBAClD;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC,CAAC;KACJ;AACH,CAAC;AAAA,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import { TypeSpecTestLibrary } from "@typespec/compiler/testing";
2
2
  export declare const MsGraphTestLibrary: TypeSpecTestLibrary;
3
+ export declare const ReferenceModelTestLibrary: TypeSpecTestLibrary;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/testing/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGjE,eAAO,MAAM,kBAAkB,EAAE,mBAoBhC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/testing/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGjE,eAAO,MAAM,kBAAkB,EAAE,mBAoBhC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,mBAoBvC,CAAA"}
@@ -21,4 +21,25 @@ export const MsGraphTestLibrary = {
21
21
  },
22
22
  ],
23
23
  };
24
+ export const ReferenceModelTestLibrary = {
25
+ name: "@microsoft/typespec-msgraph-reference-prod-beta",
26
+ packageRoot: resolvePath(fileURLToPath(import.meta.url), "../../../../../typespec-msgraph-reference-prod-beta/"),
27
+ files: [
28
+ {
29
+ realDir: "",
30
+ pattern: "package.json",
31
+ virtualPath: "./node_modules/@microsoft/typespec-msgraph-reference-prod-beta",
32
+ },
33
+ {
34
+ realDir: "dist/",
35
+ pattern: "*.js",
36
+ virtualPath: "./node_modules/@microsoft/typespec-msgraph-reference-prod-beta/dist/",
37
+ },
38
+ {
39
+ realDir: "lib",
40
+ pattern: "*.tsp",
41
+ virtualPath: "./node_modules/@microsoft/typespec-msgraph-reference-prod-beta/lib",
42
+ },
43
+ ],
44
+ };
24
45
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,CAAC,MAAM,kBAAkB,GAAwB;IACrD,IAAI,EAAE,6BAA6B;IACnC,WAAW,EAAE,WAAW,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,cAAc,CAAC;IACxE,KAAK,EAAE;QACL;YACE,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,cAAc;YACvB,WAAW,EAAE,4CAA4C;SAC1D;QACD;YACE,OAAO,EAAE,UAAU;YACnB,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,qDAAqD;SACnE;QACD;YACE,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,gDAAgD;SAC9D;KACF;CACF,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,CAAC,MAAM,kBAAkB,GAAwB;IACrD,IAAI,EAAE,6BAA6B;IACnC,WAAW,EAAE,WAAW,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,cAAc,CAAC;IACxE,KAAK,EAAE;QACL;YACE,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,cAAc;YACvB,WAAW,EAAE,4CAA4C;SAC1D;QACD;YACE,OAAO,EAAE,UAAU;YACnB,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,qDAAqD;SACnE;QACD;YACE,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,gDAAgD;SAC9D;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAwB;IAC5D,IAAI,EAAE,iDAAiD;IACvD,WAAW,EAAE,WAAW,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,sDAAsD,CAAC;IAChH,KAAK,EAAE;QACL;YACE,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,cAAc;YACvB,WAAW,EAAE,gEAAgE;SAC9E;QACD;YACE,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,sEAAsE;SACpF;QACD;YACE,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,oEAAoE;SAClF;KACF;CACF,CAAA"}
@@ -14,8 +14,9 @@ export declare function getCSDLPrimitiveType(typespecType: string): string;
14
14
  export declare function getIdForType(program: Program, type: Type): string;
15
15
  export declare function getNavigationTypeId(program: Program, getOperation: Operation): string;
16
16
  export declare function getInterfacesOfKinds(program: Program, navigationSources: Map<string, Interface>, kinds: string[]): Map<string, MsGraphInterface>;
17
- export declare function getTwoSegmentResourceInterface(program: Program, navigationSources: Map<string, Interface>): Map<string, MsGraphInterface>;
17
+ export declare function getCollectionIndexInterfaces(program: Program, navigationSources: Map<string, Interface>): Map<string, MsGraphInterface>;
18
18
  export declare function getPropertyTypeName(program: Program, type: Type): string;
19
+ export declare function removeReferencePrefixFromType(typeName: string): string;
19
20
  export declare function isTypeNullable(program: Program, type: Type): boolean;
20
21
  export declare function extractTypesFromUnion(type: Union): Type[];
21
22
  export declare function getSingletonTypeId(program: Program, singletonType: string | null, getOperation: Operation | undefined): string | undefined;
@@ -47,4 +48,21 @@ export declare function isNavigationSource(theInterface: Interface): boolean;
47
48
  export declare function isTopLevelNavigationSource(program: Program, theInterface: MsGraphInterface): boolean;
48
49
  export declare function getInterfaceNavigationSourceType(program: Program, theInterface: Interface): Model | undefined;
49
50
  export declare function getNavigationSourceType(program: Program, operation: Operation): Model | undefined;
51
+ /**
52
+ * Removes route path params from a route path
53
+ *
54
+ * Examples:
55
+ * - user/{id}/manager -> user/manager
56
+ * - user/{id}/friends/{friendId}/hobbies -> user/friends/hobbies
57
+ * - user/{user-id}/friends/{friend-id}/hobbies -> user/friends/hobbies
58
+ */
59
+ export declare function removeRoutePathParams(routePath: string): string;
60
+ export declare function isSameNamespace(program: Program, model: Model, baseModel?: Model): boolean;
61
+ export declare function isTypeDefinedInExternalLibrary(program: Program, type: Type): boolean;
62
+ /**
63
+ * Recursively get all source interfaces of an interface
64
+ * @param theInterface
65
+ * @returns an array of all source interfaces
66
+ */
67
+ export declare function getSourceInterfaces(theInterface: Interface): Interface[];
50
68
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAEJ,SAAS,EAET,KAAK,EACL,aAAa,EACb,SAAS,EACT,SAAS,EACT,OAAO,EACP,MAAM,EACN,IAAI,EACJ,KAAK,EACN,MAAM,oBAAoB,CAAC;AAI5B,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,SAAS,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,SAAS,CAAC;IACxB,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,CAqBnE;AAED,wBAAgB,mB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AAM,UAEtD;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,GAAG,OAAO,CAK1F;AAED,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAGpF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,SAAS,GAAG,SAAS,EAAE,CAExE"}
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) {
@@ -46,6 +46,10 @@ export function getNameForModelType(program, type) {
46
46
  return "Edm.TimeOfDay";
47
47
  case "zonedDateTime":
48
48
  return "Edm.DateTimeOffset";
49
+ case "offsetDateTime":
50
+ return "Edm.DateTimeOffset";
51
+ case "utcDateTime":
52
+ return "Edm.DateTimeOffset";
49
53
  case "duration":
50
54
  return "Edm.Duration";
51
55
  case "boolean":
@@ -134,7 +138,7 @@ export function getNavigationTypeId(program, getOperation) {
134
138
  export function getInterfacesOfKinds(program, navigationSources, kinds) {
135
139
  const interfaces = new Map();
136
140
  navigationSources.forEach((theInterface) => {
137
- if (!theInterface.sourceInterfaces.some((s) => kinds.includes(s.name))) {
141
+ if (!getSourceInterfaces(theInterface).some((s) => kinds.includes(s.name))) {
138
142
  // if source interfaces DO NOT have the kinds.
139
143
  return;
140
144
  }
@@ -144,7 +148,7 @@ export function getInterfacesOfKinds(program, navigationSources, kinds) {
144
148
  }
145
149
  graphRoutePaths.forEach((graphRoute) => {
146
150
  // skip two-segment resources as they are collections
147
- if (isTwoSegmentResource(theInterface, graphRoute)) {
151
+ if (isRouteIndexOfACollection(theInterface, graphRoute)) {
148
152
  return;
149
153
  }
150
154
  processGraphRoute(graphRoute, interfaces, theInterface);
@@ -152,30 +156,27 @@ export function getInterfacesOfKinds(program, navigationSources, kinds) {
152
156
  });
153
157
  return interfaces;
154
158
  }
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
- }
159
+ function isRouteIndexOfACollection(theInterface, graphRoute) {
160
+ const pathSegments = graphRoute.split("/");
161
+ const pathSegmentsWithoutParams = removeRoutePathParams(graphRoute).split("/");
162
+ if (pathSegments.length / pathSegmentsWithoutParams.length === 2
163
+ && getSourceInterfaces(theInterface).some((s) => s.name === "Resource")) {
164
+ return true;
162
165
  }
163
166
  return false;
164
167
  }
165
168
  // Generate an interface for a resource that has a root path and an index like /users/{id}. Note that this is a collection.
166
169
  // Resources with two-segment paths like /users/{id} are essentially collections
167
- export function getTwoSegmentResourceInterface(program, navigationSources) {
170
+ // This applies to deeply nested resources as well e.g. /cars/{carId}/wheels/{wheelId}
171
+ export function getCollectionIndexInterfaces(program, navigationSources) {
168
172
  const interfaces = new Map();
169
173
  navigationSources.forEach((theInterface) => {
170
- if (!theInterface.sourceInterfaces.some((s) => ["Resource"].includes(s.name))) {
171
- return;
172
- }
173
174
  const graphRoutePaths = getGraphRoutePaths(program, theInterface);
174
175
  if (!graphRoutePaths || !graphRoutePaths.length) {
175
176
  return;
176
177
  }
177
178
  graphRoutePaths.forEach((graphRoute) => {
178
- if (isTwoSegmentResource(theInterface, graphRoute)) {
179
+ if (isRouteIndexOfACollection(theInterface, graphRoute)) {
179
180
  processGraphRoute(graphRoute, interfaces, theInterface);
180
181
  }
181
182
  });
@@ -206,12 +207,15 @@ export function getPropertyTypeName(program, type) {
206
207
  if (!nonNullTypes.length) {
207
208
  return "undefined.";
208
209
  }
209
- return getPropertyTypeName(program, nonNullTypes[0]);
210
+ return removeReferencePrefixFromType(getPropertyTypeName(program, nonNullTypes[0]));
210
211
  }
211
212
  if ((type.kind === "Model" || type.kind === "Scalar") && ((_a = type.namespace) === null || _a === void 0 ? void 0 : _a.name) === "TypeSpec") {
212
- return getNameForType(program, type);
213
+ return removeReferencePrefixFromType(getNameForType(program, type));
213
214
  }
214
- return getIdForType(program, type);
215
+ return removeReferencePrefixFromType(getIdForType(program, type));
216
+ }
217
+ export function removeReferencePrefixFromType(typeName) {
218
+ return typeName.replace(/^reference\./, "");
215
219
  }
216
220
  export function isTypeNullable(program, type) {
217
221
  if (type.kind !== "Union") {
@@ -350,7 +354,7 @@ export function getNavigationSourceType(program, operation) {
350
354
  return getInterfaceNavigationSourceType(program, operation.interface);
351
355
  }
352
356
  function findNavigationSource(theInterface) {
353
- for (const baseInterface of theInterface.sourceInterfaces) {
357
+ for (const baseInterface of getSourceInterfaces(theInterface)) {
354
358
  if (baseInterface.name === "Resource" || baseInterface.name === "Collection") {
355
359
  return baseInterface;
356
360
  }
@@ -369,8 +373,27 @@ function findNavigationSource(theInterface) {
369
373
  * Examples:
370
374
  * - user/{id}/manager -> user/manager
371
375
  * - user/{id}/friends/{friendId}/hobbies -> user/friends/hobbies
376
+ * - user/{user-id}/friends/{friend-id}/hobbies -> user/friends/hobbies
377
+ */
378
+ export function removeRoutePathParams(routePath) {
379
+ return routePath.replace(/\/\{[\w-]+\}/g, "");
380
+ }
381
+ export function isSameNamespace(program, model, baseModel) {
382
+ if (!baseModel) {
383
+ return false;
384
+ }
385
+ return getNamespaceName(program, model) === getNamespaceName(program, baseModel);
386
+ }
387
+ export function isTypeDefinedInExternalLibrary(program, type) {
388
+ const locationContext = getLocationContext(program, type);
389
+ return locationContext.type === "library";
390
+ }
391
+ /**
392
+ * Recursively get all source interfaces of an interface
393
+ * @param theInterface
394
+ * @returns an array of all source interfaces
372
395
  */
373
- function removeRoutePathParams(routePath) {
374
- return routePath.replace(/\/\{\w+\}/g, "");
396
+ export function getSourceInterfaces(theInterface) {
397
+ return [...theInterface.sourceInterfaces, ...[...theInterface.sourceInterfaces.values()].flatMap(getSourceInterfaces)];
375
398
  }
376
399
  //# 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,CAAC;KACpB;AACH,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAAgB,EAA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B,CAAC,SAAiB;IACrD,OAAO,SAAS,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAA;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;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,YAAuB;IACzD,OAAO,CAAC,GAAG,YAAY,CAAC,gBAAgB,EAAE,GAAG,CAAC,GAAG,YAAY,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC;AACzH,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,QAsD3C"}
@@ -0,0 +1,56 @@
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.validateAddressUrlOnlyAppliesToRoutedInterfacesOrActionOperations(program);
8
+ theRules.validateAllowedValuesCannotBeEmpty(program);
9
+ theRules.validateAlternateKeyOnKey(program);
10
+ theRules.validateAlternateKeyOnPrimitiveProperty(program);
11
+ theRules.validateAlternateKeyRequiresKey(program);
12
+ theRules.validateKeyOnlyOnEntityNonNullablePrimitiveProperty(program);
13
+ theRules.validateComputedCannotBeCombined(program);
14
+ theRules.validatecontainsOnlyAppliesToNavigationProperty(program);
15
+ theRules.validateCountAppliesToGetOperationsThatReturnCollections(program);
16
+ theRules.validateDisallowedTypeSpecDecorators(program);
17
+ theRules.validateCollectionValuedNavigationPropertiesCannotBeNullable(program);
18
+ theRules.validateRequiredRequestParameters(program);
19
+ theRules.validateEntityMustHaveKey(program);
20
+ theRules.validateExpandOnlyOnGetNavigationSource(program);
21
+ theRules.validateExpandOnlyNavigationProperties(program);
22
+ theRules.validateExtendsOnSameType(program);
23
+ theRules.validateFilterAppliesToGetOperationsThatReturnCollections(program);
24
+ theRules.validateFilterOnlyAppliesToModelProperties(program);
25
+ theRules.validateFilterPropertiesMustNotBeEmpty(program);
26
+ theRules.validateGraphRouteInterfaceExtendsGraphStandardInterface(program);
27
+ theRules.validateHasStreamOnlyOnEntity(program);
28
+ theRules.validateOpenOnlyAppliesToStructuredType(program);
29
+ theRules.validateOperationInsideInterface(program);
30
+ theRules.validateOrderByAppliesToGetOperationsThatReturnCollections(program);
31
+ theRules.validateOrderByOnlyNonNavigationProperties(program);
32
+ theRules.validateReferencesOnlyAppliesToNavigationProperty(program);
33
+ theRules.validateSearchAppliesToGetOperationsThatReturnCollections(program);
34
+ theRules.validateSkipAppliesToGetOperationsThatReturnCollections(program);
35
+ theRules.validateTopAppliesToGetOperationsThatReturnCollections(program);
36
+ theRules.validateVoidFunction(program);
37
+ theRules.validateGraphRouteLeadingSlash(program);
38
+ theRules.validateOperationParametersMatchGraphRouteParameters(program);
39
+ theRules.validateExtendedModelBaseShouldMatchPartialBaseModel(program);
40
+ theRules.validateGraphDeprecatedMustBeAccompaniedByDefinition(program);
41
+ theRules.validateGraphDeprecatedValueMustBeDefinedInDeprecatedDefinition(program);
42
+ theRules.validateExtendOnlyAppliesOnDifferentNamespaces(program);
43
+ theRules.validateOwnerlessMustOnlyBeAppliedToInterfacesWithSingleSegmentGraphRoute(program);
44
+ theRules.validateOwnerlessEntityModelReferencedMustOnlyHaveNavigationPropertiesRule(program);
45
+ theRules.validateOwnerlessInterfaceMustNotHaveAnyOperations(program);
46
+ theRules.validateOwnerlessDecoratorCannotBeUsedWithIsOwner(program);
47
+ theRules.validateEntityTypeInOwnerlessExtendsClauseCannotBeUsedInOtherInterfaces(program);
48
+ theRules.validatePropertyTypeOfEntityTypeMustHaveContainsOrReferences(program);
49
+ theRules.validateGlobalOperationMustBeUsedWithNonRoutedInterface(program);
50
+ theRules.validateGlobalOperationMustBeUsedWithProjectBindingType(program);
51
+ theRules.validateGraphRouteAndInterfaceExtendsMatchForCollections(program);
52
+ theRules.validateReferenceTargetInterfaceHasGraphRoutes(program);
53
+ theRules.validateReferenceTargetUsedOnlyOnceOnInterface(program);
54
+ theRules.validateTargetPathShouldNotHaveParameters(program);
55
+ }
56
+ //# 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,iEAAiE,CAAC,OAAO,CAAC,CA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E9D,CAAC"}
@@ -16,14 +16,31 @@ extern dec action(target: Operation, name?: valueof string);
16
16
 
17
17
  /**
18
18
  * `@additionalQueryParameters` - Appends a key=value pair to the query string of the mapped internal URL for all models defined within the namespace.
19
- *
19
+ *
20
20
  * `@additionalQueryParameters` can only be applied to namespaces
21
21
  */
22
- extern dec additionalQueryParameters(target: Namespace, name: valueof string, value: valueof string);
22
+ extern dec additionalQueryParameters(
23
+ target: Namespace,
24
+ name: valueof string,
25
+ value: valueof string
26
+ );
27
+
28
+ /**
29
+ * `@addressUrl` - Specifies the URL to which the operation request is forwarded when the request
30
+ * is authenticated with an AAD account.
31
+ *
32
+ * `@addressUrl` can only be applied to routed interfaces (entity sets, singletons and navigation properties) or action operations.
33
+ */
34
+ extern dec addressUrl(
35
+ target: Interface | Operation,
36
+ url: valueof string,
37
+ omitRootNavigationSegment?: valueof boolean,
38
+ appendSegmentNameToAddress?: valueof boolean
39
+ );
23
40
 
24
41
  /**
25
42
  * `@agsAttribute` - Allows all AGS CSDL extensions that are not yet modelled explicitly in TypeSpec to be maintained
26
- *
43
+ *
27
44
  * `@agsAttribute` - Applies to models.
28
45
  */
29
46
  extern dec agsAttribute(
@@ -34,10 +51,10 @@ extern dec agsAttribute(
34
51
 
35
52
  /**
36
53
  * `@allowedValues` - mark model property with allowedValues.
37
- *
54
+ *
38
55
  * `@allowedValues` - can only be applied to model properties.
39
56
  */
40
- extern dec allowedValues(target: ModelProperty, ...values: valueof unknown[]);
57
+ extern dec allowedValues(target: ModelProperty, ...values: valueof unknown[]);
41
58
 
42
59
  /**
43
60
  * `@alternateKey` - mark a model property as an alternateKey
@@ -81,6 +98,23 @@ extern dec count(target: Operation);
81
98
  */
82
99
  extern dec deltaCollection(target: Model);
83
100
 
101
+ /**
102
+ * `@graphDeprecated` - mark an entity as graphDeprecated.
103
+ *
104
+ * `@graphDeprecated` can be applied to Model, ModelProperty, Enum, EnumMember, Operation, Namespace, Interface.
105
+ */
106
+ extern dec graphDeprecated(
107
+ target:
108
+ | Model
109
+ | ModelProperty
110
+ | Enum
111
+ | EnumMember
112
+ | Operation
113
+ | Namespace
114
+ | Interface,
115
+ name: valueof string
116
+ );
117
+
84
118
  /**
85
119
  * `@deprecatedDefinition` - Allow us create a reusable deprecation definition.
86
120
  * `@deprecatedDefinition` - Applies only to namespaces.
@@ -108,14 +142,27 @@ extern dec entity(target: Model);
108
142
  * `properties` - Property names in the model returned from the get that can be used in a $expand query parameter.
109
143
  * At least one property must be specified.
110
144
  */
111
- extern dec expand(target: Operation, property: valueof string, ...otherProperties: valueof string[]);
145
+ extern dec expand(
146
+ target: Operation,
147
+ property: valueof string,
148
+ ...otherProperties: valueof string[]
149
+ );
112
150
 
113
151
  /**
114
152
  * `@experimental` - mark the entity as experimental
115
153
  *
116
154
  * `@experimental` can be applied to Model, ModelProperty, Enum, EnumMember, Operation, Namespace, Interface.
117
155
  */
118
- extern dec experimental(target: Model | ModelProperty | Enum | EnumMember | Operation | Namespace | Interface);
156
+ extern dec experimental(
157
+ target:
158
+ | Model
159
+ | ModelProperty
160
+ | Enum
161
+ | EnumMember
162
+ | Operation
163
+ | Namespace
164
+ | Interface
165
+ );
119
166
 
120
167
  /**
121
168
  * `@filter` - Applies to: get operations that return collections of @entity or @complex models.
@@ -124,8 +171,11 @@ extern dec experimental(target: Model | ModelProperty | Enum | EnumMember | Oper
124
171
  * `properties` - array of property names in the model returned
125
172
  * from the get operation that can be used in $filter query parameter.
126
173
  */
127
- extern dec filter(target: Operation, property: valueof string, ...properties: valueof string[]);
128
-
174
+ extern dec filter(
175
+ target: Operation,
176
+ property: valueof string,
177
+ ...properties: valueof string[]
178
+ );
129
179
 
130
180
  /**
131
181
  * `@flags` - mark an enumeration type as a flag.
@@ -141,15 +191,25 @@ extern dec flags(target: Enum);
141
191
  */
142
192
  extern dec function(target: Operation, name?: valueof string);
143
193
 
194
+ /**
195
+ * `@globalOperation` - mark an operation as a globalOperation
196
+ *
197
+ * `@globalOperation` can only be applied to operations.
198
+ */
199
+ extern dec globalOperation(target: Operation);
200
+
144
201
  /**
145
202
  * `@graphRoute` - mark an interface or operation with an HTTP route.
146
- *
203
+ *
147
204
  * `@graphRoute` - can only be applied to interfaces or operations.
148
205
  */
149
206
  // TODO: Using @graphRoute on an operation currently does not work due to the following TypeSpec core issue
150
207
  // https://github.com/microsoft/typespec/issues/2106
151
208
  // Disabling all related features while we await the outcome.
152
- extern dec graphRoute(target: Interface /* | Operation */, path: valueof string);
209
+ extern dec graphRoute(
210
+ target: Interface, /* | Operation */
211
+ path: valueof string
212
+ );
153
213
 
154
214
  /**
155
215
  * `@hasStream` - indicates that an `@entity` model has a stream.
@@ -165,6 +225,13 @@ extern dec hasStream(target: Model, ...mediaTypes: valueof string[]);
165
225
  */
166
226
  extern dec immutable(target: ModelProperty);
167
227
 
228
+ /**
229
+ * `@ownerless` - mark an interface as ownerless.
230
+ *
231
+ * `@ownerless` can only be applied to interfaces.
232
+ */
233
+ extern dec ownerless(target: Interface);
234
+
168
235
  /**
169
236
  * `@open` - mark a model type as open
170
237
  *
@@ -188,7 +255,11 @@ extern dec operationParameters(target: Model);
188
255
  * `properties` - List of property names in the model returned from the get operation that can be used in a $orderBy query parameter.
189
256
  * At least one property must be specified.
190
257
  */
191
- extern dec orderBy(target: Operation, property: valueof string, ...otherProperties: valueof string[]);
258
+ extern dec orderBy(
259
+ target: Operation,
260
+ property: valueof string,
261
+ ...otherProperties: valueof string[]
262
+ );
192
263
 
193
264
  /**
194
265
  * `@pagedCollection` - mark a model as representing a paged collection.
@@ -230,7 +301,9 @@ extern dec privatePreviewDefinition(
230
301
  *
231
302
  * `@privileged` can be applied to Model, ModelProperty, Enum, EnumMember, Operation, Namespace.
232
303
  */
233
- extern dec privileged(target: Model | ModelProperty | Enum | EnumMember | Operation | Namespace);
304
+ extern dec privileged(
305
+ target: Model | ModelProperty | Enum | EnumMember | Operation | Namespace
306
+ );
234
307
 
235
308
  /**
236
309
  * `@publicNamespace` - defines the namespace to be used in generating CSDL output for all elements contained within the namespace
@@ -253,6 +326,13 @@ extern dec readOnly(target: ModelProperty);
253
326
  */
254
327
  extern dec references(target: ModelProperty);
255
328
 
329
+ /**
330
+ * `@referenceTarget` - mark an interface with referenceTarget
331
+ *
332
+ * `@references` can only be applied to interfaces.
333
+ */
334
+ extern dec referenceTarget(target: Interface, value: valueof string);
335
+
256
336
  /**
257
337
  * `@requiredForCreate` - mark a model property as required when a request is made to
258
338
  * Graph to create or update a resource.
@@ -273,6 +353,23 @@ extern dec search(target: Operation);
273
353
  */
274
354
  extern dec skip(target: Operation);
275
355
 
356
+ /**
357
+ * `@select` - Applies to operations
358
+ * Indicates that the operation supports the OData $select query parameter
359
+ */
360
+ extern dec select(target: Operation);
361
+
362
+ /**
363
+ * `@term` - Applies to: namespaces.
364
+ * Indicates that a workload wishes to require or return instance annotations in their request / response packets at runtime.
365
+ */
366
+ extern dec term(
367
+ target: Namespace,
368
+ name: valueof string,
369
+ type: Scalar,
370
+ description: valueof string
371
+ );
372
+
276
373
  /**
277
374
  * `@top` - Applies to: get operations that return collections.
278
375
  * Indicates that the get operation supports the OData $top query parameter.
@@ -287,10 +384,10 @@ extern dec top(target: Operation);
287
384
  extern dec writeOnly(target: ModelProperty);
288
385
 
289
386
  /**
290
- * `@isOwner` - specify that this workload is the primary owner of this entity model
291
- *
292
- * `@isOwner` can be applied to Model where the model also has an @entity decorator or a ModelProperty where it has either an @contains or @references decorator.
293
- */
387
+ * `@isOwner` - specify that this workload is the primary owner of this entity model
388
+ *
389
+ * `@isOwner` can be applied to Model where the model also has an @entity decorator or a ModelProperty where it has either an @contains or @references decorator.
390
+ */
294
391
  extern dec isOwner(target: Model | ModelProperty, value?: valueof boolean);
295
392
 
296
393
  /**