@cowliss/sdk 0.18.0 → 0.18.1

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 CHANGED
@@ -4,6 +4,12 @@
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.18.1 (2026-10-01)
8
+
9
+ ### Fixes
10
+
11
+ - A retried emails.send carries one Idempotency-Key, so it never sends twice
12
+
7
13
  ## 0.18.0 (2026-10-01)
8
14
 
9
15
  ### Features
package/dist/index.d.ts CHANGED
@@ -98,7 +98,9 @@ export declare class Cow {
98
98
  *
99
99
  * Synchronous like the rest of the client: the promise resolves once the
100
100
  * message has been handed over, and `deliveryId` is the row that records
101
- * what happened to it.
101
+ * what happened to it. Each call carries its own Idempotency-Key on every
102
+ * attempt, so a retry after a lost reply answers with the first send's
103
+ * `deliveryId` instead of sending again.
102
104
  */
103
105
  emails: {
104
106
  send: (input: WithDefaultSource<SendEmailInput>) => Promise<SendEmailResult>;
package/dist/index.js CHANGED
@@ -120,12 +120,12 @@ export class Cow {
120
120
  *
121
121
  * Synchronous like the rest of the client: the promise resolves once the
122
122
  * message has been handed over, and `deliveryId` is the row that records
123
- * what happened to it.
123
+ * what happened to it. Each call carries its own Idempotency-Key on every
124
+ * attempt, so a retry after a lost reply answers with the first send's
125
+ * `deliveryId` instead of sending again.
124
126
  */
125
127
  emails = {
126
- send: (input) => this.#watch(async () => this.#post("/v1/emails", {
127
- data: { ...input, sourceId: this.#sourceFor(input) },
128
- })),
128
+ send: (input) => this.#watch(async () => this.#post("/v1/emails", { data: { ...input, sourceId: this.#sourceFor(input) } }, crypto.randomUUID())),
129
129
  };
130
130
  /**
131
131
  * A link to one person's hosted email preferences page, for your app's own
@@ -164,8 +164,8 @@ export class Cow {
164
164
  });
165
165
  // Reading the body is part of the attempt: an abort or a truncated
166
166
  // response mid-read is a transport failure like any other, and
167
- // retrying it is safe (track carries its Idempotency-Key, identify
168
- // upserts on identifiers).
167
+ // retrying it is safe (track and emails.send carry an
168
+ // Idempotency-Key, identify upserts on identifiers).
169
169
  if (res.ok) {
170
170
  return (await res.json()).data;
171
171
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.18.0";
1
+ export declare const SDK_VERSION = "0.18.1";
@@ -1,2 +1,2 @@
1
1
  // Generated by scripts/version.ts from package.json. Do not edit.
2
- export const SDK_VERSION = "0.18.0";
2
+ export const SDK_VERSION = "0.18.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cowliss/sdk",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {