@ai-matrx/data 0.18.35 → 0.18.37

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.18.37
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/data/v0.18.36..npm/data/v0.18.37 -- apps/shared/data`).
7
+ No source changes intended and no consumer action required.
8
+
9
+ ## 0.18.36
10
+
11
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
12
+ `git diff npm/data/v0.18.35..npm/data/v0.18.36 -- apps/shared/data`).
13
+ No source changes intended and no consumer action required.
14
+
3
15
  ## 0.18.35
4
16
  ### Unreleased
5
17
 
@@ -9,6 +21,8 @@
9
21
  matrx-frontend so `@ai-matrx/chat` stops reaching into the app for them.
10
22
  - `@supabase/supabase-js` is now a peer dependency (external, never bundled) so `PostgrestError`
11
23
  is the consumer's own class and `instanceof` checks hold.
24
+ - `/db` gains `RecordUnavailableError`, `recordUnavailableMessage`, `isRecordUnavailableError`
25
+ (the zero-row single-record read shape), moved from matrx-frontend `lib/records/recordUnavailable.ts`.
12
26
  - **Consumer action:** none required; matrx-frontend's old modules re-export these.
13
27
 
14
28
  ## 0.18.34
package/README.md CHANGED
@@ -146,7 +146,7 @@ expired or healed and the superseded key was not cleared. **Read it before treat
146
146
  that bounce when the flag is set, or a 2.5s network blink signs people out mid-session.
147
147
  A call site needing `created_at`, `identities`, `last_sign_in_at`, `factors` or
148
148
  `*_confirmed_at` must keep `getUser()` elsewhere: the JWT carries none of them.
149
- Full contract: `common-docs/systems/platform/proxy-identity/FEATURE.md`.
149
+ Full contract: `common-docs/systems/platform/auth/proxy-identity/FEATURE.md`.
150
150
 
151
151
  **No `next/*` import lives in the package.** `cookies()` and `NextResponse` arrive through
152
152
  structural seams (`createResponse: () => NextResponse.next({ request })`), so `/next`
package/dist/db.cjs CHANGED
@@ -25,6 +25,7 @@ __export(db_exports, {
25
25
  DEFAULT_ACTIVE_ORG_COOKIE_NAME: () => DEFAULT_ACTIVE_ORG_COOKIE_NAME,
26
26
  DEFAULT_AUTH_COOKIE_NAME: () => DEFAULT_AUTH_COOKIE_NAME,
27
27
  IncompleteReadError: () => IncompleteReadError,
28
+ RecordUnavailableError: () => RecordUnavailableError,
28
29
  SessionUnavailableError: () => SessionUnavailableError,
29
30
  WriteDidNotLandError: () => WriteDidNotLandError,
30
31
  WriteRefusedError: () => WriteRefusedError,
@@ -40,11 +41,13 @@ __export(db_exports, {
40
41
  encodeActiveOrgSelection: () => encodeActiveOrgSelection,
41
42
  guardedUpdate: () => guardedUpdate,
42
43
  isMissingSessionError: () => isMissingSessionError,
44
+ isRecordUnavailableError: () => isRecordUnavailableError,
43
45
  mergeJsonColumn: () => mergeJsonColumn,
44
46
  parseCookieHeader: () => parseCookieHeader,
45
47
  personSentence: () => personSentence,
46
48
  readAllRows: () => readAllRows,
47
49
  readAllRowsRest: () => readAllRowsRest,
50
+ recordUnavailableMessage: () => recordUnavailableMessage,
48
51
  serverMessageFromBody: () => serverMessageFromBody,
49
52
  tryReadAllRows: () => tryReadAllRows,
50
53
  tryReadAllRowsRest: () => tryReadAllRowsRest,
@@ -913,4 +916,40 @@ async function writeOneRow(write, options) {
913
916
  })
914
917
  };
915
918
  }
919
+
920
+ // src/db/record-unavailable.ts
921
+ var RecordUnavailableError = class extends Error {
922
+ entity;
923
+ reason;
924
+ recordId;
925
+ /**
926
+ * Canonical entity token, when the read site knows it. With a token AND a
927
+ * recordId the renderer stops describing the ambiguity and ASKS the platform
928
+ * instead — an access gate resolves which of the four it really is.
929
+ * Without one, honest ambiguity is still the best available answer.
930
+ */
931
+ token;
932
+ /** Diagnostics identity for reconciling this exact capture in place. */
933
+ captureId;
934
+ /** Last truth written to diagnostics; avoids duplicate reconciliation. */
935
+ captureResolution;
936
+ constructor(input) {
937
+ super(recordUnavailableMessage(input.entity, input.reason));
938
+ this.name = "RecordUnavailableError";
939
+ this.entity = input.entity;
940
+ this.reason = input.reason;
941
+ this.recordId = input.recordId;
942
+ this.token = input.token;
943
+ this.captureResolution = input.reason;
944
+ }
945
+ };
946
+ function recordUnavailableMessage(entity, reason) {
947
+ if (reason === "deleted") {
948
+ return `This ${entity} was deleted, so it can no longer be opened.`;
949
+ }
950
+ return `We couldn't open this ${entity}. It may have been deleted, or it may belong to an organization you don't have access to.`;
951
+ }
952
+ function isRecordUnavailableError(value) {
953
+ return value instanceof RecordUnavailableError;
954
+ }
916
955
  //# sourceMappingURL=db.cjs.map