@erxes/core-contract 0.1.0-v2.0 → 0.1.0-v2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/activities.d.ts +1394 -139
  2. package/dist/activities.js +96 -40
  3. package/dist/audit.d.ts +1092 -48
  4. package/dist/audit.js +37 -23
  5. package/dist/auth.d.ts +2867 -61
  6. package/dist/auth.js +55 -25
  7. package/dist/automationRuns.d.ts +12 -13
  8. package/dist/automationRuns.js +15 -30
  9. package/dist/automations.d.ts +2474 -93
  10. package/dist/automations.js +56 -44
  11. package/dist/client.d.ts +30704 -0
  12. package/dist/client.js +62 -0
  13. package/dist/common.d.ts +28 -16
  14. package/dist/common.js +30 -22
  15. package/dist/companies.d.ts +1154 -44
  16. package/dist/companies.js +33 -17
  17. package/dist/contract/routes.json.js +1810 -0
  18. package/dist/customerAuth.d.ts +1661 -0
  19. package/dist/customerAuth.js +197 -0
  20. package/dist/customers.d.ts +1283 -65
  21. package/dist/customers.js +35 -25
  22. package/dist/{automationDefinition.d.ts → db/src/automationDefinition.d.ts} +4 -3
  23. package/dist/{automationDefinition.js → db/src/automationDefinition.js} +10 -32
  24. package/dist/db/src/enums.d.ts +8 -0
  25. package/dist/db/src/enums.js +334 -0
  26. package/dist/db/src/schema/auditStreams.js +6 -14
  27. package/dist/db/src/schema/authTokens.js +4 -6
  28. package/dist/db/src/schema/automations.d.ts +1 -0
  29. package/dist/db/src/schema/automations.js +15 -31
  30. package/dist/db/src/schema/common.d.ts +2 -6
  31. package/dist/db/src/schema/common.js +1 -24
  32. package/dist/db/src/schema/companies.js +6 -5
  33. package/dist/db/src/schema/customerAuth.js +101 -0
  34. package/dist/db/src/schema/customers.js +6 -6
  35. package/dist/db/src/schema/events.js +12 -60
  36. package/dist/db/src/schema/fieldValues.js +2 -2
  37. package/dist/db/src/schema/fields.js +10 -28
  38. package/dist/db/src/schema/index.d.ts +3 -0
  39. package/dist/db/src/schema/index.js +22 -20
  40. package/dist/db/src/schema/leadStages.js +5 -10
  41. package/dist/db/src/schema/leads.js +6 -11
  42. package/dist/db/src/schema/notes.js +92 -0
  43. package/dist/db/src/schema/oauth.js +3 -3
  44. package/dist/db/src/schema/payments.js +13 -23
  45. package/dist/db/src/schema/platform.js +11 -31
  46. package/dist/db/src/schema/plugins.js +10 -5
  47. package/dist/db/src/schema/products.js +7 -8
  48. package/dist/db/src/schema/rateLimits.js +7 -0
  49. package/dist/db/src/schema/saas.js +3 -9
  50. package/dist/db/src/schema/tags.js +6 -5
  51. package/dist/db/src/schema/transfer.js +13 -33
  52. package/dist/db/src/schema/trash.js +6 -7
  53. package/dist/db/src/schema/users.js +6 -10
  54. package/dist/db/src/schema/views.js +5 -13
  55. package/dist/db/src/schema/webhooks.js +7 -14
  56. package/dist/db/src/table.js +16 -2
  57. package/dist/errors.d.ts +516 -0
  58. package/dist/errors.js +218 -0
  59. package/dist/events.d.ts +585 -140
  60. package/dist/events.js +57 -42
  61. package/dist/fields.d.ts +1478 -66
  62. package/dist/fields.js +33 -47
  63. package/dist/files.d.ts +766 -62
  64. package/dist/files.js +34 -22
  65. package/dist/index.d.ts +25707 -902
  66. package/dist/index.js +22 -20
  67. package/dist/leads.d.ts +1108 -22
  68. package/dist/leads.js +39 -20
  69. package/dist/notifications.d.ts +691 -94
  70. package/dist/notifications.js +45 -91
  71. package/dist/organizations.d.ts +263 -5
  72. package/dist/organizations.js +21 -2
  73. package/dist/payments.d.ts +1794 -120
  74. package/dist/payments.js +58 -60
  75. package/dist/platform.d.ts +12 -20
  76. package/dist/platform.js +8 -21
  77. package/dist/plugins.d.ts +808 -71
  78. package/dist/plugins.js +66 -35
  79. package/dist/products.d.ts +1411 -53
  80. package/dist/products.js +40 -23
  81. package/dist/roles.d.ts +560 -8
  82. package/dist/roles.js +25 -11
  83. package/dist/routes.d.ts +8 -0
  84. package/dist/routes.js +13 -0
  85. package/dist/saas.d.ts +164 -8
  86. package/dist/saas.js +14 -29
  87. package/dist/tags.d.ts +344 -8
  88. package/dist/tags.js +16 -8
  89. package/dist/transfer.d.ts +1361 -36
  90. package/dist/transfer.js +47 -49
  91. package/dist/trash.d.ts +299 -23
  92. package/dist/trash.js +27 -20
  93. package/dist/users.d.ts +1233 -59
  94. package/dist/users.js +48 -39
  95. package/dist/values.d.ts +150 -0
  96. package/dist/values.js +139 -0
  97. package/dist/views.d.ts +404 -13
  98. package/dist/views.js +18 -28
  99. package/dist/webhooks.d.ts +791 -29
  100. package/dist/webhooks.js +36 -21
  101. package/package.json +9 -2
  102. package/dist/db/src/schema/jobs.js +0 -44
@@ -1,26 +1,4 @@
1
1
  import { z } from "zod";
2
- /**
3
- * The gateways core can connect, and where each works: the currencies it
4
- * takes and the countries it serves (empty: any). QPay is Mongolian; global
5
- * ones (Stripe …) join here as drivers in `@erxes/payment-gateways`.
6
- */
7
- export declare const PAYMENT_GATEWAYS: {
8
- readonly qpay: {
9
- readonly currencies: ["MNT"];
10
- readonly countries: ["MN"];
11
- };
12
- readonly test: {
13
- readonly currencies: [];
14
- readonly countries: [];
15
- };
16
- };
17
- export declare const PaymentGatewayKind: z.ZodEnum<{
18
- qpay: "qpay";
19
- test: "test";
20
- }>;
21
- export type PaymentGatewayKind = z.infer<typeof PaymentGatewayKind>;
22
- /** Does this kind of gateway take this currency? */
23
- export declare const gatewayTakes: (kind: PaymentGatewayKind, currency: string) => boolean;
24
2
  /** What each gateway needs (secrets are write-only: never returned). */
