@xanots/sdk 0.0.7 → 0.0.9

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 (42) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/.build-fingerprint +1 -1
  3. package/dist/bin.js +4 -4
  4. package/dist/{chunk-JAVB27HL.js → chunk-5YQOIFT4.js} +2 -2
  5. package/dist/{chunk-DBHE35JM.js → chunk-6Z5CNWFC.js} +2 -2
  6. package/dist/{chunk-JUHKEAHJ.js → chunk-7OXFMCTX.js} +3 -3
  7. package/dist/{chunk-CL2H2WYE.js → chunk-K3YSQDXJ.js} +32 -18
  8. package/dist/{chunk-7BUTRVKA.js → chunk-KSV7VOEX.js} +2 -2
  9. package/dist/{chunk-5PDOAR77.js → chunk-L6TPHWAU.js} +7 -7
  10. package/dist/{chunk-FDKR4YMN.js → chunk-OW2QZEWL.js} +2 -2
  11. package/dist/{chunk-NJGNUVXR.js → chunk-QONOJO45.js} +43 -5
  12. package/dist/{chunk-FAWNUE2U.js → chunk-UDL46O35.js} +28 -5
  13. package/dist/{chunk-H2DEDWQF.js → chunk-YNZFIY4J.js} +2 -2
  14. package/dist/{chunk-2V3JUXTF.js → chunk-ZZLPTHT5.js} +2 -2
  15. package/dist/cli.js +3 -3
  16. package/dist/{codegen-command-DYH4H4TD.js → codegen-command-YSCSCVT5.js} +8 -8
  17. package/dist/{deploy-command-HM57BINV.js → deploy-command-5TTI4TUP.js} +9 -9
  18. package/dist/{env-target-WA3BH5YU.js → env-target-4T7AT347.js} +2 -2
  19. package/dist/{ephemeral-command-SD2KLX4P.js → ephemeral-command-7TK52YQM.js} +2 -2
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.js +5 -5
  22. package/dist/{init-command-VIPWAQYS.js → init-command-OVFFW4QS.js} +5 -5
  23. package/dist/internal.d.ts +2 -2
  24. package/dist/internal.js +21 -14
  25. package/dist/{lock-commands-7VJKAXV6.js → lock-commands-ET7NIOLH.js} +4 -4
  26. package/dist/node.d.ts +2 -2
  27. package/dist/node.js +6 -6
  28. package/dist/{release-command-3IET7YII.js → release-command-4EXVLYV2.js} +7 -7
  29. package/dist/{store-DfuWu1tE.d.ts → store-CUCBSYLj.d.ts} +7 -3
  30. package/dist/{test-command-S7SMRWMP.js → test-command-2F5LKMI6.js} +3 -3
  31. package/dist/{upgrade-command-TZYSGXP7.js → upgrade-command-QL523I62.js} +5 -5
  32. package/dist/{validate-command-MMXEVHH3.js → validate-command-SK5FPCV7.js} +5 -5
  33. package/dist/{workspace-command-X6L7HTXO.js → workspace-command-HYA6JEKK.js} +8 -8
  34. package/guides/authoring.md +9 -1
  35. package/llms/fields.md +6 -4
  36. package/llms/statements-calls.md +2 -1
  37. package/llms/statements-data.md +5 -2
  38. package/llms/tests.md +2 -1
  39. package/llms-full.txt +20 -13
  40. package/llms.txt +5 -5
  41. package/manifest.json +1 -1
  42. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -11,6 +11,33 @@ listed here.
11
11
 
12
12
  ---
13
13
 
