1 | import { DownloadTask, StorageDownloadDataOutput, StorageGetUrlOutput, StorageItemWithKey, StorageItemWithPath, StorageListOutput, UploadTask } from '../../../types';
|
2 | /**
|
3 | * Base type for an S3 item.
|
4 | */
|
5 | export interface ItemBase {
|
6 | /**
|
7 | * VersionId used to reference a specific version of the object.
|
8 | */
|
9 | versionId?: string;
|
10 | /**
|
11 | * A standard MIME type describing the format of the object data.
|
12 | */
|
13 | contentType?: string;
|
14 | }
|
15 | /**
|
16 | * @deprecated Use {@link ListOutputItemWithPath} instead.
|
17 | * type for S3 list item with key.
|
18 | */
|
19 | export type ListOutputItem = Omit<ItemWithKey, 'metadata'>;
|
20 | /**
|
21 | * type for S3 list item with path.
|
22 | */
|
23 | export type ListOutputItemWithPath = Omit<ItemWithPath, 'metadata'>;
|
24 | /**
|
25 | * @deprecated Use {@link ItemWithPath} instead.
|
26 | */
|
27 | export type ItemWithKey = ItemBase & StorageItemWithKey;
|
28 | /**
|
29 | * type for S3 list item with path.
|
30 | */
|
31 | export type ItemWithPath = ItemBase & StorageItemWithPath;
|
32 | /**
|
33 | * Output type for S3 downloadData API.
|
34 | * @deprecated Use {@link DownloadDataWithPathOutput} instead.
|
35 | */
|
36 | export type DownloadDataOutput = DownloadTask<StorageDownloadDataOutput<ItemWithKey>>;
|
37 | /**
|
38 | * Output type with path for S3 downloadData API.
|
39 | */
|
40 | export type DownloadDataWithPathOutput = DownloadTask<StorageDownloadDataOutput<ItemWithPath>>;
|
41 | /**
|
42 | * Output type for S3 getUrl API.
|
43 | * @deprecated Use {@link GetUrlWithPathOutput} instead.
|
44 | */
|
45 | export type GetUrlOutput = StorageGetUrlOutput;
|
46 | /**
|
47 | * Output type with path for S3 getUrl API.
|
48 | * */
|
49 | export type GetUrlWithPathOutput = StorageGetUrlOutput;
|
50 | /**
|
51 | * Output type for S3 uploadData API.
|
52 | * @deprecated Use {@link UploadDataWithPathOutput} instead.
|
53 | */
|
54 | export type UploadDataOutput = UploadTask<ItemWithKey>;
|
55 | /**
|
56 | * Output type with path for S3 uploadData API.
|
57 | * */
|
58 | export type UploadDataWithPathOutput = UploadTask<ItemWithPath>;
|
59 | /**
|
60 | * Output type for S3 getProperties API.
|
61 | * @deprecated Use {@link GetPropertiesWithPathOutput} instead.
|
62 | * */
|
63 | export type GetPropertiesOutput = ItemBase & StorageItemWithKey;
|
64 | /**
|
65 | * Output type with path for S3 getProperties API.
|
66 | * */
|
67 | export type GetPropertiesWithPathOutput = ItemBase & StorageItemWithPath;
|
68 | /**
|
69 | * @deprecated Use {@link ListAllWithPathOutput} instead.
|
70 | * Output type for S3 list API. Lists all bucket objects.
|
71 | */
|
72 | export type ListAllOutput = Omit<StorageListOutput<ListOutputItem>, 'excludedSubpaths'>;
|
73 | /**
|
74 | * Output type with path for S3 list API. Lists all bucket objects.
|
75 | */
|
76 | export type ListAllWithPathOutput = StorageListOutput<ListOutputItemWithPath>;
|
77 | /**
|
78 | * @deprecated Use {@link ListPaginateWithPathOutput} instead.
|
79 | * Output type for S3 list API. Lists bucket objects with pagination.
|
80 | */
|
81 | export type ListPaginateOutput = Omit<StorageListOutput<ListOutputItem>, 'excludedSubpaths'> & {
|
82 | nextToken?: string;
|
83 | };
|
84 | /**
|
85 | * Output type with path for S3 list API. Lists bucket objects with pagination.
|
86 | */
|
87 | export type ListPaginateWithPathOutput = StorageListOutput<ListOutputItemWithPath> & {
|
88 | nextToken?: string;
|
89 | };
|
90 | /**
|
91 | * Output type with path for S3 copy API.
|
92 | * @deprecated Use {@link CopyWithPathOutput} instead.
|
93 | */
|
94 | export type CopyOutput = Pick<ItemWithKey, 'key'>;
|
95 | /**
|
96 | * Output type with path for S3 copy API.
|
97 | */
|
98 | export type CopyWithPathOutput = Pick<ItemWithPath, 'path'>;
|
99 | /**
|
100 | * @deprecated Use {@link RemoveWithPathOutput} instead.
|
101 | * Output type with key for S3 remove API.
|
102 | */
|
103 | export type RemoveOutput = Pick<ItemWithKey, 'key'>;
|
104 | /**
|
105 | * Output type with path for S3 remove API.
|
106 | */
|
107 | export type RemoveWithPathOutput = Pick<ItemWithPath, 'path'>;
|