@gr4vy/sdk 1.1.30 → 1.1.32

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 (64) hide show
  1. package/FUNCTIONS.md +6 -1
  2. package/README.md +37 -32
  3. package/docs/sdks/all/README.md +13 -9
  4. package/docs/sdks/auditlogs/README.md +13 -9
  5. package/docs/sdks/balances/README.md +13 -9
  6. package/docs/sdks/buyers/README.md +65 -45
  7. package/docs/sdks/cardschemedefinitions/README.md +13 -9
  8. package/docs/sdks/checkoutsessions/README.md +52 -36
  9. package/docs/sdks/cryptogram/README.md +13 -9
  10. package/docs/sdks/digitalwallets/README.md +65 -45
  11. package/docs/sdks/domains/README.md +26 -18
  12. package/docs/sdks/events/README.md +13 -9
  13. package/docs/sdks/executions/README.md +39 -27
  14. package/docs/sdks/giftcards/README.md +52 -36
  15. package/docs/sdks/gr4vygiftcards/README.md +13 -9
  16. package/docs/sdks/gr4vypaymentmethods/README.md +13 -9
  17. package/docs/sdks/gr4vyrefunds/README.md +39 -27
  18. package/docs/sdks/jobs/README.md +13 -9
  19. package/docs/sdks/merchantaccounts/README.md +48 -36
  20. package/docs/sdks/networktokens/README.md +65 -45
  21. package/docs/sdks/paymentlinks/README.md +52 -36
  22. package/docs/sdks/paymentmethods/README.md +52 -36
  23. package/docs/sdks/paymentoptions/README.md +13 -9
  24. package/docs/sdks/paymentservicedefinitions/README.md +36 -27
  25. package/docs/sdks/paymentservices/README.md +91 -63
  26. package/docs/sdks/paymentservicetokens/README.md +39 -27
  27. package/docs/sdks/payouts/README.md +39 -27
  28. package/docs/sdks/refunds/README.md +13 -9
  29. package/docs/sdks/reportexecutions/README.md +13 -9
  30. package/docs/sdks/reports/README.md +52 -36
  31. package/docs/sdks/sessions/README.md +38 -27
  32. package/docs/sdks/settlements/README.md +26 -18
  33. package/docs/sdks/shippingdetails/README.md +65 -45
  34. package/docs/sdks/transactions/README.md +91 -63
  35. package/examples/accountUpdaterJobsCreate.example.ts +3 -8
  36. package/jsr.json +1 -1
  37. package/lib/config.d.ts +3 -3
  38. package/lib/config.js +3 -3
  39. package/lib/security.d.ts.map +1 -1
  40. package/lib/security.js.map +1 -1
  41. package/models/components/stripeconnectoptions.d.ts +5 -0
  42. package/models/components/stripeconnectoptions.d.ts.map +1 -1
  43. package/models/components/stripeconnectoptions.js +4 -0
  44. package/models/components/stripeconnectoptions.js.map +1 -1
  45. package/models/components/transactionevent.d.ts +2 -0
  46. package/models/components/transactionevent.d.ts.map +1 -1
  47. package/models/components/transactionevent.js +2 -0
  48. package/models/components/transactionevent.js.map +1 -1
  49. package/models/components/travelhuboptions.d.ts +5 -0
  50. package/models/components/travelhuboptions.d.ts.map +1 -1
  51. package/models/components/travelhuboptions.js +2 -0
  52. package/models/components/travelhuboptions.js.map +1 -1
  53. package/models/components/trustlyoptions.d.ts +5 -0
  54. package/models/components/trustlyoptions.d.ts.map +1 -1
  55. package/models/components/trustlyoptions.js +2 -0
  56. package/models/components/trustlyoptions.js.map +1 -1
  57. package/package.json +1 -1
  58. package/src/lib/config.ts +3 -3
  59. package/src/lib/security.ts +4 -1
  60. package/src/models/components/stripeconnectoptions.ts +9 -0
  61. package/src/models/components/transactionevent.ts +4 -0
  62. package/src/models/components/travelhuboptions.ts +7 -0
  63. package/src/models/components/trustlyoptions.ts +7 -0
  64. package/examples/package-lock.json +0 -2716
