@quickback-dev/cli 0.60.9 → 0.61.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.
Files changed (58) hide show
  1. package/dist/docs/content.d.ts +7 -0
  2. package/dist/docs/content.d.ts.map +1 -0
  3. package/dist/docs/content.js +737 -0
  4. package/dist/docs/content.js.map +1 -0
  5. package/dist/index.js +1 -1
  6. package/dist/lib/helpers.d.ts +39 -0
  7. package/dist/lib/helpers.d.ts.map +1 -0
  8. package/dist/lib/helpers.js +299 -0
  9. package/dist/lib/helpers.js.map +1 -0
  10. package/dist/skill/docs/api/errors.md +1 -0
  11. package/dist/skill/docs/api/query-params.md +26 -0
  12. package/dist/skill/docs/changelog/index.md +79 -0
  13. package/dist/skill/docs/configure/auth.md +17 -12
  14. package/dist/skill/docs/configure/domains.md +1 -1
  15. package/dist/skill/docs/configure/index.md +5 -5
  16. package/dist/skill/docs/define/actions/index.md +18 -0
  17. package/dist/skill/docs/define/areas.md +90 -7
  18. package/dist/skill/docs/define/feature.md +88 -27
  19. package/dist/skill/docs/define/index.md +7 -1
  20. package/dist/skill/docs/define/scopes.md +1 -1
  21. package/dist/skill/docs/define/security.md +10 -0
  22. package/dist/skill/docs/define/transitions.md +11 -35
  23. package/dist/skill/docs/platform/auth/jwt-optimization.md +15 -3
  24. package/dist/skill/docs/platform/database/d1.md +6 -1
  25. package/dist/skill/docs/platform/realtime/index.md +17 -0
  26. package/dist/skill/docs/platform/webhooks/outbound.md +31 -6
  27. package/dist/skill/docs/start/deploy-browser.md +15 -6
  28. package/dist/skill/docs/start/first-api.md +16 -0
  29. package/dist/skill/docs/ui/account/features/admin.md +29 -5
  30. package/dist/skill/docs/ui/account/features/index.md +22 -0
  31. package/dist/skill/docs/ui/admin/connecting.md +6 -4
  32. package/dist/skill/docs/ui/admin/index.md +49 -10
  33. package/dist/skill/docs/ui/admin/security.md +6 -7
  34. package/package.json +1 -1
  35. package/src/skill/docs/api/errors.md +1 -0
  36. package/src/skill/docs/api/query-params.md +26 -0
  37. package/src/skill/docs/changelog/index.md +79 -0
  38. package/src/skill/docs/configure/auth.md +17 -12
  39. package/src/skill/docs/configure/domains.md +1 -1
  40. package/src/skill/docs/configure/index.md +5 -5
  41. package/src/skill/docs/define/actions/index.md +18 -0
  42. package/src/skill/docs/define/areas.md +90 -7
  43. package/src/skill/docs/define/feature.md +88 -27
  44. package/src/skill/docs/define/index.md +7 -1
  45. package/src/skill/docs/define/scopes.md +1 -1
  46. package/src/skill/docs/define/security.md +10 -0
  47. package/src/skill/docs/define/transitions.md +11 -35
  48. package/src/skill/docs/platform/auth/jwt-optimization.md +15 -3
  49. package/src/skill/docs/platform/database/d1.md +6 -1
  50. package/src/skill/docs/platform/realtime/index.md +17 -0
  51. package/src/skill/docs/platform/webhooks/outbound.md +31 -6
  52. package/src/skill/docs/start/deploy-browser.md +15 -6
  53. package/src/skill/docs/start/first-api.md +16 -0
  54. package/src/skill/docs/ui/account/features/admin.md +29 -5
  55. package/src/skill/docs/ui/account/features/index.md +22 -0
  56. package/src/skill/docs/ui/admin/connecting.md +6 -4
  57. package/src/skill/docs/ui/admin/index.md +49 -10
  58. package/src/skill/docs/ui/admin/security.md +6 -7
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/docs/content.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,0DAA0D;AAO1D,MAAM,CAAC,MAAM,IAAI,GAA6B;IAC5C,aAAa,EAAE;QACb,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,gglBAAgglB;KAC5glB;IACD,sBAAsB,EAAE;QACtB,OAAO,EAAE,kBAAkB;QAC3B,SAAS,EAAE,0naAA0na;KACtoa;IACD,aAAa,EAAE;QACb,OAAO,EAAE,iBAAiB;QAC1B,SAAS,EAAE,4xGAA4xG;KACxyG;IACD,UAAU,EAAE;QACV,OAAO,EAAE,gBAAgB;QACzB,SAAS,EAAE,kwsBAAkwsB;KAC9ws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,yBAAyB;IACzB,wBAAwB;IACxB,0BAA0B;IAC1B,mBAAmB;IACnB,sBAAsB;CACvB,CAAC"}
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@
10
10
  */
11
11
  import pc from "picocolors";
12
12
  // Version injected at build time by scripts/inject-version.ts
13
- const CLI_VERSION = "0.60.9";
13
+ const CLI_VERSION = "0.61.0";
14
14
  function getPackageVersion() {
15
15
  return CLI_VERSION;
16
16
  }
