@owlmeans/resource 0.1.18-rc.8 → 0.1.18

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.
Files changed (59) hide show
  1. package/README.md +336 -135
  2. package/agent-meta/manifest.json +87 -4
  3. package/agent-meta/skills/resource/SKILL.md +36 -104
  4. package/agent-meta/skills/resource/parts/capabilities.md +23 -0
  5. package/agent-meta/skills/resource/parts/criteria.md +60 -0
  6. package/agent-meta/skills/resource/parts/memory-engine.md +27 -0
  7. package/agent-meta/skills/resource/parts/migrations.md +35 -0
  8. package/agent-meta/skills/resource-choice/SKILL.md +271 -0
  9. package/build/consts.d.ts +0 -3
  10. package/build/consts.d.ts.map +1 -1
  11. package/build/consts.js +0 -23
  12. package/build/consts.js.map +1 -1
  13. package/build/errors.d.ts +13 -0
  14. package/build/errors.d.ts.map +1 -1
  15. package/build/errors.js +15 -1
  16. package/build/errors.js.map +1 -1
  17. package/build/helper.d.ts.map +1 -1
  18. package/build/index.d.ts +2 -0
  19. package/build/index.d.ts.map +1 -1
  20. package/build/index.js +1 -0
  21. package/build/index.js.map +1 -1
  22. package/build/migration.d.ts.map +1 -1
  23. package/build/migration.js +0 -0
  24. package/build/migration.js.map +1 -1
  25. package/build/service.d.ts.map +1 -1
  26. package/build/types.d.ts +3 -1
  27. package/build/types.d.ts.map +1 -1
  28. package/build/utils/consts.local.d.ts +2 -0
  29. package/build/utils/consts.local.d.ts.map +1 -0
  30. package/build/utils/consts.local.js +2 -0
  31. package/build/utils/consts.local.js.map +1 -0
  32. package/build/utils/name.d.ts.map +1 -1
  33. package/build/utils/name.js.map +1 -1
  34. package/build/utils/query/types.d.ts +35 -0
  35. package/build/utils/query/types.d.ts.map +1 -0
  36. package/build/utils/query/types.js +2 -0
  37. package/build/utils/query/types.js.map +1 -0
  38. package/build/utils/query.d.ts +8 -20
  39. package/build/utils/query.d.ts.map +1 -1
  40. package/build/utils/query.js +97 -103
  41. package/build/utils/query.js.map +1 -1
  42. package/build/utils.d.ts +4 -0
  43. package/build/utils.d.ts.map +1 -0
  44. package/build/utils.js +24 -0
  45. package/build/utils.js.map +1 -0
  46. package/package.json +7 -5
  47. package/src/consts.ts +0 -25
  48. package/src/errors.ts +16 -1
  49. package/src/index.ts +2 -0
  50. package/src/migration.ts +0 -0
  51. package/src/types.ts +1 -1
  52. package/src/utils/consts.local.ts +1 -0
  53. package/src/utils/name.ts +2 -2
  54. package/src/utils/query/types.ts +37 -0
  55. package/src/utils/query.ts +106 -98
  56. package/src/utils.ts +26 -0
  57. package/tests/errors.spec.ts +60 -0
  58. package/tests/tsconfig.json +17 -0
  59. package/tsconfig.json +1 -1
