@zinn-digital/sdk 0.1.1708 → 0.1.1713

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.
@@ -57180,6 +57180,46 @@ export interface paths {
57180
57180
  patch?: never;
57181
57181
  trace?: never;
57182
57182
  };
57183
+ "/v1/store-connect/orders/{ref}/messages": {
57184
+ parameters: {
57185
+ query?: never;
57186
+ header?: never;
57187
+ path?: never;
57188
+ cookie?: never;
57189
+ };
57190
+ /**
57191
+ * The store plugin reads one order's update history (sent, not sent and why, failed).
57192
+ * @description Store token only. Feeds the plugin's `zinn-ou/get-order-messages` ability (docs/1297 §22.3, `edit_shop_orders` in WordPress). Every update the engine handled for this ONE order of the token's ONE store, newest first, at most 50: another store's events, even of the same organisation and with the same order ref, are never returned. `reason` is the refusal code of an update not sent (`noConsent`, `accountOnHold`, …) or the failure class of one that failed (`provider_outage` when the messaging vendor was at fault, `our_fault` when we were, `permanent`, …). The shopper's number is masked to its last three digits. `templates` lists the approved kinds `sendStoreOrderUpdate` takes.
57193
+ */
57194
+ get: operations["getStoreOrderMessages"];
57195
+ put?: never;
57196
+ post?: never;
57197
+ delete?: never;
57198
+ options?: never;
57199
+ head?: never;
57200
+ patch?: never;
57201
+ trace?: never;
57202
+ };
57203
+ "/v1/store-connect/orders/{ref}/updates": {
57204
+ parameters: {
57205
+ query?: never;
57206
+ header?: never;
57207
+ path?: never;
57208
+ cookie?: never;
57209
+ };
57210
+ get?: never;
57211
+ put?: never;
57212
+ /**
57213
+ * The store plugin sends one order's shopper an update from an approved template.
57214
+ * @description Store token only. Feeds the plugin's `zinn-ou/send-order-update` ability (docs/1297 §22.3, `edit_shop_orders` in WordPress). `kind` is one of the approved, translated templates (never free text); the text goes to the order's own shopper, in their language, from the order's last event (a phone number is never taken from the request). The update is a new event sent by the same durable workflow as `ingestStoreEvents`, so every Campaigns guard applies: the shopper's order-updates consent, the line and channel switches, good standing, the STOP opt-out, the spike pause, the own sender and prepaid credit. Its outcome is read back with `getStoreOrderMessages`. `request_id` is the idempotency key for the order, whatever the `kind`: a repeat (even with another `kind`) books nothing and answers the FIRST update with `duplicate: true`. 403 when the account is on hold (nothing is booked), 404 when the engine has no event for the order, 429 after five staff-sent updates to one order in a day, 503 when the workflow service is down (the booking is kept; a retry with the same `request_id` starts it).
57215
+ */
57216
+ post: operations["sendStoreOrderUpdate"];
57217
+ delete?: never;
57218
+ options?: never;
57219
+ head?: never;
57220
+ patch?: never;
57221
+ trace?: never;
57222
+ };
57183
57223
  "/v1/store-connect/shopper": {
57184
57224
  parameters: {
57185
57225
  query?: never;
@@ -112814,6 +112854,60 @@ export interface components {
112814
112854
  /** @description Events already handled (never sent twice). */
112815
112855
  duplicates: number;
112816
112856
  };
112857
+ StoreOrderMessage: {
112858
+ /** @enum {string} */
112859
+ channel: "sms" | "whatsapp";
112860
+ /** @description The carrier's receipt for a sent text: `awaiting`, `delivered`, `failed` or `unconfirmed`; null when nothing was sent. */
112861
+ delivery: string | null;
112862
+ /** Format: uuid */
112863
+ id: string;
112864
+ kind: string;
112865
+ /** @description The language it went out in; empty until sent. */
112866
+ locale: string;
112867
+ /** Format: date-time */
112868
+ occurred_at: string;
112869
+ /** @enum {string} */
112870
+ outcome: "pending" | "processing" | "sent" | "skipped" | "failed";
112871
+ /** @description SMS parts billed; null when nothing was sent. */
112872
+ parts: number | null;
112873
+ /** Format: date-time */
112874
+ processed_at: string | null;
112875
+ /** @description Why it was not sent (a refusal code) or how it failed (a failure class); empty when sent. */
112876
+ reason: string;
112877
+ /**
112878
+ * @description `store` = the order's own status change; `staff` = sent by hand.
112879
+ * @enum {string}
112880
+ */
112881
+ source: "store" | "staff";
112882
+ /** @description The shopper's number, last three digits only. */
112883
+ to: string;
112884
+ };
112885
+ StoreOrderMessages: {
112886
+ messages: components["schemas"]["StoreOrderMessage"][];
112887
+ ref: string;
112888
+ /** @description The approved kinds `sendStoreOrderUpdate` accepts. */
112889
+ templates: ("order_received" | "payment_confirmed" | "on_hold" | "shipped" | "completed" | "ready_for_pickup" | "payment_failed" | "cancelled" | "refunded")[];
112890
+ };
112891
+ StoreOrderUpdateBooked: {
112892
+ /** @description The request_id was seen before; nothing new was booked. */
112893
+ duplicate: boolean;
112894
+ /** Format: uuid */
112895
+ id: string;
112896
+ kind: string;
112897
+ /** @enum {string} */
112898
+ outcome: "pending" | "processing" | "sent" | "skipped" | "failed";
112899
+ };
112900
+ StoreOrderUpdateInput: {
112901
+ /** @enum {string} */
112902
+ kind: "order_received" | "payment_confirmed" | "on_hold" | "shipped" | "completed" | "ready_for_pickup" | "payment_failed" | "cancelled" | "refunded";
112903
+ /** @description Idempotency key per order, across every `kind`: a reused id returns the first update and books nothing. */
112904
+ request_id: string;
112905
+ /**
112906
+ * Format: uri
112907
+ * @description An absolute https URL whose host is a public DNS name (not percent-encoded, not an IP literal, loopback or bare name; punycode allowed), a numeric port 1-65535 if any, no userinfo, no space, separator or control character of any script (422 `urlInvalid` otherwise); replaces the order's tracking link for a `shipped` update.
112908
+ */
112909
+ tracking_url?: string;
112910
+ };
112817
112911
  StoreShopper: {
112818
112912
  consents: {
112819
112913
  active: boolean;
@@ -193154,6 +193248,8 @@ export interface operations {
193154
193248
  * @description The email already has an account (sign in to complete the purchase), or a domain in the cart is no longer available. Nothing was created either way.
193155
193249
  *
193156
193250
  * The two are told apart by `error.code`, and a client MUST branch on it rather than on the status: the remedies are opposite. `ACCOUNT_EXISTS` means sign in and the basket follows you; the generic `CONFLICT` means a name went while it sat in the basket and the customer must search again. Until W42-N both returned `CONFLICT`, and the public funnel showed every returning customer the "your domain was taken" copy on the last click of a purchase.
193251
+ *
193252
+ * Or (`error.details[0].code` `COUPON_WITHDRAWN`, `field: promo_code`, docs/1311) a replayed checkout resumed an order whose coupon claim had lapsed and could not be re-taken: the code was removed and the order repriced to the full total before any gateway call, so nothing was charged. The keyed message (`refusal.commerce.couponWithdrawn`) states the new total; the public checkout shows its own localized sentence and re-quotes.
193157
193253
  */
193158
193254
  409: {
193159
193255
  headers: {
@@ -212787,6 +212883,65 @@ export interface operations {
212787
212883
  503: components["responses"]["ServiceUnavailable"];
212788
212884
  };
212789
212885
  };
212886
+ getStoreOrderMessages: {
212887
+ parameters: {
212888
+ query?: never;
212889
+ header?: never;
212890
+ path: {
212891
+ /** @description The store's order id. */
212892
+ ref: string;
212893
+ };
212894
+ cookie?: never;
212895
+ };
212896
+ requestBody?: never;
212897
+ responses: {
212898
+ /** @description The order's updates. */
212899
+ 200: {
212900
+ headers: {
212901
+ [name: string]: unknown;
212902
+ };
212903
+ content: {
212904
+ "application/json": components["schemas"]["StoreOrderMessages"];
212905
+ };
212906
+ };
212907
+ 401: components["responses"]["Unauthorized"];
212908
+ 422: components["responses"]["UnprocessableEntity"];
212909
+ 429: components["responses"]["TooManyRequests"];
212910
+ };
212911
+ };
212912
+ sendStoreOrderUpdate: {
212913
+ parameters: {
212914
+ query?: never;
212915
+ header?: never;
212916
+ path: {
212917
+ /** @description The store's order id. */
212918
+ ref: string;
212919
+ };
212920
+ cookie?: never;
212921
+ };
212922
+ requestBody: {
212923
+ content: {
212924
+ "application/json": components["schemas"]["StoreOrderUpdateInput"];
212925
+ };
212926
+ };
212927
+ responses: {
212928
+ /** @description Booked; the update is being sent. */
212929
+ 202: {
212930
+ headers: {
212931
+ [name: string]: unknown;
212932
+ };
212933
+ content: {
212934
+ "application/json": components["schemas"]["StoreOrderUpdateBooked"];
212935
+ };
212936
+ };
212937
+ 401: components["responses"]["Unauthorized"];
212938
+ 403: components["responses"]["Forbidden"];
212939
+ 404: components["responses"]["NotFound"];
212940
+ 422: components["responses"]["UnprocessableEntity"];
212941
+ 429: components["responses"]["TooManyRequests"];
212942
+ 503: components["responses"]["ServiceUnavailable"];
212943
+ };
212944
+ };
212790
212945
  readStoreShopper: {
212791
212946
  parameters: {
212792
212947
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinn-digital/sdk",
3
- "version": "0.1.1708",
3
+ "version": "0.1.1713",
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>",