@quonfig/cli 0.0.74 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +51 -51
  2. package/dist/codegen/json-schema-to-zod.js +127 -22
  3. package/dist/codegen/language-mappers/zod-base-mapper.d.ts +11 -1
  4. package/dist/codegen/language-mappers/zod-base-mapper.js +14 -2
  5. package/dist/codegen/language-mappers/zod-to-string-mapper.d.ts +2 -1
  6. package/dist/codegen/language-mappers/zod-to-string-mapper.js +6 -2
  7. package/dist/codegen/language-mappers/zod-to-typescript-mapper.d.ts +6 -2
  8. package/dist/codegen/language-mappers/zod-to-typescript-mapper.js +34 -5
  9. package/dist/codegen/language-mappers/zod-to-typescript-return-value-mapper.d.ts +6 -3
  10. package/dist/codegen/language-mappers/zod-to-typescript-return-value-mapper.js +22 -11
  11. package/dist/codegen/zod-introspection.d.ts +12 -0
  12. package/dist/codegen/zod-introspection.js +15 -0
  13. package/dist/commands/push.js +1 -1
  14. package/dist/commands/verify.js +1 -1
  15. package/dist/commands/workspace/bootstrap.d.ts +0 -8
  16. package/dist/commands/workspace/bootstrap.js +88 -96
  17. package/dist/migrate/push-to-cloud.js +1 -1
  18. package/dist/util/bootstrap-target.d.ts +40 -0
  19. package/dist/util/bootstrap-target.js +46 -0
  20. package/dist/util/clone-and-stack-push.d.ts +1 -4
  21. package/dist/util/clone-and-stack-push.js +2 -5
  22. package/dist/util/git-ops.d.ts +60 -2
  23. package/dist/util/git-ops.js +303 -5
  24. package/dist/verify/schema-error-reshape.d.ts +69 -0
  25. package/dist/verify/schema-error-reshape.js +257 -0
  26. package/dist/verify/schema-validator.d.ts +29 -0
  27. package/dist/verify/schema-validator.js +108 -0
  28. package/dist/verify/standalone.d.ts +31 -0
  29. package/dist/verify/standalone.js +156 -11
  30. package/dist/verify/validate.d.ts +16 -2
  31. package/dist/verify/validate.js +95 -5
  32. package/dist/version.d.ts +1 -1
  33. package/dist/version.js +1 -1
  34. package/oclif.manifest.json +2 -2
  35. package/package.json +3 -1
package/README.md CHANGED
@@ -17,7 +17,7 @@ $ npm install -g @quonfig/cli
17
17
  $ qfg COMMAND
18
18
  running command...
19
19
  $ qfg (--version)
20
- @quonfig/cli/0.0.74 linux-x64 node-v24.4.1
20
+ @quonfig/cli/0.2.0 linux-x64 node-v24.4.1
21
21
  $ qfg --help [COMMAND]
22
22
  USAGE
23
23
  $ qfg COMMAND
@@ -201,7 +201,7 @@ EXAMPLES
201
201
  $ qfg activity restore my.flag --yes
202
202
  ```
203
203
 
204
- _See code: [src/commands/activity.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/activity.ts)_
204
+ _See code: [src/commands/activity.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/activity.ts)_
205
205
 
206
206
  ## `qfg activity deleted`
207
207
 
@@ -230,7 +230,7 @@ EXAMPLES
230
230
  $ qfg activity deleted --json
231
231
  ```
232
232
 
233
- _See code: [src/commands/activity/deleted.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/activity/deleted.ts)_
233
+ _See code: [src/commands/activity/deleted.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/activity/deleted.ts)_
234
234
 
235
235
  ## `qfg activity feed`
236
236
 
@@ -265,7 +265,7 @@ EXAMPLES
265
265
  $ qfg activity feed --json
266
266
  ```
267
267
 
268
- _See code: [src/commands/activity/feed.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/activity/feed.ts)_
268
+ _See code: [src/commands/activity/feed.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/activity/feed.ts)_
269
269
 
270
270
  ## `qfg activity history [NAME]`
271
271
 
@@ -299,7 +299,7 @@ EXAMPLES
299
299
  $ qfg activity history request.timeout --json
300
300
  ```
301
301
 
