pim-import 2.78.2 → 2.79.1

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.
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reindexModel = exports.removeSubModelObject = exports.reindexSubModels = exports.reindexSubModel = exports.removeProductObject = exports.reindexProducts = exports.reindexProduct = exports.removeSubFamilyObject = exports.reindexSubFamily = exports.reindexSubFamilies = exports.pipedreamReindex = exports.removeFamilyObject = exports.reindexFamily = exports.reindexFamilies = exports.resetIndexSettings = exports.removeAllProductModelProductRelations = exports.removeProductFromColorVariantsByProductLine = exports.setProductAutodescriptionByTopicId = exports.getProductAutodescription = exports.setProductsAutodescription = exports.generateTechSpecPdf = exports.audit = exports.getAllProductEntriesByCatalog = exports.setProductRelationships = exports.setProductsRelationships = exports.importProductByCode = exports.importFamilies = exports.importSubFamilies = exports.importSubModels = exports.importModels = exports.dailyProductsUpdate = exports.importLatestProducts = exports.importCategories = exports.importDictionaryProductSubLine = exports.importDictionaryProductLine = exports.importDictionaryIcons = exports.importDictionaryFields = exports.savePDFToS3 = exports.getFileFromS3 = exports.saveJsonToS3 = exports.uploadS3 = exports.initS3 = exports.getTopicPage = exports.getEntryByID = exports.deleteEntries = exports.deletePages = exports.initBaseEntries = exports.initContentful = exports.initPim = exports.reportError = void 0;
4
+ exports.generatePDFByUrl = exports.removeRecordsByStatus = exports.setLogOptions = exports.setLogId = exports.log = exports.getStaticDailyProducts = exports.getLocalISOTime = exports.importDownloads = exports.removePostObject = exports.reindexPosts = exports.reindexPost = exports.removePressReleaseObject = exports.reindexPressReleases = exports.reindexPressRelease = exports.removePressReviewObject = exports.reindexPressReviews = exports.reindexPressReview = exports.removeStoryObject = exports.reindexStories = exports.reindexStory = exports.removeProjectObject = exports.reindexProjects = exports.reindexProject = exports.removeDownloadObject = exports.reindexDownloads = exports.reindexDownload = exports.removeModelObject = exports.reindexModels = void 0;
5
+ const sentry_1 = require("./libs/sentry");
6
+ sentry_1.initSentry();
7
+ var sentry_2 = require("./libs/sentry");
8
+ Object.defineProperty(exports, "reportError", { enumerable: true, get: function () { return sentry_2.reportError; } });
9
+ var config_1 = require("./pim/config");
10
+ Object.defineProperty(exports, "initPim", { enumerable: true, get: function () { return config_1.init; } });
11
+ var contentful_1 = require("./libs/contentful");
12
+ Object.defineProperty(exports, "initContentful", { enumerable: true, get: function () { return contentful_1.init; } });
13
+ Object.defineProperty(exports, "initBaseEntries", { enumerable: true, get: function () { return contentful_1.initBaseEntries; } });
14
+ Object.defineProperty(exports, "deletePages", { enumerable: true, get: function () { return contentful_1.deletePages; } });
15
+ Object.defineProperty(exports, "deleteEntries", { enumerable: true, get: function () { return contentful_1.deleteEntries; } });
16
+ Object.defineProperty(exports, "getEntryByID", { enumerable: true, get: function () { return contentful_1.getEntryByID; } });
17
+ Object.defineProperty(exports, "getTopicPage", { enumerable: true, get: function () { return contentful_1.getTopicPage; } });
18
+ var s3_1 = require("./libs/s3");
19
+ Object.defineProperty(exports, "initS3", { enumerable: true, get: function () { return s3_1.init; } });
20
+ Object.defineProperty(exports, "uploadS3", { enumerable: true, get: function () { return s3_1.upload; } });
21
+ Object.defineProperty(exports, "saveJsonToS3", { enumerable: true, get: function () { return s3_1.saveJsonToS3; } });
22
+ Object.defineProperty(exports, "getFileFromS3", { enumerable: true, get: function () { return s3_1.getFileFromS3; } });
23
+ Object.defineProperty(exports, "savePDFToS3", { enumerable: true, get: function () { return s3_1.savePDFToS3; } });
24
+ var dictionary_1 = require("./pim/methods/dictionary");
25
+ Object.defineProperty(exports, "importDictionaryFields", { enumerable: true, get: function () { return dictionary_1.importDictionaryFields; } });
26
+ Object.defineProperty(exports, "importDictionaryIcons", { enumerable: true, get: function () { return dictionary_1.importDictionaryIcons; } });
27
+ Object.defineProperty(exports, "importDictionaryProductLine", { enumerable: true, get: function () { return dictionary_1.importDictionaryProductLine; } });
28
+ Object.defineProperty(exports, "importDictionaryProductSubLine", { enumerable: true, get: function () { return dictionary_1.importDictionaryProductSubLine; } });
29
+ var catalogs_1 = require("./pim/methods/catalogs");
30
+ Object.defineProperty(exports, "importCategories", { enumerable: true, get: function () { return catalogs_1.importCategories; } });
31
+ var latestProducts_1 = require("./pim/methods/latestProducts");
32
+ Object.defineProperty(exports, "importLatestProducts", { enumerable: true, get: function () { return latestProducts_1.importLatestProducts; } });
33
+ var dailyProductsUpdate_1 = require("./pim/methods/dailyProductsUpdate");
34
+ Object.defineProperty(exports, "dailyProductsUpdate", { enumerable: true, get: function () { return dailyProductsUpdate_1.dailyProductsUpdate; } });
35
+ var models_1 = require("./pim/methods/models");
36
+ Object.defineProperty(exports, "importModels", { enumerable: true, get: function () { return models_1.importModels; } });
37
+ var submodels_1 = require("./pim/methods/submodels");
38
+ Object.defineProperty(exports, "importSubModels", { enumerable: true, get: function () { return submodels_1.importSubModels; } });
39
+ var subfamilies_1 = require("./pim/methods/subfamilies");
40
+ Object.defineProperty(exports, "importSubFamilies", { enumerable: true, get: function () { return subfamilies_1.importSubFamilies; } });
41
+ var families_1 = require("./pim/methods/families");
42
+ Object.defineProperty(exports, "importFamilies", { enumerable: true, get: function () { return families_1.importFamilies; } });
43
+ var products_1 = require("./pim/methods/products");
44
+ Object.defineProperty(exports, "importProductByCode", { enumerable: true, get: function () { return products_1.importProductByCode; } });
45
+ Object.defineProperty(exports, "setProductsRelationships", { enumerable: true, get: function () { return products_1.setProductsRelationships; } });
46
+ Object.defineProperty(exports, "setProductRelationships", { enumerable: true, get: function () { return products_1.setProductRelationships; } });
47
+ Object.defineProperty(exports, "getAllProductEntriesByCatalog", { enumerable: true, get: function () { return products_1.getAllProductEntriesByCatalog; } });
48
+ Object.defineProperty(exports, "audit", { enumerable: true, get: function () { return products_1.audit; } });
49
+ Object.defineProperty(exports, "generateTechSpecPdf", { enumerable: true, get: function () { return products_1.generateTechSpecPdf; } });
50
+ Object.defineProperty(exports, "setProductsAutodescription", { enumerable: true, get: function () { return products_1.setProductsAutodescription; } });
51
+ Object.defineProperty(exports, "getProductAutodescription", { enumerable: true, get: function () { return products_1.getProductAutodescription; } });
52
+ Object.defineProperty(exports, "setProductAutodescriptionByTopicId", { enumerable: true, get: function () { return products_1.setProductAutodescriptionByTopicId; } });
53
+ Object.defineProperty(exports, "removeProductFromColorVariantsByProductLine", { enumerable: true, get: function () { return products_1.removeProductFromColorVariantsByProductLine; } });
54
+ Object.defineProperty(exports, "removeAllProductModelProductRelations", { enumerable: true, get: function () { return products_1.removeAllProductModelProductRelations; } });
55
+ var config_2 = require("./algolia/config");
56
+ Object.defineProperty(exports, "resetIndexSettings", { enumerable: true, get: function () { return config_2.resetIndexSettings; } });
57
+ var families_2 = require("./algolia/families");
58
+ Object.defineProperty(exports, "reindexFamilies", { enumerable: true, get: function () { return families_2.reindexFamilies; } });
59
+ Object.defineProperty(exports, "reindexFamily", { enumerable: true, get: function () { return families_2.reindexFamily; } });
60
+ Object.defineProperty(exports, "removeFamilyObject", { enumerable: true, get: function () { return families_2.removeFamilyObject; } });
61
+ var pipedreamReindex_1 = require("./algolia/pipedreamReindex");
62
+ Object.defineProperty(exports, "pipedreamReindex", { enumerable: true, get: function () { return pipedreamReindex_1.pipedreamReindex; } });
63
+ var subFamilies_1 = require("./algolia/subFamilies");
64
+ Object.defineProperty(exports, "reindexSubFamilies", { enumerable: true, get: function () { return subFamilies_1.reindexSubFamilies; } });
65
+ Object.defineProperty(exports, "reindexSubFamily", { enumerable: true, get: function () { return subFamilies_1.reindexSubFamily; } });
66
+ Object.defineProperty(exports, "removeSubFamilyObject", { enumerable: true, get: function () { return subFamilies_1.removeSubFamilyObject; } });
67
+ var products_2 = require("./algolia/products");
68
+ Object.defineProperty(exports, "reindexProduct", { enumerable: true, get: function () { return products_2.reindexProduct; } });
69
+ Object.defineProperty(exports, "reindexProducts", { enumerable: true, get: function () { return products_2.reindexProducts; } });
70
+ Object.defineProperty(exports, "removeProductObject", { enumerable: true, get: function () { return products_2.removeProductObject; } });
71
+ var subModels_1 = require("./algolia/subModels");
72
+ Object.defineProperty(exports, "reindexSubModel", { enumerable: true, get: function () { return subModels_1.reindexSubModel; } });
73
+ Object.defineProperty(exports, "reindexSubModels", { enumerable: true, get: function () { return subModels_1.reindexSubModels; } });
74
+ Object.defineProperty(exports, "removeSubModelObject", { enumerable: true, get: function () { return subModels_1.removeSubModelObject; } });
75
+ var models_2 = require("./algolia/models");
76
+ Object.defineProperty(exports, "reindexModel", { enumerable: true, get: function () { return models_2.reindexModel; } });
77
+ Object.defineProperty(exports, "reindexModels", { enumerable: true, get: function () { return models_2.reindexModels; } });
78
+ Object.defineProperty(exports, "removeModelObject", { enumerable: true, get: function () { return models_2.removeModelObject; } });
79
+ var downloads_1 = require("./algolia/downloads");
80
+ Object.defineProperty(exports, "reindexDownload", { enumerable: true, get: function () { return downloads_1.reindexDownload; } });
81
+ Object.defineProperty(exports, "reindexDownloads", { enumerable: true, get: function () { return downloads_1.reindexDownloads; } });
82
+ Object.defineProperty(exports, "removeDownloadObject", { enumerable: true, get: function () { return downloads_1.removeDownloadObject; } });
83
+ var projects_1 = require("./algolia/projects");
84
+ Object.defineProperty(exports, "reindexProject", { enumerable: true, get: function () { return projects_1.reindexProject; } });
85
+ Object.defineProperty(exports, "reindexProjects", { enumerable: true, get: function () { return projects_1.reindexProjects; } });
86
+ Object.defineProperty(exports, "removeProjectObject", { enumerable: true, get: function () { return projects_1.removeProjectObject; } });
87
+ var stories_1 = require("./algolia/stories");
88
+ Object.defineProperty(exports, "reindexStory", { enumerable: true, get: function () { return stories_1.reindexStory; } });
89
+ Object.defineProperty(exports, "reindexStories", { enumerable: true, get: function () { return stories_1.reindexStories; } });
90
+ Object.defineProperty(exports, "removeStoryObject", { enumerable: true, get: function () { return stories_1.removeStoryObject; } });
91
+ var pressReview_1 = require("./algolia/pressReview");
92
+ Object.defineProperty(exports, "reindexPressReview", { enumerable: true, get: function () { return pressReview_1.reindexPressReview; } });
93
+ Object.defineProperty(exports, "reindexPressReviews", { enumerable: true, get: function () { return pressReview_1.reindexPressReviews; } });
94
+ Object.defineProperty(exports, "removePressReviewObject", { enumerable: true, get: function () { return pressReview_1.removePressReviewObject; } });
95
+ var pressRelease_1 = require("./algolia/pressRelease");
96
+ Object.defineProperty(exports, "reindexPressRelease", { enumerable: true, get: function () { return pressRelease_1.reindexPressRelease; } });
97
+ Object.defineProperty(exports, "reindexPressReleases", { enumerable: true, get: function () { return pressRelease_1.reindexPressReleases; } });
98
+ Object.defineProperty(exports, "removePressReleaseObject", { enumerable: true, get: function () { return pressRelease_1.removePressReleaseObject; } });
99
+ var news_1 = require("./algolia/news");
100
+ Object.defineProperty(exports, "reindexPost", { enumerable: true, get: function () { return news_1.reindexPost; } });
101
+ Object.defineProperty(exports, "reindexPosts", { enumerable: true, get: function () { return news_1.reindexPosts; } });
102
+ Object.defineProperty(exports, "removePostObject", { enumerable: true, get: function () { return news_1.removePostObject; } });
103
+ var import_1 = require("./downloads/import");
104
+ Object.defineProperty(exports, "importDownloads", { enumerable: true, get: function () { return import_1.importDownloads; } });
105
+ var utils_1 = require("./utils");
106
+ Object.defineProperty(exports, "getLocalISOTime", { enumerable: true, get: function () { return utils_1.getLocalISOTime; } });
107
+ var endpoints_1 = require("./pim/endpoints");
108
+ Object.defineProperty(exports, "getStaticDailyProducts", { enumerable: true, get: function () { return endpoints_1.getStaticDailyProducts; } });
109
+ var logs_1 = require("./libs/logs");
110
+ Object.defineProperty(exports, "log", { enumerable: true, get: function () { return logs_1.log; } });
111
+ Object.defineProperty(exports, "setLogId", { enumerable: true, get: function () { return logs_1.setLogId; } });
112
+ Object.defineProperty(exports, "setLogOptions", { enumerable: true, get: function () { return logs_1.setLogOptions; } });
113
+ var clean_1 = require("./algolia/clean");
114
+ Object.defineProperty(exports, "removeRecordsByStatus", { enumerable: true, get: function () { return clean_1.removeRecordsByStatus; } });
115
+ var puppeteer_1 = require("./libs/puppeteer");
116
+ Object.defineProperty(exports, "generatePDFByUrl", { enumerable: true, get: function () { return puppeteer_1.generatePDFByUrl; } });
117
+ //# sourceMappingURL=browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":";;;;AAAA,0CAA2C;AAC3C,mBAAU,EAAE,CAAC;AACb,wCAA4C;AAAnC,qGAAA,WAAW,OAAA;AACpB,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,gCAMmB;AALjB,4FAAA,IAAI,OAAU;AACd,8FAAA,MAAM,OAAY;AAClB,kGAAA,YAAY,OAAA;AACZ,mGAAA,aAAa,OAAA;AACb,iGAAA,WAAW,OAAA;AAEb,uDAKkC;AAJhC,oHAAA,sBAAsB,OAAA;AACtB,mHAAA,qBAAqB,OAAA;AACrB,yHAAA,2BAA2B,OAAA;AAC3B,4HAAA,8BAA8B,OAAA;AAEhC,mDAA0D;AAAjD,4GAAA,gBAAgB,OAAA;AACzB,+DAAoE;AAA3D,sHAAA,oBAAoB,OAAA;AAC7B,yEAAwE;AAA/D,0HAAA,mBAAmB,OAAA;AAC5B,+CAAoD;AAA3C,sGAAA,YAAY,OAAA;AACrB,qDAA0D;AAAjD,4GAAA,eAAe,OAAA;AACxB,yDAA8D;AAArD,gHAAA,iBAAiB,OAAA;AAC1B,mDAAwD;AAA/C,0GAAA,cAAc,OAAA;AACvB,mDAYgC;AAX9B,+GAAA,mBAAmB,OAAA;AACnB,oHAAA,wBAAwB,OAAA;AACxB,mHAAA,uBAAuB,OAAA;AACvB,yHAAA,6BAA6B,OAAA;AAC7B,iGAAA,KAAK,OAAA;AACL,+GAAA,mBAAmB,OAAA;AACnB,sHAAA,0BAA0B,OAAA;AAC1B,qHAAA,yBAAyB,O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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;AAC9B,8CAAoD;AAA3C,6GAAA,gBAAgB,OAAA"}
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.uploadAssetByUrl = exports.getWrapperImgixAttributesByAsset = exports.getWrapperImgixFields = exports.getDefaultWrapperImgixAttributesByPimUrl = exports.getWrapperImgixAttributesByPimUrl = exports.getImageAttributesByPimUrl = exports.getImageAttributesByOriginPath = exports.getContentTypeByPimUrl = exports.getNameByPimUrl = exports.getOriginPathByPimUrl = exports.getSources = exports.getImgix = void 0;
6
+ exports.uploadAssetByUrl = exports.getWrapperImgixAttributesByAsset = exports.getWrapperImgixFields = exports.getDefaultWrapperImgixAttributesByPimUrl = exports.getWrapperImgixAttributesByPimUrl = exports.getImgixPimUrlByOriginPath = exports.getImageAttributesByPimUrl = exports.getImageAttributesByOriginPath = exports.getContentTypeByPimUrl = exports.getNameByPimUrl = exports.getOriginPathByPimUrl = exports.getSources = exports.getImgix = void 0;
7
7
  const imgix_management_js_1 = __importDefault(require("imgix-management-js"));
