Skip to content

Commit 2356af4

Browse files
Copilothotlong
andcommitted
fix: address review - prefix unused params with underscore and update ROADMAP
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent abe5a1c commit 2356af4

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

ROADMAP.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ business/custom objects, aligning with industry best practices (e.g., ServiceNow
329329
**Migration (v3.x → v4.0):**
330330
- v3.x: The `SystemObjectName` constants now emit `sys_`-prefixed names. Implementations using `StorageNameMapping.resolveTableName()` can set `tableName` to preserve legacy physical table names during the transition.
331331
- v3.x: The `@objectstack/plugin-auth` ObjectQL adapter now includes `AUTH_MODEL_TO_PROTOCOL` mapping to translate better-auth's hardcoded model names (`user`, `session`, `account`, `verification`) to protocol names (`sys_user`, `sys_session`, `sys_account`, `sys_verification`). Custom adapters must adopt the same mapping.
332+
- v3.x: **Enhancement**`AuthManager` now uses better-auth's official `modelName` / `fields` schema customisation API (`AUTH_USER_CONFIG`, `AUTH_SESSION_CONFIG`, `AUTH_ACCOUNT_CONFIG`, `AUTH_VERIFICATION_CONFIG`) to declare camelCase → snake_case field mappings. The ObjectQL adapter uses `createAdapterFactory` from `better-auth/adapters` to apply these transformations automatically, eliminating the need for manual field-name conversion. The legacy `createObjectQLAdapter()` is retained for backward compatibility.
332333
- v3.x: **Bug fix**`AuthManager.createDatabaseConfig()` now wraps the ObjectQL adapter as a `DBAdapterInstance` factory function (`(options) => DBAdapter`). Previously the raw adapter object was passed, which fell through to the Kysely adapter path and failed silently. `AuthManager.handleRequest()` and `AuthPlugin.registerAuthRoutes()` now inspect `response.status >= 500` and log the error body, since better-auth catches internal errors and returns 500 Responses without throwing.
333334
- v3.x: **Bug fix**`AuthPlugin` now defers HTTP route registration to a `kernel:ready` hook instead of doing it synchronously in `start()`. This makes the plugin resilient to plugin loading order — the `http-server` service is guaranteed to be available after all plugins complete their init/start phases. The CLI `serve` command also registers `HonoServerPlugin` before config plugins (with duplicate detection) for the same reason.
334335
- v4.0: Legacy un-prefixed aliases will be fully removed.

packages/plugins/plugin-auth/src/objectql-adapter.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,25 +95,24 @@ export function createObjectQLAdapterFactory(dataEngine: IDataEngine) {
9595
},
9696
adapter: () => ({
9797
create: async <T extends Record<string, any>>(
98-
{ model, data }: { model: string; data: T; select?: string[] },
98+
{ model, data, select: _select }: { model: string; data: T; select?: string[] },
9999
): Promise<T> => {
100100
const result = await dataEngine.insert(model, data);
101101
return result as T;
102102
},
103103

104104
findOne: async <T>(
105-
{ model, where, select }: { model: string; where: CleanedWhere[]; select?: string[]; join?: any },
105+
{ model, where, select, join: _join }: { model: string; where: CleanedWhere[]; select?: string[]; join?: any },
106106
): Promise<T | null> => {
107107
const filter = convertWhere(where);
108108

109-
// Note: join is not currently supported by ObjectQL's findOne operation
110109
const result = await dataEngine.findOne(model, { filter, select });
111110

112111
return result ? (result as T) : null;
113112
},
114113

115114
findMany: async <T>(
116-
{ model, where, limit, offset, sortBy }: {
115+
{ model, where, limit, offset, sortBy, join: _join }: {
117116
model: string; where?: CleanedWhere[]; limit: number;
118117
offset?: number; sortBy?: { field: string; direction: 'asc' | 'desc' }; join?: any;
119118
},

0 commit comments

Comments
 (0)