@takeshape/schema 11.45.5 → 11.47.1

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 (465) hide show
  1. package/dist/cjs/src/agents.js +6 -6
  2. package/dist/cjs/src/api-version.js +1 -1
  3. package/dist/cjs/src/content-schema-transform.js +12 -12
  4. package/dist/cjs/src/create-input-schema.js +1 -1
  5. package/dist/cjs/src/enum.js +1 -1
  6. package/dist/cjs/src/flatten-templates.js +4 -4
  7. package/dist/cjs/src/get-is-leaf.js +1 -1
  8. package/dist/cjs/src/interfaces.js +11 -9
  9. package/dist/cjs/src/layers/layers.js +11 -5
  10. package/dist/cjs/src/layers/refs.js +3 -3
  11. package/dist/cjs/src/layers/type-utils.js +1 -1
  12. package/dist/cjs/src/migration/index.js +3 -1
  13. package/dist/cjs/src/migration/to/v3.0.0.js +20 -8
  14. package/dist/cjs/src/migration/to/v3.1.0.js +6 -4
  15. package/dist/cjs/src/migration/to/v3.10.0.js +1 -1
  16. package/dist/cjs/src/migration/to/v3.13.0.js +1 -1
  17. package/dist/cjs/src/migration/to/v3.17.0.js +1 -1
  18. package/dist/cjs/src/migration/to/v3.18.0.js +4 -4
  19. package/dist/cjs/src/migration/to/v3.18.1.js +1 -1
  20. package/dist/cjs/src/migration/to/v3.18.2.js +1 -1
  21. package/dist/cjs/src/migration/to/v3.20.0.js +5 -2
  22. package/dist/cjs/src/migration/to/v3.22.0.js +1 -1
  23. package/dist/cjs/src/migration/to/v3.31.0.js +2 -2
  24. package/dist/cjs/src/migration/to/v3.32.0.js +3 -1
  25. package/dist/cjs/src/migration/to/v3.34.0.js +6 -9
  26. package/dist/cjs/src/migration/to/v3.36.0.js +1 -1
  27. package/dist/cjs/src/migration/to/v3.39.0.js +8 -8
  28. package/dist/cjs/src/migration/to/v3.40.0.js +1 -1
  29. package/dist/cjs/src/migration/to/v3.46.0.js +1 -1
  30. package/dist/cjs/src/migration/to/v3.51.0.js +12 -0
  31. package/dist/cjs/src/migration/to/v3.9.0.js +3 -3
  32. package/dist/cjs/src/models/project-schema.js +4 -4
  33. package/dist/cjs/src/models/shape.js +2 -2
  34. package/dist/cjs/src/project-schema/index.js +4 -2
  35. package/dist/cjs/src/project-schema/migrate.js +3 -1
  36. package/dist/cjs/src/project-schema/v3.51.0.js +8 -0
  37. package/dist/cjs/src/refs.js +28 -18
  38. package/dist/cjs/src/relationships.js +25 -20
  39. package/dist/cjs/src/runtime-schema.js +16 -9
  40. package/dist/cjs/src/schema-transform.js +3 -3
  41. package/dist/cjs/src/schema-util.js +38 -30
  42. package/dist/cjs/src/schemas/auth-schemas.json +18 -78
  43. package/dist/cjs/src/schemas/index.js +7 -5
  44. package/dist/cjs/src/schemas/project-schema/experimental.json +7 -20
  45. package/dist/cjs/src/schemas/project-schema/latest.json +166 -566
  46. package/dist/cjs/src/schemas/project-schema/meta-schema-v1.0.0.json +3 -17
  47. package/dist/cjs/src/schemas/project-schema/meta-schema-v3.0.0.json +4 -4
  48. package/dist/cjs/src/schemas/project-schema/meta-schema-v3.1.0.json +4 -4
  49. package/dist/cjs/src/schemas/project-schema/meta-schema-v3.2.0.json +5 -5
  50. package/dist/cjs/src/schemas/project-schema/meta-schema-v3.3.0.json +5 -5
  51. package/dist/cjs/src/schemas/project-schema/meta-schema-v3.4.0.json +11 -43
  52. package/dist/cjs/src/schemas/project-schema/meta-schema-v3.5.0.json +7 -7
  53. package/dist/cjs/src/schemas/project-schema/meta-schema-v3.5.1.json +8 -11
  54. package/dist/cjs/src/schemas/project-schema/meta-schema-v3.6.0.json +8 -11
  55. package/dist/cjs/src/schemas/project-schema/meta-schema-v3.7.0.json +11 -9
  56. package/dist/cjs/src/schemas/project-schema/meta-schema-v3.8.0.json +11 -9
  57. package/dist/cjs/src/schemas/project-schema/meta-schema-v3.9.0.json +24 -22
  58. package/dist/cjs/src/schemas/project-schema/v1.0.0.json +3 -3
  59. package/dist/cjs/src/schemas/project-schema/v3.0.0.json +1 -1
  60. package/dist/cjs/src/schemas/project-schema/v3.1.0.json +2 -2
  61. package/dist/cjs/src/schemas/project-schema/v3.10.0.json +32 -30
  62. package/dist/cjs/src/schemas/project-schema/v3.11.0.json +32 -30
  63. package/dist/cjs/src/schemas/project-schema/v3.12.0.json +33 -36
  64. package/dist/cjs/src/schemas/project-schema/v3.12.1.json +33 -36
  65. package/dist/cjs/src/schemas/project-schema/v3.12.2.json +2122 -2125
  66. package/dist/cjs/src/schemas/project-schema/v3.12.3.json +2175 -2178
  67. package/dist/cjs/src/schemas/project-schema/v3.13.0.json +32 -30
  68. package/dist/cjs/src/schemas/project-schema/v3.14.0.json +32 -30
  69. package/dist/cjs/src/schemas/project-schema/v3.15.0.json +40 -38
  70. package/dist/cjs/src/schemas/project-schema/v3.16.0.json +40 -38
  71. package/dist/cjs/src/schemas/project-schema/v3.17.0.json +47 -39
  72. package/dist/cjs/src/schemas/project-schema/v3.17.1.json +2204 -2196
  73. package/dist/cjs/src/schemas/project-schema/v3.18.0.json +40 -38
  74. package/dist/cjs/src/schemas/project-schema/v3.18.1.json +40 -38
  75. package/dist/cjs/src/schemas/project-schema/v3.18.2.json +40 -38
  76. package/dist/cjs/src/schemas/project-schema/v3.19.0.json +40 -38
  77. package/dist/cjs/src/schemas/project-schema/v3.2.0.json +1 -1
  78. package/dist/cjs/src/schemas/project-schema/v3.20.0.json +40 -38
  79. package/dist/cjs/src/schemas/project-schema/v3.21.0.json +41 -39
  80. package/dist/cjs/src/schemas/project-schema/v3.22.0.json +41 -39
  81. package/dist/cjs/src/schemas/project-schema/v3.23.0.json +43 -43
  82. package/dist/cjs/src/schemas/project-schema/v3.24.0.json +105 -458
  83. package/dist/cjs/src/schemas/project-schema/v3.25.0.json +105 -458
  84. package/dist/cjs/src/schemas/project-schema/v3.26.0.json +107 -466
  85. package/dist/cjs/src/schemas/project-schema/v3.27.0.json +107 -466
  86. package/dist/cjs/src/schemas/project-schema/v3.28.0.json +112 -471
  87. package/dist/cjs/src/schemas/project-schema/v3.29.0.json +112 -471
  88. package/dist/cjs/src/schemas/project-schema/v3.3.0.json +1 -1
  89. package/dist/cjs/src/schemas/project-schema/v3.30.0.json +112 -472
  90. package/dist/cjs/src/schemas/project-schema/v3.31.0.json +112 -486
  91. package/dist/cjs/src/schemas/project-schema/v3.32.0.json +113 -488
  92. package/dist/cjs/src/schemas/project-schema/v3.33.0.json +113 -488
  93. package/dist/cjs/src/schemas/project-schema/v3.34.0.json +113 -488
  94. package/dist/cjs/src/schemas/project-schema/v3.35.0.json +114 -491
  95. package/dist/cjs/src/schemas/project-schema/v3.36.0.json +114 -491
  96. package/dist/cjs/src/schemas/project-schema/v3.37.0.json +118 -511
  97. package/dist/cjs/src/schemas/project-schema/v3.38.0.json +118 -511
  98. package/dist/cjs/src/schemas/project-schema/v3.39.0.json +118 -511
  99. package/dist/cjs/src/schemas/project-schema/v3.4.0.json +1 -1
  100. package/dist/cjs/src/schemas/project-schema/v3.40.0.json +118 -512
  101. package/dist/cjs/src/schemas/project-schema/v3.41.0.json +118 -512
  102. package/dist/cjs/src/schemas/project-schema/v3.42.0.json +118 -512
  103. package/dist/cjs/src/schemas/project-schema/v3.43.0.json +118 -512
  104. package/dist/cjs/src/schemas/project-schema/v3.44.0.json +125 -540
  105. package/dist/cjs/src/schemas/project-schema/v3.45.0.json +128 -554
  106. package/dist/cjs/src/schemas/project-schema/v3.46.0.json +129 -560
  107. package/dist/cjs/src/schemas/project-schema/v3.47.0.json +131 -568
  108. package/dist/cjs/src/schemas/project-schema/v3.48.0.json +132 -572
  109. package/dist/cjs/src/schemas/project-schema/v3.49.0.json +132 -558
  110. package/dist/cjs/src/schemas/project-schema/v3.5.0.json +1 -1
  111. package/dist/cjs/src/schemas/project-schema/v3.5.1.json +1 -1
  112. package/dist/cjs/src/schemas/project-schema/v3.50.0.json +165 -565
  113. package/dist/cjs/src/schemas/project-schema/v3.51.0.json +3320 -0
  114. package/dist/cjs/src/schemas/project-schema/v3.6.0.json +1 -1
  115. package/dist/cjs/src/schemas/project-schema/v3.7.0.json +1 -1
  116. package/dist/cjs/src/schemas/project-schema/v3.8.0.json +1 -1
  117. package/dist/cjs/src/schemas/project-schema/v3.9.0.json +1 -1
  118. package/dist/cjs/src/schemas/project-schema/v4.0.0.json +31 -29
  119. package/dist/cjs/src/schemas/project-schema.json +3 -0
  120. package/dist/cjs/src/schemas/user-schema.json +2 -9
  121. package/dist/cjs/src/service-dependencies.js +15 -9
  122. package/dist/cjs/src/services/services.js +12 -11
  123. package/dist/cjs/src/services/util.js +4 -4
  124. package/dist/cjs/src/template-shapes/templates.js +18 -12
  125. package/dist/cjs/src/template-shapes/where.js +23 -14
  126. package/dist/cjs/src/types/utils.js +3 -3
  127. package/dist/cjs/src/unions.js +6 -8
  128. package/dist/cjs/src/util/api-indexing.js +4 -4
  129. package/dist/cjs/src/util/detect-cycles.js +2 -2
  130. package/dist/cjs/src/util/find-shape-at-path.js +1 -1
  131. package/dist/cjs/src/util/form-config.js +0 -1
  132. package/dist/cjs/src/util/get-conflicting-properties.js +1 -1
  133. package/dist/cjs/src/util/merge.js +22 -13
  134. package/dist/cjs/src/util/patch-schema.js +2 -2
  135. package/dist/cjs/src/util/shapes.js +2 -2
  136. package/dist/cjs/src/validate.js +64 -47
  137. package/dist/cjs/src/workflows.js +4 -4
  138. package/dist/esm/src/agents.js +6 -6
  139. package/dist/esm/src/api-version.js +1 -1
  140. package/dist/esm/src/content-schema-transform.js +12 -12
  141. package/dist/esm/src/create-input-schema.js +1 -1
  142. package/dist/esm/src/enum.js +1 -1
  143. package/dist/esm/src/flatten-templates.js +4 -4
  144. package/dist/esm/src/get-is-leaf.js +1 -1
  145. package/dist/esm/src/interfaces.js +12 -10
  146. package/dist/esm/src/layers/layers.js +12 -6
  147. package/dist/esm/src/layers/refs.js +3 -3
  148. package/dist/esm/src/layers/type-utils.js +1 -1
  149. package/dist/esm/src/migration/index.js +3 -1
  150. package/dist/esm/src/migration/to/v3.0.0.js +20 -8
  151. package/dist/esm/src/migration/to/v3.1.0.js +6 -4
  152. package/dist/esm/src/migration/to/v3.10.0.js +1 -1
  153. package/dist/esm/src/migration/to/v3.13.0.js +1 -1
  154. package/dist/esm/src/migration/to/v3.17.0.js +1 -1
  155. package/dist/esm/src/migration/to/v3.18.0.js +4 -4
  156. package/dist/esm/src/migration/to/v3.18.1.js +1 -1
  157. package/dist/esm/src/migration/to/v3.18.2.js +1 -1
  158. package/dist/esm/src/migration/to/v3.20.0.js +5 -2
  159. package/dist/esm/src/migration/to/v3.22.0.js +1 -1
  160. package/dist/esm/src/migration/to/v3.31.0.js +2 -2
  161. package/dist/esm/src/migration/to/v3.32.0.js +3 -1
  162. package/dist/esm/src/migration/to/v3.34.0.js +6 -9
  163. package/dist/esm/src/migration/to/v3.36.0.js +1 -1
  164. package/dist/esm/src/migration/to/v3.39.0.js +8 -8
  165. package/dist/esm/src/migration/to/v3.40.0.js +1 -1
  166. package/dist/esm/src/migration/to/v3.46.0.js +1 -1
  167. package/dist/esm/src/migration/to/v3.51.0.js +10 -0
  168. package/dist/esm/src/migration/to/v3.9.0.js +3 -3
  169. package/dist/esm/src/mocks.js +1 -1
  170. package/dist/esm/src/models/project-schema.js +4 -4
  171. package/dist/esm/src/models/shape.js +2 -2
  172. package/dist/esm/src/project-schema/index.js +3 -1
  173. package/dist/esm/src/project-schema/migrate.js +4 -2
  174. package/dist/esm/src/project-schema/v3.51.0.js +7 -0
  175. package/dist/esm/src/refs.js +29 -19
  176. package/dist/esm/src/relationships.js +26 -21
  177. package/dist/esm/src/runtime-schema.js +16 -9
  178. package/dist/esm/src/schema-transform.js +3 -3
  179. package/dist/esm/src/schema-util.js +40 -32
  180. package/dist/esm/src/schemas/auth-schemas.json +18 -78
  181. package/dist/esm/src/schemas/index.js +4 -2
  182. package/dist/esm/src/schemas/project-schema/experimental.json +7 -20
  183. package/dist/esm/src/schemas/project-schema/latest.json +166 -566
  184. package/dist/esm/src/schemas/project-schema/meta-schema-v1.0.0.json +3 -17
  185. package/dist/esm/src/schemas/project-schema/meta-schema-v3.0.0.json +4 -4
  186. package/dist/esm/src/schemas/project-schema/meta-schema-v3.1.0.json +4 -4
  187. package/dist/esm/src/schemas/project-schema/meta-schema-v3.2.0.json +5 -5
  188. package/dist/esm/src/schemas/project-schema/meta-schema-v3.3.0.json +5 -5
  189. package/dist/esm/src/schemas/project-schema/meta-schema-v3.4.0.json +11 -43
  190. package/dist/esm/src/schemas/project-schema/meta-schema-v3.5.0.json +7 -7
  191. package/dist/esm/src/schemas/project-schema/meta-schema-v3.5.1.json +8 -11
  192. package/dist/esm/src/schemas/project-schema/meta-schema-v3.6.0.json +8 -11
  193. package/dist/esm/src/schemas/project-schema/meta-schema-v3.7.0.json +11 -9
  194. package/dist/esm/src/schemas/project-schema/meta-schema-v3.8.0.json +11 -9
  195. package/dist/esm/src/schemas/project-schema/meta-schema-v3.9.0.json +24 -22
  196. package/dist/esm/src/schemas/project-schema/v1.0.0.json +3 -3
  197. package/dist/esm/src/schemas/project-schema/v3.0.0.json +1 -1
  198. package/dist/esm/src/schemas/project-schema/v3.1.0.json +2 -2
  199. package/dist/esm/src/schemas/project-schema/v3.10.0.json +32 -30
  200. package/dist/esm/src/schemas/project-schema/v3.11.0.json +32 -30
  201. package/dist/esm/src/schemas/project-schema/v3.12.0.json +33 -36
  202. package/dist/esm/src/schemas/project-schema/v3.12.1.json +33 -36
  203. package/dist/esm/src/schemas/project-schema/v3.12.2.json +2122 -2125
  204. package/dist/esm/src/schemas/project-schema/v3.12.3.json +2175 -2178
  205. package/dist/esm/src/schemas/project-schema/v3.13.0.json +32 -30
  206. package/dist/esm/src/schemas/project-schema/v3.14.0.json +32 -30
  207. package/dist/esm/src/schemas/project-schema/v3.15.0.json +40 -38
  208. package/dist/esm/src/schemas/project-schema/v3.16.0.json +40 -38
  209. package/dist/esm/src/schemas/project-schema/v3.17.0.json +47 -39
  210. package/dist/esm/src/schemas/project-schema/v3.17.1.json +2204 -2196
  211. package/dist/esm/src/schemas/project-schema/v3.18.0.json +40 -38
  212. package/dist/esm/src/schemas/project-schema/v3.18.1.json +40 -38
  213. package/dist/esm/src/schemas/project-schema/v3.18.2.json +40 -38
  214. package/dist/esm/src/schemas/project-schema/v3.19.0.json +40 -38
  215. package/dist/esm/src/schemas/project-schema/v3.2.0.json +1 -1
  216. package/dist/esm/src/schemas/project-schema/v3.20.0.json +40 -38
  217. package/dist/esm/src/schemas/project-schema/v3.21.0.json +41 -39
  218. package/dist/esm/src/schemas/project-schema/v3.22.0.json +41 -39
  219. package/dist/esm/src/schemas/project-schema/v3.23.0.json +43 -43
  220. package/dist/esm/src/schemas/project-schema/v3.24.0.json +105 -458
  221. package/dist/esm/src/schemas/project-schema/v3.25.0.json +105 -458
  222. package/dist/esm/src/schemas/project-schema/v3.26.0.json +107 -466
  223. package/dist/esm/src/schemas/project-schema/v3.27.0.json +107 -466
  224. package/dist/esm/src/schemas/project-schema/v3.28.0.json +112 -471
  225. package/dist/esm/src/schemas/project-schema/v3.29.0.json +112 -471
  226. package/dist/esm/src/schemas/project-schema/v3.3.0.json +1 -1
  227. package/dist/esm/src/schemas/project-schema/v3.30.0.json +112 -472
  228. package/dist/esm/src/schemas/project-schema/v3.31.0.json +112 -486
  229. package/dist/esm/src/schemas/project-schema/v3.32.0.json +113 -488
  230. package/dist/esm/src/schemas/project-schema/v3.33.0.json +113 -488
  231. package/dist/esm/src/schemas/project-schema/v3.34.0.json +113 -488
  232. package/dist/esm/src/schemas/project-schema/v3.35.0.json +114 -491
  233. package/dist/esm/src/schemas/project-schema/v3.36.0.json +114 -491
  234. package/dist/esm/src/schemas/project-schema/v3.37.0.json +118 -511
  235. package/dist/esm/src/schemas/project-schema/v3.38.0.json +118 -511
  236. package/dist/esm/src/schemas/project-schema/v3.39.0.json +118 -511
  237. package/dist/esm/src/schemas/project-schema/v3.4.0.json +1 -1
  238. package/dist/esm/src/schemas/project-schema/v3.40.0.json +118 -512
  239. package/dist/esm/src/schemas/project-schema/v3.41.0.json +118 -512
  240. package/dist/esm/src/schemas/project-schema/v3.42.0.json +118 -512
  241. package/dist/esm/src/schemas/project-schema/v3.43.0.json +118 -512
  242. package/dist/esm/src/schemas/project-schema/v3.44.0.json +125 -540
  243. package/dist/esm/src/schemas/project-schema/v3.45.0.json +128 -554
  244. package/dist/esm/src/schemas/project-schema/v3.46.0.json +129 -560
  245. package/dist/esm/src/schemas/project-schema/v3.47.0.json +131 -568
  246. package/dist/esm/src/schemas/project-schema/v3.48.0.json +132 -572
  247. package/dist/esm/src/schemas/project-schema/v3.49.0.json +132 -558
  248. package/dist/esm/src/schemas/project-schema/v3.5.0.json +1 -1
  249. package/dist/esm/src/schemas/project-schema/v3.5.1.json +1 -1
  250. package/dist/esm/src/schemas/project-schema/v3.50.0.json +165 -565
  251. package/dist/esm/src/schemas/project-schema/v3.51.0.json +3320 -0
  252. package/dist/esm/src/schemas/project-schema/v3.6.0.json +1 -1
  253. package/dist/esm/src/schemas/project-schema/v3.7.0.json +1 -1
  254. package/dist/esm/src/schemas/project-schema/v3.8.0.json +1 -1
  255. package/dist/esm/src/schemas/project-schema/v3.9.0.json +1 -1
  256. package/dist/esm/src/schemas/project-schema/v4.0.0.json +31 -29
  257. package/dist/esm/src/schemas/project-schema.json +3 -0
  258. package/dist/esm/src/schemas/user-schema.json +2 -9
  259. package/dist/esm/src/service-dependencies.js +17 -11
  260. package/dist/esm/src/services/services.js +12 -11
  261. package/dist/esm/src/services/util.js +4 -4
  262. package/dist/esm/src/template-shapes/templates.js +18 -12
  263. package/dist/esm/src/template-shapes/where.js +24 -15
  264. package/dist/esm/src/types/utils.js +3 -3
  265. package/dist/esm/src/unions.js +6 -8
  266. package/dist/esm/src/util/api-indexing.js +4 -4
  267. package/dist/esm/src/util/detect-cycles.js +2 -2
  268. package/dist/esm/src/util/find-shape-at-path.js +1 -1
  269. package/dist/esm/src/util/form-config.js +0 -1
  270. package/dist/esm/src/util/get-conflicting-properties.js +1 -1
  271. package/dist/esm/src/util/merge.js +23 -14
  272. package/dist/esm/src/util/patch-schema.js +2 -2
  273. package/dist/esm/src/util/shapes.js +2 -2
  274. package/dist/esm/src/validate.js +64 -47
  275. package/dist/esm/src/workflows.js +4 -4
  276. package/dist/types/src/agents.d.ts +1 -1
  277. package/dist/types/src/builtin-schema.d.ts +2 -2
  278. package/dist/types/src/content-schema-transform.d.ts +1 -1
  279. package/dist/types/src/create-input-schema.d.ts +1 -1
  280. package/dist/types/src/enum.d.ts +1 -1
  281. package/dist/types/src/flatten-templates.d.ts +1 -1
  282. package/dist/types/src/layers/layers.d.ts +1 -1
  283. package/dist/types/src/layers/refs.d.ts +1 -1
  284. package/dist/types/src/layers/type-utils.d.ts +1 -1
  285. package/dist/types/src/layers/visitor.d.ts +2 -2
  286. package/dist/types/src/migration/index.d.ts +1 -0
  287. package/dist/types/src/migration/to/v3.17.1.d.ts +1 -1
  288. package/dist/types/src/migration/to/v3.19.0.d.ts +1 -1
  289. package/dist/types/src/migration/to/v3.21.0.d.ts +1 -1
  290. package/dist/types/src/migration/to/v3.22.0.d.ts +1 -1
  291. package/dist/types/src/migration/to/v3.23.0.d.ts +1 -1
  292. package/dist/types/src/migration/to/v3.24.0.d.ts +1 -1
  293. package/dist/types/src/migration/to/v3.25.0.d.ts +1 -1
  294. package/dist/types/src/migration/to/v3.26.0.d.ts +1 -1
  295. package/dist/types/src/migration/to/v3.27.0.d.ts +1 -1
  296. package/dist/types/src/migration/to/v3.28.0.d.ts +1 -1
  297. package/dist/types/src/migration/to/v3.29.0.d.ts +1 -1
  298. package/dist/types/src/migration/to/v3.30.0.d.ts +1 -1
  299. package/dist/types/src/migration/to/v3.31.0.d.ts +1 -1
  300. package/dist/types/src/migration/to/v3.32.0.d.ts +1 -1
  301. package/dist/types/src/migration/to/v3.33.0.d.ts +1 -1
  302. package/dist/types/src/migration/to/v3.34.0.d.ts +1 -1
  303. package/dist/types/src/migration/to/v3.35.0.d.ts +1 -1
  304. package/dist/types/src/migration/to/v3.36.0.d.ts +1 -1
  305. package/dist/types/src/migration/to/v3.37.0.d.ts +1 -1
  306. package/dist/types/src/migration/to/v3.38.0.d.ts +1 -1
  307. package/dist/types/src/migration/to/v3.39.0.d.ts +1 -1
  308. package/dist/types/src/migration/to/v3.40.0.d.ts +1 -1
  309. package/dist/types/src/migration/to/v3.41.0.d.ts +1 -1
  310. package/dist/types/src/migration/to/v3.42.0.d.ts +1 -1
  311. package/dist/types/src/migration/to/v3.43.0.d.ts +1 -1
  312. package/dist/types/src/migration/to/v3.44.0.d.ts +1 -1
  313. package/dist/types/src/migration/to/v3.45.0.d.ts +1 -1
  314. package/dist/types/src/migration/to/v3.46.0.d.ts +1 -1
  315. package/dist/types/src/migration/to/v3.47.0.d.ts +1 -1
  316. package/dist/types/src/migration/to/v3.48.0.d.ts +1 -1
  317. package/dist/types/src/migration/to/v3.49.0.d.ts +1 -1
  318. package/dist/types/src/migration/to/v3.50.0.d.ts +1 -1
  319. package/dist/types/src/migration/to/v3.51.0.d.ts +4 -0
  320. package/dist/types/src/migration/types.d.ts +1 -1
  321. package/dist/types/src/mocks.d.ts +1 -1
  322. package/dist/types/src/models/project-schema.d.ts +3 -3
  323. package/dist/types/src/models/query.d.ts +2 -2
  324. package/dist/types/src/models/service.d.ts +2 -2
  325. package/dist/types/src/models/shape.d.ts +2 -2
  326. package/dist/types/src/project-schema/index.d.ts +4 -1
  327. package/dist/types/src/project-schema/latest.d.ts +28 -10
  328. package/dist/types/src/project-schema/v3.50.0.d.ts +27 -9
  329. package/dist/types/src/project-schema/v3.51.0.d.ts +2189 -0
  330. package/dist/types/src/refs.d.ts +1 -1
  331. package/dist/types/src/relationships.d.ts +2 -2
  332. package/dist/types/src/runtime-schema.d.ts +1 -1
  333. package/dist/types/src/schema-transform.d.ts +1 -1
  334. package/dist/types/src/schema-util.d.ts +2 -2
  335. package/dist/types/src/schemas/index.d.ts +2 -2
  336. package/dist/types/src/service-dependencies.d.ts +2 -2
  337. package/dist/types/src/services/services.d.ts +3 -3
  338. package/dist/types/src/services/util.d.ts +2 -2
  339. package/dist/types/src/template-shapes/index.d.ts +2 -2
  340. package/dist/types/src/template-shapes/names.d.ts +1 -1
  341. package/dist/types/src/template-shapes/types.d.ts +2 -2
  342. package/dist/types/src/template-shapes/where.d.ts +1 -1
  343. package/dist/types/src/types/transforms.d.ts +1 -1
  344. package/dist/types/src/types/types.d.ts +4 -4
  345. package/dist/types/src/types/utils.d.ts +2 -2
  346. package/dist/types/src/unions.d.ts +2 -2
  347. package/dist/types/src/util/ai-tools.d.ts +1 -1
  348. package/dist/types/src/util/api-indexing.d.ts +1 -1
  349. package/dist/types/src/util/detect-cycles.d.ts +1 -1
  350. package/dist/types/src/util/find-shape-at-path.d.ts +1 -1
  351. package/dist/types/src/util/form-config.d.ts +1 -1
  352. package/dist/types/src/util/get-conflicting-properties.d.ts +1 -1
  353. package/dist/types/src/util/get-return-shape.d.ts +1 -1
  354. package/dist/types/src/util/has-arg.d.ts +2 -2
  355. package/dist/types/src/util/merge.d.ts +1 -1
  356. package/dist/types/src/util/patch-schema.d.ts +2 -2
  357. package/dist/types/src/util/shapes.d.ts +1 -1
  358. package/dist/types/src/validate.d.ts +4 -4
  359. package/dist/types/src/workflows.d.ts +1 -1
  360. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  361. package/examples/latest/agent-schema.json +5 -13
  362. package/examples/latest/all-fields-shapes-inline.json +19 -53
  363. package/examples/latest/all-fields-shapes.json +27 -77
  364. package/examples/latest/betzino.json +903 -3140
  365. package/examples/latest/blog-schema.json +9 -29
  366. package/examples/latest/brewery-schema.json +8 -26
  367. package/examples/latest/clear-cache-schema.json +4 -8
  368. package/examples/latest/complex-project-schema.json +99 -360
  369. package/examples/latest/complex-schema.json +487 -1754
  370. package/examples/latest/edit-schema.json +5 -12
  371. package/examples/latest/fabric-ecommerce.json +188 -839
  372. package/examples/latest/frank-and-fred-schema.json +489 -1756
  373. package/examples/latest/klirr-schema.json +683 -2412
  374. package/examples/latest/layers/rick-and-morty-layer.json +12 -33
  375. package/examples/latest/layers/shopify-layer-2023-01.json +2207 -8638
  376. package/examples/latest/layers/shopify-storefront-2023-04.json +403 -1713
  377. package/examples/latest/layers/wordpress-2024-01.json +689 -2744
  378. package/examples/latest/massive-schema.json +132 -585
  379. package/examples/latest/mill-components-schema.json +30 -126
  380. package/examples/latest/nested-shape-arrays.json +8 -20
  381. package/examples/latest/one-earth.json +237 -1114
  382. package/examples/latest/pet-oneof-array.json +8 -23
  383. package/examples/latest/post-schema.json +7 -21
  384. package/examples/latest/pruned-shopify-product-schema.json +186 -831
  385. package/examples/latest/rag-example.json +6 -16
  386. package/examples/latest/real-world-schema.json +15 -57
  387. package/examples/latest/recursive-repeater-schema.json +5 -12
  388. package/examples/latest/recursive-schema.json +5 -12
  389. package/examples/latest/rick-and-morty-ast.json +46 -175
  390. package/examples/latest/rick-and-morty-graphql.json +26 -101
  391. package/examples/latest/rick-and-morty-rest.json +4 -8
  392. package/examples/latest/rick-and-morty-with-indexing.json +6 -14
  393. package/examples/latest/schema-where-filter.json +12 -41
  394. package/examples/latest/schema-with-repeater-draftjs.json +4 -9
  395. package/examples/latest/schema-with-rick-and-morty.json +3 -5
  396. package/examples/latest/shape-books-v3_2_0.json +18 -72
  397. package/examples/latest/shape-books.json +18 -72
  398. package/examples/latest/shape-editor-schema-edited.json +24 -70
  399. package/examples/latest/shape-editor-schema-initial.json +11 -29
  400. package/examples/latest/shapedb-crud-every-prop-type.json +9 -23
  401. package/examples/latest/shopify-lookbook.json +6 -20
  402. package/examples/latest/shopify-product-2022-07.json +727 -3218
  403. package/examples/latest/shopify-product-2023-04.json +1013 -4497
  404. package/examples/latest/shopify-store-with-widget.json +214 -943
  405. package/examples/latest/stripe-product-runtime-schema.json +82 -278
  406. package/examples/latest/stripe-starter-resolved.json +477 -1954
  407. package/examples/latest/user-schema-no-required.json +4 -14
  408. package/examples/latest/user-schema-with-defaults.json +6 -28
  409. package/examples/latest/valvoline-ai-demo.json +18 -70
  410. package/examples/latest/vector-search-schema.json +9 -25
  411. package/examples/source/agent-schema.json +29 -16
  412. package/examples/source/all-fields-shapes-inline.json +21 -30
  413. package/examples/source/all-fields-shapes.json +26 -76
  414. package/examples/source/betzino.json +1501 -4960
  415. package/examples/source/blog-schema.json +1 -1
  416. package/examples/source/brewery-schema.json +1 -1
  417. package/examples/source/clear-cache-schema.json +4 -4
  418. package/examples/source/complex-project-schema.json +196 -688
  419. package/examples/source/edit-schema.json +3 -3
  420. package/examples/source/fabric-ecommerce.json +186 -837
  421. package/examples/source/frank-and-fred-schema.json +1136 -3929
  422. package/examples/source/layers/rick-and-morty-layer.json +10 -31
  423. package/examples/source/layers/shopify-layer-2023-01.json +2205 -8636
  424. package/examples/source/layers/shopify-storefront-2023-04.json +401 -1711
  425. package/examples/source/layers/wordpress-2024-01.json +689 -2743
  426. package/examples/source/massive-schema.json +386 -1455
  427. package/examples/source/nested-shape-arrays.json +12 -12
  428. package/examples/source/pet-oneof-array.json +31 -29
  429. package/examples/source/post-schema.json +1 -1
  430. package/examples/source/pruned-shopify-product-schema.json +184 -829
  431. package/examples/source/rag-example.json +5 -15
  432. package/examples/source/real-world-schema.json +32 -119
  433. package/examples/source/recursive-repeater-schema.json +3 -8
  434. package/examples/source/recursive-schema.json +1 -1
  435. package/examples/source/rick-and-morty-ast.json +66 -251
  436. package/examples/source/rick-and-morty-graphql.json +41 -162
  437. package/examples/source/rick-and-morty-rest.json +24 -6
  438. package/examples/source/rick-and-morty-with-indexing.json +25 -25
  439. package/examples/source/schema-where-filter.json +29 -50
  440. package/examples/source/schema-with-repeater-draftjs.json +9 -31
  441. package/examples/source/schema-with-rick-and-morty.json +4 -4
  442. package/examples/source/shape-books.json +49 -181
  443. package/examples/source/shape-editor-schema-edited.json +22 -68
  444. package/examples/source/shape-editor-schema-initial.json +9 -27
  445. package/examples/source/shapedb-crud-every-prop-type.json +20 -29
  446. package/examples/source/shopify-product-2022-07.json +736 -3261
  447. package/examples/source/shopify-product-2023-04.json +1022 -4540
  448. package/examples/source/shopify-store-with-widget.json +212 -941
  449. package/examples/source/stripe-product-runtime-schema.json +91 -321
  450. package/examples/source/stripe-starter-resolved.json +475 -1952
  451. package/examples/source/user-schema-with-defaults.json +1 -9
  452. package/examples/source/valvoline-ai-demo.json +175 -219
  453. package/examples/source/vector-search-schema.json +37 -38
  454. package/examples/v4_0_0/rick-and-morty-notes/flattened-schema.json +15 -49
  455. package/examples/v4_0_0/rick-and-morty-notes/layers/character-notes.json +8 -8
  456. package/examples/v4_0_0/rick-and-morty-notes/layers/takeshape-builtins.json +1 -3
  457. package/examples/v4_0_0/rick-and-morty-notes/layers/takeshape-static-sites.json +19 -79
  458. package/examples/v4_0_0/rick-and-morty-notes/schema.json +8 -5
  459. package/examples/v4_0_0/shopify-lookbook/flattened-schema.json +190 -851
  460. package/examples/v4_0_0/shopify-lookbook/layers/andrews-store.json +1103 -4431
  461. package/examples/v4_0_0/shopify-lookbook/layers/lookbook.json +64 -56
  462. package/examples/v4_0_0/shopify-lookbook/layers/takeshape-assets.json +1 -4
  463. package/examples/v4_0_0/shopify-lookbook/layers/takeshape-builtins.json +1 -3
  464. package/examples/v4_0_0/shopify-lookbook/schema.json +3 -10
  465. package/package.json +12 -9
