import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "./models/operations/index.js"; export declare class Uploads extends ClientSDK { /** * Abort multipart upload * * @remarks * This endpoint aborts the multipart upload initiated with /create-multipart. * This should be used when cancelling the upload. It does not matter if parts * were already uploaded into the external storage provider. * * You must have the correct permissions and CORS settings configured in your * external provider. We support AWS S3 as the default. See: * * https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. * * An external file store must be set up and `enable_direct_s3_uploads` must * be set to true for this endpoint to function. */ abortMultipart(request?: operations.AbortMultipartRequestBody | undefined, options?: RequestOptions): Promise; /** * Generates batches of presigned URLs for multipart parts * * @remarks * Multipart uploads are uploaded in chunks or parts to individual presigned * URLs, similar to the one generated by /generate-presigned-put. The part * numbers provided must be between 1 and 10000. The total number of parts * will depend on the chunk size in bytes that you intend to use to upload * each chunk. For example a 12MB file may have 2 5MB chunks and a final * 2MB chunk, for part numbers 1, 2, and 3. * * This endpoint will return a presigned URL for each part number provided, * which you can then use to send PUT requests for the binary chunk corresponding * to that part. When the part is uploaded, the provider should return an * ETag for the part, and this should be stored along with the part number, * because this is needed to complete the multipart upload. * * You must have the correct permissions and CORS settings configured in your * external provider. We support AWS S3 as the default. See: * * https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. * * An external file store must be set up and `enable_direct_s3_uploads` must * be set to true for this endpoint to function. */ batchPresignMultipartParts(request?: operations.BatchPresignMultipartPartsRequestBody | undefined, options?: RequestOptions): Promise; /** * Completes a direct external upload * * @remarks * Completes an external upload initialized with /get-presigned-put. The * file will be moved from its temporary location in external storage to * a final destination in the S3 bucket. An Upload record will also be * created in the database in most cases. * * If a sha1-checksum was provided in the initial request it will also * be compared with the uploaded file in storage to make sure the same * file was uploaded. The file size will be compared for the same reason. * * You must have the correct permissions and CORS settings configured in your * external provider. We support AWS S3 as the default. See: * * https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. * * An external file store must be set up and `enable_direct_s3_uploads` must * be set to true for this endpoint to function. */ completeExternalUpload(request?: operations.CompleteExternalUploadRequestBody | undefined, options?: RequestOptions): Promise; /** * Complete multipart upload * * @remarks * Completes the multipart upload in the external store, and copies the * file from its temporary location to its final location in the store. * All of the parts must have been uploaded to the external storage provider. * An Upload record will be completed in most cases once the file is copied * to its final location. * * You must have the correct permissions and CORS settings configured in your * external provider. We support AWS S3 as the default. See: * * https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. * * An external file store must be set up and `enable_direct_s3_uploads` must * be set to true for this endpoint to function. */ completeMultipart(request?: operations.CompleteMultipartRequestBody | undefined, options?: RequestOptions): Promise; /** * Creates a multipart external upload * * @remarks * Creates a multipart upload in the external storage provider, storing * a temporary reference to the external upload similar to /get-presigned-put. * * You must have the correct permissions and CORS settings configured in your * external provider. We support AWS S3 as the default. See: * * https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. * * An external file store must be set up and `enable_direct_s3_uploads` must * be set to true for this endpoint to function. */ createMultipartUpload(request?: operations.CreateMultipartUploadRequestBody | undefined, options?: RequestOptions): Promise; /** * Creates an upload */ createUpload(request?: operations.CreateUploadRequestBody | undefined, options?: RequestOptions): Promise; /** * Initiates a direct external upload * * @remarks * Direct external uploads bypass the usual method of creating uploads * via the POST /uploads route, and upload directly to an external provider, * which by default is S3. This route begins the process, and will return * a unique identifier for the external upload as well as a presigned URL * which is where the file binary blob should be uploaded to. * * Once the upload is complete to the external service, you must call the * POST /complete-external-upload route using the unique identifier returned * by this route, which will create any required Upload record in the Discourse * database and also move file from its temporary location to the final * destination in the external storage service. * * You must have the correct permissions and CORS settings configured in your * external provider. We support AWS S3 as the default. See: * * https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. * * An external file store must be set up and `enable_direct_s3_uploads` must * be set to true for this endpoint to function. */ generatePresignedPut(request?: operations.GeneratePresignedPutRequestBody | undefined, options?: RequestOptions): Promise; } //# sourceMappingURL=uploads.d.ts.map