@drawbridge/drawbridge-utils 0.0.104 → 0.0.105

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/pricing.cjs CHANGED
@@ -43,6 +43,7 @@ __export(pricing_exports, {
43
43
  plans: () => plans,
44
44
  resolvePlan: () => resolvePlan,
45
45
  scrape: () => scrape,
46
+ sending: () => sending,
46
47
  unitAmountDecimal: () => unitAmountDecimal
47
48
  });
48
49
  module.exports = __toCommonJS(pricing_exports);
@@ -774,6 +775,17 @@ var scrape = {
774
775
  };
775
776
 
776
777
  // lib/pricing.js
778
+ var sending = {
779
+ email: {
780
+ // Fraction of monthlyCeiling that raises the alarm. Far enough ahead of
781
+ // the wall to act on, high enough not to fire on ordinary growth.
782
+ alertThreshold: 0.8,
783
+ // SendGrid Essentials 50K — emails per calendar month, PLATFORM-WIDE and
784
+ // across every send path: lead-facing mail, workflow steps, and the sign-in
785
+ // codes and account mail that no plan allowance meters.
786
+ monthlyCeiling: 5e4
787
+ }
788
+ };
777
789
  var channels = {
778
790
  email: {
779
791
  actionsPerSend: 1,
@@ -803,5 +815,6 @@ var channels = {
803
815
  plans,
804
816
  resolvePlan,
805
817
  scrape,
818
+ sending,
806
819
  unitAmountDecimal
807
820
  });
@@ -36,6 +36,11 @@ import '@drawbridge/drawbridge-telemetry';
36
36
  // channels.sms.actionsPerSegment ACTIONS per SMS segment.
37
37
  // channels.*.includedInAllowance whether the plan's included actions cover it.
38
38
  //
39
+ // ─── Provider capacity (owned here) ───────────────────────────────────────────
40
+ // sending.email.monthlyCeiling EMAILS per calendar month we have BOUGHT,
41
+ // platform-wide across every send path.
42
+ // sending.email.alertThreshold FRACTION of that ceiling which alarms.
43
+ //
39
44
  // ─── Scrape + AI (lib/billing.js) ─────────────────────────────────────────────
40
45
  // MARKUP MULTIPLIER on provider cost (1.3 = 30% margin).
41
46
  // STANDARD_RATE_PER_GB DOLLARS per GB, BrightData Scraping Browser.
@@ -53,6 +58,40 @@ import '@drawbridge/drawbridge-telemetry';
53
58
  // consumer of this file.
54
59
 
55
60
 
61
+ // What we have BOUGHT from the sending providers, against what the plans above
62
+ // SELL. Here rather than in an env because it is a rate like every other number
63
+ // in this file, and the whole point of this file is that you do not have to
64
+ // know which environment to look in to find one. Changing it is a publish and a
65
+ // pin bump, which is the right friction for a number that changes when a
66
+ // contract changes.
67
+ //
68
+ // READ THIS BEFORE RAISING A PLAN ALLOWANCE. The ceiling is PLATFORM-WIDE while
69
+ // every allowance above is PER ORGANIZATION, and an allowance can be spent
70
+ // entirely on email — so the two are denominated against very different things:
71
+ //
72
+ // Elite 100,000 = 200% of the whole platform's email ceiling
73
+ // Premium 40,000 = 80%
74
+ // Pro 15,000 = 30%
75
+ // Starter 5,000 = 10%
76
+ //
77
+ // As of 2026-08-30 we sell about 2x the email we buy. That is fine while real
78
+ // usage sits far below the allowances, and it is not a margin problem — at this
79
+ // ceiling an email costs a fraction of a cent, far under the 1.5-2.5c overage.
80
+ // It is a CAPACITY problem: running out does not cost a few dollars, it stops
81
+ // every merchant's mail at once. Raising a tier's allowance moves this number
82
+ // too, or the ceiling quietly becomes the real limit.
83
+ const sending = {
84
+ email : {
85
+ // Fraction of monthlyCeiling that raises the alarm. Far enough ahead of
86
+ // the wall to act on, high enough not to fire on ordinary growth.
87
+ alertThreshold : 0.8,
88
+ // SendGrid Essentials 50K — emails per calendar month, PLATFORM-WIDE and
89
+ // across every send path: lead-facing mail, workflow steps, and the sign-in
90
+ // codes and account mail that no plan allowance meters.
91
+ monthlyCeiling : 50000
92
+ }
93
+ };
94
+
56
95
  // Weighted actions: what one message of each channel costs against a plan.
57
96
  // Named per unit so a bare `2` can never be read as cents.
58
97
  const channels = {
@@ -69,4 +108,4 @@ const channels = {
69
108
  }
70
109
  };
71
110
 
72
- export { channels };
111
+ export { channels, sending };
package/dist/pricing.d.ts CHANGED
@@ -36,6 +36,11 @@ import '@drawbridge/drawbridge-telemetry';
36
36
  // channels.sms.actionsPerSegment ACTIONS per SMS segment.
37
37
  // channels.*.includedInAllowance whether the plan's included actions cover it.
38
38
  //
39
+ // ─── Provider capacity (owned here) ───────────────────────────────────────────
40
+ // sending.email.monthlyCeiling EMAILS per calendar month we have BOUGHT,
41
+ // platform-wide across every send path.
42
+ // sending.email.alertThreshold FRACTION of that ceiling which alarms.
43
+ //
39
44
  // ─── Scrape + AI (lib/billing.js) ─────────────────────────────────────────────
40
45
  // MARKUP MULTIPLIER on provider cost (1.3 = 30% margin).
41
46
  // STANDARD_RATE_PER_GB DOLLARS per GB, BrightData Scraping Browser.
@@ -53,6 +58,40 @@ import '@drawbridge/drawbridge-telemetry';
53
58
  // consumer of this file.
54
59
 
55
60
 
61
+ // What we have BOUGHT from the sending providers, against what the plans above
62
+ // SELL. Here rather than in an env because it is a rate like every other number
63
+ // in this file, and the whole point of this file is that you do not have to
64
+ // know which environment to look in to find one. Changing it is a publish and a
65
+ // pin bump, which is the right friction for a number that changes when a
66
+ // contract changes.
67
+ //
68
+ // READ THIS BEFORE RAISING A PLAN ALLOWANCE. The ceiling is PLATFORM-WIDE while
69
+ // every allowance above is PER ORGANIZATION, and an allowance can be spent
70
+ // entirely on email — so the two are denominated against very different things:
71
+ //
72
+ // Elite 100,000 = 200% of the whole platform's email ceiling
73
+ // Premium 40,000 = 80%
74
+ // Pro 15,000 = 30%
75
+ // Starter 5,000 = 10%
76
+ //
77
+ // As of 2026-08-30 we sell about 2x the email we buy. That is fine while real
78
+ // usage sits far below the allowances, and it is not a margin problem — at this
79
+ // ceiling an email costs a fraction of a cent, far under the 1.5-2.5c overage.
80
+ // It is a CAPACITY problem: running out does not cost a few dollars, it stops
81
+ // every merchant's mail at once. Raising a tier's allowance moves this number
82
+ // too, or the ceiling quietly becomes the real limit.
83
+ const sending = {
84
+ email : {
85
+ // Fraction of monthlyCeiling that raises the alarm. Far enough ahead of
86
+ // the wall to act on, high enough not to fire on ordinary growth.
87
+ alertThreshold : 0.8,
88
+ // SendGrid Essentials 50K — emails per calendar month, PLATFORM-WIDE and
89
+ // across every send path: lead-facing mail, workflow steps, and the sign-in
90
+ // codes and account mail that no plan allowance meters.
91
+ monthlyCeiling : 50000
92
+ }
93
+ };
94
+
56
95
  // Weighted actions: what one message of each channel costs against a plan.
57
96
  // Named per unit so a bare `2` can never be read as cents.
58
97
  const channels = {
@@ -69,4 +108,4 @@ const channels = {
69
108
  }
70
109
  };
71
110
 
72
- export { channels };
111
+ export { channels, sending };
package/dist/pricing.js CHANGED
@@ -725,6 +725,17 @@ var scrape = {
725
725
  };
726
726
 
727
727
  // lib/pricing.js
728
+ var sending = {
729
+ email: {
730
+ // Fraction of monthlyCeiling that raises the alarm. Far enough ahead of
731
+ // the wall to act on, high enough not to fire on ordinary growth.
732
+ alertThreshold: 0.8,
733
+ // SendGrid Essentials 50K — emails per calendar month, PLATFORM-WIDE and
734
+ // across every send path: lead-facing mail, workflow steps, and the sign-in
735
+ // codes and account mail that no plan allowance meters.
736
+ monthlyCeiling: 5e4
737
+ }
738
+ };
728
739
  var channels = {
729
740
  email: {
730
741
  actionsPerSend: 1,
@@ -753,5 +764,6 @@ export {
753
764
  plans,
754
765
  resolvePlan,
755
766
  scrape,
767
+ sending,
756
768
  unitAmountDecimal
757
769
  };
package/package.json CHANGED
@@ -190,5 +190,5 @@
190
190
  "test": ". \"$HOME/.nvm/nvm.sh\" && nvm use && node --test"
191
191
  },
192
192
  "types": "dist/index.d.ts",
193
- "version": "0.0.104"
193
+ "version": "0.0.105"
194
194
  }