@graphcommerce/hygraph-cli 9.0.0-canary.98 → 9.0.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 CHANGED
@@ -1,270 +1,46 @@
1
1
  # @graphcommerce/hygraph-cli
2
2
 
3
- ## 9.0.0-canary.98
3
+ ## 9.0.0
4
4
 
5
- ## 9.0.0-canary.97
6
-
7
- ## 9.0.0-canary.96
8
-
9
- ## 9.0.0-canary.95
10
-
11
- ## 9.0.0-canary.94
12
-
13
- ## 9.0.0-canary.93
14
-
15
- ## 9.0.0-canary.92
16
-
17
- ## 9.0.0-canary.91
18
-
19
- ## 9.0.0-canary.90
20
-
21
- ## 9.0.0-canary.89
22
-
23
- ## 9.0.0-canary.88
24
-
25
- ## 9.0.0-canary.87
26
-
27
- ## 9.0.0-canary.86
28
-
29
- ## 9.0.0-canary.85
30
-
31
- ## 9.0.0-canary.84
32
-
33
- ## 9.0.0-canary.83
34
-
35
- ## 9.0.0-canary.82
36
-
37
- ## 9.0.0-canary.81
38
-
39
- ## 9.0.0-canary.80
40
-
41
- ## 9.0.0-canary.79
42
-
43
- ## 9.0.0-canary.78
44
-
45
- ## 9.0.0-canary.77
46
-
47
- ## 9.0.0-canary.76
48
-
49
- ## 9.0.0-canary.75
50
-
51
- ## 9.0.0-canary.74
52
-
53
- ## 9.0.0-canary.73
54
-
55
- ## 9.0.0-canary.72
56
-
57
- ## 9.0.0-canary.71
58
-
59
- ## 9.0.0-canary.70
60
-
61
- ## 9.0.0-canary.69
62
-
63
- ## 9.0.0-canary.68
64
-
65
- ## 9.0.0-canary.67
66
-
67
- ## 9.0.0-canary.66
68
-
69
- ## 9.0.0-canary.65
70
-
71
- ## 9.0.0-canary.64
72
-
73
- ## 9.0.0-canary.63
74
-
75
- ## 9.0.0-canary.62
76
-
77
- ## 9.0.0-canary.61
78
-
79
- ## 9.0.0-canary.60
80
-
81
- ## 9.0.0-canary.59
82
-
83
- ## 9.0.0-canary.58
84
-
85
- ## 9.0.0-canary.57
86
-
87
- ## 9.0.0-canary.56
88
-
89
- ## 9.0.0-canary.55
90
-
91
- ## 9.0.0-canary.54
92
-
93
- ## 8.1.0-canary.53
94
-
95
- ## 8.1.0-canary.52
96
-
97
- ## 8.1.0-canary.51
98
-
99
- ## 8.1.0-canary.50
100
-
101
- ## 8.1.0-canary.49
102
-
103
- ## 8.1.0-canary.48
104
-
105
- ## 8.1.0-canary.47
106
-
107
- ## 8.1.0-canary.46
108
-
109
- ## 8.1.0-canary.45
110
-
111
- ## 8.1.0-canary.44
112
-
113
- ## 8.1.0-canary.43
114
-
115
- ## 8.1.0-canary.42
116
-
117
- ## 8.1.0-canary.41
118
-
119
- ## 8.1.0-canary.40
120
-
121
- ## 8.1.0-canary.39
122
-
123
- ## 8.1.0-canary.38
124
-
125
- ## 8.1.0-canary.37
126
-
127
- ## 8.1.0-canary.36
128
-
129
- ## 8.1.0-canary.35
130
-
131
- ## 8.1.0-canary.34
132
-
133
- ## 8.1.0-canary.33
134
-
135
- ## 8.1.0-canary.32
136
-
137
- ## 8.1.0-canary.31
138
-
139
- ## 8.1.0-canary.30
140
-
141
- ## 8.1.0-canary.29
142
-
143
- ## 8.1.0-canary.28
144
-
145
- ## 8.1.0-canary.27
146
-
147
- ## 8.1.0-canary.26
148
-
149
- ## 8.1.0-canary.25
150
-
151
- ## 8.1.0-canary.24
152
-
153
- ## 8.1.0-canary.23
154
-
155
- ## 8.1.0-canary.22
156
-
157
- ## 8.1.0-canary.21
158
-
159
- ## 8.1.0-canary.20
160
-
161
- ## 8.1.0-canary.19
162
-
163
- ## 8.1.0-canary.18
164
-
165
- ## 8.1.0-canary.17
166
-
167
- ## 8.1.0-canary.16
168
-
169
- ## 8.1.0-canary.15
170
-
171
- ## 8.1.0-canary.14
172
-
173
- ## 8.1.0-canary.13
174
-
175
- ## 8.1.0-canary.12
176
-
177
- ## 8.1.0-canary.11
178
-
179
- ## 8.1.0-canary.10
180
-
181
- ## 8.1.0-canary.9
182
-
183
- ## 8.1.0-canary.8
184
-
185
- ## 8.1.0-canary.7
186
-
187
- ## 8.1.0-canary.6
188
-
189
- ## 8.1.0-canary.5
190
-
191
- ## 8.0.6-canary.4
192
-
193
- ## 8.0.6-canary.3
194
-
195
- ## 8.0.6-canary.2
196
-
197
- ## 8.0.6-canary.1
198
-
199
- ## 8.0.6-canary.0
200
-
201
- ## 8.0.5
202
-
203
- ## 8.0.5-canary.10
204
-
205
- ## 8.0.5-canary.9
206
-
207
- ## 8.0.5-canary.8
208
-
209
- ## 8.0.5-canary.7
210
-
211
- ## 8.0.5-canary.6
212
-
213
- ## 8.0.5-canary.5
214
-
215
- ## 8.0.5-canary.4
216
-
217
- ## 8.0.5-canary.3
218
-
219
- ## 8.0.5-canary.2
220
-
221
- ## 8.0.5-canary.1
222
-
223
- ## 8.0.5-canary.0
224
-
225
- ## 8.0.4
226
-
227
- ## 8.0.4-canary.1
228
-
229
- ## 8.0.4-canary.0
5
+ ### Patch Changes
230
6
 
