@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
@@ -0,0 +1,185 @@
1
+ {
2
+ "$schema": "https://schema.takeshape.io/project-schema#",
3
+ "version": 1,
4
+ "apiVersion": "1",
5
+ "author": "<userId>",
6
+ "projectId": "project-id",
7
+ "locales": [
8
+ "en-us"
9
+ ],
10
+ "defaultLocale": "en-us",
11
+ "workflows": {},
12
+ "queries": {
13
+ "getUser": {
14
+ "shape": "User",
15
+ "resolver": {
16
+ "name": "takeshape:get",
17
+ "service": "takeshape:local",
18
+ "options": {
19
+ "model": "User"
20
+ }
21
+ },
22
+ "description": "Get a User by ID",
23
+ "args": "TSGetArgs<User>"
24
+ },
25
+ "getUserList": {
26
+ "shape": "PaginatedList<User>",
27
+ "resolver": {
28
+ "name": "takeshape:list",
29
+ "service": "takeshape:local",
30
+ "options": {
31
+ "model": "User"
32
+ }
33
+ },
34
+ "description": "Returns a list User in natural order.",
35
+ "args": "TSListArgs<User>"
36
+ }
37
+ },
38
+ "mutations": {
39
+ "updateUser": {
40
+ "shape": "UpdateResult<User>",
41
+ "resolver": {
42
+ "name": "takeshape:update",
43
+ "service": "takeshape:local",
44
+ "options": {
45
+ "model": "User"
46
+ }
47
+ },
48
+ "description": "Update User",
49
+ "args": "UpdateArgs<User>"
50
+ },
51
+ "createUser": {
52
+ "shape": "CreateResult<User>",
53
+ "resolver": {
54
+ "name": "takeshape:create",
55
+ "service": "takeshape:local",
56
+ "options": {
57
+ "model": "User"
58
+ }
59
+ },
60
+ "description": "Create User",
61
+ "args": "CreateArgs<User>"
62
+ },
63
+ "duplicateUser": {
64
+ "shape": "DuplicateResult<User>",
65
+ "resolver": {
66
+ "name": "takeshape:duplicate",
67
+ "service": "takeshape:local",
68
+ "options": {
69
+ "model": "User"
70
+ }
71
+ },
72
+ "description": "Duplicate User",
73
+ "args": "DuplicateArgs<User>"
74
+ },
75
+ "deleteUser": {
76
+ "shape": "DeleteResult<User>",
77
+ "resolver": {
78
+ "name": "takeshape:delete",
79
+ "service": "takeshape:local",
80
+ "options": {
81
+ "model": "User"
82
+ }
83
+ },
84
+ "description": "Delete User",
85
+ "args": "DeleteArgs<User>"
86
+ }
87
+ },
88
+ "schemaVersion": "3.6.0",
89
+ "created": "2016-06-21T15:16:19.051Z",
90
+ "updated": "2016-06-21T15:16:19.051Z",
91
+ "shapes": {
92
+ "User": {
93
+ "id": "<userContentTypeId>",
94
+ "name": "User",
95
+ "title": "User",
96
+ "model": {
97
+ "type": "multiple"
98
+ },
99
+ "schema": {
100
+ "type": "object",
101
+ "properties": {
102
+ "firstName": {
103
+ "type": "string",
104
+ "@mapping": "takeshape:local:User.firstNameId"
105
+ },
106
+ "lastName": {
107
+ "type": "string",
108
+ "@mapping": "takeshape:local:User.lastNameId"
109
+ },
110
+ "username": {
111
+ "type": "string",
112
+ "default": "dude",
113
+ "maxLength": 16,
114
+ "minLength": 3,
115
+ "pattern": "^[a-z0-9_-]+$",
116
+ "@mapping": "takeshape:local:User.usernameId"
117
+ },
118
+ "email": {
119
+ "type": "string",
120
+ "format": "email",
121
+ "@mapping": "takeshape:local:User.emailId"
122
+ },
123
+ "password": {
124
+ "type": "string",
125
+ "@sensitive": true,
126
+ "maxLength": 16,
127
+ "minLength": 3,
128
+ "@mapping": "takeshape:local:User.passwordId"
129
+ },
130
+ "roles": {
131
+ "type": "array",
132
+ "items": {
133
+ "type": "string"
134
+ },
135
+ "@mapping": "takeshape:local:User.rolesId"
136
+ },
137
+ "locations": {
138
+ "type": "array",
139
+ "items": {
140
+ "$ref": "#/shapes/UserLocations/schema"
141
+ },
142
+ "@mapping": "takeshape:local:User.locationsId"
143
+ }
144
+ },
145
+ "required": []
146
+ }
147
+ },
148
+ "UserLocations": {
149
+ "id": "locationsId",
150
+ "name": "UserLocations",
151
+ "title": "User Locations",
152
+ "schema": {
153
+ "type": "object",
154
+ "properties": {
155
+ "lat": {
156
+ "type": "number",
157
+ "default": 40.694598,
158
+ "@mapping": "takeshape:local:UserLocations.latId"
159
+ },
160
+ "lon": {
161
+ "type": "number",
162
+ "default": 73.983119,
163
+ "@mapping": "takeshape:local:UserLocations.lonId"
164
+ }
165
+ }
166
+ }
167
+ }
168
+ },
169
+ "forms": {
170
+ "User": {
171
+ "default": {
172
+ "order": [
173
+ "firstName",
174
+ "lastName",
175
+ "username",
176
+ "email",
177
+ "password",
178
+ "roles",
179
+ "locations"
180
+ ]
181
+ }
182
+ }
183
+ },
184
+ "dataKey": "supersecret"
185
+ }
@@ -0,0 +1,210 @@
1
+ {
2
+ "$schema": "https://schema.takeshape.io/project-schema#",
3
+ "version": 1,
4
+ "apiVersion": "1",
5
+ "author": "<userId>",
6
+ "projectId": "project-id",
7
+ "locales": [
8
+ "en-us"
9
+ ],
10
+ "defaultLocale": "en-us",
11
+ "workflows": {},
12
+ "queries": {
13
+ "getUser": {
14
+ "shape": "User",
15
+ "resolver": {
16
+ "name": "takeshape:get",
17
+ "service": "takeshape:local",
18
+ "options": {
19
+ "model": "User"
20
+ }
21
+ },
22
+ "description": "Get a User by ID",
23
+ "args": "TSGetArgs<User>"
24
+ },
25
+ "getUserList": {
26
+ "shape": "PaginatedList<User>",
27
+ "resolver": {
28
+ "name": "takeshape:list",
29
+ "service": "takeshape:local",
30
+ "options": {
31
+ "model": "User"
32
+ }
33
+ },
34
+ "description": "Returns a list User in natural order.",
35
+ "args": "TSListArgs<User>"
36
+ }
37
+ },
38
+ "mutations": {
39
+ "updateUser": {
40
+ "shape": "UpdateResult<User>",
41
+ "resolver": {
42
+ "name": "takeshape:update",
43
+ "service": "takeshape:local",
44
+ "options": {
45
+ "model": "User"
46
+ }
47
+ },
48
+ "description": "Update User",
49
+ "args": "UpdateArgs<User>"
50
+ },
51
+ "createUser": {
52
+ "shape": "CreateResult<User>",
53
+ "resolver": {
54
+ "name": "takeshape:create",
55
+ "service": "takeshape:local",
56
+ "options": {
57
+ "model": "User"
58
+ }
59
+ },
60
+ "description": "Create User",
61
+ "args": "CreateArgs<User>"
62
+ },
63
+ "duplicateUser": {
64
+ "shape": "DuplicateResult<User>",
65
+ "resolver": {
66
+ "name": "takeshape:duplicate",
67
+ "service": "takeshape:local",
68
+ "options": {
69
+ "model": "User"
70
+ }
71
+ },
72
+ "description": "Duplicate User",
73
+ "args": "DuplicateArgs<User>"
74
+ },
75
+ "deleteUser": {
76
+ "shape": "DeleteResult<User>",
77
+ "resolver": {
78
+ "name": "takeshape:delete",
79
+ "service": "takeshape:local",
80
+ "options": {
81
+ "model": "User"
82
+ }
83
+ },
84
+ "description": "Delete User",
85
+ "args": "DeleteArgs<User>"
86
+ }
87
+ },
88
+ "schemaVersion": "3.6.0",
89
+ "created": "2016-06-21T15:16:19.051Z",
90
+ "updated": "2016-06-21T15:16:19.051Z",
91
+ "shapes": {
92
+ "User": {
93
+ "id": "<userContentTypeId>",
94
+ "name": "User",
95
+ "title": "User",
96
+ "model": {
97
+ "type": "multiple"
98
+ },
99
+ "schema": {
100
+ "type": "object",
101
+ "properties": {
102
+ "firstName": {
103
+ "type": "string",
104
+ "@l10n": true,
105
+ "@mapping": "takeshape:local:User.firstNameId"
106
+ },
107
+ "lastName": {
108
+ "type": "string",
109
+ "@l10n": true,
110
+ "@mapping": "takeshape:local:User.lastNameId"
111
+ },
112
+ "age": {
113
+ "type": "number",
114
+ "@mapping": "takeshape:local:User.ageId"
115
+ },
116
+ "username": {
117
+ "type": "string",
118
+ "default": "dude",
119
+ "maxLength": 16,
120
+ "minLength": 3,
121
+ "pattern": "^[a-z0-9_-]+$",
122
+ "@mapping": "takeshape:local:User.usernameId"
123
+ },
124
+ "email": {
125
+ "type": "string",
126
+ "@l10n": false,
127
+ "format": "email",
128
+ "@mapping": "takeshape:local:User.emailId"
129
+ },
130
+ "password": {
131
+ "type": "string",
132
+ "@sensitive": true,
133
+ "maxLength": 16,
134
+ "minLength": 3,
135
+ "@mapping": "takeshape:local:User.passwordId"
136
+ },
137
+ "roles": {
138
+ "type": "array",
139
+ "@l10n": true,
140
+ "items": {
141
+ "type": "string"
142
+ },
143
+ "@mapping": "takeshape:local:User.rolesId"
144
+ },
145
+ "locations": {
146
+ "type": "array",
147
+ "@l10n": true,
148
+ "@syncLocaleStructure": true,
149
+ "items": {
150
+ "$ref": "#/shapes/UserLocations/schema"
151
+ },
152
+ "@mapping": "takeshape:local:User.locationsId"
153
+ }
154
+ },
155
+ "required": [
156
+ "firstName",
157
+ "lastName",
158
+ "username",
159
+ "email",
160
+ "password",
161
+ "roles",
162
+ "locations"
163
+ ]
164
+ }
165
+ },
166
+ "UserLocations": {
167
+ "id": "locationsId",
168
+ "name": "UserLocations",
169
+ "title": "User Locations",
170
+ "schema": {
171
+ "type": "object",
172
+ "properties": {
173
+ "lat": {
174
+ "type": "string",
175
+ "default": "40.694598",
176
+ "@l10n": true,
177
+ "@mapping": "takeshape:local:UserLocations.latId"
178
+ },
179
+ "lon": {
180
+ "type": "string",
181
+ "default": "73.983119",
182
+ "@l10n": true,
183
+ "@mapping": "takeshape:local:UserLocations.lonId"
184
+ }
185
+ },
186
+ "required": [
187
+ "lat",
188
+ "lon"
189
+ ]
190
+ }
191
+ }
192
+ },
193
+ "forms": {
194
+ "User": {
195
+ "default": {
196
+ "order": [
197
+ "firstName",
198
+ "lastName",
199
+ "age",
200
+ "username",
201
+ "email",
202
+ "password",
203
+ "roles",
204
+ "locations"
205
+ ]
206
+ }
207
+ }
208
+ },
209
+ "dataKey": "supersecret"
210
+ }
@@ -0,0 +1,6 @@
1
+ import SemVer from 'semver/classes/semver';
2
+ export declare type VersionCompareFn = (apiVersion: string | SemVer, featureVersion: string | SemVer) => boolean;
3
+ export declare const createVersionPredicate: (featureVersion: string | SemVer, comparison: VersionCompareFn) => (apiVersion: string | SemVer) => boolean;
4
+ export declare const workflowsEnabled: (apiVersion: string | SemVer) => boolean;
5
+ export declare const whereClauseEnabled: (apiVersion: string | SemVer) => boolean;
6
+ //# sourceMappingURL=api-version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-version.d.ts","sourceRoot":"","sources":["../../src/api-version.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAE3C,oBAAY,gBAAgB,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,KAAK,OAAO,CAAC;AAEzG,eAAO,MAAM,sBAAsB,mBACjB,MAAM,GAAG,MAAM,cACnB,gBAAgB,kBACb,MAAM,GAAG,MAAM,KAAK,OAcpC,CAAC;AAEF,eAAO,MAAM,gBAAgB,eAhBZ,MAAM,GAAG,MAAM,KAAK,OAgB+B,CAAC;AAErE,eAAO,MAAM,kBAAkB,eAlBd,MAAM,GAAG,MAAM,KAAK,OAkBiC,CAAC"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.whereClauseEnabled = exports.workflowsEnabled = exports.createVersionPredicate = void 0;
7
+
8
+ var _gte = _interopRequireDefault(require("semver/functions/gte"));
9
+
10
+ var _coerce = _interopRequireDefault(require("semver/functions/coerce"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ const createVersionPredicate = (featureVersion, comparison) => {
15
+ const coercedFeatureVersion = (0, _coerce.default)(featureVersion);
16
+
17
+ if (!coercedFeatureVersion) {
18
+ throw new Error(`Could not create predicate version "${featureVersion}" is not valid`);
19
+ }
20
+
21
+ return apiVersion => {
22
+ const coercedApiVersion = (0, _coerce.default)(apiVersion);
23
+
24
+ if (!coercedApiVersion) {
25
+ throw new Error(`Version "${apiVersion}" is not valid and could not be coerced`);
26
+ }
27
+
28
+ return comparison(coercedApiVersion, coercedFeatureVersion);
29
+ };
30
+ };
31
+
32
+ exports.createVersionPredicate = createVersionPredicate;
33
+ const workflowsEnabled = createVersionPredicate('2.0.0', _gte.default);
34
+ exports.workflowsEnabled = workflowsEnabled;
35
+ const whereClauseEnabled = createVersionPredicate('2.0.0', _gte.default);
36
+ exports.whereClauseEnabled = whereClauseEnabled;
@@ -0,0 +1,105 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ /**
7
+ * A role import document is an array of role
8
+ *
9
+ * This interface was referenced by `AuthSchemas`'s JSON-Schema
10
+ * via the `definition` "RoleImport".
11
+ */
12
+ export declare type RoleImport = RoleInput[];
13
+ export interface AuthSchemas {
14
+ [k: string]: any;
15
+ }
16
+ /**
17
+ * This interface was referenced by `AuthSchemas`'s JSON-Schema
18
+ * via the `definition` "Condition".
19
+ */
20
+ export interface Condition {
21
+ }
22
+ /**
23
+ * This interface was referenced by `AuthSchemas`'s JSON-Schema
24
+ * via the `definition` "Statement".
25
+ */
26
+ export interface Statement {
27
+ Effect?: 'Allow' | 'Deny';
28
+ Sid?: string;
29
+ Action?: string[];
30
+ NotAction?: string[];
31
+ Resource?: string[];
32
+ NotResource?: string[];
33
+ Principal?: {
34
+ AWS?: string[];
35
+ Service?: string[];
36
+ };
37
+ Condition?: Condition;
38
+ }
39
+ /**
40
+ * This interface was referenced by `AuthSchemas`'s JSON-Schema
41
+ * via the `definition` "AccessPolicyDocument".
42
+ */
43
+ export interface AccessPolicyDocument {
44
+ Version: string;
45
+ Statement: Statement[];
46
+ }
47
+ /**
48
+ * This interface was referenced by `AuthSchemas`'s JSON-Schema
49
+ * via the `definition` "ApiKey".
50
+ */
51
+ export interface ApiKey {
52
+ projectId: string;
53
+ name: string;
54
+ role?: string;
55
+ permissions?: AccessPolicyDocument;
56
+ lastUsed?: string;
57
+ apiKey?: string;
58
+ id: string;
59
+ delinquent?: boolean;
60
+ apiRateLimit?: number;
61
+ deactivated?: number;
62
+ }
63
+ /**
64
+ * This interface was referenced by `AuthSchemas`'s JSON-Schema
65
+ * via the `definition` "UserPermission".
66
+ */
67
+ export interface UserPermission {
68
+ projectId: string;
69
+ userId: string;
70
+ role: string;
71
+ permissions?: AccessPolicyDocument;
72
+ created?: number;
73
+ updated?: number;
74
+ deactivated?: number;
75
+ delinquent?: boolean;
76
+ }
77
+ /**
78
+ * This interface was referenced by `AuthSchemas`'s JSON-Schema
79
+ * via the `definition` "Role".
80
+ */
81
+ export interface Role {
82
+ projectId: string;
83
+ name: string;
84
+ conditions?: Condition;
85
+ permissions: AccessPolicyDocument;
86
+ builtIn?: boolean;
87
+ created?: number;
88
+ updated?: number;
89
+ }
90
+ /**
91
+ * Input type for role creation and updates.
92
+ *
93
+ * This interface was referenced by `AuthSchemas`'s JSON-Schema
94
+ * via the `definition` "RoleInput".
95
+ */
96
+ export interface RoleInput {
97
+ projectId?: string;
98
+ name: string;
99
+ conditions?: Condition;
100
+ permissions: AccessPolicyDocument;
101
+ builtIn?: boolean;
102
+ created?: number;
103
+ updated?: number;
104
+ }
105
+ //# sourceMappingURL=auth-schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-schemas.d.ts","sourceRoot":"","sources":["../../src/auth-schemas.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH;;;;;GAKG;AACH,oBAAY,UAAU,GAAG,SAAS,EAAE,CAAC;AAErC,MAAM,WAAW,WAAW;IAC1B,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AACD;;;GAGG;AACH,MAAM,WAAW,SAAS;CAAG;AAC7B;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE;QACV,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;IACF,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AACD;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,SAAS,EAAE,CAAC;CACxB;AACD;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AACD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AACD;;;GAGG;AACH,MAAM,WAAW,IAAI;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,WAAW,EAAE,oBAAoB,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AACD;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,WAAW,EAAE,oBAAoB,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,8 @@
1
+ import { FormMap, ShapeMap } from './project-schema';
2
+ import { Content } from './types';
3
+ export declare function isAsset(content: Content): boolean;
4
+ export declare function getAssetS3Path(content: Content): string | undefined;
5
+ export declare function setAssetS3Path(content: Content, path: string): void;
6
+ export declare const builtInShapes: ShapeMap;
7
+ export declare const builtInForms: FormMap;
8
+ //# sourceMappingURL=builtin-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtin-schema.d.ts","sourceRoot":"","sources":["../../src/builtin-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAEhC,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEjD;AAID,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAEnE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAEnE;AAED,eAAO,MAAM,aAAa,EAAE,QAyS3B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,OA+P1B,CAAC"}