25
3
  export declare const GatewayConfig: z.ZodDiscriminatedUnion<[z.ZodObject<{
26
4
  kind: z.ZodLiteral<"qpay">;
@@ -43,21 +21,13 @@ export declare const PaymentGateway: z.ZodObject<{
43
21
  active: "active";
44
22
  disabled: "disabled";
45
23
  }>;
46
- createdAt: z.ZodISODateTime;
24
+ createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
47
25
  settings: z.ZodRecord<z.ZodString, z.ZodUnknown>;
48
26
  }, {
49
27
  out: {};
50
28
  in: {};
51
29
  }>;
52
30
  export type PaymentGateway = z.infer<typeof PaymentGateway>;
53
- export declare const InvoiceStatus: z.ZodEnum<{
54
- cancelled: "cancelled";
55
- expired: "expired";
56
- failed: "failed";
57
- paid: "paid";
58
- pending: "pending";
59
- refunded: "refunded";
60
- }>;
61
31
  /** The caller's own data on an invoice (order lines, room number): at most 8 KB of JSON, returned in events. */
62
32
  export declare const InvoiceMetadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
63
33
  /**
@@ -86,6 +56,8 @@ export declare const Invoice: z.ZodObject<{
86
56
  id: z.ZodString;
87
57
  gatewayId: z.ZodString;
88
58
  source: z.ZodString;
59
+ referenceType: z.ZodString;
60
+ referenceId: z.ZodString;
89
61
  amount: z.ZodInt;
90
62
  currency: z.ZodString;
91
63
  description: z.ZodString;
@@ -118,17 +90,13 @@ export declare const Invoice: z.ZodObject<{
118
90
  }, z.core.$strip>>;
119
91
  paidAmount: z.ZodNullable<z.ZodInt>;
120
92
  refundedAmount: z.ZodInt;
121
- expiresAt: z.ZodISODateTime;
122
- paidAt: z.ZodNullable<z.ZodISODateTime>;
123
- createdAt: z.ZodISODateTime;
93
+ expiresAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
94
+ paidAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
95
+ createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
124
96
  gatewayKind: z.ZodEnum<{
125
97
  qpay: "qpay";
126
98
  test: "test";
127
99
  }>;
128
- reference: z.ZodObject<{
129
- type: z.ZodString;
130
- id: z.ZodString;
131
- }, z.core.$strip>;
132
100
  refundable: z.ZodObject<{
133
101
  amount: z.ZodInt;
134
102
  gateway: z.ZodEnum<{
@@ -156,11 +124,14 @@ export declare const Refund: z.ZodObject<{
156
124
  succeeded: "succeeded";
157
125
  }>;
158
126
  error: z.ZodNullable<z.ZodString>;
159
- createdAt: z.ZodISODateTime;
160
- requestedBy: z.ZodObject<{
161
- type: z.ZodString;
162
- id: z.ZodNullable<z.ZodString>;
163
- }, z.core.$strip>;
127
+ requestedByType: z.ZodEnum<{
128
+ customer: "customer";
129
+ plugin: "plugin";
130
+ system: "system";
131
+ user: "user";
132
+ }>;
133
+ requestedBy: z.ZodNullable<z.ZodString>;
134
+ createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
164
135
  }, {
165
136
  out: {};
166
137
  in: {};
@@ -177,11 +148,6 @@ export declare const PluginPaymentSettings: z.ZodObject<{
177
148
  in: {};
178
149
  }>;
179
150
  export type PluginPaymentSettings = z.infer<typeof PluginPaymentSettings>;
180
- /**
181
- * Payments: an organisation's gateway connections (QPay, …) and invoices
182
- * made through them for plugins' records. Paid invoices publish
183
- * `core.payment.paid` (webhooks, automations, the plugin's own consumer).
184
- */
185
151
  export declare const paymentsContract: {
186
152
  gateways: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
187
153
  data: z.ZodArray<z.ZodObject<{
@@ -195,13 +161,145 @@ export declare const paymentsContract: {
195
161
  active: "active";
196
162
  disabled: "disabled";
197
163
  }>;
198
- createdAt: z.ZodISODateTime;
164
+ createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
199
165
  settings: z.ZodRecord<z.ZodString, z.ZodUnknown>;
200
166
  }, {
201
167
  out: {};
202
168
  in: {};
203
169
  }>>;
204
- }, z.core.$strip>, Record<never, never>, Record<never, never>>;
170
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
171
+ UNAUTHORIZED: {
172
+ status: number;
173
+ };
174
+ NOT_ALLOWED: {
175
+ status: number;
176
+ data: z.ZodOptional<z.ZodObject<{
177
+ permission: z.ZodString;
178
+ }, z.core.$strip>>;
179
+ };
180
+ PLUGIN_ONLY: {
181
+ status: number;
182
+ };
183
+ MEMBERS_ONLY: {
184
+ status: number;
185
+ };
186
+ ORG_REQUIRED: {
187
+ status: number;
188
+ };
189
+ SCOPE_REQUIRED: {
190
+ status: number;
191
+ };
192
+ SERVICE_TOKEN_REQUIRED: {
193
+ status: number;
194
+ };
195
+ ORGANIZATION_DISABLED: {
196
+ status: number;
197
+ data: z.ZodObject<{
198
+ manageUrl: z.ZodNullable<z.ZodString>;
199
+ }, z.core.$strip>;
200
+ };
201
+ NOT_IN_PLAN: {
202
+ status: number;
203
+ data: z.ZodOptional<z.ZodObject<{
204
+ manageUrl: z.ZodNullable<z.ZodString>;
205
+ }, z.core.$strip>>;
206
+ };
207
+ READ_ONLY: {
208
+ status: number;
209
+ };
210
+ TOO_MANY_REQUESTS: {
211
+ status: number;
212
+ };
213
+ INVALID_INPUT: {
214
+ status: number;
215
+ data: z.ZodObject<{
216
+ issues: z.ZodArray<z.ZodObject<{
217
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
218
+ message: z.ZodString;
219
+ }, z.core.$strip>>;
220
+ }, z.core.$strip>;
221
+ };
222
+ NOT_FOUND: {
223
+ status: number;
224
+ };
225
+ TAKEN: {
226
+ status: number;
227
+ data: z.ZodObject<{
228
+ field: z.ZodString;
229
+ id: z.ZodOptional<z.ZodString>;
230
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
231
+ }, z.core.$strip>;
232
+ };
233
+ INVALID_CURSOR: {
234
+ status: number;
235
+ };
236
+ INVALID_REFERENCE: {
237
+ status: number;
238
+ data: z.ZodObject<{
239
+ field: z.ZodString;
240
+ }, z.core.$strip>;
241
+ };
242
+ INVALID_FILTER: {
243
+ status: number;
244
+ };
245
+ FILTER_TOO_SLOW: {
246
+ status: number;
247
+ };
248
+ CURRENCY_NOT_SUPPORTED: {
249
+ status: number;
250
+ data: z.ZodObject<{
251
+ currency: z.ZodString;
252
+ }, z.core.$strip>;
253
+ };
254
+ DEFAULT_NOT_ALLOWED: {
255
+ status: number;
256
+ };
257
+ GATEWAY_IN_USE: {
258
+ status: number;
259
+ };
260
+ GATEWAY_NOT_ALLOWED: {
261
+ status: number;
262
+ };
263
+ GATEWAY_REFUSED: {
264
+ status: number;
265
+ };
266
+ INVALID_PRODUCT: {
267
+ status: number;
268
+ };
269
+ INVALID_SUBDOMAIN: {
270
+ status: number;
271
+ };
272
+ KIND_CHANGED: {
273
+ status: number;
274
+ };
275
+ LIMIT_EXCEEDED: {
276
+ status: number;
277
+ };
278
+ LINES_MISMATCH: {
279
+ status: number;
280
+ };
281
+ NOTHING_TO_RETRY: {
282
+ status: number;
283
+ };
284
+ NOT_PENDING: {
285
+ status: number;
286
+ };
287
+ NOT_REFUNDABLE: {
288
+ status: number;
289
+ };
290
+ NOT_TEST: {
291
+ status: number;
292
+ };
293
+ NO_GATEWAY: {
294
+ status: number;
295
+ };
296
+ PARTIAL_NOT_SUPPORTED: {
297
+ status: number;
298
+ };
299
+ SUBJECT_REQUIRED: {
300
+ status: number;
301
+ };
302
+ }>, Record<never, never>>;
205
303
  addGateway: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
206
304
  name: z.ZodString;
207
305
  config: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -224,12 +322,144 @@ export declare const paymentsContract: {
224
322
  active: "active";
225
323
  disabled: "disabled";
226
324
  }>;
227
- createdAt: z.ZodISODateTime;
325
+ createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
228
326
  settings: z.ZodRecord<z.ZodString, z.ZodUnknown>;
229
327
  }, {
230
328
  out: {};
231
329
  in: {};
232
- }>, Record<never, never>, Record<never, never>>;
330
+ }>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
331
+ UNAUTHORIZED: {
332
+ status: number;
333
+ };
334
+ NOT_ALLOWED: {
335
+ status: number;
336
+ data: z.ZodOptional<z.ZodObject<{
337
+ permission: z.ZodString;
338
+ }, z.core.$strip>>;
339
+ };
340
+ PLUGIN_ONLY: {
341
+ status: number;
342
+ };
343
+ MEMBERS_ONLY: {
344
+ status: number;
345
+ };
346
+ ORG_REQUIRED: {
347
+ status: number;
348
+ };
349
+ SCOPE_REQUIRED: {
350
+ status: number;
351
+ };
352
+ SERVICE_TOKEN_REQUIRED: {
353
+ status: number;
354
+ };
355
+ ORGANIZATION_DISABLED: {
356
+ status: number;
357
+ data: z.ZodObject<{
358
+ manageUrl: z.ZodNullable<z.ZodString>;
359
+ }, z.core.$strip>;
360
+ };
361
+ NOT_IN_PLAN: {
362
+ status: number;
363
+ data: z.ZodOptional<z.ZodObject<{
364
+ manageUrl: z.ZodNullable<z.ZodString>;
365
+ }, z.core.$strip>>;
366
+ };
367
+ READ_ONLY: {
368
+ status: number;
369
+ };
370
+ TOO_MANY_REQUESTS: {
371
+ status: number;
372
+ };
373
+ INVALID_INPUT: {
374
+ status: number;
375
+ data: z.ZodObject<{
376
+ issues: z.ZodArray<z.ZodObject<{
377
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
378
+ message: z.ZodString;
379
+ }, z.core.$strip>>;
380
+ }, z.core.$strip>;
381
+ };
382
+ NOT_FOUND: {
383
+ status: number;
384
+ };
385
+ TAKEN: {
386
+ status: number;
387
+ data: z.ZodObject<{
388
+ field: z.ZodString;
389
+ id: z.ZodOptional<z.ZodString>;
390
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
391
+ }, z.core.$strip>;
392
+ };
393
+ INVALID_CURSOR: {
394
+ status: number;
395
+ };
396
+ INVALID_REFERENCE: {
397
+ status: number;
398
+ data: z.ZodObject<{
399
+ field: z.ZodString;
400
+ }, z.core.$strip>;
401
+ };
402
+ INVALID_FILTER: {
403
+ status: number;
404
+ };
405
+ FILTER_TOO_SLOW: {
406
+ status: number;
407
+ };
408
+ CURRENCY_NOT_SUPPORTED: {
409
+ status: number;
410
+ data: z.ZodObject<{
411
+ currency: z.ZodString;
412
+ }, z.core.$strip>;
413
+ };
414
+ DEFAULT_NOT_ALLOWED: {
415
+ status: number;
416
+ };
417
+ GATEWAY_IN_USE: {
418
+ status: number;
419
+ };
420
+ GATEWAY_NOT_ALLOWED: {
421
+ status: number;
422
+ };
423
+ GATEWAY_REFUSED: {
424
+ status: number;
425
+ };
426
+ INVALID_PRODUCT: {
427
+ status: number;
428
+ };
429
+ INVALID_SUBDOMAIN: {
430
+ status: number;
431
+ };
432
+ KIND_CHANGED: {
433
+ status: number;
434
+ };
435
+ LIMIT_EXCEEDED: {
436
+ status: number;
437
+ };
438
+ LINES_MISMATCH: {
439
+ status: number;
440
+ };
441
+ NOTHING_TO_RETRY: {
442
+ status: number;
443
+ };
444
+ NOT_PENDING: {
445
+ status: number;
446
+ };
447
+ NOT_REFUNDABLE: {
448
+ status: number;
449
+ };
450
+ NOT_TEST: {
451
+ status: number;
452
+ };
453
+ NO_GATEWAY: {
454
+ status: number;
455
+ };
456
+ PARTIAL_NOT_SUPPORTED: {
457
+ status: number;
458
+ };
459
+ SUBJECT_REQUIRED: {
460
+ status: number;
461
+ };
462
+ }>, Record<never, never>>;
233
463
  updateGateway: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
234
464
  id: z.ZodString;
235
465
  name: z.ZodOptional<z.ZodString>;
@@ -257,26 +487,288 @@ export declare const paymentsContract: {
257
487
  active: "active";
258
488
  disabled: "disabled";
259
489
  }>;
260
- createdAt: z.ZodISODateTime;
490
+ createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
261
491
  settings: z.ZodRecord<z.ZodString, z.ZodUnknown>;
