@bpinternal/const 0.5.1 → 0.6.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.
@@ -3,6 +3,9 @@
3
3
  * Based on the requirements from the billing refactor document
4
4
  */
5
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 ATOMIC_BILLING_FEATURE_IDS: ["integration_subscription", "bot_count", "always_alive_count", "always_alive_concurrency", "collaborator_count", "saved_versions"];
7
+ export declare const NON_ATOMIC_BILLING_FEATURE_IDS: ["incoming_messages_events", "integration_spend", "table_rows", "file_storage", "vector_db_storage"];
8
+ export declare const CREDIT_GRANT_BILLING_FEATURE_IDS: ["integration_spend"];
6
9
  export declare const billingFeatureDefs: {
7
10
  readonly human_in_the_loop: {
8
11
  readonly name: "Human in the Loop";
@@ -4,7 +4,7 @@
4
4
  * Based on the requirements from the billing refactor document
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.billingFeatureDefs = exports.BILLING_FEATURE_IDS = void 0;
7
+ exports.billingFeatureDefs = exports.CREDIT_GRANT_BILLING_FEATURE_IDS = exports.NON_ATOMIC_BILLING_FEATURE_IDS = exports.ATOMIC_BILLING_FEATURE_IDS = exports.BILLING_FEATURE_IDS = void 0;
8
8
  exports.BILLING_FEATURE_IDS = [
9
9
  'human_in_the_loop',
10
10
  'ratelimit',
@@ -20,6 +20,22 @@ exports.BILLING_FEATURE_IDS = [
20
20
  'vector_db_storage',
21
21
  'saved_versions',
22
22
  ];
23
+ exports.ATOMIC_BILLING_FEATURE_IDS = [
24
+ 'integration_subscription',
25
+ 'bot_count',
26
+ 'always_alive_count',
27
+ 'always_alive_concurrency',
28
+ 'collaborator_count',
29
+ 'saved_versions',
30
+ ];
31
+ exports.NON_ATOMIC_BILLING_FEATURE_IDS = [
32
+ 'incoming_messages_events',
33
+ 'integration_spend',
34
+ 'table_rows',
35
+ 'file_storage',
36
+ 'vector_db_storage',
37
+ ];
38
+ exports.CREDIT_GRANT_BILLING_FEATURE_IDS = ['integration_spend'];
23
39
  exports.billingFeatureDefs = {
24
40
  human_in_the_loop: {
25
41
  name: 'Human in the Loop',
@@ -8,7 +8,7 @@ export declare const billingMetersDefs: {
8
8
  readonly unitAmount: 1;
9
9
  readonly currency: "usd";
10
10
  readonly interval: "month";
11
- readonly aggregation: "lastDuringPeriod";
11
+ readonly aggregation: "last_during_period";
12
12
  }];
13
13
  readonly meterType: "creditGrant";
14
14
  };
@@ -20,7 +20,7 @@ export declare const billingMetersDefs: {
20
20
  readonly unitAmount: 1;
21
21
  readonly currency: "usd";
22
22
  readonly interval: "month";
23
- readonly aggregation: "lastDuringPeriod";
23
+ readonly aggregation: "last_during_period";
24
24
  }];
25
25
  readonly meterType: "payAsYouGo";
26
26
  };
@@ -12,7 +12,7 @@ exports.billingMetersDefs = {
12
12
  unitAmount: 1,
13
13
  currency: 'usd',
14
14
  interval: 'month',
15
- aggregation: 'lastDuringPeriod',
15
+ aggregation: 'last_during_period',
16
16
  },
17
17
  ],
18
18
  meterType: 'creditGrant',
@@ -26,7 +26,7 @@ exports.billingMetersDefs = {
26
26
  unitAmount: 1,
27
27
  currency: 'usd',
28
28
  interval: 'month',
29
- aggregation: 'lastDuringPeriod',
29
+ aggregation: 'last_during_period',
30
30
  },
31
31
  ],
32
32
  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", "lastDuringPeriod", "lastEver", "max"]>;
4
+ export declare const aggregationSchema: z.ZodEnum<["sum", "last_during_period", "last_ever", "max"]>;
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,21 @@ 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", "lastDuringPeriod", "lastEver", "max"]>;
30
+ aggregation: z.ZodEnum<["sum", "last_during_period", "last_ever", "max"]>;
31
31
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
32
32
  }, "strip", z.ZodTypeAny, {
33
33
  providerPriceId: string;
34
34
  currency: "usd";
35
35
  interval: "month" | "year";
36
36
  unitAmount: number;
37
- aggregation: "lastDuringPeriod" | "sum" | "lastEver" | "max";
37
+ aggregation: "last_during_period" | "sum" | "last_ever" | "max";
38
38
  metadata?: Record<string, string> | undefined;
39
39
  }, {
40
40
  providerPriceId: string;
41
41
  currency: "usd";
42
42
  interval: "month" | "year";
43
43
  unitAmount: number;
44
- aggregation: "lastDuringPeriod" | "sum" | "lastEver" | "max";
44
+ aggregation: "last_during_period" | "sum" | "last_ever" | "max";
45
45
  metadata?: Record<string, string> | undefined;
46
46
  }>;
