@xano/cli 1.0.4 → 1.0.5

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 (65) hide show
  1. package/README.md +107 -4
  2. package/dist/base-command.d.ts +27 -0
  3. package/dist/base-command.js +124 -1
  4. package/dist/commands/auth/index.d.ts +45 -1
  5. package/dist/commands/auth/index.js +197 -29
  6. package/dist/commands/function/run/index.d.ts +40 -0
  7. package/dist/commands/function/run/index.js +244 -0
  8. package/dist/commands/knowledge/{pull → get}/index.d.ts +6 -2
  9. package/dist/commands/knowledge/get/index.js +126 -0
  10. package/dist/commands/knowledge/{push → list}/index.d.ts +6 -8
  11. package/dist/commands/knowledge/list/index.js +135 -0
  12. package/dist/commands/sandbox/pull/index.js +12 -2
  13. package/dist/commands/sandbox/push/index.d.ts +1 -1
  14. package/dist/commands/sandbox/push/index.js +19 -14
  15. package/dist/commands/sandbox/reset/index.js +12 -0
  16. package/dist/commands/static_host/build/create/index.d.ts +9 -1
  17. package/dist/commands/static_host/build/create/index.js +54 -4
  18. package/dist/commands/static_host/build/delete/index.d.ts +19 -0
  19. package/dist/commands/static_host/build/delete/index.js +114 -0
  20. package/dist/commands/static_host/build/get/index.d.ts +1 -1
  21. package/dist/commands/static_host/build/get/index.js +16 -10
  22. package/dist/commands/static_host/build/pull/index.d.ts +52 -0
  23. package/dist/commands/static_host/build/pull/index.js +300 -0
  24. package/dist/commands/static_host/build/push/index.d.ts +23 -0
  25. package/dist/commands/static_host/build/push/index.js +228 -0
  26. package/dist/commands/static_host/create/index.d.ts +17 -0
  27. package/dist/commands/static_host/create/index.js +86 -0
  28. package/dist/commands/static_host/deploy/index.d.ts +18 -0
  29. package/dist/commands/static_host/deploy/index.js +105 -0
  30. package/dist/commands/static_host/edit/index.d.ts +23 -0
  31. package/dist/commands/static_host/edit/index.js +151 -0
  32. package/dist/commands/static_host/get/index.d.ts +18 -0
  33. package/dist/commands/static_host/get/index.js +94 -0
  34. package/dist/commands/static_host/migrate/index.d.ts +44 -0
  35. package/dist/commands/static_host/migrate/index.js +205 -0
  36. package/dist/commands/tenant/snapshot/create/index.d.ts +17 -0
  37. package/dist/commands/tenant/snapshot/create/index.js +78 -0
  38. package/dist/commands/tenant/snapshot/delete/index.d.ts +19 -0
  39. package/dist/commands/tenant/snapshot/delete/index.js +102 -0
  40. package/dist/commands/tenant/snapshot/list/index.d.ts +16 -0
  41. package/dist/commands/tenant/snapshot/list/index.js +96 -0
  42. package/dist/commands/tenant/snapshot/swap/index.d.ts +19 -0
  43. package/dist/commands/tenant/snapshot/swap/index.js +103 -0
  44. package/dist/commands/tenant/unit_test/run/index.d.ts +1 -0
  45. package/dist/commands/tenant/unit_test/run/index.js +7 -0
  46. package/dist/commands/tenant/unit_test/run_all/index.js +7 -3
  47. package/dist/commands/unit_test/run/index.d.ts +1 -0
  48. package/dist/commands/unit_test/run/index.js +8 -0
  49. package/dist/commands/unit_test/run_all/index.js +7 -3
  50. package/dist/commands/workspace/pull/index.js +13 -2
  51. package/dist/commands/workspace/push/index.d.ts +1 -1
  52. package/dist/commands/workspace/push/index.js +15 -5
  53. package/dist/utils/function-input.d.ts +77 -0
  54. package/dist/utils/function-input.js +148 -0
  55. package/dist/utils/knowledge-sync.d.ts +84 -79
  56. package/dist/utils/knowledge-sync.js +376 -323
  57. package/dist/utils/multidoc-push.d.ts +30 -18
  58. package/dist/utils/multidoc-push.js +284 -148
  59. package/dist/utils/reference-checker.js +2 -2
  60. package/dist/utils/static-host-files.d.ts +21 -0
  61. package/dist/utils/static-host-files.js +41 -0
  62. package/oclif.manifest.json +4574 -3045
  63. package/package.json +7 -1
  64. package/dist/commands/knowledge/pull/index.js +0 -86
  65. package/dist/commands/knowledge/push/index.js +0 -126