@@ -0,0 +1,271 @@
1
+ ---
2
+ name: resource-choice
3
+ description: Which storage or execution mechanism a feature should use — postgres-resource, mongo-resource, redis-resource, static-resource, state, client-resource, config, storage-resource, queue + worker, or llm/agent. Guidance by similarity to worked cases, with an explicitly skeptical test for asynchronous processing. Use at design time, before writing a resource registration, a schema, or a job declaration.
4
+ user-invocable: true
5
+ ---
6
+ <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
7
+
8
+ # Choosing a resource
9
+
10
+ Every OwlMeans feature that keeps or moves data picks from the same short list. The list is short
11
+ on purpose: one `Resource` contract ([[resource]]) covers all of them, so the choice is about
12
+ where the bytes live and when the work runs — not about a new API to learn.
13
+
14
+ This is guidance by **similarity**, not an algorithm. Find the case under "Worked cases" below
15
+ that most resembles what you are building and take its answer; the rules in between say why those
16
+ answers came out that way, and how far you can carry one to a case that is not listed. When two
17
+ options look equally right, pick the one already registered in the app.
18
+
19
+ ## The default
20
+
21
+ **Postgres.** `@owlmeans/postgres-resource` is the answer for records the product owns and the
22
+ product queries: users, orders, projects, comments, settings, audit rows. It gets the default
23
+ because it is the only backend here that gives all of relational integrity, real query planning,
24
+ transactions, and DDL derived from the resource's AJV schema — and because being wrong with it is
25
+ cheap. Nothing else on this page is a place to *start*; each one is a place to move to for a named
26
+ reason.
27
+
28
+ Say "start with Postgres, move only if measured" out loud whenever the argument for something else
29
+ is a guess about load. A resource that turns out to be hot moves later, and the criteria objects,
30
+ paging and sorting come with it unchanged — that portability is what makes deferring the decision
31
+ safe.
32
+
33
+ ## The options
34
+
35
+ | Option | It is for | It is not for |
36
+ |---|---|---|
37
+ | `postgres-resource` | Records with structure, relations, and queries — the default | Anything the schema cannot describe up front |
38
+ | `mongo-resource` | Documents whose shape varies per record or per tenant; deep nesting read whole | Rows you will join, sum, or report across |
39
+ | `redis-resource` | Data with an expiry, a lock, a counter, or a fan-out — and a **small, namespaced** key set | A source of truth, or an unbounded keyspace (`list`/`count` walk it) |
40
+ | `static-resource` | In-process records with no database behind them — fixtures, handshake state, a per-process cache | Anything that must survive a restart or be seen by a second replica |
41
+ | `state` | Client-side records a screen binds to, reached through the context | Anything that must outlive the tab |
42
+ | `client-resource` | Client-side records that must survive a reload, over a key-value store (`web-db` gives the browser one) | A query surface — the whole store is walked per read |
43
+ | `config` | Reading the records the process was configured with, as a resource | Anything written at runtime — every write is refused |
44
+ | `storage-resource` | The **bytes** of a file, in an S3-compatible bucket (upload only) | The record describing the file — that stays in postgres or mongo |
45
+ | `queue` + a worker process | Work that must outlive the request, be retried, or be spread over workers | Anything the request can finish itself (see below) |
46
+ | `llm` / `agent` | Work whose output is judgement or language, not a computation | A rule you can write down |
47
+
48
+ ### Postgres or Mongo
49
+
50
+ Ask what a *reader* does with the record. Filter, sort, join, aggregate, report — Postgres, and
51
+ the AJV schema becomes the table ([[postgres-resource]]). Load whole by id, with a shape that
52
+ differs per record and a nesting depth no column list wants to model — Mongo, and the AJV schema
53
+ becomes the validator ([[mongo-resource]]). Both carry migrations, indexes, locks and the same
54
+ criteria language, so this is a modelling decision, not a capability one.
55
+
56
+ A single varying corner inside an otherwise relational record is not a reason to move the whole
57
+ resource: Postgres maps a nested `object` — and an `array` whose items are not plain scalars — to
58
+ `jsonb`, where a criteria *object* written against the column becomes containment (`@>`). An
59
+ `array` of plain `string`/`integer`/`number`/`boolean` items is a different case: it becomes a
60
+ native array column, queried with `$contains` / `$contained` / `$overlaps`.
61
+
62
+ ### Redis and the four things it is actually good at
63
+
64
+ `redis-resource` earns its place when the data has one of these properties, not when it is merely
65
+ "fast":
66
+
67
+ - **Expiry** — the record is meant to disappear: sessions, OTPs, nonces, magic-link tokens, an
68
+ idempotency key's memory. TTL is a per-call option on `create`/`update`/`save`, and `update`
69
+ rewrites the key, so a renewal must pass the TTL again or the record becomes permanent.
70
+ - **Cache** — a derived value it would be embarrassing to recompute per request. A cache is
71
+ correct only if a miss is invisible to the user; if losing it changes behaviour, it is state, and
72
+ state belongs in the database.
73
+ - **Lock** — one worker at a time, with an expiry so a dead holder does not block forever. Postgres
74
+ and Mongo resources also expose `lock`/`unlock`; use theirs when the lock guards *their* rows.
75
+ - **Counter / rate limit / fan-out** — increments, windows, and pub/sub between processes.
76
+
77
+ The hard limit: reads by id are single-key commands, but `load(where)`, `list`, `count` and `purge`
78
+ **walk the resource's namespace** with `SCAN` and evaluate criteria in memory, unpaged and not
79
+ cluster-safe. A resource that needs real queries belongs in Mongo or Postgres, however hot it is.
80
+
81
+ ### static-resource, state and client-resource
82
+
83
+ `static-resource` is a `Map` at module scope wearing the `Resource` contract. It is right for
84
+ fixtures, a getting-started app with no database, and short-lived handshake state in a
85
+ single-process deployment — and wrong the moment there are two replicas, because each one holds a
86
+ different truth. Do not reach for it as a cache in a scaled service; that is Redis.
87
+
88
+ `state` is the same contract on the client: records a screen binds to through `useStoreModel` /
89
+ `useStoreList`, with `watch`/`query` for the live half. Draft state, the current user, a wizard in
90
+ progress, an optimistic list. It is a store, not a security boundary — the server re-validates
91
+ everything that arrives from it.
92
+
93
+ `client-resource` is the client store that **survives a reload**: same criteria language, backed by
94
+ a key-value store an app registers under `cfg.dbs` (`@owlmeans/web-db` supplies the browser's
95
+ IndexedDB one). Reach for it for an offline cache, a remembered filter set, a queued write waiting
96
+ for connectivity — and expect the cost, because records live under their own ids with one list of
97
+ ids as the only index, so every criteria read walks the store. `state` for what the screen is
98
+ holding right now, `client-resource` for what has to be there tomorrow, the server for the truth.
99
+
100
+ ### Files
101
+
102
+ Bytes go to `storage-resource` (upload only — a bucket has no index). The **record** describing
103
+ them — url, size, mime type, owner, status — goes in a database resource, and that record is what
104
+ answers criteria, sorting and paging. Image-shaped names and schemas for it are in
105
+ [[image-resource]].
106
+
107
+ ## Be skeptical about queues
108
+
109
+ Asynchronous processing is the most over-applied answer on this page. It multiplies the number of
110
+ places a feature can fail, it needs a second process to deploy and watch, and it makes every
111
+ processor a thing that must be safe to run twice. Do not add it because the work "feels heavy".
112
+
113
+ **A request that finishes in under ~2 seconds and makes no external call never queues.** Do it
114
+ inline and return the answer.
115
+
116
+ Asynchronous work earns its complexity when at least one of these is true:
117
+
118
+ 1. **The user would otherwise wait more than ~5 seconds.** Not "the work takes 5 seconds" — the
119
+ *user waits*. Work nobody is watching can still be inline if the caller is a script.
120
+ 2. **It must survive a process restart.** A deploy, an OOM kill, or a pod eviction mid-operation
121
+ would otherwise lose work that was already accepted, and nothing would retry it.
122
+ 3. **It is retried against a third party.** Payment captures, provider syncs, mail sends and
123
+ webhook deliveries fail transiently and must be re-attempted with backoff, without the user
124
+ re-submitting.
125
+
126
+ If none holds, the honest answer is "do it in the request". If exactly one holds, look for the
127
+ smaller fix first: a database index, a batch write, a cached aggregate, or an HTTP call moved off
128
+ the critical path. Reach for the broker when the work is genuinely detached from the request.
129
+
130
+ When you do queue ([[queue]], driver [[redis-queue]]):
131
+
132
+ - A queued call is an ordinary entrypoint call — `job()` in place of `backend()`. Nothing at the
133
+ call site says "queue", so this stays a declaration change.
134
+ - Derive `JobOptions.id` from what the job is ABOUT (`develop:<storyId>`) and a duplicate enqueue
135
+ is a no-op. That is what makes an admission step safe to retry.
136
+ - `reply: false` is fire-and-forget; the default waits for the value. Choose deliberately.
137
+ - Every processor must be safe to run twice, and `touch()` in every long loop — the broker judges
138
+ liveness by the lock, and silence past `lockDuration` re-runs the job somewhere else.
139
+ - Retries default to one attempt, which is right for expensive work and wrong for cheap idempotent
140
+ work — set `attempts` per queue.
141
+ - Work that fans out into steps is one `flow(root)` graph, not a processor that enqueues its own
142
+ successors: children complete before the parent runs and it reads their results through
143
+ `children()`. Give the children of a cross-queue flow distinct ids.
144
+
145
+ **Recurring work is a schedule.** `JobOptions.delay` defers one job once; anything recurring — a
146
+ nightly digest, an hourly reconciliation — is `declareSchedule(cfg, { id, queue, name, every |
147
+ pattern })` in the shared package plus a processor registered for that job name
148
+ ([[scheduled-jobs]]). Every worker that listens to the queue keeps the broker's schedulers in line
149
+ with the declarations, so adding, changing and deleting a schedule is a code change. A scheduled
150
+ run is a processor job, never a guarded entrypoint call. Reach for a platform cron (a Kubernetes
151
+ `CronJob` in a [[kluster]] deployment) calling an entrypoint only when no worker may be running:
152
+ the broker produces a schedule's next run only while a process consumes its queue. Never simulate
153
+ cron with a self-re-enqueueing job.
154
+
155
+ ## Model-driven work
156
+
157
+ Reach for [[llm]] when the output is language or judgement — summaries, classification with fuzzy
158
+ boundaries, extraction from prose, moderation, translation — and for [[agent]] when the work needs
159
+ several turns, tools, or memory across a conversation. Everything a rule can express should stay a
160
+ rule: a regex, a criteria object, or an AJV schema is cheaper, deterministic, and testable.
161
+
162
+ Model calls are slow and paid for per attempt, so they interact with the previous section:
163
+
164
+ - A single `ask` behind a user's click is fine inline when it streams; the user sees progress.
165
+ - A pipeline of calls, or work over many records, is queue work — it is exactly case 1 and 3 above.
166
+ - A blind retry re-spends the tokens that just failed. That is why queue retries default to one.
167
+ - Store the *result* in a normal resource. A model output nobody persisted will be paid for again.
168
+
169
+ ## Choosing more than one
170
+
171
+ Most real features use two. A file upload is `storage-resource` for the bytes plus a Postgres row
172
+ for the record. A rate limiter is Redis for the window plus Postgres for the policy. An import is
173
+ a Postgres staging table plus a queue for the work plus Redis for the progress the UI polls. Split
174
+ by property — durability, expiry, size, latency — and let each part sit where that property is
175
+ cheap.
176
+
177
+ ## Worked cases
178
+
179
+ Find the row that most resembles what you are building. The answer is a starting point with a
180
+ reason attached, not a verdict — if your case differs in a way the rules above care about, the
181
+ answer changes with it. `postgres` / `mongo` / `redis` / `static` / `client` / `storage` below mean
182
+ the matching `@owlmeans/*-resource` package, `state` and `config` the packages of those names, and
183
+ `queue` means `@owlmeans/queue` plus a worker process.
184
+
185
+ ### Records and reads
186
+
187
+ | Case | Choice | Why |
188
+ |---|---|---|
189
+ | Audit log | postgres | Append-only rows that are filtered, sorted and paged by whoever reads them; retention is a scheduled delete, not a TTL. |
190
+ | Domain records (orders, projects, tickets) | postgres | The default: structure, relations, transactions, one AJV schema that becomes the table. |
191
+ | Per-tenant custom forms / submissions | mongo | The shape differs per tenant, so no column list fits; each submission is read whole by id. |
192
+ | Generated-app content documents | mongo | Deeply nested, revised whole, never aggregated across. |
193
+ | Settings / feature flags per organization entity | postgres | Few rows, read constantly, always by `entityId` — cache in Redis only after measuring, and only if a stale read is harmless. |
194
+ | Search over the product's own records | postgres | Start with indexed columns and `jsonb` containment; move to a search engine when a measured query, not a guess, says so. |
195
+ | Expensive aggregate on a dashboard | postgres, then redis | Compute it in SQL first. Cache in Redis with a TTL only once the measured query is genuinely slow — a miss must stay invisible. |
196
+ | Analytics rollups | postgres + queue schedule | The rollup is a batch write into its own table; a declared schedule produces the run and a processor does it, surviving restarts. |
197
+ | Leaderboard | postgres, redis if hot | A ranked query with an index is enough for most products; move the live top-N into a Redis counter set when it is read far more often than written. |
198
+ | Invoice numbering | postgres | A gapless sequence is a transaction and a unique constraint, not a Redis counter — a lost increment is an accounting problem. |
199
+ | Records the process was started with (plugins, seeded routes) | config | Already in `cfg`; reading them as a resource gives criteria and sorting without a second store, and every write is refused by design. |
200
+
201
+ ### Expiring, counting, coordinating
202
+
203
+ | Case | Choice | Why |
204
+ |---|---|---|
205
+ | Session / OTP cache | redis | Records defined by their expiry; losing one is a re-login, not data loss. Pass the TTL again on every renewal. |
206
+ | Password reset token | redis | Single-use and short-lived: `take(id)` hands the record to exactly one caller and throws for the second. |
207
+ | Rate limiting | redis | A counter in a window, shared across replicas, that must expire on its own. |
208
+ | Counters (views, usage quotas) | redis, reconciled to postgres | Increment in Redis for speed; the billable total belongs in the database, written periodically. |
209
+ | Presence / typing indicators | redis | Sub-minute TTL plus pub/sub; nothing is worth persisting. |
210
+ | Distributed lock | redis, or the owning resource's `lock` | Redis when the lock guards a process or a third party; the Postgres/Mongo resource's own `lock`/`unlock` when it guards its rows. |
211
+ | Idempotency keys for an API | redis | The memory only has to outlive the retry window, and expiry is the cleanup. |
212
+ | Webhook signature nonce cache | redis | Replay protection is exactly a key with a TTL. |
213
+ | Handshake state in a single-process dev app | static | In-process `Map` with no database; wrong the moment there are two replicas. |
214
+ | Fixtures / seeded demo data | static | Records reachable through the context with nothing behind them. |
215
+
216
+ ### Client side
217
+
218
+ | Case | Choice | Why |
219
+ |---|---|---|
220
+ | Wizard draft | state (`single: true`) | It belongs to the screen until submitted; only the final submit is a server write. |
221
+ | Shopping cart | state, plus postgres when it must persist | Anonymous cart lives on the client; a cart that survives a device change is a database record keyed by user. |
222
+ | Optimistic list updates | state | The store the screen binds to, re-validated by the server on write. |
223
+ | Notifications feed | postgres, delivered live over sockets | Rows with read/unread state that page; `state` mirrors them for rendering, it does not own them. |
224
+ | Offline cache of server records | client (`web-db` in the browser) | Must survive a reload and a lost connection; reads walk the store, so keep the set small and re-sync from the server. |
225
+ | Remembered UI preferences (filters, layout) | client | A handful of records per user that must outlive the tab, with nothing on the server worth a row. |
226
+
227
+ ### Files and bytes
228
+
229
+ | Case | Choice | Why |
230
+ |---|---|---|
231
+ | File upload | storage + postgres | Bytes to the bucket, the record (url, size, mime, owner) in the database — a bucket has no index to query. |
232
+ | File post-processing (thumbnails, virus scan) | queue | Survives a restart, retried against tools that fail transiently, and the user must not wait for it. |
233
+ | PDF / report generation | queue | Multi-second CPU work whose result is a stored file; return a job id, deliver the file when it exists. |
234
+ | GDPR data export | queue + storage | Minutes of reads across every resource, produced once, downloaded later from a bucket. |
235
+ | OCR | queue + llm/model call | External, slow, retried — every reason on the list at once. |
236
+
237
+ ### Asynchronous work and third parties
238
+
239
+ | Case | Choice | Why |
240
+ |---|---|---|
241
+ | Long CSV / JSON import | queue, staged in postgres | The user cannot hold a request open for thousands of rows, and a half-finished import must be resumable. |
242
+ | Bulk email | queue | Thousands of provider calls, each retried independently; one bad address must not fail the batch. |
243
+ | Transactional email (one recipient, one event) | inline | A single provider call inside the request; queue it only if the send is on a user's critical path and the provider is slow. |
244
+ | Payment capture | queue with idempotent job ids | Retried against a third party, must survive a restart, must never double-charge — derive the job id from the payment. |
245
+ | Third-party sync / reconciliation | queue schedule | Recurring, long, retried; a pattern schedule on a low-concurrency queue, and the processor re-reads the third party as the truth so a re-run is harmless. |
246
+ | Webhook fan-out | queue, one job per subscriber | Per-endpoint retries and backoff; a slow subscriber must not delay the others. |
247
+ | Scheduled digest | queue schedule | Same shape as any recurring batch — the schedule produces the run, the worker sends. |
248
+ | Scheduled reminders | postgres row + scheduled sweep, or `JobOptions.delay` | Use `delay` for a one-shot minutes-away nudge; anything cancellable or far in the future is a row a scheduled sweep picks up. |
249
+ | Recurring job where no worker process runs | platform `CronJob` calling an entrypoint | A schedule needs a consumer; a deployment with none triggers from outside and goes through the entrypoint's guards. |
250
+ | Inbound webhook handling | inline ack, queue the work | Answer 2xx immediately, then process — a third party's retry policy is not a design input for your handler. |
251
+ | Cache warmup after a deploy | queue, or nothing | Usually not worth it: let the first requests populate the cache unless a measured cold-start hurts. |
252
+
253
+ ### Model-driven features
254
+
255
+ | Case | Choice | Why |
256
+ |---|---|---|
257
+ | Chat with an assistant | agent, streamed inline; postgres for the transcript | The user is watching, so stream rather than queue; persist the conversation as ordinary records. |
258
+ | Content moderation by model | llm + queue | Every rule that can be written down stays a rule; the model handles the rest, off the request path. |
259
+ | Translation of stored content | llm + queue | Batch work over many records, paid per attempt, retried carefully — never on a page render. |
260
+ | Recommendations refresh | llm or postgres batch + queue | A periodic recompute whose output is stored; the read path only ever reads the stored result. |
261
+ | Summarizing a long document on demand | llm inline if streamed, else queue | A single streamed `ask` keeps the user informed; a pipeline over sections is queue work. |
262
+
263
+ ## Related
264
+
265
+ - [[resource]] — the contract every option implements, and the criteria language they share
266
+ - [[postgres-resource]], [[mongo-resource]], [[redis-resource]], [[static-resource]],
267
+ [[state]], [[client-resource]], [[web-db]], [[owlmeans-config]], [[storage-resource]] — the backends
268
+ - [[queue]], [[redis-queue]] — job queues and the worker process
269
+ - [[scheduled-jobs]] — recurring work on a queue schedule
270
+ - [[llm]], [[agent]] — model-driven work
271
+ - [[reuse-code]] — find the `@owlmeans/*` package before designing anything new
package/build/consts.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import type { JSONSchemaType } from 'ajv';
2
- import type { ListResult, ResourceRecord } from './types.js';
3
1
  /**
4
2
  * When a migration runs relative to the structure reconciliation a db implementation
5
3
  * performs at resource initialization.
@@ -16,5 +14,4 @@ export declare enum MigrationStage {
16
14
  Pre = "pre",
17
15
  Post = "post"
18
16
  }
19
- export declare const createListSchema: <T extends ResourceRecord>(schema: JSONSchemaType<T>) => JSONSchemaType<ListResult<T>>;
20
17
  //# sourceMappingURL=consts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE5D;;;;;;;;;;;GAWG;AACH,oBAAY,cAAc;IACxB,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AAED,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,cAAc,EAAE,QAAQ,cAAc,CAAC,CAAC,CAAC,KAAG,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,CAsBjH,CAAA"}
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;GAWG;AACH,oBAAY,cAAc;IACxB,GAAG,QAAQ;IACX,IAAI,SAAS;CACd"}
package/build/consts.js CHANGED
@@ -15,27 +15,4 @@ export var MigrationStage;
15
15
  MigrationStage["Pre"] = "pre";
16
16
  MigrationStage["Post"] = "post";
17
17
  })(MigrationStage || (MigrationStage = {}));
18
- export const createListSchema = (schema) => ({
19
- type: 'object',
20
- properties: {
21
- items: {
22
- type: 'array',
23
- items: {
24
- ...schema,
25
- type: 'object',
26
- properties: {
27
- id: { type: 'string', nullable: true },
28
- ...schema.properties
29
- },
30
- ...(schema.required ? { required: [...schema.required] } : undefined),
31
- additionalProperties: false,
32
- }
33
- },
34
- total: { type: 'number' },
35
- page: { type: 'number', nullable: true },
36
- size: { type: 'number', nullable: true }
37
- },
38
- required: ['items', 'total'],
39
- additionalProperties: false,
40
- });
41
18
  //# sourceMappingURL=consts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,+BAAa,CAAA;AACf,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAA2B,MAAyB,EAAiC,EAAE,CAAC,CAAC;IACvH,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,KAAK,EAAE;YACL,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,GAAG,MAAM;gBACT,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;oBACtC,GAAG,MAAM,CAAC,UAAU;iBACrB;gBACD,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACrE,oBAAoB,EAAE,KAAK;aAC5B;SACF;QACD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACxC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;KACzC;IACD,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;IAC5B,oBAAoB,EAAE,KAAK;CAC5B,CAAC,CAAA"}
1
+ {"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;GAWG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,+BAAa,CAAA;AACf,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB"}
package/build/errors.d.ts CHANGED
@@ -1,20 +1,33 @@
1
1
  import { ResilientError } from '@owlmeans/error';
2
+ /**
3
+ * The storage refusal family. A class that answers the caller's request declares the HTTP status
4
+ * an `@owlmeans/server-api` boundary answers it with (`static httpStatus`, inherited through the
5
+ * constructor chain): an absent record 404, a taken id or unique key 409. A fault — a misshaped
6
+ * record, an unsupported argument, a failed migration — declares nothing and answers 500.
7
+ */
2
8
  export declare class ResourceError extends ResilientError {
3
9
  static typeName: string;
4
10
  constructor(message?: string);
5
11
  }
