@dimah-s3/server 2.0.0-beta.0 → 2.0.0-beta.10

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.
@@ -1,7 +1,7 @@
1
1
  import { type MultipartAbortResponse } from "@dimah-s3/core";
2
2
  import type { S3ServerCallOptions } from "../../types/config.js";
3
3
  import type { ResolvedConfig } from "../../types/resolved.js";
4
- import { type MultipartTicketBody } from "./open-multipart";
4
+ import { type MultipartTicketBody } from "./open-multipart.js";
5
5
  /**
6
6
  * Aborts a multipart upload (`POST /presign/multipart/abort`,
7
7
  * `s3.api.multipart.abort`).
@@ -1,7 +1,7 @@
1
1
  import { type MultipartCompleteResponse } from "@dimah-s3/core";
2
2
  import type { S3ServerCallOptions } from "../../types/config.js";
3
3
  import type { ResolvedConfig } from "../../types/resolved.js";
4
- import { type MultipartTicketBody } from "./open-multipart";
4
+ import { type MultipartTicketBody } from "./open-multipart.js";
5
5
  /**
6
6
  * Completes a multipart upload (`POST /presign/multipart/complete`,
7
7
  * `s3.api.multipart.complete`).
@@ -1,7 +1,7 @@
1
1
  import type { MultipartListPartsResponse } from "@dimah-s3/core";
2
2
  import type { S3ServerCallOptions } from "../../types/config.js";
3
3
  import type { ResolvedConfig } from "../../types/resolved.js";
4
- import { type MultipartTicketBody } from "./open-multipart";
4
+ import { type MultipartTicketBody } from "./open-multipart.js";
5
5
  /**
6
6
  * Lists the uploaded parts (`POST /presign/multipart/parts`,
7
7
  * `s3.api.multipart.listParts`), so a client can resume an upload. It reads
@@ -1,5 +1,5 @@
1
1
  import type { DimahS3Config, DimahS3Logger } from "../types/config.js";
2
- import type { AppliedPlugins, DimahS3Plugin, PluginContextMap } from "./types";
2
+ import type { AppliedPlugins, DimahS3Plugin, PluginContextMap } from "./types.js";
3
3
  /**
4
4
  * Checks the plugins, builds the context map, collects the endpoints, and
5
5
  * runs each `init` in plugin order. Throws on a config error, so
@@ -1,4 +1,4 @@
1
- import type { DimahS3Plugin } from "./types";
1
+ import type { DimahS3Plugin } from "./types.js";
2
2
  /**
3
3
  * Identity helper that keeps the literal `id` and the `context` type, so
4
4
  * `s3.context[id]` and `s3[id]` are typed.
@@ -1,5 +1,5 @@
1
- export { applyPlugins } from "./apply-plugins";
2
- export { chainHooks } from "./chain-hooks";
3
- export { definePlugin } from "./define-plugin";
4
- export type { AppliedPlugins, DimahS3Plugin, DimahS3PluginHooks, PluginContextMap, PluginInitEnv, } from "./types";
1
+ export { applyPlugins } from "./apply-plugins.js";
2
+ export { chainHooks } from "./chain-hooks.js";
3
+ export { definePlugin } from "./define-plugin.js";
4
+ export type { AppliedPlugins, DimahS3Plugin, DimahS3PluginHooks, PluginContextMap, PluginInitEnv, } from "./types.js";
5
5
  //# sourceMappingURL=index.d.ts.map
package/dist/plugins.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- export { createS3Endpoint } from "./api/create-s3-endpoint";
2
- export type { S3Endpoint, S3EndpointMethod, S3EndpointOptions, } from "./api/create-s3-endpoint";
3
- export { createS3Middleware } from "./api/create-s3-middleware";
4
- export type { S3EndpointContext } from "./api/context";
5
- export { isFeatureOn } from "./config/feature-toggle";
6
- export { definePlugin } from "./plugin";
7
- export type { DimahS3Plugin, DimahS3PluginHooks, PluginContextMap, PluginInitEnv, } from "./plugin";
8
- export { isAwsNotFound } from "./helpers/aws-errors";
9
- export { deleteObjectIfMatch, type ConditionalDeleteInput, } from "./helpers/best-effort";
10
- export { readUploadMarker } from "./helpers/object-meta";
1
+ export { createS3Endpoint } from "./api/create-s3-endpoint.js";
2
+ export type { S3Endpoint, S3EndpointMethod, S3EndpointOptions, } from "./api/create-s3-endpoint.js";
3
+ export { createS3Middleware } from "./api/create-s3-middleware.js";
4
+ export type { S3EndpointContext } from "./api/context.js";
5
+ export { isFeatureOn } from "./config/feature-toggle.js";
6
+ export { definePlugin } from "./plugin/index.js";
7
+ export type { DimahS3Plugin, DimahS3PluginHooks, PluginContextMap, PluginInitEnv, } from "./plugin/index.js";
8
+ export { isAwsNotFound } from "./helpers/aws-errors.js";
9
+ export { deleteObjectIfMatch, type ConditionalDeleteInput, } from "./helpers/best-effort.js";
10
+ export { readUploadMarker } from "./helpers/object-meta.js";
11
11
  //# sourceMappingURL=plugins.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import type { S3Client } from "@aws-sdk/client-s3";
2
2
  import type { ContentDispositionType, S3Api, S3ObjectAcl, S3RouteName, UploadPresignMethod } from "@dimah-s3/core";
3
- import type { DeleteGuardContext, DeleteOnDeletedContext, DownloadGuardContext, DownloadOnPresignedContext, DownloadResolveContext, DownloadResolveInfo, GuardContext, MultipartGuardContext, MultipartOnAbortContext, RouteGuardContext, S3Operation, UploadConfirmGuardContext, UploadGuardContext, UploadObjectContext, UploadObjectInfo, UploadOnConfirmedContext, UploadOnStartContext } from "./hook-contexts";
4
- import type { DimahS3Locals, DimahS3RoutePluginOptions, Guard, LifecycleHook } from "./locals";
3
+ import type { DeleteGuardContext, DeleteOnDeletedContext, DownloadGuardContext, DownloadOnPresignedContext, DownloadResolveContext, DownloadResolveInfo, GuardContext, MultipartGuardContext, MultipartOnAbortContext, RouteGuardContext, S3Operation, UploadConfirmGuardContext, UploadGuardContext, UploadObjectContext, UploadObjectInfo, UploadOnConfirmedContext, UploadOnStartContext } from "./hook-contexts.js";
4
+ import type { DimahS3Locals, DimahS3RoutePluginOptions, Guard, LifecycleHook } from "./locals.js";
5
5
  import type { DimahS3Plugin } from "../plugin/types.js";
6
6
  /** `true` or an options object turns the feature on; omit it or pass `false` to keep it off. */
