powersync 0.1.2 → 0.2.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 +69 -65
- package/dist/commands/init.js +20 -13
- package/dist/commands/instance/config.js +1 -1
- package/dist/commands/instance/create.js +30 -27
- package/dist/commands/instance/deploy.js +8 -8
- package/dist/commands/instance/destroy.js +13 -9
- package/dist/commands/instance/schema.js +1 -1
- package/dist/commands/instance/set.js +2 -2
- package/dist/commands/instance/status.d.ts +6 -0
- package/dist/commands/instance/status.js +23 -6
- package/dist/commands/instance/stop.js +3 -3
- package/dist/commands/instance/sync-rules/deploy.js +3 -3
- package/dist/commands/instance/sync-rules/generate-schema.js +4 -4
- package/dist/commands/instance/sync-rules/validate.js +2 -2
- package/dist/commands/instances.js +12 -3
- package/dist/service/accounts.client.js +10 -1
- package/dist/service/powersync.client.js +138 -71
- package/dist/service/utils.js +13 -1
- package/dist/utils.js +10 -4
- package/oclif.manifest.json +76 -44
- package/package.json +12 -2
package/oclif.manifest.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"init": {
|
|
4
4
|
"aliases": [],
|
|
5
5
|
"args": {},
|
|
6
|
-
"description": "Initialize the CLI",
|
|
6
|
+
"description": "Initialize the CLI.",
|
|
7
7
|
"examples": [
|
|
8
8
|
"<%= config.bin %> <%= command.id %>"
|
|
9
9
|
],
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"instances": {
|
|
27
27
|
"aliases": [],
|
|
28
28
|
"args": {},
|
|
29
|
-
"description": "
|
|
29
|
+
"description": "View list of instances.",
|
|
30
30
|
"examples": [
|
|
31
31
|
"<%= config.bin %> <%= command.id %>"
|
|
32
32
|
],
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"instance:config": {
|
|
50
50
|
"aliases": [],
|
|
51
51
|
"args": {},
|
|
52
|
-
"description": "
|
|
52
|
+
"description": "Display the instance config.",
|
|
53
53
|
"examples": [
|
|
54
54
|
"<%= config.bin %> <%= command.id %>"
|
|
55
55
|
],
|
|
@@ -73,20 +73,20 @@
|
|
|
73
73
|
"instance:create": {
|
|
74
74
|
"aliases": [],
|
|
75
75
|
"args": {},
|
|
76
|
-
"description": "
|
|
76
|
+
"description": "Create a new instance.",
|
|
77
77
|
"examples": [
|
|
78
78
|
"<%= config.bin %> <%= command.id %>"
|
|
79
79
|
],
|
|
80
80
|
"flags": {
|
|
81
81
|
"databaseName": {
|
|
82
|
-
"description": "Name of the
|
|
82
|
+
"description": "Name of the database.",
|
|
83
83
|
"name": "databaseName",
|
|
84
84
|
"hasDynamicHelp": false,
|
|
85
85
|
"multiple": false,
|
|
86
86
|
"type": "option"
|
|
87
87
|
},
|
|
88
88
|
"databasePassword": {
|
|
89
|
-
"description": "Password of the
|
|
89
|
+
"description": "Password of the database.",
|
|
90
90
|
"hidden": true,
|
|
91
91
|
"name": "databasePassword",
|
|
92
92
|
"hasDynamicHelp": false,
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"type": "option"
|
|
95
95
|
},
|
|
96
96
|
"databaseUsername": {
|
|
97
|
-
"description": "Username of the
|
|
97
|
+
"description": "Username of the database.",
|
|
98
98
|
"hidden": true,
|
|
99
99
|
"name": "databaseUsername",
|
|
100
100
|
"hasDynamicHelp": false,
|
|
@@ -102,28 +102,28 @@
|
|
|
102
102
|
"type": "option"
|
|
103
103
|
},
|
|
104
104
|
"hostname": {
|
|
105
|
-
"description": "Hostname to connect to
|
|
105
|
+
"description": "Hostname to connect to database.",
|
|
106
106
|
"name": "hostname",
|
|
107
107
|
"hasDynamicHelp": false,
|
|
108
108
|
"multiple": false,
|
|
109
109
|
"type": "option"
|
|
110
110
|
},
|
|
111
111
|
"name": {
|
|
112
|
-
"description": "Name of the instance",
|
|
112
|
+
"description": "Name of the instance.",
|
|
113
113
|
"name": "name",
|
|
114
114
|
"hasDynamicHelp": false,
|
|
115
115
|
"multiple": false,
|
|
116
116
|
"type": "option"
|
|
117
117
|
},
|
|
118
118
|
"port": {
|
|
119
|
-
"description": "Port number to connect to
|
|
119
|
+
"description": "Port number to connect to database.",
|
|
120
120
|
"name": "port",
|
|
121
121
|
"hasDynamicHelp": false,
|
|
122
122
|
"multiple": false,
|
|
123
123
|
"type": "option"
|
|
124
124
|
},
|
|
125
125
|
"region": {
|
|
126
|
-
"description": "Region to deploy instance to",
|
|
126
|
+
"description": "Region to deploy instance to.",
|
|
127
127
|
"name": "region",
|
|
128
128
|
"hasDynamicHelp": false,
|
|
129
129
|
"multiple": false,
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
"type": "option"
|
|
135
135
|
},
|
|
136
136
|
"useSupabaseAuth": {
|
|
137
|
-
"description": "Use Supabase for auth",
|
|
137
|
+
"description": "Use Supabase for auth.",
|
|
138
138
|
"name": "useSupabaseAuth",
|
|
139
139
|
"allowNo": false,
|
|
140
140
|
"type": "boolean"
|
|
@@ -159,20 +159,20 @@
|
|
|
159
159
|
"instance:deploy": {
|
|
160
160
|
"aliases": [],
|
|
161
161
|
"args": {},
|
|
162
|
-
"description": "
|
|
162
|
+
"description": "Deploy changes to an existing instance.",
|
|
163
163
|
"examples": [
|
|
164
164
|
"<%= config.bin %> <%= command.id %>"
|
|
165
165
|
],
|
|
166
166
|
"flags": {
|
|
167
167
|
"databaseName": {
|
|
168
|
-
"description": "Name of the
|
|
168
|
+
"description": "Name of the database.",
|
|
169
169
|
"name": "databaseName",
|
|
170
170
|
"hasDynamicHelp": false,
|
|
171
171
|
"multiple": false,
|
|
172
172
|
"type": "option"
|
|
173
173
|
},
|
|
174
174
|
"databasePassword": {
|
|
175
|
-
"description": "Password of the
|
|
175
|
+
"description": "Password of the database.",
|
|
176
176
|
"hidden": true,
|
|
177
177
|
"name": "databasePassword",
|
|
178
178
|
"hasDynamicHelp": false,
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
"type": "option"
|
|
181
181
|
},
|
|
182
182
|
"databaseUsername": {
|
|
183
|
-
"description": "Username of the
|
|
183
|
+
"description": "Username of the database.",
|
|
184
184
|
"hidden": true,
|
|
185
185
|
"name": "databaseUsername",
|
|
186
186
|
"hasDynamicHelp": false,
|
|
@@ -188,28 +188,28 @@
|
|
|
188
188
|
"type": "option"
|
|
189
189
|
},
|
|
190
190
|
"hostname": {
|
|
191
|
-
"description": "Hostname to connect to
|
|
191
|
+
"description": "Hostname to connect to database.",
|
|
192
192
|
"name": "hostname",
|
|
193
193
|
"hasDynamicHelp": false,
|
|
194
194
|
"multiple": false,
|
|
195
195
|
"type": "option"
|
|
196
196
|
},
|
|
197
197
|
"name": {
|
|
198
|
-
"description": "Name of the instance",
|
|
198
|
+
"description": "Name of the instance.",
|
|
199
199
|
"name": "name",
|
|
200
200
|
"hasDynamicHelp": false,
|
|
201
201
|
"multiple": false,
|
|
202
202
|
"type": "option"
|
|
203
203
|
},
|
|
204
204
|
"port": {
|
|
205
|
-
"description": "Port number to connect to
|
|
205
|
+
"description": "Port number to connect to database.",
|
|
206
206
|
"name": "port",
|
|
207
207
|
"hasDynamicHelp": false,
|
|
208
208
|
"multiple": false,
|
|
209
209
|
"type": "option"
|
|
210
210
|
},
|
|
211
211
|
"useSupabaseAuth": {
|
|
212
|
-
"description": "Use Supabase auth",
|
|
212
|
+
"description": "Use Supabase auth.",
|
|
213
213
|
"name": "useSupabaseAuth",
|
|
214
214
|
"allowNo": false,
|
|
215
215
|
"type": "boolean"
|
|
@@ -234,15 +234,14 @@
|
|
|
234
234
|
"instance:destroy": {
|
|
235
235
|
"aliases": [],
|
|
236
236
|
"args": {},
|
|
237
|
-
"description": "
|
|
237
|
+
"description": "Destroy the current instance - THIS CANNOT BE UNDONE.",
|
|
238
238
|
"examples": [
|
|
239
|
-
"<%= config.bin %> <%= command.id %>"
|
|
240
|
-
"<%= config.bin %> <%= command.id %> --instanceId=1234"
|
|
239
|
+
"<%= config.bin %> <%= command.id %>"
|
|
241
240
|
],
|
|
242
241
|
"flags": {
|
|
243
242
|
"skipConfirmation": {
|
|
244
243
|
"char": "s",
|
|
245
|
-
"description": "Ignore confirmation question",
|
|
244
|
+
"description": "Ignore confirmation question.",
|
|
246
245
|
"name": "skipConfirmation",
|
|
247
246
|
"allowNo": false,
|
|
248
247
|
"type": "boolean"
|
|
@@ -267,7 +266,7 @@
|
|
|
267
266
|
"instance:schema": {
|
|
268
267
|
"aliases": [],
|
|
269
268
|
"args": {},
|
|
270
|
-
"description": "
|
|
269
|
+
"description": "View the schema of the current instance.",
|
|
271
270
|
"examples": [
|
|
272
271
|
"<%= config.bin %> <%= command.id %>"
|
|
273
272
|
],
|
|
@@ -291,15 +290,15 @@
|
|
|
291
290
|
"instance:set": {
|
|
292
291
|
"aliases": [],
|
|
293
292
|
"args": {},
|
|
294
|
-
"description": "
|
|
293
|
+
"description": "Set the current instance.",
|
|
295
294
|
"examples": [
|
|
296
295
|
"<%= config.bin %> <%= command.id %>",
|
|
297
296
|
"<%= config.bin %> <%= command.id %> --instanceId=1234"
|
|
298
297
|
],
|
|
299
298
|
"flags": {
|
|
300
299
|
"instanceId": {
|
|
301
|
-
"char": "
|
|
302
|
-
"description": "
|
|
300
|
+
"char": "i",
|
|
301
|
+
"description": "Instance ID to change to.",
|
|
303
302
|
"name": "instanceId",
|
|
304
303
|
"hasDynamicHelp": false,
|
|
305
304
|
"multiple": false,
|
|
@@ -325,11 +324,45 @@
|
|
|
325
324
|
"instance:status": {
|
|
326
325
|
"aliases": [],
|
|
327
326
|
"args": {},
|
|
328
|
-
"description": "
|
|
327
|
+
"description": "View the status of the current instance.",
|
|
329
328
|
"examples": [
|
|
330
|
-
"<%= config.bin %> <%= command.id %>"
|
|
329
|
+
"<%= config.bin %> <%= command.id %>",
|
|
330
|
+
"<%= config.bin %> <%= command.id %> --orgId=1234 --appId=1234 --instanceId=1234 --authToken=1234"
|
|
331
331
|
],
|
|
332
|
-
"flags": {
|
|
332
|
+
"flags": {
|
|
333
|
+
"appId": {
|
|
334
|
+
"char": "a",
|
|
335
|
+
"description": "app id to use",
|
|
336
|
+
"name": "appId",
|
|
337
|
+
"hasDynamicHelp": false,
|
|
338
|
+
"multiple": false,
|
|
339
|
+
"type": "option"
|
|
340
|
+
},
|
|
341
|
+
"authToken": {
|
|
342
|
+
"char": "t",
|
|
343
|
+
"description": "auth token to use",
|
|
344
|
+
"name": "authToken",
|
|
345
|
+
"hasDynamicHelp": false,
|
|
346
|
+
"multiple": false,
|
|
347
|
+
"type": "option"
|
|
348
|
+
},
|
|
349
|
+
"instanceId": {
|
|
350
|
+
"char": "i",
|
|
351
|
+
"description": "instance id to use",
|
|
352
|
+
"name": "instanceId",
|
|
353
|
+
"hasDynamicHelp": false,
|
|
354
|
+
"multiple": false,
|
|
355
|
+
"type": "option"
|
|
356
|
+
},
|
|
357
|
+
"orgId": {
|
|
358
|
+
"char": "o",
|
|
359
|
+
"description": "org id to use",
|
|
360
|
+
"name": "orgId",
|
|
361
|
+
"hasDynamicHelp": false,
|
|
362
|
+
"multiple": false,
|
|
363
|
+
"type": "option"
|
|
364
|
+
}
|
|
365
|
+
},
|
|
333
366
|
"hasDynamicHelp": false,
|
|
334
367
|
"hiddenAliases": [],
|
|
335
368
|
"id": "instance:status",
|
|
@@ -349,15 +382,14 @@
|
|
|
349
382
|
"instance:stop": {
|
|
350
383
|
"aliases": [],
|
|
351
384
|
"args": {},
|
|
352
|
-
"description": "
|
|
385
|
+
"description": "Stop the current instance.",
|
|
353
386
|
"examples": [
|
|
354
|
-
"<%= config.bin %> <%= command.id %>"
|
|
355
|
-
"<%= config.bin %> <%= command.id %> --instanceId=1234"
|
|
387
|
+
"<%= config.bin %> <%= command.id %>"
|
|
356
388
|
],
|
|
357
389
|
"flags": {
|
|
358
390
|
"skipConfirmation": {
|
|
359
391
|
"char": "s",
|
|
360
|
-
"description": "Ignore confirmation question",
|
|
392
|
+
"description": "Ignore confirmation question.",
|
|
361
393
|
"name": "skipConfirmation",
|
|
362
394
|
"allowNo": false,
|
|
363
395
|
"type": "boolean"
|
|
@@ -382,7 +414,7 @@
|
|
|
382
414
|
"instance:sync-rules:deploy": {
|
|
383
415
|
"aliases": [],
|
|
384
416
|
"args": {},
|
|
385
|
-
"description": "
|
|
417
|
+
"description": "Deploy sync rules from a local file to the current instance.",
|
|
386
418
|
"examples": [
|
|
387
419
|
"<%= config.bin %> <%= command.id %>",
|
|
388
420
|
"<%= config.bin %> <%= command.id %> --filePath path/to/file",
|
|
@@ -391,7 +423,7 @@
|
|
|
391
423
|
"flags": {
|
|
392
424
|
"filePath": {
|
|
393
425
|
"char": "f",
|
|
394
|
-
"description": "Path to the file",
|
|
426
|
+
"description": "Path to the file.",
|
|
395
427
|
"name": "filePath",
|
|
396
428
|
"required": true,
|
|
397
429
|
"hasDynamicHelp": false,
|
|
@@ -400,7 +432,7 @@
|
|
|
400
432
|
},
|
|
401
433
|
"skipConfirmation": {
|
|
402
434
|
"char": "s",
|
|
403
|
-
"description": "Ignore confirmation question",
|
|
435
|
+
"description": "Ignore confirmation question.",
|
|
404
436
|
"name": "skipConfirmation",
|
|
405
437
|
"allowNo": false,
|
|
406
438
|
"type": "boolean"
|
|
@@ -426,7 +458,7 @@
|
|
|
426
458
|
"instance:sync-rules:generate-schema": {
|
|
427
459
|
"aliases": [],
|
|
428
460
|
"args": {},
|
|
429
|
-
"description": "
|
|
461
|
+
"description": "Generate schema in your language from sync rules.",
|
|
430
462
|
"examples": [
|
|
431
463
|
"<%= config.bin %> <%= command.id %>",
|
|
432
464
|
"<%= config.bin %> <%= command.id %> --filePath path/to/file",
|
|
@@ -435,7 +467,7 @@
|
|
|
435
467
|
"flags": {
|
|
436
468
|
"filePath": {
|
|
437
469
|
"char": "f",
|
|
438
|
-
"description": "Path to the file",
|
|
470
|
+
"description": "Path to the file.",
|
|
439
471
|
"name": "filePath",
|
|
440
472
|
"required": true,
|
|
441
473
|
"hasDynamicHelp": false,
|
|
@@ -444,7 +476,7 @@
|
|
|
444
476
|
},
|
|
445
477
|
"language": {
|
|
446
478
|
"char": "l",
|
|
447
|
-
"description": "Choose language for output",
|
|
479
|
+
"description": "Choose language for output.",
|
|
448
480
|
"name": "language",
|
|
449
481
|
"hasDynamicHelp": false,
|
|
450
482
|
"multiple": false,
|
|
@@ -475,7 +507,7 @@
|
|
|
475
507
|
"instance:sync-rules:validate": {
|
|
476
508
|
"aliases": [],
|
|
477
509
|
"args": {},
|
|
478
|
-
"description": "
|
|
510
|
+
"description": "Validate sync rules from a local file.",
|
|
479
511
|
"examples": [
|
|
480
512
|
"<%= config.bin %> <%= command.id %>",
|
|
481
513
|
"<%= config.bin %> <%= command.id %> --filePath path/to/file",
|
|
@@ -484,7 +516,7 @@
|
|
|
484
516
|
"flags": {
|
|
485
517
|
"filePath": {
|
|
486
518
|
"char": "f",
|
|
487
|
-
"description": "Path to the file",
|
|
519
|
+
"description": "Path to the file.",
|
|
488
520
|
"name": "filePath",
|
|
489
521
|
"required": true,
|
|
490
522
|
"hasDynamicHelp": false,
|
|
@@ -510,5 +542,5 @@
|
|
|
510
542
|
]
|
|
511
543
|
}
|
|
512
544
|
},
|
|
513
|
-
"version": "0.1
|
|
545
|
+
"version": "0.2.1"
|
|
514
546
|
}
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"/dist",
|
|
17
17
|
"/oclif.manifest.json"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.1
|
|
19
|
+
"version": "0.2.1",
|
|
20
20
|
"bugs": "https://github.com/powersync-ja/cli/issues",
|
|
21
21
|
"types": "dist/index.d.ts",
|
|
22
22
|
"exports": "./lib/index.js",
|
|
@@ -30,8 +30,17 @@
|
|
|
30
30
|
"commands": "./dist/commands",
|
|
31
31
|
"plugins": [
|
|
32
32
|
"@oclif/plugin-help",
|
|
33
|
-
"@oclif/plugin-not-found"
|
|
33
|
+
"@oclif/plugin-not-found",
|
|
34
|
+
"@oclif/plugin-warn-if-update-available"
|
|
34
35
|
],
|
|
36
|
+
"topics": {
|
|
37
|
+
"instance:sync-rules": {
|
|
38
|
+
"description": "run \"powersync instance sync-rules\" to see a list of subcommands"
|
|
39
|
+
},
|
|
40
|
+
"instance": {
|
|
41
|
+
"description": "run \"powersync instance\" to see a list of subcommands"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
35
44
|
"topicSeparator": " "
|
|
36
45
|
},
|
|
37
46
|
"repository": "powersync-ja/cli",
|
|
@@ -39,6 +48,7 @@
|
|
|
39
48
|
"@oclif/core": "^3.18.1",
|
|
40
49
|
"@oclif/plugin-help": "^6.0.12",
|
|
41
50
|
"@oclif/plugin-not-found": "^3.0.9",
|
|
51
|
+
"@oclif/plugin-warn-if-update-available": "^3.0.10",
|
|
42
52
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
43
53
|
"dotenv": "^16.4.1",
|
|
44
54
|
"inquirer": "^9.2.13",
|