@xano/cli 0.0.25 → 0.0.26

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 +1 -3
  2. package/dist/base-command.js +5 -12
  3. package/dist/commands/function/create/index.d.ts +6 -7
  4. package/dist/commands/function/create/index.js +55 -55
  5. package/dist/commands/function/edit/index.d.ts +10 -11
  6. package/dist/commands/function/edit/index.js +162 -155
  7. package/dist/commands/function/get/index.d.ts +5 -6
  8. package/dist/commands/function/get/index.js +60 -55
  9. package/dist/commands/function/list/index.d.ts +5 -6
  10. package/dist/commands/function/list/index.js +52 -52
  11. package/dist/commands/profile/create/index.d.ts +6 -6
  12. package/dist/commands/profile/create/index.js +37 -37
  13. package/dist/commands/profile/delete/index.d.ts +2 -2
  14. package/dist/commands/profile/delete/index.js +9 -9
  15. package/dist/commands/profile/edit/index.d.ts +7 -8
  16. package/dist/commands/profile/edit/index.js +48 -48
  17. package/dist/commands/profile/get-default/index.js +1 -1
  18. package/dist/commands/profile/list/index.d.ts +2 -2
  19. package/dist/commands/profile/list/index.js +9 -9
  20. package/dist/commands/profile/me/index.d.ts +3 -4
  21. package/dist/commands/profile/me/index.js +21 -21
  22. package/dist/commands/profile/project/index.js +1 -1
  23. package/dist/commands/profile/set-default/index.js +1 -1
  24. package/dist/commands/profile/token/index.js +1 -1
  25. package/dist/commands/profile/wizard/index.d.ts +4 -5
  26. package/dist/commands/profile/wizard/index.js +108 -142
  27. package/dist/commands/run/env/delete/index.d.ts +2 -3
  28. package/dist/commands/run/env/delete/index.js +10 -10
  29. package/dist/commands/run/env/get/index.d.ts +2 -3
  30. package/dist/commands/run/env/get/index.js +11 -11
  31. package/dist/commands/run/env/list/index.d.ts +2 -3
  32. package/dist/commands/run/env/list/index.js +19 -17
  33. package/dist/commands/run/env/set/index.d.ts +2 -3
  34. package/dist/commands/run/env/set/index.js +5 -5
  35. package/dist/commands/run/exec/index.d.ts +8 -19
  36. package/dist/commands/run/exec/index.js +108 -186
  37. package/dist/commands/run/info/index.d.ts +4 -5
  38. package/dist/commands/run/info/index.js +27 -27
  39. package/dist/commands/run/projects/create/index.d.ts +3 -4
  40. package/dist/commands/run/projects/create/index.js +23 -23
  41. package/dist/commands/run/projects/delete/index.d.ts +2 -3
  42. package/dist/commands/run/projects/delete/index.js +10 -10
  43. package/dist/commands/run/projects/list/index.d.ts +2 -3
  44. package/dist/commands/run/projects/list/index.js +12 -12
  45. package/dist/commands/run/projects/update/index.d.ts +3 -4
  46. package/dist/commands/run/projects/update/index.js +21 -21
  47. package/dist/commands/run/secrets/delete/index.d.ts +2 -3
  48. package/dist/commands/run/secrets/delete/index.js +10 -10
  49. package/dist/commands/run/secrets/get/index.d.ts +2 -3
  50. package/dist/commands/run/secrets/get/index.js +11 -11
  51. package/dist/commands/run/secrets/list/index.d.ts +2 -3
  52. package/dist/commands/run/secrets/list/index.js +24 -22
  53. package/dist/commands/run/secrets/set/index.d.ts +3 -4
  54. package/dist/commands/run/secrets/set/index.js +16 -16
  55. package/dist/commands/run/sessions/delete/index.d.ts +2 -3
  56. package/dist/commands/run/sessions/delete/index.js +10 -10
  57. package/dist/commands/run/sessions/get/index.d.ts +2 -3
  58. package/dist/commands/run/sessions/get/index.js +11 -11
  59. package/dist/commands/run/sessions/list/index.d.ts +2 -3
  60. package/dist/commands/run/sessions/list/index.js +11 -11
  61. package/dist/commands/run/sessions/start/index.d.ts +2 -3
  62. package/dist/commands/run/sessions/start/index.js +11 -11
  63. package/dist/commands/run/sessions/stop/index.d.ts +2 -3
  64. package/dist/commands/run/sessions/stop/index.js +11 -11
  65. package/dist/commands/run/sink/get/index.d.ts +2 -3
  66. package/dist/commands/run/sink/get/index.js +11 -11
  67. package/dist/commands/static_host/build/create/index.d.ts +4 -5
  68. package/dist/commands/static_host/build/create/index.js +33 -33
  69. package/dist/commands/static_host/build/get/index.d.ts +4 -5
  70. package/dist/commands/static_host/build/get/index.js +20 -20
  71. package/dist/commands/static_host/build/list/index.d.ts +3 -4
  72. package/dist/commands/static_host/build/list/index.js +31 -31
  73. package/dist/commands/static_host/list/index.d.ts +3 -4
  74. package/dist/commands/static_host/list/index.js +31 -31
  75. package/dist/commands/workspace/list/index.d.ts +2 -3
  76. package/dist/commands/workspace/list/index.js +15 -15
  77. package/dist/commands/workspace/pull/index.d.ts +4 -5
  78. package/dist/commands/workspace/pull/index.js +52 -47
  79. package/dist/commands/workspace/push/index.d.ts +0 -1
  80. package/dist/commands/workspace/push/index.js +4 -4
  81. package/dist/help.d.ts +1 -1
  82. package/dist/lib/base-run-command.d.ts +6 -6
  83. package/dist/lib/base-run-command.js +6 -8
  84. package/dist/lib/run-http-client.d.ts +18 -24
  85. package/dist/lib/run-http-client.js +61 -96
  86. package/dist/lib/run-types.d.ts +80 -80
  87. package/oclif.manifest.json +849 -2027
  88. package/package.json +3 -1
  89. package/dist/commands/auth/index.d.ts +0 -21
  90. package/dist/commands/auth/index.js +0 -533
  91. package/dist/commands/branch/create/index.d.ts +0 -17
  92. package/dist/commands/branch/create/index.js +0 -164
  93. package/dist/commands/branch/delete/index.d.ts +0 -18
  94. package/dist/commands/branch/delete/index.js +0 -156
  95. package/dist/commands/branch/edit/index.d.ts +0 -19
  96. package/dist/commands/branch/edit/index.js +0 -166
  97. package/dist/commands/branch/get/index.d.ts +0 -16
  98. package/dist/commands/branch/get/index.js +0 -135
  99. package/dist/commands/branch/list/index.d.ts +0 -18
  100. package/dist/commands/branch/list/index.js +0 -138
  101. package/dist/commands/branch/set-live/index.d.ts +0 -18
  102. package/dist/commands/branch/set-live/index.js +0 -155
  103. package/dist/commands/workspace/create/index.d.ts +0 -14
  104. package/dist/commands/workspace/create/index.js +0 -131
  105. package/dist/commands/workspace/delete/index.d.ts +0 -20
  106. package/dist/commands/workspace/delete/index.js +0 -141
  107. package/dist/commands/workspace/edit/index.d.ts +0 -22
  108. package/dist/commands/workspace/edit/index.js +0 -176
  109. package/dist/commands/workspace/get/index.d.ts +0 -18
  110. package/dist/commands/workspace/get/index.js +0 -136