262
492
  }, {
263
493
  out: {};
264
494
  in: {};
265
- }>, Record<never, never>, Record<never, never>>;
495
+ }>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
496
+ UNAUTHORIZED: {
497
+ status: number;
498
+ };
499
+ NOT_ALLOWED: {
500
+ status: number;
501
+ data: z.ZodOptional<z.ZodObject<{
502
+ permission: z.ZodString;
503
+ }, z.core.$strip>>;
504
+ };
505
+ PLUGIN_ONLY: {
506
+ status: number;
507
+ };
508
+ MEMBERS_ONLY: {
509
+ status: number;
510
+ };
511
+ ORG_REQUIRED: {
512
+ status: number;
513
+ };
514
+ SCOPE_REQUIRED: {
515
+ status: number;
516
+ };
517
+ SERVICE_TOKEN_REQUIRED: {
518
+ status: number;
519
+ };
520
+ ORGANIZATION_DISABLED: {
521
+ status: number;
522
+ data: z.ZodObject<{
523
+ manageUrl: z.ZodNullable<z.ZodString>;
524
+ }, z.core.$strip>;
525
+ };
526
+ NOT_IN_PLAN: {
527
+ status: number;
528
+ data: z.ZodOptional<z.ZodObject<{
529
+ manageUrl: z.ZodNullable<z.ZodString>;
530
+ }, z.core.$strip>>;
531
+ };
532
+ READ_ONLY: {
533
+ status: number;
534
+ };
535
+ TOO_MANY_REQUESTS: {
536
+ status: number;
537
+ };
538
+ INVALID_INPUT: {
539
+ status: number;
540
+ data: z.ZodObject<{
541
+ issues: z.ZodArray<z.ZodObject<{
542
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
543
+ message: z.ZodString;
544
+ }, z.core.$strip>>;
545
+ }, z.core.$strip>;
546
+ };
547
+ NOT_FOUND: {
548
+ status: number;
549
+ };
550
+ TAKEN: {
551
+ status: number;
552
+ data: z.ZodObject<{
553
+ field: z.ZodString;
554
+ id: z.ZodOptional<z.ZodString>;
555
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
556
+ }, z.core.$strip>;
557
+ };
558
+ INVALID_CURSOR: {
559
+ status: number;
560
+ };
561
+ INVALID_REFERENCE: {
562
+ status: number;
563
+ data: z.ZodObject<{
564
+ field: z.ZodString;
565
+ }, z.core.$strip>;
566
+ };
567
+ INVALID_FILTER: {
568
+ status: number;
569
+ };
570
+ FILTER_TOO_SLOW: {
571
+ status: number;
572
+ };
573
+ CURRENCY_NOT_SUPPORTED: {
574
+ status: number;
575
+ data: z.ZodObject<{
576
+ currency: z.ZodString;
577
+ }, z.core.$strip>;
578
+ };
579
+ DEFAULT_NOT_ALLOWED: {
580
+ status: number;
581
+ };
582
+ GATEWAY_IN_USE: {
583
+ status: number;
584
+ };
585
+ GATEWAY_NOT_ALLOWED: {
586
+ status: number;
587
+ };
588
+ GATEWAY_REFUSED: {
589
+ status: number;
590
+ };
591
+ INVALID_PRODUCT: {
592
+ status: number;
593
+ };
594
+ INVALID_SUBDOMAIN: {
595
+ status: number;
596
+ };
597
+ KIND_CHANGED: {
598
+ status: number;
599
+ };
600
+ LIMIT_EXCEEDED: {
601
+ status: number;
602
+ };
603
+ LINES_MISMATCH: {
604
+ status: number;
605
+ };
606
+ NOTHING_TO_RETRY: {
607
+ status: number;
608
+ };
609
+ NOT_PENDING: {
610
+ status: number;
611
+ };
612
+ NOT_REFUNDABLE: {
613
+ status: number;
614
+ };
615
+ NOT_TEST: {
616
+ status: number;
617
+ };
618
+ NO_GATEWAY: {
619
+ status: number;
620
+ };
621
+ PARTIAL_NOT_SUPPORTED: {
622
+ status: number;
623
+ };
624
+ SUBJECT_REQUIRED: {
625
+ status: number;
626
+ };
627
+ }>, Record<never, never>>;
266
628
  removeGateway: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
267
629
  id: z.ZodString;
268
630
  }, z.core.$strip>, z.ZodObject<{
269
631
  ok: z.ZodLiteral<true>;
270
- }, z.core.$strip>, Record<never, never>, Record<never, never>>;
632
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
633
+ UNAUTHORIZED: {
634
+ status: number;
635
+ };
636
+ NOT_ALLOWED: {
637
+ status: number;
638
+ data: z.ZodOptional<z.ZodObject<{
639
+ permission: z.ZodString;
640
+ }, z.core.$strip>>;
641
+ };
642
+ PLUGIN_ONLY: {
643
+ status: number;
644
+ };
645
+ MEMBERS_ONLY: {
646
+ status: number;
647
+ };
648
+ ORG_REQUIRED: {
649
+ status: number;
650
+ };
651
+ SCOPE_REQUIRED: {
652
+ status: number;
653
+ };
654
+ SERVICE_TOKEN_REQUIRED: {
655
+ status: number;
656
+ };
657
+ ORGANIZATION_DISABLED: {
658
+ status: number;
659
+ data: z.ZodObject<{
660
+ manageUrl: z.ZodNullable<z.ZodString>;
661
+ }, z.core.$strip>;
662
+ };
663
+ NOT_IN_PLAN: {
664
+ status: number;
665
+ data: z.ZodOptional<z.ZodObject<{
666
+ manageUrl: z.ZodNullable<z.ZodString>;
667
+ }, z.core.$strip>>;
668
+ };
669
+ READ_ONLY: {
670
+ status: number;
671
+ };
672
+ TOO_MANY_REQUESTS: {
673
+ status: number;
674
+ };
675
+ INVALID_INPUT: {
676
+ status: number;
677
+ data: z.ZodObject<{
678
+ issues: z.ZodArray<z.ZodObject<{
679
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
680
+ message: z.ZodString;
681
+ }, z.core.$strip>>;
682
+ }, z.core.$strip>;
683
+ };
684
+ NOT_FOUND: {
685
+ status: number;
686
+ };
687
+ TAKEN: {
688
+ status: number;
689
+ data: z.ZodObject<{
690
+ field: z.ZodString;
691
+ id: z.ZodOptional<z.ZodString>;
692
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
693
+ }, z.core.$strip>;
694
+ };
695
+ INVALID_CURSOR: {
696
+ status: number;
697
+ };
698
+ INVALID_REFERENCE: {
699
+ status: number;
700
+ data: z.ZodObject<{
701
+ field: z.ZodString;
702
+ }, z.core.$strip>;
703
+ };
704
+ INVALID_FILTER: {
705
+ status: number;
706
+ };
707
+ FILTER_TOO_SLOW: {
708
+ status: number;
709
+ };
710
+ CURRENCY_NOT_SUPPORTED: {
711
+ status: number;
712
+ data: z.ZodObject<{
713
+ currency: z.ZodString;
714
+ }, z.core.$strip>;
715
+ };
716
+ DEFAULT_NOT_ALLOWED: {
717
+ status: number;
718
+ };
719
+ GATEWAY_IN_USE: {
720
+ status: number;
721
+ };
722
+ GATEWAY_NOT_ALLOWED: {
723
+ status: number;
724
+ };
725
+ GATEWAY_REFUSED: {
726
+ status: number;
727
+ };
728
+ INVALID_PRODUCT: {
729
+ status: number;
730
+ };
731
+ INVALID_SUBDOMAIN: {
732
+ status: number;
733
+ };
734
+ KIND_CHANGED: {
735
+ status: number;
736
+ };
737
+ LIMIT_EXCEEDED: {
738
+ status: number;
739
+ };
740
+ LINES_MISMATCH: {
741
+ status: number;
742
+ };
743
+ NOTHING_TO_RETRY: {
744
+ status: number;
745
+ };
746
+ NOT_PENDING: {
747
+ status: number;
748
+ };
749
+ NOT_REFUNDABLE: {
750
+ status: number;
751
+ };
752
+ NOT_TEST: {
753
+ status: number;
754
+ };
755
+ NO_GATEWAY: {
756
+ status: number;
757
+ };
758
+ PARTIAL_NOT_SUPPORTED: {
759
+ status: number;
760
+ };
761
+ SUBJECT_REQUIRED: {
762
+ status: number;
763
+ };
764
+ }>, Record<never, never>>;
271
765
  createInvoice: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
272
766
  gatewayId: z.ZodOptional<z.ZodString>;
273
767
  amount: z.ZodInt;
274
768
  currency: z.ZodOptional<z.ZodString>;
275
769
  description: z.ZodString;
276
- reference: z.ZodObject<{
277
- type: z.ZodString;
278
- id: z.ZodString;
279
- }, z.core.$strip>;
770
+ referenceType: z.ZodString;
771
+ referenceId: z.ZodString;
280
772
  expiresInMinutes: z.ZodDefault<z.ZodInt>;
281
773
  dedupeKey: z.ZodOptional<z.ZodString>;
