nextemos 4.2.5 → 4.2.6

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.
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const html_entities_1 = require("html-entities");
4
- const nextemos_config_1 = require("../nextemos-config");
5
- const { CdnUrl, CdnProvider, VideoCdnUrl, ThumborSource } = (0, nextemos_config_1.getConfigs)();
6
- const CDN_URL = CdnUrl || '';
7
- const VIDEO_CDN_URL = VideoCdnUrl || CDN_URL;
8
- const CDN_PROVIDER = CdnProvider;
9
- const THUMBOR_SOURCE = ThumborSource;
4
+ const CDN_URL = process.env.CDN_URL || 'https://images.proj-e.com';
5
+ const VIDEO_CDN_URL = process.env.VIDEO_CDN_URL || CDN_URL;
6
+ const CDN_PROVIDER = process.env.CDN_PROVIDER || 'thumbor';
7
+ const THUMBOR_SOURCE = process.env.THUMBOR_SOURCE;
10
8
  // CDN işlemleri için kullanılan nesne
11
9
  const cdn = {
12
10
  // CDN URL'sini döndüren özellik
@@ -52,6 +52,12 @@ const fetchRequest = () => {
52
52
  }
53
53
  if (!response.ok) {
54
54
  const errorDetail = yield response.text();
55
+ console.log("Fetch Error: ", {
56
+ api: apiURL,
57
+ status: response.status,
58
+ errorMessage: errorDetail,
59
+ headers
60
+ });
55
61
  return {
56
62
  status: response.status,
57
63
  errorMessage: errorDetail,
@@ -60,6 +66,10 @@ const fetchRequest = () => {
60
66
  }
61
67
  // response data nesnesini JSON'a dönüştürme.
62
68
  const responseData = yield response.json().catch(() => ({}));
69
+ console.log("Fetch Success: ", {
70
+ api: apiURL,
71
+ status: response.status
72
+ });
63
73
  return {
64
74
  status: response.status,
65
75
  data: responseData,
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export * from './nextemos-config';
2
1
  export * from './helpers';
3
2
  export * from './interfaces';
4
3
  export * from './enums';
package/dist/index.js CHANGED
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./nextemos-config"), exports);
18
17
  __exportStar(require("./helpers"), exports);
19
18
  __exportStar(require("./interfaces"), exports);
20
19
  __exportStar(require("./enums"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextemos",
3
- "version": "4.2.5",
3
+ "version": "4.2.6",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,9 +0,0 @@
1
- export interface IConfigs {
2
- ApiUrl?: string;
3
- CdnUrl?: string;
4
- CdnProvider?: string | null | undefined;
5
- VideoCdnUrl?: string | null | undefined;
6
- ThumborSource?: string | null | undefined;
7
- }
8
- export declare const setConfigs: (configs: IConfigs) => void;
9
- export declare const getConfigs: () => IConfigs;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getConfigs = exports.setConfigs = void 0;
4
- ;
5
- let defaultConfigs = {
6
- ApiUrl: process.env.API_URL || '',
7
- CdnUrl: process.env.CDN_URL || 'https://images.proj-e.com',
8
- CdnProvider: process.env.CDN_PROVIDER || 'thumbor',
9
- VideoCdnUrl: process.env.VIDEO_CDN_URL,
10
- ThumborSource: process.env.THUMBOR_SOURCE
11
- };
12
- const setConfigs = (configs) => {
13
- defaultConfigs = Object.assign(Object.assign({}, defaultConfigs), configs);
14
- };
15
- exports.setConfigs = setConfigs;
16
- const getConfigs = () => defaultConfigs;
17
- exports.getConfigs = getConfigs;