@zinn-digital/sdk 0.1.1400 → 0.1.1401

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.
@@ -15902,6 +15902,52 @@ export interface paths {
15902
15902
  patch?: never;
15903
15903
  trace?: never;
15904
15904
  };
15905
+ "/v1/ads/asks": {
15906
+ parameters: {
15907
+ query?: never;
15908
+ header?: never;
15909
+ path?: never;
15910
+ cookie?: never;
15911
+ };
15912
+ /**
15913
+ * The organisation's recent "Ask your ads" questions and their checked answers (za-N7).
15914
+ * @description Gated on `ads.view`; the 20 most recent asks of the caller's organisation (narrow with `?org_id=`), newest first. Never another organisation's (docs/1006 §ASKADS).
15915
+ */
15916
+ get: operations["listAdsAsks"];
15917
+ put?: never;
15918
+ /**
15919
+ * Ask a plain question about the organisation's own ads; the answer is checked figure by figure against cited facts (za-N7).
15920
+ * @description Gated on `ads.view` in ONE organisation (`org_id` in the body or `X-Zinn-Org` when the caller holds several). Interactive: one Zinn® AI call in the request, no job queue. The facts are read ONLY from the organisation's own synced figures (account totals, spend per day for up to 31 recent days, campaigns ranked by spend, Google keywords and search terms that spend with no conversion, open findings, changes waiting). `status`: `answered` (every number in `answer` appears in a fact it cites — ids in `cites`, figures in `facts`), `facts_only` (the written answer failed that check and is withheld; the cited facts are the answer), `refused` (no AI credit, or the organisation is not in good standing — `error.failure` class `refused`, nothing was spent) or `failed` (the AI provider failed — `error.failure` names the class: outage with its status page, a customer key problem, or ours). Who pays is the one meter's decision: the organisation's own AI key, else its Zinn® AI credit. At most ONE `fix` is offered, built from a fact (never by the model): `pause_campaign` or `pause_keyword` for a Google campaign or keyword that spends with no conversion. `422` codes: `askQuestion` (1 to 500 characters), `askDays` (1 to 90), `askNoAccounts`, `askHourly` (60 asks per organisation per hour). `404` for a `connection_id` that is not the organisation's.
15921
+ */
15922
+ post: operations["createAdsAsk"];
15923
+ delete?: never;
15924
+ options?: never;
15925
+ head?: never;
15926
+ patch?: never;
15927
+ trace?: never;
15928
+ };
15929
+ "/v1/ads/asks/{ask_id}/fix": {
15930
+ parameters: {
15931
+ query?: never;
15932
+ header?: never;
15933
+ path: {
15934
+ ask_id: string;
15935
+ };
15936
+ cookie?: never;
15937
+ };
15938
+ get?: never;
15939
+ put?: never;
15940
+ /**
15941
+ * Keep the answer's one fix as a change waiting for approval (za-N7).
15942
+ * @description Gated on `ads.manage` in the ask's organisation and written to its activity log. Keeps the fix as ONE pending change in the approval queue (`proposed_by` the person, `summary` `auto_action` `ask_pause_campaign` or `ask_pause_keyword`). Nothing reaches the ad network until a person approves it (`POST /v1/ads/changes/{change_id}/approve`), where the kill switches, ceilings and standing still decide; an applied pause keeps its 30-day Undo. Asking twice returns the same change. `422 askNoFix` when the answer offered none.
15943
+ */
15944
+ post: operations["proposeAdsAskFix"];
15945
+ delete?: never;
15946
+ options?: never;
15947
+ head?: never;
15948
+ patch?: never;
15949
+ trace?: never;
15950
+ };
15905
15951
  "/v1/ads/autopilot-decisions": {
15906
15952
  parameters: {
15907
15953
  query?: never;
@@ -61767,6 +61813,57 @@ export interface components {
61767
61813
  connection_id: string;
61768
61814
  data: components["schemas"]["AdsAllowedTerm"][];
61769
61815
  };
61816
+ /** @description One "Ask your ads" question and its checked answer (za-N7, docs/1006 §ASKADS). */
61817
+ AdsAsk: {
61818
+ /** @description Empty unless `answered`. Fact ids appear in square brackets after the figures they back. */
61819
+ answer: string;
61820
+ cites: string[];
61821
+ /** Format: uuid */
61822
+ connection_id: string | null;
61823
+ /** Format: date-time */
61824
+ created_at: string;
61825
+ days: number;
61826
+ error: {
61827
+ can_buy?: boolean;
61828
+ code?: string;
61829
+ failure?: components["schemas"]["VendorFailure"];
61830
+ reason?: string;
61831
+ } | null;
61832
+ facts: components["schemas"]["AdsAskFact"][];
61833
+ fix: {
61834
+ /** @enum {string} */
61835
+ action: "pause_campaign" | "pause_keyword";
61836
+ /**
61837
+ * Format: uuid
61838
+ * @description Set once proposed.
61839
+ */
61840
+ change_id: string | null;
61841
+ /** Format: uuid */
61842
+ connection_id: string;
61843
+ fact_id: string;
61844
+ } | null;
61845
+ /** Format: uuid */
61846
+ id: string;
61847
+ locale: string;
61848
+ question: string;
61849
+ /** @enum {string} */
61850
+ status: "answered" | "facts_only" | "refused" | "failed";
61851
+ };
61852
+ /** @description One cited fact. `kind`: `account`, `day`, `campaign`, `keyword`, `search_term`, `findings`, `pending`; `figures` are the strings shown (money with its currency code, truncated to the currency's minor unit). */
61853
+ AdsAskFact: {
61854
+ /** Format: uuid */
61855
+ connection_id: string;
61856
+ figures: {
61857
+ [key: string]: string;
61858
+ };
61859
+ fix?: {
61860
+ /** @enum {string} */
61861
+ action?: "pause_campaign" | "pause_keyword";
61862
+ };
61863
+ id: string;
61864
+ /** @enum {string} */
61865
+ kind: "account" | "day" | "campaign" | "keyword" | "search_term" | "findings" | "pending";
61866
+ };
61770
61867
  /** @description A customer's own Customer Match list (docs/1006 §72). Counts only, never an identifier. */
61771
61868
  AdsAudience: {
61772
61869
  /** @description False once emptied. */
@@ -134693,6 +134790,102 @@ export interface operations {
134693
134790
  429: components["responses"]["TooManyRequests"];
134694
134791
  };
134695
134792
  };
134793
+ listAdsAsks: {
134794
+ parameters: {
134795
+ query?: {
134796
+ org_id?: string;
134797
+ };
134798
+ header?: never;
134799
+ path?: never;
134800
+ cookie?: never;
134801
+ };
134802
+ requestBody?: never;
134803
+ responses: {
134804
+ /** @description The recent asks. */
134805
+ 200: {
134806
+ headers: {
134807
+ [name: string]: unknown;
134808
+ };
134809
+ content: {
134810
+ "application/json": {
134811
+ data: components["schemas"]["AdsAsk"][];
134812
+ };
134813
+ };
134814
+ };
134815
+ 401: components["responses"]["Unauthorized"];
134816
+ 403: components["responses"]["Forbidden"];
134817
+ 429: components["responses"]["TooManyRequests"];
134818
+ };
134819
+ };
134820
+ createAdsAsk: {
134821
+ parameters: {
134822
+ query?: never;
134823
+ header?: never;
134824
+ path?: never;
134825
+ cookie?: never;
134826
+ };
134827
+ requestBody: {
134828
+ content: {
134829
+ "application/json": {
134830
+ /**
134831
+ * Format: uuid
134832
+ * @description Narrow to one ad account.
134833
+ */
134834
+ connection_id?: string;
134835
+ /** @default 30 */
134836
+ days?: number;
134837
+ /** @description The answer's language, e.g. en, ar. */
134838
+ locale?: string;
134839
+ /** Format: uuid */
134840
+ org_id?: string;
134841
+ question: string;
134842
+ };
134843
+ };
134844
+ };
134845
+ responses: {
134846
+ /** @description The ask, its status and (when answered) the checked answer. */
134847
+ 201: {
134848
+ headers: {
134849
+ [name: string]: unknown;
134850
+ };
134851
+ content: {
134852
+ "application/json": components["schemas"]["AdsAsk"];
134853
+ };
134854
+ };
134855
+ 401: components["responses"]["Unauthorized"];
134856
+ 403: components["responses"]["Forbidden"];
134857
+ 404: components["responses"]["NotFound"];
134858
+ 422: components["responses"]["UnprocessableEntity"];
134859
+ 429: components["responses"]["TooManyRequests"];
134860
+ };
134861
+ };
134862
+ proposeAdsAskFix: {
134863
+ parameters: {
134864
+ query?: never;
134865
+ header?: never;
134866
+ path: {
134867
+ ask_id: string;
134868
+ };
134869
+ cookie?: never;
134870
+ };
134871
+ requestBody?: never;
134872
+ responses: {
134873
+ /** @description The pending change. */
134874
+ 201: {
134875
+ headers: {
134876
+ [name: string]: unknown;
134877
+ };
134878
+ content: {
134879
+ "application/json": components["schemas"]["AdsChange"];
134880
+ };
134881
+ };
134882
+ 401: components["responses"]["Unauthorized"];
134883
+ 403: components["responses"]["Forbidden"];
134884
+ 404: components["responses"]["NotFound"];
134885
+ 422: components["responses"]["UnprocessableEntity"];
134886
+ 429: components["responses"]["TooManyRequests"];
134887
+ };
134888
+ };
134696
134889
  getAdsAutopilotDecisions: {
134697
134890
  parameters: {
134698
134891
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinn-digital/sdk",
3
- "version": "0.1.1400",
3
+ "version": "0.1.1401",
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>",