@nxgt/janus 0.18.0 → 0.19.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.
Files changed (33) hide show
  1. package/README.md +37 -11
  2. package/dist/auth/port/assert-stores.d.ts.map +1 -1
  3. package/dist/auth/port/memory/users.d.ts.map +1 -1
  4. package/dist/auth/port/types/stores.d.ts +5 -0
  5. package/dist/auth/port/types/stores.d.ts.map +1 -1
  6. package/dist/auth/port/types/users.d.ts +17 -0
  7. package/dist/auth/port/types/users.d.ts.map +1 -1
  8. package/dist/auth/types/user-type.d.ts +15 -0
  9. package/dist/auth/types/user-type.d.ts.map +1 -1
  10. package/dist/auth/users/find-many.d.ts +29 -0
  11. package/dist/auth/users/find-many.d.ts.map +1 -0
  12. package/dist/auth/users/record-flows.d.ts.map +1 -1
  13. package/dist/chunks/{index-kvjj5xkp.js → index-6bjfv4xv.js} +8 -2
  14. package/dist/chunks/{index-kvjj5xkp.js.map → index-6bjfv4xv.js.map} +3 -3
  15. package/dist/conformance/cases/outage.d.ts.map +1 -1
  16. package/dist/conformance/cases/users/batch.d.ts +8 -0
  17. package/dist/conformance/cases/users/batch.d.ts.map +1 -0
  18. package/dist/conformance/cases/users/index.d.ts.map +1 -1
  19. package/dist/conformance/describe.d.ts +2 -1
  20. package/dist/conformance/describe.d.ts.map +1 -1
  21. package/dist/conformance/index.d.ts +1 -1
  22. package/dist/conformance/index.d.ts.map +1 -1
  23. package/dist/conformance/index.js +104 -44
  24. package/dist/conformance/index.js.map +7 -6
  25. package/dist/conformance/types.d.ts +10 -2
  26. package/dist/conformance/types.d.ts.map +1 -1
  27. package/dist/index.js +59 -7
  28. package/dist/index.js.map +6 -5
  29. package/docs/guide/adapters.md +44 -4
  30. package/docs/guide/users.md +48 -0
  31. package/docs/roadmap.md +12 -14
  32. package/docs/troubleshooting.md +39 -2
  33. package/package.json +1 -1
package/README.md CHANGED
@@ -348,6 +348,11 @@ await clinic.staff.signIn({ username, password });
348
348
  const current = await clinic.authenticate(request);
349
349
  if (current?.user.type === 'staff') current.user.service; // narrowed by type
350
350
  await clinic.authenticate(request, { type: 'staff' }); // a patient's session → null
351
+
352
+ // Several users by id, in one query: a 100-row staff list, one round trip
353
+ const members = await clinic.staff.findMany(rows.map((row) => row.staffId));
354
+ const byId = new Map(members.map((member) => [member.id, member]));
355
+ const shown = rows.map((row) => ({ ...row, active: byId.get(row.staffId)?.active ?? false }));
351
356
  ```
352
357
 
353
358
  `janus()` assembles **synchronously and with no I/O**: it checks that every
@@ -372,11 +377,19 @@ else reaches the store and is asynchronous.
372
377
  `verifyEmail`, no `resetPassword`, no `signInCode` and no `magicLink` — they
373
378
  are absent from its type, not failing at run time. Changing the e-mail sets `emailVerified`
374
379
  back to `false`.
375
- - **Per type**: `create`, `find` (or `null`), `get` (or `NOT_FOUND`), `list`,
376
- `update(user, patch)` — merged over the stored fields, then validated whole —
377
- `setActive` and `delete`; with a password, `signUp`, `signIn`, `findByLogin`,
378
- `setPassword` and `changePassword`. Every write but `delete` takes an
379
- optional `ifVersion`.
380
+ - **Per type**: `create`, `find` (or `null`), `findMany`, `get` (or
381
+ `NOT_FOUND`), `list`, `update(user, patch)` — merged over the stored fields,
382
+ then validated whole — `setActive` and `delete`; with a password, `signUp`,
383
+ `signIn`, `findByLogin`, `setPassword` and `changePassword`. Every write but
384
+ `delete` takes an optional `ifVersion`.
385
+ - **`findMany(ids)`** answers the type's users **in the order the ids were
386
+ given**, each once — a repeated id at its first place. An id `find` answers
387
+ `null` for — malformed, unknown, another type's — is **left out**, so match
388
+ by `user.id`, never by position. `[]` answers `[]` without reaching the
389
+ store; a long list is read 100 ids per query. One query when the users store
390
+ implements the optional `findUsers` (the reference store, `janus-drizzle`,
391
+ `janus-mongo`); otherwise `findUser`, ten at a time
392
+ ([users](docs/guide/users.md#several-users-at-once--findmany)).
380
393
  - **`delete(user)`** deletes the user together with every session and one-time
381
394
  token they had, so nothing of theirs is kept: a token holds the e-mail it was
382
395
  sent to. The user goes first, so an outage half-way leaves only sessions and
@@ -1005,7 +1018,7 @@ describeJanusStores({
1005
1018
  });
1006
1019
  ```
