@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.
package/dist/index.d.ts CHANGED
@@ -1,1016 +1,19 @@
1
1
  import * as effect_ParseResult from 'effect/ParseResult';
2
2
  import * as _effect_platform_HttpClientError from '@effect/platform/HttpClientError';
3
+ import { AuthenticationError, InternalServerError, IndustrialError, NotFoundError, ConflictError } from './api-spec.js';
4
+ export { AuthContext, AutomationGroup, CallbacksGroup, CheckoutGroup, CronSecurity, CustomersGroup, PayArkApi, PaymentsGroup, ProjectsGroup, RealtimeGroup, SecurityMiddleware, SubscriptionsGroup, TokensGroup, UserSecurity } from './api-spec.js';
3
5
  import * as _effect_platform_HttpApiError from '@effect/platform/HttpApiError';
4
- import * as effect_Brand from 'effect/Brand';
5
- import * as effect_Effect from 'effect/Effect';
6
- import * as _effect_platform_HttpRouter from '@effect/platform/HttpRouter';
7
- import * as effect_Redacted from 'effect/Redacted';
8
- import { HttpApiGroup, HttpApiEndpoint, HttpApiMiddleware, HttpApiSecurity, HttpApi, HttpClient } from '@effect/platform';
9
- import { Context, Schema, Effect, ParseResult, Layer } from 'effect';
10
6
  import * as _effect_platform_HttpClientResponse from '@effect/platform/HttpClientResponse';
7
+ import * as effect_Brand from 'effect/Brand';
8
+ import { Effect, ParseResult, Context, Layer } from 'effect';
9
+ import { HttpClient } from '@effect/platform';
10
+ import { PayArkConfig, CreateCheckoutParams, CheckoutSession, ListPaymentsParams, PaginatedResponse, Payment, Project } from './schemas.js';
11
+ export { CallbackQueryParams, CheckoutSessionId, CreateCustomerParams, CreateSubscriptionParams, Customer, CustomerId, Email, Id, ListCustomersParams, ListSubscriptionsParams, Metadata, PaginationMeta, PayArkErrorBody, PaymentId, PaymentStatus, ProjectId, Provider, RealtimeTriggerPayload, Subscription, SubscriptionId, SubscriptionInterval, SubscriptionStatus, Timestamp, Timestamps, Token, TokenId, UpdateCustomerParams, WebhookEvent, WebhookEventType } from './schemas.js';
11
12
  import * as effect_Cause from 'effect/Cause';
12
13
  import * as effect_Types from 'effect/Types';
