@bpinternal/const 0.11.0 → 0.13.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 (38) hide show
  1. package/dist/billing-legacy/consts.d.ts +9 -0
  2. package/dist/billing-legacy/consts.js +53 -0
  3. package/dist/billing-legacy/index.d.ts +2 -0
  4. package/dist/billing-legacy/index.js +18 -0
  5. package/dist/billing-next/config/addons.d.ts +181 -0
  6. package/dist/{billing-addons.js → billing-next/config/addons.js} +70 -47
  7. package/dist/billing-next/config/index.d.ts +5 -0
  8. package/dist/billing-next/config/index.js +18 -0
  9. package/dist/{billing-meters.d.ts → billing-next/config/meters.d.ts} +22 -12
  10. package/dist/{billing-meters.js → billing-next/config/meters.js} +15 -9
  11. package/dist/billing-next/config/plans.d.ts +170 -0
  12. package/dist/{billing-plans.js → billing-next/config/plans.js} +66 -59
  13. package/dist/{schema.d.ts → billing-next/config/schemas.d.ts} +392 -196
  14. package/dist/{schema.js → billing-next/config/schemas.js} +19 -12
  15. package/dist/billing-next/config/versions.d.ts +829 -0
  16. package/dist/billing-next/config/versions.js +27 -0
  17. package/dist/billing-next/consts.d.ts +5 -0
  18. package/dist/billing-next/consts.js +8 -0
  19. package/dist/billing-next/features.d.ts +125 -0
  20. package/dist/billing-next/features.js +127 -0
  21. package/dist/billing-next/index.d.ts +3 -0
  22. package/dist/billing-next/index.js +19 -0
  23. package/dist/billing-next/type-utils.d.ts +4 -0
  24. package/dist/{types.js → billing-next/type-utils.js} +1 -0
  25. package/dist/index.d.ts +2 -9
  26. package/dist/index.js +2 -10
  27. package/package.json +1 -1
  28. package/dist/billing-addons.d.ts +0 -136
  29. package/dist/billing-features.d.ts +0 -94
  30. package/dist/billing-features.js +0 -132
  31. package/dist/billing-plans.d.ts +0 -127
  32. package/dist/billing-versions.d.ts +0 -10
  33. package/dist/billing-versions.js +0 -37
  34. package/dist/types.d.ts +0 -82
  35. package/dist/usage-metadata.d.ts +0 -22
  36. package/dist/usage-metadata.js +0 -138
  37. /package/dist/{quotas.d.ts → billing-legacy/quotas.d.ts} +0 -0
  38. /package/dist/{quotas.js → billing-legacy/quotas.js} +0 -0
