@graphcommerce/hygraph-cli 9.0.0-canary.99 → 9.0.1-canary.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.
- package/CHANGELOG.md +22 -672
- package/dist/UpsertClient.js +11 -0
- package/dist/migrateHygraphCli.js +3 -26
- package/dist/migrations/index.js +11 -18
- package/package.json +11 -11
- package/src/UpsertClient.ts +14 -3
- package/src/migrateHygraphCli.ts +5 -4
- package/src/migrationActionFactory.ts +10 -11
- package/src/migrations/graphcommerce5to6.ts +1 -1
- package/src/migrations/graphcommerce6to7.ts +1 -1
- package/src/migrations/graphcommerce7to8.ts +1 -1
- package/src/migrations/graphcommerce8to9.ts +3 -4
- package/src/migrations/index.ts +11 -4
- package/src/readSchema.ts +3 -2
- package/src/types.ts +1 -1
- package/src/utils/getConfig.ts +1 -1
- package/src/utils/getEndpointUrl.ts +2 -2
- package/src/utils/getManagementClient.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,272 +1,48 @@
|
|
|
1
1
|
# @graphcommerce/hygraph-cli
|
|
2
2
|
|
|
3
|
-
## 9.0.
|
|
3
|
+
## 9.0.1-canary.0
|
|
4
4
|
|
|
5
|
-
## 9.0.0
|
|
5
|
+
## 9.0.0
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## 9.0.0-canary.96
|
|
10
|
-
|
|
11
|
-
## 9.0.0-canary.95
|
|
12
|
-
|
|
13
|
-
## 9.0.0-canary.94
|
|
14
|
-
|
|
15
|
-
## 9.0.0-canary.93
|
|
16
|
-
|
|
17
|
-
## 9.0.0-canary.92
|
|
18
|
-
|
|
19
|
-
## 9.0.0-canary.91
|
|
20
|
-
|
|
21
|
-
## 9.0.0-canary.90
|
|
22
|
-
|
|
23
|
-
## 9.0.0-canary.89
|
|
24
|
-
|
|
25
|
-
## 9.0.0-canary.88
|
|
26
|
-
|
|
27
|
-
## 9.0.0-canary.87
|
|
28
|
-
|
|
29
|
-
## 9.0.0-canary.86
|
|
30
|
-
|
|
31
|
-
## 9.0.0-canary.85
|
|
32
|
-
|
|
33
|
-
## 9.0.0-canary.84
|
|
34
|
-
|
|
35
|
-
## 9.0.0-canary.83
|
|
36
|
-
|
|
37
|
-
## 9.0.0-canary.82
|
|
38
|
-
|
|
39
|
-
## 9.0.0-canary.81
|
|
40
|
-
|
|
41
|
-
## 9.0.0-canary.80
|
|
42
|
-
|
|
43
|
-
## 9.0.0-canary.79
|
|
44
|
-
|
|
45
|
-
## 9.0.0-canary.78
|
|
46
|
-
|
|
47
|
-
## 9.0.0-canary.77
|
|
48
|
-
|
|
49
|
-
## 9.0.0-canary.76
|
|
50
|
-
|
|
51
|
-
## 9.0.0-canary.75
|
|
52
|
-
|
|
53
|
-
## 9.0.0-canary.74
|
|
54
|
-
|
|
55
|
-
## 9.0.0-canary.73
|
|
56
|
-
|
|
57
|
-
## 9.0.0-canary.72
|
|
58
|
-
|
|
59
|
-
## 9.0.0-canary.71
|
|
60
|
-
|
|
61
|
-
## 9.0.0-canary.70
|
|
62
|
-
|
|
63
|
-
## 9.0.0-canary.69
|
|
64
|
-
|
|
65
|
-
## 9.0.0-canary.68
|
|
66
|
-
|
|
67
|
-
## 9.0.0-canary.67
|
|
68
|
-
|
|
69
|
-
## 9.0.0-canary.66
|
|
70
|
-
|
|
71
|
-
## 9.0.0-canary.65
|
|
72
|
-
|
|
73
|
-
## 9.0.0-canary.64
|
|
74
|
-
|
|
75
|
-
## 9.0.0-canary.63
|
|
76
|
-
|
|
77
|
-
## 9.0.0-canary.62
|
|
78
|
-
|
|
79
|
-
## 9.0.0-canary.61
|
|
80
|
-
|
|
81
|
-
## 9.0.0-canary.60
|
|
82
|
-
|
|
83
|
-
## 9.0.0-canary.59
|
|
84
|
-
|
|
85
|
-
## 9.0.0-canary.58
|
|
86
|
-
|
|
87
|
-
## 9.0.0-canary.57
|
|
88
|
-
|
|
89
|
-
## 9.0.0-canary.56
|
|
90
|
-
|
|
91
|
-
## 9.0.0-canary.55
|
|
92
|
-
|
|
93
|
-
## 9.0.0-canary.54
|
|
94
|
-
|
|
95
|
-
## 8.1.0-canary.53
|
|
96
|
-
|
|
97
|
-
## 8.1.0-canary.52
|
|
98
|
-
|
|
99
|
-
## 8.1.0-canary.51
|
|
100
|
-
|
|
101
|
-
## 8.1.0-canary.50
|
|
102
|
-
|
|
103
|
-
## 8.1.0-canary.49
|
|
104
|
-
|
|
105
|
-
## 8.1.0-canary.48
|
|
106
|
-
|
|
107
|
-
## 8.1.0-canary.47
|
|
108
|
-
|
|
109
|
-
## 8.1.0-canary.46
|
|
110
|
-
|
|
111
|
-
## 8.1.0-canary.45
|
|
112
|
-
|
|
113
|
-
## 8.1.0-canary.44
|
|
114
|
-
|
|
115
|
-
## 8.1.0-canary.43
|
|
116
|
-
|
|
117
|
-
## 8.1.0-canary.42
|
|
118
|
-
|
|
119
|
-
## 8.1.0-canary.41
|
|
120
|
-
|
|
121
|
-
## 8.1.0-canary.40
|
|
122
|
-
|
|
123
|
-
## 8.1.0-canary.39
|
|
124
|
-
|
|
125
|
-
## 8.1.0-canary.38
|
|
126
|
-
|
|
127
|
-
## 8.1.0-canary.37
|
|
128
|
-
|
|
129
|
-
## 8.1.0-canary.36
|
|
130
|
-
|
|
131
|
-
## 8.1.0-canary.35
|
|
132
|
-
|
|
133
|
-
## 8.1.0-canary.34
|
|
134
|
-
|
|
135
|
-
## 8.1.0-canary.33
|
|
136
|
-
|
|
137
|
-
## 8.1.0-canary.32
|
|
138
|
-
|
|
139
|
-
## 8.1.0-canary.31
|
|
140
|
-
|
|
141
|
-
## 8.1.0-canary.30
|
|
142
|
-
|
|
143
|
-
## 8.1.0-canary.29
|
|
144
|
-
|
|
145
|
-
## 8.1.0-canary.28
|
|
146
|
-
|
|
147
|
-
## 8.1.0-canary.27
|
|
148
|
-
|
|
149
|
-
## 8.1.0-canary.26
|
|
150
|
-
|
|
151
|
-
## 8.1.0-canary.25
|
|
152
|
-
|
|
153
|
-
## 8.1.0-canary.24
|
|
154
|
-
|
|
155
|
-
## 8.1.0-canary.23
|
|
156
|
-
|
|
157
|
-
## 8.1.0-canary.22
|
|
158
|
-
|
|
159
|
-
## 8.1.0-canary.21
|
|
160
|
-
|
|
161
|
-
## 8.1.0-canary.20
|
|
162
|
-
|
|
163
|
-
## 8.1.0-canary.19
|
|
164
|
-
|
|
165
|
-
## 8.1.0-canary.18
|
|
166
|
-
|
|
167
|
-
## 8.1.0-canary.17
|
|
168
|
-
|
|
169
|
-
## 8.1.0-canary.16
|
|
170
|
-
|
|
171
|
-
## 8.1.0-canary.15
|
|
172
|
-
|
|
173
|
-
## 8.1.0-canary.14
|
|
174
|
-
|
|
175
|
-
## 8.1.0-canary.13
|
|
176
|
-
|
|
177
|
-
## 8.1.0-canary.12
|
|
178
|
-
|
|
179
|
-
## 8.1.0-canary.11
|
|
180
|
-
|
|
181
|
-
## 8.1.0-canary.10
|
|
182
|
-
|
|
183
|
-
## 8.1.0-canary.9
|
|
184
|
-
|
|
185
|
-
## 8.1.0-canary.8
|
|
186
|
-
|
|
187
|
-
## 8.1.0-canary.7
|
|
188
|
-
|
|
189
|
-
## 8.1.0-canary.6
|
|
190
|
-
|
|
191
|
-
## 8.1.0-canary.5
|
|
192
|
-
|
|
193
|
-
## 8.0.6-canary.4
|
|
194
|
-
|
|
195
|
-
## 8.0.6-canary.3
|
|
196
|
-
|
|
197
|
-
## 8.0.6-canary.2
|
|
198
|
-
|
|
199
|
-
## 8.0.6-canary.1
|
|
200
|
-
|
|
201
|
-
## 8.0.6-canary.0
|
|
202
|
-
|
|
203
|
-
## 8.0.5
|
|
204
|
-
|
|
205
|
-
## 8.0.5-canary.10
|
|
206
|
-
|
|
207
|
-
## 8.0.5-canary.9
|
|
208
|
-
|
|
209
|
-
## 8.0.5-canary.8
|
|
210
|
-
|
|
211
|
-
## 8.0.5-canary.7
|
|
212
|
-
|
|
213
|
-
## 8.0.5-canary.6
|
|
214
|
-
|
|
215
|
-
## 8.0.5-canary.5
|
|
216
|
-
|
|
217
|
-
## 8.0.5-canary.4
|
|
218
|
-
|
|
219
|
-
## 8.0.5-canary.3
|
|
220
|
-
|
|
221
|
-
## 8.0.5-canary.2
|
|
222
|
-
|
|
223
|
-
## 8.0.5-canary.1
|
|
224
|
-
|
|
225
|
-
## 8.0.5-canary.0
|
|
226
|
-
|
|
227
|
-
## 8.0.4
|
|
228
|
-
|
|
229
|
-
## 8.0.4-canary.1
|
|
230
|
-
|
|
231
|
-
## 8.0.4-canary.0
|
|
7
|
+
### Patch Changes
|
|
232
8
|
|
|
233
|
-
|
|
9
|
+
- [#2421](https://github.com/graphcommerce-org/graphcommerce/pull/2421) [`d500643`](https://github.com/graphcommerce-org/graphcommerce/commit/d500643138799b6db1610cb10a1d065d6219d8ea) - Resolve peer dependency issues so we get a clean install ([@paales](https://github.com/paales))
|
|
234
10
|
|
|
235
|
-
##
|
|
11
|
+
## 9.0.0-canary.118
|
|
236
12
|
|
|
237
|
-
##
|
|
13
|
+
## 9.0.0-canary.117
|
|
238
14
|
|
|
239
|
-
##
|
|
15
|
+
## 9.0.0-canary.116
|
|
240
16
|
|
|
241
|
-
##
|
|
17
|
+
## 9.0.0-canary.115
|
|
242
18
|
|
|
243
|
-
##
|
|
19
|
+
## 9.0.0-canary.114
|
|
244
20
|
|
|
245
|
-
##
|
|
21
|
+
## 9.0.0-canary.113
|
|
246
22
|
|
|
247
|
-
##
|
|
23
|
+
## 9.0.0-canary.112
|
|
248
24
|
|
|
249
|
-
##
|
|
25
|
+
## 9.0.0-canary.111
|
|
250
26
|
|
|
251
|
-
##
|
|
27
|
+
## 9.0.0-canary.110
|
|
252
28
|
|
|
253
|
-
##
|
|
29
|
+
## 9.0.0-canary.109
|
|
254
30
|
|
|
255
|
-
##
|
|
31
|
+
## 9.0.0-canary.108
|
|
256
32
|
|
|
257
|
-
##
|
|
33
|
+
## 9.0.0-canary.107
|
|
258
34
|
|
|
259
|
-
##
|
|
35
|
+
## 9.0.0-canary.106
|
|
260
36
|
|
|
261
|
-
##
|
|
37
|
+
## 9.0.0-canary.105
|
|
262
38
|
|
|
263
|
-
##
|
|
39
|
+
## 9.0.0-canary.104
|
|
264
40
|
|
|
265
|
-
##
|
|
41
|
+
## 9.0.0-canary.103
|
|
266
42
|
|
|
267
|
-
|
|
43
|
+
### Patch Changes
|
|
268
44
|
|
|
269
|
-
|
|
45
|
+
- [#2421](https://github.com/graphcommerce-org/graphcommerce/pull/2421) [`d500643`](https://github.com/graphcommerce-org/graphcommerce/commit/d500643138799b6db1610cb10a1d065d6219d8ea) - Resolve peer dependency issues so we get a clean install ([@paales](https://github.com/paales))
|
|
270
46
|
|
|
271
47
|
## 8.0.0
|
|
272
48
|
|
|
@@ -276,236 +52,12 @@
|
|
|
276
52
|
|
|
277
53
|
- [#2169](https://github.com/graphcommerce-org/graphcommerce/pull/2169) [`eab3f0b`](https://github.com/graphcommerce-org/graphcommerce/commit/eab3f0b0b459f5b6cc4e50d787ac1e8ae545b708) - Solve issue where a Hygraph DynamicRow conditions were missing fields in the OrCondition ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
|
278
54
|
|
|
279
|
-
## 8.0.0-canary.100
|
|
280
|
-
|
|
281
|
-
## 8.0.0-canary.99
|
|
282
|
-
|
|
283
|
-
## 8.0.0-canary.98
|
|
284
|
-
|
|
285
|
-
## 8.0.0-canary.97
|
|
286
|
-
|
|
287
|
-
## 8.0.0-canary.96
|
|
288
|
-
|
|
289
|
-
## 8.0.0-canary.95
|
|
290
|
-
|
|
291
|
-
## 8.0.0-canary.94
|
|
292
|
-
|
|
293
|
-
### Patch Changes
|
|
294
|
-
|
|
295
|
-
- [#2169](https://github.com/graphcommerce-org/graphcommerce/pull/2169) [`eab3f0b`](https://github.com/graphcommerce-org/graphcommerce/commit/eab3f0b0b459f5b6cc4e50d787ac1e8ae545b708) - Solve issue where a Hygraph DynamicRow conditions were missing fields in the OrCondition ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
|
296
|
-
|
|
297
|
-
## 8.0.0-canary.93
|
|
298
|
-
|
|
299
|
-
## 8.0.0-canary.92
|
|
300
|
-
|
|
301
|
-
## 8.0.0-canary.91
|
|
302
|
-
|
|
303
|
-
## 8.0.0-canary.90
|
|
304
|
-
|
|
305
|
-
## 8.0.0-canary.89
|
|
306
|
-
|
|
307
|
-
## 8.0.0-canary.88
|
|
308
|
-
|
|
309
|
-
## 8.0.0-canary.87
|
|
310
|
-
|
|
311
|
-
## 8.0.0-canary.86
|
|
312
|
-
|
|
313
|
-
## 8.0.0-canary.85
|
|
314
|
-
|
|
315
|
-
## 8.0.0-canary.84
|
|
316
|
-
|
|
317
|
-
## 8.0.0-canary.83
|
|
318
|
-
|
|
319
|
-
## 8.0.0-canary.82
|
|
320
|
-
|
|
321
|
-
## 8.0.0-canary.81
|
|
322
|
-
|
|
323
|
-
## 8.0.0-canary.80
|
|
324
|
-
|
|
325
|
-
## 8.0.0-canary.79
|
|
326
|
-
|
|
327
|
-
## 8.0.0-canary.78
|
|
328
|
-
|
|
329
|
-
## 8.0.0-canary.77
|
|
330
|
-
|
|
331
|
-
## 8.0.0-canary.76
|
|
332
|
-
|
|
333
|
-
## 8.0.0-canary.75
|
|
334
|
-
|
|
335
|
-
## 8.0.0-canary.74
|
|
336
|
-
|
|
337
|
-
## 8.0.0-canary.73
|
|
338
|
-
|
|
339
|
-
## 8.0.0-canary.72
|
|
340
|
-
|
|
341
|
-
## 8.0.0-canary.71
|
|
342
|
-
|
|
343
|
-
## 8.0.0-canary.70
|
|
344
|
-
|
|
345
|
-
## 8.0.0-canary.69
|
|
346
|
-
|
|
347
|
-
## 7.1.0-canary.68
|
|
348
|
-
|
|
349
|
-
## 7.1.0-canary.67
|
|
350
|
-
|
|
351
|
-
## 7.1.0-canary.66
|
|
352
|
-
|
|
353
|
-
## 7.1.0-canary.65
|
|
354
|
-
|
|
355
|
-
## 7.1.0-canary.64
|
|
356
|
-
|
|
357
|
-
## 7.1.0-canary.63
|
|
358
|
-
|
|
359
|
-
## 7.1.0-canary.62
|
|
360
|
-
|
|
361
|
-
## 7.1.0-canary.61
|
|
362
|
-
|
|
363
|
-
## 7.1.0-canary.60
|
|
364
|
-
|
|
365
|
-
## 7.1.0-canary.59
|
|
366
|
-
|
|
367
|
-
## 7.1.0-canary.58
|
|
368
|
-
|
|
369
|
-
## 7.1.0-canary.57
|
|
370
|
-
|
|
371
|
-
## 7.1.0-canary.56
|
|
372
|
-
|
|
373
|
-
## 7.1.0-canary.55
|
|
374
|
-
|
|
375
|
-
## 7.1.0-canary.54
|
|
376
|
-
|
|
377
|
-
## 7.1.0-canary.53
|
|
378
|
-
|
|
379
|
-
## 7.1.0-canary.52
|
|
380
|
-
|
|
381
|
-
## 7.1.0-canary.51
|
|
382
|
-
|
|
383
|
-
## 7.1.0-canary.50
|
|
384
|
-
|
|
385
|
-
## 7.1.0-canary.49
|
|
386
|
-
|
|
387
|
-
## 7.1.0-canary.48
|
|
388
|
-
|
|
389
|
-
## 7.1.0-canary.47
|
|
390
|
-
|
|
391
|
-
## 7.1.0-canary.46
|
|
392
|
-
|
|
393
|
-
## 7.1.0-canary.45
|
|
394
|
-
|
|
395
|
-
## 7.1.0-canary.38
|
|
396
|
-
|
|
397
|
-
## 7.1.0-canary.37
|
|
398
|
-
|
|
399
|
-
## 7.1.0-canary.36
|
|
400
|
-
|
|
401
|
-
## 7.1.0-canary.35
|
|
402
|
-
|
|
403
|
-
## 7.1.0-canary.34
|
|
404
|
-
|
|
405
|
-
## 7.1.0-canary.33
|
|
406
|
-
|
|
407
|
-
## 7.1.0-canary.32
|
|
408
|
-
|
|
409
|
-
## 7.1.0-canary.31
|
|
410
|
-
|
|
411
|
-
## 7.1.0-canary.30
|
|
412
|
-
|
|
413
|
-
## 7.1.0-canary.29
|
|
414
|
-
|
|
415
|
-
## 7.1.0-canary.28
|
|
416
|
-
|
|
417
|
-
## 7.1.0-canary.27
|
|
418
|
-
|
|
419
|
-
## 7.1.0-canary.26
|
|
420
|
-
|
|
421
|
-
## 7.1.0-canary.25
|
|
422
|
-
|
|
423
|
-
## 7.1.0-canary.24
|
|
424
|
-
|
|
425
|
-
## 7.1.0-canary.23
|
|
426
|
-
|
|
427
|
-
## 7.1.0-canary.22
|
|
428
|
-
|
|
429
|
-
## 7.1.0-canary.21
|
|
430
|
-
|
|
431
|
-
## 7.1.0-canary.20
|
|
432
|
-
|
|
433
|
-
### Patch Changes
|
|
434
|
-
|
|
435
|
-
- [#2095](https://github.com/graphcommerce-org/graphcommerce/pull/2095) [`519531eb4`](https://github.com/graphcommerce-org/graphcommerce/commit/519531eb48bf6c5b68703509d2bd64c8dfe5b92c) - Fix Hygraph CLI (Management SDK) | Add support for updating and deleting enumerations ([@JoshuaS98](https://github.com/JoshuaS98))
|
|
436
|
-
|
|
437
|
-
## 7.1.0-canary.19
|
|
438
|
-
|
|
439
|
-
## 7.1.0-canary.18
|
|
440
|
-
|
|
441
|
-
## 7.1.0-canary.17
|
|
442
|
-
|
|
443
|
-
## 7.1.0-canary.16
|
|
444
|
-
|
|
445
|
-
## 7.1.0-canary.15
|
|
446
|
-
|
|
447
|
-
## 7.1.0-canary.14
|
|
448
|
-
|
|
449
|
-
## 7.1.0-canary.13
|
|
450
|
-
|
|
451
|
-
## 7.1.0-canary.12
|
|
452
|
-
|
|
453
|
-
## 7.1.0-canary.11
|
|
454
|
-
|
|
455
|
-
## 7.1.0-canary.10
|
|
456
|
-
|
|
457
|
-
## 7.1.0-canary.9
|
|
458
|
-
|
|
459
|
-
## 7.1.0-canary.8
|
|
460
|
-
|
|
461
|
-
## 7.0.2-canary.7
|
|
462
|
-
|
|
463
|
-
## 7.0.2-canary.6
|
|
464
|
-
|
|
465
|
-
## 7.0.2-canary.5
|
|
466
|
-
|
|
467
55
|
## 7.0.1
|
|
468
56
|
|
|
469
57
|
### Patch Changes
|
|
470
58
|
|
|
471
59
|
- [#2047](https://github.com/graphcommerce-org/graphcommerce/pull/2047) [`136580b39`](https://github.com/graphcommerce-org/graphcommerce/commit/136580b39e3cffdd07e3fa087e049bd532c3e8f1) - Updated all dependencies to the latest version where possible. ([@paales](https://github.com/paales))
|
|
472
60
|
|
|
473
|
-
## 7.0.1-canary.15
|
|
474
|
-
|
|
475
|
-
## 7.0.1-canary.14
|
|
476
|
-
|
|
477
|
-
## 7.0.1-canary.13
|
|
478
|
-
|
|
479
|
-
## 7.0.1-canary.12
|
|
480
|
-
|
|
481
|
-
## 7.0.1-canary.11
|
|
482
|
-
|
|
483
|
-
## 7.0.1-canary.10
|
|
484
|
-
|
|
485
|
-
## 7.0.1-canary.9
|
|
486
|
-
|
|
487
|
-
## 7.0.1-canary.8
|
|
488
|
-
|
|
489
|
-
## 7.0.1-canary.7
|
|
490
|
-
|
|
491
|
-
## 7.0.1-canary.6
|
|
492
|
-
|
|
493
|
-
## 7.0.1-canary.5
|
|
494
|
-
|
|
495
|
-
## 7.0.1-canary.4
|
|
496
|
-
|
|
497
|
-
## 7.0.1-canary.3
|
|
498
|
-
|
|
499
|
-
## 7.0.1-canary.2
|
|
500
|
-
|
|
501
|
-
## 7.0.1-canary.1
|
|
502
|
-
|
|
503
|
-
## 7.0.1-canary.0
|
|
504
|
-
|
|
505
|
-
### Patch Changes
|
|
506
|
-
|
|
507
|
-
- [#2047](https://github.com/graphcommerce-org/graphcommerce/pull/2047) [`136580b39`](https://github.com/graphcommerce-org/graphcommerce/commit/136580b39e3cffdd07e3fa087e049bd532c3e8f1) - Updated all dependencies to the latest version where possible. ([@paales](https://github.com/paales))
|
|
508
|
-
|
|
509
61
|
## 7.0.0
|
|
510
62
|
|
|
511
63
|
### Major Changes
|
|
@@ -523,205 +75,3 @@
|
|
|
523
75
|
- [#1924](https://github.com/graphcommerce-org/graphcommerce/pull/1924) [`04581f619`](https://github.com/graphcommerce-org/graphcommerce/commit/04581f619c609f2f6ca5268ee5effb6a1db3f0eb) - Use the latest branch from graphql-mesh so that all versions are in sync ([@paales](https://github.com/paales))
|
|
524
76
|
|
|
525
77
|
- [#1960](https://github.com/graphcommerce-org/graphcommerce/pull/1960) [`86e14569b`](https://github.com/graphcommerce-org/graphcommerce/commit/86e14569b1f68f73be7f93b614e36b382c5debff) - Updated to the latest release of GraphQL codegen and solve compatibility issues with our own generator ([@paales](https://github.com/paales))
|
|
526
|
-
|
|
527
|
-
## 6.2.0-canary.98
|
|
528
|
-
|
|
529
|
-
## 6.2.0-canary.97
|
|
530
|
-
|
|
531
|
-
## 6.2.0-canary.96
|
|
532
|
-
|
|
533
|
-
## 6.2.0-canary.95
|
|
534
|
-
|
|
535
|
-
## 6.2.0-canary.94
|
|
536
|
-
|
|
537
|
-
## 6.2.0-canary.93
|
|
538
|
-
|
|
539
|
-
## 6.2.0-canary.92
|
|
540
|
-
|
|
541
|
-
## 6.2.0-canary.91
|
|
542
|
-
|
|
543
|
-
## 6.2.0-canary.90
|
|
544
|
-
|
|
545
|
-
## 6.2.0-canary.89
|
|
546
|
-
|
|
547
|
-
## 6.2.0-canary.88
|
|
548
|
-
|
|
549
|
-
## 6.2.0-canary.87
|
|
550
|
-
|
|
551
|
-
## 6.2.0-canary.86
|
|
552
|
-
|
|
553
|
-
## 6.2.0-canary.85
|
|
554
|
-
|
|
555
|
-
## 6.2.0-canary.84
|
|
556
|
-
|
|
557
|
-
## 6.2.0-canary.83
|
|
558
|
-
|
|
559
|
-
### Minor Changes
|
|
560
|
-
|
|
561
|
-
- [#1938](https://github.com/graphcommerce-org/graphcommerce/pull/1938) [`5aa6558a4`](https://github.com/graphcommerce-org/graphcommerce/commit/5aa6558a4e48d8d670284802fed65a934429b0ea) - Introduce hygraph-cli for schema migrations ([@JoshuaS98](https://github.com/JoshuaS98))
|
|
562
|
-
|
|
563
|
-
## 6.2.0-canary.82
|
|
564
|
-
|
|
565
|
-
## 6.2.0-canary.81
|
|
566
|
-
|
|
567
|
-
## 6.2.0-canary.80
|
|
568
|
-
|
|
569
|
-
## 6.2.0-canary.79
|
|
570
|
-
|
|
571
|
-
## 6.2.0-canary.78
|
|
572
|
-
|
|
573
|
-
## 6.2.0-canary.77
|
|
574
|
-
|
|
575
|
-
## 6.2.0-canary.76
|
|
576
|
-
|
|
577
|
-
## 6.2.0-canary.75
|
|
578
|
-
|
|
579
|
-
## 6.2.0-canary.74
|
|
580
|
-
|
|
581
|
-
## 6.2.0-canary.73
|
|
582
|
-
|
|
583
|
-
## 6.2.0-canary.72
|
|
584
|
-
|
|
585
|
-
## 6.2.0-canary.71
|
|
586
|
-
|
|
587
|
-
## 6.2.0-canary.70
|
|
588
|
-
|
|
589
|
-
## 6.2.0-canary.69
|
|
590
|
-
|
|
591
|
-
### Patch Changes
|
|
592
|
-
|
|
593
|
-
- [#2012](https://github.com/graphcommerce-org/graphcommerce/pull/2012) [`1dbb3ae13`](https://github.com/graphcommerce-org/graphcommerce/commit/1dbb3ae13553992ee1ed77f375375560f28c418c) - Upgrade graphql to 16.7.1, add graphql as peer dependency ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
|
|
594
|
-
|
|
595
|
-
## 6.2.0-canary.68
|
|
596
|
-
|
|
597
|
-
## 6.2.0-canary.67
|
|
598
|
-
|
|
599
|
-
## 6.2.0-canary.66
|
|
600
|
-
|
|
601
|
-
## 6.2.0-canary.65
|
|
602
|
-
|
|
603
|
-
## 6.2.0-canary.64
|
|
604
|
-
|
|
605
|
-
## 6.2.0-canary.63
|
|
606
|
-
|
|
607
|
-
## 6.2.0-canary.62
|
|
608
|
-
|
|
609
|
-
## 6.2.0-canary.61
|
|
610
|
-
|
|
611
|
-
## 6.2.0-canary.60
|
|
612
|
-
|
|
613
|
-
## 6.2.0-canary.59
|
|
614
|
-
|
|
615
|
-
## 6.2.0-canary.58
|
|
616
|
-
|
|
617
|
-
## 6.2.0-canary.57
|
|
618
|
-
|
|
619
|
-
## 6.2.0-canary.56
|
|
620
|
-
|
|
621
|
-
## 6.2.0-canary.55
|
|
622
|
-
|
|
623
|
-
## 6.2.0-canary.54
|
|
624
|
-
|
|
625
|
-
## 6.2.0-canary.53
|
|
626
|
-
|
|
627
|
-
## 6.2.0-canary.52
|
|
628
|
-
|
|
629
|
-
## 6.2.0-canary.51
|
|
630
|
-
|
|
631
|
-
## 6.2.0-canary.50
|
|
632
|
-
|
|
633
|
-
## 6.2.0-canary.49
|
|
634
|
-
|
|
635
|
-
## 6.2.0-canary.48
|
|
636
|
-
|
|
637
|
-
## 6.2.0-canary.47
|
|
638
|
-
|
|
639
|
-
## 6.2.0-canary.46
|
|
640
|
-
|
|
641
|
-
## 6.2.0-canary.45
|
|
642
|
-
|
|
643
|
-
## 6.2.0-canary.44
|
|
644
|
-
|
|
645
|
-
## 6.2.0-canary.43
|
|
646
|
-
|
|
647
|
-
## 6.2.0-canary.42
|
|
648
|
-
|
|
649
|
-
## 6.2.0-canary.41
|
|
650
|
-
|
|
651
|
-
### Patch Changes
|
|
652
|
-
|
|
653
|
-
- [#1960](https://github.com/graphcommerce-org/graphcommerce/pull/1960) [`86e14569b`](https://github.com/graphcommerce-org/graphcommerce/commit/86e14569b1f68f73be7f93b614e36b382c5debff) - Updated to the latest release of GraphQL codegen and solve compatibility issues with our own generator ([@paales](https://github.com/paales))
|
|
654
|
-
|
|
655
|
-
## 6.2.0-canary.40
|
|
656
|
-
|
|
657
|
-
## 6.2.0-canary.39
|
|
658
|
-
|
|
659
|
-
## 6.2.0-canary.38
|
|
660
|
-
|
|
661
|
-
## 6.2.0-canary.37
|
|
662
|
-
|
|
663
|
-
## 6.2.0-canary.36
|
|
664
|
-
|
|
665
|
-
## 6.2.0-canary.35
|
|
666
|
-
|
|
667
|
-
## 6.2.0-canary.34
|
|
668
|
-
|
|
669
|
-
## 6.2.0-canary.33
|
|
670
|
-
|
|
671
|
-
## 6.2.0-canary.32
|
|
672
|
-
|
|
673
|
-
## 6.2.0-canary.31
|
|
674
|
-
|
|
675
|
-
## 6.2.0-canary.30
|
|
676
|
-
|
|
677
|
-
## 6.2.0-canary.29
|
|
678
|
-
|
|
679
|
-
## 6.2.0-canary.28
|
|
680
|
-
|
|
681
|
-
## 6.2.0-canary.27
|
|
682
|
-
|
|
683
|
-
## 6.2.0-canary.26
|
|
684
|
-
|
|
685
|
-
## 6.2.0-canary.25
|
|
686
|
-
|
|
687
|
-
## 6.2.0-canary.24
|
|
688
|
-
|
|
689
|
-
## 6.2.0-canary.23
|
|
690
|
-
|
|
691
|
-
## 6.2.0-canary.22
|
|
692
|
-
|
|
693
|
-
## 6.2.0-canary.21
|
|
694
|
-
|
|
695
|
-
## 6.2.0-canary.20
|
|
696
|
-
|
|
697
|
-
## 6.2.0-canary.19
|
|
698
|
-
|
|
699
|
-
## 6.2.0-canary.18
|
|
700
|
-
|
|
701
|
-
## 6.2.0-canary.17
|
|
702
|
-
|
|
703
|
-
## 6.2.0-canary.16
|
|
704
|
-
|
|
705
|
-
## 6.2.0-canary.15
|
|
706
|
-
|
|
707
|
-
## 6.2.0-canary.14
|
|
708
|
-
|
|
709
|
-
## 6.2.0-canary.13
|
|
710
|
-
|
|
711
|
-
### Patch Changes
|
|
712
|
-
|
|
713
|
-
- [#1924](https://github.com/graphcommerce-org/graphcommerce/pull/1924) [`04581f619`](https://github.com/graphcommerce-org/graphcommerce/commit/04581f619c609f2f6ca5268ee5effb6a1db3f0eb) - Use the latest branch from graphql-mesh so that all versions are in sync ([@paales](https://github.com/paales))
|
|
714
|
-
|
|
715
|
-
## 6.2.0-canary.12
|
|
716
|
-
|
|
717
|
-
## 6.2.0-canary.11
|
|
718
|
-
|
|
719
|
-
## 6.2.0-canary.10
|
|
720
|
-
|
|
721
|
-
## 6.2.0-canary.9
|
|
722
|
-
|
|
723
|
-
## 6.2.0-canary.8
|
|
724
|
-
|
|
725
|
-
### Minor Changes
|
|
726
|
-
|
|
727
|
-
- [#1912](https://github.com/graphcommerce-org/graphcommerce/pull/1912) [`a43d389e9`](https://github.com/graphcommerce-org/graphcommerce/commit/a43d389e956fe69b73238b12c98c781b7044e4bb) - Added dynamic rows feature and better performance for Hygraph ([@JoshuaS98](https://github.com/JoshuaS98))
|
package/dist/UpsertClient.js
CHANGED
|
@@ -8,14 +8,17 @@ class UpsertClient extends management_sdk_1.Client {
|
|
|
8
8
|
super(params);
|
|
9
9
|
this.schema = schema;
|
|
10
10
|
}
|
|
11
|
+
/** @public */
|
|
11
12
|
upsertModel(data) {
|
|
12
13
|
const exists = this.schema.models.some((m) => m.apiId === data.apiId);
|
|
13
14
|
return exists ? this.createModel(data) : this.updateModel(data);
|
|
14
15
|
}
|
|
16
|
+
/** @public */
|
|
15
17
|
upsertComponent(data) {
|
|
16
18
|
const exists = this.schema.models.some((m) => m.apiId === data.apiId);
|
|
17
19
|
return exists ? this.createComponent(data) : this.updateComponent(data);
|
|
18
20
|
}
|
|
21
|
+
/** @public */
|
|
19
22
|
upsertSimpleField(data) {
|
|
20
23
|
const model = this.schema.models.find((m) => m.apiId === data.parentApiId);
|
|
21
24
|
const exists = model?.fields.some((f) => f.apiId === data.apiId);
|
|
@@ -28,39 +31,47 @@ class UpsertClient extends management_sdk_1.Client {
|
|
|
28
31
|
// const exists = model?.fields.some((f) => f.apiId === data.apiId)
|
|
29
32
|
// return exists ? this.createRemoteField(data) : this.updateRemoteField(data)
|
|
30
33
|
// }
|
|
34
|
+
/** @public */
|
|
31
35
|
upsertRelationalField(data) {
|
|
32
36
|
const model = this.schema.models.find((m) => m.apiId === data.parentApiId);
|
|
33
37
|
const exists = model?.fields.some((f) => f.apiId === data.apiId);
|
|
34
38
|
return exists ? this.createRelationalField(data) : this.updateRelationalField(data);
|
|
35
39
|
}
|
|
40
|
+
/** @public */
|
|
36
41
|
upsertUnionField(data) {
|
|
37
42
|
const model = this.schema.models.find((m) => m.apiId === data.parentApiId);
|
|
38
43
|
const exists = model?.fields.some((f) => f.apiId === data.apiId);
|
|
39
44
|
return exists ? this.createUnionField(data) : this.updateUnionField(data);
|
|
40
45
|
}
|
|
46
|
+
/** @public */
|
|
41
47
|
upsertComponentField(data) {
|
|
42
48
|
const model = this.schema.models.find((m) => m.apiId === data.parentApiId);
|
|
43
49
|
const exists = model?.fields.some((f) => f.apiId === data.apiId);
|
|
44
50
|
return exists ? this.createComponentField(data) : this.updateComponentField(data);
|
|
45
51
|
}
|
|
52
|
+
/** @public */
|
|
46
53
|
upsertComponentUnionField(data) {
|
|
47
54
|
const model = this.schema.models.find((m) => m.apiId === data.parentApiId);
|
|
48
55
|
const exists = model?.fields.some((f) => f.apiId === data.apiId);
|
|
49
56
|
return exists ? this.createComponentUnionField(data) : this.updateComponentUnionField(data);
|
|
50
57
|
}
|
|
58
|
+
/** @public */
|
|
51
59
|
upsertEnumeration(data) {
|
|
52
60
|
const exists = this.schema.enumerations.some((e) => e.apiId === data.apiId);
|
|
53
61
|
return exists ? this.createEnumeration(data) : this.updateEnumeration(data);
|
|
54
62
|
}
|
|
63
|
+
/** @public */
|
|
55
64
|
upsertEnumerableField(data) {
|
|
56
65
|
const model = this.schema.models.find((m) => m.apiId === data.parentApiId);
|
|
57
66
|
const exists = model?.fields.some((f) => f.apiId === data.apiId);
|
|
58
67
|
return exists ? this.createEnumerableField(data) : this.updateEnumerableField(data);
|
|
59
68
|
}
|
|
69
|
+
/** @public */
|
|
60
70
|
upsertStage(data) {
|
|
61
71
|
const exists = this.schema.stages.some((m) => m.apiId === data.apiId);
|
|
62
72
|
return exists ? this.createStage(data) : this.updateStage(data);
|
|
63
73
|
}
|
|
74
|
+
/** @public */
|
|
64
75
|
upsertLocale(data) {
|
|
65
76
|
const exists = this.schema.locales.some((m) => m.apiId === data.apiId);
|
|
66
77
|
return exists ? this.createLocale(data) : this.updateLocale(data);
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
@@ -31,9 +8,9 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
31
8
|
const next_config_1 = require("@graphcommerce/next-config");
|
|
32
9
|
const dotenv_1 = __importDefault(require("dotenv"));
|
|
33
10
|
const prompts_1 = __importDefault(require("prompts"));
|
|
34
|
-
const
|
|
35
|
-
const availableMigrations = __importStar(require("./migrations"));
|
|
11
|
+
const migrations_1 = require("./migrations");
|
|
36
12
|
const readSchema_1 = require("./readSchema");
|
|
13
|
+
const UpsertClient_1 = require("./UpsertClient");
|
|
37
14
|
const getConfig_1 = require("./utils/getConfig");
|
|
38
15
|
const getEndpointUrl_1 = require("./utils/getEndpointUrl");
|
|
39
16
|
const getManagementClient_1 = require("./utils/getManagementClient");
|
|
@@ -54,7 +31,7 @@ async function migrateHygraphCli() {
|
|
|
54
31
|
const schemaViewer = await (0, readSchema_1.readSchema)(mangementClient, hygraphConfig.projectId);
|
|
55
32
|
const schema = schemaViewer.viewer.project.environment.contentModel;
|
|
56
33
|
// A list of possible migrations
|
|
57
|
-
const possibleMigrations = Object.entries(availableMigrations);
|
|
34
|
+
const possibleMigrations = Object.entries(migrations_1.availableMigrations);
|
|
58
35
|
// Here we setup the list we ask the user to choose from
|
|
59
36
|
const selectMigrationInput = {
|
|
60
37
|
type: 'select',
|
package/dist/migrations/index.js
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
3
|
+
exports.availableMigrations = void 0;
|
|
4
|
+
const graphcommerce5to6_1 = require("./graphcommerce5to6");
|
|
5
|
+
const graphcommerce6to7_1 = require("./graphcommerce6to7");
|
|
6
|
+
const graphcommerce7to8_1 = require("./graphcommerce7to8");
|
|
7
|
+
const graphcommerce8to9_1 = require("./graphcommerce8to9");
|
|
8
|
+
exports.availableMigrations = [
|
|
9
|
+
graphcommerce5to6_1.graphcommerce5to6,
|
|
10
|
+
graphcommerce6to7_1.graphcommerce6to7,
|
|
11
|
+
graphcommerce7to8_1.graphcommerce7to8,
|
|
12
|
+
graphcommerce8to9_1.graphcommerce8to9,
|
|
13
|
+
];
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/hygraph-cli",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "9.0.
|
|
5
|
+
"version": "9.0.1-canary.0",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "tsc --preserveWatchOutput --watch",
|
|
8
8
|
"build": "tsc",
|
|
@@ -12,23 +12,23 @@
|
|
|
12
12
|
"main": "dist/index.js",
|
|
13
13
|
"types": "src/index.ts",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@hygraph/management-sdk": "1.2.
|
|
16
|
-
"@whatwg-node/fetch": "^0.
|
|
15
|
+
"@hygraph/management-sdk": "1.2.5",
|
|
16
|
+
"@whatwg-node/fetch": "^0.10.1",
|
|
17
|
+
"graphql": "^16.10.0",
|
|
17
18
|
"graphql-tag": "^2.12.6",
|
|
18
19
|
"prompts": "^2.4.2"
|
|
19
20
|
},
|
|
20
21
|
"peerDependencies": {
|
|
21
|
-
"@apollo/client": "
|
|
22
|
-
"@graphcommerce/eslint-config-pwa": "^9.0.
|
|
23
|
-
"@graphcommerce/next-config": "^9.0.
|
|
24
|
-
"@graphcommerce/prettier-config-pwa": "^9.0.
|
|
25
|
-
"@graphcommerce/typescript-config-pwa": "^9.0.
|
|
26
|
-
"dotenv": "^16.1.4"
|
|
27
|
-
"graphql": "^16.7.1"
|
|
22
|
+
"@apollo/client": "*",
|
|
23
|
+
"@graphcommerce/eslint-config-pwa": "^9.0.1-canary.0",
|
|
24
|
+
"@graphcommerce/next-config": "^9.0.1-canary.0",
|
|
25
|
+
"@graphcommerce/prettier-config-pwa": "^9.0.1-canary.0",
|
|
26
|
+
"@graphcommerce/typescript-config-pwa": "^9.0.1-canary.0",
|
|
27
|
+
"dotenv": "^16.1.4"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/prompts": "^2.4.9",
|
|
31
|
-
"typescript": "5.
|
|
31
|
+
"typescript": "5.7.2"
|
|
32
32
|
},
|
|
33
33
|
"sideEffects": false,
|
|
34
34
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
package/src/UpsertClient.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
BatchMigrationCreateComponentFieldInput,
|
|
3
3
|
BatchMigrationCreateComponentInput,
|
|
4
4
|
BatchMigrationCreateComponentUnionFieldInput,
|
|
@@ -10,9 +10,9 @@ import {
|
|
|
10
10
|
BatchMigrationCreateSimpleFieldInput,
|
|
11
11
|
BatchMigrationCreateStageInput,
|
|
12
12
|
BatchMigrationCreateUnionFieldInput,
|
|
13
|
-
Client,
|
|
14
13
|
} from '@hygraph/management-sdk'
|
|
15
|
-
import {
|
|
14
|
+
import { Client } from '@hygraph/management-sdk'
|
|
15
|
+
import type { Schema } from './types'
|
|
16
16
|
|
|
17
17
|
interface MigrationParams {
|
|
18
18
|
name?: string
|
|
@@ -28,16 +28,19 @@ export class UpsertClient extends Client {
|
|
|
28
28
|
super(params)
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
/** @public */
|
|
31
32
|
upsertModel(data: BatchMigrationCreateModelInput) {
|
|
32
33
|
const exists = this.schema.models.some((m) => m.apiId === data.apiId)
|
|
33
34
|
return exists ? this.createModel(data) : this.updateModel(data)
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
/** @public */
|
|
36
38
|
upsertComponent(data: BatchMigrationCreateComponentInput) {
|
|
37
39
|
const exists = this.schema.models.some((m) => m.apiId === data.apiId)
|
|
38
40
|
return exists ? this.createComponent(data) : this.updateComponent(data)
|
|
39
41
|
}
|
|
40
42
|
|
|
43
|
+
/** @public */
|
|
41
44
|
upsertSimpleField(data: BatchMigrationCreateSimpleFieldInput) {
|
|
42
45
|
const model = this.schema.models.find((m) => m.apiId === data.parentApiId)
|
|
43
46
|
const exists = model?.fields.some((f) => f.apiId === data.apiId)
|
|
@@ -52,46 +55,54 @@ export class UpsertClient extends Client {
|
|
|
52
55
|
// return exists ? this.createRemoteField(data) : this.updateRemoteField(data)
|
|
53
56
|
// }
|
|
54
57
|
|
|
58
|
+
/** @public */
|
|
55
59
|
upsertRelationalField(data: BatchMigrationCreateRelationalFieldInput) {
|
|
56
60
|
const model = this.schema.models.find((m) => m.apiId === data.parentApiId)
|
|
57
61
|
const exists = model?.fields.some((f) => f.apiId === data.apiId)
|
|
58
62
|
return exists ? this.createRelationalField(data) : this.updateRelationalField(data)
|
|
59
63
|
}
|
|
60
64
|
|
|
65
|
+
/** @public */
|
|
61
66
|
upsertUnionField(data: BatchMigrationCreateUnionFieldInput) {
|
|
62
67
|
const model = this.schema.models.find((m) => m.apiId === data.parentApiId)
|
|
63
68
|
const exists = model?.fields.some((f) => f.apiId === data.apiId)
|
|
64
69
|
return exists ? this.createUnionField(data) : this.updateUnionField(data)
|
|
65
70
|
}
|
|
66
71
|
|
|
72
|
+
/** @public */
|
|
67
73
|
upsertComponentField(data: BatchMigrationCreateComponentFieldInput) {
|
|
68
74
|
const model = this.schema.models.find((m) => m.apiId === data.parentApiId)
|
|
69
75
|
const exists = model?.fields.some((f) => f.apiId === data.apiId)
|
|
70
76
|
return exists ? this.createComponentField(data) : this.updateComponentField(data)
|
|
71
77
|
}
|
|
72
78
|
|
|
79
|
+
/** @public */
|
|
73
80
|
upsertComponentUnionField(data: BatchMigrationCreateComponentUnionFieldInput) {
|
|
74
81
|
const model = this.schema.models.find((m) => m.apiId === data.parentApiId)
|
|
75
82
|
const exists = model?.fields.some((f) => f.apiId === data.apiId)
|
|
76
83
|
return exists ? this.createComponentUnionField(data) : this.updateComponentUnionField(data)
|
|
77
84
|
}
|
|
78
85
|
|
|
86
|
+
/** @public */
|
|
79
87
|
upsertEnumeration(data: BatchMigrationCreateEnumerationInput) {
|
|
80
88
|
const exists = this.schema.enumerations.some((e) => e.apiId === data.apiId)
|
|
81
89
|
return exists ? this.createEnumeration(data) : this.updateEnumeration(data)
|
|
82
90
|
}
|
|
83
91
|
|
|
92
|
+
/** @public */
|
|
84
93
|
upsertEnumerableField(data: BatchMigrationCreateEnumerableFieldInput) {
|
|
85
94
|
const model = this.schema.models.find((m) => m.apiId === data.parentApiId)
|
|
86
95
|
const exists = model?.fields.some((f) => f.apiId === data.apiId)
|
|
87
96
|
return exists ? this.createEnumerableField(data) : this.updateEnumerableField(data)
|
|
88
97
|
}
|
|
89
98
|
|
|
99
|
+
/** @public */
|
|
90
100
|
upsertStage(data: BatchMigrationCreateStageInput) {
|
|
91
101
|
const exists = this.schema.stages.some((m) => m.apiId === data.apiId)
|
|
92
102
|
return exists ? this.createStage(data) : this.updateStage(data)
|
|
93
103
|
}
|
|
94
104
|
|
|
105
|
+
/** @public */
|
|
95
106
|
upsertLocale(data: BatchMigrationCreateLocaleInput) {
|
|
96
107
|
const exists = this.schema.locales.some((m) => m.apiId === data.apiId)
|
|
97
108
|
return exists ? this.createLocale(data) : this.updateLocale(data)
|
package/src/migrateHygraphCli.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import fs from 'fs'
|
|
2
2
|
import { loadConfig } from '@graphcommerce/next-config'
|
|
3
3
|
import dotenv from 'dotenv'
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import type { PromptObject } from 'prompts'
|
|
5
|
+
import prompts from 'prompts'
|
|
6
|
+
import { availableMigrations } from './migrations'
|
|
7
7
|
import { readSchema } from './readSchema'
|
|
8
|
-
import { MigrationFunction, Schema } from './types'
|
|
8
|
+
import type { MigrationFunction, Schema } from './types'
|
|
9
|
+
import { UpsertClient } from './UpsertClient'
|
|
9
10
|
import { getConfig } from './utils/getConfig'
|
|
10
11
|
import { getEnvironment } from './utils/getEndpointUrl'
|
|
11
12
|
import { getManagementClient } from './utils/getManagementClient'
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
BatchMigrationCreateModelInput,
|
|
1
|
+
import type {
|
|
2
|
+
BatchMigrationCreateComponentFieldInput,
|
|
4
3
|
BatchMigrationCreateComponentInput,
|
|
5
|
-
|
|
6
|
-
BatchMigrationCreateSimpleFieldInput,
|
|
4
|
+
BatchMigrationCreateComponentUnionFieldInput,
|
|
7
5
|
BatchMigrationCreateEnumerableFieldInput,
|
|
6
|
+
BatchMigrationCreateEnumerationInput,
|
|
7
|
+
BatchMigrationCreateModelInput,
|
|
8
8
|
BatchMigrationCreateRelationalFieldInput,
|
|
9
|
+
BatchMigrationCreateSimpleFieldInput,
|
|
9
10
|
BatchMigrationCreateUnionFieldInput,
|
|
10
|
-
BatchMigrationCreateComponentFieldInput,
|
|
11
11
|
BatchMigrationDeleteComponentInput,
|
|
12
12
|
BatchMigrationDeleteEnumerationInput,
|
|
13
|
+
BatchMigrationDeleteFieldInput,
|
|
13
14
|
BatchMigrationDeleteModelInput,
|
|
14
15
|
BatchMigrationUpdateComponentFieldInput,
|
|
15
16
|
BatchMigrationUpdateComponentInput,
|
|
17
|
+
BatchMigrationUpdateComponentUnionFieldInput,
|
|
16
18
|
BatchMigrationUpdateEnumerableFieldInput,
|
|
17
19
|
BatchMigrationUpdateEnumerationInput,
|
|
18
20
|
BatchMigrationUpdateModelInput,
|
|
19
21
|
BatchMigrationUpdateRelationalFieldInput,
|
|
20
22
|
BatchMigrationUpdateSimpleFieldInput,
|
|
21
23
|
BatchMigrationUpdateUnionFieldInput,
|
|
22
|
-
BatchMigrationDeleteFieldInput,
|
|
23
|
-
BatchMigrationCreateComponentUnionFieldInput,
|
|
24
|
-
BatchMigrationUpdateComponentUnionFieldInput,
|
|
25
24
|
Client,
|
|
26
25
|
} from '@hygraph/management-sdk'
|
|
27
26
|
import dotenv from 'dotenv'
|
|
28
|
-
import { Schema } from './types'
|
|
29
|
-
import {
|
|
27
|
+
import type { Schema } from './types'
|
|
28
|
+
import { capitalize, graphcommerceLog } from './utils/graphCommerceLog'
|
|
30
29
|
|
|
31
30
|
dotenv.config()
|
|
32
31
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RelationalFieldType, SimpleFieldType, VisibilityTypes } from '@hygraph/management-sdk'
|
|
2
2
|
import { migrationActionFactory } from '../migrationActionFactory'
|
|
3
|
-
import { MigrationFunction } from '../types'
|
|
3
|
+
import type { MigrationFunction } from '../types'
|
|
4
4
|
|
|
5
5
|
export const graphcommerce5to6: MigrationFunction = async (schema, client) => {
|
|
6
6
|
const { migrationAction } = migrationActionFactory(schema, client)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SimpleFieldType, VisibilityTypes } from '@hygraph/management-sdk'
|
|
2
2
|
import { migrationActionFactory } from '../migrationActionFactory'
|
|
3
|
-
import { MigrationFunction } from '../types'
|
|
3
|
+
import type { MigrationFunction } from '../types'
|
|
4
4
|
|
|
5
5
|
export const graphcommerce6to7: MigrationFunction = async (schema, client) => {
|
|
6
6
|
const { migrationAction } = migrationActionFactory(schema, client)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VisibilityTypes } from '@hygraph/management-sdk'
|
|
2
2
|
import { migrationActionFactory } from '../migrationActionFactory'
|
|
3
|
-
import { MigrationFunction } from '../types'
|
|
3
|
+
import type { MigrationFunction } from '../types'
|
|
4
4
|
|
|
5
5
|
export const graphcommerce7to8: MigrationFunction = async (schema, client) => {
|
|
6
6
|
const { migrationAction } = migrationActionFactory(schema, client)
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
BatchMigrationCreateEnumerableFieldInput,
|
|
3
3
|
BatchMigrationCreateEnumerationInput,
|
|
4
4
|
BatchMigrationCreateModelInput,
|
|
5
5
|
BatchMigrationCreateSimpleFieldInput,
|
|
6
|
-
SimpleFieldType,
|
|
7
|
-
VisibilityTypes,
|
|
8
6
|
} from '@hygraph/management-sdk'
|
|
7
|
+
import { SimpleFieldType, VisibilityTypes } from '@hygraph/management-sdk'
|
|
9
8
|
import { migrationActionFactory } from '../migrationActionFactory'
|
|
10
|
-
import { MigrationFunction } from '../types'
|
|
9
|
+
import type { MigrationFunction } from '../types'
|
|
11
10
|
|
|
12
11
|
export const graphcommerce8to9: MigrationFunction = async (schema, client) => {
|
|
13
12
|
const { migrationAction } = migrationActionFactory(schema, client)
|
package/src/migrations/index.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { graphcommerce5to6 } from './graphcommerce5to6'
|
|
2
|
+
import { graphcommerce6to7 } from './graphcommerce6to7'
|
|
3
|
+
import { graphcommerce7to8 } from './graphcommerce7to8'
|
|
4
|
+
import { graphcommerce8to9 } from './graphcommerce8to9'
|
|
5
|
+
|
|
6
|
+
export const availableMigrations = [
|
|
7
|
+
graphcommerce5to6,
|
|
8
|
+
graphcommerce6to7,
|
|
9
|
+
graphcommerce7to8,
|
|
10
|
+
graphcommerce8to9,
|
|
11
|
+
]
|
package/src/readSchema.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ApolloClient,
|
|
2
|
-
import {
|
|
1
|
+
import type { ApolloClient, NormalizedCacheObject } from '@apollo/client'
|
|
2
|
+
import { gql } from '@apollo/client'
|
|
3
|
+
import type { Schema } from './types'
|
|
3
4
|
|
|
4
5
|
export const readSchema = async (
|
|
5
6
|
managementClient: ApolloClient<NormalizedCacheObject>,
|
package/src/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
-
import type {
|
|
2
|
+
import type { Component, Enumeration, Locale, Model, Stage } from '@hygraph/management-sdk'
|
|
3
3
|
import type { MigrationInfo } from '@hygraph/management-sdk/dist/src/ManagementAPIClient'
|
|
4
4
|
import type { UpsertClient } from './UpsertClient'
|
|
5
5
|
|
package/src/utils/getConfig.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ApolloClient, NormalizedCacheObject } from '@apollo/client'
|
|
1
|
+
import type { ApolloClient, NormalizedCacheObject } from '@apollo/client'
|
|
2
2
|
import gql from 'graphql-tag'
|
|
3
|
-
import { HygraphConfig } from './getConfig'
|
|
3
|
+
import type { HygraphConfig } from './getConfig'
|
|
4
4
|
|
|
5
5
|
export async function getEnvironment(
|
|
6
6
|
client: ApolloClient<NormalizedCacheObject>,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApolloClient, HttpLink, InMemoryCache } from '@apollo/client'
|
|
2
|
-
import { HygraphConfig } from './getConfig'
|
|
2
|
+
import type { HygraphConfig } from './getConfig'
|
|
3
3
|
|
|
4
4
|
export function getManagementClient(config: HygraphConfig) {
|
|
5
5
|
const { authToken: accessToken, uri } = config
|