@quonfig/cli 0.0.9 → 0.0.11

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/README.md CHANGED
@@ -14,7 +14,7 @@ $ npm install -g @quonfig/cli
14
14
  $ qfg COMMAND
15
15
  running command...
16
16
  $ qfg (--version)
17
- @quonfig/cli/0.0.9 linux-x64 node-v24.4.1
17
+ @quonfig/cli/0.0.11 linux-x64 node-v24.4.1
18
18
  $ qfg --help [COMMAND]
19
19
  USAGE
20
20
  $ qfg COMMAND
@@ -84,7 +84,7 @@ EXAMPLES
84
84
  $ qfg config-schema --json-schema # full JSON Schema document (copy into your editor)
85
85
  ```
86
86
 
87
- _See code: [src/commands/config-schema.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/config-schema.ts)_
87
+ _See code: [src/commands/config-schema.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/config-schema.ts)_
88
88
 
89
89
  ## `qfg create NAME`
90
90
 
@@ -156,7 +156,7 @@ EXAMPLES
156
156
  $ qfg set-rollout my.new.flag --environment production --true-percent 20
157
157
  ```
158
158
 
159
- _See code: [src/commands/create.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/create.ts)_
159
+ _See code: [src/commands/create.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/create.ts)_
160
160
 
161
161
  ## `qfg flag info [NAME]`
162
162
 
@@ -356,7 +356,7 @@ EXAMPLES
356
356
  $ qfg generate --targets node-ts -o ./dist # combine with targets
357
357
  ```
358
358
 
359
- _See code: [src/commands/generate.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/generate.ts)_
359
+ _See code: [src/commands/generate.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/generate.ts)_
360
360
 
361
361
  ## `qfg generate-new-hex-key`
362
362
 
@@ -379,7 +379,7 @@ EXAMPLES
379
379
  $ qfg generate-new-hex-key
380
380
  ```
381
381
 
382
- _See code: [src/commands/generate-new-hex-key.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/generate-new-hex-key.ts)_
382
+ _See code: [src/commands/generate-new-hex-key.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/generate-new-hex-key.ts)_
383
383
 
384
384
  ## `qfg get [NAME]`
385
385
 
@@ -411,7 +411,7 @@ EXAMPLES
411
411
  $ qfg get my.config.name --environment=production
412
412
  ```
413
413
 
414
- _See code: [src/commands/get.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/get.ts)_
414
+ _See code: [src/commands/get.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/get.ts)_
415
415
 
416
416
  ## `qfg info [NAME]`
417
417
 
@@ -459,7 +459,7 @@ EXAMPLES
459
459
  $ qfg info my.config.name --exclude-evaluations # skip 24h stats
460
460
  ```
461
461
 
462
- _See code: [src/commands/info.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/info.ts)_
462
+ _See code: [src/commands/info.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/info.ts)_
463
463
 
464
464
  ## `qfg init [DIRECTORY]`
465
465
 
@@ -497,7 +497,7 @@ EXAMPLES
497
497
  $ qfg init --dry-run
498
498
  ```
499
499
 
500
- _See code: [src/commands/init.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/init.ts)_
500
+ _See code: [src/commands/init.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/init.ts)_
501
501
 
502
502
  ## `qfg interactive`
503
503
 
@@ -515,7 +515,7 @@ EXAMPLES
515
515
  $ qfg
516
516
  ```
517
517
 
518
- _See code: [src/commands/interactive.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/interactive.ts)_
518
+ _See code: [src/commands/interactive.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/interactive.ts)_
519
519
 
520
520
  ## `qfg list`
521
521
 
@@ -555,7 +555,7 @@ EXAMPLES
555
555
  $ qfg list --feature-flags
556
556
  ```
557
557
 
558
- _See code: [src/commands/list.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/list.ts)_
558
+ _See code: [src/commands/list.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/list.ts)_
559
559
 
560
560
  ## `qfg login`
561
561
 
@@ -580,7 +580,7 @@ EXAMPLES
580
580
  $ qfg login --profile myprofile
581
581
  ```
582
582
 
583
- _See code: [src/commands/login.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/login.ts)_
583
+ _See code: [src/commands/login.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/login.ts)_
584
584
 
585
585
  ## `qfg logout`
586
586
 
@@ -603,7 +603,7 @@ EXAMPLES
603
603
  $ qfg logout
604
604
  ```
605
605
 
606
- _See code: [src/commands/logout.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/logout.ts)_
606
+ _See code: [src/commands/logout.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/logout.ts)_
607
607
 
608
608
  ## `qfg mcp`
609
609
 
@@ -636,7 +636,7 @@ EXAMPLES
636
636
  $ qfg mcp --url http://local-app.quonfig-staging.com:3003/api/v1/mcp
637
637
  ```
