npm-pkg-hook 1.12.8 → 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 CHANGED
@@ -5681,7 +5681,7 @@ var require_lodash = __commonJS({
5681
5681
  }
5682
5682
  return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
5683
5683
  });
5684
- function join2(array, separator) {
5684
+ function join(array, separator) {
5685
5685
  return array == null ? "" : nativeJoin.call(array, separator);
5686
5686
  }
5687
5687
  function last(array) {
@@ -7600,7 +7600,7 @@ var require_lodash = __commonJS({
7600
7600
  lodash.isUndefined = isUndefined;
7601
7601
  lodash.isWeakMap = isWeakMap;
7602
7602
  lodash.isWeakSet = isWeakSet;
7603
- lodash.join = join2;
7603
+ lodash.join = join;
7604
7604
  lodash.kebabCase = kebabCase;
7605
7605
  lodash.last = last;
7606
7606
  lodash.lastIndexOf = lastIndexOf;
@@ -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,
@@ -8115,8 +8119,45 @@ __export(index_exports, {
8115
8119
  version: () => version2
8116
8120
  });
8117
8121
  module.exports = __toCommonJS(index_exports);
8118
- var import_node_fs = require("fs");
8119
- var import_node_path = require("path");
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
+ };
8120
8161
 
8121
8162
  // src/hooks/updateExtProductFoodsOptional/index.ts
8122
8163
  var import_client2 = require("@apollo/client");
@@ -8171,7 +8212,7 @@ var UtilDateRange = class {
8171
8212
  };
8172
8213
 
8173
8214
  // src/utils/utils.ts
8174
- var import_node_crypto = require("crypto");
8215
+ var import_crypto = require("crypto");
8175
8216
  var validTypes = {
8176
8217
  text: true,
8177
8218
  password: true,
@@ -8224,7 +8265,7 @@ var RandomCode = (length, options = {}) => {
8224
8265
  }
8225
8266
  const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
8226
8267
  const charactersLength = characters.length;
8227
- const randomBuffer = (0, import_node_crypto.randomBytes)(length);
8268
+ const randomBuffer = (0, import_crypto.randomBytes)(length);
8228
8269
  let code = "";
8229
8270
  for (let i = 0; i < length; i++) {
8230
8271
  const index = randomBuffer[i] % charactersLength;
@@ -10519,13 +10560,11 @@ var import_client14 = require("@apollo/client");
10519
10560
 
10520
10561
  // src/hooks/useModules/helpers/validateModules.ts
10521
10562
  var validateModules = (modules = [], permissions = {}) => {
10522
- if (!Array.isArray(modules) || module.length <= 0) return [];
10523
- return modules?.map((module2) => {
10563
+ if (!Array.isArray(modules) || modules.length <= 0) return [];
10564
+ return modules.map((module2) => {
10524
10565
  const hasReadPermission = permissions[module2.view]?.includes("read");
10525
10566
  const validSubModules = module2.subModules?.filter(
10526
- (subModule) => {
10527
- return permissions[subModule.view]?.includes("read");
10528
- }
10567
+ (subModule) => permissions[subModule.view]?.includes("read")
10529
10568
  ) || [];
10530
10569
  if (!hasReadPermission && validSubModules.length === 0) {
10531
10570
  return null;
@@ -55582,9 +55621,9 @@ var useGetStoreCookie = () => {
55582
55621
  };
55583
55622
 
55584
55623
  // src/hooks/getGlobalSession/index.ts
55585
- var import_node_crypto2 = __toESM(require("crypto"));
55624
+ var import_crypto2 = __toESM(require("crypto"));
55586
55625
  function generateEncryptionKey(password, salt) {
55587
- return import_node_crypto2.default.pbkdf2Sync(password, salt, 1e5, 32, "sha256").toString("hex").slice(0, 32);
55626
+ return import_crypto2.default.pbkdf2Sync(password, salt, 1e5, 32, "sha256").toString("hex").slice(0, 32);
55588
55627
  }
55589
55628
  var ENCRYPTION_KEY = generateEncryptionKey(
55590
55629
  "tu-contrase\xF1a",
@@ -55593,8 +55632,8 @@ var ENCRYPTION_KEY = generateEncryptionKey(
55593
55632
  var IV_LENGTH = 12;
55594
55633
  var encryptSession = (text) => {
55595
55634
  try {
55596
- const iv = import_node_crypto2.default.randomBytes(IV_LENGTH);
55597
- const cipher = import_node_crypto2.default.createCipheriv(
55635
+ const iv = import_crypto2.default.randomBytes(IV_LENGTH);
55636
+ const cipher = import_crypto2.default.createCipheriv(
55598
55637
  "aes-256-gcm",
55599
55638
  Buffer.from(ENCRYPTION_KEY),
55600
55639
  iv
@@ -55609,7 +55648,7 @@ var encryptSession = (text) => {
55609
55648
  ].join(":");
55610
55649
  } catch (error) {
55611
55650
  if (error instanceof Error) {
55612
- console.error("Error de encriptaci\xF3n:", error.message);
55651
+ console.error("Error de cifrado:", error.message);
55613
55652
  }
55614
55653
  return null;
55615
55654
  }
@@ -55622,7 +55661,7 @@ var decryptSession = (text) => {
55622
55661
  const iv = Buffer.from(textParts[0], "hex");
55623
55662
  const authTag = Buffer.from(textParts[1], "hex");
55624
55663
  const encryptedText = Buffer.from(textParts[2], "hex");
55625
- const decipher = import_node_crypto2.default.createDecipheriv(
55664
+ const decipher = import_crypto2.default.createDecipheriv(
55626
55665
  "aes-256-gcm",
55627
55666
  Buffer.from(ENCRYPTION_KEY),
55628
55667
  iv
@@ -55633,7 +55672,7 @@ var decryptSession = (text) => {
55633
55672
  return decrypted.toString("utf8");
55634
55673
  } catch (error) {
55635
55674
  if (error instanceof Error) {
55636
- console.error("Error de desencriptaci\xF3n:", error.message);
55675
+ console.error("Error de descifrado:", error.message);
55637
55676
  }
55638
55677
  return null;
55639
55678
  }
@@ -57250,8 +57289,7 @@ var getSession = async () => {
57250
57289
  var future = null;
57251
57290
 
57252
57291
  // src/index.ts
57253
- var packageJson = JSON.parse((0, import_node_fs.readFileSync)((0, import_node_path.join)(__dirname, "..", "package.json"), "utf8"));
57254
- var version2 = packageJson.version;
57292
+ var version2 = package_default.version;
57255
57293
  // Annotate the CommonJS export names for ESM import in node:
57256
57294
  0 && (module.exports = {
57257
57295
  BroadcastChannel,
@@ -57284,6 +57322,7 @@ var version2 = packageJson.version;
57284
57322
  SERVICES,
57285
57323
  SPANISH_MONTHS,
57286
57324
  UtilDateRange,
57325
+ __NEXTAUTH,
57287
57326
  addTenMinutes,
57288
57327
  chatRoomSubscription,
57289
57328
  completeSchedules,
@@ -57294,6 +57333,8 @@ var version2 = packageJson.version;
57294
57333
  days,
57295
57334
  decryptSession,
57296
57335
  encryptSession,
57336
+ errorHandler,
57337
+ errorLink,
57297
57338
  fetchJson,
57298
57339
  filterKeyObject,
57299
57340
  fingerprintJs,
@@ -57326,6 +57367,7 @@ var version2 = packageJson.version;
57326
57367
  once,
57327
57368
  parseFormattedFloat,
57328
57369
  paymentMethodCards,
57370
+ signOutAuth,
57329
57371
  statusOpenStores,
57330
57372
  statusOrder,
57331
57373
  statusProduct,