@stoker-platform/web-client 0.5.47 → 0.5.48
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/bundle.js +71 -31
- package/dist/types/read/getDocumentRefs.d.ts +1 -1
- package/dist/types/read/getOne.d.ts +1 -1
- package/dist/types/read/getSome.d.ts +2 -2
- package/dist/types/read/getSomeServer.d.ts +1 -1
- package/dist/types/read/subscribeMany.d.ts +1 -1
- package/dist/types/read/subscribeOne.d.ts +1 -1
- package/dist/types/write/deleteRecord.d.ts +1 -1
- package/dist/types/write/updateRecord.d.ts +1 -1
- package/package.json +3 -3
package/dist/bundle.js
CHANGED
|
@@ -8,7 +8,7 @@ import { getFunctions as Ve, httpsCallable as Je, connectFunctionsEmulator as up
|
|
|
8
8
|
import { ReCaptchaEnterpriseProvider as fp, initializeAppCheck as Gn, onTokenChanged as Hn } from "firebase/app-check";
|
|
9
9
|
import { getPerformance as dp } from "firebase/performance";
|
|
10
10
|
import { getRemoteConfig as hp, fetchAndActivate as mp } from "firebase/remote-config";
|
|
11
|
-
const pp = "0.5.
|
|
11
|
+
const pp = "0.5.47", gp = (r) => !!r.auth, ct = (r, e) => {
|
|
12
12
|
if (e?.operations)
|
|
13
13
|
return e.operations.includes(r);
|
|
14
14
|
}, An = (r, e) => e ? e.Role ? r.access?.includes(e.Role) : !1 : !0, yp = (r, e) => e ? !e.Role || r.restrictCreate === !0 ? !1 : typeof r.restrictCreate == "object" ? r.restrictCreate?.includes(e.Role) : !0 : !0, _p = (r, e) => e ? !e.Role || r.restrictUpdate === !0 ? !1 : typeof r.restrictUpdate == "object" ? r.restrictUpdate?.includes(e.Role) : !0 : !0, te = (r, e) => r.filter((t) => t.name === e)[0], _e = (r) => ["OneToOne", "OneToMany", "ManyToOne", "ManyToMany"].includes(r.type), Rd = (r, e) => {
|
|
@@ -1319,7 +1319,7 @@ const _g = /* @__PURE__ */ In(yg), vg = (r, e, t, n, s, i, a, o, c) => {
|
|
|
1319
1319
|
}, Sg = (r, e, t, n, s) => {
|
|
1320
1320
|
const i = {};
|
|
1321
1321
|
for (const a of r) {
|
|
1322
|
-
const c = e[a].default(t, n, s);
|
|
1322
|
+
const c = e[a].default({ sdk: t, utilities: n, context: s });
|
|
1323
1323
|
for (const l in c)
|
|
1324
1324
|
l === "custom" || l === "admin" || l === "fields" || delete c[l];
|
|
1325
1325
|
for (const l of c.fields)
|
|
@@ -11268,11 +11268,11 @@ const fw = async (r, e) => {
|
|
|
11268
11268
|
stream: !0
|
|
11269
11269
|
});
|
|
11270
11270
|
for await (const d of u)
|
|
11271
|
-
console.log(d.data.result.
|
|
11271
|
+
console.log(d.data.result.records.length);
|
|
11272
11272
|
c = { data: await f };
|
|
11273
11273
|
}
|
|
11274
11274
|
const l = c.data;
|
|
11275
|
-
for (const u of l.result.
|
|
11275
|
+
for (const u of l.result.records)
|
|
11276
11276
|
hm(u);
|
|
11277
11277
|
return l?.result;
|
|
11278
11278
|
}, mm = async (r, e, t, n, s, i, a) => {
|
|
@@ -11293,7 +11293,7 @@ const fw = async (r, e) => {
|
|
|
11293
11293
|
}).catch((p) => {
|
|
11294
11294
|
throw p.code === "permission-denied" && console.info(`PERMISSION_DENIED for subcollection ${d} for document at ${e.join("/")}`), p;
|
|
11295
11295
|
});
|
|
11296
|
-
r[d] = h.
|
|
11296
|
+
r[d] = h.records, s && await Promise.all(
|
|
11297
11297
|
// eslint-disable-next-line security/detect-object-injection
|
|
11298
11298
|
r[d].map((p) => uc(p, [...e, d, p.id], s, n, i, a))
|
|
11299
11299
|
), u > 0 && await Promise.all(
|
|
@@ -11363,7 +11363,7 @@ const fw = async (r, e) => {
|
|
|
11363
11363
|
return await hw(r, t, e);
|
|
11364
11364
|
const T = oc(r, a);
|
|
11365
11365
|
if (T.length === 0)
|
|
11366
|
-
return { cursor: {}, pages: 0,
|
|
11366
|
+
return { cursor: {}, pages: 0, records: [] };
|
|
11367
11367
|
let C = T.map((m) => me(m, ...t || []));
|
|
11368
11368
|
const I = e?.pagination?.startAfter || e?.pagination?.endBefore || {
|
|
11369
11369
|
first: /* @__PURE__ */ new Map(),
|
|
@@ -11440,10 +11440,10 @@ const fw = async (r, e) => {
|
|
|
11440
11440
|
m[U.name] = z;
|
|
11441
11441
|
})), e?.noEmbeddingFields && U.type === "Embedding" && delete m[U.name];
|
|
11442
11442
|
await Promise.all(P);
|
|
11443
|
-
const N = { operation: "read", data: m,
|
|
11444
|
-
await ae("postOperation", d, w, N), await ae("postRead", d, w, { context: y, refs: T,
|
|
11443
|
+
const N = { operation: "read", data: m, recordId: m.id, context: y };
|
|
11444
|
+
await ae("postOperation", d, w, N), await ae("postRead", d, w, { context: y, refs: T, record: m, listener: !1 });
|
|
11445
11445
|
}
|
|
11446
|
-
return { cursor: I, pages: O,
|
|
11446
|
+
return { cursor: I, pages: O, records: Array.from(v.values()) };
|
|
11447
11447
|
}, mw = async (r, e, t) => {
|
|
11448
11448
|
const n = it(), s = ze(), i = Ve(n, s.STOKER_FB_FUNCTIONS_REGION), l = (await Je(i, "stoker-readapi")({
|
|
11449
11449
|
path: r,
|
|
@@ -11469,7 +11469,7 @@ const fw = async (r, e) => {
|
|
|
11469
11469
|
}).catch((h) => {
|
|
11470
11470
|
throw h.code === "permission-denied" && console.info(`PERMISSION_DENIED for subcollection ${f} for document at ${e.join("/")}`), h;
|
|
11471
11471
|
});
|
|
11472
|
-
r[f] = d.
|
|
11472
|
+
r[f] = d.records, l > 0 && await Promise.all(
|
|
11473
11473
|
// eslint-disable-next-line security/detect-object-injection
|
|
11474
11474
|
r[f].map(async (h) => {
|
|
11475
11475
|
await gm(h, [...e, f, h.id], { depth: l }, n, s, i);
|
|
@@ -11539,7 +11539,7 @@ const fw = async (r, e) => {
|
|
|
11539
11539
|
if (b.length === 0)
|
|
11540
11540
|
throw new Error("PERMISSION_DENIED");
|
|
11541
11541
|
const T = { collection: d.collection };
|
|
11542
|
-
await ae("preOperation", o, w, { operation: "read",
|
|
11542
|
+
await ae("preOperation", o, w, { operation: "read", recordId: e, context: T }), await ae("preRead", o, w, { context: T, refs: b, multiple: !1, listener: !1 });
|
|
11543
11543
|
let y = {};
|
|
11544
11544
|
const E = b.map(async (A) => {
|
|
11545
11545
|
let m;
|
|
@@ -11564,7 +11564,7 @@ const fw = async (r, e) => {
|
|
|
11564
11564
|
if (t?.noEmbeddingFields)
|
|
11565
11565
|
for (const A of f.fields)
|
|
11566
11566
|
A.type === "Embedding" && delete y[A.name];
|
|
11567
|
-
return await ae("postOperation", o, w, { operation: "read", data: y,
|
|
11567
|
+
return await ae("postOperation", o, w, { operation: "read", data: y, recordId: e, context: T }), await ae("postRead", o, w, { context: T, refs: b, record: y, listener: !1 }), y;
|
|
11568
11568
|
}, pw = (r) => r !== null && typeof r == "object", _m = (r) => {
|
|
11569
11569
|
const e = (t) => {
|
|
11570
11570
|
Object.entries(t).forEach(([n, s]) => {
|
|
@@ -11646,7 +11646,7 @@ const fw = async (r, e) => {
|
|
|
11646
11646
|
const M = {
|
|
11647
11647
|
operation: "update",
|
|
11648
11648
|
data: F,
|
|
11649
|
-
|
|
11649
|
+
recordId: e,
|
|
11650
11650
|
context: A,
|
|
11651
11651
|
batch: O,
|
|
11652
11652
|
originalRecord: we(g)
|
|
@@ -11655,7 +11655,7 @@ const fw = async (r, e) => {
|
|
|
11655
11655
|
const oe = {
|
|
11656
11656
|
operation: "update",
|
|
11657
11657
|
data: F,
|
|
11658
|
-
|
|
11658
|
+
recordId: e,
|
|
11659
11659
|
context: A,
|
|
11660
11660
|
batch: O,
|
|
11661
11661
|
originalRecord: we(g)
|
|
@@ -11677,7 +11677,7 @@ const fw = async (r, e) => {
|
|
|
11677
11677
|
const U = {
|
|
11678
11678
|
operation: "update",
|
|
11679
11679
|
data: F,
|
|
11680
|
-
|
|
11680
|
+
recordId: e,
|
|
11681
11681
|
context: A,
|
|
11682
11682
|
retry: !!v,
|
|
11683
11683
|
originalRecord: we(g)
|
|
@@ -11739,7 +11739,7 @@ const fw = async (r, e) => {
|
|
|
11739
11739
|
const y = C || T, E = {
|
|
11740
11740
|
operation: r,
|
|
11741
11741
|
data: n,
|
|
11742
|
-
|
|
11742
|
+
recordId: t,
|
|
11743
11743
|
context: s,
|
|
11744
11744
|
error: y,
|
|
11745
11745
|
batch: o,
|
|
@@ -11829,7 +11829,19 @@ const fw = async (r, e) => {
|
|
|
11829
11829
|
}
|
|
11830
11830
|
e.id = O;
|
|
11831
11831
|
const m = Ko("create", r, e, i, y, zt(), S.uid, Bt.now(), Lr(), !!E);
|
|
11832
|
-
if (T && (m[T.archivedField] = !1), Nt(m), !E && b && Ye("create", "started", m, r, O, p, S.uid), E || (await ae("preOperation", o, I, {
|
|
11832
|
+
if (T && (m[T.archivedField] = !1), Nt(m), !E && b && Ye("create", "started", m, r, O, p, S.uid), E || (await ae("preOperation", o, I, {
|
|
11833
|
+
operation: "create",
|
|
11834
|
+
data: m,
|
|
11835
|
+
recordId: O,
|
|
11836
|
+
context: A,
|
|
11837
|
+
batch: g
|
|
11838
|
+
}), await ae("preWrite", o, I, {
|
|
11839
|
+
operation: "create",
|
|
11840
|
+
data: m,
|
|
11841
|
+
recordId: O,
|
|
11842
|
+
context: A,
|
|
11843
|
+
batch: g
|
|
11844
|
+
})), Xd(p, m, i), eh(p, m), E || await hy(m, p, I, u.Role), !E)
|
|
11833
11845
|
try {
|
|
11834
11846
|
await om("create", m, p, I, { operation: "create", record: m, context: A, batch: g }, i), v && (x(), await lc("create", O, m, p, u));
|
|
11835
11847
|
} catch (N) {
|
|
@@ -11838,7 +11850,13 @@ const fw = async (r, e) => {
|
|
|
11838
11850
|
if (t?.onValid && t.onValid(), Nt(m), bg(m, O, p, i, S.uid, u), ac("create", g, r, O, m, i, p, t, a, Io, ko, Cn, (N) => ke(l, "tenants", s, "system_fields", w.collection, `${w.collection}-${N.name}`, O), (N, F) => ke(l, "tenants", s, "system_unique", w.collection, `Unique-${w.collection}-${N.name}`, F), (N) => ke(l, "tenants", s, "system_fields", w.collection, `${w.collection}-${N}`, O)), g.set(ke(l, "tenants", s, r.join("/"), O), m), !E && b && Ye("create", "written", m, r, O, p, S.uid), await dc("create", r, O, m, A, p, I, g, S.uid, b || !1, u, !!E), E?.type === "unique")
|
|
11839
11851
|
return { id: O, ...m };
|
|
11840
11852
|
b && Ye("create", "success", m, r, O, p, S.uid);
|
|
11841
|
-
const R = {
|
|
11853
|
+
const R = {
|
|
11854
|
+
operation: "create",
|
|
11855
|
+
data: m,
|
|
11856
|
+
recordId: O,
|
|
11857
|
+
context: A,
|
|
11858
|
+
retry: !!E
|
|
11859
|
+
}, k = { ...R };
|
|
11842
11860
|
return await ae("postWrite", o, I, R), await ae("postOperation", o, I, k), { id: O, ...m };
|
|
11843
11861
|
}, _w = async (r, e) => {
|
|
11844
11862
|
const t = it(), n = ze(), s = Ve(t, n.STOKER_FB_FUNCTIONS_REGION);
|
|
@@ -11885,8 +11903,26 @@ const fw = async (r, e) => {
|
|
|
11885
11903
|
return await _w(r, e);
|
|
11886
11904
|
delete x.id;
|
|
11887
11905
|
const g = Ao(o), O = { collection: p.collection }, A = Ko("delete", r, x, s, I, zt(), E.uid, Bt.now(), Lr(), !!y);
|
|
11888
|
-
Nt(A), !y && _ && Ye("delete", "started", A, r, e, h, E.uid), y || (await ae("preOperation", c, C, {
|
|
11889
|
-
|
|
11906
|
+
Nt(A), !y && _ && Ye("delete", "started", A, r, e, h, E.uid), y || (await ae("preOperation", c, C, {
|
|
11907
|
+
operation: "delete",
|
|
11908
|
+
data: A,
|
|
11909
|
+
recordId: e,
|
|
11910
|
+
context: O,
|
|
11911
|
+
batch: g
|
|
11912
|
+
}), await ae("preWrite", c, C, {
|
|
11913
|
+
operation: "delete",
|
|
11914
|
+
data: A,
|
|
11915
|
+
recordId: e,
|
|
11916
|
+
context: O,
|
|
11917
|
+
batch: g
|
|
11918
|
+
})), Nt(A), Eg(A, e, h, s, E.uid, l), ac("delete", g, r, e, A, s, h, t, i, Io, ko, Cn, (N) => ke(o, "tenants", n, "system_fields", p.collection, `${p.collection}-${N.name}`, e), (N, F) => ke(o, "tenants", n, "system_unique", p.collection, `Unique-${p.collection}-${N.name}`, F), (N) => ke(o, "tenants", n, "system_fields", p.collection, `${p.collection}-${N}`, e)), g.delete(ke(o, "tenants", n, r.join("/"), e)), !y && _ && Ye("delete", "written", A, r, e, h, E.uid), await dc("delete", r, e, A, O, h, C, g, E.uid, _ || !1, l, !!y), _ && Ye("delete", "success", { ...A, ...y?.record || {} }, r, e, h, E.uid);
|
|
11919
|
+
const R = {
|
|
11920
|
+
operation: "delete",
|
|
11921
|
+
data: A,
|
|
11922
|
+
recordId: e,
|
|
11923
|
+
context: O,
|
|
11924
|
+
retry: !!y
|
|
11925
|
+
}, k = { ...R };
|
|
11890
11926
|
return await ae("postWrite", c, C, R), await ae("postOperation", c, C, k), { id: e, ...A };
|
|
11891
11927
|
}, wm = (r) => {
|
|
11892
11928
|
if (typeof r == "object")
|
|
@@ -12116,7 +12152,7 @@ let yd = !1;
|
|
|
12116
12152
|
const Gw = async (r, e, t, n) => {
|
|
12117
12153
|
if (be = t, mt)
|
|
12118
12154
|
return console.error("Stoker is already initialized."), !0;
|
|
12119
|
-
xm("stoker-client", pp, "web"), Tt = be.MODE, pe = r.default("web", Co, n), Sm = await ne(pe, ["global", "timezone"]), ne(pe, ["global", "roles"]), ne(pe, ["global", "appName"]), ne(pe, ["global", "auth", "enableMultiFactorAuth"]);
|
|
12155
|
+
xm("stoker-client", pp, "web"), Tt = be.MODE, pe = r.default({ sdk: "web", utils: Co, context: n }), Sm = await ne(pe, ["global", "timezone"]), ne(pe, ["global", "roles"]), ne(pe, ["global", "appName"]), ne(pe, ["global", "auth", "enableMultiFactorAuth"]);
|
|
12120
12156
|
const s = JSON.parse(be.STOKER_FB_WEB_APP_CONFIG), i = await ne(pe, ["global", "firebase", "GDPRSettings"]);
|
|
12121
12157
|
mt = zn(s, {
|
|
12122
12158
|
automaticDataCollectionEnabled: i || !0
|
|
@@ -12433,7 +12469,7 @@ const Gw = async (r, e, t, n) => {
|
|
|
12433
12469
|
if (C.length === 0)
|
|
12434
12470
|
throw new Error("PERMISSION_DENIED");
|
|
12435
12471
|
const I = h?.roles?.includes(a.Role), y = { collection: d.collection };
|
|
12436
|
-
await ae("preOperation", p, b, { operation: "read",
|
|
12472
|
+
await ae("preOperation", p, b, { operation: "read", recordId: e, context: y }), await ae("preRead", p, b, { context: y, refs: C, multiple: !1, listener: !0 });
|
|
12437
12473
|
const v = /* @__PURE__ */ new Map(), x = [];
|
|
12438
12474
|
let g = {};
|
|
12439
12475
|
const O = /* @__PURE__ */ new Map();
|
|
@@ -12512,12 +12548,12 @@ const Gw = async (r, e, t, n) => {
|
|
|
12512
12548
|
oe[ie] = K, z.set(`${M.name}_${ie}`, !0), Array.from(z.values()).every(($) => $) && (F({}), A(), N.fromCache === !1 && (ae("postOperation", p, b, {
|
|
12513
12549
|
operation: "read",
|
|
12514
12550
|
data: g,
|
|
12515
|
-
|
|
12551
|
+
recordId: e,
|
|
12516
12552
|
context: y
|
|
12517
12553
|
}), ae("postRead", p, b, {
|
|
12518
12554
|
context: y,
|
|
12519
12555
|
refs: C,
|
|
12520
|
-
|
|
12556
|
+
record: g,
|
|
12521
12557
|
listener: !0
|
|
12522
12558
|
})));
|
|
12523
12559
|
}).catch((K) => {
|
|
@@ -12539,12 +12575,12 @@ const Gw = async (r, e, t, n) => {
|
|
|
12539
12575
|
oe[ie] = K, z.set(`${M.name}_${ie}`, !0), Array.from(z.values()).every(($) => $) && (F({}), A(), N.fromCache === !1 && (ae("postOperation", p, b, {
|
|
12540
12576
|
operation: "read",
|
|
12541
12577
|
data: g,
|
|
12542
|
-
|
|
12578
|
+
recordId: e,
|
|
12543
12579
|
context: y
|
|
12544
12580
|
}), ae("postRead", p, b, {
|
|
12545
12581
|
context: y,
|
|
12546
12582
|
refs: C,
|
|
12547
|
-
|
|
12583
|
+
record: g,
|
|
12548
12584
|
listener: !0
|
|
12549
12585
|
})));
|
|
12550
12586
|
},
|
|
@@ -12585,16 +12621,20 @@ const Gw = async (r, e, t, n) => {
|
|
|
12585
12621
|
A(), U.metadata.fromCache === !1 && (ae("postOperation", p, b, {
|
|
12586
12622
|
operation: "read",
|
|
12587
12623
|
data: g,
|
|
12588
|
-
|
|
12624
|
+
recordId: e,
|
|
12589
12625
|
context: y
|
|
12590
12626
|
}), ae("postRead", p, b, {
|
|
12591
12627
|
context: y,
|
|
12592
12628
|
refs: C,
|
|
12593
|
-
|
|
12629
|
+
record: g,
|
|
12594
12630
|
listener: !0
|
|
12595
12631
|
}));
|
|
12596
12632
|
});
|
|
12597
|
-
} else g && (g = void 0, A(), U.metadata.fromCache === !1 && (ae("postOperation", p, b, {
|
|
12633
|
+
} else g && (g = void 0, A(), U.metadata.fromCache === !1 && (ae("postOperation", p, b, {
|
|
12634
|
+
operation: "read",
|
|
12635
|
+
recordId: e,
|
|
12636
|
+
context: y
|
|
12637
|
+
}), ae("postRead", p, b, { context: y, refs: C, listener: !0 })));
|
|
12598
12638
|
}, (U) => {
|
|
12599
12639
|
n && n(U), x.forEach((z) => z());
|
|
12600
12640
|
});
|
|
@@ -12695,10 +12735,10 @@ const Gw = async (r, e, t, n) => {
|
|
|
12695
12735
|
const Z = {
|
|
12696
12736
|
operation: "read",
|
|
12697
12737
|
data: j,
|
|
12698
|
-
|
|
12738
|
+
recordId: j.id,
|
|
12699
12739
|
context: x
|
|
12700
12740
|
};
|
|
12701
|
-
ae("postOperation", _, C, Z), ae("postRead", _, C, { context: x, refs: E,
|
|
12741
|
+
ae("postOperation", _, C, Z), ae("postRead", _, C, { context: x, refs: E, record: j, listener: !0 });
|
|
12702
12742
|
});
|
|
12703
12743
|
});
|
|
12704
12744
|
}, z = (G, K) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { RoleGroup } from "@stoker-platform/types";
|
|
2
|
-
export declare const getDocumentRefs: (path: string[],
|
|
2
|
+
export declare const getDocumentRefs: (path: string[], recordId: string, roleGroup: RoleGroup) => import("@firebase/firestore").DocumentReference<import("@firebase/firestore").DocumentData, import("@firebase/firestore").DocumentData>[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QueryConstraint } from "firebase/firestore";
|
|
2
2
|
import { CollectionField, StokerCollection, StokerRecord } from "@stoker-platform/types";
|
|
3
|
-
export declare const getOne: (path: string[],
|
|
3
|
+
export declare const getOne: (path: string[], recordId: string, options?: {
|
|
4
4
|
only?: "cache" | "server";
|
|
5
5
|
relations?: {
|
|
6
6
|
fields?: (string | CollectionField)[];
|
|
@@ -31,9 +31,9 @@ export interface GetSomeOptions {
|
|
|
31
31
|
export declare const getSome: (path: string[], options?: GetSomeOptions) => Promise<{
|
|
32
32
|
cursor: {};
|
|
33
33
|
pages: number;
|
|
34
|
-
|
|
34
|
+
records: never[];
|
|
35
35
|
} | {
|
|
36
36
|
cursor: Cursor;
|
|
37
37
|
pages: number | undefined;
|
|
38
|
-
|
|
38
|
+
records: StokerRecord[];
|
|
39
39
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StokerRecord } from "@stoker-platform/types";
|
|
2
2
|
import { Cursor } from "../main";
|
|
3
3
|
export declare const getSomeServer: (path: string[], constraints?: [string, string, unknown][], options?: any) => Promise<{
|
|
4
|
-
|
|
4
|
+
records: StokerRecord[];
|
|
5
5
|
pages: number;
|
|
6
6
|
cursor: Cursor;
|
|
7
7
|
}>;
|
|
@@ -24,7 +24,7 @@ export interface SubscribeManyOptions {
|
|
|
24
24
|
constraints: [string, WhereFilterOp, unknown][];
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
export declare const subscribeMany: (path: string[], callback: (
|
|
27
|
+
export declare const subscribeMany: (path: string[], callback: (records: StokerRecord[], cursor: Cursor, metadata: SnapshotMetadata | undefined) => void, errorCallback?: (error: Error) => void, options?: SubscribeManyOptions) => Promise<{
|
|
28
28
|
pages: number | undefined;
|
|
29
29
|
count: number | undefined;
|
|
30
30
|
unsubscribe: (direction?: "first" | "last") => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CollectionField, StokerRecord } from "@stoker-platform/types";
|
|
2
|
-
export declare const subscribeOne: (path: string[],
|
|
2
|
+
export declare const subscribeOne: (path: string[], recordId: string, callback: (record: StokerRecord | undefined) => void, errorCallback?: (error: Error) => void, options?: {
|
|
3
3
|
only?: "cache" | "default";
|
|
4
4
|
relations?: boolean | {
|
|
5
5
|
fields: (string | CollectionField)[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Timestamp } from "firebase/firestore";
|
|
2
2
|
import { StokerRecord } from "@stoker-platform/types";
|
|
3
|
-
export declare const deleteRecord: (path: string[],
|
|
3
|
+
export declare const deleteRecord: (path: string[], recordId: string, options?: {
|
|
4
4
|
retry?: {
|
|
5
5
|
type: string;
|
|
6
6
|
record: StokerRecord;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Timestamp } from "firebase/firestore";
|
|
2
2
|
import { StokerRecord, StokerPermissions } from "@stoker-platform/types";
|
|
3
|
-
export declare const updateRecord: (path: string[],
|
|
3
|
+
export declare const updateRecord: (path: string[], recordId: string, data: Partial<StokerRecord>, options?: {
|
|
4
4
|
user?: {
|
|
5
5
|
operation: "create" | "update" | "delete";
|
|
6
6
|
password?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stoker-platform/web-client",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.48",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"files": [
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"test": "echo \"Error: no test specified\""
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@stoker-platform/types": "0.5.
|
|
28
|
-
"@stoker-platform/utils": "0.5.
|
|
27
|
+
"@stoker-platform/types": "0.5.31",
|
|
28
|
+
"@stoker-platform/utils": "0.5.40",
|
|
29
29
|
"@types/lodash": "^4.17.24",
|
|
30
30
|
"@types/luxon": "^3.7.1",
|
|
31
31
|
"firebase": "^12.12.1",
|