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

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 (371) hide show
  1. package/dist/src/components/acceptable-media-types-annotation.d.ts +3 -4
  2. package/dist/src/components/acceptable-media-types-annotation.d.ts.map +1 -1
  3. package/dist/src/components/acceptable-media-types-annotation.js +2 -6
  4. package/dist/src/components/acceptable-media-types-annotation.js.map +1 -1
  5. package/dist/src/components/alternate-keys-annotation.d.ts +4 -4
  6. package/dist/src/components/alternate-keys-annotation.d.ts.map +1 -1
  7. package/dist/src/components/alternate-keys-annotation.js +8 -16
  8. package/dist/src/components/alternate-keys-annotation.js.map +1 -1
  9. package/dist/src/components/annotations.d.ts +12 -0
  10. package/dist/src/components/annotations.d.ts.map +1 -0
  11. package/dist/src/components/annotations.js +63 -0
  12. package/dist/src/components/annotations.js.map +1 -0
  13. package/dist/src/components/common-elements.d.ts +15 -73
  14. package/dist/src/components/common-elements.d.ts.map +1 -1
  15. package/dist/src/components/common-elements.js +12 -26
  16. package/dist/src/components/common-elements.js.map +1 -1
  17. package/dist/src/components/computed-annotation.d.ts +3 -4
  18. package/dist/src/components/computed-annotation.d.ts.map +1 -1
  19. package/dist/src/components/computed-annotation.js +4 -10
  20. package/dist/src/components/computed-annotation.js.map +1 -1
  21. package/dist/src/components/count-restrictions-annotation.d.ts +3 -4
  22. package/dist/src/components/count-restrictions-annotation.d.ts.map +1 -1
  23. package/dist/src/components/count-restrictions-annotation.js +4 -13
  24. package/dist/src/components/count-restrictions-annotation.js.map +1 -1
  25. package/dist/src/components/description-annotation.d.ts +3 -4
  26. package/dist/src/components/description-annotation.d.ts.map +1 -1
  27. package/dist/src/components/description-annotation.js +5 -11
  28. package/dist/src/components/description-annotation.js.map +1 -1
  29. package/dist/src/components/entity-container-element.d.ts +21 -0
  30. package/dist/src/components/entity-container-element.d.ts.map +1 -0
  31. package/dist/src/components/entity-container-element.js +22 -0
  32. package/dist/src/components/entity-container-element.js.map +1 -0
  33. package/dist/src/components/enum-type-element.d.ts +6 -0
  34. package/dist/src/components/enum-type-element.d.ts.map +1 -0
  35. package/dist/src/components/enum-type-element.js +17 -0
  36. package/dist/src/components/enum-type-element.js.map +1 -0
  37. package/dist/src/components/expand-restrictions-annotation.d.ts +4 -5
  38. package/dist/src/components/expand-restrictions-annotation.d.ts.map +1 -1
  39. package/dist/src/components/expand-restrictions-annotation.js +9 -30
  40. package/dist/src/components/expand-restrictions-annotation.js.map +1 -1
  41. package/dist/src/components/filter-restrictions-annotation.d.ts +6 -0
  42. package/dist/src/components/filter-restrictions-annotation.d.ts.map +1 -0
  43. package/dist/src/components/filter-restrictions-annotation.js +10 -0
  44. package/dist/src/components/filter-restrictions-annotation.js.map +1 -0
  45. package/dist/src/components/immutable-annotation.d.ts +5 -0
  46. package/dist/src/components/immutable-annotation.d.ts.map +1 -0
  47. package/dist/src/components/immutable-annotation.js +6 -0
  48. package/dist/src/components/immutable-annotation.js.map +1 -0
  49. package/dist/src/components/index.d.ts +2 -14
  50. package/dist/src/components/index.d.ts.map +1 -1
  51. package/dist/src/components/index.js +9 -14
  52. package/dist/src/components/index.js.map +1 -1
  53. package/dist/src/components/insert-restrictions-annotation.d.ts +6 -0
  54. package/dist/src/components/insert-restrictions-annotation.d.ts.map +1 -0
  55. package/dist/src/components/insert-restrictions-annotation.js +10 -0
  56. package/dist/src/components/insert-restrictions-annotation.js.map +1 -0
  57. package/dist/src/components/operation-element.d.ts +6 -0
  58. package/dist/src/components/operation-element.d.ts.map +1 -0
  59. package/dist/src/components/operation-element.js +70 -0
  60. package/dist/src/components/operation-element.js.map +1 -0
  61. package/dist/src/components/permissions-annotation.d.ts +3 -4
  62. package/dist/src/components/permissions-annotation.d.ts.map +1 -1
  63. package/dist/src/components/permissions-annotation.js +2 -10
  64. package/dist/src/components/permissions-annotation.js.map +1 -1
  65. package/dist/src/components/property-element.d.ts +4 -4
  66. package/dist/src/components/property-element.d.ts.map +1 -1
  67. package/dist/src/components/property-element.js +16 -32
  68. package/dist/src/components/property-element.js.map +1 -1
  69. package/dist/src/components/revisions-annotation.d.ts +4 -5
  70. package/dist/src/components/revisions-annotation.d.ts.map +1 -1
  71. package/dist/src/components/revisions-annotation.js +7 -51
  72. package/dist/src/components/revisions-annotation.js.map +1 -1
  73. package/dist/src/components/schema-element.d.ts +6 -0
  74. package/dist/src/components/schema-element.d.ts.map +1 -0
  75. package/dist/src/components/schema-element.js +42 -0
  76. package/dist/src/components/schema-element.js.map +1 -0
  77. package/dist/src/components/search-restrictions-annotation.d.ts +3 -4
  78. package/dist/src/components/search-restrictions-annotation.d.ts.map +1 -1
  79. package/dist/src/components/search-restrictions-annotation.js +4 -13
  80. package/dist/src/components/search-restrictions-annotation.js.map +1 -1
  81. package/dist/src/components/skip-supported-annotation.d.ts +3 -4
  82. package/dist/src/components/skip-supported-annotation.d.ts.map +1 -1
  83. package/dist/src/components/skip-supported-annotation.js +2 -11
  84. package/dist/src/components/skip-supported-annotation.js.map +1 -1
  85. package/dist/src/components/sort-restrictions-annotation.d.ts +4 -5
  86. package/dist/src/components/sort-restrictions-annotation.d.ts.map +1 -1
  87. package/dist/src/components/sort-restrictions-annotation.js +9 -30
  88. package/dist/src/components/sort-restrictions-annotation.js.map +1 -1
  89. package/dist/src/components/structured-type-element.d.ts +7 -4
  90. package/dist/src/components/structured-type-element.d.ts.map +1 -1
  91. package/dist/src/components/structured-type-element.js +24 -66
  92. package/dist/src/components/structured-type-element.js.map +1 -1
  93. package/dist/src/components/top-supported-annotation.d.ts +3 -4
  94. package/dist/src/components/top-supported-annotation.d.ts.map +1 -1
  95. package/dist/src/components/top-supported-annotation.js +3 -10
  96. package/dist/src/components/top-supported-annotation.js.map +1 -1
  97. package/dist/src/components/update-restrictions-annotation.d.ts +5 -0
  98. package/dist/src/components/update-restrictions-annotation.d.ts.map +1 -0
  99. package/dist/src/components/update-restrictions-annotation.js +8 -0
  100. package/dist/src/components/update-restrictions-annotation.js.map +1 -0
  101. package/dist/src/decorators/abstract.d.ts.map +1 -1
  102. package/dist/src/decorators/abstract.js +0 -6
  103. package/dist/src/decorators/abstract.js.map +1 -1
  104. package/dist/src/decorators/action.d.ts +10 -0
  105. package/dist/src/decorators/action.d.ts.map +1 -0
  106. package/dist/src/decorators/action.js +16 -0
  107. package/dist/src/decorators/action.js.map +1 -0
  108. package/dist/src/decorators/{handlers/custom/additional-query-parameters.d.ts → additional-query-parameters.d.ts} +3 -1
  109. package/dist/src/decorators/additional-query-parameters.d.ts.map +1 -0
  110. package/dist/src/decorators/additional-query-parameters.js +21 -0
  111. package/dist/src/decorators/additional-query-parameters.js.map +1 -0
  112. package/dist/src/decorators/ags-attribute.d.ts +14 -0
  113. package/dist/src/decorators/ags-attribute.d.ts.map +1 -0
  114. package/dist/src/decorators/ags-attribute.js +115 -0
  115. package/dist/src/decorators/ags-attribute.js.map +1 -0
  116. package/dist/src/decorators/allowed-values.d.ts +13 -0
  117. package/dist/src/decorators/allowed-values.d.ts.map +1 -0
  118. package/dist/src/decorators/allowed-values.js +35 -0
  119. package/dist/src/decorators/allowed-values.js.map +1 -0
  120. package/dist/src/decorators/complex.d.ts.map +1 -1
  121. package/dist/src/decorators/complex.js +0 -6
  122. package/dist/src/decorators/complex.js.map +1 -1
  123. package/dist/src/decorators/delta-collection.d.ts +8 -0
  124. package/dist/src/decorators/delta-collection.d.ts.map +1 -0
  125. package/dist/src/decorators/delta-collection.js +12 -0
  126. package/dist/src/decorators/delta-collection.js.map +1 -0
  127. package/dist/src/decorators/entity.d.ts.map +1 -1
  128. package/dist/src/decorators/entity.js +0 -6
  129. package/dist/src/decorators/entity.js.map +1 -1
  130. package/dist/src/decorators/filter.d.ts +11 -0
  131. package/dist/src/decorators/filter.d.ts.map +1 -0
  132. package/dist/src/decorators/filter.js +27 -0
  133. package/dist/src/decorators/filter.js.map +1 -0
  134. package/dist/src/decorators/flags.d.ts +9 -0
  135. package/dist/src/decorators/flags.d.ts.map +1 -0
  136. package/dist/src/decorators/flags.js +13 -0
  137. package/dist/src/decorators/flags.js.map +1 -0
  138. package/dist/src/decorators/function.d.ts +10 -0
  139. package/dist/src/decorators/function.d.ts.map +1 -0
  140. package/dist/src/decorators/function.js +16 -0
  141. package/dist/src/decorators/function.js.map +1 -0
  142. package/dist/src/decorators/graph-route.d.ts +17 -0
  143. package/dist/src/decorators/graph-route.d.ts.map +1 -0
  144. package/dist/src/decorators/graph-route.js +92 -0
  145. package/dist/src/decorators/graph-route.js.map +1 -0
  146. package/dist/src/decorators/has-stream.d.ts +1 -2
  147. package/dist/src/decorators/has-stream.d.ts.map +1 -1
  148. package/dist/src/decorators/has-stream.js +1 -14
  149. package/dist/src/decorators/has-stream.js.map +1 -1
  150. package/dist/src/decorators/immutable.d.ts +8 -0
  151. package/dist/src/decorators/immutable.d.ts.map +1 -0
  152. package/dist/src/decorators/immutable.js +12 -0
  153. package/dist/src/decorators/immutable.js.map +1 -0
  154. package/dist/src/decorators/index.d.ts +20 -1
  155. package/dist/src/decorators/index.d.ts.map +1 -1
  156. package/dist/src/decorators/index.js +20 -1
  157. package/dist/src/decorators/index.js.map +1 -1
  158. package/dist/src/decorators/is-owner.d.ts +10 -0
  159. package/dist/src/decorators/is-owner.d.ts.map +1 -0
  160. package/dist/src/decorators/is-owner.js +17 -0
  161. package/dist/src/decorators/is-owner.js.map +1 -0
  162. package/dist/src/decorators/open.d.ts.map +1 -1
  163. package/dist/src/decorators/open.js +0 -6
  164. package/dist/src/decorators/open.js.map +1 -1
  165. package/dist/src/decorators/{routed-interfaces.d.ts → operation-parameters.d.ts} +3 -11
  166. package/dist/src/decorators/operation-parameters.d.ts.map +1 -0
  167. package/dist/src/decorators/operation-parameters.js +15 -0
  168. package/dist/src/decorators/operation-parameters.js.map +1 -0
  169. package/dist/src/decorators/paged-collection.d.ts +8 -0
  170. package/dist/src/decorators/paged-collection.d.ts.map +1 -0
  171. package/dist/src/decorators/paged-collection.js +12 -0
  172. package/dist/src/decorators/paged-collection.js.map +1 -0
  173. package/dist/src/decorators/partial.d.ts +10 -0
  174. package/dist/src/decorators/partial.d.ts.map +1 -0
  175. package/dist/src/decorators/partial.js +16 -0
  176. package/dist/src/decorators/partial.js.map +1 -0
  177. package/dist/src/decorators/private-preview.d.ts.map +1 -1
  178. package/dist/src/decorators/private-preview.js +0 -10
  179. package/dist/src/decorators/private-preview.js.map +1 -1
  180. package/dist/src/decorators/privileged.d.ts +9 -0
  181. package/dist/src/decorators/privileged.d.ts.map +1 -0
  182. package/dist/src/decorators/privileged.js +13 -0
  183. package/dist/src/decorators/privileged.js.map +1 -0
  184. package/dist/src/decorators/public-namespace.d.ts +10 -0
  185. package/dist/src/decorators/public-namespace.d.ts.map +1 -0
  186. package/dist/src/decorators/public-namespace.js +16 -0
  187. package/dist/src/decorators/public-namespace.js.map +1 -0
  188. package/dist/src/decorators/required-for-create.d.ts +10 -0
  189. package/dist/src/decorators/required-for-create.d.ts.map +1 -0
  190. package/dist/src/decorators/required-for-create.js +14 -0
  191. package/dist/src/decorators/required-for-create.js.map +1 -0
  192. package/dist/src/decorators/workload-name-msa.d.ts +9 -0
  193. package/dist/src/decorators/workload-name-msa.d.ts.map +1 -0
  194. package/dist/src/decorators/workload-name-msa.js +13 -0
  195. package/dist/src/decorators/workload-name-msa.js.map +1 -0
  196. package/dist/src/decorators/workload-name.d.ts +9 -0
  197. package/dist/src/decorators/workload-name.d.ts.map +1 -0
  198. package/dist/src/decorators/workload-name.js +13 -0
  199. package/dist/src/decorators/workload-name.js.map +1 -0
  200. package/dist/src/emitter.d.ts +2 -1
  201. package/dist/src/emitter.d.ts.map +1 -1
  202. package/dist/src/emitter.js +7 -3
  203. package/dist/src/emitter.js.map +1 -1
  204. package/dist/src/entities/annotations.d.ts +40 -0
  205. package/dist/src/entities/annotations.d.ts.map +1 -0
  206. package/dist/src/entities/annotations.js +139 -0
  207. package/dist/src/entities/annotations.js.map +1 -0
  208. package/dist/src/entities/entity-container.d.ts +15 -0
  209. package/dist/src/entities/entity-container.d.ts.map +1 -0
  210. package/dist/src/entities/entity-container.js +44 -0
  211. package/dist/src/entities/entity-container.js.map +1 -0
  212. package/dist/src/entities/enum.d.ts +17 -0
  213. package/dist/src/entities/enum.d.ts.map +1 -0
  214. package/dist/src/entities/enum.js +24 -0
  215. package/dist/src/entities/enum.js.map +1 -0
  216. package/dist/src/entities/model.d.ts +47 -0
  217. package/dist/src/entities/model.d.ts.map +1 -0
  218. package/dist/src/entities/model.js +104 -0
  219. package/dist/src/entities/model.js.map +1 -0
  220. package/dist/src/entities/namespace.d.ts +22 -0
  221. package/dist/src/entities/namespace.d.ts.map +1 -0
  222. package/dist/src/entities/namespace.js +84 -0
  223. package/dist/src/entities/namespace.js.map +1 -0
  224. package/dist/src/entities/operation.d.ts +28 -0
  225. package/dist/src/entities/operation.d.ts.map +1 -0
  226. package/dist/src/entities/operation.js +103 -0
  227. package/dist/src/entities/operation.js.map +1 -0
  228. package/dist/src/entities/property.d.ts +3 -0
  229. package/dist/src/entities/property.d.ts.map +1 -0
  230. package/dist/src/entities/property.js +57 -0
  231. package/dist/src/entities/property.js.map +1 -0
  232. package/dist/src/entities/revision-definition.d.ts +9 -0
  233. package/dist/src/entities/revision-definition.d.ts.map +1 -0
  234. package/dist/src/entities/revision-definition.js +42 -0
  235. package/dist/src/entities/revision-definition.js.map +1 -0
  236. package/dist/src/index.d.ts +0 -3
  237. package/dist/src/index.d.ts.map +1 -1
  238. package/dist/src/index.js +0 -3
  239. package/dist/src/index.js.map +1 -1
  240. package/dist/src/lib.d.ts +53 -2
  241. package/dist/src/lib.d.ts.map +1 -1
  242. package/dist/src/lib.js +25 -1
  243. package/dist/src/lib.js.map +1 -1
  244. package/dist/src/linter.d.ts.map +1 -1
  245. package/dist/src/linter.js +34 -25
  246. package/dist/src/linter.js.map +1 -1
  247. package/dist/src/rules/abstract.d.ts +2 -1
  248. package/dist/src/rules/abstract.d.ts.map +1 -1
  249. package/dist/src/rules/abstract.js +8 -8
  250. package/dist/src/rules/abstract.js.map +1 -1
  251. package/dist/src/rules/allowed-values.d.ts +6 -0
  252. package/dist/src/rules/allowed-values.d.ts.map +1 -0
  253. package/dist/src/rules/allowed-values.js +59 -0
  254. package/dist/src/rules/allowed-values.js.map +1 -0
  255. package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts +2 -0
  256. package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts.map +1 -0
  257. package/dist/src/rules/collection-navigation-properties-not-nullable.js +28 -0
  258. package/dist/src/rules/collection-navigation-properties-not-nullable.js.map +1 -0
  259. package/dist/src/rules/count.d.ts.map +1 -1
  260. package/dist/src/rules/count.js +3 -1
  261. package/dist/src/rules/count.js.map +1 -1
  262. package/dist/src/rules/disallowed-typespec-decorators.d.ts +2 -0
  263. package/dist/src/rules/disallowed-typespec-decorators.d.ts.map +1 -0
  264. package/dist/src/rules/disallowed-typespec-decorators.js +33 -0
  265. package/dist/src/rules/disallowed-typespec-decorators.js.map +1 -0
  266. package/dist/src/rules/entity.d.ts +1 -0
  267. package/dist/src/rules/entity.d.ts.map +1 -1
  268. package/dist/src/rules/entity.js +43 -1
  269. package/dist/src/rules/entity.js.map +1 -1
  270. package/dist/src/rules/enum.d.ts +2 -0
  271. package/dist/src/rules/enum.d.ts.map +1 -0
  272. package/dist/src/rules/enum.js +26 -0
  273. package/dist/src/rules/enum.js.map +1 -0
  274. package/dist/src/rules/expand.d.ts.map +1 -1
  275. package/dist/src/rules/expand.js +5 -7
  276. package/dist/src/rules/expand.js.map +1 -1
  277. package/dist/src/rules/extends-on-same-type.d.ts +2 -0
  278. package/dist/src/rules/extends-on-same-type.d.ts.map +1 -0
  279. package/dist/src/rules/extends-on-same-type.js +38 -0
  280. package/dist/src/rules/extends-on-same-type.js.map +1 -0
  281. package/dist/src/rules/filter.d.ts +4 -0
  282. package/dist/src/rules/filter.d.ts.map +1 -0
  283. package/dist/src/rules/filter.js +92 -0
  284. package/dist/src/rules/filter.js.map +1 -0
  285. package/dist/src/rules/function.d.ts +2 -0
  286. package/dist/src/rules/function.d.ts.map +1 -0
  287. package/dist/src/rules/function.js +26 -0
  288. package/dist/src/rules/function.js.map +1 -0
  289. package/dist/src/rules/graph-route.d.ts +6 -0
  290. package/dist/src/rules/graph-route.d.ts.map +1 -0
  291. package/dist/src/rules/graph-route.js +97 -0
  292. package/dist/src/rules/graph-route.js.map +1 -0
  293. package/dist/src/rules/index.d.ts +13 -6
  294. package/dist/src/rules/index.d.ts.map +1 -1
  295. package/dist/src/rules/index.js +13 -161
  296. package/dist/src/rules/index.js.map +1 -1
  297. package/dist/src/rules/namespace.d.ts +3 -0
  298. package/dist/src/rules/namespace.d.ts.map +1 -0
  299. package/dist/src/rules/namespace.js +58 -0
  300. package/dist/src/rules/namespace.js.map +1 -0
  301. package/dist/src/rules/operation-inside-interface.d.ts +2 -0
  302. package/dist/src/rules/operation-inside-interface.d.ts.map +1 -0
  303. package/dist/src/rules/operation-inside-interface.js +25 -0
  304. package/dist/src/rules/operation-inside-interface.js.map +1 -0
  305. package/dist/src/rules/order-by.d.ts +1 -1
  306. package/dist/src/rules/order-by.d.ts.map +1 -1
  307. package/dist/src/rules/order-by.js +11 -10
  308. package/dist/src/rules/order-by.js.map +1 -1
  309. package/dist/src/rules/partial.d.ts +5 -0
  310. package/dist/src/rules/partial.d.ts.map +1 -0
  311. package/dist/src/rules/partial.js +35 -0
  312. package/dist/src/rules/partial.js.map +1 -0
  313. package/dist/src/rules/required-for-create.d.ts +2 -0
  314. package/dist/src/rules/required-for-create.d.ts.map +1 -0
  315. package/dist/src/rules/required-for-create.js +40 -0
  316. package/dist/src/rules/required-for-create.js.map +1 -0
  317. package/dist/src/rules/search.d.ts.map +1 -1
  318. package/dist/src/rules/search.js +3 -1
  319. package/dist/src/rules/search.js.map +1 -1
  320. package/dist/src/rules/skip.d.ts.map +1 -1
  321. package/dist/src/rules/skip.js +3 -1
  322. package/dist/src/rules/skip.js.map +1 -1
  323. package/dist/src/rules/top.d.ts.map +1 -1
  324. package/dist/src/rules/top.js +3 -1
  325. package/dist/src/rules/top.js.map +1 -1
  326. package/dist/src/utils.d.ts +22 -0
  327. package/dist/src/utils.d.ts.map +1 -1
  328. package/dist/src/utils.js +160 -4
  329. package/dist/src/utils.js.map +1 -1
  330. package/lib/decorators.tsp +182 -39
  331. package/lib/deployment.tsp +18 -0
  332. package/lib/lib.tsp +6 -22
  333. package/lib/msgraph.tsp +4 -0
  334. package/lib/porcelain.tsp +135 -0
  335. package/lib/responses.tsp +82 -0
  336. package/lib/shared-models.tsp +75 -0
  337. package/package.json +31 -20
  338. package/dist/src/components/program-context.d.ts +0 -4
  339. package/dist/src/components/program-context.d.ts.map +0 -1
  340. package/dist/src/components/program-context.js +0 -3
  341. package/dist/src/components/program-context.js.map +0 -1
  342. package/dist/src/csdl.d.ts +0 -8
  343. package/dist/src/csdl.d.ts.map +0 -1
  344. package/dist/src/csdl.js +0 -298
  345. package/dist/src/csdl.js.map +0 -1
  346. package/dist/src/decorators/attribute-builder.d.ts +0 -2
  347. package/dist/src/decorators/attribute-builder.d.ts.map +0 -1
  348. package/dist/src/decorators/attribute-builder.js +0 -166
  349. package/dist/src/decorators/attribute-builder.js.map +0 -1
  350. package/dist/src/decorators/attributes.d.ts +0 -57
  351. package/dist/src/decorators/attributes.d.ts.map +0 -1
  352. package/dist/src/decorators/attributes.js +0 -50
  353. package/dist/src/decorators/attributes.js.map +0 -1
  354. package/dist/src/decorators/handlers/custom/additional-query-parameters.d.ts.map +0 -1
  355. package/dist/src/decorators/handlers/custom/additional-query-parameters.js +0 -36
  356. package/dist/src/decorators/handlers/custom/additional-query-parameters.js.map +0 -1
  357. package/dist/src/decorators/handlers/custom/ags-attribute.d.ts +0 -7
  358. package/dist/src/decorators/handlers/custom/ags-attribute.d.ts.map +0 -1
  359. package/dist/src/decorators/handlers/custom/ags-attribute.js +0 -36
  360. package/dist/src/decorators/handlers/custom/ags-attribute.js.map +0 -1
  361. package/dist/src/decorators/handlers/custom/index.d.ts +0 -3
  362. package/dist/src/decorators/handlers/custom/index.d.ts.map +0 -1
  363. package/dist/src/decorators/handlers/custom/index.js +0 -3
  364. package/dist/src/decorators/handlers/custom/index.js.map +0 -1
  365. package/dist/src/decorators/handlers/index.d.ts +0 -30
  366. package/dist/src/decorators/handlers/index.d.ts.map +0 -1
  367. package/dist/src/decorators/handlers/index.js +0 -121
  368. package/dist/src/decorators/handlers/index.js.map +0 -1
  369. package/dist/src/decorators/routed-interfaces.d.ts.map +0 -1
  370. package/dist/src/decorators/routed-interfaces.js +0 -43
  371. package/dist/src/decorators/routed-interfaces.js.map +0 -1
