@neetru/sdk 2.1.0 → 2.1.1
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 +53 -1
- package/dist/auth.cjs +29 -7
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +2 -2
- package/dist/auth.d.ts +2 -2
- package/dist/auth.mjs +29 -7
- package/dist/auth.mjs.map +1 -1
- package/dist/catalog.d.cts +2 -2
- package/dist/catalog.d.ts +2 -2
- package/dist/checkout.d.cts +2 -2
- package/dist/checkout.d.ts +2 -2
- 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.d.cts +2 -2
- package/dist/entitlements.d.ts +2 -2
- package/dist/index.cjs +49 -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 +49 -21
- package/dist/index.mjs.map +1 -1
- package/dist/mocks.cjs +20 -14
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.d.cts +2 -2
- package/dist/mocks.d.ts +2 -2
- package/dist/mocks.mjs +20 -14
- package/dist/mocks.mjs.map +1 -1
- package/dist/notifications.d.cts +2 -2
- package/dist/notifications.d.ts +2 -2
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/support.d.cts +2 -2
- package/dist/support.d.ts +2 -2
- package/dist/telemetry.d.cts +2 -2
- package/dist/telemetry.d.ts +2 -2
- package/dist/{types-Kmt4y1FQ.d.cts → types-Cfb-qeDg.d.cts} +1 -1
- package/dist/{types-B1jylbMC.d.ts → types-V1EfjR1p.d.ts} +1 -1
- package/dist/usage.d.cts +2 -2
- package/dist/usage.d.ts +2 -2
- package/dist/webhooks.d.cts +2 -2
- package/dist/webhooks.d.ts +2 -2
- package/package.json +2 -2
package/dist/auth.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as NeetruClientConfig, N as NeetruClient } from './types-
|
|
2
|
-
import './collection-ref-
|
|
1
|
+
import { o as NeetruClientConfig, N as NeetruClient } from './types-Cfb-qeDg.cjs';
|
|
2
|
+
import './collection-ref-DqAAhuhX.cjs';
|
|
3
3
|
import '@neetru/realtime-protocol';
|
|
4
4
|
import 'drizzle-orm/node-postgres';
|
|
5
5
|
import './errors.cjs';
|
package/dist/auth.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as NeetruClientConfig, N as NeetruClient } from './types-
|
|
2
|
-
import './collection-ref-
|
|
1
|
+
import { o as NeetruClientConfig, N as NeetruClient } from './types-V1EfjR1p.js';
|
|
2
|
+
import './collection-ref-DqAAhuhX.js';
|
|
3
3
|
import '@neetru/realtime-protocol';
|
|
4
4
|
import 'drizzle-orm/node-postgres';
|
|
5
5
|
import './errors.js';
|
package/dist/auth.mjs
CHANGED
|
@@ -2954,10 +2954,9 @@ var DbCollectionRefImpl = class {
|
|
|
2954
2954
|
const batchId = `batch-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
2955
2955
|
const busChanges = [];
|
|
2956
2956
|
for (const op of ops) {
|
|
2957
|
-
const
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
if (op.op === "add") {
|
|
2957
|
+
const collection = this._collection;
|
|
2958
|
+
if (op.kind === "add") {
|
|
2959
|
+
const data = op.data;
|
|
2961
2960
|
const mutation = await this._queue.enqueue({
|
|
2962
2961
|
collection,
|
|
2963
2962
|
op: "add",
|
|
@@ -2981,7 +2980,9 @@ var DbCollectionRefImpl = class {
|
|
|
2981
2980
|
}
|
|
2982
2981
|
});
|
|
2983
2982
|
busChanges.push({ type: "added", collection, doc: { id: docId, data } });
|
|
2984
|
-
} else if (op.
|
|
2983
|
+
} else if (op.kind === "set") {
|
|
2984
|
+
const id = op.id;
|
|
2985
|
+
const data = op.data;
|
|
2985
2986
|
const existing = await this._store.getDoc(collection, id);
|
|
2986
2987
|
const mutation = await this._queue.enqueue({
|
|
2987
2988
|
collection,
|
|
@@ -3010,7 +3011,9 @@ var DbCollectionRefImpl = class {
|
|
|
3010
3011
|
collection,
|
|
3011
3012
|
doc: { id, data }
|
|
3012
3013
|
});
|
|
3013
|
-
} else if (op.
|
|
3014
|
+
} else if (op.kind === "update") {
|
|
3015
|
+
const id = op.id;
|
|
3016
|
+
const data = op.data;
|
|
3014
3017
|
const existing = await this._store.getDoc(collection, id);
|
|
3015
3018
|
const merged = { ...existing?.data ?? {}, ...data };
|
|
3016
3019
|
const mutation = await this._queue.enqueue({
|
|
@@ -3039,7 +3042,8 @@ var DbCollectionRefImpl = class {
|
|
|
3039
3042
|
}
|
|
3040
3043
|
});
|
|
3041
3044
|
busChanges.push({ type: "modified", collection, doc: { id, data: merged } });
|
|
3042
|
-
} else if (op.
|
|
3045
|
+
} else if (op.kind === "remove") {
|
|
3046
|
+
const id = op.id;
|
|
3043
3047
|
const existing = await this._store.getDoc(collection, id);
|
|
3044
3048
|
await this._queue.enqueue({
|
|
3045
3049
|
collection,
|
|
@@ -3148,6 +3152,15 @@ var DbCollectionRefImpl = class {
|
|
|
3148
3152
|
assertValidId(id);
|
|
3149
3153
|
const self = this;
|
|
3150
3154
|
return {
|
|
3155
|
+
get id() {
|
|
3156
|
+
return id;
|
|
3157
|
+
},
|
|
3158
|
+
get path() {
|
|
3159
|
+
return `${self._collection}/${id}`;
|
|
3160
|
+
},
|
|
3161
|
+
get collection() {
|
|
3162
|
+
return self._collection;
|
|
3163
|
+
},
|
|
3151
3164
|
async get() {
|
|
3152
3165
|
return self._buildGetResult(id);
|
|
3153
3166
|
},
|
|
@@ -4281,6 +4294,15 @@ function createLazyCollectionRef(name, getDocsPromise) {
|
|
|
4281
4294
|
},
|
|
4282
4295
|
doc(id) {
|
|
4283
4296
|
return {
|
|
4297
|
+
get id() {
|
|
4298
|
+
return id;
|
|
4299
|
+
},
|
|
4300
|
+
get path() {
|
|
4301
|
+
return `${name}/${id}`;
|
|
4302
|
+
},
|
|
4303
|
+
get collection() {
|
|
4304
|
+
return name;
|
|
4305
|
+
},
|
|
4284
4306
|
async get() {
|
|
4285
4307
|
return (await getRef()).doc(id).get();
|
|
4286
4308
|
},
|