@neetru/sdk 3.6.0 → 3.8.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 +104 -0
- package/README.md +66 -1
- package/dist/ai.cjs +298 -391
- package/dist/ai.d.cts +1 -1
- package/dist/ai.d.ts +1 -1
- package/dist/ai.mjs +298 -391
- package/dist/auth.cjs +3717 -5005
- package/dist/auth.d.cts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/auth.mjs +3714 -5002
- package/dist/build-guard.cjs +101 -119
- package/dist/build-guard.mjs +91 -109
- package/dist/catalog.cjs +220 -225
- package/dist/catalog.d.cts +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.mjs +220 -225
- package/dist/checkout.cjs +307 -323
- package/dist/checkout.d.cts +1 -1
- package/dist/checkout.d.ts +1 -1
- package/dist/checkout.mjs +306 -322
- package/dist/db-react.cjs +59 -87
- package/dist/db-react.d.cts +1 -1
- package/dist/db-react.d.ts +1 -1
- package/dist/db-react.mjs +56 -84
- package/dist/db.cjs +2128 -3014
- package/dist/db.d.cts +1 -1
- package/dist/db.d.ts +1 -1
- package/dist/db.mjs +2141 -3027
- package/dist/entitlements.cjs +19 -20
- package/dist/entitlements.d.cts +1 -1
- package/dist/entitlements.d.ts +1 -1
- package/dist/entitlements.mjs +19 -20
- package/dist/errors.cjs +16 -12
- package/dist/errors.d.cts +59 -3
- package/dist/errors.d.ts +59 -3
- package/dist/errors.mjs +15 -12
- package/dist/firestore-compat.cjs +241 -297
- package/dist/firestore-compat.d.cts +1 -1
- package/dist/firestore-compat.d.ts +1 -1
- package/dist/firestore-compat.mjs +215 -271
- package/dist/index.cjs +3942 -5134
- package/dist/index.d.cts +181 -5
- package/dist/index.d.ts +181 -5
- package/dist/index.mjs +4040 -5239
- package/dist/mobile.cjs +459 -344
- package/dist/mobile.d.cts +59 -4
- package/dist/mobile.d.ts +59 -4
- package/dist/mobile.mjs +459 -344
- package/dist/mocks.cjs +319 -447
- package/dist/mocks.d.cts +1 -1
- package/dist/mocks.d.ts +1 -1
- package/dist/mocks.mjs +313 -441
- package/dist/notifications.cjs +296 -317
- package/dist/notifications.d.cts +1 -1
- package/dist/notifications.d.ts +1 -1
- package/dist/notifications.mjs +295 -316
- package/dist/react.cjs +557 -707
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.mjs +547 -697
- package/dist/support.cjs +402 -328
- package/dist/support.d.cts +29 -3
- package/dist/support.d.ts +29 -3
- package/dist/support.mjs +401 -328
- package/dist/telemetry.cjs +267 -304
- package/dist/telemetry.d.cts +1 -1
- package/dist/telemetry.d.ts +1 -1
- package/dist/telemetry.mjs +267 -304
- package/dist/{types-Du_iioJ7.d.cts → types-D-9bjlM0.d.cts} +74 -1
- package/dist/{types-BPATkXYu.d.ts → types-bVztFQTI.d.ts} +74 -1
- package/dist/usage.cjs +233 -230
- package/dist/usage.d.cts +1 -1
- package/dist/usage.d.ts +1 -1
- package/dist/usage.mjs +233 -230
- package/dist/webhooks.cjs +328 -362
- package/dist/webhooks.d.cts +1 -1
- package/dist/webhooks.d.ts +1 -1
- package/dist/webhooks.mjs +325 -359
- package/package.json +5 -3
- package/dist/ai.cjs.map +0 -1
- package/dist/ai.mjs.map +0 -1
- package/dist/auth.cjs.map +0 -1
- package/dist/auth.mjs.map +0 -1
- package/dist/build-guard.cjs.map +0 -1
- package/dist/build-guard.mjs.map +0 -1
- package/dist/catalog.cjs.map +0 -1
- package/dist/catalog.mjs.map +0 -1
- package/dist/checkout.cjs.map +0 -1
- package/dist/checkout.mjs.map +0 -1
- package/dist/db-react.cjs.map +0 -1
- package/dist/db-react.mjs.map +0 -1
- package/dist/db.cjs.map +0 -1
- package/dist/db.mjs.map +0 -1
- package/dist/entitlements.cjs.map +0 -1
- package/dist/entitlements.mjs.map +0 -1
- package/dist/errors.cjs.map +0 -1
- package/dist/errors.mjs.map +0 -1
- package/dist/firestore-compat.cjs.map +0 -1
- package/dist/firestore-compat.mjs.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/mobile.cjs.map +0 -1
- package/dist/mobile.mjs.map +0 -1
- package/dist/mocks.cjs.map +0 -1
- package/dist/mocks.mjs.map +0 -1
- package/dist/notifications.cjs.map +0 -1
- package/dist/notifications.mjs.map +0 -1
- package/dist/react.cjs.map +0 -1
- package/dist/react.mjs.map +0 -1
- package/dist/support.cjs.map +0 -1
- package/dist/support.mjs.map +0 -1
- package/dist/telemetry.cjs.map +0 -1
- package/dist/telemetry.mjs.map +0 -1
- package/dist/usage.cjs.map +0 -1
- package/dist/usage.mjs.map +0 -1
- package/dist/webhooks.cjs.map +0 -1
- package/dist/webhooks.mjs.map +0 -1
package/dist/db-react.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var n = require('react');
|
|
4
4
|
|
|
5
5
|
function _interopNamespace(e) {
|
|
6
6
|
if (e && e.__esModule) return e;
|
|
@@ -20,129 +20,101 @@ function _interopNamespace(e) {
|
|
|
20
20
|
return Object.freeze(n);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var n__namespace = /*#__PURE__*/_interopNamespace(n);
|
|
24
24
|
|
|
25
25
|
// src/db/react.ts
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
if (typeof
|
|
29
|
-
|
|
30
|
-
return !!
|
|
26
|
+
function f(e) {
|
|
27
|
+
let t = e;
|
|
28
|
+
if (typeof t.syncState < "u") return false;
|
|
29
|
+
let s = t.db;
|
|
30
|
+
return !!s && typeof s.syncState < "u" && typeof s.onSyncStateChanged == "function";
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
32
|
+
function i(e) {
|
|
33
|
+
return f(e) ? e.db : e;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
if (!
|
|
35
|
+
function S(e) {
|
|
36
|
+
if (!e) return "";
|
|
37
37
|
try {
|
|
38
|
-
return JSON.stringify(
|
|
38
|
+
return JSON.stringify(e, Object.keys(e).sort());
|
|
39
39
|
} catch {
|
|
40
|
-
return String(
|
|
40
|
+
return String(e);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
|
|
43
|
+
function d(e, t) {
|
|
44
|
+
let [s, c] = n__namespace.useState({
|
|
45
45
|
data: null,
|
|
46
46
|
loading: true,
|
|
47
47
|
fromCache: true,
|
|
48
48
|
stale: false
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
} else {
|
|
66
|
-
setState({
|
|
67
|
-
data: snap.docs[0]?.data ?? null,
|
|
68
|
-
loading: false,
|
|
69
|
-
fromCache: snap.fromCache,
|
|
70
|
-
stale: snap.stale
|
|
71
|
-
});
|
|
72
|
-
}
|
|
49
|
+
}), o = n__namespace.useRef(true);
|
|
50
|
+
return n__namespace.useEffect(() => {
|
|
51
|
+
o.current = true, c({ data: null, loading: true, fromCache: true, stale: false });
|
|
52
|
+
let a = e.doc(t).onSnapshot(
|
|
53
|
+
(r) => {
|
|
54
|
+
o.current && (r === null || r.docs.length === 0 ? c({
|
|
55
|
+
data: null,
|
|
56
|
+
loading: false,
|
|
57
|
+
fromCache: r?.fromCache ?? true,
|
|
58
|
+
stale: r?.stale ?? false
|
|
59
|
+
}) : c({
|
|
60
|
+
data: r.docs[0]?.data ?? null,
|
|
61
|
+
loading: false,
|
|
62
|
+
fromCache: r.fromCache,
|
|
63
|
+
stale: r.stale
|
|
64
|
+
}));
|
|
73
65
|
}
|
|
74
66
|
);
|
|
75
67
|
return () => {
|
|
76
|
-
|
|
77
|
-
unsubscribe();
|
|
68
|
+
o.current = false, a();
|
|
78
69
|
};
|
|
79
|
-
}, [
|
|
80
|
-
return state;
|
|
70
|
+
}, [e, t]), s;
|
|
81
71
|
}
|
|
82
|
-
function
|
|
83
|
-
|
|
72
|
+
function y(e, t) {
|
|
73
|
+
let [s, c] = n__namespace.useState({
|
|
84
74
|
docs: [],
|
|
85
75
|
loading: true,
|
|
86
76
|
fromCache: true,
|
|
87
77
|
stale: false,
|
|
88
78
|
hasPendingWrites: false
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const queryRef = React__namespace.useRef(query);
|
|
93
|
-
queryRef.current = query;
|
|
94
|
-
React__namespace.useEffect(() => {
|
|
95
|
-
mountedRef.current = true;
|
|
96
|
-
setState({
|
|
79
|
+
}), o = n__namespace.useRef(true), u = S(t), a = n__namespace.useRef(t);
|
|
80
|
+
return a.current = t, n__namespace.useEffect(() => {
|
|
81
|
+
o.current = true, c({
|
|
97
82
|
docs: [],
|
|
98
83
|
loading: true,
|
|
99
84
|
fromCache: true,
|
|
100
85
|
stale: false,
|
|
101
86
|
hasPendingWrites: false
|
|
102
87
|
});
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
docs: snap.docs,
|
|
88
|
+
let r = e.onSnapshot(
|
|
89
|
+
a.current,
|
|
90
|
+
(l) => {
|
|
91
|
+
o.current && c({
|
|
92
|
+
docs: l.docs,
|
|
109
93
|
loading: false,
|
|
110
|
-
fromCache:
|
|
111
|
-
stale:
|
|
112
|
-
hasPendingWrites:
|
|
94
|
+
fromCache: l.fromCache,
|
|
95
|
+
stale: l.stale,
|
|
96
|
+
hasPendingWrites: l.hasPendingWrites
|
|
113
97
|
});
|
|
114
98
|
}
|
|
115
99
|
);
|
|
116
100
|
return () => {
|
|
117
|
-
|
|
118
|
-
unsubscribe();
|
|
101
|
+
o.current = false, r();
|
|
119
102
|
};
|
|
120
|
-
}, [
|
|
121
|
-
return state;
|
|
103
|
+
}, [e, u]), s;
|
|
122
104
|
}
|
|
123
|
-
function
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if (mountedRef.current) {
|
|
130
|
-
setState(source.syncState);
|
|
131
|
-
}
|
|
132
|
-
const unsubscribe = source.onSyncStateChanged((s) => {
|
|
133
|
-
if (!mountedRef.current) return;
|
|
134
|
-
setState(s);
|
|
105
|
+
function b(e) {
|
|
106
|
+
let t = i(e), [s, c] = n__namespace.useState(() => t.syncState), o = n__namespace.useRef(true);
|
|
107
|
+
return n__namespace.useEffect(() => {
|
|
108
|
+
o.current = true, o.current && c(t.syncState);
|
|
109
|
+
let u = t.onSyncStateChanged((a) => {
|
|
110
|
+
o.current && c(a);
|
|
135
111
|
});
|
|
136
112
|
return () => {
|
|
137
|
-
|
|
138
|
-
unsubscribe();
|
|
113
|
+
o.current = false, u();
|
|
139
114
|
};
|
|
140
|
-
}, [
|
|
141
|
-
return state;
|
|
115
|
+
}, [t]), s;
|
|
142
116
|
}
|
|
143
117
|
|
|
144
|
-
exports.useCollection =
|
|
145
|
-
exports.useDocument =
|
|
146
|
-
exports.useSyncState =
|
|
147
|
-
//# sourceMappingURL=db-react.cjs.map
|
|
148
|
-
//# sourceMappingURL=db-react.cjs.map
|
|
118
|
+
exports.useCollection = y;
|
|
119
|
+
exports.useDocument = d;
|
|
120
|
+
exports.useSyncState = b;
|
package/dist/db-react.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ar as SyncState, aw as Unsubscribe, F as DbDoc, X as NeetruClient, E as DbCollectionRef, K as DbQuery } from './types-D-9bjlM0.cjs';
|
|
2
2
|
import 'drizzle-orm/node-postgres';
|
|
3
3
|
import './errors.cjs';
|
|
4
4
|
|
package/dist/db-react.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ar as SyncState, aw as Unsubscribe, F as DbDoc, X as NeetruClient, E as DbCollectionRef, K as DbQuery } from './types-bVztFQTI.js';
|
|
2
2
|
import 'drizzle-orm/node-postgres';
|
|
3
3
|
import './errors.js';
|
|
4
4
|
|
package/dist/db-react.mjs
CHANGED
|
@@ -1,124 +1,96 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as n from 'react';
|
|
2
2
|
|
|
3
3
|
// src/db/react.ts
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
if (typeof
|
|
7
|
-
|
|
8
|
-
return !!
|
|
4
|
+
function f(e) {
|
|
5
|
+
let t = e;
|
|
6
|
+
if (typeof t.syncState < "u") return false;
|
|
7
|
+
let s = t.db;
|
|
8
|
+
return !!s && typeof s.syncState < "u" && typeof s.onSyncStateChanged == "function";
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return
|
|
10
|
+
function i(e) {
|
|
11
|
+
return f(e) ? e.db : e;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
if (!
|
|
13
|
+
function S(e) {
|
|
14
|
+
if (!e) return "";
|
|
15
15
|
try {
|
|
16
|
-
return JSON.stringify(
|
|
16
|
+
return JSON.stringify(e, Object.keys(e).sort());
|
|
17
17
|
} catch {
|
|
18
|
-
return String(
|
|
18
|
+
return String(e);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
21
|
+
function d(e, t) {
|
|
22
|
+
let [s, c] = n.useState({
|
|
23
23
|
data: null,
|
|
24
24
|
loading: true,
|
|
25
25
|
fromCache: true,
|
|
26
26
|
stale: false
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} else {
|
|
44
|
-
setState({
|
|
45
|
-
data: snap.docs[0]?.data ?? null,
|
|
46
|
-
loading: false,
|
|
47
|
-
fromCache: snap.fromCache,
|
|
48
|
-
stale: snap.stale
|
|
49
|
-
});
|
|
50
|
-
}
|
|
27
|
+
}), o = n.useRef(true);
|
|
28
|
+
return n.useEffect(() => {
|
|
29
|
+
o.current = true, c({ data: null, loading: true, fromCache: true, stale: false });
|
|
30
|
+
let a = e.doc(t).onSnapshot(
|
|
31
|
+
(r) => {
|
|
32
|
+
o.current && (r === null || r.docs.length === 0 ? c({
|
|
33
|
+
data: null,
|
|
34
|
+
loading: false,
|
|
35
|
+
fromCache: r?.fromCache ?? true,
|
|
36
|
+
stale: r?.stale ?? false
|
|
37
|
+
}) : c({
|
|
38
|
+
data: r.docs[0]?.data ?? null,
|
|
39
|
+
loading: false,
|
|
40
|
+
fromCache: r.fromCache,
|
|
41
|
+
stale: r.stale
|
|
42
|
+
}));
|
|
51
43
|
}
|
|
52
44
|
);
|
|
53
45
|
return () => {
|
|
54
|
-
|
|
55
|
-
unsubscribe();
|
|
46
|
+
o.current = false, a();
|
|
56
47
|
};
|
|
57
|
-
}, [
|
|
58
|
-
return state;
|
|
48
|
+
}, [e, t]), s;
|
|
59
49
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
50
|
+
function y(e, t) {
|
|
51
|
+
let [s, c] = n.useState({
|
|
62
52
|
docs: [],
|
|
63
53
|
loading: true,
|
|
64
54
|
fromCache: true,
|
|
65
55
|
stale: false,
|
|
66
56
|
hasPendingWrites: false
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const queryRef = React.useRef(query);
|
|
71
|
-
queryRef.current = query;
|
|
72
|
-
React.useEffect(() => {
|
|
73
|
-
mountedRef.current = true;
|
|
74
|
-
setState({
|
|
57
|
+
}), o = n.useRef(true), u = S(t), a = n.useRef(t);
|
|
58
|
+
return a.current = t, n.useEffect(() => {
|
|
59
|
+
o.current = true, c({
|
|
75
60
|
docs: [],
|
|
76
61
|
loading: true,
|
|
77
62
|
fromCache: true,
|
|
78
63
|
stale: false,
|
|
79
64
|
hasPendingWrites: false
|
|
80
65
|
});
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
docs: snap.docs,
|
|
66
|
+
let r = e.onSnapshot(
|
|
67
|
+
a.current,
|
|
68
|
+
(l) => {
|
|
69
|
+
o.current && c({
|
|
70
|
+
docs: l.docs,
|
|
87
71
|
loading: false,
|
|
88
|
-
fromCache:
|
|
89
|
-
stale:
|
|
90
|
-
hasPendingWrites:
|
|
72
|
+
fromCache: l.fromCache,
|
|
73
|
+
stale: l.stale,
|
|
74
|
+
hasPendingWrites: l.hasPendingWrites
|
|
91
75
|
});
|
|
92
76
|
}
|
|
93
77
|
);
|
|
94
78
|
return () => {
|
|
95
|
-
|
|
96
|
-
unsubscribe();
|
|
79
|
+
o.current = false, r();
|
|
97
80
|
};
|
|
98
|
-
}, [
|
|
99
|
-
return state;
|
|
81
|
+
}, [e, u]), s;
|
|
100
82
|
}
|
|
101
|
-
function
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
if (mountedRef.current) {
|
|
108
|
-
setState(source.syncState);
|
|
109
|
-
}
|
|
110
|
-
const unsubscribe = source.onSyncStateChanged((s) => {
|
|
111
|
-
if (!mountedRef.current) return;
|
|
112
|
-
setState(s);
|
|
83
|
+
function b(e) {
|
|
84
|
+
let t = i(e), [s, c] = n.useState(() => t.syncState), o = n.useRef(true);
|
|
85
|
+
return n.useEffect(() => {
|
|
86
|
+
o.current = true, o.current && c(t.syncState);
|
|
87
|
+
let u = t.onSyncStateChanged((a) => {
|
|
88
|
+
o.current && c(a);
|
|
113
89
|
});
|
|
114
90
|
return () => {
|
|
115
|
-
|
|
116
|
-
unsubscribe();
|
|
91
|
+
o.current = false, u();
|
|
117
92
|
};
|
|
118
|
-
}, [
|
|
119
|
-
return state;
|
|
93
|
+
}, [t]), s;
|
|
120
94
|
}
|
|
121
95
|
|
|
122
|
-
export { useCollection, useDocument, useSyncState };
|
|
123
|
-
//# sourceMappingURL=db-react.mjs.map
|
|
124
|
-
//# sourceMappingURL=db-react.mjs.map
|
|
96
|
+
export { y as useCollection, d as useDocument, b as useSyncState };
|