@@ -1,14 +1,43 @@
1
1
  using TypeSpec.Reflection;
2
2
 
3
3
  /**
4
- * TODO: Enable this once Model type is supported. https://github.com/microsoft/typespec/issues/1655
5
- *
6
4
  * `@abstract` - mark a model type as abstract
7
5
  *
8
6
  * `@abstract` can only be applied to models.
9
-
7
+ */
10
8
  extern dec abstract(target: Model);
11
- */
9
+
10
+ /**
11
+ * `@action` - mark an operation as an action
12
+ *
13
+ * `@action` can only be applied to operations.
14
+ */
15
+ extern dec action(target: Operation, name?: valueof string);
16
+
17
+ /**
18
+ * `@additionalQueryParameters` - Appends a key=value pair to the query string of the mapped internal URL for all models defined within the namespace.
19
+ *
20
+ * `@additionalQueryParameters` can only be applied to namespaces
21
+ */
22
+ extern dec additionalQueryParameters(target: Namespace, name: valueof string, value: valueof string);
23
+
24
+ /**
25
+ * `@agsAttribute` - Allows all AGS CSDL extensions that are not yet modelled explicitly in TypeSpec to be maintained
26
+ *
27
+ * `@agsAttribute` - Applies to models.
28
+ */
29
+ extern dec agsAttribute(
30
+ target: Model | ModelProperty | Enum | EnumMember | Operation | Interface,
31
+ name: valueof string,
32
+ value: valueof string
33
+ );
34
+
35
+ /**
36
+ * `@allowedValues` - mark model property with allowedValues.
37
+ *
38
+ * `@allowedValues` - can only be applied to model properties.
39
+ */
40
+ extern dec allowedValues(target: ModelProperty, ...values: valueof unknown[]);
12
41
 
