@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-route.d.ts","sourceRoot":"","sources":["../../../src/rules/graph-route.ts"],"names":[],"mappings":"AAMA;;GAEG;AAEH,eAAO,MAAM,0BAA0B,mCAYrC,CAAC;AAyBH,eAAO,MAAM,gDAAgD,mCAY3D,CAAC"}
@@ -0,0 +1,97 @@
1
+ import { createRule } from "@typespec/lint";
2
+ import { reportDiagnostic } from "../lib.js";
3
+ import { extractParamsFromPath, getGraphRoutePaths, hasGraphRoute } from "../index.js";
4
+ import { getIdForType } from "../utils.js";
5
+ /**
6
+ * @graphRoute should not have a leading forward slash
7
+ */
8
+ export const graphRouteLeadingSlashRule = createRule({
9
+ name: "graph-route-leading-slash",
10
+ create({ program }) {
11
+ return {
12
+ interface: (interface_) => {
13
+ applyDiagnostics(program, interface_);
14
+ },
15
+ operation: (operation) => {
16
+ applyDiagnostics(program, operation);
17
+ },
18
+ };
19
+ },
20
+ });
21
+ const applyDiagnostics = (program, target) => {
22
+ if (!hasGraphRoute(program, target)) {
23
+ return;
24
+ }
25
+ const paths = getGraphRoutePaths(program, target);
26
+ if (paths === undefined) {
27
+ return;
28
+ }
29
+ for (const path of paths) {
30
+ if (path.startsWith("/")) {
31
+ reportDiagnostic(program, {
32
+ code: "decorator-invalid-use",
33
+ target: target,
34
+ messageId: "graphRoute",
35
+ format: {
36
+ decorator: "@graphRoute",
37
+ },
38
+ });
39
+ }
40
+ }
41
+ };
42
+ export const operationParametersMatchGraphRouteParametersRule = createRule({
43
+ name: "operation-parameters-match-graph-route-parameters",
44
+ create({ program }) {
45
+ return {
46
+ operation: (operation) => {
47
+ validateParametersForGraphRoute(program, operation);
48
+ },
49
+ interface: (theInterface) => {
50
+ validateParametersForGraphRoute(program, theInterface);
51
+ },
52
+ };
53
+ },
54
+ });
55
+ function validateParametersForGraphRoute(program, target) {
56
+ if (!hasGraphRoute(program, target)) {
57
+ return;
58
+ }
59
+ const routePaths = getGraphRoutePaths(program, target);
60
+ if (routePaths === undefined) {
61
+ return;
62
+ }
63
+ const operations = [];
64
+ if (target.kind === "Operation") {
65
+ operations.push(target);
66
+ }
67
+ else {
68
+ target.operations.forEach((operation) => operations.push(operation));
69
+ }
70
+ for (const operation of operations) {
71
+ if (isOperationUsingPorcelainSyntax(program, operation)) {
72
+ continue;
73
+ }
74
+ if (operation.parameters.properties.has("graphRouteParams")) {
75
+ continue;
76
+ }
77
+ for (const path of routePaths) {
78
+ const graphRouteParameters = extractParamsFromPath(path);
79
+ const missingParameters = graphRouteParameters.filter((param) => !operation.parameters.properties.has(param));
80
+ if (missingParameters.length) {
81
+ reportDiagnostic(program, {
82
+ code: "element-missing-dependencies",
83
+ target: operation,
84
+ messageId: "operationParameterMismatch",
85
+ format: {
86
+ operation: getIdForType(program, operation),
87
+ parameters: missingParameters.join(", "),
88
+ },
89
+ });
90
+ }
91
+ }
92
+ }
93
+ }
94
+ function isOperationUsingPorcelainSyntax(program, operation) {
95
+ return operation.sourceOperation ? isOperationUsingPorcelainSyntax(program, operation.sourceOperation) : getIdForType(program, operation) === "MsGraph.Foundations.Operation";
96
+ }
97
+ //# sourceMappingURL=graph-route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-route.js","sourceRoot":"","sources":["../../../src/rules/graph-route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM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,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CACvD,CAAC;YAEF,IAAI,iBAAiB,CAAC,MAAM,EAAE;gBAC5B,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,8BAA8B;oBACpC,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,4BAA4B;oBACvC,MAAM,EAAE;wBACN,SAAS,EAAE,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC;wBAC3C,UAAU,EAAE,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC;qBACzC;iBACF,CAAC,CAAC;aACJ;SACF;KACF;AACH,CAAC;AAED,SAAS,+BAA+B,CAAC,OAAgB,EAAE,SAAoB;IAC7E,OAAO,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,+BAA+B,CAAC,OAAO,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,+BAA+B,CAAC;AAChL,CAAC"}
@@ -1,21 +1,28 @@
1
1
  export * from "./abstract.js";