302
- _See code: [src/commands/activity/history.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/activity/history.ts)_
302
+ _See code: [src/commands/activity/history.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/activity/history.ts)_
303
303
 
304
304
  ## `qfg activity restore [NAME]`
305
305
 
@@ -338,7 +338,7 @@ EXAMPLES
338
338
  $ qfg activity restore request.timeout --type config --yes
339
339
  ```
340
340
 
341
- _See code: [src/commands/activity/restore.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/activity/restore.ts)_
341
+ _See code: [src/commands/activity/restore.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/activity/restore.ts)_
342
342
 
343
343
  ## `qfg audit-log [NAME]`
344
344
 
@@ -366,7 +366,7 @@ EXAMPLES
366
366
  $ qfg audit-log my.flag
367
367
  ```
368
368
 
369
- _See code: [src/commands/audit-log.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/audit-log.ts)_
369
+ _See code: [src/commands/audit-log.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/audit-log.ts)_
370
370
 
371
371
  ## `qfg cleanup`
372
372
 
@@ -407,7 +407,7 @@ EXAMPLES
407
407
  $ qfg cleanup status my.flag.key
408
408
  ```
409
409
 
410
- _See code: [src/commands/cleanup.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/cleanup.ts)_
410
+ _See code: [src/commands/cleanup.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/cleanup.ts)_
411
411
 
412
412
  ## `qfg cleanup list`
413
413
 
@@ -453,7 +453,7 @@ EXAMPLES
453
453
  $ qfg cleanup list --json
454
454
  ```
455
455
 
456
- _See code: [src/commands/cleanup/list.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/cleanup/list.ts)_
456
+ _See code: [src/commands/cleanup/list.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/cleanup/list.ts)_
457
457
 
458
458
  ## `qfg cleanup remove [NAME]`
459
459
 
@@ -498,7 +498,7 @@ EXAMPLES
498
498
  $ qfg cleanup remove my.flag.key --json
499
499
  ```
500
500
 
501
- _See code: [src/commands/cleanup/remove.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/cleanup/remove.ts)_
501
+ _See code: [src/commands/cleanup/remove.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/cleanup/remove.ts)_
502
502
 
503
503
  ## `qfg cleanup status [NAME]`
504
504
 
@@ -538,7 +538,7 @@ EXAMPLES
538
538
  $ qfg cleanup status my.flag.key --json
539
539
  ```
540
540
 
541
- _See code: [src/commands/cleanup/status.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/cleanup/status.ts)_
541
+ _See code: [src/commands/cleanup/status.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/cleanup/status.ts)_
542
542
 
543
543
  ## `qfg cleanup verify [NAME]`
544
544
 
@@ -584,7 +584,7 @@ EXAMPLES
584
584
  $ qfg cleanup verify my.flag.key && qfg delete my.flag.key
585
585
  ```
586
586
 
587
- _See code: [src/commands/cleanup/verify.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/cleanup/verify.ts)_
587
+ _See code: [src/commands/cleanup/verify.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/cleanup/verify.ts)_
588
588
 
589
589
  ## `qfg config-schema`
590
590
 
@@ -613,7 +613,7 @@ EXAMPLES
613
613
  $ qfg config-schema --json-schema # full JSON Schema document (copy into your editor)
614
614
  ```
615
615
 
616
- _See code: [src/commands/config-schema.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/config-schema.ts)_
616
+ _See code: [src/commands/config-schema.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/config-schema.ts)_
617
617
 
618
618
  ## `qfg create NAME`
619
619
 
@@ -700,7 +700,7 @@ EXAMPLES
700
700
  $ qfg set-rollout my.new.flag --environment production --true-percent 20
701
701
  ```
702
702
 
703
- _See code: [src/commands/create.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/create.ts)_
703
+ _See code: [src/commands/create.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/create.ts)_
704
704
 
705
705
  ## `qfg delete NAME`
706
706
 
@@ -746,7 +746,7 @@ EXAMPLES
746
746
  $ qfg delete my.config --yes
747
747
  ```
748
748
 
749
- _See code: [src/commands/delete.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/delete.ts)_
749
+ _See code: [src/commands/delete.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/delete.ts)_
750
750
 
751
751
  ## `qfg flag info [NAME]`
