@zinn-digital/sdk 0.1.1347 → 0.1.1352

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.
@@ -47446,6 +47446,33 @@ export interface paths {
47446
47446
  patch?: never;
47447
47447
  trace?: never;
47448
47448
  };
47449
+ "/v1/sites/{siteId}/database/query": {
47450
+ parameters: {
47451
+ query?: never;
47452
+ header?: never;
47453
+ path: {
47454
+ /** @description Site ID (UUIDv7). */
47455
+ siteId: components["parameters"]["SiteId"];
47456
+ };
47457
+ cookie?: never;
47458
+ };
47459
+ get?: never;
47460
+ put?: never;
47461
+ /**
47462
+ * Run one guarded SQL statement against the site's WordPress database.
47463
+ * @description One statement, checked before anything reaches the site: a verb allow-list (reads `SELECT`, `SHOW`, `DESCRIBE`, `EXPLAIN`, `WITH`; writes `INSERT`, `UPDATE`, `DELETE`, `REPLACE` only with `allow_write`), no comments, no `INTO OUTFILE`/`LOAD_FILE`, no deliberate delays, and a `WHERE` clause on every `UPDATE`/`DELETE`. Schema changes and privileges are never run. Anything else answers `422` naming the rule.
47464
+ *
47465
+ * ⛔ Reads run inside `START TRANSACTION READ ONLY`, so the database itself refuses a write the check missed. A write runs in a transaction that is **rolled back** when it touches more rows than the limit, and always when `dry_run` is set — that is the preview: it answers how many rows the write *would* change.
47466
+ *
47467
+ * ⛔ `200` with `ok: false` when MySQL refuses the statement (its own diagnosis). The audit row records the verb and row counts — never the statement or its result. Requires `sites.view` and `sites.panel_access`. Fleet WordPress sites only.
47468
+ */
47469
+ post: operations["runSiteDatabaseQuery"];
47470
+ delete?: never;
47471
+ options?: never;
47472
+ head?: never;
47473
+ patch?: never;
47474
+ trace?: never;
47475
+ };
47449
47476
  "/v1/sites/{siteId}/databases": {
47450
47477
  parameters: {
47451
47478
  query?: never;
@@ -47917,6 +47944,56 @@ export interface paths {
47917
47944
  patch?: never;
47918
47945
  trace?: never;
47919
47946
  };
47947
+ "/v1/sites/{siteId}/files": {
47948
+ parameters: {
47949
+ query?: never;
47950
+ header?: never;
47951
+ path: {
47952
+ /** @description Site ID (UUIDv7). */
47953
+ siteId: components["parameters"]["SiteId"];
47954
+ };
47955
+ cookie?: never;
47956
+ };
47957
+ /**
47958
+ * List one folder of the site, inside its WordPress root.
47959
+ * @description The file editor's folder view. `path` is relative to the WordPress root (empty is the root). ⛔ `..`, absolute paths and links pointing outside the root are refused; `wp-config.php`, `.user.ini`, `php.ini` and the editor's backup folder are never listed or opened. Requires `sites.view` and `sites.panel_access`. Fleet only.
47960
+ */
47961
+ get: operations["listSiteFiles"];
47962
+ put?: never;
47963
+ post?: never;
47964
+ delete?: never;
47965
+ options?: never;
47966
+ head?: never;
47967
+ patch?: never;
47968
+ trace?: never;
47969
+ };
47970
+ "/v1/sites/{siteId}/files/content": {
47971
+ parameters: {
47972
+ query?: never;
47973
+ header?: never;
47974
+ path: {
47975
+ /** @description Site ID (UUIDv7). */
47976
+ siteId: components["parameters"]["SiteId"];
47977
+ };
47978
+ cookie?: never;
47979
+ };
47980
+ /**
47981
+ * Read one text file of the site.
47982
+ * @description Up to 1 MB of UTF-8 text, with its `sha256` — pass that back as `expected_sha256` when writing to refuse a write over a file that changed since. Same path rules as `listSiteFiles`. Requires `sites.view` and `sites.panel_access`. Fleet only.
47983
+ */
47984
+ get: operations["getSiteFileContent"];
47985
+ /**
47986
+ * Replace or create one text file of the site.
47987
+ * @description The current file is copied to `.zinn-file-backups/` (denied to the web) first, then the new content is written atomically (temporary file + rename). With `expected_sha256` the write is refused when the file changed since it was read. The audit row records the path, size and hashes — never the content. Requires `sites.view` and `sites.panel_access`. Fleet only.
47988
+ */
47989
+ put: operations["putSiteFileContent"];
47990
+ post?: never;
47991
+ delete?: never;
47992
+ options?: never;
47993
+ head?: never;
47994
+ patch?: never;
47995
+ trace?: never;
47996
+ };
47920
47997
  "/v1/sites/{siteId}/firewall": {
47921
47998
  parameters: {
47922
47999
  query?: never;
@@ -56263,6 +56340,8 @@ export interface components {
56263
56340
  updated_at: string;
56264
56341
  };
56265
56342
  AdminBoardActivity: {
56343
+ /** @description The member of staff behind an act done from an impersonated session (`user:<staff id>`, the audit log's ref); null for an ordinary act. Staff-only: customer payloads read `support` instead (VERIFY-ACTORS6). */
56344
+ acting_ref?: string | null;
56266
56345
  actor_id: components["schemas"]["Uuid"] | null;
56267
56346
  actor_is_client: boolean;
56268
56347
  /**
@@ -61178,10 +61257,22 @@ export interface components {
61178
61257
  basis?: string;
61179
61258
  /** Format: date-time */
61180
61259
  recorded_at?: string | null;
61260
+ /** @description Who last recorded the consent, by name (else e-mail) — set ONLY when `recorded_by_kind` is `person` (a current member of this org); empty otherwise. Never a raw `user:<id>` (VERIFY-ADSACTOR). */
61181
61261
  recorded_by?: string;
61262
+ /**
61263
+ * @description Who recorded the consent, as a kind the screen translates — the same kinds as `AdsBudgetDecision.decided_by_kind` (`support` = our staff, including while impersonating). `null` when nobody has.
61264
+ * @enum {string|null}
61265
+ */
61266
+ recorded_by_kind?: "person" | "support" | "agency" | "former_member" | "assistant" | "automatic" | "integration" | "other" | null;
61182
61267
  /** Format: date-time */
61183
61268
  terms_accepted_at?: string | null;
61269
+ /** @description Who accepted the Customer Match terms — the same rule as `recorded_by`. */
61184
61270
  terms_accepted_by?: string;
61271
+ /**
61272
+ * @description Who accepted the terms, as a kind (as `recorded_by_kind`); `null` when nobody has.
61273
+ * @enum {string|null}
61274
+ */
61275
+ terms_accepted_by_kind?: "person" | "support" | "agency" | "former_member" | "assistant" | "automatic" | "integration" | "other" | null;
61185
61276
  };
61186
61277
  /** Format: date-time */
61187
61278
  created_at: string;
@@ -61489,7 +61580,7 @@ export interface components {
61489
61580
  /** @description The person who decided, by name (else e-mail) — set ONLY when `decided_by_kind` is `person`, i.e. a current member of this org; empty for every other kind. Never a raw `user:<id>` or `mcp:<id>`: the audit trail keeps the stored actor. */
61490
61581
  decided_by: string;
61491
61582
  /**
61492
- * @description Who decided, as a kind the screen translates: `person` (a current member, named in `decided_by`), `support` (our staff), `agency` (a member of the parent org), `former_member` (removed, deleted or not of this org), `assistant` (the AI assistant over MCP), `automatic` (the autopilot), `integration` (an API key), `other`.
61583
+ * @description Who decided, as a kind the screen translates: `person` (a current member, named in `decided_by`), `support` (our staff — including a decision made while our staff were signed in to this account on the customer's behalf (impersonation): it is recorded as the staff member, never the customer), `agency` (a member of the parent org), `former_member` (removed, deleted or not of this org), `assistant` (the AI assistant over MCP), `automatic` (the autopilot), `integration` (an API key, stored as `apikey:<id>`), `other`.
61493
61584
  * @enum {string}
61494
61585
  */
61495
61586
  decided_by_kind: "person" | "support" | "agency" | "former_member" | "assistant" | "automatic" | "integration" | "other";
@@ -61822,6 +61913,7 @@ export interface components {
61822
61913
  connection_id: string;
61823
61914
  /** Format: date-time */
61824
61915
  decided_at: string | null;
61916
+ /** @description Who approved or declined it: who stored it (`user:<id>`, `autopilot`, `mcp:<id>`, `apikey:<id>`, …) — except a member of our staff, who reads `support` and never their id (VERIFY-ADSACTOR: an impersonated write is recorded as the staff member). */
61825
61917
  decided_by: string;
61826
61918
  /** @description Why the change was not sent, its CODE leading (`ceiling`, `killed`, `paused`, `disconnected`, `standing: …`, `needsReconnect`, `adBelowGood`, `xWritesOff`, za-70 `collides` — the collision simulator found what `summary.collision` names — or `collisionUnread` — the account could not be read for the replay — and za-10 `convertingSearch: …` — a negative keyword that would block a search with a conversion in the last 30 days, refused at the send even when a person approved it; SERVEWATCH `strategyStarves` — a bid-strategy switch whose ceiling or bids cannot win most of the campaign's searches against Google's own top-of-page estimates, refused whoever asked, its figures in `summary.serving_check`; UNDOSTRAT, on an APPLIED change whose Undo puts a bid strategy back: `killed` · `paused` · `standing` · `strategyStarves` followed by `: undo refused` — the restore passes the kill switch, good standing and the same simulation — and `undoReadBackDiffers: <campaigns>`, the strategy Google read back after the Undo is not `summary.bidding_before`, so the change stays applied and its Undo can be sent again); otherwise the network's own sentence. Empty when nothing went wrong. */
61827
61919
  error: string;
@@ -61831,6 +61923,7 @@ export interface components {
61831
61923
  org_id: string;
61832
61924
  /** Format: date-time */
61833
61925
  proposed_at: string;
61926
+ /** @description Who proposed the change: who stored it (`user:<id>`, `autopilot`, `mcp:<id>`, `apikey:<id>`, …) — except a member of our staff, who reads `support` and never their id (VERIFY-ADSACTOR: an impersonated write is recorded as the staff member). */
61834
61927
  proposed_by: string;
61835
61928
  status: components["schemas"]["AdsChangeStatus"];
61836
61929
  /** @description What the change does, for the card. SERVEWATCH adds `serving_check` (a bid-strategy switch simulated before the send: `verdict` ok · unknown · starves, `strategy`, `reason`, `ceiling_micros`, `need_micros`, `reach_pct` of the searches the ceiling can win, `raise_to_micros`, `fix`), `restores_served` (a serving-watch revert of the change that stopped a campaign) and `converting_removal` (a removal of campaigns that produced `share_pct`% of the account's results in 30 days: `campaigns`, `share_pct`, `conversions` — an automatic one waits for a person). UNDOSTRAT adds `bidding_before` on a change that alters a campaign's bidding: one entry per campaign (`resource`, `type` the bidding strategy type, `portfolio` a portfolio strategy's resource or `settings` the strategy's own values — `location`, `locationFractionMicros`, `cpcBidCeilingMicros`, `cpcBidFloorMicros`, `targetCpaMicros`, `targetRoas`, `enhancedCpcEnabled`), read before the send. Its Undo restores exactly that, and is marked undone only when Google reads it back. */
@@ -63861,7 +63954,13 @@ export interface components {
63861
63954
  created_by: string;
63862
63955
  /** Format: date-time */
63863
63956
  decided_at: string | null;
63957
+ /** @description Who decided, by name (else e-mail) — set ONLY when `decided_by_kind` is `person`, a current member of this org; empty otherwise. Never the stored `user:<id>` (ADSACTOR r2): the audit trail keeps it. */
63864
63958
  decided_by: string;
63959
+ /**
63960
+ * @description Who decided, as a kind the screen translates — the same rule as a budget decision's `decided_by_kind` (`automatic` also covers a review settled by the autopilot's own test). `null` while nothing is decided.
63961
+ * @enum {string|null}
63962
+ */
63963
+ decided_by_kind: "person" | "support" | "agency" | "former_member" | "assistant" | "automatic" | "integration" | "other" | null;
63865
63964
  /** @enum {string} */
63866
63965
  decision: "" | "keep" | "pause" | "revert" | "extend";
63867
63966
  /** Format: date */
@@ -65375,8 +65474,9 @@ export interface components {
65375
65474
  /** @description One person, resolved to something a human recognises. ⛔ Every `*_by` field on the AGENCY's side of this API carries one of these rather than a bare id — the People drawer rendered a raw UUID at a colleague's name until 2026-09-01, and an object with no id-shaped field to reach for is what stops that recurring. */
65376
65475
  AgencyBoardActor: {
65377
65476
  email?: string;
65378
- id: components["schemas"]["Uuid"];
65379
- /** @description Display name, falling back to the email address when the account has never set one. Never blank. */
65477
+ /** @description Null when a member of staff did this from an impersonated session — `name` is then `support` and no person is named (VERIFY-ACTORS6). */
65478
+ id: components["schemas"]["Uuid"] | null;
65479
+ /** @description Display name, falling back to the email address when the account has never set one. Never blank. `support` for an act a member of staff did while impersonating. */
65380
65480
  name: string;
65381
65481
  };
65382
65482
  /**
@@ -96780,6 +96880,24 @@ export interface components {
96780
96880
  */
96781
96881
  web_ide_sso_url: string | null;
96782
96882
  };
96883
+ /** @description One guarded statement's outcome. */
96884
+ SiteDatabaseQueryResult: {
96885
+ /** @description Rows a write changed (or would change). */
96886
+ affected?: number;
96887
+ columns?: string[];
96888
+ /** @description True when a write was rolled back as a preview. */
96889
+ dry_run?: boolean;
96890
+ /** @description MySQL's own refusal, when `ok` is false. */
96891
+ error?: string;
96892
+ ok: boolean;
96893
+ rows?: {
96894
+ [key: string]: unknown;
96895
+ }[];
96896
+ total_rows?: number;
96897
+ /** @example SELECT */
96898
+ verb: string;
96899
+ write: boolean;
96900
+ };
96783
96901
  /**
96784
96902
  * @description The deletion lifecycle of one site, as the customer's danger zone renders it.
96785
96903
  *
@@ -97268,6 +97386,21 @@ export interface components {
97268
97386
  * @enum {string}
97269
97387
  */
97270
97388
  SiteFailedStep: "begin" | "placement" | "account" | "blueprint" | "cdn" | "dns" | "verify" | "activate";
97389
+ /** @description A folder listing, a file read or a file write. */
97390
+ SiteFileResult: {
97391
+ /** @description Where the previous file was copied */
97392
+ backup?: string;
97393
+ bytes?: number;
97394
+ content?: string;
97395
+ entries?: {
97396
+ [key: string]: unknown;
97397
+ }[];
97398
+ error?: string;
97399
+ ok: boolean;
97400
+ path?: string;
97401
+ sha256?: string;
97402
+ truncated?: boolean;
97403
+ };
97271
97404
  SiteFirewall: {
97272
97405
  /** @description Only trusted addresses may reach the login page and wp-admin. */
97273
97406
  admin_trusted_only: boolean;
@@ -185880,6 +186013,60 @@ export interface operations {
185880
186013
  429: components["responses"]["TooManyRequests"];
185881
186014
  };
185882
186015
  };
186016
+ runSiteDatabaseQuery: {
186017
+ parameters: {
186018
+ query?: never;
186019
+ header?: never;
186020
+ path: {
186021
+ /** @description Site ID (UUIDv7). */
186022
+ siteId: components["parameters"]["SiteId"];
186023
+ };
186024
+ cookie?: never;
186025
+ };
186026
+ requestBody: {
186027
+ content: {
186028
+ "application/json": {
186029
+ /**
186030
+ * @description Permit `INSERT`/`UPDATE`/`DELETE`/`REPLACE`.
186031
+ * @default false
186032
+ */
186033
+ allow_write?: boolean;
186034
+ /**
186035
+ * @description Run a write and roll it back, answering the rows it would change.
186036
+ * @default false
186037
+ */
186038
+ dry_run?: boolean;
186039
+ /**
186040
+ * @description Rows returned for a read.
186041
+ * @default 100
186042
+ */
186043
+ max_rows?: number;
186044
+ /**
186045
+ * @description One SQL statement. A trailing `;` is allowed.
186046
+ * @example SELECT option_name FROM wp_options WHERE autoload = 'yes' LIMIT 10
186047
+ */
186048
+ sql: string;
186049
+ };
186050
+ };
186051
+ };
186052
+ responses: {
186053
+ /** @description The result, or MySQL's refusal with `ok` false. */
186054
+ 200: {
186055
+ headers: {
186056
+ [name: string]: unknown;
186057
+ };
186058
+ content: {
186059
+ "application/json": components["schemas"]["SiteDatabaseQueryResult"];
186060
+ };
186061
+ };
186062
+ 401: components["responses"]["Unauthorized"];
186063
+ 403: components["responses"]["Forbidden"];
186064
+ 404: components["responses"]["NotFound"];
186065
+ 422: components["responses"]["UnprocessableEntity"];
186066
+ 429: components["responses"]["TooManyRequests"];
186067
+ 503: components["responses"]["ProviderNotConfigured"];
186068
+ };
186069
+ };
185883
186070
  listSiteDatabases: {
185884
186071
  parameters: {
185885
186072
  query?: never;
@@ -186649,6 +186836,106 @@ export interface operations {
186649
186836
  422: components["responses"]["UnprocessableEntity"];
186650
186837
  };
186651
186838
  };
186839
+ listSiteFiles: {
186840
+ parameters: {
186841
+ query?: {
186842
+ /** @description The folder, relative to the WordPress root. */
186843
+ path?: string;
186844
+ };
186845
+ header?: never;
186846
+ path: {
186847
+ /** @description Site ID (UUIDv7). */
186848
+ siteId: components["parameters"]["SiteId"];
186849
+ };
186850
+ cookie?: never;
186851
+ };
186852
+ requestBody?: never;
186853
+ responses: {
186854
+ /** @description The folder's entries, or `ok` false with the reason. */
186855
+ 200: {
186856
+ headers: {
186857
+ [name: string]: unknown;
186858
+ };
186859
+ content: {
186860
+ "application/json": components["schemas"]["SiteFileResult"];
186861
+ };
186862
+ };
186863
+ 401: components["responses"]["Unauthorized"];
186864
+ 403: components["responses"]["Forbidden"];
186865
+ 404: components["responses"]["NotFound"];
186866
+ 422: components["responses"]["UnprocessableEntity"];
186867
+ 503: components["responses"]["ProviderNotConfigured"];
186868
+ };
186869
+ };
186870
+ getSiteFileContent: {
186871
+ parameters: {
186872
+ query: {
186873
+ /** @description The file, relative to the WordPress root. */
186874
+ path: string;
186875
+ };
186876
+ header?: never;
186877
+ path: {
186878
+ /** @description Site ID (UUIDv7). */
186879
+ siteId: components["parameters"]["SiteId"];
186880
+ };
186881
+ cookie?: never;
186882
+ };
186883
+ requestBody?: never;
186884
+ responses: {
186885
+ /** @description The file, or `ok` false with the reason. */
186886
+ 200: {
186887
+ headers: {
186888
+ [name: string]: unknown;
186889
+ };
186890
+ content: {
186891
+ "application/json": components["schemas"]["SiteFileResult"];
186892
+ };
186893
+ };
186894
+ 401: components["responses"]["Unauthorized"];
186895
+ 403: components["responses"]["Forbidden"];
186896
+ 404: components["responses"]["NotFound"];
186897
+ 422: components["responses"]["UnprocessableEntity"];
186898
+ 503: components["responses"]["ProviderNotConfigured"];
186899
+ };
186900
+ };
186901
+ putSiteFileContent: {
186902
+ parameters: {
186903
+ query?: never;
186904
+ header?: never;
186905
+ path: {
186906
+ /** @description Site ID (UUIDv7). */
186907
+ siteId: components["parameters"]["SiteId"];
186908
+ };
186909
+ cookie?: never;
186910
+ };
186911
+ requestBody: {
186912
+ content: {
186913
+ "application/json": {
186914
+ /** @description The whole new content, UTF-8. */
186915
+ content: string;
186916
+ /** @description The `sha256` the file had when read. */
186917
+ expected_sha256?: string;
186918
+ path: string;
186919
+ };
186920
+ };
186921
+ };
186922
+ responses: {
186923
+ /** @description Written (with the backup's path), or `ok` false with the reason. */
186924
+ 200: {
186925
+ headers: {
186926
+ [name: string]: unknown;
186927
+ };
186928
+ content: {
186929
+ "application/json": components["schemas"]["SiteFileResult"];
186930
+ };
186931
+ };
186932
+ 401: components["responses"]["Unauthorized"];
186933
+ 403: components["responses"]["Forbidden"];
186934
+ 404: components["responses"]["NotFound"];
186935
+ 422: components["responses"]["UnprocessableEntity"];
186936
+ 503: components["responses"]["ProviderNotConfigured"];
186937
+ };
186938
+ };
186652
186939
  getSiteFirewall: {
186653
186940
  parameters: {
186654
186941
  query?: never;
@@ -191137,6 +191424,11 @@ export interface operations {
191137
191424
  requestBody: {
191138
191425
  content: {
191139
191426
  "application/json": {
191427
+ /**
191428
+ * @description Permit the write tier (plugin/theme install and update by WordPress.org slug, activate/deactivate, option update, cache flush, rewrite flush, search-replace…). `eval`, `db query`, `config`, credential commands, `--user_pass` and `--zip` are refused at every tier.
191429
+ * @default false
191430
+ */
191431
+ allow_write?: boolean;
191140
191432
  /**
191141
191433
  * @description The WP-CLI command, with or without a leading `wp`.
191142
191434
  * @example plugin list --format=json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinn-digital/sdk",
3
- "version": "0.1.1347",
3
+ "version": "0.1.1352",
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>",