@autonoma-ai/sdk-drizzle 0.1.11 → 0.1.12

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/README.md +7 -8
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -11,27 +11,26 @@ pnpm add @autonoma-ai/sdk @autonoma-ai/sdk-drizzle
11
11
  ## Usage
12
12
 
13
13
  ```typescript
14
- import { drizzleAdapter } from '@autonoma-ai/sdk-drizzle'
14
+ import { drizzleExecutor } from '@autonoma-ai/sdk-drizzle'
15
15
  import { db } from '~/db'
16
- import * as schema from '~/db/schema'
17
16
 
18
- const adapter = drizzleAdapter(db, schema, { scopeField: 'organizationId' })
17
+ const executor = drizzleExecutor(db)
19
18
  ```
20
19
 
21
- Pass the adapter to your server handler:
20
+ Pass the executor to your server handler:
22
21
 
23
22
  ```typescript
24
23
  // app/api/autonoma/route.ts
25
24
  import { createHandler } from '@autonoma-ai/server-web'
26
- import { drizzleAdapter } from '@autonoma-ai/sdk-drizzle'
25
+ import { drizzleExecutor } from '@autonoma-ai/sdk-drizzle'
27
26
  import { db } from '~/db'
28
- import * as schema from '~/db/schema'
29
27
 
30
28
  export const POST = createHandler({
31
- adapter: drizzleAdapter(db, schema, { scopeField: 'organizationId' }),
29
+ executor: drizzleExecutor(db),
30
+ scopeField: 'organizationId',
32
31
  sharedSecret: process.env.AUTONOMA_SHARED_SECRET!,
33
32
  signingSecret: process.env.AUTONOMA_SIGNING_SECRET!,
34
- auth: async (user) => {
33
+ auth: async (user, context) => {
35
34
  const session = await createSession(user.id as string)
36
35
  return { headers: { Authorization: `Bearer ${session.token}` } }
37
36
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autonoma-ai/sdk-drizzle",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Drizzle adapter for Autonoma SDK",
5
5
  "type": "module",
6
6
  "exports": {
@@ -16,7 +16,7 @@
16
16
  "access": "public"
17
17
  },
18
18
  "dependencies": {
19
- "@autonoma-ai/sdk": "0.1.11"
19
+ "@autonoma-ai/sdk": "0.1.12"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "drizzle-orm": ">=0.30.0"