@cowliss/cli 0.3.0 → 0.4.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.
@@ -12,6 +12,7 @@ import { defineJourney } from "@cowliss/cli/journeys";
12
12
  export default defineJourney({
13
13
  trigger: { event: "checkout_started" },
14
14
  purpose: "emailMarketing",
15
+ senderIdentity: "cowliss-default",
15
16
  tags: ["demo", "checkout"],
16
17
  run: async (event, api) => {
17
18
  const purchased = await api.waitForEvent("purchase_completed", {
@@ -25,7 +26,7 @@ export default defineJourney({
25
26
  // it; the email drops its button when the prop is missing.
26
27
  const checkoutUrl = event.properties.checkoutUrl;
27
28
  const me = await api.profile.get();
28
- await api.email.send({
29
+ await api.send.email({
29
30
  template: "abandoned-checkout",
30
31
  props: {
31
32
  checkoutUrl: typeof checkoutUrl === "string" ? checkoutUrl : undefined,
@@ -9,7 +9,8 @@
9
9
  "activity": "sendEmail",
10
10
  "input": {
11
11
  "template": "abandoned-checkout",
12
- "props": { "firstName": "Ada" }
12
+ "props": { "firstName": "Ada" },
13
+ "senderIdentity": "cowliss-default"
13
14
  }
14
15
  }
15
16
  ]
@@ -21,6 +21,7 @@ import { defineJourney } from "@cowliss/cli/journeys";
21
21
  export default defineJourney({
22
22
  trigger: { event: "*" },
23
23
  purpose: "emailMarketing",
24
+ senderIdentity: "cowliss-default",
24
25
  tags: ["demo", "retention"],
25
26
  run: async (_event, api) => {
26
27
  await api.traits.set("active_30d", true);
@@ -13,6 +13,10 @@ import { defineJourney } from "@cowliss/cli/journeys";
13
13
  export default defineJourney({
14
14
  trigger: { event: "plan_upgraded", appId: "app_b" },
15
15
  purpose: "emailMarketing",
16
+ // A named identity rather than the default: a pitch for your other product
17
+ // reads better from a product address than from the one your receipts come
18
+ // from. Create it under Settings, Domains, sender identities.
19
+ senderIdentity: "product-news",
16
20
  tags: ["demo", "cross-app"],
17
21
  run: async (_event, api) => {
18
22
  await api.sleep("1d");
@@ -22,7 +26,7 @@ export default defineJourney({
22
26
  if (me.traits.plan !== "free") {
23
27
  return;
24
28
  }
25
- await api.email.send({
29
+ await api.send.email({
26
30
  template: "cross-app-pitch",
27
31
  props: { plan: "pro" },
28
32
  });
@@ -9,7 +9,8 @@
9
9
  "activity": "sendEmail",
10
10
  "input": {
11
11
  "template": "cross-app-pitch",
12
- "props": { "plan": "pro" }
12
+ "props": { "plan": "pro" },
13
+ "senderIdentity": "product-news"
13
14
  }
14
15
  }
15
16
  ]
@@ -12,6 +12,7 @@ import { defineJourney } from "@cowliss/cli/journeys";
12
12
  export default defineJourney({
13
13
  trigger: { event: "purchase_completed" },
14
14
  purpose: "emailMarketing",
15
+ senderIdentity: "cowliss-default",
15
16
  tags: ["demo", "retention"],
16
17
  run: async (_event, api) => {
17
18
  await api.traits.set("purchased_recently", true);
@@ -20,7 +21,7 @@ export default defineJourney({
20
21
  }
21
22
  await api.traits.unset("purchased_recently");
22
23
  const me = await api.profile.get();
23
- await api.email.send({
24
+ await api.send.email({
24
25
  template: "winback",
25
26
  props: {
26
27
  firstName:
@@ -13,6 +13,9 @@
13
13
  "input": { "key": "purchased_recently", "value": true }
14
14
  },
15
15
  { "activity": "unsetTrait", "input": { "key": "purchased_recently" } },
16
- { "activity": "sendEmail", "input": { "template": "winback" } }
16
+ {
17
+ "activity": "sendEmail",
18
+ "input": { "template": "winback", "senderIdentity": "cowliss-default" }
19
+ }
17
20
  ]
18
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cowliss/cli",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "cow": "./dist/index.js"
@@ -30,6 +30,7 @@
30
30
  "./package.json": "./package.json"
31
31
  },
32
32
  "dependencies": {
33
+ "@babel/parser": "^7.29.8",
33
34
  "@modelcontextprotocol/sdk": "^1.29.0",
34
35
  "commander": "^14.0.1",
35
36
  "esbuild": "^0.28.2",
@@ -37,6 +38,7 @@
37
38
  "zod": "^4.4.3"
38
39
  },
39
40
  "devDependencies": {
41
+ "@babel/types": "^7.29.8",
40
42
  "@cowliss/api-client": "0.0.0",
41
43
  "@cowliss/shared": "0.0.0",
42
44
  "@react-email/components": "^1.0.12",