@liquidmetal-ai/raindrop 0.6.4 → 0.8.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 +440 -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 +21 -8
- 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 +20 -3
- package/dist/codegen.test.js +59 -1
- package/dist/commands/build/checkout.d.ts +17 -0
- package/dist/commands/build/checkout.d.ts.map +1 -1
- package/dist/commands/build/checkout.js +144 -7
- package/dist/commands/build/delete.d.ts +15 -0
- package/dist/commands/build/delete.d.ts.map +1 -1
- package/dist/commands/build/delete.js +133 -0
- 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 +2 -2
- package/dist/commands/mcp/install-gemini.d.ts.map +1 -1
- package/dist/commands/mcp/install-gemini.js +2 -2
- package/dist/commands/mcp/install-goose.d.ts +22 -0
- package/dist/commands/mcp/install-goose.d.ts.map +1 -0
- package/dist/commands/mcp/install-goose.js +252 -0
- package/dist/commands/object/delete.d.ts.map +1 -1
- package/dist/commands/object/delete.js +20 -12
- package/dist/commands/object/get.d.ts.map +1 -1
- package/dist/commands/object/get.js +20 -12
- package/dist/commands/object/list.d.ts.map +1 -1
- package/dist/commands/object/list.js +20 -12
- package/dist/commands/object/put.d.ts.map +1 -1
- package/dist/commands/object/put.js +20 -12
- 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 +37 -4
- package/dist/index.test.js +54 -2
- package/oclif.manifest.json +4533 -2284
- package/package.json +8 -5
- package/templates/claude-code/debug-raindrop-app.md +89 -0
- package/templates/claude-code/new-raindrop-app.md +12 -4
- 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 +10 -3
- 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 +21 -0
- package/templates/goose/reattach-raindrop-session.yaml +20 -0
- package/templates/goose/update-raindrop-app.yaml +65 -0
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../../src/commands/build/checkout.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../../src/commands/build/checkout.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,gCAAgC,EAEjC,MAAM,yDAAyD,CAAC;AAGjE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKpD,UAAU,WAAW;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,WAAW,EAAE,gCAAgC,CAAC;IAC9C,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,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;;;;;;;;;;;MAeV;IAGF,gBAAgB,CAAC,YAAY,EAAE,gCAAgC,EAAE;;;;IA6B3D,wBAAwB,CAC5B,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,gCAAgC,EAAE,CAAC;IAaxC,sBAAsB,CAAC,QAAQ,EAAE,gCAAgC,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAyDjG,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA8E3B"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import { timestampDate } from '@bufbuild/protobuf/wkt';
|
|
2
|
+
import { select } from '@inquirer/prompts';
|
|
3
|
+
import { valueOf } from '@liquidmetal-ai/drizzle/appify/build';
|
|
4
|
+
import { UnitState, } from '@liquidmetal-ai/drizzle/liquidmetal/v1alpha1/catalog_pb';
|
|
1
5
|
import { Args, Flags } from '@oclif/core';
|
|
6
|
+
import chalk from 'chalk';
|
|
2
7
|
import { BaseCommand } from '../../base-command.js';
|
|
8
|
+
import { EPOCH_TS } from '../../index.js';
|
|
9
|
+
import { statusString } from './list.js';
|
|
3
10
|
export default class Branch extends BaseCommand {
|
|
4
11
|
static args = {
|
|
5
12
|
version: Args.string({ description: 'version id', required: false }),
|
|
@@ -16,7 +23,106 @@ Switched to version: 01jux6z20m4gbhn5kaa4mcm2jr
|
|
|
16
23
|
static flags = {
|
|
17
24
|
...BaseCommand.HIDDEN_FLAGS,
|
|
18
25
|
output: Flags.string({ char: 'o', description: 'output format', required: false, default: 'text' }),
|
|
26
|
+
manifest: Flags.string({
|
|
27
|
+
char: 'M',
|
|
28
|
+
description: 'project manifest',
|
|
29
|
+
required: false,
|
|
30
|
+
default: 'raindrop.manifest',
|
|
31
|
+
}),
|
|
32
|
+
impersonate: Flags.string({
|
|
33
|
+
char: 'i',
|
|
34
|
+
description: 'impersonate organization',
|
|
35
|
+
required: false,
|
|
36
|
+
hidden: true,
|
|
37
|
+
}),
|
|
19
38
|
};
|
|
39
|
+
// Build a version tree from applications
|
|
40
|
+
buildVersionTree(applications) {
|
|
41
|
+
const nodesMap = new Map();
|
|
42
|
+
const rootNodes = [];
|
|
43
|
+
// First pass: create nodes for all versions
|
|
44
|
+
applications.forEach((app) => {
|
|
45
|
+
const node = {
|
|
46
|
+
versionId: app.versionId,
|
|
47
|
+
previousVersionId: app.previousVersionId || null,
|
|
48
|
+
application: app,
|
|
49
|
+
children: [],
|
|
50
|
+
branch: app.branch,
|
|
51
|
+
};
|
|
52
|
+
nodesMap.set(app.versionId, node);
|
|
53
|
+
});
|
|
54
|
+
// Second pass: build the tree by connecting parents and children
|
|
55
|
+
for (const node of nodesMap.values()) {
|
|
56
|
+
if (node.previousVersionId && nodesMap.has(node.previousVersionId)) {
|
|
57
|
+
nodesMap.get(node.previousVersionId).children.push(node);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
rootNodes.push(node);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return { rootNodes, nodesMap };
|
|
64
|
+
}
|
|
65
|
+
// Fetch all versions of the application
|
|
66
|
+
async fetchApplicationVersions(applicationName, userId, organizationId) {
|
|
67
|
+
const { client: catalogService } = await this.catalogService();
|
|
68
|
+
const resp = await catalogService.applications({
|
|
69
|
+
userId,
|
|
70
|
+
organizationId,
|
|
71
|
+
showDeleted: true,
|
|
72
|
+
});
|
|
73
|
+
// Filter to only the specified application
|
|
74
|
+
return resp.applications.filter((app) => app.name === applicationName);
|
|
75
|
+
}
|
|
76
|
+
// Prompt user to select a version from the tree
|
|
77
|
+
async promptVersionSelection(versions) {
|
|
78
|
+
// Build the version tree
|
|
79
|
+
const { rootNodes } = this.buildVersionTree(versions);
|
|
80
|
+
// Flatten the tree to create choices with proper indentation
|
|
81
|
+
const choices = [];
|
|
82
|
+
const buildChoices = (node, prefix = '', isLast = true) => {
|
|
83
|
+
const app = node.application;
|
|
84
|
+
const date = timestampDate(app.createdAt || EPOCH_TS).toLocaleDateString();
|
|
85
|
+
const branch = app.branch ? chalk.cyan(` (${app.branch})`) : '';
|
|
86
|
+
let status;
|
|
87
|
+
if (app.state === UnitState.RUNNING) {
|
|
88
|
+
status = chalk.green(statusString[app.state]);
|
|
89
|
+
}
|
|
90
|
+
else if (app.state === UnitState.DELETING) {
|
|
91
|
+
status = chalk.yellow(statusString[app.state]);
|
|
92
|
+
}
|
|
93
|
+
else if (app.state === UnitState.DELETED) {
|
|
94
|
+
status = chalk.red(statusString[app.state]);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
status = chalk.gray(statusString[app.state]);
|
|
98
|
+
}
|
|
99
|
+
const connector = isLast ? '└─' : '├─';
|
|
100
|
+
const shortId = app.versionId.substring(0, 8);
|
|
101
|
+
const displayName = `${prefix}${connector} ${shortId}...${branch} - ${status} - ${chalk.dim(date)}`;
|
|
102
|
+
choices.push({
|
|
103
|
+
name: displayName,
|
|
104
|
+
value: app.versionId,
|
|
105
|
+
});
|
|
106
|
+
// Render children
|
|
107
|
+
const childPrefix = prefix + (isLast ? ' ' : '│ ');
|
|
108
|
+
node.children.forEach((child, index) => {
|
|
109
|
+
buildChoices(child, childPrefix, index === node.children.length - 1);
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
rootNodes.forEach((root, index) => {
|
|
113
|
+
buildChoices(root, '', index === rootNodes.length - 1);
|
|
114
|
+
});
|
|
115
|
+
// Add option to clear version
|
|
116
|
+
choices.push({
|
|
117
|
+
name: chalk.dim('(None - clear version)'),
|
|
118
|
+
value: '__NONE__',
|
|
119
|
+
});
|
|
120
|
+
const selectedVersion = await select({
|
|
121
|
+
message: 'Select a version to checkout:',
|
|
122
|
+
choices,
|
|
123
|
+
});
|
|
124
|
+
return selectedVersion === '__NONE__' ? undefined : selectedVersion;
|
|
125
|
+
}
|
|
20
126
|
async run() {
|
|
21
127
|
const config = await this.loadConfig();
|
|
22
128
|
if (config.lock) {
|
|
@@ -25,18 +131,49 @@ Switched to version: 01jux6z20m4gbhn5kaa4mcm2jr
|
|
|
25
131
|
if (['text', 'json'].indexOf(this.flags.output) === -1) {
|
|
26
132
|
this.error(`unsupported output format: ${this.flags.output}`, { exit: 1 });
|
|
27
133
|
}
|
|
28
|
-
// No args:
|
|
134
|
+
// No args: show interactive selection (for text) or current version (for json)
|
|
29
135
|
if (!this.args.version) {
|
|
30
136
|
if (this.flags.output === 'json') {
|
|
31
137
|
console.log(JSON.stringify({ versionId: config.versionId }, null, 2));
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
// For text output, show current version and prompt for selection
|
|
141
|
+
if (!config.versionId) {
|
|
142
|
+
console.log('No version currently set.\n');
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
console.log(`Currently on version: ${config.versionId}\n`);
|
|
146
|
+
}
|
|
147
|
+
// Get application name from manifest
|
|
148
|
+
const apps = await this.loadManifest();
|
|
149
|
+
const app = apps[0];
|
|
150
|
+
if (app === undefined) {
|
|
151
|
+
this.error('No application found in manifest', { exit: 1 });
|
|
152
|
+
}
|
|
153
|
+
const applicationName = valueOf(app.name);
|
|
154
|
+
// Fetch versions and show interactive selection
|
|
155
|
+
const { userId, organizationId } = await this.catalogService();
|
|
156
|
+
console.log('Fetching versions...');
|
|
157
|
+
const allVersions = await this.fetchApplicationVersions(applicationName, userId, this.flags.impersonate ?? organizationId);
|
|
158
|
+
// Filter out versions marked for deletion (exclude apps where deletedAt is set)
|
|
159
|
+
const activeVersions = allVersions.filter((app) => !app.deletedAt);
|
|
160
|
+
if (activeVersions.length === 0) {
|
|
161
|
+
config.sandbox = false;
|
|
162
|
+
await this.saveConfig(config);
|
|
163
|
+
console.log('No versions found.');
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
console.log(`\nFound ${activeVersions.length} version${activeVersions.length !== 1 ? 's' : ''}:`);
|
|
167
|
+
const selectedVersion = await this.promptVersionSelection(activeVersions);
|
|
168
|
+
const activeApp = activeVersions.find((a) => a.versionId === selectedVersion);
|
|
169
|
+
config.versionId = selectedVersion;
|
|
170
|
+
config.sandbox = activeApp?.isSandboxed === true;
|
|
171
|
+
await this.saveConfig(config);
|
|
172
|
+
if (selectedVersion) {
|
|
173
|
+
console.log(`\nSwitched to version: ${selectedVersion}`);
|
|
32
174
|
}
|
|
33
175
|
else {
|
|
34
|
-
|
|
35
|
-
console.log('No version set');
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
console.log(`Currently on version ${config.versionId}`);
|
|
39
|
-
}
|
|
176
|
+
console.log('\nCleared version from config.');
|
|
40
177
|
}
|
|
41
178
|
return;
|
|
42
179
|
}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
import { ApplicationsResponse_Application } from '@liquidmetal-ai/drizzle/liquidmetal/v1alpha1/catalog_pb';
|
|
1
2
|
import { BaseCommand } from '../../base-command.js';
|
|
3
|
+
interface VersionNode {
|
|
4
|
+
versionId: string;
|
|
5
|
+
previousVersionId: string | null;
|
|
6
|
+
application: ApplicationsResponse_Application;
|
|
7
|
+
children: VersionNode[];
|
|
8
|
+
branch?: string;
|
|
9
|
+
}
|
|
2
10
|
export default class Delete extends BaseCommand<typeof Delete> {
|
|
3
11
|
static args: {
|
|
4
12
|
application: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
@@ -20,6 +28,13 @@ export default class Delete extends BaseCommand<typeof Delete> {
|
|
|
20
28
|
rainbowUserId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
29
|
sendVersionMetadata: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
30
|
};
|
|
31
|
+
buildVersionTree(applications: ApplicationsResponse_Application[]): {
|
|
32
|
+
rootNodes: VersionNode[];
|
|
33
|
+
nodesMap: Map<string, VersionNode>;
|
|
34
|
+
};
|
|
35
|
+
fetchApplicationVersions(applicationName: string, userId: string, organizationId: string): Promise<ApplicationsResponse_Application[]>;
|
|
36
|
+
promptVersionSelection(versions: ApplicationsResponse_Application[], defaultVersion?: string): Promise<string | undefined>;
|
|
23
37
|
run(): Promise<void>;
|
|
24
38
|
}
|
|
39
|
+
export {};
|
|
25
40
|
//# sourceMappingURL=delete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/build/delete.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/build/delete.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gCAAgC,EAAa,MAAM,yDAAyD,CAAC;AAGtH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAKpD,UAAU,WAAW;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,WAAW,EAAE,gCAAgC,CAAC;IAC9C,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,MAAM,CAAC,IAAI;;MAET;IAEF,MAAM,CAAC,WAAW,SAAkC;IAEpD,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;;;;MAiCV;IAGF,gBAAgB,CAAC,YAAY,EAAE,gCAAgC,EAAE;;;;IA6B3D,wBAAwB,CAC5B,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,gCAAgC,EAAE,CAAC;IAaxC,sBAAsB,CAC1B,QAAQ,EAAE,gCAAgC,EAAE,EAC5C,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IA4DxB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA6F3B"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { timestampDate } from '@bufbuild/protobuf/wkt';
|
|
2
|
+
import { select } from '@inquirer/prompts';
|
|
1
3
|
import { valueOf } from '@liquidmetal-ai/drizzle/appify/build';
|
|
4
|
+
import { UnitState } from '@liquidmetal-ai/drizzle/liquidmetal/v1alpha1/catalog_pb';
|
|
2
5
|
import { Args, Flags } from '@oclif/core';
|
|
6
|
+
import chalk from 'chalk';
|
|
3
7
|
import { BaseCommand } from '../../base-command.js';
|
|
8
|
+
import { EPOCH_TS } from '../../index.js';
|
|
9
|
+
import { statusString } from './list.js';
|
|
4
10
|
export default class Delete extends BaseCommand {
|
|
5
11
|
static args = {
|
|
6
12
|
application: Args.string({ char: 'a', description: 'application name', required: false }),
|
|
@@ -45,6 +51,96 @@ Deleted (application) at version (version)
|
|
|
45
51
|
hidden: true,
|
|
46
52
|
}),
|
|
47
53
|
};
|
|
54
|
+
// Build a version tree from applications (reused from list.ts)
|
|
55
|
+
buildVersionTree(applications) {
|
|
56
|
+
const nodesMap = new Map();
|
|
57
|
+
const rootNodes = [];
|
|
58
|
+
// First pass: create nodes for all versions
|
|
59
|
+
applications.forEach((app) => {
|
|
60
|
+
const node = {
|
|
61
|
+
versionId: app.versionId,
|
|
62
|
+
previousVersionId: app.previousVersionId || null,
|
|
63
|
+
application: app,
|
|
64
|
+
children: [],
|
|
65
|
+
branch: app.branch,
|
|
66
|
+
};
|
|
67
|
+
nodesMap.set(app.versionId, node);
|
|
68
|
+
});
|
|
69
|
+
// Second pass: build the tree by connecting parents and children
|
|
70
|
+
for (const node of nodesMap.values()) {
|
|
71
|
+
if (node.previousVersionId && nodesMap.has(node.previousVersionId)) {
|
|
72
|
+
nodesMap.get(node.previousVersionId).children.push(node);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
rootNodes.push(node);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return { rootNodes, nodesMap };
|
|
79
|
+
}
|
|
80
|
+
// Fetch all versions of the application
|
|
81
|
+
async fetchApplicationVersions(applicationName, userId, organizationId) {
|
|
82
|
+
const { client: catalogService } = await this.catalogService();
|
|
83
|
+
const resp = await catalogService.applications({
|
|
84
|
+
userId,
|
|
85
|
+
organizationId,
|
|
86
|
+
showDeleted: true,
|
|
87
|
+
});
|
|
88
|
+
// Filter to only the specified application
|
|
89
|
+
return resp.applications.filter((app) => app.name === applicationName);
|
|
90
|
+
}
|
|
91
|
+
// Prompt user to select a version from the tree
|
|
92
|
+
async promptVersionSelection(versions, defaultVersion) {
|
|
93
|
+
// Build the version tree
|
|
94
|
+
const { rootNodes } = this.buildVersionTree(versions);
|
|
95
|
+
// Flatten the tree to create choices with proper indentation
|
|
96
|
+
const choices = [];
|
|
97
|
+
const buildChoices = (node, prefix = '', isLast = true) => {
|
|
98
|
+
const app = node.application;
|
|
99
|
+
const date = timestampDate(app.createdAt || EPOCH_TS).toLocaleDateString();
|
|
100
|
+
const branch = app.branch ? chalk.cyan(` (${app.branch})`) : '';
|
|
101
|
+
let status;
|
|
102
|
+
if (app.state === UnitState.RUNNING) {
|
|
103
|
+
status = chalk.green(statusString[app.state]);
|
|
104
|
+
}
|
|
105
|
+
else if (app.state === UnitState.DELETING) {
|
|
106
|
+
status = chalk.yellow(statusString[app.state]);
|
|
107
|
+
}
|
|
108
|
+
else if (app.state === UnitState.DELETED) {
|
|
109
|
+
status = chalk.red(statusString[app.state]);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
status = chalk.gray(statusString[app.state]);
|
|
113
|
+
}
|
|
114
|
+
const connector = isLast ? '└─' : '├─';
|
|
115
|
+
const shortId = app.versionId.substring(0, 8);
|
|
116
|
+
const isDefault = defaultVersion === app.versionId;
|
|
117
|
+
const defaultMarker = isDefault ? chalk.bold.green(' (parent - default)') : '';
|
|
118
|
+
const displayName = `${prefix}${connector} ${shortId}...${branch} - ${status} - ${chalk.dim(date)}${defaultMarker}`;
|
|
119
|
+
choices.push({
|
|
120
|
+
name: displayName,
|
|
121
|
+
value: app.versionId,
|
|
122
|
+
});
|
|
123
|
+
// Render children
|
|
124
|
+
const childPrefix = prefix + (isLast ? ' ' : '│ ');
|
|
125
|
+
node.children.forEach((child, index) => {
|
|
126
|
+
buildChoices(child, childPrefix, index === node.children.length - 1);
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
rootNodes.forEach((root, index) => {
|
|
130
|
+
buildChoices(root, '', index === rootNodes.length - 1);
|
|
131
|
+
});
|
|
132
|
+
// Add option to clear version
|
|
133
|
+
choices.push({
|
|
134
|
+
name: chalk.dim('(None - clear version)'),
|
|
135
|
+
value: '__NONE__',
|
|
136
|
+
});
|
|
137
|
+
const selectedVersion = await select({
|
|
138
|
+
message: 'Select a version to checkout:',
|
|
139
|
+
choices,
|
|
140
|
+
default: defaultVersion,
|
|
141
|
+
});
|
|
142
|
+
return selectedVersion === '__NONE__' ? undefined : selectedVersion;
|
|
143
|
+
}
|
|
48
144
|
async run() {
|
|
49
145
|
const { client: catalogService, userId, organizationId } = await this.catalogService();
|
|
50
146
|
// Get the version ID to delete, or undefined if all versions
|
|
@@ -66,6 +162,13 @@ Deleted (application) at version (version)
|
|
|
66
162
|
}
|
|
67
163
|
this.args.application = valueOf(app.name);
|
|
68
164
|
}
|
|
165
|
+
// Fetch versions BEFORE deletion to capture the parent version ID
|
|
166
|
+
let parentVersionId;
|
|
167
|
+
if (versionId) {
|
|
168
|
+
const allVersionsBeforeDelete = await this.fetchApplicationVersions(this.args.application, userId, this.flags.impersonate ?? organizationId);
|
|
169
|
+
const versionToDelete = allVersionsBeforeDelete.find((v) => v.versionId === versionId);
|
|
170
|
+
parentVersionId = versionToDelete?.previousVersionId || undefined;
|
|
171
|
+
}
|
|
69
172
|
try {
|
|
70
173
|
await catalogService.delete({
|
|
71
174
|
userId,
|
|
@@ -86,5 +189,35 @@ Deleted (application) at version (version)
|
|
|
86
189
|
else {
|
|
87
190
|
console.log(`Deleted ${this.args.application} at version ${versionId}`);
|
|
88
191
|
}
|
|
192
|
+
// After deletion, fetch all versions and prompt user to select a new active version
|
|
193
|
+
console.log('\nFetching remaining versions...');
|
|
194
|
+
const allVersions = await this.fetchApplicationVersions(this.args.application, userId, this.flags.impersonate ?? organizationId);
|
|
195
|
+
// Filter out versions marked for deletion (exclude apps where deletedAt is set)
|
|
196
|
+
const activeVersions = allVersions.filter((app) => !app.deletedAt);
|
|
197
|
+
const config = await this.loadConfig();
|
|
198
|
+
if (activeVersions.length === 0) {
|
|
199
|
+
// No undeleted versions left, clear the config
|
|
200
|
+
console.log('No undeleted versions remaining.');
|
|
201
|
+
config.versionId = undefined;
|
|
202
|
+
config.sandbox = false;
|
|
203
|
+
await this.saveConfig(config);
|
|
204
|
+
console.log('Cleared version from config.');
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
// Show interactive tree view and let user select a version
|
|
208
|
+
// Default to the parent of the deleted version if available
|
|
209
|
+
console.log(`\nFound ${activeVersions.length} undeleted version${activeVersions.length !== 1 ? 's' : ''}:`);
|
|
210
|
+
const selectedVersion = await this.promptVersionSelection(activeVersions, parentVersionId);
|
|
211
|
+
const activeApp = activeVersions.find((a) => a.versionId === selectedVersion);
|
|
212
|
+
config.versionId = selectedVersion;
|
|
213
|
+
config.sandbox = activeApp?.isSandboxed === true;
|
|
214
|
+
await this.saveConfig(config);
|
|
215
|
+
if (selectedVersion) {
|
|
216
|
+
console.log(`\nChecked out version: ${selectedVersion}`);
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
console.log('\nCleared version from config.');
|
|
220
|
+
}
|
|
221
|
+
}
|
|
89
222
|
}
|
|
90
223
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/commands/build/deploy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/commands/build/deploy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAMpD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,WAAW,SAAmC;IAErD,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;;;;;;;MAsCV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA4D3B"}
|
|
@@ -3,6 +3,7 @@ import { BaseCommand } from '../../base-command.js';
|
|
|
3
3
|
import { deploy } from '../../deploy.js';
|
|
4
4
|
import { watchStatus } from '../../status.js';
|
|
5
5
|
import { validateRaindropDirectory, isDirectoryValidationError } from '../../utils/directory-validation.js';
|
|
6
|
+
import { sandbox } from '../../deploy.js';
|
|
6
7
|
export default class Deploy extends BaseCommand {
|
|
7
8
|
static args = {};
|
|
8
9
|
static description = 'deploy a Raindrop application';
|
|
@@ -56,7 +57,9 @@ Deploy a Raindrop application version.
|
|
|
56
57
|
}
|
|
57
58
|
catch (error) {
|
|
58
59
|
if (isDirectoryValidationError(error)) {
|
|
59
|
-
this.error(error.message +
|
|
60
|
+
this.error(error.message +
|
|
61
|
+
'\n\nSuggested actions:\n' +
|
|
62
|
+
error.suggestedActions?.map((action) => ` • ${action}`).join('\n'), { exit: 1 });
|
|
60
63
|
}
|
|
61
64
|
throw error;
|
|
62
65
|
}
|
|
@@ -82,7 +85,12 @@ Deploy a Raindrop application version.
|
|
|
82
85
|
impersonate: this.flags.impersonate,
|
|
83
86
|
});
|
|
84
87
|
if (!amend) {
|
|
85
|
-
this.log(`🔔 You deployed a full version
|
|
88
|
+
this.log(`🔔 You deployed a full version update and are now in Sandbox mode, future deploys will amend`);
|
|
89
|
+
// Mark version as sandboxed
|
|
90
|
+
await sandbox({
|
|
91
|
+
command: this,
|
|
92
|
+
isSandboxed: true,
|
|
93
|
+
});
|
|
86
94
|
}
|
|
87
95
|
// Show status with watch output
|
|
88
96
|
if (!this.flags['no-watch']) {
|
|
@@ -21,6 +21,7 @@ export default class Find extends BaseCommand<typeof Find> {
|
|
|
21
21
|
rainbowUserId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
22
|
sendVersionMetadata: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
23
|
};
|
|
24
|
+
private getWorkOSEnvironment;
|
|
24
25
|
queryModules(flags: {
|
|
25
26
|
output: string;
|
|
26
27
|
rainbowAuthService: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../src/commands/build/find.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW,CAAC,OAAO,IAAI,CAAC;IACxD,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,WAAW,SAAgC;IAElD,MAAM,CAAC,QAAQ,WAmBb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;;;;;;;MA6CV;
|
|
1
|
+
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../src/commands/build/find.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW,CAAC,OAAO,IAAI,CAAC;IACxD,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,WAAW,SAAgC;IAElD,MAAM,CAAC,QAAQ,WAmBb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;;;;;;;MA6CV;YAGY,oBAAoB;IA6B5B,YAAY,CAAC,KAAK,EAAE;QACxB,MAAM,EAAE,MAAM,CAAC;QACf,kBAAkB,EAAE,MAAM,CAAC;QAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,GAAG,CAAC,EAAE,OAAO,CAAC;KACf;IAgLD,OAAO,CAAC,uBAAuB;IAgB/B,OAAO,CAAC,aAAa;IAiCf,cAAc,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,kBAAkB,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;IA+C5G,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAO3B"}
|
|
@@ -75,6 +75,29 @@ Find modules for a specific application and version.
|
|
|
75
75
|
description: 'query modules for all applications',
|
|
76
76
|
}),
|
|
77
77
|
};
|
|
78
|
+
// Helper method to fetch WorkOS environment name for an application version
|
|
79
|
+
async getWorkOSEnvironment(catalogService, userId, organizationId, applicationName, versionId) {
|
|
80
|
+
try {
|
|
81
|
+
const envResp = await catalogService.getEnvs({
|
|
82
|
+
userId,
|
|
83
|
+
organizationId,
|
|
84
|
+
envs: [
|
|
85
|
+
{
|
|
86
|
+
applicationName,
|
|
87
|
+
currentVersionId: versionId,
|
|
88
|
+
key: 'env:WORKOS_ENVIRONMENT',
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
});
|
|
92
|
+
// Look for the WORKOS_ENVIRONMENT env var
|
|
93
|
+
const workosEnv = envResp.envs.find(e => e.key === 'env:WORKOS_ENVIRONMENT');
|
|
94
|
+
return workosEnv?.value;
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
// If we can't fetch env vars, just return undefined
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
78
101
|
async queryModules(flags) {
|
|
79
102
|
let applicationName;
|
|
80
103
|
let applicationVersionId;
|
|
@@ -113,7 +136,11 @@ Find modules for a specific application and version.
|
|
|
113
136
|
}, {});
|
|
114
137
|
// Display grouped modules in compact format
|
|
115
138
|
for (const [appKey, modules] of Object.entries(modulesByApp)) {
|
|
116
|
-
|
|
139
|
+
// Fetch WorkOS environment for this app/version
|
|
140
|
+
const firstModule = modules[0];
|
|
141
|
+
const workosEnv = firstModule ? await this.getWorkOSEnvironment(catalogService, userId, organizationId, firstModule.applicationName, firstModule.applicationVersionId) : undefined;
|
|
142
|
+
const workosInfo = workosEnv ? ` ${chalk.magenta(`[WorkOS: ${workosEnv}]`)}` : '';
|
|
143
|
+
console.log(`\n${chalk.bold(appKey)}${workosInfo} ${chalk.dim(`(${modules.length} module${modules.length !== 1 ? 's' : ''})`)}`);
|
|
117
144
|
for (const module of modules) {
|
|
118
145
|
const convergedStatus = module.convergedAt
|
|
119
146
|
? chalk.green('converged')
|
|
@@ -147,7 +174,11 @@ Find modules for a specific application and version.
|
|
|
147
174
|
}, {});
|
|
148
175
|
// Display grouped modules in full format (compact style with all details)
|
|
149
176
|
for (const [appKey, modules] of Object.entries(modulesByApp)) {
|
|
150
|
-
|
|
177
|
+
// Fetch WorkOS environment for this app/version
|
|
178
|
+
const firstModule = modules[0];
|
|
179
|
+
const workosEnv = firstModule ? await this.getWorkOSEnvironment(catalogService, userId, organizationId, firstModule.applicationName, firstModule.applicationVersionId) : undefined;
|
|
180
|
+
const workosInfo = workosEnv ? ` ${chalk.magenta(`[WorkOS: ${workosEnv}]`)}` : '';
|
|
181
|
+
console.log(`\n${chalk.bold(appKey)}${workosInfo} ${chalk.dim(`(${modules.length} module${modules.length !== 1 ? 's' : ''})`)}`);
|
|
151
182
|
for (const module of modules) {
|
|
152
183
|
const convergedStatus = module.convergedAt
|
|
153
184
|
? chalk.green('converged')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/commands/build/validate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/commands/build/validate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAgBpD,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,WAAW,CAAC,OAAO,KAAK,CAAC;IAC1D,OAAgB,IAAI,KAAM;IAE1B,OAAgB,WAAW,SAAiD;IAE5E,OAAgB,QAAQ,WAA2C;IAEnE,OAAgB,KAAK;;;;;MAgBnB;IAEW,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAsBlC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
2
|
+
export default class Delete extends BaseCommand<typeof Delete> {
|
|
3
|
+
static args: {};
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
rainbowAuthService: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
raindropCatalogService: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
rainbowAuthToken: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
rainbowOrganizationId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
rainbowUserId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
sendVersionMetadata: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/commands/build/workos/delete.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,WAAW,SAA+D;IAEjF,MAAM,CAAC,QAAQ,WAOb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;MAOV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAqD3B"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { confirm } from '@inquirer/prompts';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
5
|
+
export default class Delete extends BaseCommand {
|
|
6
|
+
static args = {};
|
|
7
|
+
static description = 'Delete all WorkOS integration state from the organization';
|
|
8
|
+
static examples = [
|
|
9
|
+
`<%= config.bin %> <%= command.id %>
|
|
10
|
+
Delete all WorkOS state with confirmation prompt
|
|
11
|
+
|
|
12
|
+
<%= config.bin %> <%= command.id %> --force
|
|
13
|
+
Delete all WorkOS state without confirmation prompt
|
|
14
|
+
`,
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
18
|
+
force: Flags.boolean({
|
|
19
|
+
char: 'f',
|
|
20
|
+
description: 'Skip confirmation prompt',
|
|
21
|
+
default: false,
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
async run() {
|
|
25
|
+
const { client: workosService, userId, organizationId } = await this.workosIntegrationService();
|
|
26
|
+
// Show a big warning about what will be deleted
|
|
27
|
+
this.log('');
|
|
28
|
+
this.log(chalk.red.bold('⚠️ WARNING: DESTRUCTIVE OPERATION'));
|
|
29
|
+
this.log(chalk.red('━'.repeat(50)));
|
|
30
|
+
this.log('');
|
|
31
|
+
this.log('This command will permanently delete ALL WorkOS integration state:');
|
|
32
|
+
this.log('');
|
|
33
|
+
this.log(chalk.yellow(' • WorkOS team information'));
|
|
34
|
+
this.log(chalk.yellow(' • All environment configurations'));
|
|
35
|
+
this.log(chalk.yellow(' • All API keys stored in state'));
|
|
36
|
+
this.log(chalk.yellow(' • Primary organization name'));
|
|
37
|
+
this.log('');
|
|
38
|
+
this.log(chalk.dim('Note: This only affects local state. Nothing will be deleted from'));
|
|
39
|
+
this.log(chalk.dim('WorkOS itself. You must manage WorkOS resources separately.'));
|
|
40
|
+
this.log('');
|
|
41
|
+
this.log(chalk.red('This action CANNOT be undone!'));
|
|
42
|
+
this.log(chalk.red('━'.repeat(50)));
|
|
43
|
+
this.log('');
|
|
44
|
+
// Unless forced, ask for confirmation
|
|
45
|
+
if (!this.flags.force) {
|
|
46
|
+
const shouldDelete = await confirm({
|
|
47
|
+
message: 'Are you absolutely sure you want to delete all WorkOS state?',
|
|
48
|
+
default: false,
|
|
49
|
+
});
|
|
50
|
+
if (!shouldDelete) {
|
|
51
|
+
this.log(chalk.dim('Deletion cancelled'));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
this.log('Deleting all WorkOS state...');
|
|
57
|
+
await workosService.deleteAllWorkOSState({
|
|
58
|
+
userId,
|
|
59
|
+
organizationId,
|
|
60
|
+
});
|
|
61
|
+
this.log('');
|
|
62
|
+
this.log(chalk.green('✓ All WorkOS state has been deleted successfully'));
|
|
63
|
+
this.log('');
|
|
64
|
+
this.log(chalk.dim('To re-activate WorkOS integration, run:'));
|
|
65
|
+
this.log(chalk.dim(' raindrop build workos setup --admin-email <email>'));
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
const err = error;
|
|
69
|
+
this.error(`Failed to delete WorkOS state: ${err.message}`, { exit: 1 });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../../base-command.js';
|
|
2
|
+
export default class Attach extends BaseCommand<typeof Attach> {
|
|
3
|
+
static args: {
|
|
4
|
+
envName: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
root: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
manifest: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
application: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
versionId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
rainbowAuthService: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
raindropCatalogService: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
rainbowAuthToken: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
rainbowOrganizationId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
rainbowUserId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
sendVersionMetadata: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
};
|
|
22
|
+
run(): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=attach.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attach.d.ts","sourceRoot":"","sources":["../../../../../src/commands/build/workos/env/attach.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,MAAM,CAAC,IAAI;;MAKT;IAEF,MAAM,CAAC,WAAW,SAA2D;IAE7E,MAAM,CAAC,QAAQ,WAUb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;;;MA+BV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAwE3B"}
|