Repository navigation
Add audience segments and drip sequences to TypeScript SDK #352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8686235
Add audience segment and drip sequence SDK contracts
purpshell 107f121
Expose sequence exits and verify launch conflicts and step analytics
purpshell 434f954
Set explicit retry policy in launch conflict fixtures
purpshell 12b8549
Tighten segment create and enrollment contracts and bound preview ret…
purpshell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| import type { | ||
| CampaignSendWindowDay, | ||
| CampaignSendWindowRange, | ||
| CampaignRecipientVariables, | ||
| } from "./types.js"; | ||
| export interface CampaignDrip { | ||
| readonly enrollment: "audience" | "continuous"; | ||
| readonly exitOnReply: boolean; | ||
| /** GET opens, including scanners/previews, count; HEAD does not. */ | ||
| readonly exitOnLinkClick: boolean; | ||
| } | ||
| /** Create defaults: audience, true, false. Beta, linked-device/test senders only. */ | ||
| export type CampaignDripInput = Partial<CampaignDrip>; | ||
| /** Omitted settings preserve stored values. No defaults are applied to PATCH. | ||
| * Closing with only enrollment: audience also works after beta withdrawal. */ | ||
| export type CampaignDripPatch = Partial<CampaignDrip>; | ||
| export interface CampaignDripStepStats { | ||
| readonly step: number; | ||
| readonly entered: number; | ||
| readonly waiting: number; | ||
| readonly sent: number; | ||
| readonly delivered: number; | ||
| readonly read: number; | ||
| readonly replied: number; | ||
| readonly exited: number; | ||
| readonly failed: number; | ||
| } | ||
| export interface CampaignDripStats { | ||
| readonly enrollment: "audience" | "continuous"; | ||
| readonly enrolled: number; | ||
| readonly enrolledByApi: number; | ||
| readonly active: number; | ||
| readonly completed: number; | ||
| readonly exited: number; | ||
| readonly steps: readonly CampaignDripStepStats[]; | ||
| } | ||
| export interface EnrollCampaignContactRequest { | ||
| readonly phone: string; | ||
| readonly variables?: CampaignRecipientVariables; | ||
| } | ||
| export interface CampaignEnrollment { | ||
| readonly campaignId: string; | ||
| readonly recipientId: string; | ||
| readonly phone: string; | ||
| readonly created: boolean; | ||
| readonly status: string; | ||
| readonly enrolledAt: number; | ||
| } | ||
| export interface CampaignSegmentSnapshot { | ||
| readonly revision: number; | ||
| readonly evaluatedAt: number; | ||
| readonly matchedCount: number; | ||
| } | ||
| /** Later steps only. At most 4 hour ranges, same time zone as the campaign. | ||
| * Delay is 0..2592000 seconds, in whole multiples of delayUnit. */ | ||
| export interface CampaignStepWindow { | ||
| readonly days: readonly CampaignSendWindowDay[]; | ||
| readonly hours: readonly CampaignSendWindowRange[]; | ||
| } | ||
| export interface CampaignSequenceMessage { | ||
| readonly version?: 2; | ||
| readonly source?: string; | ||
| readonly delayAfterSec?: number; | ||
| readonly delayUnit?: "minutes" | "hours" | "days"; | ||
| readonly sendWindow?: CampaignStepWindow | null; | ||
| readonly [field: string]: unknown; | ||
| } | ||
| /** Exposed through recipient.sequenceError; arbitrary send failure codes also occur. */ | ||
| export type CampaignDripExitReason = "replied" | "link_clicked" | "opted_out"; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.