@@ -0,0 +1,9 @@
1
+ /**
2
+ * These constants and types are used by the billing v3 codebase, we should ensure both codebase can evolve separately
3
+ */
4
+ export declare const ALLOWED_TRIAL_LENGTHS_IN_DAYS = 7;
5
+ export declare const ALLOWED_TRIAL_PLANS: readonly ["plus", "team"];
6
+ export declare const BILLING_PLAN_IDS: readonly ["community", "plus", "team", "enterprise", "managed"];
7
+ export declare const billingFeatureDefs: Record<string, {
8
+ name: string;
9
+ }>;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /**
3
+ * These constants and types are used by the billing v3 codebase, we should ensure both codebase can evolve separately
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.billingFeatureDefs = exports.BILLING_PLAN_IDS = exports.ALLOWED_TRIAL_PLANS = exports.ALLOWED_TRIAL_LENGTHS_IN_DAYS = void 0;
7
+ exports.ALLOWED_TRIAL_LENGTHS_IN_DAYS = 7;
8
+ exports.ALLOWED_TRIAL_PLANS = ['plus', 'team'];
9
+ exports.BILLING_PLAN_IDS = ['community', 'plus', 'team', 'enterprise', 'managed']; // keep this in order of lowest to highest tier
10
+ exports.billingFeatureDefs = {
11
+ human_in_the_loop: {
12
+ name: 'Human in the Loop',
13
+ },
14
+ ratelimit: {
15
+ name: 'Rate Limit',
16
+ },
17
+ incoming_messages_events: {
18
+ name: 'Incoming Messages/Events',
19
+ },
20
+ integration_spend: {
21
+ name: 'Integration Spend',
22
+ },
23
+ integration_subscription: {
24
+ name: 'Integration Subscription',
25
+ },
26
+ table_rows: {
27
+ name: 'Table Rows',
28
+ },
29
+ bot_count: {
30
+ name: 'Bot Count',
31
+ },
32
+ always_alive_count: {
33
+ name: 'Always Alive Count',
34
+ },
35
+ always_alive_concurrency: {
36
+ name: 'Always Alive Concurrency',
37
+ },
38
+ collaborator_count: {
39
+ name: 'Collaborator Count',
40
+ },
41
+ file_storage: {
42
+ name: 'File Storage',
43
+ },
44
+ vector_db_storage: {
45
+ name: 'Vector DB Storage',
46
+ },
47
+ saved_versions: {
48
+ name: 'Saved Versions',
49
+ },
50
+ indexed_file_count: {
51
+ name: 'Indexed File Count',
52
+ },
53
+ };
@@ -0,0 +1,2 @@
1
+ export * from './quotas';
2
+ export * from './consts';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./quotas"), exports);
18
+ __exportStar(require("./consts"), exports);
@@ -0,0 +1,181 @@
1
+ export type BillingAddonId = keyof typeof addons;
2
+ export declare const addons: {
3
+ readonly bot_addon: {
4
+ readonly id: "bot_addon";
5
+ readonly name: "Add-on - Bot";
6
+ readonly description: "Add one more bot to your workspace";
7
+ readonly prices: {
8
+ readonly month: {
9
+ readonly amount: 10;
10
+ readonly currency: "usd";
11
+ readonly interval: "month";
12
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
13
+ };
14
+ };
15
+ readonly feature: "bot_count";
16
+ readonly increment: 1;
17
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
18
+ };
19
+ readonly collaborator_addon: {
20
+ readonly id: "collaborator_addon";
21
+ readonly name: "Add-on - Collaborators";
22
+ readonly description: "Add one more collaborator to your workspace";
23
+ readonly prices: {
24
+ readonly month: {
25
+ readonly amount: 25;
26
+ readonly currency: "usd";
27
+ readonly interval: "month";
28
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
29
+ };
30
+ };
31
+ readonly feature: "collaborator_count";
32
+ readonly increment: 1;
33
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
34
+ };
35
+ readonly always_alive_addon: {
36
+ readonly id: "always_alive_addon";
37
+ readonly name: "Add-on - Always Alive";
38
+ readonly description: "Keep one more bot always alive";
39
+ readonly prices: {
40
+ readonly month: {
41
+ readonly amount: 10;
42
+ readonly currency: "usd";
43
+ readonly interval: "month";
44
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
45
+ };
46
+ };
47
+ readonly feature: "always_alive_count";
48
+ readonly increment: 1;
49
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
50
+ };
51
+ readonly messages_events_addon: {
52
+ readonly id: "messages_events_addon";
53
+ readonly name: "Add-on - Messages & Events";
54
+ readonly description: "Adds 5,000 messages and events";
55
+ readonly prices: {
56
+ readonly month: {
57
+ readonly amount: 20;
58
+ readonly currency: "usd";
59
+ readonly interval: "month";
60
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
61
+ };
62
+ };
63
+ readonly feature: "incoming_messages_events";
64
+ readonly increment: 5000;
65
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
66
+ };
67
+ readonly table_rows_addon: {
68
+ readonly id: "table_rows_addon";
69
+ readonly name: "Add-on - Table Rows";
70
+ readonly description: "Adds 100,000 additional table rows";
71
+ readonly prices: {
72
+ readonly month: {
73
+ readonly amount: 25;
74
+ readonly currency: "usd";
75
+ readonly interval: "month";
76
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
77
+ };
78
+ };
79
+ readonly feature: "table_rows";
80
+ readonly increment: 100000;
81
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
82
+ };
83
+ readonly file_storage_addon: {
84
+ readonly id: "file_storage_addon";
85
+ readonly name: "Add-on - File Storage";
86
+ readonly description: "Adds 10GB of File Storage";
87
+ readonly prices: {
88
+ readonly month: {
89
+ readonly amount: 10;
90
+ readonly currency: "usd";
91
+ readonly interval: "month";
92
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
93
+ };
94
+ };
95
+ readonly feature: "file_storage";
96
+ readonly increment: 10000000000;
97
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
98
+ };
99
+ readonly vector_db_storage_addon: {
100
+ readonly id: "vector_db_storage_addon";
101
+ readonly name: "Add-on - Vector DB Storage";
102
+ readonly description: "Add 1 GB of vector database storage";
103
+ readonly prices: {
104
+ readonly month: {
105
+ readonly amount: 20;
106
+ readonly currency: "usd";
107
+ readonly interval: "month";
108
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
109
+ };
110
+ };
111
+ readonly feature: "vector_db_storage";
112
+ readonly increment: 1000000000;
113
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
114
+ };
115
+ readonly web_search_addon: {
116
+ readonly id: "web_search_addon";
117
+ readonly name: "Web Search and Crawl";
118
+ readonly description: "Web search and crawl functionality";
119
+ readonly prices: {
120
+ readonly month: {
121
+ readonly amount: 10;
122
+ readonly currency: "usd";
123
+ readonly interval: "month";
124
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
125
+ };
126
+ };
127
+ readonly feature: "integration_spend";
128
+ readonly increment: 10000000000;
129
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
130
+ };
131
+ readonly ai_credits_addon: {
132
+ readonly id: "ai_credits_addon";
133
+ readonly name: "AI Tokens";
134
+ readonly description: "Add $25 worth of AI credits";
135
+ readonly prices: {
136
+ readonly month: {
137
+ readonly amount: 25;
138
+ readonly currency: "usd";
139
+ readonly interval: "month";
140
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
141
+ };
142
+ };
143
+ readonly feature: "integration_spend";
144
+ readonly increment: 25000000000;
145
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
146
+ };
147
+ readonly enterprise_ai_token: {
148
+ readonly id: "enterprise_ai_token";
149
+ readonly name: "Enterprise - AI Token";
150
+ readonly description: "Enterprise AI token credits";
151
+ readonly prices: {
152
+ readonly month: {
153
+ readonly amount: -1;
154
+ readonly currency: "usd";
155
+ readonly interval: "month";
156
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
157
+ };
158
+ };
159
+ readonly feature: "integration_spend";
160
+ readonly increment: 100000000000;
161
+ readonly hidden: true;
162
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
163
+ };
164
+ readonly enterprise_additional_workspace: {
165
+ readonly id: "enterprise_additional_workspace";
166
+ readonly name: "Enterprise - Additional Workspace";
167
+ readonly description: "Enterprise additional workspace";
168
+ readonly prices: {
169
+ readonly month: {
170
+ readonly amount: -1;
171
+ readonly currency: "usd";
172
+ readonly interval: "month";
173
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
174
+ };
175
+ };
176
+ readonly feature: "collaborator_count";
177
+ readonly increment: 10;
178
+ readonly hidden: true;
179
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
180
+ };
181
+ };
@@ -1,163 +1,186 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.billingAddonsDefs = void 0;
4
- const billing_plans_1 = require("./billing-plans");
3
+ exports.addons = void 0;
4
+ const consts_1 = require("../consts");
5
+ const schemas_1 = require("./schemas");
5
6
  /* 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
+ exports.addons = {
7
8
  bot_addon: {
8
9
  id: 'bot_addon',
9
10
  name: 'Add-on - Bot',
10
11
  description: 'Add one more bot to your workspace',
11
- prices: [
12
- {
13
- price: 10,
12
+ prices: {
13
+ month: {
14
+ amount: 10,
14
15
  currency: 'usd',
15
16
  interval: 'month',
17
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
16
18
  },
17
- ],
19
+ },
18
20
  feature: 'bot_count',
19
21
  increment: 1,
22
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
20
23
  },
21
24
  collaborator_addon: {
22
25
  id: 'collaborator_addon',
23
26
  name: 'Add-on - Collaborators',
24
27
  description: 'Add one more collaborator to your workspace',
25
- prices: [
26
- {
27
- price: 25,
28
+ prices: {
29
+ month: {
30
+ amount: 25,
28
31
  currency: 'usd',
29
32
  interval: 'month',
33
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
30
34
  },
31
- ],
35
+ },
32
36
  feature: 'collaborator_count',
33
37
  increment: 1,
38
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
34
39
  },
35
40
  always_alive_addon: {
36
41
  id: 'always_alive_addon',
37
42
  name: 'Add-on - Always Alive',
38
43
  description: 'Keep one more bot always alive',
39
- prices: [
40
- {
41
- price: 10,
44
+ prices: {
45
+ month: {
46
+ amount: 10,
42
47
  currency: 'usd',
43
48
  interval: 'month',
49
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
44
50
  },
45
- ],
51
+ },
46
52
  feature: 'always_alive_count',
47
53
  increment: 1,
54
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
48
55
  },
49
56
  messages_events_addon: {
50
57
  id: 'messages_events_addon',
51
58
  name: 'Add-on - Messages & Events',
52
59
  description: 'Adds 5,000 messages and events',
53
- prices: [
54
- {
55
- price: 20,
60
+ prices: {
61
+ month: {
62
+ amount: 20,
56
63
  currency: 'usd',
57
64
  interval: 'month',
65
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
58
66
  },
59
- ],
67
+ },
60
68
  feature: 'incoming_messages_events',
61
69
  increment: 5000,
70
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
62
71
  },
63
72
  table_rows_addon: {
64
73
  id: 'table_rows_addon',
65
74
  name: 'Add-on - Table Rows',
66
75
  description: 'Adds 100,000 additional table rows',
67
- prices: [
68
- {
69
- price: 25,
76
+ prices: {
77
+ month: {
78
+ amount: 25,
70
79
  currency: 'usd',
71
80
  interval: 'month',
81
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
72
82
  },
73
- ],
83
+ },
74
84
  feature: 'table_rows',
75
85
  increment: 100000,
86
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
76
87
  },
77
88
  file_storage_addon: {
78
89
  id: 'file_storage_addon',
79
90
  name: 'Add-on - File Storage',
80
91
  description: 'Adds 10GB of File Storage',
81
- prices: [
82
- {
83
- price: 10,
92
+ prices: {
93
+ month: {
94
+ amount: 10,
84
95
  currency: 'usd',
85
96
  interval: 'month',
97
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
86
98
  },
87
- ],
99
+ },
88
100
  feature: 'file_storage',
89
101
  increment: 10_000_000_000, // 10 GB
102
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
90
103
  },
91
104
  vector_db_storage_addon: {
92
105
  id: 'vector_db_storage_addon',
93
106
  name: 'Add-on - Vector DB Storage',
94
107
  description: 'Add 1 GB of vector database storage',
95
- prices: [
96
- {
97
- price: 20,
108
+ prices: {
109
+ month: {
110
+ amount: 20,
98
111
  currency: 'usd',
99
112
  interval: 'month',
113
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
100
114
  },
101
- ],
115
+ },
102
116
  feature: 'vector_db_storage',
103
117
  increment: 1_000_000_000, // 1 GB
118
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
104
119
  },
105
120
  web_search_addon: {
106
121
  id: 'web_search_addon',
107
122
  name: 'Web Search and Crawl',
108
123
  description: 'Web search and crawl functionality',
109
- prices: [
110
- {
111
- price: 10,
124
+ prices: {
125
+ month: {
126
+ amount: 10,
112
127
  currency: 'usd',
113
128
  interval: 'month',
129
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
114
130
  },
115
- ],
131
+ },
116
132
  feature: 'integration_spend',
117
133
  increment: 10_000_000_000, // $10 in nano-dollars
134
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
118
135
  },
119
136
  ai_credits_addon: {
120
137
  id: 'ai_credits_addon',
121
138
  name: 'AI Tokens',
122
139
  description: 'Add $25 worth of AI credits',
123
- prices: [
124
- {
125
- price: 25,
140
+ prices: {
141
+ month: {
142
+ amount: 25,
126
143
  currency: 'usd',
127
144
  interval: 'month',
145
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
128
146
  },
129
- ],
147
+ },
130
148
  feature: 'integration_spend',
131
149
  increment: 25_000_000_000, // $25 in nano-dollars
150
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
132
151
  },
133
152
  enterprise_ai_token: {
134
153
  id: 'enterprise_ai_token',
135
154
  name: 'Enterprise - AI Token',
136
155
  description: 'Enterprise AI token credits',
137
- prices: [
138
- {
139
- price: billing_plans_1.FREE_PRICE, // Custom pricing
156
+ prices: {
157
+ month: {
158
+ amount: consts_1.FREE_PRICE, // Custom pricing
140
159
  currency: 'usd',
141
160
  interval: 'month',
161
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
142
162
  },
143
- ],
163
+ },
144
164
  feature: 'integration_spend',
145
165
  increment: 100_000_000_000, // $100 in nano-dollars
146
166
  hidden: true,
167
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
147
168
  },
148
169
  enterprise_additional_workspace: {
149
170
  id: 'enterprise_additional_workspace',
150
171
  name: 'Enterprise - Additional Workspace',
151
172
  description: 'Enterprise additional workspace',
152
- prices: [
153
- {
154
- price: billing_plans_1.FREE_PRICE, // Custom pricing
173
+ prices: {
174
+ month: {
175
+ amount: consts_1.FREE_PRICE, // Custom pricing
155
176
  currency: 'usd',
156
177
  interval: 'month',
178
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
157
179
  },
158
- ],
180
+ },
159
181
  feature: 'collaborator_count',
160
182
  increment: 10,
161
183
  hidden: true,
184
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
162
185
  },
163
186
  };
@@ -0,0 +1,5 @@
1
+ export type { BillingAddonId } from './addons';
2
+ export type { BillingMeterId } from './meters';
3
+ export type { BillingPlanId } from './plans';
4
+ export * from './schemas';
5
+ export * from './versions';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./schemas"), exports);
18
+ __exportStar(require("./versions"), exports);
@@ -1,5 +1,5 @@
1
- export declare const BILLING_METERS_IDS: readonly ["ai_spend_credit_grant", "ai_spend_pay_as_you_go"];
2
- export declare const billingMetersDefs: {
1
+ export type BillingMeterId = keyof typeof meters;
2
+ export declare const meters: {
3
3
  readonly ai_spend_credit_grant: {
4
4
  readonly id: "ai_spend_credit_grant";
5
5
  readonly name: "AI Spend - Credit grant";
@@ -14,12 +14,17 @@ export declare const billingMetersDefs: {
14
14
  readonly valueSettings: {
15
15
  readonly eventPayloadKey: "value";
16
16
  };
17
- readonly prices: [{
18
- readonly unitAmount: 1;
19
- readonly currency: "usd";
20
- readonly interval: "month";
21
- }];
17
+ readonly prices: {
18
+ readonly month: {
19
+ readonly unitAmount: 1;
20
+ readonly currency: "usd";
21
+ readonly interval: "month";
22
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
23
+ };
24
+ };
22
25
  readonly meterType: "creditGrant";
26
+ readonly providerMeterId: "__UNKNOWN_STRIPE_ID__";
27
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
23
28
  };
24
29
  readonly ai_spend_pay_as_you_go: {
25
30
  readonly id: "ai_spend_pay_as_you_go";
@@ -35,11 +40,16 @@ export declare const billingMetersDefs: {
35
40
  readonly valueSettings: {
36
41
  readonly eventPayloadKey: "value";
37
42
  };
38
- readonly prices: [{
39
- readonly unitAmount: 1;
40
- readonly currency: "usd";
41
- readonly interval: "month";
42
- }];
43
+ readonly prices: {
44
+ readonly month: {
45
+ readonly unitAmount: 1;
46
+ readonly currency: "usd";
47
+ readonly interval: "month";
48
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
49
+ };
50
+ };
43
51
  readonly meterType: "payAsYouGo";
52
+ readonly providerMeterId: "__UNKNOWN_STRIPE_ID__";
53
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
44
54
  };
45
55
  };
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.billingMetersDefs = exports.BILLING_METERS_IDS = void 0;
4
- exports.BILLING_METERS_IDS = ['ai_spend_credit_grant', 'ai_spend_pay_as_you_go'];
5
- exports.billingMetersDefs = {
3
+ exports.meters = void 0;
4
+ const schemas_1 = require("./schemas");
5
+ exports.meters = {
6
6
  ai_spend_credit_grant: {
7
7
  id: 'ai_spend_credit_grant',
8
8
  name: 'AI Spend - Credit grant',
@@ -10,14 +10,17 @@ exports.billingMetersDefs = {
10
10
  defaultAggregation: { formula: 'sum' },
11
11
  customerMapping: { eventPayloadKey: 'stripe_customer_id', type: 'by_id' },
12
12
  valueSettings: { eventPayloadKey: 'value' },
13
- prices: [
14
- {
13
+ prices: {
14
+ month: {
15
15
  unitAmount: 1,
16
16
  currency: 'usd',
17
17
  interval: 'month',
18
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
18
19
  },
19
- ],
20
+ },
20
21
  meterType: 'creditGrant',
22
+ providerMeterId: schemas_1.UNKNOWN_STRIPE_ID,
23
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
21
24
  },
22
25
  ai_spend_pay_as_you_go: {
23
26
  id: 'ai_spend_pay_as_you_go',
@@ -26,13 +29,16 @@ exports.billingMetersDefs = {
26
29
  defaultAggregation: { formula: 'sum' },
27
30
  customerMapping: { eventPayloadKey: 'stripe_customer_id', type: 'by_id' },
28
31
  valueSettings: { eventPayloadKey: 'value' },
29
- prices: [
30
- {
32
+ prices: {
33
+ month: {
31
34
  unitAmount: 1,
32
35
  currency: 'usd',
33
36
  interval: 'month',
37
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
34
38
  },
35
- ],
39
+ },
36
40
  meterType: 'payAsYouGo',
41
+ providerMeterId: schemas_1.UNKNOWN_STRIPE_ID,
42
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
37
43
  },
38
44
  };