47
47
  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"]>;
@@ -177,21 +177,21 @@ export declare const meterSchema: z.ZodObject<{
177
177
  unitAmount: z.ZodNumber;
178
178
  currency: z.ZodEnum<["usd"]>;
179
179
  interval: z.ZodEnum<["month", "year"]>;
180
- aggregation: z.ZodEnum<["sum", "lastDuringPeriod", "lastEver", "max"]>;
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: "lastDuringPeriod" | "sum" | "lastEver" | "max";
187
+ aggregation: "last_during_period" | "sum" | "last_ever" | "max";
188
188
  metadata?: Record<string, string> | undefined;
189
189
  }, {
190
190
  providerPriceId: string;
191
191
  currency: "usd";
192
192
  interval: "month" | "year";
193
193
  unitAmount: number;
194
- aggregation: "lastDuringPeriod" | "sum" | "lastEver" | "max";
194
+ aggregation: "last_during_period" | "sum" | "last_ever" | "max";
195
195
  metadata?: Record<string, string> | undefined;
196
196
  }>>;
197
197
  meterType: z.ZodEnum<["payAsYouGo", "creditGrant"]>;
@@ -206,7 +206,7 @@ export declare const meterSchema: z.ZodObject<{
206
206
  currency: "usd";
207
207
  interval: "month" | "year";
208
208
  unitAmount: number;
209
- aggregation: "lastDuringPeriod" | "sum" | "lastEver" | "max";
209
+ aggregation: "last_during_period" | "sum" | "last_ever" | "max";
210
210
  metadata?: Record<string, string> | undefined;
211
211
  }>>;
212
212
  meterType: "creditGrant" | "payAsYouGo";
@@ -221,7 +221,7 @@ export declare const meterSchema: z.ZodObject<{
221
221
  currency: "usd";
222
222
  interval: "month" | "year";
223
223
  unitAmount: number;
224
- aggregation: "lastDuringPeriod" | "sum" | "lastEver" | "max";
224
+ aggregation: "last_during_period" | "sum" | "last_ever" | "max";
225
225
  metadata?: Record<string, string> | undefined;
226
226
  }>>;
227
227
  meterType: "creditGrant" | "payAsYouGo";
@@ -363,21 +363,21 @@ export declare const billingVersionConfigSchema: z.ZodObject<{
363
363
  unitAmount: z.ZodNumber;
364
364
  currency: z.ZodEnum<["usd"]>;
365
365
  interval: z.ZodEnum<["month", "year"]>;
366
- aggregation: z.ZodEnum<["sum", "lastDuringPeriod", "lastEver", "max"]>;
366
+ aggregation: z.ZodEnum<["sum", "last_during_period", "last_ever", "max"]>;
367
367
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
368
368
  }, "strip", z.ZodTypeAny, {
369
369
  providerPriceId: string;
370
370
  currency: "usd";
371
371
  interval: "month" | "year";
372
372
  unitAmount: number;
373
- aggregation: "lastDuringPeriod" | "sum" | "lastEver" | "max";
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: "lastDuringPeriod" | "sum" | "lastEver" | "max";
380
+ aggregation: "last_during_period" | "sum" | "last_ever" | "max";
381
381
  metadata?: Record<string, string> | undefined;
382
382
  }>>;
383
383
  meterType: z.ZodEnum<["payAsYouGo", "creditGrant"]>;
@@ -392,7 +392,7 @@ export declare const billingVersionConfigSchema: z.ZodObject<{
392
392
  currency: "usd";
393
393
  interval: "month" | "year";
394
394
  unitAmount: number;
395
- aggregation: "lastDuringPeriod" | "sum" | "lastEver" | "max";
395
+ aggregation: "last_during_period" | "sum" | "last_ever" | "max";
396
396
  metadata?: Record<string, string> | undefined;
397
397
  }>>;
398
398
  meterType: "creditGrant" | "payAsYouGo";
@@ -407,7 +407,7 @@ export declare const billingVersionConfigSchema: z.ZodObject<{
407
407
  currency: "usd";
408
408
  interval: "month" | "year";
409
409
  unitAmount: number;
410
- aggregation: "lastDuringPeriod" | "sum" | "lastEver" | "max";
410
+ aggregation: "last_during_period" | "sum" | "last_ever" | "max";
411
411
  metadata?: Record<string, string> | undefined;
412
412
  }>>;
413
413
  meterType: "creditGrant" | "payAsYouGo";
@@ -463,7 +463,7 @@ export declare const billingVersionConfigSchema: z.ZodObject<{
463
463
  currency: "usd";
464
464
  interval: "month" | "year";
465
465
  unitAmount: number;
466
- aggregation: "lastDuringPeriod" | "sum" | "lastEver" | "max";
466
+ aggregation: "last_during_period" | "sum" | "last_ever" | "max";
467
467
  metadata?: Record<string, string> | undefined;
468
468
  }>>;
