@gr4vy/sdk 1.9.11 → 1.9.13

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 (107) hide show
  1. package/README.md +11 -0
  2. package/examples/package-lock.json +1 -1
  3. package/funcs/threeDsScenariosCreate.d.ts +18 -0
  4. package/funcs/threeDsScenariosCreate.d.ts.map +1 -0
  5. package/funcs/threeDsScenariosCreate.js +141 -0
  6. package/funcs/threeDsScenariosCreate.js.map +1 -0
  7. package/funcs/threeDsScenariosDelete.d.ts +17 -0
  8. package/funcs/threeDsScenariosDelete.d.ts.map +1 -0
  9. package/funcs/threeDsScenariosDelete.js +141 -0
  10. package/funcs/threeDsScenariosDelete.js.map +1 -0
  11. package/funcs/threeDsScenariosList.d.ts +21 -0
  12. package/funcs/threeDsScenariosList.d.ts.map +1 -0
  13. package/funcs/threeDsScenariosList.js +177 -0
  14. package/funcs/threeDsScenariosList.js.map +1 -0
  15. package/funcs/threeDsScenariosUpdate.d.ts +18 -0
  16. package/funcs/threeDsScenariosUpdate.d.ts.map +1 -0
  17. package/funcs/threeDsScenariosUpdate.js +145 -0
  18. package/funcs/threeDsScenariosUpdate.js.map +1 -0
  19. package/jsr.json +1 -1
  20. package/lib/config.d.ts +3 -3
  21. package/lib/config.js +3 -3
  22. package/models/components/index.d.ts +8 -0
  23. package/models/components/index.d.ts.map +1 -1
  24. package/models/components/index.js +8 -0
  25. package/models/components/index.js.map +1 -1
  26. package/models/components/threedsecurescenario.d.ts +33 -0
  27. package/models/components/threedsecurescenario.d.ts.map +1 -0
  28. package/models/components/threedsecurescenario.js +65 -0
  29. package/models/components/threedsecurescenario.js.map +1 -0
  30. package/models/components/threedsecurescenarioconditions.d.ts +45 -0
  31. package/models/components/threedsecurescenarioconditions.d.ts.map +1 -0
  32. package/models/components/threedsecurescenarioconditions.js +85 -0
  33. package/models/components/threedsecurescenarioconditions.js.map +1 -0
  34. package/models/components/threedsecurescenariocreate.d.ts +16 -0
  35. package/models/components/threedsecurescenariocreate.d.ts.map +1 -0
  36. package/models/components/threedsecurescenariocreate.js +52 -0
  37. package/models/components/threedsecurescenariocreate.js.map +1 -0
  38. package/models/components/threedsecurescenariooutcome.d.ts +29 -0
  39. package/models/components/threedsecurescenariooutcome.d.ts.map +1 -0
  40. package/models/components/threedsecurescenariooutcome.js +66 -0
  41. package/models/components/threedsecurescenariooutcome.js.map +1 -0
  42. package/models/components/threedsecurescenariooutcomeauthentication.d.ts +41 -0
  43. package/models/components/threedsecurescenariooutcomeauthentication.d.ts.map +1 -0
  44. package/models/components/threedsecurescenariooutcomeauthentication.js +84 -0
  45. package/models/components/threedsecurescenariooutcomeauthentication.js.map +1 -0
  46. package/models/components/threedsecurescenariooutcomeresult.d.ts +37 -0
  47. package/models/components/threedsecurescenariooutcomeresult.d.ts.map +1 -0
  48. package/models/components/threedsecurescenariooutcomeresult.js +80 -0
  49. package/models/components/threedsecurescenariooutcomeresult.js.map +1 -0
  50. package/models/components/threedsecurescenarios.d.ts +26 -0
  51. package/models/components/threedsecurescenarios.d.ts.map +1 -0
  52. package/models/components/threedsecurescenarios.js +60 -0
  53. package/models/components/threedsecurescenarios.js.map +1 -0
  54. package/models/components/threedsecurescenarioupdate.d.ts +22 -0
  55. package/models/components/threedsecurescenarioupdate.d.ts.map +1 -0
  56. package/models/components/threedsecurescenarioupdate.js +53 -0
  57. package/models/components/threedsecurescenarioupdate.js.map +1 -0
  58. package/models/operations/createthreedsscenario.d.ts +21 -0
  59. package/models/operations/createthreedsscenario.d.ts.map +1 -0
  60. package/models/operations/createthreedsscenario.js +56 -0
  61. package/models/operations/createthreedsscenario.js.map +1 -0
  62. package/models/operations/deletethreedsscenario.d.ts +23 -0
  63. package/models/operations/deletethreedsscenario.d.ts.map +1 -0
  64. package/models/operations/deletethreedsscenario.js +55 -0
  65. package/models/operations/deletethreedsscenario.js.map +1 -0
  66. package/models/operations/getthreedsscenario.d.ts +37 -0
  67. package/models/operations/getthreedsscenario.d.ts.map +1 -0
  68. package/models/operations/getthreedsscenario.js +66 -0
  69. package/models/operations/getthreedsscenario.js.map +1 -0
  70. package/models/operations/index.d.ts +4 -0
  71. package/models/operations/index.d.ts.map +1 -1
  72. package/models/operations/index.js +4 -0
  73. package/models/operations/index.js.map +1 -1
  74. package/models/operations/updatethreedsscenario.d.ts +26 -0
  75. package/models/operations/updatethreedsscenario.d.ts.map +1 -0
  76. package/models/operations/updatethreedsscenario.js +58 -0
  77. package/models/operations/updatethreedsscenario.js.map +1 -0
  78. package/package.json +1 -1
  79. package/sdk/sdk.d.ts +3 -0
  80. package/sdk/sdk.d.ts.map +1 -1
  81. package/sdk/sdk.js +4 -0
  82. package/sdk/sdk.js.map +1 -1
  83. package/sdk/threedsscenarios.d.ts +37 -0
  84. package/sdk/threedsscenarios.d.ts.map +1 -0
  85. package/sdk/threedsscenarios.js +53 -0
  86. package/sdk/threedsscenarios.js.map +1 -0
  87. package/src/funcs/threeDsScenariosCreate.ts +245 -0
  88. package/src/funcs/threeDsScenariosDelete.ts +252 -0
  89. package/src/funcs/threeDsScenariosList.ts +337 -0
  90. package/src/funcs/threeDsScenariosUpdate.ts +259 -0
  91. package/src/lib/config.ts +3 -3
  92. package/src/models/components/index.ts +8 -0
  93. package/src/models/components/threedsecurescenario.ts +73 -0
  94. package/src/models/components/threedsecurescenarioconditions.ts +108 -0
  95. package/src/models/components/threedsecurescenariocreate.ts +44 -0
  96. package/src/models/components/threedsecurescenariooutcome.ts +81 -0
  97. package/src/models/components/threedsecurescenariooutcomeauthentication.ts +114 -0
  98. package/src/models/components/threedsecurescenariooutcomeresult.ts +103 -0
  99. package/src/models/components/threedsecurescenarios.ts +59 -0
  100. package/src/models/components/threedsecurescenarioupdate.ts +51 -0
  101. package/src/models/operations/createthreedsscenario.ts +50 -0
  102. package/src/models/operations/deletethreedsscenario.ts +51 -0
  103. package/src/models/operations/getthreedsscenario.ts +82 -0
  104. package/src/models/operations/index.ts +4 -0
  105. package/src/models/operations/updatethreedsscenario.ts +57 -0
  106. package/src/sdk/sdk.ts +6 -0
  107. package/src/sdk/threedsscenarios.ts +97 -0