@@ -464,7 +464,7 @@
464
464
  "title": "Workflow Map",
465
465
  "type": "object",
466
466
  "patternProperties": {
467
- "[0-9A-Za-z_-]+": {"$ref": "#/definitions/workflow"}
467
+ "[0-9A-Za-z_-]+": { "$ref": "#/definitions/workflow" }
468
468
  }
469
469
  },
470
470
  "formConfig": {
@@ -464,7 +464,7 @@
464
464
  "title": "Workflow Map",
465
465
  "type": "object",
466
466
  "patternProperties": {
467
- "[0-9A-Za-z_-]+": {"$ref": "#/definitions/workflow"}
467
+ "[0-9A-Za-z_-]+": { "$ref": "#/definitions/workflow" }
468
468
  }
469
469
  },
470
470
  "formConfig": {
@@ -477,7 +477,7 @@
477
477
  "title": "Workflow Map",
478
478
  "type": "object",
479
479
  "patternProperties": {
480
- "[0-9A-Za-z_-]+": {"$ref": "#/definitions/workflow"}
480
+ "[0-9A-Za-z_-]+": { "$ref": "#/definitions/workflow" }
481
481
  }
482
482
  },
483
483
  "formConfig": {
@@ -477,7 +477,7 @@
477
477
  "title": "Workflow Map",
478
478
  "type": "object",
479
479
  "patternProperties": {
480
- "[0-9A-Za-z_-]+": {"$ref": "#/definitions/workflow"}
480
+ "[0-9A-Za-z_-]+": { "$ref": "#/definitions/workflow" }
481
481
  }
482
482
  },
