@takeshape/schema 8.145.1 → 8.150.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 (125) hide show
  1. package/dist/builtin-schema.d.ts.map +1 -1
  2. package/dist/builtin-schema.js +17 -0
  3. package/dist/get-is-leaf.d.ts +1 -1
  4. package/dist/get-is-leaf.d.ts.map +1 -1
  5. package/dist/get-is-leaf.js +3 -1
  6. package/dist/migration/index.d.ts +1 -0
  7. package/dist/migration/index.d.ts.map +1 -1
  8. package/dist/migration/index.js +4 -1
  9. package/dist/migration/to/v3.0.0.d.ts.map +1 -1
  10. package/dist/migration/to/v3.18.0.d.ts +5 -0
  11. package/dist/migration/to/v3.18.0.d.ts.map +1 -0
  12. package/dist/migration/to/v3.18.0.js +85 -0
  13. package/dist/mocks.d.ts.map +1 -1
  14. package/dist/mocks.js +4 -2
  15. package/dist/project-schema/index.d.ts +4 -1
  16. package/dist/project-schema/index.d.ts.map +1 -1
  17. package/dist/project-schema/index.js +20 -3
  18. package/dist/project-schema/latest.d.ts +4 -139
  19. package/dist/project-schema/latest.d.ts.map +1 -1
  20. package/dist/project-schema/migrate.d.ts.map +1 -1
  21. package/dist/project-schema/migrate.js +4 -0
  22. package/dist/project-schema/v3.18.0.d.ts +1334 -0
  23. package/dist/project-schema/v3.18.0.d.ts.map +1 -0
  24. package/dist/project-schema/v3.18.0.js +5 -0
  25. package/dist/refs.d.ts +14 -2
  26. package/dist/refs.d.ts.map +1 -1
  27. package/dist/refs.js +26 -0
  28. package/dist/relationships.d.ts +28 -2
  29. package/dist/relationships.d.ts.map +1 -1
  30. package/dist/relationships.js +234 -19
  31. package/dist/rewrite.d.ts.map +1 -1
  32. package/dist/rewrite.js +10 -2
  33. package/dist/schema-util.d.ts +1 -18
  34. package/dist/schema-util.d.ts.map +1 -1
  35. package/dist/schema-util.js +36 -120
  36. package/dist/schemas/index.d.ts +2 -2
  37. package/dist/schemas/index.d.ts.map +1 -1
  38. package/dist/schemas/index.js +6 -4
  39. package/dist/schemas/index.ts +4 -2
  40. package/dist/schemas/project-schema/latest.json +2175 -2195
  41. package/dist/schemas/project-schema/v3.18.0.json +2350 -0
  42. package/dist/schemas/project-schema.json +3 -0
  43. package/dist/template-shapes/templates.d.ts +5 -0
  44. package/dist/template-shapes/templates.d.ts.map +1 -1
  45. package/dist/template-shapes/templates.js +59 -28
  46. package/dist/template-shapes/where.d.ts +3 -4
  47. package/dist/template-shapes/where.d.ts.map +1 -1
  48. package/dist/template-shapes/where.js +32 -26
  49. package/dist/types/types.d.ts +42 -2
  50. package/dist/types/types.d.ts.map +1 -1
  51. package/dist/types/utils.d.ts +2 -0
  52. package/dist/types/utils.d.ts.map +1 -1
  53. package/dist/types/utils.js +9 -1
  54. package/dist/unions.d.ts.map +1 -1
  55. package/dist/unions.js +3 -1
  56. package/dist/util/detect-cycles.d.ts +3 -1
  57. package/dist/util/detect-cycles.d.ts.map +1 -1
  58. package/dist/util/detect-cycles.js +37 -28
  59. package/dist/util/form-config.d.ts +9 -0
  60. package/dist/util/form-config.d.ts.map +1 -0
  61. package/dist/util/form-config.js +97 -0
  62. package/dist/util/index.d.ts +1 -0
  63. package/dist/util/index.d.ts.map +1 -1
  64. package/dist/util/index.js +13 -0
  65. package/dist/validate.d.ts.map +1 -1
  66. package/dist/validate.js +75 -45
  67. package/es/builtin-schema.js +17 -0
  68. package/es/get-is-leaf.js +2 -1
  69. package/es/migration/index.js +3 -1
  70. package/es/migration/to/v3.18.0.js +72 -0
  71. package/es/mocks.js +4 -2
  72. package/es/project-schema/index.js +3 -1
  73. package/es/project-schema/migrate.js +5 -1
  74. package/es/project-schema/v3.18.0.js +1 -0
  75. package/es/refs.js +22 -1
  76. package/es/relationships.js +215 -19
  77. package/es/rewrite.js +10 -2
  78. package/es/schema-util.js +38 -119
  79. package/es/schemas/index.js +4 -3
  80. package/es/schemas/index.ts +4 -2
  81. package/es/schemas/project-schema/latest.json +2175 -2195
  82. package/es/schemas/project-schema/v3.18.0.json +2350 -0
  83. package/es/schemas/project-schema.json +3 -0
  84. package/es/template-shapes/templates.js +55 -29
  85. package/es/template-shapes/where.js +29 -23
  86. package/es/types/utils.js +8 -2
  87. package/es/unions.js +2 -1
  88. package/es/util/detect-cycles.js +36 -28
  89. package/es/util/form-config.js +85 -0
  90. package/es/util/index.js +2 -1
  91. package/es/validate.js +74 -46
  92. package/examples/latest/betzino.json +12383 -6066
  93. package/examples/latest/blog-schema.json +46 -25
  94. package/examples/latest/brewery-schema.json +14 -9
  95. package/examples/latest/complex-project-schema.json +442 -244
  96. package/examples/latest/complex-schema.json +17205 -0
  97. package/examples/latest/fabric-ecommerce.json +2 -2
  98. package/examples/latest/frank-and-fred-schema.json +5141 -2391
  99. package/examples/latest/klirr-schema.json +35445 -0
  100. package/examples/latest/massive-schema.json +1205 -640
  101. package/examples/latest/mill-components-schema.json +241 -113
  102. package/examples/latest/one-earth.json +14429 -0
  103. package/examples/latest/pet-oneof-array.json +2 -2
  104. package/examples/latest/post-schema.json +18 -11
  105. package/examples/latest/pruned-shopify-product-schema.json +2 -2
  106. package/examples/latest/real-world-schema.json +81 -41
  107. package/examples/latest/recursive-repeater-schema.json +14 -9
  108. package/examples/latest/recursive-schema.json +14 -9
  109. package/examples/latest/rick-and-morty-ast.json +138 -80
  110. package/examples/latest/rick-and-morty-graphql.json +78 -45
  111. package/examples/latest/rick-and-morty-rest.json +2 -2
  112. package/examples/latest/schema-with-repeater-draftjs.json +38 -23
  113. package/examples/latest/shape-books-v3_2_0.json +138 -80
  114. package/examples/latest/shape-books.json +138 -80
  115. package/examples/latest/shopify-lookbook.json +30 -16
  116. package/examples/latest/shopify-namespace-schema.json +364 -0
  117. package/examples/latest/shopify-store-with-widget.json +2 -2
  118. package/examples/latest/stripe-starter-resolved.json +14 -8
  119. package/examples/latest/user-schema-no-required.json +2 -2
  120. package/examples/latest/user-schema-with-defaults.json +2 -2
  121. package/examples/source/complex-schema.json +12760 -0
  122. package/examples/source/klirr-schema.json +27716 -0
  123. package/examples/source/one-earth.json +11897 -0
  124. package/examples/source/post-schema.json +0 -1
  125. package/package.json +5 -4
