@hivedev/hivesdk 1.0.37 → 1.0.39

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/hive-server.cjs CHANGED
@@ -788,9 +788,6 @@ async function handleLogin(request, response) {
788
788
  var import_path6 = __toESM(require("path"), 1);
789
789
  var import_fs6 = __toESM(require("fs"), 1);
790
790
 
791
- // Server/Authentication/IsLoggedIn.js
792
- var import_cookie2 = __toESM(require_dist(), 1);
793
-
794
791
  // Server/Utility/ParseRequestCookies.js
795
792
  async function parseRequestCookies(request) {
796
793
  if (typeof request.cookies === "object") {
@@ -815,6 +812,7 @@ async function parseRequestCookies(request) {
815
812
  }
816
813
 
817
814
  // Server/Authentication/IsLoggedIn.js
815
+ var import_cookie2 = __toESM(require_dist(), 1);
818
816
  async function isLoggedIn(request, response, bSendResponse = false) {
819
817
  await parseRequestCookies(request);
820
818
  const cookies = request.cookies;
@@ -1036,29 +1034,30 @@ async function pushNotificationToken(request, response) {
1036
1034
  // Server/HandleHiveRequests.js
1037
1035
  async function handleHiveRequests(request, response, next) {
1038
1036
  const { url, method } = request;
1037
+ const pathname = url.split("?")[0];
1039
1038
  try {
1040
- if (url === "/Login" && method === "POST") {
1039
+ if (pathname === "/Login" && method === "POST") {
1041
1040
  await handleLogin(request, response);
1042
1041
  return;
1043
- } else if (url === "/Logout" && method === "POST") {
1042
+ } else if (pathname === "/Logout" && method === "POST") {
1044
1043
  await handleLogout(request, response);
1045
1044
  return;
1046
- } else if (url === "/ServiceUrls" && method === "GET") {
1045
+ } else if (pathname === "/ServiceUrls" && method === "GET") {
1047
1046
  await getServiceUrls(request, response);
1048
1047
  return;
1049
- } else if (url === "/IsLoggedIn" && method === "POST") {
1048
+ } else if (pathname === "/IsLoggedIn" && method === "POST") {
1050
1049
  await isLoggedIn(request, response, true);
1051
1050
  return;
1052
- } else if (url === "/IsLoggedInWithPermission" && method === "POST") {
1051
+ } else if (pathname === "/IsLoggedInWithPermission" && method === "POST") {
1053
1052
  await isLoggedInWithPermission(request, response, true);
1054
1053
  return;
1055
- } else if (url === "/SaveUserFilter" && method === "POST") {
1054
+ } else if (pathname === "/SaveUserFilter" && method === "POST") {
1056
1055
  await saveUserFilter(request, response);
1057
1056
  return;
1058
- } else if (url === "/PushNotificationToken" && method === "POST") {
1057
+ } else if (pathname === "/PushNotificationToken" && method === "POST") {
1059
1058
  pushNotificationToken(request, response);
1060
1059
  return;
1061
- } else if (url === "/hive-client.js") {
1060
+ } else if (pathname === "/hive-client.js") {
1062
1061
  const filePath = import_path6.default.join(process.cwd(), "node_modules/@hivedev/hivesdk/hive-client.js");
1063
1062
  const stream = import_fs6.default.createReadStream(filePath);
1064
1063
  stream.on("open", () => {
package/hive-server.js CHANGED
@@ -761,9 +761,6 @@ async function handleLogin(request, response) {
761
761
  import path6, { parse } from "path";
762
762
  import fs6 from "fs";
763
763
 
764
- // Server/Authentication/IsLoggedIn.js
765
- var import_cookie2 = __toESM(require_dist(), 1);
766
-
767
764
  // Server/Utility/ParseRequestCookies.js
768
765
  async function parseRequestCookies(request) {
769
766
  if (typeof request.cookies === "object") {
@@ -788,6 +785,7 @@ async function parseRequestCookies(request) {
788
785
  }
789
786
 
790
787
  // Server/Authentication/IsLoggedIn.js
788
+ var import_cookie2 = __toESM(require_dist(), 1);
791
789
  async function isLoggedIn(request, response, bSendResponse = false) {
792
790
  await parseRequestCookies(request);
793
791
  const cookies = request.cookies;
@@ -1009,29 +1007,30 @@ async function pushNotificationToken(request, response) {
1009
1007
  // Server/HandleHiveRequests.js
1010
1008
  async function handleHiveRequests(request, response, next) {
1011
1009
  const { url, method } = request;
1010
+ const pathname = url.split("?")[0];
1012
1011
  try {
1013
- if (url === "/Login" && method === "POST") {
1012
+ if (pathname === "/Login" && method === "POST") {
1014
1013
  await handleLogin(request, response);
1015
1014
  return;
1016
- } else if (url === "/Logout" && method === "POST") {
1015
+ } else if (pathname === "/Logout" && method === "POST") {
1017
1016
  await handleLogout(request, response);
1018
1017
  return;
1019
- } else if (url === "/ServiceUrls" && method === "GET") {
1018
+ } else if (pathname === "/ServiceUrls" && method === "GET") {
1020
1019
  await getServiceUrls(request, response);
1021
1020
  return;
1022
- } else if (url === "/IsLoggedIn" && method === "POST") {
1021
+ } else if (pathname === "/IsLoggedIn" && method === "POST") {
1023
1022
  await isLoggedIn(request, response, true);
1024
1023
  return;
1025
- } else if (url === "/IsLoggedInWithPermission" && method === "POST") {
1024
+ } else if (pathname === "/IsLoggedInWithPermission" && method === "POST") {
1026
1025
  await isLoggedInWithPermission(request, response, true);
1027
1026
  return;
1028
- } else if (url === "/SaveUserFilter" && method === "POST") {
1027
+ } else if (pathname === "/SaveUserFilter" && method === "POST") {
1029
1028
  await saveUserFilter(request, response);
1030
1029
  return;
1031
- } else if (url === "/PushNotificationToken" && method === "POST") {
1030
+ } else if (pathname === "/PushNotificationToken" && method === "POST") {
1032
1031
  pushNotificationToken(request, response);
1033
1032
  return;
1034
- } else if (url === "/hive-client.js") {
1033
+ } else if (pathname === "/hive-client.js") {
1035
1034
  const filePath = path6.join(process.cwd(), "node_modules/@hivedev/hivesdk/hive-client.js");
1036
1035
  const stream = fs6.createReadStream(filePath);
1037
1036
  stream.on("open", () => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hivedev/hivesdk",
3
3
  "type": "module",
4
- "version": "1.0.37",
4
+ "version": "1.0.39",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
7
7
  "scripts": {