@xano/cli 0.0.26 → 0.0.27

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 (110) hide show
  1. package/dist/base-command.d.ts +3 -1
  2. package/dist/base-command.js +12 -5
  3. package/dist/commands/auth/index.d.ts +21 -0
  4. package/dist/commands/auth/index.js +533 -0
  5. package/dist/commands/branch/create/index.d.ts +17 -0
  6. package/dist/commands/branch/create/index.js +164 -0
  7. package/dist/commands/branch/delete/index.d.ts +18 -0
  8. package/dist/commands/branch/delete/index.js +156 -0
  9. package/dist/commands/branch/edit/index.d.ts +19 -0
  10. package/dist/commands/branch/edit/index.js +166 -0
  11. package/dist/commands/branch/get/index.d.ts +16 -0
  12. package/dist/commands/branch/get/index.js +135 -0
  13. package/dist/commands/branch/list/index.d.ts +18 -0
  14. package/dist/commands/branch/list/index.js +138 -0
  15. package/dist/commands/branch/set-live/index.d.ts +18 -0
  16. package/dist/commands/branch/set-live/index.js +155 -0
  17. package/dist/commands/function/create/index.d.ts +7 -6
  18. package/dist/commands/function/create/index.js +55 -55
  19. package/dist/commands/function/edit/index.d.ts +11 -10
  20. package/dist/commands/function/edit/index.js +155 -162
  21. package/dist/commands/function/get/index.d.ts +6 -5
  22. package/dist/commands/function/get/index.js +55 -60
  23. package/dist/commands/function/list/index.d.ts +6 -5
  24. package/dist/commands/function/list/index.js +52 -52
  25. package/dist/commands/profile/create/index.d.ts +6 -6
  26. package/dist/commands/profile/create/index.js +37 -37
  27. package/dist/commands/profile/delete/index.d.ts +2 -2
  28. package/dist/commands/profile/delete/index.js +9 -9
  29. package/dist/commands/profile/edit/index.d.ts +8 -7
  30. package/dist/commands/profile/edit/index.js +48 -48
  31. package/dist/commands/profile/get-default/index.js +1 -1
  32. package/dist/commands/profile/list/index.d.ts +2 -2
  33. package/dist/commands/profile/list/index.js +9 -9
  34. package/dist/commands/profile/me/index.d.ts +4 -3
  35. package/dist/commands/profile/me/index.js +21 -21
  36. package/dist/commands/profile/project/index.js +1 -1
  37. package/dist/commands/profile/set-default/index.js +1 -1
  38. package/dist/commands/profile/token/index.js +1 -1
  39. package/dist/commands/profile/wizard/index.d.ts +5 -4
  40. package/dist/commands/profile/wizard/index.js +142 -108
  41. package/dist/commands/run/env/delete/index.d.ts +3 -2
  42. package/dist/commands/run/env/delete/index.js +10 -10
  43. package/dist/commands/run/env/get/index.d.ts +3 -2
  44. package/dist/commands/run/env/get/index.js +11 -11
  45. package/dist/commands/run/env/list/index.d.ts +3 -2
  46. package/dist/commands/run/env/list/index.js +17 -19
  47. package/dist/commands/run/env/set/index.d.ts +3 -2
  48. package/dist/commands/run/env/set/index.js +5 -5
  49. package/dist/commands/run/exec/index.d.ts +19 -8
  50. package/dist/commands/run/exec/index.js +186 -108
  51. package/dist/commands/run/info/index.d.ts +5 -4
  52. package/dist/commands/run/info/index.js +27 -27
  53. package/dist/commands/run/projects/create/index.d.ts +4 -3
  54. package/dist/commands/run/projects/create/index.js +23 -23
  55. package/dist/commands/run/projects/delete/index.d.ts +3 -2
  56. package/dist/commands/run/projects/delete/index.js +10 -10
  57. package/dist/commands/run/projects/list/index.d.ts +3 -2
  58. package/dist/commands/run/projects/list/index.js +12 -12
  59. package/dist/commands/run/projects/update/index.d.ts +4 -3
  60. package/dist/commands/run/projects/update/index.js +21 -21
  61. package/dist/commands/run/secrets/delete/index.d.ts +3 -2
  62. package/dist/commands/run/secrets/delete/index.js +10 -10
  63. package/dist/commands/run/secrets/get/index.d.ts +3 -2
  64. package/dist/commands/run/secrets/get/index.js +11 -11
  65. package/dist/commands/run/secrets/list/index.d.ts +3 -2
  66. package/dist/commands/run/secrets/list/index.js +22 -24
  67. package/dist/commands/run/secrets/set/index.d.ts +4 -3
  68. package/dist/commands/run/secrets/set/index.js +16 -16
  69. package/dist/commands/run/sessions/delete/index.d.ts +3 -2
  70. package/dist/commands/run/sessions/delete/index.js +10 -10
  71. package/dist/commands/run/sessions/get/index.d.ts +3 -2
  72. package/dist/commands/run/sessions/get/index.js +11 -11
  73. package/dist/commands/run/sessions/list/index.d.ts +3 -2
  74. package/dist/commands/run/sessions/list/index.js +11 -11
  75. package/dist/commands/run/sessions/start/index.d.ts +3 -2
  76. package/dist/commands/run/sessions/start/index.js +11 -11
  77. package/dist/commands/run/sessions/stop/index.d.ts +3 -2
  78. package/dist/commands/run/sessions/stop/index.js +11 -11
  79. package/dist/commands/run/sink/get/index.d.ts +3 -2
  80. package/dist/commands/run/sink/get/index.js +11 -11
  81. package/dist/commands/static_host/build/create/index.d.ts +5 -4
  82. package/dist/commands/static_host/build/create/index.js +33 -33
  83. package/dist/commands/static_host/build/get/index.d.ts +5 -4
  84. package/dist/commands/static_host/build/get/index.js +20 -20
  85. package/dist/commands/static_host/build/list/index.d.ts +4 -3
  86. package/dist/commands/static_host/build/list/index.js +31 -31
  87. package/dist/commands/static_host/list/index.d.ts +4 -3
  88. package/dist/commands/static_host/list/index.js +31 -31
  89. package/dist/commands/workspace/create/index.d.ts +14 -0
  90. package/dist/commands/workspace/create/index.js +131 -0
  91. package/dist/commands/workspace/delete/index.d.ts +20 -0
  92. package/dist/commands/workspace/delete/index.js +141 -0
  93. package/dist/commands/workspace/edit/index.d.ts +22 -0
  94. package/dist/commands/workspace/edit/index.js +176 -0
  95. package/dist/commands/workspace/get/index.d.ts +18 -0
  96. package/dist/commands/workspace/get/index.js +136 -0
  97. package/dist/commands/workspace/list/index.d.ts +3 -2
  98. package/dist/commands/workspace/list/index.js +15 -15
  99. package/dist/commands/workspace/pull/index.d.ts +5 -4
  100. package/dist/commands/workspace/pull/index.js +113 -64
  101. package/dist/commands/workspace/push/index.d.ts +1 -0
  102. package/dist/commands/workspace/push/index.js +5 -5
  103. package/dist/help.d.ts +1 -1
  104. package/dist/lib/base-run-command.d.ts +6 -6
  105. package/dist/lib/base-run-command.js +8 -6
  106. package/dist/lib/run-http-client.d.ts +24 -18
  107. package/dist/lib/run-http-client.js +96 -61
  108. package/dist/lib/run-types.d.ts +80 -80
  109. package/oclif.manifest.json +1963 -785
  110. package/package.json +1 -1
