@sambath999/localize-token 12.4.8 → 12.4.9
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 +99 -380
- 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 +25 -3
- 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 +4 -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 +29 -5
- package/fesm2015/sambath999-localize-token.js.map +1 -1
- package/localize-token/localize.api.service.d.ts +4 -0
- package/localize-token/localize.token.d.ts +14 -0
- package/localize-token/localize.token.service.d.ts +2 -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); };
|
|
@@ -732,10 +416,10 @@
|
|
|
732
416
|
};
|
|
733
417
|
LocalizeLogindlgComponent.prototype.clickLogin = function () {
|
|
734
418
|
var _a, _b, _c;
|
|
735
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
419
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
736
420
|
var loginRes, cookieOptions;
|
|
737
421
|
var _this = this;
|
|
738
|
-
return __generator(this, function (_d) {
|
|
422
|
+
return tslib.__generator(this, function (_d) {
|
|
739
423
|
switch (_d.label) {
|
|
740
424
|
case 0:
|
|
741
425
|
if (!this.isValidPassword) {
|
|
@@ -764,10 +448,10 @@
|
|
|
764
448
|
};
|
|
765
449
|
LocalizeLogindlgComponent.prototype.login = function () {
|
|
766
450
|
var _a, _b, _c;
|
|
767
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
451
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
768
452
|
var e_1;
|
|
769
453
|
var _this = this;
|
|
770
|
-
return __generator(this, function (_d) {
|
|
454
|
+
return tslib.__generator(this, function (_d) {
|
|
771
455
|
switch (_d.label) {
|
|
772
456
|
case 0:
|
|
773
457
|
if (!((_a = this.loginUrl) === null || _a === void 0 ? void 0 : _a.trim().length)) {
|
|
@@ -848,9 +532,9 @@
|
|
|
848
532
|
this.injector = injector;
|
|
849
533
|
}
|
|
850
534
|
LocalizeLogindlgService.prototype.openLoginDialog = function (loginConfig, config) {
|
|
851
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
535
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
852
536
|
var dialogService, dialog;
|
|
853
|
-
return __generator(this, function (_b) {
|
|
537
|
+
return tslib.__generator(this, function (_b) {
|
|
854
538
|
switch (_b.label) {
|
|
855
539
|
case 0:
|
|
856
540
|
config = this.intercepDialogConfig(config);
|
|
@@ -970,9 +654,9 @@
|
|
|
970
654
|
};
|
|
971
655
|
}
|
|
972
656
|
LocalizeApiHelper.prototype.performRetry = function (options) {
|
|
973
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
657
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
974
658
|
var attempts, lastError, consoleCount, styleElement, result, error_1;
|
|
975
|
-
return __generator(this, function (_f) {
|
|
659
|
+
return tslib.__generator(this, function (_f) {
|
|
976
660
|
switch (_f.label) {
|
|
977
661
|
case 0:
|
|
978
662
|
attempts = 0;
|
|
@@ -1020,7 +704,7 @@
|
|
|
1020
704
|
return [3 /*break*/, 9];
|
|
1021
705
|
case 9: return [3 /*break*/, 1];
|
|
1022
706
|
case 10:
|
|
1023
|
-
console.warn("Failed after " + options.maxRetries + " attempts");
|
|
707
|
+
console.warn("Failed after " + options.maxRetries() + " attempts");
|
|
1024
708
|
throw lastError;
|
|
1025
709
|
}
|
|
1026
710
|
});
|
|
@@ -1028,9 +712,9 @@
|
|
|
1028
712
|
};
|
|
1029
713
|
LocalizeApiHelper.prototype.performRequestWithRetry = function (options, config, performRequest) {
|
|
1030
714
|
var _a, _b, _c, _d;
|
|
1031
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
715
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1032
716
|
var retryUnless;
|
|
1033
|
-
return __generator(this, function (_f) {
|
|
717
|
+
return tslib.__generator(this, function (_f) {
|
|
1034
718
|
switch (_f.label) {
|
|
1035
719
|
case 0:
|
|
1036
720
|
retryUnless = ((_a = config.retryOptions) === null || _a === void 0 ? void 0 : _a.retryFunction)
|
|
@@ -1054,9 +738,9 @@
|
|
|
1054
738
|
: normalizedUrl;
|
|
1055
739
|
};
|
|
1056
740
|
LocalizeApiHelper.prototype.invokeHook = function (callback) {
|
|
1057
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
741
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1058
742
|
var result;
|
|
1059
|
-
return __generator(this, function (_f) {
|
|
743
|
+
return tslib.__generator(this, function (_f) {
|
|
1060
744
|
switch (_f.label) {
|
|
1061
745
|
case 0:
|
|
1062
746
|
if (!callback)
|
|
@@ -1092,9 +776,9 @@
|
|
|
1092
776
|
};
|
|
1093
777
|
LocalizeApiHelper.prototype.onConnectionError = function (options, error) {
|
|
1094
778
|
var _a;
|
|
1095
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
779
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1096
780
|
var styleElement;
|
|
1097
|
-
return __generator(this, function (_f) {
|
|
781
|
+
return tslib.__generator(this, function (_f) {
|
|
1098
782
|
switch (_f.label) {
|
|
1099
783
|
case 0:
|
|
1100
784
|
if (!options.connectionError)
|
|
@@ -1243,6 +927,21 @@
|
|
|
1243
927
|
enumerable: false,
|
|
1244
928
|
configurable: true
|
|
1245
929
|
});
|
|
930
|
+
Object.defineProperty(LocalizeApiService.prototype, "isThirdPartyMode", {
|
|
931
|
+
get: function () { return this.localizeTokenService.config.isThirdPartyMode; },
|
|
932
|
+
enumerable: false,
|
|
933
|
+
configurable: true
|
|
934
|
+
});
|
|
935
|
+
Object.defineProperty(LocalizeApiService.prototype, "clientId", {
|
|
936
|
+
get: function () { var _a; return (_a = this.localizeTokenService.config.thirdPartyConfig) === null || _a === void 0 ? void 0 : _a.clientId; },
|
|
937
|
+
enumerable: false,
|
|
938
|
+
configurable: true
|
|
939
|
+
});
|
|
940
|
+
Object.defineProperty(LocalizeApiService.prototype, "clientSecret", {
|
|
941
|
+
get: function () { var _a; return (_a = this.localizeTokenService.config.thirdPartyConfig) === null || _a === void 0 ? void 0 : _a.clientSecret; },
|
|
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,8 +1013,8 @@
|
|
|
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
1019
|
case 0:
|
|
1321
1020
|
// Only handle 401 Unauthorized errors
|
|
@@ -1338,10 +1037,10 @@
|
|
|
1338
1037
|
};
|
|
1339
1038
|
LocalizeApiService.prototype.performRequest = function (options) {
|
|
1340
1039
|
var _a;
|
|
1341
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1040
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1342
1041
|
var buildOptions, request$, response;
|
|
1343
1042
|
var _this = this;
|
|
1344
|
-
return __generator(this, function (_e) {
|
|
1043
|
+
return tslib.__generator(this, function (_e) {
|
|
1345
1044
|
switch (_e.label) {
|
|
1346
1045
|
case 0:
|
|
1347
1046
|
buildOptions = { headers: this.buildHeaderOptions(options) };
|
|
@@ -1363,32 +1062,45 @@
|
|
|
1363
1062
|
};
|
|
1364
1063
|
LocalizeApiService.prototype.revokeToken = function () {
|
|
1365
1064
|
var _a;
|
|
1366
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1367
|
-
var apiOptions, revokeToken, error_2;
|
|
1368
|
-
|
|
1369
|
-
|
|
1065
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1066
|
+
var apiOptions, thirdPartyConfig, clientSecret, revokeToken, error_2;
|
|
1067
|
+
var _e;
|
|
1068
|
+
return tslib.__generator(this, function (_f) {
|
|
1069
|
+
switch (_f.label) {
|
|
1370
1070
|
case 0:
|
|
1371
|
-
|
|
1071
|
+
_f.trys.push([0, 4, 6, 7]);
|
|
1372
1072
|
return [4 /*yield*/, this.interceptRevokeToken()];
|
|
1373
1073
|
case 1:
|
|
1374
|
-
if (
|
|
1074
|
+
if (_f.sent())
|
|
1375
1075
|
return [2 /*return*/];
|
|
1376
1076
|
this.isRevokingToken = true;
|
|
1377
1077
|
apiOptions = Object.assign(Object.assign({}, this.buildApiOptions(((_a = this.localizeTokenService.config.refreshToken) === null || _a === void 0 ? void 0 : _a.requestUrl) || '')), { refreshToken: true });
|
|
1078
|
+
// If in third party mode, use the third party token refresh endpoint and options
|
|
1079
|
+
if (this.isThirdPartyMode) {
|
|
1080
|
+
thirdPartyConfig = this.localizeTokenService.config.thirdPartyConfig;
|
|
1081
|
+
if (thirdPartyConfig) {
|
|
1082
|
+
// Add the request URL, method and body
|
|
1083
|
+
apiOptions.requestUrl = thirdPartyConfig.refreshTokenUrl;
|
|
1084
|
+
apiOptions.method = (thirdPartyConfig === null || thirdPartyConfig === void 0 ? void 0 : thirdPartyConfig.method) || exports.EMethod.GET;
|
|
1085
|
+
apiOptions.requestBody = (thirdPartyConfig === null || thirdPartyConfig === void 0 ? void 0 : thirdPartyConfig.body) || {};
|
|
1086
|
+
clientSecret = (_e = {}, _e[SCHEMES.X_SECRET] = "" + this.clientSecret, _e);
|
|
1087
|
+
apiOptions.headers = Object.assign(Object.assign({}, apiOptions.headers), clientSecret);
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1378
1090
|
return [4 /*yield*/, ApiHelper.performRequestWithRetry(apiOptions, this.config, this.performRequest.bind(this))];
|
|
1379
1091
|
case 2:
|
|
1380
|
-
revokeToken =
|
|
1092
|
+
revokeToken = _f.sent();
|
|
1381
1093
|
return [4 /*yield*/, this.handleOnTokenRevoked(revokeToken)];
|
|
1382
1094
|
case 3:
|
|
1383
|
-
|
|
1095
|
+
_f.sent();
|
|
1384
1096
|
return [3 /*break*/, 7];
|
|
1385
1097
|
case 4:
|
|
1386
|
-
error_2 =
|
|
1098
|
+
error_2 = _f.sent();
|
|
1387
1099
|
// Handle the error, log it
|
|
1388
1100
|
return [4 /*yield*/, ApiHelper.invokeHook(this.config.onAutoLogout)];
|
|
1389
1101
|
case 5:
|
|
1390
1102
|
// Handle the error, log it
|
|
1391
|
-
|
|
1103
|
+
_f.sent();
|
|
1392
1104
|
throw error_2;
|
|
1393
1105
|
case 6:
|
|
1394
1106
|
// Reset the revoking token state
|
|
@@ -1399,10 +1111,12 @@
|
|
|
1399
1111
|
});
|
|
1400
1112
|
});
|
|
1401
1113
|
};
|
|
1114
|
+
LocalizeApiService.prototype.apiOptionsForThirdParty = function () {
|
|
1115
|
+
};
|
|
1402
1116
|
/** default http request options */
|
|
1403
1117
|
LocalizeApiService.prototype.buildHeaderOptions = function (options) {
|
|
1404
|
-
var _e, _f, _g, _h;
|
|
1405
|
-
var headers = 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)));
|
|
1118
|
+
var _e, _f, _g, _h, _j;
|
|
1119
|
+
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))), (this.isThirdPartyMode && (_j = {}, _j[SCHEMES.X_CLIENT] = "" + this.clientId, _j)));
|
|
1406
1120
|
return new i1.HttpHeaders(Object.assign(Object.assign({}, headers), options.headers));
|
|
1407
1121
|
};
|
|
1408
1122
|
LocalizeApiService.prototype.buildApiOptions = function (baseUrl, path, method, requestBody, headers) {
|
|
@@ -1415,10 +1129,10 @@
|
|
|
1415
1129
|
};
|
|
1416
1130
|
LocalizeApiService.prototype.toWaitForPreviousRequest = function () {
|
|
1417
1131
|
var _a;
|
|
1418
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1132
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1419
1133
|
var waitMilliseconds;
|
|
1420
1134
|
var _this = this;
|
|
1421
|
-
return __generator(this, function (_e) {
|
|
1135
|
+
return tslib.__generator(this, function (_e) {
|
|
1422
1136
|
switch (_e.label) {
|
|
1423
1137
|
case 0:
|
|
1424
1138
|
if (!this.isRevokingToken) return [3 /*break*/, 2];
|
|
@@ -1441,30 +1155,35 @@
|
|
|
1441
1155
|
});
|
|
1442
1156
|
};
|
|
1443
1157
|
LocalizeApiService.prototype.handleOnTokenRevoked = function (response) {
|
|
1444
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1445
|
-
return __generator(this, function (_e) {
|
|
1158
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1159
|
+
return tslib.__generator(this, function (_e) {
|
|
1446
1160
|
switch (_e.label) {
|
|
1447
1161
|
case 0:
|
|
1448
|
-
if (!(response === null || response === void 0 ? void 0 : response.
|
|
1162
|
+
if (!(this.isThirdPartyMode && (response === null || response === void 0 ? void 0 : response.token))) return [3 /*break*/, 1];
|
|
1163
|
+
// If request third party token refresh, the new access token will be in response.token.
|
|
1164
|
+
this.accessToken = response.token;
|
|
1165
|
+
return [3 /*break*/, 4];
|
|
1166
|
+
case 1:
|
|
1167
|
+
if (!(response === null || response === void 0 ? void 0 : response.status)) return [3 /*break*/, 2];
|
|
1449
1168
|
// If the response is successful, update the access token
|
|
1450
1169
|
this.accessToken = response.message;
|
|
1451
|
-
return [3 /*break*/,
|
|
1452
|
-
case
|
|
1170
|
+
return [3 /*break*/, 4];
|
|
1171
|
+
case 2:
|
|
1453
1172
|
// If the response indicates an error, invoke the onRevokeUnauthorized hook
|
|
1454
1173
|
console.warn('Token revocation failed, refresh token is expired.', response.message);
|
|
1455
1174
|
return [4 /*yield*/, ApiHelper.invokeHook(this.config.onRevokeUnauthorized)];
|
|
1456
|
-
case
|
|
1175
|
+
case 3:
|
|
1457
1176
|
_e.sent();
|
|
1458
|
-
_e.label =
|
|
1459
|
-
case
|
|
1177
|
+
_e.label = 4;
|
|
1178
|
+
case 4: return [2 /*return*/];
|
|
1460
1179
|
}
|
|
1461
1180
|
});
|
|
1462
1181
|
});
|
|
1463
1182
|
};
|
|
1464
1183
|
LocalizeApiService.prototype.interceptRevokeToken = function () {
|
|
1465
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1184
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
1466
1185
|
var _this = this;
|
|
1467
|
-
return __generator(this, function (_e) {
|
|
1186
|
+
return tslib.__generator(this, function (_e) {
|
|
1468
1187
|
switch (_e.label) {
|
|
1469
1188
|
case 0:
|
|
1470
1189
|
if (!this.isRevokingToken) return [3 /*break*/, 2];
|