@adonis-agora/durable 0.38.3 → 0.39.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/assets/spa/assets/index-Db-HnE3R.js +16 -0
  3. package/dist/assets/spa/assets/index-Db-HnE3R.js.map +1 -0
  4. package/dist/assets/spa/index.html +1 -1
  5. package/dist/src/commands/runs.d.ts +4 -1
  6. package/dist/src/commands/runs.d.ts.map +1 -1
  7. package/dist/src/commands/runs.js +1 -1
  8. package/dist/src/commands/runs.js.map +1 -1
  9. package/dist/src/dashboard/handlers.d.ts +14 -1
  10. package/dist/src/dashboard/handlers.d.ts.map +1 -1
  11. package/dist/src/dashboard/handlers.js +21 -7
  12. package/dist/src/dashboard/handlers.js.map +1 -1
  13. package/dist/src/dashboard/index.d.ts +1 -1
  14. package/dist/src/dashboard/index.js +1 -1
  15. package/dist/src/dashboard/openapi.d.ts.map +1 -1
  16. package/dist/src/dashboard/openapi.js +7 -3
  17. package/dist/src/dashboard/openapi.js.map +1 -1
  18. package/dist/src/engine.d.ts +1 -1
  19. package/dist/src/engine.d.ts.map +1 -1
  20. package/dist/src/engine.js +4 -4
  21. package/dist/src/engine.js.map +1 -1
  22. package/dist/src/index.d.ts +2 -1
  23. package/dist/src/index.d.ts.map +1 -1
  24. package/dist/src/index.js +2 -1
  25. package/dist/src/index.js.map +1 -1
  26. package/dist/src/interfaces.d.ts +19 -3
  27. package/dist/src/interfaces.d.ts.map +1 -1
  28. package/dist/src/run-gateway/interface.d.ts +1 -1
  29. package/dist/src/run-pagination.d.ts +31 -0
  30. package/dist/src/run-pagination.d.ts.map +1 -0
  31. package/dist/src/run-pagination.js +24 -0
  32. package/dist/src/run-pagination.js.map +1 -0
  33. package/dist/src/run-value-facets.js +1 -1
  34. package/dist/src/run-value-facets.js.map +1 -1
  35. package/dist/src/search-attributes.d.ts +4 -4
  36. package/dist/src/search-attributes.d.ts.map +1 -1
  37. package/dist/src/search-attributes.js +7 -7
  38. package/dist/src/search-attributes.js.map +1 -1
  39. package/dist/src/stores/lucid.d.ts.map +1 -1
  40. package/dist/src/stores/lucid.js +8 -4
  41. package/dist/src/stores/lucid.js.map +1 -1
  42. package/dist/src/telescope/data-providers.js +4 -4
  43. package/dist/src/telescope/data-providers.js.map +1 -1
  44. package/dist/src/testing/in-memory-state-store.d.ts.map +1 -1
  45. package/dist/src/testing/in-memory-state-store.js +6 -3
  46. package/dist/src/testing/in-memory-state-store.js.map +1 -1
  47. package/dist/src/testing-kit/state-store-conformance.d.ts.map +1 -1
  48. package/dist/src/testing-kit/state-store-conformance.js +8 -7
  49. package/dist/src/testing-kit/state-store-conformance.js.map +1 -1
  50. package/package.json +11 -11
  51. package/dist/assets/spa/assets/index-Dx5lG7Vu.js +0 -16
  52. package/dist/assets/spa/assets/index-Dx5lG7Vu.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,62 @@
1
1
  # @adonis-agora/durable
2
2
 