@@ -0,0 +1,364 @@
1
+ {
2
+ "apiVersion": "2",
3
+ "created": "2017-07-13T19:16:10.801Z",
4
+ "dataKey": "AQIDAHhcZWXOdlBglkxBhI23ElO/clC/kuw5ynjXDSqJgfTz8gFvrYhMK581OOYYSjJNwit9AAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMPLnOWQxVHD5AzgXdAgEQgDu0ANKQTBQ7dNFJEQcd2aOfZncgw7DjUasC+7Yp2ci0Y2+ZmbbtIa2kcHBt8eriFPR28uwgnvDzn8t6Qw==",
5
+ "defaultLocale": "en",
6
+ "forms": {
7
+ "Post": {
8
+ "default": {
9
+ "order": [
10
+ "title",
11
+ "body",
12
+ "rating",
13
+ "tags"
14
+ ]
15
+ }
16
+ },
17
+ "Tag": {
18
+ "default": {
19
+ "order": [
20
+ "name"
21
+ ]
22
+ }
23
+ }
24
+ },
25
+ "locales": [
26
+ "en"
27
+ ],
28
+ "projectId": "a4affe2b-9b02-4c37-a5b3-73bf17df41e6",
29
+ "services": {
30
+ "shopify:seans-store-takeshape": {
31
+ "title": "seans-store-takeshape",
32
+ "id": "shopify:seans-store-takeshape",
33
+ "provider": "shopify",
34
+ "namespace": "Shopify",
35
+ "serviceType": "graphql",
36
+ "authenticationType": "oauth2Bearer",
37
+ "options": {
38
+ "authHeader": "X-Shopify-Access-Token",
39
+ "endpoint": "https://seans-store-takeshape.myshopify.com/admin/api/2020-07/graphql.json",
40
+ "namespace": "Shopify",
41
+ "shop": "seans-store-takeshape",
42
+ "type": "graphql"
43
+ },
44
+ "authentication": "abc"
45
+ }
46
+ },
47
+ "updated": "2018-09-08T20:16:45.814Z",
48
+ "version": 1,
49
+ "workflows": {},
50
+ "queries": {
51
+ "getPost": {
52
+ "args": "TSGetArgs<Post>",
53
+ "description": "Get a Post by ID",
54
+ "resolver": {
55
+ "name": "takeshape:get",
56
+ "service": "takeshape:local",
57
+ "options": {},
58
+ "shapeName": "Post"
59
+ },
60
+ "shape": "Post"
61
+ },
62
+ "getPostList": {
63
+ "args": "TSListArgs<Post>",
64
+ "description": "Returns a list Post in natural order.",
65
+ "resolver": {
66
+ "name": "takeshape:list",
67
+ "service": "takeshape:local",
68
+ "options": {},
69
+ "shapeName": "Post"
70
+ },
71
+ "shape": "PaginatedList<Post>"
72
+ },
73
+ "getProduct": {
74
+ "args": {
75
+ "properties": {
76
+ "id": {
77
+ "@tag": "id",
78
+ "type": "string"
79
+ }
80
+ },
81
+ "required": [
82
+ "id"
83
+ ],
84
+ "type": "object"
85
+ },
86
+ "query": "product",
87
+ "resolver": {
88
+ "name": "graphql:query",
89
+ "service": "shopify:seans-store-takeshape",
90
+ "fieldName": ""
91
+ },
92
+ "shape": "TSShopify_Product"
93
+ },
94
+ "getProductList": {
95
+ "args": {
96
+ "properties": {
97
+ "after": {
98
+ "description": "Returns the elements that come after the specified cursor.",
99
+ "type": "string"
100
+ },
101
+ "before": {
102
+ "description": "Returns the elements that come before the specified cursor.",
103
+ "type": "string"
104
+ },
105
+ "first": {
106
+ "description": "Returns up to the first `n` elements from the list.",
107
+ "type": "integer"
108
+ },
109
+ "last": {
110
+ "description": "Returns up to the last `n` elements from the list.",
111
+ "type": "integer"
112
+ },
113
+ "query": {
114
+ "description": "Supported filter parameters:\n - `barcode`\n - `created_at`\n - `delivery_profile_id`\n - `error_feedback`\n - `gift_card`\n - `inventory_total`\n - `is_price_reduced`\n - `out_of_stock_somewhere`\n - `price`\n - `product_type`\n - `publishable_status`\n - `published_status`\n - `sku`\n - `status`\n - `tag`\n - `title`\n - `updated_at`\n - `vendor`\n\nSee the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax)\nfor more information about using filters.",
115
+ "type": "string"
116
+ },
117
+ "reverse": {
118
+ "description": "Reverse the order of the underlying list.",
119
+ "type": "boolean"
120
+ },
121
+ "savedSearchId": {
122
+ "@tag": "id",
123
+ "description": "ID of an existing saved search.\nThe search’s query string is used as the query argument.",
124
+ "type": "string"
125
+ },
126
+ "sortKey": {
127
+ "description": "Sort the underlying list by the given key.",
128
+ "enum": [
129
+ "TITLE",
130
+ "PRODUCT_TYPE",
131
+ "VENDOR",
132
+ "INVENTORY_TOTAL",
133
+ "UPDATED_AT",
134
+ "CREATED_AT",
135
+ "PUBLISHED_AT",
136
+ "ID",
137
+ "RELEVANCE"
138
+ ]
139
+ }
140
+ },
141
+ "type": "object"
142
+ },
143
+ "query": "products",
144
+ "resolver": {
145
+ "name": "graphql:query",
146
+ "service": "shopify:seans-store-takeshape",
147
+ "fieldName": ""
148
+ },
149
+ "shape": "TSShopify_ProductConnection"
150
+ },
151
+ "getTag": {
152
+ "args": "TSGetArgs<Tag>",
153
+ "description": "Get a Tag by ID",
154
+ "resolver": {
155
+ "name": "takeshape:get",
156
+ "service": "takeshape:local",
157
+ "options": {},
158
+ "shapeName": "Tag"
159
+ },
160
+ "shape": "Tag"
161
+ },
162
+ "getTagList": {
163
+ "args": "TSListArgs<Tag>",
164
+ "description": "Returns a list Tag in natural order.",
165
+ "resolver": {
166
+ "name": "takeshape:list",
167
+ "service": "takeshape:local",
168
+ "options": {},
169
+ "shapeName": "Tag"
170
+ },
171
+ "shape": "PaginatedList<Tag>"
172
+ }
173
+ },
174
+ "mutations": {
175
+ "createPost": {
176
+ "args": "CreateArgs<Post>",
177
+ "description": "Create Post",
178
+ "resolver": {
179
+ "name": "takeshape:create",
180
+ "service": "takeshape:local",
181
+ "options": {},
182
+ "shapeName": "Post"
183
+ },
184
+ "shape": "CreateResult<Post>"
185
+ },
186
+ "createProduct": {
187
+ "args": {
188
+ "properties": {
189
+ "input": {
190
+ "$ref": "#/shapes/TSShopify_ProductInput/schema"
191
+ }
192
+ },
193
+ "required": [
194
+ "input"
195
+ ],
196
+ "type": "object"
197
+ },
198
+ "query": "productCreate",
199
+ "resolver": {
200
+ "name": "graphql:mutation",
201
+ "service": "shopify:seans-store-takeshape",
202
+ "fieldName": ""
203
+ },
204
+ "shape": "TSShopify_ProductCreatePayload"
205
+ },
206
+ "createTag": {
207
+ "args": "CreateArgs<Tag>",
208
+ "description": "Create Tag",
209
+ "resolver": {
210
+ "name": "takeshape:create",
211
+ "service": "takeshape:local",
212
+ "options": {},
213
+ "shapeName": "Tag"
214
+ },
215
+ "shape": "CreateResult<Tag>"
216
+ },
217
+ "deletePost": {
218
+ "args": "DeleteArgs<Post>",
219
+ "description": "Delete Post",
220
+ "resolver": {
221
+ "name": "takeshape:delete",
222
+ "service": "takeshape:local",
223
+ "options": {},
224
+ "shapeName": "Post"
225
+ },
226
+ "shape": "DeleteResult<Post>"
227
+ },
228
+ "deleteTag": {
229
+ "args": "DeleteArgs<Tag>",
230
+ "description": "Delete Tag",
231
+ "resolver": {
232
+ "name": "takeshape:delete",
233
+ "service": "takeshape:local",
234
+ "options": {},
235
+ "shapeName": "Tag"
236
+ },
237
+ "shape": "DeleteResult<Tag>"
238
+ },
239
+ "duplicatePost": {
240
+ "args": "DuplicateArgs<Post>",
241
+ "description": "Duplicate Post",
242
+ "resolver": {
243
+ "name": "takeshape:duplicate",
244
+ "service": "takeshape:local",
245
+ "options": {},
246
+ "shapeName": "Post"
247
+ },
248
+ "shape": "DuplicateResult<Post>"
249
+ },
250
+ "duplicateTag": {
251
+ "args": "DuplicateArgs<Tag>",
252
+ "description": "Duplicate Tag",
253
+ "resolver": {
254
+ "name": "takeshape:duplicate",
255
+ "service": "takeshape:local",
256
+ "options": {},
257
+ "shapeName": "Tag"
258
+ },
259
+ "shape": "DuplicateResult<Tag>"
260
+ },
261
+ "updatePost": {
262
+ "args": "UpdateArgs<Post>",
263
+ "description": "Update Post",
264
+ "resolver": {
265
+ "name": "takeshape:update",
266
+ "service": "takeshape:local",
267
+ "options": {},
268
+ "shapeName": "Post"
269
+ },
270
+ "shape": "UpdateResult<Post>"
271
+ },
272
+ "updateTag": {
273
+ "args": "UpdateArgs<Tag>",
274
+ "description": "Update Tag",
275
+ "resolver": {
276
+ "name": "takeshape:update",
277
+ "service": "takeshape:local",
278
+ "options": {},
279
+ "shapeName": "Tag"
280
+ },
281
+ "shape": "UpdateResult<Tag>"
282
+ }
283
+ },
284
+ "shapes": {
285
+ "Post": {
286
+ "id": "postContentTypeId",
287
+ "model": {
288
+ "type": "multiple"
289
+ },
290
+ "name": "Post",
291
+ "title": "Post",
292
+ "schema": {
293
+ "properties": {
294
+ "body": {
295
+ "@l10n": true,
296
+ "@mapping": "takeshape:local:Post.bodyId",
297
+ "type": "string"
298
+ },
299
+ "productId": {
300
+ "@mapping": "takeshape:local:Post.productId",
301
+ "@tag": "id",
302
+ "type": "string"
303
+ },
304
+ "rating": {
305
+ "@mapping": "takeshape:local:Post.ratingId",
306
+ "type": "integer"
307
+ },
308
+ "tags": {
309
+ "@mapping": "takeshape:local:Post.tagsId",
310
+ "items": {
311
+ "oneOf": [
312
+ {
313
+ "@ref": "local:Tag"
314
+ }
315
+ ]
316
+ },
317
+ "@backreference": {
318
+ "enabled": true,
319
+ "name": "firstTags"
320
+ },
321
+ "type": "array",
322
+ "@input": {
323
+ "@ref": "local:TSRelationship"
324
+ },
325
+ "@resolver": {
326
+ "name": "takeshape:getRelated",
327
+ "service": "takeshape:local"
328
+ }
329
+ },
330
+ "title": {
331
+ "@l10n": true,
332
+ "@mapping": "takeshape:local:Post.titleId",
333
+ "type": "string"
334
+ }
335
+ },
336
+ "required": [
337
+ "title"
338
+ ],
339
+ "type": "object"
340
+ }
341
+ },
342
+ "Tag": {
343
+ "id": "tagContentTypeId",
344
+ "model": {
345
+ "type": "taxonomy"
346
+ },
347
+ "name": "Tag",
348
+ "title": "Tag",
349
+ "schema": {
350
+ "properties": {
351
+ "name": {
352
+ "@mapping": "takeshape:local:Tag.nameId",
353
+ "type": "string"
354
+ }
355
+ },
356
+ "required": [
357
+ "name"
358
+ ],
359
+ "type": "object"
360
+ }
361
+ }
362
+ },
363
+ "schemaVersion": "3.18.0"
364
+ }
@@ -12594,5 +12594,5 @@
12594
12594
  }
