@cowliss/cli 0.5.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 +4 -5
- package/dist/guest/{driver-14FnzM-h.js → driver-C1bsCjZT.js} +7 -3
- 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-BDj02EsQ.d.ts → index-3PMqJKmc.d.ts} +111 -16
- package/dist/guest/{journeys-C8j8Sqvl.js → journeys-Dpsp225V.js} +286 -87
- package/dist/guest/journeys.d.ts +52 -23
- package/dist/guest/journeys.js +1 -1
- package/dist/guest/wasi.js +1 -1
- package/dist/index.js +1504 -987
- package/examples/abandoned-checkout/journeys/abandoned-checkout.ts +9 -2
- package/examples/abandoned-checkout/scenarios/abandoned-checkout.timeout.json +1 -2
- package/examples/activity-decay/journeys/activity-decay.ts +13 -3
- package/examples/cross-app-pitch/journeys/cross-app-pitch.ts +10 -5
- package/examples/cross-app-pitch/scenarios/cross-app-pitch.json +1 -1
- package/examples/winback/journeys/winback.ts +10 -3
- package/examples/winback/scenarios/winback.json +1 -1
- package/package.json +1 -1
|
@@ -6,13 +6,20 @@ import { defineJourney } from "@cowliss/cli/journeys";
|
|
|
6
6
|
* recovered, a trait your segments and other journeys can read. Silence
|
|
7
7
|
* spends exactly one reminder email and closes.
|
|
8
8
|
*
|
|
9
|
+
* `marketing` and no `enrollment`, so one shopper goes through this once,
|
|
10
|
+
* ever: their second abandoned cart is not nagged about. Add
|
|
11
|
+
* `enrollment: { cooldown: "30d" }` to reach a repeat abandoner again, a
|
|
12
|
+
* month after their last reminder.
|
|
13
|
+
*
|
|
9
14
|
* Example: add it with `cow add example abandoned-checkout`; rename the
|
|
10
15
|
* events and the email to your domain's vocabulary.
|
|
11
16
|
*/
|
|
12
17
|
export default defineJourney({
|
|
13
18
|
trigger: { event: "checkout_started" },
|
|
14
|
-
purpose: "
|
|
15
|
-
|
|
19
|
+
purpose: "marketing",
|
|
20
|
+
from: "Acme <checkout@example.com>",
|
|
21
|
+
description:
|
|
22
|
+
"Reminds someone who left items in their cart, and stops if they buy.",
|
|
16
23
|
tags: ["demo", "checkout"],
|
|
17
24
|
run: async (event, api) => {
|
|
18
25
|
const purchased = await api.waitForEvent("purchase_completed", {
|
|
@@ -6,7 +6,15 @@ import { defineJourney } from "@cowliss/cli/journeys";
|
|
|
6
6
|
* later event restarts the execution, which resets the 30-day silence clock
|
|
7
7
|
* with a fresh, empty journal; 30 days of silence unsets the flag (removed,
|
|
8
8
|
* not set to false, so `exists` predicates stop matching) and the execution
|
|
9
|
-
* completes.
|
|
9
|
+
* completes.
|
|
10
|
+
*
|
|
11
|
+
* Restarting is not finishing, so a user who keeps showing up never counts
|
|
12
|
+
* as having been through this journey and the loop runs for as long as they
|
|
13
|
+
* do. The execution that ends after 30 days of silence does count, and with
|
|
14
|
+
* `marketing` and no `enrollment` that is the end of it: their next event
|
|
15
|
+
* does not re-flag them. A journey meant to track state for the life of an
|
|
16
|
+
* account wants to reopen as soon as it closes, which is what
|
|
17
|
+
* `enrollment: { cooldown: "1s" }` says.
|
|
10
18
|
*
|
|
11
19
|
* `"*"` is activity as it really arrives: whatever names your apps send,
|
|
12
20
|
* page_view and purchase and login alike. It never matches an event Cowliss
|
|
@@ -20,8 +28,10 @@ import { defineJourney } from "@cowliss/cli/journeys";
|
|
|
20
28
|
*/
|
|
21
29
|
export default defineJourney({
|
|
22
30
|
trigger: { event: "*" },
|
|
23
|
-
purpose: "
|
|
24
|
-
|
|
31
|
+
purpose: "marketing",
|
|
32
|
+
from: "Acme <hello@example.com>",
|
|
33
|
+
description:
|
|
34
|
+
"Keeps track of whether someone has been active in the last 30 days.",
|
|
25
35
|
tags: ["demo", "retention"],
|
|
26
36
|
run: async (_event, api) => {
|
|
27
37
|
await api.traits.set("active_30d", true);
|
|
@@ -7,16 +7,21 @@ import { defineJourney } from "@cowliss/cli/journeys";
|
|
|
7
7
|
* users still on the free plan. This is the portfolio-operator pattern: one
|
|
8
8
|
* org's journeys reacting across its own apps.
|
|
9
9
|
*
|
|
10
|
+
* `marketing` and no `enrollment`: one pitch per person, however often they
|
|
11
|
+
* change plan. A pitch is worth making once.
|
|
12
|
+
*
|
|
10
13
|
* Example: add it with `cow add example cross-app-pitch`; rename the app id,
|
|
11
14
|
* the event, and the email to your own.
|
|
12
15
|
*/
|
|
13
16
|
export default defineJourney({
|
|
14
17
|
trigger: { event: "plan_upgraded", appId: "app_b" },
|
|
15
|
-
purpose: "
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
|
|
18
|
+
purpose: "marketing",
|
|
19
|
+
description:
|
|
20
|
+
"Tells someone who just upgraded about the other product they can use.",
|
|
21
|
+
// An address of its own rather than the shared one: a pitch for your other
|
|
22
|
+
// product reads better from a product address than from the one your
|
|
23
|
+
// receipts come from. Verify its domain under Settings, Domains first.
|
|
24
|
+
from: "Product News <product-news@example.com>",
|
|
20
25
|
tags: ["demo", "cross-app"],
|
|
21
26
|
run: async (_event, api) => {
|
|
22
27
|
await api.sleep("1d");
|
|
@@ -4,15 +4,22 @@ import { defineJourney } from "@cowliss/cli/journeys";
|
|
|
4
4
|
* Winback: `purchase_completed` starts (or restarts) an execution and marks
|
|
5
5
|
* the profile as having bought recently; every further purchase inside 30
|
|
6
6
|
* days resets the silence clock; after 30 days of silence the flag is unset
|
|
7
|
-
* and one winback email goes out.
|
|
7
|
+
* and one winback email goes out.
|
|
8
|
+
*
|
|
9
|
+
* `marketing` and no `enrollment`, so each customer is won back once, ever:
|
|
10
|
+
* the purchase that answers the email does not start a second execution.
|
|
11
|
+
* That is the safe default for a mail nobody asked for. To win the same
|
|
12
|
+
* customer back every time they lapse, say how long to leave between
|
|
13
|
+
* attempts: `enrollment: { cooldown: "180d" }`.
|
|
8
14
|
*
|
|
9
15
|
* Example: add it with `cow add example winback`; rename the purchase event,
|
|
10
16
|
* the flag trait, and the email to your domain's vocabulary.
|
|
11
17
|
*/
|
|
12
18
|
export default defineJourney({
|
|
13
19
|
trigger: { event: "purchase_completed" },
|
|
14
|
-
purpose: "
|
|
15
|
-
|
|
20
|
+
purpose: "marketing",
|
|
21
|
+
from: "Acme <hello@example.com>",
|
|
22
|
+
description: "Invites a customer back after 30 days without a purchase.",
|
|
16
23
|
tags: ["demo", "retention"],
|
|
17
24
|
run: async (_event, api) => {
|
|
18
25
|
await api.traits.set("purchased_recently", true);
|