@@ -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
- * Get the project ID
17
+ * Build a URL scoped to the current project
16
18
  */
17
- getProjectId(): string | undefined;
19
+ buildProjectUrl(path: string, queryParams?: Record<string, unknown>): string;
18
20
  /**
19
- * Build headers for a request
21
+ * Build a URL scoped to a specific session
20
22
  */
21
- getHeaders(contentType?: string): HeadersInit;
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
- * Build a URL scoped to the current project
29
+ * Make a DELETE request
28
30
  */
29
- buildProjectUrl(path: string, queryParams?: Record<string, unknown>): string;
31
+ delete<T>(url: string, body?: unknown): Promise<T>;
30
32
  /**
31
- * Build a URL scoped to a specific session
33
+ * Make a GET request
32
34
  */
33
- buildSessionUrl(sessionId: string, path?: string, queryParams?: Record<string, unknown>): string;
35
+ get<T>(url: string): Promise<T>;
34
36
  /**
35
- * Make an HTTP request
37
+ * Build headers for a request
36
38
  */
37
- request<T>(url: string, options: RequestInit): Promise<T>;
39
+ getHeaders(contentType?: string): HeadersInit;
38
40
  /**
39
- * Make a GET request
41
+ * Get the project ID
40
42
  */
41
- get<T>(url: string): Promise<T>;
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 a PATCH request
57
+ * Make an HTTP request
52
58
  */