@@ -0,0 +1,39 @@
1
+ export type JSONValue = string | number | boolean | null | JSONArray | JSONObject;
2
+ export interface JSONObject {
3
+ [key: string]: JSONValue;
4
+ }
5
+ export interface JSONArray extends Array<JSONValue> {
6
+ }
7
+ export declare function validateBindingName(name: string): string | undefined;
8
+ export declare function updateJSON(filePath: string, mutator: (json: JSONObject) => JSONObject): void;
9
+ export declare function extractFirstBlock(toml: string, header: string): {
10
+ block: string;
11
+ start: number;
12
+ end: number;
13
+ } | null;
14
+ export declare function updateD1Block(toml: string, binding: string, dbName: string): string;
15
+ export declare function appendOrReplaceKvNamespaceBlock(toml: string, binding: string, id?: string): string;
16
+ export declare function appendOrReplaceR2Block(toml: string, binding: string, bucketName: string): string;
17
+ export declare function appendOrReplaceHyperdriveBlock(toml: string, binding: string, id?: string, database?: "hyperdrive-postgres" | "hyperdrive-mysql", connectionString?: string): string;
18
+ export interface DatabaseConfig {
19
+ type: "d1" | "hyperdrive";
20
+ binding: string;
21
+ name?: string;
22
+ id?: string;
23
+ }
24
+ export declare function parseWranglerToml(tomlContent: string): {
25
+ databases: DatabaseConfig[];
26
+ hasMultipleDatabases: boolean;
27
+ };
28
+ export declare function extractD1DatabaseId(wranglerOutput: string): string | null;
29
+ export declare function extractKvNamespaceId(wranglerOutput: string): string | null;
30
+ export declare function extractHyperdriveId(wranglerOutput: string): string | null;
31
+ export declare function updateD1BlockWithId(toml: string, binding: string, dbName: string, databaseId: string): string;
32
+ export declare function updateKvBlockWithId(toml: string, binding: string, namespaceId: string): string;
33
+ export declare function updateHyperdriveBlockWithId(toml: string, binding: string, hyperdriveId: string, connectionString?: string): string;
34
+ export interface GitInitResult {
35
+ success: boolean;
36
+ error?: string;
37
+ }
38
+ export declare function initializeGitRepository(projectPath: string): GitInitResult;
39
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/lib/helpers.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,CAAC;AAClF,MAAM,WAAW,UAAU;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AACD,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,SAAS,CAAC;CAAG;AAEtD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIpE;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,UAAU,QAKrF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;SAK7D;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAa1E;AAED,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,UAezF;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAUvF;AAED,wBAAgB,8BAA8B,CAC1C,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,EAAE,CAAC,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,qBAAqB,GAAG,kBAAkB,EACrD,gBAAgB,CAAC,EAAE,MAAM,UAyB5B;AAED,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,IAAI,GAAG,YAAY,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG;IACpD,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;CACjC,CAgDA;AAGD,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAgCzE;AAED,wBAAgB,oBAAoB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAmB1E;AAED,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA0BzE;AAGD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UA6BpG;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAGrF;AAED,wBAAgB,2BAA2B,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,gBAAgB,CAAC,EAAE,MAAM,UA+B5B;AAED,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,CA2C1E"}
@@ -0,0 +1,299 @@
1
+ export function validateBindingName(name) {
2
+ if (!name || name.trim().length === 0)
3
+ return "Please enter a binding name";
4
+ if (!/^[A-Z0-9_]+$/.test(name))
5
+ return "Use ONLY A-Z, 0-9, and underscores";
6
+ return undefined;
7
+ }
8
+ export function updateJSON(filePath, mutator) {
9
+ const { readFileSync, writeFileSync } = require("fs");
10
+ const json = JSON.parse(readFileSync(filePath, "utf8"));
11
+ const next = mutator(json);
12
+ writeFileSync(filePath, JSON.stringify(next, null, 2));
13
+ }
14
+ export function extractFirstBlock(toml, header) {
15
+ const re = new RegExp(`(\\[\\[${header}\\]\\][\\s\\S]*?)(?=\\n\\[\\[|$)`);
16
+ const match = re.exec(toml);
17
+ if (!match)
18
+ return null;
19
+ return { block: match[1], start: match.index, end: match.index + match[1].length };
20
+ }
21
+ export function updateD1Block(toml, binding, dbName) {
22
+ const found = extractFirstBlock(toml, "d1_databases");
23
+ if (!found)
24
+ return toml;
25
+ let block = found.block;
26
+ if (/binding\s*=\s*"[^"]+"/.test(block)) {
27
+ block = block.replace(/binding\s*=\s*"[^"]+"/, `binding = "${binding}"`);
28
+ }
29
+ else {
30
+ block = block.replace(/\[\[d1_databases\]\]/, `[[d1_databases]]\nbinding = "${binding}"`);
31
+ }
32
+ if (/database_name\s*=\s*"[^"]+"/.test(block)) {
33
+ block = block.replace(/database_name\s*=\s*"[^"]+"/, `database_name = "${dbName}"`);
34
+ }
35
+ return toml.slice(0, found.start) + block + toml.slice(found.end);
36
+ }
37
+ export function appendOrReplaceKvNamespaceBlock(toml, binding, id) {
38
+ const kvBlockRegex = /\[\[kv_namespaces\]\][\s\S]*?(?=(\n\[\[|$))/g;
39
+ const blocks = toml.match(kvBlockRegex) || [];
40
+ const newBlock = [
41
+ "[[kv_namespaces]]",
42
+ `binding = "${binding}"`,
43
+ id ? `id = "${id}"` : `id = "YOUR_KV_NAMESPACE_ID"`,
44
+ ].join("\n");
45
+ const existingIndex = blocks.findIndex(b => b.includes(`binding = "${binding}"`));
46
+ if (existingIndex >= 0) {
47
+ const existing = blocks[existingIndex];
48
+ return toml.replace(existing, newBlock);
49
+ }
50
+ return toml.trimEnd() + "\n\n" + newBlock + "\n";
51
+ }
52
+ export function appendOrReplaceR2Block(toml, binding, bucketName) {
53
+ const r2BlockRegex = /\[\[r2_buckets\]\][\s\S]*?(?=(\n\[\[|$))/g;
54
+ const blocks = toml.match(r2BlockRegex) || [];
55
+ const newBlock = ["[[r2_buckets]]", `binding = "${binding}"`, `bucket_name = "${bucketName}"`].join("\n");
56
+ const existingIndex = blocks.findIndex(b => b.includes(`binding = "${binding}"`));
57
+ if (existingIndex >= 0) {
58
+ const existing = blocks[existingIndex];
59
+ return toml.replace(existing, newBlock);
60
+ }
61
+ return toml.trimEnd() + "\n\n" + newBlock + "\n";
62
+ }
63
+ export function appendOrReplaceHyperdriveBlock(toml, binding, id, database, connectionString) {
64
+ const blockRegex = /\[\[hyperdrive\]\][\s\S]*?(?=(\n\[\[|$))/g;
65
+ const blocks = toml.match(blockRegex) || [];
66
+ // Use provided connection string or fallback to proper local defaults
67
+ let localConnectionString = connectionString || "postgresql://postgres:password@localhost:5432/postgres";
68
+ if (!connectionString && database === "hyperdrive-mysql") {
69
+ localConnectionString = "mysql://root:password@localhost:3306/mysql";
70
+ }
71
+ const placeholderId = id || "YOUR_HYPERDRIVE_ID";
72
+ const newBlock = [
73
+ "[[hyperdrive]]",
74
+ `binding = "${binding}"`,
75
+ `id = "${placeholderId}"`,
76
+ `localConnectionString = "${localConnectionString}"`,
77
+ ].join("\n");
78
+ const existingIndex = blocks.findIndex(b => b.includes(`binding = "${binding}"`));
79
+ if (existingIndex >= 0) {
80
+ const existing = blocks[existingIndex];
81
+ return toml.replace(existing, newBlock);
82
+ }
83
+ return toml.trimEnd() + "\n\n" + newBlock + "\n";
84
+ }
85
+ export function parseWranglerToml(tomlContent) {
86
+ const databases = [];
87
+ // Parse D1 databases
88
+ const d1Regex = /\[\[d1_databases\]\]\s*\n([^[]*?)(?=\n\[|\n$|$)/g;
89
+ let d1Match;
90
+ while ((d1Match = d1Regex.exec(tomlContent)) !== null) {
91
+ const block = d1Match[1];
92
+ const bindingRegex = /binding\s*=\s*"([^"]+)"/;
93
+ const nameRegex = /database_name\s*=\s*"([^"]+)"/;
94
+ const idRegex = /database_id\s*=\s*"([^"]+)"/;
95
+ const bindingMatch = bindingRegex.exec(block);
96
+ const nameMatch = nameRegex.exec(block);
97
+ const idMatch = idRegex.exec(block);
98
+ if (bindingMatch) {
99
+ databases.push({
100
+ type: "d1",
101
+ binding: bindingMatch[1],
102
+ name: nameMatch?.[1],
103
+ id: idMatch?.[1],
104
+ });
105
+ }
106
+ }
107
+ // Parse Hyperdrive databases
108
+ const hyperdriveRegex = /\[\[hyperdrive\]\]\s*\n([^[]*?)(?=\n\[|\n$|$)/g;
109
+ let hyperdriveMatch;
110
+ while ((hyperdriveMatch = hyperdriveRegex.exec(tomlContent)) !== null) {
111
+ const block = hyperdriveMatch[1];
112
+ const bindingRegex = /binding\s*=\s*"([^"]+)"/;
113
+ const idRegex = /id\s*=\s*"([^"]+)"/;
114
+ const bindingMatch = bindingRegex.exec(block);
115
+ const idMatch = idRegex.exec(block);
116
+ if (bindingMatch) {
117
+ databases.push({
118
+ type: "hyperdrive",
119
+ binding: bindingMatch[1],
120
+ id: idMatch?.[1],
121
+ });
122
+ }
123
+ }
124
+ return {
125
+ databases,
126
+ hasMultipleDatabases: databases.length > 1,
127
+ };
128
+ }
129
+ // Functions to extract IDs from wrangler command responses
130
+ export function extractD1DatabaseId(wranglerOutput) {
131
+ try {
132
+ // Look for TOML format: database_id = "uuid"
133
+ const tomlRegex = /database_id\s*=\s*"([^"]+)"/;
134
+ const tomlMatch = tomlRegex.exec(wranglerOutput);
135
+ if (tomlMatch) {
136
+ return tomlMatch[1];
137
+ }
138
+ // Look for JSON response with database_id
139
+ const jsonRegex = /\{[\s\S]*"database_id":\s*"([^"]+)"[\s\S]*\}/;
140
+ const jsonMatch = jsonRegex.exec(wranglerOutput);
141
+ if (jsonMatch) {
142
+ return jsonMatch[1];
143
+ }
144
+ // Parse table format from `wrangler d1 info` command
145
+ // The ID appears in the first row of the table without a label
146
+ const lines = wranglerOutput.split("\n");
147
+ for (const line of lines) {
148
+ // Look for a line that contains a UUID (36 characters with hyphens)
149
+ const uuidRegex = /│\s*([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\s*│/i;
150
+ const uuidMatch = uuidRegex.exec(line);
151
+ if (uuidMatch) {
152
+ return uuidMatch[1];
153
+ }
154
+ }
155
+ return null;
156
+ }
157
+ catch {
158
+ return null;
159
+ }
160
+ }
161
+ export function extractKvNamespaceId(wranglerOutput) {
162
+ try {
163
+ // Look for TOML format: id = "uuid"
164
+ const tomlRegex = /id\s*=\s*"([^"]+)"/;
165
+ const tomlMatch = tomlRegex.exec(wranglerOutput);
166
+ if (tomlMatch) {
167
+ return tomlMatch[1];
168
+ }
169
+ // Fallback: Look for JSON response with id field in KV context
170
+ const jsonRegex = /"id":\s*"([a-f0-9]+)"/;
171
+ const jsonMatch = jsonRegex.exec(wranglerOutput);
172
+ if (jsonMatch) {
173
+ return jsonMatch[1];
174
+ }
175
+ return null;
176
+ }
177
+ catch {
178
+ return null;
179
+ }
180
+ }
181
+ export function extractHyperdriveId(wranglerOutput) {
182
+ try {
183
+ // Look for TOML format: id = "uuid"
184
+ const tomlRegex = /id\s*=\s*"([^"]+)"/;
185
+ const tomlMatch = tomlRegex.exec(wranglerOutput);
186
+ if (tomlMatch) {
187
+ return tomlMatch[1];
188
+ }
189
+ // Fallback: Look for Hyperdrive ID in text format: "id: uuid"
190
+ const textRegex = /id:\s*([a-f0-9-]+)/i;
191
+ const textMatch = textRegex.exec(wranglerOutput);
192
+ if (textMatch) {
193
+ return textMatch[1];
194
+ }
195
+ // Fallback: Look for JSON response with id field
196
+ const jsonRegex = /\{[\s\S]*"id":\s*"([^"]+)"[\s\S]*\}/;
197
+ const jsonMatch = jsonRegex.exec(wranglerOutput);
198
+ if (jsonMatch) {
199
+ return jsonMatch[1];
200
+ }
201
+ return null;
202
+ }
203
+ catch {
204
+ return null;
205
+ }
206
+ }
207
+ // Functions to update TOML with extracted IDs
208
+ export function updateD1BlockWithId(toml, binding, dbName, databaseId) {
209
+ const found = extractFirstBlock(toml, "d1_databases");
210
+ if (!found)
211
+ return toml;
212
+ let block = found.block;
213
+ // Update binding
214
+ if (/binding\s*=\s*"[^"]+"/.test(block)) {
215
+ block = block.replace(/binding\s*=\s*"[^"]+"/, `binding = "${binding}"`);
216
+ }
217
+ else {
218
+ block = block.replace(/\[\[d1_databases\]\]/, `[[d1_databases]]\nbinding = "${binding}"`);
219
+ }
220
+ // Update database_name
221
+ if (/database_name\s*=\s*"[^"]+"/.test(block)) {
222
+ block = block.replace(/database_name\s*=\s*"[^"]+"/, `database_name = "${dbName}"`);
223
+ }
224
+ // Update database_id
225
+ if (/database_id\s*=\s*"[^"]+"/.test(block)) {
226
+ block = block.replace(/database_id\s*=\s*"[^"]+"/, `database_id = "${databaseId}"`);
227
+ }
228
+ else {
229
+ // Add database_id after database_name
230
+ block = block.replace(/database_name\s*=\s*"[^"]+"/, `database_name = "${dbName}"\ndatabase_id = "${databaseId}"`);
231
+ }
232
+ return toml.slice(0, found.start) + block + toml.slice(found.end);
233
+ }
234
+ export function updateKvBlockWithId(toml, binding, namespaceId) {
235
+ // Use the existing appendOrReplaceKvNamespaceBlock but ensure it updates the ID
236
+ return appendOrReplaceKvNamespaceBlock(toml, binding, namespaceId);
237
+ }
238
+ export function updateHyperdriveBlockWithId(toml, binding, hyperdriveId, connectionString) {
239
+ const found = extractFirstBlock(toml, "hyperdrive");
240
+ if (!found)
241
+ return toml;
242
+ let block = found.block;
243
+ // Update id field
244
+ if (/id\s*=\s*"[^"]+"/.test(block)) {
245
+ block = block.replace(/id\s*=\s*"[^"]+"/, `id = "${hyperdriveId}"`);
246
+ }
247
+ else {
248
+ // Add id after binding
249
+ block = block.replace(/binding\s*=\s*"[^"]+"/, `binding = "${binding}"\nid = "${hyperdriveId}"`);
250
+ }
251
+ // Update localConnectionString if provided
252
+ if (connectionString) {
253
+ if (/localConnectionString\s*=\s*"[^"]+"/.test(block)) {
254
+ block = block.replace(/localConnectionString\s*=\s*"[^"]+"/, `localConnectionString = "${connectionString}"`);
255
+ }
256
+ else {
257
+ // Add localConnectionString after id
258
+ block = block.replace(/id\s*=\s*"[^"]+"/, `id = "${hyperdriveId}"\nlocalConnectionString = "${connectionString}"`);
259
+ }
260
+ }
261
+ return toml.slice(0, found.start) + block + toml.slice(found.end);
262
+ }
263
+ export function initializeGitRepository(projectPath) {
264
+ const { spawnSync } = require("child_process");
265
+ // Check if git is available
266
+ const gitCheck = spawnSync("git", ["--version"], { stdio: "pipe", encoding: "utf8" });
267
+ if (gitCheck.status !== 0) {
268
+ return { success: false, error: "Git is not installed or not available in PATH" };
269
+ }
270
+ // Initialize git repository
271
+ const initResult = spawnSync("git", ["init"], {
272
+ cwd: projectPath,
273
+ stdio: "pipe",
274
+ encoding: "utf8",
275
+ });
276
+ if (initResult.status !== 0) {
277
+ return { success: false, error: `Failed to initialize git repository: ${initResult.stderr}` };
278
+ }
279
+ // Add all files to staging
280
+ const addResult = spawnSync("git", ["add", "."], {
281
+ cwd: projectPath,
282
+ stdio: "pipe",
283
+ encoding: "utf8",
284
+ });
285
+ if (addResult.status !== 0) {
286
+ return { success: false, error: `Failed to add files to git: ${addResult.stderr}` };
287
+ }
288
+ // Create initial commit
289
+ const commitResult = spawnSync("git", ["commit", "-m", "Initial commit"], {
290
+ cwd: projectPath,
291
+ stdio: "pipe",
292
+ encoding: "utf8",
293
+ });
294
+ if (commitResult.status !== 0) {
295
+ return { success: false, error: `Failed to create initial commit: ${commitResult.stderr}` };
296
+ }
297
+ return { success: true };
298
+ }
299
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/lib/helpers.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC5C,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KA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E,CAAC,MAAM,CAAC,EAAE;QAC1C,GAAG,EAAE,WAAW;QAChB,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,MAAM;KACnB,CAAC,CAAC;IAEH,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,wCAAwC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC;IAClG,CAAC;IAED,2BAA2B;IAC3B,MAAM,SAAS,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE;QAC7C,GAAG,EAAE,WAAW;QAChB,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,MAAM;KACnB,CAAC,CAAC;IAEH,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,+BAA+B,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC;IACxF,CAAC;IAED,wBAAwB;IACxB,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,gBAAgB,CAAC,EAAE;QACtE,GAAG,EAAE,WAAW;QAChB,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,MAAM;KACnB,CAAC,CAAC;IAEH,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,oCAAoC,YAAY,CAAC,MAAM,EAAE,EAAE,CAAC;IAChG,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC7B,CAAC"}
@@ -98,6 +98,7 @@ Missing or invalid authentication tokens.
98
98
  | `AUTH_EXPIRED` | Token has expired |
