@takeshape/schema 7.194.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 (312) hide show
  1. package/README.md +5 -0
  2. package/es/api-version.js +21 -0
  3. package/es/auth-schemas.js +0 -0
  4. package/es/builtin-schema.js +590 -0
  5. package/es/content-schema-transform.js +192 -0
  6. package/es/entitlements.js +0 -0
  7. package/es/enum.js +11 -0
  8. package/es/get-is-leaf.js +58 -0
  9. package/es/index.js +25 -0
  10. package/es/migration.js +413 -0
  11. package/es/mocks.js +47 -0
  12. package/es/patterns.js +0 -0
  13. package/es/project-schema/index.js +10 -0
  14. package/es/project-schema/v1.0.0.js +0 -0
  15. package/es/project-schema/v3.0.0.js +0 -0
  16. package/es/project-schema/v3.1.0.js +0 -0
  17. package/es/project-schema/v3.2.0.js +0 -0
  18. package/es/project-schema/v3.3.0.js +0 -0
  19. package/es/project-schema/v3.4.0.js +0 -0
  20. package/es/project-schema/v3.5.0.js +0 -0
  21. package/es/project-schema/v3.5.1.js +0 -0
  22. package/es/project-schema/v3.6.0.js +0 -0
  23. package/es/refs.js +301 -0
  24. package/es/resolvers.js +2 -0
  25. package/es/scalars.js +4 -0
  26. package/es/schema-util.js +1197 -0
  27. package/es/schemas/auth-schemas.json +313 -0
  28. package/es/schemas/project-schema/meta-schema-v1.0.0.json +209 -0
  29. package/es/schemas/project-schema/meta-schema-v3.0.0.json +609 -0
  30. package/es/schemas/project-schema/meta-schema-v3.1.0.json +609 -0
  31. package/es/schemas/project-schema/meta-schema-v3.2.0.json +613 -0
  32. package/es/schemas/project-schema/meta-schema-v3.3.0.json +613 -0
  33. package/es/schemas/project-schema/meta-schema-v3.4.0.json +613 -0
  34. package/es/schemas/project-schema/meta-schema-v3.5.0.json +627 -0
  35. package/es/schemas/project-schema/meta-schema-v3.5.1.json +630 -0
  36. package/es/schemas/project-schema/meta-schema-v3.6.0.json +633 -0
  37. package/es/schemas/project-schema/v1.0.0.json +321 -0
  38. package/es/schemas/project-schema/v3.0.0.json +411 -0
  39. package/es/schemas/project-schema/v3.1.0.json +569 -0
  40. package/es/schemas/project-schema/v3.2.0.json +577 -0
  41. package/es/schemas/project-schema/v3.3.0.json +578 -0
  42. package/es/schemas/project-schema/v3.4.0.json +568 -0
  43. package/es/schemas/project-schema/v3.5.0.json +568 -0
  44. package/es/schemas/project-schema/v3.5.1.json +568 -0
  45. package/es/schemas/project-schema/v3.6.0.json +584 -0
  46. package/es/schemas/project-schema.json +16 -0
  47. package/es/schemas/user-schema.json +58 -0
  48. package/es/services.js +379 -0
  49. package/es/taxonomies.js +55 -0
  50. package/es/template-shapes.js +79 -0
  51. package/es/types.js +202 -0
  52. package/es/unions.js +137 -0
  53. package/es/user-schema.js +0 -0
  54. package/es/util/detect-cycles.js +54 -0
  55. package/es/util/index.js +1 -0
  56. package/es/validate.js +764 -0
  57. package/es/versions.js +4 -0
  58. package/es/workflows.js +69 -0
  59. package/examples/.pnpm-debug.log +20 -0
  60. package/examples/v1_0_0/beer-schema.json +125 -0
  61. package/examples/v1_0_0/blog-schema.json +192 -0
  62. package/examples/v1_0_0/brewery-schema.json +232 -0
  63. package/examples/v1_0_0/complex-project-schema.json +3197 -0
  64. package/examples/v1_0_0/error-schema.json +275 -0
  65. package/examples/v1_0_0/frank-and-fred-schema.json +21387 -0
  66. package/examples/v1_0_0/massive-schema.json +6930 -0
  67. package/examples/v1_0_0/post-schema.json +83 -0
  68. package/examples/v1_0_0/real-world-schema.json +797 -0
  69. package/examples/v1_0_0/recursive-repeater-schema.json +69 -0
  70. package/examples/v1_0_0/recursive-schema.json +79 -0
  71. package/examples/v1_0_0/schema-with-repeater-draftjs.json +292 -0
  72. package/examples/v1_0_0/shape-books.json +797 -0
  73. package/examples/v1_0_0/user-schema-no-required.json +84 -0
  74. package/examples/v1_0_0/user-schema-with-defaults.json +105 -0
  75. package/examples/v1_0_0/user-schema-with-obj-prop.json +92 -0
  76. package/examples/v1_0_0/user-schema.json +87 -0
  77. package/examples/v3_0_0/rick-and-morty-rest.json +62 -0
  78. package/examples/v3_0_0/shopify-lookbook.json +1172 -0
  79. package/examples/v3_0_0/shopify-store-with-widget.json +11323 -0
  80. package/examples/v3_2_0/blog-schema.json +378 -0
  81. package/examples/v3_2_0/brewery-schema.json +385 -0
  82. package/examples/v3_2_0/complex-project-schema.json +3748 -0
  83. package/examples/v3_2_0/frank-and-fred-schema.json +19217 -0
  84. package/examples/v3_2_0/massive-schema.json +6676 -0
  85. package/examples/v3_2_0/pet-oneof-array.json +323 -0
  86. package/examples/v3_2_0/post-schema.json +265 -0
  87. package/examples/v3_2_0/real-world-schema.json +970 -0
  88. package/examples/v3_2_0/recursive-repeater-schema.json +144 -0
  89. package/examples/v3_2_0/recursive-schema.json +151 -0
  90. package/examples/v3_2_0/rick-and-morty-rest.json +65 -0
  91. package/examples/v3_2_0/schema-with-repeater-draftjs.json +381 -0
  92. package/examples/v3_2_0/shape-books.json +1044 -0
  93. package/examples/v3_2_0/shopify-store-with-widget.json +11016 -0
  94. package/examples/v3_2_0/user-schema-no-required.json +174 -0
  95. package/examples/v3_2_0/user-schema-with-defaults.json +187 -0
  96. package/examples/v3_3_0/blog-schema.json +405 -0
  97. package/examples/v3_3_0/brewery-schema.json +406 -0
  98. package/examples/v3_3_0/complex-project-schema.json +4076 -0
  99. package/examples/v3_3_0/frank-and-fred-schema.json +20913 -0
  100. package/examples/v3_3_0/massive-schema.json +7309 -0
  101. package/examples/v3_3_0/pet-oneof-array.json +380 -0
  102. package/examples/v3_3_0/post-schema.json +248 -0
  103. package/examples/v3_3_0/real-world-schema.json +1046 -0
  104. package/examples/v3_3_0/recursive-repeater-schema.json +154 -0
  105. package/examples/v3_3_0/recursive-schema.json +161 -0
  106. package/examples/v3_3_0/rick-and-morty-rest.json +101 -0
  107. package/examples/v3_3_0/schema-with-repeater-draftjs.json +393 -0
  108. package/examples/v3_3_0/shape-books.json +1121 -0
  109. package/examples/v3_3_0/shopify-lookbook.json +1196 -0
  110. package/examples/v3_3_0/shopify-store-with-widget.json +11320 -0
  111. package/examples/v3_3_0/user-schema-no-required.json +185 -0
  112. package/examples/v3_3_0/user-schema-with-defaults.json +210 -0
  113. package/examples/v3_4_0/blog-schema.json +405 -0
  114. package/examples/v3_4_0/brewery-schema.json +406 -0
  115. package/examples/v3_4_0/complex-project-schema.json +4076 -0
  116. package/examples/v3_4_0/frank-and-fred-schema.json +20913 -0
  117. package/examples/v3_4_0/massive-schema.json +7309 -0
  118. package/examples/v3_4_0/pet-oneof-array.json +420 -0
  119. package/examples/v3_4_0/post-schema.json +248 -0
  120. package/examples/v3_4_0/real-world-schema.json +1046 -0
  121. package/examples/v3_4_0/recursive-repeater-schema.json +154 -0
  122. package/examples/v3_4_0/recursive-schema.json +161 -0
  123. package/examples/v3_4_0/rick-and-morty-rest.json +101 -0
  124. package/examples/v3_4_0/schema-with-repeater-draftjs.json +393 -0
  125. package/examples/v3_4_0/shape-books.json +1121 -0
  126. package/examples/v3_4_0/shopify-lookbook.json +1196 -0
  127. package/examples/v3_4_0/shopify-store-with-widget.json +11323 -0
  128. package/examples/v3_4_0/user-schema-no-required.json +185 -0
  129. package/examples/v3_4_0/user-schema-with-defaults.json +210 -0
  130. package/examples/v3_5_0/blog-schema.json +405 -0
  131. package/examples/v3_5_0/brewery-schema.json +406 -0
  132. package/examples/v3_5_0/complex-project-schema.json +4076 -0
  133. package/examples/v3_5_0/frank-and-fred-schema.json +20913 -0
  134. package/examples/v3_5_0/massive-schema.json +7309 -0
  135. package/examples/v3_5_0/pet-oneof-array.json +420 -0
  136. package/examples/v3_5_0/post-schema.json +248 -0
  137. package/examples/v3_5_0/real-world-schema.json +1046 -0
  138. package/examples/v3_5_0/recursive-repeater-schema.json +154 -0
  139. package/examples/v3_5_0/recursive-schema.json +161 -0
  140. package/examples/v3_5_0/rick-and-morty-rest.json +101 -0
  141. package/examples/v3_5_0/schema-with-repeater-draftjs.json +393 -0
  142. package/examples/v3_5_0/shape-books.json +1121 -0
  143. package/examples/v3_5_0/shopify-lookbook.json +1196 -0
  144. package/examples/v3_5_0/shopify-store-with-widget.json +12271 -0
  145. package/examples/v3_5_0/user-schema-no-required.json +185 -0
  146. package/examples/v3_5_0/user-schema-with-defaults.json +210 -0
  147. package/examples/v3_5_1/blog-schema.json +405 -0
  148. package/examples/v3_5_1/brewery-schema.json +406 -0
  149. package/examples/v3_5_1/complex-project-schema.json +4076 -0
  150. package/examples/v3_5_1/frank-and-fred-schema.json +20913 -0
  151. package/examples/v3_5_1/massive-schema.json +7309 -0
  152. package/examples/v3_5_1/pet-oneof-array.json +420 -0
  153. package/examples/v3_5_1/post-schema.json +248 -0
  154. package/examples/v3_5_1/real-world-schema.json +1046 -0
  155. package/examples/v3_5_1/recursive-repeater-schema.json +154 -0
  156. package/examples/v3_5_1/recursive-schema.json +161 -0
  157. package/examples/v3_5_1/rick-and-morty-rest.json +101 -0
  158. package/examples/v3_5_1/schema-with-repeater-draftjs.json +393 -0
  159. package/examples/v3_5_1/shape-books.json +1121 -0
  160. package/examples/v3_5_1/shopify-lookbook.json +1196 -0
  161. package/examples/v3_5_1/shopify-store-with-widget.json +12271 -0
  162. package/examples/v3_5_1/stripe-starter-resolved.json +21419 -0
  163. package/examples/v3_5_1/user-schema-no-required.json +185 -0
  164. package/examples/v3_5_1/user-schema-with-defaults.json +210 -0
  165. package/examples/v3_6_0/blog-schema.json +405 -0
  166. package/examples/v3_6_0/brewery-schema.json +406 -0
  167. package/examples/v3_6_0/complex-project-schema.json +4076 -0
  168. package/examples/v3_6_0/frank-and-fred-schema.json +20913 -0
  169. package/examples/v3_6_0/massive-schema.json +7309 -0
  170. package/examples/v3_6_0/pet-oneof-array.json +420 -0
  171. package/examples/v3_6_0/post-schema.json +248 -0
  172. package/examples/v3_6_0/real-world-schema.json +1046 -0
  173. package/examples/v3_6_0/recursive-repeater-schema.json +154 -0
  174. package/examples/v3_6_0/recursive-schema.json +161 -0
  175. package/examples/v3_6_0/rick-and-morty-rest.json +101 -0
  176. package/examples/v3_6_0/schema-with-repeater-draftjs.json +393 -0
  177. package/examples/v3_6_0/shape-books.json +1121 -0
  178. package/examples/v3_6_0/shopify-lookbook.json +1196 -0
  179. package/examples/v3_6_0/shopify-store-with-widget.json +12271 -0
  180. package/examples/v3_6_0/stripe-starter-resolved.json +21419 -0
  181. package/examples/v3_6_0/user-schema-no-required.json +185 -0
  182. package/examples/v3_6_0/user-schema-with-defaults.json +210 -0
  183. package/lib/api-version.d.ts +6 -0
  184. package/lib/api-version.d.ts.map +1 -0
  185. package/lib/api-version.js +36 -0
  186. package/lib/auth-schemas.d.ts +105 -0
  187. package/lib/auth-schemas.d.ts.map +1 -0
  188. package/lib/auth-schemas.js +1 -0
  189. package/lib/builtin-schema.d.ts +8 -0
  190. package/lib/builtin-schema.d.ts.map +1 -0
  191. package/lib/builtin-schema.js +606 -0
  192. package/lib/content-schema-transform.d.ts +41 -0
  193. package/lib/content-schema-transform.d.ts.map +1 -0
  194. package/lib/content-schema-transform.js +217 -0
  195. package/lib/entitlements.d.ts +1 -0
  196. package/lib/entitlements.d.ts.map +1 -0
  197. package/lib/entitlements.js +1 -0
  198. package/lib/enum.d.ts +3 -0
  199. package/lib/enum.d.ts.map +1 -0
  200. package/lib/enum.js +18 -0
  201. package/lib/get-is-leaf.d.ts +4 -0
  202. package/lib/get-is-leaf.d.ts.map +1 -0
  203. package/lib/get-is-leaf.js +68 -0
  204. package/lib/index.d.ts +27 -0
  205. package/lib/index.d.ts.map +1 -0
  206. package/lib/index.js +359 -0
  207. package/lib/migration.d.ts +55 -0
  208. package/lib/migration.d.ts.map +1 -0
  209. package/lib/migration.js +463 -0
  210. package/lib/mocks.d.ts +13 -0
  211. package/lib/mocks.d.ts.map +1 -0
  212. package/lib/mocks.js +61 -0
  213. package/lib/patterns.d.ts +13 -0
  214. package/lib/patterns.d.ts.map +1 -0
  215. package/lib/patterns.js +1 -0
  216. package/lib/project-schema/index.d.ts +21 -0
  217. package/lib/project-schema/index.d.ts.map +1 -0
  218. package/lib/project-schema/index.js +122 -0
  219. package/lib/project-schema/v1.0.0.d.ts +293 -0
  220. package/lib/project-schema/v1.0.0.d.ts.map +1 -0
  221. package/lib/project-schema/v1.0.0.js +1 -0
  222. package/lib/project-schema/v3.0.0.d.ts +480 -0
  223. package/lib/project-schema/v3.0.0.d.ts.map +1 -0
  224. package/lib/project-schema/v3.0.0.js +1 -0
  225. package/lib/project-schema/v3.1.0.d.ts +623 -0
  226. package/lib/project-schema/v3.1.0.d.ts.map +1 -0
  227. package/lib/project-schema/v3.1.0.js +1 -0
  228. package/lib/project-schema/v3.2.0.d.ts +634 -0
  229. package/lib/project-schema/v3.2.0.d.ts.map +1 -0
  230. package/lib/project-schema/v3.2.0.js +1 -0
  231. package/lib/project-schema/v3.3.0.d.ts +634 -0
  232. package/lib/project-schema/v3.3.0.d.ts.map +1 -0
  233. package/lib/project-schema/v3.3.0.js +1 -0
  234. package/lib/project-schema/v3.4.0.d.ts +626 -0
  235. package/lib/project-schema/v3.4.0.d.ts.map +1 -0
  236. package/lib/project-schema/v3.4.0.js +1 -0
  237. package/lib/project-schema/v3.5.0.d.ts +651 -0
  238. package/lib/project-schema/v3.5.0.d.ts.map +1 -0
  239. package/lib/project-schema/v3.5.0.js +1 -0
  240. package/lib/project-schema/v3.5.1.d.ts +651 -0
  241. package/lib/project-schema/v3.5.1.d.ts.map +1 -0
  242. package/lib/project-schema/v3.5.1.js +1 -0
  243. package/lib/project-schema/v3.6.0.d.ts +660 -0
  244. package/lib/project-schema/v3.6.0.d.ts.map +1 -0
  245. package/lib/project-schema/v3.6.0.js +1 -0
  246. package/lib/refs.d.ts +122 -0
  247. package/lib/refs.d.ts.map +1 -0
  248. package/lib/refs.js +359 -0
  249. package/lib/resolvers.d.ts +4 -0
  250. package/lib/resolvers.d.ts.map +1 -0
  251. package/lib/resolvers.js +10 -0
  252. package/lib/scalars.d.ts +3 -0
  253. package/lib/scalars.d.ts.map +1 -0
  254. package/lib/scalars.js +13 -0
  255. package/lib/schema-util.d.ts +201 -0
  256. package/lib/schema-util.d.ts.map +1 -0
  257. package/lib/schema-util.js +1353 -0
  258. package/lib/schemas/auth-schemas.json +313 -0
  259. package/lib/schemas/project-schema/meta-schema-v1.0.0.json +209 -0
  260. package/lib/schemas/project-schema/meta-schema-v3.0.0.json +609 -0
  261. package/lib/schemas/project-schema/meta-schema-v3.1.0.json +609 -0
  262. package/lib/schemas/project-schema/meta-schema-v3.2.0.json +613 -0
  263. package/lib/schemas/project-schema/meta-schema-v3.3.0.json +613 -0
  264. package/lib/schemas/project-schema/meta-schema-v3.4.0.json +613 -0
  265. package/lib/schemas/project-schema/meta-schema-v3.5.0.json +627 -0
  266. package/lib/schemas/project-schema/meta-schema-v3.5.1.json +630 -0
  267. package/lib/schemas/project-schema/meta-schema-v3.6.0.json +633 -0
  268. package/lib/schemas/project-schema/v1.0.0.json +321 -0
  269. package/lib/schemas/project-schema/v3.0.0.json +411 -0
  270. package/lib/schemas/project-schema/v3.1.0.json +569 -0
  271. package/lib/schemas/project-schema/v3.2.0.json +577 -0
  272. package/lib/schemas/project-schema/v3.3.0.json +578 -0
  273. package/lib/schemas/project-schema/v3.4.0.json +568 -0
  274. package/lib/schemas/project-schema/v3.5.0.json +568 -0
  275. package/lib/schemas/project-schema/v3.5.1.json +568 -0
  276. package/lib/schemas/project-schema/v3.6.0.json +584 -0
  277. package/lib/schemas/project-schema.json +16 -0
  278. package/lib/schemas/user-schema.json +58 -0
  279. package/lib/services.d.ts +71 -0
  280. package/lib/services.d.ts.map +1 -0
  281. package/lib/services.js +413 -0
  282. package/lib/taxonomies.d.ts +16 -0
  283. package/lib/taxonomies.d.ts.map +1 -0
  284. package/lib/taxonomies.js +69 -0
  285. package/lib/template-shapes.d.ts +32 -0
  286. package/lib/template-shapes.d.ts.map +1 -0
  287. package/lib/template-shapes.js +100 -0
  288. package/lib/types.d.ts +187 -0
  289. package/lib/types.d.ts.map +1 -0
  290. package/lib/types.js +289 -0
  291. package/lib/unions.d.ts +29 -0
  292. package/lib/unions.d.ts.map +1 -0
  293. package/lib/unions.js +167 -0
  294. package/lib/user-schema.d.ts +39 -0
  295. package/lib/user-schema.d.ts.map +1 -0
  296. package/lib/user-schema.js +1 -0
  297. package/lib/util/detect-cycles.d.ts +6 -0
  298. package/lib/util/detect-cycles.d.ts.map +1 -0
  299. package/lib/util/detect-cycles.js +61 -0
  300. package/lib/util/index.d.ts +2 -0
  301. package/lib/util/index.d.ts.map +1 -0
  302. package/lib/util/index.js +18 -0
  303. package/lib/validate.d.ts +49 -0
  304. package/lib/validate.d.ts.map +1 -0
  305. package/lib/validate.js +823 -0
  306. package/lib/versions.d.ts +5 -0
  307. package/lib/versions.d.ts.map +1 -0
  308. package/lib/versions.js +14 -0
  309. package/lib/workflows.d.ts +15 -0
  310. package/lib/workflows.d.ts.map +1 -0
  311. package/lib/workflows.js +92 -0
  312. package/package.json +65 -0
