@spooled/sdk 1.0.31 → 1.0.32
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/README.md +10 -6
- package/dist/index.cjs +11 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31,6 +31,13 @@ var DEFAULT_CONFIG = {
|
|
|
31
31
|
var SDK_VERSION = "1.0.31";
|
|
32
32
|
var API_VERSION = "v1";
|
|
33
33
|
var API_BASE_PATH = `/api/${API_VERSION}`;
|
|
34
|
+
function normalizeCredential(value) {
|
|
35
|
+
if (value === void 0) {
|
|
36
|
+
return void 0;
|
|
37
|
+
}
|
|
38
|
+
const trimmed = value.trim();
|
|
39
|
+
return trimmed === "" ? void 0 : trimmed;
|
|
40
|
+
}
|
|
34
41
|
function resolveConfig(options) {
|
|
35
42
|
let debugFn = null;
|
|
36
43
|
if (options.debug === true) {
|
|
@@ -60,10 +67,10 @@ function resolveConfig(options) {
|
|
|
60
67
|
const derivedWsUrl = baseUrl.replace(/^http/, "ws");
|
|
61
68
|
const wsUrl = options.wsUrl ?? derivedWsUrl;
|
|
62
69
|
return {
|
|
63
|
-
apiKey: options.apiKey,
|
|
64
|
-
accessToken: options.accessToken,
|
|
65
|
-
refreshToken: options.refreshToken,
|
|
66
|
-
adminKey: options.adminKey,
|
|
70
|
+
apiKey: normalizeCredential(options.apiKey),
|
|
71
|
+
accessToken: normalizeCredential(options.accessToken),
|
|
72
|
+
refreshToken: normalizeCredential(options.refreshToken),
|
|
73
|
+
adminKey: normalizeCredential(options.adminKey),
|
|
67
74
|
baseUrl,
|
|
68
75
|
wsUrl,
|
|
69
76
|
grpcAddress: options.grpcAddress ?? DEFAULT_CONFIG.grpcAddress,
|