s3kit 0.1.0 → 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/README.md +15 -1
- package/dist/adapters/express.cjs +99 -3
- package/dist/adapters/express.cjs.map +1 -1
- package/dist/adapters/express.d.cts +2 -2
- package/dist/adapters/express.d.ts +2 -2
- package/dist/adapters/express.js +99 -3
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/fetch.cjs +99 -3
- package/dist/adapters/fetch.cjs.map +1 -1
- package/dist/adapters/fetch.d.cts +2 -2
- package/dist/adapters/fetch.d.ts +2 -2
- package/dist/adapters/fetch.js +99 -3
- package/dist/adapters/fetch.js.map +1 -1
- package/dist/adapters/next.cjs +386 -20
- package/dist/adapters/next.cjs.map +1 -1
- package/dist/adapters/next.d.cts +2 -2
- package/dist/adapters/next.d.ts +2 -2
- package/dist/adapters/next.js +387 -20
- package/dist/adapters/next.js.map +1 -1
- package/dist/client/index.cjs +15 -1
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +12 -2
- package/dist/client/index.d.ts +12 -2
- package/dist/client/index.js +15 -1
- package/dist/client/index.js.map +1 -1
- package/dist/core/index.cjs +300 -19
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +8 -3
- package/dist/core/index.d.ts +8 -3
- package/dist/core/index.js +299 -18
- package/dist/core/index.js.map +1 -1
- package/dist/http/index.cjs +99 -3
- package/dist/http/index.cjs.map +1 -1
- package/dist/http/index.d.cts +5 -2
- package/dist/http/index.d.ts +5 -2
- package/dist/http/index.js +99 -3
- package/dist/http/index.js.map +1 -1
- package/dist/index.cjs +403 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +403 -21
- package/dist/index.js.map +1 -1
- package/dist/{manager-BbmXpgXN.d.ts → manager-BtW1-sC0.d.ts} +11 -1
- package/dist/{manager-gIjo-t8h.d.cts → manager-DSsCYKEz.d.cts} +11 -1
- package/dist/react/index.cjs +334 -31
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +334 -31
- package/dist/react/index.js.map +1 -1
- package/dist/{types-g2IYvH3O.d.cts → types-B0yU5sod.d.cts} +51 -3
- package/dist/{types-g2IYvH3O.d.ts → types-B0yU5sod.d.ts} +51 -3
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type S3FileManagerAction = 'list' | 'search' | 'folder.create' | 'folder.delete' | 'upload.prepare' | 'file.delete' | 'file.copy' | 'file.move' | 'folder.copy' | 'folder.move' | 'preview.get';
|
|
1
|
+
type S3FileManagerAction = 'list' | 'search' | 'folder.create' | 'folder.delete' | 'folder.lock.get' | 'upload.prepare' | 'file.delete' | 'file.copy' | 'file.move' | 'file.attributes.get' | 'file.attributes.set' | 'folder.copy' | 'folder.move' | 'preview.get';
|
|
2
2
|
type S3Path = string;
|
|
3
3
|
interface S3FileManagerAuthContext {
|
|
4
4
|
userId?: string;
|
|
@@ -28,6 +28,7 @@ interface S3FileEntry<FileExtra = unknown> {
|
|
|
28
28
|
lastModified?: string;
|
|
29
29
|
etag?: string;
|
|
30
30
|
contentType?: string;
|
|
31
|
+
expiresAt?: string;
|
|
31
32
|
extra?: FileExtra;
|
|
32
33
|
}
|
|
33
34
|
type S3Entry<FileExtra = unknown, FolderExtra = unknown> = S3FileEntry<FileExtra> | S3FolderEntry<FolderExtra>;
|
|
@@ -61,15 +62,22 @@ interface S3DeleteFolderOptions {
|
|
|
61
62
|
recursive?: boolean;
|
|
62
63
|
}
|
|
63
64
|
interface S3DeleteFilesOptions {
|
|
64
|
-
paths
|
|
65
|
+
paths?: S3Path[];
|
|
66
|
+
items?: Array<{
|
|
67
|
+
path: S3Path;
|
|
68
|
+
ifMatch?: string;
|
|
69
|
+
ifNoneMatch?: string;
|
|
70
|
+
}>;
|
|
65
71
|
}
|
|
66
72
|
interface S3CopyOptions {
|
|
67
73
|
fromPath: S3Path;
|
|
68
74
|
toPath: S3Path;
|
|
75
|
+
ifMatch?: string;
|
|
69
76
|
}
|
|
70
77
|
interface S3MoveOptions {
|
|
71
78
|
fromPath: S3Path;
|
|
72
79
|
toPath: S3Path;
|
|
80
|
+
ifMatch?: string;
|
|
73
81
|
}
|
|
74
82
|
interface S3PrepareUploadItem {
|
|
75
83
|
path: S3Path;
|
|
@@ -77,6 +85,8 @@ interface S3PrepareUploadItem {
|
|
|
77
85
|
cacheControl?: string;
|
|
78
86
|
contentDisposition?: string;
|
|
79
87
|
metadata?: Record<string, string>;
|
|
88
|
+
expiresAt?: string | null;
|
|
89
|
+
ifNoneMatch?: string;
|
|
80
90
|
}
|
|
81
91
|
interface S3PreparedUpload {
|
|
82
92
|
path: S3Path;
|
|
@@ -98,6 +108,29 @@ interface S3GetPreviewUrlResult {
|
|
|
98
108
|
url: string;
|
|
99
109
|
expiresAt: string;
|
|
100
110
|
}
|
|
111
|
+
interface S3GetFileAttributesOptions {
|
|
112
|
+
path: S3Path;
|
|
113
|
+
}
|
|
114
|
+
interface S3SetFileAttributesOptions {
|
|
115
|
+
path: S3Path;
|
|
116
|
+
contentType?: string;
|
|
117
|
+
cacheControl?: string;
|
|
118
|
+
contentDisposition?: string;
|
|
119
|
+
metadata?: Record<string, string>;
|
|
120
|
+
expiresAt?: string | null;
|
|
121
|
+
ifMatch?: string;
|
|
122
|
+
}
|
|
123
|
+
interface S3FileAttributes {
|
|
124
|
+
path: S3Path;
|
|
125
|
+
size?: number;
|
|
126
|
+
lastModified?: string;
|
|
127
|
+
etag?: string;
|
|
128
|
+
contentType?: string;
|
|
129
|
+
cacheControl?: string;
|
|
130
|
+
contentDisposition?: string;
|
|
131
|
+
metadata?: Record<string, string>;
|
|
132
|
+
expiresAt?: string;
|
|
133
|
+
}
|
|
101
134
|
interface S3FileDecorationArgs {
|
|
102
135
|
path: S3Path;
|
|
103
136
|
key: string;
|
|
@@ -116,8 +149,23 @@ interface S3FileManagerOptions<FileExtra = unknown, FolderExtra = unknown> {
|
|
|
116
149
|
bucket: string;
|
|
117
150
|
rootPrefix?: string;
|
|
118
151
|
delimiter?: string;
|
|
152
|
+
lockFolderMoves?: boolean;
|
|
153
|
+
lockPrefix?: string;
|
|
154
|
+
lockTtlSeconds?: number;
|
|
119
155
|
authorizationMode?: S3FileManagerAuthorizationMode;
|
|
120
156
|
hooks?: S3FileManagerHooks<FileExtra, FolderExtra>;
|
|
121
157
|
}
|
|
158
|
+
interface S3GetFolderLockOptions {
|
|
159
|
+
path: S3Path;
|
|
160
|
+
}
|
|
161
|
+
interface S3FolderLock {
|
|
162
|
+
path: S3Path;
|
|
163
|
+
operation: 'folder.move';
|
|
164
|
+
fromPath: S3Path;
|
|
165
|
+
toPath: S3Path;
|
|
166
|
+
startedAt: string;
|
|
167
|
+
expiresAt: string;
|
|
168
|
+
owner?: string;
|
|
169
|
+
}
|
|
122
170
|
|
|
123
|
-
export type {
|
|
171
|
+
export type { S3FileDecorationArgs as A, S3FolderDecorationArgs as B, S3FileManagerHooks as C, S3FileManagerOptions as D, S3GetFolderLockOptions as E, S3FolderLock as F, S3FileManagerAction as S, S3Path as a, S3FileManagerAuthContext as b, S3FileManagerAuthorizeArgs as c, S3FileManagerAuthorizeHook as d, S3FileManagerAllowActionHook as e, S3FileManagerAuthorizationMode as f, S3FolderEntry as g, S3FileEntry as h, S3Entry as i, S3ListOptions as j, S3ListResult as k, S3SearchOptions as l, S3SearchResult as m, S3CreateFolderOptions as n, S3DeleteFolderOptions as o, S3DeleteFilesOptions as p, S3CopyOptions as q, S3MoveOptions as r, S3PrepareUploadItem as s, S3PreparedUpload as t, S3PrepareUploadsOptions as u, S3GetPreviewUrlOptions as v, S3GetPreviewUrlResult as w, S3GetFileAttributesOptions as x, S3SetFileAttributesOptions as y, S3FileAttributes as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type S3FileManagerAction = 'list' | 'search' | 'folder.create' | 'folder.delete' | 'upload.prepare' | 'file.delete' | 'file.copy' | 'file.move' | 'folder.copy' | 'folder.move' | 'preview.get';
|
|
1
|
+
type S3FileManagerAction = 'list' | 'search' | 'folder.create' | 'folder.delete' | 'folder.lock.get' | 'upload.prepare' | 'file.delete' | 'file.copy' | 'file.move' | 'file.attributes.get' | 'file.attributes.set' | 'folder.copy' | 'folder.move' | 'preview.get';
|
|
2
2
|
type S3Path = string;
|
|
3
3
|
interface S3FileManagerAuthContext {
|
|
4
4
|
userId?: string;
|
|
@@ -28,6 +28,7 @@ interface S3FileEntry<FileExtra = unknown> {
|
|
|
28
28
|
lastModified?: string;
|
|
29
29
|
etag?: string;
|
|
30
30
|
contentType?: string;
|
|
31
|
+
expiresAt?: string;
|
|
31
32
|
extra?: FileExtra;
|
|
32
33
|
}
|
|
33
34
|
type S3Entry<FileExtra = unknown, FolderExtra = unknown> = S3FileEntry<FileExtra> | S3FolderEntry<FolderExtra>;
|
|
@@ -61,15 +62,22 @@ interface S3DeleteFolderOptions {
|
|
|
61
62
|
recursive?: boolean;
|
|
62
63
|
}
|
|
63
64
|
interface S3DeleteFilesOptions {
|
|
64
|
-
paths
|
|
65
|
+
paths?: S3Path[];
|
|
66
|
+
items?: Array<{
|
|
67
|
+
path: S3Path;
|
|
68
|
+
ifMatch?: string;
|
|
69
|
+
ifNoneMatch?: string;
|
|
70
|
+
}>;
|
|
65
71
|
}
|
|
66
72
|
interface S3CopyOptions {
|
|
67
73
|
fromPath: S3Path;
|
|
68
74
|
toPath: S3Path;
|
|
75
|
+
ifMatch?: string;
|
|
69
76
|
}
|
|
70
77
|
interface S3MoveOptions {
|
|
71
78
|
fromPath: S3Path;
|
|
72
79
|
toPath: S3Path;
|
|
80
|
+
ifMatch?: string;
|
|
73
81
|
}
|
|
74
82
|
interface S3PrepareUploadItem {
|
|
75
83
|
path: S3Path;
|
|
@@ -77,6 +85,8 @@ interface S3PrepareUploadItem {
|
|
|
77
85
|
cacheControl?: string;
|
|
78
86
|
contentDisposition?: string;
|
|
79
87
|
metadata?: Record<string, string>;
|
|
88
|
+
expiresAt?: string | null;
|
|
89
|
+
ifNoneMatch?: string;
|
|
80
90
|
}
|
|
81
91
|
interface S3PreparedUpload {
|
|
82
92
|
path: S3Path;
|
|
@@ -98,6 +108,29 @@ interface S3GetPreviewUrlResult {
|
|
|
98
108
|
url: string;
|
|
99
109
|
expiresAt: string;
|
|
100
110
|
}
|
|
111
|
+
interface S3GetFileAttributesOptions {
|
|
112
|
+
path: S3Path;
|
|
113
|
+
}
|
|
114
|
+
interface S3SetFileAttributesOptions {
|
|
115
|
+
path: S3Path;
|
|
116
|
+
contentType?: string;
|
|
117
|
+
cacheControl?: string;
|
|
118
|
+
contentDisposition?: string;
|
|
119
|
+
metadata?: Record<string, string>;
|
|
120
|
+
expiresAt?: string | null;
|
|
121
|
+
ifMatch?: string;
|
|
122
|
+
}
|
|
123
|
+
interface S3FileAttributes {
|
|
124
|
+
path: S3Path;
|
|
125
|
+
size?: number;
|
|
126
|
+
lastModified?: string;
|
|
127
|
+
etag?: string;
|
|
128
|
+
contentType?: string;
|
|
129
|
+
cacheControl?: string;
|
|
130
|
+
contentDisposition?: string;
|
|
131
|
+
metadata?: Record<string, string>;
|
|
132
|
+
expiresAt?: string;
|
|
133
|
+
}
|
|
101
134
|
interface S3FileDecorationArgs {
|
|
102
135
|
path: S3Path;
|
|
103
136
|
key: string;
|
|
@@ -116,8 +149,23 @@ interface S3FileManagerOptions<FileExtra = unknown, FolderExtra = unknown> {
|
|
|
116
149
|
bucket: string;
|
|
117
150
|
rootPrefix?: string;
|
|
118
151
|
delimiter?: string;
|
|
152
|
+
lockFolderMoves?: boolean;
|
|
153
|
+
lockPrefix?: string;
|
|
154
|
+
lockTtlSeconds?: number;
|
|
119
155
|
authorizationMode?: S3FileManagerAuthorizationMode;
|
|
120
156
|
hooks?: S3FileManagerHooks<FileExtra, FolderExtra>;
|
|
121
157
|
}
|
|
158
|
+
interface S3GetFolderLockOptions {
|
|
159
|
+
path: S3Path;
|
|
160
|
+
}
|
|
161
|
+
interface S3FolderLock {
|
|
162
|
+
path: S3Path;
|
|
163
|
+
operation: 'folder.move';
|
|
164
|
+
fromPath: S3Path;
|
|
165
|
+
toPath: S3Path;
|
|
166
|
+
startedAt: string;
|
|
167
|
+
expiresAt: string;
|
|
168
|
+
owner?: string;
|
|
169
|
+
}
|
|
122
170
|
|
|
123
|
-
export type {
|
|
171
|
+
export type { S3FileDecorationArgs as A, S3FolderDecorationArgs as B, S3FileManagerHooks as C, S3FileManagerOptions as D, S3GetFolderLockOptions as E, S3FolderLock as F, S3FileManagerAction as S, S3Path as a, S3FileManagerAuthContext as b, S3FileManagerAuthorizeArgs as c, S3FileManagerAuthorizeHook as d, S3FileManagerAllowActionHook as e, S3FileManagerAuthorizationMode as f, S3FolderEntry as g, S3FileEntry as h, S3Entry as i, S3ListOptions as j, S3ListResult as k, S3SearchOptions as l, S3SearchResult as m, S3CreateFolderOptions as n, S3DeleteFolderOptions as o, S3DeleteFilesOptions as p, S3CopyOptions as q, S3MoveOptions as r, S3PrepareUploadItem as s, S3PreparedUpload as t, S3PrepareUploadsOptions as u, S3GetPreviewUrlOptions as v, S3GetPreviewUrlResult as w, S3GetFileAttributesOptions as x, S3SetFileAttributesOptions as y, S3FileAttributes as z };
|