vesant-sdk 1.7.0-dev.3f9ec86 → 1.7.0-dev.4c91be9

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/index.mjs CHANGED
@@ -753,29 +753,6 @@ async function collectAll(fetchPage) {
753
753
  return items;
754
754
  }
755
755
 
756
- // src/core/dedup.ts
757
- var InMemoryDedupStore = class {
758
- constructor(opts = {}) {
759
- this.expiryById = /* @__PURE__ */ new Map();
760
- this.maxEntries = opts.maxEntries ?? 1e3;
761
- this.now = opts.now ?? (() => Date.now());
762
- }
763
- async seen(id) {
764
- return this.expiryById.has(id);
765
- }
766
- async mark(id, ttlMs) {
767
- const now = this.now();
768
- this.expiryById.set(id, now + ttlMs);
769
- if (this.expiryById.size > this.maxEntries) {
770
- for (const [key, expiresAt] of this.expiryById) {
771
- if (now > expiresAt) {
772
- this.expiryById.delete(key);
773
- }
774
- }
775
- }
776
- }
777
- };
778
-
779
756
  // src/core/webhook-utils.ts
780
757
  async function verifyWebhookSignature(payload, signature, secret, opts = {}) {
781
758
  const signed = parseSignedTimestamp(signature);
@@ -3663,6 +3640,29 @@ var TaxClient = class extends BaseClient {
3663
3640
  }
3664
3641
  };
3665
3642
 
3643
+ // src/webhooks/dedup.ts
3644
+ var InMemoryDedupStore = class {
3645
+ constructor(opts = {}) {
3646
+ this.expiryById = /* @__PURE__ */ new Map();
3647
+ this.maxEntries = opts.maxEntries ?? 1e3;
3648
+ this.now = opts.now ?? (() => Date.now());
3649
+ }
3650
+ async seen(id) {
3651
+ return this.expiryById.has(id);
3652
+ }
3653
+ async mark(id, ttlMs) {
3654
+ const now = this.now();
3655
+ this.expiryById.set(id, now + ttlMs);
3656
+ if (this.expiryById.size > this.maxEntries) {
3657
+ for (const [key, expiresAt] of this.expiryById) {
3658
+ if (now > expiresAt) {
3659
+ this.expiryById.delete(key);
3660
+ }
3661
+ }
3662
+ }
3663
+ }
3664
+ };
3665
+
3666
3666
  // src/webhooks/handler.ts
3667
3667
  function resolveEventId(event) {
3668
3668
  if (event.id) {