752
752
 
@@ -950,7 +950,7 @@ EXAMPLES
950
950
  $ qfg generate --targets node-ts -o ./dist # combine with targets
951
951
  ```
952
952
 
953
- _See code: [src/commands/generate.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/generate.ts)_
953
+ _See code: [src/commands/generate.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/generate.ts)_
954
954
 
955
955
  ## `qfg generate-new-hex-key`
956
956
 
@@ -973,7 +973,7 @@ EXAMPLES
973
973
  $ qfg generate-new-hex-key
974
974
  ```
975
975
 
976
- _See code: [src/commands/generate-new-hex-key.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/generate-new-hex-key.ts)_
976
+ _See code: [src/commands/generate-new-hex-key.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/generate-new-hex-key.ts)_
977
977
 
978
978
  ## `qfg get [NAME]`
979
979
 
@@ -1005,7 +1005,7 @@ EXAMPLES
1005
1005
  $ qfg get my.config.name --environment=production
1006
1006
  ```
1007
1007
 
1008
- _See code: [src/commands/get.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/get.ts)_
1008
+ _See code: [src/commands/get.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/get.ts)_
1009
1009
 
1010
1010
  ## `qfg history NAME`
1011
1011
 
@@ -1031,7 +1031,7 @@ EXAMPLES
1031
1031
  $ qfg history my.flag
1032
1032
  ```
1033
1033
 
1034
- _See code: [src/commands/history.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/history.ts)_
1034
+ _See code: [src/commands/history.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/history.ts)_
1035
1035
 
1036
1036
  ## `qfg info [NAME]`
1037
1037
 
@@ -1079,7 +1079,7 @@ EXAMPLES
1079
1079
  $ qfg info my.config.name --exclude-evaluations # skip 24h stats
1080
1080
  ```
1081
1081
 
1082
- _See code: [src/commands/info.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/info.ts)_
1082
+ _See code: [src/commands/info.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/info.ts)_
1083
1083
 
1084
1084
  ## `qfg init [DIRECTORY]`
1085
1085
 
@@ -1119,7 +1119,7 @@ EXAMPLES
1119
1119
  $ qfg init --dry-run
1120
1120
  ```
1121
1121
 
1122
- _See code: [src/commands/init.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/init.ts)_
1122
+ _See code: [src/commands/init.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/init.ts)_
1123
1123
 
1124
1124
  ## `qfg interactive`
1125
1125
 
@@ -1149,7 +1149,7 @@ EXAMPLES
1149
1149
  $ qfg
1150
1150
  ```
1151
1151
 
1152
- _See code: [src/commands/interactive.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/interactive.ts)_
1152
+ _See code: [src/commands/interactive.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/interactive.ts)_
1153
1153
 
1154
1154
  ## `qfg list`
1155
1155
 
@@ -1189,7 +1189,7 @@ EXAMPLES
1189
1189
  $ qfg list --feature-flags
1190
1190
  ```
1191
1191
 
1192
- _See code: [src/commands/list.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/list.ts)_
1192
+ _See code: [src/commands/list.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/list.ts)_
1193
1193
 
1194
1194
  ## `qfg log`
1195
1195
 
@@ -1214,7 +1214,7 @@ EXAMPLES
1214
1214
  $ qfg log --limit 5
1215
1215
  ```
1216
1216
 
1217
- _See code: [src/commands/log.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/log.ts)_
1217
+ _See code: [src/commands/log.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/log.ts)_
1218
1218
 
1219
1219
  ## `qfg log-level NAME`
1220
1220
 
@@ -1279,7 +1279,7 @@ EXAMPLES
1279
1279
  $ qfg log-level log-level.my-app --target=Chatty --value=INFO --environment=production
1280
1280
  ```
1281
1281
 
1282
- _See code: [src/commands/log-level.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/log-level.ts)_
1282
+ _See code: [src/commands/log-level.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/log-level.ts)_
1283
1283
 
1284
1284
  ## `qfg login`
1285
1285
 
@@ -1304,7 +1304,7 @@ EXAMPLES
1304
1304
  $ qfg login --profile myprofile
