@dub/utils 0.1.48 → 0.1.49

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.
Files changed (36) hide show
  1. package/dist/chunk-3SJKMNIJ.mjs +1 -0
  2. package/dist/chunk-4433QRCV.mjs +1 -0
  3. package/dist/chunk-5L2GMUO2.mjs +1 -0
  4. package/dist/chunk-5WC6ZMEN.mjs +1 -0
  5. package/dist/chunk-A4UUQPZU.mjs +1 -0
  6. package/dist/chunk-MJT4YMEY.mjs +1 -0
  7. package/dist/chunk-OMKTUGZY.mjs +1 -0
  8. package/dist/chunk-OP7TRE7R.mjs +1 -0
  9. package/dist/chunk-RW2M3SUO.mjs +1 -0
  10. package/dist/chunk-TEUZHPA7.mjs +1 -0
  11. package/dist/chunk-VELJO2JL.mjs +1 -0
  12. package/dist/chunk-VQWWAPDH.mjs +1 -0
  13. package/dist/constants/index.d.ts +3 -1
  14. package/dist/constants/index.mjs +1 -1
  15. package/dist/constants/pricing/pricing-plan-main-features.d.ts +53 -0
  16. package/dist/constants/pricing/pricing-plan-main-features.mjs +1 -0
  17. package/dist/constants/pricing/pricing-plan-taglines.d.ts +15 -0
  18. package/dist/constants/pricing/pricing-plan-taglines.mjs +1 -0
  19. package/dist/functions/datetime/format-period.mjs +1 -1
  20. package/dist/functions/datetime/index.mjs +1 -1
  21. package/dist/functions/domains.mjs +1 -1
  22. package/dist/functions/index.mjs +1 -1
  23. package/dist/functions/link-constructor.mjs +1 -1
  24. package/dist/index.d.ts +3 -1
  25. package/dist/index.mjs +1 -1
  26. package/dist/pricing-features-868d1d7a.d.ts +159 -0
  27. package/dist/pricing-features-a81a9a3a.d.ts +173 -0
  28. package/dist/pricing-features-ea86e462.d.ts +172 -0
  29. package/dist/pricing-plan-compare-features-cb92e833.d.ts +109 -0
  30. package/dist/pricing-plan-taglines-4ef27f6d.d.ts +173 -0
  31. package/dist/pricing-plan-taglines-c5a50414.d.ts +173 -0
  32. package/dist/pricing-plan-taglines-e6a711b7.d.ts +173 -0
  33. package/dist/pricing-plan-taglines-ff8f644a.d.ts +173 -0
  34. package/dist/pricing-plans-3983dca2.d.ts +172 -0
  35. package/dist/pricing-plans-e87356d8.d.ts +159 -0
  36. package/package.json +1 -1
