@xanots/sdk 0.0.9 → 0.0.10
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/CHANGELOG.md +17 -0
- package/README.md +28 -21
- package/dist/.build-fingerprint +1 -1
- package/dist/{agent-file-refresh-4W37DGXS.js → agent-file-refresh-QNKN5RYD.js} +3 -3
- package/dist/bin.js +8 -7
- package/dist/{branch-commands-PBQ36L4A.js → branch-commands-2BLOC2GR.js} +13 -11
- package/dist/{capture-7PO6SGB4.js → capture-4WVJY4DQ.js} +2 -2
- package/dist/{chunk-ZOYMZZ3S.js → chunk-3INK4Y4E.js} +1 -1
- package/dist/{chunk-NDZFBZHC.js → chunk-3UABJA4X.js} +1 -1
- package/dist/{chunk-7OXFMCTX.js → chunk-5R73LFWK.js} +3 -3
- package/dist/{chunk-OW2QZEWL.js → chunk-5YCQ2QHH.js} +2 -2
- package/dist/{chunk-5YQOIFT4.js → chunk-75Z74TA7.js} +2 -2
- package/dist/{chunk-QTNO2WD6.js → chunk-7ZYW652H.js} +1 -1
- package/dist/{chunk-K3YSQDXJ.js → chunk-ACCBOMCB.js} +91 -74
- package/dist/{chunk-4PTSTDIG.js → chunk-AIZKXUNP.js} +2 -2
- package/dist/{chunk-P5C2YKAM.js → chunk-ANUDXFEX.js} +18 -27
- package/dist/chunk-CTD5ZCV6.js +28 -0
- package/dist/{chunk-5HCDZ2XN.js → chunk-DBFU47BJ.js} +2 -2
- package/dist/{chunk-OKNSR7MT.js → chunk-DIA7CT7J.js} +129 -150
- package/dist/{chunk-JQLR64UC.js → chunk-F6CYJ7TN.js} +21 -6
- package/dist/{chunk-BKDJN76G.js → chunk-FE5I6S6N.js} +1 -1
- package/dist/{chunk-L6TPHWAU.js → chunk-I7DQDJAM.js} +30 -48
- package/dist/{chunk-QIWBCS7N.js → chunk-JGCWTCA7.js} +2 -2
- package/dist/{chunk-MDXR5E5Q.js → chunk-K5IOND4K.js} +2 -2
- package/dist/{chunk-4PE4ZAB7.js → chunk-KA6G2L7U.js} +5 -5
- package/dist/{chunk-QONOJO45.js → chunk-LBYWGMOA.js} +1 -1
- package/dist/{chunk-ZZLPTHT5.js → chunk-P6TAVLOX.js} +2 -2
- package/dist/{chunk-3QW5NFZJ.js → chunk-QKM4U5UK.js} +3 -3
- package/dist/{chunk-T4XPCJRF.js → chunk-TCFIPDB3.js} +1 -1
- package/dist/{chunk-UDL46O35.js → chunk-VKSOTZK3.js} +2 -2
- package/dist/{chunk-6DHBYBTO.js → chunk-VNQM3V2C.js} +1 -2
- package/dist/{chunk-KSV7VOEX.js → chunk-W24FJHPD.js} +3 -3
- package/dist/chunk-WGPXT2G2.js +22 -0
- package/dist/{chunk-6AAT2AYQ.js → chunk-WP4OZZV4.js} +2 -2
- package/dist/{chunk-MU3O43L2.js → chunk-YBC3IKMF.js} +2 -2
- package/dist/{chunk-6Z5CNWFC.js → chunk-YYFXVYPX.js} +37 -6
- package/dist/chunk-ZQ2PKR6R.js +40 -0
- package/dist/cli.d.ts +57 -31
- package/dist/cli.js +6 -5
- package/dist/codegen-command-GB3H2KQ7.js +46 -0
- package/dist/{completion-A6BZ3XGU.js → completion-WF46272M.js} +2 -2
- package/dist/{config-NL33PN4D.js → config-476F3PT5.js} +1 -1
- package/dist/{deploy-command-5TTI4TUP.js → deploy-command-QTIVA22A.js} +67 -99
- package/dist/{ephemeral-command-7TK52YQM.js → ephemeral-command-U4AQ3TXX.js} +25 -28
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/{init-command-OVFFW4QS.js → init-command-MAXULNAD.js} +13 -10
- package/dist/{onboard-command-EHOHKQQU.js → init-web-3JNFG6GI.js} +10 -10
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +27 -36
- package/dist/{live-diff-QK4KC2FJ.js → live-diff-IXKBVG4K.js} +3 -3
- package/dist/{lock-commands-ET7NIOLH.js → lock-commands-DQ7CUMIV.js} +20 -19
- package/dist/{login-command-DFCURZLC.js → login-command-Z6CHTA57.js} +7 -7
- package/dist/{logout-command-WXVZQCAV.js → logout-command-ER6IKAYJ.js} +2 -2
- package/dist/{loop-7SAIGRCZ.js → loop-D5NPL4VH.js} +3 -3
- package/dist/{marketplace-command-BCOAAN2I.js → marketplace-command-P4IPLJ6J.js} +6 -6
- package/dist/{meta-client-57ZWVHST.js → meta-client-K2J4XH64.js} +6 -6
- package/dist/node.d.ts +2 -2
- package/dist/node.js +9 -8
- package/dist/{validate-command-SK5FPCV7.js → preflight-command-GZ2GE5RN.js} +17 -16
- package/dist/{profile-command-QJAAUZIV.js → profile-command-LJSBDV2L.js} +5 -5
- package/dist/{release-command-4EXVLYV2.js → release-command-YUBTNHVX.js} +36 -33
- package/dist/{routes-manifest-SP3ZXLMR.js → routes-manifest-PWZHDOI5.js} +2 -2
- package/dist/scaffold.js +2 -2
- package/dist/{static-host-D6KS7X45.js → static-host-3WMV7IZO.js} +1 -1
- package/dist/status-command-AL47VG7H.js +162 -0
- package/dist/{store-CUCBSYLj.d.ts → store-BG1UPZ3Z.d.ts} +5 -5
- package/dist/{test-command-2F5LKMI6.js → test-command-YAZLKLGQ.js} +45 -28
- package/dist/{upgrade-command-QL523I62.js → upgrade-command-FB5QJ363.js} +13 -12
- package/dist/{workspace-K72NP7SX.js → workspace-2COHDBM3.js} +1 -1
- package/dist/{workspace-command-HYA6JEKK.js → workspace-command-43P42FBP.js} +31 -32
- package/dist/{workspace-export-AJMGN3CQ.js → workspace-export-DURY5WYL.js} +2 -2
- package/guides/README.md +2 -2
- package/guides/cli.md +17 -19
- package/guides/codegen.md +21 -5
- package/guides/coverage.md +1 -1
- package/guides/deploying.md +31 -34
- package/guides/environment.md +4 -4
- package/guides/object-kinds.md +3 -3
- package/guides/project-structure.md +1 -1
- package/guides/scaffold.md +25 -2
- package/guides/typed-frontend.md +1 -1
- package/llms/kinds-agent-mcp.md +1 -1
- package/llms/kinds-core.md +1 -1
- package/llms/kinds-realtime.md +1 -1
- package/llms/lock.md +5 -5
- package/llms/tests.md +1 -1
- package/llms-full.txt +25 -34
- package/llms.txt +16 -25
- package/manifest.json +95 -426
- package/package.json +1 -1
- package/dist/chunk-3EYUR3TX.js +0 -100
- package/dist/chunk-JQJPFUZI.js +0 -118
- package/dist/chunk-YNZFIY4J.js +0 -78
- package/dist/codegen-command-YSCSCVT5.js +0 -43
- package/dist/env-target-4T7AT347.js +0 -16
- package/dist/sandbox-details-command-EDO56IY3.js +0 -18
- package/dist/sandbox-export-command-MO6DEZ7Z.js +0 -24
|
@@ -15,27 +15,30 @@ import {
|
|
|
15
15
|
normalize,
|
|
16
16
|
retiredInputSuccessor,
|
|
17
17
|
retiredInputs
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-3INK4Y4E.js";
|
|
19
|
+
import {
|
|
20
|
+
resolveEphemeralName
|
|
21
|
+
} from "./chunk-ZQ2PKR6R.js";
|
|
19
22
|
import {
|
|
20
23
|
getAccessToken
|
|
21
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-QKM4U5UK.js";
|
|
22
25
|
import {
|
|
23
26
|
exportWorkspaceBundle
|
|
24
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-7ZYW652H.js";
|
|
25
28
|
import {
|
|
26
29
|
projectShellFiles,
|
|
27
30
|
resolveFrontendPreset,
|
|
28
31
|
resolveThemeChoice,
|
|
29
32
|
sanitizeAppName
|
|
30
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-YYFXVYPX.js";
|
|
31
34
|
import {
|
|
32
35
|
XANO_DIR,
|
|
33
36
|
resolveAiPresets,
|
|
34
37
|
scaffoldProject
|
|
35
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-KA6G2L7U.js";
|
|
36
39
|
import {
|
|
37
40
|
TEST_EXPECT_TYPES
|
|
38
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-75Z74TA7.js";
|
|
39
42
|
import {
|
|
40
43
|
raw
|
|
41
44
|
} from "./chunk-LU7TRWMC.js";
|
|
@@ -44,7 +47,7 @@ import {
|
|
|
44
47
|
describeOrigin,
|
|
45
48
|
renderCodegenMarker,
|
|
46
49
|
renderCodegenReadme
|
|
47
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-ANUDXFEX.js";
|
|
48
51
|
import {
|
|
49
52
|
FIELD_METHODS,
|
|
50
53
|
STATEMENT_SURFACES,
|
|
@@ -67,14 +70,14 @@ import {
|
|
|
67
70
|
searchConstrainsRows,
|
|
68
71
|
tableTrigger,
|
|
69
72
|
workspaceTrigger
|
|
70
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-P6TAVLOX.js";
|
|
71
74
|
import {
|
|
72
75
|
loadDefault,
|
|
73
76
|
readVersion
|
|
74
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-ACCBOMCB.js";
|
|
75
78
|
import {
|
|
76
79
|
UsageError
|
|
77
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-F6CYJ7TN.js";
|
|
78
81
|
import {
|
|
79
82
|
blank,
|
|
80
83
|
detail,
|
|
@@ -115,7 +118,7 @@ import {
|
|
|
115
118
|
sys,
|
|
116
119
|
toolset,
|
|
117
120
|
withFilters
|
|
118
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-LBYWGMOA.js";
|
|
119
122
|
import {
|
|
120
123
|
parsePathParams,
|
|
121
124
|
unboundPathParams
|
|
@@ -6748,24 +6751,10 @@ function reportMismatches(report, result) {
|
|
|
6748
6751
|
|
|
6749
6752
|
// src/emit/codegen-command.ts
|
|
6750
6753
|
async function fetchBundle(args, source) {
|
|
6751
|
-
if (source.kind === "sandbox") {
|
|
6752
|
-
const auth3 = await getAccessToken(args);
|
|
6753
|
-
step("Reading the sandbox workspace");
|
|
6754
|
-
const { fetchSandboxBundle } = await import("./sandbox-export-command-MO6DEZ7Z.js");
|
|
6755
|
-
return {
|
|
6756
|
-
bundle: await fetchSandboxBundle(auth3),
|
|
6757
|
-
origin: { source: "sandbox", origin: auth3.instance }
|
|
6758
|
-
};
|
|
6759
|
-
}
|
|
6760
6754
|
if (source.kind === "ephemeral") {
|
|
6761
|
-
const name = args.positionals[0];
|
|
6762
|
-
if (name === void 0 || name === "") {
|
|
6763
|
-
throw new Error(
|
|
6764
|
-
"`xanots ephemeral codegen` needs a tenant name and an output path: `xanots ephemeral codegen <tenant> <path>`. Run `xanots ephemeral list` to see them."
|
|
6765
|
-
);
|
|
6766
|
-
}
|
|
6767
6755
|
const auth3 = await getAccessToken(args);
|
|
6768
|
-
const
|
|
6756
|
+
const name = resolveEphemeralName(auth3, source.name);
|
|
6757
|
+
const { resolveLive, fetchEphemeralBundle } = await import("./ephemeral-command-U4AQ3TXX.js");
|
|
6769
6758
|
const summary = await resolveLive(auth3, auth3.workspaceId, name);
|
|
6770
6759
|
step(`Reading ephemeral "${name}"`);
|
|
6771
6760
|
return {
|
|
@@ -6853,19 +6842,12 @@ function isMissingDependencyError(err) {
|
|
|
6853
6842
|
}
|
|
6854
6843
|
return false;
|
|
6855
6844
|
}
|
|
6856
|
-
async function
|
|
6857
|
-
const
|
|
6858
|
-
const
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
}
|
|
6863
|
-
if (pathArg === void 0 || pathArg === "") {
|
|
6864
|
-
throw new Error(
|
|
6865
|
-
source.kind === "ephemeral" ? "`xanots ephemeral codegen` needs an output path: `xanots ephemeral codegen <tenant> <path>`." : `\`xanots ${source.kind === "file" ? "codegen <bundle.json>" : `${source.kind} codegen`}\` needs an output path.`
|
|
6866
|
-
);
|
|
6867
|
-
}
|
|
6868
|
-
const { bundle, origin } = source.kind === "file" ? { bundle: readBundleFile(fileArg), origin: { source: "file", origin: fileArg } } : await fetchBundle(args, source);
|
|
6845
|
+
async function runInitFromCommand(args, source) {
|
|
6846
|
+
const pathArg = args.positionals[0] ?? ".";
|
|
6847
|
+
const { bundle, origin } = source.kind === "file" ? {
|
|
6848
|
+
bundle: readBundleFile(source.path),
|
|
6849
|
+
origin: { source: "file", origin: source.path }
|
|
6850
|
+
} : await fetchBundle(args, source);
|
|
6869
6851
|
const mode = reportMode(args.report);
|
|
6870
6852
|
const out2 = resolve(pathArg);
|
|
6871
6853
|
const appName = sanitizeAppName(args.name ?? basename(out2));
|
|
@@ -6904,7 +6886,7 @@ async function runCodegenCommand(args, source) {
|
|
|
6904
6886
|
theme: choice
|
|
6905
6887
|
});
|
|
6906
6888
|
let verified = null;
|
|
6907
|
-
if (!args.
|
|
6889
|
+
if (!args.skipRoundtrip) {
|
|
6908
6890
|
step("Verifying the generated tree round-trips");
|
|
6909
6891
|
try {
|
|
6910
6892
|
const result = verifyBundles(bundle, await reexport(out2));
|
|
@@ -6950,7 +6932,7 @@ function reportMode(value) {
|
|
|
6950
6932
|
if (value === "full" || value === "json") return value;
|
|
6951
6933
|
throw new UsageError(
|
|
6952
6934
|
`--report takes grouped, full or json, not "${value}". grouped (the default) collapses repeated findings to one line per root cause, full prints every site, and json prints the findings as data.`,
|
|
6953
|
-
{ helpFor: { command: "
|
|
6935
|
+
{ helpFor: { command: "init" } }
|
|
6954
6936
|
);
|
|
6955
6937
|
}
|
|
6956
6938
|
var EXIT_VERIFY_FAILED = 2;
|
|
@@ -6977,7 +6959,7 @@ function blameGeneratedFile(err, out2) {
|
|
|
6977
6959
|
return void 0;
|
|
6978
6960
|
}
|
|
6979
6961
|
function unverifiedReason(install) {
|
|
6980
|
-
const fix = `run \`npm install\` in the project and re-run
|
|
6962
|
+
const fix = `run \`npm install\` in the project and re-run \`init --from\` to check the round trip`;
|
|
6981
6963
|
return install === "skipped" ? `Could not verify the round trip: dependencies are not installed (--no-install) \u2014 ${fix}.` : `Could not verify the round trip: \`npm install\` did not complete, so the tree could not be loaded \u2014 ${fix}.`;
|
|
6982
6964
|
}
|
|
6983
6965
|
function countBySection(payload) {
|
|
@@ -7004,7 +6986,7 @@ function summarize(args, project, bundle, verified, out2, origin, install, mode)
|
|
|
7004
6986
|
`);
|
|
7005
6987
|
}
|
|
7006
6988
|
if (verified === null) {
|
|
7007
|
-
if (args.
|
|
6989
|
+
if (args.skipRoundtrip) warn("Skipped the round-trip check (--skip-roundtrip) \u2014 the tree is unchecked.");
|
|
7008
6990
|
} else if (verified) {
|
|
7009
6991
|
success(
|
|
7010
6992
|
omitted > 0 ? `Verified: re-exporting ${out2} reproduces the source bundle, apart from ${omitted} deliberately omitted value${omitted === 1 ? "" : "s"} listed above` : `Verified: re-exporting ${out2} reproduces the source bundle`
|
|
@@ -7014,7 +6996,7 @@ function summarize(args, project, bundle, verified, out2, origin, install, mode)
|
|
|
7014
6996
|
}
|
|
7015
6997
|
blank();
|
|
7016
6998
|
success("Project ready.");
|
|
7017
|
-
const cdHint = out2 === process.cwd() ? "" : ` cd ${args.positionals.
|
|
6999
|
+
const cdHint = out2 === process.cwd() ? "" : ` cd ${args.positionals[0] ?? "."}
|
|
7018
7000
|
`;
|
|
7019
7001
|
detail(
|
|
7020
7002
|
`Next steps:
|
|
@@ -7023,15 +7005,15 @@ function summarize(args, project, bundle, verified, out2, origin, install, mode)
|
|
|
7023
7005
|
npm run xano:deploy # build the frontend, then deploy \u2192 live ephemeral URL`
|
|
7024
7006
|
);
|
|
7025
7007
|
detail(
|
|
7026
|
-
`${s2.bold(`${XANO_DIR}/`)} is disposable and schema-only \u2014 re-running
|
|
7008
|
+
`${s2.bold(`${XANO_DIR}/`)} is disposable and schema-only \u2014 re-running \`init --from\` rewrites it. Deploying is a FULL REPLACE, so send it only to an ephemeral environment.`
|
|
7027
7009
|
);
|
|
7028
7010
|
}
|
|
7029
7011
|
|
|
7030
7012
|
export {
|
|
7031
7013
|
fetchWorkspaceBundle,
|
|
7032
7014
|
isMissingDependencyError,
|
|
7033
|
-
|
|
7015
|
+
runInitFromCommand,
|
|
7034
7016
|
verifyCrashEntry,
|
|
7035
7017
|
blameGeneratedFile
|
|
7036
7018
|
};
|
|
7037
|
-
//# sourceMappingURL=chunk-
|
|
7019
|
+
//# sourceMappingURL=chunk-I7DQDJAM.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
presetFilePath,
|
|
6
6
|
renderPreset,
|
|
7
7
|
upsertManagedBlock
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KA6G2L7U.js";
|
|
9
9
|
import {
|
|
10
10
|
warn
|
|
11
11
|
} from "./chunk-EZG76F7R.js";
|
|
@@ -92,4 +92,4 @@ export {
|
|
|
92
92
|
isCI,
|
|
93
93
|
refreshAgentFiles
|
|
94
94
|
};
|
|
95
|
-
//# sourceMappingURL=chunk-
|
|
95
|
+
//# sourceMappingURL=chunk-JGCWTCA7.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureGitignored
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FE5I6S6N.js";
|
|
4
4
|
import {
|
|
5
5
|
atomicWrite
|
|
6
6
|
} from "./chunk-GNPVYOPB.js";
|
|
@@ -57,4 +57,4 @@ export {
|
|
|
57
57
|
setEnvironment,
|
|
58
58
|
clearEnvironment
|
|
59
59
|
};
|
|
60
|
-
//# sourceMappingURL=chunk-
|
|
60
|
+
//# sourceMappingURL=chunk-K5IOND4K.js.map
|
|
@@ -46,7 +46,7 @@ canonical slug. It is written by \`npm run xano:export\`/\`xano:deploy\` and is
|
|
|
46
46
|
|
|
47
47
|
To rename an object: rename it in code, run \`npm run xano:export\` (stderr prints
|
|
48
48
|
the fix-up), run \`npx xanots lock rename <kind> <old> <new> --lock=xano/xano.lock\`,
|
|
49
|
-
then export again. \`lock rename\`/\`lock
|
|
49
|
+
then export again. \`lock rename\`/\`lock import\` need that flag from the project root \u2014
|
|
50
50
|
they take no entry file, so they look for the lock in the current directory, while
|
|
51
51
|
\`lock prune <entry-file>\` (like \`export\`) derives it from the entry.
|
|
52
52
|
\`npm run xano:check\` fails if an export would change the lock \u2014 run it before
|
|
@@ -150,13 +150,13 @@ function generatedGuidanceBody(frontend) {
|
|
|
150
150
|
|
|
151
151
|
This is a [XanoTS](https://www.npmjs.com/package/@xanots/sdk) project whose
|
|
152
152
|
Xano backend under \`xano/\` was **pulled from a live workspace** and written as
|
|
153
|
-
TypeScript by \`xanots
|
|
153
|
+
TypeScript by \`xanots init --from\`. The ${frontend.label} frontend under \`frontend/\`
|
|
154
154
|
is a starter. XanoTS is Xano's official TypeScript SDK \u2014 the supported way to
|
|
155
155
|
drive a Xano workspace from code.
|
|
156
156
|
|
|
157
157
|
### Two rules before you edit anything
|
|
158
158
|
|
|
159
|
-
- **\`xano/\` is machine-written and disposable.** Re-running \`xanots
|
|
159
|
+
- **\`xano/\` is machine-written and disposable.** Re-running \`xanots init --from\`
|
|
160
160
|
on this project rewrites that directory wholesale \u2014 no merge, no diff, no
|
|
161
161
|
preservation of hand edits. Work you want to keep goes outside \`xano/\`, or
|
|
162
162
|
gets re-applied after each pull. Everything else in the project is yours.
|
|
@@ -173,7 +173,7 @@ ${LEARN_FROM_THE_LIBRARY}
|
|
|
173
173
|
|
|
174
174
|
\`frontend/src/lib/api.ts\` derives request paths (\`getPath()\`) and request/response
|
|
175
175
|
types (\`InferInput\` / \`InferResponse\`) from the query defs in \`xano/\`. Never
|
|
176
|
-
hand-type a URL or a request body. \`npx xanots
|
|
176
|
+
hand-type a URL or a request body. \`npx xanots routes xano/index.ts\` lists every
|
|
177
177
|
endpoint's verb and resolved path.
|
|
178
178
|
|
|
179
179
|
### Layout
|
|
@@ -442,4 +442,4 @@ export {
|
|
|
442
442
|
resolveAiPresets,
|
|
443
443
|
scaffoldProject
|
|
444
444
|
};
|
|
445
|
-
//# sourceMappingURL=chunk-
|
|
445
|
+
//# sourceMappingURL=chunk-KA6G2L7U.js.map
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
registerKind,
|
|
36
36
|
tableColumns,
|
|
37
37
|
withFilters
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-LBYWGMOA.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-
|
|
3737
|
+
//# sourceMappingURL=chunk-P6TAVLOX.js.map
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
resolveOAuthErrorCode,
|
|
15
15
|
resolveScope,
|
|
16
16
|
writeCredential
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-FE5I6S6N.js";
|
|
18
18
|
import {
|
|
19
19
|
detail,
|
|
20
20
|
hostLabel,
|
|
@@ -161,7 +161,7 @@ The refresh token may be expired or already spent \u2014 refresh tokens rotate o
|
|
|
161
161
|
);
|
|
162
162
|
}
|
|
163
163
|
assertHttpsOrigin(instance2, "instance");
|
|
164
|
-
const { resolveScopedWorkspaceId } = await import("./workspace-
|
|
164
|
+
const { resolveScopedWorkspaceId } = await import("./workspace-2COHDBM3.js");
|
|
165
165
|
const workspaceId = await resolveScopedWorkspaceId({ access_token: set.access_token, instance: instance2 });
|
|
166
166
|
return { access_token: set.access_token, instance: instance2, workspaceId, credentialType: "oauth" };
|
|
167
167
|
}
|
|
@@ -272,4 +272,4 @@ export {
|
|
|
272
272
|
envMetaCredentialVarsSet,
|
|
273
273
|
getAccessToken
|
|
274
274
|
};
|
|
275
|
-
//# sourceMappingURL=chunk-
|
|
275
|
+
//# sourceMappingURL=chunk-QKM4U5UK.js.map
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
middlewareEntryGuid,
|
|
13
13
|
stackReferencesAuth,
|
|
14
14
|
tableColumns
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LBYWGMOA.js";
|
|
16
16
|
import {
|
|
17
17
|
CANONICAL_PAYLOAD_KEYS,
|
|
18
18
|
REFERENCEABLE_KINDS,
|
|
@@ -1706,4 +1706,4 @@ export {
|
|
|
1706
1706
|
Xano,
|
|
1707
1707
|
workspace
|
|
1708
1708
|
};
|
|
1709
|
-
//# sourceMappingURL=chunk-
|
|
1709
|
+
//# sourceMappingURL=chunk-VKSOTZK3.js.map
|
|
@@ -152,7 +152,6 @@ async function waitUntilReady(auth, opts, cfg = {}) {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
export {
|
|
155
|
-
tenantBaseUrl,
|
|
156
155
|
isExpired,
|
|
157
156
|
isEphemeralDisabled,
|
|
158
157
|
createEphemeral,
|
|
@@ -163,4 +162,4 @@ export {
|
|
|
163
162
|
impersonateEphemeral,
|
|
164
163
|
waitUntilReady
|
|
165
164
|
};
|
|
166
|
-
//# sourceMappingURL=chunk-
|
|
165
|
+
//# sourceMappingURL=chunk-VNQM3V2C.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compileBundle
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ACCBOMCB.js";
|
|
4
4
|
import {
|
|
5
5
|
missingArgument
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-F6CYJ7TN.js";
|
|
7
7
|
|
|
8
8
|
// src/emit/bundle-input.ts
|
|
9
9
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -34,4 +34,4 @@ export {
|
|
|
34
34
|
assertBundleInput,
|
|
35
35
|
loadBundleText
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-W24FJHPD.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/emit/output-target.ts
|
|
2
|
+
import { statSync } from "fs";
|
|
3
|
+
import { join, resolve } from "path";
|
|
4
|
+
function resolveOutputTarget(opts) {
|
|
5
|
+
const { path, name, ext } = opts;
|
|
6
|
+
if (path === "-") return { kind: "stdout" };
|
|
7
|
+
const basename = `${name}.${ext}`;
|
|
8
|
+
if (path === void 0 || path === "") {
|
|
9
|
+
return { kind: "file", path: resolve(basename) };
|
|
10
|
+
}
|
|
11
|
+
const endsWithSep = path.endsWith("/") || path.endsWith("\\");
|
|
12
|
+
const isDir = statSync(path, { throwIfNoEntry: false })?.isDirectory() ?? false;
|
|
13
|
+
if (endsWithSep || isDir) {
|
|
14
|
+
return { kind: "file", path: resolve(join(path, basename)) };
|
|
15
|
+
}
|
|
16
|
+
return { kind: "file", path: resolve(path) };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
resolveOutputTarget
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=chunk-WGPXT2G2.js.map
|
|
@@ -29,7 +29,7 @@ function endpoint(opts, suffix = "", qs = "") {
|
|
|
29
29
|
}
|
|
30
30
|
function explainDuplicateIdentity(body2) {
|
|
31
31
|
if (!/duplicate key value violates unique constraint/i.test(body2)) return void 0;
|
|
32
|
-
return "The import tried to CREATE objects that already exist under different identities, and the engine refused the duplicate.\nThis is what a stale `xano.lock` looks like: it names guids the workspace no longer has, so nothing matched and everything was planned as new. `--replace` causes it by minting fresh identities.\nRun `xanots lock
|
|
32
|
+
return "The import tried to CREATE objects that already exist under different identities, and the engine refused the duplicate.\nThis is what a stale `xano.lock` looks like: it names guids the workspace no longer has, so nothing matched and everything was planned as new. `--replace` causes it by minting fresh identities.\nRun `xanots lock import` against this workspace to re-pin the lock to what is actually there, then release again.";
|
|
33
33
|
}
|
|
34
34
|
var ImportHttpError = class extends Error {
|
|
35
35
|
constructor(status, action, statusText, body2) {
|
|
@@ -173,4 +173,4 @@ export {
|
|
|
173
173
|
importWorkspaceArchive,
|
|
174
174
|
planWorkspaceImport
|
|
175
175
|
};
|
|
176
|
-
//# sourceMappingURL=chunk-
|
|
176
|
+
//# sourceMappingURL=chunk-WP4OZZV4.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderThemeScript
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ANUDXFEX.js";
|
|
4
4
|
import {
|
|
5
5
|
defaultThemeChoice,
|
|
6
6
|
iconLibraryOf,
|
|
@@ -842,4 +842,4 @@ export {
|
|
|
842
842
|
allFrontendPresets,
|
|
843
843
|
resolveFrameworkFlag
|
|
844
844
|
};
|
|
845
|
-
//# sourceMappingURL=chunk-
|
|
845
|
+
//# sourceMappingURL=chunk-YBC3IKMF.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
presetFilePath,
|
|
3
3
|
resolveAiPresets,
|
|
4
4
|
scaffoldProject
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KA6G2L7U.js";
|
|
6
6
|
import {
|
|
7
7
|
runNpmCapturingStderr
|
|
8
8
|
} from "./chunk-ZSYZTGJH.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
allFrontendPresets,
|
|
12
12
|
findFrontendPreset,
|
|
13
13
|
resolveFrameworkFlag
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YBC3IKMF.js";
|
|
15
15
|
import {
|
|
16
16
|
initLanding,
|
|
17
17
|
renderApiTs,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
renderViteConfig,
|
|
28
28
|
renderXanoExampleMd,
|
|
29
29
|
renderXanoIndex
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-ANUDXFEX.js";
|
|
31
31
|
import {
|
|
32
32
|
DEFAULT_DARK_MODE,
|
|
33
33
|
defaultThemeChoice,
|
|
@@ -41,10 +41,14 @@ import {
|
|
|
41
41
|
} from "./chunk-Q77KNEUL.js";
|
|
42
42
|
import {
|
|
43
43
|
readVersion
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-ACCBOMCB.js";
|
|
45
|
+
import {
|
|
46
|
+
ENV_SPELLINGS,
|
|
47
|
+
parseEnvSelector
|
|
48
|
+
} from "./chunk-CTD5ZCV6.js";
|
|
45
49
|
import {
|
|
46
50
|
UsageError
|
|
47
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-F6CYJ7TN.js";
|
|
48
52
|
import {
|
|
49
53
|
blank,
|
|
50
54
|
detail,
|
|
@@ -393,7 +397,33 @@ function buildFileSet(vars, preset, choice) {
|
|
|
393
397
|
{ path: "xano/EXAMPLE.md", content: renderXanoExampleMd(vars) }
|
|
394
398
|
];
|
|
395
399
|
}
|
|
400
|
+
function resolveFromSource(raw) {
|
|
401
|
+
const env = parseEnvSelector(raw);
|
|
402
|
+
if (env !== void 0) return env;
|
|
403
|
+
if (/\.json$/i.test(raw) || /[\\/]/.test(raw)) return { kind: "file", path: raw };
|
|
404
|
+
throw new UsageError(
|
|
405
|
+
`--from does not take "${raw}". Sources are ${ENV_SPELLINGS}, or a path to a bundle .json (\`xanots ephemeral list\` shows the environment names; bare \`ephemeral\` is the one this project last deployed to).`,
|
|
406
|
+
{ helpFor: { command: "init" } }
|
|
407
|
+
);
|
|
408
|
+
}
|
|
409
|
+
function rejectPullOnlyFlags(args) {
|
|
410
|
+
const passed = [
|
|
411
|
+
...args.report !== void 0 ? ["--report"] : [],
|
|
412
|
+
...args.skipRoundtrip ? ["--skip-roundtrip"] : []
|
|
413
|
+
];
|
|
414
|
+
if (passed.length === 0) return;
|
|
415
|
+
throw new UsageError(
|
|
416
|
+
`${passed.join(" and ")} ${passed.length === 1 ? "describes" : "describe"} the pull that \`--from\` performs, so ${passed.length === 1 ? "it does" : "they do"} nothing without it. Add \`--from <source>\`, or drop ${passed.length === 1 ? "the flag" : "them"}.`,
|
|
417
|
+
{ helpFor: { command: "init" } }
|
|
418
|
+
);
|
|
419
|
+
}
|
|
396
420
|
async function runInitCommand(args) {
|
|
421
|
+
if (args.from !== void 0) {
|
|
422
|
+
const source = resolveFromSource(args.from);
|
|
423
|
+
const { runInitFromCommand } = await import("./codegen-command-GB3H2KQ7.js");
|
|
424
|
+
return runInitFromCommand(args, source);
|
|
425
|
+
}
|
|
426
|
+
rejectPullOnlyFlags(args);
|
|
397
427
|
const targetArg = args.positionals[0] ?? ".";
|
|
398
428
|
const targetDir = resolve(targetArg);
|
|
399
429
|
const appName = sanitizeAppName(args.name ?? basename(targetDir));
|
|
@@ -468,6 +498,7 @@ export {
|
|
|
468
498
|
resolveThemeChoice,
|
|
469
499
|
sanitizeAppName,
|
|
470
500
|
projectShellFiles,
|
|
501
|
+
resolveFromSource,
|
|
471
502
|
runInitCommand
|
|
472
503
|
};
|
|
473
|
-
//# sourceMappingURL=chunk-
|
|
504
|
+
//# sourceMappingURL=chunk-YYFXVYPX.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getEnvironment,
|
|
3
|
+
readEphemeralState
|
|
4
|
+
} from "./chunk-K5IOND4K.js";
|
|
5
|
+
|
|
6
|
+
// src/emit/env-target.ts
|
|
7
|
+
async function resolveEphemeral(auth, name, deps) {
|
|
8
|
+
const resolved = resolveEphemeralName(auth, name, deps.cwd);
|
|
9
|
+
const summary = await deps.resolveLive(auth, auth.workspaceId, resolved);
|
|
10
|
+
if (summary.url === void 0) {
|
|
11
|
+
throw new Error(`Ephemeral "${resolved}" has no base URL to address yet \u2014 it may still be provisioning.`);
|
|
12
|
+
}
|
|
13
|
+
return { base: summary.url, workspaceId: 1, label: `ephemeral ${resolved}`, env: resolved };
|
|
14
|
+
}
|
|
15
|
+
function resolveEphemeralName(auth, name, cwd = process.cwd()) {
|
|
16
|
+
const tracked = getEnvironment(readEphemeralState(cwd), auth.workspaceId)?.name;
|
|
17
|
+
const resolved = name ?? tracked;
|
|
18
|
+
if (resolved === void 0 || resolved === "") {
|
|
19
|
+
throw new Error(
|
|
20
|
+
`No ephemeral environment to target. Name one with \`ephemeral:<name>\` (\`xanots ephemeral list\` shows them), or run \`xanots deploy\` first \u2014 this project then remembers the env it deployed to, which is what bare \`ephemeral\` reads.`
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
return resolved;
|
|
24
|
+
}
|
|
25
|
+
async function resolveMetaTarget(auth, selector, deps = {}) {
|
|
26
|
+
switch (selector.kind) {
|
|
27
|
+
case "workspace":
|
|
28
|
+
return { base: auth.instance, workspaceId: auth.workspaceId, label: `workspace ${auth.workspaceId}` };
|
|
29
|
+
case "ephemeral": {
|
|
30
|
+
const resolveLive = deps.resolveLive ?? (await import("./ephemeral-command-U4AQ3TXX.js")).resolveLive;
|
|
31
|
+
return resolveEphemeral(auth, selector.name, { ...deps, resolveLive });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
resolveEphemeralName,
|
|
38
|
+
resolveMetaTarget
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=chunk-ZQ2PKR6R.js.map
|