@@ -170,8 +170,8 @@ export function checkTableIndexes(documents) {
170
170
  return badIndexes;
171
171
  }
172
172
  function extractSchemaFields(content) {
173
- // id and created_at are auto-added during import
174
- const fields = new Set(['id', 'created_at']);
173
+ // id, created_at, and xdo are system fields not declared in the schema
174
+ const fields = new Set(['id', 'created_at', 'xdo']);
175
175
  // Find the schema block by matching braces
176
176
  const schemaStart = content.match(/\bschema\s*\{/);
177
177
  if (!schemaStart || schemaStart.index === undefined)
@@ -0,0 +1,21 @@
1
+ export interface CollectStaticHostFilesOptions {
2
+ /**
3
+ * When true, skip files matched by the source directory's `.gitignore`.
4
+ * The `.git/` folder is always excluded regardless of this setting.
5
+ */
6
+ respectGitignore: boolean;
7
+ }
8
+ /**
9
+ * Collect the files to upload for a static-host build, as POSIX-relative paths
10
+ * (sorted, for a deterministic archive).
11
+ *
12
+ * Honours the `.gitignore` at the root of `sourceDir` when `respectGitignore` is
13
+ * set, and always excludes the `.git/` directory — it is repo metadata, never
14
+ * deployable output.
15
+ *
16
+ * Directory rules in `.gitignore` carry a trailing slash (e.g. `node_modules/`),
17
+ * and the `ignore` package only matches those when the tested path also ends in a
18
+ * slash — so directories are tested as `${rel}/` (which also lets us prune the
19
+ * whole subtree) while files are tested as-is.
20
+ */
21
+ export declare function collectStaticHostFiles(sourceDir: string, options: CollectStaticHostFilesOptions): string[];
@@ -0,0 +1,41 @@
1
+ import ignore from 'ignore';
2
+ import * as fs from 'node:fs';
3
+ import { join, relative, sep } from 'node:path';
4
+ /**
5
+ * Collect the files to upload for a static-host build, as POSIX-relative paths
6
+ * (sorted, for a deterministic archive).
7
+ *
8
+ * Honours the `.gitignore` at the root of `sourceDir` when `respectGitignore` is
9
+ * set, and always excludes the `.git/` directory — it is repo metadata, never
10
+ * deployable output.
11
+ *
12
+ * Directory rules in `.gitignore` carry a trailing slash (e.g. `node_modules/`),
13
+ * and the `ignore` package only matches those when the tested path also ends in a
14
+ * slash — so directories are tested as `${rel}/` (which also lets us prune the
15
+ * whole subtree) while files are tested as-is.
16
+ */
17
+ export function collectStaticHostFiles(sourceDir, options) {
18
+ const ig = ignore().add('.git');
19
+ if (options.respectGitignore) {
20
+ const gitignorePath = join(sourceDir, '.gitignore');
21
+ if (fs.existsSync(gitignorePath)) {
22
+ ig.add(fs.readFileSync(gitignorePath, 'utf8'));
23
+ }
24
+ }
25
+ const files = [];
26
+ const walk = (dir) => {
27
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
28
+ const abs = join(dir, entry.name);
29
+ const rel = relative(sourceDir, abs).split(sep).join('/');
30
+ if (entry.isDirectory()) {
31
+ if (!ig.ignores(`${rel}/`))
32
+ walk(abs);
33
+ }
34
+ else if (entry.isFile() && !ig.ignores(rel)) {
35
+ files.push(rel);
36
+ }
37
+ }
38
+ };
39
+ walk(sourceDir);
40
+ return files.sort();
41
+ }