1305
1305
  ```
1306
1306
 
1307
- _See code: [src/commands/login.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/login.ts)_
1307
+ _See code: [src/commands/login.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/login.ts)_
1308
1308
 
1309
1309
  ## `qfg logout`
1310
1310
 
@@ -1327,7 +1327,7 @@ EXAMPLES
1327
1327
  $ qfg logout
1328
1328
  ```
1329
1329
 
1330
- _See code: [src/commands/logout.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/logout.ts)_
1330
+ _See code: [src/commands/logout.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/logout.ts)_
1331
1331
 
1332
1332
  ## `qfg migrate`
1333
1333
 
@@ -1392,7 +1392,7 @@ EXAMPLES
1392
1392
  $ qfg migrate --from launch --source-api-key $LAUNCH_API_KEY --dir ./quonfig-repo --staging
1393
1393
  ```
1394
1394
 
1395
- _See code: [src/commands/migrate.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/migrate.ts)_
1395
+ _See code: [src/commands/migrate.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/migrate.ts)_
1396
1396
 
1397
1397
  ## `qfg migrate doctor`
1398
1398
 
@@ -1430,7 +1430,7 @@ EXAMPLES
1430
1430
  $ qfg migrate doctor --json
1431
1431
  ```
1432
1432
 
1433
- _See code: [src/commands/migrate/doctor.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/migrate/doctor.ts)_
1433
+ _See code: [src/commands/migrate/doctor.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/migrate/doctor.ts)_
1434
1434
 
1435
1435
  ## `qfg migrate my-code`
1436
1436
 
@@ -1462,7 +1462,7 @@ EXAMPLES
1462
1462
  $ qfg migrate my-code --dry-run
1463
1463
  ```
1464
1464
 
1465
- _See code: [src/commands/migrate/my-code.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/migrate/my-code.ts)_
1465
+ _See code: [src/commands/migrate/my-code.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/migrate/my-code.ts)_
1466
1466
 
1467
1467
  ## `qfg migrate status`
1468
1468
 
@@ -1493,7 +1493,7 @@ EXAMPLES
1493
1493
  $ qfg migrate status --json
1494
1494
  ```
1495
1495
 
1496
- _See code: [src/commands/migrate/status.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/migrate/status.ts)_
1496
+ _See code: [src/commands/migrate/status.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/migrate/status.ts)_
1497
1497
 
1498
1498
  ## `qfg override [NAME] [VALUE]`
1499
1499
 
@@ -1548,7 +1548,7 @@ EXAMPLES
1548
1548
  $ qfg override my.flag true --env=staging
1549
1549
  ```
1550
1550
 
1551
- _See code: [src/commands/override.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/override.ts)_
1551
+ _See code: [src/commands/override.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/override.ts)_
1552
1552
 
1553
1553
  ## `qfg pull`
1554
1554
 
@@ -1595,7 +1595,7 @@ EXAMPLES
1595
1595
  $ qfg pull # uses QUONFIG_DIR env var
1596
1596
  ```
1597
1597
 
1598
- _See code: [src/commands/pull.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/pull.ts)_
1598
+ _See code: [src/commands/pull.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/pull.ts)_
1599
1599
 
1600
1600
  ## `qfg push`
1601
1601
 
@@ -1644,7 +1644,7 @@ EXAMPLES
1644
1644
  $ qfg push --dir ./our-config --yes
1645
1645
  ```
1646
1646
 
1647
- _See code: [src/commands/push.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/push.ts)_
1647
+ _See code: [src/commands/push.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/push.ts)_
1648
1648
 
1649
1649
  ## `qfg run [COMMAND]`
1650
1650
 
@@ -1695,7 +1695,7 @@ EXAMPLES
1695
1695
  $ qfg run --env DATABASE_URL=db.url --preserve-env --environment=staging -- npm test
1696
1696
  ```
1697
1697
 
1698
- _See code: [src/commands/run.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/run.ts)_
1698
+ _See code: [src/commands/run.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/run.ts)_
1699
1699
 
1700
1700
  ## `qfg schema NAME`
1701
1701
 
@@ -1733,7 +1733,7 @@ EXAMPLES
1733
1733
  $ qfg schema my-schema --set-json-schema=@schemas/my-schema.json --protected
