nextemos 4.0.5 → 4.0.7
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/helpers/cdn.d.ts +2 -0
- package/dist/helpers/cdn.js +8 -1
- package/package.json +1 -1
package/dist/helpers/cdn.d.ts
CHANGED
package/dist/helpers/cdn.js
CHANGED
|
@@ -3,12 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const html_entities_1 = require("html-entities");
|
|
4
4
|
// Ortam değişkenlerinden CDN URL'si alınıyor, tanımlı değilse varsayılan olarak 'https://images.proj-e.com' kullanılıyor
|
|
5
5
|
const CDN_URL = process.env.CDN_URL || 'https://images.proj-e.com';
|
|
6
|
+
const VIDEO_CDN_URL = process.env.VIDEO_CDN_URL || CDN_URL;
|
|
6
7
|
// Ortam değişkenlerinden CDN sağlayıcısı alınıyor
|
|
7
8
|
const CDN_PROVIDER = process.env.CDN_PROVIDER;
|
|
8
9
|
// CDN işlemleri için kullanılan nesne
|
|
9
10
|
const cdn = {
|
|
10
11
|
// CDN URL'sini döndüren özellik
|
|
11
12
|
url: CDN_URL,
|
|
13
|
+
// Video CDN URL'sini döndüren özellik
|
|
14
|
+
videoUrl: VIDEO_CDN_URL,
|
|
12
15
|
// Thumbnail URL'si oluşturan fonksiyon
|
|
13
16
|
thumbImage: function (props) {
|
|
14
17
|
switch (CDN_PROVIDER) { // CDN sağlayıcısına göre işlemci fonksiyonunu seçiyor
|
|
@@ -21,8 +24,12 @@ const cdn = {
|
|
|
21
24
|
}
|
|
22
25
|
},
|
|
23
26
|
// CDN'deki dosyayı linkini getiren fonksiyon
|
|
24
|
-
getFile: function
|
|
27
|
+
getFile: function (path = '') {
|
|
25
28
|
return `${this.url}/${encodeURI((0, html_entities_1.decode)(path))}`;
|
|
29
|
+
},
|
|
30
|
+
// CDN'deki video url'ini getiren fonksiyon
|
|
31
|
+
getVideo: function (path = '') {
|
|
32
|
+
return `${this.videoUrl}/${encodeURI((0, html_entities_1.decode)(path))}`;
|
|
26
33
|
}
|
|
27
34
|
};
|
|
28
35
|
// Değerin geçerli olup olmadığını kontrol eden ve string olarak döndüren yardımcı fonksiyon
|