@moovio/sdk 0.6.1 → 0.7.0

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 (127) hide show
  1. package/FUNCTIONS.md +1 -0
  2. package/README.md +25 -0
  3. package/bin/mcp-server.js +814 -275
  4. package/bin/mcp-server.js.map +26 -14
  5. package/docs/sdks/accounts/README.md +2 -0
  6. package/docs/sdks/onboarding/README.md +2 -0
  7. package/docs/sdks/receipts/README.md +189 -0
  8. package/funcs/receiptsCreate.d.ts +18 -0
  9. package/funcs/receiptsCreate.d.ts.map +1 -0
  10. package/funcs/receiptsCreate.js +133 -0
  11. package/funcs/receiptsCreate.js.map +1 -0
  12. package/funcs/receiptsList.d.ts +16 -0
  13. package/funcs/receiptsList.d.ts.map +1 -0
  14. package/funcs/receiptsList.js +121 -0
  15. package/funcs/receiptsList.js.map +1 -0
  16. package/jsr.json +1 -1
  17. package/lib/config.d.ts +3 -3
  18. package/lib/config.js +3 -3
  19. package/mcp-server/extensions.d.ts +9 -0
  20. package/mcp-server/extensions.d.ts.map +1 -0
  21. package/mcp-server/extensions.js +6 -0
  22. package/mcp-server/extensions.js.map +1 -0
  23. package/mcp-server/mcp-server.js +1 -1
  24. package/mcp-server/resources.d.ts +9 -4
  25. package/mcp-server/resources.d.ts.map +1 -1
  26. package/mcp-server/resources.js +36 -9
  27. package/mcp-server/resources.js.map +1 -1
  28. package/mcp-server/server.d.ts.map +1 -1
  29. package/mcp-server/server.js +10 -1
  30. package/mcp-server/server.js.map +1 -1
  31. package/mcp-server/tools/receiptsCreate.d.ts +9 -0
  32. package/mcp-server/tools/receiptsCreate.d.ts.map +1 -0
  33. package/mcp-server/tools/receiptsCreate.js +66 -0
  34. package/mcp-server/tools/receiptsCreate.js.map +1 -0
  35. package/mcp-server/tools/receiptsList.d.ts +8 -0
  36. package/mcp-server/tools/receiptsList.d.ts.map +1 -0
  37. package/mcp-server/tools/receiptsList.js +65 -0
  38. package/mcp-server/tools/receiptsList.js.map +1 -0
  39. package/models/components/achtransactiondetails.d.ts +2 -0
  40. package/models/components/achtransactiondetails.d.ts.map +1 -1
  41. package/models/components/achtransactiondetails.js +3 -0
  42. package/models/components/achtransactiondetails.js.map +1 -1
  43. package/models/components/achtransactionstatus.d.ts +3 -0
  44. package/models/components/achtransactionstatus.d.ts.map +1 -1
  45. package/models/components/achtransactionstatus.js +1 -0
  46. package/models/components/achtransactionstatus.js.map +1 -1
  47. package/models/components/createaccount.d.ts +6 -0
  48. package/models/components/createaccount.d.ts.map +1 -1
  49. package/models/components/createaccount.js +3 -0
  50. package/models/components/createaccount.js.map +1 -1
  51. package/models/components/createterminalapplication.d.ts +4 -4
  52. package/models/components/index.d.ts +4 -0
  53. package/models/components/index.d.ts.map +1 -1
  54. package/models/components/index.js +4 -0
  55. package/models/components/index.js.map +1 -1
  56. package/models/components/receiptkind.d.ts +31 -0
  57. package/models/components/receiptkind.d.ts.map +1 -0
  58. package/models/components/receiptkind.js +63 -0
  59. package/models/components/receiptkind.js.map +1 -0
  60. package/models/components/receiptrequest.d.ts +76 -0
  61. package/models/components/receiptrequest.d.ts.map +1 -0
  62. package/models/components/receiptrequest.js +80 -0
  63. package/models/components/receiptrequest.js.map +1 -0
  64. package/models/components/receiptresponse.d.ts +94 -0
  65. package/models/components/receiptresponse.d.ts.map +1 -0
  66. package/models/components/receiptresponse.js +90 -0
  67. package/models/components/receiptresponse.js.map +1 -0
  68. package/models/components/sentreceipt.d.ts +42 -0
  69. package/models/components/sentreceipt.d.ts.map +1 -0
  70. package/models/components/sentreceipt.js +73 -0
  71. package/models/components/sentreceipt.js.map +1 -0
  72. package/models/components/terminalapplication.d.ts +4 -4
  73. package/models/errors/index.d.ts +1 -0
  74. package/models/errors/index.d.ts.map +1 -1
  75. package/models/errors/index.js +1 -0
  76. package/models/errors/index.js.map +1 -1
  77. package/models/errors/receiptvalidationerror.d.ts +46 -0
  78. package/models/errors/receiptvalidationerror.d.ts.map +1 -0
  79. package/models/errors/receiptvalidationerror.js +98 -0
  80. package/models/errors/receiptvalidationerror.js.map +1 -0
  81. package/models/operations/createreceipts.d.ts +74 -0
  82. package/models/operations/createreceipts.d.ts.map +1 -0
  83. package/models/operations/createreceipts.js +118 -0
  84. package/models/operations/createreceipts.js.map +1 -0
  85. package/models/operations/index.d.ts +2 -0
  86. package/models/operations/index.d.ts.map +1 -1
  87. package/models/operations/index.js +2 -0
  88. package/models/operations/index.js.map +1 -1
  89. package/models/operations/listreceipts.d.ts +102 -0
  90. package/models/operations/listreceipts.d.ts.map +1 -0
  91. package/models/operations/listreceipts.js +145 -0
  92. package/models/operations/listreceipts.js.map +1 -0
  93. package/package.json +1 -1
  94. package/sdk/receipts.d.ts +20 -0
  95. package/sdk/receipts.d.ts.map +1 -0
  96. package/sdk/receipts.js +32 -0
  97. package/sdk/receipts.js.map +1 -0
  98. package/sdk/sdk.d.ts +3 -0
  99. package/sdk/sdk.d.ts.map +1 -1
  100. package/sdk/sdk.js +4 -0
  101. package/sdk/sdk.js.map +1 -1
  102. package/src/funcs/receiptsCreate.ts +190 -0
  103. package/src/funcs/receiptsList.ts +171 -0
  104. package/src/lib/config.ts +3 -3
  105. package/src/mcp-server/extensions.ts +13 -0
  106. package/src/mcp-server/mcp-server.ts +1 -1
  107. package/src/mcp-server/resources.ts +75 -14
  108. package/src/mcp-server/server.ts +20 -1
  109. package/src/mcp-server/tools/receiptsCreate.ts +39 -0
  110. package/src/mcp-server/tools/receiptsList.ts +38 -0
  111. package/src/models/components/achtransactiondetails.ts +5 -0
  112. package/src/models/components/achtransactionstatus.ts +1 -0
  113. package/src/models/components/createaccount.ts +8 -0
  114. package/src/models/components/createterminalapplication.ts +4 -4
  115. package/src/models/components/index.ts +4 -0
  116. package/src/models/components/receiptkind.ts +36 -0
  117. package/src/models/components/receiptrequest.ts +123 -0
  118. package/src/models/components/receiptresponse.ts +157 -0
  119. package/src/models/components/sentreceipt.ts +79 -0
  120. package/src/models/components/terminalapplication.ts +4 -4
  121. package/src/models/errors/index.ts +1 -0
  122. package/src/models/errors/receiptvalidationerror.ts +99 -0
  123. package/src/models/operations/createreceipts.ts +161 -0
  124. package/src/models/operations/index.ts +2 -0
  125. package/src/models/operations/listreceipts.ts +222 -0
  126. package/src/sdk/receipts.ts +46 -0
  127. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,222 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type ListReceiptsGlobals = {
13
+ /**
14
+ * Specify an API version.
15
+ *
16
+ * @remarks
17
+ *
18
+ * API versioning follows the format `vYYYY.QQ.BB`, where
19
+ * - `YYYY` is the year
20
+ * - `QQ` is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10)
21
+ * - `BB` is the build number, starting at `.01`, for subsequent builds in the same quarter.
22
+ * - For example, `v2024.01.00` is the initial release of the first quarter of 2024.
23
+ *
24
+ * The `latest` version represents the most recent development state. It may include breaking changes and should be treated as a beta release.
25
+ */
26
+ xMoovVersion?: string | undefined;
27
+ };
28
+
29
+ export type ListReceiptsRequest = {
30
+ /**
31
+ * The unique identifier to filter receipts by.
32
+ */
33
+ id?: string | undefined;
34
+ };
35
+
36
+ export type ListReceiptsResponse = {
37
+ headers: { [k: string]: Array<string> };
38
+ result: Array<components.ReceiptResponse>;
39
+ };
40
+
41
+ /** @internal */
42
+ export const ListReceiptsGlobals$inboundSchema: z.ZodType<
43
+ ListReceiptsGlobals,
44
+ z.ZodTypeDef,
45
+ unknown
46
+ > = z.object({
47
+ "x-moov-version": z.string().default("v2024.01.00"),
48
+ }).transform((v) => {
49
+ return remap$(v, {
50
+ "x-moov-version": "xMoovVersion",
51
+ });
52
+ });
53
+
54
+ /** @internal */
55
+ export type ListReceiptsGlobals$Outbound = {
56
+ "x-moov-version": string;
57
+ };
58
+
59
+ /** @internal */
60
+ export const ListReceiptsGlobals$outboundSchema: z.ZodType<
61
+ ListReceiptsGlobals$Outbound,
62
+ z.ZodTypeDef,
63
+ ListReceiptsGlobals
64
+ > = z.object({
65
+ xMoovVersion: z.string().default("v2024.01.00"),
66
+ }).transform((v) => {
67
+ return remap$(v, {
68
+ xMoovVersion: "x-moov-version",
69
+ });
70
+ });
71
+
72
+ /**
73
+ * @internal
74
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
75
+ */
76
+ export namespace ListReceiptsGlobals$ {
77
+ /** @deprecated use `ListReceiptsGlobals$inboundSchema` instead. */
78
+ export const inboundSchema = ListReceiptsGlobals$inboundSchema;
79
+ /** @deprecated use `ListReceiptsGlobals$outboundSchema` instead. */
80
+ export const outboundSchema = ListReceiptsGlobals$outboundSchema;
81
+ /** @deprecated use `ListReceiptsGlobals$Outbound` instead. */
82
+ export type Outbound = ListReceiptsGlobals$Outbound;
83
+ }
84
+
85
+ export function listReceiptsGlobalsToJSON(
86
+ listReceiptsGlobals: ListReceiptsGlobals,
87
+ ): string {
88
+ return JSON.stringify(
89
+ ListReceiptsGlobals$outboundSchema.parse(listReceiptsGlobals),
90
+ );
91
+ }
92
+
93
+ export function listReceiptsGlobalsFromJSON(
94
+ jsonString: string,
95
+ ): SafeParseResult<ListReceiptsGlobals, SDKValidationError> {
96
+ return safeParse(
97
+ jsonString,
98
+ (x) => ListReceiptsGlobals$inboundSchema.parse(JSON.parse(x)),
99
+ `Failed to parse 'ListReceiptsGlobals' from JSON`,
100
+ );
101
+ }
102
+
103
+ /** @internal */
104
+ export const ListReceiptsRequest$inboundSchema: z.ZodType<
105
+ ListReceiptsRequest,
106
+ z.ZodTypeDef,
107
+ unknown
108
+ > = z.object({
109
+ id: z.string().optional(),
110
+ });
111
+
112
+ /** @internal */
113
+ export type ListReceiptsRequest$Outbound = {
114
+ id?: string | undefined;
115
+ };
116
+
117
+ /** @internal */
118
+ export const ListReceiptsRequest$outboundSchema: z.ZodType<
119
+ ListReceiptsRequest$Outbound,
120
+ z.ZodTypeDef,
121
+ ListReceiptsRequest
122
+ > = z.object({
123
+ id: z.string().optional(),
124
+ });
125
+
126
+ /**
127
+ * @internal
128
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
129
+ */
130
+ export namespace ListReceiptsRequest$ {
131
+ /** @deprecated use `ListReceiptsRequest$inboundSchema` instead. */
132
+ export const inboundSchema = ListReceiptsRequest$inboundSchema;
133
+ /** @deprecated use `ListReceiptsRequest$outboundSchema` instead. */
134
+ export const outboundSchema = ListReceiptsRequest$outboundSchema;
135
+ /** @deprecated use `ListReceiptsRequest$Outbound` instead. */
136
+ export type Outbound = ListReceiptsRequest$Outbound;
137
+ }
138
+
139
+ export function listReceiptsRequestToJSON(
140
+ listReceiptsRequest: ListReceiptsRequest,
141
+ ): string {
142
+ return JSON.stringify(
143
+ ListReceiptsRequest$outboundSchema.parse(listReceiptsRequest),
144
+ );
145
+ }
146
+
147
+ export function listReceiptsRequestFromJSON(
148
+ jsonString: string,
149
+ ): SafeParseResult<ListReceiptsRequest, SDKValidationError> {
150
+ return safeParse(
151
+ jsonString,
152
+ (x) => ListReceiptsRequest$inboundSchema.parse(JSON.parse(x)),
153
+ `Failed to parse 'ListReceiptsRequest' from JSON`,
154
+ );
155
+ }
156
+
157
+ /** @internal */
158
+ export const ListReceiptsResponse$inboundSchema: z.ZodType<
159
+ ListReceiptsResponse,
160
+ z.ZodTypeDef,
161
+ unknown
162
+ > = z.object({
163
+ Headers: z.record(z.array(z.string())),
164
+ Result: z.array(components.ReceiptResponse$inboundSchema),
165
+ }).transform((v) => {
166
+ return remap$(v, {
167
+ "Headers": "headers",
168
+ "Result": "result",
169
+ });
170
+ });
171
+
172
+ /** @internal */
173
+ export type ListReceiptsResponse$Outbound = {
174
+ Headers: { [k: string]: Array<string> };
175
+ Result: Array<components.ReceiptResponse$Outbound>;
176
+ };
177
+
178
+ /** @internal */
179
+ export const ListReceiptsResponse$outboundSchema: z.ZodType<
180
+ ListReceiptsResponse$Outbound,
181
+ z.ZodTypeDef,
182
+ ListReceiptsResponse
183
+ > = z.object({
184
+ headers: z.record(z.array(z.string())),
185
+ result: z.array(components.ReceiptResponse$outboundSchema),
186
+ }).transform((v) => {
187
+ return remap$(v, {
188
+ headers: "Headers",
189
+ result: "Result",
190
+ });
191
+ });
192
+
193
+ /**
194
+ * @internal
195
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
196
+ */
197
+ export namespace ListReceiptsResponse$ {
198
+ /** @deprecated use `ListReceiptsResponse$inboundSchema` instead. */
199
+ export const inboundSchema = ListReceiptsResponse$inboundSchema;
200
+ /** @deprecated use `ListReceiptsResponse$outboundSchema` instead. */
201
+ export const outboundSchema = ListReceiptsResponse$outboundSchema;
202
+ /** @deprecated use `ListReceiptsResponse$Outbound` instead. */
203
+ export type Outbound = ListReceiptsResponse$Outbound;
204
+ }
205
+
206
+ export function listReceiptsResponseToJSON(
207
+ listReceiptsResponse: ListReceiptsResponse,
208
+ ): string {
209
+ return JSON.stringify(
210
+ ListReceiptsResponse$outboundSchema.parse(listReceiptsResponse),
211
+ );
212
+ }
213
+
214
+ export function listReceiptsResponseFromJSON(
215
+ jsonString: string,
216
+ ): SafeParseResult<ListReceiptsResponse, SDKValidationError> {
217
+ return safeParse(
218
+ jsonString,
219
+ (x) => ListReceiptsResponse$inboundSchema.parse(JSON.parse(x)),
220
+ `Failed to parse 'ListReceiptsResponse' from JSON`,
221
+ );
222
+ }
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { receiptsCreate } from "../funcs/receiptsCreate.js";
6
+ import { receiptsList } from "../funcs/receiptsList.js";
7
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
8
+ import * as components from "../models/components/index.js";
9
+ import * as operations from "../models/operations/index.js";
10
+ import { unwrapAsync } from "../types/fp.js";
11
+
12
+ export class Receipts extends ClientSDK {
13
+ /**
14
+ * Create receipts for transfers and scheduled transfers.
15
+ *
16
+ * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
17
+ * you'll need to specify the `/accounts/{accountID}/transfers.write` scope.
18
+ */
19
+ async create(
20
+ request: Array<components.ReceiptRequest>,
21
+ options?: RequestOptions,
22
+ ): Promise<operations.CreateReceiptsResponse> {
23
+ return unwrapAsync(receiptsCreate(
24
+ this,
25
+ request,
26
+ options,
27
+ ));
28
+ }
29
+
30
+ /**
31
+ * List receipts by trasnferID, scheduleID, or occurrenceID.
32
+ *
33
+ * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
34
+ * you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
35
+ */
36
+ async list(
37
+ request: operations.ListReceiptsRequest,
38
+ options?: RequestOptions,
39
+ ): Promise<operations.ListReceiptsResponse> {
40
+ return unwrapAsync(receiptsList(
41
+ this,
42
+ request,
43
+ options,
44
+ ));
45
+ }
46
+ }
package/src/sdk/sdk.ts CHANGED
@@ -26,6 +26,7 @@ import { Onboarding } from "./onboarding.js";
26
26
  import { PaymentLinks } from "./paymentlinks.js";
27
27
  import { PaymentMethods } from "./paymentmethods.js";
28
28
  import { Ping } from "./ping.js";
29
+ import { Receipts } from "./receipts.js";
29
30
  import { Representatives } from "./representatives.js";
30
31
  import { Scheduling } from "./scheduling.js";
31
32
  import { Sweeps } from "./sweeps.js";
@@ -188,6 +189,11 @@ export class Moov extends ClientSDK {
188
189
  return (this._ping ??= new Ping(this._options));
189
190
  }
190
191
 
192
+ private _receipts?: Receipts;
193
+ get receipts(): Receipts {
194
+ return (this._receipts ??= new Receipts(this._options));
195
+ }
196
+
191
197
  private _terminalApplications?: TerminalApplications;
192
198
  get terminalApplications(): TerminalApplications {
193
199
  return (this._terminalApplications ??= new TerminalApplications(