@neetru/sdk 3.3.0 → 3.4.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/ai.d.cts +1 -1
  3. package/dist/ai.d.ts +1 -1
  4. package/dist/auth.cjs +179 -2
  5. package/dist/auth.cjs.map +1 -1
  6. package/dist/auth.d.cts +1 -1
  7. package/dist/auth.d.ts +1 -1
  8. package/dist/auth.mjs +179 -2
  9. package/dist/auth.mjs.map +1 -1
  10. package/dist/catalog.d.cts +1 -1
  11. package/dist/catalog.d.ts +1 -1
  12. package/dist/checkout.d.cts +1 -1
  13. package/dist/checkout.d.ts +1 -1
  14. package/dist/db-react.d.cts +1 -1
  15. package/dist/db-react.d.ts +1 -1
  16. package/dist/db.cjs +17 -0
  17. package/dist/db.cjs.map +1 -1
  18. package/dist/db.d.cts +1 -1
  19. package/dist/db.d.ts +1 -1
  20. package/dist/db.mjs +17 -1
  21. package/dist/db.mjs.map +1 -1
  22. package/dist/entitlements.d.cts +1 -1
  23. package/dist/entitlements.d.ts +1 -1
  24. package/dist/firestore-compat.d.cts +1 -1
  25. package/dist/firestore-compat.d.ts +1 -1
  26. package/dist/index.cjs +180 -3
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +2 -2
  29. package/dist/index.d.ts +2 -2
  30. package/dist/index.mjs +180 -3
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/mocks.cjs +68 -1
  33. package/dist/mocks.cjs.map +1 -1
  34. package/dist/mocks.d.cts +17 -1
  35. package/dist/mocks.d.ts +17 -1
  36. package/dist/mocks.mjs +68 -1
  37. package/dist/mocks.mjs.map +1 -1
  38. package/dist/notifications.d.cts +1 -1
  39. package/dist/notifications.d.ts +1 -1
  40. package/dist/react.d.cts +1 -1
  41. package/dist/react.d.ts +1 -1
  42. package/dist/support.cjs +98 -1
  43. package/dist/support.cjs.map +1 -1
  44. package/dist/support.d.cts +1 -1
  45. package/dist/support.d.ts +1 -1
  46. package/dist/support.mjs +98 -1
  47. package/dist/support.mjs.map +1 -1
  48. package/dist/telemetry.d.cts +1 -1
  49. package/dist/telemetry.d.ts +1 -1
  50. package/dist/{types-DQplLXIk.d.cts → types-BoFSCHF_.d.cts} +117 -2
  51. package/dist/{types-DslphKIM.d.ts → types-DdJyqBy-.d.ts} +117 -2
  52. package/dist/usage.d.cts +1 -1
  53. package/dist/usage.d.ts +1 -1
  54. package/dist/webhooks.d.cts +1 -1
  55. package/dist/webhooks.d.ts +1 -1
  56. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { ag as ResolvedConfig, C as CatalogListOptions, n as CatalogListResponse, a8 as Product } from './types-DQplLXIk.cjs';
1
+ import { ag as ResolvedConfig, C as CatalogListOptions, n as CatalogListResponse, a8 as Product } from './types-BoFSCHF_.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-DslphKIM.js';
1
+ import { ag as ResolvedConfig, C as CatalogListOptions, n as CatalogListResponse, a8 as Product } from './types-DdJyqBy-.js';
2
2
  import 'drizzle-orm/node-postgres';
3
3
  import './errors.js';
4
4
 
@@ -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, aI as createCheckoutNamespace } from './types-DQplLXIk.cjs';
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, aJ as createCheckoutNamespace } from './types-BoFSCHF_.cjs';
2
2
  import 'drizzle-orm/node-postgres';
3
3
  import './errors.cjs';
@@ -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, aI as createCheckoutNamespace } from './types-DslphKIM.js';
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, aJ as createCheckoutNamespace } from './types-DdJyqBy-.js';
2
2
  import 'drizzle-orm/node-postgres';
3
3
  import './errors.js';
@@ -1,4 +1,4 @@
1
- import { ap as SyncState, au as Unsubscribe, F as DbDoc, W as NeetruClient, E as DbCollectionRef, K as DbQuery } from './types-DQplLXIk.cjs';
1
+ import { ap as SyncState, au as Unsubscribe, F as DbDoc, W as NeetruClient, E as DbCollectionRef, K as DbQuery } from './types-BoFSCHF_.cjs';
2
2
  import 'drizzle-orm/node-postgres';
3
3
  import './errors.cjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { ap as SyncState, au as Unsubscribe, F as DbDoc, W as NeetruClient, E as DbCollectionRef, K as DbQuery } from './types-DslphKIM.js';
1
+ import { ap as SyncState, au as Unsubscribe, F as DbDoc, W as NeetruClient, E as DbCollectionRef, K as DbQuery } from './types-DdJyqBy-.js';
2
2
  import 'drizzle-orm/node-postgres';
3
3
  import './errors.js';
4
4
 
package/dist/db.cjs CHANGED
@@ -4401,7 +4401,23 @@ function buildTicketProvider(config, opts) {
4401
4401
  function getWebSocketRealtimeClient(gatewayUrl, ticketProvider, dbId, wsFactory) {
4402
4402
  return new NeetruRealtimeClient({ gatewayUrl, ticketProvider, dbId, webSocketFactory: wsFactory });
4403
4403
  }
4404
+ var _hasWarnedMissingDbId = false;
4405
+ function __resetDbIdWarningForTests() {
4406
+ _hasWarnedMissingDbId = false;
4407
+ }
4408
+ function warnMissingDbIdOnce(config, dbOpts) {
4409
+ if (_hasWarnedMissingDbId) return;
4410
+ if (dbOpts.dbId) return;
4411
+ if (config.env === "prod") return;
4412
+ if (typeof window === "undefined") return;
4413
+ if (typeof console === "undefined" || typeof console.warn !== "function") return;
4414
+ _hasWarnedMissingDbId = true;
4415
+ console.warn(
4416
+ "[neetru/sdk] client.db sem `dbId` expl\xEDcito: escritas client-side (add/set/update/remove/list) caem no datastore gen\xE9rico do Core, escopado por tenant/produto (header x-neetru-tenant) \u2014 `dbId` s\xF3 nomeia o cache offline LOCAL (IndexedDB), n\xE3o roteia nem escopa nada no servidor. Veja o JSDoc de NeetruDbOptions.dbId."
4417
+ );
4418
+ }
4404
4419
  function createNeetruDb(config, dbOpts = {}) {
4420
+ warnMissingDbIdOnce(config, dbOpts);
4405
4421
  let resolvedTransport;
4406
4422
  if (dbOpts.transport !== void 0) {
4407
4423
  resolvedTransport = dbOpts.transport;
@@ -4577,6 +4593,7 @@ function createLazyCollectionRef(name, getDocsPromise) {
4577
4593
  }
4578
4594
 
4579
4595
  exports.NEETRU_SENTINEL_KEY = NEETRU_SENTINEL_KEY;
4596
+ exports.__resetDbIdWarningForTests = __resetDbIdWarningForTests;
4580
4597
  exports.createNeetruDb = createNeetruDb;
4581
4598
  exports.createRestSyncTransport = createRestSyncTransport;
4582
4599
  exports.getWebSocketRealtimeClient = getWebSocketRealtimeClient;