@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.
Files changed (178) hide show
  1. package/README.md +408 -73
  2. package/bin/cjs-shims.js +7 -0
  3. package/bin/run.js +20 -2
  4. package/bundle/chunk-5GH4FS6C.js +12148 -0
  5. package/bundle/chunk-6B4I2CKP.js +231 -0
  6. package/bundle/chunk-6UE75KX2.js +4481 -0
  7. package/bundle/chunk-AU3EGGJP.js +44 -0
  8. package/bundle/chunk-CDQRD3JA.js +75 -0
  9. package/bundle/chunk-CMCEP64V.js +380 -0
  10. package/bundle/chunk-CW5ZHVPX.js +292 -0
  11. package/bundle/chunk-G6NE675D.js +238720 -0
  12. package/bundle/chunk-GLIYVKQA.js +48 -0
  13. package/bundle/chunk-KXEV6E63.js +133 -0
  14. package/bundle/chunk-MCRKUPJY.js +4515 -0
  15. package/bundle/chunk-MGM2L2T3.js +805 -0
  16. package/bundle/chunk-MVQYQJHI.js +502 -0
  17. package/bundle/chunk-NG7CZTTE.js +147 -0
  18. package/bundle/chunk-PU4RCSXF.js +22452 -0
  19. package/bundle/chunk-VXAZKB3J.js +292 -0
  20. package/bundle/chunk-W2L3MYN6.js +4480 -0
  21. package/bundle/chunk-XYJACVNA.js +231 -0
  22. package/bundle/commands/annotation/get.js +153 -0
  23. package/bundle/commands/annotation/list.js +226 -0
  24. package/bundle/commands/annotation/put.js +177 -0
  25. package/bundle/commands/auth/list.js +75 -0
  26. package/bundle/commands/auth/login.js +1654 -0
  27. package/bundle/commands/auth/logout.js +27 -0
  28. package/bundle/commands/auth/select.js +53 -0
  29. package/bundle/commands/bucket/create-credential.js +173 -0
  30. package/bundle/commands/bucket/delete-credential.js +140 -0
  31. package/bundle/commands/bucket/get-credential.js +151 -0
  32. package/bundle/commands/bucket/list-credentials.js +148 -0
  33. package/bundle/commands/build/branch.js +126 -0
  34. package/bundle/commands/build/checkout.js +198 -0
  35. package/bundle/commands/build/clone.js +153 -0
  36. package/bundle/commands/build/delete.js +227 -0
  37. package/bundle/commands/build/deploy.js +160 -0
  38. package/bundle/commands/build/env/get.js +105 -0
  39. package/bundle/commands/build/env/set.js +115 -0
  40. package/bundle/commands/build/find.js +333 -0
  41. package/bundle/commands/build/generate.js +75 -0
  42. package/bundle/commands/build/init.js +76 -0
  43. package/bundle/commands/build/list.js +11 -0
  44. package/bundle/commands/build/sandbox.js +65 -0
  45. package/bundle/commands/build/start.js +84 -0
  46. package/bundle/commands/build/status.js +1839 -0
  47. package/bundle/commands/build/stop.js +84 -0
  48. package/bundle/commands/build/tools/check.js +32 -0
  49. package/bundle/commands/build/tools/fmt.js +49 -0
  50. package/bundle/commands/build/unsandbox.js +65 -0
  51. package/bundle/commands/build/upload.js +83 -0
  52. package/bundle/commands/build/validate.js +71 -0
  53. package/bundle/commands/build/workos/delete.js +86 -0
  54. package/bundle/commands/build/workos/env/attach.js +134 -0
  55. package/bundle/commands/build/workos/env/create.js +176 -0
  56. package/bundle/commands/build/workos/env/delete.js +84 -0
  57. package/bundle/commands/build/workos/env/detach.js +115 -0
  58. package/bundle/commands/build/workos/env/get.js +117 -0
  59. package/bundle/commands/build/workos/env/list.js +139 -0
  60. package/bundle/commands/build/workos/env/set.js +138 -0
  61. package/bundle/commands/build/workos/invite.js +91 -0
  62. package/bundle/commands/build/workos/setup.js +124 -0
  63. package/bundle/commands/build/workos/status.js +93 -0
  64. package/bundle/commands/dns/create.js +128 -0
  65. package/bundle/commands/dns/delete.js +80 -0
  66. package/bundle/commands/dns/get.js +167 -0
  67. package/bundle/commands/dns/list.js +193 -0
  68. package/bundle/commands/dns/records/create.js +150 -0
  69. package/bundle/commands/dns/records/delete.js +76 -0
  70. package/bundle/commands/dns/records/get.js +118 -0
  71. package/bundle/commands/dns/records/list.js +153 -0
  72. package/bundle/commands/dns/records/update.js +146 -0
  73. package/bundle/commands/logs/query.js +237 -0
  74. package/bundle/commands/logs/tail.js +155 -0
  75. package/bundle/commands/mcp/install-claude.js +220 -0
  76. package/bundle/commands/mcp/install-gemini.js +220 -0
  77. package/bundle/commands/mcp/install-goose.js +232 -0
  78. package/bundle/commands/mcp/status.js +153 -0
  79. package/bundle/commands/object/delete.js +180 -0
  80. package/bundle/commands/object/get.js +209 -0
  81. package/bundle/commands/object/list.js +206 -0
  82. package/bundle/commands/object/put.js +211 -0
  83. package/bundle/commands/query/chunk-search.js +123 -0
  84. package/bundle/commands/query/document.js +126 -0
  85. package/bundle/commands/query/events.js +98 -0
  86. package/bundle/commands/query/reindex.js +147 -0
  87. package/bundle/commands/query/search.js +169 -0
  88. package/bundle/commands/tail.js +31 -0
  89. package/bundle/index.js +51 -0
  90. package/dist/base-command.d.ts +6 -0
  91. package/dist/base-command.d.ts.map +1 -1
  92. package/dist/base-command.js +14 -1
  93. package/dist/build.d.ts +2 -1
  94. package/dist/build.d.ts.map +1 -1
  95. package/dist/build.js +169 -51
  96. package/dist/codegen.d.ts +1 -1
  97. package/dist/codegen.d.ts.map +1 -1
  98. package/dist/codegen.js +17 -3
  99. package/dist/codegen.test.js +44 -0
  100. package/dist/commands/build/checkout.d.ts.map +1 -1
  101. package/dist/commands/build/checkout.js +4 -0
  102. package/dist/commands/build/delete.d.ts.map +1 -1
  103. package/dist/commands/build/delete.js +6 -3
  104. package/dist/commands/build/deploy.d.ts.map +1 -1
  105. package/dist/commands/build/deploy.js +10 -2
  106. package/dist/commands/build/find.d.ts +1 -0
  107. package/dist/commands/build/find.d.ts.map +1 -1
  108. package/dist/commands/build/find.js +33 -2
  109. package/dist/commands/build/validate.d.ts.map +1 -1
  110. package/dist/commands/build/validate.js +0 -1
  111. package/dist/commands/build/workos/delete.d.ts +18 -0
  112. package/dist/commands/build/workos/delete.d.ts.map +1 -0
  113. package/dist/commands/build/workos/delete.js +72 -0
  114. package/dist/commands/build/workos/env/attach.d.ts +24 -0
  115. package/dist/commands/build/workos/env/attach.d.ts.map +1 -0
  116. package/dist/commands/build/workos/env/attach.js +111 -0
  117. package/dist/commands/build/workos/env/create.d.ts +26 -0
  118. package/dist/commands/build/workos/env/create.d.ts.map +1 -0
  119. package/dist/commands/build/workos/env/create.js +156 -0
  120. package/dist/commands/build/workos/env/delete.d.ts +20 -0
  121. package/dist/commands/build/workos/env/delete.d.ts.map +1 -0
  122. package/dist/commands/build/workos/env/delete.js +61 -0
  123. package/dist/commands/build/workos/env/detach.d.ts +21 -0
  124. package/dist/commands/build/workos/env/detach.d.ts.map +1 -0
  125. package/dist/commands/build/workos/env/detach.js +94 -0
  126. package/dist/commands/build/workos/env/get.d.ts +20 -0
  127. package/dist/commands/build/workos/env/get.d.ts.map +1 -0
  128. package/dist/commands/build/workos/env/get.js +94 -0
  129. package/dist/commands/build/workos/env/list.d.ts +18 -0
  130. package/dist/commands/build/workos/env/list.d.ts.map +1 -0
  131. package/dist/commands/build/workos/env/list.js +114 -0
  132. package/dist/commands/build/workos/env/set.d.ts +27 -0
  133. package/dist/commands/build/workos/env/set.d.ts.map +1 -0
  134. package/dist/commands/build/workos/env/set.js +115 -0
  135. package/dist/commands/build/workos/invite.d.ts +21 -0
  136. package/dist/commands/build/workos/invite.d.ts.map +1 -0
  137. package/dist/commands/build/workos/invite.js +68 -0
  138. package/dist/commands/build/workos/setup.d.ts +20 -0
  139. package/dist/commands/build/workos/setup.d.ts.map +1 -0
  140. package/dist/commands/build/workos/setup.js +106 -0
  141. package/dist/commands/build/workos/status.d.ts +18 -0
  142. package/dist/commands/build/workos/status.d.ts.map +1 -0
  143. package/dist/commands/build/workos/status.js +70 -0
  144. package/dist/commands/mcp/install-claude.d.ts.map +1 -1
  145. package/dist/commands/mcp/install-claude.js +0 -2
  146. package/dist/commands/mcp/install-gemini.d.ts.map +1 -1
  147. package/dist/commands/mcp/install-gemini.js +0 -2
  148. package/dist/commands/mcp/install-goose.d.ts.map +1 -1
  149. package/dist/commands/mcp/install-goose.js +0 -2
  150. package/dist/deploy.d.ts.map +1 -1
  151. package/dist/deploy.js +2 -2
  152. package/dist/index.d.ts +2 -0
  153. package/dist/index.d.ts.map +1 -1
  154. package/dist/index.js +4 -0
  155. package/oclif.manifest.json +4544 -2466
  156. package/package.json +8 -5
  157. package/templates/claude-code/debug-raindrop-app.md +89 -0
  158. package/templates/claude-code/new-raindrop-app.md +10 -6
  159. package/templates/claude-code/reattach-raindrop-session.md +50 -12
  160. package/templates/claude-code/update-raindrop-app.md +61 -9
  161. package/templates/db/node_modules/.bin/prisma +2 -2
  162. package/templates/db/node_modules/.bin/prisma-kysely +2 -2
  163. package/templates/db/node_modules/.bin/tsc +2 -2
  164. package/templates/db/node_modules/.bin/tsserver +2 -2
  165. package/templates/db/node_modules/.bin/zx +2 -2
  166. package/templates/gemini-code/debug-raindrop-app.toml +86 -0
  167. package/templates/gemini-code/new-raindrop-app.toml +9 -5
  168. package/templates/gemini-code/reattach-raindrop-session.toml +9 -11
  169. package/templates/gemini-code/update-raindrop-app.toml +55 -10
  170. package/templates/goose/debug-raindrop-app.yaml +91 -0
  171. package/templates/goose/new-raindrop-app.yaml +12 -7
  172. package/templates/goose/reattach-raindrop-session.yaml +11 -4
  173. package/templates/goose/update-raindrop-app.yaml +57 -5
  174. package/templates/init/src/_app/auth.ts +18 -0
  175. package/templates/init/src/_app/cors.ts +64 -0
  176. package/dist/tsconfig.tsbuildinfo +0 -1
  177. package/templates/claude-code/raindrop-guidelines.md +0 -322
  178. package/templates/gemini-code/raindrop-guidelines.md +0 -322
