@taybart/corvid 0.0.1 → 0.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/index.js +4 -2
- package/dist/utils.d.ts +4 -4
- package/package.json +7 -6
package/dist/index.js
CHANGED
|
@@ -245,10 +245,12 @@ class request {
|
|
|
245
245
|
this.opts.body = body;
|
|
246
246
|
return this;
|
|
247
247
|
}
|
|
248
|
-
async do({ path, overrideBody, overrideSuccess }) {
|
|
248
|
+
async do({ path, overrideBody, overrideSuccess } = {}) {
|
|
249
249
|
if (this.opts.auth) this.opts.headers.Authorization = `Bearer ${this.opts.auth}`;
|
|
250
250
|
const body = overrideBody || this.opts.body;
|
|
251
|
-
|
|
251
|
+
let url = this.opts.url;
|
|
252
|
+
if (path) url = `${this.opts.url}${path}`;
|
|
253
|
+
const res = await fetch(url, {
|
|
252
254
|
method: this.opts.method,
|
|
253
255
|
headers: {
|
|
254
256
|
accept: 'application/json',
|
package/dist/utils.d.ts
CHANGED
|
@@ -40,9 +40,9 @@ export declare class request {
|
|
|
40
40
|
auth(token: string): this;
|
|
41
41
|
basicAuth(username: string, password: string): this;
|
|
42
42
|
body(body: Object): this;
|
|
43
|
-
do({ path, overrideBody, overrideSuccess, }
|
|
44
|
-
path
|
|
45
|
-
overrideBody
|
|
46
|
-
overrideSuccess
|
|
43
|
+
do({ path, overrideBody, overrideSuccess, }?: {
|
|
44
|
+
path?: string;
|
|
45
|
+
overrideBody?: Object;
|
|
46
|
+
overrideSuccess?: number;
|
|
47
47
|
}): Promise<any>;
|
|
48
48
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taybart/corvid",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
5
6
|
"exports": {
|
|
6
7
|
".": {
|
|
7
8
|
"types": "./dist/index.d.ts",
|
|
@@ -13,13 +14,13 @@
|
|
|
13
14
|
"files": [
|
|
14
15
|
"dist"
|
|
15
16
|
],
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": "rslib build",
|
|
18
|
-
"dev": "rslib build --watch"
|
|
19
|
-
},
|
|
20
17
|
"devDependencies": {
|
|
21
18
|
"@rslib/core": "^0.6.2",
|
|
22
19
|
"@types/node": "^22.8.1",
|
|
23
20
|
"typescript": "^5.8.3"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "rslib build",
|
|
24
|
+
"dev": "rslib build --watch"
|
|
24
25
|
}
|
|
25
|
-
}
|
|
26
|
+
}
|