@productcraft/mail 0.2.3 → 0.2.4

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 CHANGED
@@ -10,7 +10,7 @@ Server-side only. The SDK ships a Platform API Key in the `Authorization` header
10
10
 
11
11
  ## Quick start
12
12
 
13
- ```ts
13
+ ```ts before
14
14
  import { Mail } from "@productcraft/mail";
15
15
 
16
16
  // Reads PRODUCTCRAFT_API_KEY from the environment
@@ -53,7 +53,7 @@ PRODUCTCRAFT_API_KEY=pcft_live_...
53
53
 
54
54
  ## Configuration
55
55
 
56
- ```ts
56
+ ```ts before
57
57
  new Mail({
58
58
  // The auth credential the SDK presents to Mail
59
59
  // Omit to use PRODUCTCRAFT_API_KEY from the environment
@@ -73,7 +73,7 @@ Every path is workspace-scoped — `{workspace_id}` is the UUID of the workspace
73
73
 
74
74
  ### Templates
75
75
 
76
- ```ts
76
+ ```ts before
77
77
  // List templates
78
78
  await mail.client.GET(
79
79
  "/v1/workspaces/{workspace_id}/templates",
@@ -115,7 +115,7 @@ await mail.client.POST(
115
115
 
116
116
  ### Domains + DKIM
117
117
 
118
- ```ts
118
+ ```ts before
119
119
  // List domains
120
120
  await mail.client.GET("/v1/workspaces/{workspace_id}/domains", { ... });
121
121
 
@@ -134,7 +134,7 @@ await mail.client.POST(
134
134
 
135
135
  ### Messages
136
136
 
137
- ```ts
137
+ ```ts before
138
138
  // Workspace-wide message listing + filters
139
139
  await mail.client.GET(
140
140
  "/v1/workspaces/{workspace_id}/messages",
@@ -151,7 +151,7 @@ await mail.client.GET(
151
151
 
152
152
  ### Suppression list
153
153
 
154
- ```ts
154
+ ```ts before
155
155
  // Add an email to the workspace suppression list
156
156
  await mail.client.POST(
157
157
  "/v1/workspaces/{workspace_id}/suppression",
@@ -161,7 +161,7 @@ await mail.client.POST(
161
161
 
162
162
  ### Outbound webhooks
163
163
 
164
- ```ts
164
+ ```ts before
165
165
  // Configure the workspace's default webhook (delivery / open / bounce events)
166
166
  await mail.client.PUT(
167
167
  "/v1/workspaces/{workspace_id}/webhooks/default",
package/dist/index.d.cts CHANGED
@@ -2001,7 +2001,10 @@ interface paths {
2001
2001
  path?: never;
2002
2002
  cookie?: never;
2003
2003
  };
2004
- /** Get one webhook endpoint (without its secret). */
2004
+ /**
2005
+ * Get one webhook endpoint (without its secret).
2006
+ * @description The endpoint's URL, subscription, on/off state, failure streak and the last 4 characters of its signing secret. The full secret is only returned when the endpoint is created or its secret is rotated.
2007
+ */
2005
2008
  get: operations["WebhooksController_mail_workspace_getEndpoint"];
2006
2009
  put?: never;
2007
2010
  post?: never;
@@ -2106,7 +2109,10 @@ interface paths {
2106
2109
  path?: never;
2107
2110
  cookie?: never;
2108
2111
  };
2109
- /** Get one webhook event with every delivery attempt. */
2112
+ /**
2113
+ * Get one webhook event with every delivery attempt.
2114
+ * @description The event as it was sent (`type`, `data`) and every delivery attempt to every endpoint, with its trigger, HTTP status, error and the start of the response body. Use it to debug a receiver, then `replay` to send it again.
2115
+ */
2110
2116
  get: operations["WebhooksController_mail_workspace_getEvent"];
2111
2117
  put?: never;
2112
2118
  post?: never;
@@ -2764,8 +2770,9 @@ interface components {
2764
2770
  */
2765
2771
  domain_id?: string | null;
2766
2772
  /**
2767
- * @description Create it switched off.
2773
+ * @description Send `false` to create it switched off.
2768
2774
  * @default true
2775
+ * @example true
2769
2776
  */
2770
2777
  enabled: boolean;
2771
2778
  /**
@@ -5410,6 +5417,7 @@ interface components {
5410
5417
  /**
5411
5418
  * @description Hours the previous secret keeps signing too (0 ends it now).
5412
5419
  * @default 24
5420
+ * @example 24
5413
5421
  */
5414
5422
  grace_hours: number;
5415
5423
  };
@@ -6040,16 +6048,28 @@ interface components {
6040
6048
  visibility?: "public" | "private";
6041
6049
  };
6042
6050
  UpdateWebhookEndpointDto: {
6043
- /** @description A new label; null clears it. */
6051
+ /**
6052
+ * @description A new label; null clears it.
6053
+ * @example Production receiver
6054
+ */
6044
6055
  description?: string | null;
6045
6056
  /**
6046
6057
  * Format: uuid
6047
6058
  * @description Domain filter; null removes it. Not allowed on a legacy slot (its domain is what makes it one).
6048
6059
  */
6049
6060
  domain_id?: string | null;
6050
- /** @description Switch it on or off. Switching on also clears an automatic disable. */
6061
+ /**
6062
+ * @description Switch it on or off. Switching on also clears an automatic disable.
6063
+ * @example true
6064
+ */
6051
6065
  enabled?: boolean;
6052
- /** @description Replaces the subscription. Event types from `GET …/webhooks/event-types`. Empty or omitted means every event, including types added later. Older names (`message.sent`, `message.delivered`, `message.deferred`, `message.bounced`, `message.complained`, `message.failed`) are still accepted; an endpoint subscribed under one receives the event with that name as its `type`. */
6066
+ /**
6067
+ * @description Replaces the subscription. Event types from `GET …/webhooks/event-types`. Empty or omitted means every event, including types added later. Older names (`message.sent`, `message.delivered`, `message.deferred`, `message.bounced`, `message.complained`, `message.failed`) are still accepted; an endpoint subscribed under one receives the event with that name as its `type`.
6068
+ * @example [
6069
+ * "email.sent",
6070
+ * "email.delivered"
6071
+ * ]
6072
+ */
6053
6073
  event_types?: ("email.sent" | "email.delivered" | "email.delivery_delayed" | "email.bounced" | "email.complained" | "email.failed" | "email.suppressed" | "email.skipped" | "email.scheduled" | "email.canceled" | "email.opened" | "email.clicked" | "email.received" | "domain.created" | "domain.updated" | "domain.verified" | "domain.deleted" | "suppression.added" | "suppression.removed" | "sending_defaults.updated" | "contact.created" | "contact.updated" | "contact.deleted" | "message.sent" | "message.delivered" | "message.deferred" | "message.bounced" | "message.complained" | "message.failed")[];
6054
6074
  /** @description Replaces the subscription. Older name for `event_types`, accepted and returned until the legacy webhook routes are retired (Sunset: 2027-01-15). Send one of the two. */
6055
6075
  events?: ("email.sent" | "email.delivered" | "email.delivery_delayed" | "email.bounced" | "email.complained" | "email.failed" | "email.suppressed" | "email.skipped" | "email.scheduled" | "email.canceled" | "email.opened" | "email.clicked" | "email.received" | "domain.created" | "domain.updated" | "domain.verified" | "domain.deleted" | "suppression.added" | "suppression.removed" | "sending_defaults.updated" | "contact.created" | "contact.updated" | "contact.deleted" | "message.sent" | "message.delivered" | "message.deferred" | "message.bounced" | "message.complained" | "message.failed")[];
package/dist/index.d.ts CHANGED
@@ -2001,7 +2001,10 @@ interface paths {
2001
2001
  path?: never;
2002
2002
  cookie?: never;
2003
2003
  };
2004
- /** Get one webhook endpoint (without its secret). */
2004
+ /**
2005
+ * Get one webhook endpoint (without its secret).
2006
+ * @description The endpoint's URL, subscription, on/off state, failure streak and the last 4 characters of its signing secret. The full secret is only returned when the endpoint is created or its secret is rotated.
2007
+ */
2005
2008
  get: operations["WebhooksController_mail_workspace_getEndpoint"];
2006
2009
  put?: never;
2007
2010
  post?: never;
@@ -2106,7 +2109,10 @@ interface paths {
2106
2109
  path?: never;
2107
2110
  cookie?: never;
2108
2111
  };
2109
- /** Get one webhook event with every delivery attempt. */
2112
+ /**
2113
+ * Get one webhook event with every delivery attempt.
2114
+ * @description The event as it was sent (`type`, `data`) and every delivery attempt to every endpoint, with its trigger, HTTP status, error and the start of the response body. Use it to debug a receiver, then `replay` to send it again.
2115
+ */
2110
2116
  get: operations["WebhooksController_mail_workspace_getEvent"];
2111
2117
  put?: never;
2112
2118
  post?: never;
@@ -2764,8 +2770,9 @@ interface components {
2764
2770
  */
2765
2771
  domain_id?: string | null;
2766
2772
  /**
2767
- * @description Create it switched off.
2773
+ * @description Send `false` to create it switched off.
2768
2774
  * @default true
2775
+ * @example true
2769
2776
  */
2770
2777
  enabled: boolean;
2771
2778
  /**
@@ -5410,6 +5417,7 @@ interface components {
5410
5417
  /**
5411
5418
  * @description Hours the previous secret keeps signing too (0 ends it now).
5412
5419
  * @default 24
5420
+ * @example 24
5413
5421
  */
5414
5422
  grace_hours: number;
5415
5423
  };
@@ -6040,16 +6048,28 @@ interface components {
6040
6048
  visibility?: "public" | "private";
6041
6049
  };
6042
6050
  UpdateWebhookEndpointDto: {
6043
- /** @description A new label; null clears it. */
6051
+ /**
6052
+ * @description A new label; null clears it.
6053
+ * @example Production receiver
6054
+ */
6044
6055
  description?: string | null;
6045
6056
  /**
6046
6057
  * Format: uuid
6047
6058
  * @description Domain filter; null removes it. Not allowed on a legacy slot (its domain is what makes it one).
6048
6059
  */
6049
6060
  domain_id?: string | null;
6050
- /** @description Switch it on or off. Switching on also clears an automatic disable. */
6061
+ /**
6062
+ * @description Switch it on or off. Switching on also clears an automatic disable.
6063
+ * @example true
6064
+ */
6051
6065
  enabled?: boolean;
6052
- /** @description Replaces the subscription. Event types from `GET …/webhooks/event-types`. Empty or omitted means every event, including types added later. Older names (`message.sent`, `message.delivered`, `message.deferred`, `message.bounced`, `message.complained`, `message.failed`) are still accepted; an endpoint subscribed under one receives the event with that name as its `type`. */
6066
+ /**
6067
+ * @description Replaces the subscription. Event types from `GET …/webhooks/event-types`. Empty or omitted means every event, including types added later. Older names (`message.sent`, `message.delivered`, `message.deferred`, `message.bounced`, `message.complained`, `message.failed`) are still accepted; an endpoint subscribed under one receives the event with that name as its `type`.
6068
+ * @example [
6069
+ * "email.sent",
6070
+ * "email.delivered"
6071
+ * ]
6072
+ */
6053
6073
  event_types?: ("email.sent" | "email.delivered" | "email.delivery_delayed" | "email.bounced" | "email.complained" | "email.failed" | "email.suppressed" | "email.skipped" | "email.scheduled" | "email.canceled" | "email.opened" | "email.clicked" | "email.received" | "domain.created" | "domain.updated" | "domain.verified" | "domain.deleted" | "suppression.added" | "suppression.removed" | "sending_defaults.updated" | "contact.created" | "contact.updated" | "contact.deleted" | "message.sent" | "message.delivered" | "message.deferred" | "message.bounced" | "message.complained" | "message.failed")[];
6054
6074
  /** @description Replaces the subscription. Older name for `event_types`, accepted and returned until the legacy webhook routes are retired (Sunset: 2027-01-15). Send one of the two. */
6055
6075
  events?: ("email.sent" | "email.delivered" | "email.delivery_delayed" | "email.bounced" | "email.complained" | "email.failed" | "email.suppressed" | "email.skipped" | "email.scheduled" | "email.canceled" | "email.opened" | "email.clicked" | "email.received" | "domain.created" | "domain.updated" | "domain.verified" | "domain.deleted" | "suppression.added" | "suppression.removed" | "sending_defaults.updated" | "contact.created" | "contact.updated" | "contact.deleted" | "message.sent" | "message.delivered" | "message.deferred" | "message.bounced" | "message.complained" | "message.failed")[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@productcraft/mail",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Receive-and-store mail platform — template-rendered sends, mailboxes + domains + DKIM, message timeline, suppression lists, outbound webhooks via ProductCraft Mail. Generated from the production OpenAPI spec.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",