@kalutskii/foundation 0.7.8 → 0.7.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ilya Kalutskii
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @kalutskii/foundation
2
2
 
3
3
  Shared TypeScript foundation for contracts, schemas, framework adapters, and reusable utilities.
4
- The package is designed for Bun, Node.js, Hono applications, and Cloudflare Workers environments.
4
+ The package is designed for Bun, Node.js, and Hono applications.
5
5
 
6
6
  This repository is not intended to document every exported function through standalone usage snippets.
7
7
  Public JSDoc, generated declarations, colocated specifications, and editor inference are the API reference.
@@ -24,6 +24,7 @@ The package contains several deliberately isolated areas:
24
24
  | ---------------- | ----------------------------------------------------------------------------------------- |
25
25
  | `utilities` | Framework-independent datetime, enum, execution, generation, logging, and type utilities. |
26
26
  | `http` | Shared HTTP result contracts, factories, status constants, and result resolvers. |
27
+ | `upload` | Shared upload presets, file-format metadata, validation, and reusable Zod schemas. |
27
28
  | `zod-validation` | Generic Zod parsing, validation, refinement, and related type utilities. |
28
29
  | `zod-search` | Reusable search and pagination contracts composed from lower-level Zod primitives. |
29
30
  | `zod-bulk` | Include/exclude selection contracts shared by frontend and backend bulk operations. |
@@ -46,7 +47,7 @@ Framework adapters
46
47
 
47
48
 
48
49
  Contract composition
49
- zod-search / zod-bulk
50
+ zod-search / zod-bulk / upload
50
51
 
51
52
 
52
53
  Contract primitives
@@ -88,6 +89,7 @@ src/
88
89
  ├── drizzle/
89
90
  ├── hono/
90
91
  ├── http/
92
+ ├── upload/
91
93
  ├── utilities/
92
94
  ├── zod-bulk/
93
95
  ├── zod-jwt/
@@ -111,20 +113,24 @@ single public API boundary and should export only symbols intentionally supporte
111
113
 
112
114
  ## File responsibilities
113
115
 
114
- | Suffix | Expected content |
115
- | ---------------- | ----------------------------------------------------------------------------- |
116
- | `*.constants.ts` | Immutable values and literal collections without behavior. |
117
- | `*.schemas.ts` | Runtime Zod schemas and factories whose result is a schema. |
118
- | `*.types.ts` | Type aliases, interfaces, generic contracts, and schema-derived output types. |
119
- | `*.factory.ts` | Functions whose primary responsibility is constructing non-schema values. |
120
- | `*.resolvers.ts` | Functions that unwrap, normalize, or translate an existing result. |
121
- | `*.utilities.ts` | Stateless reusable behavior that has no narrower architectural owner. |
122
- | `*.parsing.ts` | Input parsing and preprocessing before domain validation. |
123
- | `*.refiners.ts` | Refinement logic that narrows or safely composes an existing value. |
124
- | `*.execution.ts` | Framework lifecycle execution and error-boundary behavior. |
125
- | `*.logging.ts` | Logging formatters, sinks, or middleware behavior. |
126
- | `*.respond.ts` | Framework response construction and response-specific contracts. |
127
- | `*.spec.ts` | The single colocated runtime and compile-time specification for a module. |
116
+ | Suffix | Expected content |
117
+ | ----------------- | ------------------------------------------------------------------------- |
118
+ | `*.constants.ts` | Immutable configuration values and metadata without behavior. |
119
+ | `*.enums.ts` | Literal collections, derived unions, ergonomic records, and aliases. |
120
+ | `*.schemas.ts` | Runtime Zod schemas and factories whose result is a schema. |
121
+ | `*.types.ts` | Type aliases, generic contracts, and schema-derived output types. |
122
+ | `*.services.ts` | Stateful service classes that coordinate one external capability. |
123
+ | `*.validation.ts` | Ordered validation behavior returning stable domain error keys. |
124
+ | `*.factory.ts` | Functions whose primary responsibility is constructing non-schema values. |
125
+ | `*.presets.ts` | Ready-to-use policies composed from public domain values. |
126
+ | `*.resolvers.ts` | Functions that unwrap, normalize, or translate an existing result. |
127
+ | `*.utilities.ts` | Stateless reusable behavior that has no narrower architectural owner. |
128
+ | `*.parsing.ts` | Input parsing and preprocessing before domain validation. |
129
+ | `*.refiners.ts` | Refinement logic that narrows or safely composes an existing value. |
130
+ | `*.execution.ts` | Framework lifecycle execution and error-boundary behavior. |
131
+ | `*.logging.ts` | Logging formatters, sinks, or middleware behavior. |
132
+ | `*.respond.ts` | Framework response construction and response-specific contracts. |
133
+ | `*.spec.ts` | The single colocated runtime and compile-time specification for a module. |
128
134
 
129
135
  Do not place TypeScript-only contracts in a schema file when they can be separated without creating a circular
130
136
  responsibility. Do not split tiny files mechanically either: separation must communicate ownership, not line count.