@zinn-digital/sdk 0.1.1351 → 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.
- package/dist/generated/schema.d.ts +269 -0
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -96803,6 +96880,24 @@ export interface components {
|
|
|
96803
96880
|
*/
|
|
96804
96881
|
web_ide_sso_url: string | null;
|
|
96805
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
|
+
};
|
|
96806
96901
|
/**
|
|
96807
96902
|
* @description The deletion lifecycle of one site, as the customer's danger zone renders it.
|
|
96808
96903
|
*
|
|
@@ -97291,6 +97386,21 @@ export interface components {
|
|
|
97291
97386
|
* @enum {string}
|
|
97292
97387
|
*/
|
|
97293
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
|
+
};
|
|
97294
97404
|
SiteFirewall: {
|
|
97295
97405
|
/** @description Only trusted addresses may reach the login page and wp-admin. */
|
|
97296
97406
|
admin_trusted_only: boolean;
|
|
@@ -185903,6 +186013,60 @@ export interface operations {
|
|
|
185903
186013
|
429: components["responses"]["TooManyRequests"];
|
|
185904
186014
|
};
|
|
185905
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
|
+
};
|
|
185906
186070
|
listSiteDatabases: {
|
|
185907
186071
|
parameters: {
|
|
185908
186072
|
query?: never;
|
|
@@ -186672,6 +186836,106 @@ export interface operations {
|
|
|
186672
186836
|
422: components["responses"]["UnprocessableEntity"];
|
|
186673
186837
|
};
|
|
186674
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
|
+
};
|
|
186675
186939
|
getSiteFirewall: {
|
|
186676
186940
|
parameters: {
|
|
186677
186941
|
query?: never;
|
|
@@ -191160,6 +191424,11 @@ export interface operations {
|
|
|
191160
191424
|
requestBody: {
|
|
191161
191425
|
content: {
|
|
191162
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;
|
|
191163
191432
|
/**
|
|
191164
191433
|
* @description The WP-CLI command, with or without a leading `wp`.
|
|
191165
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.
|
|
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>",
|