@absolutejs/sync-pack-digest 0.1.0 → 0.2.1

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/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/dist/index.d.ts CHANGED
@@ -127,6 +127,23 @@ export type DigestPackConfig<Ctx = CollectionContext> = {
127
127
  phase: 'buildDigest' | 'send' | 'cursor';
128
128
  error: unknown;
129
129
  }) => void;
130
+ /**
131
+ * When `true`, the schedule builds each digest as usual but does NOT
132
+ * call `send` and does NOT update cursors. Use for hosting QA, preview
133
+ * fires from staging, or "what would the next digest look like?"
134
+ * tooling. Built payloads are surfaced through `onActorPreview` so
135
+ * the host can render them to an admin UI.
136
+ */
137
+ dryRun?: boolean;
138
+ /**
139
+ * Called for each actor whose digest was successfully built, regardless
140
+ * of `dryRun`. In dry-run mode this is the only way to observe what
141
+ * WOULD have been sent. In live mode it fires before `send`.
142
+ */
143
+ onActorPreview?: (info: {
144
+ actorId: string;
145
+ payload: DigestPayload;
146
+ }) => void;
130
147
  };
131
148
  /**
132
149
  * Build a {@link SyncPack} that exposes scheduled per-actor digests. Each
package/dist/index.js CHANGED
@@ -53,7 +53,7 @@ var createDigestPack = (config) => {
53
53
  name: "@absolutejs/sync-pack-digest",
54
54
  ownsTables: [table],
55
55
  readsTables: [],
56
- version: "0.1.0",
56
+ version: "0.2.0",
57
57
  schemas: defineSchema({
58
58
  [table]: {
59
59
  fields: {
@@ -143,6 +143,11 @@ var createDigestPack = (config) => {
143
143
  if (payload === null) {
144
144
  continue;
145
145
  }
146
+ config.onActorPreview?.({ actorId, payload });
147
+ if (config.dryRun === true) {
148
+ processed++;
149
+ continue;
150
+ }
146
151
  try {
147
152
  await config.send(payload);
148
153
  } catch (error) {
@@ -185,5 +190,5 @@ export {
185
190
  createDigestPack
186
191
  };
187
192
 
188
- //# debugId=AE598FAB1C126FB164756E2164756E21
193
+ //# debugId=4FECC5659F9B261864756E2164756E21
189
194
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
4
  "sourcesContent": [
5
- "/**\n * `@absolutejs/sync-pack-digest` — scheduled per-actor digest pack for\n * `@absolutejs/sync`.\n *\n * Cron-fires a schedule that iterates the host's actor list, asks the host\n * to build a digest payload for each actor since their last cursor, and\n * dispatches it through a host-provided `send` adapter. Owns one table\n * (`digest_cursors`) with one row per actor; nothing else.\n *\n * Per-actor failures are caught and logged so one bad send doesn't block\n * the rest. The whole-handler retry shim from sync 1.9.0 is wired but off\n * by default (digest fires are usually fine to skip on transient infra\n * failures — the next cron fire catches up).\n *\n * @example\n * ```ts\n * import { createSyncEngine } from '@absolutejs/sync/engine';\n * import { createDigestPack } from '@absolutejs/sync-pack-digest';\n *\n * const engine = createSyncEngine();\n * engine.registerPack(createDigestPack({\n * cron: '0 8 * * 1', // Mondays 8am\n * listActors: () => db.users.allActiveIds(),\n * buildDigest: async (actorId, since) => {\n * const items = await db.feed.since(actorId, since ?? new Date(0));\n * if (items.length === 0) return null;\n * return {\n * to: await db.users.email(actorId),\n * subject: `Your weekly digest`,\n * body: render(items),\n * };\n * },\n * send: async (msg) => await resend.send(msg),\n * }));\n * ```\n */\n\nimport {\n\tdefineCollection,\n\tdefineSchedule,\n\tdefineSchema,\n\tdefineSyncPack,\n\tfield,\n\ttype CollectionContext,\n\ttype RetryPolicy,\n\ttype SyncPack,\n\ttype TableReader,\n\ttype TableWriter\n} from '@absolutejs/sync/engine';\n\n/** One row per actor — created on first successful send, updated after each. */\nexport type DigestCursor = {\n\t/** Row id (= actorId). */\n\tid: string;\n\tactorId: string;\n\t/** Epoch ms of the most recent successful send. */\n\tlastSentAt: number;\n\t/** Subject line of the most recent successful send (for observability). */\n\tlastSubject: string;\n};\n\n/** The payload the host's `buildDigest` returns. Returning `null` skips. */\nexport type DigestPayload = {\n\tto: string;\n\tsubject: string;\n\tbody: string;\n};\n\n/** Storage adapter the pack uses for the cursors table. */\nexport type DigestStore = {\n\treader: TableReader<CollectionContext>;\n\twriter: TableWriter<DigestCursor, CollectionContext, unknown>;\n\tgetById: (id: string) => DigestCursor | undefined;\n};\n\n/** Default in-memory store. */\nexport const createInMemoryDigestStore = (): DigestStore => {\n\tconst rows = new Map<string, DigestCursor>();\n\treturn {\n\t\tgetById: (id) => rows.get(id),\n\t\treader: {\n\t\t\tall: () => [...rows.values()]\n\t\t},\n\t\twriter: {\n\t\t\tdelete: (row) => {\n\t\t\t\trows.delete((row as { id: string }).id);\n\t\t\t},\n\t\t\tinsert: (data) => {\n\t\t\t\trows.set(data.id, data);\n\t\t\t\treturn data;\n\t\t\t},\n\t\t\tupdate: (data) => {\n\t\t\t\tconst prior = rows.get(data.id);\n\t\t\t\tconst merged = { ...(prior ?? {}), ...data } as DigestCursor;\n\t\t\t\trows.set(data.id, merged);\n\t\t\t\treturn merged;\n\t\t\t}\n\t\t}\n\t};\n};\n\nconst DEFAULT_CRON = '0 8 * * 1';\nconst DEFAULT_MAX_ACTORS_PER_FIRE = 1000;\nconst DEFAULT_MIN_HOURS_BETWEEN_DIGESTS = 168;\n\n/** Factory config. `send`, `buildDigest`, and `listActors` are required. */\nexport type DigestPackConfig<Ctx = CollectionContext> = {\n\t/**\n\t * Prefix applied to the owned table name AND every collection/schedule\n\t * the pack exposes. Default `\"\"`.\n\t */\n\tprefix?: string;\n\t/**\n\t * Cron pattern for the digest fire (`@elysiajs/cron` / croner syntax).\n\t * Default `\"0 8 * * 1\"` (Mondays 08:00).\n\t */\n\tcron?: string;\n\t/**\n\t * Host-supplied email sender. The pack does NOT own transport (no SMTP\n\t * client, no Resend/SES/Postmark dep). Throws are caught per-actor.\n\t */\n\tsend: (msg: DigestPayload) => Promise<void>;\n\t/**\n\t * Build the digest payload for one actor. `since` is the actor's last\n\t * successful send timestamp, or `null` if they've never received one.\n\t * Return `null` to skip this fire silently (no content for this actor).\n\t */\n\tbuildDigest: (\n\t\tactorId: string,\n\t\tsince: Date | null\n\t) => Promise<DigestPayload | null>;\n\t/**\n\t * Yield the actor ids the schedule should iterate per fire. The host's\n\t * own data layer is the source of truth for \"who exists\" — the pack\n\t * just maintains per-actor cursors.\n\t */\n\tlistActors: () =>\n\t\t| Iterable<string>\n\t\t| Promise<Iterable<string>>;\n\t/**\n\t * Cap on actors processed per fire (back-pressure). The rest wait for\n\t * the next cron fire. Default `1000`.\n\t */\n\tmaxActorsPerFire?: number;\n\t/**\n\t * Minimum hours between digests for a given actor. An actor whose\n\t * cursor is fresher than this is skipped on the fire. Default `168`\n\t * (one week — matches the weekly default cron).\n\t */\n\tminHoursBetweenDigests?: number;\n\t/**\n\t * Extract the current actor id from ctx — used to scope the cursor\n\t * collection so each actor sees their own row. Default\n\t * `(ctx) => ctx.userId`.\n\t */\n\tgetActorId?: (ctx: Ctx) => string | undefined;\n\t/**\n\t * Outer schedule retry policy. The pack catches per-actor failures\n\t * already, so this only retries the whole handler on classified\n\t * transient infrastructure failures (e.g. DB serialization). Default\n\t * undefined — digest fires miss skip on infra failure and catch up\n\t * next cron.\n\t */\n\tretry?: RetryPolicy;\n\t/** Override the storage adapter. Default: per-instance in-memory. */\n\tstore?: DigestStore;\n\t/** Wall-clock function. Default `Date.now`. */\n\tnow?: () => number;\n\t/**\n\t * Hook for surfacing per-actor failures. Defaults to `console.error`.\n\t * The pack swallows the error after this call so the schedule keeps\n\t * going for the rest of the actor list.\n\t */\n\tonActorFailure?: (info: {\n\t\tactorId: string;\n\t\tphase: 'buildDigest' | 'send' | 'cursor';\n\t\terror: unknown;\n\t}) => void;\n};\n\nconst resolveActor = (\n\tgetActorId: NonNullable<DigestPackConfig['getActorId']>,\n\tctx: unknown\n): string | undefined => getActorId(ctx as CollectionContext);\n\n/**\n * Build a {@link SyncPack} that exposes scheduled per-actor digests. Each\n * call returns a fresh pack with its own cursor store (unless overridden).\n */\nexport const createDigestPack = <Ctx = CollectionContext>(\n\tconfig: DigestPackConfig<Ctx>\n): SyncPack => {\n\tconst prefix = config.prefix ?? '';\n\tconst table = `${prefix}digest_cursors`;\n\tconst collectionName = table;\n\tconst scheduleName = `${prefix}digest:fire`;\n\tconst cron = config.cron ?? DEFAULT_CRON;\n\tconst maxActorsPerFire =\n\t\tconfig.maxActorsPerFire ?? DEFAULT_MAX_ACTORS_PER_FIRE;\n\tconst minIntervalMs =\n\t\t(config.minHoursBetweenDigests ??\n\t\t\tDEFAULT_MIN_HOURS_BETWEEN_DIGESTS) *\n\t\t60 *\n\t\t60 *\n\t\t1000;\n\tconst store = config.store ?? createInMemoryDigestStore();\n\tconst now = config.now ?? Date.now;\n\tconst getActorId = (config.getActorId ??\n\t\t((ctx: CollectionContext) =>\n\t\t\t(ctx as { userId?: string }).userId)) as (\n\t\tctx: CollectionContext\n\t) => string | undefined;\n\tconst onActorFailure =\n\t\tconfig.onActorFailure ??\n\t\t((info) => {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error(\n\t\t\t\t`[sync-pack-digest] actor \"${info.actorId}\" failed at ${info.phase}:`,\n\t\t\t\tinfo.error\n\t\t\t);\n\t\t});\n\n\tconst pack: SyncPack = {\n\t\tname: '@absolutejs/sync-pack-digest',\n\t\townsTables: [table],\n\t\treadsTables: [],\n\t\tversion: '0.1.0',\n\n\t\tschemas: defineSchema({\n\t\t\t[table]: {\n\t\t\t\tfields: {\n\t\t\t\t\tid: field.string,\n\t\t\t\t\tactorId: field.string,\n\t\t\t\t\tlastSentAt: field.number,\n\t\t\t\t\tlastSubject: field.string\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\n\t\treaders: { [table]: store.reader },\n\t\twriters: { [table]: store.writer },\n\n\t\tpermissions: {\n\t\t\t[table]: {\n\t\t\t\t// Each actor sees only their own cursor — the cursor row\n\t\t\t\t// surfaces \"your last digest was at X\" to the user without\n\t\t\t\t// leaking other actors' state. Hosts who want a global\n\t\t\t\t// admin view register their own permissions on top.\n\t\t\t\tread: (ctx: unknown, row: DigestCursor) => {\n\t\t\t\t\tconst callerId = resolveActor(getActorId, ctx);\n\t\t\t\t\treturn callerId !== undefined && row.actorId === callerId;\n\t\t\t\t},\n\t\t\t\t// Writes flow only through the pack's schedule; deny\n\t\t\t\t// outside writers by stamping actorId === caller, which\n\t\t\t\t// fails for any non-actor (the schedule runs trusted and\n\t\t\t\t// bypasses these checks).\n\t\t\t\tinsert: (ctx: unknown, row: DigestCursor) => {\n\t\t\t\t\tconst callerId = resolveActor(getActorId, ctx);\n\t\t\t\t\treturn callerId !== undefined && row.actorId === callerId;\n\t\t\t\t},\n\t\t\t\tupdate: (ctx: unknown, row: DigestCursor) => {\n\t\t\t\t\tconst callerId = resolveActor(getActorId, ctx);\n\t\t\t\t\treturn callerId !== undefined && row.actorId === callerId;\n\t\t\t\t},\n\t\t\t\tdelete: (ctx: unknown, row: DigestCursor) => {\n\t\t\t\t\tconst callerId = resolveActor(getActorId, ctx);\n\t\t\t\t\tif (callerId === undefined) return false;\n\t\t\t\t\tif ((row as { actorId?: string }).actorId !== undefined) {\n\t\t\t\t\t\treturn (row as { actorId: string }).actorId === callerId;\n\t\t\t\t\t}\n\t\t\t\t\tconst id = (row as { id?: string }).id;\n\t\t\t\t\tif (id === undefined) return false;\n\t\t\t\t\treturn store.getById(id)?.actorId === callerId;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tcollections: [\n\t\t\tdefineCollection<DigestCursor, void, CollectionContext>({\n\t\t\t\tname: collectionName,\n\t\t\t\ttables: [table],\n\t\t\t\tkey: (row) => row.id,\n\t\t\t\thydrate: (_params, ctx) => {\n\t\t\t\t\tconst callerId = resolveActor(getActorId, ctx);\n\t\t\t\t\tif (callerId === undefined) return [];\n\t\t\t\t\treturn (store.reader.all(ctx) as DigestCursor[]).filter(\n\t\t\t\t\t\t(row) => row.actorId === callerId\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tmatch: (row, _params, ctx) => {\n\t\t\t\t\tconst callerId = resolveActor(getActorId, ctx);\n\t\t\t\t\treturn (\n\t\t\t\t\t\tcallerId !== undefined && row.actorId === callerId\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tauthorize: (_params, ctx) =>\n\t\t\t\t\tresolveActor(getActorId, ctx) !== undefined\n\t\t\t})\n\t\t],\n\n\t\tschedules: [\n\t\t\tdefineSchedule({\n\t\t\t\tname: scheduleName,\n\t\t\t\tpattern: cron,\n\t\t\t\t...(config.retry !== undefined ? { retry: config.retry } : {}),\n\t\t\t\trun: async ({ actions }) => {\n\t\t\t\t\tconst t = now();\n\t\t\t\t\tconst actors = await config.listActors();\n\t\t\t\t\tlet processed = 0;\n\t\t\t\t\tfor (const actorId of actors) {\n\t\t\t\t\t\tif (processed >= maxActorsPerFire) break;\n\t\t\t\t\t\tconst cursor = store.getById(actorId);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tcursor !== undefined &&\n\t\t\t\t\t\t\tt - cursor.lastSentAt < minIntervalMs\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Not yet due for this actor.\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet payload: DigestPayload | null;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst since =\n\t\t\t\t\t\t\t\tcursor === undefined\n\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t: new Date(cursor.lastSentAt);\n\t\t\t\t\t\t\tpayload = await config.buildDigest(actorId, since);\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tonActorFailure({\n\t\t\t\t\t\t\t\tactorId,\n\t\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t\tphase: 'buildDigest'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (payload === null) {\n\t\t\t\t\t\t\t// Host signalled no content for this actor — skip\n\t\t\t\t\t\t\t// without bumping the cursor.\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait config.send(payload);\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tonActorFailure({\n\t\t\t\t\t\t\t\tactorId,\n\t\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t\tphase: 'send'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tprocessed++;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst next: DigestCursor = {\n\t\t\t\t\t\t\t\tid: actorId,\n\t\t\t\t\t\t\t\tactorId,\n\t\t\t\t\t\t\t\tlastSentAt: t,\n\t\t\t\t\t\t\t\tlastSubject: payload.subject\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (cursor === undefined) {\n\t\t\t\t\t\t\t\tawait actions.insert(table, next);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tawait actions.update(table, next);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t// The email already went out — losing the cursor\n\t\t\t\t\t\t\t// update means the actor may double-receive on\n\t\t\t\t\t\t\t// the next fire. We log so the operator sees it.\n\t\t\t\t\t\t\tonActorFailure({\n\t\t\t\t\t\t\t\tactorId,\n\t\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t\tphase: 'cursor'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t]\n\t};\n\n\treturn defineSyncPack(pack);\n};\n"
5
+ "/**\n * `@absolutejs/sync-pack-digest` — scheduled per-actor digest pack for\n * `@absolutejs/sync`.\n *\n * Cron-fires a schedule that iterates the host's actor list, asks the host\n * to build a digest payload for each actor since their last cursor, and\n * dispatches it through a host-provided `send` adapter. Owns one table\n * (`digest_cursors`) with one row per actor; nothing else.\n *\n * Per-actor failures are caught and logged so one bad send doesn't block\n * the rest. The whole-handler retry shim from sync 1.9.0 is wired but off\n * by default (digest fires are usually fine to skip on transient infra\n * failures — the next cron fire catches up).\n *\n * @example\n * ```ts\n * import { createSyncEngine } from '@absolutejs/sync/engine';\n * import { createDigestPack } from '@absolutejs/sync-pack-digest';\n *\n * const engine = createSyncEngine();\n * engine.registerPack(createDigestPack({\n * cron: '0 8 * * 1', // Mondays 8am\n * listActors: () => db.users.allActiveIds(),\n * buildDigest: async (actorId, since) => {\n * const items = await db.feed.since(actorId, since ?? new Date(0));\n * if (items.length === 0) return null;\n * return {\n * to: await db.users.email(actorId),\n * subject: `Your weekly digest`,\n * body: render(items),\n * };\n * },\n * send: async (msg) => await resend.send(msg),\n * }));\n * ```\n */\n\nimport {\n\tdefineCollection,\n\tdefineSchedule,\n\tdefineSchema,\n\tdefineSyncPack,\n\tfield,\n\ttype CollectionContext,\n\ttype RetryPolicy,\n\ttype SyncPack,\n\ttype TableReader,\n\ttype TableWriter\n} from '@absolutejs/sync/engine';\n\n/** One row per actor — created on first successful send, updated after each. */\nexport type DigestCursor = {\n\t/** Row id (= actorId). */\n\tid: string;\n\tactorId: string;\n\t/** Epoch ms of the most recent successful send. */\n\tlastSentAt: number;\n\t/** Subject line of the most recent successful send (for observability). */\n\tlastSubject: string;\n};\n\n/** The payload the host's `buildDigest` returns. Returning `null` skips. */\nexport type DigestPayload = {\n\tto: string;\n\tsubject: string;\n\tbody: string;\n};\n\n/** Storage adapter the pack uses for the cursors table. */\nexport type DigestStore = {\n\treader: TableReader<CollectionContext>;\n\twriter: TableWriter<DigestCursor, CollectionContext, unknown>;\n\tgetById: (id: string) => DigestCursor | undefined;\n};\n\n/** Default in-memory store. */\nexport const createInMemoryDigestStore = (): DigestStore => {\n\tconst rows = new Map<string, DigestCursor>();\n\treturn {\n\t\tgetById: (id) => rows.get(id),\n\t\treader: {\n\t\t\tall: () => [...rows.values()]\n\t\t},\n\t\twriter: {\n\t\t\tdelete: (row) => {\n\t\t\t\trows.delete((row as { id: string }).id);\n\t\t\t},\n\t\t\tinsert: (data) => {\n\t\t\t\trows.set(data.id, data);\n\t\t\t\treturn data;\n\t\t\t},\n\t\t\tupdate: (data) => {\n\t\t\t\tconst prior = rows.get(data.id);\n\t\t\t\tconst merged = { ...(prior ?? {}), ...data } as DigestCursor;\n\t\t\t\trows.set(data.id, merged);\n\t\t\t\treturn merged;\n\t\t\t}\n\t\t}\n\t};\n};\n\nconst DEFAULT_CRON = '0 8 * * 1';\nconst DEFAULT_MAX_ACTORS_PER_FIRE = 1000;\nconst DEFAULT_MIN_HOURS_BETWEEN_DIGESTS = 168;\n\n/** Factory config. `send`, `buildDigest`, and `listActors` are required. */\nexport type DigestPackConfig<Ctx = CollectionContext> = {\n\t/**\n\t * Prefix applied to the owned table name AND every collection/schedule\n\t * the pack exposes. Default `\"\"`.\n\t */\n\tprefix?: string;\n\t/**\n\t * Cron pattern for the digest fire (`@elysiajs/cron` / croner syntax).\n\t * Default `\"0 8 * * 1\"` (Mondays 08:00).\n\t */\n\tcron?: string;\n\t/**\n\t * Host-supplied email sender. The pack does NOT own transport (no SMTP\n\t * client, no Resend/SES/Postmark dep). Throws are caught per-actor.\n\t */\n\tsend: (msg: DigestPayload) => Promise<void>;\n\t/**\n\t * Build the digest payload for one actor. `since` is the actor's last\n\t * successful send timestamp, or `null` if they've never received one.\n\t * Return `null` to skip this fire silently (no content for this actor).\n\t */\n\tbuildDigest: (\n\t\tactorId: string,\n\t\tsince: Date | null\n\t) => Promise<DigestPayload | null>;\n\t/**\n\t * Yield the actor ids the schedule should iterate per fire. The host's\n\t * own data layer is the source of truth for \"who exists\" — the pack\n\t * just maintains per-actor cursors.\n\t */\n\tlistActors: () =>\n\t\t| Iterable<string>\n\t\t| Promise<Iterable<string>>;\n\t/**\n\t * Cap on actors processed per fire (back-pressure). The rest wait for\n\t * the next cron fire. Default `1000`.\n\t */\n\tmaxActorsPerFire?: number;\n\t/**\n\t * Minimum hours between digests for a given actor. An actor whose\n\t * cursor is fresher than this is skipped on the fire. Default `168`\n\t * (one week — matches the weekly default cron).\n\t */\n\tminHoursBetweenDigests?: number;\n\t/**\n\t * Extract the current actor id from ctx — used to scope the cursor\n\t * collection so each actor sees their own row. Default\n\t * `(ctx) => ctx.userId`.\n\t */\n\tgetActorId?: (ctx: Ctx) => string | undefined;\n\t/**\n\t * Outer schedule retry policy. The pack catches per-actor failures\n\t * already, so this only retries the whole handler on classified\n\t * transient infrastructure failures (e.g. DB serialization). Default\n\t * undefined — digest fires miss skip on infra failure and catch up\n\t * next cron.\n\t */\n\tretry?: RetryPolicy;\n\t/** Override the storage adapter. Default: per-instance in-memory. */\n\tstore?: DigestStore;\n\t/** Wall-clock function. Default `Date.now`. */\n\tnow?: () => number;\n\t/**\n\t * Hook for surfacing per-actor failures. Defaults to `console.error`.\n\t * The pack swallows the error after this call so the schedule keeps\n\t * going for the rest of the actor list.\n\t */\n\tonActorFailure?: (info: {\n\t\tactorId: string;\n\t\tphase: 'buildDigest' | 'send' | 'cursor';\n\t\terror: unknown;\n\t}) => void;\n\t/**\n\t * When `true`, the schedule builds each digest as usual but does NOT\n\t * call `send` and does NOT update cursors. Use for hosting QA, preview\n\t * fires from staging, or \"what would the next digest look like?\"\n\t * tooling. Built payloads are surfaced through `onActorPreview` so\n\t * the host can render them to an admin UI.\n\t */\n\tdryRun?: boolean;\n\t/**\n\t * Called for each actor whose digest was successfully built, regardless\n\t * of `dryRun`. In dry-run mode this is the only way to observe what\n\t * WOULD have been sent. In live mode it fires before `send`.\n\t */\n\tonActorPreview?: (info: { actorId: string; payload: DigestPayload }) => void;\n};\n\nconst resolveActor = (\n\tgetActorId: NonNullable<DigestPackConfig['getActorId']>,\n\tctx: unknown\n): string | undefined => getActorId(ctx as CollectionContext);\n\n/**\n * Build a {@link SyncPack} that exposes scheduled per-actor digests. Each\n * call returns a fresh pack with its own cursor store (unless overridden).\n */\nexport const createDigestPack = <Ctx = CollectionContext>(\n\tconfig: DigestPackConfig<Ctx>\n): SyncPack => {\n\tconst prefix = config.prefix ?? '';\n\tconst table = `${prefix}digest_cursors`;\n\tconst collectionName = table;\n\tconst scheduleName = `${prefix}digest:fire`;\n\tconst cron = config.cron ?? DEFAULT_CRON;\n\tconst maxActorsPerFire =\n\t\tconfig.maxActorsPerFire ?? DEFAULT_MAX_ACTORS_PER_FIRE;\n\tconst minIntervalMs =\n\t\t(config.minHoursBetweenDigests ??\n\t\t\tDEFAULT_MIN_HOURS_BETWEEN_DIGESTS) *\n\t\t60 *\n\t\t60 *\n\t\t1000;\n\tconst store = config.store ?? createInMemoryDigestStore();\n\tconst now = config.now ?? Date.now;\n\tconst getActorId = (config.getActorId ??\n\t\t((ctx: CollectionContext) =>\n\t\t\t(ctx as { userId?: string }).userId)) as (\n\t\tctx: CollectionContext\n\t) => string | undefined;\n\tconst onActorFailure =\n\t\tconfig.onActorFailure ??\n\t\t((info) => {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error(\n\t\t\t\t`[sync-pack-digest] actor \"${info.actorId}\" failed at ${info.phase}:`,\n\t\t\t\tinfo.error\n\t\t\t);\n\t\t});\n\n\tconst pack: SyncPack = {\n\t\tname: '@absolutejs/sync-pack-digest',\n\t\townsTables: [table],\n\t\treadsTables: [],\n\t\tversion: '0.2.0',\n\n\t\tschemas: defineSchema({\n\t\t\t[table]: {\n\t\t\t\tfields: {\n\t\t\t\t\tid: field.string,\n\t\t\t\t\tactorId: field.string,\n\t\t\t\t\tlastSentAt: field.number,\n\t\t\t\t\tlastSubject: field.string\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\n\t\treaders: { [table]: store.reader },\n\t\twriters: { [table]: store.writer },\n\n\t\tpermissions: {\n\t\t\t[table]: {\n\t\t\t\t// Each actor sees only their own cursor — the cursor row\n\t\t\t\t// surfaces \"your last digest was at X\" to the user without\n\t\t\t\t// leaking other actors' state. Hosts who want a global\n\t\t\t\t// admin view register their own permissions on top.\n\t\t\t\tread: (ctx: unknown, row: DigestCursor) => {\n\t\t\t\t\tconst callerId = resolveActor(getActorId, ctx);\n\t\t\t\t\treturn callerId !== undefined && row.actorId === callerId;\n\t\t\t\t},\n\t\t\t\t// Writes flow only through the pack's schedule; deny\n\t\t\t\t// outside writers by stamping actorId === caller, which\n\t\t\t\t// fails for any non-actor (the schedule runs trusted and\n\t\t\t\t// bypasses these checks).\n\t\t\t\tinsert: (ctx: unknown, row: DigestCursor) => {\n\t\t\t\t\tconst callerId = resolveActor(getActorId, ctx);\n\t\t\t\t\treturn callerId !== undefined && row.actorId === callerId;\n\t\t\t\t},\n\t\t\t\tupdate: (ctx: unknown, row: DigestCursor) => {\n\t\t\t\t\tconst callerId = resolveActor(getActorId, ctx);\n\t\t\t\t\treturn callerId !== undefined && row.actorId === callerId;\n\t\t\t\t},\n\t\t\t\tdelete: (ctx: unknown, row: DigestCursor) => {\n\t\t\t\t\tconst callerId = resolveActor(getActorId, ctx);\n\t\t\t\t\tif (callerId === undefined) return false;\n\t\t\t\t\tif ((row as { actorId?: string }).actorId !== undefined) {\n\t\t\t\t\t\treturn (row as { actorId: string }).actorId === callerId;\n\t\t\t\t\t}\n\t\t\t\t\tconst id = (row as { id?: string }).id;\n\t\t\t\t\tif (id === undefined) return false;\n\t\t\t\t\treturn store.getById(id)?.actorId === callerId;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tcollections: [\n\t\t\tdefineCollection<DigestCursor, void, CollectionContext>({\n\t\t\t\tname: collectionName,\n\t\t\t\ttables: [table],\n\t\t\t\tkey: (row) => row.id,\n\t\t\t\thydrate: (_params, ctx) => {\n\t\t\t\t\tconst callerId = resolveActor(getActorId, ctx);\n\t\t\t\t\tif (callerId === undefined) return [];\n\t\t\t\t\treturn (store.reader.all(ctx) as DigestCursor[]).filter(\n\t\t\t\t\t\t(row) => row.actorId === callerId\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tmatch: (row, _params, ctx) => {\n\t\t\t\t\tconst callerId = resolveActor(getActorId, ctx);\n\t\t\t\t\treturn (\n\t\t\t\t\t\tcallerId !== undefined && row.actorId === callerId\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tauthorize: (_params, ctx) =>\n\t\t\t\t\tresolveActor(getActorId, ctx) !== undefined\n\t\t\t})\n\t\t],\n\n\t\tschedules: [\n\t\t\tdefineSchedule({\n\t\t\t\tname: scheduleName,\n\t\t\t\tpattern: cron,\n\t\t\t\t...(config.retry !== undefined ? { retry: config.retry } : {}),\n\t\t\t\trun: async ({ actions }) => {\n\t\t\t\t\tconst t = now();\n\t\t\t\t\tconst actors = await config.listActors();\n\t\t\t\t\tlet processed = 0;\n\t\t\t\t\tfor (const actorId of actors) {\n\t\t\t\t\t\tif (processed >= maxActorsPerFire) break;\n\t\t\t\t\t\tconst cursor = store.getById(actorId);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tcursor !== undefined &&\n\t\t\t\t\t\t\tt - cursor.lastSentAt < minIntervalMs\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Not yet due for this actor.\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet payload: DigestPayload | null;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst since =\n\t\t\t\t\t\t\t\tcursor === undefined\n\t\t\t\t\t\t\t\t\t? null\n\t\t\t\t\t\t\t\t\t: new Date(cursor.lastSentAt);\n\t\t\t\t\t\t\tpayload = await config.buildDigest(actorId, since);\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tonActorFailure({\n\t\t\t\t\t\t\t\tactorId,\n\t\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t\tphase: 'buildDigest'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (payload === null) {\n\t\t\t\t\t\t\t// Host signalled no content for this actor — skip\n\t\t\t\t\t\t\t// without bumping the cursor.\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Surface the built payload for both live and dry-run\n\t\t\t\t\t\t// callers. Lets a host preview / audit / log each digest.\n\t\t\t\t\t\tconfig.onActorPreview?.({ actorId, payload });\n\t\t\t\t\t\tif (config.dryRun === true) {\n\t\t\t\t\t\t\t// dryRun: skip send AND cursor write. Count it as\n\t\t\t\t\t\t\t// processed so maxActorsPerFire still caps the loop.\n\t\t\t\t\t\t\tprocessed++;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait config.send(payload);\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tonActorFailure({\n\t\t\t\t\t\t\t\tactorId,\n\t\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t\tphase: 'send'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tprocessed++;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst next: DigestCursor = {\n\t\t\t\t\t\t\t\tid: actorId,\n\t\t\t\t\t\t\t\tactorId,\n\t\t\t\t\t\t\t\tlastSentAt: t,\n\t\t\t\t\t\t\t\tlastSubject: payload.subject\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (cursor === undefined) {\n\t\t\t\t\t\t\t\tawait actions.insert(table, next);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tawait actions.update(table, next);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t// The email already went out — losing the cursor\n\t\t\t\t\t\t\t// update means the actor may double-receive on\n\t\t\t\t\t\t\t// the next fire. We log so the operator sees it.\n\t\t\t\t\t\t\tonActorFailure({\n\t\t\t\t\t\t\t\tactorId,\n\t\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t\tphase: 'cursor'\n\t\t\t\t\t\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AAO,WAAW,MAAM;AAAA,cAG3B;AAAA,cACA;AAAA,YACD;AAAA,YACA,IAAI;AAAA,cACH,MAAM,OAAO,KAAK,OAAO;AAAA,cACxB,OAAO,OAAO;AAAA,cACf,eAAe;AAAA,gBACd;AAAA,gBACA;AAAA,gBACA,OAAO;AAAA,cACR,CAAC;AAAA,cACD;AAAA;AAAA,YAED;AAAA,YACA,IAAI;AAAA,cACH,MAAM,OAAqB;AAAA,gBAC1B,IAAI;AAAA,gBACJ;AAAA,gBACA,YAAY;AAAA,gBACZ,aAAa,QAAQ;AAAA,cACtB;AAAA,cACA,IAAI,WAAW,WAAW;AAAA,gBACzB,MAAM,QAAQ,OAAO,OAAO,IAAI;AAAA,cACjC,EAAO;AAAA,gBACN,MAAM,QAAQ,OAAO,OAAO,IAAI;AAAA;AAAA,cAEhC,OAAO,OAAO;AAAA,cAIf,eAAe;AAAA,gBACd;AAAA,gBACA;AAAA,gBACA,OAAO;AAAA,cACR,CAAC;AAAA;AAAA,UAEH;AAAA;AAAA,MAEF,CAAC;AAAA,IACF;AAAA,EACD;AAAA,EAEA,OAAO,eAAe,IAAI;AAAA;",
8
+ "debugId": "4FECC5659F9B261864756E2164756E21",
9
9
  "names": []
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/sync-pack-digest",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "Scheduled per-actor digest pack for @absolutejs/sync — cron-fired, cursor-managed, transport-agnostic",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,7 +11,7 @@
11
11
  "module": "./dist/index.js",
12
12
  "types": "./dist/index.d.ts",
13
13
  "type": "module",
14
- "license": "CC BY-NC 4.0",
14
+ "license": "Apache-2.0",
15
15
  "author": "Alex Kahn",
16
16
  "publishConfig": {
17
17
  "access": "public"
@@ -35,7 +35,7 @@
35
35
  "@absolutejs/sync": ">= 1.9.1"
36
36
  },
37
37
  "devDependencies": {
38
- "@absolutejs/sync": "^1.9.1",
38
+ "@absolutejs/sync": "^1.9.2",
39
39
  "@types/bun": "1.3.14",
40
40
  "prettier": "3.5.3",
41
41
  "typescript": "5.8.3"