483
483
  "formConfig": {
@@ -154,7 +154,7 @@
154
154
  },
155
155
  "items": {
156
156
  "oneOf": [
157
- {"$ref": "#/definitions/refSchema"},
157
+ { "$ref": "#/definitions/refSchema" },
158
158
  {
159
159
  "type": "object",
160
160
  "properties": {
@@ -199,7 +199,7 @@
199
199
  "allOfSchema": {
200
200
  "title": "AllOfSchema",
201
201
  "allOf": [
202
- {"$ref": "#/definitions/propertySchema"},
202
+ { "$ref": "#/definitions/propertySchema" },
203
203
  {
204
204
  "type": "object",
205
205
  "properties": {
@@ -253,7 +253,7 @@
253
253
  "oneOfSchema": {
254
254
  "title": "OneOfSchema",
255
255
  "allOf": [
256
- {"$ref": "#/definitions/propertySchema"},
256
+ { "$ref": "#/definitions/propertySchema" },
257
257
  {
258
258
  "type": "object",
259
259
  "properties": {
@@ -284,10 +284,10 @@
284
284
  "title": "Shape Schema",
285
285
  "type": "object",
286
286
  "oneOf": [
287
- {"$ref": "#/definitions/shapeSchemaAllOf"},
288
- {"$ref": "#/definitions/shapeSchemaOneOf"},
289
- {"$ref": "#/definitions/shapeSchemaEnum"},
290
- {"$ref": "#/definitions/objectSchema"}
287
+ { "$ref": "#/definitions/shapeSchemaAllOf" },
288
+ { "$ref": "#/definitions/shapeSchemaOneOf" },
289
+ { "$ref": "#/definitions/shapeSchemaEnum" },
290
+ { "$ref": "#/definitions/objectSchema" }
291
291
  ]
292
292
  },
293
293
  "queryMap": {
@@ -302,11 +302,11 @@
302
302
  },
303
303
  "args": {
304
304
  "title": "Args",
305
- "oneOf": [{"type": "string"}, {"$ref": "#/definitions/objectSchema"}]
305
+ "oneOf": [{ "type": "string" }, { "$ref": "#/definitions/objectSchema" }]
306
306
  },
307
307
  "returnShape": {
308
308
  "title": "Return Shape",
309
- "oneOf": [{"type": "string"}, {"$ref": "#/definitions/returnShapeArraySchema"}]
309
+ "oneOf": [{ "type": "string" }, { "$ref": "#/definitions/returnShapeArraySchema" }]
310
310
  },
311
311
  "directiveConfigItem": {
312
312
  "title": "Directive Config Item",
@@ -471,7 +471,9 @@
471
471
  "paths": {
472
472
  "type": "object",
473
473
  "patternProperties": {
474
- "^[^\\n\\r]*$": {"$ref": "#/definitions/parameterSerializeOptions"}
474
+ "^[^\\n\\r]*$": {
475
+ "$ref": "#/definitions/parameterSerializeOptions"
476
+ }
475
477
  }
476
478
  }
477
479
  },
@@ -837,13 +839,13 @@
837
839
  "title": "Directive Mapping Array Item",
838
840
  "description": "A tuple with a string key and a directive config to evaluate",
839
841
  "type": "array",
840
- "items": [{"type": "string"}, {"$ref": "#/definitions/directiveConfig"}]
842
+ "items": [{ "type": "string" }, { "$ref": "#/definitions/directiveConfig" }]
841
843
  },
842
844
  "directiveMappingArray": {
843
845
  "title": "Directive Mapping Array",
844
846
  "description": "An array of key / value or directive config tuples",
845
847
  "type": "array",
846
- "items": {"$ref": "#/definitions/directiveMappingArrayItem"}
848
+ "items": { "$ref": "#/definitions/directiveMappingArrayItem" }
847
849
  },
848
850
  "basicResolver": {
849
851
  "title": "BasicResolver",
@@ -946,7 +948,7 @@
946
948
  "title": "TakeshapeResolver",
947
949
  "type": "object",
948
950
  "properties": {
949
- "if": {"type": "string"},
951
+ "if": { "type": "string" },
950
952
  "id": {
951
953
  "type": "string",
952
954
  "pattern": "^(?=[a-zA-Z])[-_a-zA-Z0-9]+$"
@@ -1046,7 +1048,7 @@
1046
1048
  "title": "GraphqlResolver",
1047
1049
  "type": "object",
1048
1050
  "properties": {
1049
- "if": {"type": "string"},
1051
+ "if": { "type": "string" },
1050
1052
  "id": {
1051
1053
  "type": "string",
1052
1054
  "pattern": "^(?=[a-zA-Z])[-_a-zA-Z0-9]+$"
@@ -1071,13 +1073,13 @@
1071
1073
  "title": "GraphqlResolverOptions",
1072
1074
  "type": "object",
1073
1075
  "properties": {
1074
- "selectionSet": {"type": "string"},
1075
- "unboxParentSelectionSet": {"type": "boolean"},
1076
- "ignoreErrors": {"type": "boolean"},
1077
- "skipWhenMissingArgs": {"type": "boolean"},
1078
- "ttl": {"type": "number"},
1079
- "timeout": {"type": "number"},
1080
- "retry": {"oneOf": [{"type": "number"}, {"type": "object"}]}
1076
+ "selectionSet": { "type": "string" },
1077
+ "unboxParentSelectionSet": { "type": "boolean" },
1078
+ "ignoreErrors": { "type": "boolean" },
1079
+ "skipWhenMissingArgs": { "type": "boolean" },
1080
+ "ttl": { "type": "number" },
1081
+ "timeout": { "type": "number" },
1082
+ "retry": { "oneOf": [{ "type": "number" }, { "type": "object" }] }
1081
1083
  },
1082
1084
  "additionalProperties": true
1083
1085
  },
@@ -1109,7 +1111,7 @@
1109
1111
  "title": "RestResolver",
1110
1112
  "type": "object",
1111
1113
  "properties": {
1112
- "if": {"type": "string"},
1114
+ "if": { "type": "string" },
1113
1115
  "id": {
1114
1116
  "type": "string",
1115
1117
  "pattern": "^(?=[a-zA-Z])[-_a-zA-Z0-9]+$"
@@ -1137,10 +1139,10 @@
1137
1139
  "title": "RestResolverOptions",
1138
1140
  "type": "object",
1139
1141
  "properties": {
1140
- "trailingSlash": {"type": "boolean"},
1141
- "ttl": {"type": "number"},
1142
- "timeout": {"type": "number"},
1143
- "retry": {"oneOf": [{"type": "number"}, {"type": "object"}]}
1142
+ "trailingSlash": { "type": "boolean" },
1143
+ "ttl": { "type": "number" },
1144
+ "timeout": { "type": "number" },
1145
+ "retry": { "oneOf": [{ "type": "number" }, { "type": "object" }] }
1144
1146
  },
1145
1147
  "additionalProperties": true
1146
1148
  },
@@ -1191,7 +1193,7 @@
1191
1193
  "title": "AwsLambdaResolver",
1192
1194
  "type": "object",
1193
1195
  "properties": {
1194
- "if": {"type": "string"},
1196
+ "if": { "type": "string" },
1195
1197
  "id": {
1196
1198
  "type": "string",
1197
1199
  "pattern": "^(?=[a-zA-Z])[-_a-zA-Z0-9]+$"
@@ -1282,7 +1284,7 @@
1282
1284
  },
1283
1285
  "resolver": {
1284
1286
  "title": "Resolver",
1285
- "oneOf": [{"$ref": "#/definitions/basicResolver"}, {"$ref": "#/definitions/composeResolver"}]
1287
+ "oneOf": [{ "$ref": "#/definitions/basicResolver" }, { "$ref": "#/definitions/composeResolver" }]
1286
1288
  },
1287
1289
  "query": {
1288
1290
  "title": "Query JSON",
@@ -2287,7 +2289,7 @@
2287
2289
  "layers": {
2288
2290
  "type": "array",
2289
2291
  "items": {
2290
- "oneOf": [{"type": "string"}, {"$ref": "#/definitions/layerConfig"}]
2292
+ "oneOf": [{ "type": "string" }, { "$ref": "#/definitions/layerConfig" }]
2291
2293
  }
2292
2294
  },
2293
2295
  "dataKey": {
@@ -180,6 +180,9 @@
180
180
  {
181
181
  "$ref": "https://schema.takeshape.io/project-schema/v3.50.0#"
182
182
  },
183
+ {
184
+ "$ref": "https://schema.takeshape.io/project-schema/v3.51.0#"
185
+ },
183
186
  {
184
187
  "$ref": "https://schema.takeshape.io/project-schema/v4.0.0#"
185
188
  }
@@ -47,12 +47,5 @@
47
47
  }
48
48
  },
49
49
  "additionalProperties": false,
50
- "required": [
51
- "id",
52
- "email",
53
- "fullName",
54
- "created",
55
- "updated",
56
- "firstTime"
57
- ]
58
- }
50
+ "required": ["id", "email", "fullName", "created", "updated", "firstTime"]
51
+ }
@@ -1,14 +1,14 @@
1
- import { addAll, mapSet, deepClone } from "@takeshape/util";
1
+ import { addAll, deepClone, mapSet } from "@takeshape/util";
2
2
  import get from "lodash/get.js";
3
- import set from "lodash/set.js";
4
3
  import isObject from "lodash/isObject.js";
5
4
  import pick from "lodash/pick.js";
6
- import { isExtendsSchema, isObjectSchema, isProjectSchemaWithServices } from "./types/index.js";
7
- import { createGetNamespace, dereferenceObjectSchema, getAllPropertyRefs, getRef, getRefShapeName, propertyRefItemToPath, refExpressionToRefItem, refItemToNamespacedShapeName } from "./refs.js";
5
+ import set from "lodash/set.js";
8
6
  import { getImplementationShapeNameMap, isInterfaceShape, pruneUnusedInterfaces } from "./interfaces.js";
9
- import { getAllRefsInQuery, getArgsReference, getAllNamespaceShapes, isValidRefItem, visitSchemaProperties } from "./schema-util.js";
7
+ import { createGetNamespace, dereferenceObjectSchema, getAllPropertyRefs, getRef, getRefShapeName, propertyRefItemToPath, refExpressionToRefItem, refItemToNamespacedShapeName } from "./refs.js";
8
+ import { getAllNamespaceShapes, getAllRefsInQuery, getArgsReference, isValidRefItem, visitSchemaProperties } from "./schema-util.js";
9
+ import { isExtendsSchema, isObjectSchema, isProjectSchemaWithServices } from "./types/index.js";
10
10
  function getGraphQLServiceShapeMap(layers) {
11
- return Object.assign({}, ...Object.values(layers).map(layer => layer.schema?.shapes ?? {}));
11
+ return Object.assign({}, ...Object.values(layers).map((layer) => layer.schema?.shapes ?? {}));
12
12
  }
13
13
  function schemaExtendsShape(context, shapeName, schema) {
14
14
  return (isExtendsSchema(schema) &&
@@ -16,7 +16,7 @@ function schemaExtendsShape(context, shapeName, schema) {
16
16
  }
17
17
  function getMissingPropertyRefs(projectSchema, getNamespace) {
18
18
  const propertyRefs = getAllPropertyRefs(projectSchema);
19
- return propertyRefs.filter(ref => {
19
+ return propertyRefs.filter((ref) => {
20
20
  const path = propertyRefItemToPath(getNamespace, ref);
21
21
  return !get(projectSchema, path);
22
22
  });
@@ -46,7 +46,7 @@ function getShapeRefs(services, serviceSchemas, propertyRefs) {
46
46
  return results;
47
47
  }
48
48
  function interfacesToShapeNames(projectSchema, shapeRefArray) {
49
- return shapeRefArray.map(shapeRef => refItemToNamespacedShapeName(refExpressionToRefItem(projectSchema, shapeRef)));
49
+ return shapeRefArray.map((shapeRef) => refItemToNamespacedShapeName(refExpressionToRefItem(projectSchema, shapeRef)));
50
50
  }
51
51
  /**
52
52
  * Add all referenced shape names to the refSet meant to be used as a callback to visitSchemaProperties
@@ -115,7 +115,7 @@ export function resolveSchemaShapeDependencies(projectSchema, serviceLayers) {
115
115
  collectDependencies(requiredShapeNames);
116
116
  // Collect interfaces that requiredShapeNames implement
117
117
  const interfaceNames = new Set();
118
- const requiredShapes = mapSet(requiredShapeNames, shapeName => newSchema.shapes[shapeName] ?? remoteShapeMap[shapeName]);
118
+ const requiredShapes = mapSet(requiredShapeNames, (shapeName) => newSchema.shapes[shapeName] ?? remoteShapeMap[shapeName]);
119
119
  for (const shape of requiredShapes) {
120
120
  if (shape?.interfaces) {
121
121
  addAll(interfaceNames, interfacesToShapeNames(projectSchema, shape.interfaces));
@@ -123,7 +123,10 @@ export function resolveSchemaShapeDependencies(projectSchema, serviceLayers) {
123
123
  }
124
124
  // Collect implementations for interfaces in requiredShapeNames
125
125
  const implementationNames = new Set();
126
- const implementations = getImplementationShapeNameMap({ ...newSchema.shapes, ...remoteShapeMap });
126
+ const implementations = getImplementationShapeNameMap({
127
+ ...newSchema.shapes,
128
+ ...remoteShapeMap
129
+ });
127
130
  for (const shape of requiredShapes) {
128
131
  if (isInterfaceShape(shape) && implementations[shape.name]) {
129
132
  addAll(implementationNames, implementations[shape.name]);
@@ -136,7 +139,10 @@ export function resolveSchemaShapeDependencies(projectSchema, serviceLayers) {
136
139
  addAll(requiredShapeNames, implementationNames);
137
140
  // Populate a ShapeMap with the remote shapes we've gathered
138
141
  // A combined context which prefers remote shapes for use when merging/inlining
139
- const mergingContext = { services: newSchema.services, shapes: { ...newSchema.shapes, ...remoteShapeMap } };
142
+ const mergingContext = {
143
+ services: newSchema.services,
144
+ shapes: { ...newSchema.shapes, ...remoteShapeMap }
145
+ };
140
146
  for (const name of requiredShapeNames) {
141
147
  const localShape = newSchema.shapes[name];
142
148
  const remoteShape = remoteShapeMap[name];
@@ -1,12 +1,12 @@
1
- import { mergeWithArrayMerge } from "@takeshape/util";
2
- import { createAjv } from "@takeshape/json-schema";
3
1
  import { SchemaValidationError } from "@takeshape/errors";
4
- import isNull from "lodash/isNull.js";
2
+ import { createAjv } from "@takeshape/json-schema";
3
+ import { mergeWithArrayMerge } from "@takeshape/util";
5
4
  import isEqual from "lodash/isEqual.js";
6
- import { isEncryptedServiceConfig, isServiceAuthentication, isServiceResolver } from "../types/utils.js";
7
- import { createSchemaPropertyList, getGeneratorVersion, getServiceIdFieldName, getShapeDependencies, pathBetween } from "../schema-util.js";
5
+ import isNull from "lodash/isNull.js";
8
6
  import { SERVICE_OBJECT_PATTERN_NAME } from "../constants.js";
7
+ import { createSchemaPropertyList, getGeneratorVersion, getServiceIdFieldName, getShapeDependencies, pathBetween } from "../schema-util.js";
9
8
  import { latestSchemaJson } from "../schemas/index.js";
9
+ import { isEncryptedServiceConfig, isServiceAuthentication, isServiceResolver } from "../types/utils.js";
10
10
  import { formatError } from "../validate.js";
11
11
  import { getStoredServiceConfig } from "./util.js";
12
12
  /**
@@ -58,7 +58,6 @@ export function validateServiceConfig(maybeServiceConfig) {
58
58
  * Prepare a `ServiceConfig` object update, validating the overall structure
59
59
  * and encrypting the `ServiceAuthentication` object.
60
60
  */
61
- // eslint-disable-next-line max-params
62
61
  export function prepareServiceUpdate(encryptFn, decryptFn, projectSchema, serviceConfigUpdate, serviceKey) {
63
62
  const storedServiceConfig = getStoredServiceConfig(projectSchema, serviceKey);
64
63
  let newServiceConfig = serviceConfigUpdate;
@@ -68,6 +67,7 @@ export function prepareServiceUpdate(encryptFn, decryptFn, projectSchema, servic
68
67
  }
69
68
  const { authentication, authenticationType } = newServiceConfig;
70
69
  if (authenticationType === "none" || isNull(authentication)) {
70
+ // biome-ignore lint/performance/noDelete: Property presence may matter here
71
71
  delete newServiceConfig.authentication;
72
72
  }
73
73
  else if (authentication !== undefined) {
@@ -92,15 +92,16 @@ export function prepareServiceUpdate(encryptFn, decryptFn, projectSchema, servic
92
92
  return serviceConfig;
93
93
  }
94
94
  export function getServiceObjectFields(projectSchema, shape, provider) {
95
- return (getServiceInfo(projectSchema, shape)[provider] ?? []).filter(serviceInfo => serviceInfo.generators[SERVICE_OBJECT_PATTERN_NAME]);
95
+ return (getServiceInfo(projectSchema, shape)[provider] ?? []).filter((serviceInfo) => serviceInfo.generators[SERVICE_OBJECT_PATTERN_NAME]);
96
96
  }
97
97
  // Returns info for all services found in shape, keyed by provider
98
98
  export function getServiceInfo(projectSchema, shape) {
99
99
  const result = {};
100
100
  // Get inline dependencies by not following refs with @resolver
101
- const inlineDepShapes = getShapeDependencies(projectSchema, shape, prop => !prop["@resolver"]).map(name => projectSchema.shapes[name]);
101
+ const inlineDepShapes = getShapeDependencies(projectSchema, shape, (prop) => !prop["@resolver"]).map((name) => projectSchema.shapes[name]);
102
102
  const shapesToCheck = [shape, ...inlineDepShapes];
103
- shapesToCheck.forEach(thisShape => {
103
+ for (const thisShape of shapesToCheck) {
104
+ // biome-ignore lint/complexity/noForEach: Types for createSchemaPropertyList do not include the iterator
104
105
  createSchemaPropertyList(projectSchema, thisShape).forEach(([key, value]) => {
105
106
  const resolver = value["@resolver"];
106
107
  if (!isServiceResolver(resolver)) {
@@ -131,7 +132,7 @@ export function getServiceInfo(projectSchema, shape) {
131
132
  };
132
133
  if (Array.isArray(result[provider])) {
133
134
  // Dedupe service info
134
- if (!result[provider].find(existingServiceInfo => isEqual(existingServiceInfo, serviceInfo))) {
135
+ if (!result[provider].find((existingServiceInfo) => isEqual(existingServiceInfo, serviceInfo))) {
135
136
  result[provider].push(serviceInfo);
136
137
  }
137
138
  }
@@ -139,6 +140,6 @@ export function getServiceInfo(projectSchema, shape) {
139
140
  result[provider] = [serviceInfo];
140
141
  }
141
142
  });
142
- });
143
+ }
143
144
  return result;
144
145
  }
@@ -1,6 +1,6 @@
1
+ import { isDefined } from '@takeshape/util';
1
2
  import isEmpty from 'lodash/isEmpty.js';
2
3
  import uniq from 'lodash/uniq.js';
3
- import { isDefined } from '@takeshape/util';
4
4
  /**
5
5
  * Get a service config from a project schema.
6
6
  */
@@ -18,12 +18,12 @@ export function getServiceNamespaces(context) {
18
18
  const namespaces = new Map();
19
19
  const { services } = context;
20
20
  if (services) {
21
- Object.keys(services).forEach(serviceKey => {
21
+ for (const serviceKey of Object.keys(services)) {
22
22
  const namespace = services[serviceKey]?.namespace;
23
23
  if (namespace) {
24
24
  namespaces.set(namespace, serviceKey);
25
25
  }
26
- });
26
+ }
27
27
  }
28
28
  return namespaces;
29
29
  }
@@ -32,5 +32,5 @@ export function isMissingAuth(service) {
32
32
  }
33
33
  export function getResolverServices(resolver) {
34
34
  const resolverArray = 'compose' in resolver ? resolver.compose : [resolver];
35
- return uniq(resolverArray.map(resolver => ('service' in resolver ? resolver.service : undefined)).filter(isDefined));
35
+ return uniq(resolverArray.map((resolver) => ('service' in resolver ? resolver.service : undefined)).filter(isDefined));
36
36
  }
@@ -1,15 +1,15 @@
1
1
  import { deepClone, formatShapeName, isDefined, visit } from "@takeshape/util";
2
- import keyBy from "lodash/keyBy.js";
3
2
  import get from "lodash/get.js";
4
- import { createShape, getShapeDependencies } from "../schema-util.js";
5
- import { getFlattenedTemplateShapeName, getRef, getRefShapeName, refItemToAtRef, refItemToNamespacedShapeName } from "../refs.js";
6
- import { listTypePrefix } from "../migration/index.js";
7
- import { mergeObjectSchemas, mergeSchemaProperties } from "../util/merge.js";
3
+ import keyBy from "lodash/keyBy.js";
8
4
  import { createInputSchema } from "../create-input-schema.js";
5
+ import { listTypePrefix } from "../migration/index.js";
6
+ import { getFlattenedTemplateShapeName, getRef, getRefShapeName, refItemToAtRef, refItemToNamespacedShapeName } from "../refs.js";
7
+ import { createShape, getShapeDependencies } from "../schema-util.js";
9
8
  import { isCachedShape } from "../types/index.js";
10
- import { getWhereSearchArg } from "./where.js";
9
+ import { mergeObjectSchemas, mergeSchemaProperties } from "../util/merge.js";
10
+ import { getInputShapeName, getMutationInputShapeName } from "./names.js";
11
11
  import { TemplateVerbs } from "./types.js";
12
- import { getMutationInputShapeName, getInputShapeName } from "./names.js";
12
+ import { getWhereSearchArg } from "./where.js";
13
13
  export const TSGetArgs = getIDQueryArgs("TSGetArgs");
14
14
  export const TSGetSingletonArgs = getIDQueryArgs("TSGetSingletonArgs");
15
15
  export const TSListArgs = getShapeListQueryArgs("TSListArgs", true);
@@ -112,7 +112,10 @@ export function getSearchResultsShape(context, shape) {
112
112
  [shapeName]: createShape(shapeName, {
113
113
  type: "object",
114
114
  properties: {
115
- results: { type: "array", items: { "@ref": `local:${shape.name}` } },
115
+ results: {
116
+ type: "array",
117
+ items: { "@ref": `local:${shape.name}` }
118
+ },
116
119
  total: { type: "integer" }
117
120
  },
118
121
  required: ["results", "total"]
@@ -162,6 +165,7 @@ function rewriteRefs(context, shapeSchema, rewriteShapeName) {
162
165
  ? refItemToAtRef(refItem)
163
166
  : `local:${rewriteShapeName(refItemToNamespacedShapeName(refItem))}`;
164
167
  if (value.$ref) {
168
+ // biome-ignore lint/performance/noDelete: Property presence may matter here
165
169
  delete value.$ref;
166
170
  }
167
171
  }
@@ -206,7 +210,7 @@ export function getMutationArgs(templateName, verb) {
206
210
  ...(verb !== TemplateVerbs.Delete &&
207
211
  keyBy(getShapeDependencies(projectSchema,
208
212
  // get the shape dependencies of the shape with the @input swapped
209
- createShape(inputShape.name, rewrittenSchema), propSchema => {
213
+ createShape(inputShape.name, rewrittenSchema), (propSchema) => {
210
214
  if (propSchema["@resolver"]) {
211
215
  return false;
212
216
  }
@@ -216,7 +220,7 @@ export function getMutationArgs(templateName, verb) {
216
220
  }
217
221
  return true;
218
222
  })
219
- .map(shapeName => {
223
+ .map((shapeName) => {
220
224
  const shape = projectSchema.shapes[shapeName];
221
225
  if (!shape) {
222
226
  return;
@@ -232,7 +236,9 @@ export function getMutationArgs(templateName, verb) {
232
236
  }
233
237
  export function getMutationResultType(verb) {
234
238
  return (context, shape) => {
235
- const shapeName = formatShapeName([verb, shape.name, "result"], { shapeNameIndex: 1 });
239
+ const shapeName = formatShapeName([verb, shape.name, "result"], {
240
+ shapeNameIndex: 1
241
+ });
236
242
  const result = verb === TemplateVerbs.Delete ? { type: "boolean" } : { "@ref": `local:${shape.name}` };
237
243
  return {
238
244
  shapeName,
@@ -298,7 +304,7 @@ export function getShapeListQueryArgs(templateName, legacyArgs) {
298
304
  const isAllShapes = shape.name === "TSSearchable";
299
305
  const shapeName = isAllShapes ? templateName : getFlattenedTemplateShapeName(shape.name, templateName);
300
306
  const shapes = isAllShapes
301
- ? Object.values(projectSchema.shapes).filter(s => s.model !== undefined || isCachedShape(s))
307
+ ? Object.values(projectSchema.shapes).filter((s) => s.model !== undefined || isCachedShape(s))
302
308
  : [shape];
303
309
  const { schema, dependencies } = getWhereSearchArg(projectSchema, shapes);
304
310
  return {
@@ -1,14 +1,14 @@
1
- import unset from "lodash/unset.js";
1
+ import { formatShapeName, isDefined, pascalCase } from "@takeshape/util";
2
+ import md5 from "blueimp-md5";
2
3
  import isFunction from "lodash/isFunction.js";
3
4
  import uniqBy from "lodash/uniqBy.js";
4
- import md5 from "blueimp-md5";
5
- import { pascalCase, isDefined, formatShapeName } from "@takeshape/util";
6
- import { createSchemaPropertyList, createShape, getAllRefsInShapes } from "../schema-util.js";
5
+ import unset from "lodash/unset.js";
7
6
  import { workflowsEnabled } from "../api-version.js";
8
- import { followRef, getRef, getRefOrItemsRef, hasRefProperty, hasResolvableRef, refItemToShape, refItemToNamespacedShapeName } from "../refs.js";
9
- import { enumerateOneOfKeys, isUnionSchema } from "../unions.js";
7
+ import { followRef, getRef, getRefOrItemsRef, hasRefProperty, hasResolvableRef, refItemToNamespacedShapeName, refItemToShape } from "../refs.js";
8
+ import { getRelationship, getRelationshipShapes, isEqualRelationship } from "../relationships.js";
9
+ import { createSchemaPropertyList, createShape, getAllRefsInShapes } from "../schema-util.js";
10
10
  import { isCachedShape, isObjectSchema, isPropertySchemaWithRelationship } from "../types/utils.js";
11
- import { isEqualRelationship, getRelationship, getRelationshipShapes } from "../relationships.js";
11
+ import { enumerateOneOfKeys, isUnionSchema } from "../unions.js";
12
12
  export const MAX_RELATIONSHIP_DEPTH = 1;
13
13
  export const exceededRelationshipDepth = (depth = 0) => depth >= MAX_RELATIONSHIP_DEPTH;
14
14
  class ShapeCache {
@@ -44,9 +44,18 @@ export const fieldTypeComparison = {
44
44
  boolean: { comparators: ["eq"], type: "boolean" },
45
45
  string: { comparators: ["eq", "in", "match", "regexp"], type: "string" },
46
46
  date: { comparators: ["eq", "lt", "lte", "gt", "gte"], type: "string" },
47
- number: { comparators: ["eq", "lt", "lte", "gt", "gte", "in"], type: "number" },
48
- integer: { comparators: ["eq", "lt", "lte", "gt", "gte", "in"], type: "integer" },
49
- workflow: { comparators: ["eq", "lt", "lte", "gt", "gte", "in"], type: "string" },
47
+ number: {
48
+ comparators: ["eq", "lt", "lte", "gt", "gte", "in"],
49
+ type: "number"
50
+ },
51
+ integer: {
52
+ comparators: ["eq", "lt", "lte", "gt", "gte", "in"],
53
+ type: "integer"
54
+ },
55
+ workflow: {
56
+ comparators: ["eq", "lt", "lte", "gt", "gte", "in"],
57
+ type: "string"
58
+ },
50
59
  draftjs: { comparators: ["match"], type: "string" },
51
60
  mdx: { comparators: ["match"], type: "string" }
52
61
  };
@@ -135,7 +144,7 @@ function truncateNames(names) {
135
144
  */
136
145
  function getRelationshipShapeName(refs) {
137
146
  return refs
138
- .map(ref => {
147
+ .map((ref) => {
139
148
  const shapeName = ref.split(":")[1];
140
149
  return formatShapeName(shapeName);
141
150
  })
@@ -149,7 +158,7 @@ function getTypeName(name, prop, shapeName, context) {
149
158
  const { projectSchema, relationshipDepth, conflictingProperties } = context;
150
159
  let type = getPropType(projectSchema, name, prop);
151
160
  if (isId(name)) {
152
- return `TSWhereID`;
161
+ return "TSWhereID";
153
162
  }
154
163
  const relationship = getRelationship(prop);
155
164
  if (relationship) {
@@ -162,7 +171,7 @@ function getTypeName(name, prop, shapeName, context) {
162
171
  }
163
172
  if (isUnionSchema(prop)) {
164
173
  if (prop.oneOf.length > 1) {
165
- const shapeNames = truncateNames(joinShapeNames(enumerateOneOfKeys(projectSchema, prop.oneOf).map(child => child.shapeName)));
174
+ const shapeNames = truncateNames(joinShapeNames(enumerateOneOfKeys(projectSchema, prop.oneOf).map((child) => child.shapeName)));
166
175
  return `TSWhere${shapeNames}Union`;
167
176
  }
168
177
  type = "object";
@@ -254,7 +263,7 @@ export function getPropertyComparisonType(name, prop, shapeName, context) {
254
263
  });
255
264
  }
256
265
  else if (isUnionSchema(propOrItems)) {
257
- const shapes = enumerateOneOfKeys(projectSchema, propOrItems.oneOf).map(option => projectSchema.shapes[option.shapeName]);
266
+ const shapes = enumerateOneOfKeys(projectSchema, propOrItems.oneOf).map((option) => projectSchema.shapes[option.shapeName]);
258
267
  props = getFields(typeName, shapes, {
259
268
  ...context,
260
269
  booleanOperators: false
@@ -347,7 +356,7 @@ function getReferencedShape(context) {
347
356
  * Expand union shapes
348
357
  */
349
358
  function expandUnionShapes(projectSchema, shapes) {
350
- return uniqBy(shapes.flatMap(shape => isUnionSchema(shape.schema) ? shape.schema.oneOf.map(getReferencedShape(projectSchema)).filter(isDefined) : shape), "name");
359
+ return uniqBy(shapes.flatMap((shape) => isUnionSchema(shape.schema) ? shape.schema.oneOf.map(getReferencedShape(projectSchema)).filter(isDefined) : shape), "name");
351
360
  }
352
361
  export function getWhereShape(projectSchema, selectedShapes) {
353
362
  const shapeName = selectedShapes.length === 1 ? `TSWhere${pascalCase(selectedShapes[0].name)}Input` : "TSWhereInput";
@@ -1,8 +1,8 @@
1
1
  import { isRecord } from "@takeshape/util";
2
+ import has from "lodash/has.js";
3
+ import isArray from "lodash/isArray.js";
2
4
  import isPlainObject from "lodash/isPlainObject.js";
3
5
  import isString from "lodash/isString.js";
4
- import isArray from "lodash/isArray.js";
5
- import has from "lodash/has.js";
6
6
  import isUndefined from "lodash/isUndefined.js";
7
7
  import { latestSchemaJson } from "../schemas/index.js";
8
8
  import { ArgsType, RefType } from "./types.js";
@@ -57,7 +57,7 @@ export function containsResolver(resolver, predicate) {
57
57
  if (isBasicResolver(resolver)) {
58
58
  return predicate(resolver);
59
59
  }
60
- return Boolean(resolver.compose.find(resolver => containsResolver(resolver, predicate)));
60
+ return Boolean(resolver.compose.find((resolver) => containsResolver(resolver, predicate)));
61
61
  }
62
62
  /** Directive Mapping Utils **/
63
63
  /**
@@ -1,10 +1,10 @@
1
+ import { BadDataError } from "@takeshape/errors";
1
2
  import { camelCase, isRecord } from "@takeshape/util";
2
3
  import omit from "lodash/omit.js";
3
- import { BadDataError } from "@takeshape/errors";
4
4
  import { getRef, refItemToNamespacedShapeName } from "./refs.js";
5
+ import { getOutputShapeName } from "./template-shapes/names.js";
5
6
  import { isRefSchema } from "./types/utils.js";
6
7
  import { getShapeById } from "./util/shapes.js";
7
- import { getOutputShapeName } from "./template-shapes/names.js";
8
8
  export function enumerateOneOfKeys(projectSchema, oneOf) {
9
9
  const result = [];
10
10
  for (const child of oneOf) {
@@ -41,15 +41,14 @@ export function oneOfToObject(projectSchema, schema) {
41
41
  return { ...omit(schema, "oneOf"), type: "object", properties };
42
42
  }
43
43
  function formatKeys(keys) {
44
- return keys.map(k => `"${k}"`).join(", ");
44
+ return keys.map((k) => `"${k}"`).join(", ");
45
45
  }
46
- // eslint-disable-next-line max-params
47
- export const createUnwrapTransform = projectSchema => (obj, schema, name, shape, next) => {
46
+ export const createUnwrapTransform = (projectSchema) => (obj, schema, name, shape, next) => {
48
47
  if (isRecord(obj)) {
49
48
  const oneOfKeys = enumerateOneOfKeys(projectSchema, getOneOf(schema));
50
49
  const objectKeys = Object.keys(obj);
51
50
  if (objectKeys.length !== 1) {
52
- const propNames = oneOfKeys.map(k => k.propName);
51
+ const propNames = oneOfKeys.map((k) => k.propName);
53
52
  throw new BadDataError(`Object should only specify one of the following keys: ${formatKeys(propNames)}, but found keys: ${formatKeys(objectKeys)}`);
54
53
  }
55
54
  for (const { propName, shapeId, propSchema } of oneOfKeys) {
@@ -66,8 +65,7 @@ export const createUnwrapTransform = projectSchema => (obj, schema, name, shape,
66
65
  }
67
66
  }
68
67
  };
69
- // eslint-disable-next-line max-params
70
- export const createWrapTransform = projectSchema => (obj, schema, name, shape, next) => {
68
+ export const createWrapTransform = (projectSchema) => (obj, schema, name, shape, next) => {
71
69
  if (isRecord(obj) && typeof obj._shapeId === "string") {
72
70
  const shape = getShapeById(projectSchema, obj._shapeId);
73
71
  if (shape) {