282
774
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -291,6 +783,8 @@ export declare const paymentsContract: {
291
783
  id: z.ZodString;
292
784
  gatewayId: z.ZodString;
293
785
  source: z.ZodString;
786
+ referenceType: z.ZodString;
787
+ referenceId: z.ZodString;
294
788
  amount: z.ZodInt;
295
789
  currency: z.ZodString;
296
790
  description: z.ZodString;
@@ -323,17 +817,13 @@ export declare const paymentsContract: {
323
817
  }, z.core.$strip>>;
324
818
  paidAmount: z.ZodNullable<z.ZodInt>;
325
819
  refundedAmount: z.ZodInt;
326
- expiresAt: z.ZodISODateTime;
327
- paidAt: z.ZodNullable<z.ZodISODateTime>;
328
- createdAt: z.ZodISODateTime;
820
+ expiresAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
821
+ paidAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
822
+ createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
329
823
  gatewayKind: z.ZodEnum<{
330
824
  qpay: "qpay";
331
825
  test: "test";
332
826
  }>;
333
- reference: z.ZodObject<{
334
- type: z.ZodString;
335
- id: z.ZodString;
336
- }, z.core.$strip>;
337
827
  refundable: z.ZodObject<{
338
828
  amount: z.ZodInt;
339
829
  gateway: z.ZodEnum<{
@@ -345,13 +835,147 @@ export declare const paymentsContract: {
345
835
  }, {
346
836
  out: {};
347
837
  in: {};
348
- }>, Record<never, never>, Record<never, never>>;
838
+ }>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
839
+ UNAUTHORIZED: {
840
+ status: number;
841
+ };
842
+ NOT_ALLOWED: {
843
+ status: number;
844
+ data: z.ZodOptional<z.ZodObject<{
845
+ permission: z.ZodString;
846
+ }, z.core.$strip>>;
847
+ };
848
+ PLUGIN_ONLY: {
849
+ status: number;
850
+ };
851
+ MEMBERS_ONLY: {
852
+ status: number;
853
+ };
854
+ ORG_REQUIRED: {
855
+ status: number;
856
+ };
857
+ SCOPE_REQUIRED: {
858
+ status: number;
859
+ };
860
+ SERVICE_TOKEN_REQUIRED: {
861
+ status: number;
862
+ };
863
+ ORGANIZATION_DISABLED: {
864
+ status: number;
865
+ data: z.ZodObject<{
866
+ manageUrl: z.ZodNullable<z.ZodString>;
867
+ }, z.core.$strip>;
868
+ };
869
+ NOT_IN_PLAN: {
870
+ status: number;
871
+ data: z.ZodOptional<z.ZodObject<{
872
+ manageUrl: z.ZodNullable<z.ZodString>;
873
+ }, z.core.$strip>>;
874
+ };
875
+ READ_ONLY: {
876
+ status: number;
877
+ };
878
+ TOO_MANY_REQUESTS: {
879
+ status: number;
880
+ };
881
+ INVALID_INPUT: {
882
+ status: number;
883
+ data: z.ZodObject<{
884
+ issues: z.ZodArray<z.ZodObject<{
885
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
886
+ message: z.ZodString;
887
+ }, z.core.$strip>>;
888
+ }, z.core.$strip>;
889
+ };
890
+ NOT_FOUND: {
891
+ status: number;
892
+ };
893
+ TAKEN: {
894
+ status: number;
895
+ data: z.ZodObject<{
896
+ field: z.ZodString;
897
+ id: z.ZodOptional<z.ZodString>;
898
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
899
+ }, z.core.$strip>;
900
+ };
901
+ INVALID_CURSOR: {
902
+ status: number;
903
+ };
904
+ INVALID_REFERENCE: {
905
+ status: number;
906
+ data: z.ZodObject<{
907
+ field: z.ZodString;
908
+ }, z.core.$strip>;
909
+ };
910
+ INVALID_FILTER: {
911
+ status: number;
912
+ };
913
+ FILTER_TOO_SLOW: {
914
+ status: number;
915
+ };
916
+ CURRENCY_NOT_SUPPORTED: {
917
+ status: number;
918
+ data: z.ZodObject<{
919
+ currency: z.ZodString;
920
+ }, z.core.$strip>;
921
+ };
922
+ DEFAULT_NOT_ALLOWED: {
923
+ status: number;
924
+ };
925
+ GATEWAY_IN_USE: {
926
+ status: number;
927
+ };
928
+ GATEWAY_NOT_ALLOWED: {
929
+ status: number;
930
+ };
931
+ GATEWAY_REFUSED: {
932
+ status: number;
933
+ };
934
+ INVALID_PRODUCT: {
935
+ status: number;
936
+ };
937
+ INVALID_SUBDOMAIN: {
938
+ status: number;
939
+ };
940
+ KIND_CHANGED: {
941
+ status: number;
942
+ };
943
+ LIMIT_EXCEEDED: {
944
+ status: number;
945
+ };
946
+ LINES_MISMATCH: {
947
+ status: number;
948
+ };
949
+ NOTHING_TO_RETRY: {
950
+ status: number;
951
+ };
952
+ NOT_PENDING: {
953
+ status: number;
954
+ };
955
+ NOT_REFUNDABLE: {
956
+ status: number;
957
+ };
958
+ NOT_TEST: {
959
+ status: number;
960
+ };
961
+ NO_GATEWAY: {
962
+ status: number;
963
+ };
964
+ PARTIAL_NOT_SUPPORTED: {
965
+ status: number;
966
+ };
967
+ SUBJECT_REQUIRED: {
968
+ status: number;
969
+ };
970
+ }>, Record<never, never>>;
349
971
  getInvoice: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
350
972
  id: z.ZodString;
351
973
  }, z.core.$strip>, z.ZodObject<{
352
974
  id: z.ZodString;
353
975
  gatewayId: z.ZodString;
354
976
  source: z.ZodString;
977
+ referenceType: z.ZodString;
978
+ referenceId: z.ZodString;
355
979
  amount: z.ZodInt;
356
980
  currency: z.ZodString;
357
981
  description: z.ZodString;
@@ -384,17 +1008,13 @@ export declare const paymentsContract: {
384
1008
  }, z.core.$strip>>;
385
1009
  paidAmount: z.ZodNullable<z.ZodInt>;
386
1010
  refundedAmount: z.ZodInt;
387
- expiresAt: z.ZodISODateTime;
388
- paidAt: z.ZodNullable<z.ZodISODateTime>;
389
- createdAt: z.ZodISODateTime;
1011
+ expiresAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
1012
+ paidAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
1013
+ createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
390
1014
  gatewayKind: z.ZodEnum<{
391
1015
  qpay: "qpay";
392
1016
  test: "test";
393
1017
  }>;
394
- reference: z.ZodObject<{
395
- type: z.ZodString;
396
- id: z.ZodString;
397
- }, z.core.$strip>;
398
1018
  refundable: z.ZodObject<{
399
1019
  amount: z.ZodInt;
400
1020
  gateway: z.ZodEnum<{
@@ -406,13 +1026,147 @@ export declare const paymentsContract: {
406
1026
  }, {
407
1027
  out: {};
408
1028
  in: {};
409
- }>, Record<never, never>, Record<never, never>>;
1029
+ }>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
1030
+ UNAUTHORIZED: {
1031
+ status: number;
1032
+ };
1033
+ NOT_ALLOWED: {
1034
+ status: number;
1035
+ data: z.ZodOptional<z.ZodObject<{
1036
+ permission: z.ZodString;
1037
+ }, z.core.$strip>>;
1038
+ };
1039
+ PLUGIN_ONLY: {
1040
+ status: number;
1041
+ };
1042
+ MEMBERS_ONLY: {
1043
+ status: number;
1044
+ };
1045
+ ORG_REQUIRED: {
1046
+ status: number;
1047
+ };
1048
+ SCOPE_REQUIRED: {
1049
+ status: number;
1050
+ };
1051
+ SERVICE_TOKEN_REQUIRED: {
1052
+ status: number;
1053
+ };
1054
+ ORGANIZATION_DISABLED: {
1055
+ status: number;
1056
+ data: z.ZodObject<{
1057
+ manageUrl: z.ZodNullable<z.ZodString>;
1058
+ }, z.core.$strip>;
1059
+ };
1060
+ NOT_IN_PLAN: {
1061
+ status: number;
1062
+ data: z.ZodOptional<z.ZodObject<{
1063
+ manageUrl: z.ZodNullable<z.ZodString>;
1064
+ }, z.core.$strip>>;
1065
+ };
1066
+ READ_ONLY: {
1067
+ status: number;
1068
+ };
1069
+ TOO_MANY_REQUESTS: {
1070
+ status: number;
1071
+ };
1072
+ INVALID_INPUT: {
1073
+ status: number;
1074
+ data: z.ZodObject<{
1075
+ issues: z.ZodArray<z.ZodObject<{
1076
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
1077
+ message: z.ZodString;
1078
+ }, z.core.$strip>>;
1079
+ }, z.core.$strip>;
1080
+ };
1081
+ NOT_FOUND: {
1082
+ status: number;
1083
+ };
1084
+ TAKEN: {
1085
+ status: number;
1086
+ data: z.ZodObject<{
1087
+ field: z.ZodString;
1088
+ id: z.ZodOptional<z.ZodString>;
1089
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
1090
+ }, z.core.$strip>;
1091
+ };
1092
+ INVALID_CURSOR: {
1093
+ status: number;
1094
+ };
1095
+ INVALID_REFERENCE: {
1096
+ status: number;
1097
+ data: z.ZodObject<{
1098
+ field: z.ZodString;
1099
+ }, z.core.$strip>;
1100
+ };
1101
+ INVALID_FILTER: {
1102
+ status: number;
1103
+ };
1104
+ FILTER_TOO_SLOW: {
1105
+ status: number;
1106
+ };
1107
+ CURRENCY_NOT_SUPPORTED: {
1108
+ status: number;
1109
+ data: z.ZodObject<{
1110
+ currency: z.ZodString;
1111
+ }, z.core.$strip>;
1112
+ };
1113
+ DEFAULT_NOT_ALLOWED: {
1114
+ status: number;
1115
+ };
1116
+ GATEWAY_IN_USE: {
1117
+ status: number;
1118
+ };
1119
+ GATEWAY_NOT_ALLOWED: {
1120
+ status: number;
1121
+ };
1122
+ GATEWAY_REFUSED: {
1123
+ status: number;
1124
+ };
1125
+ INVALID_PRODUCT: {
1126
+ status: number;
1127
+ };
1128
+ INVALID_SUBDOMAIN: {
1129
+ status: number;
1130
+ };
1131
+ KIND_CHANGED: {
1132
+ status: number;
1133
+ };
1134
+ LIMIT_EXCEEDED: {
1135
+ status: number;
1136
+ };
1137
+ LINES_MISMATCH: {
1138
+ status: number;
1139
+ };
1140
+ NOTHING_TO_RETRY: {
1141
+ status: number;
1142
+ };
1143
+ NOT_PENDING: {
1144
+ status: number;
1145
+ };
1146
+ NOT_REFUNDABLE: {
1147
+ status: number;
1148
+ };
1149
+ NOT_TEST: {
1150
+ status: number;
1151
+ };
1152
+ NO_GATEWAY: {
1153
+ status: number;
1154
+ };
1155
+ PARTIAL_NOT_SUPPORTED: {
1156
+ status: number;
1157
+ };
1158
+ SUBJECT_REQUIRED: {
1159
+ status: number;
1160
+ };
1161
+ }>, Record<never, never>>;
410
1162
  cancelInvoice: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
411
1163
  id: z.ZodString;
412
1164
  }, z.core.$strip>, z.ZodObject<{
413
1165
  id: z.ZodString;
414
1166
  gatewayId: z.ZodString;
415
1167
  source: z.ZodString;
1168
+ referenceType: z.ZodString;
1169
+ referenceId: z.ZodString;
416
1170
  amount: z.ZodInt;
417
1171
  currency: z.ZodString;
418
1172
  description: z.ZodString;
@@ -445,17 +1199,13 @@ export declare const paymentsContract: {
445
1199
  }, z.core.$strip>>;
446
1200
  paidAmount: z.ZodNullable<z.ZodInt>;
447
1201
  refundedAmount: z.ZodInt;
448
- expiresAt: z.ZodISODateTime;
449
- paidAt: z.ZodNullable<z.ZodISODateTime>;
450
- createdAt: z.ZodISODateTime;
1202
+ expiresAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
1203
+ paidAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
1204
+ createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
451
1205
  gatewayKind: z.ZodEnum<{
452
1206
  qpay: "qpay";
453
1207
  test: "test";
454
1208
  }>;
455
- reference: z.ZodObject<{
456
- type: z.ZodString;
457
- id: z.ZodString;
458
- }, z.core.$strip>;
459
1209
  refundable: z.ZodObject<{
460
1210
  amount: z.ZodInt;
461
1211
  gateway: z.ZodEnum<{
@@ -467,7 +1217,139 @@ export declare const paymentsContract: {
467
1217
  }, {
468
1218
  out: {};
469
1219
  in: {};
470
- }>, Record<never, never>, Record<never, never>>;
1220
+ }>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
1221
+ UNAUTHORIZED: {
1222
+ status: number;
1223
+ };
1224
+ NOT_ALLOWED: {
1225
+ status: number;
1226
+ data: z.ZodOptional<z.ZodObject<{
1227
+ permission: z.ZodString;
1228
+ }, z.core.$strip>>;
1229
+ };
1230
+ PLUGIN_ONLY: {
1231
+ status: number;
1232
+ };
1233
+ MEMBERS_ONLY: {
1234
+ status: number;
1235
+ };
1236
+ ORG_REQUIRED: {
1237
+ status: number;
1238
+ };
1239
+ SCOPE_REQUIRED: {
1240
+ status: number;
1241
+ };
1242
+ SERVICE_TOKEN_REQUIRED: {
1243
+ status: number;
1244
+ };
1245
+ ORGANIZATION_DISABLED: {
1246
+ status: number;
1247
+ data: z.ZodObject<{
1248
+ manageUrl: z.ZodNullable<z.ZodString>;
1249
+ }, z.core.$strip>;
1250
+ };
1251
+ NOT_IN_PLAN: {
1252
+ status: number;
1253
+ data: z.ZodOptional<z.ZodObject<{
1254
+ manageUrl: z.ZodNullable<z.ZodString>;
1255
+ }, z.core.$strip>>;
1256
+ };
1257
+ READ_ONLY: {
1258
+ status: number;
1259
+ };
1260
+ TOO_MANY_REQUESTS: {
1261
+ status: number;
1262
+ };
1263
+ INVALID_INPUT: {
1264
+ status: number;
1265
+ data: z.ZodObject<{
1266
+ issues: z.ZodArray<z.ZodObject<{
1267
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
1268
+ message: z.ZodString;
1269
+ }, z.core.$strip>>;
1270
+ }, z.core.$strip>;
1271
+ };
1272
+ NOT_FOUND: {
1273
+ status: number;
1274
+ };
1275
+ TAKEN: {
1276
+ status: number;
1277
+ data: z.ZodObject<{
1278
+ field: z.ZodString;
1279
+ id: z.ZodOptional<z.ZodString>;
1280
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
1281
+ }, z.core.$strip>;
1282
+ };
1283
+ INVALID_CURSOR: {
1284
+ status: number;
1285
+ };
1286
+ INVALID_REFERENCE: {
1287
+ status: number;
1288
+ data: z.ZodObject<{
1289
+ field: z.ZodString;
1290
+ }, z.core.$strip>;
1291
+ };
1292
+ INVALID_FILTER: {
1293
+ status: number;
1294
+ };
1295
+ FILTER_TOO_SLOW: {
1296
+ status: number;
1297
+ };
1298
+ CURRENCY_NOT_SUPPORTED: {
1299
+ status: number;
1300
+ data: z.ZodObject<{
1301
+ currency: z.ZodString;
1302
+ }, z.core.$strip>;
1303
+ };
1304
+ DEFAULT_NOT_ALLOWED: {
1305
+ status: number;
1306
+ };
1307
+ GATEWAY_IN_USE: {
1308
+ status: number;
1309
+ };
1310
+ GATEWAY_NOT_ALLOWED: {
1311
+ status: number;
1312
+ };
1313
+ GATEWAY_REFUSED: {
1314
+ status: number;
1315
+ };
1316
+ INVALID_PRODUCT: {
1317
+ status: number;
1318
+ };
1319
+ INVALID_SUBDOMAIN: {
1320
+ status: number;
1321
+ };
1322
+ KIND_CHANGED: {
1323
+ status: number;
1324
+ };
1325
+ LIMIT_EXCEEDED: {
1326
+ status: number;
1327
+ };
1328
+ LINES_MISMATCH: {
1329
+ status: number;
1330
+ };
1331
+ NOTHING_TO_RETRY: {
1332
+ status: number;
1333
+ };
1334
+ NOT_PENDING: {
1335
+ status: number;
1336
+ };
1337
+ NOT_REFUNDABLE: {
1338
+ status: number;
1339
+ };
1340
+ NOT_TEST: {
1341
+ status: number;
1342
+ };
1343
+ NO_GATEWAY: {
1344
+ status: number;
1345
+ };
1346
+ PARTIAL_NOT_SUPPORTED: {
1347
+ status: number;
1348
+ };
1349
+ SUBJECT_REQUIRED: {
1350
+ status: number;
1351
+ };
1352
+ }>, Record<never, never>>;
471
1353
  refund: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
472
1354
  id: z.ZodString;
473
1355
  amount: z.ZodOptional<z.ZodInt>;
@@ -489,11 +1371,14 @@ export declare const paymentsContract: {
489
1371
  succeeded: "succeeded";
490
1372
  }>;
491
1373
  error: z.ZodNullable<z.ZodString>;
492
- createdAt: z.ZodISODateTime;
493
- requestedBy: z.ZodObject<{
494
- type: z.ZodString;
495
- id: z.ZodNullable<z.ZodString>;
496
- }, z.core.$strip>;
1374
+ requestedByType: z.ZodEnum<{
1375
+ customer: "customer";
1376
+ plugin: "plugin";
1377
+ system: "system";
1378
+ user: "user";
1379
+ }>;
1380
+ requestedBy: z.ZodNullable<z.ZodString>;
1381
+ createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
497
1382
  }, {
498
1383
  out: {};
499
1384
  in: {};
@@ -502,6 +1387,8 @@ export declare const paymentsContract: {
502
1387
  id: z.ZodString;
503
1388
  gatewayId: z.ZodString;
504
1389
  source: z.ZodString;
1390
+ referenceType: z.ZodString;
1391
+ referenceId: z.ZodString;
505
1392
  amount: z.ZodInt;
506
1393
  currency: z.ZodString;
507
1394
  description: z.ZodString;
@@ -534,17 +1421,13 @@ export declare const paymentsContract: {
534
1421
  }, z.core.$strip>>;
535
1422
  paidAmount: z.ZodNullable<z.ZodInt>;
536
1423
  refundedAmount: z.ZodInt;
537
- expiresAt: z.ZodISODateTime;
538
- paidAt: z.ZodNullable<z.ZodISODateTime>;
539
- createdAt: z.ZodISODateTime;
1424
+ expiresAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
1425
+ paidAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
1426
+ createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
540
1427
  gatewayKind: z.ZodEnum<{
541
1428
  qpay: "qpay";
542
1429
  test: "test";
543
1430
  }>;
544
- reference: z.ZodObject<{
545
- type: z.ZodString;
546
- id: z.ZodString;
547
- }, z.core.$strip>;
548
1431
  refundable: z.ZodObject<{
549
1432
  amount: z.ZodInt;
550
1433
  gateway: z.ZodEnum<{
@@ -557,7 +1440,139 @@ export declare const paymentsContract: {
557
1440
  out: {};
558
1441
  in: {};
559
1442
  }>;
560
- }, z.core.$strip>, Record<never, never>, Record<never, never>>;
1443
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
1444
+ UNAUTHORIZED: {
1445
+ status: number;
1446
+ };
1447
+ NOT_ALLOWED: {
1448
+ status: number;
1449
+ data: z.ZodOptional<z.ZodObject<{
1450
+ permission: z.ZodString;
1451
+ }, z.core.$strip>>;
1452
+ };
1453
+ PLUGIN_ONLY: {
1454
+ status: number;
1455
+ };
1456
+ MEMBERS_ONLY: {
1457
+ status: number;
1458
+ };
1459
+ ORG_REQUIRED: {
1460
+ status: number;
1461
+ };
1462
+ SCOPE_REQUIRED: {
1463
+ status: number;
1464
+ };
1465
+ SERVICE_TOKEN_REQUIRED: {
1466
+ status: number;
1467
+ };
1468
+ ORGANIZATION_DISABLED: {
1469
+ status: number;
1470
+ data: z.ZodObject<{
1471
+ manageUrl: z.ZodNullable<z.ZodString>;
1472
+ }, z.core.$strip>;
1473
+ };
1474
+ NOT_IN_PLAN: {
1475
+ status: number;
1476
+ data: z.ZodOptional<z.ZodObject<{
1477
+ manageUrl: z.ZodNullable<z.ZodString>;
1478
+ }, z.core.$strip>>;
1479
+ };
1480
+ READ_ONLY: {
1481
+ status: number;
1482
+ };
1483
+ TOO_MANY_REQUESTS: {
1484
+ status: number;
1485
+ };
1486
+ INVALID_INPUT: {
1487
+ status: number;
1488
+ data: z.ZodObject<{
1489
+ issues: z.ZodArray<z.ZodObject<{
1490
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
1491
+ message: z.ZodString;
1492
+ }, z.core.$strip>>;
1493
+ }, z.core.$strip>;
1494
+ };
1495
+ NOT_FOUND: {
1496
+ status: number;
1497
+ };
1498
+ TAKEN: {
1499
+ status: number;
1500
+ data: z.ZodObject<{
1501
+ field: z.ZodString;
1502
+ id: z.ZodOptional<z.ZodString>;
1503
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
1504
+ }, z.core.$strip>;
1505
+ };
1506
+ INVALID_CURSOR: {
1507
+ status: number;
1508
+ };
1509
+ INVALID_REFERENCE: {
1510
+ status: number;
1511
+ data: z.ZodObject<{
1512
+ field: z.ZodString;
1513
+ }, z.core.$strip>;
1514
+ };
1515
+ INVALID_FILTER: {
1516
+ status: number;
1517
+ };
1518
+ FILTER_TOO_SLOW: {
1519
+ status: number;
1520
+ };
1521
+ CURRENCY_NOT_SUPPORTED: {
1522
+ status: number;
1523
+ data: z.ZodObject<{
1524
+ currency: z.ZodString;
1525
+ }, z.core.$strip>;
1526
+ };
1527
+ DEFAULT_NOT_ALLOWED: {
1528
+ status: number;
1529
+ };
1530
+ GATEWAY_IN_USE: {
1531
+ status: number;
1532
+ };
1533
+ GATEWAY_NOT_ALLOWED: {
1534
+ status: number;
1535
+ };
1536
+ GATEWAY_REFUSED: {
1537
+ status: number;
1538
+ };
1539
+ INVALID_PRODUCT: {
1540
+ status: number;
1541
+ };
1542
+ INVALID_SUBDOMAIN: {
1543
+ status: number;
1544
+ };
1545
+ KIND_CHANGED: {
1546
+ status: number;
1547
+ };
1548
+ LIMIT_EXCEEDED: {
1549
+ status: number;
1550
+ };
1551
+ LINES_MISMATCH: {
1552
+ status: number;
1553
+ };
1554
+ NOTHING_TO_RETRY: {
1555
+ status: number;
1556
+ };
1557
+ NOT_PENDING: {
1558
+ status: number;
1559
+ };
1560
+ NOT_REFUNDABLE: {
1561
+ status: number;
1562
+ };
1563
+ NOT_TEST: {
1564
+ status: number;
1565
+ };
1566
+ NO_GATEWAY: {
1567
+ status: number;
1568
+ };
1569
+ PARTIAL_NOT_SUPPORTED: {
1570
+ status: number;
1571
+ };
1572
+ SUBJECT_REQUIRED: {
1573
+ status: number;
1574
+ };
1575
+ }>, Record<never, never>>;
561
1576
  refunds: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
562
1577
  id: z.ZodString;
563
1578
  }, z.core.$strip>, z.ZodObject<{
@@ -575,16 +1590,151 @@ export declare const paymentsContract: {
575
1590
  succeeded: "succeeded";
576
1591
  }>;
577
1592
  error: z.ZodNullable<z.ZodString>;
578
- createdAt: z.ZodISODateTime;
579
- requestedBy: z.ZodObject<{
580
- type: z.ZodString;
581
- id: z.ZodNullable<z.ZodString>;
582
- }, z.core.$strip>;
1593
+ requestedByType: z.ZodEnum<{
1594
+ customer: "customer";
1595
+ plugin: "plugin";
1596
+ system: "system";
1597
+ user: "user";
1598
+ }>;
1599
+ requestedBy: z.ZodNullable<z.ZodString>;
1600
+ createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
583
1601
  }, {
584
1602
  out: {};
585
1603
  in: {};
586
1604
  }>>;
587
- }, z.core.$strip>, Record<never, never>, Record<never, never>>;
1605
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
1606
+ UNAUTHORIZED: {
1607
+ status: number;
1608
+ };
1609
+ NOT_ALLOWED: {
1610
+ status: number;
1611
+ data: z.ZodOptional<z.ZodObject<{
1612
+ permission: z.ZodString;
1613
+ }, z.core.$strip>>;
1614
+ };
1615
+ PLUGIN_ONLY: {
1616
+ status: number;
1617
+ };
1618
+ MEMBERS_ONLY: {
1619
+ status: number;
1620
+ };
1621
+ ORG_REQUIRED: {
1622
+ status: number;
1623
+ };
1624
+ SCOPE_REQUIRED: {
1625
+ status: number;
1626
+ };
1627
+ SERVICE_TOKEN_REQUIRED: {
1628
+ status: number;
1629
+ };
1630
+ ORGANIZATION_DISABLED: {
1631
+ status: number;
1632
+ data: z.ZodObject<{
1633
+ manageUrl: z.ZodNullable<z.ZodString>;
1634
+ }, z.core.$strip>;
1635
+ };
1636
+ NOT_IN_PLAN: {
1637
+ status: number;
1638
+ data: z.ZodOptional<z.ZodObject<{
1639
+ manageUrl: z.ZodNullable<z.ZodString>;
1640
+ }, z.core.$strip>>;
1641
+ };
1642
+ READ_ONLY: {
1643
+ status: number;
1644
+ };
1645
+ TOO_MANY_REQUESTS: {
1646
+ status: number;
1647
+ };
1648
+ INVALID_INPUT: {
1649
+ status: number;
1650
+ data: z.ZodObject<{
1651
+ issues: z.ZodArray<z.ZodObject<{
1652
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
1653
+ message: z.ZodString;
1654
+ }, z.core.$strip>>;
1655
+ }, z.core.$strip>;
1656
+ };
1657
+ NOT_FOUND: {
1658
+ status: number;
1659
+ };
1660
+ TAKEN: {
1661
+ status: number;
1662
+ data: z.ZodObject<{
1663
+ field: z.ZodString;
1664
+ id: z.ZodOptional<z.ZodString>;
1665
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
1666
+ }, z.core.$strip>;
1667
+ };
1668
+ INVALID_CURSOR: {
1669
+ status: number;
1670
+ };
1671
+ INVALID_REFERENCE: {
1672
+ status: number;
1673
+ data: z.ZodObject<{
1674
+ field: z.ZodString;
1675
+ }, z.core.$strip>;
1676
+ };
1677
+ INVALID_FILTER: {
1678
+ status: number;
1679
+ };
1680
+ FILTER_TOO_SLOW: {
1681
+ status: number;
1682
+ };
1683
+ CURRENCY_NOT_SUPPORTED: {
1684
+ status: number;
1685
+ data: z.ZodObject<{
1686
+ currency: z.ZodString;
1687
+ }, z.core.$strip>;
1688
+ };
1689
+ DEFAULT_NOT_ALLOWED: {
1690
+ status: number;
1691
+ };
1692
+ GATEWAY_IN_USE: {
1693
+ status: number;
1694
+ };
1695
+ GATEWAY_NOT_ALLOWED: {
1696
+ status: number;
1697
+ };
1698
+ GATEWAY_REFUSED: {
1699
+ status: number;
1700
+ };
1701
+ INVALID_PRODUCT: {
1702
+ status: number;
1703
+ };
1704
+ INVALID_SUBDOMAIN: {
1705
+ status: number;
1706
+ };
1707
+ KIND_CHANGED: {
1708
+ status: number;
1709
+ };
1710
+ LIMIT_EXCEEDED: {
1711
+ status: number;
1712
+ };
1713
+ LINES_MISMATCH: {
1714
+ status: number;
1715
+ };
1716
+ NOTHING_TO_RETRY: {
1717
+ status: number;
1718
+ };
1719
+ NOT_PENDING: {
1720
+ status: number;
1721
+ };
1722
+ NOT_REFUNDABLE: {
1723
+ status: number;
1724
+ };
1725
+ NOT_TEST: {
1726
+ status: number;
1727
+ };
1728
+ NO_GATEWAY: {
1729
+ status: number;
1730
+ };
1731
+ PARTIAL_NOT_SUPPORTED: {
1732
+ status: number;
1733
+ };
1734
+ SUBJECT_REQUIRED: {
1735
+ status: number;
1736
+ };
1737
+ }>, Record<never, never>>;
588
1738
  pluginSettings: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