13
42
  /**
14
43
  * `@alternateKey` - mark a model property as an alternateKey
@@ -18,14 +47,11 @@ extern dec abstract(target: Model);
18
47
  extern dec alternateKey(target: ModelProperty);
19
48
 
20
49
  /**
21
- * TODO: Enable this once Model type is supported. https://github.com/microsoft/typespec/issues/1655
22
- *
23
50
  * `@complex` - mark a model as an entity type
24
51
  *
25
52
  * `@complex` can only be applied to models.
26
-
27
- extern dec complex(target: Model);
28
53
  */
54
+ extern dec complex(target: Model);
29
55
 
30
56
  /**
31
57
  * `@computed` - mark a model property as a computed property
@@ -48,28 +74,32 @@ extern dec contains(target: ModelProperty);
48
74
  */
49
75
  extern dec count(target: Operation);
50
76
 
77
+ /**
78
+ * `@deltaCollection` - mark a model as representing a delta paged collection.
79
+ *
80
+ * `@deltaCollection` can only be applied to models.
81
+ */
82
+ extern dec deltaCollection(target: Model);
83
+
51
84
  /**
52
85
  * `@deprecatedDefinition` - Allow us create a reusable deprecation definition.
53
86
  * `@deprecatedDefinition` - Applies only to namespaces.
54
87
  */
