@bpinternal/const 0.6.0 → 0.8.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.
@@ -88,7 +88,7 @@ export declare const billingAddonsDefs: {
88
88
  readonly name: "Web Search and Crawl";
89
89
  readonly description: "Web search and crawl functionality";
90
90
  readonly prices: [{
91
- readonly price: 0.01;
91
+ readonly price: 10;
92
92
  readonly currency: "usd";
93
93
  readonly interval: "month";
94
94
  }];
@@ -100,7 +100,7 @@ export declare const billingAddonsDefs: {
100
100
  readonly name: "AI Tokens";
101
101
  readonly description: "Add $25 worth of AI credits";
102
102
  readonly prices: [{
103
- readonly price: 0.01;
103
+ readonly price: 25;
104
104
  readonly currency: "usd";
105
105
  readonly interval: "month";
106
106
  }];
@@ -118,6 +118,7 @@ export declare const billingAddonsDefs: {
118
118
  }];
119
119
  readonly feature: "integration_spend";
120
120
  readonly increment: 100000000000;
121
+ readonly hidden: true;
121
122
  };
122
123
  readonly enterprise_additional_workspace: {
123
124
  readonly id: "enterprise_additional_workspace";
@@ -130,5 +131,6 @@ export declare const billingAddonsDefs: {
130
131
  }];
131
132
  readonly feature: "collaborator_count";
132
133
  readonly increment: 10;
134
+ readonly hidden: true;
133
135
  };
134
136
  };