99
99
  | `AUTH_RATE_LIMITED` | Too many auth attempts |
100
100
  | `AUTH_SESSION_REQUIRED` | The endpoint requires session (cookie) authentication — returned by `POST /api/v1/token` when called with a JWT, API key, or OAuth bearer, so a stolen or revoked token can't mint its own replacement |
101
+ | `AUTH_REVOCATION_UNAVAILABLE` | **503, retryable.** Only with [`revocationCheck: 'kv'`](/configure/auth#revocationcheck-none--kv--token-revocation-strategy): the bearer's signature verified, but its revocation state could not be read (KV binding missing or unreachable), so it was not trusted. Retry, or authenticate with a session cookie |
101
102
 
102
103
  ### Firewall (403)
103
104
 
@@ -31,6 +31,27 @@ GET /api/v1/jobs?title.like=Engineer
31
31
  GET /api/v1/jobs?department.in=Engineering,Design,Product
32
32
  ```
33
33
 
34
+ ### Unknown filters are rejected, not ignored
35
+
36
+ A filter the handler cannot apply returns `400` (`VALIDATION_INVALID_INPUT`).
37
+ It is never dropped:
38
+
39
+ | Request | Result |
40
+ |---------|--------|
41
+ | `?guestId=g_1` where `guestId` isn't a column | `400` — `Unknown filter field "guestId"` |
42
+ | `?status=open` on a view whose `query.filterable` omits `status` | `400` — `Field "status" is not filterable on this view` |
43
+ | `?title.matches=x` (no such operator) | `400` — `Unknown filter operator "matches"` |
44
+ | `?ssn=123` where `ssn` is masked for your role | `400` — see [Masking](/define/masking) |
45
+
46
+ Silently dropping a predicate would return **every row the firewall allows**
47
+ while still reading as a scoped list — a typo'd or join-table field turns a
48
+ narrow query into a full dump. The same rule closes `?search=` and `?sort=`.
49
+
50
+ > Filtering on a relationship that lives in a join table is not a column filter.
51
+ > `GET /travel-bookings?guestId=...` cannot work when membership is
52
+ > `travel_booking_guests` — expose a view or an `include` for it instead.
53
+
54
+
34
55
  ## Pagination
35
56
 
36
57
  | Parameter | Default | Description |
@@ -110,6 +131,11 @@ GET /api/v1/jobs?sort=title&order=asc
110
131
 
111
132
  When the multi-sort format is detected (comma or `-` prefix), the `order` parameter is ignored.
112
133
 
134
+ A client-supplied `?sort=` naming an unknown column — or one outside a view's
135
+ `query.sortable` — returns `400`, for the same reason unknown filters do: rows
136
+ would come back in some other order that reads as the requested one. A view's
137
+ own `defaultSort` fallback is config, not caller input, and is never rejected.
138
+
113
139
  ## Field Selection
114
140
 
115
141
  Select which columns to return using `?fields=`. Available on LIST and GET routes (not Views — they define their own field set).
@@ -8,6 +8,85 @@ The current release series. Older entries are archived by version range:
8
8
  - [v0.20 – v0.29](/changelog/v0.2x)
9
9
  - [v0.18 and earlier](/changelog/v0.1x)
10
10
 
11
+ ## v0.61.0 — August 12, 2026
12
+
13
+ ### Security: JWT revocation now fails closed when KV is unreachable
14
+
15
+ **Affects projects using `auth.jwt.revocationCheck: 'kv'`** — including every
16
+ project with a `.sealed()` column, which force-enables it.
17
+
18
+ Setting `revocationCheck: 'kv'` asks the verifier to consult current security
19
+ state before trusting a signed bearer. It did the opposite under failure: a
20
+ missing `KV` binding, a failed read, or a corrupt entry all returned "not
21
+ revoked," so a token was accepted during exactly the outage that hid its
22
+ revocation. A banned user's bearer kept working for the rest of its TTL, and
23
+ the one signal that would have caught it was the thing that had broken.
24
+
25
+ The check now returns `active` / `revoked` / `unavailable`, and only `active`
26
+ authenticates the bearer. A corrupt stamp is `unavailable` too — it used to
27
+ parse as `NaN` and compare as "not revoked."
28
+
29
+ **What changes operationally.** A bearer whose revocation state can't be read
30
+ gets a retryable `503 AUTH_REVOCATION_UNAVAILABLE` ([RFC 9457](/api/errors))
31
+ instead of being let through. Recovery is a separate cookie-only request: a
32
+ request carrying `Authorization` has its cookie stripped before session auth,
33
+ so during a KV outage every JWT-bearer request gets the 503 until the client
34
+ retries on its session cookie. One reason-only log line per occurrence carries
35
+ the cause (`missing-binding` / `read-error`) with no token, claim, or KV key in
36
+ it — **alert on it.**
37
+
38
+ This ties bearer-token availability to KV. That is the trade the opt-in now
39
+ makes honestly, and it is the right way round: a revocation check that gives
40
+ up under load is worth nothing. If you want the TTL bound *without* the
41
+ coupling, leave `revocationCheck` at `'none'` and set `expiresIn: 30`.
42
+
43
+ Because the binding is now load-bearing, a project with named `environments`
44
+ must declare `bindings.kv` on **every** target — a compile error naming the
45
+ environment, rather than a 503 discovered after deploy.
46
+
47
+ `revocationCheck: 'none'` output is byte-identical. See
48
+ [`revocationCheck`](/configure/auth#revocationcheck-none--kv--token-revocation-strategy).
49
+
50
+ ### Security: revocation was off by one second
51
+
52
+ **Also affects projects using `auth.jwt.revocationCheck: 'kv'`.**
53
+
54
+ Revocation markers and token mint timestamps were both whole seconds, and the
55
+ check rejected only a token stamped *strictly before* the marker. A token
56
+ minted earlier in the same second as the revocation therefore compared **equal**
57
+ and survived — a sub-second hole in a mechanism whose whole promise is
58
+ "revoked within seconds." Whether an attacker landed in it was a coin flip on
59
+ clock alignment, not on anything defensible.
60
+
61
+ Markers are now epoch milliseconds, tokens carry millisecond companions
62
+ (`iatMs`, and `sctMs` for the relationship-scope proof), and the comparison
63
+ denies a tie. A token minted milliseconds before the revocation is rejected; one
64
+ legitimately re-minted *after* it in that same second is still accepted, which
65
+ is why simply flipping `<` to `<=` on seconds was not the fix.
66
+
67
+ `iat` and `sct` remain standards-compatible unix **seconds** for external
68
+ tooling — the millisecond claims are internal ordering metadata, set by the
69
+ signer from the same clock sample and never accepted from a caller.
70
+
71
+ **Rollout is conservative, not clever.** Marker format is read from an explicit
72
+ version marker, never guessed from magnitude. Where one side is from v0.60.4 or
73
+ earlier — an old token against a new marker, or any token against an old marker
74
+ — there is no sub-second information to compare, so the **entire marker second**
75
+ is revoked. That over-revocation is bounded (old tokens expire within their TTL,
76
+ old markers within the entry lifetime), and it costs the caller a `401` and a
77
+ re-authentication, exactly as any other rejected token does. No action is needed
78
+ upgrading forward.
79
+
80
+ **Do not straddle this release, though.** A worker from before v0.61.0 reads a
81
+ millisecond marker as `NaN` and concludes *not revoked* — it does not recognise
82
+ it as corrupt, so the fail-closed path added above never fires. Rolling back
83
+ across this release, or running two differently-versioned deploy targets against
84
+ one shared KV namespace, means every revocation written by the new version is
85
+ **silently unenforced** by the old one until the entry expires (~19 minutes at
86
+ default settings). Upgrade targets that share a namespace together. If you must
87
+ roll back, treat outstanding bearers as unrevoked for that window: lower
88
+ `expiresIn`, or purge the `qbrev:` keys and re-stamp from the old version.
89
+
11
90
  ## v0.60.4 — August 4, 2026
12
91
 
13
92
  ### Fix: retired-path cleanup was inert in v0.60.1–v0.60.3
@@ -45,7 +45,7 @@ The short version, before the knob-by-knob detail:
45
45
  - **Default: 180-second TTL, auto-refreshed.** Every authenticated call returns a fresh token via the `set-auth-token` header, so the low TTL is invisible to logged-in users. The worst-case window for a stolen or pre-revocation token is 3 minutes — and you can shrink it to 30 seconds with one config line.
46
46
  - **Need revocation faster than the TTL?** Set [`revocationCheck: 'kv'`](#revocationcheck-none--kv--token-revocation-strategy). Revoked tokens are rejected within seconds; revocation stamps are written automatically on user ban, org-member removal, role change, and changes to scope-conferring relationship rows.
47
47
 
48
- Those two knobs — `expiresIn` and `revocationCheck` — cover the vast majority of deployments. The honest residual for the strictest threat models: the KV check revokes per-principal (not per-session), fails open if KV is unreachable (degrading to the TTL bound), and propagates cross-PoP in ~60s. If you need fail-closed, per-session kill semantics, set `expiresIn: 30` for a hard 30-second ceiling — and [tell us about your use case](https://github.com/kardoe/quickback/issues); an opaque-session mode is under consideration.
48
+ Those two knobs — `expiresIn` and `revocationCheck` — cover the vast majority of deployments. The honest residual for the strictest threat models: the KV check revokes per-principal (not per-session) and propagates cross-PoP in ~60s. It **fails closed** — if KV can't be read, the bearer isn't trusted and a bearer-only caller gets a retryable `503`, so enabling it ties bearer availability to KV. If you need per-session kill semantics, set `expiresIn: 30` for a hard 30-second ceiling — and [tell us about your use case](https://github.com/kardoe/quickback/issues); an opaque-session mode is under consideration.
49
49
 
50
50
  ### Behavior recap
51
51
 
@@ -105,11 +105,11 @@ Default `'none'`.
105
105
  | Value | Behavior | Cost per verify |
106
106
  |---|---|---|
107
107
  | `'none'` | No revocation check. Stolen / pre-revocation tokens valid until TTL expires (scope claims: until the carry-forward cap). Use a low `expiresIn` to bound the replay window. | 0 |
108
- | `'kv'` | Fast-path checks per-principal revocation timestamps in the project's existing `KV` binding before trusting a verified token. | 2+ KV reads (~5-15ms, edge-cached) |
108
+ | `'kv'` | Fast-path checks per-principal revocation timestamps in the project's existing `KV` binding before trusting a verified token. Fails closed: an unreadable store means the bearer is not trusted. | 2+ KV reads (~5-15ms, edge-cached) |
109
109
 
110
110
  `'kv'` (v0.45+, **Cloudflare runtime only**) keeps the fast-path stateless against the auth DB (still 0 D1 queries). There is nothing extra to provision — entries ride the `KV` binding every project already has, prefixed `qbrev:` and self-expiring after the maximum token lifetime, so the store never accumulates.
111
111
 
112
- A token is rejected when its mint timestamp (`iat`, or `sct` for the relationship-scope claim) predates the stored timestamp for any principal key it rides on:
112
+ A token is rejected when its mint timestamp (`iat`/`iatMs`, or `sct`/`sctMs` for the relationship-scope claim) is **at or before** the stored timestamp for any principal key it rides on:
113
113
 
114
114
  | Key | Revokes | Written automatically on |
115
115
  |---|---|---|
@@ -122,8 +122,12 @@ A token is rejected when its mint timestamp (`iat`, or `sct` for the relationshi
122
122
  Semantics worth knowing:
123
123
 
124
124
  - **Revoke-on-touch for scopes:** any update or delete of a conferring row stamps the revocation, without evaluating whether the change actually ended the relationship. A false positive just forces a cheap re-prove (`/scope/v1/enter` or a minting namespace route).
125
- - **Fails open:** a missing binding or KV outage skips the check (logged) — revocation degrades to the TTL / carry-forward-cap bound rather than locking every bearer out.
125
+ - **No same-second gap:** markers are stored in epoch milliseconds (written `m<ms>` — an explicit format version, not a magnitude the reader guesses at) and tokens carry millisecond companions (`iatMs` / `sctMs`) alongside the standards-compatible seconds claims, so a token minted a few milliseconds before the revocation is rejected — while one legitimately re-minted *after* it in that same second is still accepted. Tokens and markers written by v0.60.4 or earlier are handled **conservatively**: with no sub-second information on one side, the whole marker second is revoked. That over-revocation is bounded — the last old token expires within its TTL, and the last old marker within the entry lifetime. Like any rejected token it costs the caller a `401`, not a silent recovery: the bearer falls through unauthenticated (its cookie having been stripped, per the next bullet), and the client re-authenticates for a fresh token.
126
+ - **Do not straddle the v0.61.0 upgrade.** A worker from **before** v0.61.0 reads `m<ms>` markers as `NaN` and treats them as *no revocation at all* — not as a corrupt entry. So rolling back across this release, or pointing two differently-versioned deploy targets at one shared KV namespace, means every revocation written by the new version is **silently unenforced** by the old one until the entry expires (`ENTRY_TTL_SECONDS`, ~19 minutes at default settings). Upgrade all targets sharing a namespace together; if you must roll back, treat outstanding bearer tokens as unrevoked for that window — lower `expiresIn`, or purge the `qbrev:` keys and re-stamp from the old version.
127
+ - **Fails closed:** a missing binding, a failed read, or a corrupt entry means the token's revocation state is *unknown* — and an unknown bearer is not authenticated. The caller gets `503 AUTH_REVOCATION_UNAVAILABLE` (RFC 9457, retryable). Recovery is a **separate cookie-only request**: a request carrying `Authorization` has its cookie stripped before session auth, so within that one request there is nothing left to fall back to. Reads are never silently skipped, because the outage that hides a revocation is exactly the moment this check exists for.
128
+ - **Availability coupling:** the flip side of the above. Bearer-token auth now depends on KV being readable. Alert on `AUTH_REVOCATION_UNAVAILABLE`; a sustained rate means the binding is missing on some deployment target, or KV is degraded. Every named environment must declare `bindings.kv` — the compiler rejects a target that doesn't.
126
129
  - **Eventual consistency:** KV propagates cross-PoP in ~60s. "Immediate" means seconds at the writing location, bounded-seconds globally — still far inside the 15-minute carry-forward cap that bounds revocation without this check.
130
+ - **Writes stay best-effort:** the *stamps* are written after the authorization change has already committed (the ban row, the removed membership, the deleted conferring row). A failed stamp does not fail that write — the DB state is the durable cut. It is only the *read* side that fails closed.
127
131
  - **Coverage gap:** batch *hard* deletes don't return rows through the chokepoint; call `revokeScopeTokens` explicitly if you bulk-hard-delete conferring rows.
128
132
 
129
133
  ## Defaults when the JWT surface is enabled
@@ -145,34 +149,35 @@ missing field falls back to its hardcoded value:
145
149
  - **B2C SaaS, mostly browser traffic:** keep defaults. The 180s TTL + auto-refresh model just works.
146
150
  - **Pentest engagement / enterprise compliance:** set `expiresIn: 30`. Tokens stay invisible to logged-in users (auto-refreshed every authed call) but stolen-token windows shrink to 30s.
147
151
  - **CLI-heavy / long-running CI tokens:** `expiresIn: 3600` for one-hour bearer tokens. Pair with `issuer` / `audience` if multiple services consume the same JWT.
148
- - **Need immediate revocation:** set `revocationCheck: 'kv'` (Cloudflare runtime) — revoked tokens are rejected within seconds, and stamps are written automatically on user ban, member removal, role change, and scope-conferring row changes (see the [scope revocation notes](/define/scopes#revocation--ttl)). Or drop TTL to ~30s — similar effect with bounded delay and zero KV reads.
152
+ - **Need immediate revocation:** set `revocationCheck: 'kv'` (Cloudflare runtime) — revoked tokens are rejected within seconds, and stamps are written automatically on user ban, member removal, role change, and scope-conferring row changes (see the [scope revocation notes](/define/scopes#revocation--ttl)). It fails closed, so bearer auth then depends on KV being readable — declare `bindings.kv` on every environment and alert on `AUTH_REVOCATION_UNAVAILABLE`. Or drop TTL to ~30s — similar effect with bounded delay, zero KV reads, and no availability coupling.
149
153
 
150
- ## `auth.loginUrl` / `auth.profileUrl` — external sign-in for consumer Workers
154
+ ## `auth.loginUrl` — external sign-in for consumer Workers
151
155
 
152
- When a Quickback Worker doesn't host its own Account SPA — e.g. an internal-app mesh where one Worker on the parent domain owns identity (`auth.example.com`) and other Workers share cookies — the compiler-emitted CMS access gates need to redirect unauthenticated visitors to the central sign-in surface, not the local `/account/login` (which doesn't exist there).
156
+ When a Quickback Worker doesn't host its own Account SPA — e.g. an internal-app mesh where one Worker on the parent domain owns identity (`auth.example.com`) and other Workers share cookies — the compiler-emitted CMS access gate needs to redirect unauthenticated visitors to the central sign-in surface, not the local `/account/login` (which doesn't exist there).
153
157
 
154
158
  ```ts title="quickback.config.ts"
155
159
  export default defineConfig({
156
160
  // ...
157
161
  auth: {
158
162
  loginUrl: 'https://auth.example.com/login',
159
- profileUrl: 'https://auth.example.com/profile',
160
163
  },
161
164
  });
162
165
  ```
163
166
 
164
- Both fields override compiler-emitted browser redirects in the CMS shell:
165
-
166
167
  - **Unauthenticated visitor hits a CMS route** → `302 → <loginUrl>?redirect=<original-url>`
167
- - **Authenticated user fails the `cms.access: 'admin'` platform-role check** → `302 → <profileUrl>`
168
168
 
169
169
  The `?redirect=…` query param is preserved unchanged so the central sign-in surface can bounce the user back after authentication.
170
170
 
171
+ Signing in is the *only* thing the CMS gate redirects for. A signed-in caller who isn't admitted is served the CMS shell and shown a screen naming what they'd need — see [CMS access](/ui/admin#access-gate). There is no wrong-role redirect, and no `auth.profileUrl`.
172
+
173
+ > **Removed in v0.62:** `auth.profileUrl`. Its only consumer was the CMS wrong-role redirect. The config schema is strict, so a leftover `profileUrl` key now fails the compile — delete it.
174
+
175
+
171
176
  ### Resolution precedence
172
177
 
173
178
  Most-specific wins:
174
179
 
175
- 1. Explicit `auth.loginUrl` / `auth.profileUrl` — the cookie-trusting consumer-Worker case (this section).
180
+ 1. Explicit `auth.loginUrl` — the cookie-trusting consumer-Worker case (this section).
176
181
  2. `https://<account.domain>/login` — inferred when this project hosts its own Account SPA on a custom domain.
177
182
  3. `/account/login` — built-in fallback, when neither knob is set.
178
183
 
@@ -88,7 +88,7 @@ The unified domain is useful for development and debugging. You can override it
88
88
  export default {
89
89
  name: "my-app",
90
90
  template: "hono",
91
- cms: { domain: "cms.example.com", access: "admin" },
91
+ cms: { domain: "cms.example.com", access: "sysadmin" },
92
92
  account: {
93
93
  domain: "auth.example.com",
94
94
  adminDomain: "admin.example.com",