@gr4vy/sdk 2.3.14 → 2.3.16

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 (135) hide show
  1. package/README.md +14 -1
  2. package/funcs/apiKeyPairsCreate.d.ts +18 -0
  3. package/funcs/apiKeyPairsCreate.d.ts.map +1 -0
  4. package/funcs/apiKeyPairsCreate.js +119 -0
  5. package/funcs/apiKeyPairsCreate.js.map +1 -0
  6. package/funcs/apiKeyPairsDelete.d.ts +17 -0
  7. package/funcs/apiKeyPairsDelete.d.ts.map +1 -0
  8. package/funcs/apiKeyPairsDelete.js +128 -0
  9. package/funcs/apiKeyPairsDelete.js.map +1 -0
  10. package/funcs/apiKeyPairsGet.d.ts +18 -0
  11. package/funcs/apiKeyPairsGet.d.ts.map +1 -0
  12. package/funcs/apiKeyPairsGet.js +138 -0
  13. package/funcs/apiKeyPairsGet.js.map +1 -0
  14. package/funcs/apiKeyPairsList.d.ts +21 -0
  15. package/funcs/apiKeyPairsList.d.ts.map +1 -0
  16. package/funcs/apiKeyPairsList.js +160 -0
  17. package/funcs/apiKeyPairsList.js.map +1 -0
  18. package/funcs/apiKeyPairsUpdate.d.ts +18 -0
  19. package/funcs/apiKeyPairsUpdate.d.ts.map +1 -0
  20. package/funcs/apiKeyPairsUpdate.js +130 -0
  21. package/funcs/apiKeyPairsUpdate.js.map +1 -0
  22. package/jsr.json +1 -1
  23. package/lib/config.d.ts +3 -3
  24. package/lib/config.js +3 -3
  25. package/models/components/apicommonschemascreator.d.ts +12 -0
  26. package/models/components/apicommonschemascreator.d.ts.map +1 -0
  27. package/models/components/{creator.js → apicommonschemascreator.js} +6 -6
  28. package/models/components/apicommonschemascreator.js.map +1 -0
  29. package/models/components/apikeypair.d.ts +58 -0
  30. package/models/components/apikeypair.d.ts.map +1 -0
  31. package/models/components/apikeypair.js +75 -0
  32. package/models/components/apikeypair.js.map +1 -0
  33. package/models/components/apikeypaircreate.d.ts +38 -0
  34. package/models/components/apikeypaircreate.d.ts.map +1 -0
  35. package/models/components/apikeypaircreate.js +63 -0
  36. package/models/components/apikeypaircreate.js.map +1 -0
  37. package/models/components/apikeypairupdate.d.ts +27 -0
  38. package/models/components/apikeypairupdate.d.ts.map +1 -0
  39. package/models/components/apikeypairupdate.js +59 -0
  40. package/models/components/apikeypairupdate.js.map +1 -0
  41. package/models/components/apiroutersapikeypairsschemascreator.d.ts +25 -0
  42. package/models/components/apiroutersapikeypairsschemascreator.d.ts.map +1 -0
  43. package/models/components/apiroutersapikeypairsschemascreator.js +58 -0
  44. package/models/components/apiroutersapikeypairsschemascreator.js.map +1 -0
  45. package/models/components/certificatealgorithm.d.ts +12 -0
  46. package/models/components/certificatealgorithm.d.ts.map +1 -0
  47. package/models/components/certificatealgorithm.js +49 -0
  48. package/models/components/certificatealgorithm.js.map +1 -0
  49. package/models/components/collectionapikeypair.d.ts +26 -0
  50. package/models/components/collectionapikeypair.d.ts.map +1 -0
  51. package/models/components/collectionapikeypair.js +60 -0
  52. package/models/components/collectionapikeypair.js.map +1 -0
  53. package/models/components/giftcardserviceprovider.d.ts +1 -0
  54. package/models/components/giftcardserviceprovider.d.ts.map +1 -1
  55. package/models/components/giftcardserviceprovider.js +1 -0
  56. package/models/components/giftcardserviceprovider.js.map +1 -1
  57. package/models/components/index.d.ts +10 -1
  58. package/models/components/index.d.ts.map +1 -1
  59. package/models/components/index.js +10 -1
  60. package/models/components/index.js.map +1 -1
  61. package/models/components/merchantaccountsummary.d.ts +16 -0
  62. package/models/components/merchantaccountsummary.d.ts.map +1 -0
  63. package/models/components/merchantaccountsummary.js +65 -0
  64. package/models/components/merchantaccountsummary.js.map +1 -0
  65. package/models/components/permissionset.d.ts +10 -0
  66. package/models/components/permissionset.d.ts.map +1 -0
  67. package/models/components/permissionset.js +50 -0
  68. package/models/components/permissionset.js.map +1 -0
  69. package/models/components/refund.d.ts +2 -2
  70. package/models/components/refund.d.ts.map +1 -1
  71. package/models/components/refund.js +2 -2
  72. package/models/components/refund.js.map +1 -1
  73. package/models/components/role.d.ts +15 -0
  74. package/models/components/role.d.ts.map +1 -0
  75. package/models/components/role.js +56 -0
  76. package/models/components/role.js.map +1 -0
  77. package/models/operations/deleteapikeypair.d.ts +15 -0
  78. package/models/operations/deleteapikeypair.d.ts.map +1 -0
  79. package/models/operations/deleteapikeypair.js +54 -0
  80. package/models/operations/deleteapikeypair.js.map +1 -0
  81. package/models/operations/getapikeypair.d.ts +15 -0
  82. package/models/operations/getapikeypair.d.ts.map +1 -0
  83. package/models/operations/getapikeypair.js +54 -0
  84. package/models/operations/getapikeypair.js.map +1 -0
  85. package/models/operations/index.d.ts +4 -0
  86. package/models/operations/index.d.ts.map +1 -1
  87. package/models/operations/index.js +4 -0
  88. package/models/operations/index.js.map +1 -1
  89. package/models/operations/listapikeypairs.d.ts +29 -0
  90. package/models/operations/listapikeypairs.d.ts.map +1 -0
  91. package/models/operations/listapikeypairs.js +65 -0
  92. package/models/operations/listapikeypairs.js.map +1 -0
  93. package/models/operations/updateapikeypair.d.ts +18 -0
  94. package/models/operations/updateapikeypair.d.ts.map +1 -0
  95. package/models/operations/updateapikeypair.js +57 -0
  96. package/models/operations/updateapikeypair.js.map +1 -0
  97. package/package.json +1 -1
  98. package/sdk/apikeypairs.d.ts +44 -0
  99. package/sdk/apikeypairs.d.ts.map +1 -0
  100. package/sdk/apikeypairs.js +63 -0
  101. package/sdk/apikeypairs.js.map +1 -0
  102. package/sdk/sdk.d.ts +3 -0
  103. package/sdk/sdk.d.ts.map +1 -1
  104. package/sdk/sdk.js +4 -0
  105. package/sdk/sdk.js.map +1 -1
  106. package/src/funcs/apiKeyPairsCreate.ts +215 -0
  107. package/src/funcs/apiKeyPairsDelete.ts +225 -0
  108. package/src/funcs/apiKeyPairsGet.ts +235 -0
  109. package/src/funcs/apiKeyPairsList.ts +312 -0
  110. package/src/funcs/apiKeyPairsUpdate.ts +230 -0
  111. package/src/lib/config.ts +3 -3
  112. package/src/models/components/apicommonschemascreator.ts +40 -0
  113. package/src/models/components/apikeypair.ts +109 -0
  114. package/src/models/components/apikeypaircreate.ts +73 -0
  115. package/src/models/components/apikeypairupdate.ts +56 -0
  116. package/src/models/components/apiroutersapikeypairsschemascreator.ts +55 -0
  117. package/src/models/components/certificatealgorithm.ts +26 -0
  118. package/src/models/components/collectionapikeypair.ts +56 -0
  119. package/src/models/components/giftcardserviceprovider.ts +1 -0
  120. package/src/models/components/index.ts +10 -1
  121. package/src/models/components/merchantaccountsummary.ts +52 -0
  122. package/src/models/components/permissionset.ts +31 -0
  123. package/src/models/components/refund.ts +6 -3
  124. package/src/models/components/role.ts +37 -0
  125. package/src/models/operations/deleteapikeypair.ts +39 -0
  126. package/src/models/operations/getapikeypair.ts +39 -0
  127. package/src/models/operations/index.ts +4 -0
  128. package/src/models/operations/listapikeypairs.ts +72 -0
  129. package/src/models/operations/updateapikeypair.ts +44 -0
  130. package/src/sdk/apikeypairs.ts +107 -0
  131. package/src/sdk/sdk.ts +6 -0
  132. package/models/components/creator.d.ts +0 -12
  133. package/models/components/creator.d.ts.map +0 -1
  134. package/models/components/creator.js.map +0 -1
  135. package/src/models/components/creator.ts +0 -37
