@claroshq/claros 0.0.0-stage → 0.8.3
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/LICENSE +21 -0
- package/README.md +16 -2
- package/assets/dashboard/apple-touch-icon.png +0 -0
- package/assets/dashboard/assets/bricolage-grotesque-latin-ext-wght-normal-CcLUaPy7.woff2 +0 -0
- package/assets/dashboard/assets/bricolage-grotesque-latin-wght-normal-DLoelf7F.woff2 +0 -0
- package/assets/dashboard/assets/bricolage-grotesque-vietnamese-wght-normal-BUzh504Q.woff2 +0 -0
- package/assets/dashboard/assets/index-Dvs1k10B.js +23 -0
- package/assets/dashboard/assets/index-gR64IOwq.css +1 -0
- package/assets/dashboard/assets/instrument-sans-latin-ext-wght-normal-B5bTHO_g.woff2 +0 -0
- package/assets/dashboard/assets/instrument-sans-latin-wght-normal-BbzFLZTg.woff2 +0 -0
- package/assets/dashboard/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
- package/assets/dashboard/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
- package/assets/dashboard/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
- package/assets/dashboard/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/assets/dashboard/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/assets/dashboard/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
- package/assets/dashboard/assets/quicksand-latin-ext-wght-normal-CrJ75Ewg.woff2 +0 -0
- package/assets/dashboard/assets/quicksand-latin-wght-normal-Buj9m_3d.woff2 +0 -0
- package/assets/dashboard/assets/quicksand-vietnamese-wght-normal-ei70gACF.woff2 +0 -0
- package/assets/dashboard/claros.js +122 -0
- package/assets/dashboard/favicon-16.png +0 -0
- package/assets/dashboard/favicon-32.png +0 -0
- package/assets/dashboard/favicon.ico +0 -0
- package/assets/dashboard/favicon.svg +17 -0
- package/assets/dashboard/fonts-license.txt +119 -0
- package/assets/dashboard/index.html +34 -0
- package/assets/migrations/0000_baseline.sql +343 -0
- package/assets/migrations/0001_kb_fts.sql +22 -0
- package/assets/migrations/0002_instance_layer.sql +51 -0
- package/assets/migrations/0003_suppressions_lower_email.sql +22 -0
- package/assets/migrations/0004_claim_tokens.sql +9 -0
- package/assets/migrations/0005_topics_transports.sql +36 -0
- package/assets/migrations/0006_ops_alerts.sql +28 -0
- package/assets/migrations/0007_integration_surface.sql +46 -0
- package/assets/migrations/0008_p5_engine.sql +31 -0
- package/assets/migrations/0009_p5b_readiness.sql +11 -0
- package/assets/migrations/meta/0000_snapshot.json +2489 -0
- package/assets/migrations/meta/0002_snapshot.json +2645 -0
- package/assets/migrations/meta/0004_snapshot.json +2698 -0
- package/assets/migrations/meta/0005_snapshot.json +2959 -0
- package/assets/migrations/meta/0006_snapshot.json +3138 -0
- package/assets/migrations/meta/0007_snapshot.json +3469 -0
- package/assets/migrations/meta/0008_snapshot.json +3709 -0
- package/assets/migrations/meta/0009_snapshot.json +3785 -0
- package/assets/migrations/meta/_journal.json +76 -0
- package/assets/worker/index.js +57863 -0
- package/bin/claros.mjs +13 -0
- package/dist/apply.d.ts +10 -0
- package/dist/apply.d.ts.map +1 -0
- package/dist/apply.js +72 -0
- package/dist/apply.js.map +1 -0
- package/dist/assets.d.ts +15 -0
- package/dist/assets.d.ts.map +1 -0
- package/dist/assets.js +48 -0
- package/dist/assets.js.map +1 -0
- package/dist/claim.d.ts +12 -0
- package/dist/claim.d.ts.map +1 -0
- package/dist/claim.js +26 -0
- package/dist/claim.js.map +1 -0
- package/dist/cli.d.ts +13 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +158 -0
- package/dist/cli.js.map +1 -0
- package/dist/cloudflare-api.d.ts +48 -0
- package/dist/cloudflare-api.d.ts.map +1 -0
- package/dist/cloudflare-api.js +94 -0
- package/dist/cloudflare-api.js.map +1 -0
- package/dist/import.d.ts +16 -0
- package/dist/import.d.ts.map +1 -0
- package/dist/import.js +97 -0
- package/dist/import.js.map +1 -0
- package/dist/ops.d.ts +84 -0
- package/dist/ops.d.ts.map +1 -0
- package/dist/ops.js +552 -0
- package/dist/ops.js.map +1 -0
- package/dist/state.d.ts +53 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +87 -0
- package/dist/state.js.map +1 -0
- package/dist/template.d.ts +77 -0
- package/dist/template.d.ts.map +1 -0
- package/dist/template.js +127 -0
- package/dist/template.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +36 -0
- package/dist/version.js.map +1 -0
- package/dist/wrangler.d.ts +116 -0
- package/dist/wrangler.d.ts.map +1 -0
- package/dist/wrangler.js +210 -0
- package/dist/wrangler.js.map +1 -0
- package/package.json +53 -4
package/dist/wrangler.js
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every wrangler call the CLI makes, in one place.
|
|
3
|
+
*
|
|
4
|
+
* `Runner` spawns wrangler with arguments and returns its exit code and
|
|
5
|
+
* output; tests replace it with a fake that simulates a Cloudflare account.
|
|
6
|
+
* `Wrangler` turns the calls into typed results, parsing JSON where wrangler
|
|
7
|
+
* offers `--json` and the plain text output where it does not.
|
|
8
|
+
*/
|
|
9
|
+
import { spawn } from "node:child_process";
|
|
10
|
+
import { createRequire } from "node:module";
|
|
11
|
+
import { dirname, join } from "node:path";
|
|
12
|
+
/** The wrangler bin of the wrangler package this CLI depends on. */
|
|
13
|
+
export function wranglerBin() {
|
|
14
|
+
const require = createRequire(import.meta.url);
|
|
15
|
+
return join(dirname(require.resolve("wrangler/package.json")), "bin", "wrangler.js");
|
|
16
|
+
}
|
|
17
|
+
/** Runs the real wrangler (node <wrangler bin> ...args). */
|
|
18
|
+
export function spawnRunner(bin = wranglerBin()) {
|
|
19
|
+
return (args, opts = {}) => new Promise((resolve, reject) => {
|
|
20
|
+
const child = spawn(process.execPath, [bin, ...args], {
|
|
21
|
+
cwd: opts.cwd,
|
|
22
|
+
env: { ...process.env, ...opts.env },
|
|
23
|
+
stdio: opts.interactive ? "inherit" : ["pipe", "pipe", "pipe"],
|
|
24
|
+
});
|
|
25
|
+
let stdout = "";
|
|
26
|
+
let stderr = "";
|
|
27
|
+
child.stdout?.on("data", (d) => (stdout += d.toString()));
|
|
28
|
+
child.stderr?.on("data", (d) => (stderr += d.toString()));
|
|
29
|
+
child.on("error", reject);
|
|
30
|
+
child.on("close", (code) => resolve({ code: code ?? 1, stdout, stderr }));
|
|
31
|
+
if (!opts.interactive) {
|
|
32
|
+
if (opts.input !== undefined)
|
|
33
|
+
child.stdin?.write(opts.input);
|
|
34
|
+
child.stdin?.end();
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** A wrangler command failed. */
|
|
39
|
+
export class WranglerError extends Error {
|
|
40
|
+
args;
|
|
41
|
+
result;
|
|
42
|
+
constructor(args, result) {
|
|
43
|
+
super(`wrangler ${redactArgs(args).join(" ")} failed (exit ${result.code}):\n${tail(result.stderr || result.stdout)}`);
|
|
44
|
+
this.args = args;
|
|
45
|
+
this.result = result;
|
|
46
|
+
}
|
|
47
|
+
/** stdout and stderr together, for matching known error messages. */
|
|
48
|
+
get output() {
|
|
49
|
+
return `${this.result.stdout}\n${this.result.stderr}`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function tail(text, lines = 20) {
|
|
53
|
+
return text.trim().split("\n").slice(-lines).join("\n");
|
|
54
|
+
}
|
|
55
|
+
/** SQL passed with --command is shown as "<sql>" in errors (it can hold token hashes). */
|
|
56
|
+
function redactArgs(args) {
|
|
57
|
+
return args.map((a, i) => (args[i - 1] === "--command" ? "<sql>" : a));
|
|
58
|
+
}
|
|
59
|
+
/** The first JSON value in wrangler's stdout (banners and warnings can precede it). */
|
|
60
|
+
export function parseJsonOutput(stdout) {
|
|
61
|
+
const start = stdout.search(/[[{]/);
|
|
62
|
+
if (start < 0)
|
|
63
|
+
throw new Error(`expected JSON from wrangler, got: ${tail(stdout, 5)}`);
|
|
64
|
+
return JSON.parse(stdout.slice(start));
|
|
65
|
+
}
|
|
66
|
+
/** Name of the D1 binding in the generated configuration. */
|
|
67
|
+
export const D1_BINDING = "DB";
|
|
68
|
+
/**
|
|
69
|
+
* Tables `d1 export` can write: everything but SQLite and D1 internals and
|
|
70
|
+
* the FTS5 knowledge-base index (kb_fts and its shadow tables), which is
|
|
71
|
+
* rebuilt from kb_entries with `INSERT INTO kb_fts(kb_fts) VALUES('rebuild')`.
|
|
72
|
+
*/
|
|
73
|
+
export const D1_EXPORTABLE_TABLES_SQL = "SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%' AND name NOT LIKE '_cf_%' AND name NOT LIKE 'kb_fts%' ORDER BY name";
|
|
74
|
+
export class Wrangler {
|
|
75
|
+
run;
|
|
76
|
+
ctx;
|
|
77
|
+
constructor(run, ctx = {}) {
|
|
78
|
+
this.run = run;
|
|
79
|
+
this.ctx = ctx;
|
|
80
|
+
}
|
|
81
|
+
/** The same runner bound to an account and a generated configuration file. */
|
|
82
|
+
with(ctx) {
|
|
83
|
+
return new Wrangler(this.run, { ...this.ctx, ...ctx });
|
|
84
|
+
}
|
|
85
|
+
async exec(args, opts = {}) {
|
|
86
|
+
const env = { ...(opts.env ?? {}) };
|
|
87
|
+
if (this.ctx.accountId)
|
|
88
|
+
env.CLOUDFLARE_ACCOUNT_ID = this.ctx.accountId;
|
|
89
|
+
return this.run(args, { ...opts, env, cwd: opts.cwd ?? this.ctx.cwd });
|
|
90
|
+
}
|
|
91
|
+
async ok(args, opts = {}) {
|
|
92
|
+
const res = await this.exec(args, opts);
|
|
93
|
+
if (res.code !== 0)
|
|
94
|
+
throw new WranglerError(args, res);
|
|
95
|
+
return res;
|
|
96
|
+
}
|
|
97
|
+
config() {
|
|
98
|
+
if (!this.ctx.configPath)
|
|
99
|
+
throw new Error("internal: no wrangler configuration for this command");
|
|
100
|
+
return ["--config", this.ctx.configPath];
|
|
101
|
+
}
|
|
102
|
+
async whoami() {
|
|
103
|
+
const res = await this.exec(["whoami", "--json"]);
|
|
104
|
+
if (res.code !== 0)
|
|
105
|
+
return { loggedIn: false, accounts: [] };
|
|
106
|
+
const out = parseJsonOutput(res.stdout);
|
|
107
|
+
return { loggedIn: out.loggedIn !== false, email: out.email, accounts: out.accounts ?? [] };
|
|
108
|
+
}
|
|
109
|
+
async login() {
|
|
110
|
+
await this.ok(["login"], { interactive: true });
|
|
111
|
+
}
|
|
112
|
+
/** The credentials wrangler uses (for the few Cloudflare API reads wrangler has no command for). */
|
|
113
|
+
async authToken() {
|
|
114
|
+
const res = await this.exec(["auth", "token", "--json"]);
|
|
115
|
+
if (res.code !== 0)
|
|
116
|
+
return null;
|
|
117
|
+
return parseJsonOutput(res.stdout);
|
|
118
|
+
}
|
|
119
|
+
async d1List() {
|
|
120
|
+
const res = await this.ok(["d1", "list", "--json"]);
|
|
121
|
+
return parseJsonOutput(res.stdout);
|
|
122
|
+
}
|
|
123
|
+
async d1Create(name) {
|
|
124
|
+
await this.ok(["d1", "create", name]);
|
|
125
|
+
}
|
|
126
|
+
async queueExists(name) {
|
|
127
|
+
const args = ["queues", "info", name];
|
|
128
|
+
const res = await this.exec(args);
|
|
129
|
+
if (res.code === 0)
|
|
130
|
+
return true;
|
|
131
|
+
if (/does not exist/i.test(`${res.stdout}\n${res.stderr}`))
|
|
132
|
+
return false;
|
|
133
|
+
throw new WranglerError(args, res);
|
|
134
|
+
}
|
|
135
|
+
async queueCreate(name) {
|
|
136
|
+
await this.ok(["queues", "create", name]);
|
|
137
|
+
}
|
|
138
|
+
/** Names of the Worker's secrets, or null when the Worker does not exist yet. */
|
|
139
|
+
async secretNames() {
|
|
140
|
+
const args = ["secret", "list", "--format", "json", ...this.config()];
|
|
141
|
+
const res = await this.exec(args);
|
|
142
|
+
if (res.code !== 0) {
|
|
143
|
+
if (/Worker ".*" not found|\b10007\b/.test(`${res.stdout}\n${res.stderr}`))
|
|
144
|
+
return null;
|
|
145
|
+
throw new WranglerError(args, res);
|
|
146
|
+
}
|
|
147
|
+
return parseJsonOutput(res.stdout).map((s) => s.name);
|
|
148
|
+
}
|
|
149
|
+
/** Run SQL on the remote D1 database; one result set per statement. */
|
|
150
|
+
async d1Execute(command) {
|
|
151
|
+
const res = await this.ok(["d1", "execute", D1_BINDING, "--remote", "--json", "--yes", "--command", command, ...this.config()]);
|
|
152
|
+
const out = parseJsonOutput(res.stdout);
|
|
153
|
+
return out.map((r) => r.results ?? []);
|
|
154
|
+
}
|
|
155
|
+
/** Migration files not yet applied to the remote D1 database. */
|
|
156
|
+
async migrationsPending() {
|
|
157
|
+
const res = await this.ok(["d1", "migrations", "list", D1_BINDING, "--remote", ...this.config()]);
|
|
158
|
+
if (/No migrations to apply/i.test(res.stdout))
|
|
159
|
+
return [];
|
|
160
|
+
return [...new Set(res.stdout.match(/\b\d{4}_[\w-]+\.sql\b/g) ?? [])];
|
|
161
|
+
}
|
|
162
|
+
async migrationsApply() {
|
|
163
|
+
await this.ok(["d1", "migrations", "apply", D1_BINDING, "--remote", "--force", ...this.config()]);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* The current D1 Time Travel bookmark of the remote database
|
|
167
|
+
* (`wrangler d1 time-travel info DB --json` prints `{ "bookmark": "..." }`).
|
|
168
|
+
*/
|
|
169
|
+
async d1Bookmark() {
|
|
170
|
+
const res = await this.ok(["d1", "time-travel", "info", D1_BINDING, "--json", ...this.config()]);
|
|
171
|
+
const bookmark = parseJsonOutput(res.stdout).bookmark;
|
|
172
|
+
if (typeof bookmark !== "string" || bookmark === "")
|
|
173
|
+
throw new Error(`wrangler d1 time-travel info returned no bookmark: ${tail(res.stdout, 5)}`);
|
|
174
|
+
return bookmark;
|
|
175
|
+
}
|
|
176
|
+
/** Regular tables of the remote D1 database (no SQLite, D1 or FTS5 internals). */
|
|
177
|
+
async d1ExportableTables() {
|
|
178
|
+
const [rows = []] = await this.d1Execute(D1_EXPORTABLE_TABLES_SQL);
|
|
179
|
+
return rows.map((r) => String(r.name));
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Export the remote D1 database as SQL. `d1 export` refuses databases with
|
|
183
|
+
* virtual tables (FTS5), so callers pass the regular tables to export.
|
|
184
|
+
*/
|
|
185
|
+
async d1Export(outputFile, tables = []) {
|
|
186
|
+
const args = ["d1", "export", D1_BINDING, "--remote", "--skip-confirmation", "--output", outputFile];
|
|
187
|
+
for (const t of tables)
|
|
188
|
+
args.push("--table", t);
|
|
189
|
+
await this.ok([...args, ...this.config()]);
|
|
190
|
+
}
|
|
191
|
+
async deploy(opts = {}) {
|
|
192
|
+
const args = ["deploy", ...this.config()];
|
|
193
|
+
if (opts.secretsFile)
|
|
194
|
+
args.push("--secrets-file", opts.secretsFile);
|
|
195
|
+
const res = await this.ok(args);
|
|
196
|
+
const output = `${res.stdout}\n${res.stderr}`;
|
|
197
|
+
const versionId = /Current Version ID:\s*([0-9a-f-]{8,})/i.exec(output)?.[1] ?? null;
|
|
198
|
+
const urls = [...new Set(output.match(/https:\/\/[a-z0-9.-]+\.[a-z]{2,}/gi) ?? [])];
|
|
199
|
+
return { versionId, urls, output };
|
|
200
|
+
}
|
|
201
|
+
/** Roll the Worker back to a version (the previous one when no id is given). */
|
|
202
|
+
async rollback(versionId, message) {
|
|
203
|
+
const args = ["rollback"];
|
|
204
|
+
if (versionId)
|
|
205
|
+
args.push(versionId);
|
|
206
|
+
args.push("--yes", "--message", message, ...this.config());
|
|
207
|
+
await this.ok(args);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=wrangler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrangler.js","sourceRoot":"","sources":["../src/wrangler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,oB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AAC,SAAwB,EAAE,OAAe;QACtD,MAAM,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;QAC1B,IAAI,SAAS;YAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3D,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claroshq/claros",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.8.3",
|
|
4
|
+
"description": "Deploy and operate Claros on Cloudflare Workers + D1",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"claros",
|
|
7
|
+
"lifecycle-email",
|
|
8
|
+
"email",
|
|
9
|
+
"cloudflare",
|
|
10
|
+
"cloudflare-workers",
|
|
11
|
+
"d1",
|
|
12
|
+
"self-hosted",
|
|
13
|
+
"cli"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/claroshq/claros.git",
|
|
20
|
+
"directory": "packages/cli"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/claroshq/claros/blob/main/docs/install/cloudflare.md",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/claroshq/claros/issues"
|
|
25
|
+
},
|
|
26
|
+
"bin": {
|
|
27
|
+
"claros": "bin/claros.mjs"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"bin",
|
|
31
|
+
"dist",
|
|
32
|
+
"assets"
|
|
33
|
+
],
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=22.0.0"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "tsc --build",
|
|
42
|
+
"typecheck": "tsc --noEmit",
|
|
43
|
+
"test": "vitest run",
|
|
44
|
+
"bundle-assets": "node scripts/bundle-assets.mjs",
|
|
45
|
+
"prepack": "node scripts/bundle-assets.mjs"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"wrangler": "^4.168.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/node": "^22.0.0",
|
|
52
|
+
"typescript": "^5.5.0",
|
|
53
|
+
"vitest": "^1.6.0"
|
|
54
|
+
}
|
|
55
|
+
}
|