skapi-js 1.8.1 → 1.8.3

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
@@ -51,7 +51,7 @@ type GetRecordQuery = {
51
51
  record_id?: string;
52
52
  /** Table name not required when "record_id" is given. A bare string is shorthand for { name: <string> }. */
53
53
  table?: string | {
54
- /** Max 128 chars. Blocks: / ! * #, control chars, and sentinel 􏿿. */
54
+ /** Max 256 characters, where / ! * # % each count as 3. Blocks control chars and sentinel 􏿿. */
55
55
  name: string;
56
56
  /** Number range: 0 ~ 99. Default: 'public' */
57
57
  access_group?: number | 'private' | 'public' | 'authorized' | 'admin';
@@ -65,9 +65,9 @@ type GetRecordQuery = {
65
65
  };
66
66
  /** Index condition and range cannot be used simultaneously.*/
67
67
  index?: {
68
- /** Custom names: max 128 chars, cannot start with "$", blocks / ! * #, control chars, and sentinel 􏿿. Reserved names: $uploaded, $updated, $referenced_count, $user_id. */
68
+ /** Custom names: max 256 characters, where / ! * # % each count as 3. Cannot start with "$". Blocks control chars and sentinel 􏿿. Reserved names: $uploaded, $updated, $referenced_count, $user_id. */
69
69
  name: string | '$updated' | '$uploaded' | '$referenced_count' | '$user_id';
70
- /** String value max 256 chars. Allows punctuation (including / ! * #). Blocks control chars and sentinel 􏿿. */
70
+ /** String value max 256 characters. Any punctuation is allowed and counts as one character, and values compare exactly as written. Blocks control chars and sentinel 􏿿. */
71
71
  value: string | number | boolean;
72
72
  /** For a string value: '>=' = 'starts with', '<=' = 'ends with'. When the name is a compound name ending in '.', '>=' / '<=' match the child name segment (starts / ends with). '>' / '<' are lexicographic; numbers/booleans compare normally. */
73
73
  condition?: Condition;
@@ -81,7 +81,7 @@ type PostRecordConfig = {
81
81
  readonly?: boolean;
82
82
  /** Table name not required when "record_id" is given.*/
83
83
  table?: {
84
- /** Max 128 chars. Blocks: / ! * #, control chars, and sentinel 􏿿. */
84
+ /** Max 256 characters, where / ! * # % each count as 3. Blocks control chars and sentinel 􏿿. */
85
85
  name?: string;
86
86
  /** Number range: 0 ~ 99. Default: 'public' */
87
87
  access_group?: number | 'private' | 'public' | 'authorized' | 'admin';
@@ -114,9 +114,9 @@ type PostRecordConfig = {
114
114
  reference?: string | null;
115
115
  /** null removes index */
116
116
  index?: {
117
- /** Max 128 chars, cannot start with "$", blocks / ! * #, control chars, and sentinel 􏿿. */
117
+ /** Max 256 characters, where / ! * # % each count as 3. Cannot start with "$". Blocks control chars and sentinel 􏿿. */
118
118
  name: string;
119
- /** String value max 256 chars. Allows punctuation (including / ! * #). Blocks control chars and sentinel 􏿿. */
119
+ /** String value max 256 characters. Any punctuation is allowed and counts as one character, and values compare exactly as written. Blocks control chars and sentinel 􏿿. */
120
120
  value: string | number | boolean;
121
121
  } | null;
122
122
  tags?: string[] | null;
@@ -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;
@@ -722,6 +744,8 @@ declare class Skapi {
722
744
  accessToken?: boolean | string;
723
745
  idToken?: boolean | string;
724
746
  };
747
+ stableGateway?: boolean;
748
+ revalidate?: boolean;
725
749
  }) => any;
726
750
  };
727
751
  private __connection;
@@ -1177,6 +1201,8 @@ declare class Skapi {
1177
1201
  config?: {
1178
1202
  dataType?: 'base64' | 'download' | 'endpoint' | 'blob' | 'text' | 'info';
1179
1203
  expires?: number;
1204
+ browserCache?: number;
1205
+ refresh?: boolean;
1180
1206
  progress?: ProgressCallback;
1181
1207
  }): Promise<Blob | string | void | FileInfo>;
1182
1208
  /**
package/dist/skapi.d.ts CHANGED
@@ -51,7 +51,7 @@ type GetRecordQuery = {
51
51
  record_id?: string;
52
52
  /** Table name not required when "record_id" is given. A bare string is shorthand for { name: <string> }. */
53
53
  table?: string | {
54
- /** Max 128 chars. Blocks: / ! * #, control chars, and sentinel 􏿿. */
54
+ /** Max 256 characters, where / ! * # % each count as 3. Blocks control chars and sentinel 􏿿. */
55
55
  name: string;
56
56
  /** Number range: 0 ~ 99. Default: 'public' */
57
57
  access_group?: number | 'private' | 'public' | 'authorized' | 'admin';
@@ -65,9 +65,9 @@ type GetRecordQuery = {
65
65
  };
66
66
  /** Index condition and range cannot be used simultaneously.*/
67
67
  index?: {
68
- /** Custom names: max 128 chars, cannot start with "$", blocks / ! * #, control chars, and sentinel 􏿿. Reserved names: $uploaded, $updated, $referenced_count, $user_id. */
68
+ /** Custom names: max 256 characters, where / ! * # % each count as 3. Cannot start with "$". Blocks control chars and sentinel 􏿿. Reserved names: $uploaded, $updated, $referenced_count, $user_id. */
69
69
  name: string | '$updated' | '$uploaded' | '$referenced_count' | '$user_id';
70
- /** String value max 256 chars. Allows punctuation (including / ! * #). Blocks control chars and sentinel 􏿿. */
70
+ /** String value max 256 characters. Any punctuation is allowed and counts as one character, and values compare exactly as written. Blocks control chars and sentinel 􏿿. */
71
71
  value: string | number | boolean;
72
72
  /** For a string value: '>=' = 'starts with', '<=' = 'ends with'. When the name is a compound name ending in '.', '>=' / '<=' match the child name segment (starts / ends with). '>' / '<' are lexicographic; numbers/booleans compare normally. */
73
73
  condition?: Condition;
@@ -81,7 +81,7 @@ type PostRecordConfig = {
81
81
  readonly?: boolean;
82
82
  /** Table name not required when "record_id" is given.*/
83
83
  table?: {
84
- /** Max 128 chars. Blocks: / ! * #, control chars, and sentinel 􏿿. */
84
+ /** Max 256 characters, where / ! * # % each count as 3. Blocks control chars and sentinel 􏿿. */
85
85
  name?: string;
86
86
  /** Number range: 0 ~ 99. Default: 'public' */
87
87
  access_group?: number | 'private' | 'public' | 'authorized' | 'admin';
@@ -114,9 +114,9 @@ type PostRecordConfig = {
114
114
  reference?: string | null;
115
115
  /** null removes index */
116
116
  index?: {
117
- /** Max 128 chars, cannot start with "$", blocks / ! * #, control chars, and sentinel 􏿿. */
117
+ /** Max 256 characters, where / ! * # % each count as 3. Cannot start with "$". Blocks control chars and sentinel 􏿿. */
118
118
  name: string;
119
- /** String value max 256 chars. Allows punctuation (including / ! * #). Blocks control chars and sentinel 􏿿. */
119
+ /** String value max 256 characters. Any punctuation is allowed and counts as one character, and values compare exactly as written. Blocks control chars and sentinel 􏿿. */
120
120
  value: string | number | boolean;
121
121
  } | null;
122
122
  tags?: string[] | null;
@@ -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;
@@ -722,6 +744,8 @@ declare class Skapi {
722
744
  accessToken?: boolean | string;
723
745
  idToken?: boolean | string;
724
746
  };
747
+ stableGateway?: boolean;
748
+ revalidate?: boolean;
725
749
  }) => any;
726
750
  };
727
751
  private __connection;
@@ -1177,6 +1201,8 @@ declare class Skapi {
1177
1201
  config?: {
1178
1202
  dataType?: 'base64' | 'download' | 'endpoint' | 'blob' | 'text' | 'info';
1179
1203
  expires?: number;
1204
+ browserCache?: number;
1205
+ refresh?: boolean;
1180
1206
  progress?: ProgressCallback;
1181
1207
  }): Promise<Blob | string | void | FileInfo>;
1182
1208
  /**