@eluvio/elv-client-js 4.0.124 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "4.0.124",
3
+ "version": "4.0.125",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
@@ -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}`