@zinn-digital/sdk 0.1.1585 → 0.1.1587

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.
@@ -33460,6 +33460,26 @@ export interface paths {
33460
33460
  patch?: never;
33461
33461
  trace?: never;
33462
33462
  };
33463
+ "/v1/email-marketing/ai/write": {
33464
+ parameters: {
33465
+ query?: never;
33466
+ header?: never;
33467
+ path?: never;
33468
+ cookie?: never;
33469
+ };
33470
+ get?: never;
33471
+ put?: never;
33472
+ /**
33473
+ * Write a draft campaign email from a short brief with Zinn® AI.
33474
+ * @description Gated on `email_marketing.manage`. One model call during the request, paid by the organisation's own provider key, its credit balance or its included AI allowance, and listed on the AI spend page as "Writing campaign emails". Returns two subject lines (for an A/B test), a preheader and a sanitised HTML body in the requested language; nothing is saved, the editor fills the campaign and the customer saves it. Refused with `402` while the account is on hold or there is no AI allowance left, and `422` with a `failure` object (provider outage, a problem with the customer's own key, or ours) when the model call fails. Nothing is charged for a failed call.
33475
+ */
33476
+ post: operations["writeEmailMarketingCampaignWithAi"];
33477
+ delete?: never;
33478
+ options?: never;
33479
+ head?: never;
33480
+ patch?: never;
33481
+ trace?: never;
33482
+ };
33463
33483
  "/v1/email-marketing/campaigns": {
33464
33484
  parameters: {
33465
33485
  query?: never;
@@ -33730,8 +33750,8 @@ export interface paths {
33730
33750
  get: operations["listEmailMarketingSenders"];
33731
33751
  put?: never;
33732
33752
  /**
33733
- * Connect the customer's own SMTP server for campaigns.
33734
- * @description Gated on `email_marketing.manage`. `kind` is `smtp` today (Amazon SES works through its SMTP interface); other kinds are refused until their adapter ships. The password goes to the secret store and is never returned. The connection starts `unverified`; call the verify endpoint to prove it. `409` when the organisation already has a connection with that name.
33753
+ * Connect a campaign sender (Zinn® sending, or the customer's own SMTP server).
33754
+ * @description Gated on `email_marketing.manage`. `kind` is `pool` (Zinn® sending through our marketing pool: send `name` and `from_address` only; the response carries `dkim_record`, the TXT record the From domain publishes, and verifying checks that it is live) or `smtp` (Amazon SES, Resend and Mailgun work through their SMTP interfaces); other kinds are refused until their adapter ships. An SMTP password goes to the secret store and is never returned. The connection starts `unverified`; call the verify endpoint to prove it. `409` when the organisation already has a connection with that name.
33735
33755
  */
33736
33756
  post: operations["createEmailMarketingSender"];
33737
33757
  delete?: never;
@@ -82466,6 +82486,26 @@ export interface components {
82466
82486
  rate_limit_per_min: number;
82467
82487
  route_through_proxy: boolean;
82468
82488
  };
82489
+ EmailMarketingAiDraft: {
82490
+ /** @description The body */
82491
+ html: string;
82492
+ model: string;
82493
+ preheader: string;
82494
+ subject_a: string;
82495
+ /** @description A second subject line for an A/B test. */
82496
+ subject_b: string;
82497
+ };
82498
+ EmailMarketingAiWriteRequest: {
82499
+ /** @description What the email is about */
82500
+ brief: string;
82501
+ /** @description The language to write in (a BCP 47 tag); defaults to en. */
82502
+ locale?: string;
82503
+ /**
82504
+ * @default friendly
82505
+ * @enum {string}
82506
+ */
82507
+ tone: "friendly" | "professional" | "playful" | "urgent" | "calm";
82508
+ };
82469
82509
  EmailMarketingCampaign: {
82470
82510
  /** Format: date-time */
82471
82511
  created_at: string;
@@ -82671,6 +82711,13 @@ export interface components {
82671
82711
  EmailMarketingSender: {
82672
82712
  /** Format: date-time */
82673
82713
  created_at: string;
82714
+ /** @description Pool senders only (kind pool, docs/1052 §10b): the TXT record the From domain publishes so Zinn® sending can DKIM-sign as that domain. The selector is per organisation. Null for your own SMTP, or when the key could not be read. */
82715
+ dkim_record: {
82716
+ name: string;
82717
+ /** @enum {string} */
82718
+ type: "TXT";
82719
+ value: string;
82720
+ } | null;
82674
82721
  from_address: string;
82675
82722
  host: string;
82676
82723
  /** Format: uuid */
@@ -82687,13 +82734,14 @@ export interface components {
82687
82734
  /** Format: date-time */
82688
82735
  verified_at: string | null;
82689
82736
  };
82737
+ /** @description `host`, `username` and `password` are required for `smtp` and ignored for `pool`. */
82690
82738
  EmailMarketingSenderCreate: {
82691
82739
  from_address: string;
82692
- host: string;
82740
+ host?: string;
82693
82741
  /** @enum {string} */
82694
- kind: "smtp";
82742
+ kind: "pool" | "smtp";
82695
82743
  name: string;
82696
- password: string;
82744
+ password?: string;
82697
82745
  /**
82698
82746
  * @default 587
82699
82747
  * @enum {integer}
@@ -82701,7 +82749,7 @@ export interface components {
82701
82749
  port: 25 | 465 | 587 | 2525;
82702
82750
  /** @enum {string} */
82703
82751
  tls?: "starttls" | "implicit";
82704
- username: string;
82752
+ username?: string;
82705
82753
  };
82706
82754
  EmailMarketingSenderList: {
82707
82755
  data: components["schemas"]["EmailMarketingSender"][];
@@ -171111,6 +171159,47 @@ export interface operations {
171111
171159
  403: components["responses"]["Forbidden"];
171112
171160
  };
171113
171161
  };
171162
+ writeEmailMarketingCampaignWithAi: {
171163
+ parameters: {
171164
+ query?: {
171165
+ /** @description The organization this call acts on. Optional for a caller with exactly one direct membership; **required** for anyone with more than one — which is every reseller and every agency — because the engine refuses rather than guesses (a wrong guess here writes one tenant's gateway credentials under another tenant's Vault path). */
171166
+ org_id?: components["parameters"]["OrgIdQuery"];
171167
+ };
171168
+ header?: never;
171169
+ path?: never;
171170
+ cookie?: never;
171171
+ };
171172
+ requestBody: {
171173
+ content: {
171174
+ "application/json": components["schemas"]["EmailMarketingAiWriteRequest"];
171175
+ };
171176
+ };
171177
+ responses: {
171178
+ /** @description The draft. */
171179
+ 200: {
171180
+ headers: {
171181
+ [name: string]: unknown;
171182
+ };
171183
+ content: {
171184
+ "application/json": components["schemas"]["EmailMarketingAiDraft"];
171185
+ };
171186
+ };
171187
+ 401: components["responses"]["Unauthorized"];
171188
+ /** @description The account is on hold, or there is no AI allowance left to pay for the call. */
171189
+ 402: {
171190
+ headers: {
171191
+ [name: string]: unknown;
171192
+ };
171193
+ content: {
171194
+ "application/json": components["schemas"]["Error"];
171195
+ };
171196
+ };
171197
+ 403: components["responses"]["Forbidden"];
171198
+ 404: components["responses"]["NotFound"];
171199
+ 409: components["responses"]["Conflict"];
171200
+ 422: components["responses"]["UnprocessableEntity"];
171201
+ };
171202
+ };
171114
171203
  listEmailMarketingCampaigns: {
171115
171204
  parameters: {
171116
171205
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinn-digital/sdk",
3
- "version": "0.1.1585",
3
+ "version": "0.1.1587",
4
4
  "description": "Typed TypeScript client for the Zinn Digital Platform API, generated from its OpenAPI spec.",
5
5
  "license": "MIT",
6
6
  "author": "Neil Lock \u2014 CEO, Zinn Digital\u00ae Ltd <office@zinndigital.com>",