231
- ## 8.0.3
7
+ - [#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))
232
8
 
233
- ## 8.0.3-canary.6
9
+ ## 9.0.0-canary.118
234
10
 
235
- ## 8.0.3-canary.5
11
+ ## 9.0.0-canary.117
236
12
 
237
- ## 8.0.3-canary.4
13
+ ## 9.0.0-canary.116
238
14
 
239
- ## 8.0.3-canary.3
15
+ ## 9.0.0-canary.115
240
16
 
241
- ## 8.0.3-canary.2
17
+ ## 9.0.0-canary.114
242
18
 
243
- ## 8.0.3-canary.1
19
+ ## 9.0.0-canary.113
244
20
 
245
- ## 8.0.3-canary.0
21
+ ## 9.0.0-canary.112
246
22
 
247
- ## 8.0.2
23
+ ## 9.0.0-canary.111
248
24
 
249
- ## 8.0.2-canary.3
25
+ ## 9.0.0-canary.110
250
26
 
251
- ## 8.0.2-canary.2
27
+ ## 9.0.0-canary.109
252
28
 
253
- ## 8.0.2-canary.1
29
+ ## 9.0.0-canary.108
254
30
 
255
- ## 8.0.2-canary.0
31
+ ## 9.0.0-canary.107
256
32
 
257
- ## 8.0.1
33
+ ## 9.0.0-canary.106
258
34
 
259
- ## 8.0.1-canary.4
35
+ ## 9.0.0-canary.105
260
36
 
261
- ## 8.0.1-canary.3
37
+ ## 9.0.0-canary.104
262
38
 
263
- ## 8.0.1-canary.2
39
+ ## 9.0.0-canary.103
264
40
 
265
- ## 8.0.1-canary.1
41
+ ### Patch Changes
266
42
 
267
- ## 8.0.1-canary.0
43
+ - [#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))
268
44
 
269
45
  ## 8.0.0
270
46
 
@@ -274,236 +50,12 @@
274
50
 
275
51
  - [#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))
276
52
 
277
- ## 8.0.0-canary.100
278
-
279
- ## 8.0.0-canary.99
280
-
281
- ## 8.0.0-canary.98
282
-
283
- ## 8.0.0-canary.97
284
-
285
- ## 8.0.0-canary.96
286
-
287
- ## 8.0.0-canary.95
288
-
289
- ## 8.0.0-canary.94
290
-
291
- ### Patch Changes
292
-
293
- - [#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))
294
-
295
- ## 8.0.0-canary.93
296
-
297
- ## 8.0.0-canary.92
298
-
299
- ## 8.0.0-canary.91
300
-
301
- ## 8.0.0-canary.90
302
-
303
- ## 8.0.0-canary.89
304
-
305
- ## 8.0.0-canary.88
306
-
307
- ## 8.0.0-canary.87
308
-
309
- ## 8.0.0-canary.86
310
-
311
- ## 8.0.0-canary.85
312
-
313
- ## 8.0.0-canary.84
314
-
315
- ## 8.0.0-canary.83
316
-
317
- ## 8.0.0-canary.82
318
-
319
- ## 8.0.0-canary.81
320
-
321
- ## 8.0.0-canary.80
322
-
323
- ## 8.0.0-canary.79
324
-
325
- ## 8.0.0-canary.78
326
-
327
- ## 8.0.0-canary.77
328
-
329
- ## 8.0.0-canary.76
330
-
331
- ## 8.0.0-canary.75
332
-
333
- ## 8.0.0-canary.74
334
-
335
- ## 8.0.0-canary.73
336
-
337
- ## 8.0.0-canary.72
338
-
339
- ## 8.0.0-canary.71
340
-
341
- ## 8.0.0-canary.70
342
-
343
- ## 8.0.0-canary.69
344
-
345
- ## 7.1.0-canary.68
346
-
347
- ## 7.1.0-canary.67
348
-
349
- ## 7.1.0-canary.66
350
-
351
- ## 7.1.0-canary.65
352
-
353
- ## 7.1.0-canary.64
354
-
355
- ## 7.1.0-canary.63
356
-
357
- ## 7.1.0-canary.62
358
-
359
- ## 7.1.0-canary.61
360
-
361
- ## 7.1.0-canary.60
362
-
363
- ## 7.1.0-canary.59
364
-
365
- ## 7.1.0-canary.58
366
-
367
- ## 7.1.0-canary.57
368
-
369
- ## 7.1.0-canary.56
370
-
371
- ## 7.1.0-canary.55
372
-
373
- ## 7.1.0-canary.54
374
-
375
- ## 7.1.0-canary.53
376
-
377
- ## 7.1.0-canary.52
378
-
379
- ## 7.1.0-canary.51
380
-
381
- ## 7.1.0-canary.50
382
-
383
- ## 7.1.0-canary.49
384
-
385
- ## 7.1.0-canary.48
386
-
387
- ## 7.1.0-canary.47
388
-
389
- ## 7.1.0-canary.46
390
-
391
- ## 7.1.0-canary.45
392
-
393
- ## 7.1.0-canary.38
394
-
395
- ## 7.1.0-canary.37
396
-
397
- ## 7.1.0-canary.36
398
-
399
- ## 7.1.0-canary.35
400
-
401
- ## 7.1.0-canary.34
402
-
403
- ## 7.1.0-canary.33
404
-
405
- ## 7.1.0-canary.32
406
-
407
- ## 7.1.0-canary.31
408
-
409
- ## 7.1.0-canary.30
410
-
411
- ## 7.1.0-canary.29
412
-
413
- ## 7.1.0-canary.28
414
-
415
- ## 7.1.0-canary.27
416
-
417
- ## 7.1.0-canary.26
418
-
419
- ## 7.1.0-canary.25
420
-
421
- ## 7.1.0-canary.24
422
-
423
- ## 7.1.0-canary.23
424
-
425
- ## 7.1.0-canary.22
426
-
427
- ## 7.1.0-canary.21
428
-
429
- ## 7.1.0-canary.20
430
-
431
- ### Patch Changes
432
-
433
- - [#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))
434
-
435
- ## 7.1.0-canary.19
436
-
437
- ## 7.1.0-canary.18
438
-
439
- ## 7.1.0-canary.17
440
-
441
- ## 7.1.0-canary.16
442
-
443
- ## 7.1.0-canary.15
444
-
445
- ## 7.1.0-canary.14
446
-
447
- ## 7.1.0-canary.13
448
-
449
- ## 7.1.0-canary.12
450
-
451
- ## 7.1.0-canary.11
452
-
453
- ## 7.1.0-canary.10
454
-
455
- ## 7.1.0-canary.9
456
-
457
- ## 7.1.0-canary.8
458
-
459
- ## 7.0.2-canary.7
460
-
461
- ## 7.0.2-canary.6
462
-
463
- ## 7.0.2-canary.5
464
-
465
53
  ## 7.0.1
466
54
 
467
55
  ### Patch Changes
468
56
 
469
57
  - [#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))
470
58
 
471
- ## 7.0.1-canary.15
472
-
473
- ## 7.0.1-canary.14
474
-
475
- ## 7.0.1-canary.13
476
-
477
- ## 7.0.1-canary.12
478
-
479
- ## 7.0.1-canary.11
480
-
481
- ## 7.0.1-canary.10
482
-
483
- ## 7.0.1-canary.9
484
-
485
- ## 7.0.1-canary.8
486
-
487
- ## 7.0.1-canary.7
488
-
489
- ## 7.0.1-canary.6
490
-
491
- ## 7.0.1-canary.5
492
-
493
- ## 7.0.1-canary.4
494
-
495
- ## 7.0.1-canary.3
496
-
497
- ## 7.0.1-canary.2
498
-
499
- ## 7.0.1-canary.1
500
-
501
- ## 7.0.1-canary.0
502
-
503
- ### Patch Changes
504
-
505
- - [#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))
506
-
507
59
  ## 7.0.0
508
60
 
509
61
  ### Major Changes
@@ -521,205 +73,3 @@
521
73
  - [#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))
522
74
 
523
75
  - [#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))
524
-
525
- ## 6.2.0-canary.98
526
-
527
- ## 6.2.0-canary.97
528
-
529
- ## 6.2.0-canary.96
530
-
531
- ## 6.2.0-canary.95
532
-
533
- ## 6.2.0-canary.94
534
-
535
- ## 6.2.0-canary.93
536
-
537
- ## 6.2.0-canary.92
538
-
539
- ## 6.2.0-canary.91
540
-
541
- ## 6.2.0-canary.90
542
-
543
- ## 6.2.0-canary.89
544
-
545
- ## 6.2.0-canary.88
546
-
547
- ## 6.2.0-canary.87
548
-
549
- ## 6.2.0-canary.86
550
-
551
- ## 6.2.0-canary.85
552
-
553
- ## 6.2.0-canary.84
554
-
555
- ## 6.2.0-canary.83
556
-
557
- ### Minor Changes
558
-
559
- - [#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))
560
-
561
- ## 6.2.0-canary.82
562
-
563
- ## 6.2.0-canary.81
564
-
565
- ## 6.2.0-canary.80
566
-
567
- ## 6.2.0-canary.79
568
-
569
- ## 6.2.0-canary.78
570
-
571
- ## 6.2.0-canary.77
572
-
573
- ## 6.2.0-canary.76
574
-
575
- ## 6.2.0-canary.75
576
-
577
- ## 6.2.0-canary.74
578
-
579
- ## 6.2.0-canary.73
580
-
581
- ## 6.2.0-canary.72
582
-
583
- ## 6.2.0-canary.71
584
-
585
- ## 6.2.0-canary.70
586
-
587
- ## 6.2.0-canary.69
588
-
589
- ### Patch Changes
590
-
591
- - [#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))
592
-
593
- ## 6.2.0-canary.68
594
-
595
- ## 6.2.0-canary.67
596
-
597
- ## 6.2.0-canary.66
598
-
599
- ## 6.2.0-canary.65
600
-
601
- ## 6.2.0-canary.64
602
-
603
- ## 6.2.0-canary.63
604
-
605
- ## 6.2.0-canary.62
606
-
607
- ## 6.2.0-canary.61
608
-
609
- ## 6.2.0-canary.60
610
-
611
- ## 6.2.0-canary.59
612
-
613
- ## 6.2.0-canary.58
614
-
615
- ## 6.2.0-canary.57
616
-
617
- ## 6.2.0-canary.56
618
-
619
- ## 6.2.0-canary.55
620
-
621
- ## 6.2.0-canary.54
622
-
623
- ## 6.2.0-canary.53
624
-
625
- ## 6.2.0-canary.52
626
-
627
- ## 6.2.0-canary.51
628
-
629
- ## 6.2.0-canary.50
630
-
631
- ## 6.2.0-canary.49
632
-
633
- ## 6.2.0-canary.48
634
-
635
- ## 6.2.0-canary.47
636
-
637
- ## 6.2.0-canary.46
638
-
639
- ## 6.2.0-canary.45
640
-
641
- ## 6.2.0-canary.44
642
-
643
- ## 6.2.0-canary.43
644
-
645
- ## 6.2.0-canary.42
646
-
647
- ## 6.2.0-canary.41
648
-
649
- ### Patch Changes
650
-
651
- - [#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))
652
-
653
- ## 6.2.0-canary.40
654
-
655
- ## 6.2.0-canary.39
656
-
657
- ## 6.2.0-canary.38
658
-
659
- ## 6.2.0-canary.37
660
-
661
- ## 6.2.0-canary.36
662
-
663
- ## 6.2.0-canary.35
664
-
665
- ## 6.2.0-canary.34
666
-
667
- ## 6.2.0-canary.33
668
-
669
- ## 6.2.0-canary.32
670
-
671
- ## 6.2.0-canary.31
672
-
673
- ## 6.2.0-canary.30
674
-
675
- ## 6.2.0-canary.29
676
-
677
- ## 6.2.0-canary.28
678
-
679
- ## 6.2.0-canary.27
680
-
681
- ## 6.2.0-canary.26
682
-
683
- ## 6.2.0-canary.25
684
-
685
- ## 6.2.0-canary.24
686
-
687
- ## 6.2.0-canary.23
688
-
689
- ## 6.2.0-canary.22
690
-
691
- ## 6.2.0-canary.21
692
-
693
- ## 6.2.0-canary.20
694
-
695
- ## 6.2.0-canary.19
696
-
697
- ## 6.2.0-canary.18
698
-
699
- ## 6.2.0-canary.17
700
-
701
- ## 6.2.0-canary.16
702
-
703
- ## 6.2.0-canary.15
704
-
705
- ## 6.2.0-canary.14
706
-
707
- ## 6.2.0-canary.13
708
-
709
- ### Patch Changes
710
-
711
- - [#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))
712
-
713
- ## 6.2.0-canary.12
714
-
715
- ## 6.2.0-canary.11
716
-
717
- ## 6.2.0-canary.10
718
-
719
- ## 6.2.0-canary.9
720
-
721
- ## 6.2.0-canary.8
722
-
723
- ### Minor Changes
724
-
725
- - [#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))
@@ -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 UpsertClient_1 = require("./UpsertClient");
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',
@@ -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
- __exportStar(require("./graphcommerce5to6"), exports);
18
- __exportStar(require("./graphcommerce6to7"), exports);
19
- __exportStar(require("./graphcommerce7to8"), exports);
20
- __exportStar(require("./graphcommerce8to9"), exports);
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.0-canary.98",
5
+ "version": "9.0.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.4",
16
- "@whatwg-node/fetch": "^0.9.18",
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": "^3",
22
- "@graphcommerce/eslint-config-pwa": "^9.0.0-canary.98",
23
- "@graphcommerce/next-config": "^9.0.0-canary.98",
24
- "@graphcommerce/prettier-config-pwa": "^9.0.0-canary.98",
25
- "@graphcommerce/typescript-config-pwa": "^9.0.0-canary.98",
26
- "dotenv": "^16.1.4",
27
- "graphql": "^16.7.1"
22
+ "@apollo/client": "*",
23
+ "@graphcommerce/eslint-config-pwa": "^9.0.0",
24
+ "@graphcommerce/next-config": "^9.0.0",
25
+ "@graphcommerce/prettier-config-pwa": "^9.0.0",
26
+ "@graphcommerce/typescript-config-pwa": "^9.0.0",
27
+ "dotenv": "^16.1.4"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/prompts": "^2.4.9",
31
- "typescript": "5.5.3"
31
+ "typescript": "5.7.2"
32
32
  },
33
33
  "sideEffects": false,
34
34
  "prettier": "@graphcommerce/prettier-config-pwa",
@@ -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 { Schema } from './types'
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)
@@ -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 prompts, { PromptObject } from 'prompts'
5
- import { UpsertClient } from './UpsertClient'
6
- import * as availableMigrations from './migrations'
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 { loadConfig } from '@graphcommerce/next-config'
2
- import {
3
- BatchMigrationCreateModelInput,
1
+ import type {
2
+ BatchMigrationCreateComponentFieldInput,
4
3
  BatchMigrationCreateComponentInput,
5
- BatchMigrationCreateEnumerationInput,
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 { graphcommerceLog, capitalize } from './utils/graphCommerceLog'
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)
@@ -1,4 +1,11 @@
1
- export * from './graphcommerce5to6'
2
- export * from './graphcommerce6to7'
3
- export * from './graphcommerce7to8'
4
- export * from './graphcommerce8to9'
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, gql, NormalizedCacheObject } from '@apollo/client'
2
- import { Schema } from './types'
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 { Model, Component, Enumeration, Client, Locale, Stage } from '@hygraph/management-sdk'
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
 
@@ -1,4 +1,4 @@
1
- import { GraphCommerceConfig } from '@graphcommerce/next-config'
1
+ import type { GraphCommerceConfig } from '@graphcommerce/next-config'
2
2
 
3
3
  export type HygraphConfig = {
4
4
  projectId: string
@@ -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