@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
@@ -17,16 +17,15 @@ List all executions of a specific report.
17
17
 
18
18
  <!-- UsageSnippet language="typescript" operationID="list_report_executions" method="get" path="/reports/{report_id}/executions" -->
19
19
  ```typescript
20
- import { Gr4vy, withToken } from "@gr4vy/sdk";
21
- import fs from "fs";
20
+ import { Gr4vy } from "@gr4vy/sdk";
22
21
 
23
22
  const gr4vy = new Gr4vy({
24
- id: "example",
25
- server: "sandbox",
26
- merchantAccountId: "default",
27
- bearerAuth: withToken({
28
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
29
- }),
23
+ merchantAccountId: "<id>",
24
+ server: "sandbox",
25
+ id: "example",
26
+ bearerAuth: withToken({
27
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
28
+ }),
30
29
  });
31
30
 
32
31
  async function run() {
@@ -46,13 +45,18 @@ The standalone function version of this method:
46
45
 
47
46
  ```typescript
48
47
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
48
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
49
49
  import { reportsExecutionsList } from "@gr4vy/sdk/funcs/reportsExecutionsList.js";
50
50
 
51
51
  // Use `Gr4vyCore` for best tree-shaking performance.
52
52
  // You can create one instance of it to use across an application.
53
53
  const gr4vy = new Gr4vyCore({
54
54
  merchantAccountId: "<id>",
55
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
55
+ server: "sandbox",
56
+ id: "example",
57
+ bearerAuth: withToken({
58
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
59
+ }),
56
60
  });
57
61
 