@@ -108,7 +108,7 @@ exports.billingAddonsDefs = {
108
108
  description: 'Web search and crawl functionality',
109
109
  prices: [
110
110
  {
111
- price: 0.01,
111
+ price: 10,
112
112
  currency: 'usd',
113
113
  interval: 'month',
114
114
  },
@@ -122,7 +122,7 @@ exports.billingAddonsDefs = {
122
122
  description: 'Add $25 worth of AI credits',
123
123
  prices: [
124
124
  {
125
- price: 0.01,
125
+ price: 25,
126
126
  currency: 'usd',
127
127
  interval: 'month',
128
128
  },
@@ -143,6 +143,7 @@ exports.billingAddonsDefs = {
143
143
  ],
144
144
  feature: 'integration_spend',
145
145
  increment: 100_000_000_000, // $100 in nano-dollars
146
+ hidden: true,
146
147
  },
147
148
  enterprise_additional_workspace: {
148
149
  id: 'enterprise_additional_workspace',
@@ -157,5 +158,6 @@ exports.billingAddonsDefs = {
157
158
  ],
158
159
  feature: 'collaborator_count',
159
160
  increment: 10,
161
+ hidden: true,
160
162
  },
161
163
  };
@@ -4,11 +4,20 @@ export declare const billingMetersDefs: {
4
4
  readonly id: "ai_spend_credit_grant";
5
5
  readonly name: "AI Spend - Credit grant";
6
6
  readonly description: "Pre-purchased credits applied toward AI usage";
7
+ readonly defaultAggregation: {
8
+ readonly formula: "sum";
9
+ };
10
+ readonly customerMapping: {
11
+ readonly eventPayloadKey: "stripe_customer_id";
12
+ readonly type: "by_id";
13
+ };
14
+ readonly valueSettings: {
15
+ readonly eventPayloadKey: "value";
16
+ };
7
17
  readonly prices: [{
8
18
  readonly unitAmount: 1;
9
19
  readonly currency: "usd";
10
20
  readonly interval: "month";
11
- readonly aggregation: "last_during_period";
12
21
  }];
13
22
  readonly meterType: "creditGrant";
14
23
  };
@@ -16,11 +25,20 @@ export declare const billingMetersDefs: {
16
25
  readonly id: "ai_spend_pay_as_you_go";
17
26
  readonly name: "AI Spend - Pay as you go";
18
27
  readonly description: "Usage-based charges for AI spend, billed monthly";
28
+ readonly defaultAggregation: {
29
+ readonly formula: "sum";
30
+ };
31
+ readonly customerMapping: {
32
+ readonly eventPayloadKey: "stripe_customer_id";
33
+ readonly type: "by_id";
34
+ };
35
+ readonly valueSettings: {
36
+ readonly eventPayloadKey: "value";
37
+ };
19
38
  readonly prices: [{
20
39
  readonly unitAmount: 1;
21
40
  readonly currency: "usd";
22
41
  readonly interval: "month";
23
- readonly aggregation: "last_during_period";
24
42
  }];
25
43
  readonly meterType: "payAsYouGo";
26
44
  };
@@ -7,12 +7,14 @@ exports.billingMetersDefs = {
7
7
  id: 'ai_spend_credit_grant',
8
8
  name: 'AI Spend - Credit grant',
9
9
  description: 'Pre-purchased credits applied toward AI usage',
10
+ defaultAggregation: { formula: 'sum' },
11
+ customerMapping: { eventPayloadKey: 'stripe_customer_id', type: 'by_id' },
12
+ valueSettings: { eventPayloadKey: 'value' },
10
13
  prices: [
11
14
  {
12
15
  unitAmount: 1,
13
16
  currency: 'usd',
14
17
  interval: 'month',
15
- aggregation: 'last_during_period',
16
18
  },
17
19
  ],
18
20
  meterType: 'creditGrant',
@@ -21,12 +23,14 @@ exports.billingMetersDefs = {
21
23
  id: 'ai_spend_pay_as_you_go',
22
24
  name: 'AI Spend - Pay as you go',
23
25
  description: 'Usage-based charges for AI spend, billed monthly',
26
+ defaultAggregation: { formula: 'sum' },
27
+ customerMapping: { eventPayloadKey: 'stripe_customer_id', type: 'by_id' },
28
+ valueSettings: { eventPayloadKey: 'value' },
24
29
  prices: [
25
30
  {
26
31
  unitAmount: 1,
27
32
  currency: 'usd',
28
33
  interval: 'month',
29
- aggregation: 'last_during_period',
30
34
  },
31
35
  ],
32
36
  meterType: 'payAsYouGo',
package/dist/schema.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export declare const intervalSchema: z.ZodEnum<["month", "year"]>;
3
3
  export declare const unitAmountSchema: z.ZodNumber;
4
- export declare const aggregationSchema: z.ZodEnum<["sum", "last_during_period", "last_ever", "max"]>;
4
+ export declare const aggregationSchema: z.ZodEnum<["sum", "count"]>;
5
5
  export declare const meterTypeSchema: z.ZodEnum<["payAsYouGo", "creditGrant"]>;
6
6
  export declare const priceSchema: z.ZodObject<{
7
7
  providerPriceId: z.ZodString;
@@ -27,21 +27,18 @@ export declare const meteredPriceSchema: z.ZodObject<{
27
27
  unitAmount: z.ZodNumber;
28
28
  currency: z.ZodEnum<["usd"]>;
29
29
  interval: z.ZodEnum<["month", "year"]>;
30
- aggregation: z.ZodEnum<["sum", "last_during_period", "last_ever", "max"]>;
31
30
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
32
31
  }, "strip", z.ZodTypeAny, {
33
32
  providerPriceId: string;
34
33
  currency: "usd";
35
34
  interval: "month" | "year";
36
35
  unitAmount: number;
37
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
38
36
  metadata?: Record<string, string> | undefined;
39
37
  }, {
40
38
  providerPriceId: string;
41
39
  currency: "usd";
42
40
  interval: "month" | "year";
43
41
  unitAmount: number;
44
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
45
42
  metadata?: Record<string, string> | undefined;
46
43
  }>;
47
44
  export declare const featureSchema: z.ZodEnum<["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"]>;
@@ -132,6 +129,7 @@ export declare const addOnSchema: z.ZodObject<{
132
129
  prorationDisabled: z.ZodOptional<z.ZodBoolean>;
133
130
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
134
131
  autoRechargeable: z.ZodOptional<z.ZodBoolean>;
132
+ hidden: z.ZodOptional<z.ZodBoolean>;
135
133
  }, "strip", z.ZodTypeAny, {
136
134
  id: string;
137
135
  name: string;
@@ -149,6 +147,7 @@ export declare const addOnSchema: z.ZodObject<{
149
147
  metadata?: Record<string, string> | undefined;
150
148
  prorationDisabled?: boolean | undefined;
151
149
  autoRechargeable?: boolean | undefined;
150
+ hidden?: boolean | undefined;
152
151
  }, {
153
152
  id: string;
154
153
  name: string;
@@ -166,32 +165,31 @@ export declare const addOnSchema: z.ZodObject<{
166
165
  metadata?: Record<string, string> | undefined;
167
166
  prorationDisabled?: boolean | undefined;
168
167
  autoRechargeable?: boolean | undefined;
168
+ hidden?: boolean | undefined;
169
169
  }>;
170
170
  export declare const meterSchema: z.ZodObject<{
171
171
  id: z.ZodString;
172
172
  name: z.ZodString;
173
173
  description: z.ZodString;
174
174
  providerProductId: z.ZodString;
175
+ providerMeterId: z.ZodString;
175
176
  prices: z.ZodRecord<z.ZodEnum<["month", "year"]>, z.ZodObject<{
176
177
  providerPriceId: z.ZodString;
177
178
  unitAmount: z.ZodNumber;
178
179
  currency: z.ZodEnum<["usd"]>;
179
180
  interval: z.ZodEnum<["month", "year"]>;
180
- aggregation: z.ZodEnum<["sum", "last_during_period", "last_ever", "max"]>;
181
181
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
182
182
  }, "strip", z.ZodTypeAny, {
183
183
  providerPriceId: string;
184
184
  currency: "usd";
185
185
  interval: "month" | "year";
186
186
  unitAmount: number;
187
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
188
187
  metadata?: Record<string, string> | undefined;
189
188
  }, {
190
189
  providerPriceId: string;
191
190
  currency: "usd";
192
191
  interval: "month" | "year";
193
192
  unitAmount: number;
194
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
195
193
  metadata?: Record<string, string> | undefined;
196
194
  }>>;
197
195
  meterType: z.ZodEnum<["payAsYouGo", "creditGrant"]>;
@@ -206,9 +204,9 @@ export declare const meterSchema: z.ZodObject<{
206
204
  currency: "usd";
207
205
  interval: "month" | "year";
208
206
  unitAmount: number;
209
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
210
207
  metadata?: Record<string, string> | undefined;
211
208
  }>>;
209
+ providerMeterId: string;
212
210
  meterType: "creditGrant" | "payAsYouGo";
213
211
  metadata?: Record<string, string> | undefined;
214
212
  }, {
@@ -221,9 +219,9 @@ export declare const meterSchema: z.ZodObject<{
221
219
  currency: "usd";
222
220
  interval: "month" | "year";
223
221
  unitAmount: number;
224
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
225
222
  metadata?: Record<string, string> | undefined;
226
223
  }>>;
224
+ providerMeterId: string;
227
225
  meterType: "creditGrant" | "payAsYouGo";
228
226
  metadata?: Record<string, string> | undefined;
229
227
  }>;
@@ -318,6 +316,7 @@ export declare const billingVersionConfigSchema: z.ZodObject<{
318
316
  prorationDisabled: z.ZodOptional<z.ZodBoolean>;
319
317
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
320
318
  autoRechargeable: z.ZodOptional<z.ZodBoolean>;
319
+ hidden: z.ZodOptional<z.ZodBoolean>;
321
320
  }, "strip", z.ZodTypeAny, {
322
321
  id: string;
323
322
  name: string;
@@ -335,6 +334,7 @@ export declare const billingVersionConfigSchema: z.ZodObject<{
335
334
  metadata?: Record<string, string> | undefined;
336
335
  prorationDisabled?: boolean | undefined;
337
336
  autoRechargeable?: boolean | undefined;
337
+ hidden?: boolean | undefined;
338
338
  }, {
339
339
  id: string;
340
340
  name: string;
@@ -352,32 +352,31 @@ export declare const billingVersionConfigSchema: z.ZodObject<{
352
352
  metadata?: Record<string, string> | undefined;
353
353
  prorationDisabled?: boolean | undefined;
354
354
  autoRechargeable?: boolean | undefined;
355
+ hidden?: boolean | undefined;
355
356
  }>>;
356
357
  meters: z.ZodRecord<z.ZodString, z.ZodObject<{
357
358
  id: z.ZodString;
358
359
  name: z.ZodString;
359
360
  description: z.ZodString;
360
361
  providerProductId: z.ZodString;
362
+ providerMeterId: z.ZodString;
361
363
  prices: z.ZodRecord<z.ZodEnum<["month", "year"]>, z.ZodObject<{
362
364
  providerPriceId: z.ZodString;
363
365
  unitAmount: z.ZodNumber;
364
366
  currency: z.ZodEnum<["usd"]>;
365
367
  interval: z.ZodEnum<["month", "year"]>;
366
- aggregation: z.ZodEnum<["sum", "last_during_period", "last_ever", "max"]>;
367
368
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
368
369
  }, "strip", z.ZodTypeAny, {
369
370
  providerPriceId: string;
370
371
  currency: "usd";
371
372
  interval: "month" | "year";
372
373
  unitAmount: number;
373
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
374
374
  metadata?: Record<string, string> | undefined;
375
375
  }, {
376
376
  providerPriceId: string;
377
377
  currency: "usd";
378
378
  interval: "month" | "year";
379
379
  unitAmount: number;
380
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
381
380
  metadata?: Record<string, string> | undefined;
382
381
  }>>;
383
382
  meterType: z.ZodEnum<["payAsYouGo", "creditGrant"]>;
@@ -392,9 +391,9 @@ export declare const billingVersionConfigSchema: z.ZodObject<{
392
391
  currency: "usd";
393
392
  interval: "month" | "year";
394
393
  unitAmount: number;
395
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
396
394
  metadata?: Record<string, string> | undefined;
397
395
  }>>;
396
+ providerMeterId: string;
398
397
  meterType: "creditGrant" | "payAsYouGo";
399
398
  metadata?: Record<string, string> | undefined;
400
399
  }, {
@@ -407,9 +406,9 @@ export declare const billingVersionConfigSchema: z.ZodObject<{
407
406
  currency: "usd";
408
407
  interval: "month" | "year";
409
408
  unitAmount: number;
410
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
411
409
  metadata?: Record<string, string> | undefined;
412
410
  }>>;
411
+ providerMeterId: string;
413
412
  meterType: "creditGrant" | "payAsYouGo";
414
413
  metadata?: Record<string, string> | undefined;
415
414
  }>>;
@@ -452,6 +451,7 @@ export declare const billingVersionConfigSchema: z.ZodObject<{
452
451
  metadata?: Record<string, string> | undefined;
453
452
  prorationDisabled?: boolean | undefined;
454
453
  autoRechargeable?: boolean | undefined;
454
+ hidden?: boolean | undefined;
455
455
  }>;
456
456
  meters: Record<string, {
457
457
  id: string;
@@ -463,9 +463,9 @@ export declare const billingVersionConfigSchema: z.ZodObject<{
463
463
  currency: "usd";
464
464
  interval: "month" | "year";
465
465
  unitAmount: number;
466
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
467
466
  metadata?: Record<string, string> | undefined;
468
467
  }>>;
468
+ providerMeterId: string;
469
469
  meterType: "creditGrant" | "payAsYouGo";
470
470
  metadata?: Record<string, string> | undefined;
471
471
  }>;
@@ -508,6 +508,7 @@ export declare const billingVersionConfigSchema: z.ZodObject<{
508
508
  metadata?: Record<string, string> | undefined;
509
509
  prorationDisabled?: boolean | undefined;
510
510
  autoRechargeable?: boolean | undefined;
511
+ hidden?: boolean | undefined;
511
512
  }>;
512
513
  meters: Record<string, {
513
514
  id: string;
@@ -519,9 +520,9 @@ export declare const billingVersionConfigSchema: z.ZodObject<{
519
520
  currency: "usd";
520
521
  interval: "month" | "year";
521
522
  unitAmount: number;
522
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
523
523
  metadata?: Record<string, string> | undefined;
524
524
  }>>;
525
+ providerMeterId: string;
525
526
  meterType: "creditGrant" | "payAsYouGo";
526
527
  metadata?: Record<string, string> | undefined;
527
528
  }>;
@@ -619,6 +620,7 @@ export declare const billingConfigSchema: z.ZodRecord<z.ZodEnum<["v4"]>, z.ZodOb
619
620
  prorationDisabled: z.ZodOptional<z.ZodBoolean>;
620
621
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
621
622
  autoRechargeable: z.ZodOptional<z.ZodBoolean>;
623
+ hidden: z.ZodOptional<z.ZodBoolean>;
622
624
  }, "strip", z.ZodTypeAny, {
623
625
  id: string;
624
626
  name: string;
@@ -636,6 +638,7 @@ export declare const billingConfigSchema: z.ZodRecord<z.ZodEnum<["v4"]>, z.ZodOb
636
638
  metadata?: Record<string, string> | undefined;
637
639
  prorationDisabled?: boolean | undefined;
638
640
  autoRechargeable?: boolean | undefined;
641
+ hidden?: boolean | undefined;
639
642
  }, {
640
643
  id: string;
641
644
  name: string;
@@ -653,32 +656,31 @@ export declare const billingConfigSchema: z.ZodRecord<z.ZodEnum<["v4"]>, z.ZodOb
653
656
  metadata?: Record<string, string> | undefined;
654
657
  prorationDisabled?: boolean | undefined;
655
658
  autoRechargeable?: boolean | undefined;
659
+ hidden?: boolean | undefined;
656
660
  }>>;
657
661
  meters: z.ZodRecord<z.ZodString, z.ZodObject<{
658
662
  id: z.ZodString;
659
663
  name: z.ZodString;
660
664
  description: z.ZodString;
661
665
  providerProductId: z.ZodString;
666
+ providerMeterId: z.ZodString;
662
667
  prices: z.ZodRecord<z.ZodEnum<["month", "year"]>, z.ZodObject<{
663
668
  providerPriceId: z.ZodString;
664
669
  unitAmount: z.ZodNumber;
665
670
  currency: z.ZodEnum<["usd"]>;
666
671
  interval: z.ZodEnum<["month", "year"]>;
667
- aggregation: z.ZodEnum<["sum", "last_during_period", "last_ever", "max"]>;
668
672
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
669
673
  }, "strip", z.ZodTypeAny, {
670
674
  providerPriceId: string;
671
675
  currency: "usd";
672
676
  interval: "month" | "year";
673
677
  unitAmount: number;
674
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
675
678
  metadata?: Record<string, string> | undefined;
676
679
  }, {
677
680
  providerPriceId: string;
678
681
  currency: "usd";
679
682
  interval: "month" | "year";
680
683
  unitAmount: number;
681
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
682
684
  metadata?: Record<string, string> | undefined;
683
685
  }>>;
684
686
  meterType: z.ZodEnum<["payAsYouGo", "creditGrant"]>;
@@ -693,9 +695,9 @@ export declare const billingConfigSchema: z.ZodRecord<z.ZodEnum<["v4"]>, z.ZodOb
693
695
  currency: "usd";
694
696
  interval: "month" | "year";
695
697
  unitAmount: number;
696
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
697
698
  metadata?: Record<string, string> | undefined;
698
699
  }>>;
700
+ providerMeterId: string;
699
701
  meterType: "creditGrant" | "payAsYouGo";
700
702
  metadata?: Record<string, string> | undefined;
701
703
  }, {
@@ -708,9 +710,9 @@ export declare const billingConfigSchema: z.ZodRecord<z.ZodEnum<["v4"]>, z.ZodOb
708
710
  currency: "usd";
709
711
  interval: "month" | "year";
710
712
  unitAmount: number;
711
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
712
713
  metadata?: Record<string, string> | undefined;
713
714
  }>>;
715
+ providerMeterId: string;
714
716
  meterType: "creditGrant" | "payAsYouGo";
715
717
  metadata?: Record<string, string> | undefined;
716
718
  }>>;
@@ -753,6 +755,7 @@ export declare const billingConfigSchema: z.ZodRecord<z.ZodEnum<["v4"]>, z.ZodOb
753
755
  metadata?: Record<string, string> | undefined;
754
756
  prorationDisabled?: boolean | undefined;
755
757
  autoRechargeable?: boolean | undefined;
758
+ hidden?: boolean | undefined;
756
759
  }>;
757
760
  meters: Record<string, {
758
761
  id: string;
@@ -764,9 +767,9 @@ export declare const billingConfigSchema: z.ZodRecord<z.ZodEnum<["v4"]>, z.ZodOb
764
767
  currency: "usd";
765
768
  interval: "month" | "year";
766
769
  unitAmount: number;
767
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
768
770
  metadata?: Record<string, string> | undefined;
769
771
  }>>;
772
+ providerMeterId: string;
770
773
  meterType: "creditGrant" | "payAsYouGo";
771
774
  metadata?: Record<string, string> | undefined;
772
775
  }>;
@@ -809,6 +812,7 @@ export declare const billingConfigSchema: z.ZodRecord<z.ZodEnum<["v4"]>, z.ZodOb
809
812
  metadata?: Record<string, string> | undefined;
810
813
  prorationDisabled?: boolean | undefined;
811
814
  autoRechargeable?: boolean | undefined;
815
+ hidden?: boolean | undefined;
812
816
  }>;
813
817
  meters: Record<string, {
814
818
  id: string;
@@ -820,9 +824,9 @@ export declare const billingConfigSchema: z.ZodRecord<z.ZodEnum<["v4"]>, z.ZodOb
820
824
  currency: "usd";
821
825
  interval: "month" | "year";
822
826
  unitAmount: number;
823
- aggregation: "last_during_period" | "sum" | "last_ever" | "max";
824
827
  metadata?: Record<string, string> | undefined;
825
828
  }>>;
829
+ providerMeterId: string;
826
830
  meterType: "creditGrant" | "payAsYouGo";
827
831
  metadata?: Record<string, string> | undefined;
828
832
  }>;
package/dist/schema.js CHANGED
@@ -6,7 +6,7 @@ const billing_versions_1 = require("./billing-versions");
6
6
  const billing_features_1 = require("./billing-features");
7
7
  exports.intervalSchema = zod_1.z.enum(['month', 'year']);
8
8
  exports.unitAmountSchema = zod_1.z.number().int().min(1);
9
- exports.aggregationSchema = zod_1.z.enum(['sum', 'last_during_period', 'last_ever', 'max']);
9
+ exports.aggregationSchema = zod_1.z.enum(['sum', 'count']);
10
10
  exports.meterTypeSchema = zod_1.z.enum(['payAsYouGo', 'creditGrant']);
11
11
  exports.priceSchema = zod_1.z.object({
12
12
  providerPriceId: zod_1.z.string(),
@@ -20,7 +20,6 @@ exports.meteredPriceSchema = zod_1.z.object({
20
20
  unitAmount: exports.unitAmountSchema,
21
21
  currency: zod_1.z.enum(['usd']),
22
22
  interval: exports.intervalSchema,
23
- aggregation: exports.aggregationSchema,
24
23
  metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
25
24
  });
26
25
  exports.featureSchema = zod_1.z.enum(billing_features_1.BILLING_FEATURE_IDS);
@@ -45,12 +44,14 @@ exports.addOnSchema = zod_1.z.object({
45
44
  prorationDisabled: zod_1.z.boolean().optional(),
46
45
  metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
47
46
  autoRechargeable: zod_1.z.boolean().optional(),
47
+ hidden: zod_1.z.boolean().optional(),
48
48
  });
49
49
  exports.meterSchema = zod_1.z.object({
50
50
  id: zod_1.z.string(),
51
51
  name: zod_1.z.string(),
52
52
  description: zod_1.z.string(),
53
53
  providerProductId: zod_1.z.string(),
54
+ providerMeterId: zod_1.z.string(),
54
55
  prices: zod_1.z.record(exports.intervalSchema, exports.meteredPriceSchema),
55
56
  meterType: exports.meterTypeSchema,
56
57
  metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
package/dist/types.d.ts CHANGED
@@ -29,7 +29,6 @@ export type BillingMeteredPriceDefinition = {
29
29
  unitAmount: number;
30
30
  currency: 'usd';
31
31
  interval: Interval;
32
- aggregation: Aggregation;
33
32
  };
34
33
  export type BillingPlanDefinition = {
35
34
  id: BillingPlanId;
@@ -49,11 +48,22 @@ export type BillingAddonDefinition = {
49
48
  increment: number;
50
49
  prorationDisabled?: boolean;
51
50
  metadata?: Record<string, string>;
51
+ hidden?: boolean;
52
52
  };
53
53
  export type BillingMeterDefinition = {
54
54
  id: BillingMeterId;
55
55
  name: string;
56
56
  description: string;
57
+ defaultAggregation: {
58
+ formula: Aggregation;
59
+ };
60
+ customerMapping: {
61
+ eventPayloadKey: 'stripe_customer_id';
62
+ type: 'by_id';
63
+ };
64
+ valueSettings: {
65
+ eventPayloadKey: 'value';
66
+ };
57
67
  prices: Array<BillingMeteredPriceDefinition>;
58
68
  meterType: MeterType;
59
69
  metadata?: Record<string, string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpinternal/const",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "Shared constants for Skynet billing refactor (vendored copy of upstream packages/const)",
5
5
  "license": "UNLICENSED",
6
6
  "files": [