powersync 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -29
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +7 -0
- package/dist/commands/instance/create.d.ts +3 -0
- package/dist/commands/instance/create.js +52 -97
- package/dist/commands/instance/deploy.d.ts +3 -1
- package/dist/commands/instance/deploy.js +30 -80
- package/dist/commands/instance/generate-dev-token.d.ts +10 -0
- package/dist/commands/instance/generate-dev-token.js +54 -0
- 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/commands.utils.d.ts +2 -0
- package/dist/commands.utils.js +86 -0
- package/dist/service/accounts.client.js +78 -54
- package/dist/service/powersync.client.js +8378 -2105
- package/dist/service/utils.js +24 -23
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +13 -0
- package/oclif.manifest.json +102 -7
- package/package.json +24 -23
package/dist/service/utils.js
CHANGED
|
@@ -18,7 +18,7 @@ var files = [
|
|
|
18
18
|
"/dist",
|
|
19
19
|
"/oclif.manifest.json"
|
|
20
20
|
];
|
|
21
|
-
var version = "0.
|
|
21
|
+
var version = "0.5.0";
|
|
22
22
|
var bugs = "https://github.com/powersync-ja/cli/issues";
|
|
23
23
|
var types = "dist/index.d.ts";
|
|
24
24
|
var exports = "./lib/index.js";
|
|
@@ -58,49 +58,50 @@ var scripts = {
|
|
|
58
58
|
prepare: "pnpm run build",
|
|
59
59
|
test: "vitest",
|
|
60
60
|
release: "pnpm build && pnpm changeset publish",
|
|
61
|
-
prettier: "prettier --write
|
|
61
|
+
prettier: "prettier --write \"**/*.ts\"",
|
|
62
62
|
version: "pnpm run readme && git add README.md",
|
|
63
63
|
"pack:tarballs": "oclif pack tarballs --parallel"
|
|
64
64
|
};
|
|
65
65
|
var dependencies = {
|
|
66
|
-
"@oclif/core": "^3.
|
|
67
|
-
"@oclif/plugin-help": "^6.
|
|
66
|
+
"@oclif/core": "^3.27.0",
|
|
67
|
+
"@oclif/plugin-help": "^6.2.8",
|
|
68
68
|
"@oclif/plugin-not-found": "^3.1.4",
|
|
69
|
-
"@oclif/plugin-warn-if-update-available": "^3.
|
|
69
|
+
"@oclif/plugin-warn-if-update-available": "^3.1.11",
|
|
70
70
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
71
|
+
clipboardy: "^4.0.0",
|
|
71
72
|
dotenv: "^16.4.5",
|
|
72
|
-
inquirer: "^9.
|
|
73
|
+
inquirer: "^9.3.6",
|
|
73
74
|
ora: "^8.0.1"
|
|
74
75
|
};
|
|
75
76
|
var devDependencies = {
|
|
76
|
-
"@changesets/cli": "^2.27.
|
|
77
|
-
"@journeyapps-platform/powersync-
|
|
78
|
-
"@journeyapps-platform/
|
|
79
|
-
"@journeyapps-platform/sdk-accounts-hub": "^6.0.0",
|
|
77
|
+
"@changesets/cli": "^2.27.7",
|
|
78
|
+
"@journeyapps-platform/powersync-types": "^0.22.0",
|
|
79
|
+
"@journeyapps-platform/sdk-accounts-hub": "^7.0.1",
|
|
80
80
|
"@journeyapps-platform/sdk-common": "^5.5.0",
|
|
81
|
-
"@journeyapps-platform/sdk-powersync": "^0.
|
|
82
|
-
"@journeyapps-platform/types-accounts-hub": "^
|
|
83
|
-
"@
|
|
81
|
+
"@journeyapps-platform/sdk-powersync": "^0.22.1",
|
|
82
|
+
"@journeyapps-platform/types-accounts-hub": "^7.0.1",
|
|
83
|
+
"@powersync/service-sync-rules": "^0.18.2",
|
|
84
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
|
84
85
|
"@rollup/plugin-json": "^6.1.0",
|
|
85
86
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
86
87
|
"@types/inquirer": "^9.0.7",
|
|
87
|
-
"@types/node": "^20.
|
|
88
|
-
esbuild: "^0.
|
|
88
|
+
"@types/node": "^20.16.1",
|
|
89
|
+
esbuild: "^0.23.1",
|
|
89
90
|
eslint: "^8.57.0",
|
|
90
91
|
"eslint-config-oclif": "^5",
|
|
91
|
-
"eslint-config-oclif-typescript": "^3.1.
|
|
92
|
+
"eslint-config-oclif-typescript": "^3.1.9",
|
|
92
93
|
"eslint-config-prettier": "^9.1.0",
|
|
93
|
-
"eslint-plugin-prettier": "^5.1
|
|
94
|
-
glob: "^
|
|
95
|
-
oclif: "^4.
|
|
96
|
-
prettier: "^3.
|
|
97
|
-
rollup: "^4.
|
|
94
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
95
|
+
glob: "^11.0.0",
|
|
96
|
+
oclif: "^4.14.29",
|
|
97
|
+
prettier: "^3.3.3",
|
|
98
|
+
rollup: "^4.21.2",
|
|
98
99
|
"rollup-plugin-esbuild": "^6.1.1",
|
|
99
100
|
shx: "^0.3.4",
|
|
100
101
|
"strip-ansi": "^7.1.0",
|
|
101
102
|
"ts-node": "^10.9.2",
|
|
102
|
-
typescript: "^5.4
|
|
103
|
-
vitest: "^
|
|
103
|
+
typescript: "^5.5.4",
|
|
104
|
+
vitest: "^2.0.5"
|
|
104
105
|
};
|
|
105
106
|
var packageJSON = {
|
|
106
107
|
author: author,
|
package/dist/utils.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export declare const bold: (text: string) => string;
|
|
|
4
4
|
export declare const green: (text: string) => string;
|
|
5
5
|
export declare const yellow: (text: string) => string;
|
|
6
6
|
export declare const red: (text: string) => string;
|
|
7
|
+
export declare const convertSeconds: (seconds: number) => string;
|
package/dist/utils.js
CHANGED
|
@@ -49,3 +49,16 @@ export const bold = (text) => ux.colorize('bold', text);
|
|
|
49
49
|
export const green = (text) => ux.colorize('green', text);
|
|
50
50
|
export const yellow = (text) => ux.colorize('yellow', text);
|
|
51
51
|
export const red = (text) => ux.colorize('red', text);
|
|
52
|
+
const formatUnit = (value, unit) => `${value} ${unit}${value === 1 ? '' : 's'}`;
|
|
53
|
+
export const convertSeconds = (seconds) => {
|
|
54
|
+
if (seconds < 60)
|
|
55
|
+
return formatUnit(seconds, 'second');
|
|
56
|
+
const minutes = Math.floor(seconds / 60);
|
|
57
|
+
if (minutes < 60)
|
|
58
|
+
return formatUnit(minutes, 'minute');
|
|
59
|
+
const hours = Math.floor(minutes / 60);
|
|
60
|
+
const remainingMinutes = minutes % 60;
|
|
61
|
+
if (remainingMinutes === 0)
|
|
62
|
+
return formatUnit(hours, 'hour');
|
|
63
|
+
return `${formatUnit(hours, 'hour')} ${formatUnit(remainingMinutes, 'minute')}`;
|
|
64
|
+
};
|
package/oclif.manifest.json
CHANGED
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
],
|
|
80
80
|
"flags": {
|
|
81
81
|
"databaseName": {
|
|
82
|
+
"char": "n",
|
|
82
83
|
"description": "Name of the database.",
|
|
83
84
|
"name": "databaseName",
|
|
84
85
|
"hasDynamicHelp": false,
|
|
@@ -86,6 +87,7 @@
|
|
|
86
87
|
"type": "option"
|
|
87
88
|
},
|
|
88
89
|
"databasePassword": {
|
|
90
|
+
"char": "p",
|
|
89
91
|
"description": "Password of the database.",
|
|
90
92
|
"hidden": true,
|
|
91
93
|
"name": "databasePassword",
|
|
@@ -94,6 +96,7 @@
|
|
|
94
96
|
"type": "option"
|
|
95
97
|
},
|
|
96
98
|
"databaseUsername": {
|
|
99
|
+
"char": "u",
|
|
97
100
|
"description": "Username of the database.",
|
|
98
101
|
"hidden": true,
|
|
99
102
|
"name": "databaseUsername",
|
|
@@ -102,13 +105,32 @@
|
|
|
102
105
|
"type": "option"
|
|
103
106
|
},
|
|
104
107
|
"hostname": {
|
|
108
|
+
"char": "h",
|
|
105
109
|
"description": "Hostname to connect to database.",
|
|
106
110
|
"name": "hostname",
|
|
107
111
|
"hasDynamicHelp": false,
|
|
108
112
|
"multiple": false,
|
|
109
113
|
"type": "option"
|
|
110
114
|
},
|
|
115
|
+
"jwksAudiences": {
|
|
116
|
+
"char": "a",
|
|
117
|
+
"description": "JWKS audiences (comma separated).",
|
|
118
|
+
"name": "jwksAudiences",
|
|
119
|
+
"default": "",
|
|
120
|
+
"hasDynamicHelp": false,
|
|
121
|
+
"multiple": false,
|
|
122
|
+
"type": "option"
|
|
123
|
+
},
|
|
124
|
+
"jwksUri": {
|
|
125
|
+
"char": "w",
|
|
126
|
+
"description": "JWKS URL (must include https://).",
|
|
127
|
+
"name": "jwksUri",
|
|
128
|
+
"hasDynamicHelp": false,
|
|
129
|
+
"multiple": false,
|
|
130
|
+
"type": "option"
|
|
131
|
+
},
|
|
111
132
|
"name": {
|
|
133
|
+
"char": "i",
|
|
112
134
|
"description": "Name of the instance.",
|
|
113
135
|
"name": "name",
|
|
114
136
|
"hasDynamicHelp": false,
|
|
@@ -116,6 +138,7 @@
|
|
|
116
138
|
"type": "option"
|
|
117
139
|
},
|
|
118
140
|
"port": {
|
|
141
|
+
"char": "o",
|
|
119
142
|
"description": "Port number to connect to database.",
|
|
120
143
|
"name": "port",
|
|
121
144
|
"hasDynamicHelp": false,
|
|
@@ -123,16 +146,25 @@
|
|
|
123
146
|
"type": "option"
|
|
124
147
|
},
|
|
125
148
|
"region": {
|
|
149
|
+
"char": "r",
|
|
126
150
|
"description": "Region to deploy instance to.",
|
|
127
151
|
"name": "region",
|
|
128
152
|
"hasDynamicHelp": false,
|
|
129
153
|
"multiple": false,
|
|
130
154
|
"type": "option"
|
|
131
155
|
},
|
|
156
|
+
"skipInteraction": {
|
|
157
|
+
"char": "s",
|
|
158
|
+
"description": "Skip interactivity.",
|
|
159
|
+
"name": "skipInteraction",
|
|
160
|
+
"allowNo": false,
|
|
161
|
+
"type": "boolean"
|
|
162
|
+
},
|
|
132
163
|
"useSupabaseAuth": {
|
|
133
|
-
"
|
|
164
|
+
"char": "a",
|
|
165
|
+
"description": "Use Supabase auth.",
|
|
134
166
|
"name": "useSupabaseAuth",
|
|
135
|
-
"allowNo":
|
|
167
|
+
"allowNo": true,
|
|
136
168
|
"type": "boolean"
|
|
137
169
|
}
|
|
138
170
|
},
|
|
@@ -161,6 +193,7 @@
|
|
|
161
193
|
],
|
|
162
194
|
"flags": {
|
|
163
195
|
"databaseName": {
|
|
196
|
+
"char": "n",
|
|
164
197
|
"description": "Name of the database.",
|
|
165
198
|
"name": "databaseName",
|
|
166
199
|
"hasDynamicHelp": false,
|
|
@@ -168,6 +201,7 @@
|
|
|
168
201
|
"type": "option"
|
|
169
202
|
},
|
|
170
203
|
"databasePassword": {
|
|
204
|
+
"char": "p",
|
|
171
205
|
"description": "Password of the database.",
|
|
172
206
|
"hidden": true,
|
|
173
207
|
"name": "databasePassword",
|
|
@@ -176,6 +210,7 @@
|
|
|
176
210
|
"type": "option"
|
|
177
211
|
},
|
|
178
212
|
"databaseUsername": {
|
|
213
|
+
"char": "u",
|
|
179
214
|
"description": "Username of the database.",
|
|
180
215
|
"hidden": true,
|
|
181
216
|
"name": "databaseUsername",
|
|
@@ -184,30 +219,49 @@
|
|
|
184
219
|
"type": "option"
|
|
185
220
|
},
|
|
186
221
|
"hostname": {
|
|
222
|
+
"char": "h",
|
|
187
223
|
"description": "Hostname to connect to database.",
|
|
188
224
|
"name": "hostname",
|
|
189
225
|
"hasDynamicHelp": false,
|
|
190
226
|
"multiple": false,
|
|
191
227
|
"type": "option"
|
|
192
228
|
},
|
|
193
|
-
"
|
|
194
|
-
"
|
|
195
|
-
"
|
|
229
|
+
"jwksAudiences": {
|
|
230
|
+
"char": "a",
|
|
231
|
+
"description": "JWKS audiences (comma separated).",
|
|
232
|
+
"name": "jwksAudiences",
|
|
233
|
+
"hasDynamicHelp": false,
|
|
234
|
+
"multiple": false,
|
|
235
|
+
"type": "option"
|
|
236
|
+
},
|
|
237
|
+
"jwksUri": {
|
|
238
|
+
"char": "w",
|
|
239
|
+
"description": "JWKS URL (must include https://).",
|
|
240
|
+
"name": "jwksUri",
|
|
196
241
|
"hasDynamicHelp": false,
|
|
197
242
|
"multiple": false,
|
|
198
243
|
"type": "option"
|
|
199
244
|
},
|
|
200
245
|
"port": {
|
|
246
|
+
"char": "o",
|
|
201
247
|
"description": "Port number to connect to database.",
|
|
202
248
|
"name": "port",
|
|
203
249
|
"hasDynamicHelp": false,
|
|
204
250
|
"multiple": false,
|
|
205
251
|
"type": "option"
|
|
206
252
|
},
|
|
253
|
+
"skipInteraction": {
|
|
254
|
+
"char": "s",
|
|
255
|
+
"description": "Skip interactivity.",
|
|
256
|
+
"name": "skipInteraction",
|
|
257
|
+
"allowNo": false,
|
|
258
|
+
"type": "boolean"
|
|
259
|
+
},
|
|
207
260
|
"useSupabaseAuth": {
|
|
261
|
+
"char": "a",
|
|
208
262
|
"description": "Use Supabase auth.",
|
|
209
263
|
"name": "useSupabaseAuth",
|
|
210
|
-
"allowNo":
|
|
264
|
+
"allowNo": true,
|
|
211
265
|
"type": "boolean"
|
|
212
266
|
}
|
|
213
267
|
},
|
|
@@ -259,6 +313,47 @@
|
|
|
259
313
|
"destroy.js"
|
|
260
314
|
]
|
|
261
315
|
},
|
|
316
|
+
"instance:generate-dev-token": {
|
|
317
|
+
"aliases": [],
|
|
318
|
+
"args": {},
|
|
319
|
+
"description": "Generate a developer token using the Token subject/ User ID.",
|
|
320
|
+
"examples": [
|
|
321
|
+
"<%= config.bin %> <%= command.id %>"
|
|
322
|
+
],
|
|
323
|
+
"flags": {
|
|
324
|
+
"expiresInSeconds": {
|
|
325
|
+
"char": "e",
|
|
326
|
+
"description": "The token expiry in seconds.",
|
|
327
|
+
"name": "expiresInSeconds",
|
|
328
|
+
"hasDynamicHelp": false,
|
|
329
|
+
"multiple": false,
|
|
330
|
+
"type": "option"
|
|
331
|
+
},
|
|
332
|
+
"userId": {
|
|
333
|
+
"char": "u",
|
|
334
|
+
"description": "The Token subject/User ID for the developer token",
|
|
335
|
+
"name": "userId",
|
|
336
|
+
"hasDynamicHelp": false,
|
|
337
|
+
"multiple": false,
|
|
338
|
+
"type": "option"
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"hasDynamicHelp": false,
|
|
342
|
+
"hiddenAliases": [],
|
|
343
|
+
"id": "instance:generate-dev-token",
|
|
344
|
+
"pluginAlias": "powersync",
|
|
345
|
+
"pluginName": "powersync",
|
|
346
|
+
"pluginType": "core",
|
|
347
|
+
"strict": true,
|
|
348
|
+
"enableJsonFlag": false,
|
|
349
|
+
"isESM": true,
|
|
350
|
+
"relativePath": [
|
|
351
|
+
"dist",
|
|
352
|
+
"commands",
|
|
353
|
+
"instance",
|
|
354
|
+
"generate-dev-token.js"
|
|
355
|
+
]
|
|
356
|
+
},
|
|
262
357
|
"instance:schema": {
|
|
263
358
|
"aliases": [],
|
|
264
359
|
"args": {},
|
|
@@ -538,5 +633,5 @@
|
|
|
538
633
|
]
|
|
539
634
|
}
|
|
540
635
|
},
|
|
541
|
-
"version": "0.
|
|
636
|
+
"version": "0.5.0"
|
|
542
637
|
}
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"/dist",
|
|
17
17
|
"/oclif.manifest.json"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.
|
|
19
|
+
"version": "0.5.0",
|
|
20
20
|
"bugs": "https://github.com/powersync-ja/cli/issues",
|
|
21
21
|
"types": "dist/index.d.ts",
|
|
22
22
|
"exports": "./lib/index.js",
|
|
@@ -45,44 +45,45 @@
|
|
|
45
45
|
},
|
|
46
46
|
"repository": "powersync-ja/cli",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@oclif/core": "^3.
|
|
49
|
-
"@oclif/plugin-help": "^6.
|
|
48
|
+
"@oclif/core": "^3.27.0",
|
|
49
|
+
"@oclif/plugin-help": "^6.2.8",
|
|
50
50
|
"@oclif/plugin-not-found": "^3.1.4",
|
|
51
|
-
"@oclif/plugin-warn-if-update-available": "^3.
|
|
51
|
+
"@oclif/plugin-warn-if-update-available": "^3.1.11",
|
|
52
52
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
53
|
+
"clipboardy": "^4.0.0",
|
|
53
54
|
"dotenv": "^16.4.5",
|
|
54
|
-
"inquirer": "^9.
|
|
55
|
+
"inquirer": "^9.3.6",
|
|
55
56
|
"ora": "^8.0.1"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
|
-
"@changesets/cli": "^2.27.
|
|
59
|
-
"@journeyapps-platform/powersync-
|
|
60
|
-
"@journeyapps-platform/
|
|
61
|
-
"@journeyapps-platform/sdk-accounts-hub": "^6.0.0",
|
|
59
|
+
"@changesets/cli": "^2.27.7",
|
|
60
|
+
"@journeyapps-platform/powersync-types": "^0.22.0",
|
|
61
|
+
"@journeyapps-platform/sdk-accounts-hub": "^7.0.1",
|
|
62
62
|
"@journeyapps-platform/sdk-common": "^5.5.0",
|
|
63
|
-
"@journeyapps-platform/sdk-powersync": "^0.
|
|
64
|
-
"@journeyapps-platform/types-accounts-hub": "^
|
|
65
|
-
"@
|
|
63
|
+
"@journeyapps-platform/sdk-powersync": "^0.22.1",
|
|
64
|
+
"@journeyapps-platform/types-accounts-hub": "^7.0.1",
|
|
65
|
+
"@powersync/service-sync-rules": "^0.18.2",
|
|
66
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
|
66
67
|
"@rollup/plugin-json": "^6.1.0",
|
|
67
68
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
68
69
|
"@types/inquirer": "^9.0.7",
|
|
69
|
-
"@types/node": "^20.
|
|
70
|
-
"esbuild": "^0.
|
|
70
|
+
"@types/node": "^20.16.1",
|
|
71
|
+
"esbuild": "^0.23.1",
|
|
71
72
|
"eslint": "^8.57.0",
|
|
72
73
|
"eslint-config-oclif": "^5",
|
|
73
|
-
"eslint-config-oclif-typescript": "^3.1.
|
|
74
|
+
"eslint-config-oclif-typescript": "^3.1.9",
|
|
74
75
|
"eslint-config-prettier": "^9.1.0",
|
|
75
|
-
"eslint-plugin-prettier": "^5.1
|
|
76
|
-
"glob": "^
|
|
77
|
-
"oclif": "^4.
|
|
78
|
-
"prettier": "^3.
|
|
79
|
-
"rollup": "^4.
|
|
76
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
77
|
+
"glob": "^11.0.0",
|
|
78
|
+
"oclif": "^4.14.29",
|
|
79
|
+
"prettier": "^3.3.3",
|
|
80
|
+
"rollup": "^4.21.2",
|
|
80
81
|
"rollup-plugin-esbuild": "^6.1.1",
|
|
81
82
|
"shx": "^0.3.4",
|
|
82
83
|
"strip-ansi": "^7.1.0",
|
|
83
84
|
"ts-node": "^10.9.2",
|
|
84
|
-
"typescript": "^5.4
|
|
85
|
-
"vitest": "^
|
|
85
|
+
"typescript": "^5.5.4",
|
|
86
|
+
"vitest": "^2.0.5"
|
|
86
87
|
},
|
|
87
88
|
"scripts": {
|
|
88
89
|
"build": "pnpm build:oclif-commands && pnpm bundle:powersync-deps && ./combine-bundle-and-build.sh && pnpm readme",
|
|
@@ -93,7 +94,7 @@
|
|
|
93
94
|
"readme": "oclif readme && ./update-readme.sh",
|
|
94
95
|
"test": "vitest",
|
|
95
96
|
"release": "pnpm build && pnpm changeset publish",
|
|
96
|
-
"prettier": "prettier --write
|
|
97
|
+
"prettier": "prettier --write \"**/*.ts\"",
|
|
97
98
|
"version": "pnpm run readme && git add README.md",
|
|
98
99
|
"pack:tarballs": "oclif pack tarballs --parallel"
|
|
99
100
|
}
|