@gr4vy/sdk 1.1.40 → 1.1.42

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 (86) hide show
  1. package/FUNCTIONS.md +1 -6
  2. package/README.md +32 -37
  3. package/docs/sdks/all/README.md +9 -13
  4. package/docs/sdks/auditlogs/README.md +9 -13
  5. package/docs/sdks/balances/README.md +9 -13
  6. package/docs/sdks/buyers/README.md +45 -65
  7. package/docs/sdks/cardschemedefinitions/README.md +9 -13
  8. package/docs/sdks/checkoutsessions/README.md +36 -52
  9. package/docs/sdks/cryptogram/README.md +9 -13
  10. package/docs/sdks/digitalwallets/README.md +45 -65
  11. package/docs/sdks/domains/README.md +18 -26
  12. package/docs/sdks/events/README.md +9 -13
  13. package/docs/sdks/executions/README.md +27 -39
  14. package/docs/sdks/giftcards/README.md +36 -52
  15. package/docs/sdks/gr4vygiftcards/README.md +9 -13
  16. package/docs/sdks/gr4vypaymentmethods/README.md +9 -13
  17. package/docs/sdks/gr4vyrefunds/README.md +27 -39
  18. package/docs/sdks/jobs/README.md +9 -13
  19. package/docs/sdks/merchantaccounts/README.md +36 -48
  20. package/docs/sdks/networktokens/README.md +45 -65
  21. package/docs/sdks/paymentlinks/README.md +36 -52
  22. package/docs/sdks/paymentmethods/README.md +36 -52
  23. package/docs/sdks/paymentoptions/README.md +9 -13
  24. package/docs/sdks/paymentservicedefinitions/README.md +27 -36
  25. package/docs/sdks/paymentservices/README.md +63 -91
  26. package/docs/sdks/paymentservicetokens/README.md +27 -39
  27. package/docs/sdks/payouts/README.md +27 -39
  28. package/docs/sdks/refunds/README.md +9 -13
  29. package/docs/sdks/reportexecutions/README.md +9 -13
  30. package/docs/sdks/reports/README.md +36 -52
  31. package/docs/sdks/sessions/README.md +27 -38
  32. package/docs/sdks/settlements/README.md +18 -26
  33. package/docs/sdks/shippingdetails/README.md +45 -65
  34. package/docs/sdks/transactions/README.md +72 -104
  35. package/examples/accountUpdaterJobsCreate.example.ts +8 -3
  36. package/examples/package-lock.json +620 -0
  37. package/funcs/auditLogsList.js +3 -0
  38. package/funcs/auditLogsList.js.map +1 -1
  39. package/funcs/buyersList.js +3 -0
  40. package/funcs/buyersList.js.map +1 -1
  41. package/funcs/giftCardsList.js +3 -0
  42. package/funcs/giftCardsList.js.map +1 -1
  43. package/funcs/merchantAccountsList.js +3 -0
  44. package/funcs/merchantAccountsList.js.map +1 -1
  45. package/funcs/paymentLinksList.js +3 -0
  46. package/funcs/paymentLinksList.js.map +1 -1
  47. package/funcs/paymentMethodsList.js +3 -0
  48. package/funcs/paymentMethodsList.js.map +1 -1
  49. package/funcs/paymentServiceDefinitionsList.js +3 -0
  50. package/funcs/paymentServiceDefinitionsList.js.map +1 -1
  51. package/funcs/paymentServicesList.js +3 -0
  52. package/funcs/paymentServicesList.js.map +1 -1
  53. package/funcs/payoutsList.js +3 -0
  54. package/funcs/payoutsList.js.map +1 -1
  55. package/funcs/reportExecutionsList.js +3 -0
  56. package/funcs/reportExecutionsList.js.map +1 -1
  57. package/funcs/reportsExecutionsList.js +3 -0
  58. package/funcs/reportsExecutionsList.js.map +1 -1
  59. package/funcs/reportsList.js +3 -0
  60. package/funcs/reportsList.js.map +1 -1
  61. package/funcs/transactionsList.js +3 -0
  62. package/funcs/transactionsList.js.map +1 -1
  63. package/jsr.json +1 -1
  64. package/lib/config.d.ts +3 -3
  65. package/lib/config.js +3 -3
  66. package/models/components/auditlogaction.d.ts +1 -0
  67. package/models/components/auditlogaction.d.ts.map +1 -1
  68. package/models/components/auditlogaction.js +1 -0
  69. package/models/components/auditlogaction.js.map +1 -1
  70. package/package.json +1 -1
  71. package/src/funcs/auditLogsList.ts +3 -0
  72. package/src/funcs/buyersList.ts +3 -0
  73. package/src/funcs/giftCardsList.ts +3 -0
  74. package/src/funcs/merchantAccountsList.ts +3 -0
  75. package/src/funcs/paymentLinksList.ts +3 -0
  76. package/src/funcs/paymentMethodsList.ts +3 -0
  77. package/src/funcs/paymentServiceDefinitionsList.ts +3 -0
  78. package/src/funcs/paymentServicesList.ts +3 -0
  79. package/src/funcs/payoutsList.ts +3 -0
  80. package/src/funcs/reportExecutionsList.ts +3 -0
  81. package/src/funcs/reportsExecutionsList.ts +3 -0
  82. package/src/funcs/reportsList.ts +3 -0
  83. package/src/funcs/transactionsList.ts +3 -0
  84. package/src/lib/config.ts +3 -3
  85. package/src/models/components/auditlogaction.ts +1 -0
  86. package/tests/utils/setup.ts +37 -0
