@pdfvector/util 0.0.12 → 0.0.14
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.
- package/.tsc/lib/plan.d.ts +6 -2
- package/.tsc/lib/plan.js +14 -2
- package/CHANGELOG.md +14 -0
- package/package.json +1 -1
package/.tsc/lib/plan.d.ts
CHANGED
|
@@ -5,8 +5,9 @@ export interface PlanDefinition {
|
|
|
5
5
|
annualPrice: number;
|
|
6
6
|
}
|
|
7
7
|
export type PlanKey = "free" | "basic" | "pro";
|
|
8
|
+
export type AnyPlanKey = string;
|
|
8
9
|
export interface Plan {
|
|
9
|
-
key:
|
|
10
|
+
key: AnyPlanKey;
|
|
10
11
|
annual: boolean;
|
|
11
12
|
}
|
|
12
13
|
export interface PlanSchedule {
|
|
@@ -14,11 +15,14 @@ export interface PlanSchedule {
|
|
|
14
15
|
date: Date;
|
|
15
16
|
}
|
|
16
17
|
export interface ChangedPlan {
|
|
17
|
-
key:
|
|
18
|
+
key: AnyPlanKey;
|
|
18
19
|
time: number;
|
|
19
20
|
credits: number;
|
|
20
21
|
}
|
|
22
|
+
export declare const freeMonthlyCredits = 100;
|
|
21
23
|
export declare const planDefinitions: Record<PlanKey, PlanDefinition>;
|
|
22
24
|
export declare const planKeys: [PlanKey, ...PlanKey[]];
|
|
23
25
|
export declare function isPlanKey(value: string): value is PlanKey;
|
|
26
|
+
export declare function capitalizeKey(key: string): string;
|
|
27
|
+
export declare function getPlanLabel(key: string): string;
|
|
24
28
|
export declare function formatPlanLabel(plan: Plan): string;
|
package/.tsc/lib/plan.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
export const freeMonthlyCredits = 100;
|
|
1
2
|
export const planDefinitions = {
|
|
2
3
|
free: {
|
|
3
4
|
label: "Free",
|
|
4
|
-
monthlyCredits:
|
|
5
|
+
monthlyCredits: freeMonthlyCredits,
|
|
5
6
|
monthlyPrice: 0,
|
|
6
7
|
annualPrice: 0,
|
|
7
8
|
},
|
|
@@ -22,8 +23,19 @@ export const planKeys = Object.keys(planDefinitions);
|
|
|
22
23
|
export function isPlanKey(value) {
|
|
23
24
|
return planKeys.includes(value);
|
|
24
25
|
}
|
|
26
|
+
export function capitalizeKey(key) {
|
|
27
|
+
return key.charAt(0).toUpperCase() + key.slice(1);
|
|
28
|
+
}
|
|
29
|
+
export function getPlanLabel(key) {
|
|
30
|
+
if (isPlanKey(key))
|
|
31
|
+
return planDefinitions[key].label;
|
|
32
|
+
if (key.startsWith("enterprise-"))
|
|
33
|
+
return "Enterprise (Custom)";
|
|
34
|
+
return capitalizeKey(key);
|
|
35
|
+
}
|
|
25
36
|
export function formatPlanLabel(plan) {
|
|
26
|
-
const
|
|
37
|
+
const label = getPlanLabel(plan.key);
|
|
38
|
+
const parts = ["the", label];
|
|
27
39
|
if (plan.key !== "free")
|
|
28
40
|
parts.push(plan.annual ? "annual" : "monthly");
|
|
29
41
|
parts.push("plan");
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @pdfvector/util
|
|
2
2
|
|
|
3
|
+
## 0.0.14
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#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
|
|
9
|
+
|
|
10
|
+
## 0.0.13
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
- [#102](https://github.com/phuctm97/pdfvector/pull/102) [`4808c15`](https://github.com/phuctm97/pdfvector/commit/4808c15f69c705d1e335d2a88d652d464398f4fd) Thanks [@khanhduyvt0101](https://github.com/khanhduyvt0101)! - Update pricing flow for enterprise
|
|
16
|
+
|
|
3
17
|
## 0.0.12
|
|
4
18
|
### Patch Changes
|
|
5
19
|
|