469
469
  meterType: "creditGrant" | "payAsYouGo";
@@ -519,7 +519,7 @@ export declare const billingVersionConfigSchema: z.ZodObject<{
519
519
  currency: "usd";
520
520
  interval: "month" | "year";
521
521
  unitAmount: number;
522
- aggregation: "lastDuringPeriod" | "sum" | "lastEver" | "max";
522
+ aggregation: "last_during_period" | "sum" | "last_ever" | "max";
523
523
  metadata?: Record<string, string> | undefined;
524
524
  }>>;
525
525
  meterType: "creditGrant" | "payAsYouGo";
@@ -664,21 +664,21 @@ export declare const billingConfigSchema: z.ZodRecord<z.ZodEnum<["v4"]>, z.ZodOb
664
664
  unitAmount: z.ZodNumber;
665
665
  currency: z.ZodEnum<["usd"]>;
666
666
  interval: z.ZodEnum<["month", "year"]>;
667
- aggregation: z.ZodEnum<["sum", "lastDuringPeriod", "lastEver", "max"]>;
667
+ aggregation: z.ZodEnum<["sum", "last_during_period", "last_ever", "max"]>;
668
668
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
669
669
  }, "strip", z.ZodTypeAny, {
670
670
  providerPriceId: string;
671
671
  currency: "usd";
672
672
  interval: "month" | "year";
673
673
  unitAmount: number;
674
- aggregation: "lastDuringPeriod" | "sum" | "lastEver" | "max";
674
+ aggregation: "last_during_period" | "sum" | "last_ever" | "max";
675
675
  metadata?: Record<string, string> | undefined;
676
676
  }, {
677
677
  providerPriceId: string;
678
678
  currency: "usd";
679
679
  interval: "month" | "year";
680
680
  unitAmount: number;
681
- aggregation: "lastDuringPeriod" | "sum" | "lastEver" | "max";
681
+ aggregation: "last_during_period" | "sum" | "last_ever" | "max";
682
682
  metadata?: Record<string, string> | undefined;
683
683
  }>>;
684
684
  meterType: z.ZodEnum<["payAsYouGo", "creditGrant"]>;
@@ -693,7 +693,7 @@ export declare const billingConfigSchema: z.ZodRecord<z.ZodEnum<["v4"]>, z.ZodOb
693
693
  currency: "usd";
694
694
  interval: "month" | "year";
695
695
  unitAmount: number;
696
- aggregation: "lastDuringPeriod" | "sum" | "lastEver" | "max";
696
+ aggregation: "last_during_period" | "sum" | "last_ever" | "max";
697
697
  metadata?: Record<string, string> | undefined;
698
698
  }>>;
699
699
  meterType: "creditGrant" | "payAsYouGo";
@@ -708,7 +708,7 @@ export declare const billingConfigSchema: z.ZodRecord<z.ZodEnum<["v4"]>, z.ZodOb
708
708
  currency: "usd";
709
709
  interval: "month" | "year";
710
710
  unitAmount: number;
711
- aggregation: "lastDuringPeriod" | "sum" | "lastEver" | "max";
711
+ aggregation: "last_during_period" | "sum" | "last_ever" | "max";
712
712
  metadata?: Record<string, string> | undefined;
713
713
  }>>;
714
714
  meterType: "creditGrant" | "payAsYouGo";
@@ -764,7 +764,7 @@ export declare const billingConfigSchema: z.ZodRecord<z.ZodEnum<["v4"]>, z.ZodOb
764
764
  currency: "usd";
765
765
  interval: "month" | "year";
766
766
  unitAmount: number;
767
- aggregation: "lastDuringPeriod" | "sum" | "lastEver" | "max";
767
+ aggregation: "last_during_period" | "sum" | "last_ever" | "max";
768
768
  metadata?: Record<string, string> | undefined;
769
769
  }>>;
770
770
  meterType: "creditGrant" | "payAsYouGo";
@@ -820,7 +820,7 @@ export declare const billingConfigSchema: z.ZodRecord<z.ZodEnum<["v4"]>, z.ZodOb
820
820
  currency: "usd";
821
821
  interval: "month" | "year";
822
822
  unitAmount: number;
823
- aggregation: "lastDuringPeriod" | "sum" | "lastEver" | "max";
823
+ aggregation: "last_during_period" | "sum" | "last_ever" | "max";
824
824
  metadata?: Record<string, string> | undefined;
825
825
  }>>;
826
826
  meterType: "creditGrant" | "payAsYouGo";
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', 'lastDuringPeriod', 'lastEver', 'max']);
9
+ exports.aggregationSchema = zod_1.z.enum(['sum', 'last_during_period', 'last_ever', 'max']);
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(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpinternal/const",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "Shared constants for Skynet billing refactor (vendored copy of upstream packages/const)",
5
5
  "license": "UNLICENSED",
6
6
  "files": [