run402 1.42.0 → 1.44.0
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/lib/sdk.mjs +1 -1
- package/lib/sites.mjs +132 -24
- package/package.json +4 -1
- package/sdk/dist/errors.d.ts +5 -0
- package/sdk/dist/errors.d.ts.map +1 -1
- package/sdk/dist/errors.js +9 -0
- package/sdk/dist/errors.js.map +1 -1
- package/sdk/dist/index.d.ts +1 -1
- package/sdk/dist/index.d.ts.map +1 -1
- package/sdk/dist/index.js +1 -1
- package/sdk/dist/index.js.map +1 -1
- package/sdk/dist/namespaces/projects.d.ts +10 -1
- package/sdk/dist/namespaces/projects.d.ts.map +1 -1
- package/sdk/dist/namespaces/projects.js +24 -1
- package/sdk/dist/namespaces/projects.js.map +1 -1
- package/sdk/dist/namespaces/sites.d.ts +13 -21
- package/sdk/dist/namespaces/sites.d.ts.map +1 -1
- package/sdk/dist/namespaces/sites.js +9 -21
- package/sdk/dist/namespaces/sites.js.map +1 -1
- package/sdk/dist/node/canonicalize.d.ts +41 -0
- package/sdk/dist/node/canonicalize.d.ts.map +1 -0
- package/sdk/dist/node/canonicalize.js +62 -0
- package/sdk/dist/node/canonicalize.js.map +1 -0
- package/sdk/dist/node/index.d.ts +19 -2
- package/sdk/dist/node/index.d.ts.map +1 -1
- package/sdk/dist/node/index.js +21 -2
- package/sdk/dist/node/index.js.map +1 -1
- package/sdk/dist/node/sites-node.d.ts +109 -0
- package/sdk/dist/node/sites-node.d.ts.map +1 -0
- package/sdk/dist/node/sites-node.js +347 -0
- package/sdk/dist/node/sites-node.js.map +1 -0
package/lib/sdk.mjs
CHANGED
package/lib/sites.mjs
CHANGED
|
@@ -1,28 +1,35 @@
|
|
|
1
|
-
import { readFileSync } from "fs";
|
|
2
|
-
import {
|
|
1
|
+
import { mkdtempSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
2
|
+
import { tmpdir } from "os";
|
|
3
|
+
import { dirname, join, resolve } from "path";
|
|
3
4
|
import { allowanceAuthHeaders, resolveProjectId, updateProject } from "./config.mjs";
|
|
4
5
|
import { resolveFilePathsInManifest } from "./manifest.mjs";
|
|
5
6
|
import { getSdk } from "./sdk.mjs";
|
|
6
7
|
import { reportSdkError } from "./sdk-errors.mjs";
|
|
7
8
|
|
|
8
|
-
const HELP = `run402 sites
|
|
9
|
+
const HELP = `run402 sites - Deploy and manage static sites
|
|
9
10
|
|
|
10
11
|
Usage:
|
|
11
12
|
run402 sites deploy --manifest <file> [--project <id>] [--target <target>]
|
|
13
|
+
run402 sites deploy-dir <path> --project <id> [--target <target>]
|
|
12
14
|
run402 sites status <deployment_id>
|
|
13
15
|
cat manifest.json | run402 sites deploy
|
|
14
16
|
|
|
15
17
|
Subcommands:
|
|
16
|
-
deploy
|
|
17
|
-
|
|
18
|
+
deploy Deploy a static site from a manifest JSON
|
|
19
|
+
deploy-dir Deploy a static site from a local directory (SDK walks it for you)
|
|
20
|
+
status Check the status of a deployment
|
|
18
21
|
|
|
19
22
|
Options (deploy):
|
|
20
23
|
--manifest <file> Path to manifest JSON file (or read from stdin)
|
|
21
24
|
--project <id> Project ID (defaults to active project)
|
|
22
25
|
--target <target> Deployment target (e.g. 'production')
|
|
23
|
-
--inherit Copy unchanged files from the previous deployment (only upload changed files)
|
|
24
26
|
--help, -h Show this help message
|
|
25
27
|
|
|
28
|
+
Options (deploy-dir):
|
|
29
|
+
<path> Positional: local directory to deploy
|
|
30
|
+
--project <id> Project ID (defaults to active project)
|
|
31
|
+
--target <target> Deployment target (e.g. 'production')
|
|
32
|
+
|
|
26
33
|
Manifest format (JSON):
|
|
27
34
|
{
|
|
28
35
|
"files": [
|
|
@@ -32,34 +39,37 @@ Manifest format (JSON):
|
|
|
32
39
|
}
|
|
33
40
|
|
|
34
41
|
Files can use either inline "data" or a local "path":
|
|
35
|
-
{ "file": "index.html", "data": "<html>...</html>" }
|
|
36
|
-
{ "file": "style.css", "path": "./dist/style.css" }
|
|
42
|
+
{ "file": "index.html", "data": "<html>...</html>" } <- inline content
|
|
43
|
+
{ "file": "style.css", "path": "./dist/style.css" } <- read from disk
|
|
37
44
|
Paths are resolved relative to the manifest file's directory.
|
|
38
45
|
Binary files (images, fonts, etc.) are auto-detected and base64-encoded.
|
|
39
46
|
|
|
40
47
|
Examples:
|
|
41
48
|
run402 sites deploy --manifest site.json
|
|
49
|
+
run402 sites deploy-dir ./my-site --project prj_abc
|
|
42
50
|
run402 sites status dpl_abc123
|
|
43
51
|
cat site.json | run402 sites deploy
|
|
44
52
|
|
|
45
53
|
Notes:
|
|
46
|
-
-
|
|
47
|
-
|
|
54
|
+
- Both deploy and deploy-dir use the v1.32 plan/commit transport: only
|
|
55
|
+
bytes the gateway doesn't already have are uploaded. Re-deploys of an
|
|
56
|
+
unchanged tree make no S3 PUTs.
|
|
57
|
+
- deploy-dir walks the directory, skips .git / node_modules / .DS_Store,
|
|
58
|
+
and auto-detects binary files. Symlinks are rejected.
|
|
59
|
+
- Free with active tier - requires allowance auth
|
|
48
60
|
`;
|
|
49
61
|
|
|
50
62
|
const SUB_HELP = {
|
|
51
|
-
deploy: `run402 sites deploy
|
|
63
|
+
deploy: `run402 sites deploy - Deploy a static site from a manifest
|
|
52
64
|
|
|
53
65
|
Usage:
|
|
54
|
-
run402 sites deploy --manifest <file> [--project <id>] [--target <target>]
|
|
66
|
+
run402 sites deploy --manifest <file> [--project <id>] [--target <target>]
|
|
55
67
|
cat manifest.json | run402 sites deploy [--project <id>] [--target <target>]
|
|
56
68
|
|
|
57
69
|
Options:
|
|
58
70
|
--manifest <file> Path to manifest JSON file (or read from stdin)
|
|
59
71
|
--project <id> Project ID (defaults to the active project)
|
|
60
72
|
--target <target> Deployment target (e.g. 'production')
|
|
61
|
-
--inherit Copy unchanged files from the previous deployment
|
|
62
|
-
(only upload changed files)
|
|
63
73
|
|
|
64
74
|
Manifest format (JSON):
|
|
65
75
|
{
|
|
@@ -73,12 +83,40 @@ Manifest format (JSON):
|
|
|
73
83
|
|
|
74
84
|
Notes:
|
|
75
85
|
- Must include at least index.html in the files array
|
|
76
|
-
- Free with active tier
|
|
86
|
+
- Free with active tier - requires allowance auth
|
|
77
87
|
|
|
78
88
|
Examples:
|
|
79
89
|
run402 sites deploy --manifest site.json
|
|
80
|
-
run402 sites deploy --manifest site.json --target production
|
|
90
|
+
run402 sites deploy --manifest site.json --target production
|
|
81
91
|
cat site.json | run402 sites deploy
|
|
92
|
+
`,
|
|
93
|
+
"deploy-dir": `run402 sites deploy-dir - Deploy a static site from a local directory
|
|
94
|
+
|
|
95
|
+
Usage:
|
|
96
|
+
run402 sites deploy-dir <path> [--project <id>] [--target <target>]
|
|
97
|
+
|
|
98
|
+
Arguments:
|
|
99
|
+
<path> Local directory to deploy (positional, required)
|
|
100
|
+
|
|
101
|
+
Options:
|
|
102
|
+
--project <id> Project ID (defaults to the active project)
|
|
103
|
+
--target <target> Deployment target (e.g. 'production')
|
|
104
|
+
|
|
105
|
+
Behavior:
|
|
106
|
+
- Walks <path> recursively, skips .git / node_modules / .DS_Store
|
|
107
|
+
- Computes per-file SHA-256 and uploads only bytes the gateway doesn't
|
|
108
|
+
already have (plan/commit transport, v1.32+)
|
|
109
|
+
- Symlinks are rejected (no following)
|
|
110
|
+
- Paths in the manifest are POSIX-style relative to <path>
|
|
111
|
+
|
|
112
|
+
Notes:
|
|
113
|
+
- Re-deploying an unchanged tree makes no S3 PUTs (returns immediately
|
|
114
|
+
with bytes_uploaded: 0)
|
|
115
|
+
- Free with active tier - requires allowance auth
|
|
116
|
+
|
|
117
|
+
Examples:
|
|
118
|
+
run402 sites deploy-dir ./dist --project prj_abc
|
|
119
|
+
run402 sites deploy-dir ./my-site --project prj_abc --target production
|
|
82
120
|
`,
|
|
83
121
|
};
|
|
84
122
|
|
|
@@ -88,14 +126,41 @@ async function readStdin() {
|
|
|
88
126
|
return Buffer.concat(chunks).toString("utf-8");
|
|
89
127
|
}
|
|
90
128
|
|
|
129
|
+
/**
|
|
130
|
+
* Stage manifest files to a temp directory so the SDK's deployDir can walk
|
|
131
|
+
* them. The v1.32 SDK no longer accepts inline file bytes — every deploy
|
|
132
|
+
* goes through plan/commit and reads from a directory.
|
|
133
|
+
*/
|
|
134
|
+
function stageFilesToTempDir(files) {
|
|
135
|
+
const stage = mkdtempSync(join(tmpdir(), "run402-deploy-stage-"));
|
|
136
|
+
for (const f of files) {
|
|
137
|
+
if (typeof f.file !== "string" || typeof f.data !== "string") {
|
|
138
|
+
throw new Error("manifest entry missing required 'file' or 'data' string");
|
|
139
|
+
}
|
|
140
|
+
const target = join(stage, f.file);
|
|
141
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
142
|
+
const buf = (f.encoding ?? "utf-8") === "base64"
|
|
143
|
+
? Buffer.from(f.data, "base64")
|
|
144
|
+
: Buffer.from(f.data, "utf-8");
|
|
145
|
+
writeFileSync(target, buf);
|
|
146
|
+
}
|
|
147
|
+
return stage;
|
|
148
|
+
}
|
|
149
|
+
|
|
91
150
|
async function deploy(args) {
|
|
92
|
-
const opts = { manifest: null, project: undefined, target: undefined
|
|
151
|
+
const opts = { manifest: null, project: undefined, target: undefined };
|
|
93
152
|
for (let i = 0; i < args.length; i++) {
|
|
94
153
|
if (args[i] === "--help" || args[i] === "-h") { console.log(HELP); process.exit(0); }
|
|
95
154
|
if (args[i] === "--manifest" && args[i + 1]) opts.manifest = args[++i];
|
|
96
155
|
if (args[i] === "--project" && args[i + 1]) opts.project = args[++i];
|
|
97
156
|
if (args[i] === "--target" && args[i + 1]) opts.target = args[++i];
|
|
98
|
-
if (args[i] === "--inherit")
|
|
157
|
+
if (args[i] === "--inherit") {
|
|
158
|
+
console.error(JSON.stringify({
|
|
159
|
+
status: "error",
|
|
160
|
+
message: "--inherit is removed in v1.32; the SDK now uploads only changed files automatically.",
|
|
161
|
+
}));
|
|
162
|
+
process.exit(1);
|
|
163
|
+
}
|
|
99
164
|
}
|
|
100
165
|
const projectId = resolveProjectId(opts.project);
|
|
101
166
|
const raw = opts.manifest ? readFileSync(opts.manifest, "utf-8") : await readStdin();
|
|
@@ -103,13 +168,14 @@ async function deploy(args) {
|
|
|
103
168
|
if (opts.manifest) resolveFilePathsInManifest(manifest, dirname(resolve(opts.manifest)));
|
|
104
169
|
|
|
105
170
|
// Preserve the aggressive early exit when no allowance is configured.
|
|
106
|
-
allowanceAuthHeaders("/
|
|
171
|
+
allowanceAuthHeaders("/deploy/v1/plan");
|
|
107
172
|
|
|
173
|
+
const stage = stageFilesToTempDir(manifest.files || []);
|
|
108
174
|
try {
|
|
109
|
-
const data = await getSdk().sites.
|
|
110
|
-
|
|
175
|
+
const data = await getSdk().sites.deployDir({
|
|
176
|
+
project: projectId,
|
|
177
|
+
dir: stage,
|
|
111
178
|
target: opts.target,
|
|
112
|
-
inherit: opts.inherit,
|
|
113
179
|
});
|
|
114
180
|
if (data.deployment_id) {
|
|
115
181
|
updateProject(projectId, { last_deployment_id: data.deployment_id });
|
|
@@ -117,6 +183,47 @@ async function deploy(args) {
|
|
|
117
183
|
console.log(JSON.stringify(data, null, 2));
|
|
118
184
|
} catch (err) {
|
|
119
185
|
reportSdkError(err);
|
|
186
|
+
} finally {
|
|
187
|
+
rmSync(stage, { recursive: true, force: true });
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
async function deployDir(args) {
|
|
192
|
+
const opts = { dir: null, project: undefined, target: undefined };
|
|
193
|
+
for (let i = 0; i < args.length; i++) {
|
|
194
|
+
if (args[i] === "--help" || args[i] === "-h") { console.log(SUB_HELP["deploy-dir"]); process.exit(0); }
|
|
195
|
+
if (args[i] === "--project" && args[i + 1]) { opts.project = args[++i]; continue; }
|
|
196
|
+
if (args[i] === "--target" && args[i + 1]) { opts.target = args[++i]; continue; }
|
|
197
|
+
if (args[i] === "--inherit") {
|
|
198
|
+
console.error(JSON.stringify({
|
|
199
|
+
status: "error",
|
|
200
|
+
message: "--inherit is removed in v1.32; the SDK now uploads only changed files automatically.",
|
|
201
|
+
}));
|
|
202
|
+
process.exit(1);
|
|
203
|
+
}
|
|
204
|
+
if (!args[i].startsWith("-") && opts.dir === null) { opts.dir = args[i]; continue; }
|
|
205
|
+
}
|
|
206
|
+
if (!opts.dir) {
|
|
207
|
+
console.error(JSON.stringify({ status: "error", message: "Missing <path>. Usage: run402 sites deploy-dir <path> --project <id>" }));
|
|
208
|
+
process.exit(1);
|
|
209
|
+
}
|
|
210
|
+
const projectId = resolveProjectId(opts.project);
|
|
211
|
+
|
|
212
|
+
// Preserve the aggressive early exit when no allowance is configured.
|
|
213
|
+
allowanceAuthHeaders("/deploy/v1/plan");
|
|
214
|
+
|
|
215
|
+
try {
|
|
216
|
+
const data = await getSdk().sites.deployDir({
|
|
217
|
+
project: projectId,
|
|
218
|
+
dir: opts.dir,
|
|
219
|
+
target: opts.target,
|
|
220
|
+
});
|
|
221
|
+
if (data.deployment_id) {
|
|
222
|
+
updateProject(projectId, { last_deployment_id: data.deployment_id });
|
|
223
|
+
}
|
|
224
|
+
console.log(JSON.stringify({ status: "ok", ...data }, null, 2));
|
|
225
|
+
} catch (err) {
|
|
226
|
+
reportSdkError(err);
|
|
120
227
|
}
|
|
121
228
|
}
|
|
122
229
|
|
|
@@ -138,8 +245,9 @@ export async function run(sub, args) {
|
|
|
138
245
|
if (!sub || sub === '--help' || sub === '-h') { console.log(HELP); process.exit(0); }
|
|
139
246
|
if (Array.isArray(args) && (args.includes("--help") || args.includes("-h"))) { console.log(SUB_HELP[sub] || HELP); process.exit(0); }
|
|
140
247
|
switch (sub) {
|
|
141
|
-
case "deploy":
|
|
142
|
-
case "
|
|
248
|
+
case "deploy": await deploy(args); break;
|
|
249
|
+
case "deploy-dir": await deployDir(args); break;
|
|
250
|
+
case "status": await status(args); break;
|
|
143
251
|
default:
|
|
144
252
|
console.error(`Unknown subcommand: ${sub}\n`);
|
|
145
253
|
console.log(HELP);
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "run402",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.44.0",
|
|
4
4
|
"description": "CLI for Run402 — provision Postgres databases, deploy static sites, generate images, and manage wallets via x402 and MPP micropayments.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"run402": "cli.mjs"
|
|
8
8
|
},
|
|
9
|
+
"imports": {
|
|
10
|
+
"#sdk/node": "./sdk/dist/node/index.js"
|
|
11
|
+
},
|
|
9
12
|
"scripts": {
|
|
10
13
|
"prepack": "mkdir -p core-dist sdk/dist sdk/core-dist && cp ../core/dist/*.js core-dist/ && cp -R ../sdk/dist/. sdk/dist/ && cp ../sdk/core-dist/*.js sdk/core-dist/"
|
|
11
14
|
},
|
package/sdk/dist/errors.d.ts
CHANGED
|
@@ -31,4 +31,9 @@ export declare class NetworkError extends Run402Error {
|
|
|
31
31
|
readonly cause: unknown;
|
|
32
32
|
constructor(message: string, cause: unknown, context: string);
|
|
33
33
|
}
|
|
34
|
+
/** Local/filesystem error — input validation, missing path, unreadable dir. No HTTP involved. */
|
|
35
|
+
export declare class LocalError extends Run402Error {
|
|
36
|
+
readonly cause?: unknown;
|
|
37
|
+
constructor(message: string, context: string, cause?: unknown);
|
|
38
|
+
}
|
|
34
39
|
//# sourceMappingURL=errors.d.ts.map
|
package/sdk/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,8BAAsB,WAAY,SAAQ,KAAK;IAC7C,iFAAiF;IACjF,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,2FAA2F;IAC3F,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEb,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAA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,MAAM,GAAE,MAAM,GAAG,IAAW,EAAE,IAAI,GAAE,OAAc;CAInG;AAED,4FAA4F;AAC5F,qBAAa,YAAa,SAAQ,WAAW;CAAG;AAEhD,wDAAwD;AACxD,qBAAa,QAAS,SAAQ,WAAW;CAAG;AAE5C,iGAAiG;AACjG,qBAAa,YAAa,SAAQ,WAAW;IAC3C,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;gBACZ,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM;CAI7D;AAED,iGAAiG;AACjG,qBAAa,UAAW,SAAQ,WAAW;IACzC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;gBACb,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAI9D"}
|
package/sdk/dist/errors.js
CHANGED
|
@@ -43,4 +43,13 @@ export class NetworkError extends Run402Error {
|
|
|
43
43
|
this.cause = cause;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
+
/** Local/filesystem error — input validation, missing path, unreadable dir. No HTTP involved. */
|
|
47
|
+
export class LocalError extends Run402Error {
|
|
48
|
+
cause;
|
|
49
|
+
constructor(message, context, cause) {
|
|
50
|
+
super(message, null, null, context);
|
|
51
|
+
if (cause !== undefined)
|
|
52
|
+
this.cause = cause;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
46
55
|
//# sourceMappingURL=errors.js.map
|
package/sdk/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,OAAgB,WAAY,SAAQ,KAAK;IAC7C,iFAAiF;IACxE,MAAM,CAAgB;IAC/B,+DAA+D;IACtD,IAAI,CAAU;IACvB,2FAA2F;IAClF,OAAO,CAAS;IAEzB,YAAY,OAAe,EAAE,MAAqB,EAAE,IAAa,E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,CAAC;CACF"}
|
package/sdk/dist/index.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ export declare class Run402 {
|
|
|
62
62
|
* sandbox examples: `const r = run402({ ... })`.
|
|
63
63
|
*/
|
|
64
64
|
export declare function run402(opts: Run402Options): Run402;
|
|
65
|
-
export { Run402Error, PaymentRequired, ProjectNotFound, Unauthorized, ApiError, NetworkError, } from "./errors.js";
|
|
65
|
+
export { Run402Error, PaymentRequired, ProjectNotFound, Unauthorized, ApiError, NetworkError, LocalError, } from "./errors.js";
|
|
66
66
|
export type { CredentialsProvider, ProjectKeys } from "./credentials.js";
|
|
67
67
|
export type { RequestOptions, Client } from "./kernel.js";
|
|
68
68
|
//# sourceMappingURL=index.d.ts.map
|
package/sdk/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,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G,MAAM,CAElD;AAED,OAAO,EACL,WAAW,EACX,eAAe,EACf,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACzE,YAAY,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
package/sdk/dist/index.js
CHANGED
|
@@ -77,5 +77,5 @@ export class Run402 {
|
|
|
77
77
|
export function run402(opts) {
|
|
78
78
|
return new Run402(opts);
|
|
79
79
|
}
|
|
80
|
-
export { Run402Error, PaymentRequired, ProjectNotFound, Unauthorized, ApiError, NetworkError, } from "./errors.js";
|
|
80
|
+
export { Run402Error, PaymentRequired, ProjectNotFound, Unauthorized, ApiError, NetworkError, LocalError, } from "./errors.js";
|
|
81
81
|
//# sourceMappingURL=index.js.map
|
package/sdk/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAkC,MAAM,aAAa,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,SAA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I,CAAC,MAAM,CAAC,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC;QACvC,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,IAAmB;IACxC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,OAAO,EACL,WAAW,EACX,eAAe,EACf,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,UAAU,GACX,MAAM,aAAa,CAAC"}
|
|
@@ -33,8 +33,17 @@ export declare class Projects {
|
|
|
33
33
|
/**
|
|
34
34
|
* List active projects for a wallet address. Public endpoint — no auth
|
|
35
35
|
* required, no payment.
|
|
36
|
+
*
|
|
37
|
+
* When `wallet` is omitted, the SDK resolves it from the credential
|
|
38
|
+
* provider's local allowance via `credentials.readAllowance()`. This mirrors
|
|
39
|
+
* the optional-argument shape of {@link Allowance.faucet}.
|
|
40
|
+
*
|
|
41
|
+
* @throws {Run402Error} with `context: "listing projects"` when the
|
|
42
|
+
* argument is omitted and the provider does not implement
|
|
43
|
+
* `readAllowance` (typical for sandbox providers), or when
|
|
44
|
+
* `readAllowance()` returns `null` (no local allowance configured).
|
|
36
45
|
*/
|
|
37
|
-
list(wallet
|
|
46
|
+
list(wallet?: string): Promise<ListProjectsResult>;
|
|
38
47
|
/**
|
|
39
48
|
* Get usage metrics for a project — API calls, storage, tier limits,
|
|
40
49
|
* lease expiry.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/namespaces/projects.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EACV,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,eAAe,EACf,cAAc,EACd,YAAY,EACZ,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAE7B,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C;;;;;;;;OAQG;IACG,SAAS,CAAC,IAAI,GAAE,gBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC;IAyBtE;;;;;;;OAOG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAcvC
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/namespaces/projects.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EACV,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,eAAe,EACf,cAAc,EACd,YAAY,EACZ,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAE7B,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C;;;;;;;;OAQG;IACG,SAAS,CAAC,IAAI,GAAE,gBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC;IAyBtE;;;;;;;OAOG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAcvC;;;;;;;;;;;;OAYG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA8BxD;;;OAGG;IACG,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAUhD;;;OAGG;IACG,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAUlD;;;;;;;;;OASG;IACG,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;IAgC1E;;;;;;;;OAQG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAWzC;;;OAGG;IACG,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC;IAOtC;;;;;OAKG;IACG,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAM5C;;;;;OAKG;IACG,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAM5C;;;;;;OAMG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAapC;;;OAGG;IACG,MAAM,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAKvC"}
|
|
@@ -68,9 +68,32 @@ export class Projects {
|
|
|
68
68
|
/**
|
|
69
69
|
* List active projects for a wallet address. Public endpoint — no auth
|
|
70
70
|
* required, no payment.
|
|
71
|
+
*
|
|
72
|
+
* When `wallet` is omitted, the SDK resolves it from the credential
|
|
73
|
+
* provider's local allowance via `credentials.readAllowance()`. This mirrors
|
|
74
|
+
* the optional-argument shape of {@link Allowance.faucet}.
|
|
75
|
+
*
|
|
76
|
+
* @throws {Run402Error} with `context: "listing projects"` when the
|
|
77
|
+
* argument is omitted and the provider does not implement
|
|
78
|
+
* `readAllowance` (typical for sandbox providers), or when
|
|
79
|
+
* `readAllowance()` returns `null` (no local allowance configured).
|
|
71
80
|
*/
|
|
72
81
|
async list(wallet) {
|
|
73
|
-
|
|
82
|
+
let resolvedWallet = wallet;
|
|
83
|
+
if (resolvedWallet === undefined) {
|
|
84
|
+
const reader = this.client.credentials.readAllowance;
|
|
85
|
+
if (!reader) {
|
|
86
|
+
throw new (class extends Run402Error {
|
|
87
|
+
})("projects.list() with no wallet requires a credential provider that implements readAllowance(). Pass an explicit wallet, or use @run402/sdk/node.", null, null, "listing projects");
|
|
88
|
+
}
|
|
89
|
+
const data = await reader.call(this.client.credentials);
|
|
90
|
+
if (!data) {
|
|
91
|
+
throw new (class extends Run402Error {
|
|
92
|
+
})("No local allowance configured. Run `run402 allowance create`, or pass an explicit wallet.", null, null, "listing projects");
|
|
93
|
+
}
|
|
94
|
+
resolvedWallet = data.address;
|
|
95
|
+
}
|
|
96
|
+
const w = resolvedWallet.toLowerCase();
|
|
74
97
|
return this.client.request(`/wallets/v1/${w}/projects`, {
|
|
75
98
|
context: "listing projects",
|
|
76
99
|
withAuth: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/namespaces/projects.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAc5D,MAAM,OAAO,QAAQ;IACU;IAA7B,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C;;;;;;;;OAQG;IACH,KAAK,CAAC,SAAS,CAAC,OAAyB,EAAE;QACzC,MAAM,IAAI,GAA4B,EAAE,CAAC;QACzC,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;YAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACnD,IAAI,IAA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C,WAAW,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,MAAM;QACV,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC;QACxD,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QACzB,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `sites` namespace — static site deployments
|
|
2
|
+
* `sites` namespace — static site deployments.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `
|
|
4
|
+
* As of v1.32 the inline-bytes deploy path (`POST /deployments/v1` with
|
|
5
|
+
* base64 file blobs) is REMOVED at the gateway (returns 410 Gone). Callers
|
|
6
|
+
* migrate to `NodeSites.deployDir` from `@run402/sdk/node`, which uses the
|
|
7
|
+
* plan/commit transport over `/deploy/v1/plan` + `/deploy/v1/commit`.
|
|
8
|
+
*
|
|
9
|
+
* The isomorphic surface keeps only the public read-only `getDeployment`
|
|
10
|
+
* call. `SiteFile` is preserved for `apps.bundleDeploy` (separate `/deploy/v1`
|
|
11
|
+
* endpoint, unaffected by the v1.32 cutover).
|
|
7
12
|
*/
|
|
8
13
|
import type { Client } from "../kernel.js";
|
|
9
14
|
export interface SiteFile {
|
|
@@ -13,20 +18,13 @@ export interface SiteFile {
|
|
|
13
18
|
data: string;
|
|
14
19
|
encoding?: "utf-8" | "base64";
|
|
15
20
|
}
|
|
16
|
-
export interface SiteDeployOptions {
|
|
17
|
-
/** Files to deploy. Paths are relative to the site root. */
|
|
18
|
-
files: SiteFile[];
|
|
19
|
-
/** Deployment target label, e.g. `"production"`. */
|
|
20
|
-
target?: string;
|
|
21
|
-
/**
|
|
22
|
-
* When true, unchanged files are copied from the previous deployment —
|
|
23
|
-
* only changed/new files need to appear in `files`.
|
|
24
|
-
*/
|
|
25
|
-
inherit?: boolean;
|
|
26
|
-
}
|
|
27
21
|
export interface SiteDeployResult {
|
|
28
22
|
deployment_id: string;
|
|
29
23
|
url: string;
|
|
24
|
+
/** Total bytes across the manifest (present when reported by the gateway). */
|
|
25
|
+
bytes_total?: number;
|
|
26
|
+
/** Bytes uploaded in this deploy (0 on a no-op redeploy). */
|
|
27
|
+
bytes_uploaded?: number;
|
|
30
28
|
}
|
|
31
29
|
export interface DeploymentInfo {
|
|
32
30
|
id: string;
|
|
@@ -40,12 +38,6 @@ export interface DeploymentInfo {
|
|
|
40
38
|
export declare class Sites {
|
|
41
39
|
private readonly client;
|
|
42
40
|
constructor(client: Client);
|
|
43
|
-
/**
|
|
44
|
-
* Deploy a static site. Payment flows through the configured fetch wrapper
|
|
45
|
-
* (x402 in Node when a tier purchase is required; typically free with an
|
|
46
|
-
* active tier).
|
|
47
|
-
*/
|
|
48
|
-
deploy(projectId: string, opts: SiteDeployOptions): Promise<SiteDeployResult>;
|
|
49
41
|
/** Get deployment metadata by id. Public — no project auth. */
|
|
50
42
|
getDeployment(deploymentId: string): Promise<DeploymentInfo>;
|
|
51
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sites.d.ts","sourceRoot":"","sources":["../../src/namespaces/sites.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sites.d.ts","sourceRoot":"","sources":["../../src/namespaces/sites.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,WAAW,QAAQ;IACvB,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,KAAK;IACJ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C,+DAA+D;IACzD,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;CAMnE"}
|
|
@@ -1,32 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `sites` namespace — static site deployments
|
|
2
|
+
* `sites` namespace — static site deployments.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `
|
|
4
|
+
* As of v1.32 the inline-bytes deploy path (`POST /deployments/v1` with
|
|
5
|
+
* base64 file blobs) is REMOVED at the gateway (returns 410 Gone). Callers
|
|
6
|
+
* migrate to `NodeSites.deployDir` from `@run402/sdk/node`, which uses the
|
|
7
|
+
* plan/commit transport over `/deploy/v1/plan` + `/deploy/v1/commit`.
|
|
8
|
+
*
|
|
9
|
+
* The isomorphic surface keeps only the public read-only `getDeployment`
|
|
10
|
+
* call. `SiteFile` is preserved for `apps.bundleDeploy` (separate `/deploy/v1`
|
|
11
|
+
* endpoint, unaffected by the v1.32 cutover).
|
|
7
12
|
*/
|
|
8
13
|
export class Sites {
|
|
9
14
|
client;
|
|
10
15
|
constructor(client) {
|
|
11
16
|
this.client = client;
|
|
12
17
|
}
|
|
13
|
-
/**
|
|
14
|
-
* Deploy a static site. Payment flows through the configured fetch wrapper
|
|
15
|
-
* (x402 in Node when a tier purchase is required; typically free with an
|
|
16
|
-
* active tier).
|
|
17
|
-
*/
|
|
18
|
-
async deploy(projectId, opts) {
|
|
19
|
-
const body = { project: projectId, files: opts.files };
|
|
20
|
-
if (opts.target !== undefined)
|
|
21
|
-
body.target = opts.target;
|
|
22
|
-
if (opts.inherit)
|
|
23
|
-
body.inherit = true;
|
|
24
|
-
return this.client.request("/deployments/v1", {
|
|
25
|
-
method: "POST",
|
|
26
|
-
body,
|
|
27
|
-
context: "deploying site",
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
18
|
/** Get deployment metadata by id. Public — no project auth. */
|
|
31
19
|
async getDeployment(deploymentId) {
|
|
32
20
|
return this.client.request(`/deployments/v1/${deploymentId}`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sites.js","sourceRoot":"","sources":["../../src/namespaces/sites.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sites.js","sourceRoot":"","sources":["../../src/namespaces/sites.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA+BH,MAAM,OAAO,KAAK;IACa;IAA7B,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C,+DAA+D;IAC/D,KAAK,CAAC,aAAa,CAAC,YAAoB;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAiB,mBAAmB,YAAY,EAAE,EAAE;YAC5E,OAAO,EAAE,qBAAqB;YAC9B,QAAQ,EAAE,KAAK;SAChB,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RFC 8785 (JCS) canonical JSON for the v1.32 deploy-plan manifest digest.
|
|
3
|
+
*
|
|
4
|
+
* MUST stay byte-for-byte identical to the gateway's
|
|
5
|
+
* `services/deploy-plans.ts:canonicalizeJson`. A digest mismatch breaks
|
|
6
|
+
* idempotency: the SDK's hash won't match the gateway's, so retrying a
|
|
7
|
+
* plan creates a NEW plan instead of finding the existing one.
|
|
8
|
+
*
|
|
9
|
+
* Spec for our value domain:
|
|
10
|
+
* - object keys sorted ASCII-ascending
|
|
11
|
+
* - arrays comma-separated, no whitespace
|
|
12
|
+
* - strings/numbers via JSON.stringify (matches RFC 8785 for ASCII paths,
|
|
13
|
+
* hex sha256, integer sizes, ASCII content_types)
|
|
14
|
+
*/
|
|
15
|
+
export interface ManifestEntry {
|
|
16
|
+
path: string;
|
|
17
|
+
sha256: string;
|
|
18
|
+
size: number;
|
|
19
|
+
content_type: string;
|
|
20
|
+
}
|
|
21
|
+
export interface Manifest {
|
|
22
|
+
files: ManifestEntry[];
|
|
23
|
+
}
|
|
24
|
+
export declare function canonicalizeJson(value: unknown): string;
|
|
25
|
+
/**
|
|
26
|
+
* Build the canonical manifest object the gateway hashes: `{ files: [...] }`
|
|
27
|
+
* with entries sorted by path and only the four expected keys per entry.
|
|
28
|
+
* `content_type` defaults to `"application/octet-stream"` when absent.
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildCanonicalManifest(entries: Array<{
|
|
31
|
+
path: string;
|
|
32
|
+
sha256: string;
|
|
33
|
+
size: number;
|
|
34
|
+
content_type?: string;
|
|
35
|
+
}>): Manifest;
|
|
36
|
+
/**
|
|
37
|
+
* Compute the hex SHA-256 of the canonical JSON encoding of a manifest.
|
|
38
|
+
* Matches the gateway's `computeManifestDigest`.
|
|
39
|
+
*/
|
|
40
|
+
export declare function computeManifestDigest(manifest: Manifest): Promise<string>;
|
|
41
|
+
//# sourceMappingURL=canonicalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonicalize.d.ts","sourceRoot":"","sources":["../../src/node/canonicalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAavD;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GACpF,QAAQ,CAUV;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAO/E"}
|