@moovio/sdk 0.6.0 → 0.6.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 (141) hide show
  1. package/README.md +38 -8
  2. package/bin/mcp-server.js +1122 -258
  3. package/bin/mcp-server.js.map +28 -11
  4. package/docs/sdks/receipts/README.md +189 -0
  5. package/docs/sdks/transfers/README.md +185 -0
  6. package/funcs/receiptsCreate.d.ts +18 -0
  7. package/funcs/receiptsCreate.d.ts.map +1 -0
  8. package/funcs/receiptsCreate.js +133 -0
  9. package/funcs/receiptsCreate.js.map +1 -0
  10. package/funcs/receiptsList.d.ts +16 -0
  11. package/funcs/receiptsList.d.ts.map +1 -0
  12. package/funcs/receiptsList.js +121 -0
  13. package/funcs/receiptsList.js.map +1 -0
  14. package/funcs/transfersCreateCancellation.d.ts +17 -0
  15. package/funcs/transfersCreateCancellation.d.ts.map +1 -0
  16. package/funcs/transfersCreateCancellation.js +128 -0
  17. package/funcs/transfersCreateCancellation.js.map +1 -0
  18. package/funcs/transfersGetCancellation.d.ts +16 -0
  19. package/funcs/transfersGetCancellation.d.ts.map +1 -0
  20. package/funcs/transfersGetCancellation.js +131 -0
  21. package/funcs/transfersGetCancellation.js.map +1 -0
  22. package/jsr.json +1 -1
  23. package/lib/config.d.ts +3 -3
  24. package/lib/config.js +3 -3
  25. package/mcp-server/mcp-server.js +1 -1
  26. package/mcp-server/server.d.ts.map +1 -1
  27. package/mcp-server/server.js +9 -1
  28. package/mcp-server/server.js.map +1 -1
  29. package/mcp-server/tools/receiptsCreate.d.ts +9 -0
  30. package/mcp-server/tools/receiptsCreate.d.ts.map +1 -0
  31. package/mcp-server/tools/receiptsCreate.js +66 -0
  32. package/mcp-server/tools/receiptsCreate.js.map +1 -0
  33. package/mcp-server/tools/receiptsList.d.ts +8 -0
  34. package/mcp-server/tools/receiptsList.d.ts.map +1 -0
  35. package/mcp-server/tools/receiptsList.js +65 -0
  36. package/mcp-server/tools/receiptsList.js.map +1 -0
  37. package/mcp-server/tools/transfersCreateCancellation.d.ts +8 -0
  38. package/mcp-server/tools/transfersCreateCancellation.d.ts.map +1 -0
  39. package/mcp-server/tools/transfersCreateCancellation.js +65 -0
  40. package/mcp-server/tools/transfersCreateCancellation.js.map +1 -0
  41. package/mcp-server/tools/transfersGetCancellation.d.ts +8 -0
  42. package/mcp-server/tools/transfersGetCancellation.d.ts.map +1 -0
  43. package/mcp-server/tools/transfersGetCancellation.js +65 -0
  44. package/mcp-server/tools/transfersGetCancellation.js.map +1 -0
  45. package/models/components/index.d.ts +4 -0
  46. package/models/components/index.d.ts.map +1 -1
  47. package/models/components/index.js +4 -0
  48. package/models/components/index.js.map +1 -1
  49. package/models/components/receiptkind.d.ts +31 -0
  50. package/models/components/receiptkind.d.ts.map +1 -0
  51. package/models/components/receiptkind.js +63 -0
  52. package/models/components/receiptkind.js.map +1 -0
  53. package/models/components/receiptrequest.d.ts +76 -0
  54. package/models/components/receiptrequest.d.ts.map +1 -0
  55. package/models/components/receiptrequest.js +80 -0
  56. package/models/components/receiptrequest.js.map +1 -0
  57. package/models/components/receiptresponse.d.ts +94 -0
  58. package/models/components/receiptresponse.d.ts.map +1 -0
  59. package/models/components/receiptresponse.js +90 -0
  60. package/models/components/receiptresponse.js.map +1 -0
  61. package/models/components/sentreceipt.d.ts +42 -0
  62. package/models/components/sentreceipt.d.ts.map +1 -0
  63. package/models/components/sentreceipt.js +73 -0
  64. package/models/components/sentreceipt.js.map +1 -0
  65. package/models/components/transfer.d.ts +3 -0
  66. package/models/components/transfer.d.ts.map +1 -1
  67. package/models/components/transfer.js +3 -0
  68. package/models/components/transfer.js.map +1 -1
  69. package/models/errors/index.d.ts +1 -0
  70. package/models/errors/index.d.ts.map +1 -1
  71. package/models/errors/index.js +1 -0
  72. package/models/errors/index.js.map +1 -1
  73. package/models/errors/receiptvalidationerror.d.ts +46 -0
  74. package/models/errors/receiptvalidationerror.d.ts.map +1 -0
  75. package/models/errors/receiptvalidationerror.js +98 -0
  76. package/models/errors/receiptvalidationerror.js.map +1 -0
  77. package/models/errors/transfer.d.ts +3 -0
  78. package/models/errors/transfer.d.ts.map +1 -1
  79. package/models/errors/transfer.js +4 -0
  80. package/models/errors/transfer.js.map +1 -1
  81. package/models/operations/createcancellation.d.ts +107 -0
  82. package/models/operations/createcancellation.d.ts.map +1 -0
  83. package/models/operations/createcancellation.js +147 -0
  84. package/models/operations/createcancellation.js.map +1 -0
  85. package/models/operations/createreceipts.d.ts +74 -0
  86. package/models/operations/createreceipts.d.ts.map +1 -0
  87. package/models/operations/createreceipts.js +118 -0
  88. package/models/operations/createreceipts.js.map +1 -0
  89. package/models/operations/getcancellation.d.ts +112 -0
  90. package/models/operations/getcancellation.d.ts.map +1 -0
  91. package/models/operations/getcancellation.js +149 -0
  92. package/models/operations/getcancellation.js.map +1 -0
  93. package/models/operations/index.d.ts +4 -0
  94. package/models/operations/index.d.ts.map +1 -1
  95. package/models/operations/index.js +4 -0
  96. package/models/operations/index.js.map +1 -1
  97. package/models/operations/listreceipts.d.ts +102 -0
  98. package/models/operations/listreceipts.d.ts.map +1 -0
  99. package/models/operations/listreceipts.js +145 -0
  100. package/models/operations/listreceipts.js.map +1 -0
  101. package/package.json +1 -1
  102. package/sdk/receipts.d.ts +20 -0
  103. package/sdk/receipts.d.ts.map +1 -0
  104. package/sdk/receipts.js +32 -0
  105. package/sdk/receipts.js.map +1 -0
  106. package/sdk/sdk.d.ts +3 -0
  107. package/sdk/sdk.d.ts.map +1 -1
  108. package/sdk/sdk.js +4 -0
  109. package/sdk/sdk.js.map +1 -1
  110. package/sdk/transfers.d.ts +14 -0
  111. package/sdk/transfers.d.ts.map +1 -1
  112. package/sdk/transfers.js +20 -0
  113. package/sdk/transfers.js.map +1 -1
  114. package/src/funcs/receiptsCreate.ts +190 -0
  115. package/src/funcs/receiptsList.ts +171 -0
  116. package/src/funcs/transfersCreateCancellation.ts +184 -0
  117. package/src/funcs/transfersGetCancellation.ts +183 -0
  118. package/src/lib/config.ts +3 -3
  119. package/src/mcp-server/mcp-server.ts +1 -1
  120. package/src/mcp-server/server.ts +9 -1
  121. package/src/mcp-server/tools/receiptsCreate.ts +39 -0
  122. package/src/mcp-server/tools/receiptsList.ts +38 -0
  123. package/src/mcp-server/tools/transfersCreateCancellation.ts +38 -0
  124. package/src/mcp-server/tools/transfersGetCancellation.ts +38 -0
  125. package/src/models/components/index.ts +4 -0
  126. package/src/models/components/receiptkind.ts +36 -0
  127. package/src/models/components/receiptrequest.ts +123 -0
  128. package/src/models/components/receiptresponse.ts +157 -0
  129. package/src/models/components/sentreceipt.ts +79 -0
  130. package/src/models/components/transfer.ts +10 -0
  131. package/src/models/errors/index.ts +1 -0
  132. package/src/models/errors/receiptvalidationerror.ts +99 -0
  133. package/src/models/errors/transfer.ts +6 -0
  134. package/src/models/operations/createcancellation.ts +229 -0
  135. package/src/models/operations/createreceipts.ts +161 -0
  136. package/src/models/operations/getcancellation.ts +236 -0
  137. package/src/models/operations/index.ts +4 -0
  138. package/src/models/operations/listreceipts.ts +222 -0
  139. package/src/sdk/receipts.ts +46 -0
  140. package/src/sdk/sdk.ts +6 -0
  141. package/src/sdk/transfers.ts +36 -0