14
+ ## 0.0.8 — The auth() lookalike
15
+
16
+ _2026-08-30_ · [release notes](https://github.com/xanots/sdk/releases/tag/v0.0.8)
17
+
18
+ `ref("auth.id")` looks like it reads the authenticated caller. It does not, and the engine's error for it — `Missing var entry: auth` — pointed nowhere useful. That spelling, and every other reserved namespace read as if it were a stack variable, now fails the export with the accessor that works. The same mistake was shipped in our own file-upload recipe, which is corrected.
19
+
20
+ - ⚠️ `ref()` on an engine-reserved namespace now fails the export
21
+ - The file-upload recipe read the input bag the wrong way
22
+ - The unbound-variable warning now quotes the error you actually get
23
+
24
+ ---
25
+
26
+ ## 0.0.7 — Verb pairs on one path
27
+
28
+ _2026-08-29_ · [release notes](https://github.com/xanots/sdk/releases/tag/v0.0.7)
29
+
30
+ Queries are now identified the way the engine identifies them — by api group, verb, and name together — so `GET /items` and `POST /items` are two endpoints instead of one export error. The grounding docs an AI agent reads got a full pass for people arriving at Xano for the first time, and two silent-failure classes now surface at `export()` instead of on a live endpoint.
31
+
32
+ - A `GET` and `POST` on the same path no longer collide
33
+ - ⚠️ A query's verb and api group are now part of its identity
34
+ - ⚠️ `s.api.call` takes the query handle, not a bare name
35
+ - A tagged value in a template literal now fails the build instead of shipping garbage
36
+ - The grounding docs assume no prior Xano knowledge
37
+ - `xanots deploy` no longer loops on "re-run the deploy" when your session has expired
38
+
39
+ ---
40
+
14
41
  ## 0.0.6 — The action identity fix
15
42
 
16
43
  _2026-08-28_ · [release notes](https://github.com/xanots/sdk/releases/tag/v0.0.6)
@@ -1 +1 @@
1
- 12b76c8975e939f33a9312372b45a4090256a351870c259c08c96691cbda54af
1
+ 6be27443d5fbd10d871e0401f52565ed89d47edcc49810206bbf1efb9497f539
package/dist/bin.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  maybeNotifyUpdate
4
- } from "./chunk-FDKR4YMN.js";
4
+ } from "./chunk-OW2QZEWL.js";
5
5
  import {
6
6
  readVersion,
7
7
  run
8
- } from "./chunk-CL2H2WYE.js";
8
+ } from "./chunk-K3YSQDXJ.js";
9
9
  import {
10
10
  exitCodeOf,
11
11
  reportFailure
@@ -16,9 +16,9 @@ import {
16
16
  clearProgress,
17
17
  error
18
18
  } from "./chunk-EZG76F7R.js";
19
- import "./chunk-FAWNUE2U.js";
19
+ import "./chunk-UDL46O35.js";
20
20
  import "./chunk-OKNSR7MT.js";
21
- import "./chunk-NJGNUVXR.js";
21
+ import "./chunk-QONOJO45.js";
22
22
  import "./chunk-WHOJWOSV.js";
23
23
  import "./chunk-5XZ744TS.js";
24
24
  import "./chunk-7JDT4PBU.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  c,
3
3
  resp
4
- } from "./chunk-NJGNUVXR.js";
4
+ } from "./chunk-QONOJO45.js";
5
5
 
6
6
  // src/values/expect.ts
7
7
  var TEST_EXPECT_TYPES = [
@@ -90,4 +90,4 @@ export {
90
90
  TEST_EXPECT_TYPES,
91
91
  expect
92
92
  };
93
- //# sourceMappingURL=chunk-JAVB27HL.js.map
93
+ //# sourceMappingURL=chunk-5YQOIFT4.js.map
@@ -41,7 +41,7 @@ import {
41
41
  } from "./chunk-Q77KNEUL.js";
42
42
  import {
43
43
  readVersion
44
- } from "./chunk-CL2H2WYE.js";
44
+ } from "./chunk-K3YSQDXJ.js";
45
45
  import {
46
46
  UsageError
47
47
  } from "./chunk-JQLR64UC.js";
@@ -470,4 +470,4 @@ export {
470
470
  projectShellFiles,
471
471
  runInitCommand
472
472
  };
473
- //# sourceMappingURL=chunk-DBHE35JM.js.map
473
+ //# sourceMappingURL=chunk-6Z5CNWFC.js.map
@@ -6,7 +6,7 @@ import {
6
6
  realtimeChannelGuid,
7
7
  realtimeServerRefName,
8
8
  resolveRealtimeServerRef
9
- } from "./chunk-2V3JUXTF.js";
9
+ } from "./chunk-ZZLPTHT5.js";
10
10
  import {
11
11
  assertCanonical,
12
12
  assertOneOf,
@@ -25,7 +25,7 @@ import {
25
25
  resolveAuthRef,
26
26
  resolveMockKeys,
27
27
  warnLiveDatasource
28
- } from "./chunk-NJGNUVXR.js";
28
+ } from "./chunk-QONOJO45.js";
29
29
  import {
30
30
  encodeStatement
31
31
  } from "./chunk-5XZ744TS.js";
@@ -667,4 +667,4 @@ export {
667
667
  addonKind,
668
668
  addon
669
669
  };
