@xano/cli 0.0.95-beta.9 → 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 (240) hide show
  1. package/README.md +111 -70
  2. package/dist/base-command.d.ts +16 -1
  3. package/dist/base-command.js +57 -5
  4. package/dist/commands/auth/index.d.ts +1 -0
  5. package/dist/commands/auth/index.js +15 -10
  6. package/dist/commands/branch/create/index.d.ts +4 -1
  7. package/dist/commands/branch/create/index.js +22 -21
  8. package/dist/commands/branch/delete/index.d.ts +1 -0
  9. package/dist/commands/branch/delete/index.js +1 -4
  10. package/dist/commands/branch/edit/index.d.ts +1 -0
  11. package/dist/commands/branch/edit/index.js +1 -4
  12. package/dist/commands/branch/get/index.d.ts +1 -0
  13. package/dist/commands/branch/get/index.js +1 -4
  14. package/dist/commands/branch/list/index.d.ts +2 -6
  15. package/dist/commands/branch/list/index.js +13 -17
  16. package/dist/commands/branch/set_live/index.d.ts +1 -0
  17. package/dist/commands/branch/set_live/index.js +1 -4
  18. package/dist/commands/function/create/index.d.ts +1 -0
  19. package/dist/commands/function/create/index.js +1 -2
  20. package/dist/commands/function/edit/index.d.ts +1 -0
  21. package/dist/commands/function/edit/index.js +1 -2
  22. package/dist/commands/function/get/index.d.ts +1 -0
  23. package/dist/commands/function/get/index.js +1 -4
  24. package/dist/commands/function/list/index.d.ts +1 -0
  25. package/dist/commands/function/list/index.js +1 -4
  26. package/dist/commands/platform/get/index.d.ts +1 -0
  27. package/dist/commands/platform/get/index.js +1 -4
  28. package/dist/commands/platform/list/index.d.ts +1 -0
  29. package/dist/commands/platform/list/index.js +1 -4
  30. package/dist/commands/profile/create/index.d.ts +1 -0
  31. package/dist/commands/profile/create/index.js +10 -4
  32. package/dist/commands/profile/delete/index.d.ts +1 -0
  33. package/dist/commands/profile/delete/index.js +8 -4
  34. package/dist/commands/profile/edit/index.d.ts +1 -0
  35. package/dist/commands/profile/edit/index.js +1 -4
  36. package/dist/commands/profile/get/index.d.ts +3 -0
  37. package/dist/commands/profile/get/index.js +12 -5
  38. package/dist/commands/profile/list/index.d.ts +1 -0
  39. package/dist/commands/profile/list/index.js +8 -4
  40. package/dist/commands/profile/me/index.d.ts +1 -0
  41. package/dist/commands/profile/me/index.js +1 -4
  42. package/dist/commands/profile/set/index.d.ts +3 -0
  43. package/dist/commands/profile/set/index.js +12 -6
  44. package/dist/commands/profile/token/index.d.ts +3 -0
  45. package/dist/commands/profile/token/index.js +12 -5
  46. package/dist/commands/profile/wizard/index.d.ts +1 -0
  47. package/dist/commands/profile/wizard/index.js +13 -9
  48. package/dist/commands/profile/workspace/index.d.ts +3 -0
  49. package/dist/commands/profile/workspace/index.js +12 -5
  50. package/dist/commands/profile/workspace/set/index.d.ts +1 -0
  51. package/dist/commands/profile/workspace/set/index.js +1 -3
  52. package/dist/commands/release/create/index.d.ts +4 -1
  53. package/dist/commands/release/create/index.js +12 -14
  54. package/dist/commands/release/delete/index.d.ts +1 -0
  55. package/dist/commands/release/delete/index.js +1 -4
  56. package/dist/commands/release/deploy/index.d.ts +3 -0
  57. package/dist/commands/release/deploy/index.js +31 -1
  58. package/dist/commands/release/edit/index.d.ts +1 -0
  59. package/dist/commands/release/edit/index.js +1 -4
  60. package/dist/commands/release/export/index.d.ts +1 -0
  61. package/dist/commands/release/export/index.js +1 -3
  62. package/dist/commands/release/get/index.d.ts +1 -0
  63. package/dist/commands/release/get/index.js +1 -4
  64. package/dist/commands/release/import/index.d.ts +1 -0
  65. package/dist/commands/release/import/index.js +1 -3
  66. package/dist/commands/release/list/index.d.ts +1 -0
  67. package/dist/commands/release/list/index.js +1 -4
  68. package/dist/commands/release/pull/index.d.ts +2 -3
  69. package/dist/commands/release/pull/index.js +19 -18
  70. package/dist/commands/release/push/index.d.ts +2 -3
  71. package/dist/commands/release/push/index.js +19 -22
  72. package/dist/commands/sandbox/delete/index.d.ts +13 -0
  73. package/dist/commands/sandbox/delete/index.js +71 -0
  74. package/dist/commands/sandbox/env/delete/index.d.ts +1 -0
  75. package/dist/commands/sandbox/env/delete/index.js +4 -2
  76. package/dist/commands/sandbox/env/get/index.d.ts +1 -0
  77. package/dist/commands/sandbox/env/get/index.js +4 -2
  78. package/dist/commands/sandbox/env/get_all/index.d.ts +1 -0
  79. package/dist/commands/sandbox/env/get_all/index.js +4 -2
  80. package/dist/commands/sandbox/env/list/index.d.ts +1 -0
  81. package/dist/commands/sandbox/env/list/index.js +4 -2
  82. package/dist/commands/sandbox/env/set/index.d.ts +1 -0
  83. package/dist/commands/sandbox/env/set/index.js +4 -2
  84. package/dist/commands/sandbox/env/set_all/index.d.ts +1 -0
  85. package/dist/commands/sandbox/env/set_all/index.js +4 -2
  86. package/dist/commands/sandbox/get/index.d.ts +1 -0
  87. package/dist/commands/sandbox/get/index.js +2 -0
  88. package/dist/commands/sandbox/license/get/index.d.ts +1 -0
  89. package/dist/commands/sandbox/license/get/index.js +4 -2
  90. package/dist/commands/sandbox/license/set/index.d.ts +1 -0
  91. package/dist/commands/sandbox/license/set/index.js +4 -2
  92. package/dist/commands/sandbox/pull/index.d.ts +2 -3
  93. package/dist/commands/sandbox/pull/index.js +19 -14
  94. package/dist/commands/sandbox/push/index.d.ts +12 -4
  95. package/dist/commands/sandbox/push/index.js +150 -95
  96. package/dist/commands/sandbox/reset/index.d.ts +1 -0
  97. package/dist/commands/sandbox/reset/index.js +4 -2
  98. package/dist/commands/sandbox/review/index.d.ts +1 -0
  99. package/dist/commands/sandbox/review/index.js +4 -2
  100. package/dist/commands/sandbox/unit_test/list/index.d.ts +1 -0
  101. package/dist/commands/sandbox/unit_test/list/index.js +4 -2
  102. package/dist/commands/sandbox/unit_test/run/index.d.ts +1 -0
  103. package/dist/commands/sandbox/unit_test/run/index.js +4 -2
  104. package/dist/commands/sandbox/unit_test/run_all/index.d.ts +1 -0
  105. package/dist/commands/sandbox/unit_test/run_all/index.js +4 -0
  106. package/dist/commands/sandbox/workflow_test/list/index.d.ts +1 -0
  107. package/dist/commands/sandbox/workflow_test/list/index.js +4 -2
  108. package/dist/commands/sandbox/workflow_test/run/index.d.ts +1 -0
  109. package/dist/commands/sandbox/workflow_test/run/index.js +4 -2
  110. package/dist/commands/sandbox/workflow_test/run_all/index.d.ts +1 -0
  111. package/dist/commands/sandbox/workflow_test/run_all/index.js +4 -0
  112. package/dist/commands/static_host/build/create/index.d.ts +1 -0
  113. package/dist/commands/static_host/build/create/index.js +1 -3
  114. package/dist/commands/static_host/build/get/index.d.ts +1 -0
  115. package/dist/commands/static_host/build/get/index.js +1 -4
  116. package/dist/commands/static_host/build/list/index.d.ts +1 -0
  117. package/dist/commands/static_host/build/list/index.js +1 -4
  118. package/dist/commands/static_host/list/index.d.ts +1 -0
  119. package/dist/commands/static_host/list/index.js +1 -4
  120. package/dist/commands/tenant/backup/create/index.d.ts +1 -0
  121. package/dist/commands/tenant/backup/create/index.js +1 -4
  122. package/dist/commands/tenant/backup/delete/index.d.ts +1 -0
  123. package/dist/commands/tenant/backup/delete/index.js +1 -4
  124. package/dist/commands/tenant/backup/export/index.d.ts +1 -0
  125. package/dist/commands/tenant/backup/export/index.js +1 -3
  126. package/dist/commands/tenant/backup/import/index.d.ts +1 -0
  127. package/dist/commands/tenant/backup/import/index.js +1 -3
  128. package/dist/commands/tenant/backup/list/index.d.ts +1 -0
  129. package/dist/commands/tenant/backup/list/index.js +1 -4
  130. package/dist/commands/tenant/backup/restore/index.d.ts +1 -0
  131. package/dist/commands/tenant/backup/restore/index.js +1 -4
  132. package/dist/commands/tenant/cluster/create/index.d.ts +1 -0
  133. package/dist/commands/tenant/cluster/create/index.js +1 -3
  134. package/dist/commands/tenant/cluster/delete/index.d.ts +1 -0
  135. package/dist/commands/tenant/cluster/delete/index.js +1 -4
  136. package/dist/commands/tenant/cluster/edit/index.d.ts +1 -0
  137. package/dist/commands/tenant/cluster/edit/index.js +1 -4
  138. package/dist/commands/tenant/cluster/get/index.d.ts +1 -0
  139. package/dist/commands/tenant/cluster/get/index.js +1 -4
  140. package/dist/commands/tenant/cluster/license/get/index.d.ts +1 -0
  141. package/dist/commands/tenant/cluster/license/get/index.js +1 -3
  142. package/dist/commands/tenant/cluster/license/set/index.d.ts +1 -0
  143. package/dist/commands/tenant/cluster/license/set/index.js +1 -3
  144. package/dist/commands/tenant/cluster/list/index.d.ts +1 -0
  145. package/dist/commands/tenant/cluster/list/index.js +1 -4
  146. package/dist/commands/tenant/create/index.d.ts +1 -0
  147. package/dist/commands/tenant/create/index.js +1 -3
  148. package/dist/commands/tenant/delete/index.d.ts +1 -0
  149. package/dist/commands/tenant/delete/index.js +1 -4
  150. package/dist/commands/tenant/deploy_platform/index.d.ts +1 -0
  151. package/dist/commands/tenant/deploy_platform/index.js +1 -3
  152. package/dist/commands/tenant/deploy_release/index.d.ts +1 -0
  153. package/dist/commands/tenant/deploy_release/index.js +1 -4
  154. package/dist/commands/tenant/edit/index.d.ts +1 -0
  155. package/dist/commands/tenant/edit/index.js +1 -4
  156. package/dist/commands/tenant/env/delete/index.d.ts +1 -0
  157. package/dist/commands/tenant/env/delete/index.js +1 -4
  158. package/dist/commands/tenant/env/get/index.d.ts +1 -0
  159. package/dist/commands/tenant/env/get/index.js +1 -4
  160. package/dist/commands/tenant/env/get_all/index.d.ts +1 -0
  161. package/dist/commands/tenant/env/get_all/index.js +1 -3
  162. package/dist/commands/tenant/env/list/index.d.ts +1 -0
  163. package/dist/commands/tenant/env/list/index.js +1 -4
  164. package/dist/commands/tenant/env/set/index.d.ts +1 -0
  165. package/dist/commands/tenant/env/set/index.js +1 -4
  166. package/dist/commands/tenant/env/set_all/index.d.ts +1 -0
  167. package/dist/commands/tenant/env/set_all/index.js +1 -3
  168. package/dist/commands/tenant/get/index.d.ts +1 -0
  169. package/dist/commands/tenant/get/index.js +1 -4
  170. package/dist/commands/tenant/impersonate/index.d.ts +1 -0
  171. package/dist/commands/tenant/impersonate/index.js +1 -4
  172. package/dist/commands/tenant/license/get/index.d.ts +1 -0
  173. package/dist/commands/tenant/license/get/index.js +1 -3
  174. package/dist/commands/tenant/license/set/index.d.ts +1 -0
  175. package/dist/commands/tenant/license/set/index.js +1 -3
  176. package/dist/commands/tenant/list/index.d.ts +1 -0
  177. package/dist/commands/tenant/list/index.js +1 -4
  178. package/dist/commands/tenant/pull/index.d.ts +2 -3
  179. package/dist/commands/tenant/pull/index.js +20 -21
  180. package/dist/commands/tenant/push/index.d.ts +2 -22
  181. package/dist/commands/tenant/push/index.js +7 -225
  182. package/dist/commands/tenant/unit_test/list/index.d.ts +1 -0
  183. package/dist/commands/tenant/unit_test/list/index.js +2 -27
  184. package/dist/commands/tenant/unit_test/run/index.d.ts +1 -0
  185. package/dist/commands/tenant/unit_test/run/index.js +2 -27
  186. package/dist/commands/tenant/unit_test/run_all/index.d.ts +1 -0
  187. package/dist/commands/tenant/unit_test/run_all/index.js +2 -27
  188. package/dist/commands/tenant/workflow_test/list/index.d.ts +1 -0
  189. package/dist/commands/tenant/workflow_test/list/index.js +2 -27
  190. package/dist/commands/tenant/workflow_test/run/index.d.ts +1 -0
  191. package/dist/commands/tenant/workflow_test/run/index.js +2 -27
  192. package/dist/commands/tenant/workflow_test/run_all/index.d.ts +1 -0
  193. package/dist/commands/tenant/workflow_test/run_all/index.js +2 -27
  194. package/dist/commands/unit_test/list/index.d.ts +1 -0
  195. package/dist/commands/unit_test/list/index.js +1 -4
  196. package/dist/commands/unit_test/run/index.d.ts +1 -0
  197. package/dist/commands/unit_test/run/index.js +1 -4
  198. package/dist/commands/unit_test/run_all/index.d.ts +1 -0
  199. package/dist/commands/unit_test/run_all/index.js +1 -4
  200. package/dist/commands/update/index.d.ts +1 -0
  201. package/dist/commands/workflow_test/delete/index.d.ts +1 -0
  202. package/dist/commands/workflow_test/delete/index.js +1 -4
  203. package/dist/commands/workflow_test/get/index.d.ts +1 -0
  204. package/dist/commands/workflow_test/get/index.js +1 -4
  205. package/dist/commands/workflow_test/list/index.d.ts +1 -0
  206. package/dist/commands/workflow_test/list/index.js +1 -4
  207. package/dist/commands/workflow_test/run/index.d.ts +1 -0
  208. package/dist/commands/workflow_test/run/index.js +1 -4
  209. package/dist/commands/workflow_test/run_all/index.d.ts +1 -0
  210. package/dist/commands/workflow_test/run_all/index.js +1 -4
  211. package/dist/commands/workspace/create/index.d.ts +1 -0
  212. package/dist/commands/workspace/create/index.js +1 -4
  213. package/dist/commands/workspace/delete/index.d.ts +2 -6
  214. package/dist/commands/workspace/delete/index.js +17 -16
  215. package/dist/commands/workspace/edit/index.d.ts +2 -6
  216. package/dist/commands/workspace/edit/index.js +16 -20
  217. package/dist/commands/workspace/get/index.d.ts +2 -6
  218. package/dist/commands/workspace/get/index.js +14 -18
  219. package/dist/commands/workspace/git/pull/index.d.ts +2 -3
  220. package/dist/commands/workspace/git/pull/index.js +18 -17
  221. package/dist/commands/workspace/list/index.d.ts +1 -0
  222. package/dist/commands/workspace/list/index.js +1 -4
  223. package/dist/commands/workspace/pull/index.d.ts +2 -3
  224. package/dist/commands/workspace/pull/index.js +21 -24
  225. package/dist/commands/workspace/push/index.d.ts +7 -16
  226. package/dist/commands/workspace/push/index.js +85 -700
  227. package/dist/utils/multidoc-push.d.ts +63 -0
  228. package/dist/utils/multidoc-push.js +690 -0
  229. package/dist/utils/reference-checker.d.ts +57 -0
  230. package/dist/utils/reference-checker.js +232 -0
  231. package/oclif.manifest.json +3562 -2647
  232. package/package.json +1 -1
  233. package/dist/commands/sandbox/workflow_test/delete/index.d.ts +0 -17
  234. package/dist/commands/sandbox/workflow_test/delete/index.js +0 -59
  235. package/dist/commands/sandbox/workflow_test/get/index.d.ts +0 -17
  236. package/dist/commands/sandbox/workflow_test/get/index.js +0 -58
  237. package/dist/commands/tenant/workflow_test/delete/index.d.ts +0 -19
  238. package/dist/commands/tenant/workflow_test/delete/index.js +0 -110
  239. package/dist/commands/tenant/workflow_test/get/index.d.ts +0 -19
  240. package/dist/commands/tenant/workflow_test/get/index.js +0 -112
