@redsift/products 12.5.16-alpha.1 → 12.6.1

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.
@@ -598,6 +598,8 @@ var EXTRACTOR_STRINGS = {
598
598
  "investigate:card.dmarc.summary-domain-quarantine-partial-sp-weak": "The domain only quarantines {pct}% of unauthorized email, and subdomains use a weaker policy, leaving them vulnerable to spoofing.",
599
599
  // Summary box strings for email compliance results
600
600
  "investigate:card.dmarc.summary-email-pass": "The email is DMARC compliant. It passed both DKIM and SPF.",
601
+ "investigate:card.dmarc.summary-email-pass-dkim-only": "The email is DMARC compliant. DKIM passed, but SPF did not.",
602
+ "investigate:card.dmarc.summary-email-pass-spf-only": "The email is DMARC compliant. SPF passed, but DKIM did not.",
601
603
  "investigate:card.dmarc.summary-email-fail-both": "The email is not DMARC compliant. Neither DKIM nor SPF passed.",
602
604
  "investigate:card.dmarc.summary-email-fail-dkim": "The email is not DMARC compliant. DKIM did not pass.",
603
605
  "investigate:card.dmarc.summary-email-fail-spf": "The email is not DMARC compliant. SPF did not pass.",
@@ -1086,6 +1088,8 @@ var EXTRACTOR_STRINGS = {
1086
1088
  "investigate:card.dmarc.summary-domain-quarantine-partial-sp-weak": "Le domaine ne met en quarantaine que {pct} % des e-mails non autoris\xE9s, et les sous-domaines utilisent une politique plus faible, les rendant vuln\xE9rables \xE0 l'usurpation.",
1087
1089
  // Summary box strings for email compliance results
1088
1090
  "investigate:card.dmarc.summary-email-pass": "L'e-mail est conforme \xE0 DMARC. Il a pass\xE9 \xE0 la fois DKIM et SPF.",
1091
+ "investigate:card.dmarc.summary-email-pass-dkim-only": "L'e-mail est conforme \xE0 DMARC. DKIM a pass\xE9, mais pas SPF.",
1092
+ "investigate:card.dmarc.summary-email-pass-spf-only": "L'e-mail est conforme \xE0 DMARC. SPF a pass\xE9, mais pas DKIM.",
1089
1093
  "investigate:card.dmarc.summary-email-fail-both": "L'e-mail n'est pas conforme \xE0 DMARC. Ni DKIM ni SPF n'ont pass\xE9.",
1090
1094
  "investigate:card.dmarc.summary-email-fail-dkim": "L'e-mail n'est pas conforme \xE0 DMARC. DKIM n'a pas pass\xE9.",
1091
1095
  "investigate:card.dmarc.summary-email-fail-spf": "L'e-mail n'est pas conforme \xE0 DMARC. SPF n'a pas pass\xE9.",
@@ -2700,18 +2704,65 @@ var frFR = {
2700
2704
  };
2701
2705
 
2702
2706
  /**
2703
- * Add the 'investigate.' namespace prefix to all extractor string keys
2704
- * so they align with the DS translation key convention.
2707
+ * Merging `@redsift/signal-logic`'s extractor strings into the DS signal-card catalogue.
2708
+ *
2709
+ * Pure (no JSON or package imports) so the `yarn verify:intl-drift` check can run the exact merge
2710
+ * the runtime uses, rather than a re-implementation that could agree with itself while the real
2711
+ * one is broken.
2705
2712
  */
2706
- function prefixKeys(strings) {
2707
- const result = {};
2708
- for (const [key, value] of Object.entries(strings)) {
2709
- result[`investigate.${key}`] = value;
2713
+
2714
+ /** A translation value, mirroring `ExtractorStringValue` from `@redsift/signal-logic/i18n`. */
2715
+
2716
+ /** The DS catalogue namespace every signal-card key lives under. */
2717
+ const NAMESPACE = 'investigate';
2718
+
2719
+ /** Upstream's colon form of the same namespace, e.g. `investigate:extracted-email`. */
2720
+ const UPSTREAM_NAMESPACE = `${NAMESPACE}:`;
2721
+
2722
+ /**
2723
+ * The catalogue key an upstream extractor-string key is stored under.
2724
+ *
2725
+ * Upstream keys come in two forms: namespace-less (`card.amp.spf-passed_md`) and colon-namespaced
2726
+ * (`investigate:card.spf.passed_md`). `useSignalCardTranslation` maps `t('investigate:foo')` to
2727
+ * `investigate.foo`, so a colon-namespaced key must drop its namespace before the dot prefix is
2728
+ * added. Prefixing it as-is (DS-116) stored it under `investigate.investigate:foo`, which nothing
2729
+ * ever looks up, so the key rendered as its own name.
2730
+ */
2731
+ function toCatalogueKey(upstreamKey) {
2732
+ const key = upstreamKey.startsWith(UPSTREAM_NAMESPACE) ? upstreamKey.slice(UPSTREAM_NAMESPACE.length) : upstreamKey;
2733
+ return `${NAMESPACE}.${key}`;
2734
+ }
2735
+
2736
+ /**
2737
+ * Merge upstream extractor strings over one locale's DS JSON.
2738
+ *
2739
+ * Upstream wins where both sides carry a key: signal-logic is the source of truth for these
2740
+ * strings, and the DS JSON is only a mirror of them.
2741
+ *
2742
+ * Upstream can carry the same key in both forms (`investigate:extracted-dns-short` and bare
2743
+ * `extracted-dns-short`), sometimes with different copy. Upstream resolves them as distinct keys,
2744
+ * but here both land on `investigate.extracted-dns-short`, so one must win. The colon-namespaced
2745
+ * form does, whatever order upstream lists them in: it is the key callers ask for by name with
2746
+ * `t('investigate:…')`.
2747
+ */
2748
+ function mergeCatalogue(dsStrings, upstreamStrings) {
2749
+ // `T` is left unconstrained: the DS JSON is not only strings (`glossary.label.*.link_UNKNOWN` is
2750
+ // a boolean), and it passes through untouched.
2751
+ const merged = _objectSpread2({}, dsStrings);
2752
+ const entries = Object.entries(upstreamStrings);
2753
+ const isNamespaced = _ref => {
2754
+ let [key] = _ref;
2755
+ return key.startsWith(UPSTREAM_NAMESPACE);
2756
+ };
2757
+ for (const [key, value] of [...entries.filter(e => !isNamespaced(e)), ...entries.filter(isNamespaced)]) {
2758
+ merged[toCatalogueKey(key)] = value;
2710
2759
  }
2711
- return result;
2760
+ return merged;
2712
2761
  }
2713
- const mergedEnUS = _objectSpread2(_objectSpread2({}, enUS), prefixKeys(EXTRACTOR_STRINGS['en-US']));
2714
- const mergedFrFR = _objectSpread2(_objectSpread2({}, frFR), prefixKeys(EXTRACTOR_STRINGS['fr-FR']));
2762
+
2763
+ /* istanbul ignore file */
2764
+ const mergedEnUS = mergeCatalogue(enUS, EXTRACTOR_STRINGS['en-US']);
2765
+ const mergedFrFR = mergeCatalogue(frFR, EXTRACTOR_STRINGS['fr-FR']);
2715
2766
  var intlMessages = {
2716
2767
  'en-US': mergedEnUS,
2717
2768
  'fr-FR': mergedFrFR