638
638
 
639
- _See code: [src/commands/mcp.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/mcp.ts)_
639
+ _See code: [src/commands/mcp.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/mcp.ts)_
640
640
 
641
641
  ## `qfg override [NAME]`
642
642
 
@@ -675,7 +675,7 @@ EXAMPLES
675
675
  $ qfg override my.double.config --value=3.14159
676
676
  ```
677
677
 
678
- _See code: [src/commands/override.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/override.ts)_
678
+ _See code: [src/commands/override.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/override.ts)_
679
679
 
680
680
  ## `qfg pull`
681
681
 
@@ -719,7 +719,7 @@ EXAMPLES
719
719
  $ qfg pull # uses QUONFIG_DIR env var
720
720
  ```
721
721
 
722
- _See code: [src/commands/pull.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/pull.ts)_
722
+ _See code: [src/commands/pull.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/pull.ts)_
723
723
 
724
724
  ## `qfg schema NAME`
725
725
 
@@ -757,7 +757,7 @@ EXAMPLES
757
757
  $ qfg schema my-schema --set-json-schema=@schemas/my-schema.json --protected
758
758
  ```
759
759
 
760
- _See code: [src/commands/schema.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/schema.ts)_
760
+ _See code: [src/commands/schema.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/schema.ts)_
761
761
 
762
762
  ## `qfg sdk-key`
763
763
 
@@ -784,7 +784,7 @@ EXAMPLES
784
784
  $ qfg sdk-key revoke <key-id>
785
785
  ```
786
786
 
787
- _See code: [src/commands/sdk-key.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/sdk-key.ts)_
787
+ _See code: [src/commands/sdk-key.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/sdk-key.ts)_
788
788
 
789
789
  ## `qfg sdk-key create`
790
790
 
@@ -816,7 +816,7 @@ EXAMPLES
816
816
  $ qfg sdk-key create --environment staging --type browser
817
817
  ```
818
818
 
819
- _See code: [src/commands/sdk-key/create.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/sdk-key/create.ts)_
819
+ _See code: [src/commands/sdk-key/create.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/sdk-key/create.ts)_
820
820
 
821
821
  ## `qfg sdk-key list`
822
822
 
@@ -845,7 +845,7 @@ EXAMPLES
845
845
  $ qfg sdk-key list --environment production
846
846
  ```
847
847
 
848
- _See code: [src/commands/sdk-key/list.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/sdk-key/list.ts)_
848
+ _See code: [src/commands/sdk-key/list.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/sdk-key/list.ts)_
849
849
 
850
850
  ## `qfg sdk-key revoke KEYID`
851
851
 
@@ -872,7 +872,7 @@ EXAMPLES
872
872
  $ qfg sdk-key revoke a1b2c3d4-e5f6-7890-abcd-ef1234567890
873
873
  ```
874
874
 
875
- _See code: [src/commands/sdk-key/revoke.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/sdk-key/revoke.ts)_
875
+ _See code: [src/commands/sdk-key/revoke.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/sdk-key/revoke.ts)_
876
876
 
877
877
  ## `qfg set-default [NAME]`
878
878
 
@@ -939,7 +939,7 @@ EXAMPLES
939
939
  $ qfg set-rollout my.flag.name --environment production --true-percent 20
940
940
  ```
941
941
 
942
- _See code: [src/commands/set-default.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/set-default.ts)_
942
+ _See code: [src/commands/set-default.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/set-default.ts)_
943
943
 
944
944
  ## `qfg set-rollout [NAME]`
945
945
 
@@ -1016,7 +1016,7 @@ EXAMPLES
1016
1016
  $ qfg set-rollout my.variant.flag --environment production --weights "a:33,b:33,c:34" --hash-by user.id
1017
1017
  ```
1018
1018
 
1019
- _See code: [src/commands/set-rollout.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/set-rollout.ts)_
1019
+ _See code: [src/commands/set-rollout.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/set-rollout.ts)_
1020
1020
 
1021
1021
  ## `qfg sync`
1022
1022
 
@@ -1048,7 +1048,7 @@ EXAMPLES
1048
1048
  $ qfg sync --watch --dir ./our-config --interval 30
1049
1049
  ```
1050
1050
 
1051
- _See code: [src/commands/sync.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/sync.ts)_
1051
+ _See code: [src/commands/sync.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/sync.ts)_
1052
1052
 
1053
1053
  ## `qfg toggle [NAME]`
1054
1054
 
@@ -1146,7 +1146,7 @@ EXAMPLES
1146
1146
  $ qfg verify --json
