tnx-shared 5.2.3 → 5.2.4
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/assets/gulpfile.js +4 -12
- package/bundles/tnx-shared.umd.js +29 -19
- package/bundles/tnx-shared.umd.js.map +1 -1
- package/bundles/tnx-shared.umd.min.js +1 -1
- package/bundles/tnx-shared.umd.min.js.map +1 -1
- package/classes/environment-schema.d.ts.map +1 -1
- package/esm2015/classes/environment-schema.js +24 -17
- package/esm2015/classes/public-function.js +2 -2
- package/esm2015/intercepters/send-access-token.interceptor.js +2 -2
- package/esm2015/services/environment.service.js +4 -1
- package/fesm2015/tnx-shared.js +29 -19
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +3 -3
- package/services/environment.service.d.ts +1 -0
- package/services/environment.service.d.ts.map +1 -1
- package/tnx-shared.metadata.json +1 -1
package/assets/gulpfile.js
CHANGED
|
@@ -329,18 +329,10 @@ function generateEnvironmentTsFile(environment) {
|
|
|
329
329
|
}
|
|
330
330
|
|
|
331
331
|
function transformEnvironmentTsAndJsonFile(envName, input) {
|
|
332
|
-
return input
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
function generateApplicationJsonFile() {
|
|
337
|
-
if (!fs.existsSync(`${pathSharedAssets}/environments/${angularSchemaObj.scopeName}/application.json`)) {
|
|
338
|
-
return src(`${pathSharedAssets}/environments/application-template.json`)
|
|
339
|
-
.pipe(rename(`application.json`))
|
|
340
|
-
.pipe(dest(`${pathSharedAssets}/environments/${angularSchemaObj.scopeName}`));
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
return true;
|
|
332
|
+
return input
|
|
333
|
+
.replaceAll('{{environmentName}}', envName)
|
|
334
|
+
.replaceAll('{{scopeName}}', angularSchemaObj.scopeName)
|
|
335
|
+
.replaceAll('{{configService}}', angularSchemaObj.configService);
|
|
344
336
|
}
|
|
345
337
|
|
|
346
338
|
function generateEnvironmentJsonFile(environment) {
|
|
@@ -933,6 +933,9 @@
|
|
|
933
933
|
EnvironmentService.prototype.getSignalr_ClientKey = function () {
|
|
934
934
|
return this.environment.signalr.clientKey;
|
|
935
935
|
};
|
|
936
|
+
EnvironmentService.prototype.getApiGateway = function () {
|
|
937
|
+
return this.environment.appMetadata.gateway;
|
|
938
|
+
};
|
|
936
939
|
EnvironmentService.prototype.getGatewaySubpath = function () {
|
|
937
940
|
return this.environment.appMetadata.gatewaySubpath;
|
|
938
941
|
};
|
|
@@ -3321,6 +3324,9 @@
|
|
|
3321
3324
|
};
|
|
3322
3325
|
var mergeJSON = function (target, source) {
|
|
3323
3326
|
var e_1, _a;
|
|
3327
|
+
if (Object.keys(source).length == 0) {
|
|
3328
|
+
return target;
|
|
3329
|
+
}
|
|
3324
3330
|
if (isArray(source)) {
|
|
3325
3331
|
if (!isArray(target)) {
|
|
3326
3332
|
target = [];
|
|
@@ -3431,26 +3437,30 @@
|
|
|
3431
3437
|
var commonMasterDataApi = window.commonMasterDataApi;
|
|
3432
3438
|
var appXhr = new XMLHttpRequest();
|
|
3433
3439
|
appXhr.open('GET', commonMasterDataApi + "v5/ConfigAndSetting/GetAppConfig", false);
|
|
3434
|
-
|
|
3440
|
+
// Gọi api của mình thì ko cần logic cache này, logic này do phía api quyết định xem có cache không và cache bao lâu
|
|
3441
|
+
// appXhr.setRequestHeader('Cache-Control', 'no-cache, no-store, max-age=0');
|
|
3435
3442
|
appXhr.send(null);
|
|
3436
3443
|
var resGetAppConfig = appXhr.responseText;
|
|
3437
3444
|
var op = JSON.parse(resGetAppConfig).data;
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3445
|
+
// Nếu là prod thì không cần đọc cấu hình từ json nữa
|
|
3446
|
+
if (personalName != 'prod') {
|
|
3447
|
+
var res = [];
|
|
3448
|
+
res.push(getEnvironmentByName(personalName, scopeName, customPath));
|
|
3449
|
+
while (res.length > 0) {
|
|
3450
|
+
var source = JSON.parse(res.shift());
|
|
3451
|
+
op = mergeJSON(op, source);
|
|
3452
|
+
}
|
|
3453
|
+
if (op) {
|
|
3454
|
+
if (op.apps) {
|
|
3455
|
+
Object.keys(op.apps).forEach(function (appCode) {
|
|
3456
|
+
op.apps[appCode].code = appCode.toLowerCase();
|
|
3457
|
+
});
|
|
3458
|
+
}
|
|
3459
|
+
if (op.services) {
|
|
3460
|
+
Object.keys(op.services).forEach(function (appCode) {
|
|
3461
|
+
op.services[appCode].code = appCode.toLowerCase();
|
|
3462
|
+
});
|
|
3463
|
+
}
|
|
3454
3464
|
}
|
|
3455
3465
|
}
|
|
3456
3466
|
return op;
|
|
@@ -25303,7 +25313,7 @@
|
|
|
25303
25313
|
this._environmentService = _environmentService;
|
|
25304
25314
|
}
|
|
25305
25315
|
SendAccessTokenInterceptor.prototype.intercept = function (request, next) {
|
|
25306
|
-
if (!this._environmentService.getDisableAuthentication) {
|
|
25316
|
+
if (!this._environmentService.getDisableAuthentication()) {
|
|
25307
25317
|
request = request.clone({
|
|
25308
25318
|
setHeaders: {
|
|
25309
25319
|
Authorization: "Bearer " + this.authenService.getAccessToken(),
|
|
@@ -25798,7 +25808,7 @@
|
|
|
25798
25808
|
ngxMask.NgxMaskModule.forRoot(),
|
|
25799
25809
|
i4.OAuthModule.forRoot({
|
|
25800
25810
|
resourceServer: {
|
|
25801
|
-
allowedUrls: [environment.
|
|
25811
|
+
allowedUrls: [environment.appMetadata.appGateway],
|
|
25802
25812
|
sendAccessToken: false,
|
|
25803
25813
|
},
|
|
25804
25814
|
}),
|