@bpinternal/const 0.3.8 → 0.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.
@@ -0,0 +1,134 @@
1
+ export declare const billingAddonsDefs: {
2
+ readonly bot_addon: {
3
+ readonly id: "bot_addon";
4
+ readonly name: "Add-on - Bot";
5
+ readonly description: "Add one more bot to your workspace";
6
+ readonly prices: [{
7
+ readonly price: 10;
8
+ readonly currency: "usd";
9
+ readonly interval: "month";
10
+ }];
11
+ readonly feature: "bot_count";
12
+ readonly increment: 1;
13
+ };
14
+ readonly collaborator_addon: {
15
+ readonly id: "collaborator_addon";
16
+ readonly name: "Add-on - Collaborators";
17
+ readonly description: "Add one more collaborator to your workspace";
18
+ readonly prices: [{
19
+ readonly price: 25;
20
+ readonly currency: "usd";
21
+ readonly interval: "month";
22
+ }];
23
+ readonly feature: "collaborator_count";
24
+ readonly increment: 1;
25
+ };
26
+ readonly always_alive_addon: {
27
+ readonly id: "always_alive_addon";
28
+ readonly name: "Add-on - Always Alive";
29
+ readonly description: "Keep one more bot always alive";
30
+ readonly prices: [{
31
+ readonly price: 10;
32
+ readonly currency: "usd";
33
+ readonly interval: "month";
34
+ }];
35
+ readonly feature: "always_alive_count";
36
+ readonly increment: 1;
37
+ };
38
+ readonly messages_events_addon: {
39
+ readonly id: "messages_events_addon";
40
+ readonly name: "Add-on - Messages & Events";
41
+ readonly description: "Adds 5,000 messages and events";
42
+ readonly prices: [{
43
+ readonly price: 20;
44
+ readonly currency: "usd";
45
+ readonly interval: "month";
46
+ }];
47
+ readonly feature: "incoming_messages_events";
48
+ readonly increment: 5000;
49
+ };
50
+ readonly table_rows_addon: {
51
+ readonly id: "table_rows_addon";
52
+ readonly name: "Add-on - Table Rows";
53
+ readonly description: "Adds 100,000 additional table rows";
54
+ readonly prices: [{
55
+ readonly price: 25;
56
+ readonly currency: "usd";
57
+ readonly interval: "month";
58
+ }];
59
+ readonly feature: "table_rows";
60
+ readonly increment: 100000;
61
+ };
62
+ readonly file_storage_addon: {
63
+ readonly id: "file_storage_addon";
64
+ readonly name: "Add-on - File Storage";
65
+ readonly description: "Adds 10GB of File Storage";
66
+ readonly prices: [{
67
+ readonly price: 10;
68
+ readonly currency: "usd";
69
+ readonly interval: "month";
70
+ }];
71
+ readonly feature: "file_storage";
72
+ readonly increment: 10000000000;
73
+ };
74
+ readonly vector_db_storage_addon: {
75
+ readonly id: "vector_db_storage_addon";
76
+ readonly name: "Add-on - Vector DB Storage";
77
+ readonly description: "Add 1 GB of vector database storage";
78
+ readonly prices: [{
79
+ readonly price: 20;
80
+ readonly currency: "usd";
81
+ readonly interval: "month";
82
+ }];
83
+ readonly feature: "vector_db_storage";
84
+ readonly increment: 1000000000;
85
+ };
86
+ readonly web_search_addon: {
87
+ readonly id: "web_search_addon";
88
+ readonly name: "Web Search and Crawl";
89
+ readonly description: "Web search and crawl functionality";
90
+ readonly prices: [{
91
+ readonly price: 0.01;
92
+ readonly currency: "usd";
93
+ readonly interval: "month";
94
+ }];
95
+ readonly feature: "integration_spend";
96
+ readonly increment: 10000000000;
97
+ };
98
+ readonly ai_credits_addon: {
99
+ readonly id: "ai_credits_addon";
100
+ readonly name: "AI Tokens";
101
+ readonly description: "Add $25 worth of AI credits";
102
+ readonly prices: [{
103
+ readonly price: 0.01;
104
+ readonly currency: "usd";
105
+ readonly interval: "month";
106
+ }];
107
+ readonly feature: "integration_spend";
108
+ readonly increment: 25000000000;
109
+ };
110
+ readonly enterprise_ai_token: {
111
+ readonly id: "enterprise_ai_token";
112
+ readonly name: "Enterprise - AI Token";
113
+ readonly description: "Enterprise AI token credits";
114
+ readonly prices: [{
115
+ readonly price: -1;
116
+ readonly currency: "usd";
117
+ readonly interval: "month";
118
+ }];
119
+ readonly feature: "integration_spend";
120
+ readonly increment: 100000000000;
121
+ };
122
+ readonly enterprise_additional_workspace: {
123
+ readonly id: "enterprise_additional_workspace";
124
+ readonly name: "Enterprise - Additional Workspace";
125
+ readonly description: "Enterprise additional workspace";
126
+ readonly prices: [{
127
+ readonly price: -1;
128
+ readonly currency: "usd";
129
+ readonly interval: "month";
130
+ }];
131
+ readonly feature: "collaborator_count";
132
+ readonly increment: 10;
133
+ };
134
+ };
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.billingAddonsDefs = void 0;
4
+ const billing_plans_1 = require("./billing-plans");
5
+ /* IMPORTANT: the `name` field is used to match existing products in Stripe DO NOT CHANGE THE NAME OF AN EXISTING PRODUCT */
6
+ exports.billingAddonsDefs = {
7
+ bot_addon: {
8
+ id: 'bot_addon',
9
+ name: 'Add-on - Bot',
10
+ description: 'Add one more bot to your workspace',
11
+ prices: [
12
+ {
13
+ price: 10,
14
+ currency: 'usd',
15
+ interval: 'month',
16
+ },
17
+ ],
18
+ feature: 'bot_count',
19
+ increment: 1,
20
+ },
21
+ collaborator_addon: {
22
+ id: 'collaborator_addon',
23
+ name: 'Add-on - Collaborators',
24
+ description: 'Add one more collaborator to your workspace',
25
+ prices: [
26
+ {
27
+ price: 25,
28
+ currency: 'usd',
29
+ interval: 'month',
30
+ },
31
+ ],
32
+ feature: 'collaborator_count',
33
+ increment: 1,
34
+ },
35
+ always_alive_addon: {
36
+ id: 'always_alive_addon',
37
+ name: 'Add-on - Always Alive',
38
+ description: 'Keep one more bot always alive',
39
+ prices: [
40
+ {
41
+ price: 10,
42
+ currency: 'usd',
43
+ interval: 'month',
44
+ },
45
+ ],
46
+ feature: 'always_alive_count',
47
+ increment: 1,
48
+ },
49
+ messages_events_addon: {
50
+ id: 'messages_events_addon',
51
+ name: 'Add-on - Messages & Events',
52
+ description: 'Adds 5,000 messages and events',
53
+ prices: [
54
+ {
55
+ price: 20,
56
+ currency: 'usd',
57
+ interval: 'month',
58
+ },
59
+ ],
60
+ feature: 'incoming_messages_events',
61
+ increment: 5000,
62
+ },
63
+ table_rows_addon: {
64
+ id: 'table_rows_addon',
65
+ name: 'Add-on - Table Rows',
66
+ description: 'Adds 100,000 additional table rows',
67
+ prices: [
68
+ {
69
+ price: 25,
70
+ currency: 'usd',
71
+ interval: 'month',
72
+ },
73
+ ],
74
+ feature: 'table_rows',
75
+ increment: 100000,
76
+ },
77
+ file_storage_addon: {
78
+ id: 'file_storage_addon',
79
+ name: 'Add-on - File Storage',
80
+ description: 'Adds 10GB of File Storage',
81
+ prices: [
82
+ {
83
+ price: 10,
84
+ currency: 'usd',
85
+ interval: 'month',
86
+ },
87
+ ],
88
+ feature: 'file_storage',
89
+ increment: 10_000_000_000, // 10 GB
90
+ },
91
+ vector_db_storage_addon: {
92
+ id: 'vector_db_storage_addon',
93
+ name: 'Add-on - Vector DB Storage',
94
+ description: 'Add 1 GB of vector database storage',
95
+ prices: [
96
+ {
97
+ price: 20,
98
+ currency: 'usd',
99
+ interval: 'month',
100
+ },
101
+ ],
102
+ feature: 'vector_db_storage',
103
+ increment: 1_000_000_000, // 1 GB
104
+ },
105
+ web_search_addon: {
106
+ id: 'web_search_addon',
107
+ name: 'Web Search and Crawl',
108
+ description: 'Web search and crawl functionality',
109
+ prices: [
110
+ {
111
+ price: 0.01,
112
+ currency: 'usd',
113
+ interval: 'month',
114
+ },
115
+ ],
116
+ feature: 'integration_spend',
117
+ increment: 10_000_000_000, // $10 in nano-dollars
118
+ },
119
+ ai_credits_addon: {
120
+ id: 'ai_credits_addon',
121
+ name: 'AI Tokens',
122
+ description: 'Add $25 worth of AI credits',
123
+ prices: [
124
+ {
125
+ price: 0.01,
126
+ currency: 'usd',
127
+ interval: 'month',
128
+ },
129
+ ],
130
+ feature: 'integration_spend',
131
+ increment: 25_000_000_000, // $25 in nano-dollars
132
+ },
133
+ enterprise_ai_token: {
134
+ id: 'enterprise_ai_token',
135
+ name: 'Enterprise - AI Token',
136
+ description: 'Enterprise AI token credits',
137
+ prices: [
138
+ {
139
+ price: billing_plans_1.FREE_PRICE, // Custom pricing
140
+ currency: 'usd',
141
+ interval: 'month',
142
+ },
143
+ ],
144
+ feature: 'integration_spend',
145
+ increment: 100_000_000_000, // $100 in nano-dollars
146
+ },
147
+ enterprise_additional_workspace: {
148
+ id: 'enterprise_additional_workspace',
149
+ name: 'Enterprise - Additional Workspace',
150
+ description: 'Enterprise additional workspace',
151
+ prices: [
152
+ {
153
+ price: billing_plans_1.FREE_PRICE, // Custom pricing
154
+ currency: 'usd',
155
+ interval: 'month',
156
+ },
157
+ ],
158
+ feature: 'collaborator_count',
159
+ increment: 10,
160
+ },
161
+ };
@@ -2,16 +2,8 @@
2
2
  * Billing features for v4 billing system
