@abyss-project/commons-front-core 20.3.0 → 20.5.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 (49) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/catalog/captures-plan.ts +10 -2
  3. package/catalog/pages/DeliveryHistory.tsx +142 -142
  4. package/catalog/pages/DeliverySubscriptions.tsx +50 -2
  5. package/catalog/pages/ScheduledTasks.tsx +116 -2
  6. package/catalog/specs/captures.spec.ts +156 -145
  7. package/catalog/specs/write-capture-index.ts +82 -81
  8. package/dist/{CookieConsentSettings-BPBNaNNI.js → CookieConsentSettings-BBfIxpPu.js} +1 -1
  9. package/dist/{Surface-DmHRzUtQ.js → Surface-D3XLL_3t.js} +172 -44
  10. package/dist/{Tabs-CxBeR0D-.js → Tabs-B9vRDAXt.js} +1 -1
  11. package/dist/components/business/Deliveries/DeliverySubscriptionForm.d.ts +7 -2
  12. package/dist/components/business/Deliveries/ScheduledTaskForm.d.ts +8 -2
  13. package/dist/components/business/Deliveries/ScheduledTaskPanel.d.ts +30 -0
  14. package/dist/components/business/Deliveries/ScheduledTasks.component.d.ts +3 -2
  15. package/dist/components/business/Deliveries/deliveries.logic.d.ts +36 -1
  16. package/dist/components/business/Deliveries/deliveries.types.d.ts +95 -3
  17. package/dist/components/business/Deliveries/test-support/deliveries.fixtures.d.ts +2 -1
  18. package/dist/cookie-consent.js +2 -2
  19. package/dist/{design-theme-HWymeGb7.js → design-theme-enTIAR9e.js} +877 -872
  20. package/dist/{editors-BmRsTu0H.js → editors-C9ezTyVX.js} +27 -27
  21. package/dist/editors.js +1 -1
  22. package/dist/hooks/use-rich-intl.hook.d.ts +136 -16
  23. package/dist/{index-Dco3zEwV.js → index-1hcOcpTI.js} +2 -2
  24. package/dist/{index-RjzeFVe-.js → index-B1LrM7Gs.js} +2 -2
  25. package/dist/{index-ZL-d1iKb.js → index-BKCtYW42.js} +2 -2
  26. package/dist/{index-ClEFydIA.js → index-BRNbXIRg.js} +2 -2
  27. package/dist/{index-DnweGlM_.js → index-BmWT-YnY.js} +2 -2
  28. package/dist/{index-DYdLhNjl.js → index-C1-1xoEz.js} +3 -3
  29. package/dist/{index-BTwuilx5.js → index-C21JZxdV.js} +3 -3
  30. package/dist/{index-BwugEq4x.js → index-COZaHoYW.js} +2 -2
  31. package/dist/{index-DLIvsZA_.js → index-CYPRhUy3.js} +2 -2
  32. package/dist/{index-ChCpWPzk.js → index-CuHChI1V.js} +4 -4
  33. package/dist/{index-Buo7Iim6.js → index-D23exlxA.js} +4 -4
  34. package/dist/{index-BGAmhhJZ.js → index-DTDA_bq_.js} +2 -2
  35. package/dist/{index-Cv8TWKKk.js → index-DYlHW9pm.js} +2 -2
  36. package/dist/{index-CsZJyqSF.js → index-DilASatl.js} +2 -2
  37. package/dist/{index-CSl9Kc0V.js → index-DpLOnTAQ.js} +2 -2
  38. package/dist/{index-CJjWI7qL.js → index-DrEPqLmj.js} +3 -3
  39. package/dist/{index-DsxBk5OJ.js → index-PIhlmbry.js} +1 -1
  40. package/dist/{index-CI0SMeOa.js → index-av4SSfbk.js} +2 -2
  41. package/dist/{index-DVyE9B4I.js → index-grnEwsvE.js} +2 -2
  42. package/dist/{index-DuLb3GSj.js → index-jXwg-vPK.js} +4 -4
  43. package/dist/{index-BAH9H4GE.js → index-owJAgGXX.js} +3 -3
  44. package/dist/index.js +10613 -10268
  45. package/dist/legacy.js +745 -750
  46. package/dist/translations/en.d.ts +64 -0
  47. package/dist/translations/fr.d.ts +64 -0
  48. package/package.json +5 -5
  49. package/test-results/catalog/.last-run.json +4 -0