53
- patch<T>(url: string, body: unknown): Promise<T>;
59
+ request<T>(url: string, options: RequestInit): Promise<T>;
54
60
  /**
55
- * Make a DELETE request
61
+ * Log a message if verbose mode is enabled
56
62
  */
57
- delete<T>(url: string, body?: unknown): Promise<T>;
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
- * Get the project ID
12
+ * Build a URL scoped to the current project
13
13
  */
14
- getProjectId() {
15
- return this.config.projectId;
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 headers for a request
22
+ * Build a URL scoped to a specific session
19
23
  */
20
- getHeaders(contentType = 'application/json') {
21
- const headers = {
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
- * Build a URL scoped to the current project
50
+ * Make a DELETE request
51
51
  */
52
- buildProjectUrl(path, queryParams) {
53
- const projectId = this.config.projectId;
54
- if (!projectId) {
55
- throw new Error('Project ID is required. Set it in your profile.');
56
- }
57
- return this.buildUrl(`/project/${projectId}${path}`, queryParams);
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
- * Build a URL scoped to a specific session
60
+ * Make a GET request
61
61
  */
62
- buildSessionUrl(sessionId, path = '', queryParams) {
63
- return this.buildUrl(`/session/${sessionId}${path}`, queryParams);
62
+ async get(url) {
63
+ return this.request(url, {
64
+ headers: this.getHeaders(),
65
+ method: 'GET',
66
+ });
64
67
  }
65
68
  /**
66
- * Make an HTTP request
69
+ * Build headers for a request
67
70
  */
68
- async request(url, options) {
69
- const response = await fetch(url, options);
70
- if (!response.ok) {
71
- const error = new Error(`HTTP ${response.status}: ${response.statusText}`);
72
- error.status = response.status;
73
- try {
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
- * Make a GET request
79
+ * Get the project ID
89
80
  */
90
- async get(url) {
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
- method: 'GET',
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 a PATCH request
115
+ * Make an HTTP request
118
116
  */
119
- async patch(url, body) {
120
- return this.request(url, {
121
- method: 'PATCH',
122
- headers: this.getHeaders(),
123
- body: JSON.stringify(body),
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
- * Make a DELETE request
164
+ * Log a message if verbose mode is enabled
128
165
  */
129
- async delete(url, body) {
130
- return this.request(url, {
131
- method: 'DELETE',
132
- headers: this.getHeaders(),
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
  }
@@ -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
- id: string;
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
- id: string;
84
+ args: Record<string, unknown> | unknown[];
85
85
  created_at: string;
86
- updated_at: string;
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
- args: unknown[] | Record<string, unknown>;
93
- doc: string;
92
+ updated_at: string;
93
+ user_id: number;
94
94
  }
95
95
  export interface SessionExecution {
96
- id: string;
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
- response: unknown;
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
- total_time: number;
107
+ pre_time: number;
108
+ response: unknown;
109
+ run_id: string;
110
+ state: 'complete' | 'error' | string;
110
111
  tenant_id: number;
111
- access: string;
112
- backup: RunBackup;
113
- _run: RunDefinition;
112
+ total_time: number;
113
+ updated_at: string;
114
114
  }
115
115
  export interface EndpointInput {
116
- source: string;
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
- id?: string | number;
134
- session?: SessionExecution;
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
- debug?: string[];
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 = 'running' | 'stopped' | 'error';
174
+ export type SessionStatus = 'error' | 'running' | 'stopped';
175
175
  export interface Session {
176
- id: string;
177
176
  created_at: string;
178
- updated_at: string;
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: number | null;
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
- log_object: object;
212
- output?: string | Record<string, unknown>;
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
  }