skapi-js 1.8.1 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/skapi.d.mts CHANGED
@@ -176,6 +176,17 @@ type RecordData = {
176
176
  };
177
177
  ip: string;
178
178
  readonly: boolean;
179
+ /**
180
+ * Present ONLY on an element of a postRecords() result that the backend refused.
181
+ * Such an element is an empty record (record_id is ""), and this carries the reason
182
+ * the backend gave, e.g. { code: 'NOT_EXISTS', message: 'Reference "..." does not exists.' }.
183
+ * A saved record never has it, so `record_id` stays the test for "did this save".
184
+ */
185
+ error?: {
186
+ code?: string;
187
+ message?: string;
188
+ [key: string]: any;
189
+ };
179
190
  };
180
191
  type Connection = {
181
192
  /** User's locale */
@@ -653,6 +664,17 @@ declare class Skapi {
653
664
  owner: string;
654
665
  session: Record<string, any> | null;
655
666
  connection: Connection | null;
667
+ /**
668
+ * unique_id -> record_id, bucketed by a "<service>/<owner>" scope key.
669
+ *
670
+ * The scope is mandatory. One Skapi instance routinely serves MANY services: the
671
+ * MCP server keeps a single instance per user and names the target project on every
672
+ * call, and the dashboard switches projects without reconstructing. A flat map let
673
+ * the same unique_id from two projects collide on one key, so a post carrying
674
+ * `reference: "src::<file>"` was silently rewritten to the OTHER project's
675
+ * record_id and the backend rejected it as non-existent. Never key this by
676
+ * unique_id alone, and never scope it by `this.service` when the call names its own.
677
+ */
656
678
  private __my_unique_ids;
657
679
  private __uniqueIdsPersistTimer;
658
680
  private userPool;
package/dist/skapi.d.ts CHANGED
@@ -176,6 +176,17 @@ type RecordData = {
176
176
  };
177
177
  ip: string;
178
178
  readonly: boolean;
179
+ /**
180
+ * Present ONLY on an element of a postRecords() result that the backend refused.
181
+ * Such an element is an empty record (record_id is ""), and this carries the reason
182
+ * the backend gave, e.g. { code: 'NOT_EXISTS', message: 'Reference "..." does not exists.' }.
183
+ * A saved record never has it, so `record_id` stays the test for "did this save".
184
+ */
185
+ error?: {
186
+ code?: string;
187
+ message?: string;
188
+ [key: string]: any;
189
+ };
179
190
  };
180
191
  type Connection = {
181
192
  /** User's locale */
@@ -653,6 +664,17 @@ declare class Skapi {
653
664
  owner: string;
654
665
  session: Record<string, any> | null;
655
666
  connection: Connection | null;
667
+ /**
668
+ * unique_id -> record_id, bucketed by a "<service>/<owner>" scope key.
669
+ *
670
+ * The scope is mandatory. One Skapi instance routinely serves MANY services: the
671
+ * MCP server keeps a single instance per user and names the target project on every
672
+ * call, and the dashboard switches projects without reconstructing. A flat map let
673
+ * the same unique_id from two projects collide on one key, so a post carrying
674
+ * `reference: "src::<file>"` was silently rewritten to the OTHER project's
675
+ * record_id and the backend rejected it as non-existent. Never key this by
676
+ * unique_id alone, and never scope it by `this.service` when the call names its own.
677
+ */
656
678
  private __my_unique_ids;
657
679
  private __uniqueIdsPersistTimer;
658
680
  private userPool;