12
+ /** The addressed record does not exist (`get`, `update`, `take` of an absent id or criteria). */
6
13
  export declare class UnknownRecordError extends ResourceError {
7
14
  static typeName: string;
15
+ /** The addressed record is absent: answered 404. */
16
+ static httpStatus: number;
8
17
  static readonly idSeparator: string;
9
18
  constructor(id: string);
19
+ /** Everything after the first separator — an id or a criteria description may contain one. */
10
20
  get id(): string;
11
21
  }
12
22
  export declare class MisshapedRecord extends ResourceError {
13
23
  static typeName: string;
14
24
  constructor(msg: string);
15
25
  }
26
+ /** A record under that id or unique key is already stored (`create`, a unique-index violation). */
16
27
  export declare class RecordExists extends ResourceError {
17
28
  static typeName: string;
29
+ /** The id or unique key is taken: answered 409. */
30
+ static httpStatus: number;
18
31
  constructor(msg: string);
19
32
  }
20
33
  export declare class RecordUpdateFailed extends ResourceError {
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAG,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEjD,qBAAa,aAAc,SAAQ,cAAc;IAC/C,OAAuB,QAAQ,SAAkB;gBAErC,OAAO,GAAE,MAAgB;CAGtC;AAED,qBAAa,kBAAmB,SAAQ,aAAa;IACnD,OAAuB,QAAQ,SAAgD;IAE/E,gBAAuB,WAAW,EAAE,MAAM,CAAM;gBAEpC,EAAE,EAAE,MAAM;IAKtB,IAAI,EAAE,IAAI,MAAM,CAEf;CACF;AAED,qBAAa,eAAgB,SAAQ,aAAa;IAChD,OAAuB,QAAQ,SAA6C;gBAEhE,GAAG,EAAE,MAAM;CAIxB;AAED,qBAAa,YAAa,SAAQ,aAAa;IAC7C,OAAuB,QAAQ,SAA0C;gBAE7D,GAAG,EAAE,MAAM;CAIxB;AAED,qBAAa,kBAAmB,SAAQ,aAAa;IACnD,OAAuB,QAAQ,SAAgD;gBAEnE,GAAG,EAAE,MAAM;CAIxB;AAED,qBAAa,wBAAyB,SAAQ,aAAa;IACzD,OAAuB,QAAQ,SAAsD;gBAEzE,QAAQ,EAAE,MAAM;CAI7B;AAED,qBAAa,sBAAuB,SAAQ,aAAa;IACvD,OAAuB,QAAQ,SAAoD;gBAEvE,MAAM,EAAE,MAAM;CAI3B;AAED;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,aAAa;IAC/C,OAAuB,QAAQ,SAA4C;gBAE/D,GAAG,EAAE,MAAM;CAIxB;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ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MAAM,EAGtB;CACF;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,aAAa;IAClD,OAAuB,QAAQ,SAA+C;IAE9E,YAAY,GAAG,EAAE,MAAM,EAGtB;CACF"}
package/build/errors.js CHANGED
@@ -1,19 +1,30 @@
1
1
  import { ResilientError } from '@owlmeans/error';
2
+ /**
3
+ * The storage refusal family. A class that answers the caller's request declares the HTTP status
4
+ * an `@owlmeans/server-api` boundary answers it with (`static httpStatus`, inherited through the
5
+ * constructor chain): an absent record 404, a taken id or unique key 409. A fault — a misshaped
6
+ * record, an unsupported argument, a failed migration — declares nothing and answers 500.
7
+ */
2
8
  export class ResourceError extends ResilientError {
3
9
  static typeName = 'ResourceError';
4
10
  constructor(message = 'error') {
5
11
  super(ResourceError.typeName, `resource:${message}`);
6
12
  }
7
13
  }
14
+ /** The addressed record does not exist (`get`, `update`, `take` of an absent id or criteria). */
8
15
  export class UnknownRecordError extends ResourceError {
9
16
  static typeName = `${ResourceError.typeName}UnknownRecordError`;
17
+ /** The addressed record is absent: answered 404. */
18
+ static httpStatus = 404;
10
19
  static idSeparator = '/';
11
20
  constructor(id) {
12
21
  super(`unknown-record${UnknownRecordError.idSeparator}${id}`);
13
22
  this.type = UnknownRecordError.typeName;
14
23
  }
24
+ /** Everything after the first separator — an id or a criteria description may contain one. */
15
25
  get id() {
16
- return this.message.split(UnknownRecordError.idSeparator)[1];
26
+ const at = this.message.indexOf(UnknownRecordError.idSeparator);
27
+ return at < 0 ? '' : this.message.slice(at + UnknownRecordError.idSeparator.length);
17
28
  }
18
29
  }
19
30
  export class MisshapedRecord extends ResourceError {
@@ -23,8 +34,11 @@ export class MisshapedRecord extends ResourceError {
23
34
  this.type = MisshapedRecord.typeName;
24
35
  }
25
36
  }
37
+ /** A record under that id or unique key is already stored (`create`, a unique-index violation). */
26
38
  export class RecordExists extends ResourceError {
27
39
  static typeName = `${ResourceError.typeName}RecordExists`;
40
+ /** The id or unique key is taken: answered 409. */
41
+ static httpStatus = 409;
28
42
  constructor(msg) {
29
43
  super(`record-exists:${msg}`);
30
44
  this.type = RecordExists.typeName;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAG,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,OAAO,aAAc,SAAQ,cAAc;IACxC,MAAM,CAAU,QAAQ,GAAG,eAAe,CAAA;IAEjD,YAAY,UAAkB,OAAO;QACnC,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,YAAY,OAAO,EAAE,CAAC,CAAA;IACtD,CAAC;;AAGH,MAAM,OAAO,kBAAmB,SAAQ,aAAa;IAC5C,MAAM,CAAU,QAAQ,GAAG,GAAG,aAAa,CAAC,QAAQ,oBAAoB,CAAA;IAExE,MAAM,CAAU,WAAW,GAAW,GAAG,CAAA;IAEhD,YAAY,EAAU;QACpB,KAAK,CAAC,iBAAiB,kBAAkB,CAAC,WAAW,GAAG,EAAE,EAAE,CAAC,CAAA;QAC7D,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC,QAAQ,CAAA;IACzC,CAAC;IAED,IAAI,EAAE;QACJ,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;IAC9D,CAAC;;AAGH,MAAM,OAAO,eAAgB,SAAQ,aAAa;IACzC,MAAM,CAAU,QAAQ,GAAG,GAAG,aAAa,CAAC,QAAQ,iBAAiB,CAAA;IAE5E,YAAY,GAAW;QACrB,KAAK,CAAC,oBAAoB,GAAG,EAAE,CAAC,CAAA;QAChC,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,QAAQ,CAAA;IACtC,CAAC;;AAGH,MAAM,OAAO,YAAa,SAAQ,aAAa;IACtC,MAAM,CAAU,QAAQ,GAAG,GAAG,aAAa,CAAC,QAAQ,cAAc,CAAA;IAEzE,YAAY,GAAW;QACrB,KAAK,CA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D,cAAc,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAA;AAC/C,cAAc,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;AACrD,cAAc,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,CAAA;AAC3D,cAAc,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,CAAA;AACzD,cAAc,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAA;AACjD,cAAc,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,EAAE,EAAE,KAAK,CAAC,EAAE,OAAO,MAAM,EAAE,KAAG,CAMxD,CAAA"}
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,MAAM,EAAE,KAAG,CAMxD,CAAA"}
package/build/index.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  export * from './errors.js';
2
2
  export * from './consts.js';
3
+ export * from './utils.js';
3
4
  export * from './service.js';
4
5
  export * from './helper.js';
5
6
  export * from './utils/query.js';
7
+ export type * from './utils/query/types.js';
6
8
  export * from './migration.js';
7
9
  export type * from './types.js';
8
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,mBAAmB,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,mBAAmB,wBAAwB,CAAA;AAC3C,cAAc,gBAAgB,CAAA;AAC9B,mBAAmB,YAAY,CAAA"}
package/build/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './errors.js';
2
2
  export * from './consts.js';
3
+ export * from './utils.js';
3
4
  export * from './service.js';
4
5
  export * from './helper.js';
5
6
  export * from './utils/query.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAEhC,cAAc,gBAAgB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../src/migration.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACC,iBAAiB,EAAE,eAAe,EAAE,mBAAmB,EAAE,cAAc,EACnF,MAAM,YAAY,CAAA;AAqBnB;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,EAAE,GAAG,OAAO,OAAK,iBAAiB,CAAC,EAAE,CA+B5E,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,GAAU,EAAE,GAAG,OAAO,EAC9C,OAAO,MAAM,EACb,UAAU,iBAAiB,CAAC,EAAE,CAAC,EAC/B,OAAO,cAAc,CAAC,EAAE,CAAC,EACzB,OAAO,mBAAmB,KACzB,OAAO,CAAC,eAAe,CAqDzB,CAAA"}
1
+ {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../src/migration.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACC,iBAAiB,EAAE,eAAe,EAAE,mBAAmB,EAAE,cAAc,EACnF,MAAM,YAAY,CAAA;AAqBnB;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,EAAE,GAAG,OAAO,OAAK,iBAAiB,CAAC,EAAE,CA+B5E,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,GAAU,EAAE,GAAG,OAAO,SACvC,MAAM,YACH,iBAAiB,CAAC,EAAE,CAAC,SACxB,cAAc,CAAC,EAAE,CAAC,SAClB,mBAAmB,KACzB,OAAO,CAAC,eAAe,CAqDzB,CAAA"}
Binary file
@@ -1 +1 @@
1
- {"version":3,"file":"migration.js","sourceRoot":"","sources":["../src/migration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAK/D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,KAAe,EAAU,EAAE,CACzD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,IAAI,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;AAE9F;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,G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C,OAAO,CAAC,EAAE,OAAO,UAAU,CAAC,OAAO,CAAC,KAAG,OAqFzE,CAAA"}
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,EAA6B,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAG9E,eAAO,MAAM,eAAe,GAC1B,EAAE,EAAE,MAAM,EAAE,OAAO,SAAS,iBAAiB,CAAC,EAAE,EAAE,MAAM,CAAC,GAAG,iBAAiB,CAAC,EAAE,EAAE,MAAM,CAAC,SAClF,MAAM,YAAY,OAAO,CAAC,OAAO,CAAC,SAAS,UAAU,CAAC,OAAO,CAAC,KAAG,OAqFzE,CAAA"}
package/build/types.d.ts CHANGED
@@ -110,7 +110,9 @@ export interface Resource<T extends ResourceRecord> extends BasicResource {
110
110
  /** Bulk delete. Refuses an empty criteria object rather than emptying the resource. */
111
111
  purge(where: Criteria<T>): Promise<number>;
112
112
  }
113
- export type Unsubscribe = () => Promise<void>;
113
+ export interface Unsubscribe {
114
+ (): Promise<void>;
115
+ }
114
116
  export interface SubscribeOptions {
115
117
  channel?: string;
116
118
  once?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC9F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ;AAED,sDAAsD;AACtD,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,CAAC,CAAA;IACP,GAAG,CAAC,EAAE,CAAC,CAAA;IACP,GAAG,CAAC,EAAE,CAAC,CAAA;IACP,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AAE,cAAc,CAAA;IACrB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,MAAM,WAAW,MAAO,SAAQ,WAAW;IACzC,GAAG,CAAC,EAAE,QAAQ,EAAE,CAAA;CACjB;AAED,MAAM,WAAW,OAAO,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,YAAY,CAAC,CAAC,CAAC;CAC1E"}
@@ -0,0 +1,2 @@
1
+ export declare const COMPARISON: Set<string>;
2
+ //# sourceMappingURL=consts.local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../../src/utils/consts.local.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,aAAwD,CAAA"}
@@ -0,0 +1,2 @@
1
+ export const COMPARISON = new Set(['$eq', '$ne', '$gt', '$gte', '$lt', '$lte']);
2
+ //# sourceMappingURL=consts.local.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../../src/utils/consts.local.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"name.d.ts","sourceRoot":"","sources":["../../src/utils/name.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAC,MAAM,aAAa,CAAA;AAE7E,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EACxE,UAAU,CAAC,EAAE,SAAS,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,QAAQ,QAAQ,WAClB,CAAA"}
1
+ {"version":3,"file":"name.d.ts","sourceRoot":"","sources":["../../src/utils/name.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE/E,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,YAC9D,CAAC,WAAW,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,UAAU,QAAQ,KAClE,MAAwD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"name.js","sourceRoot":"","sources":["../../src/utils/name.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,QAAW,EAAE,OAAoC,EAAE,MAAgB,EACnE,EAAE,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAA"}
1
+ {"version":3,"file":"name.js","sourceRoot":"","sources":["../../src/utils/name.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,QAAW,EAAE,OAAoC,EAAE,MAAgB,EAC3D,EAAE,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAA"}
@@ -0,0 +1,35 @@
1
+ import type { Criteria, ListOptions, ListResult, ResourceRecord, Sort } from '../../types.js';
2
+ /**
3
+ * In-memory evaluation of `Criteria<any>` — the engine every store without a query language of its
4
+ * own (state, static, client, redis) answers a criteria object through.
5
+ */
6
+ export interface RecordQueryHelper {
7
+ /**
8
+ * Whether one record satisfies the criteria.
9
+ *
10
+ * `undefined` as a criteria value is skipped rather than compared — it is what an optional filter
11
+ * looks like when nothing was chosen, and treating it as "must be undefined" makes an unset
12
+ * dropdown filter the list down to nothing.
13
+ *
14
+ * @throws {UnsupportedArgumentError} on an unknown operator.
15
+ */
16
+ matchCriteria: <T extends ResourceRecord>(record: T, criteria?: Criteria<any>) => boolean;
17
+ /** Every record the criteria accepts, in insertion order. */
18
+ filterRecords: <T extends ResourceRecord>(records: T[], criteria?: Criteria<any>) => T[];
19
+ /**
20
+ * Sort a copy. A bare field name is ascending; `{ field, order: 'desc' }` reverses it — the same
21
+ * meaning every backend gives it, so a sort written for one store orders the same way against
22
+ * another.
23
+ */
24
+ sortRecords: <T extends ResourceRecord>(records: T[], sort?: Sort<any>[]) => T[];
25
+ /** The first record the criteria accepts, honouring the sort. */
26
+ firstMatch: <T extends ResourceRecord>(records: T[], where?: Criteria<any>, opts?: {
27
+ sort?: Sort<any>[];
28
+ }) => T | null;
29
+ /**
30
+ * Filter, sort and page an in-memory record set into the shape every resource answers with.
31
+ * `size` is opt-in: an in-memory store returns everything when none is asked for.
32
+ */
33
+ applyQuery: <T extends ResourceRecord>(records: T[], where?: Criteria<any>, opts?: ListOptions<any>) => ListResult<T>;
34
+ }
35
+ //# sourceMappingURL=types.d.ts.map