@voyantjs/connect-sdk 0.1.2 → 0.1.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAiFpB,qBAAa,eAAe;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAgB;IAC3C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA0B;IACzD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAe;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,OAAO,EAAE,sBAAsB;IAW3C,OAAO,CAAC,YAAY;IAiCpB;;;;OAIG;IACG,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,oBAAyB;IAUzD,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,oBAAyB;CAqClE"}
|
|
@@ -20,6 +20,7 @@ function appendQuery(url, query) {
|
|
|
20
20
|
function normalizePath(path) {
|
|
21
21
|
return path.startsWith("/") ? path : `/${path}`;
|
|
22
22
|
}
|
|
23
|
+
const defaultFetch = (input, init) => globalThis.fetch(input, init);
|
|
23
24
|
function isBodyInit(value) {
|
|
24
25
|
return (value instanceof ArrayBuffer ||
|
|
25
26
|
value instanceof Blob ||
|
|
@@ -70,9 +71,10 @@ export class VoyantTransport {
|
|
|
70
71
|
this.apiKey = options.apiKey;
|
|
71
72
|
this.baseUrl = options.baseUrl ?? DEFAULT_BASE_URL;
|
|
72
73
|
this.defaultHeaders = options.headers;
|
|
73
|
-
this.fetchImpl = options.fetch ??
|
|
74
|
+
this.fetchImpl = options.fetch ?? defaultFetch;
|
|
74
75
|
this.authHeader = options.authHeader ?? "authorization";
|
|
75
|
-
this.authScheme =
|
|
76
|
+
this.authScheme =
|
|
77
|
+
options.authScheme === undefined ? "Bearer" : options.authScheme;
|
|
76
78
|
this.userAgent = options.userAgent ?? "voyant-sdk";
|
|
77
79
|
}
|
|
78
80
|
buildRequest(path, options = {}) {
|