@sambath999/localize-token 12.3.4 → 12.3.5
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/bundles/sambath999-localize-token.umd.js +23 -8
- package/bundles/sambath999-localize-token.umd.js.map +1 -1
- package/esm2015/localize-token/localize.api.service.js +12 -5
- package/esm2015/localize-token/localize.token.service.js +9 -5
- package/fesm2015/sambath999-localize-token.js +19 -8
- package/fesm2015/sambath999-localize-token.js.map +1 -1
- package/localize-token/localize.api.service.d.ts +3 -1
- package/localize-token/localize.token.service.d.ts +4 -2
- package/package.json +1 -1
- package/sambath999-localize-token.metadata.json +1 -1
|
@@ -565,29 +565,33 @@
|
|
|
565
565
|
|
|
566
566
|
var LocalizeTokenService = /** @class */ (function () {
|
|
567
567
|
function LocalizeTokenService() {
|
|
568
|
+
this.configSubject = new rxjs.BehaviorSubject({});
|
|
568
569
|
this.isRevokingTokenSubject = new rxjs.BehaviorSubject(false);
|
|
569
570
|
this.defaultConfig = {
|
|
570
571
|
mainDomain: extractMainDomain(),
|
|
571
572
|
authTokenName: 'auth-token',
|
|
572
573
|
refreshTokenName: '_lze_rftkp_',
|
|
573
574
|
};
|
|
574
|
-
this._config = Object.assign({}, this.defaultConfig);
|
|
575
575
|
this.isInitialized = false;
|
|
576
576
|
this.decodeToken = function (token) { return jwt_decode__namespace.jwtDecode(token); };
|
|
577
577
|
}
|
|
578
578
|
Object.defineProperty(LocalizeTokenService.prototype, "config", {
|
|
579
579
|
get: function () {
|
|
580
580
|
this.throwIfNotInitialized();
|
|
581
|
-
return this.
|
|
581
|
+
return this.configSubject.value;
|
|
582
582
|
},
|
|
583
583
|
enumerable: false,
|
|
584
584
|
configurable: true
|
|
585
585
|
});
|
|
586
586
|
LocalizeTokenService.prototype.init = function (config) {
|
|
587
|
-
console.
|
|
588
|
-
this.
|
|
587
|
+
console.log('LocalizeTokenService is initialized.');
|
|
588
|
+
this.configSubject.next(Object.assign(Object.assign({}, this.defaultConfig), config));
|
|
589
589
|
this.isInitialized = true;
|
|
590
590
|
};
|
|
591
|
+
LocalizeTokenService.prototype.ngOnDestroy = function () {
|
|
592
|
+
// this.configSubject.complete();
|
|
593
|
+
// this.isRevokingTokenSubject.complete();
|
|
594
|
+
};
|
|
591
595
|
Object.defineProperty(LocalizeTokenService.prototype, "authToken", {
|
|
592
596
|
get: function () { return this.storageGet(); },
|
|
593
597
|
set: function (value) {
|
|
@@ -886,9 +890,10 @@
|
|
|
886
890
|
this.httpClient = httpClient;
|
|
887
891
|
this.localizeTokenService = localizeTokenService;
|
|
888
892
|
this.destroy$ = new rxjs.Subject();
|
|
893
|
+
this.configSubject = new rxjs.BehaviorSubject({});
|
|
889
894
|
this.isRequestingSubject = new rxjs.BehaviorSubject(false);
|
|
890
895
|
this.isResolvingStartupSubject = new rxjs.BehaviorSubject(false);
|
|
891
|
-
this.
|
|
896
|
+
this.defaultConfig = {
|
|
892
897
|
waitEachRequest: { milliseconds: 0 },
|
|
893
898
|
enableRequestCancellation: true,
|
|
894
899
|
retryOptions: {
|
|
@@ -950,14 +955,21 @@
|
|
|
950
955
|
enumerable: false,
|
|
951
956
|
configurable: true
|
|
952
957
|
});
|
|
958
|
+
Object.defineProperty(LocalizeApiService.prototype, "config", {
|
|
959
|
+
get: function () {
|
|
960
|
+
this.validateConfig(this.config);
|
|
961
|
+
return this.configSubject.value;
|
|
962
|
+
},
|
|
963
|
+
enumerable: false,
|
|
964
|
+
configurable: true
|
|
965
|
+
});
|
|
953
966
|
/**
|
|
954
967
|
* Initialize the API service.
|
|
955
968
|
* @param apiConfigs - The API configurations.
|
|
956
969
|
*/
|
|
957
970
|
LocalizeApiService.prototype.init = function (apiConfigs) {
|
|
958
|
-
console.
|
|
959
|
-
this.
|
|
960
|
-
this.validateConfig(this.config);
|
|
971
|
+
console.log('LocalizeApiService is initialized.');
|
|
972
|
+
this.configSubject.next(Object.assign(Object.assign({}, this.defaultConfig), apiConfigs));
|
|
961
973
|
};
|
|
962
974
|
LocalizeApiService.prototype.cancelPendingRequests = function () {
|
|
963
975
|
this.config.enableRequestCancellation
|
|
@@ -966,6 +978,9 @@
|
|
|
966
978
|
LocalizeApiService.prototype.ngOnDestroy = function () {
|
|
967
979
|
this.destroy$.next();
|
|
968
980
|
this.destroy$.complete();
|
|
981
|
+
// this.isResolvingStartupSubject.complete();
|
|
982
|
+
// this.isRequestingSubject.complete();
|
|
983
|
+
// this.configSubject.complete();
|
|
969
984
|
};
|
|
970
985
|
LocalizeApiService.prototype.request = function (baseUrl, path, method, reqBody, reqHeaders) {
|
|
971
986
|
if (method === void 0) { method = exports.EMethod.GET; }
|