create-safest-tools 0.4.1 → 0.4.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-safest-tools",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Create customer-owned abuse-reporting infrastructure on Cloudflare",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -39,6 +39,14 @@ function AnswerValue({ answer }: { answer: ReportAnswer }) {
39
39
  : <span className="answer-text">{value}</span>;
40
40
  }
41
41
 
42
+ function reporterEmailValue(report: ReportDetailRecord): string {
43
+ if (report.reporterEmail) return report.reporterEmail;
44
+ if (report.reporterContactStatus === "redacted") return "Redacted by the retention policy";
45
+ if (report.reporterContactStatus === "restricted") return "Restricted for this role";
46
+ if (report.reporterContactStatus === "unavailable") return "Temporarily unavailable";
47
+ return "Not provided";
48
+ }
49
+
42
50
  function deliveryLabel(state: string): string {
43
51
  if (state === "suppressed") return "Not sent";
44
52
  if (state === "queued" || state === "pending" || state === "sending" || state === "delivering") return "Queued";
@@ -147,6 +155,7 @@ function DetailContent({ report, actorId, generatedAt, actionCodes, claimReports
147
155
  <Fact label="Channel">{readable(report.source || "unknown")}</Fact>
148
156
  <Fact label="Submitted">{dateTime(report.submittedAt || report.receivedAt)}</Fact>
149
157
  <Fact label="Language">{report.locale || "—"}</Fact>
158
+ <Fact label="Reporter email">{reporterEmailValue(report)}</Fact>
150
159
  </dl><div className="answer-list">
151
160
  {answers.length ? answers.map((answer) => <article className="answer-record" key={answer.fieldKey}><div><strong>{answer.label || readable(answer.fieldKey)}</strong>{answer.required ? <small>Required question</small> : null}</div><AnswerValue answer={answer} /></article>) : <EmptyLine>This form did not contain additional questions.</EmptyLine>}
152
161
  </div></section>
@@ -183,6 +183,9 @@ export interface ReportDetailRecord {
183
183
  customerUrl?: string;
184
184
  ownerReference?: string;
185
185
  reporterReference?: string;
186
+ reporterEmail?: string | null;
187
+ reporterContactMode?: string;
188
+ reporterContactStatus?: "available" | "not_provided" | "redacted" | "restricted" | "unavailable";
186
189
  policyTitle?: string;
187
190
  policyVersionId?: string;
188
191
  queuePolicyVersionId?: string;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "safest-resolve-installation",
3
- "version": "0.4.1",
4
- "safestToolsVersion": "0.4.1-resolve",
3
+ "version": "0.4.2",
4
+ "safestToolsVersion": "0.4.2-resolve",
5
5
  "private": true,
6
6
  "license": "Apache-2.0",
7
7
  "type": "module",