@moovio/sdk 0.6.1 → 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 (95) hide show
  1. package/README.md +19 -0
  2. package/bin/mcp-server.js +769 -272
  3. package/bin/mcp-server.js.map +20 -9
  4. package/docs/sdks/receipts/README.md +189 -0
  5. package/funcs/receiptsCreate.d.ts +18 -0
  6. package/funcs/receiptsCreate.d.ts.map +1 -0
  7. package/funcs/receiptsCreate.js +133 -0
  8. package/funcs/receiptsCreate.js.map +1 -0
  9. package/funcs/receiptsList.d.ts +16 -0
  10. package/funcs/receiptsList.d.ts.map +1 -0
  11. package/funcs/receiptsList.js +121 -0
  12. package/funcs/receiptsList.js.map +1 -0
  13. package/jsr.json +1 -1
  14. package/lib/config.d.ts +3 -3
  15. package/lib/config.js +3 -3
  16. package/mcp-server/mcp-server.js +1 -1
  17. package/mcp-server/server.d.ts.map +1 -1
  18. package/mcp-server/server.js +5 -1
  19. package/mcp-server/server.js.map +1 -1
  20. package/mcp-server/tools/receiptsCreate.d.ts +9 -0
  21. package/mcp-server/tools/receiptsCreate.d.ts.map +1 -0
  22. package/mcp-server/tools/receiptsCreate.js +66 -0
  23. package/mcp-server/tools/receiptsCreate.js.map +1 -0
  24. package/mcp-server/tools/receiptsList.d.ts +8 -0
  25. package/mcp-server/tools/receiptsList.d.ts.map +1 -0
  26. package/mcp-server/tools/receiptsList.js +65 -0
  27. package/mcp-server/tools/receiptsList.js.map +1 -0
  28. package/models/components/index.d.ts +4 -0
  29. package/models/components/index.d.ts.map +1 -1
  30. package/models/components/index.js +4 -0
  31. package/models/components/index.js.map +1 -1
  32. package/models/components/receiptkind.d.ts +31 -0
  33. package/models/components/receiptkind.d.ts.map +1 -0
  34. package/models/components/receiptkind.js +63 -0
  35. package/models/components/receiptkind.js.map +1 -0
  36. package/models/components/receiptrequest.d.ts +76 -0
  37. package/models/components/receiptrequest.d.ts.map +1 -0
  38. package/models/components/receiptrequest.js +80 -0
  39. package/models/components/receiptrequest.js.map +1 -0
  40. package/models/components/receiptresponse.d.ts +94 -0
  41. package/models/components/receiptresponse.d.ts.map +1 -0
  42. package/models/components/receiptresponse.js +90 -0
  43. package/models/components/receiptresponse.js.map +1 -0
  44. package/models/components/sentreceipt.d.ts +42 -0
  45. package/models/components/sentreceipt.d.ts.map +1 -0
  46. package/models/components/sentreceipt.js +73 -0
  47. package/models/components/sentreceipt.js.map +1 -0
  48. package/models/errors/index.d.ts +1 -0
  49. package/models/errors/index.d.ts.map +1 -1
  50. package/models/errors/index.js +1 -0
  51. package/models/errors/index.js.map +1 -1
  52. package/models/errors/receiptvalidationerror.d.ts +46 -0
  53. package/models/errors/receiptvalidationerror.d.ts.map +1 -0
  54. package/models/errors/receiptvalidationerror.js +98 -0
  55. package/models/errors/receiptvalidationerror.js.map +1 -0
  56. package/models/operations/createreceipts.d.ts +74 -0
  57. package/models/operations/createreceipts.d.ts.map +1 -0
  58. package/models/operations/createreceipts.js +118 -0
  59. package/models/operations/createreceipts.js.map +1 -0
  60. package/models/operations/index.d.ts +2 -0
  61. package/models/operations/index.d.ts.map +1 -1
  62. package/models/operations/index.js +2 -0
  63. package/models/operations/index.js.map +1 -1
  64. package/models/operations/listreceipts.d.ts +102 -0
  65. package/models/operations/listreceipts.d.ts.map +1 -0
  66. package/models/operations/listreceipts.js +145 -0
  67. package/models/operations/listreceipts.js.map +1 -0
  68. package/package.json +1 -1
  69. package/sdk/receipts.d.ts +20 -0
  70. package/sdk/receipts.d.ts.map +1 -0
  71. package/sdk/receipts.js +32 -0
  72. package/sdk/receipts.js.map +1 -0
  73. package/sdk/sdk.d.ts +3 -0
  74. package/sdk/sdk.d.ts.map +1 -1
  75. package/sdk/sdk.js +4 -0
  76. package/sdk/sdk.js.map +1 -1
  77. package/src/funcs/receiptsCreate.ts +190 -0
  78. package/src/funcs/receiptsList.ts +171 -0
  79. package/src/lib/config.ts +3 -3
  80. package/src/mcp-server/mcp-server.ts +1 -1
  81. package/src/mcp-server/server.ts +5 -1
  82. package/src/mcp-server/tools/receiptsCreate.ts +39 -0
  83. package/src/mcp-server/tools/receiptsList.ts +38 -0
  84. package/src/models/components/index.ts +4 -0
  85. package/src/models/components/receiptkind.ts +36 -0
  86. package/src/models/components/receiptrequest.ts +123 -0
  87. package/src/models/components/receiptresponse.ts +157 -0
  88. package/src/models/components/sentreceipt.ts +79 -0
  89. package/src/models/errors/index.ts +1 -0
  90. package/src/models/errors/receiptvalidationerror.ts +99 -0
  91. package/src/models/operations/createreceipts.ts +161 -0
  92. package/src/models/operations/index.ts +2 -0
  93. package/src/models/operations/listreceipts.ts +222 -0
  94. package/src/sdk/receipts.ts +46 -0
  95. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,79 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type SentReceipt = {
11
+ /**
12
+ * Unique identifier for the receipt.
13
+ */
14
+ receiptID: string;
15
+ /**
16
+ * The idempotency key used when creating the receipt.
17
+ */
18
+ idempotencyKey: string;
19
+ /**
20
+ * When the receipt was sent.
21
+ */
22
+ sentOn: Date;
23
+ };
24
+
25
+ /** @internal */
26
+ export const SentReceipt$inboundSchema: z.ZodType<
27
+ SentReceipt,
28
+ z.ZodTypeDef,
29
+ unknown
30
+ > = z.object({
31
+ receiptID: z.string(),
32
+ idempotencyKey: z.string(),
33
+ sentOn: z.string().datetime({ offset: true }).transform(v => new Date(v)),
34
+ });
35
+
36
+ /** @internal */
37
+ export type SentReceipt$Outbound = {
38
+ receiptID: string;
39
+ idempotencyKey: string;
40
+ sentOn: string;
41
+ };
42
+
43
+ /** @internal */
44
+ export const SentReceipt$outboundSchema: z.ZodType<
45
+ SentReceipt$Outbound,
46
+ z.ZodTypeDef,
47
+ SentReceipt
48
+ > = z.object({
49
+ receiptID: z.string(),
50
+ idempotencyKey: z.string(),
51
+ sentOn: z.date().transform(v => v.toISOString()),
52
+ });
53
+
54
+ /**
55
+ * @internal
56
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
57
+ */
58
+ export namespace SentReceipt$ {
59
+ /** @deprecated use `SentReceipt$inboundSchema` instead. */
60
+ export const inboundSchema = SentReceipt$inboundSchema;
61
+ /** @deprecated use `SentReceipt$outboundSchema` instead. */
62
+ export const outboundSchema = SentReceipt$outboundSchema;
63
+ /** @deprecated use `SentReceipt$Outbound` instead. */
64
+ export type Outbound = SentReceipt$Outbound;
65
+ }
66
+
67
+ export function sentReceiptToJSON(sentReceipt: SentReceipt): string {
68
+ return JSON.stringify(SentReceipt$outboundSchema.parse(sentReceipt));
69
+ }
70
+
71
+ export function sentReceiptFromJSON(
72
+ jsonString: string,
73
+ ): SafeParseResult<SentReceipt, SDKValidationError> {
74
+ return safeParse(
75
+ jsonString,
76
+ (x) => SentReceipt$inboundSchema.parse(JSON.parse(x)),
77
+ `Failed to parse 'SentReceipt' from JSON`,
78
+ );
79
+ }
@@ -22,6 +22,7 @@ export * from "./linkcarderror.js";
22
22
  export * from "./microdepositvalidationerror.js";
