@eluvio/elv-client-js 4.0.42 → 4.0.43
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/ElvClient-min.js +10 -17
- package/dist/ElvClient-node-min.js +12 -19
- package/dist/ElvFrameClient-min.js +10 -17
- package/dist/ElvWalletClient-min.js +10 -17
- package/dist/ElvWalletClient-node-min.js +12 -19
- package/dist/src/Crypto.js +11 -5
- package/package.json +1 -1
- package/src/ElvClient.js +4 -0
- package/src/FrameClient.js +2 -0
- package/src/client/ABRPublishing.js +2 -2
- package/src/client/ContentManagement.js +3 -3
- package/src/client/Files.js +23 -0
package/dist/src/Crypto.js
CHANGED
|
@@ -13,19 +13,25 @@ if (typeof crypto === "undefined") {
|
|
|
13
13
|
};
|
|
14
14
|
globalThis.crypto = _crypto;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
let ElvCrypto;
|
|
19
|
+
switch(Utils.Platform()) {
|
|
18
20
|
case Utils.PLATFORM_REACT_NATIVE:
|
|
19
|
-
|
|
21
|
+
ElvCrypto = require("@eluvio/crypto/dist/elv-crypto.bundle.externals").default;
|
|
20
22
|
break;
|
|
21
23
|
case Utils.PLATFORM_WEB:
|
|
22
|
-
|
|
24
|
+
ElvCrypto = require("@eluvio/crypto/dist/elv-crypto.bundle.externals").default;
|
|
23
25
|
break;
|
|
24
26
|
default:
|
|
25
|
-
|
|
27
|
+
ElvCrypto = require("@eluvio/crypto/dist/elv-crypto.bundle.node").default;
|
|
26
28
|
break;
|
|
27
29
|
}
|
|
28
30
|
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
var _ElvCrypto = require("@eluvio/crypto");
|
|
34
|
+
|
|
29
35
|
/**
|
|
30
36
|
* @namespace
|
|
31
37
|
* @description This namespace contains cryptographic helper methods to encrypt and decrypt
|
package/package.json
CHANGED
package/src/ElvClient.js
CHANGED
package/src/FrameClient.js
CHANGED
|
@@ -428,6 +428,7 @@ class FrameClient {
|
|
|
428
428
|
"MergeMetadata",
|
|
429
429
|
"MetadataAuth",
|
|
430
430
|
"MintNFT",
|
|
431
|
+
"MoveFiles",
|
|
431
432
|
"NetworkInfo",
|
|
432
433
|
"NodeId",
|
|
433
434
|
"Nodes",
|
|
@@ -440,6 +441,7 @@ class FrameClient {
|
|
|
440
441
|
"PublicRep",
|
|
441
442
|
"PublishContentVersion",
|
|
442
443
|
"QParts",
|
|
444
|
+
"RecordWriteToken",
|
|
443
445
|
"RedeemCode",
|
|
444
446
|
"RemoveAccessGroupManager",
|
|
445
447
|
"RemoveAccessGroupMember",
|
|
@@ -623,7 +623,7 @@ exports.LROStatus = async function({libraryId, objectId}) {
|
|
|
623
623
|
|
|
624
624
|
const lroDraft = await this.LRODraftInfo({libraryId, objectId});
|
|
625
625
|
|
|
626
|
-
this.
|
|
626
|
+
this.RecordWriteToken({writeToken: lroDraft.write_token, fabricNodeUrl: lroDraft.node});
|
|
627
627
|
|
|
628
628
|
return await this.ContentObjectMetadata({
|
|
629
629
|
libraryId,
|
|
@@ -652,7 +652,7 @@ exports.FinalizeABRMezzanine = async function({libraryId, objectId, preFinalizeF
|
|
|
652
652
|
const lroDraft = await this.LRODraftInfo({libraryId, objectId});
|
|
653
653
|
|
|
654
654
|
// tell http client what node to contact for this write token
|
|
655
|
-
this.
|
|
655
|
+
this.RecordWriteToken({writeToken: lroDraft.write_token, fabricNodeUrl: lroDraft.node});
|
|
656
656
|
|
|
657
657
|
const lastJobOfferingsInfo = await this.ContentObjectMetadata({
|
|
658
658
|
libraryId,
|
|
@@ -187,7 +187,7 @@ exports.CreateContentType = async function({name, metadata={}, bitcode}) {
|
|
|
187
187
|
const createResponse = await this.utils.ResponseToJson(rawCreateResponse);
|
|
188
188
|
|
|
189
189
|
// Record the node used in creating this write token
|
|
190
|
-
this.
|
|
190
|
+
this.RecordWriteToken({writeToken: createResponse.write_token, fabricNodeUrl: nodeUrl});
|
|
191
191
|
|
|
192
192
|
await this.ReplaceMetadata({
|
|
193
193
|
libraryId: this.contentSpaceLibraryId,
|
|
@@ -611,7 +611,7 @@ exports.CreateContentObject = async function({libraryId, objectId, options={}})
|
|
|
611
611
|
const createResponse = await this.utils.ResponseToJson(rawCreateResponse);
|
|
612
612
|
|
|
613
613
|
// Record the node used in creating this write token
|
|
614
|
-
this.
|
|
614
|
+
this.RecordWriteToken({writeToken: createResponse.write_token, fabricNodeUrl: nodeUrl});
|
|
615
615
|
|
|
616
616
|
createResponse.writeToken = createResponse.write_token;
|
|
617
617
|
createResponse.objectId = createResponse.id;
|
|
@@ -782,7 +782,7 @@ exports.EditContentObject = async function({libraryId, objectId, options={}}) {
|
|
|
782
782
|
const editResponse = await this.utils.ResponseToJson(rawEditResponse);
|
|
783
783
|
|
|
784
784
|
// Record the node used in creating this write token
|
|
785
|
-
this.
|
|
785
|
+
this.RecordWriteToken({writeToken: editResponse.write_token, fabricNodeUrl: nodeUrl});
|
|
786
786
|
|
|
787
787
|
editResponse.writeToken = editResponse.write_token;
|
|
788
788
|
editResponse.objectId = editResponse.id;
|
package/src/client/Files.js
CHANGED
|
@@ -603,6 +603,29 @@ exports.CreateFileDirectories = async function({libraryId, objectId, writeToken,
|
|
|
603
603
|
await this.CreateFileUploadJob({libraryId, objectId, writeToken, ops});
|
|
604
604
|
};
|
|
605
605
|
|
|
606
|
+
/**
|
|
607
|
+
* Move or rename the specified list of files/directories
|
|
608
|
+
*
|
|
609
|
+
* @memberof module:ElvClient/Files+Parts
|
|
610
|
+
* @methodGroup Files
|
|
611
|
+
* @namedParams
|
|
612
|
+
* @param {string} libraryId - ID of the library
|
|
613
|
+
* @param {string} objectId - ID of the object
|
|
614
|
+
* @param {string} writeToken - Write token of the draft
|
|
615
|
+
* @param {Array<string>} filePaths - List of file paths to move. Format: ```[ { "path": "original/path", to: "new/path" } ]```
|
|
616
|
+
*/
|
|
617
|
+
exports.MoveFiles = async function({libraryId, objectId, writeToken, filePaths}) {
|
|
618
|
+
ValidateParameters({libraryId, objectId});
|
|
619
|
+
ValidateWriteToken(writeToken);
|
|
620
|
+
|
|
621
|
+
this.Log(`Moving Files: ${libraryId} ${objectId} ${writeToken}`);
|
|
622
|
+
this.Log(filePaths);
|
|
623
|
+
|
|
624
|
+
const ops = filePaths.map(({path, to}) => ({op: "move", copy_move_source_path: path, path: to}));
|
|
625
|
+
|
|
626
|
+
await this.CreateFileUploadJob({libraryId, objectId, writeToken, ops});
|
|
627
|
+
};
|
|
628
|
+
|
|
606
629
|
/**
|
|
607
630
|
* Delete the specified list of files/directories
|
|
608
631
|
*
|