@sambath999/localize-token 12.4.8 → 12.4.11
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 +98 -374
- package/bundles/sambath999-localize-token.umd.js.map +1 -1
- package/esm2015/localize-api-token/localize-api-token.module.js +1 -1
- package/esm2015/localize-api-token/localize-api-token.service.js +1 -1
- package/esm2015/localize-logindlg/localize-logindlg.component.js +1 -1
- package/esm2015/localize-logindlg/localize-logindlg.module.js +1 -1
- package/esm2015/localize-logindlg/localize-logindlg.service.js +1 -1
- package/esm2015/localize-token/helpers/interfaces.js +1 -1
- package/esm2015/localize-token/helpers/localize.api.assets.js +1 -1
- package/esm2015/localize-token/helpers/loccalize.api.helper.js +2 -2
- package/esm2015/localize-token/localize.api.service.js +35 -9
- package/esm2015/localize-token/localize.token.js +3 -1
- package/esm2015/localize-token/localize.token.module.js +1 -1
- package/esm2015/localize-token/localize.token.service.js +6 -4
- package/esm2015/localize-token/localize.token.storage.js +1 -1
- package/esm2015/public-api.js +1 -1
- package/esm2015/sambath999-localize-token.js +1 -1
- package/fesm2015/sambath999-localize-token.js +38 -8
- package/fesm2015/sambath999-localize-token.js.map +1 -1
- package/localize-token/helpers/interfaces.d.ts +1 -0
- package/localize-token/localize.api.service.d.ts +7 -3
- package/localize-token/localize.token.d.ts +13 -0
- package/localize-token/localize.token.service.d.ts +4 -2
- package/package.json +1 -1
- package/sambath999-localize-token.metadata.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common/http'), require('@angular/core'), require('primeng/api'), require('primeng/dynamicdialog'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@sambath999/localize-token', ['exports', '@angular/common/http', '@angular/core', 'primeng/api', 'primeng/dynamicdialog', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.sambath999 = global.sambath999 || {}, global.sambath999["localize-token"] = {}), global.ng.common.http, global.ng.core, global.api, global.dynamicdialog, global.
|
|
5
|
-
})(this, (function (exports, i1, i0, api, dynamicdialog,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('@angular/common/http'), require('@angular/core'), require('primeng/api'), require('primeng/dynamicdialog'), require('jwt-decode'), require('rxjs'), require('@angular/platform-browser'), require('@angular/common'), require('primeng/toast'), require('primeng/inputtext'), require('primeng/button'), require('@angular/forms')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@sambath999/localize-token', ['exports', 'tslib', '@angular/common/http', '@angular/core', 'primeng/api', 'primeng/dynamicdialog', 'jwt-decode', 'rxjs', '@angular/platform-browser', '@angular/common', 'primeng/toast', 'primeng/inputtext', 'primeng/button', '@angular/forms'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.sambath999 = global.sambath999 || {}, global.sambath999["localize-token"] = {}), global.tslib, global.ng.common.http, global.ng.core, global.api, global.dynamicdialog, global.jwt_decode, global.rxjs, global.ng.platformBrowser, global.ng.common, global.toast, global.inputtext, global.button, global.ng.forms));
|
|
5
|
+
})(this, (function (exports, tslib, i1, i0, api, dynamicdialog, jwt_decode, rxjs, platformBrowser, common, toast, inputtext, button, forms) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -26,324 +26,6 @@
|
|
|
26
26
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
27
27
|
var jwt_decode__namespace = /*#__PURE__*/_interopNamespace(jwt_decode);
|
|
28
28
|
|
|
29
|
-
/*! *****************************************************************************
|
|
30
|
-
Copyright (c) Microsoft Corporation.
|
|
31
|
-
|
|
32
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
33
|
-
purpose with or without fee is hereby granted.
|
|
34
|
-
|
|
35
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
36
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
37
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
38
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
39
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
40
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
41
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
42
|
-
***************************************************************************** */
|
|
43
|
-
/* global Reflect, Promise */
|
|
44
|
-
var extendStatics = function (d, b) {
|
|
45
|
-
extendStatics = Object.setPrototypeOf ||
|
|
46
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
47
|
-
function (d, b) { for (var p in b)
|
|
48
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
49
|
-
d[p] = b[p]; };
|
|
50
|
-
return extendStatics(d, b);
|
|
51
|
-
};
|
|
52
|
-
function __extends(d, b) {
|
|
53
|
-
if (typeof b !== "function" && b !== null)
|
|
54
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
55
|
-
extendStatics(d, b);
|
|
56
|
-
function __() { this.constructor = d; }
|
|
57
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
58
|
-
}
|
|
59
|
-
var __assign = function () {
|
|
60
|
-
__assign = Object.assign || function __assign(t) {
|
|
61
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
62
|
-
s = arguments[i];
|
|
63
|
-
for (var p in s)
|
|
64
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
65
|
-
t[p] = s[p];
|
|
66
|
-
}
|
|
67
|
-
return t;
|
|
68
|
-
};
|
|
69
|
-
return __assign.apply(this, arguments);
|
|
70
|
-
};
|
|
71
|
-
function __rest(s, e) {
|
|
72
|
-
var t = {};
|
|
73
|
-
for (var p in s)
|
|
74
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
75
|
-
t[p] = s[p];
|
|
76
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
77
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
78
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
79
|
-
t[p[i]] = s[p[i]];
|
|
80
|
-
}
|
|
81
|
-
return t;
|
|
82
|
-
}
|
|
83
|
-
function __decorate(decorators, target, key, desc) {
|
|
84
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
85
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
86
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
87
|
-
else
|
|
88
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
89
|
-
if (d = decorators[i])
|
|
90
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
91
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
92
|
-
}
|
|
93
|
-
function __param(paramIndex, decorator) {
|
|
94
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
|
95
|
-
}
|
|
96
|
-
function __metadata(metadataKey, metadataValue) {
|
|
97
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
98
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
99
|
-
}
|
|
100
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
101
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
102
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
103
|
-
function fulfilled(value) { try {
|
|
104
|
-
step(generator.next(value));
|
|
105
|
-
}
|
|
106
|
-
catch (e) {
|
|
107
|
-
reject(e);
|
|
108
|
-
} }
|
|
109
|
-
function rejected(value) { try {
|
|
110
|
-
step(generator["throw"](value));
|
|
111
|
-
}
|
|
112
|
-
catch (e) {
|
|
113
|
-
reject(e);
|
|
114
|
-
} }
|
|
115
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
116
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
function __generator(thisArg, body) {
|
|
120
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
121
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
122
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
123
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
124
|
-
function step(op) {
|
|
125
|
-
if (f)
|
|
126
|
-
throw new TypeError("Generator is already executing.");
|
|
127
|
-
while (_)
|
|
128
|
-
try {
|
|
129
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
130
|
-
return t;
|
|
131
|
-
if (y = 0, t)
|
|
132
|
-
op = [op[0] & 2, t.value];
|
|
133
|
-
switch (op[0]) {
|
|
134
|
-
case 0:
|
|
135
|
-
case 1:
|
|
136
|
-
t = op;
|
|
137
|
-
break;
|
|
138
|
-
case 4:
|
|
139
|
-
_.label++;
|
|
140
|
-
return { value: op[1], done: false };
|
|
141
|
-
case 5:
|
|
142
|
-
_.label++;
|
|
143
|
-
y = op[1];
|
|
144
|
-
op = [0];
|
|
145
|
-
continue;
|
|
146
|
-
case 7:
|
|
147
|
-
op = _.ops.pop();
|
|
148
|
-
_.trys.pop();
|
|
149
|
-
continue;
|
|
150
|
-
default:
|
|
151
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
152
|
-
_ = 0;
|
|
153
|
-
continue;
|
|
154
|
-
}
|
|
155
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
156
|
-
_.label = op[1];
|
|
157
|
-
break;
|
|
158
|
-
}
|
|
159
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
160
|
-
_.label = t[1];
|
|
161
|
-
t = op;
|
|
162
|
-
break;
|
|
163
|
-
}
|
|
164
|
-
if (t && _.label < t[2]) {
|
|
165
|
-
_.label = t[2];
|
|
166
|
-
_.ops.push(op);
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
if (t[2])
|
|
170
|
-
_.ops.pop();
|
|
171
|
-
_.trys.pop();
|
|
172
|
-
continue;
|
|
173
|
-
}
|
|
174
|
-
op = body.call(thisArg, _);
|
|
175
|
-
}
|
|
176
|
-
catch (e) {
|
|
177
|
-
op = [6, e];
|
|
178
|
-
y = 0;
|
|
179
|
-
}
|
|
180
|
-
finally {
|
|
181
|
-
f = t = 0;
|
|
182
|
-
}
|
|
183
|
-
if (op[0] & 5)
|
|
184
|
-
throw op[1];
|
|
185
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
189
|
-
if (k2 === undefined)
|
|
190
|
-
k2 = k;
|
|
191
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
192
|
-
}) : (function (o, m, k, k2) {
|
|
193
|
-
if (k2 === undefined)
|
|
194
|
-
k2 = k;
|
|
195
|
-
o[k2] = m[k];
|
|
196
|
-
});
|
|
197
|
-
function __exportStar(m, o) {
|
|
198
|
-
for (var p in m)
|
|
199
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
200
|
-
__createBinding(o, m, p);
|
|
201
|
-
}
|
|
202
|
-
function __values(o) {
|
|
203
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
204
|
-
if (m)
|
|
205
|
-
return m.call(o);
|
|
206
|
-
if (o && typeof o.length === "number")
|
|
207
|
-
return {
|
|
208
|
-
next: function () {
|
|
209
|
-
if (o && i >= o.length)
|
|
210
|
-
o = void 0;
|
|
211
|
-
return { value: o && o[i++], done: !o };
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
215
|
-
}
|
|
216
|
-
function __read(o, n) {
|
|
217
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
218
|
-
if (!m)
|
|
219
|
-
return o;
|
|
220
|
-
var i = m.call(o), r, ar = [], e;
|
|
221
|
-
try {
|
|
222
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
223
|
-
ar.push(r.value);
|
|
224
|
-
}
|
|
225
|
-
catch (error) {
|
|
226
|
-
e = { error: error };
|
|
227
|
-
}
|
|
228
|
-
finally {
|
|
229
|
-
try {
|
|
230
|
-
if (r && !r.done && (m = i["return"]))
|
|
231
|
-
m.call(i);
|
|
232
|
-
}
|
|
233
|
-
finally {
|
|
234
|
-
if (e)
|
|
235
|
-
throw e.error;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
return ar;
|
|
239
|
-
}
|
|
240
|
-
/** @deprecated */
|
|
241
|
-
function __spread() {
|
|
242
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
243
|
-
ar = ar.concat(__read(arguments[i]));
|
|
244
|
-
return ar;
|
|
245
|
-
}
|
|
246
|
-
/** @deprecated */
|
|
247
|
-
function __spreadArrays() {
|
|
248
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
249
|
-
s += arguments[i].length;
|
|
250
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
251
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
252
|
-
r[k] = a[j];
|
|
253
|
-
return r;
|
|
254
|
-
}
|
|
255
|
-
function __spreadArray(to, from, pack) {
|
|
256
|
-
if (pack || arguments.length === 2)
|
|
257
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
258
|
-
if (ar || !(i in from)) {
|
|
259
|
-
if (!ar)
|
|
260
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
261
|
-
ar[i] = from[i];
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
return to.concat(ar || from);
|
|
265
|
-
}
|
|
266
|
-
function __await(v) {
|
|
267
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
268
|
-
}
|
|
269
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
270
|
-
if (!Symbol.asyncIterator)
|
|
271
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
272
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
273
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
274
|
-
function verb(n) { if (g[n])
|
|
275
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
276
|
-
function resume(n, v) { try {
|
|
277
|
-
step(g[n](v));
|
|
278
|
-
}
|
|
279
|
-
catch (e) {
|
|
280
|
-
settle(q[0][3], e);
|
|
281
|
-
} }
|
|
282
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
283
|
-
function fulfill(value) { resume("next", value); }
|
|
284
|
-
function reject(value) { resume("throw", value); }
|
|
285
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
286
|
-
resume(q[0][0], q[0][1]); }
|
|
287
|
-
}
|
|
288
|
-
function __asyncDelegator(o) {
|
|
289
|
-
var i, p;
|
|
290
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
291
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
292
|
-
}
|
|
293
|
-
function __asyncValues(o) {
|
|
294
|
-
if (!Symbol.asyncIterator)
|
|
295
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
296
|
-
var m = o[Symbol.asyncIterator], i;
|
|
297
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
298
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
299
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
300
|
-
}
|
|
301
|
-
function __makeTemplateObject(cooked, raw) {
|
|
302
|
-
if (Object.defineProperty) {
|
|
303
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
304
|
-
}
|
|
305
|
-
else {
|
|
306
|
-
cooked.raw = raw;
|
|
307
|
-
}
|
|
308
|
-
return cooked;
|
|
309
|
-
}
|
|
310
|
-
;
|
|
311
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
312
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
313
|
-
}) : function (o, v) {
|
|
314
|
-
o["default"] = v;
|
|
315
|
-
};
|
|
316
|
-
function __importStar(mod) {
|
|
317
|
-
if (mod && mod.__esModule)
|
|
318
|
-
return mod;
|
|
319
|
-
var result = {};
|
|
320
|
-
if (mod != null)
|
|
321
|
-
for (var k in mod)
|
|
322
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
323
|
-
__createBinding(result, mod, k);
|
|
324
|
-
__setModuleDefault(result, mod);
|
|
325
|
-
return result;
|
|
326
|
-
}
|
|
327
|
-
function __importDefault(mod) {
|
|
328
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
329
|
-
}
|
|
330
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
331
|
-
if (kind === "a" && !f)
|
|
332
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
333
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
334
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
335
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
336
|
-
}
|
|
337
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
338
|
-
if (kind === "m")
|
|
339
|
-
throw new TypeError("Private method is not writable");
|
|
340
|
-
if (kind === "a" && !f)
|
|
341
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
342
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
343
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
344
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
29
|
/**
|
|
348
30
|
* Assembly of @package ng2-cookies @see https://www.npmjs.com/package/ng2-cookies
|
|
349
31
|
*
|
|
@@ -413,7 +95,7 @@
|
|
|
413
95
|
if (document.cookie) {
|
|
414
96
|
var split = document.cookie.split(';');
|
|
415
97
|
try {
|
|
416
|
-
for (var split_1 = __values(split), split_1_1 = split_1.next(); !split_1_1.done; split_1_1 = split_1.next()) {
|
|
98
|
+
for (var split_1 = tslib.__values(split), split_1_1 = split_1.next(); !split_1_1.done; split_1_1 = split_1.next()) {
|
|
417
99
|
var s = split_1_1.value;
|
|
418
100
|
var currCookie = s.split('=');
|
|
419
101
|
currCookie[0] = currCookie[0].trim();
|
|
@@ -463,7 +145,7 @@
|
|
|
463
145
|
var e_2, _a;
|
|
464
146
|
var cookies = this.getAll();
|
|
465
147
|
try {
|
|
466
|
-
for (var _b = __values(Object.keys(cookies)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
148
|
+
for (var _b = tslib.__values(Object.keys(cookies)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
467
149
|
var cookieName = _c.value;
|
|
468
150
|
this.delete(cookieName, path, domain);
|
|
469
151
|
}
|
|
@@ -490,6 +172,8 @@
|
|
|
490
172
|
X_TENANT: 'X-Tenant',
|
|
491
173
|
X_REFRESH_TOKEN: 'X-RefreshToken',
|
|
492
174
|
CONTENT_TYPE: 'Content-Type',
|
|
175
|
+
X_CLIENT: 'X-Client',
|
|
176
|
+
X_SECRET: 'X-Secret'
|
|
493
177
|
};
|
|
494
178
|
/**
|
|
495
179
|
* Waits for a specified amount of time.
|
|
@@ -499,8 +183,8 @@
|
|
|
499
183
|
*/
|
|
500
184
|
function waitFor(milliseconds, when) {
|
|
501
185
|
if (when === void 0) { when = true; }
|
|
502
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
503
|
-
return __generator(this, function (_a) {
|
|
186
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
187
|
+
return tslib.__generator(this, function (_a) {
|
|
504
188
|
switch (_a.label) {
|
|
505
189
|
case 0:
|
|
506
190
|
if (!when)
|
|
@@ -520,11 +204,11 @@
|
|
|
520
204
|
*/
|
|
521
205
|
function waitUntil(when, intervalNumber) {
|
|
522
206
|
if (intervalNumber === void 0) { intervalNumber = 50; }
|
|
523
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
207
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
524
208
|
function isConditionMet() {
|
|
525
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
209
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
526
210
|
var cond, result, _a;
|
|
527
|
-
return __generator(this, function (_b) {
|
|
211
|
+
return tslib.__generator(this, function (_b) {
|
|
528
212
|
switch (_b.label) {
|
|
529
213
|
case 0:
|
|
530
214
|
cond = when();
|
|
@@ -544,15 +228,15 @@
|
|
|
544
228
|
});
|
|
545
229
|
}
|
|
546
230
|
var _this = this;
|
|
547
|
-
return __generator(this, function (_a) {
|
|
231
|
+
return tslib.__generator(this, function (_a) {
|
|
548
232
|
switch (_a.label) {
|
|
549
233
|
case 0: return [4 /*yield*/, isConditionMet()];
|
|
550
234
|
case 1:
|
|
551
235
|
if (_a.sent())
|
|
552
236
|
return [2 /*return*/];
|
|
553
237
|
return [4 /*yield*/, new Promise(function (resolve) {
|
|
554
|
-
var interval = setInterval(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
555
|
-
return __generator(this, function (_a) {
|
|
238
|
+
var interval = setInterval(function () { return tslib.__awaiter(_this, void 0, void 0, function () {
|
|
239
|
+
return tslib.__generator(this, function (_a) {
|
|
556
240
|
switch (_a.label) {
|
|
557
241
|
case 0: return [4 /*yield*/, isConditionMet()];
|
|
558
242
|
case 1:
|
|
@@ -590,7 +274,7 @@
|
|
|
590
274
|
refreshToken: {
|
|
591
275
|
name: 'refresh-token',
|
|
592
276
|
requestUrl: '/api/token/revoke'
|
|
593
|
-
}
|
|
277
|
+
}
|
|
594
278
|
};
|
|
595
279
|
this.isInitialized = false;
|
|
596
280
|
this.decodeToken = function (token) { return jwt_decode__namespace.jwtDecode(token); };
|
|
@@ -650,6 +334,16 @@
|
|
|
650
334
|
enumerable: false,
|
|
651
335
|
configurable: true
|
|
652
336
|
});
|
|
337
|
+
Object.defineProperty(LocalizeTokenService.prototype, "clientId", {
|
|
338
|
+
get: function () { var _a; return LocalizeToken.storage.get(((_a = this.config.thirdPartyConfig) === null || _a === void 0 ? void 0 : _a.clientId) || ''); },
|
|
339
|
+
enumerable: false,
|
|
340
|
+
configurable: true
|
|
341
|
+
});
|
|
342
|
+
Object.defineProperty(LocalizeTokenService.prototype, "clientSecret", {
|
|
343
|
+
get: function () { var _a; return LocalizeToken.storage.get(((_a = this.config.thirdPartyConfig) === null || _a === void 0 ? void 0 : _a.clientSecret) || ''); },
|
|
344
|
+
enumerable: false,
|
|
345
|
+
configurable: true
|
|
346
|
+
});
|
|
653
347
|
LocalizeTokenService.prototype.storageGet = function () {
|
|
654
348
|
var _a;
|
|
655
349
|
try {
|
|
@@ -732,10 +426,10 @@
|
|
|
732
426
|
};
|
|
733
427
|
LocalizeLogindlgComponent.prototype.clickLogin = function () {
|
|
734
428
|
var _a, _b, _c;
|
|
735
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
429
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
736
430
|
var loginRes, cookieOptions;
|
|
737
431
|
var _this = this;
|
|
738
|
-
return __generator(this, function (_d) {
|
|
432
|
+
return tslib.__generator(this, function (_d) {
|
|
739
433
|
switch (_d.label) {
|
|
740
434
|
case 0:
|
|
741
435
|
if (!this.isValidPassword) {
|
|
@@ -764,10 +458,10 @@
|
|
|
764
458
|
};
|
|
765
459
|
LocalizeLogindlgComponent.prototype.login = function () {
|
|
766
460
|
var _a, _b, _c;
|
|
767
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
461
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
768
462
|
var e_1;
|
|
769
463
|
var _this = this;
|
|
770
|
-
return __generator(this, function (_d) {
|
|
464
|
+
return tslib.__generator(this, function (_d) {
|
|
771
465
|
switch (_d.label) {
|
|
772
466
|
case 0:
|
|
773
467
|
if (!((_a = this.loginUrl) === null || _a === void 0 ? void 0 : _a.trim().length)) {
|
|
@@ -848,9 +542,9 @@
|
|
|
848
542
|
this.injector = injector;
|
|
849
543
|
}
|
|
850
544
|
LocalizeLogindlgService.prototype.openLoginDialog = function (loginConfig, config) {
|
|
851
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
545
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
852
546
|
var dialogService, dialog;
|
|
853
|
-
return __generator(this, function (_b) {
|
|
547
|
+
return tslib.__generator(this, function (_b) {
|
|
854
548
|
switch (_b.label) {
|
|
855
549
|
case 0:
|
|
856
550
|
config = this.intercepDialogConfig(config);
|
|
@@ -970,9 +664,9 @@
|
|
|
970
664
|
};
|
|
971
665
|
}
|
|
972
666
|
LocalizeApiHelper.prototype.performRetry = function (options) {
|
|
973
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
667
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
974
668
|
var attempts, lastError, consoleCount, styleElement, result, error_1;
|
|
975
|
-
return __generator(this, function (_f) {
|
|
669
|
+
return tslib.__generator(this, function (_f) {
|
|
976
670
|
switch (_f.label) {
|
|
977
671
|
case 0:
|
|
978
672
|
attempts = 0;
|
|
@@ -1020,7 +714,7 @@
|
|
|
1020
714
|
return [3 /*break*/, 9];
|
|
1021
715
|
case 9: return [3 /*break*/, 1];
|
|
1022
716
|
case 10:
|
|
1023
|
-
console.warn("Failed after " + options.maxRetries + " attempts");
|
|
717
|
+
console.warn("Failed after " + options.maxRetries() + " attempts");
|
|
1024
718
|
throw lastError;
|
|
1025
719
|
}
|
|
1026
720
|
});
|
|
@@ -1028,9 +722,9 @@
|
|
|
1028
722
|
};
|
|
1029
723
|
LocalizeApiHelper.prototype.performRequestWithRetry = function (options, config, performRequest) {
|
|
1030
724
|
var _a, _b, _c, _d;
|
|
1031
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
725
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1032
726
|
var retryUnless;
|
|
1033
|
-
return __generator(this, function (_f) {
|
|
727
|
+
return tslib.__generator(this, function (_f) {
|
|
1034
728
|
switch (_f.label) {
|
|
1035
729
|
case 0:
|
|
1036
730
|
retryUnless = ((_a = config.retryOptions) === null || _a === void 0 ? void 0 : _a.retryFunction)
|
|
@@ -1054,9 +748,9 @@
|
|
|
1054
748
|
: normalizedUrl;
|
|
1055
749
|
};
|
|
1056
750
|
LocalizeApiHelper.prototype.invokeHook = function (callback) {
|
|
1057
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
751
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1058
752
|
var result;
|
|
1059
|
-
return __generator(this, function (_f) {
|
|
753
|
+
return tslib.__generator(this, function (_f) {
|
|
1060
754
|
switch (_f.label) {
|
|
1061
755
|
case 0:
|
|
1062
756
|
if (!callback)
|
|
@@ -1092,9 +786,9 @@
|
|
|
1092
786
|
};
|
|
1093
787
|
LocalizeApiHelper.prototype.onConnectionError = function (options, error) {
|
|
1094
788
|
var _a;
|
|
1095
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
789
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1096
790
|
var styleElement;
|
|
1097
|
-
return __generator(this, function (_f) {
|
|
791
|
+
return tslib.__generator(this, function (_f) {
|
|
1098
792
|
switch (_f.label) {
|
|
1099
793
|
case 0:
|
|
1100
794
|
if (!options.connectionError)
|
|
@@ -1243,6 +937,11 @@
|
|
|
1243
937
|
enumerable: false,
|
|
1244
938
|
configurable: true
|
|
1245
939
|
});
|
|
940
|
+
Object.defineProperty(LocalizeApiService.prototype, "thirdPartyConfig", {
|
|
941
|
+
get: function () { var _a; return (_a = this.localizeTokenService.config) === null || _a === void 0 ? void 0 : _a.thirdPartyConfig; },
|
|
942
|
+
enumerable: false,
|
|
943
|
+
configurable: true
|
|
944
|
+
});
|
|
1246
945
|
Object.defineProperty(LocalizeApiService.prototype, "config", {
|
|
1247
946
|
get: function () {
|
|
1248
947
|
this.validateConfig();
|
|
@@ -1270,10 +969,10 @@
|
|
|
1270
969
|
LocalizeApiService.prototype.request = function (baseUrl, path, method, reqBody, reqHeaders) {
|
|
1271
970
|
if (method === void 0) { method = exports.EMethod.GET; }
|
|
1272
971
|
if (reqBody === void 0) { reqBody = null; }
|
|
1273
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
972
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1274
973
|
var apiOptions, error_1;
|
|
1275
974
|
var _this = this;
|
|
1276
|
-
return __generator(this, function (_e) {
|
|
975
|
+
return tslib.__generator(this, function (_e) {
|
|
1277
976
|
switch (_e.label) {
|
|
1278
977
|
case 0: return [4 /*yield*/, waitUntil(function () { return !_this.isResolvingStartup; }, 500)];
|
|
1279
978
|
case 1:
|
|
@@ -1300,9 +999,9 @@
|
|
|
1300
999
|
});
|
|
1301
1000
|
};
|
|
1302
1001
|
LocalizeApiService.prototype.handleOnRequestError = function (error, options) {
|
|
1303
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1002
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1304
1003
|
var _this = this;
|
|
1305
|
-
return __generator(this, function (_e) {
|
|
1004
|
+
return tslib.__generator(this, function (_e) {
|
|
1306
1005
|
switch (_e.label) {
|
|
1307
1006
|
case 0:
|
|
1308
1007
|
if (error.status !== 401)
|
|
@@ -1314,12 +1013,14 @@
|
|
|
1314
1013
|
maxRetries: function () { return 1000; },
|
|
1315
1014
|
delay: 10,
|
|
1316
1015
|
retryUnless: function (error) { return error.status === 401 || ApiHelper.isConnectionError(error); },
|
|
1317
|
-
callback: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1318
|
-
return __generator(this, function (_e) {
|
|
1016
|
+
callback: function () { return tslib.__awaiter(_this, void 0, void 0, function () {
|
|
1017
|
+
return tslib.__generator(this, function (_e) {
|
|
1319
1018
|
switch (_e.label) {
|
|
1320
|
-
case 0:
|
|
1321
|
-
|
|
1322
|
-
|
|
1019
|
+
case 0:
|
|
1020
|
+
// Handle third party API unauthorized error when request
|
|
1021
|
+
this.handleThirdPartyAuthError(error, options.requestUrl);
|
|
1022
|
+
// Only handle 401 Unauthorized errors
|
|
1023
|
+
return [4 /*yield*/, this.revokeToken()];
|
|
1323
1024
|
case 1:
|
|
1324
1025
|
// Only handle 401 Unauthorized errors
|
|
1325
1026
|
_e.sent();
|
|
@@ -1336,12 +1037,27 @@
|
|
|
1336
1037
|
});
|
|
1337
1038
|
});
|
|
1338
1039
|
};
|
|
1040
|
+
LocalizeApiService.prototype.handleThirdPartyAuthError = function (error, requestUrl) {
|
|
1041
|
+
var _a, _b, _c;
|
|
1042
|
+
if (!((_a = this.thirdPartyConfig) === null || _a === void 0 ? void 0 : _a.isThirdPartyMode))
|
|
1043
|
+
return;
|
|
1044
|
+
if (error.status === 401) {
|
|
1045
|
+
if (this.thirdPartyConfig.lastUnauthorizedUrl === requestUrl) {
|
|
1046
|
+
this.thirdPartyConfig.lastUnauthorizedUrl = "";
|
|
1047
|
+
throw (_c = (_b = this.config).onException) === null || _c === void 0 ? void 0 : _c.call(_b, Object.assign(Object.assign({}, error), { status: 405, message: "Unauthorized request url " + requestUrl + ". Please contact administrator." }));
|
|
1048
|
+
}
|
|
1049
|
+
this.thirdPartyConfig.lastUnauthorizedUrl = requestUrl;
|
|
1050
|
+
}
|
|
1051
|
+
else {
|
|
1052
|
+
this.thirdPartyConfig.lastUnauthorizedUrl = "";
|
|
1053
|
+
}
|
|
1054
|
+
};
|
|
1339
1055
|
LocalizeApiService.prototype.performRequest = function (options) {
|
|
1340
1056
|
var _a;
|
|
1341
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1057
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1342
1058
|
var buildOptions, request$, response;
|
|
1343
1059
|
var _this = this;
|
|
1344
|
-
return __generator(this, function (_e) {
|
|
1060
|
+
return tslib.__generator(this, function (_e) {
|
|
1345
1061
|
switch (_e.label) {
|
|
1346
1062
|
case 0:
|
|
1347
1063
|
buildOptions = { headers: this.buildHeaderOptions(options) };
|
|
@@ -1362,10 +1078,10 @@
|
|
|
1362
1078
|
});
|
|
1363
1079
|
};
|
|
1364
1080
|
LocalizeApiService.prototype.revokeToken = function () {
|
|
1365
|
-
var _a;
|
|
1366
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1367
|
-
var apiOptions, revokeToken, error_2;
|
|
1368
|
-
return __generator(this, function (_e) {
|
|
1081
|
+
var _a, _b;
|
|
1082
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1083
|
+
var defaultApiOptions, thirdParyApiOptions, apiOptions, revokeToken, error_2;
|
|
1084
|
+
return tslib.__generator(this, function (_e) {
|
|
1369
1085
|
switch (_e.label) {
|
|
1370
1086
|
case 0:
|
|
1371
1087
|
_e.trys.push([0, 4, 6, 7]);
|
|
@@ -1374,7 +1090,9 @@
|
|
|
1374
1090
|
if (_e.sent())
|
|
1375
1091
|
return [2 /*return*/];
|
|
1376
1092
|
this.isRevokingToken = true;
|
|
1377
|
-
|
|
1093
|
+
defaultApiOptions = Object.assign(Object.assign({}, this.buildApiOptions(((_a = this.localizeTokenService.config.refreshToken) === null || _a === void 0 ? void 0 : _a.requestUrl) || '')), { refreshToken: true });
|
|
1094
|
+
thirdParyApiOptions = this.buildThirdPartyApiOption(defaultApiOptions);
|
|
1095
|
+
apiOptions = ((_b = this.thirdPartyConfig) === null || _b === void 0 ? void 0 : _b.isThirdPartyMode) ? thirdParyApiOptions : defaultApiOptions;
|
|
1378
1096
|
return [4 /*yield*/, ApiHelper.performRequestWithRetry(apiOptions, this.config, this.performRequest.bind(this))];
|
|
1379
1097
|
case 2:
|
|
1380
1098
|
revokeToken = _e.sent();
|
|
@@ -1399,10 +1117,16 @@
|
|
|
1399
1117
|
});
|
|
1400
1118
|
});
|
|
1401
1119
|
};
|
|
1120
|
+
LocalizeApiService.prototype.buildThirdPartyApiOption = function (apiOptions) {
|
|
1121
|
+
var _e;
|
|
1122
|
+
var _a, _b, _c;
|
|
1123
|
+
return Object.assign(Object.assign({}, apiOptions), { requestUrl: ((_a = this.thirdPartyConfig) === null || _a === void 0 ? void 0 : _a.refreshToken.requestUrl) || '', method: ((_b = this.thirdPartyConfig) === null || _b === void 0 ? void 0 : _b.refreshToken.method) || exports.EMethod.GET, requestBody: ((_c = this.thirdPartyConfig) === null || _c === void 0 ? void 0 : _c.refreshToken.body) || {}, headers: Object.assign(Object.assign({}, apiOptions.headers), (_e = {}, _e[SCHEMES.X_SECRET] = "" + this.localizeTokenService.clientSecret, _e)) });
|
|
1124
|
+
};
|
|
1402
1125
|
/** default http request options */
|
|
1403
1126
|
LocalizeApiService.prototype.buildHeaderOptions = function (options) {
|
|
1404
|
-
var _e, _f, _g, _h;
|
|
1405
|
-
var
|
|
1127
|
+
var _e, _f, _g, _h, _j;
|
|
1128
|
+
var _a;
|
|
1129
|
+
var headers = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (options.refreshToken && (_e = {}, _e[SCHEMES.X_REFRESH_TOKEN] = "" + this.refreshToken, _e))), (!options.isFormData && (_f = {}, _f[SCHEMES.CONTENT_TYPE] = 'application/json', _f))), (_g = {}, _g[SCHEMES.AUTHORIZATION] = "Bearer " + this.accessToken, _g)), (this.needTenant && (_h = {}, _h[SCHEMES.X_TENANT] = "" + this.tenantToken, _h))), (((_a = this.thirdPartyConfig) === null || _a === void 0 ? void 0 : _a.isThirdPartyMode) && (_j = {}, _j[SCHEMES.X_CLIENT] = "" + this.localizeTokenService.clientId, _j)));
|
|
1406
1130
|
return new i1.HttpHeaders(Object.assign(Object.assign({}, headers), options.headers));
|
|
1407
1131
|
};
|
|
1408
1132
|
LocalizeApiService.prototype.buildApiOptions = function (baseUrl, path, method, requestBody, headers) {
|
|
@@ -1415,10 +1139,10 @@
|
|
|
1415
1139
|
};
|
|
1416
1140
|
LocalizeApiService.prototype.toWaitForPreviousRequest = function () {
|
|
1417
1141
|
var _a;
|
|
1418
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1142
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1419
1143
|
var waitMilliseconds;
|
|
1420
1144
|
var _this = this;
|
|
1421
|
-
return __generator(this, function (_e) {
|
|
1145
|
+
return tslib.__generator(this, function (_e) {
|
|
1422
1146
|
switch (_e.label) {
|
|
1423
1147
|
case 0:
|
|
1424
1148
|
if (!this.isRevokingToken) return [3 /*break*/, 2];
|
|
@@ -1441,13 +1165,13 @@
|
|
|
1441
1165
|
});
|
|
1442
1166
|
};
|
|
1443
1167
|
LocalizeApiService.prototype.handleOnTokenRevoked = function (response) {
|
|
1444
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1445
|
-
return __generator(this, function (_e) {
|
|
1168
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1169
|
+
return tslib.__generator(this, function (_e) {
|
|
1446
1170
|
switch (_e.label) {
|
|
1447
1171
|
case 0:
|
|
1448
|
-
if (!(response === null || response === void 0 ? void 0 : response.status)) return [3 /*break*/, 1];
|
|
1172
|
+
if (!((response === null || response === void 0 ? void 0 : response.status) || (response === null || response === void 0 ? void 0 : response.token))) return [3 /*break*/, 1];
|
|
1449
1173
|
// If the response is successful, update the access token
|
|
1450
|
-
this.accessToken = response.message;
|
|
1174
|
+
this.accessToken = response.message || response.token; // response.token for third party revoke
|
|
1451
1175
|
return [3 /*break*/, 3];
|
|
1452
1176
|
case 1:
|
|
1453
1177
|
// If the response indicates an error, invoke the onRevokeUnauthorized hook
|
|
@@ -1462,9 +1186,9 @@
|
|
|
1462
1186
|
});
|
|
1463
1187
|
};
|
|
1464
1188
|
LocalizeApiService.prototype.interceptRevokeToken = function () {
|
|
1465
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1189
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1466
1190
|
var _this = this;
|
|
1467
|
-
return __generator(this, function (_e) {
|
|
1191
|
+
return tslib.__generator(this, function (_e) {
|
|
1468
1192
|
switch (_e.label) {
|
|
1469
1193
|
case 0:
|
|
1470
1194
|
if (!this.isRevokingToken) return [3 /*break*/, 2];
|