mock-aws-s3-v3 6.0.1 → 6.0.3
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/dist/src/__tests__/useBothMockAndActualClient.js +27 -22
- package/dist/src/__tests__/useBothMockAndActualClient.js.map +1 -1
- package/dist/src/mockS3.d.ts +1 -0
- package/dist/src/mockS3.d.ts.map +1 -1
- package/dist/src/mockS3.js +136 -76
- package/dist/src/mockS3.js.map +1 -1
- package/package.json +10 -10
|
@@ -3,31 +3,36 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
4
4
|
const mockS3_1 = require("../mockS3");
|
|
5
5
|
test('use both actual and mock', async () => {
|
|
6
|
+
var _a;
|
|
6
7
|
const mockClient = (0, mockS3_1.createS3Client)({
|
|
7
8
|
localDirectory: 'goldstackLocal/s3',
|
|
8
9
|
bucket: 'test-local',
|
|
9
10
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
11
|
+
await mockClient.send(new client_s3_1.PutObjectCommand({
|
|
12
|
+
Bucket: 'test-local',
|
|
13
|
+
Key: 'test-key',
|
|
14
|
+
Body: 'hello',
|
|
15
|
+
}));
|
|
16
|
+
const res = await mockClient.send(new client_s3_1.GetObjectCommand({
|
|
17
|
+
Bucket: 'test-local',
|
|
18
|
+
Key: 'test-key',
|
|
19
|
+
}));
|
|
20
|
+
expect(await ((_a = res.Body) === null || _a === void 0 ? void 0 : _a.transformToString())).toBe('hello');
|
|
21
|
+
// Should throw NoSuchKey when getting non-existent key from mocked bucket
|
|
22
|
+
await expect(mockClient.send(new client_s3_1.GetObjectCommand({
|
|
23
|
+
Bucket: 'test-local',
|
|
24
|
+
Key: 'non-existent-key',
|
|
25
|
+
}))).rejects.toThrow(client_s3_1.NoSuchKey);
|
|
26
|
+
// When using a non-mocked bucket through mock client, it should forward to real client and throw
|
|
27
|
+
await expect(mockClient.send(new client_s3_1.GetObjectCommand({
|
|
28
|
+
Bucket: 'test-local-not',
|
|
29
|
+
Key: 'test-key',
|
|
30
|
+
}))).rejects.toThrow();
|
|
31
|
+
// Direct use of real client should also throw
|
|
32
|
+
const realClient = new client_s3_1.S3Client();
|
|
33
|
+
await expect(realClient.send(new client_s3_1.GetObjectCommand({
|
|
34
|
+
Bucket: 'test-remote-fake',
|
|
35
|
+
Key: 'test-key',
|
|
36
|
+
}))).rejects.toThrow();
|
|
32
37
|
});
|
|
33
38
|
//# sourceMappingURL=useBothMockAndActualClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBothMockAndActualClient.js","sourceRoot":"","sources":["../../../src/__tests__/useBothMockAndActualClient.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"useBothMockAndActualClient.js","sourceRoot":"","sources":["../../../src/__tests__/useBothMockAndActualClient.ts"],"names":[],"mappings":";;AAAA,kDAK4B;AAC5B,sCAA2C;AAE3C,IAAI,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;;IAC1C,MAAM,UAAU,GAAG,IAAA,uBAAc,EAAC;QAChC,cAAc,EAAE,mBAAmB;QACnC,MAAM,EAAE,YAAY;KACrB,CAAC,CAAC;IACH,MAAM,UAAU,CAAC,IAAI,CACnB,IAAI,4BAAgB,CAAC;QACnB,MAAM,EAAE,YAAY;QACpB,GAAG,EAAE,UAAU;QACf,IAAI,EAAE,OAAO;KACd,CAAC,CACH,CAAC;IAEF,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,IAAI,CAC/B,IAAI,4BAAgB,CAAC;QACnB,MAAM,EAAE,YAAY;QACpB,GAAG,EAAE,UAAU;KAChB,CAAC,CACH,CAAC;IACF,MAAM,CAAC,MAAM,CAAA,MAAA,GAAG,CAAC,IAAI,0CAAE,iBAAiB,EAAE,CAAA,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAE1D,0EAA0E;IAC1E,MAAM,MAAM,CACV,UAAU,CAAC,IAAI,CACb,IAAI,4BAAgB,CAAC;QACnB,MAAM,EAAE,YAAY;QACpB,GAAG,EAAE,kBAAkB;KACxB,CAAC,CACH,CACF,CAAC,OAAO,CAAC,OAAO,CAAC,qBAAS,CAAC,CAAC;IAE7B,iGAAiG;IACjG,MAAM,MAAM,CACV,UAAU,CAAC,IAAI,CACb,IAAI,4BAAgB,CAAC;QACnB,MAAM,EAAE,gBAAgB;QACxB,GAAG,EAAE,UAAU;KAChB,CAAC,CACH,CACF,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IAEpB,8CAA8C;IAC9C,MAAM,UAAU,GAAG,IAAI,oBAAQ,EAAE,CAAC;IAClC,MAAM,MAAM,CACV,UAAU,CAAC,IAAI,CACb,IAAI,4BAAgB,CAAC;QACnB,MAAM,EAAE,kBAAkB;QAC1B,GAAG,EAAE,UAAU;KAChB,CAAC,CACH,CACF,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;AACtB,CAAC,CAAC,CAAC"}
|
package/dist/src/mockS3.d.ts
CHANGED
package/dist/src/mockS3.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockS3.d.ts","sourceRoot":"","sources":["../../src/mockS3.ts"],"names":[],"mappings":"AAAA,OAAO,EAgBL,QAAQ,EACT,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"mockS3.d.ts","sourceRoot":"","sources":["../../src/mockS3.ts"],"names":[],"mappings":"AAAA,OAAO,EAgBL,QAAQ,EACT,MAAM,oBAAoB,CAAC;AAwB5B;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAMhD;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,yCAAyC;IACzC,cAAc,EAAE,MAAM,CAAC;IACvB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;CAChB;AAYD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAC7B,cAAc,EACd,QAAQ,EACR,MAAM,GACP,EAAE,qBAAqB,GAAG,QAAQ,CAuHlC"}
|
package/dist/src/mockS3.js
CHANGED
|
@@ -1,106 +1,166 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
5
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
36
|
exports.resetMocks = resetMocks;
|
|
7
37
|
exports.createS3Client = createS3Client;
|
|
8
38
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
9
39
|
const aws_sdk_client_mock_1 = require("aws-sdk-client-mock");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const mockS3ByBucket = new Map();
|
|
40
|
+
const path_1 = require("path");
|
|
41
|
+
const s3Mock = __importStar(require("mock-aws-s3"));
|
|
42
|
+
const bucketContexts = new Map();
|
|
14
43
|
/**
|
|
15
44
|
* Resets mocks for a specific bucket. If no bucket provided, resets all mocks.
|
|
45
|
+
* @param bucket - Optional bucket name to reset
|
|
16
46
|
*/
|
|
17
47
|
function resetMocks(bucket) {
|
|
18
48
|
if (bucket) {
|
|
19
|
-
|
|
20
|
-
mockClientsByBucket.delete(bucket);
|
|
21
|
-
mockS3ByBucket.delete(bucket);
|
|
49
|
+
bucketContexts.delete(bucket);
|
|
22
50
|
}
|
|
23
51
|
else {
|
|
24
|
-
|
|
25
|
-
mockClientsByBucket.clear();
|
|
26
|
-
mockS3ByBucket.clear();
|
|
52
|
+
bucketContexts.clear();
|
|
27
53
|
}
|
|
28
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Validates and retrieves bucket context, throwing an error if not found
|
|
57
|
+
* @param bucket - Bucket name to validate
|
|
58
|
+
* @returns BucketContext for the specified bucket
|
|
59
|
+
*/
|
|
60
|
+
function getBucketContext(bucket) {
|
|
61
|
+
const context = bucketContexts.get(bucket);
|
|
62
|
+
return context;
|
|
63
|
+
}
|
|
29
64
|
/**
|
|
30
65
|
* Creates a mocked S3 instance for a specific bucket.
|
|
31
66
|
* Each bucket gets its own mock instance to prevent interference.
|
|
32
67
|
*/
|
|
33
68
|
function createS3Client({ localDirectory, s3Client, bucket, }) {
|
|
34
|
-
if (!
|
|
35
|
-
|
|
36
|
-
clientsByBucket.set(bucket, s3Client);
|
|
69
|
+
if (!bucket) {
|
|
70
|
+
throw new Error('Bucket name is required');
|
|
37
71
|
}
|
|
38
|
-
if (!
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
client
|
|
55
|
-
|
|
56
|
-
|
|
72
|
+
if (!localDirectory) {
|
|
73
|
+
throw new Error('Local directory is required');
|
|
74
|
+
}
|
|
75
|
+
let context = bucketContexts.get(bucket);
|
|
76
|
+
if (context) {
|
|
77
|
+
return context.client;
|
|
78
|
+
}
|
|
79
|
+
const client = s3Client || new client_s3_1.S3Client();
|
|
80
|
+
const clientSend = client.send.bind(client);
|
|
81
|
+
const mockClientInstance = (0, aws_sdk_client_mock_1.mockClient)(client);
|
|
82
|
+
s3Mock.config.basePath = (0, path_1.resolve)(localDirectory);
|
|
83
|
+
const mockS3 = new s3Mock.S3({
|
|
84
|
+
params: { Bucket: bucket },
|
|
85
|
+
region: 'us-west-2',
|
|
86
|
+
});
|
|
87
|
+
context = {
|
|
88
|
+
client,
|
|
89
|
+
mockClient: mockClientInstance,
|
|
90
|
+
mockS3,
|
|
91
|
+
localDirectory: (0, path_1.resolve)(localDirectory),
|
|
92
|
+
};
|
|
93
|
+
bucketContexts.set(bucket, context);
|
|
94
|
+
client._goldstackRequests = [];
|
|
95
|
+
const operations = [
|
|
96
|
+
{ command: client_s3_1.PutObjectCommand, method: 'putObject' },
|
|
97
|
+
{ command: client_s3_1.GetObjectCommand, method: 'getObject' },
|
|
98
|
+
{ command: client_s3_1.CreateBucketCommand, method: 'createBucket' },
|
|
99
|
+
{ command: client_s3_1.DeleteBucketCommand, method: 'deleteBucket' },
|
|
100
|
+
{ command: client_s3_1.ListObjectsCommand, method: 'listObjects' },
|
|
101
|
+
{ command: client_s3_1.ListObjectsV2Command, method: 'listObjectsV2' },
|
|
102
|
+
{ command: client_s3_1.DeleteObjectsCommand, method: 'deleteObjects' },
|
|
103
|
+
{ command: client_s3_1.DeleteObjectCommand, method: 'deleteObject' },
|
|
104
|
+
{ command: client_s3_1.HeadObjectCommand, method: 'headObject' },
|
|
105
|
+
{ command: client_s3_1.CopyObjectCommand, method: 'copyObject' },
|
|
106
|
+
{ command: client_s3_1.GetObjectTaggingCommand, method: 'getObjectTagging' },
|
|
107
|
+
{ command: client_s3_1.PutObjectTaggingCommand, method: 'putObjectTagging' },
|
|
108
|
+
{ command: client_s3_1.ListBucketsCommand, method: undefined }, // not supported
|
|
109
|
+
];
|
|
110
|
+
operations.forEach(({ command, method }) => {
|
|
111
|
+
mockClientInstance
|
|
112
|
+
.on(command)
|
|
113
|
+
.callsFake(async (input) => {
|
|
114
|
+
const context = getBucketContext(input.Bucket);
|
|
115
|
+
if (!context) {
|
|
116
|
+
// if no context defined for bucket, send command to real client
|
|
117
|
+
const commandWithInput = new command(input);
|
|
118
|
+
return await clientSend(commandWithInput);
|
|
119
|
+
}
|
|
120
|
+
if (!method) {
|
|
121
|
+
throw new Error(`Method ${command.name} not implemented.`);
|
|
122
|
+
}
|
|
123
|
+
s3Mock.config.basePath = context.localDirectory;
|
|
124
|
+
context.client._goldstackRequests.push({
|
|
125
|
+
command: command.name,
|
|
57
126
|
input,
|
|
58
127
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const res = await resOperation.promise();
|
|
62
|
-
const output = { ...res };
|
|
63
|
-
const body = {
|
|
64
|
-
transformToString: async () => { var _a; return ((_a = res.Body) === null || _a === void 0 ? void 0 : _a.toString()) || ''; },
|
|
65
|
-
pipe: (destination, options) => {
|
|
66
|
-
return resOperation.createReadStream().pipe(destination, options);
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
output.Body = body;
|
|
70
|
-
return output;
|
|
128
|
+
if (process.env.GOLDSTACK_DEBUG) {
|
|
129
|
+
console.debug(`Performing command ${command.name} on mock S3 bucket ${input.Bucket}.\n Folder for local bucket: ${context.localDirectory}`);
|
|
71
130
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
131
|
+
const operation = context.mockS3[method](input);
|
|
132
|
+
if (method === 'getObject') {
|
|
133
|
+
let stream;
|
|
134
|
+
try {
|
|
135
|
+
const res = await operation.promise();
|
|
136
|
+
const output = { ...res };
|
|
137
|
+
const body = {
|
|
138
|
+
transformToString: async () => { var _a; return ((_a = res.Body) === null || _a === void 0 ? void 0 : _a.toString()) || ''; },
|
|
139
|
+
pipe: (destination, options) => {
|
|
140
|
+
stream = operation.createReadStream();
|
|
141
|
+
return stream.pipe(destination, options);
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
output.Body = body;
|
|
145
|
+
return output;
|
|
146
|
+
}
|
|
147
|
+
catch (e) {
|
|
148
|
+
if (stream) {
|
|
149
|
+
stream.destroy();
|
|
150
|
+
}
|
|
151
|
+
const awsError = e;
|
|
152
|
+
if (awsError.code === 'NoSuchKey') {
|
|
153
|
+
throw new client_s3_1.NoSuchKey({
|
|
154
|
+
message: e.message,
|
|
155
|
+
$metadata: {},
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
throw e;
|
|
79
159
|
}
|
|
80
|
-
throw e;
|
|
81
160
|
}
|
|
161
|
+
return await operation.promise();
|
|
82
162
|
});
|
|
83
|
-
wrappedAsIs(client, mockS3, client_s3_1.CreateBucketCommand, 'createBucket', s3Client);
|
|
84
|
-
wrappedAsIs(client, mockS3, client_s3_1.DeleteBucketCommand, 'deleteBucket', s3Client);
|
|
85
|
-
wrappedAsIs(client, mockS3, client_s3_1.ListObjectsCommand, 'listObjects', s3Client);
|
|
86
|
-
wrappedAsIs(client, mockS3, client_s3_1.ListObjectsV2Command, 'listObjectsV2', s3Client);
|
|
87
|
-
wrappedAsIs(client, mockS3, client_s3_1.DeleteObjectsCommand, 'deleteObjects', s3Client);
|
|
88
|
-
wrappedAsIs(client, mockS3, client_s3_1.DeleteObjectCommand, 'deleteObject', s3Client);
|
|
89
|
-
wrappedAsIs(client, mockS3, client_s3_1.HeadObjectCommand, 'headObject', s3Client);
|
|
90
|
-
wrappedAsIs(client, mockS3, client_s3_1.CopyObjectCommand, 'copyObject', s3Client);
|
|
91
|
-
wrappedAsIs(client, mockS3, client_s3_1.GetObjectTaggingCommand, 'getObjectTagging', s3Client);
|
|
92
|
-
wrappedAsIs(client, mockS3, client_s3_1.PutObjectTaggingCommand, 'putObjectTagging', s3Client);
|
|
93
|
-
notSupported(client, client_s3_1.ListBucketsCommand);
|
|
94
|
-
}
|
|
95
|
-
return s3Client;
|
|
96
|
-
}
|
|
97
|
-
function wrappedAsIs(client, mockS3, command, methodName, s3Client) {
|
|
98
|
-
client.on(command).callsFake(async (input) => {
|
|
99
|
-
s3Client._goldstackRequests.push({ command: command.name, input });
|
|
100
|
-
return await mockS3[methodName](input).promise();
|
|
101
163
|
});
|
|
102
|
-
|
|
103
|
-
function notSupported(client, command) {
|
|
104
|
-
client.on(command).rejects('Method ' + command.name + ' not implemented.');
|
|
164
|
+
return client;
|
|
105
165
|
}
|
|
106
166
|
//# sourceMappingURL=mockS3.js.map
|
package/dist/src/mockS3.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockS3.js","sourceRoot":"","sources":["../../src/mockS3.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version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AAS,CAAC,OAAO,EAAE,CAAC;oBACtC,MAAM,MAAM,GAAoB,EAAE,GAAI,GAAW,EAAE,CAAC;oBAEpD,MAAM,IAAI,GAAoC;wBAC5C,iBAAiB,EAAE,KAAK,IAAI,EAAE,WAAC,OAAA,CAAA,MAAA,GAAG,CAAC,IAAI,0CAAE,QAAQ,EAAE,KAAI,EAAE,CAAA,EAAA;wBACzD,IAAI,EAAE,CAAC,WAAwB,EAAE,OAAQ,EAAE,EAAE;4BAC3C,MAAM,GAAG,SAAS,CAAC,gBAAgB,EAAE,CAAC;4BACtC,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;wBAC3C,CAAC;qBACK,CAAC;oBAET,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;oBACnB,OAAO,MAAM,CAAC;gBAChB,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,IAAI,MAAM,EAAE,CAAC;wBACX,MAAM,CAAC,OAAO,EAAE,CAAC;oBACnB,CAAC;oBAED,MAAM,QAAQ,GAAG,CAAa,CAAC;oBAC/B,IAAI,QAAQ,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;wBAClC,MAAM,IAAI,qBAAS,CAAC;4BAClB,OAAO,EAAE,CAAC,CAAC,OAAO;4BAClB,SAAS,EAAE,EAAE;yBACd,CAAC,CAAC;oBACL,CAAC;oBACD,MAAM,CAAC,CAAC;gBACV,CAAC;YACH,CAAC;YAED,OAAO,MAAM,SAAS,CAAC,OAAO,EAAE,CAAC;QACnC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mock-aws-s3-v3",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.3",
|
|
4
4
|
"description": "Local file-based mock for AWS S3 for unit and local testing for AWS JavaScript SDK v3+.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -34,22 +34,22 @@
|
|
|
34
34
|
"version:apply": "utils-git changed --exec \"yarn version $@ && yarn version apply\""
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@aws-sdk/client-s3": "3.
|
|
38
|
-
"@smithy/types": "^
|
|
39
|
-
"@types/sinon": "^17.0.
|
|
40
|
-
"aws-sdk-client-mock": "^4.0
|
|
37
|
+
"@aws-sdk/client-s3": "^3.844.0",
|
|
38
|
+
"@smithy/types": "^4.3.1",
|
|
39
|
+
"@types/sinon": "^17.0.4",
|
|
40
|
+
"aws-sdk-client-mock": "^4.1.0",
|
|
41
41
|
"mock-aws-s3": "^4.0.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@goldstack/utils-git": "0.2.
|
|
45
|
-
"@swc/core": "^1.
|
|
46
|
-
"@swc/jest": "^0.2.
|
|
44
|
+
"@goldstack/utils-git": "0.2.13",
|
|
45
|
+
"@swc/core": "^1.12.11",
|
|
46
|
+
"@swc/jest": "^0.2.39",
|
|
47
47
|
"@types/jest": "^29.5.14",
|
|
48
48
|
"@types/mock-aws-s3": "^2.6.3",
|
|
49
|
-
"@types/node": "^
|
|
49
|
+
"@types/node": "^24.0.13",
|
|
50
50
|
"jest": "^29.7.0",
|
|
51
51
|
"rimraf": "^3.0.2",
|
|
52
|
-
"typescript": "^5.
|
|
52
|
+
"typescript": "^5.8.3"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"main": "dist/src/mockS3.js"
|