@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,719 @@
1
+ import * as _effect_platform_HttpApiError from '@effect/platform/HttpApiError';
2
+ import * as effect_Brand from 'effect/Brand';
3
+ import * as effect_Effect from 'effect/Effect';
4
+ import * as _effect_platform_HttpRouter from '@effect/platform/HttpRouter';
5
+ import * as effect_Redacted from 'effect/Redacted';
6
+ import { HttpApiGroup, HttpApiEndpoint, HttpApiMiddleware, HttpApiSecurity, HttpApi } from '@effect/platform';
7
+ import { Context, Schema } from 'effect';
8
+
9
+ declare const IndustrialError_base: Schema.TaggedErrorClass<IndustrialError, "IndustrialError", {
10
+ readonly _tag: Schema.tag<"IndustrialError">;
11
+ } & {
12
+ error: typeof Schema.String;
13
+ details: Schema.optional<typeof Schema.Any>;
14
+ }>;
15
+ /**
16
+ * Industrial Error Schema with Status mapping.
17
+ */
18
+ declare class IndustrialError extends IndustrialError_base {
19
+ }
20
+ declare const AuthenticationError_base: Schema.TaggedErrorClass<AuthenticationError, "AuthenticationError", {
21
+ readonly _tag: Schema.tag<"AuthenticationError">;
22
+ } & {
23
+ error: typeof Schema.String;
24
+ }>;
25
+ declare class AuthenticationError extends AuthenticationError_base {
26
+ }
27
+ declare const NotFoundError_base: Schema.TaggedErrorClass<NotFoundError, "NotFoundError", {
28
+ readonly _tag: Schema.tag<"NotFoundError">;
29
+ } & {
30
+ error: typeof Schema.String;
31
+ }>;
32
+ declare class NotFoundError extends NotFoundError_base {
33
+ }
34
+ declare const InternalServerError_base: Schema.TaggedErrorClass<InternalServerError, "InternalServerError", {
35
+ readonly _tag: Schema.tag<"InternalServerError">;
36
+ } & {
37
+ error: typeof Schema.String;
38
+ details: Schema.optional<typeof Schema.Any>;
39
+ }>;
40
+ declare class InternalServerError extends InternalServerError_base {
41
+ }
42
+ declare const ConflictError_base: Schema.TaggedErrorClass<ConflictError, "ConflictError", {
43
+ readonly _tag: Schema.tag<"ConflictError">;
44
+ } & {
45
+ error: typeof Schema.String;
46
+ }>;
47
+ declare class ConflictError extends ConflictError_base {
48
+ }
49
+ /**
50
+ * PayArk Industrial API Specification.
51
+ * Single source of truth for the entire platform.
52
+ */
53
+ interface AuthContext {
54
+ readonly project?: {
55
+ readonly id: string;
56
+ };
57
+ readonly user?: {
58
+ readonly id: string;
59
+ };
60
+ }
61
+ declare const AuthContext: Context.Tag<AuthContext, AuthContext>;
62
+ declare const SecurityMiddleware_base: HttpApiMiddleware.TagClass.BaseSecurity<SecurityMiddleware, "SecurityMiddleware", {
63
+ readonly security: {
64
+ readonly bearer: HttpApiSecurity.Bearer;
65
+ };
66
+ readonly provides: Context.Tag<AuthContext, AuthContext>;
67
+ readonly failure: Schema.Union<[typeof AuthenticationError, typeof IndustrialError]>;
68
+ }, {
69
+ readonly bearer: (_: effect_Redacted.Redacted<string>) => effect_Effect.Effect<AuthContext, IndustrialError | AuthenticationError, _effect_platform_HttpRouter.HttpRouter.Provided>;
70
+ }, {
71
+ readonly bearer: HttpApiSecurity.Bearer;
72
+ }>;
73
+ declare class SecurityMiddleware extends SecurityMiddleware_base {
74
+ }
75
+ declare const CronSecurity_base: HttpApiMiddleware.TagClass.BaseSecurity<CronSecurity, "CronSecurity", {
76
+ readonly security: {
77
+ readonly secret: HttpApiSecurity.ApiKey;
78
+ };
79
+ readonly failure: Schema.Union<[typeof AuthenticationError, typeof IndustrialError]>;
80
+ }, {
81
+ readonly secret: (_: effect_Redacted.Redacted<string>) => effect_Effect.Effect<void, IndustrialError | AuthenticationError, _effect_platform_HttpRouter.HttpRouter.Provided>;
82
+ }, {
83
+ readonly secret: HttpApiSecurity.ApiKey;
84
+ }>;
85
+ declare class CronSecurity extends CronSecurity_base {
86
+ }
87
+ declare const UserSecurity_base: HttpApiMiddleware.TagClass.BaseSecurity<UserSecurity, "UserSecurity", {
88
+ readonly security: {
89
+ readonly bearer: HttpApiSecurity.Bearer;
90
+ };
91
+ readonly provides: Context.Tag<AuthContext, AuthContext>;
92
+ readonly failure: Schema.Union<[typeof AuthenticationError, typeof IndustrialError]>;
93
+ }, {
94
+ readonly bearer: (_: effect_Redacted.Redacted<string>) => effect_Effect.Effect<AuthContext, IndustrialError | AuthenticationError, _effect_platform_HttpRouter.HttpRouter.Provided>;
95
+ }, {
96
+ readonly bearer: HttpApiSecurity.Bearer;
97
+ }>;
98
+ declare class UserSecurity extends UserSecurity_base {
99
+ }
100
+ declare const CheckoutGroup: HttpApiGroup.HttpApiGroup<"checkout", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", never, never, {
101
+ readonly amount?: (number & effect_Brand.Brand<"MinorUnitsInt">) | undefined;
102
+ readonly currency: string;
103
+ readonly provider: "esewa" | "khalti" | "connectips" | "imepay" | "fonepay" | "sandbox";
104
+ readonly returnUrl: string & effect_Brand.Brand<"UrlString">;
105
+ readonly cancelUrl?: (string & effect_Brand.Brand<"UrlString">) | undefined;
106
+ readonly metadata?: {
107
+ readonly [x: string]: any;
108
+ } | undefined;
109
+ readonly subscriptionId?: (string & effect_Brand.Brand<"SubscriptionId">) | undefined;
110
+ }, never, {
111
+ readonly id: string & effect_Brand.Brand<"CheckoutSessionId">;
112
+ readonly checkout_url: string & effect_Brand.Brand<"UrlString">;
113
+ readonly payment_method: {
114
+ readonly fields?: {
115
+ readonly [x: string]: string;
116
+ } | undefined;
117
+ readonly type: "esewa" | "khalti" | "connectips" | "imepay" | "fonepay" | "sandbox";
118
+ readonly url?: (string & effect_Brand.Brand<"UrlString">) | undefined;
119
+ readonly method?: "POST" | "GET" | undefined;
120
+ };
121
+ }, IndustrialError | AuthenticationError | InternalServerError, never, never>, IndustrialError | AuthenticationError, SecurityMiddleware, false>;
122
+ declare const PaymentsGroup: HttpApiGroup.HttpApiGroup<"payments", HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, {
123
+ readonly limit?: number | undefined;
124
+ readonly offset?: number | undefined;
125
+ readonly projectId?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
126
+ }, never, never, {
127
+ readonly data: readonly {
128
+ readonly id: string & effect_Brand.Brand<"PaymentId">;
129
+ readonly amount: number;
130
+ readonly currency: string;
131
+ readonly status: "pending" | "success" | "failed";
132
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
133
+ readonly provider_ref?: string | null | undefined;
134
+ readonly metadata_json?: {
135
+ readonly [x: string]: any;
136
+ } | null | undefined;
137
+ readonly gateway_response?: any;
138
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
139
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
140
+ }[];
141
+ readonly meta: {
142
+ readonly total: number | null;
143
+ readonly limit: number;
144
+ readonly offset: number;
145
+ };
146
+ }, IndustrialError | AuthenticationError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"retrieve", "GET", {
147
+ readonly id: string & effect_Brand.Brand<"Id">;
148
+ }, never, never, never, {
149
+ readonly id: string & effect_Brand.Brand<"PaymentId">;
150
+ readonly amount: number;
151
+ readonly currency: string;
152
+ readonly status: "pending" | "success" | "failed";
153
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
154
+ readonly provider_ref?: string | null | undefined;
155
+ readonly metadata_json?: {
156
+ readonly [x: string]: any;
157
+ } | null | undefined;
158
+ readonly gateway_response?: any;
159
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
160
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
161
+ }, IndustrialError | AuthenticationError | NotFoundError | InternalServerError, never, never>, IndustrialError | AuthenticationError, SecurityMiddleware, false>;
162
+ declare const CustomersGroup: HttpApiGroup.HttpApiGroup<"customers", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", never, never, {
163
+ readonly metadata?: {
164
+ readonly [x: string]: any;
165
+ } | undefined;
166
+ readonly project_id?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
167
+ readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
168
+ readonly email?: (string & effect_Brand.Brand<"Email">) | undefined;
169
+ readonly name?: (string & effect_Brand.Brand<"NonEmptyString">) | undefined;
170
+ readonly phone?: string | undefined;
171
+ }, never, {
172
+ readonly id: string & effect_Brand.Brand<"CustomerId">;
173
+ readonly metadata: {
174
+ readonly [x: string]: any;
175
+ } | null;
176
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
177
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
178
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
179
+ readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
180
+ readonly email: (string & effect_Brand.Brand<"Email">) | null;
181
+ readonly name: (string & effect_Brand.Brand<"NonEmptyString">) | null;
182
+ readonly phone: string | null;
183
+ }, IndustrialError | AuthenticationError | InternalServerError | ConflictError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, {
184
+ readonly limit?: number | undefined;
185
+ readonly offset?: number | undefined;
186
+ readonly projectId?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
187
+ readonly merchant_customer_id?: string | undefined;
188
+ readonly email?: string | undefined;
189
+ }, never, never, {
190
+ readonly data: readonly {
191
+ readonly id: string & effect_Brand.Brand<"CustomerId">;
192
+ readonly metadata: {
193
+ readonly [x: string]: any;
194
+ } | null;
195
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
196
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
197
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
198
+ readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
199
+ readonly email: (string & effect_Brand.Brand<"Email">) | null;
200
+ readonly name: (string & effect_Brand.Brand<"NonEmptyString">) | null;
201
+ readonly phone: string | null;
202
+ }[];
203
+ readonly meta: {
204
+ readonly total: number | null;
205
+ readonly limit: number;
206
+ readonly offset: number;
207
+ };
208
+ }, IndustrialError | AuthenticationError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"retrieve", "GET", {
209
+ readonly id: string & effect_Brand.Brand<"Id">;
210
+ }, never, never, never, {
211
+ readonly id: string & effect_Brand.Brand<"CustomerId">;
212
+ readonly metadata: {
213
+ readonly [x: string]: any;
214
+ } | null;
215
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
216
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
217
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
218
+ readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
219
+ readonly email: (string & effect_Brand.Brand<"Email">) | null;
220
+ readonly name: (string & effect_Brand.Brand<"NonEmptyString">) | null;
221
+ readonly phone: string | null;
222
+ }, IndustrialError | AuthenticationError | NotFoundError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"update", "PATCH", {
223
+ readonly id: string & effect_Brand.Brand<"Id">;
224
+ }, never, {
225
+ readonly metadata?: {
226
+ readonly [x: string]: any;
227
+ } | undefined;
228
+ readonly email?: (string & effect_Brand.Brand<"Email">) | undefined;
229
+ readonly name?: (string & effect_Brand.Brand<"NonEmptyString">) | undefined;
230
+ readonly phone?: string | undefined;
231
+ }, never, {
232
+ readonly id: string & effect_Brand.Brand<"CustomerId">;
233
+ readonly metadata: {
234
+ readonly [x: string]: any;
235
+ } | null;
236
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
237
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
238
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
239
+ readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
240
+ readonly email: (string & effect_Brand.Brand<"Email">) | null;
241
+ readonly name: (string & effect_Brand.Brand<"NonEmptyString">) | null;
242
+ readonly phone: string | null;
243
+ }, IndustrialError | AuthenticationError | NotFoundError | InternalServerError | ConflictError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"delete", "DELETE", {
244
+ readonly id: string & effect_Brand.Brand<"Id">;
245
+ }, never, never, never, void, IndustrialError | AuthenticationError | NotFoundError | InternalServerError | ConflictError, never, never>, IndustrialError | AuthenticationError, SecurityMiddleware, false>;
246
+ declare const SubscriptionsGroup: HttpApiGroup.HttpApiGroup<"subscriptions", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", never, never, {
247
+ readonly amount: number & effect_Brand.Brand<"MinorUnitsInt">;
248
+ readonly currency: string;
249
+ readonly metadata?: {
250
+ readonly [x: string]: any;
251
+ } | undefined;
252
+ readonly project_id?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
253
+ readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
254
+ readonly interval: "month" | "year" | "week";
255
+ readonly interval_count?: number | undefined;
256
+ readonly auto_send_link?: boolean | undefined;
257
+ }, never, {
258
+ readonly id: string & effect_Brand.Brand<"SubscriptionId">;
259
+ readonly amount: number;
260
+ readonly currency: string;
261
+ readonly metadata?: {
262
+ readonly [x: string]: any;
263
+ } | null | undefined;
264
+ readonly status: "active" | "past_due" | "canceled" | "paused";
265
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
266
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
267
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
268
+ readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
269
+ readonly interval: "month" | "year" | "week";
270
+ readonly interval_count: number;
271
+ readonly current_period_start: string & effect_Brand.Brand<"Timestamp">;
272
+ readonly current_period_end: string & effect_Brand.Brand<"Timestamp">;
273
+ readonly payment_link: string & effect_Brand.Brand<"UrlString">;
274
+ readonly auto_send_link: boolean;
275
+ readonly canceled_at?: (string & effect_Brand.Brand<"Timestamp">) | null | undefined;
276
+ }, IndustrialError | AuthenticationError | InternalServerError, SecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"retrieve", "GET", {
277
+ readonly id: string & effect_Brand.Brand<"SubscriptionId">;
278
+ }, never, never, never, {
279
+ readonly id: string & effect_Brand.Brand<"SubscriptionId">;
280
+ readonly amount: number;
281
+ readonly currency: string;
282
+ readonly metadata?: {
283
+ readonly [x: string]: any;
284
+ } | null | undefined;
285
+ readonly status: "active" | "past_due" | "canceled" | "paused";
286
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
287
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
288
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
289
+ readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
290
+ readonly interval: "month" | "year" | "week";
291
+ readonly interval_count: number;
292
+ readonly current_period_start: string & effect_Brand.Brand<"Timestamp">;
293
+ readonly current_period_end: string & effect_Brand.Brand<"Timestamp">;
294
+ readonly payment_link: string & effect_Brand.Brand<"UrlString">;
295
+ readonly auto_send_link: boolean;
296
+ readonly canceled_at?: (string & effect_Brand.Brand<"Timestamp">) | null | undefined;
297
+ }, IndustrialError | AuthenticationError | NotFoundError | InternalServerError, SecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, {
298
+ readonly status?: "active" | "past_due" | "canceled" | "paused" | undefined;
299
+ readonly limit?: number | undefined;
300
+ readonly offset?: number | undefined;
301
+ readonly projectId?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
302
+ readonly customerId?: (string & effect_Brand.Brand<"CustomerId">) | undefined;
303
+ }, never, never, {
304
+ readonly data: readonly {
305
+ readonly id: string & effect_Brand.Brand<"SubscriptionId">;
306
+ readonly amount: number;
307
+ readonly currency: string;
308
+ readonly metadata?: {
309
+ readonly [x: string]: any;
310
+ } | null | undefined;
311
+ readonly status: "active" | "past_due" | "canceled" | "paused";
312
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
313
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
314
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
315
+ readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
316
+ readonly interval: "month" | "year" | "week";
317
+ readonly interval_count: number;
318
+ readonly current_period_start: string & effect_Brand.Brand<"Timestamp">;
319
+ readonly current_period_end: string & effect_Brand.Brand<"Timestamp">;
320
+ readonly payment_link: string & effect_Brand.Brand<"UrlString">;
321
+ readonly auto_send_link: boolean;
322
+ readonly canceled_at?: (string & effect_Brand.Brand<"Timestamp">) | null | undefined;
323
+ }[];
324
+ readonly meta: {
325
+ readonly total: number | null;
326
+ readonly limit: number;
327
+ readonly offset: number;
328
+ };
329
+ }, IndustrialError | AuthenticationError | InternalServerError, SecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"cancel", "POST", {
330
+ readonly id: string & effect_Brand.Brand<"SubscriptionId">;
331
+ }, never, never, never, {
332
+ readonly id: string & effect_Brand.Brand<"SubscriptionId">;
333
+ readonly amount: number;
334
+ readonly currency: string;
335
+ readonly metadata?: {
336
+ readonly [x: string]: any;
337
+ } | null | undefined;
338
+ readonly status: "active" | "past_due" | "canceled" | "paused";
339
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
340
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
341
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
342
+ readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
343
+ readonly interval: "month" | "year" | "week";
344
+ readonly interval_count: number;
345
+ readonly current_period_start: string & effect_Brand.Brand<"Timestamp">;
346
+ readonly current_period_end: string & effect_Brand.Brand<"Timestamp">;
347
+ readonly payment_link: string & effect_Brand.Brand<"UrlString">;
348
+ readonly auto_send_link: boolean;
349
+ readonly canceled_at?: (string & effect_Brand.Brand<"Timestamp">) | null | undefined;
350
+ }, IndustrialError | AuthenticationError | NotFoundError | InternalServerError, SecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"activate", "POST", {
351
+ readonly id: string & effect_Brand.Brand<"SubscriptionId">;
352
+ }, never, {
353
+ readonly provider: "esewa" | "khalti" | "connectips" | "imepay" | "fonepay" | "sandbox";
354
+ readonly returnUrl: string;
355
+ readonly cancelUrl?: string | undefined;
356
+ }, never, {
357
+ readonly checkout_url: string;
358
+ readonly payment_id: string;
359
+ }, IndustrialError | NotFoundError | InternalServerError, never, never>, never, never, false>;
360
+ declare const AutomationGroup: HttpApiGroup.HttpApiGroup<"automation", HttpApiEndpoint.HttpApiEndpoint<"reminders", "POST", never, never, never, never, {
361
+ readonly message: string;
362
+ readonly count: number;
363
+ }, InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"reaper", "POST", never, never, never, never, {
364
+ readonly message: string;
365
+ readonly count: number;
366
+ }, InternalServerError, never, never>, IndustrialError | AuthenticationError, CronSecurity, false>;
367
+ declare const TokensGroup: HttpApiGroup.HttpApiGroup<"tokens", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", never, never, {
368
+ readonly name: string;
369
+ readonly scopes: readonly string[];
370
+ readonly expires_in_days?: number | undefined;
371
+ }, never, {
372
+ readonly id: string & effect_Brand.Brand<"TokenId">;
373
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
374
+ readonly name: string & effect_Brand.Brand<"NonEmptyString">;
375
+ readonly scopes: readonly string[];
376
+ readonly last_used_at: (string & effect_Brand.Brand<"Timestamp">) | null;
377
+ readonly expires_at: (string & effect_Brand.Brand<"Timestamp">) | null;
378
+ readonly token: string;
379
+ }, AuthenticationError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, never, never, never, readonly {
380
+ readonly id: string & effect_Brand.Brand<"TokenId">;
381
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
382
+ readonly name: string & effect_Brand.Brand<"NonEmptyString">;
383
+ readonly scopes: readonly string[];
384
+ readonly last_used_at: (string & effect_Brand.Brand<"Timestamp">) | null;
385
+ readonly expires_at: (string & effect_Brand.Brand<"Timestamp">) | null;
386
+ }[], AuthenticationError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"delete", "DELETE", {
387
+ readonly id: string & effect_Brand.Brand<"TokenId">;
388
+ }, never, never, never, null, AuthenticationError | NotFoundError | InternalServerError, never, never>, IndustrialError | AuthenticationError, UserSecurity, false>;
389
+ declare const ProjectsGroup: HttpApiGroup.HttpApiGroup<"projects", HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, never, never, never, readonly {
390
+ readonly id: string & effect_Brand.Brand<"ProjectId">;
391
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
392
+ readonly name: string & effect_Brand.Brand<"NonEmptyString">;
393
+ readonly api_key_secret: string;
394
+ }[], AuthenticationError | InternalServerError, never, never>, IndustrialError | AuthenticationError, SecurityMiddleware, false>;
395
+ declare const CallbacksGroup: HttpApiGroup.HttpApiGroup<"callbacks", HttpApiEndpoint.HttpApiEndpoint<"handle", "GET", {
396
+ readonly provider: string;
397
+ }, {
398
+ readonly data?: string | undefined;
399
+ readonly payment_id?: string | undefined;
400
+ readonly pidx?: string | undefined;
401
+ }, never, never, any, IndustrialError | NotFoundError | InternalServerError, never, never>, never, never, false>;
402
+ declare const RealtimeGroup: HttpApiGroup.HttpApiGroup<"realtime", HttpApiEndpoint.HttpApiEndpoint<"connect", "GET", never, {
403
+ readonly token: string;
404
+ }, never, never, any, AuthenticationError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"trigger", "POST", never, {
405
+ readonly token?: string | undefined;
406
+ }, {
407
+ readonly data?: any;
408
+ readonly event?: "payment.success" | "payment.failed" | "subscription.created" | "subscription.payment_succeeded" | "subscription.payment_failed" | "subscription.renewal_due" | "subscription.canceled" | undefined;
409
+ }, never, {
410
+ readonly status: string;
411
+ readonly event?: string | undefined;
412
+ }, AuthenticationError | InternalServerError, never, never>, never, never, false>;
413
+ declare const PayArkApi: HttpApi.HttpApi<"PayArkApi", HttpApiGroup.HttpApiGroup<"checkout", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", never, never, {
414
+ readonly amount?: (number & effect_Brand.Brand<"MinorUnitsInt">) | undefined;
415
+ readonly currency: string;
416
+ readonly provider: "esewa" | "khalti" | "connectips" | "imepay" | "fonepay" | "sandbox";
417
+ readonly returnUrl: string & effect_Brand.Brand<"UrlString">;
418
+ readonly cancelUrl?: (string & effect_Brand.Brand<"UrlString">) | undefined;
419
+ readonly metadata?: {
420
+ readonly [x: string]: any;
421
+ } | undefined;
422
+ readonly subscriptionId?: (string & effect_Brand.Brand<"SubscriptionId">) | undefined;
423
+ }, never, {
424
+ readonly id: string & effect_Brand.Brand<"CheckoutSessionId">;
425
+ readonly checkout_url: string & effect_Brand.Brand<"UrlString">;
426
+ readonly payment_method: {
427
+ readonly fields?: {
428
+ readonly [x: string]: string;
429
+ } | undefined;
430
+ readonly type: "esewa" | "khalti" | "connectips" | "imepay" | "fonepay" | "sandbox";
431
+ readonly url?: (string & effect_Brand.Brand<"UrlString">) | undefined;
432
+ readonly method?: "POST" | "GET" | undefined;
433
+ };
434
+ }, IndustrialError | AuthenticationError | InternalServerError, never, never>, IndustrialError | AuthenticationError, SecurityMiddleware, false> | HttpApiGroup.HttpApiGroup<"payments", HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, {
435
+ readonly limit?: number | undefined;
436
+ readonly offset?: number | undefined;
437
+ readonly projectId?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
438
+ }, never, never, {
439
+ readonly data: readonly {
440
+ readonly id: string & effect_Brand.Brand<"PaymentId">;
441
+ readonly amount: number;
442
+ readonly currency: string;
443
+ readonly status: "pending" | "success" | "failed";
444
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
445
+ readonly provider_ref?: string | null | undefined;
446
+ readonly metadata_json?: {
447
+ readonly [x: string]: any;
448
+ } | null | undefined;
449
+ readonly gateway_response?: any;
450
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
451
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
452
+ }[];
453
+ readonly meta: {
454
+ readonly total: number | null;
455
+ readonly limit: number;
456
+ readonly offset: number;
457
+ };
458
+ }, IndustrialError | AuthenticationError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"retrieve", "GET", {
459
+ readonly id: string & effect_Brand.Brand<"Id">;
460
+ }, never, never, never, {
461
+ readonly id: string & effect_Brand.Brand<"PaymentId">;
462
+ readonly amount: number;
463
+ readonly currency: string;
464
+ readonly status: "pending" | "success" | "failed";
465
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
466
+ readonly provider_ref?: string | null | undefined;
467
+ readonly metadata_json?: {
468
+ readonly [x: string]: any;
469
+ } | null | undefined;
470
+ readonly gateway_response?: any;
471
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
472
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
473
+ }, IndustrialError | AuthenticationError | NotFoundError | InternalServerError, never, never>, IndustrialError | AuthenticationError, SecurityMiddleware, false> | HttpApiGroup.HttpApiGroup<"customers", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", never, never, {
474
+ readonly metadata?: {
475
+ readonly [x: string]: any;
476
+ } | undefined;
477
+ readonly project_id?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
478
+ readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
479
+ readonly email?: (string & effect_Brand.Brand<"Email">) | undefined;
480
+ readonly name?: (string & effect_Brand.Brand<"NonEmptyString">) | undefined;
481
+ readonly phone?: string | undefined;
482
+ }, never, {
483
+ readonly id: string & effect_Brand.Brand<"CustomerId">;
484
+ readonly metadata: {
485
+ readonly [x: string]: any;
486
+ } | null;
487
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
488
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
489
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
490
+ readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
491
+ readonly email: (string & effect_Brand.Brand<"Email">) | null;
492
+ readonly name: (string & effect_Brand.Brand<"NonEmptyString">) | null;
493
+ readonly phone: string | null;
494
+ }, IndustrialError | AuthenticationError | InternalServerError | ConflictError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, {
495
+ readonly limit?: number | undefined;
496
+ readonly offset?: number | undefined;
497
+ readonly projectId?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
498
+ readonly merchant_customer_id?: string | undefined;
499
+ readonly email?: string | undefined;
500
+ }, never, never, {
501
+ readonly data: readonly {
502
+ readonly id: string & effect_Brand.Brand<"CustomerId">;
503
+ readonly metadata: {
504
+ readonly [x: string]: any;
505
+ } | null;
506
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
507
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
508
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
509
+ readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
510
+ readonly email: (string & effect_Brand.Brand<"Email">) | null;
511
+ readonly name: (string & effect_Brand.Brand<"NonEmptyString">) | null;
512
+ readonly phone: string | null;
513
+ }[];
514
+ readonly meta: {
515
+ readonly total: number | null;
516
+ readonly limit: number;
517
+ readonly offset: number;
518
+ };
519
+ }, IndustrialError | AuthenticationError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"retrieve", "GET", {
520
+ readonly id: string & effect_Brand.Brand<"Id">;
521
+ }, never, never, never, {
522
+ readonly id: string & effect_Brand.Brand<"CustomerId">;
523
+ readonly metadata: {
524
+ readonly [x: string]: any;
525
+ } | null;
526
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
527
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
528
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
529
+ readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
530
+ readonly email: (string & effect_Brand.Brand<"Email">) | null;
531
+ readonly name: (string & effect_Brand.Brand<"NonEmptyString">) | null;
532
+ readonly phone: string | null;
533
+ }, IndustrialError | AuthenticationError | NotFoundError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"update", "PATCH", {
534
+ readonly id: string & effect_Brand.Brand<"Id">;
535
+ }, never, {
536
+ readonly metadata?: {
537
+ readonly [x: string]: any;
538
+ } | undefined;
539
+ readonly email?: (string & effect_Brand.Brand<"Email">) | undefined;
540
+ readonly name?: (string & effect_Brand.Brand<"NonEmptyString">) | undefined;
541
+ readonly phone?: string | undefined;
542
+ }, never, {
543
+ readonly id: string & effect_Brand.Brand<"CustomerId">;
544
+ readonly metadata: {
545
+ readonly [x: string]: any;
546
+ } | null;
547
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
548
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
549
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
550
+ readonly merchant_customer_id: string & effect_Brand.Brand<"NonEmptyString">;
551
+ readonly email: (string & effect_Brand.Brand<"Email">) | null;
552
+ readonly name: (string & effect_Brand.Brand<"NonEmptyString">) | null;
553
+ readonly phone: string | null;
554
+ }, IndustrialError | AuthenticationError | NotFoundError | InternalServerError | ConflictError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"delete", "DELETE", {
555
+ readonly id: string & effect_Brand.Brand<"Id">;
556
+ }, never, never, never, void, IndustrialError | AuthenticationError | NotFoundError | InternalServerError | ConflictError, never, never>, IndustrialError | AuthenticationError, SecurityMiddleware, false> | HttpApiGroup.HttpApiGroup<"subscriptions", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", never, never, {
557
+ readonly amount: number & effect_Brand.Brand<"MinorUnitsInt">;
558
+ readonly currency: string;
559
+ readonly metadata?: {
560
+ readonly [x: string]: any;
561
+ } | undefined;
562
+ readonly project_id?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
563
+ readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
564
+ readonly interval: "month" | "year" | "week";
565
+ readonly interval_count?: number | undefined;
566
+ readonly auto_send_link?: boolean | undefined;
567
+ }, never, {
568
+ readonly id: string & effect_Brand.Brand<"SubscriptionId">;
569
+ readonly amount: number;
570
+ readonly currency: string;
571
+ readonly metadata?: {
572
+ readonly [x: string]: any;
573
+ } | null | undefined;
574
+ readonly status: "active" | "past_due" | "canceled" | "paused";
575
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
576
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
577
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
578
+ readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
579
+ readonly interval: "month" | "year" | "week";
580
+ readonly interval_count: number;
581
+ readonly current_period_start: string & effect_Brand.Brand<"Timestamp">;
582
+ readonly current_period_end: string & effect_Brand.Brand<"Timestamp">;
583
+ readonly payment_link: string & effect_Brand.Brand<"UrlString">;
584
+ readonly auto_send_link: boolean;
585
+ readonly canceled_at?: (string & effect_Brand.Brand<"Timestamp">) | null | undefined;
586
+ }, IndustrialError | AuthenticationError | InternalServerError, SecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"retrieve", "GET", {
587
+ readonly id: string & effect_Brand.Brand<"SubscriptionId">;
588
+ }, never, never, never, {
589
+ readonly id: string & effect_Brand.Brand<"SubscriptionId">;
590
+ readonly amount: number;
591
+ readonly currency: string;
592
+ readonly metadata?: {
593
+ readonly [x: string]: any;
594
+ } | null | undefined;
595
+ readonly status: "active" | "past_due" | "canceled" | "paused";
596
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
597
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
598
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
599
+ readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
600
+ readonly interval: "month" | "year" | "week";
601
+ readonly interval_count: number;
602
+ readonly current_period_start: string & effect_Brand.Brand<"Timestamp">;
603
+ readonly current_period_end: string & effect_Brand.Brand<"Timestamp">;
604
+ readonly payment_link: string & effect_Brand.Brand<"UrlString">;
605
+ readonly auto_send_link: boolean;
606
+ readonly canceled_at?: (string & effect_Brand.Brand<"Timestamp">) | null | undefined;
607
+ }, IndustrialError | AuthenticationError | NotFoundError | InternalServerError, SecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, {
608
+ readonly status?: "active" | "past_due" | "canceled" | "paused" | undefined;
609
+ readonly limit?: number | undefined;
610
+ readonly offset?: number | undefined;
611
+ readonly projectId?: (string & effect_Brand.Brand<"ProjectId">) | undefined;
612
+ readonly customerId?: (string & effect_Brand.Brand<"CustomerId">) | undefined;
613
+ }, never, never, {
614
+ readonly data: readonly {
615
+ readonly id: string & effect_Brand.Brand<"SubscriptionId">;
616
+ readonly amount: number;
617
+ readonly currency: string;
618
+ readonly metadata?: {
619
+ readonly [x: string]: any;
620
+ } | null | undefined;
621
+ readonly status: "active" | "past_due" | "canceled" | "paused";
622
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
623
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
624
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
625
+ readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
626
+ readonly interval: "month" | "year" | "week";
627
+ readonly interval_count: number;
628
+ readonly current_period_start: string & effect_Brand.Brand<"Timestamp">;
629
+ readonly current_period_end: string & effect_Brand.Brand<"Timestamp">;
630
+ readonly payment_link: string & effect_Brand.Brand<"UrlString">;
631
+ readonly auto_send_link: boolean;
632
+ readonly canceled_at?: (string & effect_Brand.Brand<"Timestamp">) | null | undefined;
633
+ }[];
634
+ readonly meta: {
635
+ readonly total: number | null;
636
+ readonly limit: number;
637
+ readonly offset: number;
638
+ };
639
+ }, IndustrialError | AuthenticationError | InternalServerError, SecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"cancel", "POST", {
640
+ readonly id: string & effect_Brand.Brand<"SubscriptionId">;
641
+ }, never, never, never, {
642
+ readonly id: string & effect_Brand.Brand<"SubscriptionId">;
643
+ readonly amount: number;
644
+ readonly currency: string;
645
+ readonly metadata?: {
646
+ readonly [x: string]: any;
647
+ } | null | undefined;
648
+ readonly status: "active" | "past_due" | "canceled" | "paused";
649
+ readonly project_id: string & effect_Brand.Brand<"ProjectId">;
650
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
651
+ readonly updated_at?: (string & effect_Brand.Brand<"Timestamp">) | undefined;
652
+ readonly customer_id: string & effect_Brand.Brand<"CustomerId">;
653
+ readonly interval: "month" | "year" | "week";
654
+ readonly interval_count: number;
655
+ readonly current_period_start: string & effect_Brand.Brand<"Timestamp">;
656
+ readonly current_period_end: string & effect_Brand.Brand<"Timestamp">;
657
+ readonly payment_link: string & effect_Brand.Brand<"UrlString">;
658
+ readonly auto_send_link: boolean;
659
+ readonly canceled_at?: (string & effect_Brand.Brand<"Timestamp">) | null | undefined;
660
+ }, IndustrialError | AuthenticationError | NotFoundError | InternalServerError, SecurityMiddleware, never> | HttpApiEndpoint.HttpApiEndpoint<"activate", "POST", {
661
+ readonly id: string & effect_Brand.Brand<"SubscriptionId">;
662
+ }, never, {
663
+ readonly provider: "esewa" | "khalti" | "connectips" | "imepay" | "fonepay" | "sandbox";
664
+ readonly returnUrl: string;
665
+ readonly cancelUrl?: string | undefined;
666
+ }, never, {
667
+ readonly checkout_url: string;
668
+ readonly payment_id: string;
669
+ }, IndustrialError | NotFoundError | InternalServerError, never, never>, never, never, false> | HttpApiGroup.HttpApiGroup<"automation", HttpApiEndpoint.HttpApiEndpoint<"reminders", "POST", never, never, never, never, {
670
+ readonly message: string;
671
+ readonly count: number;
672
+ }, InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"reaper", "POST", never, never, never, never, {
673
+ readonly message: string;
674
+ readonly count: number;
675
+ }, InternalServerError, never, never>, IndustrialError | AuthenticationError, CronSecurity, false> | HttpApiGroup.HttpApiGroup<"tokens", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", never, never, {
676
+ readonly name: string;
677
+ readonly scopes: readonly string[];
678
+ readonly expires_in_days?: number | undefined;
679
+ }, never, {
680
+ readonly id: string & effect_Brand.Brand<"TokenId">;
681
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
682
+ readonly name: string & effect_Brand.Brand<"NonEmptyString">;
683
+ readonly scopes: readonly string[];
684
+ readonly last_used_at: (string & effect_Brand.Brand<"Timestamp">) | null;
685
+ readonly expires_at: (string & effect_Brand.Brand<"Timestamp">) | null;
686
+ readonly token: string;
687
+ }, AuthenticationError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, never, never, never, readonly {
688
+ readonly id: string & effect_Brand.Brand<"TokenId">;
689
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
690
+ readonly name: string & effect_Brand.Brand<"NonEmptyString">;
691
+ readonly scopes: readonly string[];
692
+ readonly last_used_at: (string & effect_Brand.Brand<"Timestamp">) | null;
693
+ readonly expires_at: (string & effect_Brand.Brand<"Timestamp">) | null;
694
+ }[], AuthenticationError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"delete", "DELETE", {
695
+ readonly id: string & effect_Brand.Brand<"TokenId">;
696
+ }, never, never, never, null, AuthenticationError | NotFoundError | InternalServerError, never, never>, IndustrialError | AuthenticationError, UserSecurity, false> | HttpApiGroup.HttpApiGroup<"projects", HttpApiEndpoint.HttpApiEndpoint<"list", "GET", never, never, never, never, readonly {
697
+ readonly id: string & effect_Brand.Brand<"ProjectId">;
698
+ readonly created_at: string & effect_Brand.Brand<"Timestamp">;
699
+ readonly name: string & effect_Brand.Brand<"NonEmptyString">;
700
+ readonly api_key_secret: string;
701
+ }[], AuthenticationError | InternalServerError, never, never>, IndustrialError | AuthenticationError, SecurityMiddleware, false> | HttpApiGroup.HttpApiGroup<"callbacks", HttpApiEndpoint.HttpApiEndpoint<"handle", "GET", {
702
+ readonly provider: string;
703
+ }, {
704
+ readonly data?: string | undefined;
705
+ readonly payment_id?: string | undefined;
706
+ readonly pidx?: string | undefined;
707
+ }, never, never, any, IndustrialError | NotFoundError | InternalServerError, never, never>, never, never, false> | HttpApiGroup.HttpApiGroup<"realtime", HttpApiEndpoint.HttpApiEndpoint<"connect", "GET", never, {
708
+ readonly token: string;
709
+ }, never, never, any, AuthenticationError | InternalServerError, never, never> | HttpApiEndpoint.HttpApiEndpoint<"trigger", "POST", never, {
710
+ readonly token?: string | undefined;
711
+ }, {
712
+ readonly data?: any;
713
+ readonly event?: "payment.success" | "payment.failed" | "subscription.created" | "subscription.payment_succeeded" | "subscription.payment_failed" | "subscription.renewal_due" | "subscription.canceled" | undefined;
714
+ }, never, {
715
+ readonly status: string;
716
+ readonly event?: string | undefined;
717
+ }, AuthenticationError | InternalServerError, never, never>, never, never, false>, IndustrialError | AuthenticationError | NotFoundError | InternalServerError | ConflictError | _effect_platform_HttpApiError.HttpApiDecodeError, never>;
718
+
719
+ export { AuthContext, AuthenticationError, AutomationGroup, CallbacksGroup, CheckoutGroup, ConflictError, CronSecurity, CustomersGroup, IndustrialError, InternalServerError, NotFoundError, PayArkApi, PaymentsGroup, ProjectsGroup, RealtimeGroup, SecurityMiddleware, SubscriptionsGroup, TokensGroup, UserSecurity };