@pgflow/core 0.0.0-array-map-steps-cd94242a-20251008042921 → 0.0.0-condition-4354fcb6-20260108134756

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/dist/types.d.ts CHANGED
@@ -1,14 +1,16 @@
1
- import type { ExtractFlowSteps, StepInput, Simplify, AnyFlow, ExtractFlowInput } from '@pgflow/dsl';
1
+ import type { ExtractFlowSteps, StepInput, Simplify, AnyFlow, ExtractFlowInput, Json } from '@pgflow/dsl';
2
2
  import type { Database } from './database-types.js';
3
- export type Json = string | number | boolean | null | {
4
- [key: string]: Json | undefined;
5
- } | Json[];
3
+ export type { Json };
6
4
  /**
7
5
  * Record representing a task from pgflow.start_tasks
8
6
  *
9
7
  * Same as pgflow.step_task_record type, but with not-null fields and type argument for payload.
10
8
  * The input type is automatically inferred based on the step_slug using a discriminated union.
11
9
  * This ensures that each step only receives inputs from its declared dependencies and the flow's run input.
10
+ *
11
+ * Note: flow_input is nullable because start_tasks only includes it for root non-map steps.
12
+ * For dependent and map steps, flow_input is NULL to avoid data duplication.
13
+ * Workers can access the original flow input via ctx.flowInput (lazy loaded).
12
14
  */
13
15
  export type StepTaskRecord<TFlow extends AnyFlow> = {
14
16
  [StepSlug in Extract<keyof ExtractFlowSteps<TFlow>, string>]: {
@@ -18,6 +20,7 @@ export type StepTaskRecord<TFlow extends AnyFlow> = {
18
20
  task_index: number;
19
21
  input: Simplify<StepInput<TFlow, StepSlug>>;
20
22
  msg_id: number;
23
+ flow_input: ExtractFlowInput<TFlow> | null;
21
24
  };
22
25
  }[Extract<keyof ExtractFlowSteps<TFlow>, string>];
23
26
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,OAAO,EACP,gBAAgB,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,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AO,CAAC,CAAC,KAAK,CAAC,CAAC;AAEnE;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "@pgflow/core",
3
- "version": "0.0.0-array-map-steps-cd94242a-20251008042921",
4
- "license": "AGPL-3.0",
3
+ "version": "0.0.0-condition-4354fcb6-20260108134756",
4
+ "license": "Apache-2.0",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/pgflow-dev/pgflow",
8
+ "directory": "pkgs/core"
9
+ },
5
10
  "type": "module",
6
11
  "main": "./dist/index.js",
7
12
  "module": "./dist/index.js",
@@ -19,12 +24,11 @@
19
24
  }
20
25
  },
21
26
  "devDependencies": {
22
- "@types/node": "^22.14.1",
23
- "supabase": "2.21.1"
27
+ "@types/node": "^22.14.1"
24
28
  },
25
29
  "dependencies": {
26
30
  "postgres": "^3.4.5",
27
- "@pgflow/dsl": "0.0.0-array-map-steps-cd94242a-20251008042921"
31
+ "@pgflow/dsl": "0.0.0-condition-4354fcb6-20260108134756"
28
32
  },
29
33
  "publishConfig": {
30
34
  "access": "public"
package/dist/ATLAS.md DELETED
@@ -1,32 +0,0 @@
1
- # Atlas setup
2
-
3
- We use [Atlas](https://atlasgo.io/docs) to generate migrations from the declarative schemas stored in `./schemas/` folder.
4
-
5
- ## Configuration
6
-
7
- The setup is configured in `atlas.hcl`.
8
-
9
- It is set to compare `schemas/` to what is in `supabase/migrations/`.
10
-
11
- ### Docker dev image
12
-
13
- Atlas requires a dev database to be available for computing diffs.
14
- The database must be empty, but contain everything needed for the schemas to apply.
15
-
16
- We need a configured [PGMQ](https://github.com/tembo-io/pgmq) extension, which Atlas does not support
17
- in their dev images.
18
-
19
- That's why this setup relies on a custom built image `jumski/postgres-15-pgmq:latest`.
20
-
21
- Inspect `Dockerfile.atlas` to see how it is built.
22
-
23
- See also `./scripts/build-atlas-postgres-image` and `./scripts/push-atlas-postgres-image` scripts for building and pushing the image.
24
-
25
- ## Workflow
26
-
27
- 1. Make sure you start with a clean database (`pnpm supabase db reset`).
28
- 1. Modify the schemas in `schemas/` to a desired state.
29
- 1. Run `./scripts/atlas-migrate-diff <migration-name>` to create a new migration based on the diff.
30
- 1. Run `pnpm supabase migration up` to apply the migration.
31
- 1. In case of any errors, remove the generated migration file, make changes in `schemas/` and repeat the process.
32
- 1. After the migration is applied, verify it does not break tests with `nx test:pgtap`