primer cambio

This commit is contained in:
beseira13
2026-01-19 12:12:38 -03:00
parent 5f59dba52d
commit 44990f015a
4759 changed files with 588702 additions and 0 deletions

View File

@@ -0,0 +1,94 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
const _ = require("lodash");
const Op = require("../../../operators");
const Utils = require("../../../utils");
const OperatorHelpers = {
OperatorMap: {
[Op.eq]: "=",
[Op.ne]: "!=",
[Op.gte]: ">=",
[Op.gt]: ">",
[Op.lte]: "<=",
[Op.lt]: "<",
[Op.not]: "IS NOT",
[Op.is]: "IS",
[Op.in]: "IN",
[Op.notIn]: "NOT IN",
[Op.like]: "LIKE",
[Op.notLike]: "NOT LIKE",
[Op.iLike]: "ILIKE",
[Op.notILike]: "NOT ILIKE",
[Op.startsWith]: "LIKE",
[Op.endsWith]: "LIKE",
[Op.substring]: "LIKE",
[Op.regexp]: "~",
[Op.notRegexp]: "!~",
[Op.iRegexp]: "~*",
[Op.notIRegexp]: "!~*",
[Op.between]: "BETWEEN",
[Op.notBetween]: "NOT BETWEEN",
[Op.overlap]: "&&",
[Op.contains]: "@>",
[Op.contained]: "<@",
[Op.adjacent]: "-|-",
[Op.strictLeft]: "<<",
[Op.strictRight]: ">>",
[Op.noExtendRight]: "&<",
[Op.noExtendLeft]: "&>",
[Op.any]: "ANY",
[Op.all]: "ALL",
[Op.and]: " AND ",
[Op.or]: " OR ",
[Op.col]: "COL",
[Op.placeholder]: "$$PLACEHOLDER$$",
[Op.match]: "@@"
},
OperatorsAliasMap: {},
setOperatorsAliases(aliases) {
if (!aliases || _.isEmpty(aliases)) {
this.OperatorsAliasMap = false;
} else {
this.OperatorsAliasMap = __spreadValues({}, aliases);
}
},
_replaceAliases(orig) {
const obj = {};
if (!this.OperatorsAliasMap) {
return orig;
}
Utils.getOperators(orig).forEach((op) => {
const item = orig[op];
if (_.isPlainObject(item)) {
obj[op] = this._replaceAliases(item);
} else {
obj[op] = item;
}
});
_.forOwn(orig, (item, prop) => {
prop = this.OperatorsAliasMap[prop] || prop;
if (_.isPlainObject(item)) {
item = this._replaceAliases(item);
}
obj[prop] = item;
});
return obj;
}
};
module.exports = OperatorHelpers;
//# sourceMappingURL=operators.js.map

View File