2
2
  export * from "./alternate-key.js";
3
+ export * from "./collection-navigation-properties-not-nullable.js";
3
4
  export * from "./computed.js";
4
5
  export * from "./contains.js";
5
6
  export * from "./count.js";
7
+ export * from "./disallowed-typespec-decorators.js";
6
8
  export * from "./entity.js";
9
+ export * from "./enum.js";
7
10
  export * from "./expand.js";
11
+ export * from "./extends-on-same-type.js";
12
+ export * from "./filter.js";
13
+ export * from "./function.js";
14
+ export * from "./graph-route.js";
8
15
  export * from "./has-stream.js";
16
+ export * from "./namespace.js";
9
17
  export * from "./open.js";
18
+ export * from "./operation-inside-interface.js";
10
19
  export * from "./order-by.js";
11
20
  export * from "./references.js";
21
+ export * from "./required-for-create.js";
12
22
  export * from "./search.js";
13
23
  export * from "./skip.js";
14
24
  export * from "./top.js";
15
- export declare const extendsOnSameTypeRule: import("@typespec/lint").LintRule;
16
- export declare const keyOnlyOnEntityNonNullablePrimitivePropertyRule: import("@typespec/lint").LintRule;
17
- export declare const operationInsideInterfaceRule: import("@typespec/lint").LintRule;
18
- export declare const voidFunctionRule: import("@typespec/lint").LintRule;
19
- export declare const disallowedTypeSpecDecoratorsRule: import("@typespec/lint").LintRule;
20
- export declare const useEvolvableEnumRule: import("@typespec/lint").LintRule;
25
+ export * from "./allowed-values.js";
26
+ export * from "./graph-route.js";
27
+ export * from "./partial.js";
21
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/index.ts"],"names":[],"mappings":"AAMA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AAEzB,eAAO,MAAM,qBAAqB,mCA+BhC,CAAC;AAEH,eAAO,MAAM,+CAA+C,mCAwC1D,CAAC;AAEH,eAAO,MAAM,4BAA4B,mCAkBvC,CAAC;AAEH,eAAO,MAAM,gBAAgB,mCAsB3B,CAAC;AAEH,eAAO,MAAM,gCAAgC,mCA+B3C,CAAC;AAEH,eAAO,MAAM,oBAAoB,mCAuB/B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oDAAoD,CAAC;AACnE,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,qCAAqC,CAAC;AACpD,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,iCAAiC,CAAC;AAChD,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC"}
@@ -1,176 +1,28 @@
1
- import { isKey, isVoidType } from "@typespec/compiler";
2
- import { createRule } from "@typespec/lint";
3
- import { isComplex, isEntity, isFunction } from "../decorators/index.js";
4
- import { reportDiagnostic } from "../lib.js";
5
- import { isExcludedCoreType, isTypeNullable } from "../utils.js";
6
1
  export * from "./abstract.js";
7
2
  export * from "./alternate-key.js";
3
+ export * from "./collection-navigation-properties-not-nullable.js";
8
4
  export * from "./computed.js";
9
5
  export * from "./contains.js";
10
6
  export * from "./count.js";
7
+ export * from "./disallowed-typespec-decorators.js";
11
8
  export * from "./entity.js";
9
+ export * from "./enum.js";
12
10
  export * from "./expand.js";
11
+ export * from "./extends-on-same-type.js";
12
+ export * from "./filter.js";
13
+ export * from "./function.js";
14
+ export * from "./graph-route.js";
13
15
  export * from "./has-stream.js";
16
+ export * from "./namespace.js";
14
17
  export * from "./open.js";
18
+ export * from "./operation-inside-interface.js";
15
19
  export * from "./order-by.js";
16
20
  export * from "./references.js";
21
+ export * from "./required-for-create.js";
17
22
  export * from "./search.js";
18
23
  export * from "./skip.js";
19
24
  export * from "./top.js";
