better-auth-streampay 2.0.0 → 2.2.0
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/README.md +92 -8
- package/dist/client.cjs +5 -0
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +7 -2
- package/dist/client.d.ts +7 -2
- package/dist/client.js +5 -0
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +718 -176
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.js +718 -176
- package/dist/index.js.map +1 -1
- package/dist/{streampay-CYAHE6Qj.d.cts → streampay-B3vf7Hvq.d.cts} +1435 -154
- package/dist/{streampay-CYAHE6Qj.d.ts → streampay-B3vf7Hvq.d.ts} +1435 -154
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _streamsdk_typescript from '@streamsdk/typescript';
|
|
2
|
-
import { SubscriptionDetailed, CurrencyCode, CreatePaymentLinkDto, PaymentRefundRequest, SubscriptionUpdate, ConsumerCreate, ConsumerResponse, PaginationParams, ConsumerListResponse, ConsumerUpdate, PaymentLinkDetailed, PaymentLinkListResponse, ProductCreate, ProductDto, ProductListResponse, ProductUpdate, CouponCreate, CouponDetailed, CouponListResponse, CouponUpdate, SubscriptionCreate, SubscriptionListResponse, SubscriptionCancel, FreezeSubscriptionCreateRequest, FreezeSubscriptionBase, FreezeListResponse, FreezeSubscriptionUpdateRequest, InvoiceListResponse, InvoiceDetailed, PaymentListResponse, PaymentResponse } from '@streamsdk/typescript';
|
|
2
|
+
import { SubscriptionDetailed, CurrencyCode, CreatePaymentLinkDto, PaymentRefundRequest, SubscriptionUpdate, ConsumerCreate, ConsumerResponse, PaginationParams, ConsumerListResponse, ConsumerUpdate, PaymentLinkDetailed, PaymentLinkListResponse, UpdatePaymentLinkStatusDto, ProductCreate, ProductDto, ProductListResponse, ProductUpdate, CouponCreate, CouponDetailed, CouponListResponse, CouponUpdate, SubscriptionCreate, SubscriptionListResponse, SubscriptionCancel, FreezeSubscriptionCreateRequest, FreezeSubscriptionBase, FreezeListResponse, FreezeSubscriptionUpdateRequest, InvoiceListResponse, InvoiceDetailed, PaymentListResponse, PaymentResponse } from '@streamsdk/typescript';
|
|
3
3
|
import * as better_auth from 'better-auth';
|
|
4
4
|
import { GenericEndpointContext, User, UnionToIntersection } from 'better-auth';
|
|
5
5
|
import * as zod from 'zod';
|
|
@@ -17,6 +17,8 @@ declare const $ERROR_CODES: {
|
|
|
17
17
|
NOT_FOUND: ErrorCodeEntry<"NOT_FOUND">;
|
|
18
18
|
VALIDATION_ERROR: ErrorCodeEntry<"VALIDATION_ERROR">;
|
|
19
19
|
CONSUMER_DUPLICATE: ErrorCodeEntry<"CONSUMER_DUPLICATE">;
|
|
20
|
+
STREAMPAY_CONSUMER_LINK_CONFLICT: ErrorCodeEntry<"STREAMPAY_CONSUMER_LINK_CONFLICT">;
|
|
21
|
+
STREAMPAY_CONSUMER_LINK_WRITE_FAILED: ErrorCodeEntry<"STREAMPAY_CONSUMER_LINK_WRITE_FAILED">;
|
|
20
22
|
CONSUMER_HAS_ONGOING_ACTIVITY: ErrorCodeEntry<"CONSUMER_HAS_ONGOING_ACTIVITY">;
|
|
21
23
|
INVOICE_INVALID_STATE: ErrorCodeEntry<"INVOICE_INVALID_STATE">;
|
|
22
24
|
PAYMENT_DUPLICATE: ErrorCodeEntry<"PAYMENT_DUPLICATE">;
|
|
@@ -28,6 +30,7 @@ declare const $ERROR_CODES: {
|
|
|
28
30
|
PAYMENT_METHOD_INVALID: ErrorCodeEntry<"PAYMENT_METHOD_INVALID">;
|
|
29
31
|
PRODUCT_LOCKED: ErrorCodeEntry<"PRODUCT_LOCKED">;
|
|
30
32
|
COUPON_LOCKED: ErrorCodeEntry<"COUPON_LOCKED">;
|
|
33
|
+
CHECKOUT_CLIENT_FIELDS_FORBIDDEN: ErrorCodeEntry<"CHECKOUT_CLIENT_FIELDS_FORBIDDEN">;
|
|
31
34
|
SUBSCRIPTION_NOT_FOUND: ErrorCodeEntry<"SUBSCRIPTION_NOT_FOUND">;
|
|
32
35
|
SUBSCRIPTION_PLAN_NOT_FOUND: ErrorCodeEntry<"SUBSCRIPTION_PLAN_NOT_FOUND">;
|
|
33
36
|
SUBSCRIPTION_ALREADY_ACTIVE: ErrorCodeEntry<"SUBSCRIPTION_ALREADY_ACTIVE">;
|
|
@@ -37,6 +40,8 @@ declare const $ERROR_CODES: {
|
|
|
37
40
|
SUBSCRIPTION_EXPIRED: ErrorCodeEntry<"SUBSCRIPTION_EXPIRED">;
|
|
38
41
|
SUBSCRIPTION_ALREADY_SCHEDULED_CANCEL: ErrorCodeEntry<"SUBSCRIPTION_ALREADY_SCHEDULED_CANCEL">;
|
|
39
42
|
SUBSCRIPTION_ALREADY_ON_PLAN: ErrorCodeEntry<"SUBSCRIPTION_ALREADY_ON_PLAN">;
|
|
43
|
+
SUBSCRIPTION_SEAT_COUNT_INVALID: ErrorCodeEntry<"SUBSCRIPTION_SEAT_COUNT_INVALID">;
|
|
44
|
+
SUBSCRIPTION_SEAT_CHANGE_ALREADY_SCHEDULED: ErrorCodeEntry<"SUBSCRIPTION_SEAT_CHANGE_ALREADY_SCHEDULED">;
|
|
40
45
|
SUBSCRIPTION_IMMEDIATE_CANCEL_UNSUPPORTED: ErrorCodeEntry<"SUBSCRIPTION_IMMEDIATE_CANCEL_UNSUPPORTED">;
|
|
41
46
|
SUBSCRIPTION_PERIOD_END_CANCEL_UNSUPPORTED: ErrorCodeEntry<"SUBSCRIPTION_PERIOD_END_CANCEL_UNSUPPORTED">;
|
|
42
47
|
SUBSCRIPTION_PLAN_GROUP_MISMATCH: ErrorCodeEntry<"SUBSCRIPTION_PLAN_GROUP_MISMATCH">;
|
|
@@ -152,10 +157,22 @@ type StreamPayWebhookPayload<TEvent extends StreamPayEventType = StreamPayEventT
|
|
|
152
157
|
type SubscriptionRecurringInterval = NonNullable<SubscriptionDetailed["recurring_interval"]>;
|
|
153
158
|
type SubscriptionBillingStatus = "current" | "past_due";
|
|
154
159
|
type SubscriptionReferenceType = "user" | "organization" | "custom";
|
|
160
|
+
/** Controls per-seat checkout without conflating billed seats with entitlement limits. */
|
|
161
|
+
interface StreamPaySeatBilling {
|
|
162
|
+
/** Initial quantity when an upgrade request omits `seats`. Defaults to `minimum`, then 1. */
|
|
163
|
+
default?: number;
|
|
164
|
+
/** Smallest allowed seat count. Defaults to 1. */
|
|
165
|
+
minimum?: number;
|
|
166
|
+
/** Largest allowed seat count. Omit for no application-level maximum. */
|
|
167
|
+
maximum?: number;
|
|
168
|
+
/** Lets the customer edit quantity on StreamPay's hosted checkout. Defaults to false. */
|
|
169
|
+
customerEditable?: boolean;
|
|
170
|
+
}
|
|
155
171
|
/** `productId` must reference a recurring StreamPay product matching `billingInterval`. */
|
|
156
172
|
interface StreamPayPlan<Limits extends Record<string, unknown> = Record<string, unknown>> {
|
|
157
173
|
name: string;
|
|
158
174
|
productId: string;
|
|
175
|
+
/** Price for one seat/item in the currency's smallest unit. */
|
|
159
176
|
priceInSmallestUnit: number;
|
|
160
177
|
currency?: CreatePaymentLinkDto["currency"];
|
|
161
178
|
version?: string;
|
|
@@ -163,6 +180,7 @@ interface StreamPayPlan<Limits extends Record<string, unknown> = Record<string,
|
|
|
163
180
|
billingIntervalCount?: number;
|
|
164
181
|
trialPeriodDays?: number;
|
|
165
182
|
group?: string;
|
|
183
|
+
seatBilling?: StreamPaySeatBilling;
|
|
166
184
|
limits?: Limits;
|
|
167
185
|
}
|
|
168
186
|
type StreamPayPlanLike = StreamPayPlan<Record<string, unknown>>;
|
|
@@ -179,6 +197,8 @@ interface Subscription {
|
|
|
179
197
|
planVersion: string | null;
|
|
180
198
|
productId: string | null;
|
|
181
199
|
group: string | null;
|
|
200
|
+
/** Authoritative quantity for the configured plan product. Legacy rows default to 1. */
|
|
201
|
+
seats: number;
|
|
182
202
|
amountInSmallestUnit: number | null;
|
|
183
203
|
originalAmountInSmallestUnit: number | null;
|
|
184
204
|
currency: CurrencyCode | null;
|
|
@@ -199,6 +219,9 @@ interface Subscription {
|
|
|
199
219
|
pendingPlan: string | null;
|
|
200
220
|
pendingProductId: string | null;
|
|
201
221
|
pendingPlanEffectiveAt: Date | null;
|
|
222
|
+
/** Seat count that StreamPay will apply with the pending change, if any. */
|
|
223
|
+
pendingSeats: number | null;
|
|
224
|
+
pendingSeatsEffectiveAt: Date | null;
|
|
202
225
|
endedAt: Date | null;
|
|
203
226
|
frozenAt: Date | null;
|
|
204
227
|
freezeEndAt: Date | null;
|
|
@@ -236,7 +259,7 @@ interface AuthorizeReferenceContext {
|
|
|
236
259
|
user: StreamPaySessionUser;
|
|
237
260
|
referenceId: string;
|
|
238
261
|
referenceType: SubscriptionReferenceType;
|
|
239
|
-
action: "upgrade" | "cancel" | "uncancel" | "freeze" | "unfreeze" | "cancel-freeze" | "read" | "change-plan" | "cancel-plan-change";
|
|
262
|
+
action: "upgrade" | "cancel" | "uncancel" | "freeze" | "unfreeze" | "cancel-freeze" | "read" | "change-plan" | "update-seats" | "cancel-plan-change";
|
|
240
263
|
}
|
|
241
264
|
interface TrialEligibilityContext {
|
|
242
265
|
user: StreamPaySessionUser;
|
|
@@ -395,6 +418,7 @@ declare function subscriptions(subsOptions: SubscriptionsOptions): (options: Str
|
|
|
395
418
|
method: "POST";
|
|
396
419
|
body: zod.ZodObject<{
|
|
397
420
|
plan: zod.ZodString;
|
|
421
|
+
seats: zod.ZodOptional<zod.ZodNumber>;
|
|
398
422
|
referenceId: zod.ZodOptional<zod.ZodString>;
|
|
399
423
|
referenceType: zod.ZodOptional<zod.ZodEnum<{
|
|
400
424
|
custom: "custom";
|
|
@@ -403,7 +427,7 @@ declare function subscriptions(subsOptions: SubscriptionsOptions): (options: Str
|
|
|
403
427
|
}>>;
|
|
404
428
|
successUrl: zod.ZodOptional<zod.ZodString>;
|
|
405
429
|
failureUrl: zod.ZodOptional<zod.ZodString>;
|
|
406
|
-
}, zod_v4_core.$
|
|
430
|
+
}, zod_v4_core.$strict>;
|
|
407
431
|
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
408
432
|
session: {
|
|
409
433
|
session: Record<string, any> & {
|
|
@@ -434,6 +458,7 @@ declare function subscriptions(subsOptions: SubscriptionsOptions): (options: Str
|
|
|
434
458
|
reused: boolean;
|
|
435
459
|
status: string;
|
|
436
460
|
plan: string;
|
|
461
|
+
seats: number;
|
|
437
462
|
}>;
|
|
438
463
|
subscriptionSuccess: better_auth.StrictEndpoint<"/subscription/success", {
|
|
439
464
|
method: "GET";
|
|
@@ -719,6 +744,7 @@ declare function subscriptions(subsOptions: SubscriptionsOptions): (options: Str
|
|
|
719
744
|
body: zod.ZodObject<{
|
|
720
745
|
subscriptionId: zod.ZodString;
|
|
721
746
|
plan: zod.ZodString;
|
|
747
|
+
seats: zod.ZodOptional<zod.ZodNumber>;
|
|
722
748
|
}, zod_v4_core.$strict>;
|
|
723
749
|
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
724
750
|
session: {
|
|
@@ -747,6 +773,7 @@ declare function subscriptions(subsOptions: SubscriptionsOptions): (options: Str
|
|
|
747
773
|
mode: string;
|
|
748
774
|
subscriptionId: string;
|
|
749
775
|
plan: string;
|
|
776
|
+
seats: number;
|
|
750
777
|
effectiveAt: string | null;
|
|
751
778
|
pendingChange: {
|
|
752
779
|
id?: string;
|
|
@@ -790,6 +817,7 @@ declare function subscriptions(subsOptions: SubscriptionsOptions): (options: Str
|
|
|
790
817
|
mode: string;
|
|
791
818
|
subscriptionId: string;
|
|
792
819
|
plan: string;
|
|
820
|
+
seats: number;
|
|
793
821
|
effectiveAt: string | null;
|
|
794
822
|
pendingChange: {
|
|
795
823
|
id?: string;
|
|
@@ -1047,11 +1075,12 @@ declare function subscriptions(subsOptions: SubscriptionsOptions): (options: Str
|
|
|
1047
1075
|
};
|
|
1048
1076
|
reused: boolean;
|
|
1049
1077
|
}>;
|
|
1050
|
-
|
|
1078
|
+
updateSubscriptionSeats: better_auth.StrictEndpoint<"/subscription/update-seats", {
|
|
1051
1079
|
method: "POST";
|
|
1052
1080
|
body: zod.ZodObject<{
|
|
1053
1081
|
subscriptionId: zod.ZodString;
|
|
1054
|
-
|
|
1082
|
+
seats: zod.ZodNumber;
|
|
1083
|
+
}, zod_v4_core.$strict>;
|
|
1055
1084
|
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
1056
1085
|
session: {
|
|
1057
1086
|
session: Record<string, any> & {
|
|
@@ -1076,7 +1105,97 @@ declare function subscriptions(subsOptions: SubscriptionsOptions): (options: Str
|
|
|
1076
1105
|
};
|
|
1077
1106
|
}>)[];
|
|
1078
1107
|
}, {
|
|
1079
|
-
|
|
1108
|
+
mode: string;
|
|
1109
|
+
subscriptionId: string;
|
|
1110
|
+
seats: number;
|
|
1111
|
+
effectiveAt: string | null;
|
|
1112
|
+
pendingChange: {
|
|
1113
|
+
id?: string;
|
|
1114
|
+
effective_at?: string;
|
|
1115
|
+
invoice_was_reissued?: boolean;
|
|
1116
|
+
target_items?: {
|
|
1117
|
+
product_id?: string;
|
|
1118
|
+
product_name?: string;
|
|
1119
|
+
quantity?: number;
|
|
1120
|
+
original_amount?: string;
|
|
1121
|
+
discounted_amount?: string;
|
|
1122
|
+
}[];
|
|
1123
|
+
target_subscription_coupon_ids?: string[];
|
|
1124
|
+
target_recurring_interval?: "WEEK" | "MONTH" | "QUARTER" | "YEAR";
|
|
1125
|
+
target_recurring_interval_count?: number;
|
|
1126
|
+
target_amount?: string;
|
|
1127
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
1128
|
+
current_amount?: string;
|
|
1129
|
+
delta_amount?: string;
|
|
1130
|
+
delta_amount_per_month?: string | null;
|
|
1131
|
+
changes?: {
|
|
1132
|
+
kind?: "PRODUCT_ADDED" | "PRODUCT_REMOVED" | "PRODUCT_REPLACED" | "QUANTITY_DECREASED" | "QUANTITY_INCREASED" | "COUPON_ADDED" | "COUPON_REMOVED" | "INTERVAL_CHANGED";
|
|
1133
|
+
label?: string;
|
|
1134
|
+
product_id?: string | null;
|
|
1135
|
+
from_value?: string | null;
|
|
1136
|
+
to_value?: string | null;
|
|
1137
|
+
}[];
|
|
1138
|
+
next_invoice_preview?: {
|
|
1139
|
+
period_start?: string;
|
|
1140
|
+
period_end?: string;
|
|
1141
|
+
issue_at?: string;
|
|
1142
|
+
due_at?: string;
|
|
1143
|
+
subtotal?: string;
|
|
1144
|
+
discount_total?: string;
|
|
1145
|
+
total_amount?: string;
|
|
1146
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
1147
|
+
};
|
|
1148
|
+
};
|
|
1149
|
+
reused: boolean;
|
|
1150
|
+
} | {
|
|
1151
|
+
mode: string;
|
|
1152
|
+
subscriptionId: string;
|
|
1153
|
+
seats: number;
|
|
1154
|
+
effectiveAt: null;
|
|
1155
|
+
pendingChange: null;
|
|
1156
|
+
reused: boolean;
|
|
1157
|
+
} | {
|
|
1158
|
+
mode: string;
|
|
1159
|
+
subscriptionId: string;
|
|
1160
|
+
seats: number;
|
|
1161
|
+
effectiveAt: string | null;
|
|
1162
|
+
pendingChange: {
|
|
1163
|
+
id?: string;
|
|
1164
|
+
effective_at?: string;
|
|
1165
|
+
invoice_was_reissued?: boolean;
|
|
1166
|
+
target_items?: {
|
|
1167
|
+
product_id?: string;
|
|
1168
|
+
product_name?: string;
|
|
1169
|
+
quantity?: number;
|
|
1170
|
+
original_amount?: string;
|
|
1171
|
+
discounted_amount?: string;
|
|
1172
|
+
}[];
|
|
1173
|
+
target_subscription_coupon_ids?: string[];
|
|
1174
|
+
target_recurring_interval?: "WEEK" | "MONTH" | "QUARTER" | "YEAR";
|
|
1175
|
+
target_recurring_interval_count?: number;
|
|
1176
|
+
target_amount?: string;
|
|
1177
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
1178
|
+
current_amount?: string;
|
|
1179
|
+
delta_amount?: string;
|
|
1180
|
+
delta_amount_per_month?: string | null;
|
|
1181
|
+
changes?: {
|
|
1182
|
+
kind?: "PRODUCT_ADDED" | "PRODUCT_REMOVED" | "PRODUCT_REPLACED" | "QUANTITY_DECREASED" | "QUANTITY_INCREASED" | "COUPON_ADDED" | "COUPON_REMOVED" | "INTERVAL_CHANGED";
|
|
1183
|
+
label?: string;
|
|
1184
|
+
product_id?: string | null;
|
|
1185
|
+
from_value?: string | null;
|
|
1186
|
+
to_value?: string | null;
|
|
1187
|
+
}[];
|
|
1188
|
+
next_invoice_preview?: {
|
|
1189
|
+
period_start?: string;
|
|
1190
|
+
period_end?: string;
|
|
1191
|
+
issue_at?: string;
|
|
1192
|
+
due_at?: string;
|
|
1193
|
+
subtotal?: string;
|
|
1194
|
+
discount_total?: string;
|
|
1195
|
+
total_amount?: string;
|
|
1196
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
1197
|
+
};
|
|
1198
|
+
} | null;
|
|
1080
1199
|
subscription: {
|
|
1081
1200
|
created_at?: string;
|
|
1082
1201
|
updated_at?: string | null;
|
|
@@ -1294,8 +1413,9 @@ declare function subscriptions(subsOptions: SubscriptionsOptions): (options: Str
|
|
|
1294
1413
|
readonly amount_in_smallest_unit?: number;
|
|
1295
1414
|
readonly original_amount_in_smallest_unit?: number;
|
|
1296
1415
|
};
|
|
1416
|
+
reused: boolean;
|
|
1297
1417
|
}>;
|
|
1298
|
-
|
|
1418
|
+
cancelSubscriptionPlanChange: better_auth.StrictEndpoint<"/subscription/change-plan/cancel", {
|
|
1299
1419
|
method: "POST";
|
|
1300
1420
|
body: zod.ZodObject<{
|
|
1301
1421
|
subscriptionId: zod.ZodString;
|
|
@@ -1324,7 +1444,8 @@ declare function subscriptions(subsOptions: SubscriptionsOptions): (options: Str
|
|
|
1324
1444
|
};
|
|
1325
1445
|
}>)[];
|
|
1326
1446
|
}, {
|
|
1327
|
-
|
|
1447
|
+
canceled: boolean;
|
|
1448
|
+
reused: boolean;
|
|
1328
1449
|
subscription: {
|
|
1329
1450
|
created_at?: string;
|
|
1330
1451
|
updated_at?: string | null;
|
|
@@ -1543,84 +1664,10 @@ declare function subscriptions(subsOptions: SubscriptionsOptions): (options: Str
|
|
|
1543
1664
|
readonly original_amount_in_smallest_unit?: number;
|
|
1544
1665
|
};
|
|
1545
1666
|
}>;
|
|
1546
|
-
|
|
1547
|
-
method: "POST";
|
|
1548
|
-
body: zod.ZodObject<{
|
|
1549
|
-
subscriptionId: zod.ZodString;
|
|
1550
|
-
freezeStartDatetime: zod.ZodString;
|
|
1551
|
-
freezeEndDatetime: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
1552
|
-
notes: zod.ZodOptional<zod.ZodString>;
|
|
1553
|
-
}, zod_v4_core.$strip>;
|
|
1554
|
-
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
1555
|
-
session: {
|
|
1556
|
-
session: Record<string, any> & {
|
|
1557
|
-
id: string;
|
|
1558
|
-
createdAt: Date;
|
|
1559
|
-
updatedAt: Date;
|
|
1560
|
-
userId: string;
|
|
1561
|
-
expiresAt: Date;
|
|
1562
|
-
token: string;
|
|
1563
|
-
ipAddress?: string | null | undefined;
|
|
1564
|
-
userAgent?: string | null | undefined;
|
|
1565
|
-
};
|
|
1566
|
-
user: Record<string, any> & {
|
|
1567
|
-
id: string;
|
|
1568
|
-
createdAt: Date;
|
|
1569
|
-
updatedAt: Date;
|
|
1570
|
-
email: string;
|
|
1571
|
-
emailVerified: boolean;
|
|
1572
|
-
name: string;
|
|
1573
|
-
image?: string | null | undefined;
|
|
1574
|
-
};
|
|
1575
|
-
};
|
|
1576
|
-
}>)[];
|
|
1577
|
-
}, {
|
|
1578
|
-
created_at?: string;
|
|
1579
|
-
updated_at?: string | null;
|
|
1580
|
-
id?: string;
|
|
1581
|
-
freeze_start_datetime?: string;
|
|
1582
|
-
freeze_end_datetime?: string | null;
|
|
1583
|
-
notes?: string | null;
|
|
1584
|
-
subscription_id?: string;
|
|
1585
|
-
invoice_id?: string;
|
|
1586
|
-
duration?: number | null;
|
|
1587
|
-
}>;
|
|
1588
|
-
unfreezeSubscription: better_auth.StrictEndpoint<"/subscription/unfreeze", {
|
|
1589
|
-
method: "POST";
|
|
1590
|
-
body: zod.ZodObject<{
|
|
1591
|
-
subscriptionId: zod.ZodString;
|
|
1592
|
-
}, zod_v4_core.$strip>;
|
|
1593
|
-
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
1594
|
-
session: {
|
|
1595
|
-
session: Record<string, any> & {
|
|
1596
|
-
id: string;
|
|
1597
|
-
createdAt: Date;
|
|
1598
|
-
updatedAt: Date;
|
|
1599
|
-
userId: string;
|
|
1600
|
-
expiresAt: Date;
|
|
1601
|
-
token: string;
|
|
1602
|
-
ipAddress?: string | null | undefined;
|
|
1603
|
-
userAgent?: string | null | undefined;
|
|
1604
|
-
};
|
|
1605
|
-
user: Record<string, any> & {
|
|
1606
|
-
id: string;
|
|
1607
|
-
createdAt: Date;
|
|
1608
|
-
updatedAt: Date;
|
|
1609
|
-
email: string;
|
|
1610
|
-
emailVerified: boolean;
|
|
1611
|
-
name: string;
|
|
1612
|
-
image?: string | null | undefined;
|
|
1613
|
-
};
|
|
1614
|
-
};
|
|
1615
|
-
}>)[];
|
|
1616
|
-
}, {
|
|
1617
|
-
unfrozen: boolean;
|
|
1618
|
-
}>;
|
|
1619
|
-
cancelSubscriptionFreeze: better_auth.StrictEndpoint<"/subscription/freeze/cancel", {
|
|
1667
|
+
cancelSubscriptionPendingChange: better_auth.StrictEndpoint<"/subscription/pending-change/cancel", {
|
|
1620
1668
|
method: "POST";
|
|
1621
1669
|
body: zod.ZodObject<{
|
|
1622
1670
|
subscriptionId: zod.ZodString;
|
|
1623
|
-
freezeId: zod.ZodString;
|
|
1624
1671
|
}, zod_v4_core.$strip>;
|
|
1625
1672
|
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
1626
1673
|
session: {
|
|
@@ -1647,74 +1694,648 @@ declare function subscriptions(subsOptions: SubscriptionsOptions): (options: Str
|
|
|
1647
1694
|
}>)[];
|
|
1648
1695
|
}, {
|
|
1649
1696
|
canceled: boolean;
|
|
1650
|
-
freezeId: string;
|
|
1651
1697
|
reused: boolean;
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
ipAddress?: string | null | undefined;
|
|
1673
|
-
userAgent?: string | null | undefined;
|
|
1674
|
-
};
|
|
1675
|
-
user: Record<string, any> & {
|
|
1676
|
-
id: string;
|
|
1677
|
-
createdAt: Date;
|
|
1678
|
-
updatedAt: Date;
|
|
1679
|
-
email: string;
|
|
1680
|
-
emailVerified: boolean;
|
|
1681
|
-
name: string;
|
|
1682
|
-
image?: string | null | undefined;
|
|
1683
|
-
};
|
|
1698
|
+
subscription: {
|
|
1699
|
+
created_at?: string;
|
|
1700
|
+
updated_at?: string | null;
|
|
1701
|
+
id?: string;
|
|
1702
|
+
description?: string | null;
|
|
1703
|
+
amount?: string;
|
|
1704
|
+
original_amount?: string;
|
|
1705
|
+
item_level_discounted_amount?: string;
|
|
1706
|
+
coupon_calculation_metadata?: {
|
|
1707
|
+
coupons?: {
|
|
1708
|
+
coupon_id?: string;
|
|
1709
|
+
name?: string;
|
|
1710
|
+
is_percentage?: boolean;
|
|
1711
|
+
discount_value?: string;
|
|
1712
|
+
currency?: string | null;
|
|
1713
|
+
order?: number;
|
|
1714
|
+
amount_before_discount?: string;
|
|
1715
|
+
discount_amount?: string;
|
|
1716
|
+
amount_after_discount?: string;
|
|
1717
|
+
}[];
|
|
1684
1718
|
};
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1719
|
+
remaining_days?: number;
|
|
1720
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
1721
|
+
home_currency_amount?: string | null;
|
|
1722
|
+
exchange_rate_at_creation?: string | null;
|
|
1723
|
+
recurring_interval?: "WEEK" | "MONTH" | "QUARTER" | "YEAR";
|
|
1724
|
+
recurring_interval_count?: number;
|
|
1725
|
+
status?: "INACTIVE" | "ACTIVE" | "EXPIRED" | "CANCELED" | "FROZEN" | "TRIALING" | "TRIAL_PENDING";
|
|
1726
|
+
current_period_start?: string;
|
|
1727
|
+
current_period_end?: string;
|
|
1728
|
+
current_cycle_number?: number;
|
|
1729
|
+
cancel_at_period_end?: boolean;
|
|
1730
|
+
cancel_at_cycle_number?: number | null;
|
|
1731
|
+
started_at?: string | null;
|
|
1732
|
+
ended_at?: string | null;
|
|
1733
|
+
user_id?: string;
|
|
1734
|
+
organization_consumer_id?: string;
|
|
1735
|
+
latest_invoice_id?: string | null;
|
|
1736
|
+
trial_period_days?: number | null;
|
|
1737
|
+
trial_end?: string | null;
|
|
1738
|
+
organization_consumer?: {
|
|
1739
|
+
id?: string;
|
|
1740
|
+
name?: string;
|
|
1741
|
+
alias?: string | null;
|
|
1742
|
+
email?: string | null;
|
|
1743
|
+
phone_number?: string | null;
|
|
1744
|
+
preferred_language?: "AR" | "EN";
|
|
1745
|
+
consumer_type: "INDIVIDUAL" | "BUSINESS";
|
|
1746
|
+
address?: {
|
|
1747
|
+
address_line_1?: string;
|
|
1748
|
+
address_line_2?: string | null;
|
|
1749
|
+
city?: string;
|
|
1750
|
+
postal_code?: string | null;
|
|
1751
|
+
country?: string;
|
|
1752
|
+
};
|
|
1753
|
+
vat_number?: string | null;
|
|
1754
|
+
commercial_registration?: string | null;
|
|
1755
|
+
};
|
|
1756
|
+
items?: {
|
|
1757
|
+
created_at?: string;
|
|
1758
|
+
updated_at?: string | null;
|
|
1759
|
+
id?: string;
|
|
1760
|
+
product_id?: string;
|
|
1761
|
+
subscription_id?: string;
|
|
1762
|
+
quantity?: number;
|
|
1763
|
+
original_amount?: string;
|
|
1764
|
+
discounted_amount?: string;
|
|
1765
|
+
coupon_calculation_metadata?: {
|
|
1766
|
+
coupons?: {
|
|
1767
|
+
coupon_id?: string;
|
|
1768
|
+
name?: string;
|
|
1769
|
+
is_percentage?: boolean;
|
|
1770
|
+
discount_value?: string;
|
|
1771
|
+
currency?: string | null;
|
|
1772
|
+
order?: number;
|
|
1773
|
+
amount_before_discount?: string;
|
|
1774
|
+
discount_amount?: string;
|
|
1775
|
+
amount_after_discount?: string;
|
|
1776
|
+
}[];
|
|
1777
|
+
};
|
|
1778
|
+
product?: {
|
|
1779
|
+
created_at?: string;
|
|
1780
|
+
updated_at?: string | null;
|
|
1781
|
+
id?: string;
|
|
1782
|
+
name?: string;
|
|
1783
|
+
description?: string | null;
|
|
1784
|
+
type?: "RECURRING" | "ONE_OFF";
|
|
1785
|
+
recurring_interval?: "WEEK" | "MONTH" | "YEAR" | "SEMESTER";
|
|
1786
|
+
recurring_interval_count?: number;
|
|
1787
|
+
price?: string;
|
|
1788
|
+
currency: "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BOV" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHE" | "CHF" | "CHW" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MXV" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLE" | "SLL" | "SOS" | "SRD" | "SSP" | "STN" | "SVC" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "USN" | "UYI" | "UYU" | "UYW" | "UZS" | "VED" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "XSU" | "XUA" | "YER" | "ZAR" | "ZMW" | "ZWL";
|
|
1789
|
+
is_price_exempt_from_vat?: boolean;
|
|
1790
|
+
is_price_inclusive_of_vat?: boolean;
|
|
1791
|
+
price_excluding_vat?: string;
|
|
1792
|
+
vat_amount?: string;
|
|
1793
|
+
prices?: {
|
|
1794
|
+
id?: string;
|
|
1795
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
1796
|
+
amount?: string;
|
|
1797
|
+
is_active?: boolean;
|
|
1798
|
+
is_price_inclusive_of_vat?: boolean;
|
|
1799
|
+
is_price_exempt_from_vat?: boolean;
|
|
1800
|
+
price_excluding_vat?: string;
|
|
1801
|
+
vat_amount?: string;
|
|
1802
|
+
}[];
|
|
1803
|
+
is_active?: boolean;
|
|
1804
|
+
is_one_time?: boolean;
|
|
1805
|
+
is_used_in_finalized_invoice: boolean;
|
|
1806
|
+
};
|
|
1807
|
+
}[] | null;
|
|
1808
|
+
latest_invoice?: {
|
|
1809
|
+
created_at?: string;
|
|
1810
|
+
updated_at?: string | null;
|
|
1811
|
+
id?: string;
|
|
1812
|
+
payment_link_id?: string | null;
|
|
1813
|
+
user_id?: string;
|
|
1814
|
+
organization_id?: string;
|
|
1815
|
+
organization_consumer_id?: string;
|
|
1816
|
+
account_id?: string;
|
|
1817
|
+
branch_id?: string;
|
|
1818
|
+
org_invoice_number?: number;
|
|
1819
|
+
description?: string | null;
|
|
1820
|
+
total_amount?: string;
|
|
1821
|
+
original_amount?: string;
|
|
1822
|
+
item_level_discounted_amount?: string;
|
|
1823
|
+
total_vat_amount?: string | null;
|
|
1824
|
+
total_price_excluding_vat?: string | null;
|
|
1825
|
+
coupon_calculation_metadata?: {
|
|
1826
|
+
coupons?: {
|
|
1827
|
+
coupon_id?: string;
|
|
1828
|
+
name?: string;
|
|
1829
|
+
is_percentage?: boolean;
|
|
1830
|
+
discount_value?: string;
|
|
1831
|
+
currency?: string | null;
|
|
1832
|
+
order?: number;
|
|
1833
|
+
amount_before_discount?: string;
|
|
1834
|
+
discount_amount?: string;
|
|
1835
|
+
amount_after_discount?: string;
|
|
1836
|
+
}[];
|
|
1837
|
+
};
|
|
1838
|
+
currency: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
1839
|
+
home_currency_amount?: string | null;
|
|
1840
|
+
home_currency_amount_actual?: string | null;
|
|
1841
|
+
exchange_rate_at_creation?: string | null;
|
|
1842
|
+
consumer_message?: string | null;
|
|
1843
|
+
status?: "CREATED" | "ACCEPTED" | "EXPIRED" | "CANCELED" | "DRAFT" | "SENT" | "REJECTED" | "COMPLETED";
|
|
1844
|
+
payment_method?: "OPENBANKING" | "PAYMENTGATEWAY";
|
|
1845
|
+
allowed_payment_flow?: "ALL" | "AUTO" | "MANUAL";
|
|
1846
|
+
current_payment_flow?: "ALL" | "AUTO" | "MANUAL";
|
|
1847
|
+
period_start?: string | null;
|
|
1848
|
+
period_end?: string | null;
|
|
1849
|
+
recurring_interval?: "WEEK" | "MONTH" | "YEAR" | "SEMESTER";
|
|
1850
|
+
recurring_interval_count?: number | null;
|
|
1851
|
+
type?: "RECURRING" | "ONE_OFF" | "ONE_OFF_FUTURE" | "INSTALLMENTS" | "PRORATION";
|
|
1852
|
+
readonly total_amount_in_smallest_unit?: number;
|
|
1853
|
+
readonly original_amount_in_smallest_unit?: number;
|
|
1854
|
+
};
|
|
1855
|
+
latest_freeze?: {
|
|
1856
|
+
created_at?: string;
|
|
1857
|
+
updated_at?: string | null;
|
|
1858
|
+
id?: string;
|
|
1859
|
+
freeze_start_datetime?: string;
|
|
1860
|
+
freeze_end_datetime?: string | null;
|
|
1861
|
+
notes?: string | null;
|
|
1862
|
+
subscription_id?: string;
|
|
1863
|
+
invoice_id?: string;
|
|
1864
|
+
duration?: number | null;
|
|
1865
|
+
};
|
|
1866
|
+
override_payment_methods?: {
|
|
1867
|
+
visa?: boolean | null;
|
|
1868
|
+
mastercard?: boolean | null;
|
|
1869
|
+
amex?: boolean | null;
|
|
1870
|
+
bank_transfer?: boolean | null;
|
|
1871
|
+
installment?: boolean | null;
|
|
1872
|
+
qurrah?: boolean | null;
|
|
1873
|
+
subscription_auto_renewal?: boolean | null;
|
|
1874
|
+
};
|
|
1875
|
+
pending_change?: {
|
|
1876
|
+
id?: string;
|
|
1877
|
+
effective_at?: string;
|
|
1878
|
+
invoice_was_reissued?: boolean;
|
|
1879
|
+
target_items?: {
|
|
1880
|
+
product_id?: string;
|
|
1881
|
+
product_name?: string;
|
|
1882
|
+
quantity?: number;
|
|
1883
|
+
original_amount?: string;
|
|
1884
|
+
discounted_amount?: string;
|
|
1885
|
+
}[];
|
|
1886
|
+
target_subscription_coupon_ids?: string[];
|
|
1887
|
+
target_recurring_interval?: "WEEK" | "MONTH" | "QUARTER" | "YEAR";
|
|
1888
|
+
target_recurring_interval_count?: number;
|
|
1889
|
+
target_amount?: string;
|
|
1890
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
1891
|
+
current_amount?: string;
|
|
1892
|
+
delta_amount?: string;
|
|
1893
|
+
delta_amount_per_month?: string | null;
|
|
1894
|
+
changes?: {
|
|
1895
|
+
kind?: "PRODUCT_ADDED" | "PRODUCT_REMOVED" | "PRODUCT_REPLACED" | "QUANTITY_DECREASED" | "QUANTITY_INCREASED" | "COUPON_ADDED" | "COUPON_REMOVED" | "INTERVAL_CHANGED";
|
|
1896
|
+
label?: string;
|
|
1897
|
+
product_id?: string | null;
|
|
1898
|
+
from_value?: string | null;
|
|
1899
|
+
to_value?: string | null;
|
|
1900
|
+
}[];
|
|
1901
|
+
next_invoice_preview?: {
|
|
1902
|
+
period_start?: string;
|
|
1903
|
+
period_end?: string;
|
|
1904
|
+
issue_at?: string;
|
|
1905
|
+
due_at?: string;
|
|
1906
|
+
subtotal?: string;
|
|
1907
|
+
discount_total?: string;
|
|
1908
|
+
total_amount?: string;
|
|
1909
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
1910
|
+
};
|
|
1911
|
+
};
|
|
1912
|
+
readonly amount_in_smallest_unit?: number;
|
|
1913
|
+
readonly original_amount_in_smallest_unit?: number;
|
|
1914
|
+
};
|
|
1915
|
+
}>;
|
|
1916
|
+
uncancelSubscription: better_auth.StrictEndpoint<"/subscription/uncancel", {
|
|
1917
|
+
method: "POST";
|
|
1918
|
+
body: zod.ZodObject<{
|
|
1919
|
+
subscriptionId: zod.ZodString;
|
|
1920
|
+
}, zod_v4_core.$strip>;
|
|
1921
|
+
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
1922
|
+
session: {
|
|
1923
|
+
session: Record<string, any> & {
|
|
1924
|
+
id: string;
|
|
1925
|
+
createdAt: Date;
|
|
1926
|
+
updatedAt: Date;
|
|
1927
|
+
userId: string;
|
|
1928
|
+
expiresAt: Date;
|
|
1929
|
+
token: string;
|
|
1930
|
+
ipAddress?: string | null | undefined;
|
|
1931
|
+
userAgent?: string | null | undefined;
|
|
1932
|
+
};
|
|
1933
|
+
user: Record<string, any> & {
|
|
1934
|
+
id: string;
|
|
1935
|
+
createdAt: Date;
|
|
1936
|
+
updatedAt: Date;
|
|
1937
|
+
email: string;
|
|
1938
|
+
emailVerified: boolean;
|
|
1939
|
+
name: string;
|
|
1940
|
+
image?: string | null | undefined;
|
|
1941
|
+
};
|
|
1942
|
+
};
|
|
1943
|
+
}>)[];
|
|
1944
|
+
}, {
|
|
1945
|
+
uncanceled: boolean;
|
|
1946
|
+
subscription: {
|
|
1947
|
+
created_at?: string;
|
|
1948
|
+
updated_at?: string | null;
|
|
1949
|
+
id?: string;
|
|
1950
|
+
description?: string | null;
|
|
1951
|
+
amount?: string;
|
|
1952
|
+
original_amount?: string;
|
|
1953
|
+
item_level_discounted_amount?: string;
|
|
1954
|
+
coupon_calculation_metadata?: {
|
|
1955
|
+
coupons?: {
|
|
1956
|
+
coupon_id?: string;
|
|
1957
|
+
name?: string;
|
|
1958
|
+
is_percentage?: boolean;
|
|
1959
|
+
discount_value?: string;
|
|
1960
|
+
currency?: string | null;
|
|
1961
|
+
order?: number;
|
|
1962
|
+
amount_before_discount?: string;
|
|
1963
|
+
discount_amount?: string;
|
|
1964
|
+
amount_after_discount?: string;
|
|
1965
|
+
}[];
|
|
1966
|
+
};
|
|
1967
|
+
remaining_days?: number;
|
|
1968
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
1969
|
+
home_currency_amount?: string | null;
|
|
1970
|
+
exchange_rate_at_creation?: string | null;
|
|
1971
|
+
recurring_interval?: "WEEK" | "MONTH" | "QUARTER" | "YEAR";
|
|
1972
|
+
recurring_interval_count?: number;
|
|
1973
|
+
status?: "INACTIVE" | "ACTIVE" | "EXPIRED" | "CANCELED" | "FROZEN" | "TRIALING" | "TRIAL_PENDING";
|
|
1974
|
+
current_period_start?: string;
|
|
1975
|
+
current_period_end?: string;
|
|
1976
|
+
current_cycle_number?: number;
|
|
1977
|
+
cancel_at_period_end?: boolean;
|
|
1978
|
+
cancel_at_cycle_number?: number | null;
|
|
1979
|
+
started_at?: string | null;
|
|
1980
|
+
ended_at?: string | null;
|
|
1981
|
+
user_id?: string;
|
|
1982
|
+
organization_consumer_id?: string;
|
|
1983
|
+
latest_invoice_id?: string | null;
|
|
1984
|
+
trial_period_days?: number | null;
|
|
1985
|
+
trial_end?: string | null;
|
|
1986
|
+
organization_consumer?: {
|
|
1987
|
+
id?: string;
|
|
1988
|
+
name?: string;
|
|
1989
|
+
alias?: string | null;
|
|
1990
|
+
email?: string | null;
|
|
1991
|
+
phone_number?: string | null;
|
|
1992
|
+
preferred_language?: "AR" | "EN";
|
|
1993
|
+
consumer_type: "INDIVIDUAL" | "BUSINESS";
|
|
1994
|
+
address?: {
|
|
1995
|
+
address_line_1?: string;
|
|
1996
|
+
address_line_2?: string | null;
|
|
1997
|
+
city?: string;
|
|
1998
|
+
postal_code?: string | null;
|
|
1999
|
+
country?: string;
|
|
2000
|
+
};
|
|
2001
|
+
vat_number?: string | null;
|
|
2002
|
+
commercial_registration?: string | null;
|
|
2003
|
+
};
|
|
2004
|
+
items?: {
|
|
2005
|
+
created_at?: string;
|
|
2006
|
+
updated_at?: string | null;
|
|
2007
|
+
id?: string;
|
|
2008
|
+
product_id?: string;
|
|
2009
|
+
subscription_id?: string;
|
|
2010
|
+
quantity?: number;
|
|
2011
|
+
original_amount?: string;
|
|
2012
|
+
discounted_amount?: string;
|
|
2013
|
+
coupon_calculation_metadata?: {
|
|
2014
|
+
coupons?: {
|
|
2015
|
+
coupon_id?: string;
|
|
2016
|
+
name?: string;
|
|
2017
|
+
is_percentage?: boolean;
|
|
2018
|
+
discount_value?: string;
|
|
2019
|
+
currency?: string | null;
|
|
2020
|
+
order?: number;
|
|
2021
|
+
amount_before_discount?: string;
|
|
2022
|
+
discount_amount?: string;
|
|
2023
|
+
amount_after_discount?: string;
|
|
2024
|
+
}[];
|
|
2025
|
+
};
|
|
2026
|
+
product?: {
|
|
2027
|
+
created_at?: string;
|
|
2028
|
+
updated_at?: string | null;
|
|
2029
|
+
id?: string;
|
|
2030
|
+
name?: string;
|
|
2031
|
+
description?: string | null;
|
|
2032
|
+
type?: "RECURRING" | "ONE_OFF";
|
|
2033
|
+
recurring_interval?: "WEEK" | "MONTH" | "YEAR" | "SEMESTER";
|
|
2034
|
+
recurring_interval_count?: number;
|
|
2035
|
+
price?: string;
|
|
2036
|
+
currency: "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BOV" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHE" | "CHF" | "CHW" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MXV" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLE" | "SLL" | "SOS" | "SRD" | "SSP" | "STN" | "SVC" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "USN" | "UYI" | "UYU" | "UYW" | "UZS" | "VED" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "XSU" | "XUA" | "YER" | "ZAR" | "ZMW" | "ZWL";
|
|
2037
|
+
is_price_exempt_from_vat?: boolean;
|
|
2038
|
+
is_price_inclusive_of_vat?: boolean;
|
|
2039
|
+
price_excluding_vat?: string;
|
|
2040
|
+
vat_amount?: string;
|
|
2041
|
+
prices?: {
|
|
2042
|
+
id?: string;
|
|
2043
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
2044
|
+
amount?: string;
|
|
2045
|
+
is_active?: boolean;
|
|
2046
|
+
is_price_inclusive_of_vat?: boolean;
|
|
2047
|
+
is_price_exempt_from_vat?: boolean;
|
|
2048
|
+
price_excluding_vat?: string;
|
|
2049
|
+
vat_amount?: string;
|
|
2050
|
+
}[];
|
|
2051
|
+
is_active?: boolean;
|
|
2052
|
+
is_one_time?: boolean;
|
|
2053
|
+
is_used_in_finalized_invoice: boolean;
|
|
2054
|
+
};
|
|
2055
|
+
}[] | null;
|
|
2056
|
+
latest_invoice?: {
|
|
2057
|
+
created_at?: string;
|
|
2058
|
+
updated_at?: string | null;
|
|
2059
|
+
id?: string;
|
|
2060
|
+
payment_link_id?: string | null;
|
|
2061
|
+
user_id?: string;
|
|
2062
|
+
organization_id?: string;
|
|
2063
|
+
organization_consumer_id?: string;
|
|
2064
|
+
account_id?: string;
|
|
2065
|
+
branch_id?: string;
|
|
2066
|
+
org_invoice_number?: number;
|
|
2067
|
+
description?: string | null;
|
|
2068
|
+
total_amount?: string;
|
|
2069
|
+
original_amount?: string;
|
|
2070
|
+
item_level_discounted_amount?: string;
|
|
2071
|
+
total_vat_amount?: string | null;
|
|
2072
|
+
total_price_excluding_vat?: string | null;
|
|
2073
|
+
coupon_calculation_metadata?: {
|
|
2074
|
+
coupons?: {
|
|
2075
|
+
coupon_id?: string;
|
|
2076
|
+
name?: string;
|
|
2077
|
+
is_percentage?: boolean;
|
|
2078
|
+
discount_value?: string;
|
|
2079
|
+
currency?: string | null;
|
|
2080
|
+
order?: number;
|
|
2081
|
+
amount_before_discount?: string;
|
|
2082
|
+
discount_amount?: string;
|
|
2083
|
+
amount_after_discount?: string;
|
|
2084
|
+
}[];
|
|
2085
|
+
};
|
|
2086
|
+
currency: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
2087
|
+
home_currency_amount?: string | null;
|
|
2088
|
+
home_currency_amount_actual?: string | null;
|
|
2089
|
+
exchange_rate_at_creation?: string | null;
|
|
2090
|
+
consumer_message?: string | null;
|
|
2091
|
+
status?: "CREATED" | "ACCEPTED" | "EXPIRED" | "CANCELED" | "DRAFT" | "SENT" | "REJECTED" | "COMPLETED";
|
|
2092
|
+
payment_method?: "OPENBANKING" | "PAYMENTGATEWAY";
|
|
2093
|
+
allowed_payment_flow?: "ALL" | "AUTO" | "MANUAL";
|
|
2094
|
+
current_payment_flow?: "ALL" | "AUTO" | "MANUAL";
|
|
2095
|
+
period_start?: string | null;
|
|
2096
|
+
period_end?: string | null;
|
|
2097
|
+
recurring_interval?: "WEEK" | "MONTH" | "YEAR" | "SEMESTER";
|
|
2098
|
+
recurring_interval_count?: number | null;
|
|
2099
|
+
type?: "RECURRING" | "ONE_OFF" | "ONE_OFF_FUTURE" | "INSTALLMENTS" | "PRORATION";
|
|
2100
|
+
readonly total_amount_in_smallest_unit?: number;
|
|
2101
|
+
readonly original_amount_in_smallest_unit?: number;
|
|
2102
|
+
};
|
|
2103
|
+
latest_freeze?: {
|
|
2104
|
+
created_at?: string;
|
|
2105
|
+
updated_at?: string | null;
|
|
2106
|
+
id?: string;
|
|
2107
|
+
freeze_start_datetime?: string;
|
|
2108
|
+
freeze_end_datetime?: string | null;
|
|
2109
|
+
notes?: string | null;
|
|
2110
|
+
subscription_id?: string;
|
|
2111
|
+
invoice_id?: string;
|
|
2112
|
+
duration?: number | null;
|
|
2113
|
+
};
|
|
2114
|
+
override_payment_methods?: {
|
|
2115
|
+
visa?: boolean | null;
|
|
2116
|
+
mastercard?: boolean | null;
|
|
2117
|
+
amex?: boolean | null;
|
|
2118
|
+
bank_transfer?: boolean | null;
|
|
2119
|
+
installment?: boolean | null;
|
|
2120
|
+
qurrah?: boolean | null;
|
|
2121
|
+
subscription_auto_renewal?: boolean | null;
|
|
2122
|
+
};
|
|
2123
|
+
pending_change?: {
|
|
2124
|
+
id?: string;
|
|
2125
|
+
effective_at?: string;
|
|
2126
|
+
invoice_was_reissued?: boolean;
|
|
2127
|
+
target_items?: {
|
|
2128
|
+
product_id?: string;
|
|
2129
|
+
product_name?: string;
|
|
2130
|
+
quantity?: number;
|
|
2131
|
+
original_amount?: string;
|
|
2132
|
+
discounted_amount?: string;
|
|
2133
|
+
}[];
|
|
2134
|
+
target_subscription_coupon_ids?: string[];
|
|
2135
|
+
target_recurring_interval?: "WEEK" | "MONTH" | "QUARTER" | "YEAR";
|
|
2136
|
+
target_recurring_interval_count?: number;
|
|
2137
|
+
target_amount?: string;
|
|
2138
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
2139
|
+
current_amount?: string;
|
|
2140
|
+
delta_amount?: string;
|
|
2141
|
+
delta_amount_per_month?: string | null;
|
|
2142
|
+
changes?: {
|
|
2143
|
+
kind?: "PRODUCT_ADDED" | "PRODUCT_REMOVED" | "PRODUCT_REPLACED" | "QUANTITY_DECREASED" | "QUANTITY_INCREASED" | "COUPON_ADDED" | "COUPON_REMOVED" | "INTERVAL_CHANGED";
|
|
2144
|
+
label?: string;
|
|
2145
|
+
product_id?: string | null;
|
|
2146
|
+
from_value?: string | null;
|
|
2147
|
+
to_value?: string | null;
|
|
2148
|
+
}[];
|
|
2149
|
+
next_invoice_preview?: {
|
|
2150
|
+
period_start?: string;
|
|
2151
|
+
period_end?: string;
|
|
2152
|
+
issue_at?: string;
|
|
2153
|
+
due_at?: string;
|
|
2154
|
+
subtotal?: string;
|
|
2155
|
+
discount_total?: string;
|
|
2156
|
+
total_amount?: string;
|
|
2157
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
2158
|
+
};
|
|
2159
|
+
};
|
|
2160
|
+
readonly amount_in_smallest_unit?: number;
|
|
2161
|
+
readonly original_amount_in_smallest_unit?: number;
|
|
2162
|
+
};
|
|
2163
|
+
}>;
|
|
2164
|
+
freezeSubscription: better_auth.StrictEndpoint<"/subscription/freeze", {
|
|
2165
|
+
method: "POST";
|
|
2166
|
+
body: zod.ZodObject<{
|
|
2167
|
+
subscriptionId: zod.ZodString;
|
|
2168
|
+
freezeStartDatetime: zod.ZodString;
|
|
2169
|
+
freezeEndDatetime: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
|
|
2170
|
+
notes: zod.ZodOptional<zod.ZodString>;
|
|
2171
|
+
}, zod_v4_core.$strip>;
|
|
2172
|
+
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
2173
|
+
session: {
|
|
2174
|
+
session: Record<string, any> & {
|
|
2175
|
+
id: string;
|
|
2176
|
+
createdAt: Date;
|
|
2177
|
+
updatedAt: Date;
|
|
2178
|
+
userId: string;
|
|
2179
|
+
expiresAt: Date;
|
|
2180
|
+
token: string;
|
|
2181
|
+
ipAddress?: string | null | undefined;
|
|
2182
|
+
userAgent?: string | null | undefined;
|
|
2183
|
+
};
|
|
2184
|
+
user: Record<string, any> & {
|
|
2185
|
+
id: string;
|
|
2186
|
+
createdAt: Date;
|
|
2187
|
+
updatedAt: Date;
|
|
2188
|
+
email: string;
|
|
2189
|
+
emailVerified: boolean;
|
|
2190
|
+
name: string;
|
|
2191
|
+
image?: string | null | undefined;
|
|
2192
|
+
};
|
|
2193
|
+
};
|
|
2194
|
+
}>)[];
|
|
2195
|
+
}, {
|
|
2196
|
+
created_at?: string;
|
|
2197
|
+
updated_at?: string | null;
|
|
2198
|
+
id?: string;
|
|
2199
|
+
freeze_start_datetime?: string;
|
|
2200
|
+
freeze_end_datetime?: string | null;
|
|
2201
|
+
notes?: string | null;
|
|
2202
|
+
subscription_id?: string;
|
|
2203
|
+
invoice_id?: string;
|
|
2204
|
+
duration?: number | null;
|
|
2205
|
+
}>;
|
|
2206
|
+
unfreezeSubscription: better_auth.StrictEndpoint<"/subscription/unfreeze", {
|
|
2207
|
+
method: "POST";
|
|
2208
|
+
body: zod.ZodObject<{
|
|
2209
|
+
subscriptionId: zod.ZodString;
|
|
2210
|
+
}, zod_v4_core.$strip>;
|
|
2211
|
+
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
2212
|
+
session: {
|
|
2213
|
+
session: Record<string, any> & {
|
|
2214
|
+
id: string;
|
|
2215
|
+
createdAt: Date;
|
|
2216
|
+
updatedAt: Date;
|
|
2217
|
+
userId: string;
|
|
2218
|
+
expiresAt: Date;
|
|
2219
|
+
token: string;
|
|
2220
|
+
ipAddress?: string | null | undefined;
|
|
2221
|
+
userAgent?: string | null | undefined;
|
|
2222
|
+
};
|
|
2223
|
+
user: Record<string, any> & {
|
|
2224
|
+
id: string;
|
|
2225
|
+
createdAt: Date;
|
|
2226
|
+
updatedAt: Date;
|
|
2227
|
+
email: string;
|
|
2228
|
+
emailVerified: boolean;
|
|
2229
|
+
name: string;
|
|
2230
|
+
image?: string | null | undefined;
|
|
2231
|
+
};
|
|
2232
|
+
};
|
|
2233
|
+
}>)[];
|
|
2234
|
+
}, {
|
|
2235
|
+
unfrozen: boolean;
|
|
2236
|
+
}>;
|
|
2237
|
+
cancelSubscriptionFreeze: better_auth.StrictEndpoint<"/subscription/freeze/cancel", {
|
|
2238
|
+
method: "POST";
|
|
2239
|
+
body: zod.ZodObject<{
|
|
2240
|
+
subscriptionId: zod.ZodString;
|
|
2241
|
+
freezeId: zod.ZodString;
|
|
2242
|
+
}, zod_v4_core.$strip>;
|
|
2243
|
+
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
2244
|
+
session: {
|
|
2245
|
+
session: Record<string, any> & {
|
|
2246
|
+
id: string;
|
|
2247
|
+
createdAt: Date;
|
|
2248
|
+
updatedAt: Date;
|
|
2249
|
+
userId: string;
|
|
2250
|
+
expiresAt: Date;
|
|
2251
|
+
token: string;
|
|
2252
|
+
ipAddress?: string | null | undefined;
|
|
2253
|
+
userAgent?: string | null | undefined;
|
|
2254
|
+
};
|
|
2255
|
+
user: Record<string, any> & {
|
|
2256
|
+
id: string;
|
|
2257
|
+
createdAt: Date;
|
|
2258
|
+
updatedAt: Date;
|
|
2259
|
+
email: string;
|
|
2260
|
+
emailVerified: boolean;
|
|
2261
|
+
name: string;
|
|
2262
|
+
image?: string | null | undefined;
|
|
2263
|
+
};
|
|
2264
|
+
};
|
|
2265
|
+
}>)[];
|
|
2266
|
+
}, {
|
|
2267
|
+
canceled: boolean;
|
|
2268
|
+
freezeId: string;
|
|
2269
|
+
reused: boolean;
|
|
2270
|
+
}>;
|
|
2271
|
+
listSubscriptions: better_auth.StrictEndpoint<"/subscription/list", {
|
|
2272
|
+
method: "GET";
|
|
2273
|
+
query: zod.ZodOptional<zod.ZodObject<{
|
|
2274
|
+
referenceId: zod.ZodOptional<zod.ZodString>;
|
|
2275
|
+
referenceType: zod.ZodOptional<zod.ZodEnum<{
|
|
2276
|
+
custom: "custom";
|
|
2277
|
+
user: "user";
|
|
2278
|
+
organization: "organization";
|
|
2279
|
+
}>>;
|
|
2280
|
+
}, zod_v4_core.$strip>>;
|
|
2281
|
+
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
2282
|
+
session: {
|
|
2283
|
+
session: Record<string, any> & {
|
|
2284
|
+
id: string;
|
|
2285
|
+
createdAt: Date;
|
|
2286
|
+
updatedAt: Date;
|
|
2287
|
+
userId: string;
|
|
2288
|
+
expiresAt: Date;
|
|
2289
|
+
token: string;
|
|
2290
|
+
ipAddress?: string | null | undefined;
|
|
2291
|
+
userAgent?: string | null | undefined;
|
|
2292
|
+
};
|
|
2293
|
+
user: Record<string, any> & {
|
|
2294
|
+
id: string;
|
|
2295
|
+
createdAt: Date;
|
|
2296
|
+
updatedAt: Date;
|
|
2297
|
+
email: string;
|
|
2298
|
+
emailVerified: boolean;
|
|
2299
|
+
name: string;
|
|
2300
|
+
image?: string | null | undefined;
|
|
2301
|
+
};
|
|
2302
|
+
};
|
|
2303
|
+
}>)[];
|
|
2304
|
+
}, {
|
|
2305
|
+
seats: number;
|
|
2306
|
+
plan: StreamPayPlanLike | null;
|
|
2307
|
+
id: string;
|
|
2308
|
+
referenceId: string;
|
|
2309
|
+
referenceType: SubscriptionReferenceType;
|
|
2310
|
+
activeSlotKey: string | null;
|
|
2311
|
+
streampaySubscriptionId: string | null;
|
|
2312
|
+
streampayConsumerId: string | null;
|
|
2313
|
+
streampayPaymentLinkId: string | null;
|
|
2314
|
+
planVersion: string | null;
|
|
2315
|
+
productId: string | null;
|
|
2316
|
+
group: string | null;
|
|
2317
|
+
amountInSmallestUnit: number | null;
|
|
2318
|
+
originalAmountInSmallestUnit: number | null;
|
|
2319
|
+
currency: _streamsdk_typescript.CurrencyCode | null;
|
|
2320
|
+
billingInterval: SubscriptionRecurringInterval | null;
|
|
2321
|
+
billingIntervalCount: number | null;
|
|
2322
|
+
status: SubscriptionStatus;
|
|
2323
|
+
providerStatus: StreamPaySubscriptionStatus | null;
|
|
2324
|
+
billingStatus: SubscriptionBillingStatus;
|
|
2325
|
+
periodStart: Date | null;
|
|
2326
|
+
periodEnd: Date | null;
|
|
2327
|
+
currentCycleNumber: number | null;
|
|
2328
|
+
trialStart: Date | null;
|
|
2329
|
+
trialEnd: Date | null;
|
|
2330
|
+
cancelAtPeriodEnd: boolean;
|
|
2331
|
+
cancelAt: Date | null;
|
|
2332
|
+
cancelScheduledAt: Date | null;
|
|
1714
2333
|
canceledAt: Date | null;
|
|
1715
2334
|
pendingPlan: string | null;
|
|
1716
2335
|
pendingProductId: string | null;
|
|
1717
2336
|
pendingPlanEffectiveAt: Date | null;
|
|
2337
|
+
pendingSeats: number | null;
|
|
2338
|
+
pendingSeatsEffectiveAt: Date | null;
|
|
1718
2339
|
endedAt: Date | null;
|
|
1719
2340
|
frozenAt: Date | null;
|
|
1720
2341
|
freezeEndAt: Date | null;
|
|
@@ -1758,6 +2379,7 @@ declare function subscriptions(subsOptions: SubscriptionsOptions): (options: Str
|
|
|
1758
2379
|
};
|
|
1759
2380
|
}>)[];
|
|
1760
2381
|
}, {
|
|
2382
|
+
seats: number;
|
|
1761
2383
|
plan: StreamPayPlanLike | null;
|
|
1762
2384
|
id: string;
|
|
1763
2385
|
referenceId: string;
|
|
@@ -1789,6 +2411,8 @@ declare function subscriptions(subsOptions: SubscriptionsOptions): (options: Str
|
|
|
1789
2411
|
pendingPlan: string | null;
|
|
1790
2412
|
pendingProductId: string | null;
|
|
1791
2413
|
pendingPlanEffectiveAt: Date | null;
|
|
2414
|
+
pendingSeats: number | null;
|
|
2415
|
+
pendingSeatsEffectiveAt: Date | null;
|
|
1792
2416
|
endedAt: Date | null;
|
|
1793
2417
|
frozenAt: Date | null;
|
|
1794
2418
|
freezeEndAt: Date | null;
|
|
@@ -2009,6 +2633,11 @@ declare function subscriptions(subsOptions: SubscriptionsOptions): (options: Str
|
|
|
2009
2633
|
readonly required: false;
|
|
2010
2634
|
readonly index: true;
|
|
2011
2635
|
};
|
|
2636
|
+
readonly seats: {
|
|
2637
|
+
readonly type: "number";
|
|
2638
|
+
readonly required: false;
|
|
2639
|
+
readonly defaultValue: 1;
|
|
2640
|
+
};
|
|
2012
2641
|
readonly amountInSmallestUnit: {
|
|
2013
2642
|
readonly type: "number";
|
|
2014
2643
|
readonly required: false;
|
|
@@ -2097,6 +2726,14 @@ declare function subscriptions(subsOptions: SubscriptionsOptions): (options: Str
|
|
|
2097
2726
|
readonly type: "date";
|
|
2098
2727
|
readonly required: false;
|
|
2099
2728
|
};
|
|
2729
|
+
readonly pendingSeats: {
|
|
2730
|
+
readonly type: "number";
|
|
2731
|
+
readonly required: false;
|
|
2732
|
+
};
|
|
2733
|
+
readonly pendingSeatsEffectiveAt: {
|
|
2734
|
+
readonly type: "date";
|
|
2735
|
+
readonly required: false;
|
|
2736
|
+
};
|
|
2100
2737
|
readonly endedAt: {
|
|
2101
2738
|
readonly type: "date";
|
|
2102
2739
|
readonly required: false;
|
|
@@ -5601,6 +6238,36 @@ interface StreamPayCustomFieldsSchema {
|
|
|
5601
6238
|
properties: Record<string, StreamPayCustomFieldDefinition>;
|
|
5602
6239
|
required?: string[];
|
|
5603
6240
|
}
|
|
6241
|
+
type CheckoutUser = User & StreamPaySessionUser & Record<string, unknown>;
|
|
6242
|
+
interface CheckoutResolutionContext {
|
|
6243
|
+
/** Resolved Better Auth user, including app-defined user fields. */
|
|
6244
|
+
user: CheckoutUser | null;
|
|
6245
|
+
/** Validated but untrusted client input. */
|
|
6246
|
+
body: CheckoutParams;
|
|
6247
|
+
}
|
|
6248
|
+
interface CheckoutOverrides {
|
|
6249
|
+
products?: Array<{
|
|
6250
|
+
productId: string;
|
|
6251
|
+
quantity?: number;
|
|
6252
|
+
}>;
|
|
6253
|
+
name?: string;
|
|
6254
|
+
description?: string;
|
|
6255
|
+
successUrl?: string;
|
|
6256
|
+
failureUrl?: string;
|
|
6257
|
+
maxNumberOfPayments?: number;
|
|
6258
|
+
validUntil?: string;
|
|
6259
|
+
couponIds?: string[];
|
|
6260
|
+
metadata?: Record<string, string | number | boolean>;
|
|
6261
|
+
referenceId?: string;
|
|
6262
|
+
}
|
|
6263
|
+
interface CheckoutCreatedContext {
|
|
6264
|
+
user: CheckoutUser | null;
|
|
6265
|
+
referenceId?: string;
|
|
6266
|
+
paymentLinkId: string;
|
|
6267
|
+
url: string;
|
|
6268
|
+
/** The exact payload sent to StreamPay. */
|
|
6269
|
+
payload: CreatePaymentLinkDto;
|
|
6270
|
+
}
|
|
5604
6271
|
interface CheckoutOptions {
|
|
5605
6272
|
products?: StreamPayProduct[] | (() => Promise<StreamPayProduct[]>);
|
|
5606
6273
|
successUrl?: string;
|
|
@@ -5609,6 +6276,17 @@ interface CheckoutOptions {
|
|
|
5609
6276
|
contactInformationType?: "EMAIL" | "PHONE";
|
|
5610
6277
|
currency?: CreatePaymentLinkDto["currency"];
|
|
5611
6278
|
customFields?: StreamPayCustomFieldsSchema;
|
|
6279
|
+
/**
|
|
6280
|
+
* Derive checkout fields on the server for each request. When configured, the
|
|
6281
|
+
* client may only send `referenceId` and `redirect`; all payment fields must be
|
|
6282
|
+
* returned here.
|
|
6283
|
+
*/
|
|
6284
|
+
resolveCheckout?: (data: CheckoutResolutionContext, ctx: GenericEndpointContext) => Promise<CheckoutOverrides> | CheckoutOverrides;
|
|
6285
|
+
/**
|
|
6286
|
+
* Persist app state after link creation and before the response is returned.
|
|
6287
|
+
* A thrown error aborts checkout and triggers best-effort link deactivation.
|
|
6288
|
+
*/
|
|
6289
|
+
onCheckoutCreated?: (data: CheckoutCreatedContext, ctx: GenericEndpointContext) => Promise<void> | void;
|
|
5612
6290
|
}
|
|
5613
6291
|
declare const CheckoutBody: z.ZodObject<{
|
|
5614
6292
|
products: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
@@ -6214,6 +6892,7 @@ interface StreamPayClient {
|
|
|
6214
6892
|
createPaymentLink(input: CreatePaymentLinkDto): Promise<PaymentLinkDetailed>;
|
|
6215
6893
|
listPaymentLinks(params?: PaginationParams): Promise<PaymentLinkListResponse>;
|
|
6216
6894
|
getPaymentLink(paymentLinkId: string): Promise<PaymentLinkDetailed>;
|
|
6895
|
+
updatePaymentLinkStatus?(paymentLinkId: string, input: UpdatePaymentLinkStatusDto): Promise<PaymentLinkDetailed>;
|
|
6217
6896
|
getPaymentUrl(link: PaymentLinkDetailed): string | null;
|
|
6218
6897
|
createProduct(input: ProductCreate): Promise<ProductDto>;
|
|
6219
6898
|
listProducts(params?: PaginationParams): Promise<ProductListResponse>;
|
|
@@ -10197,6 +10876,7 @@ declare const streampay: <O extends StreamPayOptions>(options: O) => {
|
|
|
10197
10876
|
method: "POST";
|
|
10198
10877
|
body: zod.ZodObject<{
|
|
10199
10878
|
plan: zod.ZodString;
|
|
10879
|
+
seats: zod.ZodOptional<zod.ZodNumber>;
|
|
10200
10880
|
referenceId: zod.ZodOptional<zod.ZodString>;
|
|
10201
10881
|
referenceType: zod.ZodOptional<zod.ZodEnum<{
|
|
10202
10882
|
custom: "custom";
|
|
@@ -10205,7 +10885,7 @@ declare const streampay: <O extends StreamPayOptions>(options: O) => {
|
|
|
10205
10885
|
}>>;
|
|
10206
10886
|
successUrl: zod.ZodOptional<zod.ZodString>;
|
|
10207
10887
|
failureUrl: zod.ZodOptional<zod.ZodString>;
|
|
10208
|
-
}, zod_v4_core.$
|
|
10888
|
+
}, zod_v4_core.$strict>;
|
|
10209
10889
|
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
10210
10890
|
session: {
|
|
10211
10891
|
session: Record<string, any> & {
|
|
@@ -10236,6 +10916,7 @@ declare const streampay: <O extends StreamPayOptions>(options: O) => {
|
|
|
10236
10916
|
reused: boolean;
|
|
10237
10917
|
status: string;
|
|
10238
10918
|
plan: string;
|
|
10919
|
+
seats: number;
|
|
10239
10920
|
}>;
|
|
10240
10921
|
subscriptionSuccess: better_auth.StrictEndpoint<"/subscription/success", {
|
|
10241
10922
|
method: "GET";
|
|
@@ -10513,14 +11194,350 @@ declare const streampay: <O extends StreamPayOptions>(options: O) => {
|
|
|
10513
11194
|
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
10514
11195
|
};
|
|
10515
11196
|
};
|
|
10516
|
-
readonly amount_in_smallest_unit?: number;
|
|
10517
|
-
readonly original_amount_in_smallest_unit?: number;
|
|
11197
|
+
readonly amount_in_smallest_unit?: number;
|
|
11198
|
+
readonly original_amount_in_smallest_unit?: number;
|
|
11199
|
+
}>;
|
|
11200
|
+
changeSubscriptionPlan: better_auth.StrictEndpoint<"/subscription/change-plan", {
|
|
11201
|
+
method: "POST";
|
|
11202
|
+
body: zod.ZodObject<{
|
|
11203
|
+
subscriptionId: zod.ZodString;
|
|
11204
|
+
plan: zod.ZodString;
|
|
11205
|
+
seats: zod.ZodOptional<zod.ZodNumber>;
|
|
11206
|
+
}, zod_v4_core.$strict>;
|
|
11207
|
+
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
11208
|
+
session: {
|
|
11209
|
+
session: Record<string, any> & {
|
|
11210
|
+
id: string;
|
|
11211
|
+
createdAt: Date;
|
|
11212
|
+
updatedAt: Date;
|
|
11213
|
+
userId: string;
|
|
11214
|
+
expiresAt: Date;
|
|
11215
|
+
token: string;
|
|
11216
|
+
ipAddress?: string | null | undefined;
|
|
11217
|
+
userAgent?: string | null | undefined;
|
|
11218
|
+
};
|
|
11219
|
+
user: Record<string, any> & {
|
|
11220
|
+
id: string;
|
|
11221
|
+
createdAt: Date;
|
|
11222
|
+
updatedAt: Date;
|
|
11223
|
+
email: string;
|
|
11224
|
+
emailVerified: boolean;
|
|
11225
|
+
name: string;
|
|
11226
|
+
image?: string | null | undefined;
|
|
11227
|
+
};
|
|
11228
|
+
};
|
|
11229
|
+
}>)[];
|
|
11230
|
+
}, {
|
|
11231
|
+
mode: string;
|
|
11232
|
+
subscriptionId: string;
|
|
11233
|
+
plan: string;
|
|
11234
|
+
seats: number;
|
|
11235
|
+
effectiveAt: string | null;
|
|
11236
|
+
pendingChange: {
|
|
11237
|
+
id?: string;
|
|
11238
|
+
effective_at?: string;
|
|
11239
|
+
invoice_was_reissued?: boolean;
|
|
11240
|
+
target_items?: {
|
|
11241
|
+
product_id?: string;
|
|
11242
|
+
product_name?: string;
|
|
11243
|
+
quantity?: number;
|
|
11244
|
+
original_amount?: string;
|
|
11245
|
+
discounted_amount?: string;
|
|
11246
|
+
}[];
|
|
11247
|
+
target_subscription_coupon_ids?: string[];
|
|
11248
|
+
target_recurring_interval?: "WEEK" | "MONTH" | "QUARTER" | "YEAR";
|
|
11249
|
+
target_recurring_interval_count?: number;
|
|
11250
|
+
target_amount?: string;
|
|
11251
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
11252
|
+
current_amount?: string;
|
|
11253
|
+
delta_amount?: string;
|
|
11254
|
+
delta_amount_per_month?: string | null;
|
|
11255
|
+
changes?: {
|
|
11256
|
+
kind?: "PRODUCT_ADDED" | "PRODUCT_REMOVED" | "PRODUCT_REPLACED" | "QUANTITY_DECREASED" | "QUANTITY_INCREASED" | "COUPON_ADDED" | "COUPON_REMOVED" | "INTERVAL_CHANGED";
|
|
11257
|
+
label?: string;
|
|
11258
|
+
product_id?: string | null;
|
|
11259
|
+
from_value?: string | null;
|
|
11260
|
+
to_value?: string | null;
|
|
11261
|
+
}[];
|
|
11262
|
+
next_invoice_preview?: {
|
|
11263
|
+
period_start?: string;
|
|
11264
|
+
period_end?: string;
|
|
11265
|
+
issue_at?: string;
|
|
11266
|
+
due_at?: string;
|
|
11267
|
+
subtotal?: string;
|
|
11268
|
+
discount_total?: string;
|
|
11269
|
+
total_amount?: string;
|
|
11270
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
11271
|
+
};
|
|
11272
|
+
} | undefined;
|
|
11273
|
+
reused: boolean;
|
|
11274
|
+
} | {
|
|
11275
|
+
mode: string;
|
|
11276
|
+
subscriptionId: string;
|
|
11277
|
+
plan: string;
|
|
11278
|
+
seats: number;
|
|
11279
|
+
effectiveAt: string | null;
|
|
11280
|
+
pendingChange: {
|
|
11281
|
+
id?: string;
|
|
11282
|
+
effective_at?: string;
|
|
11283
|
+
invoice_was_reissued?: boolean;
|
|
11284
|
+
target_items?: {
|
|
11285
|
+
product_id?: string;
|
|
11286
|
+
product_name?: string;
|
|
11287
|
+
quantity?: number;
|
|
11288
|
+
original_amount?: string;
|
|
11289
|
+
discounted_amount?: string;
|
|
11290
|
+
}[];
|
|
11291
|
+
target_subscription_coupon_ids?: string[];
|
|
11292
|
+
target_recurring_interval?: "WEEK" | "MONTH" | "QUARTER" | "YEAR";
|
|
11293
|
+
target_recurring_interval_count?: number;
|
|
11294
|
+
target_amount?: string;
|
|
11295
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
11296
|
+
current_amount?: string;
|
|
11297
|
+
delta_amount?: string;
|
|
11298
|
+
delta_amount_per_month?: string | null;
|
|
11299
|
+
changes?: {
|
|
11300
|
+
kind?: "PRODUCT_ADDED" | "PRODUCT_REMOVED" | "PRODUCT_REPLACED" | "QUANTITY_DECREASED" | "QUANTITY_INCREASED" | "COUPON_ADDED" | "COUPON_REMOVED" | "INTERVAL_CHANGED";
|
|
11301
|
+
label?: string;
|
|
11302
|
+
product_id?: string | null;
|
|
11303
|
+
from_value?: string | null;
|
|
11304
|
+
to_value?: string | null;
|
|
11305
|
+
}[];
|
|
11306
|
+
next_invoice_preview?: {
|
|
11307
|
+
period_start?: string;
|
|
11308
|
+
period_end?: string;
|
|
11309
|
+
issue_at?: string;
|
|
11310
|
+
due_at?: string;
|
|
11311
|
+
subtotal?: string;
|
|
11312
|
+
discount_total?: string;
|
|
11313
|
+
total_amount?: string;
|
|
11314
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
11315
|
+
};
|
|
11316
|
+
} | null;
|
|
11317
|
+
subscription: {
|
|
11318
|
+
created_at?: string;
|
|
11319
|
+
updated_at?: string | null;
|
|
11320
|
+
id?: string;
|
|
11321
|
+
description?: string | null;
|
|
11322
|
+
amount?: string;
|
|
11323
|
+
original_amount?: string;
|
|
11324
|
+
item_level_discounted_amount?: string;
|
|
11325
|
+
coupon_calculation_metadata?: {
|
|
11326
|
+
coupons?: {
|
|
11327
|
+
coupon_id?: string;
|
|
11328
|
+
name?: string;
|
|
11329
|
+
is_percentage?: boolean;
|
|
11330
|
+
discount_value?: string;
|
|
11331
|
+
currency?: string | null;
|
|
11332
|
+
order?: number;
|
|
11333
|
+
amount_before_discount?: string;
|
|
11334
|
+
discount_amount?: string;
|
|
11335
|
+
amount_after_discount?: string;
|
|
11336
|
+
}[];
|
|
11337
|
+
};
|
|
11338
|
+
remaining_days?: number;
|
|
11339
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
11340
|
+
home_currency_amount?: string | null;
|
|
11341
|
+
exchange_rate_at_creation?: string | null;
|
|
11342
|
+
recurring_interval?: "WEEK" | "MONTH" | "QUARTER" | "YEAR";
|
|
11343
|
+
recurring_interval_count?: number;
|
|
11344
|
+
status?: "INACTIVE" | "ACTIVE" | "EXPIRED" | "CANCELED" | "FROZEN" | "TRIALING" | "TRIAL_PENDING";
|
|
11345
|
+
current_period_start?: string;
|
|
11346
|
+
current_period_end?: string;
|
|
11347
|
+
current_cycle_number?: number;
|
|
11348
|
+
cancel_at_period_end?: boolean;
|
|
11349
|
+
cancel_at_cycle_number?: number | null;
|
|
11350
|
+
started_at?: string | null;
|
|
11351
|
+
ended_at?: string | null;
|
|
11352
|
+
user_id?: string;
|
|
11353
|
+
organization_consumer_id?: string;
|
|
11354
|
+
latest_invoice_id?: string | null;
|
|
11355
|
+
trial_period_days?: number | null;
|
|
11356
|
+
trial_end?: string | null;
|
|
11357
|
+
organization_consumer?: {
|
|
11358
|
+
id?: string;
|
|
11359
|
+
name?: string;
|
|
11360
|
+
alias?: string | null;
|
|
11361
|
+
email?: string | null;
|
|
11362
|
+
phone_number?: string | null;
|
|
11363
|
+
preferred_language?: "AR" | "EN";
|
|
11364
|
+
consumer_type: "INDIVIDUAL" | "BUSINESS";
|
|
11365
|
+
address?: {
|
|
11366
|
+
address_line_1?: string;
|
|
11367
|
+
address_line_2?: string | null;
|
|
11368
|
+
city?: string;
|
|
11369
|
+
postal_code?: string | null;
|
|
11370
|
+
country?: string;
|
|
11371
|
+
};
|
|
11372
|
+
vat_number?: string | null;
|
|
11373
|
+
commercial_registration?: string | null;
|
|
11374
|
+
};
|
|
11375
|
+
items?: {
|
|
11376
|
+
created_at?: string;
|
|
11377
|
+
updated_at?: string | null;
|
|
11378
|
+
id?: string;
|
|
11379
|
+
product_id?: string;
|
|
11380
|
+
subscription_id?: string;
|
|
11381
|
+
quantity?: number;
|
|
11382
|
+
original_amount?: string;
|
|
11383
|
+
discounted_amount?: string;
|
|
11384
|
+
coupon_calculation_metadata?: {
|
|
11385
|
+
coupons?: {
|
|
11386
|
+
coupon_id?: string;
|
|
11387
|
+
name?: string;
|
|
11388
|
+
is_percentage?: boolean;
|
|
11389
|
+
discount_value?: string;
|
|
11390
|
+
currency?: string | null;
|
|
11391
|
+
order?: number;
|
|
11392
|
+
amount_before_discount?: string;
|
|
11393
|
+
discount_amount?: string;
|
|
11394
|
+
amount_after_discount?: string;
|
|
11395
|
+
}[];
|
|
11396
|
+
};
|
|
11397
|
+
product?: {
|
|
11398
|
+
created_at?: string;
|
|
11399
|
+
updated_at?: string | null;
|
|
11400
|
+
id?: string;
|
|
11401
|
+
name?: string;
|
|
11402
|
+
description?: string | null;
|
|
11403
|
+
type?: "RECURRING" | "ONE_OFF";
|
|
11404
|
+
recurring_interval?: "WEEK" | "MONTH" | "YEAR" | "SEMESTER";
|
|
11405
|
+
recurring_interval_count?: number;
|
|
11406
|
+
price?: string;
|
|
11407
|
+
currency: "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BOV" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHE" | "CHF" | "CHW" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MXV" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLE" | "SLL" | "SOS" | "SRD" | "SSP" | "STN" | "SVC" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "USN" | "UYI" | "UYU" | "UYW" | "UZS" | "VED" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "XSU" | "XUA" | "YER" | "ZAR" | "ZMW" | "ZWL";
|
|
11408
|
+
is_price_exempt_from_vat?: boolean;
|
|
11409
|
+
is_price_inclusive_of_vat?: boolean;
|
|
11410
|
+
price_excluding_vat?: string;
|
|
11411
|
+
vat_amount?: string;
|
|
11412
|
+
prices?: {
|
|
11413
|
+
id?: string;
|
|
11414
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
11415
|
+
amount?: string;
|
|
11416
|
+
is_active?: boolean;
|
|
11417
|
+
is_price_inclusive_of_vat?: boolean;
|
|
11418
|
+
is_price_exempt_from_vat?: boolean;
|
|
11419
|
+
price_excluding_vat?: string;
|
|
11420
|
+
vat_amount?: string;
|
|
11421
|
+
}[];
|
|
11422
|
+
is_active?: boolean;
|
|
11423
|
+
is_one_time?: boolean;
|
|
11424
|
+
is_used_in_finalized_invoice: boolean;
|
|
11425
|
+
};
|
|
11426
|
+
}[] | null;
|
|
11427
|
+
latest_invoice?: {
|
|
11428
|
+
created_at?: string;
|
|
11429
|
+
updated_at?: string | null;
|
|
11430
|
+
id?: string;
|
|
11431
|
+
payment_link_id?: string | null;
|
|
11432
|
+
user_id?: string;
|
|
11433
|
+
organization_id?: string;
|
|
11434
|
+
organization_consumer_id?: string;
|
|
11435
|
+
account_id?: string;
|
|
11436
|
+
branch_id?: string;
|
|
11437
|
+
org_invoice_number?: number;
|
|
11438
|
+
description?: string | null;
|
|
11439
|
+
total_amount?: string;
|
|
11440
|
+
original_amount?: string;
|
|
11441
|
+
item_level_discounted_amount?: string;
|
|
11442
|
+
total_vat_amount?: string | null;
|
|
11443
|
+
total_price_excluding_vat?: string | null;
|
|
11444
|
+
coupon_calculation_metadata?: {
|
|
11445
|
+
coupons?: {
|
|
11446
|
+
coupon_id?: string;
|
|
11447
|
+
name?: string;
|
|
11448
|
+
is_percentage?: boolean;
|
|
11449
|
+
discount_value?: string;
|
|
11450
|
+
currency?: string | null;
|
|
11451
|
+
order?: number;
|
|
11452
|
+
amount_before_discount?: string;
|
|
11453
|
+
discount_amount?: string;
|
|
11454
|
+
amount_after_discount?: string;
|
|
11455
|
+
}[];
|
|
11456
|
+
};
|
|
11457
|
+
currency: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
11458
|
+
home_currency_amount?: string | null;
|
|
11459
|
+
home_currency_amount_actual?: string | null;
|
|
11460
|
+
exchange_rate_at_creation?: string | null;
|
|
11461
|
+
consumer_message?: string | null;
|
|
11462
|
+
status?: "CREATED" | "ACCEPTED" | "EXPIRED" | "CANCELED" | "DRAFT" | "SENT" | "REJECTED" | "COMPLETED";
|
|
11463
|
+
payment_method?: "OPENBANKING" | "PAYMENTGATEWAY";
|
|
11464
|
+
allowed_payment_flow?: "ALL" | "AUTO" | "MANUAL";
|
|
11465
|
+
current_payment_flow?: "ALL" | "AUTO" | "MANUAL";
|
|
11466
|
+
period_start?: string | null;
|
|
11467
|
+
period_end?: string | null;
|
|
11468
|
+
recurring_interval?: "WEEK" | "MONTH" | "YEAR" | "SEMESTER";
|
|
11469
|
+
recurring_interval_count?: number | null;
|
|
11470
|
+
type?: "RECURRING" | "ONE_OFF" | "ONE_OFF_FUTURE" | "INSTALLMENTS" | "PRORATION";
|
|
11471
|
+
readonly total_amount_in_smallest_unit?: number;
|
|
11472
|
+
readonly original_amount_in_smallest_unit?: number;
|
|
11473
|
+
};
|
|
11474
|
+
latest_freeze?: {
|
|
11475
|
+
created_at?: string;
|
|
11476
|
+
updated_at?: string | null;
|
|
11477
|
+
id?: string;
|
|
11478
|
+
freeze_start_datetime?: string;
|
|
11479
|
+
freeze_end_datetime?: string | null;
|
|
11480
|
+
notes?: string | null;
|
|
11481
|
+
subscription_id?: string;
|
|
11482
|
+
invoice_id?: string;
|
|
11483
|
+
duration?: number | null;
|
|
11484
|
+
};
|
|
11485
|
+
override_payment_methods?: {
|
|
11486
|
+
visa?: boolean | null;
|
|
11487
|
+
mastercard?: boolean | null;
|
|
11488
|
+
amex?: boolean | null;
|
|
11489
|
+
bank_transfer?: boolean | null;
|
|
11490
|
+
installment?: boolean | null;
|
|
11491
|
+
qurrah?: boolean | null;
|
|
11492
|
+
subscription_auto_renewal?: boolean | null;
|
|
11493
|
+
};
|
|
11494
|
+
pending_change?: {
|
|
11495
|
+
id?: string;
|
|
11496
|
+
effective_at?: string;
|
|
11497
|
+
invoice_was_reissued?: boolean;
|
|
11498
|
+
target_items?: {
|
|
11499
|
+
product_id?: string;
|
|
11500
|
+
product_name?: string;
|
|
11501
|
+
quantity?: number;
|
|
11502
|
+
original_amount?: string;
|
|
11503
|
+
discounted_amount?: string;
|
|
11504
|
+
}[];
|
|
11505
|
+
target_subscription_coupon_ids?: string[];
|
|
11506
|
+
target_recurring_interval?: "WEEK" | "MONTH" | "QUARTER" | "YEAR";
|
|
11507
|
+
target_recurring_interval_count?: number;
|
|
11508
|
+
target_amount?: string;
|
|
11509
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
11510
|
+
current_amount?: string;
|
|
11511
|
+
delta_amount?: string;
|
|
11512
|
+
delta_amount_per_month?: string | null;
|
|
11513
|
+
changes?: {
|
|
11514
|
+
kind?: "PRODUCT_ADDED" | "PRODUCT_REMOVED" | "PRODUCT_REPLACED" | "QUANTITY_DECREASED" | "QUANTITY_INCREASED" | "COUPON_ADDED" | "COUPON_REMOVED" | "INTERVAL_CHANGED";
|
|
11515
|
+
label?: string;
|
|
11516
|
+
product_id?: string | null;
|
|
11517
|
+
from_value?: string | null;
|
|
11518
|
+
to_value?: string | null;
|
|
11519
|
+
}[];
|
|
11520
|
+
next_invoice_preview?: {
|
|
11521
|
+
period_start?: string;
|
|
11522
|
+
period_end?: string;
|
|
11523
|
+
issue_at?: string;
|
|
11524
|
+
due_at?: string;
|
|
11525
|
+
subtotal?: string;
|
|
11526
|
+
discount_total?: string;
|
|
11527
|
+
total_amount?: string;
|
|
11528
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
11529
|
+
};
|
|
11530
|
+
};
|
|
11531
|
+
readonly amount_in_smallest_unit?: number;
|
|
11532
|
+
readonly original_amount_in_smallest_unit?: number;
|
|
11533
|
+
};
|
|
11534
|
+
reused: boolean;
|
|
10518
11535
|
}>;
|
|
10519
|
-
|
|
11536
|
+
updateSubscriptionSeats: better_auth.StrictEndpoint<"/subscription/update-seats", {
|
|
10520
11537
|
method: "POST";
|
|
10521
11538
|
body: zod.ZodObject<{
|
|
10522
11539
|
subscriptionId: zod.ZodString;
|
|
10523
|
-
|
|
11540
|
+
seats: zod.ZodNumber;
|
|
10524
11541
|
}, zod_v4_core.$strict>;
|
|
10525
11542
|
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
10526
11543
|
session: {
|
|
@@ -10548,7 +11565,7 @@ declare const streampay: <O extends StreamPayOptions>(options: O) => {
|
|
|
10548
11565
|
}, {
|
|
10549
11566
|
mode: string;
|
|
10550
11567
|
subscriptionId: string;
|
|
10551
|
-
|
|
11568
|
+
seats: number;
|
|
10552
11569
|
effectiveAt: string | null;
|
|
10553
11570
|
pendingChange: {
|
|
10554
11571
|
id?: string;
|
|
@@ -10586,12 +11603,19 @@ declare const streampay: <O extends StreamPayOptions>(options: O) => {
|
|
|
10586
11603
|
total_amount?: string;
|
|
10587
11604
|
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
10588
11605
|
};
|
|
10589
|
-
}
|
|
11606
|
+
};
|
|
10590
11607
|
reused: boolean;
|
|
10591
11608
|
} | {
|
|
10592
11609
|
mode: string;
|
|
10593
11610
|
subscriptionId: string;
|
|
10594
|
-
|
|
11611
|
+
seats: number;
|
|
11612
|
+
effectiveAt: null;
|
|
11613
|
+
pendingChange: null;
|
|
11614
|
+
reused: boolean;
|
|
11615
|
+
} | {
|
|
11616
|
+
mode: string;
|
|
11617
|
+
subscriptionId: string;
|
|
11618
|
+
seats: number;
|
|
10595
11619
|
effectiveAt: string | null;
|
|
10596
11620
|
pendingChange: {
|
|
10597
11621
|
id?: string;
|
|
@@ -10879,6 +11903,256 @@ declare const streampay: <O extends StreamPayOptions>(options: O) => {
|
|
|
10879
11903
|
}>)[];
|
|
10880
11904
|
}, {
|
|
10881
11905
|
canceled: boolean;
|
|
11906
|
+
reused: boolean;
|
|
11907
|
+
subscription: {
|
|
11908
|
+
created_at?: string;
|
|
11909
|
+
updated_at?: string | null;
|
|
11910
|
+
id?: string;
|
|
11911
|
+
description?: string | null;
|
|
11912
|
+
amount?: string;
|
|
11913
|
+
original_amount?: string;
|
|
11914
|
+
item_level_discounted_amount?: string;
|
|
11915
|
+
coupon_calculation_metadata?: {
|
|
11916
|
+
coupons?: {
|
|
11917
|
+
coupon_id?: string;
|
|
11918
|
+
name?: string;
|
|
11919
|
+
is_percentage?: boolean;
|
|
11920
|
+
discount_value?: string;
|
|
11921
|
+
currency?: string | null;
|
|
11922
|
+
order?: number;
|
|
11923
|
+
amount_before_discount?: string;
|
|
11924
|
+
discount_amount?: string;
|
|
11925
|
+
amount_after_discount?: string;
|
|
11926
|
+
}[];
|
|
11927
|
+
};
|
|
11928
|
+
remaining_days?: number;
|
|
11929
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
11930
|
+
home_currency_amount?: string | null;
|
|
11931
|
+
exchange_rate_at_creation?: string | null;
|
|
11932
|
+
recurring_interval?: "WEEK" | "MONTH" | "QUARTER" | "YEAR";
|
|
11933
|
+
recurring_interval_count?: number;
|
|
11934
|
+
status?: "INACTIVE" | "ACTIVE" | "EXPIRED" | "CANCELED" | "FROZEN" | "TRIALING" | "TRIAL_PENDING";
|
|
11935
|
+
current_period_start?: string;
|
|
11936
|
+
current_period_end?: string;
|
|
11937
|
+
current_cycle_number?: number;
|
|
11938
|
+
cancel_at_period_end?: boolean;
|
|
11939
|
+
cancel_at_cycle_number?: number | null;
|
|
11940
|
+
started_at?: string | null;
|
|
11941
|
+
ended_at?: string | null;
|
|
11942
|
+
user_id?: string;
|
|
11943
|
+
organization_consumer_id?: string;
|
|
11944
|
+
latest_invoice_id?: string | null;
|
|
11945
|
+
trial_period_days?: number | null;
|
|
11946
|
+
trial_end?: string | null;
|
|
11947
|
+
organization_consumer?: {
|
|
11948
|
+
id?: string;
|
|
11949
|
+
name?: string;
|
|
11950
|
+
alias?: string | null;
|
|
11951
|
+
email?: string | null;
|
|
11952
|
+
phone_number?: string | null;
|
|
11953
|
+
preferred_language?: "AR" | "EN";
|
|
11954
|
+
consumer_type: "INDIVIDUAL" | "BUSINESS";
|
|
11955
|
+
address?: {
|
|
11956
|
+
address_line_1?: string;
|
|
11957
|
+
address_line_2?: string | null;
|
|
11958
|
+
city?: string;
|
|
11959
|
+
postal_code?: string | null;
|
|
11960
|
+
country?: string;
|
|
11961
|
+
};
|
|
11962
|
+
vat_number?: string | null;
|
|
11963
|
+
commercial_registration?: string | null;
|
|
11964
|
+
};
|
|
11965
|
+
items?: {
|
|
11966
|
+
created_at?: string;
|
|
11967
|
+
updated_at?: string | null;
|
|
11968
|
+
id?: string;
|
|
11969
|
+
product_id?: string;
|
|
11970
|
+
subscription_id?: string;
|
|
11971
|
+
quantity?: number;
|
|
11972
|
+
original_amount?: string;
|
|
11973
|
+
discounted_amount?: string;
|
|
11974
|
+
coupon_calculation_metadata?: {
|
|
11975
|
+
coupons?: {
|
|
11976
|
+
coupon_id?: string;
|
|
11977
|
+
name?: string;
|
|
11978
|
+
is_percentage?: boolean;
|
|
11979
|
+
discount_value?: string;
|
|
11980
|
+
currency?: string | null;
|
|
11981
|
+
order?: number;
|
|
11982
|
+
amount_before_discount?: string;
|
|
11983
|
+
discount_amount?: string;
|
|
11984
|
+
amount_after_discount?: string;
|
|
11985
|
+
}[];
|
|
11986
|
+
};
|
|
11987
|
+
product?: {
|
|
11988
|
+
created_at?: string;
|
|
11989
|
+
updated_at?: string | null;
|
|
11990
|
+
id?: string;
|
|
11991
|
+
name?: string;
|
|
11992
|
+
description?: string | null;
|
|
11993
|
+
type?: "RECURRING" | "ONE_OFF";
|
|
11994
|
+
recurring_interval?: "WEEK" | "MONTH" | "YEAR" | "SEMESTER";
|
|
11995
|
+
recurring_interval_count?: number;
|
|
11996
|
+
price?: string;
|
|
11997
|
+
currency: "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BOV" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHE" | "CHF" | "CHW" | "CLF" | "CLP" | "CNY" | "COP" | "COU" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "IQD" | "IRR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MXV" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLE" | "SLL" | "SOS" | "SRD" | "SSP" | "STN" | "SVC" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "USN" | "UYI" | "UYU" | "UYW" | "UZS" | "VED" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "XSU" | "XUA" | "YER" | "ZAR" | "ZMW" | "ZWL";
|
|
11998
|
+
is_price_exempt_from_vat?: boolean;
|
|
11999
|
+
is_price_inclusive_of_vat?: boolean;
|
|
12000
|
+
price_excluding_vat?: string;
|
|
12001
|
+
vat_amount?: string;
|
|
12002
|
+
prices?: {
|
|
12003
|
+
id?: string;
|
|
12004
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
12005
|
+
amount?: string;
|
|
12006
|
+
is_active?: boolean;
|
|
12007
|
+
is_price_inclusive_of_vat?: boolean;
|
|
12008
|
+
is_price_exempt_from_vat?: boolean;
|
|
12009
|
+
price_excluding_vat?: string;
|
|
12010
|
+
vat_amount?: string;
|
|
12011
|
+
}[];
|
|
12012
|
+
is_active?: boolean;
|
|
12013
|
+
is_one_time?: boolean;
|
|
12014
|
+
is_used_in_finalized_invoice: boolean;
|
|
12015
|
+
};
|
|
12016
|
+
}[] | null;
|
|
12017
|
+
latest_invoice?: {
|
|
12018
|
+
created_at?: string;
|
|
12019
|
+
updated_at?: string | null;
|
|
12020
|
+
id?: string;
|
|
12021
|
+
payment_link_id?: string | null;
|
|
12022
|
+
user_id?: string;
|
|
12023
|
+
organization_id?: string;
|
|
12024
|
+
organization_consumer_id?: string;
|
|
12025
|
+
account_id?: string;
|
|
12026
|
+
branch_id?: string;
|
|
12027
|
+
org_invoice_number?: number;
|
|
12028
|
+
description?: string | null;
|
|
12029
|
+
total_amount?: string;
|
|
12030
|
+
original_amount?: string;
|
|
12031
|
+
item_level_discounted_amount?: string;
|
|
12032
|
+
total_vat_amount?: string | null;
|
|
12033
|
+
total_price_excluding_vat?: string | null;
|
|
12034
|
+
coupon_calculation_metadata?: {
|
|
12035
|
+
coupons?: {
|
|
12036
|
+
coupon_id?: string;
|
|
12037
|
+
name?: string;
|
|
12038
|
+
is_percentage?: boolean;
|
|
12039
|
+
discount_value?: string;
|
|
12040
|
+
currency?: string | null;
|
|
12041
|
+
order?: number;
|
|
12042
|
+
amount_before_discount?: string;
|
|
12043
|
+
discount_amount?: string;
|
|
12044
|
+
amount_after_discount?: string;
|
|
12045
|
+
}[];
|
|
12046
|
+
};
|
|
12047
|
+
currency: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
12048
|
+
home_currency_amount?: string | null;
|
|
12049
|
+
home_currency_amount_actual?: string | null;
|
|
12050
|
+
exchange_rate_at_creation?: string | null;
|
|
12051
|
+
consumer_message?: string | null;
|
|
12052
|
+
status?: "CREATED" | "ACCEPTED" | "EXPIRED" | "CANCELED" | "DRAFT" | "SENT" | "REJECTED" | "COMPLETED";
|
|
12053
|
+
payment_method?: "OPENBANKING" | "PAYMENTGATEWAY";
|
|
12054
|
+
allowed_payment_flow?: "ALL" | "AUTO" | "MANUAL";
|
|
12055
|
+
current_payment_flow?: "ALL" | "AUTO" | "MANUAL";
|
|
12056
|
+
period_start?: string | null;
|
|
12057
|
+
period_end?: string | null;
|
|
12058
|
+
recurring_interval?: "WEEK" | "MONTH" | "YEAR" | "SEMESTER";
|
|
12059
|
+
recurring_interval_count?: number | null;
|
|
12060
|
+
type?: "RECURRING" | "ONE_OFF" | "ONE_OFF_FUTURE" | "INSTALLMENTS" | "PRORATION";
|
|
12061
|
+
readonly total_amount_in_smallest_unit?: number;
|
|
12062
|
+
readonly original_amount_in_smallest_unit?: number;
|
|
12063
|
+
};
|
|
12064
|
+
latest_freeze?: {
|
|
12065
|
+
created_at?: string;
|
|
12066
|
+
updated_at?: string | null;
|
|
12067
|
+
id?: string;
|
|
12068
|
+
freeze_start_datetime?: string;
|
|
12069
|
+
freeze_end_datetime?: string | null;
|
|
12070
|
+
notes?: string | null;
|
|
12071
|
+
subscription_id?: string;
|
|
12072
|
+
invoice_id?: string;
|
|
12073
|
+
duration?: number | null;
|
|
12074
|
+
};
|
|
12075
|
+
override_payment_methods?: {
|
|
12076
|
+
visa?: boolean | null;
|
|
12077
|
+
mastercard?: boolean | null;
|
|
12078
|
+
amex?: boolean | null;
|
|
12079
|
+
bank_transfer?: boolean | null;
|
|
12080
|
+
installment?: boolean | null;
|
|
12081
|
+
qurrah?: boolean | null;
|
|
12082
|
+
subscription_auto_renewal?: boolean | null;
|
|
12083
|
+
};
|
|
12084
|
+
pending_change?: {
|
|
12085
|
+
id?: string;
|
|
12086
|
+
effective_at?: string;
|
|
12087
|
+
invoice_was_reissued?: boolean;
|
|
12088
|
+
target_items?: {
|
|
12089
|
+
product_id?: string;
|
|
12090
|
+
product_name?: string;
|
|
12091
|
+
quantity?: number;
|
|
12092
|
+
original_amount?: string;
|
|
12093
|
+
discounted_amount?: string;
|
|
12094
|
+
}[];
|
|
12095
|
+
target_subscription_coupon_ids?: string[];
|
|
12096
|
+
target_recurring_interval?: "WEEK" | "MONTH" | "QUARTER" | "YEAR";
|
|
12097
|
+
target_recurring_interval_count?: number;
|
|
12098
|
+
target_amount?: string;
|
|
12099
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
12100
|
+
current_amount?: string;
|
|
12101
|
+
delta_amount?: string;
|
|
12102
|
+
delta_amount_per_month?: string | null;
|
|
12103
|
+
changes?: {
|
|
12104
|
+
kind?: "PRODUCT_ADDED" | "PRODUCT_REMOVED" | "PRODUCT_REPLACED" | "QUANTITY_DECREASED" | "QUANTITY_INCREASED" | "COUPON_ADDED" | "COUPON_REMOVED" | "INTERVAL_CHANGED";
|
|
12105
|
+
label?: string;
|
|
12106
|
+
product_id?: string | null;
|
|
12107
|
+
from_value?: string | null;
|
|
12108
|
+
to_value?: string | null;
|
|
12109
|
+
}[];
|
|
12110
|
+
next_invoice_preview?: {
|
|
12111
|
+
period_start?: string;
|
|
12112
|
+
period_end?: string;
|
|
12113
|
+
issue_at?: string;
|
|
12114
|
+
due_at?: string;
|
|
12115
|
+
subtotal?: string;
|
|
12116
|
+
discount_total?: string;
|
|
12117
|
+
total_amount?: string;
|
|
12118
|
+
currency?: "SAR" | "USD" | "EUR" | "GBP" | "AED" | "BHD" | "KWD" | "OMR" | "QAR";
|
|
12119
|
+
};
|
|
12120
|
+
};
|
|
12121
|
+
readonly amount_in_smallest_unit?: number;
|
|
12122
|
+
readonly original_amount_in_smallest_unit?: number;
|
|
12123
|
+
};
|
|
12124
|
+
}>;
|
|
12125
|
+
cancelSubscriptionPendingChange: better_auth.StrictEndpoint<"/subscription/pending-change/cancel", {
|
|
12126
|
+
method: "POST";
|
|
12127
|
+
body: zod.ZodObject<{
|
|
12128
|
+
subscriptionId: zod.ZodString;
|
|
12129
|
+
}, zod_v4_core.$strip>;
|
|
12130
|
+
use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
|
|
12131
|
+
session: {
|
|
12132
|
+
session: Record<string, any> & {
|
|
12133
|
+
id: string;
|
|
12134
|
+
createdAt: Date;
|
|
12135
|
+
updatedAt: Date;
|
|
12136
|
+
userId: string;
|
|
12137
|
+
expiresAt: Date;
|
|
12138
|
+
token: string;
|
|
12139
|
+
ipAddress?: string | null | undefined;
|
|
12140
|
+
userAgent?: string | null | undefined;
|
|
12141
|
+
};
|
|
12142
|
+
user: Record<string, any> & {
|
|
12143
|
+
id: string;
|
|
12144
|
+
createdAt: Date;
|
|
12145
|
+
updatedAt: Date;
|
|
12146
|
+
email: string;
|
|
12147
|
+
emailVerified: boolean;
|
|
12148
|
+
name: string;
|
|
12149
|
+
image?: string | null | undefined;
|
|
12150
|
+
};
|
|
12151
|
+
};
|
|
12152
|
+
}>)[];
|
|
12153
|
+
}, {
|
|
12154
|
+
canceled: boolean;
|
|
12155
|
+
reused: boolean;
|
|
10882
12156
|
subscription: {
|
|
10883
12157
|
created_at?: string;
|
|
10884
12158
|
updated_at?: string | null;
|
|
@@ -11486,6 +12760,7 @@ declare const streampay: <O extends StreamPayOptions>(options: O) => {
|
|
|
11486
12760
|
};
|
|
11487
12761
|
}>)[];
|
|
11488
12762
|
}, {
|
|
12763
|
+
seats: number;
|
|
11489
12764
|
plan: StreamPayPlanLike | null;
|
|
11490
12765
|
id: string;
|
|
11491
12766
|
referenceId: string;
|
|
@@ -11517,6 +12792,8 @@ declare const streampay: <O extends StreamPayOptions>(options: O) => {
|
|
|
11517
12792
|
pendingPlan: string | null;
|
|
11518
12793
|
pendingProductId: string | null;
|
|
11519
12794
|
pendingPlanEffectiveAt: Date | null;
|
|
12795
|
+
pendingSeats: number | null;
|
|
12796
|
+
pendingSeatsEffectiveAt: Date | null;
|
|
11520
12797
|
endedAt: Date | null;
|
|
11521
12798
|
frozenAt: Date | null;
|
|
11522
12799
|
freezeEndAt: Date | null;
|
|
@@ -11560,6 +12837,7 @@ declare const streampay: <O extends StreamPayOptions>(options: O) => {
|
|
|
11560
12837
|
};
|
|
11561
12838
|
}>)[];
|
|
11562
12839
|
}, {
|
|
12840
|
+
seats: number;
|
|
11563
12841
|
plan: StreamPayPlanLike | null;
|
|
11564
12842
|
id: string;
|
|
11565
12843
|
referenceId: string;
|
|
@@ -11591,6 +12869,8 @@ declare const streampay: <O extends StreamPayOptions>(options: O) => {
|
|
|
11591
12869
|
pendingPlan: string | null;
|
|
11592
12870
|
pendingProductId: string | null;
|
|
11593
12871
|
pendingPlanEffectiveAt: Date | null;
|
|
12872
|
+
pendingSeats: number | null;
|
|
12873
|
+
pendingSeatsEffectiveAt: Date | null;
|
|
11594
12874
|
endedAt: Date | null;
|
|
11595
12875
|
frozenAt: Date | null;
|
|
11596
12876
|
freezeEndAt: Date | null;
|
|
@@ -11696,6 +12976,7 @@ declare const streampay: <O extends StreamPayOptions>(options: O) => {
|
|
|
11696
12976
|
type: "string";
|
|
11697
12977
|
required: false;
|
|
11698
12978
|
input: false;
|
|
12979
|
+
unique: true;
|
|
11699
12980
|
};
|
|
11700
12981
|
};
|
|
11701
12982
|
};
|
|
@@ -11724,4 +13005,4 @@ declare const streampay: <O extends StreamPayOptions>(options: O) => {
|
|
|
11724
13005
|
};
|
|
11725
13006
|
};
|
|
11726
13007
|
|
|
11727
|
-
export { $ERROR_CODES as $, type AdminOptions as A, type
|
|
13008
|
+
export { $ERROR_CODES as $, type AdminOptions as A, type StreamPayHookContext as B, CheckoutBody as C, DEFAULT_ACCESS_STATUSES as D, type ErrorCodeEntry as E, type FeatureKey as F, type StreamPayInvoiceEventType as G, type StreamPayOptions as H, type StreamPayPaymentEventType as I, type StreamPayPaymentLinkEventType as J, type StreamPayPlan as K, type LimitCheckResult as L, type StreamPayPlanLike as M, type StreamPayPlugin as N, type StreamPayPluginRegistry as O, PLAN_NAME_METADATA_KEY as P, type StreamPayPlugins as Q, REFERENCE_ID_METADATA_KEY as R, type StreamPayErrorCode as S, type StreamPayProduct as T, type StreamPaySeatBilling as U, type StreamPaySubscriptionEventType as V, type StreamPayWebhookData as W, type StreamPayWebhookEnvelope as X, type StreamPayWebhookPayload as Y, type Subscription as Z, type SubscriptionBillingStatus as _, type StreamPayClient as a, type SubscriptionCallback as a0, type SubscriptionCallbackData as a1, type SubscriptionCallbacks as a2, type SubscriptionReferenceType as a3, type SubscriptionStatus as a4, type SubscriptionsOptions as a5, type SyncContext as a6, type TrialEligibilityContext as a7, type WebhookEnvelopeHandler as a8, type WebhookHandler as a9, type WebhookHandlers as aa, type WebhookSyncFailure as ab, type WebhooksOptions as ac, admin as ad, checkLimit as ae, checkout as af, classifyWebhookFailure as ag, dispatchWebhook as ah, hasFeature as ai, hasSubscriptionAccess as aj, isKnownStreamPayWebhookPayload as ak, isStreamPayWebhookEnvelope as al, mapToErrorCode as am, portal as an, subscriptionSlotKey as ao, subscriptions as ap, syncWebhookPayload as aq, webhooks as ar, type AuthorizeReferenceContext as b, type CheckoutCreatedContext as c, type CheckoutOptions as d, type CheckoutOverrides as e, type CheckoutParams as f, type CheckoutResolutionContext as g, type ClaimExistingConsumerBy as h, type ClaimExistingConsumerIdentifier as i, type ConsumerCreateOverrides as j, type PluginAdapter as k, type PortalOptions as l, REFERENCE_TYPE_METADATA_KEY as m, type ResolvedPlans as n, STREAMPAY_EVENT_TYPES as o, STREAMPAY_INVOICE_EVENT_TYPES as p, STREAMPAY_PAYMENT_EVENT_TYPES as q, STREAMPAY_PAYMENT_LINK_EVENT_TYPES as r, streampay as s, STREAMPAY_SUBSCRIPTION_EVENT_TYPES as t, SUBSCRIPTION_ROW_ID_METADATA_KEY as u, type StreamPayCustomFieldDefinition as v, type StreamPayCustomFieldsSchema as w, type StreamPayEndpoints as x, type StreamPayEntityType as y, type StreamPayEventType as z };
|