@eluvio/elv-client-js 4.0.123 → 4.0.125
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/package.json +1 -1
- package/src/client/Shares.js +4 -3
- package/src/walletClient/index.js +13 -6
package/package.json
CHANGED
package/src/client/Shares.js
CHANGED
|
@@ -43,17 +43,18 @@ exports.CreateShare = async function({objectId, expiresAt, params={}}) {
|
|
|
43
43
|
* @param {string=} objectId - If specified, the results will be limited shares for the specified object
|
|
44
44
|
* @param {number=} limit=100 - Maximum number of results to return
|
|
45
45
|
* @param {number=} offset=0 - Offset from which to return results
|
|
46
|
+
* @param {Object=} params={} - Additional parameters
|
|
46
47
|
*
|
|
47
48
|
* @returns {Promise<Array<Object>>} - Info about the shares
|
|
48
49
|
*/
|
|
49
|
-
exports.Shares = async function({objectId, limit=100, offset=0}={}) {
|
|
50
|
+
exports.Shares = async function({objectId, limit=100, offset=0, params={}}={}) {
|
|
50
51
|
const tenantId = await this.userProfileClient.TenantContractId();
|
|
51
52
|
|
|
52
53
|
const response = await this.MakeAuthServiceRequest({
|
|
53
54
|
path: UrlJoin("as", "sharing", tenantId, "shares"),
|
|
54
|
-
method: objectId ? "POST" : "GET",
|
|
55
|
+
method: objectId || Object.keys(params).length > 0 ? "POST" : "GET",
|
|
55
56
|
queryParams: { limit, offset },
|
|
56
|
-
body: objectId ? {object_id: objectId} : undefined,
|
|
57
|
+
body: objectId ? {object_id: objectId, ...params} : undefined,
|
|
57
58
|
format: "JSON",
|
|
58
59
|
headers: {
|
|
59
60
|
Authorization: `Bearer ${this.signedToken}`
|
|
@@ -185,12 +185,19 @@ class ElvWalletClient {
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
|
|
189
|
-
client.
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
188
|
+
try {
|
|
189
|
+
walletClient.topLevelInfo = await client.utils.ResponseToJson(
|
|
190
|
+
client.MakeAuthServiceRequest({
|
|
191
|
+
path: "/as/mw/toplevel",
|
|
192
|
+
queryParams: {env: mode}
|
|
193
|
+
})
|
|
194
|
+
);
|
|
195
|
+
} catch(error) {
|
|
196
|
+
// eslint-disable-next-line no-console
|
|
197
|
+
console.error("Unable to load top level info:");
|
|
198
|
+
// eslint-disable-next-line no-console
|
|
199
|
+
console.error(error);
|
|
200
|
+
}
|
|
194
201
|
|
|
195
202
|
if(!skipMarketplaceLoad) {
|
|
196
203
|
await walletClient.LoadAvailableMarketplaces();
|