|
| 1 | +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 2 | +// SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +import { S3Client, CopyObjectCommand, CreateBucketCommand, DeleteBucketCommand, DeleteObjectsCommand, GetObjectCommand, ListObjectsV2Command, PutObjectCommand } from "@aws-sdk/client-s3"; |
| 5 | + |
| 6 | +export const createBucket = async (client, params) => { |
| 7 | + const command = new CreateBucketCommand(params); |
| 8 | + return client.send(command); |
| 9 | +}; |
| 10 | +export const putObject = async (client, params) => { |
| 11 | + const command = new PutObjectCommand(params); |
| 12 | + return client.send(command); |
| 13 | +}; |
| 14 | +export const getObject = async (client, params) => { |
| 15 | + const command = new GetObjectCommand(params); |
| 16 | + return client.send(command); |
| 17 | +}; |
| 18 | +export const copyObject = async (client, params) => { |
| 19 | + const command = new CopyObjectCommand(params); |
| 20 | + return client.send(command); |
| 21 | +}; |
| 22 | +export const listObjects = async (client, params) => { |
| 23 | + const command = new ListObjectsV2Command(params); |
| 24 | + return client.send(command); |
| 25 | +}; |
| 26 | +export const deleteObjects = async (client, params) => { |
| 27 | + const command = new DeleteObjectsCommand(params); |
| 28 | + return client.send(command); |
| 29 | +}; |
| 30 | +export const deleteBucket = async (client, params) => { |
| 31 | + const command = new DeleteBucketCommand(params); |
| 32 | + return client.send(command); |
| 33 | +}; |
0 commit comments