pim-import 2.41.0 → 2.42.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 +2 -1
- package/dist/index.js.map +1 -1
- package/dist/libs/logs.js +8 -2
- package/dist/libs/logs.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/libs/logs.ts +8 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.importDownloads = exports.removeProjectObject = exports.reindexProjects = exports.reindexProject = exports.removeDownloadObject = exports.reindexDownloads = exports.reindexDownload = exports.removeModelObject = exports.reindexModels = exports.reindexModel = exports.removeSubModelObject = exports.reindexSubModels = exports.reindexSubModel = exports.removeProductObject = exports.reindexProducts = exports.reindexProduct = exports.removeSubFamilyObject = exports.reindexSubFamily = exports.reindexSubFamilies = exports.removeFamilyObject = exports.reindexFamily = exports.reindexFamilies = exports.resetIndexSettings = exports.audit = exports.getAllProductEntriesByCatalog = exports.setProductRelationships = exports.setProductsRelationships = exports.importProductByCode = exports.importFamilies = exports.importSubFamilies = exports.importSubModels = exports.importModels = exports.dailyProductsUpdate = exports.importLatestProducts = exports.importCategoriesAndSubFamilies = exports.importDictionaryProductSubLine = exports.importDictionaryProductLine = exports.importDictionaryIcons = exports.importDictionaryFields = exports.getFileFromS3 = exports.saveJsonToS3 = exports.uploadS3 = exports.initS3 = exports.getTopicPage = exports.getEntryByID = exports.deleteEntries = exports.deletePages = exports.initBaseEntries = exports.initContentful = exports.initPim = void 0;
|
|
4
|
-
exports.removeRecordsByStatus = exports.setLogId = exports.log = exports.getStaticDailyProducts = exports.getLocalISOTime = void 0;
|
|
4
|
+
exports.removeRecordsByStatus = exports.setLogOptions = exports.setLogId = exports.log = exports.getStaticDailyProducts = exports.getLocalISOTime = void 0;
|
|
5
5
|
const sentry_1 = require("./libs/sentry");
|
|
6
6
|
sentry_1.initSentry();
|
|
7
7
|
var config_1 = require("./pim/config");
|
|
@@ -82,6 +82,7 @@ Object.defineProperty(exports, "getStaticDailyProducts", { enumerable: true, get
|
|
|
82
82
|
var logs_1 = require("./libs/logs");
|
|
83
83
|
Object.defineProperty(exports, "log", { enumerable: true, get: function () { return logs_1.log; } });
|
|
84
84
|
Object.defineProperty(exports, "setLogId", { enumerable: true, get: function () { return logs_1.setLogId; } });
|
|
85
|
+
Object.defineProperty(exports, "setLogOptions", { enumerable: true, get: function () { return logs_1.setLogOptions; } });
|
|
85
86
|
var clean_1 = require("./algolia/clean");
|
|
86
87
|
Object.defineProperty(exports, "removeRecordsByStatus", { enumerable: true, get: function () { return clean_1.removeRecordsByStatus; } });
|
|
87
88
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,0CAA2C;AAC3C,mBAAU,EAAE,CAAC;AACb,uCAA+C;AAAtC,iGAAA,IAAI,OAAW;AACxB,gDAO2B;AANzB,4GAAA,IAAI,OAAkB;AACtB,6GAAA,eAAe,OAAA;AACf,yGAAA,WAAW,OAAA;AACX,2GAAA,aAAa,OAAA;AACb,0GAAA,YAAY,OAAA;AACZ,0GAAA,YAAY,OAAA;AAEd,gCAKmB;AAJjB,4FAAA,IAAI,OAAU;AACd,8FAAA,MAAM,OAAY;AAClB,kGAAA,YAAY,OAAA;AACZ,mGAAA,aAAa,OAAA;AAEf,uDAKkC;AAJhC,oHAAA,sBAAsB,OAAA;AACtB,mHAAA,qBAAqB,OAAA;AACrB,yHAAA,2BAA2B,OAAA;AAC3B,4HAAA,8BAA8B,OAAA;AAEhC,mDAAwE;AAA/D,0HAAA,8BAA8B,OAAA;AACvC,+DAAoE;AAA3D,sHAAA,oBAAoB,OAAA;AAC7B,yEAAwE;AAA/D,0HAAA,mBAAmB,O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A,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA;AAErB,iDAI6B;AAH3B,4GAAA,eAAe,OAAA;AACf,6GAAA,gBAAgB,OAAA;AAChB,iHAAA,oBAAoB,OAAA;AAEtB,2CAI0B;AAHxB,sGAAA,YAAY,OAAA;AACZ,uGAAA,aAAa,OAAA;AACb,2GAAA,iBAAiB,OAAA;AAEnB,iDAI6B;AAH3B,4GAAA,eAAe,OAAA;AACf,6GAAA,gBAAgB,OAAA;AAChB,iHAAA,oBAAoB,OAAA;AAEtB,+CAI4B;AAH1B,0GAAA,cAAc,OAAA;AACd,2GAAA,eAAe,OAAA;AACf,+GAAA,mBAAmB,OAAA;AAErB,6CAAqD;AAA5C,yGAAA,eAAe,OAAA;AACxB,iCAA0C;AAAjC,wGAAA,eAAe,OAAA;AACxB,6CAAyD;AAAhD,mHAAA,sBAAsB,OAAA;AAC/B,oCAA2D;AAAlD,2FAAA,GAAG,OAAA;AAAE,gGAAA,QAAQ,OAAA;AAAE,qGAAA,aAAa,OAAA;AACrC,yCAAwD;AAA/C,8GAAA,qBAAqB,OAAA"}
|
package/dist/libs/logs.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.log = exports.setLogId = exports.getLogger = exports.logLevelToHide = exports.logStatus = void 0;
|
|
3
|
+
exports.log = exports.setLogOptions = exports.setLogId = exports.getLogger = exports.logLevelToHide = exports.logStatus = void 0;
|
|
4
4
|
exports.logStatus = true;
|
|
5
5
|
exports.logLevelToHide = [];
|
|
6
6
|
const logdna = require("@logdna/logger");
|
|
7
7
|
let logger = null;
|
|
8
8
|
let logId = "";
|
|
9
|
+
let logOpts = {};
|
|
9
10
|
const getLogger = () => {
|
|
10
11
|
if (logger) {
|
|
11
12
|
console.log("Logger already exists");
|
|
@@ -30,6 +31,10 @@ const setLogId = (id) => {
|
|
|
30
31
|
logId = id;
|
|
31
32
|
};
|
|
32
33
|
exports.setLogId = setLogId;
|
|
34
|
+
const setLogOptions = (opts) => {
|
|
35
|
+
logOpts = opts;
|
|
36
|
+
};
|
|
37
|
+
exports.setLogOptions = setLogOptions;
|
|
33
38
|
const log = (message, level = "DEBUG") => {
|
|
34
39
|
const Logger = exports.getLogger();
|
|
35
40
|
message = logId ? `[${logId}] - ${message}` : message;
|
|
@@ -45,7 +50,8 @@ const log = (message, level = "DEBUG") => {
|
|
|
45
50
|
else if (exports.logStatus || !exports.logLevelToHide.includes(level)) {
|
|
46
51
|
if (Logger) {
|
|
47
52
|
console.log(`${level} - ${message}`);
|
|
48
|
-
|
|
53
|
+
logOpts.level = level;
|
|
54
|
+
Logger.log(message, logOpts);
|
|
49
55
|
}
|
|
50
56
|
else {
|
|
51
57
|
const date = new Date();
|
package/dist/libs/logs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../src/libs/logs.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../src/libs/logs.ts"],"names":[],"mappings":";;;AAEa,QAAA,SAAS,GAAG,IAAI,CAAC;AACjB,QAAA,cAAc,GAAgB,EAAE,CAAC;AAE9C,MAAM,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACzC,IAAI,MAAM,GAAQ,IAAI,CAAC;AACvB,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAI,OAAO,GAAkB,EAAE,CAAC;AAEzB,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,IAAI,MAAM,EAAE;QACV,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;KACtC;SAAM,IACL,OAAO,EAAE,GAAG,EAAE,cAAc;QAC5B,OAAO,EAAE,GAAG,EAAE,mBAAmB,EACjC;QACA,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC1B,MAAM,OAAO,GAAG;YACd,GAAG,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ACrC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;YACtB,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;SAC9B;aAAM;YACL,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YACxB,MAAM,UAAU,GACd,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;gBACnE,GAAG;gBACH,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACpE,OAAO,CAAC,GAAG,CAAC,IAAI,UAAU,KAAK,KAAK,MAAM,OAAO,EAAE,CAAC,CAAC;SACtD;KACF;AACH,CAAC,CAAC;AAzBW,QAAA,GAAG,OAyBd"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -87,5 +87,5 @@ export {
|
|
|
87
87
|
export { importDownloads } from "./downloads/import";
|
|
88
88
|
export { getLocalISOTime } from "./utils";
|
|
89
89
|
export { getStaticDailyProducts } from "./pim/endpoints";
|
|
90
|
-
export { log, setLogId } from "./libs/logs";
|
|
90
|
+
export { log, setLogId, setLogOptions } from "./libs/logs";
|
|
91
91
|
export { removeRecordsByStatus } from "./algolia/clean";
|
package/src/libs/logs.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ObjectPartial } from "../types";
|
|
1
2
|
export type LogLevels = "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR" | "FATAL"; // https://www.npmjs.com/package/@logdna/logger#user-content-supported-log-levels
|
|
2
3
|
export const logStatus = true;
|
|
3
4
|
export const logLevelToHide: LogLevels[] = []; // ["debug", "info"];
|
|
@@ -5,6 +6,7 @@ export const logLevelToHide: LogLevels[] = []; // ["debug", "info"];
|
|
|
5
6
|
const logdna = require("@logdna/logger");
|
|
6
7
|
let logger: any = null;
|
|
7
8
|
let logId = "";
|
|
9
|
+
let logOpts: ObjectPartial = {};
|
|
8
10
|
|
|
9
11
|
export const getLogger = () => {
|
|
10
12
|
if (logger) {
|
|
@@ -33,6 +35,10 @@ export const setLogId = (id: string) => {
|
|
|
33
35
|
logId = id;
|
|
34
36
|
};
|
|
35
37
|
|
|
38
|
+
export const setLogOptions = (opts: ObjectPartial) => {
|
|
39
|
+
logOpts = opts;
|
|
40
|
+
};
|
|
41
|
+
|
|
36
42
|
export const log = (message: string, level: LogLevels = "DEBUG") => {
|
|
37
43
|
const Logger = getLogger();
|
|
38
44
|
|
|
@@ -47,7 +53,8 @@ export const log = (message: string, level: LogLevels = "DEBUG") => {
|
|
|
47
53
|
} else if (logStatus || !logLevelToHide.includes(level)) {
|
|
48
54
|
if (Logger) {
|
|
49
55
|
console.log(`${level} - ${message}`);
|
|
50
|
-
|
|
56
|
+
logOpts.level = level;
|
|
57
|
+
Logger.log(message, logOpts);
|
|
51
58
|
} else {
|
|
52
59
|
const date = new Date();
|
|
53
60
|
const dateFormat =
|