cojson-storage-indexeddb 0.10.15 → 0.11.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.
@@ -1,4 +1,4 @@
1
1
 
2
- > cojson-storage-indexeddb@0.10.15 build /home/runner/_work/jazz/jazz/packages/cojson-storage-indexeddb
2
+ > cojson-storage-indexeddb@0.11.0 build /home/runner/_work/jazz/jazz/packages/cojson-storage-indexeddb
3
3
  > rm -rf ./dist && tsc --sourceMap --outDir dist
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # cojson-storage-indexeddb
2
2
 
3
+ ## 0.11.0
4
+
5
+ ### Patch Changes
6
+
7
+ - a4713df: Moving to the d.ts files for the exported type definitions
8
+ - Updated dependencies [b9d194a]
9
+ - Updated dependencies [a4713df]
10
+ - Updated dependencies [e22de9f]
11
+ - Updated dependencies [34cbdc3]
12
+ - Updated dependencies [0f67e0a]
13
+ - cojson@0.11.0
14
+ - cojson-storage@0.11.0
15
+
3
16
  ## 0.10.15
4
17
 
5
18
  ### Patch Changes
@@ -0,0 +1,19 @@
1
+ export type StoreName = "coValues" | "sessions" | "transactions" | "signatureAfter";
2
+ export declare class CoJsonIDBTransaction {
3
+ db: IDBDatabase;
4
+ tx: IDBTransaction;
5
+ pendingRequests: ((txEntry: this) => void)[];
6
+ rejectHandlers: (() => void)[];
7
+ id: number;
8
+ running: boolean;
9
+ failed: boolean;
10
+ done: boolean;
11
+ constructor(db: IDBDatabase);
12
+ startedAt: number;
13
+ isReusable(): boolean;
14
+ getObjectStore(name: StoreName): IDBObjectStore;
15
+ private pushRequest;
16
+ handleRequest<T>(handler: (txEntry: this) => IDBRequest<T>): Promise<T>;
17
+ commit(): void;
18
+ }
19
+ //# sourceMappingURL=CoJsonIDBTransaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoJsonIDBTransaction.d.ts","sourceRoot":"","sources":["../src/CoJsonIDBTransaction.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GACjB,UAAU,GACV,UAAU,GACV,cAAc,GACd,gBAAgB,CAAC;AAKrB,qBAAa,oBAAoB;IAC/B,EAAE,EAAE,WAAW,CAAC;IAChB,EAAE,EAAE,cAAc,CAAC;IAEnB,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,KAAK,IAAI,CAAC,EAAE,CAAM;IAClD,cAAc,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,CAAM;IAEpC,EAAE,SAAiB;IAEnB,OAAO,UAAS;IAChB,MAAM,UAAS;IACf,IAAI,UAAS;gBAED,EAAE,EAAE,WAAW;IAgB3B,SAAS,SAAqB;IAC9B,UAAU;IAKV,cAAc,CAAC,IAAI,EAAE,SAAS;IAI9B,OAAO,CAAC,WAAW;IAgCnB,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC;IAyB1D,MAAM;CAKP"}
@@ -0,0 +1,29 @@
1
+ import type { CojsonInternalTypes, RawCoID, SessionID } from "cojson";
2
+ import type { DBClientInterface, SessionRow, SignatureAfterRow, StoredCoValueRow, StoredSessionRow, TransactionRow } from "cojson-storage";
3
+ import { CoJsonIDBTransaction } from "./CoJsonIDBTransaction.js";
4
+ export declare class IDBClient implements DBClientInterface {
5
+ private db;
6
+ activeTransaction: CoJsonIDBTransaction | undefined;
7
+ autoBatchingTransaction: CoJsonIDBTransaction | undefined;
8
+ constructor(db: IDBDatabase);
9
+ makeRequest<T>(handler: (txEntry: CoJsonIDBTransaction) => IDBRequest<T>): Promise<T>;
10
+ getCoValue(coValueId: RawCoID): Promise<StoredCoValueRow | undefined>;
11
+ getCoValueSessions(coValueRowId: number): Promise<StoredSessionRow[]>;
12
+ getSingleCoValueSession(coValueRowId: number, sessionID: SessionID): Promise<StoredSessionRow | undefined>;
13
+ getNewTransactionInSession(sessionRowId: number, firstNewTxIdx: number): Promise<TransactionRow[]>;
14
+ getSignatures(sessionRowId: number, firstNewTxIdx: number): Promise<SignatureAfterRow[]>;
15
+ addCoValue(msg: CojsonInternalTypes.NewContentMessage): Promise<number>;
16
+ addSessionUpdate({ sessionUpdate, sessionRow, }: {
17
+ sessionUpdate: SessionRow;
18
+ sessionRow?: StoredSessionRow;
19
+ }): Promise<number>;
20
+ addTransaction(sessionRowID: number, idx: number, newTransaction: CojsonInternalTypes.Transaction): Promise<void>;
21
+ addSignatureAfter({ sessionRowID, idx, signature, }: {
22
+ sessionRowID: number;
23
+ idx: number;
24
+ signature: CojsonInternalTypes.Signature;
25
+ }): Promise<IDBValidKey>;
26
+ closeTransaction(tx: CoJsonIDBTransaction): void;
27
+ transaction(operationsCallback: () => unknown): Promise<void>;
28
+ }
29
+ //# sourceMappingURL=idbClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"idbClient.d.ts","sourceRoot":"","sources":["../src/idbClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACtE,OAAO,KAAK,EAEV,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,qBAAa,SAAU,YAAW,iBAAiB;IACjD,OAAO,CAAC,EAAE,CAAC;IAEX,iBAAiB,EAAE,oBAAoB,GAAG,SAAS,CAAC;IACpD,uBAAuB,EAAE,oBAAoB,GAAG,SAAS,CAAC;gBAE9C,EAAE,EAAE,WAAW;IAI3B,WAAW,CAAC,CAAC,EACX,OAAO,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,UAAU,CAAC,CAAC,CAAC,GACxD,OAAO,CAAC,CAAC,CAAC;IAgBP,UAAU,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAMrE,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IASrE,uBAAuB,CAC3B,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IASlC,0BAA0B,CAC9B,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,cAAc,EAAE,CAAC;IAatB,aAAa,CACjB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAazB,UAAU,CACd,GAAG,EAAE,mBAAmB,CAAC,iBAAiB,GACzC,OAAO,CAAC,MAAM,CAAC;IAcZ,gBAAgB,CAAC,EACrB,aAAa,EACb,UAAU,GACX,EAAE;QACD,aAAa,EAAE,UAAU,CAAC;QAC1B,UAAU,CAAC,EAAE,gBAAgB,CAAC;KAC/B,GAAG,OAAO,CAAC,MAAM,CAAC;IAcb,cAAc,CAClB,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,mBAAmB,CAAC,WAAW;IAW3C,iBAAiB,CAAC,EACtB,YAAY,EACZ,GAAG,EACH,SAAS,GACV,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,mBAAmB,CAAC,SAAS,CAAC;KAC1C;IAUD,gBAAgB,CAAC,EAAE,EAAE,oBAAoB;IAQnC,WAAW,CAAC,kBAAkB,EAAE,MAAM,OAAO;CAYpD"}
@@ -0,0 +1,13 @@
1
+ import { type IncomingSyncStream, type OutgoingSyncQueue, type Peer } from "cojson";
2
+ export declare function internal_setDatabaseName(name: string): void;
3
+ export declare class IDBNode {
4
+ private readonly dbClient;
5
+ private readonly syncManager;
6
+ constructor(db: IDBDatabase, fromLocalNode: IncomingSyncStream, toLocalNode: OutgoingSyncQueue);
7
+ static asPeer({ trace, localNodeName, }?: {
8
+ trace?: boolean;
9
+ localNodeName?: string;
10
+ } | undefined): Promise<Peer>;
11
+ static open(fromLocalNode: IncomingSyncStream, toLocalNode: OutgoingSyncQueue): Promise<IDBNode>;
12
+ }
13
+ //# sourceMappingURL=idbNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"idbNode.d.ts","sourceRoot":"","sources":["../src/idbNode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,IAAI,EAEV,MAAM,QAAQ,CAAC;AAMhB,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,QAEpD;AAED,qBAAa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAY;IACrC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;gBAGxC,EAAE,EAAE,WAAW,EACf,aAAa,EAAE,kBAAkB,EACjC,WAAW,EAAE,iBAAiB;WAuBnB,MAAM,CACjB,EACE,KAAK,EACL,aAAuB,GACxB,GAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAEhD,GACA,OAAO,CAAC,IAAI,CAAC;WAiBH,IAAI,CACf,aAAa,EAAE,kBAAkB,EACjC,WAAW,EAAE,iBAAiB;CA8CjC"}
@@ -0,0 +1,2 @@
1
+ export { IDBNode, IDBNode as IDBStorage, internal_setDatabaseName, } from "./idbNode.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,OAAO,IAAI,UAAU,EACrB,wBAAwB,GACzB,MAAM,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=CoJsonIDBTransaction.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoJsonIDBTransaction.test.d.ts","sourceRoot":"","sources":["../../src/tests/CoJsonIDBTransaction.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=idbNode.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"idbNode.test.d.ts","sourceRoot":"","sources":["../../src/tests/idbNode.test.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "cojson-storage-indexeddb",
3
- "version": "0.10.15",
3
+ "version": "0.11.0",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
- "types": "src/index.ts",
6
+ "types": "dist/index.d.ts",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
- "cojson": "0.10.15",
10
- "cojson-storage": "0.10.15"
9
+ "cojson": "0.11.0",
10
+ "cojson-storage": "0.11.0"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@vitest/browser": "^3.0.5",
package/tsconfig.json CHANGED
@@ -9,7 +9,9 @@
9
9
  "skipLibCheck": true,
10
10
  "forceConsistentCasingInFileNames": true,
11
11
  "noUncheckedIndexedAccess": true,
12
- "esModuleInterop": true
12
+ "esModuleInterop": true,
13
+ "declaration": true,
14
+ "declarationMap": true
13
15
  },
14
16
  "include": ["./src/**/*"]
15
17
  }