nextemos 5.0.5 → 5.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/getConfigs.js +32 -2
- package/dist/helpers/index.d.ts +0 -1
- package/dist/helpers/index.js +1 -3
- package/dist/services/urls.js +5 -2
- package/package.json +1 -1
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -25
|
@@ -5,6 +5,36 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const fs_1 = __importDefault(require("fs"));
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Ana projenin kök dizinini bul
|
|
10
|
+
*/
|
|
11
|
+
const findProjectRoot = () => {
|
|
12
|
+
if (require.main) {
|
|
13
|
+
return path_1.default.dirname(require.main.filename);
|
|
14
|
+
}
|
|
15
|
+
return process.cwd();
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Ana projedeki nextemos-config.json dosyasını oku
|
|
19
|
+
*/
|
|
20
|
+
const loadConfig = () => {
|
|
21
|
+
const projectRoot = findProjectRoot();
|
|
22
|
+
const configPath = path_1.default.join(projectRoot, "nextemos-config.json");
|
|
23
|
+
try {
|
|
24
|
+
if (fs_1.default.existsSync(configPath)) {
|
|
25
|
+
const configData = fs_1.default.readFileSync(configPath, "utf-8");
|
|
26
|
+
return JSON.parse(configData);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
console.warn(`Config file not found at: ${configPath}`);
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
console.error("Failed to read config file:", error);
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
// Config verisini al ve kullan
|
|
39
|
+
const NEXTEMOS_CONFIG = loadConfig();
|
|
10
40
|
exports.default = NEXTEMOS_CONFIG;
|
package/dist/helpers/index.d.ts
CHANGED
package/dist/helpers/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.decodeHTML = exports.cdn = exports.toQueryString = exports.toIntArray = exports.fetchRequest = void 0;
|
|
7
7
|
/// helpers
|
|
8
8
|
var fetchRequest_1 = require("./fetchRequest");
|
|
9
9
|
Object.defineProperty(exports, "fetchRequest", { enumerable: true, get: function () { return __importDefault(fetchRequest_1).default; } });
|
|
@@ -15,5 +15,3 @@ var cdn_1 = require("./cdn");
|
|
|
15
15
|
Object.defineProperty(exports, "cdn", { enumerable: true, get: function () { return __importDefault(cdn_1).default; } });
|
|
16
16
|
var decodeHTML_1 = require("./decodeHTML");
|
|
17
17
|
Object.defineProperty(exports, "decodeHTML", { enumerable: true, get: function () { return __importDefault(decodeHTML_1).default; } });
|
|
18
|
-
var getConfigs_1 = require("./getConfigs");
|
|
19
|
-
Object.defineProperty(exports, "getConfigs", { enumerable: true, get: function () { return __importDefault(getConfigs_1).default; } });
|
package/dist/services/urls.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.getUrl = void 0;
|
|
4
|
-
const
|
|
5
|
-
const { API_URL, USE_API_URL } =
|
|
7
|
+
const getConfigs_1 = __importDefault(require("../helpers/getConfigs"));
|
|
8
|
+
const { API_URL, USE_API_URL } = getConfigs_1.default;
|
|
6
9
|
exports.default = {
|
|
7
10
|
Banner: {
|
|
8
11
|
GetBannerById: "/{language}/Banner/v1/GetBannerById",
|
package/package.json
CHANGED
package/dist/config.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/config.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const promises_1 = require("fs/promises");
|
|
13
|
-
const getConfig = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
-
const packagePath = process.cwd();
|
|
15
|
-
const configPath = `${packagePath}/nextemos-config.json`;
|
|
16
|
-
try {
|
|
17
|
-
const data = yield (0, promises_1.readFile)(configPath, "utf-8");
|
|
18
|
-
return JSON.parse(data);
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
console.error("Failed to read config file:", error);
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
getConfig().then((config) => console.log(config));
|