670
- //# sourceMappingURL=chunk-JUHKEAHJ.js.map
670
+ //# sourceMappingURL=chunk-7OXFMCTX.js.map
@@ -24,7 +24,7 @@ import {
24
24
  Xano,
25
25
  assertSeedIds,
26
26
  coerceSeedRowValues
27
- } from "./chunk-FAWNUE2U.js";
27
+ } from "./chunk-UDL46O35.js";
28
28
  import {
29
29
  getCommand,
30
30
  getSubcommand,
@@ -44,7 +44,7 @@ import {
44
44
  pathSegment,
45
45
  serializeBundle,
46
46
  tableColumns
47
- } from "./chunk-NJGNUVXR.js";
47
+ } from "./chunk-QONOJO45.js";
48
48
  import {
49
49
  WORKSPACE_KEY,
50
50
  createLockContext,
@@ -61,7 +61,7 @@ import {
61
61
  // src/emit/cli.ts
62
62
  import { pathToFileURL as pathToFileURL3, fileURLToPath as fileURLToPath3 } from "url";
63
63
  import { existsSync, readdirSync as readdirSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
64
- import { basename, dirname, join as join2, relative as relative2, resolve } from "path";
64
+ import { basename, dirname, isAbsolute, join as join2, relative as relative2, resolve } from "path";
65
65
  import { createRequire } from "module";
66
66
 
67
67
  // src/workspace/seed.ts
@@ -839,12 +839,26 @@ function suggestSiblingFile(path) {
839
839
  return void 0;
840
840
  }
841
841
  }
842
+ function findEntryInAncestor(file) {
843
+ if (isAbsolute(file)) return void 0;
844
+ let dir = dirname(resolve(file));
845
+ for (; ; ) {
846
+ const parent = dirname(dir);
847
+ if (parent === dir) return void 0;
848
+ dir = parent;
849
+ if (existsSync(resolve(dir, file))) return dir;
850
+ }
851
+ }
842
852
  async function loadDefault(file) {
843
853
  const path = resolve(file);
844
854
  if (!existsSync(path)) {
845
- throw new UsageError(`Cannot find entry file "${file}" (resolved to ${path}).`, {
846
- suggestion: suggestSiblingFile(path)
847
- });
855
+ const elsewhere = findEntryInAncestor(file);
856
+ const where = elsewhere !== void 0 ? `A relative entry resolves against the current directory (${process.cwd()}), and "${file}" does exist under ${elsewhere} \u2014 run xanots from there.` : `A relative entry resolves against the current directory (${process.cwd()}).`;
857
+ throw new UsageError(
858
+ `Cannot find entry file "${file}" (resolved to ${path}).` + (isAbsolute(file) ? "" : `
859
+ ${where}`),
860
+ { suggestion: suggestSiblingFile(path) }
861
+ );
848
862
  }
849
863
  const url = pathToFileURL3(path).href;
850
864
  const isTypeScript = /\.[mc]?ts$/.test(file);
@@ -955,7 +969,7 @@ async function run(argv) {
955
969
  return;
956
970
  }
957
971
  if (command === "init") {
958
- const { runInitCommand } = await import("./init-command-VIPWAQYS.js");
972
+ const { runInitCommand } = await import("./init-command-OVFFW4QS.js");
959
973
  return runInitCommand(args);
960
974
  }
961
975
  if (command === "completion") {
@@ -970,11 +984,11 @@ async function run(argv) {
970
984
  return runCompletionCommand(shell);
971
985
  }
972
986
  if (command === "upgrade") {
973
- const { runUpgradeCommand } = await import("./upgrade-command-TZYSGXP7.js");
987
+ const { runUpgradeCommand } = await import("./upgrade-command-QL523I62.js");
974
988
  return runUpgradeCommand(args);
975
989
  }
976
990
  if (command === "lock") {
977
- const { runLockCommand } = await import("./lock-commands-7VJKAXV6.js");
991
+ const { runLockCommand } = await import("./lock-commands-ET7NIOLH.js");
978
992
  return runLockCommand(args);
979
993
  }
980
994
  if (command === "login") {
@@ -986,15 +1000,15 @@ async function run(argv) {
986
1000
  return runLogoutCommand(args);
987
1001
  }
988
1002
  if (command === "deploy") {
989
- const { runDeployCommand } = await import("./deploy-command-HM57BINV.js");
1003
+ const { runDeployCommand } = await import("./deploy-command-5TTI4TUP.js");
990
1004
  return runDeployCommand(args);
991
1005
  }
992
1006
  if (command === "ephemeral") {
993
- const { runEphemeralCommand } = await import("./ephemeral-command-SD2KLX4P.js");
1007
+ const { runEphemeralCommand } = await import("./ephemeral-command-7TK52YQM.js");
994
1008
  return runEphemeralCommand(args);
995
1009
  }
996
1010
  if (command === "release") {
997
- const { runReleaseCommand } = await import("./release-command-3IET7YII.js");
1011
+ const { runReleaseCommand } = await import("./release-command-4EXVLYV2.js");
998
1012
  return runReleaseCommand(args);
999
1013
  }
1000
1014
  if (command === "sandbox") {
@@ -1010,21 +1024,21 @@ async function run(argv) {
1010
1024
  return runSandboxExportCommand(args);
1011
1025
  }
1012
1026
  if (args.subcommand === "codegen") {
1013
- const { runCodegenCommand } = await import("./codegen-command-DYH4H4TD.js");
1027
+ const { runCodegenCommand } = await import("./codegen-command-YSCSCVT5.js");
1014
1028
  return runCodegenCommand(args, { kind: "sandbox" });
1015
1029
  }
1016
1030
  throw unknownSubcommand("sandbox", args.subcommand);
1017
1031
  }
1018
1032
  if (command === "test") {
1019
- const { runTestCommand } = await import("./test-command-S7SMRWMP.js");
1033
+ const { runTestCommand } = await import("./test-command-2F5LKMI6.js");
1020
1034
  return runTestCommand(args);
1021
1035
  }
1022
1036
  if (command === "workspace") {
1023
- const { runWorkspaceCommand } = await import("./workspace-command-X6L7HTXO.js");
1037
+ const { runWorkspaceCommand } = await import("./workspace-command-HYA6JEKK.js");
1024
1038
  return runWorkspaceCommand(args);
1025
1039
  }
1026
1040
  if (command === "codegen") {
1027
- const { runCodegenCommand } = await import("./codegen-command-DYH4H4TD.js");
1041
+ const { runCodegenCommand } = await import("./codegen-command-YSCSCVT5.js");
1028
1042
  return runCodegenCommand(args, { kind: "file" });
1029
1043
  }
1030
1044
  if (command === "profile") {
@@ -1052,7 +1066,7 @@ async function run(argv) {
1052
1066
  throw unknownCommand("push");
1053
1067
  }
1054
1068
  if (command === "validate") {
1055
- const { runValidateCommand } = await import("./validate-command-MMXEVHH3.js");
1069
+ const { runValidateCommand } = await import("./validate-command-SK5FPCV7.js");
1056
1070
  return runValidateCommand(args);
1057
1071
  }
1058
1072
  if (command !== "compile" && command !== "export" && command !== "paths" && command !== "routes") {
@@ -1317,4 +1331,4 @@ export {
1317
1331
  exportBundleJson,
1318
1332
  compileBundle
1319
1333
  };
1320
- //# sourceMappingURL=chunk-CL2H2WYE.js.map
1334
+ //# sourceMappingURL=chunk-K3YSQDXJ.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  compileBundle
3
- } from "./chunk-CL2H2WYE.js";
3
+ } from "./chunk-K3YSQDXJ.js";
4
4
  import {
5
5
  missingArgument
6
6
  } from "./chunk-JQLR64UC.js";
@@ -34,4 +34,4 @@ export {
34
34
  assertBundleInput,
35
35
  loadBundleText
36
36
  };
37
- //# sourceMappingURL=chunk-7BUTRVKA.js.map
37
+ //# sourceMappingURL=chunk-KSV7VOEX.js.map
@@ -27,7 +27,7 @@ import {
27
27
  resolveFrontendPreset,
28
28
  resolveThemeChoice,
29
29
  sanitizeAppName
30
- } from "./chunk-DBHE35JM.js";
30
+ } from "./chunk-6Z5CNWFC.js";
31
31
  import {
32
32
  XANO_DIR,
33
33
  resolveAiPresets,
@@ -35,7 +35,7 @@ import {
35
35
  } from "./chunk-4PE4ZAB7.js";
36
36
  import {
37
37
  TEST_EXPECT_TYPES
38
- } from "./chunk-JAVB27HL.js";
38
+ } from "./chunk-5YQOIFT4.js";
39
39
  import {
40
40
  raw
41
41
  } from "./chunk-LU7TRWMC.js";
@@ -67,11 +67,11 @@ import {
67
67
  searchConstrainsRows,
68
68
  tableTrigger,
69
69
  workspaceTrigger
70
- } from "./chunk-2V3JUXTF.js";
70
+ } from "./chunk-ZZLPTHT5.js";
71
71
  import {
72
72
  loadDefault,
73
73
  readVersion
74
- } from "./chunk-CL2H2WYE.js";
74
+ } from "./chunk-K3YSQDXJ.js";
75
75
  import {
76
76
  UsageError
77
77
  } from "./chunk-JQLR64UC.js";
@@ -115,7 +115,7 @@ import {
115
115
  sys,
116
116
  toolset,
117
117
  withFilters
118
- } from "./chunk-NJGNUVXR.js";
118
+ } from "./chunk-QONOJO45.js";
119
119
  import {
120
120
  parsePathParams,
121
121
  unboundPathParams
@@ -6765,7 +6765,7 @@ async function fetchBundle(args, source) {
6765
6765
  );
6766
6766
  }
6767
6767
  const auth3 = await getAccessToken(args);
6768
- const { resolveLive, fetchEphemeralBundle } = await import("./ephemeral-command-SD2KLX4P.js");
6768
+ const { resolveLive, fetchEphemeralBundle } = await import("./ephemeral-command-7TK52YQM.js");
6769
6769
  const summary = await resolveLive(auth3, auth3.workspaceId, name);
6770
6770
  step(`Reading ephemeral "${name}"`);
6771
6771
  return {
@@ -7034,4 +7034,4 @@ export {
7034
7034
  verifyCrashEntry,
7035
7035
  blameGeneratedFile
7036
7036
  };
7037
- //# sourceMappingURL=chunk-5PDOAR77.js.map
7037
+ //# sourceMappingURL=chunk-L6TPHWAU.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readVersion
3
- } from "./chunk-CL2H2WYE.js";
3
+ } from "./chunk-K3YSQDXJ.js";
4
4
  import {
5
5
  atomicWrite
6
6
  } from "./chunk-GNPVYOPB.js";
