@neetru/sdk 2.1.0 → 2.2.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.
- package/CHANGELOG.md +94 -1
- package/dist/auth.cjs +156 -7
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +5 -3
- package/dist/auth.d.ts +5 -3
- package/dist/auth.mjs +156 -8
- package/dist/auth.mjs.map +1 -1
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +2 -2
- package/dist/catalog.d.ts +2 -2
- package/dist/catalog.mjs.map +1 -1
- package/dist/checkout.cjs.map +1 -1
- package/dist/checkout.d.cts +2 -2
- package/dist/checkout.d.ts +2 -2
- package/dist/checkout.mjs.map +1 -1
- package/dist/{collection-ref-BBvTTXoG.d.cts → collection-ref-DqAAhuhX.d.cts} +56 -7
- package/dist/{collection-ref-BBvTTXoG.d.ts → collection-ref-DqAAhuhX.d.ts} +56 -7
- package/dist/db-react.d.cts +1 -1
- package/dist/db-react.d.ts +1 -1
- package/dist/db.cjs +29 -7
- package/dist/db.cjs.map +1 -1
- package/dist/db.d.cts +2 -2
- package/dist/db.d.ts +2 -2
- package/dist/db.mjs +29 -7
- package/dist/db.mjs.map +1 -1
- package/dist/entitlements.cjs.map +1 -1
- package/dist/entitlements.d.cts +2 -2
- package/dist/entitlements.d.ts +2 -2
- package/dist/entitlements.mjs.map +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.mjs.map +1 -1
- package/dist/index.cjs +172 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +172 -21
- package/dist/index.mjs.map +1 -1
- package/dist/mocks.cjs +75 -14
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.d.cts +22 -2
- package/dist/mocks.d.ts +22 -2
- package/dist/mocks.mjs +75 -14
- package/dist/mocks.mjs.map +1 -1
- package/dist/notifications.cjs.map +1 -1
- package/dist/notifications.d.cts +2 -2
- package/dist/notifications.d.ts +2 -2
- package/dist/notifications.mjs.map +1 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/support.cjs.map +1 -1
- package/dist/support.d.cts +2 -2
- package/dist/support.d.ts +2 -2
- package/dist/support.mjs.map +1 -1
- package/dist/telemetry.cjs.map +1 -1
- package/dist/telemetry.d.cts +2 -2
- package/dist/telemetry.d.ts +2 -2
- package/dist/telemetry.mjs.map +1 -1
- package/dist/{types-B1jylbMC.d.ts → types-CvTje138.d.ts} +46 -2
- package/dist/{types-Kmt4y1FQ.d.cts → types-DlDxttiG.d.cts} +46 -2
- package/dist/usage.cjs.map +1 -1
- package/dist/usage.d.cts +2 -2
- package/dist/usage.d.ts +2 -2
- package/dist/usage.mjs.map +1 -1
- package/dist/webhooks.cjs.map +1 -1
- package/dist/webhooks.d.cts +2 -2
- package/dist/webhooks.d.ts +2 -2
- package/dist/webhooks.mjs.map +1 -1
- package/package.json +3 -2
package/dist/db.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { C as ConflictRecord, a as CreateOfflineDocumentsOptions, D as DbBatchOp, b as DbChangeType, c as DbCollectionRef, d as DbDoc, e as DbDocRef, f as DbGetResult, g as DbListResult, h as DbQuery, i as DbWhereFilter, N as NeetruDbDocuments, R as RealtimeTransport, S as SyncState } from './collection-ref-
|
|
2
|
-
export { k as DbSqlLease, p as NeetruDb, q as NeetruDbEngine, r as NeetruDbError, s as NeetruDbErrorCode, t as NeetruDbOptions, v as NeetruSqlClient, I as SqlOptions,
|
|
1
|
+
export { C as ConflictRecord, a as CreateOfflineDocumentsOptions, D as DbBatchOp, b as DbChangeType, c as DbCollectionRef, d as DbDoc, e as DbDocRef, f as DbGetResult, g as DbListResult, h as DbQuery, i as DbWhereFilter, N as NeetruDbDocuments, R as RealtimeTransport, S as SyncState } from './collection-ref-DqAAhuhX.cjs';
|
|
2
|
+
export { k as DbSqlLease, p as NeetruDb, q as NeetruDbEngine, r as NeetruDbError, s as NeetruDbErrorCode, t as NeetruDbOptions, v as NeetruSqlClient, I as SqlOptions, a4 as createNeetruDb, a6 as createRestSyncTransport, a8 as getWebSocketRealtimeClient } from './types-DlDxttiG.cjs';
|
|
3
3
|
import '@neetru/realtime-protocol';
|
|
4
4
|
import 'drizzle-orm/node-postgres';
|
|
5
5
|
import './errors.cjs';
|
package/dist/db.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { C as ConflictRecord, a as CreateOfflineDocumentsOptions, D as DbBatchOp, b as DbChangeType, c as DbCollectionRef, d as DbDoc, e as DbDocRef, f as DbGetResult, g as DbListResult, h as DbQuery, i as DbWhereFilter, N as NeetruDbDocuments, R as RealtimeTransport, S as SyncState } from './collection-ref-
|
|
2
|
-
export { k as DbSqlLease, p as NeetruDb, q as NeetruDbEngine, r as NeetruDbError, s as NeetruDbErrorCode, t as NeetruDbOptions, v as NeetruSqlClient, I as SqlOptions,
|
|
1
|
+
export { C as ConflictRecord, a as CreateOfflineDocumentsOptions, D as DbBatchOp, b as DbChangeType, c as DbCollectionRef, d as DbDoc, e as DbDocRef, f as DbGetResult, g as DbListResult, h as DbQuery, i as DbWhereFilter, N as NeetruDbDocuments, R as RealtimeTransport, S as SyncState } from './collection-ref-DqAAhuhX.js';
|
|
2
|
+
export { k as DbSqlLease, p as NeetruDb, q as NeetruDbEngine, r as NeetruDbError, s as NeetruDbErrorCode, t as NeetruDbOptions, v as NeetruSqlClient, I as SqlOptions, a4 as createNeetruDb, a6 as createRestSyncTransport, a8 as getWebSocketRealtimeClient } from './types-CvTje138.js';
|
|
3
3
|
import '@neetru/realtime-protocol';
|
|
4
4
|
import 'drizzle-orm/node-postgres';
|
|
5
5
|
import './errors.js';
|
package/dist/db.mjs
CHANGED
|
@@ -2375,10 +2375,9 @@ var DbCollectionRefImpl = class {
|
|
|
2375
2375
|
const batchId = `batch-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
2376
2376
|
const busChanges = [];
|
|
2377
2377
|
for (const op of ops) {
|
|
2378
|
-
const
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
if (op.op === "add") {
|
|
2378
|
+
const collection = this._collection;
|
|
2379
|
+
if (op.kind === "add") {
|
|
2380
|
+
const data = op.data;
|
|
2382
2381
|
const mutation = await this._queue.enqueue({
|
|
2383
2382
|
collection,
|
|
2384
2383
|
op: "add",
|
|
@@ -2402,7 +2401,9 @@ var DbCollectionRefImpl = class {
|
|
|
2402
2401
|
}
|
|
2403
2402
|
});
|
|
2404
2403
|
busChanges.push({ type: "added", collection, doc: { id: docId, data } });
|
|
2405
|
-
} else if (op.
|
|
2404
|
+
} else if (op.kind === "set") {
|
|
2405
|
+
const id = op.id;
|
|
2406
|
+
const data = op.data;
|
|
2406
2407
|
const existing = await this._store.getDoc(collection, id);
|
|
2407
2408
|
const mutation = await this._queue.enqueue({
|
|
2408
2409
|
collection,
|
|
@@ -2431,7 +2432,9 @@ var DbCollectionRefImpl = class {
|
|
|
2431
2432
|
collection,
|
|
2432
2433
|
doc: { id, data }
|
|
2433
2434
|
});
|
|
2434
|
-
} else if (op.
|
|
2435
|
+
} else if (op.kind === "update") {
|
|
2436
|
+
const id = op.id;
|
|
2437
|
+
const data = op.data;
|
|
2435
2438
|
const existing = await this._store.getDoc(collection, id);
|
|
2436
2439
|
const merged = { ...existing?.data ?? {}, ...data };
|
|
2437
2440
|
const mutation = await this._queue.enqueue({
|
|
@@ -2460,7 +2463,8 @@ var DbCollectionRefImpl = class {
|
|
|
2460
2463
|
}
|
|
2461
2464
|
});
|
|
2462
2465
|
busChanges.push({ type: "modified", collection, doc: { id, data: merged } });
|
|
2463
|
-
} else if (op.
|
|
2466
|
+
} else if (op.kind === "remove") {
|
|
2467
|
+
const id = op.id;
|
|
2464
2468
|
const existing = await this._store.getDoc(collection, id);
|
|
2465
2469
|
await this._queue.enqueue({
|
|
2466
2470
|
collection,
|
|
@@ -2569,6 +2573,15 @@ var DbCollectionRefImpl = class {
|
|
|
2569
2573
|
assertValidId(id);
|
|
2570
2574
|
const self = this;
|
|
2571
2575
|
return {
|
|
2576
|
+
get id() {
|
|
2577
|
+
return id;
|
|
2578
|
+
},
|
|
2579
|
+
get path() {
|
|
2580
|
+
return `${self._collection}/${id}`;
|
|
2581
|
+
},
|
|
2582
|
+
get collection() {
|
|
2583
|
+
return self._collection;
|
|
2584
|
+
},
|
|
2572
2585
|
async get() {
|
|
2573
2586
|
return self._buildGetResult(id);
|
|
2574
2587
|
},
|
|
@@ -3705,6 +3718,15 @@ function createLazyCollectionRef(name, getDocsPromise) {
|
|
|
3705
3718
|
},
|
|
3706
3719
|
doc(id) {
|
|
3707
3720
|
return {
|
|
3721
|
+
get id() {
|
|
3722
|
+
return id;
|
|
3723
|
+
},
|
|
3724
|
+
get path() {
|
|
3725
|
+
return `${name}/${id}`;
|
|
3726
|
+
},
|
|
3727
|
+
get collection() {
|
|
3728
|
+
return name;
|
|
3729
|
+
},
|
|
3708
3730
|
async get() {
|
|
3709
3731
|
return (await getRef()).doc(id).get();
|
|
3710
3732
|
},
|