diff --git a/package-lock.json b/package-lock.json index d8972d48..f2b8a8e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "name": "convex-helpers-base", "dependencies": { "classnames": "^2.3.2", - "convex": "^1.31.0", + "convex": "^1.31.2", "convex-helpers": "file:packages/convex-helpers/dist", "hono": "^4.3.6", "react": "^19.2.3", diff --git a/package.json b/package.json index 82e5abc1..b62dbc4d 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ }, "dependencies": { "classnames": "^2.3.2", - "convex": "^1.31.0", + "convex": "^1.31.2", "convex-helpers": "file:packages/convex-helpers/dist", "hono": "^4.3.6", "react": "^19.2.3", diff --git a/packages/convex-helpers/CHANGELOG.md b/packages/convex-helpers/CHANGELOG.md index bdd251dd..ec28a8b2 100644 --- a/packages/convex-helpers/CHANGELOG.md +++ b/packages/convex-helpers/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.1.109 (upcoming) + +- Triggers/row-level security: fix a type issue with the `ctx.db` APIs with + table name arguments (see the changelog of + [`convex@1.31.2`](https://github.com/get-convex/convex-js/blob/main/CHANGELOG.md#1312)) + ## 0.1.108 - `makeUseQueryWithStatus`: fix handling of some argument values diff --git a/packages/convex-helpers/server/rowLevelSecurity.ts b/packages/convex-helpers/server/rowLevelSecurity.ts index f14a685c..20f8d1ea 100644 --- a/packages/convex-helpers/server/rowLevelSecurity.ts +++ b/packages/convex-helpers/server/rowLevelSecurity.ts @@ -237,8 +237,8 @@ class WrapReader } get>( - table: NonUnion, - id: GenericId, + table: TableName, + id: GenericId>, ): Promise | null>; get>( id: GenericId, @@ -356,8 +356,8 @@ class WrapWriter } patch>( - table: NonUnion, - id: GenericId, + table: TableName, + id: GenericId>, value: Partial>, ): Promise; patch>( @@ -374,8 +374,8 @@ class WrapWriter } replace>( - table: NonUnion, - id: GenericId, + table: TableName, + id: GenericId>, value: WithOptionalSystemFields>, ): Promise; replace>( @@ -392,8 +392,8 @@ class WrapWriter } delete>( - table: NonUnion, - id: GenericId, + table: TableName, + id: GenericId>, ): Promise; delete(id: GenericId>): Promise; async delete(arg0: any, arg1?: any): Promise { @@ -405,8 +405,8 @@ class WrapWriter } get>( - table: NonUnion, - id: GenericId, + table: TableName, + id: GenericId>, ): Promise | null>; get>( id: GenericId, diff --git a/packages/convex-helpers/server/triggers.ts b/packages/convex-helpers/server/triggers.ts index 171bf681..d8b8a2d9 100644 --- a/packages/convex-helpers/server/triggers.ts +++ b/packages/convex-helpers/server/triggers.ts @@ -171,8 +171,8 @@ export class DatabaseWriterWithTriggers< } delete>( - table: NonUnion, - id: GenericId, + table: TableName, + id: GenericId>, ): Promise; delete(id: GenericId>): Promise; delete(arg0: any, arg1?: any): Promise { @@ -180,8 +180,8 @@ export class DatabaseWriterWithTriggers< } get>( - table: NonUnion, - id: GenericId, + table: TableName, + id: GenericId>, ): Promise | null>; get>( id: GenericId, @@ -198,8 +198,8 @@ export class DatabaseWriterWithTriggers< } patch>( - table: NonUnion, - id: GenericId, + table: TableName, + id: GenericId>, value: PatchValue>, ): Promise; patch>( @@ -224,8 +224,8 @@ export class DatabaseWriterWithTriggers< } replace>( - table: NonUnion, - id: GenericId, + table: TableName, + id: GenericId>, value: WithOptionalSystemFields>, ): Promise; replace>( @@ -252,8 +252,8 @@ export function writerWithTriggers< ): GenericDatabaseWriter { const patch: { >( - table: NonUnion, - id: GenericId, + table: TableName, + id: GenericId>, value: PatchValue>, ): Promise; >( @@ -293,8 +293,8 @@ export function writerWithTriggers< const replace: { >( - table: NonUnion, - id: GenericId, + table: TableName, + id: GenericId>, value: WithOptionalSystemFields>, ): Promise; >( @@ -334,8 +334,8 @@ export function writerWithTriggers< const delete_: { >( - table: NonUnion, - id: GenericId, + table: TableName, + id: GenericId>, ): Promise; (id: GenericId>): Promise; } = async (arg0: any, arg1?: any) => {