1147
1147
  ```
1148
1148
 
1149
- _See code: [src/commands/verify.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/verify.ts)_
1149
+ _See code: [src/commands/verify.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/verify.ts)_
1150
1150
 
1151
1151
  ## `qfg whoami`
1152
1152
 
@@ -1169,7 +1169,7 @@ EXAMPLES
1169
1169
  $ qfg whoami
1170
1170
  ```
1171
1171
 
1172
- _See code: [src/commands/whoami.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/whoami.ts)_
1172
+ _See code: [src/commands/whoami.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/whoami.ts)_
1173
1173
 
1174
1174
  ## `qfg workspace`
1175
1175
 
@@ -1192,7 +1192,7 @@ EXAMPLES
1192
1192
  $ qfg workspace
1193
1193
  ```
1194
1194
 
1195
- _See code: [src/commands/workspace.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/workspace.ts)_
1195
+ _See code: [src/commands/workspace.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/workspace.ts)_
1196
1196
 
1197
1197
  ## `qfg workspace bootstrap`
1198
1198
 
@@ -1225,7 +1225,7 @@ EXAMPLES
1225
1225
  $ qfg workspace bootstrap --dir ./our-config --skip-validate
1226
1226
  ```
1227
1227
 
1228
- _See code: [src/commands/workspace/bootstrap.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/workspace/bootstrap.ts)_
1228
+ _See code: [src/commands/workspace/bootstrap.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/workspace/bootstrap.ts)_
1229
1229
 
1230
1230
  ## `qfg workspace switch`
1231
1231
 
@@ -1248,7 +1248,7 @@ EXAMPLES
1248
1248
  $ qfg workspace switch
