@memberstack/dom 1.9.30 → 1.9.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.
@@ -23,7 +23,7 @@ __export(endpoints_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(endpoints_exports);
25
25
  var endpoints = {
26
- API: process.env.API_ENDPOINT
26
+ API: "http://localhost:3005"
27
27
  };
28
28
  // Annotate the CommonJS export names for ESM import in node:
29
29
  0 && (module.exports = {
@@ -1,6 +1,6 @@
1
1
  // src/constants/endpoints.ts
2
2
  var endpoints = {
3
- API: process.env.API_ENDPOINT
3
+ API: "http://localhost:3005"
4
4
  };
5
5
  export {
6
6
  endpoints
package/lib/index.js CHANGED
@@ -14026,7 +14026,7 @@ var import_axios = __toESM(require("axios"));
14026
14026
 
14027
14027
  // src/constants/endpoints.ts
14028
14028
  var endpoints = {
14029
- API: process.env.API_ENDPOINT
14029
+ API: "http://localhost:3005"
14030
14030
  };
14031
14031
 
14032
14032
  // src/methods/requests/requests.ts
@@ -14266,7 +14266,8 @@ var initRequest = ({
14266
14266
  url: `/comments/posts`,
14267
14267
  data: {
14268
14268
  channelKey: params.channelKey,
14269
- content: params.content
14269
+ content: params.content,
14270
+ _url: window.location.origin + window.location.pathname
14270
14271
  }
14271
14272
  });
14272
14273
  });
@@ -14415,7 +14416,8 @@ var initRequest = ({
14415
14416
  return __async(this, null, function* () {
14416
14417
  const queryParams = new URLSearchParams({
14417
14418
  // @ts-ignore
14418
- includeSSOText: window == null ? void 0 : window.ssoUI
14419
+ includeSSOText: window == null ? void 0 : window.ssoUI,
14420
+ trackPageView: params == null ? void 0 : params.trackPageView
14419
14421
  });
14420
14422
  return sendRequest({
14421
14423
  method: "GET" /* GET */,
@@ -14523,9 +14525,12 @@ var initRequest = ({
14523
14525
  },
14524
14526
  getCurrentMember(options) {
14525
14527
  return __async(this, null, function* () {
14528
+ const memberToken = getMemberToken();
14529
+ if (!memberToken)
14530
+ return { data: null };
14526
14531
  const getMemberRequest = sendRequest({
14527
14532
  method: "GET" /* GET */,
14528
- url: `/member?${Math.floor(1e3 + Math.random() * 9e3)}`,
14533
+ url: `/member`,
14529
14534
  headers: addHeaders(options)
14530
14535
  });
14531
14536
  function setMember() {
package/lib/index.mjs CHANGED
@@ -13994,7 +13994,7 @@ import axios from "axios";
13994
13994
 
13995
13995
  // src/constants/endpoints.ts
13996
13996
  var endpoints = {
13997
- API: process.env.API_ENDPOINT
13997
+ API: "http://localhost:3005"
13998
13998
  };
13999
13999
 
14000
14000
  // src/methods/requests/requests.ts
@@ -14234,7 +14234,8 @@ var initRequest = ({
14234
14234
  url: `/comments/posts`,
14235
14235
  data: {
14236
14236
  channelKey: params.channelKey,
14237
- content: params.content
14237
+ content: params.content,
14238
+ _url: window.location.origin + window.location.pathname
14238
14239
  }
14239
14240
  });
14240
14241
  });
@@ -14383,7 +14384,8 @@ var initRequest = ({
14383
14384
  return __async(this, null, function* () {
14384
14385
  const queryParams = new URLSearchParams({
14385
14386
  // @ts-ignore
14386
- includeSSOText: window == null ? void 0 : window.ssoUI
14387
+ includeSSOText: window == null ? void 0 : window.ssoUI,
14388
+ trackPageView: params == null ? void 0 : params.trackPageView
14387
14389
  });
14388
14390
  return sendRequest({
14389
14391
  method: "GET" /* GET */,
@@ -14491,9 +14493,12 @@ var initRequest = ({
14491
14493
  },
14492
14494
  getCurrentMember(options) {
14493
14495
  return __async(this, null, function* () {
14496
+ const memberToken = getMemberToken();
14497
+ if (!memberToken)
14498
+ return { data: null };
14494
14499
  const getMemberRequest = sendRequest({
14495
14500
  method: "GET" /* GET */,
14496
- url: `/member?${Math.floor(1e3 + Math.random() * 9e3)}`,
14501
+ url: `/member`,
14497
14502
  headers: addHeaders(options)
14498
14503
  });
14499
14504
  function setMember() {
@@ -14026,7 +14026,7 @@ var import_axios = __toESM(require("axios"));
14026
14026
 
14027
14027
  // src/constants/endpoints.ts
14028
14028
  var endpoints = {
14029
- API: process.env.API_ENDPOINT
14029
+ API: "http://localhost:3005"
14030
14030
  };
14031
14031
 
14032
14032
  // src/methods/requests/requests.ts
@@ -14266,7 +14266,8 @@ var initRequest = ({
14266
14266
  url: `/comments/posts`,
14267
14267
  data: {
14268
14268
  channelKey: params.channelKey,
14269
- content: params.content
14269
+ content: params.content,
14270
+ _url: window.location.origin + window.location.pathname
14270
14271
  }
14271
14272
  });
14272
14273
  });
@@ -14415,7 +14416,8 @@ var initRequest = ({
14415
14416
  return __async(this, null, function* () {
14416
14417
  const queryParams = new URLSearchParams({
14417
14418
  // @ts-ignore
14418
- includeSSOText: window == null ? void 0 : window.ssoUI
14419
+ includeSSOText: window == null ? void 0 : window.ssoUI,
14420
+ trackPageView: params == null ? void 0 : params.trackPageView
14419
14421
  });
14420
14422
  return sendRequest({
14421
14423
  method: "GET" /* GET */,
@@ -14523,9 +14525,12 @@ var initRequest = ({
14523
14525
  },
14524
14526
  getCurrentMember(options) {
14525
14527
  return __async(this, null, function* () {
14528
+ const memberToken = getMemberToken();
14529
+ if (!memberToken)
14530
+ return { data: null };
14526
14531
  const getMemberRequest = sendRequest({
14527
14532
  method: "GET" /* GET */,
14528
- url: `/member?${Math.floor(1e3 + Math.random() * 9e3)}`,
14533
+ url: `/member`,
14529
14534
  headers: addHeaders(options)
14530
14535
  });
14531
14536
  function setMember() {
@@ -13994,7 +13994,7 @@ import axios from "axios";
13994
13994
 
13995
13995
  // src/constants/endpoints.ts
13996
13996
  var endpoints = {
13997
- API: process.env.API_ENDPOINT
13997
+ API: "http://localhost:3005"
13998
13998
  };
13999
13999
 
14000
14000
  // src/methods/requests/requests.ts
@@ -14234,7 +14234,8 @@ var initRequest = ({
14234
14234
  url: `/comments/posts`,
14235
14235
  data: {
14236
14236
  channelKey: params.channelKey,
14237
- content: params.content
14237
+ content: params.content,
14238
+ _url: window.location.origin + window.location.pathname
14238
14239
  }
14239
14240
  });
14240
14241
  });
@@ -14383,7 +14384,8 @@ var initRequest = ({
14383
14384
  return __async(this, null, function* () {
14384
14385
  const queryParams = new URLSearchParams({
14385
14386
  // @ts-ignore
14386
- includeSSOText: window == null ? void 0 : window.ssoUI
14387
+ includeSSOText: window == null ? void 0 : window.ssoUI,
14388
+ trackPageView: params == null ? void 0 : params.trackPageView
14387
14389
  });
14388
14390
  return sendRequest({
14389
14391
  method: "GET" /* GET */,
@@ -14491,9 +14493,12 @@ var initRequest = ({
14491
14493
  },
14492
14494
  getCurrentMember(options) {
14493
14495
  return __async(this, null, function* () {
14496
+ const memberToken = getMemberToken();
14497
+ if (!memberToken)
14498
+ return { data: null };
14494
14499
  const getMemberRequest = sendRequest({
14495
14500
  method: "GET" /* GET */,
14496
- url: `/member?${Math.floor(1e3 + Math.random() * 9e3)}`,
14501
+ url: `/member`,
14497
14502
  headers: addHeaders(options)
14498
14503
  });
14499
14504
  function setMember() {
@@ -76,7 +76,7 @@ var import_axios = __toESM(require("axios"));
76
76
 
77
77
  // src/constants/endpoints.ts
78
78
  var endpoints = {
79
- API: process.env.API_ENDPOINT
79
+ API: "http://localhost:3005"
80
80
  };
81
81
 
82
82
  // src/utils/cookies.ts
@@ -358,7 +358,8 @@ var initRequest = ({
358
358
  url: `/comments/posts`,
359
359
  data: {
360
360
  channelKey: params.channelKey,
361
- content: params.content
361
+ content: params.content,
362
+ _url: window.location.origin + window.location.pathname
362
363
  }
363
364
  });
364
365
  });
@@ -507,7 +508,8 @@ var initRequest = ({
507
508
  return __async(this, null, function* () {
508
509
  const queryParams = new URLSearchParams({
509
510
  // @ts-ignore
510
- includeSSOText: window == null ? void 0 : window.ssoUI
511
+ includeSSOText: window == null ? void 0 : window.ssoUI,
512
+ trackPageView: params == null ? void 0 : params.trackPageView
511
513
  });
512
514
  return sendRequest({
513
515
  method: "GET" /* GET */,
@@ -615,9 +617,12 @@ var initRequest = ({
615
617
  },
616
618
  getCurrentMember(options) {
617
619
  return __async(this, null, function* () {
620
+ const memberToken = getMemberToken();
621
+ if (!memberToken)
622
+ return { data: null };
618
623
  const getMemberRequest = sendRequest({
619
624
  method: "GET" /* GET */,
620
- url: `/member?${Math.floor(1e3 + Math.random() * 9e3)}`,
625
+ url: `/member`,
621
626
  headers: addHeaders(options)
622
627
  });
623
628
  function setMember() {
@@ -43,7 +43,7 @@ import axios from "axios";
43
43
 
44
44
  // src/constants/endpoints.ts
45
45
  var endpoints = {
46
- API: process.env.API_ENDPOINT
46
+ API: "http://localhost:3005"
47
47
  };
48
48
 
49
49
  // src/utils/cookies.ts
@@ -325,7 +325,8 @@ var initRequest = ({
325
325
  url: `/comments/posts`,
326
326
  data: {
327
327
  channelKey: params.channelKey,
328
- content: params.content
328
+ content: params.content,
329
+ _url: window.location.origin + window.location.pathname
329
330
  }
330
331
  });
331
332
  });
@@ -474,7 +475,8 @@ var initRequest = ({
474
475
  return __async(this, null, function* () {
475
476
  const queryParams = new URLSearchParams({
476
477
  // @ts-ignore
477
- includeSSOText: window == null ? void 0 : window.ssoUI
478
+ includeSSOText: window == null ? void 0 : window.ssoUI,
479
+ trackPageView: params == null ? void 0 : params.trackPageView
478
480
  });
479
481
  return sendRequest({
480
482
  method: "GET" /* GET */,
@@ -582,9 +584,12 @@ var initRequest = ({
582
584
  },
583
585
  getCurrentMember(options) {
584
586
  return __async(this, null, function* () {
587
+ const memberToken = getMemberToken();
588
+ if (!memberToken)
589
+ return { data: null };
585
590
  const getMemberRequest = sendRequest({
586
591
  method: "GET" /* GET */,
587
- url: `/member?${Math.floor(1e3 + Math.random() * 9e3)}`,
592
+ url: `/member`,
588
593
  headers: addHeaders(options)
589
594
  });
590
595
  function setMember() {
@@ -75,7 +75,7 @@ var import_axios = __toESM(require("axios"));
75
75
 
76
76
  // src/constants/endpoints.ts
77
77
  var endpoints = {
78
- API: process.env.API_ENDPOINT
78
+ API: "http://localhost:3005"
79
79
  };
80
80
 
81
81
  // src/utils/cookies.ts
@@ -43,7 +43,7 @@ import axios from "axios";
43
43
 
44
44
  // src/constants/endpoints.ts
45
45
  var endpoints = {
46
- API: process.env.API_ENDPOINT
46
+ API: "http://localhost:3005"
47
47
  };
48
48
 
49
49
  // src/utils/cookies.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberstack/dom",
3
- "version": "1.9.30",
3
+ "version": "1.9.32",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./lib/index.mjs",
6
6
  "types": "./lib/index.d.ts",
@@ -27,7 +27,7 @@
27
27
  "clean": "rm -rf node_modules lib",
28
28
  "deploy:latest": "npx np --tag latest --no-tests --any-branch",
29
29
  "deploy:next": "npx np --tag next --no-tests --any-branch",
30
- "build:local": "tsup --format esm,cjs --dts"
30
+ "build:local": "tsup --format esm,cjs --dts --env.API_ENDPOINT https://client.memberstack.com"
31
31
  },
32
32
  "devDependencies": {
33
33
  "replace-in-file": "^6.3.5",
@@ -35,4 +35,4 @@
35
35
  "tsc-watch": "^6.0.4",
36
36
  "tsup": "^7.2.0"
37
37
  }
38
- }
38
+ }