@lokalise/file-storage-service-sdk
Advanced tools
Comparing version
@@ -14,3 +14,3 @@ import type { Either } from '@lokalise/node-core'; | ||
uploadFile(ownerId: string, useCase: UseCaseEnum, fileData: FileData, contentHeaders: ContentHeaders, requestContext: HttpRequestContext): Promise<Either<ErrorResponse, string>>; | ||
createUploadUrl(ownerId: string, useCase: UseCaseEnum, fileData: FileData, requestContext: HttpRequestContext, contentHeaders: ContentHeaders): Promise<Either<ErrorResponse, FileUploadData>>; | ||
createUploadUrl(ownerId: string, useCase: UseCaseEnum, fileData: FileData, requestContext: HttpRequestContext, contentHeaders: ContentHeaders, ttlInSecs?: number): Promise<Either<ErrorResponse, FileUploadData>>; | ||
getFileMetadata(ownerId: string, fileId: string, requestContext: HttpRequestContext): Promise<Either<ErrorResponse, FileMetadata>>; | ||
@@ -17,0 +17,0 @@ getFileDownloadUrl(ownerId: string, fileId: string, useCase: UseCaseEnum, requestContext: HttpRequestContext): Promise<Either<ErrorResponse, string>>; |
@@ -101,3 +101,3 @@ "use strict"; | ||
} | ||
async createUploadUrl(ownerId, useCase, fileData, requestContext, contentHeaders) { | ||
async createUploadUrl(ownerId, useCase, fileData, requestContext, contentHeaders, ttlInSecs) { | ||
const { filename, mimeType, metadata } = fileData; | ||
@@ -109,2 +109,3 @@ const body = { | ||
mimeType, | ||
ttlInSecs, | ||
}; | ||
@@ -111,0 +112,0 @@ const response = await (0, backend_http_client_1.sendPost)(this.fileStorageHttpClient, this.getUseCaseEndpoint(ownerId, useCase, 'upload-url'), body, { |
@@ -14,2 +14,3 @@ import { z } from 'zod'; | ||
contentHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
ttlInSecs: z.ZodOptional<z.ZodNumber>; | ||
}, "strip", z.ZodTypeAny, { | ||
@@ -20,2 +21,3 @@ filename: string; | ||
contentHeaders?: Record<string, string> | undefined; | ||
ttlInSecs?: number | undefined; | ||
}, { | ||
@@ -26,2 +28,3 @@ filename: string; | ||
contentHeaders?: Record<string, string> | undefined; | ||
ttlInSecs?: number | undefined; | ||
}>, { | ||
@@ -32,2 +35,3 @@ filename: string; | ||
contentHeaders?: Record<string, string> | undefined; | ||
ttlInSecs?: number | undefined; | ||
}, { | ||
@@ -38,2 +42,3 @@ filename: string; | ||
contentHeaders?: Record<string, string> | undefined; | ||
ttlInSecs?: number | undefined; | ||
}>; | ||
@@ -40,0 +45,0 @@ export declare const CREATE_UPLOAD_URL_REPLY_SCHEMA: z.ZodObject<{ |
@@ -21,2 +21,3 @@ "use strict"; | ||
.describe(`List of all headers that will be sent to a storage for a file - it is important that they match, otherwise there will be a signature mismatch error. Valid inputs are: ${Object.keys(exports.SupportedContentHeaders.Values).join(', ')}`), | ||
ttlInSecs: zod_1.z.number().optional(), | ||
}) | ||
@@ -23,0 +24,0 @@ .refine((args) => { |
{ | ||
"name": "@lokalise/file-storage-service-sdk", | ||
"version": "7.0.0", | ||
"version": "7.1.0", | ||
"description": "SDK for file-storage-service", | ||
@@ -5,0 +5,0 @@ "author": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
56158
0.64%679
1.04%