@xano/cli 0.0.95-beta.2 → 0.0.95

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 (76) hide show
  1. package/README.md +2 -20
  2. package/dist/commands/tenant/create/index.d.ts +3 -1
  3. package/dist/commands/tenant/create/index.js +28 -6
  4. package/dist/commands/tenant/push/index.js +1 -1
  5. package/dist/help.d.ts +1 -2
  6. package/dist/help.js +1 -39
  7. package/oclif.manifest.json +2251 -5131
  8. package/package.json +1 -16
  9. package/dist/commands/ephemeral/access/index.d.ts +0 -15
  10. package/dist/commands/ephemeral/access/index.js +0 -78
  11. package/dist/commands/ephemeral/create/index.d.ts +0 -17
  12. package/dist/commands/ephemeral/create/index.js +0 -102
  13. package/dist/commands/ephemeral/delete/index.d.ts +0 -16
  14. package/dist/commands/ephemeral/delete/index.js +0 -99
  15. package/dist/commands/ephemeral/env/delete/index.d.ts +0 -17
  16. package/dist/commands/ephemeral/env/delete/index.js +0 -105
  17. package/dist/commands/ephemeral/env/get/index.d.ts +0 -15
  18. package/dist/commands/ephemeral/env/get/index.js +0 -81
  19. package/dist/commands/ephemeral/env/get_all/index.d.ts +0 -16
  20. package/dist/commands/ephemeral/env/get_all/index.js +0 -94
  21. package/dist/commands/ephemeral/env/list/index.d.ts +0 -14
  22. package/dist/commands/ephemeral/env/list/index.js +0 -83
  23. package/dist/commands/ephemeral/env/set/index.d.ts +0 -16
  24. package/dist/commands/ephemeral/env/set/index.js +0 -90
  25. package/dist/commands/ephemeral/env/set_all/index.d.ts +0 -16
  26. package/dist/commands/ephemeral/env/set_all/index.js +0 -102
  27. package/dist/commands/ephemeral/get/index.d.ts +0 -14
  28. package/dist/commands/ephemeral/get/index.js +0 -102
  29. package/dist/commands/ephemeral/impersonate/index.d.ts +0 -16
  30. package/dist/commands/ephemeral/impersonate/index.js +0 -110
  31. package/dist/commands/ephemeral/license/get/index.d.ts +0 -16
  32. package/dist/commands/ephemeral/license/get/index.js +0 -94
  33. package/dist/commands/ephemeral/license/set/index.d.ts +0 -17
  34. package/dist/commands/ephemeral/license/set/index.js +0 -111
  35. package/dist/commands/ephemeral/list/index.d.ts +0 -15
  36. package/dist/commands/ephemeral/list/index.js +0 -109
  37. package/dist/commands/ephemeral/pull/index.d.ts +0 -18
  38. package/dist/commands/ephemeral/pull/index.js +0 -197
  39. package/dist/commands/ephemeral/push/index.d.ts +0 -19
  40. package/dist/commands/ephemeral/push/index.js +0 -158
  41. package/dist/commands/ephemeral/shared/index.d.ts +0 -15
  42. package/dist/commands/ephemeral/shared/index.js +0 -108
  43. package/dist/commands/ephemeral/unit_test/list/index.d.ts +0 -14
  44. package/dist/commands/ephemeral/unit_test/list/index.js +0 -105
  45. package/dist/commands/ephemeral/unit_test/run/index.d.ts +0 -15
  46. package/dist/commands/ephemeral/unit_test/run/index.js +0 -93
  47. package/dist/commands/ephemeral/unit_test/run_all/index.d.ts +0 -14
  48. package/dist/commands/ephemeral/unit_test/run_all/index.js +0 -183
  49. package/dist/commands/ephemeral/workflow_test/delete/index.d.ts +0 -18
  50. package/dist/commands/ephemeral/workflow_test/delete/index.js +0 -75
  51. package/dist/commands/ephemeral/workflow_test/get/index.d.ts +0 -18
  52. package/dist/commands/ephemeral/workflow_test/get/index.js +0 -77
  53. package/dist/commands/ephemeral/workflow_test/list/index.d.ts +0 -13
  54. package/dist/commands/ephemeral/workflow_test/list/index.js +0 -98
  55. package/dist/commands/ephemeral/workflow_test/run/index.d.ts +0 -18
  56. package/dist/commands/ephemeral/workflow_test/run/index.js +0 -91
  57. package/dist/commands/ephemeral/workflow_test/run_all/index.d.ts +0 -13
  58. package/dist/commands/ephemeral/workflow_test/run_all/index.js +0 -169
  59. package/dist/commands/release/deploy/index.d.ts +0 -17
  60. package/dist/commands/release/deploy/index.js +0 -107
  61. package/dist/commands/tenant/unit_test/list/index.d.ts +0 -15
  62. package/dist/commands/tenant/unit_test/list/index.js +0 -140
  63. package/dist/commands/tenant/unit_test/run/index.d.ts +0 -16
  64. package/dist/commands/tenant/unit_test/run/index.js +0 -128
  65. package/dist/commands/tenant/unit_test/run_all/index.d.ts +0 -15
  66. package/dist/commands/tenant/unit_test/run_all/index.js +0 -215
  67. package/dist/commands/tenant/workflow_test/delete/index.d.ts +0 -19
  68. package/dist/commands/tenant/workflow_test/delete/index.js +0 -110
  69. package/dist/commands/tenant/workflow_test/get/index.d.ts +0 -19
  70. package/dist/commands/tenant/workflow_test/get/index.js +0 -112
  71. package/dist/commands/tenant/workflow_test/list/index.d.ts +0 -14
  72. package/dist/commands/tenant/workflow_test/list/index.js +0 -133
  73. package/dist/commands/tenant/workflow_test/run/index.d.ts +0 -19
  74. package/dist/commands/tenant/workflow_test/run/index.js +0 -126
  75. package/dist/commands/tenant/workflow_test/run_all/index.d.ts +0 -14
  76. package/dist/commands/tenant/workflow_test/run_all/index.js +0 -201
