@liquidmetal-ai/raindrop 0.7.0 → 0.8.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 +408 -73
- package/bin/cjs-shims.js +7 -0
- package/bin/run.js +20 -2
- package/bundle/chunk-5GH4FS6C.js +12148 -0
- package/bundle/chunk-6B4I2CKP.js +231 -0
- package/bundle/chunk-6UE75KX2.js +4481 -0
- package/bundle/chunk-AU3EGGJP.js +44 -0
- package/bundle/chunk-CDQRD3JA.js +75 -0
- package/bundle/chunk-CMCEP64V.js +380 -0
- package/bundle/chunk-CW5ZHVPX.js +292 -0
- package/bundle/chunk-G6NE675D.js +238720 -0
- package/bundle/chunk-GLIYVKQA.js +48 -0
- package/bundle/chunk-KXEV6E63.js +133 -0
- package/bundle/chunk-MCRKUPJY.js +4515 -0
- package/bundle/chunk-MGM2L2T3.js +805 -0
- package/bundle/chunk-MVQYQJHI.js +502 -0
- package/bundle/chunk-NG7CZTTE.js +147 -0
- package/bundle/chunk-PU4RCSXF.js +22452 -0
- package/bundle/chunk-VXAZKB3J.js +292 -0
- package/bundle/chunk-W2L3MYN6.js +4480 -0
- package/bundle/chunk-XYJACVNA.js +231 -0
- package/bundle/commands/annotation/get.js +153 -0
- package/bundle/commands/annotation/list.js +226 -0
- package/bundle/commands/annotation/put.js +177 -0
- package/bundle/commands/auth/list.js +75 -0
- package/bundle/commands/auth/login.js +1654 -0
- package/bundle/commands/auth/logout.js +27 -0
- package/bundle/commands/auth/select.js +53 -0
- package/bundle/commands/bucket/create-credential.js +173 -0
- package/bundle/commands/bucket/delete-credential.js +140 -0
- package/bundle/commands/bucket/get-credential.js +151 -0
- package/bundle/commands/bucket/list-credentials.js +148 -0
- package/bundle/commands/build/branch.js +126 -0
- package/bundle/commands/build/checkout.js +198 -0
- package/bundle/commands/build/clone.js +153 -0
- package/bundle/commands/build/delete.js +227 -0
- package/bundle/commands/build/deploy.js +160 -0
- package/bundle/commands/build/env/get.js +105 -0
- package/bundle/commands/build/env/set.js +115 -0
- package/bundle/commands/build/find.js +333 -0
- package/bundle/commands/build/generate.js +75 -0
- package/bundle/commands/build/init.js +76 -0
- package/bundle/commands/build/list.js +11 -0
- package/bundle/commands/build/sandbox.js +65 -0
- package/bundle/commands/build/start.js +84 -0
- package/bundle/commands/build/status.js +1839 -0
- package/bundle/commands/build/stop.js +84 -0
- package/bundle/commands/build/tools/check.js +32 -0
- package/bundle/commands/build/tools/fmt.js +49 -0
- package/bundle/commands/build/unsandbox.js +65 -0
- package/bundle/commands/build/upload.js +83 -0
- package/bundle/commands/build/validate.js +71 -0
- package/bundle/commands/build/workos/delete.js +86 -0
- package/bundle/commands/build/workos/env/attach.js +134 -0
- package/bundle/commands/build/workos/env/create.js +176 -0
- package/bundle/commands/build/workos/env/delete.js +84 -0
- package/bundle/commands/build/workos/env/detach.js +115 -0
- package/bundle/commands/build/workos/env/get.js +117 -0
- package/bundle/commands/build/workos/env/list.js +139 -0
- package/bundle/commands/build/workos/env/set.js +138 -0
- package/bundle/commands/build/workos/invite.js +91 -0
- package/bundle/commands/build/workos/setup.js +124 -0
- package/bundle/commands/build/workos/status.js +93 -0
- package/bundle/commands/dns/create.js +128 -0
- package/bundle/commands/dns/delete.js +80 -0
- package/bundle/commands/dns/get.js +167 -0
- package/bundle/commands/dns/list.js +193 -0
- package/bundle/commands/dns/records/create.js +150 -0
- package/bundle/commands/dns/records/delete.js +76 -0
- package/bundle/commands/dns/records/get.js +118 -0
- package/bundle/commands/dns/records/list.js +153 -0
- package/bundle/commands/dns/records/update.js +146 -0
- package/bundle/commands/logs/query.js +237 -0
- package/bundle/commands/logs/tail.js +155 -0
- package/bundle/commands/mcp/install-claude.js +220 -0
- package/bundle/commands/mcp/install-gemini.js +220 -0
- package/bundle/commands/mcp/install-goose.js +232 -0
- package/bundle/commands/mcp/status.js +153 -0
- package/bundle/commands/object/delete.js +180 -0
- package/bundle/commands/object/get.js +209 -0
- package/bundle/commands/object/list.js +206 -0
- package/bundle/commands/object/put.js +211 -0
- package/bundle/commands/query/chunk-search.js +123 -0
- package/bundle/commands/query/document.js +126 -0
- package/bundle/commands/query/events.js +98 -0
- package/bundle/commands/query/reindex.js +147 -0
- package/bundle/commands/query/search.js +169 -0
- package/bundle/commands/tail.js +31 -0
- package/bundle/index.js +51 -0
- package/dist/base-command.d.ts +6 -0
- package/dist/base-command.d.ts.map +1 -1
- package/dist/base-command.js +14 -1
- package/dist/build.d.ts +2 -1
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +169 -51
- package/dist/codegen.d.ts +1 -1
- package/dist/codegen.d.ts.map +1 -1
- package/dist/codegen.js +17 -3
- package/dist/codegen.test.js +44 -0
- package/dist/commands/build/checkout.d.ts.map +1 -1
- package/dist/commands/build/checkout.js +4 -0
- package/dist/commands/build/delete.d.ts.map +1 -1
- package/dist/commands/build/delete.js +6 -3
- package/dist/commands/build/deploy.d.ts.map +1 -1
- package/dist/commands/build/deploy.js +10 -2
- package/dist/commands/build/find.d.ts +1 -0
- package/dist/commands/build/find.d.ts.map +1 -1
- package/dist/commands/build/find.js +33 -2
- package/dist/commands/build/validate.d.ts.map +1 -1
- package/dist/commands/build/validate.js +0 -1
- package/dist/commands/build/workos/delete.d.ts +18 -0
- package/dist/commands/build/workos/delete.d.ts.map +1 -0
- package/dist/commands/build/workos/delete.js +72 -0
- package/dist/commands/build/workos/env/attach.d.ts +24 -0
- package/dist/commands/build/workos/env/attach.d.ts.map +1 -0
- package/dist/commands/build/workos/env/attach.js +111 -0
- package/dist/commands/build/workos/env/create.d.ts +26 -0
- package/dist/commands/build/workos/env/create.d.ts.map +1 -0
- package/dist/commands/build/workos/env/create.js +156 -0
- package/dist/commands/build/workos/env/delete.d.ts +20 -0
- package/dist/commands/build/workos/env/delete.d.ts.map +1 -0
- package/dist/commands/build/workos/env/delete.js +61 -0
- package/dist/commands/build/workos/env/detach.d.ts +21 -0
- package/dist/commands/build/workos/env/detach.d.ts.map +1 -0
- package/dist/commands/build/workos/env/detach.js +94 -0
- package/dist/commands/build/workos/env/get.d.ts +20 -0
- package/dist/commands/build/workos/env/get.d.ts.map +1 -0
- package/dist/commands/build/workos/env/get.js +94 -0
- package/dist/commands/build/workos/env/list.d.ts +18 -0
- package/dist/commands/build/workos/env/list.d.ts.map +1 -0
- package/dist/commands/build/workos/env/list.js +114 -0
- package/dist/commands/build/workos/env/set.d.ts +27 -0
- package/dist/commands/build/workos/env/set.d.ts.map +1 -0
- package/dist/commands/build/workos/env/set.js +115 -0
- package/dist/commands/build/workos/invite.d.ts +21 -0
- package/dist/commands/build/workos/invite.d.ts.map +1 -0
- package/dist/commands/build/workos/invite.js +68 -0
- package/dist/commands/build/workos/setup.d.ts +20 -0
- package/dist/commands/build/workos/setup.d.ts.map +1 -0
- package/dist/commands/build/workos/setup.js +106 -0
- package/dist/commands/build/workos/status.d.ts +18 -0
- package/dist/commands/build/workos/status.d.ts.map +1 -0
- package/dist/commands/build/workos/status.js +70 -0
- package/dist/commands/mcp/install-claude.d.ts.map +1 -1
- package/dist/commands/mcp/install-claude.js +0 -2
- package/dist/commands/mcp/install-gemini.d.ts.map +1 -1
- package/dist/commands/mcp/install-gemini.js +0 -2
- package/dist/commands/mcp/install-goose.d.ts.map +1 -1
- package/dist/commands/mcp/install-goose.js +0 -2
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/oclif.manifest.json +4544 -2466
- package/package.json +8 -5
- package/templates/claude-code/debug-raindrop-app.md +89 -0
- package/templates/claude-code/new-raindrop-app.md +10 -6
- package/templates/claude-code/reattach-raindrop-session.md +50 -12
- package/templates/claude-code/update-raindrop-app.md +61 -9
- package/templates/db/node_modules/.bin/prisma +2 -2
- package/templates/db/node_modules/.bin/prisma-kysely +2 -2
- package/templates/db/node_modules/.bin/tsc +2 -2
- package/templates/db/node_modules/.bin/tsserver +2 -2
- package/templates/db/node_modules/.bin/zx +2 -2
- package/templates/gemini-code/debug-raindrop-app.toml +86 -0
- package/templates/gemini-code/new-raindrop-app.toml +9 -5
- package/templates/gemini-code/reattach-raindrop-session.toml +9 -11
- package/templates/gemini-code/update-raindrop-app.toml +55 -10
- package/templates/goose/debug-raindrop-app.yaml +91 -0
- package/templates/goose/new-raindrop-app.yaml +12 -7
- package/templates/goose/reattach-raindrop-session.yaml +11 -4
- package/templates/goose/update-raindrop-app.yaml +57 -5
- package/templates/init/src/_app/auth.ts +18 -0
- package/templates/init/src/_app/cors.ts +64 -0
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/templates/claude-code/raindrop-guidelines.md +0 -322
- package/templates/gemini-code/raindrop-guidelines.md +0 -322
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseCommand
|
|
3
|
+
} from "../../chunk-MCRKUPJY.js";
|
|
4
|
+
import {
|
|
5
|
+
init_cjs_shims,
|
|
6
|
+
readState,
|
|
7
|
+
replaceState
|
|
8
|
+
} from "../../chunk-G6NE675D.js";
|
|
9
|
+
|
|
10
|
+
// src/commands/auth/logout.ts
|
|
11
|
+
init_cjs_shims();
|
|
12
|
+
var Logout = class extends BaseCommand {
|
|
13
|
+
static args = {};
|
|
14
|
+
static description = "Logout authentications";
|
|
15
|
+
static flags = {};
|
|
16
|
+
async run() {
|
|
17
|
+
const state = await readState(this.config.configDir);
|
|
18
|
+
if (state.currentOrganizationId) {
|
|
19
|
+
delete state.organizationIdToBearerToken[state.currentOrganizationId];
|
|
20
|
+
state.currentOrganizationId = void 0;
|
|
21
|
+
}
|
|
22
|
+
await replaceState(this.config.configDir, state);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
Logout as default
|
|
27
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
esm_default2 as esm_default
|
|
3
|
+
} from "../../chunk-5GH4FS6C.js";
|
|
4
|
+
import {
|
|
5
|
+
BaseCommand
|
|
6
|
+
} from "../../chunk-MCRKUPJY.js";
|
|
7
|
+
import {
|
|
8
|
+
__toESM,
|
|
9
|
+
init_cjs_shims,
|
|
10
|
+
readState,
|
|
11
|
+
replaceState,
|
|
12
|
+
require_lib
|
|
13
|
+
} from "../../chunk-G6NE675D.js";
|
|
14
|
+
|
|
15
|
+
// src/commands/auth/select.ts
|
|
16
|
+
init_cjs_shims();
|
|
17
|
+
var import_core = __toESM(require_lib(), 1);
|
|
18
|
+
var Select = class extends BaseCommand {
|
|
19
|
+
static args = {};
|
|
20
|
+
static description = "Select active organization";
|
|
21
|
+
static flags = {
|
|
22
|
+
organizationId: import_core.Flags.string({
|
|
23
|
+
description: "organizationId to select as active"
|
|
24
|
+
})
|
|
25
|
+
};
|
|
26
|
+
async run() {
|
|
27
|
+
const state = await readState(this.config.configDir);
|
|
28
|
+
let organizationId = this.flags.organizationId;
|
|
29
|
+
if (!organizationId) {
|
|
30
|
+
if (Object.entries(state.organizationIdToBearerToken).length === 0) {
|
|
31
|
+
this.error(`no organizations are authorized. see raindrop auth login.`);
|
|
32
|
+
}
|
|
33
|
+
organizationId = await esm_default({
|
|
34
|
+
message: "Select an organization",
|
|
35
|
+
default: state.currentOrganizationId,
|
|
36
|
+
choices: Object.entries(state.organizationIdToBearerToken).map(([_, token]) => {
|
|
37
|
+
return {
|
|
38
|
+
name: `${token.userEmail} - ${token.organizationName}`,
|
|
39
|
+
value: token.organizationId
|
|
40
|
+
};
|
|
41
|
+
}).sort((a, b) => a.name.localeCompare(b.name))
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (!state.organizationIdToBearerToken[organizationId]) {
|
|
45
|
+
this.error(`${organizationId} not authenticated`);
|
|
46
|
+
}
|
|
47
|
+
state.currentOrganizationId = organizationId;
|
|
48
|
+
await replaceState(this.config.configDir, state);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
Select as default
|
|
53
|
+
};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseCommand
|
|
3
|
+
} from "../../chunk-MCRKUPJY.js";
|
|
4
|
+
import {
|
|
5
|
+
CreateCredentialResponseSchema,
|
|
6
|
+
__toESM,
|
|
7
|
+
init_cjs_shims,
|
|
8
|
+
require_lib,
|
|
9
|
+
timestampDate,
|
|
10
|
+
timestampFromDate,
|
|
11
|
+
toJsonString,
|
|
12
|
+
valueOf
|
|
13
|
+
} from "../../chunk-G6NE675D.js";
|
|
14
|
+
|
|
15
|
+
// src/commands/bucket/create-credential.ts
|
|
16
|
+
init_cjs_shims();
|
|
17
|
+
var import_core = __toESM(require_lib(), 1);
|
|
18
|
+
var CreateCredential = class _CreateCredential extends BaseCommand {
|
|
19
|
+
static description = "Create S3 credentials for a bucket";
|
|
20
|
+
static examples = [
|
|
21
|
+
`<%= config.bin %> bucket create-credential --bucket my-bucket --name "My API Key"
|
|
22
|
+
Create a new S3 credential for my-bucket
|
|
23
|
+
`,
|
|
24
|
+
`<%= config.bin %> bucket create-credential --bucket my-bucket --name "Temp Key" --expires-at "2024-12-31"
|
|
25
|
+
Create a credential that expires on Dec 31, 2024
|
|
26
|
+
`,
|
|
27
|
+
`<%= config.bin %> bucket create-credential --api-url https://bucket.example.com --name "Direct API Key"
|
|
28
|
+
Create a credential using a direct API URL
|
|
29
|
+
`
|
|
30
|
+
];
|
|
31
|
+
static flags = {
|
|
32
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
33
|
+
bucket: import_core.Flags.string({
|
|
34
|
+
char: "b",
|
|
35
|
+
description: "bucket name",
|
|
36
|
+
required: false,
|
|
37
|
+
exclusive: ["api-url"]
|
|
38
|
+
}),
|
|
39
|
+
name: import_core.Flags.string({
|
|
40
|
+
char: "n",
|
|
41
|
+
description: "credential name",
|
|
42
|
+
required: true
|
|
43
|
+
}),
|
|
44
|
+
"expires-at": import_core.Flags.string({
|
|
45
|
+
description: "expiration date (ISO 8601 format)",
|
|
46
|
+
required: false
|
|
47
|
+
}),
|
|
48
|
+
"api-url": import_core.Flags.string({
|
|
49
|
+
description: "direct API URL (bypasses bucket discovery)",
|
|
50
|
+
required: false,
|
|
51
|
+
exclusive: ["bucket", "application", "version"]
|
|
52
|
+
}),
|
|
53
|
+
application: import_core.Flags.string({
|
|
54
|
+
char: "a",
|
|
55
|
+
description: "application name",
|
|
56
|
+
required: false,
|
|
57
|
+
exclusive: ["api-url"]
|
|
58
|
+
}),
|
|
59
|
+
version: import_core.Flags.string({
|
|
60
|
+
char: "v",
|
|
61
|
+
description: "application version",
|
|
62
|
+
required: false,
|
|
63
|
+
exclusive: ["api-url"]
|
|
64
|
+
}),
|
|
65
|
+
output: import_core.Flags.string({
|
|
66
|
+
char: "o",
|
|
67
|
+
description: "output format",
|
|
68
|
+
default: "text",
|
|
69
|
+
options: ["text", "json"]
|
|
70
|
+
}),
|
|
71
|
+
impersonate: import_core.Flags.string({
|
|
72
|
+
char: "i",
|
|
73
|
+
description: "impersonate organization",
|
|
74
|
+
required: false,
|
|
75
|
+
hidden: true
|
|
76
|
+
}),
|
|
77
|
+
manifest: import_core.Flags.string({
|
|
78
|
+
char: "M",
|
|
79
|
+
description: "project manifest",
|
|
80
|
+
required: false,
|
|
81
|
+
default: "raindrop.manifest",
|
|
82
|
+
hidden: true
|
|
83
|
+
})
|
|
84
|
+
};
|
|
85
|
+
async run() {
|
|
86
|
+
const { flags } = await this.parse(_CreateCredential);
|
|
87
|
+
if (!flags["api-url"] && !flags.bucket) {
|
|
88
|
+
this.error("Either --api-url or --bucket must be specified");
|
|
89
|
+
}
|
|
90
|
+
let apiUrl;
|
|
91
|
+
let bucketName;
|
|
92
|
+
if (flags["api-url"]) {
|
|
93
|
+
apiUrl = flags["api-url"];
|
|
94
|
+
} else {
|
|
95
|
+
bucketName = flags.bucket;
|
|
96
|
+
let applicationName = flags.application;
|
|
97
|
+
let applicationVersionId = flags.version;
|
|
98
|
+
if (!applicationVersionId) {
|
|
99
|
+
const config = await this.loadConfig();
|
|
100
|
+
applicationVersionId = config.versionId;
|
|
101
|
+
}
|
|
102
|
+
if (!applicationName) {
|
|
103
|
+
const apps = await this.loadManifest();
|
|
104
|
+
const app = apps[0];
|
|
105
|
+
if (app === void 0) {
|
|
106
|
+
this.error("No application provided or found in manifest", { exit: 1 });
|
|
107
|
+
}
|
|
108
|
+
applicationName = valueOf(app.name);
|
|
109
|
+
}
|
|
110
|
+
const { client: catalogService, userId, organizationId: defaultOrganizationId } = await this.catalogService();
|
|
111
|
+
const organizationId = flags.impersonate ?? defaultOrganizationId;
|
|
112
|
+
const modulesResp = await catalogService.queryModules({
|
|
113
|
+
userId,
|
|
114
|
+
applicationName,
|
|
115
|
+
applicationVersionId,
|
|
116
|
+
organizationId,
|
|
117
|
+
moduleType: "bucket"
|
|
118
|
+
});
|
|
119
|
+
const bucketModule = modulesResp.modules.find((m) => m.name === bucketName && m.type === "bucket");
|
|
120
|
+
if (!bucketModule) {
|
|
121
|
+
this.error(`Bucket '${bucketName}' not found in application ${applicationName}@${applicationVersionId}`);
|
|
122
|
+
}
|
|
123
|
+
apiUrl = bucketModule.bucket?.s3?.apiUrl;
|
|
124
|
+
if (!apiUrl) {
|
|
125
|
+
this.error(`Bucket '${bucketName}' does not have an API URL configured`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
let expiresAt;
|
|
129
|
+
if (flags["expires-at"]) {
|
|
130
|
+
const expiresDate = new Date(flags["expires-at"]);
|
|
131
|
+
if (isNaN(expiresDate.getTime())) {
|
|
132
|
+
this.error("Invalid expiration date format. Use ISO 8601 format (e.g., 2024-12-31 or 2024-12-31T23:59:59Z)");
|
|
133
|
+
}
|
|
134
|
+
if (expiresDate <= /* @__PURE__ */ new Date()) {
|
|
135
|
+
this.error("Expiration date must be in the future");
|
|
136
|
+
}
|
|
137
|
+
expiresAt = timestampFromDate(expiresDate);
|
|
138
|
+
}
|
|
139
|
+
const { client: credentialService } = await this.bucketApiService(apiUrl);
|
|
140
|
+
try {
|
|
141
|
+
const response = await credentialService.createCredential({
|
|
142
|
+
name: flags.name,
|
|
143
|
+
expiresAt
|
|
144
|
+
});
|
|
145
|
+
if (flags.output === "json") {
|
|
146
|
+
console.log(toJsonString(CreateCredentialResponseSchema, response, { prettySpaces: 2 }));
|
|
147
|
+
} else {
|
|
148
|
+
const cred = response.credential;
|
|
149
|
+
if (!cred) {
|
|
150
|
+
this.error("No credential returned from service");
|
|
151
|
+
}
|
|
152
|
+
console.log(`Successfully created S3 credential${bucketName ? ` for bucket '${bucketName}'` : ""}`);
|
|
153
|
+
console.log(`
|
|
154
|
+
Access Key: ${cred.accessKey}`);
|
|
155
|
+
console.log(`Secret Key: ${cred.secretKey}`);
|
|
156
|
+
console.log(`Name: ${cred.name}`);
|
|
157
|
+
if (cred.createdAt) {
|
|
158
|
+
console.log(`Created: ${timestampDate(cred.createdAt).toISOString()}`);
|
|
159
|
+
}
|
|
160
|
+
if (cred.expiresAt) {
|
|
161
|
+
console.log(`Expires: ${timestampDate(cred.expiresAt).toISOString()}`);
|
|
162
|
+
}
|
|
163
|
+
console.log("\n\u26A0\uFE0F Save these credentials securely - the secret key cannot be retrieved again!");
|
|
164
|
+
}
|
|
165
|
+
} catch (error) {
|
|
166
|
+
const err = error;
|
|
167
|
+
this.error(`Failed to create credential: ${err.message}`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
export {
|
|
172
|
+
CreateCredential as default
|
|
173
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseCommand
|
|
3
|
+
} from "../../chunk-MCRKUPJY.js";
|
|
4
|
+
import {
|
|
5
|
+
DeleteCredentialResponseSchema,
|
|
6
|
+
__toESM,
|
|
7
|
+
init_cjs_shims,
|
|
8
|
+
require_lib,
|
|
9
|
+
toJsonString,
|
|
10
|
+
valueOf
|
|
11
|
+
} from "../../chunk-G6NE675D.js";
|
|
12
|
+
|
|
13
|
+
// src/commands/bucket/delete-credential.ts
|
|
14
|
+
init_cjs_shims();
|
|
15
|
+
var import_core = __toESM(require_lib(), 1);
|
|
16
|
+
var DeleteCredential = class _DeleteCredential extends BaseCommand {
|
|
17
|
+
static description = "Delete an S3 credential";
|
|
18
|
+
static examples = [
|
|
19
|
+
`<%= config.bin %> bucket delete-credential --bucket my-bucket --access-key AKIAIOSFODNN7EXAMPLE
|
|
20
|
+
Delete a specific credential
|
|
21
|
+
`,
|
|
22
|
+
`<%= config.bin %> bucket delete-credential --api-url https://bucket.example.com --access-key AKIAIOSFODNN7EXAMPLE
|
|
23
|
+
Delete credential using a direct API URL
|
|
24
|
+
`
|
|
25
|
+
];
|
|
26
|
+
static flags = {
|
|
27
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
28
|
+
bucket: import_core.Flags.string({
|
|
29
|
+
char: "b",
|
|
30
|
+
description: "bucket name",
|
|
31
|
+
required: false,
|
|
32
|
+
exclusive: ["api-url"]
|
|
33
|
+
}),
|
|
34
|
+
"access-key": import_core.Flags.string({
|
|
35
|
+
description: "access key of the credential to delete",
|
|
36
|
+
required: true
|
|
37
|
+
}),
|
|
38
|
+
"api-url": import_core.Flags.string({
|
|
39
|
+
description: "direct API URL (bypasses bucket discovery)",
|
|
40
|
+
required: false,
|
|
41
|
+
exclusive: ["bucket", "application", "version"]
|
|
42
|
+
}),
|
|
43
|
+
application: import_core.Flags.string({
|
|
44
|
+
char: "a",
|
|
45
|
+
description: "application name",
|
|
46
|
+
required: false,
|
|
47
|
+
exclusive: ["api-url"]
|
|
48
|
+
}),
|
|
49
|
+
version: import_core.Flags.string({
|
|
50
|
+
char: "v",
|
|
51
|
+
description: "application version",
|
|
52
|
+
required: false,
|
|
53
|
+
exclusive: ["api-url"]
|
|
54
|
+
}),
|
|
55
|
+
output: import_core.Flags.string({
|
|
56
|
+
char: "o",
|
|
57
|
+
description: "output format",
|
|
58
|
+
default: "text",
|
|
59
|
+
options: ["text", "json"]
|
|
60
|
+
}),
|
|
61
|
+
impersonate: import_core.Flags.string({
|
|
62
|
+
char: "i",
|
|
63
|
+
description: "impersonate organization",
|
|
64
|
+
required: false,
|
|
65
|
+
hidden: true
|
|
66
|
+
}),
|
|
67
|
+
manifest: import_core.Flags.string({
|
|
68
|
+
char: "M",
|
|
69
|
+
description: "project manifest",
|
|
70
|
+
required: false,
|
|
71
|
+
default: "raindrop.manifest",
|
|
72
|
+
hidden: true
|
|
73
|
+
})
|
|
74
|
+
};
|
|
75
|
+
async run() {
|
|
76
|
+
const { flags } = await this.parse(_DeleteCredential);
|
|
77
|
+
if (!flags["api-url"] && !flags.bucket) {
|
|
78
|
+
this.error("Either --api-url or --bucket must be specified");
|
|
79
|
+
}
|
|
80
|
+
let apiUrl;
|
|
81
|
+
let bucketName;
|
|
82
|
+
if (flags["api-url"]) {
|
|
83
|
+
apiUrl = flags["api-url"];
|
|
84
|
+
} else {
|
|
85
|
+
bucketName = flags.bucket;
|
|
86
|
+
let applicationName = flags.application;
|
|
87
|
+
let applicationVersionId = flags.version;
|
|
88
|
+
if (!applicationVersionId) {
|
|
89
|
+
const config = await this.loadConfig();
|
|
90
|
+
applicationVersionId = config.versionId;
|
|
91
|
+
}
|
|
92
|
+
if (!applicationName) {
|
|
93
|
+
const apps = await this.loadManifest();
|
|
94
|
+
const app = apps[0];
|
|
95
|
+
if (app === void 0) {
|
|
96
|
+
this.error("No application provided or found in manifest", { exit: 1 });
|
|
97
|
+
}
|
|
98
|
+
applicationName = valueOf(app.name);
|
|
99
|
+
}
|
|
100
|
+
const { client: catalogService, userId, organizationId: defaultOrganizationId } = await this.catalogService();
|
|
101
|
+
const organizationId = flags.impersonate ?? defaultOrganizationId;
|
|
102
|
+
const modulesResp = await catalogService.queryModules({
|
|
103
|
+
userId,
|
|
104
|
+
applicationName,
|
|
105
|
+
applicationVersionId,
|
|
106
|
+
organizationId,
|
|
107
|
+
moduleType: "bucket"
|
|
108
|
+
});
|
|
109
|
+
const bucketModule = modulesResp.modules.find((m) => m.name === bucketName && m.type === "bucket");
|
|
110
|
+
if (!bucketModule) {
|
|
111
|
+
this.error(`Bucket '${bucketName}' not found in application ${applicationName}@${applicationVersionId}`);
|
|
112
|
+
}
|
|
113
|
+
apiUrl = bucketModule.bucket?.s3?.apiUrl;
|
|
114
|
+
if (!apiUrl) {
|
|
115
|
+
this.error(`Bucket '${bucketName}' does not have an API URL configured`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const { client: credentialService } = await this.bucketApiService(apiUrl);
|
|
119
|
+
try {
|
|
120
|
+
const response = await credentialService.deleteCredential({
|
|
121
|
+
accessKey: flags["access-key"]
|
|
122
|
+
});
|
|
123
|
+
if (flags.output === "json") {
|
|
124
|
+
console.log(toJsonString(DeleteCredentialResponseSchema, response, { prettySpaces: 2 }));
|
|
125
|
+
} else {
|
|
126
|
+
if (response.deleted) {
|
|
127
|
+
console.log(`Successfully deleted credential '${flags["access-key"]}'${bucketName ? ` from bucket '${bucketName}'` : ""}`);
|
|
128
|
+
} else {
|
|
129
|
+
console.log(`Credential '${flags["access-key"]}' not found${bucketName ? ` in bucket '${bucketName}'` : ""}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
} catch (error) {
|
|
133
|
+
const err = error;
|
|
134
|
+
this.error(`Failed to delete credential: ${err.message}`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
export {
|
|
139
|
+
DeleteCredential as default
|
|
140
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseCommand
|
|
3
|
+
} from "../../chunk-MCRKUPJY.js";
|
|
4
|
+
import {
|
|
5
|
+
GetCredentialResponseSchema,
|
|
6
|
+
__toESM,
|
|
7
|
+
init_cjs_shims,
|
|
8
|
+
require_lib,
|
|
9
|
+
timestampDate,
|
|
10
|
+
toJsonString,
|
|
11
|
+
valueOf
|
|
12
|
+
} from "../../chunk-G6NE675D.js";
|
|
13
|
+
|
|
14
|
+
// src/commands/bucket/get-credential.ts
|
|
15
|
+
init_cjs_shims();
|
|
16
|
+
var import_core = __toESM(require_lib(), 1);
|
|
17
|
+
var GetCredential = class _GetCredential extends BaseCommand {
|
|
18
|
+
static description = "Get details of a specific S3 credential";
|
|
19
|
+
static examples = [
|
|
20
|
+
`<%= config.bin %> bucket get-credential --bucket my-bucket --access-key AKIAIOSFODNN7EXAMPLE
|
|
21
|
+
Get details of a specific credential
|
|
22
|
+
`,
|
|
23
|
+
`<%= config.bin %> bucket get-credential --api-url https://bucket.example.com --access-key AKIAIOSFODNN7EXAMPLE
|
|
24
|
+
Get credential details using a direct API URL
|
|
25
|
+
`
|
|
26
|
+
];
|
|
27
|
+
static flags = {
|
|
28
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
29
|
+
bucket: import_core.Flags.string({
|
|
30
|
+
char: "b",
|
|
31
|
+
description: "bucket name",
|
|
32
|
+
required: false,
|
|
33
|
+
exclusive: ["api-url"]
|
|
34
|
+
}),
|
|
35
|
+
"access-key": import_core.Flags.string({
|
|
36
|
+
description: "access key of the credential to retrieve",
|
|
37
|
+
required: true
|
|
38
|
+
}),
|
|
39
|
+
"api-url": import_core.Flags.string({
|
|
40
|
+
description: "direct API URL (bypasses bucket discovery)",
|
|
41
|
+
required: false,
|
|
42
|
+
exclusive: ["bucket", "application", "version"]
|
|
43
|
+
}),
|
|
44
|
+
application: import_core.Flags.string({
|
|
45
|
+
char: "a",
|
|
46
|
+
description: "application name",
|
|
47
|
+
required: false,
|
|
48
|
+
exclusive: ["api-url"]
|
|
49
|
+
}),
|
|
50
|
+
version: import_core.Flags.string({
|
|
51
|
+
char: "v",
|
|
52
|
+
description: "application version",
|
|
53
|
+
required: false,
|
|
54
|
+
exclusive: ["api-url"]
|
|
55
|
+
}),
|
|
56
|
+
output: import_core.Flags.string({
|
|
57
|
+
char: "o",
|
|
58
|
+
description: "output format",
|
|
59
|
+
default: "text",
|
|
60
|
+
options: ["text", "json"]
|
|
61
|
+
}),
|
|
62
|
+
impersonate: import_core.Flags.string({
|
|
63
|
+
char: "i",
|
|
64
|
+
description: "impersonate organization",
|
|
65
|
+
required: false,
|
|
66
|
+
hidden: true
|
|
67
|
+
}),
|
|
68
|
+
manifest: import_core.Flags.string({
|
|
69
|
+
char: "M",
|
|
70
|
+
description: "project manifest",
|
|
71
|
+
required: false,
|
|
72
|
+
default: "raindrop.manifest",
|
|
73
|
+
hidden: true
|
|
74
|
+
})
|
|
75
|
+
};
|
|
76
|
+
async run() {
|
|
77
|
+
const { flags } = await this.parse(_GetCredential);
|
|
78
|
+
if (!flags["api-url"] && !flags.bucket) {
|
|
79
|
+
this.error("Either --api-url or --bucket must be specified");
|
|
80
|
+
}
|
|
81
|
+
let apiUrl;
|
|
82
|
+
let bucketName;
|
|
83
|
+
if (flags["api-url"]) {
|
|
84
|
+
apiUrl = flags["api-url"];
|
|
85
|
+
} else {
|
|
86
|
+
bucketName = flags.bucket;
|
|
87
|
+
let applicationName = flags.application;
|
|
88
|
+
let applicationVersionId = flags.version;
|
|
89
|
+
if (!applicationVersionId) {
|
|
90
|
+
const config = await this.loadConfig();
|
|
91
|
+
applicationVersionId = config.versionId;
|
|
92
|
+
}
|
|
93
|
+
if (!applicationName) {
|
|
94
|
+
const apps = await this.loadManifest();
|
|
95
|
+
const app = apps[0];
|
|
96
|
+
if (app === void 0) {
|
|
97
|
+
this.error("No application provided or found in manifest", { exit: 1 });
|
|
98
|
+
}
|
|
99
|
+
applicationName = valueOf(app.name);
|
|
100
|
+
}
|
|
101
|
+
const { client: catalogService, userId, organizationId: defaultOrganizationId } = await this.catalogService();
|
|
102
|
+
const organizationId = flags.impersonate ?? defaultOrganizationId;
|
|
103
|
+
const modulesResp = await catalogService.queryModules({
|
|
104
|
+
userId,
|
|
105
|
+
applicationName,
|
|
106
|
+
applicationVersionId,
|
|
107
|
+
organizationId,
|
|
108
|
+
moduleType: "bucket"
|
|
109
|
+
});
|
|
110
|
+
const bucketModule = modulesResp.modules.find((m) => m.name === bucketName && m.type === "bucket");
|
|
111
|
+
if (!bucketModule) {
|
|
112
|
+
this.error(`Bucket '${bucketName}' not found in application ${applicationName}@${applicationVersionId}`);
|
|
113
|
+
}
|
|
114
|
+
apiUrl = bucketModule.bucket?.s3?.apiUrl;
|
|
115
|
+
if (!apiUrl) {
|
|
116
|
+
this.error(`Bucket '${bucketName}' does not have an API URL configured`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const { client: credentialService } = await this.bucketApiService(apiUrl);
|
|
120
|
+
try {
|
|
121
|
+
const response = await credentialService.getCredential({
|
|
122
|
+
accessKey: flags["access-key"]
|
|
123
|
+
});
|
|
124
|
+
if (flags.output === "json") {
|
|
125
|
+
console.log(toJsonString(GetCredentialResponseSchema, response, { prettySpaces: 2 }));
|
|
126
|
+
} else {
|
|
127
|
+
const cred = response.credential;
|
|
128
|
+
if (!cred) {
|
|
129
|
+
this.error("No credential returned from service");
|
|
130
|
+
}
|
|
131
|
+
console.log(`Credential details${bucketName ? ` for bucket '${bucketName}'` : ""}:
|
|
132
|
+
`);
|
|
133
|
+
console.log(`Access Key: ${cred.accessKey}`);
|
|
134
|
+
console.log(`Name: ${cred.name}`);
|
|
135
|
+
if (cred.createdAt) {
|
|
136
|
+
console.log(`Created: ${timestampDate(cred.createdAt).toISOString()}`);
|
|
137
|
+
}
|
|
138
|
+
if (cred.expiresAt) {
|
|
139
|
+
console.log(`Expires: ${timestampDate(cred.expiresAt).toISOString()}`);
|
|
140
|
+
}
|
|
141
|
+
console.log("\nNote: Secret key is not displayed for security reasons");
|
|
142
|
+
}
|
|
143
|
+
} catch (error) {
|
|
144
|
+
const err = error;
|
|
145
|
+
this.error(`Failed to get credential: ${err.message}`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
export {
|
|
150
|
+
GetCredential as default
|
|
151
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseCommand
|
|
3
|
+
} from "../../chunk-MCRKUPJY.js";
|
|
4
|
+
import {
|
|
5
|
+
ListCredentialsResponseSchema,
|
|
6
|
+
__toESM,
|
|
7
|
+
init_cjs_shims,
|
|
8
|
+
require_lib,
|
|
9
|
+
timestampDate,
|
|
10
|
+
toJsonString,
|
|
11
|
+
valueOf
|
|
12
|
+
} from "../../chunk-G6NE675D.js";
|
|
13
|
+
|
|
14
|
+
// src/commands/bucket/list-credentials.ts
|
|
15
|
+
init_cjs_shims();
|
|
16
|
+
var import_core = __toESM(require_lib(), 1);
|
|
17
|
+
var ListCredentials = class _ListCredentials extends BaseCommand {
|
|
18
|
+
static description = "List S3 credentials for a bucket";
|
|
19
|
+
static examples = [
|
|
20
|
+
`<%= config.bin %> bucket list-credentials --bucket my-bucket
|
|
21
|
+
List all credentials for my-bucket
|
|
22
|
+
`,
|
|
23
|
+
`<%= config.bin %> bucket list-credentials --api-url https://bucket.example.com
|
|
24
|
+
List all credentials using a direct API URL
|
|
25
|
+
`
|
|
26
|
+
];
|
|
27
|
+
static flags = {
|
|
28
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
29
|
+
bucket: import_core.Flags.string({
|
|
30
|
+
char: "b",
|
|
31
|
+
description: "bucket name",
|
|
32
|
+
required: false,
|
|
33
|
+
exclusive: ["api-url"]
|
|
34
|
+
}),
|
|
35
|
+
"api-url": import_core.Flags.string({
|
|
36
|
+
description: "direct API URL (bypasses bucket discovery)",
|
|
37
|
+
required: false,
|
|
38
|
+
exclusive: ["bucket", "application", "version"]
|
|
39
|
+
}),
|
|
40
|
+
application: import_core.Flags.string({
|
|
41
|
+
char: "a",
|
|
42
|
+
description: "application name",
|
|
43
|
+
required: false,
|
|
44
|
+
exclusive: ["api-url"]
|
|
45
|
+
}),
|
|
46
|
+
version: import_core.Flags.string({
|
|
47
|
+
char: "v",
|
|
48
|
+
description: "application version",
|
|
49
|
+
required: false,
|
|
50
|
+
exclusive: ["api-url"]
|
|
51
|
+
}),
|
|
52
|
+
output: import_core.Flags.string({
|
|
53
|
+
char: "o",
|
|
54
|
+
description: "output format",
|
|
55
|
+
default: "text",
|
|
56
|
+
options: ["text", "json"]
|
|
57
|
+
}),
|
|
58
|
+
impersonate: import_core.Flags.string({
|
|
59
|
+
char: "i",
|
|
60
|
+
description: "impersonate organization",
|
|
61
|
+
required: false,
|
|
62
|
+
hidden: true
|
|
63
|
+
}),
|
|
64
|
+
manifest: import_core.Flags.string({
|
|
65
|
+
char: "M",
|
|
66
|
+
description: "project manifest",
|
|
67
|
+
required: false,
|
|
68
|
+
default: "raindrop.manifest",
|
|
69
|
+
hidden: true
|
|
70
|
+
})
|
|
71
|
+
};
|
|
72
|
+
async run() {
|
|
73
|
+
const { flags } = await this.parse(_ListCredentials);
|
|
74
|
+
if (!flags["api-url"] && !flags.bucket) {
|
|
75
|
+
this.error("Either --api-url or --bucket must be specified");
|
|
76
|
+
}
|
|
77
|
+
let apiUrl;
|
|
78
|
+
let bucketName;
|
|
79
|
+
if (flags["api-url"]) {
|
|
80
|
+
apiUrl = flags["api-url"];
|
|
81
|
+
} else {
|
|
82
|
+
bucketName = flags.bucket;
|
|
83
|
+
let applicationName = flags.application;
|
|
84
|
+
let applicationVersionId = flags.version;
|
|
85
|
+
if (!applicationVersionId) {
|
|
86
|
+
const config = await this.loadConfig();
|
|
87
|
+
applicationVersionId = config.versionId;
|
|
88
|
+
}
|
|
89
|
+
if (!applicationName) {
|
|
90
|
+
const apps = await this.loadManifest();
|
|
91
|
+
const app = apps[0];
|
|
92
|
+
if (app === void 0) {
|
|
93
|
+
this.error("No application provided or found in manifest", { exit: 1 });
|
|
94
|
+
}
|
|
95
|
+
applicationName = valueOf(app.name);
|
|
96
|
+
}
|
|
97
|
+
const { client: catalogService, userId, organizationId: defaultOrganizationId } = await this.catalogService();
|
|
98
|
+
const organizationId = flags.impersonate ?? defaultOrganizationId;
|
|
99
|
+
const modulesResp = await catalogService.queryModules({
|
|
100
|
+
userId,
|
|
101
|
+
applicationName,
|
|
102
|
+
applicationVersionId,
|
|
103
|
+
organizationId,
|
|
104
|
+
moduleType: "bucket"
|
|
105
|
+
});
|
|
106
|
+
const bucketModule = modulesResp.modules.find((m) => m.name === bucketName && m.type === "bucket");
|
|
107
|
+
if (!bucketModule) {
|
|
108
|
+
this.error(`Bucket '${bucketName}' not found in application ${applicationName}@${applicationVersionId}`);
|
|
109
|
+
}
|
|
110
|
+
apiUrl = bucketModule.bucket?.s3?.apiUrl;
|
|
111
|
+
if (!apiUrl) {
|
|
112
|
+
this.error(`Bucket '${bucketName}' does not have an API URL configured`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const { client: credentialService } = await this.bucketApiService(apiUrl);
|
|
116
|
+
try {
|
|
117
|
+
const response = await credentialService.listCredentials({});
|
|
118
|
+
if (flags.output === "json") {
|
|
119
|
+
console.log(toJsonString(ListCredentialsResponseSchema, response, { prettySpaces: 2 }));
|
|
120
|
+
} else {
|
|
121
|
+
const credentials = response.credentials;
|
|
122
|
+
if (credentials.length === 0) {
|
|
123
|
+
console.log(`No credentials found${bucketName ? ` for bucket '${bucketName}'` : ""}`);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
console.log(`Found ${credentials.length} credential${credentials.length === 1 ? "" : "s"}${bucketName ? ` for bucket '${bucketName}'` : ""}:
|
|
127
|
+
`);
|
|
128
|
+
for (const cred of credentials) {
|
|
129
|
+
console.log(`Access Key: ${cred.accessKey}`);
|
|
130
|
+
console.log(`Name: ${cred.name}`);
|
|
131
|
+
if (cred.createdAt) {
|
|
132
|
+
console.log(`Created: ${timestampDate(cred.createdAt).toISOString()}`);
|
|
133
|
+
}
|
|
134
|
+
if (cred.expiresAt) {
|
|
135
|
+
console.log(`Expires: ${timestampDate(cred.expiresAt).toISOString()}`);
|
|
136
|
+
}
|
|
137
|
+
console.log("---");
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
} catch (error) {
|
|
141
|
+
const err = error;
|
|
142
|
+
this.error(`Failed to list credentials: ${err.message}`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
export {
|
|
147
|
+
ListCredentials as default
|
|
148
|
+
};
|