@@ -0,0 +1,172 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ type PlanFeature = {
4
+ id?: string;
5
+ text: string;
6
+ tooltip?: {
7
+ title: string;
8
+ cta: string;
9
+ href: string;
10
+ };
11
+ };
12
+ type PlanDetails = {
13
+ name: string;
14
+ price: {
15
+ monthly: number | null;
16
+ yearly: number | null;
17
+ ids?: string[];
18
+ };
19
+ limits: {
20
+ links: number;
21
+ clicks: number;
22
+ payouts: number;
23
+ domains: number;
24
+ tags: number;
25
+ folders: number;
26
+ groups: number;
27
+ networkInvites: number;
28
+ users: number;
29
+ ai: number;
30
+ api: number;
31
+ analyticsApi: number;
32
+ retention: string;
33
+ };
34
+ tiers?: {
35
+ [key: number]: {
36
+ price: {
37
+ monthly: number | null;
38
+ yearly: number | null;
39
+ ids: string[];
40
+ };
41
+ limits: {
42
+ links: number;
43
+ clicks: number;
44
+ };
45
+ };
46
+ };
47
+ featureTitle?: string;
48
+ features?: PlanFeature[];
49
+ };
50
+ declare const NEW_BUSINESS_PRICE_IDS: string[];
51
+ declare const PLANS: PlanDetails[];
52
+ declare const FREE_PLAN: PlanDetails;
53
+ declare const PRO_PLAN: PlanDetails;
54
+ declare const BUSINESS_PLAN: PlanDetails;
55
+ declare const ADVANCED_PLAN: PlanDetails;
56
+ declare const ENTERPRISE_PLAN: PlanDetails;
57
+ declare const SELF_SERVE_PAID_PLANS: PlanDetails[];
58
+ declare const FREE_WORKSPACES_LIMIT = 2;
59
+ declare const getPlanAndTierFromPriceId: ({ priceId, }: {
60
+ priceId: string;
61
+ }) => {
62
+ plan: PlanDetails | null;
63
+ planTier: number;
64
+ };
65
+ declare const getPlanDetails: ({ plan, planTier, }: {
66
+ plan: string;
67
+ planTier?: number | undefined;
68
+ }) => PlanDetails;
69
+ declare const getNextPlan: (plan?: string | null) => PlanDetails;
70
+ declare const isDowngradePlan: ({ currentPlan, newPlan, currentTier, newTier, }: {
71
+ currentPlan: string;
72
+ newPlan: string;
73
+ currentTier?: number | undefined;
74
+ newTier?: number | undefined;
75
+ }) => boolean;
76
+ declare const getSuggestedPlan: ({ events, links, suggestFree, }: {
77
+ events?: number | undefined;
78
+ links?: number | undefined;
79
+ suggestFree?: boolean | undefined;
80
+ }) => {
81
+ plan: PlanDetails;
82
+ planTier: number;
83
+ };
84
+ declare const isLegacyBusinessPlan: ({ plan, payoutsLimit, }: {
85
+ plan?: string | undefined;
86
+ payoutsLimit?: number | undefined;
87
+ }) => boolean;
88
+
89
+ type HeroFeature = {
90
+ id?: string;
91
+ text: string;
92
+ disabled?: boolean;
93
+ tooltip?: ReactNode | {
94
+ title: string;
95
+ cta: string;
96
+ href: string;
97
+ };
98
+ };
99
+ declare const PRICING_FEATURES: {
100
+ links: {
101
+ Pro: {
102
+ features: HeroFeature[];
103
+ }[];
104
+ Business: {
105
+ features: HeroFeature[];
106
+ }[];
107
+ Advanced: {
108
+ features: HeroFeature[];
109
+ }[];
110
+ Enterprise: {
111
+ features: HeroFeature[];
112
+ }[];
113
+ };
114
+ partners: {
115
+ Business: {
116
+ features: HeroFeature[];
117
+ }[];
118
+ Advanced: {
119
+ features: (HeroFeature | {
120
+ id: string;
121
+ text: string;
122
+ tooltip: {
123
+ title: string;
124
+ };
125
+ })[];
126
+ }[];
127
+ Enterprise: {
128
+ features: (HeroFeature | {
129
+ id: string;
130
+ text: string;
131
+ tooltip: {
132
+ title: string;
133
+ };
134
+ })[];
135
+ }[];
136
+ };
137
+ };
138
+
139
+ declare const PRICING_PLAN_TAGLINES: {
140
+ links: {
141
+ Pro: string;
142
+ Business: string;
143
+ Advanced: string;
144
+ Enterprise: string;
145
+ };
146
+ partners: {
147
+ Business: string;
148
+ Advanced: string;
149
+ Enterprise: string;
150
+ };
151
+ };
152
+ declare const PRICING_PLAN_COMPARE_FEATURES: {
153
+ category: string;
154
+ href: string;
155
+ features: {
156
+ text: string | ((d: {
157
+ id: string;
158
+ plan: (typeof PLANS)[number];
159
+ }) => ReactNode);
160
+ href?: string;
161
+ check?: boolean | {
162
+ default?: boolean;
163
+ free?: boolean;
164
+ pro?: boolean;
165
+ business?: boolean;
166
+ advanced?: boolean;
167
+ enterprise?: boolean;
168
+ };
169
+ }[];
170
+ }[];
171
+
172
+ export { ADVANCED_PLAN as A, BUSINESS_PLAN as B, ENTERPRISE_PLAN as E, FREE_PLAN as F, NEW_BUSINESS_PRICE_IDS as N, PlanFeature as P, SELF_SERVE_PAID_PLANS as S, PlanDetails as a, PLANS as b, PRO_PLAN as c, FREE_WORKSPACES_LIMIT as d, getPlanDetails as e, getNextPlan as f, getPlanAndTierFromPriceId as g, getSuggestedPlan as h, isDowngradePlan as i, isLegacyBusinessPlan as j, PRICING_FEATURES as k, PRICING_PLAN_TAGLINES as l, PRICING_PLAN_COMPARE_FEATURES as m };
@@ -0,0 +1,159 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ type PlanFeature = {
4
+ id?: string;
5
+ text: string;
6
+ tooltip?: {
7
+ title: string;
8
+ cta: string;
9
+ href: string;
10
+ };
11
+ };
12
+ type PlanDetails = {
13
+ name: string;
14
+ price: {
15
+ monthly: number | null;
16
+ yearly: number | null;
17
+ ids?: string[];
18
+ };
19
+ limits: {
20
+ links: number;
21
+ clicks: number;
22
+ payouts: number;
23
+ domains: number;
24
+ tags: number;
25
+ folders: number;
26
+ groups: number;
27
+ networkInvites: number;
28
+ users: number;
29
+ ai: number;
30
+ api: number;
31
+ analyticsApi: number;
32
+ retention: string;
33
+ };
34
+ tiers?: {
35
+ [key: number]: {
36
+ price: {
37
+ monthly: number | null;
38
+ yearly: number | null;
39
+ ids: string[];
40
+ };
41
+ limits: {
42
+ links: number;
43
+ clicks: number;
44
+ };
45
+ };
46
+ };
47
+ featureTitle?: string;
48
+ features?: PlanFeature[];
49
+ };
50
+ declare const NEW_BUSINESS_PRICE_IDS: string[];
51
+ declare const PLANS: PlanDetails[];
52
+ declare const FREE_PLAN: PlanDetails;
53
+ declare const PRO_PLAN: PlanDetails;
54
+ declare const BUSINESS_PLAN: PlanDetails;
55
+ declare const ADVANCED_PLAN: PlanDetails;
56
+ declare const ENTERPRISE_PLAN: PlanDetails;
57
+ declare const SELF_SERVE_PAID_PLANS: PlanDetails[];
58
+ declare const FREE_WORKSPACES_LIMIT = 2;
59
+ declare const getPlanAndTierFromPriceId: ({ priceId, }: {
60
+ priceId: string;
61
+ }) => {
62
+ plan: PlanDetails | null;
63
+ planTier: number;
64
+ };
65
+ declare const getPlanDetails: ({ plan, planTier, }: {
66
+ plan: string;
67
+ planTier?: number | undefined;
68
+ }) => PlanDetails;
69
+ declare const getNextPlan: (plan?: string | null) => PlanDetails;
70
+ declare const isDowngradePlan: ({ currentPlan, newPlan, currentTier, newTier, }: {
71
+ currentPlan: string;
72
+ newPlan: string;
73
+ currentTier?: number | undefined;
74
+ newTier?: number | undefined;
75
+ }) => boolean;
76
+ declare const getSuggestedPlan: ({ events, links, suggestFree, }: {
77
+ events?: number | undefined;
78
+ links?: number | undefined;
79
+ suggestFree?: boolean | undefined;
80
+ }) => {
81
+ plan: PlanDetails;
82
+ planTier: number;
83
+ };
84
+ declare const isLegacyBusinessPlan: ({ plan, payoutsLimit, }: {
85
+ plan?: string | undefined;
86
+ payoutsLimit?: number | undefined;
87
+ }) => boolean;
88
+
89
+ type HeroFeature = {
90
+ id?: string;
91
+ text: string;
92
+ disabled?: boolean;
93
+ tooltip?: ReactNode | {
94
+ title: string;
95
+ cta: string;
96
+ href: string;
97
+ };
98
+ };
99
+ declare const PRICING_PLAN_MAIN_FEATURES: {
100
+ links: {
101
+ Pro: {
102
+ features: HeroFeature[];
103
+ }[];
104
+ Business: {
105
+ features: HeroFeature[];
106
+ }[];
107
+ Advanced: {
108
+ features: HeroFeature[];
109
+ }[];
110
+ Enterprise: {
111
+ features: HeroFeature[];
112
+ }[];
113
+ };
114
+ partners: {
115
+ Business: {
116
+ features: HeroFeature[];
117
+ }[];
118
+ Advanced: {
119
+ features: (HeroFeature | {
120
+ id: string;
121
+ text: string;
122
+ tooltip: {
123
+ title: string;
124
+ };
125
+ })[];
126
+ }[];
127
+ Enterprise: {
128
+ features: (HeroFeature | {
129
+ id: string;
130
+ text: string;
131
+ tooltip: {
132
+ title: string;
133
+ };
134
+ })[];
135
+ }[];
136
+ };
137
+ };
138
+
139
+ declare const PRICING_PLAN_COMPARE_FEATURES: {
140
+ category: string;
141
+ href: string;
142
+ features: {
143
+ text: string | ((d: {
144
+ id: string;
145
+ plan: (typeof PLANS)[number];
146
+ }) => ReactNode);
147
+ href?: string;
148
+ check?: boolean | {
149
+ default?: boolean;
150
+ free?: boolean;
151
+ pro?: boolean;
152
+ business?: boolean;
153
+ advanced?: boolean;
154
+ enterprise?: boolean;
155
+ };
156
+ }[];
157
+ }[];
158
+
159
+ export { ADVANCED_PLAN as A, BUSINESS_PLAN as B, ENTERPRISE_PLAN as E, FREE_PLAN as F, NEW_BUSINESS_PRICE_IDS as N, PlanFeature as P, SELF_SERVE_PAID_PLANS as S, PlanDetails as a, PLANS as b, PRO_PLAN as c, FREE_WORKSPACES_LIMIT as d, getPlanDetails as e, getNextPlan as f, getPlanAndTierFromPriceId as g, getSuggestedPlan as h, isDowngradePlan as i, isLegacyBusinessPlan as j, PRICING_PLAN_MAIN_FEATURES as k, PRICING_PLAN_COMPARE_FEATURES as l };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dub/utils",
3
3
  "description": "Utility functions and constants for Dub",
4
- "version": "0.1.48",
4
+ "version": "0.1.49",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.mjs",
7
7
  "module": "./dist/index.mjs",