@capillarytech/creatives-library 7.13.9 → 7.13.10

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.13.9",
4
+ "version": "7.13.10",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -27,7 +27,7 @@ const CREATIVES_CDN_QUALITY_CONFIG_KEY = 'CREATIVES_CDN_QUALITY_CONFIG';
27
27
  const CREATIVES_CDN_TRANSFORMATION_URL_SUFFIX_KEY = 'CREATIVES_CDN_TRANSFORMATION_URL_SUFFIX';
28
28
 
29
29
  const HTTPS_STR = "https://"
30
- const ALLOWED_EXTENSIONS_STR = ".*(?:jpg|png|jpeg)$"
30
+ const ALLOWED_EXTENSIONS_STR = ".*(?:jpg|png|jpeg|gif)$"
31
31
  const ANY_STR = ".*"
32
32
 
33
33
  /**
@@ -113,7 +113,19 @@ describe("cdnTransformationTests", () => {
113
113
  expect(GENERATED_CDN_URL).toEqual(EXPECTED_CDN_URL);
114
114
  });
115
115
 
116
- it("Should replace s3 url with cdn url for email without transformation for formats other than jpg/png/jpeg", () => {
116
+ it("Should replace s3 url with cdn url for email for gif formats", () => {
117
+ const TEST_S3_URL = `https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/02557e68-6b7b-4d0e-ba6f-efcf8972.gif`;
118
+ const GENERATED_CDN_URL = cdnUtils.getCdnUrl({
119
+ url: TEST_S3_URL,
120
+ channelName: "EMAIL",
121
+ height: 100,
122
+ width: 200,
123
+ });
124
+ const EXPECTED_CDN_URL = `https://storage.crm.n.content-cdn.io/cdn-cgi/image/width=200,height=100,format=auto,quality=75,/intouch_creative_assets/02557e68-6b7b-4d0e-ba6f-efcf8972.gif`;
125
+ expect(GENERATED_CDN_URL).toEqual(EXPECTED_CDN_URL);
126
+ });
127
+
128
+ it("Should replace s3 url with cdn url for email without transformation for formats other than jpg/png/jpeg/gif", () => {
117
129
  const TEST_S3_URL = `https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/2c9233ed-0959-4aff-b749-9171b5c8.avif`; //this is random url
118
130
  const GENERATED_CDN_URL = cdnUtils.getCdnUrl({
119
131
  url: TEST_S3_URL,