@takeshape/schema 11.52.0 → 11.55.0

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 (1024) hide show
  1. package/dist/__tests__/_examples.test.js +77 -0
  2. package/dist/__tests__/agents.test.js +163 -0
  3. package/dist/__tests__/api-version.test.js +24 -0
  4. package/dist/__tests__/builtin-schema.test.js +18 -0
  5. package/dist/__tests__/content-schema-transform.test.d.ts +1 -0
  6. package/dist/__tests__/content-schema-transform.test.js +522 -0
  7. package/dist/__tests__/create-input-schema.test.d.ts +1 -0
  8. package/dist/__tests__/create-input-schema.test.js +184 -0
  9. package/dist/__tests__/enum.test.d.ts +1 -0
  10. package/dist/__tests__/enum.test.js +36 -0
  11. package/dist/__tests__/flatten-templates.test.d.ts +1 -0
  12. package/dist/__tests__/flatten-templates.test.js +40 -0
  13. package/dist/__tests__/get-is-leaf.test.d.ts +1 -0
  14. package/dist/__tests__/get-is-leaf.test.js +50 -0
  15. package/dist/__tests__/interfaces.test.d.ts +1 -0
  16. package/dist/__tests__/interfaces.test.js +219 -0
  17. package/dist/__tests__/migration.test.d.ts +1 -0
  18. package/dist/__tests__/migration.test.js +34 -0
  19. package/dist/__tests__/mocks.test.d.ts +1 -0
  20. package/dist/__tests__/mocks.test.js +24 -0
  21. package/dist/__tests__/refs.test.d.ts +1 -0
  22. package/dist/__tests__/refs.test.js +752 -0
  23. package/dist/__tests__/relationships.test.d.ts +1 -0
  24. package/dist/__tests__/relationships.test.js +638 -0
  25. package/dist/__tests__/schema-transform.test.d.ts +1 -0
  26. package/dist/__tests__/schema-transform.test.js +205 -0
  27. package/dist/__tests__/schema-util.test.d.ts +1 -0
  28. package/dist/__tests__/schema-util.test.js +1731 -0
  29. package/dist/__tests__/service-dependencies.test.d.ts +1 -0
  30. package/dist/__tests__/service-dependencies.test.js +360 -0
  31. package/dist/__tests__/unions.test.d.ts +1 -0
  32. package/dist/__tests__/unions.test.js +44 -0
  33. package/dist/__tests__/validate.test.d.ts +1 -0
  34. package/dist/__tests__/validate.test.js +1926 -0
  35. package/dist/__tests__/workflows.test.d.ts +3 -0
  36. package/dist/__tests__/workflows.test.js +149 -0
  37. package/dist/agents.d.ts +14 -0
  38. package/dist/auth-schemas.d.ts +125 -0
  39. package/dist/builtin-schema.d.ts +8 -0
  40. package/dist/content-schema-transform.d.ts +35 -0
  41. package/dist/content-schema-transform.js +162 -0
  42. package/dist/create-input-schema.d.ts +9 -0
  43. package/dist/enum.d.ts +2 -0
  44. package/dist/flatten-templates.d.ts +2 -0
  45. package/dist/flatten-templates.js +20 -0
  46. package/dist/get-is-leaf.d.ts +3 -0
  47. package/dist/get-is-leaf.js +56 -0
  48. package/dist/index.d.ts +48 -0
  49. package/dist/index.js +46 -0
  50. package/dist/interfaces.d.ts +12 -0
  51. package/dist/interfaces.js +85 -0
  52. package/dist/layers/__tests__/layers.test.d.ts +1 -0
  53. package/dist/layers/__tests__/layers.test.js +38 -0
  54. package/dist/layers/layers.d.ts +26 -0
  55. package/dist/layers/layers.js +301 -0
  56. package/dist/layers/refs.d.ts +102 -0
  57. package/dist/layers/refs.js +220 -0
  58. package/dist/layers/type-utils.d.ts +59 -0
  59. package/dist/layers/type-utils.js +118 -0
  60. package/dist/layers/visitor.d.ts +5 -0
  61. package/dist/layers/visitor.js +38 -0
  62. package/dist/migration/index.d.ts +64 -0
  63. package/dist/migration/index.js +122 -0
  64. package/dist/migration/to/__tests__/v3.10.0.test.d.ts +1 -0
  65. package/dist/migration/to/__tests__/v3.10.0.test.js +90 -0
  66. package/dist/migration/to/__tests__/v3.12.3.test.d.ts +1 -0
  67. package/dist/migration/to/__tests__/v3.12.3.test.js +103 -0
  68. package/dist/migration/to/__tests__/v3.17.test.d.ts +1 -0
  69. package/dist/migration/to/__tests__/v3.17.test.js +71 -0
  70. package/dist/migration/to/__tests__/v3.34.0.test.d.ts +1 -0
  71. package/dist/migration/to/__tests__/v3.34.0.test.js +240 -0
  72. package/dist/migration/to/__tests__/v3.39.0.test.d.ts +1 -0
  73. package/dist/migration/to/__tests__/v3.39.0.test.js +116 -0
  74. package/dist/migration/to/__tests__/v3.46.0.test.d.ts +1 -0
  75. package/dist/migration/to/__tests__/v3.46.0.test.js +59 -0
  76. package/dist/migration/to/v3.0.0.d.ts +4 -0
  77. package/dist/migration/to/v3.0.0.js +212 -0
  78. package/dist/migration/to/v3.1.0.d.ts +4 -0
  79. package/dist/migration/to/v3.1.0.js +194 -0
  80. package/dist/migration/to/v3.10.0.d.ts +4 -0
  81. package/dist/migration/to/v3.11.0.d.ts +4 -0
  82. package/dist/migration/to/v3.12.0.d.ts +4 -0
  83. package/dist/migration/to/v3.12.1.d.ts +4 -0
  84. package/dist/migration/to/v3.12.2.d.ts +4 -0
  85. package/dist/migration/to/v3.12.3.d.ts +4 -0
  86. package/dist/migration/to/v3.13.0.d.ts +4 -0
  87. package/dist/migration/to/v3.14.0.d.ts +4 -0
  88. package/dist/migration/to/v3.15.0.d.ts +4 -0
  89. package/dist/migration/to/v3.16.0.d.ts +4 -0
  90. package/dist/migration/to/v3.17.0.d.ts +4 -0
  91. package/dist/migration/to/v3.17.1.d.ts +4 -0
  92. package/dist/migration/to/v3.18.0.d.ts +4 -0
  93. package/dist/migration/to/v3.18.1.d.ts +4 -0
  94. package/dist/migration/to/v3.18.2.d.ts +4 -0
  95. package/dist/migration/to/v3.19.0.d.ts +4 -0
  96. package/dist/migration/to/v3.2.0.d.ts +4 -0
  97. package/dist/migration/to/v3.20.0.d.ts +4 -0
  98. package/dist/migration/to/v3.21.0.d.ts +4 -0
  99. package/dist/migration/to/v3.22.0.d.ts +4 -0
  100. package/dist/migration/to/v3.23.0.d.ts +4 -0
  101. package/dist/migration/to/v3.24.0.d.ts +4 -0
  102. package/dist/migration/to/v3.25.0.d.ts +4 -0
  103. package/dist/migration/to/v3.26.0.d.ts +4 -0
  104. package/dist/migration/to/v3.27.0.d.ts +4 -0
  105. package/dist/migration/to/v3.28.0.d.ts +4 -0
  106. package/dist/migration/to/v3.29.0.d.ts +4 -0
  107. package/dist/migration/to/v3.3.0.d.ts +4 -0
  108. package/dist/migration/to/v3.30.0.d.ts +4 -0
  109. package/dist/migration/to/v3.31.0.d.ts +4 -0
  110. package/dist/migration/to/v3.32.0.d.ts +4 -0
  111. package/dist/migration/to/v3.32.0.js +59 -0
  112. package/dist/migration/to/v3.33.0.d.ts +4 -0
  113. package/dist/migration/to/v3.34.0.d.ts +6 -0
  114. package/dist/migration/to/v3.34.0.js +116 -0
  115. package/dist/migration/to/v3.35.0.d.ts +4 -0
  116. package/dist/migration/to/v3.36.0.d.ts +4 -0
  117. package/dist/migration/to/v3.37.0.d.ts +4 -0
  118. package/dist/migration/to/v3.38.0.d.ts +4 -0
  119. package/dist/migration/to/v3.39.0.d.ts +4 -0
  120. package/dist/migration/to/v3.39.0.js +45 -0
  121. package/dist/migration/to/v3.4.0.d.ts +4 -0
  122. package/dist/migration/to/v3.40.0.d.ts +4 -0
  123. package/dist/migration/to/v3.41.0.d.ts +4 -0
  124. package/dist/migration/to/v3.42.0.d.ts +4 -0
  125. package/dist/migration/to/v3.43.0.d.ts +4 -0
  126. package/dist/migration/to/v3.44.0.d.ts +4 -0
  127. package/dist/migration/to/v3.45.0.d.ts +4 -0
  128. package/dist/migration/to/v3.46.0.d.ts +4 -0
  129. package/dist/migration/to/v3.47.0.d.ts +4 -0
  130. package/dist/migration/to/v3.48.0.d.ts +4 -0
  131. package/dist/migration/to/v3.49.0.d.ts +4 -0
  132. package/dist/migration/to/v3.5.0.d.ts +4 -0
  133. package/dist/migration/to/v3.5.1.d.ts +4 -0
  134. package/dist/migration/to/v3.50.0.d.ts +4 -0
  135. package/dist/migration/to/v3.51.0.d.ts +4 -0
  136. package/dist/migration/to/v3.6.0.d.ts +4 -0
  137. package/dist/migration/to/v3.7.0.d.ts +4 -0
  138. package/dist/migration/to/v3.8.0.d.ts +4 -0
  139. package/dist/migration/to/v3.9.0.d.ts +4 -0
  140. package/dist/migration/types.d.ts +19 -0
  141. package/dist/migration/types.js +1 -0
  142. package/dist/mocks.d.ts +13 -0
  143. package/dist/mocks.js +58 -0
  144. package/dist/models/__tests__/project-schema.test.d.ts +1 -0
  145. package/dist/models/__tests__/project-schema.test.js +67 -0
  146. package/dist/models/__tests__/query.test.d.ts +1 -0
  147. package/dist/models/__tests__/query.test.js +27 -0
  148. package/dist/models/__tests__/service.test.d.ts +1 -0
  149. package/dist/models/__tests__/service.test.js +17 -0
  150. package/dist/models/__tests__/shape.test.d.ts +1 -0
  151. package/dist/models/__tests__/shape.test.js +61 -0
  152. package/dist/models/project-schema.d.ts +35 -0
  153. package/dist/models/project-schema.js +92 -0
  154. package/dist/models/query.d.ts +17 -0
  155. package/dist/models/service.d.ts +12 -0
  156. package/dist/models/shape.d.ts +41 -0
  157. package/dist/models/shape.js +85 -0
  158. package/dist/patterns.js +1 -0
  159. package/dist/project-schema/index.d.ts +187 -0
  160. package/dist/project-schema/index.js +75 -0
  161. package/dist/project-schema/migrate.d.ts +4 -0
  162. package/dist/project-schema/migrate.js +194 -0
  163. package/dist/refs.d.ts +226 -0
  164. package/dist/refs.js +608 -0
  165. package/dist/relationships.d.ts +40 -0
  166. package/dist/relationships.js +311 -0
  167. package/dist/runtime-schema.d.ts +5 -0
  168. package/dist/runtime-schema.js +80 -0
  169. package/dist/schema-transform.d.ts +19 -0
  170. package/dist/schema-transform.js +74 -0
  171. package/dist/schema-util.d.ts +210 -0
  172. package/dist/schema-util.js +1077 -0
  173. package/dist/schemas/auth-schemas.json +365 -0
  174. package/dist/schemas/index.js +154 -0
  175. package/dist/service-dependencies.d.ts +13 -0
  176. package/dist/service-dependencies.js +165 -0
  177. package/dist/services/__tests__/services.test.d.ts +1 -0
  178. package/dist/services/__tests__/services.test.js +113 -0
  179. package/dist/services/services.d.ts +31 -0
  180. package/dist/services/services.js +145 -0
  181. package/dist/services/types.js +1 -0
  182. package/dist/services/util.d.ts +16 -0
  183. package/dist/taxonomies.d.ts +15 -0
  184. package/dist/taxonomies.js +24 -0
  185. package/dist/template-shapes/__tests__/index.test.d.ts +1 -0
  186. package/dist/template-shapes/__tests__/index.test.js +40 -0
  187. package/dist/template-shapes/__tests__/names.test.d.ts +1 -0
  188. package/dist/template-shapes/__tests__/names.test.js +19 -0
  189. package/dist/template-shapes/__tests__/templates.test.d.ts +1 -0
  190. package/dist/template-shapes/__tests__/templates.test.js +80 -0
  191. package/dist/template-shapes/__tests__/where.test.d.ts +1 -0
  192. package/dist/template-shapes/__tests__/where.test.js +218 -0
  193. package/dist/template-shapes/index.d.ts +7 -0
  194. package/dist/template-shapes/names.d.ts +10 -0
  195. package/dist/template-shapes/templates.d.ts +32 -0
  196. package/dist/template-shapes/templates.js +319 -0
  197. package/dist/template-shapes/types.d.ts +15 -0
  198. package/dist/template-shapes/where.d.ts +37 -0
  199. package/dist/template-shapes/where.js +402 -0
  200. package/dist/types/__tests__/utils.test.d.ts +1 -0
  201. package/dist/types/__tests__/utils.test.js +159 -0
  202. package/dist/types/index.d.ts +3 -0
  203. package/dist/types/index.js +2 -0
  204. package/dist/types/transforms.d.ts +13 -0
  205. package/dist/types/transforms.js +1 -0
  206. package/dist/types/types.d.ts +211 -0
  207. package/dist/types/utils.d.ts +117 -0
  208. package/dist/types/utils.js +279 -0
  209. package/dist/unions.d.ts +14 -0
  210. package/dist/unions.js +77 -0
  211. package/dist/util/__tests__/api-indexing.test.d.ts +1 -0
  212. package/dist/util/__tests__/api-indexing.test.js +129 -0
  213. package/dist/util/__tests__/detect-cycles.test.d.ts +1 -0
  214. package/dist/util/__tests__/detect-cycles.test.js +193 -0
  215. package/dist/util/__tests__/find-shape-at-path.test.d.ts +1 -0
  216. package/dist/util/__tests__/find-shape-at-path.test.js +41 -0
  217. package/dist/util/__tests__/form-config.test.d.ts +1 -0
  218. package/dist/util/__tests__/form-config.test.js +196 -0
  219. package/dist/util/__tests__/get-return-shape.test.d.ts +1 -0
  220. package/dist/util/__tests__/get-return-shape.test.js +27 -0
  221. package/dist/util/__tests__/has-args.test.d.ts +1 -0
  222. package/dist/util/__tests__/has-args.test.js +46 -0
  223. package/dist/util/__tests__/merge.test.d.ts +1 -0
  224. package/dist/util/__tests__/merge.test.js +1074 -0
  225. package/dist/util/__tests__/patch-schema.test.d.ts +1 -0
  226. package/dist/util/__tests__/patch-schema.test.js +82 -0
  227. package/dist/util/__tests__/shapes.test.d.ts +1 -0
  228. package/dist/util/__tests__/shapes.test.js +30 -0
  229. package/dist/util/ai-tools.d.ts +3 -0
  230. package/dist/util/api-indexing.d.ts +9 -0
  231. package/dist/util/api-indexing.js +57 -0
  232. package/dist/util/detect-cycles.d.ts +7 -0
  233. package/dist/util/detect-cycles.js +45 -0
  234. package/dist/util/find-shape-at-path.d.ts +21 -0
  235. package/dist/util/form-config.d.ts +11 -0
  236. package/dist/util/form-config.js +62 -0
  237. package/dist/util/get-conflicting-properties.d.ts +6 -0
  238. package/dist/util/get-conflicting-properties.js +55 -0
  239. package/dist/util/get-return-shape.d.ts +4 -0
  240. package/dist/util/get-return-shape.js +30 -0
  241. package/dist/util/has-arg.d.ts +4 -0
  242. package/dist/util/has-arg.js +13 -0
  243. package/dist/util/merge.d.ts +15 -0
  244. package/dist/util/merge.js +256 -0
  245. package/dist/util/patch-schema.d.ts +8 -0
  246. package/dist/util/shapes.d.ts +5 -0
  247. package/dist/validate/errors.d.ts +3 -0
  248. package/dist/validate/errors.js +20 -0
  249. package/dist/validate/validate.d.ts +73 -0
  250. package/dist/validate/validate.js +1107 -0
  251. package/dist/versions.d.ts +4 -0
  252. package/dist/versions.js +4 -0
  253. package/dist/workflows.d.ts +14 -0
  254. package/dist/workflows.js +66 -0
  255. package/examples/latest/agent-schema.json +12 -4
  256. package/examples/latest/all-fields-shapes-inline.json +52 -18
  257. package/examples/latest/all-fields-shapes.json +76 -26
  258. package/examples/latest/betzino.json +3139 -902
  259. package/examples/latest/blog-schema.json +28 -8
  260. package/examples/latest/brewery-schema.json +25 -7
  261. package/examples/latest/clear-cache-schema.json +7 -3
  262. package/examples/latest/complex-project-schema.json +359 -98
  263. package/examples/latest/complex-schema.json +1754 -487
  264. package/examples/latest/edit-schema.json +11 -4
  265. package/examples/latest/fabric-ecommerce.json +838 -187
  266. package/examples/latest/frank-and-fred-schema.json +1753 -486
  267. package/examples/latest/klirr-schema.json +2411 -682
  268. package/examples/latest/layers/rick-and-morty-layer.json +32 -11
  269. package/examples/latest/layers/shopify-layer-2023-01.json +8637 -2206
  270. package/examples/latest/layers/shopify-storefront-2023-04.json +1714 -404
  271. package/examples/latest/layers/wordpress-2024-01.json +2746 -691
  272. package/examples/latest/massive-schema.json +584 -131
  273. package/examples/latest/mill-components-schema.json +125 -29
  274. package/examples/latest/nested-shape-arrays.json +19 -7
  275. package/examples/latest/one-earth.json +1113 -236
  276. package/examples/latest/pet-oneof-array.json +22 -7
  277. package/examples/latest/post-schema.json +20 -6
  278. package/examples/latest/pruned-shopify-product-schema.json +830 -185
  279. package/examples/latest/rag-example.json +15 -5
  280. package/examples/latest/real-world-schema.json +56 -14
  281. package/examples/latest/recursive-repeater-schema.json +11 -4
  282. package/examples/latest/recursive-schema.json +11 -4
  283. package/examples/latest/rick-and-morty-ast.json +174 -45
  284. package/examples/latest/rick-and-morty-graphql.json +100 -25
  285. package/examples/latest/rick-and-morty-rest.json +7 -3
  286. package/examples/latest/rick-and-morty-with-indexing.json +13 -5
  287. package/examples/latest/schema-where-filter.json +40 -11
  288. package/examples/latest/schema-with-repeater-draftjs.json +8 -3
  289. package/examples/latest/schema-with-rick-and-morty.json +4 -2
  290. package/examples/latest/shape-books-v3_2_0.json +71 -17
  291. package/examples/latest/shape-books.json +71 -17
  292. package/examples/latest/shape-editor-schema-edited.json +69 -23
  293. package/examples/latest/shape-editor-schema-initial.json +28 -10
  294. package/examples/latest/shapedb-crud-every-prop-type.json +22 -8
  295. package/examples/latest/shopify-lookbook.json +19 -5
  296. package/examples/latest/shopify-product-2022-07.json +3217 -726
  297. package/examples/latest/shopify-product-2023-04.json +4496 -1012
  298. package/examples/latest/shopify-store-with-widget.json +942 -213
  299. package/examples/latest/stripe-product-runtime-schema.json +277 -81
  300. package/examples/latest/stripe-starter-resolved.json +1953 -476
  301. package/examples/latest/user-schema-no-required.json +13 -3
  302. package/examples/latest/user-schema-with-defaults.json +27 -5
  303. package/examples/latest/valvoline-ai-demo.json +69 -17
  304. package/examples/latest/vector-search-schema.json +24 -8
  305. package/package.json +23 -24
  306. package/dist/cjs/package.json +0 -1
  307. package/dist/cjs/src/agents.js +0 -147
  308. package/dist/cjs/src/api-version.js +0 -24
  309. package/dist/cjs/src/auth-schemas.js +0 -8
  310. package/dist/cjs/src/builtin-schema.js +0 -616
  311. package/dist/cjs/src/constants.js +0 -4
  312. package/dist/cjs/src/content-schema-transform.js +0 -175
  313. package/dist/cjs/src/create-input-schema.js +0 -66
  314. package/dist/cjs/src/enum.js +0 -12
  315. package/dist/cjs/src/flatten-templates.js +0 -26
  316. package/dist/cjs/src/get-is-leaf.js +0 -59
  317. package/dist/cjs/src/index.js +0 -62
  318. package/dist/cjs/src/interfaces.js +0 -98
  319. package/dist/cjs/src/layers/layers.js +0 -313
  320. package/dist/cjs/src/layers/refs.js +0 -243
  321. package/dist/cjs/src/layers/type-utils.js +0 -145
  322. package/dist/cjs/src/layers/visitor.js +0 -42
  323. package/dist/cjs/src/migration/index.js +0 -142
  324. package/dist/cjs/src/migration/to/v3.0.0.js +0 -217
  325. package/dist/cjs/src/migration/to/v3.1.0.js +0 -199
  326. package/dist/cjs/src/migration/to/v3.10.0.js +0 -72
  327. package/dist/cjs/src/migration/to/v3.11.0.js +0 -90
  328. package/dist/cjs/src/migration/to/v3.12.0.js +0 -12
  329. package/dist/cjs/src/migration/to/v3.12.1.js +0 -12
  330. package/dist/cjs/src/migration/to/v3.12.2.js +0 -12
  331. package/dist/cjs/src/migration/to/v3.12.3.js +0 -92
  332. package/dist/cjs/src/migration/to/v3.13.0.js +0 -22
  333. package/dist/cjs/src/migration/to/v3.14.0.js +0 -12
  334. package/dist/cjs/src/migration/to/v3.15.0.js +0 -12
  335. package/dist/cjs/src/migration/to/v3.16.0.js +0 -12
  336. package/dist/cjs/src/migration/to/v3.17.0.js +0 -27
  337. package/dist/cjs/src/migration/to/v3.17.1.js +0 -12
  338. package/dist/cjs/src/migration/to/v3.18.0.js +0 -69
  339. package/dist/cjs/src/migration/to/v3.18.1.js +0 -20
  340. package/dist/cjs/src/migration/to/v3.18.2.js +0 -24
  341. package/dist/cjs/src/migration/to/v3.19.0.js +0 -12
  342. package/dist/cjs/src/migration/to/v3.2.0.js +0 -12
  343. package/dist/cjs/src/migration/to/v3.20.0.js +0 -29
  344. package/dist/cjs/src/migration/to/v3.21.0.js +0 -12
  345. package/dist/cjs/src/migration/to/v3.22.0.js +0 -30
  346. package/dist/cjs/src/migration/to/v3.23.0.js +0 -12
  347. package/dist/cjs/src/migration/to/v3.24.0.js +0 -13
  348. package/dist/cjs/src/migration/to/v3.25.0.js +0 -13
  349. package/dist/cjs/src/migration/to/v3.26.0.js +0 -12
  350. package/dist/cjs/src/migration/to/v3.27.0.js +0 -12
  351. package/dist/cjs/src/migration/to/v3.28.0.js +0 -12
  352. package/dist/cjs/src/migration/to/v3.29.0.js +0 -12
  353. package/dist/cjs/src/migration/to/v3.3.0.js +0 -15
  354. package/dist/cjs/src/migration/to/v3.30.0.js +0 -12
  355. package/dist/cjs/src/migration/to/v3.31.0.js +0 -43
  356. package/dist/cjs/src/migration/to/v3.32.0.js +0 -61
  357. package/dist/cjs/src/migration/to/v3.33.0.js +0 -12
  358. package/dist/cjs/src/migration/to/v3.34.0.js +0 -123
  359. package/dist/cjs/src/migration/to/v3.35.0.js +0 -12
  360. package/dist/cjs/src/migration/to/v3.36.0.js +0 -27
  361. package/dist/cjs/src/migration/to/v3.37.0.js +0 -12
  362. package/dist/cjs/src/migration/to/v3.38.0.js +0 -12
  363. package/dist/cjs/src/migration/to/v3.39.0.js +0 -47
  364. package/dist/cjs/src/migration/to/v3.4.0.js +0 -12
  365. package/dist/cjs/src/migration/to/v3.40.0.js +0 -31
  366. package/dist/cjs/src/migration/to/v3.41.0.js +0 -12
  367. package/dist/cjs/src/migration/to/v3.42.0.js +0 -12
  368. package/dist/cjs/src/migration/to/v3.43.0.js +0 -12
  369. package/dist/cjs/src/migration/to/v3.44.0.js +0 -12
  370. package/dist/cjs/src/migration/to/v3.45.0.js +0 -12
  371. package/dist/cjs/src/migration/to/v3.46.0.js +0 -37
  372. package/dist/cjs/src/migration/to/v3.47.0.js +0 -12
  373. package/dist/cjs/src/migration/to/v3.48.0.js +0 -12
  374. package/dist/cjs/src/migration/to/v3.49.0.js +0 -12
  375. package/dist/cjs/src/migration/to/v3.5.0.js +0 -12
  376. package/dist/cjs/src/migration/to/v3.5.1.js +0 -12
  377. package/dist/cjs/src/migration/to/v3.50.0.js +0 -12
  378. package/dist/cjs/src/migration/to/v3.51.0.js +0 -12
  379. package/dist/cjs/src/migration/to/v3.6.0.js +0 -12
  380. package/dist/cjs/src/migration/to/v3.7.0.js +0 -12
  381. package/dist/cjs/src/migration/to/v3.8.0.js +0 -12
  382. package/dist/cjs/src/migration/to/v3.9.0.js +0 -84
  383. package/dist/cjs/src/migration/types.js +0 -2
  384. package/dist/cjs/src/migration/utils.js +0 -10
  385. package/dist/cjs/src/mocks.js +0 -65
  386. package/dist/cjs/src/models/project-schema.js +0 -99
  387. package/dist/cjs/src/models/query.js +0 -35
  388. package/dist/cjs/src/models/service.js +0 -24
  389. package/dist/cjs/src/models/shape.js +0 -89
  390. package/dist/cjs/src/patterns.js +0 -2
  391. package/dist/cjs/src/project-schema/index.js +0 -156
  392. package/dist/cjs/src/project-schema/latest.js +0 -8
  393. package/dist/cjs/src/project-schema/migrate.js +0 -198
  394. package/dist/cjs/src/project-schema/v1.0.0.js +0 -8
  395. package/dist/cjs/src/project-schema/v3.0.0.js +0 -8
  396. package/dist/cjs/src/project-schema/v3.1.0.js +0 -8
  397. package/dist/cjs/src/project-schema/v3.10.0.js +0 -8
  398. package/dist/cjs/src/project-schema/v3.11.0.js +0 -8
  399. package/dist/cjs/src/project-schema/v3.12.0.js +0 -8
  400. package/dist/cjs/src/project-schema/v3.12.1.js +0 -8
  401. package/dist/cjs/src/project-schema/v3.12.2.js +0 -8
  402. package/dist/cjs/src/project-schema/v3.12.3.js +0 -8
  403. package/dist/cjs/src/project-schema/v3.13.0.js +0 -8
  404. package/dist/cjs/src/project-schema/v3.13.1.js +0 -8
  405. package/dist/cjs/src/project-schema/v3.14.0.js +0 -8
  406. package/dist/cjs/src/project-schema/v3.15.0.js +0 -8
  407. package/dist/cjs/src/project-schema/v3.16.0.js +0 -8
  408. package/dist/cjs/src/project-schema/v3.17.0.js +0 -8
  409. package/dist/cjs/src/project-schema/v3.17.1.js +0 -8
  410. package/dist/cjs/src/project-schema/v3.18.0.js +0 -8
  411. package/dist/cjs/src/project-schema/v3.18.1.js +0 -8
  412. package/dist/cjs/src/project-schema/v3.18.2.js +0 -8
  413. package/dist/cjs/src/project-schema/v3.19.0.js +0 -8
  414. package/dist/cjs/src/project-schema/v3.2.0.js +0 -8
  415. package/dist/cjs/src/project-schema/v3.20.0.js +0 -8
  416. package/dist/cjs/src/project-schema/v3.21.0.js +0 -8
  417. package/dist/cjs/src/project-schema/v3.22.0.js +0 -8
  418. package/dist/cjs/src/project-schema/v3.23.0.js +0 -8
  419. package/dist/cjs/src/project-schema/v3.24.0.js +0 -8
  420. package/dist/cjs/src/project-schema/v3.25.0.js +0 -8
  421. package/dist/cjs/src/project-schema/v3.26.0.js +0 -8
  422. package/dist/cjs/src/project-schema/v3.27.0.js +0 -8
  423. package/dist/cjs/src/project-schema/v3.28.0.js +0 -8
  424. package/dist/cjs/src/project-schema/v3.29.0.js +0 -8
  425. package/dist/cjs/src/project-schema/v3.3.0.js +0 -8
  426. package/dist/cjs/src/project-schema/v3.30.0.js +0 -8
  427. package/dist/cjs/src/project-schema/v3.31.0.js +0 -8
  428. package/dist/cjs/src/project-schema/v3.32.0.js +0 -8
  429. package/dist/cjs/src/project-schema/v3.33.0.js +0 -8
  430. package/dist/cjs/src/project-schema/v3.34.0.js +0 -8
  431. package/dist/cjs/src/project-schema/v3.35.0.js +0 -8
  432. package/dist/cjs/src/project-schema/v3.36.0.js +0 -8
  433. package/dist/cjs/src/project-schema/v3.37.0.js +0 -8
  434. package/dist/cjs/src/project-schema/v3.38.0.js +0 -8
  435. package/dist/cjs/src/project-schema/v3.39.0.js +0 -8
  436. package/dist/cjs/src/project-schema/v3.4.0.js +0 -8
  437. package/dist/cjs/src/project-schema/v3.40.0.js +0 -8
  438. package/dist/cjs/src/project-schema/v3.41.0.js +0 -8
  439. package/dist/cjs/src/project-schema/v3.42.0.js +0 -8
  440. package/dist/cjs/src/project-schema/v3.43.0.js +0 -8
  441. package/dist/cjs/src/project-schema/v3.44.0.js +0 -8
  442. package/dist/cjs/src/project-schema/v3.45.0.js +0 -8
  443. package/dist/cjs/src/project-schema/v3.46.0.js +0 -8
  444. package/dist/cjs/src/project-schema/v3.47.0.js +0 -8
  445. package/dist/cjs/src/project-schema/v3.48.0.js +0 -8
  446. package/dist/cjs/src/project-schema/v3.49.0.js +0 -8
  447. package/dist/cjs/src/project-schema/v3.5.0.js +0 -8
  448. package/dist/cjs/src/project-schema/v3.5.1.js +0 -8
  449. package/dist/cjs/src/project-schema/v3.50.0.js +0 -8
  450. package/dist/cjs/src/project-schema/v3.51.0.js +0 -8
  451. package/dist/cjs/src/project-schema/v3.6.0.js +0 -8
  452. package/dist/cjs/src/project-schema/v3.7.0.js +0 -8
  453. package/dist/cjs/src/project-schema/v3.8.0.js +0 -8
  454. package/dist/cjs/src/project-schema/v3.9.0.js +0 -8
  455. package/dist/cjs/src/project-schema/v4.0.0.js +0 -8
  456. package/dist/cjs/src/refs.js +0 -671
  457. package/dist/cjs/src/relationships.js +0 -326
  458. package/dist/cjs/src/runtime-schema.js +0 -88
  459. package/dist/cjs/src/scalars.js +0 -8
  460. package/dist/cjs/src/schema-transform.js +0 -83
  461. package/dist/cjs/src/schema-util.js +0 -1140
  462. package/dist/cjs/src/schemas/auth-schemas.json +0 -313
  463. package/dist/cjs/src/schemas/index.js +0 -162
  464. package/dist/cjs/src/schemas/user-schema.json +0 -51
  465. package/dist/cjs/src/service-dependencies.js +0 -172
  466. package/dist/cjs/src/services/services.js +0 -156
  467. package/dist/cjs/src/services/types.js +0 -2
  468. package/dist/cjs/src/services/util.js +0 -45
  469. package/dist/cjs/src/taxonomies.js +0 -28
  470. package/dist/cjs/src/template-shapes/index.js +0 -37
  471. package/dist/cjs/src/template-shapes/names.js +0 -26
  472. package/dist/cjs/src/template-shapes/templates.js +0 -331
  473. package/dist/cjs/src/template-shapes/types.js +0 -10
  474. package/dist/cjs/src/template-shapes/where.js +0 -414
  475. package/dist/cjs/src/types/index.js +0 -19
  476. package/dist/cjs/src/types/transforms.js +0 -2
  477. package/dist/cjs/src/types/types.js +0 -21
  478. package/dist/cjs/src/types/utils.js +0 -344
  479. package/dist/cjs/src/unions.js +0 -88
  480. package/dist/cjs/src/user-schema.js +0 -8
  481. package/dist/cjs/src/util/ai-tools.js +0 -10
  482. package/dist/cjs/src/util/api-indexing.js +0 -62
  483. package/dist/cjs/src/util/detect-cycles.js +0 -48
  484. package/dist/cjs/src/util/find-shape-at-path.js +0 -57
  485. package/dist/cjs/src/util/form-config.js +0 -66
  486. package/dist/cjs/src/util/get-conflicting-properties.js +0 -58
  487. package/dist/cjs/src/util/get-return-shape.js +0 -34
  488. package/dist/cjs/src/util/has-arg.js +0 -17
  489. package/dist/cjs/src/util/merge.js +0 -269
  490. package/dist/cjs/src/util/patch-schema.js +0 -55
  491. package/dist/cjs/src/util/shapes.js +0 -31
  492. package/dist/cjs/src/validate.js +0 -1140
  493. package/dist/cjs/src/versions.js +0 -8
  494. package/dist/cjs/src/workflows.js +0 -76
  495. package/dist/cjs/tsconfig.cjs.tsbuildinfo +0 -1
  496. package/dist/esm/package.json +0 -1
  497. package/dist/esm/src/content-schema-transform.js +0 -162
  498. package/dist/esm/src/flatten-templates.js +0 -20
  499. package/dist/esm/src/get-is-leaf.js +0 -56
  500. package/dist/esm/src/index.js +0 -46
  501. package/dist/esm/src/interfaces.js +0 -85
  502. package/dist/esm/src/layers/layers.js +0 -301
  503. package/dist/esm/src/layers/refs.js +0 -220
  504. package/dist/esm/src/layers/type-utils.js +0 -118
  505. package/dist/esm/src/layers/visitor.js +0 -38
  506. package/dist/esm/src/migration/index.js +0 -122
  507. package/dist/esm/src/migration/to/v3.0.0.js +0 -212
  508. package/dist/esm/src/migration/to/v3.1.0.js +0 -194
  509. package/dist/esm/src/migration/to/v3.32.0.js +0 -59
  510. package/dist/esm/src/migration/to/v3.34.0.js +0 -116
  511. package/dist/esm/src/migration/to/v3.39.0.js +0 -45
  512. package/dist/esm/src/mocks.js +0 -58
  513. package/dist/esm/src/models/project-schema.js +0 -92
  514. package/dist/esm/src/models/shape.js +0 -85
  515. package/dist/esm/src/project-schema/index.js +0 -138
  516. package/dist/esm/src/project-schema/migrate.js +0 -194
  517. package/dist/esm/src/refs.js +0 -608
  518. package/dist/esm/src/relationships.js +0 -311
  519. package/dist/esm/src/runtime-schema.js +0 -80
  520. package/dist/esm/src/schema-transform.js +0 -74
  521. package/dist/esm/src/schema-util.js +0 -1077
  522. package/dist/esm/src/schemas/auth-schemas.json +0 -313
  523. package/dist/esm/src/schemas/index.js +0 -154
  524. package/dist/esm/src/schemas/project-schema/experimental.json +0 -1101
  525. package/dist/esm/src/schemas/project-schema/latest.json +0 -3320
  526. package/dist/esm/src/schemas/project-schema/meta-schema-v1.0.0.json +0 -193
  527. package/dist/esm/src/schemas/project-schema/meta-schema-v3.0.0.json +0 -608
  528. package/dist/esm/src/schemas/project-schema/meta-schema-v3.1.0.json +0 -608
  529. package/dist/esm/src/schemas/project-schema/meta-schema-v3.2.0.json +0 -612
  530. package/dist/esm/src/schemas/project-schema/meta-schema-v3.3.0.json +0 -612
  531. package/dist/esm/src/schemas/project-schema/meta-schema-v3.4.0.json +0 -637
  532. package/dist/esm/src/schemas/project-schema/meta-schema-v3.5.0.json +0 -626
  533. package/dist/esm/src/schemas/project-schema/meta-schema-v3.5.1.json +0 -626
  534. package/dist/esm/src/schemas/project-schema/meta-schema-v3.6.0.json +0 -629
  535. package/dist/esm/src/schemas/project-schema/meta-schema-v3.7.0.json +0 -1137
  536. package/dist/esm/src/schemas/project-schema/meta-schema-v3.8.0.json +0 -1137
  537. package/dist/esm/src/schemas/project-schema/meta-schema-v3.9.0.json +0 -1477
  538. package/dist/esm/src/schemas/project-schema/v1.0.0.json +0 -321
  539. package/dist/esm/src/schemas/project-schema/v3.0.0.json +0 -414
  540. package/dist/esm/src/schemas/project-schema/v3.1.0.json +0 -572
  541. package/dist/esm/src/schemas/project-schema/v3.10.0.json +0 -2097
  542. package/dist/esm/src/schemas/project-schema/v3.11.0.json +0 -2141
  543. package/dist/esm/src/schemas/project-schema/v3.12.0.json +0 -2144
  544. package/dist/esm/src/schemas/project-schema/v3.12.1.json +0 -2282
  545. package/dist/esm/src/schemas/project-schema/v3.12.2.json +0 -2304
  546. package/dist/esm/src/schemas/project-schema/v3.12.3.json +0 -2357
  547. package/dist/esm/src/schemas/project-schema/v3.13.0.json +0 -2377
  548. package/dist/esm/src/schemas/project-schema/v3.14.0.json +0 -2385
  549. package/dist/esm/src/schemas/project-schema/v3.15.0.json +0 -2365
  550. package/dist/esm/src/schemas/project-schema/v3.16.0.json +0 -2373
  551. package/dist/esm/src/schemas/project-schema/v3.17.0.json +0 -2378
  552. package/dist/esm/src/schemas/project-schema/v3.17.1.json +0 -2380
  553. package/dist/esm/src/schemas/project-schema/v3.18.0.json +0 -2356
  554. package/dist/esm/src/schemas/project-schema/v3.18.1.json +0 -2357
  555. package/dist/esm/src/schemas/project-schema/v3.18.2.json +0 -2357
  556. package/dist/esm/src/schemas/project-schema/v3.19.0.json +0 -2369
  557. package/dist/esm/src/schemas/project-schema/v3.2.0.json +0 -580
  558. package/dist/esm/src/schemas/project-schema/v3.20.0.json +0 -2369
  559. package/dist/esm/src/schemas/project-schema/v3.21.0.json +0 -2376
  560. package/dist/esm/src/schemas/project-schema/v3.22.0.json +0 -2381
  561. package/dist/esm/src/schemas/project-schema/v3.23.0.json +0 -2456
  562. package/dist/esm/src/schemas/project-schema/v3.24.0.json +0 -2556
  563. package/dist/esm/src/schemas/project-schema/v3.25.0.json +0 -2552
  564. package/dist/esm/src/schemas/project-schema/v3.26.0.json +0 -2599
  565. package/dist/esm/src/schemas/project-schema/v3.27.0.json +0 -2611
  566. package/dist/esm/src/schemas/project-schema/v3.28.0.json +0 -2656
  567. package/dist/esm/src/schemas/project-schema/v3.29.0.json +0 -2670
  568. package/dist/esm/src/schemas/project-schema/v3.3.0.json +0 -581
  569. package/dist/esm/src/schemas/project-schema/v3.30.0.json +0 -2656
  570. package/dist/esm/src/schemas/project-schema/v3.31.0.json +0 -2714
  571. package/dist/esm/src/schemas/project-schema/v3.32.0.json +0 -2708
  572. package/dist/esm/src/schemas/project-schema/v3.33.0.json +0 -2715
  573. package/dist/esm/src/schemas/project-schema/v3.34.0.json +0 -2715
  574. package/dist/esm/src/schemas/project-schema/v3.35.0.json +0 -2748
  575. package/dist/esm/src/schemas/project-schema/v3.36.0.json +0 -2756
  576. package/dist/esm/src/schemas/project-schema/v3.37.0.json +0 -2821
  577. package/dist/esm/src/schemas/project-schema/v3.38.0.json +0 -2819
  578. package/dist/esm/src/schemas/project-schema/v3.39.0.json +0 -2827
  579. package/dist/esm/src/schemas/project-schema/v3.4.0.json +0 -571
  580. package/dist/esm/src/schemas/project-schema/v3.40.0.json +0 -2830
  581. package/dist/esm/src/schemas/project-schema/v3.41.0.json +0 -2830
  582. package/dist/esm/src/schemas/project-schema/v3.42.0.json +0 -2835
  583. package/dist/esm/src/schemas/project-schema/v3.43.0.json +0 -2841
  584. package/dist/esm/src/schemas/project-schema/v3.44.0.json +0 -3013
  585. package/dist/esm/src/schemas/project-schema/v3.45.0.json +0 -3064
  586. package/dist/esm/src/schemas/project-schema/v3.46.0.json +0 -3136
  587. package/dist/esm/src/schemas/project-schema/v3.47.0.json +0 -3189
  588. package/dist/esm/src/schemas/project-schema/v3.48.0.json +0 -3196
  589. package/dist/esm/src/schemas/project-schema/v3.49.0.json +0 -3239
  590. package/dist/esm/src/schemas/project-schema/v3.5.0.json +0 -571
  591. package/dist/esm/src/schemas/project-schema/v3.5.1.json +0 -571
  592. package/dist/esm/src/schemas/project-schema/v3.50.0.json +0 -3320
  593. package/dist/esm/src/schemas/project-schema/v3.51.0.json +0 -3320
  594. package/dist/esm/src/schemas/project-schema/v3.6.0.json +0 -587
  595. package/dist/esm/src/schemas/project-schema/v3.7.0.json +0 -587
  596. package/dist/esm/src/schemas/project-schema/v3.8.0.json +0 -604
  597. package/dist/esm/src/schemas/project-schema/v3.9.0.json +0 -604
  598. package/dist/esm/src/schemas/project-schema/v4.0.0.json +0 -2316
  599. package/dist/esm/src/schemas/project-schema.json +0 -190
  600. package/dist/esm/src/schemas/user-schema.json +0 -51
  601. package/dist/esm/src/service-dependencies.js +0 -165
  602. package/dist/esm/src/services/services.js +0 -145
  603. package/dist/esm/src/taxonomies.js +0 -24
  604. package/dist/esm/src/template-shapes/templates.js +0 -319
  605. package/dist/esm/src/template-shapes/where.js +0 -402
  606. package/dist/esm/src/types/index.js +0 -3
  607. package/dist/esm/src/types/utils.js +0 -279
  608. package/dist/esm/src/unions.js +0 -77
  609. package/dist/esm/src/user-schema.js +0 -7
  610. package/dist/esm/src/util/api-indexing.js +0 -57
  611. package/dist/esm/src/util/detect-cycles.js +0 -45
  612. package/dist/esm/src/util/form-config.js +0 -62
  613. package/dist/esm/src/util/get-conflicting-properties.js +0 -55
  614. package/dist/esm/src/util/get-return-shape.js +0 -30
  615. package/dist/esm/src/util/has-arg.js +0 -13
  616. package/dist/esm/src/util/merge.js +0 -256
  617. package/dist/esm/src/validate.js +0 -1126
  618. package/dist/esm/src/versions.js +0 -4
  619. package/dist/esm/src/workflows.js +0 -66
  620. package/dist/esm/tsconfig.esm.tsbuildinfo +0 -1
  621. package/dist/types/src/agents.d.ts +0 -14
  622. package/dist/types/src/auth-schemas.d.ts +0 -104
  623. package/dist/types/src/builtin-schema.d.ts +0 -8
  624. package/dist/types/src/content-schema-transform.d.ts +0 -35
  625. package/dist/types/src/create-input-schema.d.ts +0 -9
  626. package/dist/types/src/enum.d.ts +0 -2
  627. package/dist/types/src/flatten-templates.d.ts +0 -2
  628. package/dist/types/src/get-is-leaf.d.ts +0 -3
  629. package/dist/types/src/index.d.ts +0 -48
  630. package/dist/types/src/interfaces.d.ts +0 -12
  631. package/dist/types/src/layers/layers.d.ts +0 -26
  632. package/dist/types/src/layers/refs.d.ts +0 -102
  633. package/dist/types/src/layers/type-utils.d.ts +0 -59
  634. package/dist/types/src/layers/visitor.d.ts +0 -5
  635. package/dist/types/src/migration/index.d.ts +0 -64
  636. package/dist/types/src/migration/to/v3.0.0.d.ts +0 -4
  637. package/dist/types/src/migration/to/v3.1.0.d.ts +0 -4
  638. package/dist/types/src/migration/to/v3.10.0.d.ts +0 -4
  639. package/dist/types/src/migration/to/v3.11.0.d.ts +0 -4
  640. package/dist/types/src/migration/to/v3.12.0.d.ts +0 -4
  641. package/dist/types/src/migration/to/v3.12.1.d.ts +0 -4
  642. package/dist/types/src/migration/to/v3.12.2.d.ts +0 -4
  643. package/dist/types/src/migration/to/v3.12.3.d.ts +0 -4
  644. package/dist/types/src/migration/to/v3.13.0.d.ts +0 -4
  645. package/dist/types/src/migration/to/v3.14.0.d.ts +0 -4
  646. package/dist/types/src/migration/to/v3.15.0.d.ts +0 -4
  647. package/dist/types/src/migration/to/v3.16.0.d.ts +0 -4
  648. package/dist/types/src/migration/to/v3.17.0.d.ts +0 -4
  649. package/dist/types/src/migration/to/v3.17.1.d.ts +0 -4
  650. package/dist/types/src/migration/to/v3.18.0.d.ts +0 -4
  651. package/dist/types/src/migration/to/v3.18.1.d.ts +0 -4
  652. package/dist/types/src/migration/to/v3.18.2.d.ts +0 -4
  653. package/dist/types/src/migration/to/v3.19.0.d.ts +0 -4
  654. package/dist/types/src/migration/to/v3.2.0.d.ts +0 -4
  655. package/dist/types/src/migration/to/v3.20.0.d.ts +0 -4
  656. package/dist/types/src/migration/to/v3.21.0.d.ts +0 -4
  657. package/dist/types/src/migration/to/v3.22.0.d.ts +0 -4
  658. package/dist/types/src/migration/to/v3.23.0.d.ts +0 -4
  659. package/dist/types/src/migration/to/v3.24.0.d.ts +0 -4
  660. package/dist/types/src/migration/to/v3.25.0.d.ts +0 -4
  661. package/dist/types/src/migration/to/v3.26.0.d.ts +0 -4
  662. package/dist/types/src/migration/to/v3.27.0.d.ts +0 -4
  663. package/dist/types/src/migration/to/v3.28.0.d.ts +0 -4
  664. package/dist/types/src/migration/to/v3.29.0.d.ts +0 -4
  665. package/dist/types/src/migration/to/v3.3.0.d.ts +0 -4
  666. package/dist/types/src/migration/to/v3.30.0.d.ts +0 -4
  667. package/dist/types/src/migration/to/v3.31.0.d.ts +0 -4
  668. package/dist/types/src/migration/to/v3.32.0.d.ts +0 -4
  669. package/dist/types/src/migration/to/v3.33.0.d.ts +0 -4
  670. package/dist/types/src/migration/to/v3.34.0.d.ts +0 -6
  671. package/dist/types/src/migration/to/v3.35.0.d.ts +0 -4
  672. package/dist/types/src/migration/to/v3.36.0.d.ts +0 -4
  673. package/dist/types/src/migration/to/v3.37.0.d.ts +0 -4
  674. package/dist/types/src/migration/to/v3.38.0.d.ts +0 -4
  675. package/dist/types/src/migration/to/v3.39.0.d.ts +0 -4
  676. package/dist/types/src/migration/to/v3.4.0.d.ts +0 -4
  677. package/dist/types/src/migration/to/v3.40.0.d.ts +0 -4
  678. package/dist/types/src/migration/to/v3.41.0.d.ts +0 -4
  679. package/dist/types/src/migration/to/v3.42.0.d.ts +0 -4
  680. package/dist/types/src/migration/to/v3.43.0.d.ts +0 -4
  681. package/dist/types/src/migration/to/v3.44.0.d.ts +0 -4
  682. package/dist/types/src/migration/to/v3.45.0.d.ts +0 -4
  683. package/dist/types/src/migration/to/v3.46.0.d.ts +0 -4
  684. package/dist/types/src/migration/to/v3.47.0.d.ts +0 -4
  685. package/dist/types/src/migration/to/v3.48.0.d.ts +0 -4
  686. package/dist/types/src/migration/to/v3.49.0.d.ts +0 -4
  687. package/dist/types/src/migration/to/v3.5.0.d.ts +0 -4
  688. package/dist/types/src/migration/to/v3.5.1.d.ts +0 -4
  689. package/dist/types/src/migration/to/v3.50.0.d.ts +0 -4
  690. package/dist/types/src/migration/to/v3.51.0.d.ts +0 -4
  691. package/dist/types/src/migration/to/v3.6.0.d.ts +0 -4
  692. package/dist/types/src/migration/to/v3.7.0.d.ts +0 -4
  693. package/dist/types/src/migration/to/v3.8.0.d.ts +0 -4
  694. package/dist/types/src/migration/to/v3.9.0.d.ts +0 -4
  695. package/dist/types/src/migration/types.d.ts +0 -19
  696. package/dist/types/src/mocks.d.ts +0 -13
  697. package/dist/types/src/models/project-schema.d.ts +0 -35
  698. package/dist/types/src/models/query.d.ts +0 -17
  699. package/dist/types/src/models/service.d.ts +0 -12
  700. package/dist/types/src/models/shape.d.ts +0 -41
  701. package/dist/types/src/project-schema/index.d.ts +0 -187
  702. package/dist/types/src/project-schema/migrate.d.ts +0 -4
  703. package/dist/types/src/refs.d.ts +0 -226
  704. package/dist/types/src/relationships.d.ts +0 -40
  705. package/dist/types/src/runtime-schema.d.ts +0 -5
  706. package/dist/types/src/schema-transform.d.ts +0 -19
  707. package/dist/types/src/schema-util.d.ts +0 -210
  708. package/dist/types/src/service-dependencies.d.ts +0 -13
  709. package/dist/types/src/services/services.d.ts +0 -31
  710. package/dist/types/src/services/util.d.ts +0 -16
  711. package/dist/types/src/taxonomies.d.ts +0 -15
  712. package/dist/types/src/template-shapes/index.d.ts +0 -7
  713. package/dist/types/src/template-shapes/names.d.ts +0 -10
  714. package/dist/types/src/template-shapes/templates.d.ts +0 -32
  715. package/dist/types/src/template-shapes/types.d.ts +0 -15
  716. package/dist/types/src/template-shapes/where.d.ts +0 -37
  717. package/dist/types/src/types/index.d.ts +0 -3
  718. package/dist/types/src/types/transforms.d.ts +0 -13
  719. package/dist/types/src/types/types.d.ts +0 -211
  720. package/dist/types/src/types/utils.d.ts +0 -117
  721. package/dist/types/src/unions.d.ts +0 -14
  722. package/dist/types/src/user-schema.d.ts +0 -38
  723. package/dist/types/src/util/ai-tools.d.ts +0 -3
  724. package/dist/types/src/util/api-indexing.d.ts +0 -9
  725. package/dist/types/src/util/detect-cycles.d.ts +0 -7
  726. package/dist/types/src/util/find-shape-at-path.d.ts +0 -21
  727. package/dist/types/src/util/form-config.d.ts +0 -11
  728. package/dist/types/src/util/get-conflicting-properties.d.ts +0 -6
  729. package/dist/types/src/util/get-return-shape.d.ts +0 -4
  730. package/dist/types/src/util/has-arg.d.ts +0 -4
  731. package/dist/types/src/util/merge.d.ts +0 -15
  732. package/dist/types/src/util/patch-schema.d.ts +0 -8
  733. package/dist/types/src/util/shapes.d.ts +0 -5
  734. package/dist/types/src/validate.d.ts +0 -75
  735. package/dist/types/src/versions.d.ts +0 -4
  736. package/dist/types/src/workflows.d.ts +0 -14
  737. package/dist/types/tsconfig.types.tsbuildinfo +0 -1
  738. /package/dist/{esm/src/migration/types.js → __tests__/_examples.test.d.ts} +0 -0
  739. /package/dist/{esm/src/patterns.js → __tests__/agents.test.d.ts} +0 -0
  740. /package/dist/{esm/src/services/types.js → __tests__/api-version.test.d.ts} +0 -0
  741. /package/dist/{esm/src/types/transforms.js → __tests__/builtin-schema.test.d.ts} +0 -0
  742. /package/dist/{esm/src/agents.js → agents.js} +0 -0
  743. /package/dist/{types/src/api-version.d.ts → api-version.d.ts} +0 -0
  744. /package/dist/{esm/src/api-version.js → api-version.js} +0 -0
  745. /package/dist/{esm/src/auth-schemas.js → auth-schemas.js} +0 -0
  746. /package/dist/{esm/src/builtin-schema.js → builtin-schema.js} +0 -0
  747. /package/dist/{types/src/constants.d.ts → constants.d.ts} +0 -0
  748. /package/dist/{esm/src/constants.js → constants.js} +0 -0
  749. /package/dist/{esm/src/create-input-schema.js → create-input-schema.js} +0 -0
  750. /package/dist/{esm/src/enum.js → enum.js} +0 -0
  751. /package/dist/{esm/src/migration → migration}/to/v3.10.0.js +0 -0
  752. /package/dist/{esm/src/migration → migration}/to/v3.11.0.js +0 -0
  753. /package/dist/{esm/src/migration → migration}/to/v3.12.0.js +0 -0
  754. /package/dist/{esm/src/migration → migration}/to/v3.12.1.js +0 -0
  755. /package/dist/{esm/src/migration → migration}/to/v3.12.2.js +0 -0
  756. /package/dist/{esm/src/migration → migration}/to/v3.12.3.js +0 -0
  757. /package/dist/{esm/src/migration → migration}/to/v3.13.0.js +0 -0
  758. /package/dist/{esm/src/migration → migration}/to/v3.14.0.js +0 -0
  759. /package/dist/{esm/src/migration → migration}/to/v3.15.0.js +0 -0
  760. /package/dist/{esm/src/migration → migration}/to/v3.16.0.js +0 -0
  761. /package/dist/{esm/src/migration → migration}/to/v3.17.0.js +0 -0
  762. /package/dist/{esm/src/migration → migration}/to/v3.17.1.js +0 -0
  763. /package/dist/{esm/src/migration → migration}/to/v3.18.0.js +0 -0
  764. /package/dist/{esm/src/migration → migration}/to/v3.18.1.js +0 -0
  765. /package/dist/{esm/src/migration → migration}/to/v3.18.2.js +0 -0
  766. /package/dist/{esm/src/migration → migration}/to/v3.19.0.js +0 -0
  767. /package/dist/{esm/src/migration → migration}/to/v3.2.0.js +0 -0
  768. /package/dist/{esm/src/migration → migration}/to/v3.20.0.js +0 -0
  769. /package/dist/{esm/src/migration → migration}/to/v3.21.0.js +0 -0
  770. /package/dist/{esm/src/migration → migration}/to/v3.22.0.js +0 -0
  771. /package/dist/{esm/src/migration → migration}/to/v3.23.0.js +0 -0
  772. /package/dist/{esm/src/migration → migration}/to/v3.24.0.js +0 -0
  773. /package/dist/{esm/src/migration → migration}/to/v3.25.0.js +0 -0
  774. /package/dist/{esm/src/migration → migration}/to/v3.26.0.js +0 -0
  775. /package/dist/{esm/src/migration → migration}/to/v3.27.0.js +0 -0
  776. /package/dist/{esm/src/migration → migration}/to/v3.28.0.js +0 -0
  777. /package/dist/{esm/src/migration → migration}/to/v3.29.0.js +0 -0
  778. /package/dist/{esm/src/migration → migration}/to/v3.3.0.js +0 -0
  779. /package/dist/{esm/src/migration → migration}/to/v3.30.0.js +0 -0
  780. /package/dist/{esm/src/migration → migration}/to/v3.31.0.js +0 -0
  781. /package/dist/{esm/src/migration → migration}/to/v3.33.0.js +0 -0
  782. /package/dist/{esm/src/migration → migration}/to/v3.35.0.js +0 -0
  783. /package/dist/{esm/src/migration → migration}/to/v3.36.0.js +0 -0
  784. /package/dist/{esm/src/migration → migration}/to/v3.37.0.js +0 -0
  785. /package/dist/{esm/src/migration → migration}/to/v3.38.0.js +0 -0
  786. /package/dist/{esm/src/migration → migration}/to/v3.4.0.js +0 -0
  787. /package/dist/{esm/src/migration → migration}/to/v3.40.0.js +0 -0
  788. /package/dist/{esm/src/migration → migration}/to/v3.41.0.js +0 -0
  789. /package/dist/{esm/src/migration → migration}/to/v3.42.0.js +0 -0
  790. /package/dist/{esm/src/migration → migration}/to/v3.43.0.js +0 -0
  791. /package/dist/{esm/src/migration → migration}/to/v3.44.0.js +0 -0
  792. /package/dist/{esm/src/migration → migration}/to/v3.45.0.js +0 -0
  793. /package/dist/{esm/src/migration → migration}/to/v3.46.0.js +0 -0
  794. /package/dist/{esm/src/migration → migration}/to/v3.47.0.js +0 -0
  795. /package/dist/{esm/src/migration → migration}/to/v3.48.0.js +0 -0
  796. /package/dist/{esm/src/migration → migration}/to/v3.49.0.js +0 -0
  797. /package/dist/{esm/src/migration → migration}/to/v3.5.0.js +0 -0
  798. /package/dist/{esm/src/migration → migration}/to/v3.5.1.js +0 -0
  799. /package/dist/{esm/src/migration → migration}/to/v3.50.0.js +0 -0
  800. /package/dist/{esm/src/migration → migration}/to/v3.51.0.js +0 -0
  801. /package/dist/{esm/src/migration → migration}/to/v3.6.0.js +0 -0
  802. /package/dist/{esm/src/migration → migration}/to/v3.7.0.js +0 -0
  803. /package/dist/{esm/src/migration → migration}/to/v3.8.0.js +0 -0
  804. /package/dist/{esm/src/migration → migration}/to/v3.9.0.js +0 -0
  805. /package/dist/{types/src/migration → migration}/utils.d.ts +0 -0
  806. /package/dist/{esm/src/migration → migration}/utils.js +0 -0
  807. /package/dist/{esm/src/models → models}/query.js +0 -0
  808. /package/dist/{esm/src/models → models}/service.js +0 -0
  809. /package/dist/{types/src/patterns.d.ts → patterns.d.ts} +0 -0
  810. /package/dist/{types/src/project-schema → project-schema}/latest.d.ts +0 -0
  811. /package/dist/{esm/src/project-schema → project-schema}/latest.js +0 -0
  812. /package/dist/{types/src/project-schema → project-schema}/v1.0.0.d.ts +0 -0
  813. /package/dist/{esm/src/project-schema → project-schema}/v1.0.0.js +0 -0
  814. /package/dist/{types/src/project-schema → project-schema}/v3.0.0.d.ts +0 -0
  815. /package/dist/{esm/src/project-schema → project-schema}/v3.0.0.js +0 -0
  816. /package/dist/{types/src/project-schema → project-schema}/v3.1.0.d.ts +0 -0
  817. /package/dist/{esm/src/project-schema → project-schema}/v3.1.0.js +0 -0
  818. /package/dist/{types/src/project-schema → project-schema}/v3.10.0.d.ts +0 -0
  819. /package/dist/{esm/src/project-schema → project-schema}/v3.10.0.js +0 -0
  820. /package/dist/{types/src/project-schema → project-schema}/v3.11.0.d.ts +0 -0
  821. /package/dist/{esm/src/project-schema → project-schema}/v3.11.0.js +0 -0
  822. /package/dist/{types/src/project-schema → project-schema}/v3.12.0.d.ts +0 -0
  823. /package/dist/{esm/src/project-schema → project-schema}/v3.12.0.js +0 -0
  824. /package/dist/{types/src/project-schema → project-schema}/v3.12.1.d.ts +0 -0
  825. /package/dist/{esm/src/project-schema → project-schema}/v3.12.1.js +0 -0
  826. /package/dist/{types/src/project-schema → project-schema}/v3.12.2.d.ts +0 -0
  827. /package/dist/{esm/src/project-schema → project-schema}/v3.12.2.js +0 -0
  828. /package/dist/{types/src/project-schema → project-schema}/v3.12.3.d.ts +0 -0
  829. /package/dist/{esm/src/project-schema → project-schema}/v3.12.3.js +0 -0
  830. /package/dist/{types/src/project-schema → project-schema}/v3.13.0.d.ts +0 -0
  831. /package/dist/{esm/src/project-schema → project-schema}/v3.13.0.js +0 -0
  832. /package/dist/{types/src/project-schema → project-schema}/v3.13.1.d.ts +0 -0
  833. /package/dist/{esm/src/project-schema → project-schema}/v3.13.1.js +0 -0
  834. /package/dist/{types/src/project-schema → project-schema}/v3.14.0.d.ts +0 -0
  835. /package/dist/{esm/src/project-schema → project-schema}/v3.14.0.js +0 -0
  836. /package/dist/{types/src/project-schema → project-schema}/v3.15.0.d.ts +0 -0
  837. /package/dist/{esm/src/project-schema → project-schema}/v3.15.0.js +0 -0
  838. /package/dist/{types/src/project-schema → project-schema}/v3.16.0.d.ts +0 -0
  839. /package/dist/{esm/src/project-schema → project-schema}/v3.16.0.js +0 -0
  840. /package/dist/{types/src/project-schema → project-schema}/v3.17.0.d.ts +0 -0
  841. /package/dist/{esm/src/project-schema → project-schema}/v3.17.0.js +0 -0
  842. /package/dist/{types/src/project-schema → project-schema}/v3.17.1.d.ts +0 -0
  843. /package/dist/{esm/src/project-schema → project-schema}/v3.17.1.js +0 -0
  844. /package/dist/{types/src/project-schema → project-schema}/v3.18.0.d.ts +0 -0
  845. /package/dist/{esm/src/project-schema → project-schema}/v3.18.0.js +0 -0
  846. /package/dist/{types/src/project-schema → project-schema}/v3.18.1.d.ts +0 -0
  847. /package/dist/{esm/src/project-schema → project-schema}/v3.18.1.js +0 -0
  848. /package/dist/{types/src/project-schema → project-schema}/v3.18.2.d.ts +0 -0
  849. /package/dist/{esm/src/project-schema → project-schema}/v3.18.2.js +0 -0
  850. /package/dist/{types/src/project-schema → project-schema}/v3.19.0.d.ts +0 -0
  851. /package/dist/{esm/src/project-schema → project-schema}/v3.19.0.js +0 -0
  852. /package/dist/{types/src/project-schema → project-schema}/v3.2.0.d.ts +0 -0
  853. /package/dist/{esm/src/project-schema → project-schema}/v3.2.0.js +0 -0
  854. /package/dist/{types/src/project-schema → project-schema}/v3.20.0.d.ts +0 -0
  855. /package/dist/{esm/src/project-schema → project-schema}/v3.20.0.js +0 -0
  856. /package/dist/{types/src/project-schema → project-schema}/v3.21.0.d.ts +0 -0
  857. /package/dist/{esm/src/project-schema → project-schema}/v3.21.0.js +0 -0
  858. /package/dist/{types/src/project-schema → project-schema}/v3.22.0.d.ts +0 -0
  859. /package/dist/{esm/src/project-schema → project-schema}/v3.22.0.js +0 -0
  860. /package/dist/{types/src/project-schema → project-schema}/v3.23.0.d.ts +0 -0
  861. /package/dist/{esm/src/project-schema → project-schema}/v3.23.0.js +0 -0
  862. /package/dist/{types/src/project-schema → project-schema}/v3.24.0.d.ts +0 -0
  863. /package/dist/{esm/src/project-schema → project-schema}/v3.24.0.js +0 -0
  864. /package/dist/{types/src/project-schema → project-schema}/v3.25.0.d.ts +0 -0
  865. /package/dist/{esm/src/project-schema → project-schema}/v3.25.0.js +0 -0
  866. /package/dist/{types/src/project-schema → project-schema}/v3.26.0.d.ts +0 -0
  867. /package/dist/{esm/src/project-schema → project-schema}/v3.26.0.js +0 -0
  868. /package/dist/{types/src/project-schema → project-schema}/v3.27.0.d.ts +0 -0
  869. /package/dist/{esm/src/project-schema → project-schema}/v3.27.0.js +0 -0
  870. /package/dist/{types/src/project-schema → project-schema}/v3.28.0.d.ts +0 -0
  871. /package/dist/{esm/src/project-schema → project-schema}/v3.28.0.js +0 -0
  872. /package/dist/{types/src/project-schema → project-schema}/v3.29.0.d.ts +0 -0
  873. /package/dist/{esm/src/project-schema → project-schema}/v3.29.0.js +0 -0
  874. /package/dist/{types/src/project-schema → project-schema}/v3.3.0.d.ts +0 -0
  875. /package/dist/{esm/src/project-schema → project-schema}/v3.3.0.js +0 -0
  876. /package/dist/{types/src/project-schema → project-schema}/v3.30.0.d.ts +0 -0
  877. /package/dist/{esm/src/project-schema → project-schema}/v3.30.0.js +0 -0
  878. /package/dist/{types/src/project-schema → project-schema}/v3.31.0.d.ts +0 -0
  879. /package/dist/{esm/src/project-schema → project-schema}/v3.31.0.js +0 -0
  880. /package/dist/{types/src/project-schema → project-schema}/v3.32.0.d.ts +0 -0
  881. /package/dist/{esm/src/project-schema → project-schema}/v3.32.0.js +0 -0
  882. /package/dist/{types/src/project-schema → project-schema}/v3.33.0.d.ts +0 -0
  883. /package/dist/{esm/src/project-schema → project-schema}/v3.33.0.js +0 -0
  884. /package/dist/{types/src/project-schema → project-schema}/v3.34.0.d.ts +0 -0
  885. /package/dist/{esm/src/project-schema → project-schema}/v3.34.0.js +0 -0
  886. /package/dist/{types/src/project-schema → project-schema}/v3.35.0.d.ts +0 -0
  887. /package/dist/{esm/src/project-schema → project-schema}/v3.35.0.js +0 -0
  888. /package/dist/{types/src/project-schema → project-schema}/v3.36.0.d.ts +0 -0
  889. /package/dist/{esm/src/project-schema → project-schema}/v3.36.0.js +0 -0
  890. /package/dist/{types/src/project-schema → project-schema}/v3.37.0.d.ts +0 -0
  891. /package/dist/{esm/src/project-schema → project-schema}/v3.37.0.js +0 -0
  892. /package/dist/{types/src/project-schema → project-schema}/v3.38.0.d.ts +0 -0
  893. /package/dist/{esm/src/project-schema → project-schema}/v3.38.0.js +0 -0
  894. /package/dist/{types/src/project-schema → project-schema}/v3.39.0.d.ts +0 -0
  895. /package/dist/{esm/src/project-schema → project-schema}/v3.39.0.js +0 -0
  896. /package/dist/{types/src/project-schema → project-schema}/v3.4.0.d.ts +0 -0
  897. /package/dist/{esm/src/project-schema → project-schema}/v3.4.0.js +0 -0
  898. /package/dist/{types/src/project-schema → project-schema}/v3.40.0.d.ts +0 -0
  899. /package/dist/{esm/src/project-schema → project-schema}/v3.40.0.js +0 -0
  900. /package/dist/{types/src/project-schema → project-schema}/v3.41.0.d.ts +0 -0
  901. /package/dist/{esm/src/project-schema → project-schema}/v3.41.0.js +0 -0
  902. /package/dist/{types/src/project-schema → project-schema}/v3.42.0.d.ts +0 -0
  903. /package/dist/{esm/src/project-schema → project-schema}/v3.42.0.js +0 -0
  904. /package/dist/{types/src/project-schema → project-schema}/v3.43.0.d.ts +0 -0
  905. /package/dist/{esm/src/project-schema → project-schema}/v3.43.0.js +0 -0
  906. /package/dist/{types/src/project-schema → project-schema}/v3.44.0.d.ts +0 -0
  907. /package/dist/{esm/src/project-schema → project-schema}/v3.44.0.js +0 -0
  908. /package/dist/{types/src/project-schema → project-schema}/v3.45.0.d.ts +0 -0
  909. /package/dist/{esm/src/project-schema → project-schema}/v3.45.0.js +0 -0
  910. /package/dist/{types/src/project-schema → project-schema}/v3.46.0.d.ts +0 -0
  911. /package/dist/{esm/src/project-schema → project-schema}/v3.46.0.js +0 -0
  912. /package/dist/{types/src/project-schema → project-schema}/v3.47.0.d.ts +0 -0
  913. /package/dist/{esm/src/project-schema → project-schema}/v3.47.0.js +0 -0
  914. /package/dist/{types/src/project-schema → project-schema}/v3.48.0.d.ts +0 -0
  915. /package/dist/{esm/src/project-schema → project-schema}/v3.48.0.js +0 -0
  916. /package/dist/{types/src/project-schema → project-schema}/v3.49.0.d.ts +0 -0
  917. /package/dist/{esm/src/project-schema → project-schema}/v3.49.0.js +0 -0
  918. /package/dist/{types/src/project-schema → project-schema}/v3.5.0.d.ts +0 -0
  919. /package/dist/{esm/src/project-schema → project-schema}/v3.5.0.js +0 -0
  920. /package/dist/{types/src/project-schema → project-schema}/v3.5.1.d.ts +0 -0
  921. /package/dist/{esm/src/project-schema → project-schema}/v3.5.1.js +0 -0
  922. /package/dist/{types/src/project-schema → project-schema}/v3.50.0.d.ts +0 -0
  923. /package/dist/{esm/src/project-schema → project-schema}/v3.50.0.js +0 -0
  924. /package/dist/{types/src/project-schema → project-schema}/v3.51.0.d.ts +0 -0
  925. /package/dist/{esm/src/project-schema → project-schema}/v3.51.0.js +0 -0
  926. /package/dist/{types/src/project-schema → project-schema}/v3.6.0.d.ts +0 -0
  927. /package/dist/{esm/src/project-schema → project-schema}/v3.6.0.js +0 -0
  928. /package/dist/{types/src/project-schema → project-schema}/v3.7.0.d.ts +0 -0
  929. /package/dist/{esm/src/project-schema → project-schema}/v3.7.0.js +0 -0
  930. /package/dist/{types/src/project-schema → project-schema}/v3.8.0.d.ts +0 -0
  931. /package/dist/{esm/src/project-schema → project-schema}/v3.8.0.js +0 -0
  932. /package/dist/{types/src/project-schema → project-schema}/v3.9.0.d.ts +0 -0
  933. /package/dist/{esm/src/project-schema → project-schema}/v3.9.0.js +0 -0
  934. /package/dist/{types/src/project-schema → project-schema}/v4.0.0.d.ts +0 -0
  935. /package/dist/{esm/src/project-schema → project-schema}/v4.0.0.js +0 -0
  936. /package/dist/{types/src/scalars.d.ts → scalars.d.ts} +0 -0
  937. /package/dist/{esm/src/scalars.js → scalars.js} +0 -0
  938. /package/dist/{types/src/schemas → schemas}/index.d.ts +0 -0
  939. /package/dist/{cjs/src/schemas → schemas}/project-schema/experimental.json +0 -0
  940. /package/dist/{cjs/src/schemas → schemas}/project-schema/latest.json +0 -0
  941. /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v1.0.0.json +0 -0
  942. /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.0.0.json +0 -0
  943. /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.1.0.json +0 -0
  944. /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.2.0.json +0 -0
  945. /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.3.0.json +0 -0
  946. /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.4.0.json +0 -0
  947. /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.5.0.json +0 -0
  948. /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.5.1.json +0 -0
  949. /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.6.0.json +0 -0
  950. /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.7.0.json +0 -0
  951. /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.8.0.json +0 -0
  952. /package/dist/{cjs/src/schemas → schemas}/project-schema/meta-schema-v3.9.0.json +0 -0
  953. /package/dist/{cjs/src/schemas → schemas}/project-schema/v1.0.0.json +0 -0
  954. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.0.0.json +0 -0
  955. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.1.0.json +0 -0
  956. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.10.0.json +0 -0
  957. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.11.0.json +0 -0
  958. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.12.0.json +0 -0
  959. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.12.1.json +0 -0
  960. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.12.2.json +0 -0
  961. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.12.3.json +0 -0
  962. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.13.0.json +0 -0
  963. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.14.0.json +0 -0
  964. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.15.0.json +0 -0
  965. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.16.0.json +0 -0
  966. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.17.0.json +0 -0
  967. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.17.1.json +0 -0
  968. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.18.0.json +0 -0
  969. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.18.1.json +0 -0
  970. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.18.2.json +0 -0
  971. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.19.0.json +0 -0
  972. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.2.0.json +0 -0
  973. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.20.0.json +0 -0
  974. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.21.0.json +0 -0
  975. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.22.0.json +0 -0
  976. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.23.0.json +0 -0
  977. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.24.0.json +0 -0
  978. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.25.0.json +0 -0
  979. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.26.0.json +0 -0
  980. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.27.0.json +0 -0
  981. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.28.0.json +0 -0
  982. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.29.0.json +0 -0
  983. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.3.0.json +0 -0
  984. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.30.0.json +0 -0
  985. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.31.0.json +0 -0
  986. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.32.0.json +0 -0
  987. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.33.0.json +0 -0
  988. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.34.0.json +0 -0
  989. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.35.0.json +0 -0
  990. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.36.0.json +0 -0
  991. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.37.0.json +0 -0
  992. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.38.0.json +0 -0
  993. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.39.0.json +0 -0
  994. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.4.0.json +0 -0
  995. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.40.0.json +0 -0
  996. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.41.0.json +0 -0
  997. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.42.0.json +0 -0
  998. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.43.0.json +0 -0
  999. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.44.0.json +0 -0
  1000. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.45.0.json +0 -0
  1001. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.46.0.json +0 -0
  1002. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.47.0.json +0 -0
  1003. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.48.0.json +0 -0
  1004. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.49.0.json +0 -0
  1005. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.5.0.json +0 -0
  1006. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.5.1.json +0 -0
  1007. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.50.0.json +0 -0
  1008. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.51.0.json +0 -0
  1009. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.6.0.json +0 -0
  1010. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.7.0.json +0 -0
  1011. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.8.0.json +0 -0
  1012. /package/dist/{cjs/src/schemas → schemas}/project-schema/v3.9.0.json +0 -0
  1013. /package/dist/{cjs/src/schemas → schemas}/project-schema/v4.0.0.json +0 -0
  1014. /package/dist/{cjs/src/schemas → schemas}/project-schema.json +0 -0
  1015. /package/dist/{types/src/services → services}/types.d.ts +0 -0
  1016. /package/dist/{esm/src/services → services}/util.js +0 -0
  1017. /package/dist/{esm/src/template-shapes → template-shapes}/index.js +0 -0
  1018. /package/dist/{esm/src/template-shapes → template-shapes}/names.js +0 -0
  1019. /package/dist/{esm/src/template-shapes → template-shapes}/types.js +0 -0
  1020. /package/dist/{esm/src/types → types}/types.js +0 -0
  1021. /package/dist/{esm/src/util → util}/ai-tools.js +0 -0
  1022. /package/dist/{esm/src/util → util}/find-shape-at-path.js +0 -0
  1023. /package/dist/{esm/src/util → util}/patch-schema.js +0 -0
  1024. /package/dist/{esm/src/util → util}/shapes.js +0 -0
