@eluvio/elv-client-js 3.1.75 → 3.1.79
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/README.md +2 -1
- package/dist/ElvClient-min.js +5 -5
- package/dist/ElvClient-node-min.js +9 -9
- package/dist/ElvFrameClient-min.js +4 -4
- package/dist/src/AuthorizationClient.js +24 -14
- package/dist/src/EthClient.js +21 -11
- package/dist/src/FrameClient.js +1 -1
- package/dist/src/client/ABRPublishing.js +30 -9
- package/dist/src/client/ContentAccess.js +36 -27
- package/dist/src/client/ContentManagement.js +404 -305
- package/dist/src/client/Files.js +72 -50
- package/package-lock.json +1 -1
- package/package.json +1 -1
- package/src/AuthorizationClient.js +4 -1
- package/src/EthClient.js +2 -0
- package/src/FrameClient.js +1 -0
- package/src/client/ABRPublishing.js +18 -3
- package/src/client/ContentAccess.js +5 -3
- package/src/client/ContentManagement.js +63 -1
- package/src/client/Files.js +4 -1
- package/testScripts/logo2.png +0 -0
- package/typeSpecs/DropEventSite.js +204 -39
- package/typeSpecs/NFTTemplate.js +11 -3
- package/utilities/MezzanineCreate.js +2 -2
|
@@ -241,7 +241,7 @@ function () {
|
|
|
241
241
|
}, {
|
|
242
242
|
key: "GenerateAuthorizationToken",
|
|
243
243
|
value: function GenerateAuthorizationToken(_ref3) {
|
|
244
|
-
var libraryId, objectId, versionHash, partHash, encryption, _ref3$update, update, _ref3$noAuth, noAuth, publicKey, owner, cap, token, _ref4, transactionHash, signature, multiSig;
|
|
244
|
+
var libraryId, objectId, versionHash, partHash, encryption, _ref3$update, update, _ref3$noAuth, noAuth, publicKey, owner, ownerCapKey, ownerCap, cap, token, _ref4, transactionHash, signature, multiSig;
|
|
245
245
|
|
|
246
246
|
return _regeneratorRuntime.async(function GenerateAuthorizationToken$(_context3) {
|
|
247
247
|
while (1) {
|
|
@@ -271,7 +271,7 @@ function () {
|
|
|
271
271
|
|
|
272
272
|
case 9:
|
|
273
273
|
if (!_context3.t0) {
|
|
274
|
-
_context3.next =
|
|
274
|
+
_context3.next = 22;
|
|
275
275
|
break;
|
|
276
276
|
}
|
|
277
277
|
|
|
@@ -282,34 +282,44 @@ function () {
|
|
|
282
282
|
|
|
283
283
|
case 12:
|
|
284
284
|
owner = _context3.sent;
|
|
285
|
+
ownerCapKey = "eluv.caps.iusr".concat(Utils.AddressToHash(this.client.signer.address));
|
|
286
|
+
_context3.next = 16;
|
|
287
|
+
return _regeneratorRuntime.awrap(client.ContentObjectMetadata({
|
|
288
|
+
libraryId: libraryId,
|
|
289
|
+
objectId: objectId,
|
|
290
|
+
metadataSubtree: ownerCapKey
|
|
291
|
+
}));
|
|
285
292
|
|
|
286
|
-
|
|
287
|
-
|
|
293
|
+
case 16:
|
|
294
|
+
ownerCap = _context3.sent;
|
|
295
|
+
|
|
296
|
+
if (!(!Utils.EqualAddress(owner, this.client.signer.address) && !ownerCap)) {
|
|
297
|
+
_context3.next = 22;
|
|
288
298
|
break;
|
|
289
299
|
}
|
|
290
300
|
|
|
291
|
-
_context3.next =
|
|
301
|
+
_context3.next = 20;
|
|
292
302
|
return _regeneratorRuntime.awrap(this.ReEncryptionConk({
|
|
293
303
|
libraryId: libraryId,
|
|
294
304
|
objectId: objectId
|
|
295
305
|
}));
|
|
296
306
|
|
|
297
|
-
case
|
|
307
|
+
case 20:
|
|
298
308
|
cap = _context3.sent;
|
|
299
309
|
publicKey = cap.public_key;
|
|
300
310
|
|
|
301
|
-
case
|
|
311
|
+
case 22:
|
|
302
312
|
token = {
|
|
303
313
|
qspace_id: this.contentSpaceId,
|
|
304
314
|
addr: Utils.FormatAddress(this.client.signer && this.client.signer.address || "")
|
|
305
315
|
};
|
|
306
316
|
|
|
307
317
|
if (this.noAuth || noAuth) {
|
|
308
|
-
_context3.next =
|
|
318
|
+
_context3.next = 29;
|
|
309
319
|
break;
|
|
310
320
|
}
|
|
311
321
|
|
|
312
|
-
_context3.next =
|
|
322
|
+
_context3.next = 26;
|
|
313
323
|
return _regeneratorRuntime.awrap(this.MakeAccessRequest({
|
|
314
324
|
libraryId: libraryId,
|
|
315
325
|
objectId: objectId,
|
|
@@ -320,7 +330,7 @@ function () {
|
|
|
320
330
|
noAuth: this.noAuth || noAuth
|
|
321
331
|
}));
|
|
322
332
|
|
|
323
|
-
case
|
|
333
|
+
case 26:
|
|
324
334
|
_ref4 = _context3.sent;
|
|
325
335
|
transactionHash = _ref4.transactionHash;
|
|
326
336
|
|
|
@@ -328,7 +338,7 @@ function () {
|
|
|
328
338
|
token.tx_id = transactionHash;
|
|
329
339
|
}
|
|
330
340
|
|
|
331
|
-
case
|
|
341
|
+
case 29:
|
|
332
342
|
if (libraryId) {
|
|
333
343
|
token.qlib_id = libraryId;
|
|
334
344
|
}
|
|
@@ -342,15 +352,15 @@ function () {
|
|
|
342
352
|
}
|
|
343
353
|
|
|
344
354
|
token = Utils.B64(JSON.stringify(token));
|
|
345
|
-
_context3.next =
|
|
355
|
+
_context3.next = 35;
|
|
346
356
|
return _regeneratorRuntime.awrap(this.Sign(Ethers.utils.keccak256(Ethers.utils.toUtf8Bytes(token))));
|
|
347
357
|
|
|
348
|
-
case
|
|
358
|
+
case 35:
|
|
349
359
|
signature = _context3.sent;
|
|
350
360
|
multiSig = Utils.FormatSignature(signature);
|
|
351
361
|
return _context3.abrupt("return", "".concat(token, ".").concat(Utils.B64(multiSig)));
|
|
352
362
|
|
|
353
|
-
case
|
|
363
|
+
case 38:
|
|
354
364
|
case "end":
|
|
355
365
|
return _context3.stop();
|
|
356
366
|
}
|
package/dist/src/EthClient.js
CHANGED
|
@@ -480,7 +480,7 @@ function () {
|
|
|
480
480
|
|
|
481
481
|
case 22:
|
|
482
482
|
if (success) {
|
|
483
|
-
_context6.next =
|
|
483
|
+
_context6.next = 49;
|
|
484
484
|
break;
|
|
485
485
|
}
|
|
486
486
|
|
|
@@ -491,7 +491,7 @@ function () {
|
|
|
491
491
|
case 26:
|
|
492
492
|
result = _context6.sent;
|
|
493
493
|
success = true;
|
|
494
|
-
_context6.next =
|
|
494
|
+
_context6.next = 47;
|
|
495
495
|
break;
|
|
496
496
|
|
|
497
497
|
case 30:
|
|
@@ -513,41 +513,51 @@ function () {
|
|
|
513
513
|
latestBlock = _context6.sent;
|
|
514
514
|
overrides.gasLimit = latestBlock.gasLimit;
|
|
515
515
|
overrides.gasPrice = overrides.gasPrice ? overrides.gasPrice * 1.50 : 8000000000;
|
|
516
|
-
_context6.next =
|
|
516
|
+
_context6.next = 47;
|
|
517
517
|
break;
|
|
518
518
|
|
|
519
519
|
case 40:
|
|
520
|
+
if (!(_context6.t0.code === "NONCE_EXPIRED" && _context6.t0.reason === "nonce has already been used")) {
|
|
521
|
+
_context6.next = 44;
|
|
522
|
+
break;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
this.Log("Retrying method call ".concat(methodName));
|
|
526
|
+
_context6.next = 47;
|
|
527
|
+
break;
|
|
528
|
+
|
|
529
|
+
case 44:
|
|
520
530
|
if ((_context6.t0.message || _context6.t0).includes("invalid response")) {
|
|
521
|
-
_context6.next =
|
|
531
|
+
_context6.next = 47;
|
|
522
532
|
break;
|
|
523
533
|
}
|
|
524
534
|
|
|
525
535
|
this.Log(_typeof(_context6.t0) === "object" ? JSON.stringify(_context6.t0, null, 2) : _context6.t0, true);
|
|
526
536
|
throw _context6.t0;
|
|
527
537
|
|
|
528
|
-
case
|
|
538
|
+
case 47:
|
|
529
539
|
_context6.next = 22;
|
|
530
540
|
break;
|
|
531
541
|
|
|
532
|
-
case
|
|
542
|
+
case 49:
|
|
533
543
|
return _context6.abrupt("return", result);
|
|
534
544
|
|
|
535
|
-
case
|
|
536
|
-
_context6.prev =
|
|
545
|
+
case 50:
|
|
546
|
+
_context6.prev = 50;
|
|
537
547
|
|
|
538
548
|
// Unlock if performing a transaction
|
|
539
549
|
if (!methodAbi || !methodAbi.constant) {
|
|
540
550
|
this.locked = false;
|
|
541
551
|
}
|
|
542
552
|
|
|
543
|
-
return _context6.finish(
|
|
553
|
+
return _context6.finish(50);
|
|
544
554
|
|
|
545
|
-
case
|
|
555
|
+
case 53:
|
|
546
556
|
case "end":
|
|
547
557
|
return _context6.stop();
|
|
548
558
|
}
|
|
549
559
|
}
|
|
550
|
-
}, null, this, [[20,,
|
|
560
|
+
}, null, this, [[20,, 50, 53], [23, 30]]);
|
|
551
561
|
}
|
|
552
562
|
}, {
|
|
553
563
|
key: "CallContractMethodAndWait",
|
package/dist/src/FrameClient.js
CHANGED
|
@@ -445,7 +445,7 @@ function () {
|
|
|
445
445
|
* @returns {Array<string>} - List of ElvClient methods available to a FrameClient
|
|
446
446
|
*/
|
|
447
447
|
value: function AllowedMethods() {
|
|
448
|
-
return ["AccessGroupManagers", "AccessGroupMembers", "AccessGroupOwner", "AccessInfo", "AccessRequest", "AccessType", "AddAccessGroupManager", "AddAccessGroupMember", "AddContentLibraryGroup", "AddContentObjectGroupPermission", "AddLibraryContentType", "AssetMetadata", "AvailableDRMs", "AvailableOfferings", "AwaitPending", "BitmovinPlayoutOptions", "BlockNumber", "CallBitcodeMethod", "CallContractMethod", "CallContractMethodAndWait", "ClearCache", "ClearStaticToken", "Collection", "CollectionTransactions", "ConfigUrl", "ContentLibraries", "ContentLibrary", "ContentLibraryGroupPermissions", "ContentLibraryOwner", "ContentObject", "ContentObjectAccessComplete", "ContentObjectGraph", "ContentObjectGroupPermissions", "ContentObjectImageUrl", "ContentObjectLibraryId", "ContentObjectMetadata", "ContentObjectOwner", "ContentObjectTenantId", "ContentObjectVersions", "ContentObjects", "ContentPart", "ContentParts", "ContentSpaceId", "ContentType", "ContentTypeOwner", "ContentTypes", "ContractAbi", "ContractEvents", "ContractMetadata", "ContractName", "CopyContentObject", "CreateABRMezzanine", "CreateAccessGroup", "CreateAndFinalizeContentObject", "CreateContentLibrary", "CreateContentObject", "CreateContentType", "CreateEncryptionConk", "CreateFileDirectories", "CreateFileUploadJob", "CreateLinks", "CreateNTPInstance", "CreatePart", "CreateProductionMaster", "CreateSignedToken", "CurrentAccountAddress", "CustomContractAddress", "Decrypt", "DecryptECIES", "DefaultKMSAddress", "DeleteAccessGroup", "DeleteContentLibrary", "DeleteContentObject", "DeleteContentVersion", "DeleteFiles", "DeleteMetadata", "DeleteNTPInstance", "DeletePart", "DeployContract", "Download", "DownloadEncrypted", "DownloadFile", "DownloadPart", "EditAndFinalizeContentObject", "EditContentObject", "Encrypt", "EncryptECIES", "EncryptionConk", "Events", "ExtractEventFromLogs", "ExtractValueFromEvent", "FabricUrl", "FileUrl", "FinalizeABRMezzanine", "FinalizeContentObject", "FinalizePart", "FinalizeStateChannelAccess", "FinalizeUploadJob", "FormatContractArguments", "GenerateStateChannelToken", "GetBalance", "InitializeAuthPolicy", "IssueNTPCode", "IssueSignedNTPCode", "LatestVersionHash", "LibraryContentTypes", "LinkAccessGroupToOauth", "LinkData", "LinkTarget", "LinkUrl", "ListAccessGroups", "ListFiles", "ListNTPInstances", "LROStatus", "MergeContractMetadata", "MergeMetadata", "MetadataAuth", "MintNFT", "NetworkInfo", "NodeId", "Nodes", "NTPInstance", "Permission", "PlayoutOptions", "PlayoutPathResolution", "ProduceMetadataLinks", "Proofs", "PublicRep", "PublishContentVersion", "QParts", "RedeemCode", "RemoveAccessGroupManager", "RemoveAccessGroupMember", "RemoveContentObjectGroupPermission", "RemoveContentLibraryGroup", "RemoveLibraryContentType", "Rep", "ReplaceContractMetadata", "ReplaceMetadata", "Request", "ResetRegion", "SendFunds", "SetAccessCharge", "SetAuth", "SetAuthContext", "SetAuthPolicy", "SetContentLibraryImage", "SetContentObjectImage", "SetCustomContentContract", "SetGroupPermission", "SetNodes", "SetOauthToken", "SetPolicyAuthorization", "SetSignerFromOauthToken", "SetStaticToken", "SetVisibility", "SetPermission", "StartABRMezzanineJobs", "SuspendNTPInstance", "UnlinkAccessGroupFromOauth", "UpdateContentObjectGraph", "UpdateNTPInstance", "UploadFileData", "UploadFiles", "UploadFilesFromS3", "UploadJobStatus", "UploadPart", "UploadPartChunk", "UploadStatus", "UseRegion", "VerifyContentObject", "Visibility"];
|
|
448
|
+
return ["AccessGroupManagers", "AccessGroupMembers", "AccessGroupOwner", "AccessInfo", "AccessRequest", "AccessType", "AddAccessGroupManager", "AddAccessGroupMember", "AddContentLibraryGroup", "AddContentObjectGroupPermission", "AddLibraryContentType", "AssetMetadata", "AvailableDRMs", "AvailableOfferings", "AwaitPending", "BitmovinPlayoutOptions", "BlockNumber", "CallBitcodeMethod", "CallContractMethod", "CallContractMethodAndWait", "ClearCache", "ClearStaticToken", "Collection", "CollectionTransactions", "ConfigUrl", "ContentLibraries", "ContentLibrary", "ContentLibraryGroupPermissions", "ContentLibraryOwner", "ContentObject", "ContentObjectAccessComplete", "ContentObjectGraph", "ContentObjectGroupPermissions", "ContentObjectImageUrl", "ContentObjectLibraryId", "ContentObjectMetadata", "ContentObjectOwner", "ContentObjectTenantId", "ContentObjectVersions", "ContentObjects", "ContentPart", "ContentParts", "ContentSpaceId", "ContentType", "ContentTypeOwner", "ContentTypes", "ContractAbi", "ContractEvents", "ContractMetadata", "ContractName", "CopyContentObject", "CreateABRMezzanine", "CreateAccessGroup", "CreateAndFinalizeContentObject", "CreateContentLibrary", "CreateContentObject", "CreateContentType", "CreateEncryptionConk", "CreateFileDirectories", "CreateFileUploadJob", "CreateLinks", "CreateNTPInstance", "CreateNonOwnerCap", "CreatePart", "CreateProductionMaster", "CreateSignedToken", "CurrentAccountAddress", "CustomContractAddress", "Decrypt", "DecryptECIES", "DefaultKMSAddress", "DeleteAccessGroup", "DeleteContentLibrary", "DeleteContentObject", "DeleteContentVersion", "DeleteFiles", "DeleteMetadata", "DeleteNTPInstance", "DeletePart", "DeployContract", "Download", "DownloadEncrypted", "DownloadFile", "DownloadPart", "EditAndFinalizeContentObject", "EditContentObject", "Encrypt", "EncryptECIES", "EncryptionConk", "Events", "ExtractEventFromLogs", "ExtractValueFromEvent", "FabricUrl", "FileUrl", "FinalizeABRMezzanine", "FinalizeContentObject", "FinalizePart", "FinalizeStateChannelAccess", "FinalizeUploadJob", "FormatContractArguments", "GenerateStateChannelToken", "GetBalance", "InitializeAuthPolicy", "IssueNTPCode", "IssueSignedNTPCode", "LatestVersionHash", "LibraryContentTypes", "LinkAccessGroupToOauth", "LinkData", "LinkTarget", "LinkUrl", "ListAccessGroups", "ListFiles", "ListNTPInstances", "LROStatus", "MergeContractMetadata", "MergeMetadata", "MetadataAuth", "MintNFT", "NetworkInfo", "NodeId", "Nodes", "NTPInstance", "Permission", "PlayoutOptions", "PlayoutPathResolution", "ProduceMetadataLinks", "Proofs", "PublicRep", "PublishContentVersion", "QParts", "RedeemCode", "RemoveAccessGroupManager", "RemoveAccessGroupMember", "RemoveContentObjectGroupPermission", "RemoveContentLibraryGroup", "RemoveLibraryContentType", "Rep", "ReplaceContractMetadata", "ReplaceMetadata", "Request", "ResetRegion", "SendFunds", "SetAccessCharge", "SetAuth", "SetAuthContext", "SetAuthPolicy", "SetContentLibraryImage", "SetContentObjectImage", "SetCustomContentContract", "SetGroupPermission", "SetNodes", "SetOauthToken", "SetPolicyAuthorization", "SetSignerFromOauthToken", "SetStaticToken", "SetVisibility", "SetPermission", "StartABRMezzanineJobs", "SuspendNTPInstance", "UnlinkAccessGroupFromOauth", "UpdateContentObjectGraph", "UpdateNTPInstance", "UploadFileData", "UploadFiles", "UploadFilesFromS3", "UploadJobStatus", "UploadPart", "UploadPartChunk", "UploadStatus", "UseRegion", "VerifyContentObject", "Visibility"];
|
|
449
449
|
}
|
|
450
450
|
}, {
|
|
451
451
|
key: "AllowedUserProfileMethods",
|
|
@@ -15,6 +15,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
15
15
|
*
|
|
16
16
|
* @module ElvClient/ABRPublishing
|
|
17
17
|
*/
|
|
18
|
+
var R = require("ramda");
|
|
19
|
+
|
|
18
20
|
var UrlJoin = require("url-join");
|
|
19
21
|
|
|
20
22
|
var HttpClient = require("../HttpClient");
|
|
@@ -344,7 +346,7 @@ exports.CreateProductionMaster = function _callee(_ref) {
|
|
|
344
346
|
|
|
345
347
|
|
|
346
348
|
exports.CreateABRMezzanine = function _callee2(_ref4) {
|
|
347
|
-
var libraryId, objectId, type, name, description, metadata, masterVersionHash, abrProfile, _ref4$variant, variant, _ref4$offeringKey, offeringKey, existingMez, options, id, write_token, editResponse, createResponse, masterName, authorizationTokens, headers, body, storeClear, _ref5, logs, errors, warnings, finalizeResponse;
|
|
349
|
+
var libraryId, objectId, type, name, description, metadata, masterVersionHash, abrProfile, _ref4$variant, variant, _ref4$offeringKey, offeringKey, existingMez, options, id, write_token, editResponse, createResponse, masterName, authorizationTokens, headers, body, storeClear, _ref5, logs, errors, warnings, existingMetadata, finalizeResponse;
|
|
348
350
|
|
|
349
351
|
return _regeneratorRuntime.async(function _callee2$(_context2) {
|
|
350
352
|
while (1) {
|
|
@@ -541,7 +543,6 @@ exports.CreateABRMezzanine = function _callee2(_ref4) {
|
|
|
541
543
|
"/": "./rep/playout/".concat(offeringKey, "/options.json")
|
|
542
544
|
})
|
|
543
545
|
}, metadata["public"].asset_metadata);
|
|
544
|
-
metadata.elv_created_at = new Date().getTime();
|
|
545
546
|
|
|
546
547
|
if (name || !existingMez) {
|
|
547
548
|
metadata.name = name || "".concat(masterName, " Mezzanine");
|
|
@@ -551,18 +552,38 @@ exports.CreateABRMezzanine = function _callee2(_ref4) {
|
|
|
551
552
|
if (description || !existingMez) {
|
|
552
553
|
metadata.description = description || "";
|
|
553
554
|
metadata["public"].description = description || "";
|
|
554
|
-
}
|
|
555
|
+
} // retrieve existing metadata to merge with updated metadata
|
|
555
556
|
|
|
556
|
-
|
|
557
|
-
|
|
557
|
+
|
|
558
|
+
_context2.next = 71;
|
|
559
|
+
return _regeneratorRuntime.awrap(this.ContentObjectMetadata({
|
|
560
|
+
libraryId: libraryId,
|
|
561
|
+
objectId: id,
|
|
562
|
+
writeToken: write_token
|
|
563
|
+
}));
|
|
564
|
+
|
|
565
|
+
case 71:
|
|
566
|
+
existingMetadata = _context2.sent;
|
|
567
|
+
// newer metadata values replace existing metadata, unless both new and old values are objects,
|
|
568
|
+
// in which case their keys are merged recursively
|
|
569
|
+
metadata = R.mergeDeepRight(existingMetadata, metadata);
|
|
570
|
+
|
|
571
|
+
if (!existingMez) {
|
|
572
|
+
// set creation date
|
|
573
|
+
metadata.elv_created_at = new Date().getTime();
|
|
574
|
+
} // write metadata to mezzanine object
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
_context2.next = 76;
|
|
578
|
+
return _regeneratorRuntime.awrap(this.ReplaceMetadata({
|
|
558
579
|
libraryId: libraryId,
|
|
559
580
|
objectId: id,
|
|
560
581
|
writeToken: write_token,
|
|
561
582
|
metadata: metadata
|
|
562
583
|
}));
|
|
563
584
|
|
|
564
|
-
case
|
|
565
|
-
_context2.next =
|
|
585
|
+
case 76:
|
|
586
|
+
_context2.next = 78;
|
|
566
587
|
return _regeneratorRuntime.awrap(this.FinalizeContentObject({
|
|
567
588
|
libraryId: libraryId,
|
|
568
589
|
objectId: id,
|
|
@@ -570,7 +591,7 @@ exports.CreateABRMezzanine = function _callee2(_ref4) {
|
|
|
570
591
|
commitMessage: "Create ABR mezzanine"
|
|
571
592
|
}));
|
|
572
593
|
|
|
573
|
-
case
|
|
594
|
+
case 78:
|
|
574
595
|
finalizeResponse = _context2.sent;
|
|
575
596
|
return _context2.abrupt("return", _objectSpread({
|
|
576
597
|
logs: logs || [],
|
|
@@ -578,7 +599,7 @@ exports.CreateABRMezzanine = function _callee2(_ref4) {
|
|
|
578
599
|
errors: errors || []
|
|
579
600
|
}, finalizeResponse));
|
|
580
601
|
|
|
581
|
-
case
|
|
602
|
+
case 80:
|
|
582
603
|
case "end":
|
|
583
604
|
return _context2.stop();
|
|
584
605
|
}
|
|
@@ -944,9 +944,8 @@ exports.LibraryContentTypes = function _callee13(_ref8) {
|
|
|
944
944
|
* @param {object=} filterOptions - Pagination, sorting and filtering options
|
|
945
945
|
* @param {number=} filterOptions.start - Start index for pagination
|
|
946
946
|
* @param {number=} filterOptions.limit - Max number of objects to return
|
|
947
|
-
* @param {string=} filterOptions.cacheId - Cache ID corresponding a previous query
|
|
948
947
|
* @param {(Array<string> | string)=} filterOptions.sort - Sort by the specified key(s)
|
|
949
|
-
* @param {boolean=} filterOptions.sortDesc
|
|
948
|
+
* @param {boolean=} filterOptions.sortDesc - Sort in descending order
|
|
950
949
|
* @param {(Array<string> | string)=} filterOptions.select - Include only the specified metadata keys (all must start with /public)
|
|
951
950
|
* @param {(Array<object> | object)=} filterOptions.filter - Filter objects by metadata
|
|
952
951
|
* @param {string=} filterOptions.filter.key - Key to filter on (must start with /public)
|
|
@@ -4259,7 +4258,7 @@ exports.CreateEncryptionConk = function _callee46(_ref39) {
|
|
|
4259
4258
|
|
|
4260
4259
|
|
|
4261
4260
|
exports.EncryptionConk = function _callee47(_ref40) {
|
|
4262
|
-
var libraryId, objectId, versionHash, writeToken, _ref40$download, download, owner, capKey, existingUserCap;
|
|
4261
|
+
var libraryId, objectId, versionHash, writeToken, _ref40$download, download, owner, ownerCapKey, ownerCap, capKey, existingUserCap;
|
|
4263
4262
|
|
|
4264
4263
|
return _regeneratorRuntime.async(function _callee47$(_context47) {
|
|
4265
4264
|
while (1) {
|
|
@@ -4287,46 +4286,56 @@ exports.EncryptionConk = function _callee47(_ref40) {
|
|
|
4287
4286
|
|
|
4288
4287
|
case 6:
|
|
4289
4288
|
owner = _context47.sent;
|
|
4289
|
+
ownerCapKey = "eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address));
|
|
4290
|
+
_context47.next = 10;
|
|
4291
|
+
return _regeneratorRuntime.awrap(this.ContentObjectMetadata({
|
|
4292
|
+
libraryId: libraryId,
|
|
4293
|
+
objectId: objectId,
|
|
4294
|
+
metadataSubtree: ownerCapKey
|
|
4295
|
+
}));
|
|
4290
4296
|
|
|
4291
|
-
|
|
4292
|
-
|
|
4297
|
+
case 10:
|
|
4298
|
+
ownerCap = _context47.sent;
|
|
4299
|
+
|
|
4300
|
+
if (!(!this.utils.EqualAddress(owner, this.signer.address) && !ownerCap)) {
|
|
4301
|
+
_context47.next = 21;
|
|
4293
4302
|
break;
|
|
4294
4303
|
}
|
|
4295
4304
|
|
|
4296
4305
|
if (!download) {
|
|
4297
|
-
_context47.next =
|
|
4306
|
+
_context47.next = 18;
|
|
4298
4307
|
break;
|
|
4299
4308
|
}
|
|
4300
4309
|
|
|
4301
|
-
_context47.next =
|
|
4310
|
+
_context47.next = 15;
|
|
4302
4311
|
return _regeneratorRuntime.awrap(this.authClient.ReEncryptionConk({
|
|
4303
4312
|
libraryId: libraryId,
|
|
4304
4313
|
objectId: objectId,
|
|
4305
4314
|
versionHash: versionHash
|
|
4306
4315
|
}));
|
|
4307
4316
|
|
|
4308
|
-
case
|
|
4317
|
+
case 15:
|
|
4309
4318
|
return _context47.abrupt("return", _context47.sent);
|
|
4310
4319
|
|
|
4311
|
-
case
|
|
4312
|
-
_context47.next =
|
|
4320
|
+
case 18:
|
|
4321
|
+
_context47.next = 20;
|
|
4313
4322
|
return _regeneratorRuntime.awrap(this.authClient.EncryptionConk({
|
|
4314
4323
|
libraryId: libraryId,
|
|
4315
4324
|
objectId: objectId,
|
|
4316
4325
|
versionHash: versionHash
|
|
4317
4326
|
}));
|
|
4318
4327
|
|
|
4319
|
-
case
|
|
4328
|
+
case 20:
|
|
4320
4329
|
return _context47.abrupt("return", _context47.sent);
|
|
4321
4330
|
|
|
4322
|
-
case
|
|
4331
|
+
case 21:
|
|
4323
4332
|
if (this.encryptionConks[objectId]) {
|
|
4324
|
-
_context47.next =
|
|
4333
|
+
_context47.next = 38;
|
|
4325
4334
|
break;
|
|
4326
4335
|
}
|
|
4327
4336
|
|
|
4328
4337
|
capKey = "eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address));
|
|
4329
|
-
_context47.next =
|
|
4338
|
+
_context47.next = 25;
|
|
4330
4339
|
return _regeneratorRuntime.awrap(this.ContentObjectMetadata({
|
|
4331
4340
|
libraryId: libraryId,
|
|
4332
4341
|
objectId: objectId,
|
|
@@ -4336,29 +4345,29 @@ exports.EncryptionConk = function _callee47(_ref40) {
|
|
|
4336
4345
|
metadataSubtree: capKey
|
|
4337
4346
|
}));
|
|
4338
4347
|
|
|
4339
|
-
case
|
|
4348
|
+
case 25:
|
|
4340
4349
|
existingUserCap = _context47.sent;
|
|
4341
4350
|
|
|
4342
4351
|
if (!existingUserCap) {
|
|
4343
|
-
_context47.next =
|
|
4352
|
+
_context47.next = 32;
|
|
4344
4353
|
break;
|
|
4345
4354
|
}
|
|
4346
4355
|
|
|
4347
|
-
_context47.next =
|
|
4356
|
+
_context47.next = 29;
|
|
4348
4357
|
return _regeneratorRuntime.awrap(this.Crypto.DecryptCap(existingUserCap, this.signer.signingKey.privateKey));
|
|
4349
4358
|
|
|
4350
|
-
case
|
|
4359
|
+
case 29:
|
|
4351
4360
|
this.encryptionConks[objectId] = _context47.sent;
|
|
4352
|
-
_context47.next =
|
|
4361
|
+
_context47.next = 38;
|
|
4353
4362
|
break;
|
|
4354
4363
|
|
|
4355
|
-
case
|
|
4364
|
+
case 32:
|
|
4356
4365
|
if (!writeToken) {
|
|
4357
|
-
_context47.next =
|
|
4366
|
+
_context47.next = 37;
|
|
4358
4367
|
break;
|
|
4359
4368
|
}
|
|
4360
4369
|
|
|
4361
|
-
_context47.next =
|
|
4370
|
+
_context47.next = 35;
|
|
4362
4371
|
return _regeneratorRuntime.awrap(this.CreateEncryptionConk({
|
|
4363
4372
|
libraryId: libraryId,
|
|
4364
4373
|
objectId: objectId,
|
|
@@ -4367,17 +4376,17 @@ exports.EncryptionConk = function _callee47(_ref40) {
|
|
|
4367
4376
|
createKMSConk: false
|
|
4368
4377
|
}));
|
|
4369
4378
|
|
|
4370
|
-
case
|
|
4371
|
-
_context47.next =
|
|
4379
|
+
case 35:
|
|
4380
|
+
_context47.next = 38;
|
|
4372
4381
|
break;
|
|
4373
4382
|
|
|
4374
|
-
case
|
|
4383
|
+
case 37:
|
|
4375
4384
|
throw "No encryption conk present for " + objectId;
|
|
4376
4385
|
|
|
4377
|
-
case
|
|
4386
|
+
case 38:
|
|
4378
4387
|
return _context47.abrupt("return", this.encryptionConks[objectId]);
|
|
4379
4388
|
|
|
4380
|
-
case
|
|
4389
|
+
case 39:
|
|
4381
4390
|
case "end":
|
|
4382
4391
|
return _context47.stop();
|
|
4383
4392
|
}
|