20
- export const extendsOnSameTypeRule = createRule({
21
- name: "extends-on-same-type",
22
- create({ program }) {
23
- return {
24
- model: (model) => {
25
- if (!model.baseModel) {
26
- return;
27
- }
28
- if (isEntity(program, model) && !isEntity(program, model.baseModel)) {
29
- reportDiagnostic(program, {
30
- code: "extends-invalid-use",
31
- target: model,
32
- format: {
33
- type: "@entity",
34
- },
35
- });
36
- }
37
- if (isComplex(program, model) && !isComplex(program, model.baseModel)) {
38
- reportDiagnostic(program, {
39
- code: "extends-invalid-use",
40
- target: model,
41
- format: {
42
- type: "@complex",
43
- },
44
- });
45
- }
46
- },
47
- };
48
- },
49
- });
50
- export const keyOnlyOnEntityNonNullablePrimitivePropertyRule = createRule({
51
- name: "key-only-on-entity-non-nullable-primitive-property",
52
- create({ program }) {
53
- return {
54
- modelProperty: (property) => {
55
- if (!property.model || !isKey(program, property)) {
56
- return;
57
- }
58
- if (!isEntity(program, property.model)) {
59
- reportDiagnostic(program, {
60
- code: "decorator-missing-dependencies",
61
- target: property,
62
- format: {
63
- decorator: "@key",
64
- required: "@entity",
65
- location: "entity model",
66
- },
67
- });
68
- return;
69
- }
70
- if (isTypeNullable(program, property.type) ||
71
- property.type.kind !== "Scalar" ||
72
- property.name === "Array") {
73
- reportDiagnostic(program, {
74
- code: "decorator-invalid-use",
75
- target: property,
76
- messageId: "key",
77
- format: {},
78
- });
79
- return;
80
- }
81
- },
82
- };
83
- },
84
- });
85
- export const operationInsideInterfaceRule = createRule({
86
- name: "operation-inside-interface",
87
- create({ program }) {
88
- return {
89
- operation: (operation) => {
90
- if (operation.interface) {
91
- return;
92
- }
93
- reportDiagnostic(program, {
94
- code: "element-missing-dependencies",
95
- target: operation,
96
- messageId: "operation",
97
- format: {},
98
- });
99
- },
100
- };
101
- },
102
- });
103
- export const voidFunctionRule = createRule({
104
- name: "void-function",
105
- create({ program }) {
106
- return {
107
- operation: (operation) => {
108
- if (!isFunction(program, operation)) {
109
- return;
110
- }
111
- if (!isVoidType(operation.returnType)) {
112
- return;
113
- }
114
- reportDiagnostic(program, {
115
- code: "decorator-missing-dependencies",
116
- target: operation,
117
- messageId: "function",
118
- format: {},
119
- });
120
- },
121
- };
122
- },
123
- });
124
- export const disallowedTypeSpecDecoratorsRule = createRule({
125
- name: "disallowed-typespec-decorators",
126
- create({ program }) {
127
- return {
128
- decorator: (decorator) => {
129
- const denyList = [
130
- "@friendlyName",
131
- "@secret",
132
- "@summary",
133
- "@tag",
134
- "@visibility",
135
- "@withVisibility",
136
- "@withUpdateableProperties",
137
- "@withDefaultKeyVisibility",
138
- ];
139
- if (denyList.indexOf(decorator.name) < 0) {
140
- return;
141
- }
142
- reportDiagnostic(program, {
143
- code: "decorator-invalid-use",
144
- target: decorator.target,
145
- messageId: "disallowedTypeSpecDecorators",
146
- format: {
147
- decorator: decorator.name,
148
- },
149
- });
150
- },
151
- };
152
- },
153
- });
154
- export const useEvolvableEnumRule = createRule({
155
- name: "use-evolvable-enum",
156
- create({ program }) {
157
- return {
158
- enum: (enumType) => {
159
- if (isExcludedCoreType(program, enumType)) {
160
- return;
161
- }
162
- if (enumType.members.has("unknownFutureValue")) {
163
- return;
164
- }
165
- reportDiagnostic(program, {
166
- code: "use-evolvable-enum",
167
- target: enumType,
168
- format: {
169
- enum: enumType.name,
170
- },
171
- });
172
- },
173
- };
174
- },
175
- });
25
+ export * from "./allowed-values.js";
26
+ export * from "./graph-route.js";
27
+ export * from "./partial.js";
176
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,cAAc,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,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const namespaceIsRequiredRule: import("@typespec/lint").LintRule;
2
+ export declare const invalidPublicNamespaceNameRule: import("@typespec/lint").LintRule;
3
+ //# sourceMappingURL=namespace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../../../src/rules/namespace.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,uBAAuB,mCA2BlC,CAAC;AAEH,eAAO,MAAM,8BAA8B,mCA6BzC,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { createRule } from "@typespec/lint";
2
+ import { reportDiagnostic } from "../lib.js";
3
+ import { getPublicNamespaceName, hasPublicNamespace } from "../index.js";
4
+ import { getNamespaceFullName } from "@typespec/compiler";
5
+ export const namespaceIsRequiredRule = createRule({
6
+ name: "namespace-is-required",
7
+ create({ program }) {
8
+ return {
9
+ model: (model) => {
10
+ if (model.namespace && model.namespace.name) {
11
+ return;
12
+ }
13
+ while (model.baseModel) {
14
+ model = model.baseModel;
15
+ if (model.namespace && model.namespace.name) {
16
+ return;
17
+ }
18
+ }
19
+ reportDiagnostic(program, {
20
+ code: "element-missing-dependencies",
21
+ target: model,
22
+ messageId: "modelMissingNamespace",
23
+ format: {
24
+ model: model.name,
25
+ },
26
+ });
27
+ },
28
+ };
29
+ },
30
+ });
31
+ export const invalidPublicNamespaceNameRule = createRule({
32
+ name: "invalid-public-namespace-name",
33
+ create({ program }) {
34
+ return {
35
+ namespace: (namespace) => {
36
+ if (!hasPublicNamespace(program, namespace)) {
37
+ return;
38
+ }
39
+ // publicNamespace name should either be "microsoft.graph"
40
+ // or match the pattern "microsoft.graph.<string_token>"
41
+ const namespaceRegex = /microsoft\.graph\.[\w]+/;
42
+ const publicNamespaceName = getPublicNamespaceName(program, namespace);
43
+ if (publicNamespaceName === "microsoft.graph" || namespaceRegex.test(publicNamespaceName)) {
44
+ return;
45
+ }
46
+ reportDiagnostic(program, {
47
+ code: "decorator-invalid-use",
48
+ target: namespace,
49
+ messageId: "invalidPublicNamespaceName",
50
+ format: {
51
+ namespace: getNamespaceFullName(namespace),
52
+ },
53
+ });
54
+ },
55
+ };
56
+ },
57
+ });
58
+ //# sourceMappingURL=namespace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namespace.js","sourceRoot":"","sources":["../../../src/rules/namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,MAAM,CAAC,MAAM,uBAAuB,GAAG,UAAU,CAAC;IAChD,IAAI,EAAE,uBAAuB;IAC7B,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;gBACf,IAAI,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE;oBAC3C,OAAO;iBACR;gBAED,OAAO,KAAK,CAAC,SAAS,EAAE;oBACtB,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC;oBACxB,IAAI,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE;wBAC3C,OAAO;qBACR;iBACF;gBAED,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,8BAA8B;oBACpC,MAAM,EAAE,KAAK;oBACb,SAAS,EAAE,uBAAuB;oBAClC,MAAM,EAAE;wBACN,KAAK,EAAE,KAAK,CAAC,IAAI;qBAClB;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,8BAA8B,GAAG,UAAU,CAAC;IACvD,IAAI,EAAE,+BAA+B;IACrC,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;gBACvB,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;oBAC3C,OAAO;iBACR;gBAED,0DAA0D;gBAC1D,wDAAwD;gBACxD,MAAM,cAAc,GAAG,yBAAyB,CAAC;gBACjD,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,OAAO,EAAE,SAAS,CAAE,CAAC;gBAExE,IAAI,mBAAmB,KAAK,iBAAiB,IAAI,cAAc,CAAC,IAAI,CAAC,mBAAmB,CAAC,EAAE;oBACzF,OAAO;iBACR;gBAED,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,uBAAuB;oBAC7B,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,4BAA4B;oBACvC,MAAM,EAAE;wBACN,SAAS,EAAE,oBAAoB,CAAC,SAAS,CAAC;qBAC3C;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const operationInsideInterfaceRule: import("@typespec/lint").LintRule;
2
+ //# sourceMappingURL=operation-inside-interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-inside-interface.d.ts","sourceRoot":"","sources":["../../../src/rules/operation-inside-interface.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,4BAA4B,mCAsBvC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { createRule } from "@typespec/lint";
2
+ import { reportDiagnostic } from "../lib.js";
3
+ import { isExcludedCoreType } from "../utils.js";
4
+ export const operationInsideInterfaceRule = createRule({
5
+ name: "operation-inside-interface",
6
+ create({ program }) {
7
+ return {
8
+ operation: (operation) => {
9
+ if (operation.interface) {
10
+ return;
11
+ }
12
+ if (isExcludedCoreType(program, operation)) {
13
+ return;
14
+ }
15
+ reportDiagnostic(program, {
16
+ code: "element-missing-dependencies",
17
+ target: operation,
18
+ messageId: "operation",
19
+ format: {},
20
+ });
21
+ },
22
+ };
23
+ },
24
+ });
25
+ //# sourceMappingURL=operation-inside-interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-inside-interface.js","sourceRoot":"","sources":["../../../src/rules/operation-inside-interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,CAAC,MAAM,4BAA4B,GAAG,UAAU,CAAC;IACrD,IAAI,EAAE,4BAA4B;IAClC,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;gBACvB,IAAI,SAAS,CAAC,SAAS,EAAE;oBACvB,OAAO;iBACR;gBAED,IAAI,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;oBAC1C,OAAO;iBACR;gBAED,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,8BAA8B;oBACpC,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,WAAW;oBACtB,MAAM,EAAE,EAAE;iBACX,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
- export declare const orderByOnlyOnGetNavigationSourceRule: import("@typespec/lint").LintRule;
1
+ export declare const orderByAppliesToGetOperationsThatReturnCollectionsRule: import("@typespec/lint").LintRule;
2
2
  export declare const orderByOnlyNonNavigationPropertiesRule: import("@typespec/lint").LintRule;
