@aws-lite/s3-types 0.1.1
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/index.d.ts +45 -0
- package/package.json +13 -0
- package/readme.md +46 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
/* ! Do not remove IMPORTS_START / IMPORTS_END ! */
|
|
3
|
+
// $IMPORTS_START
|
|
4
|
+
GetObjectCommandOutput as GetObjectResponse,
|
|
5
|
+
HeadObjectCommandOutput as HeadObjectResponse,
|
|
6
|
+
ListObjectsV2CommandOutput as ListObjectsV2Response,
|
|
7
|
+
PutObjectCommandOutput as PutObjectResponse,
|
|
8
|
+
// $IMPORTS_END
|
|
9
|
+
} from "@aws-sdk/client-s3";
|
|
10
|
+
|
|
11
|
+
declare interface AwsLiteS3 {
|
|
12
|
+
/* ! Do not remove METHODS_START / METHODS_END ! */
|
|
13
|
+
// $METHODS_START
|
|
14
|
+
/**
|
|
15
|
+
* @description
|
|
16
|
+
* - AWS docs: {@link https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html S3: GetObject}
|
|
17
|
+
* - aws-lite docs: {@link https://github.com/architect/aws-lite/blob/main/plugins/s3/readme.md#GetObject S3: GetObject}
|
|
18
|
+
*/
|
|
19
|
+
GetObject: (input: { Bucket: string, Key: string, PartNumber?: number, VersionId?: string, IfMatch?: string, IfModifiedSince?: string, IfNoneMatch?: string, IfUnmodifiedSince?: string, Range?: string, SSECustomerAlgorithm?: string, SSECustomerKey?: string, SSECustomerKeyMD5?: string, RequestPayer?: string, ExpectedBucketOwner?: string, ChecksumMode?: string, ResponseCacheControl?: string, ResponseContentDisposition?: string, ResponseContentEncoding?: string, ResponseContentLanguage?: string, ResponseContentType?: string, ResponseExpires?: string }) => Promise<GetObjectResponse>
|
|
20
|
+
/**
|
|
21
|
+
* @description
|
|
22
|
+
* - AWS docs: {@link https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html S3: HeadObject}
|
|
23
|
+
* - aws-lite docs: {@link https://github.com/architect/aws-lite/blob/main/plugins/s3/readme.md#HeadObject S3: HeadObject}
|
|
24
|
+
*/
|
|
25
|
+
HeadObject: (input: { Bucket: string, Key: string, PartNumber?: number, VersionId?: string, IfMatch?: string, IfModifiedSince?: string, IfNoneMatch?: string, IfUnmodifiedSince?: string, Range?: string, SSECustomerAlgorithm?: string, SSECustomerKey?: string, SSECustomerKeyMD5?: string, RequestPayer?: string, ExpectedBucketOwner?: string, ChecksumMode?: string }) => Promise<HeadObjectResponse>
|
|
26
|
+
/**
|
|
27
|
+
* @description
|
|
28
|
+
* - AWS docs: {@link https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html S3: ListObjectsV2}
|
|
29
|
+
* - aws-lite docs: {@link https://github.com/architect/aws-lite/blob/main/plugins/s3/readme.md#ListObjectsV2 S3: ListObjectsV2}
|
|
30
|
+
*/
|
|
31
|
+
ListObjectsV2: (input: { Bucket: string, ContinuationToken?: string, Delimiter?: string, EncodingType?: string, FetchOwner?: string, MaxKeys?: number, Prefix?: string, StartAfter?: string, RequestPayer?: string, ExpectedBucketOwner?: string, OptionalObjectAttributes?: string, paginate?: boolean }) => Promise<ListObjectsV2Response>
|
|
32
|
+
/**
|
|
33
|
+
* @description
|
|
34
|
+
* - AWS docs: {@link https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html S3: PutObject}
|
|
35
|
+
* - aws-lite docs: {@link https://github.com/architect/aws-lite/blob/main/plugins/s3/readme.md#PutObject S3: PutObject}
|
|
36
|
+
*/
|
|
37
|
+
PutObject: (input: { Bucket: string, Key: string, File: string, MinChunkSize?: number, ACL?: string, BucketKeyEnabled?: string, CacheControl?: string, ChecksumAlgorithm?: string, ChecksumCRC32?: string, ChecksumCRC32C?: string, ChecksumSHA1?: string, ChecksumSHA256?: string, ContentDisposition?: string, ContentEncoding?: string, ContentLanguage?: string, ContentLength?: string, ContentMD5?: string, ContentType?: string, ExpectedBucketOwner?: string, Expires?: string, GrantFullControl?: string, GrantRead?: string, GrantReadACP?: string, GrantWriteACP?: string, ObjectLockLegalHoldStatus?: string, ObjectLockMode?: string, ObjectLockRetainUntilDate?: string, RequestPayer?: string, ServerSideEncryption?: string, SSECustomerAlgorithm?: string, SSECustomerKey?: string, SSECustomerKeyMD5?: string, SSEKMSEncryptionContext?: string, SSEKMSKeyId?: string, StorageClass?: string, Tagging?: string, WebsiteRedirectLocation?: string }) => Promise<PutObjectResponse>
|
|
38
|
+
// $METHODS_END
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare module "@aws-lite/client" {
|
|
42
|
+
interface AwsLiteClient {
|
|
43
|
+
S3: AwsLiteS3;
|
|
44
|
+
}
|
|
45
|
+
}
|
package/package.json
ADDED
package/readme.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
## Install
|
|
2
|
+
|
|
3
|
+
Add to `devDependencies` in `package.json`:
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npm i -D @aws-lite/s3-types
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
<small>Be sure you also have `@aws-lite/s3` installed.</small>
|
|
10
|
+
|
|
11
|
+
## Usage and Config
|
|
12
|
+
|
|
13
|
+
### Javascript VSCode Intellisense
|
|
14
|
+
|
|
15
|
+
In a Javascript project, the ambient types will be automatically loaded.
|
|
16
|
+
|
|
17
|
+
### TypeScript `tsconfig`
|
|
18
|
+
|
|
19
|
+
#### Add this package to `compilerOptions.types`
|
|
20
|
+
|
|
21
|
+
Example:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"extends": "@tsconfig/node-lts/tsconfig.json",
|
|
26
|
+
"compilerOptions": {
|
|
27
|
+
"types": [
|
|
28
|
+
"@aws-lite/s3-types"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
#### Or use reference types
|
|
35
|
+
|
|
36
|
+
Either in individual files or in an `index.d.ts` file.
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
/// <reference types="@aws-lite/s3-types" />
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
ymmv
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
/// <reference path="./node_modules/@aws-lite/s3-types/index.d.ts" />
|
|
46
|
+
```
|