@wral/report-it 0.1.2 → 0.1.4
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 +40 -1
- package/dist/define.mjs +1 -1
- package/dist/define.standalone.js +1290 -1111
- package/dist/index.mjs +94 -80
- package/dist/{wral-code-input-CC2ZCxcs.js → wral-code-input-DCemMj53.js} +650 -471
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -56,6 +56,40 @@ column width (default 680px).
|
|
|
56
56
|
`PUT /v1/requests/{requestId}` (idempotent — retries return the same
|
|
57
57
|
reference) → confirmation + behind-the-scenes journey.
|
|
58
58
|
|
|
59
|
+
### Skipping the account (DEV-1270)
|
|
60
|
+
|
|
61
|
+
The sign-in card files its alternatives under a collapsed **"Other ways
|
|
62
|
+
to send this"** disclosure — deliberately present but never the path of
|
|
63
|
+
least resistance. It always offers the newsroom desk number. It offers
|
|
64
|
+
an in-form anonymous submission **only when the server advertises it**:
|
|
65
|
+
`GET /v1/forms` carries `anonymous: {enabled, humanCheck}`, the client
|
|
66
|
+
records it (`client.anonymousCapability()`), and the route renders from
|
|
67
|
+
that alone — never from anything baked into the page. A deployment with
|
|
68
|
+
`enabled: false`, or an older API with no block at all, leaves the route
|
|
69
|
+
dark and the phone number as the only anonymous option. A form
|
|
70
|
+
suppresses the route regardless with `allowAnonymous: false`.
|
|
71
|
+
|
|
72
|
+
`humanCheck` is `null` today (no proof-of-human provider is configured;
|
|
73
|
+
the API defends the route with per-caller limits). When a provider is
|
|
74
|
+
configured server-side it becomes `{provider, siteKey}` and the
|
|
75
|
+
component will render that widget in the confirmation card and pass its
|
|
76
|
+
token as `humanToken` — the server is the only party that can verify a
|
|
77
|
+
captcha, so the server is the only party that may ask for one.
|
|
78
|
+
|
|
79
|
+
The session itself: `createAnonSession({formId, requestId})` posts to
|
|
80
|
+
`/v1/anon/sessions` unauthenticated and holds the returned token; every
|
|
81
|
+
auth-bearing call then presents it as the bearer in place of the My WRAL
|
|
82
|
+
identity until `endAnonSession()` — called after a successful submit and
|
|
83
|
+
on Start over, so a stale anonymous session can never ride along with a
|
|
84
|
+
signed-in one.
|
|
85
|
+
|
|
86
|
+
Choosing it takes a confirmation card stating what the viewer gives up,
|
|
87
|
+
with **Sign in instead** as the primary action. The choice is recorded
|
|
88
|
+
on the gate step (`{kind: 'gate', anonymous: true}`), so it survives a
|
|
89
|
+
reload; the session is minted at submit against the `requestId`, so an
|
|
90
|
+
abandoned form leaves nothing behind, and a mid-upload expiry re-mints
|
|
91
|
+
in place instead of opening the sign-in card.
|
|
92
|
+
|
|
59
93
|
Auth uses `@wral/sdk-auth-audience` directly (`sendCode`/`verifyCode`);
|
|
60
94
|
`requireAuth`/`authFetch` are deliberately avoided — their 401 paths
|
|
61
95
|
redirect to `/login/`, which would destroy an unsubmitted form. A 401
|
|
@@ -83,7 +117,12 @@ The harness runs against the live dev API by default (real My WRAL
|
|
|
83
117
|
login — your email receives a real code) or fully offline with the
|
|
84
118
|
in-memory demo client (any email, any six digits). Append
|
|
85
119
|
`?demofail=1` to make the second upload fail once and exercise the
|
|
86
|
-
retry UX.
|
|
120
|
+
retry UX. The **Anonymous route** checkbox (demo mode only, also
|
|
121
|
+
settable with `?anon=1`) makes the demo client advertise anonymous
|
|
122
|
+
submission the way a real server does, lighting up the in-form option;
|
|
123
|
+
unchecked it stays dark. In live-dev mode the route follows the dev API's
|
|
124
|
+
own `anonymous` block, so a real anonymous submission can be exercised
|
|
125
|
+
end to end against the dev content stage.
|
|
87
126
|
|
|
88
127
|
## Release
|
|
89
128
|
|
package/dist/define.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as n from "amazon-cognito-identity-js";
|
|
2
|
-
import { W as i, a as r, b as a } from "./wral-code-input-
|
|
2
|
+
import { W as i, a as r, b as a } from "./wral-code-input-DCemMj53.js";
|
|
3
3
|
typeof window < "u" && !window.AmazonCognitoIdentity && (window.AmazonCognitoIdentity = n);
|
|
4
4
|
const d = {
|
|
5
5
|
"wral-report-it": a,
|