@grandlinex/base-con 1.0.1 → 1.0.3
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/cjs/BaseCon.d.ts +8 -8
- package/dist/cjs/BaseCon.js +1 -1
- package/dist/mjs/BaseCon.d.ts +8 -8
- package/dist/mjs/BaseCon.js +1 -1
- package/package.json +1 -1
package/dist/cjs/BaseCon.d.ts
CHANGED
|
@@ -46,12 +46,12 @@ export interface ConHandle {
|
|
|
46
46
|
* @class
|
|
47
47
|
*/
|
|
48
48
|
export default class BaseCon {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
api: string;
|
|
50
|
+
permanentHeader: Record<string, string>;
|
|
51
|
+
authorization: string | null;
|
|
52
|
+
noAuth: boolean;
|
|
53
|
+
disconnected: boolean;
|
|
54
|
+
logger: (arg: any) => void;
|
|
55
55
|
con: ConHandle;
|
|
56
56
|
reconnect: () => Promise<boolean>;
|
|
57
57
|
onReconnect: (con: BaseCon) => Promise<boolean>;
|
|
@@ -96,14 +96,14 @@ export default class BaseCon {
|
|
|
96
96
|
* @return {string} The authorization token or an empty string if none is set.
|
|
97
97
|
*/
|
|
98
98
|
getBearer(): string | null;
|
|
99
|
-
|
|
99
|
+
p(path: string, config?: ConHandleConfig): string;
|
|
100
100
|
/**
|
|
101
101
|
* Sends a ping request to the API to verify connectivity and version availability.
|
|
102
102
|
*
|
|
103
103
|
* @return {boolean} `true` if the API responded with a 200 status code and a valid version object; `false` otherwise.
|
|
104
104
|
*/
|
|
105
105
|
ping(): Promise<boolean>;
|
|
106
|
-
|
|
106
|
+
tokenHeader(): Record<string, string>;
|
|
107
107
|
setPermanentHeader(header: Record<string, string>): void;
|
|
108
108
|
/**
|
|
109
109
|
* Validates the current authentication token by performing a ping and a test request
|
package/dist/cjs/BaseCon.js
CHANGED
|
@@ -233,7 +233,7 @@ class BaseCon {
|
|
|
233
233
|
});
|
|
234
234
|
if (token.code === 200 || token.code === 201) {
|
|
235
235
|
if (!dry) {
|
|
236
|
-
this.authorization =
|
|
236
|
+
this.authorization = token.data?.token || null;
|
|
237
237
|
this.disconnected = false;
|
|
238
238
|
this.noAuth = false;
|
|
239
239
|
this.reconnect = async () => {
|
package/dist/mjs/BaseCon.d.ts
CHANGED
|
@@ -46,12 +46,12 @@ export interface ConHandle {
|
|
|
46
46
|
* @class
|
|
47
47
|
*/
|
|
48
48
|
export default class BaseCon {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
api: string;
|
|
50
|
+
permanentHeader: Record<string, string>;
|
|
51
|
+
authorization: string | null;
|
|
52
|
+
noAuth: boolean;
|
|
53
|
+
disconnected: boolean;
|
|
54
|
+
logger: (arg: any) => void;
|
|
55
55
|
con: ConHandle;
|
|
56
56
|
reconnect: () => Promise<boolean>;
|
|
57
57
|
onReconnect: (con: BaseCon) => Promise<boolean>;
|
|
@@ -96,14 +96,14 @@ export default class BaseCon {
|
|
|
96
96
|
* @return {string} The authorization token or an empty string if none is set.
|
|
97
97
|
*/
|
|
98
98
|
getBearer(): string | null;
|
|
99
|
-
|
|
99
|
+
p(path: string, config?: ConHandleConfig): string;
|
|
100
100
|
/**
|
|
101
101
|
* Sends a ping request to the API to verify connectivity and version availability.
|
|
102
102
|
*
|
|
103
103
|
* @return {boolean} `true` if the API responded with a 200 status code and a valid version object; `false` otherwise.
|
|
104
104
|
*/
|
|
105
105
|
ping(): Promise<boolean>;
|
|
106
|
-
|
|
106
|
+
tokenHeader(): Record<string, string>;
|
|
107
107
|
setPermanentHeader(header: Record<string, string>): void;
|
|
108
108
|
/**
|
|
109
109
|
* Validates the current authentication token by performing a ping and a test request
|
package/dist/mjs/BaseCon.js
CHANGED
|
@@ -227,7 +227,7 @@ export default class BaseCon {
|
|
|
227
227
|
});
|
|
228
228
|
if (token.code === 200 || token.code === 201) {
|
|
229
229
|
if (!dry) {
|
|
230
|
-
this.authorization =
|
|
230
|
+
this.authorization = token.data?.token || null;
|
|
231
231
|
this.disconnected = false;
|
|
232
232
|
this.noAuth = false;
|
|
233
233
|
this.reconnect = async () => {
|