@xano/cli 0.0.37 → 0.0.40

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 (114) hide show
  1. package/README.md +325 -102
  2. package/dist/commands/auth/index.d.ts +0 -2
  3. package/dist/commands/auth/index.js +2 -55
  4. package/dist/commands/profile/create/index.d.ts +0 -2
  5. package/dist/commands/profile/create/index.js +0 -15
  6. package/dist/commands/profile/edit/index.d.ts +0 -4
  7. package/dist/commands/profile/edit/index.js +7 -38
  8. package/dist/commands/profile/wizard/index.d.ts +0 -2
  9. package/dist/commands/profile/wizard/index.js +0 -106
  10. package/dist/commands/profile/{project → workspace}/index.d.ts +1 -1
  11. package/dist/commands/profile/{project → workspace}/index.js +10 -10
  12. package/dist/commands/release/delete/index.d.ts +2 -4
  13. package/dist/commands/release/delete/index.js +39 -12
  14. package/dist/commands/release/edit/index.d.ts +2 -4
  15. package/dist/commands/release/edit/index.js +31 -5
  16. package/dist/commands/release/export/index.d.ts +2 -4
  17. package/dist/commands/release/export/index.js +39 -11
  18. package/dist/commands/release/get/index.d.ts +2 -4
  19. package/dist/commands/release/get/index.js +31 -5
  20. package/dist/commands/release/pull/index.d.ts +31 -0
  21. package/dist/commands/release/pull/index.js +345 -0
  22. package/dist/commands/release/push/index.d.ts +26 -0
  23. package/dist/commands/release/push/index.js +230 -0
  24. package/dist/commands/tenant/backup/delete/index.d.ts +1 -1
  25. package/dist/commands/tenant/backup/delete/index.js +8 -9
  26. package/dist/commands/tenant/backup/export/index.d.ts +1 -1
  27. package/dist/commands/tenant/backup/export/index.js +9 -10
  28. package/dist/commands/tenant/backup/restore/index.d.ts +1 -1
  29. package/dist/commands/tenant/backup/restore/index.js +8 -9
  30. package/dist/commands/tenant/cluster/create/index.d.ts +18 -0
  31. package/dist/commands/tenant/cluster/create/index.js +149 -0
  32. package/dist/commands/{run/sessions/start → tenant/cluster/delete}/index.d.ts +9 -3
  33. package/dist/commands/tenant/cluster/delete/index.js +125 -0
  34. package/dist/commands/tenant/cluster/edit/index.d.ts +22 -0
  35. package/dist/commands/tenant/cluster/edit/index.js +128 -0
  36. package/dist/commands/{run/sessions → tenant/cluster}/get/index.d.ts +7 -3
  37. package/dist/commands/tenant/cluster/get/index.js +114 -0
  38. package/dist/commands/{run/info → tenant/cluster/license/get}/index.d.ts +10 -7
  39. package/dist/commands/tenant/cluster/license/get/index.js +118 -0
  40. package/dist/commands/tenant/cluster/license/set/index.d.ts +21 -0
  41. package/dist/commands/tenant/cluster/license/set/index.js +132 -0
  42. package/dist/commands/{run/env → tenant/cluster}/list/index.d.ts +3 -3
  43. package/dist/commands/tenant/cluster/list/index.js +109 -0
  44. package/dist/commands/tenant/create/index.d.ts +6 -3
  45. package/dist/commands/tenant/create/index.js +28 -20
  46. package/dist/commands/tenant/deploy_platform/index.d.ts +1 -1
  47. package/dist/commands/tenant/deploy_platform/index.js +8 -9
  48. package/dist/commands/tenant/deploy_release/index.d.ts +1 -1
  49. package/dist/commands/tenant/deploy_release/index.js +13 -13
  50. package/dist/commands/tenant/env/delete/index.d.ts +19 -0
  51. package/dist/commands/tenant/env/delete/index.js +139 -0
  52. package/dist/commands/{run/projects/create → tenant/env/get}/index.d.ts +7 -4
  53. package/dist/commands/tenant/env/get/index.js +113 -0
  54. package/dist/commands/{run/projects/update → tenant/env/get_all}/index.d.ts +7 -5
  55. package/dist/commands/tenant/env/get_all/index.js +123 -0
  56. package/dist/commands/{run/secrets/get → tenant/env/list}/index.d.ts +5 -3
  57. package/dist/commands/tenant/env/list/index.js +116 -0
  58. package/dist/commands/tenant/env/set/index.d.ts +18 -0
  59. package/dist/commands/tenant/env/set/index.js +122 -0
  60. package/dist/commands/tenant/env/set_all/index.d.ts +18 -0
  61. package/dist/commands/tenant/env/set_all/index.js +131 -0
  62. package/dist/commands/tenant/get/index.js +6 -5
  63. package/dist/commands/tenant/impersonate/index.d.ts +19 -0
  64. package/dist/commands/tenant/impersonate/index.js +146 -0
  65. package/dist/commands/tenant/license/get/index.d.ts +18 -0
  66. package/dist/commands/tenant/license/get/index.js +127 -0
  67. package/dist/commands/tenant/license/set/index.d.ts +19 -0
  68. package/dist/commands/tenant/license/set/index.js +141 -0
  69. package/dist/commands/tenant/list/index.js +6 -6
  70. package/dist/commands/tenant/pull/index.d.ts +31 -0
  71. package/dist/commands/tenant/pull/index.js +327 -0
  72. package/dist/commands/tenant/push/index.d.ts +24 -0
  73. package/dist/commands/tenant/push/index.js +245 -0
  74. package/oclif.manifest.json +2076 -1670
  75. package/package.json +1 -19
  76. package/dist/commands/run/env/delete/index.d.ts +0 -14
  77. package/dist/commands/run/env/delete/index.js +0 -65
  78. package/dist/commands/run/env/get/index.d.ts +0 -14
  79. package/dist/commands/run/env/get/index.js +0 -52
  80. package/dist/commands/run/env/list/index.js +0 -56
  81. package/dist/commands/run/env/set/index.d.ts +0 -14
  82. package/dist/commands/run/env/set/index.js +0 -51
  83. package/dist/commands/run/exec/index.d.ts +0 -31
  84. package/dist/commands/run/exec/index.js +0 -431
  85. package/dist/commands/run/info/index.js +0 -160
  86. package/dist/commands/run/projects/create/index.js +0 -75
  87. package/dist/commands/run/projects/delete/index.d.ts +0 -14
  88. package/dist/commands/run/projects/delete/index.js +0 -65
  89. package/dist/commands/run/projects/list/index.d.ts +0 -13
  90. package/dist/commands/run/projects/list/index.js +0 -66
  91. package/dist/commands/run/projects/update/index.js +0 -86
  92. package/dist/commands/run/secrets/delete/index.d.ts +0 -14
  93. package/dist/commands/run/secrets/delete/index.js +0 -65
  94. package/dist/commands/run/secrets/get/index.js +0 -52
  95. package/dist/commands/run/secrets/list/index.d.ts +0 -12
  96. package/dist/commands/run/secrets/list/index.js +0 -60
  97. package/dist/commands/run/secrets/set/index.d.ts +0 -16
  98. package/dist/commands/run/secrets/set/index.js +0 -74
  99. package/dist/commands/run/sessions/delete/index.d.ts +0 -14
  100. package/dist/commands/run/sessions/delete/index.js +0 -65
  101. package/dist/commands/run/sessions/get/index.js +0 -72
  102. package/dist/commands/run/sessions/list/index.d.ts +0 -13
  103. package/dist/commands/run/sessions/list/index.js +0 -64
  104. package/dist/commands/run/sessions/start/index.js +0 -56
  105. package/dist/commands/run/sessions/stop/index.d.ts +0 -14
  106. package/dist/commands/run/sessions/stop/index.js +0 -56
  107. package/dist/commands/run/sink/get/index.d.ts +0 -14
  108. package/dist/commands/run/sink/get/index.js +0 -63
  109. package/dist/lib/base-run-command.d.ts +0 -41
  110. package/dist/lib/base-run-command.js +0 -75
  111. package/dist/lib/run-http-client.d.ts +0 -64
  112. package/dist/lib/run-http-client.js +0 -171
  113. package/dist/lib/run-types.d.ts +0 -226
  114. package/dist/lib/run-types.js +0 -5