55
88
  extern dec deprecatedDefinition(
56
89
  target: Namespace,
57
- name: string,
58
- category: string,
59
- announcementDate: string,
60
- removalDate: string,
61
- description: string
90
+ name: valueof string,
91
+ category: valueof string,
92
+ announcementDate: valueof string,
93
+ removalDate: valueof string,
94
+ description: valueof string
62
95
  );
63
96
 
64
97
  /**
65
- * TODO: Enable this once Model type is supported. https://github.com/microsoft/typespec/issues/1655
66
- *
67
98
  * `@entity` - mark a model as an entity type
68
99
  *
69
100
  * `@entity` can only be applied to models.
70
-
71
- extern dec entity(target: Model);
72
101
  */
102
+ extern dec entity(target: Model);
73
103
 
74
104
  /**
75
105
  * `@expand` - Applies to: get operations that return collections or individual instances of models that contain @contains or @references properties.
@@ -78,18 +108,71 @@ extern dec entity(target: Model);
78
108
  * `properties` - Property names in the model returned from the get that can be used in a $expand query parameter.
79
109
  * At least one property must be specified.
80
110
  */
81
- extern dec expand(target: Operation, property: string, ...otherProperties: string[]);
111
+ extern dec expand(target: Operation, property: valueof string, ...otherProperties: valueof string[]);
112
+
113
+ /**
114
+ * `@filter` - Applies to: get operations that return collections of @entity or @complex models.
115
+ * Indicates that the get operation supports OData $filter query parameter.
116
+ *
117
+ * `properties` - array of property names in the model returned
118
+ * from the get operation that can be used in $filter query parameter.
119
+ */
120
+ extern dec filter(target: Operation, property: valueof string, ...properties: valueof string[]);
121
+
82
122
 
