better-auth-streampay 1.3.0 → 2.0.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 +265 -500
- package/dist/client.cjs +11 -0
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +14 -4
- package/dist/client.d.ts +14 -4
- package/dist/client.js +11 -0
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +1888 -800
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +142 -13
- package/dist/index.d.ts +142 -13
- package/dist/index.js +1883 -802
- package/dist/index.js.map +1 -1
- package/dist/{streampay-1mamzabs.d.cts → streampay-CYAHE6Qj.d.cts} +5494 -1740
- package/dist/{streampay-1mamzabs.d.ts → streampay-CYAHE6Qj.d.ts} +5494 -1740
- package/package.json +22 -10
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as StreamPayClient } from './streampay-
|
|
2
|
-
export { $ as $ERROR_CODES, A as AdminOptions, b as AuthorizeReferenceContext, C as CheckoutBody, c as CheckoutOptions, d as CheckoutParams, e as ClaimExistingConsumerBy, f as ClaimExistingConsumerIdentifier, g as ConsumerCreateOverrides, F as FeatureKey, L as LimitCheckResult, P as PLAN_NAME_METADATA_KEY, h as PluginAdapter, i as PortalOptions, R as REFERENCE_ID_METADATA_KEY, j as
|
|
1
|
+
import { a as StreamPayClient } from './streampay-CYAHE6Qj.cjs';
|
|
2
|
+
export { $ as $ERROR_CODES, A as AdminOptions, b as AuthorizeReferenceContext, C as CheckoutBody, c as CheckoutOptions, d as CheckoutParams, e as ClaimExistingConsumerBy, f as ClaimExistingConsumerIdentifier, g as ConsumerCreateOverrides, D as DEFAULT_ACCESS_STATUSES, F as FeatureKey, L as LimitCheckResult, P as PLAN_NAME_METADATA_KEY, h as PluginAdapter, i as PortalOptions, R as REFERENCE_ID_METADATA_KEY, j as REFERENCE_TYPE_METADATA_KEY, k as ResolvedPlans, l as STREAMPAY_EVENT_TYPES, m as STREAMPAY_INVOICE_EVENT_TYPES, n as STREAMPAY_PAYMENT_EVENT_TYPES, o as STREAMPAY_PAYMENT_LINK_EVENT_TYPES, p as STREAMPAY_SUBSCRIPTION_EVENT_TYPES, q as SUBSCRIPTION_ROW_ID_METADATA_KEY, r as StreamPayCustomFieldDefinition, t as StreamPayCustomFieldsSchema, u as StreamPayEndpoints, v as StreamPayEntityType, S as StreamPayErrorCode, w as StreamPayEventType, x as StreamPayHookContext, y as StreamPayInvoiceEventType, z as StreamPayOptions, B as StreamPayPaymentEventType, G as StreamPayPaymentLinkEventType, H as StreamPayPlan, I as StreamPayPlanLike, J as StreamPayPlugin, K as StreamPayPluginRegistry, M as StreamPayPlugins, N as StreamPayProduct, O as StreamPaySubscriptionEventType, Q as StreamPayWebhookData, T as StreamPayWebhookEnvelope, U as StreamPayWebhookPayload, V as Subscription, W as SubscriptionBillingStatus, X as SubscriptionCallback, Y as SubscriptionCallbackData, Z as SubscriptionCallbacks, _ as SubscriptionReferenceType, a0 as SubscriptionStatus, a1 as SubscriptionsOptions, a2 as SyncContext, a3 as TrialEligibilityContext, a4 as WebhookEnvelopeHandler, a5 as WebhookHandler, a6 as WebhookHandlers, a7 as WebhookSyncFailure, a8 as WebhooksOptions, a9 as admin, aa as checkLimit, ab as checkout, ac as classifyWebhookFailure, ad as dispatchWebhook, ae as hasFeature, af as hasSubscriptionAccess, ag as isKnownStreamPayWebhookPayload, ah as isStreamPayWebhookEnvelope, ai as mapToErrorCode, aj as portal, s as streampay, ak as subscriptionSlotKey, al as subscriptions, am as syncWebhookPayload, an as webhooks } from './streampay-CYAHE6Qj.cjs';
|
|
3
3
|
import { InvoiceDetailed, PaymentResponse, ConsumerResponse } from '@streamsdk/typescript';
|
|
4
4
|
import 'better-auth';
|
|
5
|
-
import 'zod/v4/core';
|
|
6
5
|
import 'zod';
|
|
6
|
+
import 'zod/v4/core';
|
|
7
7
|
|
|
8
8
|
declare const subscriptionSchema: {
|
|
9
9
|
readonly streampayWebhookEvent: {
|
|
@@ -17,15 +17,44 @@ declare const subscriptionSchema: {
|
|
|
17
17
|
readonly type: "string";
|
|
18
18
|
readonly required: true;
|
|
19
19
|
};
|
|
20
|
-
readonly
|
|
20
|
+
readonly receivedAt: {
|
|
21
21
|
readonly type: "date";
|
|
22
22
|
readonly required: true;
|
|
23
23
|
readonly index: true;
|
|
24
24
|
};
|
|
25
|
+
readonly lastAttemptAt: {
|
|
26
|
+
readonly type: "date";
|
|
27
|
+
readonly required: false;
|
|
28
|
+
readonly index: true;
|
|
29
|
+
};
|
|
30
|
+
readonly nextAttemptAt: {
|
|
31
|
+
readonly type: "date";
|
|
32
|
+
readonly required: false;
|
|
33
|
+
readonly index: true;
|
|
34
|
+
};
|
|
35
|
+
readonly completedAt: {
|
|
36
|
+
readonly type: "date";
|
|
37
|
+
readonly required: false;
|
|
38
|
+
readonly index: true;
|
|
39
|
+
};
|
|
40
|
+
readonly deadLetteredAt: {
|
|
41
|
+
readonly type: "date";
|
|
42
|
+
readonly required: false;
|
|
43
|
+
readonly index: true;
|
|
44
|
+
};
|
|
45
|
+
readonly lockedAt: {
|
|
46
|
+
readonly type: "date";
|
|
47
|
+
readonly required: false;
|
|
48
|
+
readonly index: true;
|
|
49
|
+
};
|
|
50
|
+
readonly lockedBy: {
|
|
51
|
+
readonly type: "string";
|
|
52
|
+
readonly required: false;
|
|
53
|
+
};
|
|
25
54
|
readonly status: {
|
|
26
55
|
readonly type: "string";
|
|
27
56
|
readonly required: false;
|
|
28
|
-
readonly defaultValue: "
|
|
57
|
+
readonly defaultValue: "pending";
|
|
29
58
|
readonly index: true;
|
|
30
59
|
};
|
|
31
60
|
readonly attemptCount: {
|
|
@@ -33,10 +62,6 @@ declare const subscriptionSchema: {
|
|
|
33
62
|
readonly required: false;
|
|
34
63
|
readonly defaultValue: 1;
|
|
35
64
|
};
|
|
36
|
-
readonly firstSeenAt: {
|
|
37
|
-
readonly type: "date";
|
|
38
|
-
readonly required: false;
|
|
39
|
-
};
|
|
40
65
|
readonly rawPayload: {
|
|
41
66
|
readonly type: "string";
|
|
42
67
|
readonly required: false;
|
|
@@ -49,6 +74,11 @@ declare const subscriptionSchema: {
|
|
|
49
74
|
readonly type: "string";
|
|
50
75
|
readonly required: false;
|
|
51
76
|
};
|
|
77
|
+
readonly lastErrorCode: {
|
|
78
|
+
readonly type: "string";
|
|
79
|
+
readonly required: false;
|
|
80
|
+
readonly index: true;
|
|
81
|
+
};
|
|
52
82
|
};
|
|
53
83
|
};
|
|
54
84
|
readonly subscription: {
|
|
@@ -57,6 +87,19 @@ declare const subscriptionSchema: {
|
|
|
57
87
|
readonly type: "string";
|
|
58
88
|
readonly required: true;
|
|
59
89
|
readonly input: false;
|
|
90
|
+
readonly index: true;
|
|
91
|
+
};
|
|
92
|
+
readonly referenceType: {
|
|
93
|
+
readonly type: "string";
|
|
94
|
+
readonly required: false;
|
|
95
|
+
readonly defaultValue: "user";
|
|
96
|
+
readonly input: false;
|
|
97
|
+
};
|
|
98
|
+
readonly activeSlotKey: {
|
|
99
|
+
readonly type: "string";
|
|
100
|
+
readonly required: false;
|
|
101
|
+
readonly unique: true;
|
|
102
|
+
readonly input: false;
|
|
60
103
|
};
|
|
61
104
|
readonly streampaySubscriptionId: {
|
|
62
105
|
readonly type: "string";
|
|
@@ -68,16 +111,37 @@ declare const subscriptionSchema: {
|
|
|
68
111
|
readonly type: "string";
|
|
69
112
|
readonly required: false;
|
|
70
113
|
readonly input: false;
|
|
114
|
+
readonly index: true;
|
|
115
|
+
};
|
|
116
|
+
readonly streampayPaymentLinkId: {
|
|
117
|
+
readonly type: "string";
|
|
118
|
+
readonly required: false;
|
|
119
|
+
readonly unique: true;
|
|
120
|
+
readonly input: false;
|
|
71
121
|
};
|
|
72
122
|
readonly plan: {
|
|
73
123
|
readonly type: "string";
|
|
74
124
|
readonly required: true;
|
|
75
125
|
};
|
|
126
|
+
readonly planVersion: {
|
|
127
|
+
readonly type: "string";
|
|
128
|
+
readonly required: false;
|
|
129
|
+
};
|
|
130
|
+
readonly productId: {
|
|
131
|
+
readonly type: "string";
|
|
132
|
+
readonly required: false;
|
|
133
|
+
readonly index: true;
|
|
134
|
+
};
|
|
76
135
|
readonly group: {
|
|
77
136
|
readonly type: "string";
|
|
78
137
|
readonly required: false;
|
|
138
|
+
readonly index: true;
|
|
79
139
|
};
|
|
80
|
-
readonly
|
|
140
|
+
readonly amountInSmallestUnit: {
|
|
141
|
+
readonly type: "number";
|
|
142
|
+
readonly required: false;
|
|
143
|
+
};
|
|
144
|
+
readonly originalAmountInSmallestUnit: {
|
|
81
145
|
readonly type: "number";
|
|
82
146
|
readonly required: false;
|
|
83
147
|
};
|
|
@@ -99,6 +163,17 @@ declare const subscriptionSchema: {
|
|
|
99
163
|
readonly type: "string";
|
|
100
164
|
readonly required: false;
|
|
101
165
|
readonly defaultValue: "incomplete";
|
|
166
|
+
readonly index: true;
|
|
167
|
+
};
|
|
168
|
+
readonly providerStatus: {
|
|
169
|
+
readonly type: "string";
|
|
170
|
+
readonly required: false;
|
|
171
|
+
};
|
|
172
|
+
readonly billingStatus: {
|
|
173
|
+
readonly type: "string";
|
|
174
|
+
readonly required: false;
|
|
175
|
+
readonly defaultValue: "current";
|
|
176
|
+
readonly index: true;
|
|
102
177
|
};
|
|
103
178
|
readonly periodStart: {
|
|
104
179
|
readonly type: "date";
|
|
@@ -108,11 +183,48 @@ declare const subscriptionSchema: {
|
|
|
108
183
|
readonly type: "date";
|
|
109
184
|
readonly required: false;
|
|
110
185
|
};
|
|
186
|
+
readonly currentCycleNumber: {
|
|
187
|
+
readonly type: "number";
|
|
188
|
+
readonly required: false;
|
|
189
|
+
};
|
|
190
|
+
readonly trialStart: {
|
|
191
|
+
readonly type: "date";
|
|
192
|
+
readonly required: false;
|
|
193
|
+
};
|
|
194
|
+
readonly trialEnd: {
|
|
195
|
+
readonly type: "date";
|
|
196
|
+
readonly required: false;
|
|
197
|
+
};
|
|
111
198
|
readonly cancelAtPeriodEnd: {
|
|
112
199
|
readonly type: "boolean";
|
|
113
200
|
readonly required: false;
|
|
114
201
|
readonly defaultValue: false;
|
|
115
202
|
};
|
|
203
|
+
readonly cancelAt: {
|
|
204
|
+
readonly type: "date";
|
|
205
|
+
readonly required: false;
|
|
206
|
+
};
|
|
207
|
+
readonly cancelScheduledAt: {
|
|
208
|
+
readonly type: "date";
|
|
209
|
+
readonly required: false;
|
|
210
|
+
};
|
|
211
|
+
readonly canceledAt: {
|
|
212
|
+
readonly type: "date";
|
|
213
|
+
readonly required: false;
|
|
214
|
+
};
|
|
215
|
+
readonly pendingPlan: {
|
|
216
|
+
readonly type: "string";
|
|
217
|
+
readonly required: false;
|
|
218
|
+
};
|
|
219
|
+
readonly pendingProductId: {
|
|
220
|
+
readonly type: "string";
|
|
221
|
+
readonly required: false;
|
|
222
|
+
readonly index: true;
|
|
223
|
+
};
|
|
224
|
+
readonly pendingPlanEffectiveAt: {
|
|
225
|
+
readonly type: "date";
|
|
226
|
+
readonly required: false;
|
|
227
|
+
};
|
|
116
228
|
readonly endedAt: {
|
|
117
229
|
readonly type: "date";
|
|
118
230
|
readonly required: false;
|
|
@@ -125,6 +237,26 @@ declare const subscriptionSchema: {
|
|
|
125
237
|
readonly type: "date";
|
|
126
238
|
readonly required: false;
|
|
127
239
|
};
|
|
240
|
+
readonly providerUpdatedAt: {
|
|
241
|
+
readonly type: "date";
|
|
242
|
+
readonly required: false;
|
|
243
|
+
};
|
|
244
|
+
readonly syncedAt: {
|
|
245
|
+
readonly type: "date";
|
|
246
|
+
readonly required: false;
|
|
247
|
+
readonly index: true;
|
|
248
|
+
};
|
|
249
|
+
readonly createdAt: {
|
|
250
|
+
readonly type: "date";
|
|
251
|
+
readonly required: false;
|
|
252
|
+
readonly input: false;
|
|
253
|
+
};
|
|
254
|
+
readonly updatedAt: {
|
|
255
|
+
readonly type: "date";
|
|
256
|
+
readonly required: false;
|
|
257
|
+
readonly input: false;
|
|
258
|
+
readonly index: true;
|
|
259
|
+
};
|
|
128
260
|
};
|
|
129
261
|
};
|
|
130
262
|
};
|
|
@@ -136,7 +268,6 @@ type PaymentMethod = NonNullable<PaymentResponse["payment_method"]>;
|
|
|
136
268
|
type RefundReason = NonNullable<PaymentResponse["refund_reason"]>;
|
|
137
269
|
type Language = "AR" | "EN";
|
|
138
270
|
|
|
139
|
-
/** Convert between decimal-SAR strings/numbers and integer halalat (1 SAR = 100 halalat). */
|
|
140
271
|
declare const StreamPayAmount: {
|
|
141
272
|
readonly toHalalat: (sar: string | number) => number;
|
|
142
273
|
readonly toSAR: (halalat: number) => string;
|
|
@@ -190,9 +321,7 @@ declare class StreamPayWebhookError extends Error {
|
|
|
190
321
|
readonly reason: VerifyFailureReason;
|
|
191
322
|
constructor(reason: VerifyFailureReason, message?: string);
|
|
192
323
|
}
|
|
193
|
-
/** Verify a StreamPay webhook signature against the raw body. Returns a result object; never throws. */
|
|
194
324
|
declare function verifyWebhook(input: VerifyWebhookInput): VerifyWebhookResult;
|
|
195
|
-
/** Like `verifyWebhook` but throws `StreamPayWebhookError` on failure; returns the signed timestamp on success. */
|
|
196
325
|
declare function verifyWebhookOrThrow(input: VerifyWebhookInput): number;
|
|
197
326
|
|
|
198
327
|
export { type ConsumerIdentifiers, type InvoiceStatus, type Language, type ParsedStreamPayError, type PaymentMethod, type RefundReason, StreamPayAmount, type StreamPayPaymentStatus, type StreamPayValidationIssue, StreamPayWebhookError, type SubscriptionSchema, type VerifyFailureReason, type VerifyWebhookInput, type VerifyWebhookResult, findConsumerByExternalId, findConsumerByIdentifiers, formatStreamPayError, parseStreamPayError, subscriptionSchema, verifyWebhook, verifyWebhookOrThrow };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as StreamPayClient } from './streampay-
|
|
2
|
-
export { $ as $ERROR_CODES, A as AdminOptions, b as AuthorizeReferenceContext, C as CheckoutBody, c as CheckoutOptions, d as CheckoutParams, e as ClaimExistingConsumerBy, f as ClaimExistingConsumerIdentifier, g as ConsumerCreateOverrides, F as FeatureKey, L as LimitCheckResult, P as PLAN_NAME_METADATA_KEY, h as PluginAdapter, i as PortalOptions, R as REFERENCE_ID_METADATA_KEY, j as
|
|
1
|
+
import { a as StreamPayClient } from './streampay-CYAHE6Qj.js';
|
|
2
|
+
export { $ as $ERROR_CODES, A as AdminOptions, b as AuthorizeReferenceContext, C as CheckoutBody, c as CheckoutOptions, d as CheckoutParams, e as ClaimExistingConsumerBy, f as ClaimExistingConsumerIdentifier, g as ConsumerCreateOverrides, D as DEFAULT_ACCESS_STATUSES, F as FeatureKey, L as LimitCheckResult, P as PLAN_NAME_METADATA_KEY, h as PluginAdapter, i as PortalOptions, R as REFERENCE_ID_METADATA_KEY, j as REFERENCE_TYPE_METADATA_KEY, k as ResolvedPlans, l as STREAMPAY_EVENT_TYPES, m as STREAMPAY_INVOICE_EVENT_TYPES, n as STREAMPAY_PAYMENT_EVENT_TYPES, o as STREAMPAY_PAYMENT_LINK_EVENT_TYPES, p as STREAMPAY_SUBSCRIPTION_EVENT_TYPES, q as SUBSCRIPTION_ROW_ID_METADATA_KEY, r as StreamPayCustomFieldDefinition, t as StreamPayCustomFieldsSchema, u as StreamPayEndpoints, v as StreamPayEntityType, S as StreamPayErrorCode, w as StreamPayEventType, x as StreamPayHookContext, y as StreamPayInvoiceEventType, z as StreamPayOptions, B as StreamPayPaymentEventType, G as StreamPayPaymentLinkEventType, H as StreamPayPlan, I as StreamPayPlanLike, J as StreamPayPlugin, K as StreamPayPluginRegistry, M as StreamPayPlugins, N as StreamPayProduct, O as StreamPaySubscriptionEventType, Q as StreamPayWebhookData, T as StreamPayWebhookEnvelope, U as StreamPayWebhookPayload, V as Subscription, W as SubscriptionBillingStatus, X as SubscriptionCallback, Y as SubscriptionCallbackData, Z as SubscriptionCallbacks, _ as SubscriptionReferenceType, a0 as SubscriptionStatus, a1 as SubscriptionsOptions, a2 as SyncContext, a3 as TrialEligibilityContext, a4 as WebhookEnvelopeHandler, a5 as WebhookHandler, a6 as WebhookHandlers, a7 as WebhookSyncFailure, a8 as WebhooksOptions, a9 as admin, aa as checkLimit, ab as checkout, ac as classifyWebhookFailure, ad as dispatchWebhook, ae as hasFeature, af as hasSubscriptionAccess, ag as isKnownStreamPayWebhookPayload, ah as isStreamPayWebhookEnvelope, ai as mapToErrorCode, aj as portal, s as streampay, ak as subscriptionSlotKey, al as subscriptions, am as syncWebhookPayload, an as webhooks } from './streampay-CYAHE6Qj.js';
|
|
3
3
|
import { InvoiceDetailed, PaymentResponse, ConsumerResponse } from '@streamsdk/typescript';
|
|
4
4
|
import 'better-auth';
|
|
5
|
-
import 'zod/v4/core';
|
|
6
5
|
import 'zod';
|
|
6
|
+
import 'zod/v4/core';
|
|
7
7
|
|
|
8
8
|
declare const subscriptionSchema: {
|
|
9
9
|
readonly streampayWebhookEvent: {
|
|
@@ -17,15 +17,44 @@ declare const subscriptionSchema: {
|
|
|
17
17
|
readonly type: "string";
|
|
18
18
|
readonly required: true;
|
|
19
19
|
};
|
|
20
|
-
readonly
|
|
20
|
+
readonly receivedAt: {
|
|
21
21
|
readonly type: "date";
|
|
22
22
|
readonly required: true;
|
|
23
23
|
readonly index: true;
|
|
24
24
|
};
|
|
25
|
+
readonly lastAttemptAt: {
|
|
26
|
+
readonly type: "date";
|
|
27
|
+
readonly required: false;
|
|
28
|
+
readonly index: true;
|
|
29
|
+
};
|
|
30
|
+
readonly nextAttemptAt: {
|
|
31
|
+
readonly type: "date";
|
|
32
|
+
readonly required: false;
|
|
33
|
+
readonly index: true;
|
|
34
|
+
};
|
|
35
|
+
readonly completedAt: {
|
|
36
|
+
readonly type: "date";
|
|
37
|
+
readonly required: false;
|
|
38
|
+
readonly index: true;
|
|
39
|
+
};
|
|
40
|
+
readonly deadLetteredAt: {
|
|
41
|
+
readonly type: "date";
|
|
42
|
+
readonly required: false;
|
|
43
|
+
readonly index: true;
|
|
44
|
+
};
|
|
45
|
+
readonly lockedAt: {
|
|
46
|
+
readonly type: "date";
|
|
47
|
+
readonly required: false;
|
|
48
|
+
readonly index: true;
|
|
49
|
+
};
|
|
50
|
+
readonly lockedBy: {
|
|
51
|
+
readonly type: "string";
|
|
52
|
+
readonly required: false;
|
|
53
|
+
};
|
|
25
54
|
readonly status: {
|
|
26
55
|
readonly type: "string";
|
|
27
56
|
readonly required: false;
|
|
28
|
-
readonly defaultValue: "
|
|
57
|
+
readonly defaultValue: "pending";
|
|
29
58
|
readonly index: true;
|
|
30
59
|
};
|
|
31
60
|
readonly attemptCount: {
|
|
@@ -33,10 +62,6 @@ declare const subscriptionSchema: {
|
|
|
33
62
|
readonly required: false;
|
|
34
63
|
readonly defaultValue: 1;
|
|
35
64
|
};
|
|
36
|
-
readonly firstSeenAt: {
|
|
37
|
-
readonly type: "date";
|
|
38
|
-
readonly required: false;
|
|
39
|
-
};
|
|
40
65
|
readonly rawPayload: {
|
|
41
66
|
readonly type: "string";
|
|
42
67
|
readonly required: false;
|
|
@@ -49,6 +74,11 @@ declare const subscriptionSchema: {
|
|
|
49
74
|
readonly type: "string";
|
|
50
75
|
readonly required: false;
|
|
51
76
|
};
|
|
77
|
+
readonly lastErrorCode: {
|
|
78
|
+
readonly type: "string";
|
|
79
|
+
readonly required: false;
|
|
80
|
+
readonly index: true;
|
|
81
|
+
};
|
|
52
82
|
};
|
|
53
83
|
};
|
|
54
84
|
readonly subscription: {
|
|
@@ -57,6 +87,19 @@ declare const subscriptionSchema: {
|
|
|
57
87
|
readonly type: "string";
|
|
58
88
|
readonly required: true;
|
|
59
89
|
readonly input: false;
|
|
90
|
+
readonly index: true;
|
|
91
|
+
};
|
|
92
|
+
readonly referenceType: {
|
|
93
|
+
readonly type: "string";
|
|
94
|
+
readonly required: false;
|
|
95
|
+
readonly defaultValue: "user";
|
|
96
|
+
readonly input: false;
|
|
97
|
+
};
|
|
98
|
+
readonly activeSlotKey: {
|
|
99
|
+
readonly type: "string";
|
|
100
|
+
readonly required: false;
|
|
101
|
+
readonly unique: true;
|
|
102
|
+
readonly input: false;
|
|
60
103
|
};
|
|
61
104
|
readonly streampaySubscriptionId: {
|
|
62
105
|
readonly type: "string";
|
|
@@ -68,16 +111,37 @@ declare const subscriptionSchema: {
|
|
|
68
111
|
readonly type: "string";
|
|
69
112
|
readonly required: false;
|
|
70
113
|
readonly input: false;
|
|
114
|
+
readonly index: true;
|
|
115
|
+
};
|
|
116
|
+
readonly streampayPaymentLinkId: {
|
|
117
|
+
readonly type: "string";
|
|
118
|
+
readonly required: false;
|
|
119
|
+
readonly unique: true;
|
|
120
|
+
readonly input: false;
|
|
71
121
|
};
|
|
72
122
|
readonly plan: {
|
|
73
123
|
readonly type: "string";
|
|
74
124
|
readonly required: true;
|
|
75
125
|
};
|
|
126
|
+
readonly planVersion: {
|
|
127
|
+
readonly type: "string";
|
|
128
|
+
readonly required: false;
|
|
129
|
+
};
|
|
130
|
+
readonly productId: {
|
|
131
|
+
readonly type: "string";
|
|
132
|
+
readonly required: false;
|
|
133
|
+
readonly index: true;
|
|
134
|
+
};
|
|
76
135
|
readonly group: {
|
|
77
136
|
readonly type: "string";
|
|
78
137
|
readonly required: false;
|
|
138
|
+
readonly index: true;
|
|
79
139
|
};
|
|
80
|
-
readonly
|
|
140
|
+
readonly amountInSmallestUnit: {
|
|
141
|
+
readonly type: "number";
|
|
142
|
+
readonly required: false;
|
|
143
|
+
};
|
|
144
|
+
readonly originalAmountInSmallestUnit: {
|
|
81
145
|
readonly type: "number";
|
|
82
146
|
readonly required: false;
|
|
83
147
|
};
|
|
@@ -99,6 +163,17 @@ declare const subscriptionSchema: {
|
|
|
99
163
|
readonly type: "string";
|
|
100
164
|
readonly required: false;
|
|
101
165
|
readonly defaultValue: "incomplete";
|
|
166
|
+
readonly index: true;
|
|
167
|
+
};
|
|
168
|
+
readonly providerStatus: {
|
|
169
|
+
readonly type: "string";
|
|
170
|
+
readonly required: false;
|
|
171
|
+
};
|
|
172
|
+
readonly billingStatus: {
|
|
173
|
+
readonly type: "string";
|
|
174
|
+
readonly required: false;
|
|
175
|
+
readonly defaultValue: "current";
|
|
176
|
+
readonly index: true;
|
|
102
177
|
};
|
|
103
178
|
readonly periodStart: {
|
|
104
179
|
readonly type: "date";
|
|
@@ -108,11 +183,48 @@ declare const subscriptionSchema: {
|
|
|
108
183
|
readonly type: "date";
|
|
109
184
|
readonly required: false;
|
|
110
185
|
};
|
|
186
|
+
readonly currentCycleNumber: {
|
|
187
|
+
readonly type: "number";
|
|
188
|
+
readonly required: false;
|
|
189
|
+
};
|
|
190
|
+
readonly trialStart: {
|
|
191
|
+
readonly type: "date";
|
|
192
|
+
readonly required: false;
|
|
193
|
+
};
|
|
194
|
+
readonly trialEnd: {
|
|
195
|
+
readonly type: "date";
|
|
196
|
+
readonly required: false;
|
|
197
|
+
};
|
|
111
198
|
readonly cancelAtPeriodEnd: {
|
|
112
199
|
readonly type: "boolean";
|
|
113
200
|
readonly required: false;
|
|
114
201
|
readonly defaultValue: false;
|
|
115
202
|
};
|
|
203
|
+
readonly cancelAt: {
|
|
204
|
+
readonly type: "date";
|
|
205
|
+
readonly required: false;
|
|
206
|
+
};
|
|
207
|
+
readonly cancelScheduledAt: {
|
|
208
|
+
readonly type: "date";
|
|
209
|
+
readonly required: false;
|
|
210
|
+
};
|
|
211
|
+
readonly canceledAt: {
|
|
212
|
+
readonly type: "date";
|
|
213
|
+
readonly required: false;
|
|
214
|
+
};
|
|
215
|
+
readonly pendingPlan: {
|
|
216
|
+
readonly type: "string";
|
|
217
|
+
readonly required: false;
|
|
218
|
+
};
|
|
219
|
+
readonly pendingProductId: {
|
|
220
|
+
readonly type: "string";
|
|
221
|
+
readonly required: false;
|
|
222
|
+
readonly index: true;
|
|
223
|
+
};
|
|
224
|
+
readonly pendingPlanEffectiveAt: {
|
|
225
|
+
readonly type: "date";
|
|
226
|
+
readonly required: false;
|
|
227
|
+
};
|
|
116
228
|
readonly endedAt: {
|
|
117
229
|
readonly type: "date";
|
|
118
230
|
readonly required: false;
|
|
@@ -125,6 +237,26 @@ declare const subscriptionSchema: {
|
|
|
125
237
|
readonly type: "date";
|
|
126
238
|
readonly required: false;
|
|
127
239
|
};
|
|
240
|
+
readonly providerUpdatedAt: {
|
|
241
|
+
readonly type: "date";
|
|
242
|
+
readonly required: false;
|
|
243
|
+
};
|
|
244
|
+
readonly syncedAt: {
|
|
245
|
+
readonly type: "date";
|
|
246
|
+
readonly required: false;
|
|
247
|
+
readonly index: true;
|
|
248
|
+
};
|
|
249
|
+
readonly createdAt: {
|
|
250
|
+
readonly type: "date";
|
|
251
|
+
readonly required: false;
|
|
252
|
+
readonly input: false;
|
|
253
|
+
};
|
|
254
|
+
readonly updatedAt: {
|
|
255
|
+
readonly type: "date";
|
|
256
|
+
readonly required: false;
|
|
257
|
+
readonly input: false;
|
|
258
|
+
readonly index: true;
|
|
259
|
+
};
|
|
128
260
|
};
|
|
129
261
|
};
|
|
130
262
|
};
|
|
@@ -136,7 +268,6 @@ type PaymentMethod = NonNullable<PaymentResponse["payment_method"]>;
|
|
|
136
268
|
type RefundReason = NonNullable<PaymentResponse["refund_reason"]>;
|
|
137
269
|
type Language = "AR" | "EN";
|
|
138
270
|
|
|
139
|
-
/** Convert between decimal-SAR strings/numbers and integer halalat (1 SAR = 100 halalat). */
|
|
140
271
|
declare const StreamPayAmount: {
|
|
141
272
|
readonly toHalalat: (sar: string | number) => number;
|
|
142
273
|
readonly toSAR: (halalat: number) => string;
|
|
@@ -190,9 +321,7 @@ declare class StreamPayWebhookError extends Error {
|
|
|
190
321
|
readonly reason: VerifyFailureReason;
|
|
191
322
|
constructor(reason: VerifyFailureReason, message?: string);
|
|
192
323
|
}
|
|
193
|
-
/** Verify a StreamPay webhook signature against the raw body. Returns a result object; never throws. */
|
|
194
324
|
declare function verifyWebhook(input: VerifyWebhookInput): VerifyWebhookResult;
|
|
195
|
-
/** Like `verifyWebhook` but throws `StreamPayWebhookError` on failure; returns the signed timestamp on success. */
|
|
196
325
|
declare function verifyWebhookOrThrow(input: VerifyWebhookInput): number;
|
|
197
326
|
|
|
198
327
|
export { type ConsumerIdentifiers, type InvoiceStatus, type Language, type ParsedStreamPayError, type PaymentMethod, type RefundReason, StreamPayAmount, type StreamPayPaymentStatus, type StreamPayValidationIssue, StreamPayWebhookError, type SubscriptionSchema, type VerifyFailureReason, type VerifyWebhookInput, type VerifyWebhookResult, findConsumerByExternalId, findConsumerByIdentifiers, formatStreamPayError, parseStreamPayError, subscriptionSchema, verifyWebhook, verifyWebhookOrThrow };
|