@@ -1,4 +1,5 @@
1
- import { BasePaginate, DeliveryEventType, FlowDeliverySource, ICreateDeliverySubscriptionBody, ICreateScheduledTaskBody, ICreateRehydrationBody, ICreateRehydrationData, IDelivery, IDeliverySubscription, IEstimateRehydrationData, IEstimateRehydrationQuery, IArchivedDay, IListRehydrationData, IPurgeArchiveBody, IPurgeArchiveData, IRehydrationJob, IPaginateDeliveryQuery, IPaginateDeliverySubscriptionQuery, IPaginateScheduledTaskQuery, IPaginateScheduledTaskRunQuery, IScheduledTask, IScheduledTaskRun, IUpdateDeliverySubscriptionBody, IUpdateScheduledTaskBody } from '@abyss-project/flow';
1
+ import { ReactNode } from 'react';
2
+ import { BasePaginate, DeliveryEventType, FlowDeliverySource, ICreateDeliverySubscriptionBody, ICreateScheduledTaskBody, ICreateRehydrationBody, ICreateRehydrationData, IDelivery, IDeliverySubscription, IEstimateRehydrationData, IEstimateRehydrationQuery, IArchivedDay, IListRehydrationData, IPurgeArchiveBody, IPurgeArchiveData, IRehydrationJob, IPaginateDeliveryQuery, IPaginateDeliverySubscriptionQuery, IPaginateScheduledTaskQuery, IPaginateScheduledTaskRunQuery, IScheduledTask, IScheduledTaskRun, IUpdateDeliverySubscriptionBody, IUpdateScheduledTaskBody, ScheduledTaskIncidentPolicy } from '@abyss-project/flow';
2
3
  /**
3
4
  * The Deliveries components are data-agnostic: every datum and every action goes through a prop
4
5
  * that returns a promise, so each service front binds its own Flow SDK calls (scope included) and
@@ -26,6 +27,41 @@ export interface ScheduledTaskWithSecret {
26
27
  scheduledTask: IScheduledTask;
27
28
  secret: string;
28
29
  }
30
+ /** The `filters` of a subscription as Flow stores them: blocks keyed by kind, or none. */
31
+ export type DeliverySubscriptionFilters = IDeliverySubscription['filters'];
32
+ /** What the host's filters editor receives, inside the create and edit drawer. */
33
+ export interface DeliveryFiltersSlotProps {
34
+ /** The source chosen in the form: a change of source empties the filters. */
35
+ source: FlowDeliverySource;
36
+ /**
37
+ * The event types ticked in the form. A block of filters requires its event type (Flow refuses
38
+ * it otherwise): the editor drops or hides a block whose type is no longer ticked.
39
+ */
40
+ eventTypes: DeliveryEventType[];
41
+ /** The filters being edited: those of the subscription, `null` at creation. */
42
+ value: DeliverySubscriptionFilters;
43
+ onChange(next: DeliverySubscriptionFilters): void;
44
+ /** The subscription edited; `null` at creation. */
45
+ subscription: IDeliverySubscription | null;
46
+ }
47
+ /**
48
+ * The host's own page header, for a host that names the page itself (its title, its breadcrumb):
49
+ * the component then draws no header of its own and portals its primary action (the create
50
+ * button, drawn only with the right to create) into `actions`, an element of the host's header.
51
+ * `null` while that element is not mounted yet: the action appears once it is.
52
+ */
53
+ export interface DeliveryHostHeader {
54
+ actions: HTMLElement | null;
55
+ }
56
+ /**
57
+ * The host's own page header, for a `DeliveryHistory` whose page the host names itself: no header
58
+ * of the component's own, and the subscription it lists (`getSubscription`: its URL and its
59
+ * events) is portalled into `subtitle`, an element of the host's header. `null` while that element
60
+ * is not mounted yet.
61
+ */
62
+ export interface DeliveryHistoryHostHeader {
63
+ subtitle: HTMLElement | null;
64
+ }
29
65
  export interface DeliverySubscriptionsProps {
30
66
  /** The sources the host may subscribe to (the form offers these only). */
31
67
  sources: FlowDeliverySource[];
@@ -43,6 +79,15 @@ export interface DeliverySubscriptionsProps {
43
79
  */
44
80
  flowUrl?: string;
45
81
  permissions: DeliverySubscriptionPermissions;
82
+ /**
83
+ * The filters editor of the host, drawn in the form under the event types. With it, the creation
84
+ * and the update send `filters` (what it holds, `null` for none: an update replaces the
85
+ * filters, never merges them); without it, `filters` is never sent and an update keeps the
86
+ * subscription's own.
87
+ */
88
+ renderFilters?(props: DeliveryFiltersSlotProps): ReactNode;
89
+ /** The host's page header that takes the place of the component's (see `DeliveryHostHeader`). */
90
+ hostHeader?: DeliveryHostHeader;
46
91
  }
47
92
  /**
48
93
  * The archive of one subscription's history, past the 30 days where a delivery keeps its body:
@@ -86,6 +131,19 @@ export interface DeliveryHistoryProps {
86
131
  getSubscription?(): Promise<IDeliverySubscription>;
87
132
  /** Where « Ouvrir dans Flow » leads; without it, no link is drawn. */
88
133
  flowUrl?: string;
134
+ /**
135
+ * The host's page header that takes the place of the component's (see
136
+ * `DeliveryHistoryHostHeader`).
137
+ */
138
+ hostHeader?: DeliveryHistoryHostHeader;
139
+ }
140
+ /** What the host's incident-policy editor receives, inside the create and edit drawer. */
141
+ export interface ScheduledTaskIncidentPolicySlotProps {
142
+ /** The policy being edited: the task's, `null` at creation or for a task without one. */
143
+ value: ScheduledTaskIncidentPolicy | null;
144
+ onChange(next: ScheduledTaskIncidentPolicy | null): void;
145
+ /** The task edited; `null` at creation. */
146
+ task: IScheduledTask | null;
89
147
  }
