🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →

@geprog/node-migrate-ts

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@geprog/node-migrate-ts - npm Package Compare versions

Comparing version

to
3.2.0

@@ -7,4 +7,4 @@ import { Db } from 'mongodb';

id: string;
up(context?: MigrationContext): Promise<void> | void;
down(context?: MigrationContext): Promise<void> | void;
up(this: void, context?: MigrationContext): Promise<void> | void;
down(this: void, context?: MigrationContext): Promise<void> | void;
}

@@ -11,0 +11,0 @@

@@ -0,1 +1,2 @@

"use strict";
var __defProp = Object.defineProperty;

@@ -5,3 +6,2 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;

var __hasOwnProp = Object.prototype.hasOwnProperty;
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
var __export = (target, all) => {

@@ -11,15 +11,20 @@ for (var name in all)

};
var __reExport = (target, module2, copyDefault, desc) => {
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
for (let key of __getOwnPropNames(module2))
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return target;
return to;
};
var __toCommonJS = /* @__PURE__ */ ((cache) => {
return (module2, temp) => {
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
};
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var __forAwait = (obj, it, method) => {
it = obj[Symbol.asyncIterator];
method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((resolve, reject, done) => {
arg = fn.call(obj, arg);
done = arg.done;
return Promise.resolve(arg.value).then((value) => resolve({ value, done }), reject);
}));
return it ? it.call(obj) : (obj = obj[Symbol.iterator](), it = {}, method("next"), method("return"), it);
};

@@ -32,2 +37,3 @@ // src/index.ts

});
module.exports = __toCommonJS(src_exports);

@@ -51,3 +57,3 @@ // src/MongoMigrationStore.ts

migrationId: migration.id,
timestamp: +new Date()
timestamp: +/* @__PURE__ */ new Date()
});

@@ -64,9 +70,22 @@ }

const appliedMigrations = await migrationStore.getAppliedMigrations();
const migrationsToApply = migrations.filter((migration) => appliedMigrations.find((appliedMigration) => appliedMigration.migrationId === migration.id) === void 0);
for await (const migration of migrationsToApply) {
await migration.up(context);
await migrationStore.insertMigration(migration);
const migrationsToApply = migrations.filter(
(migration) => appliedMigrations.find((appliedMigration) => appliedMigration.migrationId === migration.id) === void 0
);
try {
for (var iter = __forAwait(migrationsToApply), more, temp, error; more = !(temp = await iter.next()).done; more = false) {
const migration = temp.value;
await migration.up(context);
await migrationStore.insertMigration(migration);
}
} catch (temp) {
error = [temp];
} finally {
try {
more && (temp = iter.return) && await temp.call(iter);
} finally {
if (error)
throw error[0];
}
}
};
module.exports = __toCommonJS(src_exports);
// Annotate the CommonJS export names for ESM import in node:

@@ -73,0 +92,0 @@ 0 && (module.exports = {

{
"name": "@geprog/node-migrate-ts",
"version": "3.1.14",
"version": "3.2.0",
"description": "Abstract migration framework using TypeScript",

@@ -32,15 +32,17 @@ "homepage": "https://geprog.com",

"devDependencies": {
"@geprog/eslint-config": "1.1.0",
"@geprog/semantic-release-config": "1.0.0",
"c8": "7.11.3",
"eslint": "8.8.0",
"mongodb": "4.3.1",
"prettier": "2.5.1",
"semantic-release": "19.0.2",
"tsup": "5.11.13",
"typescript": "4.5.5",
"vitest": "0.16.0"
"@geprog/eslint-config": "2.1.0",
"@geprog/semantic-release-config": "2.0.0",
"@vitest/coverage-c8": "0.28.5",
"c8": "7.13.0",
"eslint": "8.34.0",
"mongodb": "5.0.1",
"prettier": "2.8.4",
"semantic-release": "20.1.0",
"tsup": "6.6.3",
"typescript": "4.9.5",
"vite": "4.1.4",
"vitest": "0.28.5"
},
"peerDependencies": {
"mongodb": "^3.6.0 || ^4.0.0"
"mongodb": "^3.6.0 || ^4.0.0 || ^5.0.0"
},

@@ -47,0 +49,0 @@ "peerDependenciesMeta": {

Sorry, the diff of this file is not supported yet