1007
1020
 
1008
- There are 55 cases. They cover:
1021
+ There are 58 cases. They cover:
1009
1022
  - round-trip, byte for byte — including every edge character the core lets
1010
1023
  through (control characters, U+FFFF, a surrogate pair);
1011
1024
  - uniqueness, as a constraint: of twenty concurrent inserts of one login,
@@ -1032,9 +1045,16 @@ There are 55 cases. They cover:
1032
1045
  removed by one that names `null`;
1033
1046
  - deletion: a user's logins are freed, and every session and token of theirs
1034
1047
  goes, with a replay answering `false` or `0` rather than failing;
1035
- - **outages**, one case for each of the fourteen methods whose honest answer can
1048
+ - the optional `users.findUsers`: each stored user once, whatever its type, an
1049
+ id nobody holds left out, and `[]` — never `null` — when nobody holds any;
1050
+ - **outages**, one case for each of the fifteen methods whose honest answer can
1036
1051
  be "nothing".
1037
1052
 
1053
+ **An optional method a store lacks skips its cases, with the reason** — a
1054
+ store without `sessions.deleteExpiredSessions` or `users.findUsers` passes the
1055
+ suite. A case's `needs` names what it cannot run without, one `CaseNeed` or a list
1056
+ (`outage.findUsers` needs `['faults', 'findUsers']`).
1057
+
1038
1058
  The suite imports no test framework and no assertion library. It runs under
1039
1059
  `bun test`, vitest and jest. Its cases are also exported as data
