@bpinternal/const 0.32.0 → 0.34.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.
@@ -1,6 +1,5 @@
1
- export * from './plans';
2
- export * from './addons';
3
- export * from './grants';
1
+ export * from './v4';
2
+ export * from './v5';
4
3
  export * from './schemas';
5
4
  export * from './versions';
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -14,8 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./plans"), exports);
18
- __exportStar(require("./addons"), exports);
19
- __exportStar(require("./grants"), exports);
17
+ __exportStar(require("./v4"), exports);
18
+ __exportStar(require("./v5"), exports);
20
19
  __exportStar(require("./schemas"), exports);
21
20
  __exportStar(require("./versions"), exports);
@@ -0,0 +1,6 @@
1
+ export declare function entitlementsForConversations(conversations: number): {
2
+ incoming_messages_events: number;
3
+ ai_spend: number;
4
+ conversation_sessions: number;
5
+ };
6
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.entitlementsForConversations = entitlementsForConversations;
4
+ const consts_1 = require("../consts");
5
+ function entitlementsForConversations(conversations) {
6
+ return {
7
+ incoming_messages_events: conversations * consts_1.MESSAGES_PER_CONVERSATION,
8
+ ai_spend: conversations * consts_1.AI_SPEND_PER_CONVERSATION,
9
+ conversation_sessions: conversations,
10
+ };
11
+ }
@@ -1,9 +1,9 @@
1
- import { BillingPlanId } from './plans';
2
- import { BillingAddonDefinition } from './schemas';
3
- export type BillingAddonId = keyof typeof addons;
1
+ import { V4BillingPlanId } from './plans';
2
+ import { BillingAddonDefinition } from '../schemas';
3
+ export type BillingAddonId = keyof typeof v4Addons;
4
4
  type BillingAddonPlanPrices = BillingAddonDefinition['prices'];
