@gr4vy/sdk 1.0.3 → 1.0.4
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 +3 -3
- package/jsr.json +1 -1
- package/lib/config.d.ts +5 -5
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +9 -9
- package/lib/config.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +8 -8
package/README.md
CHANGED
|
@@ -523,8 +523,8 @@ You can override the default server globally by passing a server name to the `se
|
|
|
523
523
|
|
|
524
524
|
| Name | Server | Variables | Description |
|
|
525
525
|
| ------------ | ------------------------------------ | --------- | ----------- |
|
|
526
|
-
| `production` | `https://api.{id}.gr4vy.app` | `id` | |
|
|
527
526
|
| `sandbox` | `https://api.sandbox.{id}.gr4vy.app` | `id` | |
|
|
527
|
+
| `production` | `https://api.{id}.gr4vy.app` | `id` | |
|
|
528
528
|
|
|
529
529
|
If the selected server has variables, you may override its default values through the additional parameters made available in the SDK constructor:
|
|
530
530
|
|
|
@@ -538,7 +538,7 @@ If the selected server has variables, you may override its default values throug
|
|
|
538
538
|
import { Gr4vy } from "@gr4vy/sdk";
|
|
539
539
|
|
|
540
540
|
const gr4vy = new Gr4vy({
|
|
541
|
-
server: "
|
|
541
|
+
server: "production",
|
|
542
542
|
id: "<id>",
|
|
543
543
|
merchantAccountId: "<id>",
|
|
544
544
|
server: "sandbox",
|
|
@@ -570,7 +570,7 @@ The default server can also be overridden globally by passing a URL to the `serv
|
|
|
570
570
|
import { Gr4vy } from "@gr4vy/sdk";
|
|
571
571
|
|
|
572
572
|
const gr4vy = new Gr4vy({
|
|
573
|
-
serverURL: "https://api.example.gr4vy.app",
|
|
573
|
+
serverURL: "https://api.sandbox.example.gr4vy.app",
|
|
574
574
|
merchantAccountId: "<id>",
|
|
575
575
|
server: "sandbox",
|
|
576
576
|
id: "example",
|
package/jsr.json
CHANGED
package/lib/config.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { HTTPClient } from "./http.js";
|
|
2
2
|
import { Logger } from "./logger.js";
|
|
3
3
|
import { RetryConfig } from "./retries.js";
|
|
4
|
-
export declare const ServerProduction = "production";
|
|
5
4
|
export declare const ServerSandbox = "sandbox";
|
|
5
|
+
export declare const ServerProduction = "production";
|
|
6
6
|
/**
|
|
7
7
|
* Contains the list of servers available to the SDK
|
|
8
8
|
*/
|
|
9
9
|
export declare const ServerList: {
|
|
10
|
-
readonly production: "https://api.{id}.gr4vy.app";
|
|
11
10
|
readonly sandbox: "https://api.sandbox.{id}.gr4vy.app";
|
|
11
|
+
readonly production: "https://api.{id}.gr4vy.app";
|
|
12
12
|
};
|
|
13
13
|
export type SDKOptions = {
|
|
14
14
|
bearerAuth?: string | (() => Promise<string>) | undefined;
|
|
@@ -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.0.
|
|
48
|
-
readonly genVersion: "2.
|
|
49
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.0.
|
|
47
|
+
readonly sdkVersion: "1.0.4";
|
|
48
|
+
readonly genVersion: "2.640.1";
|
|
49
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.0.4 2.640.1 1.0.0 @gr4vy/sdk";
|
|
50
50
|
};
|
|
51
51
|
//# sourceMappingURL=config.d.ts.map
|
package/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/lib/config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/lib/config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C;;GAEG;AACH,eAAO,MAAM,UAAU;;;CAGb,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC;IAE1D;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEvC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,OAAO,UAAU,GAAG,SAAS,CAAC;IAC7C;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,UAAU,GAAG,GAAG,GAAG,IAAI,CAsBpE;AAED,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC"}
|
package/lib/config.js
CHANGED
|
@@ -3,31 +3,31 @@
|
|
|
3
3
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SDK_METADATA = exports.ServerList = exports.
|
|
6
|
+
exports.SDK_METADATA = exports.ServerList = exports.ServerProduction = exports.ServerSandbox = void 0;
|
|
7
7
|
exports.serverURLFromOptions = serverURLFromOptions;
|
|
8
8
|
const url_js_1 = require("./url.js");
|
|
9
|
-
exports.ServerProduction = "production";
|
|
10
9
|
exports.ServerSandbox = "sandbox";
|
|
10
|
+
exports.ServerProduction = "production";
|
|
11
11
|
/**
|
|
12
12
|
* Contains the list of servers available to the SDK
|
|
13
13
|
*/
|
|
14
14
|
exports.ServerList = {
|
|
15
|
-
[exports.ServerProduction]: "https://api.{id}.gr4vy.app",
|
|
16
15
|
[exports.ServerSandbox]: "https://api.sandbox.{id}.gr4vy.app",
|
|
16
|
+
[exports.ServerProduction]: "https://api.{id}.gr4vy.app",
|
|
17
17
|
};
|
|
18
18
|
function serverURLFromOptions(options) {
|
|
19
19
|
let serverURL = options.serverURL;
|
|
20
20
|
const serverParams = {
|
|
21
|
-
"
|
|
21
|
+
"sandbox": {
|
|
22
22
|
"id": options.id ?? "example",
|
|
23
23
|
},
|
|
24
|
-
"
|
|
24
|
+
"production": {
|
|
25
25
|
"id": options.id ?? "example",
|
|
26
26
|
},
|
|
27
27
|
};
|
|
28
28
|
let params = {};
|
|
29
29
|
if (!serverURL) {
|
|
30
|
-
const server = options.server ?? exports.
|
|
30
|
+
const server = options.server ?? exports.ServerSandbox;
|
|
31
31
|
serverURL = exports.ServerList[server] || "";
|
|
32
32
|
params = serverParams[server] || {};
|
|
33
33
|
}
|
|
@@ -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.0.
|
|
41
|
-
genVersion: "2.
|
|
42
|
-
userAgent: "speakeasy-sdk/typescript 1.0.
|
|
40
|
+
sdkVersion: "1.0.4",
|
|
41
|
+
genVersion: "2.640.1",
|
|
42
|
+
userAgent: "speakeasy-sdk/typescript 1.0.4 2.640.1 1.0.0 @gr4vy/sdk",
|
|
43
43
|
};
|
|
44
44
|
//# sourceMappingURL=config.js.map
|
package/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/lib/config.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAkDH,oDAsBC;AAnED,qCAA8C;AAEjC,QAAA,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/lib/config.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAkDH,oDAsBC;AAnED,qCAA8C;AAEjC,QAAA,aAAa,GAAG,SAAS,CAAC;AAC1B,QAAA,gBAAgB,GAAG,YAAY,CAAC;AAC7C;;GAEG;AACU,QAAA,UAAU,GAAG;IACxB,CAAC,qBAAa,CAAC,EAAE,oCAAoC;IACrD,CAAC,wBAAgB,CAAC,EAAE,4BAA4B;CACxC,CAAC;AAmCX,SAAgB,oBAAoB,CAAC,OAAmB;IACtD,IAAI,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAElC,MAAM,YAAY,GAA2B;QAC3C,SAAS,EAAE;YACT,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,SAAS;SAC9B;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,SAAS;SAC9B;KACF,CAAC;IAEF,IAAI,MAAM,GAAW,EAAE,CAAC;IAExB,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,qBAAa,CAAC;QAC/C,SAAS,GAAG,kBAAU,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACrC,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,GAAG,IAAA,mBAAU,EAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;IACxC,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAEY,QAAA,YAAY,GAAG;IAC1B,QAAQ,EAAE,YAAY;IACtB,iBAAiB,EAAE,OAAO;IAC1B,UAAU,EAAE,OAAO;IACnB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,yDAAyD;CAC5D,CAAC"}
|
package/package.json
CHANGED
package/src/lib/config.ts
CHANGED
|
@@ -7,14 +7,14 @@ import { Logger } from "./logger.js";
|
|
|
7
7
|
import { RetryConfig } from "./retries.js";
|
|
8
8
|
import { Params, pathToFunc } from "./url.js";
|
|
9
9
|
|
|
10
|
-
export const ServerProduction = "production";
|
|
11
10
|
export const ServerSandbox = "sandbox";
|
|
11
|
+
export const ServerProduction = "production";
|
|
12
12
|
/**
|
|
13
13
|
* Contains the list of servers available to the SDK
|
|
14
14
|
*/
|
|
15
15
|
export const ServerList = {
|
|
16
|
-
[ServerProduction]: "https://api.{id}.gr4vy.app",
|
|
17
16
|
[ServerSandbox]: "https://api.sandbox.{id}.gr4vy.app",
|
|
17
|
+
[ServerProduction]: "https://api.{id}.gr4vy.app",
|
|
18
18
|
} as const;
|
|
19
19
|
|
|
20
20
|
export type SDKOptions = {
|
|
@@ -54,10 +54,10 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
54
54
|
let serverURL = options.serverURL;
|
|
55
55
|
|
|
56
56
|
const serverParams: Record<string, Params> = {
|
|
57
|
-
"
|
|
57
|
+
"sandbox": {
|
|
58
58
|
"id": options.id ?? "example",
|
|
59
59
|
},
|
|
60
|
-
"
|
|
60
|
+
"production": {
|
|
61
61
|
"id": options.id ?? "example",
|
|
62
62
|
},
|
|
63
63
|
};
|
|
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
let params: Params = {};
|
|
66
66
|
|
|
67
67
|
if (!serverURL) {
|
|
68
|
-
const server = options.server ??
|
|
68
|
+
const server = options.server ?? ServerSandbox;
|
|
69
69
|
serverURL = ServerList[server] || "";
|
|
70
70
|
params = serverParams[server] || {};
|
|
71
71
|
}
|
|
@@ -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.0.
|
|
81
|
-
genVersion: "2.
|
|
82
|
-
userAgent: "speakeasy-sdk/typescript 1.0.
|
|
80
|
+
sdkVersion: "1.0.4",
|
|
81
|
+
genVersion: "2.640.1",
|
|
82
|
+
userAgent: "speakeasy-sdk/typescript 1.0.4 2.640.1 1.0.0 @gr4vy/sdk",
|
|
83
83
|
} as const;
|