@medusajs/js-sdk 2.0.2-snapshot-20241105102007 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +12 -1
- package/dist/client.js.map +1 -1
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/client.js +12 -1
- package/dist/esm/client.js.map +1 -1
- package/package.json +2 -2
package/dist/client.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,UAAU,EACV,mBAAmB,EAEpB,MAAM,SAAS,CAAA;AAEhB,eAAO,MAAM,sBAAsB,0BAA0B,CAAA;
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,UAAU,EACV,mBAAmB,EAEpB,MAAM,SAAS,CAAA;AAEhB,eAAO,MAAM,sBAAsB,0BAA0B,CAAA;AA2E7D,qBAAa,UAAW,SAAQ,KAAK;IACnC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;gBAElB,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAKlE;AAED,qBAAa,MAAM;IACV,MAAM,EAAE,WAAW,CAAA;IAC1B,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,MAAM,CAAQ;IAEtB,OAAO,CAAC,uBAAuB,CAAsB;IACrD,OAAO,CAAC,KAAK,CAAK;gBAEN,MAAM,EAAE,MAAM;IAiB1B;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,CAAC,SAAS,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC;IAIrE;;;;;;;;;OASG;IACG,WAAW,CACf,KAAK,EAAE,UAAU,EACjB,IAAI,CAAC,EAAE,SAAS,GACf,OAAO,CAAC,mBAAmB,CAAC;IAiB/B,QAAQ,CAAC,KAAK,EAAE,MAAM;IAItB,UAAU;IAIV,SAAS,CAAC,WAAW;IAkBrB,SAAS,CAAC,UAAU,IAAI,WAAW;IA2DnC,SAAS,CAAC,gBAAgB,QAAO;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,GAAG,EAAE,CAI9D;IAED,SAAS,CAAC,wBAAwB,QAC9B;QAAE,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAA;KAAE,GACpC,EAAE,CAIL;IAED,SAAS,CAAC,aAAa,QAAO;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,GAAG,EAAE,CAQ3D;IAED,SAAS,CAAC,SAAS,UAAW,MAAM,UAgBnC;IAED,SAAS,CAAC,SAAS,kCAelB;IAED,SAAS,CAAC,oBAAoB;;;MAqB7B;CACF"}
|
package/dist/client.js
CHANGED
@@ -7,6 +7,17 @@ exports.Client = exports.FetchError = exports.PUBLISHABLE_KEY_HEADER = void 0;
|
|
7
7
|
const qs_1 = __importDefault(require("qs"));
|
8
8
|
const fetch_event_stream_1 = require("fetch-event-stream");
|
9
9
|
exports.PUBLISHABLE_KEY_HEADER = "x-publishable-api-key";
|
10
|
+
// We want to explicitly retrieve the base URL instead of relying on relative paths that differ in behavior between browsers.
|
11
|
+
const getBaseUrl = (passedBaseUrl) => {
|
12
|
+
if (typeof window === "undefined") {
|
13
|
+
return passedBaseUrl;
|
14
|
+
}
|
15
|
+
// If the passed base URL is empty or "/", we use the current origin from the browser.
|
16
|
+
if (passedBaseUrl === "" || passedBaseUrl === "/") {
|
17
|
+
return window.location.origin;
|
18
|
+
}
|
19
|
+
return passedBaseUrl;
|
20
|
+
};
|
10
21
|
const hasStorage = (storage) => {
|
11
22
|
if (typeof window !== "undefined") {
|
12
23
|
return storage in window;
|
@@ -126,7 +137,7 @@ class Client {
|
|
126
137
|
storageKey,
|
127
138
|
};
|
128
139
|
};
|
129
|
-
this.config = config;
|
140
|
+
this.config = { ...config, baseUrl: getBaseUrl(config.baseUrl) };
|
130
141
|
const logger = config.logger || {
|
131
142
|
error: console.error,
|
132
143
|
warn: console.warn,
|
package/dist/client.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAmB;AACnB,2DAA2C;AAU9B,QAAA,sBAAsB,GAAG,uBAAuB,CAAA;AAE7D,MAAM,UAAU,GAAG,CAAC,OAA0C,EAAE,EAAE;IAChE,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,OAAO,IAAI,MAAM,CAAA;IAC1B,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE;IAC/B,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACzB,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;AAC5C,CAAC,CAAA;AAED,MAAM,eAAe,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC3C,OAAO;QACL,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACxC,aAAa,EAAE,YAAY;KAC5B,CAAA;AACH,CAAC,CAAA;AAED,MAAM,gBAAgB,GAAG,CACvB,IAA2B,EAC3B,OAAgB,EAChB,MAAc,EACW,EAAE;IAC3B,IAAI,IAAI,GAAG,IAAI,EAAE,IAAI,CAAA;IACrB,IAAI,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,kBAAkB,CAAC,EAA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AC,MAAM,CAAC,OAAO,CAAC,CAAA;gBACrD,IAAI,IAAI,EAAE,KAAK,EAAE,CAAC;oBAChB,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAC/B,eAAe,CAAC,YAAY,CAAC,OAAO,EAAE,CACvC,CAAA;oBACD,MAAM,gBAAgB,GAAG,YAAE,CAAC,SAAS,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;oBACnE,eAAe,CAAC,MAAM,GAAG,gBAAgB,CAAA;gBAC3C,CAAC;YACH,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,0BAA0B,EAC1B,QAAQ,eAAe,CAAC,QAAQ,EAAE,IAAI,EACtC,YAAY,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAClE,CAAA;YAED,kFAAkF;YAClF,OAAO,MAAM,KAAK,CAChB,eAAe,EACf,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAC7C,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;gBACd,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAA;gBACnE,OAAO,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;YACzC,CAAC,CAAC,CAAA;QACJ,CAAC,CAAA;IACH,CAAC;CAmFF;AA7OD,wBA6OC"}
|
package/dist/esm/client.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,UAAU,EACV,mBAAmB,EAEpB,MAAM,SAAS,CAAA;AAEhB,eAAO,MAAM,sBAAsB,0BAA0B,CAAA;
|
1
|
+
{"version":3,"file":"client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AAG,EAAE,CAQ3D;IAED,SAAS,CAAC,SAAS,UAAW,MAAM,UAgBnC;IAED,SAAS,CAAC,SAAS,kCAelB;IAED,SAAS,CAAC,oBAAoB;;;MAqB7B;CACF"}
|
package/dist/esm/client.js
CHANGED
@@ -10,6 +10,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
10
10
|
import qs from "qs";
|
11
11
|
import { events } from "fetch-event-stream";
|
12
12
|
export const PUBLISHABLE_KEY_HEADER = "x-publishable-api-key";
|
13
|
+
// We want to explicitly retrieve the base URL instead of relying on relative paths that differ in behavior between browsers.
|
14
|
+
const getBaseUrl = (passedBaseUrl) => {
|
15
|
+
if (typeof window === "undefined") {
|
16
|
+
return passedBaseUrl;
|
17
|
+
}
|
18
|
+
// If the passed base URL is empty or "/", we use the current origin from the browser.
|
19
|
+
if (passedBaseUrl === "" || passedBaseUrl === "/") {
|
20
|
+
return window.location.origin;
|
21
|
+
}
|
22
|
+
return passedBaseUrl;
|
23
|
+
};
|
13
24
|
const hasStorage = (storage) => {
|
14
25
|
if (typeof window !== "undefined") {
|
15
26
|
return storage in window;
|
@@ -125,7 +136,7 @@ export class Client {
|
|
125
136
|
storageKey,
|
126
137
|
};
|
127
138
|
};
|
128
|
-
this.config = config;
|
139
|
+
this.config = Object.assign(Object.assign({}, config), { baseUrl: getBaseUrl(config.baseUrl) });
|
129
140
|
const logger = config.logger || {
|
130
141
|
error: console.error,
|
131
142
|
warn: console.warn,
|
package/dist/esm/client.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAU3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,uBAAuB,CAAA;AAE7D,MAAM,UAAU,GAAG,CAAC,OAA0C,EAAE,EAAE;IA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K,IAAI,CAAC,KAAK,EAAG,CAAA;oBACnE,eAAe,CAAC,MAAM,GAAG,gBAAgB,CAAA;gBAC3C,CAAC;YACH,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,0BAA0B,EAC1B,QAAQ,eAAe,CAAC,QAAQ,EAAE,IAAI,EACtC,YAAY,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAClE,CAAA;YAED,kFAAkF;YAClF,OAAO,MAAM,KAAK,CAChB,eAAe,EACf,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAC7C,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;gBACd,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAA;gBACnE,OAAO,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;YACzC,CAAC,CAAC,CAAA;QACJ,CAAC,CAAA,CAAA;IACH,CAAC;CAmFF"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@medusajs/js-sdk",
|
3
|
-
"version": "2.0.2
|
3
|
+
"version": "2.0.2",
|
4
4
|
"description": "SDK for the Medusa API",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"module": "dist/esm/index.js",
|
@@ -35,7 +35,7 @@
|
|
35
35
|
"typescript": "^5.6.2"
|
36
36
|
},
|
37
37
|
"dependencies": {
|
38
|
-
"@medusajs/types": "2.0.2
|
38
|
+
"@medusajs/types": "^2.0.2",
|
39
39
|
"fetch-event-stream": "^0.1.5",
|
40
40
|
"qs": "^6.12.1"
|
41
41
|
},
|