@project-ajax/sdk 0.0.60 → 0.0.62

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 (150) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +0 -2
  4. package/package.json +4 -16
  5. package/src/index.ts +0 -1
  6. package/dist/capabilities/slashCommand.d.ts +0 -56
  7. package/dist/capabilities/slashCommand.d.ts.map +0 -1
  8. package/dist/capabilities/slashCommand.js +0 -32
  9. package/dist/cli/api/client.d.ts +0 -212
  10. package/dist/cli/api/client.d.ts.map +0 -1
  11. package/dist/cli/api/client.js +0 -330
  12. package/dist/cli/api/result.d.ts +0 -43
  13. package/dist/cli/api/result.d.ts.map +0 -1
  14. package/dist/cli/api/result.js +0 -43
  15. package/dist/cli/bin/cli.d.ts +0 -3
  16. package/dist/cli/bin/cli.d.ts.map +0 -1
  17. package/dist/cli/bin/cli.js +0 -5
  18. package/dist/cli/commands/auth.d.ts +0 -2
  19. package/dist/cli/commands/auth.d.ts.map +0 -1
  20. package/dist/cli/commands/auth.impl.d.ts +0 -5
  21. package/dist/cli/commands/auth.impl.d.ts.map +0 -1
  22. package/dist/cli/commands/auth.impl.js +0 -45
  23. package/dist/cli/commands/auth.impl.test.d.ts +0 -2
  24. package/dist/cli/commands/auth.impl.test.d.ts.map +0 -1
  25. package/dist/cli/commands/auth.js +0 -56
  26. package/dist/cli/commands/bundle.d.ts +0 -2
  27. package/dist/cli/commands/bundle.d.ts.map +0 -1
  28. package/dist/cli/commands/bundle.impl.d.ts +0 -2
  29. package/dist/cli/commands/bundle.impl.d.ts.map +0 -1
  30. package/dist/cli/commands/bundle.impl.js +0 -21
  31. package/dist/cli/commands/bundle.impl.test.d.ts +0 -2
  32. package/dist/cli/commands/bundle.impl.test.d.ts.map +0 -1
  33. package/dist/cli/commands/bundle.js +0 -23
  34. package/dist/cli/commands/capabilities.d.ts +0 -2
  35. package/dist/cli/commands/capabilities.d.ts.map +0 -1
  36. package/dist/cli/commands/capabilities.impl.d.ts +0 -3
  37. package/dist/cli/commands/capabilities.impl.d.ts.map +0 -1
  38. package/dist/cli/commands/capabilities.impl.js +0 -40
  39. package/dist/cli/commands/capabilities.js +0 -24
  40. package/dist/cli/commands/connect.d.ts +0 -2
  41. package/dist/cli/commands/connect.d.ts.map +0 -1
  42. package/dist/cli/commands/connect.impl.d.ts +0 -6
  43. package/dist/cli/commands/connect.impl.d.ts.map +0 -1
  44. package/dist/cli/commands/connect.impl.js +0 -116
  45. package/dist/cli/commands/connect.js +0 -78
  46. package/dist/cli/commands/deploy.d.ts +0 -3
  47. package/dist/cli/commands/deploy.d.ts.map +0 -1
  48. package/dist/cli/commands/deploy.impl.d.ts +0 -6
  49. package/dist/cli/commands/deploy.impl.d.ts.map +0 -1
  50. package/dist/cli/commands/deploy.impl.js +0 -60
  51. package/dist/cli/commands/deploy.impl.test.d.ts +0 -2
  52. package/dist/cli/commands/deploy.impl.test.d.ts.map +0 -1
  53. package/dist/cli/commands/deploy.js +0 -22
  54. package/dist/cli/commands/env.d.ts +0 -2
  55. package/dist/cli/commands/env.d.ts.map +0 -1
  56. package/dist/cli/commands/env.impl.d.ts +0 -11
  57. package/dist/cli/commands/env.impl.d.ts.map +0 -1
  58. package/dist/cli/commands/env.impl.js +0 -62
  59. package/dist/cli/commands/env.js +0 -39
  60. package/dist/cli/commands/exec.d.ts +0 -3
  61. package/dist/cli/commands/exec.d.ts.map +0 -1
  62. package/dist/cli/commands/exec.impl.d.ts +0 -7
  63. package/dist/cli/commands/exec.impl.d.ts.map +0 -1
  64. package/dist/cli/commands/exec.impl.js +0 -123
  65. package/dist/cli/commands/exec.js +0 -30
  66. package/dist/cli/commands/runs.d.ts +0 -2
  67. package/dist/cli/commands/runs.d.ts.map +0 -1
  68. package/dist/cli/commands/runs.impl.d.ts +0 -4
  69. package/dist/cli/commands/runs.impl.d.ts.map +0 -1
  70. package/dist/cli/commands/runs.impl.js +0 -71
  71. package/dist/cli/commands/runs.js +0 -45
  72. package/dist/cli/commands/secrets.d.ts +0 -2
  73. package/dist/cli/commands/secrets.d.ts.map +0 -1
  74. package/dist/cli/commands/secrets.impl.d.ts +0 -5
  75. package/dist/cli/commands/secrets.impl.d.ts.map +0 -1
  76. package/dist/cli/commands/secrets.impl.js +0 -99
  77. package/dist/cli/commands/secrets.js +0 -64
  78. package/dist/cli/commands/utils/testing.d.ts +0 -13
  79. package/dist/cli/commands/utils/testing.d.ts.map +0 -1
  80. package/dist/cli/commands/utils/testing.js +0 -58
  81. package/dist/cli/config.d.ts +0 -63
  82. package/dist/cli/config.d.ts.map +0 -1
  83. package/dist/cli/config.js +0 -194
  84. package/dist/cli/config.test.d.ts +0 -2
  85. package/dist/cli/config.test.d.ts.map +0 -1
  86. package/dist/cli/context.d.ts +0 -15
  87. package/dist/cli/context.d.ts.map +0 -1
  88. package/dist/cli/context.js +0 -16
  89. package/dist/cli/deploy.d.ts +0 -37
  90. package/dist/cli/deploy.d.ts.map +0 -1
  91. package/dist/cli/deploy.js +0 -100
  92. package/dist/cli/flags.d.ts +0 -21
  93. package/dist/cli/flags.d.ts.map +0 -1
  94. package/dist/cli/flags.js +0 -49
  95. package/dist/cli/handler.d.ts +0 -14
  96. package/dist/cli/handler.d.ts.map +0 -1
  97. package/dist/cli/handler.js +0 -32
  98. package/dist/cli/io.d.ts +0 -55
  99. package/dist/cli/io.d.ts.map +0 -1
  100. package/dist/cli/io.js +0 -96
  101. package/dist/cli/routes.d.ts +0 -2
  102. package/dist/cli/routes.d.ts.map +0 -1
  103. package/dist/cli/routes.js +0 -62
  104. package/dist/cli/utils/array.d.ts +0 -2
  105. package/dist/cli/utils/array.d.ts.map +0 -1
  106. package/dist/cli/utils/array.js +0 -10
  107. package/dist/cli/utils/openUrl.d.ts +0 -4
  108. package/dist/cli/utils/openUrl.d.ts.map +0 -1
  109. package/dist/cli/utils/openUrl.js +0 -43
  110. package/dist/cli/utils/string.d.ts +0 -2
  111. package/dist/cli/utils/string.d.ts.map +0 -1
  112. package/dist/cli/utils/string.js +0 -12
  113. package/src/capabilities/slashCommand.ts +0 -71
  114. package/src/cli/api/client.ts +0 -628
  115. package/src/cli/api/result.ts +0 -71
  116. package/src/cli/bin/cli.ts +0 -7
  117. package/src/cli/commands/.cursor/rules/testing-commands.mdc +0 -212
  118. package/src/cli/commands/auth.impl.test.ts +0 -228
  119. package/src/cli/commands/auth.impl.ts +0 -56
  120. package/src/cli/commands/auth.ts +0 -63
  121. package/src/cli/commands/bundle.impl.test.ts +0 -143
  122. package/src/cli/commands/bundle.impl.ts +0 -21
  123. package/src/cli/commands/bundle.ts +0 -23
  124. package/src/cli/commands/capabilities.impl.ts +0 -47
  125. package/src/cli/commands/capabilities.ts +0 -25
  126. package/src/cli/commands/connect.impl.ts +0 -149
  127. package/src/cli/commands/connect.ts +0 -80
  128. package/src/cli/commands/deploy.impl.test.ts +0 -254
  129. package/src/cli/commands/deploy.impl.ts +0 -73
  130. package/src/cli/commands/deploy.ts +0 -22
  131. package/src/cli/commands/env.impl.ts +0 -88
  132. package/src/cli/commands/env.ts +0 -38
  133. package/src/cli/commands/exec.impl.ts +0 -171
  134. package/src/cli/commands/exec.ts +0 -32
  135. package/src/cli/commands/runs.impl.ts +0 -87
  136. package/src/cli/commands/runs.ts +0 -49
  137. package/src/cli/commands/secrets.impl.ts +0 -130
  138. package/src/cli/commands/secrets.ts +0 -73
  139. package/src/cli/commands/utils/testing.ts +0 -66
  140. package/src/cli/config.test.ts +0 -108
  141. package/src/cli/config.ts +0 -265
  142. package/src/cli/context.ts +0 -26
  143. package/src/cli/deploy.ts +0 -190
  144. package/src/cli/flags.ts +0 -72
  145. package/src/cli/handler.ts +0 -68
  146. package/src/cli/io.ts +0 -132
  147. package/src/cli/routes.ts +0 -61
  148. package/src/cli/utils/array.ts +0 -7
  149. package/src/cli/utils/openUrl.ts +0 -53
  150. package/src/cli/utils/string.ts +0 -9
