powersync 0.7.0 → 0.7.1
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 +24 -23
- package/dist/commands/instance/create.d.ts +2 -2
- package/dist/commands/instance/create.js +6 -13
- package/dist/commands/instance/deploy.d.ts +2 -1
- package/dist/commands/instance/deploy.js +16 -16
- package/dist/instance-command-flags.d.ts +12 -0
- package/dist/instance-command-flags.js +13 -0
- package/dist/service/accounts.client.js +1 -1
- package/dist/service/powersync.client.js +1 -1
- package/dist/service/utils.js +1 -1
- package/dist/utils.d.ts +7 -0
- package/oclif.manifest.json +26 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ EXAMPLES
|
|
|
90
90
|
$ npx powersync init
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
_See code: [src/commands/init.ts](https://github.com/powersync-ja/cli/blob/v0.7.
|
|
93
|
+
_See code: [src/commands/init.ts](https://github.com/powersync-ja/cli/blob/v0.7.1/src/commands/init.ts)_
|
|
94
94
|
|
|
95
95
|
## `powersync instance config`
|
|
96
96
|
|
|
@@ -107,7 +107,7 @@ EXAMPLES
|
|
|
107
107
|
$ npx powersync instance config
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
_See code: [src/commands/instance/config.ts](https://github.com/powersync-ja/cli/blob/v0.7.
|
|
110
|
+
_See code: [src/commands/instance/config.ts](https://github.com/powersync-ja/cli/blob/v0.7.1/src/commands/instance/config.ts)_
|
|
111
111
|
|
|
112
112
|
## `powersync instance create`
|
|
113
113
|
|
|
@@ -115,7 +115,7 @@ Create a new instance.
|
|
|
115
115
|
|
|
116
116
|
```
|
|
117
117
|
USAGE
|
|
118
|
-
$ npx powersync instance create [-
|
|
118
|
+
$ npx powersync instance create [-i <value>] [-r <value>] [-n <value>] [-h <value>] [-w <value>] [-a <value>] [-o
|
|
119
119
|
<value>] [-s] [-j <value>] [-b]
|
|
120
120
|
|
|
121
121
|
FLAGS
|
|
@@ -137,7 +137,7 @@ EXAMPLES
|
|
|
137
137
|
$ npx powersync instance create
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
-
_See code: [src/commands/instance/create.ts](https://github.com/powersync-ja/cli/blob/v0.7.
|
|
140
|
+
_See code: [src/commands/instance/create.ts](https://github.com/powersync-ja/cli/blob/v0.7.1/src/commands/instance/create.ts)_
|
|
141
141
|
|
|
142
142
|
## `powersync instance deploy`
|
|
143
143
|
|
|
@@ -145,16 +145,17 @@ Deploy changes to an existing instance.
|
|
|
145
145
|
|
|
146
146
|
```
|
|
147
147
|
USAGE
|
|
148
|
-
$ npx powersync instance deploy [-n <value>] [-h <value>] [-w <value>] [-a <value>] [-o <value>] [-s] [-b]
|
|
148
|
+
$ npx powersync instance deploy [-n <value>] [-h <value>] [-w <value>] [-a <value>] [-o <value>] [-s] [-j <value>] [-b]
|
|
149
149
|
|
|
150
150
|
FLAGS
|
|
151
|
-
-a, --jwtAudiences=<value>
|
|
152
|
-
-b, --[no-]useSupabaseAuth
|
|
153
|
-
-h, --hostname=<value>
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
151
|
+
-a, --jwtAudiences=<value> JWT audiences (comma separated).
|
|
152
|
+
-b, --[no-]useSupabaseAuth Use Supabase auth.
|
|
153
|
+
-h, --hostname=<value> Hostname to connect to database.
|
|
154
|
+
-j, --supabaseJWTSecret=<value> Supabase JWT secret
|
|
155
|
+
-n, --databaseName=<value> Name of the database.
|
|
156
|
+
-o, --port=<value> Port number to connect to database.
|
|
157
|
+
-s, --skipInteraction Skip interactivity.
|
|
158
|
+
-w, --jwksUri=<value> JWKS URI (must include https://).
|
|
158
159
|
|
|
159
160
|
DESCRIPTION
|
|
160
161
|
Deploy changes to an existing instance.
|
|
@@ -163,7 +164,7 @@ EXAMPLES
|
|
|
163
164
|
$ npx powersync instance deploy
|
|
164
165
|
```
|
|
165
166
|
|
|
166
|
-
_See code: [src/commands/instance/deploy.ts](https://github.com/powersync-ja/cli/blob/v0.7.
|
|
167
|
+
_See code: [src/commands/instance/deploy.ts](https://github.com/powersync-ja/cli/blob/v0.7.1/src/commands/instance/deploy.ts)_
|
|
167
168
|
|
|
168
169
|
## `powersync instance destroy`
|
|
169
170
|
|
|
@@ -183,7 +184,7 @@ EXAMPLES
|
|
|
183
184
|
$ npx powersync instance destroy
|
|
184
185
|
```
|
|
185
186
|
|
|
186
|
-
_See code: [src/commands/instance/destroy.ts](https://github.com/powersync-ja/cli/blob/v0.7.
|
|
187
|
+
_See code: [src/commands/instance/destroy.ts](https://github.com/powersync-ja/cli/blob/v0.7.1/src/commands/instance/destroy.ts)_
|
|
187
188
|
|
|
188
189
|
## `powersync instance generate-dev-token`
|
|
189
190
|
|
|
@@ -204,7 +205,7 @@ EXAMPLES
|
|
|
204
205
|
$ npx powersync instance generate-dev-token
|
|
205
206
|
```
|
|
206
207
|
|
|
207
|
-
_See code: [src/commands/instance/generate-dev-token.ts](https://github.com/powersync-ja/cli/blob/v0.7.
|
|
208
|
+
_See code: [src/commands/instance/generate-dev-token.ts](https://github.com/powersync-ja/cli/blob/v0.7.1/src/commands/instance/generate-dev-token.ts)_
|
|
208
209
|
|
|
209
210
|
## `powersync instance schema`
|
|
210
211
|
|
|
@@ -221,7 +222,7 @@ EXAMPLES
|
|
|
221
222
|
$ npx powersync instance schema
|
|
222
223
|
```
|
|
223
224
|
|
|
224
|
-
_See code: [src/commands/instance/schema.ts](https://github.com/powersync-ja/cli/blob/v0.7.
|
|
225
|
+
_See code: [src/commands/instance/schema.ts](https://github.com/powersync-ja/cli/blob/v0.7.1/src/commands/instance/schema.ts)_
|
|
225
226
|
|
|
226
227
|
## `powersync instance set`
|
|
227
228
|
|
|
@@ -243,7 +244,7 @@ EXAMPLES
|
|
|
243
244
|
$ npx powersync instance set --instanceId=1234
|
|
244
245
|
```
|
|
245
246
|
|
|
246
|
-
_See code: [src/commands/instance/set.ts](https://github.com/powersync-ja/cli/blob/v0.7.
|
|
247
|
+
_See code: [src/commands/instance/set.ts](https://github.com/powersync-ja/cli/blob/v0.7.1/src/commands/instance/set.ts)_
|
|
247
248
|
|
|
248
249
|
## `powersync instance status`
|
|
249
250
|
|
|
@@ -268,7 +269,7 @@ EXAMPLES
|
|
|
268
269
|
$ npx powersync instance status --orgId=1234 --projectId=1234 --instanceId=1234 --authToken=1234
|
|
269
270
|
```
|
|
270
271
|
|
|
271
|
-
_See code: [src/commands/instance/status.ts](https://github.com/powersync-ja/cli/blob/v0.7.
|
|
272
|
+
_See code: [src/commands/instance/status.ts](https://github.com/powersync-ja/cli/blob/v0.7.1/src/commands/instance/status.ts)_
|
|
272
273
|
|
|
273
274
|
## `powersync instance stop`
|
|
274
275
|
|
|
@@ -288,7 +289,7 @@ EXAMPLES
|
|
|
288
289
|
$ npx powersync instance stop
|
|
289
290
|
```
|
|
290
291
|
|
|
291
|
-
_See code: [src/commands/instance/stop.ts](https://github.com/powersync-ja/cli/blob/v0.7.
|
|
292
|
+
_See code: [src/commands/instance/stop.ts](https://github.com/powersync-ja/cli/blob/v0.7.1/src/commands/instance/stop.ts)_
|
|
292
293
|
|
|
293
294
|
## `powersync instance sync-rules deploy`
|
|
294
295
|
|
|
@@ -313,7 +314,7 @@ EXAMPLES
|
|
|
313
314
|
$ npx powersync instance sync-rules deploy -f path/to/file
|
|
314
315
|
```
|
|
315
316
|
|
|
316
|
-
_See code: [src/commands/instance/sync-rules/deploy.ts](https://github.com/powersync-ja/cli/blob/v0.7.
|
|
317
|
+
_See code: [src/commands/instance/sync-rules/deploy.ts](https://github.com/powersync-ja/cli/blob/v0.7.1/src/commands/instance/sync-rules/deploy.ts)_
|
|
317
318
|
|
|
318
319
|
## `powersync instance sync-rules generate-schema`
|
|
319
320
|
|
|
@@ -339,7 +340,7 @@ EXAMPLES
|
|
|
339
340
|
$ npx powersync instance sync-rules generate-schema -f path/to/file
|
|
340
341
|
```
|
|
341
342
|
|
|
342
|
-
_See code: [src/commands/instance/sync-rules/generate-schema.ts](https://github.com/powersync-ja/cli/blob/v0.7.
|
|
343
|
+
_See code: [src/commands/instance/sync-rules/generate-schema.ts](https://github.com/powersync-ja/cli/blob/v0.7.1/src/commands/instance/sync-rules/generate-schema.ts)_
|
|
343
344
|
|
|
344
345
|
## `powersync instance sync-rules validate`
|
|
345
346
|
|
|
@@ -363,7 +364,7 @@ EXAMPLES
|
|
|
363
364
|
$ npx powersync instance sync-rules validate -f path/to/file
|
|
364
365
|
```
|
|
365
366
|
|
|
366
|
-
_See code: [src/commands/instance/sync-rules/validate.ts](https://github.com/powersync-ja/cli/blob/v0.7.
|
|
367
|
+
_See code: [src/commands/instance/sync-rules/validate.ts](https://github.com/powersync-ja/cli/blob/v0.7.1/src/commands/instance/sync-rules/validate.ts)_
|
|
367
368
|
|
|
368
369
|
## `powersync instances`
|
|
369
370
|
|
|
@@ -380,5 +381,5 @@ EXAMPLES
|
|
|
380
381
|
$ npx powersync instances
|
|
381
382
|
```
|
|
382
383
|
|
|
383
|
-
_See code: [src/commands/instances.ts](https://github.com/powersync-ja/cli/blob/v0.7.
|
|
384
|
+
_See code: [src/commands/instances.ts](https://github.com/powersync-ja/cli/blob/v0.7.1/src/commands/instances.ts)_
|
|
384
385
|
<!-- commandsstop -->
|
|
@@ -9,12 +9,12 @@ export default class InstanceCreate extends Command {
|
|
|
9
9
|
hostname: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
10
|
jwksUri: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
11
|
jwtAudiences: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
-
name: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
12
|
port: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
14
|
-
region: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
15
13
|
skipInteraction: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
16
14
|
supabaseJWTSecret: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
17
15
|
useSupabaseAuth: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
16
|
+
name: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
17
|
+
region: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
18
18
|
};
|
|
19
19
|
run(): Promise<void>;
|
|
20
20
|
}
|
|
@@ -2,28 +2,21 @@ import { Command, Flags, ux } from '@oclif/core';
|
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
3
|
import ora from 'ora';
|
|
4
4
|
import { generateCommonDeployQuestions } from '../../commands.utils.js';
|
|
5
|
+
import { generateCommonInstanceConfigFlags } from '../../instance-command-flags.js';
|
|
5
6
|
import * as PowerSyncClient from '../../service/powersync.client.js';
|
|
6
7
|
import { bold, checkThatEnvVariablesAreSet, green, red, updateEnvFileVariableValue } from '../../utils.js';
|
|
7
8
|
export default class InstanceCreate extends Command {
|
|
8
9
|
static description = 'Create a new instance.';
|
|
9
10
|
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
10
11
|
static flags = {
|
|
11
|
-
databaseName: Flags.string({ char: 'n', description: 'Name of the database.' }),
|
|
12
|
-
databasePassword: Flags.string({ char: 'p', description: 'Password of the database.', hidden: true }),
|
|
13
|
-
databaseUsername: Flags.string({ char: 'u', description: 'Username of the database.', hidden: true }),
|
|
14
|
-
hostname: Flags.string({ char: 'h', description: 'Hostname to connect to database.' }),
|
|
15
|
-
jwksUri: Flags.string({ char: 'w', description: 'JWKS URI (must include https://).' }),
|
|
16
|
-
jwtAudiences: Flags.string({ char: 'a', default: '', description: 'JWT audiences (comma separated).' }),
|
|
17
12
|
name: Flags.string({ char: 'i', description: 'Name of the instance.' }),
|
|
18
|
-
port: Flags.integer({ char: 'o', description: 'Port number to connect to database.' }),
|
|
19
13
|
region: Flags.string({ char: 'r', description: 'Region to deploy instance to.' }),
|
|
20
|
-
|
|
21
|
-
supabaseJWTSecret: Flags.string({ allowNo: true, char: 'j', description: 'Supabase JWT secret' }),
|
|
22
|
-
useSupabaseAuth: Flags.boolean({ allowNo: true, char: 'b', description: 'Use Supabase auth.' })
|
|
14
|
+
...generateCommonInstanceConfigFlags()
|
|
23
15
|
};
|
|
24
16
|
async run() {
|
|
25
17
|
checkThatEnvVariablesAreSet(this.config.bin);
|
|
26
|
-
const
|
|
18
|
+
const parsed = await this.parse(InstanceCreate);
|
|
19
|
+
const flags = parsed.flags;
|
|
27
20
|
const regions = await PowerSyncClient.getRegions();
|
|
28
21
|
let answers = {
|
|
29
22
|
databaseName: undefined,
|
|
@@ -70,7 +63,7 @@ export default class InstanceCreate extends Command {
|
|
|
70
63
|
const jwksUri = flags.jwksUri || answers.jwksUri;
|
|
71
64
|
const answerAudiences = answers.jwtAudiences ? answers.jwtAudiences.split(',') : [];
|
|
72
65
|
const flagsAudiences = flags.jwtAudiences ? flags.jwtAudiences.split(',') : [];
|
|
73
|
-
const audiences = [...flagsAudiences, ...answerAudiences];
|
|
66
|
+
const audiences = [...new Set([...flagsAudiences, ...answerAudiences])];
|
|
74
67
|
const supabaseJWTSecret = flags.supabaseJWTSecret ?? answers.supabaseJWTSecret;
|
|
75
68
|
// TODO, support other connection types
|
|
76
69
|
const connection = {
|
|
@@ -98,7 +91,7 @@ export default class InstanceCreate extends Command {
|
|
|
98
91
|
}
|
|
99
92
|
: undefined
|
|
100
93
|
},
|
|
101
|
-
region,
|
|
94
|
+
region: region,
|
|
102
95
|
replication: {
|
|
103
96
|
connections: [connection]
|
|
104
97
|
}
|
|
@@ -8,9 +8,10 @@ export default class InstanceDeploy extends Command {
|
|
|
8
8
|
databaseUsername: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
9
|
hostname: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
10
|
jwksUri: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
-
jwtAudiences: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string
|
|
11
|
+
jwtAudiences: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
12
|
port: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
13
|
skipInteraction: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
14
|
+
supabaseJWTSecret: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
14
15
|
useSupabaseAuth: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
15
16
|
};
|
|
16
17
|
run(): Promise<void>;
|
|
@@ -1,33 +1,27 @@
|
|
|
1
|
-
import { Command,
|
|
1
|
+
import { Command, ux } from '@oclif/core';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
3
|
import ora from 'ora';
|
|
4
4
|
import { generateCommonDeployQuestions } from '../../commands.utils.js';
|
|
5
|
+
import { generateCommonInstanceConfigFlags } from '../../instance-command-flags.js';
|
|
5
6
|
import * as PowerSyncClient from '../../service/powersync.client.js';
|
|
6
7
|
import { bold, checkThatEnvVariablesAreSet, green, red } from '../../utils.js';
|
|
7
8
|
export default class InstanceDeploy extends Command {
|
|
8
9
|
static description = 'Deploy changes to an existing instance.';
|
|
9
10
|
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
10
11
|
static flags = {
|
|
11
|
-
|
|
12
|
-
databasePassword: Flags.string({ char: 'p', description: 'Password of the database.', hidden: true }),
|
|
13
|
-
databaseUsername: Flags.string({ char: 'u', description: 'Username of the database.', hidden: true }),
|
|
14
|
-
hostname: Flags.string({ char: 'h', description: 'Hostname to connect to database.' }),
|
|
15
|
-
jwksUri: Flags.string({ char: 'w', description: 'JWKS URI (must include https://).' }),
|
|
16
|
-
jwtAudiences: Flags.string({ char: 'a', description: 'JWT audiences (comma separated).' }),
|
|
17
|
-
port: Flags.integer({ char: 'o', description: 'Port number to connect to database.' }),
|
|
18
|
-
skipInteraction: Flags.boolean({ char: 's', description: 'Skip interactivity.' }),
|
|
19
|
-
useSupabaseAuth: Flags.boolean({ allowNo: true, char: 'b', description: 'Use Supabase auth.' })
|
|
12
|
+
...generateCommonInstanceConfigFlags()
|
|
20
13
|
};
|
|
21
14
|
async run() {
|
|
22
15
|
checkThatEnvVariablesAreSet(this.config.bin, true);
|
|
23
|
-
const
|
|
16
|
+
const parsed = await this.parse(InstanceDeploy);
|
|
17
|
+
const flags = parsed.flags;
|
|
24
18
|
let answers = {
|
|
25
19
|
databaseName: undefined,
|
|
26
20
|
databasePassword: undefined,
|
|
27
21
|
databaseUsername: undefined,
|
|
28
22
|
hostname: undefined,
|
|
29
|
-
jwksAudiences: undefined,
|
|
30
23
|
jwksUri: undefined,
|
|
24
|
+
jwtAudiences: undefined,
|
|
31
25
|
port: undefined,
|
|
32
26
|
useSupabaseAuth: undefined
|
|
33
27
|
};
|
|
@@ -42,16 +36,22 @@ export default class InstanceDeploy extends Command {
|
|
|
42
36
|
const databaseUsername = flags.databaseUsername || answers.databaseUsername;
|
|
43
37
|
const useSupabaseAuth = flags.useSupabaseAuth || answers.useSupabaseAuth;
|
|
44
38
|
const jwksUri = flags.jwksUri || answers.jwksUri;
|
|
45
|
-
const answerAudiences = answers.
|
|
46
|
-
const flagsAudiences = flags.
|
|
47
|
-
const audiences = flagsAudiences
|
|
39
|
+
const answerAudiences = answers.jwtAudiences ? answers.jwtAudiences.split(',') : [];
|
|
40
|
+
const flagsAudiences = flags.jwtAudiences ? flags.jwtAudiences.split(',') : [];
|
|
41
|
+
const audiences = [...new Set([...flagsAudiences, ...answerAudiences])];
|
|
42
|
+
const supabaseJWTSecret = flags.supabaseJWTSecret ?? answers.supabaseJWTSecret;
|
|
48
43
|
const instanceConfig = await PowerSyncClient.getInstanceConfig();
|
|
49
44
|
const { region } = instanceConfig.config;
|
|
50
45
|
const config = {
|
|
51
46
|
client_auth: {
|
|
52
47
|
additional_audiences: audiences || undefined,
|
|
53
48
|
jwks_uri: jwksUri || undefined,
|
|
54
|
-
supabase: useSupabaseAuth
|
|
49
|
+
supabase: useSupabaseAuth,
|
|
50
|
+
supabase_jwt_secret: supabaseJWTSecret
|
|
51
|
+
? {
|
|
52
|
+
secret: supabaseJWTSecret
|
|
53
|
+
}
|
|
54
|
+
: undefined
|
|
55
55
|
},
|
|
56
56
|
region,
|
|
57
57
|
replication: {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const generateCommonInstanceConfigFlags: () => {
|
|
2
|
+
databaseName: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
3
|
+
databasePassword: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
4
|
+
databaseUsername: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
5
|
+
hostname: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
6
|
+
jwksUri: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
7
|
+
jwtAudiences: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
8
|
+
port: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
skipInteraction: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
10
|
+
supabaseJWTSecret: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
useSupabaseAuth: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
export const generateCommonInstanceConfigFlags = () => ({
|
|
3
|
+
databaseName: Flags.string({ char: 'n', description: 'Name of the database.' }),
|
|
4
|
+
databasePassword: Flags.string({ char: 'p', description: 'Password of the database.', hidden: true }),
|
|
5
|
+
databaseUsername: Flags.string({ char: 'u', description: 'Username of the database.', hidden: true }),
|
|
6
|
+
hostname: Flags.string({ char: 'h', description: 'Hostname to connect to database.' }),
|
|
7
|
+
jwksUri: Flags.string({ char: 'w', description: 'JWKS URI (must include https://).' }),
|
|
8
|
+
jwtAudiences: Flags.string({ char: 'a', default: '', description: 'JWT audiences (comma separated).' }),
|
|
9
|
+
port: Flags.integer({ char: 'o', description: 'Port number to connect to database.' }),
|
|
10
|
+
skipInteraction: Flags.boolean({ char: 's', description: 'Skip interactivity.' }),
|
|
11
|
+
supabaseJWTSecret: Flags.string({ allowNo: true, char: 'j', description: 'Supabase JWT secret' }),
|
|
12
|
+
useSupabaseAuth: Flags.boolean({ allowNo: true, char: 'b', description: 'Use Supabase auth.' })
|
|
13
|
+
});
|
|
@@ -11157,7 +11157,7 @@ var files = [
|
|
|
11157
11157
|
"/dist",
|
|
11158
11158
|
"/oclif.manifest.json"
|
|
11159
11159
|
];
|
|
11160
|
-
var version = "0.7.
|
|
11160
|
+
var version = "0.7.1";
|
|
11161
11161
|
var bugs = "https://github.com/powersync-ja/cli/issues";
|
|
11162
11162
|
var types = "dist/index.d.ts";
|
|
11163
11163
|
var exports = "./lib/index.js";
|
|
@@ -47503,7 +47503,7 @@ var files = [
|
|
|
47503
47503
|
"/dist",
|
|
47504
47504
|
"/oclif.manifest.json"
|
|
47505
47505
|
];
|
|
47506
|
-
var version = "0.7.
|
|
47506
|
+
var version = "0.7.1";
|
|
47507
47507
|
var bugs = "https://github.com/powersync-ja/cli/issues";
|
|
47508
47508
|
var types$2 = "dist/index.d.ts";
|
|
47509
47509
|
var exports = "./lib/index.js";
|
package/dist/service/utils.js
CHANGED
package/dist/utils.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import type { FlagInput } from '@oclif/core/lib/interfaces/parser.js';
|
|
2
|
+
/**
|
|
3
|
+
* Oclif flags include {[flag: string]: any} which allows for any additional flag members.
|
|
4
|
+
* This makes using flags vulnerable to typos and errors.
|
|
5
|
+
* This helper type only exposes the declared flag members in the type.
|
|
6
|
+
*/
|
|
7
|
+
export type StrictFlags<T> = T extends FlagInput<infer U> ? U : never;
|
|
1
8
|
export declare const checkThatEnvVariablesAreSet: (cliName: string, requiresInstanceId?: boolean) => undefined;
|
|
2
9
|
export declare const updateEnvFileVariableValue: (variableName: string, newValue: string) => void;
|
|
3
10
|
export declare const bold: (text: string) => string;
|
package/oclif.manifest.json
CHANGED
|
@@ -78,6 +78,22 @@
|
|
|
78
78
|
"<%= config.bin %> <%= command.id %>"
|
|
79
79
|
],
|
|
80
80
|
"flags": {
|
|
81
|
+
"name": {
|
|
82
|
+
"char": "i",
|
|
83
|
+
"description": "Name of the instance.",
|
|
84
|
+
"name": "name",
|
|
85
|
+
"hasDynamicHelp": false,
|
|
86
|
+
"multiple": false,
|
|
87
|
+
"type": "option"
|
|
88
|
+
},
|
|
89
|
+
"region": {
|
|
90
|
+
"char": "r",
|
|
91
|
+
"description": "Region to deploy instance to.",
|
|
92
|
+
"name": "region",
|
|
93
|
+
"hasDynamicHelp": false,
|
|
94
|
+
"multiple": false,
|
|
95
|
+
"type": "option"
|
|
96
|
+
},
|
|
81
97
|
"databaseName": {
|
|
82
98
|
"char": "n",
|
|
83
99
|
"description": "Name of the database.",
|
|
@@ -129,14 +145,6 @@
|
|
|
129
145
|
"multiple": false,
|
|
130
146
|
"type": "option"
|
|
131
147
|
},
|
|
132
|
-
"name": {
|
|
133
|
-
"char": "i",
|
|
134
|
-
"description": "Name of the instance.",
|
|
135
|
-
"name": "name",
|
|
136
|
-
"hasDynamicHelp": false,
|
|
137
|
-
"multiple": false,
|
|
138
|
-
"type": "option"
|
|
139
|
-
},
|
|
140
148
|
"port": {
|
|
141
149
|
"char": "o",
|
|
142
150
|
"description": "Port number to connect to database.",
|
|
@@ -145,14 +153,6 @@
|
|
|
145
153
|
"multiple": false,
|
|
146
154
|
"type": "option"
|
|
147
155
|
},
|
|
148
|
-
"region": {
|
|
149
|
-
"char": "r",
|
|
150
|
-
"description": "Region to deploy instance to.",
|
|
151
|
-
"name": "region",
|
|
152
|
-
"hasDynamicHelp": false,
|
|
153
|
-
"multiple": false,
|
|
154
|
-
"type": "option"
|
|
155
|
-
},
|
|
156
156
|
"skipInteraction": {
|
|
157
157
|
"char": "s",
|
|
158
158
|
"description": "Skip interactivity.",
|
|
@@ -246,6 +246,7 @@
|
|
|
246
246
|
"char": "a",
|
|
247
247
|
"description": "JWT audiences (comma separated).",
|
|
248
248
|
"name": "jwtAudiences",
|
|
249
|
+
"default": "",
|
|
249
250
|
"hasDynamicHelp": false,
|
|
250
251
|
"multiple": false,
|
|
251
252
|
"type": "option"
|
|
@@ -265,6 +266,14 @@
|
|
|
265
266
|
"allowNo": false,
|
|
266
267
|
"type": "boolean"
|
|
267
268
|
},
|
|
269
|
+
"supabaseJWTSecret": {
|
|
270
|
+
"char": "j",
|
|
271
|
+
"description": "Supabase JWT secret",
|
|
272
|
+
"name": "supabaseJWTSecret",
|
|
273
|
+
"hasDynamicHelp": false,
|
|
274
|
+
"multiple": false,
|
|
275
|
+
"type": "option"
|
|
276
|
+
},
|
|
268
277
|
"useSupabaseAuth": {
|
|
269
278
|
"char": "b",
|
|
270
279
|
"description": "Use Supabase auth.",
|
|
@@ -641,5 +650,5 @@
|
|
|
641
650
|
]
|
|
642
651
|
}
|
|
643
652
|
},
|
|
644
|
-
"version": "0.7.
|
|
653
|
+
"version": "0.7.1"
|
|
645
654
|
}
|