helios-utilities-sdk 1.0.16 → 1.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/build/helpers/Fetcher.d.ts +1 -1
- package/build/helpers/Fetcher.d.ts.map +1 -1
- package/build/helpers/Fetcher.js +2 -2
- package/build/helpers/Fetcher.js.map +1 -1
- package/build/helpers/Poster.d.ts +1 -1
- package/build/helpers/Poster.d.ts.map +1 -1
- package/build/helpers/Poster.js +2 -2
- package/build/helpers/Poster.js.map +1 -1
- package/build/helpers/Putter.d.ts +1 -1
- package/build/helpers/Putter.d.ts.map +1 -1
- package/build/helpers/Putter.js +2 -2
- package/build/helpers/Putter.js.map +1 -1
- package/package.json +21 -21
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type FetcherData } from "./ApiHelpers.js";
|
|
2
|
-
declare const fetcher: <T>(url: string | URL) => Promise<FetcherData<T>>;
|
|
2
|
+
declare const fetcher: <T>(url: string | URL, isText?: boolean) => Promise<FetcherData<T>>;
|
|
3
3
|
export default fetcher;
|
|
4
4
|
//# sourceMappingURL=Fetcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fetcher.d.ts","sourceRoot":"","sources":["../../src/helpers/Fetcher.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,WAAW,EAIjB,MAAM,iBAAiB,CAAC;AAEzB,QAAA,MAAM,OAAO,GAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"Fetcher.d.ts","sourceRoot":"","sources":["../../src/helpers/Fetcher.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,WAAW,EAIjB,MAAM,iBAAiB,CAAC;AAEzB,QAAA,MAAM,OAAO,GAAU,CAAC,EACtB,KAAK,MAAM,GAAG,GAAG,EACjB,gBAAc,KACb,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAexB,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/build/helpers/Fetcher.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { UnauthorizedError } from "../errors/UnauthorizedError.js";
|
|
2
2
|
import { buildHeaders, handleErr, normalizeFetcherData, } from "./ApiHelpers.js";
|
|
3
|
-
const fetcher = async (url) => {
|
|
3
|
+
const fetcher = async (url, isText = false) => {
|
|
4
4
|
let payload = {};
|
|
5
5
|
try {
|
|
6
6
|
const headers = buildHeaders();
|
|
7
7
|
const response = await fetch(url.toString(), { headers: headers });
|
|
8
8
|
if (response.status == 401)
|
|
9
9
|
throw new UnauthorizedError("Unauthorized");
|
|
10
|
-
const data = await response.json();
|
|
10
|
+
const data = isText ? await response.text() : await response.json();
|
|
11
11
|
payload.data = data;
|
|
12
12
|
}
|
|
13
13
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fetcher.js","sourceRoot":"","sources":["../../src/helpers/Fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAEL,YAAY,EACZ,SAAS,EACT,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,OAAO,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"Fetcher.js","sourceRoot":"","sources":["../../src/helpers/Fetcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAEL,YAAY,EACZ,SAAS,EACT,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,OAAO,GAAG,KAAK,EACnB,GAAiB,EACjB,MAAM,GAAG,KAAK,EACW,EAAE;IAC3B,IAAI,OAAO,GAAmB,EAAE,CAAC;IAEjC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;QAE/B,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QACnE,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG;YAAE,MAAM,IAAI,iBAAiB,CAAC,cAAc,CAAC,CAAC;QACxE,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACpE,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IACtB,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,OAAO,GAAG,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,oBAAoB,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type FetcherData } from "./ApiHelpers.js";
|
|
2
|
-
declare const poster: <T>(url: string | URL, body: any) => Promise<FetcherData<T>>;
|
|
2
|
+
declare const poster: <T>(url: string | URL, body: any, isText?: boolean) => Promise<FetcherData<T>>;
|
|
3
3
|
export default poster;
|
|
4
4
|
//# sourceMappingURL=Poster.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Poster.d.ts","sourceRoot":"","sources":["../../src/helpers/Poster.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,WAAW,EAIjB,MAAM,iBAAiB,CAAC;AAEzB,QAAA,MAAM,MAAM,GAAU,CAAC,EACrB,KAAK,MAAM,GAAG,GAAG,EACjB,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"Poster.d.ts","sourceRoot":"","sources":["../../src/helpers/Poster.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,WAAW,EAIjB,MAAM,iBAAiB,CAAC;AAEzB,QAAA,MAAM,MAAM,GAAU,CAAC,EACrB,KAAK,MAAM,GAAG,GAAG,EACjB,MAAM,GAAG,EACT,gBAAc,KACb,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAkBxB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/build/helpers/Poster.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UnauthorizedError } from "../errors/UnauthorizedError.js";
|
|
2
2
|
import { buildHeaders, handleErr, normalizeFetcherData, } from "./ApiHelpers.js";
|
|
3
|
-
const poster = async (url, body) => {
|
|
3
|
+
const poster = async (url, body, isText = false) => {
|
|
4
4
|
let payload = {};
|
|
5
5
|
try {
|
|
6
6
|
const headers = buildHeaders();
|
|
@@ -11,7 +11,7 @@ const poster = async (url, body) => {
|
|
|
11
11
|
});
|
|
12
12
|
if (response.status == 401)
|
|
13
13
|
throw new UnauthorizedError("Unauthorized");
|
|
14
|
-
payload.data = await response.json();
|
|
14
|
+
payload.data = isText ? await response.text() : await response.json();
|
|
15
15
|
}
|
|
16
16
|
catch (err) {
|
|
17
17
|
payload = handleErr(err, payload);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Poster.js","sourceRoot":"","sources":["../../src/helpers/Poster.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAEL,YAAY,EACZ,SAAS,EACT,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,GAAG,KAAK,EAClB,GAAiB,EACjB,IAAS,
|
|
1
|
+
{"version":3,"file":"Poster.js","sourceRoot":"","sources":["../../src/helpers/Poster.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAEL,YAAY,EACZ,SAAS,EACT,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,GAAG,KAAK,EAClB,GAAiB,EACjB,IAAS,EACT,MAAM,GAAG,KAAK,EACW,EAAE;IAC3B,IAAI,OAAO,GAAmB,EAAE,CAAC;IAEjC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;QAE/B,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE;YAC3C,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QACH,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG;YAAE,MAAM,IAAI,iBAAiB,CAAC,cAAc,CAAC,CAAC;QACxE,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACxE,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,OAAO,GAAG,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,oBAAoB,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type FetcherData } from "./ApiHelpers.js";
|
|
2
|
-
declare const putter: <T>(url: string | URL, body: any) => Promise<FetcherData<T>>;
|
|
2
|
+
declare const putter: <T>(url: string | URL, body: any, isText?: boolean) => Promise<FetcherData<T>>;
|
|
3
3
|
export default putter;
|
|
4
4
|
//# sourceMappingURL=Putter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Putter.d.ts","sourceRoot":"","sources":["../../src/helpers/Putter.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AAEzB,QAAA,MAAM,MAAM,GAAU,CAAC,EACrB,KAAK,MAAM,GAAG,GAAG,EACjB,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"Putter.d.ts","sourceRoot":"","sources":["../../src/helpers/Putter.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAC;AAEzB,QAAA,MAAM,MAAM,GAAU,CAAC,EACrB,KAAK,MAAM,GAAG,GAAG,EACjB,MAAM,GAAG,EACT,gBAAc,KACb,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAkBxB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/build/helpers/Putter.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UnauthorizedError } from "../errors/UnauthorizedError.js";
|
|
2
2
|
import { buildHeaders, handleErr, normalizeFetcherData, } from "./ApiHelpers.js";
|
|
3
|
-
const putter = async (url, body) => {
|
|
3
|
+
const putter = async (url, body, isText = false) => {
|
|
4
4
|
let payload = {};
|
|
5
5
|
try {
|
|
6
6
|
const headers = buildHeaders();
|
|
@@ -11,7 +11,7 @@ const putter = async (url, body) => {
|
|
|
11
11
|
});
|
|
12
12
|
if (response.status == 401)
|
|
13
13
|
throw new UnauthorizedError("Unauthorized");
|
|
14
|
-
payload.data = await response.json();
|
|
14
|
+
payload.data = isText ? await response.text() : await response.json();
|
|
15
15
|
}
|
|
16
16
|
catch (err) {
|
|
17
17
|
payload = handleErr(err, payload);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Putter.js","sourceRoot":"","sources":["../../src/helpers/Putter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EACL,YAAY,EACZ,SAAS,EACT,oBAAoB,GAErB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,GAAG,KAAK,EAClB,GAAiB,EACjB,IAAS,
|
|
1
|
+
{"version":3,"file":"Putter.js","sourceRoot":"","sources":["../../src/helpers/Putter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EACL,YAAY,EACZ,SAAS,EACT,oBAAoB,GAErB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,GAAG,KAAK,EAClB,GAAiB,EACjB,IAAS,EACT,MAAM,GAAG,KAAK,EACW,EAAE;IAC3B,IAAI,OAAO,GAAmB,EAAE,CAAC;IAEjC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;QAE/B,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE;YAC3C,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QACH,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG;YAAE,MAAM,IAAI,iBAAiB,CAAC,cAAc,CAAC,CAAC;QACxE,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACxE,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,OAAO,GAAG,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,oBAAoB,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "helios-utilities-sdk",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
5
|
-
"license": "ISC",
|
|
6
|
-
"author": "DevClarkMiller",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"main": "build/index.js",
|
|
9
|
-
"types": "build/index.d.ts",
|
|
10
|
-
"files": [
|
|
11
|
-
"build",
|
|
12
|
-
"README.md"
|
|
13
|
-
],
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "npx tsc",
|
|
16
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
17
|
-
},
|
|
18
|
-
"dependencies": {
|
|
19
|
-
"typescript": "^5.9.3"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "helios-utilities-sdk",
|
|
3
|
+
"version": "1.0.17",
|
|
4
|
+
"description": "",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "DevClarkMiller",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "build/index.js",
|
|
9
|
+
"types": "build/index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"build",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "npx tsc",
|
|
16
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"typescript": "^5.9.3"
|
|
20
|
+
}
|
|
21
|
+
}
|