13
-
14
- declare const IndustrialError_base: Schema.TaggedErrorClass<IndustrialError, "IndustrialError", {
15
- readonly _tag: Schema.tag<"IndustrialError">;
16
- } & {
17
- error: typeof Schema.String;
18
- details: Schema.optional<typeof Schema.Any>;
19
- }>;
20
- /**
21
- * Industrial Error Schema with Status mapping.
22
- */
23
- declare class IndustrialError extends IndustrialError_base {
24
- }
25
- declare const AuthenticationError_base: Schema.TaggedErrorClass<AuthenticationError, "AuthenticationError", {
26
- readonly _tag: Schema.tag<"AuthenticationError">;
27
- } & {
28
- error: typeof Schema.String;
29
- }>;
30
- declare class AuthenticationError extends AuthenticationError_base {
31
- }
32
- declare const NotFoundError_base: Schema.TaggedErrorClass<NotFoundError, "NotFoundError", {
33
- readonly _tag: Schema.tag<"NotFoundError">;
34
- } & {
35
- error: typeof Schema.String;
36
- }>;
37
- declare class NotFoundError extends NotFoundError_base {
38
- }
39
- declare const InternalServerError_base: Schema.TaggedErrorClass<InternalServerError, "InternalServerError", {
40
- readonly _tag: Schema.tag<"InternalServerError">;
41
- } & {
42
- error: typeof Schema.String;
43
- details: Schema.optional<typeof Schema.Any>;
44
- }>;
45
- declare class InternalServerError extends InternalServerError_base {
46
- }
47
- declare const ConflictError_base: Schema.TaggedErrorClass<ConflictError, "ConflictError", {
48
- readonly _tag: Schema.tag<"ConflictError">;
49
- } & {
50
- error: typeof Schema.String;
51
- }>;
52
- declare class ConflictError extends ConflictError_base {
53
- }
54
- /**
55
- * PayArk Industrial API Specification.
56
- * Single source of truth for the entire platform.
57
- */
58
- interface AuthContext {
59
- readonly project?: {
60
- readonly id: string;
61
- };
62
- readonly user?: {
63
- readonly id: string;
64
- };
65
- }
66
- declare const AuthContext: Context.Tag<AuthContext, AuthContext>;
67
- declare const SecurityMiddleware_base: HttpApiMiddleware.TagClass.BaseSecurity<SecurityMiddleware, "SecurityMiddleware", {
68
- readonly security: {
69
- readonly bearer: HttpApiSecurity.Bearer;
70
- };
71
- readonly provides: Context.Tag<AuthContext, AuthContext>;
72
- readonly failure: Schema.Union<[typeof AuthenticationError, typeof IndustrialError]>;
73
- }, {
74
- readonly bearer: (_: effect_Redacted.Redacted<string>) => effect_Effect.Effect<AuthContext, AuthenticationError | IndustrialError, _effect_platform_HttpRouter.HttpRouter.Provided>;
75
- }, {
76
- readonly bearer: HttpApiSecurity.Bearer;
77
- }>;
78
- declare class SecurityMiddleware extends SecurityMiddleware_base {
79
- }
80
- declare const CronSecurity_base: HttpApiMiddleware.TagClass.BaseSecurity<CronSecurity, "CronSecurity", {
81
- readonly security: {
82
- readonly secret: HttpApiSecurity.ApiKey;
83
- };
84
- readonly failure: Schema.Union<[typeof AuthenticationError, typeof IndustrialError]>;
85
- }, {
86
- readonly secret: (_: effect_Redacted.Redacted<string>) => effect_Effect.Effect<void, AuthenticationError | IndustrialError, _effect_platform_HttpRouter.HttpRouter.Provided>;
87
- }, {
88
- readonly secret: HttpApiSecurity.ApiKey;
89
- }>;
90
- declare class CronSecurity extends CronSecurity_base {
91
- }
92
- declare const UserSecurity_base: HttpApiMiddleware.TagClass.BaseSecurity<UserSecurity, "UserSecurity", {
93
- readonly security: {
94
- readonly bearer: HttpApiSecurity.Bearer;
95
- };
96
- readonly provides: Context.Tag<AuthContext, AuthContext>;
97
- readonly failure: Schema.Union<[typeof AuthenticationError, typeof IndustrialError]>;
98
- }, {
99
- readonly bearer: (_: effect_Redacted.Redacted<string>) => effect_Effect.Effect<AuthContext, AuthenticationError | IndustrialError, _effect_platform_HttpRouter.HttpRouter.Provided>;
100
- }, {
101
- readonly bearer: HttpApiSecurity.Bearer;
102
- }>;
103
- declare class UserSecurity extends UserSecurity_base {
104
- }
105
- declare const CheckoutGroup: HttpApiGroup.HttpApiGroup<"checkout", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", never, never, {
106
- readonly amount?: (number & effect_Brand.Brand<"MinorUnitsInt">) | undefined;
107
- readonly currency: string;
108
- readonly provider: "esewa" | "khalti" | "connectips" | "imepay" | "fonepay" | "sandbox";
109
- readonly returnUrl: string & effect_Brand.Brand<"UrlString">;
110
- readonly cancelUrl?: (string & effect_Brand.Brand<"UrlString">) | undefined;
111
- readonly metadata?: {
112
- readonly [x: string]: any;
113
- } | undefined;
114
- readonly subscriptionId?: (string & effect_Brand.Brand<"SubscriptionId">) | undefined;
115
- }, never, {
116
- readonly id: string & effect_Brand.Brand<"CheckoutSessionId">;
117
- readonly checkout_url: string & effect_Brand.Brand<"UrlString">;
118
- readonly payment_method: {
119
- readonly type: "esewa" | "khalti" | "connectips" | "imepay" | "fonepay" | "sandbox";
120
- readonly url?: (string & effect_Brand.Brand<"UrlString">) | undefined;
121
- readonly method?: "POST" | "GET" | undefined;
122
- readonly fields?: {
123
- readonly [x: string]: string;
124
- } | undefined;
125
- };
126
- }, AuthenticationError | InternalServerError | IndustrialError, never, never>, AuthenticationError | IndustrialError, SecurityMiddleware, false>;
127
- declare const PaymentsGroup: HttpApiGroup.HttpApiGroup<"payments", HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, {
128
- readonly limit?: number | undefined;
129
- readonly offset?: number | undefined;
130
- readonly projectId?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
131
- }, never, never, {
132
- readonly data: readonly {
133
- readonly id: string & effect_Brand.Brand<"PaymentId">;
134
- readonly amount: number;
135
- readonly currency: string;
136
- readonly status: "pending" | "success" | "failed";
137
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
138
- readonly provider_ref?: string | null | undefined;
139
- readonly metadata_json?: {
140
- readonly [x: string]: any;
141
- } | null | undefined;
142
- readonly gateway_response?: any;
143
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
144
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
145
- }[];
146
- readonly meta: {
147
- readonly total: number | null;
148
- readonly limit: number;
149
- readonly offset: number;
150
- };
151
- }, AuthenticationError | InternalServerError | IndustrialError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"retrieve", "GET", {
152
- readonly id: string & effect_Brand.Brand<"Id">;
153
- }, never, never, never, {
154
- readonly id: string & effect_Brand.Brand<"PaymentId">;
155
- readonly amount: number;
156
- readonly currency: string;
157
- readonly status: "pending" | "success" | "failed";
158
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
159
- readonly provider_ref?: string | null | undefined;
160
- readonly metadata_json?: {
161
- readonly [x: string]: any;
162
- } | null | undefined;
163
- readonly gateway_response?: any;
164
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
165
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
166
- }, AuthenticationError | InternalServerError | IndustrialError | NotFoundError, never, never>, AuthenticationError | IndustrialError, SecurityMiddleware, false>;
167
- declare const CustomersGroup: HttpApiGroup.HttpApiGroup<"customers", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", never, never, {
168
- readonly metadata?: {
169
- readonly [x: string]: any;
170
- } | undefined;
171
- readonly project_id?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
172
- readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
173
- readonly email?: (string & effect_Brand.Brand<"Email">) | undefined;
174
- readonly name?: (string & effect_Brand.Brand<"NonEmptyString">) | undefined;
175
- readonly phone?: string | undefined;
176
- }, never, {
177
- readonly id: string & effect_Brand.Brand<"CustomerId">;
178
- readonly metadata: {
179
- readonly [x: string]: any;
180
- } | null;
181
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
182
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
183
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
184
- readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
185
- readonly email: (string & effect_Brand.Brand<"Email">) | null;
186
- readonly name: (string & effect_Brand.Brand<"NonEmptyString">) | null;
187
- readonly phone: string | null;
188
- }, AuthenticationError | InternalServerError | IndustrialError | ConflictError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, {
189
- readonly limit?: number | undefined;
190
- readonly offset?: number | undefined;
191
- readonly projectId?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
192
- readonly merchant_customer_id?: string | undefined;
193
- readonly email?: string | undefined;
194
- }, never, never, {
195
- readonly data: readonly {
196
- readonly id: string & effect_Brand.Brand<"CustomerId">;
197
- readonly metadata: {
198
- readonly [x: string]: any;
199
- } | null;
200
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
201
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
202
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
203
- readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
204
- readonly email: (string & effect_Brand.Brand<"Email">) | null;
205
- readonly name: (string & effect_Brand.Brand<"NonEmptyString">) | null;
206
- readonly phone: string | null;
207
- }[];
208
- readonly meta: {
209
- readonly total: number | null;
210
- readonly limit: number;
211
- readonly offset: number;
212
- };
213
- }, AuthenticationError | InternalServerError | IndustrialError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"retrieve", "GET", {
214
- readonly id: string & effect_Brand.Brand<"Id">;
215
- }, never, never, never, {
216
- readonly id: string & effect_Brand.Brand<"CustomerId">;
217
- readonly metadata: {
218
- readonly [x: string]: any;
219
- } | null;
220
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
221
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
222
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
223
- readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
224
- readonly email: (string & effect_Brand.Brand<"Email">) | null;
225
- readonly name: (string & effect_Brand.Brand<"NonEmptyString">) | null;
226
- readonly phone: string | null;
227
- }, AuthenticationError | InternalServerError | IndustrialError | NotFoundError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"update", "PATCH", {
228
- readonly id: string & effect_Brand.Brand<"Id">;
229
- }, never, {
230
- readonly metadata?: {
231
- readonly [x: string]: any;
232
- } | undefined;
233
- readonly email?: (string & effect_Brand.Brand<"Email">) | undefined;
234
- readonly name?: (string & effect_Brand.Brand<"NonEmptyString">) | undefined;
235
- readonly phone?: string | undefined;
236
- }, never, {
237
- readonly id: string & effect_Brand.Brand<"CustomerId">;
238
- readonly metadata: {
239
- readonly [x: string]: any;
240
- } | null;
241
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
242
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
243
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
244
- readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
245
- readonly email: (string & effect_Brand.Brand<"Email">) | null;
246
- readonly name: (string & effect_Brand.Brand<"NonEmptyString">) | null;
247
- readonly phone: string | null;
248
- }, AuthenticationError | InternalServerError | IndustrialError | NotFoundError | ConflictError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"delete", "DELETE", {
249
- readonly id: string & effect_Brand.Brand<"Id">;
250
- }, never, never, never, void, AuthenticationError | InternalServerError | IndustrialError | NotFoundError | ConflictError, never, never>, AuthenticationError | IndustrialError, SecurityMiddleware, false>;
251
- declare const SubscriptionsGroup: HttpApiGroup.HttpApiGroup<"subscriptions", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", never, never, {
252
- readonly amount: number & effect_Brand.Brand<"MinorUnitsInt">;
253
- readonly currency: string;
254
- readonly metadata?: {
255
- readonly [x: string]: any;
256
- } | undefined;
257
- readonly project_id?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
258
- readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
259
- readonly interval: "month" | "year" | "week";
260
- readonly interval_count?: number | undefined;
261
- readonly auto_send_link?: boolean | undefined;
262
- }, never, {
263
- readonly id: string & effect_Brand.Brand<"SubscriptionId">;
264
- readonly amount: number;
265
- readonly currency: string;
266
- readonly metadata?: {
267
- readonly [x: string]: any;
268
- } | null | undefined;
269
- readonly status: "active" | "past_due" | "canceled" | "paused";
270
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
271
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
272
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
273
- readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
274
- readonly interval: "month" | "year" | "week";
275
- readonly interval_count: number;
276
- readonly current_period_start: string & effect_Brand.Brand<"Timestamp">;
277
- readonly current_period_end: string & effect_Brand.Brand<"Timestamp">;
278
- readonly payment_link: string & effect_Brand.Brand<"UrlString">;
279
- readonly auto_send_link: boolean;
280
- readonly canceled_at?: (string & effect_Brand.Brand<"Timestamp">) | null | undefined;
281
- }, AuthenticationError | InternalServerError | IndustrialError, SecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"retrieve", "GET", {
282
- readonly id: string & effect_Brand.Brand<"SubscriptionId">;
283
- }, never, never, never, {
284
- readonly id: string & effect_Brand.Brand<"SubscriptionId">;
285
- readonly amount: number;
286
- readonly currency: string;
287
- readonly metadata?: {
288
- readonly [x: string]: any;
289
- } | null | undefined;
290
- readonly status: "active" | "past_due" | "canceled" | "paused";
291
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
292
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
293
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
294
- readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
295
- readonly interval: "month" | "year" | "week";
296
- readonly interval_count: number;
297
- readonly current_period_start: string & effect_Brand.Brand<"Timestamp">;
298
- readonly current_period_end: string & effect_Brand.Brand<"Timestamp">;
299
- readonly payment_link: string & effect_Brand.Brand<"UrlString">;
300
- readonly auto_send_link: boolean;
301
- readonly canceled_at?: (string & effect_Brand.Brand<"Timestamp">) | null | undefined;
302
- }, AuthenticationError | InternalServerError | IndustrialError | NotFoundError, SecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, {
303
- readonly status?: "active" | "past_due" | "canceled" | "paused" | undefined;
304
- readonly limit?: number | undefined;
305
- readonly offset?: number | undefined;
306
- readonly projectId?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
307
- readonly customerId?: (string & effect_Brand.Brand<"CustomerId">) | undefined;
308
- }, never, never, {
309
- readonly data: readonly {
310
- readonly id: string & effect_Brand.Brand<"SubscriptionId">;
311
- readonly amount: number;
312
- readonly currency: string;
313
- readonly metadata?: {
314
- readonly [x: string]: any;
315
- } | null | undefined;
316
- readonly status: "active" | "past_due" | "canceled" | "paused";
317
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
318
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
319
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
320
- readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
321
- readonly interval: "month" | "year" | "week";
322
- readonly interval_count: number;
323
- readonly current_period_start: string & effect_Brand.Brand<"Timestamp">;
324
- readonly current_period_end: string & effect_Brand.Brand<"Timestamp">;
325
- readonly payment_link: string & effect_Brand.Brand<"UrlString">;
326
- readonly auto_send_link: boolean;
327
- readonly canceled_at?: (string & effect_Brand.Brand<"Timestamp">) | null | undefined;
328
- }[];
329
- readonly meta: {
330
- readonly total: number | null;
331
- readonly limit: number;
332
- readonly offset: number;
333
- };
334
- }, AuthenticationError | InternalServerError | IndustrialError, SecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"cancel", "POST", {
335
- readonly id: string & effect_Brand.Brand<"SubscriptionId">;
336
- }, never, never, never, {
337
- readonly id: string & effect_Brand.Brand<"SubscriptionId">;
338
- readonly amount: number;
339
- readonly currency: string;
340
- readonly metadata?: {
341
- readonly [x: string]: any;
342
- } | null | undefined;
343
- readonly status: "active" | "past_due" | "canceled" | "paused";
344
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
345
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
346
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
347
- readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
348
- readonly interval: "month" | "year" | "week";
349
- readonly interval_count: number;
350
- readonly current_period_start: string & effect_Brand.Brand<"Timestamp">;
351
- readonly current_period_end: string & effect_Brand.Brand<"Timestamp">;
352
- readonly payment_link: string & effect_Brand.Brand<"UrlString">;
353
- readonly auto_send_link: boolean;
354
- readonly canceled_at?: (string & effect_Brand.Brand<"Timestamp">) | null | undefined;
355
- }, AuthenticationError | InternalServerError | IndustrialError | NotFoundError, SecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"activate", "POST", {
356
- readonly id: string & effect_Brand.Brand<"SubscriptionId">;
357
- }, never, {
358
- readonly provider: "esewa" | "khalti" | "connectips" | "imepay" | "fonepay" | "sandbox";
359
- readonly returnUrl: string;
360
- readonly cancelUrl?: string | undefined;
361
- }, never, {
362
- readonly checkout_url: string;
363
- readonly payment_id: string;
364
- }, InternalServerError | IndustrialError | NotFoundError, never, never>, never, never, false>;
365
- declare const AutomationGroup: HttpApiGroup.HttpApiGroup<"automation", HttpApiEndpoint.HttpApiEndpoint<"reminders", "POST", never, never, never, never, {
366
- readonly message: string;
367
- readonly count: number;
368
- }, InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"reaper", "POST", never, never, never, never, {
369
- readonly message: string;
370
- readonly count: number;
371
- }, InternalServerError, never, never>, AuthenticationError | IndustrialError, CronSecurity, false>;
372
- declare const TokensGroup: HttpApiGroup.HttpApiGroup<"tokens", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", never, never, {
373
- readonly name: string;
374
- readonly scopes: readonly string[];
375
- readonly expires_in_days?: number | undefined;
376
- }, never, {
377
- readonly id: string & effect_Brand.Brand<"TokenId">;
378
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
379
- readonly name: string & effect_Brand.Brand<"NonEmptyString">;
380
- readonly scopes: readonly string[];
381
- readonly last_used_at: (string & effect_Brand.Brand<"Timestamp">) | null;
382
- readonly expires_at: (string & effect_Brand.Brand<"Timestamp">) | null;
383
- readonly token: string;
384
- }, AuthenticationError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, never, never, never, readonly {
385
- readonly id: string & effect_Brand.Brand<"TokenId">;
386
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
387
- readonly name: string & effect_Brand.Brand<"NonEmptyString">;
388
- readonly scopes: readonly string[];
389
- readonly last_used_at: (string & effect_Brand.Brand<"Timestamp">) | null;
390
- readonly expires_at: (string & effect_Brand.Brand<"Timestamp">) | null;
391
- }[], AuthenticationError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"delete", "DELETE", {
392
- readonly id: string & effect_Brand.Brand<"TokenId">;
393
- }, never, never, never, null, AuthenticationError | InternalServerError | NotFoundError, never, never>, AuthenticationError | IndustrialError, UserSecurity, false>;
394
- declare const ProjectsGroup: HttpApiGroup.HttpApiGroup<"projects", HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, never, never, never, readonly {
395
- readonly id: string & effect_Brand.Brand<"ProjectId">;
396
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
397
- readonly name: string & effect_Brand.Brand<"NonEmptyString">;
398
- readonly api_key_secret: string;
399
- }[], AuthenticationError | InternalServerError, never, never>, AuthenticationError | IndustrialError, SecurityMiddleware, false>;
400
- declare const CallbacksGroup: HttpApiGroup.HttpApiGroup<"callbacks", HttpApiEndpoint.HttpApiEndpoint<"handle", "GET", {
401
- readonly provider: string;
402
- }, {
403
- readonly data?: string | undefined;
404
- readonly payment_id?: string | undefined;
405
- readonly pidx?: string | undefined;
406
- }, never, never, any, InternalServerError | IndustrialError | NotFoundError, never, never>, never, never, false>;
407
- declare const RealtimeGroup: HttpApiGroup.HttpApiGroup<"realtime", HttpApiEndpoint.HttpApiEndpoint<"connect", "GET", never, {
408
- readonly token: string;
409
- }, never, never, any, AuthenticationError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"trigger", "POST", never, {
410
- readonly token?: string | undefined;
411
- }, {
412
- readonly data?: any;
413
- readonly event?: "payment.success" | "payment.failed" | "subscription.created" | "subscription.payment_succeeded" | "subscription.payment_failed" | "subscription.renewal_due" | "subscription.canceled" | undefined;
414
- }, never, {
415
- readonly status: string;
416
- readonly event?: string | undefined;
417
- }, AuthenticationError | InternalServerError, never, never>, never, never, false>;
418
- declare const PayArkApi: HttpApi.HttpApi<"PayArkApi", HttpApiGroup.HttpApiGroup<"checkout", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", never, never, {
419
- readonly amount?: (number & effect_Brand.Brand<"MinorUnitsInt">) | undefined;
420
- readonly currency: string;
421
- readonly provider: "esewa" | "khalti" | "connectips" | "imepay" | "fonepay" | "sandbox";
422
- readonly returnUrl: string & effect_Brand.Brand<"UrlString">;
423
- readonly cancelUrl?: (string & effect_Brand.Brand<"UrlString">) | undefined;
424
- readonly metadata?: {
425
- readonly [x: string]: any;
426
- } | undefined;
427
- readonly subscriptionId?: (string & effect_Brand.Brand<"SubscriptionId">) | undefined;
428
- }, never, {
429
- readonly id: string & effect_Brand.Brand<"CheckoutSessionId">;
430
- readonly checkout_url: string & effect_Brand.Brand<"UrlString">;
431
- readonly payment_method: {
432
- readonly type: "esewa" | "khalti" | "connectips" | "imepay" | "fonepay" | "sandbox";
433
- readonly url?: (string & effect_Brand.Brand<"UrlString">) | undefined;
434
- readonly method?: "POST" | "GET" | undefined;
435
- readonly fields?: {
436
- readonly [x: string]: string;
437
- } | undefined;
438
- };
439
- }, AuthenticationError | InternalServerError | IndustrialError, never, never>, AuthenticationError | IndustrialError, SecurityMiddleware, false> | HttpApiGroup.HttpApiGroup<"payments", HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, {
440
- readonly limit?: number | undefined;
441
- readonly offset?: number | undefined;
442
- readonly projectId?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
443
- }, never, never, {
444
- readonly data: readonly {
445
- readonly id: string & effect_Brand.Brand<"PaymentId">;
446
- readonly amount: number;
447
- readonly currency: string;
448
- readonly status: "pending" | "success" | "failed";
449
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
450
- readonly provider_ref?: string | null | undefined;
451
- readonly metadata_json?: {
452
- readonly [x: string]: any;
453
- } | null | undefined;
454
- readonly gateway_response?: any;
455
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
456
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
457
- }[];
458
- readonly meta: {
459
- readonly total: number | null;
460
- readonly limit: number;
461
- readonly offset: number;
462
- };
463
- }, AuthenticationError | InternalServerError | IndustrialError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"retrieve", "GET", {
464
- readonly id: string & effect_Brand.Brand<"Id">;
465
- }, never, never, never, {
466
- readonly id: string & effect_Brand.Brand<"PaymentId">;
467
- readonly amount: number;
468
- readonly currency: string;
469
- readonly status: "pending" | "success" | "failed";
470
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
471
- readonly provider_ref?: string | null | undefined;
472
- readonly metadata_json?: {
473
- readonly [x: string]: any;
474
- } | null | undefined;
475
- readonly gateway_response?: any;
476
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
477
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
478
- }, AuthenticationError | InternalServerError | IndustrialError | NotFoundError, never, never>, AuthenticationError | IndustrialError, SecurityMiddleware, false> | HttpApiGroup.HttpApiGroup<"customers", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", never, never, {
479
- readonly metadata?: {
480
- readonly [x: string]: any;
481
- } | undefined;
482
- readonly project_id?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
483
- readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
484
- readonly email?: (string & effect_Brand.Brand<"Email">) | undefined;
485
- readonly name?: (string & effect_Brand.Brand<"NonEmptyString">) | undefined;
486
- readonly phone?: string | undefined;
487
- }, never, {
488
- readonly id: string & effect_Brand.Brand<"CustomerId">;
489
- readonly metadata: {
490
- readonly [x: string]: any;
491
- } | null;
492
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
493
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
494
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
495
- readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
496
- readonly email: (string & effect_Brand.Brand<"Email">) | null;
497
- readonly name: (string & effect_Brand.Brand<"NonEmptyString">) | null;
498
- readonly phone: string | null;
499
- }, AuthenticationError | InternalServerError | IndustrialError | ConflictError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, {
500
- readonly limit?: number | undefined;
501
- readonly offset?: number | undefined;
502
- readonly projectId?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
503
- readonly merchant_customer_id?: string | undefined;
504
- readonly email?: string | undefined;
505
- }, never, never, {
506
- readonly data: readonly {
507
- readonly id: string & effect_Brand.Brand<"CustomerId">;
508
- readonly metadata: {
509
- readonly [x: string]: any;
510
- } | null;
511
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
512
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
513
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
514
- readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
515
- readonly email: (string & effect_Brand.Brand<"Email">) | null;
516
- readonly name: (string & effect_Brand.Brand<"NonEmptyString">) | null;
517
- readonly phone: string | null;
518
- }[];
519
- readonly meta: {
520
- readonly total: number | null;
521
- readonly limit: number;
522
- readonly offset: number;
523
- };
524
- }, AuthenticationError | InternalServerError | IndustrialError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"retrieve", "GET", {
525
- readonly id: string & effect_Brand.Brand<"Id">;
526
- }, never, never, never, {
527
- readonly id: string & effect_Brand.Brand<"CustomerId">;
528
- readonly metadata: {
529
- readonly [x: string]: any;
530
- } | null;
531
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
532
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
533
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
534
- readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
535
- readonly email: (string & effect_Brand.Brand<"Email">) | null;
536
- readonly name: (string & effect_Brand.Brand<"NonEmptyString">) | null;
537
- readonly phone: string | null;
538
- }, AuthenticationError | InternalServerError | IndustrialError | NotFoundError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"update", "PATCH", {
539
- readonly id: string & effect_Brand.Brand<"Id">;
540
- }, never, {
541
- readonly metadata?: {
542
- readonly [x: string]: any;
543
- } | undefined;
544
- readonly email?: (string & effect_Brand.Brand<"Email">) | undefined;
545
- readonly name?: (string & effect_Brand.Brand<"NonEmptyString">) | undefined;
546
- readonly phone?: string | undefined;
547
- }, never, {
548
- readonly id: string & effect_Brand.Brand<"CustomerId">;
549
- readonly metadata: {
550
- readonly [x: string]: any;
551
- } | null;
552
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
553
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
554
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
555
- readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
556
- readonly email: (string & effect_Brand.Brand<"Email">) | null;
557
- readonly name: (string & effect_Brand.Brand<"NonEmptyString">) | null;
558
- readonly phone: string | null;
559
- }, AuthenticationError | InternalServerError | IndustrialError | NotFoundError | ConflictError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"delete", "DELETE", {
560
- readonly id: string & effect_Brand.Brand<"Id">;
561
- }, never, never, never, void, AuthenticationError | InternalServerError | IndustrialError | NotFoundError | ConflictError, never, never>, AuthenticationError | IndustrialError, SecurityMiddleware, false> | HttpApiGroup.HttpApiGroup<"subscriptions", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", never, never, {
562
- readonly amount: number & effect_Brand.Brand<"MinorUnitsInt">;
563
- readonly currency: string;
564
- readonly metadata?: {
565
- readonly [x: string]: any;
566
- } | undefined;
567
- readonly project_id?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
568
- readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
569
- readonly interval: "month" | "year" | "week";
570
- readonly interval_count?: number | undefined;
571
- readonly auto_send_link?: boolean | undefined;
572
- }, never, {
573
- readonly id: string & effect_Brand.Brand<"SubscriptionId">;
574
- readonly amount: number;
575
- readonly currency: string;
576
- readonly metadata?: {
577
- readonly [x: string]: any;
578
- } | null | undefined;
579
- readonly status: "active" | "past_due" | "canceled" | "paused";
580
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
581
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
582
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
583
- readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
584
- readonly interval: "month" | "year" | "week";
585
- readonly interval_count: number;
586
- readonly current_period_start: string & effect_Brand.Brand<"Timestamp">;
587
- readonly current_period_end: string & effect_Brand.Brand<"Timestamp">;
588
- readonly payment_link: string & effect_Brand.Brand<"UrlString">;
589
- readonly auto_send_link: boolean;
590
- readonly canceled_at?: (string & effect_Brand.Brand<"Timestamp">) | null | undefined;
591
- }, AuthenticationError | InternalServerError | IndustrialError, SecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"retrieve", "GET", {
592
- readonly id: string & effect_Brand.Brand<"SubscriptionId">;
593
- }, never, never, never, {
594
- readonly id: string & effect_Brand.Brand<"SubscriptionId">;
595
- readonly amount: number;
596
- readonly currency: string;
597
- readonly metadata?: {
598
- readonly [x: string]: any;
599
- } | null | undefined;
600
- readonly status: "active" | "past_due" | "canceled" | "paused";
601
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
602
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
603
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
604
- readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
605
- readonly interval: "month" | "year" | "week";
606
- readonly interval_count: number;
607
- readonly current_period_start: string & effect_Brand.Brand<"Timestamp">;
608
- readonly current_period_end: string & effect_Brand.Brand<"Timestamp">;
609
- readonly payment_link: string & effect_Brand.Brand<"UrlString">;
610
- readonly auto_send_link: boolean;
611
- readonly canceled_at?: (string & effect_Brand.Brand<"Timestamp">) | null | undefined;
612
- }, AuthenticationError | InternalServerError | IndustrialError | NotFoundError, SecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, {
613
- readonly status?: "active" | "past_due" | "canceled" | "paused" | undefined;
614
- readonly limit?: number | undefined;
615
- readonly offset?: number | undefined;
616
- readonly projectId?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
617
- readonly customerId?: (string & effect_Brand.Brand<"CustomerId">) | undefined;
618
- }, never, never, {
619
- readonly data: readonly {
620
- readonly id: string & effect_Brand.Brand<"SubscriptionId">;
621
- readonly amount: number;
622
- readonly currency: string;
623
- readonly metadata?: {
624
- readonly [x: string]: any;
625
- } | null | undefined;
626
- readonly status: "active" | "past_due" | "canceled" | "paused";
627
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
628
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
629
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
630
- readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
631
- readonly interval: "month" | "year" | "week";
632
- readonly interval_count: number;
633
- readonly current_period_start: string & effect_Brand.Brand<"Timestamp">;
634
- readonly current_period_end: string & effect_Brand.Brand<"Timestamp">;
635
- readonly payment_link: string & effect_Brand.Brand<"UrlString">;
636
- readonly auto_send_link: boolean;
637
- readonly canceled_at?: (string & effect_Brand.Brand<"Timestamp">) | null | undefined;
638
- }[];
639
- readonly meta: {
640
- readonly total: number | null;
641
- readonly limit: number;
642
- readonly offset: number;
643
- };
644
- }, AuthenticationError | InternalServerError | IndustrialError, SecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"cancel", "POST", {
645
- readonly id: string & effect_Brand.Brand<"SubscriptionId">;
646
- }, never, never, never, {
647
- readonly id: string & effect_Brand.Brand<"SubscriptionId">;
648
- readonly amount: number;
649
- readonly currency: string;
650
- readonly metadata?: {
651
- readonly [x: string]: any;
652
- } | null | undefined;
653
- readonly status: "active" | "past_due" | "canceled" | "paused";
654
- readonly project_id: string & effect_Brand.Brand<"ProjectId">;
655
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
656
- readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
657
- readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
658
- readonly interval: "month" | "year" | "week";
659
- readonly interval_count: number;
660
- readonly current_period_start: string & effect_Brand.Brand<"Timestamp">;
661
- readonly current_period_end: string & effect_Brand.Brand<"Timestamp">;
662
- readonly payment_link: string & effect_Brand.Brand<"UrlString">;
663
- readonly auto_send_link: boolean;
664
- readonly canceled_at?: (string & effect_Brand.Brand<"Timestamp">) | null | undefined;
665
- }, AuthenticationError | InternalServerError | IndustrialError | NotFoundError, SecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"activate", "POST", {
666
- readonly id: string & effect_Brand.Brand<"SubscriptionId">;
667
- }, never, {
668
- readonly provider: "esewa" | "khalti" | "connectips" | "imepay" | "fonepay" | "sandbox";
669
- readonly returnUrl: string;
670
- readonly cancelUrl?: string | undefined;
671
- }, never, {
672
- readonly checkout_url: string;
673
- readonly payment_id: string;
674
- }, InternalServerError | IndustrialError | NotFoundError, never, never>, never, never, false> | HttpApiGroup.HttpApiGroup<"automation", HttpApiEndpoint.HttpApiEndpoint<"reminders", "POST", never, never, never, never, {
675
- readonly message: string;
676
- readonly count: number;
677
- }, InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"reaper", "POST", never, never, never, never, {
678
- readonly message: string;
679
- readonly count: number;
680
- }, InternalServerError, never, never>, AuthenticationError | IndustrialError, CronSecurity, false> | HttpApiGroup.HttpApiGroup<"tokens", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", never, never, {
681
- readonly name: string;
682
- readonly scopes: readonly string[];
683
- readonly expires_in_days?: number | undefined;
684
- }, never, {
685
- readonly id: string & effect_Brand.Brand<"TokenId">;
686
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
687
- readonly name: string & effect_Brand.Brand<"NonEmptyString">;
688
- readonly scopes: readonly string[];
689
- readonly last_used_at: (string & effect_Brand.Brand<"Timestamp">) | null;
690
- readonly expires_at: (string & effect_Brand.Brand<"Timestamp">) | null;
691
- readonly token: string;
692
- }, AuthenticationError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, never, never, never, readonly {
693
- readonly id: string & effect_Brand.Brand<"TokenId">;
694
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
695
- readonly name: string & effect_Brand.Brand<"NonEmptyString">;
696
- readonly scopes: readonly string[];
697
- readonly last_used_at: (string & effect_Brand.Brand<"Timestamp">) | null;
698
- readonly expires_at: (string & effect_Brand.Brand<"Timestamp">) | null;
699
- }[], AuthenticationError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"delete", "DELETE", {
700
- readonly id: string & effect_Brand.Brand<"TokenId">;
701
- }, never, never, never, null, AuthenticationError | InternalServerError | NotFoundError, never, never>, AuthenticationError | IndustrialError, UserSecurity, false> | HttpApiGroup.HttpApiGroup<"projects", HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, never, never, never, readonly {
702
- readonly id: string & effect_Brand.Brand<"ProjectId">;
703
- readonly created_at: string & effect_Brand.Brand<"Timestamp">;
704
- readonly name: string & effect_Brand.Brand<"NonEmptyString">;
705
- readonly api_key_secret: string;
706
- }[], AuthenticationError | InternalServerError, never, never>, AuthenticationError | IndustrialError, SecurityMiddleware, false> | HttpApiGroup.HttpApiGroup<"callbacks", HttpApiEndpoint.HttpApiEndpoint<"handle", "GET", {
707
- readonly provider: string;
708
- }, {
709
- readonly data?: string | undefined;
710
- readonly payment_id?: string | undefined;
711
- readonly pidx?: string | undefined;
712
- }, never, never, any, InternalServerError | IndustrialError | NotFoundError, never, never>, never, never, false> | HttpApiGroup.HttpApiGroup<"realtime", HttpApiEndpoint.HttpApiEndpoint<"connect", "GET", never, {
713
- readonly token: string;
714
- }, never, never, any, AuthenticationError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"trigger", "POST", never, {
715
- readonly token?: string | undefined;
716
- }, {
717
- readonly data?: any;
718
- readonly event?: "payment.success" | "payment.failed" | "subscription.created" | "subscription.payment_succeeded" | "subscription.payment_failed" | "subscription.renewal_due" | "subscription.canceled" | undefined;
719
- }, never, {
720
- readonly status: string;
721
- readonly event?: string | undefined;
722
- }, AuthenticationError | InternalServerError, never, never>, never, never, false>, _effect_platform_HttpApiError.HttpApiDecodeError | AuthenticationError | InternalServerError | IndustrialError | NotFoundError | ConflictError, never>;
723
-
724
- /**
725
- * ── Branded Types ──
726
- */
727
- declare const Id: Schema.brand<typeof Schema.String, "Id">;
728
- type Id = Schema.Schema.Type<typeof Id>;
729
- declare const ProjectId: Schema.brand<typeof Schema.String, "ProjectId">;
730
- type ProjectId = Schema.Schema.Type<typeof ProjectId>;
731
- declare const PaymentId: Schema.brand<typeof Schema.String, "PaymentId">;
732
- type PaymentId = Schema.Schema.Type<typeof PaymentId>;
733
- declare const CheckoutSessionId: Schema.brand<typeof Schema.String, "CheckoutSessionId">;
734
- type CheckoutSessionId = Schema.Schema.Type<typeof CheckoutSessionId>;
735
- declare const SubscriptionId: Schema.brand<typeof Schema.String, "SubscriptionId">;
736
- type SubscriptionId = Schema.Schema.Type<typeof SubscriptionId>;
737
- declare const CustomerId: Schema.brand<typeof Schema.String, "CustomerId">;
738
- type CustomerId = Schema.Schema.Type<typeof CustomerId>;
739
- declare const TokenId: Schema.brand<typeof Schema.String, "TokenId">;
740
- type TokenId = Schema.Schema.Type<typeof TokenId>;
741
- /**
742
- * ── Atomic Atoms ──
743
- */
744
- declare const Email: Schema.brand<Schema.filter<typeof Schema.String>, "Email">;
745
- type Email = Schema.Schema.Type<typeof Email>;
746
- declare const Timestamp: Schema.brand<typeof Schema.String, "Timestamp">;
747
- type Timestamp = Schema.Schema.Type<typeof Timestamp>;
748
- declare const Metadata: Schema.Record$<typeof Schema.String, typeof Schema.Any>;
749
- type Metadata = Schema.Schema.Type<typeof Metadata>;
750
- declare const Timestamps: Schema.Struct<{
751
- created_at: Schema.brand<typeof Schema.String, "Timestamp">;
752
- updated_at: Schema.brand<typeof Schema.String, "Timestamp">;
753
- }>;
754
- type Timestamps = Schema.Schema.Type<typeof Timestamps>;
755
- /**
756
- * ── Enums ──
757
- */
758
- declare const Provider: Schema.Literal<["esewa", "khalti", "connectips", "imepay", "fonepay", "sandbox"]>;
759
- type Provider = Schema.Schema.Type<typeof Provider>;
760
- declare const PaymentStatus: Schema.Literal<["pending", "success", "failed"]>;
761
- type PaymentStatus = Schema.Schema.Type<typeof PaymentStatus>;
762
- declare const SubscriptionStatus: Schema.Literal<["active", "past_due", "canceled", "paused"]>;
763
- type SubscriptionStatus = Schema.Schema.Type<typeof SubscriptionStatus>;
764
- declare const SubscriptionInterval: Schema.Literal<["month", "year", "week"]>;
765
- type SubscriptionInterval = Schema.Schema.Type<typeof SubscriptionInterval>;
766
- /**
767
- * ── Models ──
768
- */
769
- declare const Customer: Schema.Struct<{
770
- id: Schema.brand<typeof Schema.String, "CustomerId">;
771
- merchant_customer_id: Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">;
772
- email: Schema.NullOr<Schema.brand<Schema.filter<typeof Schema.String>, "Email">>;
773
- name: Schema.NullOr<Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">>;
774
- phone: Schema.NullOr<typeof Schema.String>;
775
- project_id: Schema.brand<typeof Schema.String, "ProjectId">;
776
- metadata: Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
777
- created_at: Schema.brand<typeof Schema.String, "Timestamp">;
778
- updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
779
- }>;
780
- type Customer = Schema.Schema.Type<typeof Customer>;
781
- declare const Payment: Schema.Struct<{
782
- id: Schema.brand<typeof Schema.String, "PaymentId">;
783
- project_id: Schema.brand<typeof Schema.String, "ProjectId">;
784
- amount: typeof Schema.Number;
785
- currency: typeof Schema.String;
786
- status: Schema.Literal<["pending", "success", "failed"]>;
787
- provider_ref: Schema.optional<Schema.NullOr<typeof Schema.String>>;
788
- metadata_json: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
789
- gateway_response: Schema.optional<Schema.NullOr<typeof Schema.Any>>;
790
- created_at: Schema.brand<typeof Schema.String, "Timestamp">;
791
- updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
792
- }>;
793
- type Payment = Schema.Schema.Type<typeof Payment>;
794
- declare const Subscription: Schema.Struct<{
795
- id: Schema.brand<typeof Schema.String, "SubscriptionId">;
796
- project_id: Schema.brand<typeof Schema.String, "ProjectId">;
797
- customer_id: Schema.brand<typeof Schema.String, "CustomerId">;
798
- status: Schema.Literal<["active", "past_due", "canceled", "paused"]>;
799
- amount: typeof Schema.Number;
800
- currency: typeof Schema.String;
801
- interval: Schema.Literal<["month", "year", "week"]>;
802
- interval_count: typeof Schema.Number;
803
- current_period_start: Schema.brand<typeof Schema.String, "Timestamp">;
804
- current_period_end: Schema.brand<typeof Schema.String, "Timestamp">;
805
- payment_link: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
806
- auto_send_link: typeof Schema.Boolean;
807
- metadata: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
808
- canceled_at: Schema.optional<Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>>;
809
- created_at: Schema.brand<typeof Schema.String, "Timestamp">;
810
- updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
811
- }>;
812
- type Subscription = Schema.Schema.Type<typeof Subscription>;
813
- declare const Project: Schema.Struct<{
814
- id: Schema.brand<typeof Schema.String, "ProjectId">;
815
- name: Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">;
816
- api_key_secret: typeof Schema.String;
817
- created_at: Schema.brand<typeof Schema.String, "Timestamp">;
818
- }>;
819
- type Project = Schema.Schema.Type<typeof Project>;
820
- declare const Token: Schema.Struct<{
821
- id: Schema.brand<typeof Schema.String, "TokenId">;
822
- name: Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">;
823
- scopes: Schema.Array$<typeof Schema.String>;
824
- last_used_at: Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>;
825
- expires_at: Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>;
826
- created_at: Schema.brand<typeof Schema.String, "Timestamp">;
827
- }>;
828
- type Token = Schema.Schema.Type<typeof Token>;
829
- /**
830
- * ── Pagination ──
831
- */
832
- declare const PaginationMeta: Schema.Struct<{
833
- total: Schema.NullOr<typeof Schema.Number>;
834
- limit: typeof Schema.Number;
835
- offset: typeof Schema.Number;
836
- }>;
837
- type PaginationMeta = Schema.Schema.Type<typeof PaginationMeta>;
838
- declare const PaginatedResponse: <A, I, R>(schema: Schema.Schema<A, I, R>) => Schema.Struct<{
839
- data: Schema.Array$<Schema.Schema<A, I, R>>;
840
- meta: Schema.Struct<{
841
- total: Schema.NullOr<typeof Schema.Number>;
842
- limit: typeof Schema.Number;
843
- offset: typeof Schema.Number;
844
- }>;
845
- }>;
846
- interface PaginatedResponse<T> {
847
- readonly data: readonly T[];
848
- readonly meta: PaginationMeta;
849
- }
850
- /**
851
- * ── Webhooks ──
852
- */
853
- declare const WebhookEventType: Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>;
854
- type WebhookEventType = Schema.Schema.Type<typeof WebhookEventType>;
855
- declare const WebhookEvent: Schema.Struct<{
856
- type: Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>;
857
- id: Schema.optional<typeof Schema.String>;
858
- data: Schema.Union<[Schema.Struct<{
859
- id: Schema.brand<typeof Schema.String, "PaymentId">;
860
- project_id: Schema.brand<typeof Schema.String, "ProjectId">;
861
- amount: typeof Schema.Number;
862
- currency: typeof Schema.String;
863
- status: Schema.Literal<["pending", "success", "failed"]>;
864
- provider_ref: Schema.optional<Schema.NullOr<typeof Schema.String>>;
865
- metadata_json: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
866
- gateway_response: Schema.optional<Schema.NullOr<typeof Schema.Any>>;
867
- created_at: Schema.brand<typeof Schema.String, "Timestamp">;
868
- updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
869
- }>, Schema.Struct<{
870
- id: Schema.brand<typeof Schema.String, "SubscriptionId">;
871
- project_id: Schema.brand<typeof Schema.String, "ProjectId">;
872
- customer_id: Schema.brand<typeof Schema.String, "CustomerId">;
873
- status: Schema.Literal<["active", "past_due", "canceled", "paused"]>;
874
- amount: typeof Schema.Number;
875
- currency: typeof Schema.String;
876
- interval: Schema.Literal<["month", "year", "week"]>;
877
- interval_count: typeof Schema.Number;
878
- current_period_start: Schema.brand<typeof Schema.String, "Timestamp">;
879
- current_period_end: Schema.brand<typeof Schema.String, "Timestamp">;
880
- payment_link: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
881
- auto_send_link: typeof Schema.Boolean;
882
- metadata: Schema.optional<Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>>;
883
- canceled_at: Schema.optional<Schema.NullOr<Schema.brand<typeof Schema.String, "Timestamp">>>;
884
- created_at: Schema.brand<typeof Schema.String, "Timestamp">;
885
- updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
886
- }>, Schema.Struct<{
887
- id: Schema.brand<typeof Schema.String, "CustomerId">;
888
- merchant_customer_id: Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">;
889
- email: Schema.NullOr<Schema.brand<Schema.filter<typeof Schema.String>, "Email">>;
890
- name: Schema.NullOr<Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">>;
891
- phone: Schema.NullOr<typeof Schema.String>;
892
- project_id: Schema.brand<typeof Schema.String, "ProjectId">;
893
- metadata: Schema.NullOr<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
894
- created_at: Schema.brand<typeof Schema.String, "Timestamp">;
895
- updated_at: Schema.optional<Schema.brand<typeof Schema.String, "Timestamp">>;
896
- }>, Schema.Struct<{
897
- id: typeof Schema.String;
898
- amount: Schema.optional<typeof Schema.Number>;
899
- currency: Schema.optional<typeof Schema.String>;
900
- status: typeof Schema.String;
901
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
902
- }>]>;
903
- is_test: typeof Schema.Boolean;
904
- created: Schema.optional<typeof Schema.Number>;
905
- }>;
906
- type WebhookEvent = Schema.Schema.Type<typeof WebhookEvent>;
907
- /**
908
- * ── Params & Inputs ──
909
- */
910
- declare const CreateCheckoutParams: Schema.filter<Schema.Struct<{
911
- amount: Schema.optional<Schema.brand<Schema.filter<Schema.filter<typeof Schema.Number>>, "MinorUnitsInt">>;
912
- currency: Schema.optionalWith<typeof Schema.String, {
913
- default: () => string;
914
- }>;
915
- provider: Schema.Literal<["esewa", "khalti", "connectips", "imepay", "fonepay", "sandbox"]>;
916
- returnUrl: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
917
- cancelUrl: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">>;
918
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
919
- subscriptionId: Schema.optional<Schema.brand<typeof Schema.String, "SubscriptionId">>;
920
- }>>;
921
- type CreateCheckoutParams = Schema.Schema.Type<typeof CreateCheckoutParams>;
922
- declare const CheckoutSession: Schema.Struct<{
923
- id: Schema.brand<typeof Schema.String, "CheckoutSessionId">;
924
- checkout_url: Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">;
925
- payment_method: Schema.Struct<{
926
- type: Schema.Literal<["esewa", "khalti", "connectips", "imepay", "fonepay", "sandbox"]>;
927
- url: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "UrlString">>;
928
- method: Schema.optional<Schema.Literal<["GET", "POST"]>>;
929
- fields: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
930
- }>;
931
- }>;
932
- type CheckoutSession = Schema.Schema.Type<typeof CheckoutSession>;
933
- declare const CreateCustomerParams: Schema.Struct<{
934
- merchant_customer_id: Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">;
935
- email: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "Email">>;
936
- name: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">>;
937
- phone: Schema.optional<typeof Schema.String>;
938
- project_id: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
939
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
940
- }>;
941
- type CreateCustomerParams = Schema.Schema.Type<typeof CreateCustomerParams>;
942
- declare const ListPaymentsParams: Schema.Struct<{
943
- limit: Schema.optional<typeof Schema.NumberFromString>;
944
- offset: Schema.optional<typeof Schema.NumberFromString>;
945
- projectId: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
946
- }>;
947
- type ListPaymentsParams = Schema.Schema.Type<typeof ListPaymentsParams>;
948
- declare const ListCustomersParams: Schema.Struct<{
949
- limit: Schema.optional<typeof Schema.NumberFromString>;
950
- offset: Schema.optional<typeof Schema.NumberFromString>;
951
- email: Schema.optional<typeof Schema.String>;
952
- merchant_customer_id: Schema.optional<typeof Schema.String>;
953
- projectId: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
954
- }>;
955
- type ListCustomersParams = Schema.Schema.Type<typeof ListCustomersParams>;
956
- declare const UpdateCustomerParams: Schema.Struct<{
957
- email: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "Email">>;
958
- name: Schema.optional<Schema.brand<Schema.filter<typeof Schema.String>, "NonEmptyString">>;
959
- phone: Schema.optional<typeof Schema.String>;
960
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
961
- }>;
962
- type UpdateCustomerParams = Schema.Schema.Type<typeof UpdateCustomerParams>;
963
- declare const CreateSubscriptionParams: Schema.Struct<{
964
- customer_id: Schema.brand<typeof Schema.String, "CustomerId">;
965
- amount: Schema.brand<Schema.filter<Schema.filter<typeof Schema.Number>>, "MinorUnitsInt">;
966
- currency: Schema.optionalWith<typeof Schema.String, {
967
- default: () => string;
968
- }>;
969
- interval: Schema.Literal<["month", "year", "week"]>;
970
- interval_count: Schema.optional<typeof Schema.Number>;
971
- project_id: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
972
- auto_send_link: Schema.optional<typeof Schema.Boolean>;
973
- metadata: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Any>>;
974
- }>;
975
- type CreateSubscriptionParams = Schema.Schema.Type<typeof CreateSubscriptionParams>;
976
- declare const CallbackQueryParams: Schema.Struct<{
977
- payment_id: Schema.optional<typeof Schema.String>;
978
- data: Schema.optional<typeof Schema.String>;
979
- pidx: Schema.optional<typeof Schema.String>;
980
- }>;
981
- type CallbackQueryParams = Schema.Schema.Type<typeof CallbackQueryParams>;
982
- declare const ListSubscriptionsParams: Schema.Struct<{
983
- limit: Schema.optional<typeof Schema.NumberFromString>;
984
- offset: Schema.optional<typeof Schema.NumberFromString>;
985
- projectId: Schema.optional<Schema.brand<typeof Schema.String, "ProjectId">>;
986
- customerId: Schema.optional<Schema.brand<typeof Schema.String, "CustomerId">>;
987
- status: Schema.optional<Schema.Literal<["active", "past_due", "canceled", "paused"]>>;
988
- }>;
989
- type ListSubscriptionsParams = Schema.Schema.Type<typeof ListSubscriptionsParams>;
990
- declare const RealtimeTriggerPayload: Schema.Struct<{
991
- event: Schema.optional<Schema.Literal<["payment.success", "payment.failed", "subscription.created", "subscription.payment_succeeded", "subscription.payment_failed", "subscription.renewal_due", "subscription.canceled"]>>;
992
- data: Schema.optional<typeof Schema.Any>;
993
- }>;
994
- type RealtimeTriggerPayload = Schema.Schema.Type<typeof RealtimeTriggerPayload>;
995
- /**
996
- * ── Client Config ──
997
- */
998
- declare const PayArkConfig: Schema.Struct<{
999
- apiKey: typeof Schema.String;
1000
- baseUrl: Schema.optional<typeof Schema.String>;
1001
- timeout: Schema.optional<typeof Schema.Number>;
1002
- maxRetries: Schema.optional<typeof Schema.Number>;
1003
- sandbox: Schema.optional<typeof Schema.Boolean>;
1004
- }>;
1005
- type PayArkConfig = Schema.Schema.Type<typeof PayArkConfig>;
1006
- /**
1007
- * ── Error Schemas ──
1008
- */
1009
- declare const PayArkErrorBody$1: Schema.Struct<{
1010
- error: typeof Schema.String;
1011
- details: Schema.optional<typeof Schema.Any>;
1012
- }>;
1013
- type PayArkErrorBody$1 = Schema.Schema.Type<typeof PayArkErrorBody$1>;
14
+ import 'effect/Effect';
15
+ import '@effect/platform/HttpRouter';
16
+ import 'effect/Redacted';
1014
17
 
