@zinn-digital/sdk 0.1.1481 → 0.1.1485

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.
@@ -16101,6 +16101,26 @@ export interface paths {
16101
16101
  patch?: never;
16102
16102
  trace?: never;
16103
16103
  };
16104
+ "/v1/ads/analytics/funnel": {
16105
+ parameters: {
16106
+ query?: never;
16107
+ header?: never;
16108
+ path?: never;
16109
+ cookie?: never;
16110
+ };
16111
+ /**
16112
+ * The funnel impression -> click -> conversion -> paid, and the customer's own measured outcomes beside the network's conversions (za-282).
16113
+ * @description Over the same filters as the other analytics reads. Impressions, clicks and conversions are the networks' stored daily figures under every filter. `paid` is the sales (purchases and upgrades, not refunded in full) the customer's OWN source recorded (store, checkout, plugin, CRM or the events API); a sale recorded on more than one ad account counts once per organisation. `truth` puts, per ad account that has ever sent an outcome, the conversions the network counted beside the outcomes the customer's own source recorded on the same days (the kinds the account's tracking settings compare), the gap, and the latest daily tracking-truth check. An account that never sent an outcome has no truth (never zero): it is counted in `untracked_accounts` and left out of both sides. Outcomes carry no campaign, country, device or product/site: with any of those filters `attributable` is false, `not_split_by` names them, `truth` and the `paid` step are null. Gated on `ads.view` over the organisations the person can view; `org_id` narrows to that organisation and its client organisations. Outcomes are windowed on each ad account's own day, in the account's stored time zone (UTC when none is stored yet), the same days as the network's figures and the daily tracking-truth check. A person who may view no organisation is refused (404), never answered with an empty frame. Stored rows only, never a network call. Money is integer micros of the reporting `currency` at the current stored rate (`fx`).
16114
+ */
16115
+ get: operations["getAdsAnalyticsFunnel"];
16116
+ put?: never;
16117
+ post?: never;
16118
+ delete?: never;
16119
+ options?: never;
16120
+ head?: never;
16121
+ patch?: never;
16122
+ trace?: never;
16123
+ };
16104
16124
  "/v1/ads/analytics/impact": {
16105
16125
  parameters: {
16106
16126
  query?: never;
@@ -19289,7 +19309,7 @@ export interface paths {
19289
19309
  put?: never;
19290
19310
  /**
19291
19311
  * The events API — send real outcomes (sales, trials, leads, sign-ups).
19292
- * @description Gated on `ads.manage`; audit action `ads.outcomes_received`. Up to 500 per request (send pages for a back-fill; no limit on pages). Idempotent per `(kind, external_ref)`: the same order twice is stored once, and a later copy that carries a click id the first lacked fills it in. `external_ref` is the order / trial id in YOUR system and is the transaction id every upload carries, so the network never counts one outcome twice. A plain `email` is SHA-256-hashed at the door and dropped. `201` when any was new. `free_listing` is a free sign-up that is not a sale: omit `value_minor` (or send `0` with `currency`) and map it to its own, usually secondary, upload action. `renewal` is a plugin subscription / licence renewed (za-96): it goes to its own secondary action (the plugin feed, `getAdsPluginFeed`), never counted as a new sale. `consent` is stored per conversion and passed to the network exactly as sent; withdraw an outcome with `retractAdsOutcomes`. A long-lived API key (`zdk_…`) holding `ads.manage` in the connection's organisation authenticates here. Anything new starts the upload within minutes (the daily run is the safety net).
19312
+ * @description Gated on `ads.manage` or `ads.outcomes.write` (KEYSCOPE — the narrow site-server key: exact-org, never inherited by a sub-account, accepted by this route and `retractAdsOutcomes` and by NO other route); audit action `ads.outcomes_received`. Up to 500 per request (send pages for a back-fill; no limit on pages). Idempotent per `(kind, external_ref)`: the same order twice is stored once, and a later copy that carries a click id the first lacked fills it in. `external_ref` is the order / trial id in YOUR system and is the transaction id every upload carries, so the network never counts one outcome twice. A plain `email` is SHA-256-hashed at the door and dropped. `201` when any was new. `free_listing` is a free sign-up that is not a sale: omit `value_minor` (or send `0` with `currency`) and map it to its own, usually secondary, upload action. `renewal` is a plugin subscription / licence renewed (za-96): it goes to its own secondary action (the plugin feed, `getAdsPluginFeed`), never counted as a new sale. `consent` is stored per conversion and passed to the network exactly as sent; withdraw an outcome with `retractAdsOutcomes`. A long-lived API key (`zdk_…`) holding `ads.outcomes.write` (or `ads.manage`) in the connection's organisation authenticates here. Anything new starts the upload within minutes (the daily run is the safety net).
19293
19313
  */
19294
19314
  post: operations["sendAdsOutcomes"];
19295
19315
  delete?: never;
@@ -19311,7 +19331,7 @@ export interface paths {
19311
19331
  put?: never;
19312
19332
  /**
19313
19333
  * Withdraw outcomes you sent, by your own id (a full refund).
19314
- * @description Gated on `ads.manage`; audit action `ads.outcomes_retracted`. Up to 500 per request. Each `(kind, external_ref)` is treated exactly like a sale refunded in full (za-122): one not uploaded yet is never uploaded (`withheld`); one already uploaded gets ONE retraction, which the next upload run sends to the network as a conversion adjustment (`retracted`; the run is started now when any was). Idempotent: an outcome withdrawn before, or refunded by its checkout provider, is `already`; an id this connection never received is `not_found`. The adjustment's progress shows on `listAdsTrackingEvents`. Nothing is charged.
19334
+ * @description Gated on `ads.manage` or `ads.outcomes.write` (KEYSCOPE — exact-org, see `sendAdsOutcomes`); audit action `ads.outcomes_retracted`. Up to 500 per request. Each `(kind, external_ref)` is treated exactly like a sale refunded in full (za-122): one not uploaded yet is never uploaded (`withheld`); one already uploaded gets ONE retraction, which the next upload run sends to the network as a conversion adjustment (`retracted`; the run is started now when any was). Idempotent: an outcome withdrawn before, or refunded by its checkout provider, is `already`; an id this connection never received is `not_found`. The adjustment's progress shows on `listAdsTrackingEvents`. Nothing is charged.
19315
19335
  */
19316
19336
  post: operations["retractAdsOutcomes"];
19317
19337
  delete?: never;
@@ -63723,6 +63743,31 @@ export interface components {
63723
63743
  /** @description Currencies left out of the blended figures for want of a stored rate; `???` stands for accounts whose currency is not known. */
63724
63744
  unconverted: string[];
63725
63745
  };
63746
+ AdsAnalyticsFunnel: components["schemas"]["AdsAnalyticsFrame"] & {
63747
+ /** @description `false` when a filter the customer's own outcomes cannot follow is set (they carry no campaign, country, device or product/site). */
63748
+ attributable: boolean;
63749
+ /** Format: int64 */
63750
+ network_value_micros: number;
63751
+ not_split_by: ("campaign" | "country" | "device" | "offering")[];
63752
+ /** Format: int64 */
63753
+ paid_value_micros: number | null;
63754
+ steps: components["schemas"]["AdsAnalyticsFunnelStep"][];
63755
+ truth: components["schemas"]["AdsAnalyticsTruth"] | null;
63756
+ };
63757
+ AdsAnalyticsFunnelStep: {
63758
+ /**
63759
+ * Format: int64
63760
+ * @description Thousandths (a network may report part conversions). `null` on `paid` when the first-party side cannot be read for these filters or no account has a first-party source.
63761
+ */
63762
+ count_milli: number | null;
63763
+ /**
63764
+ * Format: int64
63765
+ * @description This step over the step before it, in basis points. `null` on the first step, with nothing before, and on `paid` while an account with figures in the period has no first-party source.
63766
+ */
63767
+ rate_bp: number | null;
63768
+ /** @enum {string} */
63769
+ step: "impressions" | "clicks" | "conversions" | "paid";
63770
+ };
63726
63771
  AdsAnalyticsFx: {
63727
63772
  /** @description When the stored rate was fetched (ISO 8601). */
63728
63773
  as_of: string;
@@ -63896,6 +63941,91 @@ export interface components {
63896
63941
  points: components["schemas"]["AdsAnalyticsPoint"][];
63897
63942
  previous: components["schemas"]["AdsAnalyticsPoint"][] | null;
63898
63943
  };
63944
+ AdsAnalyticsTruth: {
63945
+ /** @description The 20 accounts with the largest gap; `tracked_accounts` is the full count. */
63946
+ accounts: components["schemas"]["AdsAnalyticsTruthAccount"][];
63947
+ by_kind: {
63948
+ count: number;
63949
+ kind: string;
63950
+ }[];
63951
+ /** Format: int64 */
63952
+ gap_bp: number | null;
63953
+ /** @description The gap within which the counts match (the daily check's threshold). */
63954
+ gap_limit_bp: number;
63955
+ /**
63956
+ * @description The gap in words by the daily tracking-truth check's thresholds: `missed` = the networks counted fewer than happened, `overcounted` = more.
63957
+ * @enum {string}
63958
+ */
63959
+ gap_verdict: "none" | "too_few" | "matches" | "missed" | "overcounted";
63960
+ /**
63961
+ * Format: int64
63962
+ * @description Outcomes the customer's own source recorded on the tracked accounts, of the kinds each account's tracking settings compare, each ONCE per organisation (the same order recorded on two ad accounts is one).
63963
+ */
63964
+ measured_conversions: number;
63965
+ /**
63966
+ * Format: int64
63967
+ * @description The per-account recorded counts summed: what the networks were each sent. `gap_bp` and `gap_verdict` compare THIS with the networks' summed claims.
63968
+ */
63969
+ measured_conversions_per_account: number;
63970
+ /**
63971
+ * Format: int64
63972
+ * @description The recorded outcomes' value net of partial refunds, each outcome once per organisation; refunded-in-full outcomes add no value.
63973
+ */
63974
+ measured_value_micros: number;
63975
+ /** @description The fewest recorded conversions a gap is judged on. */
63976
+ min_conversions: number;
63977
+ /**
63978
+ * Format: int64
63979
+ * @description The tracked accounts' network-reported conversions (every primary action).
63980
+ */
63981
+ network_conversions_milli: number;
63982
+ /** Format: int64 */
63983
+ network_value_micros: number;
63984
+ /**
63985
+ * Format: int64
63986
+ * @description How many more the per-account sum is than the once-per-organisation count.
63987
+ */
63988
+ recorded_on_several_accounts: number;
63989
+ /**
63990
+ * Format: date
63991
+ * @description The first day still settling at the network (an upload lands hours later) when the period reaches it.
63992
+ */
63993
+ settling_from: string | null;
63994
+ tracked_accounts: number;
63995
+ /** @description Accounts that have never sent a first-party outcome; left out of the comparison (they have no truth */
63996
+ untracked_accounts: number;
63997
+ /** @description Of those */
63998
+ untracked_active_accounts: number;
63999
+ };
64000
+ AdsAnalyticsTruthAccount: {
64001
+ check: components["schemas"]["AdsAnalyticsTruthCheck"] | null;
64002
+ /** Format: uuid */
64003
+ connection_id: string;
64004
+ /**
64005
+ * Format: int64
64006
+ * @description (measured - network) / measured in basis points; negative = the network counts more than happened; `null` with nothing measured.
64007
+ */
64008
+ gap_bp: number | null;
64009
+ label: string;
64010
+ /** Format: int64 */
64011
+ measured_conversions: number;
64012
+ network: string;
64013
+ /** Format: int64 */
64014
+ network_conversions_milli: number;
64015
+ };
64016
+ AdsAnalyticsTruthCheck: {
64017
+ /** Format: date-time */
64018
+ checked_at: string;
64019
+ credited: number | null;
64020
+ gap_pct: number | null;
64021
+ real: number;
64022
+ /** @description The latest daily tracking-truth verdict (za-115). */
64023
+ status: string;
64024
+ /** Format: date */
64025
+ window_end: string;
64026
+ /** Format: date */
64027
+ window_start: string;
64028
+ };
63899
64029
  /** @description One "Ask your ads" question and its checked answer (za-N7, docs/1006 §ASKADS). */
63900
64030
  AdsAsk: {
63901
64031
  /** @description Empty unless `answered`. Fact ids appear in square brackets after the figures they back. */
@@ -72420,7 +72550,7 @@ export interface components {
72420
72550
  */
72421
72551
  sandbox: boolean;
72422
72552
  /**
72423
- * @description RBAC permission keys to grant. Each must be a permission the caller holds in the target org (a key can never out-scope its creator); an unheld scope is a `403`, an unknown one a `422`. Defaults to an empty list — an inert key you can widen later by replacing it.
72553
+ * @description RBAC permission keys to grant. Each must be a permission the caller holds in the target org (a key can never out-scope its creator); an unheld scope is a `403`, an unknown one a `422`. Defaults to an empty list — an inert key you can widen later by replacing it. Scopes apply to the key's org and every sub-account under it, EXCEPT the exact-org scopes, which reach the key's own org only: `ads.outcomes.write` (send and retract conversion outcomes — `sendAdsOutcomes`, `retractAdsOutcomes` — and nothing else; a caller holding `ads.manage` in the org may grant it).
72424
72554
  * @default []
72425
72555
  * @example [
72426
72556
  * "sites.view",
@@ -138674,6 +138804,56 @@ export interface operations {
138674
138804
  429: components["responses"]["TooManyRequests"];
138675
138805
  };
138676
138806
  };
138807
+ getAdsAnalyticsFunnel: {
138808
+ parameters: {
138809
+ query?: {
138810
+ /** @description Comma-separated `<connection_id>:<campaign_id>` tokens. */
138811
+ campaign?: components["parameters"]["AdsAnalyticsCampaign"];
138812
+ compare?: components["parameters"]["AdsAnalyticsCompare"];
138813
+ /** @description Comma-separated ad-account connection ids. */
138814
+ connection?: components["parameters"]["AdsAnalyticsConnection"];
138815
+ /** @description Comma-separated ISO 3166-1 alpha-2 codes. Reads the country-level figures. */
138816
+ country?: components["parameters"]["AdsAnalyticsCountry"];
138817
+ /** @description Reporting currency (ISO 4217). Default the one currency in play, else the organisation's. */
138818
+ currency?: components["parameters"]["AdsAnalyticsCurrency"];
138819
+ /** @description Comma-separated devices: `mobile`, `desktop`, `tablet`, `tv`, `other` (za-282). Reads the device-level figures (Google Ads accounts, campaign grain). No stored level is split by both country and device, so `device` with `country` is refused (422, field `device`). */
138820
+ device?: components["parameters"]["AdsAnalyticsDevice"];
138821
+ from?: components["parameters"]["AdsAnalyticsFrom"];
138822
+ /** @description Bucket size. Default day up to 92 days, week up to 366, month beyond. */
138823
+ grain?: components["parameters"]["AdsAnalyticsGrain"];
138824
+ /** @description Comma-separated networks (google, microsoft, meta, linkedin, tiktok, x, pinterest, amazon). */
138825
+ network?: components["parameters"]["AdsAnalyticsNetwork"];
138826
+ /** @description Comma-separated product/site ids (za-290), or `unassigned`. */
138827
+ offering?: components["parameters"]["AdsAnalyticsOffering"];
138828
+ org_id?: string;
138829
+ /** @description The period. `custom` takes `from` and `to`. */
138830
+ range?: components["parameters"]["AdsAnalyticsRange"];
138831
+ to?: components["parameters"]["AdsAnalyticsTo"];
138832
+ };
138833
+ header?: never;
138834
+ path?: never;
138835
+ cookie?: never;
138836
+ };
138837
+ requestBody?: never;
138838
+ responses: {
138839
+ /** @description The funnel and the comparison. */
138840
+ 200: {
138841
+ headers: {
138842
+ [name: string]: unknown;
138843
+ };
138844
+ content: {
138845
+ "application/json": {
138846
+ data: components["schemas"]["AdsAnalyticsFunnel"];
138847
+ };
138848
+ };
138849
+ };
138850
+ 401: components["responses"]["Unauthorized"];
138851
+ 403: components["responses"]["Forbidden"];
138852
+ 404: components["responses"]["NotFound"];
138853
+ 422: components["responses"]["UnprocessableEntity"];
138854
+ 429: components["responses"]["TooManyRequests"];
138855
+ };
138856
+ };
138677
138857
  getAdsAnalyticsImpact: {
138678
138858
  parameters: {
138679
138859
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinn-digital/sdk",
3
- "version": "0.1.1481",
3
+ "version": "0.1.1485",
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>",