package/README.md CHANGED
@@ -235,11 +235,6 @@ xano release pull ./my-release -r v1.0 --env --records
235
235
  xano release push ./my-release -n "v2.0"
236
236
  xano release push ./my-release -n "v2.0" --hotfix -d "Critical fix"
237
237
  xano release push ./my-release -n "v2.0" --no-records --no-env
238
-
239
- # Deploy a release to its workspace as a new branch
240
- xano release deploy "v1.0"
241
- xano release deploy "v1.0" --branch "restore-v1" --no-set_live
242
- xano release deploy "v1.0" -w 40 -o json
243
238
  ```
244
239
 
245
240
  ### Platforms
@@ -307,7 +302,8 @@ xano tenant get <tenant_name>
307
302
 
308
303
  # Create a tenant
309
304
  xano tenant create "My Tenant"
310
- xano tenant create "My Tenant" -d "Description" --cluster_id 1 --platform_id 5
305
+ xano tenant create "My Tenant" -d "Description" --type tier2 --cluster_id 1 --platform_id 5
306
+ xano tenant create "My Tenant" --type tier2 --cluster_id 1 --license ./license.yaml
311
307
 
312
308
  # Edit a tenant
313
309
  xano tenant edit <tenant_name> --display "New Name" -d "New description"
@@ -445,20 +441,6 @@ xano tenant cluster license set <cluster_id>
445
441
  xano tenant cluster license set <cluster_id> --file ./kubeconfig.yaml
446
442
  ```
447
443
 
448
- ### Ephemeral
449
-
450
- Manage ephemeral tenants. Ephemeral tenants are workspace-agnostic (tier1 only) and do not run background tasks.
451
-
452
- ```bash
453
- # Create an ephemeral tenant
454
- xano ephemeral create "My Ephemeral"
455
- xano ephemeral create "CI Tenant" -d "For CI/CD" -o json
456
-
457
- # Get ephemeral tenant details
458
- xano ephemeral get <tenant_name>
459
- xano ephemeral get <tenant_name> -o json
460
- ```
461
-
462
444
  ### Static Hosts
