@spica-devkit/identity 0.9.14 → 0.9.17
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/index.d.ts +0 -1
- package/dist/index.js +768 -42
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +765 -41
- package/dist/index.mjs.map +1 -1
- package/dist/src/identity.d.ts +4 -2
- package/dist/src/index.d.ts +0 -1
- package/dist/src/interface.d.ts +17 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -2,11 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var axios_1 = require('axios');
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var axios_1__default = /*#__PURE__*/_interopDefaultLegacy(axios_1);
|
|
10
|
+
|
|
11
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
12
|
+
|
|
13
|
+
function createCommonjsModule(fn, basedir, module) {
|
|
14
|
+
return module = {
|
|
15
|
+
path: basedir,
|
|
16
|
+
exports: {},
|
|
17
|
+
require: function (path, base) {
|
|
18
|
+
return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
|
|
19
|
+
}
|
|
20
|
+
}, fn(module, module.exports), module.exports;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function commonjsRequire () {
|
|
24
|
+
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var request = createCommonjsModule(function (module, exports) {
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.Axios = exports.logWarning = void 0;
|
|
10
30
|
|
|
11
31
|
function logWarning(response) {
|
|
12
32
|
const warning = response.headers["warning"];
|
|
@@ -14,6 +34,7 @@ function logWarning(response) {
|
|
|
14
34
|
console.warn(warning);
|
|
15
35
|
}
|
|
16
36
|
}
|
|
37
|
+
exports.logWarning = logWarning;
|
|
17
38
|
class Axios {
|
|
18
39
|
constructor(config) {
|
|
19
40
|
this.interceptors = {
|
|
@@ -38,7 +59,7 @@ class Axios {
|
|
|
38
59
|
}
|
|
39
60
|
}
|
|
40
61
|
};
|
|
41
|
-
this.instance =
|
|
62
|
+
this.instance = axios_1__default['default'].default.create(config);
|
|
42
63
|
this.instance.interceptors.request.use(this.interceptors.request.onFulfilled, this.interceptors.request.onRejected);
|
|
43
64
|
this.instance.interceptors.response.use(this.interceptors.response.onFulfilled, this.interceptors.response.onRejected);
|
|
44
65
|
this.baseUrl = this.instance.defaults.baseURL;
|
|
@@ -71,6 +92,13 @@ class Axios {
|
|
|
71
92
|
return this.instance.delete(url, config);
|
|
72
93
|
}
|
|
73
94
|
}
|
|
95
|
+
exports.Axios = Axios;
|
|
96
|
+
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
var initialize_1 = createCommonjsModule(function (module, exports) {
|
|
100
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
101
|
+
exports.isPlatformBrowser = exports.checkInitialized = exports.initialize = void 0;
|
|
74
102
|
|
|
75
103
|
let service;
|
|
76
104
|
function initialize(options) {
|
|
@@ -87,7 +115,7 @@ function initialize(options) {
|
|
|
87
115
|
throw new Error("Public url must be provided.");
|
|
88
116
|
}
|
|
89
117
|
if (!service) {
|
|
90
|
-
service = new Axios({ baseURL: publicUrl, headers: { Authorization: authorization } });
|
|
118
|
+
service = new request.Axios({ baseURL: publicUrl, headers: { Authorization: authorization } });
|
|
91
119
|
}
|
|
92
120
|
else {
|
|
93
121
|
service.setBaseUrl(publicUrl);
|
|
@@ -95,51 +123,727 @@ function initialize(options) {
|
|
|
95
123
|
}
|
|
96
124
|
return { authorization, publicUrl, service };
|
|
97
125
|
}
|
|
126
|
+
exports.initialize = initialize;
|
|
98
127
|
function checkInitialized(authorization) {
|
|
99
128
|
if (!authorization) {
|
|
100
129
|
throw new Error("You should call initialize method with a valid apikey or identity token.");
|
|
101
130
|
}
|
|
102
131
|
}
|
|
132
|
+
exports.checkInitialized = checkInitialized;
|
|
103
133
|
function getPublicUrl() {
|
|
104
134
|
return isPlatformBrowser() ? undefined : process.env.__INTERNAL__SPICA__PUBLIC_URL__;
|
|
105
135
|
}
|
|
106
136
|
function isPlatformBrowser() {
|
|
107
137
|
return typeof window !== "undefined";
|
|
108
138
|
}
|
|
139
|
+
exports.isPlatformBrowser = isPlatformBrowser;
|
|
109
140
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
var _interface = createCommonjsModule(function (module, exports) {
|
|
144
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
145
|
+
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
var url = createCommonjsModule(function (module, exports) {
|
|
149
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
150
|
+
exports.buildUrl = void 0;
|
|
151
|
+
function buildUrl(baseUrl, queryParams = {}) {
|
|
152
|
+
const url = new URL(baseUrl);
|
|
153
|
+
for (let [key, value] of Object.entries(queryParams)) {
|
|
154
|
+
if (typeof value != "string") {
|
|
155
|
+
value = JSON.stringify(value);
|
|
156
|
+
}
|
|
157
|
+
url.searchParams.set(key, value);
|
|
158
|
+
}
|
|
159
|
+
return url;
|
|
160
|
+
}
|
|
161
|
+
exports.buildUrl = buildUrl;
|
|
162
|
+
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
var src = createCommonjsModule(function (module, exports) {
|
|
166
|
+
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
167
|
+
if (k2 === undefined) k2 = k;
|
|
168
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
169
|
+
}) : (function(o, m, k, k2) {
|
|
170
|
+
if (k2 === undefined) k2 = k;
|
|
171
|
+
o[k2] = m[k];
|
|
172
|
+
}));
|
|
173
|
+
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
174
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
118
175
|
};
|
|
176
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
177
|
+
__exportStar(initialize_1, exports);
|
|
178
|
+
__exportStar(_interface, exports);
|
|
179
|
+
__exportStar(request, exports);
|
|
180
|
+
__exportStar(url, exports);
|
|
181
|
+
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
var internal_common = createCommonjsModule(function (module, exports) {
|
|
185
|
+
var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
186
|
+
if (k2 === undefined) k2 = k;
|
|
187
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
188
|
+
}) : (function(o, m, k, k2) {
|
|
189
|
+
if (k2 === undefined) k2 = k;
|
|
190
|
+
o[k2] = m[k];
|
|
191
|
+
}));
|
|
192
|
+
var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
|
|
193
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
194
|
+
};
|
|
195
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
196
|
+
__exportStar(src, exports);
|
|
197
|
+
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
/*! *****************************************************************************
|
|
201
|
+
Copyright (c) Microsoft Corporation.
|
|
202
|
+
|
|
203
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
204
|
+
purpose with or without fee is hereby granted.
|
|
205
|
+
|
|
206
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
207
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
208
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
209
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
210
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
211
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
212
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
213
|
+
***************************************************************************** */
|
|
214
|
+
/* global Reflect, Promise */
|
|
215
|
+
|
|
216
|
+
var extendStatics = function(d, b) {
|
|
217
|
+
extendStatics = Object.setPrototypeOf ||
|
|
218
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
219
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
220
|
+
return extendStatics(d, b);
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
function __extends(d, b) {
|
|
224
|
+
extendStatics(d, b);
|
|
225
|
+
function __() { this.constructor = d; }
|
|
226
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
230
|
+
function isFunction(x) {
|
|
231
|
+
return typeof x === 'function';
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
235
|
+
var _enable_super_gross_mode_that_will_cause_bad_things = false;
|
|
236
|
+
var config = {
|
|
237
|
+
Promise: undefined,
|
|
238
|
+
set useDeprecatedSynchronousErrorHandling(value) {
|
|
239
|
+
if (value) {
|
|
240
|
+
var error = /*@__PURE__*/ new Error();
|
|
241
|
+
/*@__PURE__*/ console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack);
|
|
242
|
+
}
|
|
243
|
+
_enable_super_gross_mode_that_will_cause_bad_things = value;
|
|
244
|
+
},
|
|
245
|
+
get useDeprecatedSynchronousErrorHandling() {
|
|
246
|
+
return _enable_super_gross_mode_that_will_cause_bad_things;
|
|
247
|
+
},
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
251
|
+
function hostReportError(err) {
|
|
252
|
+
setTimeout(function () { throw err; }, 0);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/** PURE_IMPORTS_START _config,_util_hostReportError PURE_IMPORTS_END */
|
|
256
|
+
var empty = {
|
|
257
|
+
closed: true,
|
|
258
|
+
next: function (value) { },
|
|
259
|
+
error: function (err) {
|
|
260
|
+
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
261
|
+
throw err;
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
hostReportError(err);
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
complete: function () { }
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
271
|
+
var isArray = /*@__PURE__*/ (function () { return Array.isArray || (function (x) { return x && typeof x.length === 'number'; }); })();
|
|
272
|
+
|
|
273
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
274
|
+
function isObject(x) {
|
|
275
|
+
return x !== null && typeof x === 'object';
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
279
|
+
var UnsubscriptionErrorImpl = /*@__PURE__*/ (function () {
|
|
280
|
+
function UnsubscriptionErrorImpl(errors) {
|
|
281
|
+
Error.call(this);
|
|
282
|
+
this.message = errors ?
|
|
283
|
+
errors.length + " errors occurred during unsubscription:\n" + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ') : '';
|
|
284
|
+
this.name = 'UnsubscriptionError';
|
|
285
|
+
this.errors = errors;
|
|
286
|
+
return this;
|
|
287
|
+
}
|
|
288
|
+
UnsubscriptionErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
|
|
289
|
+
return UnsubscriptionErrorImpl;
|
|
290
|
+
})();
|
|
291
|
+
var UnsubscriptionError = UnsubscriptionErrorImpl;
|
|
292
|
+
|
|
293
|
+
/** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_UnsubscriptionError PURE_IMPORTS_END */
|
|
294
|
+
var Subscription = /*@__PURE__*/ (function () {
|
|
295
|
+
function Subscription(unsubscribe) {
|
|
296
|
+
this.closed = false;
|
|
297
|
+
this._parentOrParents = null;
|
|
298
|
+
this._subscriptions = null;
|
|
299
|
+
if (unsubscribe) {
|
|
300
|
+
this._ctorUnsubscribe = true;
|
|
301
|
+
this._unsubscribe = unsubscribe;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
Subscription.prototype.unsubscribe = function () {
|
|
305
|
+
var errors;
|
|
306
|
+
if (this.closed) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
var _a = this, _parentOrParents = _a._parentOrParents, _ctorUnsubscribe = _a._ctorUnsubscribe, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;
|
|
310
|
+
this.closed = true;
|
|
311
|
+
this._parentOrParents = null;
|
|
312
|
+
this._subscriptions = null;
|
|
313
|
+
if (_parentOrParents instanceof Subscription) {
|
|
314
|
+
_parentOrParents.remove(this);
|
|
315
|
+
}
|
|
316
|
+
else if (_parentOrParents !== null) {
|
|
317
|
+
for (var index = 0; index < _parentOrParents.length; ++index) {
|
|
318
|
+
var parent_1 = _parentOrParents[index];
|
|
319
|
+
parent_1.remove(this);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
if (isFunction(_unsubscribe)) {
|
|
323
|
+
if (_ctorUnsubscribe) {
|
|
324
|
+
this._unsubscribe = undefined;
|
|
325
|
+
}
|
|
326
|
+
try {
|
|
327
|
+
_unsubscribe.call(this);
|
|
328
|
+
}
|
|
329
|
+
catch (e) {
|
|
330
|
+
errors = e instanceof UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
if (isArray(_subscriptions)) {
|
|
334
|
+
var index = -1;
|
|
335
|
+
var len = _subscriptions.length;
|
|
336
|
+
while (++index < len) {
|
|
337
|
+
var sub = _subscriptions[index];
|
|
338
|
+
if (isObject(sub)) {
|
|
339
|
+
try {
|
|
340
|
+
sub.unsubscribe();
|
|
341
|
+
}
|
|
342
|
+
catch (e) {
|
|
343
|
+
errors = errors || [];
|
|
344
|
+
if (e instanceof UnsubscriptionError) {
|
|
345
|
+
errors = errors.concat(flattenUnsubscriptionErrors(e.errors));
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
errors.push(e);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
if (errors) {
|
|
355
|
+
throw new UnsubscriptionError(errors);
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
Subscription.prototype.add = function (teardown) {
|
|
359
|
+
var subscription = teardown;
|
|
360
|
+
if (!teardown) {
|
|
361
|
+
return Subscription.EMPTY;
|
|
362
|
+
}
|
|
363
|
+
switch (typeof teardown) {
|
|
364
|
+
case 'function':
|
|
365
|
+
subscription = new Subscription(teardown);
|
|
366
|
+
case 'object':
|
|
367
|
+
if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {
|
|
368
|
+
return subscription;
|
|
369
|
+
}
|
|
370
|
+
else if (this.closed) {
|
|
371
|
+
subscription.unsubscribe();
|
|
372
|
+
return subscription;
|
|
373
|
+
}
|
|
374
|
+
else if (!(subscription instanceof Subscription)) {
|
|
375
|
+
var tmp = subscription;
|
|
376
|
+
subscription = new Subscription();
|
|
377
|
+
subscription._subscriptions = [tmp];
|
|
378
|
+
}
|
|
379
|
+
break;
|
|
380
|
+
default: {
|
|
381
|
+
throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
var _parentOrParents = subscription._parentOrParents;
|
|
385
|
+
if (_parentOrParents === null) {
|
|
386
|
+
subscription._parentOrParents = this;
|
|
387
|
+
}
|
|
388
|
+
else if (_parentOrParents instanceof Subscription) {
|
|
389
|
+
if (_parentOrParents === this) {
|
|
390
|
+
return subscription;
|
|
391
|
+
}
|
|
392
|
+
subscription._parentOrParents = [_parentOrParents, this];
|
|
393
|
+
}
|
|
394
|
+
else if (_parentOrParents.indexOf(this) === -1) {
|
|
395
|
+
_parentOrParents.push(this);
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
return subscription;
|
|
399
|
+
}
|
|
400
|
+
var subscriptions = this._subscriptions;
|
|
401
|
+
if (subscriptions === null) {
|
|
402
|
+
this._subscriptions = [subscription];
|
|
403
|
+
}
|
|
404
|
+
else {
|
|
405
|
+
subscriptions.push(subscription);
|
|
406
|
+
}
|
|
407
|
+
return subscription;
|
|
408
|
+
};
|
|
409
|
+
Subscription.prototype.remove = function (subscription) {
|
|
410
|
+
var subscriptions = this._subscriptions;
|
|
411
|
+
if (subscriptions) {
|
|
412
|
+
var subscriptionIndex = subscriptions.indexOf(subscription);
|
|
413
|
+
if (subscriptionIndex !== -1) {
|
|
414
|
+
subscriptions.splice(subscriptionIndex, 1);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
Subscription.EMPTY = (function (empty) {
|
|
419
|
+
empty.closed = true;
|
|
420
|
+
return empty;
|
|
421
|
+
}(new Subscription()));
|
|
422
|
+
return Subscription;
|
|
423
|
+
}());
|
|
424
|
+
function flattenUnsubscriptionErrors(errors) {
|
|
425
|
+
return errors.reduce(function (errs, err) { return errs.concat((err instanceof UnsubscriptionError) ? err.errors : err); }, []);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
429
|
+
var rxSubscriber = /*@__PURE__*/ (function () {
|
|
430
|
+
return typeof Symbol === 'function'
|
|
431
|
+
? /*@__PURE__*/ Symbol('rxSubscriber')
|
|
432
|
+
: '@@rxSubscriber_' + /*@__PURE__*/ Math.random();
|
|
433
|
+
})();
|
|
434
|
+
|
|
435
|
+
/** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */
|
|
436
|
+
var Subscriber = /*@__PURE__*/ (function (_super) {
|
|
437
|
+
__extends(Subscriber, _super);
|
|
438
|
+
function Subscriber(destinationOrNext, error, complete) {
|
|
439
|
+
var _this = _super.call(this) || this;
|
|
440
|
+
_this.syncErrorValue = null;
|
|
441
|
+
_this.syncErrorThrown = false;
|
|
442
|
+
_this.syncErrorThrowable = false;
|
|
443
|
+
_this.isStopped = false;
|
|
444
|
+
switch (arguments.length) {
|
|
445
|
+
case 0:
|
|
446
|
+
_this.destination = empty;
|
|
447
|
+
break;
|
|
448
|
+
case 1:
|
|
449
|
+
if (!destinationOrNext) {
|
|
450
|
+
_this.destination = empty;
|
|
451
|
+
break;
|
|
452
|
+
}
|
|
453
|
+
if (typeof destinationOrNext === 'object') {
|
|
454
|
+
if (destinationOrNext instanceof Subscriber) {
|
|
455
|
+
_this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
|
|
456
|
+
_this.destination = destinationOrNext;
|
|
457
|
+
destinationOrNext.add(_this);
|
|
458
|
+
}
|
|
459
|
+
else {
|
|
460
|
+
_this.syncErrorThrowable = true;
|
|
461
|
+
_this.destination = new SafeSubscriber(_this, destinationOrNext);
|
|
462
|
+
}
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
default:
|
|
466
|
+
_this.syncErrorThrowable = true;
|
|
467
|
+
_this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);
|
|
468
|
+
break;
|
|
469
|
+
}
|
|
470
|
+
return _this;
|
|
471
|
+
}
|
|
472
|
+
Subscriber.prototype[rxSubscriber] = function () { return this; };
|
|
473
|
+
Subscriber.create = function (next, error, complete) {
|
|
474
|
+
var subscriber = new Subscriber(next, error, complete);
|
|
475
|
+
subscriber.syncErrorThrowable = false;
|
|
476
|
+
return subscriber;
|
|
477
|
+
};
|
|
478
|
+
Subscriber.prototype.next = function (value) {
|
|
479
|
+
if (!this.isStopped) {
|
|
480
|
+
this._next(value);
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
Subscriber.prototype.error = function (err) {
|
|
484
|
+
if (!this.isStopped) {
|
|
485
|
+
this.isStopped = true;
|
|
486
|
+
this._error(err);
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
Subscriber.prototype.complete = function () {
|
|
490
|
+
if (!this.isStopped) {
|
|
491
|
+
this.isStopped = true;
|
|
492
|
+
this._complete();
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
Subscriber.prototype.unsubscribe = function () {
|
|
496
|
+
if (this.closed) {
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
this.isStopped = true;
|
|
500
|
+
_super.prototype.unsubscribe.call(this);
|
|
501
|
+
};
|
|
502
|
+
Subscriber.prototype._next = function (value) {
|
|
503
|
+
this.destination.next(value);
|
|
504
|
+
};
|
|
505
|
+
Subscriber.prototype._error = function (err) {
|
|
506
|
+
this.destination.error(err);
|
|
507
|
+
this.unsubscribe();
|
|
508
|
+
};
|
|
509
|
+
Subscriber.prototype._complete = function () {
|
|
510
|
+
this.destination.complete();
|
|
511
|
+
this.unsubscribe();
|
|
512
|
+
};
|
|
513
|
+
Subscriber.prototype._unsubscribeAndRecycle = function () {
|
|
514
|
+
var _parentOrParents = this._parentOrParents;
|
|
515
|
+
this._parentOrParents = null;
|
|
516
|
+
this.unsubscribe();
|
|
517
|
+
this.closed = false;
|
|
518
|
+
this.isStopped = false;
|
|
519
|
+
this._parentOrParents = _parentOrParents;
|
|
520
|
+
return this;
|
|
521
|
+
};
|
|
522
|
+
return Subscriber;
|
|
523
|
+
}(Subscription));
|
|
524
|
+
var SafeSubscriber = /*@__PURE__*/ (function (_super) {
|
|
525
|
+
__extends(SafeSubscriber, _super);
|
|
526
|
+
function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {
|
|
527
|
+
var _this = _super.call(this) || this;
|
|
528
|
+
_this._parentSubscriber = _parentSubscriber;
|
|
529
|
+
var next;
|
|
530
|
+
var context = _this;
|
|
531
|
+
if (isFunction(observerOrNext)) {
|
|
532
|
+
next = observerOrNext;
|
|
533
|
+
}
|
|
534
|
+
else if (observerOrNext) {
|
|
535
|
+
next = observerOrNext.next;
|
|
536
|
+
error = observerOrNext.error;
|
|
537
|
+
complete = observerOrNext.complete;
|
|
538
|
+
if (observerOrNext !== empty) {
|
|
539
|
+
context = Object.create(observerOrNext);
|
|
540
|
+
if (isFunction(context.unsubscribe)) {
|
|
541
|
+
_this.add(context.unsubscribe.bind(context));
|
|
542
|
+
}
|
|
543
|
+
context.unsubscribe = _this.unsubscribe.bind(_this);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
_this._context = context;
|
|
547
|
+
_this._next = next;
|
|
548
|
+
_this._error = error;
|
|
549
|
+
_this._complete = complete;
|
|
550
|
+
return _this;
|
|
551
|
+
}
|
|
552
|
+
SafeSubscriber.prototype.next = function (value) {
|
|
553
|
+
if (!this.isStopped && this._next) {
|
|
554
|
+
var _parentSubscriber = this._parentSubscriber;
|
|
555
|
+
if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
|
556
|
+
this.__tryOrUnsub(this._next, value);
|
|
557
|
+
}
|
|
558
|
+
else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
|
|
559
|
+
this.unsubscribe();
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
};
|
|
563
|
+
SafeSubscriber.prototype.error = function (err) {
|
|
564
|
+
if (!this.isStopped) {
|
|
565
|
+
var _parentSubscriber = this._parentSubscriber;
|
|
566
|
+
var useDeprecatedSynchronousErrorHandling = config.useDeprecatedSynchronousErrorHandling;
|
|
567
|
+
if (this._error) {
|
|
568
|
+
if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
|
569
|
+
this.__tryOrUnsub(this._error, err);
|
|
570
|
+
this.unsubscribe();
|
|
571
|
+
}
|
|
572
|
+
else {
|
|
573
|
+
this.__tryOrSetError(_parentSubscriber, this._error, err);
|
|
574
|
+
this.unsubscribe();
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
else if (!_parentSubscriber.syncErrorThrowable) {
|
|
578
|
+
this.unsubscribe();
|
|
579
|
+
if (useDeprecatedSynchronousErrorHandling) {
|
|
580
|
+
throw err;
|
|
581
|
+
}
|
|
582
|
+
hostReportError(err);
|
|
583
|
+
}
|
|
584
|
+
else {
|
|
585
|
+
if (useDeprecatedSynchronousErrorHandling) {
|
|
586
|
+
_parentSubscriber.syncErrorValue = err;
|
|
587
|
+
_parentSubscriber.syncErrorThrown = true;
|
|
588
|
+
}
|
|
589
|
+
else {
|
|
590
|
+
hostReportError(err);
|
|
591
|
+
}
|
|
592
|
+
this.unsubscribe();
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
};
|
|
596
|
+
SafeSubscriber.prototype.complete = function () {
|
|
597
|
+
var _this = this;
|
|
598
|
+
if (!this.isStopped) {
|
|
599
|
+
var _parentSubscriber = this._parentSubscriber;
|
|
600
|
+
if (this._complete) {
|
|
601
|
+
var wrappedComplete = function () { return _this._complete.call(_this._context); };
|
|
602
|
+
if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
|
|
603
|
+
this.__tryOrUnsub(wrappedComplete);
|
|
604
|
+
this.unsubscribe();
|
|
605
|
+
}
|
|
606
|
+
else {
|
|
607
|
+
this.__tryOrSetError(_parentSubscriber, wrappedComplete);
|
|
608
|
+
this.unsubscribe();
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
else {
|
|
612
|
+
this.unsubscribe();
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
};
|
|
616
|
+
SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {
|
|
617
|
+
try {
|
|
618
|
+
fn.call(this._context, value);
|
|
619
|
+
}
|
|
620
|
+
catch (err) {
|
|
621
|
+
this.unsubscribe();
|
|
622
|
+
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
623
|
+
throw err;
|
|
624
|
+
}
|
|
625
|
+
else {
|
|
626
|
+
hostReportError(err);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
};
|
|
630
|
+
SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {
|
|
631
|
+
if (!config.useDeprecatedSynchronousErrorHandling) {
|
|
632
|
+
throw new Error('bad call');
|
|
633
|
+
}
|
|
634
|
+
try {
|
|
635
|
+
fn.call(this._context, value);
|
|
636
|
+
}
|
|
637
|
+
catch (err) {
|
|
638
|
+
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
639
|
+
parent.syncErrorValue = err;
|
|
640
|
+
parent.syncErrorThrown = true;
|
|
641
|
+
return true;
|
|
642
|
+
}
|
|
643
|
+
else {
|
|
644
|
+
hostReportError(err);
|
|
645
|
+
return true;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
return false;
|
|
649
|
+
};
|
|
650
|
+
SafeSubscriber.prototype._unsubscribe = function () {
|
|
651
|
+
var _parentSubscriber = this._parentSubscriber;
|
|
652
|
+
this._context = null;
|
|
653
|
+
this._parentSubscriber = null;
|
|
654
|
+
_parentSubscriber.unsubscribe();
|
|
655
|
+
};
|
|
656
|
+
return SafeSubscriber;
|
|
657
|
+
}(Subscriber));
|
|
658
|
+
|
|
659
|
+
/** PURE_IMPORTS_START _Subscriber PURE_IMPORTS_END */
|
|
660
|
+
function canReportError(observer) {
|
|
661
|
+
while (observer) {
|
|
662
|
+
var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped;
|
|
663
|
+
if (closed_1 || isStopped) {
|
|
664
|
+
return false;
|
|
665
|
+
}
|
|
666
|
+
else if (destination && destination instanceof Subscriber) {
|
|
667
|
+
observer = destination;
|
|
668
|
+
}
|
|
669
|
+
else {
|
|
670
|
+
observer = null;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
return true;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/** PURE_IMPORTS_START _Subscriber,_symbol_rxSubscriber,_Observer PURE_IMPORTS_END */
|
|
677
|
+
function toSubscriber(nextOrObserver, error, complete) {
|
|
678
|
+
if (nextOrObserver) {
|
|
679
|
+
if (nextOrObserver instanceof Subscriber) {
|
|
680
|
+
return nextOrObserver;
|
|
681
|
+
}
|
|
682
|
+
if (nextOrObserver[rxSubscriber]) {
|
|
683
|
+
return nextOrObserver[rxSubscriber]();
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
if (!nextOrObserver && !error && !complete) {
|
|
687
|
+
return new Subscriber(empty);
|
|
688
|
+
}
|
|
689
|
+
return new Subscriber(nextOrObserver, error, complete);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
693
|
+
var observable = /*@__PURE__*/ (function () { return typeof Symbol === 'function' && Symbol.observable || '@@observable'; })();
|
|
694
|
+
|
|
695
|
+
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
|
696
|
+
function identity(x) {
|
|
697
|
+
return x;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/** PURE_IMPORTS_START _identity PURE_IMPORTS_END */
|
|
701
|
+
function pipeFromArray(fns) {
|
|
702
|
+
if (fns.length === 0) {
|
|
703
|
+
return identity;
|
|
704
|
+
}
|
|
705
|
+
if (fns.length === 1) {
|
|
706
|
+
return fns[0];
|
|
707
|
+
}
|
|
708
|
+
return function piped(input) {
|
|
709
|
+
return fns.reduce(function (prev, fn) { return fn(prev); }, input);
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
/** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */
|
|
714
|
+
var Observable = /*@__PURE__*/ (function () {
|
|
715
|
+
function Observable(subscribe) {
|
|
716
|
+
this._isScalar = false;
|
|
717
|
+
if (subscribe) {
|
|
718
|
+
this._subscribe = subscribe;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
Observable.prototype.lift = function (operator) {
|
|
722
|
+
var observable = new Observable();
|
|
723
|
+
observable.source = this;
|
|
724
|
+
observable.operator = operator;
|
|
725
|
+
return observable;
|
|
726
|
+
};
|
|
727
|
+
Observable.prototype.subscribe = function (observerOrNext, error, complete) {
|
|
728
|
+
var operator = this.operator;
|
|
729
|
+
var sink = toSubscriber(observerOrNext, error, complete);
|
|
730
|
+
if (operator) {
|
|
731
|
+
sink.add(operator.call(sink, this.source));
|
|
732
|
+
}
|
|
733
|
+
else {
|
|
734
|
+
sink.add(this.source || (config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?
|
|
735
|
+
this._subscribe(sink) :
|
|
736
|
+
this._trySubscribe(sink));
|
|
737
|
+
}
|
|
738
|
+
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
739
|
+
if (sink.syncErrorThrowable) {
|
|
740
|
+
sink.syncErrorThrowable = false;
|
|
741
|
+
if (sink.syncErrorThrown) {
|
|
742
|
+
throw sink.syncErrorValue;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
return sink;
|
|
747
|
+
};
|
|
748
|
+
Observable.prototype._trySubscribe = function (sink) {
|
|
749
|
+
try {
|
|
750
|
+
return this._subscribe(sink);
|
|
751
|
+
}
|
|
752
|
+
catch (err) {
|
|
753
|
+
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
754
|
+
sink.syncErrorThrown = true;
|
|
755
|
+
sink.syncErrorValue = err;
|
|
756
|
+
}
|
|
757
|
+
if (canReportError(sink)) {
|
|
758
|
+
sink.error(err);
|
|
759
|
+
}
|
|
760
|
+
else {
|
|
761
|
+
console.warn(err);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
};
|
|
765
|
+
Observable.prototype.forEach = function (next, promiseCtor) {
|
|
766
|
+
var _this = this;
|
|
767
|
+
promiseCtor = getPromiseCtor(promiseCtor);
|
|
768
|
+
return new promiseCtor(function (resolve, reject) {
|
|
769
|
+
var subscription;
|
|
770
|
+
subscription = _this.subscribe(function (value) {
|
|
771
|
+
try {
|
|
772
|
+
next(value);
|
|
773
|
+
}
|
|
774
|
+
catch (err) {
|
|
775
|
+
reject(err);
|
|
776
|
+
if (subscription) {
|
|
777
|
+
subscription.unsubscribe();
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
}, reject, resolve);
|
|
781
|
+
});
|
|
782
|
+
};
|
|
783
|
+
Observable.prototype._subscribe = function (subscriber) {
|
|
784
|
+
var source = this.source;
|
|
785
|
+
return source && source.subscribe(subscriber);
|
|
786
|
+
};
|
|
787
|
+
Observable.prototype[observable] = function () {
|
|
788
|
+
return this;
|
|
789
|
+
};
|
|
790
|
+
Observable.prototype.pipe = function () {
|
|
791
|
+
var operations = [];
|
|
792
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
793
|
+
operations[_i] = arguments[_i];
|
|
794
|
+
}
|
|
795
|
+
if (operations.length === 0) {
|
|
796
|
+
return this;
|
|
797
|
+
}
|
|
798
|
+
return pipeFromArray(operations)(this);
|
|
799
|
+
};
|
|
800
|
+
Observable.prototype.toPromise = function (promiseCtor) {
|
|
801
|
+
var _this = this;
|
|
802
|
+
promiseCtor = getPromiseCtor(promiseCtor);
|
|
803
|
+
return new promiseCtor(function (resolve, reject) {
|
|
804
|
+
var value;
|
|
805
|
+
_this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });
|
|
806
|
+
});
|
|
807
|
+
};
|
|
808
|
+
Observable.create = function (subscribe) {
|
|
809
|
+
return new Observable(subscribe);
|
|
810
|
+
};
|
|
811
|
+
return Observable;
|
|
812
|
+
}());
|
|
813
|
+
function getPromiseCtor(promiseCtor) {
|
|
814
|
+
if (!promiseCtor) {
|
|
815
|
+
promiseCtor = Promise;
|
|
816
|
+
}
|
|
817
|
+
if (!promiseCtor) {
|
|
818
|
+
throw new Error('no Promise impl found');
|
|
819
|
+
}
|
|
820
|
+
return promiseCtor;
|
|
821
|
+
}
|
|
822
|
+
|
|
119
823
|
let authorization;
|
|
120
|
-
let service
|
|
824
|
+
let service;
|
|
121
825
|
const identitySegment = "passport/identity";
|
|
122
|
-
function initialize
|
|
123
|
-
const { authorization: _authorization, service: _service } = initialize(options);
|
|
826
|
+
function initialize(options) {
|
|
827
|
+
const { authorization: _authorization, service: _service } = internal_common.initialize(options);
|
|
124
828
|
authorization = _authorization;
|
|
125
|
-
service
|
|
126
|
-
service
|
|
829
|
+
service = _service;
|
|
830
|
+
service.setWriteDefaults({
|
|
127
831
|
headers: {
|
|
128
832
|
"Content-Type": "application/json"
|
|
129
833
|
}
|
|
130
834
|
});
|
|
131
835
|
}
|
|
132
836
|
function verifyToken(token, baseUrl) {
|
|
133
|
-
const _baseUrl = baseUrl ? baseUrl : service
|
|
837
|
+
const _baseUrl = baseUrl ? baseUrl : service ? service.baseUrl : undefined;
|
|
134
838
|
if (!_baseUrl) {
|
|
135
839
|
throw new Error("You should pass the base url of the server or call the initialize method.");
|
|
136
840
|
}
|
|
137
|
-
const req = new Axios({ baseURL: _baseUrl });
|
|
841
|
+
const req = new internal_common.Axios({ baseURL: _baseUrl });
|
|
138
842
|
return req.get(`${identitySegment}/verify`, { headers: { Authorization: token } });
|
|
139
843
|
}
|
|
140
844
|
function login(identifier, password, tokenLifeSpan) {
|
|
141
|
-
checkInitialized(authorization);
|
|
142
|
-
return service
|
|
845
|
+
internal_common.checkInitialized(authorization);
|
|
846
|
+
return service
|
|
143
847
|
.post("/passport/identify", {
|
|
144
848
|
identifier,
|
|
145
849
|
password,
|
|
@@ -147,41 +851,61 @@ function login(identifier, password, tokenLifeSpan) {
|
|
|
147
851
|
})
|
|
148
852
|
.then(response => response.token);
|
|
149
853
|
}
|
|
854
|
+
async function loginWithStrategy(id) {
|
|
855
|
+
internal_common.checkInitialized(authorization);
|
|
856
|
+
const { url, state } = await service.get(`/passport/strategy/${id}/url`);
|
|
857
|
+
const token = new Observable(observer => {
|
|
858
|
+
service
|
|
859
|
+
.post("/passport/identify", {
|
|
860
|
+
state
|
|
861
|
+
})
|
|
862
|
+
.then(({ token }) => {
|
|
863
|
+
observer.next(token);
|
|
864
|
+
observer.complete();
|
|
865
|
+
})
|
|
866
|
+
.catch(e => observer.error(e));
|
|
867
|
+
});
|
|
868
|
+
return {
|
|
869
|
+
url,
|
|
870
|
+
token
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
function getStrategies() {
|
|
874
|
+
return service.get("/passport/strategies");
|
|
875
|
+
}
|
|
150
876
|
function get(id) {
|
|
151
|
-
checkInitialized(authorization);
|
|
152
|
-
return service
|
|
877
|
+
internal_common.checkInitialized(authorization);
|
|
878
|
+
return service.get(`${identitySegment}/${id}`);
|
|
153
879
|
}
|
|
154
880
|
function getAll(queryParams = {}) {
|
|
155
|
-
checkInitialized(authorization);
|
|
156
|
-
return service
|
|
881
|
+
internal_common.checkInitialized(authorization);
|
|
882
|
+
return service.get(identitySegment, {
|
|
157
883
|
params: queryParams
|
|
158
884
|
});
|
|
159
885
|
}
|
|
160
|
-
function insert(identity) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
return insertedIdentity;
|
|
167
|
-
});
|
|
886
|
+
async function insert(identity) {
|
|
887
|
+
internal_common.checkInitialized(authorization);
|
|
888
|
+
const insertedIdentity = await service.post(identitySegment, identity);
|
|
889
|
+
return exports.policy.attach(insertedIdentity._id, identity.policies).then(policies => {
|
|
890
|
+
insertedIdentity.policies = policies;
|
|
891
|
+
return insertedIdentity;
|
|
168
892
|
});
|
|
169
893
|
}
|
|
170
894
|
function update(id, identity) {
|
|
171
|
-
checkInitialized(authorization);
|
|
172
|
-
return service
|
|
895
|
+
internal_common.checkInitialized(authorization);
|
|
896
|
+
return service.put(`${identitySegment}/${id}`, identity);
|
|
173
897
|
}
|
|
174
898
|
function remove(id) {
|
|
175
|
-
checkInitialized(authorization);
|
|
176
|
-
return service
|
|
899
|
+
internal_common.checkInitialized(authorization);
|
|
900
|
+
return service.delete(`${identitySegment}/${id}`);
|
|
177
901
|
}
|
|
178
902
|
(function (policy) {
|
|
179
903
|
function attach(identityId, policyIds = []) {
|
|
180
|
-
checkInitialized(authorization);
|
|
904
|
+
internal_common.checkInitialized(authorization);
|
|
181
905
|
const promises = [];
|
|
182
906
|
const attachedPolicies = new Set();
|
|
183
907
|
for (const policyId of policyIds) {
|
|
184
|
-
const promise = service
|
|
908
|
+
const promise = service
|
|
185
909
|
.put(`${identitySegment}/${identityId}/policy/${policyId}`, {})
|
|
186
910
|
.then(() => attachedPolicies.add(policyId))
|
|
187
911
|
.catch(e => {
|
|
@@ -194,11 +918,11 @@ function remove(id) {
|
|
|
194
918
|
}
|
|
195
919
|
policy.attach = attach;
|
|
196
920
|
function detach(identityId, policyIds = []) {
|
|
197
|
-
checkInitialized(authorization);
|
|
921
|
+
internal_common.checkInitialized(authorization);
|
|
198
922
|
const promises = [];
|
|
199
923
|
const detachedPolicies = new Set();
|
|
200
924
|
for (const policyId of policyIds) {
|
|
201
|
-
const promise = service
|
|
925
|
+
const promise = service
|
|
202
926
|
.delete(`${identitySegment}/${identityId}/policy/${policyId}`)
|
|
203
927
|
.then(() => detachedPolicies.add(policyId))
|
|
204
928
|
.catch(e => {
|
|
@@ -214,9 +938,11 @@ function remove(id) {
|
|
|
214
938
|
|
|
215
939
|
exports.get = get;
|
|
216
940
|
exports.getAll = getAll;
|
|
217
|
-
exports.
|
|
941
|
+
exports.getStrategies = getStrategies;
|
|
942
|
+
exports.initialize = initialize;
|
|
218
943
|
exports.insert = insert;
|
|
219
944
|
exports.login = login;
|
|
945
|
+
exports.loginWithStrategy = loginWithStrategy;
|
|
220
946
|
exports.remove = remove;
|
|
221
947
|
exports.update = update;
|
|
222
948
|
exports.verifyToken = verifyToken;
|