@ollie-shop/cli 0.3.4 → 1.0.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.
Files changed (79) hide show
  1. package/.turbo/turbo-build.log +6 -9
  2. package/CHANGELOG.md +21 -0
  3. package/dist/index.js +986 -3956
  4. package/package.json +15 -37
  5. package/src/README.md +126 -0
  6. package/src/cli.tsx +45 -0
  7. package/src/commands/help.tsx +79 -0
  8. package/src/commands/login.tsx +92 -0
  9. package/src/commands/start.tsx +411 -0
  10. package/src/index.tsx +8 -0
  11. package/src/utils/auth.ts +218 -21
  12. package/src/utils/bundle.ts +177 -0
  13. package/src/utils/config.ts +123 -0
  14. package/src/utils/esbuild.ts +533 -0
  15. package/tsconfig.json +10 -15
  16. package/tsup.config.ts +7 -7
  17. package/CLAUDE_CLI.md +0 -265
  18. package/README.md +0 -711
  19. package/__tests__/mocks/console.ts +0 -22
  20. package/__tests__/mocks/core.ts +0 -137
  21. package/__tests__/mocks/index.ts +0 -4
  22. package/__tests__/mocks/inquirer.ts +0 -16
  23. package/__tests__/mocks/progress.ts +0 -19
  24. package/dist/index.d.ts +0 -1
  25. package/src/__tests__/helpers/cli-test-helper.ts +0 -281
  26. package/src/__tests__/mocks/index.ts +0 -142
  27. package/src/actions/component.actions.ts +0 -278
  28. package/src/actions/function.actions.ts +0 -220
  29. package/src/actions/project.actions.ts +0 -131
  30. package/src/actions/version.actions.ts +0 -233
  31. package/src/commands/__tests__/component-validation.test.ts +0 -250
  32. package/src/commands/__tests__/component.test.ts +0 -318
  33. package/src/commands/__tests__/function-validation.test.ts +0 -220
  34. package/src/commands/__tests__/function.test.ts +0 -286
  35. package/src/commands/__tests__/store-version-validation.test.ts +0 -414
  36. package/src/commands/__tests__/store-version.test.ts +0 -402
  37. package/src/commands/component.ts +0 -178
  38. package/src/commands/docs.ts +0 -24
  39. package/src/commands/function.ts +0 -201
  40. package/src/commands/help.ts +0 -18
  41. package/src/commands/index.ts +0 -27
  42. package/src/commands/login.ts +0 -267
  43. package/src/commands/project.ts +0 -107
  44. package/src/commands/store-version.ts +0 -242
  45. package/src/commands/version.ts +0 -51
  46. package/src/commands/whoami.ts +0 -46
  47. package/src/index.ts +0 -116
  48. package/src/prompts/component.prompts.ts +0 -94
  49. package/src/prompts/function.prompts.ts +0 -168
  50. package/src/schemas/command.schema.ts +0 -644
  51. package/src/types/index.ts +0 -183
  52. package/src/utils/__tests__/command-parser.test.ts +0 -159
  53. package/src/utils/__tests__/command-suggestions.test.ts +0 -185
  54. package/src/utils/__tests__/console.test.ts +0 -192
  55. package/src/utils/__tests__/context-detector.test.ts +0 -258
  56. package/src/utils/__tests__/enhanced-error-handler.test.ts +0 -137
  57. package/src/utils/__tests__/error-handler.test.ts +0 -107
  58. package/src/utils/__tests__/rich-progress.test.ts +0 -181
  59. package/src/utils/__tests__/validation-error-formatter.test.ts +0 -175
  60. package/src/utils/__tests__/validation-helpers.test.ts +0 -125
  61. package/src/utils/cli-progress-reporter.ts +0 -84
  62. package/src/utils/command-builder.ts +0 -390
  63. package/src/utils/command-helpers.ts +0 -83
  64. package/src/utils/command-parser.ts +0 -245
  65. package/src/utils/command-suggestions.ts +0 -176
  66. package/src/utils/console.ts +0 -320
  67. package/src/utils/constants.ts +0 -39
  68. package/src/utils/context-detector.ts +0 -177
  69. package/src/utils/deploy-helpers.ts +0 -357
  70. package/src/utils/enhanced-error-handler.ts +0 -264
  71. package/src/utils/error-handler.ts +0 -60
  72. package/src/utils/errors.ts +0 -256
  73. package/src/utils/interactive-builder.ts +0 -325
  74. package/src/utils/rich-progress.ts +0 -331
  75. package/src/utils/store.ts +0 -23
  76. package/src/utils/validation-error-formatter.ts +0 -337
  77. package/src/utils/validation-helpers.ts +0 -325
  78. package/vitest.config.ts +0 -35
  79. package/vitest.setup.ts +0 -29