463
445
 
464
446
  ```bash
@@ -9,10 +9,12 @@ export default class TenantCreate extends BaseCommand {
9
9
  cluster_id: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
10
  description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
11
  domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ ephemeral: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
13
  ingress: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
- license: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
14
+ license: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
15
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
15
16
  platform_id: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ type: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
16
18
  tasks: import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
19
  workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
20
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -16,7 +16,8 @@ export default class TenantCreate extends BaseCommand {
16
16
  `$ xano tenant create "Production"
17
17
  Created tenant: Production (production) - ID: 42
18
18
  `,
19
- `$ xano tenant create "Staging" --description "Staging env" --cluster_id 1 --platform_id 1 --license tier2 -o json`,
19
+ `$ xano tenant create "Staging" --description "Staging env" --cluster_id 1 --platform_id 1 --type tier2 -o json`,
20
+ `$ xano tenant create "Staging" --type tier2 --cluster_id 1 --license ./license.yaml`,
20
21
  ];
21
22
  static flags = {
22
23
  ...BaseCommand.baseFlags,
@@ -33,15 +34,18 @@ Created tenant: Production (production) - ID: 42
33
34
  description: 'Custom domain for the tenant',
34
35
  required: false,
35
36
  }),
37
+ ephemeral: Flags.boolean({
38
+ default: false,
39
+ description: 'Mark tenant as ephemeral (allows push operations)',
40
+ }),
36
41
  ingress: Flags.boolean({
37
42
  allowNo: true,
38
43
  default: true,
39
44
  description: 'Enable ingress',
40
45
  }),
41
46
  license: Flags.string({
42
- default: 'tier1',
43
- description: 'License tier',
44
- options: ['tier1', 'tier2', 'tier3'],
47
+ char: 'l',
48
+ description: 'Path to a license override file to apply during creation',
45
49
  required: false,
46
50
  }),
47
51
  output: Flags.string({
@@ -55,6 +59,12 @@ Created tenant: Production (production) - ID: 42
55
59
  description: 'Platform ID to use',
56
60
  required: false,
57
61
  }),
62
+ type: Flags.string({
63
+ default: 'tier1',
64
+ description: 'Tenant type',
65
+ options: ['tier1', 'tier2', 'tier3'],
66
+ required: false,
67
+ }),
58
68
  tasks: Flags.boolean({
59
69
  allowNo: true,
60
70
  default: true,
@@ -87,8 +97,9 @@ Created tenant: Production (production) - ID: 42
87
97
  }
88
98
  const body = {
89
99
  display: args.display,
100
+ ephemeral: flags.ephemeral,
90
101
  ingress: flags.ingress,
91
- license: flags.license,
102
+ license: flags.type,
92
103
  tag: [],
93
104
  tasks: flags.tasks,
94
105
  };
@@ -102,7 +113,16 @@ Created tenant: Production (production) - ID: 42
102
113
  body.platform_id = flags.platform_id;
103
114
  if (flags.domain)
104
115
  body.domain = flags.domain;
105
- if (flags.license === 'tier2' || flags.license === 'tier3' || flags.cluster_id) {
116
+ if (flags.license) {
117
+ const licensePath = path.resolve(flags.license);
118
+ if (!fs.existsSync(licensePath)) {
119
+ this.error(`License file not found: ${licensePath}`);
120
+ }
121
+ const licenseContent = fs.readFileSync(licensePath, 'utf8');
122
+ body.license_overrides = yaml.load(licenseContent);
123
+ }
124
+ const effectiveType = flags.cluster_id ? 'tier3' : flags.type;
125
+ if (effectiveType === 'tier2' || effectiveType === 'tier3') {
106
126
  this.warn('This may take a few minutes. Please be patient.');
107
127
  }
108
128
  const apiUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}/tenant`;
@@ -129,6 +149,8 @@ Created tenant: Production (production) - ID: 42
129
149
  if (tenant.state) {
130
150
  this.log(` State: ${tenant.state}`);
131
151
  }