589
1739
  data: z.ZodArray<z.ZodObject<{
590
1740
  plugin: z.ZodString;
@@ -595,7 +1745,139 @@ export declare const paymentsContract: {
595
1745
  out: {};
596
1746
  in: {};
597
1747
  }>>;
598
- }, z.core.$strip>, Record<never, never>, Record<never, never>>;
1748
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
1749
+ UNAUTHORIZED: {
1750
+ status: number;
1751
+ };
1752
+ NOT_ALLOWED: {
1753
+ status: number;
1754
+ data: z.ZodOptional<z.ZodObject<{
1755
+ permission: z.ZodString;
1756
+ }, z.core.$strip>>;
1757
+ };
1758
+ PLUGIN_ONLY: {
1759
+ status: number;
1760
+ };
1761
+ MEMBERS_ONLY: {
1762
+ status: number;
1763
+ };
1764
+ ORG_REQUIRED: {
1765
+ status: number;
1766
+ };
1767
+ SCOPE_REQUIRED: {
1768
+ status: number;
1769
+ };
1770
+ SERVICE_TOKEN_REQUIRED: {
1771
+ status: number;
1772
+ };
1773
+ ORGANIZATION_DISABLED: {
1774
+ status: number;
1775
+ data: z.ZodObject<{
1776
+ manageUrl: z.ZodNullable<z.ZodString>;
1777
+ }, z.core.$strip>;
1778
+ };
1779
+ NOT_IN_PLAN: {
1780
+ status: number;
1781
+ data: z.ZodOptional<z.ZodObject<{
1782
+ manageUrl: z.ZodNullable<z.ZodString>;
1783
+ }, z.core.$strip>>;
1784
+ };
1785
+ READ_ONLY: {
1786
+ status: number;
1787
+ };
1788
+ TOO_MANY_REQUESTS: {
1789
+ status: number;
1790
+ };
1791
+ INVALID_INPUT: {
1792
+ status: number;
1793
+ data: z.ZodObject<{
1794
+ issues: z.ZodArray<z.ZodObject<{
1795
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
1796
+ message: z.ZodString;
1797
+ }, z.core.$strip>>;
1798
+ }, z.core.$strip>;
1799
+ };
1800
+ NOT_FOUND: {
1801
+ status: number;
1802
+ };
1803
+ TAKEN: {
1804
+ status: number;
1805
+ data: z.ZodObject<{
1806
+ field: z.ZodString;
1807
+ id: z.ZodOptional<z.ZodString>;
1808
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
1809
+ }, z.core.$strip>;
1810
+ };
1811
+ INVALID_CURSOR: {
1812
+ status: number;
1813
+ };
1814
+ INVALID_REFERENCE: {
1815
+ status: number;
1816
+ data: z.ZodObject<{
1817
+ field: z.ZodString;
1818
+ }, z.core.$strip>;
1819
+ };
1820
+ INVALID_FILTER: {
1821
+ status: number;
1822
+ };
1823
+ FILTER_TOO_SLOW: {
1824
+ status: number;
1825
+ };
1826
+ CURRENCY_NOT_SUPPORTED: {
1827
+ status: number;
1828
+ data: z.ZodObject<{
1829
+ currency: z.ZodString;
1830
+ }, z.core.$strip>;
1831
+ };
1832
+ DEFAULT_NOT_ALLOWED: {
1833
+ status: number;
1834
+ };
1835
+ GATEWAY_IN_USE: {
1836
+ status: number;
1837
+ };
1838
+ GATEWAY_NOT_ALLOWED: {
1839
+ status: number;
1840
+ };
1841
+ GATEWAY_REFUSED: {
1842
+ status: number;
1843
+ };
1844
+ INVALID_PRODUCT: {
1845
+ status: number;
1846
+ };
1847
+ INVALID_SUBDOMAIN: {
1848
+ status: number;
1849
+ };
1850
+ KIND_CHANGED: {
1851
+ status: number;
1852
+ };
1853
+ LIMIT_EXCEEDED: {
1854
+ status: number;
1855
+ };
1856
+ LINES_MISMATCH: {
1857
+ status: number;
1858
+ };
1859
+ NOTHING_TO_RETRY: {
1860
+ status: number;
1861
+ };
1862
+ NOT_PENDING: {
1863
+ status: number;
1864
+ };
1865
+ NOT_REFUNDABLE: {
1866
+ status: number;
1867
+ };
1868
+ NOT_TEST: {
1869
+ status: number;
1870
+ };
1871
+ NO_GATEWAY: {
1872
+ status: number;
1873
+ };
1874
+ PARTIAL_NOT_SUPPORTED: {
1875
+ status: number;
1876
+ };
1877
+ SUBJECT_REQUIRED: {
1878
+ status: number;
1879
+ };
1880
+ }>, Record<never, never>>;
599
1881
  updatePluginSettings: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
