@takeshape/schema 11.45.5 → 11.46.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 (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 +18 -16
  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 +15 -13
  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
@@ -1,7 +1,7 @@
1
+ import { isInterfaceShape } from "../interfaces.js";
1
2
  import { refItemToShape } from "../refs.js";
2
3
  import { createSchemaPropertyAccessor, createSchemaPropertyList, getShapeByRef } from "../schema-util.js";
3
4
  import { isCachedShape, isModelShape } from "../types/index.js";
4
- import { isInterfaceShape } from "../interfaces.js";
5
5
  /**
6
6
  * Create a shape model from either a ref item or a ref string such as `rick:Character`
7
7
  */
@@ -24,7 +24,7 @@ export class ShapeModel {
24
24
  else {
25
25
  const rawShape = refItemToShape(_projectSchemaModel.json, refArg);
26
26
  if (!rawShape) {
27
- throw new Error(`Error creating shape model: ref item argument could not be resolved to a shape`);
27
+ throw new Error("Error creating shape model: ref item argument could not be resolved to a shape");
28
28
  }
29
29
  this._rawShape = rawShape;
30
30
  this._shapeRefItem = refArg;
@@ -59,6 +59,7 @@ export * from "./v3.47.0.js";
59
59
  export * from "./v3.48.0.js";
60
60
  export * from "./v3.49.0.js";
61
61
  export * from "./v3.50.0.js";
62
+ export * from "./v3.51.0.js";
62
63
  export * from "./v4.0.0.js";
63
64
  // Schema type utilities
64
65
  function createVersionPredicate(expectedVersion) {
@@ -132,5 +133,6 @@ export const isProjectSchemaJSONV3_47_0 = createVersionPredicate("3.47.0");
132
133
  export const isProjectSchemaJSONV3_48_0 = createVersionPredicate("3.48.0");
133
134
  export const isProjectSchemaJSONV3_49_0 = createVersionPredicate("3.49.0");
134
135
  export const isProjectSchemaJSONV3_50_0 = createVersionPredicate("3.50.0");
135
- export const isLatestProjectSchemaJSON = createVersionPredicate("3.50.0");
136
+ export const isProjectSchemaJSONV3_51_0 = createVersionPredicate("3.51.0");
137
+ export const isLatestProjectSchemaJSON = createVersionPredicate("3.51.0");
136
138
  export const isProjectSchemaJSONV4_0_0 = createVersionPredicate("4.0.0");
@@ -1,6 +1,5 @@
1
1
  import { migrateTo } from "../migration/index.js";
2
- import { isProjectSchemaJSONV1_0_0, isProjectSchemaJSONV3_0_0, isProjectSchemaJSONV3_1_0, isProjectSchemaJSONV3_2_0, isProjectSchemaJSONV3_3_0, isProjectSchemaJSONV3_4_0, isProjectSchemaJSONV3_5_0, isProjectSchemaJSONV3_5_1, isProjectSchemaJSONV3_6_0, isProjectSchemaJSONV3_7_0, isProjectSchemaJSONV3_8_0, isProjectSchemaJSONV3_9_0, isProjectSchemaJSONV3_10_0, isProjectSchemaJSONV3_11_0, isProjectSchemaJSONV3_12_0, isProjectSchemaJSONV3_12_1, isProjectSchemaJSONV3_12_2, isProjectSchemaJSONV3_12_3, isProjectSchemaJSONV3_13_0, isProjectSchemaJSONV3_14_0, isProjectSchemaJSONV3_15_0, isProjectSchemaJSONV3_16_0, isProjectSchemaJSONV3_17_0, isProjectSchemaJSONV3_17_1, isProjectSchemaJSONV3_18_0, isProjectSchemaJSONV3_18_1, isProjectSchemaJSONV3_18_2, isProjectSchemaJSONV3_19_0, isProjectSchemaJSONV3_20_0, isProjectSchemaJSONV3_21_0, isProjectSchemaJSONV3_22_0, isProjectSchemaJSONV3_23_0, isProjectSchemaJSONV3_24_0, isProjectSchemaJSONV3_25_0, isProjectSchemaJSONV3_26_0, isProjectSchemaJSONV3_27_0, isProjectSchemaJSONV3_28_0, isProjectSchemaJSONV3_29_0, isProjectSchemaJSONV3_30_0, isProjectSchemaJSONV3_31_0, isProjectSchemaJSONV3_32_0, isProjectSchemaJSONV3_33_0, isProjectSchemaJSONV3_34_0, isProjectSchemaJSONV3_35_0, isProjectSchemaJSONV3_36_0, isProjectSchemaJSONV3_37_0, isProjectSchemaJSONV3_38_0, isProjectSchemaJSONV3_39_0, isProjectSchemaJSONV3_40_0, isProjectSchemaJSONV3_41_0, isProjectSchemaJSONV3_42_0, isProjectSchemaJSONV3_43_0, isProjectSchemaJSONV3_44_0, isProjectSchemaJSONV3_45_0, isProjectSchemaJSONV3_46_0, isProjectSchemaJSONV3_47_0, isProjectSchemaJSONV3_48_0, isProjectSchemaJSONV3_49_0, isProjectSchemaJSONV4_0_0, isLatestProjectSchemaJSON } from "./index.js";
3
- // eslint-disable-next-line complexity
2
+ import { isProjectSchemaJSONV1_0_0, isProjectSchemaJSONV3_0_0, isProjectSchemaJSONV3_1_0, isProjectSchemaJSONV3_2_0, isProjectSchemaJSONV3_3_0, isProjectSchemaJSONV3_4_0, isProjectSchemaJSONV3_5_0, isProjectSchemaJSONV3_5_1, isProjectSchemaJSONV3_6_0, isProjectSchemaJSONV3_7_0, isProjectSchemaJSONV3_8_0, isProjectSchemaJSONV3_9_0, isProjectSchemaJSONV3_10_0, isProjectSchemaJSONV3_11_0, isProjectSchemaJSONV3_12_0, isProjectSchemaJSONV3_12_1, isProjectSchemaJSONV3_12_2, isProjectSchemaJSONV3_12_3, isProjectSchemaJSONV3_13_0, isProjectSchemaJSONV3_14_0, isProjectSchemaJSONV3_15_0, isProjectSchemaJSONV3_16_0, isProjectSchemaJSONV3_17_0, isProjectSchemaJSONV3_17_1, isProjectSchemaJSONV3_18_0, isProjectSchemaJSONV3_18_1, isProjectSchemaJSONV3_18_2, isProjectSchemaJSONV3_19_0, isProjectSchemaJSONV3_20_0, isProjectSchemaJSONV3_21_0, isProjectSchemaJSONV3_22_0, isProjectSchemaJSONV3_23_0, isProjectSchemaJSONV3_24_0, isProjectSchemaJSONV3_25_0, isProjectSchemaJSONV3_26_0, isProjectSchemaJSONV3_27_0, isProjectSchemaJSONV3_28_0, isProjectSchemaJSONV3_29_0, isProjectSchemaJSONV3_30_0, isProjectSchemaJSONV3_31_0, isProjectSchemaJSONV3_32_0, isProjectSchemaJSONV3_33_0, isProjectSchemaJSONV3_34_0, isProjectSchemaJSONV3_35_0, isProjectSchemaJSONV3_36_0, isProjectSchemaJSONV3_37_0, isProjectSchemaJSONV3_38_0, isProjectSchemaJSONV3_39_0, isProjectSchemaJSONV3_40_0, isProjectSchemaJSONV3_41_0, isProjectSchemaJSONV3_42_0, isProjectSchemaJSONV3_43_0, isProjectSchemaJSONV3_44_0, isProjectSchemaJSONV3_45_0, isProjectSchemaJSONV3_46_0, isProjectSchemaJSONV3_47_0, isProjectSchemaJSONV3_48_0, isProjectSchemaJSONV3_49_0, isProjectSchemaJSONV3_50_0, isProjectSchemaJSONV4_0_0, isLatestProjectSchemaJSON } from "./index.js";
4
3
  export async function migrateToLatestProjectSchema(context, projectSchema) {
5
4
  if (isLatestProjectSchemaJSON(projectSchema)) {
6
5
  return projectSchema;
@@ -179,6 +178,9 @@ export async function migrateToLatestProjectSchema(context, projectSchema) {
179
178
  if (isProjectSchemaJSONV3_49_0(projectSchema)) {
180
179
  projectSchema = await migrateTo["v3.50.0"](context, projectSchema);
181
180
  }
181
+ if (isProjectSchemaJSONV3_50_0(projectSchema)) {
182
+ projectSchema = await migrateTo["v3.51.0"](context, projectSchema);
183
+ }
182
184
  if (isProjectSchemaJSONV4_0_0(projectSchema)) {
183
185
  throw new Error("You are using an unreleased schema version. Migration is not possible");
184
186
  }
@@ -0,0 +1,7 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+ export {};
@@ -1,15 +1,15 @@
1
- import { isIntegerLike, isDefined, visit, isRecord } from "@takeshape/util";
2
- import get from "lodash/get.js";
1
+ import { NotFoundError } from "@takeshape/errors";
2
+ import { isDefined, isIntegerLike, isRecord, visit } from "@takeshape/util";
3
+ import compact from "lodash/compact.js";
3
4
  import assign from "lodash/fp/assign.js";
4
5
  import omit from "lodash/fp/omit.js";
6
+ import get from "lodash/get.js";
5
7
  import isString from "lodash/isString.js";
6
- import { NotFoundError } from "@takeshape/errors";
7
- import compact from "lodash/compact.js";
8
- import { getServiceNamespaces } from "./services/util.js";
9
- import { mergeDeepObjectSchemas, mergeObjectSchemas } from "./util/merge.js";
10
- import { getToolRef } from "./util/ai-tools.js";
11
8
  import { isScalar } from "./scalars.js";
9
+ import { getServiceNamespaces } from "./services/util.js";
12
10
  import { getRefType, isAllOfSchema, isExtendsSchema, isObjectSchema, isOneOfSchema, isRefSchema, isRefSchemaLegacy } from "./types/index.js";
11
+ import { getToolRef } from "./util/ai-tools.js";
12
+ import { mergeDeepObjectSchemas, mergeObjectSchemas } from "./util/merge.js";
13
13
  /**
14
14
  * Guard for RefItemWithPath. Tests for presence of all required props.
15
15
  */
@@ -34,7 +34,11 @@ export function parseReturnShape(projectSchema, shape) {
34
34
  if (!ref) {
35
35
  throw new Error(`Could not parse ${JSON.stringify(shape.items)}: invalid ref`);
36
36
  }
37
- return { isArray: true, ref, shapeName: refItemToNamespacedShapeName(ref) };
37
+ return {
38
+ isArray: true,
39
+ ref,
40
+ shapeName: refItemToNamespacedShapeName(ref)
41
+ };
38
42
  }
39
43
  if (typeof shape.items.type !== "string") {
40
44
  throw new Error(`Could not parse ${JSON.stringify(shape.items)}: invalid type`);
@@ -53,7 +57,9 @@ export function returnShapeToSchema(projectSchema, returnShape) {
53
57
  if (isScalar(returnShape) || returnShape === "object") {
54
58
  return { type: returnShape };
55
59
  }
56
- return { "@ref": refItemToAtRef(refExpressionToRefItem(projectSchema, returnShape)) };
60
+ return {
61
+ "@ref": refItemToAtRef(refExpressionToRefItem(projectSchema, returnShape))
62
+ };
57
63
  }
58
64
  return returnShape;
59
65
  }
@@ -112,7 +118,7 @@ export function refExpressionToRefItem(context, refExpression) {
112
118
  * Converts a list of ref expressions into a list of ref items.
113
119
  */
114
120
  export function refExpressionListToRefItemList(context, refExpressionList) {
115
- return refExpressionList.map(ref => refExpressionToRefItem(context, ref));
121
+ return refExpressionList.map((ref) => refExpressionToRefItem(context, ref));
116
122
  }
117
123
  /**
118
124
  * Sugar for converting a `refExpression` directly into a shape, without the
@@ -244,7 +250,7 @@ export function getOneOfRefs(context, propertySchema, schemaPath = []) {
244
250
  const oneOf = propertySchema.oneOf ?? propertySchema.items?.oneOf;
245
251
  const path = propertySchema.oneOf ? schemaPath : [...schemaPath, "items"];
246
252
  if (oneOf) {
247
- return compact(oneOf.map(one => {
253
+ return compact(oneOf.map((one) => {
248
254
  return getRefWithPath(context, one, path);
249
255
  }));
250
256
  }
@@ -294,7 +300,7 @@ export function refItemToShape(context, refItem) {
294
300
  * Get all shapes referenced by a RefItem array.
295
301
  */
296
302
  export function refItemListToShapeList(context, refItems) {
297
- return refItems.map(ref => refItemToShape(context, ref)).filter(isDefined);
303
+ return refItems.map((ref) => refItemToShape(context, ref)).filter(isDefined);
298
304
  }
299
305
  /**
300
306
  * Get a shape referenced by a `RefItem`, also returning the path to the new shape.
@@ -366,10 +372,10 @@ export function hasResolvableRef(context, schema) {
366
372
  return Boolean(refItemToShapeSchema(context, getRef(context, schema)));
367
373
  }
368
374
  if (isAllOfSchema(schema)) {
369
- return Boolean(schema.allOf.find(s => hasResolvableRef(context, s)));
375
+ return Boolean(schema.allOf.find((s) => hasResolvableRef(context, s)));
370
376
  }
371
377
  if (isOneOfSchema(schema)) {
372
- return Boolean(schema.oneOf.find(s => hasResolvableRef(context, s)));
378
+ return Boolean(schema.oneOf.find((s) => hasResolvableRef(context, s)));
373
379
  }
374
380
  return false;
375
381
  }
@@ -377,7 +383,7 @@ function isSelfReferential(path, shapeName) {
377
383
  if (path[0] !== "shapes" || path[1] !== shapeName) {
378
384
  return false;
379
385
  }
380
- const index = path.findIndex(part => part === "allOf" || part === "extends");
386
+ const index = path.findIndex((part) => part === "allOf" || part === "extends");
381
387
  return index !== -1 && isIntegerLike(path[Number(index) + 1]);
382
388
  }
383
389
  /**
@@ -435,7 +441,7 @@ export function dereferenceObjectSchema(context, shapeOrFieldSchema, schemaPath
435
441
  return schema;
436
442
  }
437
443
  export function createGetNamespace(context) {
438
- return serviceId => context.services?.[serviceId]?.namespace;
444
+ return (serviceId) => context.services?.[serviceId]?.namespace;
439
445
  }
440
446
  export function parsePropertyRef(refStr) {
441
447
  const [serviceId, coordinate] = splitAtRef(refStr);
@@ -444,7 +450,11 @@ export function parsePropertyRef(refStr) {
444
450
  return { serviceId, shapeName: "Query", propertyName: coordinateParts[0] };
445
451
  }
446
452
  if (coordinateParts.length === 2) {
447
- return { serviceId, shapeName: coordinateParts[0], propertyName: coordinateParts[1] };
453
+ return {
454
+ serviceId,
455
+ shapeName: coordinateParts[0],
456
+ propertyName: coordinateParts[1]
457
+ };
448
458
  }
449
459
  }
450
460
  export function serializePropertyRef({ shapeName, propertyName, serviceId }) {
@@ -521,7 +531,7 @@ export function getAllPropertyRefs(projectSchema) {
521
531
  const parentIsResolver = (path, resolverName) => {
522
532
  const parent = get(projectSchema, path.slice(0, -1));
523
533
  return (isRecord(parent) &&
524
- (Array.isArray(resolverName) ? resolverName.some(name => name === parent.name) : parent.name === resolverName));
534
+ (Array.isArray(resolverName) ? resolverName.some((name) => name === parent.name) : parent.name === resolverName));
525
535
  };
526
536
  const parentIsGenerateState = (path) => {
527
537
  if (path[0] !== "ai-experimental" || path[path.length - 2] !== "execution") {
@@ -583,7 +593,7 @@ export function normalizeRefs(projectSchema, property) {
583
593
  if (property.oneOf) {
584
594
  return {
585
595
  ...updatedProperty,
586
- oneOf: property.oneOf.map(item => normalizeRefs(projectSchema, item))
596
+ oneOf: property.oneOf.map((item) => normalizeRefs(projectSchema, item))
587
597
  };
588
598
  }
589
599
  // Convert $ref to @ref
@@ -1,11 +1,11 @@
1
1
  import { isDefined } from "@takeshape/util";
2
- import find from "lodash/find.js";
3
2
  import camelCase from "lodash/camelCase.js";
3
+ import find from "lodash/find.js";
4
4
  import uniq from "lodash/uniq.js";
5
- import { isPropertySchemaWithRelationship, isModelShape, isObjectSchema } from "./types/index.js";
6
- import { getRefShapeName, followRef } from "./refs.js";
7
- import { isUnionSchema } from "./unions.js";
8
5
  import { builtInShapes } from "./builtin-schema.js";
6
+ import { followRef, getRefShapeName } from "./refs.js";
7
+ import { isModelShape, isObjectSchema, isPropertySchemaWithRelationship } from "./types/index.js";
8
+ import { isUnionSchema } from "./unions.js";
9
9
  import { getShapeById } from "./util/shapes.js";
10
10
  /**
11
11
  * Turn a LegacyRelationship into a partial PropertySchemaWithRelationship.
@@ -25,8 +25,8 @@ export function getRelationshipSchema(projectSchema, relationship) {
25
25
  let shapeRefs;
26
26
  if ("shapeIds" in relationship) {
27
27
  shapeRefs = relationship.shapeIds
28
- .map(shapeId => {
29
- const shape = getShapeById(projectSchema, shapeId) ?? find(builtInShapes, shape => shape.id === shapeId);
28
+ .map((shapeId) => {
29
+ const shape = getShapeById(projectSchema, shapeId) ?? find(builtInShapes, (shape) => shape.id === shapeId);
30
30
  return (shape && {
31
31
  "@ref": `local:${shape.name}`
32
32
  });
@@ -35,7 +35,7 @@ export function getRelationshipSchema(projectSchema, relationship) {
35
35
  isMultiple = relationship.type === "multiple";
36
36
  }
37
37
  else {
38
- shapeRefs = relationship.refs.map(refStr => ({ "@ref": refStr }));
38
+ shapeRefs = relationship.refs.map((refStr) => ({ "@ref": refStr }));
39
39
  isMultiple = relationship.isMultiple;
40
40
  }
41
41
  if (!shapeRefs.length) {
@@ -70,7 +70,7 @@ export function getRelationshipShapeRefs(propertySchema) {
70
70
  let refs = [];
71
71
  const schema = propertySchema.items ?? propertySchema;
72
72
  if (schema.oneOf) {
73
- refs = schema.oneOf.map(schema => schema["@ref"]).filter(isDefined);
73
+ refs = schema.oneOf.map((schema) => schema["@ref"]).filter(isDefined);
74
74
  }
75
75
  else if (schema["@ref"]) {
76
76
  refs = [schema["@ref"]];
@@ -82,7 +82,7 @@ export function getRelationshipShapeRefs(propertySchema) {
82
82
  */
83
83
  export function getRelationshipShapes(shapes, refs) {
84
84
  return refs
85
- .map(ref => {
85
+ .map((ref) => {
86
86
  const shapeName = ref.split(":")[1];
87
87
  const shape = shapes[shapeName];
88
88
  return shape ? shape : undefined;
@@ -94,7 +94,7 @@ export function getRelationshipShapes(shapes, refs) {
94
94
  */
95
95
  export function getRelationshipShapeIds(shapes, refs) {
96
96
  return refs
97
- .map(ref => {
97
+ .map((ref) => {
98
98
  const shapeName = ref.split(":")[1];
99
99
  const shape = shapes[shapeName];
100
100
  return shape ? shape.id : undefined;
@@ -137,7 +137,7 @@ export function findExistingRelationships(projectSchema, shapes) {
137
137
  const relationships = {};
138
138
  const shapeArray = Object.values(shapes);
139
139
  const shapesSeen = new Set();
140
- const shapeIds = new Set(shapeArray.map(shape => shape.id));
140
+ const shapeIds = new Set(shapeArray.map((shape) => shape.id));
141
141
  const findRelationships = (schema, path, parentShapeName) => {
142
142
  const relationship = getRelationship(schema);
143
143
  if (relationship) {
@@ -211,7 +211,7 @@ export function isEqualRelationship(a, b) {
211
211
  return false;
212
212
  }
213
213
  const refSet = new Set(refsA);
214
- return refsB.every(ref => refSet.has(ref));
214
+ return refsB.every((ref) => refSet.has(ref));
215
215
  }
216
216
  /**
217
217
  * Test whether an array of PropertySchemas have unequal relationships
@@ -223,10 +223,10 @@ export function hasUnequalRelationships(relationships) {
223
223
  }));
224
224
  }
225
225
  function getRelatedShapeIds(relationships) {
226
- return uniq(relationships.map(rel => (rel.hasBackreference ? rel.shapeId : undefined)).filter(isDefined));
226
+ return uniq(relationships.map((rel) => (rel.hasBackreference ? rel.shapeId : undefined)).filter(isDefined));
227
227
  }
228
228
  function getShapes(projectSchema, shapeIds) {
229
- return shapeIds.map(shapeId => getShapeById(projectSchema, shapeId)).filter(isDefined);
229
+ return shapeIds.map((shapeId) => getShapeById(projectSchema, shapeId)).filter(isDefined);
230
230
  }
231
231
  /**
232
232
  * Adds backreference fields to the schema.
@@ -236,7 +236,7 @@ export function addRelatedFields(projectSchema, allRelationships) {
236
236
  const shape = getShapeById(projectSchema, shapeId);
237
237
  if (shape && isObjectSchema(shape.schema)) {
238
238
  const relatedShapeIds = getRelatedShapeIds(shapeRelationships);
239
- const relatedShapeNames = getShapes(projectSchema, relatedShapeIds).map(shape => shape.name);
239
+ const relatedShapeNames = getShapes(projectSchema, relatedShapeIds).map((shape) => shape.name);
240
240
  if (relatedShapeNames.length) {
241
241
  let shapeName;
242
242
  if (relatedShapeNames.length === 1) {
@@ -251,14 +251,16 @@ export function addRelatedFields(projectSchema, allRelationships) {
251
251
  name: shapeName,
252
252
  title: shapeName,
253
253
  schema: {
254
- oneOf: relatedShapeNames.map(name => ({ "@ref": `local:${name}` }))
254
+ oneOf: relatedShapeNames.map((name) => ({
255
+ "@ref": `local:${name}`
256
+ }))
255
257
  }
256
258
  };
257
259
  }
258
260
  // _references, a list of all backreferences across all fields on this shape.
259
261
  // It lists all the items that have references to the current item.
260
262
  // It is for convenience.
261
- if (shapeRelationships.some(rel => rel.hasBackreference)) {
263
+ if (shapeRelationships.some((rel) => rel.hasBackreference)) {
262
264
  shape.schema.properties._references = {
263
265
  "@args": `TSListArgs<local:${shapeName}>`,
264
266
  "@ref": `PaginatedList<local:${shapeName}>`,
@@ -268,8 +270,8 @@ export function addRelatedFields(projectSchema, allRelationships) {
268
270
  args: {
269
271
  ops: [
270
272
  { path: "$", mapping: "$args" },
271
- { path: `baseWhere._references.eq`, mapping: "$source._id" },
272
- { path: `baseWhere._shapeId.in`, value: relatedShapeIds }
273
+ { path: "baseWhere._references.eq", mapping: "$source._id" },
274
+ { path: "baseWhere._shapeId.in", value: relatedShapeIds }
273
275
  ]
274
276
  }
275
277
  }
@@ -292,8 +294,11 @@ export function addRelatedFields(projectSchema, allRelationships) {
292
294
  args: {
293
295
  ops: [
294
296
  { path: "$", mapping: "$args" },
295
- { path: `baseWhere.${filterField}.eq`, mapping: "$source._id" },
296
- { path: `baseWhere._shapeId.eq`, value: relatedShape.id }
297
+ {
298
+ path: `baseWhere.${filterField}.eq`,
299
+ mapping: "$source._id"
300
+ },
301
+ { path: "baseWhere._shapeId.eq", value: relatedShape.id }
297
302
  ]
298
303
  }
299
304
  }
@@ -1,14 +1,14 @@
1
1
  import { SchemaBuildError } from "@takeshape/errors";
2
- import compose from "lodash/fp/compose.js";
3
2
  import { deepClone } from "@takeshape/util";
4
- import set from "lodash/set.js";
3
+ import compose from "lodash/fp/compose.js";
5
4
  import isError from "lodash/isError.js";
6
- import { isModelShape } from "./types/index.js";
7
- import { applyDefaultsToSchema, createShape } from "./schema-util.js";
8
- import { addRelatedFields, findExistingRelationships } from "./relationships.js";
9
- import { flattenTemplates } from "./flatten-templates.js";
5
+ import set from "lodash/set.js";
10
6
  import { addAiQueries } from "./agents.js";
7
+ import { flattenTemplates } from "./flatten-templates.js";
8
+ import { addRelatedFields, findExistingRelationships } from "./relationships.js";
9
+ import { applyDefaultsToSchema, createShape } from "./schema-util.js";
11
10
  import { resolveSchemaShapeDependencies } from "./service-dependencies.js";
11
+ import { isModelShape } from "./types/index.js";
12
12
  export function applyLegacyCompatibilityTweaks(projectSchema) {
13
13
  const newSchema = deepClone(projectSchema);
14
14
  let hasSearchableShapes = false;
@@ -16,8 +16,12 @@ export function applyLegacyCompatibilityTweaks(projectSchema) {
16
16
  if (isModelShape(shape)) {
17
17
  hasSearchableShapes = true;
18
18
  // Magic _contentTypeId field used for V1 compatibility
19
- set(shape, ["schema", "properties", "_contentTypeId"], { type: "string" });
20
- set(shape, ["schema", "properties", "_contentTypeName"], { type: "string" });
19
+ set(shape, ["schema", "properties", "_contentTypeId"], {
20
+ type: "string"
21
+ });
22
+ set(shape, ["schema", "properties", "_contentTypeName"], {
23
+ type: "string"
24
+ });
21
25
  if (shape.model?.type !== "single") {
22
26
  newSchema.queries[`search${shapeName}Index`] = {
23
27
  shape: `SearchResults<${shapeName}>`,
@@ -43,7 +47,10 @@ export function applyLegacyCompatibilityTweaks(projectSchema) {
43
47
  }
44
48
  if (hasSearchableShapes) {
45
49
  // A placeholder shape for the TSSearchable interface
46
- newSchema.shapes.TSSearchable = createShape("TSSearchable", { type: "object", properties: {} });
50
+ newSchema.shapes.TSSearchable = createShape("TSSearchable", {
51
+ type: "object",
52
+ properties: {}
53
+ });
47
54
  newSchema.queries.search = {
48
55
  shape: "SearchResults<TSSearchable>",
49
56
  resolver: {
@@ -1,8 +1,8 @@
1
1
  import { visit } from "@takeshape/util";
2
2
  import pickBy from "lodash/pickBy.js";
3
+ import { getContentTransform } from "./content-schema-transform.js";
3
4
  import { isObjectSchema } from "./types/index.js";
4
5
  import { createUnwrapTransform, createWrapTransform, isUnionSchema } from "./unions.js";
5
- import { getContentTransform } from "./content-schema-transform.js";
6
6
  function createPropertiesPredicate(propertyNames) {
7
7
  const byShape = new Map();
8
8
  for (const name of propertyNames) {
@@ -22,7 +22,7 @@ function createPropertiesPredicate(propertyNames) {
22
22
  }
23
23
  export function removePropertiesTransform(propertyNames) {
24
24
  const isBlacklisted = createPropertiesPredicate(propertyNames);
25
- return projectSchema => {
25
+ return (projectSchema) => {
26
26
  visit(projectSchema, ["schema"], (value, path) => {
27
27
  if (path.length === 3 && path[0] === "shapes" && path[2] === "schema") {
28
28
  const shapeSchema = value;
@@ -30,7 +30,7 @@ export function removePropertiesTransform(propertyNames) {
30
30
  const { properties, required } = shapeSchema;
31
31
  shapeSchema.properties = pickBy(properties, (_, name) => !isBlacklisted(path[1], name));
32
32
  if (required) {
33
- shapeSchema.required = required.filter(name => !isBlacklisted(path[1], name));
33
+ shapeSchema.required = required.filter((name) => !isBlacklisted(path[1], name));
34
34
  }
35
35
  }
36
36
  }
@@ -1,22 +1,22 @@
1
- import mapValues from "lodash/mapValues.js";
2
- import keyBy from "lodash/keyBy.js";
1
+ import { deepClone, ensureArray, pascalCase, visit } from "@takeshape/util";
3
2
  import curry from "lodash/fp/curry.js";
4
3
  import orderBy from "lodash/fp/orderBy.js";
5
- import uniq from "lodash/uniq.js";
6
- import { deepClone, visit, pascalCase, ensureArray } from "@takeshape/util";
7
- import isString from "lodash/isString.js";
8
4
  import isArray from "lodash/isArray.js";
5
+ import isString from "lodash/isString.js";
6
+ import keyBy from "lodash/keyBy.js";
7
+ import mapValues from "lodash/mapValues.js";
9
8
  import some from "lodash/some.js";
10
- import { defaultWorkflow, getStatusField } from "./workflows.js";
11
- import { CURRENT_API_VERSION, CURRENT_SCHEMA_VERSION } from "./versions.js";
9
+ import uniq from "lodash/uniq.js";
12
10
  import { workflowsEnabled } from "./api-version.js";
13
- import { builtInShapes, builtInForms } from "./builtin-schema.js";
14
- import { createTemplateShapeName, dereferenceObjectSchema, dereferenceSchema, getRef, getRefOrItemsRef, getRefShapeName, parseReturnShape, refExpressionToRefItem, refItemToShape, refItemToNamespacedShapeName, refItemToShapeSchema, atRefToRefItem, refToRefItem, parseTemplateShape, returnShapeToSchema, serializePropertyRef } from "./refs.js";
11
+ import { builtInForms, builtInShapes } from "./builtin-schema.js";
12
+ import { SERVICE_OBJECT_PATTERN_NAME } from "./constants.js";
13
+ import { atRefToRefItem, createTemplateShapeName, dereferenceObjectSchema, dereferenceSchema, getRef, getRefOrItemsRef, getRefShapeName, parseReturnShape, parseTemplateShape, refExpressionToRefItem, refItemToNamespacedShapeName, refItemToShape, refItemToShapeSchema, refToRefItem, returnShapeToSchema, serializePropertyRef } from "./refs.js";
14
+ import { getArgsType, isAllOfSchema, isArraySchema, isCachedShape, isExtendsSchema, isGraphqlResolver, isModelShape, isObjectSchema, isOneOfSchema, isRefSchema } from "./types/index.js";
15
15
  import { isUnionSchema } from "./unions.js";
16
- import { mergeFormProperties, mergeSchemaProperties } from "./util/merge.js";
17
16
  import { getArgs } from "./util/has-arg.js";
18
- import { getArgsType, isObjectSchema, isAllOfSchema, isOneOfSchema, isExtendsSchema, isArraySchema, isGraphqlResolver, isRefSchema, isModelShape, isCachedShape } from "./types/index.js";
19
- import { SERVICE_OBJECT_PATTERN_NAME } from "./constants.js";
17
+ import { mergeFormProperties, mergeSchemaProperties } from "./util/merge.js";
18
+ import { CURRENT_API_VERSION, CURRENT_SCHEMA_VERSION } from "./versions.js";
19
+ import { defaultWorkflow, getStatusField } from "./workflows.js";
20
20
  export function isBuiltinShape(shapeName) {
21
21
  return Boolean(builtInShapes[shapeName]);
22
22
  }
@@ -386,17 +386,17 @@ const requiredBuiltinShapes = ["Asset", "TSRelationship", "TSStaticSite", "TSUse
386
386
  */
387
387
  export function getBuiltinsUsed(projectSchema) {
388
388
  const builtinsUsed = {};
389
- const shapeNames = uniq(requiredBuiltinShapes.concat(getAllRefs(projectSchema, refItem => refItem.serviceKey === "local" && isBuiltinShape(refItem.typeName)).map(refItemToNamespacedShapeName)));
389
+ const shapeNames = uniq(requiredBuiltinShapes.concat(getAllRefs(projectSchema, (refItem) => refItem.serviceKey === "local" && isBuiltinShape(refItem.typeName)).map(refItemToNamespacedShapeName)));
390
390
  const schemaWithAllBuiltins = {
391
391
  ...emptySchema("project-id"),
392
392
  shapes: builtInShapes
393
393
  };
394
- shapeNames.forEach(builtinShapeName => {
394
+ for (const builtinShapeName of shapeNames) {
395
395
  builtinsUsed[builtinShapeName] = builtInShapes[builtinShapeName];
396
- getShapeDependencies(schemaWithAllBuiltins, builtInShapes[builtinShapeName]).forEach(depShapeName => {
396
+ for (const depShapeName of getShapeDependencies(schemaWithAllBuiltins, builtInShapes[builtinShapeName])) {
397
397
  builtinsUsed[depShapeName] = builtInShapes[depShapeName];
398
- });
399
- });
398
+ }
399
+ }
400
400
  return builtinsUsed;
401
401
  }
402
402
  export function applyDefaultsToSchema(projectSchema) {
@@ -405,7 +405,9 @@ export function applyDefaultsToSchema(projectSchema) {
405
405
  ...projectSchema,
406
406
  workflows: {
407
407
  ...projectSchema.workflows,
408
- ...(workflowsEnabled(projectSchema.apiVersion) && { default: defaultWorkflow })
408
+ ...(workflowsEnabled(projectSchema.apiVersion) && {
409
+ default: defaultWorkflow
410
+ })
409
411
  },
410
412
  queries: {
411
413
  ...builtInQueriesAndMutations.queries,
@@ -415,7 +417,7 @@ export function applyDefaultsToSchema(projectSchema) {
415
417
  ...builtInQueriesAndMutations.mutations,
416
418
  ...projectSchema.mutations
417
419
  },
418
- shapes: mapValues({ ...builtinsUsed, ...projectSchema.shapes }, shape => {
420
+ shapes: mapValues({ ...builtinsUsed, ...projectSchema.shapes }, (shape) => {
419
421
  const builtInShape = builtinsUsed[shape.name];
420
422
  if (builtInShape && builtInShape !== shape) {
421
423
  shape = {
@@ -428,7 +430,10 @@ export function applyDefaultsToSchema(projectSchema) {
428
430
  forms: mapValues({ ...builtInForms, ...projectSchema.forms }, (formsConfig, shapeName) => {
429
431
  const builtInFormsConfig = builtInForms[shapeName];
430
432
  if (builtInFormsConfig && builtInFormsConfig !== formsConfig) {
431
- formsConfig = { ...formsConfig, default: mergeFormProperties(formsConfig.default, builtInFormsConfig.default) };
433
+ formsConfig = {
434
+ ...formsConfig,
435
+ default: mergeFormProperties(formsConfig.default, builtInFormsConfig.default)
436
+ };
432
437
  }
433
438
  return formsConfig;
434
439
  })
@@ -481,16 +486,19 @@ const createShapeToPropertySchema = (projectSchema, definitions, definitionNames
481
486
  };
482
487
  propSchema.required = ["_shapeId"];
483
488
  }
484
- propSchema.oneOf.forEach(schema => {
489
+ for (const schema of propSchema.oneOf) {
485
490
  handleSchema(schema);
486
- });
491
+ }
487
492
  return;
488
493
  }
489
494
  // Add workflow validation
490
495
  if (propSchema["@workflow"]) {
491
496
  const workflowName = propSchema["@workflow"];
492
497
  const workflow = projectSchema.workflows[workflowName] || defaultWorkflow;
493
- propSchema.oneOf = workflow.steps.map(step => ({ enum: [step.key, step.name], title: step.title }));
498
+ propSchema.oneOf = workflow.steps.map((step) => ({
499
+ enum: [step.key, step.name],
500
+ title: step.title
501
+ }));
494
502
  }
495
503
  const refItem = getRef(projectSchema, propSchema);
496
504
  if (refItem) {
@@ -525,9 +533,9 @@ const createShapeToPropertySchema = (projectSchema, definitions, definitionNames
525
533
  if (shape.title) {
526
534
  shapeSchemaCopy.title = shape.title;
527
535
  }
528
- Object.values(shapeSchemaCopy.properties).forEach(schema => {
536
+ for (const schema of Object.values(shapeSchemaCopy.properties)) {
529
537
  handleSchema(schema);
530
- });
538
+ }
531
539
  return shapeSchemaCopy;
532
540
  };
533
541
  return rewriteRefs;
@@ -771,7 +779,7 @@ export function getFullyQualifiedShapeName(schema) {
771
779
  * @param schema
772
780
  */
773
781
  export function getStorageKey(schema) {
774
- const first = findMapping(schema, mapping => mapping.startsWith("shapedb:"));
782
+ const first = findMapping(schema, (mapping) => mapping.startsWith("shapedb:"));
775
783
  return first ? splitMapping(first)[1] : undefined;
776
784
  }
777
785
  export function getPropertyService(schema) {
@@ -814,7 +822,7 @@ export function getShapesById(projectSchema) {
814
822
  * @returns A `string` array with all the shapes that are in namespaces.
815
823
  */
816
824
  export function getAllNamespaceShapes(projectSchema) {
817
- const isServiceRef = refItem => Boolean(refItem.serviceNamespace);
825
+ const isServiceRef = (refItem) => Boolean(refItem.serviceNamespace);
818
826
  return uniq(getAllValidRefs(projectSchema, isServiceRef).map(refItemToNamespacedShapeName));
819
827
  }
820
828
  /**
@@ -837,11 +845,11 @@ export function getNamespacedShapeNameList(projectSchema) {
837
845
  const namespacedShapeNames = new Set(getAllNamespaceShapes(projectSchema));
838
846
  // Add all namespaced shapes to the schema if they are not already present,
839
847
  // e.g. Shopify_Product
840
- namespacedShapeNames.forEach(name => {
848
+ for (const name of namespacedShapeNames) {
841
849
  if (!existingShapeNames.has(name)) {
842
850
  requiredShapeNames.add(name);
843
851
  }
844
- });
852
+ }
845
853
  return requiredShapeNames;
846
854
  }
847
855
  /**
@@ -887,7 +895,7 @@ export const createSchemaPropertyList = curry((context, shapeOrSchema) => {
887
895
  .sort(([nameA], [nameB]) => {
888
896
  const indexA = comparatorArray.indexOf(nameA);
889
897
  const indexB = comparatorArray.indexOf(nameB);
890
- return (indexA > -1 ? indexA : Infinity) - (indexB > -1 ? indexB : Infinity);
898
+ return ((indexA > -1 ? indexA : Number.POSITIVE_INFINITY) - (indexB > -1 ? indexB : Number.POSITIVE_INFINITY));
891
899
  }));
892
900
  }
893
901
  return self;
@@ -1030,12 +1038,12 @@ export function queryToPropertySchema(projectSchema, query) {
1030
1038
  export function getQueriesShape(projectSchema, operation) {
1031
1039
  return createShape(pascalCase(operation), {
1032
1040
  type: "object",
1033
- properties: mapValues(projectSchema[operation === "query" ? "queries" : "mutations"], query => queryToPropertySchema(projectSchema, query))
1041
+ properties: mapValues(projectSchema[operation === "query" ? "queries" : "mutations"], (query) => queryToPropertySchema(projectSchema, query))
1034
1042
  });
1035
1043
  }
1036
1044
  export function fieldMappingContainsKey(fieldMapping, key) {
1037
1045
  if (isArray(fieldMapping)) {
1038
- return some(fieldMapping, mapping => parseMapping(mapping).key === key);
1046
+ return some(fieldMapping, (mapping) => parseMapping(mapping).key === key);
1039
1047
  }
1040
1048
  return parseMapping(fieldMapping).key === key;
1041
1049
  }