@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../../../../src/dialects/abstract/query-generator/operators.js"],
"sourcesContent": ["'use strict';\n\nconst _ = require('lodash');\nconst Op = require('../../../operators');\nconst Utils = require('../../../utils');\n\nconst OperatorHelpers = {\n OperatorMap: {\n [Op.eq]: '=',\n [Op.ne]: '!=',\n [Op.gte]: '>=',\n [Op.gt]: '>',\n [Op.lte]: '<=',\n [Op.lt]: '<',\n [Op.not]: 'IS NOT',\n [Op.is]: 'IS',\n [Op.in]: 'IN',\n [Op.notIn]: 'NOT IN',\n [Op.like]: 'LIKE',\n [Op.notLike]: 'NOT LIKE',\n [Op.iLike]: 'ILIKE',\n [Op.notILike]: 'NOT ILIKE',\n [Op.startsWith]: 'LIKE',\n [Op.endsWith]: 'LIKE',\n [Op.substring]: 'LIKE',\n [Op.regexp]: '~',\n [Op.notRegexp]: '!~',\n [Op.iRegexp]: '~*',\n [Op.notIRegexp]: '!~*',\n [Op.between]: 'BETWEEN',\n [Op.notBetween]: 'NOT BETWEEN',\n [Op.overlap]: '&&',\n [Op.contains]: '@>',\n [Op.contained]: '<@',\n [Op.adjacent]: '-|-',\n [Op.strictLeft]: '<<',\n [Op.strictRight]: '>>',\n [Op.noExtendRight]: '&<',\n [Op.noExtendLeft]: '&>',\n [Op.any]: 'ANY',\n [Op.all]: 'ALL',\n [Op.and]: ' AND ',\n [Op.or]: ' OR ',\n [Op.col]: 'COL',\n [Op.placeholder]: '$$PLACEHOLDER$$',\n [Op.match]: '@@'\n },\n\n OperatorsAliasMap: {},\n\n setOperatorsAliases(aliases) {\n if (!aliases || _.isEmpty(aliases)) {\n this.OperatorsAliasMap = false;\n } else {\n this.OperatorsAliasMap = { ...aliases };\n }\n },\n\n _replaceAliases(orig) {\n const obj = {};\n if (!this.OperatorsAliasMap) {\n return orig;\n }\n\n Utils.getOperators(orig).forEach(op => {\n const item = orig[op];\n if (_.isPlainObject(item)) {\n obj[op] = this._replaceAliases(item);\n } else {\n obj[op] = item;\n }\n });\n\n _.forOwn(orig, (item, prop) => {\n prop = this.OperatorsAliasMap[prop] || prop;\n if (_.isPlainObject(item)) {\n item = this._replaceAliases(item);\n }\n obj[prop] = item;\n });\n return obj;\n }\n};\n\nmodule.exports = OperatorHelpers;\n"],
"mappings": ";;;;;;;;;;;;;;;;;AAEA,MAAM,IAAI,QAAQ;AAClB,MAAM,KAAK,QAAQ;AACnB,MAAM,QAAQ,QAAQ;AAEtB,MAAM,kBAAkB;AAAA,EACtB,aAAa;AAAA,KACV,GAAG,KAAK;AAAA,KACR,GAAG,KAAK;AAAA,KACR,GAAG,MAAM;AAAA,KACT,GAAG,KAAK;AAAA,KACR,GAAG,MAAM;AAAA,KACT,GAAG,KAAK;AAAA,KACR,GAAG,MAAM;AAAA,KACT,GAAG,KAAK;AAAA,KACR,GAAG,KAAK;AAAA,KACR,GAAG,QAAQ;AAAA,KACX,GAAG,OAAO;AAAA,KACV,GAAG,UAAU;AAAA,KACb,GAAG,QAAQ;AAAA,KACX,GAAG,WAAW;AAAA,KACd,GAAG,aAAa;AAAA,KAChB,GAAG,WAAW;AAAA,KACd,GAAG,YAAY;AAAA,KACf,GAAG,SAAS;AAAA,KACZ,GAAG,YAAY;AAAA,KACf,GAAG,UAAU;AAAA,KACb,GAAG,aAAa;AAAA,KAChB,GAAG,UAAU;AAAA,KACb,GAAG,aAAa;AAAA,KAChB,GAAG,UAAU;AAAA,KACb,GAAG,WAAW;AAAA,KACd,GAAG,YAAY;AAAA,KACf,GAAG,WAAW;AAAA,KACd,GAAG,aAAa;AAAA,KAChB,GAAG,cAAc;AAAA,KACjB,GAAG,gBAAgB;AAAA,KACnB,GAAG,eAAe;AAAA,KAClB,GAAG,MAAM;AAAA,KACT,GAAG,MAAM;AAAA,KACT,GAAG,MAAM;AAAA,KACT,GAAG,KAAK;AAAA,KACR,GAAG,MAAM;AAAA,KACT,GAAG,cAAc;AAAA,KACjB,GAAG,QAAQ;AAAA;AAAA,EAGd,mBAAmB;AAAA,EAEnB,oBAAoB,SAAS;AAC3B,QAAI,CAAC,WAAW,EAAE,QAAQ,UAAU;AAClC,WAAK,oBAAoB;AAAA,WACpB;AACL,WAAK,oBAAoB,mBAAK;AAAA;AAAA;AAAA,EAIlC,gBAAgB,MAAM;AACpB,UAAM,MAAM;AACZ,QAAI,CAAC,KAAK,mBAAmB;AAC3B,aAAO;AAAA;AAGT,UAAM,aAAa,MAAM,QAAQ,QAAM;AACrC,YAAM,OAAO,KAAK;AAClB,UAAI,EAAE,cAAc,OAAO;AACzB,YAAI,MAAM,KAAK,gBAAgB;AAAA,aAC1B;AACL,YAAI,MAAM;AAAA;AAAA;AAId,MAAE,OAAO,MAAM,CAAC,MAAM,SAAS;AAC7B,aAAO,KAAK,kBAAkB,SAAS;AACvC,UAAI,EAAE,cAAc,OAAO;AACzB,eAAO,KAAK,gBAAgB;AAAA;AAE9B,UAAI,QAAQ;AAAA;AAEd,WAAO;AAAA;AAAA;AAIX,OAAO,UAAU;",
"names": []
}

