@pgflow/dsl 0.5.4 → 0.6.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.
- package/README.md +2 -3
- package/dist/CHANGELOG.md +29 -0
- package/dist/README.md +2 -3
- package/dist/package.json +1 -1
- package/dist/platforms/supabase.d.ts +4 -2
- package/dist/platforms/supabase.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -120,8 +120,7 @@ All platforms provide these core resources:
|
|
|
120
120
|
When using the Supabase platform with EdgeWorker, additional resources are available:
|
|
121
121
|
|
|
122
122
|
- **`context.sql`** - PostgreSQL client (postgres.js)
|
|
123
|
-
- **`context.
|
|
124
|
-
- **`context.serviceSupabase`** - Supabase client with service role key
|
|
123
|
+
- **`context.supabase`** - Supabase client with service role key for full database access
|
|
125
124
|
|
|
126
125
|
To use Supabase resources, import the `Flow` class from the Supabase preset:
|
|
127
126
|
|
|
@@ -132,7 +131,7 @@ const MyFlow = new Flow<{ userId: string }>({
|
|
|
132
131
|
slug: 'my_flow',
|
|
133
132
|
}).step({ slug: 'process' }, async (input, context) => {
|
|
134
133
|
// TypeScript knows context includes Supabase resources
|
|
135
|
-
const { data } = await context.
|
|
134
|
+
const { data } = await context.supabase
|
|
136
135
|
.from('users')
|
|
137
136
|
.select('*')
|
|
138
137
|
.eq('id', input.userId);
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @pgflow/dsl
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a67bf27: 🚨 **BREAKING**: Remove `anonSupabase` and `serviceSupabase` from context, replaced with single `supabase` client (initialized with service role key)
|
|
8
|
+
|
|
9
|
+
The dual-client approach was unnecessary complexity. Edge Functions run in a trusted environment with service role access, so a single client is sufficient.
|
|
10
|
+
|
|
11
|
+
**Migration guide**:
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
// Before
|
|
15
|
+
const { data } = await context.serviceSupabase.from('users').select();
|
|
16
|
+
const { data: publicData } = await context.anonSupabase
|
|
17
|
+
.from('posts')
|
|
18
|
+
.select();
|
|
19
|
+
|
|
20
|
+
// After
|
|
21
|
+
const { data } = await context.supabase.from('users').select();
|
|
22
|
+
// For RLS-respecting queries, implement proper policies in your database
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
⚠️ **Breaking changes**:
|
|
26
|
+
|
|
27
|
+
- Removed `anonSupabase` from context interface
|
|
28
|
+
- Removed `serviceSupabase` from context interface
|
|
29
|
+
- Added `supabase` field (initialized with service role key)
|
|
30
|
+
- Removed `createAnonSupabaseClient` function
|
|
31
|
+
|
|
3
32
|
## 0.5.4
|
|
4
33
|
|
|
5
34
|
### Patch Changes
|
package/dist/README.md
CHANGED
|
@@ -120,8 +120,7 @@ All platforms provide these core resources:
|
|
|
120
120
|
When using the Supabase platform with EdgeWorker, additional resources are available:
|
|
121
121
|
|
|
122
122
|
- **`context.sql`** - PostgreSQL client (postgres.js)
|
|
123
|
-
- **`context.
|
|
124
|
-
- **`context.serviceSupabase`** - Supabase client with service role key
|
|
123
|
+
- **`context.supabase`** - Supabase client with service role key for full database access
|
|
125
124
|
|
|
126
125
|
To use Supabase resources, import the `Flow` class from the Supabase preset:
|
|
127
126
|
|
|
@@ -132,7 +131,7 @@ const MyFlow = new Flow<{ userId: string }>({
|
|
|
132
131
|
slug: 'my_flow',
|
|
133
132
|
}).step({ slug: 'process' }, async (input, context) => {
|
|
134
133
|
// TypeScript knows context includes Supabase resources
|
|
135
|
-
const { data } = await context.
|
|
134
|
+
const { data } = await context.supabase
|
|
136
135
|
.from('users')
|
|
137
136
|
.select('*')
|
|
138
137
|
.eq('id', input.userId);
|
package/dist/package.json
CHANGED
|
@@ -3,8 +3,10 @@ import type { SupabaseClient } from '@supabase/supabase-js';
|
|
|
3
3
|
import { Flow as CoreFlow, type AnyInput, type AnySteps, type AnyDeps, EmptySteps, EmptyDeps, type Env, type UserEnv, type ValidEnv, type AnyFlow, type Json, type BaseContext } from '../index.js';
|
|
4
4
|
export interface SupabaseResources extends Record<string, unknown> {
|
|
5
5
|
sql: Sql;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Supabase client with service role key for full database access
|
|
8
|
+
*/
|
|
9
|
+
supabase: SupabaseClient;
|
|
8
10
|
}
|
|
9
11
|
export interface SupabaseEnv extends Env {
|
|
10
12
|
EDGE_WORKER_DB_URL: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/platforms/supabase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,IAAI,IAAI,QAAQ,EAChB,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,KAAK,OAAO,EAC1C,UAAU,EAAE,SAAS,EAAE,KAAK,GAAG,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAC5D,KAAK,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,WAAW,EAC1C,MAAM,aAAa,CAAC;AAGrB,MAAM,WAAW,iBAAkB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAChE,GAAG,EAAc,GAAG,CAAC;IACrB
|
|
1
|
+
{"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/platforms/supabase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,IAAI,IAAI,QAAQ,EAChB,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,KAAK,OAAO,EAC1C,UAAU,EAAE,SAAS,EAAE,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