Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ jobs:
token: ${{ secrets.FLOWCORE_MACHINE_GITHUB_TOKEN }}
submodules: true
- name: Extract version from deno.json
uses: sergeysova/jq-action@v2
id: version
with:
cmd: "jq .version deno.json -r"
run: |
echo "value=$(python3 -c 'import json; print(json.load(open("deno.json"))["version"])')" >> "$GITHUB_OUTPUT"
- name: Show my version
run: 'echo "version ${{ steps.version.outputs.value }}"'

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Extract package name from deno.json
uses: sergeysova/jq-action@v2
id: package
with:
cmd: "jq .name deno.json -r"
run: |
echo "value=$(python3 -c 'import json; print(json.load(open("deno.json"))["name"])')" >> "$GITHUB_OUTPUT"
- name: Setup Deno2 environment
uses: denoland/setup-deno@v2
with:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ jobs:
token: ${{ secrets.FLOWCORE_MACHINE_GITHUB_TOKEN }}
submodules: true
- name: Extract version from deno.json
uses: sergeysova/jq-action@v2
id: version
with:
cmd: "jq .version deno.json -r"
run: |
echo "value=$(python3 -c 'import json; print(json.load(open("deno.json"))["version"])')" >> "$GITHUB_OUTPUT"

- name: Show my version
run: 'echo "version ${{ steps.version.outputs.value }}"'
Expand Down
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Pathways helps you build event-driven applications with type-safe pathways for p
- [HTTP Server Integration](#http-server-integration)
- [Persistence Options](#persistence-options)
- [Advanced Usage](#advanced-usage)
- [Runtime Defaults and Auto-Provisioning](#runtime-defaults-and-auto-provisioning)
- [Auditing](#auditing)
- [Custom Loggers](#custom-loggers)
- [Retry Mechanisms](#retry-mechanisms)
Expand Down Expand Up @@ -128,6 +129,52 @@ const pathways = new PathwaysBuilder({
})
```

### Runtime Defaults and Auto-Provisioning

`PathwaysBuilder` can now drive different startup behavior for development and production:

- `development`: starts the local in-process pump and only provisions shared Flowcore resources such as the data core,
flow types, and event types
- `production + virtual`: requires cluster mode and auto-provisions a virtual pathway by name
- `production + managed`: auto-provisions a managed pathway by name and does not start a local pump

```typescript
const pathways = new PathwaysBuilder({
baseUrl: "https://api.flowcore.io",
tenant: "your-tenant",
dataCore: "your-data-core",
apiKey: process.env.FLOWCORE_API_KEY!,
runtimeEnv: process.env.NODE_ENV === "production" ? "production" : "development",
pathwayName: "orders-service",
pathwayMode: "virtual", // default
defaultAutoProvision: true, // default
})
```

For managed production delivery, provide a transform endpoint and leave event fetching to the control plane:

```typescript
const pathways = new PathwaysBuilder({
baseUrl: "https://api.flowcore.io",
tenant: "your-tenant",
dataCore: "your-data-core",
apiKey: process.env.FLOWCORE_API_KEY!,
runtimeEnv: "production",
pathwayName: "orders-service",
pathwayMode: "managed",
managedConfig: {
endpointUrl: "https://app.example.com/api/flowcore",
authHeaders: {
authorization: `Bearer ${process.env.TRANSFORM_TOKEN!}`,
},
sizeClass: "medium",
},
})
```

To disable all remote provisioning and keep startup fully manual, set `defaultAutoProvision: false` or pass
`autoProvision: false` to `startPump()`.

### Registering Pathways

Register pathways with their schemas for type-safe event handling:
Expand Down
3 changes: 2 additions & 1 deletion deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading