@toride/drizzle 0.1.0 → 0.2.0

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +2 -2
  2. package/package.json +6 -2
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ConstraintAdapter, ResourceRef } from 'toride';
1
+ import { ConstraintAdapter, TorideSchema, DefaultSchema, ResourceRef } from 'toride';
2
2
 
3
3
  declare const VERSION = "0.0.1";
4
4
 
@@ -54,6 +54,6 @@ interface DrizzleResolverOptions {
54
54
  * @param options - Optional configuration.
55
55
  * @returns A ResourceResolver function.
56
56
  */
57
- declare function createDrizzleResolver(db: any, table: any, options?: DrizzleResolverOptions): (ref: ResourceRef) => Promise<Record<string, unknown>>;
57
+ declare function createDrizzleResolver<S extends TorideSchema = DefaultSchema, R extends S["resources"] = S["resources"]>(db: any, table: any, options?: DrizzleResolverOptions): (ref: ResourceRef<S, R>) => Promise<S["resourceAttributeMap"][R]>;
58
58
 
59
59
  export { type AnyTable, type DrizzleAdapterOptions, type DrizzleQuery, type DrizzleResolverOptions, type RelationConfig, type RoleAssignmentConfig, VERSION, createDrizzleAdapter, createDrizzleResolver };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toride/drizzle",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Drizzle ORM integration for Toride authorization engine",
5
5
  "type": "module",
6
6
  "exports": {
@@ -20,7 +20,7 @@
20
20
  ]
21
21
  },
22
22
  "dependencies": {
23
- "toride": "0.1.0"
23
+ "toride": "0.2.0"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "drizzle-orm": ">=0.29.0"
@@ -33,6 +33,9 @@
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
+ "devDependencies": {
37
+ "tsd": "^0.33.0"
38
+ },
36
39
  "keywords": [
37
40
  "authorization",
38
41
  "drizzle",
@@ -46,6 +49,7 @@
46
49
  "scripts": {
47
50
  "build": "tsup",
48
51
  "test": "vitest run",
52
+ "typetest": "tsd --files 'src/__typetests__/*.test-d.ts'",
49
53
  "lint": "tsc --noEmit"
50
54
  }
51
55
  }