pim-import 2.63.0 → 2.64.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 CHANGED
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.reindexModels = 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 = 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 = void 0;
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
5
  const sentry_1 = require("./libs/sentry");
6
6
  sentry_1.initSentry();
7
+ var sentry_2 = require("./libs/sentry");
8
+ Object.defineProperty(exports, "reportError", { enumerable: true, get: function () { return sentry_2.reportError; } });
7
9
  var config_1 = require("./pim/config");
8
10
  Object.defineProperty(exports, "initPim", { enumerable: true, get: function () { return config_1.init; } });
9
11
  var contentful_1 = require("./libs/contentful");
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,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,OAAA;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BAAuB,OAAA;AAEzB,uDAIgC;AAH9B,mHAAA,mBAAmB,OAAA;AACnB,oHAAA,oBAAoB,OAAA;AACpB,wHAAA,wBAAwB,OAAA;AAE1B,uCAA6E;AAApE,mGAAA,WAAW,OAAA;AAAE,oGAAA,YAAY,OAAA;AAAE,wGAAA,gBAAgB,OAAA;AACpD,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"}
@@ -22,20 +22,35 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
22
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.initSentry = void 0;
25
+ exports.reportError = exports.initSentry = void 0;
26
26
  const dotenv_1 = __importDefault(require("dotenv"));
27
27
  dotenv_1.default.config();
28
28
  const Sentry = __importStar(require("@sentry/node"));
29
- const initSentry = () => {
29
+ let sentryInitialized = false;
30
+ const initSentry = async () => {
30
31
  if (process.env.FPI_SENTRY_DSN) {
31
- return Sentry.init({
32
+ const sentry = await Sentry.init({
32
33
  dsn: process.env.FPI_SENTRY_DSN,
33
34
  tracesSampleRate: Number(process.env.FPI_SENTRY_TRACE_SAMPLE_RATE) || 1.0,
34
35
  });
36
+ sentryInitialized = true;
37
+ return sentry;
35
38
  }
36
39
  else {
37
40
  throw new Error("No FPI_SENTRY_DSN evironment var found");
38
41
  }
39
42
  };
40
43
  exports.initSentry = initSentry;
44
+ const reportError = async (error) => {
45
+ if (!sentryInitialized)
46
+ await exports.initSentry();
47
+ if (typeof error === "string") {
48
+ Sentry.captureMessage(error);
49
+ }
50
+ else {
51
+ Sentry.captureException(error);
52
+ }
53
+ await Sentry.flush();
54
+ };
55
+ exports.reportError = reportError;
41
56
  //# sourceMappingURL=sentry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sentry.js","sourceRoot":"","sources":["../../src/libs/sentry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA4B;AAC5B,gBAAM,CAAC,MAAM,EAAE,CAAC;AAChB,qDAAuC;AAGhC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE;QAC9B,OAAO,MAAM,CAAC,IAAI,CAAC;YACjB,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;YAK/B,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,IAAI,GAAG;SAC1E,CAAC,CAAC;KACJ;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;KAC3D;AACH,CAAC,CAAC;AAbW,QAAA,UAAU,cAarB"}
1
+ {"version":3,"file":"sentry.js","sourceRoot":"","sources":["../../src/libs/sentry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA4B;AAC5B,gBAAM,CAAC,MAAM,EAAE,CAAC;AAChB,qDAAuC;AAEvC,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAEvB,MAAM,UAAU,GAAG,KAAK,IAAI,EAAE;IACnC,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE;QAC9B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC;YAC/B,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;YAK/B,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,IAAI,GAAG;SAC1E,CAAC,CAAC;QACH,iBAAiB,GAAG,IAAI,CAAC;QACzB,OAAO,MAAM,CAAC;KACf;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;KAC3D;AACH,CAAC,CAAC;AAfW,QAAA,UAAU,cAerB;AAEK,MAAM,WAAW,GAAG,KAAK,EAAE,KAAU,EAAE,EAAE;IAC9C,IAAI,CAAC,iBAAiB;QAAE,MAAM,kBAAU,EAAE,CAAC;IAE3C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;KAC9B;SAAM;QACL,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;KAChC;IACD,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;AACvB,CAAC,CAAC;AATW,QAAA,WAAW,eAStB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pim-import",
3
- "version": "2.63.0",
3
+ "version": "2.64.0",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { initSentry } from "./libs/sentry";
2
2
  initSentry();
3
+ export { reportError } from "./libs/sentry";
3
4
  export { init as initPim } from "./pim/config";
4
5
  export {
5
6
  init as initContentful,
@@ -2,10 +2,11 @@ import dotenv from "dotenv";
2
2
  dotenv.config();
3
3
  import * as Sentry from "@sentry/node";
4
4
  // import * as Tracing from "@sentry/tracing";
5
+ let sentryInitialized = false;
5
6
 
6
- export const initSentry = () => {
7
+ export const initSentry = async () => {
7
8
  if (process.env.FPI_SENTRY_DSN) {
8
- return Sentry.init({
9
+ const sentry = await Sentry.init({
9
10
  dsn: process.env.FPI_SENTRY_DSN,
10
11
 
11
12
  // Set tracesSampleRate to 1.0 to capture 100%
@@ -13,7 +14,20 @@ export const initSentry = () => {
13
14
  // We recommend adjusting this value in production
14
15
  tracesSampleRate: Number(process.env.FPI_SENTRY_TRACE_SAMPLE_RATE) || 1.0,
15
16
  });
17
+ sentryInitialized = true;
18
+ return sentry;
16
19
  } else {
17
20
  throw new Error("No FPI_SENTRY_DSN evironment var found");
18
21
  }
19
22
  };
23
+
24
+ export const reportError = async (error: any) => {
25
+ if (!sentryInitialized) await initSentry();
26
+
27
+ if (typeof error === "string") {
28
+ Sentry.captureMessage(error);
29
+ } else {
30
+ Sentry.captureException(error);
31
+ }
32
+ await Sentry.flush();
33
+ };