@ai-matrx/associations 0.14.90 → 0.14.92

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.
@@ -337,7 +337,7 @@ interface ReferenceSearchCandidatesFn {
337
337
  }
338
338
  interface CandidatesServiceApi {
339
339
  /**
340
- * The universal candidate reader RPC (`public.reference_search_candidates`)
340
+ * The universal candidate reader RPC (`platform.reference_search_candidates`)
341
341
  * — shared by candidate search here and title resolution in titles.ts.
342
342
  */
343
343
  callReferenceSearchCandidates: ReferenceSearchCandidatesFn;
@@ -388,7 +388,7 @@ interface CreateEntityRowArgs {
388
388
  title: string;
389
389
  /**
390
390
  * The organization the new row belongs to. REQUIRED by
391
- * `public.entity_row_create`: every creatable token's table carries
391
+ * `platform.entity_row_create`: every creatable token's table carries
392
392
  * `organization_id`, and the door refuses a row with nobody owning it.
393
393
  */
394
394
  orgId?: string | null;
@@ -337,7 +337,7 @@ interface ReferenceSearchCandidatesFn {
337
337
  }
338
338
  interface CandidatesServiceApi {
339
339
  /**
340
- * The universal candidate reader RPC (`public.reference_search_candidates`)
340
+ * The universal candidate reader RPC (`platform.reference_search_candidates`)
341
341
  * — shared by candidate search here and title resolution in titles.ts.
342
342
  */
343
343
  callReferenceSearchCandidates: ReferenceSearchCandidatesFn;
@@ -388,7 +388,7 @@ interface CreateEntityRowArgs {
388
388
  title: string;
389
389
  /**
390
390
  * The organization the new row belongs to. REQUIRED by
391
- * `public.entity_row_create`: every creatable token's table carries
391
+ * `platform.entity_row_create`: every creatable token's table carries
392
392
  * `organization_id`, and the door refuses a row with nobody owning it.
393
393
  */
394
394
  orgId?: string | null;
@@ -152,6 +152,8 @@ var SIGNED_OUT_LEAD = "You're signed out";
152
152
  var SIGNED_OUT_MESSAGE = `${SIGNED_OUT_LEAD}. Sign in again \u2014 your text is kept here.`;
153
153
  function createRpcResultHelpers(errorSink, sessionAttached) {
154
154
  function mapPgError(e) {
155
+ if (e?.name === "NotAuthenticatedError")
156
+ return { code: "unauthorized", message: SIGNED_OUT_MESSAGE };
155
157
  const { pgCode, pgMessage, pgHint } = readPgFields(e);
156
158
  if (pgCode === "PGRST202") {
157
159
  const message = "demanded schema violation: the database this client is pointed at cannot answer a demanded @ai-matrx/associations RPC (PostgREST PGRST202 \u2014 function not found). This package DEMANDS the platform " + `schema (README \xA7 The demanded schema). ${pgMessage ?? ""}`.trim();
@@ -1396,7 +1398,7 @@ function createEntityRowsService(deps, titles) {
1396
1398
  return {
1397
1399
  /**
1398
1400
  * Create one row of `token`'s backing table named `title`, through
1399
- * `public.entity_row_create`. The door stamps `created_by` from `auth.uid()`,
1401
+ * `platform.entity_row_create`. The door stamps `created_by` from `auth.uid()`,
1400
1402
  * checks the caller can act in the organization, and refuses machinery tokens and
1401
1403
  * tables with no organization by name. Returns the new row's id + title. The
1402
1404
  * caller wires associations afterwards — this layer never writes edges.
@@ -1464,7 +1466,7 @@ function createEntityRowsService(deps, titles) {
1464
1466
  }
1465
1467
  },
1466
1468
  /**
1467
- * Rename one row of `token`'s table through `public.entity_row_rename`. The door
1469
+ * Rename one row of `token`'s table through `platform.entity_row_rename`. The door
1468
1470
  * decides on the one ladder — the row's author, `editor` on the row, or a platform
1469
1471
  * admin — and answers "there is no such thing here" rather than telling a caller
1470
1472
  * that somebody else's row exists.