@foldspace-fe/casdoor-next-auth-kit 0.1.15 → 0.1.16
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/billing/index.d.ts +18 -3
- package/dist/billing/index.js +22 -2
- package/dist/chunk-46V73LSW.js +494 -0
- package/dist/chunk-46V73LSW.js.map +1 -0
- package/dist/{chunk-CLABP4I6.js → chunk-FW4WDHNS.js} +8 -1
- package/dist/chunk-FW4WDHNS.js.map +1 -0
- package/dist/{chunk-5ISF7ZAG.js → chunk-ZCHLJYLN.js} +14 -43
- package/dist/chunk-ZCHLJYLN.js.map +1 -0
- package/dist/cli.js +20 -5
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +23 -3
- package/dist/react/index.d.ts +23 -3
- package/dist/react/index.js +285 -12
- package/dist/react/index.js.map +1 -1
- package/dist/skills/casdoor-next-auth-kit/SKILL.md +17 -4
- package/dist/types-xgHVGy75.d.ts +895 -0
- package/package.json +4 -3
- package/dist/chunk-5ISF7ZAG.js.map +0 -1
- package/dist/chunk-CLABP4I6.js.map +0 -1
- package/dist/chunk-O3FKI5NT.js +0 -187
- package/dist/chunk-O3FKI5NT.js.map +0 -1
- package/dist/types-DwThfdu-.d.ts +0 -362
package/dist/types-DwThfdu-.d.ts
DELETED
|
@@ -1,362 +0,0 @@
|
|
|
1
|
-
type BillingItemKind = 'subscription' | 'product';
|
|
2
|
-
type BillingInterval = 'month' | 'year';
|
|
3
|
-
interface BillingConversionRule {
|
|
4
|
-
productKey: string;
|
|
5
|
-
kind: 'grant-credits' | 'redeem-credits';
|
|
6
|
-
creditsPerUnit: number;
|
|
7
|
-
minQuantity?: number;
|
|
8
|
-
maxQuantity?: number;
|
|
9
|
-
}
|
|
10
|
-
interface BillingDefaults {
|
|
11
|
-
defaultReturnTo?: string;
|
|
12
|
-
defaultQuantity?: number;
|
|
13
|
-
defaultInterval?: BillingInterval;
|
|
14
|
-
}
|
|
15
|
-
interface BillingItem {
|
|
16
|
-
key: string;
|
|
17
|
-
kind: BillingItemKind;
|
|
18
|
-
title: string;
|
|
19
|
-
description?: string;
|
|
20
|
-
featured?: boolean;
|
|
21
|
-
badge?: string;
|
|
22
|
-
priceLabel?: string;
|
|
23
|
-
priceValue?: number;
|
|
24
|
-
interval?: BillingInterval;
|
|
25
|
-
credits?: number;
|
|
26
|
-
features?: string[];
|
|
27
|
-
backendRef: {
|
|
28
|
-
productId: string;
|
|
29
|
-
planId?: string;
|
|
30
|
-
priceId?: string;
|
|
31
|
-
};
|
|
32
|
-
creditGrant?: {
|
|
33
|
-
creditsPerUnit: number;
|
|
34
|
-
unitName?: string;
|
|
35
|
-
};
|
|
36
|
-
creditRedeem?: {
|
|
37
|
-
productKey: string;
|
|
38
|
-
creditsPerUnit: number;
|
|
39
|
-
};
|
|
40
|
-
metadata?: Record<string, string>;
|
|
41
|
-
}
|
|
42
|
-
interface BillingRuntimeConfig {
|
|
43
|
-
catalogKey: string;
|
|
44
|
-
items: BillingItem[];
|
|
45
|
-
conversionRules?: BillingConversionRule[];
|
|
46
|
-
defaults?: BillingDefaults;
|
|
47
|
-
}
|
|
48
|
-
interface BillingCatalogConfig extends BillingRuntimeConfig {
|
|
49
|
-
title?: string;
|
|
50
|
-
description?: string;
|
|
51
|
-
portalPath?: string;
|
|
52
|
-
successPath?: string;
|
|
53
|
-
cancelPath?: string;
|
|
54
|
-
}
|
|
55
|
-
interface BillingPaymentSuccessContext {
|
|
56
|
-
request: Request;
|
|
57
|
-
url: URL;
|
|
58
|
-
searchParams: URLSearchParams;
|
|
59
|
-
params: Record<string, string>;
|
|
60
|
-
body: unknown;
|
|
61
|
-
paymentId: string | null;
|
|
62
|
-
orderId: string | null;
|
|
63
|
-
redirectTo: string | null;
|
|
64
|
-
}
|
|
65
|
-
type BillingPaymentSuccessHandlerResult = void | null | string | Response | {
|
|
66
|
-
redirectTo?: string | null;
|
|
67
|
-
};
|
|
68
|
-
type BillingPaymentSuccessHandler = (context: BillingPaymentSuccessContext) => BillingPaymentSuccessHandlerResult | Promise<BillingPaymentSuccessHandlerResult>;
|
|
69
|
-
type BillingPaymentFinishedHandler = BillingPaymentSuccessHandler;
|
|
70
|
-
interface BillingPaymentSuccessRouteOptions {
|
|
71
|
-
appUrl?: string;
|
|
72
|
-
fallbackRedirect?: string;
|
|
73
|
-
handler?: BillingPaymentSuccessHandler;
|
|
74
|
-
}
|
|
75
|
-
type BillingPaymentFinishedRouteOptions = BillingPaymentSuccessRouteOptions;
|
|
76
|
-
type BillingActionKind = 'purchase' | 'subscribe' | 'manage' | 'upgrade' | 'cancel';
|
|
77
|
-
interface BillingSubscriptionPurchaseConfig {
|
|
78
|
-
productKey: string;
|
|
79
|
-
productId: string;
|
|
80
|
-
planId?: string;
|
|
81
|
-
priceId?: string;
|
|
82
|
-
interval?: BillingInterval;
|
|
83
|
-
quantity?: number;
|
|
84
|
-
metadata?: Record<string, string>;
|
|
85
|
-
}
|
|
86
|
-
interface BillingProductPurchaseConfig {
|
|
87
|
-
productKey: string;
|
|
88
|
-
productId: string;
|
|
89
|
-
priceId?: string;
|
|
90
|
-
quantity?: number;
|
|
91
|
-
creditGrant?: BillingItem['creditGrant'];
|
|
92
|
-
creditRedeem?: BillingItem['creditRedeem'];
|
|
93
|
-
metadata?: Record<string, string>;
|
|
94
|
-
}
|
|
95
|
-
interface BillingActionPayload {
|
|
96
|
-
key: string;
|
|
97
|
-
kind: BillingActionKind;
|
|
98
|
-
productId?: string;
|
|
99
|
-
planId?: string;
|
|
100
|
-
priceId?: string;
|
|
101
|
-
quantity?: number;
|
|
102
|
-
interval?: BillingInterval;
|
|
103
|
-
subscriptionConfig?: BillingSubscriptionPurchaseConfig;
|
|
104
|
-
productConfig?: BillingProductPurchaseConfig;
|
|
105
|
-
returnTo?: string;
|
|
106
|
-
metadata?: Record<string, string>;
|
|
107
|
-
}
|
|
108
|
-
interface BillingProductSnapshot {
|
|
109
|
-
productKey: string;
|
|
110
|
-
productId?: string;
|
|
111
|
-
title?: string;
|
|
112
|
-
kind: BillingItemKind;
|
|
113
|
-
planId?: string;
|
|
114
|
-
priceId?: string;
|
|
115
|
-
interval?: BillingInterval;
|
|
116
|
-
creditGrant?: BillingItem['creditGrant'];
|
|
117
|
-
creditRedeem?: BillingItem['creditRedeem'];
|
|
118
|
-
metadata?: Record<string, string>;
|
|
119
|
-
}
|
|
120
|
-
interface BillingSubscriptionState {
|
|
121
|
-
subscriptionId?: string;
|
|
122
|
-
planKey?: string;
|
|
123
|
-
planName?: string;
|
|
124
|
-
product?: BillingProductSnapshot;
|
|
125
|
-
status?: 'active' | 'trialing' | 'past_due' | 'canceled' | 'inactive';
|
|
126
|
-
interval?: BillingInterval;
|
|
127
|
-
renewAt?: string;
|
|
128
|
-
cancelAt?: string;
|
|
129
|
-
currentPeriodStart?: string;
|
|
130
|
-
currentPeriodEnd?: string;
|
|
131
|
-
autoRenew?: boolean;
|
|
132
|
-
}
|
|
133
|
-
interface BillingCreditsState {
|
|
134
|
-
balance: number;
|
|
135
|
-
used?: number;
|
|
136
|
-
reserved?: number;
|
|
137
|
-
unit?: string;
|
|
138
|
-
updatedAt?: string;
|
|
139
|
-
}
|
|
140
|
-
interface BillingProductState {
|
|
141
|
-
productKey: string;
|
|
142
|
-
productId?: string;
|
|
143
|
-
title?: string;
|
|
144
|
-
kind: 'product';
|
|
145
|
-
status?: 'active' | 'inactive' | 'archived';
|
|
146
|
-
quantity?: number;
|
|
147
|
-
owned?: boolean;
|
|
148
|
-
creditsBalance?: number;
|
|
149
|
-
creditGrant?: BillingItem['creditGrant'];
|
|
150
|
-
creditRedeem?: BillingItem['creditRedeem'];
|
|
151
|
-
updatedAt?: string;
|
|
152
|
-
}
|
|
153
|
-
interface BillingOrderHistoryItem {
|
|
154
|
-
orderId: string;
|
|
155
|
-
productKey?: string;
|
|
156
|
-
productId?: string;
|
|
157
|
-
productTitle?: string;
|
|
158
|
-
kind?: 'subscription' | 'product';
|
|
159
|
-
quantity?: number;
|
|
160
|
-
amount?: number;
|
|
161
|
-
currency?: string;
|
|
162
|
-
status?: 'pending' | 'paid' | 'failed' | 'canceled' | 'refunded';
|
|
163
|
-
paymentId?: string;
|
|
164
|
-
transactionId?: string;
|
|
165
|
-
createdAt?: string;
|
|
166
|
-
updatedAt?: string;
|
|
167
|
-
}
|
|
168
|
-
interface BillingPaymentHistoryItem {
|
|
169
|
-
paymentId: string;
|
|
170
|
-
orderId?: string;
|
|
171
|
-
productKey?: string;
|
|
172
|
-
amount?: number;
|
|
173
|
-
currency?: string;
|
|
174
|
-
status?: 'pending' | 'paid' | 'failed' | 'canceled' | 'refunded';
|
|
175
|
-
transactionId?: string;
|
|
176
|
-
createdAt?: string;
|
|
177
|
-
updatedAt?: string;
|
|
178
|
-
}
|
|
179
|
-
interface BillingSubscriptionHistoryItem {
|
|
180
|
-
subscriptionId: string;
|
|
181
|
-
product?: BillingProductSnapshot;
|
|
182
|
-
planKey?: string;
|
|
183
|
-
planName?: string;
|
|
184
|
-
status?: 'active' | 'trialing' | 'past_due' | 'canceled' | 'inactive';
|
|
185
|
-
interval?: BillingInterval;
|
|
186
|
-
orderId?: string;
|
|
187
|
-
paymentId?: string;
|
|
188
|
-
startedAt?: string;
|
|
189
|
-
endedAt?: string;
|
|
190
|
-
updatedAt?: string;
|
|
191
|
-
}
|
|
192
|
-
interface BillingEntitlementState {
|
|
193
|
-
features?: string[];
|
|
194
|
-
limits?: Record<string, number>;
|
|
195
|
-
flags?: Record<string, boolean>;
|
|
196
|
-
}
|
|
197
|
-
interface BillingStatusState {
|
|
198
|
-
loading: boolean;
|
|
199
|
-
refreshing: boolean;
|
|
200
|
-
error: string | null;
|
|
201
|
-
lastFetchedAt?: string;
|
|
202
|
-
}
|
|
203
|
-
interface BillingPurchaseStatus {
|
|
204
|
-
actionKey?: string;
|
|
205
|
-
orderId?: string;
|
|
206
|
-
paymentId?: string;
|
|
207
|
-
transactionId?: string;
|
|
208
|
-
status: 'idle' | 'pending' | 'requires_payment' | 'paid' | 'failed' | 'canceled' | 'refunded';
|
|
209
|
-
orderStatus?: string;
|
|
210
|
-
paymentStatus?: string;
|
|
211
|
-
transactionStatus?: string;
|
|
212
|
-
redirectTo?: string;
|
|
213
|
-
updatedAt?: string;
|
|
214
|
-
}
|
|
215
|
-
interface BillingApiClient {
|
|
216
|
-
fetchRuntimeConfig: (catalogKey: string) => Promise<BillingRuntimeConfig | BillingCatalogConfig>;
|
|
217
|
-
fetchSubscription: (args: {
|
|
218
|
-
userId?: string;
|
|
219
|
-
catalogKey?: string;
|
|
220
|
-
}) => Promise<BillingSubscriptionState>;
|
|
221
|
-
fetchSubscriptionHistory: (args: {
|
|
222
|
-
userId?: string;
|
|
223
|
-
catalogKey?: string;
|
|
224
|
-
}) => Promise<BillingSubscriptionHistoryItem[]>;
|
|
225
|
-
fetchProducts: (args: {
|
|
226
|
-
userId?: string;
|
|
227
|
-
catalogKey?: string;
|
|
228
|
-
}) => Promise<BillingProductState[]>;
|
|
229
|
-
fetchOrderHistory: (args: {
|
|
230
|
-
userId?: string;
|
|
231
|
-
catalogKey?: string;
|
|
232
|
-
productKey?: string;
|
|
233
|
-
}) => Promise<BillingOrderHistoryItem[]>;
|
|
234
|
-
fetchPaymentHistory: (args: {
|
|
235
|
-
userId?: string;
|
|
236
|
-
catalogKey?: string;
|
|
237
|
-
}) => Promise<BillingPaymentHistoryItem[]>;
|
|
238
|
-
fetchPurchaseStatus: (args: {
|
|
239
|
-
orderId?: string;
|
|
240
|
-
paymentId?: string;
|
|
241
|
-
transactionId?: string;
|
|
242
|
-
}) => Promise<BillingPurchaseStatus>;
|
|
243
|
-
fetchCredits: (args: {
|
|
244
|
-
userId?: string;
|
|
245
|
-
catalogKey?: string;
|
|
246
|
-
}) => Promise<BillingCreditsState>;
|
|
247
|
-
fetchEntitlements: (args: {
|
|
248
|
-
userId?: string;
|
|
249
|
-
catalogKey?: string;
|
|
250
|
-
}) => Promise<BillingEntitlementState>;
|
|
251
|
-
createAction: (payload: BillingActionPayload) => Promise<{
|
|
252
|
-
redirectTo?: string;
|
|
253
|
-
nextAction?: string;
|
|
254
|
-
status?: 'pending' | 'succeeded' | 'failed';
|
|
255
|
-
}>;
|
|
256
|
-
refresh: (args: {
|
|
257
|
-
userId?: string;
|
|
258
|
-
catalogKey?: string;
|
|
259
|
-
}) => Promise<void>;
|
|
260
|
-
}
|
|
261
|
-
interface BillingLoaders {
|
|
262
|
-
runtimeConfigLoader?: (catalogKey: string) => Promise<BillingRuntimeConfig | BillingCatalogConfig>;
|
|
263
|
-
subscriptionLoader?: (args: {
|
|
264
|
-
userId?: string;
|
|
265
|
-
catalogKey?: string;
|
|
266
|
-
}) => Promise<BillingSubscriptionState>;
|
|
267
|
-
subscriptionHistoryLoader?: (args: {
|
|
268
|
-
userId?: string;
|
|
269
|
-
catalogKey?: string;
|
|
270
|
-
}) => Promise<BillingSubscriptionHistoryItem[]>;
|
|
271
|
-
productsLoader?: (args: {
|
|
272
|
-
userId?: string;
|
|
273
|
-
catalogKey?: string;
|
|
274
|
-
}) => Promise<BillingProductState[]>;
|
|
275
|
-
orderHistoryLoader?: (args: {
|
|
276
|
-
userId?: string;
|
|
277
|
-
catalogKey?: string;
|
|
278
|
-
productKey?: string;
|
|
279
|
-
}) => Promise<BillingOrderHistoryItem[]>;
|
|
280
|
-
paymentHistoryLoader?: (args: {
|
|
281
|
-
userId?: string;
|
|
282
|
-
catalogKey?: string;
|
|
283
|
-
}) => Promise<BillingPaymentHistoryItem[]>;
|
|
284
|
-
purchaseStatusLoader?: (args: {
|
|
285
|
-
orderId?: string;
|
|
286
|
-
paymentId?: string;
|
|
287
|
-
transactionId?: string;
|
|
288
|
-
}) => Promise<BillingPurchaseStatus>;
|
|
289
|
-
creditsLoader?: (args: {
|
|
290
|
-
userId?: string;
|
|
291
|
-
catalogKey?: string;
|
|
292
|
-
}) => Promise<BillingCreditsState>;
|
|
293
|
-
entitlementsLoader?: (args: {
|
|
294
|
-
userId?: string;
|
|
295
|
-
catalogKey?: string;
|
|
296
|
-
}) => Promise<BillingEntitlementState>;
|
|
297
|
-
}
|
|
298
|
-
interface BillingActionExecutor {
|
|
299
|
-
(payload: BillingActionPayload): Promise<{
|
|
300
|
-
redirectTo?: string;
|
|
301
|
-
nextAction?: string;
|
|
302
|
-
status?: 'pending' | 'succeeded' | 'failed';
|
|
303
|
-
}>;
|
|
304
|
-
}
|
|
305
|
-
interface BillingSubscriptionContextValue {
|
|
306
|
-
availablePlans?: BillingItem[];
|
|
307
|
-
subscription?: BillingSubscriptionState;
|
|
308
|
-
subscriptionHistory?: BillingSubscriptionHistoryItem[];
|
|
309
|
-
entitlements?: BillingEntitlementState;
|
|
310
|
-
status?: BillingStatusState;
|
|
311
|
-
}
|
|
312
|
-
interface BillingProductContextValue {
|
|
313
|
-
availableProducts?: BillingItem[];
|
|
314
|
-
products?: BillingProductState[];
|
|
315
|
-
orderHistory?: BillingOrderHistoryItem[];
|
|
316
|
-
paymentHistory?: BillingPaymentHistoryItem[];
|
|
317
|
-
status?: BillingStatusState;
|
|
318
|
-
}
|
|
319
|
-
interface BillingCreditsContextValue {
|
|
320
|
-
credits?: BillingCreditsState;
|
|
321
|
-
status?: BillingStatusState;
|
|
322
|
-
}
|
|
323
|
-
interface BillingCoreContextValue {
|
|
324
|
-
apiClient: BillingApiClient;
|
|
325
|
-
runtimeConfigLoader?: BillingLoaders['runtimeConfigLoader'];
|
|
326
|
-
loaders?: BillingLoaders;
|
|
327
|
-
actionExecutor?: BillingActionExecutor;
|
|
328
|
-
defaults?: BillingDefaults;
|
|
329
|
-
runtimeConfig?: BillingRuntimeConfig;
|
|
330
|
-
runtimeCatalog?: BillingCatalogConfig;
|
|
331
|
-
runtimeConfigLoading: boolean;
|
|
332
|
-
runtimeConfigError: string | null;
|
|
333
|
-
subscription?: BillingSubscriptionState;
|
|
334
|
-
subscriptionHistory?: BillingSubscriptionHistoryItem[];
|
|
335
|
-
products?: BillingProductState[];
|
|
336
|
-
orderHistory?: BillingOrderHistoryItem[];
|
|
337
|
-
paymentHistory?: BillingPaymentHistoryItem[];
|
|
338
|
-
availablePlans?: BillingItem[];
|
|
339
|
-
availableProducts?: BillingItem[];
|
|
340
|
-
credits?: BillingCreditsState;
|
|
341
|
-
entitlements?: BillingEntitlementState;
|
|
342
|
-
purchaseStatus?: BillingPurchaseStatus;
|
|
343
|
-
status: BillingStatusState;
|
|
344
|
-
refresh: () => Promise<void>;
|
|
345
|
-
runAction: (payload: BillingActionPayload) => Promise<{
|
|
346
|
-
redirectTo?: string;
|
|
347
|
-
nextAction?: string;
|
|
348
|
-
status?: 'pending' | 'succeeded' | 'failed';
|
|
349
|
-
}>;
|
|
350
|
-
setRuntimeConfig: (config?: BillingRuntimeConfig) => void;
|
|
351
|
-
setSubscription: (value?: BillingSubscriptionState) => void;
|
|
352
|
-
setSubscriptionHistory: (value?: BillingSubscriptionHistoryItem[]) => void;
|
|
353
|
-
setProducts: (value?: BillingProductState[]) => void;
|
|
354
|
-
setOrderHistory: (value?: BillingOrderHistoryItem[]) => void;
|
|
355
|
-
setPaymentHistory: (value?: BillingPaymentHistoryItem[]) => void;
|
|
356
|
-
setCredits: (value?: BillingCreditsState) => void;
|
|
357
|
-
setEntitlements: (value?: BillingEntitlementState) => void;
|
|
358
|
-
setPurchaseStatus: (status?: BillingPurchaseStatus) => void;
|
|
359
|
-
setStatus: (status: BillingStatusState | ((current: BillingStatusState) => BillingStatusState)) => void;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
export type { BillingPaymentSuccessHandler as A, BillingActionPayload as B, BillingPaymentSuccessHandlerResult as C, BillingPaymentSuccessRouteOptions as D, BillingProductContextValue as E, BillingProductPurchaseConfig as F, BillingSubscriptionContextValue as G, BillingSubscriptionPurchaseConfig as H, BillingItem as a, BillingRuntimeConfig as b, BillingCatalogConfig as c, BillingApiClient as d, BillingLoaders as e, BillingActionExecutor as f, BillingDefaults as g, BillingSubscriptionState as h, BillingSubscriptionHistoryItem as i, BillingProductState as j, BillingOrderHistoryItem as k, BillingPaymentHistoryItem as l, BillingCreditsState as m, BillingEntitlementState as n, BillingStatusState as o, BillingPurchaseStatus as p, BillingProductSnapshot as q, BillingCoreContextValue as r, BillingActionKind as s, BillingConversionRule as t, BillingCreditsContextValue as u, BillingInterval as v, BillingItemKind as w, BillingPaymentFinishedHandler as x, BillingPaymentFinishedRouteOptions as y, BillingPaymentSuccessContext as z };
|