@neetru/sdk 3.4.4 → 3.4.5
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 +19 -0
- package/dist/ai.d.cts +1 -1
- package/dist/ai.d.ts +1 -1
- package/dist/auth.cjs +16 -4
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/auth.mjs +16 -4
- package/dist/auth.mjs.map +1 -1
- package/dist/catalog.d.cts +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/checkout.d.cts +1 -1
- package/dist/checkout.d.ts +1 -1
- package/dist/db-react.d.cts +1 -1
- package/dist/db-react.d.ts +1 -1
- package/dist/db.d.cts +1 -1
- package/dist/db.d.ts +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 +17 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +17 -5
- package/dist/index.mjs.map +1 -1
- package/dist/mocks.d.cts +1 -1
- package/dist/mocks.d.ts +1 -1
- package/dist/notifications.d.cts +1 -1
- package/dist/notifications.d.ts +1 -1
- 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.map +1 -1
- package/dist/support.d.cts +1 -1
- package/dist/support.d.ts +1 -1
- package/dist/telemetry.cjs +16 -4
- 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 +16 -4
- package/dist/telemetry.mjs.map +1 -1
- package/dist/{types-Dw0fqhHm.d.cts → types-DIVZl7nO.d.cts} +3 -0
- package/dist/{types-Bzxb5rlF.d.ts → types-nnztVk7G.d.ts} +3 -0
- package/dist/usage.d.cts +1 -1
- package/dist/usage.d.ts +1 -1
- package/dist/webhooks.d.cts +1 -1
- package/dist/webhooks.d.ts +1 -1
- package/package.json +1 -1
package/dist/catalog.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ag as ResolvedConfig, C as CatalogListOptions, n as CatalogListResponse, a8 as Product } from './types-
|
|
1
|
+
import { ag as ResolvedConfig, C as CatalogListOptions, n as CatalogListResponse, a8 as Product } from './types-DIVZl7nO.cjs';
|
|
2
2
|
import 'drizzle-orm/node-postgres';
|
|
3
3
|
import './errors.cjs';
|
|
4
4
|
|
package/dist/catalog.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ag as ResolvedConfig, C as CatalogListOptions, n as CatalogListResponse, a8 as Product } from './types-
|
|
1
|
+
import { ag as ResolvedConfig, C as CatalogListOptions, n as CatalogListResponse, a8 as Product } from './types-nnztVk7G.js';
|
|
2
2
|
import 'drizzle-orm/node-postgres';
|
|
3
3
|
import './errors.js';
|
|
4
4
|
|
package/dist/checkout.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { o as CheckoutAuthOpts, p as CheckoutIntentInfo, q as CheckoutIntentStatus, r as CheckoutNamespace, s as CheckoutStartInput, t as CheckoutStartResult, u as CheckoutTenantType, S as MockCheckout, aK as createCheckoutNamespace } from './types-
|
|
1
|
+
export { o as CheckoutAuthOpts, p as CheckoutIntentInfo, q as CheckoutIntentStatus, r as CheckoutNamespace, s as CheckoutStartInput, t as CheckoutStartResult, u as CheckoutTenantType, S as MockCheckout, aK as createCheckoutNamespace } from './types-DIVZl7nO.cjs';
|
|
2
2
|
import 'drizzle-orm/node-postgres';
|
|
3
3
|
import './errors.cjs';
|
package/dist/checkout.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { o as CheckoutAuthOpts, p as CheckoutIntentInfo, q as CheckoutIntentStatus, r as CheckoutNamespace, s as CheckoutStartInput, t as CheckoutStartResult, u as CheckoutTenantType, S as MockCheckout, aK as createCheckoutNamespace } from './types-
|
|
1
|
+
export { o as CheckoutAuthOpts, p as CheckoutIntentInfo, q as CheckoutIntentStatus, r as CheckoutNamespace, s as CheckoutStartInput, t as CheckoutStartResult, u as CheckoutTenantType, S as MockCheckout, aK as createCheckoutNamespace } from './types-nnztVk7G.js';
|
|
2
2
|
import 'drizzle-orm/node-postgres';
|
|
3
3
|
import './errors.js';
|
package/dist/db-react.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aq as SyncState, av as Unsubscribe, F as DbDoc, W as NeetruClient, E as DbCollectionRef, K as DbQuery } from './types-
|
|
1
|
+
import { aq as SyncState, av as Unsubscribe, F as DbDoc, W as NeetruClient, E as DbCollectionRef, K as DbQuery } from './types-DIVZl7nO.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 { aq as SyncState, av as Unsubscribe, F as DbDoc, W as NeetruClient, E as DbCollectionRef, K as DbQuery } from './types-
|
|
1
|
+
import { aq as SyncState, av as Unsubscribe, F as DbDoc, W as NeetruClient, E as DbCollectionRef, K as DbQuery } from './types-nnztVk7G.js';
|
|
2
2
|
import 'drizzle-orm/node-postgres';
|
|
3
3
|
import './errors.js';
|
|
4
4
|
|
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-DIVZl7nO.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-nnztVk7G.js';
|
|
2
2
|
import 'drizzle-orm/node-postgres';
|
|
3
3
|
import './errors.js';
|
package/dist/entitlements.d.cts
CHANGED
package/dist/entitlements.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Y as NeetruDb, E as DbCollectionRef, P as FieldSentinel, K as DbQuery } from './types-
|
|
1
|
+
import { Y as NeetruDb, E as DbCollectionRef, P as FieldSentinel, K as DbQuery } from './types-DIVZl7nO.cjs';
|
|
2
2
|
import 'drizzle-orm/node-postgres';
|
|
3
3
|
import './errors.cjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Y as NeetruDb, E as DbCollectionRef, P as FieldSentinel, K as DbQuery } from './types-
|
|
1
|
+
import { Y as NeetruDb, E as DbCollectionRef, P as FieldSentinel, K as DbQuery } from './types-nnztVk7G.js';
|
|
2
2
|
import 'drizzle-orm/node-postgres';
|
|
3
3
|
import './errors.js';
|
|
4
4
|
|
package/dist/index.cjs
CHANGED
|
@@ -1273,6 +1273,12 @@ function createEntitlementsNamespace(config) {
|
|
|
1273
1273
|
init_errors();
|
|
1274
1274
|
init_http();
|
|
1275
1275
|
var VALID_LOG_LEVELS = ["debug", "info", "warn", "error", "fatal"];
|
|
1276
|
+
function isBrowserContext() {
|
|
1277
|
+
return typeof globalThis !== "undefined" && typeof globalThis.window !== "undefined";
|
|
1278
|
+
}
|
|
1279
|
+
function resolveEventTransport() {
|
|
1280
|
+
return isBrowserContext() ? { path: "/api/sdk/v1/telemetry/event/public", requireAuth: false } : { path: "/api/sdk/v1/telemetry/event", requireAuth: true };
|
|
1281
|
+
}
|
|
1276
1282
|
function consoleFor(level) {
|
|
1277
1283
|
switch (level) {
|
|
1278
1284
|
case "debug":
|
|
@@ -1302,15 +1308,18 @@ function createTelemetryNamespace(config) {
|
|
|
1302
1308
|
batch.map(async (ev) => {
|
|
1303
1309
|
try {
|
|
1304
1310
|
const body = { name: ev.name };
|
|
1311
|
+
const productSlug = ev.productSlug ?? config.productId;
|
|
1312
|
+
if (productSlug) body.productSlug = productSlug;
|
|
1305
1313
|
if (ev.properties && typeof ev.properties === "object") {
|
|
1306
1314
|
body.properties = ev.properties;
|
|
1307
1315
|
}
|
|
1308
1316
|
if (ev.timestamp) body.timestamp = ev.timestamp;
|
|
1317
|
+
const transport = resolveEventTransport();
|
|
1309
1318
|
await httpRequest(config, {
|
|
1310
1319
|
method: "POST",
|
|
1311
|
-
path:
|
|
1320
|
+
path: transport.path,
|
|
1312
1321
|
body,
|
|
1313
|
-
requireAuth:
|
|
1322
|
+
requireAuth: transport.requireAuth,
|
|
1314
1323
|
retries: 1,
|
|
1315
1324
|
// caça-bruxas: retry sem Idempotency-Key duplicava o evento se o
|
|
1316
1325
|
// servidor já tinha persistido antes da falha transiente. Mesmo
|
|
@@ -1363,15 +1372,18 @@ function createTelemetryNamespace(config) {
|
|
|
1363
1372
|
throw new exports.NeetruError("validation_failed", "event.name max 128 chars");
|
|
1364
1373
|
}
|
|
1365
1374
|
const body = { name: input.name };
|
|
1375
|
+
const productSlug = input.productSlug ?? config.productId;
|
|
1376
|
+
if (productSlug) body.productSlug = productSlug;
|
|
1366
1377
|
if (input.properties && typeof input.properties === "object") {
|
|
1367
1378
|
body.properties = input.properties;
|
|
1368
1379
|
}
|
|
1369
1380
|
if (input.timestamp) body.timestamp = input.timestamp;
|
|
1381
|
+
const transport = resolveEventTransport();
|
|
1370
1382
|
const raw = await httpRequest(config, {
|
|
1371
1383
|
method: "POST",
|
|
1372
|
-
path:
|
|
1384
|
+
path: transport.path,
|
|
1373
1385
|
body,
|
|
1374
|
-
requireAuth:
|
|
1386
|
+
requireAuth: transport.requireAuth
|
|
1375
1387
|
});
|
|
1376
1388
|
if (!raw || raw.ok !== true || typeof raw.eventId !== "string") {
|
|
1377
1389
|
throw new exports.NeetruError("invalid_response", "Telemetry response missing eventId");
|
|
@@ -8043,7 +8055,7 @@ function createNeetruClient(config = {}) {
|
|
|
8043
8055
|
init_errors();
|
|
8044
8056
|
init_db_errors();
|
|
8045
8057
|
init_http();
|
|
8046
|
-
var VERSION = "3.4.
|
|
8058
|
+
var VERSION = "3.4.5";
|
|
8047
8059
|
|
|
8048
8060
|
exports.DEFAULT_BASE_URL = DEFAULT_BASE_URL;
|
|
8049
8061
|
exports.DEV_FIXTURE_USER = DEV_FIXTURE_USER;
|