90
148
  export interface ScheduledTasksProps {
91
149
  list(params: IPaginateScheduledTaskQuery): Promise<BasePaginate<IScheduledTask>>;
@@ -95,8 +153,42 @@ export interface ScheduledTasksProps {
95
153
  regenerateSecret(id: string): Promise<ScheduledTaskWithSecret>;
96
154
  /** « Run now »: queues one run at once. */
97
155
  trigger(id: string): Promise<void>;
156
+ /**
157
+ * The runs of a task, newest first. The date range and the request id of the run filters are
158
+ * Flow's (`from`, `to`, `requestId`); the outcome filter narrows the page loaded.
159
+ */
98
160
  listRuns(id: string, params: IPaginateScheduledTaskRunQuery): Promise<BasePaginate<IScheduledTaskRun>>;
161
+ /**
162
+ * One task, for a deep link (`initialTaskId`). A rejection whose answer is a 404 is drawn as a
163
+ * task that does not exist (any more); any other one as a failure with a retry.
164
+ */
165
+ get(id: string): Promise<IScheduledTask>;
99
166
  permissions: ScheduledTaskPermissions;
100
- /** Where « Ouvrir dans Flow » leads. */
101
- flowUrl: string;
167
+ /** Where « Ouvrir dans Flow » leads. Without it, no link is drawn. */
168
+ flowUrl?: string;
169
+ /**
170
+ * The task whose panel (its state, its runs) opens on arrival, loaded with `get`: the target of
171
+ * a link to one task. A new value opens that task.
172
+ */
173
+ initialTaskId?: string;
174
+ /** The panel of a task was closed: a host on the route of one task goes back to the list's. */
175
+ onCloseTask?(): void;
176
+ /**
177
+ * The screen of the host's logs for the request of a run (its `requestId`, sent as
178
+ * `x-request-id`), drawn as a link in the run detail. `undefined`: no link for that run.
179
+ */
180
+ runLogsHref?(run: IScheduledTaskRun): string | undefined;
181
+ /**
182
+ * The host's incident-policy editor, drawn in the form under the retry settings. With it, the
183
+ * creation and the update send `incidentPolicy` (what it holds, `null` for none); without it,
184
+ * `incidentPolicy` is never sent and an update keeps the task's own.
185
+ */
186
+ renderIncidentPolicy?(props: ScheduledTaskIncidentPolicySlotProps): ReactNode;
187
+ /**
188
+ * The host's card of a task's state (failure streak, open incident), drawn at the head of the
189
+ * task's panel, above its runs.
190
+ */
191
+ renderTaskState?(task: IScheduledTask): ReactNode;
192
+ /** The host's page header that takes the place of the component's (see `DeliveryHostHeader`). */
193
+ hostHeader?: DeliveryHostHeader;
102
194
  }
@@ -1,4 +1,4 @@
1
- import { BasePaginate, DeliveryEventType, DeliveryFormat, DeliveryStatus, FlowDeliverySource, IArchivedDay, IDelivery, IDeliverySubscription, IRehydrationJob, IScheduledTask, IScheduledTaskRun, ScheduledTaskRunStatus } from '@abyss-project/flow';
1
+ import { BasePaginate, DeliveryEventType, DeliveryFormat, DeliveryStatus, FlowDeliverySource, IArchivedDay, IDelivery, IDeliverySubscription, IRehydrationJob, IScheduledTask, IScheduledTaskRun, ScheduledTaskRetryBackoff, ScheduledTaskRunStatus } from '@abyss-project/flow';
2
2
  /**
3
3
  * Fixtures shared by the specs and the catalog pages. The Flow enums are types only here (the SDK
4
4
  * is an optional peer), so their values are written as strings and cast.
@@ -6,6 +6,7 @@ import { BasePaginate, DeliveryEventType, DeliveryFormat, DeliveryStatus, FlowDe
6
6
  export declare const source: (value: string) => FlowDeliverySource;
7
7
  export declare const deliveryStatus: (value: string) => DeliveryStatus;
8
8
  export declare const runStatus: (value: string) => ScheduledTaskRunStatus;
9
+ export declare const retryBackoff: (value: string) => ScheduledTaskRetryBackoff;
9
10
  export declare const deliveryFormat: (value: string) => DeliveryFormat;
10
11
  export declare const eventType: (value: string) => DeliveryEventType;
11
12
  export declare const SOURCES: FlowDeliverySource[];
@@ -1,5 +1,5 @@
1
- import { A as o, g as a, h as n, e as C, i as t, f as i, j as r, k as A, C as E, b as O, c as S, D as _, R as k, o as I, m as c, l as d, n as N, r as T, p as l, u as f, d as D, a as R, w as V } from "./CookieConsentSettings-BPBNaNNI.js";
2
- import { f as p } from "./Surface-DmHRzUtQ.js";
1
+ import { A as o, g as a, h as n, e as C, i as t, f as i, j as r, k as A, C as E, b as O, c as S, D as _, R as k, o as I, m as c, l as d, n as N, r as T, p as l, u as f, d as D, a as R, w as V } from "./CookieConsentSettings-BBfIxpPu.js";
2
+ import { f as p } from "./Surface-D3XLL_3t.js";
3
3
  export {
4
4
  o as AbyssCookieConsentProvider,
5
5
  a as CONSENT_VALIDITY_DAYS,