@cowliss/cli 0.6.0 → 0.7.0
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 +1 -1
- package/dist/guest/{driver-DBt5l1Z5.js → driver-C1bsCjZT.js} +4 -1
- package/dist/guest/driver.d.ts +1 -1
- package/dist/guest/driver.js +1 -1
- package/dist/guest/emails.d.ts +6 -0
- package/dist/guest/{index-CXcCEcAg.d.ts → index-3PMqJKmc.d.ts} +104 -12
- package/dist/guest/{journeys-BrcKEXz0.js → journeys-Dpsp225V.js} +223 -43
- package/dist/guest/journeys.d.ts +37 -12
- package/dist/guest/journeys.js +1 -1
- package/dist/guest/wasi.js +1 -1
- package/dist/index.js +777 -290
- package/examples/abandoned-checkout/journeys/abandoned-checkout.ts +9 -1
- package/examples/activity-decay/journeys/activity-decay.ts +13 -2
- package/examples/cross-app-pitch/journeys/cross-app-pitch.ts +6 -1
- package/examples/winback/journeys/winback.ts +10 -2
- package/package.json +1 -1
package/dist/guest/journeys.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as
|
|
1
|
+
import { i as GuestEvent, n as Trigger, r as TriggerInput, t as Duration } from "./index-3PMqJKmc.js";
|
|
2
2
|
//#region src/guest/journeys.d.ts
|
|
3
3
|
/** The event a journey runs for, or the one a `waitForEvent` resolved with. */
|
|
4
4
|
type Event = GuestEvent;
|
|
@@ -121,22 +121,41 @@ type Api = {
|
|
|
121
121
|
type JourneyConfig = {
|
|
122
122
|
trigger: Trigger;
|
|
123
123
|
/**
|
|
124
|
-
*
|
|
125
|
-
* project declares in `cow.json`. The key's shape is checked
|
|
126
|
-
* the org declares it is checked when the release is deployed.
|
|
124
|
+
* Why this journey contacts someone: `marketing`, `transactional`, or a
|
|
125
|
+
* purpose this project declares in `cow.json`. The key's shape is checked
|
|
126
|
+
* here; that the org declares it is checked when the release is deployed.
|
|
127
127
|
*/
|
|
128
128
|
purpose: string;
|
|
129
|
+
/**
|
|
130
|
+
* How often one recipient may enter this journey. A marketing journey
|
|
131
|
+
* enrolls each recipient once, ever; give it a `cooldown` and it re-opens
|
|
132
|
+
* that long after their last completed run. A transactional journey
|
|
133
|
+
* enrolls on every trigger — three orders are three receipts — so it
|
|
134
|
+
* takes no cooldown and `cow build` refuses one.
|
|
135
|
+
*
|
|
136
|
+
* History counts: adding a cooldown to a journey that has been running
|
|
137
|
+
* for months measures from runs that already completed.
|
|
138
|
+
*/
|
|
139
|
+
enrollment?: {
|
|
140
|
+
cooldown: Duration;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* One plain sentence saying what this journey does for the person who
|
|
144
|
+
* gets it. Shown wherever the journey is read. Optional; at most 500
|
|
145
|
+
* characters.
|
|
146
|
+
*/
|
|
147
|
+
description?: string;
|
|
129
148
|
/**
|
|
130
149
|
* The address every `api.send.email` in this journey goes out as:
|
|
131
150
|
* `"billing@acme.com"` or `"Billing <billing@acme.com>"`. A single send
|
|
132
151
|
* can override it.
|
|
133
152
|
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
153
|
+
* Required, on a domain your organization has verified: there is no
|
|
154
|
+
* address Cowliss lends you. Named here rather than in a settings page,
|
|
155
|
+
* so the address a journey sends from is readable in the journey's own
|
|
156
|
+
* source.
|
|
138
157
|
*/
|
|
139
|
-
from
|
|
158
|
+
from: string;
|
|
140
159
|
/** The author's labels; the dashboard's only grouping. Defaults to none. */
|
|
141
160
|
tags: string[];
|
|
142
161
|
};
|
|
@@ -147,11 +166,17 @@ type Journey = JourneyConfig & {
|
|
|
147
166
|
* Author a journey. Throws at definition time on an invalid config.
|
|
148
167
|
*
|
|
149
168
|
* There is no environment gate here: an organization has one data space, and
|
|
150
|
-
* a journey runs wherever it is
|
|
169
|
+
* a journey runs wherever it is on and nowhere else (ADR 0011, ADR 0013).
|
|
151
170
|
*/
|
|
152
|
-
declare function defineJourney(input: Omit<JourneyConfig, "tags"> & {
|
|
171
|
+
declare function defineJourney(input: Omit<JourneyConfig, "tags" | "trigger"> & {
|
|
172
|
+
/**
|
|
173
|
+
* What starts it: `{ event }`, or `{ segment }` carrying the predicate
|
|
174
|
+
* list of the segment this journey enrolls from. Written form, so a
|
|
175
|
+
* predicate can leave `match` and `atLeast` out.
|
|
176
|
+
*/
|
|
177
|
+
trigger: TriggerInput;
|
|
153
178
|
tags?: string[];
|
|
154
179
|
run: (event: Event, api: Api) => Promise<void>;
|
|
155
180
|
}): Journey;
|
|
156
181
|
//#endregion
|
|
157
|
-
export { Api, CapabilityError, CowTemplates, type Duration, EmailSendResult, Event, Journey, JourneyConfig, Profile, type Trigger, defineJourney };
|
|
182
|
+
export { Api, CapabilityError, CowTemplates, type Duration, EmailSendResult, Event, Journey, JourneyConfig, Profile, type Trigger, type TriggerInput, defineJourney };
|
package/dist/guest/journeys.js
CHANGED
package/dist/guest/wasi.js
CHANGED