@takeshape/schema 8.105.0 → 8.106.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 (319) hide show
  1. package/{lib → dist}/api-version.d.ts +0 -0
  2. package/{lib → dist}/api-version.d.ts.map +0 -0
  3. package/{lib → dist}/api-version.js +0 -0
  4. package/{lib → dist}/auth-schemas.d.ts +0 -0
  5. package/{lib → dist}/auth-schemas.d.ts.map +0 -0
  6. package/{lib → dist}/auth-schemas.js +0 -0
  7. package/{lib → dist}/builtin-schema.d.ts +0 -0
  8. package/{lib → dist}/builtin-schema.d.ts.map +0 -0
  9. package/{lib → dist}/builtin-schema.js +0 -0
  10. package/{lib → dist}/content-schema-transform.d.ts +0 -0
  11. package/{lib → dist}/content-schema-transform.d.ts.map +0 -0
  12. package/{lib → dist}/content-schema-transform.js +0 -0
  13. package/{lib → dist}/enum.d.ts +0 -0
  14. package/{lib → dist}/enum.d.ts.map +0 -0
  15. package/{lib → dist}/enum.js +0 -0
  16. package/{lib → dist}/flatten-templates.d.ts +0 -0
  17. package/{lib → dist}/flatten-templates.d.ts.map +0 -0
  18. package/{lib → dist}/flatten-templates.js +0 -0
  19. package/{lib → dist}/get-is-leaf.d.ts +0 -0
  20. package/{lib → dist}/get-is-leaf.d.ts.map +0 -0
  21. package/{lib → dist}/get-is-leaf.js +0 -0
  22. package/{lib → dist}/index.d.ts +0 -0
  23. package/{lib → dist}/index.d.ts.map +0 -0
  24. package/{lib → dist}/index.js +0 -0
  25. package/{lib → dist}/layers/layers.d.ts +0 -0
  26. package/{lib → dist}/layers/layers.d.ts.map +0 -0
  27. package/{lib → dist}/layers/layers.js +0 -0
  28. package/{lib → dist}/layers/refs.d.ts +0 -0
  29. package/{lib → dist}/layers/refs.d.ts.map +0 -0
  30. package/{lib → dist}/layers/refs.js +0 -0
  31. package/{lib → dist}/layers/type-utils.d.ts +0 -0
  32. package/{lib → dist}/layers/type-utils.d.ts.map +0 -0
  33. package/{lib → dist}/layers/type-utils.js +0 -0
  34. package/{lib → dist}/layers/visitor.d.ts +0 -0
  35. package/{lib → dist}/layers/visitor.d.ts.map +0 -0
  36. package/{lib → dist}/layers/visitor.js +0 -0
  37. package/{lib → dist}/migration/index.d.ts +0 -0
  38. package/{lib → dist}/migration/index.d.ts.map +0 -0
  39. package/{lib → dist}/migration/index.js +0 -0
  40. package/{lib → dist}/migration/to/v3.0.0.d.ts +0 -0
  41. package/{lib → dist}/migration/to/v3.0.0.d.ts.map +0 -0
  42. package/{lib → dist}/migration/to/v3.0.0.js +0 -0
  43. package/{lib → dist}/migration/to/v3.1.0.d.ts +0 -0
  44. package/{lib → dist}/migration/to/v3.1.0.d.ts.map +0 -0
  45. package/{lib → dist}/migration/to/v3.1.0.js +0 -0
  46. package/{lib → dist}/migration/to/v3.10.0.d.ts +0 -0
  47. package/{lib → dist}/migration/to/v3.10.0.d.ts.map +0 -0
  48. package/{lib → dist}/migration/to/v3.10.0.js +0 -0
  49. package/{lib → dist}/migration/to/v3.11.0.d.ts +0 -0
  50. package/{lib → dist}/migration/to/v3.11.0.d.ts.map +0 -0
  51. package/{lib → dist}/migration/to/v3.11.0.js +0 -0
  52. package/{lib → dist}/migration/to/v3.12.0.d.ts +0 -0
  53. package/{lib → dist}/migration/to/v3.12.0.d.ts.map +0 -0
  54. package/{lib → dist}/migration/to/v3.12.0.js +0 -0
  55. package/{lib → dist}/migration/to/v3.12.1.d.ts +0 -0
  56. package/{lib → dist}/migration/to/v3.12.1.d.ts.map +0 -0
  57. package/{lib → dist}/migration/to/v3.12.1.js +0 -0
  58. package/{lib → dist}/migration/to/v3.12.2.d.ts +0 -0
  59. package/{lib → dist}/migration/to/v3.12.2.d.ts.map +0 -0
  60. package/{lib → dist}/migration/to/v3.12.2.js +0 -0
  61. package/{lib → dist}/migration/to/v3.12.3.d.ts +0 -0
  62. package/{lib → dist}/migration/to/v3.12.3.d.ts.map +0 -0
  63. package/{lib → dist}/migration/to/v3.12.3.js +0 -0
  64. package/{lib → dist}/migration/to/v3.13.0.d.ts +0 -0
  65. package/{lib → dist}/migration/to/v3.13.0.d.ts.map +0 -0
  66. package/{lib → dist}/migration/to/v3.13.0.js +0 -0
  67. package/{lib → dist}/migration/to/v3.14.0.d.ts +0 -0
  68. package/{lib → dist}/migration/to/v3.14.0.d.ts.map +0 -0
  69. package/{lib → dist}/migration/to/v3.14.0.js +0 -0
  70. package/{lib → dist}/migration/to/v3.15.0.d.ts +0 -0
  71. package/{lib → dist}/migration/to/v3.15.0.d.ts.map +0 -0
  72. package/{lib → dist}/migration/to/v3.15.0.js +0 -0
  73. package/{lib → dist}/migration/to/v3.16.0.d.ts +0 -0
  74. package/{lib → dist}/migration/to/v3.16.0.d.ts.map +0 -0
  75. package/{lib → dist}/migration/to/v3.16.0.js +0 -0
  76. package/{lib → dist}/migration/to/v3.17.0.d.ts +0 -0
  77. package/{lib → dist}/migration/to/v3.17.0.d.ts.map +0 -0
  78. package/{lib → dist}/migration/to/v3.17.0.js +0 -0
  79. package/{lib → dist}/migration/to/v3.2.0.d.ts +0 -0
  80. package/{lib → dist}/migration/to/v3.2.0.d.ts.map +0 -0
  81. package/{lib → dist}/migration/to/v3.2.0.js +0 -0
  82. package/{lib → dist}/migration/to/v3.3.0.d.ts +0 -0
  83. package/{lib → dist}/migration/to/v3.3.0.d.ts.map +0 -0
  84. package/{lib → dist}/migration/to/v3.3.0.js +0 -0
  85. package/{lib → dist}/migration/to/v3.4.0.d.ts +0 -0
  86. package/{lib → dist}/migration/to/v3.4.0.d.ts.map +0 -0
  87. package/{lib → dist}/migration/to/v3.4.0.js +0 -0
  88. package/{lib → dist}/migration/to/v3.5.0.d.ts +0 -0
  89. package/{lib → dist}/migration/to/v3.5.0.d.ts.map +0 -0
  90. package/{lib → dist}/migration/to/v3.5.0.js +0 -0
  91. package/{lib → dist}/migration/to/v3.5.1.d.ts +0 -0
  92. package/{lib → dist}/migration/to/v3.5.1.d.ts.map +0 -0
  93. package/{lib → dist}/migration/to/v3.5.1.js +0 -0
  94. package/{lib → dist}/migration/to/v3.6.0.d.ts +0 -0
  95. package/{lib → dist}/migration/to/v3.6.0.d.ts.map +0 -0
  96. package/{lib → dist}/migration/to/v3.6.0.js +0 -0
  97. package/{lib → dist}/migration/to/v3.7.0.d.ts +0 -0
  98. package/{lib → dist}/migration/to/v3.7.0.d.ts.map +0 -0
  99. package/{lib → dist}/migration/to/v3.7.0.js +0 -0
  100. package/{lib → dist}/migration/to/v3.8.0.d.ts +0 -0
  101. package/{lib → dist}/migration/to/v3.8.0.d.ts.map +0 -0
  102. package/{lib → dist}/migration/to/v3.8.0.js +0 -0
  103. package/{lib → dist}/migration/to/v3.9.0.d.ts +0 -0
  104. package/{lib → dist}/migration/to/v3.9.0.d.ts.map +0 -0
  105. package/{lib → dist}/migration/to/v3.9.0.js +0 -0
  106. package/{lib → dist}/migration/types.d.ts +0 -0
  107. package/{lib → dist}/migration/types.d.ts.map +0 -0
  108. package/{lib → dist}/migration/types.js +0 -0
  109. package/{lib → dist}/migration/utils.d.ts +0 -0
  110. package/{lib → dist}/migration/utils.d.ts.map +0 -0
  111. package/{lib → dist}/migration/utils.js +0 -0
  112. package/{lib → dist}/mocks.d.ts +0 -0
  113. package/{lib → dist}/mocks.d.ts.map +0 -0
  114. package/{lib → dist}/mocks.js +0 -0
  115. package/{lib → dist}/patterns.d.ts +0 -0
  116. package/{lib → dist}/patterns.d.ts.map +0 -0
  117. package/{lib → dist}/patterns.js +0 -0
  118. package/{lib → dist}/project-schema/index.d.ts +0 -0
  119. package/{lib → dist}/project-schema/index.d.ts.map +0 -0
  120. package/{lib → dist}/project-schema/index.js +0 -0
  121. package/{lib → dist}/project-schema/latest.d.ts +0 -0
  122. package/{lib → dist}/project-schema/latest.d.ts.map +0 -0
  123. package/{lib → dist}/project-schema/latest.js +0 -0
  124. package/{lib → dist}/project-schema/migrate.d.ts +0 -0
  125. package/{lib → dist}/project-schema/migrate.d.ts.map +0 -0
  126. package/{lib → dist}/project-schema/migrate.js +0 -0
  127. package/{lib → dist}/project-schema/v1.0.0.d.ts +0 -0
  128. package/{lib → dist}/project-schema/v1.0.0.d.ts.map +0 -0
  129. package/{lib → dist}/project-schema/v1.0.0.js +0 -0
  130. package/{lib → dist}/project-schema/v3.0.0.d.ts +0 -0
  131. package/{lib → dist}/project-schema/v3.0.0.d.ts.map +0 -0
  132. package/{lib → dist}/project-schema/v3.0.0.js +0 -0
  133. package/{lib → dist}/project-schema/v3.1.0.d.ts +0 -0
  134. package/{lib → dist}/project-schema/v3.1.0.d.ts.map +0 -0
  135. package/{lib → dist}/project-schema/v3.1.0.js +0 -0
  136. package/{lib → dist}/project-schema/v3.10.0.d.ts +0 -0
  137. package/{lib → dist}/project-schema/v3.10.0.d.ts.map +0 -0
  138. package/{lib → dist}/project-schema/v3.10.0.js +0 -0
  139. package/{lib → dist}/project-schema/v3.11.0.d.ts +0 -0
  140. package/{lib → dist}/project-schema/v3.11.0.d.ts.map +0 -0
  141. package/{lib → dist}/project-schema/v3.11.0.js +0 -0
  142. package/{lib → dist}/project-schema/v3.12.0.d.ts +0 -0
  143. package/{lib → dist}/project-schema/v3.12.0.d.ts.map +0 -0
  144. package/{lib → dist}/project-schema/v3.12.0.js +0 -0
  145. package/{lib → dist}/project-schema/v3.12.1.d.ts +0 -0
  146. package/{lib → dist}/project-schema/v3.12.1.d.ts.map +0 -0
  147. package/{lib → dist}/project-schema/v3.12.1.js +0 -0
  148. package/{lib → dist}/project-schema/v3.12.2.d.ts +0 -0
  149. package/{lib → dist}/project-schema/v3.12.2.d.ts.map +0 -0
  150. package/{lib → dist}/project-schema/v3.12.2.js +0 -0
  151. package/{lib → dist}/project-schema/v3.12.3.d.ts +0 -0
  152. package/{lib → dist}/project-schema/v3.12.3.d.ts.map +0 -0
  153. package/{lib → dist}/project-schema/v3.12.3.js +0 -0
  154. package/{lib → dist}/project-schema/v3.13.0.d.ts +0 -0
  155. package/{lib → dist}/project-schema/v3.13.0.d.ts.map +0 -0
  156. package/{lib → dist}/project-schema/v3.13.0.js +0 -0
  157. package/{lib → dist}/project-schema/v3.13.1.d.ts +0 -0
  158. package/{lib → dist}/project-schema/v3.13.1.d.ts.map +0 -0
  159. package/{lib → dist}/project-schema/v3.13.1.js +0 -0
  160. package/{lib → dist}/project-schema/v3.14.0.d.ts +0 -0
  161. package/{lib → dist}/project-schema/v3.14.0.d.ts.map +0 -0
  162. package/{lib → dist}/project-schema/v3.14.0.js +0 -0
  163. package/{lib → dist}/project-schema/v3.15.0.d.ts +0 -0
  164. package/{lib → dist}/project-schema/v3.15.0.d.ts.map +0 -0
  165. package/{lib → dist}/project-schema/v3.15.0.js +0 -0
  166. package/{lib → dist}/project-schema/v3.16.0.d.ts +0 -0
  167. package/{lib → dist}/project-schema/v3.16.0.d.ts.map +0 -0
  168. package/{lib → dist}/project-schema/v3.16.0.js +0 -0
  169. package/{lib → dist}/project-schema/v3.17.0.d.ts +0 -0
  170. package/{lib → dist}/project-schema/v3.17.0.d.ts.map +0 -0
  171. package/{lib → dist}/project-schema/v3.17.0.js +0 -0
  172. package/{lib → dist}/project-schema/v3.2.0.d.ts +0 -0
  173. package/{lib → dist}/project-schema/v3.2.0.d.ts.map +0 -0
  174. package/{lib → dist}/project-schema/v3.2.0.js +0 -0
  175. package/{lib → dist}/project-schema/v3.3.0.d.ts +0 -0
  176. package/{lib → dist}/project-schema/v3.3.0.d.ts.map +0 -0
  177. package/{lib → dist}/project-schema/v3.3.0.js +0 -0
  178. package/{lib → dist}/project-schema/v3.4.0.d.ts +0 -0
  179. package/{lib → dist}/project-schema/v3.4.0.d.ts.map +0 -0
  180. package/{lib → dist}/project-schema/v3.4.0.js +0 -0
  181. package/{lib → dist}/project-schema/v3.5.0.d.ts +0 -0
  182. package/{lib → dist}/project-schema/v3.5.0.d.ts.map +0 -0
  183. package/{lib → dist}/project-schema/v3.5.0.js +0 -0
  184. package/{lib → dist}/project-schema/v3.5.1.d.ts +0 -0
  185. package/{lib → dist}/project-schema/v3.5.1.d.ts.map +0 -0
  186. package/{lib → dist}/project-schema/v3.5.1.js +0 -0
  187. package/{lib → dist}/project-schema/v3.6.0.d.ts +0 -0
  188. package/{lib → dist}/project-schema/v3.6.0.d.ts.map +0 -0
  189. package/{lib → dist}/project-schema/v3.6.0.js +0 -0
  190. package/{lib → dist}/project-schema/v3.7.0.d.ts +0 -0
  191. package/{lib → dist}/project-schema/v3.7.0.d.ts.map +0 -0
  192. package/{lib → dist}/project-schema/v3.7.0.js +0 -0
  193. package/{lib → dist}/project-schema/v3.8.0.d.ts +0 -0
  194. package/{lib → dist}/project-schema/v3.8.0.d.ts.map +0 -0
  195. package/{lib → dist}/project-schema/v3.8.0.js +0 -0
  196. package/{lib → dist}/project-schema/v3.9.0.d.ts +0 -0
  197. package/{lib → dist}/project-schema/v3.9.0.d.ts.map +0 -0
  198. package/{lib → dist}/project-schema/v3.9.0.js +0 -0
  199. package/{lib → dist}/project-schema/v4.0.0.d.ts +0 -0
  200. package/{lib → dist}/project-schema/v4.0.0.d.ts.map +0 -0
  201. package/{lib → dist}/project-schema/v4.0.0.js +0 -0
  202. package/{lib → dist}/refs.d.ts +0 -0
  203. package/{lib → dist}/refs.d.ts.map +0 -0
  204. package/{lib → dist}/refs.js +0 -0
  205. package/dist/relationships.d.ts +11 -0
  206. package/dist/relationships.d.ts.map +1 -0
  207. package/dist/relationships.js +66 -0
  208. package/{lib → dist}/rewrite.d.ts +0 -0
  209. package/{lib → dist}/rewrite.d.ts.map +0 -0
  210. package/{lib → dist}/rewrite.js +0 -0
  211. package/{lib → dist}/scalars.d.ts +0 -0
  212. package/{lib → dist}/scalars.d.ts.map +0 -0
  213. package/{lib → dist}/scalars.js +0 -0
  214. package/{lib → dist}/schema-util.d.ts +2 -0
  215. package/dist/schema-util.d.ts.map +1 -0
  216. package/{lib → dist}/schema-util.js +10 -7
  217. package/{lib → dist}/schemas/auth-schemas.json +0 -0
  218. package/{lib → dist}/schemas/index.d.ts +0 -0
  219. package/{lib → dist}/schemas/index.d.ts.map +0 -0
  220. package/{lib → dist}/schemas/index.js +0 -0
  221. package/{lib → dist}/schemas/index.ts +0 -0
  222. package/{lib → dist}/schemas/project-schema/latest.json +0 -0
  223. package/{lib → dist}/schemas/project-schema/meta-schema-v1.0.0.json +0 -0
  224. package/{lib → dist}/schemas/project-schema/meta-schema-v3.0.0.json +0 -0
  225. package/{lib → dist}/schemas/project-schema/meta-schema-v3.1.0.json +0 -0
  226. package/{lib → dist}/schemas/project-schema/meta-schema-v3.2.0.json +0 -0
  227. package/{lib → dist}/schemas/project-schema/meta-schema-v3.3.0.json +0 -0
  228. package/{lib → dist}/schemas/project-schema/meta-schema-v3.4.0.json +0 -0
  229. package/{lib → dist}/schemas/project-schema/meta-schema-v3.5.0.json +0 -0
  230. package/{lib → dist}/schemas/project-schema/meta-schema-v3.5.1.json +0 -0
  231. package/{lib → dist}/schemas/project-schema/meta-schema-v3.6.0.json +0 -0
  232. package/{lib → dist}/schemas/project-schema/meta-schema-v3.7.0.json +0 -0
  233. package/{lib → dist}/schemas/project-schema/meta-schema-v3.8.0.json +0 -0
  234. package/{lib → dist}/schemas/project-schema/meta-schema-v3.9.0.json +0 -0
  235. package/{lib → dist}/schemas/project-schema/v1.0.0.json +0 -0
  236. package/{lib → dist}/schemas/project-schema/v3.0.0.json +0 -0
  237. package/{lib → dist}/schemas/project-schema/v3.1.0.json +0 -0
  238. package/{lib → dist}/schemas/project-schema/v3.10.0.json +0 -0
  239. package/{lib → dist}/schemas/project-schema/v3.11.0.json +0 -0
  240. package/{lib → dist}/schemas/project-schema/v3.12.0.json +0 -0
  241. package/{lib → dist}/schemas/project-schema/v3.12.1.json +0 -0
  242. package/{lib → dist}/schemas/project-schema/v3.12.2.json +0 -0
  243. package/{lib → dist}/schemas/project-schema/v3.12.3.json +0 -0
  244. package/{lib → dist}/schemas/project-schema/v3.13.0.json +0 -0
  245. package/{lib → dist}/schemas/project-schema/v3.14.0.json +0 -0
  246. package/{lib → dist}/schemas/project-schema/v3.15.0.json +0 -0
  247. package/{lib → dist}/schemas/project-schema/v3.16.0.json +0 -0
  248. package/{lib → dist}/schemas/project-schema/v3.17.0.json +0 -0
  249. package/{lib → dist}/schemas/project-schema/v3.2.0.json +0 -0
  250. package/{lib → dist}/schemas/project-schema/v3.3.0.json +0 -0
  251. package/{lib → dist}/schemas/project-schema/v3.4.0.json +0 -0
  252. package/{lib → dist}/schemas/project-schema/v3.5.0.json +0 -0
  253. package/{lib → dist}/schemas/project-schema/v3.5.1.json +0 -0
  254. package/{lib → dist}/schemas/project-schema/v3.6.0.json +0 -0
  255. package/{lib → dist}/schemas/project-schema/v3.7.0.json +0 -0
  256. package/{lib → dist}/schemas/project-schema/v3.8.0.json +0 -0
  257. package/{lib → dist}/schemas/project-schema/v3.9.0.json +0 -0
  258. package/{lib → dist}/schemas/project-schema/v4.0.0.json +0 -0
  259. package/{lib → dist}/schemas/project-schema.json +0 -0
  260. package/{lib → dist}/schemas/user-schema.json +0 -0
  261. package/{lib → dist}/services.d.ts +0 -0
  262. package/{lib → dist}/services.d.ts.map +0 -0
  263. package/{lib → dist}/services.js +0 -0
  264. package/{lib → dist}/taxonomies.d.ts +0 -0
  265. package/{lib → dist}/taxonomies.d.ts.map +0 -0
  266. package/{lib → dist}/taxonomies.js +0 -0
  267. package/{lib → dist}/template-shapes/index.d.ts +0 -0
  268. package/{lib → dist}/template-shapes/index.d.ts.map +0 -0
  269. package/{lib → dist}/template-shapes/index.js +0 -0
  270. package/{lib → dist}/template-shapes/templates.d.ts +0 -0
  271. package/{lib → dist}/template-shapes/templates.d.ts.map +0 -0
  272. package/{lib → dist}/template-shapes/templates.js +0 -0
  273. package/{lib → dist}/template-shapes/types.d.ts +0 -0
  274. package/{lib → dist}/template-shapes/types.d.ts.map +0 -0
  275. package/{lib → dist}/template-shapes/types.js +0 -0
  276. package/{lib → dist}/template-shapes/where.d.ts +0 -1
  277. package/{lib → dist}/template-shapes/where.d.ts.map +1 -1
  278. package/{lib → dist}/template-shapes/where.js +3 -26
  279. package/{lib → dist}/types/index.d.ts +0 -0
  280. package/{lib → dist}/types/index.d.ts.map +0 -0
  281. package/{lib → dist}/types/index.js +0 -0
  282. package/{lib → dist}/types/types.d.ts +0 -0
  283. package/{lib → dist}/types/types.d.ts.map +0 -0
  284. package/{lib → dist}/types/types.js +0 -0
  285. package/{lib → dist}/types/utils.d.ts +0 -0
  286. package/{lib → dist}/types/utils.d.ts.map +0 -0
  287. package/{lib → dist}/types/utils.js +0 -0
  288. package/{lib → dist}/unions.d.ts +0 -0
  289. package/{lib → dist}/unions.d.ts.map +0 -0
  290. package/{lib → dist}/unions.js +0 -0
  291. package/{lib → dist}/user-schema.d.ts +0 -0
  292. package/{lib → dist}/user-schema.d.ts.map +0 -0
  293. package/{lib → dist}/user-schema.js +0 -0
  294. package/{lib → dist}/util/detect-cycles.d.ts +0 -0
  295. package/{lib → dist}/util/detect-cycles.d.ts.map +0 -0
  296. package/{lib → dist}/util/detect-cycles.js +0 -0
  297. package/{lib → dist}/util/index.d.ts +0 -0
  298. package/{lib → dist}/util/index.d.ts.map +0 -0
  299. package/{lib → dist}/util/index.js +0 -0
  300. package/{lib → dist}/util/merge.d.ts +0 -0
  301. package/{lib → dist}/util/merge.d.ts.map +0 -0
  302. package/{lib → dist}/util/merge.js +0 -0
  303. package/{lib → dist}/validate.d.ts +0 -0
  304. package/{lib → dist}/validate.d.ts.map +0 -0
  305. package/{lib → dist}/validate.js +0 -0
  306. package/{lib → dist}/versions.d.ts +0 -0
  307. package/{lib → dist}/versions.d.ts.map +0 -0
  308. package/{lib → dist}/versions.js +0 -0
  309. package/{lib → dist}/workflows.d.ts +0 -0
  310. package/{lib → dist}/workflows.d.ts.map +0 -0
  311. package/{lib → dist}/workflows.js +0 -0
  312. package/es/relationships.js +38 -0
  313. package/es/schema-util.js +10 -7
  314. package/es/template-shapes/where.js +1 -23
  315. package/package.json +11 -11
  316. package/lib/relationships.d.ts +0 -3
  317. package/lib/relationships.d.ts.map +0 -1
  318. package/lib/relationships.js +0 -24
  319. package/lib/schema-util.d.ts.map +0 -1
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getRelationshipSchema = getRelationshipSchema;
7
+ exports.hasUnequalRelationships = hasUnequalRelationships;
8
+ exports.isEqualRelationship = isEqualRelationship;
9
+
10
+ function getRelationshipSchema(relationship) {
11
+ const itemSchema = {
12
+ $ref: '#/shapes/TSRelationship/schema'
13
+ };
14
+
15
+ if (relationship.type === 'multiple') {
16
+ return {
17
+ type: 'array',
18
+ items: itemSchema,
19
+ '@relationship': relationship
20
+ };
21
+ }
22
+
23
+ return { ...itemSchema,
24
+ '@relationship': relationship
25
+ };
26
+ } // TODO: Code below will likely cause a conflict with @relationship PR...
27
+
28
+ /**
29
+ * Test whether two PropertySchemas have equal realtionships
30
+ */
31
+
32
+
33
+ function isEqualRelationship(a, b) {
34
+ var _a$Relationship, _b$Relationship;
35
+
36
+ // non-relationships are considered equal in that they are both equal that regard
37
+ if (!a['@relationship'] && !b['@relationship']) {
38
+ return true;
39
+ }
40
+
41
+ const idsA = (_a$Relationship = a['@relationship']) === null || _a$Relationship === void 0 ? void 0 : _a$Relationship.shapeIds;
42
+
43
+ if (!idsA) {
44
+ return false;
45
+ }
46
+
47
+ const idsB = (_b$Relationship = b['@relationship']) === null || _b$Relationship === void 0 ? void 0 : _b$Relationship.shapeIds;
48
+
49
+ if (!idsB || idsA.length !== idsB.length) {
50
+ return false;
51
+ }
52
+
53
+ const idSet = new Set(idsA);
54
+ return idsB.every(id => idSet.has(id));
55
+ }
56
+ /**
57
+ * Test whether an array of PropertySchemas have unequal relationships
58
+ */
59
+
60
+
61
+ function hasUnequalRelationships(relationships) {
62
+ return Boolean(relationships.find((propertySchema, index, allRelationships) => {
63
+ const nextPropertySchema = allRelationships[index + 1];
64
+ return nextPropertySchema ? !isEqualRelationship(propertySchema, nextPropertySchema) : false;
65
+ }));
66
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -47,6 +47,8 @@ export interface RelationshipEnv {
47
47
  path: string[];
48
48
  hasBackreference: boolean;
49
49
  relatedName?: string;
50
+ schema: PropertySchema;
51
+ shapeName: string;
50
52
  }
51
53
  export declare function stringifyQuerySource(providerId: string, serviceId: string): string;
52
54
  export declare function parseQuerySource(source: string): {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-util.d.ts","sourceRoot":"","sources":["../../src/schema-util.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,UAAU,EAEV,KAAK,EACL,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EAGX,WAAW,EAEZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,+BAA+B,EAC/B,UAAU,EACV,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAElB,gBAAgB,EAChB,UAAU,EACV,aAAa,EACd,MAAM,eAAe,CAAC;AAWvB,OAAO,EAAC,KAAK,EAAuB,MAAM,iBAAiB,CAAC;AAe5D,OAAO,EAUL,OAAO,EAIP,eAAe,EACf,eAAe,EACf,qBAAqB,EACtB,MAAM,QAAQ,CAAC;AAKhB,eAAO,MAAM,2BAA2B,2BAA2B,CAAC;AAEpE,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEzD;AAID,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED,wBAAgB,aAAa,CAAC,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,GAAG,OAAO,CAG7F;AAED,eAAO,MAAM,kBAAkB,UAU9B,CAAC;AACF,eAAO,MAAM,gBAAgB,UAAyD,CAAC;AAEvF,eAAO,MAAM,gBAAgB,UAY5B,CAAC;AAEF,eAAO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C,CAAC;AAgC9E;;GAEG;AACH,eAAO,MAAM,SAAS,kBAAmB,kBAAkB,aAAa,MAAM,YAAY,MAAM,KAAG,MAAM,GAAG,SAC9C,CAAC;AAC/D;;GAEG;AACH,eAAO,MAAM,YAAY,kBACR,kBAAkB,aACtB,MAAM,YACP,MAAM,KACf,MAAM,GAAG,SAA4E,CAAC;AAEzF;;;GAGG;AACH,eAAO,MAAM,WAAW,kBAAmB,kBAAkB,aAAa,MAAM,YAAY,MAAM,KAAG,MACrC,CAAC;AACjE;;;GAGG;AACH,eAAO,MAAM,cAAc,kBAAmB,kBAAkB,aAAa,MAAM,YAAY,MAAM,KAAG,MACrC,CAAC;AAEpE;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,KAAK,CAAC,UAAU,CAAC,CAEnB;AAED,oBAAY,2BAA2B,GACnC,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,qBAAqB,CAAC;AAE1B;;GAEG;AACH,eAAO,MAAM,sBAAsB,cAAe,MAAM,YAAY,2BAA2B,KAAG,MAGjG,CAAC;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAQ3F"}
@@ -549,7 +549,7 @@ function findExistingRelationships(projectSchema, shapes) {
549
549
  const shapesSeen = new Set();
550
550
  const shapeIds = new Set(shapeArray.map(shape => shape.id));
551
551
 
552
- const findRelationships = (schema, path) => {
552
+ const findRelationships = (schema, path, parentShapeName) => {
553
553
  if (schema['@relationship']) {
554
554
  var _schema$Backreferenc;
555
555
 
@@ -566,7 +566,9 @@ function findExistingRelationships(projectSchema, shapes) {
566
566
  relatedName,
567
567
  path: path.slice(1),
568
568
  shapeId: path[0],
569
- hasBackreference: Boolean((_schema$Backreferenc2 = schema['@backreference']) === null || _schema$Backreferenc2 === void 0 ? void 0 : _schema$Backreferenc2.enabled)
569
+ hasBackreference: Boolean((_schema$Backreferenc2 = schema['@backreference']) === null || _schema$Backreferenc2 === void 0 ? void 0 : _schema$Backreferenc2.enabled),
570
+ schema,
571
+ shapeName: parentShapeName
570
572
  });
571
573
  }
572
574
  }
@@ -591,13 +593,13 @@ function findExistingRelationships(projectSchema, shapes) {
591
593
 
592
594
  if (prop.properties) {
593
595
  for (const name of Object.keys(prop.properties)) {
594
- findRelationships(prop.properties[name], path.concat(name));
596
+ findRelationships(prop.properties[name], path.concat(name), shapeName ?? parentShapeName);
595
597
  }
596
598
  } else if (prop.items) {
597
- findRelationships(prop.items, path);
599
+ findRelationships(prop.items, path, shapeName ?? parentShapeName);
598
600
  } else if ((0, _unions.isUnionSchema)(prop)) {
599
601
  for (const child of prop.oneOf) {
600
- findRelationships(child, path);
602
+ findRelationships(child, path, shapeName ?? parentShapeName);
601
603
  }
602
604
  }
603
605
  };
@@ -606,9 +608,10 @@ function findExistingRelationships(projectSchema, shapes) {
606
608
  if (isModelShape(shape)) {
607
609
  const {
608
610
  schema,
609
- id
611
+ id,
612
+ name
610
613
  } = shape;
611
- findRelationships(schema, [id]);
614
+ findRelationships(schema, [id], name);
612
615
  }
613
616
  }
614
617
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -20,7 +20,6 @@ export declare const fieldTypeComparison: Record<string, {
20
20
  export declare const comparatorDescriptions: Record<string, string>;
21
21
  export declare const booleanOperators: string[];
22
22
  export declare const boolOpDescriptionMap: Record<string, string>;
23
- export declare function isEqualRelationship(a: PropertySchema, b: PropertySchema): boolean;
24
23
  export declare function getFieldTypeComparison(fieldType: string): Maybe<Record<string, PropertySchema>>;
25
24
  export interface PropertyContext {
26
25
  shapeCache: ShapeCache;
@@ -1 +1 @@
1
- {"version":3,"file":"where.d.ts","sourceRoot":"","sources":["../../../src/template-shapes/where.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,EAAY,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAC,cAAc,EAAE,aAAa,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAI5E,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAczD,OAAO,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAIzC,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,eAAO,MAAM,yBAAyB,sBAAgB,OAA0C,CAAC;AAEjG,aAAK,qBAAqB,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE5F,aAAK,UAAU,GAAG,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC;AAExC,cAAM,UAAU;IACd,MAAM,0BAAiC;IACvC,UAAU,cAAqB;IAE/B,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAI/B,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI;IAO/C,UAAU,IAAI,QAAQ;CAiBvB;AAED,eAAO,MAAM,mBAAmB,EAAE,MAAM,CACtC,MAAM,EACN;IAAC,WAAW,EAAE,qBAAqB,EAAE,CAAC;IAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAA;CAAC,CAW1F,CAAC;AACF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CASzD,CAAC;AAEF,eAAO,MAAM,gBAAgB,UAAuB,CAAC;AACrD,eAAO,MAAM,oBAAoB,EAAE,MAAM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AAM,CAAC,CAAC;IACpC,aAAa,EAAE,aAAa,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAgBD,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAkBrH;AAYD,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,cAAc,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,eAAe,GACvB,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAkFvC;AAkED,wBAAgB,aAAa,CAAC,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,KAAK,EAAE,GAAG,gBAAgB,CA4BrG;AAED,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,KAAK,EAAE,GACtB;IAAC,MAAM,EAAE,YAAY,CAAC;IAAC,YAAY,EAAE,QAAQ,CAAA;CAAC,CAchD"}
@@ -9,7 +9,6 @@ exports.getFields = getFields;
9
9
  exports.getPropertyComparisonType = getPropertyComparisonType;
10
10
  exports.getWhereSearchArg = getWhereSearchArg;
11
11
  exports.getWhereShape = getWhereShape;
12
- exports.isEqualRelationship = isEqualRelationship;
13
12
 
14
13
  var _util = require("@takeshape/util");
15
14
 
@@ -31,6 +30,8 @@ var _uniqBy = _interopRequireDefault(require("lodash/uniqBy"));
31
30
 
32
31
  var _blueimpMd = _interopRequireDefault(require("blueimp-md5"));
33
32
 
33
+ var _relationships = require("../relationships");
34
+
34
35
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
35
36
 
36
37
  const MAX_RELATIONSHIP_DEPTH = 1;
@@ -137,37 +138,13 @@ const boolOpDescriptionMap = {
137
138
  };
138
139
  exports.boolOpDescriptionMap = boolOpDescriptionMap;
139
140
 
140
- function isEqualRelationship(a, b) {
141
- var _a$Relationship, _b$Relationship;
142
-
143
- // non-relationships are considered equal in that they are both equal that regard
144
- if (!a['@relationship'] && !b['@relationship']) {
145
- return true;
146
- }
147
-
148
- const idsA = (_a$Relationship = a['@relationship']) === null || _a$Relationship === void 0 ? void 0 : _a$Relationship.shapeIds;
149
-
150
- if (!idsA) {
151
- return false;
152
- }
153
-
154
- const idsB = (_b$Relationship = b['@relationship']) === null || _b$Relationship === void 0 ? void 0 : _b$Relationship.shapeIds;
155
-
156
- if (!idsB || idsA.length !== idsB.length) {
157
- return false;
158
- }
159
-
160
- const idSet = new Set(idsA);
161
- return idsB.every(id => idSet.has(id));
162
- }
163
-
164
141
  function getConflictingProperties(projectSchema, shapes) {
165
142
  const conflicts = new Set();
166
143
  const allProps = {};
167
144
 
168
145
  for (const shape of Object.values(shapes)) {
169
146
  for (const [name, prop] of (0, _schemaUtil.createSchemaPropertyList)(projectSchema, shape).getNodes()) {
170
- if (name in allProps && (allProps[name].type !== prop.type || !isEqualRelationship(allProps[name], prop))) {
147
+ if (name in allProps && (allProps[name].type !== prop.type || !(0, _relationships.isEqualRelationship)(allProps[name], prop))) {
171
148
  conflicts.add(name);
172
149
  }
173
150
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -14,4 +14,42 @@ export function getRelationshipSchema(relationship) {
14
14
  return { ...itemSchema,
15
15
  '@relationship': relationship
16
16
  };
17
+ } // TODO: Code below will likely cause a conflict with @relationship PR...
18
+
19
+ /**
20
+ * Test whether two PropertySchemas have equal realtionships
21
+ */
22
+
23
+ export function isEqualRelationship(a, b) {
24
+ var _a$Relationship, _b$Relationship;
25
+
26
+ // non-relationships are considered equal in that they are both equal that regard
27
+ if (!a['@relationship'] && !b['@relationship']) {
28
+ return true;
29
+ }
30
+
31
+ const idsA = (_a$Relationship = a['@relationship']) === null || _a$Relationship === void 0 ? void 0 : _a$Relationship.shapeIds;
32
+
33
+ if (!idsA) {
34
+ return false;
35
+ }
36
+
37
+ const idsB = (_b$Relationship = b['@relationship']) === null || _b$Relationship === void 0 ? void 0 : _b$Relationship.shapeIds;
38
+
39
+ if (!idsB || idsA.length !== idsB.length) {
40
+ return false;
41
+ }
42
+
43
+ const idSet = new Set(idsA);
44
+ return idsB.every(id => idSet.has(id));
45
+ }
46
+ /**
47
+ * Test whether an array of PropertySchemas have unequal relationships
48
+ */
49
+
50
+ export function hasUnequalRelationships(relationships) {
51
+ return Boolean(relationships.find((propertySchema, index, allRelationships) => {
52
+ const nextPropertySchema = allRelationships[index + 1];
53
+ return nextPropertySchema ? !isEqualRelationship(propertySchema, nextPropertySchema) : false;
54
+ }));
17
55
  }
package/es/schema-util.js CHANGED
@@ -433,7 +433,7 @@ export function findExistingRelationships(projectSchema, shapes) {
433
433
  const shapesSeen = new Set();
434
434
  const shapeIds = new Set(shapeArray.map(shape => shape.id));
435
435
 
436
- const findRelationships = (schema, path) => {
436
+ const findRelationships = (schema, path, parentShapeName) => {
437
437
  if (schema['@relationship']) {
438
438
  var _schema$Backreferenc;
439
439
 
@@ -450,7 +450,9 @@ export function findExistingRelationships(projectSchema, shapes) {
450
450
  relatedName,
451
451
  path: path.slice(1),
452
452
  shapeId: path[0],
453
- hasBackreference: Boolean((_schema$Backreferenc2 = schema['@backreference']) === null || _schema$Backreferenc2 === void 0 ? void 0 : _schema$Backreferenc2.enabled)
453
+ hasBackreference: Boolean((_schema$Backreferenc2 = schema['@backreference']) === null || _schema$Backreferenc2 === void 0 ? void 0 : _schema$Backreferenc2.enabled),
454
+ schema,
455
+ shapeName: parentShapeName
454
456
  });
455
457
  }
456
458
  }
@@ -475,13 +477,13 @@ export function findExistingRelationships(projectSchema, shapes) {
475
477
 
476
478
  if (prop.properties) {
477
479
  for (const name of Object.keys(prop.properties)) {
478
- findRelationships(prop.properties[name], path.concat(name));
480
+ findRelationships(prop.properties[name], path.concat(name), shapeName ?? parentShapeName);
479
481
  }
480
482
  } else if (prop.items) {
481
- findRelationships(prop.items, path);
483
+ findRelationships(prop.items, path, shapeName ?? parentShapeName);
482
484
  } else if (isUnionSchema(prop)) {
483
485
  for (const child of prop.oneOf) {
484
- findRelationships(child, path);
486
+ findRelationships(child, path, shapeName ?? parentShapeName);
485
487
  }
486
488
  }
487
489
  };
@@ -490,9 +492,10 @@ export function findExistingRelationships(projectSchema, shapes) {
490
492
  if (isModelShape(shape)) {
491
493
  const {
492
494
  schema,
493
- id
495
+ id,
496
+ name
494
497
  } = shape;
495
- findRelationships(schema, [id]);
498
+ findRelationships(schema, [id], name);
496
499
  }
497
500
  }
498
501
 
@@ -8,6 +8,7 @@ import { enumerateOneOfKeys, isUnionSchema } from '../unions';
8
8
  import { isObjectSchema } from '../types';
9
9
  import uniqBy from 'lodash/uniqBy';
10
10
  import md5 from 'blueimp-md5';
11
+ import { isEqualRelationship } from '../relationships';
11
12
  export const MAX_RELATIONSHIP_DEPTH = 1;
12
13
  export const exceededRelationshipDepth = (depth = 0) => depth >= MAX_RELATIONSHIP_DEPTH;
13
14
 
@@ -103,29 +104,6 @@ export const boolOpDescriptionMap = {
103
104
  OR: 'OR takes an array of conditions that should appear in the matching results. Nested boolean operators can be used to create complex filters.',
104
105
  NOT: 'NOT takes a single condition that must not appear in the matching results.'
105
106
  };
106
- export function isEqualRelationship(a, b) {
107
- var _a$Relationship, _b$Relationship;
108
-
109
- // non-relationships are considered equal in that they are both equal that regard
110
- if (!a['@relationship'] && !b['@relationship']) {
111
- return true;
112
- }
113
-
114
- const idsA = (_a$Relationship = a['@relationship']) === null || _a$Relationship === void 0 ? void 0 : _a$Relationship.shapeIds;
115
-
116
- if (!idsA) {
117
- return false;
118
- }
119
-
120
- const idsB = (_b$Relationship = b['@relationship']) === null || _b$Relationship === void 0 ? void 0 : _b$Relationship.shapeIds;
121
-
122
- if (!idsB || idsA.length !== idsB.length) {
123
- return false;
124
- }
125
-
126
- const idSet = new Set(idsA);
127
- return idsB.every(id => idSet.has(id));
128
- }
129
107
 
130
108
  function getConflictingProperties(projectSchema, shapes) {
131
109
  const conflicts = new Set();