@xano/cli 0.0.95-beta.15 → 0.0.95-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xano/cli",
3
3
  "description": "CLI for Xano's Metadata API",
4
- "version": "0.0.95-beta.15",
4
+ "version": "0.0.95-beta.16",
5
5
  "author": "Sean Montgomery",
6
6
  "bin": {
7
7
  "xano": "./bin/run.js"
@@ -1,19 +0,0 @@
1
- import BaseCommand from '../../../../base-command.js';
2
- export default class TenantWorkflowTestDelete extends BaseCommand {
3
- static args: {
4
- workflow_test_id: import("@oclif/core/interfaces").Arg<number, {
5
- max?: number;
6
- min?: number;
7
- }>;
8
- };
9
- static description: string;
10
- static examples: string[];
11
- static flags: {
12
- output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
- tenant: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
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
- run(): Promise<void>;
19
- }
@@ -1,85 +0,0 @@
1
- import { Args, Flags } from '@oclif/core';
2
- import BaseCommand from '../../../../base-command.js';
3
- export default class TenantWorkflowTestDelete extends BaseCommand {
4
- static args = {
5
- workflow_test_id: Args.integer({
6
- description: 'ID of the workflow test to delete',
7
- required: true,
8
- }),
9
- };
10
- static description = 'Delete a workflow test for a tenant';
11
- static examples = [
12
- `$ xano tenant workflow-test delete 42 -t my-tenant
13
- Deleted workflow test 42
14
- `,
15
- `$ xano tenant workflow-test delete 42 -t my-tenant -o json`,
16
- ];
17
- static flags = {
18
- ...BaseCommand.baseFlags,
19
- output: Flags.string({
20
- char: 'o',
21
- default: 'summary',
22
- description: 'Output format',
23
- options: ['summary', 'json'],
24
- required: false,
25
- }),
26
- tenant: Flags.string({
27
- char: 't',
28
- description: 'Tenant name',
29
- required: true,
30
- }),
31
- workspace: Flags.string({
32
- char: 'w',
33
- description: 'Workspace ID (uses profile workspace if not provided)',
34
- required: false,
35
- }),
36
- };
37
- async run() {
38
- const { args, flags } = await this.parse(TenantWorkflowTestDelete);
39
- const profileName = flags.profile || this.getDefaultProfile();
40
- const credentials = this.loadCredentialsFile();
41
- if (!credentials || !(profileName in credentials.profiles)) {
42
- this.error(`Profile '${profileName}' not found.\nCreate a profile using 'xano profile create'`);
43
- }
44
- const profile = credentials.profiles[profileName];
45
- if (!profile.instance_origin) {
46
- this.error(`Profile '${profileName}' is missing instance_origin`);
47
- }
48
- if (!profile.access_token) {
49
- this.error(`Profile '${profileName}' is missing access_token`);
50
- }
51
- const workspaceId = flags.workspace || profile.workspace;
52
- if (!workspaceId) {
53
- this.error('No workspace ID provided. Use --workspace flag or set one in your profile.');
54
- }
55
- const tenantName = encodeURIComponent(flags.tenant);
56
- const apiUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}/tenant/${tenantName}/workflow_test/${args.workflow_test_id}`;
57
- try {
58
- const response = await this.verboseFetch(apiUrl, {
59
- headers: {
60
- accept: 'application/json',
61
- Authorization: `Bearer ${profile.access_token}`,
62
- },
63
- method: 'DELETE',
64
- }, flags.verbose, profile.access_token);
65
- if (!response.ok) {
66
- const errorText = await response.text();
67
- this.error(`API request failed with status ${response.status}: ${response.statusText}\n${errorText}`);
68
- }
69
- if (flags.output === 'json') {
70
- this.log(JSON.stringify({ deleted: true, workflow_test_id: args.workflow_test_id }, null, 2));
71
- }
72
- else {
73
- this.log(`Deleted workflow test ${args.workflow_test_id}`);
74
- }
75
- }
76
- catch (error) {
77
- if (error instanceof Error) {
78
- this.error(`Failed to delete workflow test: ${error.message}`);
79
- }
80
- else {
81
- this.error(`Failed to delete workflow test: ${String(error)}`);
82
- }
83
- }
84
- }
85
- }