@ayepi/sqlite 0.0.0-stage → 0.5.0

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/index.js ADDED
@@ -0,0 +1,419 @@
1
+ import { z } from "zod";
2
+ import { applyHit } from "@ayepi/rate";
3
+ //#region src/db.ts
4
+ /**
5
+ * # The database port
6
+ *
7
+ * Every store in this package takes a {@link SqliteDatabase}: the small synchronous surface of a SQLite connection
8
+ * it needs. A `better-sqlite3` `Database` satisfies it as is, so the application opens the file once (with its own
9
+ * pragmas) and every ayepi port shares it. Tables are created on construction (`CREATE … IF NOT EXISTS`) under a
10
+ * validated name prefix.
11
+ *
12
+ * @module
13
+ */
14
+ /** The default table-name prefix. */
15
+ const DEFAULT_PREFIX = "ayepi_";
16
+ /** A table-name prefix: it is spliced into SQL, so only identifier characters are allowed. */
17
+ const Prefix = z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/, "a table prefix is letters, digits and _, not starting with a digit");
18
+ /** Resolve the shared options: a validated prefix and a clock. */
19
+ function resolveOptions(opts) {
20
+ return {
21
+ prefix: Prefix.parse(opts.prefix ?? "ayepi_"),
22
+ now: opts.now ?? Date.now
23
+ };
24
+ }
25
+ /** Run `fn` atomically and with the write lock held: `BEGIN IMMEDIATE`, or a savepoint inside an open transaction. */
26
+ function atomic(db, fn) {
27
+ const nested = db.inTransaction === true;
28
+ db.exec(nested ? "SAVEPOINT ayepi_atomic" : "BEGIN IMMEDIATE");
29
+ try {
30
+ const out = fn();
31
+ db.exec(nested ? "RELEASE ayepi_atomic" : "COMMIT");
32
+ return out;
33
+ } catch (err) {
34
+ db.exec(nested ? "ROLLBACK TO ayepi_atomic; RELEASE ayepi_atomic" : "ROLLBACK");
35
+ throw err;
36
+ }
37
+ }
38
+ /** Calls a function once every `every` calls (amortized cleanup). */
39
+ function every(count, fn) {
40
+ let n = 0;
41
+ return () => {
42
+ if (++n % count === 0) fn();
43
+ };
44
+ }
45
+ //#endregion
46
+ //#region src/queue.ts
47
+ /**
48
+ * # `sqliteQueue` — the `@ayepi/work` Queue
49
+ *
50
+ * A durable work log with visibility-timeout leasing, in one table shared by any number of named queues. `pop`
51
+ * reclaims expired leases (a dead worker's items are redelivered, `attempt + 1`) and then leases visible items in
52
+ * one `UPDATE … RETURNING`, so two workers can never lease the same item. `heartbeat`/`ack`/`fail` are gated on the
53
+ * lease token, so a worker whose lease lapsed cannot touch an item another worker now holds. Pushes with the same
54
+ * `dedupeKey` collapse while the first is still in the queue (a unique index).
55
+ *
56
+ * @module
57
+ */
58
+ /** The lease handle `pop` hands out: the row and the lease token. */
59
+ const Lease = z.object({
60
+ id: z.number(),
61
+ token: z.string()
62
+ });
63
+ const LeasedRow = z.object({
64
+ id: z.number(),
65
+ body: z.string(),
66
+ attempt: z.number()
67
+ });
68
+ const CountRow = z.object({ n: z.number() });
69
+ const DeadRow = z.object({
70
+ body: z.string(),
71
+ error: z.string(),
72
+ at: z.number()
73
+ });
74
+ const DEAD_LIMIT = 100;
75
+ /**
76
+ * Create a `@ayepi/work` {@link Queue} on `db` (tables `<prefix>queue` and `<prefix>queue_dead`).
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * const bulk = sqliteQueue(db, { name: 'bulk' }) // a separate queue for a noisy type
81
+ * const ingest = defineWork('ingest', handler, { queue: bulk })
82
+ * ```
83
+ */
84
+ function sqliteQueue(db, opts = {}) {
85
+ const { prefix, now } = resolveOptions(opts);
86
+ const name = opts.name ?? "default";
87
+ const t = `${prefix}queue`;
88
+ const dt = `${prefix}queue_dead`;
89
+ db.exec(`CREATE TABLE IF NOT EXISTS ${t} (
90
+ id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, body TEXT NOT NULL, visible_at INTEGER NOT NULL,
91
+ lease_token TEXT, lease_until INTEGER, attempt INTEGER NOT NULL DEFAULT 0, dedupe_key TEXT);
92
+ CREATE INDEX IF NOT EXISTS ${t}_ready ON ${t}(name, visible_at) WHERE lease_token IS NULL;
93
+ CREATE INDEX IF NOT EXISTS ${t}_leased ON ${t}(name, lease_until) WHERE lease_token IS NOT NULL;
94
+ CREATE UNIQUE INDEX IF NOT EXISTS ${t}_dedupe ON ${t}(name, dedupe_key) WHERE dedupe_key IS NOT NULL;
95
+ CREATE TABLE IF NOT EXISTS ${dt} (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, body TEXT NOT NULL, error TEXT NOT NULL, at INTEGER NOT NULL);`);
96
+ const insert = db.prepare(`INSERT INTO ${t} (name, body, visible_at) VALUES (?, ?, ?)`);
97
+ const insertOnce = db.prepare(`INSERT INTO ${t} (name, body, visible_at, dedupe_key) VALUES (?, ?, ?, ?) ON CONFLICT DO NOTHING`);
98
+ const reclaim = db.prepare(`UPDATE ${t} SET lease_token = NULL, lease_until = NULL, attempt = attempt + 1
99
+ WHERE name = ? AND lease_token IS NOT NULL AND lease_until <= ?`);
100
+ const lease = db.prepare(`UPDATE ${t} SET lease_token = ?, lease_until = ?
101
+ WHERE id IN (SELECT id FROM ${t} WHERE name = ? AND lease_token IS NULL AND visible_at <= ? ORDER BY visible_at, id LIMIT ?)
102
+ RETURNING id, body, attempt`);
103
+ const extend = db.prepare(`UPDATE ${t} SET lease_until = ? WHERE id = ? AND lease_token = ?`);
104
+ const remove = db.prepare(`DELETE FROM ${t} WHERE id = ? AND lease_token = ?`);
105
+ const release = db.prepare(`UPDATE ${t} SET lease_token = NULL, lease_until = NULL, attempt = ?, visible_at = ? WHERE id = ? AND lease_token = ?`);
106
+ const bury = db.prepare(`INSERT INTO ${dt} (name, body, error, at) VALUES (?, ?, ?, ?)`);
107
+ const count = db.prepare(`SELECT count(*) AS n FROM ${t} WHERE name = ?`);
108
+ const graveyard = db.prepare(`SELECT body, error, at FROM ${dt} WHERE name = ? ORDER BY id LIMIT ?`);
109
+ /** The lease of a handle this queue issued, or `null` for anything else. */
110
+ const leaseOf = (pulled) => {
111
+ const parsed = Lease.safeParse(pulled.handle);
112
+ return parsed.success ? parsed.data : null;
113
+ };
114
+ return {
115
+ push(body, o) {
116
+ const visibleAt = now() + (o?.delay ?? 0);
117
+ if (o?.dedupeKey) insertOnce.run(name, body, visibleAt, o.dedupeKey);
118
+ else insert.run(name, body, visibleAt);
119
+ },
120
+ pop(max, visibility) {
121
+ const at = now();
122
+ reclaim.run(name, at);
123
+ const token = crypto.randomUUID();
124
+ const rows = lease.all(token, at + visibility, name, at, max).map((r) => LeasedRow.parse(r));
125
+ rows.sort((a, b) => a.id - b.id);
126
+ return rows.map((r) => ({
127
+ body: r.body,
128
+ handle: {
129
+ id: r.id,
130
+ token
131
+ },
132
+ attempt: r.attempt + 1
133
+ }));
134
+ },
135
+ heartbeat(pulled, visibility) {
136
+ const l = leaseOf(pulled);
137
+ if (l) extend.run(now() + visibility, l.id, l.token);
138
+ },
139
+ ack(pulled) {
140
+ const l = leaseOf(pulled);
141
+ if (l) remove.run(l.id, l.token);
142
+ },
143
+ fail(pulled, delay) {
144
+ const l = leaseOf(pulled);
145
+ if (l) release.run(pulled.attempt, now() + (delay ?? 0), l.id, l.token);
146
+ },
147
+ deadLetter(body, error) {
148
+ bury.run(name, body, error, now());
149
+ },
150
+ size() {
151
+ return CountRow.parse(count.get(name)).n;
152
+ },
153
+ dead(limit = DEAD_LIMIT) {
154
+ return graveyard.all(name, limit).map((r) => DeadRow.parse(r));
155
+ }
156
+ };
157
+ }
158
+ //#endregion
159
+ //#region src/store.ts
160
+ /**
161
+ * # `sqliteStore` — the `@ayepi/work` Store
162
+ *
163
+ * A key/value table with per-key expiry. `setIfNotExists` (the claim every work lease and fire-once relies on) and
164
+ * `increment` (the group counter) are single statements, so they are atomic across every process sharing the file.
165
+ *
166
+ * @module
167
+ */
168
+ const SWEEP_EVERY$1 = 1e3;
169
+ const ValueRow = z.object({ value: z.string() });
170
+ /**
171
+ * Create the `@ayepi/work` {@link Store} on `db` (table `<prefix>kv`).
172
+ *
173
+ * @example
174
+ * ```ts
175
+ * import Database from 'better-sqlite3'
176
+ * const db = new Database('hub.db')
177
+ * createWork({ work, ...sqliteBackend(db) }) // queue + store + pubsub in one file
178
+ * ```
179
+ */
180
+ function sqliteStore(db, opts = {}) {
181
+ const { prefix, now } = resolveOptions(opts);
182
+ const t = `${prefix}kv`;
183
+ db.exec(`CREATE TABLE IF NOT EXISTS ${t} (key TEXT PRIMARY KEY, value TEXT NOT NULL, expires_at INTEGER) WITHOUT ROWID;
184
+ CREATE INDEX IF NOT EXISTS ${t}_expires ON ${t}(expires_at) WHERE expires_at IS NOT NULL;`);
185
+ const read = db.prepare(`SELECT value FROM ${t} WHERE key = ? AND (expires_at IS NULL OR expires_at > ?)`);
186
+ /** One statement per expiry form: `?` (expires at a time) and `NULL` (kept until deleted). */
187
+ const both = (sql) => ({
188
+ at: db.prepare(sql("?")),
189
+ never: db.prepare(sql("NULL"))
190
+ });
191
+ const write = both((e) => `INSERT INTO ${t} (key, value, expires_at) VALUES (?, ?, ${e})
192
+ ON CONFLICT (key) DO UPDATE SET value = excluded.value, expires_at = excluded.expires_at`);
193
+ const remove = db.prepare(`DELETE FROM ${t} WHERE key = ?`);
194
+ const claim = both((e) => `INSERT INTO ${t} (key, value, expires_at) VALUES (?, ?, ${e})
195
+ ON CONFLICT (key) DO UPDATE SET value = excluded.value, expires_at = excluded.expires_at
196
+ WHERE ${t}.expires_at IS NOT NULL AND ${t}.expires_at <= ?`);
197
+ const add = both((e) => `INSERT INTO ${t} (key, value, expires_at) VALUES (?, CAST(CAST(? AS INTEGER) AS TEXT), ${e})
198
+ ON CONFLICT (key) DO UPDATE SET
199
+ value = CAST((CASE WHEN ${t}.expires_at IS NOT NULL AND ${t}.expires_at <= ? THEN 0 ELSE CAST(${t}.value AS INTEGER) END) + CAST(? AS INTEGER) AS TEXT),
200
+ expires_at = excluded.expires_at
201
+ RETURNING value`);
202
+ const purge = db.prepare(`DELETE FROM ${t} WHERE expires_at IS NOT NULL AND expires_at <= ?`);
203
+ const sweep = every(opts.sweepEvery ?? SWEEP_EVERY$1, () => void purge.run(now()));
204
+ return {
205
+ get(key) {
206
+ const row = ValueRow.safeParse(read.get(key, now()));
207
+ return row.success ? row.data.value : void 0;
208
+ },
209
+ set(key, value, ttl) {
210
+ if (ttl) write.at.run(key, value, now() + ttl);
211
+ else write.never.run(key, value);
212
+ sweep();
213
+ },
214
+ delete(key) {
215
+ remove.run(key);
216
+ },
217
+ setIfNotExists(key, value, ttl) {
218
+ sweep();
219
+ return (ttl ? claim.at.run(key, value, now() + ttl, now()) : claim.never.run(key, value, now())).changes === 1;
220
+ },
221
+ increment(key, by, ttl) {
222
+ sweep();
223
+ const row = ttl ? add.at.get(key, by, now() + ttl, now(), by) : add.never.get(key, by, now(), by);
224
+ return Number(ValueRow.parse(row).value);
225
+ }
226
+ };
227
+ }
228
+ //#endregion
229
+ //#region src/pubsub.ts
230
+ /**
231
+ * # `sqlitePubSub` — the `@ayepi/work` PubSub
232
+ *
233
+ * Fans a message out to every subscriber in this process at once, and through a messages table to the other
234
+ * processes sharing the database file, which poll it. Pub/sub is best-effort for the work engine (waiters also poll
235
+ * the store), so a message older than `retention` is simply dropped.
236
+ *
237
+ * @module
238
+ */
239
+ const POLL = 100;
240
+ const RETENTION = 6e4;
241
+ const PRUNE_EVERY = 100;
242
+ const MessageRow = z.object({
243
+ id: z.number(),
244
+ origin: z.string(),
245
+ body: z.string()
246
+ });
247
+ const MaxRow = z.object({ id: z.number().nullable() });
248
+ /** Create the `@ayepi/work` {@link PubSub} on `db` (table `<prefix>pubsub`). */
249
+ function sqlitePubSub(db, opts = {}) {
250
+ const { prefix, now } = resolveOptions(opts);
251
+ const listeners = /* @__PURE__ */ new Set();
252
+ const deliver = (message) => {
253
+ for (const l of [...listeners]) l(message);
254
+ };
255
+ if (opts.poll === false) return {
256
+ publish: deliver,
257
+ subscribe(l) {
258
+ listeners.add(l);
259
+ return () => void listeners.delete(l);
260
+ },
261
+ close: () => listeners.clear()
262
+ };
263
+ const interval = opts.poll ?? POLL;
264
+ const retention = opts.retention ?? RETENTION;
265
+ const origin = crypto.randomUUID();
266
+ const t = `${prefix}pubsub`;
267
+ db.exec(`CREATE TABLE IF NOT EXISTS ${t} (id INTEGER PRIMARY KEY AUTOINCREMENT, origin TEXT NOT NULL, body TEXT NOT NULL, at INTEGER NOT NULL);
268
+ CREATE INDEX IF NOT EXISTS ${t}_at ON ${t}(at);`);
269
+ const insert = db.prepare(`INSERT INTO ${t} (origin, body, at) VALUES (?, ?, ?)`);
270
+ const since = db.prepare(`SELECT id, origin, body FROM ${t} WHERE id > ? ORDER BY id`);
271
+ const last = db.prepare(`SELECT max(id) AS id FROM ${t}`);
272
+ const purge = db.prepare(`DELETE FROM ${t} WHERE at < ?`);
273
+ const prune = every(PRUNE_EVERY, () => void purge.run(now() - retention));
274
+ const latest = () => MaxRow.parse(last.get()).id ?? 0;
275
+ let cursor = 0;
276
+ let timer = null;
277
+ const read = () => {
278
+ for (const raw of since.all(cursor)) {
279
+ const row = MessageRow.parse(raw);
280
+ cursor = row.id;
281
+ if (row.origin !== origin) deliver(row.body);
282
+ }
283
+ };
284
+ const stop = () => {
285
+ if (timer) clearInterval(timer);
286
+ timer = null;
287
+ };
288
+ return {
289
+ publish(message) {
290
+ insert.run(origin, message, now());
291
+ prune();
292
+ deliver(message);
293
+ },
294
+ subscribe(l) {
295
+ listeners.add(l);
296
+ if (!timer) {
297
+ cursor = latest();
298
+ timer = setInterval(read, interval);
299
+ timer.unref?.();
300
+ }
301
+ return () => {
302
+ listeners.delete(l);
303
+ if (listeners.size === 0) stop();
304
+ };
305
+ },
306
+ close() {
307
+ listeners.clear();
308
+ stop();
309
+ }
310
+ };
311
+ }
312
+ //#endregion
313
+ //#region src/rate.ts
314
+ /**
315
+ * # `sqliteRateStore` — an `@ayepi/rate` store
316
+ *
317
+ * Runs `@ayepi/rate`'s own algorithms ({@link applyHit}) on rows instead of Maps, inside one write transaction per
318
+ * hit, so every algorithm and weighted cost behaves exactly as in the in-memory store while the limit is shared by
319
+ * every process using the file.
320
+ *
321
+ * @module
322
+ */
323
+ const SWEEP_EVERY = 1e3;
324
+ const IDLE = 600 * 1e3;
325
+ const CounterRow = z.object({
326
+ count: z.number(),
327
+ reset: z.number()
328
+ });
329
+ const BucketRow = z.object({
330
+ tokens: z.number(),
331
+ ts: z.number()
332
+ });
333
+ /**
334
+ * Create an `@ayepi/rate` {@link RateLimitStore} on `db` (tables `<prefix>rate_counter` and `<prefix>rate_bucket`).
335
+ *
336
+ * @example
337
+ * ```ts
338
+ * const spend = limiter({ limit: 5_000_000, window: 86_400_000, store: sqliteRateStore(db) })
339
+ * ```
340
+ */
341
+ function sqliteRateStore(db, opts = {}) {
342
+ const { prefix } = resolveOptions(opts);
343
+ const idle = opts.idle ?? IDLE;
344
+ const ct = `${prefix}rate_counter`;
345
+ const bt = `${prefix}rate_bucket`;
346
+ db.exec(`CREATE TABLE IF NOT EXISTS ${ct} (key TEXT PRIMARY KEY, count REAL NOT NULL, reset INTEGER NOT NULL, expires_at INTEGER NOT NULL) WITHOUT ROWID;
347
+ CREATE TABLE IF NOT EXISTS ${bt} (key TEXT PRIMARY KEY, tokens REAL NOT NULL, ts INTEGER NOT NULL, expires_at INTEGER NOT NULL) WITHOUT ROWID;`);
348
+ const readCounter = db.prepare(`SELECT count, reset FROM ${ct} WHERE key = ?`);
349
+ const writeCounter = db.prepare(`INSERT INTO ${ct} (key, count, reset, expires_at) VALUES (?, ?, ?, ?)
350
+ ON CONFLICT (key) DO UPDATE SET count = excluded.count, reset = excluded.reset, expires_at = excluded.expires_at`);
351
+ const readBucket = db.prepare(`SELECT tokens, ts FROM ${bt} WHERE key = ?`);
352
+ const writeBucket = db.prepare(`INSERT INTO ${bt} (key, tokens, ts, expires_at) VALUES (?, ?, ?, ?)
353
+ ON CONFLICT (key) DO UPDATE SET tokens = excluded.tokens, ts = excluded.ts, expires_at = excluded.expires_at`);
354
+ const dropCounters = db.prepare(`DELETE FROM ${ct} WHERE key = ? OR substr(key, 1, length(?) + 1) = ? || '|'`);
355
+ const dropBucket = db.prepare(`DELETE FROM ${bt} WHERE key = ?`);
356
+ const purgeCounters = db.prepare(`DELETE FROM ${ct} WHERE expires_at <= ?`);
357
+ const purgeBuckets = db.prepare(`DELETE FROM ${bt} WHERE expires_at <= ?`);
358
+ let clock = 0;
359
+ const sweep = every(opts.sweepEvery ?? SWEEP_EVERY, () => {
360
+ purgeCounters.run(clock);
361
+ purgeBuckets.run(clock);
362
+ });
363
+ return {
364
+ consume(key, rule, now, cost) {
365
+ clock = now;
366
+ const counters = {
367
+ get: (k) => {
368
+ const row = CounterRow.safeParse(readCounter.get(k));
369
+ return row.success ? row.data : void 0;
370
+ },
371
+ set: (k, c) => void writeCounter.run(k, c.count, c.reset, c.reset + rule.window)
372
+ };
373
+ const buckets = {
374
+ get: (k) => {
375
+ const row = BucketRow.safeParse(readBucket.get(k));
376
+ return row.success ? row.data : void 0;
377
+ },
378
+ set: (k, b) => void writeBucket.run(k, b.tokens, b.ts, b.ts + idle)
379
+ };
380
+ const result = atomic(db, () => applyHit({
381
+ counters,
382
+ buckets
383
+ }, key, rule, now, cost));
384
+ sweep();
385
+ return result;
386
+ },
387
+ reset(key) {
388
+ atomic(db, () => {
389
+ dropCounters.run(key, key, key);
390
+ dropBucket.run(key);
391
+ });
392
+ }
393
+ };
394
+ }
395
+ //#endregion
396
+ //#region src/index.ts
397
+ /** Create the `@ayepi/work` queue, store and pub/sub on `db` — spread it into `createWork`. */
398
+ function sqliteBackend(db, opts = {}) {
399
+ const shared = {
400
+ prefix: opts.prefix,
401
+ now: opts.now
402
+ };
403
+ return {
404
+ queue: sqliteQueue(db, {
405
+ ...shared,
406
+ ...opts.queue
407
+ }),
408
+ store: sqliteStore(db, {
409
+ ...shared,
410
+ ...opts.store
411
+ }),
412
+ pubsub: sqlitePubSub(db, {
413
+ ...shared,
414
+ ...opts.pubsub
415
+ })
416
+ };
417
+ }
418
+ //#endregion
419
+ export { DEFAULT_PREFIX, Prefix, atomic, sqliteBackend, sqlitePubSub, sqliteQueue, sqliteRateStore, sqliteStore };
package/package.json CHANGED
@@ -1,6 +1,80 @@
1
1
  {
2
2
  "name": "@ayepi/sqlite",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.5.0",
4
+ "description": "SQLite backends for ayepi (better-sqlite3) — the @ayepi/work Queue, Store and PubSub, and an @ayepi/rate store, in one database file",
5
+ "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/ClickerMonkey/ayepi.git",
12
+ "directory": "packages/sqlite"
13
+ },
14
+ "homepage": "https://github.com/ClickerMonkey/ayepi/tree/main/packages/sqlite#readme",
15
+ "bugs": {
16
+ "url": "https://github.com/ClickerMonkey/ayepi/issues"
17
+ },
18
+ "type": "module",
19
+ "sideEffects": false,
20
+ "files": [
21
+ "dist",
22
+ "ayepi-*.md"
23
+ ],
24
+ "exports": {
25
+ ".": {
26
+ "import": {
27
+ "types": "./dist/index.d.ts",
28
+ "default": "./dist/index.js"
29
+ },
30
+ "require": {
31
+ "types": "./dist/index.d.cts",
32
+ "default": "./dist/index.cjs"
33
+ }
34
+ },
35
+ "./package.json": "./package.json"
36
+ },
37
+ "engines": {
38
+ "node": ">=18"
39
+ },
40
+ "peerDependencies": {
41
+ "zod": "^4.6.7",
42
+ "@ayepi/rate": "^0.5.0",
43
+ "@ayepi/work": "^0.5.0"
44
+ },
45
+ "peerDependenciesMeta": {
46
+ "@ayepi/rate": {
47
+ "optional": true
48
+ },
49
+ "@ayepi/work": {
50
+ "optional": true
51
+ }
52
+ },
53
+ "devDependencies": {
54
+ "@types/better-sqlite3": "^9.6.0",
55
+ "@vitest/coverage-v8": "^2.1.8",
56
+ "better-sqlite3": "^13.0.3",
57
+ "publint": "^0.3.0",
58
+ "tsdown": "^0.12.0",
59
+ "vitest": "^2.1.8",
60
+ "zod": "^4.6.7",
61
+ "@ayepi/core": "0.5.0",
62
+ "@ayepi/rate": "0.5.0",
63
+ "@ayepi/work": "0.5.0"
64
+ },
65
+ "keywords": [
66
+ "ayepi",
67
+ "sqlite",
68
+ "better-sqlite3",
69
+ "queue",
70
+ "job-queue",
71
+ "rate-limit",
72
+ "work"
73
+ ],
74
+ "scripts": {
75
+ "build": "tsdown",
76
+ "typecheck": "tsc --noEmit",
77
+ "test": "vitest run --coverage",
78
+ "publint": "publint"
79
+ }
6
80
  }