@contentstack/marketplace-sdk 1.2.5 → 1.2.7

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/CHANGELOG.md CHANGED
@@ -1,4 +1,14 @@
1
1
  # Changelog
2
+
3
+ ## [v1.2.7](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.2.6) (2024-05-15)
4
+ - Fixed base URL path logic in contentstackClient to handle when region and host not provided
5
+
6
+ ## [v1.2.6](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.2.6) (2024-03-03)
7
+ - Update sanity tests
8
+
9
+ ## [v1.2.5](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.2.5) (2025-01-17)
10
+ - Dependency update
11
+
2
12
  ## [v1.2.4](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.2.4) (2024-10-22)
3
13
  - Node version bump in github package publish workflow file
4
14
 
@@ -6,6 +6,7 @@ import error from './core/contentstackError';
6
6
  import { Marketplace } from './marketplace/index.js';
7
7
  import { Region } from './contentstack.js';
8
8
  export default function contentstackClient(_ref) {
9
+ var _http$defaults;
9
10
  var http = _ref.http;
10
11
  /**
11
12
  * @description The login call is used to sign in to your Contentstack account and obtain the authtoken.
@@ -27,9 +28,13 @@ export default function contentstackClient(_ref) {
27
28
  */
28
29
 
29
30
  var region = http.defaults.region;
30
- var baseUrlPath = "https://api.contentstack.io:443/v3/user-session";
31
+ var baseUrlPath = "/user-session";
31
32
  if (region && region !== Region.NA) {
32
33
  baseUrlPath = "https://".concat(region, "-api.contentstack.com:443/v3/user-session");
34
+ } else if (!region && http !== null && http !== void 0 && (_http$defaults = http.defaults) !== null && _http$defaults !== void 0 && _http$defaults.host) {
35
+ baseUrlPath = "https://".concat(http.defaults.host, ":443/v3/user-session");
36
+ } else {
37
+ baseUrlPath = "https://api.contentstack.io:443/v3/user-session";
33
38
  }
34
39
  function login(requestBody) {
35
40
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -15,6 +15,7 @@ var _contentstack = require("./contentstack.js");
15
15
  */
16
16
 
17
17
  function contentstackClient(_ref) {
18
+ var _http$defaults;
18
19
  var http = _ref.http;
19
20
  /**
20
21
  * @description The login call is used to sign in to your Contentstack account and obtain the authtoken.
@@ -36,9 +37,13 @@ function contentstackClient(_ref) {
36
37
  */
37
38
 
38
39
  var region = http.defaults.region;
39
- var baseUrlPath = "https://api.contentstack.io:443/v3/user-session";
40
+ var baseUrlPath = "/user-session";
40
41
  if (region && region !== _contentstack.Region.NA) {
41
42
  baseUrlPath = "https://".concat(region, "-api.contentstack.com:443/v3/user-session");
43
+ } else if (!region && http !== null && http !== void 0 && (_http$defaults = http.defaults) !== null && _http$defaults !== void 0 && _http$defaults.host) {
44
+ baseUrlPath = "https://".concat(http.defaults.host, ":443/v3/user-session");
45
+ } else {
46
+ baseUrlPath = "https://api.contentstack.io:443/v3/user-session";
42
47
  }
43
48
  function login(requestBody) {
44
49
  var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};