@dimah-s3/core 0.7.3 → 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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { S3ClientFetchOptions, S3Fetch } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Shared `$fetch` for core routes and client plugins.
|
|
4
|
+
* `base` is a normalized API prefix (e.g. `/api/s3`).
|
|
5
|
+
*
|
|
6
|
+
* Non-OK JSON matching {@link s3FetchErrorSchema} throws {@link DimahS3Error}.
|
|
7
|
+
* `throw: true` is the better-fetch flag; `onError` maps onto the same class
|
|
8
|
+
* the server throws so `instanceof DimahS3Error` works in the browser.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createS3Fetch(base: string, options?: S3ClientFetchOptions): S3Fetch;
|
|
11
|
+
//# sourceMappingURL=create-s3-fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-s3-fetch.d.ts","sourceRoot":"","sources":["../../src/plugin/create-s3-fetch.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AA0C7D;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAoBT"}
|
|
@@ -3,16 +3,23 @@ import type { S3ClientPlugin } from "./types";
|
|
|
3
3
|
* Identity helper that preserves literal `id` and method types for
|
|
4
4
|
* {@link createS3Client} inference (`api[id]`).
|
|
5
5
|
*
|
|
6
|
+
* `$InferServerPlugin` must share the same `id` as the client plugin.
|
|
7
|
+
*
|
|
6
8
|
* ```ts
|
|
7
9
|
* export function dbClient() {
|
|
8
10
|
* return defineClientPlugin({
|
|
9
11
|
* id: "db",
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
+
* $InferServerPlugin: {} as ReturnType<typeof db>,
|
|
13
|
+
* getActions: ($fetch) => ({
|
|
14
|
+
* listObjects: () => $fetch("/db/objects", { method: "GET" }),
|
|
12
15
|
* }),
|
|
13
16
|
* });
|
|
14
17
|
* }
|
|
15
18
|
* ```
|
|
16
19
|
*/
|
|
17
|
-
export declare function defineClientPlugin<Id extends string, TMethods extends Record<string, unknown> = Record<string, unknown
|
|
20
|
+
export declare function defineClientPlugin<Id extends string, TMethods extends Record<string, unknown> = Record<string, unknown>, TServer extends {
|
|
21
|
+
id: Id;
|
|
22
|
+
} = {
|
|
23
|
+
id: Id;
|
|
24
|
+
}>(plugin: S3ClientPlugin<Id, TMethods, TServer>): S3ClientPlugin<Id, TMethods, TServer>;
|
|
18
25
|
//# sourceMappingURL=define-client-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-client-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/define-client-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C
|
|
1
|
+
{"version":3,"file":"define-client-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/define-client-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAChC,EAAE,SAAS,MAAM,EACjB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,OAAO,SAAS;IAAE,EAAE,EAAE,EAAE,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,EAAE,CAAA;CAAE,EAEvC,MAAM,EAAE,cAAc,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,GAC5C,cAAc,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,CAEvC"}
|
package/dist/plugin/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { createS3Fetch } from "./create-s3-fetch";
|
|
2
2
|
export { defineClientPlugin } from "./define-client-plugin";
|
|
3
|
-
export {
|
|
4
|
-
export { RESERVED_CLIENT_KEYS, type ClientPluginMethodsMap, type ReservedClientKey, type
|
|
3
|
+
export { pluginPath } from "./plugin-path";
|
|
4
|
+
export { RESERVED_CLIENT_KEYS, type ClientPluginMethodsMap, type ReservedClientKey, type S3ClientFetchOptions, type S3ClientPlugin, type S3Fetch, } from "./types";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,oBAAoB,EACpB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,OAAO,GACb,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a plugin HTTP path under `basePath`.
|
|
3
|
+
* Server endpoints and client `getActions` share this so URLs never diverge.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* pluginPath("db", "objects") // "/db/objects"
|
|
7
|
+
*/
|
|
8
|
+
export declare function pluginPath(pluginId: string, path: string): string;
|
|
9
|
+
//# sourceMappingURL=plugin-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-path.d.ts","sourceRoot":"","sources":["../../src/plugin/plugin-path.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjE"}
|
package/dist/plugin/types.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
import type { BetterFetch } from "@better-fetch/fetch";
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
3
|
+
* Shared `$fetch` for core routes and client plugins.
|
|
4
|
+
* Always created with `throw: true` and `errorSchema` (`s3FetchErrorSchema`) —
|
|
5
|
+
* non-OK JSON becomes {@link DimahS3Error} via `onError`.
|
|
6
|
+
*/
|
|
7
|
+
export type S3Fetch = BetterFetch<{
|
|
8
|
+
throw: true;
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* Optional fetch configuration for {@link createS3Client}.
|
|
12
|
+
* Applied to core routes and every client plugin sharing the same `$fetch`.
|
|
4
13
|
*/
|
|
5
14
|
export type S3ClientFetchOptions = {
|
|
6
15
|
/** Defaults to global `fetch` — override for SSR, tests, or logging. */
|
|
@@ -13,34 +22,35 @@ export type S3ClientFetchOptions = {
|
|
|
13
22
|
*/
|
|
14
23
|
headers?: HeadersInit | (() => HeadersInit | Promise<HeadersInit>);
|
|
15
24
|
};
|
|
16
|
-
/**
|
|
17
|
-
* Shared HTTP helper used by core `S3Api` methods and client plugins.
|
|
18
|
-
* Built once by {@link createFetcher} / {@link createS3Client}.
|
|
19
|
-
*/
|
|
20
|
-
export type S3ClientFetcher = {
|
|
21
|
-
get<T>(path: string, query?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
22
|
-
post<T>(path: string, body?: unknown): Promise<T>;
|
|
23
|
-
put<T>(path: string, body?: unknown): Promise<T>;
|
|
24
|
-
patch<T>(path: string, body?: unknown): Promise<T>;
|
|
25
|
-
delete<T>(path: string, query?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
26
|
-
};
|
|
27
25
|
/**
|
|
28
26
|
* Browser / isomorphic client plugin — mirrors server `DimahS3Plugin`
|
|
29
27
|
* (literal `id` + methods flattened onto the `createS3Client` result).
|
|
30
28
|
*
|
|
31
29
|
* @typeParam Id — unique plugin id; becomes `api[id]`.
|
|
32
|
-
* @typeParam TMethods — methods returned by {@link
|
|
30
|
+
* @typeParam TMethods — methods returned by {@link S3ClientPlugin.getActions}.
|
|
31
|
+
* @typeParam TServer — matching server plugin; `$InferServerPlugin` must share `id`.
|
|
33
32
|
*/
|
|
34
|
-
export type S3ClientPlugin<Id extends string = string, TMethods extends Record<string, unknown> = Record<string, unknown
|
|
33
|
+
export type S3ClientPlugin<Id extends string = string, TMethods extends Record<string, unknown> = Record<string, unknown>, TServer extends {
|
|
34
|
+
id: string;
|
|
35
|
+
} = {
|
|
36
|
+
id: Id;
|
|
37
|
+
}> = {
|
|
35
38
|
id: Id;
|
|
36
|
-
/**
|
|
37
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Type-only pointer at the matching server plugin (`ReturnType<typeof db>`).
|
|
41
|
+
* Constrains `id` to match the server plugin's `id`.
|
|
42
|
+
*/
|
|
43
|
+
$InferServerPlugin?: TServer & {
|
|
44
|
+
id: Id;
|
|
45
|
+
};
|
|
46
|
+
/** Build typed methods that call plugin endpoints via the shared `$fetch`. */
|
|
47
|
+
getActions: ($fetch: S3Fetch) => TMethods;
|
|
38
48
|
};
|
|
39
49
|
/** Map client plugin ids → their method bags. */
|
|
40
50
|
export type ClientPluginMethodsMap<P extends readonly S3ClientPlugin[]> = {
|
|
41
51
|
[K in P[number] as K["id"]]: K extends S3ClientPlugin<string, infer M> ? M : never;
|
|
42
52
|
};
|
|
43
53
|
/** Keys reserved on the `createS3Client` result — client plugins may not use these as ids. */
|
|
44
|
-
export declare const RESERVED_CLIENT_KEYS: readonly ["upload", "confirm", "download", "delete", "multipart"];
|
|
54
|
+
export declare const RESERVED_CLIENT_KEYS: readonly ["upload", "confirm", "download", "delete", "multipart", "$ERROR_CODES", "$fetch", "$Infer", "Provider", "useApi"];
|
|
45
55
|
export type ReservedClientKey = (typeof RESERVED_CLIENT_KEYS)[number];
|
|
46
56
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugin/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,wEAAwE;IACxE,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,qDAAqD;IACrD,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;CACpE,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugin/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,WAAW,CAAC;IAAE,KAAK,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC;AAEnD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,wEAAwE;IACxE,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,qDAAqD;IACrD,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;CACpE,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,CACxB,EAAE,SAAS,MAAM,GAAG,MAAM,EAC1B,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,OAAO,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,EAAE,CAAA;CAAE,IACzC;IACF,EAAE,EAAE,EAAE,CAAC;IACP;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,GAAG;QAAE,EAAE,EAAE,EAAE,CAAA;KAAE,CAAC;IAC1C,8EAA8E;IAC9E,UAAU,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,QAAQ,CAAC;CAC3C,CAAC;AAEF,iDAAiD;AACjD,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,SAAS,cAAc,EAAE,IAAI;KACvE,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAClE,CAAC,GACD,KAAK;CACV,CAAC;AAEF,8FAA8F;AAC9F,eAAO,MAAM,oBAAoB,YAC/B,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACR,WAAW,EACX,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,QAAQ,CACA,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/routes.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/** Default mount path for the catch-all route (`app/api/s3/[...s3]/route.ts`). */
|
|
2
2
|
export declare const S3_API_BASE_PATH = "/api/s3";
|
|
3
3
|
export declare function normalizeS3ApiBasePath(basePath: string): string;
|
|
4
|
+
/** Relative paths under {@link S3_API_BASE_PATH}. Always start with `/`. */
|
|
4
5
|
export declare const S3_API_ROUTES: {
|
|
5
|
-
readonly upload: "presign/upload";
|
|
6
|
-
readonly uploadConfirm: "presign/upload/confirm";
|
|
7
|
-
readonly download: "presign/download";
|
|
8
|
-
readonly delete: "delete";
|
|
9
|
-
readonly multipartInit: "presign/multipart/init";
|
|
10
|
-
readonly multipartPart: "presign/multipart/part";
|
|
11
|
-
readonly multipartComplete: "presign/multipart/complete";
|
|
12
|
-
readonly multipartAbort: "presign/multipart/abort";
|
|
13
|
-
readonly multipartListParts: "presign/multipart/parts";
|
|
6
|
+
readonly upload: "/presign/upload";
|
|
7
|
+
readonly uploadConfirm: "/presign/upload/confirm";
|
|
8
|
+
readonly download: "/presign/download";
|
|
9
|
+
readonly delete: "/delete";
|
|
10
|
+
readonly multipartInit: "/presign/multipart/init";
|
|
11
|
+
readonly multipartPart: "/presign/multipart/part";
|
|
12
|
+
readonly multipartComplete: "/presign/multipart/complete";
|
|
13
|
+
readonly multipartAbort: "/presign/multipart/abort";
|
|
14
|
+
readonly multipartListParts: "/presign/multipart/parts";
|
|
14
15
|
};
|
|
15
16
|
//# sourceMappingURL=routes.d.ts.map
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,eAAO,MAAM,aAAa;aACxB,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,4EAA4E;AAC5E,eAAO,MAAM,aAAa;aACxB,MAAM,EAAE,iBAAiB;aACzB,aAAa,EAAE,yBAAyB;aACxC,QAAQ,EAAE,mBAAmB;aAC7B,MAAM,EAAE,SAAS;aACjB,aAAa,EAAE,yBAAyB;aACxC,aAAa,EAAE,yBAAyB;aACxC,iBAAiB,EAAE,6BAA6B;aAChD,cAAc,EAAE,0BAA0B;aAC1C,kBAAkB,EAAE,0BAA0B;CACtC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../src/schema/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Query string — numbers arrive as strings. */
|
|
3
|
+
export declare const downloadQuerySchema: z.ZodObject<{
|
|
4
|
+
key: z.ZodString;
|
|
5
|
+
bucket: z.ZodOptional<z.ZodString>;
|
|
6
|
+
fileName: z.ZodOptional<z.ZodString>;
|
|
7
|
+
expiresIn: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
//# sourceMappingURL=download.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/schema/download.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,gDAAgD;AAChD,eAAO,MAAM,mBAAmB;;;;;iBAK9B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** `params` bag on API error JSON. */
|
|
3
|
+
export declare const s3ErrorParamsSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
4
|
+
/**
|
|
5
|
+
* better-fetch `errorSchema` — same `{ message, code?, params? }` body
|
|
6
|
+
* better-call serializes from `DimahS3Error`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const s3FetchErrorSchema: z.ZodObject<{
|
|
9
|
+
message: z.ZodString;
|
|
10
|
+
code: z.ZodOptional<z.ZodString>;
|
|
11
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type S3FetchError = z.infer<typeof s3FetchErrorSchema>;
|
|
14
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/schema/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,sCAAsC;AACtC,eAAO,MAAM,mBAAmB,2EAG/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;iBAI7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { metadataSchema, optionalTrimmedString, s3ObjectAclSchema, trimmedString, } from "./shared";
|
|
2
|
+
export { confirmBodySchema, uploadBodySchema } from "./upload";
|
|
3
|
+
export { downloadQuerySchema } from "./download";
|
|
4
|
+
export { deleteQuerySchema } from "./delete";
|
|
5
|
+
export { multipartAbortBodySchema, multipartCompleteBodySchema, multipartInitBodySchema, multipartListPartsQuerySchema, multipartSignPartBodySchema, } from "./multipart";
|
|
6
|
+
export { s3ErrorParamsSchema, s3FetchErrorSchema } from "./error";
|
|
7
|
+
export type { S3FetchError } from "./error";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,GACd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,uBAAuB,EACvB,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const multipartInitBodySchema: z.ZodObject<{
|
|
3
|
+
key: z.ZodString;
|
|
4
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
5
|
+
fileSize: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
7
|
+
bucket: z.ZodOptional<z.ZodString>;
|
|
8
|
+
expiresIn: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
acl: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
private: "private";
|
|
11
|
+
"public-read": "public-read";
|
|
12
|
+
}>>;
|
|
13
|
+
fileName: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export declare const multipartSignPartBodySchema: z.ZodObject<{
|
|
16
|
+
key: z.ZodString;
|
|
17
|
+
uploadId: z.ZodString;
|
|
18
|
+
partNumber: z.ZodNumber;
|
|
19
|
+
partSize: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
bucket: z.ZodOptional<z.ZodString>;
|
|
21
|
+
expiresIn: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export declare const multipartListPartsQuerySchema: z.ZodObject<{
|
|
24
|
+
key: z.ZodString;
|
|
25
|
+
uploadId: z.ZodString;
|
|
26
|
+
bucket: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export declare const multipartCompleteBodySchema: z.ZodObject<{
|
|
29
|
+
key: z.ZodString;
|
|
30
|
+
uploadId: z.ZodString;
|
|
31
|
+
parts: z.ZodArray<z.ZodObject<{
|
|
32
|
+
partNumber: z.ZodNumber;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
bucket: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export declare const multipartAbortBodySchema: z.ZodObject<{
|
|
37
|
+
key: z.ZodString;
|
|
38
|
+
uploadId: z.ZodString;
|
|
39
|
+
bucket: z.ZodOptional<z.ZodString>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
//# sourceMappingURL=multipart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multipart.d.ts","sourceRoot":"","sources":["../../src/schema/multipart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;iBAAmB,CAAC;AAExD,eAAO,MAAM,2BAA2B;;;;;;;iBAOtC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;iBAIxC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;iBAKtC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;iBAInC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Non-empty trimmed string. */
|
|
3
|
+
export declare const trimmedString: z.ZodString;
|
|
4
|
+
/** Optional non-empty trimmed string (empty / missing → omitted). */
|
|
5
|
+
export declare const optionalTrimmedString: z.ZodOptional<z.ZodString>;
|
|
6
|
+
export declare const s3ObjectAclSchema: z.ZodEnum<{
|
|
7
|
+
private: "private";
|
|
8
|
+
"public-read": "public-read";
|
|
9
|
+
}>;
|
|
10
|
+
export declare const metadataSchema: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
11
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/schema/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gCAAgC;AAChC,eAAO,MAAM,aAAa,aAA2B,CAAC;AAEtD,qEAAqE;AACrE,eAAO,MAAM,qBAAqB,4BAAsC,CAAC;AAEzE,eAAO,MAAM,iBAAiB;;;EAAqC,CAAC;AAEpE,eAAO,MAAM,cAAc,uCAAmC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const uploadBodySchema: z.ZodObject<{
|
|
3
|
+
key: z.ZodString;
|
|
4
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
5
|
+
fileSize: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
7
|
+
bucket: z.ZodOptional<z.ZodString>;
|
|
8
|
+
expiresIn: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
acl: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
private: "private";
|
|
11
|
+
"public-read": "public-read";
|
|
12
|
+
}>>;
|
|
13
|
+
fileName: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export declare const confirmBodySchema: z.ZodObject<{
|
|
16
|
+
key: z.ZodString;
|
|
17
|
+
bucket: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
//# sourceMappingURL=upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/schema/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;iBAS3B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAC"}
|
package/dist/types/requests.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import type { confirmBodySchema, uploadBodySchema } from "../schema/upload";
|
|
3
|
+
import type { downloadQuerySchema } from "../schema/download";
|
|
4
|
+
import type { deleteQuerySchema } from "../schema/delete";
|
|
5
|
+
import type { multipartAbortBodySchema, multipartCompleteBodySchema, multipartInitBodySchema, multipartListPartsQuerySchema, multipartSignPartBodySchema } from "../schema/multipart";
|
|
6
|
+
import type { s3ObjectAclSchema } from "../schema/shared";
|
|
7
|
+
export type { UploadPresignMethod } from "./upload-presign-method";
|
|
2
8
|
/** S3 object ACL. */
|
|
3
|
-
export type S3ObjectAcl =
|
|
9
|
+
export type S3ObjectAcl = z.infer<typeof s3ObjectAclSchema>;
|
|
4
10
|
/**
|
|
5
11
|
* Server-side auth context for `dimahS3().api` calls (guards / db scope).
|
|
6
12
|
* Ignored by {@link createS3Client} — never sent over the wire.
|
|
@@ -10,89 +16,26 @@ export type S3ApiHeaders = {
|
|
|
10
16
|
headers?: HeadersInit;
|
|
11
17
|
};
|
|
12
18
|
/** Payload for {@link S3Api.upload}. */
|
|
13
|
-
export type UploadPayload =
|
|
14
|
-
/** S3 object key. */
|
|
15
|
-
key: string;
|
|
16
|
-
/** Declared MIME type. */
|
|
17
|
-
contentType?: string;
|
|
18
|
-
/** Declared size in bytes. */
|
|
19
|
-
fileSize?: number;
|
|
20
|
-
/** Custom object metadata (`x-amz-meta-*`). */
|
|
21
|
-
metadata?: Record<string, string>;
|
|
22
|
-
/** Override default bucket. */
|
|
23
|
-
bucket?: string;
|
|
24
|
-
/** Requested ACL. */
|
|
25
|
-
acl?: S3ObjectAcl;
|
|
26
|
-
/** Original filename for `Content-Disposition`. */
|
|
27
|
-
fileName?: string;
|
|
28
|
-
};
|
|
19
|
+
export type UploadPayload = z.infer<typeof uploadBodySchema> & S3ApiHeaders;
|
|
29
20
|
/** Payload for {@link S3Api.confirm}. */
|
|
30
|
-
export type ConfirmPayload =
|
|
31
|
-
/** S3 object key. */
|
|
32
|
-
key: string;
|
|
33
|
-
/** Override default bucket. */
|
|
34
|
-
bucket?: string;
|
|
35
|
-
};
|
|
21
|
+
export type ConfirmPayload = z.infer<typeof confirmBodySchema> & S3ApiHeaders;
|
|
36
22
|
/** Options for {@link S3Api.download}. */
|
|
37
|
-
export type DownloadOptions =
|
|
38
|
-
/** Download filename for `Content-Disposition`. */
|
|
39
|
-
fileName?: string;
|
|
40
|
-
/** Override default bucket. */
|
|
41
|
-
bucket?: string;
|
|
42
|
-
};
|
|
23
|
+
export type DownloadOptions = Omit<z.infer<typeof downloadQuerySchema>, "key"> & S3ApiHeaders;
|
|
43
24
|
/** Options for {@link S3Api.delete}. */
|
|
44
|
-
export type DeleteOptions =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
/** Payload for {@link S3Api.multipart.init}. Same fields as {@link UploadPayload}. */
|
|
49
|
-
export type MultipartInitPayload = UploadPayload;
|
|
25
|
+
export type DeleteOptions = Omit<z.infer<typeof deleteQuerySchema>, "key"> & S3ApiHeaders;
|
|
26
|
+
/** Payload for {@link S3Api.multipart.init}. */
|
|
27
|
+
export type MultipartInitPayload = z.infer<typeof multipartInitBodySchema> & S3ApiHeaders;
|
|
50
28
|
/** Payload for {@link S3Api.multipart.signPart}. */
|
|
51
|
-
export type MultipartSignPartPayload =
|
|
52
|
-
/** S3 object key. */
|
|
53
|
-
key: string;
|
|
54
|
-
/** Multipart upload ID. */
|
|
55
|
-
uploadId: string;
|
|
56
|
-
/** 1-based part number. */
|
|
57
|
-
partNumber: number;
|
|
58
|
-
/** Byte size locked into the presigned URL signature. */
|
|
59
|
-
partSize?: number;
|
|
60
|
-
/** Override default bucket. */
|
|
61
|
-
bucket?: string;
|
|
62
|
-
};
|
|
29
|
+
export type MultipartSignPartPayload = z.infer<typeof multipartSignPartBodySchema> & S3ApiHeaders;
|
|
63
30
|
/** Payload for {@link S3Api.multipart.listParts}. */
|
|
64
|
-
export type MultipartListPartsPayload =
|
|
65
|
-
/** S3 object key. */
|
|
66
|
-
key: string;
|
|
67
|
-
/** Multipart upload ID. */
|
|
68
|
-
uploadId: string;
|
|
69
|
-
/** Override default bucket. */
|
|
70
|
-
bucket?: string;
|
|
71
|
-
};
|
|
31
|
+
export type MultipartListPartsPayload = z.infer<typeof multipartListPartsQuerySchema> & S3ApiHeaders;
|
|
72
32
|
/** A completed multipart part reference for {@link S3Api.multipart.complete}. */
|
|
73
33
|
export type MultipartCompletedPartRef = {
|
|
74
34
|
/** 1-based part number. */
|
|
75
35
|
partNumber: number;
|
|
76
36
|
};
|
|
77
37
|
/** Payload for {@link S3Api.multipart.complete}. */
|
|
78
|
-
export type MultipartCompletePayload =
|
|
79
|
-
/** S3 object key. */
|
|
80
|
-
key: string;
|
|
81
|
-
/** Multipart upload ID. */
|
|
82
|
-
uploadId: string;
|
|
83
|
-
/** Parts to assemble (order does not matter — S3 sorts by part number). */
|
|
84
|
-
parts: MultipartCompletedPartRef[];
|
|
85
|
-
/** Override default bucket. */
|
|
86
|
-
bucket?: string;
|
|
87
|
-
};
|
|
38
|
+
export type MultipartCompletePayload = z.infer<typeof multipartCompleteBodySchema> & S3ApiHeaders;
|
|
88
39
|
/** Payload for {@link S3Api.multipart.abort}. */
|
|
89
|
-
export type MultipartAbortPayload =
|
|
90
|
-
/** S3 object key. */
|
|
91
|
-
key: string;
|
|
92
|
-
/** Multipart upload ID. */
|
|
93
|
-
uploadId: string;
|
|
94
|
-
/** Override default bucket. */
|
|
95
|
-
bucket?: string;
|
|
96
|
-
};
|
|
97
|
-
export type { UploadPresignMethod };
|
|
40
|
+
export type MultipartAbortPayload = z.infer<typeof multipartAbortBodySchema> & S3ApiHeaders;
|
|
98
41
|
//# sourceMappingURL=requests.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../src/types/requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../src/types/requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EACV,wBAAwB,EACxB,2BAA2B,EAC3B,uBAAuB,EACvB,6BAA6B,EAC7B,2BAA2B,EAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,qBAAqB;AACrB,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,wEAAwE;IACxE,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC;AAEF,wCAAwC;AACxC,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,GAAG,YAAY,CAAC;AAE5E,yCAAyC;AACzC,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,GAAG,YAAY,CAAC;AAE9E,0CAA0C;AAC1C,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,EAAE,KAAK,CAAC,GAC5E,YAAY,CAAC;AAEf,wCAAwC;AACxC,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,EAAE,KAAK,CAAC,GACxE,YAAY,CAAC;AAEf,gDAAgD;AAChD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,GACxE,YAAY,CAAC;AAEf,oDAAoD;AACpD,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,2BAA2B,CACnC,GACC,YAAY,CAAC;AAEf,qDAAqD;AACrD,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,6BAA6B,CACrC,GACC,YAAY,CAAC;AAEf,iFAAiF;AACjF,MAAM,MAAM,yBAAyB,GAAG;IACtC,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,oDAAoD;AACpD,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,2BAA2B,CACnC,GACC,YAAY,CAAC;AAEf,iDAAiD;AACjD,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,GAC1E,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dimah-s3/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Shared types and pure helpers for @dimah-s3/react and @dimah-s3/server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"s3",
|
|
@@ -31,6 +31,11 @@
|
|
|
31
31
|
"files": [
|
|
32
32
|
"dist"
|
|
33
33
|
],
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@better-fetch/fetch": "1.3.1",
|
|
36
|
+
"better-call": "1.4.0",
|
|
37
|
+
"zod": "^4.4.3"
|
|
38
|
+
},
|
|
34
39
|
"devDependencies": {
|
|
35
40
|
"eslint": "^10.8.1",
|
|
36
41
|
"tsup": "^8.5.1",
|
|
@@ -43,7 +48,7 @@
|
|
|
43
48
|
"access": "public"
|
|
44
49
|
},
|
|
45
50
|
"scripts": {
|
|
46
|
-
"build": "tsup --config tsup.config.ts && tsc --emitDeclarationOnly",
|
|
51
|
+
"build": "tsup --config tsup.config.ts && tsc --emitDeclarationOnly -p tsconfig.build.json",
|
|
47
52
|
"lint": "eslint",
|
|
48
53
|
"check-types": "tsc --noEmit",
|
|
49
54
|
"test": "vitest run"
|
package/dist/index.test.d.ts
DELETED
package/dist/index.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { S3ClientFetcher, S3ClientFetchOptions } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Shared fetch + JSON error parsing for core routes and client plugins.
|
|
4
|
-
* `base` is a normalized API prefix (e.g. `/api/s3`).
|
|
5
|
-
*
|
|
6
|
-
* Non-OK responses throw {@link DimahS3Error} with the HTTP status — same
|
|
7
|
-
* class as server procedures, so client and server error shapes stay aligned.
|
|
8
|
-
*/
|
|
9
|
-
export declare function createFetcher(base: string, options?: S3ClientFetchOptions): S3ClientFetcher;
|
|
10
|
-
//# sourceMappingURL=create-fetcher.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-fetcher.d.ts","sourceRoot":"","sources":["../../src/plugin/create-fetcher.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AA4CrE;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,oBAAoB,GAC7B,eAAe,CA0DjB"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Build the relative path for a plugin HTTP endpoint under `basePath`.
|
|
3
|
-
* Server mounts and client fetchers share this so URLs never diverge.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* pluginEndpointPath("db", "objects") // "plugins/db/objects"
|
|
7
|
-
*/
|
|
8
|
-
export declare function pluginEndpointPath(pluginId: string, path: string): string;
|
|
9
|
-
//# sourceMappingURL=plugin-endpoint-path.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-endpoint-path.d.ts","sourceRoot":"","sources":["../../src/plugin/plugin-endpoint-path.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzE"}
|