@oasis-path/gamma-sdk 1.0.6 → 1.0.8
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/client.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export declare class GammaFilesClient {
|
|
|
9
9
|
deleteFile(fileId: string): Promise<DeleteFileResponse>;
|
|
10
10
|
getFileMetadata(fileId: string): Promise<FileMetadataResponse>;
|
|
11
11
|
generatePresignedUrl(options: PresignedUrlOptions): Promise<PresignedUrlResponse>;
|
|
12
|
-
viewFileByToken(fileId: string, token: string): Promise<ViewFileByTokenResult>;
|
|
12
|
+
viewFileByToken(fileId: string, token: string, compressionValue?: number): Promise<ViewFileByTokenResult>;
|
|
13
13
|
private request;
|
|
14
14
|
}
|
package/dist/client.js
CHANGED
|
@@ -32,8 +32,8 @@ class GammaFilesClient {
|
|
|
32
32
|
async generatePresignedUrl(options) {
|
|
33
33
|
return (0, generatePresignedUrl_1.generatePresignedUrl)(options, this.request.bind(this));
|
|
34
34
|
}
|
|
35
|
-
async viewFileByToken(fileId, token) {
|
|
36
|
-
return (0, viewFileByToken_1.viewFileByToken)(fileId, token, this.request.bind(this));
|
|
35
|
+
async viewFileByToken(fileId, token, compressionValue) {
|
|
36
|
+
return (0, viewFileByToken_1.viewFileByToken)(fileId, token, this.request.bind(this), compressionValue);
|
|
37
37
|
}
|
|
38
38
|
async request(method, path, options) {
|
|
39
39
|
return (0, request_1.makeRequest)(method, path, this.baseUrl, this.apiKey, options);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ViewFileByTokenResult } from '../types';
|
|
2
|
-
export declare function viewFileByToken(fileId: string, token: string, request: <T>(method: string, path: string, options?: any) => Promise<T
|
|
2
|
+
export declare function viewFileByToken(fileId: string, token: string, request: <T>(method: string, path: string, options?: any) => Promise<T>, compressionValue?: number): Promise<ViewFileByTokenResult>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.viewFileByToken = viewFileByToken;
|
|
4
|
-
async function viewFileByToken(fileId, token, request) {
|
|
5
|
-
|
|
4
|
+
async function viewFileByToken(fileId, token, request, compressionValue) {
|
|
5
|
+
let url = `/api/files/view/${fileId}?token=${encodeURIComponent(token)}`;
|
|
6
|
+
// Add compression parameter if provided
|
|
7
|
+
if (compressionValue !== undefined) {
|
|
8
|
+
url += `&compressionValue=${compressionValue}`;
|
|
9
|
+
}
|
|
6
10
|
return request('GET', url, {
|
|
7
11
|
binary: true,
|
|
8
12
|
skipAuth: true,
|