600
1882
  plugin: z.ZodString;
601
1883
  defaultGatewayId: z.ZodNullable<z.ZodString>;
@@ -608,7 +1890,139 @@ export declare const paymentsContract: {
608
1890
  }, {
609
1891
  out: {};
610
1892
  in: {};
611
- }>, Record<never, never>, Record<never, never>>;
1893
+ }>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
1894
+ UNAUTHORIZED: {
1895
+ status: number;
1896
+ };
1897
+ NOT_ALLOWED: {
1898
+ status: number;
1899
+ data: z.ZodOptional<z.ZodObject<{
1900
+ permission: z.ZodString;
1901
+ }, z.core.$strip>>;
1902
+ };
1903
+ PLUGIN_ONLY: {
1904
+ status: number;
1905
+ };
1906
+ MEMBERS_ONLY: {
1907
+ status: number;
1908
+ };
1909
+ ORG_REQUIRED: {
1910
+ status: number;
1911
+ };
1912
+ SCOPE_REQUIRED: {
1913
+ status: number;
1914
+ };
1915
+ SERVICE_TOKEN_REQUIRED: {
1916
+ status: number;
1917
+ };
1918
+ ORGANIZATION_DISABLED: {
1919
+ status: number;
1920
+ data: z.ZodObject<{
1921
+ manageUrl: z.ZodNullable<z.ZodString>;
1922
+ }, z.core.$strip>;
1923
+ };
1924
+ NOT_IN_PLAN: {
1925
+ status: number;
1926
+ data: z.ZodOptional<z.ZodObject<{
1927
+ manageUrl: z.ZodNullable<z.ZodString>;
1928
+ }, z.core.$strip>>;
1929
+ };
1930
+ READ_ONLY: {
1931
+ status: number;
1932
+ };
1933
+ TOO_MANY_REQUESTS: {
1934
+ status: number;
1935
+ };
1936
+ INVALID_INPUT: {
1937
+ status: number;
1938
+ data: z.ZodObject<{
1939
+ issues: z.ZodArray<z.ZodObject<{
1940
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
1941
+ message: z.ZodString;
1942
+ }, z.core.$strip>>;
1943
+ }, z.core.$strip>;
1944
+ };
1945
+ NOT_FOUND: {
1946
+ status: number;
1947
+ };
1948
+ TAKEN: {
1949
+ status: number;
1950
+ data: z.ZodObject<{
1951
+ field: z.ZodString;
1952
+ id: z.ZodOptional<z.ZodString>;
1953
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
1954
+ }, z.core.$strip>;
1955
+ };
1956
+ INVALID_CURSOR: {
1957
+ status: number;
1958
+ };
1959
+ INVALID_REFERENCE: {
1960
+ status: number;
1961
+ data: z.ZodObject<{
1962
+ field: z.ZodString;
1963
+ }, z.core.$strip>;
1964
+ };
1965
+ INVALID_FILTER: {
1966
+ status: number;
1967
+ };
1968
+ FILTER_TOO_SLOW: {
1969
+ status: number;
1970
+ };
1971
+ CURRENCY_NOT_SUPPORTED: {
1972
+ status: number;
1973
+ data: z.ZodObject<{
1974
+ currency: z.ZodString;
1975
+ }, z.core.$strip>;
1976
+ };
1977
+ DEFAULT_NOT_ALLOWED: {
1978
+ status: number;
1979
+ };
1980
+ GATEWAY_IN_USE: {
1981
+ status: number;
1982
+ };
1983
+ GATEWAY_NOT_ALLOWED: {
1984
+ status: number;
1985
+ };
1986
+ GATEWAY_REFUSED: {
1987
+ status: number;
1988
+ };
1989
+ INVALID_PRODUCT: {
1990
+ status: number;
1991
+ };
1992
+ INVALID_SUBDOMAIN: {
1993
+ status: number;
1994
+ };
1995
+ KIND_CHANGED: {
1996
+ status: number;
1997
+ };
1998
+ LIMIT_EXCEEDED: {
1999
+ status: number;
2000
+ };
2001
+ LINES_MISMATCH: {
2002
+ status: number;
2003
+ };
2004
+ NOTHING_TO_RETRY: {
2005
+ status: number;
2006
+ };
2007
+ NOT_PENDING: {
2008
+ status: number;
2009
+ };
2010
+ NOT_REFUNDABLE: {
2011
+ status: number;
2012
+ };
2013
+ NOT_TEST: {
2014
+ status: number;
2015
+ };
2016
+ NO_GATEWAY: {
2017
+ status: number;
2018
+ };
2019
+ PARTIAL_NOT_SUPPORTED: {
2020
+ status: number;
2021
+ };
2022
+ SUBJECT_REQUIRED: {
2023
+ status: number;
2024
+ };
2025
+ }>, Record<never, never>>;
612
2026
  invoices: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
