@moovio/sdk 0.0.0-dev.18 → 0.0.0-dev.19

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 (89) hide show
  1. package/README.md +71 -58
  2. package/bin/mcp-server.js +1244 -960
  3. package/bin/mcp-server.js.map +21 -13
  4. package/funcs/cardsGetMetadata.d.ts +21 -0
  5. package/funcs/cardsGetMetadata.d.ts.map +1 -0
  6. package/funcs/cardsGetMetadata.js +126 -0
  7. package/funcs/cardsGetMetadata.js.map +1 -0
  8. package/jsr.json +1 -1
  9. package/lib/config.d.ts +2 -2
  10. package/lib/config.js +2 -2
  11. package/mcp-server/mcp-server.js +1 -1
  12. package/mcp-server/server.d.ts.map +1 -1
  13. package/mcp-server/server.js +3 -1
  14. package/mcp-server/server.js.map +1 -1
  15. package/mcp-server/tools/cardsGetMetadata.d.ts +8 -0
  16. package/mcp-server/tools/cardsGetMetadata.d.ts.map +1 -0
  17. package/mcp-server/tools/cardsGetMetadata.js +67 -0
  18. package/mcp-server/tools/cardsGetMetadata.js.map +1 -0
  19. package/models/components/cardmetadata.d.ts +91 -0
  20. package/models/components/cardmetadata.d.ts.map +1 -0
  21. package/models/components/cardmetadata.js +85 -0
  22. package/models/components/cardmetadata.js.map +1 -0
  23. package/models/components/cardmetadatarequest.d.ts +30 -0
  24. package/models/components/cardmetadatarequest.d.ts.map +1 -0
  25. package/models/components/cardmetadatarequest.js +62 -0
  26. package/models/components/cardmetadatarequest.js.map +1 -0
  27. package/models/components/collectionpaymentmethodtype.d.ts +1 -0
  28. package/models/components/collectionpaymentmethodtype.d.ts.map +1 -1
  29. package/models/components/collectionpaymentmethodtype.js +1 -0
  30. package/models/components/collectionpaymentmethodtype.js.map +1 -1
  31. package/models/components/createreversal.d.ts +6 -0
  32. package/models/components/createreversal.d.ts.map +1 -1
  33. package/models/components/createreversal.js +3 -0
  34. package/models/components/createreversal.js.map +1 -1
  35. package/models/components/index.d.ts +4 -0
  36. package/models/components/index.d.ts.map +1 -1
  37. package/models/components/index.js +4 -0
  38. package/models/components/index.js.map +1 -1
  39. package/models/components/reversalamountdetails.d.ts +21 -0
  40. package/models/components/reversalamountdetails.d.ts.map +1 -0
  41. package/models/components/reversalamountdetails.js +60 -0
  42. package/models/components/reversalamountdetails.js.map +1 -0
  43. package/models/components/reversalamountdetailsvalidationerror.d.ts +17 -0
  44. package/models/components/reversalamountdetailsvalidationerror.d.ts.map +1 -0
  45. package/models/components/reversalamountdetailsvalidationerror.js +59 -0
  46. package/models/components/reversalamountdetailsvalidationerror.js.map +1 -0
  47. package/models/errors/cardmetadatarequesterror.d.ts +31 -0
  48. package/models/errors/cardmetadatarequesterror.d.ts.map +1 -0
  49. package/models/errors/cardmetadatarequesterror.js +85 -0
  50. package/models/errors/cardmetadatarequesterror.js.map +1 -0
  51. package/models/errors/index.d.ts +1 -0
  52. package/models/errors/index.d.ts.map +1 -1
  53. package/models/errors/index.js +1 -0
  54. package/models/errors/index.js.map +1 -1
  55. package/models/errors/reversalvalidationerror.d.ts +4 -0
  56. package/models/errors/reversalvalidationerror.d.ts.map +1 -1
  57. package/models/errors/reversalvalidationerror.js +6 -0
  58. package/models/errors/reversalvalidationerror.js.map +1 -1
  59. package/models/operations/getcardmetadata.d.ts +24 -0
  60. package/models/operations/getcardmetadata.d.ts.map +1 -0
  61. package/models/operations/getcardmetadata.js +72 -0
  62. package/models/operations/getcardmetadata.js.map +1 -0
  63. package/models/operations/index.d.ts +1 -0
  64. package/models/operations/index.d.ts.map +1 -1
  65. package/models/operations/index.js +1 -0
  66. package/models/operations/index.js.map +1 -1
  67. package/package.json +1 -1
  68. package/sdk/cards.d.ts +10 -0
  69. package/sdk/cards.d.ts.map +1 -1
  70. package/sdk/cards.js +12 -0
  71. package/sdk/cards.js.map +1 -1
  72. package/src/funcs/cardsGetMetadata.ts +184 -0
  73. package/src/lib/config.ts +2 -2
  74. package/src/mcp-server/mcp-server.ts +1 -1
  75. package/src/mcp-server/server.ts +3 -1
  76. package/src/mcp-server/tools/cardsGetMetadata.ts +41 -0
  77. package/src/models/components/cardmetadata.ts +160 -0
  78. package/src/models/components/cardmetadatarequest.ts +72 -0
  79. package/src/models/components/collectionpaymentmethodtype.ts +1 -0
  80. package/src/models/components/createreversal.ts +13 -0
  81. package/src/models/components/index.ts +4 -0
  82. package/src/models/components/reversalamountdetails.ts +61 -0
  83. package/src/models/components/reversalamountdetailsvalidationerror.ts +55 -0
  84. package/src/models/errors/cardmetadatarequesterror.ts +80 -0
  85. package/src/models/errors/index.ts +1 -0
  86. package/src/models/errors/reversalvalidationerror.ts +12 -0
  87. package/src/models/operations/getcardmetadata.ts +67 -0
  88. package/src/models/operations/index.ts +1 -0
  89. package/src/sdk/cards.ts +21 -0