@@ -1,171 +0,0 @@
1
- /**
2
- * HTTP client for Xano Run API
3
- * Based on @xano/run-sdk HttpClient
4
- */
5
- export const DEFAULT_RUN_BASE_URL = 'https://app.dev.xano.com/';
6
- export class RunHttpClient {
7
- config;
8
- constructor(config) {
9
- this.config = config;
10
- }
11
- /**
12
- * Build a URL scoped to the current project
13
- */
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);
20
- }
21
- /**
22
- * Build a URL scoped to a specific session
23
- */
24
- buildSessionUrl(sessionId, path = '', queryParams) {
25
- return this.buildUrl(`/session/${sessionId}${path}`, queryParams);
26
- }
27
- /**
28
- * Build a URL with optional query parameters
29
- */
30
- buildUrl(path, queryParams) {
31
- const baseUrl = this.config.baseUrl.endsWith('/')
32
- ? this.config.baseUrl.slice(0, -1)
33
- : this.config.baseUrl;
34
- const url = new URL(`${baseUrl}/api:run${path}`);
35
- if (queryParams) {
36
- for (const [key, value] of Object.entries(queryParams)) {
37
- if (value !== undefined && value !== null) {
38
- if (typeof value === 'object') {
39
- url.searchParams.set(key, JSON.stringify(value));
40
- }
41
- else {
42
- url.searchParams.set(key, String(value));
43
- }
44
- }
45
- }
46
- }
47
- return url.toString();
48
- }
49
- /**
50
- * Make a DELETE request
51
- */
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
- }
59
- /**
60
- * Make a GET request
61
- */
62
- async get(url) {
63
- return this.request(url, {
64
- headers: this.getHeaders(),
65
- method: 'GET',
66
- });
67
- }
68
- /**
69
- * Build headers for a request
70
- */
71
- getHeaders(contentType = 'application/json') {
72
- const headers = {
73
- 'Authorization': `Bearer ${this.config.authToken}`,
74
- 'Content-Type': contentType,
75
- };
76
- return headers;
77
- }
78
- /**
79
- * Get the project ID
80
- */
81
- getProjectId() {
82
- return this.config.projectId;
83
- }
84
- /**
85
- * Make a PATCH request
86
- */
87
- async patch(url, body) {
88
- return this.request(url, {
89
- body: JSON.stringify(body),
90
- headers: this.getHeaders(),
91
- method: 'PATCH',
92
- });
93
- }
94
- /**
95
- * Make a POST request with JSON body
96
- */
97
- async post(url, body) {
98
- return this.request(url, {
99
- body: body ? JSON.stringify(body) : undefined,
100
- headers: this.getHeaders(),
101
- method: 'POST',
102
- });
103
- }
104
- /**
105
- * Make a POST request with XanoScript body
106
- */
107
- async postXanoScript(url, code) {
108
- return this.request(url, {
109
- body: code,
110
- headers: this.getHeaders('text/x-xanoscript'),
111
- method: 'POST',
112
- });
113
- }
114
- /**
115
- * Make an HTTP request
116
- */
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;
162
- }
163
- /**
164
- * Log a message if verbose mode is enabled
165
- */
166
- log(message) {
167
- if (this.config.verbose && this.config.logger) {
168
- this.config.logger(message);
169
- }
170
- }
171
- }
@@ -1,226 +0,0 @@
1
- /**
2
- * Types for Xano Run API
3
- * Based on @xano/run-sdk types
4
- */
5
- export interface PaginatedResponse<T> {
6
- curPage?: number;
7
- items: T[];
8
- itemsReceived?: number;
9
- itemsTotal?: number;
10
- nextPage?: null | number;
11
- offset?: number;
12
- pageTotal?: number;
13
- perPage?: number;
14
- prevPage?: null | number;
15
- }
16
- export interface XanoRunError extends Error {
17
- response?: unknown;
18
- status?: number;
19
- }
20
- export interface Project {
21
- access: 'private' | 'public';
22
- created_at: string;
23
- description: string;
24
- id: string;
25
- name: string;
26
- user_id: number;
27
- }
28
- export interface CreateProjectInput {
29
- description: string;
30
- name: string;
31
- }
32
- export interface UpdateProjectInput {
33
- description?: string;
34
- name?: string;
35
- }
36
- export interface EnvKeysResponse {
37
- env: string[];
38
- }
39
- export interface EnvValueResponse {
40
- name: string;
41
- value: string;
42
- }
43
- export interface UpdateEnvInput {
44
- env: {
45
- name: string;
46
- value: string;
47
- };
48
- name: string;
49
- }
50
- export type SecretType = 'kubernetes.io/dockerconfigjson' | 'kubernetes.io/service-account-token';
51
- export interface SecretMetadata {
52
- name: string;
53
- repo?: string;
54
- type: SecretType;
55
- }
56
- export interface SecretKeysResponse {
57
- secrets: SecretMetadata[];
58
- }
59
- export interface SecretValueResponse {
60
- name: string;
61
- repo?: string;
62
- type: SecretType;
63
- value: string;
64
- }
65
- export interface UpdateSecretInput {
66
- name: string;
67
- secret: {
68
- name: string;
69
- repo?: string;
70
- type: SecretType;
71
- value: string;
72
- };
73
- }
74
- export type RunType = 'job' | 'service';
75
- export interface RunOptions {
76
- args?: Record<string, unknown>;
77
- env?: Record<string, string>;
78
- }
79
- export interface RunBackup {
80
- resource: string;
81
- size: number;
82
- }
83
- export interface RunDefinition {
84
- args: Record<string, unknown> | unknown[];
85
- created_at: string;
86
- doc: string;
87
- id: string;
88
- name: string;
89
- project_id: string;
90
- sig: string;
91
- type: RunType;
92
- updated_at: string;
93
- user_id: number;
94
- }
95
- export interface SessionExecution {
96
- _run: RunDefinition;
97
- access: string;
98
- backup: RunBackup;
99
- batch_id: null | string;
100
- boot_time: number;
101
- created_at: string;
102
- error_msg: string;
103
- id: string;
104
- label: string;
105
- main_time: number;
106
- post_time: number;
107
- pre_time: number;
108
- response: unknown;
109
- run_id: string;
110
- state: 'complete' | 'error' | string;
111
- tenant_id: number;
112
- total_time: number;
113
- updated_at: string;
114
- }
115
- export interface EndpointInput {
116
- default: string;
117
- name: string;
118
- nullable: boolean;
119
- required: boolean;
120
- source: string;
121
- type: string;
122
- }
123
- export interface Endpoint {
124
- input: EndpointInput[];
125
- url: string;
126
- verb: string;
127
- }
128
- export interface MetadataApi {
129
- url: string;
130
- }
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
- };
145
- run?: {
146
- debug?: string[];
147
- id?: number | string;
148
- problems?: Array<{
149
- message?: string;
150
- severity?: string;
151
- }>;
152
- result?: {
153
- boot_time?: number;
154
- main_time?: number;
155
- post_time?: number;
156
- pre_time?: number;
157
- response?: unknown;
158
- total_time?: number;
159
- };
160
- session?: SessionExecution;
161
- };
162
- service?: {
163
- id: number;
164
- run: {
165
- id: number;
166
- };
167
- };
168
- }
169
- export interface DocInfoResult {
170
- env?: string[];
171
- input?: Record<string, unknown>;
172
- type: RunType;
173
- }
174
- export type SessionStatus = 'error' | 'running' | 'stopped';
175
- export interface Session {
176
- created_at: string;
177
- id: string;
178
- project_id: string;
179
- state: string;
180
- updated_at: string;
181
- }
182
- export interface SessionDetail {
183
- access: 'private' | 'public';
184
- backupResource: null | string;
185
- createdAt: string;
186
- doc: string;
187
- id: string;
188
- name: string;
189
- projectId: null | string;
190
- status: SessionStatus;
191
- uptime: null | number;
192
- url?: string;
193
- }
194
- export interface UpdateSessionInput {
195
- access?: 'private' | 'public';
196
- name?: string;
197
- }
198
- export interface TableColumn {
199
- description?: string;
200
- isPrimaryKey: boolean;
201
- name: string;
202
- type: string;
203
- }
204
- export interface RunLogEntry {
205
- created_at: string;
206
- duration: number;
207
- error_msg: string;
208
- function_name?: string;
209
- id: number;
210
- input?: unknown[];
211
- log_object: object;
212
- log_type: string;
213
- output?: Record<string, unknown> | string;
214
- stack?: unknown[];
215
- value_store?: Record<string, unknown>;
216
- }
217
- export interface SinkTable {
218
- columns: TableColumn[];
219
- content: Record<string, unknown>[];
220
- guid: string;
221
- name: string;
222
- }
223
- export interface SinkData {
224
- logs: RunLogEntry[];
225
- tables: SinkTable[];
226
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * Types for Xano Run API
3
- * Based on @xano/run-sdk types
4
- */
5
- export {};