@dimah-s3/core 0.7.4 → 0.8.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.
- package/README.md +4 -2
- package/dist/create-s3-client.d.ts +17 -3
- package/dist/create-s3-client.d.ts.map +1 -1
- package/dist/error-codes.d.ts +70 -0
- package/dist/error-codes.d.ts.map +1 -0
- package/dist/error.d.ts +31 -25
- package/dist/error.d.ts.map +1 -1
- package/dist/helpers/default-object-key.d.ts +6 -0
- package/dist/helpers/default-object-key.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +2 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/truncate-file-name.d.ts +0 -2
- package/dist/helpers/truncate-file-name.d.ts.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +240 -153
- package/dist/index.js.map +1 -1
- package/dist/plugin/create-s3-fetch.d.ts +11 -0
- package/dist/plugin/create-s3-fetch.d.ts.map +1 -0
- package/dist/plugin/define-client-plugin.d.ts +10 -3
- package/dist/plugin/define-client-plugin.d.ts.map +1 -1
- package/dist/plugin/index.d.ts +3 -3
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/plugin-path.d.ts +9 -0
- package/dist/plugin/plugin-path.d.ts.map +1 -0
- package/dist/plugin/types.d.ts +28 -18
- package/dist/plugin/types.d.ts.map +1 -1
- package/dist/routes.d.ts +10 -9
- package/dist/routes.d.ts.map +1 -1
- package/dist/schema/delete.d.ts +6 -0
- package/dist/schema/delete.d.ts.map +1 -0
- package/dist/schema/download.d.ts +9 -0
- package/dist/schema/download.d.ts.map +1 -0
- package/dist/schema/error.d.ts +14 -0
- package/dist/schema/error.d.ts.map +1 -0
- package/dist/schema/index.d.ts +8 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/multipart.d.ts +41 -0
- package/dist/schema/multipart.d.ts.map +1 -0
- package/dist/schema/shared.d.ts +11 -0
- package/dist/schema/shared.d.ts.map +1 -0
- package/dist/schema/upload.d.ts +19 -0
- package/dist/schema/upload.d.ts.map +1 -0
- package/dist/types/requests.d.ts +18 -75
- package/dist/types/requests.d.ts.map +1 -1
- package/package.json +7 -2
- package/dist/index.test.d.ts +0 -2
- package/dist/index.test.d.ts.map +0 -1
- package/dist/plugin/create-fetcher.d.ts +0 -10
- package/dist/plugin/create-fetcher.d.ts.map +0 -1
- package/dist/plugin/plugin-endpoint-path.d.ts +0 -9
- package/dist/plugin/plugin-endpoint-path.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -25,11 +25,13 @@ export const api = createS3Client({
|
|
|
25
25
|
try {
|
|
26
26
|
await api.download(key);
|
|
27
27
|
} catch (err) {
|
|
28
|
-
if (err instanceof DimahS3Error)
|
|
28
|
+
if (err instanceof DimahS3Error)
|
|
29
|
+
console.error(err.statusCode, err.code, err.message);
|
|
29
30
|
}
|
|
30
31
|
```
|
|
31
32
|
|
|
32
|
-
For React apps, prefer `createS3Client` from `@dimah-s3/react` (returns
|
|
33
|
+
For React apps, prefer `createS3Client` from `@dimah-s3/react` (returns the API
|
|
34
|
+
object plus a bound `Provider` / `useApi`).
|
|
33
35
|
|
|
34
36
|
## License
|
|
35
37
|
|
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
import type { S3Api } from "./types";
|
|
2
|
-
import {
|
|
2
|
+
import { S3_ERROR_CODES } from "./error";
|
|
3
|
+
import { type ClientPluginMethodsMap, type S3ClientFetchOptions, type S3ClientPlugin, type S3Fetch } from "./plugin";
|
|
3
4
|
/** Options for {@link createS3Client}. */
|
|
4
5
|
export type CreateS3ClientOptions<P extends readonly S3ClientPlugin[] = readonly S3ClientPlugin[]> = {
|
|
5
6
|
/** API path prefix — must match server `basePath`. @default "/api/s3" */
|
|
6
7
|
basePath?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Absolute client origin + path (e.g. `https://api.example.com/api/s3`).
|
|
10
|
+
* Wins over {@link basePath} when both are set.
|
|
11
|
+
*/
|
|
12
|
+
baseURL?: string;
|
|
7
13
|
/** Client plugins (e.g. `dbClient()` from `@dimah-s3/db/client`). */
|
|
8
14
|
plugins?: P;
|
|
9
15
|
} & S3ClientFetchOptions;
|
|
16
|
+
/** Browser client returned by {@link createS3Client}. */
|
|
17
|
+
export type CreateS3ClientResult<P extends readonly S3ClientPlugin[] = []> = S3Api & ClientPluginMethodsMap<P> & {
|
|
18
|
+
$ERROR_CODES: typeof S3_ERROR_CODES;
|
|
19
|
+
$fetch: S3Fetch;
|
|
20
|
+
$Infer: {
|
|
21
|
+
plugins: P;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
10
24
|
/**
|
|
11
25
|
* Browser (or isomorphic) client for the dimah-s3 HTTP API.
|
|
12
26
|
*
|
|
13
27
|
* For React apps prefer `createS3Client` from `@dimah-s3/react` — same options,
|
|
14
|
-
* plus a bound `
|
|
28
|
+
* plus a bound `Provider` / typed `useApi` on the client object.
|
|
15
29
|
*
|
|
16
30
|
* ```ts
|
|
17
31
|
* import { createS3Client } from "@dimah-s3/core";
|
|
@@ -25,5 +39,5 @@ export type CreateS3ClientOptions<P extends readonly S3ClientPlugin[] = readonly
|
|
|
25
39
|
* await api.db.listObjects();
|
|
26
40
|
* ```
|
|
27
41
|
*/
|
|
28
|
-
export declare function createS3Client<const P extends readonly S3ClientPlugin[] = []>(options?: CreateS3ClientOptions<P>):
|
|
42
|
+
export declare function createS3Client<const P extends readonly S3ClientPlugin[] = []>(options?: CreateS3ClientOptions<P>): CreateS3ClientResult<P>;
|
|
29
43
|
//# sourceMappingURL=create-s3-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-s3-client.d.ts","sourceRoot":"","sources":["../src/create-s3-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAQV,KAAK,EAGN,MAAM,SAAS,CAAC;AAEjB,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"create-s3-client.d.ts","sourceRoot":"","sources":["../src/create-s3-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAQV,KAAK,EAGN,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,OAAO,EACb,MAAM,UAAU,CAAC;AAOlB,0CAA0C;AAC1C,MAAM,MAAM,qBAAqB,CAC/B,CAAC,SAAS,SAAS,cAAc,EAAE,GAAG,SAAS,cAAc,EAAE,IAC7D;IACF,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,OAAO,CAAC,EAAE,CAAC,CAAC;CACb,GAAG,oBAAoB,CAAC;AA0FzB,yDAAyD;AACzD,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,SAAS,cAAc,EAAE,GAAG,EAAE,IACvE,KAAK,GACH,sBAAsB,CAAC,CAAC,CAAC,GAAG;IAC1B,YAAY,EAAE,OAAO,cAAc,CAAC;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE;QAAE,OAAO,EAAE,CAAC,CAAA;KAAE,CAAC;CACxB,CAAC;AAEN;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,SAAS,cAAc,EAAE,GAAG,EAAE,EAC3E,OAAO,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,GACjC,oBAAoB,CAAC,CAAC,CAAC,CA2BzB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pair each stable API `code` with its English `message`.
|
|
3
|
+
* Same shape as Better Auth `defineErrorCodes`.
|
|
4
|
+
*/
|
|
5
|
+
export declare function defineErrorCodes<const T extends Record<string, string>>(messages: T): {
|
|
6
|
+
readonly [K in keyof T]: {
|
|
7
|
+
readonly code: K;
|
|
8
|
+
readonly message: T[K];
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Domain error catalog. Zod failures share {@link S3_ERROR_CODES.VALIDATION_ERROR};
|
|
13
|
+
* HTTP 404 for unknown routes uses {@link S3_ERROR_CODES.NOT_FOUND}.
|
|
14
|
+
*/
|
|
15
|
+
export declare const S3_ERROR_CODES: {
|
|
16
|
+
readonly NOT_FOUND: {
|
|
17
|
+
readonly code: "NOT_FOUND";
|
|
18
|
+
readonly message: "Not Found";
|
|
19
|
+
};
|
|
20
|
+
readonly UNAUTHORIZED: {
|
|
21
|
+
readonly code: "UNAUTHORIZED";
|
|
22
|
+
readonly message: "Unauthorized";
|
|
23
|
+
};
|
|
24
|
+
readonly FORBIDDEN: {
|
|
25
|
+
readonly code: "FORBIDDEN";
|
|
26
|
+
readonly message: "Forbidden";
|
|
27
|
+
};
|
|
28
|
+
readonly CONFLICT: {
|
|
29
|
+
readonly code: "CONFLICT";
|
|
30
|
+
readonly message: "Conflict";
|
|
31
|
+
};
|
|
32
|
+
readonly INTERNAL_ERROR: {
|
|
33
|
+
readonly code: "INTERNAL_ERROR";
|
|
34
|
+
readonly message: "Internal server error";
|
|
35
|
+
};
|
|
36
|
+
readonly OBJECT_NOT_FOUND: {
|
|
37
|
+
readonly code: "OBJECT_NOT_FOUND";
|
|
38
|
+
readonly message: "Object not found";
|
|
39
|
+
};
|
|
40
|
+
readonly FEATURE_DISABLED: {
|
|
41
|
+
readonly code: "FEATURE_DISABLED";
|
|
42
|
+
readonly message: "{feature} is disabled";
|
|
43
|
+
};
|
|
44
|
+
readonly INVALID_KEY: {
|
|
45
|
+
readonly code: "INVALID_KEY";
|
|
46
|
+
readonly message: "Object key is invalid";
|
|
47
|
+
};
|
|
48
|
+
readonly INVALID_BUCKET: {
|
|
49
|
+
readonly code: "INVALID_BUCKET";
|
|
50
|
+
readonly message: "Bucket is not allowed";
|
|
51
|
+
};
|
|
52
|
+
readonly S3_NETWORK_ERROR: {
|
|
53
|
+
readonly code: "S3_NETWORK_ERROR";
|
|
54
|
+
readonly message: "S3 endpoint unreachable ({code}): check your endpoint URL and network connectivity";
|
|
55
|
+
};
|
|
56
|
+
readonly FILE_SIZE_REQUIRED_UPLOAD: {
|
|
57
|
+
readonly code: "FILE_SIZE_REQUIRED_UPLOAD";
|
|
58
|
+
readonly message: "fileSize is required when upload.requireFileSize is enabled";
|
|
59
|
+
};
|
|
60
|
+
readonly FILE_SIZE_REQUIRED_MULTIPART: {
|
|
61
|
+
readonly code: "FILE_SIZE_REQUIRED_MULTIPART";
|
|
62
|
+
readonly message: "fileSize is required when multipart.requireFileSize is enabled";
|
|
63
|
+
};
|
|
64
|
+
readonly VALIDATION_ERROR: {
|
|
65
|
+
readonly code: "VALIDATION_ERROR";
|
|
66
|
+
readonly message: "Validation Error";
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export type S3ErrorCode = keyof typeof S3_ERROR_CODES;
|
|
70
|
+
//# sourceMappingURL=error-codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../src/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACrE,QAAQ,EAAE,CAAC,GACV;IAAE,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG;QAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE;CAAE,CAQ3E;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBzB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,cAAc,CAAC"}
|
package/dist/error.d.ts
CHANGED
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
readonly INVALID_JSON: "INVALID_JSON";
|
|
5
|
-
readonly FORBIDDEN: "FORBIDDEN";
|
|
6
|
-
readonly INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
7
|
-
readonly OBJECT_NOT_FOUND: "OBJECT_NOT_FOUND";
|
|
8
|
-
readonly S3_NETWORK_ERROR: "S3_NETWORK_ERROR";
|
|
9
|
-
readonly FIELD_REQUIRED: "FIELD_REQUIRED";
|
|
10
|
-
readonly KEY_REQUIRED: "KEY_REQUIRED";
|
|
11
|
-
readonly UPLOAD_ID_REQUIRED: "UPLOAD_ID_REQUIRED";
|
|
12
|
-
readonly PART_NUMBER_INVALID: "PART_NUMBER_INVALID";
|
|
13
|
-
readonly PARTS_REQUIRED: "PARTS_REQUIRED";
|
|
14
|
-
readonly FILE_SIZE_REQUIRED_UPLOAD: "FILE_SIZE_REQUIRED_UPLOAD";
|
|
15
|
-
readonly FILE_SIZE_REQUIRED_MULTIPART: "FILE_SIZE_REQUIRED_MULTIPART";
|
|
16
|
-
};
|
|
17
|
-
export type S3ErrorCode = (typeof S3_ERROR_CODES)[keyof typeof S3_ERROR_CODES];
|
|
1
|
+
import { APIError } from "better-call/error";
|
|
2
|
+
import { type S3ErrorCode } from "./error-codes";
|
|
3
|
+
export { defineErrorCodes, S3_ERROR_CODES, type S3ErrorCode, } from "./error-codes";
|
|
18
4
|
export type DimahS3ErrorParams = Record<string, string | number>;
|
|
19
|
-
export type
|
|
5
|
+
export type DimahS3ErrorStatus = NonNullable<ConstructorParameters<typeof APIError>[0]>;
|
|
6
|
+
export type DimahS3ErrorBody = {
|
|
7
|
+
message?: string;
|
|
8
|
+
code?: string;
|
|
20
9
|
cause?: unknown;
|
|
21
|
-
|
|
10
|
+
params?: DimahS3ErrorParams;
|
|
11
|
+
} & Record<string, unknown>;
|
|
12
|
+
type RawError = {
|
|
13
|
+
code: string;
|
|
14
|
+
message: string;
|
|
22
15
|
params?: DimahS3ErrorParams;
|
|
23
16
|
};
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Typed API error. Same constructor as better-call {@link APIError}
|
|
19
|
+
* (`status`, `body`) so `ctx.error(...)` and `DimahS3Error.from(...)` share
|
|
20
|
+
* a shape. HTTP serializes `{ message, code?, params? }` via native `toResponse`.
|
|
21
|
+
*/
|
|
22
|
+
export declare class DimahS3Error extends APIError {
|
|
23
|
+
constructor(status?: DimahS3ErrorStatus, body?: DimahS3ErrorBody, headers?: HeadersInit);
|
|
24
|
+
get code(): string | undefined;
|
|
25
|
+
get params(): DimahS3ErrorParams | undefined;
|
|
26
|
+
/** Throw a catalog (or custom) `{ code, message }` with an HTTP status. */
|
|
27
|
+
static from(status: DimahS3ErrorStatus, error: RawError): DimahS3Error;
|
|
28
|
+
static fromStatus(status: DimahS3ErrorStatus, body?: DimahS3ErrorBody): DimahS3Error;
|
|
30
29
|
}
|
|
30
|
+
/** True for {@link DimahS3Error} and better-call `APIError` (including duck-typed copies). */
|
|
31
|
+
export declare function isAPIError(error: unknown): error is APIError;
|
|
32
|
+
export declare function isDimahS3Error(error: unknown): error is DimahS3Error;
|
|
33
|
+
/** True when `error` is a {@link DimahS3Error} with this catalog `code`. */
|
|
34
|
+
export declare function isS3ErrorCode<C extends S3ErrorCode>(error: unknown, code: C): error is DimahS3Error & {
|
|
35
|
+
code: C;
|
|
36
|
+
};
|
|
31
37
|
//# sourceMappingURL=error.d.ts.map
|
package/dist/error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,KAAK,WAAW,GACjB,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAEjE,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAC1C,qBAAqB,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAC1C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5B,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B,CAAC;AAEF;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,QAAQ;IACxC,YACE,MAAM,GAAE,kBAAkC,EAC1C,IAAI,CAAC,EAAE,gBAAgB,EACvB,OAAO,CAAC,EAAE,WAAW,EAQtB;IAED,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED,IAAI,MAAM,IAAI,kBAAkB,GAAG,SAAS,CAE3C;IAED,2EAA2E;IAC3E,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,QAAQ,GAAG,YAAY,CAMrE;IAED,MAAM,CAAC,UAAU,CACf,MAAM,EAAE,kBAAkB,EAC1B,IAAI,CAAC,EAAE,gBAAgB,GACtB,YAAY,CAEd;CACF;AAED,8FAA8F;AAC9F,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAI5D;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAKpE;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,CAAC,SAAS,WAAW,EACjD,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,CAAC,GACN,KAAK,IAAI,YAAY,GAAG;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAErC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-object-key.d.ts","sourceRoot":"","sources":["../../src/helpers/default-object-key.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAEnD"}
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -6,5 +6,6 @@ export { parseFileName } from "./parse-file-name";
|
|
|
6
6
|
export { formatFileSize } from "./format-file-size";
|
|
7
7
|
export { buildContentDisposition } from "./build-content-disposition";
|
|
8
8
|
export { sanitizeFileName } from "./sanitize-file-name";
|
|
9
|
-
export {
|
|
9
|
+
export { defaultObjectKey } from "./default-object-key";
|
|
10
|
+
export { truncateFileName } from "./truncate-file-name";
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -2,6 +2,4 @@
|
|
|
2
2
|
* Truncates a filename while preserving the extension when possible.
|
|
3
3
|
*/
|
|
4
4
|
export declare function truncateFileName(name: string, maxChars?: number): string;
|
|
5
|
-
/** @deprecated Use {@link truncateFileName}. */
|
|
6
|
-
export declare const truncateFilename: typeof truncateFileName;
|
|
7
5
|
//# sourceMappingURL=truncate-file-name.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"truncate-file-name.d.ts","sourceRoot":"","sources":["../../src/helpers/truncate-file-name.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,SAAK,GAAG,MAAM,CAYpE
|
|
1
|
+
{"version":3,"file":"truncate-file-name.d.ts","sourceRoot":"","sources":["../../src/helpers/truncate-file-name.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,SAAK,GAAG,MAAM,CAYpE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export * from "./types";
|
|
2
2
|
export * from "./helpers";
|
|
3
|
-
export
|
|
3
|
+
export * from "./schema";
|
|
4
|
+
export { DimahS3Error, defineErrorCodes, isAPIError, isDimahS3Error, isS3ErrorCode, S3_ERROR_CODES, type DimahS3ErrorBody, type DimahS3ErrorParams, type DimahS3ErrorStatus, type S3ErrorCode, } from "./error";
|
|
4
5
|
export { S3_API_BASE_PATH, normalizeS3ApiBasePath, S3_API_ROUTES, } from "./routes";
|
|
5
|
-
export { createS3Client, type CreateS3ClientOptions } from "./create-s3-client";
|
|
6
|
-
export {
|
|
7
|
-
export type { ClientPluginMethodsMap, ReservedClientKey,
|
|
6
|
+
export { createS3Client, type CreateS3ClientOptions, type CreateS3ClientResult, } from "./create-s3-client";
|
|
7
|
+
export { createS3Fetch, defineClientPlugin, pluginPath, RESERVED_CLIENT_KEYS, } from "./plugin";
|
|
8
|
+
export type { ClientPluginMethodsMap, ReservedClientKey, S3ClientFetchOptions, S3ClientPlugin, S3Fetch, } from "./plugin";
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,OAAO,EACL,YAAY,EACZ,cAAc,EACd,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,aAAa,EACb,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,WAAW,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,aAAa,GACd,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,OAAO,GACR,MAAM,UAAU,CAAC"}
|