@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.
@@ -1,4 +1,4 @@
1
- import { n as Duration, r as GuestEvent, t as Trigger } from "./index-CXcCEcAg.js";
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
- * A fixed purpose (`emailMarketing`, `dataProcessing`) or one this
125
- * project declares in `cow.json`. The key's shape is checked here; that
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
- * Optional: leave it out and Cowliss sends from the address it gives your
135
- * organization, with nothing to set up. Named here rather than in a
136
- * settings page, so the address a journey sends from is readable in the
137
- * journey's own source.
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?: string;
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 enabled and nowhere else (ADR 0011, ADR 0013).
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 };
@@ -1,3 +1,3 @@
1
- import { n as defineJourney, t as CapabilityError } from "./journeys-BrcKEXz0.js";
1
+ import { n as defineJourney, t as CapabilityError } from "./journeys-Dpsp225V.js";
2
2
 
3
3
  export { CapabilityError, defineJourney };
@@ -1,4 +1,4 @@
1
- import { t as runGuest } from "./driver-DBt5l1Z5.js";
1
+ import { t as runGuest } from "./driver-C1bsCjZT.js";
2
2
 
3
3
  //#region src/guest/wasi.ts
4
4
  const STDIN = 0;