@@ -1,1140 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getQueryMapName = exports.shapeHasArrayPropOfShape = exports.getDefaultMutationName = exports.ensureMutationByShape = exports.ensureQueryByShape = exports.findMutationByShape = exports.findQueryByShape = exports.createSchemaPropertyAccessor = exports.createSchemaPropertyList = exports.isBuiltInPropertyName = exports.BuiltInPropertiesProfile = exports.DEFAULT_ID_FIELD = exports.nonStructuralSchemaKeys = exports.multipleRelationshipSchemaKeys = exports.arraySchemaKeys = exports.objectSchemaKeys = exports.scalarSchemaKeys = exports.commonSchemaKeys = exports.schemaMetadataKeys = void 0;
7
- exports.isBuiltinShape = isBuiltinShape;
8
- exports.isBuiltinQuery = isBuiltinQuery;
9
- exports.isBuiltinMutation = isBuiltinMutation;
10
- exports.isBuiltinType = isBuiltinType;
11
- exports.getServiceIdFieldName = getServiceIdFieldName;
12
- exports.getGeneratorVersion = getGeneratorVersion;
13
- exports.pathBetween = pathBetween;
14
- exports.getShapeQueriesAndMutations = getShapeQueriesAndMutations;
15
- exports.getCommonBuiltInProperties = getCommonBuiltInProperties;
16
- exports.getIdField = getIdField;
17
- exports.getModelBuiltInProperties = getModelBuiltInProperties;
18
- exports.getBuiltInPropertyNames = getBuiltInPropertyNames;
19
- exports.applyBuiltinPropertiesToShape = applyBuiltinPropertiesToShape;
20
- exports.getBuiltinsUsed = getBuiltinsUsed;
21
- exports.applyDefaultsToSchema = applyDefaultsToSchema;
22
- exports.getShapeByRef = getShapeByRef;
23
- exports.getArgsReference = getArgsReference;
24
- exports.getArgsReferenceWithPath = getArgsReferenceWithPath;
25
- exports.getArgsShapeSchema = getArgsShapeSchema;
26
- exports.shapeToPropertySchema = shapeToPropertySchema;
27
- exports.projectSchemaToJSONSchema = projectSchemaToJSONSchema;
28
- exports.getShapeDependencies = getShapeDependencies;
29
- exports.getRelevantShapes = getRelevantShapes;
30
- exports.visitSchemaProperties = visitSchemaProperties;
31
- exports.visitShapeProperties = visitShapeProperties;
32
- exports.getAllRefsInShapes = getAllRefsInShapes;
33
- exports.getAllRefsInQuery = getAllRefsInQuery;
34
- exports.getAllRefsInQueries = getAllRefsInQueries;
35
- exports.getAllRefs = getAllRefs;
36
- exports.isValidRefItem = isValidRefItem;
37
- exports.getAllValidRefs = getAllValidRefs;
38
- exports.parseMapping = parseMapping;
39
- exports.splitMapping = splitMapping;
40
- exports.findMapping = findMapping;
41
- exports.getFirstMapping = getFirstMapping;
42
- exports.getFullyQualifiedShapeName = getFullyQualifiedShapeName;
43
- exports.getStorageKey = getStorageKey;
44
- exports.getPropertyService = getPropertyService;
45
- exports.emptySchema = emptySchema;
46
- exports.createLayerSchema = createLayerSchema;
47
- exports.getShapesById = getShapesById;
48
- exports.getAllNamespaceShapes = getAllNamespaceShapes;
49
- exports.getNamespacedShapeNameList = getNamespacedShapeNameList;
50
- exports.filterGraphQLServiceMap = filterGraphQLServiceMap;
51
- exports.createShape = createShape;
52
- exports.queryToPropertySchema = queryToPropertySchema;
53
- exports.getQueriesShape = getQueriesShape;
54
- exports.fieldMappingContainsKey = fieldMappingContainsKey;
55
- exports.schemaMatchesShapeName = schemaMatchesShapeName;
56
- const util_1 = require("@takeshape/util");
57
- const curry_js_1 = __importDefault(require("lodash/fp/curry.js"));
58
- const orderBy_js_1 = __importDefault(require("lodash/fp/orderBy.js"));
59
- const isArray_js_1 = __importDefault(require("lodash/isArray.js"));
60
- const isString_js_1 = __importDefault(require("lodash/isString.js"));
61
- const keyBy_js_1 = __importDefault(require("lodash/keyBy.js"));
62
- const mapValues_js_1 = __importDefault(require("lodash/mapValues.js"));
63
- const some_js_1 = __importDefault(require("lodash/some.js"));
64
- const uniq_js_1 = __importDefault(require("lodash/uniq.js"));
65
- const api_version_1 = require("./api-version");
66
- const builtin_schema_1 = require("./builtin-schema");
67
- const constants_1 = require("./constants");
68
- const refs_1 = require("./refs");
69
- const types_1 = require("./types");
70
- const unions_1 = require("./unions");
71
- const has_arg_1 = require("./util/has-arg");
72
- const merge_1 = require("./util/merge");
73
- const versions_1 = require("./versions");
74
- const workflows_1 = require("./workflows");
75
- function isBuiltinShape(shapeName) {
76
- return Boolean(builtin_schema_1.builtInShapes[shapeName]);
77
- }
78
- const builtInQueriesAndMutations = getShapeQueriesAndMutations(Object.values(builtin_schema_1.builtInShapes));
79
- function isBuiltinQuery(name) {
80
- return builtInQueriesAndMutations.queries[name] !== undefined;
81
- }
82
- function isBuiltinMutation(name) {
83
- return builtInQueriesAndMutations.mutations[name] !== undefined;
84
- }
85
- function isBuiltinType(projectSchema, refSchema) {
86
- const shapeName = (0, refs_1.getRefShapeName)(projectSchema, refSchema);
87
- return shapeName !== undefined && isBuiltinShape(shapeName);
88
- }
89
- exports.schemaMetadataKeys = [
90
- '$comment',
91
- 'title',
92
- 'description',
93
- '@l10n',
94
- '@deprecationReason',
95
- '@tag',
96
- '@tags',
97
- '@syncLocaleStructure',
98
- '@sensitive'
99
- ];
100
- exports.commonSchemaKeys = ['type', 'default', 'readOnly', ...exports.schemaMetadataKeys];
101
- exports.scalarSchemaKeys = [
102
- ...exports.commonSchemaKeys,
103
- 'format',
104
- 'oneOf',
105
- 'multipleOf',
106
- 'maximum',
107
- 'exclusiveMaximum',
108
- 'minimum',
109
- 'exclusiveMinimum',
110
- 'maxLength',
111
- 'minLength',
112
- 'pattern'
113
- ];
114
- exports.objectSchemaKeys = [...exports.commonSchemaKeys, 'properties', 'required'];
115
- exports.arraySchemaKeys = [
116
- ...exports.commonSchemaKeys,
117
- 'items',
118
- 'additionalItems',
119
- 'maxItems',
120
- 'minItems',
121
- 'uniqueItems'
122
- ];
123
- exports.multipleRelationshipSchemaKeys = [...exports.schemaMetadataKeys, 'maxItems', 'minItems'];
124
- // All properties except properties, items, additionalItems
125
- exports.nonStructuralSchemaKeys = [
126
- ...exports.scalarSchemaKeys,
127
- '@resolver',
128
- '@input',
129
- '@output',
130
- '@backreference',
131
- '@args',
132
- 'required',
133
- 'maxItems',
134
- 'minItems',
135
- 'uniqueItems'
136
- ];
137
- function getServiceIdFieldName(serviceFieldName) {
138
- return `${serviceFieldName}Id`;
139
- }
140
- const generatorVersions = {
141
- [constants_1.SERVICE_OBJECT_PATTERN_NAME]: '1'
142
- };
143
- function getGeneratorVersion(generator) {
144
- return generatorVersions[generator];
145
- }
146
- // Follow refs to find the path between two shapes in a schema
147
- function pathBetween(fromShape, toShape, projectSchema, depthLimit = 4) {
148
- if (fromShape.name === toShape.name) {
149
- return [];
150
- }
151
- const toShapeName = toShape.name;
152
- let shortestPath;
153
- let shortestPathLength = Number.MAX_SAFE_INTEGER;
154
- const pathBetweenHelper = (schema, pathSoFar, seen, depth) => {
155
- if (depth > depthLimit) {
156
- return;
157
- }
158
- if (schema.items) {
159
- pathBetweenHelper(schema.items, pathSoFar, seen, depth);
160
- return;
161
- }
162
- const refItem = (0, refs_1.getRef)(projectSchema, schema);
163
- if (refItem) {
164
- const referenced = (0, refs_1.refItemToShape)(projectSchema, refItem);
165
- if (referenced) {
166
- if (referenced.name === toShapeName && pathSoFar.length < shortestPathLength) {
167
- shortestPath = pathSoFar;
168
- shortestPathLength = pathSoFar.length;
169
- }
170
- else if (!seen.has(referenced.name)) {
171
- pathBetweenHelper(referenced.schema, pathSoFar, new Set([...seen, referenced.name]), depth);
172
- }
173
- }
174
- }
175
- else if (pathSoFar.length + 1 < shortestPathLength && (schema.oneOf ?? schema.allOf ?? schema.properties)) {
176
- if (schema.oneOf) {
177
- for (const itemSchema of schema.oneOf) {
178
- pathBetweenHelper(itemSchema, pathSoFar, seen, depth);
179
- }
180
- }
181
- else {
182
- for (const [propName, propSchema] of (0, exports.createSchemaPropertyList)(projectSchema, schema).getNodes()) {
183
- pathBetweenHelper(propSchema, pathSoFar.concat(String(propName)), seen, depth + 1);
184
- }
185
- }
186
- }
187
- };
188
- pathBetweenHelper(fromShape.schema, [], new Set([fromShape.name]), 0);
189
- if (!shortestPath) {
190
- throw new Error(`No path between ${fromShape.name} and ${toShape.name}`);
191
- }
192
- return shortestPath;
193
- }
194
- function getShapeQueriesAndMutations(shapes) {
195
- const queries = {};
196
- const mutations = {};
197
- for (const shape of (0, util_1.ensureArray)(shapes)) {
198
- const { name, model } = shape;
199
- const service = 'shapedb';
200
- if (model) {
201
- const isSingleton = model.type === 'single';
202
- queries[`get${name}`] = {
203
- shape: name,
204
- resolver: {
205
- name: 'shapedb:get',
206
- service,
207
- shapeName: name
208
- },
209
- description: `Get a ${name} by ID`,
210
- args: isSingleton
211
- ? (0, refs_1.createTemplateShapeName)('TSGetSingletonArgs', name)
212
- : (0, refs_1.createTemplateShapeName)('TSGetArgs', name)
213
- };
214
- mutations[`update${name}`] = {
215
- shape: (0, refs_1.createTemplateShapeName)('UpdateResult', name),
216
- resolver: {
217
- name: 'shapedb:update',
218
- service,
219
- shapeName: name
220
- },
221
- description: `Update ${name}`,
222
- args: (0, refs_1.createTemplateShapeName)('UpdateArgs', name)
223
- };
224
- if (!isSingleton) {
225
- queries[`get${name}List`] = {
226
- shape: (0, refs_1.createTemplateShapeName)('PaginatedList', name),
227
- resolver: {
228
- name: 'shapedb:list',
229
- service,
230
- shapeName: name
231
- },
232
- description: `Returns a list ${name} in natural order.`,
233
- args: (0, refs_1.createTemplateShapeName)('TSListArgs', name)
234
- };
235
- mutations[`create${name}`] = {
236
- shape: (0, refs_1.createTemplateShapeName)('CreateResult', name),
237
- resolver: {
238
- name: 'shapedb:create',
239
- service,
240
- shapeName: name
241
- },
242
- description: `Create ${name}`,
243
- args: (0, refs_1.createTemplateShapeName)('CreateArgs', name)
244
- };
245
- mutations[`duplicate${name}`] = {
246
- shape: (0, refs_1.createTemplateShapeName)('DuplicateResult', name),
247
- resolver: {
248
- name: 'shapedb:duplicate',
249
- service,
250
- shapeName: name
251
- },
252
- description: `Duplicate ${name}`,
253
- args: (0, refs_1.createTemplateShapeName)('DuplicateArgs', name)
254
- };
255
- mutations[`delete${name}`] = {
256
- shape: (0, refs_1.createTemplateShapeName)('DeleteResult', name),
257
- resolver: {
258
- name: 'shapedb:delete',
259
- service,
260
- shapeName: name
261
- },
262
- description: `Delete ${name}`,
263
- args: (0, refs_1.createTemplateShapeName)('DeleteArgs', name)
264
- };
265
- }
266
- }
267
- }
268
- return { queries, mutations };
269
- }
270
- function getCommonBuiltInProperties(shape) {
271
- return {
272
- _id: {
273
- title: 'Id',
274
- type: 'string'
275
- },
276
- _shapeId: {
277
- type: 'string',
278
- title: 'Shape Id',
279
- enum: [shape.id]
280
- }
281
- };
282
- }
283
- exports.DEFAULT_ID_FIELD = 'id';
284
- function getIdField(obj) {
285
- return obj?.idField ?? exports.DEFAULT_ID_FIELD;
286
- }
287
- /**
288
- * Get properties necessary for cached / remote data to work with the TSSearchable interface.
289
- */
290
- function getCachedBuiltInProperties(projectSchema, shape, properties) {
291
- const idField = getIdField(shape.cache);
292
- // TODO Implement `searchSummary` and `_shapeId` here, and remove `getRemoteShapeTSSearchableFields`
293
- return {
294
- _id: {
295
- title: 'Id',
296
- type: 'string',
297
- ...properties._id,
298
- ...(properties[idField]?.['@mapping'] ? { '@mapping': properties[idField]['@mapping'] } : {})
299
- }
300
- };
301
- }
302
- function getModelBuiltInProperties(projectSchema, shape) {
303
- const apiVersion = projectSchema.apiVersion ?? versions_1.CURRENT_API_VERSION;
304
- const showDeprecationReason = apiVersion !== '1';
305
- const properties = {
306
- _version: {
307
- title: 'Version',
308
- type: 'integer'
309
- },
310
- _shapeName: {
311
- title: 'Shape Name',
312
- type: 'string'
313
- },
314
- _createdAt: {
315
- title: 'Created',
316
- type: 'string',
317
- format: 'date-time'
318
- },
319
- _createdBy: {
320
- title: 'Created By',
321
- '@ref': 'local:TSUser',
322
- '@input': {
323
- type: 'string'
324
- },
325
- '@resolver': {
326
- name: 'takeshape:getUser',
327
- service: 'takeshape'
328
- }
329
- },
330
- _updatedAt: {
331
- title: 'Updated',
332
- type: 'string',
333
- format: 'date-time'
334
- },
335
- _updatedBy: {
336
- title: 'Updated By',
337
- '@ref': 'local:TSUser',
338
- '@input': {
339
- type: 'string'
340
- },
341
- '@resolver': {
342
- name: 'takeshape:getUser',
343
- service: 'takeshape'
344
- }
345
- },
346
- _schemaVersion: {
347
- title: 'Schema Version',
348
- type: 'number'
349
- },
350
- _enabled: {
351
- title: 'Enabled',
352
- type: 'boolean',
353
- ...(showDeprecationReason ? { '@deprecationReason': 'Use _status instead' } : {})
354
- },
355
- _enabledAt: {
356
- title: 'Enabled Date',
357
- type: 'string',
358
- format: 'date-time',
359
- ...(showDeprecationReason ? { '@deprecationReason': 'Use a custom date field instead' } : {})
360
- }
361
- };
362
- if ((0, api_version_1.workflowsEnabled)(apiVersion)) {
363
- return {
364
- ...properties,
365
- _status: {
366
- ...(projectSchema.workflows && (0, workflows_1.getStatusField)(projectSchema.workflows, shape))
367
- }
368
- };
369
- }
370
- return properties;
371
- }
372
- /**
373
- * Return all the built in property names,
374
- */
375
- function getBuiltInPropertyNames(profile = BuiltInPropertiesProfile.Model) {
376
- const fakeShape = {
377
- id: 'shape-id'
378
- };
379
- let keys = [...Object.keys(getCommonBuiltInProperties(fakeShape))];
380
- if (profile === BuiltInPropertiesProfile.Model) {
381
- keys = [...keys, ...Object.keys(getModelBuiltInProperties({}, fakeShape))];
382
- }
383
- return new Set(keys);
384
- }
385
- var BuiltInPropertiesProfile;
386
- (function (BuiltInPropertiesProfile) {
387
- BuiltInPropertiesProfile[BuiltInPropertiesProfile["Model"] = 0] = "Model";
388
- BuiltInPropertiesProfile[BuiltInPropertiesProfile["Cached"] = 1] = "Cached";
389
- BuiltInPropertiesProfile[BuiltInPropertiesProfile["None"] = 2] = "None";
390
- })(BuiltInPropertiesProfile || (exports.BuiltInPropertiesProfile = BuiltInPropertiesProfile = {}));
391
- const BUILT_IN_PROPERTY_NAMES = {
392
- [BuiltInPropertiesProfile.Model]: getBuiltInPropertyNames(BuiltInPropertiesProfile.Model),
393
- [BuiltInPropertiesProfile.Cached]: getBuiltInPropertyNames(BuiltInPropertiesProfile.Cached),
394
- [BuiltInPropertiesProfile.None]: getBuiltInPropertyNames(BuiltInPropertiesProfile.None)
395
- };
396
- const isBuiltInPropertyName = (name, profile = BuiltInPropertiesProfile.Model) => {
397
- return BUILT_IN_PROPERTY_NAMES[profile].has(name);
398
- };
399
- exports.isBuiltInPropertyName = isBuiltInPropertyName;
400
- /**
401
- * Get the profile to use for loading built-in properties
402
- */
403
- function getBuiltInPropertiesProfile(shape) {
404
- if ((0, types_1.isModelShape)(shape)) {
405
- return BuiltInPropertiesProfile.Model;
406
- }
407
- if ((0, types_1.isCachedShape)(shape)) {
408
- return BuiltInPropertiesProfile.Cached;
409
- }
410
- return BuiltInPropertiesProfile.None;
411
- }
412
- function applyBuiltinPropertiesToShape(projectSchema, shape) {
413
- const profile = getBuiltInPropertiesProfile(shape);
414
- if (profile === BuiltInPropertiesProfile.None) {
415
- return shape;
416
- }
417
- const shapeObjectSchema = (0, refs_1.dereferenceObjectSchema)(projectSchema, shape.schema, ['shapes', shape.name]);
418
- const { properties } = shapeObjectSchema;
419
- const commonProperties = getCommonBuiltInProperties(shape);
420
- const modelProperties = profile === BuiltInPropertiesProfile.Model ? getModelBuiltInProperties(projectSchema, shape) : undefined;
421
- const cachedProperties = profile === BuiltInPropertiesProfile.Cached
422
- ? getCachedBuiltInProperties(projectSchema, shape, properties)
423
- : undefined;
424
- return {
425
- ...shape,
426
- schema: {
427
- ...shapeObjectSchema,
428
- properties: {
429
- ...properties,
430
- ...commonProperties,
431
- ...modelProperties,
432
- ...cachedProperties
433
- }
434
- }
435
- };
436
- }
437
- // Dependencies of these built-in shapes are automatically added by getBuiltinsUsed
438
- const requiredBuiltinShapes = ['Asset', 'TSRelationship', 'TSStaticSite', 'TSUser'];
439
- /**
440
- * Get all built-in shapes that are depended on by the given project schema.
441
- * Required built-in shapes are always included.
442
- */
443
- function getBuiltinsUsed(projectSchema) {
444
- const builtinsUsed = {};
445
- const shapeNames = (0, uniq_js_1.default)(requiredBuiltinShapes.concat(getAllRefs(projectSchema, (refItem) => refItem.serviceKey === 'local' && isBuiltinShape(refItem.typeName)).map(refs_1.refItemToNamespacedShapeName)));
446
- const schemaWithAllBuiltins = {
447
- ...emptySchema('project-id'),
448
- shapes: builtin_schema_1.builtInShapes
449
- };
450
- for (const builtinShapeName of shapeNames) {
451
- builtinsUsed[builtinShapeName] = builtin_schema_1.builtInShapes[builtinShapeName];
452
- for (const depShapeName of getShapeDependencies(schemaWithAllBuiltins, builtin_schema_1.builtInShapes[builtinShapeName])) {
453
- builtinsUsed[depShapeName] = builtin_schema_1.builtInShapes[depShapeName];
454
- }
455
- }
456
- return builtinsUsed;
457
- }
458
- function applyDefaultsToSchema(projectSchema) {
459
- const builtinsUsed = getBuiltinsUsed(projectSchema);
460
- return {
461
- ...projectSchema,
462
- workflows: {
463
- ...projectSchema.workflows,
464
- ...((0, api_version_1.workflowsEnabled)(projectSchema.apiVersion) && {
465
- default: workflows_1.defaultWorkflow
466
- })
467
- },
468
- queries: {
469
- ...builtInQueriesAndMutations.queries,
470
- ...projectSchema.queries
471
- },
472
- mutations: {
473
- ...builtInQueriesAndMutations.mutations,
474
- ...projectSchema.mutations
475
- },
476
- shapes: (0, mapValues_js_1.default)({ ...builtinsUsed, ...projectSchema.shapes }, (shape) => {
477
- const builtInShape = builtinsUsed[shape.name];
478
- if (builtInShape && builtInShape !== shape) {
479
- shape = {
480
- ...shape,
481
- schema: (0, merge_1.mergeSchemaProperties)((0, refs_1.dereferenceObjectSchema)(projectSchema, shape.schema), (0, refs_1.dereferenceObjectSchema)(projectSchema, builtInShape.schema))
482
- };
483
- }
484
- return applyBuiltinPropertiesToShape(projectSchema, shape);
485
- }),
486
- forms: (0, mapValues_js_1.default)({ ...builtin_schema_1.builtInForms, ...projectSchema.forms }, (formsConfig, shapeName) => {
487
- const builtInFormsConfig = builtin_schema_1.builtInForms[shapeName];
488
- if (builtInFormsConfig && builtInFormsConfig !== formsConfig) {
489
- formsConfig = {
490
- ...formsConfig,
491
- default: (0, merge_1.mergeFormProperties)(formsConfig.default, builtInFormsConfig.default)
492
- };
493
- }
494
- return formsConfig;
495
- })
496
- };
497
- }
498
- function getShapeByRef(projectSchema, shapeRef) {
499
- return (0, refs_1.refItemToShape)(projectSchema, (0, refs_1.atRefToRefItem)(projectSchema, shapeRef));
500
- }
501
- function getArgsReference(projectSchema, argsSchema) {
502
- const args = (0, has_arg_1.getArgs)(argsSchema);
503
- if (args && typeof args === 'string') {
504
- // @args: ShapeName OR Namespace_TypeName
505
- return (0, refs_1.refExpressionToRefItem)(projectSchema, args);
506
- }
507
- }
508
- function getArgsReferenceWithPath(context, argsSchema, schemaPath = []) {
509
- const refItem = getArgsReference(context, argsSchema);
510
- if (refItem) {
511
- const argsType = (0, types_1.getArgsType)(argsSchema);
512
- return {
513
- ...refItem,
514
- path: schemaPath.concat([argsType])
515
- };
516
- }
517
- }
518
- function getArgsShapeSchema(context, argsSchema) {
519
- const args = (0, has_arg_1.getArgs)(argsSchema);
520
- if (args) {
521
- if (typeof args === 'string') {
522
- const refItem = getArgsReference(context, argsSchema);
523
- if (refItem) {
524
- return (0, refs_1.refItemToShapeSchema)(context, refItem);
525
- }
526
- }
527
- else {
528
- return args;
529
- }
530
- }
531
- }
532
- const createShapeToPropertySchema = (projectSchema, definitions, definitionNames, { useShapeIdDiscriminator }) => {
533
- const rewriteRefs = (shape) => {
534
- const handleSchema = (propSchema) => {
535
- // Unwrap array schema
536
- propSchema = propSchema.items ?? propSchema;
537
- if ((0, types_1.isOneOfSchema)(propSchema)) {
538
- const isUnion = (0, unions_1.isUnionSchema)(propSchema);
539
- if (useShapeIdDiscriminator && isUnion) {
540
- propSchema.discriminator = {
541
- propertyName: '_shapeId'
542
- };
543
- propSchema.required = ['_shapeId'];
544
- }
545
- for (const schema of propSchema.oneOf) {
546
- handleSchema(schema);
547
- }
548
- return;
549
- }
550
- // Add workflow validation
551
- if (propSchema['@workflow']) {
552
- const workflowName = propSchema['@workflow'];
553
- const workflow = projectSchema.workflows[workflowName] || workflows_1.defaultWorkflow;
554
- propSchema.oneOf = workflow.steps.map((step) => ({
555
- enum: [step.key, step.name],
556
- title: step.title
557
- }));
558
- }
559
- const refItem = (0, refs_1.getRef)(projectSchema, propSchema);
560
- if (refItem) {
561
- const shapeName = (0, refs_1.refItemToNamespacedShapeName)(refItem);
562
- const shape = (0, refs_1.refItemToShape)(projectSchema, refItem);
563
- if (shape) {
564
- delete propSchema['@ref'];
565
- propSchema.$ref = `#/definitions/${shapeName}`;
566
- if (!definitionNames.has(shapeName)) {
567
- definitionNames.add(shapeName);
568
- const rewritten = rewriteRefs(shape);
569
- if (useShapeIdDiscriminator && (0, types_1.isObjectSchema)(rewritten)) {
570
- rewritten.properties._shapeId = {
571
- type: 'string',
572
- enum: [shape.id]
573
- };
574
- }
575
- definitions[shapeName] = rewritten;
576
- }
577
- }
578
- }
579
- };
580
- const shapeSchema = (0, util_1.deepClone)(shape.schema);
581
- if ((0, types_1.isOneOfSchema)(shapeSchema)) {
582
- handleSchema(shapeSchema);
583
- return shapeSchema;
584
- }
585
- if (shapeSchema.enum) {
586
- return shapeSchema;
587
- }
588
- const shapeSchemaCopy = (0, refs_1.dereferenceObjectSchema)(projectSchema, shapeSchema);
589
- if (shape.title) {
590
- shapeSchemaCopy.title = shape.title;
591
- }
592
- for (const schema of Object.values(shapeSchemaCopy.properties)) {
593
- handleSchema(schema);
594
- }
595
- return shapeSchemaCopy;
596
- };
597
- return rewriteRefs;
598
- };
599
- function shapeToPropertySchema(projectSchema, shape) {
600
- const definitions = {};
601
- const definitionNames = new Set();
602
- const convert = createShapeToPropertySchema(projectSchema, definitions, definitionNames, {
603
- useShapeIdDiscriminator: true
604
- });
605
- return {
606
- ...convert(shape),
607
- definitions
608
- };
609
- }
610
- function projectSchemaToJSONSchema(projectSchema) {
611
- const definitions = {};
612
- const definitionNames = new Set();
613
- const convert = createShapeToPropertySchema(projectSchema, definitions, definitionNames, {
614
- useShapeIdDiscriminator: false
615
- });
616
- for (const shape of Object.values(projectSchema.shapes)) {
617
- definitions[shape.name] = convert(shape);
618
- definitionNames.add(shape.name);
619
- }
620
- return {
621
- definitions
622
- };
623
- }
624
- function getShapeDependencies(projectSchema, shape, predicate) {
625
- const shapeNames = new Set();
626
- const findDependencies = (schema) => {
627
- const shouldFollow = Boolean(!predicate || predicate(schema));
628
- if (shouldFollow) {
629
- schema = schema.items ?? schema;
630
- const refItem = (0, refs_1.getRef)(projectSchema, schema);
631
- if (refItem) {
632
- const refShape = (0, refs_1.refItemToShape)(projectSchema, refItem);
633
- if (refShape && !shapeNames.has(refShape.name)) {
634
- shapeNames.add(refShape.name);
635
- findDependencies((0, refs_1.dereferenceSchema)(projectSchema, refShape.schema, ['shapes', refShape.name]));
636
- }
637
- }
638
- else if ((0, types_1.isObjectSchema)(schema) || (0, types_1.isAllOfSchema)(schema) || (0, types_1.isOneOfSchema)(schema)) {
639
- visitSchemaProperties(schema, [], findDependencies);
640
- }
641
- }
642
- return shouldFollow;
643
- };
644
- findDependencies(shape.schema);
645
- return [...shapeNames];
646
- }
647
- function getRelevantShapes(projectSchema, params) {
648
- const { shapeIds, shapeNames, byId = false, includeDependencies = true } = params;
649
- if (Boolean(shapeNames?.length) || Boolean(shapeIds?.length)) {
650
- const ids = new Set(shapeIds);
651
- const names = new Set(shapeNames);
652
- const shapes = {};
653
- for (const shape of Object.values(projectSchema.shapes)) {
654
- if (ids.has(shape.id) || names.has(shape.name)) {
655
- const shapeNames = includeDependencies
656
- ? [shape.name].concat(getShapeDependencies(projectSchema, shape))
657
- : [shape.name];
658
- for (const shapeName of shapeNames) {
659
- const dependentShape = projectSchema.shapes[shapeName];
660
- shapes[byId ? dependentShape.id : dependentShape.name] = dependentShape;
661
- }
662
- }
663
- }
664
- return shapes;
665
- }
666
- return {};
667
- }
668
- function visitSchemaProperties(root, path, callback) {
669
- const visitEach = (entries, path) => {
670
- for (const [name, propSchema] of entries) {
671
- const newPath = [...path, name];
672
- visit(propSchema, newPath);
673
- }
674
- };
675
- const visit = (schema, path) => {
676
- if (schema !== root && callback(schema, path) === false) {
677
- return;
678
- }
679
- if ((0, types_1.isArraySchema)(schema)) {
680
- visit(schema.items, [...path, 'items']);
681
- }
682
- else if ((0, types_1.isObjectSchema)(schema)) {
683
- visitEach(Object.entries(schema.properties), [...path, 'properties']);
684
- }
685
- else if ((0, types_1.isExtendsSchema)(schema)) {
686
- visitEach(Object.entries(schema.extends), [...path, 'extends']);
687
- }
688
- else if ((0, types_1.isAllOfSchema)(schema)) {
689
- visitEach(Object.entries(schema.allOf), [...path, 'allOf']);
690
- }
691
- else if ((0, types_1.isOneOfSchema)(schema)) {
692
- visitEach(Object.entries(schema.oneOf), [...path, 'oneOf']);
693
- }
694
- };
695
- visit(root, path);
696
- }
697
- function visitShapeProperties(shapes, callback) {
698
- for (const [shapeName, shape] of Object.entries(shapes)) {
699
- visitSchemaProperties(shape.schema, ['shapes', shapeName, 'schema'], callback);
700
- }
701
- }
702
- function addRef(refs, ref, predicate) {
703
- if (ref && (!predicate || predicate(ref))) {
704
- refs.push(ref);
705
- }
706
- }
707
- /**
708
- * Walk through a `ProjectSchemaJSON` and collect all the `ref`s.
709
- */
710
- function getAllRefsInShapes(projectSchema, predicate) {
711
- const items = [];
712
- const refPropNames = ['$ref', '@ref', '@args', 'args', 'interfaces'];
713
- (0, util_1.visit)(projectSchema.shapes, refPropNames, (interfaces, refPath) => {
714
- const propName = refPath[refPath.length - 1];
715
- const path = ['shapes', ...refPath];
716
- if (propName === 'interfaces' && (0, isArray_js_1.default)(interfaces)) {
717
- interfaces.forEach((interfaceRefExpression, index) => {
718
- addRef(items, {
719
- ...(0, refs_1.refExpressionToRefItem)(projectSchema, interfaceRefExpression),
720
- path: [...path, index]
721
- }, predicate);
722
- });
723
- }
724
- // The client sometimes generates invalid schemas, like refs that are
725
- // undefined. Treat ref as unknown and toss those out.
726
- // See the `useShapeEditor > can deal with renames test`
727
- if (!(0, isString_js_1.default)(interfaces)) {
728
- return;
729
- }
730
- if (propName === '@ref') {
731
- const { shapeName, template } = (0, refs_1.parseTemplateShape)(interfaces);
732
- addRef(items, { ...(0, refs_1.atRefToRefItem)(projectSchema, shapeName, template), path }, predicate);
733
- }
734
- else if (propName === '$ref') {
735
- addRef(items, { ...(0, refs_1.refToRefItem)(projectSchema, interfaces), path }, predicate);
736
- }
737
- else if (propName === '@args' || propName === 'args') {
738
- addRef(items, { ...(0, refs_1.refExpressionToRefItem)(projectSchema, interfaces), path }, predicate);
739
- }
740
- });
741
- return items;
742
- }
743
- /**
744
- * Get all refs
745
- */
746
- function getAllRefsInQuery(projectSchema, queryPath, query, predicate) {
747
- const refItems = [];
748
- const propertyVisitor = (propSchema, propSchemaPath) => {
749
- addRef(refItems, (0, refs_1.getRefOrItemsRef)(projectSchema, propSchema, propSchemaPath), predicate);
750
- };
751
- if (query.args && typeof query.args === 'string') {
752
- addRef(refItems, getArgsReferenceWithPath(projectSchema, query, queryPath), predicate);
753
- }
754
- if (query.args && typeof query.args === 'object') {
755
- visitSchemaProperties((0, refs_1.dereferenceObjectSchema)(projectSchema, query.args), [...queryPath, 'args'], propertyVisitor);
756
- }
757
- if (query.shape) {
758
- const { isArray, ref } = (0, refs_1.parseReturnShape)(projectSchema, query.shape);
759
- if (ref) {
760
- addRef(refItems, {
761
- ...ref,
762
- path: queryPath.concat(isArray ? ['shape', 'items', '@ref'] : ['shape'])
763
- }, predicate);
764
- }
765
- }
766
- return refItems;
767
- }
768
- /**
769
- * Collect refs from `queries` or `mutations`.
770
- */
771
- function getAllRefsInQueries(projectSchema, rootPropertyName, predicate) {
772
- const refItems = [];
773
- const rootPath = [rootPropertyName];
774
- for (const [queryName, query] of Object.entries(projectSchema[rootPropertyName])) {
775
- const queryPath = rootPath.concat([queryName]);
776
- const queryRefs = getAllRefsInQuery(projectSchema, queryPath, query, predicate);
777
- if (queryRefs.length) {
778
- refItems.push(...queryRefs);
779
- }
780
- }
781
- return refItems;
782
- }
783
- /**
784
- * Get all refs in a ProjectSchemaJSON
785
- * @param predicate return true to include the ref in
786
- */
787
- function getAllRefs(projectSchema, predicate) {
788
- return [
789
- ...getAllRefsInShapes(projectSchema, predicate),
790
- ...getAllRefsInQueries(projectSchema, 'queries', predicate),
791
- ...getAllRefsInQueries(projectSchema, 'mutations', predicate)
792
- ];
793
- }
794
- function isValidRefItem(refItem) {
795
- return refItem.isValidService;
796
- }
797
- /**
798
- * Get all valid refs in a ProjectSchemaJSON
799
- * @param predicate return true to include the ref in
800
- */
801
- function getAllValidRefs(projectSchema, predicate) {
802
- return getAllRefs(projectSchema, predicate).filter(isValidRefItem);
803
- }
804
- function parseMapping(mapping) {
805
- const [providerId, serviceId, coordinate] = mapping.split(':');
806
- const [shapeName, key] = coordinate.split('.');
807
- return {
808
- providerId,
809
- serviceId,
810
- shapeName,
811
- key
812
- };
813
- }
814
- function splitMapping(mapping) {
815
- const parts = mapping.split('.');
816
- return [parts[0], parts.slice(1).join('.')];
817
- }
818
- function findMapping(schema, predicate) {
819
- const mapping = schema['@mapping'];
820
- if (Array.isArray(mapping)) {
821
- return mapping.find(predicate);
822
- }
823
- return mapping && predicate(mapping) ? mapping : undefined;
824
- }
825
- function getFirstMapping(schema) {
826
- return Array.isArray(schema['@mapping']) ? schema['@mapping'][0] : schema['@mapping'];
827
- }
828
- function getFullyQualifiedShapeName(schema) {
829
- const first = getFirstMapping(schema);
830
- return first ? splitMapping(first)[0] : undefined;
831
- }
832
- /**
833
- * Find key for use storing data in ShapeDB or API Indexing this allows renaming of properties without db migration
834
- * Mapping must be using the shapedb service id
835
- * @param schema
836
- */
837
- function getStorageKey(schema) {
838
- const first = findMapping(schema, (mapping) => mapping.startsWith('shapedb:'));
839
- return first ? splitMapping(first)[1] : undefined;
840
- }
841
- function getPropertyService(schema) {
842
- const first = getFirstMapping(schema);
843
- const split = first?.split(':');
844
- return split ? `${split[0]}:${split[1]}` : undefined;
845
- }
846
- function emptySchema(projectId) {
847
- return {
848
- projectId,
849
- defaultLocale: 'en-us',
850
- locales: ['en-us'],
851
- apiVersion: '2',
852
- schemaVersion: versions_1.CURRENT_SCHEMA_VERSION,
853
- queries: {},
854
- mutations: {},
855
- shapes: {},
856
- workflows: {},
857
- forms: {}
858
- };
859
- }
860
- function createLayerSchema(partialSchema) {
861
- return {
862
- schemaVersion: versions_1.CURRENT_SCHEMA_VERSION,
863
- queries: {},
864
- mutations: {},
865
- shapes: {},
866
- ...partialSchema
867
- };
868
- }
869
- function getShapesById(projectSchema) {
870
- return (0, keyBy_js_1.default)(Object.values(projectSchema.shapes), 'id');
871
- }
872
- /**
873
- * Walk through the project schema and return an array of all
874
- * referenced shape names that are in a service namespace.
875
- *
876
- * @param projectSchema A V3 project schema.
877
- *
878
- * @returns A `string` array with all the shapes that are in namespaces.
879
- */
880
- function getAllNamespaceShapes(projectSchema) {
881
- const isServiceRef = (refItem) => Boolean(refItem.serviceNamespace);
882
- return (0, uniq_js_1.default)(getAllValidRefs(projectSchema, isServiceRef).map(refs_1.refItemToNamespacedShapeName));
883
- }
884
- /**
885
- * Returns a list of all shape names in a service namespace, excluding any
886
- * that have been set directly in the project schema
887
- *
888
- * @todo It's unsound to discard dependencies in this way, should avoid
889
- * collisions with aliases or similar any remote shape that collides,
890
- * e.g., Shopify_Product -> Shopify_Product_2
891
- *
892
- * @param projectSchema A V3 project schema with remote service configs.
893
- *
894
- * @returns A `Set` of shape names.
895
- */
896
- function getNamespacedShapeNameList(projectSchema) {
897
- const requiredShapeNames = new Set();
898
- // All the shape names
899
- const existingShapeNames = new Set(Object.keys(projectSchema.shapes));
900
- // All the referenced shape names with namespaces that belong to a service
901
- const namespacedShapeNames = new Set(getAllNamespaceShapes(projectSchema));
902
- // Add all namespaced shapes to the schema if they are not already present,
903
- // e.g. Shopify_Product
904
- for (const name of namespacedShapeNames) {
905
- if (!existingShapeNames.has(name)) {
906
- requiredShapeNames.add(name);
907
- }
908
- }
909
- return requiredShapeNames;
910
- }
911
- /**
912
- * Filter the service map to return only services passing the GraphQL Service
913
- * typeguard.
914
- *
915
- * @param serviceMap A service map.
916
- *
917
- * @returns A new map with the filtered list of services
918
- */
919
- function filterGraphQLServiceMap(serviceMap) {
920
- const filtered = new Map();
921
- for (const [serviceKey, serviceConfig] of serviceMap) {
922
- if (serviceConfig.serviceType === 'graphql') {
923
- filtered.set(serviceKey, serviceConfig);
924
- }
925
- }
926
- return filtered;
927
- }
928
- /**
929
- * Creates a schema property list chainable fn, allowing you to manipulate and
930
- * iterate the properties in a schema.
931
- */
932
- exports.createSchemaPropertyList = (0, curry_js_1.default)((context, shapeOrSchema) => {
933
- const propSchema = isShape(shapeOrSchema) ? shapeOrSchema.schema : shapeOrSchema;
934
- const schema = (0, refs_1.dereferenceSchema)(context, propSchema, isShape(shapeOrSchema) ? ['shapes', shapeOrSchema.name] : undefined);
935
- const propertyIterator = new Map((0, types_1.isObjectSchema)(schema) ? Object.entries(schema.properties) : undefined);
936
- const defaultOrderByIteratees = [(n) => n[0]];
937
- const defaultOrderByOrders = ['asc'];
938
- const _orderBy = (iteratees = defaultOrderByIteratees, orders = defaultOrderByOrders) => {
939
- self._propertyIterator = new Map((0, orderBy_js_1.default)(iteratees, orders, Array.from(self._propertyIterator)));
940
- return self;
941
- };
942
- const _sortWith = (comparator) => {
943
- self._propertyIterator = new Map(Array.from(self._propertyIterator).sort(comparator));
944
- return self;
945
- };
946
- const _sortByNamesWithList = (comparatorArray) => {
947
- // If no array is provided, the original sort is preserved
948
- if (comparatorArray) {
949
- self._propertyIterator = new Map(Array.from(self._propertyIterator)
950
- .filter(([name]) => comparatorArray.includes(name))
951
- .sort(([nameA], [nameB]) => {
952
- const indexA = comparatorArray.indexOf(nameA);
953
- const indexB = comparatorArray.indexOf(nameB);
954
- return ((indexA > -1 ? indexA : Number.POSITIVE_INFINITY) - (indexB > -1 ? indexB : Number.POSITIVE_INFINITY));
955
- }));
956
- }
957
- return self;
958
- };
959
- const _filterBy = (predicate) => {
960
- self._propertyIterator = new Map(Array.from(self._propertyIterator).filter(predicate));
961
- return self;
962
- };
963
- const _forEach = (iteratee) => {
964
- Array.from(self._propertyIterator).forEach(iteratee);
965
- return self;
966
- };
967
- const _getNodes = () => {
968
- return Array.from(self._propertyIterator);
969
- };
970
- const _getObject = () => {
971
- return Array.from(self._propertyIterator).reduce((curr, node) => Object.assign(curr, { [node[0]]: node[1] }), {});
972
- };
973
- const _getNames = () => {
974
- return Array.from(self._propertyIterator, ([name]) => name);
975
- };
976
- const _getValues = () => {
977
- return Array.from(self._propertyIterator, ([, value]) => value);
978
- };
979
- const self = {
980
- _propertyIterator: propertyIterator,
981
- orderBy: _orderBy,
982
- sortWith: _sortWith,
983
- sortByNamesWithList: _sortByNamesWithList,
984
- filterBy: _filterBy,
985
- forEach: _forEach,
986
- getNodes: _getNodes,
987
- getObject: _getObject,
988
- getNames: _getNames,
989
- getValues: _getValues
990
- };
991
- return self;
992
- });
993
- function isShape(shapeOrSchema) {
994
- return 'schema' in shapeOrSchema;
995
- }
996
- class SchemaPropertyAccessor {
997
- schema;
998
- properties;
999
- entries;
1000
- constructor(context, shapeOrSchema) {
1001
- const propSchema = isShape(shapeOrSchema) ? shapeOrSchema.schema : shapeOrSchema;
1002
- this.schema = (0, refs_1.dereferenceSchema)(context, propSchema, isShape(shapeOrSchema) ? ['shapes', shapeOrSchema.name] : undefined);
1003
- this.entries = (0, types_1.isObjectSchema)(this.schema) ? Object.entries(this.schema.properties) : [];
1004
- this.properties = new Map(this.entries);
1005
- }
1006
- getValue(propertyName) {
1007
- return this.properties.get(propertyName);
1008
- }
1009
- findValue(predicate) {
1010
- return this.entries.find(predicate)?.[1];
1011
- }
1012
- findName(predicate) {
1013
- return this.entries.find(predicate)?.[0];
1014
- }
1015
- getKey(propertyName) {
1016
- const value = this.properties.get(propertyName);
1017
- if (value) {
1018
- return getStorageKey(value);
1019
- }
1020
- }
1021
- }
1022
- /**
1023
- * Creates a schema property accessor, allowing you to safely access schema
1024
- * properties.
1025
- */
1026
- exports.createSchemaPropertyAccessor = (0, curry_js_1.default)((context, shapeOrSchema) => {
1027
- return new SchemaPropertyAccessor(context, shapeOrSchema);
1028
- });
1029
- function findQueryHelper(slice, shapeName, resolver, type) {
1030
- const schemaPath = type === 'query' ? 'queries' : 'mutations';
1031
- return Object.keys(slice[schemaPath]).find((queryName) => {
1032
- const queryOrMutation = slice[schemaPath][queryName];
1033
- return (queryOrMutation.resolver.name === resolver &&
1034
- queryOrMutation.resolver.shapeName === shapeName);
1035
- });
1036
- }
1037
- function ensureQueryHelper(slice, shapeName, resolver, type) {
1038
- const foundQuery = findQueryHelper(slice, shapeName, resolver, type);
1039
- if (!foundQuery) {
1040
- throw new Error(`Failed to find a "${resolver}" ${type} for shape "${shapeName}"`);
1041
- }
1042
- return foundQuery;
1043
- }
1044
- /**
1045
- * Find the query in the schema that corresponds to the given shape and resolver.
1046
- */
1047
- const findQueryByShape = (projectSchema, shapeName, resolver) => findQueryHelper(projectSchema, shapeName, resolver, 'query');
1048
- exports.findQueryByShape = findQueryByShape;
1049
- /**
1050
- * Find the query in the schema that corresponds to the given shape and resolver.
1051
- */
1052
- const findMutationByShape = (projectSchema, shapeName, resolver) => findQueryHelper(projectSchema, shapeName, resolver, 'mutation');
1053
- exports.findMutationByShape = findMutationByShape;
1054
- /**
1055
- * Find the query in the schema that corresponds to the given shape and resolver.
1056
- * Throw an error if that query does not exist
1057
- */
1058
- const ensureQueryByShape = (projectSchema, shapeName, resolver) => ensureQueryHelper(projectSchema, shapeName, resolver, 'query');
1059
- exports.ensureQueryByShape = ensureQueryByShape;
1060
- /**
1061
- * Find the mutation in the schema that corresponds to the given shape and resolver.
1062
- * Throw an error if that mutation does not exist
1063
- */
1064
- const ensureMutationByShape = (projectSchema, shapeName, resolver) => ensureQueryHelper(projectSchema, shapeName, resolver, 'mutation');
1065
- exports.ensureMutationByShape = ensureMutationByShape;
1066
- /**
1067
- * Find the query in the schema that corresponds to the given shape and resolver.
1068
- */
1069
- const getDefaultMutationName = (shapeName, resolver) => {
1070
- const action = resolver.substring(resolver.indexOf(':') + 1);
1071
- return `${action}${shapeName}`;
1072
- };
1073
- exports.getDefaultMutationName = getDefaultMutationName;
1074
- function createShape(name, schema, rest) {
1075
- return {
1076
- name,
1077
- id: name,
1078
- title: name,
1079
- schema,
1080
- ...rest
1081
- };
1082
- }
1083
- function queryToPropertySchema(projectSchema, query) {
1084
- let mapping;
1085
- if ((0, types_1.isGraphqlResolver)(query.resolver)) {
1086
- mapping = (0, refs_1.serializePropertyRef)({
1087
- serviceId: query.resolver.service,
1088
- shapeName: 'Query',
1089
- propertyName: query.resolver.fieldName
1090
- });
1091
- }
1092
- return {
1093
- ...(0, refs_1.returnShapeToSchema)(projectSchema, query.shape),
1094
- ...(mapping ? { '@mapping': mapping } : {}),
1095
- '@resolver': query.resolver,
1096
- '@args': query.args
1097
- };
1098
- }
1099
- function getQueriesShape(projectSchema, operation) {
1100
- return createShape((0, util_1.pascalCase)(operation), {
1101
- type: 'object',
1102
- properties: (0, mapValues_js_1.default)(projectSchema[operation === 'query' ? 'queries' : 'mutations'], (query) => queryToPropertySchema(projectSchema, query))
1103
- });
1104
- }
1105
- function fieldMappingContainsKey(fieldMapping, key) {
1106
- if ((0, isArray_js_1.default)(fieldMapping)) {
1107
- return (0, some_js_1.default)(fieldMapping, (mapping) => parseMapping(mapping).key === key);
1108
- }
1109
- return parseMapping(fieldMapping).key === key;
1110
- }
1111
- /**
1112
- * Return true if `schemaWithRef` is a ref to a shape named `shapeName`
1113
- */
1114
- function schemaMatchesShapeName(workingCopy, propertySchema, shapeName) {
1115
- const arrayOfShapeRef = (0, refs_1.getRef)(workingCopy, propertySchema);
1116
- return Boolean(arrayOfShapeRef && (0, refs_1.refItemToNamespacedShapeName)(arrayOfShapeRef) === shapeName);
1117
- }
1118
- /**
1119
- * Return true if `shape` has a property that is an array of refs to `shapeName`
1120
- */
1121
- const shapeHasArrayPropOfShape = (projectSchema, shape, shapeName) => {
1122
- if (shape && (0, types_1.isObjectSchema)(shape.schema)) {
1123
- for (const propName in shape.schema.properties) {
1124
- if (Object.hasOwn(shape.schema.properties, propName)) {
1125
- const propSchema = shape.schema.properties[propName];
1126
- if (propSchema.items &&
1127
- (0, types_1.isRefSchema)(propSchema.items) &&
1128
- schemaMatchesShapeName(projectSchema, propSchema.items, shapeName)) {
1129
- return true;
1130
- }
1131
- }
1132
- }
1133
- }
1134
- return false;
1135
- };
1136
- exports.shapeHasArrayPropOfShape = shapeHasArrayPropOfShape;
1137
- const getQueryMapName = (type) => {
1138
- return type === 'query' ? 'queries' : 'mutations';
1139
- };
1140
- exports.getQueryMapName = getQueryMapName;