@@ -2,12 +2,10 @@ import { Command } from '@oclif/core';
2
2
  export default abstract class BaseCommand extends Command {
3
3
  static baseFlags: {
4
4
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
5
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
6
5
  };
7
6
  static flags: {
8
7
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
8
  };
11
- protected getDefaultProfile(): string;
12
9
  protected getProfile(): string | undefined;
10
+ protected getDefaultProfile(): string;
13
11
  }
@@ -1,8 +1,8 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
- import * as yaml from 'js-yaml';
3
2
  import * as fs from 'node:fs';
4
3
  import * as os from 'node:os';
5
4
  import * as path from 'node:path';
5
+ import * as yaml from 'js-yaml';
6
6
  export default class BaseCommand extends Command {
7
7
  static baseFlags = {
8
8
  profile: Flags.string({
@@ -11,16 +11,13 @@ export default class BaseCommand extends Command {
11
11
  env: 'XANO_PROFILE',
12
12
  required: false,
13
13
  }),
14
- verbose: Flags.boolean({
15
- char: 'v',
16
- default: false,
17
- description: 'Show detailed request/response information',
18
- env: 'XANO_VERBOSE',
19
- required: false,
20
- }),
21
14
  };
22
15
  // Override the flags property to include baseFlags
23
16
  static flags = BaseCommand.baseFlags;
17
+ // Helper method to get the profile flag value
18
+ getProfile() {
19
+ return this.flags?.profile;
20
+ }
24
21
  // Helper method to get the default profile from credentials file
25
22
  getDefaultProfile() {
26
23
  try {
@@ -40,8 +37,4 @@ export default class BaseCommand extends Command {
40
37
  return 'default';
41
38
  }
42
39
  }
43
- // Helper method to get the profile flag value
44
- getProfile() {
45
- return this.flags?.profile;
46
- }
47
40
  }
@@ -1,19 +1,18 @@
1
1
  import BaseCommand from '../../../base-command.js';
2
2
  export default class FunctionCreate extends BaseCommand {
3
3
  static args: {};
4
- static description: string;
5
- static examples: string[];
6
4
  static flags: {
7
- edit: import("@oclif/core/interfaces").BooleanFlag<boolean>;
5
+ workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
6
  file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
- output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
7
  stdin: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
- workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ edit: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
+ output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
10
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
11
  };
12
+ static description: string;
13
+ static examples: string[];
15
14
  run(): Promise<void>;
16
15
  private editFile;
17
- private loadCredentials;
18
16
  private readStdin;
17
+ private loadCredentials;
19
18
  }
@@ -1,12 +1,47 @@
1
1
  import { Flags } from '@oclif/core';
2
- import * as yaml from 'js-yaml';
3
2
  import { execSync } from 'node:child_process';
4
3
  import * as fs from 'node:fs';
5
4
  import * as os from 'node:os';
6
5
  import * as path from 'node:path';
6
+ import * as yaml from 'js-yaml';
7
7
  import BaseCommand from '../../../base-command.js';
8
8
  export default class FunctionCreate extends BaseCommand {
9
9
  static args = {};
10
+ static flags = {
11
+ ...BaseCommand.baseFlags,
12
+ workspace: Flags.string({
13
+ char: 'w',
14
+ description: 'Workspace ID (optional if set in profile)',
15
+ required: false,
16
+ }),
17
+ file: Flags.string({
18
+ char: 'f',
19
+ description: 'Path to file containing XanoScript code',
20
+ required: false,
21
+ exclusive: ['stdin'],
22
+ }),
23
+ stdin: Flags.boolean({
24
+ char: 's',
25
+ description: 'Read XanoScript code from stdin',
26
+ required: false,
27
+ default: false,
28
+ exclusive: ['file'],
29
+ }),
30
+ edit: Flags.boolean({
31
+ char: 'e',
32
+ description: 'Open file in editor before creating function (requires --file)',
33
+ required: false,
34
+ default: false,
35
+ dependsOn: ['file'],
36
+ }),
37
+ output: Flags.string({
38
+ char: 'o',
39
+ description: 'Output format',
40
+ required: false,
41
+ default: 'summary',
42
+ options: ['summary', 'json'],
43
+ }),
44
+ };
10
45
  static description = 'Create a new function in a workspace';
11
46
  static examples = [
12
47
  `$ xano function:create -w 40 -f function.xs
@@ -38,41 +73,6 @@ Name: my_function
38
73
  }
39
74
  `,
40
75
  ];
41
- static flags = {
42
- ...BaseCommand.baseFlags,
43
- edit: Flags.boolean({
44
- char: 'e',
45
- default: false,
46
- dependsOn: ['file'],
47
- description: 'Open file in editor before creating function (requires --file)',
48
- required: false,
49
- }),
50
- file: Flags.string({
51
- char: 'f',
52
- description: 'Path to file containing XanoScript code',
53
- exclusive: ['stdin'],
54
- required: false,
55
- }),
56
- output: Flags.string({
57
- char: 'o',
58
- default: 'summary',
59
- description: 'Output format',
60
- options: ['summary', 'json'],
61
- required: false,
62
- }),
63
- stdin: Flags.boolean({
64
- char: 's',
65
- default: false,
66
- description: 'Read XanoScript code from stdin',
67
- exclusive: ['file'],
68
- required: false,
69
- }),
70
- workspace: Flags.string({
71
- char: 'w',
72
- description: 'Workspace ID (optional if set in profile)',
73
- required: false,
74
- }),
75
- };
76
76
  async run() {
77
77
  const { flags } = await this.parse(FunctionCreate);
78
78
  // Get profile name (default or from flag/env)
@@ -154,13 +154,13 @@ Name: my_function
154
154
  // Create function via API
155
155
  try {
156
156
  const response = await fetch(apiUrl, {
157
- body: xanoscript,
157
+ method: 'POST',
158
158
  headers: {
159
159
  'accept': 'application/json',
160
- 'Authorization': `Bearer ${profile.access_token}`,
161
160
  'Content-Type': 'text/x-xanoscript',
161
+ 'Authorization': `Bearer ${profile.access_token}`,
162
162
  },
163
- method: 'POST',
163
+ body: xanoscript,
164
164
  });
165
165
  if (!response.ok) {
166
166
  const errorText = await response.text();
@@ -240,6 +240,22 @@ Name: my_function
240
240
  }
241
241
  return tmpFile;
242
242
  }
243
+ async readStdin() {
244
+ return new Promise((resolve, reject) => {
245
+ const chunks = [];
246
+ process.stdin.on('data', (chunk) => {
247
+ chunks.push(chunk);
248
+ });
249
+ process.stdin.on('end', () => {
250
+ resolve(Buffer.concat(chunks).toString('utf8'));
251
+ });
252
+ process.stdin.on('error', (error) => {
253
+ reject(error);
254
+ });
255
+ // Resume stdin if it was paused
256
+ process.stdin.resume();
257
+ });
258
+ }
243
259
  loadCredentials() {
244
260
  const configDir = path.join(os.homedir(), '.xano');
245
261
  const credentialsPath = path.join(configDir, 'credentials.yaml');
@@ -261,20 +277,4 @@ Name: my_function
261
277
  this.error(`Failed to parse credentials file: ${error}`);
262
278
  }
263
279
  }
264
- async readStdin() {
265
- return new Promise((resolve, reject) => {
266
- const chunks = [];
267
- process.stdin.on('data', (chunk) => {
268
- chunks.push(chunk);
269
- });
270
- process.stdin.on('end', () => {
271
- resolve(Buffer.concat(chunks).toString('utf8'));
272
- });
273
- process.stdin.on('error', (error) => {
274
- reject(error);
275
- });
276
- // Resume stdin if it was paused
277
- process.stdin.resume();
278
- });
279
- }
280
280
  }
@@ -3,23 +3,22 @@ export default class FunctionEdit extends BaseCommand {
3
3
  static args: {
4
4
  function_id: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
5
5
  };
6
- static description: string;
7
- static examples: string[];
8
6
  static flags: {
9
- edit: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
+ workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
8
  file: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
- output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
- publish: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
9
  stdin: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
- workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ edit: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
+ publish: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
+ output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
15
13
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
14
  };
15
+ static description: string;
16
+ static examples: string[];
18
17
  run(): Promise<void>;
19
- private editFile;
20
- private editFunctionContent;
21
18
  private fetchFunctionCode;
22
- private loadCredentials;
23
- private promptForFunctionId;
19
+ private editFunctionContent;
20
+ private editFile;
24
21
  private readStdin;
22
+ private promptForFunctionId;
23
+ private loadCredentials;
25
24
  }