@@ -304,6 +304,9 @@ async function $do(
304
304
  if (typeof nextCursor !== "string") {
305
305
  return { next: () => null };
306
306
  }
307
+ if (nextCursor.trim() === "") {
308
+ return { next: () => null };
309
+ }
307
310
 
308
311
  const nextVal = () =>
309
312
  paymentMethodsList(
@@ -304,6 +304,9 @@ async function $do(
304
304
  if (typeof nextCursor !== "string") {
305
305
  return { next: () => null };
306
306
  }
307
+ if (nextCursor.trim() === "") {
308
+ return { next: () => null };
309
+ }
307
310
 
308
311
  const nextVal = () =>
309
312
  paymentServiceDefinitionsList(
@@ -302,6 +302,9 @@ async function $do(
302
302
  if (typeof nextCursor !== "string") {
303
303
  return { next: () => null };
304
304
  }
305
+ if (nextCursor.trim() === "") {
306
+ return { next: () => null };
307
+ }
305
308
 
306
309
  const nextVal = () =>
307
310
  paymentServicesList(
@@ -310,6 +310,9 @@ async function $do(
310
310
  if (typeof nextCursor !== "string") {
311
311
  return { next: () => null };
312
312
  }
313
+ if (nextCursor.trim() === "") {
314
+ return { next: () => null };
315
+ }
313
316
 
314
317
  const nextVal = () =>
315
318
  payoutsList(
@@ -305,6 +305,9 @@ async function $do(
305
305
  if (typeof nextCursor !== "string") {
306
306
  return { next: () => null };
307
307
  }
308
+ if (nextCursor.trim() === "") {
309
+ return { next: () => null };
310
+ }
308
311
 
309
312
  const nextVal = () =>
310
313
  reportExecutionsList(
@@ -321,6 +321,9 @@ async function $do(
321
321
  if (typeof nextCursor !== "string") {
322
322
  return { next: () => null };
323
323
  }
324
+ if (nextCursor.trim() === "") {
325
+ return { next: () => null };
326
+ }
324
327
 
325
328
  const nextVal = () =>
326
329
  reportsExecutionsList(
@@ -301,6 +301,9 @@ async function $do(
301
301
  if (typeof nextCursor !== "string") {
302
302
  return { next: () => null };
303
303
  }
304
+ if (nextCursor.trim() === "") {
305
+ return { next: () => null };
306
+ }
304
307
 
305
308
  const nextVal = () =>
306
309
  reportsList(
@@ -339,6 +339,9 @@ async function $do(
339
339
  if (typeof nextCursor !== "string") {
340
340
  return { next: () => null };
341
341
  }
342
+ if (nextCursor.trim() === "") {
343
+ return { next: () => null };
344
+ }
342
345
 
343
346
  const nextVal = () =>
344
347
  transactionsList(
package/src/lib/config.ts CHANGED
@@ -77,7 +77,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
77
77
  export const SDK_METADATA = {
78
78
  language: "typescript",
79
79
  openapiDocVersion: "1.0.0",
80
- sdkVersion: "1.1.40",
81
- genVersion: "2.690.1",
82
- userAgent: "speakeasy-sdk/typescript 1.1.40 2.690.1 1.0.0 @gr4vy/sdk",
80
+ sdkVersion: "1.1.42",
81
+ genVersion: "2.692.0",
82
+ userAgent: "speakeasy-sdk/typescript 1.1.42 2.692.0 1.0.0 @gr4vy/sdk",
83
83
  } as const;
@@ -14,6 +14,7 @@ export const AuditLogAction = {
14
14
  Updated: "updated",
15
15
  Deleted: "deleted",
16
16
  Voided: "voided",
17
+ Canceled: "canceled",
17
18
  Captured: "captured",
18
19
  } as const;
19
20
  export type AuditLogAction = OpenEnum<typeof AuditLogAction>;
@@ -2,6 +2,7 @@ import crypto from "crypto";
2
2
  import fs from "fs";
3
3
  import path from "path";
4
4
  import { Gr4vy, withToken } from "../../src";
5
+ import { HTTPClient } from "../../src/lib/http";
5
6
 
6
7
  const loadPrivateKey = (): string => {
7
8
  let privateKey = process.env.PRIVATE_KEY;
@@ -14,11 +15,47 @@ const loadPrivateKey = (): string => {
14
15
  return privateKey;
15
16
  };
16
17
 
18
+ const httpClient = new HTTPClient({
19
+ /**
20
+ * Adds a custom HTTP client that inserts random fields in the response,
21
+ * ensuring we test for forward compatibility.
22
+ */
23
+ fetcher: async (request) => {
24
+ const originalResponse = await fetch(request);
25
+ const contentType = originalResponse.headers.get("content-type");
26
+ if (!contentType || !contentType.includes("application/json")) {
27
+ return originalResponse;
28
+ }
29
+
30
+ try {
31
+ const data = await originalResponse.clone().json();
32
+ const randomKey = `unexpected_field_${Math.floor(Math.random() * 1000)}`;
33
+ data[randomKey] = "this is an injected test value";
34
+
35
+ const modifiedBody = new Blob([JSON.stringify(data, null, 2)], {
36
+ type: 'application/json',
37
+ });
38
+
39
+ const modifiedResponse = new Response(modifiedBody, {
40
+ status: originalResponse.status,
41
+ statusText: originalResponse.statusText,
42
+ headers: originalResponse.headers,
43
+ });
44
+
45
+ return modifiedResponse;
46
+ } catch (error) {
47
+ console.error("Failed to parse JSON, returning original response:", error);
48
+ return originalResponse;
49
+ }
50
+ },
51
+ });
52
+
17
53
  const createGr4vyClient = (
18
54
  privateKey: string,
19
55
  merchantAccountId?: string
20
56
  ): Gr4vy => {
21
57
  return new Gr4vy({
58
+ httpClient: httpClient,
22
59
  server: "sandbox",
23
60
  id: "e2e",
24
61
  merchantAccountId,