@takeshape/schema 8.16.0 → 8.20.2

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 (117) hide show
  1. package/es/enum.js +1 -1
  2. package/es/get-is-leaf.js +5 -5
  3. package/es/layers/type-utils.js +2 -2
  4. package/es/migration.js +59 -1
  5. package/es/project-schema/index.js +1 -0
  6. package/es/project-schema/v3.10.0.js +1 -0
  7. package/es/refs.js +19 -19
  8. package/es/schema-util.js +7 -7
  9. package/es/schemas/index.js +15 -15
  10. package/es/schemas/index.ts +26 -25
  11. package/es/schemas/project-schema/v3.10.0.json +2091 -0
  12. package/es/schemas/project-schema/v4.0.0.json +8 -6
  13. package/es/schemas/project-schema.json +2 -1
  14. package/es/types/types.js +1 -1
  15. package/es/types/utils.js +20 -19
  16. package/es/util/detect-cycles.js +1 -1
  17. package/es/validate.js +10 -7
  18. package/examples/latest/blog-schema.json +32 -32
  19. package/examples/latest/brewery-schema.json +53 -53
  20. package/examples/latest/complex-project-schema.json +3278 -3278
  21. package/examples/latest/fabric-ecommerce.json +130 -130
  22. package/examples/latest/frank-and-fred-schema.json +15588 -15588
  23. package/examples/latest/massive-schema.json +5836 -5836
  24. package/examples/latest/mill-components-schema.json +876 -876
  25. package/examples/latest/pet-oneof-array.json +77 -77
  26. package/examples/latest/post-schema.json +23 -23
  27. package/examples/latest/pruned-shopify-product-schema.json +19 -19
  28. package/examples/latest/real-world-schema.json +166 -166
  29. package/examples/latest/recursive-repeater-schema.json +14 -14
  30. package/examples/latest/recursive-schema.json +14 -14
  31. package/examples/latest/rick-and-morty-ast.json +1875 -1896
  32. package/examples/latest/rick-and-morty-graphql.json +1093 -1093
  33. package/examples/latest/rick-and-morty-rest.json +20 -20
  34. package/examples/latest/schema-with-repeater-draftjs.json +9 -9
  35. package/examples/latest/shape-books-v3_2_0.json +218 -218
  36. package/examples/latest/shape-books.json +218 -218
  37. package/examples/latest/shopify-lookbook.json +147 -147
  38. package/examples/latest/shopify-store-with-widget.json +10420 -10420
  39. package/examples/latest/stripe-starter-resolved.json +1018 -1018
  40. package/examples/latest/user-schema-no-required.json +19 -19
  41. package/examples/latest/user-schema-with-defaults.json +20 -20
  42. package/examples/source/rick-and-morty-ast.json +0 -21
  43. package/lib/content-schema-transform.d.ts +13 -13
  44. package/lib/content-schema-transform.d.ts.map +1 -1
  45. package/lib/enum.d.ts +2 -2
  46. package/lib/enum.d.ts.map +1 -1
  47. package/lib/enum.js +2 -2
  48. package/lib/get-is-leaf.d.ts +2 -2
  49. package/lib/get-is-leaf.d.ts.map +1 -1
  50. package/lib/get-is-leaf.js +5 -5
  51. package/lib/layers/type-utils.js +1 -1
  52. package/lib/migration.d.ts +6 -5
  53. package/lib/migration.d.ts.map +1 -1
  54. package/lib/migration.js +60 -0
  55. package/lib/project-schema/index.d.ts +3 -1
  56. package/lib/project-schema/index.d.ts.map +1 -1
  57. package/lib/project-schema/index.js +25 -12
  58. package/lib/project-schema/latest.d.ts +260 -238
  59. package/lib/project-schema/latest.d.ts.map +1 -1
  60. package/lib/project-schema/v1.0.0.d.ts +14 -7
  61. package/lib/project-schema/v1.0.0.d.ts.map +1 -1
  62. package/lib/project-schema/v3.0.0.d.ts +24 -25
  63. package/lib/project-schema/v3.0.0.d.ts.map +1 -1
  64. package/lib/project-schema/v3.1.0.d.ts +42 -43
  65. package/lib/project-schema/v3.1.0.d.ts.map +1 -1
  66. package/lib/project-schema/v3.10.0.d.ts +1202 -0
  67. package/lib/project-schema/v3.10.0.d.ts.map +1 -0
  68. package/lib/project-schema/v3.10.0.js +5 -0
  69. package/lib/project-schema/v3.2.0.d.ts +42 -43
  70. package/lib/project-schema/v3.2.0.d.ts.map +1 -1
  71. package/lib/project-schema/v3.3.0.d.ts +42 -43
  72. package/lib/project-schema/v3.3.0.d.ts.map +1 -1
  73. package/lib/project-schema/v3.4.0.d.ts +42 -43
  74. package/lib/project-schema/v3.4.0.d.ts.map +1 -1
  75. package/lib/project-schema/v3.5.0.d.ts +42 -43
  76. package/lib/project-schema/v3.5.0.d.ts.map +1 -1
  77. package/lib/project-schema/v3.5.1.d.ts +42 -43
  78. package/lib/project-schema/v3.5.1.d.ts.map +1 -1
  79. package/lib/project-schema/v3.6.0.d.ts +42 -43
  80. package/lib/project-schema/v3.6.0.d.ts.map +1 -1
  81. package/lib/project-schema/v3.7.0.d.ts +42 -43
  82. package/lib/project-schema/v3.7.0.d.ts.map +1 -1
  83. package/lib/project-schema/v3.8.0.d.ts +42 -43
  84. package/lib/project-schema/v3.8.0.d.ts.map +1 -1
  85. package/lib/project-schema/v3.9.0.d.ts +42 -43
  86. package/lib/project-schema/v3.9.0.d.ts.map +1 -1
  87. package/lib/project-schema/v4.0.0.d.ts +54 -52
  88. package/lib/project-schema/v4.0.0.d.ts.map +1 -1
  89. package/lib/refs.d.ts +8 -8
  90. package/lib/refs.d.ts.map +1 -1
  91. package/lib/refs.js +19 -19
  92. package/lib/schema-util.d.ts +23 -23
  93. package/lib/schema-util.d.ts.map +1 -1
  94. package/lib/schema-util.js +7 -7
  95. package/lib/schemas/index.d.ts +3421 -3420
  96. package/lib/schemas/index.d.ts.map +1 -1
  97. package/lib/schemas/index.js +26 -30
  98. package/lib/schemas/index.ts +26 -25
  99. package/lib/schemas/project-schema/v3.10.0.json +2091 -0
  100. package/lib/schemas/project-schema/v4.0.0.json +8 -6
  101. package/lib/schemas/project-schema.json +2 -1
  102. package/lib/types/types.d.ts +8 -7
  103. package/lib/types/types.d.ts.map +1 -1
  104. package/lib/types/types.js +1 -1
  105. package/lib/types/utils.d.ts +9 -8
  106. package/lib/types/utils.d.ts.map +1 -1
  107. package/lib/types/utils.js +25 -23
  108. package/lib/unions.d.ts +8 -8
  109. package/lib/unions.d.ts.map +1 -1
  110. package/lib/util/detect-cycles.d.ts +2 -2
  111. package/lib/util/detect-cycles.d.ts.map +1 -1
  112. package/lib/util/detect-cycles.js +1 -1
  113. package/lib/validate.d.ts.map +1 -1
  114. package/lib/validate.js +9 -6
  115. package/lib/workflows.d.ts +2 -2
  116. package/lib/workflows.d.ts.map +1 -1
  117. package/package.json +5 -5
@@ -9,635 +9,845 @@
9
9
  "locales": [
10
10
  "en-us"
11
11
  ],