1734
1734
  ```
1735
1735
 
1736
- _See code: [src/commands/schema.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/schema.ts)_
1736
+ _See code: [src/commands/schema.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/schema.ts)_
1737
1737
 
1738
1738
  ## `qfg sdk-key`
1739
1739
 
@@ -1760,7 +1760,7 @@ EXAMPLES
1760
1760
  $ qfg sdk-key revoke <key-id>
1761
1761
  ```
1762
1762
 
1763
- _See code: [src/commands/sdk-key.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/sdk-key.ts)_
1763
+ _See code: [src/commands/sdk-key.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/sdk-key.ts)_
1764
1764
 
1765
1765
  ## `qfg sdk-key create`
1766
1766
 
@@ -1792,7 +1792,7 @@ EXAMPLES
1792
1792
  $ qfg sdk-key create --environment staging --type browser
1793
1793
  ```
1794
1794
 
1795
- _See code: [src/commands/sdk-key/create.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/sdk-key/create.ts)_
1795
+ _See code: [src/commands/sdk-key/create.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/sdk-key/create.ts)_
1796
1796
 
1797
1797
  ## `qfg sdk-key list`
1798
1798
 
@@ -1821,7 +1821,7 @@ EXAMPLES
1821
1821
  $ qfg sdk-key list --environment production
1822
1822
  ```
1823
1823
 
1824
- _See code: [src/commands/sdk-key/list.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/sdk-key/list.ts)_
1824
+ _See code: [src/commands/sdk-key/list.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/sdk-key/list.ts)_
1825
1825
 
1826
1826
  ## `qfg sdk-key revoke KEYID`
1827
1827
 
@@ -1848,7 +1848,7 @@ EXAMPLES
1848
1848
  $ qfg sdk-key revoke a1b2c3d4-e5f6-7890-abcd-ef1234567890
1849
1849
  ```
1850
1850
 
1851
- _See code: [src/commands/sdk-key/revoke.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/sdk-key/revoke.ts)_
1851
+ _See code: [src/commands/sdk-key/revoke.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/sdk-key/revoke.ts)_
1852
1852
 
1853
1853
  ## `qfg serve`
1854
1854
 
@@ -1906,7 +1906,7 @@ EXAMPLES
1906
1906
  $ qfg serve --port 6581 --frontend-sdk-key PUBLIC_KEY
1907
1907
  ```
1908
1908
 
1909
- _See code: [src/commands/serve.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/serve.ts)_
1909
+ _See code: [src/commands/serve.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/serve.ts)_
1910
1910
 
1911
1911
  ## `qfg set-default [NAME]`
1912
1912
 
@@ -1982,7 +1982,7 @@ EXAMPLES
1982
1982
  $ qfg pull && qfg config-schema
1983
1983
  ```
1984
1984
 
1985
- _See code: [src/commands/set-default.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/set-default.ts)_
1985
+ _See code: [src/commands/set-default.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/set-default.ts)_
1986
1986
 
1987
1987
  ## `qfg set-rollout [NAME]`
1988
1988
 
@@ -2073,7 +2073,7 @@ EXAMPLES
2073
2073
  $ qfg set-rollout my.variant.flag --environment production --weights "a:33,b:33,c:34" --hash-by user.id
2074
2074
  ```
2075
2075
 
2076
- _See code: [src/commands/set-rollout.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/set-rollout.ts)_
2076
+ _See code: [src/commands/set-rollout.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/set-rollout.ts)_
2077
2077
 
2078
2078
  ## `qfg sync`
2079
2079
 
@@ -2105,7 +2105,7 @@ EXAMPLES
2105
2105
  $ qfg sync --watch --dir ./our-config --interval 30
2106
2106
  ```
2107
2107
 
2108
- _See code: [src/commands/sync.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/sync.ts)_
2108
+ _See code: [src/commands/sync.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/sync.ts)_
2109
2109
 
2110
2110
  ## `qfg toggle [NAME]`
2111
2111
 
@@ -2212,7 +2212,7 @@ EXAMPLES
2212
2212
  $ qfg verify --json
2213
2213
  ```
2214
2214
 
2215
- _See code: [src/commands/verify.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/verify.ts)_
2215
+ _See code: [src/commands/verify.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/verify.ts)_
2216
2216
 
2217
2217
  ## `qfg whoami`