7
7
  export type FeatureToggle<T> = boolean | T;
@@ -1,5 +1,5 @@
1
1
  import type { ContentDispositionType, S3ObjectAcl } from "@dimah-s3/core";
2
- import type { DimahS3Locals } from "./locals";
2
+ import type { DimahS3Locals } from "./locals.js";
3
3
  /** The call a hook runs in. Plugin endpoints use `"plugin"`. */
4
4
  export type S3Operation = "upload" | "confirm" | "download" | "file" | "delete" | "deleteMany" | "catalog" | "put" | "multipart.init" | "multipart.signPart" | "multipart.listParts" | "multipart.complete" | "multipart.abort" | "plugin";
5
5
  /**
@@ -1,4 +1,4 @@
1
- export type { DeleteGuardContext, DeleteOnDeletedContext, DownloadGuardContext, DownloadOnPresignedContext, DownloadResolveContext, DownloadResolveInfo, GuardContext, MultipartGuardContext, MultipartOnAbortContext, MultipartUploadContext, ObjectContext, ObjectS3Headers, RouteGuardContext, S3Operation, UploadConfirmGuardContext, UploadFile, UploadGuardContext, UploadKind, UploadObjectContext, UploadObjectInfo, UploadOnConfirmedContext, UploadOnStartContext, VerifiedObject, } from "./hook-contexts";
2
- export type { DeleteConfig, DimahS3Api, DimahS3Config, DimahS3Logger, DimahS3RouteConfig, DownloadConfig, FeatureToggle, MultipartConfig, PutInput, S3ServerCallOptions, TicketSubject, UploadConfig, } from "./config";
3
- export type { DimahS3Locals, DimahS3RoutePluginOptions, Guard, GuardResult, LifecycleHook, } from "./locals";
1
+ export type { DeleteGuardContext, DeleteOnDeletedContext, DownloadGuardContext, DownloadOnPresignedContext, DownloadResolveContext, DownloadResolveInfo, GuardContext, MultipartGuardContext, MultipartOnAbortContext, MultipartUploadContext, ObjectContext, ObjectS3Headers, RouteGuardContext, S3Operation, UploadConfirmGuardContext, UploadFile, UploadGuardContext, UploadKind, UploadObjectContext, UploadObjectInfo, UploadOnConfirmedContext, UploadOnStartContext, VerifiedObject, } from "./hook-contexts.js";
2
+ export type { DeleteConfig, DimahS3Api, DimahS3Config, DimahS3Logger, DimahS3RouteConfig, DownloadConfig, FeatureToggle, MultipartConfig, PutInput, S3ServerCallOptions, TicketSubject, UploadConfig, } from "./config.js";
3
+ export type { DimahS3Locals, DimahS3RoutePluginOptions, Guard, GuardResult, LifecycleHook, } from "./locals.js";
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,8 +1,8 @@
1
1
  import type { S3Client } from "@aws-sdk/client-s3";
2
2
  import type { ContentDispositionType, S3ObjectAcl, UploadPresignMethod } from "@dimah-s3/core";
3
- import type { DimahS3Config, DimahS3Logger, DownloadConfig, TicketSubject, UploadConfig } from "./config";
4
- import type { DeleteGuardContext, DeleteOnDeletedContext, DownloadGuardContext, DownloadOnPresignedContext, GuardContext, MultipartGuardContext, MultipartOnAbortContext, RouteGuardContext, UploadConfirmGuardContext, UploadGuardContext, UploadOnConfirmedContext, UploadOnStartContext } from "./hook-contexts";
5
- import type { DimahS3RoutePluginOptions, Guard, LifecycleHook } from "./locals";
3
+ import type { DimahS3Config, DimahS3Logger, DownloadConfig, TicketSubject, UploadConfig } from "./config.js";
4
+ import type { DeleteGuardContext, DeleteOnDeletedContext, DownloadGuardContext, DownloadOnPresignedContext, GuardContext, MultipartGuardContext, MultipartOnAbortContext, RouteGuardContext, UploadConfirmGuardContext, UploadGuardContext, UploadOnConfirmedContext, UploadOnStartContext } from "./hook-contexts.js";
5
+ import type { DimahS3RoutePluginOptions, Guard, LifecycleHook } from "./locals.js";
6
6
  /**
7
7
  * A route feature a call can hit. `multipart` is nested under upload, and
8
8
  * `proxy` is a download in `mode: "proxy"`, the only one `/file` serves.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dimah-s3/server",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0-beta.10",
4
4
  "description": "Presigned S3 server — dimahS3() with HTTP handler and direct api for upload, download, delete, and multipart",
5
5
  "keywords": [
6
6
  "s3",
@@ -25,7 +25,7 @@
25
25
  "sveltekit",
26
26
  "typescript"
27
27
  ],
28
- "homepage": "https://v2.s3.dimah.dev/docs/server",
28
+ "homepage": "https://s3.dimah.dev/docs/server",
29
29
  "bugs": {
30
30
  "url": "https://github.com/dimah-kz/dimah-s3/issues"
31
31
  },
@@ -80,24 +80,24 @@
80
80
  "dist"
81
81
  ],
82
82
  "dependencies": {
83
- "@aws-sdk/s3-presigned-post": "^3.1161.0",
84
- "@aws-sdk/s3-request-presigner": "^3.1161.0",
85
- "@dimah-s3/core": "2.0.0-beta.0",
86
- "better-call": "1.4.4",
83
+ "@aws-sdk/s3-presigned-post": "^3.1169.0",
84
+ "@aws-sdk/s3-request-presigner": "^3.1169.0",
85
+ "@dimah-s3/core": "2.0.0-beta.10",
86
+ "better-call": "1.4.5",
87
87
  "zod": "^4.6.7"
88
88
  },
89
89
  "devDependencies": {
90
- "@aws-sdk/client-s3": "^3.1161.0",
90
+ "@aws-sdk/client-s3": "^3.1169.0",
91
91
  "@types/node": "^26.6.6",
92
92
  "@workspace/eslint-config": "0.0.1",
93
93
  "@workspace/tsup-config": "0.0.0",
94
94
  "@workspace/typescript-config": "0.0.1",
95
95
  "@workspace/vitest-config": "0.0.7",
96
- "eslint": "^10.14.0",
96
+ "eslint": "^10.15.0",
97
97
  "tsc-alias": "^1.9.10",
98
98
  "tsup": "^9.0.0",
99
99
  "typescript": "7.0.2",
100
- "vitest": "^5.0.5"
100
+ "vitest": "^5.1.0"
101
101
  },
102
102
  "peerDependencies": {
103
103
  "@aws-sdk/client-s3": ">=3"
@@ -106,7 +106,7 @@
106
106
  "access": "public"
107
107
  },
108
108
  "scripts": {
109
- "build": "tsup --config tsup.config.ts && tsc --emitDeclarationOnly -p tsconfig.build.json && tsc-alias",
109
+ "build": "tsup --config tsup.config.ts && tsc --emitDeclarationOnly -p tsconfig.build.json && tsc-alias && node ../../tooling/tsup-config/dts-extensions.mjs",
110
110
  "check-types": "tsc --noEmit",
111
111
  "lint": "eslint --cache --cache-strategy content --max-warnings 0",
112
112
  "test": "vitest run"