@kevisual/cnb 0.0.16 → 0.0.17
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/opencode.js +7 -4
- package/dist/routes.js +7 -4
- package/package.json +1 -1
- package/src/cnb-core.ts +6 -4
package/dist/opencode.js
CHANGED
|
@@ -22509,9 +22509,12 @@ class InitEnv2 {
|
|
|
22509
22509
|
InitEnv2.init();
|
|
22510
22510
|
|
|
22511
22511
|
// src/cnb-core.ts
|
|
22512
|
+
var API_BASER_URL = "https://api.cnb.cool";
|
|
22513
|
+
var API_HACK_URL = "https://cnb.cool";
|
|
22514
|
+
|
|
22512
22515
|
class CNBCore {
|
|
22513
|
-
baseURL =
|
|
22514
|
-
hackURL =
|
|
22516
|
+
baseURL = API_BASER_URL;
|
|
22517
|
+
hackURL = API_HACK_URL;
|
|
22515
22518
|
token;
|
|
22516
22519
|
cookie;
|
|
22517
22520
|
constructor(options) {
|
|
@@ -22526,8 +22529,8 @@ class CNBCore {
|
|
|
22526
22529
|
}
|
|
22527
22530
|
}
|
|
22528
22531
|
if (options?.cors?.baseUrl) {
|
|
22529
|
-
this.baseURL = options.cors.baseUrl + "/" +
|
|
22530
|
-
this.hackURL = options.cors.baseUrl + "/" +
|
|
22532
|
+
this.baseURL = options.cors.baseUrl + "/" + API_BASER_URL.replace("https://", "");
|
|
22533
|
+
this.hackURL = options.cors.baseUrl + "/" + API_HACK_URL.replace("https://", "");
|
|
22531
22534
|
}
|
|
22532
22535
|
}
|
|
22533
22536
|
async request({ url: url2, method = "GET", data, params, headers, body, useCookie, useOrigin }) {
|
package/dist/routes.js
CHANGED
|
@@ -22509,9 +22509,12 @@ class InitEnv2 {
|
|
|
22509
22509
|
InitEnv2.init();
|
|
22510
22510
|
|
|
22511
22511
|
// src/cnb-core.ts
|
|
22512
|
+
var API_BASER_URL = "https://api.cnb.cool";
|
|
22513
|
+
var API_HACK_URL = "https://cnb.cool";
|
|
22514
|
+
|
|
22512
22515
|
class CNBCore {
|
|
22513
|
-
baseURL =
|
|
22514
|
-
hackURL =
|
|
22516
|
+
baseURL = API_BASER_URL;
|
|
22517
|
+
hackURL = API_HACK_URL;
|
|
22515
22518
|
token;
|
|
22516
22519
|
cookie;
|
|
22517
22520
|
constructor(options) {
|
|
@@ -22526,8 +22529,8 @@ class CNBCore {
|
|
|
22526
22529
|
}
|
|
22527
22530
|
}
|
|
22528
22531
|
if (options?.cors?.baseUrl) {
|
|
22529
|
-
this.baseURL = options.cors.baseUrl + "/" +
|
|
22530
|
-
this.hackURL = options.cors.baseUrl + "/" +
|
|
22532
|
+
this.baseURL = options.cors.baseUrl + "/" + API_BASER_URL.replace("https://", "");
|
|
22533
|
+
this.hackURL = options.cors.baseUrl + "/" + API_HACK_URL.replace("https://", "");
|
|
22531
22534
|
}
|
|
22532
22535
|
}
|
|
22533
22536
|
async request({ url: url2, method = "GET", data, params, headers, body, useCookie, useOrigin }) {
|
package/package.json
CHANGED
package/src/cnb-core.ts
CHANGED
|
@@ -20,9 +20,11 @@ export type RequestOptions = {
|
|
|
20
20
|
useCookie?: boolean;
|
|
21
21
|
useOrigin?: boolean;
|
|
22
22
|
};
|
|
23
|
+
const API_BASER_URL = 'https://api.cnb.cool'
|
|
24
|
+
const API_HACK_URL = 'https://cnb.cool'
|
|
23
25
|
export class CNBCore {
|
|
24
|
-
baseURL =
|
|
25
|
-
hackURL =
|
|
26
|
+
baseURL = API_BASER_URL;
|
|
27
|
+
hackURL = API_HACK_URL;
|
|
26
28
|
public token: string;
|
|
27
29
|
public cookie?: string;
|
|
28
30
|
constructor(options: CNBCoreOptions) {
|
|
@@ -37,8 +39,8 @@ export class CNBCore {
|
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
if (options?.cors?.baseUrl) {
|
|
40
|
-
this.baseURL = options.cors.baseUrl + '/' +
|
|
41
|
-
this.hackURL = options.cors.baseUrl + '/' +
|
|
42
|
+
this.baseURL = options.cors.baseUrl + '/' + API_BASER_URL.replace('https://', '');
|
|
43
|
+
this.hackURL = options.cors.baseUrl + '/' + API_HACK_URL.replace('https://', '');
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
|