drapcode-utility 2.4.7 → 2.4.9

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.
@@ -297,7 +297,7 @@ const makeMySqlCall = async (projectId, data, extDbSetting) => {
297
297
  const allowedOps = ["select", "insert", "update", "delete"];
298
298
  let result = "";
299
299
  try {
300
- const { sql: sqlQuery, params: sqlParams = [], pagination: sqlPagination, sort: sqlSort, searchQuery } = data || {};
300
+ const { sql: sqlQuery, params: sqlParams = [], pagination: sqlPagination, files: sqlFiles = [], sort: sqlSort, searchQuery } = data || {};
301
301
  if (!sqlQuery || !sqlQuery.trim()) {
302
302
  return { status: 400, error: "SQL Query is empty" };
303
303
  }
@@ -316,6 +316,15 @@ const makeMySqlCall = async (projectId, data, extDbSetting) => {
316
316
  finalSql += (0, util_1.buildOrderByClause)(sqlSort);
317
317
  // Add LIMIT/OFFSET clause
318
318
  finalSql += (0, util_1.buildLimitOffsetClause)(sqlPagination, values);
319
+ // Add Files if any in values
320
+ if (sqlFiles && sqlFiles.length > 0) {
321
+ sqlFiles.forEach((fileObj) => {
322
+ console.log("🚀 ~ makeMySqlCall ~ fileObj:", fileObj);
323
+ const fileData = fileObj && fileObj !== 'null' ? Buffer.from(fileObj, 'base64') : null;
324
+ console.log("🚀 ~ makeMySqlCall ~ fileData:", fileData);
325
+ values.push(fileData);
326
+ });
327
+ }
319
328
  const { mysqlDbHostUrl, mysqlDbUser, mysqlDbPassword, mysqlDbName, mysqlDbPort } = extDbSetting || {};
320
329
  const mysqlDBConfig = {
321
330
  host: mysqlDbHostUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drapcode-utility",
3
- "version": "2.4.7",
3
+ "version": "2.4.9",
4
4
  "description": "DrapCode Utility",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -42,9 +42,9 @@
42
42
  "axios": "^1.1.2",
43
43
  "date-fns": "^4.1.0",
44
44
  "dompurify": "^3.1.7",
45
- "drapcode-constant": "^2.0.1",
45
+ "drapcode-constant": "^2.0.2",
46
46
  "drapcode-logger": "^1.3.5",
47
- "drapcode-redis": "^1.4.8",
47
+ "drapcode-redis": "^1.4.9",
48
48
  "exiftool-vendored": "^28.2.1",
49
49
  "express": "^4.17.1",
50
50
  "gm": "^1.25.0",