1015
18
  /** Machine-readable error codes. */
1016
19
  type PayArkErrorCode = "authentication_error" | "permission_error" | "invalid_request_error" | "not_found_error" | "rate_limit_error" | "api_error" | "connection_error" | "unknown_error";
@@ -2390,4 +1393,4 @@ declare class PayArk extends PayArk_base {
2390
1393
  static readonly Live: (config: PayArkConfig) => Layer.Layer<PayArk, never, never>;
2391
1394
  }
2392
1395
 
2393
- export { AuthContext, AuthenticationError, AutomationGroup, CallbackQueryParams, CallbacksGroup, CheckoutGroup, CheckoutSession, CheckoutSessionId, ConflictError, CreateCheckoutParams, CreateCustomerParams, CreateSubscriptionParams, CronSecurity, Customer, CustomerId, CustomersGroup, Email, Id, IndustrialError, InternalServerError, ListCustomersParams, ListPaymentsParams, ListSubscriptionsParams, Metadata, NotFoundError, PaginatedResponse, PaginationMeta, PayArk, PayArkApi, PayArkClient, PayArkConfig, PayArkEffect, PayArkEffectError, PayArkErrorBody$1 as PayArkErrorBody, Payment, PaymentId, PaymentStatus, PaymentsGroup, Project, ProjectId, ProjectsGroup, Provider, RealtimeGroup, RealtimeTriggerPayload, SecurityMiddleware, Subscription, SubscriptionId, SubscriptionInterval, SubscriptionStatus, SubscriptionsGroup, Timestamp, Timestamps, Token, TokenId, TokensGroup, UpdateCustomerParams, UserSecurity, WebhookEvent, WebhookEventType, makeClient };
1396
+ export { AuthenticationError, CheckoutSession, ConflictError, CreateCheckoutParams, IndustrialError, InternalServerError, ListPaymentsParams, NotFoundError, PaginatedResponse, PayArk, PayArkClient, PayArkConfig, PayArkEffect, PayArkEffectError, Payment, Project, makeClient };