@zinn-digital/sdk 0.1.1351 → 0.1.1353

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.
@@ -17280,7 +17280,7 @@ export interface paths {
17280
17280
  put?: never;
17281
17281
  /**
17282
17282
  * Buy one tracking number that forwards to the customer's own number (za-160).
17283
- * @description Gated on `ads.manage`; audit action `ads.call_number_ordered` (no phone number in its metadata). The price is the voice vendor's own answer for that number, re-read now, times the platform margin; the first month is taken from the org's prepaid Zinn® credit BEFORE the order and returned if the vendor refuses it. Refused (422) when call tracking is not open (`callNotOpen`), the CRM source `telnyx` is not set up (`callNoSource`), the forward-to number is not a United States number (`callForwardToNotOffered`), the account holds its cap (`callTooMany`), the account is not in good standing (`callAccountOnHold`), the credit is short (`callNoCredit`), the number was taken (`callNumberGone`) or its price is no longer the `first_month_usd_micros` the customer was shown (`callPriceChanged`, nothing charged). A vendor that does not answer the order leaves the number `ordering`: it is found by its reference, or refunded, within the next sweep.
17283
+ * @description Gated on `ads.manage`; audit action `ads.call_number_ordered` (no phone number in its metadata). The price is the voice vendor's own answer for that number, re-read now, times the platform margin; the first charge (the vendor's upfront fee plus the first month, both taken by the vendor at purchase) is taken from the org's prepaid Zinn® credit BEFORE the order and returned if the vendor refuses it. Refused (422) when call tracking is not open (`callNotOpen`), the CRM source `telnyx` is not set up (`callNoSource`), the forward-to number is not a United States number or is one of our own tracking numbers (a call loop, `callForwardToNotOffered`), the account holds its cap (`callTooMany`), the account is not in good standing (`callAccountOnHold`), the credit is short (`callNoCredit`), the number was taken (`callNumberGone`) or its price is no longer the `first_month_usd_micros` the customer was shown (`callPriceChanged`, nothing charged). An order the vendor has not finished yet leaves the number `ordering` and starts the account's number sweep at once (retried until it completes); a vendor that does not answer the order leaves it `ordering` too: it is found by its reference, or refunded.
17284
17284
  */
17285
17285
  post: operations["orderAdsCallNumber"];
17286
17286
  delete?: never;
@@ -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;
@@ -61724,7 +61801,10 @@ export interface components {
61724
61801
  source_id: string | null;
61725
61802
  };
61726
61803
  AdsCallNumberOffer: {
61727
- /** Format: int64 */
61804
+ /**
61805
+ * Format: int64
61806
+ * @description What buying it costs now — the vendor's upfront fee plus the first month, with the margin.
61807
+ */
61728
61808
  first_month_usd_micros: number;
61729
61809
  locality: string;
61730
61810
  /** Format: int64 */
@@ -96803,6 +96883,24 @@ export interface components {
96803
96883
  */
96804
96884
  web_ide_sso_url: string | null;
96805
96885
  };
96886
+ /** @description One guarded statement's outcome. */
96887
+ SiteDatabaseQueryResult: {
96888
+ /** @description Rows a write changed (or would change). */
96889
+ affected?: number;
96890
+ columns?: string[];
96891
+ /** @description True when a write was rolled back as a preview. */
96892
+ dry_run?: boolean;
96893
+ /** @description MySQL's own refusal, when `ok` is false. */
96894
+ error?: string;
96895
+ ok: boolean;
96896
+ rows?: {
96897
+ [key: string]: unknown;
96898
+ }[];
96899
+ total_rows?: number;
96900
+ /** @example SELECT */
96901
+ verb: string;
96902
+ write: boolean;
96903
+ };
96806
96904
  /**
96807
96905
  * @description The deletion lifecycle of one site, as the customer's danger zone renders it.
96808
96906
  *
@@ -97291,6 +97389,21 @@ export interface components {
97291
97389
  * @enum {string}
97292
97390
  */
97293
97391
  SiteFailedStep: "begin" | "placement" | "account" | "blueprint" | "cdn" | "dns" | "verify" | "activate";
97392
+ /** @description A folder listing, a file read or a file write. */
97393
+ SiteFileResult: {
97394
+ /** @description Where the previous file was copied */
97395
+ backup?: string;
97396
+ bytes?: number;
97397
+ content?: string;
97398
+ entries?: {
97399
+ [key: string]: unknown;
97400
+ }[];
97401
+ error?: string;
97402
+ ok: boolean;
97403
+ path?: string;
97404
+ sha256?: string;
97405
+ truncated?: boolean;
97406
+ };
97294
97407
  SiteFirewall: {
97295
97408
  /** @description Only trusted addresses may reach the login page and wp-admin. */
97296
97409
  admin_trusted_only: boolean;
@@ -185903,6 +186016,60 @@ export interface operations {
185903
186016
  429: components["responses"]["TooManyRequests"];
185904
186017
  };
185905
186018
  };
186019
+ runSiteDatabaseQuery: {
186020
+ parameters: {
186021
+ query?: never;
186022
+ header?: never;
186023
+ path: {
186024
+ /** @description Site ID (UUIDv7). */
186025
+ siteId: components["parameters"]["SiteId"];
186026
+ };
186027
+ cookie?: never;
186028
+ };
186029
+ requestBody: {
186030
+ content: {
186031
+ "application/json": {
186032
+ /**
186033
+ * @description Permit `INSERT`/`UPDATE`/`DELETE`/`REPLACE`.
186034
+ * @default false
186035
+ */
186036
+ allow_write?: boolean;
186037
+ /**
186038
+ * @description Run a write and roll it back, answering the rows it would change.
186039
+ * @default false
186040
+ */
186041
+ dry_run?: boolean;
186042
+ /**
186043
+ * @description Rows returned for a read.
186044
+ * @default 100
186045
+ */
186046
+ max_rows?: number;
186047
+ /**
186048
+ * @description One SQL statement. A trailing `;` is allowed.
186049
+ * @example SELECT option_name FROM wp_options WHERE autoload = 'yes' LIMIT 10
186050
+ */
186051
+ sql: string;
186052
+ };
186053
+ };
186054
+ };
186055
+ responses: {
186056
+ /** @description The result, or MySQL's refusal with `ok` false. */
186057
+ 200: {
186058
+ headers: {
186059
+ [name: string]: unknown;
186060
+ };
186061
+ content: {
186062
+ "application/json": components["schemas"]["SiteDatabaseQueryResult"];
186063
+ };
186064
+ };
186065
+ 401: components["responses"]["Unauthorized"];
186066
+ 403: components["responses"]["Forbidden"];
186067
+ 404: components["responses"]["NotFound"];
186068
+ 422: components["responses"]["UnprocessableEntity"];
186069
+ 429: components["responses"]["TooManyRequests"];
186070
+ 503: components["responses"]["ProviderNotConfigured"];
186071
+ };
186072
+ };
185906
186073
  listSiteDatabases: {
185907
186074
  parameters: {
185908
186075
  query?: never;
@@ -186672,6 +186839,106 @@ export interface operations {
186672
186839
  422: components["responses"]["UnprocessableEntity"];
186673
186840
  };
186674
186841
  };
186842
+ listSiteFiles: {
186843
+ parameters: {
186844
+ query?: {
186845
+ /** @description The folder, relative to the WordPress root. */
186846
+ path?: string;
186847
+ };
186848
+ header?: never;
186849
+ path: {
186850
+ /** @description Site ID (UUIDv7). */
186851
+ siteId: components["parameters"]["SiteId"];
186852
+ };
186853
+ cookie?: never;
186854
+ };
186855
+ requestBody?: never;
186856
+ responses: {
186857
+ /** @description The folder's entries, or `ok` false with the reason. */
186858
+ 200: {
186859
+ headers: {
186860
+ [name: string]: unknown;
186861
+ };
186862
+ content: {
186863
+ "application/json": components["schemas"]["SiteFileResult"];
186864
+ };
186865
+ };
186866
+ 401: components["responses"]["Unauthorized"];
186867
+ 403: components["responses"]["Forbidden"];
186868
+ 404: components["responses"]["NotFound"];
186869
+ 422: components["responses"]["UnprocessableEntity"];
186870
+ 503: components["responses"]["ProviderNotConfigured"];
186871
+ };
186872
+ };
186873
+ getSiteFileContent: {
186874
+ parameters: {
186875
+ query: {
186876
+ /** @description The file, relative to the WordPress root. */
186877
+ path: string;
186878
+ };
186879
+ header?: never;
186880
+ path: {
186881
+ /** @description Site ID (UUIDv7). */
186882
+ siteId: components["parameters"]["SiteId"];
186883
+ };
186884
+ cookie?: never;
186885
+ };
186886
+ requestBody?: never;
186887
+ responses: {
186888
+ /** @description The file, or `ok` false with the reason. */
186889
+ 200: {
186890
+ headers: {
186891
+ [name: string]: unknown;
186892
+ };
186893
+ content: {
186894
+ "application/json": components["schemas"]["SiteFileResult"];
186895
+ };
186896
+ };
186897
+ 401: components["responses"]["Unauthorized"];
186898
+ 403: components["responses"]["Forbidden"];
186899
+ 404: components["responses"]["NotFound"];
186900
+ 422: components["responses"]["UnprocessableEntity"];
186901
+ 503: components["responses"]["ProviderNotConfigured"];
186902
+ };
186903
+ };
186904
+ putSiteFileContent: {
186905
+ parameters: {
186906
+ query?: never;
186907
+ header?: never;
186908
+ path: {
186909
+ /** @description Site ID (UUIDv7). */
186910
+ siteId: components["parameters"]["SiteId"];
186911
+ };
186912
+ cookie?: never;
186913
+ };
186914
+ requestBody: {
186915
+ content: {
186916
+ "application/json": {
186917
+ /** @description The whole new content, UTF-8. */
186918
+ content: string;
186919
+ /** @description The `sha256` the file had when read. */
186920
+ expected_sha256?: string;
186921
+ path: string;
186922
+ };
186923
+ };
186924
+ };
186925
+ responses: {
186926
+ /** @description Written (with the backup's path), or `ok` false with the reason. */
186927
+ 200: {
186928
+ headers: {
186929
+ [name: string]: unknown;
186930
+ };
186931
+ content: {
186932
+ "application/json": components["schemas"]["SiteFileResult"];
186933
+ };
186934
+ };
186935
+ 401: components["responses"]["Unauthorized"];
186936
+ 403: components["responses"]["Forbidden"];
186937
+ 404: components["responses"]["NotFound"];
186938
+ 422: components["responses"]["UnprocessableEntity"];
186939
+ 503: components["responses"]["ProviderNotConfigured"];
186940
+ };
186941
+ };
186675
186942
  getSiteFirewall: {
186676
186943
  parameters: {
186677
186944
  query?: never;
@@ -191160,6 +191427,11 @@ export interface operations {
191160
191427
  requestBody: {
191161
191428
  content: {
191162
191429
  "application/json": {
191430
+ /**
191431
+ * @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.
191432
+ * @default false
191433
+ */
191434
+ allow_write?: boolean;
191163
191435
  /**
191164
191436
  * @description The WP-CLI command, with or without a leading `wp`.
191165
191437
  * @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.1351",
3
+ "version": "0.1.1353",
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>",