@@ -0,0 +1,189 @@
1
+ # Receipts
2
+ (*receipts*)
3
+
4
+ ## Overview
5
+
6
+ ### Available Operations
7
+
8
+ * [create](#create) - Create receipts for transfers and scheduled transfers.
9
+
10
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
11
+ you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
12
+ * [list](#list) - List receipts by trasnferID, scheduleID, or occurrenceID.
13
+
14
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
15
+ you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
16
+
17
+ ## create
18
+
19
+ Create receipts for transfers and scheduled transfers.
20
+
21
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
22
+ you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
23
+
24
+ ### Example Usage
25
+
26
+ ```typescript
27
+ import { Moov } from "@moovio/sdk";
28
+
29
+ const moov = new Moov({
30
+ security: {
31
+ username: "",
32
+ password: "",
33
+ },
34
+ });
35
+
36
+ async function run() {
37
+ const result = await moov.receipts.create([
38
+ {
39
+ kind: "sale.customer.v1",
40
+ email: "jordan.lee@classbooker.dev",
41
+ },
42
+ ]);
43
+
44
+ // Handle the result
45
+ console.log(result);
46
+ }
47
+
48
+ run();
49
+ ```
50
+
51
+ ### Standalone function
52
+
53
+ The standalone function version of this method:
54
+
55
+ ```typescript
56
+ import { MoovCore } from "@moovio/sdk/core.js";
57
+ import { receiptsCreate } from "@moovio/sdk/funcs/receiptsCreate.js";
58
+
59
+ // Use `MoovCore` for best tree-shaking performance.
60
+ // You can create one instance of it to use across an application.
61
+ const moov = new MoovCore({
62
+ security: {
63
+ username: "",
64
+ password: "",
65
+ },
66
+ });
67
+
68
+ async function run() {
69
+ const res = await receiptsCreate(moov, [
70
+ {
71
+ kind: "sale.customer.v1",
72
+ email: "jordan.lee@classbooker.dev",
73
+ },
74
+ ]);
75
+
76
+ if (!res.ok) {
77
+ throw res.error;
78
+ }
79
+
80
+ const { value: result } = res;
81
+
82
+ // Handle the result
83
+ console.log(result);
84
+ }
85
+
86
+ run();
87
+ ```
88
+
89
+ ### Parameters
90
+
91
+ | Parameter | Type | Required | Description |
92
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
93
+ | `request` | [components.ReceiptRequest[]](../../models/.md) | :heavy_check_mark: | The request object to use for the request. |
94
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
95
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
96
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
97
+
98
+ ### Response
99
+
100
+ **Promise\<[operations.CreateReceiptsResponse](../../models/operations/createreceiptsresponse.md)\>**
101
+
102
+ ### Errors
103
+
104
+ | Error Type | Status Code | Content Type |
105
+ | ----------------------------- | ----------------------------- | ----------------------------- |
106
+ | errors.GenericError | 400, 409 | application/json |
107
+ | errors.ReceiptValidationError | 422 | application/json |
108
+ | errors.APIError | 4XX, 5XX | \*/\* |
109
+
110
+ ## list
111
+
112
+ List receipts by trasnferID, scheduleID, or occurrenceID.
113
+
114
+ To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
115
+ you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
116
+
117
+ ### Example Usage
118
+
119
+ ```typescript
120
+ import { Moov } from "@moovio/sdk";
121
+
122
+ const moov = new Moov({
123
+ security: {
124
+ username: "",
125
+ password: "",
126
+ },
127
+ });
128
+
129
+ async function run() {
130
+ const result = await moov.receipts.list({});
131
+
132
+ // Handle the result
133
+ console.log(result);
134
+ }
135
+
136
+ run();
137
+ ```
138
+
139
+ ### Standalone function
140
+
141
+ The standalone function version of this method:
142
+
143
+ ```typescript
144
+ import { MoovCore } from "@moovio/sdk/core.js";
145
+ import { receiptsList } from "@moovio/sdk/funcs/receiptsList.js";
146
+
147
+ // Use `MoovCore` for best tree-shaking performance.
148
+ // You can create one instance of it to use across an application.
149
+ const moov = new MoovCore({
150
+ security: {
151
+ username: "",
152
+ password: "",
153
+ },
154
+ });
155
+
156
+ async function run() {
157
+ const res = await receiptsList(moov, {});
158
+
159
+ if (!res.ok) {
160
+ throw res.error;
161
+ }
162
+
163
+ const { value: result } = res;
164
+
165
+ // Handle the result
166
+ console.log(result);
167
+ }
168
+
169
+ run();
170
+ ```
171
+
172
+ ### Parameters
173
+
174
+ | Parameter | Type | Required | Description |
175
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
176
+ | `request` | [operations.ListReceiptsRequest](../../models/operations/listreceiptsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
177
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
178
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
179
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
180
+
181
+ ### Response
182
+
183
+ **Promise\<[operations.ListReceiptsResponse](../../models/operations/listreceiptsresponse.md)\>**
184
+
185
+ ### Errors
186
+
187
+ | Error Type | Status Code | Content Type |
188
+ | --------------- | --------------- | --------------- |
189
+ | errors.APIError | 4XX, 5XX | \*/\* |
@@ -35,6 +35,14 @@ Read our [transfers overview guide](https://docs.moov.io/guides/money-movement/o
35
35
 
36
36
  To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
37
37
  you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
38
+ * [createCancellation](#createcancellation) - Initiate a cancellation for a card, ACH, or queued transfer.
39
+
40
+ To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
41
+ to specify the `/accounts/{accountID}/transfers.write` scope.
42
+ * [getCancellation](#getcancellation) - Get details of a cancellation for a transfer.
43
+
44
+ To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
45
+ to specify the `/accounts/{accountID}/transfers.read` scope.
38
46
  * [initiateRefund](#initiaterefund) - Initiate a refund for a card transfer.
39
47
 
40
48
  **Use the [Cancel or refund a card transfer](https://docs.moov.io/api/money-movement/refunds/cancel/) endpoint for more comprehensive cancel and refund options.**
@@ -511,6 +519,183 @@ run();
511
519
  | --------------- | --------------- | --------------- |
512
520
  | errors.APIError | 4XX, 5XX | \*/\* |
513
521
 
522
+ ## createCancellation
523
+
524
+ Initiate a cancellation for a card, ACH, or queued transfer.
525
+
526
+ To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
527
+ to specify the `/accounts/{accountID}/transfers.write` scope.
528
+
529
+ ### Example Usage
530
+
531
+ ```typescript
532
+ import { Moov } from "@moovio/sdk";
533
+
534
+ const moov = new Moov({
535
+ security: {
536
+ username: "",
537
+ password: "",
538
+ },
539
+ });
540
+
541
+ async function run() {
542
+ const result = await moov.transfers.createCancellation({
543
+ accountID: "12dbe811-b86d-497b-ae0f-fb7cfda35251",
544
+ transferID: "6bb9450c-10a9-4c8d-a8d2-d3fa18648706",
545
+ });
546
+
547
+ // Handle the result
548
+ console.log(result);
549
+ }
550
+
551
+ run();
552
+ ```
553
+
554
+ ### Standalone function
555
+
556
+ The standalone function version of this method:
557
+
558
+ ```typescript
559
+ import { MoovCore } from "@moovio/sdk/core.js";
560
+ import { transfersCreateCancellation } from "@moovio/sdk/funcs/transfersCreateCancellation.js";
561
+
562
+ // Use `MoovCore` for best tree-shaking performance.
563
+ // You can create one instance of it to use across an application.
564
+ const moov = new MoovCore({
565
+ security: {
566
+ username: "",
567
+ password: "",
568
+ },
569
+ });
570
+
571
+ async function run() {
572
+ const res = await transfersCreateCancellation(moov, {
573
+ accountID: "12dbe811-b86d-497b-ae0f-fb7cfda35251",
574
+ transferID: "6bb9450c-10a9-4c8d-a8d2-d3fa18648706",
575
+ });
576
+
577
+ if (!res.ok) {
578
+ throw res.error;
579
+ }
580
+
581
+ const { value: result } = res;
582
+
583
+ // Handle the result
584
+ console.log(result);
585
+ }
586
+
587
+ run();
588
+ ```
589
+
590
+ ### Parameters
591
+
592
+ | Parameter | Type | Required | Description |
593
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
594
+ | `request` | [operations.CreateCancellationRequest](../../models/operations/createcancellationrequest.md) | :heavy_check_mark: | The request object to use for the request. |
595
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
596
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
597
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
598
+
599
+ ### Response
600
+
601
+ **Promise\<[operations.CreateCancellationResponse](../../models/operations/createcancellationresponse.md)\>**
602
+
603
+ ### Errors
604
+
605
+ | Error Type | Status Code | Content Type |
606
+ | ------------------- | ------------------- | ------------------- |
607
+ | errors.GenericError | 400 | application/json |
608
+ | errors.APIError | 4XX, 5XX | \*/\* |
609
+
610
+ ## getCancellation
611
+
612
+ Get details of a cancellation for a transfer.
613
+
614
+ To access this endpoint using a [token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
615
+ to specify the `/accounts/{accountID}/transfers.read` scope.
616
+
617
+ ### Example Usage
618
+
619
+ ```typescript
620
+ import { Moov } from "@moovio/sdk";
621
+
622
+ const moov = new Moov({
623
+ security: {
624
+ username: "",
625
+ password: "",
626
+ },
627
+ });
628
+
629
+ async function run() {
630
+ const result = await moov.transfers.getCancellation({
631
+ accountID: "fe098575-0376-4404-9a9c-6fe55e3766af",
632
+ transferID: "b3b49c6a-9b74-4a85-9d49-864ada05cbf2",
633
+ cancellationID: "5848c1db-18ac-41eb-b107-b6499987902c",
634
+ });
635
+
636
+ // Handle the result
637
+ console.log(result);
638
+ }
639
+
640
+ run();
641
+ ```
642
+
643
+ ### Standalone function
644
+
645
+ The standalone function version of this method:
646
+
647
+ ```typescript
648
+ import { MoovCore } from "@moovio/sdk/core.js";
649
+ import { transfersGetCancellation } from "@moovio/sdk/funcs/transfersGetCancellation.js";
650
+
651
+ // Use `MoovCore` for best tree-shaking performance.
652
+ // You can create one instance of it to use across an application.
653
+ const moov = new MoovCore({
654
+ security: {
655
+ username: "",
656
+ password: "",
657
+ },
658
+ });
659
+
660
+ async function run() {
661
+ const res = await transfersGetCancellation(moov, {
662
+ accountID: "fe098575-0376-4404-9a9c-6fe55e3766af",
663
+ transferID: "b3b49c6a-9b74-4a85-9d49-864ada05cbf2",
664
+ cancellationID: "5848c1db-18ac-41eb-b107-b6499987902c",
665
+ });
666
+
667
+ if (!res.ok) {
668
+ throw res.error;
669
+ }
670
+
671
+ const { value: result } = res;
672
+
673
+ // Handle the result
674
+ console.log(result);
675
+ }
676
+
677
+ run();
678
+ ```
679
+
680
+ ### Parameters
681
+
682
+ | Parameter | Type | Required | Description |
683
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
684
+ | `request` | [operations.GetCancellationRequest](../../models/operations/getcancellationrequest.md) | :heavy_check_mark: | The request object to use for the request. |
685
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
686
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
687
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
688
+
689
+ ### Response
690
+
691
+ **Promise\<[operations.GetCancellationResponse](../../models/operations/getcancellationresponse.md)\>**
692
+
693
+ ### Errors
694
+
695
+ | Error Type | Status Code | Content Type |
696
+ | --------------- | --------------- | --------------- |
697
+ | errors.APIError | 4XX, 5XX | \*/\* |
698
+
514
699
  ## initiateRefund
515
700
 
516
701
  Initiate a refund for a card transfer.
@@ -0,0 +1,18 @@
1
+ import { MoovCore } from "../core.js";
2
+ import { RequestOptions } from "../lib/sdks.js";
3
+ import * as components from "../models/components/index.js";
4
+ import { APIError } from "../models/errors/apierror.js";
5
+ import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
6
+ import * as errors from "../models/errors/index.js";
7
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
8
+ import * as operations from "../models/operations/index.js";
9
+ import { APIPromise } from "../types/async.js";
10
+ import { Result } from "../types/fp.js";
11
+ /**
12
+ * Create receipts for transfers and scheduled transfers.
13
+ *
14
+ * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
15
+ * you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
16
+ */
17
+ export declare function receiptsCreate(client: MoovCore, request: Array<components.ReceiptRequest>, options?: RequestOptions): APIPromise<Result<operations.CreateReceiptsResponse, errors.GenericError | errors.ReceiptValidationError | APIError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
18
+ //# sourceMappingURL=receiptsCreate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receiptsCreate.d.ts","sourceRoot":"","sources":["../src/funcs/receiptsCreate.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKtC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,EACzC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,sBAAsB,EAC/B,MAAM,CAAC,YAAY,GACnB,MAAM,CAAC,sBAAsB,GAC7B,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CAMA"}
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.receiptsCreate = receiptsCreate;
40
+ const z = __importStar(require("zod"));
41
+ const encodings_js_1 = require("../lib/encodings.js");
42
+ const M = __importStar(require("../lib/matchers.js"));
43
+ const primitives_js_1 = require("../lib/primitives.js");
44
+ const schemas_js_1 = require("../lib/schemas.js");
45
+ const security_js_1 = require("../lib/security.js");
46
+ const url_js_1 = require("../lib/url.js");
47
+ const components = __importStar(require("../models/components/index.js"));
48
+ const errors = __importStar(require("../models/errors/index.js"));
49
+ const operations = __importStar(require("../models/operations/index.js"));
50
+ const async_js_1 = require("../types/async.js");
51
+ /**
52
+ * Create receipts for transfers and scheduled transfers.
53
+ *
54
+ * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
55
+ * you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
56
+ */
57
+ function receiptsCreate(client, request, options) {
58
+ return new async_js_1.APIPromise($do(client, request, options));
59
+ }
60
+ async function $do(client, request, options) {
61
+ const parsed = (0, schemas_js_1.safeParse)(request, (value) => z.array(components.ReceiptRequest$outboundSchema).parse(value), "Input validation failed");
62
+ if (!parsed.ok) {
63
+ return [parsed, { status: "invalid" }];
64
+ }
65
+ const payload = parsed.value;
66
+ const body = (0, encodings_js_1.encodeJSON)("body", payload, { explode: true });
67
+ const path = (0, url_js_1.pathToFunc)("/receipts")();
68
+ const headers = new Headers((0, primitives_js_1.compactMap)({
69
+ "Content-Type": "application/json",
70
+ Accept: "application/json",
71
+ "x-moov-version": (0, encodings_js_1.encodeSimple)("x-moov-version", client._options.xMoovVersion, { explode: false, charEncoding: "none" }),
72
+ }));
73
+ const securityInput = await (0, security_js_1.extractSecurity)(client._options.security);
74
+ const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
75
+ const context = {
76
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
77
+ operationID: "createReceipts",
78
+ oAuth2Scopes: [],
79
+ resolvedSecurity: requestSecurity,
80
+ securitySource: client._options.security,
81
+ retryConfig: options?.retries
82
+ || client._options.retryConfig
83
+ || { strategy: "none" },
84
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
85
+ };
86
+ const requestRes = client._createRequest(context, {
87
+ security: requestSecurity,
88
+ method: "POST",
89
+ baseURL: options?.serverURL,
90
+ path: path,
91
+ headers: headers,
92
+ body: body,
93
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
94
+ }, options);
95
+ if (!requestRes.ok) {
96
+ return [requestRes, { status: "invalid" }];
97
+ }
98
+ const req = requestRes.value;
99
+ const doResult = await client._do(req, {
100
+ context,
101
+ errorCodes: [
102
+ "400",
103
+ "401",
104
+ "403",
105
+ "404",
106
+ "409",
107
+ "422",
108
+ "429",
109
+ "4XX",
110
+ "500",
111
+ "504",
112
+ "5XX",
113
+ ],
114
+ retryConfig: context.retryConfig,
115
+ retryCodes: context.retryCodes,
116
+ });
117
+ if (!doResult.ok) {
118
+ return [doResult, { status: "request-error", request: req }];
119
+ }
120
+ const response = doResult.value;
121
+ const responseFields = {
122
+ HttpMeta: { Response: response, Request: req },
123
+ };
124
+ const [result] = await M.match(M.json(200, operations.CreateReceiptsResponse$inboundSchema, {
125
+ hdrs: true,
126
+ key: "Result",
127
+ }), M.jsonErr([400, 409], errors.GenericError$inboundSchema, { hdrs: true }), M.jsonErr(422, errors.ReceiptValidationError$inboundSchema, { hdrs: true }), M.fail([401, 403, 404, 429]), M.fail([500, 504]), M.fail("4XX"), M.fail("5XX"))(response, { extraFields: responseFields });
128
+ if (!result.ok) {
129
+ return [result, { status: "complete", request: req, response }];
130
+ }
131
+ return [result, { status: "complete", request: req, response }];
132
+ }
133
+ //# sourceMappingURL=receiptsCreate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receiptsCreate.js","sourceRoot":"","sources":["../src/funcs/receiptsCreate.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCH,wCAuBC;AArDD,uCAAyB;AAEzB,sDAA+D;AAC/D,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAC3C,0EAA4D;AAS5D,kEAAoD;AAEpD,0EAA4D;AAC5D,gDAAwD;AAGxD;;;;;GAKG;AACH,SAAgB,cAAc,CAC5B,MAAgB,EAChB,OAAyC,EACzC,OAAwB;IAexB,OAAO,IAAI,qBAAU,CAAC,GAAG,CACvB,MAAM,EACN,OAAO,EACP,OAAO,CACR,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,GAAG,CAChB,MAAgB,EAChB,OAAyC,EACzC,OAAwB;IAkBxB,MAAM,MAAM,GAAG,IAAA,sBAAS,EACtB,OAAO,EACP,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,6BAA6B,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EACzE,yBAAyB,CAC1B,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IACzC,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;IAC7B,MAAM,IAAI,GAAG,IAAA,yBAAU,EAAC,MAA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AA0B,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EACxE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,oCAAoC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAC3E,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,EAC5B,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAClB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EACb,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACd,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { MoovCore } from "../core.js";
2
+ import { RequestOptions } from "../lib/sdks.js";
3
+ import { APIError } from "../models/errors/apierror.js";
4
+ import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
5
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
6
+ import * as operations from "../models/operations/index.js";
7
+ import { APIPromise } from "../types/async.js";
8
+ import { Result } from "../types/fp.js";
9
+ /**
10
+ * List receipts by trasnferID, scheduleID, or occurrenceID.
11
+ *
12
+ * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
13
+ * you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
14
+ */
15
+ export declare function receiptsList(client: MoovCore, request: operations.ListReceiptsRequest, options?: RequestOptions): APIPromise<Result<operations.ListReceiptsResponse, APIError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
16
+ //# sourceMappingURL=receiptsList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receiptsList.d.ts","sourceRoot":"","sources":["../src/funcs/receiptsList.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKtC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,UAAU,CAAC,mBAAmB,EACvC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,oBAAoB,EAC7B,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CAMA"}