@lifeready/core 8.0.11 → 8.0.12
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/lifeready-core.umd.js +44 -20
- package/bundles/lifeready-core.umd.js.map +1 -1
- package/bundles/lifeready-core.umd.min.js +1 -1
- package/bundles/lifeready-core.umd.min.js.map +1 -1
- package/esm2015/lib/_common/exceptions.js +4 -1
- package/esm2015/lib/_common/index.js +3 -0
- package/esm2015/lib/_common/kc-lodash.js +11 -0
- package/esm2015/lib/api/lr-graphql/lr-graphql.service.js +2 -2
- package/esm2015/lib/api/lr-graphql/lr-merged-mutation.js +2 -2
- package/esm2015/lib/api/lr-graphql/lr-mutation.js +2 -2
- package/esm2015/lib/api/types/lr-graphql.types.js +1 -1
- package/esm2015/lib/auth/auth.service.js +12 -5
- package/esm2015/lib/key/key-graph.service.js +5 -5
- package/esm2015/lib/profile/profile-details.service.js +5 -5
- package/esm2015/lib/scenario/scenario.service.js +3 -1
- package/esm2015/lib/scenario/scenario.types.js +1 -1
- package/fesm2015/lifeready-core.js +32 -16
- package/fesm2015/lifeready-core.js.map +1 -1
- package/lib/_common/exceptions.d.ts +1 -0
- package/lib/_common/index.d.ts +2 -0
- package/lib/_common/kc-lodash.d.ts +5 -0
- package/lib/api/types/lr-graphql.types.d.ts +1 -0
- package/lib/scenario/scenario.service.d.ts +3 -0
- package/lib/scenario/scenario.types.d.ts +2 -0
- package/lifeready-core.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('apollo-angular'), require('@dagrejs/graphlib'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@lifeready/core', ['exports', '@angular/core', 'apollo-angular', '@dagrejs/graphlib', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.lifeready = global.lifeready || {}, global.lifeready.core = {}), global.ng.core, global['apollo-angular'], global['@dagrejs/graphlib'], global
|
|
5
|
-
}(this, (function (exports, i0, i1, graphlib,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('apollo-angular'), require('@dagrejs/graphlib'), require('node-jose'), require('@aws-amplify/auth/lib-esm/Auth'), require('graphql-tag'), require('moment'), require('lodash/cloneDeep'), require('lodash/isEqual'), require('lodash/keyBy'), require('lodash/omit'), require('@apollo/client/core'), require('@apollo/client/link/context'), require('@apollo/client/link/retry'), require('ngx-cookie-service'), require('graphql/language/printer'), require('@angular/common/http'), require('@aws-amplify/core'), require('@ng-idle/core'), require('@ng-idle/keepalive'), require('slip39'), require('@aws-amplify/auth')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@lifeready/core', ['exports', '@angular/core', 'apollo-angular', '@dagrejs/graphlib', 'node-jose', '@aws-amplify/auth/lib-esm/Auth', 'graphql-tag', 'moment', 'lodash/cloneDeep', 'lodash/isEqual', 'lodash/keyBy', 'lodash/omit', '@apollo/client/core', '@apollo/client/link/context', '@apollo/client/link/retry', 'ngx-cookie-service', 'graphql/language/printer', '@angular/common/http', '@aws-amplify/core', '@ng-idle/core', '@ng-idle/keepalive', 'slip39', '@aws-amplify/auth'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.lifeready = global.lifeready || {}, global.lifeready.core = {}), global.ng.core, global['apollo-angular'], global['@dagrejs/graphlib'], global['node-jose'], global['@aws-amplify/auth/lib-esm/Auth'], global['graphql-tag'], global.moment, global['lodash/cloneDeep'], global['lodash/isEqual'], null, global['lodash/omit'], global['@apollo/client/core'], global['@apollo/client/link/context'], global['@apollo/client/link/retry'], global['ngx-cookie-service'], global['graphql/language/printer'], global.ng.common.http, global['@aws-amplify/core'], global['@ng-idle/core'], global['@ng-idle/keepalive'], global.slip39, global['@aws-amplify/auth']));
|
|
5
|
+
}(this, (function (exports, i0, i1, graphlib, nodeJose, i4, gql, moment_, lodash$1, lodash$2, keyBy, lodash, core, context, retry, i2, gqlPrinter, i2$1, core$1, i3, i4$1, slip39, Auth) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -27,9 +27,11 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
var graphlib__default = /*#__PURE__*/_interopDefaultLegacy(graphlib);
|
|
30
|
-
var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
31
30
|
var gql__default = /*#__PURE__*/_interopDefaultLegacy(gql);
|
|
32
31
|
var moment___namespace = /*#__PURE__*/_interopNamespace(moment_);
|
|
32
|
+
var lodash__default$1 = /*#__PURE__*/_interopDefaultLegacy(lodash$1);
|
|
33
|
+
var lodash__default$2 = /*#__PURE__*/_interopDefaultLegacy(lodash$2);
|
|
34
|
+
var lodash__default = /*#__PURE__*/_interopDefaultLegacy(lodash);
|
|
33
35
|
var Auth__default = /*#__PURE__*/_interopDefaultLegacy(Auth);
|
|
34
36
|
|
|
35
37
|
/*! *****************************************************************************
|
|
@@ -357,6 +359,8 @@
|
|
|
357
359
|
PayloadType["UINT_8_ARRAY"] = "UINT_8_ARRAY";
|
|
358
360
|
})(PayloadType || (PayloadType = {}));
|
|
359
361
|
|
|
362
|
+
// This file is in the "lr-lodash" directory so that we can use the barrel file
|
|
363
|
+
|
|
360
364
|
function handleApolloError(errors) {
|
|
361
365
|
if (!errors || !errors.length)
|
|
362
366
|
return;
|
|
@@ -364,6 +368,7 @@
|
|
|
364
368
|
return new KcError({
|
|
365
369
|
code: x.extensions && x.extensions.code,
|
|
366
370
|
source: x.extensions && x.extensions.source,
|
|
371
|
+
data: x.extensions && lodash__default['default'](x.extensions, ['code', 'source']),
|
|
367
372
|
message: x.message,
|
|
368
373
|
debug: {
|
|
369
374
|
locations: x.locations,
|
|
@@ -391,6 +396,7 @@
|
|
|
391
396
|
this._type = 'KcError';
|
|
392
397
|
this.code = options.code;
|
|
393
398
|
this.source = options.source;
|
|
399
|
+
this.data = options.data;
|
|
394
400
|
this.message = options.message;
|
|
395
401
|
this.debug = options.debug;
|
|
396
402
|
}
|
|
@@ -1954,7 +1960,7 @@
|
|
|
1954
1960
|
}
|
|
1955
1961
|
var node = {
|
|
1956
1962
|
type: KeyGraphNodeType.Key,
|
|
1957
|
-
data:
|
|
1963
|
+
data: lodash__default$1['default'](key),
|
|
1958
1964
|
};
|
|
1959
1965
|
this.graph.setNode(key.id, node);
|
|
1960
1966
|
}
|
|
@@ -1977,7 +1983,7 @@
|
|
|
1977
1983
|
}
|
|
1978
1984
|
var edge = {
|
|
1979
1985
|
type: KeyGraphEdgeType.KeyLink,
|
|
1980
|
-
data:
|
|
1986
|
+
data: lodash__default$1['default'](keyLink),
|
|
1981
1987
|
};
|
|
1982
1988
|
// Edge goes from wrapping key to wrapped key.
|
|
1983
1989
|
this.graph.setEdge(keyLink.wrappingKeyId, keyLink.keyId, edge);
|
|
@@ -2001,7 +2007,7 @@
|
|
|
2001
2007
|
}
|
|
2002
2008
|
var edge = {
|
|
2003
2009
|
type: KeyGraphEdgeType.PassKeyLink,
|
|
2004
|
-
data:
|
|
2010
|
+
data: lodash__default$1['default'](passKeyLink),
|
|
2005
2011
|
};
|
|
2006
2012
|
// Edge goes from wrapping key to wrapped key.
|
|
2007
2013
|
this.graph.setEdge(passKeyLink.passKeyId, passKeyLink.keyId, edge);
|
|
@@ -3359,7 +3365,7 @@
|
|
|
3359
3365
|
*/
|
|
3360
3366
|
LrMutation.prototype.select = function (fragments) {
|
|
3361
3367
|
// Don't touch the original
|
|
3362
|
-
var mutationDoc =
|
|
3368
|
+
var mutationDoc = lodash__default$1['default'](this.mutation);
|
|
3363
3369
|
var mutationNode = getMutation(mutationDoc);
|
|
3364
3370
|
var fragmentMap = {};
|
|
3365
3371
|
getFragments(fragments).forEach(function (fragment) {
|
|
@@ -3595,7 +3601,7 @@
|
|
|
3595
3601
|
var fragments = getFragments(mutation);
|
|
3596
3602
|
mergedFragments = __spread(mergedFragments, _this.renameFragmentDefinitions(fragments, prefix));
|
|
3597
3603
|
});
|
|
3598
|
-
var mergedMutation =
|
|
3604
|
+
var mergedMutation = lodash__default$1['default'](lrMergedMutationDoc);
|
|
3599
3605
|
var mutationNode = getMutation(mergedMutation);
|
|
3600
3606
|
// Add in the mutation selections
|
|
3601
3607
|
mutationNode.selectionSet.selections = selections;
|
|
@@ -3635,7 +3641,7 @@
|
|
|
3635
3641
|
switch (_a.label) {
|
|
3636
3642
|
case 0:
|
|
3637
3643
|
// Make copies to avoid side effect.
|
|
3638
|
-
options =
|
|
3644
|
+
options = lodash__default$1['default'](options);
|
|
3639
3645
|
includeKeyGraph = this.isIncludeKeyGraph(options.includeKeyGraph);
|
|
3640
3646
|
if (includeKeyGraph) {
|
|
3641
3647
|
operation = getQuery(options.query);
|
|
@@ -3695,7 +3701,7 @@
|
|
|
3695
3701
|
switch (_a.label) {
|
|
3696
3702
|
case 0:
|
|
3697
3703
|
// Make copies to avoid side effect.
|
|
3698
|
-
options = Object.assign(Object.assign({}, options), { mutation:
|
|
3704
|
+
options = Object.assign(Object.assign({}, options), { mutation: lodash__default$1['default'](options.mutation) });
|
|
3699
3705
|
includeKeyGraph = this.isIncludeKeyGraph(options.includeKeyGraph);
|
|
3700
3706
|
if (includeKeyGraph) {
|
|
3701
3707
|
operation = getMutation(options.mutation);
|
|
@@ -3729,7 +3735,7 @@
|
|
|
3729
3735
|
});
|
|
3730
3736
|
};
|
|
3731
3737
|
LrGraphQLService.prototype.statsSnapshot = function () {
|
|
3732
|
-
return
|
|
3738
|
+
return lodash__default$1['default'](this.stats);
|
|
3733
3739
|
};
|
|
3734
3740
|
LrGraphQLService.prototype.addKeys = function (response) {
|
|
3735
3741
|
if (response.data.keyGraph) {
|
|
@@ -6858,10 +6864,26 @@
|
|
|
6858
6864
|
// Debug utilities
|
|
6859
6865
|
// ------------------------------------------------------
|
|
6860
6866
|
AuthService.prototype.debugLogin = function (username, password) {
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6867
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6868
|
+
return __generator(this, function (_b) {
|
|
6869
|
+
switch (_b.label) {
|
|
6870
|
+
case 0:
|
|
6871
|
+
// This will fail if debug is null. But when debug is null, this function
|
|
6872
|
+
// should not be called.
|
|
6873
|
+
this.kcConfig.debug.username = username;
|
|
6874
|
+
// This mechanism only works in a browser session because it needs to set cookies etc.
|
|
6875
|
+
// But it sets the last_login field for the users which we need in some tests.
|
|
6876
|
+
return [4 /*yield*/, this.http
|
|
6877
|
+
.get(this.kcConfig.authUrl + "debug_only/users/login/?username=" + encodeURIComponent(username))
|
|
6878
|
+
.toPromise()];
|
|
6879
|
+
case 1:
|
|
6880
|
+
// This mechanism only works in a browser session because it needs to set cookies etc.
|
|
6881
|
+
// But it sets the last_login field for the users which we need in some tests.
|
|
6882
|
+
_b.sent();
|
|
6883
|
+
return [2 /*return*/, this.debugLoadUser(password)];
|
|
6884
|
+
}
|
|
6885
|
+
});
|
|
6886
|
+
});
|
|
6865
6887
|
};
|
|
6866
6888
|
AuthService.prototype.debugLoadUser = function (password) {
|
|
6867
6889
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -9921,7 +9943,7 @@
|
|
|
9921
9943
|
oldValue: oldValue.value,
|
|
9922
9944
|
});
|
|
9923
9945
|
}
|
|
9924
|
-
else if (!
|
|
9946
|
+
else if (!lodash__default$2['default'](newValue.value, oldValue.value)) {
|
|
9925
9947
|
changes.push({
|
|
9926
9948
|
field: field,
|
|
9927
9949
|
id: oldValue.id,
|
|
@@ -9988,7 +10010,7 @@
|
|
|
9988
10010
|
break;
|
|
9989
10011
|
default: {
|
|
9990
10012
|
var value = details[change.field];
|
|
9991
|
-
if (
|
|
10013
|
+
if (lodash__default$2['default'](value, change.oldValue)) {
|
|
9992
10014
|
hasChanged = true;
|
|
9993
10015
|
details[change.field] = change.newValue;
|
|
9994
10016
|
}
|
|
@@ -10024,7 +10046,7 @@
|
|
|
10024
10046
|
property = property || { value: field, hasMultiple: false };
|
|
10025
10047
|
property.values = property.values || [];
|
|
10026
10048
|
if (property.values.length === 0 ||
|
|
10027
|
-
property.values.every(function (x) { return !
|
|
10049
|
+
property.values.every(function (x) { return !lodash__default$2['default'](field, x.value); })) {
|
|
10028
10050
|
property.values.push({
|
|
10029
10051
|
id: label + "-" + new Date().getTime(),
|
|
10030
10052
|
label: label,
|
|
@@ -10762,6 +10784,7 @@
|
|
|
10762
10784
|
createClaimants = _b.sent();
|
|
10763
10785
|
return [2 /*return*/, {
|
|
10764
10786
|
enabled: options.enabled,
|
|
10787
|
+
inactiveSeconds: options.inactiveSeconds,
|
|
10765
10788
|
createAssembly: createAssembly,
|
|
10766
10789
|
createReceivers: createReceivers,
|
|
10767
10790
|
createClaimants: createClaimants,
|
|
@@ -10864,6 +10887,7 @@
|
|
|
10864
10887
|
return [2 /*return*/, {
|
|
10865
10888
|
scenarioId: options.scenarioId,
|
|
10866
10889
|
enabled: options.enabled,
|
|
10890
|
+
inactiveSeconds: options.inactiveSeconds,
|
|
10867
10891
|
updateAssembly: updateAssembly,
|
|
10868
10892
|
createReceivers: createReceivers,
|
|
10869
10893
|
updateReceivers: updateReceivers,
|