@quickback-dev/cli 0.10.15 → 0.10.20
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/dist/commands/compile.d.ts.map +1 -1
- package/dist/commands/compile.js +40 -2
- package/dist/commands/compile.js.map +1 -1
- package/dist/docs/content.js +6 -6
- package/dist/docs/content.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/skill/SKILL.md +142 -1051
- package/dist/skill/agents/quickback-specialist/AGENT.md +36 -0
- package/dist/skill/docs/changelog.md +1192 -0
- package/dist/skill/docs/compiler/claude-code-skill.md +312 -0
- package/dist/skill/docs/compiler/cloud-compiler/authentication.md +63 -0
- package/dist/skill/docs/compiler/cloud-compiler/cli.md +307 -0
- package/dist/skill/docs/compiler/cloud-compiler/endpoints.md +78 -0
- package/dist/skill/docs/compiler/cloud-compiler/index.md +65 -0
- package/dist/skill/docs/compiler/cloud-compiler/local-compiler.md +115 -0
- package/dist/skill/docs/compiler/cloud-compiler/troubleshooting.md +76 -0
- package/dist/skill/docs/compiler/config/agents.md +144 -0
- package/dist/skill/docs/compiler/config/auth.md +109 -0
- package/dist/skill/docs/compiler/config/bindings.md +176 -0
- package/dist/skill/docs/compiler/config/domains.md +149 -0
- package/dist/skill/docs/compiler/config/index.md +419 -0
- package/dist/skill/docs/compiler/config/output.md +338 -0
- package/dist/skill/docs/compiler/config/providers.md +248 -0
- package/dist/skill/docs/compiler/config/security.md +255 -0
- package/dist/skill/docs/compiler/config/single-tenant.md +128 -0
- package/dist/skill/docs/compiler/config/variables.md +157 -0
- package/dist/skill/docs/compiler/definitions/access.md +445 -0
- package/dist/skill/docs/compiler/definitions/actions.md +884 -0
- package/dist/skill/docs/compiler/definitions/concepts.md +52 -0
- package/dist/skill/docs/compiler/definitions/feature.md +164 -0
- package/dist/skill/docs/compiler/definitions/firewall.md +285 -0
- package/dist/skill/docs/compiler/definitions/guards.md +241 -0
- package/dist/skill/docs/compiler/definitions/index.md +219 -0
- package/dist/skill/docs/compiler/definitions/masking.md +241 -0
- package/dist/skill/docs/compiler/definitions/read.md +220 -0
- package/dist/skill/docs/compiler/definitions/schema.md +697 -0
- package/dist/skill/docs/compiler/definitions/validation.md +35 -0
- package/dist/skill/docs/compiler/definitions/views.md +292 -0
- package/dist/skill/docs/compiler/getting-started/claude-code.md +126 -0
- package/dist/skill/docs/compiler/getting-started/full-example.md +431 -0
- package/dist/skill/docs/compiler/getting-started/hand-crafted.md +178 -0
- package/dist/skill/docs/compiler/getting-started/index.md +192 -0
- package/dist/skill/docs/compiler/getting-started/patterns.md +225 -0
- package/dist/skill/docs/compiler/getting-started/template-blog.md +280 -0
- package/dist/skill/docs/compiler/getting-started/template-cloudflare.md +260 -0
- package/dist/skill/docs/compiler/getting-started/template-empty.md +112 -0
- package/dist/skill/docs/compiler/getting-started/templates.md +111 -0
- package/dist/skill/docs/compiler/index.md +85 -0
- package/dist/skill/docs/compiler/targets/hono-api/cloudflare.md +94 -0
- package/dist/skill/docs/compiler/targets/hono-api/database/d1.md +246 -0
- package/dist/skill/docs/compiler/targets/hono-api/database/index.md +16 -0
- package/dist/skill/docs/compiler/targets/hono-api/database/neon.md +144 -0
- package/dist/skill/docs/compiler/targets/hono-api/database/using-d1.md +39 -0
- package/dist/skill/docs/compiler/targets/hono-api/index.md +37 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/actions-api.md +323 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +357 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/caching.md +105 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/crud.md +652 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/errors.md +224 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/index.md +37 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/openapi.md +203 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/query-params.md +199 -0
- package/dist/skill/docs/compiler/targets/hono-api/using-the-api/views-api.md +161 -0
- package/dist/skill/docs/compiler/targets/index.md +47 -0
- package/dist/skill/docs/compiler/targets/supabase-rls/index.md +55 -0
- package/dist/skill/docs/compiler/targets/supabase-rls/limitations.md +48 -0
- package/dist/skill/docs/compiler/targets/supabase-rls/mappings.md +99 -0
- package/dist/skill/docs/compiler/targets/supabase-rls/setup.md +88 -0
- package/dist/skill/docs/compiler/troubleshooting.md +120 -0
- package/dist/skill/docs/index.md +77 -0
- package/dist/skill/docs/stack/account-ui/customization.md +378 -0
- package/dist/skill/docs/stack/account-ui/environment-variables.md +325 -0
- package/dist/skill/docs/stack/account-ui/features/admin.md +76 -0
- package/dist/skill/docs/stack/account-ui/features/api-keys.md +22 -0
- package/dist/skill/docs/stack/account-ui/features/avatars.md +37 -0
- package/dist/skill/docs/stack/account-ui/features/cli-authorize.md +21 -0
- package/dist/skill/docs/stack/account-ui/features/index.md +291 -0
- package/dist/skill/docs/stack/account-ui/features/organizations.md +29 -0
- package/dist/skill/docs/stack/account-ui/features/passkeys.md +31 -0
- package/dist/skill/docs/stack/account-ui/features/passwordless.md +28 -0
- package/dist/skill/docs/stack/account-ui/features/sessions.md +20 -0
- package/dist/skill/docs/stack/account-ui/hooks.md +209 -0
- package/dist/skill/docs/stack/account-ui/index.md +147 -0
- package/dist/skill/docs/stack/account-ui/library-usage.md +257 -0
- package/dist/skill/docs/stack/account-ui/standalone.md +149 -0
- package/dist/skill/docs/stack/account-ui/with-quickback.md +160 -0
- package/dist/skill/docs/stack/account-ui/worker.md +362 -0
- package/dist/skill/docs/stack/auth/api-keys.md +15 -0
- package/dist/skill/docs/stack/auth/device-auth.md +14 -0
- package/dist/skill/docs/stack/auth/index.md +64 -0
- package/dist/skill/docs/stack/auth/jwt-optimization.md +245 -0
- package/dist/skill/docs/stack/auth/plugins/aws-ses.md +127 -0
- package/dist/skill/docs/stack/auth/plugins/combo-auth.md +74 -0
- package/dist/skill/docs/stack/auth/plugins/index.md +228 -0
- package/dist/skill/docs/stack/auth/plugins/upgrade-anonymous.md +155 -0
- package/dist/skill/docs/stack/auth/security.md +455 -0
- package/dist/skill/docs/stack/auth/using-auth.md +39 -0
- package/dist/skill/docs/stack/cms/actions.md +199 -0
- package/dist/skill/docs/stack/cms/components.md +479 -0
- package/dist/skill/docs/stack/cms/connecting.md +199 -0
- package/dist/skill/docs/stack/cms/dashboard.md +39 -0
- package/dist/skill/docs/stack/cms/index.md +158 -0
- package/dist/skill/docs/stack/cms/inline-editing.md +136 -0
- package/dist/skill/docs/stack/cms/pages.md +275 -0
- package/dist/skill/docs/stack/cms/record-layouts.md +151 -0
- package/dist/skill/docs/stack/cms/schema-format.md +437 -0
- package/dist/skill/docs/stack/cms/schema-registry.md +200 -0
- package/dist/skill/docs/stack/cms/security.md +203 -0
- package/dist/skill/docs/stack/cms/table-views.md +142 -0
- package/dist/skill/docs/stack/index.md +65 -0
- package/dist/skill/docs/stack/queues/handlers.md +317 -0
- package/dist/skill/docs/stack/queues/index.md +56 -0
- package/dist/skill/docs/stack/queues/using-queues.md +192 -0
- package/dist/skill/docs/stack/realtime/durable-objects.md +488 -0
- package/dist/skill/docs/stack/realtime/index.md +67 -0
- package/dist/skill/docs/stack/realtime/using-realtime.md +211 -0
- package/dist/skill/docs/stack/storage/index.md +17 -0
- package/dist/skill/docs/stack/storage/kv.md +204 -0
- package/dist/skill/docs/stack/storage/r2.md +232 -0
- package/dist/skill/docs/stack/storage/using-kv.md +70 -0
- package/dist/skill/docs/stack/storage/using-r2.md +55 -0
- package/dist/skill/docs/stack/vector/embeddings.md +554 -0
- package/dist/skill/docs/stack/vector/index.md +44 -0
- package/dist/skill/docs/stack/vector/using-embeddings.md +186 -0
- package/dist/skill/docs/stack/webhooks/inbound.md +186 -0
- package/dist/skill/docs/stack/webhooks/index.md +36 -0
- package/dist/skill/docs/stack/webhooks/outbound.md +281 -0
- package/package.json +1 -1
- package/src/skill/SKILL.md +142 -1051
- package/src/skill/agents/quickback-specialist/AGENT.md +36 -0
- package/src/skill/docs/changelog.md +1192 -0
- package/src/skill/docs/compiler/claude-code-skill.md +312 -0
- package/src/skill/docs/compiler/cloud-compiler/authentication.md +63 -0
- package/src/skill/docs/compiler/cloud-compiler/cli.md +307 -0
- package/src/skill/docs/compiler/cloud-compiler/endpoints.md +78 -0
- package/src/skill/docs/compiler/cloud-compiler/index.md +65 -0
- package/src/skill/docs/compiler/cloud-compiler/local-compiler.md +115 -0
- package/src/skill/docs/compiler/cloud-compiler/troubleshooting.md +76 -0
- package/src/skill/docs/compiler/config/agents.md +144 -0
- package/src/skill/docs/compiler/config/auth.md +109 -0
- package/src/skill/docs/compiler/config/bindings.md +176 -0
- package/src/skill/docs/compiler/config/domains.md +149 -0
- package/src/skill/docs/compiler/config/index.md +419 -0
- package/src/skill/docs/compiler/config/output.md +338 -0
- package/src/skill/docs/compiler/config/providers.md +248 -0
- package/src/skill/docs/compiler/config/security.md +255 -0
- package/src/skill/docs/compiler/config/single-tenant.md +128 -0
- package/src/skill/docs/compiler/config/variables.md +157 -0
- package/src/skill/docs/compiler/definitions/access.md +445 -0
- package/src/skill/docs/compiler/definitions/actions.md +884 -0
- package/src/skill/docs/compiler/definitions/concepts.md +52 -0
- package/src/skill/docs/compiler/definitions/feature.md +164 -0
- package/src/skill/docs/compiler/definitions/firewall.md +285 -0
- package/src/skill/docs/compiler/definitions/guards.md +241 -0
- package/src/skill/docs/compiler/definitions/index.md +219 -0
- package/src/skill/docs/compiler/definitions/masking.md +241 -0
- package/src/skill/docs/compiler/definitions/read.md +220 -0
- package/src/skill/docs/compiler/definitions/schema.md +697 -0
- package/src/skill/docs/compiler/definitions/validation.md +35 -0
- package/src/skill/docs/compiler/definitions/views.md +292 -0
- package/src/skill/docs/compiler/getting-started/claude-code.md +126 -0
- package/src/skill/docs/compiler/getting-started/full-example.md +431 -0
- package/src/skill/docs/compiler/getting-started/hand-crafted.md +178 -0
- package/src/skill/docs/compiler/getting-started/index.md +192 -0
- package/src/skill/docs/compiler/getting-started/patterns.md +225 -0
- package/src/skill/docs/compiler/getting-started/template-blog.md +280 -0
- package/src/skill/docs/compiler/getting-started/template-cloudflare.md +260 -0
- package/src/skill/docs/compiler/getting-started/template-empty.md +112 -0
- package/src/skill/docs/compiler/getting-started/templates.md +111 -0
- package/src/skill/docs/compiler/index.md +85 -0
- package/src/skill/docs/compiler/targets/hono-api/cloudflare.md +94 -0
- package/src/skill/docs/compiler/targets/hono-api/database/d1.md +246 -0
- package/src/skill/docs/compiler/targets/hono-api/database/index.md +16 -0
- package/src/skill/docs/compiler/targets/hono-api/database/neon.md +144 -0
- package/src/skill/docs/compiler/targets/hono-api/database/using-d1.md +39 -0
- package/src/skill/docs/compiler/targets/hono-api/index.md +37 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/actions-api.md +323 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/batch-operations.md +357 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/caching.md +105 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/crud.md +652 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/errors.md +224 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/index.md +37 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/openapi.md +203 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/query-params.md +199 -0
- package/src/skill/docs/compiler/targets/hono-api/using-the-api/views-api.md +161 -0
- package/src/skill/docs/compiler/targets/index.md +47 -0
- package/src/skill/docs/compiler/targets/supabase-rls/index.md +55 -0
- package/src/skill/docs/compiler/targets/supabase-rls/limitations.md +48 -0
- package/src/skill/docs/compiler/targets/supabase-rls/mappings.md +99 -0
- package/src/skill/docs/compiler/targets/supabase-rls/setup.md +88 -0
- package/src/skill/docs/compiler/troubleshooting.md +120 -0
- package/src/skill/docs/index.md +77 -0
- package/src/skill/docs/stack/account-ui/customization.md +378 -0
- package/src/skill/docs/stack/account-ui/environment-variables.md +325 -0
- package/src/skill/docs/stack/account-ui/features/admin.md +76 -0
- package/src/skill/docs/stack/account-ui/features/api-keys.md +22 -0
- package/src/skill/docs/stack/account-ui/features/avatars.md +37 -0
- package/src/skill/docs/stack/account-ui/features/cli-authorize.md +21 -0
- package/src/skill/docs/stack/account-ui/features/index.md +291 -0
- package/src/skill/docs/stack/account-ui/features/organizations.md +29 -0
- package/src/skill/docs/stack/account-ui/features/passkeys.md +31 -0
- package/src/skill/docs/stack/account-ui/features/passwordless.md +28 -0
- package/src/skill/docs/stack/account-ui/features/sessions.md +20 -0
- package/src/skill/docs/stack/account-ui/hooks.md +209 -0
- package/src/skill/docs/stack/account-ui/index.md +147 -0
- package/src/skill/docs/stack/account-ui/library-usage.md +257 -0
- package/src/skill/docs/stack/account-ui/standalone.md +149 -0
- package/src/skill/docs/stack/account-ui/with-quickback.md +160 -0
- package/src/skill/docs/stack/account-ui/worker.md +362 -0
- package/src/skill/docs/stack/auth/api-keys.md +15 -0
- package/src/skill/docs/stack/auth/device-auth.md +14 -0
- package/src/skill/docs/stack/auth/index.md +64 -0
- package/src/skill/docs/stack/auth/jwt-optimization.md +245 -0
- package/src/skill/docs/stack/auth/plugins/aws-ses.md +127 -0
- package/src/skill/docs/stack/auth/plugins/combo-auth.md +74 -0
- package/src/skill/docs/stack/auth/plugins/index.md +228 -0
- package/src/skill/docs/stack/auth/plugins/upgrade-anonymous.md +155 -0
- package/src/skill/docs/stack/auth/security.md +455 -0
- package/src/skill/docs/stack/auth/using-auth.md +39 -0
- package/src/skill/docs/stack/cms/actions.md +199 -0
- package/src/skill/docs/stack/cms/components.md +479 -0
- package/src/skill/docs/stack/cms/connecting.md +199 -0
- package/src/skill/docs/stack/cms/dashboard.md +39 -0
- package/src/skill/docs/stack/cms/index.md +158 -0
- package/src/skill/docs/stack/cms/inline-editing.md +136 -0
- package/src/skill/docs/stack/cms/pages.md +275 -0
- package/src/skill/docs/stack/cms/record-layouts.md +151 -0
- package/src/skill/docs/stack/cms/schema-format.md +437 -0
- package/src/skill/docs/stack/cms/schema-registry.md +200 -0
- package/src/skill/docs/stack/cms/security.md +203 -0
- package/src/skill/docs/stack/cms/table-views.md +142 -0
- package/src/skill/docs/stack/index.md +65 -0
- package/src/skill/docs/stack/queues/handlers.md +317 -0
- package/src/skill/docs/stack/queues/index.md +56 -0
- package/src/skill/docs/stack/queues/using-queues.md +192 -0
- package/src/skill/docs/stack/realtime/durable-objects.md +488 -0
- package/src/skill/docs/stack/realtime/index.md +67 -0
- package/src/skill/docs/stack/realtime/using-realtime.md +211 -0
- package/src/skill/docs/stack/storage/index.md +17 -0
- package/src/skill/docs/stack/storage/kv.md +204 -0
- package/src/skill/docs/stack/storage/r2.md +232 -0
- package/src/skill/docs/stack/storage/using-kv.md +70 -0
- package/src/skill/docs/stack/storage/using-r2.md +55 -0
- package/src/skill/docs/stack/vector/embeddings.md +554 -0
- package/src/skill/docs/stack/vector/index.md +44 -0
- package/src/skill/docs/stack/vector/using-embeddings.md +186 -0
- package/src/skill/docs/stack/webhooks/inbound.md +186 -0
- package/src/skill/docs/stack/webhooks/index.md +36 -0
- package/src/skill/docs/stack/webhooks/outbound.md +281 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Validation
|
|
2
|
+
|
|
3
|
+
## Action Input Validation
|
|
4
|
+
|
|
5
|
+
You can validate input data in custom actions using Zod schemas. The input is validated before the action handler executes:
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
// quickback/features/applications/actions.ts
|
|
9
|
+
import { defineActions } from '@quickback/compiler';
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
|
|
12
|
+
export default defineActions(applications, {
|
|
13
|
+
'advance-stage': {
|
|
14
|
+
description: "Move application to the next pipeline stage",
|
|
15
|
+
input: z.object({
|
|
16
|
+
stage: z.enum(["screening", "interview", "offer", "hired"]),
|
|
17
|
+
notes: z.string().min(1).max(500).optional(),
|
|
18
|
+
}),
|
|
19
|
+
access: { roles: ["owner", "hiring-manager"] },
|
|
20
|
+
execute: async ({ db, record, ctx, input }) => {
|
|
21
|
+
// input is validated against the Zod schema before execution
|
|
22
|
+
return record;
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If validation fails, the API returns a `400 Bad Request` with details about which fields failed.
|
|
29
|
+
|
|
30
|
+
See [Actions](/compiler/definitions/actions) for the full action definition reference.
|
|
31
|
+
|
|
32
|
+
> **Planned: Field-Level Validation**
|
|
33
|
+
>
|
|
34
|
+
> Field-level validation rules in `defineTable()` (e.g., `minLength`, `maxLength`, `enum`) are planned for a future release. Today, use Zod schemas in actions for input validation, and rely on your Drizzle schema constraints (`.notNull()`, column types) for database-level enforcement.
|
|
35
|
+
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
# Views - Column Level Security
|
|
2
|
+
|
|
3
|
+
Views implement **Column Level Security (CLS)** - controlling which columns users can access. This complements **Row Level Security (RLS)** provided by the [Firewall](/compiler/definitions/firewall), which controls which rows users can access.
|
|
4
|
+
|
|
5
|
+
> **Migration note**: views were previously declared at the resource top
|
|
6
|
+
> level (`views: {...}`). In DSL v2 they live under
|
|
7
|
+
> [`read.views`](/compiler/definitions/read#views-under-read-views) so the
|
|
8
|
+
> read pipeline owns its own configuration. The top-level form is rejected
|
|
9
|
+
> at compile time.
|
|
10
|
+
|
|
11
|
+
| Security Layer | Controls | Quickback Feature |
|
|
12
|
+
|----------------|----------|-------------------|
|
|
13
|
+
| Row Level Security | Which records | Firewall |
|
|
14
|
+
| Column Level Security | Which fields | Views |
|
|
15
|
+
|
|
16
|
+
Views provide named field projections with role-based access control. Use views to return different sets of columns to different users without duplicating CRUD endpoints.
|
|
17
|
+
|
|
18
|
+
## When to Use Views
|
|
19
|
+
|
|
20
|
+
| Concept | Purpose | Example |
|
|
21
|
+
|---------|---------|---------|
|
|
22
|
+
| CRUD list | Full records | Returns all columns |
|
|
23
|
+
| Masking | Hide values | Email `j***@c******.com` |
|
|
24
|
+
| Views | Exclude columns | Only `id`, `name`, `source` |
|
|
25
|
+
|
|
26
|
+
- **CRUD list** returns all fields to authorized users
|
|
27
|
+
- **Masking** transforms sensitive values but still includes the column
|
|
28
|
+
- **Views** completely exclude columns from the response
|
|
29
|
+
|
|
30
|
+
## Basic Usage
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
// features/candidates/candidates.ts
|
|
34
|
+
import { sqliteTable, text } from 'drizzle-orm/sqlite-core';
|
|
35
|
+
import { defineTable } from '@quickback/compiler';
|
|
36
|
+
|
|
37
|
+
export const candidates = sqliteTable('candidates', {
|
|
38
|
+
id: text('id').primaryKey(),
|
|
39
|
+
name: text('name').notNull(),
|
|
40
|
+
email: text('email').notNull(),
|
|
41
|
+
phone: text('phone'),
|
|
42
|
+
source: text('source'),
|
|
43
|
+
resumeUrl: text('resume_url'),
|
|
44
|
+
internalNotes: text('internal_notes'),
|
|
45
|
+
organizationId: text('organization_id').notNull(),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export default defineTable(candidates, {
|
|
49
|
+
masking: {
|
|
50
|
+
email: { type: 'email', show: { roles: ['hiring-manager', 'recruiter'] } },
|
|
51
|
+
phone: { type: 'phone', show: { roles: ['hiring-manager', 'recruiter'] } },
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
read: {
|
|
55
|
+
access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
|
|
56
|
+
|
|
57
|
+
// Named field projections
|
|
58
|
+
views: {
|
|
59
|
+
pipeline: {
|
|
60
|
+
fields: ['id', 'name', 'source'],
|
|
61
|
+
access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
|
|
62
|
+
},
|
|
63
|
+
full: {
|
|
64
|
+
fields: ['id', 'name', 'email', 'phone', 'source', 'resumeUrl', 'internalNotes'],
|
|
65
|
+
access: { roles: ['hiring-manager', 'recruiter'] },
|
|
66
|
+
},
|
|
67
|
+
report: {
|
|
68
|
+
fields: ['id', 'name', 'source', 'createdAt'],
|
|
69
|
+
access: { roles: ['owner', 'hiring-manager'] },
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Generated Endpoints
|
|
77
|
+
|
|
78
|
+
Each view generates **two** equivalent GET endpoints — pick whichever is more ergonomic for your client:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
GET /api/v1/candidates # Full read - read.access fields
|
|
82
|
+
GET /api/v1/candidates?view=pipeline # Query-string dispatch
|
|
83
|
+
GET /api/v1/candidates/views/pipeline # Explicit path form
|
|
84
|
+
GET /api/v1/candidates?view=full # hiring-manager/recruiter only
|
|
85
|
+
GET /api/v1/candidates/views/report # report fields
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The `?view=` query-string form is convenient when the rest of your client
|
|
89
|
+
already builds collection URLs and you only need to swap the projection.
|
|
90
|
+
The `/views/{name}` path form is better when you want a stable URL per
|
|
91
|
+
projection.
|
|
92
|
+
|
|
93
|
+
## Query Parameters
|
|
94
|
+
|
|
95
|
+
Views support the same query parameters as the list endpoint:
|
|
96
|
+
|
|
97
|
+
### Pagination
|
|
98
|
+
|
|
99
|
+
| Parameter | Description | Default | Max |
|
|
100
|
+
|-----------|-------------|---------|-----|
|
|
101
|
+
| `limit` | Number of records to return | 50 | 100 |
|
|
102
|
+
| `offset` | Number of records to skip | 0 | - |
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Get first 10 records
|
|
106
|
+
GET /api/v1/candidates/views/pipeline?limit=10
|
|
107
|
+
|
|
108
|
+
# Get records 11-20
|
|
109
|
+
GET /api/v1/candidates/views/pipeline?limit=10&offset=10
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Filtering
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Filter by exact value
|
|
116
|
+
GET /api/v1/candidates/views/pipeline?source=linkedin
|
|
117
|
+
|
|
118
|
+
# Filter with operators
|
|
119
|
+
GET /api/v1/candidates/views/pipeline?createdAt.gt=2024-01-01
|
|
120
|
+
|
|
121
|
+
# Multiple filters (AND logic)
|
|
122
|
+
GET /api/v1/candidates/views/pipeline?source=linkedin&name.like=Smith
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Sorting
|
|
126
|
+
|
|
127
|
+
| Parameter | Description | Default |
|
|
128
|
+
|-----------|-------------|---------|
|
|
129
|
+
| `sort` | Field to sort by | `createdAt` |
|
|
130
|
+
| `order` | Sort direction (`asc` or `desc`) | `desc` |
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
GET /api/v1/candidates/views/pipeline?sort=name&order=asc
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Security
|
|
137
|
+
|
|
138
|
+
All four security pillars apply to views:
|
|
139
|
+
|
|
140
|
+
| Pillar | Behavior |
|
|
141
|
+
|--------|----------|
|
|
142
|
+
| **Firewall** | WHERE clause applied (same as list) |
|
|
143
|
+
| **Access** | Per-view access control |
|
|
144
|
+
| **Guards** | N/A (read-only) |
|
|
145
|
+
| **Masking** | Applied to returned fields |
|
|
146
|
+
|
|
147
|
+
### Firewall
|
|
148
|
+
|
|
149
|
+
Views automatically apply the same firewall conditions as the list endpoint. Users only see records within their organization scope.
|
|
150
|
+
|
|
151
|
+
### Access Control
|
|
152
|
+
|
|
153
|
+
Each view has its own access configuration:
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
read: {
|
|
157
|
+
access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
|
|
158
|
+
views: {
|
|
159
|
+
// Pipeline view - available to all roles
|
|
160
|
+
pipeline: {
|
|
161
|
+
fields: ['id', 'name', 'source'],
|
|
162
|
+
access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
|
|
163
|
+
},
|
|
164
|
+
// Full view - recruiter and above
|
|
165
|
+
full: {
|
|
166
|
+
fields: ['id', 'name', 'source', 'email', 'phone', 'internalNotes'],
|
|
167
|
+
access: { roles: ['hiring-manager', 'recruiter'] },
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Masking
|
|
174
|
+
|
|
175
|
+
Masking rules are applied to the returned fields. If a view includes a masked field like `email`, the masking rules still apply:
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
masking: {
|
|
179
|
+
email: { type: 'email', show: { roles: ['hiring-manager', 'recruiter'] } },
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
read: {
|
|
183
|
+
access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
|
|
184
|
+
views: {
|
|
185
|
+
// Even if an interviewer accesses the 'full' view, email will be masked
|
|
186
|
+
// because masking rules take precedence
|
|
187
|
+
full: {
|
|
188
|
+
fields: ['id', 'name', 'email'],
|
|
189
|
+
access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### How Views and Masking Work Together
|
|
196
|
+
|
|
197
|
+
Views and masking are orthogonal concerns:
|
|
198
|
+
- **Views** control field selection (which columns appear)
|
|
199
|
+
- **Masking** controls field transformation (how values appear based on role)
|
|
200
|
+
|
|
201
|
+
Example configuration:
|
|
202
|
+
|
|
203
|
+
```typescript
|
|
204
|
+
masking: {
|
|
205
|
+
email: { type: 'email', show: { roles: ['hiring-manager', 'recruiter'] } },
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
read: {
|
|
209
|
+
access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
|
|
210
|
+
views: {
|
|
211
|
+
pipeline: {
|
|
212
|
+
fields: ['id', 'name'], // email NOT included
|
|
213
|
+
access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
|
|
214
|
+
},
|
|
215
|
+
full: {
|
|
216
|
+
fields: ['id', 'name', 'email'], // email included
|
|
217
|
+
access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
| Endpoint | Role | `email` in response? | `email` value |
|
|
224
|
+
|----------|------|---------------------|---------------|
|
|
225
|
+
| `/views/pipeline` | interviewer | No | N/A |
|
|
226
|
+
| `/views/pipeline` | recruiter | No | N/A |
|
|
227
|
+
| `/views/full` | interviewer | Yes | `j***@c******.com` |
|
|
228
|
+
| `/views/full` | recruiter | Yes | `jane@company.com` |
|
|
229
|
+
|
|
230
|
+
## Response Format
|
|
231
|
+
|
|
232
|
+
View responses include metadata about the view:
|
|
233
|
+
|
|
234
|
+
```json
|
|
235
|
+
{
|
|
236
|
+
"data": [
|
|
237
|
+
{ "id": "cnd_123", "name": "Jane Doe", "source": "linkedin" },
|
|
238
|
+
{ "id": "cnd_456", "name": "John Smith", "source": "referral" }
|
|
239
|
+
],
|
|
240
|
+
"view": "pipeline",
|
|
241
|
+
"fields": ["id", "name", "source"],
|
|
242
|
+
"pagination": {
|
|
243
|
+
"limit": 50,
|
|
244
|
+
"offset": 0,
|
|
245
|
+
"count": 2
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Complete Example
|
|
251
|
+
|
|
252
|
+
```typescript
|
|
253
|
+
// features/jobs/jobs.ts
|
|
254
|
+
export default defineTable(jobs, {
|
|
255
|
+
guards: {
|
|
256
|
+
createable: ['title', 'department', 'status', 'salaryMin', 'salaryMax'],
|
|
257
|
+
updatable: ['title', 'department', 'status'],
|
|
258
|
+
},
|
|
259
|
+
|
|
260
|
+
masking: {
|
|
261
|
+
salaryMin: { type: 'redact', show: { roles: ['owner', 'hiring-manager'] } },
|
|
262
|
+
salaryMax: { type: 'redact', show: { roles: ['owner', 'hiring-manager'] } },
|
|
263
|
+
},
|
|
264
|
+
|
|
265
|
+
read: {
|
|
266
|
+
access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
|
|
267
|
+
views: {
|
|
268
|
+
// Public job board view
|
|
269
|
+
board: {
|
|
270
|
+
fields: ['id', 'title', 'department', 'status'],
|
|
271
|
+
access: { roles: ['owner', 'hiring-manager', 'recruiter', 'interviewer'] },
|
|
272
|
+
},
|
|
273
|
+
// Internal view with salary info
|
|
274
|
+
internal: {
|
|
275
|
+
fields: ['id', 'title', 'department', 'status', 'salaryMin', 'salaryMax'],
|
|
276
|
+
access: { roles: ['owner', 'hiring-manager'] },
|
|
277
|
+
},
|
|
278
|
+
// Compensation report
|
|
279
|
+
compensation: {
|
|
280
|
+
fields: ['id', 'title', 'department', 'salaryMin', 'salaryMax'],
|
|
281
|
+
access: { roles: ['owner', 'hiring-manager'] },
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
|
|
286
|
+
crud: {
|
|
287
|
+
create: { access: { roles: ['owner', 'hiring-manager'] } },
|
|
288
|
+
update: { access: { roles: ['owner', 'hiring-manager'] } },
|
|
289
|
+
delete: { access: { roles: ['owner', 'hiring-manager'] } },
|
|
290
|
+
},
|
|
291
|
+
});
|
|
292
|
+
```
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# AI Tools
|
|
2
|
+
|
|
3
|
+
The Quickback CLI ships with built-in support for AI developer tools. One install gets you a Claude Code skill, Cursor IDE rules, and an MCP server that works with any AI tool.
|
|
4
|
+
|
|
5
|
+
## MCP Server
|
|
6
|
+
|
|
7
|
+
The MCP server exposes Quickback documentation, project config, and feature definitions to any MCP-compatible AI tool — Claude Desktop, Cursor, VS Code Copilot, Windsurf, and more.
|
|
8
|
+
|
|
9
|
+
### Setup
|
|
10
|
+
|
|
11
|
+
Add to your AI tool's MCP configuration:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"mcpServers": {
|
|
16
|
+
"quickback": {
|
|
17
|
+
"command": "npx",
|
|
18
|
+
"args": ["@quickback-dev/cli", "mcp"]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Where to put this:**
|
|
25
|
+
|
|
26
|
+
| Tool | Config File |
|
|
27
|
+
|------|-------------|
|
|
28
|
+
| Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) |
|
|
29
|
+
| Cursor | `.cursor/mcp.json` in your project root |
|
|
30
|
+
| VS Code (Copilot) | `.vscode/mcp.json` in your project root |
|
|
31
|
+
|
|
32
|
+
### What the MCP Server Provides
|
|
33
|
+
|
|
34
|
+
**Documentation tools:**
|
|
35
|
+
|
|
36
|
+
| Tool | Description |
|
|
37
|
+
|------|-------------|
|
|
38
|
+
| `list_topics` | List all 100+ documentation topics |
|
|
39
|
+
| `get_doc` | Get a specific doc by name (supports fuzzy matching) |
|
|
40
|
+
| `search_docs` | Search documentation content by keyword |
|
|
41
|
+
|
|
42
|
+
**Project-aware tools** (when running inside a Quickback project):
|
|
43
|
+
|
|
44
|
+
| Tool | Description |
|
|
45
|
+
|------|-------------|
|
|
46
|
+
| `read_config` | Read your `quickback.config.ts` |
|
|
47
|
+
| `list_features` | List all features and their table files |
|
|
48
|
+
| `read_feature` | Read the source code of a specific feature |
|
|
49
|
+
| `read_schema_registry` | Read the compiled `schema-registry.json` |
|
|
50
|
+
|
|
51
|
+
The MCP server also registers every documentation topic as an MCP resource at `quickback://docs/{topic}`.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Claude Code Skill
|
|
56
|
+
|
|
57
|
+
The Claude Code skill gives Claude deep knowledge of Quickback's security layers, patterns, and APIs. It also activates a specialist agent for generating complete feature definitions.
|
|
58
|
+
|
|
59
|
+
### Install
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
quickback claude install
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Options:**
|
|
66
|
+
|
|
67
|
+
| Flag | Description |
|
|
68
|
+
|------|-------------|
|
|
69
|
+
| `--global` | Install to `~/.claude/` (available in all projects) |
|
|
70
|
+
| `--local` | Install to `./quickback/.claude/` (project-specific) |
|
|
71
|
+
|
|
72
|
+
### Manage
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
quickback claude status # Check installation
|
|
76
|
+
quickback claude update # Update to latest version
|
|
77
|
+
quickback claude remove # Remove the skill
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### What You Get
|
|
81
|
+
|
|
82
|
+
- **Quickback Skill** — Claude understands `defineTable()`, `defineActions()`, security pillars, provider options, and the compiler workflow
|
|
83
|
+
- **Specialist Agent** — Automatically activates when creating resources, configuring security, or defining actions. Generates complete, working code in your `quickback/features/` directory.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Cursor IDE Rules
|
|
88
|
+
|
|
89
|
+
Cursor rules provide Quickback context directly to Cursor's AI, activated automatically when editing `quickback/**/*.ts` files.
|
|
90
|
+
|
|
91
|
+
### Install
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
quickback cursor install
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
This copies `quickback.mdc` to `.cursor/rules/` in your project. Consider committing this file to your repo so your team gets the rules automatically.
|
|
98
|
+
|
|
99
|
+
### Manage
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
quickback cursor status # Check installation
|
|
103
|
+
quickback cursor update # Update to latest version
|
|
104
|
+
quickback cursor remove # Remove the rules
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Usage Examples
|
|
110
|
+
|
|
111
|
+
With any of these tools installed, you can ask your AI to:
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
"Create a candidates feature with org-scoped firewall and email/phone masking"
|
|
115
|
+
|
|
116
|
+
"Add an 'approve' action to expenses that sets status and records the approver"
|
|
117
|
+
|
|
118
|
+
"Show me the firewall documentation"
|
|
119
|
+
|
|
120
|
+
"What security layers does my current project have configured?"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## See Also
|
|
124
|
+
|
|
125
|
+
- [Claude Code Plugin](/compiler/claude-code-skill) — Full plugin reference
|
|
126
|
+
- [Getting Started](/compiler/getting-started) — Project setup guide
|