deepspace 0.19.1 → 0.19.2

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/schema.d.ts CHANGED
@@ -62,7 +62,7 @@ interface RolePermissions {
62
62
  create: boolean;
63
63
  update: PermissionLevel;
64
64
  delete: PermissionLevel;
65
- /** If set, only these columns can be updated by this role. */
65
+ /** If set, only these caller-supplied columns can be created or updated by this role. */
66
66
  writableFields?: string[];
67
67
  }
68
68
  interface CollectionSchema {
package/dist/server.d.ts CHANGED
@@ -423,7 +423,7 @@ interface RolePermissions {
423
423
  create: boolean;
424
424
  update: PermissionLevel;
425
425
  delete: PermissionLevel;
426
- /** If set, only these columns can be updated by this role. */
426
+ /** If set, only these caller-supplied columns can be created or updated by this role. */
427
427
  writableFields?: string[];
428
428
  }
429
429
  interface CollectionSchema {
package/dist/worker.d.ts CHANGED
@@ -1000,7 +1000,7 @@ interface RolePermissions {
1000
1000
  create: boolean;
1001
1001
  update: PermissionLevel;
1002
1002
  delete: PermissionLevel;
1003
- /** If set, only these columns can be updated by this role. */
1003
+ /** If set, only these caller-supplied columns can be created or updated by this role. */
1004
1004
  writableFields?: string[];
1005
1005
  }
1006
1006
  interface CollectionSchema {
@@ -21,11 +21,10 @@
21
21
  },
22
22
  "route": {
23
23
  "path": "/admin",
24
- "protected": true
24
+ "protected": true,
25
+ "roles": ["admin"]
25
26
  },
26
27
  "requires": [],
27
- "instructions": [
28
- "This layers an admin-only /admin panel on top of the /settings page that every scaffold already ships (that shared src/schemas/admin-schema.ts is why it reports \"Exists (skipped)\" here). Add a nav entry for /admin; keep /settings for per-user settings."
29
- ],
28
+ "instructions": [],
30
29
  "patterns": []
31
30
  }
@@ -5,10 +5,6 @@
5
5
  "description": "Scheduled background tasks via the per-app CronRoom DO",
6
6
  "details": "Reference implementation of a working cron job. Registers a 1-minute 'heartbeat' task in src/cron.ts (consumed by AppCronRoom at construction time). Each fire is logged to the DO's cron_history table; /cron-log subscribes via useCronMonitor and renders live history. Useful both as a working example and as the basis for the cron e2e spec.",
7
7
  "files": [
8
- {
9
- "src": "src/cron.ts",
10
- "dest": "src/cron.ts"
11
- },
12
8
  {
13
9
  "src": "src/CronLogPage.tsx",
14
10
  "dest": "src/pages/cron-log.tsx"
@@ -19,10 +15,17 @@
19
15
  "protected": false
20
16
  },
21
17
  "requires": [],
18
+ "code": [
19
+ {
20
+ "file": "src/cron.ts",
21
+ "marker": "export const tasks: CronTask[] = []",
22
+ "insert": "tasks.push({ name: 'heartbeat', intervalMinutes: 1 })"
23
+ }
24
+ ],
22
25
  "instructions": [
23
26
  "Deploy the app: npm run deploy",
24
27
  "Within ~90s, visit /cron-log on the deployed app — you should see one new row per minute as the AppCronRoom alarm fires the heartbeat task.",
25
- "Open the page on a desktop browser and look at devtools → Network → WS → /ws/cron/app:<APP_NAME> to see live cron.* protocol frames."
28
+ "Open the page on a desktop browser and inspect /ws/cron/<SCOPE_ID>, where SCOPE_ID is app:<APP_ID> from src/constants.ts; APP_ID is immutable, while APP_NAME is only the mutable URL label."
26
29
  ],
27
30
  "patterns": [
28
31
  "Task config lives in code (src/cron.ts), not JSON. AppCronRoom validates at construction time.",
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Demonstrates:
5
5
  * - 'unclaimed-or-own' permission for claimable tasks
6
- * - writableFields for restricting which fields can be updated
6
+ * - writableFields for restricting which fields can be created or updated
7
7
  * - timestampTrigger for automatic timestamps
8
8
  * - Admin grading workflow
9
9
  */
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * A claimable task system demonstrating:
5
5
  * - 'unclaimed-or-own' permission for claiming unclaimed items
6
- * - writableFields for restricting which fields users can update
6
+ * - writableFields for restricting which fields users can create or update
7
7
  * - timestampTrigger for automatic timestamp fields
8
8
  * - Admin-only grading workflow
9
9
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepspace",
3
- "version": "0.19.1",
3
+ "version": "0.19.2",
4
4
  "engines": {
5
5
  "node": ">=22.15.0 <23 || >=24 <25 || >=26 <27"
6
6
  },
@@ -1,25 +0,0 @@
1
- /**
2
- * Cron task definitions for the heartbeat reference feature.
3
- *
4
- * AppCronRoom (declared in worker.ts) reads `tasks` at construction time
5
- * and validates them. The DO alarm fires `runTask(name, env)` on the
6
- * configured schedule; each fire is recorded in the DO's `cron_history`
7
- * table and pushed to subscribers over `/ws/cron/:roomId`.
8
- *
9
- * The heartbeat task here is the low-cost liveness probe used by both
10
- * the cron e2e spec and as a quick sanity check after a deploy. To add
11
- * your own task, append a {name, intervalMinutes} or {name, schedule,
12
- * timezone} entry to `tasks` and dispatch on `name` inside `runTask`.
13
- */
14
-
15
- import type { CronTask } from 'deepspace/worker'
16
-
17
- export const tasks: CronTask[] = [
18
- { name: 'heartbeat', intervalMinutes: 1 },
19
- ]
20
-
21
- export async function runTask(_name: string, _env: unknown): Promise<void> {
22
- // No-op work — the DO records every invocation in cron_history regardless,
23
- // which is what the e2e spec asserts against. Real apps would dispatch on
24
- // `_name` here and call into integrations / records via buildCronContext.
25
- }