@@ -0,0 +1,108 @@
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type ThreeDSecureScenarioConditions = {
12
+ /**
13
+ * First name of the buyer to match.
14
+ */
15
+ firstName?: string | null | undefined;
16
+ /**
17
+ * Last name of the buyer to match.
18
+ */
19
+ lastName?: string | null | undefined;
20
+ /**
21
+ * Email address of the buyer to match.
22
+ */
23
+ emailAddress?: string | null | undefined;
24
+ /**
25
+ * Amount of the transaction to match.
26
+ */
27
+ amount?: number | null | undefined;
28
+ /**
29
+ * External identifier to match.
30
+ */
31
+ externalIdentifier?: string | null | undefined;
32
+ /**
33
+ * Card number to match.
34
+ */
35
+ cardNumber?: string | null | undefined;
36
+ };
37
+
38
+ /** @internal */
39
+ export const ThreeDSecureScenarioConditions$inboundSchema: z.ZodType<
40
+ ThreeDSecureScenarioConditions,
41
+ z.ZodTypeDef,
42
+ unknown
43
+ > = z.object({
44
+ first_name: z.nullable(z.string()).optional(),
45
+ last_name: z.nullable(z.string()).optional(),
46
+ email_address: z.nullable(z.string()).optional(),
47
+ amount: z.nullable(z.number().int()).optional(),
48
+ external_identifier: z.nullable(z.string()).optional(),
49
+ card_number: z.nullable(z.string()).optional(),
50
+ }).transform((v) => {
51
+ return remap$(v, {
52
+ "first_name": "firstName",
53
+ "last_name": "lastName",
54
+ "email_address": "emailAddress",
55
+ "external_identifier": "externalIdentifier",
56
+ "card_number": "cardNumber",
57
+ });
58
+ });
59
+ /** @internal */
60
+ export type ThreeDSecureScenarioConditions$Outbound = {
61
+ first_name?: string | null | undefined;
62
+ last_name?: string | null | undefined;
63
+ email_address?: string | null | undefined;
64
+ amount?: number | null | undefined;
65
+ external_identifier?: string | null | undefined;
66
+ card_number?: string | null | undefined;
67
+ };
68
+
69
+ /** @internal */
70
+ export const ThreeDSecureScenarioConditions$outboundSchema: z.ZodType<
71
+ ThreeDSecureScenarioConditions$Outbound,
72
+ z.ZodTypeDef,
73
+ ThreeDSecureScenarioConditions
74
+ > = z.object({
75
+ firstName: z.nullable(z.string()).optional(),
76
+ lastName: z.nullable(z.string()).optional(),
77
+ emailAddress: z.nullable(z.string()).optional(),
78
+ amount: z.nullable(z.number().int()).optional(),
79
+ externalIdentifier: z.nullable(z.string()).optional(),
80
+ cardNumber: z.nullable(z.string()).optional(),
81
+ }).transform((v) => {
82
+ return remap$(v, {
83
+ firstName: "first_name",
84
+ lastName: "last_name",
85
+ emailAddress: "email_address",
86
+ externalIdentifier: "external_identifier",
87
+ cardNumber: "card_number",
88
+ });
89
+ });
90
+
91
+ export function threeDSecureScenarioConditionsToJSON(
92
+ threeDSecureScenarioConditions: ThreeDSecureScenarioConditions,
93
+ ): string {
94
+ return JSON.stringify(
95
+ ThreeDSecureScenarioConditions$outboundSchema.parse(
96
+ threeDSecureScenarioConditions,
97
+ ),
98
+ );
99
+ }
100
+ export function threeDSecureScenarioConditionsFromJSON(
101
+ jsonString: string,
102
+ ): SafeParseResult<ThreeDSecureScenarioConditions, SDKValidationError> {
103
+ return safeParse(
104
+ jsonString,
105
+ (x) => ThreeDSecureScenarioConditions$inboundSchema.parse(JSON.parse(x)),
106
+ `Failed to parse 'ThreeDSecureScenarioConditions' from JSON`,
107
+ );
108
+ }
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import {
7
+ ThreeDSecureScenarioConditions,
8
+ ThreeDSecureScenarioConditions$Outbound,
9
+ ThreeDSecureScenarioConditions$outboundSchema,
10
+ } from "./threedsecurescenarioconditions.js";
11
+ import {
12
+ ThreeDSecureScenarioOutcome,
13
+ ThreeDSecureScenarioOutcome$Outbound,
14
+ ThreeDSecureScenarioOutcome$outboundSchema,
15
+ } from "./threedsecurescenariooutcome.js";
16
+
17
+ export type ThreeDSecureScenarioCreate = {
18
+ conditions: ThreeDSecureScenarioConditions;
19
+ outcome: ThreeDSecureScenarioOutcome;
20
+ };
21
+
22
+ /** @internal */
23
+ export type ThreeDSecureScenarioCreate$Outbound = {
24
+ conditions: ThreeDSecureScenarioConditions$Outbound;
25
+ outcome: ThreeDSecureScenarioOutcome$Outbound;
26
+ };
27
+
28
+ /** @internal */
29
+ export const ThreeDSecureScenarioCreate$outboundSchema: z.ZodType<
30
+ ThreeDSecureScenarioCreate$Outbound,
31
+ z.ZodTypeDef,
32
+ ThreeDSecureScenarioCreate
33
+ > = z.object({
34
+ conditions: ThreeDSecureScenarioConditions$outboundSchema,
35
+ outcome: ThreeDSecureScenarioOutcome$outboundSchema,
36
+ });
37
+
38
+ export function threeDSecureScenarioCreateToJSON(
39
+ threeDSecureScenarioCreate: ThreeDSecureScenarioCreate,
40
+ ): string {
41
+ return JSON.stringify(
42
+ ThreeDSecureScenarioCreate$outboundSchema.parse(threeDSecureScenarioCreate),
43
+ );
44
+ }
@@ -0,0 +1,81 @@
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ ThreeDSecureScenarioOutcomeAuthentication,
11
+ ThreeDSecureScenarioOutcomeAuthentication$inboundSchema,
12
+ ThreeDSecureScenarioOutcomeAuthentication$Outbound,
13
+ ThreeDSecureScenarioOutcomeAuthentication$outboundSchema,
14
+ } from "./threedsecurescenariooutcomeauthentication.js";
15
+ import {
16
+ ThreeDSecureScenarioOutcomeResult,
17
+ ThreeDSecureScenarioOutcomeResult$inboundSchema,
18
+ ThreeDSecureScenarioOutcomeResult$Outbound,
19
+ ThreeDSecureScenarioOutcomeResult$outboundSchema,
20
+ } from "./threedsecurescenariooutcomeresult.js";
21
+
22
+ export type ThreeDSecureScenarioOutcome = {
23
+ /**
24
+ * The version of 3DS which will be simulated.
25
+ */
26
+ version: string;
27
+ authentication: ThreeDSecureScenarioOutcomeAuthentication;
28
+ /**
29
+ * 3DS result value. Required if authentication status is "C".
30
+ */
31
+ result?: ThreeDSecureScenarioOutcomeResult | null | undefined;
32
+ };
33
+
34
+ /** @internal */
35
+ export const ThreeDSecureScenarioOutcome$inboundSchema: z.ZodType<
36
+ ThreeDSecureScenarioOutcome,
37
+ z.ZodTypeDef,
38
+ unknown
39
+ > = z.object({
40
+ version: z.string(),
41
+ authentication: ThreeDSecureScenarioOutcomeAuthentication$inboundSchema,
42
+ result: z.nullable(ThreeDSecureScenarioOutcomeResult$inboundSchema)
43
+ .optional(),
44
+ });
45
+ /** @internal */
46
+ export type ThreeDSecureScenarioOutcome$Outbound = {
47
+ version: string;
48
+ authentication: ThreeDSecureScenarioOutcomeAuthentication$Outbound;
49
+ result?: ThreeDSecureScenarioOutcomeResult$Outbound | null | undefined;
50
+ };
51
+
52
+ /** @internal */
53
+ export const ThreeDSecureScenarioOutcome$outboundSchema: z.ZodType<
54
+ ThreeDSecureScenarioOutcome$Outbound,
55
+ z.ZodTypeDef,
56
+ ThreeDSecureScenarioOutcome
57
+ > = z.object({
58
+ version: z.string(),
59
+ authentication: ThreeDSecureScenarioOutcomeAuthentication$outboundSchema,
60
+ result: z.nullable(ThreeDSecureScenarioOutcomeResult$outboundSchema)
61
+ .optional(),
62
+ });
63
+
64
+ export function threeDSecureScenarioOutcomeToJSON(
65
+ threeDSecureScenarioOutcome: ThreeDSecureScenarioOutcome,
66
+ ): string {
67
+ return JSON.stringify(
68
+ ThreeDSecureScenarioOutcome$outboundSchema.parse(
69
+ threeDSecureScenarioOutcome,
70
+ ),
71
+ );
72
+ }
73
+ export function threeDSecureScenarioOutcomeFromJSON(
74
+ jsonString: string,
75
+ ): SafeParseResult<ThreeDSecureScenarioOutcome, SDKValidationError> {
76
+ return safeParse(
77
+ jsonString,
78
+ (x) => ThreeDSecureScenarioOutcome$inboundSchema.parse(JSON.parse(x)),
79
+ `Failed to parse 'ThreeDSecureScenarioOutcome' from JSON`,
80
+ );
81
+ }
@@ -0,0 +1,114 @@
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 * as openEnums from "../../types/enums.js";
9
+ import { OpenEnum } from "../../types/enums.js";
10
+ import { Result as SafeParseResult } from "../../types/fp.js";
11
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
12
+
13
+ /**
14
+ * 3DS transaction status.
15
+ */
16
+ export const ThreeDSecureScenarioOutcomeAuthenticationTransactionStatus = {
17
+ Y: "Y",
18
+ N: "N",
19
+ A: "A",
20
+ R: "R",
21
+ U: "U",
22
+ C: "C",
23
+ Timeout: "timeout",
24
+ } as const;
25
+ /**
26
+ * 3DS transaction status.
27
+ */
28
+ export type ThreeDSecureScenarioOutcomeAuthenticationTransactionStatus =
29
+ OpenEnum<typeof ThreeDSecureScenarioOutcomeAuthenticationTransactionStatus>;
30
+
31
+ export type ThreeDSecureScenarioOutcomeAuthentication = {
32
+ /**
33
+ * 3DS transaction status.
34
+ */
35
+ transactionStatus: ThreeDSecureScenarioOutcomeAuthenticationTransactionStatus;
36
+ };
37
+
38
+ /** @internal */
39
+ export const ThreeDSecureScenarioOutcomeAuthenticationTransactionStatus$inboundSchema:
40
+ z.ZodType<
41
+ ThreeDSecureScenarioOutcomeAuthenticationTransactionStatus,
42
+ z.ZodTypeDef,
43
+ unknown
44
+ > = openEnums.inboundSchema(
45
+ ThreeDSecureScenarioOutcomeAuthenticationTransactionStatus,
46
+ );
47
+ /** @internal */
48
+ export const ThreeDSecureScenarioOutcomeAuthenticationTransactionStatus$outboundSchema:
49
+ z.ZodType<
50
+ string,
51
+ z.ZodTypeDef,
52
+ ThreeDSecureScenarioOutcomeAuthenticationTransactionStatus
53
+ > = openEnums.outboundSchema(
54
+ ThreeDSecureScenarioOutcomeAuthenticationTransactionStatus,
55
+ );
56
+
57
+ /** @internal */
58
+ export const ThreeDSecureScenarioOutcomeAuthentication$inboundSchema: z.ZodType<
59
+ ThreeDSecureScenarioOutcomeAuthentication,
60
+ z.ZodTypeDef,
61
+ unknown
62
+ > = z.object({
63
+ transaction_status:
64
+ ThreeDSecureScenarioOutcomeAuthenticationTransactionStatus$inboundSchema,
65
+ }).transform((v) => {
66
+ return remap$(v, {
67
+ "transaction_status": "transactionStatus",
68
+ });
69
+ });
70
+ /** @internal */
71
+ export type ThreeDSecureScenarioOutcomeAuthentication$Outbound = {
72
+ transaction_status: string;
73
+ };
74
+
75
+ /** @internal */
76
+ export const ThreeDSecureScenarioOutcomeAuthentication$outboundSchema:
77
+ z.ZodType<
78
+ ThreeDSecureScenarioOutcomeAuthentication$Outbound,
79
+ z.ZodTypeDef,
80
+ ThreeDSecureScenarioOutcomeAuthentication
81
+ > = z.object({
82
+ transactionStatus:
83
+ ThreeDSecureScenarioOutcomeAuthenticationTransactionStatus$outboundSchema,
84
+ }).transform((v) => {
85
+ return remap$(v, {
86
+ transactionStatus: "transaction_status",
87
+ });
88
+ });
89
+
90
+ export function threeDSecureScenarioOutcomeAuthenticationToJSON(
91
+ threeDSecureScenarioOutcomeAuthentication:
92
+ ThreeDSecureScenarioOutcomeAuthentication,
93
+ ): string {
94
+ return JSON.stringify(
95
+ ThreeDSecureScenarioOutcomeAuthentication$outboundSchema.parse(
96
+ threeDSecureScenarioOutcomeAuthentication,
97
+ ),
98
+ );
99
+ }
100
+ export function threeDSecureScenarioOutcomeAuthenticationFromJSON(
101
+ jsonString: string,
102
+ ): SafeParseResult<
103
+ ThreeDSecureScenarioOutcomeAuthentication,
104
+ SDKValidationError
105
+ > {
106
+ return safeParse(
107
+ jsonString,
108
+ (x) =>
109
+ ThreeDSecureScenarioOutcomeAuthentication$inboundSchema.parse(
110
+ JSON.parse(x),
111
+ ),
112
+ `Failed to parse 'ThreeDSecureScenarioOutcomeAuthentication' from JSON`,
113
+ );
114
+ }
@@ -0,0 +1,103 @@
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 * as openEnums from "../../types/enums.js";
9
+ import { OpenEnum } from "../../types/enums.js";
10
+ import { Result as SafeParseResult } from "../../types/fp.js";
11
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
12
+
13
+ /**
14
+ * 3DS result.
15
+ */
16
+ export const ThreeDSecureScenarioOutcomeResultTransactionStatus = {
17
+ Y: "Y",
18
+ N: "N",
19
+ Timeout: "timeout",
20
+ } as const;
21
+ /**
22
+ * 3DS result.
23
+ */
24
+ export type ThreeDSecureScenarioOutcomeResultTransactionStatus = OpenEnum<
25
+ typeof ThreeDSecureScenarioOutcomeResultTransactionStatus
26
+ >;
27
+
28
+ export type ThreeDSecureScenarioOutcomeResult = {
29
+ /**
30
+ * 3DS result.
31
+ */
32
+ transactionStatus: ThreeDSecureScenarioOutcomeResultTransactionStatus;
33
+ };
34
+
35
+ /** @internal */
36
+ export const ThreeDSecureScenarioOutcomeResultTransactionStatus$inboundSchema:
37
+ z.ZodType<
38
+ ThreeDSecureScenarioOutcomeResultTransactionStatus,
39
+ z.ZodTypeDef,
40
+ unknown
41
+ > = openEnums.inboundSchema(
42
+ ThreeDSecureScenarioOutcomeResultTransactionStatus,
43
+ );
44
+ /** @internal */
45
+ export const ThreeDSecureScenarioOutcomeResultTransactionStatus$outboundSchema:
46
+ z.ZodType<
47
+ string,
48
+ z.ZodTypeDef,
49
+ ThreeDSecureScenarioOutcomeResultTransactionStatus
50
+ > = openEnums.outboundSchema(
51
+ ThreeDSecureScenarioOutcomeResultTransactionStatus,
52
+ );
53
+
54
+ /** @internal */
55
+ export const ThreeDSecureScenarioOutcomeResult$inboundSchema: z.ZodType<
56
+ ThreeDSecureScenarioOutcomeResult,
57
+ z.ZodTypeDef,
58
+ unknown
59
+ > = z.object({
60
+ transaction_status:
61
+ ThreeDSecureScenarioOutcomeResultTransactionStatus$inboundSchema,
62
+ }).transform((v) => {
63
+ return remap$(v, {
64
+ "transaction_status": "transactionStatus",
65
+ });
66
+ });
67
+ /** @internal */
68
+ export type ThreeDSecureScenarioOutcomeResult$Outbound = {
69
+ transaction_status: string;
70
+ };
71
+
72
+ /** @internal */
73
+ export const ThreeDSecureScenarioOutcomeResult$outboundSchema: z.ZodType<
74
+ ThreeDSecureScenarioOutcomeResult$Outbound,
75
+ z.ZodTypeDef,
76
+ ThreeDSecureScenarioOutcomeResult
77
+ > = z.object({
78
+ transactionStatus:
79
+ ThreeDSecureScenarioOutcomeResultTransactionStatus$outboundSchema,
80
+ }).transform((v) => {
81
+ return remap$(v, {
82
+ transactionStatus: "transaction_status",
83
+ });
84
+ });
85
+
86
+ export function threeDSecureScenarioOutcomeResultToJSON(
87
+ threeDSecureScenarioOutcomeResult: ThreeDSecureScenarioOutcomeResult,
88
+ ): string {
89
+ return JSON.stringify(
90
+ ThreeDSecureScenarioOutcomeResult$outboundSchema.parse(
91
+ threeDSecureScenarioOutcomeResult,
92
+ ),
93
+ );
94
+ }
95
+ export function threeDSecureScenarioOutcomeResultFromJSON(
96
+ jsonString: string,
97
+ ): SafeParseResult<ThreeDSecureScenarioOutcomeResult, SDKValidationError> {
98
+ return safeParse(
99
+ jsonString,
100
+ (x) => ThreeDSecureScenarioOutcomeResult$inboundSchema.parse(JSON.parse(x)),
101
+ `Failed to parse 'ThreeDSecureScenarioOutcomeResult' from JSON`,
102
+ );
103
+ }
@@ -0,0 +1,59 @@
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ ThreeDSecureScenario,
12
+ ThreeDSecureScenario$inboundSchema,
13
+ } from "./threedsecurescenario.js";
14
+
15
+ export type ThreeDSecureScenarios = {
16
+ /**
17
+ * A list of items returned for this request.
18
+ */
19
+ items: Array<ThreeDSecureScenario>;
20
+ /**
21
+ * The number of items for this page.
22
+ */
23
+ limit: number;
24
+ /**
25
+ * The cursor pointing at the next page of items.
26
+ */
27
+ nextCursor?: string | null | undefined;
28
+ /**
29
+ * The cursor pointing at the previous page of items.
30
+ */
31
+ previousCursor?: string | null | undefined;
32
+ };
33
+
34
+ /** @internal */
35
+ export const ThreeDSecureScenarios$inboundSchema: z.ZodType<
36
+ ThreeDSecureScenarios,
37
+ z.ZodTypeDef,
38
+ unknown
39
+ > = z.object({
40
+ items: z.array(ThreeDSecureScenario$inboundSchema),
41
+ limit: z.number().int().default(20),
42
+ next_cursor: z.nullable(z.string()).optional(),
43
+ previous_cursor: z.nullable(z.string()).optional(),
44
+ }).transform((v) => {
45
+ return remap$(v, {
46
+ "next_cursor": "nextCursor",
47
+ "previous_cursor": "previousCursor",
48
+ });
49
+ });
50
+
51
+ export function threeDSecureScenariosFromJSON(
52
+ jsonString: string,
53
+ ): SafeParseResult<ThreeDSecureScenarios, SDKValidationError> {
54
+ return safeParse(
55
+ jsonString,
56
+ (x) => ThreeDSecureScenarios$inboundSchema.parse(JSON.parse(x)),
57
+ `Failed to parse 'ThreeDSecureScenarios' from JSON`,
58
+ );
59
+ }
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import {
7
+ ThreeDSecureScenarioConditions,
8
+ ThreeDSecureScenarioConditions$Outbound,
9
+ ThreeDSecureScenarioConditions$outboundSchema,
10
+ } from "./threedsecurescenarioconditions.js";
11
+ import {
12
+ ThreeDSecureScenarioOutcome,
13
+ ThreeDSecureScenarioOutcome$Outbound,
14
+ ThreeDSecureScenarioOutcome$outboundSchema,
15
+ } from "./threedsecurescenariooutcome.js";
16
+
17
+ export type ThreeDSecureScenarioUpdate = {
18
+ /**
19
+ * Conditions for the scenario.
20
+ */
21
+ conditions?: ThreeDSecureScenarioConditions | null | undefined;
22
+ /**
23
+ * Outcome for the scenario.
24
+ */
25
+ outcome?: ThreeDSecureScenarioOutcome | null | undefined;
26
+ };
27
+
28
+ /** @internal */
29
+ export type ThreeDSecureScenarioUpdate$Outbound = {
30
+ conditions?: ThreeDSecureScenarioConditions$Outbound | null | undefined;
31
+ outcome?: ThreeDSecureScenarioOutcome$Outbound | null | undefined;
32
+ };
33
+
34
+ /** @internal */
35
+ export const ThreeDSecureScenarioUpdate$outboundSchema: z.ZodType<
36
+ ThreeDSecureScenarioUpdate$Outbound,
37
+ z.ZodTypeDef,
38
+ ThreeDSecureScenarioUpdate
39
+ > = z.object({
40
+ conditions: z.nullable(ThreeDSecureScenarioConditions$outboundSchema)
41
+ .optional(),
42
+ outcome: z.nullable(ThreeDSecureScenarioOutcome$outboundSchema).optional(),
43
+ });
44
+
45
+ export function threeDSecureScenarioUpdateToJSON(
46
+ threeDSecureScenarioUpdate: ThreeDSecureScenarioUpdate,
47
+ ): string {
48
+ return JSON.stringify(
49
+ ThreeDSecureScenarioUpdate$outboundSchema.parse(threeDSecureScenarioUpdate),
50
+ );
51
+ }
@@ -0,0 +1,50 @@
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 * as components from "../components/index.js";
8
+
9
+ export type CreateThreeDsScenarioGlobals = {
10
+ merchantAccountId?: string | undefined;
11
+ };
12
+
13
+ export type CreateThreeDsScenarioRequest = {
14
+ /**
15
+ * The ID of the merchant account to use for this request.
16
+ */
17
+ merchantAccountId?: string | null | undefined;
18
+ threeDSecureScenarioCreate: components.ThreeDSecureScenarioCreate;
19
+ };
20
+
21
+ /** @internal */
22
+ export type CreateThreeDsScenarioRequest$Outbound = {
23
+ merchantAccountId?: string | null | undefined;
24
+ ThreeDSecureScenarioCreate: components.ThreeDSecureScenarioCreate$Outbound;
25
+ };
26
+
27
+ /** @internal */
28
+ export const CreateThreeDsScenarioRequest$outboundSchema: z.ZodType<
29
+ CreateThreeDsScenarioRequest$Outbound,
30
+ z.ZodTypeDef,
31
+ CreateThreeDsScenarioRequest
32
+ > = z.object({
33
+ merchantAccountId: z.nullable(z.string()).optional(),
34
+ threeDSecureScenarioCreate:
35
+ components.ThreeDSecureScenarioCreate$outboundSchema,
36
+ }).transform((v) => {
37
+ return remap$(v, {
38
+ threeDSecureScenarioCreate: "ThreeDSecureScenarioCreate",
39
+ });
40
+ });
41
+
42
+ export function createThreeDsScenarioRequestToJSON(
43
+ createThreeDsScenarioRequest: CreateThreeDsScenarioRequest,
44
+ ): string {
45
+ return JSON.stringify(
46
+ CreateThreeDsScenarioRequest$outboundSchema.parse(
47
+ createThreeDsScenarioRequest,
48
+ ),
49
+ );
50
+ }
@@ -0,0 +1,51 @@
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
+
8
+ export type DeleteThreeDsScenarioGlobals = {
9
+ merchantAccountId?: string | undefined;
10
+ };
11
+
12
+ export type DeleteThreeDsScenarioRequest = {
13
+ /**
14
+ * The ID of the 3DS scenario
15
+ */
16
+ threeDsScenarioId: string;
17
+ /**
18
+ * The ID of the merchant account to use for this request.
19
+ */
20
+ merchantAccountId?: string | null | undefined;
21
+ };
22
+
23
+ /** @internal */
24
+ export type DeleteThreeDsScenarioRequest$Outbound = {
25
+ three_ds_scenario_id: string;
26
+ merchantAccountId?: string | null | undefined;
27
+ };
28
+
29
+ /** @internal */
30
+ export const DeleteThreeDsScenarioRequest$outboundSchema: z.ZodType<
31
+ DeleteThreeDsScenarioRequest$Outbound,
32
+ z.ZodTypeDef,
33
+ DeleteThreeDsScenarioRequest
34
+ > = z.object({
35
+ threeDsScenarioId: z.string(),
36
+ merchantAccountId: z.nullable(z.string()).optional(),
37
+ }).transform((v) => {
38
+ return remap$(v, {
39
+ threeDsScenarioId: "three_ds_scenario_id",
40
+ });
41
+ });
42
+
43
+ export function deleteThreeDsScenarioRequestToJSON(
44
+ deleteThreeDsScenarioRequest: DeleteThreeDsScenarioRequest,
45
+ ): string {
46
+ return JSON.stringify(
47
+ DeleteThreeDsScenarioRequest$outboundSchema.parse(
48
+ deleteThreeDsScenarioRequest,
49
+ ),
50
+ );
51
+ }