@absolutejs/sync-pack-digest 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,78 @@
1
+ {
2
+ "contract": 1,
3
+ "identity": {
4
+ "accent": "#a855f7",
5
+ "category": "sync",
6
+ "description": "Scheduled per-actor digest pack for `@absolutejs/sync` — one `engine.registerPack(createDigestPack(...))` adds a cron-fired schedule that iterates your actors, builds each one’s digest since their personal cursor, and hands it to your sender (the pack owns cursors and cadence, never transport). Per-actor failures are isolated; `dryRun` previews what would send.",
7
+ "docsUrl": "https://github.com/absolutejs/sync-packs/tree/main/digest",
8
+ "name": "@absolutejs/sync-pack-digest",
9
+ "tagline": "Send everyone a personal summary email on a schedule."
10
+ },
11
+ "settings": {
12
+ "type": "object",
13
+ "properties": {
14
+ "cron": {
15
+ "description": "When digests fire (cron syntax). Default Mondays at 08:00.",
16
+ "examples": [
17
+ "0 8 * * 1"
18
+ ],
19
+ "title": "Digest schedule",
20
+ "type": "string"
21
+ },
22
+ "dryRun": {
23
+ "description": "Build digests but don’t send or advance cursors — preview what the next fire would deliver.",
24
+ "title": "Preview mode",
25
+ "type": "boolean"
26
+ },
27
+ "maxActorsPerFire": {
28
+ "description": "How many people are processed per fire; the rest wait for the next one. Default 1000.",
29
+ "minimum": 1,
30
+ "title": "People per fire",
31
+ "type": "integer"
32
+ },
33
+ "minHoursBetweenDigests": {
34
+ "description": "Someone whose last digest is fresher than this is skipped. Default 168 (one week).",
35
+ "minimum": 0,
36
+ "title": "Minimum hours between digests",
37
+ "type": "number"
38
+ },
39
+ "prefix": {
40
+ "description": "Name prefix for the pack’s cursor table, collection, and schedule.",
41
+ "title": "Name prefix",
42
+ "type": "string"
43
+ }
44
+ }
45
+ },
46
+ "wiring": [
47
+ {
48
+ "description": "Rides @absolutejs/sync’s engine recipe: `engine` is its module-scope binding (mount the scheduled plugin so cron patterns actually fire). Delivery composes with @absolutejs/dispatch or any sender.",
49
+ "id": "default",
50
+ "server": {
51
+ "code": "engine.registerPack(createDigestPack({\n\t// TODO: what goes in one person’s digest since their last one.\n\tbuildDigest: async (actorId, since) => null, // null skips silently\n\t// TODO: who receives digests (your data layer is the source of truth).\n\tlistActors: () => [],\n\t// TODO: deliver it — e.g. dispatcher.email({ to, subject, text }).\n\tsend: async (message) => {},\n\t...${settings}\n}));",
52
+ "imports": [
53
+ {
54
+ "from": "@absolutejs/sync-pack-digest",
55
+ "names": [
56
+ "createDigestPack"
57
+ ]
58
+ }
59
+ ],
60
+ "placement": "module-scope"
61
+ },
62
+ "title": "Register scheduled digests on the sync engine"
63
+ }
64
+ ],
65
+ "tools": {
66
+ "pack_surface": {
67
+ "annotations": {
68
+ "readOnlyHint": true
69
+ },
70
+ "description": "What this digest pack adds to the sync engine: the cursor table it owns, its collection, and the digest schedule with its cron pattern.",
71
+ "input": {
72
+ "type": "object",
73
+ "properties": {}
74
+ },
75
+ "kind": "runtime"
76
+ }
77
+ }
78
+ }
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@absolutejs/sync-pack-digest",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Scheduled per-actor digest pack for @absolutejs/sync — cron-fired, cursor-managed, transport-agnostic",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/absolutejs/sync-packs.git",
8
8
  "directory": "digest"
9
9
  },
10
+ "homepage": "https://github.com/absolutejs/sync-packs/tree/main/digest",
11
+ "bugs": {
12
+ "url": "https://github.com/absolutejs/sync-packs/issues"
13
+ },
10
14
  "main": "./dist/index.js",
11
15
  "module": "./dist/index.js",
12
16
  "types": "./dist/index.d.ts",
@@ -25,7 +29,7 @@
25
29
  "email"
26
30
  ],
27
31
  "scripts": {
28
- "build": "rm -rf dist && bun build src/index.ts --outdir dist --sourcemap --target=bun --external @absolutejs/sync && tsc --project tsconfig.build.json",
32
+ "build": "rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --sourcemap --target=bun --external @absolutejs/sync && tsc --project tsconfig.build.json && absolute-manifest emit",
29
33
  "test": "bun test",
30
34
  "typecheck": "tsc --noEmit",
31
35
  "format": "prettier --write \"./**/*.{ts,json,md}\"",
@@ -45,7 +49,23 @@
45
49
  "types": "./dist/index.d.ts",
46
50
  "import": "./dist/index.js",
47
51
  "default": "./dist/index.js"
48
- }
52
+ },
53
+ "./manifest": {
54
+ "types": "./dist/manifest.d.ts",
55
+ "import": "./dist/manifest.js",
56
+ "default": "./dist/manifest.js"
57
+ },
58
+ "./manifest.json": "./dist/manifest.json"
59
+ },
60
+ "files": [
61
+ "dist",
62
+ "README.md"
63
+ ],
64
+ "absolutejs": {
65
+ "manifestContract": 1
49
66
  },
50
- "files": ["dist", "README.md"]
67
+ "dependencies": {
68
+ "@absolutejs/manifest": "^0.1.0",
69
+ "@sinclair/typebox": "^0.34.0"
70
+ }
51
71
  }