@drawbridge/drawbridge-utils 0.0.103 → 0.0.104
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/ai.cjs +4 -0
- package/dist/ai.js +4 -0
- package/dist/billing.cjs +16 -0
- package/dist/billing.d.cts +7 -1
- package/dist/billing.d.ts +7 -1
- package/dist/billing.js +10 -0
- package/dist/features.cjs +5 -0
- package/dist/features.d.cts +5 -0
- package/dist/features.d.ts +5 -0
- package/dist/features.js +5 -0
- package/dist/plans.cjs +40 -8
- package/dist/plans.d.cts +58 -8
- package/dist/plans.d.ts +58 -8
- package/dist/plans.js +38 -7
- package/dist/pricing.cjs +807 -0
- package/dist/pricing.d.cts +72 -0
- package/dist/pricing.d.ts +72 -0
- package/dist/pricing.js +757 -0
- package/package.json +6 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export { conversionRate, free, plans, resolvePlan, unitAmountDecimal } from './plans.cjs';
|
|
2
|
+
export { LOCAL_FLAT_CENTS, MARKUP, PREMIUM_CPM_CENTS, PREMIUM_RATE_PER_GB, REUSE_FLAT_CENTS, STANDARD_CPM_CENTS, STANDARD_RATE_PER_GB, ai, scrape } from './billing.cjs';
|
|
3
|
+
import './features.cjs';
|
|
4
|
+
import './index.cjs';
|
|
5
|
+
import 'currency-codes';
|
|
6
|
+
import 'nanoid';
|
|
7
|
+
import './color.cjs';
|
|
8
|
+
import 'tinycolor2';
|
|
9
|
+
import './usage.cjs';
|
|
10
|
+
import './transactions.cjs';
|
|
11
|
+
import '@drawbridge/drawbridge-telemetry';
|
|
12
|
+
|
|
13
|
+
// Pricing — the one file you open to see every customer-facing number.
|
|
14
|
+
//
|
|
15
|
+
// Nothing is DEFINED here except the channel weights: the values still live
|
|
16
|
+
// where their accounting lives, and this file re-exports them so a rate can be
|
|
17
|
+
// found without knowing which module owns it. It is also the seam if we ever
|
|
18
|
+
// migrate the values for real.
|
|
19
|
+
//
|
|
20
|
+
// Every number below carries its UNIT in the map, because the unit is exactly
|
|
21
|
+
// what got lost: `overages.actions` was '2.5' and read as $2.50 by everyone who
|
|
22
|
+
// met it — twice, once in production (2026-05-31, every paid tier billed 10x).
|
|
23
|
+
//
|
|
24
|
+
// ─── Plan overages (lib/plans.js) ─────────────────────────────────────────────
|
|
25
|
+
// actionCents CENTS per action, number. 2.5 = $0.025.
|
|
26
|
+
// Starter 2.5 · Pro 2 · Premium 1.85 · Elite 1.5.
|
|
27
|
+
// Free has none — it is hard-capped at 200 actions.
|
|
28
|
+
// overages.actions DEPRECATED alias of actionCents, as a string. Kept for
|
|
29
|
+
// one release so consumers pin-bump in any order.
|
|
30
|
+
// unitAmountDecimal() cents → Stripe `unit_amount_decimal` (a cents string).
|
|
31
|
+
// plans[ id ].conversion PERCENT of order value taken as the conversion fee.
|
|
32
|
+
// limits.* counts, except storage which is BYTES.
|
|
33
|
+
//
|
|
34
|
+
// ─── Channel weights (owned here) ─────────────────────────────────────────────
|
|
35
|
+
// channels.email.actionsPerSend ACTIONS per email send.
|
|
36
|
+
// channels.sms.actionsPerSegment ACTIONS per SMS segment.
|
|
37
|
+
// channels.*.includedInAllowance whether the plan's included actions cover it.
|
|
38
|
+
//
|
|
39
|
+
// ─── Scrape + AI (lib/billing.js) ─────────────────────────────────────────────
|
|
40
|
+
// MARKUP MULTIPLIER on provider cost (1.3 = 30% margin).
|
|
41
|
+
// STANDARD_RATE_PER_GB DOLLARS per GB, BrightData Scraping Browser.
|
|
42
|
+
// PREMIUM_RATE_PER_GB DOLLARS per GB, premium hosts.
|
|
43
|
+
// STANDARD_CPM_CENTS CENTS per request, BrightData Web Unlocker.
|
|
44
|
+
// PREMIUM_CPM_CENTS CENTS per request, premium hosts.
|
|
45
|
+
// LOCAL_FLAT_CENTS CENTS per cold local render.
|
|
46
|
+
// REUSE_FLAT_CENTS CENTS per cache reuse.
|
|
47
|
+
// ai.rates CENTS per 1,000,000 tokens, wholesale + retail, per
|
|
48
|
+
// model; ai.rates.tools is CENTS per request.
|
|
49
|
+
//
|
|
50
|
+
// lib/ai.js is NOT re-exported here on purpose: its `models` registry names WHICH
|
|
51
|
+
// model we call, not what it costs (the rate table lives in billing.js), and
|
|
52
|
+
// importing it would pull @google/genai and construct a client into every
|
|
53
|
+
// consumer of this file.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
// Weighted actions: what one message of each channel costs against a plan.
|
|
57
|
+
// Named per unit so a bare `2` can never be read as cents.
|
|
58
|
+
const channels = {
|
|
59
|
+
email : {
|
|
60
|
+
actionsPerSend : 1,
|
|
61
|
+
includedInAllowance : true
|
|
62
|
+
},
|
|
63
|
+
sms : {
|
|
64
|
+
// Two actions PER SEGMENT (a long message is several segments), billed from
|
|
65
|
+
// the FIRST segment and never drawn from the plan's included allowance —
|
|
66
|
+
// carrier cost is real from message one, so there is no free tier of it.
|
|
67
|
+
actionsPerSegment : 2,
|
|
68
|
+
includedInAllowance : false
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export { channels };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export { conversionRate, free, plans, resolvePlan, unitAmountDecimal } from './plans.js';
|
|
2
|
+
export { LOCAL_FLAT_CENTS, MARKUP, PREMIUM_CPM_CENTS, PREMIUM_RATE_PER_GB, REUSE_FLAT_CENTS, STANDARD_CPM_CENTS, STANDARD_RATE_PER_GB, ai, scrape } from './billing.js';
|
|
3
|
+
import './features.js';
|
|
4
|
+
import './index.js';
|
|
5
|
+
import 'currency-codes';
|
|
6
|
+
import 'nanoid';
|
|
7
|
+
import './color.js';
|
|
8
|
+
import 'tinycolor2';
|
|
9
|
+
import './usage.js';
|
|
10
|
+
import './transactions.js';
|
|
11
|
+
import '@drawbridge/drawbridge-telemetry';
|
|
12
|
+
|
|
13
|
+
// Pricing — the one file you open to see every customer-facing number.
|
|
14
|
+
//
|
|
15
|
+
// Nothing is DEFINED here except the channel weights: the values still live
|
|
16
|
+
// where their accounting lives, and this file re-exports them so a rate can be
|
|
17
|
+
// found without knowing which module owns it. It is also the seam if we ever
|
|
18
|
+
// migrate the values for real.
|
|
19
|
+
//
|
|
20
|
+
// Every number below carries its UNIT in the map, because the unit is exactly
|
|
21
|
+
// what got lost: `overages.actions` was '2.5' and read as $2.50 by everyone who
|
|
22
|
+
// met it — twice, once in production (2026-05-31, every paid tier billed 10x).
|
|
23
|
+
//
|
|
24
|
+
// ─── Plan overages (lib/plans.js) ─────────────────────────────────────────────
|
|
25
|
+
// actionCents CENTS per action, number. 2.5 = $0.025.
|
|
26
|
+
// Starter 2.5 · Pro 2 · Premium 1.85 · Elite 1.5.
|
|
27
|
+
// Free has none — it is hard-capped at 200 actions.
|
|
28
|
+
// overages.actions DEPRECATED alias of actionCents, as a string. Kept for
|
|
29
|
+
// one release so consumers pin-bump in any order.
|
|
30
|
+
// unitAmountDecimal() cents → Stripe `unit_amount_decimal` (a cents string).
|
|
31
|
+
// plans[ id ].conversion PERCENT of order value taken as the conversion fee.
|
|
32
|
+
// limits.* counts, except storage which is BYTES.
|
|
33
|
+
//
|
|
34
|
+
// ─── Channel weights (owned here) ─────────────────────────────────────────────
|
|
35
|
+
// channels.email.actionsPerSend ACTIONS per email send.
|
|
36
|
+
// channels.sms.actionsPerSegment ACTIONS per SMS segment.
|
|
37
|
+
// channels.*.includedInAllowance whether the plan's included actions cover it.
|
|
38
|
+
//
|
|
39
|
+
// ─── Scrape + AI (lib/billing.js) ─────────────────────────────────────────────
|
|
40
|
+
// MARKUP MULTIPLIER on provider cost (1.3 = 30% margin).
|
|
41
|
+
// STANDARD_RATE_PER_GB DOLLARS per GB, BrightData Scraping Browser.
|
|
42
|
+
// PREMIUM_RATE_PER_GB DOLLARS per GB, premium hosts.
|
|
43
|
+
// STANDARD_CPM_CENTS CENTS per request, BrightData Web Unlocker.
|
|
44
|
+
// PREMIUM_CPM_CENTS CENTS per request, premium hosts.
|
|
45
|
+
// LOCAL_FLAT_CENTS CENTS per cold local render.
|
|
46
|
+
// REUSE_FLAT_CENTS CENTS per cache reuse.
|
|
47
|
+
// ai.rates CENTS per 1,000,000 tokens, wholesale + retail, per
|
|
48
|
+
// model; ai.rates.tools is CENTS per request.
|
|
49
|
+
//
|
|
50
|
+
// lib/ai.js is NOT re-exported here on purpose: its `models` registry names WHICH
|
|
51
|
+
// model we call, not what it costs (the rate table lives in billing.js), and
|
|
52
|
+
// importing it would pull @google/genai and construct a client into every
|
|
53
|
+
// consumer of this file.
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
// Weighted actions: what one message of each channel costs against a plan.
|
|
57
|
+
// Named per unit so a bare `2` can never be read as cents.
|
|
58
|
+
const channels = {
|
|
59
|
+
email : {
|
|
60
|
+
actionsPerSend : 1,
|
|
61
|
+
includedInAllowance : true
|
|
62
|
+
},
|
|
63
|
+
sms : {
|
|
64
|
+
// Two actions PER SEGMENT (a long message is several segments), billed from
|
|
65
|
+
// the FIRST segment and never drawn from the plan's included allowance —
|
|
66
|
+
// carrier cost is real from message one, so there is no free tier of it.
|
|
67
|
+
actionsPerSegment : 2,
|
|
68
|
+
includedInAllowance : false
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export { channels };
|