@quickback-dev/cli 0.9.5
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/README.md +7 -0
- package/dist/commands/claude.d.ts +13 -0
- package/dist/commands/claude.d.ts.map +1 -0
- package/dist/commands/claude.js +305 -0
- package/dist/commands/claude.js.map +1 -0
- package/dist/commands/compile.d.ts +18 -0
- package/dist/commands/compile.d.ts.map +1 -0
- package/dist/commands/compile.js +326 -0
- package/dist/commands/compile.js.map +1 -0
- package/dist/commands/create.d.ts +18 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +798 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/cursor.d.ts +11 -0
- package/dist/commands/cursor.d.ts.map +1 -0
- package/dist/commands/cursor.js +156 -0
- package/dist/commands/cursor.js.map +1 -0
- package/dist/commands/docs.d.ts +10 -0
- package/dist/commands/docs.d.ts.map +1 -0
- package/dist/commands/docs.js +93 -0
- package/dist/commands/docs.js.map +1 -0
- package/dist/commands/example.d.ts +7 -0
- package/dist/commands/example.d.ts.map +1 -0
- package/dist/commands/example.js +153 -0
- package/dist/commands/example.js.map +1 -0
- package/dist/commands/init.d.ts +6 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +383 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/login.d.ts +16 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +287 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +7 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +19 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/mcp.d.ts +21 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +331 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/whoami.d.ts +7 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +37 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/cursor/quickback.mdc +277 -0
- package/dist/docs/content.d.ts +7 -0
- package/dist/docs/content.d.ts.map +1 -0
- package/dist/docs/content.js +577 -0
- package/dist/docs/content.js.map +1 -0
- package/dist/examples/recruitment.tar.gz +0 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +188 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api-client.d.ts +103 -0
- package/dist/lib/api-client.d.ts.map +1 -0
- package/dist/lib/api-client.js +231 -0
- package/dist/lib/api-client.js.map +1 -0
- package/dist/lib/api-client.test.d.ts +2 -0
- package/dist/lib/api-client.test.d.ts.map +1 -0
- package/dist/lib/api-client.test.js +133 -0
- package/dist/lib/api-client.test.js.map +1 -0
- package/dist/lib/artifact-routing.d.ts +8 -0
- package/dist/lib/artifact-routing.d.ts.map +1 -0
- package/dist/lib/artifact-routing.js +34 -0
- package/dist/lib/artifact-routing.js.map +1 -0
- package/dist/lib/artifact-routing.test.d.ts +2 -0
- package/dist/lib/artifact-routing.test.d.ts.map +1 -0
- package/dist/lib/artifact-routing.test.js +37 -0
- package/dist/lib/artifact-routing.test.js.map +1 -0
- package/dist/lib/async-utils.d.ts +6 -0
- package/dist/lib/async-utils.d.ts.map +1 -0
- package/dist/lib/async-utils.js +26 -0
- package/dist/lib/async-utils.js.map +1 -0
- package/dist/lib/auth.d.ts +55 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +102 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/compiler-stubs.d.ts +108 -0
- package/dist/lib/compiler-stubs.d.ts.map +1 -0
- package/dist/lib/compiler-stubs.js +142 -0
- package/dist/lib/compiler-stubs.js.map +1 -0
- package/dist/lib/drizzle-meta-routing.test.d.ts +2 -0
- package/dist/lib/drizzle-meta-routing.test.d.ts.map +1 -0
- package/dist/lib/drizzle-meta-routing.test.js +123 -0
- package/dist/lib/drizzle-meta-routing.test.js.map +1 -0
- package/dist/lib/file-loader.d.ts +165 -0
- package/dist/lib/file-loader.d.ts.map +1 -0
- package/dist/lib/file-loader.js +577 -0
- package/dist/lib/file-loader.js.map +1 -0
- package/dist/lib/file-loader.test.d.ts +2 -0
- package/dist/lib/file-loader.test.d.ts.map +1 -0
- package/dist/lib/file-loader.test.js +75 -0
- package/dist/lib/file-loader.test.js.map +1 -0
- package/dist/lib/file-writer.d.ts +30 -0
- package/dist/lib/file-writer.d.ts.map +1 -0
- package/dist/lib/file-writer.js +122 -0
- package/dist/lib/file-writer.js.map +1 -0
- package/dist/lib/helpers.d.ts +39 -0
- package/dist/lib/helpers.d.ts.map +1 -0
- package/dist/lib/helpers.js +299 -0
- package/dist/lib/helpers.js.map +1 -0
- package/dist/lib/markdown-renderer.d.ts +8 -0
- package/dist/lib/markdown-renderer.d.ts.map +1 -0
- package/dist/lib/markdown-renderer.js +151 -0
- package/dist/lib/markdown-renderer.js.map +1 -0
- package/dist/lib/shell.d.ts +15 -0
- package/dist/lib/shell.d.ts.map +1 -0
- package/dist/lib/shell.js +32 -0
- package/dist/lib/shell.js.map +1 -0
- package/dist/skill/SKILL.md +887 -0
- package/dist/skill/agents/quickback-specialist/AGENT.md +298 -0
- package/dist/templates/registry.d.ts +36 -0
- package/dist/templates/registry.d.ts.map +1 -0
- package/dist/templates/registry.js +181 -0
- package/dist/templates/registry.js.map +1 -0
- package/package.json +55 -0
- package/src/cursor/quickback.mdc +277 -0
- package/src/examples/recruitment.tar.gz +0 -0
- package/src/skill/SKILL.md +887 -0
- package/src/skill/agents/quickback-specialist/AGENT.md +298 -0
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Quickback API engine - use when defining tables, schemas, security (Firewall, Access, Guards, Masking), actions, views, validation, or deploying Quickback projects
|
|
3
|
+
globs: quickback/**/*.ts
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Quickback
|
|
7
|
+
|
|
8
|
+
Quickback is two things:
|
|
9
|
+
|
|
10
|
+
1. **Compiler** — Transforms declarative TypeScript definitions into secure, production-ready APIs
|
|
11
|
+
2. **Stack** — A Supabase alternative running entirely on Cloudflare (D1, R2, KV, Durable Objects, Queues, Workers AI)
|
|
12
|
+
|
|
13
|
+
The output is standard TypeScript (Hono, Drizzle, Better Auth) running on your own infrastructure.
|
|
14
|
+
|
|
15
|
+
## Project Structure
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
my-app/
|
|
19
|
+
├── quickback/
|
|
20
|
+
│ ├── quickback.config.ts
|
|
21
|
+
│ └── features/
|
|
22
|
+
│ └── {feature-name}/
|
|
23
|
+
│ ├── {table}.ts # Schema + security (defineTable)
|
|
24
|
+
│ ├── actions.ts # Custom actions (optional)
|
|
25
|
+
│ └── handlers/ # Action handlers (optional)
|
|
26
|
+
└── ...
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## quickback.config.ts
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import { defineConfig, defineRuntime, defineDatabase, defineAuth } from '@quickback/compiler';
|
|
33
|
+
|
|
34
|
+
export default defineConfig({
|
|
35
|
+
name: "my-saas-app",
|
|
36
|
+
providers: {
|
|
37
|
+
runtime: defineRuntime("cloudflare"),
|
|
38
|
+
database: defineDatabase("cloudflare-d1"),
|
|
39
|
+
auth: defineAuth("better-auth"),
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Automatic Audit Fields
|
|
45
|
+
|
|
46
|
+
Quickback auto-injects: `createdAt`, `modifiedAt`, `deletedAt`, `createdBy`, `modifiedBy`, `deletedBy`. Do NOT define these in schemas.
|
|
47
|
+
|
|
48
|
+
## defineTable() — Schema + Security
|
|
49
|
+
|
|
50
|
+
Each feature file exports a Drizzle table and a `defineTable()` default export with security config:
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
|
|
54
|
+
import { defineTable } from "@quickback/compiler";
|
|
55
|
+
|
|
56
|
+
export const todos = sqliteTable("todos", {
|
|
57
|
+
id: integer("id").primaryKey(),
|
|
58
|
+
title: text("title").notNull(),
|
|
59
|
+
description: text("description"),
|
|
60
|
+
completed: integer("completed", { mode: "boolean" }).default(false),
|
|
61
|
+
userId: text("user_id").notNull(),
|
|
62
|
+
organizationId: text("organization_id").notNull(),
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export default defineTable(todos, {
|
|
66
|
+
firewall: { organization: {}, owner: {} },
|
|
67
|
+
crud: {
|
|
68
|
+
list: { access: { roles: ["member", "admin"] } },
|
|
69
|
+
get: { access: { roles: ["member", "admin"] } },
|
|
70
|
+
create: { access: { roles: ["member", "admin"] } },
|
|
71
|
+
update: { access: { roles: ["admin"] } },
|
|
72
|
+
delete: { access: { roles: ["admin"] }, mode: "soft" },
|
|
73
|
+
},
|
|
74
|
+
guards: {
|
|
75
|
+
createable: ["title", "description", "completed"],
|
|
76
|
+
updatable: ["title", "description", "completed"],
|
|
77
|
+
},
|
|
78
|
+
masking: {
|
|
79
|
+
userId: { type: "redact", show: { roles: ["admin"] } },
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Four Security Layers
|
|
85
|
+
|
|
86
|
+
Every request passes through: `Request → Firewall → Access → Guards → Database → Masking → Response`
|
|
87
|
+
|
|
88
|
+
### 1. Firewall — Data Isolation
|
|
89
|
+
|
|
90
|
+
Auto WHERE clauses for tenant isolation:
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
firewall: {
|
|
94
|
+
organization: {}, // WHERE organizationId = ctx.activeOrgId
|
|
95
|
+
owner: {}, // AND userId = ctx.userId
|
|
96
|
+
team: {}, // WHERE teamId = ctx.activeTeamId
|
|
97
|
+
softDelete: {}, // AND deletedAt IS NULL
|
|
98
|
+
exception: true, // No filtering (public)
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### 2. Access — Permission Checks
|
|
103
|
+
|
|
104
|
+
Role-based and record-based (deny by default):
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
crud: {
|
|
108
|
+
list: { access: { roles: ['member'] } },
|
|
109
|
+
update: {
|
|
110
|
+
access: {
|
|
111
|
+
or: [
|
|
112
|
+
{ roles: ['admin'] },
|
|
113
|
+
{ record: { createdBy: { equals: '$ctx.userId' } } },
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Operators: `equals`, `notEquals`, `in`, `notIn`, `greaterThan`, `lessThan`
|
|
121
|
+
Context: `$ctx.userId`, `$ctx.activeOrgId`, `$ctx.roles`
|
|
122
|
+
|
|
123
|
+
### 3. Guards — Field Protection
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
guards: {
|
|
127
|
+
createable: ['name', 'description'],
|
|
128
|
+
updatable: ['description'],
|
|
129
|
+
immutable: ['invoiceNumber'],
|
|
130
|
+
protected: { status: ['approve'] }, // Only via named actions
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 4. Masking — PII Redaction
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
masking: {
|
|
138
|
+
ssn: { type: 'ssn', show: { roles: ['admin'] } },
|
|
139
|
+
email: { type: 'email', show: { roles: ['admin'], or: 'owner' } },
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Types: `email`, `phone`, `ssn`, `creditCard`, `name`, `redact`, `custom`
|
|
144
|
+
|
|
145
|
+
## Views — Column Projections
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
views: {
|
|
149
|
+
summary: { fields: ['id', 'name'], access: { roles: ['member'] } },
|
|
150
|
+
full: { fields: ['id', 'name', 'phone', 'ssn'], access: { roles: ['admin'] } },
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Validation
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
validation: {
|
|
158
|
+
name: { minLength: 1, maxLength: 100 },
|
|
159
|
+
capacity: { min: 1, max: 1000 },
|
|
160
|
+
roomType: { enum: ['meeting', 'conference'] },
|
|
161
|
+
email: { email: true },
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Actions — Custom Business Logic
|
|
166
|
+
|
|
167
|
+
Separate `actions.ts` file:
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
import { todos } from './todos';
|
|
171
|
+
import { defineActions } from '@quickback/compiler';
|
|
172
|
+
import { z } from 'zod';
|
|
173
|
+
|
|
174
|
+
export default defineActions(todos, {
|
|
175
|
+
complete: {
|
|
176
|
+
description: "Mark todo as complete",
|
|
177
|
+
input: z.object({ completedAt: z.string().datetime().optional() }),
|
|
178
|
+
guard: { roles: ["member", "admin"] },
|
|
179
|
+
execute: async ({ db, record, ctx, input }) => {
|
|
180
|
+
await db.update(todos).set({ completed: true }).where(eq(todos.id, record.id));
|
|
181
|
+
return { success: true };
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Record-based: `POST /api/v1/{resource}/:id/{action}`
|
|
188
|
+
Standalone: `standalone: true`, custom `path` and `method`
|
|
189
|
+
|
|
190
|
+
### Actions-Only Features (no tables)
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
// quickback/features/utilities/actions.ts
|
|
194
|
+
import { defineActions } from '@quickback/compiler';
|
|
195
|
+
import { z } from 'zod';
|
|
196
|
+
|
|
197
|
+
export default defineActions(null, {
|
|
198
|
+
healthCheck: {
|
|
199
|
+
standalone: true,
|
|
200
|
+
path: "/health",
|
|
201
|
+
method: "GET",
|
|
202
|
+
input: z.object({}),
|
|
203
|
+
guard: { roles: ["member", "admin"] },
|
|
204
|
+
handler: "./handlers/health-check",
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
All actions must have `standalone: true` when there is no table.
|
|
210
|
+
|
|
211
|
+
### Public Actions
|
|
212
|
+
|
|
213
|
+
Use `roles: ["PUBLIC"]` for unauthenticated endpoints. Mandatory audit logged. The wildcard `"*"` is not supported.
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
access: { roles: ["PUBLIC"] } // No auth, audit logged
|
|
217
|
+
access: { roles: ["member"] } // Requires auth + role
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Custom Dependencies
|
|
221
|
+
|
|
222
|
+
```typescript
|
|
223
|
+
export default defineConfig({
|
|
224
|
+
build: {
|
|
225
|
+
dependencies: {
|
|
226
|
+
"fast-xml-parser": "^4.5.0",
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
});
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## CMS Layouts
|
|
233
|
+
|
|
234
|
+
```typescript
|
|
235
|
+
layouts: {
|
|
236
|
+
default: {
|
|
237
|
+
sections: [
|
|
238
|
+
{ label: "Details", columns: 2, fields: ["name", "email"] },
|
|
239
|
+
{ label: "Notes", collapsed: true, fields: ["notes"] },
|
|
240
|
+
],
|
|
241
|
+
},
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## API Reference
|
|
246
|
+
|
|
247
|
+
| Method | Endpoint | Description |
|
|
248
|
+
|--------|----------|-------------|
|
|
249
|
+
| `GET` | `/api/v1/{resource}` | List |
|
|
250
|
+
| `GET` | `/api/v1/{resource}/:id` | Get |
|
|
251
|
+
| `POST` | `/api/v1/{resource}` | Create |
|
|
252
|
+
| `PATCH` | `/api/v1/{resource}/:id` | Update |
|
|
253
|
+
| `DELETE` | `/api/v1/{resource}/:id` | Delete |
|
|
254
|
+
|
|
255
|
+
Query params: `?limit=50&offset=0`, `?status=active`, `?sort=-createdAt`, `?fields=id,name`, `?search=text`
|
|
256
|
+
Filter operators: `.gt`, `.gte`, `.lt`, `.lte`, `.ne`, `.like`, `.in`
|
|
257
|
+
|
|
258
|
+
## Database Dialects
|
|
259
|
+
|
|
260
|
+
| Stack | Import | Table Function |
|
|
261
|
+
|-------|--------|----------------|
|
|
262
|
+
| Cloudflare D1 / SQLite | `drizzle-orm/sqlite-core` | `sqliteTable` |
|
|
263
|
+
| Supabase / PostgreSQL | `drizzle-orm/pg-core` | `pgTable` |
|
|
264
|
+
|
|
265
|
+
## CLI Commands
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
quickback create <template> <name> # Create project
|
|
269
|
+
quickback compile # Compile definitions
|
|
270
|
+
quickback docs [topic] # Show documentation
|
|
271
|
+
quickback claude install # Install Claude Code skill
|
|
272
|
+
quickback cursor install # Install Cursor rules
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## Full Documentation
|
|
276
|
+
|
|
277
|
+
https://docs.quickback.dev
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/docs/content.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAyczC,CAAC;AAEF,eAAO,MAAM,UAAU,UAmHtB,CAAC"}
|