@@ -0,0 +1,160 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import * as types from "../../types/primitives.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ CardBrand,
12
+ CardBrand$inboundSchema,
13
+ CardBrand$outboundSchema,
14
+ } from "./cardbrand.js";
15
+ import {
16
+ CardType,
17
+ CardType$inboundSchema,
18
+ CardType$outboundSchema,
19
+ } from "./cardtype.js";
20
+ import {
21
+ DomesticPullFromCard,
22
+ DomesticPullFromCard$inboundSchema,
23
+ DomesticPullFromCard$outboundSchema,
24
+ } from "./domesticpullfromcard.js";
25
+ import {
26
+ DomesticPushToCard,
27
+ DomesticPushToCard$inboundSchema,
28
+ DomesticPushToCard$outboundSchema,
29
+ } from "./domesticpushtocard.js";
30
+
31
+ /**
32
+ * Metadata describing a card.
33
+ */
34
+ export type CardMetadata = {
35
+ /**
36
+ * The first six to eight digits of the card number, which identifies the financial institution that issued the card.
37
+ */
38
+ bin: string;
39
+ /**
40
+ * The card brand.
41
+ */
42
+ brand: CardBrand;
43
+ /**
44
+ * The category or level of the card defined by the issuer.
45
+ *
46
+ * @remarks
47
+ * Examples include, but not limited to, "REWARDS", "TRADITIONAL REWARDS", "CLASSIC", and "CORPORATE PURCHASING".
48
+ */
49
+ cardCategory?: string | undefined;
50
+ /**
51
+ * The type of the card.
52
+ */
53
+ cardType: CardType;
54
+ /**
55
+ * If true, the card is for commercial use, or associated with a business.
56
+ *
57
+ * @remarks
58
+ * If false, the card is associated with a general consumer.
59
+ */
60
+ commercial?: boolean | undefined;
61
+ /**
62
+ * If true, the card issuing bank is regulated, and the scheme fees for debit transactions will be limited based on the Durbin Amendment.
63
+ *
64
+ * @remarks
65
+ * If false, the card issuing bank is not regulated, and the scheme fees will not be limited.
66
+ */
67
+ regulated?: boolean | undefined;
68
+ /**
69
+ * Financial institution that issued the card.
70
+ */
71
+ issuer?: string | undefined;
72
+ /**
73
+ * Country where the card was issued.
74
+ */
75
+ issuerCountry?: string | undefined;
76
+ /**
77
+ * Phone number of the issuer.
78
+ */
79
+ issuerPhone?: string | undefined;
80
+ /**
81
+ * URL of the issuer.
82
+ */
83
+ issuerURL?: string | undefined;
84
+ /**
85
+ * Indicates if the card supports domestic pull-from-card transfer.
86
+ */
87
+ domesticPullFromCard?: DomesticPullFromCard | undefined;
88
+ /**
89
+ * Indicates which level of domestic push-to-card transfer is supported by the card, if any.
90
+ */
91
+ domesticPushToCard?: DomesticPushToCard | undefined;
92
+ };
93
+
94
+ /** @internal */
95
+ export const CardMetadata$inboundSchema: z.ZodType<
96
+ CardMetadata,
97
+ z.ZodTypeDef,
98
+ unknown
99
+ > = z.object({
100
+ bin: types.string(),
101
+ brand: CardBrand$inboundSchema,
102
+ cardCategory: types.optional(types.string()),
103
+ cardType: CardType$inboundSchema,
104
+ commercial: types.optional(types.boolean()),
105
+ regulated: types.optional(types.boolean()),
106
+ issuer: types.optional(types.string()),
107
+ issuerCountry: types.optional(types.string()),
108
+ issuerPhone: types.optional(types.string()),
109
+ issuerURL: types.optional(types.string()),
110
+ domesticPullFromCard: types.optional(DomesticPullFromCard$inboundSchema),
111
+ domesticPushToCard: types.optional(DomesticPushToCard$inboundSchema),
112
+ });
113
+ /** @internal */
114
+ export type CardMetadata$Outbound = {
115
+ bin: string;
116
+ brand: string;
117
+ cardCategory?: string | undefined;
118
+ cardType: string;
119
+ commercial?: boolean | undefined;
120
+ regulated?: boolean | undefined;
121
+ issuer?: string | undefined;
122
+ issuerCountry?: string | undefined;
123
+ issuerPhone?: string | undefined;
124
+ issuerURL?: string | undefined;
125
+ domesticPullFromCard?: string | undefined;
126
+ domesticPushToCard?: string | undefined;
127
+ };
128
+
129
+ /** @internal */
130
+ export const CardMetadata$outboundSchema: z.ZodType<
131
+ CardMetadata$Outbound,
132
+ z.ZodTypeDef,
133
+ CardMetadata
134
+ > = z.object({
135
+ bin: z.string(),
136
+ brand: CardBrand$outboundSchema,
137
+ cardCategory: z.string().optional(),
138
+ cardType: CardType$outboundSchema,
139
+ commercial: z.boolean().optional(),
140
+ regulated: z.boolean().optional(),
141
+ issuer: z.string().optional(),
142
+ issuerCountry: z.string().optional(),
143
+ issuerPhone: z.string().optional(),
144
+ issuerURL: z.string().optional(),
145
+ domesticPullFromCard: DomesticPullFromCard$outboundSchema.optional(),
146
+ domesticPushToCard: DomesticPushToCard$outboundSchema.optional(),
147
+ });
148
+
149
+ export function cardMetadataToJSON(cardMetadata: CardMetadata): string {
150
+ return JSON.stringify(CardMetadata$outboundSchema.parse(cardMetadata));
151
+ }
152
+ export function cardMetadataFromJSON(
153
+ jsonString: string,
154
+ ): SafeParseResult<CardMetadata, SDKValidationError> {
155
+ return safeParse(
156
+ jsonString,
157
+ (x) => CardMetadata$inboundSchema.parse(JSON.parse(x)),
158
+ `Failed to parse 'CardMetadata' from JSON`,
159
+ );
160
+ }
@@ -0,0 +1,72 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import * as types from "../../types/primitives.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ E2EEToken,
12
+ E2EEToken$inboundSchema,
13
+ E2EEToken$Outbound,
14
+ E2EEToken$outboundSchema,
15
+ } from "./e2eetoken.js";
16
+
17
+ export type CardMetadataRequest = {
18
+ /**
19
+ * Wraps a compact-serialized JSON Web Encryption (JWE) token used for secure transmission of sensitive data (e.g., PCI information) through intermediaries.
20
+ *
21
+ * @remarks
22
+ * This token is encrypted using the public key from /end-to-end-keys and wraps an AES key. For details and examples, refer to our
23
+ * [GitHub repository](https://github.com/moovfinancial/moov-go/blob/main/examples/e2ee/e2ee_test.go).
24
+ */
25
+ e2ee?: E2EEToken | undefined;
26
+ /**
27
+ * The full card number (PAN).
28
+ */
29
+ cardNumber?: string | undefined;
30
+ };
31
+
32
+ /** @internal */
33
+ export const CardMetadataRequest$inboundSchema: z.ZodType<
34
+ CardMetadataRequest,
35
+ z.ZodTypeDef,
36
+ unknown
37
+ > = z.object({
38
+ e2ee: types.optional(E2EEToken$inboundSchema),
39
+ cardNumber: types.optional(types.string()),
40
+ });
41
+ /** @internal */
42
+ export type CardMetadataRequest$Outbound = {
43
+ e2ee?: E2EEToken$Outbound | undefined;
44
+ cardNumber?: string | undefined;
45
+ };
46
+
47
+ /** @internal */
48
+ export const CardMetadataRequest$outboundSchema: z.ZodType<
49
+ CardMetadataRequest$Outbound,
50
+ z.ZodTypeDef,
51
+ CardMetadataRequest
52
+ > = z.object({
53
+ e2ee: E2EEToken$outboundSchema.optional(),
54
+ cardNumber: z.string().optional(),
55
+ });
56
+
57
+ export function cardMetadataRequestToJSON(
58
+ cardMetadataRequest: CardMetadataRequest,
59
+ ): string {
60
+ return JSON.stringify(
61
+ CardMetadataRequest$outboundSchema.parse(cardMetadataRequest),
62
+ );
63
+ }
64
+ export function cardMetadataRequestFromJSON(
65
+ jsonString: string,
66
+ ): SafeParseResult<CardMetadataRequest, SDKValidationError> {
67
+ return safeParse(
68
+ jsonString,
69
+ (x) => CardMetadataRequest$inboundSchema.parse(JSON.parse(x)),
70
+ `Failed to parse 'CardMetadataRequest' from JSON`,
71
+ );
72
+ }
@@ -13,6 +13,7 @@ export const CollectionPaymentMethodType = {
13
13
  ApplePay: "apple-pay",
14
14
  CardPayment: "card-payment",
15
15
  AchDebitCollect: "ach-debit-collect",
16
+ GooglePay: "google-pay",
16
17
  } as const;
