@eluvio/elv-client-js 4.2.12 → 4.2.14
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 +1 -1
- package/dist/ElvClient-node-min.js +1 -1
- package/dist/ElvFrameClient-min.js +1 -1
- package/dist/ElvPermissionsClient-min.js +1 -1
- package/dist/ElvWalletClient-min.js +1 -1
- package/dist/ElvWalletClient-node-min.js +1 -1
- package/dist/src/ElvClient.js +21 -19
- package/dist/src/FrameClient.js +1 -1
- package/dist/src/RemoteSigner.js +24 -18
- package/dist/src/client/ABRPublishing.js +1 -1
- package/dist/src/client/ContentAccess.js +30 -29
- package/dist/src/client/Contracts.js +291 -140
- package/dist/src/walletClient/index.js +5 -4
- package/package.json +3 -2
- package/src/ElvClient.js +2 -1
- package/src/FrameClient.js +3 -0
- package/src/LogMessage.js +1 -1
- package/src/RemoteSigner.js +17 -3
- package/src/client/ABRPublishing.js +1 -1
- package/src/client/ContentAccess.js +17 -14
- package/src/client/Contracts.js +88 -7
- package/src/walletClient/index.js +15 -4
- package/dist/src/ContentObjectVerification.js +0 -281
package/dist/src/ElvClient.js
CHANGED
|
@@ -826,39 +826,41 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
826
826
|
key: "SetRemoteSigner",
|
|
827
827
|
value: function () {
|
|
828
828
|
var _SetRemoteSigner = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref12) {
|
|
829
|
-
var idToken, authToken, tenantId, extraData, signerURIs, unsignedPublicAuth, signer;
|
|
829
|
+
var idToken, userIdCode, authToken, tenantId, extraData, signerURIs, unsignedPublicAuth, signer;
|
|
830
830
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
831
831
|
while (1) switch (_context8.prev = _context8.next) {
|
|
832
832
|
case 0:
|
|
833
|
-
idToken = _ref12.idToken, authToken = _ref12.authToken, tenantId = _ref12.tenantId, extraData = _ref12.extraData, signerURIs = _ref12.signerURIs, unsignedPublicAuth = _ref12.unsignedPublicAuth;
|
|
833
|
+
idToken = _ref12.idToken, userIdCode = _ref12.userIdCode, authToken = _ref12.authToken, tenantId = _ref12.tenantId, extraData = _ref12.extraData, signerURIs = _ref12.signerURIs, unsignedPublicAuth = _ref12.unsignedPublicAuth;
|
|
834
834
|
_context8.t0 = RemoteSigner;
|
|
835
835
|
_context8.t1 = signerURIs || this.authServiceURIs;
|
|
836
836
|
_context8.t2 = idToken;
|
|
837
|
-
_context8.t3 =
|
|
838
|
-
_context8.t4 =
|
|
839
|
-
_context8.
|
|
837
|
+
_context8.t3 = userIdCode;
|
|
838
|
+
_context8.t4 = authToken;
|
|
839
|
+
_context8.t5 = tenantId;
|
|
840
|
+
_context8.next = 9;
|
|
840
841
|
return this.ethClient.Provider();
|
|
841
|
-
case
|
|
842
|
-
_context8.
|
|
843
|
-
_context8.
|
|
844
|
-
_context8.
|
|
845
|
-
_context8.
|
|
842
|
+
case 9:
|
|
843
|
+
_context8.t6 = _context8.sent;
|
|
844
|
+
_context8.t7 = extraData;
|
|
845
|
+
_context8.t8 = unsignedPublicAuth;
|
|
846
|
+
_context8.t9 = {
|
|
846
847
|
signerURIs: _context8.t1,
|
|
847
848
|
idToken: _context8.t2,
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
849
|
+
userIdCode: _context8.t3,
|
|
850
|
+
authToken: _context8.t4,
|
|
851
|
+
tenantId: _context8.t5,
|
|
852
|
+
provider: _context8.t6,
|
|
853
|
+
extraData: _context8.t7,
|
|
854
|
+
unsignedPublicAuth: _context8.t8
|
|
853
855
|
};
|
|
854
|
-
signer = new _context8.t0(_context8.
|
|
855
|
-
_context8.next =
|
|
856
|
+
signer = new _context8.t0(_context8.t9);
|
|
857
|
+
_context8.next = 16;
|
|
856
858
|
return signer.Initialize();
|
|
857
|
-
case
|
|
859
|
+
case 16:
|
|
858
860
|
this.SetSigner({
|
|
859
861
|
signer: signer
|
|
860
862
|
});
|
|
861
|
-
case
|
|
863
|
+
case 17:
|
|
862
864
|
case "end":
|
|
863
865
|
return _context8.stop();
|
|
864
866
|
}
|
package/dist/src/FrameClient.js
CHANGED
|
@@ -449,7 +449,7 @@ var FrameClient = /*#__PURE__*/function () {
|
|
|
449
449
|
}, {
|
|
450
450
|
key: "AllowedMethods",
|
|
451
451
|
value: function AllowedMethods() {
|
|
452
|
-
return ["AccessGroupManagers", "AccessGroupMembers", "AccessGroupOwner", "AccessInfo", "AccessRequest", "AccessType", "AddAccessGroupManager", "AddAccessGroupMember", "AddContentLibraryGroup", "AddContentObjectGroupPermission", "AddLibraryContentType", "AssetMetadata", "AuditContentObject", "AuditStream", "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", "ContractInfo", "ContractMetadata", "ContractName", "CopyContentObject", "CreateABRMezzanine", "CreateAccessGroup", "CreateAndFinalizeContentObject", "CreateAuthorizationToken", "CreateContentLibrary", "CreateContentObject", "CreateContentType", "CreateEncryptionConk", "CreateFabricToken", "CreateFileDirectories", "CreateFileUploadJob", "CreateLinks", "CreateNTPInstance", "CreateNonOwnerCap", "CreatePart", "CreateProductionMaster", "CreateShare", "CreateSignedMessageJSON", "CreateSignedToken", "CreateStaticToken", "CurrentAccountAddress", "CustomContractAddress", "DecodeSignedMessageJSON", "Decrypt", "DecryptECIES", "DefaultKMSAddress", "DeleteAccessGroup", "DeleteContentLibrary", "DeleteContentObject", "DeleteContentVersion", "DeleteFiles", "DeleteMetadata", "DeleteNTPInstance", "DeletePart", "DeleteWriteToken", "DeployContract", "Download", "DownloadEncrypted", "DownloadFile", "DownloadPart", "EditAndFinalizeContentObject", "EditContentObject", "EmbedUrl", "Encrypt", "EncryptECIES", "EncryptionConk", "Events", "ExtractEventFromLogs", "ExtractValueFromEvent", "FabricUrl", "FileUrl", "FinalizeABRMezzanine", "FinalizeContentObject", "FinalizePart", "FinalizeStateChannelAccess", "FinalizeUploadJob", "FormatContractArguments", "GenerateStateChannelToken", "GenerateSignedLinkToken", "GetBalance", "GlobalUrl", "InitializeAuthPolicy", "IssueNTPCode", "IssueSignedNTPCode", "LatestVersionHash", "LibraryContentTypes", "LinkAccessGroupToOauth", "LinkData", "LinkTarget", "LinkUrl", "ListAccessGroups", "ListFiles", "ListNTPInstances", "LRODraftInfo", "LROStatus", "MakeAuthServiceRequest", "MakeFileServiceRequest", "MergeContractMetadata", "MergeMetadata", "MetadataAuth", "MintNFT", "MoveFiles", "NetworkInfo", "NodeId", "Nodes", "NTPInstance", "ObjectCleanup", "Permission", "PlayoutOptions", "PlayoutPathResolution", "ProduceMetadataLinks", "Proofs", "PublicRep", "PublishContentVersion", "QParts", "RecordWriteToken", "RedeemCode", "RedeemShareToken", "RemoveAccessGroupManager", "RemoveAccessGroupMember", "RemoveContentObjectGroupPermission", "RemoveContentLibraryGroup", "RemoveLibraryContentType", "Rep", "ReplaceContractMetadata", "ReplaceMetadata", "Request", "ResetRegion", "ResetTenantId", "RevokeShare", "SendFunds", "SetAccessCharge", "SetAuth", "SetAuthContext", "SetAuthPolicy", "SetContentLibraryImage", "SetContentObjectImage", "SetCustomContentContract", "SetGroupPermission", "SetNodes", "SetOauthToken", "SetPolicyAuthorization", "SetSignerFromOauthToken", "SetStaticToken", "SetTenantContractId", "SetTenantId", "SetVisibility", "SetPermission", "ShareInfo", "Shares", "SpaceNodes", "StartABRMezzanineJobs", "StreamAddWatermark", "StreamConfig", "StreamCopyToVod", "StreamCreate", "StreamInitialize", "StreamInsertion", "StreamListUrls", "StreamRemoveWatermark", "StreamSetOfferingAndDRM", "StreamStatus", "StreamStartOrStopOrReset", "StreamStopSession", "SuspendNTPInstance", "TenantContractId", "TenantId", "UnlinkAccessGroupFromOauth", "UpdateContentObjectGraph", "UpdateNTPInstance", "UpdateShare", "UploadFileData", "UploadFilesFromS3", "UploadJobStatus", "UploadPart", "UploadPartChunk", "UploadStatus", "UseRegion", "Visibility", "WriteTokenNodeUrlLocal", "WriteTokenNodeUrlNetwork"];
|
|
452
|
+
return ["AccessGroupManagers", "AccessGroupMembers", "AccessGroupOwner", "AccessInfo", "AccessRequest", "AccessType", "AddAccessGroupManager", "AddAccessGroupMember", "AddContentLibraryGroup", "AddContentObjectGroupPermission", "AddLibraryContentType", "AssetMetadata", "AuditContentObject", "AuditStream", "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", "ContractInfo", "ContractMetadata", "ContractName", "CopyContentObject", "CreateABRMezzanine", "CreateAccessGroup", "CreateAndFinalizeContentObject", "CreateAuthorizationToken", "CreateContentLibrary", "CreateContentObject", "CreateContentType", "CreateEncryptionConk", "CreateFabricToken", "CreateFileDirectories", "CreateFileUploadJob", "CreateLinks", "CreateNTPInstance", "CreateNonOwnerCap", "CreatePart", "CreateProductionMaster", "CreateShare", "CreateSignedMessageJSON", "CreateSignedToken", "CreateStaticToken", "CurrentAccountAddress", "CustomContractAddress", "DecodeSignedMessageJSON", "Decrypt", "DecryptECIES", "DefaultKMSAddress", "DeleteAccessGroup", "DeleteContentLibrary", "DeleteContentObject", "DeleteContentVersion", "DeleteFiles", "DeleteMetadata", "DeleteNTPInstance", "DeletePart", "DeleteWriteToken", "DeployContract", "Download", "DownloadEncrypted", "DownloadFile", "DownloadPart", "EditAndFinalizeContentObject", "EditContentObject", "EmbedUrl", "Encrypt", "EncryptECIES", "EncryptionConk", "Events", "ExtractEventFromLogs", "ExtractValueFromEvent", "FabricUrl", "FileUrl", "FinalizeABRMezzanine", "FinalizeContentObject", "FinalizePart", "FinalizeStateChannelAccess", "FinalizeUploadJob", "FormatContractArguments", "GenerateStateChannelToken", "GenerateSignedLinkToken", "GetBalance", "GlobalUrl", "InitializeAuthPolicy", "IssueNTPCode", "IssueSignedNTPCode", "LatestVersionHash", "LibraryContentTypes", "LinkAccessGroupToOauth", "LinkData", "LinkTarget", "LinkUrl", "ListAccessGroups", "ListFiles", "ListNTPInstances", "LRODraftInfo", "LROStatus", "MakeAuthServiceRequest", "MakeFileServiceRequest", "MergeContractMetadata", "MergeMetadata", "MetadataAuth", "MintNFT", "MoveFiles", "NetworkInfo", "NodeId", "Nodes", "NTPInstance", "ObjectCleanup", "Permission", "PlayoutOptions", "PlayoutPathResolution", "ProduceMetadataLinks", "Proofs", "PublicRep", "PublishContentVersion", "QParts", "RecordWriteToken", "RedeemCode", "RedeemShareToken", "RemoveAccessGroupManager", "RemoveAccessGroupMember", "RemoveContentObjectGroupPermission", "RemoveContentLibraryGroup", "RemoveLibraryContentType", "Rep", "ReplaceContractMetadata", "ReplaceMetadata", "Request", "ResetRegion", "ResetTenantId", "RevokeShare", "SendFunds", "SetAccessCharge", "SetAuth", "SetAuthContext", "SetAuthPolicy", "SetContentLibraryImage", "SetContentObjectImage", "SetCustomContentContract", "SetGroupPermission", "SetNodes", "SetOauthToken", "SetPolicyAuthorization", "SetSignerFromOauthToken", "SetStaticToken", "SetTenantContractId", "SetTenantId", "TenantAdminGroup", "ContentAdminGroup", "TenantUsersGroup", "SetVisibility", "SetPermission", "ShareInfo", "Shares", "SpaceNodes", "StartABRMezzanineJobs", "StreamAddWatermark", "StreamConfig", "StreamCopyToVod", "StreamCreate", "StreamInitialize", "StreamInsertion", "StreamListUrls", "StreamRemoveWatermark", "StreamSetOfferingAndDRM", "StreamStatus", "StreamStartOrStopOrReset", "StreamStopSession", "SuspendNTPInstance", "TenantContractId", "TenantId", "UnlinkAccessGroupFromOauth", "UpdateContentObjectGraph", "UpdateNTPInstance", "UpdateShare", "UploadFileData", "UploadFilesFromS3", "UploadJobStatus", "UploadPart", "UploadPartChunk", "UploadStatus", "UseRegion", "Visibility", "WriteTokenNodeUrlLocal", "WriteTokenNodeUrlNetwork"];
|
|
453
453
|
}
|
|
454
454
|
}, {
|
|
455
455
|
key: "AllowedUserProfileMethods",
|
package/dist/src/RemoteSigner.js
CHANGED
|
@@ -21,6 +21,7 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
21
21
|
var _this;
|
|
22
22
|
var signerURIs = _ref.signerURIs,
|
|
23
23
|
idToken = _ref.idToken,
|
|
24
|
+
userIdCode = _ref.userIdCode,
|
|
24
25
|
authToken = _ref.authToken,
|
|
25
26
|
tenantId = _ref.tenantId,
|
|
26
27
|
provider = _ref.provider,
|
|
@@ -36,6 +37,7 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
36
37
|
uris: signerURIs
|
|
37
38
|
});
|
|
38
39
|
_this.idToken = idToken;
|
|
40
|
+
_this.userIdCode = userIdCode;
|
|
39
41
|
_this.tenantId = tenantId;
|
|
40
42
|
_this.authToken = authToken;
|
|
41
43
|
_this.extraLoginData = extraData || {};
|
|
@@ -47,29 +49,33 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
47
49
|
key: "Initialize",
|
|
48
50
|
value: function () {
|
|
49
51
|
var _Initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
50
|
-
var _yield$Utils$Response, addr, eth, token, keys, address;
|
|
52
|
+
var body, _yield$Utils$Response, addr, eth, token, keys, address;
|
|
51
53
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
52
54
|
while (1) switch (_context.prev = _context.next) {
|
|
53
55
|
case 0:
|
|
54
56
|
if (this.authToken) {
|
|
55
|
-
_context.next =
|
|
57
|
+
_context.next = 13;
|
|
56
58
|
break;
|
|
57
59
|
}
|
|
58
|
-
|
|
60
|
+
body = {
|
|
61
|
+
ext: this.extraLoginData || {}
|
|
62
|
+
};
|
|
63
|
+
if (this.tenantId) {
|
|
64
|
+
body.tid = this.tenantId;
|
|
65
|
+
}
|
|
66
|
+
if (this.userIdCode) {
|
|
67
|
+
body.code = this.userIdCode;
|
|
68
|
+
}
|
|
69
|
+
_context.next = 6;
|
|
59
70
|
return Utils.ResponseToJson(this.HttpClient.Request({
|
|
60
|
-
path: UrlJoin("as", "wlt", "login", "jwt"),
|
|
71
|
+
path: UrlJoin("as", "wlt", "login", this.userIdCode ? "code" : "jwt"),
|
|
61
72
|
method: "POST",
|
|
62
|
-
body:
|
|
63
|
-
tid: this.tenantId,
|
|
64
|
-
ext: this.extraLoginData || {}
|
|
65
|
-
} : {
|
|
66
|
-
ext: this.extraLoginData || {}
|
|
67
|
-
},
|
|
73
|
+
body: body,
|
|
68
74
|
headers: {
|
|
69
|
-
Authorization: "Bearer ".concat(this.idToken)
|
|
75
|
+
Authorization: "Bearer ".concat(this.userIdCode || this.idToken)
|
|
70
76
|
}
|
|
71
77
|
}));
|
|
72
|
-
case
|
|
78
|
+
case 6:
|
|
73
79
|
_yield$Utils$Response = _context.sent;
|
|
74
80
|
addr = _yield$Utils$Response.addr;
|
|
75
81
|
eth = _yield$Utils$Response.eth;
|
|
@@ -77,12 +83,12 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
77
83
|
this.authToken = token;
|
|
78
84
|
this.address = Utils.FormatAddress(addr);
|
|
79
85
|
this.id = eth;
|
|
80
|
-
case
|
|
86
|
+
case 13:
|
|
81
87
|
if (this.address) {
|
|
82
|
-
_context.next =
|
|
88
|
+
_context.next = 19;
|
|
83
89
|
break;
|
|
84
90
|
}
|
|
85
|
-
_context.next =
|
|
91
|
+
_context.next = 16;
|
|
86
92
|
return Utils.ResponseToJson(this.HttpClient.Request({
|
|
87
93
|
method: "GET",
|
|
88
94
|
path: UrlJoin("as", "wlt", "keys"),
|
|
@@ -90,7 +96,7 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
90
96
|
Authorization: "Bearer ".concat(this.authToken)
|
|
91
97
|
}
|
|
92
98
|
}));
|
|
93
|
-
case
|
|
99
|
+
case 16:
|
|
94
100
|
keys = _context.sent;
|
|
95
101
|
address = keys.eth[0];
|
|
96
102
|
if (address && address.startsWith("0x")) {
|
|
@@ -98,10 +104,10 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
98
104
|
} else {
|
|
99
105
|
this.address = Utils.HashToAddress(keys.eth[0]);
|
|
100
106
|
}
|
|
101
|
-
case
|
|
107
|
+
case 19:
|
|
102
108
|
this.id = this.address ? "ikms".concat(Utils.AddressToHash(this.address)) : undefined;
|
|
103
109
|
this.signer = this.provider.getSigner(this.address);
|
|
104
|
-
case
|
|
110
|
+
case 21:
|
|
105
111
|
case "end":
|
|
106
112
|
return _context.stop();
|
|
107
113
|
}
|
|
@@ -396,7 +396,7 @@ exports.CreateABRMezzanine = /*#__PURE__*/function () {
|
|
|
396
396
|
ValidateWriteToken(masterWriteToken);
|
|
397
397
|
masterObjectId = this.utils.DecodeWriteToken(masterWriteToken).objectId;
|
|
398
398
|
_context2.next = 15;
|
|
399
|
-
return
|
|
399
|
+
return this.ContentObjectLibraryId({
|
|
400
400
|
objectId: masterObjectId
|
|
401
401
|
});
|
|
402
402
|
case 15:
|
|
@@ -986,7 +986,7 @@ exports.ContentObjects = /*#__PURE__*/function () {
|
|
|
986
986
|
*/
|
|
987
987
|
exports.ContentObject = /*#__PURE__*/function () {
|
|
988
988
|
var _ref26 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref25) {
|
|
989
|
-
var objectId, versionHash, writeToken, noCache, id, path;
|
|
989
|
+
var objectId, versionHash, writeToken, noCache, id, path, info;
|
|
990
990
|
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
991
991
|
while (1) switch (_context15.prev = _context15.next) {
|
|
992
992
|
case 0:
|
|
@@ -1000,41 +1000,40 @@ exports.ContentObject = /*#__PURE__*/function () {
|
|
|
1000
1000
|
ValidateObject(objectId);
|
|
1001
1001
|
id = writeToken || versionHash || objectId;
|
|
1002
1002
|
if (!(noCache || !this.objectInfo[id] || Date.now() - this.objectInfo[id].retrievedAt > 30000)) {
|
|
1003
|
-
_context15.next =
|
|
1003
|
+
_context15.next = 18;
|
|
1004
1004
|
break;
|
|
1005
1005
|
}
|
|
1006
1006
|
path = UrlJoin("q", id);
|
|
1007
|
-
_context15.t0 =
|
|
1008
|
-
_context15.
|
|
1009
|
-
_context15.next = 11;
|
|
1007
|
+
_context15.t0 = this.HttpClient;
|
|
1008
|
+
_context15.next = 10;
|
|
1010
1009
|
return this.authClient.AuthorizationHeader({
|
|
1011
1010
|
objectId: objectId,
|
|
1012
1011
|
versionHash: versionHash
|
|
1013
1012
|
});
|
|
1014
|
-
case
|
|
1015
|
-
_context15.
|
|
1016
|
-
_context15.
|
|
1017
|
-
_context15.
|
|
1013
|
+
case 10:
|
|
1014
|
+
_context15.t1 = _context15.sent;
|
|
1015
|
+
_context15.t2 = path;
|
|
1016
|
+
_context15.t3 = {
|
|
1018
1017
|
details: true,
|
|
1019
1018
|
profile: true
|
|
1020
1019
|
};
|
|
1021
|
-
_context15.
|
|
1022
|
-
headers: _context15.
|
|
1020
|
+
_context15.t4 = {
|
|
1021
|
+
headers: _context15.t1,
|
|
1023
1022
|
method: "GET",
|
|
1024
|
-
path: _context15.
|
|
1025
|
-
queryParams: _context15.
|
|
1023
|
+
path: _context15.t2,
|
|
1024
|
+
queryParams: _context15.t3
|
|
1026
1025
|
};
|
|
1027
|
-
_context15.next =
|
|
1028
|
-
return _context15.
|
|
1029
|
-
case
|
|
1030
|
-
|
|
1026
|
+
_context15.next = 16;
|
|
1027
|
+
return _context15.t0.RequestJsonBody.call(_context15.t0, _context15.t4);
|
|
1028
|
+
case 16:
|
|
1029
|
+
info = _context15.sent;
|
|
1031
1030
|
this.objectInfo[id] = {
|
|
1032
|
-
retrievedAt:
|
|
1033
|
-
info:
|
|
1031
|
+
retrievedAt: Date.now(),
|
|
1032
|
+
info: info
|
|
1034
1033
|
};
|
|
1035
|
-
case
|
|
1034
|
+
case 18:
|
|
1036
1035
|
return _context15.abrupt("return", this.objectInfo[id].info);
|
|
1037
|
-
case
|
|
1036
|
+
case 19:
|
|
1038
1037
|
case "end":
|
|
1039
1038
|
return _context15.stop();
|
|
1040
1039
|
}
|
|
@@ -2943,6 +2942,7 @@ exports.MakeFileServiceRequest = /*#__PURE__*/function () {
|
|
|
2943
2942
|
* @param {string=} versionHash - Hash of the object version - if not specified, latest version will be used
|
|
2944
2943
|
* @param {string=} writeToken - Write token of an object draft - if calling bitcode of a draft object
|
|
2945
2944
|
* @param {string} method - Bitcode method to call
|
|
2945
|
+
* @param {string} verb - HTTP verb (GET, POST, PUT, DELETE, ...)
|
|
2946
2946
|
* @param {Object=} queryParams - Query parameters to include in the request
|
|
2947
2947
|
* @param {Object=} body - Request body to include, if calling a non-constant method
|
|
2948
2948
|
* @param {Object=} headers - Request headers to include
|
|
@@ -2954,11 +2954,11 @@ exports.MakeFileServiceRequest = /*#__PURE__*/function () {
|
|
|
2954
2954
|
*/
|
|
2955
2955
|
exports.CallBitcodeMethod = /*#__PURE__*/function () {
|
|
2956
2956
|
var _ref64 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(_ref63) {
|
|
2957
|
-
var libraryId, objectId, versionHash, writeToken, method, _ref63$queryParams, queryParams, _ref63$body, body, _ref63$headers, headers, _ref63$constant, constant, _ref63$format, format, path, authHeader;
|
|
2957
|
+
var libraryId, objectId, versionHash, writeToken, method, verb, _ref63$queryParams, queryParams, _ref63$body, body, _ref63$headers, headers, _ref63$constant, constant, _ref63$format, format, path, authHeader;
|
|
2958
2958
|
return _regeneratorRuntime.wrap(function _callee36$(_context36) {
|
|
2959
2959
|
while (1) switch (_context36.prev = _context36.next) {
|
|
2960
2960
|
case 0:
|
|
2961
|
-
libraryId = _ref63.libraryId, objectId = _ref63.objectId, versionHash = _ref63.versionHash, writeToken = _ref63.writeToken, method = _ref63.method, _ref63$queryParams = _ref63.queryParams, queryParams = _ref63$queryParams === void 0 ? {} : _ref63$queryParams, _ref63$body = _ref63.body, body = _ref63$body === void 0 ? {} : _ref63$body, _ref63$headers = _ref63.headers, headers = _ref63$headers === void 0 ? {} : _ref63$headers, _ref63$constant = _ref63.constant, constant = _ref63$constant === void 0 ? true : _ref63$constant, _ref63$format = _ref63.format, format = _ref63$format === void 0 ? "json" : _ref63$format;
|
|
2961
|
+
libraryId = _ref63.libraryId, objectId = _ref63.objectId, versionHash = _ref63.versionHash, writeToken = _ref63.writeToken, method = _ref63.method, verb = _ref63.verb, _ref63$queryParams = _ref63.queryParams, queryParams = _ref63$queryParams === void 0 ? {} : _ref63$queryParams, _ref63$body = _ref63.body, body = _ref63$body === void 0 ? {} : _ref63$body, _ref63$headers = _ref63.headers, headers = _ref63$headers === void 0 ? {} : _ref63$headers, _ref63$constant = _ref63.constant, constant = _ref63$constant === void 0 ? true : _ref63$constant, _ref63$format = _ref63.format, format = _ref63$format === void 0 ? "json" : _ref63$format;
|
|
2962
2962
|
ValidateParameters({
|
|
2963
2963
|
libraryId: libraryId,
|
|
2964
2964
|
objectId: objectId,
|
|
@@ -2991,24 +2991,25 @@ exports.CallBitcodeMethod = /*#__PURE__*/function () {
|
|
|
2991
2991
|
case 11:
|
|
2992
2992
|
headers.Authorization = _context36.sent.Authorization;
|
|
2993
2993
|
case 12:
|
|
2994
|
-
|
|
2994
|
+
verb = verb ? verb : constant ? "GET" : "POST";
|
|
2995
|
+
this.Log("Calling bitcode method: ".concat(libraryId || "", " ").concat(objectId || versionHash, " ").concat(writeToken || "", "\n ").concat(verb, " ").concat(path, "\n Query Params:\n ").concat(JSON.stringify(queryParams || ""), "\n Body:\n ").concat(JSON.stringify(body || ""), "\n Headers\n ").concat(JSON.stringify(headers || "")));
|
|
2995
2996
|
_context36.t0 = this.utils;
|
|
2996
2997
|
_context36.t1 = format;
|
|
2997
|
-
_context36.next =
|
|
2998
|
+
_context36.next = 18;
|
|
2998
2999
|
return this.HttpClient.Request({
|
|
2999
3000
|
body: body,
|
|
3000
3001
|
headers: headers,
|
|
3001
|
-
method:
|
|
3002
|
+
method: verb,
|
|
3002
3003
|
path: path,
|
|
3003
3004
|
queryParams: queryParams,
|
|
3004
3005
|
allowFailover: false
|
|
3005
3006
|
});
|
|
3006
|
-
case
|
|
3007
|
+
case 18:
|
|
3007
3008
|
_context36.t2 = _context36.sent;
|
|
3008
3009
|
_context36.t3 = this.HttpClient.debug;
|
|
3009
3010
|
_context36.t4 = this.HttpClient.Log.bind(this.HttpClient);
|
|
3010
3011
|
return _context36.abrupt("return", _context36.t0.ResponseToFormat.call(_context36.t0, _context36.t1, _context36.t2, _context36.t3, _context36.t4));
|
|
3011
|
-
case
|
|
3012
|
+
case 22:
|
|
3012
3013
|
case "end":
|
|
3013
3014
|
return _context36.stop();
|
|
3014
3015
|
}
|
|
@@ -3631,7 +3632,7 @@ exports.EmbedUrl = /*#__PURE__*/function () {
|
|
|
3631
3632
|
meta_tags: data
|
|
3632
3633
|
})));
|
|
3633
3634
|
}
|
|
3634
|
-
if (!["owner", "editable", "viewable"].includes(permission)) {
|
|
3635
|
+
if (!["owner", "editable", "viewable", "listable"].includes(permission)) {
|
|
3635
3636
|
_context42.next = 76;
|
|
3636
3637
|
break;
|
|
3637
3638
|
}
|