12
- "schemaVersion": "3.9.0",
13
- "queries": {
14
- "getAsset": {
15
- "shape": "Asset",
16
- "resolver": {
17
- "name": "takeshape:get",
18
- "service": "takeshape:local",
19
- "options": {},
20
- "shapeName": "Asset"
21
- },
22
- "description": "Get a Asset by ID",
23
- "args": "TSGetArgs<Asset>"
24
- },
25
- "getAssetList": {
26
- "shape": "PaginatedList<Asset>",
27
- "resolver": {
28
- "name": "takeshape:list",
29
- "service": "takeshape:local",
30
- "options": {},
31
- "shapeName": "Asset"
32
- },
33
- "description": "Returns a list Asset in natural order.",
34
- "args": "TSListArgs<Asset>"
35
- },
36
- "getTsStaticSite": {
37
- "shape": "TsStaticSite",
38
- "resolver": {
39
- "name": "takeshape:get",
40
- "service": "takeshape:local",
41
- "options": {},
42
- "shapeName": "TsStaticSite"
43
- },
44
- "description": "Get a TsStaticSite by ID",
45
- "args": "TSGetArgs<TsStaticSite>"
46
- },
47
- "getTsStaticSiteList": {
48
- "shape": "PaginatedList<TsStaticSite>",
49
- "resolver": {
50
- "name": "takeshape:list",
51
- "service": "takeshape:local",
52
- "options": {},
53
- "shapeName": "TsStaticSite"
54
- },
55
- "description": "Returns a list TsStaticSite in natural order.",
56
- "args": "TSListArgs<TsStaticSite>"
57
- },
58
- "getMyProfile": {
59
- "shape": "Profile",
60
- "resolver": {
61
- "name": "takeshape:find",
62
- "service": "takeshape:local",
63
- "options": {},
64
- "argsMapping": {
65
- "where.id.eq": [
66
- [
67
- "get",
68
- {
69
- "path": "claims.sub"
70
- }
71
- ]
72
- ]
12
+ "workflows": {
13
+ "default": {
14
+ "name": "default",
15
+ "title": "Default",
16
+ "steps": [
17
+ {
18
+ "name": "disabled",
19
+ "title": "Disabled",
20
+ "key": "r1uCfi4ZL",
21
+ "color": "#bdbdbd",
22
+ "live": false
73
23
  },
74
- "shapeName": "Profile"
75
- },
76
- "description": "Get my Profile"
77
- },
78
- "getMySubscriptions": {
79
- "shape": {
80
- "type": "array",
81
- "items": {
82
- "@ref": "stripe:Subscription"
24
+ {
25
+ "name": "enabled",
26
+ "title": "Enabled",
27
+ "key": "rkhRGs4WL",
28
+ "color": "#5cd79b",
29
+ "live": true
83
30
  }
84
- },
85
- "resolver": {
86
- "resultsMapping": [
87
- [
88
- "get",
89
- {
90
- "path": "steps.subscriptions.data"
91
- }
92
- ]
31
+ ]
32
+ }
33
+ },
34
+ "forms": {
35
+ "Asset": {
36
+ "default": {
37
+ "order": [
38
+ "title",
39
+ "description",
40
+ "caption",
41
+ "credit",
42
+ "filename",
43
+ "path",
44
+ "mimeType",
45
+ "sourceUrl",
46
+ "uploadStatus"
93
47
  ],
94
- "compose": [
95
- {
96
- "if": "!isEmpty(claims.sub)",
97
- "id": "profile",
98
- "name": "takeshape:find",
99
- "service": "takeshape:local",
100
- "options": {},
101
- "argsMapping": {
102
- "where.id.eq": [
103
- [
104
- "get",
105
- {
106
- "path": "claims.sub"
107
- }
108
- ]
109
- ]
110
- },
111
- "shapeName": "Profile"
48
+ "properties": {
49
+ "title": {
50
+ "widget": "singleLineText",
51
+ "disabled": true
112
52
  },
113
- {
114
- "if": "!isEmpty(steps.profile.stripeCustomerId)",
115
- "id": "subscriptions",
116
- "name": "rest:get",
117
- "service": "stripe",
118
- "options": {},
119
- "searchParamsMapping": [
120
- [
121
- "expand[]",
122
- [
123
- [
124
- "set",
125
- {
126
- "value": "data.items"
127
- }
128
- ]
129
- ]
130
- ],
131
- [
132
- "expand[]",
133
- [
134
- [
135
- "set",
136
- {
137
- "value": "data.plan.product"
138
- }
139
- ]
140
- ]
141
- ],
142
- [
143
- "expand[]",
144
- [
145
- [
146
- "set",
147
- {
148
- "value": "data.latest_invoice.payment_intent"
149
- }
150
- ]
151
- ]
152
- ],
153
- [
154
- "customer",
155
- [
156
- [
157
- "get",
158
- {
159
- "path": "steps.profile.stripeCustomerId"
160
- }
161
- ]
162
- ]
163
- ]
164
- ],
165
- "path": "/v1/subscriptions"
53
+ "description": {
54
+ "widget": "paragraphText",
55
+ "disabled": true
56
+ },
57
+ "caption": {
58
+ "widget": "wysiwygSingleLineText",
59
+ "disabled": true
60
+ },
61
+ "credit": {
62
+ "widget": "wysiwygSingleLineText",
63
+ "disabled": true
64
+ },
65
+ "filename": {
66
+ "widget": "singleLineText",
67
+ "disabled": true
68
+ },
69
+ "path": {
70
+ "widget": "singleLineText",
71
+ "disabled": true
72
+ },
73
+ "mimeType": {
74
+ "widget": "singleLineText",
75
+ "disabled": true
76
+ },
77
+ "sourceUrl": {
78
+ "widget": "singleLineText",
79
+ "disabled": true
80
+ },
81
+ "uploadStatus": {
82
+ "widget": "singleLineText",
83
+ "disabled": true
166
84
  }
167
- ]
168
- },
169
- "description": "Get my subscriptions"
170
- },
171
- "getSubscriptions": {
172
- "shape": {
173
- "type": "array",
174
- "items": {
175
- "@ref": "stripe:Subscription"
176
85
  }
177
- },
178
- "resolver": {
179
- "resultsMapping": [
180
- [
181
- "get",
182
- {
183
- "path": "steps.subscriptions.data"
184
- }
185
- ]
86
+ }
87
+ },
88
+ "TsStaticSite": {
89
+ "default": {
90
+ "order": [
91
+ "title",
92
+ "provider",
93
+ "destination",
94
+ "idKey",
95
+ "secretKey",
96
+ "environmentVariables"
186
97
  ],
187
- "compose": [
188
- {
189
- "id": "subscriptions",
190
- "name": "rest:get",
191
- "service": "stripe",
192
- "options": {},
193
- "searchParamsMapping": [
194
- [
195
- "expand[]",
196
- [
197
- [
198
- "set",
199
- {
200
- "value": "data.items"
201
- }
202
- ]
203
- ]
204
- ],
205
- [
206
- "customer",
207
- [
208
- [
209
- "get",
210
- {
211
- "path": "args.customer"
212
- }
213
- ]
214
- ]
215
- ]
98
+ "properties": {
99
+ "title": {
100
+ "widget": "singleLineText",
101
+ "disabled": true
102
+ },
103
+ "provider": {
104
+ "widget": "dropdown",
105
+ "disabled": true
106
+ },
107
+ "destination": {
108
+ "widget": "singleLineText",
109
+ "instructions": "Deployment Bucket or FTP Host",
110
+ "disabled": true
111
+ },
112
+ "idKey": {
113
+ "widget": "singleLineText",
114
+ "instructions": "AWS Access Key ID or Google Cloud Storage Client Email or FTP Username",
115
+ "disabled": true
116
+ },
117
+ "secretKey": {
118
+ "widget": "sensitiveField",
119
+ "instructions": "AWS Secret Access Key or Google Cloud Storage Private Key or FTP Password",
120
+ "multiline": true,
121
+ "disabled": true
122
+ },
123
+ "environmentVariables": {
124
+ "widget": "repeater",
125
+ "order": [
126
+ "name",
127
+ "value"
216
128
  ],
217
- "path": "/v1/subscriptions"
129
+ "disabled": true,
130
+ "properties": {
131
+ "name": {
132
+ "widget": "singleLineText",
133
+ "disabled": true
134
+ },
135
+ "value": {
136
+ "widget": "singleLineText",
137
+ "disabled": true
138
+ }
139
+ }
218
140
  }
219
- ]
141
+ }
220
142
  },
221
- "description": "Get my subscriptions",
222
- "args": "GetSubscriptionsInput"
223
- },
224
- "getStripeProducts": {
225
- "shape": {
226
- "type": "array",
227
- "items": {
228
- "@ref": "takeshape:local:StripeProductWithPrices"
143
+ "generalHeader": {
144
+ "order": [
145
+ "title",
146
+ "provider",
147
+ "baseUrl"
148
+ ],
149
+ "properties": {
150
+ "title": {
151
+ "widget": "singleLineText",
152
+ "disabled": true
153
+ },
154
+ "provider": {
155
+ "widget": "dropdown",
156
+ "disabled": true
157
+ },
158
+ "baseUrl": {
159
+ "widget": "singleLineText",
160
+ "disabled": true
161
+ }
229
162
  }
230
163
  },
231
- "resolver": {
232
- "resultsMapping": [
233
- [
234
- "expressionEval",
235
- {
236
- "expression": "map(compose(set('prices', placeholder, newObject()), get(placeholder, groupBy('product', steps.prices.data)), get('id')), steps.products.data)"
237
- }
238
- ],
239
- [
240
- "getMultiple",
241
- {
242
- "paths": [
243
- "previousStep",
244
- "steps.products.data"
245
- ]
246
- }
247
- ],
248
- [
249
- "zipAndMerge",
250
- {}
251
- ]
164
+ "generalFooter": {
165
+ "order": [
166
+ "environmentVariables",
167
+ "triggers"
252
168
  ],
253
- "compose": [
254
- {
255
- "id": "products",
256
- "name": "rest:get",
257
- "service": "stripe",
258
- "options": {},
259
- "searchParamsMapping": [
260
- [
261
- "active",
262
- [
263
- [
264
- "set",
265
- {
266
- "value": "true"
267
- }
268
- ]
269
- ]
270
- ]
169
+ "properties": {
170
+ "environmentVariables": {
171
+ "widget": "repeater",
172
+ "order": [
173
+ "name",
174
+ "value"
271
175
  ],
272
- "path": "/v1/products"
176
+ "disabled": true,
177
+ "properties": {
178
+ "name": {
179
+ "widget": "singleLineText",
180
+ "disabled": true
181
+ },
182
+ "value": {
183
+ "widget": "singleLineText",
184
+ "disabled": true
185
+ }
186
+ }
273
187
  },
274
- {
275
- "id": "prices",
276
- "name": "rest:get",
277
- "service": "stripe",
278
- "options": {},
279
- "searchParamsMapping": [
280
- [
281
- "active",
282
- [
283
- [
284
- "set",
285
- {
286
- "value": "true"
287
- }
288
- ]
289
- ]
290
- ]
188
+ "triggers": {
189
+ "widget": "repeater",
190
+ "order": [
191
+ "contentTypeId",
192
+ "status"
291
193
  ],
292
- "path": "/v1/prices"
194
+ "disabled": true,
195
+ "preview": "siteTriggerPreview",
196
+ "properties": {
197
+ "contentTypeId": {
198
+ "widget": "dropdown",
199
+ "disabled": true
200
+ },
201
+ "status": {
202
+ "widget": "dropdown",
203
+ "disabled": true
204
+ }
205
+ }
293
206
  }
294
- ]
295
- },
296
- "description": "Get Stripe products"
297
- },
298
- "getProfile": {
299
- "shape": "Profile",
300
- "resolver": {
301
- "name": "takeshape:get",
302
- "service": "takeshape:local",
303
- "options": {},
304
- "shapeName": "Profile"
305
- },
306
- "description": "Get a Profile by ID",
307
- "args": "TSGetArgs<Profile>"
308
- },
309
- "getProfileList": {
310
- "shape": "PaginatedList<Profile>",
311
- "resolver": {
312
- "name": "takeshape:list",
313
- "service": "takeshape:local",
314
- "options": {},
315
- "shapeName": "Profile"
207
+ }
316
208
  },
317
- "description": "Returns a list Profile in natural order.",
318
- "args": "TSListArgs<Profile>"
319
- }
320
- },
321
- "mutations": {
322
- "updateAsset": {
323
- "shape": "UpdateResult<Asset>",
324
- "resolver": {
325
- "name": "takeshape:update",
326
- "service": "takeshape:local",
327
- "options": {},
328
- "shapeName": "Asset"
209
+ "s3": {
210
+ "order": [
211
+ "destination",
212
+ "idKey",
213
+ "secretKey",
214
+ "privateAcl"
215
+ ],
216
+ "properties": {
217
+ "destination": {
218
+ "widget": "singleLineText",
219
+ "instructions": "Deployment Bucket Name",
220
+ "disabled": true
221
+ },
222
+ "idKey": {
223
+ "widget": "singleLineText",
224
+ "instructions": "AWS Access Key ID",
225
+ "disabled": true
226
+ },
227
+ "secretKey": {
228
+ "widget": "sensitiveField",
229
+ "instructions": "AWS Secret Access Key",
230
+ "multiline": true,
231
+ "disabled": true
232
+ },
233
+ "privateAcl": {
234
+ "widget": "checkbox",
235
+ "instructions": "Disable public access to deployed files. This is useful when fronting S3 with CloudFront or with \"Block All Public Access\"",
236
+ "disabled": true
237
+ }
238
+ }
329
239
  },
330
- "description": "Update Asset",
331
- "args": "UpdateArgs<Asset>"
332
- },
333
- "createAsset": {
334
- "shape": "CreateResult<Asset>",
335
- "resolver": {
336
- "name": "takeshape:create",
337
- "service": "takeshape:local",
338
- "options": {},
339
- "shapeName": "Asset"
240
+ "gcs": {
241
+ "order": [
242
+ "destination",
243
+ "idKey",
244
+ "secretKey",
245
+ "privateAcl"
246
+ ],
247
+ "properties": {
248
+ "destination": {
249
+ "widget": "singleLineText",
250
+ "instructions": "Deployment Bucket Name",
251
+ "disabled": true
252
+ },
253
+ "idKey": {
254
+ "widget": "singleLineText",
255
+ "instructions": "Google Cloud Storage Client Email",
256
+ "disabled": true
257
+ },
258
+ "secretKey": {
259
+ "widget": "sensitiveField",
260
+ "instructions": "Google Cloud Storage Private Key",
261
+ "multiline": true,
262
+ "disabled": true
263
+ },
264
+ "privateAcl": {
265
+ "widget": "checkbox",
266
+ "instructions": "Disable public access to deployed files.",
267
+ "disabled": true
268
+ }
269
+ }
340
270
  },
341
- "description": "Create Asset",
342
- "args": "CreateArgs<Asset>"
271
+ "ftp": {
272
+ "order": [
273
+ "destination",
274
+ "idKey",
275
+ "secretKey"
276
+ ],
277
+ "properties": {
278
+ "destination": {
279
+ "widget": "singleLineText",
280
+ "instructions": "FTP Host",
281
+ "disabled": true
282
+ },
283
+ "idKey": {
284
+ "widget": "singleLineText",
285
+ "instructions": "FTP Username",
286
+ "disabled": true
287
+ },
288
+ "secretKey": {
289
+ "widget": "sensitiveField",
290
+ "instructions": "FTP Password",
291
+ "multiline": true,
292
+ "disabled": true
293
+ }
294
+ }
295
+ },
296
+ "azure": {
297
+ "order": [
298
+ "destination",
299
+ "secretKey"
300
+ ],
301
+ "properties": {
302
+ "destination": {
303
+ "widget": "singleLineText",
304
+ "instructions": "Storage Account Name",
305
+ "disabled": true
306
+ },
307
+ "secretKey": {
308
+ "widget": "sensitiveField",
309
+ "instructions": "Access key",
310
+ "multiline": true,
311
+ "disabled": true
312
+ }
313
+ }
314
+ },
315
+ "netlify": {
316
+ "order": [
317
+ "destination"
318
+ ],
319
+ "properties": {
320
+ "destination": {
321
+ "widget": "publishTargets",
322
+ "itemTemplate": "siteDropdownItem",
323
+ "instructions": "Choose existing or create a new site.",
324
+ "disabled": true
325
+ }
326
+ }
327
+ },
328
+ "vercel": {
329
+ "order": [
330
+ "destination"
331
+ ],
332
+ "properties": {
333
+ "destination": {
334
+ "widget": "publishTargets",
335
+ "itemTemplate": "siteDropdownItem",
336
+ "instructions": "Choose existing or create a new project.",
337
+ "disabled": true
338
+ }
339
+ }
340
+ }
343
341
  },
344
- "duplicateAsset": {
345
- "shape": "DuplicateResult<Asset>",
342
+ "Profile": {
343
+ "default": {
344
+ "properties": {
345
+ "id": {
346
+ "widget": "singleLineText"
347
+ },
348
+ "firstName": {
349
+ "widget": "singleLineText"
350
+ },
351
+ "lastName": {
352
+ "widget": "singleLineText"
353
+ },
354
+ "email": {
355
+ "widget": "singleLineText"
356
+ },
357
+ "bio": {
358
+ "widget": "paragraphText"
359
+ },
360
+ "avatar": {
361
+ "widget": "image"
362
+ },
363
+ "stripeCustomerId": {
364
+ "widget": "singleLineText"
365
+ }
366
+ },
367
+ "order": [
368
+ "id",
369
+ "firstName",
370
+ "lastName",
371
+ "email",
372
+ "bio",
373
+ "avatar",
374
+ "stripeCustomerId"
375
+ ]
376
+ }
377
+ }
378
+ },
379
+ "services": {
380
+ "auth-0": {
381
+ "id": "auth-0",
382
+ "provider": "auth0",
383
+ "title": "auth0",
384
+ "serviceType": "authentication",
385
+ "authenticationType": "none",
386
+ "options": {
387
+ "domain": "dev-by9w1mxg.us.auth0.com",
388
+ "audience": "https://api.takeshape.io/project/79b5254d-5bc3-4034-8b05-e9c2f097de5a/auth-0"
389
+ }
390
+ },
391
+ "stripe": {
392
+ "id": "stripe",
393
+ "provider": "stripe",
394
+ "title": "Stripe",
395
+ "namespace": "Stripe",
396
+ "serviceType": "openapi",
397
+ "authenticationType": "bearer",
398
+ "authentication": "supersecret",
399
+ "options": {
400
+ "endpoint": "https://api.stripe.com/",
401
+ "spec": "https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json"
402
+ }
403
+ }
404
+ },
405
+ "queries": {
406
+ "getAsset": {
407
+ "shape": "Asset",
346
408
  "resolver": {
347
- "name": "takeshape:duplicate",
409
+ "name": "takeshape:get",
348
410
  "service": "takeshape:local",
349
411
  "options": {},
350
412
  "shapeName": "Asset"
351
413
  },
352
- "description": "Duplicate Asset",
353
- "args": "DuplicateArgs<Asset>"
414
+ "description": "Get a Asset by ID",
415
+ "args": "TSGetArgs<Asset>"
354
416
  },
355
- "deleteAsset": {
356
- "shape": "DeleteResult<Asset>",
417
+ "getAssetList": {
418
+ "shape": "PaginatedList<Asset>",
357
419
  "resolver": {
358
- "name": "takeshape:delete",
420
+ "name": "takeshape:list",
359
421
  "service": "takeshape:local",
360
422
  "options": {},
361
423
  "shapeName": "Asset"
362
424
  },
363
- "description": "Delete Asset",
364
- "args": "DeleteArgs<Asset>"
425
+ "description": "Returns a list Asset in natural order.",
426
+ "args": "TSListArgs<Asset>"
365
427
  },
366
- "updateTsStaticSite": {
367
- "shape": "UpdateResult<TsStaticSite>",
428
+ "getTsStaticSite": {
429
+ "shape": "TsStaticSite",
368
430
  "resolver": {
369
- "name": "takeshape:update",
431
+ "name": "takeshape:get",
370
432
  "service": "takeshape:local",
371
433
  "options": {},
372
434
  "shapeName": "TsStaticSite"
373
435
  },
374
- "description": "Update TsStaticSite",
375
- "args": "UpdateArgs<TsStaticSite>"
436
+ "description": "Get a TsStaticSite by ID",
437
+ "args": "TSGetArgs<TsStaticSite>"
376
438
  },
377
- "createTsStaticSite": {
378
- "shape": "CreateResult<TsStaticSite>",
439
+ "getTsStaticSiteList": {
440
+ "shape": "PaginatedList<TsStaticSite>",
379
441
  "resolver": {
380
- "name": "takeshape:create",
442
+ "name": "takeshape:list",
381
443
  "service": "takeshape:local",
382
444
  "options": {},
383
445
  "shapeName": "TsStaticSite"
384
446
  },
385
- "description": "Create TsStaticSite",
386
- "args": "CreateArgs<TsStaticSite>"
447
+ "description": "Returns a list TsStaticSite in natural order.",
448
+ "args": "TSListArgs<TsStaticSite>"
387
449
  },
388
- "duplicateTsStaticSite": {
389
- "shape": "DuplicateResult<TsStaticSite>",
450
+ "getMyProfile": {
451
+ "shape": "Profile",
390
452
  "resolver": {
391
- "name": "takeshape:duplicate",
453
+ "name": "takeshape:find",
392
454
  "service": "takeshape:local",
393
455
  "options": {},
394
- "shapeName": "TsStaticSite"
456
+ "argsMapping": {
457
+ "where.id.eq": [
458
+ [
459
+ "get",
460
+ {
461
+ "path": "claims.sub"
462
+ }
463
+ ]
464
+ ]
465
+ },
466
+ "shapeName": "Profile"
395
467
  },
396
- "description": "Duplicate TsStaticSite",
397
- "args": "DuplicateArgs<TsStaticSite>"
468
+ "description": "Get my Profile"
398
469
  },
399
- "deleteTsStaticSite": {
400
- "shape": "DeleteResult<TsStaticSite>",
401
- "resolver": {
402
- "name": "takeshape:delete",
403
- "service": "takeshape:local",
404
- "options": {},
405
- "shapeName": "TsStaticSite"
470
+ "getMySubscriptions": {
471
+ "shape": {
472
+ "type": "array",
473
+ "items": {
474
+ "@ref": "stripe:Subscription"
475
+ }
406
476
  },
407
- "description": "Delete TsStaticSite",
408
- "args": "DeleteArgs<TsStaticSite>"
409
- },
410
- "upsertMyProfile": {
411
- "shape": "Profile",
412
477
  "resolver": {
413
478
  "resultsMapping": [
414
479
  [
415
480
  "get",
416
481
  {
417
- "path": "steps.createProfile.result"
418
- }
419
- ],
420
- [
421
- "get",
422
- {
423
- "path": "steps.updateProfile.result"
482
+ "path": "steps.subscriptions.data"
424
483
  }
425
484
  ]
426
485
  ],
427
486
  "compose": [
428
487
  {
429
488
  "if": "!isEmpty(claims.sub)",
430
- "id": "existingProfile",
431
- "argsMapping": {
432
- "where.id.eq": [
433
- [
434
- "get",
435
- {
436
- "path": "claims.sub"
437
- }
438
- ]
439
- ]
440
- },
489
+ "id": "profile",
441
490
  "name": "takeshape:find",
442
491
  "service": "takeshape:local",
443
492
  "options": {},
444
- "shapeName": "Profile"
445
- },
446
- {
447
- "if": "isEmpty(steps.existingProfile)",
448
- "id": "createProfile",
449
493
  "argsMapping": {
450
- "input.id": [
494
+ "where.id.eq": [
451
495
  [
452
496
  "get",
453
497
  {
454
498
  "path": "claims.sub"
455
499
  }
456
500
  ]
457
- ],
458
- "input.email": [
459
- [
460
- "get",
461
- {
462
- "path": "claims.email"
463
- }
464
- ]
465
- ],
466
- "input.firstName": [
467
- [
468
- "get",
469
- {
470
- "path": "args.firstName"
471
- }
472
- ]
473
- ],
474
- "input.lastName": [
475
- [
476
- "get",
477
- {
478
- "path": "args.lastName"
479
- }
480
- ]
481
- ],
482
- "input.bio": [
483
- [
484
- "get",
485
- {
486
- "path": "args.bio"
487
- }
488
- ]
489
- ],
490
- "input.avatar.id": [
491
- [
492
- "get",
493
- {
494
- "path": "args.avatarId"
495
- }
496
- ]
497
501
  ]
498
502
  },
499
- "name": "takeshape:create",
500
- "service": "takeshape:local",
501
- "options": {},
502
503
  "shapeName": "Profile"
503
504
  },
504
505
  {
505
- "if": "!isEmpty(steps.existingProfile)",
506
- "id": "updateProfile",
507
- "argsMapping": {
508
- "input._id": [
509
- [
510
- "get",
511
- {
512
- "path": "steps.existingProfile._id"
513
- }
514
- ]
515
- ],
516
- "input.email": [
517
- [
518
- "get",
519
- {
520
- "path": "claims.email"
521
- }
522
- ]
523
- ],
524
- "input.firstName": [
506
+ "if": "!isEmpty(steps.profile.stripeCustomerId)",
507
+ "id": "subscriptions",
508
+ "name": "rest:get",
509
+ "service": "stripe",
510
+ "options": {},
511
+ "searchParamsMapping": [
512
+ [
513
+ "expand[]",
525
514
  [
526
- "get",
527
- {
528
- "path": "args.firstName"
529
- }
515
+ [
516
+ "set",
517
+ {
518
+ "value": "data.items"
519
+ }
520
+ ]
530
521
  ]
531
522
  ],
532
- "input.lastName": [
523
+ [
524
+ "expand[]",
533
525
  [
534
- "get",
535
- {
536
- "path": "args.lastName"
537
- }
526
+ [
527
+ "set",
528
+ {
529
+ "value": "data.plan.product"
530
+ }
531
+ ]
538
532
  ]
539
533
  ],
540
- "input.bio": [
534
+ [
535
+ "expand[]",
541
536
  [
542
- "get",
543
- {
544
- "path": "args.bio"
545
- }
537
+ [
538
+ "set",
539
+ {
540
+ "value": "data.latest_invoice.payment_intent"
541
+ }
542
+ ]
546
543
  ]
547
544
  ],
548
- "input.avatar.id": [
545
+ [
546
+ "customer",
549
547
  [
550
- "get",
551
- {
552
- "path": "args.avatarId"
553
- }
548
+ [
549
+ "get",
550
+ {
551
+ "path": "steps.profile.stripeCustomerId"
552
+ }
553
+ ]
554
554
  ]
555
555
  ]
556
- },
557
- "name": "takeshape:update",
558
- "service": "takeshape:local",
559
- "options": {},
560
- "shapeName": "Profile"
556
+ ],
557
+ "path": "/v1/subscriptions"
561
558
  }
562
559
  ]
563
560
  },
564
- "description": "Upsert My Profile",
565
- "args": "UpsertMyProfileInput"
561
+ "description": "Get my subscriptions"
566
562
  },
567
- "upsertMyCustomer": {
568
- "shape": "stripe:Customer",
563
+ "getSubscriptions": {
564
+ "shape": {
565
+ "type": "array",
566
+ "items": {
567
+ "@ref": "stripe:Subscription"
568
+ }
569
+ },
569
570
  "resolver": {
570
571
  "resultsMapping": [
571
572
  [
572
573
  "get",
573
574
  {
574
- "path": "steps.updatedCustomer"
575
+ "path": "steps.subscriptions.data"
575
576
  }
576
577
  ]
577
578
  ],
578
579
  "compose": [
579
580
  {
580
- "if": "!isEmpty(claims.sub)",
581
- "id": "existingProfile",
582
- "argsMapping": {
583
- "where.id.eq": [
581
+ "id": "subscriptions",
582
+ "name": "rest:get",
583
+ "service": "stripe",
584
+ "options": {},
585
+ "searchParamsMapping": [
586
+ [
587
+ "expand[]",
584
588
  [
585
- "get",
586
- {
587
- "path": "claims.sub"
588
- }
589
+ [
590
+ "set",
591
+ {
592
+ "value": "data.items"
593
+ }
594
+ ]
595
+ ]
596
+ ],
597
+ [
598
+ "customer",
599
+ [
600
+ [
601
+ "get",
602
+ {
603
+ "path": "args.customer"
604
+ }
605
+ ]
589
606
  ]
590
607
  ]
591
- },
592
- "name": "takeshape:find",
593
- "service": "takeshape:local",
594
- "options": {},
595
- "shapeName": "Profile"
596
- },
608
+ ],
609
+ "path": "/v1/subscriptions"
610
+ }
611
+ ]
612
+ },
613
+ "description": "Get my subscriptions",
614
+ "args": "GetSubscriptionsInput"
615
+ },
616
+ "getStripeProducts": {
617
+ "shape": {
618
+ "type": "array",
619
+ "items": {
620
+ "@ref": "takeshape:local:StripeProductWithPrices"
621
+ }
622
+ },
623
+ "resolver": {
624
+ "resultsMapping": [
625
+ [
626
+ "expressionEval",
627
+ {
628
+ "expression": "map(compose(set('prices', placeholder, newObject()), get(placeholder, groupBy('product', steps.prices.data)), get('id')), steps.products.data)"
629
+ }
630
+ ],
631
+ [
632
+ "getMultiple",
633
+ {
634
+ "paths": [
635
+ "previousStep",
636
+ "steps.products.data"
637
+ ]
638
+ }
639
+ ],
640
+ [
641
+ "zipAndMerge",
642
+ {}
643
+ ]
644
+ ],
645
+ "compose": [
597
646
  {
598
- "if": "!isEmpty(claims.sub) && !isEmpty(claims.email) && isEmpty(steps.existingProfile.stripeCustomerId)",
599
- "id": "existingCustomerByEmail",
647
+ "id": "products",
600
648
  "name": "rest:get",
601
649
  "service": "stripe",
602
650
  "options": {},
603
651
  "searchParamsMapping": [
604
652
  [
605
- "email",
653
+ "active",
606
654
  [
607
655
  [
608
- "get",
656
+ "set",
609
657
  {
610
- "path": "claims.email"
658
+ "value": "true"
611
659
  }
612
660
  ]
613
661
  ]
614
662
  ]
615
663
  ],
616
- "path": "/v1/customers"
664
+ "path": "/v1/products"
617
665
  },
618
666
  {
619
- "if": "!isEmpty(claims.sub) && !isEmpty(claims.email) && !isEmpty(steps.existingProfile.stripeCustomerId)",
620
- "id": "existingCustomerById",
667
+ "id": "prices",
621
668
  "name": "rest:get",
622
669
  "service": "stripe",
623
670
  "options": {},
624
- "argsMapping": {
625
- "pathParams.customer": [
626
- [
627
- "get",
671
+ "searchParamsMapping": [
672
+ [
673
+ "active",
674
+ [
675
+ [
676
+ "set",
677
+ {
678
+ "value": "true"
679
+ }
680
+ ]
681
+ ]
682
+ ]
683
+ ],
684
+ "path": "/v1/prices"
685
+ }
686
+ ]
687
+ },
688
+ "description": "Get Stripe products"
689
+ },
690
+ "getProfile": {
691
+ "shape": "Profile",
692
+ "resolver": {
693
+ "name": "takeshape:get",
694
+ "service": "takeshape:local",
695
+ "options": {},
696
+ "shapeName": "Profile"
697
+ },
698
+ "description": "Get a Profile by ID",
699
+ "args": "TSGetArgs<Profile>"
700
+ },
701
+ "getProfileList": {
702
+ "shape": "PaginatedList<Profile>",
703
+ "resolver": {
704
+ "name": "takeshape:list",
705
+ "service": "takeshape:local",
706
+ "options": {},
707
+ "shapeName": "Profile"
708
+ },
709
+ "description": "Returns a list Profile in natural order.",
710
+ "args": "TSListArgs<Profile>"
711
+ }
712
+ },
713
+ "mutations": {
714
+ "updateAsset": {
715
+ "shape": "UpdateResult<Asset>",
716
+ "resolver": {
717
+ "name": "takeshape:update",
718
+ "service": "takeshape:local",
719
+ "options": {},
720
+ "shapeName": "Asset"
721
+ },
722
+ "description": "Update Asset",
723
+ "args": "UpdateArgs<Asset>"
724
+ },
725
+ "createAsset": {
726
+ "shape": "CreateResult<Asset>",
727
+ "resolver": {
728
+ "name": "takeshape:create",
729
+ "service": "takeshape:local",
730
+ "options": {},
731
+ "shapeName": "Asset"
732
+ },
733
+ "description": "Create Asset",
734
+ "args": "CreateArgs<Asset>"
735
+ },
736
+ "duplicateAsset": {
737
+ "shape": "DuplicateResult<Asset>",
738
+ "resolver": {
739
+ "name": "takeshape:duplicate",
740
+ "service": "takeshape:local",
741
+ "options": {},
742
+ "shapeName": "Asset"
743
+ },
744
+ "description": "Duplicate Asset",
745
+ "args": "DuplicateArgs<Asset>"
746
+ },
747
+ "deleteAsset": {
748
+ "shape": "DeleteResult<Asset>",
749
+ "resolver": {
750
+ "name": "takeshape:delete",
751
+ "service": "takeshape:local",
752
+ "options": {},
753
+ "shapeName": "Asset"
754
+ },
755
+ "description": "Delete Asset",
756
+ "args": "DeleteArgs<Asset>"
757
+ },
758
+ "updateTsStaticSite": {
759
+ "shape": "UpdateResult<TsStaticSite>",
760
+ "resolver": {
761
+ "name": "takeshape:update",
762
+ "service": "takeshape:local",
763
+ "options": {},
764
+ "shapeName": "TsStaticSite"
765
+ },
766
+ "description": "Update TsStaticSite",
767
+ "args": "UpdateArgs<TsStaticSite>"
768
+ },
769
+ "createTsStaticSite": {
770
+ "shape": "CreateResult<TsStaticSite>",
771
+ "resolver": {
772
+ "name": "takeshape:create",
773
+ "service": "takeshape:local",
774
+ "options": {},
775
+ "shapeName": "TsStaticSite"
776
+ },
777
+ "description": "Create TsStaticSite",
778
+ "args": "CreateArgs<TsStaticSite>"
779
+ },
780
+ "duplicateTsStaticSite": {
781
+ "shape": "DuplicateResult<TsStaticSite>",
782
+ "resolver": {
783
+ "name": "takeshape:duplicate",
784
+ "service": "takeshape:local",
785
+ "options": {},
786
+ "shapeName": "TsStaticSite"
787
+ },
788
+ "description": "Duplicate TsStaticSite",
789
+ "args": "DuplicateArgs<TsStaticSite>"
790
+ },
791
+ "deleteTsStaticSite": {
792
+ "shape": "DeleteResult<TsStaticSite>",
793
+ "resolver": {
794
+ "name": "takeshape:delete",
795
+ "service": "takeshape:local",
796
+ "options": {},
797
+ "shapeName": "TsStaticSite"
798
+ },
799
+ "description": "Delete TsStaticSite",
800
+ "args": "DeleteArgs<TsStaticSite>"
801
+ },
802
+ "upsertMyProfile": {
803
+ "shape": "Profile",
804
+ "resolver": {
805
+ "resultsMapping": [
806
+ [
807
+ "get",
808
+ {
809
+ "path": "steps.createProfile.result"
810
+ }
811
+ ],
812
+ [
813
+ "get",
814
+ {
815
+ "path": "steps.updateProfile.result"
816
+ }
817
+ ]
818
+ ],
819
+ "compose": [
820
+ {
821
+ "if": "!isEmpty(claims.sub)",
822
+ "id": "existingProfile",
823
+ "argsMapping": {
824
+ "where.id.eq": [
825
+ [
826
+ "get",
628
827
  {
629
- "path": "steps.existingProfile.stripeCustomerId"
828
+ "path": "claims.sub"
630
829
  }
631
830
  ]
632
831
  ]
633
832
  },
634
- "path": "/v1/customers/{customer}"
833
+ "name": "takeshape:find",
834
+ "service": "takeshape:local",
835
+ "options": {},
836
+ "shapeName": "Profile"
635
837
  },
636
838
  {
637
- "if": "!isEmpty(claims.sub) && !isEmpty(claims.email)",
638
- "id": "updatedCustomer",
839
+ "if": "isEmpty(steps.existingProfile)",
840
+ "id": "createProfile",
639
841
  "argsMapping": {
640
- "form.email": [
842
+ "input.id": [
843
+ [
844
+ "get",
845
+ {
846
+ "path": "claims.sub"
847
+ }
848
+ ]
849
+ ],
850
+ "input.email": [
641
851
  [
642
852
  "get",
643
853
  {
@@ -645,45 +855,47 @@
645
855
  }
646
856
  ]
647
857
  ],
648
- "form.name": [
858
+ "input.firstName": [
649
859
  [
650
860
  "get",
651
861
  {
652
- "path": "args.name"
862
+ "path": "args.firstName"
653
863
  }
654
864
  ]
655
865
  ],
656
- "form.description": [
866
+ "input.lastName": [
657
867
  [
658
868
  "get",
659
869
  {
660
- "path": "args.description"
870
+ "path": "args.lastName"
661
871
  }
662
872
  ]
663
873
  ],
664
- "pathParams.customer": [
874
+ "input.bio": [
665
875
  [
666
876
  "get",
667
877
  {
668
- "path": "steps.existingCustomerByEmail.data[0].id"
878
+ "path": "args.bio"
669
879
  }
670
- ],
880
+ ]
881
+ ],
882
+ "input.avatar.id": [
671
883
  [
672
884
  "get",
673
885
  {
674
- "path": "steps.existingCustomerById.id"
886
+ "path": "args.avatarId"
675
887
  }
676
888
  ]
677
889
  ]
678
890
  },
679
- "name": "rest:post",
680
- "service": "stripe",
891
+ "name": "takeshape:create",
892
+ "service": "takeshape:local",
681
893
  "options": {},
682
- "path": "/v1/customers/{customer}"
894
+ "shapeName": "Profile"
683
895
  },
684
896
  {
685
- "if": "!isEmpty(claims.sub) && !isEmpty(steps.existingProfile) && isEmpty(steps.existingProfile.stripeCustomerId)",
686
- "id": "updatedProfile",
897
+ "if": "!isEmpty(steps.existingProfile)",
898
+ "id": "updateProfile",
687
899
  "argsMapping": {
688
900
  "input._id": [
689
901
  [
@@ -693,11 +905,43 @@
693
905
  }
694
906
  ]
695
907
  ],
696
- "input.stripeCustomerId": [
908
+ "input.email": [
697
909
  [
698
910
  "get",
699
911
  {
700
- "path": "steps.updatedCustomer.id"
912
+ "path": "claims.email"
913
+ }
914
+ ]
915
+ ],
916
+ "input.firstName": [
917
+ [
918
+ "get",
919
+ {
920
+ "path": "args.firstName"
921
+ }
922
+ ]
923
+ ],
924
+ "input.lastName": [
925
+ [
926
+ "get",
927
+ {
928
+ "path": "args.lastName"
929
+ }
930
+ ]
931
+ ],
932
+ "input.bio": [
933
+ [
934
+ "get",
935
+ {
936
+ "path": "args.bio"
937
+ }
938
+ ]
939
+ ],
940
+ "input.avatar.id": [
941
+ [
942
+ "get",
943
+ {
944
+ "path": "args.avatarId"
701
945
  }
702
946
  ]
703
947
  ]
@@ -709,19 +953,167 @@
709
953
  }
710
954
  ]
711
955
  },
712
- "description": "Upsert My Stripe Customer",
713
- "args": "UpsertMyCustomerInput"
956
+ "description": "Upsert My Profile",
957
+ "args": "UpsertMyProfileInput"
714
958
  },
715
- "createMySubscription": {
716
- "shape": "stripe:Subscription",
959
+ "upsertMyCustomer": {
960
+ "shape": "stripe:Customer",
717
961
  "resolver": {
718
- "compose": [
719
- {
720
- "if": "!isEmpty(claims.sub)",
721
- "id": "existingProfile",
722
- "argsMapping": {
723
- "where.id.eq": [
724
- [
962
+ "resultsMapping": [
963
+ [
964
+ "get",
965
+ {
966
+ "path": "steps.updatedCustomer"
967
+ }
968
+ ]
969
+ ],
970
+ "compose": [
971
+ {
972
+ "if": "!isEmpty(claims.sub)",
973
+ "id": "existingProfile",
974
+ "argsMapping": {
975
+ "where.id.eq": [
976
+ [
977
+ "get",
978
+ {
979
+ "path": "claims.sub"
980
+ }
981
+ ]
982
+ ]
983
+ },
984
+ "name": "takeshape:find",
985
+ "service": "takeshape:local",
986
+ "options": {},
987
+ "shapeName": "Profile"
988
+ },
989
+ {
990
+ "if": "!isEmpty(claims.sub) && !isEmpty(claims.email) && isEmpty(steps.existingProfile.stripeCustomerId)",
991
+ "id": "existingCustomerByEmail",
992
+ "name": "rest:get",
993
+ "service": "stripe",
994
+ "options": {},
995
+ "searchParamsMapping": [
996
+ [
997
+ "email",
998
+ [
999
+ [
1000
+ "get",
1001
+ {
1002
+ "path": "claims.email"
1003
+ }
1004
+ ]
1005
+ ]
1006
+ ]
1007
+ ],
1008
+ "path": "/v1/customers"
1009
+ },
1010
+ {
1011
+ "if": "!isEmpty(claims.sub) && !isEmpty(claims.email) && !isEmpty(steps.existingProfile.stripeCustomerId)",
1012
+ "id": "existingCustomerById",
1013
+ "name": "rest:get",
1014
+ "service": "stripe",
1015
+ "options": {},
1016
+ "argsMapping": {
1017
+ "pathParams.customer": [
1018
+ [
1019
+ "get",
1020
+ {
1021
+ "path": "steps.existingProfile.stripeCustomerId"
1022
+ }
1023
+ ]
1024
+ ]
1025
+ },
1026
+ "path": "/v1/customers/{customer}"
1027
+ },
1028
+ {
1029
+ "if": "!isEmpty(claims.sub) && !isEmpty(claims.email)",
1030
+ "id": "updatedCustomer",
1031
+ "argsMapping": {
1032
+ "form.email": [
1033
+ [
1034
+ "get",
1035
+ {
1036
+ "path": "claims.email"
1037
+ }
1038
+ ]
1039
+ ],
1040
+ "form.name": [
1041
+ [
1042
+ "get",
1043
+ {
1044
+ "path": "args.name"
1045
+ }
1046
+ ]
1047
+ ],
1048
+ "form.description": [
1049
+ [
1050
+ "get",
1051
+ {
1052
+ "path": "args.description"
1053
+ }
1054
+ ]
1055
+ ],
1056
+ "pathParams.customer": [
1057
+ [
1058
+ "get",
1059
+ {
1060
+ "path": "steps.existingCustomerByEmail.data[0].id"
1061
+ }
1062
+ ],
1063
+ [
1064
+ "get",
1065
+ {
1066
+ "path": "steps.existingCustomerById.id"
1067
+ }
1068
+ ]
1069
+ ]
1070
+ },
1071
+ "name": "rest:post",
1072
+ "service": "stripe",
1073
+ "options": {},
1074
+ "path": "/v1/customers/{customer}"
1075
+ },
1076
+ {
1077
+ "if": "!isEmpty(claims.sub) && !isEmpty(steps.existingProfile) && isEmpty(steps.existingProfile.stripeCustomerId)",
1078
+ "id": "updatedProfile",
1079
+ "argsMapping": {
1080
+ "input._id": [
1081
+ [
1082
+ "get",
1083
+ {
1084
+ "path": "steps.existingProfile._id"
1085
+ }
1086
+ ]
1087
+ ],
1088
+ "input.stripeCustomerId": [
1089
+ [
1090
+ "get",
1091
+ {
1092
+ "path": "steps.updatedCustomer.id"
1093
+ }
1094
+ ]
1095
+ ]
1096
+ },
1097
+ "name": "takeshape:update",
1098
+ "service": "takeshape:local",
1099
+ "options": {},
1100
+ "shapeName": "Profile"
1101
+ }
1102
+ ]
1103
+ },
1104
+ "description": "Upsert My Stripe Customer",
1105
+ "args": "UpsertMyCustomerInput"
1106
+ },
1107
+ "createMySubscription": {
1108
+ "shape": "stripe:Subscription",
1109
+ "resolver": {
1110
+ "compose": [
1111
+ {
1112
+ "if": "!isEmpty(claims.sub)",
1113
+ "id": "existingProfile",
1114
+ "argsMapping": {
1115
+ "where.id.eq": [
1116
+ [
725
1117
  "get",
726
1118
  {
727
1119
  "path": "claims.sub"
@@ -20863,519 +21255,127 @@
20863
21255
  "tire_retreading_and_repair",
20864
21256
  "tolls_bridge_fees",
20865
21257
  "tourist_attractions_and_exhibits",
20866
- "towing_services",
20867
- "trailer_parks_campgrounds",
20868
- "transportation_services",
20869
- "travel_agencies_tour_operators",
20870
- "truck_stop_iteration",
20871
- "truck_utility_trailer_rentals",
20872
- "typesetting_plate_making_and_related_services",
20873
- "typewriter_stores",
20874
- "u_s_federal_government_agencies_or_departments",
20875
- "uniforms_commercial_clothing",
20876
- "used_merchandise_and_secondhand_stores",
20877
- "utilities",
20878
- "variety_stores",
20879
- "veterinary_services",
20880
- "video_amusement_game_supplies",
20881
- "video_game_arcades",
20882
- "video_tape_rental_stores",
20883
- "vocational_trade_schools",
20884
- "watch_jewelry_repair",
20885
- "welding_repair",
20886
- "wholesale_clubs",
20887
- "wig_and_toupee_stores",
20888
- "wires_money_orders",
20889
- "womens_accessory_and_specialty_shops",
20890
- "womens_ready_to_wear_stores",
20891
- "wrecking_and_salvage_yards"
20892
- ]
20893
- },
20894
- "type": "array"
20895
- },
20896
- "interval": {
20897
- "description": "Interval (or event) to which the amount applies.",
20898
- "enum": [
20899
- "all_time",
20900
- "daily",
20901
- "monthly",
20902
- "per_authorization",
20903
- "weekly",
20904
- "yearly"
20905
- ]
20906
- }
20907
- }
20908
- }
20909
- },
20910
- "Stripe_IssuingTransactionFlightDataLeg": {
20911
- "id": "Stripe_IssuingTransactionFlightDataLeg",
20912
- "name": "Stripe_IssuingTransactionFlightDataLeg",
20913
- "title": "Stripe_IssuingTransactionFlightDataLeg",
20914
- "schema": {
20915
- "type": "object",
20916
- "properties": {
20917
- "arrival_airport_code": {
20918
- "description": "The three-letter IATA airport code of the flight's destination.",
20919
- "maxLength": 5000,
20920
- "type": "string"
20921
- },
20922
- "carrier": {
20923
- "description": "The airline carrier code.",
20924
- "maxLength": 5000,
20925
- "type": "string"
20926
- },
20927
- "departure_airport_code": {
20928
- "description": "The three-letter IATA airport code that the flight departed from.",
20929
- "maxLength": 5000,
20930
- "type": "string"
20931
- },
20932
- "flight_number": {
20933
- "description": "The flight number.",
20934
- "maxLength": 5000,
20935
- "type": "string"
20936
- },
20937
- "service_class": {
20938
- "description": "The flight's service class.",
20939
- "maxLength": 5000,
20940
- "type": "string"
20941
- },
20942
- "stopover_allowed": {
20943
- "description": "Whether a stopover is allowed on this flight.",
20944
- "type": "boolean"
20945
- }
20946
- }
20947
- }
20948
- },
20949
- "Stripe_IssuingCardholderIdDocument": {
20950
- "id": "Stripe_IssuingCardholderIdDocument",
20951
- "name": "Stripe_IssuingCardholderIdDocument",
20952
- "title": "Stripe_IssuingCardholderIdDocument",
20953
- "schema": {
20954
- "type": "object",
20955
- "properties": {
20956
- "back": {
20957
- "oneOf": [
20958
- {
20959
- "@ref": "local:WrappedString"
20960
- },
20961
- {
20962
- "@ref": "stripe:File"
20963
- }
20964
- ],
20965
- "@resolver": {
20966
- "name": "util:wrap",
20967
- "service": "takeshape:local"
20968
- }
20969
- },
20970
- "front": {
20971
- "oneOf": [
20972
- {
20973
- "@ref": "local:WrappedString"
20974
- },
20975
- {
20976
- "@ref": "stripe:File"
20977
- }
20978
- ],
20979
- "@resolver": {
20980
- "name": "util:wrap",
20981
- "service": "takeshape:local"
20982
- }
20983
- }
20984
- }
20985
- }
20986
- }
20987
- },
20988
- "workflows": {
20989
- "default": {
20990
- "name": "default",
20991
- "title": "Default",
20992
- "steps": [
20993
- {
20994
- "name": "disabled",
20995
- "title": "Disabled",
20996
- "key": "r1uCfi4ZL",
20997
- "color": "#bdbdbd",
20998
- "live": false
20999
- },
21000
- {
21001
- "name": "enabled",
21002
- "title": "Enabled",
21003
- "key": "rkhRGs4WL",
21004
- "color": "#5cd79b",
21005
- "live": true
21006
- }
21007
- ]
21008
- }
21009
- },
21010
- "forms": {
21011
- "Asset": {
21012
- "default": {
21013
- "order": [
21014
- "title",
21015
- "description",
21016
- "caption",
21017
- "credit",
21018
- "filename",
21019
- "path",
21020
- "mimeType",
21021
- "sourceUrl",
21022
- "uploadStatus"
21023
- ],
21024
- "properties": {
21025
- "title": {
21026
- "widget": "singleLineText",
21027
- "disabled": true
21028
- },
21029
- "description": {
21030
- "widget": "paragraphText",
21031
- "disabled": true
21032
- },
21033
- "caption": {
21034
- "widget": "wysiwygSingleLineText",
21035
- "disabled": true
21036
- },
21037
- "credit": {
21038
- "widget": "wysiwygSingleLineText",
21039
- "disabled": true
21040
- },
21041
- "filename": {
21042
- "widget": "singleLineText",
21043
- "disabled": true
21044
- },
21045
- "path": {
21046
- "widget": "singleLineText",
21047
- "disabled": true
21048
- },
21049
- "mimeType": {
21050
- "widget": "singleLineText",
21051
- "disabled": true
21052
- },
21053
- "sourceUrl": {
21054
- "widget": "singleLineText",
21055
- "disabled": true
21056
- },
21057
- "uploadStatus": {
21058
- "widget": "singleLineText",
21059
- "disabled": true
21060
- }
21061
- }
21062
- }
21063
- },
21064
- "TsStaticSite": {
21065
- "default": {
21066
- "order": [
21067
- "title",
21068
- "provider",
21069
- "destination",
21070
- "idKey",
21071
- "secretKey",
21072
- "environmentVariables"
21073
- ],
21074
- "properties": {
21075
- "title": {
21076
- "widget": "singleLineText",
21077
- "disabled": true
21078
- },
21079
- "provider": {
21080
- "widget": "dropdown",
21081
- "disabled": true
21082
- },
21083
- "destination": {
21084
- "widget": "singleLineText",
21085
- "instructions": "Deployment Bucket or FTP Host",
21086
- "disabled": true
21087
- },
21088
- "idKey": {
21089
- "widget": "singleLineText",
21090
- "instructions": "AWS Access Key ID or Google Cloud Storage Client Email or FTP Username",
21091
- "disabled": true
21092
- },
21093
- "secretKey": {
21094
- "widget": "sensitiveField",
21095
- "instructions": "AWS Secret Access Key or Google Cloud Storage Private Key or FTP Password",
21096
- "multiline": true,
21097
- "disabled": true
21098
- },
21099
- "environmentVariables": {
21100
- "widget": "repeater",
21101
- "order": [
21102
- "name",
21103
- "value"
21104
- ],
21105
- "disabled": true,
21106
- "properties": {
21107
- "name": {
21108
- "widget": "singleLineText",
21109
- "disabled": true
21110
- },
21111
- "value": {
21112
- "widget": "singleLineText",
21113
- "disabled": true
21114
- }
21115
- }
21116
- }
21117
- }
21118
- },
21119
- "generalHeader": {
21120
- "order": [
21121
- "title",
21122
- "provider",
21123
- "baseUrl"
21124
- ],
21125
- "properties": {
21126
- "title": {
21127
- "widget": "singleLineText",
21128
- "disabled": true
21129
- },
21130
- "provider": {
21131
- "widget": "dropdown",
21132
- "disabled": true
21133
- },
21134
- "baseUrl": {
21135
- "widget": "singleLineText",
21136
- "disabled": true
21137
- }
21138
- }
21139
- },
21140
- "generalFooter": {
21141
- "order": [
21142
- "environmentVariables",
21143
- "triggers"
21144
- ],
21145
- "properties": {
21146
- "environmentVariables": {
21147
- "widget": "repeater",
21148
- "order": [
21149
- "name",
21150
- "value"
21151
- ],
21152
- "disabled": true,
21153
- "properties": {
21154
- "name": {
21155
- "widget": "singleLineText",
21156
- "disabled": true
21157
- },
21158
- "value": {
21159
- "widget": "singleLineText",
21160
- "disabled": true
21161
- }
21162
- }
21163
- },
21164
- "triggers": {
21165
- "widget": "repeater",
21166
- "order": [
21167
- "contentTypeId",
21168
- "status"
21169
- ],
21170
- "disabled": true,
21171
- "preview": "siteTriggerPreview",
21172
- "properties": {
21173
- "contentTypeId": {
21174
- "widget": "dropdown",
21175
- "disabled": true
21176
- },
21177
- "status": {
21178
- "widget": "dropdown",
21179
- "disabled": true
21180
- }
21181
- }
21182
- }
21183
- }
21184
- },
21185
- "s3": {
21186
- "order": [
21187
- "destination",
21188
- "idKey",
21189
- "secretKey",
21190
- "privateAcl"
21191
- ],
21192
- "properties": {
21193
- "destination": {
21194
- "widget": "singleLineText",
21195
- "instructions": "Deployment Bucket Name",
21196
- "disabled": true
21197
- },
21198
- "idKey": {
21199
- "widget": "singleLineText",
21200
- "instructions": "AWS Access Key ID",
21201
- "disabled": true
21202
- },
21203
- "secretKey": {
21204
- "widget": "sensitiveField",
21205
- "instructions": "AWS Secret Access Key",
21206
- "multiline": true,
21207
- "disabled": true
21258
+ "towing_services",
21259
+ "trailer_parks_campgrounds",
21260
+ "transportation_services",
21261
+ "travel_agencies_tour_operators",
21262
+ "truck_stop_iteration",
21263
+ "truck_utility_trailer_rentals",
21264
+ "typesetting_plate_making_and_related_services",
21265
+ "typewriter_stores",
21266
+ "u_s_federal_government_agencies_or_departments",
21267
+ "uniforms_commercial_clothing",
21268
+ "used_merchandise_and_secondhand_stores",
21269
+ "utilities",
21270
+ "variety_stores",
21271
+ "veterinary_services",
21272
+ "video_amusement_game_supplies",
21273
+ "video_game_arcades",
21274
+ "video_tape_rental_stores",
21275
+ "vocational_trade_schools",
21276
+ "watch_jewelry_repair",
21277
+ "welding_repair",
21278
+ "wholesale_clubs",
21279
+ "wig_and_toupee_stores",
21280
+ "wires_money_orders",
21281
+ "womens_accessory_and_specialty_shops",
21282
+ "womens_ready_to_wear_stores",
21283
+ "wrecking_and_salvage_yards"
21284
+ ]
21285
+ },
21286
+ "type": "array"
21208
21287
  },
21209
- "privateAcl": {
21210
- "widget": "checkbox",
21211
- "instructions": "Disable public access to deployed files. This is useful when fronting S3 with CloudFront or with \"Block All Public Access\"",
21212
- "disabled": true
21288
+ "interval": {
21289
+ "description": "Interval (or event) to which the amount applies.",
21290
+ "enum": [
21291
+ "all_time",
21292
+ "daily",
21293
+ "monthly",
21294
+ "per_authorization",
21295
+ "weekly",
21296
+ "yearly"
21297
+ ]
21213
21298
  }
21214
21299
  }
21215
- },
21216
- "gcs": {
21217
- "order": [
21218
- "destination",
21219
- "idKey",
21220
- "secretKey",
21221
- "privateAcl"
21222
- ],
21300
+ }
21301
+ },
21302
+ "Stripe_IssuingTransactionFlightDataLeg": {
21303
+ "id": "Stripe_IssuingTransactionFlightDataLeg",
21304
+ "name": "Stripe_IssuingTransactionFlightDataLeg",
21305
+ "title": "Stripe_IssuingTransactionFlightDataLeg",
21306
+ "schema": {
21307
+ "type": "object",
21223
21308
  "properties": {
21224
- "destination": {
21225
- "widget": "singleLineText",
21226
- "instructions": "Deployment Bucket Name",
21227
- "disabled": true
21228
- },
21229
- "idKey": {
21230
- "widget": "singleLineText",
21231
- "instructions": "Google Cloud Storage Client Email",
21232
- "disabled": true
21309
+ "arrival_airport_code": {
21310
+ "description": "The three-letter IATA airport code of the flight's destination.",
21311
+ "maxLength": 5000,
21312
+ "type": "string"
21233
21313
  },
21234
- "secretKey": {
21235
- "widget": "sensitiveField",
21236
- "instructions": "Google Cloud Storage Private Key",
21237
- "multiline": true,
21238
- "disabled": true
21314
+ "carrier": {
21315
+ "description": "The airline carrier code.",
21316
+ "maxLength": 5000,
21317
+ "type": "string"
21239
21318
  },
21240
- "privateAcl": {
21241
- "widget": "checkbox",
21242
- "instructions": "Disable public access to deployed files.",
21243
- "disabled": true
21244
- }
21245
- }
21246
- },
21247
- "ftp": {
21248
- "order": [
21249
- "destination",
21250
- "idKey",
21251
- "secretKey"
21252
- ],
21253
- "properties": {
21254
- "destination": {
21255
- "widget": "singleLineText",
21256
- "instructions": "FTP Host",
21257
- "disabled": true
21319
+ "departure_airport_code": {
21320
+ "description": "The three-letter IATA airport code that the flight departed from.",
21321
+ "maxLength": 5000,
21322
+ "type": "string"
21258
21323
  },
21259
- "idKey": {
21260
- "widget": "singleLineText",
21261
- "instructions": "FTP Username",
21262
- "disabled": true
21324
+ "flight_number": {
21325
+ "description": "The flight number.",
21326
+ "maxLength": 5000,
21327
+ "type": "string"
21263
21328
  },
21264
- "secretKey": {
21265
- "widget": "sensitiveField",
21266
- "instructions": "FTP Password",
21267
- "multiline": true,
21268
- "disabled": true
21269
- }
21270
- }
21271
- },
21272
- "azure": {
21273
- "order": [
21274
- "destination",
21275
- "secretKey"
21276
- ],
21277
- "properties": {
21278
- "destination": {
21279
- "widget": "singleLineText",
21280
- "instructions": "Storage Account Name",
21281
- "disabled": true
21329
+ "service_class": {
21330
+ "description": "The flight's service class.",
21331
+ "maxLength": 5000,
21332
+ "type": "string"
21282
21333
  },
21283
- "secretKey": {
21284
- "widget": "sensitiveField",
21285
- "instructions": "Access key",
21286
- "multiline": true,
21287
- "disabled": true
21288
- }
21289
- }
21290
- },
21291
- "netlify": {
21292
- "order": [
21293
- "destination"
21294
- ],
21295
- "properties": {
21296
- "destination": {
21297
- "widget": "publishTargets",
21298
- "itemTemplate": "siteDropdownItem",
21299
- "instructions": "Choose existing or create a new site.",
21300
- "disabled": true
21301
- }
21302
- }
21303
- },
21304
- "vercel": {
21305
- "order": [
21306
- "destination"
21307
- ],
21308
- "properties": {
21309
- "destination": {
21310
- "widget": "publishTargets",
21311
- "itemTemplate": "siteDropdownItem",
21312
- "instructions": "Choose existing or create a new project.",
21313
- "disabled": true
21334
+ "stopover_allowed": {
21335
+ "description": "Whether a stopover is allowed on this flight.",
21336
+ "type": "boolean"
21314
21337
  }
21315
21338
  }
21316
21339
  }
21317
21340
  },
21318
- "Profile": {
21319
- "default": {
21341
+ "Stripe_IssuingCardholderIdDocument": {
21342
+ "id": "Stripe_IssuingCardholderIdDocument",
21343
+ "name": "Stripe_IssuingCardholderIdDocument",
21344
+ "title": "Stripe_IssuingCardholderIdDocument",
21345
+ "schema": {
21346
+ "type": "object",
21320
21347
  "properties": {
21321
- "id": {
21322
- "widget": "singleLineText"
21323
- },
21324
- "firstName": {
21325
- "widget": "singleLineText"
21326
- },
21327
- "lastName": {
21328
- "widget": "singleLineText"
21329
- },
21330
- "email": {
21331
- "widget": "singleLineText"
21332
- },
21333
- "bio": {
21334
- "widget": "paragraphText"
21335
- },
21336
- "avatar": {
21337
- "widget": "image"
21348
+ "back": {
21349
+ "oneOf": [
21350
+ {
21351
+ "@ref": "local:WrappedString"
21352
+ },
21353
+ {
21354
+ "@ref": "stripe:File"
21355
+ }
21356
+ ],
21357
+ "@resolver": {
21358
+ "name": "util:wrap",
21359
+ "service": "takeshape:local"
21360
+ }
21338
21361
  },
21339
- "stripeCustomerId": {
21340
- "widget": "singleLineText"
21362
+ "front": {
21363
+ "oneOf": [
21364
+ {
21365
+ "@ref": "local:WrappedString"
21366
+ },
21367
+ {
21368
+ "@ref": "stripe:File"
21369
+ }
21370
+ ],
21371
+ "@resolver": {
21372
+ "name": "util:wrap",
21373
+ "service": "takeshape:local"
21374
+ }
21341
21375
  }
21342
- },
21343
- "order": [
21344
- "id",
21345
- "firstName",
21346
- "lastName",
21347
- "email",
21348
- "bio",
21349
- "avatar",
21350
- "stripeCustomerId"
21351
- ]
21376
+ }
21352
21377
  }
21353
21378
  }
21354
21379
  },
21355
- "services": {
21356
- "auth-0": {
21357
- "id": "auth-0",
21358
- "provider": "auth0",
21359
- "title": "auth0",
21360
- "serviceType": "authentication",
21361
- "authenticationType": "none",
21362
- "options": {
21363
- "domain": "dev-by9w1mxg.us.auth0.com",
21364
- "audience": "https://api.takeshape.io/project/79b5254d-5bc3-4034-8b05-e9c2f097de5a/auth-0"
21365
- }
21366
- },
21367
- "stripe": {
21368
- "id": "stripe",
21369
- "provider": "stripe",
21370
- "title": "Stripe",
21371
- "namespace": "Stripe",
21372
- "serviceType": "openapi",
21373
- "authenticationType": "bearer",
21374
- "authentication": "supersecret",
21375
- "options": {
21376
- "endpoint": "https://api.stripe.com/",
21377
- "spec": "https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json"
21378
- }
21379
- }
21380
- }
21380
+ "schemaVersion": "3.10.0"
21381
21381
  }