@neetru/sdk 3.4.7 → 3.6.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 +45 -0
- package/dist/ai.cjs +17 -13
- package/dist/ai.cjs.map +1 -1
- package/dist/ai.d.cts +1 -1
- package/dist/ai.d.ts +1 -1
- package/dist/ai.mjs +17 -13
- package/dist/ai.mjs.map +1 -1
- package/dist/auth.cjs +159 -107
- 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 +159 -107
- package/dist/auth.mjs.map +1 -1
- package/dist/catalog.cjs +19 -4
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.mjs +19 -4
- package/dist/catalog.mjs.map +1 -1
- package/dist/checkout.cjs +11 -3
- package/dist/checkout.cjs.map +1 -1
- package/dist/checkout.d.cts +1 -1
- package/dist/checkout.d.ts +1 -1
- package/dist/checkout.mjs +11 -3
- package/dist/checkout.mjs.map +1 -1
- package/dist/db-react.d.cts +1 -1
- package/dist/db-react.d.ts +1 -1
- package/dist/db.cjs +17 -7
- package/dist/db.cjs.map +1 -1
- package/dist/db.d.cts +1 -1
- package/dist/db.d.ts +1 -1
- package/dist/db.mjs +17 -7
- package/dist/db.mjs.map +1 -1
- package/dist/entitlements.d.cts +1 -1
- package/dist/entitlements.d.ts +1 -1
- package/dist/firestore-compat.d.cts +1 -1
- package/dist/firestore-compat.d.ts +1 -1
- package/dist/index.cjs +160 -108
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -2
- package/dist/index.d.ts +30 -2
- package/dist/index.mjs +160 -108
- package/dist/index.mjs.map +1 -1
- package/dist/mobile.cjs +515 -0
- package/dist/mobile.cjs.map +1 -0
- package/dist/mobile.d.cts +89 -0
- package/dist/mobile.d.ts +89 -0
- package/dist/mobile.mjs +513 -0
- package/dist/mobile.mjs.map +1 -0
- package/dist/mocks.cjs +17 -0
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.d.cts +5 -1
- package/dist/mocks.d.ts +5 -1
- package/dist/mocks.mjs +17 -0
- package/dist/mocks.mjs.map +1 -1
- package/dist/notifications.cjs +11 -3
- package/dist/notifications.cjs.map +1 -1
- package/dist/notifications.d.cts +1 -1
- package/dist/notifications.d.ts +1 -1
- package/dist/notifications.mjs +11 -3
- package/dist/notifications.mjs.map +1 -1
- package/dist/react.cjs +36 -2
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.mjs +36 -2
- package/dist/react.mjs.map +1 -1
- package/dist/support.cjs +15 -4
- package/dist/support.cjs.map +1 -1
- package/dist/support.d.cts +1 -1
- package/dist/support.d.ts +1 -1
- package/dist/support.mjs +15 -4
- package/dist/support.mjs.map +1 -1
- package/dist/telemetry.cjs +11 -3
- package/dist/telemetry.cjs.map +1 -1
- package/dist/telemetry.d.cts +1 -1
- package/dist/telemetry.d.ts +1 -1
- package/dist/telemetry.mjs +11 -3
- package/dist/telemetry.mjs.map +1 -1
- package/dist/{types-nnztVk7G.d.ts → types-BPATkXYu.d.ts} +35 -7
- package/dist/{types-DIVZl7nO.d.cts → types-Du_iioJ7.d.cts} +35 -7
- package/dist/usage.cjs +11 -3
- package/dist/usage.cjs.map +1 -1
- package/dist/usage.d.cts +1 -1
- package/dist/usage.d.ts +1 -1
- package/dist/usage.mjs +11 -3
- package/dist/usage.mjs.map +1 -1
- package/dist/webhooks.cjs +17 -4
- package/dist/webhooks.cjs.map +1 -1
- package/dist/webhooks.d.cts +1 -1
- package/dist/webhooks.d.ts +1 -1
- package/dist/webhooks.mjs +17 -4
- package/dist/webhooks.mjs.map +1 -1
- package/package.json +9 -1
package/dist/db.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { w as ConflictRecord, x as CreateOfflineDocumentsOptions, z as DbBatchOp, B as DbChangeType, E as DbCollectionRef, F as DbDoc, G as DbDocRef, H as DbGetResult, I as DbListResult, K as DbQuery, L as DbSqlLease, N as DbWhereFilter, P as FieldSentinel, Q as IncrementSentinel, V as NEETRU_SENTINEL_KEY, Y as NeetruDb, Z as NeetruDbDocuments, _ as NeetruDbEngine, $ as NeetruDbError, a0 as NeetruDbErrorCode, a1 as NeetruDbOptions, a2 as NeetruDbTransport, a4 as NeetruSqlClient, ad as RealtimeTransport, ai as ServerTimestampSentinel, ak as SqlOptions, ap as SyncErrorEvent, aq as SyncState, aH as WithFieldSentinels, aI as __resetDbIdWarningForTests, aL as createNeetruDb, aN as createRestSyncTransport, aP as getWebSocketRealtimeClient, aQ as increment, aR as isFieldSentinel, aS as isIncrementSentinel, aT as isServerTimestampSentinel, aU as serverTimestamp } from './types-
|
|
1
|
+
export { w as ConflictRecord, x as CreateOfflineDocumentsOptions, z as DbBatchOp, B as DbChangeType, E as DbCollectionRef, F as DbDoc, G as DbDocRef, H as DbGetResult, I as DbListResult, K as DbQuery, L as DbSqlLease, N as DbWhereFilter, P as FieldSentinel, Q as IncrementSentinel, V as NEETRU_SENTINEL_KEY, Y as NeetruDb, Z as NeetruDbDocuments, _ as NeetruDbEngine, $ as NeetruDbError, a0 as NeetruDbErrorCode, a1 as NeetruDbOptions, a2 as NeetruDbTransport, a4 as NeetruSqlClient, ad as RealtimeTransport, ai as ServerTimestampSentinel, ak as SqlOptions, ap as SyncErrorEvent, aq as SyncState, aH as WithFieldSentinels, aI as __resetDbIdWarningForTests, aL as createNeetruDb, aN as createRestSyncTransport, aP as getWebSocketRealtimeClient, aQ as increment, aR as isFieldSentinel, aS as isIncrementSentinel, aT as isServerTimestampSentinel, aU as serverTimestamp } from './types-Du_iioJ7.cjs';
|
|
2
2
|
import 'drizzle-orm/node-postgres';
|
|
3
3
|
import './errors.cjs';
|
package/dist/db.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { w as ConflictRecord, x as CreateOfflineDocumentsOptions, z as DbBatchOp, B as DbChangeType, E as DbCollectionRef, F as DbDoc, G as DbDocRef, H as DbGetResult, I as DbListResult, K as DbQuery, L as DbSqlLease, N as DbWhereFilter, P as FieldSentinel, Q as IncrementSentinel, V as NEETRU_SENTINEL_KEY, Y as NeetruDb, Z as NeetruDbDocuments, _ as NeetruDbEngine, $ as NeetruDbError, a0 as NeetruDbErrorCode, a1 as NeetruDbOptions, a2 as NeetruDbTransport, a4 as NeetruSqlClient, ad as RealtimeTransport, ai as ServerTimestampSentinel, ak as SqlOptions, ap as SyncErrorEvent, aq as SyncState, aH as WithFieldSentinels, aI as __resetDbIdWarningForTests, aL as createNeetruDb, aN as createRestSyncTransport, aP as getWebSocketRealtimeClient, aQ as increment, aR as isFieldSentinel, aS as isIncrementSentinel, aT as isServerTimestampSentinel, aU as serverTimestamp } from './types-
|
|
1
|
+
export { w as ConflictRecord, x as CreateOfflineDocumentsOptions, z as DbBatchOp, B as DbChangeType, E as DbCollectionRef, F as DbDoc, G as DbDocRef, H as DbGetResult, I as DbListResult, K as DbQuery, L as DbSqlLease, N as DbWhereFilter, P as FieldSentinel, Q as IncrementSentinel, V as NEETRU_SENTINEL_KEY, Y as NeetruDb, Z as NeetruDbDocuments, _ as NeetruDbEngine, $ as NeetruDbError, a0 as NeetruDbErrorCode, a1 as NeetruDbOptions, a2 as NeetruDbTransport, a4 as NeetruSqlClient, ad as RealtimeTransport, ai as ServerTimestampSentinel, ak as SqlOptions, ap as SyncErrorEvent, aq as SyncState, aH as WithFieldSentinels, aI as __resetDbIdWarningForTests, aL as createNeetruDb, aN as createRestSyncTransport, aP as getWebSocketRealtimeClient, aQ as increment, aR as isFieldSentinel, aS as isIncrementSentinel, aT as isServerTimestampSentinel, aU as serverTimestamp } from './types-BPATkXYu.js';
|
|
2
2
|
import 'drizzle-orm/node-postgres';
|
|
3
3
|
import './errors.js';
|
package/dist/db.mjs
CHANGED
|
@@ -96,7 +96,8 @@ var init_idempotency = __esm({
|
|
|
96
96
|
var http_exports = {};
|
|
97
97
|
__export(http_exports, {
|
|
98
98
|
checkCoreVersionCompat: () => checkCoreVersionCompat,
|
|
99
|
-
httpRequest: () => httpRequest
|
|
99
|
+
httpRequest: () => httpRequest,
|
|
100
|
+
statusToCode: () => statusToCode
|
|
100
101
|
});
|
|
101
102
|
function stripRevision(v) {
|
|
102
103
|
return v.split("+")[0] ?? v;
|
|
@@ -112,12 +113,16 @@ function compareCalVer(a, b) {
|
|
|
112
113
|
}
|
|
113
114
|
return 0;
|
|
114
115
|
}
|
|
115
|
-
function
|
|
116
|
+
function readInjectedSdkVersion() {
|
|
116
117
|
try {
|
|
117
|
-
|
|
118
|
-
if (ver) return parseInt(ver.split(".")[0] ?? "3", 10);
|
|
118
|
+
return "3.6.0";
|
|
119
119
|
} catch {
|
|
120
|
+
return void 0;
|
|
120
121
|
}
|
|
122
|
+
}
|
|
123
|
+
function getSdkMajor() {
|
|
124
|
+
const ver = readInjectedSdkVersion();
|
|
125
|
+
if (ver) return parseInt(ver.split(".")[0] ?? "3", 10);
|
|
121
126
|
return 3;
|
|
122
127
|
}
|
|
123
128
|
function checkCoreVersionCompat(coreVersion) {
|
|
@@ -195,6 +200,10 @@ async function httpRequest(config, opts) {
|
|
|
195
200
|
accept: "application/json",
|
|
196
201
|
...opts.headers
|
|
197
202
|
};
|
|
203
|
+
const sdkVersion = readInjectedSdkVersion();
|
|
204
|
+
if (sdkVersion) {
|
|
205
|
+
headers["x-neetru-sdk-version"] = sdkVersion;
|
|
206
|
+
}
|
|
198
207
|
if (opts.requireAuth) {
|
|
199
208
|
if (!config.apiKey) {
|
|
200
209
|
throw new NeetruError(
|
|
@@ -524,7 +533,7 @@ var init_lease = __esm({
|
|
|
524
533
|
void this._doRenew();
|
|
525
534
|
}, MIN_RENEWAL_DELAY_MS);
|
|
526
535
|
console.warn(
|
|
527
|
-
`[SqlLeaseManager] renova\xE7\xE3o E emiss\xE3o de lease novo falharam; re-tentando em ${MIN_RENEWAL_DELAY_MS}ms (cert
|
|
536
|
+
`[SqlLeaseManager] renova\xE7\xE3o E emiss\xE3o de lease novo falharam; re-tentando em ${MIN_RENEWAL_DELAY_MS}ms (cert TLS ef\xEAmero do servidor expira ~15min ap\xF3s o \xFAltimo swap):`,
|
|
528
537
|
err instanceof Error ? err.message : err
|
|
529
538
|
);
|
|
530
539
|
return;
|
|
@@ -535,8 +544,9 @@ var init_lease = __esm({
|
|
|
535
544
|
/**
|
|
536
545
|
* Recuperação REATIVA: chamado pelo wrapper resiliente (`resilient-pool.ts`)
|
|
537
546
|
* quando uma query plana falha num erro de ESTABELECIMENTO de conexão (cert
|
|
538
|
-
*
|
|
539
|
-
* disparou). Emite um lease NOVO e faz o swap do pool interno
|
|
547
|
+
* TLS efêmero do servidor expirado no meio de uma request, ou timer de
|
|
548
|
+
* renovação que não disparou). Emite um lease NOVO e faz o swap do pool interno
|
|
549
|
+
* do wrapper com
|
|
540
550
|
* o certificado fresco; o wrapper então re-tenta a query 1x no pool novo.
|
|
541
551
|
*
|
|
542
552
|
* Vai DIRETO ao lease novo (sem `leaseId`) — a conexão falhou porque o
|