@gr4vy/sdk 1.0.3 → 1.0.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 +8 -10
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Gr4vy
|
|
1
|
+
# Gr4vy TypeScript SDK
|
|
2
2
|
|
|
3
|
-
Developer-friendly & type-safe
|
|
3
|
+
Developer-friendly & type-safe TypeScript SDK specifically catered to leverage the **Gr4vy** API.
|
|
4
4
|
|
|
5
5
|
<div align="left">
|
|
6
6
|
<a href="https://www.npmjs.com/package/@gr4vy/sdk"><img alt="NPM Version" src="https://img.shields.io/npm/v/%40gr4vy%2Fsdk?style=for-the-badge" /></a>
|
|
@@ -9,9 +9,7 @@ Developer-friendly & type-safe Typescript SDK specifically catered to leverage t
|
|
|
9
9
|
|
|
10
10
|
## Summary
|
|
11
11
|
|
|
12
|
-
Gr4vy
|
|
13
|
-
|
|
14
|
-
The official Gr4vy SDK for Typescript provides a convenient way to interact with the Gr4vy API from your server-side application. This SDK allows you to seamlessly integrate Gr4vy's powerful payment orchestration capabilities, including:
|
|
12
|
+
The official Gr4vy SDK for TypeScript provides a convenient way to interact with the Gr4vy API from your server-side application. This SDK allows you to seamlessly integrate Gr4vy's powerful payment orchestration capabilities, including:
|
|
15
13
|
|
|
16
14
|
* Creating Transactions: Initiate and process payments with various payment methods and services.
|
|
17
15
|
* Managing Buyers: Store and manage buyer information securely.
|
|
@@ -26,7 +24,7 @@ This SDK is designed to simplify development, reduce boilerplate code, and help
|
|
|
26
24
|
<!-- Start Table of Contents [toc] -->
|
|
27
25
|
## Table of Contents
|
|
28
26
|
<!-- $toc-max-depth=2 -->
|
|
29
|
-
* [Gr4vy
|
|
27
|
+
* [Gr4vy TypeScript SDK](#gr4vy-typescript-sdk)
|
|
30
28
|
* [SDK Installation](#sdk-installation)
|
|
31
29
|
* [Requirements](#requirements)
|
|
32
30
|
* [SDK Example Usage](#sdk-example-usage)
|
|
@@ -523,8 +521,8 @@ You can override the default server globally by passing a server name to the `se
|
|
|
523
521
|
|
|
524
522
|
| Name | Server | Variables | Description |
|
|
525
523
|
| ------------ | ------------------------------------ | --------- | ----------- |
|
|
526
|
-
| `production` | `https://api.{id}.gr4vy.app` | `id` | |
|
|
527
524
|
| `sandbox` | `https://api.sandbox.{id}.gr4vy.app` | `id` | |
|
|
525
|
+
| `production` | `https://api.{id}.gr4vy.app` | `id` | |
|
|
528
526
|
|
|
529
527
|
If the selected server has variables, you may override its default values through the additional parameters made available in the SDK constructor:
|
|
530
528
|
|
|
@@ -538,7 +536,7 @@ If the selected server has variables, you may override its default values throug
|
|
|
538
536
|
import { Gr4vy } from "@gr4vy/sdk";
|
|
539
537
|
|
|
540
538
|
const gr4vy = new Gr4vy({
|
|
541
|
-
server: "
|
|
539
|
+
server: "production",
|
|
542
540
|
id: "<id>",
|
|
543
541
|
merchantAccountId: "<id>",
|
|
544
542
|
server: "sandbox",
|
|
@@ -570,7 +568,7 @@ The default server can also be overridden globally by passing a URL to the `serv
|
|
|
570
568
|
import { Gr4vy } from "@gr4vy/sdk";
|
|
571
569
|
|
|
572
570
|
const gr4vy = new Gr4vy({
|
|
573
|
-
serverURL: "https://api.example.gr4vy.app",
|
|
571
|
+
serverURL: "https://api.sandbox.example.gr4vy.app",
|
|
574
572
|
merchantAccountId: "<id>",
|
|
575
573
|
server: "sandbox",
|
|
576
574
|
id: "example",
|
|
@@ -879,7 +877,7 @@ Gr4vy: The Gr4vy API.
|
|
|
879
877
|
<!-- Start Table of Contents [toc] -->
|
|
880
878
|
## Table of Contents
|
|
881
879
|
<!-- $toc-max-depth=2 -->
|
|
882
|
-
* [Gr4vy
|
|
880
|
+
* [Gr4vy TypeScript SDK](#gr4vy-typescript-sdk)
|
|
883
881
|
* [SDK Installation](#sdk-installation)
|
|
884
882
|
* [Requirements](#requirements)
|
|
885
883
|
* [SDK Example Usage](#sdk-example-usage)
|
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.5";
|
|
48
|
+
readonly genVersion: "2.644.1";
|
|
49
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.0.5 2.644.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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AAM,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.5",
|
|
41
|
+
genVersion: "2.644.1",
|
|
42
|
+
userAgent: "speakeasy-sdk/typescript 1.0.5 2.644.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.5",
|
|
81
|
+
genVersion: "2.644.1",
|
|
82
|
+
userAgent: "speakeasy-sdk/typescript 1.0.5 2.644.1 1.0.0 @gr4vy/sdk",
|
|
83
83
|
} as const;
|