hono-crud 0.3.0 → 0.3.2

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/CHANGELOG.md CHANGED
@@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
  %b
12
12
  %b
13
13
  %b
14
+ %b
15
+ %b
14
16
  ## [0.1.0] - 2025-01-29
15
17
 
16
18
  ### Added
@@ -38,3 +40,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
38
40
  [0.1.4]: https://github.com/kshdotdev/hono-crud/compare/v0.1.3...v0.1.4
39
41
  [0.2.0]: https://github.com/kshdotdev/hono-crud/compare/v0.1.4...v0.2.0
40
42
  [0.3.0]: https://github.com/kshdotdev/hono-crud/compare/v0.2.0...v0.3.0
43
+ [0.3.1]: https://github.com/kshdotdev/hono-crud/compare/v0.3.0...v0.3.1
44
+ [0.3.2]: https://github.com/kshdotdev/hono-crud/compare/v0.3.1...v0.3.2
@@ -1,13 +1,13 @@
1
1
  import { Table, SQL, Column } from 'drizzle-orm';
2
- import { M as MetaInput, I as IncludeOptions, F as FilterCondition, g as RelationConfig, h as NestedUpdateInput, i as NestedWriteResult, L as ListFilters, P as PaginatedResult, j as AggregateOptions, k as AggregateResult, S as SearchOptions, l as SearchResult } from '../../types-CwJSGrCj.js';
2
+ import { M as MetaInput, I as IncludeOptions, F as FilterCondition, g as RelationConfig, h as NestedUpdateInput, i as NestedWriteResult, L as ListFilters, P as PaginatedResult, j as AggregateOptions, k as AggregateResult, S as SearchOptions, l as SearchResult } from '../../types-CA784ZtV.js';
3
3
  import { Env } from 'hono';
4
- import { C as CreateEndpoint, M as ModelObject, R as ReadEndpoint, U as UpdateEndpoint, D as DeleteEndpoint, L as ListEndpoint, a as RestoreEndpoint, B as BatchCreateEndpoint, b as BatchDeleteEndpoint, c as BatchRestoreEndpoint, d as BatchUpdateEndpoint, e as BatchUpdateItem, A as AggregateEndpoint, f as BatchUpsertEndpoint, g as UpsertEndpoint, E as ExportEndpoint, I as ImportEndpoint, S as SearchEndpoint, V as VersionCompareEndpoint, h as VersionHistoryEndpoint, i as VersionReadEndpoint, j as VersionRollbackEndpoint } from '../../import-C4cjkYZ1.js';
5
- import { A as AdapterBundle } from '../../index-BVaCSKwG.js';
4
+ import { C as CreateEndpoint, M as ModelObject, R as ReadEndpoint, U as UpdateEndpoint, D as DeleteEndpoint, L as ListEndpoint, a as RestoreEndpoint, B as BatchCreateEndpoint, b as BatchDeleteEndpoint, c as BatchRestoreEndpoint, d as BatchUpdateEndpoint, e as BatchUpdateItem, A as AggregateEndpoint, f as BatchUpsertEndpoint, g as UpsertEndpoint, E as ExportEndpoint, I as ImportEndpoint, S as SearchEndpoint, V as VersionCompareEndpoint, h as VersionHistoryEndpoint, i as VersionReadEndpoint, j as VersionRollbackEndpoint } from '../../import-B7KS4Wvh.js';
5
+ import { A as AdapterBundle } from '../../index-5BEg0ty5.js';
6
6
  import { z } from 'zod';
7
7
  import '@hono/zod-openapi';
8
- import '../../route-BCROG0Mx.js';
8
+ import '../../route-DwSID3du.js';
9
9
  import 'hono/utils/http-status';
10
- import '../../versioning-4Pn5V1ed.js';
10
+ import '../../versioning-BG8-R7C0.js';
11
11
 
12
12
  /**
13
13
  * Internal query builder interface used for type-safe method calls.
@@ -303,15 +303,15 @@ declare abstract class DrizzleDeleteEndpoint<E extends Env = Env, M extends Meta
303
303
  /**
304
304
  * Counts related records for restrict check.
305
305
  */
306
- protected countRelated(parentId: string | number, relationName: string, relationConfig: RelationConfig, tx?: unknown): Promise<number>;
306
+ protected countRelated(parentId: string | number, _relationName: string, relationConfig: RelationConfig, tx?: unknown): Promise<number>;
307
307
  /**
308
308
  * Deletes related records for cascade delete.
309
309
  */
310
- protected deleteRelated(parentId: string | number, relationName: string, relationConfig: RelationConfig, tx?: unknown): Promise<number>;
310
+ protected deleteRelated(parentId: string | number, _relationName: string, relationConfig: RelationConfig, tx?: unknown): Promise<number>;
311
311
  /**
312
312
  * Sets foreign key to null for related records.
313
313
  */
314
- protected nullifyRelated(parentId: string | number, relationName: string, relationConfig: RelationConfig, tx?: unknown): Promise<number>;
314
+ protected nullifyRelated(parentId: string | number, _relationName: string, relationConfig: RelationConfig, tx?: unknown): Promise<number>;
315
315
  /**
316
316
  * Override handle to wrap in transaction when useTransaction is true.
317
317
  */
@@ -742,7 +742,7 @@ declare const DrizzleAdapters: AdapterBundle;
742
742
  type DrizzleTable = {
743
743
  _: {
744
744
  name: string;
745
- columns: Record<string, any>;
745
+ columns: Record<string, unknown>;
746
746
  };
747
747
  };