8
8
  const endpoints_1 = require("../pim/endpoints");
9
9
  const logs_1 = require("./logs");
@@ -11,6 +11,7 @@ const contentful_cda_1 = require("./contentful-cda");
11
11
  const axios_1 = __importDefault(require("axios"));
12
12
  const https_1 = __importDefault(require("https"));
13
13
  const mime_types_1 = __importDefault(require("mime-types"));
14
+ const utils_1 = require("../utils");
14
15
  let imgix;
15
16
  const getImgix = () => {
16
17
  if (imgix) {
@@ -65,12 +66,13 @@ exports.getImageAttributesByPimUrl = getImageAttributesByPimUrl;
65
66
  const getImgixPimUrlByOriginPath = (originPath) => {
66
67
  return `https://${process.env.FPI_IMGIX_PIM_IMAGE_DOMAIN}${originPath}`;
67
68
  };
69
+ exports.getImgixPimUrlByOriginPath = getImgixPimUrlByOriginPath;
68
70
  const getImgixAssetUrlByOriginPath = (originPath) => {
69
71
  return `https://${process.env.FPI_IMGIX_ASSET_IMAGE_DOMAIN}${originPath}`;
70
72
  };
71
- const getImigixDataFromImgixAttributes = (imgAttributes) => {
73
+ const getImgixDataFromImgixAttributes = (imgAttributes) => {
72
74
  const imgixData = {
73
- url: getImgixPimUrlByOriginPath(imgAttributes.origin_path),
75
+ url: exports.getImgixPimUrlByOriginPath(imgAttributes.origin_path),
74
76
  details: {
75
77
  size: imgAttributes.file_size,
76
78
  image: {
@@ -87,7 +89,7 @@ const getWrapperImgixAttributesByPimUrl = async (pimUrl) => {
87
89
  const allImgAttributes = await exports.getImageAttributesByPimUrl(pimUrl);
88
90
  let imgixData = null;
89
91
  if (Object.entries(allImgAttributes).length) {
90
- imgixData = getImigixDataFromImgixAttributes(allImgAttributes);
92
+ imgixData = getImgixDataFromImgixAttributes(allImgAttributes);
91
93
  }
92
94
  return imgixData;
93
95
  };
@@ -100,7 +102,7 @@ const getDefaultWrapperImgixAttributesByPimUrl = (pimUrl) => {
100
102
  media_height: 1920,
101
103
  content_type: exports.getContentTypeByPimUrl(pimUrl),
102
104
  };
103
- const imgixData = getImigixDataFromImgixAttributes(defaultImgAttributes);
105
+ const imgixData = getImgixDataFromImgixAttributes(defaultImgAttributes);
104
106
  return imgixData;
105
107
  };
106
108
  exports.getDefaultWrapperImgixAttributesByPimUrl = getDefaultWrapperImgixAttributesByPimUrl;
@@ -139,7 +141,7 @@ exports.getWrapperImgixAttributesByAsset = getWrapperImgixAttributesByAsset;
139
141
  const uploadAssetByUrl = async (url) => {
140
142
  logs_1.log(`uploadAssetByUrl - ${url}`);
141
143
  const sourceId = process.env.FPI_IMGIX_ASSETS_SOURCE_ID || "";
142
- const fileName = url.replace(/^.*[\\\/]/, "");
144
+ const fileName = utils_1.basename(url);
143
145
  const originPath = `/${fileName}`;
144
146
  const imgix = exports.getImgix();
145
147
  const imageAttributes = (await exports.getImageAttributesByOriginPath(originPath, sourceId));
@@ -1 +1 @@
1
- {"version":3,"file":"imgix.js","sourceRoot":"","sources":["../../src/libs/imgix.ts"],"names":[],"mappings":";;;;;;AAAA,8EAA2C;AAC3C,gDAAgD;AAChD,iCAA6B;AAE7B,qDAG0B;AAC1B,kDAA0B;AAC1B,kDAA0B;AAC1B,4DAA8B;AAE9B,IAAI,KAAe,CAAC;AACb,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,IAAI,KAAK,EAAE;QACT,OAAO,KAAK,CAAC;KACd;IAED,KAAK,GAAG,IAAI,6BAAQ,CAAC;QACnB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,EAAE;KAC5C,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAVW,QAAA,QAAQ,YAUnB;AAEK,MAAM,UAAU,GAAG,KAAK,IAAI,EAAE;IACnC,MAAM,KAAK,GAAG,gBAAQ,EAAE,CAAC;IACzB,OAAO,MAAM,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC,CAAC;AAHW,QAAA,UAAU,cAGrB;AAYK,MAAM,qBAAqB,GAAG,CAAC,SAAiB,EAAE,EAAE;IACzD,MAAM,SAAS,GAAG,wBAAY,EAAE,CAAC;IACjC,OAAO,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAC9E,CAAC,CAAC;AAHW,QAAA,qBAAqB,yBAGhC;AAYK,MAAM,eAAe,GAAG,CAAC,SAAiB,EAAE,EAAE;IACnD,OAAO,SAAS,CAAC,SAAS,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,KAAK;aAC1B,CAAC,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,EAAE;gBACnC,UAAU,EAAE,KAAK;gBACjB,YAAY,EAAE,aAAa;aAC5B,CAAC,CAAC;YACH,MAAM,UAAU,GAAG,kBAAkB,QAAQ,IAAI,QAAQ,EAAE,CAAC;YAC5D,MAAM,QAAQ,GAAG,CAAC,MAAM,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE;gBAChD,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,OAAO,CAAC,IAAI;aACnB,CAAC,CAAQ,CAAC;YACX,OAAO,wCAAgC,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;SACrE;QAAC,OAAO,GAAQ,EAAE;YACjB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,SAAS,CAAC;SAClB;KACF;AACH,CAAC,CAAC;AAzCW,QAAA,gBAAgB,oBAyC3B"}
package/dist/libs/logs.js CHANGED
@@ -3,26 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
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
- const logdna = require("@logdna/logger");
7
- let logger = null;
8
6
  let logId = "";
9
7
  let logOpts = {};
10
8
  const getLogger = () => {
11
- if (logger) {
12
- }
13
- else if (process?.env?.FPI_LOGDNA_KEY &&
14
- process?.env?.FPI_LOGDNA_APP_NAME) {
15
- const options = {
16
- app: process.env.FPI_LOGDNA_APP_NAME,
17
- level: "debug",
18
- };
19
- logger = logdna.createLogger(process.env.FPI_LOGDNA_KEY, options);
20
- logger.on("error", console.error);
21
- }
22
- else {
23
- console.log("FPI_LOGDNA_KEY or FPI_LOGDNA_APP_NAME evironment variables not found");
24
- }
25
- return logger;
9
+ return null;
26
10
  };
27
11
  exports.getLogger = getLogger;
28
12
  const setLogId = (id) => {
@@ -38,7 +22,6 @@ const log = (message, level = "DEBUG") => {
38
22
  message = logId ? `[${logId}] - ${message}` : message;
39
23
  if (level === "ERROR") {
40
24
  if (Logger) {
41
- Logger.error(message);
42
25
  throw new Error(message);
43
26
  }
44
27
  else {
@@ -49,7 +32,6 @@ const log = (message, level = "DEBUG") => {
49
32
  if (Logger) {
50
33
  console.log(`${level} - ${message}`);
51
34
  logOpts.level = level;
52
- Logger.log(message, logOpts);
53
35
  }
54
36
  else {
55
37
  const date = new Date();
@@ -1 +1 @@
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;KAEX;SAAM,IACL,OAAO,EAAE,GAAG,EAAE,cAAc;QAC5B,OAAO,EAAE,GAAG,EAAE,mBAAmB,EACjC;QAEA,MAAM,OAAO,GAAG;YACd,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB;YACpC,KAAK,EAAE,OAAO;SACf,CAAC;QACF,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAClE,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;KACnC;SAAM;QACL,OAAO,CAAC,GAAG,CACT,sEAAsE,CACvE,CAAC;KACH;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AArBW,QAAA,SAAS,aAqBpB;AAEK,MAAM,QA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,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QACvD,IAAI,MAAM,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,MAAM,OAAO,EAAE,CAAC,CAAC;YACrC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;SAEvB;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"}
@@ -265,6 +265,13 @@
265
265
  "dictionary": "",
266
266
  "type": "number"
267
267
  },
268
+ {
269
+ "key": "length_us",
270
+ "parent": "physical",
271
+ "icon": false,
272
+ "dictionary": "",
273
+ "type": "number"
274
+ },
268
275
  {
269
276
  "key": "netWeight",
270
277
  "parent": "logistic",
@@ -475,6 +482,13 @@
475
482
  "dictionary": "",
476
483
  "type": "number"
477
484
  },
485
+ {
486
+ "key": "vac",
487
+ "parent": "electrical",
488
+ "icon": false,
489
+ "dictionary": "",
490
+ "type": "string"
491
+ },
478
492
  {
479
493
  "key": "vdc",
480
494
  "parent": "electrical",
@@ -783,6 +797,13 @@
783
797
  "dictionary": "",
784
798
  "type": "number"
785
799
  },
800
+ {
801
+ "key": "rgGamutIndex",
802
+ "parent": "photomestric",
803
+ "icon": false,
804
+ "dictionary": "",
805
+ "type": "number"
806
+ },
786
807
  {
787
808
  "key": "transversalTilting",
788
809
  "parent": "physical",
@@ -838,5 +859,229 @@
838
859
  "icon": false,
839
860
  "dictionary": "DTernaryFlag",
840
861
  "type": "object"
862
+ },
863
+ {
864
+ "key": "priceLists",
865
+ "parent": "",
866
+ "icon": false,
867
+ "dictionary": "DPriceList",
868
+ "type": "array"
869
+ },
870
+ {
871
+ "key": "productionSite",
872
+ "parent": "",
873
+ "icon": false,
874
+ "dictionary": "DProductionSite",
875
+ "type": "object"
876
+ },
877
+ {
878
+ "key": "customProduct",
879
+ "parent": "",
880
+ "icon": false,
881
+ "dictionary": "DTernaryFlag",
882
+ "type": "object"
883
+ },
884
+ {
885
+ "key": "bucketColours",
886
+ "parent": "",
887
+ "icon": true,
888
+ "dictionary": "DWebColour",
889
+ "type": "array"
890
+ },
891
+ {
892
+ "key": "quickDelivery",
893
+ "parent": "",
894
+ "icon": false,
895
+ "dictionary": "DTernaryFlag",
896
+ "type": "object"
897
+ },
898
+ {
899
+ "key": "reflectorFinish",
900
+ "parent": "optical",
901
+ "icon": false,
902
+ "dictionary": "DReflectorFinish",
903
+ "type": "object"
904
+ },
905
+ {
906
+ "key": "screenFinish",
907
+ "parent": "optical",
908
+ "icon": false,
909
+ "dictionary": "",
910
+ "type": "string"
911
+ },
912
+ {
913
+ "key": "cutOff",
914
+ "parent": "electrical",
915
+ "icon": false,
916
+ "dictionary": "",
917
+ "type": "boolean"
918
+ },
919
+ {
920
+ "key": "emergencyLightingFlux",
921
+ "parent": "electrical",
922
+ "icon": false,
923
+ "dictionary": "",
924
+ "type": "number"
925
+ },
926
+ {
927
+ "key": "lightSourceIncluded",
928
+ "parent": "electrical",
929
+ "icon": false,
930
+ "dictionary": "",
931
+ "type": "string"
932
+ },
933
+ {
934
+ "key": "phases",
935
+ "parent": "electrical",
936
+ "icon": false,
937
+ "dictionary": "DPhase",
938
+ "type": "array"
939
+ },
940
+ {
941
+ "key": "maximumWattage",
942
+ "parent": "electrical",
943
+ "icon": false,
944
+ "dictionary": "",
945
+ "type": "number"
946
+ },
947
+ {
948
+ "key": "driverInputVoltage",
949
+ "parent": "electrical",
950
+ "icon": false,
951
+ "dictionary": "",
952
+ "type": "string"
953
+ },
954
+ {
955
+ "key": "driverOutputVoltage",
956
+ "parent": "electrical",
957
+ "icon": false,
958
+ "dictionary": "",
959
+ "type": "string"
960
+ },
961
+ {
962
+ "key": "lor",
963
+ "parent": "photometric",
964
+ "icon": false,
965
+ "dictionary": "",
966
+ "type": "string"
967
+ },
968
+ {
969
+ "key": "rgGamutIndex",
970
+ "parent": "photometric",
971
+ "icon": false,
972
+ "dictionary": "",
973
+ "type": "number"
974
+ },
975
+ {
976
+ "key": "suspensionType",
977
+ "parent": "physical",
978
+ "icon": false,
979
+ "dictionary": "DSuspensionType",
980
+ "type": "object"
981
+ },
982
+ {
983
+ "key": "constructionMaterial",
984
+ "parent": "physical",
985
+ "icon": false,
986
+ "dictionary": "",
987
+ "type": "string"
988
+ },
989
+ {
990
+ "key": "width",
991
+ "parent": "physical",
992
+ "icon": false,
993
+ "dictionary": "",
994
+ "type": "number"
995
+ },
996
+ {
997
+ "key": "width_us",
998
+ "parent": "physical",
999
+ "icon": false,
1000
+ "dictionary": "",
1001
+ "type": "number"
1002
+ },
1003
+ {
1004
+ "key": "height",
1005
+ "parent": "physical",
1006
+ "icon": false,
1007
+ "dictionary": "",
1008
+ "type": "number"
1009
+ },
1010
+ {
1011
+ "key": "height_us",
1012
+ "parent": "physical",
1013
+ "icon": false,
1014
+ "dictionary": "",
1015
+ "type": "number"
1016
+ },
1017
+ {
1018
+ "key": "cableIngress",
1019
+ "parent": "physical",
1020
+ "icon": false,
1021
+ "dictionary": "DCableIngress",
1022
+ "type": "object"
1023
+ },
1024
+ {
1025
+ "key": "cordsColour",
1026
+ "parent": "physical",
1027
+ "icon": false,
1028
+ "dictionary": "DWebColour",
1029
+ "type": "array"
1030
+ },
1031
+ {
1032
+ "key": "canopyColor",
1033
+ "parent": "physical",
1034
+ "icon": false,
1035
+ "dictionary": "DWebColour",
1036
+ "type": "object"
1037
+ },
1038
+ {
1039
+ "key": "shippingPkgQty",
1040
+ "parent": "logistic",
1041
+ "icon": false,
1042
+ "dictionary": "",
1043
+ "type": "string"
1044
+ },
1045
+ {
1046
+ "key": "pkgRefCode",
1047
+ "parent": "logistic",
1048
+ "icon": false,
1049
+ "dictionary": "",
1050
+ "type": "string"
1051
+ },
1052
+ {
1053
+ "key": "available",
1054
+ "parent": "logistic",
1055
+ "icon": false,
1056
+ "dictionary": "DTernaryFlag",
1057
+ "type": "object"
1058
+ },
1059
+ {
1060
+ "key": "production",
1061
+ "parent": "logistic",
1062
+ "icon": false,
1063
+ "dictionary": "DProduction",
1064
+ "type": "object"
1065
+ },
1066
+ {
1067
+ "key": "euRule",
1068
+ "parent": "certification",
1069
+ "icon": false,
1070
+ "dictionary": "",
1071
+ "type": "string"
1072
+ },
1073
+ {
1074
+ "key": "lightObjMinDist",
1075
+ "parent": "marking",
1076
+ "icon": false,
1077
+ "dictionary": "",
1078
+ "type": "number"
1079
+ },
1080
+ {
1081
+ "key": "spareParts",
1082
+ "parent": "DTernaryFlag",
1083
+ "icon": false,
1084
+ "dictionary": "",
1085
+ "type": "object"
841
1086
  }
842
1087
  ]
@@ -13,37 +13,6 @@ const logs_1 = require("../../libs/logs");
13
13
  const utils_1 = require("../../utils");
14
14
  exports.contentTypeId = "globalJsonFile";
15
15
  exports.entryId = "globalJsonProductFields";
16
- const updateContentfulDictionaryData = async (data, clearBefore = false) => {
17
- logs_1.log(`updateContentfulDictionaryData - Start`, "INFO");
18
- const environment = await contentful_1.getEnvironment();
19
- const defaultEnvironmentLocaleCode = await contentful_1.getEnvironmentDefaultLocaleCode();
20
- logs_1.log(`Check if dictionary entry exists`);
21
- let entry = await contentful_1.getEntryByID(exports.entryId, exports.contentTypeId);
22
- const entryData = {
23
- fields: {},
24
- };
25
- if (entry) {
26
- logs_1.log(`Dictionary entry exists. Update entry data`);
27
- if (clearBefore &&
28
- Object.entries(entry.fields.json[defaultEnvironmentLocaleCode]).length) {
29
- entry.fields.json[defaultEnvironmentLocaleCode] = {};
30
- entry = await entry.update();
31
- }
32
- entryData.fields = entry?.fields || {};
33
- entryData.fields = await contentful_1.addFieldValue(entryData, "internalName", "DictionaryProductFields");
34
- entryData.fields = await contentful_1.addFieldValue(entryData, "json", data);
35
- entry = await entry.update();
36
- entry = await entry.publish();
37
- }
38
- else {
39
- logs_1.log(`Entry not exists. Create new entry with data`);
40
- entryData.fields = await contentful_1.addFieldValue(entryData, "internalName", "DictionaryProductFields");
41
- entryData.fields = await contentful_1.addFieldValue(entryData, "json", data);
42
- entry = await environment.createEntryWithId(exports.contentTypeId, exports.entryId, entryData);
43
- entry = await entry.publish();
44
- }
45
- logs_1.log(`updateContentfulDictionaryData - Completed`);
46
- };
47
16
  const getRequiredDictionaryDataWithIcons = () => {
48
17
  return productFields_json_1.default.filter((field) => field.icon);
49
18
  };
@@ -83,13 +52,11 @@ const importDictionaryIcons = async (skipAlreadyExistsCheck = false) => {
83
52
  try {
84
53
  s3_1.checkConfig();
85
54
  logs_1.log("importDictionaryIcons - Start", "INFO");
86
- logs_1.log("Get dictionary Contentful entry");
87
- const defaultEnvironmentLocaleCode = await contentful_1.getEnvironmentDefaultLocaleCode();
88
- const entry = await contentful_1.getEntryByID(exports.entryId, exports.contentTypeId);
89
- if (!entry) {
90
- throw new Error("Dictionary entry not exists.");
55
+ logs_1.log("Get S3 JSON dictionary file");
56
+ const data = await s3_1.getFileFromS3(`dictionary.json`);
57
+ if (!data) {
58
+ throw new Error("Dictionary JSON file not found on S3.");
91
59
  }
92
- const data = entry.fields.json[defaultEnvironmentLocaleCode];
93
60
  const requiredDictionaryDataWithIcons = getRequiredDictionaryDataWithIcons();
94
61
  for (const reqField of requiredDictionaryDataWithIcons) {
95
62
  const reqFieldKey = reqField.key;
@@ -124,8 +91,8 @@ const importDictionaryIcons = async (skipAlreadyExistsCheck = false) => {
124
91
  else {
125
92
  logs_1.log(`No certifications found into contenful dictionary`);
126
93
  }
127
- logs_1.log("Updating Contentful dictionary entry data");
128
- await updateContentfulDictionaryData(data, true);
94
+ logs_1.log("Updating S3 dictionary entry data");
95
+ await s3_1.saveJsonToS3(data, "dictionary.json");
129
96
  logs_1.log("importDictionaryIcons - Completed");
130
97
  return { completed: true };
131
98
  }
@@ -205,7 +172,7 @@ const importDictionaryFields = async (offset = 0, limit = -1) => {
205
172
  }
206
173
  if (Object.entries(data).length) {
207
174
  logs_1.log("Create/Update Contentful entry");
208
- await updateContentfulDictionaryData(data, offset === 0);
175
+ await s3_1.saveJsonToS3(data, "dictionary.json", "");
209
176
  }
210
177
  else {
211
178
  logs_1.log("no matches found", "ERROR");