@@ -8,6 +8,7 @@ export default class TenantEnvList extends BaseCommand {
8
8
  static flags: {
9
9
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
10
  workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
12
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
13
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
14
  };
@@ -1,8 +1,6 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
6
4
  import BaseCommand from '../../../../base-command.js';
7
5
  export default class TenantEnvList extends BaseCommand {
8
6
  static args = {
@@ -96,8 +94,7 @@ Environment variables for tenant my-tenant:
96
94
  }
97
95
  }
98
96
  loadCredentials() {
99
- const configDir = path.join(os.homedir(), '.xano');
100
- const credentialsPath = path.join(configDir, 'credentials.yaml');
97
+ const credentialsPath = this.getCredentialsPath();
101
98
  if (!fs.existsSync(credentialsPath)) {
102
99
  this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
103
100
  }
@@ -10,6 +10,7 @@ export default class TenantEnvSet extends BaseCommand {
10
10
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
11
  value: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
12
  workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
14
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
15
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
16
  };
@@ -1,8 +1,6 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
6
4
  import BaseCommand from '../../../../base-command.js';
7
5
  export default class TenantEnvSet extends BaseCommand {
8
6
  static args = {
@@ -102,8 +100,7 @@ Environment variable 'DATABASE_URL' set for tenant my-tenant
102
100
  }
103
101
  }
104
102
  loadCredentials() {
105
- const configDir = path.join(os.homedir(), '.xano');
106
- const credentialsPath = path.join(configDir, 'credentials.yaml');
103
+ const credentialsPath = this.getCredentialsPath();
107
104
  if (!fs.existsSync(credentialsPath)) {
108
105
  this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
109
106
  }
@@ -10,6 +10,7 @@ export default class TenantEnvSetAll extends BaseCommand {
10
10
  file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
11
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
12
  workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
14
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
15
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
16
  };
@@ -1,7 +1,6 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
4
  import * as path from 'node:path';
6
5
  import BaseCommand from '../../../../base-command.js';
7
6
  export default class TenantEnvSetAll extends BaseCommand {
@@ -111,8 +110,7 @@ Reads from env_my-tenant.yaml
111
110
  }
112
111
  }
113
112
  loadCredentials() {
114
- const configDir = path.join(os.homedir(), '.xano');
115
- const credentialsPath = path.join(configDir, 'credentials.yaml');
113
+ const credentialsPath = this.getCredentialsPath();
116
114
  if (!fs.existsSync(credentialsPath)) {
117
115
  this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
118
116
  }
@@ -8,6 +8,7 @@ export default class TenantGet extends BaseCommand {
8
8
  static flags: {
9
9
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
10
  workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
12
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
13
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
14
  };
@@ -1,8 +1,6 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
6
4
  import BaseCommand from '../../../base-command.js';
7
5
  export default class TenantGet extends BaseCommand {
8
6
  static args = {
@@ -118,8 +116,7 @@ Tenant: My Tenant (my-tenant)
118
116
  }
119
117
  }
120
118
  loadCredentials() {
121
- const configDir = path.join(os.homedir(), '.xano');
122
- const credentialsPath = path.join(configDir, 'credentials.yaml');
119
+ const credentialsPath = this.getCredentialsPath();
123
120
  if (!fs.existsSync(credentialsPath)) {
124
121
  this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
125
122
  }
@@ -9,6 +9,7 @@ export default class TenantImpersonate extends BaseCommand {
9
9
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
10
  'url-only': import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
11
  workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
13
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
14
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
15
  };
@@ -1,8 +1,6 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
6
4
  import open from 'open';
7
5
  import BaseCommand from '../../../base-command.js';
8
6
  export default class TenantImpersonate extends BaseCommand {
@@ -126,8 +124,7 @@ Impersonation successful!
126
124
  return instanceOrigin;
127
125
  }
128
126
  loadCredentials() {
129
- const configDir = path.join(os.homedir(), '.xano');
130
- const credentialsPath = path.join(configDir, 'credentials.yaml');
127
+ const credentialsPath = this.getCredentialsPath();
131
128
  if (!fs.existsSync(credentialsPath)) {
132
129
  this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano auth'`);
133
130
  }
@@ -10,6 +10,7 @@ export default class TenantLicenseGet extends BaseCommand {
10
10
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
11
  view: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
12
  workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
14
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
15
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
16
  };
@@ -1,7 +1,6 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
4
  import * as path from 'node:path';
6
5
  import BaseCommand from '../../../../base-command.js';
7
6
  export default class TenantLicenseGet extends BaseCommand {
@@ -107,8 +106,7 @@ License saved to my-license.yaml
107
106
  }
108
107
  }
109
108
  loadCredentials() {
110
- const configDir = path.join(os.homedir(), '.xano');
111
- const credentialsPath = path.join(configDir, 'credentials.yaml');
109
+ const credentialsPath = this.getCredentialsPath();
112
110
  if (!fs.existsSync(credentialsPath)) {
113
111
  this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
114
112
  }
@@ -11,6 +11,7 @@ export default class TenantLicenseSet extends BaseCommand {
11
11
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
12
  value: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
13
  workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
15
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
16
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
17
  };
@@ -1,7 +1,6 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
4
  import * as path from 'node:path';
6
5
  import BaseCommand from '../../../../base-command.js';
7
6
  export default class TenantLicenseSet extends BaseCommand {
@@ -121,8 +120,7 @@ Reads from license_my-tenant.yaml
121
120
  }
122
121
  }
123
122
  loadCredentials() {
124
- const configDir = path.join(os.homedir(), '.xano');
125
- const credentialsPath = path.join(configDir, 'credentials.yaml');
123
+ const credentialsPath = this.getCredentialsPath();
126
124
  if (!fs.existsSync(credentialsPath)) {
127
125
  this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
128
126
  }
@@ -5,6 +5,7 @@ export default class TenantList extends BaseCommand {
5
5
  static flags: {
6
6
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
7
  workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
9
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
10
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
11
  };
@@ -1,8 +1,6 @@
1
1
  import { Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
6
4
  import BaseCommand from '../../../base-command.js';
7
5
  export default class TenantList extends BaseCommand {
8
6
  static description = 'List all tenants in a workspace';
@@ -116,8 +114,7 @@ Tenants in workspace 5:
116
114
  }
117
115
  }
118
116
  loadCredentials() {
119
- const configDir = path.join(os.homedir(), '.xano');
120
- const credentialsPath = path.join(configDir, 'credentials.yaml');
117
+ const credentialsPath = this.getCredentialsPath();
121
118
  if (!fs.existsSync(credentialsPath)) {
122
119
  this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
123
120
  }
@@ -1,16 +1,15 @@
1
1
  import BaseCommand from '../../../base-command.js';
2
2
  export default class Pull extends BaseCommand {
3
- static args: {
4
- directory: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
- };
6
3
  static description: string;
7
4
  static examples: string[];
8
5
  static flags: {
6
+ directory: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
7
  draft: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
8
  env: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
9
  records: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
10
  tenant: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
11
  workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
13
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
14
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
15
  };
@@ -1,35 +1,35 @@
1
- import { Args, Flags } from '@oclif/core';
1
+ import { Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
4
  import * as path from 'node:path';
6
5
  import snakeCase from 'lodash.snakecase';
7
6
  import BaseCommand from '../../../base-command.js';
8
7
  import { buildApiGroupFolderResolver, parseDocument } from '../../../utils/document-parser.js';
9
8
  export default class Pull extends BaseCommand {
10
- static args = {
11
- directory: Args.string({
12
- description: 'Output directory for pulled documents',
13
- required: true,
14
- }),
15
- };
16
9
  static description = 'Pull a tenant multidoc from the Xano Metadata API and split into individual files';
17
10
  static examples = [
18
- `$ xano tenant pull ./my-tenant -t my-tenant
11
+ `$ xano tenant pull -t my-tenant
12
+ Pulled 42 documents from tenant my-tenant to current directory
13
+ `,
14
+ `$ xano tenant pull -d ./my-tenant -t my-tenant
19
15
  Pulled 42 documents from tenant my-tenant to ./my-tenant
20
16
  `,
21
- `$ xano tenant pull ./output -t my-tenant -w 40
17
+ `$ xano tenant pull -d ./output -t my-tenant -w 40
22
18
  Pulled 15 documents from tenant my-tenant to ./output
23
19
  `,
24
- `$ xano tenant pull ./backup -t my-tenant --profile production --env --records
25
- Pulled 58 documents from tenant my-tenant to ./backup
26
- `,
27
- `$ xano tenant pull ./my-tenant -t my-tenant --draft
28
- Pulled 42 documents from tenant my-tenant to ./my-tenant
20
+ `$ xano tenant pull -t my-tenant --profile production --env --records
21
+ Pulled 58 documents from tenant my-tenant
29
22
  `,
23
+ `$ xano tenant pull -t my-tenant --draft`,
30
24
  ];
31
25
  static flags = {
32
26
  ...BaseCommand.baseFlags,
27
+ directory: Flags.string({
28
+ char: 'd',
29
+ default: '.',
30
+ description: 'Output directory for pulled documents (defaults to current directory)',
31
+ required: false,
32
+ }),
33
33
  draft: Flags.boolean({
34
34
  default: false,
35
35
  description: 'Include draft versions',
@@ -57,7 +57,7 @@ Pulled 42 documents from tenant my-tenant to ./my-tenant
57
57
  }),
58
58
  };
59
59
  async run() {
60
- const { args, flags } = await this.parse(Pull);
60
+ const { flags } = await this.parse(Pull);
61
61
  // Get profile name (default or from flag/env)
62
62
  const profileName = flags.profile || this.getDefaultProfile();
63
63
  // Load credentials
@@ -85,7 +85,7 @@ Pulled 42 documents from tenant my-tenant to ./my-tenant
85
85
  }
86
86
  else {
87
87
  this.error(`Workspace ID is required. Either:\n` +
88
- ` 1. Provide it as a flag: xano tenant pull <directory> -t <tenant_name> -w <workspace_id>\n` +
88
+ ` 1. Provide it as a flag: xano tenant pull -t <tenant_name> -w <workspace_id>\n` +
89
89
  ` 2. Set it in your profile using: xano profile:edit ${profileName} -w <workspace_id>`);
90
90
  }
91
91
  const tenantName = flags.tenant;
@@ -141,7 +141,7 @@ Pulled 42 documents from tenant my-tenant to ./my-tenant
141
141
  return;
142
142
  }
143
143
  // Resolve the output directory
144
- const outputDir = path.resolve(args.directory);
144
+ const outputDir = path.resolve(flags.directory);
145
145
  // Create the output directory if it doesn't exist
146
146
  fs.mkdirSync(outputDir, { recursive: true });
147
147
  // Resolve api_group names to unique folder names, disambiguating collisions
@@ -247,11 +247,10 @@ Pulled 42 documents from tenant my-tenant to ./my-tenant
247
247
  fs.writeFileSync(filePath, doc.content, 'utf8');
248
248
  writtenCount++;
249
249
  }
250
- this.log(`Pulled ${writtenCount} documents from tenant ${tenantName} to ${args.directory}`);
250
+ this.log(`Pulled ${writtenCount} documents from tenant ${tenantName} to ${flags.directory}`);
251
251
  }
252
252
  loadCredentials() {
253
- const configDir = path.join(os.homedir(), '.xano');
254
- const credentialsPath = path.join(configDir, 'credentials.yaml');
253
+ const credentialsPath = this.getCredentialsPath();
255
254
  // Check if credentials file exists
256
255
  if (!fs.existsSync(credentialsPath)) {
257
256
  this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile:create'`);
@@ -1,25 +1,5 @@
1
- import BaseCommand from '../../../base-command.js';
2
- export default class Push extends BaseCommand {
3
- static args: {
4
- directory: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
- };
1
+ import { Command } from '@oclif/core';
2
+ export default class Push extends Command {
6
3
  static description: string;
7
- static examples: string[];
8
- static flags: {
9
- env: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
- records: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
- tenant: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
- transaction: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
- truncate: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
- workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
- profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
- };
18
4
  run(): Promise<void>;
19
- /**
20
- * Recursively collect all .xs files from a directory, sorted by
21
- * type subdirectory name then filename for deterministic ordering.
22
- */
23
- private collectFiles;
24
- private loadCredentials;
25
5
  }
@@ -1,228 +1,10 @@
1
- import { Args, Flags } from '@oclif/core';
2
- import * as yaml from 'js-yaml';
3
- import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
6
- import BaseCommand from '../../../base-command.js';
7
- import { findFilesWithGuid } from '../../../utils/document-parser.js';
8
- export default class Push extends BaseCommand {
9
- static args = {
10
- directory: Args.string({
11
- description: 'Directory containing documents to push (as produced by tenant pull or workspace pull)',
12
- required: true,
13
- }),
14
- };
15
- static description = 'Push local documents to a tenant via the Xano Metadata API multidoc endpoint';
16
- static examples = [
17
- `$ xano tenant push ./my-workspace -t my-tenant
18
- Pushed 42 documents to tenant my-tenant from ./my-workspace
19
- `,
20
- `$ xano tenant push ./output -t my-tenant -w 40
21
- Pushed 15 documents to tenant my-tenant from ./output
22
- `,
23
- `$ xano tenant push ./backup -t my-tenant --profile production
24
- Pushed 58 documents to tenant my-tenant from ./backup
25
- `,
26
- `$ xano tenant push ./my-workspace -t my-tenant --records
27
- Include table records in import
28
- `,
29
- `$ xano tenant push ./my-workspace -t my-tenant --env
30
- Include environment variables in import
31
- `,
32
- `$ xano tenant push ./my-workspace -t my-tenant --truncate
33
- Truncate all table records before importing
34
- `,
35
- ];
36
- static flags = {
37
- ...BaseCommand.baseFlags,
38
- env: Flags.boolean({
39
- default: false,
40
- description: 'Include environment variables in import',
41
- required: false,
42
- }),
43
- records: Flags.boolean({
44
- default: false,
45
- description: 'Include records in import',
46
- required: false,
47
- }),
48
- tenant: Flags.string({
49
- char: 't',
50
- description: 'Tenant name to push to',
51
- required: true,
52
- }),
53
- transaction: Flags.boolean({
54
- allowNo: true,
55
- default: true,
56
- description: 'Wrap import in a database transaction (use --no-transaction for debugging purposes)',
57
- required: false,
58
- }),
59
- truncate: Flags.boolean({
60
- default: false,
61
- description: 'Truncate all table records before importing',
62
- required: false,
63
- }),
64
- workspace: Flags.string({
65
- char: 'w',
66
- description: 'Workspace ID (optional if set in profile)',
67
- required: false,
68
- }),
69
- };
1
+ import { Command } from '@oclif/core';
2
+ export default class Push extends Command {
3
+ static description = 'Direct tenant push is not supported. Deploy through a release or use the sandbox (xano sandbox push).';
70
4
  async run() {
71
- const { args, flags } = await this.parse(Push);
72
- // Get profile name (default or from flag/env)
73
- const profileName = flags.profile || this.getDefaultProfile();
74
- // Load credentials
75
- const credentials = this.loadCredentials();
76
- // Get the profile configuration
77
- if (!(profileName in credentials.profiles)) {
78
- this.error(`Profile '${profileName}' not found. Available profiles: ${Object.keys(credentials.profiles).join(', ')}\n` +
79
- `Create a profile using 'xano profile:create'`);
80
- }
81
- const profile = credentials.profiles[profileName];
82
- // Validate required fields
83
- if (!profile.instance_origin) {
84
- this.error(`Profile '${profileName}' is missing instance_origin`);
85
- }
86
- if (!profile.access_token) {
87
- this.error(`Profile '${profileName}' is missing access_token`);
88
- }
89
- // Determine workspace_id from flag or profile
90
- let workspaceId;
91
- if (flags.workspace) {
92
- workspaceId = flags.workspace;
93
- }
94
- else if (profile.workspace) {
95
- workspaceId = profile.workspace;
96
- }
97
- else {
98
- this.error(`Workspace ID is required. Either:\n` +
99
- ` 1. Provide it as a flag: xano tenant push <directory> -t <tenant_name> -w <workspace_id>\n` +
100
- ` 2. Set it in your profile using: xano profile:edit ${profileName} -w <workspace_id>`);
101
- }
102
- const tenantName = flags.tenant;
103
- // Resolve the input directory
104
- const inputDir = path.resolve(args.directory);
105
- if (!fs.existsSync(inputDir)) {
106
- this.error(`Directory not found: ${inputDir}`);
107
- }
108
- if (!fs.statSync(inputDir).isDirectory()) {
109
- this.error(`Not a directory: ${inputDir}`);
110
- }
111
- // Collect all .xs files from the directory tree
112
- const files = this.collectFiles(inputDir);
113
- if (files.length === 0) {
114
- this.error(`No .xs files found in ${args.directory}`);
115
- }
116
- // Read each file and track file path alongside content
117
- const documentEntries = [];
118
- for (const filePath of files) {
119
- const content = fs.readFileSync(filePath, 'utf8').trim();
120
- if (content) {
121
- documentEntries.push({ content, filePath });
122
- }
123
- }
124
- if (documentEntries.length === 0) {
125
- this.error(`All .xs files in ${args.directory} are empty`);
126
- }
127
- const multidoc = documentEntries.map((d) => d.content).join('\n---\n');
128
- // Construct the API URL
129
- const queryParams = new URLSearchParams({
130
- env: flags.env.toString(),
131
- records: flags.records.toString(),
132
- transaction: flags.transaction.toString(),
133
- truncate: flags.truncate.toString(),
134
- });
135
- const apiUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}/tenant/${tenantName}/multidoc?${queryParams.toString()}`;
136
- // POST the multidoc to the API
137
- const requestHeaders = {
138
- accept: 'application/json',
139
- Authorization: `Bearer ${profile.access_token}`,
140
- 'Content-Type': 'text/x-xanoscript',
141
- };
142
- const startTime = Date.now();
143
- try {
144
- const response = await this.verboseFetch(apiUrl, {
145
- body: multidoc,
146
- headers: requestHeaders,
147
- method: 'POST',
148
- }, flags.verbose, profile.access_token);
149
- if (!response.ok) {
150
- const errorText = await response.text();
151
- let errorMessage = `Push failed (${response.status})`;
152
- try {
153
- const errorJson = JSON.parse(errorText);
154
- errorMessage += `: ${errorJson.message}`;
155
- if (errorJson.payload?.param) {
156
- errorMessage += `\n Parameter: ${errorJson.payload.param}`;
157
- }
158
- }
159
- catch {
160
- errorMessage += `\n${errorText}`;
161
- }
162
- // Surface local files involved in duplicate GUID errors
163
- const guidMatch = errorMessage.match(/Duplicate \w+ guid: (\S+)/);
164
- if (guidMatch) {
165
- const dupeFiles = findFilesWithGuid(documentEntries, guidMatch[1]);
166
- if (dupeFiles.length > 0) {
167
- const relPaths = dupeFiles.map((f) => path.relative(inputDir, f));
168
- errorMessage += `\n Local files with this GUID:\n${relPaths.map((f) => ` ${f}`).join('\n')}`;
169
- }
170
- }
171
- this.error(errorMessage);
172
- }
173
- // Parse the response (suppress raw output; only show in verbose mode)
174
- const responseText = await response.text();
175
- if (responseText && responseText !== 'null' && flags.verbose) {
176
- this.log(responseText);
177
- }
178
- }
179
- catch (error) {
180
- if (error instanceof Error) {
181
- this.error(`Failed to push multidoc: ${error.message}`);
182
- }
183
- else {
184
- this.error(`Failed to push multidoc: ${String(error)}`);
185
- }
186
- }
187
- const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
188
- this.log(`Pushed ${documentEntries.length} documents to tenant ${tenantName} from ${args.directory} in ${elapsed}s`);
189
- }
190
- /**
191
- * Recursively collect all .xs files from a directory, sorted by
192
- * type subdirectory name then filename for deterministic ordering.
193
- */
194
- collectFiles(dir) {
195
- const files = [];
196
- const entries = fs.readdirSync(dir, { withFileTypes: true });
197
- for (const entry of entries) {
198
- const fullPath = path.join(dir, entry.name);
199
- if (entry.isDirectory()) {
200
- files.push(...this.collectFiles(fullPath));
201
- }
202
- else if (entry.isFile() && entry.name.endsWith('.xs')) {
203
- files.push(fullPath);
204
- }
205
- }
206
- return files.sort();
207
- }
208
- loadCredentials() {
209
- const configDir = path.join(os.homedir(), '.xano');
210
- const credentialsPath = path.join(configDir, 'credentials.yaml');
211
- // Check if credentials file exists
212
- if (!fs.existsSync(credentialsPath)) {
213
- this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile:create'`);
214
- }
215
- // Read credentials file
216
- try {
217
- const fileContent = fs.readFileSync(credentialsPath, 'utf8');
218
- const parsed = yaml.load(fileContent);
219
- if (!parsed || typeof parsed !== 'object' || !('profiles' in parsed)) {
220
- this.error('Credentials file has invalid format.');
221
- }
222
- return parsed;
223
- }
224
- catch (error) {
225
- this.error(`Failed to parse credentials file: ${error}`);
226
- }
5
+ this.error('Direct tenant push is not supported.\n' +
6
+ 'To deploy changes, use one of the following:\n' +
7
+ ' - Create a release through the standard deployment workflow\n' +
8
+ ' - Use the sandbox: xano sandbox push <directory>');
227
9
  }
228
10
  }
@@ -8,6 +8,7 @@ export default class TenantUnitTestList extends BaseCommand {
8
8
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
9
  tenant: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
10
  workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
12
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
13
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
14
  };