@cowliss/sdk 0.20.0 → 0.22.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/CHANGELOG.md +17 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/types.d.ts +24 -1
- package/dist/version.autogenerated.d.ts +1 -1
- package/dist/version.autogenerated.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,23 @@
|
|
|
4
4
|
|
|
5
5
|
What changed in each version of `@cowliss/sdk` after 0.16.0, newest first. Earlier versions are listed on [npm](https://www.npmjs.com/package/@cowliss/sdk?activeTab=versions).
|
|
6
6
|
|
|
7
|
+
## 0.22.0 (2026-10-12)
|
|
8
|
+
|
|
9
|
+
### Breaking changes
|
|
10
|
+
|
|
11
|
+
- Delete the catalog, violations, strict mode and the held queue
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- Record each key's use per app and the calling client on events
|
|
16
|
+
|
|
17
|
+
## 0.21.0 (2026-10-02)
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
- Plan constants, plan_limit, meta warnings and root-domain helper
|
|
22
|
+
- **Emails:** Test sends with `test: true` and reserved test addresses
|
|
23
|
+
|
|
7
24
|
## 0.20.0 (2026-10-02)
|
|
8
25
|
|
|
9
26
|
### Features
|
package/dist/index.d.ts
CHANGED
|
@@ -106,6 +106,12 @@ export declare class Cow {
|
|
|
106
106
|
*
|
|
107
107
|
* Addressed to `{ email }` that no profile in the app holds yet, the send
|
|
108
108
|
* creates that profile first, as `identify` would.
|
|
109
|
+
*
|
|
110
|
+
* `test: true` asks "would this exact send work?": every check runs and
|
|
111
|
+
* refuses as it would, and the answer carries `status` (`would_send` or
|
|
112
|
+
* the skip) and `rendered`, but nothing is sent or created. An address at
|
|
113
|
+
* `test.cowliss.com` is the other half: a real send whose outcome the
|
|
114
|
+
* address picks (`delivered@`, `bounced@`, `complained@`, `suppressed@`).
|
|
109
115
|
*/
|
|
110
116
|
emails: {
|
|
111
117
|
send: ({ idempotencyKey, ...input }: WithDefaultSource<SendEmailInput> & {
|
package/dist/index.js
CHANGED
|
@@ -128,6 +128,12 @@ export class Cow {
|
|
|
128
128
|
*
|
|
129
129
|
* Addressed to `{ email }` that no profile in the app holds yet, the send
|
|
130
130
|
* creates that profile first, as `identify` would.
|
|
131
|
+
*
|
|
132
|
+
* `test: true` asks "would this exact send work?": every check runs and
|
|
133
|
+
* refuses as it would, and the answer carries `status` (`would_send` or
|
|
134
|
+
* the skip) and `rendered`, but nothing is sent or created. An address at
|
|
135
|
+
* `test.cowliss.com` is the other half: a real send whose outcome the
|
|
136
|
+
* address picks (`delivered@`, `bounced@`, `complained@`, `suppressed@`).
|
|
131
137
|
*/
|
|
132
138
|
emails = {
|
|
133
139
|
send: ({ idempotencyKey, ...input }) => this.#watch(async () => this.#post("/v1/emails", { data: { ...input, sourceId: this.#sourceFor(input) } }, idempotencyKey ?? crypto.randomUUID())),
|
package/dist/types.d.ts
CHANGED
|
@@ -13,8 +13,13 @@
|
|
|
13
13
|
* typecheck here rather than at a customer's call site.
|
|
14
14
|
*/
|
|
15
15
|
/** The API's error-code enum, as the SDK surfaces it on `CowError.code`. */
|
|
16
|
-
export type ErrorCode = "malformed_request" | "invalid_key" | "forbidden" | "not_found" | "conflict" | "payload_too_large" | "validation_failed" | "trait_validation_failed" | "
|
|
16
|
+
export type ErrorCode = "malformed_request" | "invalid_key" | "forbidden" | "not_found" | "conflict" | "payload_too_large" | "validation_failed" | "trait_validation_failed" | "over_quota" | "rate_limited" | "dependency_unavailable" | "internal" | "journey_fuel_exceeded" | "journey_timeout" | "journey_memory_exceeded" | "journey_error" | "journey_output_invalid" | "journey_nondeterministic" | "push_invalid" | "version_not_ready" | "version_outdated" | "source_inactive" | "artifact_too_large" | "plan_limit";
|
|
17
17
|
export type IdentifierKind = "anonymousId" | "userId" | "clerkId" | "email";
|
|
18
|
+
/**
|
|
19
|
+
* What became of a send: handed over and how it settled, a check that
|
|
20
|
+
* skipped it, or (for a test send) the dry-run twin of either.
|
|
21
|
+
*/
|
|
22
|
+
export type DeliveryStatus = "sent" | "delivered" | "bounced" | "complained" | "failed" | "skipped_disabled" | "skipped_paused" | "skipped_suppressed" | "skipped_quota" | "skipped_unknown_purpose" | "skipped_frequency_cap" | "skipped_consent" | "skipped_domain" | "skipped_ssrf" | "would_send" | "would_skip_disabled" | "would_skip_paused" | "would_skip_suppressed" | "would_skip_quota" | "would_skip_unknown_purpose" | "would_skip_frequency_cap" | "would_skip_consent" | "would_skip_domain" | "would_skip_ssrf";
|
|
18
23
|
/**
|
|
19
24
|
* The named identifiers a call carries, at least one. Cowliss generates the
|
|
20
25
|
* profile id and resolves the map to it; a call carrying two identifiers is
|
|
@@ -56,6 +61,8 @@ export type EventDto = {
|
|
|
56
61
|
timestamp: string;
|
|
57
62
|
receivedAt: string;
|
|
58
63
|
messageId: string | null;
|
|
64
|
+
/** The `X-Cow-Client` the call carried, such as `@cowliss/sdk/0.21.0`. */
|
|
65
|
+
client: string | null;
|
|
59
66
|
};
|
|
60
67
|
/**
|
|
61
68
|
* A purpose path: one of the two roots, or a name your app's `cow.json`
|
|
@@ -156,10 +163,26 @@ export type SendEmailInput = {
|
|
|
156
163
|
key: string;
|
|
157
164
|
props?: Record<string, unknown>;
|
|
158
165
|
};
|
|
166
|
+
/**
|
|
167
|
+
* A dry run: every check the real send makes and the same refusals, one
|
|
168
|
+
* delivery row with the outcome, and nothing sent, no profile created, no
|
|
169
|
+
* idempotency key spent and no credit used.
|
|
170
|
+
*/
|
|
171
|
+
test?: boolean;
|
|
159
172
|
};
|
|
160
173
|
export type SendEmailResult = {
|
|
161
174
|
/** The delivery this send left behind: the row in Deliveries. */
|
|
162
175
|
deliveryId: string;
|
|
176
|
+
/** `sent`, or the skip a check recorded; on a test, `would_send` or `would_skip_*`. */
|
|
177
|
+
status: DeliveryStatus;
|
|
178
|
+
/** A test send only: `to` named an `email` nobody holds, which the send would create. */
|
|
179
|
+
wouldCreateProfile?: boolean;
|
|
180
|
+
/** A test send only: the message the real send would carry. */
|
|
181
|
+
rendered?: {
|
|
182
|
+
subject: string;
|
|
183
|
+
html: string;
|
|
184
|
+
text: string;
|
|
185
|
+
};
|
|
163
186
|
};
|
|
164
187
|
/** A template key and the props a send would pass it. */
|
|
165
188
|
export type PreviewEmailInput = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.22.0";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by scripts/version.ts from package.json. Do not edit.
|
|
2
|
-
export const SDK_VERSION = "0.
|
|
2
|
+
export const SDK_VERSION = "0.22.0";
|