@@ -6,11 +6,11 @@ const PathOrBlob = JSC.Node.PathOrBlob;
6
6
const ZigString = JSC .ZigString ;
7
7
const Method = bun .http .Method ;
8
8
const S3File = @import ("./S3File.zig" );
9
- const AWSCredentials = bun .AWSCredentials ;
9
+ const S3Credentials = bun .S3 . S3Credentials ;
10
10
11
11
const S3BucketOptions = struct {
12
- credentials : * AWSCredentials ,
13
- options : bun.S3.MultiPartUpload. MultiPartUploadOptions = .{},
12
+ credentials : * S3Credentials ,
13
+ options : bun.S3.MultiPartUploadOptions = .{},
14
14
acl : ? bun.S3.ACL = null ,
15
15
pub usingnamespace bun .New (@This ());
16
16
@@ -20,7 +20,7 @@ const S3BucketOptions = struct {
20
20
}
21
21
};
22
22
23
- pub fn writeFormatCredentials (credentials : * AWSCredentials , options : bun.S3.MultiPartUpload .MultiPartUploadOptions , acl : ? bun.S3.ACL , comptime Formatter : type , formatter : * Formatter , writer : anytype , comptime enable_ansi_colors : bool ) ! void {
23
+ pub fn writeFormatCredentials (credentials : * S3Credentials , options : bun.S3.MultiPartUploadOptions , acl : ? bun.S3.ACL , comptime Formatter : type , formatter : * Formatter , writer : anytype , comptime enable_ansi_colors : bool ) ! void {
24
24
try writer .writeAll ("\n " );
25
25
26
26
{
@@ -37,7 +37,7 @@ pub fn writeFormatCredentials(credentials: *AWSCredentials, options: bun.S3.Mult
37
37
formatter .printComma (Writer , writer , enable_ansi_colors ) catch bun .outOfMemory ();
38
38
try writer .writeAll ("\n " );
39
39
40
- const region = if (credentials .region .len > 0 ) credentials .region else AWSCredentials .guessRegion (credentials .endpoint );
40
+ const region = if (credentials .region .len > 0 ) credentials .region else S3Credentials .guessRegion (credentials .endpoint );
41
41
try formatter .writeIndent (Writer , writer );
42
42
try writer .writeAll (comptime bun .Output .prettyFmt ("<r>region<d>:<r> \" " , enable_ansi_colors ));
43
43
try writer .print (comptime bun .Output .prettyFmt ("<r><b>{s}<r>\" " , enable_ansi_colors ), .{region });
@@ -133,7 +133,7 @@ pub fn call(ptr: *S3BucketOptions, globalThis: *JSC.JSGlobalObject, callframe: *
133
133
};
134
134
errdefer path .deinit ();
135
135
const options = args .nextEat ();
136
- var blob = Blob .new (try S3File .constructS3FileWithAWSCredentialsAndOptions (globalThis , path , options , ptr .credentials , ptr .options , ptr .acl ));
136
+ var blob = Blob .new (try S3File .constructS3FileWithS3CredentialsAndOptions (globalThis , path , options , ptr .credentials , ptr .options , ptr .acl ));
137
137
blob .allocator = bun .default_allocator ;
138
138
return blob .toJS (globalThis );
139
139
}
@@ -151,7 +151,7 @@ pub fn presign(ptr: *S3BucketOptions, globalThis: *JSC.JSGlobalObject, callframe
151
151
errdefer path .deinit ();
152
152
153
153
const options = args .nextEat ();
154
- var blob = try S3File .constructS3FileWithAWSCredentialsAndOptions (globalThis , path , options , ptr .credentials , ptr .options , ptr .acl );
154
+ var blob = try S3File .constructS3FileWithS3CredentialsAndOptions (globalThis , path , options , ptr .credentials , ptr .options , ptr .acl );
155
155
defer blob .detach ();
156
156
return S3File .getPresignUrlFrom (& blob , globalThis , options );
157
157
}
@@ -168,7 +168,7 @@ pub fn exists(ptr: *S3BucketOptions, globalThis: *JSC.JSGlobalObject, callframe:
168
168
};
169
169
errdefer path .deinit ();
170
170
const options = args .nextEat ();
171
- var blob = try S3File .constructS3FileWithAWSCredentialsAndOptions (globalThis , path , options , ptr .credentials , ptr .options , ptr .acl );
171
+ var blob = try S3File .constructS3FileWithS3CredentialsAndOptions (globalThis , path , options , ptr .credentials , ptr .options , ptr .acl );
172
172
defer blob .detach ();
173
173
return S3File .S3BlobStatTask .exists (globalThis , & blob );
174
174
}
@@ -185,7 +185,7 @@ pub fn size(ptr: *S3BucketOptions, globalThis: *JSC.JSGlobalObject, callframe: *
185
185
};
186
186
errdefer path .deinit ();
187
187
const options = args .nextEat ();
188
- var blob = try S3File .constructS3FileWithAWSCredentialsAndOptions (globalThis , path , options , ptr .credentials , ptr .options , ptr .acl );
188
+ var blob = try S3File .constructS3FileWithS3CredentialsAndOptions (globalThis , path , options , ptr .credentials , ptr .options , ptr .acl );
189
189
defer blob .detach ();
190
190
return S3File .S3BlobStatTask .size (globalThis , & blob );
191
191
}
@@ -203,7 +203,7 @@ pub fn write(ptr: *S3BucketOptions, globalThis: *JSC.JSGlobalObject, callframe:
203
203
};
204
204
205
205
const options = args .nextEat ();
206
- var blob = try S3File .constructS3FileWithAWSCredentialsAndOptions (globalThis , path , options , ptr .credentials , ptr .options , ptr .acl );
206
+ var blob = try S3File .constructS3FileWithS3CredentialsAndOptions (globalThis , path , options , ptr .credentials , ptr .options , ptr .acl );
207
207
defer blob .detach ();
208
208
var blob_internal : PathOrBlob = .{ .blob = blob };
209
209
return Blob .writeFileInternal (globalThis , & blob_internal , data , .{
@@ -221,7 +221,7 @@ pub fn unlink(ptr: *S3BucketOptions, globalThis: *JSC.JSGlobalObject, callframe:
221
221
};
222
222
errdefer path .deinit ();
223
223
const options = args .nextEat ();
224
- var blob = try S3File .constructS3FileWithAWSCredentialsAndOptions (globalThis , path , options , ptr .credentials , ptr .options , ptr .acl );
224
+ var blob = try S3File .constructS3FileWithS3CredentialsAndOptions (globalThis , path , options , ptr .credentials , ptr .options , ptr .acl );
225
225
defer blob .detach ();
226
226
return blob .store .? .data .s3 .unlink (blob .store .? , globalThis , options );
227
227
}
@@ -235,7 +235,7 @@ pub fn construct(globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) cal
235
235
if (options .isEmptyOrUndefinedOrNull () or ! options .isObject ()) {
236
236
globalThis .throwInvalidArguments ("Expected S3 options to be passed" , .{}) catch return null ;
237
237
}
238
- var aws_options = AWSCredentials .getCredentialsWithOptions (globalThis .bunVM ().transpiler .env .getAWSCredentials (), .{}, options , null , globalThis ) catch return null ;
238
+ var aws_options = S3Credentials .getCredentialsWithOptions (globalThis .bunVM ().transpiler .env .getS3Credentials (), .{}, options , null , globalThis ) catch return null ;
239
239
defer aws_options .deinit ();
240
240
return S3BucketOptions .new (.{
241
241
.credentials = aws_options .credentials .dupe (),
0 commit comments