@xano/cli 0.0.26 → 0.0.28
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/dist/base-command.d.ts +3 -1
- package/dist/base-command.js +12 -5
- package/dist/commands/auth/index.d.ts +21 -0
- package/dist/commands/auth/index.js +533 -0
- package/dist/commands/branch/create/index.d.ts +17 -0
- package/dist/commands/branch/create/index.js +164 -0
- package/dist/commands/branch/delete/index.d.ts +18 -0
- package/dist/commands/branch/delete/index.js +156 -0
- package/dist/commands/branch/edit/index.d.ts +19 -0
- package/dist/commands/branch/edit/index.js +166 -0
- package/dist/commands/branch/get/index.d.ts +16 -0
- package/dist/commands/branch/get/index.js +135 -0
- package/dist/commands/branch/list/index.d.ts +18 -0
- package/dist/commands/branch/list/index.js +138 -0
- package/dist/commands/branch/set-live/index.d.ts +18 -0
- package/dist/commands/branch/set-live/index.js +155 -0
- package/dist/commands/function/create/index.d.ts +7 -6
- package/dist/commands/function/create/index.js +55 -55
- package/dist/commands/function/edit/index.d.ts +11 -10
- package/dist/commands/function/edit/index.js +155 -162
- package/dist/commands/function/get/index.d.ts +6 -5
- package/dist/commands/function/get/index.js +55 -60
- package/dist/commands/function/list/index.d.ts +6 -5
- package/dist/commands/function/list/index.js +52 -52
- package/dist/commands/profile/create/index.d.ts +6 -6
- package/dist/commands/profile/create/index.js +37 -37
- package/dist/commands/profile/delete/index.d.ts +2 -2
- package/dist/commands/profile/delete/index.js +9 -9
- package/dist/commands/profile/edit/index.d.ts +8 -7
- package/dist/commands/profile/edit/index.js +48 -48
- package/dist/commands/profile/get-default/index.js +1 -1
- package/dist/commands/profile/list/index.d.ts +2 -2
- package/dist/commands/profile/list/index.js +9 -9
- package/dist/commands/profile/me/index.d.ts +4 -3
- package/dist/commands/profile/me/index.js +21 -21
- package/dist/commands/profile/project/index.js +1 -1
- package/dist/commands/profile/set-default/index.js +1 -1
- package/dist/commands/profile/token/index.js +1 -1
- package/dist/commands/profile/wizard/index.d.ts +5 -4
- package/dist/commands/profile/wizard/index.js +142 -108
- package/dist/commands/run/env/delete/index.d.ts +3 -2
- package/dist/commands/run/env/delete/index.js +10 -10
- package/dist/commands/run/env/get/index.d.ts +3 -2
- package/dist/commands/run/env/get/index.js +11 -11
- package/dist/commands/run/env/list/index.d.ts +3 -2
- package/dist/commands/run/env/list/index.js +17 -19
- package/dist/commands/run/env/set/index.d.ts +3 -2
- package/dist/commands/run/env/set/index.js +5 -5
- package/dist/commands/run/exec/index.d.ts +19 -8
- package/dist/commands/run/exec/index.js +186 -108
- package/dist/commands/run/info/index.d.ts +5 -4
- package/dist/commands/run/info/index.js +27 -27
- package/dist/commands/run/projects/create/index.d.ts +4 -3
- package/dist/commands/run/projects/create/index.js +23 -23
- package/dist/commands/run/projects/delete/index.d.ts +3 -2
- package/dist/commands/run/projects/delete/index.js +10 -10
- package/dist/commands/run/projects/list/index.d.ts +3 -2
- package/dist/commands/run/projects/list/index.js +12 -12
- package/dist/commands/run/projects/update/index.d.ts +4 -3
- package/dist/commands/run/projects/update/index.js +21 -21
- package/dist/commands/run/secrets/delete/index.d.ts +3 -2
- package/dist/commands/run/secrets/delete/index.js +10 -10
- package/dist/commands/run/secrets/get/index.d.ts +3 -2
- package/dist/commands/run/secrets/get/index.js +11 -11
- package/dist/commands/run/secrets/list/index.d.ts +3 -2
- package/dist/commands/run/secrets/list/index.js +22 -24
- package/dist/commands/run/secrets/set/index.d.ts +4 -3
- package/dist/commands/run/secrets/set/index.js +16 -16
- package/dist/commands/run/sessions/delete/index.d.ts +3 -2
- package/dist/commands/run/sessions/delete/index.js +10 -10
- package/dist/commands/run/sessions/get/index.d.ts +3 -2
- package/dist/commands/run/sessions/get/index.js +11 -11
- package/dist/commands/run/sessions/list/index.d.ts +3 -2
- package/dist/commands/run/sessions/list/index.js +11 -11
- package/dist/commands/run/sessions/start/index.d.ts +3 -2
- package/dist/commands/run/sessions/start/index.js +11 -11
- package/dist/commands/run/sessions/stop/index.d.ts +3 -2
- package/dist/commands/run/sessions/stop/index.js +11 -11
- package/dist/commands/run/sink/get/index.d.ts +3 -2
- package/dist/commands/run/sink/get/index.js +11 -11
- package/dist/commands/static_host/build/create/index.d.ts +5 -4
- package/dist/commands/static_host/build/create/index.js +33 -33
- package/dist/commands/static_host/build/get/index.d.ts +5 -4
- package/dist/commands/static_host/build/get/index.js +20 -20
- package/dist/commands/static_host/build/list/index.d.ts +4 -3
- package/dist/commands/static_host/build/list/index.js +31 -31
- package/dist/commands/static_host/list/index.d.ts +4 -3
- package/dist/commands/static_host/list/index.js +31 -31
- package/dist/commands/workspace/create/index.d.ts +14 -0
- package/dist/commands/workspace/create/index.js +131 -0
- package/dist/commands/workspace/delete/index.d.ts +20 -0
- package/dist/commands/workspace/delete/index.js +141 -0
- package/dist/commands/workspace/edit/index.d.ts +22 -0
- package/dist/commands/workspace/edit/index.js +176 -0
- package/dist/commands/workspace/get/index.d.ts +18 -0
- package/dist/commands/workspace/get/index.js +136 -0
- package/dist/commands/workspace/list/index.d.ts +3 -2
- package/dist/commands/workspace/list/index.js +15 -15
- package/dist/commands/workspace/pull/index.d.ts +6 -4
- package/dist/commands/workspace/pull/index.js +123 -63
- package/dist/commands/workspace/push/index.d.ts +2 -0
- package/dist/commands/workspace/push/index.js +16 -5
- package/dist/help.d.ts +1 -1
- package/dist/lib/base-run-command.d.ts +6 -6
- package/dist/lib/base-run-command.js +8 -6
- package/dist/lib/run-http-client.d.ts +24 -18
- package/dist/lib/run-http-client.js +96 -61
- package/dist/lib/run-types.d.ts +80 -80
- package/oclif.manifest.json +2041 -843
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Base command for all run commands
|
|
3
3
|
*/
|
|
4
|
+
import * as yaml from 'js-yaml';
|
|
4
5
|
import * as fs from 'node:fs';
|
|
5
6
|
import * as os from 'node:os';
|
|
6
7
|
import * as path from 'node:path';
|
|
7
|
-
import * as yaml from 'js-yaml';
|
|
8
8
|
import BaseCommand from '../base-command.js';
|
|
9
9
|
import { DEFAULT_RUN_BASE_URL, RunHttpClient } from './run-http-client.js';
|
|
10
10
|
export default class BaseRunCommand extends BaseCommand {
|
|
@@ -14,7 +14,7 @@ export default class BaseRunCommand extends BaseCommand {
|
|
|
14
14
|
/**
|
|
15
15
|
* Initialize the run command with profile and HTTP client
|
|
16
16
|
*/
|
|
17
|
-
async initRunCommand(profileFlag) {
|
|
17
|
+
async initRunCommand(profileFlag, verbose) {
|
|
18
18
|
this.profileName = profileFlag || this.getDefaultProfile();
|
|
19
19
|
const credentials = this.loadCredentials();
|
|
20
20
|
if (!(this.profileName in credentials.profiles)) {
|
|
@@ -27,19 +27,21 @@ export default class BaseRunCommand extends BaseCommand {
|
|
|
27
27
|
}
|
|
28
28
|
const baseUrl = this.profile.run_base_url || DEFAULT_RUN_BASE_URL;
|
|
29
29
|
this.httpClient = new RunHttpClient({
|
|
30
|
-
baseUrl,
|
|
31
30
|
authToken: this.profile.access_token,
|
|
31
|
+
baseUrl,
|
|
32
|
+
logger: (msg) => this.log(msg),
|
|
32
33
|
projectId: this.profile.project,
|
|
34
|
+
verbose,
|
|
33
35
|
});
|
|
34
36
|
}
|
|
35
37
|
/**
|
|
36
38
|
* Initialize with project required
|
|
37
39
|
*/
|
|
38
|
-
async initRunCommandWithProject(profileFlag) {
|
|
39
|
-
await this.initRunCommand(profileFlag);
|
|
40
|
+
async initRunCommandWithProject(profileFlag, verbose) {
|
|
41
|
+
await this.initRunCommand(profileFlag, verbose);
|
|
40
42
|
if (!this.profile.project) {
|
|
41
43
|
this.error(`Profile '${this.profileName}' is missing project. ` +
|
|
42
|
-
`
|
|
44
|
+
`Run 'xano profile:wizard' to set up your profile or use 'xano profile:edit --project <project-id>'`);
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
@@ -2,43 +2,49 @@
|
|
|
2
2
|
* HTTP client for Xano Run API
|
|
3
3
|
* Based on @xano/run-sdk HttpClient
|
|
4
4
|
*/
|
|
5
|
-
export declare const DEFAULT_RUN_BASE_URL = "https://app.xano.com/";
|
|
5
|
+
export declare const DEFAULT_RUN_BASE_URL = "https://app.dev.xano.com/";
|
|
6
6
|
export interface RunHttpClientConfig {
|
|
7
|
-
baseUrl: string;
|
|
8
7
|
authToken: string;
|
|
8
|
+
baseUrl: string;
|
|
9
|
+
logger?: (message: string) => void;
|
|
9
10
|
projectId?: string;
|
|
11
|
+
verbose?: boolean;
|
|
10
12
|
}
|
|
11
13
|
export declare class RunHttpClient {
|
|
12
14
|
private readonly config;
|
|
13
15
|
constructor(config: RunHttpClientConfig);
|
|
14
16
|
/**
|
|
15
|
-
*
|
|
17
|
+
* Build a URL scoped to the current project
|
|
16
18
|
*/
|
|
17
|
-
|
|
19
|
+
buildProjectUrl(path: string, queryParams?: Record<string, unknown>): string;
|
|
18
20
|
/**
|
|
19
|
-
* Build
|
|
21
|
+
* Build a URL scoped to a specific session
|
|
20
22
|
*/
|
|
21
|
-
|
|
23
|
+
buildSessionUrl(sessionId: string, path?: string, queryParams?: Record<string, unknown>): string;
|
|
22
24
|
/**
|
|
23
25
|
* Build a URL with optional query parameters
|
|
24
26
|
*/
|
|
25
27
|
buildUrl(path: string, queryParams?: Record<string, unknown>): string;
|
|
26
28
|
/**
|
|
27
|
-
*
|
|
29
|
+
* Make a DELETE request
|
|
28
30
|
*/
|
|
29
|
-
|
|
31
|
+
delete<T>(url: string, body?: unknown): Promise<T>;
|
|
30
32
|
/**
|
|
31
|
-
*
|
|
33
|
+
* Make a GET request
|
|
32
34
|
*/
|
|
33
|
-
|
|
35
|
+
get<T>(url: string): Promise<T>;
|
|
34
36
|
/**
|
|
35
|
-
*
|
|
37
|
+
* Build headers for a request
|
|
36
38
|
*/
|
|
37
|
-
|
|
39
|
+
getHeaders(contentType?: string): HeadersInit;
|
|
38
40
|
/**
|
|
39
|
-
*
|
|
41
|
+
* Get the project ID
|
|
40
42
|
*/
|
|
41
|
-
|
|
43
|
+
getProjectId(): string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Make a PATCH request
|
|
46
|
+
*/
|
|
47
|
+
patch<T>(url: string, body: unknown): Promise<T>;
|
|
42
48
|
/**
|
|
43
49
|
* Make a POST request with JSON body
|
|
44
50
|
*/
|
|
@@ -48,11 +54,11 @@ export declare class RunHttpClient {
|
|
|
48
54
|
*/
|
|
49
55
|
postXanoScript<T>(url: string, code: string): Promise<T>;
|
|
50
56
|
/**
|
|
51
|
-
* Make
|
|
57
|
+
* Make an HTTP request
|
|
52
58
|
*/
|
|
53
|
-
|
|
59
|
+
request<T>(url: string, options: RequestInit): Promise<T>;
|
|
54
60
|
/**
|
|
55
|
-
*
|
|
61
|
+
* Log a message if verbose mode is enabled
|
|
56
62
|
*/
|
|
57
|
-
|
|
63
|
+
private log;
|
|
58
64
|
}
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
* HTTP client for Xano Run API
|
|
3
3
|
* Based on @xano/run-sdk HttpClient
|
|
4
4
|
*/
|
|
5
|
-
export const DEFAULT_RUN_BASE_URL = 'https://app.xano.com/';
|
|
5
|
+
export const DEFAULT_RUN_BASE_URL = 'https://app.dev.xano.com/';
|
|
6
6
|
export class RunHttpClient {
|
|
7
7
|
config;
|
|
8
8
|
constructor(config) {
|
|
9
9
|
this.config = config;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Build a URL scoped to the current project
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
buildProjectUrl(path, queryParams) {
|
|
15
|
+
const { projectId } = this.config;
|
|
16
|
+
if (!projectId) {
|
|
17
|
+
throw new Error('Project ID is required. Set it in your profile.');
|
|
18
|
+
}
|
|
19
|
+
return this.buildUrl(`/project/${projectId}${path}`, queryParams);
|
|
16
20
|
}
|
|
17
21
|
/**
|
|
18
|
-
* Build
|
|
22
|
+
* Build a URL scoped to a specific session
|
|
19
23
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
'Content-Type': contentType,
|
|
23
|
-
'Authorization': `Bearer ${this.config.authToken}`,
|
|
24
|
-
};
|
|
25
|
-
return headers;
|
|
24
|
+
buildSessionUrl(sessionId, path = '', queryParams) {
|
|
25
|
+
return this.buildUrl(`/session/${sessionId}${path}`, queryParams);
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* Build a URL with optional query parameters
|
|
@@ -47,50 +47,48 @@ export class RunHttpClient {
|
|
|
47
47
|
return url.toString();
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
50
|
+
* Make a DELETE request
|
|
51
51
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
async delete(url, body) {
|
|
53
|
+
return this.request(url, {
|
|
54
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
55
|
+
headers: this.getHeaders(),
|
|
56
|
+
method: 'DELETE',
|
|
57
|
+
});
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
60
|
+
* Make a GET request
|
|
61
61
|
*/
|
|
62
|
-
|
|
63
|
-
return this.
|
|
62
|
+
async get(url) {
|
|
63
|
+
return this.request(url, {
|
|
64
|
+
headers: this.getHeaders(),
|
|
65
|
+
method: 'GET',
|
|
66
|
+
});
|
|
64
67
|
}
|
|
65
68
|
/**
|
|
66
|
-
*
|
|
69
|
+
* Build headers for a request
|
|
67
70
|
*/
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
error.response = await response.json();
|
|
75
|
-
}
|
|
76
|
-
catch {
|
|
77
|
-
error.response = await response.text();
|
|
78
|
-
}
|
|
79
|
-
throw error;
|
|
80
|
-
}
|
|
81
|
-
const text = await response.text();
|
|
82
|
-
if (!text) {
|
|
83
|
-
return undefined;
|
|
84
|
-
}
|
|
85
|
-
return JSON.parse(text);
|
|
71
|
+
getHeaders(contentType = 'application/json') {
|
|
72
|
+
const headers = {
|
|
73
|
+
'Authorization': `Bearer ${this.config.authToken}`,
|
|
74
|
+
'Content-Type': contentType,
|
|
75
|
+
};
|
|
76
|
+
return headers;
|
|
86
77
|
}
|
|
87
78
|
/**
|
|
88
|
-
*
|
|
79
|
+
* Get the project ID
|
|
89
80
|
*/
|
|
90
|
-
|
|
81
|
+
getProjectId() {
|
|
82
|
+
return this.config.projectId;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Make a PATCH request
|
|
86
|
+
*/
|
|
87
|
+
async patch(url, body) {
|
|
91
88
|
return this.request(url, {
|
|
92
|
-
|
|
89
|
+
body: JSON.stringify(body),
|
|
93
90
|
headers: this.getHeaders(),
|
|
91
|
+
method: 'PATCH',
|
|
94
92
|
});
|
|
95
93
|
}
|
|
96
94
|
/**
|
|
@@ -98,9 +96,9 @@ export class RunHttpClient {
|
|
|
98
96
|
*/
|
|
99
97
|
async post(url, body) {
|
|
100
98
|
return this.request(url, {
|
|
101
|
-
method: 'POST',
|
|
102
|
-
headers: this.getHeaders(),
|
|
103
99
|
body: body ? JSON.stringify(body) : undefined,
|
|
100
|
+
headers: this.getHeaders(),
|
|
101
|
+
method: 'POST',
|
|
104
102
|
});
|
|
105
103
|
}
|
|
106
104
|
/**
|
|
@@ -108,29 +106,66 @@ export class RunHttpClient {
|
|
|
108
106
|
*/
|
|
109
107
|
async postXanoScript(url, code) {
|
|
110
108
|
return this.request(url, {
|
|
111
|
-
method: 'POST',
|
|
112
|
-
headers: this.getHeaders('text/x-xanoscript'),
|
|
113
109
|
body: code,
|
|
110
|
+
headers: this.getHeaders('text/x-xanoscript'),
|
|
111
|
+
method: 'POST',
|
|
114
112
|
});
|
|
115
113
|
}
|
|
116
114
|
/**
|
|
117
|
-
* Make
|
|
115
|
+
* Make an HTTP request
|
|
118
116
|
*/
|
|
119
|
-
async
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
});
|
|
117
|
+
async request(url, options) {
|
|
118
|
+
const method = options.method || 'GET';
|
|
119
|
+
const contentType = options.headers?.['Content-Type'] || 'application/json';
|
|
120
|
+
// Log request details
|
|
121
|
+
this.log(`\n${'─'.repeat(60)}`);
|
|
122
|
+
this.log(`→ ${method} ${url}`);
|
|
123
|
+
this.log(` Content-Type: ${contentType}`);
|
|
124
|
+
if (options.body) {
|
|
125
|
+
const bodyPreview = typeof options.body === 'string'
|
|
126
|
+
? options.body.length > 500 ? options.body.slice(0, 500) + '...' : options.body
|
|
127
|
+
: JSON.stringify(options.body);
|
|
128
|
+
this.log(` Body: ${bodyPreview}`);
|
|
129
|
+
}
|
|
130
|
+
const startTime = Date.now();
|
|
131
|
+
const response = await fetch(url, options);
|
|
132
|
+
const elapsed = Date.now() - startTime;
|
|
133
|
+
// Log response details
|
|
134
|
+
this.log(`← ${response.status} ${response.statusText} (${elapsed}ms)`);
|
|
135
|
+
if (!response.ok) {
|
|
136
|
+
const error = new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
137
|
+
error.status = response.status;
|
|
138
|
+
try {
|
|
139
|
+
error.response = await response.json();
|
|
140
|
+
this.log(` Response: ${JSON.stringify(error.response, null, 2)}`);
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
error.response = await response.text();
|
|
144
|
+
this.log(` Response: ${error.response}`);
|
|
145
|
+
}
|
|
146
|
+
this.log(`${'─'.repeat(60)}\n`);
|
|
147
|
+
throw error;
|
|
148
|
+
}
|
|
149
|
+
const text = await response.text();
|
|
150
|
+
if (!text) {
|
|
151
|
+
this.log(` Response: (empty)`);
|
|
152
|
+
this.log(`${'─'.repeat(60)}\n`);
|
|
153
|
+
return undefined;
|
|
154
|
+
}
|
|
155
|
+
const parsed = JSON.parse(text);
|
|
156
|
+
if (this.config.verbose) {
|
|
157
|
+
const responsePreview = text.length > 1000 ? text.slice(0, 1000) + '...' : text;
|
|
158
|
+
this.log(` Response: ${responsePreview}`);
|
|
159
|
+
}
|
|
160
|
+
this.log(`${'─'.repeat(60)}\n`);
|
|
161
|
+
return parsed;
|
|
125
162
|
}
|
|
126
163
|
/**
|
|
127
|
-
*
|
|
164
|
+
* Log a message if verbose mode is enabled
|
|
128
165
|
*/
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
body: body ? JSON.stringify(body) : undefined,
|
|
134
|
-
});
|
|
166
|
+
log(message) {
|
|
167
|
+
if (this.config.verbose && this.config.logger) {
|
|
168
|
+
this.config.logger(message);
|
|
169
|
+
}
|
|
135
170
|
}
|
|
136
171
|
}
|
package/dist/lib/run-types.d.ts
CHANGED
|
@@ -3,35 +3,35 @@
|
|
|
3
3
|
* Based on @xano/run-sdk types
|
|
4
4
|
*/
|
|
5
5
|
export interface PaginatedResponse<T> {
|
|
6
|
+
curPage?: number;
|
|
6
7
|
items: T[];
|
|
7
8
|
itemsReceived?: number;
|
|
8
|
-
curPage?: number;
|
|
9
|
-
nextPage?: number | null;
|
|
10
|
-
prevPage?: number | null;
|
|
11
|
-
offset?: number;
|
|
12
|
-
perPage?: number;
|
|
13
9
|
itemsTotal?: number;
|
|
10
|
+
nextPage?: null | number;
|
|
11
|
+
offset?: number;
|
|
14
12
|
pageTotal?: number;
|
|
13
|
+
perPage?: number;
|
|
14
|
+
prevPage?: null | number;
|
|
15
15
|
}
|
|
16
16
|
export interface XanoRunError extends Error {
|
|
17
|
-
status?: number;
|
|
18
17
|
response?: unknown;
|
|
18
|
+
status?: number;
|
|
19
19
|
}
|
|
20
20
|
export interface Project {
|
|
21
|
-
|
|
21
|
+
access: 'private' | 'public';
|
|
22
22
|
created_at: string;
|
|
23
|
-
name: string;
|
|
24
23
|
description: string;
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
25
26
|
user_id: number;
|
|
26
|
-
access: 'private' | 'public';
|
|
27
27
|
}
|
|
28
28
|
export interface CreateProjectInput {
|
|
29
|
-
name: string;
|
|
30
29
|
description: string;
|
|
30
|
+
name: string;
|
|
31
31
|
}
|
|
32
32
|
export interface UpdateProjectInput {
|
|
33
|
-
name?: string;
|
|
34
33
|
description?: string;
|
|
34
|
+
name?: string;
|
|
35
35
|
}
|
|
36
36
|
export interface EnvKeysResponse {
|
|
37
37
|
env: string[];
|
|
@@ -41,34 +41,34 @@ export interface EnvValueResponse {
|
|
|
41
41
|
value: string;
|
|
42
42
|
}
|
|
43
43
|
export interface UpdateEnvInput {
|
|
44
|
-
name: string;
|
|
45
44
|
env: {
|
|
46
45
|
name: string;
|
|
47
46
|
value: string;
|
|
48
47
|
};
|
|
48
|
+
name: string;
|
|
49
49
|
}
|
|
50
50
|
export type SecretType = 'kubernetes.io/dockerconfigjson' | 'kubernetes.io/service-account-token';
|
|
51
51
|
export interface SecretMetadata {
|
|
52
52
|
name: string;
|
|
53
|
-
type: SecretType;
|
|
54
53
|
repo?: string;
|
|
54
|
+
type: SecretType;
|
|
55
55
|
}
|
|
56
56
|
export interface SecretKeysResponse {
|
|
57
57
|
secrets: SecretMetadata[];
|
|
58
58
|
}
|
|
59
59
|
export interface SecretValueResponse {
|
|
60
60
|
name: string;
|
|
61
|
-
type: SecretType;
|
|
62
61
|
repo?: string;
|
|
62
|
+
type: SecretType;
|
|
63
63
|
value: string;
|
|
64
64
|
}
|
|
65
65
|
export interface UpdateSecretInput {
|
|
66
66
|
name: string;
|
|
67
67
|
secret: {
|
|
68
68
|
name: string;
|
|
69
|
+
repo?: string;
|
|
69
70
|
type: SecretType;
|
|
70
71
|
value: string;
|
|
71
|
-
repo?: string;
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
export type RunType = 'job' | 'service';
|
|
@@ -81,70 +81,83 @@ export interface RunBackup {
|
|
|
81
81
|
size: number;
|
|
82
82
|
}
|
|
83
83
|
export interface RunDefinition {
|
|
84
|
-
|
|
84
|
+
args: Record<string, unknown> | unknown[];
|
|
85
85
|
created_at: string;
|
|
86
|
-
|
|
86
|
+
doc: string;
|
|
87
|
+
id: string;
|
|
87
88
|
name: string;
|
|
88
|
-
user_id: number;
|
|
89
89
|
project_id: string;
|
|
90
90
|
sig: string;
|
|
91
91
|
type: RunType;
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
updated_at: string;
|
|
93
|
+
user_id: number;
|
|
94
94
|
}
|
|
95
95
|
export interface SessionExecution {
|
|
96
|
-
|
|
96
|
+
_run: RunDefinition;
|
|
97
|
+
access: string;
|
|
98
|
+
backup: RunBackup;
|
|
99
|
+
batch_id: null | string;
|
|
100
|
+
boot_time: number;
|
|
97
101
|
created_at: string;
|
|
98
|
-
updated_at: string;
|
|
99
|
-
run_id: string;
|
|
100
|
-
batch_id: string | null;
|
|
101
|
-
state: 'complete' | 'error' | string;
|
|
102
102
|
error_msg: string;
|
|
103
|
-
|
|
103
|
+
id: string;
|
|
104
104
|
label: string;
|
|
105
|
-
boot_time: number;
|
|
106
|
-
pre_time: number;
|
|
107
105
|
main_time: number;
|
|
108
106
|
post_time: number;
|
|
109
|
-
|
|
107
|
+
pre_time: number;
|
|
108
|
+
response: unknown;
|
|
109
|
+
run_id: string;
|
|
110
|
+
state: 'complete' | 'error' | string;
|
|
110
111
|
tenant_id: number;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
_run: RunDefinition;
|
|
112
|
+
total_time: number;
|
|
113
|
+
updated_at: string;
|
|
114
114
|
}
|
|
115
115
|
export interface EndpointInput {
|
|
116
|
-
|
|
116
|
+
default: string;
|
|
117
117
|
name: string;
|
|
118
|
-
type: string;
|
|
119
118
|
nullable: boolean;
|
|
120
|
-
default: string;
|
|
121
119
|
required: boolean;
|
|
120
|
+
source: string;
|
|
121
|
+
type: string;
|
|
122
122
|
}
|
|
123
123
|
export interface Endpoint {
|
|
124
|
+
input: EndpointInput[];
|
|
124
125
|
url: string;
|
|
125
126
|
verb: string;
|
|
126
|
-
input: EndpointInput[];
|
|
127
127
|
}
|
|
128
128
|
export interface MetadataApi {
|
|
129
129
|
url: string;
|
|
130
130
|
}
|
|
131
131
|
export interface RunResult {
|
|
132
|
+
logs?: unknown[];
|
|
133
|
+
result?: {
|
|
134
|
+
boot_time?: number;
|
|
135
|
+
endpoints?: Endpoint[];
|
|
136
|
+
main_time?: number;
|
|
137
|
+
metadata_api?: MetadataApi;
|
|
138
|
+
post_time?: number;
|
|
139
|
+
pre_result?: unknown;
|
|
140
|
+
pre_time?: number;
|
|
141
|
+
response?: unknown;
|
|
142
|
+
state?: 'complete';
|
|
143
|
+
total_time?: number;
|
|
144
|
+
};
|
|
132
145
|
run?: {
|
|
133
|
-
|
|
134
|
-
|
|
146
|
+
debug?: string[];
|
|
147
|
+
id?: number | string;
|
|
148
|
+
problems?: Array<{
|
|
149
|
+
message?: string;
|
|
150
|
+
severity?: string;
|
|
151
|
+
}>;
|
|
135
152
|
result?: {
|
|
136
|
-
response?: unknown;
|
|
137
153
|
boot_time?: number;
|
|
138
154
|
main_time?: number;
|
|
139
|
-
pre_time?: number;
|
|
140
155
|
post_time?: number;
|
|
156
|
+
pre_time?: number;
|
|
157
|
+
response?: unknown;
|
|
141
158
|
total_time?: number;
|
|
142
159
|
};
|
|
143
|
-
|
|
144
|
-
problems?: Array<{
|
|
145
|
-
message?: string;
|
|
146
|
-
severity?: string;
|
|
147
|
-
}>;
|
|
160
|
+
session?: SessionExecution;
|
|
148
161
|
};
|
|
149
162
|
service?: {
|
|
150
163
|
id: number;
|
|
@@ -152,75 +165,62 @@ export interface RunResult {
|
|
|
152
165
|
id: number;
|
|
153
166
|
};
|
|
154
167
|
};
|
|
155
|
-
logs?: unknown[];
|
|
156
|
-
result?: {
|
|
157
|
-
state?: 'complete';
|
|
158
|
-
response?: unknown;
|
|
159
|
-
boot_time?: number;
|
|
160
|
-
pre_time?: number;
|
|
161
|
-
main_time?: number;
|
|
162
|
-
post_time?: number;
|
|
163
|
-
total_time?: number;
|
|
164
|
-
pre_result?: unknown;
|
|
165
|
-
endpoints?: Endpoint[];
|
|
166
|
-
metadata_api?: MetadataApi;
|
|
167
|
-
};
|
|
168
168
|
}
|
|
169
169
|
export interface DocInfoResult {
|
|
170
|
-
type: RunType;
|
|
171
|
-
input?: Record<string, unknown>;
|
|
172
170
|
env?: string[];
|
|
171
|
+
input?: Record<string, unknown>;
|
|
172
|
+
type: RunType;
|
|
173
173
|
}
|
|
174
|
-
export type SessionStatus = '
|
|
174
|
+
export type SessionStatus = 'error' | 'running' | 'stopped';
|
|
175
175
|
export interface Session {
|
|
176
|
-
id: string;
|
|
177
176
|
created_at: string;
|
|
178
|
-
|
|
177
|
+
id: string;
|
|
179
178
|
project_id: string;
|
|
180
179
|
state: string;
|
|
180
|
+
updated_at: string;
|
|
181
181
|
}
|
|
182
182
|
export interface SessionDetail {
|
|
183
|
+
access: 'private' | 'public';
|
|
184
|
+
backupResource: null | string;
|
|
185
|
+
createdAt: string;
|
|
186
|
+
doc: string;
|
|
183
187
|
id: string;
|
|
184
188
|
name: string;
|
|
189
|
+
projectId: null | string;
|
|
185
190
|
status: SessionStatus;
|
|
186
|
-
uptime:
|
|
191
|
+
uptime: null | number;
|
|
187
192
|
url?: string;
|
|
188
|
-
doc: string;
|
|
189
|
-
createdAt: string;
|
|
190
|
-
access: 'private' | 'public';
|
|
191
|
-
projectId: string | null;
|
|
192
|
-
backupResource: string | null;
|
|
193
193
|
}
|
|
194
194
|
export interface UpdateSessionInput {
|
|
195
|
-
name?: string;
|
|
196
195
|
access?: 'private' | 'public';
|
|
196
|
+
name?: string;
|
|
197
197
|
}
|
|
198
198
|
export interface TableColumn {
|
|
199
|
-
name: string;
|
|
200
|
-
type: string;
|
|
201
199
|
description?: string;
|
|
202
200
|
isPrimaryKey: boolean;
|
|
201
|
+
name: string;
|
|
202
|
+
type: string;
|
|
203
203
|
}
|
|
204
204
|
export interface RunLogEntry {
|
|
205
|
-
id: number;
|
|
206
205
|
created_at: string;
|
|
207
|
-
log_type: string;
|
|
208
206
|
duration: number;
|
|
209
|
-
function_name?: string;
|
|
210
207
|
error_msg: string;
|
|
211
|
-
|
|
212
|
-
|
|
208
|
+
function_name?: string;
|
|
209
|
+
id: number;
|
|
213
210
|
input?: unknown[];
|
|
211
|
+
log_object: object;
|
|
212
|
+
log_type: string;
|
|
213
|
+
output?: Record<string, unknown> | string;
|
|
214
214
|
stack?: unknown[];
|
|
215
215
|
value_store?: Record<string, unknown>;
|
|
216
216
|
}
|
|
217
217
|
export interface SinkTable {
|
|
218
|
-
guid: string;
|
|
219
|
-
name: string;
|
|
220
218
|
columns: TableColumn[];
|
|
221
219
|
content: Record<string, unknown>[];
|
|
220
|
+
guid: string;
|
|
221
|
+
name: string;
|
|
222
222
|
}
|
|
223
223
|
export interface SinkData {
|
|
224
|
-
tables: SinkTable[];
|
|
225
224
|
logs: RunLogEntry[];
|
|
225
|
+
tables: SinkTable[];
|
|
226
226
|
}
|