@aglyn/plugins-marketing 1.0.0-beta.218 → 1.0.0-beta.219

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 (57) hide show
  1. package/README.md +2 -0
  2. package/package.json +15 -15
  3. package/src/lib/analytics-provider.d.ts +177 -0
  4. package/src/lib/analytics-provider.js +370 -0
  5. package/src/lib/analytics-provider.js.map +1 -0
  6. package/src/lib/components/campaign-detail-card.js +16 -16
  7. package/src/lib/components/campaign-detail-card.js.map +1 -1
  8. package/src/lib/components/campaign-members-section.js +11 -11
  9. package/src/lib/components/campaign-members-section.js.map +1 -1
  10. package/src/lib/components/campaign-report-card.js +6 -4
  11. package/src/lib/components/campaign-report-card.js.map +1 -1
  12. package/src/lib/components/campaigns-card.js +1 -1
  13. package/src/lib/components/campaigns-card.js.map +1 -1
  14. package/src/lib/components/conversion-attribution.component.js +1 -1
  15. package/src/lib/components/conversion-attribution.component.js.map +1 -1
  16. package/src/lib/components/email-detail.js +12 -7
  17. package/src/lib/components/email-detail.js.map +1 -1
  18. package/src/lib/components/email-messages-widget.js +1 -1
  19. package/src/lib/components/email-messages-widget.js.map +1 -1
  20. package/src/lib/components/emails-list-card.js +11 -5
  21. package/src/lib/components/emails-list-card.js.map +1 -1
  22. package/src/lib/components/host-experiments-card.component.js +12 -7
  23. package/src/lib/components/host-experiments-card.component.js.map +1 -1
  24. package/src/lib/components/org-experiments-card.js +1 -1
  25. package/src/lib/components/org-experiments-card.js.map +1 -1
  26. package/src/lib/components/record-route-context.d.ts +41 -0
  27. package/src/lib/components/record-route-context.js +63 -0
  28. package/src/lib/components/record-route-context.js.map +1 -0
  29. package/src/lib/components/use-marketing-hub-path.d.ts +18 -5
  30. package/src/lib/components/use-marketing-hub-path.js +36 -6
  31. package/src/lib/components/use-marketing-hub-path.js.map +1 -1
  32. package/src/lib/model/campaign-send-time.d.ts +74 -0
  33. package/src/lib/model/campaign-send-time.js +120 -0
  34. package/src/lib/model/campaign-send-time.js.map +1 -0
  35. package/src/lib/model/experiments.js +1 -1
  36. package/src/lib/model/experiments.js.map +1 -1
  37. package/src/lib/server/campaign-batch-plan.d.ts +73 -0
  38. package/src/lib/server/campaign-batch-plan.js +79 -0
  39. package/src/lib/server/campaign-batch-plan.js.map +1 -0
  40. package/src/lib/server/campaign-send.js +10 -5
  41. package/src/lib/server/campaign-send.js.map +1 -1
  42. package/src/lib/server/email-events.js +7 -6
  43. package/src/lib/server/email-events.js.map +1 -1
  44. package/src/lib/server/list-send-time-facts.d.ts +60 -0
  45. package/src/lib/server/list-send-time-facts.js +108 -0
  46. package/src/lib/server/list-send-time-facts.js.map +1 -0
  47. package/src/lib/server.js +4 -0
  48. package/src/lib/server.js.map +1 -1
  49. package/src/lib/tenant-emails.d.ts +29 -0
  50. package/src/lib/tenant-emails.js +41 -0
  51. package/src/lib/tenant-emails.js.map +1 -0
  52. package/src/lib/testing/stand-in-emails-page-routes.d.ts +27 -0
  53. package/src/lib/testing/stand-in-emails-page-routes.js +42 -0
  54. package/src/lib/testing/stand-in-emails-page-routes.js.map +1 -0
  55. package/src/lib/components/use-emails-hub-path.d.ts +0 -58
  56. package/src/lib/components/use-emails-hub-path.js +0 -109
  57. package/src/lib/components/use-emails-hub-path.js.map +0 -1