1249
1249
  ```
1250
1250
 
1251
- _See code: [src/commands/workspace/switch.ts](https://github.com/quonfig/cli/blob/v0.0.9/src/commands/workspace/switch.ts)_
1251
+ _See code: [src/commands/workspace/switch.ts](https://github.com/quonfig/cli/blob/v0.0.11/src/commands/workspace/switch.ts)_
1252
1252
  <!-- commandsstop -->
1253
1253
 
1254
1254
  ## Local Development
@@ -63,76 +63,59 @@ export default class Get extends APICommand {
63
63
  const errorMsg = request.error?.error || `Failed to get config: ${request.status}`;
64
64
  return this.err(errorMsg, { serverError: request.error });
65
65
  }
66
- // oRPC returns EvaluationResult[] — find the matching key
67
66
  const results = (Array.isArray(request.json) ? request.json : []);
68
- const result = results.find((r) => r.key === key);
69
- if (!result) {
67
+ const config = results.find((r) => r.key === key);
68
+ if (!config) {
70
69
  return this.err(`${key} could not be evaluated in this environment`);
71
70
  }
72
- // Adapt to the legacy response shape for downstream compatibility
73
- const config = {
74
- key: result.key,
75
- type: result.configType,
76
- value: result.displayValue,
77
- metadata: {
78
- conditionalValueIndex: 0,
79
- configRowIndex: 0,
80
- id: 0,
81
- type: result.configType,
82
- valueType: result.valueType,
83
- },
84
- };
85
71
  let value = config.value;
86
- // Check if this config has dependencies
87
- if (config.dependencies && config.dependencies.length > 0) {
88
- // Check for providedBy dependency (config value from env var)
89
- const providedByDep = config.dependencies.find((dep) => dep.dependencyType === 'providedBy');
90
- if (providedByDep) {
91
- const envVarName = providedByDep.source;
92
- this.log(`This config is provided by env var '${envVarName}'`);
93
- // Check if the env var is present
94
- const envValue = process.env[envVarName];
95
- if (!envValue) {
96
- return this.err(`Environment variable '${envVarName}' is not set. Cannot resolve config '${key}'.`, {
97
- [key]: value,
98
- provided: true,
72
+ const providedByDep = config.dependencies?.find((dep) => dep.dependencyType === 'providedBy');
73
+ if (providedByDep) {
74
+ const envVarName = providedByDep.source;
75
+ this.log(`This config is provided by env var '${envVarName}'`);
76
+ const envValue = process.env[envVarName];
77
+ if (envValue === undefined) {
78
+ return this.err(`Environment variable '${envVarName}' is not set. Cannot resolve config '${key}'.`, {
79
+ [key]: null,
80
+ provided: true,
81
+ missingEnvVar: envVarName,
82
+ });
83
+ }
84
+ value = envValue;
85
+ this.log(`Successfully resolved config '${key}' from env var`);
86
+ }
87
+ const decryptWithDep = config.dependencies?.find((dep) => dep.dependencyType === 'decryptWith');
88
+ if (decryptWithDep && decryptWithDep.config) {
89
+ const encryptionKeyConfig = decryptWithDep.config;
90
+ const keyProvidedByDep = encryptionKeyConfig.dependencies?.find((dep) => dep.dependencyType === 'providedBy');
91
+ if (keyProvidedByDep) {
92
+ const envVarName = keyProvidedByDep.source;
93
+ this.log(`This config is encrypted by key '${encryptionKeyConfig.key}' that should be found in env var '${envVarName}'`);
94
+ const encryptionKey = process.env[envVarName];
95
+ if (encryptionKey === undefined) {
96
+ return this.err(`Environment variable '${envVarName}' is not set. Cannot decrypt config '${key}'.`, {
97
+ [key]: null,
98
+ encrypted: true,
99
99
  missingEnvVar: envVarName,
100
100
  });
101
101
  }
102
- value = envValue;
103
- this.log(`Successfully resolved config '${key}' from env var`);
104
- }
105
- // Check for decryptWith dependency (encrypted config)
106
- const decryptWithDep = config.dependencies.find((dep) => dep.dependencyType === 'decryptWith');
107
- if (decryptWithDep && decryptWithDep.config) {
108
- const encryptionKeyConfig = decryptWithDep.config;
109
- // Find the providedBy dependency to get the env var name for the encryption key
110
- const keyProvidedByDep = encryptionKeyConfig.dependencies?.find((dep) => dep.dependencyType === 'providedBy');
111
- if (keyProvidedByDep) {
112
- const envVarName = keyProvidedByDep.source;
113
- this.log(`This config is encrypted by key '${encryptionKeyConfig.key}' that should be found in env var '${envVarName}'`);
114
- // Check if the env var is present
115
- const encryptionKey = process.env[envVarName];
116
- if (!encryptionKey) {
117
- return this.err(`Environment variable '${envVarName}' is not set. Cannot decrypt config '${key}'.`, {
118
- [key]: value,
119
- encrypted: true,
120
- missingEnvVar: envVarName,
121
- });
122
- }
123
- // Attempt decryption
124
- try {
125
- value = decrypt(value, encryptionKey);
126
- this.log(`Successfully decrypted config '${key}'`);
127
- }
128
- catch (error) {
129
- const errorMessage = error instanceof Error ? error.message : String(error);
130
- return this.err(`Failed to decrypt config '${key}': ${errorMessage}`, {
131
- [key]: value,
132
- encrypted: true,
133
- error: errorMessage,
134
- });
135
- }
102
+ if (typeof value !== 'string') {
103
+ return this.err(`Config '${key}' is marked decryptWith but its value is not a string.`, {
104
+ [key]: null,
105
+ encrypted: true,
106
+ });
107
+ }
108
+ try {
109
+ value = decrypt(value, encryptionKey);
110
+ this.log(`Successfully decrypted config '${key}'`);
111
+ }
112
+ catch (error) {
113
+ const errorMessage = error instanceof Error ? error.message : String(error);
114
+ return this.err(`Failed to decrypt config '${key}': ${errorMessage}`, {
115
+ [key]: null,
116
+ encrypted: true,
117
+ error: errorMessage,
118
+ });
136
119
  }
137
120
  }
138
121
  }
@@ -4,8 +4,8 @@ const WORKOS_BASE_URL = 'https://api.workos.com';
4
4
  const WORKOS_CLIENT_ID_PRODUCTION = 'client_01KKCCWMNB2K8HYQZQ96G1MXE0';
5
5
  const WORKOS_CLIENT_ID_STAGING = 'client_01KKCCWM4K87JS0MKS8PHZ0ZY1';
6
6
  const getClientId = () => {
7
- if (process.env.WORKOS_CLIENT_ID) {
8
- return process.env.WORKOS_CLIENT_ID;
7
+ if (process.env.CLI_WORKOS_CLIENT_ID) {
8
+ return process.env.CLI_WORKOS_CLIENT_ID;
9
9
  }
10
10
  const domain = getDomain();
11
11
  if (domain === 'quonfig-staging.com') {
@@ -2217,5 +2217,5 @@
2217
2217
  ]
2218
2218
  }
2219
2219
  },
2220
- "version": "0.0.9"
2220
+ "version": "0.0.11"
2221
2221
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "packageManager": "yarn@4.11.0+sha512.4e54aeace9141df2f0177c266b05ec50dc044638157dae128c471ba65994ac802122d7ab35bcd9e81641228b7dcf24867d28e750e0bcae8a05277d600008ad54",
3
3
  "name": "@quonfig/cli",
4
- "version": "0.0.9",
4
+ "version": "0.0.11",
5
5
  "bugs": {
6
6
  "url": "https://github.com/quonfig/cli/issues"
7
7
  },