613
2027
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
614
2028
  cursor: z.ZodOptional<z.ZodString>;
@@ -635,6 +2049,8 @@ export declare const paymentsContract: {
635
2049
  id: z.ZodString;
636
2050
  gatewayId: z.ZodString;
637
2051
  source: z.ZodString;
2052
+ referenceType: z.ZodString;
2053
+ referenceId: z.ZodString;
638
2054
  amount: z.ZodInt;
639
2055
  currency: z.ZodString;
640
2056
  description: z.ZodString;
@@ -667,17 +2083,13 @@ export declare const paymentsContract: {
667
2083
  }, z.core.$strip>>;
668
2084
  paidAmount: z.ZodNullable<z.ZodInt>;
669
2085
  refundedAmount: z.ZodInt;
670
- expiresAt: z.ZodISODateTime;
671
- paidAt: z.ZodNullable<z.ZodISODateTime>;
672
- createdAt: z.ZodISODateTime;
2086
+ expiresAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
2087
+ paidAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
2088
+ createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
673
2089
  gatewayKind: z.ZodEnum<{
674
2090
  qpay: "qpay";
675
2091
  test: "test";
676
2092
  }>;
677
- reference: z.ZodObject<{
678
- type: z.ZodString;
679
- id: z.ZodString;
680
- }, z.core.$strip>;
681
2093
  refundable: z.ZodObject<{
682
2094
  amount: z.ZodInt;
683
2095
  gateway: z.ZodEnum<{
@@ -698,13 +2110,147 @@ export declare const paymentsContract: {
698
2110
  }, z.core.$strip>;
699
2111
  totalCount: z.ZodInt;
700
2112
  totalCapped: z.ZodOptional<z.ZodBoolean>;
701
- }, z.core.$strip>, Record<never, never>, Record<never, never>>;
2113
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
2114
+ UNAUTHORIZED: {
2115
+ status: number;
2116
+ };
2117
+ NOT_ALLOWED: {
2118
+ status: number;
2119
+ data: z.ZodOptional<z.ZodObject<{
2120
+ permission: z.ZodString;
2121
+ }, z.core.$strip>>;
2122
+ };
2123
+ PLUGIN_ONLY: {
2124
+ status: number;
2125
+ };
2126
+ MEMBERS_ONLY: {
2127
+ status: number;
2128
+ };
2129
+ ORG_REQUIRED: {
2130
+ status: number;
2131
+ };
2132
+ SCOPE_REQUIRED: {
2133
+ status: number;
2134
+ };
2135
+ SERVICE_TOKEN_REQUIRED: {
2136
+ status: number;
2137
+ };
2138
+ ORGANIZATION_DISABLED: {
2139
+ status: number;
2140
+ data: z.ZodObject<{
2141
+ manageUrl: z.ZodNullable<z.ZodString>;
2142
+ }, z.core.$strip>;
2143
+ };
2144
+ NOT_IN_PLAN: {
2145
+ status: number;
2146
+ data: z.ZodOptional<z.ZodObject<{
2147
+ manageUrl: z.ZodNullable<z.ZodString>;
2148
+ }, z.core.$strip>>;
2149
+ };
2150
+ READ_ONLY: {
2151
+ status: number;
2152
+ };
2153
+ TOO_MANY_REQUESTS: {
2154
+ status: number;
2155
+ };
2156
+ INVALID_INPUT: {
2157
+ status: number;
2158
+ data: z.ZodObject<{
2159
+ issues: z.ZodArray<z.ZodObject<{
2160
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
2161
+ message: z.ZodString;
2162
+ }, z.core.$strip>>;
2163
+ }, z.core.$strip>;
2164
+ };
2165
+ NOT_FOUND: {
2166
+ status: number;
2167
+ };
2168
+ TAKEN: {
2169
+ status: number;
2170
+ data: z.ZodObject<{
2171
+ field: z.ZodString;
2172
+ id: z.ZodOptional<z.ZodString>;
2173
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
2174
+ }, z.core.$strip>;
2175
+ };
2176
+ INVALID_CURSOR: {
2177
+ status: number;
2178
+ };
2179
+ INVALID_REFERENCE: {
2180
+ status: number;
2181
+ data: z.ZodObject<{
2182
+ field: z.ZodString;
2183
+ }, z.core.$strip>;
2184
+ };
2185
+ INVALID_FILTER: {
2186
+ status: number;
2187
+ };
2188
+ FILTER_TOO_SLOW: {
2189
+ status: number;
2190
+ };
2191
+ CURRENCY_NOT_SUPPORTED: {
2192
+ status: number;
2193
+ data: z.ZodObject<{
2194
+ currency: z.ZodString;
2195
+ }, z.core.$strip>;
2196
+ };
2197
+ DEFAULT_NOT_ALLOWED: {
2198
+ status: number;
2199
+ };
2200
+ GATEWAY_IN_USE: {
2201
+ status: number;
2202
+ };
2203
+ GATEWAY_NOT_ALLOWED: {
2204
+ status: number;
2205
+ };
2206
+ GATEWAY_REFUSED: {
2207
+ status: number;
2208
+ };
2209
+ INVALID_PRODUCT: {
2210
+ status: number;
2211
+ };
2212
+ INVALID_SUBDOMAIN: {
2213
+ status: number;
2214
+ };
2215
+ KIND_CHANGED: {
2216
+ status: number;
2217
+ };
2218
+ LIMIT_EXCEEDED: {
2219
+ status: number;
2220
+ };
2221
+ LINES_MISMATCH: {
2222
+ status: number;
2223
+ };
2224
+ NOTHING_TO_RETRY: {
2225
+ status: number;
2226
+ };
2227
+ NOT_PENDING: {
2228
+ status: number;
2229
+ };
2230
+ NOT_REFUNDABLE: {
2231
+ status: number;
2232
+ };
2233
+ NOT_TEST: {
2234
+ status: number;
2235
+ };
2236
+ NO_GATEWAY: {
2237
+ status: number;
2238
+ };
2239
+ PARTIAL_NOT_SUPPORTED: {
2240
+ status: number;
2241
+ };
2242
+ SUBJECT_REQUIRED: {
2243
+ status: number;
2244
+ };
2245
+ }>, Record<never, never>>;
702
2246
  payTestInvoice: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
703
2247
  id: z.ZodString;
704
2248
  }, z.core.$strip>, z.ZodObject<{
705
2249
  id: z.ZodString;
706
2250
  gatewayId: z.ZodString;
707
2251
  source: z.ZodString;
2252
+ referenceType: z.ZodString;
2253
+ referenceId: z.ZodString;
708
2254
  amount: z.ZodInt;
709
2255
  currency: z.ZodString;
710
2256
  description: z.ZodString;
@@ -737,17 +2283,13 @@ export declare const paymentsContract: {
737
2283
  }, z.core.$strip>>;
738
2284
  paidAmount: z.ZodNullable<z.ZodInt>;
739
2285
  refundedAmount: z.ZodInt;
740
- expiresAt: z.ZodISODateTime;
741
- paidAt: z.ZodNullable<z.ZodISODateTime>;
742
- createdAt: z.ZodISODateTime;
2286
+ expiresAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
2287
+ paidAt: z.ZodNullable<z.ZodCodec<z.ZodDate, z.ZodISODateTime>>;
2288
+ createdAt: z.ZodCodec<z.ZodDate, z.ZodISODateTime>;
743
2289
  gatewayKind: z.ZodEnum<{
744
2290
  qpay: "qpay";
745
2291
  test: "test";
746
2292
  }>;
747
- reference: z.ZodObject<{
748
- type: z.ZodString;
749
- id: z.ZodString;
750
- }, z.core.$strip>;
751
2293
  refundable: z.ZodObject<{
752
2294
  amount: z.ZodInt;
753
2295
  gateway: z.ZodEnum<{
@@ -759,5 +2301,137 @@ export declare const paymentsContract: {
759
2301
  }, {
760
2302
  out: {};
761
2303
  in: {};
762
- }>, Record<never, never>, Record<never, never>>;
2304
+ }>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
2305
+ UNAUTHORIZED: {
2306
+ status: number;
2307
+ };
2308
+ NOT_ALLOWED: {
2309
+ status: number;
2310
+ data: z.ZodOptional<z.ZodObject<{
2311
+ permission: z.ZodString;
2312
+ }, z.core.$strip>>;
2313
+ };
2314
+ PLUGIN_ONLY: {
2315
+ status: number;
2316
+ };
2317
+ MEMBERS_ONLY: {
2318
+ status: number;
2319
+ };
2320
+ ORG_REQUIRED: {
2321
+ status: number;
2322
+ };
2323
+ SCOPE_REQUIRED: {
2324
+ status: number;
2325
+ };
2326
+ SERVICE_TOKEN_REQUIRED: {
2327
+ status: number;
2328
+ };
2329
+ ORGANIZATION_DISABLED: {
2330
+ status: number;
2331
+ data: z.ZodObject<{
2332
+ manageUrl: z.ZodNullable<z.ZodString>;
2333
+ }, z.core.$strip>;
2334
+ };
2335
+ NOT_IN_PLAN: {
2336
+ status: number;
2337
+ data: z.ZodOptional<z.ZodObject<{
2338
+ manageUrl: z.ZodNullable<z.ZodString>;
2339
+ }, z.core.$strip>>;
2340
+ };
2341
+ READ_ONLY: {
2342
+ status: number;
2343
+ };
2344
+ TOO_MANY_REQUESTS: {
2345
+ status: number;
2346
+ };
2347
+ INVALID_INPUT: {
2348
+ status: number;
2349
+ data: z.ZodObject<{
2350
+ issues: z.ZodArray<z.ZodObject<{
2351
+ path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
2352
+ message: z.ZodString;
2353
+ }, z.core.$strip>>;
2354
+ }, z.core.$strip>;
2355
+ };
2356
+ NOT_FOUND: {
2357
+ status: number;
2358
+ };
2359
+ TAKEN: {
2360
+ status: number;
2361
+ data: z.ZodObject<{
2362
+ field: z.ZodString;
2363
+ id: z.ZodOptional<z.ZodString>;
2364
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
2365
+ }, z.core.$strip>;
2366
+ };
2367
+ INVALID_CURSOR: {
2368
+ status: number;
2369
+ };
2370
+ INVALID_REFERENCE: {
2371
+ status: number;
2372
+ data: z.ZodObject<{
2373
+ field: z.ZodString;
2374
+ }, z.core.$strip>;
2375
+ };
2376
+ INVALID_FILTER: {
2377
+ status: number;
2378
+ };
2379
+ FILTER_TOO_SLOW: {
2380
+ status: number;
2381
+ };
2382
+ CURRENCY_NOT_SUPPORTED: {
2383
+ status: number;
2384
+ data: z.ZodObject<{
2385
+ currency: z.ZodString;
2386
+ }, z.core.$strip>;
2387
+ };
2388
+ DEFAULT_NOT_ALLOWED: {
2389
+ status: number;
2390
+ };
2391
+ GATEWAY_IN_USE: {
2392
+ status: number;
2393
+ };
2394
+ GATEWAY_NOT_ALLOWED: {
2395
+ status: number;
2396
+ };
2397
+ GATEWAY_REFUSED: {
2398
+ status: number;
2399
+ };
2400
+ INVALID_PRODUCT: {
2401
+ status: number;
2402
+ };
2403
+ INVALID_SUBDOMAIN: {
2404
+ status: number;
2405
+ };
2406
+ KIND_CHANGED: {
2407
+ status: number;
2408
+ };
2409
+ LIMIT_EXCEEDED: {
2410
+ status: number;
2411
+ };
2412
+ LINES_MISMATCH: {
2413
+ status: number;
2414
+ };
2415
+ NOTHING_TO_RETRY: {
2416
+ status: number;
2417
+ };
2418
+ NOT_PENDING: {
2419
+ status: number;
2420
+ };
2421
+ NOT_REFUNDABLE: {
2422
+ status: number;
2423
+ };
2424
+ NOT_TEST: {
2425
+ status: number;
2426
+ };
2427
+ NO_GATEWAY: {
2428
+ status: number;
2429
+ };
2430
+ PARTIAL_NOT_SUPPORTED: {
2431
+ status: number;
2432
+ };
2433
+ SUBJECT_REQUIRED: {
2434
+ status: number;
2435
+ };
2436
+ }>, Record<never, never>>;
763
2437
  };