@liquidmetal-ai/raindrop 0.13.0 → 0.15.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 +327 -89
- package/bundle/build-CBEGQPJT.js +62 -0
- package/bundle/{chunk-IEF2XC25.js → chunk-2PH3PHH3.js} +5 -3
- package/bundle/{chunk-4HZ22KOV.js → chunk-3CMR7ES5.js} +4 -4
- package/bundle/{chunk-JSBM2JYW.js → chunk-3EYKCHIK.js} +1 -1
- package/bundle/chunk-5XHDP4VK.js +1697 -0
- package/bundle/{chunk-TSQK4HH6.js → chunk-674GMSXY.js} +1 -1
- package/bundle/{chunk-PS3WZBDF.js → chunk-6L4V66WZ.js} +1105 -2728
- package/bundle/{chunk-5245CEUM.js → chunk-AGG7JZVH.js} +2 -2
- package/bundle/{chunk-3GFKUF5D.js → chunk-B3IY2XS6.js} +4 -2
- package/bundle/{chunk-WIDI65NO.js → chunk-CBAXTRCS.js} +1 -1
- package/bundle/{chunk-JLVDTXO2.js → chunk-DPV5HIG7.js} +4 -4
- package/bundle/{chunk-36GNZK4A.js → chunk-EVXLXWP7.js} +1 -1
- package/bundle/{chunk-4YVU5KEQ.js → chunk-HN3AAKRY.js} +4 -2
- package/bundle/{chunk-NVNEQXHN.js → chunk-IGLE4Y3B.js} +7 -5
- package/bundle/{chunk-FGSYWVBA.js → chunk-IQ6HFRA6.js} +1 -1
- package/bundle/{chunk-O3QZDJ75.js → chunk-JQONDSHY.js} +2 -2
- package/bundle/{chunk-W4IPOFZC.js → chunk-KADMFJLN.js} +8 -6
- package/bundle/chunk-KG5BLUGU.js +246 -0
- package/bundle/{chunk-V5LHJTYS.js → chunk-KLOYSTZY.js} +13 -2
- package/bundle/{chunk-ETC5VU7H.js → chunk-KXHVSLAI.js} +1 -1
- package/bundle/{chunk-Y4WFGNPM.js → chunk-L6FRQULN.js} +1 -1
- package/bundle/{chunk-3QCVYSRU.js → chunk-LT3BFQ4O.js} +1 -1
- package/bundle/{chunk-KQZJHBNG.js → chunk-MBLKVNI5.js} +1 -1
- package/bundle/{chunk-6AIUQUUM.js → chunk-MFMVJZW6.js} +71 -15
- package/bundle/{chunk-25T7MEKO.js → chunk-MJBLNWG3.js} +1 -1
- package/bundle/{chunk-MSJ33O5Y.js → chunk-NRCQIE3Z.js} +95 -115
- package/bundle/{chunk-XKKPPSPC.js → chunk-OCYTN4IH.js} +2 -2
- package/bundle/{chunk-2GAMWFJE.js → chunk-QEF5D4VE.js} +1 -1
- package/bundle/{chunk-4B3QYXBA.js → chunk-T7MQCLXF.js} +5 -3
- package/bundle/{chunk-LDFYPOXJ.js → chunk-TFQY5TSY.js} +1 -1
- package/bundle/{chunk-BWK4MC7Y.js → chunk-USZXZZAR.js} +8 -6
- package/bundle/{chunk-ER2RCPCY.js → chunk-V54KHS5B.js} +2 -2
- package/bundle/{chunk-YSKASURB.js → chunk-V6J23FL2.js} +1 -1
- package/bundle/{chunk-UHSTDJ7X.js → chunk-VN2QYX4C.js} +1 -1
- package/bundle/{chunk-Z4OWKG7J.js → chunk-VOT5MMEY.js} +1 -1
- package/bundle/{chunk-W6GU26WO.js → chunk-WG6BDFPZ.js} +1 -1
- package/bundle/{chunk-AK77X5GL.js → chunk-XX74I5RK.js} +4 -2
- package/bundle/{chunk-6BT265R3.js → chunk-YQCRWPNI.js} +1 -1
- package/bundle/commands/annotation/get.js +3 -3
- package/bundle/commands/annotation/list.js +3 -3
- package/bundle/commands/annotation/put.js +3 -3
- package/bundle/commands/auth/apikey.js +2 -2
- package/bundle/commands/auth/list.js +2 -2
- package/bundle/commands/auth/login.js +2 -2
- package/bundle/commands/auth/logout.js +2 -2
- package/bundle/commands/auth/select.js +3 -3
- package/bundle/commands/bucket/create-credential.js +2 -2
- package/bundle/commands/bucket/delete-credential.js +2 -2
- package/bundle/commands/bucket/get-credential.js +2 -2
- package/bundle/commands/bucket/list-credentials.js +2 -2
- package/bundle/commands/build/actor/setup.js +124 -0
- package/bundle/commands/build/branch.js +10 -10
- package/bundle/commands/build/bucket-events/setup.js +146 -0
- package/bundle/commands/build/checkout.js +8 -8
- package/bundle/commands/build/clone.js +6 -6
- package/bundle/commands/build/delete.js +8 -8
- package/bundle/commands/build/deploy.js +10 -10
- package/bundle/commands/build/env/get.js +3 -3
- package/bundle/commands/build/env/list.js +2 -2
- package/bundle/commands/build/env/set.js +3 -3
- package/bundle/commands/build/env.js +2 -2
- package/bundle/commands/build/features.js +192 -0
- package/bundle/commands/build/find.js +4 -4
- package/bundle/commands/build/generate.js +52 -3
- package/bundle/commands/build/init-workspace.js +3 -3
- package/bundle/commands/build/init.js +15 -3
- package/bundle/commands/build/list.js +5 -5
- package/bundle/commands/build/queue/setup.js +133 -0
- package/bundle/commands/build/sandbox.js +6 -6
- package/bundle/commands/build/smartbucket/setup.js +165 -0
- package/bundle/commands/build/smartmemory/setup.js +171 -0
- package/bundle/commands/build/smartsql/setup.js +167 -0
- package/bundle/commands/build/start.js +2 -2
- package/bundle/commands/build/status.js +5 -5
- package/bundle/commands/build/stop.js +2 -2
- package/bundle/commands/build/stripe/dashboard.js +3 -3
- package/bundle/commands/build/stripe/onboard.js +3 -3
- package/bundle/commands/build/stripe/setup.js +3 -3
- package/bundle/commands/build/stripe/start.js +14 -14
- package/bundle/commands/build/stripe/status.js +3 -3
- package/bundle/commands/build/stripe/subscription/create.js +4 -4
- package/bundle/commands/build/stripe/subscription/get.js +4 -4
- package/bundle/commands/build/stripe/subscription/update.js +4 -4
- package/bundle/commands/build/tools/check.js +2 -2
- package/bundle/commands/build/tools/fmt.js +2 -2
- package/bundle/commands/build/unsandbox.js +6 -6
- package/bundle/commands/build/upload.js +5 -5
- package/bundle/commands/build/validate.js +85 -14
- package/bundle/commands/build/workos/delete.js +6 -6
- package/bundle/commands/build/workos/env/attach.js +3 -3
- package/bundle/commands/build/workos/env/attached.js +3 -3
- package/bundle/commands/build/workos/env/create.js +3 -3
- package/bundle/commands/build/workos/env/delete.js +3 -3
- package/bundle/commands/build/workos/env/detach.js +3 -3
- package/bundle/commands/build/workos/env/dev-login.js +3 -3
- package/bundle/commands/build/workos/env/get.js +3 -3
- package/bundle/commands/build/workos/env/list.js +3 -3
- package/bundle/commands/build/workos/env/set.js +3 -3
- package/bundle/commands/build/workos/invite.js +3 -3
- package/bundle/commands/build/workos/jwt.js +172 -0
- package/bundle/commands/build/workos/setup.js +3 -3
- package/bundle/commands/build/workos/status.js +3 -3
- package/bundle/commands/dns/create.js +2 -2
- package/bundle/commands/dns/delete.js +6 -6
- package/bundle/commands/dns/get.js +6 -6
- package/bundle/commands/dns/list.js +3 -3
- package/bundle/commands/dns/records/create.js +2 -2
- package/bundle/commands/dns/records/delete.js +3 -3
- package/bundle/commands/dns/records/get.js +2 -2
- package/bundle/commands/dns/records/list.js +2 -2
- package/bundle/commands/dns/records/update.js +2 -2
- package/bundle/commands/doctor.js +309 -0
- package/bundle/commands/logs/query.js +3 -3
- package/bundle/commands/logs/tail.js +3 -3
- package/bundle/commands/mcp/install-claude.js +2 -2
- package/bundle/commands/mcp/install-gemini.js +2 -2
- package/bundle/commands/mcp/install-goose.js +2 -2
- package/bundle/commands/mcp/status.js +2 -2
- package/bundle/commands/object/delete.js +5 -37
- package/bundle/commands/object/get.js +5 -37
- package/bundle/commands/object/list.js +7 -39
- package/bundle/commands/object/put.js +5 -37
- package/bundle/commands/query/chunk-search.js +14 -46
- package/bundle/commands/query/document.js +17 -55
- package/bundle/commands/query/events.js +2 -2
- package/bundle/commands/query/reindex.js +2 -2
- package/bundle/commands/query/search.js +14 -46
- package/bundle/commands/tail.js +2 -2
- package/bundle/index.js +1 -1
- package/dist/commands/build/actor/setup.d.ts +22 -0
- package/dist/commands/build/actor/setup.d.ts.map +1 -0
- package/dist/commands/build/actor/setup.js +116 -0
- package/dist/commands/build/bucket-events/setup.d.ts +22 -0
- package/dist/commands/build/bucket-events/setup.d.ts.map +1 -0
- package/dist/commands/build/bucket-events/setup.js +134 -0
- package/dist/commands/build/features.d.ts +19 -0
- package/dist/commands/build/features.d.ts.map +1 -0
- package/dist/commands/build/features.js +97 -0
- package/dist/commands/build/generate.d.ts +2 -0
- package/dist/commands/build/generate.d.ts.map +1 -1
- package/dist/commands/build/generate.js +52 -0
- package/dist/commands/build/init.d.ts.map +1 -1
- package/dist/commands/build/init.js +10 -0
- package/dist/commands/build/queue/setup.d.ts +21 -0
- package/dist/commands/build/queue/setup.d.ts.map +1 -0
- package/dist/commands/build/queue/setup.js +120 -0
- package/dist/commands/build/smartbucket/setup.d.ts +23 -0
- package/dist/commands/build/smartbucket/setup.d.ts.map +1 -0
- package/dist/commands/build/smartbucket/setup.js +167 -0
- package/dist/commands/build/smartmemory/setup.d.ts +23 -0
- package/dist/commands/build/smartmemory/setup.d.ts.map +1 -0
- package/dist/commands/build/smartmemory/setup.js +172 -0
- package/dist/commands/build/smartsql/setup.d.ts +23 -0
- package/dist/commands/build/smartsql/setup.d.ts.map +1 -0
- package/dist/commands/build/smartsql/setup.js +169 -0
- package/dist/commands/build/validate.d.ts +2 -0
- package/dist/commands/build/validate.d.ts.map +1 -1
- package/dist/commands/build/validate.js +80 -8
- package/dist/commands/build/workos/jwt.d.ts +23 -0
- package/dist/commands/build/workos/jwt.d.ts.map +1 -0
- package/dist/commands/build/workos/jwt.js +172 -0
- package/dist/commands/doctor.d.ts +27 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +328 -0
- package/dist/commands/object/delete.d.ts +0 -2
- package/dist/commands/object/delete.d.ts.map +1 -1
- package/dist/commands/object/delete.js +3 -38
- package/dist/commands/object/get.d.ts +0 -2
- package/dist/commands/object/get.d.ts.map +1 -1
- package/dist/commands/object/get.js +3 -38
- package/dist/commands/object/list.d.ts +0 -2
- package/dist/commands/object/list.d.ts.map +1 -1
- package/dist/commands/object/list.js +5 -40
- package/dist/commands/object/put.d.ts +0 -2
- package/dist/commands/object/put.d.ts.map +1 -1
- package/dist/commands/object/put.js +3 -38
- package/dist/commands/query/chunk-search.d.ts +0 -2
- package/dist/commands/query/chunk-search.d.ts.map +1 -1
- package/dist/commands/query/chunk-search.js +12 -46
- package/dist/commands/query/document.d.ts +1 -3
- package/dist/commands/query/document.d.ts.map +1 -1
- package/dist/commands/query/document.js +16 -60
- package/dist/commands/query/search.d.ts +0 -2
- package/dist/commands/query/search.d.ts.map +1 -1
- package/dist/commands/query/search.js +12 -46
- package/dist/feature-catalog.d.ts +28 -0
- package/dist/feature-catalog.d.ts.map +1 -0
- package/dist/feature-catalog.js +104 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -2
- package/oclif.manifest.json +4811 -3433
- package/package.json +3 -3
- package/templates/examples/smartbucket-minimal.ts.hbs +87 -0
- package/templates/examples/smartmemory-minimal.ts.hbs +82 -0
- package/templates/examples/smartsql-minimal.ts.hbs +69 -0
- package/templates/handlers/actor/index.test.ts.hbs +48 -85
- package/templates/handlers/actor/index.ts.hbs +16 -316
- package/templates/handlers/bucket-event-notification/index.ts.hbs +32 -235
- package/templates/handlers/bucket-event-observer.ts.hbs +79 -0
- package/templates/handlers/http-service/index.test.ts.hbs +3 -0
- package/templates/handlers/http-service/index.ts.hbs +43 -15
- package/templates/handlers/queue-consumer-setup.ts.hbs +45 -0
- package/templates/handlers/task/index.test.ts.hbs +30 -112
- package/templates/handlers/task/index.ts.hbs +19 -58
- package/templates/init/RAINDROP.md.hbs +97 -1
- package/templates/init/eslint.config.js +43 -0
- package/templates/init/package.json.hbs +4 -1
- package/templates/init/tsconfig.json +3 -3
- package/bundle/chunk-23UBI7BN.js +0 -48
- package/bundle/chunk-2QWMBNE3.js +0 -384
- package/bundle/chunk-45IYWQDC.js +0 -384
- package/bundle/chunk-5YUO23QU.js +0 -4585
- package/bundle/chunk-6MIGCNUO.js +0 -75
- package/bundle/chunk-7ZJWA6HP.js +0 -805
- package/bundle/chunk-AIYVX2M7.js +0 -44
- package/bundle/chunk-BB5TNIEM.js +0 -48
- package/bundle/chunk-BUR3HFKH.js +0 -488
- package/bundle/chunk-BYSBS7KT.js +0 -488
- package/bundle/chunk-CX3RWI62.js +0 -28658
- package/bundle/chunk-DLH7MI57.js +0 -305
- package/bundle/chunk-E3WJIYJZ.js +0 -12148
- package/bundle/chunk-EX7NOPRF.js +0 -12148
- package/bundle/chunk-F76JQS2J.js +0 -231
- package/bundle/chunk-FBOXMVKD.js +0 -28679
- package/bundle/chunk-FTPZ6SQW.js +0 -238909
- package/bundle/chunk-H3CFZ7ZH.js +0 -74
- package/bundle/chunk-HXOILVWA.js +0 -384
- package/bundle/chunk-IMP7O5AC.js +0 -22452
- package/bundle/chunk-IPYOAKRE.js +0 -231
- package/bundle/chunk-J7HN6XF2.js +0 -4461
- package/bundle/chunk-JOLOAALA.js +0 -231
- package/bundle/chunk-JZ2G4Q35.js +0 -4585
- package/bundle/chunk-KVAWPWF7.js +0 -231
- package/bundle/chunk-MEUAAIXV.js +0 -28657
- package/bundle/chunk-QBWFE57Z.js +0 -384
- package/bundle/chunk-SP3LOXPC.js +0 -46
- package/bundle/chunk-T7C564PR.js +0 -28678
- package/bundle/chunk-UFH545WJ.js +0 -22452
- package/bundle/chunk-UHVMPWM5.js +0 -315
- package/bundle/chunk-VB7ZTSZV.js +0 -1089
- package/bundle/chunk-VBIJDFMJ.js +0 -384
- package/bundle/chunk-VR7RLTE3.js +0 -231
- package/bundle/chunk-WFZUJLEC.js +0 -231
- package/bundle/chunk-YDGJTLVZ.js +0 -133
- package/bundle/chunk-YPNQ7UFK.js +0 -502
- package/bundle/chunk-YXFDRMSN.js +0 -384
- package/dist/lib/dns-utils.d.ts +0 -7
- package/dist/lib/dns-utils.d.ts.map +0 -1
- package/dist/lib/dns-utils.js +0 -44
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-TFQY5TSY.js";
|
|
4
4
|
import {
|
|
5
5
|
init_cjs_shims,
|
|
6
6
|
readState,
|
|
7
7
|
replaceState
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-KLOYSTZY.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/auth/logout.ts
|
|
11
11
|
init_cjs_shims();
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
esm_default3 as esm_default
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-YQCRWPNI.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseCommand
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-TFQY5TSY.js";
|
|
7
7
|
import {
|
|
8
8
|
__toESM,
|
|
9
9
|
init_cjs_shims,
|
|
10
10
|
readState,
|
|
11
11
|
replaceState,
|
|
12
12
|
require_lib
|
|
13
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-KLOYSTZY.js";
|
|
14
14
|
|
|
15
15
|
// src/commands/auth/select.ts
|
|
16
16
|
init_cjs_shims();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-TFQY5TSY.js";
|
|
4
4
|
import {
|
|
5
5
|
CreateCredentialResponseSchema,
|
|
6
6
|
__toESM,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
timestampFromDate,
|
|
11
11
|
toJsonString,
|
|
12
12
|
valueOf
|
|
13
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-KLOYSTZY.js";
|
|
14
14
|
|
|
15
15
|
// src/commands/bucket/create-credential.ts
|
|
16
16
|
init_cjs_shims();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-TFQY5TSY.js";
|
|
4
4
|
import {
|
|
5
5
|
DeleteCredentialResponseSchema,
|
|
6
6
|
__toESM,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
require_lib,
|
|
9
9
|
toJsonString,
|
|
10
10
|
valueOf
|
|
11
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-KLOYSTZY.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/bucket/delete-credential.ts
|
|
14
14
|
init_cjs_shims();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-TFQY5TSY.js";
|
|
4
4
|
import {
|
|
5
5
|
GetCredentialResponseSchema,
|
|
6
6
|
__toESM,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
timestampDate,
|
|
10
10
|
toJsonString,
|
|
11
11
|
valueOf
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-KLOYSTZY.js";
|
|
13
13
|
|
|
14
14
|
// src/commands/bucket/get-credential.ts
|
|
15
15
|
init_cjs_shims();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-TFQY5TSY.js";
|
|
4
4
|
import {
|
|
5
5
|
ListCredentialsResponseSchema,
|
|
6
6
|
__toESM,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
timestampDate,
|
|
10
10
|
toJsonString,
|
|
11
11
|
valueOf
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-KLOYSTZY.js";
|
|
13
13
|
|
|
14
14
|
// src/commands/bucket/list-credentials.ts
|
|
15
15
|
init_cjs_shims();
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TEMPLATES_DIR,
|
|
3
|
+
renderTemplateFromFile
|
|
4
|
+
} from "../../../chunk-L6FRQULN.js";
|
|
5
|
+
import {
|
|
6
|
+
source_default
|
|
7
|
+
} from "../../../chunk-V6J23FL2.js";
|
|
8
|
+
import {
|
|
9
|
+
BaseCommand
|
|
10
|
+
} from "../../../chunk-TFQY5TSY.js";
|
|
11
|
+
import {
|
|
12
|
+
__toESM,
|
|
13
|
+
init_cjs_shims,
|
|
14
|
+
require_lib
|
|
15
|
+
} from "../../../chunk-KLOYSTZY.js";
|
|
16
|
+
|
|
17
|
+
// src/commands/build/actor/setup.ts
|
|
18
|
+
init_cjs_shims();
|
|
19
|
+
var import_core = __toESM(require_lib(), 1);
|
|
20
|
+
import * as fs from "node:fs/promises";
|
|
21
|
+
import * as path from "node:path";
|
|
22
|
+
var ActorSetup = class extends BaseCommand {
|
|
23
|
+
static args = {};
|
|
24
|
+
static description = "Add a stateful actor (Durable Object) to your Raindrop app";
|
|
25
|
+
static examples = [
|
|
26
|
+
`<%= config.bin %> <%= command.id %>
|
|
27
|
+
Add actor with default name "my-actor"
|
|
28
|
+
|
|
29
|
+
<%= config.bin %> <%= command.id %> --name counter
|
|
30
|
+
Add actor with custom name "counter"
|
|
31
|
+
`
|
|
32
|
+
];
|
|
33
|
+
static flags = {
|
|
34
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
35
|
+
name: import_core.Flags.string({
|
|
36
|
+
description: "Name for the actor",
|
|
37
|
+
default: "my-actor"
|
|
38
|
+
}),
|
|
39
|
+
"dry-run": import_core.Flags.boolean({
|
|
40
|
+
description: "Preview changes without applying them",
|
|
41
|
+
default: false
|
|
42
|
+
})
|
|
43
|
+
};
|
|
44
|
+
async run() {
|
|
45
|
+
const actorName = this.flags.name;
|
|
46
|
+
const className = this.toPascalCase(actorName);
|
|
47
|
+
const dryRun = this.flags["dry-run"];
|
|
48
|
+
if (dryRun) {
|
|
49
|
+
this.log(source_default.blue.bold("DRY RUN - Preview of changes (no files will be modified)"));
|
|
50
|
+
this.log("");
|
|
51
|
+
this.log(source_default.blue("Would create:") + " " + source_default.bold(`src/${actorName}/index.ts`));
|
|
52
|
+
this.log(source_default.dim(" - 70 lines of actor code"));
|
|
53
|
+
this.log(source_default.dim(" - State management, counter, data storage"));
|
|
54
|
+
this.log("");
|
|
55
|
+
this.log(source_default.blue("Would update:") + " " + source_default.bold("raindrop.manifest"));
|
|
56
|
+
this.log(source_default.dim(` + actor "${actorName}" {}`));
|
|
57
|
+
this.log("");
|
|
58
|
+
this.log(source_default.blue("Environment binding:") + " " + source_default.bold(`this.env.${className.toUpperCase()}`));
|
|
59
|
+
this.log("");
|
|
60
|
+
this.log(source_default.yellow("Run without --dry-run to apply these changes"));
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
const actorDir = path.join(process.cwd(), "src", actorName);
|
|
65
|
+
await fs.mkdir(actorDir, { recursive: true });
|
|
66
|
+
const actorContent = await this.generateActorFile(className);
|
|
67
|
+
const actorPath = path.join(actorDir, "index.ts");
|
|
68
|
+
await fs.writeFile(actorPath, actorContent);
|
|
69
|
+
this.log(source_default.green("\u2713") + " Created " + source_default.bold(`src/${actorName}/index.ts`));
|
|
70
|
+
await this.updateManifest(actorName);
|
|
71
|
+
this.log(source_default.green("\u2713") + " Updated " + source_default.bold("raindrop.manifest"));
|
|
72
|
+
this.log("");
|
|
73
|
+
this.log(source_default.bold.cyan("Next Steps:"));
|
|
74
|
+
this.log("");
|
|
75
|
+
this.log("1. Run " + source_default.bold("raindrop build generate") + " to update types");
|
|
76
|
+
this.log("2. Check out " + source_default.bold(`src/${actorName}/index.ts`) + " for the actor code");
|
|
77
|
+
this.log("3. Call actor methods from your services:");
|
|
78
|
+
this.log("");
|
|
79
|
+
this.log(source_default.dim("Example usage:"));
|
|
80
|
+
this.log(source_default.dim(` const actorId = this.env.${className.toUpperCase()}.idFromName('user-123');`));
|
|
81
|
+
this.log(source_default.dim(` const actor = this.env.${className.toUpperCase()}.get(actorId);`));
|
|
82
|
+
this.log(source_default.dim(` const count = await actor.increment();`));
|
|
83
|
+
this.log("");
|
|
84
|
+
} catch (error) {
|
|
85
|
+
this.error(`Failed to set up actor: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
toPascalCase(str) {
|
|
89
|
+
return str.split(/[-_]/).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join("");
|
|
90
|
+
}
|
|
91
|
+
async generateActorFile(className) {
|
|
92
|
+
const templatePath = path.join(TEMPLATES_DIR, "handlers", "actor", "index.ts.hbs");
|
|
93
|
+
return renderTemplateFromFile(templatePath, { actorClassName: className });
|
|
94
|
+
}
|
|
95
|
+
async updateManifest(actorName) {
|
|
96
|
+
const manifestPath = path.join(process.cwd(), "raindrop.manifest");
|
|
97
|
+
try {
|
|
98
|
+
let content = await fs.readFile(manifestPath, "utf-8");
|
|
99
|
+
if (content.includes(`actor "${actorName}"`)) {
|
|
100
|
+
this.log(source_default.yellow("\u26A0") + " Actor already exists in manifest");
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const appMatch = content.match(/application\s+"[^"]+"\s+\{/);
|
|
104
|
+
if (appMatch) {
|
|
105
|
+
const insertPos = appMatch.index + appMatch[0].length;
|
|
106
|
+
const binding = `
|
|
107
|
+
actor "${actorName}" {}
|
|
108
|
+
`;
|
|
109
|
+
content = content.slice(0, insertPos) + binding + content.slice(insertPos);
|
|
110
|
+
await fs.writeFile(manifestPath, content);
|
|
111
|
+
} else {
|
|
112
|
+
throw new Error("Could not find application block in raindrop.manifest");
|
|
113
|
+
}
|
|
114
|
+
} catch (error) {
|
|
115
|
+
if (error.code === "ENOENT") {
|
|
116
|
+
throw new Error("raindrop.manifest not found. Are you in a Raindrop project directory?");
|
|
117
|
+
}
|
|
118
|
+
throw error;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
export {
|
|
123
|
+
ActorSetup as default
|
|
124
|
+
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
watchStatus
|
|
3
|
-
} from "../../chunk-5245CEUM.js";
|
|
4
|
-
import "../../chunk-36GNZK4A.js";
|
|
5
1
|
import {
|
|
6
2
|
deploy,
|
|
7
3
|
sandbox
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-DPV5HIG7.js";
|
|
5
|
+
import "../../chunk-MJBLNWG3.js";
|
|
6
|
+
import "../../chunk-JQONDSHY.js";
|
|
7
|
+
import "../../chunk-L6FRQULN.js";
|
|
8
|
+
import {
|
|
9
|
+
watchStatus
|
|
10
|
+
} from "../../chunk-AGG7JZVH.js";
|
|
11
|
+
import "../../chunk-V6J23FL2.js";
|
|
12
12
|
import {
|
|
13
13
|
BaseCommand
|
|
14
|
-
} from "../../chunk-
|
|
14
|
+
} from "../../chunk-TFQY5TSY.js";
|
|
15
15
|
import {
|
|
16
16
|
__toESM,
|
|
17
17
|
init_cjs_shims,
|
|
18
18
|
require_lib
|
|
19
|
-
} from "../../chunk-
|
|
19
|
+
} from "../../chunk-KLOYSTZY.js";
|
|
20
20
|
|
|
21
21
|
// src/commands/build/branch.ts
|
|
22
22
|
init_cjs_shims();
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TEMPLATES_DIR,
|
|
3
|
+
renderTemplateFromFile
|
|
4
|
+
} from "../../../chunk-L6FRQULN.js";
|
|
5
|
+
import {
|
|
6
|
+
source_default
|
|
7
|
+
} from "../../../chunk-V6J23FL2.js";
|
|
8
|
+
import {
|
|
9
|
+
BaseCommand
|
|
10
|
+
} from "../../../chunk-TFQY5TSY.js";
|
|
11
|
+
import {
|
|
12
|
+
__toESM,
|
|
13
|
+
init_cjs_shims,
|
|
14
|
+
require_lib
|
|
15
|
+
} from "../../../chunk-KLOYSTZY.js";
|
|
16
|
+
|
|
17
|
+
// src/commands/build/bucket-events/setup.ts
|
|
18
|
+
init_cjs_shims();
|
|
19
|
+
var import_core = __toESM(require_lib(), 1);
|
|
20
|
+
import * as fs from "node:fs/promises";
|
|
21
|
+
import * as path from "node:path";
|
|
22
|
+
var BucketEventsSetup = class extends BaseCommand {
|
|
23
|
+
static args = {};
|
|
24
|
+
static description = "Add bucket event notifications (observer) to your Raindrop app";
|
|
25
|
+
static examples = [
|
|
26
|
+
`<%= config.bin %> <%= command.id %>
|
|
27
|
+
Add bucket event observer with default names
|
|
28
|
+
|
|
29
|
+
<%= config.bin %> <%= command.id %> --bucket uploads --observer file-processor
|
|
30
|
+
Add bucket event observer with custom names
|
|
31
|
+
`
|
|
32
|
+
];
|
|
33
|
+
static flags = {
|
|
34
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
35
|
+
bucket: import_core.Flags.string({
|
|
36
|
+
description: "Name of the bucket to watch",
|
|
37
|
+
default: "my-bucket"
|
|
38
|
+
}),
|
|
39
|
+
observer: import_core.Flags.string({
|
|
40
|
+
description: "Name for the event observer",
|
|
41
|
+
default: "bucket-events"
|
|
42
|
+
}),
|
|
43
|
+
"dry-run": import_core.Flags.boolean({
|
|
44
|
+
description: "Preview changes without applying them",
|
|
45
|
+
default: false
|
|
46
|
+
})
|
|
47
|
+
};
|
|
48
|
+
async run() {
|
|
49
|
+
const bucketName = this.flags.bucket;
|
|
50
|
+
const observerName = this.flags.observer;
|
|
51
|
+
const dryRun = this.flags["dry-run"];
|
|
52
|
+
if (dryRun) {
|
|
53
|
+
this.log(source_default.blue.bold("DRY RUN - Preview of changes (no files will be modified)"));
|
|
54
|
+
this.log("");
|
|
55
|
+
this.log(source_default.blue("Would create:") + " " + source_default.bold(`src/${observerName}/index.ts`));
|
|
56
|
+
this.log(source_default.dim(" - 68 lines of bucket event handler code"));
|
|
57
|
+
this.log(source_default.dim(" - Upload, delete, multipart event handling"));
|
|
58
|
+
this.log("");
|
|
59
|
+
this.log(source_default.blue("Would update:") + " " + source_default.bold("raindrop.manifest"));
|
|
60
|
+
this.log(source_default.dim(` + bucket "${bucketName}" {} (if not exists)`));
|
|
61
|
+
this.log(source_default.dim(` + observer "${observerName}" {`));
|
|
62
|
+
this.log(source_default.dim(` source { bucket = "${bucketName}" ... }`));
|
|
63
|
+
this.log(source_default.dim(` }`));
|
|
64
|
+
this.log("");
|
|
65
|
+
this.log(source_default.blue("Environment binding:") + " " + source_default.bold(`this.env.${bucketName.toUpperCase().replace(/-/g, "_")}`));
|
|
66
|
+
this.log("");
|
|
67
|
+
this.log(source_default.yellow("Run without --dry-run to apply these changes"));
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
const observerDir = path.join(process.cwd(), "src", observerName);
|
|
72
|
+
await fs.mkdir(observerDir, { recursive: true });
|
|
73
|
+
const observerContent = await this.generateObserverFile(bucketName);
|
|
74
|
+
const observerPath = path.join(observerDir, "index.ts");
|
|
75
|
+
await fs.writeFile(observerPath, observerContent);
|
|
76
|
+
this.log(source_default.green("\u2713") + " Created " + source_default.bold(`src/${observerName}/index.ts`));
|
|
77
|
+
await this.updateManifest(bucketName, observerName);
|
|
78
|
+
this.log(source_default.green("\u2713") + " Updated " + source_default.bold("raindrop.manifest"));
|
|
79
|
+
this.log("");
|
|
80
|
+
this.log(source_default.bold.cyan("Next Steps:"));
|
|
81
|
+
this.log("");
|
|
82
|
+
this.log("1. Run " + source_default.bold("raindrop build generate") + " to update types");
|
|
83
|
+
this.log("2. Check out " + source_default.bold(`src/${observerName}/index.ts`) + " for the event handler");
|
|
84
|
+
this.log("3. Ensure the bucket exists in your manifest:");
|
|
85
|
+
this.log("");
|
|
86
|
+
this.log(source_default.dim(` bucket "${bucketName}" {}`));
|
|
87
|
+
this.log("");
|
|
88
|
+
this.log("4. Upload files to the bucket to trigger events:");
|
|
89
|
+
this.log("");
|
|
90
|
+
this.log(source_default.dim(` await this.env.${bucketName.toUpperCase().replace(/-/g, "_")}.put('file.txt', data);`));
|
|
91
|
+
this.log("");
|
|
92
|
+
} catch (error) {
|
|
93
|
+
this.error(`Failed to set up bucket events: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async generateObserverFile(bucketName) {
|
|
97
|
+
const templatePath = path.join(TEMPLATES_DIR, "handlers", "bucket-event-observer.ts.hbs");
|
|
98
|
+
return renderTemplateFromFile(templatePath, { bucketName });
|
|
99
|
+
}
|
|
100
|
+
async updateManifest(bucketName, observerName) {
|
|
101
|
+
const manifestPath = path.join(process.cwd(), "raindrop.manifest");
|
|
102
|
+
try {
|
|
103
|
+
let content = await fs.readFile(manifestPath, "utf-8");
|
|
104
|
+
if (content.includes(`observer "${observerName}"`)) {
|
|
105
|
+
this.log(source_default.yellow("\u26A0") + " Observer already exists in manifest");
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const hasBucket = content.includes(`bucket "${bucketName}"`);
|
|
109
|
+
const appMatch = content.match(/application\s+"[^"]+"\s+\{/);
|
|
110
|
+
if (appMatch) {
|
|
111
|
+
const insertPos = appMatch.index + appMatch[0].length;
|
|
112
|
+
let binding = "";
|
|
113
|
+
if (!hasBucket) {
|
|
114
|
+
binding += `
|
|
115
|
+
bucket "${bucketName}" {}
|
|
116
|
+
`;
|
|
117
|
+
this.log(source_default.green("\u2713") + " Added bucket to manifest");
|
|
118
|
+
}
|
|
119
|
+
binding += `
|
|
120
|
+
observer "${observerName}" {
|
|
121
|
+
source {
|
|
122
|
+
bucket = "${bucketName}"
|
|
123
|
+
max_retries = 5
|
|
124
|
+
batch_size = 1
|
|
125
|
+
rule {
|
|
126
|
+
actions = ["PutObject", "DeleteObject"]
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
`;
|
|
131
|
+
content = content.slice(0, insertPos) + binding + content.slice(insertPos);
|
|
132
|
+
await fs.writeFile(manifestPath, content);
|
|
133
|
+
} else {
|
|
134
|
+
throw new Error("Could not find application block in raindrop.manifest");
|
|
135
|
+
}
|
|
136
|
+
} catch (error) {
|
|
137
|
+
if (error.code === "ENOENT") {
|
|
138
|
+
throw new Error("raindrop.manifest not found. Are you in a Raindrop project directory?");
|
|
139
|
+
}
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
export {
|
|
145
|
+
BucketEventsSetup as default
|
|
146
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
esm_default3 as esm_default
|
|
3
|
-
} from "../../chunk-6BT265R3.js";
|
|
4
1
|
import {
|
|
5
2
|
statusString
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-3CMR7ES5.js";
|
|
4
|
+
import "../../chunk-V54KHS5B.js";
|
|
8
5
|
import {
|
|
9
6
|
source_default
|
|
10
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-V6J23FL2.js";
|
|
8
|
+
import {
|
|
9
|
+
esm_default3 as esm_default
|
|
10
|
+
} from "../../chunk-YQCRWPNI.js";
|
|
11
11
|
import {
|
|
12
12
|
BaseCommand
|
|
13
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-TFQY5TSY.js";
|
|
14
14
|
import {
|
|
15
15
|
EPOCH_TS,
|
|
16
16
|
UnitState,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
require_lib,
|
|
20
20
|
timestampDate,
|
|
21
21
|
valueOf
|
|
22
|
-
} from "../../chunk-
|
|
22
|
+
} from "../../chunk-KLOYSTZY.js";
|
|
23
23
|
|
|
24
24
|
// src/commands/build/checkout.ts
|
|
25
25
|
init_cjs_shims();
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
esm_default
|
|
3
|
-
} from "../../chunk-6BT265R3.js";
|
|
4
1
|
import {
|
|
5
2
|
codegenPlan,
|
|
6
3
|
fileExists,
|
|
7
4
|
renderCodegenPlan
|
|
8
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-L6FRQULN.js";
|
|
6
|
+
import {
|
|
7
|
+
esm_default
|
|
8
|
+
} from "../../chunk-YQCRWPNI.js";
|
|
9
9
|
import {
|
|
10
10
|
$,
|
|
11
11
|
BaseCommand,
|
|
12
12
|
spinner
|
|
13
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-TFQY5TSY.js";
|
|
14
14
|
import {
|
|
15
15
|
__toESM,
|
|
16
16
|
getFrameworkVersion,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
mustManifestFromString,
|
|
19
19
|
readState,
|
|
20
20
|
require_lib
|
|
21
|
-
} from "../../chunk-
|
|
21
|
+
} from "../../chunk-KLOYSTZY.js";
|
|
22
22
|
|
|
23
23
|
// src/commands/build/clone.ts
|
|
24
24
|
init_cjs_shims();
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
esm_default3 as esm_default
|
|
3
|
-
} from "../../chunk-6BT265R3.js";
|
|
4
1
|
import {
|
|
5
2
|
statusString
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-3CMR7ES5.js";
|
|
4
|
+
import "../../chunk-V54KHS5B.js";
|
|
8
5
|
import {
|
|
9
6
|
source_default
|
|
10
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-V6J23FL2.js";
|
|
8
|
+
import {
|
|
9
|
+
esm_default3 as esm_default
|
|
10
|
+
} from "../../chunk-YQCRWPNI.js";
|
|
11
11
|
import {
|
|
12
12
|
BaseCommand
|
|
13
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-TFQY5TSY.js";
|
|
14
14
|
import {
|
|
15
15
|
EPOCH_TS,
|
|
16
16
|
UnitState,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
require_lib,
|
|
20
20
|
timestampDate,
|
|
21
21
|
valueOf
|
|
22
|
-
} from "../../chunk-
|
|
22
|
+
} from "../../chunk-KLOYSTZY.js";
|
|
23
23
|
|
|
24
24
|
// src/commands/build/delete.ts
|
|
25
25
|
init_cjs_shims();
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
watchStatus
|
|
3
|
-
} from "../../chunk-5245CEUM.js";
|
|
4
|
-
import "../../chunk-36GNZK4A.js";
|
|
5
1
|
import {
|
|
6
2
|
deploy,
|
|
7
3
|
sandbox
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-DPV5HIG7.js";
|
|
5
|
+
import "../../chunk-MJBLNWG3.js";
|
|
6
|
+
import "../../chunk-JQONDSHY.js";
|
|
7
|
+
import "../../chunk-L6FRQULN.js";
|
|
8
|
+
import {
|
|
9
|
+
watchStatus
|
|
10
|
+
} from "../../chunk-AGG7JZVH.js";
|
|
11
|
+
import "../../chunk-V6J23FL2.js";
|
|
12
12
|
import {
|
|
13
13
|
BaseCommand
|
|
14
|
-
} from "../../chunk-
|
|
14
|
+
} from "../../chunk-TFQY5TSY.js";
|
|
15
15
|
import {
|
|
16
16
|
__toESM,
|
|
17
17
|
init_cjs_shims,
|
|
18
18
|
require_lib
|
|
19
|
-
} from "../../chunk-
|
|
19
|
+
} from "../../chunk-KLOYSTZY.js";
|
|
20
20
|
|
|
21
21
|
// src/commands/build/deploy.ts
|
|
22
22
|
init_cjs_shims();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseEnvVar
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-KXHVSLAI.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseCommand
|
|
6
|
-
} from "../../../chunk-
|
|
6
|
+
} from "../../../chunk-TFQY5TSY.js";
|
|
7
7
|
import {
|
|
8
8
|
__toESM,
|
|
9
9
|
init_cjs_shims,
|
|
10
10
|
require_lib,
|
|
11
11
|
valueOf
|
|
12
|
-
} from "../../../chunk-
|
|
12
|
+
} from "../../../chunk-KLOYSTZY.js";
|
|
13
13
|
|
|
14
14
|
// src/commands/build/env/get.ts
|
|
15
15
|
init_cjs_shims();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-TFQY5TSY.js";
|
|
4
4
|
import {
|
|
5
5
|
__toESM,
|
|
6
6
|
init_cjs_shims,
|
|
7
7
|
listEnvVars,
|
|
8
8
|
require_lib,
|
|
9
9
|
valueOf
|
|
10
|
-
} from "../../../chunk-
|
|
10
|
+
} from "../../../chunk-KLOYSTZY.js";
|
|
11
11
|
|
|
12
12
|
// src/commands/build/env/list.ts
|
|
13
13
|
init_cjs_shims();
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseEnvVar
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-KXHVSLAI.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseCommand
|
|
6
|
-
} from "../../../chunk-
|
|
6
|
+
} from "../../../chunk-TFQY5TSY.js";
|
|
7
7
|
import {
|
|
8
8
|
__toESM,
|
|
9
9
|
init_cjs_shims,
|
|
10
10
|
require_lib,
|
|
11
11
|
valueOf
|
|
12
|
-
} from "../../../chunk-
|
|
12
|
+
} from "../../../chunk-KLOYSTZY.js";
|
|
13
13
|
|
|
14
14
|
// src/commands/build/env/set.ts
|
|
15
15
|
init_cjs_shims();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseCommand
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-TFQY5TSY.js";
|
|
4
4
|
import {
|
|
5
5
|
__toESM,
|
|
6
6
|
init_cjs_shims,
|
|
7
7
|
require_lib
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-KLOYSTZY.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/build/env.ts
|
|
11
11
|
init_cjs_shims();
|