@pdfvector/util 0.0.13 → 0.0.15

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,7 @@ export interface PlanDefinition {
3
3
  monthlyCredits: number;
4
4
  monthlyPrice: number;
5
5
  annualPrice: number;
6
+ maxInstances: number;
6
7
  }
7
8
  export type PlanKey = "free" | "basic" | "pro";
8
9
  export type AnyPlanKey = string;
@@ -24,4 +25,5 @@ export declare const planDefinitions: Record<PlanKey, PlanDefinition>;
24
25
  export declare const planKeys: [PlanKey, ...PlanKey[]];
25
26
  export declare function isPlanKey(value: string): value is PlanKey;
26
27
  export declare function capitalizeKey(key: string): string;
28
+ export declare function getPlanLabel(key: string): string;
27
29
  export declare function formatPlanLabel(plan: Plan): string;
package/.tsc/lib/plan.js CHANGED
@@ -5,18 +5,21 @@ export const planDefinitions = {
5
5
  monthlyCredits: freeMonthlyCredits,
6
6
  monthlyPrice: 0,
7
7
  annualPrice: 0,
8
+ maxInstances: 0,
8
9
  },
9
10
  basic: {
10
11
  label: "Basic",
11
12
  monthlyCredits: 3000,
12
13
  monthlyPrice: 25,
13
14
  annualPrice: 23,
15
+ maxInstances: 0,
14
16
  },
15
17
  pro: {
16
18
  label: "Pro",
17
19
  monthlyCredits: 100000,
18
20
  monthlyPrice: 97,
19
21
  annualPrice: 89,
22
+ maxInstances: 0,
20
23
  },
21
24
  };
22
25
  export const planKeys = Object.keys(planDefinitions);
@@ -26,10 +29,15 @@ export function isPlanKey(value) {
26
29
  export function capitalizeKey(key) {
27
30
  return key.charAt(0).toUpperCase() + key.slice(1);
28
31
  }
32
+ export function getPlanLabel(key) {
33
+ if (isPlanKey(key))
34
+ return planDefinitions[key].label;
35
+ if (key.startsWith("enterprise-"))
36
+ return "Enterprise (Custom)";
37
+ return capitalizeKey(key);
38
+ }
29
39
  export function formatPlanLabel(plan) {
30
- const label = isPlanKey(plan.key)
31
- ? planDefinitions[plan.key].label
32
- : capitalizeKey(plan.key);
40
+ const label = getPlanLabel(plan.key);
33
41
  const parts = ["the", label];
34
42
  if (plan.key !== "free")
35
43
  parts.push(plan.annual ? "annual" : "monthly");
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @pdfvector/util
2
2
 
3
+ ## 0.0.15
4
+ ### Patch Changes
5
+
6
+
7
+
8
+ - [#108](https://github.com/phuctm97/pdfvector/pull/108) [`28b850f`](https://github.com/phuctm97/pdfvector/commit/28b850f3d8cdaa7ec8225cb4e1f1ffcd4a1a23bd) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Add JWT
9
+
10
+ ## 0.0.14
11
+ ### Patch Changes
12
+
13
+
14
+
15
+ - [#106](https://github.com/phuctm97/pdfvector/pull/106) [`8d496e1`](https://github.com/phuctm97/pdfvector/commit/8d496e136d7058dbd6524d6b5c12d716bc7b39a1) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Update plan key display
16
+
3
17
  ## 0.0.13
4
18
  ### Patch Changes
5
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfvector/util",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "type": "module",
5
5
  "main": ".tsc/lib/index.js",
6
6
  "files": [