17
18
  /**
18
19
  * Payment methods allowed for collecting a payment.
@@ -7,12 +7,22 @@ import { safeParse } from "../../lib/schemas.js";
7
7
  import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import * as types from "../../types/primitives.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ ReversalAmountDetails,
12
+ ReversalAmountDetails$inboundSchema,
13
+ ReversalAmountDetails$Outbound,
14
+ ReversalAmountDetails$outboundSchema,
15
+ } from "./reversalamountdetails.js";
10
16
 
11
17
  export type CreateReversal = {
12
18
  /**
13
19
  * Amount to reverse in cents. Partial amounts will automatically trigger a refund instead of a cancellation.
14
20
  */
15
21
  amount: number;
22
+ /**
23
+ * Breakdown of the reversed amount.
24
+ */
25
+ amountDetails?: ReversalAmountDetails | undefined;
16
26
  };
17
27
 
18
28
  /** @internal */
@@ -22,10 +32,12 @@ export const CreateReversal$inboundSchema: z.ZodType<
22
32
  unknown
23
33
  > = z.object({
24
34
  amount: types.number(),
35
+ amountDetails: types.optional(ReversalAmountDetails$inboundSchema),
25
36
  });
26
37
  /** @internal */
27
38
  export type CreateReversal$Outbound = {
28
39
  amount: number;
40
+ amountDetails?: ReversalAmountDetails$Outbound | undefined;
29
41
  };
