@patalink/node-api-client 1.0.0 → 1.0.1
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/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -26,11 +26,13 @@ interface TransactionStatus {
|
|
|
26
26
|
interface ClientConfig {
|
|
27
27
|
apiKey: string;
|
|
28
28
|
encryptionKey: string;
|
|
29
|
+
baseUrl: string;
|
|
29
30
|
timeout?: number;
|
|
30
31
|
}
|
|
31
32
|
declare class PataLinkClient {
|
|
32
33
|
private apiKey;
|
|
33
34
|
private encryptionKey;
|
|
35
|
+
private baseUrl;
|
|
34
36
|
private timeout;
|
|
35
37
|
constructor(config: ClientConfig);
|
|
36
38
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -26,11 +26,13 @@ interface TransactionStatus {
|
|
|
26
26
|
interface ClientConfig {
|
|
27
27
|
apiKey: string;
|
|
28
28
|
encryptionKey: string;
|
|
29
|
+
baseUrl: string;
|
|
29
30
|
timeout?: number;
|
|
30
31
|
}
|
|
31
32
|
declare class PataLinkClient {
|
|
32
33
|
private apiKey;
|
|
33
34
|
private encryptionKey;
|
|
35
|
+
private baseUrl;
|
|
34
36
|
private timeout;
|
|
35
37
|
constructor(config: ClientConfig);
|
|
36
38
|
/**
|
package/dist/index.js
CHANGED
|
@@ -35,12 +35,12 @@ __export(index_exports, {
|
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(index_exports);
|
|
37
37
|
var CryptoJS = __toESM(require("crypto-js"));
|
|
38
|
-
var BASE_URL = "http://localhost:3001";
|
|
39
38
|
var PataLinkClient = class {
|
|
40
39
|
constructor(config) {
|
|
41
40
|
if (!config.apiKey) throw new Error("API key is required");
|
|
42
41
|
if (!config.encryptionKey) throw new Error("Encryption key is required");
|
|
43
42
|
this.apiKey = config.apiKey;
|
|
43
|
+
this.baseUrl = config.baseUrl;
|
|
44
44
|
this.encryptionKey = config.encryptionKey;
|
|
45
45
|
this.timeout = config.timeout || 3e4;
|
|
46
46
|
}
|
|
@@ -73,7 +73,7 @@ var PataLinkClient = class {
|
|
|
73
73
|
const controller = new AbortController();
|
|
74
74
|
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
75
75
|
try {
|
|
76
|
-
const response = await fetch(`${
|
|
76
|
+
const response = await fetch(`${this.baseUrl}${endpoint}`, {
|
|
77
77
|
...options,
|
|
78
78
|
headers: {
|
|
79
79
|
"Authorization": `Bearer ${this.apiKey}`,
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import * as CryptoJS from "crypto-js";
|
|
3
|
-
var BASE_URL = "http://localhost:3001";
|
|
4
3
|
var PataLinkClient = class {
|
|
5
4
|
constructor(config) {
|
|
6
5
|
if (!config.apiKey) throw new Error("API key is required");
|
|
7
6
|
if (!config.encryptionKey) throw new Error("Encryption key is required");
|
|
8
7
|
this.apiKey = config.apiKey;
|
|
8
|
+
this.baseUrl = config.baseUrl;
|
|
9
9
|
this.encryptionKey = config.encryptionKey;
|
|
10
10
|
this.timeout = config.timeout || 3e4;
|
|
11
11
|
}
|
|
@@ -38,7 +38,7 @@ var PataLinkClient = class {
|
|
|
38
38
|
const controller = new AbortController();
|
|
39
39
|
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
40
40
|
try {
|
|
41
|
-
const response = await fetch(`${
|
|
41
|
+
const response = await fetch(`${this.baseUrl}${endpoint}`, {
|
|
42
42
|
...options,
|
|
43
43
|
headers: {
|
|
44
44
|
"Authorization": `Bearer ${this.apiKey}`,
|