@eluvio/elv-client-js 4.0.124 → 4.0.126

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.126",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
@@ -1940,15 +1940,13 @@ exports.MakeFileServiceRequest = async function({
1940
1940
  queryPath = UrlJoin("qlibs", libraryId, queryPath);
1941
1941
  }
1942
1942
 
1943
- let authorization = [
1943
+ queryParams.authorization = [
1944
1944
  authorizationToken,
1945
1945
  await this.authClient.AuthorizationToken({libraryId, objectId, versionHash, encryption, makeAccessRequest: encryption === "cgck"})
1946
1946
  ]
1947
1947
  .flat()
1948
1948
  .filter(token => token);
1949
-
1950
- headers.Authorization = headers.Authorization || authorization.map(token => `Bearer ${token}`);
1951
-
1949
+
1952
1950
  return this.utils.ResponseToFormat(
1953
1951
  format,
1954
1952
  await this.FileServiceHttpClient.Request({
@@ -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}`