5
- export declare const constantMonthlyPrice: (amount: number, scope?: BillingPlanId[]) => BillingAddonPlanPrices;
6
- export declare const addons: {
5
+ export declare const constantMonthlyPrice: (amount: number, scope?: V4BillingPlanId[]) => BillingAddonPlanPrices;
6
+ export declare const v4Addons: {
7
7
  readonly conversation_sessions_addon: {
8
8
  readonly id: "conversation_sessions_addon";
9
9
  readonly name: "Add-on - Conversation Sessions";
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addons = exports.constantMonthlyPrice = void 0;
4
- const consts_1 = require("../consts");
5
- const schemas_1 = require("./schemas");
3
+ exports.v4Addons = exports.constantMonthlyPrice = void 0;
4
+ const consts_1 = require("../../consts");
5
+ const schemas_1 = require("../schemas");
6
6
  const constantMonthlyPrice = (amount, scope = ['community', 'plus', 'team', 'enterprise', 'managed']) => {
7
7
  return scope
8
8
  .map((plan) => ({
@@ -17,7 +17,7 @@ const constantMonthlyPrice = (amount, scope = ['community', 'plus', 'team', 'ent
17
17
  };
18
18
  exports.constantMonthlyPrice = constantMonthlyPrice;
19
19
  /* IMPORTANT: the `name` field is used to match existing products in Stripe DO NOT CHANGE THE NAME OF AN EXISTING PRODUCT */
20
- exports.addons = {
20
+ exports.v4Addons = {
21
21
  conversation_sessions_addon: {
22
22
  id: 'conversation_sessions_addon',
23
23
  name: 'Add-on - Conversation Sessions',
@@ -1,5 +1,5 @@
1
- export type GrantId = keyof typeof creditGrants;
2
- export declare const creditGrants: {
1
+ export type GrantId = keyof typeof v4CreditGrants;
2
+ export declare const v4CreditGrants: {
3
3
  readonly ai_spend_credit_grant: {
4
4
  readonly id: "ai_spend_credit_grant";
5
5
  readonly name: "AI Spend - Credit grant";
@@ -17,5 +17,5 @@ export declare const creditGrants: {
17
17
  readonly providerPricingPlanVersionId: "__UNKNOWN_STRIPE_ID__";
18
18
  };
19
19
  };
20
- export type GrantIncrementFeatureId = (typeof creditGrants)[keyof typeof creditGrants]['feature'];
20
+ export type GrantIncrementFeatureId = (typeof v4CreditGrants)[keyof typeof v4CreditGrants]['feature'];
21
21
  //# sourceMappingURL=grants.d.ts.map
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.creditGrants = void 0;
4
- const consts_1 = require("../consts");
5
- const schemas_1 = require("./schemas");
6
- exports.creditGrants = {
3
+ exports.v4CreditGrants = void 0;
4
+ const consts_1 = require("../../consts");
5
+ const schemas_1 = require("../schemas");
6
+ exports.v4CreditGrants = {
7
7
  ai_spend_credit_grant: {
8
8
  id: 'ai_spend_credit_grant',
9
9
  name: 'AI Spend - Credit grant',
@@ -0,0 +1,4 @@
1
+ export * from './addons';
2
+ export * from './grants';
3
+ export * from './plans';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,19 @@
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("./addons"), exports);
18
+ __exportStar(require("./grants"), exports);
19
+ __exportStar(require("./plans"), exports);
@@ -1,5 +1,5 @@
1
- export type BillingPlanId = keyof typeof plans;
2
- export declare const plans: {
1
+ export type V4BillingPlanId = keyof typeof v4Plans;
2
+ export declare const v4Plans: {
3
3
  readonly community: {
4
4
  readonly id: "community";
5
5
  readonly name: "Plan - Free";
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.plans = void 0;
4
- const consts_1 = require("../consts");
5
- const schemas_1 = require("./schemas");
3
+ exports.v4Plans = void 0;
4
+ const consts_1 = require("../../consts");
5
+ const schemas_1 = require("../schemas");
6
6
  const ENTERPRISE_PLAN_FEATURES = {
7
7
  table_rows: 0,
8
8
  bot_count: consts_1.SMALL_UNLIMITED,
@@ -16,7 +16,7 @@ const ENTERPRISE_PLAN_FEATURES = {
16
16
  conversation_sessions: 0,
17
17
  };
18
18
  /* IMPORTANT: the `name` field is used to match existing products in Stripe DO NOT CHANGE THE NAME OF AN EXISTING PRODUCT */
19
- exports.plans = {
19
+ exports.v4Plans = {
20
20
  community: {
21
21
  id: 'community',
22
22
  name: 'Plan - Free',
@@ -0,0 +1,2 @@
1
+ export * from './plans';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,17 @@
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("./plans"), exports);
@@ -0,0 +1,150 @@
1
+ export declare const v5Plans: {
2
+ readonly community: {
3
+ readonly id: "community";
4
+ readonly name: "Plan - Free";
5
+ readonly description: "Free plan for trying things out";
6
+ readonly tierIndex: 0;
7
+ readonly prices: {
8
+ readonly month: {
9
+ readonly amount: -1;
10
+ readonly currency: "usd";
11
+ readonly interval: "month";
12
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
13
+ };
14
+ };
15
+ readonly features: {
16
+ readonly incoming_messages_events: number;
17
+ readonly ai_spend: number;
18
+ readonly conversation_sessions: number;
19
+ readonly table_rows: 1000;
20
+ readonly bot_count: 3;
21
+ readonly collaborator_count: 3;
22
+ readonly file_storage: number;
23
+ readonly vector_db_storage: number;
24
+ readonly saved_versions: 3;
25
+ readonly indexed_file_count: 1000;
26
+ };
27
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
28
+ };
29
+ readonly plus: {
30
+ readonly id: "plus";
31
+ readonly name: "Plan - Plus";
32
+ readonly description: "For growing businesses";
33
+ readonly tierIndex: 1;
34
+ readonly prices: {
35
+ readonly month: {
36
+ readonly amount: 49;
37
+ readonly currency: "usd";
38
+ readonly interval: "month";
39
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
40
+ };
41
+ readonly year: {
42
+ readonly amount: 490;
43
+ readonly currency: "usd";
44
+ readonly interval: "year";
45
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
46
+ };
47
+ };
48
+ readonly features: {
49
+ readonly incoming_messages_events: number;
50
+ readonly ai_spend: number;
51
+ readonly conversation_sessions: number;
52
+ readonly table_rows: 100000;
53
+ readonly bot_count: 5000;
54
+ readonly collaborator_count: 3;
55
+ readonly file_storage: number;
56
+ readonly vector_db_storage: number;
57
+ readonly saved_versions: 50;
58
+ readonly indexed_file_count: 2000;
59
+ };
60
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
61
+ };
62
+ readonly team: {
63
+ readonly id: "team";
64
+ readonly name: "Plan - Team";
65
+ readonly description: "For small teams";
66
+ readonly tierIndex: 2;
67
+ readonly prices: {
68
+ readonly month: {
69
+ readonly amount: 939;
70
+ readonly currency: "usd";
71
+ readonly interval: "month";
72
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
73
+ };
74
+ readonly year: {
75
+ readonly amount: number;
76
+ readonly currency: "usd";
77
+ readonly interval: "year";
78
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
79
+ };
80
+ };
81
+ readonly features: {
82
+ readonly table_rows: 500000;
83
+ readonly bot_count: 5000;
84
+ readonly collaborator_count: 5000;
85
+ readonly file_storage: number;
86
+ readonly vector_db_storage: number;
87
+ readonly saved_versions: 100;
88
+ readonly indexed_file_count: 5000000;
89
+ readonly incoming_messages_events: number;
90
+ readonly ai_spend: number;
91
+ readonly conversation_sessions: 1500;
92
+ };
93
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
94
+ };
95
+ readonly enterprise: {
96
+ readonly id: "enterprise";
97
+ readonly name: "Plan - Enterprise";
98
+ readonly description: "Enterprise license subscription";
99
+ readonly tierIndex: 3;
100
+ readonly prices: {
101
+ readonly month: {
102
+ readonly amount: -1;
103
+ readonly currency: "usd";
104
+ readonly interval: "month";
105
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
106
+ };
107
+ };
108
+ readonly features: {
109
+ table_rows: number;
110
+ bot_count: number;
111
+ collaborator_count: number;
112
+ file_storage: number;
113
+ vector_db_storage: number;
114
+ saved_versions: number;
115
+ indexed_file_count: number;
116
+ incoming_messages_events: number;
117
+ ai_spend: number;
118
+ conversation_sessions: number;
119
+ };
120
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
121
+ };
122
+ readonly managed: {
123
+ readonly id: "managed";
124
+ readonly name: "Plan - Managed";
125
+ readonly description: "Managed license subscription";
126
+ readonly tierIndex: 4;
127
+ readonly prices: {
128
+ readonly month: {
129
+ readonly amount: -1;
130
+ readonly currency: "usd";
131
+ readonly interval: "month";
132
+ readonly providerPriceId: "__UNKNOWN_STRIPE_ID__";
133
+ };
134
+ };
135
+ readonly features: {
136
+ table_rows: number;
137
+ bot_count: number;
138
+ collaborator_count: number;
139
+ file_storage: number;
140
+ vector_db_storage: number;
141
+ saved_versions: number;
142
+ indexed_file_count: number;
143
+ incoming_messages_events: number;
144
+ ai_spend: number;
145
+ conversation_sessions: number;
146
+ };
147
+ readonly providerProductId: "__UNKNOWN_STRIPE_ID__";
148
+ };
149
+ };
150
+ //# sourceMappingURL=plans.d.ts.map
@@ -0,0 +1,99 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.v5Plans = void 0;
37
+ const consts_1 = require("../../consts");
38
+ const schemas_1 = require("../schemas");
39
+ const utils_1 = require("../utils");
40
+ const v4 = __importStar(require("../v4"));
41
+ exports.v5Plans = {
42
+ ...v4.v4Plans,
43
+ community: {
44
+ id: 'community',
45
+ name: 'Plan - Free',
46
+ description: 'Free plan for trying things out',
47
+ tierIndex: 0,
48
+ prices: {
49
+ month: {
50
+ amount: consts_1.FREE_PRICE,
51
+ currency: 'usd',
52
+ interval: 'month',
53
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
54
+ },
55
+ },
56
+ features: {
57
+ table_rows: 1000,
58
+ bot_count: 3,
59
+ collaborator_count: 3,
60
+ file_storage: 100 * consts_1.MB,
61
+ vector_db_storage: 100 * consts_1.MB,
62
+ saved_versions: 3,
63
+ indexed_file_count: 1_000,
64
+ ...(0, utils_1.entitlementsForConversations)(25),
65
+ },
66
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
67
+ },
68
+ plus: {
69
+ id: 'plus',
70
+ name: 'Plan - Plus',
71
+ description: 'For growing businesses',
72
+ tierIndex: 1,
73
+ prices: {
74
+ month: {
75
+ amount: 49,
76
+ currency: 'usd',
77
+ interval: 'month',
78
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
79
+ },
80
+ year: {
81
+ amount: 490,
82
+ currency: 'usd',
83
+ interval: 'year',
84
+ providerPriceId: schemas_1.UNKNOWN_STRIPE_ID,
85
+ },
86
+ },
87
+ features: {
88
+ table_rows: 100_000,
89
+ bot_count: consts_1.SMALL_UNLIMITED,
90
+ collaborator_count: 3,
91
+ file_storage: 10 * consts_1.GB,
92
+ vector_db_storage: 1 * consts_1.GB,
93
+ saved_versions: 50,
94
+ indexed_file_count: 2_000,
95
+ ...(0, utils_1.entitlementsForConversations)(50),
96
+ },
97
+ providerProductId: schemas_1.UNKNOWN_STRIPE_ID,
98
+ },
99
+ };