@@ -1,143 +0,0 @@
1
- import {
2
- afterEach,
3
- beforeEach,
4
- describe,
5
- expect,
6
- it,
7
- type Mock,
8
- vi,
9
- } from "vitest";
10
- import { ApiClient } from "../api/client.js";
11
- import { Result } from "../api/result.js";
12
- import { Config } from "../config.js";
13
- import { downloadBundle } from "./bundle.impl.js";
14
- import {
15
- baseFlags,
16
- cleanupTmpDirectories,
17
- createAndLoadConfig,
18
- createBaseContext,
19
- } from "./utils/testing.js";
20
-
21
- afterEach(cleanupTmpDirectories);
22
-
23
- describe("downloadBundle", () => {
24
- let stderrSpy: Mock<typeof process.stderr.write>;
25
- let stdoutSpy: Mock<typeof process.stdout.write>;
26
-
27
- beforeEach(() => {
28
- stderrSpy = vi
29
- .spyOn(process.stderr, "write")
30
- .mockImplementation(() => true);
31
- stdoutSpy = vi
32
- .spyOn(process.stdout, "write")
33
- .mockImplementation(() => true);
34
- });
35
-
36
- it("downloads and pipes bundle to stdout when workerId is set", async () => {
37
- const [mockConfig] = await createAndLoadConfig({
38
- configFile: {
39
- token:
40
- "1.2.eyJzcGFjZUlkIjoic3BhY2UxIiwidXNlcklkIjoidXNlcjEiLCJjZWxsSWQiOiJjZWxsMSJ9.sig",
41
- workerId: "worker-123",
42
- environment: "local",
43
- baseUrl: "http://localhost:3000",
44
- },
45
- });
46
-
47
- vi.spyOn(Config, "load").mockResolvedValue(mockConfig);
48
-
49
- // Create a mock web stream
50
- const mockWebStream = new ReadableStream({
51
- start(controller) {
52
- controller.enqueue(new TextEncoder().encode("bundle content"));
53
- controller.close();
54
- },
55
- });
56
-
57
- // This allows us to wait for the pipe to happen.
58
- let resolveWrite: () => void;
59
- const writePromise = new Promise<void>((resolve) => {
60
- resolveWrite = resolve;
61
- });
62
- stdoutSpy = vi.spyOn(process.stdout, "write").mockImplementation(() => {
63
- resolveWrite();
64
- return true;
65
- });
66
-
67
- const mockDownloadWorkerBundle = vi
68
- .spyOn(ApiClient.prototype, "downloadWorkerBundle")
69
- .mockResolvedValue(Result.success(mockWebStream));
70
-
71
- const context = createBaseContext();
72
-
73
- await downloadBundle.call(context, baseFlags);
74
-
75
- expect(mockDownloadWorkerBundle).toHaveBeenCalledWith("worker-123");
76
- await writePromise;
77
- expect(stdoutSpy).toHaveBeenCalledWith(Buffer.from("bundle content"));
78
- });
79
-
80
- it("throws error when workerId is not set", async () => {
81
- const [mockConfig] = await createAndLoadConfig({
82
- configFile: {
83
- token:
84
- "1.2.eyJzcGFjZUlkIjoic3BhY2UxIiwidXNlcklkIjoidXNlcjEiLCJjZWxsSWQiOiJjZWxsMSJ9.sig",
85
- workerId: null,
86
- environment: "local",
87
- baseUrl: "http://localhost:3000",
88
- },
89
- });
90
-
91
- vi.spyOn(Config, "load").mockResolvedValue(mockConfig);
92
-
93
- const mockDownloadWorkerBundle = vi.spyOn(
94
- ApiClient.prototype,
95
- "downloadWorkerBundle",
96
- );
97
-
98
- const context = createBaseContext();
99
-
100
- await expect(downloadBundle.call(context, baseFlags)).rejects.toThrow(
101
- "No worker configured. Run 'workers deploy' first to create a worker.",
102
- );
103
-
104
- expect(mockDownloadWorkerBundle).not.toHaveBeenCalled();
105
- });
106
-
107
- it("handles download failure gracefully", async () => {
108
- const [mockConfig] = await createAndLoadConfig({
109
- configFile: {
110
- token:
111
- "1.2.eyJzcGFjZUlkIjoic3BhY2UxIiwidXNlcklkIjoidXNlcjEiLCJjZWxsSWQiOiJjZWxsMSJ9.sig",
112
- workerId: "worker-123",
113
- environment: "local",
114
- baseUrl: "http://localhost:3000",
115
- },
116
- });
117
-
118
- vi.spyOn(Config, "load").mockResolvedValue(mockConfig);
119
-
120
- const mockDownloadWorkerBundle = vi
121
- .spyOn(ApiClient.prototype, "downloadWorkerBundle")
122
- .mockResolvedValue(
123
- Result.fail({
124
- status: 404,
125
- statusText: "Not Found",
126
- message: "Worker bundle not found",
127
- }),
128
- );
129
-
130
- const context = createBaseContext();
131
-
132
- await downloadBundle.call(context, baseFlags);
133
-
134
- expect(mockDownloadWorkerBundle).toHaveBeenCalledWith("worker-123");
135
-
136
- const allCalls = stderrSpy.mock.calls.map((call) => call[0]).join("");
137
- expect(allCalls).toContain("✗ Failed to download bundle");
138
- expect(allCalls).toContain("✗ Worker bundle not found");
139
-
140
- // Should not write anything to stdout on error
141
- expect(stdoutSpy).not.toHaveBeenCalled();
142
- });
143
- });
@@ -1,21 +0,0 @@
1
- import { Readable } from "node:stream";
2
- import { Result } from "../api/result.js";
3
- import { buildAuthedHandler } from "../handler.js";
4
-
5
- export const downloadBundle = buildAuthedHandler(async function () {
6
- const { workerId } = this.config;
7
- if (!workerId) {
8
- throw new Error(
9
- "No worker configured. Run 'workers deploy' first to create a worker.",
10
- );
11
- }
12
-
13
- const result = await this.apiClient.downloadWorkerBundle(workerId);
14
- if (Result.isFail(result)) {
15
- this.io.writeErr(`✗ Failed to download bundle`);
16
- this.io.writeErr(`✗ ${result.error.message}`);
17
- return;
18
- }
19
-
20
- Readable.fromWeb(result.value).pipe(this.process.stdout);
21
- });
@@ -1,23 +0,0 @@
1
- import { buildCommand, buildRouteMap } from "@stricli/core";
2
- import { globalFlags } from "../flags.js";
3
-
4
- export const bundleCommands = buildRouteMap({
5
- docs: {
6
- brief: "Commands for managing worker bundles",
7
- },
8
- routes: {
9
- download: buildCommand({
10
- docs: {
11
- brief: "Download the bundle for the worker",
12
- },
13
-
14
- parameters: {
15
- flags: {
16
- ...globalFlags,
17
- },
18
- },
19
-
20
- loader: () => import("./bundle.impl.js").then((m) => m.downloadBundle),
21
- }),
22
- },
23
- });
@@ -1,47 +0,0 @@
1
- import { Result } from "../api/result.js";
2
- import type { FormatFlags } from "../flags.js";
3
- import { buildAuthedHandler } from "../handler.js";
4
-
5
- export const listCapabilities = buildAuthedHandler(async function (
6
- flags: FormatFlags,
7
- ) {
8
- const { workerId } = this.config;
9
- if (!workerId) {
10
- throw new Error(
11
- "No worker configured. Run 'workers deploy' first to create a worker.",
12
- );
13
- }
14
-
15
- this.process.stderr.write(`Fetching capabilities...`);
16
-
17
- const result = await this.apiClient.listCapabilities(workerId);
18
-
19
- if (Result.isSuccess(result)) {
20
- this.process.stderr.write("OK\n\n");
21
-
22
- const data = Result.unwrap(result);
23
- if (data.capabilities.length === 0) {
24
- this.io.writeErr("No capabilities found for this worker.");
25
- } else {
26
- this.io.writeTableOut({
27
- headers: ["Key", "Tag"],
28
- rows: data.capabilities.map((capability) => [
29
- capability.key,
30
- capability._tag,
31
- ]),
32
- plain: flags.plain,
33
- });
34
- }
35
- } else {
36
- this.process.stderr.write("ERROR\n\n");
37
-
38
- // If it's a validation error, show the clean debug message
39
- if (result.error.validationError) {
40
- this.io.writeErr(`✗ ${result.error.validationError.debugMessage}`);
41
- throw new Error(result.error.validationError.debugMessage);
42
- } else {
43
- this.io.writeErr(`✗ ${result.error.message}`);
44
- throw new Error(result.error.message);
45
- }
46
- }
47
- });
@@ -1,25 +0,0 @@
1
- import { buildCommand, buildRouteMap } from "@stricli/core";
2
- import { formatFlags, globalFlags } from "../flags.js";
3
-
4
- export const capabilitiesCommands = buildRouteMap({
5
- docs: {
6
- brief: "Commands for managing worker capabilities",
7
- },
8
- routes: {
9
- list: buildCommand({
10
- docs: {
11
- brief: "List all capabilities for a worker",
12
- },
13
-
14
- parameters: {
15
- flags: {
16
- ...globalFlags,
17
- ...formatFlags,
18
- },
19
- },
20
-
21
- loader: () =>
22
- import("./capabilities.impl.js").then((m) => m.listCapabilities),
23
- }),
24
- },
25
- });
@@ -1,149 +0,0 @@
1
- import type { ApiError } from "../api/client.js";
2
- import { Result } from "../api/result.js";
3
- import type { FormatFlags, GlobalFlags } from "../flags.js";
4
- import { type AuthedContext, buildAuthedHandler } from "../handler.js";
5
- import { openBrowserUrl } from "../utils/openUrl.js";
6
-
7
- export const listProviders = buildAuthedHandler(async function (
8
- flags: FormatFlags,
9
- ) {
10
- this.process.stderr.write("Fetching providers...");
11
- const providersResult = await this.apiClient.listOauthProviders();
12
-
13
- if (Result.isFail(providersResult)) {
14
- this.process.stderr.write("ERROR\n\n");
15
- reportApiError(this, providersResult.error, "list providers");
16
- } else {
17
- this.process.stderr.write("OK\n\n");
18
- const providers = providersResult.value.providers;
19
- if (providers.length === 0) {
20
- this.io.writeErr("No OAuth providers are currently available.");
21
- return;
22
- }
23
-
24
- this.io.writeTableOut({
25
- headers: ["Provider", "Description"],
26
- rows: providers.map((provider) => [provider.key, provider.displayName]),
27
- plain: flags.plain,
28
- });
29
- }
30
- });
31
-
32
- export const addConnection = buildAuthedHandler(async function (
33
- _flags: GlobalFlags,
34
- provider: string,
35
- ) {
36
- const workerId = requireWorkerId(this);
37
-
38
- this.process.stderr.write(
39
- `Starting OAuth flow with provider "${provider}"...`,
40
- );
41
- const startResult = await this.apiClient.startOauth({ workerId, provider });
42
-
43
- if (Result.isFail(startResult)) {
44
- this.process.stderr.write("ERROR\n\n");
45
- reportApiError(this, startResult.error, "start OAuth flow");
46
- return;
47
- }
48
-
49
- this.process.stderr.write("OK\n\n");
50
-
51
- const { authorizationUrl } = startResult.value;
52
-
53
- this.io.writeErr("Opening your browser to continue the OAuth flow...");
54
- try {
55
- await openBrowserUrl(authorizationUrl);
56
- } catch (error) {
57
- this.io.writeErr(
58
- `Unable to open the browser automatically (${String(
59
- error,
60
- )}). Please open the link below manually.`,
61
- );
62
- }
63
-
64
- this.io.writeErr("");
65
- this.io.writeErr("If the browser did not open, visit:");
66
- this.io.writeErr(` ${authorizationUrl}`);
67
- this.io.writeErr("");
68
- this.io.writeErr(
69
- "After completing the flow in your browser, return to the CLI.",
70
- );
71
- });
72
-
73
- export const listConnections = buildAuthedHandler(async function (
74
- flags: FormatFlags,
75
- ) {
76
- const workerId = requireWorkerId(this);
77
-
78
- this.process.stderr.write("Fetching OAuth connections...");
79
- const secretsResult = await this.apiClient.listSecrets(workerId, {
80
- secretKinds: ["oauth"],
81
- });
82
-
83
- if (Result.isFail(secretsResult)) {
84
- this.process.stderr.write("ERROR\n\n");
85
- reportApiError(this, secretsResult.error, "list OAuth connections");
86
- return;
87
- }
88
-
89
- this.process.stderr.write("OK\n\n");
90
-
91
- const secrets = secretsResult.value.secrets;
92
-
93
- if (secrets.length === 0) {
94
- this.io.writeErr("No OAuth connections found for this worker.");
95
- return;
96
- }
97
-
98
- this.io.writeTableOut({
99
- headers: ["Env Var", "Created At"],
100
- rows: secrets.map((secret) => [
101
- `process.env.${secret.key}`,
102
- secret.createdAt,
103
- ]),
104
- plain: flags.plain,
105
- });
106
- });
107
-
108
- export const removeConnection = buildAuthedHandler(async function (
109
- _flags: GlobalFlags,
110
- provider: string,
111
- ) {
112
- const workerId = requireWorkerId(this);
113
-
114
- this.process.stderr.write(
115
- `Removing OAuth connection for provider "${provider}"...`,
116
- );
117
- const result = await this.apiClient.deleteOauthConnection({
118
- workerId,
119
- provider,
120
- });
121
-
122
- if (Result.isFail(result)) {
123
- this.process.stderr.write("ERROR\n\n");
124
- reportApiError(this, result.error, "remove connection");
125
- return;
126
- }
127
-
128
- this.process.stderr.write("OK\n");
129
- });
130
-
131
- function requireWorkerId(context: AuthedContext): string {
132
- const workerId = context.config.workerId;
133
- if (!workerId) {
134
- throw new Error(
135
- "No worker configured. Run 'workers deploy' first to create a worker.",
136
- );
137
- }
138
- return workerId;
139
- }
140
-
141
- function reportApiError(
142
- context: AuthedContext,
143
- error: ApiError,
144
- action: string,
145
- ): never {
146
- context.io.writeErr(`✗ Failed to ${action}`);
147
- context.io.writeErr(`✗ ${error.message}`);
148
- throw new Error(error.message);
149
- }
@@ -1,80 +0,0 @@
1
- import { buildCommand, buildRouteMap } from "@stricli/core";
2
-
3
- import { formatFlags, globalFlags } from "../flags.js";
4
-
5
- export const connectCommands = buildRouteMap({
6
- docs: {
7
- brief: "Manage OAuth connections for your worker",
8
- },
9
- routes: {
10
- providers: buildCommand({
11
- docs: {
12
- brief: "List available OAuth providers",
13
- },
14
- parameters: {
15
- flags: {
16
- ...globalFlags,
17
- ...formatFlags,
18
- },
19
- },
20
- loader: () => import("./connect.impl.js").then((m) => m.listProviders),
21
- }),
22
-
23
- add: buildCommand({
24
- docs: {
25
- brief: "Start an OAuth flow for a provider",
26
- },
27
- parameters: {
28
- positional: {
29
- kind: "tuple",
30
- parameters: [
31
- {
32
- brief: "Provider name (see `providers` command)",
33
- parse: String,
34
- placeholder: "provider",
35
- },
36
- ],
37
- },
38
- flags: {
39
- ...globalFlags,
40
- },
41
- },
42
- loader: () => import("./connect.impl.js").then((m) => m.addConnection),
43
- }),
44
-
45
- list: buildCommand({
46
- docs: {
47
- brief: "List active OAuth connections",
48
- },
49
- parameters: {
50
- flags: {
51
- ...globalFlags,
52
- ...formatFlags,
53
- },
54
- },
55
- loader: () => import("./connect.impl.js").then((m) => m.listConnections),
56
- }),
57
-
58
- rm: buildCommand({
59
- docs: {
60
- brief: "Remove an OAuth connection",
61
- },
62
- parameters: {
63
- positional: {
64
- kind: "tuple",
65
- parameters: [
66
- {
67
- brief: "Provider name to remove",
68
- parse: String,
69
- placeholder: "provider",
70
- },
71
- ],
72
- },
73
- flags: {
74
- ...globalFlags,
75
- },
76
- },
77
- loader: () => import("./connect.impl.js").then((m) => m.removeConnection),
78
- }),
79
- },
80
- });