83
123
  /**
84
- * TODO: Enable this once Model type is supported. https://github.com/microsoft/typespec/issues/1655
124
+ * `@flags` - mark an enumeration type as a flag.
85
125
  *
126
+ * `@flags` can only be applied to enums.
127
+ */
128
+ extern dec flags(target: Enum);
129
+
130
+ /**
131
+ * `@function` - mark an operation as a function
132
+ *
133
+ * `@function` can only be applied to operations.
134
+ */
135
+ extern dec function(target: Operation, name?: valueof string);
136
+
137
+ /**
138
+ * `@graphRoute` - mark an interface or operation with an HTTP route.
139
+ *
140
+ * `@graphRoute` - can only be applied to interfaces or operations.
141
+ */
142
+ // TODO: Using @graphRoute on an operation currently does not work due to the following TypeSpec core issue
143
+ // https://github.com/microsoft/typespec/issues/2106
144
+ // Disabling all related features while we await the outcome.
145
+ extern dec graphRoute(target: Interface /* | Operation */, path: valueof string);
146
+
147
+ /**
86
148
  * `@hasStream` - indicates that an `@entity` model has a stream.
87
149
  *
88
- * `mediaTypes` - list of media types supported by the stream.
89
- * If not specified, the stream supports any media type.
90
-
91
- extern dec hasStream(target: Model, ...mediaTypes: string[]);
150
+ * `mediaTypes` - list of media types supported by the stream. If not specified, the stream supports any media type.
151
+ */
152
+ extern dec hasStream(target: Model, ...mediaTypes: valueof string[]);
153
+
154
+ /**
155
+ * `@immutable` - mark a model property as immutable.
156
+ *
157
+ * `@immutable` can only be applied to model properties.
158
+ */
159
+ extern dec immutable(target: ModelProperty);
160
+
161
+ /**
162
+ * `@open` - mark a model type as open
163
+ *
164
+ * `@open` can only be applied to models.
92
165
  */
166
+ extern dec open(target: Model);
167
+
168
+ /**
169
+ * `@operationParameters` - A model with this decorator will not be generated in the CSDL
170
+ * and can't be reused by other models through inheritance,
171
+ * or any other way except through being a parameter for an action operation.
172
+ * The purpose of this model is only to define model parameters that would be too verbose.
173
+ * This decorator will be the equivalent of inlining the properties of the model into parameters of the operation.
174
+ */
175
+ extern dec operationParameters(target: Model);
93
176
 
