@alwaysmeticulous/api 2.185.1 → 2.186.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.
@@ -30,7 +30,11 @@ export interface SessionData {
30
30
  * Only present on recordings since ~Aug 2024
31
31
  */
32
32
  indexedDb?: {
33
- state: IDBObjectStoreSnapshot[];
33
+ /**
34
+ * createObjectStoreOptions will be omitted when snapshotting an object store entry on the fly.
35
+ * @see IDBObjectStoreMetadata.snapshotEntriesOnRead for more details.
36
+ */
37
+ state: (IDBObjectStoreSnapshot | Omit<IDBObjectStoreSnapshot, "createObjectStoreOptions">)[];
34
38
  };
35
39
  };
36
40
  /**
@@ -106,6 +110,12 @@ export interface EarlyRequest {
106
110
  export interface IDBObjectStoreMetadata {
107
111
  databaseName: string;
108
112
  objectStoreName: string;
113
+ /**
114
+ * If true, then we only snapshot the entries as they are read from the object store.
115
+ * This can be useful if the object store is typically large and we don't want to snapshot
116
+ * the entire thing.
117
+ */
118
+ snapshotEntriesOnRead?: boolean;
109
119
  serialize?: (value: any) => string;
110
120
  deserialize?: (value: string) => any;
111
121
  /**
@@ -132,13 +142,19 @@ interface StringKey {
132
142
  export type IDBObjectStoreSnapshot = Pick<IDBObjectStoreMetadata, "databaseName" | "objectStoreName"> & {
133
143
  createObjectStoreOptions: IDBObjectStoreParameters;
134
144
  /**
135
- * Entry values are JSON stringified by default. JSON representable objects, arrays and primitives are supported.
136
- * For all other types (e.g. Date, Regex, ArrayBuffer etc.), you can define a custom [de]serialize function on the
137
- * object store metadata to dictate how the value should be mapped to/from strings. @see IDBObjectStoreMetadata
145
+ * Entry values are serialized with SuperJSON by default. JSON representable objects, arrays and primitives are
146
+ * supported as well as more complex types (e.g. Date, Regex, ArrayBuffer etc.). However, you can add custom
147
+ * serialization logic to the object store metadata to support object store specific types.
148
+ * @see IDBObjectStoreMetadata.serialize
138
149
  */
139
150
  entries: {
140
151
  key?: SerializedIDBValidKey;
141
152
  value: string;
153
+ /**
154
+ * This may be present for snapshots taken since ~Dec 2024 when we started using SuperJSON.
155
+ * If it's present, this field stores the SuperJSONResult.meta field, with the stringified
156
+ * text of SuperJSON.json being stored in the value field above.
157
+ */
142
158
  valueMeta?: {
143
159
  values?: unknown;
144
160
  referentialEqualities?: unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/api",
3
- "version": "2.185.1",
3
+ "version": "2.186.0",
4
4
  "description": "Meticulous API types",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -35,5 +35,5 @@
35
35
  "bugs": {
36
36
  "url": "https://github.com/alwaysmeticulous/meticulous-sdk/issues"
37
37
  },
38
- "gitHead": "31fd9518a85bb75e2a5fcb2b108a9d8d177eb087"
38
+ "gitHead": "e87ff02d6e974358abcd262d74855085fd01b8a8"
39
39
  }