@zinn-digital/sdk 0.1.1519 → 0.1.1520
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 +175 -0
- package/package.json +1 -1
|
@@ -20855,6 +20855,30 @@ export interface paths {
|
|
|
20855
20855
|
patch?: never;
|
|
20856
20856
|
trace?: never;
|
|
20857
20857
|
};
|
|
20858
|
+
"/v1/ads/events": {
|
|
20859
|
+
parameters: {
|
|
20860
|
+
query?: never;
|
|
20861
|
+
header?: never;
|
|
20862
|
+
path?: never;
|
|
20863
|
+
cookie?: never;
|
|
20864
|
+
};
|
|
20865
|
+
/**
|
|
20866
|
+
* The server events you sent, newest first, with what each connected network did.
|
|
20867
|
+
* @description Gated on `ads.view`. docs/1006.d/features/za-129-server-events.md, za-129. The newest 50 events sent to `sendAdsServerEvents`, each with one `deliveries` row per connected ad account: `pending` (waiting to upload), `uploaded`, `failed` (the network refused it; tried again later, `reason` says why), `skipped` (no click id or hashed e-mail for that network, consent `DENIED` for a network that cannot carry consent, no upload action for its kind, or older than the network's window), or `waiting` (not yet fanned out). `networks` lists the accounts an event goes to (Google Ads, Microsoft Advertising, Meta, X — never a disconnected one) and `waiting` counts events not yet fanned out. The org is the caller's only org, or `org_id`.
|
|
20868
|
+
*/
|
|
20869
|
+
get: operations["listAdsServerEvents"];
|
|
20870
|
+
put?: never;
|
|
20871
|
+
/**
|
|
20872
|
+
* The server events API — send a conversion once; it goes to every connected network.
|
|
20873
|
+
* @description Gated on `ads.manage`; audit action `ads.server_events_received`. docs/1006.d/features/za-129-server-events.md, za-129. Your server sends each conversion ONCE with your own `event_id`; it is stored once per organisation (a retry or a double send is a duplicate, listed in `duplicate_event_ids`) and then fanned out, in the background, to every connected ad account of the organisation (Google Ads offline / enhanced conversions, Microsoft offline conversions, the Meta Conversions API, the X Conversion API). `event_id` is the transaction / event id every network receives, so no network counts one conversion twice — send the same id from your browser pixel to dedupe the pair. A plain `email` is SHA-256-hashed at the door and dropped; never send other personal data. `consent` is kept as sent: Google receives it, and Meta and X are never sent an event whose consent is `DENIED`. Money is integer minor units plus an ISO 4217 currency. Up to 500 events per request (no limit on requests). Uploads follow each account's tracking settings (an upload action per kind, recovery on) and stop while an account is paused or its kill switch is on, or the subscription is not in good standing — they resume by themselves. `202` when any event was new; `200` when all were duplicates. A long-lived API key (`zdk_…`) holding `ads.manage` in the organisation authenticates here.
|
|
20874
|
+
*/
|
|
20875
|
+
post: operations["sendAdsServerEvents"];
|
|
20876
|
+
delete?: never;
|
|
20877
|
+
options?: never;
|
|
20878
|
+
head?: never;
|
|
20879
|
+
patch?: never;
|
|
20880
|
+
trace?: never;
|
|
20881
|
+
};
|
|
20858
20882
|
"/v1/ads/history-imports/{import_id}": {
|
|
20859
20883
|
parameters: {
|
|
20860
20884
|
query?: never;
|
|
@@ -68788,6 +68812,87 @@ export interface components {
|
|
|
68788
68812
|
value: number | string;
|
|
68789
68813
|
}[];
|
|
68790
68814
|
};
|
|
68815
|
+
AdsServerEvent: {
|
|
68816
|
+
/** @description Which click ids it carried (never their values). */
|
|
68817
|
+
click_ids: ("gclid" | "gbraid" | "wbraid" | "msclkid" | "fbclid" | "twclid")[];
|
|
68818
|
+
consent: string;
|
|
68819
|
+
currency: string;
|
|
68820
|
+
deliveries: components["schemas"]["AdsServerEventDelivery"][];
|
|
68821
|
+
event_id: string;
|
|
68822
|
+
/** Format: date-time */
|
|
68823
|
+
fanned_out_at: string | null;
|
|
68824
|
+
has_email_hash: boolean;
|
|
68825
|
+
kind: string;
|
|
68826
|
+
/** Format: date-time */
|
|
68827
|
+
occurred_at: string;
|
|
68828
|
+
/** Format: date-time */
|
|
68829
|
+
received_at: string;
|
|
68830
|
+
value_minor: number | null;
|
|
68831
|
+
};
|
|
68832
|
+
AdsServerEventDelivery: {
|
|
68833
|
+
/** Format: uuid */
|
|
68834
|
+
connection_id: string;
|
|
68835
|
+
/** @enum {string} */
|
|
68836
|
+
platform: "google" | "microsoft" | "meta" | "x";
|
|
68837
|
+
reason: string;
|
|
68838
|
+
/** @enum {string} */
|
|
68839
|
+
status: "waiting" | "not_sent" | "pending" | "uploaded" | "failed" | "skipped";
|
|
68840
|
+
/** Format: date-time */
|
|
68841
|
+
uploaded_at: string | null;
|
|
68842
|
+
};
|
|
68843
|
+
AdsServerEventIn: {
|
|
68844
|
+
/** @enum {string} */
|
|
68845
|
+
consent?: "" | "GRANTED" | "DENIED" | "UNSPECIFIED";
|
|
68846
|
+
/** @description ISO 4217; required with `value_minor`. */
|
|
68847
|
+
currency?: string;
|
|
68848
|
+
/**
|
|
68849
|
+
* Format: email
|
|
68850
|
+
* @description Hashed at the door (SHA-256 of the normalised address); never stored.
|
|
68851
|
+
*/
|
|
68852
|
+
email?: string;
|
|
68853
|
+
/** @description SHA-256 of the lower-cased */
|
|
68854
|
+
email_hash?: string;
|
|
68855
|
+
/** @description Your own id for this conversion (the order / trial / lead id). The dedupe key: per organisation here, and the transaction / event id at every network. */
|
|
68856
|
+
event_id: string;
|
|
68857
|
+
/** @description Meta's click id (the `fbclid` query parameter). */
|
|
68858
|
+
fbclid?: string;
|
|
68859
|
+
gbraid?: string;
|
|
68860
|
+
gclid?: string;
|
|
68861
|
+
/** @enum {string} */
|
|
68862
|
+
kind: "purchase" | "trial" | "lead" | "signup" | "activation" | "retained7" | "retained30" | "upgrade" | "free_listing";
|
|
68863
|
+
msclkid?: string;
|
|
68864
|
+
/** Format: date-time */
|
|
68865
|
+
occurred_at: string;
|
|
68866
|
+
/** @description X's click id (the `twclid` query parameter). */
|
|
68867
|
+
twclid?: string;
|
|
68868
|
+
/** @description Integer minor units (4999 = 49.99). A `free_listing` carries none. */
|
|
68869
|
+
value_minor?: number | null;
|
|
68870
|
+
wbraid?: string;
|
|
68871
|
+
};
|
|
68872
|
+
AdsServerEventList: {
|
|
68873
|
+
data: components["schemas"]["AdsServerEvent"][];
|
|
68874
|
+
networks: components["schemas"]["AdsServerEventNetwork"][];
|
|
68875
|
+
waiting: number;
|
|
68876
|
+
};
|
|
68877
|
+
AdsServerEventNetwork: {
|
|
68878
|
+
/** Format: uuid */
|
|
68879
|
+
connection_id: string;
|
|
68880
|
+
external_id: string;
|
|
68881
|
+
label: string;
|
|
68882
|
+
/** @enum {string} */
|
|
68883
|
+
platform: "google" | "microsoft" | "meta" | "x";
|
|
68884
|
+
/** @enum {string} */
|
|
68885
|
+
status: "active" | "paused";
|
|
68886
|
+
};
|
|
68887
|
+
AdsServerEventsReceived: {
|
|
68888
|
+
created: number;
|
|
68889
|
+
/** @description The first 50 duplicate ids. */
|
|
68890
|
+
duplicate_event_ids: string[];
|
|
68891
|
+
/** @description Events whose `event_id` was already stored (or repeated in this request). */
|
|
68892
|
+
duplicates: number;
|
|
68893
|
+
/** @description False only when nothing was new, or the background fan-out could not start (it then runs with the daily step). */
|
|
68894
|
+
fan_out_started: boolean;
|
|
68895
|
+
};
|
|
68791
68896
|
AdsShield: {
|
|
68792
68897
|
avg_cpc_minor: number;
|
|
68793
68898
|
by_reason: {
|
|
@@ -148896,6 +149001,76 @@ export interface operations {
|
|
|
148896
149001
|
429: components["responses"]["TooManyRequests"];
|
|
148897
149002
|
};
|
|
148898
149003
|
};
|
|
149004
|
+
listAdsServerEvents: {
|
|
149005
|
+
parameters: {
|
|
149006
|
+
query?: {
|
|
149007
|
+
org_id?: string;
|
|
149008
|
+
};
|
|
149009
|
+
header?: never;
|
|
149010
|
+
path?: never;
|
|
149011
|
+
cookie?: never;
|
|
149012
|
+
};
|
|
149013
|
+
requestBody?: never;
|
|
149014
|
+
responses: {
|
|
149015
|
+
/** @description The newest events. */
|
|
149016
|
+
200: {
|
|
149017
|
+
headers: {
|
|
149018
|
+
[name: string]: unknown;
|
|
149019
|
+
};
|
|
149020
|
+
content: {
|
|
149021
|
+
"application/json": components["schemas"]["AdsServerEventList"];
|
|
149022
|
+
};
|
|
149023
|
+
};
|
|
149024
|
+
401: components["responses"]["Unauthorized"];
|
|
149025
|
+
403: components["responses"]["Forbidden"];
|
|
149026
|
+
404: components["responses"]["NotFound"];
|
|
149027
|
+
422: components["responses"]["UnprocessableEntity"];
|
|
149028
|
+
};
|
|
149029
|
+
};
|
|
149030
|
+
sendAdsServerEvents: {
|
|
149031
|
+
parameters: {
|
|
149032
|
+
query?: {
|
|
149033
|
+
org_id?: string;
|
|
149034
|
+
};
|
|
149035
|
+
header?: never;
|
|
149036
|
+
path?: never;
|
|
149037
|
+
cookie?: never;
|
|
149038
|
+
};
|
|
149039
|
+
requestBody: {
|
|
149040
|
+
content: {
|
|
149041
|
+
"application/json": {
|
|
149042
|
+
events: components["schemas"]["AdsServerEventIn"][];
|
|
149043
|
+
/** Format: uuid */
|
|
149044
|
+
org_id?: string;
|
|
149045
|
+
};
|
|
149046
|
+
};
|
|
149047
|
+
};
|
|
149048
|
+
responses: {
|
|
149049
|
+
/** @description Every event was already stored (nothing new). */
|
|
149050
|
+
200: {
|
|
149051
|
+
headers: {
|
|
149052
|
+
[name: string]: unknown;
|
|
149053
|
+
};
|
|
149054
|
+
content: {
|
|
149055
|
+
"application/json": components["schemas"]["AdsServerEventsReceived"];
|
|
149056
|
+
};
|
|
149057
|
+
};
|
|
149058
|
+
/** @description Stored; the fan-out to every connected network has started. */
|
|
149059
|
+
202: {
|
|
149060
|
+
headers: {
|
|
149061
|
+
[name: string]: unknown;
|
|
149062
|
+
};
|
|
149063
|
+
content: {
|
|
149064
|
+
"application/json": components["schemas"]["AdsServerEventsReceived"];
|
|
149065
|
+
};
|
|
149066
|
+
};
|
|
149067
|
+
401: components["responses"]["Unauthorized"];
|
|
149068
|
+
403: components["responses"]["Forbidden"];
|
|
149069
|
+
404: components["responses"]["NotFound"];
|
|
149070
|
+
422: components["responses"]["UnprocessableEntity"];
|
|
149071
|
+
429: components["responses"]["TooManyRequests"];
|
|
149072
|
+
};
|
|
149073
|
+
};
|
|
148899
149074
|
getAdsHistoryImport: {
|
|
148900
149075
|
parameters: {
|
|
148901
149076
|
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.1520",
|
|
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>",
|