@wix/mcp 1.0.88 → 1.0.89
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/build/bin-standalone.js +32 -15
- package/build/cjs/index.cjs +37 -19
- package/build/cjs/toolkit.cjs +37 -19
- package/build/dts/code-mode/index.js +5 -4
- package/build/dts/config/default-config.js +32 -15
- package/build/esm/index.js +37 -19
- package/build/esm/toolkit.js +37 -19
- package/package.json +2 -2
package/build/bin-standalone.js
CHANGED
|
@@ -71737,32 +71737,49 @@ var ACCOUNT_SITE_EXECUTE_SCOPE = dedent_default`
|
|
|
71737
71737
|
request<T = unknown>(options: WixRequestOptions): Promise<WixResponse<T>>;
|
|
71738
71738
|
// Build a multipart/form-data body from files (defaults to the \`files\`
|
|
71739
71739
|
// global). Each file becomes a part named fieldName (default "files") with
|
|
71740
|
-
// its path as the filename
|
|
71740
|
+
// its path as the filename; \`body\` is bytes so binary parts stay intact.
|
|
71741
|
+
// Pass a base64 entry for binary (an image/font): { path, base64 }, or a
|
|
71742
|
+
// \`files\`-param entry tagged \`base64\`.
|
|
71741
71743
|
multipart(
|
|
71742
|
-
files?: Array<{ path: string; content
|
|
71744
|
+
files?: Array<{ path: string; content?: string; base64?: string; bytes?: Uint8Array; contentType?: string }>,
|
|
71743
71745
|
options?: { fieldName?: string }
|
|
71744
|
-
): { body:
|
|
71746
|
+
): { body: Uint8Array; contentType: string };
|
|
71747
|
+
// Unzip a downloaded site archive (base64 string or bytes) into entries with
|
|
71748
|
+
// RAW bytes (binary-safe); entry.text() decodes a text file. Entries can be
|
|
71749
|
+
// passed straight back to wix.multipart() for a re-upload.
|
|
71750
|
+
unzip(input: string | Uint8Array): Promise<Array<{ path: string; bytes: Uint8Array; text(): string }>>;
|
|
71745
71751
|
};
|
|
71746
71752
|
declare const siteId: string | undefined;
|
|
71747
|
-
// Files from the ExecuteWixAPI \`files\` param
|
|
71748
|
-
|
|
71753
|
+
// Files from the ExecuteWixAPI \`files\` param. Text entries have \`content\`;
|
|
71754
|
+
// an entry tagged \`=== FILE: <path> base64 ===\` has encoding:'base64' and
|
|
71755
|
+
// base64 \`content\` (a binary file — image, font).
|
|
71756
|
+
declare const files: Array<{ path: string; content: string; encoding?: "base64" }>;
|
|
71749
71757
|
\`\`\`
|
|
71750
71758
|
|
|
71751
|
-
FILE UPLOADS:
|
|
71759
|
+
FILE UPLOADS: put every file in the \`files\` param (never inline in \`code\`). Text goes raw; a small binary (icon, logo, font) rides as a \`base64\`-tagged entry — large images/video are referenced by URL (\`<img src="https://...">\`), not bundled. \`wix.multipart()\` turns the whole set into one upload body (bytes, so binary is safe):
|
|
71752
71760
|
\`\`\`javascript
|
|
71753
|
-
// files param:
|
|
71761
|
+
// files param:
|
|
71762
|
+
// === FILE: index.html ===
|
|
71763
|
+
// <!doctype html><img src="logo.png">...
|
|
71764
|
+
// === FILE: logo.png base64 ===
|
|
71765
|
+
// iVBORw0KGgoAAA...
|
|
71754
71766
|
async () => {
|
|
71755
|
-
const mp = wix.multipart(); //
|
|
71756
|
-
const res = await wix.request({
|
|
71757
|
-
|
|
71758
|
-
|
|
71759
|
-
url: "https://www.wixapis.com/.../upload",
|
|
71760
|
-
headers: { "Content-Type": mp.contentType },
|
|
71761
|
-
body: mp.body
|
|
71762
|
-
});
|
|
71767
|
+
const mp = wix.multipart(); // all entries from the files param; base64 ones decoded to raw bytes
|
|
71768
|
+
const res = await wix.request({ scope: "account", method: "POST",
|
|
71769
|
+
url: "https://www.wixapis.com/.../drop",
|
|
71770
|
+
headers: { "Content-Type": mp.contentType }, body: mp.body });
|
|
71763
71771
|
return res.data;
|
|
71764
71772
|
}
|
|
71765
71773
|
\`\`\`
|
|
71774
|
+
DOWNLOAD + EDIT + RE-UPLOAD: fetch the zip as base64, \`wix.unzip()\` it, edit text via \`entry.text()\`, keep binary as bytes, and hand the entries back to \`wix.multipart()\`:
|
|
71775
|
+
\`\`\`javascript
|
|
71776
|
+
const r = await wix.request({ scope: "account", method: "GET", responseType: "base64", url: zipUrl });
|
|
71777
|
+
const entries = await wix.unzip(r.data); // [{ path, bytes, text() }]
|
|
71778
|
+
const edited = entries.map(e => e.path === "index.html"
|
|
71779
|
+
? { path: e.path, content: e.text().replace("Old title", "New title") }
|
|
71780
|
+
: e); // images etc. pass through untouched as bytes
|
|
71781
|
+
const mp = wix.multipart(edited);
|
|
71782
|
+
\`\`\`
|
|
71766
71783
|
`;
|
|
71767
71784
|
var EXECUTE_WIX_API_WQL = dedent_default`
|
|
71768
71785
|
For query and search endpoints: each endpoint declares which fields it can filter and sort by, and with which operators. That list is closed for fields and their operators and covers that endpoint only, and a field's presence in the response is no evidence it can be filtered on. It lives in the method's declared capabilities, and some resources also publish it as a "Supported Filters and Sorting" page. Logical operators are WQL syntax rather than field capabilities and never appear in it. Anything else errors or silently returns the wrong rows; fetch a bounded page and filter it in your own code instead.
|
package/build/cjs/index.cjs
CHANGED
|
@@ -37353,32 +37353,49 @@ var ACCOUNT_SITE_EXECUTE_SCOPE = dedent_default`
|
|
|
37353
37353
|
request<T = unknown>(options: WixRequestOptions): Promise<WixResponse<T>>;
|
|
37354
37354
|
// Build a multipart/form-data body from files (defaults to the \`files\`
|
|
37355
37355
|
// global). Each file becomes a part named fieldName (default "files") with
|
|
37356
|
-
// its path as the filename
|
|
37356
|
+
// its path as the filename; \`body\` is bytes so binary parts stay intact.
|
|
37357
|
+
// Pass a base64 entry for binary (an image/font): { path, base64 }, or a
|
|
37358
|
+
// \`files\`-param entry tagged \`base64\`.
|
|
37357
37359
|
multipart(
|
|
37358
|
-
files?: Array<{ path: string; content
|
|
37360
|
+
files?: Array<{ path: string; content?: string; base64?: string; bytes?: Uint8Array; contentType?: string }>,
|
|
37359
37361
|
options?: { fieldName?: string }
|
|
37360
|
-
): { body:
|
|
37362
|
+
): { body: Uint8Array; contentType: string };
|
|
37363
|
+
// Unzip a downloaded site archive (base64 string or bytes) into entries with
|
|
37364
|
+
// RAW bytes (binary-safe); entry.text() decodes a text file. Entries can be
|
|
37365
|
+
// passed straight back to wix.multipart() for a re-upload.
|
|
37366
|
+
unzip(input: string | Uint8Array): Promise<Array<{ path: string; bytes: Uint8Array; text(): string }>>;
|
|
37361
37367
|
};
|
|
37362
37368
|
declare const siteId: string | undefined;
|
|
37363
|
-
// Files from the ExecuteWixAPI \`files\` param
|
|
37364
|
-
|
|
37369
|
+
// Files from the ExecuteWixAPI \`files\` param. Text entries have \`content\`;
|
|
37370
|
+
// an entry tagged \`=== FILE: <path> base64 ===\` has encoding:'base64' and
|
|
37371
|
+
// base64 \`content\` (a binary file — image, font).
|
|
37372
|
+
declare const files: Array<{ path: string; content: string; encoding?: "base64" }>;
|
|
37365
37373
|
\`\`\`
|
|
37366
37374
|
|
|
37367
|
-
FILE UPLOADS:
|
|
37375
|
+
FILE UPLOADS: put every file in the \`files\` param (never inline in \`code\`). Text goes raw; a small binary (icon, logo, font) rides as a \`base64\`-tagged entry — large images/video are referenced by URL (\`<img src="https://...">\`), not bundled. \`wix.multipart()\` turns the whole set into one upload body (bytes, so binary is safe):
|
|
37368
37376
|
\`\`\`javascript
|
|
37369
|
-
// files param:
|
|
37377
|
+
// files param:
|
|
37378
|
+
// === FILE: index.html ===
|
|
37379
|
+
// <!doctype html><img src="logo.png">...
|
|
37380
|
+
// === FILE: logo.png base64 ===
|
|
37381
|
+
// iVBORw0KGgoAAA...
|
|
37370
37382
|
async () => {
|
|
37371
|
-
const mp = wix.multipart(); //
|
|
37372
|
-
const res = await wix.request({
|
|
37373
|
-
|
|
37374
|
-
|
|
37375
|
-
url: "https://www.wixapis.com/.../upload",
|
|
37376
|
-
headers: { "Content-Type": mp.contentType },
|
|
37377
|
-
body: mp.body
|
|
37378
|
-
});
|
|
37383
|
+
const mp = wix.multipart(); // all entries from the files param; base64 ones decoded to raw bytes
|
|
37384
|
+
const res = await wix.request({ scope: "account", method: "POST",
|
|
37385
|
+
url: "https://www.wixapis.com/.../drop",
|
|
37386
|
+
headers: { "Content-Type": mp.contentType }, body: mp.body });
|
|
37379
37387
|
return res.data;
|
|
37380
37388
|
}
|
|
37381
37389
|
\`\`\`
|
|
37390
|
+
DOWNLOAD + EDIT + RE-UPLOAD: fetch the zip as base64, \`wix.unzip()\` it, edit text via \`entry.text()\`, keep binary as bytes, and hand the entries back to \`wix.multipart()\`:
|
|
37391
|
+
\`\`\`javascript
|
|
37392
|
+
const r = await wix.request({ scope: "account", method: "GET", responseType: "base64", url: zipUrl });
|
|
37393
|
+
const entries = await wix.unzip(r.data); // [{ path, bytes, text() }]
|
|
37394
|
+
const edited = entries.map(e => e.path === "index.html"
|
|
37395
|
+
? { path: e.path, content: e.text().replace("Old title", "New title") }
|
|
37396
|
+
: e); // images etc. pass through untouched as bytes
|
|
37397
|
+
const mp = wix.multipart(edited);
|
|
37398
|
+
\`\`\`
|
|
37382
37399
|
`;
|
|
37383
37400
|
var EXECUTE_WIX_API_WQL = dedent_default`
|
|
37384
37401
|
For query and search endpoints: each endpoint declares which fields it can filter and sort by, and with which operators. That list is closed for fields and their operators and covers that endpoint only, and a field's presence in the response is no evidence it can be filtered on. It lives in the method's declared capabilities, and some resources also publish it as a "Supported Filters and Sorting" page. Logical operators are WQL syntax rather than field capabilities and never appear in it. Anything else errors or silently returns the wrong rows; fetch a bounded page and filter it in your own code instead.
|
|
@@ -53183,10 +53200,11 @@ function addExecuteTool(server, options) {
|
|
|
53183
53200
|
sourceDocUrls: external_exports.array(external_exports.string()).describe(d2.sourceDocUrls),
|
|
53184
53201
|
files: external_exports.string().optional().describe(
|
|
53185
53202
|
[
|
|
53186
|
-
"Optional bundle of raw file contents for uploads, so file bytes never go through the `code` JavaScript (no escaping, no string-literal/`${}`/backtick pitfalls).",
|
|
53187
|
-
"Format:
|
|
53188
|
-
'
|
|
53189
|
-
|
|
53203
|
+
"Optional bundle of raw file contents for uploads, so file bytes never go through the `code` JavaScript (no escaping, no string-literal/`${}`/backtick pitfalls). Never inline file contents in `code`.",
|
|
53204
|
+
"Format: sections delimited by a line `=== FILE: <path> ===` (text, raw) or `=== FILE: <path> base64 ===` (binary, base64); `<path>` is relative to the site root. Example:",
|
|
53205
|
+
'`=== FILE: index.html ===\\n<!doctype html><img src="logo.png">\\n=== FILE: assets/app.js ===\\nconsole.log(1)\\n=== FILE: logo.png base64 ===\\niVBORw0KGgo...`',
|
|
53206
|
+
'In `code` they are the `files` global (`{ path, content, encoding?: "base64" }[]`); `wix.multipart()` turns them into one binary-safe `multipart/form-data` body: `const mp = wix.multipart(); await wix.request({ scope: "account", method: "POST", url, headers: { "Content-Type": mp.contentType }, body: mp.body });`.',
|
|
53207
|
+
'Use base64 entries for small assets (icons, logos, fonts) and for files you downloaded and are re-uploading; large images/video go in by URL (`<img src="https://...">`), not in the bundle. A file containing a line exactly like the delimiter is not supported.'
|
|
53190
53208
|
].join(" ")
|
|
53191
53209
|
),
|
|
53192
53210
|
// Visitor mode takes an agent-supplied token and pins the site; account/site
|
package/build/cjs/toolkit.cjs
CHANGED
|
@@ -17840,32 +17840,49 @@ var ACCOUNT_SITE_EXECUTE_SCOPE = dedent_default`
|
|
|
17840
17840
|
request<T = unknown>(options: WixRequestOptions): Promise<WixResponse<T>>;
|
|
17841
17841
|
// Build a multipart/form-data body from files (defaults to the \`files\`
|
|
17842
17842
|
// global). Each file becomes a part named fieldName (default "files") with
|
|
17843
|
-
// its path as the filename
|
|
17843
|
+
// its path as the filename; \`body\` is bytes so binary parts stay intact.
|
|
17844
|
+
// Pass a base64 entry for binary (an image/font): { path, base64 }, or a
|
|
17845
|
+
// \`files\`-param entry tagged \`base64\`.
|
|
17844
17846
|
multipart(
|
|
17845
|
-
files?: Array<{ path: string; content
|
|
17847
|
+
files?: Array<{ path: string; content?: string; base64?: string; bytes?: Uint8Array; contentType?: string }>,
|
|
17846
17848
|
options?: { fieldName?: string }
|
|
17847
|
-
): { body:
|
|
17849
|
+
): { body: Uint8Array; contentType: string };
|
|
17850
|
+
// Unzip a downloaded site archive (base64 string or bytes) into entries with
|
|
17851
|
+
// RAW bytes (binary-safe); entry.text() decodes a text file. Entries can be
|
|
17852
|
+
// passed straight back to wix.multipart() for a re-upload.
|
|
17853
|
+
unzip(input: string | Uint8Array): Promise<Array<{ path: string; bytes: Uint8Array; text(): string }>>;
|
|
17848
17854
|
};
|
|
17849
17855
|
declare const siteId: string | undefined;
|
|
17850
|
-
// Files from the ExecuteWixAPI \`files\` param
|
|
17851
|
-
|
|
17856
|
+
// Files from the ExecuteWixAPI \`files\` param. Text entries have \`content\`;
|
|
17857
|
+
// an entry tagged \`=== FILE: <path> base64 ===\` has encoding:'base64' and
|
|
17858
|
+
// base64 \`content\` (a binary file — image, font).
|
|
17859
|
+
declare const files: Array<{ path: string; content: string; encoding?: "base64" }>;
|
|
17852
17860
|
\`\`\`
|
|
17853
17861
|
|
|
17854
|
-
FILE UPLOADS:
|
|
17862
|
+
FILE UPLOADS: put every file in the \`files\` param (never inline in \`code\`). Text goes raw; a small binary (icon, logo, font) rides as a \`base64\`-tagged entry — large images/video are referenced by URL (\`<img src="https://...">\`), not bundled. \`wix.multipart()\` turns the whole set into one upload body (bytes, so binary is safe):
|
|
17855
17863
|
\`\`\`javascript
|
|
17856
|
-
// files param:
|
|
17864
|
+
// files param:
|
|
17865
|
+
// === FILE: index.html ===
|
|
17866
|
+
// <!doctype html><img src="logo.png">...
|
|
17867
|
+
// === FILE: logo.png base64 ===
|
|
17868
|
+
// iVBORw0KGgoAAA...
|
|
17857
17869
|
async () => {
|
|
17858
|
-
const mp = wix.multipart(); //
|
|
17859
|
-
const res = await wix.request({
|
|
17860
|
-
|
|
17861
|
-
|
|
17862
|
-
url: "https://www.wixapis.com/.../upload",
|
|
17863
|
-
headers: { "Content-Type": mp.contentType },
|
|
17864
|
-
body: mp.body
|
|
17865
|
-
});
|
|
17870
|
+
const mp = wix.multipart(); // all entries from the files param; base64 ones decoded to raw bytes
|
|
17871
|
+
const res = await wix.request({ scope: "account", method: "POST",
|
|
17872
|
+
url: "https://www.wixapis.com/.../drop",
|
|
17873
|
+
headers: { "Content-Type": mp.contentType }, body: mp.body });
|
|
17866
17874
|
return res.data;
|
|
17867
17875
|
}
|
|
17868
17876
|
\`\`\`
|
|
17877
|
+
DOWNLOAD + EDIT + RE-UPLOAD: fetch the zip as base64, \`wix.unzip()\` it, edit text via \`entry.text()\`, keep binary as bytes, and hand the entries back to \`wix.multipart()\`:
|
|
17878
|
+
\`\`\`javascript
|
|
17879
|
+
const r = await wix.request({ scope: "account", method: "GET", responseType: "base64", url: zipUrl });
|
|
17880
|
+
const entries = await wix.unzip(r.data); // [{ path, bytes, text() }]
|
|
17881
|
+
const edited = entries.map(e => e.path === "index.html"
|
|
17882
|
+
? { path: e.path, content: e.text().replace("Old title", "New title") }
|
|
17883
|
+
: e); // images etc. pass through untouched as bytes
|
|
17884
|
+
const mp = wix.multipart(edited);
|
|
17885
|
+
\`\`\`
|
|
17869
17886
|
`;
|
|
17870
17887
|
var EXECUTE_WIX_API_WQL = dedent_default`
|
|
17871
17888
|
For query and search endpoints: each endpoint declares which fields it can filter and sort by, and with which operators. That list is closed for fields and their operators and covers that endpoint only, and a field's presence in the response is no evidence it can be filtered on. It lives in the method's declared capabilities, and some resources also publish it as a "Supported Filters and Sorting" page. Logical operators are WQL syntax rather than field capabilities and never appear in it. Anything else errors or silently returns the wrong rows; fetch a bounded page and filter it in your own code instead.
|
|
@@ -22326,10 +22343,11 @@ function addExecuteTool(server, options) {
|
|
|
22326
22343
|
sourceDocUrls: external_exports.array(external_exports.string()).describe(d.sourceDocUrls),
|
|
22327
22344
|
files: external_exports.string().optional().describe(
|
|
22328
22345
|
[
|
|
22329
|
-
"Optional bundle of raw file contents for uploads, so file bytes never go through the `code` JavaScript (no escaping, no string-literal/`${}`/backtick pitfalls).",
|
|
22330
|
-
"Format:
|
|
22331
|
-
'
|
|
22332
|
-
|
|
22346
|
+
"Optional bundle of raw file contents for uploads, so file bytes never go through the `code` JavaScript (no escaping, no string-literal/`${}`/backtick pitfalls). Never inline file contents in `code`.",
|
|
22347
|
+
"Format: sections delimited by a line `=== FILE: <path> ===` (text, raw) or `=== FILE: <path> base64 ===` (binary, base64); `<path>` is relative to the site root. Example:",
|
|
22348
|
+
'`=== FILE: index.html ===\\n<!doctype html><img src="logo.png">\\n=== FILE: assets/app.js ===\\nconsole.log(1)\\n=== FILE: logo.png base64 ===\\niVBORw0KGgo...`',
|
|
22349
|
+
'In `code` they are the `files` global (`{ path, content, encoding?: "base64" }[]`); `wix.multipart()` turns them into one binary-safe `multipart/form-data` body: `const mp = wix.multipart(); await wix.request({ scope: "account", method: "POST", url, headers: { "Content-Type": mp.contentType }, body: mp.body });`.',
|
|
22350
|
+
'Use base64 entries for small assets (icons, logos, fonts) and for files you downloaded and are re-uploading; large images/video go in by URL (`<img src="https://...">`), not in the bundle. A file containing a line exactly like the delimiter is not supported.'
|
|
22333
22351
|
].join(" ")
|
|
22334
22352
|
),
|
|
22335
22353
|
// Visitor mode takes an agent-supplied token and pins the site; account/site
|
|
@@ -240,10 +240,11 @@ function addExecuteTool(server, options) {
|
|
|
240
240
|
.string()
|
|
241
241
|
.optional()
|
|
242
242
|
.describe([
|
|
243
|
-
'Optional bundle of raw file contents for uploads, so file bytes never go through the `code` JavaScript (no escaping, no string-literal/`${}`/backtick pitfalls).',
|
|
244
|
-
|
|
245
|
-
'
|
|
246
|
-
'
|
|
243
|
+
'Optional bundle of raw file contents for uploads, so file bytes never go through the `code` JavaScript (no escaping, no string-literal/`${}`/backtick pitfalls). Never inline file contents in `code`.',
|
|
244
|
+
'Format: sections delimited by a line `=== FILE: <path> ===` (text, raw) or `=== FILE: <path> base64 ===` (binary, base64); `<path>` is relative to the site root. Example:',
|
|
245
|
+
'`=== FILE: index.html ===\\n<!doctype html><img src="logo.png">\\n=== FILE: assets/app.js ===\\nconsole.log(1)\\n=== FILE: logo.png base64 ===\\niVBORw0KGgo...`',
|
|
246
|
+
'In `code` they are the `files` global (`{ path, content, encoding?: "base64" }[]`); `wix.multipart()` turns them into one binary-safe `multipart/form-data` body: `const mp = wix.multipart(); await wix.request({ scope: "account", method: "POST", url, headers: { "Content-Type": mp.contentType }, body: mp.body });`.',
|
|
247
|
+
'Use base64 entries for small assets (icons, logos, fonts) and for files you downloaded and are re-uploading; large images/video go in by URL (`<img src="https://...">`), not in the bundle. A file containing a line exactly like the delimiter is not supported.'
|
|
247
248
|
].join(' ')),
|
|
248
249
|
// Visitor mode takes an agent-supplied token and pins the site; account/site
|
|
249
250
|
// mode lets the agent pick the site.
|
|
@@ -167,32 +167,49 @@ const ACCOUNT_SITE_EXECUTE_SCOPE = dedent `
|
|
|
167
167
|
request<T = unknown>(options: WixRequestOptions): Promise<WixResponse<T>>;
|
|
168
168
|
// Build a multipart/form-data body from files (defaults to the \`files\`
|
|
169
169
|
// global). Each file becomes a part named fieldName (default "files") with
|
|
170
|
-
// its path as the filename
|
|
170
|
+
// its path as the filename; \`body\` is bytes so binary parts stay intact.
|
|
171
|
+
// Pass a base64 entry for binary (an image/font): { path, base64 }, or a
|
|
172
|
+
// \`files\`-param entry tagged \`base64\`.
|
|
171
173
|
multipart(
|
|
172
|
-
files?: Array<{ path: string; content
|
|
174
|
+
files?: Array<{ path: string; content?: string; base64?: string; bytes?: Uint8Array; contentType?: string }>,
|
|
173
175
|
options?: { fieldName?: string }
|
|
174
|
-
): { body:
|
|
176
|
+
): { body: Uint8Array; contentType: string };
|
|
177
|
+
// Unzip a downloaded site archive (base64 string or bytes) into entries with
|
|
178
|
+
// RAW bytes (binary-safe); entry.text() decodes a text file. Entries can be
|
|
179
|
+
// passed straight back to wix.multipart() for a re-upload.
|
|
180
|
+
unzip(input: string | Uint8Array): Promise<Array<{ path: string; bytes: Uint8Array; text(): string }>>;
|
|
175
181
|
};
|
|
176
182
|
declare const siteId: string | undefined;
|
|
177
|
-
// Files from the ExecuteWixAPI \`files\` param
|
|
178
|
-
|
|
183
|
+
// Files from the ExecuteWixAPI \`files\` param. Text entries have \`content\`;
|
|
184
|
+
// an entry tagged \`=== FILE: <path> base64 ===\` has encoding:'base64' and
|
|
185
|
+
// base64 \`content\` (a binary file — image, font).
|
|
186
|
+
declare const files: Array<{ path: string; content: string; encoding?: "base64" }>;
|
|
179
187
|
\`\`\`
|
|
180
188
|
|
|
181
|
-
FILE UPLOADS:
|
|
189
|
+
FILE UPLOADS: put every file in the \`files\` param (never inline in \`code\`). Text goes raw; a small binary (icon, logo, font) rides as a \`base64\`-tagged entry — large images/video are referenced by URL (\`<img src="https://...">\`), not bundled. \`wix.multipart()\` turns the whole set into one upload body (bytes, so binary is safe):
|
|
182
190
|
\`\`\`javascript
|
|
183
|
-
// files param:
|
|
191
|
+
// files param:
|
|
192
|
+
// === FILE: index.html ===
|
|
193
|
+
// <!doctype html><img src="logo.png">...
|
|
194
|
+
// === FILE: logo.png base64 ===
|
|
195
|
+
// iVBORw0KGgoAAA...
|
|
184
196
|
async () => {
|
|
185
|
-
const mp = wix.multipart(); //
|
|
186
|
-
const res = await wix.request({
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
url: "https://www.wixapis.com/.../upload",
|
|
190
|
-
headers: { "Content-Type": mp.contentType },
|
|
191
|
-
body: mp.body
|
|
192
|
-
});
|
|
197
|
+
const mp = wix.multipart(); // all entries from the files param; base64 ones decoded to raw bytes
|
|
198
|
+
const res = await wix.request({ scope: "account", method: "POST",
|
|
199
|
+
url: "https://www.wixapis.com/.../drop",
|
|
200
|
+
headers: { "Content-Type": mp.contentType }, body: mp.body });
|
|
193
201
|
return res.data;
|
|
194
202
|
}
|
|
195
203
|
\`\`\`
|
|
204
|
+
DOWNLOAD + EDIT + RE-UPLOAD: fetch the zip as base64, \`wix.unzip()\` it, edit text via \`entry.text()\`, keep binary as bytes, and hand the entries back to \`wix.multipart()\`:
|
|
205
|
+
\`\`\`javascript
|
|
206
|
+
const r = await wix.request({ scope: "account", method: "GET", responseType: "base64", url: zipUrl });
|
|
207
|
+
const entries = await wix.unzip(r.data); // [{ path, bytes, text() }]
|
|
208
|
+
const edited = entries.map(e => e.path === "index.html"
|
|
209
|
+
? { path: e.path, content: e.text().replace("Old title", "New title") }
|
|
210
|
+
: e); // images etc. pass through untouched as bytes
|
|
211
|
+
const mp = wix.multipart(edited);
|
|
212
|
+
\`\`\`
|
|
196
213
|
`;
|
|
197
214
|
const EXECUTE_WIX_API_WQL = dedent `
|
|
198
215
|
For query and search endpoints: each endpoint declares which fields it can filter and sort by, and with which operators. That list is closed for fields and their operators and covers that endpoint only, and a field's presence in the response is no evidence it can be filtered on. It lives in the method's declared capabilities, and some resources also publish it as a "Supported Filters and Sorting" page. Logical operators are WQL syntax rather than field capabilities and never appear in it. Anything else errors or silently returns the wrong rows; fetch a bounded page and filter it in your own code instead.
|
package/build/esm/index.js
CHANGED
|
@@ -31066,32 +31066,49 @@ var ACCOUNT_SITE_EXECUTE_SCOPE = dedent_default`
|
|
|
31066
31066
|
request<T = unknown>(options: WixRequestOptions): Promise<WixResponse<T>>;
|
|
31067
31067
|
// Build a multipart/form-data body from files (defaults to the \`files\`
|
|
31068
31068
|
// global). Each file becomes a part named fieldName (default "files") with
|
|
31069
|
-
// its path as the filename
|
|
31069
|
+
// its path as the filename; \`body\` is bytes so binary parts stay intact.
|
|
31070
|
+
// Pass a base64 entry for binary (an image/font): { path, base64 }, or a
|
|
31071
|
+
// \`files\`-param entry tagged \`base64\`.
|
|
31070
31072
|
multipart(
|
|
31071
|
-
files?: Array<{ path: string; content
|
|
31073
|
+
files?: Array<{ path: string; content?: string; base64?: string; bytes?: Uint8Array; contentType?: string }>,
|
|
31072
31074
|
options?: { fieldName?: string }
|
|
31073
|
-
): { body:
|
|
31075
|
+
): { body: Uint8Array; contentType: string };
|
|
31076
|
+
// Unzip a downloaded site archive (base64 string or bytes) into entries with
|
|
31077
|
+
// RAW bytes (binary-safe); entry.text() decodes a text file. Entries can be
|
|
31078
|
+
// passed straight back to wix.multipart() for a re-upload.
|
|
31079
|
+
unzip(input: string | Uint8Array): Promise<Array<{ path: string; bytes: Uint8Array; text(): string }>>;
|
|
31074
31080
|
};
|
|
31075
31081
|
declare const siteId: string | undefined;
|
|
31076
|
-
// Files from the ExecuteWixAPI \`files\` param
|
|
31077
|
-
|
|
31082
|
+
// Files from the ExecuteWixAPI \`files\` param. Text entries have \`content\`;
|
|
31083
|
+
// an entry tagged \`=== FILE: <path> base64 ===\` has encoding:'base64' and
|
|
31084
|
+
// base64 \`content\` (a binary file — image, font).
|
|
31085
|
+
declare const files: Array<{ path: string; content: string; encoding?: "base64" }>;
|
|
31078
31086
|
\`\`\`
|
|
31079
31087
|
|
|
31080
|
-
FILE UPLOADS:
|
|
31088
|
+
FILE UPLOADS: put every file in the \`files\` param (never inline in \`code\`). Text goes raw; a small binary (icon, logo, font) rides as a \`base64\`-tagged entry — large images/video are referenced by URL (\`<img src="https://...">\`), not bundled. \`wix.multipart()\` turns the whole set into one upload body (bytes, so binary is safe):
|
|
31081
31089
|
\`\`\`javascript
|
|
31082
|
-
// files param:
|
|
31090
|
+
// files param:
|
|
31091
|
+
// === FILE: index.html ===
|
|
31092
|
+
// <!doctype html><img src="logo.png">...
|
|
31093
|
+
// === FILE: logo.png base64 ===
|
|
31094
|
+
// iVBORw0KGgoAAA...
|
|
31083
31095
|
async () => {
|
|
31084
|
-
const mp = wix.multipart(); //
|
|
31085
|
-
const res = await wix.request({
|
|
31086
|
-
|
|
31087
|
-
|
|
31088
|
-
url: "https://www.wixapis.com/.../upload",
|
|
31089
|
-
headers: { "Content-Type": mp.contentType },
|
|
31090
|
-
body: mp.body
|
|
31091
|
-
});
|
|
31096
|
+
const mp = wix.multipart(); // all entries from the files param; base64 ones decoded to raw bytes
|
|
31097
|
+
const res = await wix.request({ scope: "account", method: "POST",
|
|
31098
|
+
url: "https://www.wixapis.com/.../drop",
|
|
31099
|
+
headers: { "Content-Type": mp.contentType }, body: mp.body });
|
|
31092
31100
|
return res.data;
|
|
31093
31101
|
}
|
|
31094
31102
|
\`\`\`
|
|
31103
|
+
DOWNLOAD + EDIT + RE-UPLOAD: fetch the zip as base64, \`wix.unzip()\` it, edit text via \`entry.text()\`, keep binary as bytes, and hand the entries back to \`wix.multipart()\`:
|
|
31104
|
+
\`\`\`javascript
|
|
31105
|
+
const r = await wix.request({ scope: "account", method: "GET", responseType: "base64", url: zipUrl });
|
|
31106
|
+
const entries = await wix.unzip(r.data); // [{ path, bytes, text() }]
|
|
31107
|
+
const edited = entries.map(e => e.path === "index.html"
|
|
31108
|
+
? { path: e.path, content: e.text().replace("Old title", "New title") }
|
|
31109
|
+
: e); // images etc. pass through untouched as bytes
|
|
31110
|
+
const mp = wix.multipart(edited);
|
|
31111
|
+
\`\`\`
|
|
31095
31112
|
`;
|
|
31096
31113
|
var EXECUTE_WIX_API_WQL = dedent_default`
|
|
31097
31114
|
For query and search endpoints: each endpoint declares which fields it can filter and sort by, and with which operators. That list is closed for fields and their operators and covers that endpoint only, and a field's presence in the response is no evidence it can be filtered on. It lives in the method's declared capabilities, and some resources also publish it as a "Supported Filters and Sorting" page. Logical operators are WQL syntax rather than field capabilities and never appear in it. Anything else errors or silently returns the wrong rows; fetch a bounded page and filter it in your own code instead.
|
|
@@ -46947,10 +46964,11 @@ function addExecuteTool(server, options) {
|
|
|
46947
46964
|
sourceDocUrls: external_exports.array(external_exports.string()).describe(d2.sourceDocUrls),
|
|
46948
46965
|
files: external_exports.string().optional().describe(
|
|
46949
46966
|
[
|
|
46950
|
-
"Optional bundle of raw file contents for uploads, so file bytes never go through the `code` JavaScript (no escaping, no string-literal/`${}`/backtick pitfalls).",
|
|
46951
|
-
"Format:
|
|
46952
|
-
'
|
|
46953
|
-
|
|
46967
|
+
"Optional bundle of raw file contents for uploads, so file bytes never go through the `code` JavaScript (no escaping, no string-literal/`${}`/backtick pitfalls). Never inline file contents in `code`.",
|
|
46968
|
+
"Format: sections delimited by a line `=== FILE: <path> ===` (text, raw) or `=== FILE: <path> base64 ===` (binary, base64); `<path>` is relative to the site root. Example:",
|
|
46969
|
+
'`=== FILE: index.html ===\\n<!doctype html><img src="logo.png">\\n=== FILE: assets/app.js ===\\nconsole.log(1)\\n=== FILE: logo.png base64 ===\\niVBORw0KGgo...`',
|
|
46970
|
+
'In `code` they are the `files` global (`{ path, content, encoding?: "base64" }[]`); `wix.multipart()` turns them into one binary-safe `multipart/form-data` body: `const mp = wix.multipart(); await wix.request({ scope: "account", method: "POST", url, headers: { "Content-Type": mp.contentType }, body: mp.body });`.',
|
|
46971
|
+
'Use base64 entries for small assets (icons, logos, fonts) and for files you downloaded and are re-uploading; large images/video go in by URL (`<img src="https://...">`), not in the bundle. A file containing a line exactly like the delimiter is not supported.'
|
|
46954
46972
|
].join(" ")
|
|
46955
46973
|
),
|
|
46956
46974
|
// Visitor mode takes an agent-supplied token and pins the site; account/site
|
package/build/esm/toolkit.js
CHANGED
|
@@ -12262,32 +12262,49 @@ var ACCOUNT_SITE_EXECUTE_SCOPE = dedent_default`
|
|
|
12262
12262
|
request<T = unknown>(options: WixRequestOptions): Promise<WixResponse<T>>;
|
|
12263
12263
|
// Build a multipart/form-data body from files (defaults to the \`files\`
|
|
12264
12264
|
// global). Each file becomes a part named fieldName (default "files") with
|
|
12265
|
-
// its path as the filename
|
|
12265
|
+
// its path as the filename; \`body\` is bytes so binary parts stay intact.
|
|
12266
|
+
// Pass a base64 entry for binary (an image/font): { path, base64 }, or a
|
|
12267
|
+
// \`files\`-param entry tagged \`base64\`.
|
|
12266
12268
|
multipart(
|
|
12267
|
-
files?: Array<{ path: string; content
|
|
12269
|
+
files?: Array<{ path: string; content?: string; base64?: string; bytes?: Uint8Array; contentType?: string }>,
|
|
12268
12270
|
options?: { fieldName?: string }
|
|
12269
|
-
): { body:
|
|
12271
|
+
): { body: Uint8Array; contentType: string };
|
|
12272
|
+
// Unzip a downloaded site archive (base64 string or bytes) into entries with
|
|
12273
|
+
// RAW bytes (binary-safe); entry.text() decodes a text file. Entries can be
|
|
12274
|
+
// passed straight back to wix.multipart() for a re-upload.
|
|
12275
|
+
unzip(input: string | Uint8Array): Promise<Array<{ path: string; bytes: Uint8Array; text(): string }>>;
|
|
12270
12276
|
};
|
|
12271
12277
|
declare const siteId: string | undefined;
|
|
12272
|
-
// Files from the ExecuteWixAPI \`files\` param
|
|
12273
|
-
|
|
12278
|
+
// Files from the ExecuteWixAPI \`files\` param. Text entries have \`content\`;
|
|
12279
|
+
// an entry tagged \`=== FILE: <path> base64 ===\` has encoding:'base64' and
|
|
12280
|
+
// base64 \`content\` (a binary file — image, font).
|
|
12281
|
+
declare const files: Array<{ path: string; content: string; encoding?: "base64" }>;
|
|
12274
12282
|
\`\`\`
|
|
12275
12283
|
|
|
12276
|
-
FILE UPLOADS:
|
|
12284
|
+
FILE UPLOADS: put every file in the \`files\` param (never inline in \`code\`). Text goes raw; a small binary (icon, logo, font) rides as a \`base64\`-tagged entry — large images/video are referenced by URL (\`<img src="https://...">\`), not bundled. \`wix.multipart()\` turns the whole set into one upload body (bytes, so binary is safe):
|
|
12277
12285
|
\`\`\`javascript
|
|
12278
|
-
// files param:
|
|
12286
|
+
// files param:
|
|
12287
|
+
// === FILE: index.html ===
|
|
12288
|
+
// <!doctype html><img src="logo.png">...
|
|
12289
|
+
// === FILE: logo.png base64 ===
|
|
12290
|
+
// iVBORw0KGgoAAA...
|
|
12279
12291
|
async () => {
|
|
12280
|
-
const mp = wix.multipart(); //
|
|
12281
|
-
const res = await wix.request({
|
|
12282
|
-
|
|
12283
|
-
|
|
12284
|
-
url: "https://www.wixapis.com/.../upload",
|
|
12285
|
-
headers: { "Content-Type": mp.contentType },
|
|
12286
|
-
body: mp.body
|
|
12287
|
-
});
|
|
12292
|
+
const mp = wix.multipart(); // all entries from the files param; base64 ones decoded to raw bytes
|
|
12293
|
+
const res = await wix.request({ scope: "account", method: "POST",
|
|
12294
|
+
url: "https://www.wixapis.com/.../drop",
|
|
12295
|
+
headers: { "Content-Type": mp.contentType }, body: mp.body });
|
|
12288
12296
|
return res.data;
|
|
12289
12297
|
}
|
|
12290
12298
|
\`\`\`
|
|
12299
|
+
DOWNLOAD + EDIT + RE-UPLOAD: fetch the zip as base64, \`wix.unzip()\` it, edit text via \`entry.text()\`, keep binary as bytes, and hand the entries back to \`wix.multipart()\`:
|
|
12300
|
+
\`\`\`javascript
|
|
12301
|
+
const r = await wix.request({ scope: "account", method: "GET", responseType: "base64", url: zipUrl });
|
|
12302
|
+
const entries = await wix.unzip(r.data); // [{ path, bytes, text() }]
|
|
12303
|
+
const edited = entries.map(e => e.path === "index.html"
|
|
12304
|
+
? { path: e.path, content: e.text().replace("Old title", "New title") }
|
|
12305
|
+
: e); // images etc. pass through untouched as bytes
|
|
12306
|
+
const mp = wix.multipart(edited);
|
|
12307
|
+
\`\`\`
|
|
12291
12308
|
`;
|
|
12292
12309
|
var EXECUTE_WIX_API_WQL = dedent_default`
|
|
12293
12310
|
For query and search endpoints: each endpoint declares which fields it can filter and sort by, and with which operators. That list is closed for fields and their operators and covers that endpoint only, and a field's presence in the response is no evidence it can be filtered on. It lives in the method's declared capabilities, and some resources also publish it as a "Supported Filters and Sorting" page. Logical operators are WQL syntax rather than field capabilities and never appear in it. Anything else errors or silently returns the wrong rows; fetch a bounded page and filter it in your own code instead.
|
|
@@ -16745,10 +16762,11 @@ function addExecuteTool(server, options) {
|
|
|
16745
16762
|
sourceDocUrls: external_exports.array(external_exports.string()).describe(d.sourceDocUrls),
|
|
16746
16763
|
files: external_exports.string().optional().describe(
|
|
16747
16764
|
[
|
|
16748
|
-
"Optional bundle of raw file contents for uploads, so file bytes never go through the `code` JavaScript (no escaping, no string-literal/`${}`/backtick pitfalls).",
|
|
16749
|
-
"Format:
|
|
16750
|
-
'
|
|
16751
|
-
|
|
16765
|
+
"Optional bundle of raw file contents for uploads, so file bytes never go through the `code` JavaScript (no escaping, no string-literal/`${}`/backtick pitfalls). Never inline file contents in `code`.",
|
|
16766
|
+
"Format: sections delimited by a line `=== FILE: <path> ===` (text, raw) or `=== FILE: <path> base64 ===` (binary, base64); `<path>` is relative to the site root. Example:",
|
|
16767
|
+
'`=== FILE: index.html ===\\n<!doctype html><img src="logo.png">\\n=== FILE: assets/app.js ===\\nconsole.log(1)\\n=== FILE: logo.png base64 ===\\niVBORw0KGgo...`',
|
|
16768
|
+
'In `code` they are the `files` global (`{ path, content, encoding?: "base64" }[]`); `wix.multipart()` turns them into one binary-safe `multipart/form-data` body: `const mp = wix.multipart(); await wix.request({ scope: "account", method: "POST", url, headers: { "Content-Type": mp.contentType }, body: mp.body });`.',
|
|
16769
|
+
'Use base64 entries for small assets (icons, logos, fonts) and for files you downloaded and are re-uploading; large images/video go in by URL (`<img src="https://...">`), not in the bundle. A file containing a line exactly like the delimiter is not supported.'
|
|
16752
16770
|
].join(" ")
|
|
16753
16771
|
),
|
|
16754
16772
|
// Visitor mode takes an agent-supplied token and pins the site; account/site
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.89",
|
|
4
4
|
"description": "A Model Context Protocol server for Wix AI tools",
|
|
5
5
|
"bin": "./build/bin-standalone.js",
|
|
6
6
|
"dependencies": {
|
|
@@ -133,5 +133,5 @@
|
|
|
133
133
|
]
|
|
134
134
|
}
|
|
135
135
|
},
|
|
136
|
-
"falconPackageHash": "
|
|
136
|
+
"falconPackageHash": "56dddfd3c4abc5ee20298c4a7f54f409dc405abaf86f58fcc82d48ab"
|
|
137
137
|
}
|