23
23
  export * from "./onboardinginviteerror.js";
24
24
  export * from "./patchsweepconfigerror.js";
25
+ export * from "./receiptvalidationerror.js";
25
26
  export * from "./refundvalidationerror.js";
26
27
  export * from "./representativevalidationerror.js";
27
28
  export * from "./requestcarderror.js";
@@ -0,0 +1,99 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+
7
+ export type ReceiptValidationErrorData = {
8
+ kind?: string | undefined;
9
+ email?: string | undefined;
10
+ emailAccountID?: string | undefined;
11
+ forTransferID?: string | undefined;
12
+ forScheduleID?: string | undefined;
13
+ forOccurrenceID?: string | undefined;
14
+ };
15
+
16
+ export class ReceiptValidationError extends Error {
17
+ kind?: string | undefined;
18
+ email?: string | undefined;
19
+ emailAccountID?: string | undefined;
20
+ forTransferID?: string | undefined;
21
+ forScheduleID?: string | undefined;
22
+ forOccurrenceID?: string | undefined;
23
+
24
+ /** The original data that was passed to this error instance. */
25
+ data$: ReceiptValidationErrorData;
26
+
27
+ constructor(err: ReceiptValidationErrorData) {
28
+ const message = "message" in err && typeof err.message === "string"
29
+ ? err.message
30
+ : `API error occurred: ${JSON.stringify(err)}`;
31
+ super(message);
32
+ this.data$ = err;
33
+
34
+ if (err.kind != null) this.kind = err.kind;
35
+ if (err.email != null) this.email = err.email;
36
+ if (err.emailAccountID != null) this.emailAccountID = err.emailAccountID;
37
+ if (err.forTransferID != null) this.forTransferID = err.forTransferID;
38
+ if (err.forScheduleID != null) this.forScheduleID = err.forScheduleID;
39
+ if (err.forOccurrenceID != null) this.forOccurrenceID = err.forOccurrenceID;
40
+
41
+ this.name = "ReceiptValidationError";
42
+ }
43
+ }
44
+
45
+ /** @internal */
46
+ export const ReceiptValidationError$inboundSchema: z.ZodType<
47
+ ReceiptValidationError,
48
+ z.ZodTypeDef,
49
+ unknown
50
+ > = z.object({
51
+ kind: z.string().optional(),
52
+ email: z.string().optional(),
53
+ emailAccountID: z.string().optional(),
54
+ forTransferID: z.string().optional(),
55
+ forScheduleID: z.string().optional(),
56
+ forOccurrenceID: z.string().optional(),
57
+ })
58
+ .transform((v) => {
59
+ return new ReceiptValidationError(v);
60
+ });
61
+
62
+ /** @internal */
63
+ export type ReceiptValidationError$Outbound = {
64
+ kind?: string | undefined;
65
+ email?: string | undefined;
66
+ emailAccountID?: string | undefined;
67
+ forTransferID?: string | undefined;
68
+ forScheduleID?: string | undefined;
69
+ forOccurrenceID?: string | undefined;
70
+ };
71
+
72
+ /** @internal */
73
+ export const ReceiptValidationError$outboundSchema: z.ZodType<
74
+ ReceiptValidationError$Outbound,
75
+ z.ZodTypeDef,
76
+ ReceiptValidationError
77
+ > = z.instanceof(ReceiptValidationError)
78
+ .transform(v => v.data$)
79
+ .pipe(z.object({
80
+ kind: z.string().optional(),
81
+ email: z.string().optional(),
82
+ emailAccountID: z.string().optional(),
83
+ forTransferID: z.string().optional(),
84
+ forScheduleID: z.string().optional(),
85
+ forOccurrenceID: z.string().optional(),
86
+ }));
87
+
88
+ /**
89
+ * @internal
90
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
91
+ */
92
+ export namespace ReceiptValidationError$ {
93
+ /** @deprecated use `ReceiptValidationError$inboundSchema` instead. */
94
+ export const inboundSchema = ReceiptValidationError$inboundSchema;
95
+ /** @deprecated use `ReceiptValidationError$outboundSchema` instead. */
96
+ export const outboundSchema = ReceiptValidationError$outboundSchema;
97
+ /** @deprecated use `ReceiptValidationError$Outbound` instead. */
98
+ export type Outbound = ReceiptValidationError$Outbound;
99
+ }
@@ -0,0 +1,161 @@
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 CreateReceiptsGlobals = {
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 CreateReceiptsResponse = {
30
+ headers: { [k: string]: Array<string> };
31
+ result: components.ReceiptResponse;
32
+ };
33
+
34
+ /** @internal */
35
+ export const CreateReceiptsGlobals$inboundSchema: z.ZodType<
36
+ CreateReceiptsGlobals,
37
+ z.ZodTypeDef,
38
+ unknown
39
+ > = z.object({
40
+ "x-moov-version": z.string().default("v2024.01.00"),
41
+ }).transform((v) => {
42
+ return remap$(v, {
43
+ "x-moov-version": "xMoovVersion",
44
+ });
45
+ });
46
+
47
+ /** @internal */
48
+ export type CreateReceiptsGlobals$Outbound = {
49
+ "x-moov-version": string;
50
+ };
51
+
52
+ /** @internal */
53
+ export const CreateReceiptsGlobals$outboundSchema: z.ZodType<
54
+ CreateReceiptsGlobals$Outbound,
55
+ z.ZodTypeDef,
56
+ CreateReceiptsGlobals
57
+ > = z.object({
58
+ xMoovVersion: z.string().default("v2024.01.00"),
59
+ }).transform((v) => {
60
+ return remap$(v, {
61
+ xMoovVersion: "x-moov-version",
62
+ });
63
+ });
64
+
65
+ /**
66
+ * @internal
67
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
68
+ */
69
+ export namespace CreateReceiptsGlobals$ {
70
+ /** @deprecated use `CreateReceiptsGlobals$inboundSchema` instead. */
71
+ export const inboundSchema = CreateReceiptsGlobals$inboundSchema;
72
+ /** @deprecated use `CreateReceiptsGlobals$outboundSchema` instead. */
73
+ export const outboundSchema = CreateReceiptsGlobals$outboundSchema;
74
+ /** @deprecated use `CreateReceiptsGlobals$Outbound` instead. */
75
+ export type Outbound = CreateReceiptsGlobals$Outbound;
76
+ }
77
+
78
+ export function createReceiptsGlobalsToJSON(
79
+ createReceiptsGlobals: CreateReceiptsGlobals,
80
+ ): string {
81
+ return JSON.stringify(
82
+ CreateReceiptsGlobals$outboundSchema.parse(createReceiptsGlobals),
83
+ );
84
+ }
85
+
86
+ export function createReceiptsGlobalsFromJSON(
87
+ jsonString: string,
88
+ ): SafeParseResult<CreateReceiptsGlobals, SDKValidationError> {
89
+ return safeParse(
90
+ jsonString,
91
+ (x) => CreateReceiptsGlobals$inboundSchema.parse(JSON.parse(x)),
92
+ `Failed to parse 'CreateReceiptsGlobals' from JSON`,
93
+ );
94
+ }
95
+
96
+ /** @internal */
97
+ export const CreateReceiptsResponse$inboundSchema: z.ZodType<
98
+ CreateReceiptsResponse,
99
+ z.ZodTypeDef,
100
+ unknown
101
+ > = z.object({
102
+ Headers: z.record(z.array(z.string())),
103
+ Result: components.ReceiptResponse$inboundSchema,
104
+ }).transform((v) => {
105
+ return remap$(v, {
106
+ "Headers": "headers",
107
+ "Result": "result",
108
+ });
109
+ });
110
+
111
+ /** @internal */
112
+ export type CreateReceiptsResponse$Outbound = {
113
+ Headers: { [k: string]: Array<string> };
114
+ Result: components.ReceiptResponse$Outbound;
115
+ };
116
+
117
+ /** @internal */
118
+ export const CreateReceiptsResponse$outboundSchema: z.ZodType<
119
+ CreateReceiptsResponse$Outbound,
120
+ z.ZodTypeDef,
121
+ CreateReceiptsResponse
122
+ > = z.object({
123
+ headers: z.record(z.array(z.string())),
124
+ result: components.ReceiptResponse$outboundSchema,
125
+ }).transform((v) => {
126
+ return remap$(v, {
127
+ headers: "Headers",
128
+ result: "Result",
129
+ });
130
+ });
131
+
132
+ /**
133
+ * @internal
134
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
135
+ */
136
+ export namespace CreateReceiptsResponse$ {
137
+ /** @deprecated use `CreateReceiptsResponse$inboundSchema` instead. */
138
+ export const inboundSchema = CreateReceiptsResponse$inboundSchema;
139
+ /** @deprecated use `CreateReceiptsResponse$outboundSchema` instead. */
140
+ export const outboundSchema = CreateReceiptsResponse$outboundSchema;
141
+ /** @deprecated use `CreateReceiptsResponse$Outbound` instead. */
142
+ export type Outbound = CreateReceiptsResponse$Outbound;
143
+ }
144
+
145
+ export function createReceiptsResponseToJSON(
146
+ createReceiptsResponse: CreateReceiptsResponse,
147
+ ): string {
148
+ return JSON.stringify(
149
+ CreateReceiptsResponse$outboundSchema.parse(createReceiptsResponse),
150
+ );
151
+ }
152
+
153
+ export function createReceiptsResponseFromJSON(
154
+ jsonString: string,
155
+ ): SafeParseResult<CreateReceiptsResponse, SDKValidationError> {
156
+ return safeParse(
157
+ jsonString,
158
+ (x) => CreateReceiptsResponse$inboundSchema.parse(JSON.parse(x)),
159
+ `Failed to parse 'CreateReceiptsResponse' from JSON`,
160
+ );
161
+ }
@@ -15,6 +15,7 @@ export * from "./createcancellation.js";
15
15
  export * from "./createfeeplanagreements.js";
16
16
  export * from "./createonboardinginvite.js";
17
17
  export * from "./createpaymentlink.js";
18
+ export * from "./createreceipts.js";
18
19
  export * from "./createrepresentative.js";
19
20
  export * from "./createreversal.js";
20
21
  export * from "./createschedule.js";
@@ -97,6 +98,7 @@ export * from "./listpartnerpricing.js";
97
98
  export * from "./listpartnerpricingagreements.js";
98
99
  export * from "./listpaymentlinks.js";
99
100
  export * from "./listpaymentmethods.js";
101
+ export * from "./listreceipts.js";
100
102
  export * from "./listrefunds.js";
101
103
  export * from "./listrepresentatives.js";
102
104
  export * from "./listschedules.js";
@@ -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(