@gr4vy/sdk 1.10.3 → 1.10.5

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.
package/README.md CHANGED
@@ -638,19 +638,23 @@ The `HTTPClient` constructor takes an optional `fetcher` argument that can be
638
638
  used to integrate a third-party HTTP client or when writing tests to mock out
639
639
  the HTTP client and feed in fixtures.
640
640
 
641
- The following example shows how to use the `"beforeRequest"` hook to to add a
642
- custom header and a timeout to requests and how to use the `"requestError"` hook
643
- to log errors:
641
+ The following example shows how to:
642
+ - route requests through a proxy server using [undici](https://www.npmjs.com/package/undici)'s ProxyAgent
643
+ - use the `"beforeRequest"` hook to add a custom header and a timeout to requests
644
+ - use the `"requestError"` hook to log errors
644
645
 
645
646
  ```typescript
646
647
  import { Gr4vy } from "@gr4vy/sdk";
648
+ import { ProxyAgent } from "undici";
647
649
  import { HTTPClient } from "@gr4vy/sdk/lib/http";
648
650
 
651
+ const dispatcher = new ProxyAgent("http://proxy.example.com:8080");
652
+
649
653
  const httpClient = new HTTPClient({
650
- // fetcher takes a function that has the same signature as native `fetch`.
651
- fetcher: (request) => {
652
- return fetch(request);
653
- }
654
+ // 'fetcher' takes a function that has the same signature as native 'fetch'.
655
+ fetcher: (input, init) =>
656
+ // 'dispatcher' is specific to undici and not part of the standard Fetch API.
657
+ fetch(input, { ...init, dispatcher } as RequestInit),
654
658
  });
655
659
 
656
660
  httpClient.addHook("beforeRequest", (request) => {
@@ -837,23 +841,27 @@ const gr4vy = new Gr4vy({
837
841
  });
838
842
 
839
843
  async function run() {
840
- const result = await gr4vy.accountUpdater.jobs.create({
841
- paymentMethodIds: [
842
- "ef9496d8-53a5-4aad-8ca2-00eb68334389",
843
- "f29e886e-93cc-4714-b4a3-12b7a718e595",
844
- ],
845
- }, {
846
- retries: {
847
- strategy: "backoff",
848
- backoff: {
849
- initialInterval: 1,
850
- maxInterval: 50,
851
- exponent: 1.1,
852
- maxElapsedTime: 100,
844
+ const result = await gr4vy.accountUpdater.jobs.create(
845
+ {
846
+ paymentMethodIds: [
847
+ "ef9496d8-53a5-4aad-8ca2-00eb68334389",
848
+ "f29e886e-93cc-4714-b4a3-12b7a718e595",
849
+ ],
850
+ },
851
+ undefined,
852
+ {
853
+ retries: {
854
+ strategy: "backoff",
855
+ backoff: {
856
+ initialInterval: 1,
857
+ maxInterval: 50,
858
+ exponent: 1.1,
859
+ maxElapsedTime: 100,
860
+ },
861
+ retryConnectionErrors: false,
853
862
  },
854
- retryConnectionErrors: false,
855
863
  },
856
- });
864
+ );
857
865
 
858
866
  console.log(result);
859
867
  }
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "..": {
20
20
  "name": "@gr4vy/sdk",
21
- "version": "1.10.3",
21
+ "version": "1.10.5",
22
22
  "dependencies": {
23
23
  "@trust/keyto": "^1.0.1",
24
24
  "jsonwebtoken": "^9.0.3",
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@gr4vy/sdk",
5
- "version": "1.10.3",
5
+ "version": "1.10.5",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/lib/config.d.ts CHANGED
@@ -44,8 +44,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
44
44
  export declare const SDK_METADATA: {
45
45
  readonly language: "typescript";
46
46
  readonly openapiDocVersion: "1.0.0";
47
- readonly sdkVersion: "1.10.3";
48
- readonly genVersion: "2.816.0";
49
- readonly userAgent: "speakeasy-sdk/typescript 1.10.3 2.816.0 1.0.0 @gr4vy/sdk";
47
+ readonly sdkVersion: "1.10.5";
48
+ readonly genVersion: "2.824.1";
49
+ readonly userAgent: "speakeasy-sdk/typescript 1.10.5 2.824.1 1.0.0 @gr4vy/sdk";
50
50
  };
51
51
  //# sourceMappingURL=config.d.ts.map
package/lib/config.js CHANGED
@@ -37,8 +37,8 @@ function serverURLFromOptions(options) {
37
37
  exports.SDK_METADATA = {
38
38
  language: "typescript",
39
39
  openapiDocVersion: "1.0.0",
40
- sdkVersion: "1.10.3",
41
- genVersion: "2.816.0",
42
- userAgent: "speakeasy-sdk/typescript 1.10.3 2.816.0 1.0.0 @gr4vy/sdk",
40
+ sdkVersion: "1.10.5",
41
+ genVersion: "2.824.1",
42
+ userAgent: "speakeasy-sdk/typescript 1.10.5 2.824.1 1.0.0 @gr4vy/sdk",
43
43
  };
44
44
  //# sourceMappingURL=config.js.map
@@ -20,6 +20,7 @@ export declare const CardScheme: {
20
20
  readonly Nyce: "nyce";
21
21
  readonly Other: "other";
22
22
  readonly Pulse: "pulse";
23
+ readonly Qcard: "qcard";
23
24
  readonly Rupay: "rupay";
24
25
  readonly Star: "star";
25
26
  readonly Uatp: "uatp";
@@ -1 +1 @@
1
- {"version":3,"file":"cardscheme.d.ts","sourceRoot":"","sources":["../../src/models/components/cardscheme.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;CAyBb,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAC;AAErD,gBAAgB;AAChB,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,OAAO,CAC9C,UAAU,EACV,CAAC,CAAC,UAAU,EACZ,OAAO,CAC8B,CAAC;AACxC,gBAAgB;AAChB,eAAO,MAAM,yBAAyB,EAAE,CAAC,CAAC,OAAO,CAC/C,MAAM,EACN,CAAC,CAAC,UAAU,EACZ,UAAU,CAC4B,CAAC"}
1
+ {"version":3,"file":"cardscheme.d.ts","sourceRoot":"","sources":["../../src/models/components/cardscheme.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Bb,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAC;AAErD,gBAAgB;AAChB,eAAO,MAAM,wBAAwB,EAAE,CAAC,CAAC,OAAO,CAC9C,UAAU,EACV,CAAC,CAAC,UAAU,EACZ,OAAO,CAC8B,CAAC;AACxC,gBAAgB;AAChB,eAAO,MAAM,yBAAyB,EAAE,CAAC,CAAC,OAAO,CAC/C,MAAM,EACN,CAAC,CAAC,UAAU,EACZ,UAAU,CAC4B,CAAC"}
@@ -58,6 +58,7 @@ exports.CardScheme = {
58
58
  Nyce: "nyce",
59
59
  Other: "other",
60
60
  Pulse: "pulse",
61
+ Qcard: "qcard",
61
62
  Rupay: "rupay",
62
63
  Star: "star",
63
64
  Uatp: "uatp",
@@ -1 +1 @@
1
- {"version":3,"file":"cardscheme.js","sourceRoot":"","sources":["../../src/models/components/cardscheme.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,gEAAkD;AAGrC,QAAA,UAAU,GAAG;IACxB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,YAAY;IACxB,aAAa,EAAE,gBAAgB;IAC/B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,UAAU;IACpB,eAAe,EAAE,kBAAkB;IACnC,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,WAAW;IACtB,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,YAAY;IACxB,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;CACJ,CAAC;AAGX,gBAAgB;AACH,QAAA,wBAAwB,GAIjC,SAAS,CAAC,aAAa,CAAC,kBAAU,CAAC,CAAC;AACxC,gBAAgB;AACH,QAAA,yBAAyB,GAIlC,SAAS,CAAC,cAAc,CAAC,kBAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"cardscheme.js","sourceRoot":"","sources":["../../src/models/components/cardscheme.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,gEAAkD;AAGrC,QAAA,UAAU,GAAG;IACxB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,YAAY;IACxB,aAAa,EAAE,gBAAgB;IAC/B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,UAAU;IACpB,eAAe,EAAE,kBAAkB;IACnC,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,WAAW;IACtB,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,YAAY;IACxB,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;CACJ,CAAC;AAGX,gBAAgB;AACH,QAAA,wBAAwB,GAIjC,SAAS,CAAC,aAAa,CAAC,kBAAU,CAAC,CAAC;AACxC,gBAAgB;AACH,QAAA,yBAAyB,GAIlC,SAAS,CAAC,cAAc,CAAC,kBAAU,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gr4vy/sdk",
3
- "version": "1.10.3",
3
+ "version": "1.10.5",
4
4
  "author": "Gr4vy",
5
5
  "main": "./index.js",
6
6
  "sideEffects": false,
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.10.3",
81
- genVersion: "2.816.0",
82
- userAgent: "speakeasy-sdk/typescript 1.10.3 2.816.0 1.0.0 @gr4vy/sdk",
80
+ sdkVersion: "1.10.5",
81
+ genVersion: "2.824.1",
82
+ userAgent: "speakeasy-sdk/typescript 1.10.5 2.824.1 1.0.0 @gr4vy/sdk",
83
83
  } as const;
@@ -26,6 +26,7 @@ export const CardScheme = {
26
26
  Nyce: "nyce",
27
27
  Other: "other",
28
28
  Pulse: "pulse",
29
+ Qcard: "qcard",
29
30
  Rupay: "rupay",
30
31
  Star: "star",
31
32
  Uatp: "uatp",