@payark/sdk-effect 0.1.5 → 0.1.6

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.
@@ -0,0 +1,294 @@
1
+ import { Schema } from 'effect';
2
+
3
+ /**
4
+ * ── Branded Types ──
5
+ */
6
+ declare const Id: Schema.brand<typeof Schema.String, "Id">;
7
+ type Id = Schema.Schema.Type<typeof Id>;
8
+ declare const ProjectId: Schema.brand<typeof Schema.String, "ProjectId">;
9
+ type ProjectId = Schema.Schema.Type<typeof ProjectId>;
10
+ declare const PaymentId: Schema.brand<typeof Schema.String, "PaymentId">;
11
+ type PaymentId = Schema.Schema.Type<typeof PaymentId>;
12
+ declare const CheckoutSessionId: Schema.brand<typeof Schema.String, "CheckoutSessionId">;
13
+ type CheckoutSessionId = Schema.Schema.Type<typeof CheckoutSessionId>;
14
+ declare const SubscriptionId: Schema.brand<typeof Schema.String, "SubscriptionId">;
15
+ type SubscriptionId = Schema.Schema.Type<typeof SubscriptionId>;
16
+ declare const CustomerId: Schema.brand<typeof Schema.String, "CustomerId">;
17
+ type CustomerId = Schema.Schema.Type<typeof CustomerId>;
18
+ declare const TokenId: Schema.brand<typeof Schema.String, "TokenId">;
19
+ type TokenId = Schema.Schema.Type<typeof TokenId>;
20
+ /**
21
+ * ── Atomic Atoms ──
22
+ */
23
+ declare const Email: Schema.brand<Schema.filter<typeof Schema.String>, "Email">;
24
+ type Email = Schema.Schema.Type<typeof Email>;
25
+ declare const Timestamp: Schema.brand<typeof Schema.String, "Timestamp">;
26
+ type Timestamp = Schema.Schema.Type<typeof Timestamp>;
27
+ declare const Metadata: Schema.Record$<typeof Schema.String, typeof Schema.Any>;
28
+ type Metadata = Schema.Schema.Type<typeof Metadata>;
29
+ declare const Timestamps: Schema.Struct<{
30
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
31
+ updated_at: Schema.brand<typeof Schema.String, "Timestamp">;
32
+ }>;
33
+ type Timestamps = Schema.Schema.Type<typeof Timestamps>;
34
+ /**
35
+ * ── Enums ──
36
+ */
37
+ declare const Provider: Schema.Literal<["esewa", "khalti", "connectips", "imepay", "fonepay", "sandbox"]>;
38
+ type Provider = Schema.Schema.Type<typeof Provider>;
39
+ declare const PaymentStatus: Schema.Literal<["pending", "success", "failed"]>;
40
+ type PaymentStatus = Schema.Schema.Type<typeof PaymentStatus>;
41
+ declare const SubscriptionStatus: Schema.Literal<["active", "past_due", "canceled", "paused"]>;
42
+ type SubscriptionStatus = Schema.Schema.Type<typeof SubscriptionStatus>;
43
+ declare const SubscriptionInterval: Schema.Literal<["month", "year", "week"]>;
44
+ type SubscriptionInterval = Schema.Schema.Type<typeof SubscriptionInterval>;
45
+ /**
46
+ * ── Models ──
47
+ */
48
+ declare const Customer: Schema.Struct<{
49
+ id: Schema.brand<typeof Schema.String, "CustomerId">;
50
+ merchant_customer_id: Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">;
51
+ email: Schema.NullOr<Schema.brand<Schema.filter<typeof Schema.String>, "Email">>;
52
+ name: Schema.NullOr<Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">>;
53
+ phone: Schema.NullOr<typeof Schema.String>;
54
+ project_id: Schema.brand<typeof Schema.String, "ProjectId">;
55
+ metadata: Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
56
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
57
+ updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
58
+ }>;
59
+ type Customer = Schema.Schema.Type<typeof Customer>;
60
+ declare const Payment: Schema.Struct<{
61
+ id: Schema.brand<typeof Schema.String, "PaymentId">;
62
+ project_id: Schema.brand<typeof Schema.String, "ProjectId">;
63
+ amount: typeof Schema.Number;
64
+ currency: typeof Schema.String;
65
+ status: Schema.Literal<["pending", "success", "failed"]>;
66
+ provider_ref: Schema.optional<Schema.NullOr<typeof Schema.String>>;
67
+ metadata_json: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
68
+ gateway_response: Schema.optional<Schema.NullOr<typeof Schema.Any>>;
69
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
70
+ updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
71
+ }>;
72
+ type Payment = Schema.Schema.Type<typeof Payment>;
73
+ declare const Subscription: Schema.Struct<{
74
+ id: Schema.brand<typeof Schema.String, "SubscriptionId">;
75
+ project_id: Schema.brand<typeof Schema.String, "ProjectId">;
76
+ customer_id: Schema.brand<typeof Schema.String, "CustomerId">;
77
+ status: Schema.Literal<["active", "past_due", "canceled", "paused"]>;
78
+ amount: typeof Schema.Number;
79
+ currency: typeof Schema.String;
80
+ interval: Schema.Literal<["month", "year", "week"]>;
81
+ interval_count: typeof Schema.Number;
82
+ current_period_start: Schema.brand<typeof Schema.String, "Timestamp">;
83
+ current_period_end: Schema.brand<typeof Schema.String, "Timestamp">;
84
+ payment_link: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
85
+ auto_send_link: typeof Schema.Boolean;
86
+ metadata: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
87
+ canceled_at: Schema.optional<Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>>;
88
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
89
+ updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
90
+ }>;
91
+ type Subscription = Schema.Schema.Type<typeof Subscription>;
92
+ declare const Project: Schema.Struct<{
93
+ id: Schema.brand<typeof Schema.String, "ProjectId">;
94
+ name: Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">;
95
+ api_key_secret: typeof Schema.String;
96
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
97
+ }>;
98
+ type Project = Schema.Schema.Type<typeof Project>;
99
+ declare const Token: Schema.Struct<{
100
+ id: Schema.brand<typeof Schema.String, "TokenId">;
101
+ name: Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">;
102
+ scopes: Schema.Array$<typeof Schema.String>;
103
+ last_used_at: Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>;
104
+ expires_at: Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>;
105
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
106
+ }>;
107
+ type Token = Schema.Schema.Type<typeof Token>;
108
+ /**
109
+ * ── Pagination ──
110
+ */
111
+ declare const PaginationMeta: Schema.Struct<{
112
+ total: Schema.NullOr<typeof Schema.Number>;
113
+ limit: typeof Schema.Number;
114
+ offset: typeof Schema.Number;
115
+ }>;
116
+ type PaginationMeta = Schema.Schema.Type<typeof PaginationMeta>;
117
+ declare const PaginatedResponse: <A, I, R>(schema: Schema.Schema<A, I, R>) => Schema.Struct<{
118
+ data: Schema.Array$<Schema.Schema<A, I, R>>;
119
+ meta: Schema.Struct<{
120
+ total: Schema.NullOr<typeof Schema.Number>;
121
+ limit: typeof Schema.Number;
122
+ offset: typeof Schema.Number;
123
+ }>;
124
+ }>;
125
+ interface PaginatedResponse<T> {
126
+ readonly data: readonly T[];
127
+ readonly meta: PaginationMeta;
128
+ }
129
+ /**
130
+ * ── Webhooks ──
131
+ */
132
+ declare const WebhookEventType: Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>;
133
+ type WebhookEventType = Schema.Schema.Type<typeof WebhookEventType>;
134
+ declare const WebhookEvent: Schema.Struct<{
135
+ type: Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>;
136
+ id: Schema.optional<typeof Schema.String>;
137
+ data: Schema.Union<[Schema.Struct<{
138
+ id: Schema.brand<typeof Schema.String, "PaymentId">;
139
+ project_id: Schema.brand<typeof Schema.String, "ProjectId">;
140
+ amount: typeof Schema.Number;
141
+ currency: typeof Schema.String;
142
+ status: Schema.Literal<["pending", "success", "failed"]>;
143
+ provider_ref: Schema.optional<Schema.NullOr<typeof Schema.String>>;
144
+ metadata_json: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
145
+ gateway_response: Schema.optional<Schema.NullOr<typeof Schema.Any>>;
146
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
147
+ updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
148
+ }>, Schema.Struct<{
149
+ id: Schema.brand<typeof Schema.String, "SubscriptionId">;
150
+ project_id: Schema.brand<typeof Schema.String, "ProjectId">;
151
+ customer_id: Schema.brand<typeof Schema.String, "CustomerId">;
152
+ status: Schema.Literal<["active", "past_due", "canceled", "paused"]>;
153
+ amount: typeof Schema.Number;
154
+ currency: typeof Schema.String;
155
+ interval: Schema.Literal<["month", "year", "week"]>;
156
+ interval_count: typeof Schema.Number;
157
+ current_period_start: Schema.brand<typeof Schema.String, "Timestamp">;
158
+ current_period_end: Schema.brand<typeof Schema.String, "Timestamp">;
159
+ payment_link: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
160
+ auto_send_link: typeof Schema.Boolean;
161
+ metadata: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
162
+ canceled_at: Schema.optional<Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>>;
163
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
164
+ updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
165
+ }>, Schema.Struct<{
166
+ id: Schema.brand<typeof Schema.String, "CustomerId">;
167
+ merchant_customer_id: Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">;
168
+ email: Schema.NullOr<Schema.brand<Schema.filter<typeof Schema.String>, "Email">>;
169
+ name: Schema.NullOr<Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">>;
170
+ phone: Schema.NullOr<typeof Schema.String>;
171
+ project_id: Schema.brand<typeof Schema.String, "ProjectId">;
172
+ metadata: Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
173
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
174
+ updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
175
+ }>, Schema.Struct<{
176
+ id: typeof Schema.String;
177
+ amount: Schema.optional<typeof Schema.Number>;
178
+ currency: Schema.optional<typeof Schema.String>;
179
+ status: typeof Schema.String;
180
+ metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
181
+ }>]>;
182
+ is_test: typeof Schema.Boolean;
183
+ created: Schema.optional<typeof Schema.Number>;
184
+ }>;
185
+ type WebhookEvent = Schema.Schema.Type<typeof WebhookEvent>;
186
+ /**
187
+ * ── Params & Inputs ──
188
+ */
189
+ declare const CreateCheckoutParams: Schema.filter<Schema.Struct<{
190
+ amount: Schema.optional<Schema.brand<Schema.filter<Schema.filter<typeof Schema.Number>>, "MinorUnitsInt">>;
191
+ currency: Schema.optionalWith<typeof Schema.String, {
192
+ default: () => string;
193
+ }>;
194
+ provider: Schema.Literal<["esewa", "khalti", "connectips", "imepay", "fonepay", "sandbox"]>;
195
+ returnUrl: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
196
+ cancelUrl: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">>;
197
+ metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
198
+ subscriptionId: Schema.optional<Schema.brand<typeof Schema.String, "SubscriptionId">>;
199
+ }>>;
200
+ type CreateCheckoutParams = Schema.Schema.Type<typeof CreateCheckoutParams>;
201
+ declare const CheckoutSession: Schema.Struct<{
202
+ id: Schema.brand<typeof Schema.String, "CheckoutSessionId">;
203
+ checkout_url: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
204
+ payment_method: Schema.Struct<{
205
+ type: Schema.Literal<["esewa", "khalti", "connectips", "imepay", "fonepay", "sandbox"]>;
206
+ url: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">>;
207
+ method: Schema.optional<Schema.Literal<["GET", "POST"]>>;
208
+ fields: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
209
+ }>;
210
+ }>;
211
+ type CheckoutSession = Schema.Schema.Type<typeof CheckoutSession>;
212
+ declare const CreateCustomerParams: Schema.Struct<{
213
+ merchant_customer_id: Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">;
214
+ email: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "Email">>;
215
+ name: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">>;
216
+ phone: Schema.optional<typeof Schema.String>;
217
+ project_id: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
218
+ metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
219
+ }>;
220
+ type CreateCustomerParams = Schema.Schema.Type<typeof CreateCustomerParams>;
221
+ declare const ListPaymentsParams: Schema.Struct<{
222
+ limit: Schema.optional<typeof Schema.NumberFromString>;
223
+ offset: Schema.optional<typeof Schema.NumberFromString>;
224
+ projectId: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
225
+ }>;
226
+ type ListPaymentsParams = Schema.Schema.Type<typeof ListPaymentsParams>;
227
+ declare const ListCustomersParams: Schema.Struct<{
228
+ limit: Schema.optional<typeof Schema.NumberFromString>;
229
+ offset: Schema.optional<typeof Schema.NumberFromString>;
230
+ email: Schema.optional<typeof Schema.String>;
231
+ merchant_customer_id: Schema.optional<typeof Schema.String>;
232
+ projectId: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
233
+ }>;
234
+ type ListCustomersParams = Schema.Schema.Type<typeof ListCustomersParams>;
235
+ declare const UpdateCustomerParams: Schema.Struct<{
236
+ email: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "Email">>;
237
+ name: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">>;
238
+ phone: Schema.optional<typeof Schema.String>;
239
+ metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
240
+ }>;
241
+ type UpdateCustomerParams = Schema.Schema.Type<typeof UpdateCustomerParams>;
242
+ declare const CreateSubscriptionParams: Schema.Struct<{
243
+ customer_id: Schema.brand<typeof Schema.String, "CustomerId">;
244
+ amount: Schema.brand<Schema.filter<Schema.filter<typeof Schema.Number>>, "MinorUnitsInt">;
245
+ currency: Schema.optionalWith<typeof Schema.String, {
246
+ default: () => string;
247
+ }>;
248
+ interval: Schema.Literal<["month", "year", "week"]>;
249
+ interval_count: Schema.optional<typeof Schema.Number>;
250
+ project_id: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
251
+ auto_send_link: Schema.optional<typeof Schema.Boolean>;
252
+ metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
253
+ }>;
254
+ type CreateSubscriptionParams = Schema.Schema.Type<typeof CreateSubscriptionParams>;
255
+ declare const CallbackQueryParams: Schema.Struct<{
256
+ payment_id: Schema.optional<typeof Schema.String>;
257
+ data: Schema.optional<typeof Schema.String>;
258
+ pidx: Schema.optional<typeof Schema.String>;
259
+ }>;
260
+ type CallbackQueryParams = Schema.Schema.Type<typeof CallbackQueryParams>;
261
+ declare const ListSubscriptionsParams: Schema.Struct<{
262
+ limit: Schema.optional<typeof Schema.NumberFromString>;
263
+ offset: Schema.optional<typeof Schema.NumberFromString>;
264
+ projectId: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
265
+ customerId: Schema.optional<Schema.brand<typeof Schema.String, "CustomerId">>;
266
+ status: Schema.optional<Schema.Literal<["active", "past_due", "canceled", "paused"]>>;
267
+ }>;
268
+ type ListSubscriptionsParams = Schema.Schema.Type<typeof ListSubscriptionsParams>;
269
+ declare const RealtimeTriggerPayload: Schema.Struct<{
270
+ event: Schema.optional<Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>>;
271
+ data: Schema.optional<typeof Schema.Any>;
272
+ }>;
273
+ type RealtimeTriggerPayload = Schema.Schema.Type<typeof RealtimeTriggerPayload>;
274
+ /**
275
+ * ── Client Config ──
276
+ */
277
+ declare const PayArkConfig: Schema.Struct<{
278
+ apiKey: typeof Schema.String;
279
+ baseUrl: Schema.optional<typeof Schema.String>;
280
+ timeout: Schema.optional<typeof Schema.Number>;
281
+ maxRetries: Schema.optional<typeof Schema.Number>;
282
+ sandbox: Schema.optional<typeof Schema.Boolean>;
283
+ }>;
284
+ type PayArkConfig = Schema.Schema.Type<typeof PayArkConfig>;
285
+ /**
286
+ * ── Error Schemas ──
287
+ */
288
+ declare const PayArkErrorBody: Schema.Struct<{
289
+ error: typeof Schema.String;
290
+ details: Schema.optional<typeof Schema.Any>;
291
+ }>;
292
+ type PayArkErrorBody = Schema.Schema.Type<typeof PayArkErrorBody>;
293
+
294
+ export { CallbackQueryParams, CheckoutSession, CheckoutSessionId, CreateCheckoutParams, CreateCustomerParams, CreateSubscriptionParams, Customer, CustomerId, Email, Id, ListCustomersParams, ListPaymentsParams, ListSubscriptionsParams, Metadata, PaginatedResponse, PaginationMeta, PayArkConfig, PayArkErrorBody, Payment, PaymentId, PaymentStatus, Project, ProjectId, Provider, RealtimeTriggerPayload, Subscription, SubscriptionId, SubscriptionInterval, SubscriptionStatus, Timestamp, Timestamps, Token, TokenId, UpdateCustomerParams, WebhookEvent, WebhookEventType };
@@ -0,0 +1,294 @@
1
+ import { Schema } from 'effect';
2
+
3
+ /**
4
+ * ── Branded Types ──
5
+ */
6
+ declare const Id: Schema.brand<typeof Schema.String, "Id">;
7
+ type Id = Schema.Schema.Type<typeof Id>;
8
+ declare const ProjectId: Schema.brand<typeof Schema.String, "ProjectId">;
9
+ type ProjectId = Schema.Schema.Type<typeof ProjectId>;
10
+ declare const PaymentId: Schema.brand<typeof Schema.String, "PaymentId">;
11
+ type PaymentId = Schema.Schema.Type<typeof PaymentId>;
12
+ declare const CheckoutSessionId: Schema.brand<typeof Schema.String, "CheckoutSessionId">;
13
+ type CheckoutSessionId = Schema.Schema.Type<typeof CheckoutSessionId>;
14
+ declare const SubscriptionId: Schema.brand<typeof Schema.String, "SubscriptionId">;
15
+ type SubscriptionId = Schema.Schema.Type<typeof SubscriptionId>;
16
+ declare const CustomerId: Schema.brand<typeof Schema.String, "CustomerId">;
17
+ type CustomerId = Schema.Schema.Type<typeof CustomerId>;
18
+ declare const TokenId: Schema.brand<typeof Schema.String, "TokenId">;
19
+ type TokenId = Schema.Schema.Type<typeof TokenId>;
20
+ /**
21
+ * ── Atomic Atoms ──
22
+ */
23
+ declare const Email: Schema.brand<Schema.filter<typeof Schema.String>, "Email">;
24
+ type Email = Schema.Schema.Type<typeof Email>;
25
+ declare const Timestamp: Schema.brand<typeof Schema.String, "Timestamp">;
26
+ type Timestamp = Schema.Schema.Type<typeof Timestamp>;
27
+ declare const Metadata: Schema.Record$<typeof Schema.String, typeof Schema.Any>;
28
+ type Metadata = Schema.Schema.Type<typeof Metadata>;
29
+ declare const Timestamps: Schema.Struct<{
30
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
31
+ updated_at: Schema.brand<typeof Schema.String, "Timestamp">;
32
+ }>;
33
+ type Timestamps = Schema.Schema.Type<typeof Timestamps>;
34
+ /**
35
+ * ── Enums ──
36
+ */
37
+ declare const Provider: Schema.Literal<["esewa", "khalti", "connectips", "imepay", "fonepay", "sandbox"]>;
38
+ type Provider = Schema.Schema.Type<typeof Provider>;
39
+ declare const PaymentStatus: Schema.Literal<["pending", "success", "failed"]>;
40
+ type PaymentStatus = Schema.Schema.Type<typeof PaymentStatus>;
41
+ declare const SubscriptionStatus: Schema.Literal<["active", "past_due", "canceled", "paused"]>;
42
+ type SubscriptionStatus = Schema.Schema.Type<typeof SubscriptionStatus>;
43
+ declare const SubscriptionInterval: Schema.Literal<["month", "year", "week"]>;
44
+ type SubscriptionInterval = Schema.Schema.Type<typeof SubscriptionInterval>;
45
+ /**
46
+ * ── Models ──
47
+ */
48
+ declare const Customer: Schema.Struct<{
49
+ id: Schema.brand<typeof Schema.String, "CustomerId">;
50
+ merchant_customer_id: Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">;
51
+ email: Schema.NullOr<Schema.brand<Schema.filter<typeof Schema.String>, "Email">>;
52
+ name: Schema.NullOr<Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">>;
53
+ phone: Schema.NullOr<typeof Schema.String>;
54
+ project_id: Schema.brand<typeof Schema.String, "ProjectId">;
55
+ metadata: Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
56
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
57
+ updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
58
+ }>;
59
+ type Customer = Schema.Schema.Type<typeof Customer>;
60
+ declare const Payment: Schema.Struct<{
61
+ id: Schema.brand<typeof Schema.String, "PaymentId">;
62
+ project_id: Schema.brand<typeof Schema.String, "ProjectId">;
63
+ amount: typeof Schema.Number;
64
+ currency: typeof Schema.String;
65
+ status: Schema.Literal<["pending", "success", "failed"]>;
66
+ provider_ref: Schema.optional<Schema.NullOr<typeof Schema.String>>;
67
+ metadata_json: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
68
+ gateway_response: Schema.optional<Schema.NullOr<typeof Schema.Any>>;
69
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
70
+ updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
71
+ }>;
72
+ type Payment = Schema.Schema.Type<typeof Payment>;
73
+ declare const Subscription: Schema.Struct<{
74
+ id: Schema.brand<typeof Schema.String, "SubscriptionId">;
75
+ project_id: Schema.brand<typeof Schema.String, "ProjectId">;
76
+ customer_id: Schema.brand<typeof Schema.String, "CustomerId">;
77
+ status: Schema.Literal<["active", "past_due", "canceled", "paused"]>;
78
+ amount: typeof Schema.Number;
79
+ currency: typeof Schema.String;
80
+ interval: Schema.Literal<["month", "year", "week"]>;
81
+ interval_count: typeof Schema.Number;
82
+ current_period_start: Schema.brand<typeof Schema.String, "Timestamp">;
83
+ current_period_end: Schema.brand<typeof Schema.String, "Timestamp">;
84
+ payment_link: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
85
+ auto_send_link: typeof Schema.Boolean;
86
+ metadata: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
87
+ canceled_at: Schema.optional<Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>>;
88
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
89
+ updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
90
+ }>;
91
+ type Subscription = Schema.Schema.Type<typeof Subscription>;
92
+ declare const Project: Schema.Struct<{
93
+ id: Schema.brand<typeof Schema.String, "ProjectId">;
94
+ name: Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">;
95
+ api_key_secret: typeof Schema.String;
96
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
97
+ }>;
98
+ type Project = Schema.Schema.Type<typeof Project>;
99
+ declare const Token: Schema.Struct<{
100
+ id: Schema.brand<typeof Schema.String, "TokenId">;
101
+ name: Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">;
102
+ scopes: Schema.Array$<typeof Schema.String>;
103
+ last_used_at: Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>;
104
+ expires_at: Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>;
105
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
106
+ }>;
107
+ type Token = Schema.Schema.Type<typeof Token>;
108
+ /**
109
+ * ── Pagination ──
110
+ */
111
+ declare const PaginationMeta: Schema.Struct<{
112
+ total: Schema.NullOr<typeof Schema.Number>;
113
+ limit: typeof Schema.Number;
114
+ offset: typeof Schema.Number;
115
+ }>;
116
+ type PaginationMeta = Schema.Schema.Type<typeof PaginationMeta>;
117
+ declare const PaginatedResponse: <A, I, R>(schema: Schema.Schema<A, I, R>) => Schema.Struct<{
118
+ data: Schema.Array$<Schema.Schema<A, I, R>>;
119
+ meta: Schema.Struct<{
120
+ total: Schema.NullOr<typeof Schema.Number>;
121
+ limit: typeof Schema.Number;
122
+ offset: typeof Schema.Number;
123
+ }>;
124
+ }>;
125
+ interface PaginatedResponse<T> {
126
+ readonly data: readonly T[];
127
+ readonly meta: PaginationMeta;
128
+ }
129
+ /**
130
+ * ── Webhooks ──
131
+ */
132
+ declare const WebhookEventType: Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>;
133
+ type WebhookEventType = Schema.Schema.Type<typeof WebhookEventType>;
134
+ declare const WebhookEvent: Schema.Struct<{
135
+ type: Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>;
136
+ id: Schema.optional<typeof Schema.String>;
137
+ data: Schema.Union<[Schema.Struct<{
138
+ id: Schema.brand<typeof Schema.String, "PaymentId">;
139
+ project_id: Schema.brand<typeof Schema.String, "ProjectId">;
140
+ amount: typeof Schema.Number;
141
+ currency: typeof Schema.String;
142
+ status: Schema.Literal<["pending", "success", "failed"]>;
143
+ provider_ref: Schema.optional<Schema.NullOr<typeof Schema.String>>;
144
+ metadata_json: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
145
+ gateway_response: Schema.optional<Schema.NullOr<typeof Schema.Any>>;
146
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
147
+ updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
148
+ }>, Schema.Struct<{
149
+ id: Schema.brand<typeof Schema.String, "SubscriptionId">;
150
+ project_id: Schema.brand<typeof Schema.String, "ProjectId">;
151
+ customer_id: Schema.brand<typeof Schema.String, "CustomerId">;
152
+ status: Schema.Literal<["active", "past_due", "canceled", "paused"]>;
153
+ amount: typeof Schema.Number;
154
+ currency: typeof Schema.String;
155
+ interval: Schema.Literal<["month", "year", "week"]>;
156
+ interval_count: typeof Schema.Number;
157
+ current_period_start: Schema.brand<typeof Schema.String, "Timestamp">;
158
+ current_period_end: Schema.brand<typeof Schema.String, "Timestamp">;
159
+ payment_link: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
160
+ auto_send_link: typeof Schema.Boolean;
161
+ metadata: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
162
+ canceled_at: Schema.optional<Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>>;
163
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
164
+ updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
165
+ }>, Schema.Struct<{
166
+ id: Schema.brand<typeof Schema.String, "CustomerId">;
167
+ merchant_customer_id: Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">;
168
+ email: Schema.NullOr<Schema.brand<Schema.filter<typeof Schema.String>, "Email">>;
169
+ name: Schema.NullOr<Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">>;
170
+ phone: Schema.NullOr<typeof Schema.String>;
171
+ project_id: Schema.brand<typeof Schema.String, "ProjectId">;
172
+ metadata: Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
173
+ created_at: Schema.brand<typeof Schema.String, "Timestamp">;
174
+ updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
175
+ }>, Schema.Struct<{
176
+ id: typeof Schema.String;
177
+ amount: Schema.optional<typeof Schema.Number>;
178
+ currency: Schema.optional<typeof Schema.String>;
179
+ status: typeof Schema.String;
180
+ metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
181
+ }>]>;
182
+ is_test: typeof Schema.Boolean;
183
+ created: Schema.optional<typeof Schema.Number>;
184
+ }>;
185
+ type WebhookEvent = Schema.Schema.Type<typeof WebhookEvent>;
186
+ /**
187
+ * ── Params & Inputs ──
188
+ */
189
+ declare const CreateCheckoutParams: Schema.filter<Schema.Struct<{
190
+ amount: Schema.optional<Schema.brand<Schema.filter<Schema.filter<typeof Schema.Number>>, "MinorUnitsInt">>;
191
+ currency: Schema.optionalWith<typeof Schema.String, {
192
+ default: () => string;
193
+ }>;
194
+ provider: Schema.Literal<["esewa", "khalti", "connectips", "imepay", "fonepay", "sandbox"]>;
195
+ returnUrl: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
196
+ cancelUrl: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">>;
197
+ metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
198
+ subscriptionId: Schema.optional<Schema.brand<typeof Schema.String, "SubscriptionId">>;
199
+ }>>;
200
+ type CreateCheckoutParams = Schema.Schema.Type<typeof CreateCheckoutParams>;
201
+ declare const CheckoutSession: Schema.Struct<{
202
+ id: Schema.brand<typeof Schema.String, "CheckoutSessionId">;
203
+ checkout_url: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
204
+ payment_method: Schema.Struct<{
205
+ type: Schema.Literal<["esewa", "khalti", "connectips", "imepay", "fonepay", "sandbox"]>;
206
+ url: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">>;
207
+ method: Schema.optional<Schema.Literal<["GET", "POST"]>>;
208
+ fields: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
209
+ }>;
210
+ }>;
211
+ type CheckoutSession = Schema.Schema.Type<typeof CheckoutSession>;
212
+ declare const CreateCustomerParams: Schema.Struct<{
213
+ merchant_customer_id: Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">;
214
+ email: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "Email">>;
215
+ name: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">>;
216
+ phone: Schema.optional<typeof Schema.String>;
217
+ project_id: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
218
+ metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
219
+ }>;
220
+ type CreateCustomerParams = Schema.Schema.Type<typeof CreateCustomerParams>;
221
+ declare const ListPaymentsParams: Schema.Struct<{
222
+ limit: Schema.optional<typeof Schema.NumberFromString>;
223
+ offset: Schema.optional<typeof Schema.NumberFromString>;
224
+ projectId: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
225
+ }>;
226
+ type ListPaymentsParams = Schema.Schema.Type<typeof ListPaymentsParams>;
227
+ declare const ListCustomersParams: Schema.Struct<{
228
+ limit: Schema.optional<typeof Schema.NumberFromString>;
229
+ offset: Schema.optional<typeof Schema.NumberFromString>;
230
+ email: Schema.optional<typeof Schema.String>;
231
+ merchant_customer_id: Schema.optional<typeof Schema.String>;
232
+ projectId: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
233
+ }>;
234
+ type ListCustomersParams = Schema.Schema.Type<typeof ListCustomersParams>;
235
+ declare const UpdateCustomerParams: Schema.Struct<{
236
+ email: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "Email">>;
237
+ name: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">>;
238
+ phone: Schema.optional<typeof Schema.String>;
239
+ metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
240
+ }>;
241
+ type UpdateCustomerParams = Schema.Schema.Type<typeof UpdateCustomerParams>;
242
+ declare const CreateSubscriptionParams: Schema.Struct<{
243
+ customer_id: Schema.brand<typeof Schema.String, "CustomerId">;
244
+ amount: Schema.brand<Schema.filter<Schema.filter<typeof Schema.Number>>, "MinorUnitsInt">;
245
+ currency: Schema.optionalWith<typeof Schema.String, {
246
+ default: () => string;
247
+ }>;
248
+ interval: Schema.Literal<["month", "year", "week"]>;
249
+ interval_count: Schema.optional<typeof Schema.Number>;
250
+ project_id: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
251
+ auto_send_link: Schema.optional<typeof Schema.Boolean>;
252
+ metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
253
+ }>;
254
+ type CreateSubscriptionParams = Schema.Schema.Type<typeof CreateSubscriptionParams>;
255
+ declare const CallbackQueryParams: Schema.Struct<{
256
+ payment_id: Schema.optional<typeof Schema.String>;
257
+ data: Schema.optional<typeof Schema.String>;
258
+ pidx: Schema.optional<typeof Schema.String>;
259
+ }>;
260
+ type CallbackQueryParams = Schema.Schema.Type<typeof CallbackQueryParams>;
261
+ declare const ListSubscriptionsParams: Schema.Struct<{
262
+ limit: Schema.optional<typeof Schema.NumberFromString>;
263
+ offset: Schema.optional<typeof Schema.NumberFromString>;
264
+ projectId: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
265
+ customerId: Schema.optional<Schema.brand<typeof Schema.String, "CustomerId">>;
266
+ status: Schema.optional<Schema.Literal<["active", "past_due", "canceled", "paused"]>>;
267
+ }>;
268
+ type ListSubscriptionsParams = Schema.Schema.Type<typeof ListSubscriptionsParams>;
269
+ declare const RealtimeTriggerPayload: Schema.Struct<{
270
+ event: Schema.optional<Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>>;
271
+ data: Schema.optional<typeof Schema.Any>;
272
+ }>;
273
+ type RealtimeTriggerPayload = Schema.Schema.Type<typeof RealtimeTriggerPayload>;
274
+ /**
275
+ * ── Client Config ──
276
+ */
277
+ declare const PayArkConfig: Schema.Struct<{
278
+ apiKey: typeof Schema.String;
279
+ baseUrl: Schema.optional<typeof Schema.String>;
280
+ timeout: Schema.optional<typeof Schema.Number>;
281
+ maxRetries: Schema.optional<typeof Schema.Number>;
282
+ sandbox: Schema.optional<typeof Schema.Boolean>;
283
+ }>;
284
+ type PayArkConfig = Schema.Schema.Type<typeof PayArkConfig>;
285
+ /**
286
+ * ── Error Schemas ──
287
+ */
288
+ declare const PayArkErrorBody: Schema.Struct<{
289
+ error: typeof Schema.String;
290
+ details: Schema.optional<typeof Schema.Any>;
291
+ }>;
292
+ type PayArkErrorBody = Schema.Schema.Type<typeof PayArkErrorBody>;
293
+
294
+ export { CallbackQueryParams, CheckoutSession, CheckoutSessionId, CreateCheckoutParams, CreateCustomerParams, CreateSubscriptionParams, Customer, CustomerId, Email, Id, ListCustomersParams, ListPaymentsParams, ListSubscriptionsParams, Metadata, PaginatedResponse, PaginationMeta, PayArkConfig, PayArkErrorBody, Payment, PaymentId, PaymentStatus, Project, ProjectId, Provider, RealtimeTriggerPayload, Subscription, SubscriptionId, SubscriptionInterval, SubscriptionStatus, Timestamp, Timestamps, Token, TokenId, UpdateCustomerParams, WebhookEvent, WebhookEventType };