58
62
  async function run() {
@@ -112,16 +116,15 @@ Creates a download URL for a specific execution of a report.
112
116
 
113
117
  <!-- UsageSnippet language="typescript" operationID="create_report_execution_url" method="post" path="/reports/{report_id}/executions/{report_execution_id}/url" -->
114
118
  ```typescript
115
- import { Gr4vy, withToken } from "@gr4vy/sdk";
116
- import fs from "fs";
119
+ import { Gr4vy } from "@gr4vy/sdk";
117
120
 
118
121
  const gr4vy = new Gr4vy({
119
- id: "example",
120
- server: "sandbox",
121
- merchantAccountId: "default",
122
- bearerAuth: withToken({
123
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
124
- }),
122
+ merchantAccountId: "<id>",
123
+ server: "sandbox",
124
+ id: "example",
125
+ bearerAuth: withToken({
126
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
127
+ }),
125
128
  });
126
129
 
127
130
  async function run() {
@@ -139,13 +142,18 @@ The standalone function version of this method:
139
142
 
140
143
  ```typescript
141
144
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
145
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
142
146
  import { reportsExecutionsUrl } from "@gr4vy/sdk/funcs/reportsExecutionsUrl.js";
143
147
 
144
148
  // Use `Gr4vyCore` for best tree-shaking performance.
145
149
  // You can create one instance of it to use across an application.
146
150
  const gr4vy = new Gr4vyCore({
147
151
  merchantAccountId: "<id>",
148
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
152
+ server: "sandbox",
153
+ id: "example",
154
+ bearerAuth: withToken({
155
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
156
+ }),
149
157
  });
150
158
 
151
159
  async function run() {
@@ -202,16 +210,15 @@ Fetch a specific executed report.
202
210
 
203
211
  <!-- UsageSnippet language="typescript" operationID="get_report_execution" method="get" path="/report-executions/{report_execution_id}" -->
204
212
  ```typescript
205
- import { Gr4vy, withToken } from "@gr4vy/sdk";
206
- import fs from "fs";
213
+ import { Gr4vy } from "@gr4vy/sdk";
207
214
 
208
215
  const gr4vy = new Gr4vy({
209
- id: "example",
210
- server: "sandbox",
211
- merchantAccountId: "default",
212
- bearerAuth: withToken({
213
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
214
- }),
216
+ merchantAccountId: "<id>",
217
+ server: "sandbox",
218
+ id: "example",
219
+ bearerAuth: withToken({
220
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
221
+ }),
215
222
  });
216
223
 
217
224
  async function run() {
@@ -229,13 +236,18 @@ The standalone function version of this method:
229
236
 
230
237
  ```typescript
231
238
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
239
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
232
240
  import { reportsExecutionsGet } from "@gr4vy/sdk/funcs/reportsExecutionsGet.js";
233
241
 
234
242
  // Use `Gr4vyCore` for best tree-shaking performance.
235
243
  // You can create one instance of it to use across an application.
236
244
  const gr4vy = new Gr4vyCore({
237
245
  merchantAccountId: "<id>",
238
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
246
+ server: "sandbox",
247
+ id: "example",
248
+ bearerAuth: withToken({
249
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
250
+ }),
239
251
  });
240
252
 
241
253
  async function run() {
@@ -18,16 +18,15 @@ Fetch details about a gift card.
18
18
 
19
19
  <!-- UsageSnippet language="typescript" operationID="get_gift_card" method="get" path="/gift-cards/{gift_card_id}" -->
20
20
  ```typescript
21
- import { Gr4vy, withToken } from "@gr4vy/sdk";
22
- import fs from "fs";
21
+ import { Gr4vy } from "@gr4vy/sdk";
23
22
 
24
23
  const gr4vy = new Gr4vy({
25
- id: "example",
26
- server: "sandbox",
27
- merchantAccountId: "default",
28
- bearerAuth: withToken({
29
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
30
- }),
24
+ merchantAccountId: "<id>",
25
+ server: "sandbox",
26
+ id: "example",
27
+ bearerAuth: withToken({
28
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
29
+ }),
31
30
  });
32
31
 
33
32
  async function run() {
@@ -45,13 +44,18 @@ The standalone function version of this method:
45
44
 
46
45
  ```typescript
47
46
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
47
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
48
48
  import { giftCardsGet } from "@gr4vy/sdk/funcs/giftCardsGet.js";
49
49
 
50
50
  // Use `Gr4vyCore` for best tree-shaking performance.
51
51
  // You can create one instance of it to use across an application.
52
52
  const gr4vy = new Gr4vyCore({
53
53
  merchantAccountId: "<id>",
54
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
54
+ server: "sandbox",
55
+ id: "example",
56
+ bearerAuth: withToken({
57
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
58
+ }),
55
59
  });
56
60
 
57
61
  async function run() {
@@ -107,16 +111,15 @@ Removes a gift card from our system.
107
111
 
108
112
  <!-- UsageSnippet language="typescript" operationID="delete_gift_card" method="delete" path="/gift-cards/{gift_card_id}" -->
109
113
  ```typescript
110
- import { Gr4vy, withToken } from "@gr4vy/sdk";
111
- import fs from "fs";
114
+ import { Gr4vy } from "@gr4vy/sdk";
112
115
 
113
116
  const gr4vy = new Gr4vy({
114
- id: "example",
115
- server: "sandbox",
116
- merchantAccountId: "default",
117
- bearerAuth: withToken({
118
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
119
- }),
117
+ merchantAccountId: "<id>",
118
+ server: "sandbox",
119
+ id: "example",
120
+ bearerAuth: withToken({
121
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
122
+ }),
120
123
  });
121
124
 
122
125
  async function run() {
@@ -134,13 +137,18 @@ The standalone function version of this method:
134
137
 
135
138
  ```typescript
136
139
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
140
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
137
141
  import { giftCardsDelete } from "@gr4vy/sdk/funcs/giftCardsDelete.js";
138
142
 
139
143
  // Use `Gr4vyCore` for best tree-shaking performance.
140
144
  // You can create one instance of it to use across an application.
141
145
  const gr4vy = new Gr4vyCore({
142
146
  merchantAccountId: "<id>",
143
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
147
+ server: "sandbox",
148
+ id: "example",
149
+ bearerAuth: withToken({
150
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
151
+ }),
144
152
  });
145
153
 
146
154
  async function run() {
@@ -196,16 +204,15 @@ Store a new gift card in the vault.
196
204
 
197
205
  <!-- UsageSnippet language="typescript" operationID="create_gift_card" method="post" path="/gift-cards" -->
198
206
  ```typescript
199
- import { Gr4vy, withToken } from "@gr4vy/sdk";
200
- import fs from "fs";
207
+ import { Gr4vy } from "@gr4vy/sdk";
201
208
 
202
209
  const gr4vy = new Gr4vy({
203
- id: "example",
204
- server: "sandbox",
205
- merchantAccountId: "default",
206
- bearerAuth: withToken({
207
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
208
- }),
210
+ merchantAccountId: "<id>",
211
+ server: "sandbox",
212
+ id: "example",
213
+ bearerAuth: withToken({
214
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
215
+ }),
209
216
  });
210
217
 
211
218
  async function run() {
@@ -226,13 +233,18 @@ The standalone function version of this method:
226
233
 
227
234
  ```typescript
228
235
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
236
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
229
237
  import { giftCardsCreate } from "@gr4vy/sdk/funcs/giftCardsCreate.js";
230
238
 
231
239
  // Use `Gr4vyCore` for best tree-shaking performance.
232
240
  // You can create one instance of it to use across an application.
233
241
  const gr4vy = new Gr4vyCore({
234
242
  merchantAccountId: "<id>",
235
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
243
+ server: "sandbox",
244
+ id: "example",
245
+ bearerAuth: withToken({
246
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
247
+ }),
236
248
  });
237
249
 
238
250
  async function run() {
@@ -291,16 +303,15 @@ Browser all gift cards.
291
303
 
292
304
  <!-- UsageSnippet language="typescript" operationID="list_gift_cards" method="get" path="/gift-cards" -->
293
305
  ```typescript
294
- import { Gr4vy, withToken } from "@gr4vy/sdk";
295
- import fs from "fs";
306
+ import { Gr4vy } from "@gr4vy/sdk";
296
307
 
297
308
  const gr4vy = new Gr4vy({
298
- id: "example",
299
- server: "sandbox",
300
- merchantAccountId: "default",
301
- bearerAuth: withToken({
302
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
303
- }),
309
+ merchantAccountId: "<id>",
310
+ server: "sandbox",
311
+ id: "example",
312
+ bearerAuth: withToken({
313
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
314
+ }),
304
315
  });
305
316
 
306
317
  async function run() {
@@ -320,13 +331,18 @@ The standalone function version of this method:
320
331
 
321
332
  ```typescript
322
333
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
334
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
323
335
  import { giftCardsList } from "@gr4vy/sdk/funcs/giftCardsList.js";
324
336
 
325
337
  // Use `Gr4vyCore` for best tree-shaking performance.
326
338
  // You can create one instance of it to use across an application.
327
339
  const gr4vy = new Gr4vyCore({
328
340
  merchantAccountId: "<id>",
329
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
341
+ server: "sandbox",
342
+ id: "example",
343
+ bearerAuth: withToken({
344
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
345
+ }),
330
346
  });
331
347
 
332
348
  async function run() {
@@ -15,16 +15,15 @@ List all the stored gift cards for a specific buyer.
15
15
 
16
16
  <!-- UsageSnippet language="typescript" operationID="list_buyer_gift_cards" method="get" path="/buyers/gift-cards" -->
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 { buyersGiftCardsList } from "@gr4vy/sdk/funcs/buyersGiftCardsList.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 @@ List all the stored payment methods for a specific buyer.
15
15
 
16
16
  <!-- UsageSnippet language="typescript" operationID="list_buyer_payment_methods" method="get" path="/buyers/payment-methods" -->
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 { buyersPaymentMethodsList } from "@gr4vy/sdk/funcs/buyersPaymentMethodsList.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() {
@@ -17,16 +17,15 @@ List refunds for a transaction.
17
17
 
18
18
  <!-- UsageSnippet language="typescript" operationID="list_transaction_refunds" method="get" path="/transactions/{transaction_id}/refunds" -->
19
19
  ```typescript
20
- import { Gr4vy, withToken } from "@gr4vy/sdk";
21
- import fs from "fs";
20
+ import { Gr4vy } from "@gr4vy/sdk";
22
21
 
23
22
  const gr4vy = new Gr4vy({
24
- id: "example",
25
- server: "sandbox",
26
- merchantAccountId: "default",
27
- bearerAuth: withToken({
28
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
29
- }),
23
+ merchantAccountId: "<id>",
24
+ server: "sandbox",
25
+ id: "example",
26
+ bearerAuth: withToken({
27
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
28
+ }),
30
29
  });
31
30
 
32
31
  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 { transactionsRefundsList } from "@gr4vy/sdk/funcs/transactionsRefundsList.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() {
@@ -106,16 +110,15 @@ Create a refund for a transaction.
106
110
 
107
111
  <!-- UsageSnippet language="typescript" operationID="create_transaction_refund" method="post" path="/transactions/{transaction_id}/refunds" -->
108
112
  ```typescript
109
- import { Gr4vy, withToken } from "@gr4vy/sdk";
110
- import fs from "fs";
113
+ import { Gr4vy } from "@gr4vy/sdk";
111
114
 
112
115
  const gr4vy = new Gr4vy({
113
- id: "example",
114
- server: "sandbox",
115
- merchantAccountId: "default",
116
- bearerAuth: withToken({
117
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
118
- }),
116
+ merchantAccountId: "<id>",
117
+ server: "sandbox",
118
+ id: "example",
119
+ bearerAuth: withToken({
120
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
121
+ }),
119
122
  });
120
123
 
121
124
  async function run() {
@@ -133,13 +136,18 @@ The standalone function version of this method:
133
136
 
134
137
  ```typescript
135
138
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
139
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
136
140
  import { transactionsRefundsCreate } from "@gr4vy/sdk/funcs/transactionsRefundsCreate.js";
137
141
 
138
142
  // Use `Gr4vyCore` for best tree-shaking performance.
139
143
  // You can create one instance of it to use across an application.
140
144
  const gr4vy = new Gr4vyCore({
141
145
  merchantAccountId: "<id>",
142
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
146
+ server: "sandbox",
147
+ id: "example",
148
+ bearerAuth: withToken({
149
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
150
+ }),
143
151
  });
144
152
 
145
153
  async function run() {
@@ -196,16 +204,15 @@ Fetch refund for a transaction.
196
204
 
197
205
  <!-- UsageSnippet language="typescript" operationID="get_transaction_refund" method="get" path="/transactions/{transaction_id}/refunds/{refund_id}" -->
198
206
  ```typescript
199
- import { Gr4vy, withToken } from "@gr4vy/sdk";
200
- import fs from "fs";
207
+ import { Gr4vy } from "@gr4vy/sdk";
201
208
 
202
209
  const gr4vy = new Gr4vy({
203
- id: "example",
204
- server: "sandbox",
205
- merchantAccountId: "default",
206
- bearerAuth: withToken({
207
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
208
- }),
210
+ merchantAccountId: "<id>",
211
+ server: "sandbox",
212
+ id: "example",
213
+ bearerAuth: withToken({
214
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
215
+ }),
209
216
  });
210
217
 
211
218
  async function run() {
@@ -223,13 +230,18 @@ The standalone function version of this method:
223
230
 
224
231
  ```typescript
225
232
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
233
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
226
234
  import { transactionsRefundsGet } from "@gr4vy/sdk/funcs/transactionsRefundsGet.js";
227
235
 
228
236
  // Use `Gr4vyCore` for best tree-shaking performance.
229
237
  // You can create one instance of it to use across an application.
230
238
  const gr4vy = new Gr4vyCore({
231
239
  merchantAccountId: "<id>",
232
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
240
+ server: "sandbox",
241
+ id: "example",
242
+ bearerAuth: withToken({
243
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
244
+ }),
233
245
  });
234
246
 
235
247
  async function run() {
@@ -15,16 +15,15 @@ Schedule one or more stored cards for an account update.
15
15
 
16
16
  <!-- UsageSnippet language="typescript" operationID="create_account_updater_job" method="post" path="/account-updater/jobs" -->
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() {
@@ -47,13 +46,18 @@ The standalone function version of this method:
47
46
 
48
47
  ```typescript
49
48
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
49
+ import { withToken } from "@gr4vy/sdk/lib/auth.js";
50
50
  import { accountUpdaterJobsCreate } from "@gr4vy/sdk/funcs/accountUpdaterJobsCreate.js";
51
51
 
52
52
  // Use `Gr4vyCore` for best tree-shaking performance.
53
53
  // You can create one instance of it to use across an application.
54
54
  const gr4vy = new Gr4vyCore({
55
55
  merchantAccountId: "<id>",
56
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
56
+ server: "sandbox",
57
+ id: "example",
58
+ bearerAuth: withToken({
59
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
60
+ }),
57
61
  });
58
62
 
59
63
  async function run() {