@liquidmetal-ai/raindrop 0.2.9 → 0.2.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 +36 -36
- package/dist/base-command.d.ts +2 -1
- package/dist/base-command.d.ts.map +1 -1
- package/dist/base-command.js +11 -1
- package/dist/codegen.d.ts +7 -0
- package/dist/codegen.d.ts.map +1 -1
- package/dist/codegen.js +90 -16
- package/dist/codegen.test.js +21 -0
- package/dist/commands/auth/login.d.ts.map +1 -1
- package/dist/commands/build/branch.d.ts.map +1 -1
- package/dist/commands/build/branch.js +16 -1
- package/dist/commands/build/checkout.d.ts.map +1 -1
- package/dist/commands/build/checkout.js +4 -1
- package/dist/commands/build/delete.js +2 -2
- package/dist/commands/build/deploy.d.ts.map +1 -1
- package/dist/commands/build/deploy.js +9 -3
- package/dist/commands/build/find.d.ts.map +1 -1
- package/dist/commands/build/find.js +3 -1
- package/dist/commands/build/generate.d.ts.map +1 -1
- package/dist/commands/build/generate.js +1 -0
- package/dist/commands/build/init.js +1 -1
- package/dist/commands/build/list.d.ts.map +1 -1
- package/dist/commands/build/list.js +3 -2
- package/dist/commands/build/sandbox.d.ts.map +1 -1
- package/dist/commands/build/sandbox.js +8 -2
- package/dist/commands/build/start.d.ts.map +1 -1
- package/dist/commands/build/start.js +5 -2
- package/dist/commands/build/status.d.ts.map +1 -1
- package/dist/commands/build/status.js +5 -4
- package/dist/commands/build/stop.d.ts.map +1 -1
- package/dist/commands/build/stop.js +5 -2
- package/dist/commands/build/unsandbox.d.ts.map +1 -1
- package/dist/commands/build/unsandbox.js +8 -2
- package/dist/commands/build/validate.js +3 -3
- package/dist/commands/object/delete.d.ts.map +1 -1
- package/dist/commands/object/delete.js +8 -4
- package/dist/commands/object/get.d.ts.map +1 -1
- package/dist/commands/object/get.js +8 -6
- package/dist/commands/object/list.d.ts.map +1 -1
- package/dist/commands/object/list.js +14 -10
- package/dist/commands/object/put.d.ts.map +1 -1
- package/dist/commands/object/put.js +11 -7
- package/dist/commands/query/chunk-search.d.ts.map +1 -1
- package/dist/commands/query/chunk-search.js +11 -9
- package/dist/commands/query/register-retriever.d.ts.map +1 -1
- package/dist/commands/query/register-retriever.js +2 -7
- package/dist/commands/query/search.d.ts.map +1 -1
- package/dist/commands/query/search.js +15 -15
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -0
- package/dist/config.test.js +3 -0
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +0 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -2
- package/dist/trace.d.ts +20 -0
- package/dist/trace.d.ts.map +1 -0
- package/dist/trace.js +117 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/oclif.manifest.json +758 -758
- package/package.json +1 -1
- package/templates/db/common/kysely-d1.ts +173 -0
- package/templates/db/db/README.md +32 -0
- package/templates/db/package.json +19 -0
- package/templates/db/prisma/schema.prisma.hbs +46 -0
- package/templates/db/scripts/create_migration.mts +78 -0
- package/templates/db/scripts/seed-sql.mts +32 -0
- package/templates/db/scripts/seed.ts.hbs +219 -0
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ $ npm install -g @liquidmetal-ai/raindrop
|
|
|
20
20
|
$ raindrop COMMAND
|
|
21
21
|
running command...
|
|
22
22
|
$ raindrop (--version)
|
|
23
|
-
@liquidmetal-ai/raindrop/0.2.
|
|
23
|
+
@liquidmetal-ai/raindrop/0.2.11 darwin-arm64 node-v23.10.0
|
|
24
24
|
$ raindrop --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ raindrop COMMAND
|
|
@@ -90,7 +90,7 @@ DESCRIPTION
|
|
|
90
90
|
List authentications
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
_See code: [src/commands/auth/list.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
93
|
+
_See code: [src/commands/auth/list.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/auth/list.ts)_
|
|
94
94
|
|
|
95
95
|
## `raindrop auth login`
|
|
96
96
|
|
|
@@ -104,7 +104,7 @@ DESCRIPTION
|
|
|
104
104
|
Logs a user into the LiquidMetal platform. Supports browser-based authentication.
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
_See code: [src/commands/auth/login.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
107
|
+
_See code: [src/commands/auth/login.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/auth/login.ts)_
|
|
108
108
|
|
|
109
109
|
## `raindrop auth logout`
|
|
110
110
|
|
|
@@ -118,7 +118,7 @@ DESCRIPTION
|
|
|
118
118
|
Logout authentications
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
-
_See code: [src/commands/auth/logout.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
121
|
+
_See code: [src/commands/auth/logout.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/auth/logout.ts)_
|
|
122
122
|
|
|
123
123
|
## `raindrop auth select`
|
|
124
124
|
|
|
@@ -135,7 +135,7 @@ DESCRIPTION
|
|
|
135
135
|
Select active organization
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
-
_See code: [src/commands/auth/select.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
138
|
+
_See code: [src/commands/auth/select.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/auth/select.ts)_
|
|
139
139
|
|
|
140
140
|
## `raindrop build branch BRANCH`
|
|
141
141
|
|
|
@@ -164,7 +164,7 @@ EXAMPLES
|
|
|
164
164
|
Branch a Raindrop application.
|
|
165
165
|
```
|
|
166
166
|
|
|
167
|
-
_See code: [src/commands/build/branch.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
167
|
+
_See code: [src/commands/build/branch.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/branch.ts)_
|
|
168
168
|
|
|
169
169
|
## `raindrop build checkout [VERSION]`
|
|
170
170
|
|
|
@@ -190,7 +190,7 @@ EXAMPLES
|
|
|
190
190
|
Switched to version: 01jux6z20m4gbhn5kaa4mcm2jr
|
|
191
191
|
```
|
|
192
192
|
|
|
193
|
-
_See code: [src/commands/build/checkout.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
193
|
+
_See code: [src/commands/build/checkout.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/checkout.ts)_
|
|
194
194
|
|
|
195
195
|
## `raindrop build delete [APPLICATION]`
|
|
196
196
|
|
|
@@ -219,7 +219,7 @@ EXAMPLES
|
|
|
219
219
|
Deleted (application) at version (version)
|
|
220
220
|
```
|
|
221
221
|
|
|
222
|
-
_See code: [src/commands/build/delete.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
222
|
+
_See code: [src/commands/build/delete.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/delete.ts)_
|
|
223
223
|
|
|
224
224
|
## `raindrop build deploy`
|
|
225
225
|
|
|
@@ -247,7 +247,7 @@ EXAMPLES
|
|
|
247
247
|
Deploy a Raindrop application version.
|
|
248
248
|
```
|
|
249
249
|
|
|
250
|
-
_See code: [src/commands/build/deploy.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
250
|
+
_See code: [src/commands/build/deploy.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/deploy.ts)_
|
|
251
251
|
|
|
252
252
|
## `raindrop build env get VAR`
|
|
253
253
|
|
|
@@ -274,7 +274,7 @@ EXAMPLES
|
|
|
274
274
|
sets an env var/secret.
|
|
275
275
|
```
|
|
276
276
|
|
|
277
|
-
_See code: [src/commands/build/env/get.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
277
|
+
_See code: [src/commands/build/env/get.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/env/get.ts)_
|
|
278
278
|
|
|
279
279
|
## `raindrop build env set VAR [VALUE]`
|
|
280
280
|
|
|
@@ -303,7 +303,7 @@ EXAMPLES
|
|
|
303
303
|
sets an env var/secret.
|
|
304
304
|
```
|
|
305
305
|
|
|
306
|
-
_See code: [src/commands/build/env/set.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
306
|
+
_See code: [src/commands/build/env/set.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/env/set.ts)_
|
|
307
307
|
|
|
308
308
|
## `raindrop build find`
|
|
309
309
|
|
|
@@ -328,7 +328,7 @@ EXAMPLES
|
|
|
328
328
|
$ raindrop build find .
|
|
329
329
|
```
|
|
330
330
|
|
|
331
|
-
_See code: [src/commands/build/find.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
331
|
+
_See code: [src/commands/build/find.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/find.ts)_
|
|
332
332
|
|
|
333
333
|
## `raindrop build generate`
|
|
334
334
|
|
|
@@ -350,7 +350,7 @@ EXAMPLES
|
|
|
350
350
|
$ raindrop build generate
|
|
351
351
|
```
|
|
352
352
|
|
|
353
|
-
_See code: [src/commands/build/generate.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
353
|
+
_See code: [src/commands/build/generate.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/generate.ts)_
|
|
354
354
|
|
|
355
355
|
## `raindrop build init [PATH]`
|
|
356
356
|
|
|
@@ -374,7 +374,7 @@ EXAMPLES
|
|
|
374
374
|
Initialize a project in the current directory.
|
|
375
375
|
```
|
|
376
376
|
|
|
377
|
-
_See code: [src/commands/build/init.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
377
|
+
_See code: [src/commands/build/init.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/init.ts)_
|
|
378
378
|
|
|
379
379
|
## `raindrop build list`
|
|
380
380
|
|
|
@@ -397,7 +397,7 @@ EXAMPLES
|
|
|
397
397
|
List Raindrop catalog resources.
|
|
398
398
|
```
|
|
399
399
|
|
|
400
|
-
_See code: [src/commands/build/list.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
400
|
+
_See code: [src/commands/build/list.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/list.ts)_
|
|
401
401
|
|
|
402
402
|
## `raindrop build sandbox [VERSIONID]`
|
|
403
403
|
|
|
@@ -420,7 +420,7 @@ EXAMPLES
|
|
|
420
420
|
$ raindrop build sandbox
|
|
421
421
|
```
|
|
422
422
|
|
|
423
|
-
_See code: [src/commands/build/sandbox.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
423
|
+
_See code: [src/commands/build/sandbox.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/sandbox.ts)_
|
|
424
424
|
|
|
425
425
|
## `raindrop build start`
|
|
426
426
|
|
|
@@ -444,7 +444,7 @@ EXAMPLES
|
|
|
444
444
|
Start a Raindrop application.
|
|
445
445
|
```
|
|
446
446
|
|
|
447
|
-
_See code: [src/commands/build/start.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
447
|
+
_See code: [src/commands/build/start.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/start.ts)_
|
|
448
448
|
|
|
449
449
|
## `raindrop build status`
|
|
450
450
|
|
|
@@ -469,7 +469,7 @@ EXAMPLES
|
|
|
469
469
|
$ raindrop build status .
|
|
470
470
|
```
|
|
471
471
|
|
|
472
|
-
_See code: [src/commands/build/status.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
472
|
+
_See code: [src/commands/build/status.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/status.ts)_
|
|
473
473
|
|
|
474
474
|
## `raindrop build stop`
|
|
475
475
|
|
|
@@ -493,7 +493,7 @@ EXAMPLES
|
|
|
493
493
|
Stop a Raindrop application.
|
|
494
494
|
```
|
|
495
495
|
|
|
496
|
-
_See code: [src/commands/build/stop.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
496
|
+
_See code: [src/commands/build/stop.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/stop.ts)_
|
|
497
497
|
|
|
498
498
|
## `raindrop build tools check`
|
|
499
499
|
|
|
@@ -514,7 +514,7 @@ EXAMPLES
|
|
|
514
514
|
$ raindrop build tools check
|
|
515
515
|
```
|
|
516
516
|
|
|
517
|
-
_See code: [src/commands/build/tools/check.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
517
|
+
_See code: [src/commands/build/tools/check.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/tools/check.ts)_
|
|
518
518
|
|
|
519
519
|
## `raindrop build tools fmt`
|
|
520
520
|
|
|
@@ -535,7 +535,7 @@ EXAMPLES
|
|
|
535
535
|
$ raindrop build tools fmt
|
|
536
536
|
```
|
|
537
537
|
|
|
538
|
-
_See code: [src/commands/build/tools/fmt.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
538
|
+
_See code: [src/commands/build/tools/fmt.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/tools/fmt.ts)_
|
|
539
539
|
|
|
540
540
|
## `raindrop build unsandbox [VERSIONID]`
|
|
541
541
|
|
|
@@ -558,7 +558,7 @@ EXAMPLES
|
|
|
558
558
|
$ raindrop build unsandbox
|
|
559
559
|
```
|
|
560
560
|
|
|
561
|
-
_See code: [src/commands/build/unsandbox.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
561
|
+
_See code: [src/commands/build/unsandbox.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/unsandbox.ts)_
|
|
562
562
|
|
|
563
563
|
## `raindrop build upload`
|
|
564
564
|
|
|
@@ -581,7 +581,7 @@ EXAMPLES
|
|
|
581
581
|
$ raindrop build upload
|
|
582
582
|
```
|
|
583
583
|
|
|
584
|
-
_See code: [src/commands/build/upload.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
584
|
+
_See code: [src/commands/build/upload.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/upload.ts)_
|
|
585
585
|
|
|
586
586
|
## `raindrop build validate`
|
|
587
587
|
|
|
@@ -603,7 +603,7 @@ EXAMPLES
|
|
|
603
603
|
$ raindrop build validate
|
|
604
604
|
```
|
|
605
605
|
|
|
606
|
-
_See code: [src/commands/build/validate.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
606
|
+
_See code: [src/commands/build/validate.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/build/validate.ts)_
|
|
607
607
|
|
|
608
608
|
## `raindrop help [COMMAND]`
|
|
609
609
|
|
|
@@ -637,7 +637,7 @@ ARGUMENTS
|
|
|
637
637
|
KEY key/path in the bucket to delete
|
|
638
638
|
|
|
639
639
|
FLAGS
|
|
640
|
-
-b, --bucket=<value> (required) bucket
|
|
640
|
+
-b, --bucket=<value> (required) bucket ID
|
|
641
641
|
-o, --output=<option> [default: text] output format
|
|
642
642
|
<options: text|json>
|
|
643
643
|
|
|
@@ -649,7 +649,7 @@ EXAMPLES
|
|
|
649
649
|
Delete file with key 'my-key' from my-bucket
|
|
650
650
|
```
|
|
651
651
|
|
|
652
|
-
_See code: [src/commands/object/delete.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
652
|
+
_See code: [src/commands/object/delete.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/object/delete.ts)_
|
|
653
653
|
|
|
654
654
|
## `raindrop object get KEY [OUTPUT]`
|
|
655
655
|
|
|
@@ -664,7 +664,7 @@ ARGUMENTS
|
|
|
664
664
|
OUTPUT output file (defaults to key basename)
|
|
665
665
|
|
|
666
666
|
FLAGS
|
|
667
|
-
-b, --bucket=<value> (required) bucket
|
|
667
|
+
-b, --bucket=<value> (required) bucket ID
|
|
668
668
|
-f, --format=<option> [default: file] output format
|
|
669
669
|
<options: file|stdout|json>
|
|
670
670
|
|
|
@@ -679,7 +679,7 @@ EXAMPLES
|
|
|
679
679
|
Download file with key 'my-key' from my-bucket to output.txt
|
|
680
680
|
```
|
|
681
681
|
|
|
682
|
-
_See code: [src/commands/object/get.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
682
|
+
_See code: [src/commands/object/get.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/object/get.ts)_
|
|
683
683
|
|
|
684
684
|
## `raindrop object list`
|
|
685
685
|
|
|
@@ -690,7 +690,7 @@ USAGE
|
|
|
690
690
|
$ raindrop object list -b <value> [-o text|json|table]
|
|
691
691
|
|
|
692
692
|
FLAGS
|
|
693
|
-
-b, --bucket=<value> (required) bucket
|
|
693
|
+
-b, --bucket=<value> (required) bucket ID
|
|
694
694
|
-o, --output=<option> [default: text] output format
|
|
695
695
|
<options: text|json|table>
|
|
696
696
|
|
|
@@ -702,7 +702,7 @@ EXAMPLES
|
|
|
702
702
|
List all objects in my-bucket
|
|
703
703
|
```
|
|
704
704
|
|
|
705
|
-
_See code: [src/commands/object/list.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
705
|
+
_See code: [src/commands/object/list.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/object/list.ts)_
|
|
706
706
|
|
|
707
707
|
## `raindrop object put FILE KEY`
|
|
708
708
|
|
|
@@ -717,7 +717,7 @@ ARGUMENTS
|
|
|
717
717
|
KEY key/path in the bucket
|
|
718
718
|
|
|
719
719
|
FLAGS
|
|
720
|
-
-b, --bucket=<value> (required) bucket
|
|
720
|
+
-b, --bucket=<value> (required) bucket ID
|
|
721
721
|
-o, --output=<option> [default: text] output format
|
|
722
722
|
<options: text|json>
|
|
723
723
|
-t, --contentType=<value> content type of the file
|
|
@@ -730,7 +730,7 @@ EXAMPLES
|
|
|
730
730
|
Upload myfile.txt to my-bucket with key 'my-key'
|
|
731
731
|
```
|
|
732
732
|
|
|
733
|
-
_See code: [src/commands/object/put.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
733
|
+
_See code: [src/commands/object/put.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/object/put.ts)_
|
|
734
734
|
|
|
735
735
|
## `raindrop plugins`
|
|
736
736
|
|
|
@@ -1045,7 +1045,7 @@ EXAMPLES
|
|
|
1045
1045
|
Run a RAG search query against a Smart Bucket.
|
|
1046
1046
|
```
|
|
1047
1047
|
|
|
1048
|
-
_See code: [src/commands/query/chunk-search.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
1048
|
+
_See code: [src/commands/query/chunk-search.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/query/chunk-search.ts)_
|
|
1049
1049
|
|
|
1050
1050
|
## `raindrop query register-retriever BUCKET URL DELETEURL BUCKETNAME`
|
|
1051
1051
|
|
|
@@ -1069,7 +1069,7 @@ EXAMPLES
|
|
|
1069
1069
|
Register a new retriever tool.
|
|
1070
1070
|
```
|
|
1071
1071
|
|
|
1072
|
-
_See code: [src/commands/query/register-retriever.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
1072
|
+
_See code: [src/commands/query/register-retriever.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/query/register-retriever.ts)_
|
|
1073
1073
|
|
|
1074
1074
|
## `raindrop query search [QUERY]`
|
|
1075
1075
|
|
|
@@ -1099,7 +1099,7 @@ EXAMPLES
|
|
|
1099
1099
|
Get page 2 of previous search results.
|
|
1100
1100
|
```
|
|
1101
1101
|
|
|
1102
|
-
_See code: [src/commands/query/search.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
1102
|
+
_See code: [src/commands/query/search.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/query/search.ts)_
|
|
1103
1103
|
|
|
1104
1104
|
## `raindrop tail`
|
|
1105
1105
|
|
|
@@ -1113,5 +1113,5 @@ DESCRIPTION
|
|
|
1113
1113
|
tail logs of applications deployed
|
|
1114
1114
|
```
|
|
1115
1115
|
|
|
1116
|
-
_See code: [src/commands/tail.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.
|
|
1116
|
+
_See code: [src/commands/tail.ts](https://github.com/liquidmetal-ai/liquidmetal/blob/v0.2.11/src/commands/tail.ts)_
|
|
1117
1117
|
<!-- commandsstop -->
|
package/dist/base-command.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Client } from '@connectrpc/connect';
|
|
|
2
2
|
import { Application } from '@liquidmetal-ai/drizzle/appify/build';
|
|
3
3
|
import { CatalogService } from '@liquidmetal-ai/drizzle/liquidmetal/v1alpha1/catalog_pb';
|
|
4
4
|
import { RainbowAuthService } from '@liquidmetal-ai/drizzle/liquidmetal/v1alpha1/rainbow_auth_pb';
|
|
5
|
-
import { ObjectService } from '@liquidmetal-ai/drizzle/liquidmetal/v1alpha1/
|
|
5
|
+
import { ObjectService } from '@liquidmetal-ai/drizzle/liquidmetal/v1alpha1/object_pb';
|
|
6
6
|
import { SearchAgentService } from '@liquidmetal-ai/drizzle/liquidmetal/v1alpha1/search_agent_pb';
|
|
7
7
|
import { Command, Interfaces } from '@oclif/core';
|
|
8
8
|
import { Config } from './config.js';
|
|
@@ -52,5 +52,6 @@ export declare abstract class BaseCommand<T extends typeof Command> extends Comm
|
|
|
52
52
|
client: Client<typeof RainbowAuthService>;
|
|
53
53
|
}>;
|
|
54
54
|
raindropFrameworkVersion(): Promise<string>;
|
|
55
|
+
log(message?: string, ...args: any[]): void;
|
|
55
56
|
}
|
|
56
57
|
//# sourceMappingURL=base-command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-command.d.ts","sourceRoot":"","sources":["../src/base-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,yDAAyD,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8DAA8D,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"base-command.d.ts","sourceRoot":"","sources":["../src/base-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,yDAAyD,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8DAA8D,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,wDAAwD,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8DAA8D,CAAC;AAElG,OAAO,EAAE,OAAO,EAAS,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzD,OAAO,EAAE,MAAM,EAA0B,MAAM,aAAa,CAAC;AAC7D,OAAO,EAML,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,OAAO,OAAO,IAAI,UAAU,CAAC,aAAa,CAAC,CAAC,OAAO,WAAW,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACvH,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,OAAO,OAAO,IAAI,UAAU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aAAa,IAAI,OAAO,CAAC;QACvC,MAAM,EAAE,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;QACrC,cAAc,EAAE,MAAM,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;cAgBc,kBAAkB,IAAI,OAAO,CAAC;QAC5C,MAAM,EAAE,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;KAC3C,CAAC;IAMI,wBAAwB,IAAI,OAAO,CAAC,MAAM,CAAC;IAWjD,GAAG,CAAC,OAAO,GAAE,MAAW,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;CAGhD"}
|
package/dist/base-command.js
CHANGED
|
@@ -144,10 +144,14 @@ export class BaseCommand extends Command {
|
|
|
144
144
|
}
|
|
145
145
|
async objectService() {
|
|
146
146
|
const { client: rainbowAuth } = await this.rainbowAuthService();
|
|
147
|
+
const identity = await this.catalogIdentity();
|
|
147
148
|
const result = await objectService({
|
|
148
149
|
rainbowAuth,
|
|
149
150
|
configDir: this.config.configDir,
|
|
150
|
-
identity:
|
|
151
|
+
identity: {
|
|
152
|
+
...identity,
|
|
153
|
+
baseUrl: `https://api-${this.flags.bucket}.${identity.organizationId}.lmapp.run`,
|
|
154
|
+
},
|
|
151
155
|
});
|
|
152
156
|
return result;
|
|
153
157
|
}
|
|
@@ -162,4 +166,10 @@ export class BaseCommand extends Command {
|
|
|
162
166
|
}
|
|
163
167
|
return version;
|
|
164
168
|
}
|
|
169
|
+
// log overrides the default oclif log method to use stderr, so that actual command output can be
|
|
170
|
+
// piped to other commands properly
|
|
171
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
172
|
+
log(message = '', ...args) {
|
|
173
|
+
this.logToStderr(message, ...args);
|
|
174
|
+
}
|
|
165
175
|
}
|
package/dist/codegen.d.ts
CHANGED
|
@@ -4,18 +4,25 @@ export declare const TEMPLATES_DIR: string;
|
|
|
4
4
|
export declare const TEMPLATE_INIT = "init";
|
|
5
5
|
export declare const GENERATED_EXTENSION = ".gen";
|
|
6
6
|
export declare const HANDLERS_DIR = "src";
|
|
7
|
+
export declare const COMMON_DIR = "common";
|
|
8
|
+
export declare const DB_DIR = "db";
|
|
9
|
+
export declare const PRISMA_DIR = "prisma";
|
|
10
|
+
export declare const DB_SCRIPT_DIR = "scripts";
|
|
7
11
|
export declare const RAINDROP_TYPES_FILENAME = "raindrop.gen.ts";
|
|
8
12
|
export declare function trimTemplateSuffix(filename: string): string;
|
|
9
13
|
type TemplateContext = Record<string, string | number>;
|
|
10
14
|
export declare function renderTemplateFromString(template: string, context: TemplateContext): string;
|
|
11
15
|
export declare function renderTemplateFromFile(templatePath: string, context: TemplateContext): Promise<string>;
|
|
12
16
|
export declare function renderTemplatesFromDirectory(templatePath: string, outPath: string, context: TemplateContext, opts: CodegenOptions): Promise<void>;
|
|
17
|
+
type TemplateType = 'scaffolding' | 'user-modifiable' | 'non-user-modifiable';
|
|
18
|
+
export declare function templateType(relPath: string): TemplateType;
|
|
13
19
|
export declare function shouldWriteTemplate(opts: CodegenOptions, relPath: string): boolean;
|
|
14
20
|
export type CodegenOptions = {
|
|
15
21
|
renderScaffoldingCode?: boolean;
|
|
16
22
|
renderUserModifiableCode?: boolean;
|
|
17
23
|
renderNonUserModifiableCode?: boolean;
|
|
18
24
|
overwrite?: boolean;
|
|
25
|
+
mergePackageJson?: boolean;
|
|
19
26
|
} | undefined;
|
|
20
27
|
export declare function renderCodegenPlan(plan: CodegenPlan, outPath: string | undefined, opts: CodegenOptions, context?: TemplateContext): Promise<void>;
|
|
21
28
|
export type CodegenPlan = {
|
package/dist/codegen.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../src/codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAW,MAAM,sCAAsC,CAAC;AAK5G,eAAO,MAAM,SAAS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G,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBlF;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D"}
|
package/dist/codegen.js
CHANGED
|
@@ -8,14 +8,24 @@ export const TEMPLATES_DIR = path.join(path.dirname(fileURLToPath(import.meta.ur
|
|
|
8
8
|
export const TEMPLATE_INIT = 'init';
|
|
9
9
|
export const GENERATED_EXTENSION = '.gen';
|
|
10
10
|
export const HANDLERS_DIR = 'src';
|
|
11
|
+
export const COMMON_DIR = 'common';
|
|
12
|
+
export const DB_DIR = 'db';
|
|
13
|
+
export const PRISMA_DIR = 'prisma';
|
|
14
|
+
export const DB_SCRIPT_DIR = 'scripts';
|
|
11
15
|
export const RAINDROP_TYPES_FILENAME = 'raindrop.gen.ts';
|
|
12
16
|
const TEMPLATE_BUCKET_EVENT_NOTIFICATION = path.join('handlers', 'bucket-event-notification');
|
|
13
17
|
const TEMPLATE_QUEUE_CONSUMER = path.join('handlers', 'queue-consumer');
|
|
14
18
|
const TEMPLATE_HTTP_SERVICE = path.join('handlers', 'http-service');
|
|
15
19
|
const TEMPLATE_ACTOR = path.join('handlers', 'actor');
|
|
16
20
|
const TEMPLATE_TASK = path.join('handlers', 'task');
|
|
21
|
+
const TEMPLATE_DB = 'db';
|
|
22
|
+
const TEMPLATE_DB_DB = path.join('db', 'db');
|
|
23
|
+
const TEMPLATE_DB_COMMON = path.join('db', 'common');
|
|
24
|
+
const TEMPLATE_DB_PRISMA = path.join('db', 'prisma');
|
|
25
|
+
const TEMPLATE_DB_SCRIPT = path.join('db', 'scripts');
|
|
17
26
|
const TEMPLATE_EXTENSION = '.hbs';
|
|
18
27
|
const SCAFFOLDING_PREFIX = '__';
|
|
28
|
+
const PACKAGE_JSON = 'package.json';
|
|
19
29
|
const HANDLEBARS_RENDER_OPTS = {
|
|
20
30
|
strict: true, // Fail on missing variables
|
|
21
31
|
noEscape: true, // Do not escape HTML
|
|
@@ -31,28 +41,66 @@ export async function renderTemplateFromFile(templatePath, context) {
|
|
|
31
41
|
const template = await fs.readFile(templatePath, 'utf-8');
|
|
32
42
|
return renderTemplateFromString(template, context);
|
|
33
43
|
}
|
|
44
|
+
// Handle special case for package.json - merge them rather than overwrite
|
|
45
|
+
async function handlePackageJson(templatePath, outputPath) {
|
|
46
|
+
// Read the template package.json and render it
|
|
47
|
+
const templateJson = JSON.parse(await fs.readFile(templatePath, 'utf-8'));
|
|
48
|
+
// Check if output package.json exists
|
|
49
|
+
const existingJson = JSON.parse(await fs.readFile(outputPath, 'utf-8'));
|
|
50
|
+
// Merge the existing package.json with the template one
|
|
51
|
+
const mergedJson = {
|
|
52
|
+
...existingJson,
|
|
53
|
+
dependencies: { ...existingJson.dependencies, ...templateJson.dependencies },
|
|
54
|
+
devDependencies: { ...existingJson.devDependencies, ...templateJson.devDependencies },
|
|
55
|
+
scripts: { ...existingJson.scripts, ...templateJson.scripts },
|
|
56
|
+
};
|
|
57
|
+
// Write the merged package.json
|
|
58
|
+
await fs.writeFile(outputPath, JSON.stringify(mergedJson, null, 2));
|
|
59
|
+
}
|
|
34
60
|
export async function renderTemplatesFromDirectory(templatePath, outPath, context, opts) {
|
|
35
61
|
const visit = async (relPath) => {
|
|
36
|
-
|
|
37
|
-
|
|
62
|
+
try {
|
|
63
|
+
if (!shouldWriteTemplate(opts, relPath)) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
//NOTE: Sometimes we want to pass full files, this allows us to do that
|
|
67
|
+
// If the template is a directory, we need to join it with the relPath
|
|
68
|
+
// If the template is a file, we need to use the templatePath as the relPath
|
|
69
|
+
const fullTemplatePath = relPath ? path.join(templatePath, relPath) : templatePath;
|
|
70
|
+
relPath = relPath ? relPath : path.basename(templatePath);
|
|
71
|
+
const outputFilename = trimTemplateSuffix(relPath);
|
|
72
|
+
const outputFilePath = path.join(outPath, outputFilename);
|
|
73
|
+
// Special handling for package.json
|
|
74
|
+
if (!relPath.endsWith(TEMPLATE_EXTENSION) && outputFilename === PACKAGE_JSON && opts?.mergePackageJson) {
|
|
75
|
+
await handlePackageJson(fullTemplatePath, outputFilePath);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
// Create directory if needed
|
|
79
|
+
await fs.mkdir(path.dirname(outputFilePath), { recursive: true });
|
|
80
|
+
// Regular file handling
|
|
81
|
+
const rawContent = await fs.readFile(fullTemplatePath, 'utf-8');
|
|
82
|
+
// Templates are rendered, other files are copied
|
|
83
|
+
const content = relPath.endsWith(TEMPLATE_EXTENSION) ? renderTemplateFromString(rawContent, context) : rawContent;
|
|
84
|
+
const alreadyExists = await fileExists(outputFilePath);
|
|
85
|
+
if (alreadyExists && !opts?.overwrite) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
await fs.writeFile(outputFilePath, content);
|
|
38
89
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const content = relPath.endsWith(TEMPLATE_EXTENSION)
|
|
42
|
-
? await renderTemplateFromFile(path.join(templatePath, relPath), context)
|
|
43
|
-
: rawContent;
|
|
44
|
-
const outputFilename = trimTemplateSuffix(relPath);
|
|
45
|
-
await fs.mkdir(path.join(outPath, path.dirname(outputFilename)), { recursive: true });
|
|
46
|
-
const outputFilePath = path.join(outPath, outputFilename);
|
|
47
|
-
const alreadyExists = await fileExists(outputFilePath);
|
|
48
|
-
if (alreadyExists && !opts?.overwrite) {
|
|
49
|
-
return;
|
|
90
|
+
catch (err) {
|
|
91
|
+
console.error(`Error processing file ${relPath}: ${err}`);
|
|
50
92
|
}
|
|
51
|
-
await fs.writeFile(outputFilePath, content);
|
|
52
93
|
};
|
|
94
|
+
//if its a file, just call the visit function
|
|
95
|
+
if (await fs.lstat(templatePath).then((stats) => stats.isFile())) {
|
|
96
|
+
//this works because we are using the templatePath as the template name
|
|
97
|
+
//and the visit function is called with the template name
|
|
98
|
+
await visit('');
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
53
101
|
return await dirWalk(templatePath, visit);
|
|
54
102
|
}
|
|
55
|
-
function templateType(relPath) {
|
|
103
|
+
export function templateType(relPath) {
|
|
56
104
|
if (path.basename(relPath).startsWith(SCAFFOLDING_PREFIX)) {
|
|
57
105
|
return 'scaffolding';
|
|
58
106
|
}
|
|
@@ -124,6 +172,32 @@ export function codegenPlan(apps) {
|
|
|
124
172
|
context: { taskClassName: kebabCaseToUpperCamelCase(valueOf(task.name)) },
|
|
125
173
|
});
|
|
126
174
|
}
|
|
175
|
+
for (const db of app.sqlDatabase) {
|
|
176
|
+
plan.push({
|
|
177
|
+
templateName: path.join(TEMPLATES_DIR, TEMPLATE_DB, 'package.json'),
|
|
178
|
+
outPath: path.join('./'),
|
|
179
|
+
});
|
|
180
|
+
plan.push({
|
|
181
|
+
templateName: path.join(TEMPLATES_DIR, TEMPLATE_DB_DB),
|
|
182
|
+
outPath: path.join(DB_DIR, valueOf(db.name)),
|
|
183
|
+
context: { dbName: kebabCaseToCamelCase(valueOf(db.name)) },
|
|
184
|
+
});
|
|
185
|
+
plan.push({
|
|
186
|
+
templateName: path.join(TEMPLATES_DIR, TEMPLATE_DB_COMMON),
|
|
187
|
+
outPath: path.join(HANDLERS_DIR, COMMON_DIR),
|
|
188
|
+
context: { dbName: kebabCaseToCamelCase(valueOf(db.name)) },
|
|
189
|
+
});
|
|
190
|
+
plan.push({
|
|
191
|
+
templateName: path.join(TEMPLATES_DIR, TEMPLATE_DB_PRISMA),
|
|
192
|
+
outPath: path.join(PRISMA_DIR, valueOf(db.name)),
|
|
193
|
+
context: { dbName: kebabCaseToCamelCase(valueOf(db.name)) },
|
|
194
|
+
});
|
|
195
|
+
plan.push({
|
|
196
|
+
templateName: path.join(TEMPLATES_DIR, TEMPLATE_DB_SCRIPT),
|
|
197
|
+
outPath: path.join(DB_SCRIPT_DIR),
|
|
198
|
+
context: { dbName: kebabCaseToCamelCase(valueOf(db.name)) },
|
|
199
|
+
});
|
|
200
|
+
}
|
|
127
201
|
}
|
|
128
202
|
return plan;
|
|
129
203
|
}
|
|
@@ -133,7 +207,7 @@ import { {{#each imports}}{{this}}, {{/each}} } from '@liquidmetal-ai/raindrop-f
|
|
|
133
207
|
export interface Env {
|
|
134
208
|
_raindrop: {
|
|
135
209
|
app: App;
|
|
136
|
-
}
|
|
210
|
+
};
|
|
137
211
|
{{#each resources}}
|
|
138
212
|
{{this.name}}: {{{this.type}}};
|
|
139
213
|
{{/each}}
|
package/dist/codegen.test.js
CHANGED
|
@@ -59,6 +59,27 @@ test('codegens from app with durable object', async () => {
|
|
|
59
59
|
expect(plan[1]?.templateName).toMatch('templates/handlers/actor');
|
|
60
60
|
expect(plan[1]?.outPath).toEqual('src/ingest-object');
|
|
61
61
|
});
|
|
62
|
+
test('codegens from app with sql database', async () => {
|
|
63
|
+
const apps = await mustManifestFromString(`
|
|
64
|
+
application "ingest" {
|
|
65
|
+
sql_database "demosql" {}
|
|
66
|
+
}
|
|
67
|
+
`);
|
|
68
|
+
const plan = codegenPlan(apps);
|
|
69
|
+
expect(Object.keys(plan)).toHaveLength(6);
|
|
70
|
+
expect(plan[0]?.templateName).toMatch('templates/init');
|
|
71
|
+
expect(plan[0]?.outPath).toEqual('');
|
|
72
|
+
expect(plan[1]?.templateName).toMatch('templates/db/package.json');
|
|
73
|
+
expect(plan[1]?.outPath).toEqual('./');
|
|
74
|
+
expect(plan[2]?.templateName).toMatch('templates/db/db');
|
|
75
|
+
expect(plan[2]?.outPath).toEqual('db/demosql');
|
|
76
|
+
expect(plan[3]?.templateName).toMatch('templates/db/common');
|
|
77
|
+
expect(plan[3]?.outPath).toEqual('src/common');
|
|
78
|
+
expect(plan[4]?.templateName).toMatch('templates/db/prisma');
|
|
79
|
+
expect(plan[4]?.outPath).toEqual('prisma/demosql');
|
|
80
|
+
expect(plan[5]?.templateName).toMatch('templates/db/scripts');
|
|
81
|
+
expect(plan[5]?.outPath).toEqual('scripts');
|
|
82
|
+
});
|
|
62
83
|
test('only codegens scaffolding when enabled', () => {
|
|
63
84
|
expect(shouldWriteTemplate({
|
|
64
85
|
renderScaffoldingCode: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AASpD,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,WAAW,CAAC,OAAO,KAAK,CAAC;IAC1D,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,WAAW,SAAuF;IAEzG,MAAM,CAAC,KAAK;;MAMV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AASpD,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,WAAW,CAAC,OAAO,KAAK,CAAC;IAC1D,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,WAAW,SAAuF;IAEzG,MAAM,CAAC,KAAK;;MAMV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA+D3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"branch.d.ts","sourceRoot":"","sources":["../../../src/commands/build/branch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,MAAM,CAAC,IAAI;;MAET;IAEF,MAAM,CAAC,WAAW,SAAmC;IAErD,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;;;;MA4BV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"branch.d.ts","sourceRoot":"","sources":["../../../src/commands/build/branch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,MAAM,CAAC,IAAI;;MAET;IAEF,MAAM,CAAC,WAAW,SAAmC;IAErD,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;;;;MA4BV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAsC3B"}
|
|
@@ -42,9 +42,15 @@ Branch a Raindrop application.
|
|
|
42
42
|
};
|
|
43
43
|
async run() {
|
|
44
44
|
const config = await this.loadConfig();
|
|
45
|
+
if (config.lock) {
|
|
46
|
+
this.error('Operation not allowed: application is in a locked state');
|
|
47
|
+
}
|
|
48
|
+
if (config.sandbox) {
|
|
49
|
+
this.error('Branching is not allowed in sandbox mode');
|
|
50
|
+
}
|
|
45
51
|
// Allow the user to see the currently selected version
|
|
46
52
|
if (this.flags.show) {
|
|
47
|
-
|
|
53
|
+
console.log(`Current versionId: ${config.versionId}`);
|
|
48
54
|
return;
|
|
49
55
|
}
|
|
50
56
|
const versionId = this.flags.versionId || config.versionId;
|
|
@@ -59,5 +65,14 @@ Branch a Raindrop application.
|
|
|
59
65
|
start: this.flags.start,
|
|
60
66
|
impersonate: this.flags.impersonate,
|
|
61
67
|
});
|
|
68
|
+
//reload config file
|
|
69
|
+
const updatedConfig = await this.loadConfig();
|
|
70
|
+
if (!updatedConfig.versionId) {
|
|
71
|
+
this.error('VersionId is not set in the config file');
|
|
72
|
+
}
|
|
73
|
+
// Auto sandbox the new branch
|
|
74
|
+
this.log('Branching complete, sandboxing the new branch');
|
|
75
|
+
await this.config.runCommand('build:sandbox', [updatedConfig.versionId]);
|
|
76
|
+
this.log(`🔔 Branch is in Sandbox mode`);
|
|
62
77
|
}
|
|
63
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../../src/commands/build/checkout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,MAAM,CAAC,IAAI;;MAET;IAEF,MAAM,CAAC,WAAW,SAAsD;IAExE,MAAM,CAAC,QAAQ,WAOb;IAEF,MAAM,CAAC,KAAK;;;;;;;;MAGV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../../src/commands/build/checkout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,MAAM,CAAC,IAAI;;MAET;IAEF,MAAM,CAAC,WAAW,SAAsD;IAExE,MAAM,CAAC,QAAQ,WAOb;IAEF,MAAM,CAAC,KAAK;;;;;;;;MAGV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiC3B"}
|
|
@@ -18,10 +18,13 @@ Switched to version: 01jux6z20m4gbhn5kaa4mcm2jr
|
|
|
18
18
|
output: Flags.string({ char: 'o', description: 'output format', required: false, default: 'text' }),
|
|
19
19
|
};
|
|
20
20
|
async run() {
|
|
21
|
+
const config = await this.loadConfig();
|
|
22
|
+
if (config.lock) {
|
|
23
|
+
this.error('Operation not allowed: application is in a locked state');
|
|
24
|
+
}
|
|
21
25
|
if (['text', 'json'].indexOf(this.flags.output) === -1) {
|
|
22
26
|
this.error(`unsupported output format: ${this.flags.output}`, { exit: 1 });
|
|
23
27
|
}
|
|
24
|
-
const config = await this.loadConfig();
|
|
25
28
|
// No args: just show the current version
|
|
26
29
|
if (!this.args.version) {
|
|
27
30
|
if (this.flags.output === 'json') {
|