package/FUNCTIONS.md CHANGED
@@ -20,13 +20,18 @@ specific category of applications.
20
20
 
21
21
  ```typescript
22
22
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
23
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
23
24
  import { accountUpdaterJobsCreate } from "@gr4vy/sdk/funcs/accountUpdaterJobsCreate.js";
24
25
 
25
26
  // Use `Gr4vyCore` for best tree-shaking performance.
26
27
  // You can create one instance of it to use across an application.
27
28
  const gr4vy = new Gr4vyCore({
28
29
  merchantAccountId: "<id>",
29
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
30
+ server: "sandbox",
31
+ id: "example",
32
+ bearerAuth: withToken({
33
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
34
+ }),
30
35
  });
31
36
 
32
37
  async function run() {
package/README.md CHANGED
@@ -450,14 +450,13 @@ try {
450
450
 
451
451
  ### Example
452
452
  ```typescript
453
- import { Gr4vy, withToken } from "@gr4vy/sdk";
453
+ import { Gr4vy } from "@gr4vy/sdk";
454
454
  import * as errors from "@gr4vy/sdk/models/errors";
455
- import fs from "fs";
456
455
 
457
456
  const gr4vy = new Gr4vy({
458
- id: "example",
457
+ merchantAccountId: "<id>",
459
458
  server: "sandbox",
460
- merchantAccountId: "default",
459
+ id: "example",
461
460
  bearerAuth: withToken({
462
461
  privateKey: fs.readFileSync("private_key.pem", "utf8"),
463
462
  }),
@@ -554,13 +553,14 @@ If the selected server has variables, you may override its default values throug
554
553
  #### Example
555
554
 
556
555
  ```typescript
557
- import { Gr4vy, withToken } from "@gr4vy/sdk";
558
- import fs from "fs";
556
+ import { Gr4vy } from "@gr4vy/sdk";
559
557
 
560
558
  const gr4vy = new Gr4vy({
561
- id: "example",
559
+ server: "production",
560
+ id: "<id>",
561
+ merchantAccountId: "<id>",
562
562
  server: "sandbox",
563
- merchantAccountId: "default",
563
+ id: "example",
564
564
  bearerAuth: withToken({
565
565
  privateKey: fs.readFileSync("private_key.pem", "utf8"),
566
566
  }),
@@ -585,13 +585,13 @@ run();
585
585
 
586
586
  The default server can also be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
587
587
  ```typescript
588
- import { Gr4vy, withToken } from "@gr4vy/sdk";
589
- import fs from "fs";
588
+ import { Gr4vy } from "@gr4vy/sdk";
590
589
 
591
590
  const gr4vy = new Gr4vy({
592
- id: "example",
591
+ serverURL: "https://api.sandbox.example.gr4vy.app",
592
+ merchantAccountId: "<id>",
593
593
  server: "sandbox",
594
- merchantAccountId: "default",
594
+ id: "example",
595
595
  bearerAuth: withToken({
596
596
  privateKey: fs.readFileSync("private_key.pem", "utf8"),
597
597
  }),
@@ -675,16 +675,15 @@ This SDK supports the following security scheme globally:
675
675
 
676
676
  To authenticate with the API the `bearerAuth` parameter must be set when initializing the SDK client instance. For example:
677
677
  ```typescript
678
- import { Gr4vy, withToken } from "@gr4vy/sdk";
679
- import fs from "fs";
678
+ import { Gr4vy } from "@gr4vy/sdk";
680
679
 
681
680
  const gr4vy = new Gr4vy({
682
- id: "example",
683
681
  server: "sandbox",
684
- merchantAccountId: "default",
682
+ id: "example",
685
683
  bearerAuth: withToken({
686
684
  privateKey: fs.readFileSync("private_key.pem", "utf8"),
687
685
  }),
686
+ merchantAccountId: "<id>",
688
687
  });
689
688
 
690
689
  async function run() {
@@ -742,13 +741,12 @@ yarn add @gr4vy/sdk zod
742
741
  ### Example
743
742
 
744
743
  ```typescript
745
- import { Gr4vy, withToken } from "@gr4vy/sdk";
746
- import fs from "fs";
744
+ import { Gr4vy } from "@gr4vy/sdk";
747
745
 
748
746
  const gr4vy = new Gr4vy({
749
- id: "example",
747
+ merchantAccountId: "<id>",
750
748
  server: "sandbox",
751
- merchantAccountId: "default",
749
+ id: "example",
752
750
  bearerAuth: withToken({
753
751
  privateKey: fs.readFileSync("private_key.pem", "utf8"),
754
752
  }),
@@ -783,13 +781,12 @@ syntax.
783
781
  Here's an example of one such pagination call:
784
782
 
785
783
  ```typescript
786
- import { Gr4vy, withToken } from "@gr4vy/sdk";
787
- import fs from "fs";
784
+ import { Gr4vy } from "@gr4vy/sdk";
788
785
 
789
786
  const gr4vy = new Gr4vy({
790
- id: "example",
787
+ merchantAccountId: "<id>",
791
788
  server: "sandbox",
792
- merchantAccountId: "default",
789
+ id: "example",
793
790
  bearerAuth: withToken({
794
791
  privateKey: fs.readFileSync("private_key.pem", "utf8"),
795
792
  }),
@@ -815,13 +812,12 @@ Some of the endpoints in this SDK support retries. If you use the SDK without a
815
812
 
816
813
  To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
817
814
  ```typescript
818
- import { Gr4vy, withToken } from "@gr4vy/sdk";
819
- import fs from "fs";
815
+ import { Gr4vy } from "@gr4vy/sdk";
820
816
 
821
817
  const gr4vy = new Gr4vy({
822
- id: "example",
818
+ merchantAccountId: "<id>",
823
819
  server: "sandbox",
824
- merchantAccountId: "default",
820
+ id: "example",
825
821
  bearerAuth: withToken({
826
822
  privateKey: fs.readFileSync("private_key.pem", "utf8"),
827
823
  }),
@@ -855,13 +851,22 @@ run();
855
851
 
856
852
  If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
857
853
  ```typescript
858
- import { Gr4vy, withToken } from "@gr4vy/sdk";
859
- import fs from "fs";
854
+ import { Gr4vy } from "@gr4vy/sdk";
860
855
 
861
856
  const gr4vy = new Gr4vy({
862
- id: "example",
857
+ retryConfig: {
858
+ strategy: "backoff",
859
+ backoff: {
860
+ initialInterval: 1,
861
+ maxInterval: 50,
862
+ exponent: 1.1,
863
+ maxElapsedTime: 100,
864
+ },
865
+ retryConnectionErrors: false,
866
+ },
867
+ merchantAccountId: "<id>",
863
868
  server: "sandbox",
864
- merchantAccountId: "default",
869
+ id: "example",
865
870
  bearerAuth: withToken({
866
871
  privateKey: fs.readFileSync("private_key.pem", "utf8"),
867
872
  }),
@@ -15,16 +15,15 @@ Create a refund for all instruments on a transaction.
15
15
 
16
16
  <!-- UsageSnippet language="typescript" operationID="create_full_transaction_refund" method="post" path="/transactions/{transaction_id}/refunds/all" -->
17
17
  ```typescript
18
- import { Gr4vy, withToken } from "@gr4vy/sdk";
19
- import fs from "fs";
18
+ import { Gr4vy } from "@gr4vy/sdk";
20
19
 
21
20
  const gr4vy = new Gr4vy({
22
- id: "example",
23
- server: "sandbox",
24
- merchantAccountId: "default",
25
- bearerAuth: withToken({
26
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
27
- }),
21
+ merchantAccountId: "<id>",
22
+ server: "sandbox",
23
+ id: "example",
24
+ bearerAuth: withToken({
25
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
26
+ }),
28
27
  });
29
28
 
30
29
  async function run() {
@@ -42,13 +41,18 @@ The standalone function version of this method:
42
41
 
43
42
  ```typescript
44
43
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
44
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
45
45
  import { transactionsRefundsAllCreate } from "@gr4vy/sdk/funcs/transactionsRefundsAllCreate.js";
46
46
 
47
47
  // Use `Gr4vyCore` for best tree-shaking performance.
48
48
  // You can create one instance of it to use across an application.
49
49
  const gr4vy = new Gr4vyCore({
50
50
  merchantAccountId: "<id>",
51
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
51
+ server: "sandbox",
52
+ id: "example",
53
+ bearerAuth: withToken({
54
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
55
+ }),
52
56
  });
53
57
 
54
58
  async function run() {
@@ -15,16 +15,15 @@ Returns a list of activity by dashboard users.
15
15
 
16
16
  <!-- UsageSnippet language="typescript" operationID="list_audit_logs" method="get" path="/audit-logs" -->
17
17
  ```typescript
18
- import { Gr4vy, withToken } from "@gr4vy/sdk";
19
- import fs from "fs";
18
+ import { Gr4vy } from "@gr4vy/sdk";
20
19
 
21
20
  const gr4vy = new Gr4vy({
22
- id: "example",
23
- server: "sandbox",
24
- merchantAccountId: "default",
25
- bearerAuth: withToken({
26
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
27
- }),
21
+ merchantAccountId: "<id>",
22
+ server: "sandbox",
23
+ id: "example",
24
+ bearerAuth: withToken({
25
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
26
+ }),
28
27
  });
29
28
 
30
29
  async function run() {
@@ -44,13 +43,18 @@ The standalone function version of this method:
44
43
 
45
44
  ```typescript
46
45
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
46
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
47
47
  import { auditLogsList } from "@gr4vy/sdk/funcs/auditLogsList.js";
48
48
 
49
49
  // Use `Gr4vyCore` for best tree-shaking performance.
50
50
  // You can create one instance of it to use across an application.
51
51
  const gr4vy = new Gr4vyCore({
52
52
  merchantAccountId: "<id>",
53
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
53
+ server: "sandbox",
54
+ id: "example",
55
+ bearerAuth: withToken({
56
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
57
+ }),
54
58
  });
55
59
 
56
60
  async function run() {
@@ -15,16 +15,15 @@ Fetch the balances for one or more gift cards.
15
15
 
16
16
  <!-- UsageSnippet language="typescript" operationID="list_gift_card_balances" method="post" path="/gift-cards/balances" -->
17
17
  ```typescript
18
- import { Gr4vy, withToken } from "@gr4vy/sdk";
19
- import fs from "fs";
18
+ import { Gr4vy } from "@gr4vy/sdk";
20
19
 
21
20
  const gr4vy = new Gr4vy({
22
- id: "example",
23
- server: "sandbox",
24
- merchantAccountId: "default",
25
- bearerAuth: withToken({
26
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
27
- }),
21
+ merchantAccountId: "<id>",
22
+ server: "sandbox",
23
+ id: "example",
24
+ bearerAuth: withToken({
25
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
26
+ }),
28
27
  });
29
28
 
30
29
  async function run() {
@@ -55,13 +54,18 @@ The standalone function version of this method:
55
54
 
56
55
  ```typescript
57
56
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
57
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
58
58
  import { giftCardsBalancesList } from "@gr4vy/sdk/funcs/giftCardsBalancesList.js";
59
59
 
60
60
  // Use `Gr4vyCore` for best tree-shaking performance.
61
61
  // You can create one instance of it to use across an application.
62
62
  const gr4vy = new Gr4vyCore({
63
63
  merchantAccountId: "<id>",
64
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
64
+ server: "sandbox",
65
+ id: "example",
66
+ bearerAuth: withToken({
67
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
68
+ }),
65
69
  });
66
70
 
67
71
  async function run() {
@@ -19,16 +19,15 @@ List all buyers or search for a specific buyer.
19
19
 
20
20
  <!-- UsageSnippet language="typescript" operationID="list_buyers" method="get" path="/buyers" -->
21
21
  ```typescript
22
- import { Gr4vy, withToken } from "@gr4vy/sdk";
23
- import fs from "fs";
22
+ import { Gr4vy } from "@gr4vy/sdk";
24
23
 
25
24
  const gr4vy = new Gr4vy({
26
- id: "example",
27
- server: "sandbox",
28
- merchantAccountId: "default",
29
- bearerAuth: withToken({
30
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
31
- }),
25
+ merchantAccountId: "<id>",
26
+ server: "sandbox",
27
+ id: "example",
28
+ bearerAuth: withToken({
29
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
30
+ }),
32
31
  });
33
32
 
34
33
  async function run() {
@@ -48,13 +47,18 @@ The standalone function version of this method:
48
47
 
49
48
  ```typescript
50
49
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
50
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
51
51
  import { buyersList } from "@gr4vy/sdk/funcs/buyersList.js";
52
52
 
53
53
  // Use `Gr4vyCore` for best tree-shaking performance.
54
54
  // You can create one instance of it to use across an application.
55
55
  const gr4vy = new Gr4vyCore({
56
56
  merchantAccountId: "<id>",
57
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
57
+ server: "sandbox",
58
+ id: "example",
59
+ bearerAuth: withToken({
60
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
61
+ }),
58
62
  });
59
63
 
60
64
  async function run() {
@@ -111,16 +115,15 @@ Create a new buyer record.
111
115
 
112
116
  <!-- UsageSnippet language="typescript" operationID="add_buyer" method="post" path="/buyers" -->
113
117
  ```typescript
114
- import { Gr4vy, withToken } from "@gr4vy/sdk";
115
- import fs from "fs";
118
+ import { Gr4vy } from "@gr4vy/sdk";
116
119
 
117
120
  const gr4vy = new Gr4vy({
118
- id: "example",
119
- server: "sandbox",
120
- merchantAccountId: "default",
121
- bearerAuth: withToken({
122
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
123
- }),
121
+ merchantAccountId: "<id>",
122
+ server: "sandbox",
123
+ id: "example",
124
+ bearerAuth: withToken({
125
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
126
+ }),
124
127
  });
125
128
 
126
129
  async function run() {
@@ -138,13 +141,18 @@ The standalone function version of this method:
138
141
 
139
142
  ```typescript
140
143
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
144
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
141
145
  import { buyersCreate } from "@gr4vy/sdk/funcs/buyersCreate.js";
142
146
 
143
147
  // Use `Gr4vyCore` for best tree-shaking performance.
144
148
  // You can create one instance of it to use across an application.
145
149
  const gr4vy = new Gr4vyCore({
146
150
  merchantAccountId: "<id>",
147
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
151
+ server: "sandbox",
152
+ id: "example",
153
+ bearerAuth: withToken({
154
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
155
+ }),
148
156
  });
149
157
 
150
158
  async function run() {
@@ -200,16 +208,15 @@ Fetches a buyer by its ID.
200
208
 
201
209
  <!-- UsageSnippet language="typescript" operationID="get_buyer" method="get" path="/buyers/{buyer_id}" -->
202
210
  ```typescript
203
- import { Gr4vy, withToken } from "@gr4vy/sdk";
204
- import fs from "fs";
211
+ import { Gr4vy } from "@gr4vy/sdk";
205
212
 
206
213
  const gr4vy = new Gr4vy({
207
- id: "example",
208
- server: "sandbox",
209
- merchantAccountId: "default",
210
- bearerAuth: withToken({
211
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
212
- }),
214
+ merchantAccountId: "<id>",
215
+ server: "sandbox",
216
+ id: "example",
217
+ bearerAuth: withToken({
218
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
219
+ }),
213
220
  });
214
221
 
215
222
  async function run() {
@@ -227,13 +234,18 @@ The standalone function version of this method:
227
234
 
228
235
  ```typescript
229
236
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
237
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
230
238
  import { buyersGet } from "@gr4vy/sdk/funcs/buyersGet.js";
231
239
 
232
240
  // Use `Gr4vyCore` for best tree-shaking performance.
233
241
  // You can create one instance of it to use across an application.
234
242
  const gr4vy = new Gr4vyCore({
235
243
  merchantAccountId: "<id>",
236
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
244
+ server: "sandbox",
245
+ id: "example",
246
+ bearerAuth: withToken({
247
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
248
+ }),
237
249
  });
238
250
 
239
251
  async function run() {
@@ -289,16 +301,15 @@ Updates a buyer record.
289
301
 
290
302
  <!-- UsageSnippet language="typescript" operationID="update_buyer" method="put" path="/buyers/{buyer_id}" -->
291
303
  ```typescript
292
- import { Gr4vy, withToken } from "@gr4vy/sdk";
293
- import fs from "fs";
304
+ import { Gr4vy } from "@gr4vy/sdk";
294
305
 
295
306
  const gr4vy = new Gr4vy({
296
- id: "example",
297
- server: "sandbox",
298
- merchantAccountId: "default",
299
- bearerAuth: withToken({
300
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
301
- }),
307
+ merchantAccountId: "<id>",
308
+ server: "sandbox",
309
+ id: "example",
310
+ bearerAuth: withToken({
311
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
312
+ }),
302
313
  });
303
314
 
304
315
  async function run() {
@@ -316,13 +327,18 @@ The standalone function version of this method:
316
327
 
317
328
  ```typescript
318
329
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
330
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
319
331
  import { buyersUpdate } from "@gr4vy/sdk/funcs/buyersUpdate.js";
320
332
 
321
333
  // Use `Gr4vyCore` for best tree-shaking performance.
322
334
  // You can create one instance of it to use across an application.
323
335
  const gr4vy = new Gr4vyCore({
324
336
  merchantAccountId: "<id>",
325
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
337
+ server: "sandbox",
338
+ id: "example",
339
+ bearerAuth: withToken({
340
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
341
+ }),
326
342
  });
327
343
 
328
344
  async function run() {
@@ -379,16 +395,15 @@ Permanently removes a buyer record.
379
395
 
380
396
  <!-- UsageSnippet language="typescript" operationID="delete_buyer" method="delete" path="/buyers/{buyer_id}" -->
381
397
  ```typescript
382
- import { Gr4vy, withToken } from "@gr4vy/sdk";
383
- import fs from "fs";
398
+ import { Gr4vy } from "@gr4vy/sdk";
384
399
 
385
400
  const gr4vy = new Gr4vy({
386
- id: "example",
387
- server: "sandbox",
388
- merchantAccountId: "default",
389
- bearerAuth: withToken({
390
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
391
- }),
401
+ merchantAccountId: "<id>",
402
+ server: "sandbox",
403
+ id: "example",
404
+ bearerAuth: withToken({
405
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
406
+ }),
392
407
  });
393
408
 
394
409
  async function run() {
@@ -406,13 +421,18 @@ The standalone function version of this method:
406
421
 
407
422
  ```typescript
408
423
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
424
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
409
425
  import { buyersDelete } from "@gr4vy/sdk/funcs/buyersDelete.js";
410
426
 
411
427
  // Use `Gr4vyCore` for best tree-shaking performance.
412
428
  // You can create one instance of it to use across an application.
413
429
  const gr4vy = new Gr4vyCore({
414
430
  merchantAccountId: "<id>",
415
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
431
+ server: "sandbox",
432
+ id: "example",
433
+ bearerAuth: withToken({
434
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
435
+ }),
416
436
  });
417
437
 
418
438
  async function run() {
@@ -15,16 +15,15 @@ Fetch a list of the definitions of each card scheme.
15
15
 
16
16
  <!-- UsageSnippet language="typescript" operationID="list_card_scheme_definitions" method="get" path="/card-scheme-definitions" -->
17
17
  ```typescript
18
- import { Gr4vy, withToken } from "@gr4vy/sdk";
19
- import fs from "fs";
18
+ import { Gr4vy } from "@gr4vy/sdk";
20
19
 
21
20
  const gr4vy = new Gr4vy({
22
- id: "example",
23
- server: "sandbox",
24
- merchantAccountId: "default",
25
- bearerAuth: withToken({
26
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
27
- }),
21
+ merchantAccountId: "<id>",
22
+ server: "sandbox",
23
+ id: "example",
24
+ bearerAuth: withToken({
25
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
26
+ }),
28
27
  });
29
28
 
30
29
  async function run() {
@@ -42,13 +41,18 @@ The standalone function version of this method:
42
41
 
43
42
  ```typescript
44
43
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
44
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
45
45
  import { cardSchemeDefinitionsList } from "@gr4vy/sdk/funcs/cardSchemeDefinitionsList.js";
46
46
 
47
47
  // Use `Gr4vyCore` for best tree-shaking performance.
48
48
  // You can create one instance of it to use across an application.
49
49
  const gr4vy = new Gr4vyCore({
50
50
  merchantAccountId: "<id>",
51
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
51
+ server: "sandbox",
52
+ id: "example",
53
+ bearerAuth: withToken({
54
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
55
+ }),
52
56
  });
53
57
 
54
58
  async function run() {