30
42
 
31
43
  /** @internal */
@@ -35,6 +47,7 @@ export const CreateReversal$outboundSchema: z.ZodType<
35
47
  CreateReversal
36
48
  > = z.object({
37
49
  amount: z.number().int(),
50
+ amountDetails: ReversalAmountDetails$outboundSchema.optional(),
38
51
  });
39
52
 
40
53
  export function createReversalToJSON(createReversal: CreateReversal): string {
@@ -110,6 +110,8 @@ export * from "./cardbrandfees.js";
110
110
  export * from "./cardexpiration.js";
111
111
  export * from "./cardexpirationerror.js";
112
112
  export * from "./cardissuingnetwork.js";
113
+ export * from "./cardmetadata.js";
114
+ export * from "./cardmetadatarequest.js";
113
115
  export * from "./cardpaymentdetails.js";
114
116
  export * from "./cardpaymentdetailserror.js";
115
117
  export * from "./cardpaymentpaymentmethod.js";
@@ -455,6 +457,8 @@ export * from "./resolutionlinkrecipient.js";
455
457
  export * from "./resolutionlinkstatus.js";
456
458
  export * from "./returnpolicytype.js";
457
459
  export * from "./reversal.js";
460
+ export * from "./reversalamountdetails.js";
461
+ export * from "./reversalamountdetailsvalidationerror.js";
458
462
  export * from "./reversedwithcancellation.js";
459
463
  export * from "./reversedwithrefund.js";
460
464
  export * from "./revoketokenrequest.js";
@@ -0,0 +1,61 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import * as types from "../../types/primitives.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ AmountDecimal,
12
+ AmountDecimal$inboundSchema,
13
+ AmountDecimal$Outbound,
14
+ AmountDecimal$outboundSchema,
15
+ } from "./amountdecimal.js";
16
+
17
+ export type ReversalAmountDetails = {
18
+ /**
19
+ * The amount of surcharge to refund. Should be proportionate to the surcharge on the original transfer. This does not reply if the reversal resulted in a cancellation instead of a refund
20
+ */
21
+ surcharge?: AmountDecimal | undefined;
22
+ };
23
+
24
+ /** @internal */
25
+ export const ReversalAmountDetails$inboundSchema: z.ZodType<
26
+ ReversalAmountDetails,
27
+ z.ZodTypeDef,
28
+ unknown
29
+ > = z.object({
30
+ surcharge: types.optional(AmountDecimal$inboundSchema),
31
+ });
32
+ /** @internal */
33
+ export type ReversalAmountDetails$Outbound = {
34
+ surcharge?: AmountDecimal$Outbound | undefined;
35
+ };
36
+
37
+ /** @internal */
38
+ export const ReversalAmountDetails$outboundSchema: z.ZodType<
39
+ ReversalAmountDetails$Outbound,
40
+ z.ZodTypeDef,
41
+ ReversalAmountDetails
42
+ > = z.object({
43
+ surcharge: AmountDecimal$outboundSchema.optional(),
44
+ });
45
+
46
+ export function reversalAmountDetailsToJSON(
47
+ reversalAmountDetails: ReversalAmountDetails,
48
+ ): string {
49
+ return JSON.stringify(
50
+ ReversalAmountDetails$outboundSchema.parse(reversalAmountDetails),
51
+ );
52
+ }
53
+ export function reversalAmountDetailsFromJSON(
54
+ jsonString: string,
55
+ ): SafeParseResult<ReversalAmountDetails, SDKValidationError> {
56
+ return safeParse(
57
+ jsonString,
58
+ (x) => ReversalAmountDetails$inboundSchema.parse(JSON.parse(x)),
59
+ `Failed to parse 'ReversalAmountDetails' from JSON`,
60
+ );
61
+ }
@@ -0,0 +1,55 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import * as types from "../../types/primitives.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type ReversalAmountDetailsValidationError = {
12
+ surcharge?: string | undefined;
13
+ };
14
+
15
+ /** @internal */
16
+ export const ReversalAmountDetailsValidationError$inboundSchema: z.ZodType<
17
+ ReversalAmountDetailsValidationError,
18
+ z.ZodTypeDef,
19
+ unknown
20
+ > = z.object({
21
+ surcharge: types.optional(types.string()),
22
+ });
23
+ /** @internal */
24
+ export type ReversalAmountDetailsValidationError$Outbound = {
25
+ surcharge?: string | undefined;
26
+ };
27
+
28
+ /** @internal */
29
+ export const ReversalAmountDetailsValidationError$outboundSchema: z.ZodType<
30
+ ReversalAmountDetailsValidationError$Outbound,
31
+ z.ZodTypeDef,
32
+ ReversalAmountDetailsValidationError
33
+ > = z.object({
34
+ surcharge: z.string().optional(),
35
+ });
36
+
37
+ export function reversalAmountDetailsValidationErrorToJSON(
38
+ reversalAmountDetailsValidationError: ReversalAmountDetailsValidationError,
39
+ ): string {
40
+ return JSON.stringify(
41
+ ReversalAmountDetailsValidationError$outboundSchema.parse(
42
+ reversalAmountDetailsValidationError,
43
+ ),
44
+ );
45
+ }
46
+ export function reversalAmountDetailsValidationErrorFromJSON(
47
+ jsonString: string,
48
+ ): SafeParseResult<ReversalAmountDetailsValidationError, SDKValidationError> {
49
+ return safeParse(
50
+ jsonString,
51
+ (x) =>
52
+ ReversalAmountDetailsValidationError$inboundSchema.parse(JSON.parse(x)),
53
+ `Failed to parse 'ReversalAmountDetailsValidationError' from JSON`,
54
+ );
55
+ }
@@ -0,0 +1,80 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import * as types from "../../types/primitives.js";
7
+ import * as components from "../components/index.js";
8
+ import { MoovError } from "./mooverror.js";
9
+
10
+ export type CardMetadataRequestErrorData = {
11
+ error?: string | undefined;
12
+ e2ee?: components.End2EndEncryptionError | undefined;
13
+ cardNumber?: string | undefined;
14
+ };
15
+
16
+ export class CardMetadataRequestError extends MoovError {
17
+ error?: string | undefined;
18
+ e2ee?: components.End2EndEncryptionError | undefined;
19
+ cardNumber?: string | undefined;
20
+
21
+ /** The original data that was passed to this error instance. */
22
+ data$: CardMetadataRequestErrorData;
23
+
24
+ constructor(
25
+ err: CardMetadataRequestErrorData,
26
+ httpMeta: { response: Response; request: Request; body: string },
27
+ ) {
28
+ const message = "message" in err && typeof err.message === "string"
29
+ ? err.message
30
+ : `API error occurred: ${JSON.stringify(err)}`;
31
+ super(message, httpMeta);
32
+ this.data$ = err;
33
+ if (err.error != null) this.error = err.error;
34
+ if (err.e2ee != null) this.e2ee = err.e2ee;
35
+ if (err.cardNumber != null) this.cardNumber = err.cardNumber;
36
+
37
+ this.name = "CardMetadataRequestError";
38
+ }
39
+ }
40
+
41
+ /** @internal */
42
+ export const CardMetadataRequestError$inboundSchema: z.ZodType<
43
+ CardMetadataRequestError,
44
+ z.ZodTypeDef,
45
+ unknown
46
+ > = z.object({
47
+ error: types.optional(types.string()),
48
+ e2ee: types.optional(components.End2EndEncryptionError$inboundSchema),
49
+ cardNumber: types.optional(types.string()),
50
+ request$: z.instanceof(Request),
51
+ response$: z.instanceof(Response),
52
+ body$: z.string(),
53
+ })
54
+ .transform((v) => {
55
+ return new CardMetadataRequestError(v, {
56
+ request: v.request$,
57
+ response: v.response$,
58
+ body: v.body$,
59
+ });
60
+ });
61
+
62
+ /** @internal */
63
+ export type CardMetadataRequestError$Outbound = {
64
+ error?: string | undefined;
65
+ e2ee?: components.End2EndEncryptionError$Outbound | undefined;
66
+ cardNumber?: string | undefined;
67
+ };
68
+
69
+ /** @internal */
70
+ export const CardMetadataRequestError$outboundSchema: z.ZodType<
71
+ CardMetadataRequestError$Outbound,
72
+ z.ZodTypeDef,
73
+ CardMetadataRequestError
74
+ > = z.instanceof(CardMetadataRequestError)
75
+ .transform(v => v.data$)
76
+ .pipe(z.object({
77
+ error: z.string().optional(),
78
+ e2ee: components.End2EndEncryptionError$outboundSchema.optional(),
79
+ cardNumber: z.string().optional(),
80
+ }));
@@ -10,6 +10,7 @@ export * from "./authtokenrequesterror.js";
10
10
  export * from "./bankaccountvalidationerror.js";