94
177
  /**
95
178
  * `@orderBy` - Applies to: get operations that return collections of @entity or @complex models.
@@ -98,19 +181,30 @@ extern dec expand(target: Operation, property: string, ...otherProperties: strin
98
181
  * `properties` - List of property names in the model returned from the get operation that can be used in a $orderBy query parameter.
99
182
  * At least one property must be specified.
100
183
  */
101
- extern dec orderBy(target: Operation, property: string, ...otherProperties: string[]);
184
+ extern dec orderBy(target: Operation, property: valueof string, ...otherProperties: valueof string[]);
185
+
186
+ /**
187
+ * `@pagedCollection` - mark a model as representing a paged collection.
188
+ *
189
+ * `@pagedCollection` can only be applied to models.
190
+ */
191
+ extern dec pagedCollection(target: Model);
102
192
 
103
193
  /**
104
- * TODO: Enable this once Model type is supported. https://github.com/microsoft/typespec/issues/1655
194
+ * `@partial` - Mark a model as partial.
105
195
  *
196
+ * `@partial` can only be applied to models.
197
+ */
198
+ extern dec partial(target: Model, value: Model);
199
+
200
+ /**
106
201
  * `@privatePreview` - Allow us define a privatePreview element.
107
202
  * `@privatePreview` - Applies to models, model properties, enums, enum members, namespaces and operations.
108
-
203
+ */
109
204
  extern dec privatePreview(
110
205
  target: Model | ModelProperty | EnumMember | Enum | Operation | Namespace,
111
- name: string
112
- )
113
- */
206
+ name: valueof string
207
+ );
114
208
 
115
209
  /**
116
210
  * `@privatePreviewDefinition` - Allow us create a reusable private preview definition.
@@ -118,23 +212,25 @@ extern dec privatePreview(
118
212
  */
119
213
  extern dec privatePreviewDefinition(
120
214
  target: Namespace,
121
- name: string,
122
- announcementDate: string,
123
- removalDate: string,
124
- owner: string
215
+ name: valueof string,
216
+ announcementDate: valueof string,
217
+ removalDate: valueof string,
218
+ owner?: valueof string
125
219
  );
126
220
 
127
221
  /**
128
- * `@search` - Applies to: get operations that return collections.
129
- * Indicates that the get operation supports the OData $search query parameter.
222
+ * `@privileged` - mark the entity as privileged
223
+ *
224
+ * `@privileged` can be applied to Model, ModelProperty, Enum, EnumMember, Operation, Namespace.
130
225
  */
131
- extern dec search(target: Operation);
226
+ extern dec privileged(target: Model | ModelProperty | Enum | EnumMember | Operation | Namespace);
132
227
 
133
228
  /**
134
- * `@skip` - Applies to: get operations that return collections.
135
- * Indicates that the get operation supports the OData $skip query parameter.
229
+ * `@publicNamespace` - defines the namespace to be used in generating CSDL output for all elements contained within the namespace
230
+ *
231
+ * `@publicNamespace` can only be applied to namespaces.
136
232
  */
137
- extern dec skip(target: Operation);
233
+ extern dec publicNamespace(target: Namespace, name: valueof string);
138
234
 
139
235
  /**
140
236
  * `@readOnly` - mark a model property as readOnly property
@@ -150,6 +246,26 @@ extern dec readOnly(target: ModelProperty);
150
246
  */
151
247
  extern dec references(target: ModelProperty);
152
248
 
249
+ /**
250
+ * `@requiredForCreate` - mark a model property as required when a request is made to
251
+ * Graph to create or update a resource.
252
+ *
253
+ * `@requiredForCreate` can only be applied to model properties.
254
+ */
255
+ extern dec requiredForCreate(target: ModelProperty);
256
+
257
+ /**
258
+ * `@search` - Applies to: get operations that return collections.
259
+ * Indicates that the get operation supports the OData $search query parameter.
260
+ */
261
+ extern dec search(target: Operation);
262
+
263
+ /**
264
+ * `@skip` - Applies to: get operations that return collections.
265
+ * Indicates that the get operation supports the OData $skip query parameter.
266
+ */
267
+ extern dec skip(target: Operation);
268
+
153
269
  /**
154
270
  * `@top` - Applies to: get operations that return collections.
155
271
  * Indicates that the get operation supports the OData $top query parameter.
@@ -162,3 +278,30 @@ extern dec top(target: Operation);
162
278
  * `@writeOnly` can only be applied to model properties.
163
279
  */
164
280
  extern dec writeOnly(target: ModelProperty);
281
+
282
+ /**
283
+ * `@isOwner` - specify that this workload is the primary owner of this entity model
284
+ *
285
+ * `@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.
286
+ */
287
+ extern dec isOwner(target: Model | ModelProperty, value?: valueof boolean);
288
+
289
+ /**
290
+ * `@workloadName` - specifies the name used by the underlying workload
291
+ *
292
+ * `@workloadName` can be applied to Model, ModelProperty, Enum, EnumMember.
293
+ */
294
+ extern dec workloadName(
295
+ target: Model | ModelProperty | Enum | EnumMember,
296
+ workloadName: valueof string
297
+ );
298
+
299
+ /**
300
+ * `@workloadNameMsa` - specifies the name used by the underlying workload for consumer use cases
301
+ *
302
+ * `@workloadNameMsa` can be applied to Model, ModelProperty, Enum, EnumMember.
303
+ */
304
+ extern dec workloadNameMsa(
305
+ target: Model | ModelProperty | Enum | EnumMember,
306
+ workloadNameMsa: valueof string
307
+ );
@@ -0,0 +1,18 @@
1
+ namespace MsGraph.Deployment;
2
+
3
+ enum deploymentTargets {
4
+ prodBeta,
5
+ prodV1_0,
6
+ prodEdu,
7
+ ppeBeta,
8
+ ppeV1_0,
9
+ ppeEdu,
10
+ mooncakeBeta,
11
+ mooncakeV1_0,
12
+ fairfaxBeta,
13
+ fairfaxV1_0,
14
+ usNatBeta,
15
+ usNatV1_0,
16
+ usSecBeta,
17
+ usSecV1_0
18
+ }
package/lib/lib.tsp CHANGED
@@ -1,35 +1,19 @@
1
1
  import "../dist/src/index.js";
2
- import "@typespec/rest";
2
+ import "@typespec/http";
3
3
 
4
4
  using TypeSpec.Http;
5
- namespace TypeSpec.MsGraph;
5
+ namespace MsGraph;
6
6
 
7
7
  scalar date;
8
8
 
9
9
  scalar stream;
10
10
 
11
- model ResourceResponse {}
11
+ scalar guid extends string;
12
12
 
13
13
  model EmptyParameters {}
14
14
 
15
- model PagedListResponse {}
15
+ // --- Base interfaces for all interfaces that contain operations returning entities.
16
16
 