@@ -170,4 +170,4 @@ export {
170
170
  upgradeCommand,
171
171
  maybeNotifyUpdate
172
172
  };
173
- //# sourceMappingURL=chunk-FDKR4YMN.js.map
173
+ //# sourceMappingURL=chunk-OW2QZEWL.js.map
@@ -1456,9 +1456,13 @@ var input = {
1456
1456
  *
1457
1457
  * It is NOT a stored file resource and cannot be written to a file column
1458
1458
  * directly. Store it first and write what you get back:
1459
- * `s.storage.create_image({ as: "img", value: ref("input.avatar") })`, then
1460
- * write `ref("img")` to an `f.image()` column. Use {@link input.image} and
1461
- * friends only when the caller already sends a stored file resource.
1459
+ * `s.storage.create_image({ as: "img", value: inp("avatar") })`, then write
1460
+ * `ref("img")` to an `f.image()` column. Use {@link input.image} and friends
1461
+ * only when the caller already sends a stored file resource.
1462
+ *
1463
+ * Read the upload with `inp`, NOT `ref("input.avatar")`: `ref` is the `var`
1464
+ * tag, so that spelling makes the engine look for a stack variable named
1465
+ * `input` and fail the request with `Missing var entry: input`.
1462
1466
  */
1463
1467
  file: makeInput("file"),
1464
1468
  /**
@@ -3686,12 +3690,37 @@ function phpEncodeString(str) {
3686
3690
  case " ":
3687
3691
  out2 += "\\t";
3688
3692
  break;
3693
+ // PHP escapes the two line terminators even under JSON_UNESCAPED_UNICODE
3694
+ // — that flag is not JSON_UNESCAPED_LINE_TERMINATORS, which the engine
3695
+ // does not pass.
3696
+ case "\u2028":
3697
+ out2 += "\\u2028";
3698
+ break;
3699
+ case "\u2029":
3700
+ out2 += "\\u2029";
3701
+ break;
3689
3702
  default:
3690
3703
  out2 += code < 32 ? "\\u" + code.toString(16).padStart(4, "0") : ch;
3691
3704
  }
3692
3705
  }
3693
3706
  return out2 + '"';
3694
3707
  }
3708
+ var PHP_INT_MAX = 9223372036854775807n;
3709
+ function phpEncodeNumber(value) {
3710
+ if (!Number.isFinite(value)) return "0";
3711
+ const text = JSON.stringify(value);
3712
+ if (!/[.eE]/.test(text)) {
3713
+ const n = BigInt(text);
3714
+ return n > PHP_INT_MAX || n < -PHP_INT_MAX - 1n ? `"${text}"` : text;
3715
+ }
3716
+ const [mantissaText, exponentText] = Math.abs(value).toExponential().split("e");
3717
+ const exponent = Number(exponentText);
3718
+ if (exponent >= -4 && exponent < 17) return text;
3719
+ const digits = mantissaText.replace(".", "").replace(/0+$/, "") || "0";
3720
+ const mantissa = digits.length > 1 ? `${digits[0]}.${digits.slice(1)}` : `${digits}.0`;
3721
+ const sign = exponent < 0 ? "-" : "+";
3722
+ return `${value < 0 ? "-" : ""}${mantissa}e${sign}${Math.abs(exponent)}`;
3723
+ }
3695
3724
  function phpJsonEncode(value) {
3696
3725
  const out2 = [];
3697
3726
  const stack = [{ value }];
@@ -3711,7 +3740,7 @@ function phpJsonEncode(value) {
3711
3740
  out2.push(phpEncodeString(current));
3712
3741
  continue;
3713
3742
  case "number":
3714
- out2.push(Number.isFinite(current) ? JSON.stringify(current) : "0");
3743
+ out2.push(phpEncodeNumber(current));
3715
3744
  continue;
3716
3745
  case "boolean":
3717
3746
  out2.push(current ? "true" : "false");
@@ -3733,6 +3762,15 @@ function phpJsonEncode(value) {
3733
3762
  }
3734
3763
  const obj2 = current;
3735
3764
  const keys = Object.keys(obj2).filter((key) => obj2[key] !== void 0);
3765
+ if (keys.length > 0 && keys.every((key, i) => key === String(i))) {
3766
+ stack.push({ lit: "]" });
3767
+ for (let i = keys.length - 1; i >= 0; i--) {
3768
+ stack.push({ value: obj2[keys[i]] });
3769
+ if (i > 0) stack.push({ lit: "," });
3770
+ }
3771
+ stack.push({ lit: "[" });
3772
+ continue;
3773
+ }
3736
3774
  stack.push({ lit: "}" });
3737
3775
  for (let i = keys.length - 1; i >= 0; i--) {
3738
3776
  const key = keys[i];
@@ -4079,4 +4117,4 @@ export {
4079
4117
  serializeBundle,
4080
4118
  emitBundle
4081
4119
  };
4082
- //# sourceMappingURL=chunk-NJGNUVXR.js.map
4120
+ //# sourceMappingURL=chunk-QONOJO45.js.map
@@ -12,7 +12,7 @@ import {
12
12
  middlewareEntryGuid,
13
13
  stackReferencesAuth,
14
14
  tableColumns
15
- } from "./chunk-NJGNUVXR.js";
15
+ } from "./chunk-QONOJO45.js";
16
16
  import {
17
17
  CANONICAL_PAYLOAD_KEYS,
18
18
  REFERENCEABLE_KINDS,
@@ -566,7 +566,22 @@ function checkRealtimeDeliver(bundleType, sections, bag) {
566
566
  );
567
567
  }
568
568
  }
569
- var IMPLICIT_VAR_BASES = /* @__PURE__ */ new Set(["input"]);
569
+ var RESERVED_VAR_NAMESPACES = {
570
+ auth: (path) => `the authenticated caller \u2014 use \`auth("${tail(path)}")\``,
571
+ input: (path) => `a request input \u2014 use \`inp("${tail(path) || "name"}")\``,
572
+ env: (path) => `a workspace env var \u2014 use \`env("${tail(path) || "NAME"}")\` (or \`sys.*\` for a request-context value)`,
573
+ response: (path) => `the response under test \u2014 use \`resp("${tail(path)}")\``,
574
+ output: (path) => `a statement output \u2014 use \`out("${tail(path) || "name"}")\``,
575
+ error: (path) => `a caught error \u2014 use \`caught("${tail(path) || "message"}")\``,
576
+ trycatch: (path) => `a caught error \u2014 use \`caught("${tail(path) || "message"}")\``,
577
+ db: (path) => `a table column \u2014 use \`col("${tail(path) || "column"}")\``,
578
+ toolset: (path) => `a toolset binding \u2014 use \`toolset("${tail(path) || "token"}")\``,
579
+ var: (path, base) => `the variable namespace itself \u2014 drop the \`${base}.\` prefix (\`ref("${tail(path)}")\`)`
580
+ };
581
+ function tail(path) {
582
+ const dot = path.indexOf(".");
583
+ return dot === -1 ? "" : path.slice(dot + 1);
584
+ }
570
585
  function collectBindings(statements) {
571
586
  const bound = /* @__PURE__ */ new Set();
572
587
  for (const statement of statements) {
@@ -620,14 +635,22 @@ function checkUnboundVarRefs(sections, bag) {
620
635
  for (const path of refs) {
621
636
  const dot = path.indexOf(".");
622
637
  const base = dot === -1 ? path : path.slice(0, dot);
623
- if (base === "" || base.startsWith("$") || IMPLICIT_VAR_BASES.has(base)) continue;
638
+ if (base === "" || base.startsWith("$")) continue;
624
639
  if (bound.has(base)) continue;
625
640
  if (reported.has(base)) continue;
626
641
  reported.add(base);
642
+ const reserved = RESERVED_VAR_NAMESPACES[base];
643
+ if (reserved) {
644
+ bag.error(
645
+ "stack.reserved-var-namespace",
646
+ `${owner}: \`ref("${path}")\` reads a STACK VARIABLE named \`${base}\`, and nothing in this stack binds one \u2014 so the engine raises \`Missing var entry: ${base}\` (ERROR_FATAL, HTTP 500) on the first request. \`ref\` only ever spells a stack variable. For ${reserved(path, base)}. (If you really do mean a stack variable named \`${base}\`, bind it first with \`as: "${base}"\` and this passes.)`
647
+ );
648
+ continue;
649
+ }
627
650
  const suggestion = didYouMean(base, bound);
628
651
  bag.warn(
629
652
  "stack.unbound-var",
630
- `${owner}: \`ref("${path}")\` names a variable that nothing in this stack binds with \`as\`. At runtime this raises \`Unable to locate var: ${base}\` \u2014 an HTTP 500 on the deployed environment.${suggestion ? ` Did you mean "${suggestion}"?` : ""} Bind it first (\`as: "${base}"\` on the statement that produces it). Do NOT reach for \`ref(\u2026, { safe: true })\` here: that is for drilling into a value that may be null, and against a name that binds nothing it just turns the 500 into a silent \`null\`.`
653
+ `${owner}: \`ref("${path}")\` names a variable that nothing in this stack binds with \`as\`. At runtime this raises \`Missing var entry: ${base}\` \u2014 an HTTP 500 on the deployed environment.${suggestion ? ` Did you mean "${suggestion}"?` : ""} Bind it first (\`as: "${base}"\` on the statement that produces it). Do NOT reach for \`ref(\u2026, { safe: true })\` here: that is for drilling into a value that may be null, and against a name that binds nothing it just turns the 500 into a silent \`null\`.`
631
654
  );
632
655
  }
633
656
  }
@@ -1683,4 +1706,4 @@ export {
1683
1706
  Xano,
1684
1707
  workspace
1685
1708
  };
1686
- //# sourceMappingURL=chunk-FAWNUE2U.js.map
1709
+ //# sourceMappingURL=chunk-UDL46O35.js.map
@@ -66,7 +66,7 @@ async function resolveMetaTarget(auth, opts, deps = {}) {
66
66
  case "sandbox":
67
67
  return resolveSandbox(auth);
68
68
  case "ephemeral": {
69
- const resolveLive = deps.resolveLive ?? (await import("./ephemeral-command-SD2KLX4P.js")).resolveLive;
69
+ const resolveLive = deps.resolveLive ?? (await import("./ephemeral-command-7TK52YQM.js")).resolveLive;
70
70
  return resolveEphemeral(auth, opts.name, { ...deps, resolveLive });
71
71
  }
72
72
  }
@@ -75,4 +75,4 @@ async function resolveMetaTarget(auth, opts, deps = {}) {
75
75
  export {
76
76
  resolveMetaTarget
77
77
  };
78
- //# sourceMappingURL=chunk-H2DEDWQF.js.map
78
+ //# sourceMappingURL=chunk-YNZFIY4J.js.map
@@ -35,7 +35,7 @@ import {
35
35
  registerKind,
36
36
  tableColumns,
37
37
  withFilters
38
- } from "./chunk-NJGNUVXR.js";
38
+ } from "./chunk-QONOJO45.js";
39
39
  import {
40
40
  assertPathParamInputs,
41
41
  fillPathParams,
@@ -3734,4 +3734,4 @@ export {
3734
3734
  workspaceKind,
3735
3735
  workspaceConfig
3736
3736
  };
3737
- //# sourceMappingURL=chunk-2V3JUXTF.js.map
3737
+ //# sourceMappingURL=chunk-ZZLPTHT5.js.map
package/dist/cli.js CHANGED
@@ -8,14 +8,14 @@ import {
8
8
  resolveHelpRequest,
9
9
  resolveLockPath,
10
10
  run
11
- } from "./chunk-CL2H2WYE.js";
11
+ } from "./chunk-K3YSQDXJ.js";
12
12
  import "./chunk-JQLR64UC.js";
13
13
  import "./chunk-OYMR5AMJ.js";
14
14
  import "./chunk-GNPVYOPB.js";
15
15
  import "./chunk-EZG76F7R.js";
16
- import "./chunk-FAWNUE2U.js";
16
+ import "./chunk-UDL46O35.js";
17
17
  import "./chunk-OKNSR7MT.js";
18
- import "./chunk-NJGNUVXR.js";
18
+ import "./chunk-QONOJO45.js";
19
19
  import "./chunk-WHOJWOSV.js";
20
20
  import "./chunk-5XZ744TS.js";
21
21
  import "./chunk-7JDT4PBU.js";
@@ -4,32 +4,32 @@ import {
4
4
  isMissingDependencyError,
5
5
  runCodegenCommand,
6
6
  verifyCrashEntry
7
- } from "./chunk-5PDOAR77.js";
7
+ } from "./chunk-L6TPHWAU.js";
8
8
  import "./chunk-ZOYMZZ3S.js";
9
9
  import "./chunk-3QW5NFZJ.js";
10
10
  import "./chunk-BKDJN76G.js";
11
11
  import "./chunk-QTNO2WD6.js";
12
12
  import "./chunk-ZUTSMMAG.js";
13
13
  import "./chunk-X4DVXBFY.js";
14
- import "./chunk-DBHE35JM.js";
14
+ import "./chunk-6Z5CNWFC.js";
15
15
  import "./chunk-4PE4ZAB7.js";
16
16
  import "./chunk-ZSYZTGJH.js";
17
17
  import "./chunk-3IGNIP6R.js";
18
- import "./chunk-JAVB27HL.js";
18
+ import "./chunk-5YQOIFT4.js";
19
19
  import "./chunk-LU7TRWMC.js";
20
20
  import "./chunk-MU3O43L2.js";
21
21
  import "./chunk-P5C2YKAM.js";
22
22
  import "./chunk-Q77KNEUL.js";
23
23
  import "./chunk-4BXJGVZ3.js";
24
- import "./chunk-2V3JUXTF.js";
25
- import "./chunk-CL2H2WYE.js";
24
+ import "./chunk-ZZLPTHT5.js";
25
+ import "./chunk-K3YSQDXJ.js";
26
26
  import "./chunk-JQLR64UC.js";
27
27
  import "./chunk-OYMR5AMJ.js";
28
28
  import "./chunk-GNPVYOPB.js";
29
29
  import "./chunk-EZG76F7R.js";
30
- import "./chunk-FAWNUE2U.js";
30
+ import "./chunk-UDL46O35.js";
31
31
  import "./chunk-OKNSR7MT.js";
32
- import "./chunk-NJGNUVXR.js";
32
+ import "./chunk-QONOJO45.js";
33
33
  import "./chunk-WHOJWOSV.js";
34
34
  import "./chunk-5XZ744TS.js";
35
35
  import "./chunk-7JDT4PBU.js";
@@ -40,4 +40,4 @@ export {
40
40
  runCodegenCommand,
41
41
  verifyCrashEntry
42
42
  };
43
- //# sourceMappingURL=codegen-command-DYH4H4TD.js.map
43
+ //# sourceMappingURL=codegen-command-YSCSCVT5.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  assertBundleInput,
6
6
  loadBundleText
7
- } from "./chunk-7BUTRVKA.js";
7
+ } from "./chunk-KSV7VOEX.js";
8
8
  import {
9
9
  createEphemeral,
10
10
  getEphemeral,
@@ -42,7 +42,7 @@ import {
42
42
  fetchOrExplain,
43
43
  httpFailure
44
44
  } from "./chunk-3IGNIP6R.js";
45
- import "./chunk-CL2H2WYE.js";
45
+ import "./chunk-K3YSQDXJ.js";
46
46
  import {
47
47
  assertWritableDest
48
48
  } from "./chunk-JQLR64UC.js";
@@ -62,9 +62,9 @@ import {
62
62
  warn,
63
63
  withSpinner
64
64
  } from "./chunk-EZG76F7R.js";
65
- import "./chunk-FAWNUE2U.js";
65
+ import "./chunk-UDL46O35.js";
66
66
  import "./chunk-OKNSR7MT.js";
67
- import "./chunk-NJGNUVXR.js";
67
+ import "./chunk-QONOJO45.js";
68
68
  import "./chunk-WHOJWOSV.js";
69
69
  import "./chunk-5XZ744TS.js";
70
70
  import "./chunk-7JDT4PBU.js";
@@ -158,7 +158,7 @@ async function runDeployedTests(auth, dest, summary, args) {
158
158
  }
159
159
  }