2218
2218
 
@@ -2235,7 +2235,7 @@ EXAMPLES
2235
2235
  $ qfg whoami
2236
2236
  ```
2237
2237
 
2238
- _See code: [src/commands/whoami.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/whoami.ts)_
2238
+ _See code: [src/commands/whoami.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/whoami.ts)_
2239
2239
 
2240
2240
  ## `qfg workspace`
2241
2241
 
@@ -2258,7 +2258,7 @@ EXAMPLES
2258
2258
  $ qfg workspace
2259
2259
  ```
2260
2260
 
2261
- _See code: [src/commands/workspace.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/workspace.ts)_
2261
+ _See code: [src/commands/workspace.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/workspace.ts)_
2262
2262
 
2263
2263
  ## `qfg workspace bootstrap`
2264
2264
 
@@ -2271,7 +2271,7 @@ USAGE
2271
2271
 
2272
2272
  FLAGS
2273
2273
  --dir=<value> Local directory to push (defaults to current directory)
2274
- --force Force push even if remote already has commits
2274
+ --force Accepted and ignored (no-op). Bootstrap never rewrites the workspace history.
2275
2275
  --skip-validate Skip config validation before pushing
2276
2276
 
2277
2277
  GLOBAL FLAGS
@@ -2291,7 +2291,7 @@ EXAMPLES
2291
2291
  $ qfg workspace bootstrap --dir ./our-config --skip-validate
2292
2292
  ```
2293
2293
 
2294
- _See code: [src/commands/workspace/bootstrap.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/workspace/bootstrap.ts)_
2294
+ _See code: [src/commands/workspace/bootstrap.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/workspace/bootstrap.ts)_
2295
2295
 
2296
2296
  ## `qfg workspace create SLUG`
2297
2297
 
@@ -2325,7 +2325,7 @@ EXAMPLES
2325
2325
  $ qfg workspace create my-team --org 11111111-1111-1111-1111-111111111111
2326
2326
  ```
2327
2327
 
2328
- _See code: [src/commands/workspace/create.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/workspace/create.ts)_
2328
+ _See code: [src/commands/workspace/create.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/workspace/create.ts)_
2329
2329
 
2330
2330
  ## `qfg workspace switch [SLUG]`
2331
2331
 
@@ -2353,7 +2353,7 @@ EXAMPLES
2353
2353
  $ qfg workspace switch acme/production