1040
1060
  (`allCases`, or by store: `userStoreCases`, `sessionStoreCases`,
@@ -1316,6 +1336,12 @@ stored fields and the result is checked against the schema, so a patch can
1316
1336
  never leave a user that the schema would refuse. Pass `ifVersion` to make the
1317
1337
  write conditional on what you read.
1318
1338
 
1339
+ **`findMany` answers fewer users than ids, never `null` in their place.** An
1340
+ unknown, malformed or other type's id is left out and a repeated one answered
1341
+ once, so `users[i]` is not the user of `ids[i]`: build a `Map` by `user.id`.
1342
+ An outage is `STORE_FAILED`, never a shorter list — a row whose user is
1343
+ missing from the answer is one nobody holds.
1344
+
1319
1345
  **Under `bun test`, pass `runner: { describe, it }`.** Measured: Bun gives a
1320
1346
  test file `describe` and `it` as bare identifiers, not as properties of
1321
1347
  `globalThis`. jest, and vitest with `globals: true`, are found without it.
@@ -1381,18 +1407,18 @@ that sends one, since it is awaited: queue the event and return.
1381
1407
 
1382
1408
  ## Type safety, counted
1383
1409
 
1384
- **One hundred and fifty-two plausible mistakes, one hundred and fifty-two refused at compile time — and
1410
+ **One hundred and fifty-five plausible mistakes, one hundred and fifty-five refused at compile time — and
1385
1411
  two gaps, named.**
1386
1412
 
1387
1413
  The lists are typechecked and never run, with one `@ts-expect-error` per
1388
1414
  mistake beside the shapes that must keep compiling. One is a single file:
1389
1415
  `test/types/refusals.ts` (fifteen, on the shared vocabulary). The other three
1390
- are folders with one file per behaviour: `test/types/port/` (twenty-four, on
1416
+ are folders with one file per behaviour: `test/types/port/` (twenty-five, on
1391
1417
  the identity stores' port, from the point of view of the person implementing
1392
- it), `test/types/auth/` (sixty-five, on `janus()`, from the point of view of
1418
+ it), `test/types/auth/` (sixty-seven, on `janus()`, from the point of view of
1393
1419
  the application — twelve of them on the second factor, three on sign-in codes,
1394
1420
  five on user events, four on step-ups, six on the sign-in throttle, five on the mail throttle, four on
1395
- sign-in links, six on devices) and `test/types/permissions/` (forty-eight, on the
1421
+ sign-in links, six on devices, two on `findMany`) and `test/types/permissions/` (forty-eight, on the
1396
1422
  permission model and the questions asked of it). The rule comes from
1397
1423
  `nxgt-data`, and so does the reason to distrust the claim without the files:
1398
1424
  when it was last measured on `@nxgt/mongo`, *seven of twelve plausible
@@ -1 +1 @@
1
- {"version":3,"file":"assert-stores.d.ts","sourceRoot":"","sources":["../../../src/auth/port/assert-stores.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAoC9D;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAC3B,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,MAAM,GACX,iBAAiB,CAmCnB"}
1
+ {"version":3,"file":"assert-stores.d.ts","sourceRoot":"","sources":["../../../src/auth/port/assert-stores.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAoC9D;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAC3B,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,MAAM,GACX,iBAAiB,CA+BnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../src/auth/port/memory/users.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,UAAU,CAAC;AAYtD,mFAAmF;AACnF,wBAAgB,eAAe,IAAI,SAAS,CAiE3C"}
1
+ {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../src/auth/port/memory/users.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,UAAU,CAAC;AAYtD,mFAAmF;AACnF,wBAAgB,eAAe,IAAI,SAAS,CAwE3C"}
@@ -24,5 +24,10 @@ export interface JanusStores {
24
24
  export interface StoreCapabilities {
25
25
  /** Whether `sessions.deleteExpiredSessions` is implemented. */
26
26
  readonly collectExpired: boolean;
27
+ /**
28
+ * Whether `users.findUsers` is implemented: `findMany` answers in one query
29
+ * when it is, and with `findUser`, a few ids at a time, when it is not.
30
+ */
31
+ readonly findUsers: boolean;
27
32
  }
28
33
  //# sourceMappingURL=stores.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stores.d.ts","sourceRoot":"","sources":["../../../../src/auth/port/types/stores.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC5B;AAED,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB;IACjC,+DAA+D;IAC/D,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;CACjC"}
1
+ {"version":3,"file":"stores.d.ts","sourceRoot":"","sources":["../../../../src/auth/port/types/stores.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC5B;AAED,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB;IACjC,+DAA+D;IAC/D,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC5B"}
@@ -129,6 +129,23 @@ export interface UserStore {
129
129
  insertUser(record: UserRecord): Promise<UserRecord>;
130
130
  /** The user with this id, whatever their type, or `null`. */
131
131
  findUser(id: Id): Promise<UserRecord | null>;
132
+ /**
133
+ * **Optional capability.** The users holding these ids, whatever their
134
+ * type, in **one query** — `@nxgt/janus-drizzle`'s `inArray`,
135
+ * `@nxgt/janus-mongo`'s `$in`.
136
+ *
137
+ * An id no user holds is **left out**: an absence here is a shorter list,
138
+ * never `null` and never a rejection. Each record appears once, in any
139
+ * order — the core puts them back in the caller's order. A failure throws,
140
+ * as everywhere on this port: answering `[]` for an outage turns it into
141
+ * "nobody", which is the lockout rule 2 exists to prevent.
142
+ *
143
+ * The core calls it with **1 to 100 distinct, well-formed ids**, never an
144
+ * empty list, and reads a longer list in several calls. A store that does
145
+ * not implement it is read with `findUser`, a few ids at a time, so every
146
+ * store answers `findMany`; this method only makes it one round trip.
147
+ */
148
+ findUsers?(ids: readonly Id[]): Promise<readonly UserRecord[]>;
132
149
  /**
133
150
  * The user of this type holding this login, or `null`.
134
151
  *
@@ -1 +1 @@
1
- {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../src/auth/port/types/users.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IAC1B,gEAAgE;IAChE,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;;;OASG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,4CAA4C;IAC5C,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IACzC,iDAAiD;IACjD,QAAQ,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACjD;;;OAGG;IACH,QAAQ,CAAC,eAAe,EAAE,IAAI,GAAG,IAAI,CAAC;IACtC;;;OAGG;IACH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7C;;;;;;;;;;;;;;;OAeG;IACH,SAAS,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE,GAAG,OAAO,CAAC,SAAS,UAAU,EAAE,CAAC,CAAC;IAE/D;;;;;OAKG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAEzE;;;;;;OAMG;IACH,SAAS,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IAElE;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAE7E;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACrC"}
@@ -22,6 +22,21 @@ export interface UserTypeApi<U, In> {
22
22
  }): Promise<U>;
23
23
  /** The user of this type, or `null` — for a malformed id, an unknown one, or one of another type. */
24
24
  find(id: string): Promise<U | null>;
25
+ /**
26
+ * The users of this type holding these ids, **in the order the ids were
27
+ * given** — one query when the users store implements `findUsers`, a few
28
+ * `find`s at a time when it does not. For a list of rows, where one `find`
29
+ * per row would fill the connection pool.
30
+ *
31
+ * An id `find` answers `null` for — malformed, unknown, or another type's —
32
+ * is **left out**, so the answer may be shorter than `ids`: match by
33
+ * `user.id`, never by position. A repeated id is answered once, at its
34
+ * first place. An empty list answers `[]` without reaching the store. Any
35
+ * length is read, 100 ids per query.
36
+ *
37
+ * Rejects with `STORE_FAILED` only: an absence is never an error here.
38
+ */
39
+ findMany(ids: readonly string[]): Promise<U[]>;
25
40
  /** The user of this type, or `NOT_FOUND`. */
26
41
  get(id: string): Promise<U>;
27
42
  /** One page of users of this type, in creation order. A cursor this package did not mint is `INVALID_CUR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G,OAAO,CAAC,CAAC,CAAC,CAAC;IAE9E,iFAAiF;IACjF,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAE9E;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACxC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * `findMany`: several users of one type by id, in one query when the users
3
+ * store implements the optional `findUsers`, and with `findUser`, a few ids at
4
+ * a time, when it does not.
5
+ */
6
+ import type { Context } from '../context';
7
+ import type { UserRecord } from '../port/types';
8
+ /**
9
+ * The most ids one `findUsers` call is given. A longer list is read in
10
+ * several calls, one after another, so no query grows with the caller's list.
11
+ */
12
+ export declare const FIND_MANY_BATCH = 100;
13
+ /**
14
+ * How many `findUser` calls run at once when the store has no `findUsers`:
15
+ * enough to keep a 100-row list quick, few enough to leave the connection
16
+ * pool to the rest of the application.
17
+ */
18
+ export declare const FIND_MANY_CONCURRENCY = 10;
19
+ /**
20
+ * The users of this type holding these ids, **in the order the ids were
21
+ * given**, each once — at its first occurrence. An id that is malformed, held
22
+ * by nobody or held by a user of another type is left out: an absence is a
23
+ * shorter list, never a rejection. A failure throws.
24
+ *
25
+ * An empty list — or one with no well-formed id — answers `[]` without
26
+ * reaching the store.
27
+ */
28
+ export declare function findManyRecords(context: Context, ids: readonly string[], type: string, where: string): Promise<UserRecord[]>;
29
+ //# sourceMappingURL=find-many.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-many.d.ts","sourceRoot":"","sources":["../../../src/auth/users/find-many.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACpC,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,SAAS,MAAM,EAAE,EACtB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,UAAU,EAAE,CAAC,CAuBvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"record-flows.d.ts","sourceRoot":"","sources":["../../../src/auth/users/record-flows.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EACN,KAAK,OAAO,EACZ,KAAK,OAAO,EAKZ,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAI1C;;;GAGG;AACH,wBAAgB,WAAW,CAC1B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,YAAY,EAClB,EAAE,EAAE,EAAE,GACJ,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CA0D7B"}
1
+ {"version":3,"file":"record-flows.d.ts","sourceRoot":"","sources":["../../../src/auth/users/record-flows.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EACN,KAAK,OAAO,EACZ,KAAK,OAAO,EAKZ,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAG5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAI1C;;;GAGG;AACH,wBAAgB,WAAW,CAC1B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,YAAY,EAClB,EAAE,EAAE,EAAE,GACJ,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAoE7B"}
@@ -268,6 +268,12 @@ function memoryUserStore() {
268
268
  const stored = byId.get(id);
269
269
  return stored === undefined ? null : copy(stored);
270
270
  },
271
+ async findUsers(ids) {
272
+ return [...new Set(ids)].flatMap((id) => {
273
+ const stored = byId.get(id);
274
+ return stored === undefined ? [] : [copy(stored)];
275
+ });
276
+ },
271
277
  async findUserByLogin(type, login) {
272
278
  const id = byLogin.get(keyOf(type, login));
273
279
  const stored = id === undefined ? undefined : byId.get(id);
@@ -306,5 +312,5 @@ function createMemoryStores2() {
306
312
  }
307
313
  export { mintId2, isId2, mintedAt2, createMemoryStores2 };
308
314
 
309
- //# debugId=0777A8A648CFB0FA64756E2164756E21
310
- //# sourceMappingURL=index-kvjj5xkp.js.map
315
+ //# debugId=D2F28CB1297A405F64756E2164756E21
316
+ //# sourceMappingURL=index-6bjfv4xv.js.map
@@ -8,10 +8,10 @@
8
8
  "import type { TokenRecord, TokenStore } from '../types';\nimport { copy } from './copy';\n\n/** The token store in memory, by token hash. */\nexport function memoryTokenStore(): TokenStore {\n\tconst byTokenHash = new Map<string, TokenRecord>();\n\n\treturn {\n\t\tasync insertToken(record) {\n\t\t\tif (byTokenHash.has(record.tokenHash)) return;\n\t\t\tbyTokenHash.set(record.tokenHash, copy(record));\n\t\t},\n\n\t\tasync consumeToken(tokenHash, kind, at) {\n\t\t\t// No `await` between this read and the write below: on one event loop\n\t\t\t// that is what makes the pair a single conditional write.\n\t\t\tconst stored = byTokenHash.get(tokenHash);\n\t\t\tif (stored === undefined || stored.kind !== kind) return null;\n\n\t\t\tconst before = copy(stored);\n\t\t\tif (stored.spentAt === null) {\n\t\t\t\tbyTokenHash.set(tokenHash, { ...stored, spentAt: new Date(at) });\n\t\t\t}\n\n\t\t\treturn before;\n\t\t},\n\n\t\tasync countAttempt(tokenHash, kind) {\n\t\t\t// The same single conditional write as consumeToken: no `await`\n\t\t\t// between the read and the write.\n\t\t\tconst stored = byTokenHash.get(tokenHash);\n\t\t\tif (stored === undefined || stored.kind !== kind) return null;\n\t\t\tif (stored.spentAt !== null) return copy(stored);\n\n\t\t\tconst counted = { ...stored, attempts: stored.attempts + 1 };\n\t\t\tbyTokenHash.set(tokenHash, counted);\n\t\t\treturn copy(counted);\n\t\t},\n\n\t\tasync spendUserTokens(userId, kind, at, except) {\n\t\t\tlet spent = 0;\n\n\t\t\tfor (const [tokenHash, stored] of byTokenHash) {\n\t\t\t\tif (\n\t\t\t\t\ttokenHash !== except &&\n\t\t\t\t\tstored.userId === userId &&\n\t\t\t\t\tstored.kind === kind &&\n\t\t\t\t\tstored.spentAt === null\n\t\t\t\t) {\n\t\t\t\t\tbyTokenHash.set(tokenHash, { ...stored, spentAt: new Date(at) });\n\t\t\t\t\tspent += 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn spent;\n\t\t},\n\n\t\tasync deleteUserTokens(userId) {\n\t\t\tlet deleted = 0;\n\n\t\t\tfor (const [tokenHash, stored] of byTokenHash) {\n\t\t\t\tif (stored.userId === userId) {\n\t\t\t\t\tbyTokenHash.delete(tokenHash);\n\t\t\t\t\tdeleted += 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn deleted;\n\t\t},\n\t};\n}\n",
9
9
  "import { StoreConflict } from '../../../errors/janus-error';\nimport type { Id } from '../../../ids/id';\nimport type { UserRecord } from '../types';\n\n/** What the in-memory user store holds: the records, and the unique index on their logins. */\nexport interface UserIndex {\n\treadonly byId: Map<Id, UserRecord>;\n\t/** The unique index: (type, login) key → the id holding it. */\n\treadonly byLogin: Map<string, Id>;\n}\n\n/** The unique key of one login. `\\u0000` cannot occur in a type name the core accepts. */\nexport const keyOf = (type: string, login: string): string =>\n\t`${type}\\u0000${login}`;\n\n/** The first of `logins` held by a user of `type` other than `id`. */\nexport const takenBy = (\n\t{ byLogin }: UserIndex,\n\ttype: string,\n\tlogins: readonly string[],\n\tid: Id,\n): string | undefined =>\n\tlogins.find((login) => {\n\t\tconst holder = byLogin.get(keyOf(type, login));\n\t\treturn holder !== undefined && holder !== id;\n\t});\n\n/** The conflict a login held by another user of `type` is refused with. */\nexport const taken = (operation: string, type: string, login: string) =>\n\tnew StoreConflict(\n\t\t'login',\n\t\t`${operation}: the login is taken by another ${type}`,\n\t\t{ login, userType: type, operation },\n\t);\n\n/** Points every login of `record` at its id. */\nexport function indexLogins({ byLogin }: UserIndex, record: UserRecord): void {\n\tfor (const login of record.logins) {\n\t\tbyLogin.set(keyOf(record.type, login), record.id);\n\t}\n}\n\n/** Frees every login of `record`. */\nexport function dropLogins({ byLogin }: UserIndex, record: UserRecord): void {\n\tfor (const login of record.logins) {\n\t\tbyLogin.delete(keyOf(record.type, login));\n\t}\n}\n",
10
10
  "import { NotFoundError, StoreConflict } from '../../../errors/janus-error';\nimport type { Id } from '../../../ids/id';\nimport type { UserPatch, UserRecord } from '../types';\nimport { copy } from './copy';\nimport {\n\tdropLogins,\n\tindexLogins,\n\ttaken,\n\ttakenBy,\n\ttype UserIndex,\n} from './user-index';\n\n/**\n * `updateUser` in memory: refused for an unknown id, a version that moved or\n * a login held by another user — checked, then written, in one synchronous\n * step.\n */\nexport function updateStored(\n\tindex: UserIndex,\n\tid: Id,\n\tpatch: UserPatch,\n\tifVersion: number,\n): UserRecord {\n\tconst stored = index.byId.get(id);\n\n\tif (stored === undefined) {\n\t\tthrow new NotFoundError('updateUser: no user has this id', {\n\t\t\tuserId: id,\n\t\t\toperation: 'updateUser',\n\t\t});\n\t}\n\n\tif (stored.version !== ifVersion) {\n\t\tthrow new StoreConflict(\n\t\t\t'version',\n\t\t\t`updateUser: expected version ${ifVersion}, found ${stored.version}`,\n\t\t\t{\n\t\t\t\tuserId: id,\n\t\t\t\texpectedVersion: ifVersion,\n\t\t\t\tactualVersion: stored.version,\n\t\t\t\toperation: 'updateUser',\n\t\t\t},\n\t\t);\n\t}\n\n\tif (patch.logins !== undefined) {\n\t\tconst collision = takenBy(index, stored.type, patch.logins, id);\n\t\tif (collision !== undefined) {\n\t\t\tthrow taken('updateUser', stored.type, collision);\n\t\t}\n\t}\n\n\tconst written = applyPatch(stored, copy(patch));\n\n\tindex.byId.set(id, written);\n\tif (patch.logins !== undefined) {\n\t\tdropLogins(index, stored);\n\t\tindexLogins(index, written);\n\t}\n\n\treturn copy(written);\n}\n\n/**\n * The record a patch produces: the fields it names, replaced whole; the fields\n * it does not name, untouched.\n *\n * Reads each field by name rather than spreading the patch, so a key the port\n * does not declare — `version`, `id`, `type`, `createdAt`, or a `snake_case`\n * typo from JavaScript — never reaches the record. A key present as\n * `undefined` is absent, never an erasure.\n */\nfunction applyPatch(stored: UserRecord, patch: UserPatch): UserRecord {\n\treturn {\n\t\t...stored,\n\t\tschemaVersion: patch.schemaVersion ?? stored.schemaVersion,\n\t\tactive: patch.active ?? stored.active,\n\t\tfields: patch.fields ?? stored.fields,\n\t\tlogins: patch.logins ?? stored.logins,\n\t\tpassword: patch.password === undefined ? stored.password : patch.password,\n\t\tsecondFactor:\n\t\t\tpatch.secondFactor === undefined\n\t\t\t\t? stored.secondFactor\n\t\t\t\t: patch.secondFactor,\n\t\temailVerifiedAt:\n\t\t\tpatch.emailVerifiedAt === undefined\n\t\t\t\t? stored.emailVerifiedAt\n\t\t\t\t: patch.emailVerifiedAt,\n\t\tversion: stored.version + 1,\n\t\tupdatedAt: patch.updatedAt,\n\t};\n}\n",
11
- "import type { Id } from '../../../ids/id';\nimport type { UserRecord, UserStore } from '../types';\nimport { copy } from './copy';\nimport {\n\tdropLogins,\n\tindexLogins,\n\tkeyOf,\n\ttaken,\n\ttakenBy,\n\ttype UserIndex,\n} from './user-index';\nimport { updateStored } from './user-update';\n\n/** The user store in memory: the records by id, and the unique index on logins. */\nexport function memoryUserStore(): UserStore {\n\tconst index: UserIndex = {\n\t\tbyId: new Map<Id, UserRecord>(),\n\t\tbyLogin: new Map<string, Id>(),\n\t};\n\tconst { byId, byLogin } = index;\n\n\treturn {\n\t\tasync insertUser(record) {\n\t\t\tconst stored = byId.get(record.id);\n\t\t\tif (stored !== undefined) return copy(stored);\n\n\t\t\tconst collision = takenBy(index, record.type, record.logins, record.id);\n\t\t\tif (collision !== undefined) {\n\t\t\t\tthrow taken('insertUser', record.type, collision);\n\t\t\t}\n\n\t\t\tconst written = copy(record);\n\t\t\tbyId.set(written.id, written);\n\t\t\tindexLogins(index, written);\n\n\t\t\treturn copy(written);\n\t\t},\n\n\t\tasync findUser(id) {\n\t\t\tconst stored = byId.get(id);\n\t\t\treturn stored === undefined ? null : copy(stored);\n\t\t},\n\n\t\tasync findUserByLogin(type, login) {\n\t\t\tconst id = byLogin.get(keyOf(type, login));\n\t\t\tconst stored = id === undefined ? undefined : byId.get(id);\n\t\t\treturn stored === undefined ? null : copy(stored);\n\t\t},\n\n\t\tasync listUsers({ type, after, limit }) {\n\t\t\t// A Map keeps insertion order, not id order: a retried insert or an\n\t\t\t// id minted on another machine can land out of sequence.\n\t\t\tconst ids = [...byId.values()]\n\t\t\t\t.filter((user) => user.type === type)\n\t\t\t\t.map((user) => user.id)\n\t\t\t\t.filter((id) => after === null || id > after)\n\t\t\t\t.sort();\n\t\t\tconst pageIds = ids.slice(0, limit);\n\t\t\tconst last = pageIds.at(-1);\n\n\t\t\treturn {\n\t\t\t\titems: pageIds.map((id) => copy(byId.get(id) as UserRecord)),\n\t\t\t\tnextCursor: ids.length > limit && last !== undefined ? last : null,\n\t\t\t};\n\t\t},\n\n\t\tasync updateUser(id, patch, ifVersion) {\n\t\t\treturn updateStored(index, id, patch, ifVersion);\n\t\t},\n\n\t\tasync deleteUser(id) {\n\t\t\tconst stored = byId.get(id);\n\t\t\tif (stored === undefined) return false;\n\n\t\t\tbyId.delete(id);\n\t\t\tdropLogins(index, stored);\n\t\t\treturn true;\n\t\t},\n\t};\n}\n",
11
+ "import type { Id } from '../../../ids/id';\nimport type { UserRecord, UserStore } from '../types';\nimport { copy } from './copy';\nimport {\n\tdropLogins,\n\tindexLogins,\n\tkeyOf,\n\ttaken,\n\ttakenBy,\n\ttype UserIndex,\n} from './user-index';\nimport { updateStored } from './user-update';\n\n/** The user store in memory: the records by id, and the unique index on logins. */\nexport function memoryUserStore(): UserStore {\n\tconst index: UserIndex = {\n\t\tbyId: new Map<Id, UserRecord>(),\n\t\tbyLogin: new Map<string, Id>(),\n\t};\n\tconst { byId, byLogin } = index;\n\n\treturn {\n\t\tasync insertUser(record) {\n\t\t\tconst stored = byId.get(record.id);\n\t\t\tif (stored !== undefined) return copy(stored);\n\n\t\t\tconst collision = takenBy(index, record.type, record.logins, record.id);\n\t\t\tif (collision !== undefined) {\n\t\t\t\tthrow taken('insertUser', record.type, collision);\n\t\t\t}\n\n\t\t\tconst written = copy(record);\n\t\t\tbyId.set(written.id, written);\n\t\t\tindexLogins(index, written);\n\n\t\t\treturn copy(written);\n\t\t},\n\n\t\tasync findUser(id) {\n\t\t\tconst stored = byId.get(id);\n\t\t\treturn stored === undefined ? null : copy(stored);\n\t\t},\n\n\t\tasync findUsers(ids) {\n\t\t\treturn [...new Set(ids)].flatMap((id) => {\n\t\t\t\tconst stored = byId.get(id);\n\t\t\t\treturn stored === undefined ? [] : [copy(stored)];\n\t\t\t});\n\t\t},\n\n\t\tasync findUserByLogin(type, login) {\n\t\t\tconst id = byLogin.get(keyOf(type, login));\n\t\t\tconst stored = id === undefined ? undefined : byId.get(id);\n\t\t\treturn stored === undefined ? null : copy(stored);\n\t\t},\n\n\t\tasync listUsers({ type, after, limit }) {\n\t\t\t// A Map keeps insertion order, not id order: a retried insert or an\n\t\t\t// id minted on another machine can land out of sequence.\n\t\t\tconst ids = [...byId.values()]\n\t\t\t\t.filter((user) => user.type === type)\n\t\t\t\t.map((user) => user.id)\n\t\t\t\t.filter((id) => after === null || id > after)\n\t\t\t\t.sort();\n\t\t\tconst pageIds = ids.slice(0, limit);\n\t\t\tconst last = pageIds.at(-1);\n\n\t\t\treturn {\n\t\t\t\titems: pageIds.map((id) => copy(byId.get(id) as UserRecord)),\n\t\t\t\tnextCursor: ids.length > limit && last !== undefined ? last : null,\n\t\t\t};\n\t\t},\n\n\t\tasync updateUser(id, patch, ifVersion) {\n\t\t\treturn updateStored(index, id, patch, ifVersion);\n\t\t},\n\n\t\tasync deleteUser(id) {\n\t\t\tconst stored = byId.get(id);\n\t\t\tif (stored === undefined) return false;\n\n\t\t\tbyId.delete(id);\n\t\t\tdropLogins(index, stored);\n\t\t\treturn true;\n\t\t},\n\t};\n}\n",
12
12
  "import type { JanusStores } from '../types';\nimport { memorySessionStore } from './sessions';\nimport { memoryTokenStore } from './tokens';\nimport { memoryUserStore } from './users';\n\n/**\n * The reference implementation of the store port, in memory.\n *\n * **Shipped and documented, not a test helper.** It is what a consumer uses in\n * their own unit tests, and what an adapter author compares against when a\n * conformance case they do not understand turns red. So it keeps the six rules\n * for real rather than approximately:\n *\n * - uniqueness is a constraint — an index checked and written inside the same\n * synchronous step, which is what atomic means on one event loop;\n * - `consumeToken` reads and writes with no `await` between the two, so twenty\n * concurrent calls see exactly one unspent token;\n * - every record is **copied in and copied out**, so a caller that mutates what\n * it passed or what it got back cannot reach the store — the in-memory\n * version of \"bytes round-trip\";\n * - a patch applies only the fields it names, and only the fields the port\n * declares: a stray `version` or `id` in a patch from JavaScript is ignored,\n * not written.\n *\n * Every method is `async` even though none waits on anything: a caller that\n * forgot an `await` must fail here the way it would against a real database.\n */\nexport function createMemoryStores(): JanusStores {\n\treturn {\n\t\tusers: memoryUserStore(),\n\t\tsessions: memorySessionStore(),\n\t\ttokens: memoryTokenStore(),\n\t};\n}\n"
13
13
  ],
14
- "mappings": ";;;;;;AAyBA,IAAM,MAAyB,MAAM,KAAK,EAAE,QAAQ,IAAI,GAAG,CAAC,GAAG,MAC9D,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAC/B;AAEA,IAAI,SAAS;AACb,IAAI,WAAW;AAWf,IAAM,eAAe;AAWd,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SAG1C,WAAU,CAAC,IAAI;AAAA,MACpB,MAAM,SAAS,KAAK,IAAI,EAAE;AAAA,MAC1B,IAAI,WAAW;AAAA,QAAW,OAAO;AAAA,MAEjC,KAAK,OAAO,EAAE;AAAA,MACd,WAAW,OAAO,MAAM;AAAA,MACxB,OAAO;AAAA;AAAA,EAET;AAAA;;;AC1DM,SAAS,mBAAkB,GAAgB;AAAA,EACjD,OAAO;AAAA,IACN,OAAO,gBAAgB;AAAA,IACvB,UAAU,mBAAmB;AAAA,IAC7B,QAAQ,iBAAiB;AAAA,EAC1B;AAAA;",
15
+ "debugId": "D2F28CB1297A405F64756E2164756E21",
16
16
  "names": []
17
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"outage.d.ts","sourceRoot":"","sources":["../../../src/conformance/cases/outage.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAe,eAAe,EAAc,MAAM,UAAU,CAAC;AAiEzE,eAAO,MAAM,WAAW,EAAE,SAAS,eAAe,EA2FjD,CAAC"}
1
+ {"version":3,"file":"outage.d.ts","sourceRoot":"","sources":["../../../src/conformance/cases/outage.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAe,eAAe,EAAc,MAAM,UAAU,CAAC;AAkEzE,eAAO,MAAM,WAAW,EAAE,SAAS,eAAe,EAuGjD,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ConformanceCase } from '../../types';
2
+ /**
3
+ * The optional `findUsers`: several users in one query. Skipped, with the
4
+ * reason, for a store that does not implement it — the core then reads with
5
+ * `findUser`.
6
+ */
7
+ export declare const userBatchCases: readonly ConformanceCase[];
8
+ //# sourceMappingURL=batch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../../../src/conformance/cases/users/batch.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAOnD;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,eAAe,EAgDpD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/conformance/cases/users/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAQnD,qEAAqE;AACrE,eAAO,MAAM,cAAc,EAAE,SAAS,eAAe,EAOpD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/conformance/cases/users/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AASnD,qEAAqE;AACrE,eAAO,MAAM,cAAc,EAAE,SAAS,eAAe,EAQpD,CAAC"}
@@ -5,6 +5,7 @@ export declare const allCases: readonly ConformanceCase[];
5
5
  export declare const SKIP_REASONS: {
6
6
  readonly faults: "faults not provided: the outage invariant is not proven for this adapter";
7
7
  readonly deleteExpiredSessions: "stores.sessions does not implement the optional deleteExpiredSessions";
8
+ readonly findUsers: "stores.users does not implement the optional findUsers: findMany reads with findUser instead";
8
9
  };
9
10
  /**
10
11
  * Runs one case against one freshly opened set of stores, and closes them,
@@ -50,7 +51,7 @@ interface DescribedCase {
50
51
  readonly id: string;
51
52
  readonly group: string;
52
53
  readonly name: string;
53
- readonly needs?: string;
54
+ readonly needs?: string | readonly string[];
54
55
  }
55
56
  /**
56
57
  * Describes one suite's cases, grouped, under a runner. Shared by every suite
@@ -1 +1 @@
1
- {"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/conformance/describe.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACX,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EAEjB,MAAM,SAAS,CAAC;AAEjB,mDAAmD;AACnD,eAAO,MAAM,QAAQ,EAAE,SAAS,eAAe,EAK9C,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,YAAY;;;CAKf,CAAC;AAEX;;;;;;GAMG;AACH,wBAAsB,OAAO,CAC5B,e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;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;CAC5C;AAQD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,aAAa,EAAE,OAAO,EAAE;IAC/D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,CACb,eAAe,EAAE,CAAC,KACd,OAAO,CAAC;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;IACvE,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAChD,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;CACrC,GAAG,IAAI,CA6CP;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAgB5D"}
@@ -29,5 +29,5 @@ export { userStoreCases } from './cases/users';
29
29
  export { allCases, describeJanusStores, runCase, SKIP_REASONS, } from './describe';
30
30
  export { referenceHarness } from './reference';
31
31
  export { allRelationCases, describeRelationStores, type OpenedRelations, type RelationCase, type RelationContext, type RelationFaults, type RelationHarness, type RelationMethod, referenceRelationHarness, relationOutageCases, relationStoreCases, runRelationCase, } from './relations';
32
- export type { CaseContext, ConformanceCase, ConformanceHarness, ConformanceRunner, OpenedStores, PortMethod, StoreFaults, } from './types';
32
+ export type { CaseContext, CaseNeed, ConformanceCase, ConformanceHarness, ConformanceRunner, OpenedStores, PortMethod, StoreFaults, } from './types';
33
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conformance/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACN,QAAQ,EACR,mBAAmB,EACnB,OAAO,EACP,YAAY,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACN,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,GACf,MAAM,aAAa,CAAC;AACrB,YAAY,EACX,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,WAAW,GACX,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/conformance/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACN,QAAQ,EACR,mBAAmB,EACnB,OAAO,EACP,YAAY,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACN,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,GACf,MAAM,aAAa,CAAC;AACrB,YAAY,EACX,WAAW,EACX,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,WAAW,GACX,MAAM,SAAS,CAAC"}