@chidchanun/bcp 0.2.8 → 0.2.10
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 +164 -163
- package/docs/README.md +48 -139
- package/docs/api-manifest.json +4 -2
- package/docs/api-reference.md +92 -242
- package/docs/docs-web-manifest.json +7 -3
- package/docs/durable-jobs.md +359 -0
- package/docs/job-scheduling.md +357 -0
- package/docs/platform-manifest.json +23 -4
- package/docs/releases/0.2.10.md +148 -0
- package/docs/releases/0.2.9.md +162 -0
- package/package.json +2 -2
- package/packages/client/src/jobs.mjs +2289 -0
- package/packages/client/src/jobs.ts +34 -0
- package/packages/server/src/job-scheduler.ts +1144 -0
- package/packages/server/src/jobs-redis.ts +1226 -0
- package/packages/server/src/jobs.ts +768 -128
package/docs/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The `docs/` directory is the documentation source of truth for BCP Framework and is organized for **`bcp-docs-web`**.
|
|
4
4
|
|
|
5
|
-
> **Documentation target:** BCP Framework `0.2.
|
|
5
|
+
> **Documentation target:** BCP Framework `0.2.10 — Durable Jobs Platform`
|
|
6
6
|
>
|
|
7
7
|
> **Release state:** unreleased development target until RC validation, tagging and npm publication complete.
|
|
8
8
|
|
|
@@ -21,24 +21,6 @@ docs/api-manifest.json
|
|
|
21
21
|
-> public package entrypoints, source ownership and guide mapping
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Markdown files under `docs/` remain the authored documentation content.
|
|
25
|
-
|
|
26
|
-
Recommended flow:
|
|
27
|
-
|
|
28
|
-
```text
|
|
29
|
-
framework source/tests
|
|
30
|
-
↓
|
|
31
|
-
docs/
|
|
32
|
-
├─ Markdown content
|
|
33
|
-
├─ docs-web-manifest.json
|
|
34
|
-
├─ platform-manifest.json
|
|
35
|
-
└─ api-manifest.json
|
|
36
|
-
↓
|
|
37
|
-
manifest-driven sync
|
|
38
|
-
↓
|
|
39
|
-
bcp-docs-web
|
|
40
|
-
```
|
|
41
|
-
|
|
42
24
|
Framework source and tests remain authoritative for runtime behavior.
|
|
43
25
|
|
|
44
26
|
## Current 0.2.x milestones
|
|
@@ -54,49 +36,58 @@ Framework source and tests remain authoritative for runtime behavior.
|
|
|
54
36
|
| `0.2.6` | Authorization & Security v2 |
|
|
55
37
|
| `0.2.7` | Observability Platform v2 |
|
|
56
38
|
| `0.2.8` | Background Jobs Platform |
|
|
39
|
+
| `0.2.9` | Job Scheduling Platform |
|
|
40
|
+
| `0.2.10` | Durable Jobs Platform |
|
|
57
41
|
|
|
58
|
-
## 0.2.
|
|
42
|
+
## 0.2.10 — Durable Jobs Platform
|
|
59
43
|
|
|
60
|
-
`0.2.
|
|
44
|
+
`0.2.10` makes the queue/scheduler contracts production-oriented without changing the `bcp/jobs` public entrypoint.
|
|
61
45
|
|
|
62
46
|
New/updated documentation sources:
|
|
63
47
|
|
|
64
48
|
| Source | Purpose |
|
|
65
49
|
| --- | --- |
|
|
66
|
-
| `background-jobs.md` |
|
|
67
|
-
| `
|
|
68
|
-
| `
|
|
50
|
+
| `background-jobs.md` | Base queue/worker contract |
|
|
51
|
+
| `job-scheduling.md` | Interval/cron schedules and scheduler leases |
|
|
52
|
+
| `durable-jobs.md` | Visibility leases, heartbeat recovery, DLQ, retention, statistics and Redis adapters |
|
|
53
|
+
| `api-reference.md` | Current `bcp/jobs` public APIs |
|
|
54
|
+
| `platform-manifest.json` | Durable Jobs capability flags |
|
|
69
55
|
| `api-manifest.json` | `bcp/jobs` guide ownership |
|
|
70
|
-
| `docs-web-manifest.json` |
|
|
71
|
-
| `releases/0.2.
|
|
56
|
+
| `docs-web-manifest.json` | Durable Jobs navigation and `0.2.10` release route |
|
|
57
|
+
| `releases/0.2.10.md` | Durable Jobs Platform release notes |
|
|
72
58
|
|
|
73
|
-
Primary APIs:
|
|
59
|
+
Primary durable APIs:
|
|
74
60
|
|
|
75
61
|
```ts
|
|
76
62
|
import {
|
|
77
63
|
createJobQueue,
|
|
78
|
-
|
|
64
|
+
createRedisJobQueueAdapter,
|
|
65
|
+
createRedisJobScheduleStore,
|
|
79
66
|
} from "bcp/jobs";
|
|
80
67
|
```
|
|
81
68
|
|
|
82
69
|
Runtime model:
|
|
83
70
|
|
|
84
71
|
```text
|
|
85
|
-
web/API/action
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
72
|
+
web / API / action
|
|
73
|
+
|
|
|
74
|
+
v
|
|
75
|
+
shared JobQueueAdapter
|
|
76
|
+
|
|
|
77
|
+
+--> visibility lease + heartbeat
|
|
78
|
+
+--> retry / stale recovery
|
|
79
|
+
+--> DLQ / requeue
|
|
80
|
+
|
|
|
81
|
+
v
|
|
82
|
+
worker processes
|
|
83
|
+
|
|
84
|
+
scheduler processes
|
|
85
|
+
|
|
|
86
|
+
v
|
|
87
|
+
shared JobScheduleStore lease
|
|
97
88
|
```
|
|
98
89
|
|
|
99
|
-
|
|
90
|
+
BCP does not bundle a Redis client library. Redis connection creation and shutdown remain application-owned through the minimal `RedisCommandClient` contract and optional close hook.
|
|
100
91
|
|
|
101
92
|
## Update rule
|
|
102
93
|
|
|
@@ -113,23 +104,6 @@ When framework behavior or public surface changes:
|
|
|
113
104
|
|
|
114
105
|
## Docs-web navigation
|
|
115
106
|
|
|
116
|
-
`docs/docs-web-manifest.json` is the authoritative ordered navigation contract.
|
|
117
|
-
|
|
118
|
-
Current sections:
|
|
119
|
-
|
|
120
|
-
```text
|
|
121
|
-
Getting Started
|
|
122
|
-
Routing & Data
|
|
123
|
-
Authentication & Authorization
|
|
124
|
-
Database
|
|
125
|
-
Runtime & Infrastructure
|
|
126
|
-
Storage & Uploads
|
|
127
|
-
Developer Experience
|
|
128
|
-
Platform & Compatibility
|
|
129
|
-
API Reference
|
|
130
|
-
Releases
|
|
131
|
-
```
|
|
132
|
-
|
|
133
107
|
Important current routes:
|
|
134
108
|
|
|
135
109
|
| Website route | Markdown source |
|
|
@@ -138,40 +112,18 @@ Important current routes:
|
|
|
138
112
|
| `/docs/authorization-security` | `authorization-security.md` |
|
|
139
113
|
| `/docs/observability` | `observability.md` |
|
|
140
114
|
| `/docs/background-jobs` | `background-jobs.md` |
|
|
141
|
-
| `/docs/
|
|
115
|
+
| `/docs/job-scheduling` | `job-scheduling.md` |
|
|
116
|
+
| `/docs/durable-jobs` | `durable-jobs.md` |
|
|
142
117
|
| `/docs/application-packaging` | `application-packaging.md` |
|
|
143
118
|
| `/docs/database` | `database.md` |
|
|
144
119
|
| `/docs/api-reference` | `api-reference.md` |
|
|
145
|
-
| `/releases/0.2.
|
|
120
|
+
| `/releases/0.2.10` | `releases/0.2.10.md` |
|
|
146
121
|
|
|
147
122
|
Every route/source pair is validated by unit tests.
|
|
148
123
|
|
|
149
|
-
##
|
|
150
|
-
|
|
151
|
-
`docs/platform-manifest.json` describes:
|
|
152
|
-
|
|
153
|
-
```text
|
|
154
|
-
framework version/release state
|
|
155
|
-
Node/React/runtime baseline
|
|
156
|
-
production build/package target
|
|
157
|
-
public package entrypoints
|
|
158
|
-
CLI command families
|
|
159
|
-
capability flags
|
|
160
|
-
previous-baseline compatibility intent
|
|
161
|
-
documentation contract files
|
|
162
|
-
```
|
|
124
|
+
## Public entrypoints
|
|
163
125
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
```text
|
|
167
|
-
standalone-node
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
## API manifest
|
|
171
|
-
|
|
172
|
-
`docs/api-manifest.json` describes public package entrypoints documentation tooling may present as supported APIs.
|
|
173
|
-
|
|
174
|
-
Current entrypoints:
|
|
126
|
+
Current documented entrypoints:
|
|
175
127
|
|
|
176
128
|
```text
|
|
177
129
|
bcp
|
|
@@ -191,39 +143,9 @@ bcp/middleware
|
|
|
191
143
|
|
|
192
144
|
The API-manifest entrypoint set must match the platform public-entrypoint set exactly.
|
|
193
145
|
|
|
194
|
-
## bcp-docs-web synchronization
|
|
195
|
-
|
|
196
|
-
The docs website sync loads the manifests before Markdown content:
|
|
197
|
-
|
|
198
|
-
```text
|
|
199
|
-
selected framework ref
|
|
200
|
-
↓
|
|
201
|
-
docs-web-manifest.json
|
|
202
|
-
platform-manifest.json
|
|
203
|
-
api-manifest.json
|
|
204
|
-
↓
|
|
205
|
-
validate version/release/API parity
|
|
206
|
-
↓
|
|
207
|
-
load referenced Markdown
|
|
208
|
-
↓
|
|
209
|
-
synchronize CMS/search/navigation
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
## Source conventions
|
|
213
|
-
|
|
214
|
-
- one H1 per Markdown page,
|
|
215
|
-
- stable heading hierarchy,
|
|
216
|
-
- fenced code blocks with language tags,
|
|
217
|
-
- relative links between docs,
|
|
218
|
-
- exact public API names,
|
|
219
|
-
- clear stable/RC/roadmap labels,
|
|
220
|
-
- security limitations next to affected APIs,
|
|
221
|
-
- no framework-internal module presented as public API,
|
|
222
|
-
- no secrets/runtime `.env` values in public documentation metadata.
|
|
223
|
-
|
|
224
146
|
## Release validation
|
|
225
147
|
|
|
226
|
-
Before publishing `0.2.
|
|
148
|
+
Before publishing `0.2.10`:
|
|
227
149
|
|
|
228
150
|
```bash
|
|
229
151
|
npm run typecheck
|
|
@@ -234,33 +156,20 @@ npm run test:e2e
|
|
|
234
156
|
npm run rc:check
|
|
235
157
|
```
|
|
236
158
|
|
|
237
|
-
|
|
159
|
+
Durable Jobs Platform validation covers:
|
|
238
160
|
|
|
239
|
-
-
|
|
240
|
-
-
|
|
241
|
-
-
|
|
242
|
-
-
|
|
243
|
-
-
|
|
244
|
-
-
|
|
245
|
-
-
|
|
246
|
-
-
|
|
161
|
+
- worker visibility leases and heartbeat renewal,
|
|
162
|
+
- stale-running recovery,
|
|
163
|
+
- retry exhaustion and DLQ indexing,
|
|
164
|
+
- dead-letter requeue,
|
|
165
|
+
- queue statistics,
|
|
166
|
+
- terminal retention cleanup,
|
|
167
|
+
- Redis queue and schedule adapter command contracts,
|
|
168
|
+
- compiled `bcp/jobs` runtime imports,
|
|
247
169
|
- docs/platform/API version parity.
|
|
248
170
|
|
|
249
171
|
The final release tag must point to the exact commit that passed the complete RC sequence.
|
|
250
172
|
|
|
251
173
|
## Repository authority
|
|
252
174
|
|
|
253
|
-
The framework repository remains authoritative for
|
|
254
|
-
|
|
255
|
-
```text
|
|
256
|
-
source
|
|
257
|
-
public exports
|
|
258
|
-
tests
|
|
259
|
-
Markdown docs
|
|
260
|
-
docs-web manifest
|
|
261
|
-
platform manifest
|
|
262
|
-
API manifest
|
|
263
|
-
release notes
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
`bcp-docs-web` remains the presentation/search/navigation layer for this content.
|
|
175
|
+
The framework repository remains authoritative for source, public exports, tests, Markdown docs, manifests and release notes. `bcp-docs-web` remains the presentation/search/navigation layer.
|
package/docs/api-manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"framework": "bcp",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.10",
|
|
5
5
|
"releaseState": "unreleased",
|
|
6
6
|
"coverage": "public-entrypoints",
|
|
7
7
|
"entrypoints": [
|
|
@@ -99,9 +99,11 @@
|
|
|
99
99
|
"source": "packages/client/src/jobs.ts",
|
|
100
100
|
"environment": "server",
|
|
101
101
|
"route": "/docs/api-reference#bcp-jobs",
|
|
102
|
-
"summary": "Background
|
|
102
|
+
"summary": "Background queues and schedules with visibility leases, heartbeats, stale recovery, DLQ maintenance and Redis-compatible durable adapters.",
|
|
103
103
|
"guides": [
|
|
104
104
|
"/docs/background-jobs",
|
|
105
|
+
"/docs/job-scheduling",
|
|
106
|
+
"/docs/durable-jobs",
|
|
105
107
|
"/docs/observability"
|
|
106
108
|
]
|
|
107
109
|
},
|