@eluvio/elv-client-js 3.2.28 → 3.2.30
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 +5 -5
- package/dist/ElvClient-node-min.js +7 -7
- package/dist/ElvFrameClient-min.js +17 -10
- package/dist/ElvWalletClient-min.js +5 -5
- package/dist/ElvWalletClient-node-min.js +7 -7
- package/dist/src/FrameClient.js +22 -2
- package/dist/src/walletClient/ClientMethods.js +6 -4
- package/dist/src/walletClient/index.js +46 -31
- package/package.json +1 -1
- package/src/FrameClient.js +14 -2
package/dist/src/FrameClient.js
CHANGED
|
@@ -24,6 +24,11 @@ var Utils = require("./Utils");
|
|
|
24
24
|
|
|
25
25
|
var permissionLevels = require("./client/ContentAccess").permissionLevels;
|
|
26
26
|
|
|
27
|
+
var _require = require("./LogMessage"),
|
|
28
|
+
LogMessage = _require.LogMessage;
|
|
29
|
+
|
|
30
|
+
var Crypto = require("./Crypto");
|
|
31
|
+
|
|
27
32
|
var FrameClient = /*#__PURE__*/function () {
|
|
28
33
|
"use strict";
|
|
29
34
|
|
|
@@ -75,7 +80,9 @@ var FrameClient = /*#__PURE__*/function () {
|
|
|
75
80
|
|
|
76
81
|
this.target = target;
|
|
77
82
|
this.timeout = timeout;
|
|
78
|
-
this.utils = Utils;
|
|
83
|
+
this.utils = Utils;
|
|
84
|
+
this.Crypto = Crypto;
|
|
85
|
+
this.Crypto.ElvCrypto(); // Dynamically defined methods defined in AllowedMethods
|
|
79
86
|
|
|
80
87
|
var _iterator = _createForOfIteratorHelper(this.AllowedMethods()),
|
|
81
88
|
_step;
|
|
@@ -202,6 +209,12 @@ var FrameClient = /*#__PURE__*/function () {
|
|
|
202
209
|
|
|
203
210
|
|
|
204
211
|
_createClass(FrameClient, [{
|
|
212
|
+
key: "Log",
|
|
213
|
+
value: function Log(message) {
|
|
214
|
+
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
215
|
+
LogMessage(this, message, error);
|
|
216
|
+
}
|
|
217
|
+
}, {
|
|
205
218
|
key: "PassRequest",
|
|
206
219
|
value: function () {
|
|
207
220
|
var _PassRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref4) {
|
|
@@ -476,7 +489,10 @@ var FrameClient = /*#__PURE__*/function () {
|
|
|
476
489
|
* @returns {Array<string>} - List of ElvClient methods available to a FrameClient
|
|
477
490
|
*/
|
|
478
491
|
function AllowedMethods() {
|
|
479
|
-
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",
|
|
492
|
+
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",
|
|
493
|
+
/*"UploadFiles",*/
|
|
494
|
+
//Override
|
|
495
|
+
"UploadFilesFromS3", "UploadJobStatus", "UploadPart", "UploadPartChunk", "UploadStatus", "UseRegion", "VerifyContentObject", "Visibility"];
|
|
480
496
|
}
|
|
481
497
|
}, {
|
|
482
498
|
key: "AllowedUserProfileMethods",
|
|
@@ -503,4 +519,8 @@ var FrameClient = /*#__PURE__*/function () {
|
|
|
503
519
|
return FrameClient;
|
|
504
520
|
}();
|
|
505
521
|
|
|
522
|
+
var _require2 = require("./client/Files"),
|
|
523
|
+
UploadFiles = _require2.UploadFiles;
|
|
524
|
+
|
|
525
|
+
FrameClient.prototype.UploadFiles = UploadFiles;
|
|
506
526
|
exports.FrameClient = FrameClient;
|
|
@@ -2037,17 +2037,18 @@ exports.ListingAttributes = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regene
|
|
|
2037
2037
|
* @methodGroup Purchase
|
|
2038
2038
|
* @namedParams
|
|
2039
2039
|
* @param {Object} marketplaceParams - Parameters of the marketplace
|
|
2040
|
-
* @param {string} sku - The SKU of the item to
|
|
2040
|
+
* @param {string} sku - The SKU of the item to claim
|
|
2041
|
+
* @param {string=} email - Email address of the user. If specified, this will bind the user to the tenant of the specified marketplace
|
|
2041
2042
|
*/
|
|
2042
2043
|
|
|
2043
2044
|
exports.ClaimItem = /*#__PURE__*/function () {
|
|
2044
2045
|
var _ref63 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(_ref62) {
|
|
2045
|
-
var marketplaceParams, sku, marketplaceInfo;
|
|
2046
|
+
var marketplaceParams, sku, email, marketplaceInfo;
|
|
2046
2047
|
return _regeneratorRuntime.wrap(function _callee32$(_context32) {
|
|
2047
2048
|
while (1) {
|
|
2048
2049
|
switch (_context32.prev = _context32.next) {
|
|
2049
2050
|
case 0:
|
|
2050
|
-
marketplaceParams = _ref62.marketplaceParams, sku = _ref62.sku;
|
|
2051
|
+
marketplaceParams = _ref62.marketplaceParams, sku = _ref62.sku, email = _ref62.email;
|
|
2051
2052
|
_context32.next = 3;
|
|
2052
2053
|
return this.MarketplaceInfo({
|
|
2053
2054
|
marketplaceParams: marketplaceParams
|
|
@@ -2062,7 +2063,8 @@ exports.ClaimItem = /*#__PURE__*/function () {
|
|
|
2062
2063
|
body: {
|
|
2063
2064
|
op: "nft-claim",
|
|
2064
2065
|
sid: marketplaceInfo.marketplaceId,
|
|
2065
|
-
sku: sku
|
|
2066
|
+
sku: sku,
|
|
2067
|
+
email: email
|
|
2066
2068
|
},
|
|
2067
2069
|
headers: {
|
|
2068
2070
|
Authorization: "Bearer ".concat(this.AuthToken())
|
|
@@ -36,6 +36,12 @@ var Ethers = require("ethers");
|
|
|
36
36
|
|
|
37
37
|
var inBrowser = typeof window !== "undefined";
|
|
38
38
|
var embedded = inBrowser && window.top !== window.self;
|
|
39
|
+
var localStorageAvailable = false;
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
typeof localStorage !== "undefined" && localStorage.getItem("test");
|
|
43
|
+
localStorageAvailable = true; // eslint-disable-next-line no-empty
|
|
44
|
+
} catch (error) {}
|
|
39
45
|
/**
|
|
40
46
|
* Use the <a href="#.Initialize">Initialize</a> method to initialize a new client.
|
|
41
47
|
*
|
|
@@ -43,6 +49,7 @@ var embedded = inBrowser && window.top !== window.self;
|
|
|
43
49
|
* See the Modules section on the sidebar for all client methods unrelated to login and authorization
|
|
44
50
|
*/
|
|
45
51
|
|
|
52
|
+
|
|
46
53
|
var ElvWalletClient = /*#__PURE__*/function () {
|
|
47
54
|
"use strict";
|
|
48
55
|
|
|
@@ -115,6 +122,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
115
122
|
* @param {string} mode=production - Environment to use (`production`, `staging`)
|
|
116
123
|
* @param {Object=} marketplaceParams - Marketplace parameters
|
|
117
124
|
* @param {boolean=} storeAuthToken=true - If specified, auth tokens will be stored in localstorage (if available)
|
|
125
|
+
* @param {Object=} client - Existing instance of ElvClient to use instead of initializing a new one
|
|
118
126
|
*
|
|
119
127
|
* @returns {Promise<ElvWalletClient>}
|
|
120
128
|
*/
|
|
@@ -532,7 +540,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
532
540
|
this.loggedIn = false;
|
|
533
541
|
this.cachedMarketplaces = {}; // Delete saved auth token
|
|
534
542
|
|
|
535
|
-
if (
|
|
543
|
+
if (localStorageAvailable) {
|
|
536
544
|
try {
|
|
537
545
|
localStorage.removeItem("__elv-token-".concat(this.network)); // eslint-disable-next-line no-empty
|
|
538
546
|
} catch (error) {}
|
|
@@ -891,7 +899,7 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
891
899
|
this.cachedMarketplaces = {};
|
|
892
900
|
var token = this.ClientAuthToken();
|
|
893
901
|
|
|
894
|
-
if (this.storeAuthToken &&
|
|
902
|
+
if (this.storeAuthToken && localStorageAvailable) {
|
|
895
903
|
try {
|
|
896
904
|
localStorage.setItem("__elv-token-".concat(this.network), token); // eslint-disable-next-line no-empty
|
|
897
905
|
} catch (error) {}
|
|
@@ -1809,13 +1817,13 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
1809
1817
|
key: "Initialize",
|
|
1810
1818
|
value: function () {
|
|
1811
1819
|
var _Initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(_ref18) {
|
|
1812
|
-
var _ref18$appId, appId, _ref18$network, network, _ref18$mode, mode, marketplaceParams, previewMarketplaceId, _ref18$storeAuthToken, storeAuthToken, _ref19, tenantSlug, marketplaceSlug, marketplaceId, marketplaceHash,
|
|
1820
|
+
var client, _ref18$appId, appId, _ref18$network, network, _ref18$mode, mode, marketplaceParams, previewMarketplaceId, _ref18$storeAuthToken, storeAuthToken, _ref19, tenantSlug, marketplaceSlug, marketplaceId, marketplaceHash, previewMarketplaceHash, walletClient, url, savedToken;
|
|
1813
1821
|
|
|
1814
1822
|
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
1815
1823
|
while (1) {
|
|
1816
1824
|
switch (_context18.prev = _context18.next) {
|
|
1817
1825
|
case 0:
|
|
1818
|
-
_ref18$appId = _ref18.appId, appId = _ref18$appId === void 0 ? "general" : _ref18$appId, _ref18$network = _ref18.network, network = _ref18$network === void 0 ? "main" : _ref18$network, _ref18$mode = _ref18.mode, mode = _ref18$mode === void 0 ? "production" : _ref18$mode, marketplaceParams = _ref18.marketplaceParams, previewMarketplaceId = _ref18.previewMarketplaceId, _ref18$storeAuthToken = _ref18.storeAuthToken, storeAuthToken = _ref18$storeAuthToken === void 0 ? true : _ref18$storeAuthToken;
|
|
1826
|
+
client = _ref18.client, _ref18$appId = _ref18.appId, appId = _ref18$appId === void 0 ? "general" : _ref18$appId, _ref18$network = _ref18.network, network = _ref18$network === void 0 ? "main" : _ref18$network, _ref18$mode = _ref18.mode, mode = _ref18$mode === void 0 ? "production" : _ref18$mode, marketplaceParams = _ref18.marketplaceParams, previewMarketplaceId = _ref18.previewMarketplaceId, _ref18$storeAuthToken = _ref18.storeAuthToken, storeAuthToken = _ref18$storeAuthToken === void 0 ? true : _ref18$storeAuthToken;
|
|
1819
1827
|
_ref19 = marketplaceParams || {}, tenantSlug = _ref19.tenantSlug, marketplaceSlug = _ref19.marketplaceSlug, marketplaceId = _ref19.marketplaceId, marketplaceHash = _ref19.marketplaceHash;
|
|
1820
1828
|
|
|
1821
1829
|
if (Configuration[network]) {
|
|
@@ -1834,30 +1842,37 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
1834
1842
|
throw Error("ElvWalletClient: Invalid mode ".concat(mode));
|
|
1835
1843
|
|
|
1836
1844
|
case 8:
|
|
1837
|
-
|
|
1845
|
+
if (client) {
|
|
1846
|
+
_context18.next = 12;
|
|
1847
|
+
break;
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
_context18.next = 11;
|
|
1838
1851
|
return ElvClient.FromNetworkName({
|
|
1839
1852
|
networkName: network,
|
|
1840
1853
|
assumeV3: true
|
|
1841
1854
|
});
|
|
1842
1855
|
|
|
1843
|
-
case
|
|
1856
|
+
case 11:
|
|
1844
1857
|
client = _context18.sent;
|
|
1858
|
+
|
|
1859
|
+
case 12:
|
|
1845
1860
|
previewMarketplaceHash = previewMarketplaceId;
|
|
1846
1861
|
|
|
1847
1862
|
if (!(previewMarketplaceHash && !previewMarketplaceHash.startsWith("hq__"))) {
|
|
1848
|
-
_context18.next =
|
|
1863
|
+
_context18.next = 17;
|
|
1849
1864
|
break;
|
|
1850
1865
|
}
|
|
1851
1866
|
|
|
1852
|
-
_context18.next =
|
|
1867
|
+
_context18.next = 16;
|
|
1853
1868
|
return client.LatestVersionHash({
|
|
1854
1869
|
objectId: previewMarketplaceId
|
|
1855
1870
|
});
|
|
1856
1871
|
|
|
1857
|
-
case
|
|
1872
|
+
case 16:
|
|
1858
1873
|
previewMarketplaceHash = _context18.sent;
|
|
1859
1874
|
|
|
1860
|
-
case
|
|
1875
|
+
case 17:
|
|
1861
1876
|
walletClient = new ElvWalletClient({
|
|
1862
1877
|
appId: appId,
|
|
1863
1878
|
client: client,
|
|
@@ -1874,69 +1889,69 @@ var ElvWalletClient = /*#__PURE__*/function () {
|
|
|
1874
1889
|
});
|
|
1875
1890
|
|
|
1876
1891
|
if (!(inBrowser && window.location && window.location.href)) {
|
|
1877
|
-
_context18.next =
|
|
1892
|
+
_context18.next = 37;
|
|
1878
1893
|
break;
|
|
1879
1894
|
}
|
|
1880
1895
|
|
|
1881
1896
|
url = new URL(window.location.href);
|
|
1882
1897
|
|
|
1883
1898
|
if (!url.searchParams.get("elvToken")) {
|
|
1884
|
-
_context18.next =
|
|
1899
|
+
_context18.next = 27;
|
|
1885
1900
|
break;
|
|
1886
1901
|
}
|
|
1887
1902
|
|
|
1888
|
-
_context18.next =
|
|
1903
|
+
_context18.next = 23;
|
|
1889
1904
|
return walletClient.Authenticate({
|
|
1890
1905
|
token: url.searchParams.get("elvToken")
|
|
1891
1906
|
});
|
|
1892
1907
|
|
|
1893
|
-
case
|
|
1908
|
+
case 23:
|
|
1894
1909
|
url.searchParams["delete"]("elvToken");
|
|
1895
1910
|
window.history.replaceState("", "", url);
|
|
1896
|
-
_context18.next =
|
|
1911
|
+
_context18.next = 37;
|
|
1897
1912
|
break;
|
|
1898
1913
|
|
|
1899
|
-
case
|
|
1900
|
-
if (!(storeAuthToken &&
|
|
1901
|
-
_context18.next =
|
|
1914
|
+
case 27:
|
|
1915
|
+
if (!(storeAuthToken && localStorageAvailable)) {
|
|
1916
|
+
_context18.next = 37;
|
|
1902
1917
|
break;
|
|
1903
1918
|
}
|
|
1904
1919
|
|
|
1905
|
-
_context18.prev =
|
|
1920
|
+
_context18.prev = 28;
|
|
1906
1921
|
// Load saved auth token
|
|
1907
1922
|
savedToken = localStorage.getItem("__elv-token-".concat(network));
|
|
1908
1923
|
|
|
1909
1924
|
if (!savedToken) {
|
|
1910
|
-
_context18.next =
|
|
1925
|
+
_context18.next = 33;
|
|
1911
1926
|
break;
|
|
1912
1927
|
}
|
|
1913
1928
|
|
|
1914
|
-
_context18.next =
|
|
1929
|
+
_context18.next = 33;
|
|
1915
1930
|
return walletClient.Authenticate({
|
|
1916
1931
|
token: savedToken
|
|
1917
1932
|
});
|
|
1918
1933
|
|
|
1919
|
-
case
|
|
1920
|
-
_context18.next =
|
|
1934
|
+
case 33:
|
|
1935
|
+
_context18.next = 37;
|
|
1921
1936
|
break;
|
|
1922
1937
|
|
|
1923
|
-
case
|
|
1924
|
-
_context18.prev =
|
|
1925
|
-
_context18.t0 = _context18["catch"](
|
|
1938
|
+
case 35:
|
|
1939
|
+
_context18.prev = 35;
|
|
1940
|
+
_context18.t0 = _context18["catch"](28);
|
|
1926
1941
|
|
|
1927
|
-
case
|
|
1928
|
-
_context18.next =
|
|
1942
|
+
case 37:
|
|
1943
|
+
_context18.next = 39;
|
|
1929
1944
|
return walletClient.LoadAvailableMarketplaces();
|
|
1930
1945
|
|
|
1931
|
-
case
|
|
1946
|
+
case 39:
|
|
1932
1947
|
return _context18.abrupt("return", walletClient);
|
|
1933
1948
|
|
|
1934
|
-
case
|
|
1949
|
+
case 40:
|
|
1935
1950
|
case "end":
|
|
1936
1951
|
return _context18.stop();
|
|
1937
1952
|
}
|
|
1938
1953
|
}
|
|
1939
|
-
}, _callee18, null, [[
|
|
1954
|
+
}, _callee18, null, [[28, 35]]);
|
|
1940
1955
|
}));
|
|
1941
1956
|
|
|
1942
1957
|
function Initialize(_x21) {
|
package/package.json
CHANGED
package/src/FrameClient.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
const Id = require("./Id");
|
|
2
2
|
const Utils = require("./Utils");
|
|
3
3
|
const permissionLevels = require("./client/ContentAccess").permissionLevels;
|
|
4
|
+
const {LogMessage} = require("./LogMessage");
|
|
5
|
+
const Crypto = require("./Crypto");
|
|
4
6
|
|
|
5
7
|
class FrameClient {
|
|
8
|
+
Log(message, error = false) {
|
|
9
|
+
LogMessage(this, message, error);
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
/**
|
|
7
13
|
* FrameClient is a client that looks to the user like an ElvClient, but works by passing messages
|
|
8
14
|
* to another frame with an actual ElvClient instead of making the calls itself.
|
|
@@ -45,6 +51,10 @@ class FrameClient {
|
|
|
45
51
|
|
|
46
52
|
this.utils = Utils;
|
|
47
53
|
|
|
54
|
+
this.Crypto = Crypto;
|
|
55
|
+
this.Crypto.ElvCrypto();
|
|
56
|
+
|
|
57
|
+
|
|
48
58
|
// Dynamically defined methods defined in AllowedMethods
|
|
49
59
|
for(const methodName of this.AllowedMethods()){
|
|
50
60
|
this[methodName] = async (args) => {
|
|
@@ -195,7 +205,6 @@ class FrameClient {
|
|
|
195
205
|
methodListener = async (event) => {
|
|
196
206
|
try {
|
|
197
207
|
const message = event.data;
|
|
198
|
-
|
|
199
208
|
if(message.type !== "ElvFrameResponse" || message.requestId !== requestId) {
|
|
200
209
|
return;
|
|
201
210
|
}
|
|
@@ -431,7 +440,7 @@ class FrameClient {
|
|
|
431
440
|
"UpdateContentObjectGraph",
|
|
432
441
|
"UpdateNTPInstance",
|
|
433
442
|
"UploadFileData",
|
|
434
|
-
"UploadFiles"
|
|
443
|
+
/*"UploadFiles",*/ //Override
|
|
435
444
|
"UploadFilesFromS3",
|
|
436
445
|
"UploadJobStatus",
|
|
437
446
|
"UploadPart",
|
|
@@ -462,4 +471,7 @@ class FrameClient {
|
|
|
462
471
|
}
|
|
463
472
|
}
|
|
464
473
|
|
|
474
|
+
const { UploadFiles } = require("./client/Files");
|
|
475
|
+
FrameClient.prototype.UploadFiles=UploadFiles;
|
|
476
|
+
|
|
465
477
|
exports.FrameClient = FrameClient;
|