@@ -0,0 +1,176 @@
1
+ import {
2
+ source_default
3
+ } from "../../../../chunk-MVQYQJHI.js";
4
+ import {
5
+ BaseCommand
6
+ } from "../../../../chunk-MCRKUPJY.js";
7
+ import {
8
+ EnvironmentType,
9
+ __toESM,
10
+ init_cjs_shims,
11
+ require_lib,
12
+ valueOf
13
+ } from "../../../../chunk-G6NE675D.js";
14
+
15
+ // src/commands/build/workos/env/create.ts
16
+ init_cjs_shims();
17
+ var import_core = __toESM(require_lib(), 1);
18
+ var Create = class extends BaseCommand {
19
+ static args = {
20
+ envName: import_core.Args.string({
21
+ description: "environment name (defaults to application name)",
22
+ required: false
23
+ })
24
+ };
25
+ static description = "Create a WorkOS environment for a Raindrop app";
26
+ static examples = [
27
+ `<%= config.bin %> <%= command.id %>
28
+ Create WorkOS environment with application name and auto-attach
29
+
30
+ <%= config.bin %> <%= command.id %> my-env
31
+ Create environment with specific name and auto-attach
32
+
33
+ <%= config.bin %> <%= command.id %> my-env --noattach
34
+ Create environment without attaching to current version
35
+
36
+ <%= config.bin %> <%= command.id %> my-env --name "Acme Inc"
37
+ Create with explicit organization name
38
+
39
+ <%= config.bin %> <%= command.id %> my-env --output json
40
+ Get JSON output
41
+ `
42
+ ];
43
+ static flags = {
44
+ ...BaseCommand.HIDDEN_FLAGS,
45
+ root: import_core.Flags.string({
46
+ char: "r",
47
+ description: "root directory",
48
+ required: false,
49
+ default: process.cwd()
50
+ }),
51
+ manifest: import_core.Flags.string({
52
+ char: "M",
53
+ description: "project manifest",
54
+ required: false,
55
+ default: "raindrop.manifest"
56
+ }),
57
+ application: import_core.Flags.string({
58
+ char: "a",
59
+ description: "application name",
60
+ required: false
61
+ }),
62
+ versionId: import_core.Flags.string({
63
+ char: "v",
64
+ aliases: ["version"],
65
+ description: "version ID",
66
+ required: false
67
+ }),
68
+ name: import_core.Flags.string({
69
+ description: "primary organization name (optional if cached)",
70
+ required: false
71
+ }),
72
+ noattach: import_core.Flags.boolean({
73
+ description: "do not attach environment to current version after creation",
74
+ default: false
75
+ }),
76
+ output: import_core.Flags.string({
77
+ char: "o",
78
+ description: "output format",
79
+ default: "text",
80
+ options: ["text", "json"]
81
+ })
82
+ };
83
+ async run() {
84
+ const apps = await this.loadManifest();
85
+ const app = apps.find((app2) => valueOf(app2.name) === this.flags.application) || apps[0];
86
+ if (app === void 0) {
87
+ this.error(`application ${this.flags.application} not found in manifest`, { exit: 1 });
88
+ }
89
+ const applicationName = valueOf(app.name);
90
+ const environmentName = this.args.envName || applicationName;
91
+ const { client: workosService, userId, organizationId } = await this.workosIntegrationService();
92
+ try {
93
+ await workosService.createEnvironment({
94
+ userId,
95
+ organizationId,
96
+ environmentName,
97
+ environmentType: EnvironmentType.STAGING,
98
+ primaryOrganizationName: this.flags.name
99
+ });
100
+ let attached = false;
101
+ if (!this.flags.noattach) {
102
+ try {
103
+ const config = await this.loadConfig();
104
+ const versionId = this.flags.versionId || config.versionId;
105
+ if (versionId) {
106
+ await workosService.attachEnvironmentToVersion({
107
+ userId,
108
+ organizationId,
109
+ applicationName,
110
+ versionId,
111
+ environmentName
112
+ });
113
+ attached = true;
114
+ }
115
+ } catch (attachError) {
116
+ const err = attachError;
117
+ if (this.flags.output === "text") {
118
+ this.log(source_default.yellow("Warning: ") + `Failed to auto-attach environment: ${err.message}`);
119
+ this.log(source_default.dim("You can manually attach with: raindrop build workos env attach " + environmentName));
120
+ }
121
+ }
122
+ }
123
+ switch (this.flags.output) {
124
+ case "json":
125
+ console.log(
126
+ JSON.stringify(
127
+ {
128
+ success: true,
129
+ environmentName,
130
+ environmentType: "staging",
131
+ attached,
132
+ applicationName
133
+ },
134
+ null,
135
+ 2
136
+ )
137
+ );
138
+ break;
139
+ case "text":
140
+ default:
141
+ this.log(source_default.green("\u2713") + ` WorkOS environment created for ${source_default.bold(environmentName)}`);
142
+ this.log("");
143
+ this.log(` ${source_default.cyan("Environment:")} ${environmentName}`);
144
+ this.log(` ${source_default.cyan("Type:")} staging`);
145
+ if (attached) {
146
+ this.log(` ${source_default.cyan("Attached to:")} ${applicationName} (current version)`);
147
+ }
148
+ this.log("");
149
+ this.log(source_default.dim("The environment, organization, and API key have been automatically configured."));
150
+ if (attached) {
151
+ this.log(source_default.dim("Environment has been attached to the current version."));
152
+ }
153
+ this.log(source_default.dim("View details with: raindrop build workos env get " + environmentName));
154
+ break;
155
+ }
156
+ } catch (error) {
157
+ const err = error;
158
+ if (err.message.includes("team not found")) {
159
+ this.error(
160
+ "WorkOS integration not activated. Run: raindrop build workos setup --admin-email <email>",
161
+ { exit: 1 }
162
+ );
163
+ }
164
+ if (err.message.includes("already exists")) {
165
+ this.error(
166
+ `WorkOS environment already exists for ${environmentName}. Use 'raindrop build workos env get ${environmentName}' to view it.`,
167
+ { exit: 1 }
168
+ );
169
+ }
170
+ this.error(`Failed to create WorkOS environment: ${err.message}`, { exit: 1 });
171
+ }
172
+ }
173
+ };
174
+ export {
175
+ Create as default
176
+ };
@@ -0,0 +1,84 @@
1
+ import {
2
+ source_default
3
+ } from "../../../../chunk-MVQYQJHI.js";
4
+ import {
5
+ BaseCommand
6
+ } from "../../../../chunk-MCRKUPJY.js";
7
+ import {
8
+ __toESM,
9
+ init_cjs_shims,
10
+ require_lib
11
+ } from "../../../../chunk-G6NE675D.js";
12
+
13
+ // src/commands/build/workos/env/delete.ts
14
+ init_cjs_shims();
15
+ var import_core = __toESM(require_lib(), 1);
16
+ var Delete = class extends BaseCommand {
17
+ static args = {
18
+ appName: import_core.Args.string({
19
+ description: "raindrop app name",
20
+ required: true
21
+ })
22
+ };
23
+ static description = "Remove WorkOS environment configuration (does NOT delete from WorkOS)";
24
+ static examples = [
25
+ `<%= config.bin %> <%= command.id %> my-app
26
+ Remove WorkOS environment configuration for app
27
+
28
+ <%= config.bin %> <%= command.id %> my-app --output json
29
+ Get JSON output
30
+ `
31
+ ];
32
+ static flags = {
33
+ ...BaseCommand.HIDDEN_FLAGS,
34
+ output: import_core.Flags.string({
35
+ char: "o",
36
+ description: "output format",
37
+ default: "text",
38
+ options: ["text", "json"]
39
+ })
40
+ };
41
+ async run() {
42
+ const { client: workosService, userId, organizationId } = await this.workosIntegrationService();
43
+ try {
44
+ await workosService.deleteEnvironment({
45
+ userId,
46
+ organizationId,
47
+ environmentName: this.args.appName
48
+ });
49
+ switch (this.flags.output) {
50
+ case "json":
51
+ console.log(
52
+ JSON.stringify(
53
+ {
54
+ success: true,
55
+ appName: this.args.appName
56
+ },
57
+ null,
58
+ 2
59
+ )
60
+ );
61
+ break;
62
+ case "text":
63
+ default:
64
+ this.log(source_default.green("\u2713") + ` WorkOS environment configuration removed for ${source_default.bold(this.args.appName)}`);
65
+ this.log("");
66
+ this.log(source_default.yellow("\u26A0") + " " + source_default.dim("Note: This only removes the configuration from Raindrop."));
67
+ this.log(source_default.dim(" To delete the environment from WorkOS, manage it in the WorkOS dashboard."));
68
+ break;
69
+ }
70
+ } catch (error) {
71
+ const err = error;
72
+ if (err.message.includes("not found")) {
73
+ this.error(
74
+ `WorkOS environment not found for ${this.args.appName}`,
75
+ { exit: 1 }
76
+ );
77
+ }
78
+ this.error(`Failed to delete WorkOS environment: ${err.message}`, { exit: 1 });
79
+ }
80
+ }
81
+ };
82
+ export {
83
+ Delete as default
84
+ };
@@ -0,0 +1,115 @@
1
+ import {
2
+ source_default
3
+ } from "../../../../chunk-MVQYQJHI.js";
4
+ import {
5
+ BaseCommand
6
+ } from "../../../../chunk-MCRKUPJY.js";
7
+ import {
8
+ __toESM,
9
+ init_cjs_shims,
10
+ require_lib,
11
+ valueOf
12
+ } from "../../../../chunk-G6NE675D.js";
13
+
14
+ // src/commands/build/workos/env/detach.ts
15
+ init_cjs_shims();
16
+ var import_core = __toESM(require_lib(), 1);
17
+ var Detach = class extends BaseCommand {
18
+ static description = "Detach WorkOS environment from an application version";
19
+ static examples = [
20
+ `<%= config.bin %> <%= command.id %>
21
+ Detach WorkOS environment from current version
22
+
23
+ <%= config.bin %> <%= command.id %> --application my-app --versionId abc123
24
+ Detach from specific application and version
25
+ `
26
+ ];
27
+ static flags = {
28
+ ...BaseCommand.HIDDEN_FLAGS,
29
+ root: import_core.Flags.string({
30
+ char: "r",
31
+ description: "root directory",
32
+ required: false,
33
+ default: process.cwd()
34
+ }),
35
+ manifest: import_core.Flags.string({
36
+ char: "M",
37
+ description: "project manifest",
38
+ required: false,
39
+ default: "raindrop.manifest"
40
+ }),
41
+ application: import_core.Flags.string({
42
+ char: "a",
43
+ description: "application name",
44
+ required: false
45
+ }),
46
+ versionId: import_core.Flags.string({
47
+ char: "v",
48
+ aliases: ["version"],
49
+ description: "version ID",
50
+ required: false
51
+ }),
52
+ output: import_core.Flags.string({
53
+ char: "o",
54
+ description: "output format",
55
+ default: "text",
56
+ options: ["text", "json"]
57
+ })
58
+ };
59
+ async run() {
60
+ const apps = await this.loadManifest();
61
+ const app = apps.find((app2) => valueOf(app2.name) === this.flags.application) || apps[0];
62
+ if (app === void 0) {
63
+ this.error(`application ${this.flags.application} not found in manifest`, { exit: 1 });
64
+ }
65
+ const applicationName = valueOf(app.name);
66
+ const config = await this.loadConfig();
67
+ const versionId = this.flags.versionId || config.versionId;
68
+ if (!versionId) {
69
+ this.error(
70
+ "No version ID found. Deploy your application first with: raindrop build deploy",
71
+ { exit: 1 }
72
+ );
73
+ }
74
+ const { client: workosService, userId, organizationId } = await this.workosIntegrationService();
75
+ try {
76
+ await workosService.detachEnvironmentFromVersion({
77
+ userId,
78
+ organizationId,
79
+ applicationName,
80
+ versionId
81
+ });
82
+ switch (this.flags.output) {
83
+ case "json":
84
+ console.log(
85
+ JSON.stringify(
86
+ {
87
+ success: true,
88
+ applicationName,
89
+ versionId
90
+ },
91
+ null,
92
+ 2
93
+ )
94
+ );
95
+ break;
96
+ case "text":
97
+ default:
98
+ this.log(source_default.green("\u2713") + ` WorkOS environment detached`);
99
+ this.log("");
100
+ this.log(` ${source_default.cyan("Application:")} ${applicationName}`);
101
+ this.log(` ${source_default.cyan("Version ID:")} ${versionId}`);
102
+ this.log("");
103
+ this.log(source_default.dim("The WORKOS_ENVIRONMENT variable has been removed from this version."));
104
+ this.log(source_default.dim("Changes will take effect after convergence completes."));
105
+ break;
106
+ }
107
+ } catch (error) {
108
+ const err = error;
109
+ this.error(`Failed to detach WorkOS environment: ${err.message}`, { exit: 1 });
110
+ }
111
+ }
112
+ };
113
+ export {
114
+ Detach as default
115
+ };
@@ -0,0 +1,117 @@
1
+ import {
2
+ source_default
3
+ } from "../../../../chunk-MVQYQJHI.js";
4
+ import {
5
+ BaseCommand
6
+ } from "../../../../chunk-MCRKUPJY.js";
7
+ import {
8
+ __toESM,
9
+ init_cjs_shims,
10
+ require_lib
11
+ } from "../../../../chunk-G6NE675D.js";
12
+
13
+ // src/commands/build/workos/env/get.ts
14
+ init_cjs_shims();
15
+ var import_core = __toESM(require_lib(), 1);
16
+ var Get = class extends BaseCommand {
17
+ static args = {
18
+ appName: import_core.Args.string({
19
+ description: "raindrop app name",
20
+ required: true
21
+ })
22
+ };
23
+ static description = "Get WorkOS environment details for a Raindrop app";
24
+ static examples = [
25
+ `<%= config.bin %> <%= command.id %> my-app
26
+ View WorkOS environment details
27
+
28
+ <%= config.bin %> <%= command.id %> my-app --output json
29
+ Get JSON output
30
+ `
31
+ ];
32
+ static flags = {
33
+ ...BaseCommand.HIDDEN_FLAGS,
34
+ output: import_core.Flags.string({
35
+ char: "o",
36
+ description: "output format",
37
+ default: "text",
38
+ options: ["text", "json", "table"]
39
+ })
40
+ };
41
+ async run() {
42
+ const { client: workosService, userId, organizationId } = await this.workosIntegrationService();
43
+ try {
44
+ const response = await workosService.getEnvironment({
45
+ userId,
46
+ organizationId,
47
+ environmentName: this.args.appName
48
+ });
49
+ if (!response.environment) {
50
+ this.error(`WorkOS environment not found for ${this.args.appName}`, { exit: 1 });
51
+ }
52
+ const env = response.environment;
53
+ switch (this.flags.output) {
54
+ case "json":
55
+ console.log(
56
+ JSON.stringify(
57
+ {
58
+ name: env.name,
59
+ environmentId: env.environmentId,
60
+ clientId: env.clientId,
61
+ environmentType: env.environmentType,
62
+ connect: env.workosConnectHostname,
63
+ apiHostname: env.workosApiHostname,
64
+ organizationId: env.workosOrganizationId
65
+ },
66
+ null,
67
+ 2
68
+ )
69
+ );
70
+ break;
71
+ case "table":
72
+ console.table({
73
+ "App Name": env.name,
74
+ "Environment ID": env.environmentId,
75
+ "Client ID": env.clientId,
76
+ "Type": env.environmentType || "staging",
77
+ "Connect": env.workosConnectHostname || "",
78
+ "API": env.workosApiHostname || "",
79
+ "Org ID": env.workosOrganizationId || ""
80
+ });
81
+ break;
82
+ case "text":
83
+ default:
84
+ this.log(source_default.bold(`WorkOS Environment: ${env.name}`));
85
+ this.log("");
86
+ this.log(` ${source_default.cyan("App Name:")} ${env.name}`);
87
+ this.log(` ${source_default.cyan("Environment ID:")} ${env.environmentId}`);
88
+ this.log(` ${source_default.cyan("Client ID:")} ${env.clientId}`);
89
+ this.log(` ${source_default.cyan("Type:")} ${env.environmentType || "staging"}`);
90
+ if (env.workosConnectHostname) {
91
+ this.log(` ${source_default.cyan("Connect:")} ${env.workosConnectHostname}`);
92
+ }
93
+ if (env.workosApiHostname) {
94
+ this.log(` ${source_default.cyan("API:")} ${env.workosApiHostname}`);
95
+ }
96
+ if (env.workosOrganizationId) {
97
+ this.log(` ${source_default.cyan("Org ID:")} ${env.workosOrganizationId}`);
98
+ }
99
+ this.log("");
100
+ this.log(source_default.dim("Note: API key value is stored securely and not displayed."));
101
+ break;
102
+ }
103
+ } catch (error) {
104
+ const err = error;
105
+ if (err.message.includes("not found")) {
106
+ this.error(
107
+ `WorkOS environment not found for ${this.args.appName}. Create one with: raindrop build workos env create ${this.args.appName}`,
108
+ { exit: 1 }
109
+ );
110
+ }
111
+ this.error(`Failed to get WorkOS environment: ${err.message}`, { exit: 1 });
112
+ }
113
+ }
114
+ };
115
+ export {
116
+ Get as default
117
+ };
@@ -0,0 +1,139 @@
1
+ import {
2
+ source_default
3
+ } from "../../../../chunk-MVQYQJHI.js";
4
+ import {
5
+ BaseCommand
6
+ } from "../../../../chunk-MCRKUPJY.js";
7
+ import {
8
+ EnvironmentType,
9
+ __toESM,
10
+ init_cjs_shims,
11
+ require_lib
12
+ } from "../../../../chunk-G6NE675D.js";
13
+
14
+ // src/commands/build/workos/env/list.ts
15
+ init_cjs_shims();
16
+ var import_core = __toESM(require_lib(), 1);
17
+ var List = class extends BaseCommand {
18
+ static args = {};
19
+ static description = "List all WorkOS environments for the organization";
20
+ static examples = [
21
+ `<%= config.bin %> <%= command.id %>
22
+ List all WorkOS environments in compact format (default)
23
+
24
+ <%= config.bin %> <%= command.id %> --output table
25
+ List all environments in table format
26
+
27
+ <%= config.bin %> <%= command.id %> --output json
28
+ List all environments in JSON format
29
+ `
30
+ ];
31
+ static flags = {
32
+ ...BaseCommand.HIDDEN_FLAGS,
33
+ output: import_core.Flags.string({
34
+ char: "o",
35
+ description: "output format",
36
+ default: "compact",
37
+ options: ["text", "table", "json", "compact"]
38
+ })
39
+ };
40
+ async run() {
41
+ const { client: workosService, userId, organizationId } = await this.workosIntegrationService();
42
+ try {
43
+ const response = await workosService.listEnvironments({
44
+ userId,
45
+ organizationId
46
+ });
47
+ if (!response.environments || response.environments.length === 0) {
48
+ this.log(source_default.dim("No WorkOS environments found in this organization"));
49
+ this.log(source_default.dim("Create a new environment with: raindrop build workos env create <app-name>"));
50
+ return;
51
+ }
52
+ switch (this.flags.output) {
53
+ case "compact":
54
+ for (const env of response.environments) {
55
+ const envTypeStr = env.environmentType === EnvironmentType.STAGING ? "staging" : "production";
56
+ const typeColor = env.environmentType === EnvironmentType.STAGING ? source_default.yellow : source_default.green;
57
+ console.log(`
58
+ ${source_default.bold(env.name)}`);
59
+ console.log(` \u2514\u2500 ${typeColor(envTypeStr)} - ${source_default.dim(env.environmentId)}`);
60
+ console.log(` ${source_default.dim(`Client ID: ${env.clientId}`)}`);
61
+ if (env.workosConnectHostname) {
62
+ console.log(` ${source_default.dim(`Connect: ${env.workosConnectHostname}`)}`);
63
+ }
64
+ if (env.workosApiHostname) {
65
+ console.log(` ${source_default.dim(`API: ${env.workosApiHostname}`)}`);
66
+ }
67
+ if (env.workosOrganizationId) {
68
+ console.log(` ${source_default.dim(`Org ID: ${env.workosOrganizationId}`)}`);
69
+ }
70
+ }
71
+ console.log("");
72
+ console.log(source_default.dim("\u2500".repeat(50)));
73
+ console.log(source_default.dim(`Total: ${response.environments.length} environments`));
74
+ break;
75
+ case "text":
76
+ for (const env of response.environments) {
77
+ console.log(`App: ${source_default.bold(env.name)}`);
78
+ console.log(` Environment ID: ${source_default.dim(env.environmentId)}`);
79
+ console.log(` Client ID: ${source_default.dim(env.clientId)}`);
80
+ console.log(` Type: ${source_default.cyan(env.environmentType || "staging")}`);
81
+ if (env.workosConnectHostname) {
82
+ console.log(` Connect: ${source_default.dim(env.workosConnectHostname)}`);
83
+ }
84
+ if (env.workosApiHostname) {
85
+ console.log(` API: ${source_default.dim(env.workosApiHostname)}`);
86
+ }
87
+ if (env.workosOrganizationId) {
88
+ console.log(` Org ID: ${source_default.dim(env.workosOrganizationId)}`);
89
+ }
90
+ console.log(source_default.dim("\u2500".repeat(50)));
91
+ }
92
+ this.log(source_default.bold(`
93
+ Total environments: ${response.environments.length}`));
94
+ break;
95
+ case "json":
96
+ console.log(
97
+ JSON.stringify(
98
+ {
99
+ environments: response.environments.map((env) => ({
100
+ name: env.name,
101
+ environmentId: env.environmentId,
102
+ clientId: env.clientId,
103
+ environmentType: env.environmentType,
104
+ connect: env.workosConnectHostname,
105
+ apiHostname: env.workosApiHostname,
106
+ organizationId: env.workosOrganizationId
107
+ })),
108
+ totalCount: response.environments.length
109
+ },
110
+ null,
111
+ 2
112
+ )
113
+ );
114
+ break;
115
+ case "table":
116
+ console.table(
117
+ response.environments.map((env) => ({
118
+ "App Name": env.name,
119
+ "Environment ID": env.environmentId,
120
+ "Client ID": env.clientId,
121
+ "Type": env.environmentType || "staging",
122
+ "Connect": env.workosConnectHostname || "",
123
+ "API": env.workosApiHostname || "",
124
+ "Org ID": env.workosOrganizationId || ""
125
+ }))
126
+ );
127
+ this.log(source_default.bold(`
128
+ Total environments: ${response.environments.length}`));
129
+ break;
130
+ }
131
+ } catch (error) {
132
+ const err = error;
133
+ this.error(`Failed to list WorkOS environments: ${err.message}`, { exit: 1 });
134
+ }
135
+ }
136
+ };
137
+ export {
138
+ List as default
139
+ };