3
+ ## 0.39.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#140](https://github.com/DavideCarvalho/adonis-agora-durable/pull/140) [`5c57004`](https://github.com/DavideCarvalho/adonis-agora-durable/commit/5c570047165530c6b7bbe4c868d747e4405da49d) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - **Breaking:** run listings are paged with `page`/`size` instead of `limit`/`offset`, and paging is now 1-BASED.
8
+
9
+ Every `@adonis-agora/*` library now exposes the same offset-pagination interface as `@adonis-agora/filter` (`FilterInput.page`/`.size`, resolved to its `ResolvedPagination { page, size }`): a **1-based** page number defaulting to `1`, and a page size. One query-string builder, one mental model, whether the listing behind it is a Lucid model or this engine's run store. Defaults and caps are unchanged — the dashboard listing still defaults to 50 rows and still caps at 200; only the spelling and the base moved.
10
+
11
+ The 0-based offset has not disappeared, it has become internal: `runPageWindow(query)` (newly exported) resolves a `RunQuery`'s `page`/`size` into the `{ limit, offset }` a store actually spends, and it is the one place that arithmetic lives. Custom `StateStore` implementations should call it rather than compute an offset by hand; the conformance kit asserts the resulting semantics (notably that **no `size` means no bound** — a store must not invent a default window).
12
+
13
+ What changed, concretely:
14
+
15
+ - `RunQuery.limit`/`.offset` → `RunQuery.page`/`.size`. This is also the cross-pod wire shape, so a `listRuns` gateway request between a proxy pod and a store pod carries `size` where it carried `limit` (the golden wire fixtures moved with it — polyglot SDKs asserting those bytes need the same rename).
16
+ - `GET /durable/api/runs` parses `?page=&size=` and answers `{ runs, meta: { page, size, count }, statuses }`. The pagination envelope key is **`meta`** — the name AdonisJS/Lucid's own `.paginate()` uses, and where `@adonis-agora/filter`'s offset path lands, so every `@adonis-agora/*` listing spells it the same (it also spares you `body.page.page`). It replaces the previous `limit`/`offset` echo; read the window off `body.meta`. `limit`/`offset` query params are now ignored like any other unknown flat param, so a stale client gets an unpaged first page rather than a `400`.
17
+ - The console's client (`durableClient.runsPage`, `RunPageOptions`, `runQueryString`) sends `page`/`size` and pages the runs list 1-based; `RunsPage` carries that window as `.meta`.
18
+
19
+ Deliberately NOT renamed: `GET /durable/api/runs/values` keeps `limit`/`offset`. That endpoint is filter's own group-by-count aggregation (`groupByCount[limit]`/`groupByCount[offset]`, `GroupByCountFromRequestOptions`), not a run listing — `limit`/`offset` IS the aligned spelling there, and respelling it would diverge from the lib rather than match it. The ace `durable:runs --limit` flag also keeps its name: it is a row cap with no page companion, and it maps to `size` internally.
20
+
21
+ Migration — the offset you were sending is `(page - 1) * size`:
22
+
23
+ ```ts
24
+ // before
25
+ await engine.listRuns({ workflow: 'checkout', limit: 25, offset: 50 })
26
+ // after — third page of 25
27
+ await engine.listRuns({ workflow: 'checkout', page: 3, size: 25 })
28
+ ```
29
+
30
+ ```
31
+ # before
32
+ GET /durable/api/runs?status=failed&limit=25&offset=50
33
+ # after
34
+ GET /durable/api/runs?status=failed&page=3&size=25
35
+ ```
36
+
37
+ ```ts
38
+ // reading the window back off a /runs response
39
+ - const { limit, offset } = body.page
40
+ + const { page, size, count } = body.meta
41
+ ```
42
+
43
+ ```ts
44
+ // a store adapter's listRuns
45
+ - if (query.limit !== undefined) q.limit(query.limit)
46
+ - if (query.offset !== undefined) q.offset(query.offset)
47
+ + const { limit, offset } = runPageWindow(query)
48
+ + if (limit !== undefined) q.limit(limit)
49
+ + if (offset > 0) q.offset(offset)
50
+ ```
51
+
52
+ ### Patch Changes
53
+
54
+ - [#138](https://github.com/DavideCarvalho/adonis-agora-durable/pull/138) [`4916be2`](https://github.com/DavideCarvalho/adonis-agora-durable/commit/4916be2b7129d6bceba2e7d2fc9c302b00d2c283) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Routine dependency refresh.
55
+
56
+ `@adonis-agora/durable`'s optional `vitest` peer now accepts `^5.0.0` too (`^3.0.0 || ^4.0.0 || ^5.0.0`). The testing kit is exercised against vitest 5 in CI and the range only widens, so nothing that resolved before stops resolving. The package's stale `zod` devDependency (`3.25.76`) is realigned with the `zod@4.5.4` it already declares — and pnpm already resolved — as a runtime dependency; no published dependency range changes.
57
+
58
+ `@adonis-agora/durable-eslint-plugin` picks up `@typescript-eslint/utils@8.69.0`.
59
+
3
60
  ## 0.38.3
4
61
 
5
62
  ### Patch Changes