3
3
  //# sourceMappingURL=order-by.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"order-by.d.ts","sourceRoot":"","sources":["../../../src/rules/order-by.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,oCAAoC,mCA6B/C,CAAC;AAEH,eAAO,MAAM,sCAAsC,mCAyCjD,CAAC"}
1
+ {"version":3,"file":"order-by.d.ts","sourceRoot":"","sources":["../../../src/rules/order-by.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,sDAAsD,mCA6BjE,CAAC;AAEH,eAAO,MAAM,sCAAsC,mCAwCjD,CAAC"}
@@ -2,21 +2,23 @@ import { walkPropertiesInherited } from "@typespec/compiler";
2
2
  import { createRule } from "@typespec/lint";
3
3
  import { getOperationVerb } from "@typespec/http";
4
4
  import { getOrderBy, isContains, isOrderBy, isReferences } from "../index.js";
5
+ import { isTypeCollection } from "../utils.js";
5
6
  import { reportDiagnostic } from "../lib.js";
6
- export const orderByOnlyOnGetNavigationSourceRule = createRule({
7
- name: "order-by-only-on-get-navigation-source",
7
+ import { getNavigationSourceType } from "../utils.js";
8
+ export const orderByAppliesToGetOperationsThatReturnCollectionsRule = createRule({
9
+ name: "order-by-applies-to-get-operations-that-return-collections",
8
10
  create({ program }) {
9
11
  return {
10
12
  operation: (operation) => {
11
- var _a;
12
13
  if (!isOrderBy(program, operation)) {
13
14
  return;
14
15
  }
15
16
  if (getOperationVerb(program, operation) === "get") {
16
- return;
17
- }
18
- if ((_a = operation.interface) === null || _a === void 0 ? void 0 : _a.operations.has("_isNavigationSource")) {
19
- return;
17
+ const returnType = operation.returnType;
18
+ const isCollection = isTypeCollection(program, returnType);
19
+ if (isCollection) {
20
+ return;
21
+ }
20
22
  }
21
23
  reportDiagnostic(program, {
22
24
  code: "decorator-invalid-use",
@@ -24,7 +26,7 @@ export const orderByOnlyOnGetNavigationSourceRule = createRule({
24
26
  messageId: "wrongType",
25
27
  format: {
26
28
  decorator: "@orderBy",
27
- target: "get operation",
29
+ target: "get operation that returns a collection",
28
30
  },
29
31
  });
30
32
  },
@@ -36,12 +38,11 @@ export const orderByOnlyNonNavigationPropertiesRule = createRule({
36
38
  create({ program }) {
37
39
  return {
38
40
  operation: (operation) => {
39
- var _a, _b;
40
41
  const ordered = getOrderBy(program, operation);
41
42
  if (!ordered.length) {
42
43
  return;
43
44
  }
44
- const returnType = (_b = (_a = operation.interface) === null || _a === void 0 ? void 0 : _a.operations.get("_isNavigationSource")) === null || _b === void 0 ? void 0 : _b.returnType;
45
+ const returnType = getNavigationSourceType(program, operation);
45
46
  if (!returnType) {
46
47
  return;
47
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"order-by.js","sourceRoot":"","sources":["../../../src/rules/order-by.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,CAAC,MAAM,oCAAoC,GAAG,UAAU,CAAC;IAC7D,IAAI,EAAE,wCAAwC;IAC9C,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;;gBACvB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;oBAClC,OAAO;iBACR;gBAED,IAAI,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,KAAK,EAAE;oBAClD,OAAO;iBACR;gBAED,IAAI,MAAA,SAAS,CAAC,SAAS,0CAAE,UAAU,CAAC,GAAG,CAAC,qBAAqB,CAAC,EAAE;oBAC9D,OAAO;iB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,CAAC,IAAI,CAAC,CAAC;gBAEpC,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CACpC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,uBAAuB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAC1D,CAAC;gBAEF,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;oBAC3B,OAAO;iBACR;gBAED,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,uBAAuB;oBAC7B,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,mBAAmB;oBAC9B,MAAM,EAAE;wBACN,KAAK,EAAE,SAAS,CAAC,IAAI;wBACrB,UAAU,EAAE,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;qBACvC;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @partial applies to a model.
3
+ */
4
+ export declare const extendedModelBaseShouldMatchPartialBaseModel: import("@typespec/lint").LintRule;
5
+ //# sourceMappingURL=partial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partial.d.ts","sourceRoot":"","sources":["../../../src/rules/partial.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,eAAO,MAAM,4CAA4C,mCA0BvD,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { createRule } from "@typespec/lint";
2
+ import { getPartialReferenceModel, isPartial } from "../index.js";
3
+ import { reportDiagnostic } from "../lib.js";
4
+ /**
5
+ * @partial applies to a model.
6
+ */
7
+ export const extendedModelBaseShouldMatchPartialBaseModel = createRule({
8
+ name: "extended-model-base-should-match-partial-model-base",
9
+ create({ program }) {
10
+ return {
11
+ model: (model) => {
12
+ var _a, _b;
13
+ if (!isPartial(program, model)) {
14
+ return;
15
+ }
16
+ if (!(model === null || model === void 0 ? void 0 : model.baseModel)) {
17
+ return;
18
+ }
19
+ const partialReference = getPartialReferenceModel(program, model);
20
+ if (((_a = partialReference === null || partialReference === void 0 ? void 0 : partialReference.baseModel) === null || _a === void 0 ? void 0 : _a.name) !== ((_b = model === null || model === void 0 ? void 0 : model.baseModel) === null || _b === void 0 ? void 0 : _b.name)) {
21
+ reportDiagnostic(program, {
22
+ code: "decorator-invalid-use",
23
+ target: model,
24
+ messageId: "partial",
25
+ format: {
26
+ decorator: "@partial",
27
+ target: "model",
28
+ },
29
+ });
30
+ }
31
+ },
32
+ };
33
+ },
34
+ });
35
+ //# sourceMappingURL=partial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partial.js","sourceRoot":"","sources":["../../../src/rules/partial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG7C;;GAEG;AAEH,MAAM,CAAC,MAAM,4CAA4C,GAAG,UAAU,CAAC;IACrE,IAAI,EAAE,qDAAqD;IAC3D,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;;gBACf,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE;oBAC9B,OAAO;iBACR;gBACD,IAAG,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,CAAA,EAAC;oBACnB,OAAO;iBACR;gBACD,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;gBAClE,IAAG,CAAA,MAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,SAAS,0CAAE,IAAI,OAAK,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,0CAAE,IAAI,CAAA,EAAC;oBAC9D,gBAAgB,CAAC,OAAO,EAAE;wBACxB,IAAI,EAAE,uBAAuB;wBAC7B,MAAM,EAAE,KAAK;wBACb,SAAS,EAAE,SAAS;wBACpB,MAAM,EAAE;4BACN,SAAS,EAAE,UAAU;4BACrB,MAAM,EAAE,OAAO;yBAChB;qBACF,CAAC,CAAC;iBACJ;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const requiredRequestParametersRule: import("@typespec/lint").LintRule;
2
+ //# sourceMappingURL=required-for-create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"required-for-create.d.ts","sourceRoot":"","sources":["../../../src/rules/required-for-create.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,6BAA6B,mCAsCxC,CAAC"}