tero 0.1.2 → 0.3.0

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.
@@ -0,0 +1,21 @@
1
+ /** Shared S3 client options: endpoint/path-style for R2 and custom endpoints, and request timeouts. */
2
+ export function buildS3ClientConfig(cloudConfig) {
3
+ const clientConfig = {
4
+ region: cloudConfig.region,
5
+ credentials: {
6
+ accessKeyId: cloudConfig.accessKeyId,
7
+ secretAccessKey: cloudConfig.secretAccessKey,
8
+ },
9
+ requestHandler: {
10
+ requestTimeout: cloudConfig.requestTimeoutMs ?? 30_000,
11
+ connectionTimeout: cloudConfig.connectionTimeoutMs ?? 5_000,
12
+ // Without this the SDK only logs a warning on timeout and keeps waiting.
13
+ throwOnRequestTimeout: true,
14
+ },
15
+ };
16
+ if (cloudConfig.endpoint) {
17
+ clientConfig.endpoint = cloudConfig.endpoint;
18
+ clientConfig.forcePathStyle = true; // Required for R2
19
+ }
20
+ return clientConfig;
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tero",
3
- "version": "0.1.2",
3
+ "version": "0.3.0",
4
4
  "description": "Tero is a JSON database that provides ACID transactions, automated cloud backup, and automatic cloud recovery",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",