11
11
  export * from "./brandvalidationerror.js";
12
12
  export * from "./cardacquiringrefund.js";
13
+ export * from "./cardmetadatarequesterror.js";
13
14
  export * from "./connectaccountrequestvalidationerror.js";
14
15
  export * from "./createaccounterror.js";
15
16
  export * from "./createinvoiceerror.js";
@@ -4,14 +4,17 @@
4
4
 
5
5
  import * as z from "zod/v3";
6
6
  import * as types from "../../types/primitives.js";
7
+ import * as components from "../components/index.js";
7
8
  import { MoovError } from "./mooverror.js";
8
9
 
9
10
  export type ReversalValidationErrorData = {
10
11
  amount?: string | undefined;
12
+ amountDetails?: components.ReversalAmountDetailsValidationError | undefined;
11
13
  };
12
14
 
13
15
  export class ReversalValidationError extends MoovError {
14
16
  amount?: string | undefined;
17
+ amountDetails?: components.ReversalAmountDetailsValidationError | undefined;
15
18
 
16
19
  /** The original data that was passed to this error instance. */
17
20
  data$: ReversalValidationErrorData;
@@ -26,6 +29,7 @@ export class ReversalValidationError extends MoovError {
26
29
  super(message, httpMeta);
27
30
  this.data$ = err;
28
31
  if (err.amount != null) this.amount = err.amount;
32
+ if (err.amountDetails != null) this.amountDetails = err.amountDetails;
29
33
 
30
34
  this.name = "ReversalValidationError";
31
35
  }
@@ -38,6 +42,9 @@ export const ReversalValidationError$inboundSchema: z.ZodType<
38
42
  unknown
39
43
  > = z.object({
40
44
  amount: types.optional(types.string()),
45
+ amountDetails: types.optional(
46
+ components.ReversalAmountDetailsValidationError$inboundSchema,
47
+ ),
41
48
  request$: z.instanceof(Request),
42
49
  response$: z.instanceof(Response),
43
50
  body$: z.string(),
@@ -53,6 +60,9 @@ export const ReversalValidationError$inboundSchema: z.ZodType<
53
60
  /** @internal */
54
61
  export type ReversalValidationError$Outbound = {
55
62
  amount?: string | undefined;
63
+ amountDetails?:
64
+ | components.ReversalAmountDetailsValidationError$Outbound
65
+ | undefined;
56
66
  };
57
67
 
58
68
  /** @internal */
@@ -64,4 +74,6 @@ export const ReversalValidationError$outboundSchema: z.ZodType<
64
74
  .transform(v => v.data$)
65
75
  .pipe(z.object({
66
76
  amount: z.string().optional(),
77
+ amountDetails: components
78
+ .ReversalAmountDetailsValidationError$outboundSchema.optional(),
67
79
  }));
@@ -0,0 +1,67 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
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 GetCardMetadataResponse = {
13
+ headers: { [k: string]: Array<string> };
14
+ result: components.CardMetadata;
15
+ };
16
+
17
+ /** @internal */
18
+ export const GetCardMetadataResponse$inboundSchema: z.ZodType<
19
+ GetCardMetadataResponse,
20
+ z.ZodTypeDef,
21
+ unknown
22
+ > = z.object({
23
+ Headers: z.record(z.array(z.string())).default({}),
24
+ Result: components.CardMetadata$inboundSchema,
25
+ }).transform((v) => {
26
+ return remap$(v, {
27
+ "Headers": "headers",
28
+ "Result": "result",
29
+ });
30
+ });
31
+ /** @internal */
32
+ export type GetCardMetadataResponse$Outbound = {
33
+ Headers: { [k: string]: Array<string> };
34
+ Result: components.CardMetadata$Outbound;
35
+ };
36
+
37
+ /** @internal */
38
+ export const GetCardMetadataResponse$outboundSchema: z.ZodType<
39
+ GetCardMetadataResponse$Outbound,
40
+ z.ZodTypeDef,
41
+ GetCardMetadataResponse
42
+ > = z.object({
43
+ headers: z.record(z.array(z.string())),
44
+ result: components.CardMetadata$outboundSchema,
45
+ }).transform((v) => {
46
+ return remap$(v, {
47
+ headers: "Headers",
48
+ result: "Result",
49
+ });
50
+ });
51
+
52
+ export function getCardMetadataResponseToJSON(
53
+ getCardMetadataResponse: GetCardMetadataResponse,
54
+ ): string {
55
+ return JSON.stringify(
56
+ GetCardMetadataResponse$outboundSchema.parse(getCardMetadataResponse),
57
+ );
58
+ }
59
+ export function getCardMetadataResponseFromJSON(
60
+ jsonString: string,
61
+ ): SafeParseResult<GetCardMetadataResponse, SDKValidationError> {
62
+ return safeParse(
63
+ jsonString,
64
+ (x) => GetCardMetadataResponse$inboundSchema.parse(JSON.parse(x)),
65
+ `Failed to parse 'GetCardMetadataResponse' from JSON`,
66
+ );
67
+ }
@@ -60,6 +60,7 @@ export * from "./getbrand.js";
60
60
  export * from "./getcancellation.js";
61
61
  export * from "./getcapability.js";
62
62
  export * from "./getcard.js";
63
+ export * from "./getcardmetadata.js";
63
64
  export * from "./getdispute.js";
64
65
  export * from "./getdisputeevidence.js";
65
66
  export * from "./getdisputeevidencedata.js";
package/src/sdk/cards.ts CHANGED
@@ -4,10 +4,12 @@
4
4
 
5
5
  import { cardsDisable } from "../funcs/cardsDisable.js";
6
6
  import { cardsGet } from "../funcs/cardsGet.js";
7
+ import { cardsGetMetadata } from "../funcs/cardsGetMetadata.js";
7
8
  import { cardsLink } from "../funcs/cardsLink.js";
8
9
  import { cardsList } from "../funcs/cardsList.js";
9
10
  import { cardsUpdate } from "../funcs/cardsUpdate.js";
10
11
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
12
+ import * as components from "../models/components/index.js";
11
13
  import * as operations from "../models/operations/index.js";
12
14
  import { unwrapAsync } from "../types/fp.js";
13
15
 
@@ -123,4 +125,23 @@ export class Cards extends ClientSDK {
123
125
  options,
124
126
  ));
125
127
  }
128
+
129
+ /**
130
+ * Look up metadata for a card without linking it to a Moov account.
131
+ *
132
+ * Only use this endpoint if you have provided Moov with a copy of your PCI attestation of compliance.
133
+ *
134
+ * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
135
+ * you'll need to specify the `/card-metadata.read` scope.
136
+ */
137
+ async getMetadata(
138
+ request: components.CardMetadataRequest,
139
+ options?: RequestOptions,
140
+ ): Promise<operations.GetCardMetadataResponse> {
141
+ return unwrapAsync(cardsGetMetadata(
142
+ this,
143
+ request,
144
+ options,
145
+ ));
146
+ }
126
147
  }