748
748
  /**
@@ -1,5 +1,5 @@
1
- import { CreateEndpoint, ReadEndpoint, UpdateEndpoint, DeleteEndpoint, ListEndpoint, RestoreEndpoint, BatchCreateEndpoint, BatchUpdateEndpoint, BatchDeleteEndpoint, BatchRestoreEndpoint, UpsertEndpoint, BatchUpsertEndpoint, VersionHistoryEndpoint, VersionReadEndpoint, VersionCompareEndpoint, VersionRollbackEndpoint, AggregateEndpoint, computeAggregations, SearchEndpoint, searchInMemory, ExportEndpoint, ImportEndpoint } from '../../chunk-NTQNZZSH.js';
2
- import '../../chunk-SCC4CBTS.js';
1
+ import { CreateEndpoint, ReadEndpoint, UpdateEndpoint, DeleteEndpoint, ListEndpoint, RestoreEndpoint, BatchCreateEndpoint, BatchUpdateEndpoint, BatchDeleteEndpoint, BatchRestoreEndpoint, UpsertEndpoint, BatchUpsertEndpoint, VersionHistoryEndpoint, VersionReadEndpoint, VersionCompareEndpoint, VersionRollbackEndpoint, AggregateEndpoint, computeAggregations, SearchEndpoint, searchInMemory, ExportEndpoint, ImportEndpoint } from '../../chunk-LCRNKT65.js';
2
+ import '../../chunk-CDCGYMC6.js';
3
3
  import '../../chunk-U3SUUXJK.js';
4
4
  import { getLogger } from '../../chunk-FST5S5UY.js';
5
5
  import { getTableColumns, eq, inArray, between, isNull, isNotNull, ilike, like, notInArray, lte, lt, gte, gt, ne, and, sql, or, desc, asc } from 'drizzle-orm';
@@ -269,7 +269,7 @@ var DrizzleCreateEndpoint = class extends CreateEndpoint {
269
269
  if (!this.useTransaction) {
270
270
  return super.handle();
271
271
  }
272
- return cast(this.db).transaction(async (tx) => {
272
+ return cast(this.getDb()).transaction(async (tx) => {
273
273
  this._tx = tx;
274
274
  try {
275
275
  return await super.handle();
@@ -308,7 +308,7 @@ var DrizzleReadEndpoint = class extends ReadEndpoint {
308
308
  if (softDeleteConfig.enabled) {
309
309
  conditions.push(isNull(this.getColumn(softDeleteConfig.field)));
310
310
  }
311
- const result = await cast(this.db).select().from(table).where(and(...conditions)).limit(1);
311
+ const result = await cast(this.getDb()).select().from(table).where(and(...conditions)).limit(1);
312
312
  if (!result[0]) {
313
313
  return null;
314
314
  }
@@ -474,7 +474,7 @@ var DrizzleUpdateEndpoint = class extends UpdateEndpoint {
474
474
  if (!this.useTransaction) {
475
475
  return super.handle();
476
476
  }
477
- return cast(this.db).transaction(async (tx) => {
477
+ return cast(this.getDb()).transaction(async (tx) => {
478
478
  this._tx = tx;
479
479
  try {
480
480
  return await super.handle();
@@ -560,7 +560,7 @@ var DrizzleDeleteEndpoint = class extends DeleteEndpoint {
560
560
  /**
561
561
  * Counts related records for restrict check.
562
562
  */
