@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,569 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://schema.takeshape.io/project-schema/v3.1.0#",
4
+ "title": "Project Schema",
5
+ "definitions": {
6
+ "shape": {
7
+ "title": "Shape",
8
+ "description": "A Shape is a schema object for structuring and storing data from one or more sources, including the TakeShape data store and connected services",
9
+ "type": "object",
10
+ "properties": {
11
+ "name": {
12
+ "type": "string",
13
+ "pattern": "^[_a-zA-Z][_a-zA-Z0-9]*$",
14
+ "description": "The Pascal-cased human-readable id for a Shape. This value should match the shape's key in the shapes object. This value is used in @ref and @mapping annotations"
15
+ },
16
+ "id": {
17
+ "type": "string",
18
+ "pattern": "[0-9A-Za-z_-]+",
19
+ "description": "The machine-readable id for a Shape which should never change. When using TakeShape's built-in database to store Shape data, this value is used database as a stable \"table name\" and changing it will result in orphaning that data."
20
+ },
21
+ "title": {
22
+ "type": "string",
23
+ "description": "The human-readable name for a Shape for use in a UI."
24
+ },
25
+ "description": {
26
+ "type": "string"
27
+ },
28
+ "model": {
29
+ "description": "Specifying a model type allows Shape data to be stored in TakeShape's built-in database",
30
+ "type": "object",
31
+ "properties": {
32
+ "type": {
33
+ "title": "Model Type",
34
+ "type": "string",
35
+ "enum": ["single", "multiple", "taxonomy"]
36
+ }
37
+ },
38
+ "required": ["type"],
39
+ "additionalProperties": false
40
+ },
41
+ "workflow": {
42
+ "type": "string"
43
+ },
44
+ "schema": {
45
+ "$ref": "https://schema.takeshape.io/project-schema/meta-schema-v3.1.0#/definitions/contentObjectSchema"
46
+ }
47
+ },
48
+ "required": ["name", "title", "id", "schema"]
49
+ },
50
+ "shapeWithObjectSchema": {
51
+ "title": "Shape With Object Schema",
52
+ "type": "object",
53
+ "allOf": [
54
+ {
55
+ "$ref": "#/definitions/shape"
56
+ },
57
+ {
58
+ "type": "object",
59
+ "properties": {
60
+ "schema": {
61
+ "$ref": "https://schema.takeshape.io/project-schema/meta-schema-v3.1.0#/definitions/objectSchema"
62
+ }
63
+ },
64
+ "required": ["schema"],
65
+ "additionalProperties": false
66
+ }
67
+ ]
68
+ },
69
+ "shapeMap": {
70
+ "title": "Shape Map",
71
+ "type": "object",
72
+ "patternProperties": {
73
+ "[0-9A-Za-z_-]+": {"$ref": "#/definitions/shape"}
74
+ }
75
+ },
76
+ "formMap": {
77
+ "title": "Form Map",
78
+ "type": "object",
79
+ "patternProperties": {
80
+ "[0-9A-Za-z_-]+": {
81
+ "$ref": "#/definitions/formsConfig"
82
+ }
83
+ }
84
+ },
85
+ "formScalarConfig": {
86
+ "title": "Form Scalar Config",
87
+ "type": "object",
88
+ "properties": {
89
+ "widget": {
90
+ "type": "string"
91
+ }
92
+ },
93
+ "additionalProperties": false,
94
+ "required": ["widget"]
95
+ },
96
+ "formObjectConfig": {
97
+ "title": "Form Object Config",
98
+ "type": "object",
99
+ "properties": {
100
+ "widget": {
101
+ "type": "string"
102
+ },
103
+ "order": {
104
+ "type": "array",
105
+ "items": {
106
+ "type": "string"
107
+ }
108
+ },
109
+ "properties": {
110
+ "patternProperties": {
111
+ "[0-9A-Za-z_-]+": {
112
+ "$ref": "#/definitions/formConfig"
113
+ }
114
+ }
115
+ }
116
+ },
117
+ "additionalProperties": false
118
+ },
119
+ "formArrayConfig": {
120
+ "title": "Form Array Config",
121
+ "type": "object",
122
+ "properties": {
123
+ "widget": {
124
+ "type": "string"
125
+ },
126
+ "items": {
127
+ "$ref": "#/definitions/formConfig"
128
+ }
129
+ },
130
+ "additionalProperties": false,
131
+ "required": ["widget", "items"]
132
+ },
133
+ "searchParamsAuthentication": {
134
+ "title": "Search Params Authentication",
135
+ "type": "array",
136
+ "items": {
137
+ "properties": {
138
+ "name": {
139
+ "type": "string"
140
+ },
141
+ "value": {
142
+ "type": "string"
143
+ }
144
+ },
145
+ "required": ["name", "value"],
146
+ "additionalProperties": false
147
+ }
148
+ },
149
+ "bearerAuthentication": {
150
+ "title": "Bearer Authentication",
151
+ "type": "object",
152
+ "properties": {
153
+ "token": {
154
+ "type": "string"
155
+ },
156
+ "prefix": {
157
+ "type": "string"
158
+ },
159
+ "header": {
160
+ "type": "string"
161
+ }
162
+ },
163
+ "additionalProperties": false
164
+ },
165
+ "oauth2BearerAuthentication": {
166
+ "title": "OAuth 2 Bearer Authentication",
167
+ "type": "object",
168
+ "properties": {
169
+ "token": {
170
+ "type": "string"
171
+ },
172
+ "prefix": {
173
+ "type": "string"
174
+ },
175
+ "header": {
176
+ "type": "string"
177
+ },
178
+ "scope": {
179
+ "type": "string"
180
+ },
181
+ "expiresAt": {
182
+ "type": "string"
183
+ }
184
+ },
185
+ "additionalProperties": false
186
+ },
187
+ "basicAuthentication": {
188
+ "title": "Basic Authentication",
189
+ "type": "object",
190
+ "properties": {
191
+ "username": {
192
+ "type": "string"
193
+ },
194
+ "password": {
195
+ "type": "string"
196
+ },
197
+ "useIso8859": {
198
+ "type": "boolean"
199
+ }
200
+ },
201
+ "additionalProperties": false
202
+ },
203
+ "oauth2Authentication": {
204
+ "title": "OAuth 2 Authentication",
205
+ "type": "object",
206
+ "properties": {
207
+ "grantType": {
208
+ "type": "string",
209
+ "enum": ["authorizationCode", "clientCredentials"]
210
+ },
211
+ "authorizationUrl": {
212
+ "type": "string"
213
+ },
214
+ "accessTokenUrl": {
215
+ "type": "string"
216
+ },
217
+ "clientId": {
218
+ "type": "string"
219
+ },
220
+ "clientSecret": {
221
+ "type": "string"
222
+ },
223
+ "scope": {
224
+ "type": "string"
225
+ },
226
+ "usePkce": {
227
+ "type": "boolean"
228
+ },
229
+ "redirectUrl": {
230
+ "type": "string"
231
+ },
232
+ "headerPrefix": {
233
+ "type": "string"
234
+ },
235
+ "audience": {
236
+ "type": "string"
237
+ },
238
+ "resource": {
239
+ "type": "string"
240
+ }
241
+ },
242
+ "additionalProperties": false
243
+ },
244
+ "serviceAuthentication": {
245
+ "title": "Service Authentication",
246
+ "oneOf": [
247
+ {
248
+ "$ref": "#/definitions/oauth2Authentication"
249
+ },
250
+ {
251
+ "$ref": "#/definitions/oauth2BearerAuthentication"
252
+ },
253
+ {
254
+ "$ref": "#/definitions/bearerAuthentication"
255
+ },
256
+ {
257
+ "$ref": "#/definitions/basicAuthentication"
258
+ },
259
+ {
260
+ "$ref": "#/definitions/searchParamsAuthentication"
261
+ }
262
+ ]
263
+ },
264
+ "serviceType": {
265
+ "title": "Service Type",
266
+ "description": "The general type of this service, specifying how and where it will be utilized.",
267
+ "type": "string",
268
+ "enum": ["deployment", "authentication", "takeshape", "rest", "graphql", "openapi", "unknown"]
269
+ },
270
+ "serviceConfig": {
271
+ "title": "Service Config",
272
+ "type": "object",
273
+ "properties": {
274
+ "id": {
275
+ "type": "string",
276
+ "description": "Machine-readable identifier, should typically be the same as the property name on the services object."
277
+ },
278
+ "title": {
279
+ "type": "string",
280
+ "description": "Human-readable name for this service."
281
+ },
282
+ "provider": {
283
+ "description": "The service provider id.",
284
+ "type": "string"
285
+ },
286
+ "namespace": {
287
+ "type": "string",
288
+ "description": "A namespace to use for the imported types tied to this service."
289
+ },
290
+ "serviceType": {
291
+ "$ref": "#/definitions/serviceType"
292
+ },
293
+ "authenticationType": {
294
+ "type": "string",
295
+ "enum": ["oauth2", "basic", "bearer", "searchParams", "oauth2Bearer", "none", "unknown"]
296
+ },
297
+ "authentication": {
298
+ "$ref": "#/definitions/serviceAuthentication"
299
+ },
300
+ "webhookId": {
301
+ "type": "string"
302
+ },
303
+ "options": {
304
+ "type": "object",
305
+ "description": "Configuration options passed to and handled by the provider.",
306
+ "patternProperties": {
307
+ "[a-zA-Z][a-zA-Z0-9]*": {
308
+ "type": "string"
309
+ }
310
+ }
311
+ }
312
+ },
313
+ "required": ["id", "title", "provider", "serviceType", "authenticationType"],
314
+ "additionalProperties": false
315
+ },
316
+ "storedServiceConfig": {
317
+ "title": "Stored Service Config",
318
+ "type": "object",
319
+ "properties": {
320
+ "id": {
321
+ "type": "string",
322
+ "description": "Machine-readable identifier, should typically be the same as the property name on the services object."
323
+ },
324
+ "title": {
325
+ "type": "string",
326
+ "description": "Human-readable name for this service."
327
+ },
328
+ "provider": {
329
+ "type": "string",
330
+ "description": "The service provider id."
331
+ },
332
+ "namespace": {
333
+ "type": "string",
334
+ "description": "A namespace to use for the imported types tied to this service."
335
+ },
336
+ "serviceType": {
337
+ "$ref": "#/definitions/serviceType"
338
+ },
339
+ "authenticationType": {
340
+ "type": "string",
341
+ "enum": ["oauth2", "basic", "bearer", "searchParams", "oauth2Bearer", "none", "unknown"]
342
+ },
343
+ "authentication": {
344
+ "type": "string"
345
+ },
346
+ "webhookId": {
347
+ "type": "string"
348
+ },
349
+ "options": {
350
+ "type": "object",
351
+ "description": "Configuration options passed to and handled by the provider.",
352
+ "patternProperties": {
353
+ "[a-zA-Z][a-zA-Z0-9]*": {
354
+ "type": "string"
355
+ }
356
+ }
357
+ }
358
+ },
359
+ "required": ["id", "title", "provider", "serviceType", "authenticationType"],
360
+ "additionalProperties": false
361
+ },
362
+ "anyServiceConfig": {
363
+ "title": "Any Service Config",
364
+ "oneOf": [
365
+ {
366
+ "$ref": "#/definitions/storedServiceConfig"
367
+ },
368
+ {
369
+ "$ref": "#/definitions/serviceConfig"
370
+ }
371
+ ]
372
+ },
373
+ "storedServiceMap": {
374
+ "title": "Stored Service Map",
375
+ "type": "object",
376
+ "patternProperties": {
377
+ "[0-9A-Za-z_-]+": {
378
+ "$ref": "#/definitions/storedServiceConfig"
379
+ }
380
+ }
381
+ },
382
+ "workflowStep": {
383
+ "title": "Workflow Step",
384
+ "type": "object",
385
+ "properties": {
386
+ "name": {
387
+ "type": "string",
388
+ "title": "Name",
389
+ "pattern": "^[_a-zA-Z][_a-zA-Z0-9]*$",
390
+ "description": "machine-readable slug"
391
+ },
392
+ "title": {
393
+ "title": "Title",
394
+ "type": "string",
395
+ "description": "Human-readable id for use in the UI"
396
+ },
397
+ "description": {
398
+ "title": "Description",
399
+ "type": "string"
400
+ },
401
+ "color": {
402
+ "title": "Color",
403
+ "type": "string",
404
+ "description": "Hex color code"
405
+ },
406
+ "live": {
407
+ "title": "Live",
408
+ "type": "boolean",
409
+ "description": "Value to indicate whether items in the state should be returned in list queries"
410
+ },
411
+ "key": {
412
+ "title": "Key",
413
+ "type": "string",
414
+ "description": "machine-readable id"
415
+ }
416
+ },
417
+ "required": ["name", "title", "color", "live", "key"],
418
+ "additionalProperties": false
419
+ },
420
+ "workflow": {
421
+ "title": "Workflow",
422
+ "type": "object",
423
+ "properties": {
424
+ "name": {
425
+ "type": "string",
426
+ "pattern": "^[_a-zA-Z][_a-zA-Z0-9]*$",
427
+ "description": "machine-readable id"
428
+ },
429
+ "title": {
430
+ "type": "string",
431
+ "title": "Workflow Name",
432
+ "minLength": 1,
433
+ "description": "Human-readable id for use in the UI"
434
+ },
435
+ "steps": {
436
+ "type": "array",
437
+ "title": "Steps",
438
+ "items": {
439
+ "$ref": "#/definitions/workflowStep"
440
+ },
441
+ "minItems": 1
442
+ }
443
+ },
444
+ "required": ["name", "title", "steps"]
445
+ },
446
+ "workflowMap": {
447
+ "title": "Workflow Map",
448
+ "type": "object",
449
+ "patternProperties": {
450
+ "[0-9A-Za-z_-]+": {"$ref": "#/definitions/workflow"}
451
+ }
452
+ },
453
+ "formConfig": {
454
+ "title": "Form Config",
455
+ "type": "object"
456
+ },
457
+ "formsConfig": {
458
+ "title": "Forms Config",
459
+ "type": "object",
460
+ "properties": {
461
+ "default": {
462
+ "$ref": "#/definitions/formConfig"
463
+ }
464
+ },
465
+ "patternProperties": {
466
+ "[0-9A-Za-z_-]+": {
467
+ "$ref": "#/definitions/formConfig"
468
+ }
469
+ },
470
+ "required": ["default"]
471
+ }
472
+ },
473
+ "properties": {
474
+ "$schema": {
475
+ "type": "string"
476
+ },
477
+ "version": {
478
+ "type": "number",
479
+ "description": "This is the revision number of your schema. Every time your project schema is updated, this value should be incremented."
480
+ },
481
+ "apiVersion": {
482
+ "type": "string",
483
+ "description": "The version of the TakeShape API your project is using. We increase the version as we make breaking changes to the API endpoints."
484
+ },
485
+ "schemaVersion": {
486
+ "type": "string",
487
+ "enum": ["3.1.0"],
488
+ "description": "The version of the schema format your project is using. We increase the version as we make breaking changes to the schema format."
489
+ },
490
+ "projectId": {
491
+ "type": "string",
492
+ "description": "The ID of the TakeShape project this schema belongs to."
493
+ },
494
+ "author": {
495
+ "type": "string",
496
+ "description":"The ID of the TakeShape user who created the schema."
497
+ },
498
+ "created": {
499
+ "type": "string",
500
+ "format": "date-time",
501
+ "description": "The date the schema was created"
502
+ },
503
+ "updated": {
504
+ "type": "string",
505
+ "format": "date-time",
506
+ "description": "The date the schema was last updated"
507
+ },
508
+ "deactivated": {
509
+ "type": "number"
510
+ },
511
+ "defaultLocale": {
512
+ "type": "string",
513
+ "minLength": 1,
514
+ "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{2,3})?$",
515
+ "description": "The locale that should be preferred when creating new Shape items. This must be an entry in the locales array."
516
+ },
517
+ "locales": {
518
+ "type": "array",
519
+ "minItems": 1,
520
+ "items": {
521
+ "type": "string",
522
+ "minLength": 1,
523
+ "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{2,3})?$"
524
+ }
525
+ },
526
+ "queries": {
527
+ "$ref": "https://schema.takeshape.io/project-schema/meta-schema-v3.1.0#/definitions/queryMap",
528
+ "description": "Queries map directly to queries your project's GraphQL API"
529
+ },
530
+ "mutations": {
531
+ "$ref": "https://schema.takeshape.io/project-schema/meta-schema-v3.1.0#/definitions/queryMap",
532
+ "description": "Mutations map directly to mutations your project's GraphQL API"
533
+ },
534
+ "shapes": {
535
+ "$ref": "#/definitions/shapeMap",
536
+ "description": "A Shape is a schema object for structuring and storing data from one or more sources, including the TakeShape data store and connected services."
537
+ },
538
+ "forms": {
539
+ "$ref": "#/definitions/formMap",
540
+ "description": "Forms define a visual interface for editing Shapes in the TakeShape UI."
541
+ },
542
+ "workflows": {
543
+ "$ref": "#/definitions/workflowMap",
544
+ "description": "Workflows describe the status of a shape item. Every schema starts with a default workflow with two steps, Disabled and Enabled"
545
+ },
546
+ "dataKey": {
547
+ "type": "string"
548
+ },
549
+ "services": {
550
+ "$ref": "#/definitions/storedServiceMap",
551
+ "description": "By connecting new Services to your project schema, you can add shapes, queries, and mutations from 3rd party sources to your API in TakeShape. This allows you to mesh together exactly the API you need to interact with all of the services your app or business depends upon. Services use an encrypted configuration to keep auth tokens secret. For this reason, services can only be added to a schema through the web client or through the Admin API."
552
+ }
553
+ },
554
+ "additionalProperties": false,
555
+ "required": [
556
+ "projectId",
557
+ "created",
558
+ "updated",
559
+ "apiVersion",
560
+ "schemaVersion",
561
+ "version",
562
+ "defaultLocale",
563
+ "locales",
564
+ "shapes",
565
+ "queries",
566
+ "mutations",
567
+ "workflows"
568
+ ]
569
+ }