@t4h.framework/dev 0.14.1 → 0.15.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/CHANGELOG.md +19 -0
- package/README.md +96 -45
- package/dist/AppProcess.d.ts +36 -0
- package/dist/AppProcess.js +126 -0
- package/dist/AppProcess.js.map +1 -0
- package/dist/Server.d.ts +41 -0
- package/dist/Server.js +168 -0
- package/dist/Server.js.map +1 -0
- package/dist/constants/server.d.ts +9 -0
- package/dist/constants/server.js +10 -0
- package/dist/constants/server.js.map +1 -0
- package/dist/http/create-app.d.ts +16 -0
- package/dist/http/create-app.js +134 -0
- package/dist/http/create-app.js.map +1 -0
- package/dist/http/helpers/to-http-error.d.ts +8 -0
- package/dist/http/helpers/to-http-error.js +9 -0
- package/dist/http/helpers/to-http-error.js.map +1 -0
- package/dist/http/middlewares/error-handler.middleware.d.ts +2 -0
- package/dist/http/middlewares/error-handler.middleware.js +27 -0
- package/dist/http/middlewares/error-handler.middleware.js.map +1 -0
- package/dist/http/middlewares/project-manifest.middleware.d.ts +11 -0
- package/dist/http/middlewares/project-manifest.middleware.js +11 -0
- package/dist/http/middlewares/project-manifest.middleware.js.map +1 -0
- package/dist/http/middlewares/read-json-body.middleware.d.ts +6 -0
- package/dist/http/middlewares/read-json-body.middleware.js +22 -0
- package/dist/http/middlewares/read-json-body.middleware.js.map +1 -0
- package/dist/http/middlewares/workflow-authorization.middleware.d.ts +12 -0
- package/dist/http/middlewares/workflow-authorization.middleware.js +28 -0
- package/dist/http/middlewares/workflow-authorization.middleware.js.map +1 -0
- package/dist/index.d.ts +3 -15
- package/dist/index.js +2 -15
- package/dist/index.js.map +1 -1
- package/dist/models/JSONRPCClient.d.ts +2 -0
- package/dist/models/JSONRPCClient.js +21 -4
- package/dist/models/JSONRPCClient.js.map +1 -1
- package/dist/models/JSONRPCError.d.ts +13 -0
- package/dist/models/JSONRPCError.js +11 -0
- package/dist/models/JSONRPCError.js.map +1 -0
- package/dist/models/JSONRPCServer.d.ts +2 -0
- package/dist/models/JSONRPCServer.js +27 -5
- package/dist/models/JSONRPCServer.js.map +1 -1
- package/dist/models/WorkflowAuthorizationMissingError.d.ts +5 -0
- package/dist/models/WorkflowAuthorizationMissingError.js +9 -0
- package/dist/models/WorkflowAuthorizationMissingError.js.map +1 -0
- package/dist/models/WorkflowRun.d.ts +28 -15
- package/dist/models/WorkflowRun.js +17 -8
- package/dist/models/WorkflowRun.js.map +1 -1
- package/dist/models/WorkflowRunActivity.d.ts +40 -27
- package/dist/models/WorkflowRunActivity.js +46 -34
- package/dist/models/WorkflowRunActivity.js.map +1 -1
- package/dist/models/claims/DevHttpClientRequestClaim.js +4 -5
- package/dist/models/claims/DevHttpClientRequestClaim.js.map +1 -1
- package/dist/models/claims/DevORMClaim.d.ts +15 -4
- package/dist/models/claims/DevORMClaim.js +128 -29
- package/dist/models/claims/DevORMClaim.js.map +1 -1
- package/dist/models/claims/DevWorkflowBatchClaim.js +2 -3
- package/dist/models/claims/DevWorkflowBatchClaim.js.map +1 -1
- package/dist/models/claims/DevWorkflowClaim.d.ts +1 -1
- package/dist/models/claims/DevWorkflowClaim.js +6 -11
- package/dist/models/claims/DevWorkflowClaim.js.map +1 -1
- package/dist/repositories/WorkflowRun.repository.d.ts +41 -6
- package/dist/repositories/WorkflowRun.repository.js +204 -11
- package/dist/repositories/WorkflowRun.repository.js.map +1 -1
- package/dist/repositories/WorkflowRunActivity.repository.d.ts +19 -6
- package/dist/repositories/WorkflowRunActivity.repository.js +73 -23
- package/dist/repositories/WorkflowRunActivity.repository.js.map +1 -1
- package/dist/repositories/WorkflowRunAsyncActivityPending.repository.d.ts +39 -0
- package/dist/repositories/WorkflowRunAsyncActivityPending.repository.js +160 -0
- package/dist/repositories/WorkflowRunAsyncActivityPending.repository.js.map +1 -0
- package/dist/services/ActivityRegistry.service.d.ts +7 -0
- package/dist/services/ActivityRegistry.service.js +32 -0
- package/dist/services/ActivityRegistry.service.js.map +1 -0
- package/dist/services/Database.service.d.ts +14 -0
- package/dist/services/Database.service.js +108 -0
- package/dist/services/Database.service.js.map +1 -0
- package/dist/services/TimeoutScheduler.service.js +9 -3
- package/dist/services/TimeoutScheduler.service.js.map +1 -1
- package/dist/services/WorkflowAuthorization.service.d.ts +19 -0
- package/dist/services/WorkflowAuthorization.service.js +75 -0
- package/dist/services/WorkflowAuthorization.service.js.map +1 -0
- package/dist/services/WorkflowRunAsyncActivityFacade.service.d.ts +8 -15
- package/dist/services/WorkflowRunAsyncActivityFacade.service.js +12 -26
- package/dist/services/WorkflowRunAsyncActivityFacade.service.js.map +1 -1
- package/dist/services/WorkflowRunEvents.service.d.ts +11 -0
- package/dist/services/WorkflowRunEvents.service.js +42 -0
- package/dist/services/WorkflowRunEvents.service.js.map +1 -0
- package/dist/services/WorkflowRunFacade.service.d.ts +109 -7
- package/dist/services/WorkflowRunFacade.service.js +65 -10
- package/dist/services/WorkflowRunFacade.service.js.map +1 -1
- package/dist/services/WorkflowRunLock.service.d.ts +6 -0
- package/dist/services/WorkflowRunLock.service.js +34 -0
- package/dist/services/WorkflowRunLock.service.js.map +1 -0
- package/dist/services/WorkflowRunSyncActivityFacade.service.d.ts +4 -4
- package/dist/services/WorkflowRunSyncActivityFacade.service.js +7 -7
- package/dist/services/WorkflowRunSyncActivityFacade.service.js.map +1 -1
- package/dist/tools/find-workflow-by-id.d.ts +2 -0
- package/dist/tools/find-workflow-by-id.js +9 -0
- package/dist/tools/find-workflow-by-id.js.map +1 -0
- package/dist/tools/format-routes.d.ts +10 -0
- package/dist/tools/format-routes.js +40 -0
- package/dist/tools/format-routes.js.map +1 -0
- package/dist/tools/replace.d.ts +1 -0
- package/dist/tools/replace.js +14 -0
- package/dist/tools/replace.js.map +1 -0
- package/dist/tools/to-workflow-run-activity-output.d.ts +24 -0
- package/dist/tools/to-workflow-run-activity-output.js +18 -0
- package/dist/tools/to-workflow-run-activity-output.js.map +1 -0
- package/dist/tools/to-workflow-run-output.d.ts +12 -0
- package/dist/tools/to-workflow-run-output.js +13 -0
- package/dist/tools/to-workflow-run-output.js.map +1 -0
- package/dist/transport/AppProcessJsonRpc.js +59 -0
- package/dist/transport/AppProcessJsonRpc.js.map +1 -0
- package/dist/use-cases/BuildWorkflowRunActivityHistory.usecase.d.ts +9 -0
- package/dist/use-cases/{WorkflowRunBuildHistory.usecase.js → BuildWorkflowRunActivityHistory.usecase.js} +18 -16
- package/dist/use-cases/BuildWorkflowRunActivityHistory.usecase.js.map +1 -0
- package/dist/use-cases/CreateWorkflowRun.usecase.d.ts +6 -6
- package/dist/use-cases/CreateWorkflowRun.usecase.js +20 -21
- package/dist/use-cases/CreateWorkflowRun.usecase.js.map +1 -1
- package/dist/use-cases/CreateWorkflowRunAsyncActivity.usecase.d.ts +9 -3
- package/dist/use-cases/CreateWorkflowRunAsyncActivity.usecase.js +45 -39
- package/dist/use-cases/CreateWorkflowRunAsyncActivity.usecase.js.map +1 -1
- package/dist/use-cases/EnqueueWorkflowRunNextTick.usecase.d.ts +9 -0
- package/dist/use-cases/EnqueueWorkflowRunNextTick.usecase.js +43 -0
- package/dist/use-cases/EnqueueWorkflowRunNextTick.usecase.js.map +1 -0
- package/dist/use-cases/ExecuteWorkflowRunActivity.usecase.d.ts +9 -0
- package/dist/use-cases/ExecuteWorkflowRunActivity.usecase.js +46 -0
- package/dist/use-cases/ExecuteWorkflowRunActivity.usecase.js.map +1 -0
- package/dist/use-cases/ExecuteWorkflowRunAsyncActivity.usecase.d.ts +22 -0
- package/dist/use-cases/ExecuteWorkflowRunAsyncActivity.usecase.js +117 -0
- package/dist/use-cases/ExecuteWorkflowRunAsyncActivity.usecase.js.map +1 -0
- package/dist/use-cases/NextTickWorkflowRun.usecase.d.ts +18 -7
- package/dist/use-cases/NextTickWorkflowRun.usecase.js +153 -126
- package/dist/use-cases/NextTickWorkflowRun.usecase.js.map +1 -1
- package/dist/use-cases/RunWorkflow.usecase.d.ts +10 -0
- package/dist/use-cases/RunWorkflow.usecase.js +46 -0
- package/dist/use-cases/RunWorkflow.usecase.js.map +1 -0
- package/dist/use-cases/WorkflowRunActivityFind.usecase.d.ts +34 -0
- package/dist/use-cases/WorkflowRunActivityFind.usecase.js +49 -0
- package/dist/use-cases/WorkflowRunActivityFind.usecase.js.map +1 -0
- package/dist/use-cases/WorkflowRunActivityFindById.usecase.d.ts +34 -0
- package/dist/use-cases/WorkflowRunActivityFindById.usecase.js +60 -0
- package/dist/use-cases/WorkflowRunActivityFindById.usecase.js.map +1 -0
- package/dist/use-cases/WorkflowRunAsyncActivityAdvance.usecase.d.ts +12 -4
- package/dist/use-cases/WorkflowRunAsyncActivityAdvance.usecase.js +41 -27
- package/dist/use-cases/WorkflowRunAsyncActivityAdvance.usecase.js.map +1 -1
- package/dist/use-cases/WorkflowRunAsyncActivityPendingFind.usecase.d.ts +24 -0
- package/dist/use-cases/WorkflowRunAsyncActivityPendingFind.usecase.js +56 -0
- package/dist/use-cases/WorkflowRunAsyncActivityPendingFind.usecase.js.map +1 -0
- package/dist/use-cases/WorkflowRunFind.usecase.d.ts +18 -0
- package/dist/use-cases/WorkflowRunFind.usecase.js +28 -0
- package/dist/use-cases/WorkflowRunFind.usecase.js.map +1 -0
- package/dist/use-cases/WorkflowRunFindById.usecase.d.ts +21 -0
- package/dist/use-cases/WorkflowRunFindById.usecase.js +46 -0
- package/dist/use-cases/WorkflowRunFindById.usecase.js.map +1 -0
- package/dist/workers/app-process.js +10 -1
- package/dist/workers/app-process.js.map +1 -1
- package/package.json +14 -4
- package/.ai/skills/framework-dev/SKILL.md +0 -348
- package/dist/DevServer.d.ts +0 -24
- package/dist/DevServer.js +0 -87
- package/dist/DevServer.js.map +0 -1
- package/dist/models/InMemoryDatabase.d.ts +0 -20
- package/dist/models/InMemoryDatabase.js +0 -111
- package/dist/models/InMemoryDatabase.js.map +0 -1
- package/dist/services/BuildWorkflowRunResult.service.d.ts +0 -8
- package/dist/services/BuildWorkflowRunResult.service.js +0 -49
- package/dist/services/BuildWorkflowRunResult.service.js.map +0 -1
- package/dist/tools/is-workflow-waiting.d.ts +0 -4
- package/dist/tools/is-workflow-waiting.js +0 -12
- package/dist/tools/is-workflow-waiting.js.map +0 -1
- package/dist/transport/DevServerJsonRpc.js +0 -42
- package/dist/transport/DevServerJsonRpc.js.map +0 -1
- package/dist/use-cases/CallbackWorkflowRunAsyncActivity.usecase.d.ts +0 -14
- package/dist/use-cases/CallbackWorkflowRunAsyncActivity.usecase.js +0 -64
- package/dist/use-cases/CallbackWorkflowRunAsyncActivity.usecase.js.map +0 -1
- package/dist/use-cases/TimeoutWorkflowRunAsyncActivity.usecase.d.ts +0 -8
- package/dist/use-cases/TimeoutWorkflowRunAsyncActivity.usecase.js +0 -40
- package/dist/use-cases/TimeoutWorkflowRunAsyncActivity.usecase.js.map +0 -1
- package/dist/use-cases/WorkflowRunAsyncActivity.usecase.d.ts +0 -7
- package/dist/use-cases/WorkflowRunAsyncActivity.usecase.js +0 -46
- package/dist/use-cases/WorkflowRunAsyncActivity.usecase.js.map +0 -1
- package/dist/use-cases/WorkflowRunBuildHistory.usecase.d.ts +0 -8
- package/dist/use-cases/WorkflowRunBuildHistory.usecase.js.map +0 -1
- package/dist/use-cases/WorkflowRunSyncActivity.usecase.d.ts +0 -4
- package/dist/use-cases/WorkflowRunSyncActivity.usecase.js +0 -28
- package/dist/use-cases/WorkflowRunSyncActivity.usecase.js.map +0 -1
- /package/dist/transport/{DevServerJsonRpc.d.ts → AppProcessJsonRpc.d.ts} +0 -0
|
@@ -1,348 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: framework-dev
|
|
3
|
-
description: >-
|
|
4
|
-
Local development runtime for T4H Framework apps via @t4h.framework/dev:
|
|
5
|
-
DevServer (TypeScript watch, forked app process, JSON-RPC IPC), dev claim
|
|
6
|
-
providers (ORM, HTTP, FS, cache, SMTP, workflow engine), workflow runs, env
|
|
7
|
-
vars, and async activity advancement. Use when implementing or debugging
|
|
8
|
-
framework dev, embedding DevServer, importing @t4h.framework/dev/build for
|
|
9
|
-
tsBuild/tsBuildWatch/upApp, wiring dev claims in tests, isWorkflowWaiting,
|
|
10
|
-
findClaimByConstructor, db.json ORM persistence, or understanding how
|
|
11
|
-
framework dev / framework build work under @t4h.framework/cli.
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
# @t4h.framework/dev
|
|
15
|
-
|
|
16
|
-
Local development runtime for [T4H Framework](https://github.com/tech4humans-brasil/framework) apps. Watches TypeScript, compiles the project, forks a child process that loads the user's `App`, and runs workflows with in-memory or local claim implementations — no external runtime infrastructure.
|
|
17
|
-
|
|
18
|
-
| Import | Purpose |
|
|
19
|
-
|--------|---------|
|
|
20
|
-
| `@t4h.framework/dev` | `DevServer`, `claims`, dev claim classes, `findClaimByConstructor`, `isWorkflowWaiting` |
|
|
21
|
-
| `@t4h.framework/dev/build` | `tsBuild`, `tsBuildWatch`, `upApp`, path resolvers, `mkdirOutDirProjectFromTsConfigPathAndJsonPackagePath` |
|
|
22
|
-
|
|
23
|
-
Node `>=22`. ESM (`"type": "module"`). Authoritative docs: `packages/dev/README.md` and source under `packages/dev/src/`.
|
|
24
|
-
|
|
25
|
-
Interactive CLI (`framework dev`, `framework build`) lives in **`@t4h.framework/cli`** — see `packages/cli/.ai/skills/framework-cli/SKILL.md` for flags and menus. This skill covers the **dev package API and behavior**.
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Architecture
|
|
30
|
-
|
|
31
|
-
```mermaid
|
|
32
|
-
flowchart TB
|
|
33
|
-
subgraph parent ["Parent (DevServer)"]
|
|
34
|
-
Watch["tsBuildWatch"]
|
|
35
|
-
RPCClient["JSON-RPC client"]
|
|
36
|
-
Watch -->|"onSuccess"| Fork
|
|
37
|
-
Fork["fork(app-process)"]
|
|
38
|
-
Fork --> RPCClient
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
subgraph child ["Child (app-process worker)"]
|
|
42
|
-
App["User App via upApp"]
|
|
43
|
-
RPCServer["JSON-RPC server"]
|
|
44
|
-
Claims["claims registry"]
|
|
45
|
-
App --> RPCServer
|
|
46
|
-
Claims --> App
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
RPCClient <-->|"IPC messages"| RPCServer
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
1. **Parent** — `DevServer.start()` resolves paths, creates a temp out dir, starts `tsBuildWatch`.
|
|
53
|
-
2. **On successful compile** — kills prior child, forks `src/workers/app-process.js` with compiled entry URL and `NAME=value` env args.
|
|
54
|
-
3. **Child** — `upApp(entrypoint)` loads `App`, registers RPC handlers from `DevServerJsonRpc`, notifies parent with `manifest`.
|
|
55
|
-
4. **Parent drives** — workflows, env, async advancement via `JSONRPCClient.call(...)`.
|
|
56
|
-
|
|
57
|
-
Rebuild on file change restarts the child (CLI aborts in-flight prompts on manifest reload).
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## App project requirements
|
|
62
|
-
|
|
63
|
-
| Requirement | Detail |
|
|
64
|
-
|-------------|--------|
|
|
65
|
-
| `package.json` `main` | Non-empty string (compiled JS path relative to `dist/`) |
|
|
66
|
-
| `tsconfig.json` | Beside `package.json` (`resolveTsconfigFromPackageJsonPath`) |
|
|
67
|
-
| App export | `default` instance of `App` **or** named `app` (`upApp` throws `App not found` otherwise) |
|
|
68
|
-
| Peer deps | Match app imports: `@t4h.framework/core`, `cache`, `fs`, `http`, `orm`, `smtp`, `runtime-claims` |
|
|
69
|
-
|
|
70
|
-
Typical app script (via CLI):
|
|
71
|
-
|
|
72
|
-
```json
|
|
73
|
-
{
|
|
74
|
-
"main": "main.js",
|
|
75
|
-
"scripts": {
|
|
76
|
-
"dev": "framework dev --env-file-if-exists=.env"
|
|
77
|
-
},
|
|
78
|
-
"devDependencies": {
|
|
79
|
-
"@t4h.framework/cli": "workspace:^"
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Install dev package directly only for **programmatic** embedding:
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
yarn add -D @t4h.framework/dev
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## DevServer (programmatic)
|
|
93
|
-
|
|
94
|
-
```typescript
|
|
95
|
-
import { DevServer } from '@t4h.framework/dev'
|
|
96
|
-
|
|
97
|
-
const devServer = new DevServer(
|
|
98
|
-
{
|
|
99
|
-
entrypoint: './package.json',
|
|
100
|
-
env: { API_KEY: 'secret' },
|
|
101
|
-
},
|
|
102
|
-
manifest => {
|
|
103
|
-
console.log(
|
|
104
|
-
'App loaded:',
|
|
105
|
-
manifest.workflows.map(w => w.id),
|
|
106
|
-
)
|
|
107
|
-
},
|
|
108
|
-
)
|
|
109
|
-
|
|
110
|
-
await devServer.start()
|
|
111
|
-
|
|
112
|
-
const result = await devServer.runWorkflow('my-workflow/v1', {
|
|
113
|
-
userId: '123',
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
await devServer.setEnv('API_KEY', 'new-value')
|
|
117
|
-
const env = await devServer.listEnv()
|
|
118
|
-
|
|
119
|
-
const pending = await devServer.listWaitingAsyncActivities()
|
|
120
|
-
await devServer.advanceAsyncActivity(pending[0].id, { approved: true })
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### `DevServerConfig`
|
|
124
|
-
|
|
125
|
-
| Field | Type | Role |
|
|
126
|
-
|-------|------|------|
|
|
127
|
-
| `entrypoint` | `string` | Path to `package.json` or directory containing it |
|
|
128
|
-
| `env` | `Record<string, string>` | Initial env passed to child as `NAME=value` argv |
|
|
129
|
-
|
|
130
|
-
### Methods
|
|
131
|
-
|
|
132
|
-
| Method | RPC / behavior |
|
|
133
|
-
|--------|----------------|
|
|
134
|
-
| `start()` | Resolve paths, temp out dir, `tsBuildWatch`; fork child on first successful build |
|
|
135
|
-
| `runWorkflow(workflowId, input)` | `workflow.run` |
|
|
136
|
-
| `setEnv(name, value)` | `env.set` |
|
|
137
|
-
| `listEnv()` | `env.list` → `Record<string, string>` |
|
|
138
|
-
| `listWaitingAsyncActivities()` | `workflow.async-activities.waiting.list` |
|
|
139
|
-
| `advanceAsyncActivity(id, payload)` | `workflow.async-activities.advance` |
|
|
140
|
-
|
|
141
|
-
Compile overrides in `DevServer` (same as `framework build`): `outDir: <temp>/dist`, `sourceMap: true`, `declaration: false`.
|
|
142
|
-
|
|
143
|
-
---
|
|
144
|
-
|
|
145
|
-
## Workflow run results
|
|
146
|
-
|
|
147
|
-
`BuildWorkflowRunResultService.build(run)` shapes RPC results:
|
|
148
|
-
|
|
149
|
-
| Run state | Returned value |
|
|
150
|
-
|-----------|----------------|
|
|
151
|
-
| `fulfilled` | `run.output` |
|
|
152
|
-
| `rejected` | `{ error: run.rejectedReason }` |
|
|
153
|
-
| pending async activity | `{ isWaiting: true, id: string }` (activity id) |
|
|
154
|
-
| otherwise | `{ isWaiting: false }` |
|
|
155
|
-
|
|
156
|
-
Detect waiting results in tooling:
|
|
157
|
-
|
|
158
|
-
```typescript
|
|
159
|
-
import { isWorkflowWaiting } from '@t4h.framework/dev'
|
|
160
|
-
|
|
161
|
-
if (isWorkflowWaiting(result)) {
|
|
162
|
-
console.log(`Paused; advance activity id: ${result.id}`)
|
|
163
|
-
}
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
The CLI uses this for the same guidance after **Run workflow**.
|
|
167
|
-
|
|
168
|
-
---
|
|
169
|
-
|
|
170
|
-
## JSON-RPC surface (child handlers)
|
|
171
|
-
|
|
172
|
-
Defined in `src/transport/DevServerJsonRpc.ts`:
|
|
173
|
-
|
|
174
|
-
| Method | Params | Behavior |
|
|
175
|
-
|--------|--------|----------|
|
|
176
|
-
| `workflow.run` | `workflowId`, `input` | Create run, `nextTick`, return built result |
|
|
177
|
-
| `workflow.async-activities.advance` | `id`, `payload` | Advance pending async activity |
|
|
178
|
-
| `workflow.async-activities.waiting.list` | — | Pending activities with `id`, `workflowId`, optional `schema` |
|
|
179
|
-
| `env.set` | `name`, `value` | Update child env `Map` (scoped via `Env.run`) |
|
|
180
|
-
| `env.list` | — | `Object.fromEntries(env)` |
|
|
181
|
-
|
|
182
|
-
Parent receives `manifest` notification from child (`app.toManifest()`, workflow ids default to `:index` when missing).
|
|
183
|
-
|
|
184
|
-
---
|
|
185
|
-
|
|
186
|
-
## Build pipeline (`@t4h.framework/dev/build`)
|
|
187
|
-
|
|
188
|
-
Used by `framework build` and internally by `DevServer`. Mirror imports from `packages/cli/src/commands/build/build.ts`:
|
|
189
|
-
|
|
190
|
-
```typescript
|
|
191
|
-
import path from 'node:path'
|
|
192
|
-
import {
|
|
193
|
-
mkdirOutDirProjectFromTsConfigPathAndJsonPackagePath,
|
|
194
|
-
resolvePackageJsonPath,
|
|
195
|
-
resolveTsconfigFromPackageJsonPath,
|
|
196
|
-
tsBuild,
|
|
197
|
-
upApp,
|
|
198
|
-
} from '@t4h.framework/dev/build'
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
### Steps (`framework build`)
|
|
202
|
-
|
|
203
|
-
1. `resolvePackageJsonPath(entrypoint)` — file or directory; throws if missing.
|
|
204
|
-
2. `resolveTsconfigFromPackageJsonPath` — `<packageDir>/tsconfig.json` must exist.
|
|
205
|
-
3. `mkdirOutDirProjectFromTsConfigPathAndJsonPackagePath` — creates `<tsconfigDir>/.temp/<random>/`, copies `package.json`; may `process.send({ type: 'outDir', data })` when IPC parent exists.
|
|
206
|
-
4. `tsBuild(tsconfigPath, { outDir: join(outDir, 'dist'), sourceMap: true, declaration: false, declarationMap: false })` — returns `{ ok, diagnostics, parsed }`; throw on `!ok`.
|
|
207
|
-
5. `Env.run(env, () => upApp(join(outDir, 'dist', packageJson.main)))` then `app.toManifest()` → `manifest.json` in out dir.
|
|
208
|
-
|
|
209
|
-
### `tsBuild` vs `tsBuildWatch`
|
|
210
|
-
|
|
211
|
-
| Function | Use |
|
|
212
|
-
|----------|-----|
|
|
213
|
-
| `tsBuild` | One-shot compile (`framework build`) |
|
|
214
|
-
| `tsBuildWatch` | Watch mode with `onSuccess`, `onFail`, `onStatus`; returns `{ close() }` watcher |
|
|
215
|
-
|
|
216
|
-
### `upApp(appPath)`
|
|
217
|
-
|
|
218
|
-
```typescript
|
|
219
|
-
const module = await import(appPath)
|
|
220
|
-
if (module.default instanceof App) return module.default
|
|
221
|
-
if (module.app instanceof App) return module.app
|
|
222
|
-
throw new Error('App not found')
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
Tests: `src/tools/__tests__/up-app.spec.ts`.
|
|
226
|
-
|
|
227
|
-
---
|
|
228
|
-
|
|
229
|
-
## Dev claims
|
|
230
|
-
|
|
231
|
-
Registry: `export const claims` in `src/claims.ts` (`ClaimProvider[]` for `App` / `TestWorkflowEnvironment`).
|
|
232
|
-
|
|
233
|
-
```typescript
|
|
234
|
-
import { claims, findClaimByConstructor } from '@t4h.framework/dev'
|
|
235
|
-
import { DevHttpClientRequestClaim } from '@t4h.framework/dev'
|
|
236
|
-
|
|
237
|
-
const httpClaim = findClaimByConstructor(DevHttpClientRequestClaim)
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
| Claim constructor | Dev class | Behavior (from source) |
|
|
241
|
-
|-------------------|-----------|------------------------|
|
|
242
|
-
| `ORMClaim` | `DevORMClaim` | In-memory DB persisted to **`db.json`** in `process.cwd()` |
|
|
243
|
-
| `HttpClientRequestClaim` | `DevHttpClientRequestClaim` | Real HTTP via **`undici`** (`request`, redirects) |
|
|
244
|
-
| `FileSystemClaim` | `DevFileSystemClaim` | Local FS; writes under temp dir; `DevFileBinary` codec |
|
|
245
|
-
| `SmtpSendEmailClaim` | `DevSmtpSendEmailClaim` | **`nodemailer`** transport from `connectionString` URL |
|
|
246
|
-
| `WorkflowClaim` | `DevWorkflowClaim` | Local workflow runs via `WorkflowRunFacade` (nested `startWorkflow`) |
|
|
247
|
-
| `CacheClaim` | `DevCacheClaim` | In-memory `Map` (process lifetime) |
|
|
248
|
-
| `SftpClaim` | `DevSftpClaim` | Real SFTP via **`ssh2-sftp-client`** |
|
|
249
|
-
| `GetActivityUniqueIdentifierClaim` | `DevGetActivityUniqueIdentifierClaim` | Dev identifiers |
|
|
250
|
-
| `GetWorkflowUniqueIdentifierClaim` | `DevGetWorkflowUniqueIdentifierClaim` | Dev identifiers |
|
|
251
|
-
| `GetProjectUniqueIdentifierClaim` | `DevGetProjectUniqueIdentifierClaim` | Dev identifiers |
|
|
252
|
-
| `GetProjectVersionUniqueIdentifierClaim` | `DevGetProjectVersionUniqueIdentifierClaim` | Dev identifiers |
|
|
253
|
-
| `GetProjectVersionWorkflowUniqueIdentifierClaim` | `DevGetProjectVersionWorkflowUniqueIdentifierClaim` | Dev identifiers |
|
|
254
|
-
|
|
255
|
-
Exported claim classes (main entry): see `src/index.ts` — not every registry entry has a dedicated public export; use `claims` or `findClaimByConstructor` for tests.
|
|
256
|
-
|
|
257
|
-
`DevWorkflowClaim.start` requires `workflow.id`; supports parent run context via `RuntimeContextService`.
|
|
258
|
-
|
|
259
|
-
---
|
|
260
|
-
|
|
261
|
-
## Testing with dev claims
|
|
262
|
-
|
|
263
|
-
Prefer `@t4h.framework/core/testing` (`TestWorkflowEnvironment`) with `mockClaim`
|
|
264
|
-
for unit tests (see **framework-workflow-testing**). For integration-style tests
|
|
265
|
-
that need real dev claim behavior, pass the dev `claims` registry and spy on a
|
|
266
|
-
concrete claim:
|
|
267
|
-
|
|
268
|
-
```typescript
|
|
269
|
-
import { claims, DevHttpClientRequestClaim, findClaimByConstructor } from '@t4h.framework/dev'
|
|
270
|
-
import { TestWorkflowEnvironment } from '@t4h.framework/core/testing'
|
|
271
|
-
|
|
272
|
-
const httpClaim = findClaimByConstructor(DevHttpClientRequestClaim)
|
|
273
|
-
vi.spyOn(httpClaim, 'request')
|
|
274
|
-
|
|
275
|
-
const env = TestWorkflowEnvironment.create({ now: 0 })
|
|
276
|
-
await env.execute(MyWorkflow, input, { claims })
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
RPC handler tests: `src/transport/__tests__/DevServerJsonRpc.spec.ts`. Result shaping: `src/services/__tests__/BuildWorkflowRunResult.service.spec.ts`. Async fixtures: `src/__tests__/fixtures.ts` (`TestAsyncActivity` with `pending` / `advance`).
|
|
280
|
-
|
|
281
|
-
---
|
|
282
|
-
|
|
283
|
-
## Package layout (for contributors)
|
|
284
|
-
|
|
285
|
-
```
|
|
286
|
-
packages/dev/src/
|
|
287
|
-
├── DevServer.ts # Parent orchestration
|
|
288
|
-
├── claims.ts # ClaimProvider registry
|
|
289
|
-
├── workers/app-process.ts # Child entry (fork target)
|
|
290
|
-
├── transport/DevServerJsonRpc.ts
|
|
291
|
-
├── tools/ # build, watch, upApp, resolvers
|
|
292
|
-
├── models/claims/ # Dev*Claim implementations
|
|
293
|
-
├── services/ # WorkflowRunFacade, BuildWorkflowRunResult, …
|
|
294
|
-
├── use-cases/ # CreateWorkflowRun, async advance, …
|
|
295
|
-
└── repositories/ # In-memory workflow run stores
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
Develop the package:
|
|
299
|
-
|
|
300
|
-
```bash
|
|
301
|
-
cd packages/dev
|
|
302
|
-
yarn build
|
|
303
|
-
yarn test # vitest
|
|
304
|
-
yarn check-types
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
`vitest.setup.ts` loads `reflect-metadata` (pleroma DI).
|
|
308
|
-
|
|
309
|
-
---
|
|
310
|
-
|
|
311
|
-
## Common mistakes (do not invent APIs)
|
|
312
|
-
|
|
313
|
-
| Mistake | Reality |
|
|
314
|
-
|---------|---------|
|
|
315
|
-
| Export plain object instead of `App` | `upApp` throws `App not found` |
|
|
316
|
-
| Missing `tsconfig.json` next to `package.json` | `resolveTsconfigFromPackageJsonPath` throws |
|
|
317
|
-
| Missing or non-string `package.json` `main` | `DevServer` / build throw |
|
|
318
|
-
| Expecting SMTP captured in memory | `DevSmtpSendEmailClaim` sends via nodemailer using the activity connection string |
|
|
319
|
-
| Expecting mock HTTP in dev | `DevHttpClientRequestClaim` performs real outbound HTTP |
|
|
320
|
-
| ORM data lost between runs | Data lives in **`db.json`** under cwd (deleted only if you remove the file) |
|
|
321
|
-
| Wrong waiting-result shape | Use `isWorkflowWaiting` — checks `isWaiting === true` and string `id` |
|
|
322
|
-
| Import build tools from main entry | Use `@t4h.framework/dev/build` for `tsBuild`, `upApp`, resolvers |
|
|
323
|
-
| Assume all JSON Schema types in CLI prompts | CLI only handles `object`, `string`, `number` (see framework-cli skill) |
|
|
324
|
-
| Add RPC methods without updating both sides | Parent `DevServer` client calls must match child `handlers` in `DevServerJsonRpc.ts` |
|
|
325
|
-
|
|
326
|
-
---
|
|
327
|
-
|
|
328
|
-
## Quick reference
|
|
329
|
-
|
|
330
|
-
```bash
|
|
331
|
-
# Via CLI (requires @t4h.framework/cli)
|
|
332
|
-
framework dev --entrypoint ./package.json -e API_KEY=secret
|
|
333
|
-
framework dev --env-file-if-exists=.env
|
|
334
|
-
framework build --entrypoint ./package.json -e MY_VAR=value
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
```typescript
|
|
338
|
-
// Programmatic dev loop
|
|
339
|
-
import { DevServer, isWorkflowWaiting } from '@t4h.framework/dev'
|
|
340
|
-
|
|
341
|
-
// Build-only tooling
|
|
342
|
-
import { tsBuild, upApp } from '@t4h.framework/dev/build'
|
|
343
|
-
|
|
344
|
-
// Test / custom App wiring
|
|
345
|
-
import { claims, findClaimByConstructor, DevORMClaim } from '@t4h.framework/dev'
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
For CLI menus, publish IPC, and binary relaunch behavior, use **`framework-cli`** skill. For workflow/activity authoring, use **`framework-core`** skill.
|
package/dist/DevServer.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { App } from '@t4h.framework/core';
|
|
2
|
-
export interface DevServerConfig {
|
|
3
|
-
entrypoint: string;
|
|
4
|
-
env: Record<string, string>;
|
|
5
|
-
}
|
|
6
|
-
export declare class DevServer {
|
|
7
|
-
private readonly config;
|
|
8
|
-
private readonly onAppManifest;
|
|
9
|
-
private tsBuildWatcher;
|
|
10
|
-
private packageJsonPath;
|
|
11
|
-
private tsConfigPath;
|
|
12
|
-
private outDir;
|
|
13
|
-
private app;
|
|
14
|
-
private jsonRpcServer;
|
|
15
|
-
private jsonRpcClient;
|
|
16
|
-
constructor(config: DevServerConfig, onAppManifest: (manifest: ReturnType<App['toManifest']>) => void);
|
|
17
|
-
start(): Promise<void>;
|
|
18
|
-
protected onTsBuildSuccess(): Promise<void>;
|
|
19
|
-
runWorkflow(workflowId: string, input: any): Promise<any>;
|
|
20
|
-
setEnv(name: string, value: string): Promise<any>;
|
|
21
|
-
listEnv(): Promise<any>;
|
|
22
|
-
listWaitingAsyncActivities(): Promise<any>;
|
|
23
|
-
advanceAsyncActivity(id: string, payload: unknown): Promise<any>;
|
|
24
|
-
}
|
package/dist/DevServer.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { ChildProcess, fork } from 'node:child_process';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { pathToFileURL } from 'node:url';
|
|
4
|
-
import Type from 'typebox';
|
|
5
|
-
import { JSONRPCClient } from './models/JSONRPCClient.js';
|
|
6
|
-
import { JSONRPCServer, JSONRPCServerMethod } from './models/JSONRPCServer.js';
|
|
7
|
-
import { mkdirOutDirProjectFromTsConfigPathAndJsonPackagePath } from './tools/mkdir-out-dir-project-from-ts-config-path-and-json-package-path.js';
|
|
8
|
-
import { resolvePackageJsonPath } from './tools/resolve-package-json-path.js';
|
|
9
|
-
import { resolveTsconfigFromPackageJsonPath } from './tools/resolve-tsconfig-path-from-package-json-path.js';
|
|
10
|
-
import { tsBuildWatch } from './tools/ts-build-watch.js';
|
|
11
|
-
export class DevServer {
|
|
12
|
-
config;
|
|
13
|
-
onAppManifest;
|
|
14
|
-
tsBuildWatcher;
|
|
15
|
-
packageJsonPath;
|
|
16
|
-
tsConfigPath;
|
|
17
|
-
outDir;
|
|
18
|
-
app;
|
|
19
|
-
jsonRpcServer;
|
|
20
|
-
jsonRpcClient;
|
|
21
|
-
constructor(config, onAppManifest) {
|
|
22
|
-
this.config = config;
|
|
23
|
-
this.onAppManifest = onAppManifest;
|
|
24
|
-
this.jsonRpcServer = new JSONRPCServer([
|
|
25
|
-
new JSONRPCServerMethod('manifest', { schema: [Type.Any()] }, manifest => this.onAppManifest(manifest)),
|
|
26
|
-
], message => {
|
|
27
|
-
this.app?.send(message);
|
|
28
|
-
});
|
|
29
|
-
this.jsonRpcClient = new JSONRPCClient(message => {
|
|
30
|
-
this.app?.send(message);
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
async start() {
|
|
34
|
-
this.packageJsonPath = await resolvePackageJsonPath(this.config.entrypoint);
|
|
35
|
-
this.tsConfigPath = await resolveTsconfigFromPackageJsonPath(this.packageJsonPath);
|
|
36
|
-
this.outDir = await mkdirOutDirProjectFromTsConfigPathAndJsonPackagePath(this.tsConfigPath, this.packageJsonPath);
|
|
37
|
-
this.tsBuildWatcher = tsBuildWatch(this.tsConfigPath, {
|
|
38
|
-
outDir: path.join(this.outDir, 'dist'),
|
|
39
|
-
sourceMap: true,
|
|
40
|
-
declaration: false,
|
|
41
|
-
declarationMap: false,
|
|
42
|
-
}, {
|
|
43
|
-
onSuccess: () => this.onTsBuildSuccess(),
|
|
44
|
-
onFail(diagnostics) {
|
|
45
|
-
console.error('[DevServer] ts build failed:', diagnostics);
|
|
46
|
-
},
|
|
47
|
-
onStatus(status) {
|
|
48
|
-
console.log('[DevServer] ts build status:', status);
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
async onTsBuildSuccess() {
|
|
53
|
-
if (this.app) {
|
|
54
|
-
this.app.kill();
|
|
55
|
-
}
|
|
56
|
-
const { default: packageJson } = await import(this.packageJsonPath, {
|
|
57
|
-
with: { type: 'json' },
|
|
58
|
-
});
|
|
59
|
-
if (typeof packageJson.main !== 'string')
|
|
60
|
-
throw new Error('Main is not a string');
|
|
61
|
-
const entrypoint = pathToFileURL(path.join(this.outDir, 'dist', packageJson.main)).href;
|
|
62
|
-
this.app = fork(path.join(import.meta.dirname, 'workers', 'app-process.js'), [
|
|
63
|
-
entrypoint,
|
|
64
|
-
...Object.entries(this.config.env).map(([name, value]) => `${name}=${value}`),
|
|
65
|
-
], { stdio: ['ignore', 'inherit', 'inherit', 'ipc'] });
|
|
66
|
-
this.app.on('message', message => Promise.all([
|
|
67
|
-
this.jsonRpcServer.handle(message),
|
|
68
|
-
this.jsonRpcClient.handle(message),
|
|
69
|
-
]));
|
|
70
|
-
}
|
|
71
|
-
async runWorkflow(workflowId, input) {
|
|
72
|
-
return await this.jsonRpcClient.call('workflow.run', workflowId, input);
|
|
73
|
-
}
|
|
74
|
-
async setEnv(name, value) {
|
|
75
|
-
return await this.jsonRpcClient.call('env.set', name, value);
|
|
76
|
-
}
|
|
77
|
-
async listEnv() {
|
|
78
|
-
return await this.jsonRpcClient.call('env.list');
|
|
79
|
-
}
|
|
80
|
-
async listWaitingAsyncActivities() {
|
|
81
|
-
return await this.jsonRpcClient.call('workflow.async-activities.waiting.list');
|
|
82
|
-
}
|
|
83
|
-
async advanceAsyncActivity(id, payload) {
|
|
84
|
-
return await this.jsonRpcClient.call('workflow.async-activities.advance', id, payload);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=DevServer.js.map
|
package/dist/DevServer.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DevServer.js","sourceRoot":"","sources":["../src/DevServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAGxC,OAAO,IAAI,MAAM,SAAS,CAAA;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,aA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O,CACR,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import EventEmitter from 'node:events';
|
|
2
|
-
import type { FindOptions } from '@t4h.framework/orm';
|
|
3
|
-
export type Row = Record<string, any> & {
|
|
4
|
-
id: string;
|
|
5
|
-
};
|
|
6
|
-
export declare class InMemoryDatabaseTable extends EventEmitter {
|
|
7
|
-
private readonly rows;
|
|
8
|
-
private _sort;
|
|
9
|
-
find(options: FindOptions<Row>): Row[];
|
|
10
|
-
insert(rows: Omit<Row, 'id'>[]): string[];
|
|
11
|
-
update(where: FindOptions<Row>['where'], row: object): number;
|
|
12
|
-
delete(where: FindOptions<Row>['where']): void;
|
|
13
|
-
toJSON(): Row[];
|
|
14
|
-
}
|
|
15
|
-
export declare class InMemoryDatabase extends EventEmitter {
|
|
16
|
-
private readonly tables;
|
|
17
|
-
constructor(initial?: Record<string, Row[]>);
|
|
18
|
-
table(name: string): InMemoryDatabaseTable;
|
|
19
|
-
toJSON(): Record<string, Row[]>;
|
|
20
|
-
}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import EventEmitter from 'node:events';
|
|
2
|
-
import sift from 'sift';
|
|
3
|
-
import { uuidv7 } from 'uuidv7';
|
|
4
|
-
const { createEqualsOperation } = sift;
|
|
5
|
-
const escapeRegExp = (char) => char.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
6
|
-
const likePatternToRegExp = (pattern, flags) => {
|
|
7
|
-
let source = '';
|
|
8
|
-
for (let index = 0; index < pattern.length; index++) {
|
|
9
|
-
const char = pattern[index];
|
|
10
|
-
if (char === '\\' && index + 1 < pattern.length)
|
|
11
|
-
source += escapeRegExp(pattern[++index]);
|
|
12
|
-
else if (char === '%')
|
|
13
|
-
source += '.*';
|
|
14
|
-
else if (char === '_')
|
|
15
|
-
source += '.';
|
|
16
|
-
else
|
|
17
|
-
source += escapeRegExp(char);
|
|
18
|
-
}
|
|
19
|
-
return new RegExp(`^${source}$`, flags);
|
|
20
|
-
};
|
|
21
|
-
const createLikeOperation = (flags) => (params, ownerQuery, options) => {
|
|
22
|
-
const regExp = likePatternToRegExp(params, flags);
|
|
23
|
-
return createEqualsOperation((value) => typeof value === 'string' && regExp.test(value), ownerQuery, options);
|
|
24
|
-
};
|
|
25
|
-
const operations = {
|
|
26
|
-
$like: createLikeOperation('s'),
|
|
27
|
-
$ilike: createLikeOperation('is'),
|
|
28
|
-
};
|
|
29
|
-
export class InMemoryDatabaseTable extends EventEmitter {
|
|
30
|
-
rows = [];
|
|
31
|
-
_sort(rows, orderBy) {
|
|
32
|
-
const entries = Object.entries(orderBy);
|
|
33
|
-
return rows.toSorted((rowA, rowB) => {
|
|
34
|
-
for (const [key, dir] of entries) {
|
|
35
|
-
const rowAPropertyValue = rowA[key];
|
|
36
|
-
const rowBPropertyValue = rowB[key];
|
|
37
|
-
if (rowAPropertyValue === rowBPropertyValue)
|
|
38
|
-
continue;
|
|
39
|
-
if (rowAPropertyValue == null)
|
|
40
|
-
return dir === 'asc' ? -1 : 1;
|
|
41
|
-
if (rowBPropertyValue == null)
|
|
42
|
-
return dir === 'asc' ? 1 : -1;
|
|
43
|
-
const cmp = rowAPropertyValue < rowBPropertyValue ? -1 : 1;
|
|
44
|
-
return dir === 'asc' ? cmp : -cmp;
|
|
45
|
-
}
|
|
46
|
-
return 0;
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
find(options) {
|
|
50
|
-
// @ts-expect-error: todo
|
|
51
|
-
let rows = this.rows.filter(sift(options.where, { operations }));
|
|
52
|
-
if (options.orderBy)
|
|
53
|
-
rows = this._sort(rows, options.orderBy);
|
|
54
|
-
if (options.offset)
|
|
55
|
-
rows = rows.slice(options.offset);
|
|
56
|
-
if (options.limit)
|
|
57
|
-
rows = rows.slice(0, options.limit);
|
|
58
|
-
return rows;
|
|
59
|
-
}
|
|
60
|
-
insert(rows) {
|
|
61
|
-
const ids = rows.map(row => {
|
|
62
|
-
const id = uuidv7();
|
|
63
|
-
this.rows.push({ id, ...row });
|
|
64
|
-
return id;
|
|
65
|
-
});
|
|
66
|
-
this.emit('change');
|
|
67
|
-
return ids;
|
|
68
|
-
}
|
|
69
|
-
update(where, row) {
|
|
70
|
-
const rows = this.find({ where });
|
|
71
|
-
for (const inMemoryRow of rows)
|
|
72
|
-
this.rows.splice(this.rows.indexOf(inMemoryRow), 1, {
|
|
73
|
-
...inMemoryRow,
|
|
74
|
-
...row,
|
|
75
|
-
});
|
|
76
|
-
this.emit('change');
|
|
77
|
-
return rows.length;
|
|
78
|
-
}
|
|
79
|
-
delete(where) {
|
|
80
|
-
const rows = this.find({ where });
|
|
81
|
-
for (const inMemoryRow of rows)
|
|
82
|
-
this.rows.splice(this.rows.indexOf(inMemoryRow), 1);
|
|
83
|
-
this.emit('change');
|
|
84
|
-
}
|
|
85
|
-
toJSON() {
|
|
86
|
-
return this.rows;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
export class InMemoryDatabase extends EventEmitter {
|
|
90
|
-
tables = new Map();
|
|
91
|
-
constructor(initial = {}) {
|
|
92
|
-
super();
|
|
93
|
-
for (const [name, rows] of Object.entries(initial))
|
|
94
|
-
this.table(name).insert(rows);
|
|
95
|
-
}
|
|
96
|
-
table(name) {
|
|
97
|
-
if (!this.tables.has(name)) {
|
|
98
|
-
const table = new InMemoryDatabaseTable();
|
|
99
|
-
this.tables.set(name, table);
|
|
100
|
-
table.on('change', () => this.emit('change', table));
|
|
101
|
-
}
|
|
102
|
-
return this.tables.get(name);
|
|
103
|
-
}
|
|
104
|
-
toJSON() {
|
|
105
|
-
return Object.fromEntries(Array.from(this.tables.entries()).map(([name, table]) => [
|
|
106
|
-
name,
|
|
107
|
-
table.toJSON(),
|
|
108
|
-
]));
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
//# sourceMappingURL=InMemoryDatabase.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InMemoryDatabase.js","sourceRoot":"","sources":["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AA;IAC/B,CAAC;IAEM,MAAM;QACX,OAAO,MAAM,CAAC,WAAW,CACvB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;YACvD,IAAI;YACJ,KAAK,CAAC,MAAM,EAAE;SACf,CAAC,CACH,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { WorkflowRun } from '../models/WorkflowRun.js';
|
|
2
|
-
import { WorkflowRunActivityRepository } from '../repositories/WorkflowRunActivity.repository.js';
|
|
3
|
-
export declare class BuildWorkflowRunResultService {
|
|
4
|
-
private readonly workflowRunActivityRepository;
|
|
5
|
-
constructor(workflowRunActivityRepository: WorkflowRunActivityRepository);
|
|
6
|
-
build(run: WorkflowRun): unknown;
|
|
7
|
-
private findLastPendingAsyncActivityByRun;
|
|
8
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
8
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
|
-
};
|
|
10
|
-
import { Inject, Injectable } from 'pleroma';
|
|
11
|
-
import { WorkflowRun } from '../models/WorkflowRun.js';
|
|
12
|
-
import { WorkflowRunActivityRepository } from '../repositories/WorkflowRunActivity.repository.js';
|
|
13
|
-
let BuildWorkflowRunResultService = class BuildWorkflowRunResultService {
|
|
14
|
-
workflowRunActivityRepository;
|
|
15
|
-
constructor(workflowRunActivityRepository) {
|
|
16
|
-
this.workflowRunActivityRepository = workflowRunActivityRepository;
|
|
17
|
-
}
|
|
18
|
-
build(run) {
|
|
19
|
-
if (run.status === 'fulfilled')
|
|
20
|
-
return run.output;
|
|
21
|
-
if (run.status === 'rejected')
|
|
22
|
-
return { error: run.rejectedReason };
|
|
23
|
-
const pending = this.findLastPendingAsyncActivityByRun(run);
|
|
24
|
-
if (pending)
|
|
25
|
-
return { isWaiting: true, id: pending.asyncActivity.activity.id };
|
|
26
|
-
return { isWaiting: false };
|
|
27
|
-
}
|
|
28
|
-
findLastPendingAsyncActivityByRun(run) {
|
|
29
|
-
const activities = this.workflowRunActivityRepository
|
|
30
|
-
.findByRunId(run.id)
|
|
31
|
-
.filter(activity => activity.asyncActivity);
|
|
32
|
-
for (const activity of activities.reverse()) {
|
|
33
|
-
if (!activity.asyncActivity)
|
|
34
|
-
continue;
|
|
35
|
-
const pending = activity.asyncActivity.lastPendingAsyncActivity;
|
|
36
|
-
if (!pending)
|
|
37
|
-
continue;
|
|
38
|
-
if (pending.status !== 'pending')
|
|
39
|
-
continue;
|
|
40
|
-
return pending;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
BuildWorkflowRunResultService = __decorate([
|
|
45
|
-
Injectable(),
|
|
46
|
-
__param(0, Inject(() => WorkflowRunActivityRepository))
|
|
47
|
-
], BuildWorkflowRunResultService);
|
|
48
|
-
export { BuildWorkflowRunResultService };
|
|
49
|
-
//# sourceMappingURL=BuildWorkflowRunResult.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BuildWorkflowRunResult.service.js","sourceRoot":"","sources":["../../src/services/BuildWorkflowRunResult.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EA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