pgflow 0.10.0 → 0.12.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-example-worker.d.ts","sourceRoot":"","sources":["../../../src/commands/install/create-example-worker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-example-worker.d.ts","sourceRoot":"","sources":["../../../src/commands/install/create-example-worker.ts"],"names":[],"mappings":"AA+CA,wBAAsB,mBAAmB,CAAC,EACxC,YAAY,EACZ,WAAmB,GACpB,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,OAAO,CAAC,OAAO,CAAC,CAkEnB"}
|
|
@@ -3,7 +3,28 @@ import path from 'path';
|
|
|
3
3
|
import { log, confirm } from '@clack/prompts';
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
import { getVersion } from '../../utils/get-version.js';
|
|
6
|
-
const INDEX_TS_TEMPLATE =
|
|
6
|
+
const INDEX_TS_TEMPLATE = `/**
|
|
7
|
+
* To run this worker locally:
|
|
8
|
+
*
|
|
9
|
+
* 1. Start the Edge Runtime (in one terminal):
|
|
10
|
+
* npx supabase functions serve --no-verify-jwt
|
|
11
|
+
*
|
|
12
|
+
* 2. Start the worker (in another terminal):
|
|
13
|
+
* curl http://localhost:54321/functions/v1/greet-user-worker
|
|
14
|
+
*
|
|
15
|
+
* 3. Trigger a flow run (in Supabase Studio SQL Editor):
|
|
16
|
+
* SELECT * FROM pgflow.start_flow(
|
|
17
|
+
* flow_slug => 'greetUser',
|
|
18
|
+
* input => '{"firstName": "Alice", "lastName": "Smith"}'::jsonb
|
|
19
|
+
* );
|
|
20
|
+
*
|
|
21
|
+
* 4. Check run status:
|
|
22
|
+
* SELECT * FROM pgflow.runs
|
|
23
|
+
* WHERE flow_slug = 'greetUser'
|
|
24
|
+
* ORDER BY started_at DESC
|
|
25
|
+
* LIMIT 1;
|
|
26
|
+
*/
|
|
27
|
+
import { EdgeWorker } from '@pgflow/edge-worker';
|
|
7
28
|
import { GreetUser } from '../../flows/greet-user.ts';
|
|
8
29
|
|
|
9
30
|
EdgeWorker.start(GreetUser);
|
|
@@ -19,11 +19,11 @@ export const GreetUser = new Flow<Input>({
|
|
|
19
19
|
})
|
|
20
20
|
.step(
|
|
21
21
|
{ slug: 'fullName' },
|
|
22
|
-
(
|
|
22
|
+
(flowInput) => \`\${flowInput.firstName} \${flowInput.lastName}\`
|
|
23
23
|
)
|
|
24
24
|
.step(
|
|
25
25
|
{ slug: 'greeting', dependsOn: ['fullName'] },
|
|
26
|
-
(
|
|
26
|
+
(deps) => \`Hello, \${deps.fullName}!\`
|
|
27
27
|
);
|
|
28
28
|
`;
|
|
29
29
|
export async function createFlowsDirectory({ supabasePath, autoConfirm = false, }) {
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pgflow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@decimalturn/toml-patch": "0.3.7",
|
|
31
31
|
"chalk": "^5.4.1",
|
|
32
32
|
"commander": "^13.1.0",
|
|
33
|
-
"@pgflow/core": "0.
|
|
33
|
+
"@pgflow/core": "0.12.0"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|