@zinn-digital/sdk 0.1.1812 → 0.1.1813
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/dist/generated/schema.d.ts +40 -13
- package/package.json +1 -1
|
@@ -35180,8 +35180,8 @@ export interface paths {
|
|
|
35180
35180
|
get?: never;
|
|
35181
35181
|
put?: never;
|
|
35182
35182
|
/**
|
|
35183
|
-
* Send one SMS to one contact
|
|
35184
|
-
* @description Gated on `email_marketing.manage`. Every guard runs before the provider is called: the line and SMS switches, the account's good standing, the contact's SMS consent, this organisation's spike pause, an open country, and the credit — the price (parts x the country's price per part) is debited BEFORE sending and returned if the network refuses the message. Refusals carry a `refusal.campaigns.channel*` key: `CAMPAIGNS_NO_CREDIT` (402), `CAMPAIGNS_NO_CONSENT` / `CAMPAIGNS_SUPPRESSED` / `CAMPAIGNS_NO_PHONE` / `CAMPAIGNS_PAUSED` (409), `CAMPAIGNS_UNPRICED` / `CAMPAIGNS_COUNTRY_NOT_OPEN` / `CAMPAIGNS_VENDOR_REFUSED` (422), `CAMPAIGNS_TOO_LONG` (400), `CAMPAIGNS_NOT_OPEN` / `CAMPAIGNS_CHANNEL_OFF` / `CAMPAIGNS_ACCOUNT_ON_HOLD` (403), and `CAMPAIGNS_VENDOR_UNAVAILABLE` / `CAMPAIGNS_NOT_CONFIGURED` (503). One message per call; audited (`email_marketing.message.send`).
|
|
35183
|
+
* Send one SMS or WhatsApp message to one contact.
|
|
35184
|
+
* @description Gated on `email_marketing.manage`. `channel: whatsapp` sends a Meta-approved `template` (with `template_language` and up to 20 `template_params`) from the organisation's OWN WhatsApp Business account; it costs 0 Zinn® credit (Meta bills that account) and still checks good standing, WhatsApp consent and the WhatsApp spike pause. A missing or malformed template is refused with `CAMPAIGNS_TEMPLATE_REQUIRED` (400) before anything else; no own account is `CAMPAIGNS_OWN_SENDER_REQUIRED` (409). An SMS is paid from the Zinn® credit balance. Every guard runs before the provider is called: the line and SMS switches, the account's good standing, the contact's SMS consent, this organisation's spike pause, an open country, and the credit — the price (parts x the country's price per part) is debited BEFORE sending and returned if the network refuses the message. Refusals carry a `refusal.campaigns.channel*` key: `CAMPAIGNS_NO_CREDIT` (402), `CAMPAIGNS_NO_CONSENT` / `CAMPAIGNS_SUPPRESSED` / `CAMPAIGNS_NO_PHONE` / `CAMPAIGNS_PAUSED` (409), `CAMPAIGNS_UNPRICED` / `CAMPAIGNS_COUNTRY_NOT_OPEN` / `CAMPAIGNS_VENDOR_REFUSED` (422), `CAMPAIGNS_TOO_LONG` (400), `CAMPAIGNS_NOT_OPEN` / `CAMPAIGNS_CHANNEL_OFF` / `CAMPAIGNS_ACCOUNT_ON_HOLD` (403), and `CAMPAIGNS_VENDOR_UNAVAILABLE` / `CAMPAIGNS_NOT_CONFIGURED` (503). One message per call; audited (`email_marketing.message.send`).
|
|
35185
35185
|
*/
|
|
35186
35186
|
post: operations["sendEmailMarketingMessage"];
|
|
35187
35187
|
delete?: never;
|
|
@@ -35642,14 +35642,14 @@ export interface paths {
|
|
|
35642
35642
|
cookie?: never;
|
|
35643
35643
|
};
|
|
35644
35644
|
/**
|
|
35645
|
-
* Bulk SMS campaigns, newest first, one keyset page.
|
|
35646
|
-
* @description Gated on `email_marketing.view`.
|
|
35645
|
+
* Bulk SMS and WhatsApp campaigns, newest first, one keyset page.
|
|
35646
|
+
* @description Gated on `email_marketing.view`. `channel` narrows the page to one channel.
|
|
35647
35647
|
*/
|
|
35648
35648
|
get: operations["listSmsMarketingCampaigns"];
|
|
35649
35649
|
put?: never;
|
|
35650
35650
|
/**
|
|
35651
|
-
* Create a draft SMS to a list.
|
|
35652
|
-
* @description Gated on `email_marketing.manage`.
|
|
35651
|
+
* Create a draft SMS or WhatsApp campaign to a list.
|
|
35652
|
+
* @description Gated on `email_marketing.manage`. `channel: whatsapp` sends an approved template from the organisation's own WhatsApp Business account (named "WhatsApp campaign" by default).
|
|
35653
35653
|
*/
|
|
35654
35654
|
post: operations["createSmsMarketingCampaign"];
|
|
35655
35655
|
delete?: never;
|
|
@@ -35713,7 +35713,7 @@ export interface paths {
|
|
|
35713
35713
|
put?: never;
|
|
35714
35714
|
/**
|
|
35715
35715
|
* Start sending an SMS to everyone on its list who agreed to SMS — or resume one paused for credit.
|
|
35716
|
-
* @description Gated on `email_marketing.manage`. The gate runs first, in order: the line is open, SMS is open to the account, the account is in good standing, the campaign is complete and within the length limit, SMS is not paused, someone on the list may be texted (a member, subscribed, with a number, an SMS consent and no STOP), and staff have reviewed a send above the review size. Each refusal is its own `409` code (`CAMPAIGNS_SMS_<CODE>`). On `202` a durable workflow sends in batches; each message is priced and paid from the account's credit before it leaves. When the credit runs out the campaign pauses (`no_credit`) and this call resumes it after a top-up. STOP replies or carrier rejections over the line pause the account's SMS; staff resume it.
|
|
35716
|
+
* @description Gated on `email_marketing.manage`. The gate runs first, in order: the line is open, SMS is open to the account, the account is in good standing, the campaign is complete and within the length limit, SMS is not paused, someone on the list may be texted (a member, subscribed, with a number, an SMS consent and no STOP), and staff have reviewed a send above the review size. Each refusal is its own `409` code (`CAMPAIGNS_SMS_<CODE>`). On `202` a durable workflow sends in batches; each message is priced and paid from the account's credit before it leaves. When the credit runs out the campaign pauses (`no_credit`) and this call resumes it after a top-up. STOP replies or carrier rejections over the line pause the account's SMS; staff resume it. A `whatsapp` campaign runs the same gate on WhatsApp's own switch, consent and pause, needs a complete template and the organisation's own connected WhatsApp Business account (`own_sender_required`), and costs 0 Zinn® credit (Meta bills that account). If Meta stops accepting that account's messages the campaign pauses as `whatsapp_not_ready`; the customer fixes the account and this call resumes it. A WhatsApp pause never pauses SMS campaigns, and the reverse.
|
|
35717
35717
|
*/
|
|
35718
35718
|
post: operations["sendSmsMarketingCampaign"];
|
|
35719
35719
|
delete?: never;
|
|
@@ -87636,6 +87636,10 @@ export interface components {
|
|
|
87636
87636
|
whatsapp_connected: boolean;
|
|
87637
87637
|
whatsapp_display_phone: string;
|
|
87638
87638
|
whatsapp_health: components["schemas"]["EmailMarketingWhatsappHealth"];
|
|
87639
|
+
/** @description WhatsApp sending is open to this organisation (line, account and switch). */
|
|
87640
|
+
whatsapp_open: boolean;
|
|
87641
|
+
/** @description WhatsApp sending is paused for this organisation (its own spike pause). */
|
|
87642
|
+
whatsapp_paused: boolean;
|
|
87639
87643
|
/** @description Embedded Signup's app and configuration ids; null when not offered yet. */
|
|
87640
87644
|
whatsapp_signup: {
|
|
87641
87645
|
app_id: string;
|
|
@@ -114656,9 +114660,11 @@ export interface components {
|
|
|
114656
114660
|
uptime_target_percent: string;
|
|
114657
114661
|
};
|
|
114658
114662
|
SmsMarketingCampaign: {
|
|
114663
|
+
/** @enum {string} */
|
|
114664
|
+
channel: "sms" | "whatsapp";
|
|
114659
114665
|
/** Format: date-time */
|
|
114660
114666
|
created_at: string;
|
|
114661
|
-
/** @description Paused for credit; `send` resumes it
|
|
114667
|
+
/** @description Paused for something the customer fixes (credit, their own sender, or Meta not accepting their WhatsApp account's messages); `send` resumes it once fixed. */
|
|
114662
114668
|
customer_can_resume: boolean;
|
|
114663
114669
|
/** Format: date-time */
|
|
114664
114670
|
finished_at: string | null;
|
|
@@ -114669,12 +114675,15 @@ export interface components {
|
|
|
114669
114675
|
name: string;
|
|
114670
114676
|
recipients_total: number;
|
|
114671
114677
|
/** @enum {string|null} */
|
|
114672
|
-
refusal_code: "not_open" | "channel_off" | "account_on_hold" | "incomplete" | "too_long" | "paused" | "empty" | "review" | "no_credit" | "not_configured" | null;
|
|
114678
|
+
refusal_code: "not_open" | "channel_off" | "account_on_hold" | "incomplete" | "too_long" | "paused" | "empty" | "review" | "no_credit" | "not_configured" | "own_sender_required" | "whatsapp_not_ready" | null;
|
|
114673
114679
|
refusal_message: string | null;
|
|
114674
114680
|
/** Format: date-time */
|
|
114675
114681
|
started_at: string | null;
|
|
114676
114682
|
/** @enum {string} */
|
|
114677
114683
|
status: "draft" | "sending" | "paused" | "sent" | "refused";
|
|
114684
|
+
template: string | null;
|
|
114685
|
+
template_language: string | null;
|
|
114686
|
+
template_params: string[];
|
|
114678
114687
|
text: string;
|
|
114679
114688
|
/** Format: date-time */
|
|
114680
114689
|
updated_at: string;
|
|
@@ -114707,9 +114716,20 @@ export interface components {
|
|
|
114707
114716
|
undelivered: number;
|
|
114708
114717
|
};
|
|
114709
114718
|
SmsMarketingCampaignWrite: {
|
|
114719
|
+
/**
|
|
114720
|
+
* @description Chosen while the campaign is a draft. `whatsapp` sends `template` from the organisation's OWN WhatsApp Business account (0 Zinn® credit; Meta bills that account).
|
|
114721
|
+
* @enum {string}
|
|
114722
|
+
*/
|
|
114723
|
+
channel?: "sms" | "whatsapp";
|
|
114710
114724
|
/** Format: uuid */
|
|
114711
114725
|
list_id?: string | null;
|
|
114712
114726
|
name?: string;
|
|
114727
|
+
/** @description WhatsApp only — the name of a template Meta approved for this account. */
|
|
114728
|
+
template?: string;
|
|
114729
|
+
/** @description WhatsApp only — the template's language code */
|
|
114730
|
+
template_language?: string;
|
|
114731
|
+
/** @description WhatsApp only — the values for the template body's `{{1}}`, `{{2}}`, … in order (the same for every recipient). */
|
|
114732
|
+
template_params?: string[];
|
|
114713
114733
|
/** @description The message. Longer than 160 GSM-7 characters is sent (and priced) as several parts. */
|
|
114714
114734
|
text?: string;
|
|
114715
114735
|
};
|
|
@@ -180376,9 +180396,15 @@ export interface operations {
|
|
|
180376
180396
|
* @default sms
|
|
180377
180397
|
* @enum {string}
|
|
180378
180398
|
*/
|
|
180379
|
-
channel?: "sms";
|
|
180380
|
-
/** @description
|
|
180381
|
-
|
|
180399
|
+
channel?: "sms" | "whatsapp";
|
|
180400
|
+
/** @description WhatsApp only (required): the name of a template Meta approved for this organisation's WhatsApp Business account (lower-case letters, digits, `_`). */
|
|
180401
|
+
template?: string;
|
|
180402
|
+
/** @description WhatsApp only (required) — the template's language code, e.g. `en_GB`. */
|
|
180403
|
+
template_language?: string;
|
|
180404
|
+
/** @description WhatsApp only — the values for the template body's `{{1}}`, `{{2}}`, … in order. */
|
|
180405
|
+
template_params?: string[];
|
|
180406
|
+
/** @description The SMS text (required for `sms`; ignored for `whatsapp`). At most 1,530 characters (10 parts) are sent. */
|
|
180407
|
+
text?: string;
|
|
180382
180408
|
};
|
|
180383
180409
|
};
|
|
180384
180410
|
};
|
|
@@ -180392,7 +180418,7 @@ export interface operations {
|
|
|
180392
180418
|
"application/json": components["schemas"]["EmailMarketingMessage"];
|
|
180393
180419
|
};
|
|
180394
180420
|
};
|
|
180395
|
-
/** @description The text is missing or too long (`CAMPAIGNS_TOO_LONG`). */
|
|
180421
|
+
/** @description The text is missing or too long (`CAMPAIGNS_TOO_LONG`), or a WhatsApp send has no usable template (`CAMPAIGNS_TEMPLATE_REQUIRED`). */
|
|
180396
180422
|
400: {
|
|
180397
180423
|
headers: {
|
|
180398
180424
|
[name: string]: unknown;
|
|
@@ -181384,6 +181410,7 @@ export interface operations {
|
|
|
181384
181410
|
parameters: {
|
|
181385
181411
|
query?: {
|
|
181386
181412
|
after?: string;
|
|
181413
|
+
channel?: "sms" | "whatsapp";
|
|
181387
181414
|
limit?: number;
|
|
181388
181415
|
/** @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). */
|
|
181389
181416
|
org_id?: components["parameters"]["OrgIdQuery"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zinn-digital/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1813",
|
|
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>",
|