View File

@@ -0,0 +1,41 @@
"use strict";
const uuidv4 = require("uuid").v4;
const TransactionQueries = {
setIsolationLevelQuery(value, options) {
if (options.parent) {
return;
}
return `SET TRANSACTION ISOLATION LEVEL ${value};`;
},
generateTransactionId() {
return uuidv4();
},
startTransactionQuery(transaction) {
if (transaction.parent) {
return `SAVEPOINT ${this.quoteIdentifier(transaction.name, true)};`;
}
return "START TRANSACTION;";
},
deferConstraintsQuery() {
},
setConstraintQuery() {
},
setDeferredQuery() {
},
setImmediateQuery() {
},
commitTransactionQuery(transaction) {
if (transaction.parent) {
return;
}
return "COMMIT;";
},
rollbackTransactionQuery(transaction) {
if (transaction.parent) {
return `ROLLBACK TO SAVEPOINT ${this.quoteIdentifier(transaction.name, true)};`;
}
return "ROLLBACK;";
}
};
module.exports = TransactionQueries;
//# sourceMappingURL=transaction.js.map

View File

@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../../../../src/dialects/abstract/query-generator/transaction.js"],
"sourcesContent": ["'use strict';\n\nconst uuidv4 = require('uuid').v4;\n\nconst TransactionQueries = {\n /**\n * Returns a query that sets the transaction isolation level.\n *\n * @param {string} value The isolation level.\n * @param {object} options An object with options.\n * @returns {string} The generated sql query.\n * @private\n */\n setIsolationLevelQuery(value, options) {\n if (options.parent) {\n return;\n }\n\n return `SET TRANSACTION ISOLATION LEVEL ${value};`;\n },\n\n generateTransactionId() {\n return uuidv4();\n },\n\n /**\n * Returns a query that starts a transaction.\n *\n * @param {Transaction} transaction\n * @returns {string} The generated sql query.\n * @private\n */\n startTransactionQuery(transaction) {\n if (transaction.parent) {\n // force quoting of savepoint identifiers for postgres\n return `SAVEPOINT ${this.quoteIdentifier(transaction.name, true)};`;\n }\n\n return 'START TRANSACTION;';\n },\n\n deferConstraintsQuery() {},\n\n setConstraintQuery() {},\n setDeferredQuery() {},\n setImmediateQuery() {},\n\n /**\n * Returns a query that commits a transaction.\n *\n * @param {Transaction} transaction An object with options.\n * @returns {string} The generated sql query.\n * @private\n */\n commitTransactionQuery(transaction) {\n if (transaction.parent) {\n return;\n }\n\n return 'COMMIT;';\n },\n\n /**\n * Returns a query that rollbacks a transaction.\n *\n * @param {Transaction} transaction\n * @returns {string} The generated sql query.\n * @private\n */\n rollbackTransactionQuery(transaction) {\n if (transaction.parent) {\n // force quoting of savepoint identifiers for postgres\n return `ROLLBACK TO SAVEPOINT ${this.quoteIdentifier(transaction.name, true)};`;\n }\n\n return 'ROLLBACK;';\n }\n};\n\nmodule.exports = TransactionQueries;\n"],
"mappings": ";AAEA,MAAM,SAAS,QAAQ,QAAQ;AAE/B,MAAM,qBAAqB;AAAA,EASzB,uBAAuB,OAAO,SAAS;AACrC,QAAI,QAAQ,QAAQ;AAClB;AAAA;AAGF,WAAO,mCAAmC;AAAA;AAAA,EAG5C,wBAAwB;AACtB,WAAO;AAAA;AAAA,EAUT,sBAAsB,aAAa;AACjC,QAAI,YAAY,QAAQ;AAEtB,aAAO,aAAa,KAAK,gBAAgB,YAAY,MAAM;AAAA;AAG7D,WAAO;AAAA;AAAA,EAGT,wBAAwB;AAAA;AAAA,EAExB,qBAAqB;AAAA;AAAA,EACrB,mBAAmB;AAAA;AAAA,EACnB,oBAAoB;AAAA;AAAA,EASpB,uBAAuB,aAAa;AAClC,QAAI,YAAY,QAAQ;AACtB;AAAA;AAGF,WAAO;AAAA;AAAA,EAUT,yBAAyB,aAAa;AACpC,QAAI,YAAY,QAAQ;AAEtB,aAAO,yBAAyB,KAAK,gBAAgB,YAAY,MAAM;AAAA;AAGzE,WAAO;AAAA;AAAA;AAIX,OAAO,UAAU;",
"names": []
}