17
- interface Item<T> {
18
- @head _isOperation(@path id: string): T;
19
- }
17
+ interface Resource<T> {}
20
18
 
21
- interface List<T> {
22
- @head _isOperation(): T[];
23
- }
24
-
25
- interface Singleton<T> {
26
- @head _isNavigationSource(@path id: string): T;
27
- }
28
-
29
- interface EntitySet<T> {
30
- @head _isNavigationSource(): T[];
31
- }
32
-
33
- interface EntitySetResource<T> {
34
- @head _isNavigationSource(@path id: string): T[];
35
- }
19
+ interface Collection<T> {}
package/lib/msgraph.tsp CHANGED
@@ -1,2 +1,6 @@
1
1
  import "./lib.tsp";
2
+ import "./shared-models.tsp";
3
+ // TODO: import "./deployment.tsp";
4
+ import "./responses.tsp";
2
5
  import "./decorators.tsp";
6
+ import "./porcelain.tsp";
@@ -0,0 +1,135 @@
1
+ // -------------------------------------------------
2
+ // porcelain.tsp
3
+ // Operation templates to provide a much-simplified syntax for defining standard Graph operations.
4
+ // -------------------------------------------------
5
+ import "@typespec/http";
6
+ import "./lib.tsp";
7
+ import "./shared-models.tsp";
8
+ import "./responses.tsp";
9
+
10
+ using TypeSpec.Http;
11
+ using MsGraph;
12
+ using MsGraph.SharedModels;
13
+ using MsGraph.Responses;
14
+
15
+ namespace MsGraph;
16
+
17
+ namespace Foundations {
18
+
19
+ @doc("Foundational operations for individual resources and collections.")
20
+ interface GraphFoundations {
21
+ op Operation<TParams, TResponse, TErrorResponse>(
22
+ ...TParams
23
+ ): TResponse | TErrorResponse;
24
+
25
+ op ResourceOperation<
26
+ TResource extends {},
27
+ TParams,
28
+ TResponse,
29
+ TErrorResponse = ResourceErrorResponse
30
+ > is GraphFoundations.Operation<TParams, TResponse, TErrorResponse>;
31
+
32
+ op CollectionOperation<
33
+ TResource extends {},
34
+ TParams,
35
+ TResponse,
36
+ TErrorResponse = CollectionErrorResponse
37
+ > is GraphFoundations.Operation<TParams, TResponse, TErrorResponse>;
38
+ }
39
+ }
40
+
41
+ @doc("Primary operation shapes for Microsoft Graph")
42
+ interface GraphOps {
43
+
44
+ // TODO: This is how we should make $select standard for Graph. Define a select decorator and use it here.
45
+ // @select("*")
46
+ @get op GetCollection<
47
+ TResource extends {} = Automatic.CalculatedResourceType,
48
+ TParams = {... Automatic.GraphRouteParams},
49
+ TResponse = CollectionResponse<TResource>,
50
+ TErrorResponse = CollectionErrorResponse
51
+ > is Foundations.GraphFoundations.CollectionOperation<
52
+ TResource, TParams, TResponse, TErrorResponse>;
53
+
54
+ // @select("*")
55
+ @get op GetPagedCollection<
56
+ TResource extends {} = Automatic.CalculatedResourceType,
57
+ TParams = {... Automatic.GraphRouteParams},
58
+ TResponse = PagedCollectionResponse<TResource>,
59
+ TErrorResponse = CollectionErrorResponse
60
+ > is Foundations.GraphFoundations.CollectionOperation<
61
+ TResource, TParams, TResponse, TErrorResponse>;
62
+
63
+ // TODO: GetDelta? FUnction etc.?
64
+
65
+ // @select("*")
66
+ @post op Post<
67
+ TResource extends {} = Automatic.CalculatedResourceType,
68
+ TParams = { ... Automatic.GraphRouteParams, @body body: TResource },
69
+ TResponse = ResourceCreatedResponse<TResource>,
70
+ TErrorResponse = CollectionErrorResponse
71
+ > is Foundations.GraphFoundations.CollectionOperation<
72
+ TResource, TParams, TResponse, TErrorResponse>;
73
+
74
+ // @select("*")
75
+ @get op GetResource<
76
+ TResource extends {} = Automatic.CalculatedResourceType,
77
+ TParams = {... Automatic.GraphRouteParams},
78
+ TResponse = ResourceResponse<TResource>,
79
+ TErrorResponse = ResourceErrorResponse
80
+ > is Foundations.GraphFoundations.ResourceOperation<
81
+ TResource, TParams, TResponse, TErrorResponse>;
82
+
83
+ @delete op Delete<
84
+ TResource extends {} = Automatic.CalculatedResourceType,
85
+ TParams = {... Automatic.GraphRouteParams},
86
+ TResponse = EmptyResponse,
87
+ TErrorResponse = ResourceErrorResponse
88
+ > is Foundations.GraphFoundations.ResourceOperation<
89
+ TResource, TParams, TResponse, TErrorResponse>;
90
+
91
+ @patch op PatchNoResponse<
92
+ TResource extends {} = Automatic.CalculatedResourceType,
93
+ TParams = {... Automatic.GraphRouteParams},
94
+ TResponse = EmptyResponse,
95
+ TErrorResponse = ResourceErrorResponse
96
+ > is Foundations.GraphFoundations.ResourceOperation<
97
+ TResource, TParams, TResponse, TErrorResponse>;
98
+
99
+ // @select("*")
100
+ @patch op PatchWithResponse<
101
+ TResource extends {} = Automatic.CalculatedResourceType,
102
+ TParams = {... Automatic.GraphRouteParams},
103
+ TResponse = ResourceResponse<TResource>,
104
+ TErrorResponse = ResourceErrorResponse
105
+ > is Foundations.GraphFoundations.ResourceOperation<
106
+ TResource, TParams, TResponse, TErrorResponse>;
107
+
108
+ @put op PutNoResponse<
109
+ TResource extends {} = Automatic.CalculatedResourceType,
110
+ TParams = {... Automatic.GraphRouteParams},
111
+ TResponse = EmptyResponse,
112
+ TErrorResponse = ResourceErrorResponse
113
+ > is Foundations.GraphFoundations.ResourceOperation<
114
+ TResource, TParams, TResponse, TErrorResponse>;
115
+
116
+ // @select("*")
117
+ @put op PutWithResponse<
118
+ TResource extends {} = Automatic.CalculatedResourceType,
119
+ TParams = {... Automatic.GraphRouteParams},
120
+ TResponse = ResourceResponse<TResource>,
121
+ TErrorResponse = ResourceErrorResponse
122
+ > is Foundations.GraphFoundations.ResourceOperation<
123
+ TResource, TParams, TResponse, TErrorResponse>;
124
+
125
+ }
126
+
127
+ namespace Automatic {
128
+ @doc("Marker type to allow injection of parameters from @route decorator.")
129
+ model GraphRouteParams { graphRouteParams: string }
130
+
131
+ // TODO: Needs direct support in the graphRoute decorator code to be able to make use of this.
132
+ @doc("Marker type to indicate to emitter that it should calculate resource from the Resource type of the containing interface's extended interface.")
133
+ model CalculatedResourceType {}
134
+ }
135
+
@@ -0,0 +1,82 @@
1
+ // -------------------------------------------------
2
+ // responses.tsp
3
+ // Standard responses that Graph will return.
4
+ // -------------------------------------------------
5
+ import "@typespec/http";
6
+ import "@microsoft/typespec-msgraph";
7
+ import "./shared-models.tsp";
8
+
9
+ using TypeSpec.Http;
10
+ using MsGraph;
11
+ using MsGraph.SharedModels;
12
+
13
+ // Raw body models represent the content of the response body, without any additional metadata.
14
+ // Note that these are primarily marker types. CSDL has no notion of what actual body content is returned in such types,
15
+ // but by passing markers through, HIDI can translate to OpenAPI.
16
+ // The content of the types exists for other future emitters that run directly off TypeSpec.
17
+ namespace MsGraph.Responses.Bodies {
18
+
19
+ @error
20
+ model ErrorBody {
21
+ error: publicError;
22
+ }
23
+
24
+ model ResourceBody<TResource> {
25
+ ...TResource;
26
+ }
27
+
28
+ model CollectionBody<TResource> {
29
+ value: TResource[];
30
+ `@odata.count`?: int64;
31
+ }
32
+
33
+ @pagedCollection
34
+ model PagedCollectionBody<TResource> is CollectionBody<TResource> {
35
+ `@odata.nextLink`?: MsGraph.SharedModels.url;
36
+ }
37
+
38
+ @pagedCollection
39
+ @deltaCollection
40
+ model DeltaCollectionBody<TResource> is PagedCollectionBody<TResource> {
41
+ `@odata.deltaLink`?: MsGraph.SharedModels.url;
42
+ }
43
+ }
44
+
45
+ // Response models represent the response as a whole, including the status code, headers, and body.
46
+ namespace MsGraph.Responses {
47
+ @doc("Response to represent a Microsoft Graph collection response payload.")
48
+ model CollectionResponse<TResource, TStatus = 200, TBody = Bodies.CollectionBody<TResource>>
49
+ is Http.Response<TStatus> {
50
+ ...Http.Body<TBody>;
51
+ }
52
+
53
+ @doc("Response to represent a Microsoft Graph paged collection response payload.")
54
+ model PagedCollectionResponse<TResource, TStatus = 200, TBody = Bodies.PagedCollectionBody<TResource>>
55
+ is CollectionResponse<TResource, TStatus, TBody>;
56
+
57
+ @doc("Response to represent a Microsoft Graph individual resource response payload.")
58
+ model ResourceResponse<TResource, TStatus = 200, TBody = Bodies.ResourceBody<TResource>>
59
+ is Http.Response<TStatus> {
60
+ ...Http.Body<TBody>;
61
+ }
62
+
63
+ @doc("Response to represent a Microsoft Graph resource creation response payload.")
64
+ model ResourceCreatedResponse<TResource, TStatus = 201, TBody = Bodies.ResourceBody<TResource>>
65
+ is ResourceResponse<TResource, TStatus, TBody> {
66
+ ...Http.LocationHeader
67
+ }
68
+
69
+ @doc("Response to represent a Microsoft Graph empty response payload.")
70
+ model EmptyResponse
71
+ is Http.Response<204>;
72
+
73
+ @doc("Response to represent a Microsoft Graph error response payload.")
74
+ model ErrorResponse<TStatus>
75
+ is Http.Response<TStatus> {
76
+ ...Http.Body<Bodies.ErrorBody>;
77
+ }
78
+
79
+ alias ResourceErrorResponse = ErrorResponse<400 | 404 | 429>;
80
+ alias CollectionErrorResponse = ErrorResponse<400 | 429>;
81
+
82
+ }
@@ -0,0 +1,75 @@
1
+ // -------------------------------------------------
2
+ // shared-models.tsp
3
+ // Common types shared among many workloads on Microsoft Graph
4
+ // -------------------------------------------------
5
+ import "@microsoft/typespec-msgraph";
6
+
7
+ using MsGraph;
8
+
9
+ @publicNamespace("microsoft.graph")
10
+ namespace MsGraph.SharedModels;
11
+
12
+ // TODO: Spec how to deal with specified and unspecified ultimate base entities w.r.t. AGS runtime replacement policies. See #140
13
+ @doc("The primary entity base model for Microsoft Graph.")
14
+ @entity
15
+ model entity {
16
+ @key id: string;
17
+ }
18
+
19
+ @doc("Complex type to represent an identity principal by id, when a human-readable name is also useful.")
20
+ @complex
21
+ @open
22
+ model identity {
23
+ id: string;
24
+ displayName: string;
25
+ }
26
+
27
+ @doc("Complex type to represent a group of identity principals used at a point in time, such as createdBy, lastModifiedBy.")
28
+ @complex
29
+ @open
30
+ model identitySet {
31
+ user: identity | null;
32
+ device: identity | null;
33
+ application: identity | null;
34
+ }
35
+
36
+ @doc("Enum for identifying the format of a text string.")
37
+ enum bodyType {
38
+ text,
39
+ html
40
+ }
41
+
42
+ @doc("Complex type to represent a chunk of text that could be either plain text or html.")
43
+ @complex
44
+ model itemBody {
45
+ contentType: bodyType;
46
+ content: string;
47
+ }
48
+
49
+ @doc("Scalar type for URLs that would be expected to work in the browser address bar.")
50
+ scalar webUrl extends string;
51
+
52
+ @doc("Scalar type for URLs that represent Graph APIs.")
53
+ scalar url extends string;
54
+
55
+ @doc("Complex type to represent a nested error that potentially has other recursive nested errors.")
56
+ @complex
57
+ @open
58
+ model innerError {
59
+ code: string;
60
+ innererror: innerError | null;
61
+ }
62
+
63
+ @doc("""
64
+ Complex type to represent a standard Microsoft Graph error.
65
+ {code}: The error code.
66
+ """)
67
+ @complex
68
+ @error
69
+ model publicError {
70
+ code: string;
71
+ message: string;
72
+ target: string | null;
73
+ innererror: innerError | null;
74
+ details: publicError[];
75
+ }