@@ -0,0 +1,73 @@
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 {
8
+ CertificateAlgorithm,
9
+ CertificateAlgorithm$outboundSchema,
10
+ } from "./certificatealgorithm.js";
11
+
12
+ export type APIKeyPairCreate = {
13
+ /**
14
+ * The display name for the API key pair.
15
+ */
16
+ displayName: string;
17
+ algorithm?: CertificateAlgorithm | undefined;
18
+ /**
19
+ * Whether the API key pair should be active and usable once created.
20
+ */
21
+ active?: boolean | undefined;
22
+ /**
23
+ * The ID of the role to assign to the API key pair. Exactly one role is supported. The caller can only assign a role whose scopes are a subset of its own.
24
+ */
25
+ roleIds: Array<string>;
26
+ /**
27
+ * The IDs of the merchant accounts to associate with the API key pair. An empty list grants access to all merchant accounts. The caller can only assign merchant accounts it has access to.
28
+ */
29
+ merchantAccountIds?: Array<string> | undefined;
30
+ /**
31
+ * A PEM-encoded ECDSA P-521 (ES512) public key. Provide this to register your own key pair (bring your own key); If omitted, Gr4vy will generate the key pair and return the private key.
32
+ */
33
+ publicKey?: string | null | undefined;
34
+ };
35
+
36
+ /** @internal */
37
+ export type APIKeyPairCreate$Outbound = {
38
+ display_name: string;
39
+ algorithm?: string | undefined;
40
+ active: boolean;
41
+ role_ids: Array<string>;
42
+ merchant_account_ids?: Array<string> | undefined;
43
+ public_key?: string | null | undefined;
44
+ };
45
+
46
+ /** @internal */
47
+ export const APIKeyPairCreate$outboundSchema: z.ZodType<
48
+ APIKeyPairCreate$Outbound,
49
+ z.ZodTypeDef,
50
+ APIKeyPairCreate
51
+ > = z.object({
52
+ displayName: z.string(),
53
+ algorithm: CertificateAlgorithm$outboundSchema.optional(),
54
+ active: z.boolean().default(true),
55
+ roleIds: z.array(z.string()),
56
+ merchantAccountIds: z.array(z.string()).optional(),
57
+ publicKey: z.nullable(z.string()).optional(),
58
+ }).transform((v) => {
59
+ return remap$(v, {
60
+ displayName: "display_name",
61
+ roleIds: "role_ids",
62
+ merchantAccountIds: "merchant_account_ids",
63
+ publicKey: "public_key",
64
+ });
65
+ });
66
+
67
+ export function apiKeyPairCreateToJSON(
68
+ apiKeyPairCreate: APIKeyPairCreate,
69
+ ): string {
70
+ return JSON.stringify(
71
+ APIKeyPairCreate$outboundSchema.parse(apiKeyPairCreate),
72
+ );
73
+ }
@@ -0,0 +1,56 @@
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 APIKeyPairUpdate = {
9
+ /**
10
+ * The display name for the API key pair.
11
+ */
12
+ displayName?: string | null | undefined;
13
+ /**
14
+ * Whether the API key pair is active and can be used to authenticate.
15
+ */
16
+ active?: boolean | null | undefined;
17
+ roleIds?: Array<string> | null | undefined;
18
+ /**
19
+ * The IDs of the merchant accounts to associate with the API key pair. The caller can only assign merchant accounts it has access to.
20
+ */
21
+ merchantAccountIds?: Array<string> | null | undefined;
22
+ };
23
+
24
+ /** @internal */
25
+ export type APIKeyPairUpdate$Outbound = {
26
+ display_name?: string | null | undefined;
27
+ active?: boolean | null | undefined;
28
+ role_ids?: Array<string> | null | undefined;
29
+ merchant_account_ids?: Array<string> | null | undefined;
30
+ };
31
+
32
+ /** @internal */
33
+ export const APIKeyPairUpdate$outboundSchema: z.ZodType<
34
+ APIKeyPairUpdate$Outbound,
35
+ z.ZodTypeDef,
36
+ APIKeyPairUpdate
37
+ > = z.object({
38
+ displayName: z.nullable(z.string()).optional(),
39
+ active: z.nullable(z.boolean()).optional(),
40
+ roleIds: z.nullable(z.array(z.string())).optional(),
41
+ merchantAccountIds: z.nullable(z.array(z.string())).optional(),
42
+ }).transform((v) => {
43
+ return remap$(v, {
44
+ displayName: "display_name",
45
+ roleIds: "role_ids",
46
+ merchantAccountIds: "merchant_account_ids",
47
+ });
48
+ });
49
+
50
+ export function apiKeyPairUpdateToJSON(
51
+ apiKeyPairUpdate: APIKeyPairUpdate,
52
+ ): string {
53
+ return JSON.stringify(
54
+ APIKeyPairUpdate$outboundSchema.parse(apiKeyPairUpdate),
55
+ );
56
+ }
@@ -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 { 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 ApiRoutersApiKeyPairsSchemasCreator = {
12
+ /**
13
+ * The ID of the user or API key pair that created the API key pair.
14
+ */
15
+ id: string;
16
+ /**
17
+ * The name of the user or API key pair that created the API key pair.
18
+ */
19
+ name: string;
20
+ /**
21
+ * The email address of the user that created the API key pair, when it was created by a dashboard user.
22
+ */
23
+ emailAddress?: string | null | undefined;
24
+ /**
25
+ * The thumbprint of the API key pair that created the API key pair, when it was created by another API key.
26
+ */
27
+ thumbprint?: string | null | undefined;
28
+ };
29
+
30
+ /** @internal */
31
+ export const ApiRoutersApiKeyPairsSchemasCreator$inboundSchema: z.ZodType<
32
+ ApiRoutersApiKeyPairsSchemasCreator,
33
+ z.ZodTypeDef,
34
+ unknown
35
+ > = z.object({
36
+ id: z.string(),
37
+ name: z.string(),
38
+ email_address: z.nullable(z.string()).optional(),
39
+ thumbprint: z.nullable(z.string()).optional(),
40
+ }).transform((v) => {
41
+ return remap$(v, {
42
+ "email_address": "emailAddress",
43
+ });
44
+ });
45
+
46
+ export function apiRoutersApiKeyPairsSchemasCreatorFromJSON(
47
+ jsonString: string,
48
+ ): SafeParseResult<ApiRoutersApiKeyPairsSchemasCreator, SDKValidationError> {
49
+ return safeParse(
50
+ jsonString,
51
+ (x) =>
52
+ ApiRoutersApiKeyPairsSchemasCreator$inboundSchema.parse(JSON.parse(x)),
53
+ `Failed to parse 'ApiRoutersApiKeyPairsSchemasCreator' from JSON`,
54
+ );
55
+ }
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import * as openEnums from "../../types/enums.js";
7
+ import { OpenEnum } from "../../types/enums.js";
8
+
9
+ export const CertificateAlgorithm = {
10
+ Ecdsa: "ECDSA",
11
+ Rsa: "RSA",
12
+ } as const;
13
+ export type CertificateAlgorithm = OpenEnum<typeof CertificateAlgorithm>;
14
+
15
+ /** @internal */
16
+ export const CertificateAlgorithm$inboundSchema: z.ZodType<
17
+ CertificateAlgorithm,
18
+ z.ZodTypeDef,
19
+ unknown
20
+ > = openEnums.inboundSchema(CertificateAlgorithm);
21
+ /** @internal */
22
+ export const CertificateAlgorithm$outboundSchema: z.ZodType<
23
+ string,
24
+ z.ZodTypeDef,
25
+ CertificateAlgorithm
26
+ > = openEnums.outboundSchema(CertificateAlgorithm);
@@ -0,0 +1,56 @@
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 { APIKeyPair, APIKeyPair$inboundSchema } from "./apikeypair.js";
11
+
12
+ export type CollectionAPIKeyPair = {
13
+ /**
14
+ * A list of items returned for this request.
15
+ */
16
+ items: Array<APIKeyPair>;
17
+ /**
18
+ * The number of items for this page.
19
+ */
20
+ limit: number;
21
+ /**
22
+ * The cursor pointing at the next page of items.
23
+ */
24
+ nextCursor?: string | null | undefined;
25
+ /**
26
+ * The cursor pointing at the previous page of items.
27
+ */
28
+ previousCursor?: string | null | undefined;
29
+ };
30
+
31
+ /** @internal */
32
+ export const CollectionAPIKeyPair$inboundSchema: z.ZodType<
33
+ CollectionAPIKeyPair,
34
+ z.ZodTypeDef,
35
+ unknown
36
+ > = z.object({
37
+ items: z.array(APIKeyPair$inboundSchema),
38
+ limit: z.number().int().default(20),
39
+ next_cursor: z.nullable(z.string()).optional(),
40
+ previous_cursor: z.nullable(z.string()).optional(),
41
+ }).transform((v) => {
42
+ return remap$(v, {
43
+ "next_cursor": "nextCursor",
44
+ "previous_cursor": "previousCursor",
45
+ });
46
+ });
47
+
48
+ export function collectionAPIKeyPairFromJSON(
49
+ jsonString: string,
50
+ ): SafeParseResult<CollectionAPIKeyPair, SDKValidationError> {
51
+ return safeParse(
52
+ jsonString,
53
+ (x) => CollectionAPIKeyPair$inboundSchema.parse(JSON.parse(x)),
54
+ `Failed to parse 'CollectionAPIKeyPair' from JSON`,
55
+ );
56
+ }
@@ -9,6 +9,7 @@ import { OpenEnum } from "../../types/enums.js";
9
9
  export const GiftCardServiceProvider = {
10
10
  MockGiftCard: "mock-gift-card",
11
11
  QwikcilverGiftCard: "qwikcilver-gift-card",
12
+ ValuelinkGiftCard: "valuelink-gift-card",
12
13
  } as const;
13
14
  export type GiftCardServiceProvider = OpenEnum<typeof GiftCardServiceProvider>;
14
15
 
@@ -25,6 +25,11 @@ export * from "./airline.js";
25
25
  export * from "./airlineleg.js";
26
26
  export * from "./airlinepassenger.js";
27
27
  export * from "./antifrauddecision.js";
28
+ export * from "./apicommonschemascreator.js";
29
+ export * from "./apikeypair.js";
30
+ export * from "./apikeypaircreate.js";
31
+ export * from "./apikeypairupdate.js";
32
+ export * from "./apiroutersapikeypairsschemascreator.js";
28
33
  export * from "./apitypesdigitalwalletaddress.js";
29
34
  export * from "./applepaypaymentmethodcreate.js";
30
35
  export * from "./applepaysessionrequest.js";
@@ -57,6 +62,7 @@ export * from "./cardschemedefinitions.js";
57
62
  export * from "./cardtype.js";
58
63
  export * from "./cardwithurlpaymentmethodcreate.js";
59
64
  export * from "./cartitem.js";
65
+ export * from "./certificatealgorithm.js";
60
66
  export * from "./chaseoptions.js";
61
67
  export * from "./checkoutpayoutoptions.js";
62
68
  export * from "./checkoutsession.js";
@@ -69,9 +75,9 @@ export * from "./clicktopayfpanpaymentmethodcreate.js";
69
75
  export * from "./clicktopaypaymentmethodcreate.js";
70
76
  export * from "./clicktopaysession.js";
71
77
  export * from "./clicktopaysessionrequest.js";
78
+ export * from "./collectionapikeypair.js";
72
79
  export * from "./createsession.js";
73
80
  export * from "./createsessionstatus.js";
74
- export * from "./creator.js";
75
81
  export * from "./cryptogram.js";
76
82
  export * from "./cryptogramcreate.js";
77
83
  export * from "./cvvresponsecode.js";
@@ -145,6 +151,7 @@ export * from "./mattildatapioptions.js";
145
151
  export * from "./merchantaccount.js";
146
152
  export * from "./merchantaccountcreate.js";
147
153
  export * from "./merchantaccounts.js";
154
+ export * from "./merchantaccountsummary.js";
148
155
  export * from "./merchantaccountthreedsconfiguration.js";
149
156
  export * from "./merchantaccountthreedsconfigurationcreate.js";
150
157
  export * from "./merchantaccountthreedsconfigurations.js";
@@ -237,6 +244,7 @@ export * from "./pazetransactionoptions.js";
237
244
  export * from "./pazetransactionvalue.js";
238
245
  export * from "./pazetraveldata.js";
239
246
  export * from "./pazewebsession.js";
247
+ export * from "./permissionset.js";
240
248
  export * from "./plaidpaymentmethodcreate.js";
241
249
  export * from "./powertranzoptions.js";
242
250
  export * from "./producttype.js";
@@ -265,6 +273,7 @@ export * from "./reportupdate.js";
265
273
  export * from "./requiredcheckoutfields.js";
266
274
  export * from "./riskifiedantifraudoptions.js";
267
275
  export * from "./riskifiedantifraudoptionslineitem.js";
276
+ export * from "./role.js";
268
277
  export * from "./security.js";
269
278
  export * from "./sepabankpaymentmethodcreate.js";
270
279
  export * from "./settlement.js";
@@ -0,0 +1,52 @@
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 MerchantAccountSummary = {
12
+ type: "merchant-account";
13
+ id: string;
14
+ displayName: string;
15
+ createdAt: Date;
16
+ updatedAt: Date;
17
+ overCaptureAmount?: number | null | undefined;
18
+ overCapturePercentage?: number | null | undefined;
19
+ };
20
+
21
+ /** @internal */
22
+ export const MerchantAccountSummary$inboundSchema: z.ZodType<
23
+ MerchantAccountSummary,
24
+ z.ZodTypeDef,
25
+ unknown
26
+ > = z.object({
27
+ type: z.literal("merchant-account").default("merchant-account"),
28
+ id: z.string(),
29
+ display_name: z.string(),
30
+ created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
31
+ updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
32
+ over_capture_amount: z.nullable(z.number().int()).optional(),
33
+ over_capture_percentage: z.nullable(z.number().int()).optional(),
34
+ }).transform((v) => {
35
+ return remap$(v, {
36
+ "display_name": "displayName",
37
+ "created_at": "createdAt",
38
+ "updated_at": "updatedAt",
39
+ "over_capture_amount": "overCaptureAmount",
40
+ "over_capture_percentage": "overCapturePercentage",
41
+ });
42
+ });
43
+
44
+ export function merchantAccountSummaryFromJSON(
45
+ jsonString: string,
46
+ ): SafeParseResult<MerchantAccountSummary, SDKValidationError> {
47
+ return safeParse(
48
+ jsonString,
49
+ (x) => MerchantAccountSummary$inboundSchema.parse(JSON.parse(x)),
50
+ `Failed to parse 'MerchantAccountSummary' from JSON`,
51
+ );
52
+ }
@@ -0,0 +1,31 @@
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
+
10
+ export type PermissionSet = {
11
+ allow: Array<string>;
12
+ };
13
+
14
+ /** @internal */
15
+ export const PermissionSet$inboundSchema: z.ZodType<
16
+ PermissionSet,
17
+ z.ZodTypeDef,
18
+ unknown
19
+ > = z.object({
20
+ allow: z.array(z.string()),
21
+ });
22
+
23
+ export function permissionSetFromJSON(
24
+ jsonString: string,
25
+ ): SafeParseResult<PermissionSet, SDKValidationError> {
26
+ return safeParse(
27
+ jsonString,
28
+ (x) => PermissionSet$inboundSchema.parse(JSON.parse(x)),
29
+ `Failed to parse 'PermissionSet' from JSON`,
30
+ );
31
+ }
@@ -7,7 +7,10 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
- import { Creator, Creator$inboundSchema } from "./creator.js";
10
+ import {
11
+ ApiCommonSchemasCreator,
12
+ ApiCommonSchemasCreator$inboundSchema,
13
+ } from "./apicommonschemascreator.js";
11
14
  import { RefundStatus, RefundStatus$inboundSchema } from "./refundstatus.js";
12
15
  import {
13
16
  RefundTargetType,
@@ -76,7 +79,7 @@ export type Refund = {
76
79
  /**
77
80
  * The user that created this resource
78
81
  */
79
- creator?: Creator | null | undefined;
82
+ creator?: ApiCommonSchemasCreator | null | undefined;
80
83
  /**
81
84
  * The standardized error code set by Gr4vy.
82
85
  */
@@ -126,7 +129,7 @@ export const Refund$inboundSchema: z.ZodType<Refund, z.ZodTypeDef, unknown> = z
126
129
  updated_at: z.string().datetime({ offset: true }).transform(v =>
127
130
  new Date(v)
128
131
  ),
129
- creator: z.nullable(Creator$inboundSchema).optional(),
132
+ creator: z.nullable(ApiCommonSchemasCreator$inboundSchema).optional(),
130
133
  error_code: z.nullable(z.string()).optional(),
131
134
  raw_response_code: z.nullable(z.string()).optional(),
132
135
  raw_response_description: z.nullable(z.string()).optional(),
@@ -0,0 +1,37 @@
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 { PermissionSet, PermissionSet$inboundSchema } from "./permissionset.js";
10
+
11
+ export type Role = {
12
+ type: "role";
13
+ id: string;
14
+ name: string;
15
+ description: string;
16
+ permissions: PermissionSet;
17
+ };
18
+
19
+ /** @internal */
20
+ export const Role$inboundSchema: z.ZodType<Role, z.ZodTypeDef, unknown> = z
21
+ .object({
22
+ type: z.literal("role").default("role"),
23
+ id: z.string(),
24
+ name: z.string(),
25
+ description: z.string(),
26
+ permissions: PermissionSet$inboundSchema,
27
+ });
28
+
29
+ export function roleFromJSON(
30
+ jsonString: string,
31
+ ): SafeParseResult<Role, SDKValidationError> {
32
+ return safeParse(
33
+ jsonString,
34
+ (x) => Role$inboundSchema.parse(JSON.parse(x)),
35
+ `Failed to parse 'Role' from JSON`,
36
+ );
37
+ }
@@ -0,0 +1,39 @@
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 DeleteApiKeyPairRequest = {
9
+ /**
10
+ * The ID of the API key pair.
11
+ */
12
+ apiKeyPairId: string;
13
+ };
14
+
15
+ /** @internal */
16
+ export type DeleteApiKeyPairRequest$Outbound = {
17
+ api_key_pair_id: string;
18
+ };
19
+
20
+ /** @internal */
21
+ export const DeleteApiKeyPairRequest$outboundSchema: z.ZodType<
22
+ DeleteApiKeyPairRequest$Outbound,
23
+ z.ZodTypeDef,
24
+ DeleteApiKeyPairRequest
25
+ > = z.object({
26
+ apiKeyPairId: z.string(),
27
+ }).transform((v) => {
28
+ return remap$(v, {
29
+ apiKeyPairId: "api_key_pair_id",
30
+ });
31
+ });
32
+
33
+ export function deleteApiKeyPairRequestToJSON(
34
+ deleteApiKeyPairRequest: DeleteApiKeyPairRequest,
35
+ ): string {
36
+ return JSON.stringify(
37
+ DeleteApiKeyPairRequest$outboundSchema.parse(deleteApiKeyPairRequest),
38
+ );
39
+ }
@@ -0,0 +1,39 @@
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 GetApiKeyPairRequest = {
9
+ /**
10
+ * The ID of the API key pair.
11
+ */
12
+ apiKeyPairId: string;
13
+ };
14
+
15
+ /** @internal */
16
+ export type GetApiKeyPairRequest$Outbound = {
17
+ api_key_pair_id: string;
18
+ };
19
+
20
+ /** @internal */
21
+ export const GetApiKeyPairRequest$outboundSchema: z.ZodType<
22
+ GetApiKeyPairRequest$Outbound,
23
+ z.ZodTypeDef,
24
+ GetApiKeyPairRequest
25
+ > = z.object({
26
+ apiKeyPairId: z.string(),
27
+ }).transform((v) => {
28
+ return remap$(v, {
29
+ apiKeyPairId: "api_key_pair_id",
30
+ });
31
+ });
32
+
33
+ export function getApiKeyPairRequestToJSON(
34
+ getApiKeyPairRequest: GetApiKeyPairRequest,
35
+ ): string {
36
+ return JSON.stringify(
37
+ GetApiKeyPairRequest$outboundSchema.parse(getApiKeyPairRequest),
38
+ );
39
+ }
@@ -31,6 +31,7 @@ export * from "./createthreedsconfiguration.js";
31
31
  export * from "./createthreedsscenario.js";
32
32
  export * from "./createtransaction.js";
33
33
  export * from "./createtransactionrefund.js";
34
+ export * from "./deleteapikeypair.js";
34
35
  export * from "./deletebuyer.js";
35
36
  export * from "./deletebuyershippingdetails.js";
36
37
  export * from "./deletecheckoutsession.js";
@@ -44,6 +45,7 @@ export * from "./deletethreedsconfiguration.js";
44
45
  export * from "./deletethreedsscenario.js";
45
46
  export * from "./editthreedsconfiguration.js";
46
47
  export * from "./expirepaymentlink.js";
48
+ export * from "./getapikeypair.js";
47
49
  export * from "./getbuyer.js";
48
50
  export * from "./getbuyershippingdetails.js";
49
51
  export * from "./getcheckoutsession.js";
@@ -64,6 +66,7 @@ export * from "./gettransactioncapture.js";
64
66
  export * from "./gettransactionrefund.js";
65
67
  export * from "./gettransactionsettlement.js";
66
68
  export * from "./listallreportexecutions.js";
69
+ export * from "./listapikeypairs.js";
67
70
  export * from "./listauditlogs.js";
68
71
  export * from "./listbuyergiftcards.js";
69
72
  export * from "./listbuyerpaymentmethods.js";
@@ -97,6 +100,7 @@ export * from "./reviewpazemobilesession.js";
97
100
  export * from "./suspendpaymentmethodnetworktoken.js";
98
101
  export * from "./synctransaction.js";
99
102
  export * from "./unregisterdigitalwalletdomain.js";
103
+ export * from "./updateapikeypair.js";
100
104
  export * from "./updatebuyer.js";
101
105
  export * from "./updatebuyershippingdetails.js";
102
106
  export * from "./updatecheckoutsession.js";
@@ -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 { 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 ListApiKeyPairsRequest = {
13
+ /**
14
+ * A pointer to the page of results to return.
15
+ */
16
+ cursor?: string | null | undefined;
17
+ /**
18
+ * The maximum number of items that are returned.
19
+ */
20
+ limit?: number | undefined;
21
+ };
22
+
23
+ export type ListApiKeyPairsResponse = {
24
+ result: components.CollectionAPIKeyPair;
25
+ };
26
+
27
+ /** @internal */
28
+ export type ListApiKeyPairsRequest$Outbound = {
29
+ cursor?: string | null | undefined;
30
+ limit: number;
31
+ };
32
+
33
+ /** @internal */
34
+ export const ListApiKeyPairsRequest$outboundSchema: z.ZodType<
35
+ ListApiKeyPairsRequest$Outbound,
36
+ z.ZodTypeDef,
37
+ ListApiKeyPairsRequest
38
+ > = z.object({
39
+ cursor: z.nullable(z.string()).optional(),
40
+ limit: z.number().int().default(20),
41
+ });
42
+
43
+ export function listApiKeyPairsRequestToJSON(
44
+ listApiKeyPairsRequest: ListApiKeyPairsRequest,
45
+ ): string {
46
+ return JSON.stringify(
47
+ ListApiKeyPairsRequest$outboundSchema.parse(listApiKeyPairsRequest),
48
+ );
49
+ }
50
+
51
+ /** @internal */
52
+ export const ListApiKeyPairsResponse$inboundSchema: z.ZodType<
53
+ ListApiKeyPairsResponse,
54
+ z.ZodTypeDef,
55
+ unknown
56
+ > = z.object({
57
+ Result: components.CollectionAPIKeyPair$inboundSchema,
58
+ }).transform((v) => {
59
+ return remap$(v, {
60
+ "Result": "result",
61
+ });
62
+ });
63
+
64
+ export function listApiKeyPairsResponseFromJSON(
65
+ jsonString: string,
66
+ ): SafeParseResult<ListApiKeyPairsResponse, SDKValidationError> {
67
+ return safeParse(
68
+ jsonString,
69
+ (x) => ListApiKeyPairsResponse$inboundSchema.parse(JSON.parse(x)),
70
+ `Failed to parse 'ListApiKeyPairsResponse' from JSON`,
71
+ );
72
+ }