2354
2354
  ```
2355
2355
 
2356
- _See code: [src/commands/workspace/switch.ts](https://github.com/quonfig/cli/blob/v0.0.74/src/commands/workspace/switch.ts)_
2356
+ _See code: [src/commands/workspace/switch.ts](https://github.com/quonfig/cli/blob/v0.2.0/src/commands/workspace/switch.ts)_
2357
2357
  <!-- commandsstop -->
2358
2358
 
2359
2359
  ## Local Development
@@ -58,6 +58,126 @@ function schemaFromObject(schema) {
58
58
  }
59
59
  return base;
60
60
  }
61
+ /**
62
+ * JSON Schema object branch check for tag detection: `type: "object"`, or no type with `properties`.
63
+ */
64
+ function isObjectBranch(schema) {
65
+ if (!isObject(schema)) {
66
+ return false;
67
+ }
68
+ if (schema.type === 'object') {
69
+ return true;
70
+ }
71
+ return schema.type === undefined && isObject(schema.properties);
72
+ }
73
+ /**
74
+ * The single value a property schema pins, from `const` or a one-value `enum`.
75
+ */
76
+ function pinnedValue(schema) {
77
+ if (!isObject(schema)) {
78
+ return undefined;
79
+ }
80
+ if (schema.const !== undefined) {
81
+ return { value: schema.const };
82
+ }
83
+ if (Array.isArray(schema.enum) && schema.enum.length === 1) {
84
+ return { value: schema.enum[0] };
85
+ }
86
+ return undefined;
87
+ }
88
+ /**
89
+ * Finds the tag of a tagged oneOf/anyOf: every branch is an object, and exactly one property name is
90
+ * required and pinned to a single value (`const` or one-value `enum`) in every branch, with a
91
+ * different value in each. Returns undefined when there is no such property, or more than one.
92
+ */
93
+ function findUnionTag(branches) {
94
+ if (branches.length < 2 || !branches.every((branch) => isObjectBranch(branch))) {
95
+ return undefined;
96
+ }
97
+ const objectBranches = branches;
98
+ const [first] = objectBranches;
99
+ const firstProperties = isObject(first.properties) ? first.properties : {};
100
+ const candidates = Object.keys(firstProperties).filter((key) => {
101
+ const values = [];
102
+ for (const branch of objectBranches) {
103
+ const properties = isObject(branch.properties) ? branch.properties : {};
104
+ const required = Array.isArray(branch.required) ? branch.required : [];
105
+ const pinned = pinnedValue(properties[key]);
106
+ if (!pinned || !required.includes(key)) {
107
+ return false;
108
+ }
109
+ values.push(pinned.value);
110
+ }
111
+ return new Set(values.map((value) => JSON.stringify(value))).size === values.length;
112
+ });
113
+ return candidates.length === 1 ? candidates[0] : undefined;
114
+ }
115
+ function schemaFromUnion(branches) {
116
+ if (branches.length === 0) {
117
+ return z.never();
118
+ }
119
+ const options = branches.map((item) => schemaToZod(item));
120
+ if (options.length === 1) {
121
+ return options[0];
122
+ }
123
+ const tag = findUnionTag(branches);
124
+ // discriminatedUnion needs every option to be a plain object schema (no default/other wrapper)
125
+ if (tag && options.every((option) => option instanceof z.ZodObject)) {
126
+ return z.discriminatedUnion(tag, options);
127
+ }
128
+ return z.union(options);
129
+ }
130
+ const STRUCTURAL_KEYWORDS = ['type', 'properties', 'const', 'enum', '$ref', 'items'];
131
+ /**
132
+ * A branch is structural when it describes a shape (type, properties, const, enum, $ref, items or a
133
+ * schema-valued additionalProperties), as opposed to adding constraints only (required, format,
134
+ * pattern, min/max...) to the sibling `type`.
135
+ */
136
+ function isStructuralBranch(branch) {
137
+ if (!isObject(branch)) {
138
+ return false;
139
+ }
140
+ return STRUCTURAL_KEYWORDS.some((key) => branch[key] !== undefined) || isObject(branch.additionalProperties);
141
+ }
142
+ /**
143
+ * A oneOf/anyOf is only a union when at least one branch is structural. When every branch is
144
+ * constraint-only it can't change the type, so the sibling `type` decides it.
145
+ */
146
+ function hasStructuralBranch(branches) {
147
+ return branches.some((branch) => isStructuralBranch(branch));
148
+ }
149
+ /**
150
+ * oneOf/anyOf, checked before `type` so a union next to `type: "object"` (or no type) isn't lost.
151
+ * Sibling `properties` are kept as an intersection with the union.
152
+ */
153
+ function schemaFromCombinator(schema, branches) {
154
+ const union = schemaFromUnion(branches);
155
+ // schemaFromObject reads only properties/required/additionalProperties, so the combinator isn't re-entered
156
+ if (isObject(schema.properties) && Object.keys(schema.properties).length > 0) {
157
+ return z.intersection(schemaFromObject(schema), union);
158
+ }
159
+ return union;
160
+ }
161
+ const MAX_TUPLE_MIN_ITEMS = 8;
162
+ function schemaFromArray(schema) {
163
+ if (Array.isArray(schema.prefixItems)) {
164
+ const items = schema.prefixItems.map((item) => schemaToZod(item));
165
+ return z.tuple(items);
166
+ }
167
+ const item = schema.items === undefined ? z.any() : schemaToZod(schema.items);
168
+ const { maxItems, minItems } = schema;
169
+ // `minItems: n` with no upper bound is a tuple of n items plus a rest: [T, T, ...T[]].
170
+ // Above MAX_TUPLE_MIN_ITEMS the tuple would be unreadable, so it stays a plain array.
171
+ if (typeof minItems === 'number' &&
172
+ Number.isInteger(minItems) &&
173
+ minItems >= 1 &&
174
+ minItems <= MAX_TUPLE_MIN_ITEMS &&
175
+ maxItems === undefined) {
176
+ const fixed = Array.from({ length: minItems }, () => item);
177
+ return z.tuple(fixed).rest(item);
178
+ }
179
+ return z.array(item);
180
+ }
61
181
  function schemaToZod(schema) {
62
182
  if (!isObject(schema)) {
63
183
  return z.any();
@@ -70,6 +190,12 @@ function schemaToZod(schema) {
70
190
  else if (schema.const !== undefined) {
71
191
  result = z.literal(schema.const);
72
192
  }
193
+ else if (Array.isArray(schema.oneOf) && hasStructuralBranch(schema.oneOf)) {
194
+ result = schemaFromCombinator(schema, schema.oneOf);
195
+ }
196
+ else if (Array.isArray(schema.anyOf) && hasStructuralBranch(schema.anyOf)) {
197
+ result = schemaFromCombinator(schema, schema.anyOf);
198
+ }
73
199
  else if (Array.isArray(schema.type)) {
74
200
  result = schemaFromTypeArray(schema, schema.type);
75
201
  }
@@ -96,16 +222,7 @@ function schemaToZod(schema) {
96
222
  break;
97
223
  }
98
224
  case 'array': {
99
- if (Array.isArray(schema.prefixItems)) {
100
- const items = schema.prefixItems.map((item) => schemaToZod(item));
101
- result = z.tuple(items);
102
- }
103
- else if (schema.items === undefined) {
104
- result = z.array(z.any());
105
- }
106
- else {
107
- result = z.array(schemaToZod(schema.items));
108
- }
225
+ result = schemaFromArray(schema);
109
226
  break;
110
227
  }
111
228
  case 'object':
@@ -119,18 +236,6 @@ function schemaToZod(schema) {
119
236
  break;
120
237
  }
121
238
  default: {
122
- if (Array.isArray(schema.oneOf)) {
123
- const options = schema.oneOf.map((item) => schemaToZod(item));
124
- result =
125
- options.length === 1 ? options[0] : z.union(options);
126
- break;
127
- }
128
- if (Array.isArray(schema.anyOf)) {
129
- const options = schema.anyOf.map((item) => schemaToZod(item));
130
- result =
131
- options.length === 1 ? options[0] : z.union(options);
132
- break;
133
- }
134
239
  if (Array.isArray(schema.allOf) && schema.allOf.length === 1) {
135
240
  result = schemaToZod(schema.allOf[0]);
136
241
  break;
@@ -1,6 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { $ZodFunctionArgs, $ZodFunctionOut, $ZodType, util } from 'zod/v4/core';
3
3
  export declare abstract class ZodBaseMapper {
4
+ /**
5
+ * Resolves the fixed tuple item at `index`. Mappers that emit value accessors override this to
6
+ * resolve the item at its indexed path rather than at the tuple's own path.
7
+ */
8
+ protected resolveTupleItem(item: $ZodType, _index: number): string;
4
9
  resolveType(type: $ZodType): string;
5
10
  /**
6
11
  * Hook for handling meta descriptions on schemas.
@@ -20,6 +25,7 @@ export declare abstract class ZodBaseMapper {
20
25
  protected abstract function(args: string, returns: string): string;
21
26
  protected abstract functionArguments(value?: $ZodFunctionArgs): string;
22
27
  protected abstract functionReturns(value: $ZodFunctionOut): string;
28
+ protected abstract intersection(left: string, right: string): string;
23
29
  protected abstract literal(value: string | number | boolean | null): string;
24
30
  protected abstract never(): string;
25
31
  protected abstract null(): string;
@@ -28,7 +34,11 @@ export declare abstract class ZodBaseMapper {
28
34
  protected abstract optional(wrappedType: string): string;
29
35
  protected abstract record(keyType: string, valueType: string): string;
30
36
  protected abstract string(): string;
31
- protected abstract tuple(wrappedTypes: string[]): string;
37
+ /**
38
+ * @param wrappedTypes The fixed leading items
39
+ * @param rest The rest element type (`z.tuple([...]).rest(x)`), when the tuple has one
40
+ */
41
+ protected abstract tuple(wrappedTypes: string[], rest?: string): string;
32
42
  protected abstract undefined(): string;
33
43
  protected abstract union(wrappedTypes: string[]): string;
34
44
  protected abstract unknown(): string;