@bpinternal/const 0.3.7 → 0.3.9

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.
@@ -6,6 +6,7 @@ import type { BillingFeature } from './billing-features';
6
6
  export declare const FREE_PRICE = -1;
7
7
  export declare const BILLING_PLAN_IDS: readonly ["community", "plus", "team", "enterprise"];
8
8
  export type BillingPlanId = (typeof BILLING_PLAN_IDS)[number];
9
+ export type Interval = 'month' | 'year';
9
10
  export type BillingAddonId = '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
11
  export type BillingPlan = {
11
12
  id: BillingPlanId;
@@ -14,7 +15,7 @@ export type BillingPlan = {
14
15
  prices: Array<{
15
16
  price: number;
16
17
  currency: 'usd';
17
- interval: 'month' | 'year';
18
+ interval: Interval;
18
19
  }>;
19
20
  features: Record<BillingFeature, number | boolean>;
20
21
  };
@@ -25,7 +26,7 @@ export type BillingAddon = {
25
26
  prices: Array<{
26
27
  price: number;
27
28
  currency: 'usd';
28
- interval: 'month' | 'year';
29
+ interval: Interval;
29
30
  }>;
30
31
  feature: BillingFeature;
31
32
  increment: number;
@@ -8,6 +8,7 @@ exports.ALLOWED_TRIAL_PLANS = exports.ALLOWED_TRIAL_LENGTHS_IN_DAYS = exports.bi
8
8
  exports.FREE_PRICE = -1;
9
9
  // keep this in order of lowest to highest tier
10
10
  exports.BILLING_PLAN_IDS = ['community', 'plus', 'team', 'enterprise'];
11
+ /* IMPORTANT: the `name` field is used to match existing products in Stripe DO NOT CHANGE THE NAME OF AN EXISTING PRODUCT */
11
12
  exports.billingPlans = {
12
13
  community: {
13
14
  id: 'community',
@@ -128,6 +129,7 @@ exports.billingPlans = {
128
129
  },
129
130
  },
130
131
  };
132
+ /* IMPORTANT: the `name` field is used to match existing products in Stripe DO NOT CHANGE THE NAME OF AN EXISTING PRODUCT */
131
133
  exports.billingAddons = {
132
134
  bot_addon: {
133
135
  id: 'bot_addon',
@@ -2,7 +2,7 @@
2
2
  * Billing versions for v4 billing system
3
3
  * Each version represents a complete billing configuration
4
4
  */
5
- import { billingPlans, billingAddons } from './billing-products';
5
+ import { billingPlans, billingAddons, Interval } from './billing-products';
6
6
  export declare const BILLING_VERSIONS: readonly ["v4"];
7
7
  export type BillingVersionId = (typeof BILLING_VERSIONS)[number];
8
8
  export type BillingVersion = {
@@ -15,14 +15,20 @@ export type BillingVersion = {
15
15
  createdAt: string;
16
16
  stripeMapping?: StripeMapping;
17
17
  };
18
+ export type PlanId = string;
19
+ export type AddonId = string;
18
20
  export type StripeMapping = {
19
- plans: Record<string, {
21
+ plans: Record<PlanId, {
22
+ name: string;
23
+ description: string;
20
24
  productId: string;
21
- priceId: string;
25
+ prices: Record<Interval | string, string>;
22
26
  }>;
23
- addons: Record<string, {
27
+ addons: Record<AddonId, {
28
+ name: string;
29
+ description: string;
24
30
  productId: string;
25
- priceId: string;
31
+ prices: Record<Interval | string, string>;
26
32
  }>;
27
33
  };
28
34
  export declare const billingVersionV4: BillingVersion;
package/dist/quotas.d.ts CHANGED
@@ -31,7 +31,7 @@ export type Quota = {
31
31
  export type QuotaKind = 'workspace' | 'bot';
32
32
  export type QuotaCategory = 'ratelimit' | 'count' | 'calls' | 'timeout' | 'credit';
33
33
  export type QuotaType = (typeof quotaTypes)[number];
34
- export declare const quotaTypes: readonly ["invocation_timeout", "invocation_calls", "storage_count", "bot_count", "knowledgebase_vector_storage", "workspace_ratelimit", "table_row_count", "workspace_member_count", "integrations_owned_count", "ai_spend", "openai_spend", "bing_search_spend", "always_alive"];
34
+ export declare const quotaTypes: readonly ["invocation_timeout", "invocation_calls", "storage_count", "bot_count", "knowledgebase_vector_storage", "workspace_ratelimit", "table_row_count", "workspace_member_count", "integrations_owned_count", "ai_spend", "openai_spend", "bing_search_spend", "always_alive", "indexed_file_count"];
35
35
  export declare const quotaConfigs: {
36
36
  readonly invocation_timeout: {
37
37
  readonly name: "Invocation Timeout";
@@ -139,6 +139,14 @@ export declare const quotaConfigs: {
139
139
  readonly category: "count";
140
140
  readonly trackUsagePerBot: false;
141
141
  };
142
+ readonly indexed_file_count: {
143
+ readonly name: "Indexed File Count";
144
+ readonly description: "Maximum number of files that can be indexed.";
145
+ readonly default: 1000;
146
+ readonly kind: "workspace";
147
+ readonly category: "count";
148
+ readonly trackUsagePerBot: true;
149
+ };
142
150
  };
143
151
  export declare const quotaConfigsV3: {
144
152
  readonly invocation_timeout: {
@@ -247,4 +255,12 @@ export declare const quotaConfigsV3: {
247
255
  readonly category: "count";
248
256
  readonly trackUsagePerBot: false;
249
257
  };
258
+ readonly indexed_file_count: {
259
+ readonly name: "Indexed File Count";
260
+ readonly description: "Maximum number of files that can be indexed.";
261
+ readonly default: 1000;
262
+ readonly kind: "workspace";
263
+ readonly category: "count";
264
+ readonly trackUsagePerBot: true;
265
+ };
250
266
  };
package/dist/quotas.js CHANGED
@@ -15,6 +15,7 @@ exports.quotaTypes = [
15
15
  'openai_spend',
16
16
  'bing_search_spend',
17
17
  'always_alive',
18
+ 'indexed_file_count',
18
19
  ];
19
20
  exports.quotaConfigs = {
20
21
  invocation_timeout: {
@@ -123,6 +124,14 @@ exports.quotaConfigs = {
123
124
  category: 'count',
124
125
  trackUsagePerBot: false,
125
126
  },
127
+ indexed_file_count: {
128
+ name: 'Indexed File Count',
129
+ description: 'Maximum number of files that can be indexed.',
130
+ default: 1_000,
131
+ kind: 'workspace',
132
+ category: 'count',
133
+ trackUsagePerBot: true,
134
+ },
126
135
  };
127
136
  exports.quotaConfigsV3 = {
128
137
  invocation_timeout: {
@@ -231,4 +240,12 @@ exports.quotaConfigsV3 = {
231
240
  category: 'count',
232
241
  trackUsagePerBot: false,
233
242
  },
243
+ indexed_file_count: {
244
+ name: 'Indexed File Count',
245
+ description: 'Maximum number of files that can be indexed.',
246
+ default: 1_000,
247
+ kind: 'workspace',
248
+ category: 'count',
249
+ trackUsagePerBot: true,
250
+ },
234
251
  };
package/package.json CHANGED
@@ -1,21 +1,22 @@
1
1
  {
2
2
  "name": "@bpinternal/const",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "description": "Shared constants for Skynet billing refactor (vendored copy of upstream packages/const)",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "devDependencies": {
12
+ "typescript": "5.5.4"
13
+ },
8
14
  "scripts": {
9
15
  "build": "tsc -b tsconfig.json",
10
16
  "dev": "tsc -w",
11
17
  "clean": "rm -rf dist tsconfig.tsbuildinfo",
12
18
  "check:lint": "eslint --max-warnings 0 --cache --ext .ts,.tsx .",
13
- "fix:lint": "eslint --fix --cache --ext .ts,.tsx ."
14
- },
15
- "files": [
16
- "dist"
17
- ],
18
- "devDependencies": {
19
- "typescript": "^5.3.3"
19
+ "fix:lint": "eslint --fix --cache --ext .ts,.tsx .",
20
+ "check:type": "tsc --noEmit"
20
21
  }
21
- }
22
+ }