npm-pkg-hook 1.12.9 → 1.13.0
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/dist/index.js +60 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +308 -267
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -4
- package/src/hooks/getGlobalSession/index.ts +8 -8
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useColorByLetters/helpers/index.ts +11 -9
- package/src/hooks/useLogout/index.ts +1 -1
- package/src/hooks/useModules/helpers/validateModules.ts +35 -21
- package/src/hooks/useOrders/useOrdersFromStore/index.ts +3 -4
- package/src/hooks/useReactToPrint/index.ts +4 -0
- package/src/index.ts +5 -2
- package/src/utils/utils.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -7890,6 +7890,7 @@ __export(index_exports, {
|
|
|
7890
7890
|
SERVICES: () => SERVICES,
|
|
7891
7891
|
SPANISH_MONTHS: () => SPANISH_MONTHS,
|
|
7892
7892
|
UtilDateRange: () => UtilDateRange,
|
|
7893
|
+
__NEXTAUTH: () => __NEXTAUTH2,
|
|
7893
7894
|
addTenMinutes: () => addTenMinutes,
|
|
7894
7895
|
chatRoomSubscription: () => chatRoomSubscription,
|
|
7895
7896
|
completeSchedules: () => completeSchedules,
|
|
@@ -7900,6 +7901,8 @@ __export(index_exports, {
|
|
|
7900
7901
|
days: () => days,
|
|
7901
7902
|
decryptSession: () => decryptSession,
|
|
7902
7903
|
encryptSession: () => encryptSession,
|
|
7904
|
+
errorHandler: () => errorHandler,
|
|
7905
|
+
errorLink: () => errorLink,
|
|
7903
7906
|
fetchJson: () => fetchJson,
|
|
7904
7907
|
filterKeyObject: () => filterKeyObject,
|
|
7905
7908
|
fingerprintJs: () => fingerprintJs,
|
|
@@ -7932,6 +7935,7 @@ __export(index_exports, {
|
|
|
7932
7935
|
once: () => once,
|
|
7933
7936
|
parseFormattedFloat: () => parseFormattedFloat,
|
|
7934
7937
|
paymentMethodCards: () => paymentMethodCards,
|
|
7938
|
+
signOutAuth: () => signOutAuth,
|
|
7935
7939
|
statusOpenStores: () => statusOpenStores,
|
|
7936
7940
|
statusOrder: () => statusOrder,
|
|
7937
7941
|
statusProduct: () => statusProduct,
|
|
@@ -8116,6 +8120,45 @@ __export(index_exports, {
|
|
|
8116
8120
|
});
|
|
8117
8121
|
module.exports = __toCommonJS(index_exports);
|
|
8118
8122
|
|
|
8123
|
+
// package.json
|
|
8124
|
+
var package_default = {
|
|
8125
|
+
main: "dist/index.cjs",
|
|
8126
|
+
module: "dist/index.mjs",
|
|
8127
|
+
types: "dist/index.d.ts",
|
|
8128
|
+
exports: {
|
|
8129
|
+
".": {
|
|
8130
|
+
types: "./dist/index.d.ts",
|
|
8131
|
+
development: "./src/index.ts",
|
|
8132
|
+
import: "./dist/index.mjs",
|
|
8133
|
+
require: "./dist/index.cjs"
|
|
8134
|
+
}
|
|
8135
|
+
},
|
|
8136
|
+
scripts: {
|
|
8137
|
+
build: "tsup",
|
|
8138
|
+
prepare: "npm run build",
|
|
8139
|
+
prepublishOnly: "npm run build",
|
|
8140
|
+
lint: "eslint .",
|
|
8141
|
+
test: "jest"
|
|
8142
|
+
},
|
|
8143
|
+
peerDependencies: {
|
|
8144
|
+
react: "^18 || ^19",
|
|
8145
|
+
"react-dom": "^18 || ^19",
|
|
8146
|
+
next: "^14 || ^15",
|
|
8147
|
+
"@apollo/client": "^3 || ^4",
|
|
8148
|
+
graphql: "^16",
|
|
8149
|
+
fs: "0.0.1-security"
|
|
8150
|
+
},
|
|
8151
|
+
devDependencies: {
|
|
8152
|
+
tsup: "8.5.1",
|
|
8153
|
+
typescript: "5.9.3",
|
|
8154
|
+
"@types/react": "18.0.20",
|
|
8155
|
+
"@types/js-cookie": "3.0.6",
|
|
8156
|
+
"@types/file-saver": "2.0.7"
|
|
8157
|
+
},
|
|
8158
|
+
version: "1.13.0",
|
|
8159
|
+
name: "npm-pkg-hook"
|
|
8160
|
+
};
|
|
8161
|
+
|
|
8119
8162
|
// src/hooks/updateExtProductFoodsOptional/index.ts
|
|
8120
8163
|
var import_client2 = require("@apollo/client");
|
|
8121
8164
|
|
|
@@ -8169,7 +8212,7 @@ var UtilDateRange = class {
|
|
|
8169
8212
|
};
|
|
8170
8213
|
|
|
8171
8214
|
// src/utils/utils.ts
|
|
8172
|
-
var
|
|
8215
|
+
var import_crypto = require("crypto");
|
|
8173
8216
|
var validTypes = {
|
|
8174
8217
|
text: true,
|
|
8175
8218
|
password: true,
|
|
@@ -8222,7 +8265,7 @@ var RandomCode = (length, options = {}) => {
|
|
|
8222
8265
|
}
|
|
8223
8266
|
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
8224
8267
|
const charactersLength = characters.length;
|
|
8225
|
-
const randomBuffer = (0,
|
|
8268
|
+
const randomBuffer = (0, import_crypto.randomBytes)(length);
|
|
8226
8269
|
let code = "";
|
|
8227
8270
|
for (let i = 0; i < length; i++) {
|
|
8228
8271
|
const index = randomBuffer[i] % charactersLength;
|
|
@@ -10517,13 +10560,11 @@ var import_client14 = require("@apollo/client");
|
|
|
10517
10560
|
|
|
10518
10561
|
// src/hooks/useModules/helpers/validateModules.ts
|
|
10519
10562
|
var validateModules = (modules = [], permissions = {}) => {
|
|
10520
|
-
if (!Array.isArray(modules) ||
|
|
10521
|
-
return modules
|
|
10563
|
+
if (!Array.isArray(modules) || modules.length <= 0) return [];
|
|
10564
|
+
return modules.map((module2) => {
|
|
10522
10565
|
const hasReadPermission = permissions[module2.view]?.includes("read");
|
|
10523
10566
|
const validSubModules = module2.subModules?.filter(
|
|
10524
|
-
(subModule) =>
|
|
10525
|
-
return permissions[subModule.view]?.includes("read");
|
|
10526
|
-
}
|
|
10567
|
+
(subModule) => permissions[subModule.view]?.includes("read")
|
|
10527
10568
|
) || [];
|
|
10528
10569
|
if (!hasReadPermission && validSubModules.length === 0) {
|
|
10529
10570
|
return null;
|
|
@@ -55580,9 +55621,9 @@ var useGetStoreCookie = () => {
|
|
|
55580
55621
|
};
|
|
55581
55622
|
|
|
55582
55623
|
// src/hooks/getGlobalSession/index.ts
|
|
55583
|
-
var
|
|
55624
|
+
var import_crypto2 = __toESM(require("crypto"));
|
|
55584
55625
|
function generateEncryptionKey(password, salt) {
|
|
55585
|
-
return
|
|
55626
|
+
return import_crypto2.default.pbkdf2Sync(password, salt, 1e5, 32, "sha256").toString("hex").slice(0, 32);
|
|
55586
55627
|
}
|
|
55587
55628
|
var ENCRYPTION_KEY = generateEncryptionKey(
|
|
55588
55629
|
"tu-contrase\xF1a",
|
|
@@ -55591,8 +55632,8 @@ var ENCRYPTION_KEY = generateEncryptionKey(
|
|
|
55591
55632
|
var IV_LENGTH = 12;
|
|
55592
55633
|
var encryptSession = (text) => {
|
|
55593
55634
|
try {
|
|
55594
|
-
const iv =
|
|
55595
|
-
const cipher =
|
|
55635
|
+
const iv = import_crypto2.default.randomBytes(IV_LENGTH);
|
|
55636
|
+
const cipher = import_crypto2.default.createCipheriv(
|
|
55596
55637
|
"aes-256-gcm",
|
|
55597
55638
|
Buffer.from(ENCRYPTION_KEY),
|
|
55598
55639
|
iv
|
|
@@ -55607,7 +55648,7 @@ var encryptSession = (text) => {
|
|
|
55607
55648
|
].join(":");
|
|
55608
55649
|
} catch (error) {
|
|
55609
55650
|
if (error instanceof Error) {
|
|
55610
|
-
console.error("Error de
|
|
55651
|
+
console.error("Error de cifrado:", error.message);
|
|
55611
55652
|
}
|
|
55612
55653
|
return null;
|
|
55613
55654
|
}
|
|
@@ -55620,7 +55661,7 @@ var decryptSession = (text) => {
|
|
|
55620
55661
|
const iv = Buffer.from(textParts[0], "hex");
|
|
55621
55662
|
const authTag = Buffer.from(textParts[1], "hex");
|
|
55622
55663
|
const encryptedText = Buffer.from(textParts[2], "hex");
|
|
55623
|
-
const decipher =
|
|
55664
|
+
const decipher = import_crypto2.default.createDecipheriv(
|
|
55624
55665
|
"aes-256-gcm",
|
|
55625
55666
|
Buffer.from(ENCRYPTION_KEY),
|
|
55626
55667
|
iv
|
|
@@ -55631,7 +55672,7 @@ var decryptSession = (text) => {
|
|
|
55631
55672
|
return decrypted.toString("utf8");
|
|
55632
55673
|
} catch (error) {
|
|
55633
55674
|
if (error instanceof Error) {
|
|
55634
|
-
console.error("Error de
|
|
55675
|
+
console.error("Error de descifrado:", error.message);
|
|
55635
55676
|
}
|
|
55636
55677
|
return null;
|
|
55637
55678
|
}
|
|
@@ -57248,7 +57289,7 @@ var getSession = async () => {
|
|
|
57248
57289
|
var future = null;
|
|
57249
57290
|
|
|
57250
57291
|
// src/index.ts
|
|
57251
|
-
var version2 =
|
|
57292
|
+
var version2 = package_default.version;
|
|
57252
57293
|
// Annotate the CommonJS export names for ESM import in node:
|
|
57253
57294
|
0 && (module.exports = {
|
|
57254
57295
|
BroadcastChannel,
|
|
@@ -57281,6 +57322,7 @@ var version2 = "1.12.9";
|
|
|
57281
57322
|
SERVICES,
|
|
57282
57323
|
SPANISH_MONTHS,
|
|
57283
57324
|
UtilDateRange,
|
|
57325
|
+
__NEXTAUTH,
|
|
57284
57326
|
addTenMinutes,
|
|
57285
57327
|
chatRoomSubscription,
|
|
57286
57328
|
completeSchedules,
|
|
@@ -57291,6 +57333,8 @@ var version2 = "1.12.9";
|
|
|
57291
57333
|
days,
|
|
57292
57334
|
decryptSession,
|
|
57293
57335
|
encryptSession,
|
|
57336
|
+
errorHandler,
|
|
57337
|
+
errorLink,
|
|
57294
57338
|
fetchJson,
|
|
57295
57339
|
filterKeyObject,
|
|
57296
57340
|
fingerprintJs,
|
|
@@ -57323,6 +57367,7 @@ var version2 = "1.12.9";
|
|
|
57323
57367
|
once,
|
|
57324
57368
|
parseFormattedFloat,
|
|
57325
57369
|
paymentMethodCards,
|
|
57370
|
+
signOutAuth,
|
|
57326
57371
|
statusOpenStores,
|
|
57327
57372
|
statusOrder,
|
|
57328
57373
|
statusProduct,
|