563
- async countRelated(parentId, relationName, relationConfig, tx) {
563
+ async countRelated(parentId, _relationName, relationConfig, tx) {
564
564
  const db = tx ?? this.getDb();
565
565
  const relatedTable = this.getRelatedTable(relationConfig);
566
566
  if (!relatedTable) return 0;
@@ -571,7 +571,7 @@ var DrizzleDeleteEndpoint = class extends DeleteEndpoint {
571
571
  /**
572
572
  * Deletes related records for cascade delete.
573
573
  */
574
- async deleteRelated(parentId, relationName, relationConfig, tx) {
574
+ async deleteRelated(parentId, _relationName, relationConfig, tx) {
575
575
  const db = tx ?? this.getDb();
576
576
  const relatedTable = this.getRelatedTable(relationConfig);
577
577
  if (!relatedTable) return 0;
@@ -582,7 +582,7 @@ var DrizzleDeleteEndpoint = class extends DeleteEndpoint {
582
582
  /**
583
583
  * Sets foreign key to null for related records.
584
584
  */
585
- async nullifyRelated(parentId, relationName, relationConfig, tx) {
585
+ async nullifyRelated(parentId, _relationName, relationConfig, tx) {
586
586
  const db = tx ?? this.getDb();
587
587
  const relatedTable = this.getRelatedTable(relationConfig);
588
588
  if (!relatedTable) return 0;
@@ -597,7 +597,7 @@ var DrizzleDeleteEndpoint = class extends DeleteEndpoint {
597
597
  if (!this.useTransaction) {
598
598
  return super.handle();
599
599
  }
600
- return cast(this.db).transaction(async (tx) => {
600
+ return cast(this.getDb()).transaction(async (tx) => {
601
601
  this._tx = tx;
602
602
  try {
603
603
  return await super.handle();
@@ -649,9 +649,10 @@ var DrizzleListEndpoint = class extends ListEndpoint {
649
649
  conditions.push(or(...searchConditions));
650
650
  }
651
651
  const whereClause = conditions.length > 0 ? and(...conditions) : void 0;
652
- const countResult = await cast(this.db).select({ count: sql`count(*)` }).from(table).where(whereClause);
652
+ const db = this.getDb();
653
+ const countResult = await cast(db).select({ count: sql`count(*)` }).from(table).where(whereClause);
653
654
  const totalCount = Number(countResult[0]?.count) || 0;
654
- let query = cast(this.db).select().from(table).where(whereClause);
655
+ let query = cast(db).select().from(table).where(whereClause);
655
656
  if (filters.options.order_by) {
656
657
  const orderColumn = this.getColumn(filters.options.order_by);
657
658
  const orderFn = filters.options.order_by_direction === "desc" ? desc : asc;
@@ -729,7 +730,7 @@ var DrizzleRestoreEndpoint = class extends RestoreEndpoint {
729
730
  if (!this.useTransaction) {
730
731
  return super.handle();
731
732
  }
732
- return cast(this.db).transaction(async (tx) => {
733
+ return cast(this.getDb()).transaction(async (tx) => {
733
734
  this._tx = tx;
734
735
  try {
735
736
  return await super.handle();
@@ -759,7 +760,7 @@ var DrizzleBatchCreateEndpoint = class extends BatchCreateEndpoint {
759
760
  ...item,
760
761
  [primaryKey]: item[primaryKey] || crypto.randomUUID()
761
762
  }));
762
- const result = await cast(this.db).insert(table).values(records).returning();
763
+ const result = await cast(this.getDb()).insert(table).values(records).returning();
763
764
  return result;
764
765
  }
765
766
  };
@@ -790,7 +791,7 @@ var DrizzleBatchUpdateEndpoint = class extends BatchUpdateEndpoint {
790
791
  if (softDeleteConfig.enabled) {
791
792
  conditions.push(isNull(this.getColumn(softDeleteConfig.field)));
792
793
  }
793
- const result = await cast(this.db).update(table).set(item.data).where(and(...conditions)).returning();
794
+ const result = await cast(this.getDb()).update(table).set(item.data).where(and(...conditions)).returning();
794
795
  if (result[0]) {
795
796
  updated.push(result[0]);
796
797
  } else {
@@ -1,11 +1,11 @@
1
1
  import { Env } from 'hono';
2
- import { C as CreateEndpoint, M as ModelObject, D as DeleteEndpoint, L as ListEndpoint, R as ReadEndpoint, a as RestoreEndpoint, U as UpdateEndpoint, B as BatchCreateEndpoint, b as BatchDeleteEndpoint, c as BatchRestoreEndpoint, d as BatchUpdateEndpoint, e as BatchUpdateItem, f as BatchUpsertEndpoint, A as AggregateEndpoint, E as ExportEndpoint, I as ImportEndpoint, S as SearchEndpoint, g as UpsertEndpoint, V as VersionCompareEndpoint, h as VersionHistoryEndpoint, i as VersionReadEndpoint, j as VersionRollbackEndpoint } from '../../import-C4cjkYZ1.js';
3
- import { M as MetaInput, g as RelationConfig, L as ListFilters, P as PaginatedResult, I as IncludeOptions, h as NestedUpdateInput, i as NestedWriteResult, j as AggregateOptions, k as AggregateResult, S as SearchOptions, l as SearchResult } from '../../types-CwJSGrCj.js';
4
- import { B as BulkPatchEndpoint, C as CloneEndpoint } from '../../bulk-patch-C1j76FUv.js';
2
+ import { C as CreateEndpoint, M as ModelObject, D as DeleteEndpoint, L as ListEndpoint, R as ReadEndpoint, a as RestoreEndpoint, U as UpdateEndpoint, B as BatchCreateEndpoint, b as BatchDeleteEndpoint, c as BatchRestoreEndpoint, d as BatchUpdateEndpoint, e as BatchUpdateItem, f as BatchUpsertEndpoint, A as AggregateEndpoint, E as ExportEndpoint, I as ImportEndpoint, S as SearchEndpoint, g as UpsertEndpoint, V as VersionCompareEndpoint, h as VersionHistoryEndpoint, i as VersionReadEndpoint, j as VersionRollbackEndpoint } from '../../import-B7KS4Wvh.js';
3
+ import { M as MetaInput, g as RelationConfig, L as ListFilters, P as PaginatedResult, I as IncludeOptions, h as NestedUpdateInput, i as NestedWriteResult, j as AggregateOptions, k as AggregateResult, S as SearchOptions, l as SearchResult } from '../../types-CA784ZtV.js';
4
+ import { B as BulkPatchEndpoint, C as CloneEndpoint } from '../../bulk-patch-B6j0q_p_.js';
5
5
  import 'zod';
6
- import '../../route-BCROG0Mx.js';
6
+ import '../../route-DwSID3du.js';
7
7
  import 'hono/utils/http-status';
8
- import '../../versioning-4Pn5V1ed.js';
8
+ import '../../versioning-BG8-R7C0.js';
9
9
  import '@hono/zod-openapi';
10
10
 
11
11
  /**
@@ -47,7 +47,7 @@ declare abstract class MemoryCreateEndpoint<E extends Env = Env, M extends MetaI
47
47
  /**
48
48
  * Creates nested related records for the parent.
49
49
  */
50
- protected createNested(parentId: string | number, relationName: string, relationConfig: RelationConfig, data: unknown): Promise<unknown[]>;
50
+ protected createNested(parentId: string | number, _relationName: string, relationConfig: RelationConfig, data: unknown): Promise<unknown[]>;
51
51
  }
52
52
  /**
53
53
  * Memory-based Read endpoint for testing.
@@ -70,7 +70,7 @@ declare abstract class MemoryUpdateEndpoint<E extends Env = Env, M extends MetaI
70
70
  /**
71
71
  * Processes nested write operations for related records.
72
72
  */
73
- protected processNestedWrites(parentId: string | number, relationName: string, relationConfig: RelationConfig, operations: NestedUpdateInput): Promise<NestedWriteResult>;
73
+ protected processNestedWrites(parentId: string | number, _relationName: string, relationConfig: RelationConfig, operations: NestedUpdateInput): Promise<NestedWriteResult>;
74
74
  }
75
75
  /**
76
76
  * Memory-based Delete endpoint for testing.
@@ -85,15 +85,15 @@ declare abstract class MemoryDeleteEndpoint<E extends Env = Env, M extends MetaI
85
85
  /**
86
86
  * Counts related records for restrict check.
87
87
  */
88
- protected countRelated(parentId: string | number, relationName: string, relationConfig: RelationConfig): Promise<number>;
88
+ protected countRelated(parentId: string | number, _relationName: string, relationConfig: RelationConfig): Promise<number>;
89
89
  /**
90
90
  * Deletes related records for cascade delete.
91
91
  */
92
- protected deleteRelated(parentId: string | number, relationName: string, relationConfig: RelationConfig): Promise<number>;
92
+ protected deleteRelated(parentId: string | number, _relationName: string, relationConfig: RelationConfig): Promise<number>;
93
93
  /**
94
94
  * Sets foreign key to null for related records.
95
95
  */
96
- protected nullifyRelated(parentId: string | number, relationName: string, relationConfig: RelationConfig): Promise<number>;
96
+ protected nullifyRelated(parentId: string | number, _relationName: string, relationConfig: RelationConfig): Promise<number>;
97
97
  delete(lookupValue: string, additionalFilters?: Record<string, string>): Promise<ModelObject<M['model']> | null>;
98
98
  }
99
99
  /**
@@ -176,7 +176,7 @@ declare abstract class MemoryBatchUpsertEndpoint<E extends Env = Env, M extends
176
176
  * Performs a native batch upsert operation.
177
177
  * For in-memory storage, this processes all items atomically.
178
178
  */
179
- protected nativeBatchUpsert(items: Partial<ModelObject<M['model']>>[], tx?: unknown): Promise<{
179
+ protected nativeBatchUpsert(items: Partial<ModelObject<M['model']>>[], _tx?: unknown): Promise<{
180
180
  items: Array<{
181
181
  data: ModelObject<M['model']>;
182
182
  created: boolean;
@@ -232,14 +232,14 @@ declare abstract class MemoryUpsertEndpoint<E extends Env = Env, M extends MetaI
232
232
  * Note: Unlike database native upsert, this can accurately determine if the record
233
233
  * was created or updated.
234
234
  */
235
- protected nativeUpsert(data: Partial<ModelObject<M['model']>>, tx?: unknown): Promise<{
235
+ protected nativeUpsert(data: Partial<ModelObject<M['model']>>, _tx?: unknown): Promise<{
236
236
  data: ModelObject<M['model']>;
237
237
  created: boolean;
238
238
  }>;
239
239
  /**
240
240
  * Processes nested write operations.
241
241
  */
242
- protected processNestedWrites(parentId: string | number, relationName: string, relationConfig: RelationConfig, operations: NestedUpdateInput): Promise<NestedWriteResult>;
242
+ protected processNestedWrites(parentId: string | number, _relationName: string, relationConfig: RelationConfig, operations: NestedUpdateInput): Promise<NestedWriteResult>;
243
243
  }
244
244
  /**
245
245
  * Memory-based Version History endpoint for testing.
@@ -1,5 +1,5 @@
1
- export { MemoryAggregateEndpoint, MemoryBatchCreateEndpoint, MemoryBatchDeleteEndpoint, MemoryBatchRestoreEndpoint, MemoryBatchUpdateEndpoint, MemoryBatchUpsertEndpoint, MemoryBulkPatchEndpoint, MemoryCloneEndpoint, MemoryCreateEndpoint, MemoryDeleteEndpoint, MemoryExportEndpoint, MemoryImportEndpoint, MemoryListEndpoint, MemoryReadEndpoint, MemoryRestoreEndpoint, MemorySearchEndpoint, MemoryUpdateEndpoint, MemoryUpsertEndpoint, MemoryVersionCompareEndpoint, MemoryVersionHistoryEndpoint, MemoryVersionReadEndpoint, MemoryVersionRollbackEndpoint, clearStorage, getStorage, getStore, storage } from '../../chunk-OKVSQZMU.js';
2
- import '../../chunk-NTQNZZSH.js';
3
- import '../../chunk-SCC4CBTS.js';
1
+ export { MemoryAggregateEndpoint, MemoryBatchCreateEndpoint, MemoryBatchDeleteEndpoint, MemoryBatchRestoreEndpoint, MemoryBatchUpdateEndpoint, MemoryBatchUpsertEndpoint, MemoryBulkPatchEndpoint, MemoryCloneEndpoint, MemoryCreateEndpoint, MemoryDeleteEndpoint, MemoryExportEndpoint, MemoryImportEndpoint, MemoryListEndpoint, MemoryReadEndpoint, MemoryRestoreEndpoint, MemorySearchEndpoint, MemoryUpdateEndpoint, MemoryUpsertEndpoint, MemoryVersionCompareEndpoint, MemoryVersionHistoryEndpoint, MemoryVersionReadEndpoint, MemoryVersionRollbackEndpoint, clearStorage, getStorage, getStore, storage } from '../../chunk-G7OXZ24G.js';
2
+ import '../../chunk-LCRNKT65.js';
3
+ import '../../chunk-CDCGYMC6.js';
4
4
  import '../../chunk-U3SUUXJK.js';
5
5
  import '../../chunk-FST5S5UY.js';
@@ -1,10 +1,10 @@
1
1
  import { Env } from 'hono';
2
- import { C as CreateEndpoint, M as ModelObject, D as DeleteEndpoint, L as ListEndpoint, R as ReadEndpoint, U as UpdateEndpoint, B as BatchCreateEndpoint, b as BatchDeleteEndpoint, c as BatchRestoreEndpoint, d as BatchUpdateEndpoint, e as BatchUpdateItem, f as BatchUpsertEndpoint, a as RestoreEndpoint, A as AggregateEndpoint, E as ExportEndpoint, I as ImportEndpoint, S as SearchEndpoint, g as UpsertEndpoint, V as VersionCompareEndpoint, h as VersionHistoryEndpoint, i as VersionReadEndpoint, j as VersionRollbackEndpoint } from '../../import-C4cjkYZ1.js';
3
- import { M as MetaInput, L as ListFilters, P as PaginatedResult, I as IncludeOptions, j as AggregateOptions, k as AggregateResult, m as AggregateField, S as SearchOptions, l as SearchResult } from '../../types-CwJSGrCj.js';
2
+ import { C as CreateEndpoint, M as ModelObject, D as DeleteEndpoint, L as ListEndpoint, R as ReadEndpoint, U as UpdateEndpoint, B as BatchCreateEndpoint, b as BatchDeleteEndpoint, c as BatchRestoreEndpoint, d as BatchUpdateEndpoint, e as BatchUpdateItem, f as BatchUpsertEndpoint, a as RestoreEndpoint, A as AggregateEndpoint, E as ExportEndpoint, I as ImportEndpoint, S as SearchEndpoint, g as UpsertEndpoint, V as VersionCompareEndpoint, h as VersionHistoryEndpoint, i as VersionReadEndpoint, j as VersionRollbackEndpoint } from '../../import-B7KS4Wvh.js';
3
+ import { M as MetaInput, L as ListFilters, P as PaginatedResult, I as IncludeOptions, j as AggregateOptions, k as AggregateResult, m as AggregateField, S as SearchOptions, l as SearchResult } from '../../types-CA784ZtV.js';
4
4
  import 'zod';
5
- import '../../route-BCROG0Mx.js';
5
+ import '../../route-DwSID3du.js';
6
6
  import 'hono/utils/http-status';
7
- import '../../versioning-4Pn5V1ed.js';
7
+ import '../../versioning-BG8-R7C0.js';
8
8
  import '@hono/zod-openapi';
9
9
 
10
10
  /**
@@ -241,7 +241,7 @@ declare abstract class PrismaBatchUpsertEndpoint<E extends Env = Env, M extends
241
241
  /**
242
242
  * Performs native Prisma batch upsert using individual upsert calls in a transaction.
243
243
  */
244
- protected nativeBatchUpsert(items: Partial<ModelObject<M['model']>>[], tx?: unknown): Promise<{
244
+ protected nativeBatchUpsert(items: Partial<ModelObject<M['model']>>[], _tx?: unknown): Promise<{
245
245
  items: Array<{
246
246
  data: ModelObject<M['model']>;
247
247
  created: boolean;
@@ -327,7 +327,7 @@ declare abstract class PrismaUpsertEndpoint<E extends Env = Env, M extends MetaI
327
327
  /**
328
328
  * Performs a native Prisma upsert operation.
329
329
  */
330
- protected nativeUpsert(data: Partial<ModelObject<M['model']>>, tx?: unknown): Promise<{
330
+ protected nativeUpsert(data: Partial<ModelObject<M['model']>>, _tx?: unknown): Promise<{
331
331
  data: ModelObject<M['model']>;
332
332
  created: boolean;
333
333
  }>;
@@ -1,5 +1,5 @@
1
- import { CreateEndpoint, ReadEndpoint, UpdateEndpoint, DeleteEndpoint, ListEndpoint, RestoreEndpoint, BatchCreateEndpoint, BatchUpdateEndpoint, BatchDeleteEndpoint, BatchRestoreEndpoint, BatchUpsertEndpoint, SearchEndpoint, searchInMemory, ExportEndpoint, ImportEndpoint, UpsertEndpoint, VersionHistoryEndpoint, VersionReadEndpoint, VersionCompareEndpoint, VersionRollbackEndpoint, AggregateEndpoint, computeAggregations } from '../../chunk-NTQNZZSH.js';
2
- import '../../chunk-SCC4CBTS.js';
1
+ import { CreateEndpoint, ReadEndpoint, UpdateEndpoint, DeleteEndpoint, ListEndpoint, RestoreEndpoint, BatchCreateEndpoint, BatchUpdateEndpoint, BatchDeleteEndpoint, BatchRestoreEndpoint, BatchUpsertEndpoint, SearchEndpoint, searchInMemory, ExportEndpoint, ImportEndpoint, UpsertEndpoint, VersionHistoryEndpoint, VersionReadEndpoint, VersionCompareEndpoint, VersionRollbackEndpoint, AggregateEndpoint, computeAggregations } from '../../chunk-LCRNKT65.js';
2
+ import '../../chunk-CDCGYMC6.js';
3
3
  import '../../chunk-U3SUUXJK.js';
4
4
  import '../../chunk-FST5S5UY.js';
5
5
  import pluralize from 'pluralize';
@@ -542,7 +542,6 @@ var PrismaBatchCreateEndpoint = class extends BatchCreateEndpoint {
542
542
  return getPrismaModel(this.prisma, this._meta.model.tableName);
543
543
  }
544
544
  async batchCreate(items) {
545
- this.getModel();
546
545
  const primaryKey = this._meta.model.primaryKeys[0];
547
546
  const records = items.map((item) => ({
548
547
  ...item,
@@ -732,7 +731,7 @@ var PrismaBatchUpsertEndpoint = class extends BatchUpsertEndpoint {
732
731
  /**
733
732
  * Performs native Prisma batch upsert using individual upsert calls in a transaction.
734
733
  */
735
- async nativeBatchUpsert(items, tx) {
734
+ async nativeBatchUpsert(items, _tx) {
736
735
  if (items.length === 0) {
737
736
  return {
738
737
  items: [],
@@ -1015,7 +1014,7 @@ var PrismaUpsertEndpoint = class extends UpsertEndpoint {
1015
1014
  /**
1016
1015
  * Performs a native Prisma upsert operation.
1017
1016
  */
1018
- async nativeUpsert(data, tx) {
1017
+ async nativeUpsert(data, _tx) {
1019
1018
  const model = this.getModel();
1020
1019
  const upsertKeys = this.getUpsertKeys();
1021
1020
  const primaryKey = this._meta.model.primaryKeys[0];
@@ -1,8 +1,8 @@
1
1
  import { A as AuthEnv, j as JWTConfig, h as JWTClaims, a as APIKeyConfig, b as APIKeyEntry, d as AuthConfig, G as Guard, g as AuthorizationCheck, O as OwnershipExtractor, f as AuthUser, E as EndpointAuthConfig } from '../memory-B_NZbOQP.js';
2
2
  export { c as APIKeyLookupResult, e as AuthType, J as JWTAlgorithm, i as JWTClaimsSchema, M as MemoryAPIKeyStorage, P as PathPattern, V as ValidatedJWTClaims, k as generateAPIKey, l as getAPIKeyStorage, m as hashAPIKey, n as isValidAPIKeyFormat, p as parseJWTClaims, s as safeParseJWTClaims, o as setAPIKeyStorage } from '../memory-B_NZbOQP.js';
3
3
  import { MiddlewareHandler, Context } from 'hono';
4
- import { M as MetaInput, O as OpenAPIRouteSchema } from '../types-CwJSGrCj.js';
5
- import { O as OpenAPIRoute } from '../route-BCROG0Mx.js';
4
+ import { M as MetaInput, O as OpenAPIRouteSchema, ap as Constructor } from '../types-CA784ZtV.js';
5
+ import { O as OpenAPIRoute } from '../route-DwSID3du.js';
6
6
  import 'zod';
7
7
  import '@hono/zod-openapi';
8
8
  import 'hono/utils/http-status';
@@ -260,10 +260,6 @@ declare function allowAll<E extends AuthEnv = AuthEnv>(): MiddlewareHandler<E>;
260
260
  */
261
261
  declare function requireAuthenticated<E extends AuthEnv = AuthEnv>(): MiddlewareHandler<E>;
262
262
 
263
- /**
264
- * Constructor type for classes.
265
- */
266
- type Constructor<T = object> = new (...args: unknown[]) => T;
267
263
  /**
268
264
  * Interface for auth endpoint methods added by withAuth mixin.
269
265
  */
@@ -301,7 +297,7 @@ interface AuthEndpointMethods {
301
297
  * }
302
298
  * ```
303
299
  */
304
- declare abstract class AuthenticatedEndpoint<E extends AuthEnv = AuthEnv, M extends MetaInput = MetaInput> extends OpenAPIRoute<E> {
300
+ declare abstract class AuthenticatedEndpoint<E extends AuthEnv = AuthEnv, _M extends MetaInput = MetaInput> extends OpenAPIRoute<E> {
305
301
  /**
306
302
  * Whether authentication is required for this endpoint.
307
303
  * @default true
@@ -324,7 +320,7 @@ declare abstract class AuthenticatedEndpoint<E extends AuthEnv = AuthEnv, M exte
324
320
  * Custom authorization check.
325
321
  * Return true to allow, false to deny.
326
322
  */
327
- authorize(user: AuthUser, ctx: Context<E>): Promise<boolean>;
323
+ authorize(_user: AuthUser, _ctx: Context<E>): Promise<boolean>;
328
324
  /**
329
325
  * Gets the authenticated user.
330
326
  * Throws UnauthorizedException if not authenticated.
@@ -1,4 +1,4 @@
1
- export { AuthenticatedEndpoint, JWTClaimsSchema, allOf, allowAll, anyOf, createAPIKeyMiddleware, createAuthMiddleware, createJWTMiddleware, decodeJWT, defaultHashAPIKey, denyAll, optionalAuth, parseJWTClaims, requireAllRoles, requireAnyPermission, requireAuth, requireAuthenticated, requireAuthentication, requireOwnership, requireOwnershipOrRole, requirePermissions, requireRoles, safeParseJWTClaims, validateAPIKey, validateAPIKeyEntry, validateJWTClaims, verifyJWT, withAuth } from '../chunk-XYVTFG7O.js';
1
+ export { AuthenticatedEndpoint, JWTClaimsSchema, allOf, allowAll, anyOf, createAPIKeyMiddleware, createAuthMiddleware, createJWTMiddleware, decodeJWT, defaultHashAPIKey, denyAll, optionalAuth, parseJWTClaims, requireAllRoles, requireAnyPermission, requireAuth, requireAuthenticated, requireAuthentication, requireOwnership, requireOwnershipOrRole, requirePermissions, requireRoles, safeParseJWTClaims, validateAPIKey, validateAPIKeyEntry, validateJWTClaims, verifyJWT, withAuth } from '../chunk-KP4HGONO.js';
2
2
  export { MemoryAPIKeyStorage, generateAPIKey, getAPIKeyStorage, hashAPIKey, isValidAPIKeyFormat, setAPIKeyStorage } from '../chunk-6LS3LNIH.js';
3
- import '../chunk-SCC4CBTS.js';
3
+ import '../chunk-CDCGYMC6.js';
4
4
  import '../chunk-FST5S5UY.js';
@@ -1,8 +1,8 @@
1
1
  import { ZodObject, ZodRawShape } from 'zod';
2
2
  import { Env } from 'hono';
3
- import { O as OpenAPIRoute } from './route-BCROG0Mx.js';
4
- import { M as MetaInput, N as NormalizedSoftDeleteConfig, a as NormalizedMultiTenantConfig, O as OpenAPIRouteSchema, H as HookMode, L as ListFilters } from './types-CwJSGrCj.js';
5
- import { M as ModelObject } from './import-C4cjkYZ1.js';
3
+ import { O as OpenAPIRoute } from './route-DwSID3du.js';
4
+ import { M as MetaInput, N as NormalizedSoftDeleteConfig, a as NormalizedMultiTenantConfig, O as OpenAPIRouteSchema, H as HookMode, L as ListFilters } from './types-CA784ZtV.js';
5
+ import { M as ModelObject } from './import-B7KS4Wvh.js';
6
6
 
7
7
  /**
8
8
  * Base endpoint for cloning/duplicating a resource.
@@ -1,11 +1,11 @@
1
1
  import { I as InvalidationPatternOptions, c as CacheKeyOptions, f as CacheStorage, a as CacheEntry, d as CacheSetOptions, e as CacheStats, C as CacheConfig, b as CacheInvalidationConfig } from '../types-DlIkjpdK.js';
2
2
  export { g as InvalidationStrategy } from '../types-DlIkjpdK.js';
3
- import { O as OpenAPIRoute } from '../route-BCROG0Mx.js';
4
- import 'hono';
3
+ import { ap as Constructor } from '../types-CA784ZtV.js';
4
+ import { O as OpenAPIRoute } from '../route-DwSID3du.js';
5
5
  import 'zod';
6
- import 'hono/utils/http-status';
7
- import '../types-CwJSGrCj.js';
6
+ import 'hono';
8
7
  import '@hono/zod-openapi';
8
+ import 'hono/utils/http-status';
9
9
 
10
10
  /**
11
11
  * Generates a cache key from the given options.
@@ -338,10 +338,6 @@ declare function setCacheStorage(storage: CacheStorage): void;
338
338
  * Get the global cache storage instance.
339
339
  */
340
340
  declare function getCacheStorage(): CacheStorage;
341
- /**
342
- * Constructor type for classes.
343
- */
344
- type Constructor<T = object> = new (...args: unknown[]) => T;
345
341
  /**
346
342
  * Interface for cacheable endpoint methods added by withCache mixin.
347
343
  */
@@ -87,12 +87,19 @@ var OpenAPIRoute = class {
87
87
  * Creates a JSON response using Hono's c.json() helper.
88
88
  * Returns Response for compatibility with handle() method signature.
89
89
  */
90
+ /**
91
+ * Hono's c.json() returns TypedResponse<T> which extends Response at runtime
92
+ * but TypeScript sees a generic mismatch. The cast through unknown is safe.
93
+ */
90
94
  json(data, status = 200) {
91
95
  return this.getContext().json(data, status);
92
96
  }
93
97
  /**
94
98
  * Creates a success response.
95
99
  */
100
+ /**
101
+ * Hono's c.json() returns TypedResponse<T> — see json() above for cast rationale.
102
+ */
96
103
  success(result, status = 200) {
97
104
  return this.getContext().json({ success: true, result }, status);
98
105
  }
@@ -1,5 +1,5 @@
1
- import { CreateEndpoint, ReadEndpoint, UpdateEndpoint, DeleteEndpoint, ListEndpoint, RestoreEndpoint, BatchCreateEndpoint, BatchUpdateEndpoint, BatchDeleteEndpoint, BatchRestoreEndpoint, BatchUpsertEndpoint, getSchemaFields, parseListFilters, UpsertEndpoint, VersionHistoryEndpoint, VersionReadEndpoint, VersionCompareEndpoint, VersionRollbackEndpoint, AggregateEndpoint, computeAggregations, SearchEndpoint, searchInMemory, ExportEndpoint, ImportEndpoint } from './chunk-NTQNZZSH.js';
2
- import { OpenAPIRoute } from './chunk-SCC4CBTS.js';
1
+ import { CreateEndpoint, ReadEndpoint, UpdateEndpoint, DeleteEndpoint, ListEndpoint, RestoreEndpoint, BatchCreateEndpoint, BatchUpdateEndpoint, BatchDeleteEndpoint, BatchRestoreEndpoint, BatchUpsertEndpoint, getSchemaFields, parseListFilters, UpsertEndpoint, VersionHistoryEndpoint, VersionReadEndpoint, VersionCompareEndpoint, VersionRollbackEndpoint, AggregateEndpoint, computeAggregations, SearchEndpoint, searchInMemory, ExportEndpoint, ImportEndpoint } from './chunk-LCRNKT65.js';
2
+ import { OpenAPIRoute } from './chunk-CDCGYMC6.js';
3
3
  import { decodeCursor, encodeCursor, getSoftDeleteConfig, getMultiTenantConfig, extractTenantId, applyComputedFields } from './chunk-U3SUUXJK.js';
4
4
  import { NotFoundException } from './chunk-FST5S5UY.js';
5
5
  import { z } from 'zod';
@@ -85,7 +85,7 @@ var MemoryCreateEndpoint = class extends CreateEndpoint {
85
85
  /**
86
86
  * Creates nested related records for the parent.
87
87
  */
88
- async createNested(parentId, relationName, relationConfig, data) {
88
+ async createNested(parentId, _relationName, relationConfig, data) {
89
89
  const relatedStore = getStore(relationConfig.model);
90
90
  const created = [];
91
91
  const items = Array.isArray(data) ? data : [data];
@@ -179,7 +179,7 @@ var MemoryUpdateEndpoint = class extends UpdateEndpoint {
179
179
  /**
180
180
  * Processes nested write operations for related records.
181
181
  */
182
- async processNestedWrites(parentId, relationName, relationConfig, operations) {
182
+ async processNestedWrites(parentId, _relationName, relationConfig, operations) {
183
183
  const relatedStore = getStore(relationConfig.model);
184
184
  const result = {
185
185
  created: [],
@@ -293,7 +293,7 @@ var MemoryDeleteEndpoint = class extends DeleteEndpoint {
293
293
  /**
294
294
  * Counts related records for restrict check.
295
295
  */
296
- async countRelated(parentId, relationName, relationConfig) {
296
+ async countRelated(parentId, _relationName, relationConfig) {
297
297
  const relatedStore = getStore(relationConfig.model);
298
298
  let count = 0;
299
299
  for (const item of relatedStore.values()) {
@@ -306,7 +306,7 @@ var MemoryDeleteEndpoint = class extends DeleteEndpoint {
306
306
  /**
307
307
  * Deletes related records for cascade delete.
308
308
  */
309
- async deleteRelated(parentId, relationName, relationConfig) {
309
+ async deleteRelated(parentId, _relationName, relationConfig) {
310
310
  const relatedStore = getStore(relationConfig.model);
311
311
  let deletedCount = 0;
312
312
  for (const [id, item] of relatedStore.entries()) {
@@ -320,7 +320,7 @@ var MemoryDeleteEndpoint = class extends DeleteEndpoint {
320
320
  /**
321
321
  * Sets foreign key to null for related records.
322
322
  */
323
- async nullifyRelated(parentId, relationName, relationConfig) {
323
+ async nullifyRelated(parentId, _relationName, relationConfig) {
324
324
  const relatedStore = getStore(relationConfig.model);
325
325
  let nullifiedCount = 0;
326
326
  for (const [id, item] of relatedStore.entries()) {
@@ -705,7 +705,7 @@ var MemoryBatchUpsertEndpoint = class extends BatchUpsertEndpoint {
705
705
  * Performs a native batch upsert operation.
706
706
  * For in-memory storage, this processes all items atomically.
707
707
  */
708
- async nativeBatchUpsert(items, tx) {
708
+ async nativeBatchUpsert(items, _tx) {
709
709
  const store = getStore(this._meta.model.tableName);
710
710
  const upsertKeys = this.getUpsertKeys();
711
711
  const primaryKey = this._meta.model.primaryKeys[0];
@@ -1179,7 +1179,7 @@ var MemoryUpsertEndpoint = class extends UpsertEndpoint {
1179
1179
  * Note: Unlike database native upsert, this can accurately determine if the record
1180
1180
  * was created or updated.
1181
1181
  */
1182
- async nativeUpsert(data, tx) {
1182
+ async nativeUpsert(data, _tx) {
1183
1183
  const store = getStore(this._meta.model.tableName);
1184
1184
  const upsertKeys = this.getUpsertKeys();
1185
1185
  const primaryKey = this._meta.model.primaryKeys[0];
@@ -1239,7 +1239,7 @@ var MemoryUpsertEndpoint = class extends UpsertEndpoint {
1239
1239
  /**
1240
1240
  * Processes nested write operations.
1241
1241
  */
1242
- async processNestedWrites(parentId, relationName, relationConfig, operations) {
1242
+ async processNestedWrites(parentId, _relationName, relationConfig, operations) {
1243
1243
  const relatedStore = getStore(relationConfig.model);
1244
1244
  const result = {
1245
1245
  created: [],
@@ -1,4 +1,4 @@
1
- import { OpenAPIRoute } from './chunk-SCC4CBTS.js';
1
+ import { OpenAPIRoute } from './chunk-CDCGYMC6.js';
2
2
  import { UnauthorizedException, ForbiddenException } from './chunk-FST5S5UY.js';
3
3
  import { z } from 'zod';
4
4
  import { decode, verify } from 'hono/jwt';
@@ -490,7 +490,7 @@ function denyAll(message = "Access denied") {
490
490
  };
491
491
  }
492
492
  function allowAll() {
493
- return async (ctx, next) => {
493
+ return async (_ctx, next) => {
494
494
  await next();
495
495
  };
496
496
  }
@@ -525,7 +525,7 @@ var AuthenticatedEndpoint = class extends OpenAPIRoute {
525
525
  * Custom authorization check.
526
526
  * Return true to allow, false to deny.
527
527
  */
528
- async authorize(user, ctx) {
528
+ async authorize(_user, _ctx) {
529
529
  return true;
530
530
  }
531
531
  // ============================================================================
@@ -743,7 +743,7 @@ function withAuth(Base) {
743
743
  * Custom authorization check.
744
744
  * Return true to allow, false to deny.
745
745
  */
746
- async authorize(user, ctx) {
746
+ async authorize(_user, _ctx) {
747
747
  return true;
748
748
  }
749
749
  // ============================================================================