12595
12595
  }
12596
12596
  },
12597
- "schemaVersion": "3.17.1"
12598
- }
12597
+ "schemaVersion": "3.18.0"
12598
+ }
@@ -1896,16 +1896,22 @@
1896
1896
  },
1897
1897
  "avatar": {
1898
1898
  "description": "",
1899
- "$ref": "#/shapes/TSRelationship/schema",
1900
- "@relationship": {
1901
- "shapeIds": [
1902
- "ASSET"
1903
- ]
1904
- },
1905
1899
  "title": "Avatar",
1906
1900
  "@mapping": "takeshape:local:Profile.k0Ha4O7oV",
1907
1901
  "@backreference": {
1908
1902
  "enabled": true
1903
+ },
1904
+ "@ref": "local:Asset",
1905
+ "@input": {
1906
+ "@ref": "local:TSRelationship"
1907
+ },
1908
+ "@args": "TSRelationshipArgs",
1909
+ "@resolver": {
1910
+ "name": "takeshape:getRelated",
1911
+ "service": "takeshape:local",
1912
+ "options": {
1913
+ "nullable": true
1914
+ }
1909
1915
  }
1910
1916
  },
1911
1917
  "stripeCustomerId": {
@@ -29351,5 +29357,5 @@
29351
29357
  }
29352
29358
  }
29353
29359
  },
29354
- "schemaVersion": "3.17.1"
29355
- }
29360
+ "schemaVersion": "3.18.0"
29361
+ }
@@ -169,6 +169,6 @@
169
169
  }
170
170
  }
171
171
  },
172
- "schemaVersion": "3.17.1",
172
+ "schemaVersion": "3.18.0",
173
173
  "services": {}
174
- }
174
+ }
@@ -194,6 +194,6 @@
194
194
  }
195
195
  }
196
196
  },
197
- "schemaVersion": "3.17.1",
197
+ "schemaVersion": "3.18.0",
198
198
  "services": {}
199
- }
199
+ }