refactor(actions): migrate endpoint and file proxies to focused imports

This commit is contained in:
2026-03-12 17:39:50 +00:00
parent f0202bbd02
commit fa985351ff
8 changed files with 42 additions and 106 deletions
@@ -45,11 +45,10 @@
import axios from "axios";
import CryptoJS from "crypto-js";
import _ from "lodash";
import {
azureHeadersPagedCustom,
consoleLogger,
getToken,
} from "../../../actions";
import { azureHeadersPagedCustom } from "../../../actions/core/headers";
import { consoleLogger } from "../../../actions/core/logger";
import { getToken } from "../../../actions/core/token";
import { hashAPIPath } from "../../../actions/core/hash";
const WORDKEY = process.env.HASHKEY;
@@ -57,18 +56,6 @@ const WEBAPI_URL =
process.env.RELAY_ROOT ||
"https://dev-pedw-ns.servicebus.windows.net/dev-pedw-hc/";
const hashAPIPath = (queryPath) => {
var hashlink = CryptoJS.HmacSHA256(
queryPath,
CryptoJS.enc.Hex.parse(WORDKEY)
);
hashlink = hashlink.toString(CryptoJS.enc.Hex);
//return "&hash=" + hashlink;
return (queryPath.indexOf("?") > -1 ? "&hash=" : "?hash=") + hashlink;
};
const encryptDocReference = (documentRef) => {
var hashlink = CryptoJS.HmacSHA256(
"documents/download/" + documentRef,
@@ -158,7 +145,7 @@ export default async function ApiProxy(req, res) {
"pinswg_documentpublisheddate":
element.pinswg_documentpublisheddate != null
? element.pinswg_documentpublisheddate
: element.pinswg_latestpublisheddate,
: element.pinswg_latestpublisheddate
});
element.pinswg_hashlink = encryptDocReference(
element.pinswg_isharedocumentreference