3
3
  * Based on the requirements from the billing refactor document
4
4
  */
5
- export declare const billingFeatures: readonly ["human_in_the_loop", "ratelimit", "incoming_messages_events", "integration_spend", "integration_subscription", "table_rows", "bot_count", "always_alive_count", "always_alive_concurrency", "collaborator_count", "file_storage", "vector_db_storage", "saved_versions"];
6
- export type BillingFeature = (typeof billingFeatures)[number];
7
- export type BillingFeatureConfig = {
8
- name: string;
9
- description: string;
10
- type: 'boolean' | 'static' | 'usage' | 'subscription';
11
- resetPeriod?: 'monthly' | 'yearly' | 'never';
12
- dimensions?: Record<string, string>;
13
- };
14
- export declare const billingFeatureConfigs: {
5
+ export declare const BILLING_FEATURE_IDS: readonly ["human_in_the_loop", "ratelimit", "incoming_messages_events", "integration_spend", "integration_subscription", "table_rows", "bot_count", "always_alive_count", "always_alive_concurrency", "collaborator_count", "file_storage", "vector_db_storage", "saved_versions"];
6
+ export declare const billingFeatureDefs: {
15
7
  readonly human_in_the_loop: {
16
8
  readonly name: "Human in the Loop";
17
9
  readonly description: "Ability to enable human intervention in bot conversations";
@@ -4,8 +4,8 @@
4
4
  * Based on the requirements from the billing refactor document
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.billingFeatureConfigs = exports.billingFeatures = void 0;
8
- exports.billingFeatures = [
7
+ exports.billingFeatureDefs = exports.BILLING_FEATURE_IDS = void 0;
8
+ exports.BILLING_FEATURE_IDS = [
9
9
  'human_in_the_loop',
10
10
  'ratelimit',
11
11
  'incoming_messages_events',
@@ -20,7 +20,7 @@ exports.billingFeatures = [
20
20
  'vector_db_storage',
21
21
  'saved_versions',
22
22
  ];
23
- exports.billingFeatureConfigs = {
23
+ exports.billingFeatureDefs = {
24
24
  human_in_the_loop: {
25
25
  name: 'Human in the Loop',
26
26
  description: 'Ability to enable human intervention in bot conversations',
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Special price value indicating a free product/plan.
3
+ * This will be converted to $0 during deployment.
4
+ */
5
+ export declare const FREE_PRICE = -1;
6
+ export declare const ALLOWED_TRIAL_LENGTHS_IN_DAYS = 7;
7
+ export declare const ALLOWED_TRIAL_PLANS: readonly ["plus"];
8
+ export declare const BILLING_PLAN_IDS: readonly ["community", "plus", "team", "enterprise"];
9
+ export declare const BILLING_ADDON_IDS: readonly ["bot_addon", "collaborator_addon", "always_alive_addon", "messages_events_addon", "table_rows_addon", "file_storage_addon", "vector_db_storage_addon", "web_search_addon", "ai_credits_addon", "enterprise_ai_token", "enterprise_additional_workspace"];
10
+ export declare const billingPlansDefs: {
11
+ readonly community: {
12
+ readonly id: "community";
13
+ readonly name: "Plan - Pay as you go";
14
+ readonly description: "Free plan for developers";
15
+ readonly prices: [{
16
+ readonly price: -1;
17
+ readonly currency: "usd";
18
+ readonly interval: "month";
19
+ }];
20
+ readonly features: {
21
+ readonly human_in_the_loop: false;
22
+ readonly ratelimit: 100;
23
+ readonly incoming_messages_events: 500;
24
+ readonly integration_spend: 5000000000;
25
+ readonly integration_subscription: false;
26
+ readonly table_rows: 1000;
27
+ readonly bot_count: 1;
28
+ readonly always_alive_count: 0;
29
+ readonly always_alive_concurrency: 1;
30
+ readonly collaborator_count: 1;
31
+ readonly file_storage: 100000000;
32
+ readonly vector_db_storage: 100000000;
33
+ readonly saved_versions: 3;
34
+ };
35
+ };
36
+ readonly plus: {
37
+ readonly id: "plus";
38
+ readonly name: "Plan - Plus";
39
+ readonly description: "For growing businesses";
40
+ readonly prices: [{
41
+ readonly price: 89;
42
+ readonly currency: "usd";
43
+ readonly interval: "month";
44
+ }, {
45
+ readonly price: 948;
46
+ readonly currency: "usd";
47
+ readonly interval: "year";
48
+ }];
49
+ readonly features: {
50
+ readonly human_in_the_loop: true;
51
+ readonly ratelimit: 100;
52
+ readonly incoming_messages_events: 5000;
53
+ readonly integration_spend: 5000000000;
54
+ readonly integration_subscription: true;
55
+ readonly table_rows: 100000;
56
+ readonly bot_count: 2;
57
+ readonly always_alive_count: 1;
58
+ readonly always_alive_concurrency: 1;
59
+ readonly collaborator_count: 2;
60
+ readonly file_storage: 10000000000;
61
+ readonly vector_db_storage: 1000000000;
62
+ readonly saved_versions: 50;
63
+ };
64
+ };
65
+ readonly team: {
66
+ readonly id: "team";
67
+ readonly name: "Plan - Team";
68
+ readonly description: "For small teams";
69
+ readonly prices: [{
70
+ readonly price: 495;
71
+ readonly currency: "usd";
72
+ readonly interval: "month";
73
+ }, {
74
+ readonly price: 5346;
75
+ readonly currency: "usd";
76
+ readonly interval: "year";
77
+ }];
78
+ readonly features: {
79
+ readonly human_in_the_loop: true;
80
+ readonly ratelimit: 1000;
81
+ readonly incoming_messages_events: 50000;
82
+ readonly integration_spend: 5000000000;
83
+ readonly integration_subscription: true;
84
+ readonly table_rows: 100000;
85
+ readonly bot_count: 3;
86
+ readonly always_alive_count: 3;
87
+ readonly always_alive_concurrency: 3;
88
+ readonly collaborator_count: 3;
89
+ readonly file_storage: 10000000000;
90
+ readonly vector_db_storage: 2000000000;
91
+ readonly saved_versions: 100;
92
+ };
93
+ };
94
+ readonly enterprise: {
95
+ readonly id: "enterprise";
96
+ readonly name: "Plan - Enterprise";
97
+ readonly description: "Enterprise license subscription";
98
+ readonly prices: [{
99
+ readonly price: -1;
100
+ readonly currency: "usd";
101
+ readonly interval: "month";
102
+ }];
103
+ readonly features: {
104
+ readonly human_in_the_loop: true;
105
+ readonly ratelimit: 10000;
106
+ readonly incoming_messages_events: 1000000;
107
+ readonly integration_spend: 5000000000;
108
+ readonly integration_subscription: true;
109
+ readonly table_rows: 10000000;
110
+ readonly bot_count: 100;
111
+ readonly always_alive_count: 50;
112
+ readonly always_alive_concurrency: 3;
113
+ readonly collaborator_count: 100;
114
+ readonly file_storage: 1000000000000;
115
+ readonly vector_db_storage: 500000000000;
116
+ readonly saved_versions: 1000;
117
+ };
118
+ };
119
+ };
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.billingPlansDefs = exports.BILLING_ADDON_IDS = exports.BILLING_PLAN_IDS = exports.ALLOWED_TRIAL_PLANS = exports.ALLOWED_TRIAL_LENGTHS_IN_DAYS = exports.FREE_PRICE = void 0;
4
+ /**
5
+ * Special price value indicating a free product/plan.
6
+ * This will be converted to $0 during deployment.
7
+ */
8
+ exports.FREE_PRICE = -1;
9
+ exports.ALLOWED_TRIAL_LENGTHS_IN_DAYS = 7;
10
+ exports.ALLOWED_TRIAL_PLANS = ['plus'];
11
+ // keep this in order of lowest to highest tier
12
+ exports.BILLING_PLAN_IDS = ['community', 'plus', 'team', 'enterprise'];
13
+ exports.BILLING_ADDON_IDS = [
14
+ 'bot_addon',
15
+ 'collaborator_addon',
16
+ 'always_alive_addon',
17
+ 'messages_events_addon',
18
+ 'table_rows_addon',
19
+ 'file_storage_addon',
20
+ 'vector_db_storage_addon',
21
+ 'web_search_addon',
22
+ 'ai_credits_addon',
23
+ 'enterprise_ai_token',
24
+ 'enterprise_additional_workspace',
25
+ ];
26
+ /* IMPORTANT: the `name` field is used to match existing products in Stripe DO NOT CHANGE THE NAME OF AN EXISTING PRODUCT */
27
+ exports.billingPlansDefs = {
28
+ community: {
29
+ id: 'community',
30
+ name: 'Plan - Pay as you go',
31
+ description: 'Free plan for developers',
32
+ prices: [
33
+ {
34
+ price: exports.FREE_PRICE,
35
+ currency: 'usd',
36
+ interval: 'month',
37
+ },
38
+ ],
39
+ features: {
40
+ human_in_the_loop: false,
41
+ ratelimit: 100,
42
+ incoming_messages_events: 500,
43
+ integration_spend: 5_000_000_000, // $5 in nano-dollars
44
+ integration_subscription: false,
45
+ table_rows: 1000,
46
+ bot_count: 1,
47
+ always_alive_count: 0,
48
+ always_alive_concurrency: 1,
49
+ collaborator_count: 1,
50
+ file_storage: 100_000_000, // 100 MB
51
+ vector_db_storage: 100_000_000, // 100 MB
52
+ saved_versions: 3,
53
+ },
54
+ },
55
+ plus: {
56
+ id: 'plus',
57
+ name: 'Plan - Plus',
58
+ description: 'For growing businesses',
59
+ prices: [
60
+ {
61
+ price: 89,
62
+ currency: 'usd',
63
+ interval: 'month',
64
+ },
65
+ {
66
+ price: 948,
67
+ currency: 'usd',
68
+ interval: 'year',
69
+ },
70
+ ],
71
+ features: {
72
+ human_in_the_loop: true,
73
+ ratelimit: 100,
74
+ incoming_messages_events: 5000,
75
+ integration_spend: 5_000_000_000, // $5 in nano-dollars
76
+ integration_subscription: true,
77
+ table_rows: 100000,
78
+ bot_count: 2,
79
+ always_alive_count: 1,
80
+ always_alive_concurrency: 1,
81
+ collaborator_count: 2,
82
+ file_storage: 10_000_000_000, // 10 GB
83
+ vector_db_storage: 1_000_000_000, // 1 GB
84
+ saved_versions: 50,
85
+ },
86
+ },
87
+ team: {
88
+ id: 'team',
89
+ name: 'Plan - Team',
90
+ description: 'For small teams',
91
+ prices: [
92
+ {
93
+ price: 495,
94
+ currency: 'usd',
95
+ interval: 'month',
96
+ },
97
+ {
98
+ price: 5346,
99
+ currency: 'usd',
100
+ interval: 'year',
101
+ },
102
+ ],
103
+ features: {
104
+ human_in_the_loop: true,
105
+ ratelimit: 1000,
106
+ incoming_messages_events: 50000,
107
+ integration_spend: 5_000_000_000, // $5 in nano-dollars
108
+ integration_subscription: true,
109
+ table_rows: 100000,
110
+ bot_count: 3,
111
+ always_alive_count: 3,
112
+ always_alive_concurrency: 3,
113
+ collaborator_count: 3,
114
+ file_storage: 10_000_000_000, // 10 GB
115
+ vector_db_storage: 2_000_000_000, // 2 GB
116
+ saved_versions: 100,
117
+ },
118
+ },
119
+ enterprise: {
120
+ id: 'enterprise',
121
+ name: 'Plan - Enterprise',
122
+ description: 'Enterprise license subscription',
123
+ prices: [
124
+ {
125
+ price: exports.FREE_PRICE, // Custom pricing
126
+ currency: 'usd',
127
+ interval: 'month',
128
+ },
129
+ ],
130
+ features: {
131
+ human_in_the_loop: true,
132
+ ratelimit: 10000,
133
+ incoming_messages_events: 1000000,
134
+ integration_spend: 5_000_000_000, // $5 in nano-dollars
135
+ integration_subscription: true,
136
+ table_rows: 10000000,
137
+ bot_count: 100,
138
+ always_alive_count: 50,
139
+ always_alive_concurrency: 3,
140
+ collaborator_count: 100,
141
+ file_storage: 1000_000_000_000, // 1000 GB
142
+ vector_db_storage: 500_000_000_000, // 500 GB
143
+ saved_versions: 1000,
144
+ },
145
+ },
146
+ };
@@ -2,38 +2,9 @@
2
2
  * Billing versions for v4 billing system
3
3
  * Each version represents a complete billing configuration
4
4
  */
5
- import { billingPlans, billingAddons, Interval } from './billing-products';
5
+ import { BillingDefinition, BillingVersionDefinition, BillingVersionId } from './types';
6
6
  export declare const BILLING_VERSIONS: readonly ["v4"];
7
- export type BillingVersionId = (typeof BILLING_VERSIONS)[number];
8
- export type BillingVersion = {
9
- version: BillingVersionId;
10
- name: string;
11
- description: string;
12
- plans: typeof billingPlans;
13
- addons: typeof billingAddons;
14
- isActive: boolean;
15
- createdAt: string;
16
- stripeMapping?: StripeMapping;
17
- };
18
- export type PlanId = string;
19
- export type AddonId = string;
20
- export type StripeMapping = Record<BillingVersionId | string, {
21
- plans: Record<PlanId, {
22
- name: string;
23
- description: string;
24
- productId: string;
25
- prices: Record<Interval | string, string>;
26
- }>;
27
- addons: Record<AddonId, {
28
- name: string;
29
- description: string;
30
- productId: string;
31
- prices: Record<Interval | string, string>;
32
- }>;
33
- }>;
34
- export declare const billingVersionV4: BillingVersion;
35
- export declare const billingVersions: {
36
- [key in BillingVersionId]: BillingVersion;
37
- };
38
- export declare const getActiveBillingVersion: () => BillingVersion;
39
- export declare const getBillingVersion: (version: BillingVersionId) => BillingVersion;
7
+ export declare const billingV4Definition: BillingVersionDefinition;
8
+ export declare const billingDefinitions: BillingDefinition;
9
+ export declare const getActiveBillingVersion: () => BillingVersionDefinition;
10
+ export declare const getBillingVersion: (version: BillingVersionId) => BillingVersionDefinition;
@@ -4,24 +4,25 @@
4
4
  * Each version represents a complete billing configuration
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.getBillingVersion = exports.getActiveBillingVersion = exports.billingVersions = exports.billingVersionV4 = exports.BILLING_VERSIONS = void 0;
8
- const billing_products_1 = require("./billing-products");
7
+ exports.getBillingVersion = exports.getActiveBillingVersion = exports.billingDefinitions = exports.billingV4Definition = exports.BILLING_VERSIONS = void 0;
8
+ const billing_plans_1 = require("./billing-plans");
9
+ const billing_addons_1 = require("./billing-addons");
9
10
  exports.BILLING_VERSIONS = ['v4'];
10
- exports.billingVersionV4 = {
11
+ exports.billingV4Definition = {
11
12
  version: 'v4',
12
13
  name: 'Billing Version 4',
13
14
  description: 'New billing system with credit grants and entitlements',
14
- plans: billing_products_1.billingPlans,
15
- addons: billing_products_1.billingAddons,
15
+ plans: billing_plans_1.billingPlansDefs,
16
+ addons: billing_addons_1.billingAddonsDefs,
16
17
  isActive: false, // Will be set to true when migration is complete
17
18
  createdAt: new Date().toISOString(),
18
19
  // stripeMapping will be populated by Pulumi
19
20
  };
20
- exports.billingVersions = {
21
- v4: exports.billingVersionV4,
21
+ exports.billingDefinitions = {
22
+ v4: exports.billingV4Definition,
22
23
  };
23
24
  const getActiveBillingVersion = () => {
24
- const activeVersion = Object.values(exports.billingVersions).find((v) => v.isActive);
25
+ const activeVersion = Object.values(exports.billingDefinitions).find((v) => v.isActive);
25
26
  if (!activeVersion) {
26
27
  throw new Error('No active billing version found');
27
28
  }
@@ -29,6 +30,6 @@ const getActiveBillingVersion = () => {
29
30
  };
30
31
  exports.getActiveBillingVersion = getActiveBillingVersion;
31
32
  const getBillingVersion = (version) => {
32
- return exports.billingVersions[version];
33
+ return exports.billingDefinitions[version];
33
34
  };
34
35
  exports.getBillingVersion = getBillingVersion;