@beehexa/hexasync-template-frontend-flow 2608.20.18 → 2608.20.32

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.
@@ -0,0 +1,82 @@
1
+ /**
2
+ * The frontend workflows, and their titles — Story 4.2 AC-1.
3
+ *
4
+ * ### A separate package, deliberately (AD-21)
5
+ *
6
+ * A frontend step is never resolved with the worker vocabulary, and this is where that becomes structural rather than
7
+ * a convention. The two runtimes genuinely differ, in four ways measured off the reference implementation
8
+ * (`dashboard-v2/src/pages/__dev/lib/connectorWorkflowMermaid.ts`):
9
+ *
10
+ * | | worker | frontend |
11
+ * | --- | --- | --- |
12
+ * | branch arms | `then` / `else` | `then` **or** `success` / `else` **or** `failed` |
13
+ * | `IF` reads | `data` | `metadata` |
14
+ * | `SWITCH` reads | `data`'s KEYS | `metadata.cases` (a record) + `metadata.default` |
15
+ * | extra route | `onError` | `onCancelled`, labelled `Cancel` |
16
+ *
17
+ * Two more the worker side has no equivalent for: an explicit **`END`** terminal when a step declares no `next`, and
18
+ * no expression handling at all — a frontend `next` is a key, a branch object, or nothing.
19
+ *
20
+ * ⛔ **So the two packages must NOT share a branch reader.** The temptation to unify them is the thing to resist:
21
+ * teaching the worker model about `success`/`failed` would make it accept documents the worker runtime rejects, which
22
+ * is exactly the invention NFR-1 forbids.
23
+ */
24
+ /** The five workflows a CONNECTOR DEFINITION may declare, in the order the reference implementation lists them. */
25
+ export const CONNECTOR_WORKFLOW_KEYS = [
26
+ 'appRegistrationSteps',
27
+ 'authorizationSteps',
28
+ 'authorizationCallbackSteps',
29
+ 'installStandaloneCallbackSteps',
30
+ 'setupSteps',
31
+ ];
32
+ /** The one a TEMPLATE declares. Separate because it lives on a different document. */
33
+ export const TEMPLATE_WORKFLOW_KEYS = ['creationSteps'];
34
+ export const FRONTEND_WORKFLOW_KEYS = [
35
+ ...CONNECTOR_WORKFLOW_KEYS,
36
+ ...TEMPLATE_WORKFLOW_KEYS,
37
+ ];
38
+ /**
39
+ * A human title per workflow — AC-1's *"drawn with its own title"*.
40
+ *
41
+ * ⚠️ **PRESERVED from the recorded baseline** (Story 4.2 review, M2). The first version renamed five of the six —
42
+ * `App Registration` → `App registration`, `Profile Setup` → `Setup`, `Profile Creation` → `Creation` and so on — on
43
+ * the reasoning that the word *Steps* is noise and sentence case reads better. Two things were wrong with that: the
44
+ * baseline README records these titles as rendered output, so changing them needs an adopt/preserve/accept verdict per
45
+ * `golden-flows/README.md`, and nothing was asserting them — **setting all six to the same string left all 27 tests
46
+ * green**, because only `authorizationSteps` (the one title that happened not to change) was compared exactly.
47
+ *
48
+ * PRESERVE is the verdict: these are the titles two shipped surfaces already draw, and the case argument is a
49
+ * preference, not a defect. Each is now asserted exactly.
50
+ */
51
+ export const FRONTEND_WORKFLOW_TITLES = {
52
+ appRegistrationSteps: 'App Registration',
53
+ authorizationSteps: 'Authorization',
54
+ authorizationCallbackSteps: 'Authorization Callback',
55
+ installStandaloneCallbackSteps: 'Install Standalone Callback',
56
+ setupSteps: 'Profile Setup',
57
+ creationSteps: 'Profile Creation',
58
+ };
59
+ export function surfaceOf(key) {
60
+ return CONNECTOR_WORKFLOW_KEYS.includes(key)
61
+ ? 'connector'
62
+ : 'template';
63
+ }
64
+ /**
65
+ * The workflows a document actually declares, in the order above.
66
+ *
67
+ * Non-empty, for the same reason the worker package requires it: a declared-but-empty workflow is a fact about the
68
+ * document, not a diagram a reader can be sent to. (The worker side shipped the looser rule and the review measured
69
+ * 4,519 corpus occurrences of an arrow into nothing.)
70
+ */
71
+ export function workflowsPresent(document,
72
+ /**
73
+ * How many of an array's items are actually DRAWABLE. Injected so this module stays free of step semantics while
74
+ * still measuring the right thing.
75
+ */
76
+ drawableCount = (items) => items.length) {
77
+ return FRONTEND_WORKFLOW_KEYS.filter((key) => {
78
+ const value = document[key];
79
+ return Array.isArray(value) && drawableCount(value) > 0;
80
+ });
81
+ }
82
+ //# sourceMappingURL=workflows.js.map
@@ -0,0 +1 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,6 @@
1
1
  {
2
2
  "name": "@beehexa/hexasync-template-frontend-flow",
3
- "version": "2608.20.18",
3
+ "version": "2608.20.32",
4
4
  "description": "The flow model for a frontend onboarding workflow — creationSteps and the five connector workflows.",
5
5
  "license": "SEE LICENSE IN ../../LICENSE",
6
6
  "type": "module",
@@ -20,7 +20,7 @@
20
20
  "build": "tsc -p tsconfig.build.json"
21
21
  },
22
22
  "dependencies": {
23
- "@beehexa/hexasync-template-model": "2608.20.18"
23
+ "@beehexa/hexasync-template-model": "2608.20.32"
24
24
  },
25
25
  "hexasync": {
26
26
  "layer": "core"