@lifeready/core 8.0.13 → 8.0.15
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 +118 -24
- 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/api/query-processor/query-processor.service.js +11 -1
- package/esm2015/lib/api/types/lr-graphql.types.js +6 -1
- package/esm2015/lib/auth/auth.service.js +6 -1
- package/esm2015/lib/life-ready.config.js +6 -3
- package/esm2015/lib/plan/plan.types.js +1 -1
- package/esm2015/lib/scenario/scenario.service.js +5 -5
- package/esm2015/lib/trusted-party/trusted-party.gql.private.js +3 -1
- package/esm2015/lib/trusted-party/trusted-party.service.js +56 -8
- package/esm2015/lib/trusted-party/trusted-party.types.js +1 -1
- package/fesm2015/lifeready-core.js +83 -10
- package/fesm2015/lifeready-core.js.map +1 -1
- package/lib/api/types/lr-graphql.types.d.ts +9 -0
- package/lib/auth/auth.service.d.ts +1 -0
- package/lib/life-ready.config.d.ts +2 -0
- package/lib/plan/plan.types.d.ts +1 -0
- package/lib/trusted-party/trusted-party.gql.private.d.ts +2 -1
- package/lib/trusted-party/trusted-party.service.d.ts +39 -14
- package/lib/trusted-party/trusted-party.types.d.ts +9 -2
- package/lifeready-core.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -1409,18 +1409,21 @@
|
|
|
1409
1409
|
var KC_CONFIG = new i0.InjectionToken('KC_CONFIG');
|
|
1410
1410
|
var RETRY_ERROR_CODES = [exports.KcErrorCode.CONCURRENT_ACCESS];
|
|
1411
1411
|
function httpOptions(auth, config) {
|
|
1412
|
-
var _a;
|
|
1412
|
+
var _a, _b;
|
|
1413
1413
|
return __awaiter(this, void 0, void 0, function () {
|
|
1414
|
-
var token, debugUsername;
|
|
1415
|
-
return __generator(this, function (
|
|
1416
|
-
switch (
|
|
1414
|
+
var token, debugUsername, debugRbacCacheMode;
|
|
1415
|
+
return __generator(this, function (_c) {
|
|
1416
|
+
switch (_c.label) {
|
|
1417
1417
|
case 0: return [4 /*yield*/, getAccessJwtToken(auth)];
|
|
1418
1418
|
case 1:
|
|
1419
|
-
token =
|
|
1419
|
+
token = _c.sent();
|
|
1420
1420
|
debugUsername = (_a = config.debug) === null || _a === void 0 ? void 0 : _a.username;
|
|
1421
|
+
debugRbacCacheMode = (_b = config.debug) === null || _b === void 0 ? void 0 : _b.rbacCacheMode;
|
|
1421
1422
|
return [2 /*return*/, {
|
|
1422
1423
|
withCredentials: true,
|
|
1423
|
-
headers: Object.assign(Object.assign({}, (token && { authorization: "Bearer " + token })), (debugUsername && { 'x-kc-dev-user': debugUsername })),
|
|
1424
|
+
headers: Object.assign(Object.assign(Object.assign({}, (token && { authorization: "Bearer " + token })), (debugUsername && { 'x-kc-dev-user': debugUsername })), (debugRbacCacheMode && {
|
|
1425
|
+
'x-kc-dev-rbac-cache-mode': debugRbacCacheMode,
|
|
1426
|
+
})),
|
|
1424
1427
|
}];
|
|
1425
1428
|
}
|
|
1426
1429
|
});
|
|
@@ -1441,15 +1444,15 @@
|
|
|
1441
1444
|
errorPolicy: 'all',
|
|
1442
1445
|
},
|
|
1443
1446
|
};
|
|
1444
|
-
var authLink = context.setContext(function (_,
|
|
1445
|
-
var headers =
|
|
1447
|
+
var authLink = context.setContext(function (_, _c) {
|
|
1448
|
+
var headers = _c.headers;
|
|
1446
1449
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
1447
1450
|
var options;
|
|
1448
|
-
return __generator(this, function (
|
|
1449
|
-
switch (
|
|
1451
|
+
return __generator(this, function (_c) {
|
|
1452
|
+
switch (_c.label) {
|
|
1450
1453
|
case 0: return [4 /*yield*/, httpOptions(auth, config)];
|
|
1451
1454
|
case 1:
|
|
1452
|
-
options =
|
|
1455
|
+
options = _c.sent();
|
|
1453
1456
|
return [2 /*return*/, Object.assign(Object.assign({}, options), { headers: Object.assign(Object.assign({}, headers), options.headers) })];
|
|
1454
1457
|
}
|
|
1455
1458
|
});
|
|
@@ -3099,6 +3102,16 @@
|
|
|
3099
3102
|
plainFieldName: 'plain',
|
|
3100
3103
|
}),
|
|
3101
3104
|
]));
|
|
3105
|
+
this.registerProcessor('DirectoryShareNode', common.series([
|
|
3106
|
+
common.makeJsonParseProcessor({
|
|
3107
|
+
plainFieldName: 'plainMeta',
|
|
3108
|
+
}),
|
|
3109
|
+
]));
|
|
3110
|
+
this.registerProcessor('FileShareNode', common.series([
|
|
3111
|
+
common.makeJsonParseProcessor({
|
|
3112
|
+
plainFieldName: 'plainMeta',
|
|
3113
|
+
}),
|
|
3114
|
+
]));
|
|
3102
3115
|
}
|
|
3103
3116
|
QueryProcessorService.prototype.processQuery = function (fields, options) {
|
|
3104
3117
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -3946,6 +3959,10 @@
|
|
|
3946
3959
|
LinkTypeField["SOFT"] = "SOFT";
|
|
3947
3960
|
LinkTypeField["REFERENCE"] = "REFERENCE";
|
|
3948
3961
|
})(exports.LinkTypeField || (exports.LinkTypeField = {}));
|
|
3962
|
+
(function (BillingPeriodField) {
|
|
3963
|
+
BillingPeriodField["MONTHLY"] = "MONTHLY";
|
|
3964
|
+
BillingPeriodField["ANNUAL"] = "ANNUAL";
|
|
3965
|
+
})(exports.BillingPeriodField || (exports.BillingPeriodField = {}));
|
|
3949
3966
|
(function (PlanStateField) {
|
|
3950
3967
|
PlanStateField["TRIALLING"] = "TRIALLING";
|
|
3951
3968
|
PlanStateField["ACTIVE"] = "ACTIVE";
|
|
@@ -6871,6 +6888,8 @@
|
|
|
6871
6888
|
// This will fail if debug is null. But when debug is null, this function
|
|
6872
6889
|
// should not be called.
|
|
6873
6890
|
this.kcConfig.debug.username = username;
|
|
6891
|
+
// Reset it so we don't get surprises.
|
|
6892
|
+
this.kcConfig.debug.rbacCacheMode = null;
|
|
6874
6893
|
// This mechanism only works in a browser session because it needs to set cookies etc.
|
|
6875
6894
|
// But it sets the last_login field for the users which we need in some tests.
|
|
6876
6895
|
return [4 /*yield*/, this.http
|
|
@@ -6940,6 +6959,9 @@
|
|
|
6940
6959
|
});
|
|
6941
6960
|
});
|
|
6942
6961
|
};
|
|
6962
|
+
AuthService.prototype.debugRetainRbacCache = function (b) {
|
|
6963
|
+
this.kcConfig.debug.rbacCacheMode = b ? 'retain' : null;
|
|
6964
|
+
};
|
|
6943
6965
|
return AuthService;
|
|
6944
6966
|
}(LrService));
|
|
6945
6967
|
exports.AuthService.CHALLENGE_TIMEOUT = 1000 * 60 * 5;
|
|
@@ -11050,7 +11072,7 @@
|
|
|
11050
11072
|
sharedCipherDataClearJson: existingDirectory.sharedCipherDataClearJson,
|
|
11051
11073
|
});
|
|
11052
11074
|
});
|
|
11053
|
-
// Fill in any missing update
|
|
11075
|
+
// Fill in any missing update files
|
|
11054
11076
|
mapEdges(existingReceiver.receiverItems.receiverFiles).forEach(function (existingFile) {
|
|
11055
11077
|
if (deleteFilesOptions.includes(existingFile.file.id)) {
|
|
11056
11078
|
return;
|
|
@@ -12119,8 +12141,8 @@
|
|
|
12119
12141
|
var templateObject_1$q, templateObject_2$k, templateObject_3$h, templateObject_4$d, templateObject_5$b, templateObject_6$6, templateObject_7$5, templateObject_8$5, templateObject_9$5, templateObject_10$2, templateObject_11$1, templateObject_12$1;
|
|
12120
12142
|
|
|
12121
12143
|
var TpCurrentUserSharedKeyQuery = gqlTyped(templateObject_1$r || (templateObject_1$r = __makeTemplateObject(["\nquery TpCurrentUserSharedKeyQuery($id: LrRelayIdInput!) {\n tp(id: $id){\n currentUserSharedKey {\n userSharedKey {\n sharedKey {\n id\n }\n mkSharedKey {\n id\n }\n mkPxk {\n id\n }\n mkReshareRequestCipher\n mkReshareRequestSent\n mkReshareResponseCipher\n mkReshareResponseSent\n }\n }\n }\n}\n"], ["\nquery TpCurrentUserSharedKeyQuery($id: LrRelayIdInput!) {\n tp(id: $id){\n currentUserSharedKey {\n userSharedKey {\n sharedKey {\n id\n }\n mkSharedKey {\n id\n }\n mkPxk {\n id\n }\n mkReshareRequestCipher\n mkReshareRequestSent\n mkReshareResponseCipher\n mkReshareResponseSent\n }\n }\n }\n}\n"])));
|
|
12122
|
-
var DirectoryShareQuery = gqlTyped(templateObject_2$l || (templateObject_2$l = __makeTemplateObject(["\nquery DirectoryShareQuery($id: LrRelayIdInput!) {\n directoryShare(id: $id) {\n item {\n id\n }\n tp {\n id\n }\n }\n}\n"], ["\nquery DirectoryShareQuery($id: LrRelayIdInput!) {\n directoryShare(id: $id) {\n item {\n id\n }\n tp {\n id\n }\n }\n}\n"])));
|
|
12123
|
-
var FileShareQuery = gqlTyped(templateObject_3$i || (templateObject_3$i = __makeTemplateObject(["\nquery FileShareItemIdQuery($id: LrRelayIdInput!) {\n fileShare(id: $id) {\n item {\n id\n }\n tp {\n id\n }\n }\n}\n"], ["\nquery FileShareItemIdQuery($id: LrRelayIdInput!) {\n fileShare(id: $id) {\n item {\n id\n }\n tp {\n id\n }\n }\n}\n"])));
|
|
12144
|
+
var DirectoryShareQuery = gqlTyped(templateObject_2$l || (templateObject_2$l = __makeTemplateObject(["\nquery DirectoryShareQuery($id: LrRelayIdInput!) {\n directoryShare(id: $id) {\n item {\n id\n }\n tp {\n id\n }\n shareType\n }\n}\n"], ["\nquery DirectoryShareQuery($id: LrRelayIdInput!) {\n directoryShare(id: $id) {\n item {\n id\n }\n tp {\n id\n }\n shareType\n }\n}\n"])));
|
|
12145
|
+
var FileShareQuery = gqlTyped(templateObject_3$i || (templateObject_3$i = __makeTemplateObject(["\nquery FileShareItemIdQuery($id: LrRelayIdInput!) {\n fileShare(id: $id) {\n item {\n id\n }\n tp {\n id\n }\n shareType\n }\n}\n"], ["\nquery FileShareItemIdQuery($id: LrRelayIdInput!) {\n fileShare(id: $id) {\n item {\n id\n }\n tp {\n id\n }\n shareType\n }\n}\n"])));
|
|
12124
12146
|
var templateObject_1$r, templateObject_2$l, templateObject_3$i;
|
|
12125
12147
|
|
|
12126
12148
|
exports.TrustedPartyService = /** @class */ (function (_super) {
|
|
@@ -12199,12 +12221,13 @@
|
|
|
12199
12221
|
};
|
|
12200
12222
|
TrustedPartyService.prototype.prepareCreateItemShareMutation = function (options) {
|
|
12201
12223
|
return __awaiter(this, void 0, void 0, function () {
|
|
12202
|
-
var itemId, itemKeyId, tpId, tpSharedKeyId, accessRole, isDirectory, shareType, itemKey, wrappingKey, wrappedItemKey;
|
|
12224
|
+
var itemId, itemKeyId, tpId, tpSharedKeyId, accessRole, isDirectory, shareType, plainMetaJson, plainMeta, itemKey, wrappingKey, wrappedItemKey;
|
|
12203
12225
|
var _this = this;
|
|
12204
12226
|
return __generator(this, function (_a) {
|
|
12205
12227
|
switch (_a.label) {
|
|
12206
12228
|
case 0:
|
|
12207
|
-
itemId = options.itemId, itemKeyId = options.itemKeyId, tpId = options.tpId, tpSharedKeyId = options.tpSharedKeyId, accessRole = options.accessRole, isDirectory = options.isDirectory, shareType = options.shareType;
|
|
12229
|
+
itemId = options.itemId, itemKeyId = options.itemKeyId, tpId = options.tpId, tpSharedKeyId = options.tpSharedKeyId, accessRole = options.accessRole, isDirectory = options.isDirectory, shareType = options.shareType, plainMetaJson = options.plainMetaJson;
|
|
12230
|
+
plainMeta = plainMetaJson && JSON.stringify(plainMetaJson);
|
|
12208
12231
|
if (accessRole == exports.AccessRoleChoice.DENY) {
|
|
12209
12232
|
if (itemKeyId || tpSharedKeyId) {
|
|
12210
12233
|
throw new KcBadArgumentException('If accessRole is AccessRoleChoice.DENY, must not specify any of itemId, itemKeyId, or tpSharedKeyId parameters');
|
|
@@ -12218,6 +12241,7 @@
|
|
|
12218
12241
|
wrappingKeyId: null,
|
|
12219
12242
|
wrappedItemKey: null,
|
|
12220
12243
|
shareType: shareType,
|
|
12244
|
+
plainMeta: plainMeta,
|
|
12221
12245
|
},
|
|
12222
12246
|
}];
|
|
12223
12247
|
}
|
|
@@ -12241,6 +12265,7 @@
|
|
|
12241
12265
|
wrappingKeyId: wrappingKey.id,
|
|
12242
12266
|
wrappedItemKey: wrappedItemKey,
|
|
12243
12267
|
shareType: shareType,
|
|
12268
|
+
plainMeta: plainMeta,
|
|
12244
12269
|
},
|
|
12245
12270
|
}];
|
|
12246
12271
|
}
|
|
@@ -12271,6 +12296,30 @@
|
|
|
12271
12296
|
});
|
|
12272
12297
|
});
|
|
12273
12298
|
};
|
|
12299
|
+
TrustedPartyService.prototype.updateDetachedDirectoryShare = function (options) {
|
|
12300
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
12301
|
+
return __generator(this, function (_a) {
|
|
12302
|
+
return [2 /*return*/, this.mutate(this.updateDetachedDirectoryShareMutation(options))];
|
|
12303
|
+
});
|
|
12304
|
+
});
|
|
12305
|
+
};
|
|
12306
|
+
TrustedPartyService.prototype.updateDetachedDirectoryShareMutation = function (options) {
|
|
12307
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
12308
|
+
var _a, _b;
|
|
12309
|
+
return __generator(this, function (_c) {
|
|
12310
|
+
switch (_c.label) {
|
|
12311
|
+
case 0:
|
|
12312
|
+
_a = LrMutation.bind;
|
|
12313
|
+
_b = {
|
|
12314
|
+
mutation: UpdateDirectoryShareMutation
|
|
12315
|
+
};
|
|
12316
|
+
return [4 /*yield*/, this.prepareUpdateDetachedItemShareMutation(options)];
|
|
12317
|
+
case 1: return [2 /*return*/, new (_a.apply(LrMutation, [void 0, (_b.variables = _c.sent(),
|
|
12318
|
+
_b)]))()];
|
|
12319
|
+
}
|
|
12320
|
+
});
|
|
12321
|
+
});
|
|
12322
|
+
};
|
|
12274
12323
|
TrustedPartyService.prototype.updateFileShare = function (options) {
|
|
12275
12324
|
return __awaiter(this, void 0, void 0, function () {
|
|
12276
12325
|
return __generator(this, function (_a) {
|
|
@@ -12295,6 +12344,30 @@
|
|
|
12295
12344
|
});
|
|
12296
12345
|
});
|
|
12297
12346
|
};
|
|
12347
|
+
TrustedPartyService.prototype.updateDetachedFileShare = function (options) {
|
|
12348
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
12349
|
+
return __generator(this, function (_a) {
|
|
12350
|
+
return [2 /*return*/, this.mutate(this.updateDetachedFileShareMutation(options))];
|
|
12351
|
+
});
|
|
12352
|
+
});
|
|
12353
|
+
};
|
|
12354
|
+
TrustedPartyService.prototype.updateDetachedFileShareMutation = function (options) {
|
|
12355
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
12356
|
+
var _a, _b;
|
|
12357
|
+
return __generator(this, function (_c) {
|
|
12358
|
+
switch (_c.label) {
|
|
12359
|
+
case 0:
|
|
12360
|
+
_a = LrMutation.bind;
|
|
12361
|
+
_b = {
|
|
12362
|
+
mutation: UpdateFileShareMutation
|
|
12363
|
+
};
|
|
12364
|
+
return [4 /*yield*/, this.prepareUpdateDetachedItemShareMutation(options)];
|
|
12365
|
+
case 1: return [2 /*return*/, new (_a.apply(LrMutation, [void 0, (_b.variables = _c.sent(),
|
|
12366
|
+
_b)]))()];
|
|
12367
|
+
}
|
|
12368
|
+
});
|
|
12369
|
+
});
|
|
12370
|
+
};
|
|
12298
12371
|
TrustedPartyService.prototype.getDirectoryShare = function (itemShareId) {
|
|
12299
12372
|
return this.lrGraphQL.query({
|
|
12300
12373
|
query: DirectoryShareQuery,
|
|
@@ -12313,13 +12386,15 @@
|
|
|
12313
12386
|
};
|
|
12314
12387
|
TrustedPartyService.prototype.prepareUpdateItemShareMutation = function (options) {
|
|
12315
12388
|
return __awaiter(this, void 0, void 0, function () {
|
|
12316
|
-
var itemShareId, accessRole, isDirectory, itemId, itemKeyId, tpId, tpSharedKeyId, itemShare, getItemShare, itemKey, wrappingKey, wrappedItemKey;
|
|
12389
|
+
var itemShareId, accessRole, isDirectory, itemId, itemKeyId, tpId, tpSharedKeyId, plainMetaJson, plainMeta, itemShare, getItemShare, itemKey, wrappingKey, wrappedItemKey;
|
|
12317
12390
|
var _this = this;
|
|
12318
12391
|
return __generator(this, function (_a) {
|
|
12319
12392
|
switch (_a.label) {
|
|
12320
12393
|
case 0:
|
|
12321
|
-
itemShareId = options.itemShareId, accessRole = options.accessRole, isDirectory = options.isDirectory, itemId = options.itemId, itemKeyId = options.itemKeyId, tpId = options.tpId, tpSharedKeyId = options.tpSharedKeyId;
|
|
12322
|
-
|
|
12394
|
+
itemShareId = options.itemShareId, accessRole = options.accessRole, isDirectory = options.isDirectory, itemId = options.itemId, itemKeyId = options.itemKeyId, tpId = options.tpId, tpSharedKeyId = options.tpSharedKeyId, plainMetaJson = options.plainMetaJson;
|
|
12395
|
+
plainMeta = plainMetaJson && JSON.stringify(plainMetaJson);
|
|
12396
|
+
// If not updating access role or updating to DENY role, then we don't need any key material.
|
|
12397
|
+
if (accessRole == null || accessRole == exports.AccessRoleChoice.DENY) {
|
|
12323
12398
|
if (itemId || itemKeyId || tpId || tpSharedKeyId) {
|
|
12324
12399
|
throw new KcBadArgumentException('If accessRole is AccessRoleChoice.DENY, must not specify any of itemId, itemKeyId, tpId, or tpSharedKeyId parameters');
|
|
12325
12400
|
}
|
|
@@ -12327,9 +12402,7 @@
|
|
|
12327
12402
|
input: {
|
|
12328
12403
|
id: itemShareId,
|
|
12329
12404
|
accessRole: accessRole,
|
|
12330
|
-
|
|
12331
|
-
wrappingKeyId: null,
|
|
12332
|
-
wrappedItemKey: null,
|
|
12405
|
+
plainMeta: plainMeta,
|
|
12333
12406
|
},
|
|
12334
12407
|
}];
|
|
12335
12408
|
}
|
|
@@ -12337,7 +12410,7 @@
|
|
|
12337
12410
|
return __generator(this, function (_a) {
|
|
12338
12411
|
switch (_a.label) {
|
|
12339
12412
|
case 0:
|
|
12340
|
-
if (!!itemShare) return [3 /*break*/,
|
|
12413
|
+
if (!!itemShare) return [3 /*break*/, 5];
|
|
12341
12414
|
if (!isDirectory) return [3 /*break*/, 2];
|
|
12342
12415
|
return [4 /*yield*/, this.getDirectoryShare(itemShareId)];
|
|
12343
12416
|
case 1:
|
|
@@ -12348,7 +12421,12 @@
|
|
|
12348
12421
|
case 3:
|
|
12349
12422
|
itemShare = (_a.sent()).fileShare;
|
|
12350
12423
|
_a.label = 4;
|
|
12351
|
-
case 4:
|
|
12424
|
+
case 4:
|
|
12425
|
+
if (itemShare.shareType == exports.ShareTypeChoice.DETACHED) {
|
|
12426
|
+
throw new KcBadArgumentException('Use updateDetachedDirectoryShare() or updateDetachedFileShare() to updated DETACHED shares.');
|
|
12427
|
+
}
|
|
12428
|
+
_a.label = 5;
|
|
12429
|
+
case 5: return [2 /*return*/, itemShare];
|
|
12352
12430
|
}
|
|
12353
12431
|
});
|
|
12354
12432
|
}); };
|
|
@@ -12407,12 +12485,28 @@
|
|
|
12407
12485
|
itemKeyId: itemKey.id,
|
|
12408
12486
|
wrappingKeyId: wrappingKey.id,
|
|
12409
12487
|
wrappedItemKey: wrappedItemKey,
|
|
12488
|
+
plainMeta: plainMeta,
|
|
12410
12489
|
},
|
|
12411
12490
|
}];
|
|
12412
12491
|
}
|
|
12413
12492
|
});
|
|
12414
12493
|
});
|
|
12415
12494
|
};
|
|
12495
|
+
TrustedPartyService.prototype.prepareUpdateDetachedItemShareMutation = function (options) {
|
|
12496
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
12497
|
+
var itemShareId, accessRole, plainMetaJson;
|
|
12498
|
+
return __generator(this, function (_a) {
|
|
12499
|
+
itemShareId = options.itemShareId, accessRole = options.accessRole, plainMetaJson = options.plainMetaJson;
|
|
12500
|
+
return [2 /*return*/, {
|
|
12501
|
+
input: {
|
|
12502
|
+
id: itemShareId,
|
|
12503
|
+
accessRole: accessRole,
|
|
12504
|
+
plainMeta: plainMetaJson && JSON.stringify(plainMetaJson),
|
|
12505
|
+
},
|
|
12506
|
+
}];
|
|
12507
|
+
});
|
|
12508
|
+
});
|
|
12509
|
+
};
|
|
12416
12510
|
TrustedPartyService.prototype.deleteDirectoryShare = function (id) {
|
|
12417
12511
|
return __awaiter(this, void 0, void 0, function () {
|
|
12418
12512
|
return __generator(this, function (_a) {
|