@iblai/data-layer 1.2.5 → 1.2.7
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/dist/index.d.ts +5283 -3
- package/dist/index.esm.js +361 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +396 -10
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/features/monetization/constants.d.ts +76 -0
- package/dist/src/features/monetization/custom-api-slice.d.ts +5017 -0
- package/dist/src/features/monetization/types.d.ts +224 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/utils/index.d.ts +5 -1
- package/dist/tests/features/monetization/constants.test.d.ts +1 -0
- package/dist/tests/features/monetization/custom-api-slice.test.d.ts +1 -0
- package/dist/tests/features/monetization/types.test.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
export interface StripeConnectStatusResponse {
|
|
2
|
+
has_account: boolean;
|
|
3
|
+
account_id: string;
|
|
4
|
+
onboarding_complete: boolean;
|
|
5
|
+
charges_enabled: boolean;
|
|
6
|
+
payouts_enabled: boolean;
|
|
7
|
+
is_ready_for_payments: boolean;
|
|
8
|
+
commission_percent: {
|
|
9
|
+
mentor: number;
|
|
10
|
+
course: number;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface StripeConnectOnboardArgs {
|
|
14
|
+
platform_key: string;
|
|
15
|
+
return_url: string;
|
|
16
|
+
refresh_url: string;
|
|
17
|
+
business_type: string;
|
|
18
|
+
}
|
|
19
|
+
export interface StripeConnectOnboardResponse {
|
|
20
|
+
account_id: string;
|
|
21
|
+
onboarding_url: string;
|
|
22
|
+
}
|
|
23
|
+
export interface StripeConnectDashboardResponse {
|
|
24
|
+
dashboard_url: string;
|
|
25
|
+
}
|
|
26
|
+
export interface PaywallPrice {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
description: string;
|
|
30
|
+
amount: number;
|
|
31
|
+
currency: string;
|
|
32
|
+
interval: string;
|
|
33
|
+
is_active: boolean;
|
|
34
|
+
features: string[];
|
|
35
|
+
sort_order: number;
|
|
36
|
+
stripe_price_id: string;
|
|
37
|
+
}
|
|
38
|
+
export interface PaywallConfigResponse {
|
|
39
|
+
item_type: string;
|
|
40
|
+
item_id: string;
|
|
41
|
+
item_name: string;
|
|
42
|
+
is_enabled: boolean;
|
|
43
|
+
allow_free_tier: boolean;
|
|
44
|
+
trial_period_days: number;
|
|
45
|
+
grandfathering_strategy: string;
|
|
46
|
+
stripe_product_id: string | null;
|
|
47
|
+
paywall_enabled_at: string | null;
|
|
48
|
+
prices: PaywallPrice[];
|
|
49
|
+
}
|
|
50
|
+
export interface PaywallItemParams {
|
|
51
|
+
platform_key: string;
|
|
52
|
+
item_type: string;
|
|
53
|
+
item_id: string;
|
|
54
|
+
}
|
|
55
|
+
export interface EnablePaywallArgs extends PaywallItemParams {
|
|
56
|
+
is_enabled: boolean;
|
|
57
|
+
allow_free_tier: boolean;
|
|
58
|
+
trial_period_days: number;
|
|
59
|
+
grandfathering_strategy: 'free_forever' | 'require_subscription';
|
|
60
|
+
}
|
|
61
|
+
export interface CreatePriceArgs extends PaywallItemParams {
|
|
62
|
+
name: string;
|
|
63
|
+
amount: number;
|
|
64
|
+
currency?: string;
|
|
65
|
+
interval?: 'month' | 'year' | 'one_time';
|
|
66
|
+
features?: string[];
|
|
67
|
+
description?: string;
|
|
68
|
+
is_active?: boolean;
|
|
69
|
+
sort_order?: number;
|
|
70
|
+
}
|
|
71
|
+
export interface UpdatePriceArgs extends PaywallItemParams {
|
|
72
|
+
price_unique_id: string;
|
|
73
|
+
name?: string;
|
|
74
|
+
amount?: number;
|
|
75
|
+
currency?: string;
|
|
76
|
+
interval?: 'month' | 'year' | 'one_time';
|
|
77
|
+
features?: string[];
|
|
78
|
+
description?: string;
|
|
79
|
+
is_active?: boolean;
|
|
80
|
+
sort_order?: number;
|
|
81
|
+
}
|
|
82
|
+
export interface DeletePriceArgs extends PaywallItemParams {
|
|
83
|
+
price_unique_id: string;
|
|
84
|
+
}
|
|
85
|
+
export interface PublicPricingResponse {
|
|
86
|
+
item_type: string;
|
|
87
|
+
item_id: string;
|
|
88
|
+
item_name: string;
|
|
89
|
+
is_paywalled: boolean;
|
|
90
|
+
allow_free_tier: boolean;
|
|
91
|
+
trial_period_days: number;
|
|
92
|
+
prices: {
|
|
93
|
+
unique_id: string;
|
|
94
|
+
name: string;
|
|
95
|
+
amount: number;
|
|
96
|
+
currency: string;
|
|
97
|
+
interval: string;
|
|
98
|
+
is_active: boolean;
|
|
99
|
+
features: string[];
|
|
100
|
+
}[];
|
|
101
|
+
}
|
|
102
|
+
export interface AccessCheckResponse {
|
|
103
|
+
has_access: boolean;
|
|
104
|
+
item_type: string;
|
|
105
|
+
item_id: string;
|
|
106
|
+
reason: string;
|
|
107
|
+
requires_payment: boolean;
|
|
108
|
+
pricing_available: boolean;
|
|
109
|
+
pricing: {
|
|
110
|
+
item_name: string;
|
|
111
|
+
prices: PaywallPrice[];
|
|
112
|
+
} | null;
|
|
113
|
+
subscription: SubscriptionObject | null;
|
|
114
|
+
}
|
|
115
|
+
export interface UnscopedAccessCheckParams {
|
|
116
|
+
item_type: string;
|
|
117
|
+
item_id: string;
|
|
118
|
+
platform_key: string;
|
|
119
|
+
}
|
|
120
|
+
export interface CheckoutArgs extends PaywallItemParams {
|
|
121
|
+
price_id: string;
|
|
122
|
+
success_url: string;
|
|
123
|
+
cancel_url: string;
|
|
124
|
+
}
|
|
125
|
+
export interface GuestCheckoutArgs extends PaywallItemParams {
|
|
126
|
+
email: string;
|
|
127
|
+
price_id: string;
|
|
128
|
+
success_url: string;
|
|
129
|
+
cancel_url: string;
|
|
130
|
+
}
|
|
131
|
+
export interface CheckoutResponse {
|
|
132
|
+
checkout_url: string;
|
|
133
|
+
session_id: string;
|
|
134
|
+
}
|
|
135
|
+
export interface CancelSubscriptionArgs extends PaywallItemParams {
|
|
136
|
+
return_url?: string;
|
|
137
|
+
}
|
|
138
|
+
export interface CancelSubscriptionResponse {
|
|
139
|
+
unique_id?: string;
|
|
140
|
+
status?: string;
|
|
141
|
+
canceled_at?: string;
|
|
142
|
+
portal_url?: string;
|
|
143
|
+
}
|
|
144
|
+
export interface SubscriptionPrice {
|
|
145
|
+
id: string;
|
|
146
|
+
name: string;
|
|
147
|
+
description: string;
|
|
148
|
+
amount: string;
|
|
149
|
+
currency: string;
|
|
150
|
+
interval: string;
|
|
151
|
+
stripe_price_id: string;
|
|
152
|
+
is_active: boolean;
|
|
153
|
+
features: string[];
|
|
154
|
+
remark: string;
|
|
155
|
+
sort_order: number;
|
|
156
|
+
created_at: string;
|
|
157
|
+
updated_at: string;
|
|
158
|
+
}
|
|
159
|
+
export interface SubscriptionObject {
|
|
160
|
+
unique_id: string;
|
|
161
|
+
user_id?: number;
|
|
162
|
+
username?: string;
|
|
163
|
+
email?: string;
|
|
164
|
+
item_type: string;
|
|
165
|
+
item_id: string;
|
|
166
|
+
item_name: string;
|
|
167
|
+
status: string;
|
|
168
|
+
price: SubscriptionPrice;
|
|
169
|
+
current_period_end: string;
|
|
170
|
+
cancel_at_period_end: boolean;
|
|
171
|
+
is_grandfathered: boolean;
|
|
172
|
+
created_at: string;
|
|
173
|
+
updated_at?: string;
|
|
174
|
+
}
|
|
175
|
+
export interface MySubscriptionsParams {
|
|
176
|
+
platform_key: string;
|
|
177
|
+
status?: string;
|
|
178
|
+
item_type?: string;
|
|
179
|
+
item_name?: string;
|
|
180
|
+
page?: number;
|
|
181
|
+
page_size?: number;
|
|
182
|
+
}
|
|
183
|
+
export interface MySubscriptionsResponse {
|
|
184
|
+
count: number;
|
|
185
|
+
next_page: number | null;
|
|
186
|
+
previous_page: number | null;
|
|
187
|
+
results: SubscriptionObject[];
|
|
188
|
+
}
|
|
189
|
+
export interface ListPaywallsParams {
|
|
190
|
+
platform_key: string;
|
|
191
|
+
item_type?: string;
|
|
192
|
+
is_enabled?: boolean;
|
|
193
|
+
page?: number;
|
|
194
|
+
page_size?: number;
|
|
195
|
+
}
|
|
196
|
+
export interface ListPaywallsResponse {
|
|
197
|
+
count: number;
|
|
198
|
+
next_page: number | null;
|
|
199
|
+
previous_page: number | null;
|
|
200
|
+
results: PaywallConfigResponse[];
|
|
201
|
+
}
|
|
202
|
+
export interface ListSubscribersParams {
|
|
203
|
+
platform_key: string;
|
|
204
|
+
status?: string;
|
|
205
|
+
item_type?: string;
|
|
206
|
+
page?: number;
|
|
207
|
+
page_size?: number;
|
|
208
|
+
}
|
|
209
|
+
export interface ListSubscribersResponse {
|
|
210
|
+
count: number;
|
|
211
|
+
next_page: number | null;
|
|
212
|
+
previous_page: number | null;
|
|
213
|
+
results: (SubscriptionObject & {
|
|
214
|
+
user: unknown;
|
|
215
|
+
})[];
|
|
216
|
+
}
|
|
217
|
+
export interface ListItemSubscribersParams extends PaywallItemParams {
|
|
218
|
+
status?: string;
|
|
219
|
+
}
|
|
220
|
+
export interface RevenueResponse {
|
|
221
|
+
sales_volume: number;
|
|
222
|
+
sales_count: number;
|
|
223
|
+
currency: string;
|
|
224
|
+
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ export * from './features/user-invitations/api-slice';
|
|
|
24
24
|
export * from './features/apps/api-slice';
|
|
25
25
|
export * from './features/billing/api-slice';
|
|
26
26
|
export * from './features/billing/custom-api-slice';
|
|
27
|
+
export * from './features/monetization/custom-api-slice';
|
|
28
|
+
export * from './features/monetization/types';
|
|
27
29
|
export * from './features/stripe/types';
|
|
28
30
|
export * from './features/stripe/api-slice';
|
|
29
31
|
export * from './features/sessions/api-slice';
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { StorageService } from '@data-layer/services/StorageService';
|
|
2
|
-
export declare const initializeDataLayer: (dmUrl: string, lmsUrl: string, legacyLmsUrl: string, storageService: StorageService, httpErrorHandler?: Record<number, (
|
|
2
|
+
export declare const initializeDataLayer: (dmUrl: string, lmsUrl: string, legacyLmsUrl: string, storageService: StorageService, httpErrorHandler?: Record<number, (error?: {
|
|
3
|
+
status: number;
|
|
4
|
+
data?: unknown;
|
|
5
|
+
message?: string;
|
|
6
|
+
}) => void>) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|