package/lib/index.js ADDED
@@ -0,0 +1,359 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ builtInShapes: true,
8
+ listTypePrefix: true,
9
+ ensureLatest: true,
10
+ normalizeSchemaVersion: true,
11
+ getRelationshipSchema: true,
12
+ migrateToLatestProjectSchema: true
13
+ };
14
+ Object.defineProperty(exports, "builtInShapes", {
15
+ enumerable: true,
16
+ get: function () {
17
+ return _builtinSchema.builtInShapes;
18
+ }
19
+ });
20
+ Object.defineProperty(exports, "listTypePrefix", {
21
+ enumerable: true,
22
+ get: function () {
23
+ return _migration.listTypePrefix;
24
+ }
25
+ });
26
+ Object.defineProperty(exports, "ensureLatest", {
27
+ enumerable: true,
28
+ get: function () {
29
+ return _migration.ensureLatest;
30
+ }
31
+ });
32
+ Object.defineProperty(exports, "normalizeSchemaVersion", {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _migration.normalizeSchemaVersion;
36
+ }
37
+ });
38
+ Object.defineProperty(exports, "getRelationshipSchema", {
39
+ enumerable: true,
40
+ get: function () {
41
+ return _migration.getRelationshipSchema;
42
+ }
43
+ });
44
+ Object.defineProperty(exports, "migrateToLatestProjectSchema", {
45
+ enumerable: true,
46
+ get: function () {
47
+ return _migration.migrateToLatestProjectSchema;
48
+ }
49
+ });
50
+
51
+ var _contentSchemaTransform = require("./content-schema-transform");
52
+
53
+ Object.keys(_contentSchemaTransform).forEach(function (key) {
54
+ if (key === "default" || key === "__esModule") return;
55
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
56
+ if (key in exports && exports[key] === _contentSchemaTransform[key]) return;
57
+ Object.defineProperty(exports, key, {
58
+ enumerable: true,
59
+ get: function () {
60
+ return _contentSchemaTransform[key];
61
+ }
62
+ });
63
+ });
64
+
65
+ var _getIsLeaf = require("./get-is-leaf");
66
+
67
+ Object.keys(_getIsLeaf).forEach(function (key) {
68
+ if (key === "default" || key === "__esModule") return;
69
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
70
+ if (key in exports && exports[key] === _getIsLeaf[key]) return;
71
+ Object.defineProperty(exports, key, {
72
+ enumerable: true,
73
+ get: function () {
74
+ return _getIsLeaf[key];
75
+ }
76
+ });
77
+ });
78
+
79
+ var _projectSchema = require("./project-schema");
80
+
81
+ Object.keys(_projectSchema).forEach(function (key) {
82
+ if (key === "default" || key === "__esModule") return;
83
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
84
+ if (key in exports && exports[key] === _projectSchema[key]) return;
85
+ Object.defineProperty(exports, key, {
86
+ enumerable: true,
87
+ get: function () {
88
+ return _projectSchema[key];
89
+ }
90
+ });
91
+ });
92
+
93
+ var _schemaUtil = require("./schema-util");
94
+
95
+ Object.keys(_schemaUtil).forEach(function (key) {
96
+ if (key === "default" || key === "__esModule") return;
97
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
98
+ if (key in exports && exports[key] === _schemaUtil[key]) return;
99
+ Object.defineProperty(exports, key, {
100
+ enumerable: true,
101
+ get: function () {
102
+ return _schemaUtil[key];
103
+ }
104
+ });
105
+ });
106
+
107
+ var _services = require("./services");
108
+
109
+ Object.keys(_services).forEach(function (key) {
110
+ if (key === "default" || key === "__esModule") return;
111
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
112
+ if (key in exports && exports[key] === _services[key]) return;
113
+ Object.defineProperty(exports, key, {
114
+ enumerable: true,
115
+ get: function () {
116
+ return _services[key];
117
+ }
118
+ });
119
+ });
120
+
121
+ var _templateShapes = require("./template-shapes");
122
+
123
+ Object.keys(_templateShapes).forEach(function (key) {
124
+ if (key === "default" || key === "__esModule") return;
125
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
126
+ if (key in exports && exports[key] === _templateShapes[key]) return;
127
+ Object.defineProperty(exports, key, {
128
+ enumerable: true,
129
+ get: function () {
130
+ return _templateShapes[key];
131
+ }
132
+ });
133
+ });
134
+
135
+ var _taxonomies = require("./taxonomies");
136
+
137
+ Object.keys(_taxonomies).forEach(function (key) {
138
+ if (key === "default" || key === "__esModule") return;
139
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
140
+ if (key in exports && exports[key] === _taxonomies[key]) return;
141
+ Object.defineProperty(exports, key, {
142
+ enumerable: true,
143
+ get: function () {
144
+ return _taxonomies[key];
145
+ }
146
+ });
147
+ });
148
+
149
+ var _types = require("./types");
150
+
151
+ Object.keys(_types).forEach(function (key) {
152
+ if (key === "default" || key === "__esModule") return;
153
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
154
+ if (key in exports && exports[key] === _types[key]) return;
155
+ Object.defineProperty(exports, key, {
156
+ enumerable: true,
157
+ get: function () {
158
+ return _types[key];
159
+ }
160
+ });
161
+ });
162
+
163
+ var _workflows = require("./workflows");
164
+
165
+ Object.keys(_workflows).forEach(function (key) {
166
+ if (key === "default" || key === "__esModule") return;
167
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
168
+ if (key in exports && exports[key] === _workflows[key]) return;
169
+ Object.defineProperty(exports, key, {
170
+ enumerable: true,
171
+ get: function () {
172
+ return _workflows[key];
173
+ }
174
+ });
175
+ });
176
+
177
+ var _builtinSchema = require("./builtin-schema");
178
+
179
+ Object.keys(_builtinSchema).forEach(function (key) {
180
+ if (key === "default" || key === "__esModule") return;
181
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
182
+ if (key in exports && exports[key] === _builtinSchema[key]) return;
183
+ Object.defineProperty(exports, key, {
184
+ enumerable: true,
185
+ get: function () {
186
+ return _builtinSchema[key];
187
+ }
188
+ });
189
+ });
190
+
191
+ var _authSchemas = require("./auth-schemas");
192
+
193
+ Object.keys(_authSchemas).forEach(function (key) {
194
+ if (key === "default" || key === "__esModule") return;
195
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
196
+ if (key in exports && exports[key] === _authSchemas[key]) return;
197
+ Object.defineProperty(exports, key, {
198
+ enumerable: true,
199
+ get: function () {
200
+ return _authSchemas[key];
201
+ }
202
+ });
203
+ });
204
+
205
+ var _apiVersion = require("./api-version");
206
+
207
+ Object.keys(_apiVersion).forEach(function (key) {
208
+ if (key === "default" || key === "__esModule") return;
209
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
210
+ if (key in exports && exports[key] === _apiVersion[key]) return;
211
+ Object.defineProperty(exports, key, {
212
+ enumerable: true,
213
+ get: function () {
214
+ return _apiVersion[key];
215
+ }
216
+ });
217
+ });
218
+
219
+ var _migration = require("./migration");
220
+
221
+ var _validate = require("./validate");
222
+
223
+ Object.keys(_validate).forEach(function (key) {
224
+ if (key === "default" || key === "__esModule") return;
225
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
226
+ if (key in exports && exports[key] === _validate[key]) return;
227
+ Object.defineProperty(exports, key, {
228
+ enumerable: true,
229
+ get: function () {
230
+ return _validate[key];
231
+ }
232
+ });
233
+ });
234
+
235
+ var _versions = require("./versions");
236
+
237
+ Object.keys(_versions).forEach(function (key) {
238
+ if (key === "default" || key === "__esModule") return;
239
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
240
+ if (key in exports && exports[key] === _versions[key]) return;
241
+ Object.defineProperty(exports, key, {
242
+ enumerable: true,
243
+ get: function () {
244
+ return _versions[key];
245
+ }
246
+ });
247
+ });
248
+
249
+ var _mocks = require("./mocks");
250
+
251
+ Object.keys(_mocks).forEach(function (key) {
252
+ if (key === "default" || key === "__esModule") return;
253
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
254
+ if (key in exports && exports[key] === _mocks[key]) return;
255
+ Object.defineProperty(exports, key, {
256
+ enumerable: true,
257
+ get: function () {
258
+ return _mocks[key];
259
+ }
260
+ });
261
+ });
262
+
263
+ var _util = require("./util");
264
+
265
+ Object.keys(_util).forEach(function (key) {
266
+ if (key === "default" || key === "__esModule") return;
267
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
268
+ if (key in exports && exports[key] === _util[key]) return;
269
+ Object.defineProperty(exports, key, {
270
+ enumerable: true,
271
+ get: function () {
272
+ return _util[key];
273
+ }
274
+ });
275
+ });
276
+
277
+ var _resolvers = require("./resolvers");
278
+
279
+ Object.keys(_resolvers).forEach(function (key) {
280
+ if (key === "default" || key === "__esModule") return;
281
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
282
+ if (key in exports && exports[key] === _resolvers[key]) return;
283
+ Object.defineProperty(exports, key, {
284
+ enumerable: true,
285
+ get: function () {
286
+ return _resolvers[key];
287
+ }
288
+ });
289
+ });
290
+
291
+ var _scalars = require("./scalars");
292
+
293
+ Object.keys(_scalars).forEach(function (key) {
294
+ if (key === "default" || key === "__esModule") return;
295
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
296
+ if (key in exports && exports[key] === _scalars[key]) return;
297
+ Object.defineProperty(exports, key, {
298
+ enumerable: true,
299
+ get: function () {
300
+ return _scalars[key];
301
+ }
302
+ });
303
+ });
304
+
305
+ var _refs = require("./refs");
306
+
307
+ Object.keys(_refs).forEach(function (key) {
308
+ if (key === "default" || key === "__esModule") return;
309
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
310
+ if (key in exports && exports[key] === _refs[key]) return;
311
+ Object.defineProperty(exports, key, {
312
+ enumerable: true,
313
+ get: function () {
314
+ return _refs[key];
315
+ }
316
+ });
317
+ });
318
+
319
+ var _unions = require("./unions");
320
+
321
+ Object.keys(_unions).forEach(function (key) {
322
+ if (key === "default" || key === "__esModule") return;
323
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
324
+ if (key in exports && exports[key] === _unions[key]) return;
325
+ Object.defineProperty(exports, key, {
326
+ enumerable: true,
327
+ get: function () {
328
+ return _unions[key];
329
+ }
330
+ });
331
+ });
332
+
333
+ var _enum = require("./enum");
334
+
335
+ Object.keys(_enum).forEach(function (key) {
336
+ if (key === "default" || key === "__esModule") return;
337
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
338
+ if (key in exports && exports[key] === _enum[key]) return;
339
+ Object.defineProperty(exports, key, {
340
+ enumerable: true,
341
+ get: function () {
342
+ return _enum[key];
343
+ }
344
+ });
345
+ });
346
+
347
+ var _patterns = require("./patterns");
348
+
349
+ Object.keys(_patterns).forEach(function (key) {
350
+ if (key === "default" || key === "__esModule") return;
351
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
352
+ if (key in exports && exports[key] === _patterns[key]) return;
353
+ Object.defineProperty(exports, key, {
354
+ enumerable: true,
355
+ get: function () {
356
+ return _patterns[key];
357
+ }
358
+ });
359
+ });
@@ -0,0 +1,55 @@
1
+ import type { ProjectSchema, AnyProjectSchema, ProjectSchemaV1_0_0, ProjectSchemaV3_0_0, ProjectSchemaV3_1_0, ProjectSchemaV3_2_0, ProjectSchemaV3_3_0, ProjectSchemaV3_4_0, ProjectSchemaV3_5_0, ProjectSchemaV3_5_1, ProjectSchemaV3_6_0, ContentSchema, ContentTypeV1_0_0, ShapeMap, ContentSchemaV1_0_0, Relationship, FormConfig, Workflow, Shape } from './project-schema';
2
+ import type { EncryptFn } from './services';
3
+ import { SafeDecryptFn } from './services';
4
+ export declare const listTypePrefix = "PaginatedList";
5
+ interface ConversionParams {
6
+ shapeName: string;
7
+ shapeTitle: string;
8
+ schema: ContentSchemaV1_0_0;
9
+ service: string;
10
+ key: string;
11
+ name: string;
12
+ depth: number;
13
+ setSource?: boolean;
14
+ omitAllSources?: boolean;
15
+ parentSchema?: ContentSchemaV1_0_0;
16
+ }
17
+ export interface ProjectSchemaUpdate extends Omit<Partial<ProjectSchema>, 'shapes' | 'forms' | 'workflows'> {
18
+ shapes?: Record<string, Shape | null>;
19
+ forms?: Record<string, FormConfig | null>;
20
+ workflows?: Record<string, Workflow | null>;
21
+ deactivated?: number;
22
+ }
23
+ declare type GenerateDataKeyFn = () => Promise<string>;
24
+ export interface ProjectSchemaMigrationContext {
25
+ generateDataKeyFn: GenerateDataKeyFn;
26
+ encryptFn: EncryptFn;
27
+ decryptFn: SafeDecryptFn;
28
+ }
29
+ export declare function getRelationshipSchema(relationship: Relationship): ContentSchema;
30
+ export declare function migrateToContentSchemaV3(params: ConversionParams): {
31
+ schema: ContentSchema;
32
+ hoistedShapes?: ShapeMap;
33
+ };
34
+ export declare function contentTypeToShape(contentType: ContentTypeV1_0_0, contentTypeId: string): ShapeMap;
35
+ export declare function migrateToV3(projectSchema: ProjectSchemaV1_0_0): ProjectSchemaV3_0_0;
36
+ export declare function migrateToV3_1(context: ProjectSchemaMigrationContext, projectSchema: ProjectSchemaV3_0_0): Promise<ProjectSchemaV3_1_0>;
37
+ export declare function migrateToV3_2(projectSchema: ProjectSchemaV3_1_0): ProjectSchemaV3_2_0;
38
+ export declare function migrateToV3_3(context: ProjectSchemaMigrationContext, projectSchema: ProjectSchemaV3_2_0): Promise<ProjectSchemaV3_3_0>;
39
+ export declare function migrateToV3_4(projectSchema: ProjectSchemaV3_3_0): ProjectSchemaV3_4_0;
40
+ export declare function migrateToV3_5(projectSchema: ProjectSchemaV3_4_0): ProjectSchemaV3_5_0;
41
+ export declare function migrateToV3_5_1(projectSchema: ProjectSchemaV3_5_0): ProjectSchemaV3_5_1;
42
+ export declare function migrateToV3_6(projectSchema: ProjectSchemaV3_5_1): ProjectSchemaV3_6_0;
43
+ export declare function migrateToLatestProjectSchema(context: ProjectSchemaMigrationContext, projectSchema: AnyProjectSchema): Promise<ProjectSchema>;
44
+ export declare function normalizeSchemaVersion(version?: string): string;
45
+ export declare function isV1Like(schema: {
46
+ schemaVersion?: string;
47
+ }): boolean;
48
+ export declare function isV1(schema: AnyProjectSchema): schema is ProjectSchemaV1_0_0;
49
+ export declare function isV3Like(schema: {
50
+ schemaVersion?: string;
51
+ }): boolean;
52
+ export declare function isV3(schema: AnyProjectSchema): schema is ProjectSchemaV3_0_0;
53
+ export declare function ensureLatest(context: ProjectSchemaMigrationContext, schema?: AnyProjectSchema): Promise<ProjectSchema | undefined>;
54
+ export {};
55
+ //# sourceMappingURL=migration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../src/migration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EAEnB,aAAa,EACb,iBAAiB,EAEjB,QAAQ,EACR,mBAAmB,EACnB,YAAY,EACZ,UAAU,EACV,QAAQ,EAER,KAAK,EAEN,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AAc1C,OAAO,EAAC,aAAa,EAA8B,MAAM,YAAY,CAAC;AActE,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAQ9C,UAAU,gBAAgB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,mBAAmB,CAAC;IA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