mobiletto-base
Advanced tools
Comparing version 2.0.28 to 2.0.29
@@ -18,3 +18,2 @@ "use strict"; | ||
const shasum_1 = __importDefault(require("shasum")); | ||
const randomstring_1 = __importDefault(require("randomstring")); | ||
const fs_1 = __importDefault(require("fs")); | ||
@@ -204,3 +203,3 @@ const cache_js_1 = require("./cache.js"); | ||
mobiletto_common_1.logger.verbose(`mirror: mirroring file: ${obj.name}`); | ||
const tempPath = `${util_js_1.MOBILETTO_TMP}/mobiletto_${(0, shasum_1.default)(JSON.stringify(obj))}.${randomstring_1.default.generate(10)}`; | ||
const tempPath = `${util_js_1.MOBILETTO_TMP}/mobiletto_${(0, shasum_1.default)(JSON.stringify(obj))}.${(0, mobiletto_common_1.rand)(10)}`; | ||
mobiletto_common_1.logger.debug(`mirror: writing ${obj.name} to temp file ${tempPath} ...`); | ||
@@ -207,0 +206,0 @@ const destName = obj.name.startsWith(sourcePath) ? obj.name.substring(sourcePath.length) : obj.name; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -42,3 +19,2 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
const shasum_1 = __importDefault(require("shasum")); | ||
const randomstring = __importStar(require("randomstring")); | ||
const stream_1 = require("stream"); | ||
@@ -129,3 +105,3 @@ const bullmq_1 = require("bullmq"); | ||
dirLevels, | ||
encPathPadding: () => ENC_PAD_SEP + randomstring.generate(1 + Math.floor(2 * Math.random())), | ||
encPathPadding: () => ENC_PAD_SEP + (0, mobiletto_common_1.rand)(1 + Math.floor(2 * Math.random())), | ||
metaWorkers, | ||
@@ -299,3 +275,3 @@ }; | ||
}; | ||
const mobilettoJobID = randomstring.generate(10); | ||
const mobilettoJobID = (0, mobiletto_common_1.rand)(10); | ||
const mq = metaLoadQueue(); | ||
@@ -302,0 +278,0 @@ META_HANDLERS[mobilettoJobID] = (meta) => files.push(meta); |
@@ -10,5 +10,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
import { logger, M_DIR, M_FILE, MobilettoError, MobilettoNotFoundError } from "mobiletto-common"; | ||
import { logger, M_DIR, M_FILE, MobilettoError, MobilettoNotFoundError, rand } from "mobiletto-common"; | ||
import shasum from "shasum"; | ||
import randomstring from "randomstring"; | ||
import fs from "fs"; | ||
@@ -197,3 +196,3 @@ import { AwaitableLRU, DISABLED_CACHE } from "./cache.js"; | ||
logger.verbose(`mirror: mirroring file: ${obj.name}`); | ||
const tempPath = `${MOBILETTO_TMP}/mobiletto_${shasum(JSON.stringify(obj))}.${randomstring.generate(10)}`; | ||
const tempPath = `${MOBILETTO_TMP}/mobiletto_${shasum(JSON.stringify(obj))}.${rand(10)}`; | ||
logger.debug(`mirror: writing ${obj.name} to temp file ${tempPath} ...`); | ||
@@ -200,0 +199,0 @@ const destName = obj.name.startsWith(sourcePath) ? obj.name.substring(sourcePath.length) : obj.name; |
@@ -13,6 +13,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import shasum from "shasum"; | ||
import * as randomstring from "randomstring"; | ||
import { Transform } from "stream"; | ||
import { Queue, QueueEvents, Worker } from "bullmq"; | ||
import { M_FILE, M_DIR, isReadable, logger, MobilettoError, MobilettoNotFoundError } from "mobiletto-common"; | ||
import { M_FILE, M_DIR, isReadable, logger, MobilettoError, MobilettoNotFoundError, rand } from "mobiletto-common"; | ||
import { DEFAULT_CRYPT_ALGO, normalizeKey, normalizeIV, decrypt, getCipher, getDecipher, DEFAULT_DIR_LEVELS, DEFAULT_META_WORKERS, } from "./crypt.js"; | ||
@@ -100,3 +99,3 @@ import { ALL_DRIVERS } from "./register.js"; | ||
dirLevels, | ||
encPathPadding: () => ENC_PAD_SEP + randomstring.generate(1 + Math.floor(2 * Math.random())), | ||
encPathPadding: () => ENC_PAD_SEP + rand(1 + Math.floor(2 * Math.random())), | ||
metaWorkers, | ||
@@ -270,3 +269,3 @@ }; | ||
}; | ||
const mobilettoJobID = randomstring.generate(10); | ||
const mobilettoJobID = rand(10); | ||
const mq = metaLoadQueue(); | ||
@@ -273,0 +272,0 @@ META_HANDLERS[mobilettoJobID] = (meta) => files.push(meta); |
{ | ||
"name": "mobiletto-base", | ||
"version": "2.0.28", | ||
"version": "2.0.29", | ||
"type": "module", | ||
@@ -42,3 +42,2 @@ "description": "A storage layer that presents a uniform interface to Amazon S3, Backblaze B2, local and other storage systems.", | ||
"@types/node": "^20.3.3", | ||
"@types/randomstring": "^1.1.8", | ||
"@types/shasum": "^1.0.0", | ||
@@ -59,8 +58,7 @@ "@typescript-eslint/eslint-plugin": "^5.61.0", | ||
"lru-cache": "^10.0.0", | ||
"mobiletto-common": "^2.0.14", | ||
"mobiletto-common": "^2.0.15", | ||
"node-fetch-commonjs": "^3.3.1", | ||
"node-redis-scan": "^1.3.6", | ||
"randomstring": "^1.3.0", | ||
"shasum": "^1.0.2" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7
13
157686
2996
- Removedrandomstring@^1.3.0
- Removedrandombytes@2.0.3(transitive)
- Removedrandomstring@1.3.0(transitive)
Updatedmobiletto-common@^2.0.15