better-auth-streampay 3.0.0 → 3.0.2
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 +67 -650
- package/dist/client.d.cts +3 -3
- package/dist/client.d.ts +3 -3
- package/dist/index.cjs +181 -121
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +181 -121
- package/dist/index.js.map +1 -1
- package/dist/{streampay-Cfl70SR_.d.cts → streampay-uhs67tYl.d.cts} +28 -13
- package/dist/{streampay-Cfl70SR_.d.ts → streampay-uhs67tYl.d.ts} +28 -13
- package/docs/integration.md +716 -0
- package/docs/staging-validation.md +159 -0
- package/docs/subscriptions.md +271 -0
- package/package.json +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import * as better_auth from 'better-auth';
|
|
2
|
+
import { Where, GenericEndpointContext, User, UnionToIntersection } from 'better-auth';
|
|
1
3
|
import * as _streamsdk_typescript from '@streamsdk/typescript';
|
|
2
4
|
import { SubscriptionDetailed, CurrencyCode, CreatePaymentLinkDto, FreezeListResponse, PaymentRefundRequest, SubscriptionUpdate, ConsumerCreate, ConsumerResponse, PaginationParams, ConsumerListResponse, ConsumerUpdate, PaymentLinkDetailed, PaymentLinkListResponse, UpdatePaymentLinkStatusDto, ProductCreate, ProductDto, ProductListResponse, ProductUpdate, CouponCreate, CouponDetailed, CouponListResponse, CouponUpdate, SubscriptionCreate, SubscriptionListResponse, SubscriptionCancel, FreezeSubscriptionCreateRequest, FreezeSubscriptionBase, FreezeSubscriptionUpdateRequest, InvoiceListResponse, InvoiceDetailed, PaymentListResponse, PaymentResponse } from '@streamsdk/typescript';
|
|
3
|
-
import * as better_auth from 'better-auth';
|
|
4
|
-
import { GenericEndpointContext, User, UnionToIntersection } from 'better-auth';
|
|
5
5
|
import * as zod from 'zod';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import * as zod_v4_core from 'zod/v4/core';
|
|
@@ -55,6 +55,32 @@ declare const $ERROR_CODES: {
|
|
|
55
55
|
type StreamPayErrorCode = keyof typeof $ERROR_CODES;
|
|
56
56
|
declare function mapToErrorCode(rawCode: string | undefined, status: number | undefined): StreamPayErrorCode;
|
|
57
57
|
|
|
58
|
+
interface StreamPayLoggerContext {
|
|
59
|
+
context: {
|
|
60
|
+
adapter?: {
|
|
61
|
+
findOne: <T = unknown>(input: {
|
|
62
|
+
model: string;
|
|
63
|
+
where: Where[];
|
|
64
|
+
}) => Promise<T | null>;
|
|
65
|
+
update?: (input: {
|
|
66
|
+
model: string;
|
|
67
|
+
update: Record<string, unknown>;
|
|
68
|
+
where: Where[];
|
|
69
|
+
}) => Promise<unknown>;
|
|
70
|
+
};
|
|
71
|
+
internalAdapter?: {
|
|
72
|
+
updateUser?: (userId: string, data: Record<string, unknown>) => Promise<unknown>;
|
|
73
|
+
listUsers?: (limit: number, offset: number, sortBy: undefined, where: Where[]) => Promise<Record<string, unknown>[]>;
|
|
74
|
+
};
|
|
75
|
+
logger: {
|
|
76
|
+
error: (message: string) => void;
|
|
77
|
+
warn: (message: string) => void;
|
|
78
|
+
info: (message: string) => void;
|
|
79
|
+
debug: (message: string) => void;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
58
84
|
interface StreamPaySessionUser {
|
|
59
85
|
id: string;
|
|
60
86
|
email?: string;
|
|
@@ -7045,17 +7071,6 @@ interface StreamPayOptions {
|
|
|
7045
7071
|
use: StreamPayPlugins;
|
|
7046
7072
|
}
|
|
7047
7073
|
|
|
7048
|
-
interface StreamPayLoggerContext {
|
|
7049
|
-
context: {
|
|
7050
|
-
logger: {
|
|
7051
|
-
error: (message: string) => void;
|
|
7052
|
-
warn: (message: string) => void;
|
|
7053
|
-
info: (message: string) => void;
|
|
7054
|
-
debug: (message: string) => void;
|
|
7055
|
-
};
|
|
7056
|
-
};
|
|
7057
|
-
}
|
|
7058
|
-
|
|
7059
7074
|
type StreamPayHookContext = StreamPayLoggerContext;
|
|
7060
7075
|
|
|
7061
7076
|
declare const streampay: <O extends StreamPayOptions>(options: O) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import * as better_auth from 'better-auth';
|
|
2
|
+
import { Where, GenericEndpointContext, User, UnionToIntersection } from 'better-auth';
|
|
1
3
|
import * as _streamsdk_typescript from '@streamsdk/typescript';
|
|
2
4
|
import { SubscriptionDetailed, CurrencyCode, CreatePaymentLinkDto, FreezeListResponse, PaymentRefundRequest, SubscriptionUpdate, ConsumerCreate, ConsumerResponse, PaginationParams, ConsumerListResponse, ConsumerUpdate, PaymentLinkDetailed, PaymentLinkListResponse, UpdatePaymentLinkStatusDto, ProductCreate, ProductDto, ProductListResponse, ProductUpdate, CouponCreate, CouponDetailed, CouponListResponse, CouponUpdate, SubscriptionCreate, SubscriptionListResponse, SubscriptionCancel, FreezeSubscriptionCreateRequest, FreezeSubscriptionBase, FreezeSubscriptionUpdateRequest, InvoiceListResponse, InvoiceDetailed, PaymentListResponse, PaymentResponse } from '@streamsdk/typescript';
|
|
3
|
-
import * as better_auth from 'better-auth';
|
|
4
|
-
import { GenericEndpointContext, User, UnionToIntersection } from 'better-auth';
|
|
5
5
|
import * as zod from 'zod';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import * as zod_v4_core from 'zod/v4/core';
|
|
@@ -55,6 +55,32 @@ declare const $ERROR_CODES: {
|
|
|
55
55
|
type StreamPayErrorCode = keyof typeof $ERROR_CODES;
|
|
56
56
|
declare function mapToErrorCode(rawCode: string | undefined, status: number | undefined): StreamPayErrorCode;
|
|
57
57
|
|
|
58
|
+
interface StreamPayLoggerContext {
|
|
59
|
+
context: {
|
|
60
|
+
adapter?: {
|
|
61
|
+
findOne: <T = unknown>(input: {
|
|
62
|
+
model: string;
|
|
63
|
+
where: Where[];
|
|
64
|
+
}) => Promise<T | null>;
|
|
65
|
+
update?: (input: {
|
|
66
|
+
model: string;
|
|
67
|
+
update: Record<string, unknown>;
|
|
68
|
+
where: Where[];
|
|
69
|
+
}) => Promise<unknown>;
|
|
70
|
+
};
|
|
71
|
+
internalAdapter?: {
|
|
72
|
+
updateUser?: (userId: string, data: Record<string, unknown>) => Promise<unknown>;
|
|
73
|
+
listUsers?: (limit: number, offset: number, sortBy: undefined, where: Where[]) => Promise<Record<string, unknown>[]>;
|
|
74
|
+
};
|
|
75
|
+
logger: {
|
|
76
|
+
error: (message: string) => void;
|
|
77
|
+
warn: (message: string) => void;
|
|
78
|
+
info: (message: string) => void;
|
|
79
|
+
debug: (message: string) => void;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
58
84
|
interface StreamPaySessionUser {
|
|
59
85
|
id: string;
|
|
60
86
|
email?: string;
|
|
@@ -7045,17 +7071,6 @@ interface StreamPayOptions {
|
|
|
7045
7071
|
use: StreamPayPlugins;
|
|
7046
7072
|
}
|
|
7047
7073
|
|
|
7048
|
-
interface StreamPayLoggerContext {
|
|
7049
|
-
context: {
|
|
7050
|
-
logger: {
|
|
7051
|
-
error: (message: string) => void;
|
|
7052
|
-
warn: (message: string) => void;
|
|
7053
|
-
info: (message: string) => void;
|
|
7054
|
-
debug: (message: string) => void;
|
|
7055
|
-
};
|
|
7056
|
-
};
|
|
7057
|
-
}
|
|
7058
|
-
|
|
7059
7074
|
type StreamPayHookContext = StreamPayLoggerContext;
|
|
7060
7075
|
|
|
7061
7076
|
declare const streampay: <O extends StreamPayOptions>(options: O) => {
|