@zinn-digital/sdk 0.1.1708 → 0.1.1712
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 +153 -0
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -212787,6 +212881,65 @@ export interface operations {
|
|
|
212787
212881
|
503: components["responses"]["ServiceUnavailable"];
|
|
212788
212882
|
};
|
|
212789
212883
|
};
|
|
212884
|
+
getStoreOrderMessages: {
|
|
212885
|
+
parameters: {
|
|
212886
|
+
query?: never;
|
|
212887
|
+
header?: never;
|
|
212888
|
+
path: {
|
|
212889
|
+
/** @description The store's order id. */
|
|
212890
|
+
ref: string;
|
|
212891
|
+
};
|
|
212892
|
+
cookie?: never;
|
|
212893
|
+
};
|
|
212894
|
+
requestBody?: never;
|
|
212895
|
+
responses: {
|
|
212896
|
+
/** @description The order's updates. */
|
|
212897
|
+
200: {
|
|
212898
|
+
headers: {
|
|
212899
|
+
[name: string]: unknown;
|
|
212900
|
+
};
|
|
212901
|
+
content: {
|
|
212902
|
+
"application/json": components["schemas"]["StoreOrderMessages"];
|
|
212903
|
+
};
|
|
212904
|
+
};
|
|
212905
|
+
401: components["responses"]["Unauthorized"];
|
|
212906
|
+
422: components["responses"]["UnprocessableEntity"];
|
|
212907
|
+
429: components["responses"]["TooManyRequests"];
|
|
212908
|
+
};
|
|
212909
|
+
};
|
|
212910
|
+
sendStoreOrderUpdate: {
|
|
212911
|
+
parameters: {
|
|
212912
|
+
query?: never;
|
|
212913
|
+
header?: never;
|
|
212914
|
+
path: {
|
|
212915
|
+
/** @description The store's order id. */
|
|
212916
|
+
ref: string;
|
|
212917
|
+
};
|
|
212918
|
+
cookie?: never;
|
|
212919
|
+
};
|
|
212920
|
+
requestBody: {
|
|
212921
|
+
content: {
|
|
212922
|
+
"application/json": components["schemas"]["StoreOrderUpdateInput"];
|
|
212923
|
+
};
|
|
212924
|
+
};
|
|
212925
|
+
responses: {
|
|
212926
|
+
/** @description Booked; the update is being sent. */
|
|
212927
|
+
202: {
|
|
212928
|
+
headers: {
|
|
212929
|
+
[name: string]: unknown;
|
|
212930
|
+
};
|
|
212931
|
+
content: {
|
|
212932
|
+
"application/json": components["schemas"]["StoreOrderUpdateBooked"];
|
|
212933
|
+
};
|
|
212934
|
+
};
|
|
212935
|
+
401: components["responses"]["Unauthorized"];
|
|
212936
|
+
403: components["responses"]["Forbidden"];
|
|
212937
|
+
404: components["responses"]["NotFound"];
|
|
212938
|
+
422: components["responses"]["UnprocessableEntity"];
|
|
212939
|
+
429: components["responses"]["TooManyRequests"];
|
|
212940
|
+
503: components["responses"]["ServiceUnavailable"];
|
|
212941
|
+
};
|
|
212942
|
+
};
|
|
212790
212943
|
readStoreShopper: {
|
|
212791
212944
|
parameters: {
|
|
212792
212945
|
query?: never;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zinn-digital/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1712",
|
|
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>",
|