160
160
  async function runTestsOrThrow(auth, dest, summary, args) {
161
- const { runSuite, EXIT_TESTS_FAILED } = await import("./test-command-S7SMRWMP.js");
161
+ const { runSuite, EXIT_TESTS_FAILED } = await import("./test-command-2F5LKMI6.js");
162
162
  let target;
163
163
  if (dest === "ephemeral") {
164
164
  if (summary.url === void 0) {
@@ -168,7 +168,7 @@ async function runTestsOrThrow(auth, dest, summary, args) {
168
168
  const name = summary.ephemeral?.name;
169
169
  target = { base: summary.url, workspaceId: 1, label: name ? `ephemeral ${name}` : "the ephemeral", env: name };
170
170
  } else {
171
- const { resolveMetaTarget } = await import("./env-target-WA3BH5YU.js");
171
+ const { resolveMetaTarget } = await import("./env-target-4T7AT347.js");
172
172
  target = await resolveMetaTarget(auth, { dest: "sandbox" });
173
173
  }
174
174
  const outcomes = await runSuite(auth, target, {
@@ -189,7 +189,7 @@ async function runTestsOrThrow(auth, dest, summary, args) {
189
189
  total: outcomes.length,
190
190
  passed,
191
191
  failed,
192
- results: outcomes.map((o) => ({
192
+ tests: outcomes.map((o) => ({
193
193
  kind: o.kind,
194
194
  name: o.name,
195
195
  status: o.status,
@@ -240,7 +240,7 @@ async function runDeployCommand(args) {
240
240
  if (dest === "ephemeral" && summary.created === false && staticSummary?.url !== void 0) {
241
241
  detail("This static URL is new \u2014 a re-deploy replaces the environment's hosting, so the previous one no longer serves.");
242
242
  }
243
- if (args.test) summary.tests = await runDeployedTests(auth, dest, summary, args);
243
+ if (args.test) summary.testRun = await runDeployedTests(auth, dest, summary, args);
244
244
  if (args.open) openDeployed(summary);
245
245
  if (isMachineOutput(args)) writeJson(summary);
246
246
  }
@@ -448,4 +448,4 @@ export {
448
448
  runDeployedTests,
449
449
  verifyMicroservices
450
450
  };
451
- //# sourceMappingURL=deploy-command-HM57BINV.js.map
451
+ //# sourceMappingURL=deploy-command-5TTI4TUP.js.map