powersync 0.4.0 → 0.4.2
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 +20 -22
- package/dist/commands/instance/create.js +3 -3
- package/dist/commands/instance/status.js +16 -4
- package/dist/commands/instance/stop.js +1 -1
- package/dist/commands/instance/sync-rules/deploy.js +2 -2
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +0 -1
- package/dist/service/accounts.client.js +117 -90
- package/dist/service/powersync.client.js +8402 -2131
- package/dist/service/utils.js +25 -25
- package/oclif.manifest.json +1 -5
- package/package.json +25 -25
package/README.md
CHANGED
|
@@ -16,7 +16,6 @@ For an overview, see the docs [here](https://docs.powersync.com/usage/tools/cli-
|
|
|
16
16
|
$ npx powersync
|
|
17
17
|
$ npx powersync COMMAND
|
|
18
18
|
running command...
|
|
19
|
-
powersync/0.4.0 linux-x64 node-v20.11.1
|
|
20
19
|
$ npx powersync --help [COMMAND]
|
|
21
20
|
USAGE
|
|
22
21
|
$ npx powersync COMMAND
|
|
@@ -39,7 +38,7 @@ Example:
|
|
|
39
38
|
# Commands
|
|
40
39
|
|
|
41
40
|
<!-- commands -->
|
|
42
|
-
* [`powersync help [
|
|
41
|
+
* [`powersync help [COMMAND]`](#powersync-help-command)
|
|
43
42
|
* [`powersync init`](#powersync-init)
|
|
44
43
|
* [`powersync instance config`](#powersync-instance-config)
|
|
45
44
|
* [`powersync instance create`](#powersync-instance-create)
|
|
@@ -54,16 +53,16 @@ Example:
|
|
|
54
53
|
* [`powersync instance sync-rules validate`](#powersync-instance-sync-rules-validate)
|
|
55
54
|
* [`powersync instances`](#powersync-instances)
|
|
56
55
|
|
|
57
|
-
## `powersync help [
|
|
56
|
+
## `powersync help [COMMAND]`
|
|
58
57
|
|
|
59
58
|
Display help for powersync.
|
|
60
59
|
|
|
61
60
|
```
|
|
62
61
|
USAGE
|
|
63
|
-
$ npx powersync help [
|
|
62
|
+
$ npx powersync help [COMMAND...] [-n]
|
|
64
63
|
|
|
65
64
|
ARGUMENTS
|
|
66
|
-
|
|
65
|
+
COMMAND... Command to show help for.
|
|
67
66
|
|
|
68
67
|
FLAGS
|
|
69
68
|
-n, --nested-commands Include all nested commands in the output.
|
|
@@ -72,7 +71,7 @@ DESCRIPTION
|
|
|
72
71
|
Display help for powersync.
|
|
73
72
|
```
|
|
74
73
|
|
|
75
|
-
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.
|
|
74
|
+
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.8/src/commands/help.ts)_
|
|
76
75
|
|
|
77
76
|
## `powersync init`
|
|
78
77
|
|
|
@@ -90,7 +89,7 @@ EXAMPLES
|
|
|
90
89
|
$ npx powersync init
|
|
91
90
|
```
|
|
92
91
|
|
|
93
|
-
_See code: [src/commands/init.ts](https://github.com/powersync-ja/cli/blob/v0.4.
|
|
92
|
+
_See code: [src/commands/init.ts](https://github.com/powersync-ja/cli/blob/v0.4.2/src/commands/init.ts)_
|
|
94
93
|
|
|
95
94
|
## `powersync instance config`
|
|
96
95
|
|
|
@@ -107,7 +106,7 @@ EXAMPLES
|
|
|
107
106
|
$ npx powersync instance config
|
|
108
107
|
```
|
|
109
108
|
|
|
110
|
-
_See code: [src/commands/instance/config.ts](https://github.com/powersync-ja/cli/blob/v0.4.
|
|
109
|
+
_See code: [src/commands/instance/config.ts](https://github.com/powersync-ja/cli/blob/v0.4.2/src/commands/instance/config.ts)_
|
|
111
110
|
|
|
112
111
|
## `powersync instance create`
|
|
113
112
|
|
|
@@ -116,15 +115,14 @@ Create a new instance.
|
|
|
116
115
|
```
|
|
117
116
|
USAGE
|
|
118
117
|
$ npx powersync instance create [--databaseName <value>] [--hostname <value>] [--name <value>] [--port <value>]
|
|
119
|
-
[--region
|
|
118
|
+
[--region <value>] [--useSupabaseAuth]
|
|
120
119
|
|
|
121
120
|
FLAGS
|
|
122
121
|
--databaseName=<value> Name of the database.
|
|
123
122
|
--hostname=<value> Hostname to connect to database.
|
|
124
123
|
--name=<value> Name of the instance.
|
|
125
124
|
--port=<value> Port number to connect to database.
|
|
126
|
-
--region=<
|
|
127
|
-
<options: US|EU>
|
|
125
|
+
--region=<value> Region to deploy instance to.
|
|
128
126
|
--useSupabaseAuth Use Supabase for auth.
|
|
129
127
|
|
|
130
128
|
DESCRIPTION
|
|
@@ -134,7 +132,7 @@ EXAMPLES
|
|
|
134
132
|
$ npx powersync instance create
|
|
135
133
|
```
|
|
136
134
|
|
|
137
|
-
_See code: [src/commands/instance/create.ts](https://github.com/powersync-ja/cli/blob/v0.4.
|
|
135
|
+
_See code: [src/commands/instance/create.ts](https://github.com/powersync-ja/cli/blob/v0.4.2/src/commands/instance/create.ts)_
|
|
138
136
|
|
|
139
137
|
## `powersync instance deploy`
|
|
140
138
|
|
|
@@ -159,7 +157,7 @@ EXAMPLES
|
|
|
159
157
|
$ npx powersync instance deploy
|
|
160
158
|
```
|
|
161
159
|
|
|
162
|
-
_See code: [src/commands/instance/deploy.ts](https://github.com/powersync-ja/cli/blob/v0.4.
|
|
160
|
+
_See code: [src/commands/instance/deploy.ts](https://github.com/powersync-ja/cli/blob/v0.4.2/src/commands/instance/deploy.ts)_
|
|
163
161
|
|
|
164
162
|
## `powersync instance destroy`
|
|
165
163
|
|
|
@@ -179,7 +177,7 @@ EXAMPLES
|
|
|
179
177
|
$ npx powersync instance destroy
|
|
180
178
|
```
|
|
181
179
|
|
|
182
|
-
_See code: [src/commands/instance/destroy.ts](https://github.com/powersync-ja/cli/blob/v0.4.
|
|
180
|
+
_See code: [src/commands/instance/destroy.ts](https://github.com/powersync-ja/cli/blob/v0.4.2/src/commands/instance/destroy.ts)_
|
|
183
181
|
|
|
184
182
|
## `powersync instance schema`
|
|
185
183
|
|
|
@@ -196,7 +194,7 @@ EXAMPLES
|
|
|
196
194
|
$ npx powersync instance schema
|
|
197
195
|
```
|
|
198
196
|
|
|
199
|
-
_See code: [src/commands/instance/schema.ts](https://github.com/powersync-ja/cli/blob/v0.4.
|
|
197
|
+
_See code: [src/commands/instance/schema.ts](https://github.com/powersync-ja/cli/blob/v0.4.2/src/commands/instance/schema.ts)_
|
|
200
198
|
|
|
201
199
|
## `powersync instance set`
|
|
202
200
|
|
|
@@ -218,7 +216,7 @@ EXAMPLES
|
|
|
218
216
|
$ npx powersync instance set --instanceId=1234
|
|
219
217
|
```
|
|
220
218
|
|
|
221
|
-
_See code: [src/commands/instance/set.ts](https://github.com/powersync-ja/cli/blob/v0.4.
|
|
219
|
+
_See code: [src/commands/instance/set.ts](https://github.com/powersync-ja/cli/blob/v0.4.2/src/commands/instance/set.ts)_
|
|
222
220
|
|
|
223
221
|
## `powersync instance status`
|
|
224
222
|
|
|
@@ -243,7 +241,7 @@ EXAMPLES
|
|
|
243
241
|
$ npx powersync instance status --orgId=1234 --projectId=1234 --instanceId=1234 --authToken=1234
|
|
244
242
|
```
|
|
245
243
|
|
|
246
|
-
_See code: [src/commands/instance/status.ts](https://github.com/powersync-ja/cli/blob/v0.4.
|
|
244
|
+
_See code: [src/commands/instance/status.ts](https://github.com/powersync-ja/cli/blob/v0.4.2/src/commands/instance/status.ts)_
|
|
247
245
|
|
|
248
246
|
## `powersync instance stop`
|
|
249
247
|
|
|
@@ -263,7 +261,7 @@ EXAMPLES
|
|
|
263
261
|
$ npx powersync instance stop
|
|
264
262
|
```
|
|
265
263
|
|
|
266
|
-
_See code: [src/commands/instance/stop.ts](https://github.com/powersync-ja/cli/blob/v0.4.
|
|
264
|
+
_See code: [src/commands/instance/stop.ts](https://github.com/powersync-ja/cli/blob/v0.4.2/src/commands/instance/stop.ts)_
|
|
267
265
|
|
|
268
266
|
## `powersync instance sync-rules deploy`
|
|
269
267
|
|
|
@@ -288,7 +286,7 @@ EXAMPLES
|
|
|
288
286
|
$ npx powersync instance sync-rules deploy -f path/to/file
|
|
289
287
|
```
|
|
290
288
|
|
|
291
|
-
_See code: [src/commands/instance/sync-rules/deploy.ts](https://github.com/powersync-ja/cli/blob/v0.4.
|
|
289
|
+
_See code: [src/commands/instance/sync-rules/deploy.ts](https://github.com/powersync-ja/cli/blob/v0.4.2/src/commands/instance/sync-rules/deploy.ts)_
|
|
292
290
|
|
|
293
291
|
## `powersync instance sync-rules generate-schema`
|
|
294
292
|
|
|
@@ -314,7 +312,7 @@ EXAMPLES
|
|
|
314
312
|
$ npx powersync instance sync-rules generate-schema -f path/to/file
|
|
315
313
|
```
|
|
316
314
|
|
|
317
|
-
_See code: [src/commands/instance/sync-rules/generate-schema.ts](https://github.com/powersync-ja/cli/blob/v0.4.
|
|
315
|
+
_See code: [src/commands/instance/sync-rules/generate-schema.ts](https://github.com/powersync-ja/cli/blob/v0.4.2/src/commands/instance/sync-rules/generate-schema.ts)_
|
|
318
316
|
|
|
319
317
|
## `powersync instance sync-rules validate`
|
|
320
318
|
|
|
@@ -338,7 +336,7 @@ EXAMPLES
|
|
|
338
336
|
$ npx powersync instance sync-rules validate -f path/to/file
|
|
339
337
|
```
|
|
340
338
|
|
|
341
|
-
_See code: [src/commands/instance/sync-rules/validate.ts](https://github.com/powersync-ja/cli/blob/v0.4.
|
|
339
|
+
_See code: [src/commands/instance/sync-rules/validate.ts](https://github.com/powersync-ja/cli/blob/v0.4.2/src/commands/instance/sync-rules/validate.ts)_
|
|
342
340
|
|
|
343
341
|
## `powersync instances`
|
|
344
342
|
|
|
@@ -355,5 +353,5 @@ EXAMPLES
|
|
|
355
353
|
$ npx powersync instances
|
|
356
354
|
```
|
|
357
355
|
|
|
358
|
-
_See code: [src/commands/instances.ts](https://github.com/powersync-ja/cli/blob/v0.4.
|
|
356
|
+
_See code: [src/commands/instances.ts](https://github.com/powersync-ja/cli/blob/v0.4.2/src/commands/instances.ts)_
|
|
359
357
|
<!-- commandsstop -->
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { Command, Flags, ux } from '@oclif/core';
|
|
3
3
|
import inquirer from 'inquirer';
|
|
4
4
|
import ora from 'ora';
|
|
5
|
-
import { REGIONS } from '../../constants.js';
|
|
6
5
|
import * as PowerSyncClient from '../../service/powersync.client.js';
|
|
7
6
|
import { bold, checkForValidEnvFile, green, red, updateEnvFileVariableValue } from '../../utils.js';
|
|
8
7
|
export default class InstanceCreate extends Command {
|
|
@@ -15,12 +14,13 @@ export default class InstanceCreate extends Command {
|
|
|
15
14
|
hostname: Flags.string({ description: 'Hostname to connect to database.' }),
|
|
16
15
|
name: Flags.string({ description: 'Name of the instance.' }),
|
|
17
16
|
port: Flags.integer({ description: 'Port number to connect to database.' }),
|
|
18
|
-
region: Flags.string({ description: 'Region to deploy instance to.'
|
|
17
|
+
region: Flags.string({ description: 'Region to deploy instance to.' }),
|
|
19
18
|
useSupabaseAuth: Flags.boolean({ description: 'Use Supabase for auth.' })
|
|
20
19
|
};
|
|
21
20
|
async run() {
|
|
22
21
|
checkForValidEnvFile(this.config.bin);
|
|
23
22
|
const { flags } = await this.parse(InstanceCreate);
|
|
23
|
+
const regions = await PowerSyncClient.getRegions();
|
|
24
24
|
const questions = [
|
|
25
25
|
{
|
|
26
26
|
message: 'What do you want to name your instance?',
|
|
@@ -32,7 +32,7 @@ export default class InstanceCreate extends Command {
|
|
|
32
32
|
when: !flags.name
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
|
-
choices:
|
|
35
|
+
choices: regions.map((region) => region.toUpperCase()),
|
|
36
36
|
message: 'What region do you want to use?',
|
|
37
37
|
name: 'region',
|
|
38
38
|
type: 'list',
|
|
@@ -8,10 +8,22 @@ export default class InstanceStatus extends Command {
|
|
|
8
8
|
'<%= config.bin %> <%= command.id %> --orgId=1234 --projectId=1234 --instanceId=1234 --authToken=1234'
|
|
9
9
|
];
|
|
10
10
|
static flags = {
|
|
11
|
-
authToken: Flags.string({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
authToken: Flags.string({
|
|
12
|
+
char: 't',
|
|
13
|
+
description: 'Override current auth token.'
|
|
14
|
+
}),
|
|
15
|
+
instanceId: Flags.string({
|
|
16
|
+
char: 'i',
|
|
17
|
+
description: 'Override current instance by providing the ID of a different instance.'
|
|
18
|
+
}),
|
|
19
|
+
orgId: Flags.string({
|
|
20
|
+
char: 'o',
|
|
21
|
+
description: 'Override current organization by providing the ID of a different organization.'
|
|
22
|
+
}),
|
|
23
|
+
projectId: Flags.string({
|
|
24
|
+
char: 'p',
|
|
25
|
+
description: 'Override current project by providing the ID of a different project.'
|
|
26
|
+
})
|
|
15
27
|
};
|
|
16
28
|
async run() {
|
|
17
29
|
const { flags } = await this.parse(InstanceStatus);
|
|
@@ -21,7 +21,7 @@ export default class InstanceDeactivate extends Command {
|
|
|
21
21
|
}
|
|
22
22
|
];
|
|
23
23
|
const answers = await inquirer.prompt(questions);
|
|
24
|
-
if (!answers.areYouSure) {
|
|
24
|
+
if (!answers.areYouSure && !flags.skipConfirmation) {
|
|
25
25
|
return ux.log('Instance will not be stopped.');
|
|
26
26
|
}
|
|
27
27
|
const spinner = ora({
|
|
@@ -27,8 +27,8 @@ export default class SyncRulesDeploy extends Command {
|
|
|
27
27
|
}
|
|
28
28
|
];
|
|
29
29
|
const answers = await inquirer.prompt(questions);
|
|
30
|
-
if (!answers.areYouSure) {
|
|
31
|
-
return ux.log('Sync files were not deployed.');
|
|
30
|
+
if (!answers.areYouSure && !flags.skipConfirmation) {
|
|
31
|
+
return ux.log(red('Sync files were not deployed.'));
|
|
32
32
|
}
|
|
33
33
|
const syncRules = fs.readFileSync(flags.filePath, 'utf8');
|
|
34
34
|
const spinner = ora({
|
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
|
@@ -10049,10 +10049,7 @@ var models = {};
|
|
|
10049
10049
|
})(BUSINESS_REGION || (exports.BUSINESS_REGION = BUSINESS_REGION = {}));
|
|
10050
10050
|
exports.Organization = t.object({
|
|
10051
10051
|
label: t.string,
|
|
10052
|
-
trial: t.boolean.optional(),
|
|
10053
10052
|
locked: t.boolean.optional(),
|
|
10054
|
-
pre_signup_trial_expiry: t.string.optional(),
|
|
10055
|
-
trial_expiry: t.string.optional(),
|
|
10056
10053
|
business_customer_code: t.string.optional(),
|
|
10057
10054
|
business_customer_region: t.Enum(BUSINESS_REGION).optional()
|
|
10058
10055
|
});
|
|
@@ -10075,7 +10072,10 @@ var models = {};
|
|
|
10075
10072
|
vcs_mode: t.Enum(VCS_MODE).optional(),
|
|
10076
10073
|
source: source.SourceMetadata.optional(),
|
|
10077
10074
|
region: t.string,
|
|
10078
|
-
features: t.array(t.Enum(ProjectFeatureFlags))
|
|
10075
|
+
features: t.array(t.Enum(ProjectFeatureFlags)),
|
|
10076
|
+
trial: t.boolean.optional(),
|
|
10077
|
+
locked: t.boolean.optional(),
|
|
10078
|
+
trial_expiry: t.string.optional()
|
|
10079
10079
|
});
|
|
10080
10080
|
exports.AppResource = exports.App.and(codecs.ResourceId);
|
|
10081
10081
|
var UserOrgAccess;
|
|
@@ -10160,7 +10160,7 @@ var models = {};
|
|
|
10160
10160
|
return result;
|
|
10161
10161
|
};
|
|
10162
10162
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10163
|
-
exports.SendMFASMSResponse = exports.SendMFASMSParams = exports.SetUserMFAPreferenceResponse = exports.SetUserMFAPreferenceParams = exports.GetMFABackupCodesResponse = exports.DeleteMFAFactorResponse = exports.DeleteMFAFactorParams = exports.VerifyMFAFactorResponse = exports.VerifyMFAFactorParams = exports.RegisterSMSMFAFactorResponse = exports.RegisterSMSMFAFactorParams = exports.RegisterTOTPMFAFactorResponse = exports.UpdateUserParams = exports.ListUserMFAFactorsResponse = exports.CreateUserParams = exports.GetPreferredMFAFactorResponse = exports.GetSensitiveAccessTokenResponse = exports.GetSensitiveAccessTokenParams = exports.GiveUserAccessParams = exports.TokenResponse = exports.CompleteSignupParams = exports.UpdateInviteParams = exports.
|
|
10163
|
+
exports.UpdateAppLocksParams = exports.UpdateOrgLocksParams = exports.SendMFASMSResponse = exports.SendMFASMSParams = exports.SetUserMFAPreferenceResponse = exports.SetUserMFAPreferenceParams = exports.GetMFABackupCodesResponse = exports.DeleteMFAFactorResponse = exports.DeleteMFAFactorParams = exports.VerifyMFAFactorResponse = exports.VerifyMFAFactorParams = exports.RegisterSMSMFAFactorResponse = exports.RegisterSMSMFAFactorParams = exports.RegisterTOTPMFAFactorResponse = exports.UpdateUserParams = exports.ListUserMFAFactorsResponse = exports.CreateUserParams = exports.GetPreferredMFAFactorResponse = exports.GetSensitiveAccessTokenResponse = exports.GetSensitiveAccessTokenParams = exports.GiveUserAccessParams = exports.TokenResponse = exports.CompleteSignupParams = exports.UpdateInviteParams = exports.GetSignupUserResponse = exports.CreateDeveloperInviteParams = exports.StartSignupParams = exports.ListUserResponse = exports.ListUserParams = exports.ListUserInvitesResponse = exports.GetUserInvitesParams = exports.ListAppsResponse = exports.ListAppParams = exports.UpdateAppParams = exports.CreateAppParams = exports.ListOrgResponse = exports.ListOrgParams = exports.UpdateOrgBilling = exports.UpdateOrgParams = exports.CreateOrgParams = exports.ExtendAppTrialParams = exports.UpgradeAppParams = exports.DowngradeAppParams = exports.ListResponseMetaData = exports.SearchParams = exports.PaginationParams = exports.OperationResponse = exports.IDParam = void 0;
|
|
10164
10164
|
const source = __importStar(dist$3);
|
|
10165
10165
|
const codecs = __importStar(dist);
|
|
10166
10166
|
const models$1 = __importStar(models);
|
|
@@ -10184,20 +10184,23 @@ var models = {};
|
|
|
10184
10184
|
total: t.number,
|
|
10185
10185
|
cursor: t.string
|
|
10186
10186
|
});
|
|
10187
|
-
exports.
|
|
10188
|
-
|
|
10187
|
+
exports.DowngradeAppParams = t.object({
|
|
10188
|
+
app_id: t.string,
|
|
10189
10189
|
trial_duration: t.number
|
|
10190
10190
|
});
|
|
10191
|
-
exports.
|
|
10192
|
-
|
|
10191
|
+
exports.UpgradeAppParams = t.object({
|
|
10192
|
+
app_id: t.string
|
|
10193
|
+
});
|
|
10194
|
+
exports.ExtendAppTrialParams = t.object({
|
|
10195
|
+
app_id: t.string,
|
|
10196
|
+
trial_duration: t.number
|
|
10193
10197
|
});
|
|
10194
10198
|
exports.CreateOrgParams = t.object({
|
|
10195
10199
|
name: t.string
|
|
10196
10200
|
});
|
|
10197
10201
|
exports.UpdateOrgParams = t.object({
|
|
10198
10202
|
id: t.string,
|
|
10199
|
-
label: t.string.optional()
|
|
10200
|
-
locked: t.boolean.optional()
|
|
10203
|
+
label: t.string.optional()
|
|
10201
10204
|
});
|
|
10202
10205
|
exports.UpdateOrgBilling = t.object({
|
|
10203
10206
|
id: t.string,
|
|
@@ -10215,7 +10218,8 @@ var models = {};
|
|
|
10215
10218
|
vcs_mode: t.string,
|
|
10216
10219
|
source: source.SourceMetadata,
|
|
10217
10220
|
auth_scope_id: t.string.optional(),
|
|
10218
|
-
features: t.array(t.Enum(models$1.ProjectFeatureFlags)).optional()
|
|
10221
|
+
features: t.array(t.Enum(models$1.ProjectFeatureFlags)).optional(),
|
|
10222
|
+
trial: t.boolean.optional()
|
|
10219
10223
|
});
|
|
10220
10224
|
exports.UpdateAppParams = t.object({
|
|
10221
10225
|
id: t.string,
|
|
@@ -10226,7 +10230,9 @@ var models = {};
|
|
|
10226
10230
|
});
|
|
10227
10231
|
exports.ListAppParams = exports.PaginationParams.and(codecs.FilterProperties(codecs.ResourceId.and(t.object({
|
|
10228
10232
|
name: t.string,
|
|
10229
|
-
org_id: t.string
|
|
10233
|
+
org_id: t.string,
|
|
10234
|
+
trial: t.boolean,
|
|
10235
|
+
locked: t.boolean
|
|
10230
10236
|
}))));
|
|
10231
10237
|
exports.ListAppsResponse = exports.ListResponseMetaData.and(t.object({
|
|
10232
10238
|
objects: t.array(models$1.AppResource)
|
|
@@ -10239,10 +10245,12 @@ var models = {};
|
|
|
10239
10245
|
exports.ListUserResponse = exports.ListResponseMetaData.and(t.object({
|
|
10240
10246
|
objects: t.array(models$1.UserResource)
|
|
10241
10247
|
}));
|
|
10242
|
-
exports.
|
|
10248
|
+
exports.StartSignupParams = t.object({
|
|
10243
10249
|
email: t.string,
|
|
10250
|
+
/**
|
|
10251
|
+
* When "start signup" is initiated for someone else (e.g. by an admin from override), this is the id of the creator.
|
|
10252
|
+
*/
|
|
10244
10253
|
user_id: t.string.optional(),
|
|
10245
|
-
trial_duration: t.number.optional(),
|
|
10246
10254
|
features: t.array(t.Enum(models$1.ProjectFeatureFlags)).optional()
|
|
10247
10255
|
});
|
|
10248
10256
|
exports.CreateDeveloperInviteParams = t.object({
|
|
@@ -10255,8 +10263,9 @@ var models = {};
|
|
|
10255
10263
|
})
|
|
10256
10264
|
.optional()
|
|
10257
10265
|
});
|
|
10258
|
-
exports.
|
|
10259
|
-
onboarding_token: t.string.optional()
|
|
10266
|
+
exports.GetSignupUserResponse = models$1.UserResource.and(t.object({
|
|
10267
|
+
onboarding_token: t.string.optional(),
|
|
10268
|
+
new_organization: t.boolean
|
|
10260
10269
|
}));
|
|
10261
10270
|
exports.UpdateInviteParams = t.object({
|
|
10262
10271
|
id: t.string,
|
|
@@ -10266,7 +10275,9 @@ var models = {};
|
|
|
10266
10275
|
id: t.string,
|
|
10267
10276
|
name: t.string,
|
|
10268
10277
|
phone_number: t.string.optional(),
|
|
10269
|
-
password: t.string
|
|
10278
|
+
password: t.string,
|
|
10279
|
+
send_welcome_email: t.boolean.optional(),
|
|
10280
|
+
org_name: t.string.optional()
|
|
10270
10281
|
});
|
|
10271
10282
|
exports.TokenResponse = t.object({
|
|
10272
10283
|
token: t.string
|
|
@@ -10340,6 +10351,14 @@ var models = {};
|
|
|
10340
10351
|
});
|
|
10341
10352
|
exports.SendMFASMSResponse = t.object({
|
|
10342
10353
|
sent: t.boolean
|
|
10354
|
+
});
|
|
10355
|
+
exports.UpdateOrgLocksParams = t.object({
|
|
10356
|
+
id: t.string,
|
|
10357
|
+
locked: t.boolean
|
|
10358
|
+
});
|
|
10359
|
+
exports.UpdateAppLocksParams = t.object({
|
|
10360
|
+
id: t.string,
|
|
10361
|
+
locked: t.boolean
|
|
10343
10362
|
});
|
|
10344
10363
|
} (api$2));
|
|
10345
10364
|
|
|
@@ -10352,11 +10371,10 @@ var ROUTES;
|
|
|
10352
10371
|
ROUTES["CREATE_ORG"] = "/api/accounts/v5/organizations/create";
|
|
10353
10372
|
ROUTES["UPDATE_ORG"] = "/api/accounts/v5/organizations/update";
|
|
10354
10373
|
ROUTES["UPDATE_ORG_BILLING"] = "/api/accounts/v5/organizations/update-billing";
|
|
10355
|
-
ROUTES["DOWNGRADE_ORG"] = "/api/accounts/v5/organizations/downgrade";
|
|
10356
|
-
ROUTES["UPGRADE_ORG"] = "/api/accounts/v5/organizations/upgrade";
|
|
10357
10374
|
ROUTES["GET_ORG"] = "/api/accounts/v5/organizations/get";
|
|
10358
10375
|
ROUTES["LIST_ORGS"] = "/api/accounts/v5/organizations/list";
|
|
10359
10376
|
ROUTES["SEARCH_ORGS"] = "/api/accounts/v5/organizations/search";
|
|
10377
|
+
ROUTES["UPDATE_ORG_LOCKS"] = "/api/accounts/v5/organizations/update-locks";
|
|
10360
10378
|
ROUTES["CREATE_USER"] = "/api/accounts/v5/users/create";
|
|
10361
10379
|
ROUTES["UPDATE_USER"] = "/api/accounts/v5/users/update";
|
|
10362
10380
|
ROUTES["DELETE_USER"] = "/api/accounts/v5/users/delete";
|
|
@@ -10364,10 +10382,10 @@ var ROUTES;
|
|
|
10364
10382
|
ROUTES["LIST_USERS"] = "/api/accounts/v5/users/list";
|
|
10365
10383
|
ROUTES["SEARCH_USERS"] = "/api/accounts/v5/users/search";
|
|
10366
10384
|
ROUTES["GIVE_USER_ACCESS"] = "/api/accounts/v5/organizations/give-user-access";
|
|
10367
|
-
ROUTES["
|
|
10368
|
-
ROUTES["
|
|
10369
|
-
ROUTES["COMPLETE_SIGNUP"] = "/api/accounts/v5/
|
|
10370
|
-
ROUTES["PROVISION_USER_TOKEN"] = "/api/accounts/v5/
|
|
10385
|
+
ROUTES["START_SIGNUP"] = "/api/accounts/v5/signup/start";
|
|
10386
|
+
ROUTES["GET_SIGNUP_USER"] = "/api/accounts/v5/signup/get-user";
|
|
10387
|
+
ROUTES["COMPLETE_SIGNUP"] = "/api/accounts/v5/signup/complete-signup";
|
|
10388
|
+
ROUTES["PROVISION_USER_TOKEN"] = "/api/accounts/v5/signup/provision-user-token";
|
|
10371
10389
|
ROUTES["CREATE_DEV_INVITE"] = "/api/accounts/v5/invites/create";
|
|
10372
10390
|
ROUTES["UPDATE_INVITE"] = "/api/accounts/v5/invites/update";
|
|
10373
10391
|
ROUTES["DESTROY_INVITE"] = "/api/accounts/v5/invites/destroy";
|
|
@@ -10375,6 +10393,10 @@ var ROUTES;
|
|
|
10375
10393
|
ROUTES["LIST_DEV_INVITES"] = "/api/accounts/v5/invites/list";
|
|
10376
10394
|
ROUTES["ACCEPT_INVITE"] = "/api/accounts/v5/invites/accept";
|
|
10377
10395
|
ROUTES["DECLINE_INVITE"] = "/api/accounts/v5/invites/decline";
|
|
10396
|
+
ROUTES["DOWNGRADE_APP_TO_TRIAL"] = "/api/accounts/v5/apps/downgrade-to-trial";
|
|
10397
|
+
ROUTES["UPGRADE_APP_FROM_TRIAL"] = "/api/accounts/v5/apps/upgrade-to-trial";
|
|
10398
|
+
ROUTES["UPDATE_APP_LOCKS"] = "/api/accounts/v5/apps/update-locks";
|
|
10399
|
+
ROUTES["EXTEND_TRIAL"] = "/api/accounts/v5/apps/extend-trial";
|
|
10378
10400
|
ROUTES["CREATE_APP"] = "/api/accounts/v5/apps/create";
|
|
10379
10401
|
ROUTES["UPDATE_APP"] = "/api/accounts/v5/apps/update";
|
|
10380
10402
|
ROUTES["DELETE_APP"] = "/api/accounts/v5/apps/delete";
|
|
@@ -10463,11 +10485,14 @@ const types_accounts_hub_1 = dist$4;
|
|
|
10463
10485
|
class AccountsV5Client extends sdk.SDKClient {
|
|
10464
10486
|
constructor() {
|
|
10465
10487
|
super(...arguments);
|
|
10466
|
-
this.
|
|
10467
|
-
path: types_accounts_hub_1.ROUTES.
|
|
10488
|
+
this.downgradeAppToTrial = this.createEndpoint({
|
|
10489
|
+
path: types_accounts_hub_1.ROUTES.DOWNGRADE_APP_TO_TRIAL
|
|
10490
|
+
});
|
|
10491
|
+
this.upgradeAppFromTrial = this.createEndpoint({
|
|
10492
|
+
path: types_accounts_hub_1.ROUTES.UPGRADE_APP_FROM_TRIAL
|
|
10468
10493
|
});
|
|
10469
|
-
this.
|
|
10470
|
-
path: types_accounts_hub_1.ROUTES.
|
|
10494
|
+
this.extendAppTrial = this.createEndpoint({
|
|
10495
|
+
path: types_accounts_hub_1.ROUTES.EXTEND_TRIAL
|
|
10471
10496
|
});
|
|
10472
10497
|
this.createUser = this.createEndpoint({
|
|
10473
10498
|
path: types_accounts_hub_1.ROUTES.CREATE_USER
|
|
@@ -10530,12 +10555,18 @@ class AccountsV5Client extends sdk.SDKClient {
|
|
|
10530
10555
|
this.updateUser = this.createEndpoint({
|
|
10531
10556
|
path: types_accounts_hub_1.ROUTES.UPDATE_USER
|
|
10532
10557
|
});
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10558
|
+
this.updateOrgLocks = this.createEndpoint({
|
|
10559
|
+
path: types_accounts_hub_1.ROUTES.UPDATE_ORG_LOCKS
|
|
10560
|
+
});
|
|
10561
|
+
this.updateAppLocks = this.createEndpoint({
|
|
10562
|
+
path: types_accounts_hub_1.ROUTES.UPDATE_APP_LOCKS
|
|
10536
10563
|
});
|
|
10537
|
-
|
|
10538
|
-
|
|
10564
|
+
// === SIGNUP ===
|
|
10565
|
+
this.startSignup = this.createEndpoint({
|
|
10566
|
+
path: types_accounts_hub_1.ROUTES.START_SIGNUP
|
|
10567
|
+
});
|
|
10568
|
+
this.getSignupUser = this.createEndpoint({
|
|
10569
|
+
path: types_accounts_hub_1.ROUTES.GET_SIGNUP_USER
|
|
10539
10570
|
});
|
|
10540
10571
|
this.completeSignup = this.createEndpoint({
|
|
10541
10572
|
path: types_accounts_hub_1.ROUTES.COMPLETE_SIGNUP
|
|
@@ -10659,7 +10690,7 @@ var distExports = requireDist();
|
|
|
10659
10690
|
var main$1 = {exports: {}};
|
|
10660
10691
|
|
|
10661
10692
|
var name$1 = "dotenv";
|
|
10662
|
-
var version$2 = "16.4.
|
|
10693
|
+
var version$2 = "16.4.5";
|
|
10663
10694
|
var description$1 = "Loads environment variables from .env file";
|
|
10664
10695
|
var main = "lib/main.js";
|
|
10665
10696
|
var types$1 = "lib/main.d.ts";
|
|
@@ -10956,52 +10987,48 @@ function configDotenv (options) {
|
|
|
10956
10987
|
}
|
|
10957
10988
|
}
|
|
10958
10989
|
|
|
10959
|
-
let
|
|
10990
|
+
let optionPaths = [dotenvPath]; // default, look for .env
|
|
10960
10991
|
if (options && options.path) {
|
|
10961
10992
|
if (!Array.isArray(options.path)) {
|
|
10962
|
-
|
|
10963
|
-
optionPathsThatExist = [_resolveHome(options.path)];
|
|
10964
|
-
}
|
|
10993
|
+
optionPaths = [_resolveHome(options.path)];
|
|
10965
10994
|
} else {
|
|
10995
|
+
optionPaths = []; // reset default
|
|
10966
10996
|
for (const filepath of options.path) {
|
|
10967
|
-
|
|
10968
|
-
optionPathsThatExist.push(_resolveHome(filepath));
|
|
10969
|
-
}
|
|
10997
|
+
optionPaths.push(_resolveHome(filepath));
|
|
10970
10998
|
}
|
|
10971
10999
|
}
|
|
10972
|
-
|
|
10973
|
-
if (!optionPathsThatExist.length) {
|
|
10974
|
-
optionPathsThatExist = [dotenvPath];
|
|
10975
|
-
}
|
|
10976
11000
|
}
|
|
10977
11001
|
|
|
10978
|
-
// If we have options.path, and it had valid paths, use them. Else fall back to .env
|
|
10979
|
-
const pathsToProcess = optionPathsThatExist.length ? optionPathsThatExist : [dotenvPath];
|
|
10980
|
-
|
|
10981
11002
|
// Build the parsed data in a temporary object (because we need to return it). Once we have the final
|
|
10982
11003
|
// parsed data, we will combine it with process.env (or options.processEnv if provided).
|
|
10983
|
-
|
|
10984
|
-
const
|
|
10985
|
-
|
|
10986
|
-
|
|
11004
|
+
let lastError;
|
|
11005
|
+
const parsedAll = {};
|
|
11006
|
+
for (const path of optionPaths) {
|
|
11007
|
+
try {
|
|
10987
11008
|
// Specifying an encoding returns a string instead of a buffer
|
|
10988
|
-
const
|
|
10989
|
-
DotenvModule.populate(parsed, singleFileParsed, options);
|
|
10990
|
-
}
|
|
11009
|
+
const parsed = DotenvModule.parse(fs.readFileSync(path, { encoding }));
|
|
10991
11010
|
|
|
10992
|
-
|
|
10993
|
-
|
|
10994
|
-
|
|
11011
|
+
DotenvModule.populate(parsedAll, parsed, options);
|
|
11012
|
+
} catch (e) {
|
|
11013
|
+
if (debug) {
|
|
11014
|
+
_debug(`Failed to load ${path} ${e.message}`);
|
|
11015
|
+
}
|
|
11016
|
+
lastError = e;
|
|
10995
11017
|
}
|
|
11018
|
+
}
|
|
10996
11019
|
|
|
10997
|
-
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
11002
|
-
|
|
11020
|
+
let processEnv = process.env;
|
|
11021
|
+
if (options && options.processEnv != null) {
|
|
11022
|
+
processEnv = options.processEnv;
|
|
11023
|
+
}
|
|
11024
|
+
|
|
11025
|
+
DotenvModule.populate(processEnv, parsedAll, options);
|
|
11026
|
+
|
|
11027
|
+
if (lastError) {
|
|
11028
|
+
return { parsed: parsedAll, error: lastError }
|
|
11029
|
+
} else {
|
|
11030
|
+
return { parsed: parsedAll }
|
|
11003
11031
|
}
|
|
11004
|
-
return { parsed }
|
|
11005
11032
|
}
|
|
11006
11033
|
|
|
11007
11034
|
// Populates process.env from .env file
|
|
@@ -11130,7 +11157,7 @@ var files = [
|
|
|
11130
11157
|
"/dist",
|
|
11131
11158
|
"/oclif.manifest.json"
|
|
11132
11159
|
];
|
|
11133
|
-
var version = "0.4.
|
|
11160
|
+
var version = "0.4.2";
|
|
11134
11161
|
var bugs = "https://github.com/powersync-ja/cli/issues";
|
|
11135
11162
|
var types = "dist/index.d.ts";
|
|
11136
11163
|
var exports = "./lib/index.js";
|
|
@@ -11175,44 +11202,44 @@ var scripts = {
|
|
|
11175
11202
|
"pack:tarballs": "oclif pack tarballs --parallel"
|
|
11176
11203
|
};
|
|
11177
11204
|
var dependencies = {
|
|
11178
|
-
"@oclif/core": "^3.
|
|
11179
|
-
"@oclif/plugin-help": "^6.
|
|
11180
|
-
"@oclif/plugin-not-found": "^3.
|
|
11181
|
-
"@oclif/plugin-warn-if-update-available": "^3.
|
|
11205
|
+
"@oclif/core": "^3.27.0",
|
|
11206
|
+
"@oclif/plugin-help": "^6.2.8",
|
|
11207
|
+
"@oclif/plugin-not-found": "^3.1.4",
|
|
11208
|
+
"@oclif/plugin-warn-if-update-available": "^3.1.11",
|
|
11182
11209
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
11183
|
-
dotenv: "^16.4.
|
|
11184
|
-
inquirer: "^9.
|
|
11210
|
+
dotenv: "^16.4.5",
|
|
11211
|
+
inquirer: "^9.3.6",
|
|
11185
11212
|
ora: "^8.0.1"
|
|
11186
11213
|
};
|
|
11187
11214
|
var devDependencies = {
|
|
11188
|
-
"@changesets/cli": "^2.27.
|
|
11189
|
-
"@journeyapps-platform/
|
|
11190
|
-
"@journeyapps-platform/powersync-types": "^0.16.7",
|
|
11191
|
-
"@journeyapps-platform/sdk-accounts-hub": "^5.1.0",
|
|
11215
|
+
"@changesets/cli": "^2.27.7",
|
|
11216
|
+
"@journeyapps-platform/sdk-accounts-hub": "^7.0.0",
|
|
11192
11217
|
"@journeyapps-platform/sdk-common": "^5.5.0",
|
|
11193
|
-
"@journeyapps-platform/sdk-powersync": "^0.
|
|
11194
|
-
"@journeyapps-platform/types-accounts-hub": "^
|
|
11195
|
-
"@
|
|
11218
|
+
"@journeyapps-platform/sdk-powersync": "^0.22.1",
|
|
11219
|
+
"@journeyapps-platform/types-accounts-hub": "^7.0.0",
|
|
11220
|
+
"@journeyapps-platform/powersync-types": "^0.22.0",
|
|
11221
|
+
"@powersync/service-sync-rules": "^0.18.2",
|
|
11222
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
|
11196
11223
|
"@rollup/plugin-json": "^6.1.0",
|
|
11197
11224
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
11198
11225
|
"@types/inquirer": "^9.0.7",
|
|
11199
|
-
"@types/node": "^20.
|
|
11200
|
-
esbuild: "^0.
|
|
11201
|
-
eslint: "^8.
|
|
11226
|
+
"@types/node": "^20.16.1",
|
|
11227
|
+
esbuild: "^0.23.1",
|
|
11228
|
+
eslint: "^8.57.0",
|
|
11202
11229
|
"eslint-config-oclif": "^5",
|
|
11203
|
-
"eslint-config-oclif-typescript": "^3.
|
|
11230
|
+
"eslint-config-oclif-typescript": "^3.1.9",
|
|
11204
11231
|
"eslint-config-prettier": "^9.1.0",
|
|
11205
|
-
"eslint-plugin-prettier": "^5.1
|
|
11206
|
-
glob: "^
|
|
11207
|
-
oclif: "^4.
|
|
11208
|
-
prettier: "^3.
|
|
11209
|
-
rollup: "^4.
|
|
11232
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
11233
|
+
glob: "^11.0.0",
|
|
11234
|
+
oclif: "^4.14.22",
|
|
11235
|
+
prettier: "^3.3.3",
|
|
11236
|
+
rollup: "^4.21.0",
|
|
11210
11237
|
"rollup-plugin-esbuild": "^6.1.1",
|
|
11211
11238
|
shx: "^0.3.4",
|
|
11212
11239
|
"strip-ansi": "^7.1.0",
|
|
11213
11240
|
"ts-node": "^10.9.2",
|
|
11214
|
-
typescript: "^5.
|
|
11215
|
-
vitest: "^
|
|
11241
|
+
typescript: "^5.5.4",
|
|
11242
|
+
vitest: "^2.0.5"
|
|
11216
11243
|
};
|
|
11217
11244
|
var packageJSON = {
|
|
11218
11245
|
author: author,
|