@contrail/flexplm 1.7.0 → 1.7.1-alpha.69baa36

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.
@@ -9,6 +9,7 @@ export declare class ThumbnailUtil {
9
9
  /** The max_thumbnail_size is for limiting the size of the thumbnail being sent to FlexPLM. It is used when checking the size of the auto generated thumbnails (smallViewable, tinyViewable, etc.). */
10
10
  private max_thumbnail_size;
11
11
  private entities;
12
+ static THUMBNAIL: string;
12
13
  static NEW_THUMBNAIL_ID: string;
13
14
  static EXISTING_THUMBNAIL_ID: string;
14
15
  static REMOVE_THUMBNAIL: string;
@@ -136,7 +136,8 @@ class ThumbnailUtil {
136
136
  const eventData = event.data || {};
137
137
  const newThumbnailId = eventData[ThumbnailUtil.NEW_THUMBNAIL_ID];
138
138
  const existingThumbnailId = eventData[ThumbnailUtil.EXISTING_THUMBNAIL_ID];
139
- const thumbnailUrl = newThumbnailId || existingThumbnailId;
139
+ const thumbnailUrl = eventData[ThumbnailUtil.THUMBNAIL];
140
+ // const thumbnailUrl = newThumbnailId || existingThumbnailId;
140
141
  // Case 1: REMOVE_THUMBNAIL
141
142
  if (newThumbnailId === ThumbnailUtil.REMOVE_THUMBNAIL) {
142
143
  if (primaryViewableId) {
@@ -236,6 +237,8 @@ class ThumbnailUtil {
236
237
  }
237
238
  }
238
239
  exports.ThumbnailUtil = ThumbnailUtil;
240
+ // Adding Thumbnail property
241
+ ThumbnailUtil.THUMBNAIL = 'THUMBNAIL';
239
242
  ThumbnailUtil.NEW_THUMBNAIL_ID = 'NEW_THUMBNAIL_ID';
240
243
  ThumbnailUtil.EXISTING_THUMBNAIL_ID = 'EXISTING_THUMBNAIL_ID';
241
244
  ThumbnailUtil.REMOVE_THUMBNAIL = 'REMOVE_THUMBNAIL';
@@ -319,7 +319,8 @@ describe('ThumbnailUtil Tests', () => {
319
319
  tinyViewableUrl: null,
320
320
  };
321
321
  mockContentCreate.mockResolvedValue(createdContent);
322
- const event = { data: { [thumbnail_util_1.ThumbnailUtil.NEW_THUMBNAIL_ID]: '/rest/thumbnail/thumb.png' } };
322
+ // const event = { data: { [ThumbnailUtil.NEW_THUMBNAIL_ID]: '/rest/thumbnail/thumb.png' } };
323
+ const event = { data: { [thumbnail_util_1.ThumbnailUtil.THUMBNAIL]: '/rest/thumbnail/thumb.png' } };
323
324
  await tu.syncThumbnailToVibeIQ({ entityId: 'entity1', event, entityName: 'color' });
324
325
  expect(mockGetRequest).toHaveBeenCalledWith({ urlPath: '/rest/thumbnail/thumb.png', includeUrlContext: false, returnFullResponse: true });
325
326
  expect(mockContentCreate).toHaveBeenCalledWith(expect.objectContaining({
@@ -350,7 +351,8 @@ describe('ThumbnailUtil Tests', () => {
350
351
  primaryFileUrl: 'https://files/primary.png', largeViewableUrl: null,
351
352
  mediumLargeViewableUrl: null, mediumViewableUrl: null, smallViewableUrl: null, tinyViewableUrl: null,
352
353
  });
353
- const event = { data: { [thumbnail_util_1.ThumbnailUtil.NEW_THUMBNAIL_ID]: '/rest/thumbnail/my image.png' } };
354
+ // const event = { data: { [ThumbnailUtil.NEW_THUMBNAIL_ID]: '/rest/thumbnail/my image.png' } };
355
+ const event = { data: { [thumbnail_util_1.ThumbnailUtil.THUMBNAIL]: '/rest/thumbnail/my image.png' } };
354
356
  await tu.syncThumbnailToVibeIQ({ entityId: 'entity1', event, entityName: 'color' });
355
357
  expect(mockGetRequest).toHaveBeenCalledWith({
356
358
  urlPath: '/rest/thumbnail/my%20image.png',
@@ -370,7 +372,8 @@ describe('ThumbnailUtil Tests', () => {
370
372
  primaryFileUrl: 'https://files/primary.jpg', largeViewableUrl: null,
371
373
  mediumLargeViewableUrl: null, mediumViewableUrl: null, smallViewableUrl: null, tinyViewableUrl: null,
372
374
  });
373
- const event = { data: { [thumbnail_util_1.ThumbnailUtil.NEW_THUMBNAIL_ID]: '/rest/thumbnail/café-logo.jpg' } };
375
+ // const event = { data: { [ThumbnailUtil.NEW_THUMBNAIL_ID]: '/rest/thumbnail/café-logo.jpg' } };
376
+ const event = { data: { [thumbnail_util_1.ThumbnailUtil.THUMBNAIL]: '/rest/thumbnail/café-logo.jpg' } };
374
377
  await tu.syncThumbnailToVibeIQ({ entityId: 'entity1', event, entityName: 'item' });
375
378
  expect(mockGetRequest).toHaveBeenCalledWith({
376
379
  urlPath: '/rest/thumbnail/caf%C3%A9-logo.jpg',
@@ -405,7 +408,8 @@ describe('ThumbnailUtil Tests', () => {
405
408
  tinyViewableUrl: null,
406
409
  };
407
410
  mockContentCreate.mockResolvedValue(createdContent);
408
- const event = { data: { [thumbnail_util_1.ThumbnailUtil.NEW_THUMBNAIL_ID]: '/rest/thumbnail/new.jpg' } };
411
+ // const event = { data: { [ThumbnailUtil.NEW_THUMBNAIL_ID]: '/rest/thumbnail/new.jpg' } };
412
+ const event = { data: { [thumbnail_util_1.ThumbnailUtil.THUMBNAIL]: '/rest/thumbnail/new.jpg' } };
409
413
  await tu.syncThumbnailToVibeIQ({ entityId: 'entity1', primaryViewableId: 'oldPv', event, entityName: 'item' });
410
414
  // Creates new content
411
415
  expect(mockContentCreate).toHaveBeenCalled();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/flexplm",
3
- "version": "1.7.0",
3
+ "version": "1.7.1-alpha.69baa36",
4
4
  "description": "Library used for integration with flexplm.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",