@smartmemory/sdk-js 1.4.123 → 1.4.125
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/apiBaseUrl.js +37 -0
- package/dist/connection.js +1 -1
- package/dist/{core-DUg_hHl8.js → core-CmAr3Blx.js} +382 -369
- package/dist/core.js +2 -2
- package/dist/index-BKn-OWw0.js +108 -0
- package/dist/index.js +5 -3
- package/dist/react.js +1 -1
- package/package.json +5 -1
- package/dist/index-BKI1h_Wn.js +0 -107
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const v = "http://localhost:9001", f = "same-origin", I = (n) => console.warn(n);
|
|
2
|
+
function B(n) {
|
|
3
|
+
return n === void 0 ? () => window.location.origin : typeof n == "function" ? n : () => n;
|
|
4
|
+
}
|
|
5
|
+
function _(n = {}) {
|
|
6
|
+
const { env: t = {}, origin: l, warn: s = I, ...A } = n, g = B(l);
|
|
7
|
+
let i;
|
|
8
|
+
function a(r = {}) {
|
|
9
|
+
const {
|
|
10
|
+
urlEnvVar: p = "VITE_API_URL",
|
|
11
|
+
sameOriginEnvVar: m = "VITE_API_BASE",
|
|
12
|
+
devDefault: d = v,
|
|
13
|
+
suffix: u = "",
|
|
14
|
+
label: c = "API"
|
|
15
|
+
} = { ...A, ...r }, e = () => `${g()}${u}`;
|
|
16
|
+
return function() {
|
|
17
|
+
if (i === f)
|
|
18
|
+
return e();
|
|
19
|
+
if (i)
|
|
20
|
+
return `${i}${u}`;
|
|
21
|
+
if (t[m] === f)
|
|
22
|
+
return e();
|
|
23
|
+
const o = t[p];
|
|
24
|
+
return typeof o == "string" && o.trim() ? o.trim() : t.DEV ? (s(`${c} base configuration missing; falling back to the local development API.`), d) : (s(`${c} base configuration missing in production; using the current origin.`), e());
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
apiBaseUrl: a(),
|
|
29
|
+
deriveApiBaseUrl: a,
|
|
30
|
+
setRuntimeApiBase(r) {
|
|
31
|
+
i = typeof r == "string" && r.trim() ? r.trim() : void 0;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
_ as createApiBaseUrl
|
|
37
|
+
};
|
package/dist/connection.js
CHANGED