@@ -14,7 +14,7 @@ import { _ as _extends } from "@swc/helpers/_/_extends";
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */ import { checkQuota, contactMatchesSegment, isEmailTopicId, DEFAULT_CAMPAIGN_TOPIC_ID, readMarketingBasis, resolveMarketingConsentPolicy, splitByMarketingConsent, createResourceUid, decodeStoredNodes, emailStarterSendBlock, resolveBrandingProfile, siteLockdownFromDocs, visibleToHost } from "@aglyn/aglyn/server";
17
+ */ import { checkQuota, contactMatchesSegment, isEmailTopicId, DEFAULT_CAMPAIGN_TOPIC_ID, readMarketingBasis, resolveMarketingConsentPolicy, splitByMarketingConsent, createResourceUid, decodeStoredNodes, emailStarterSendBlock, resolveBrandingProfile, seenOnlyThroughGrant, siteLockdownFromDocs, visibleToHost } from "@aglyn/aglyn/server";
18
18
  import { renderRecipientEmail } from "@aglyn/aglyn/app-utils/recipient-email-render";
19
19
  import { composeHostComponentNodes } from "@aglyn/aglyn/app-utils/load-referenced-components";
20
20
  import { assignExperimentVariant } from "../model/index.js";
@@ -70,7 +70,8 @@ import { campaignSendSearchFields } from "../model/campaign-list-query.js";
70
70
  * against a harness that cannot serve it.
71
71
  */ import { claimOrgEmailSendDay, orgAgeDays, readSenderReputation, reconcileOrgEmailSendDay, recordCampaignAccepted, resolveOrgEmailRamp } from "@aglyn/tenant-data-admin/server/email-sender-reputation";
72
72
  import { createHash } from "crypto";
73
- import { EMAIL_MAX_AUDIENCE_PER_SEND, EMAIL_MAX_RECIPIENTS_PER_SEND, campaignBatchPlan, createProviderRequestPacer, effectiveReputationPolicy, HOST_SENDERS_COLLECTION, isEmailConfigured, rateLimitedRetryAtMs, readHostSender, sendEmail, sendingIdentityRefusal, sentAsStamp } from "@aglyn/shared-util-email";
73
+ import { EMAIL_MAX_AUDIENCE_PER_SEND, EMAIL_MAX_RECIPIENTS_PER_SEND, createProviderRequestPacer, effectiveReputationPolicy, HOST_SENDERS_COLLECTION, isEmailConfigured, rateLimitedRetryAtMs, readHostSender, sendEmail, sendingIdentityRefusal, sentAsStamp } from "@aglyn/shared-util-email";
74
+ import { campaignBatchPlan } from "./campaign-batch-plan.js";
74
75
  /*
75
76
  * The List-Unsubscribe setting sequences share (AGL-3307), from its LEAF
76
77
  * module: the specs that reach this file spread the real barrel under their
@@ -714,7 +715,9 @@ export async function performCampaignSend(options) {
714
715
  // MAIL a sibling brand's leads under this site's campaign.
715
716
  const leads = await sweepAudience((await orgDataQueryForHost(hostId, 'leads')).query);
716
717
  audienceTruncated = leads.truncated;
717
- recipients = leads.docs.map((doc)=>{
718
+ // Held, not merely seen: a lead another site SHARED with this one
719
+ // (AGL-3336) is visible here and was never this site's audience.
720
+ recipients = leads.docs.filter((doc)=>!seenOnlyThroughGrant(doc.data(), hostId)).map((doc)=>{
718
721
  var _doc_get;
719
722
  const email = String((_doc_get = doc.get('email')) != null ? _doc_get : '');
720
723
  collectName(email, doc.get('name'));
@@ -780,7 +783,9 @@ export async function performCampaignSend(options) {
780
783
  * reports a small `audienceSize` with `audienceTruncated` set, reading as
781
784
  * "at least this many, we stopped counting" and not as a total.
782
785
  */ audienceTruncated = contacts.truncated;
783
- recipients = contacts.docs.filter((doc)=>{
786
+ recipients = contacts.docs// Held, not merely seen — a shared contact is no site's audience but
787
+ // its holders' (AGL-3336).
788
+ .filter((doc)=>!seenOnlyThroughGrant(doc.data(), hostId)).filter((doc)=>{
784
789
  var _doc_get, _doc_get1;
785
790
  return contactMatchesSegment({
786
791
  tags: (_doc_get = doc.get('tags')) != null ? _doc_get : [],
@@ -1804,7 +1809,7 @@ export async function performCampaignSend(options) {
1804
1809
  siteBase,
1805
1810
  hostId,
1806
1811
  email,
1807
- campaignId,
1812
+ sendId: campaignId,
1808
1813
  topicId,
1809
1814
  secret: unsubscribeSecret
1810
1815
  };