152
+ if (flags.license)
153
+ this.log(` License: applied`);
132
154
  }
133
155
  }
134
156
  catch (error) {
@@ -117,7 +117,7 @@ Truncate all table records before importing
117
117
  const tenantData = (await tenantResponse.json());
118
118
  if (!tenantData.ephemeral) {
119
119
  this.error(`Tenant '${tenantName}' is not ephemeral. Push is only allowed for ephemeral tenants.\n` +
120
- `Create an ephemeral tenant with: xano ephemeral create "name"`);
120
+ `Create an ephemeral tenant with: xano tenant create "name" --ephemeral`);
121
121
  }
122
122
  }
123
123
  catch (error) {
package/dist/help.d.ts CHANGED
@@ -12,10 +12,9 @@ declare class CustomCommandHelp extends BaseCommandHelp {
12
12
  protected flagHelpLabel(flag: Command.Flag.Any, showOptions?: boolean): string;
13
13
  }
14
14
  /**
15
- * Custom Help class that injects promoted commands into the COMMANDS list
15
+ * Custom Help class that uses CustomCommandHelp
16
16
  */
17
17
  export default class Help extends BaseHelp {
18
18
  protected CommandHelpClass: typeof CustomCommandHelp;
19
- formatCommands(commands: Command.Loadable[]): string;
20
19
  }
21
20
  export {};
package/dist/help.js CHANGED
@@ -1,15 +1,5 @@
1
1
  import { Help as BaseHelp } from '@oclif/core';
2
2
  import { CommandHelp as BaseCommandHelp } from '@oclif/core/help';
3
- /**
4
- * Extra commands to include in the top-level COMMANDS list.
5
- * These are nested commands promoted for discoverability.
6
- */
7
- const PROMOTED_COMMANDS = [
8
- { description: 'Create a new workspace', label: 'workspace create' },
9
- { description: 'List workspaces', label: 'workspace list' },
10
- { description: 'Pull a workspace to local files', label: 'workspace pull' },
11
- { description: 'Push local documents to a workspace', label: 'workspace push' },
12
- ];
13
3
  /**
14
4
  * Custom CommandHelp class that extends the default to display environment variables
15
5
  * alongside flag descriptions
@@ -29,36 +19,8 @@ class CustomCommandHelp extends BaseCommandHelp {
29
19
  }
30
20
  }
31
21
  /**
32
- * Custom Help class that injects promoted commands into the COMMANDS list
22
+ * Custom Help class that uses CustomCommandHelp
33
23
  */
34
24
  export default class Help extends BaseHelp {
35
25
  CommandHelpClass = CustomCommandHelp;
36
- formatCommands(commands) {
37
- if (commands.length === 0 && PROMOTED_COMMANDS.length === 0)
38
- return '';
39
- // Check before IDs are mutated: root help has top-level commands (no colons)
40
- const isRootHelp = commands.some((c) => !c.id.includes(':'));
41
- const entries = commands
42
- .filter((c) => (this.opts.hideAliasesFromRoot ? !c.aliases?.includes(c.id) : true))
43
- .filter((c) => c.id !== 'plugins')
44
- .map((c) => {
45
- if (this.config.topicSeparator !== ':')
46
- c.id = c.id.replaceAll(':', this.config.topicSeparator);
47
- const summary = this.summary(c);
48
- return [c.id, summary ? summary.replace(/\u001B\[\d+m/g, '') : ''];
49
- });
50
- // Only add promoted commands at the root level, not within a specific topic
51
- if (isRootHelp) {
52
- for (const promoted of PROMOTED_COMMANDS) {
53
- entries.push([promoted.label, promoted.description]);
54
- }
55
- }
56
- entries.sort((a, b) => a[0].localeCompare(b[0]));
57
- const body = this.renderList(entries, {
58
- indentation: 2,
59
- spacer: '\n',
60
- stripAnsi: this.opts.stripAnsi,
61
- });
62
- return this.section('COMMANDS', body + `\n\n\x1b[2mSee xano <topic> --help for all commands in a topic.\x1b[0m`);
63
- }
64
26
  }