@@ -1,22 +0,0 @@
1
- import { vi } from "vitest";
2
-
3
- export const createMockConsole = () => ({
4
- setOptions: vi.fn(),
5
- hint: vi.fn(),
6
- info: vi.fn(),
7
- success: vi.fn(),
8
- error: vi.fn(),
9
- warn: vi.fn(),
10
- debug: vi.fn(),
11
- dim: vi.fn(),
12
- spinner: vi.fn(() => ({
13
- start: vi.fn().mockReturnThis(),
14
- succeed: vi.fn().mockReturnThis(),
15
- fail: vi.fn().mockReturnThis(),
16
- warn: vi.fn().mockReturnThis(),
17
- stop: vi.fn().mockReturnThis(),
18
- text: "",
19
- })),
20
- });
21
-
22
- export const mockConsole = createMockConsole();
@@ -1,137 +0,0 @@
1
- import { faker } from "@faker-js/faker";
2
- import {
3
- componentFactory,
4
- functionFactory,
5
- versionFactory,
6
- } from "@ollie-shop/core/testing";
7
- import { vi } from "vitest";
8
-
9
- // Mock the services from core
10
- export const createMockCore = () => {
11
- // Component service functions
12
- const componentService = {
13
- createComponent: vi.fn(),
14
- listComponents: vi.fn(),
15
- getComponent: vi.fn(),
16
- deployComponent: vi.fn(),
17
- buildComponent: vi.fn(),
18
- validateComponent: vi.fn(),
19
- enableComponent: vi.fn(),
20
- disableComponent: vi.fn(),
21
- updateComponent: vi.fn(),
22
- getComponentMeta: vi.fn(),
23
- updateComponentMeta: vi.fn(),
24
- };
25
-
26
- // Function service functions
27
- const functionService = {
28
- createFunction: vi.fn(),
29
- listFunctions: vi.fn(),
30
- deployFunction: vi.fn(),
31
- buildFunction: vi.fn(),
32
- validateFunction: vi.fn(),
33
- testFunction: vi.fn(),
34
- getFunctionMeta: vi.fn(),
35
- updateFunctionMeta: vi.fn(),
36
- };
37
-
38
- // Version service functions
39
- const versionService = {
40
- createVersion: vi.fn(),
41
- listVersions: vi.fn(),
42
- getVersion: vi.fn(),
43
- updateVersion: vi.fn(),
44
- deleteVersion: vi.fn(),
45
- setDefaultVersion: vi.fn(),
46
- activateVersion: vi.fn(),
47
- deactivateVersion: vi.fn(),
48
- cloneVersion: vi.fn(),
49
- };
50
-
51
- // Setup default behaviors
52
- componentService.createComponent.mockImplementation(
53
- async (path, _options) => {
54
- return { success: true, path };
55
- },
56
- );
57
-
58
- componentService.listComponents.mockResolvedValue(
59
- componentFactory.buildList(3),
60
- );
61
-
62
- componentService.deployComponent.mockImplementation(async (id, _path) => {
63
- return componentFactory.build({
64
- id,
65
- url: faker.internet.url(),
66
- active: true,
67
- });
68
- });
69
-
70
- componentService.buildComponent.mockImplementation(async (path) => ({
71
- success: true,
72
- outputPath: `${path}/dist`,
73
- size: faker.number.int({ min: 1000, max: 100000 }),
74
- duration: faker.number.int({ min: 100, max: 5000 }),
75
- }));
76
-
77
- componentService.validateComponent.mockImplementation(async (_path) => ({
78
- valid: true,
79
- errors: [],
80
- warnings: [],
81
- }));
82
-
83
- functionService.createFunction.mockImplementation(async (path, _options) => {
84
- return { success: true, path };
85
- });
86
-
87
- functionService.listFunctions.mockResolvedValue(functionFactory.buildList(2));
88
-
89
- functionService.deployFunction.mockImplementation(async (id, _path) => {
90
- return functionFactory.build({
91
- id,
92
- urn: `arn:aws:lambda:us-east-1:${faker.string.numeric(12)}:function:deployed`,
93
- active: true,
94
- });
95
- });
96
-
97
- functionService.buildFunction.mockImplementation(async (path) => ({
98
- success: true,
99
- outputPath: `${path}/dist`,
100
- size: faker.number.int({ min: 1000, max: 50000 }),
101
- duration: faker.number.int({ min: 100, max: 3000 }),
102
- }));
103
-
104
- functionService.validateFunction.mockImplementation(async (_path) => ({
105
- valid: true,
106
- errors: [],
107
- warnings: [],
108
- }));
109
-
110
- functionService.testFunction.mockImplementation(async (_path, _payload) => ({
111
- success: true,
112
- output: { message: "Test successful" },
113
- logs: ["Function executed successfully"],
114
- duration: faker.number.int({ min: 10, max: 500 }),
115
- }));
116
-
117
- versionService.createVersion.mockImplementation(async (data) =>
118
- versionFactory.build({ ...data, id: faker.string.uuid() }),
119
- );
120
-
121
- versionService.listVersions.mockResolvedValue(versionFactory.buildList(2));
122
-
123
- versionService.setDefaultVersion.mockImplementation(async (id) =>
124
- versionFactory.build({ id, default: true }),
125
- );
126
-
127
- return {
128
- componentService,
129
- functionService,
130
- versionService,
131
- };
132
- };
133
-
134
- // Export individual mocks
135
- export const mockComponentService = createMockCore().componentService;
136
- export const mockFunctionService = createMockCore().functionService;
137
- export const mockVersionService = createMockCore().versionService;
@@ -1,4 +0,0 @@
1
- export * from "./core";
2
- export * from "./console";
3
- export * from "./inquirer";
4
- export * from "./progress";
@@ -1,16 +0,0 @@
1
- import { vi } from "vitest";
2
-
3
- export const createMockInquirer = () => ({
4
- prompt: vi.fn().mockResolvedValue({
5
- name: "test-name",
6
- slot: "header",
7
- template: "default",
8
- typescript: true,
9
- includeTests: true,
10
- includeStyles: true,
11
- confirm: true,
12
- }),
13
- registerPrompt: vi.fn(),
14
- });
15
-
16
- export const mockInquirer = createMockInquirer();
@@ -1,19 +0,0 @@
1
- import { vi } from "vitest";
2
-
3
- export const createMockProgressBar = () => ({
4
- start: vi.fn(),
5
- increment: vi.fn(),
6
- update: vi.fn(),
7
- stop: vi.fn(),
8
- });
9
-
10
- export const mockProgressBar = createMockProgressBar();
11
-
12
- export const createMockCliProgress = () => ({
13
- SingleBar: vi.fn(() => mockProgressBar),
14
- Presets: {
15
- shades_classic: {},
16
- },
17
- });
18
-
19
- export const mockCliProgress = createMockCliProgress();
package/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- #!/usr/bin/env node
@@ -1,281 +0,0 @@
1
- import { Command } from "@commander-js/extra-typings";
2
- import { expect, vi } from "vitest";
3
-
4
- /**
5
- * CLI Testing Helper for Commander.js applications
6
- * Based on best practices for testing CLI applications with Vitest
7
- */
8
-
9
- export interface CLITestResult {
10
- exitCode: number;
11
- stdout: string[];
12
- stderr: string[];
13
- error?: Error;
14
- }
15
-
16
- export interface ProcessMocks {
17
- exit: ReturnType<typeof vi.fn>;
18
- stdout: {
19
- write: ReturnType<typeof vi.fn>;
20
- };
21
- stderr: {
22
- write: ReturnType<typeof vi.fn>;
23
- };
24
- }
25
-
26
- export interface ConsoleMocks {
27
- log: ReturnType<typeof vi.fn>;
28
- error: ReturnType<typeof vi.fn>;
29
- warn: ReturnType<typeof vi.fn>;
30
- info: ReturnType<typeof vi.fn>;
31
- }
32
-
33
- /**
34
- * Create a test-friendly Commander.js program that captures output
35
- * and prevents process.exit from terminating the test
36
- */
37
- export function createTestProgram(): {
38
- program: Command;
39
- mocks: {
40
- process: ProcessMocks;
41
- console: ConsoleMocks;
42
- };
43
- getResult: () => CLITestResult;
44
- } {
45
- const stdout: string[] = [];
46
- const stderr: string[] = [];
47
- let exitCode = 0;
48
- let capturedError: Error | undefined;
49
-
50
- // Mock process methods
51
- const processMocks: ProcessMocks = {
52
- exit: vi.fn((code = 0) => {
53
- exitCode = code;
54
- // Throw error instead of exiting to prevent test termination
55
- throw new Error(`process.exit(${code})`);
56
- }),
57
- stdout: {
58
- write: vi.fn((data: string) => {
59
- stdout.push(data);
60
- return true;
61
- }),
62
- },
63
- stderr: {
64
- write: vi.fn((data: string) => {
65
- stderr.push(data);
66
- return true;
67
- }),
68
- },
69
- };
70
-
71
- // Mock console methods
72
- const consoleMocks: ConsoleMocks = {
73
- log: vi.fn((...args: unknown[]) => {
74
- stdout.push(`${args.join(" ")}\n`);
75
- }),
76
- error: vi.fn((...args: unknown[]) => {
77
- stderr.push(`${args.join(" ")}\n`);
78
- }),
79
- warn: vi.fn((...args: unknown[]) => {
80
- stderr.push(`${args.join(" ")}\n`);
81
- }),
82
- info: vi.fn((...args: unknown[]) => {
83
- stdout.push(`${args.join(" ")}\n`);
84
- }),
85
- };
86
-
87
- // Apply mocks
88
- vi.spyOn(process, "exit").mockImplementation(((code?: number | undefined) => {
89
- throw new Error(`Process exit with code ${code}`);
90
- }) as never);
91
- vi.spyOn(process.stdout, "write").mockImplementation(
92
- processMocks.stdout.write,
93
- );
94
- vi.spyOn(process.stderr, "write").mockImplementation(
95
- processMocks.stderr.write,
96
- );
97
- vi.spyOn(console, "log").mockImplementation(consoleMocks.log);
98
- vi.spyOn(console, "error").mockImplementation(consoleMocks.error);
99
- vi.spyOn(console, "warn").mockImplementation(consoleMocks.warn);
100
- vi.spyOn(console, "info").mockImplementation(consoleMocks.info);
101
-
102
- // Also mock global.console which is used by the CLI console utility
103
- vi.spyOn(global.console, "log").mockImplementation(consoleMocks.log);
104
- vi.spyOn(global.console, "error").mockImplementation(consoleMocks.error);
105
- vi.spyOn(global.console, "warn").mockImplementation(consoleMocks.warn);
106
- vi.spyOn(global.console, "info").mockImplementation(consoleMocks.info);
107
-
108
- // Create program with exitOverride to handle errors gracefully
109
- const program = new Command();
110
- program
111
- .exitOverride((err) => {
112
- capturedError = err;
113
- exitCode = err.exitCode || 1;
114
- throw err;
115
- })
116
- .configureOutput({
117
- writeOut: (str) => {
118
- stdout.push(str);
119
- },
120
- writeErr: (str) => {
121
- stderr.push(str);
122
- },
123
- });
124
-
125
- const getResult = (): CLITestResult => ({
126
- exitCode,
127
- stdout: [...stdout],
128
- stderr: [...stderr],
129
- error: capturedError,
130
- });
131
-
132
- return {
133
- program,
134
- mocks: {
135
- process: processMocks,
136
- console: consoleMocks,
137
- },
138
- getResult,
139
- };
140
- }
141
-
142
- /**
143
- * Execute a CLI command with arguments and capture the result
144
- */
145
- export async function executeCLI(
146
- program: Command,
147
- args: string[],
148
- options: { from: "node" | "electron" | "user" } = { from: "user" },
149
- ): Promise<CLITestResult> {
150
- const stdout: string[] = [];
151
- const stderr: string[] = [];
152
- let exitCode = 0;
153
- let capturedError: Error | undefined;
154
-
155
- // Capture output
156
- const originalWriteOut = program.configureOutput().writeOut;
157
- const originalWriteErr = program.configureOutput().writeErr;
158
-
159
- program.configureOutput({
160
- writeOut: (str) => {
161
- stdout.push(str);
162
- if (originalWriteOut) originalWriteOut(str);
163
- },
164
- writeErr: (str) => {
165
- stderr.push(str);
166
- if (originalWriteErr) originalWriteErr(str);
167
- },
168
- });
169
-
170
- try {
171
- await program.parseAsync(args, options);
172
- } catch (error) {
173
- capturedError = error as Error;
174
-
175
- // Handle Commander.js specific errors
176
- if (error && typeof error === "object" && "code" in error) {
177
- const commanderError = error as { code: string; exitCode: number };
178
- exitCode = commanderError.exitCode || 1;
179
- } else if (
180
- error instanceof Error &&
181
- error.message.includes("process.exit")
182
- ) {
183
- // Handle our mocked process.exit
184
- const match = error.message.match(/process\.exit\((\d+)\)/);
185
- exitCode = match?.[1] ? Number.parseInt(match[1], 10) : 1;
186
- } else {
187
- exitCode = 1;
188
- }
189
- }
190
-
191
- return {
192
- exitCode,
193
- stdout,
194
- stderr,
195
- error: capturedError,
196
- };
197
- }
198
-
199
- /**
200
- * Reset all CLI test mocks between tests
201
- */
202
- export function resetCLIMocks(): void {
203
- vi.clearAllMocks();
204
- vi.restoreAllMocks();
205
- }
206
-
207
- /**
208
- * Create mock for inquirer prompts
209
- */
210
- export function createInquirerMock(responses: Record<string, unknown>) {
211
- return {
212
- prompt: vi
213
- .fn()
214
- .mockImplementation(
215
- (questions: Array<{ name?: string; [key: string]: unknown }>) => {
216
- const answers: Record<string, unknown> = {};
217
- for (const question of questions) {
218
- if (question.name && responses[question.name] !== undefined) {
219
- answers[question.name] = responses[question.name];
220
- }
221
- }
222
- return Promise.resolve(answers);
223
- },
224
- ),
225
- };
226
- }
227
-
228
- /**
229
- * Create mock for ora spinner
230
- */
231
- export function createSpinnerMock() {
232
- const mock = {
233
- start: vi.fn().mockReturnThis(),
234
- stop: vi.fn().mockReturnThis(),
235
- succeed: vi.fn().mockReturnThis(),
236
- fail: vi.fn().mockReturnThis(),
237
- warn: vi.fn().mockReturnThis(),
238
- info: vi.fn().mockReturnThis(),
239
- text: "",
240
- isSpinning: false,
241
- };
242
-
243
- return {
244
- mock,
245
- create: vi.fn(() => mock),
246
- };
247
- }
248
-
249
- /**
250
- * Assert CLI output contains expected text
251
- */
252
- export function expectCLIOutput(
253
- result: CLITestResult,
254
- expected: {
255
- stdout?: string | RegExp;
256
- stderr?: string | RegExp;
257
- exitCode?: number;
258
- },
259
- ) {
260
- if (expected.exitCode !== undefined) {
261
- expect(result.exitCode).toBe(expected.exitCode);
262
- }
263
-
264
- if (expected.stdout !== undefined) {
265
- const stdoutText = result.stdout.join("");
266
- if (typeof expected.stdout === "string") {
267
- expect(stdoutText).toContain(expected.stdout);
268
- } else {
269
- expect(stdoutText).toMatch(expected.stdout);
270
- }
271
- }
272
-
273
- if (expected.stderr !== undefined) {
274
- const stderrText = result.stderr.join("");
275
- if (typeof expected.stderr === "string") {
276
- expect(stderrText).toContain(expected.stderr);
277
- } else {
278
- expect(stderrText).toMatch(expected.stderr);
279
- }
280
- }
281
- }
@@ -1,142 +0,0 @@
1
- import { vi } from "vitest";
2
-
3
- export interface MockConsole {
4
- success: ReturnType<typeof vi.fn>;
5
- error: ReturnType<typeof vi.fn>;
6
- info: ReturnType<typeof vi.fn>;
7
- warn: ReturnType<typeof vi.fn>;
8
- hint: ReturnType<typeof vi.fn>;
9
- spinner: ReturnType<typeof vi.fn>;
10
- log: ReturnType<typeof vi.fn>;
11
- dim: ReturnType<typeof vi.fn>;
12
- }
13
-
14
- export interface MockInquirer {
15
- prompt: ReturnType<typeof vi.fn>;
16
- select: ReturnType<typeof vi.fn>;
17
- input: ReturnType<typeof vi.fn>;
18
- confirm: ReturnType<typeof vi.fn>;
19
- }
20
-
21
- export interface MockSpinner {
22
- succeed: ReturnType<typeof vi.fn>;
23
- fail: ReturnType<typeof vi.fn>;
24
- start: ReturnType<typeof vi.fn>;
25
- stop: ReturnType<typeof vi.fn>;
26
- }
27
-
28
- export interface MockCore {
29
- listComponents: ReturnType<typeof vi.fn>;
30
- createComponent: ReturnType<typeof vi.fn>;
31
- deployComponent: ReturnType<typeof vi.fn>;
32
- deleteComponent: ReturnType<typeof vi.fn>;
33
- listFunctions: ReturnType<typeof vi.fn>;
34
- createFunction: ReturnType<typeof vi.fn>;
35
- deployFunction: ReturnType<typeof vi.fn>;
36
- deleteFunction: ReturnType<typeof vi.fn>;
37
- listVersions: ReturnType<typeof vi.fn>;
38
- createVersion: ReturnType<typeof vi.fn>;
39
- setDefaultVersion: ReturnType<typeof vi.fn>;
40
- deleteVersion: ReturnType<typeof vi.fn>;
41
- }
42
-
43
- export function createMockConsole(): MockConsole {
44
- return {
45
- success: vi.fn(),
46
- error: vi.fn(),
47
- info: vi.fn(),
48
- warn: vi.fn(),
49
- hint: vi.fn(),
50
- spinner: vi.fn(() => createMockSpinner()),
51
- log: vi.fn(),
52
- dim: vi.fn(),
53
- };
54
- }
55
-
56
- export function createMockInquirer(): MockInquirer {
57
- return {
58
- prompt: vi.fn(),
59
- select: vi.fn(),
60
- input: vi.fn(),
61
- confirm: vi.fn(),
62
- };
63
- }
64
-
65
- export function createMockSpinner(): MockSpinner {
66
- return {
67
- succeed: vi.fn(),
68
- fail: vi.fn(),
69
- start: vi.fn(),
70
- stop: vi.fn(),
71
- };
72
- }
73
-
74
- export function createMockCore(): MockCore & {
75
- versionService: {
76
- list: ReturnType<typeof vi.fn>;
77
- create: ReturnType<typeof vi.fn>;
78
- setDefault: ReturnType<typeof vi.fn>;
79
- delete: ReturnType<typeof vi.fn>;
80
- clone: ReturnType<typeof vi.fn>;
81
- activate: ReturnType<typeof vi.fn>;
82
- deactivate: ReturnType<typeof vi.fn>;
83
- };
84
- projectService: {
85
- getProjectInfo: ReturnType<typeof vi.fn>;
86
- };
87
- componentService: {
88
- list: ReturnType<typeof vi.fn>;
89
- create: ReturnType<typeof vi.fn>;
90
- deploy: ReturnType<typeof vi.fn>;
91
- delete: ReturnType<typeof vi.fn>;
92
- };
93
- functionService: {
94
- list: ReturnType<typeof vi.fn>;
95
- create: ReturnType<typeof vi.fn>;
96
- deploy: ReturnType<typeof vi.fn>;
97
- delete: ReturnType<typeof vi.fn>;
98
- update: ReturnType<typeof vi.fn>;
99
- test: ReturnType<typeof vi.fn>;
100
- };
101
- } {
102
- return {
103
- listComponents: vi.fn(),
104
- createComponent: vi.fn(),
105
- deployComponent: vi.fn(),
106
- deleteComponent: vi.fn(),
107
- listFunctions: vi.fn(),
108
- createFunction: vi.fn(),
109
- deployFunction: vi.fn(),
110
- deleteFunction: vi.fn(),
111
- listVersions: vi.fn(),
112
- createVersion: vi.fn(),
113
- setDefaultVersion: vi.fn(),
114
- deleteVersion: vi.fn(),
115
- versionService: {
116
- list: vi.fn(),
117
- create: vi.fn(),
118
- setDefault: vi.fn(),
119
- delete: vi.fn(),
120
- clone: vi.fn(),
121
- activate: vi.fn(),
122
- deactivate: vi.fn(),
123
- },
124
- projectService: {
125
- getProjectInfo: vi.fn(),
126
- },
127
- componentService: {
128
- list: vi.fn(),
129
- create: vi.fn(),
130
- deploy: vi.fn(),
131
- delete: vi.fn(),
132
- },
133
- functionService: {
134
- list: vi.fn(),
135
- create: vi.fn(),
136
- deploy: vi.fn(),
137
- delete: vi.fn(),
138
- update: vi.fn(),
139
- test: vi.fn(),
140
- },
141
- };
142
- }