@webstudio-is/protocol 0.274.4 → 0.274.5
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/lib/index.js +36 -19
- package/lib/types/builder-api/operations.d.ts +51 -0
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -5569,7 +5569,7 @@ var publicApiOperationDocumentation = [
|
|
|
5569
5569
|
description: "Update page settings and metadata",
|
|
5570
5570
|
requiredOptions: ["page", "json"],
|
|
5571
5571
|
examples: [
|
|
5572
|
-
'webstudio update-page --page page-id --title Pricing --description "Pricing plans" --json'
|
|
5572
|
+
'webstudio update-page --page page-id --title "\\"Pricing\\"" --description "\\"Pricing plans\\"" --json'
|
|
5573
5573
|
]
|
|
5574
5574
|
},
|
|
5575
5575
|
{
|
|
@@ -5742,7 +5742,7 @@ var publicApiOperationDocumentation = [
|
|
|
5742
5742
|
},
|
|
5743
5743
|
{
|
|
5744
5744
|
command: "update-props",
|
|
5745
|
-
description: "Create or update element
|
|
5745
|
+
description: "Create or update direct element prop values; use this for fixed strings, numbers, booleans, JSON, assets, pages, parameters, and resources. Editor tokens are limited to content-mode props",
|
|
5746
5746
|
requiredOptions: ["input", "json"],
|
|
5747
5747
|
examples: ["webstudio update-props --input props.json --json"]
|
|
5748
5748
|
},
|
|
@@ -5754,7 +5754,7 @@ var publicApiOperationDocumentation = [
|
|
|
5754
5754
|
},
|
|
5755
5755
|
{
|
|
5756
5756
|
command: "bind-props",
|
|
5757
|
-
description: "Bind element props to expressions, parameters, resources, or actions",
|
|
5757
|
+
description: "Bind element props to dynamic expressions, parameters, resources, or actions. Do not use for fixed string values; use update-props instead",
|
|
5758
5758
|
requiredOptions: ["input", "json"],
|
|
5759
5759
|
examples: ["webstudio bind-props --input bindings.json --json"]
|
|
5760
5760
|
},
|
|
@@ -6495,6 +6495,7 @@ var withDefaultPermit = (operation) => {
|
|
|
6495
6495
|
permit: operation.permit ?? (operation.method === "query" ? "view" : "build"),
|
|
6496
6496
|
description: documentation.description,
|
|
6497
6497
|
inputFields: inputFieldsLookup[operation.command] ?? [],
|
|
6498
|
+
inputFieldTypes: operation.inputFieldTypes ?? {},
|
|
6498
6499
|
requiredOptions: documentation.requiredOptions,
|
|
6499
6500
|
examples: documentation.examples,
|
|
6500
6501
|
localCapable: runtimeOperation !== void 0,
|
|
@@ -6724,14 +6725,16 @@ var publicApiOperationInputs = [
|
|
|
6724
6725
|
id: "instances.append",
|
|
6725
6726
|
method: "mutation",
|
|
6726
6727
|
path: "api.instances.append",
|
|
6727
|
-
client: "appendInstance"
|
|
6728
|
+
client: "appendInstance",
|
|
6729
|
+
inputFieldTypes: { children: "array" }
|
|
6728
6730
|
},
|
|
6729
6731
|
{
|
|
6730
6732
|
command: "move-instance",
|
|
6731
6733
|
id: "instances.move",
|
|
6732
6734
|
method: "mutation",
|
|
6733
6735
|
path: "api.instances.move",
|
|
6734
|
-
client: "moveInstance"
|
|
6736
|
+
client: "moveInstance",
|
|
6737
|
+
inputFieldTypes: { moves: "array" }
|
|
6735
6738
|
},
|
|
6736
6739
|
{
|
|
6737
6740
|
command: "clone-instance",
|
|
@@ -6745,7 +6748,8 @@ var publicApiOperationInputs = [
|
|
|
6745
6748
|
id: "instances.delete",
|
|
6746
6749
|
method: "mutation",
|
|
6747
6750
|
path: "api.instances.delete",
|
|
6748
|
-
client: "deleteInstance"
|
|
6751
|
+
client: "deleteInstance",
|
|
6752
|
+
inputFieldTypes: { instanceIds: "array" }
|
|
6749
6753
|
},
|
|
6750
6754
|
{
|
|
6751
6755
|
command: "update-props",
|
|
@@ -6753,7 +6757,8 @@ var publicApiOperationInputs = [
|
|
|
6753
6757
|
method: "mutation",
|
|
6754
6758
|
path: "api.instances.updateProps",
|
|
6755
6759
|
client: "updateProps",
|
|
6756
|
-
permit: "edit"
|
|
6760
|
+
permit: "edit",
|
|
6761
|
+
inputFieldTypes: { updates: "array" }
|
|
6757
6762
|
},
|
|
6758
6763
|
{
|
|
6759
6764
|
command: "delete-props",
|
|
@@ -6761,14 +6766,16 @@ var publicApiOperationInputs = [
|
|
|
6761
6766
|
method: "mutation",
|
|
6762
6767
|
path: "api.instances.deleteProps",
|
|
6763
6768
|
client: "deleteProps",
|
|
6764
|
-
permit: "edit"
|
|
6769
|
+
permit: "edit",
|
|
6770
|
+
inputFieldTypes: { deletions: "array" }
|
|
6765
6771
|
},
|
|
6766
6772
|
{
|
|
6767
6773
|
command: "bind-props",
|
|
6768
6774
|
id: "instances.bindProps",
|
|
6769
6775
|
method: "mutation",
|
|
6770
6776
|
path: "api.instances.bindProps",
|
|
6771
|
-
client: "bindProps"
|
|
6777
|
+
client: "bindProps",
|
|
6778
|
+
inputFieldTypes: { bindings: "array" }
|
|
6772
6779
|
},
|
|
6773
6780
|
{
|
|
6774
6781
|
command: "list-texts",
|
|
@@ -6797,14 +6804,16 @@ var publicApiOperationInputs = [
|
|
|
6797
6804
|
id: "styles.updateDeclarations",
|
|
6798
6805
|
method: "mutation",
|
|
6799
6806
|
path: "api.styles.updateDeclarations",
|
|
6800
|
-
client: "updateStyleDeclarations"
|
|
6807
|
+
client: "updateStyleDeclarations",
|
|
6808
|
+
inputFieldTypes: { updates: "array" }
|
|
6801
6809
|
},
|
|
6802
6810
|
{
|
|
6803
6811
|
command: "delete-styles",
|
|
6804
6812
|
id: "styles.deleteDeclarations",
|
|
6805
6813
|
method: "mutation",
|
|
6806
6814
|
path: "api.styles.deleteDeclarations",
|
|
6807
|
-
client: "deleteStyleDeclarations"
|
|
6815
|
+
client: "deleteStyleDeclarations",
|
|
6816
|
+
inputFieldTypes: { deletions: "array" }
|
|
6808
6817
|
},
|
|
6809
6818
|
{
|
|
6810
6819
|
command: "replace-styles",
|
|
@@ -6825,42 +6834,48 @@ var publicApiOperationInputs = [
|
|
|
6825
6834
|
id: "designTokens.create",
|
|
6826
6835
|
method: "mutation",
|
|
6827
6836
|
path: "api.designTokens.create",
|
|
6828
|
-
client: "createDesignTokens"
|
|
6837
|
+
client: "createDesignTokens",
|
|
6838
|
+
inputFieldTypes: { tokens: "array" }
|
|
6829
6839
|
},
|
|
6830
6840
|
{
|
|
6831
6841
|
command: "update-design-token-styles",
|
|
6832
6842
|
id: "designTokens.updateStyles",
|
|
6833
6843
|
method: "mutation",
|
|
6834
6844
|
path: "api.designTokens.updateStyles",
|
|
6835
|
-
client: "updateDesignTokenStyles"
|
|
6845
|
+
client: "updateDesignTokenStyles",
|
|
6846
|
+
inputFieldTypes: { updates: "array" }
|
|
6836
6847
|
},
|
|
6837
6848
|
{
|
|
6838
6849
|
command: "delete-design-token-styles",
|
|
6839
6850
|
id: "designTokens.deleteStyles",
|
|
6840
6851
|
method: "mutation",
|
|
6841
6852
|
path: "api.designTokens.deleteStyles",
|
|
6842
|
-
client: "deleteDesignTokenStyles"
|
|
6853
|
+
client: "deleteDesignTokenStyles",
|
|
6854
|
+
inputFieldTypes: { deletions: "array" }
|
|
6843
6855
|
},
|
|
6844
6856
|
{
|
|
6845
6857
|
command: "attach-design-token",
|
|
6846
6858
|
id: "designTokens.attach",
|
|
6847
6859
|
method: "mutation",
|
|
6848
6860
|
path: "api.designTokens.attach",
|
|
6849
|
-
client: "attachDesignToken"
|
|
6861
|
+
client: "attachDesignToken",
|
|
6862
|
+
inputFieldTypes: { instanceIds: "array" }
|
|
6850
6863
|
},
|
|
6851
6864
|
{
|
|
6852
6865
|
command: "detach-design-token",
|
|
6853
6866
|
id: "designTokens.detach",
|
|
6854
6867
|
method: "mutation",
|
|
6855
6868
|
path: "api.designTokens.detach",
|
|
6856
|
-
client: "detachDesignToken"
|
|
6869
|
+
client: "detachDesignToken",
|
|
6870
|
+
inputFieldTypes: { instanceIds: "array" }
|
|
6857
6871
|
},
|
|
6858
6872
|
{
|
|
6859
6873
|
command: "extract-design-token",
|
|
6860
6874
|
id: "designTokens.extract",
|
|
6861
6875
|
method: "mutation",
|
|
6862
6876
|
path: "api.designTokens.extract",
|
|
6863
|
-
client: "extractDesignToken"
|
|
6877
|
+
client: "extractDesignToken",
|
|
6878
|
+
inputFieldTypes: { instanceIds: "array", removeLocalProps: "array" }
|
|
6864
6879
|
},
|
|
6865
6880
|
{
|
|
6866
6881
|
command: "list-css-variables",
|
|
@@ -6881,7 +6896,8 @@ var publicApiOperationInputs = [
|
|
|
6881
6896
|
id: "cssVariables.delete",
|
|
6882
6897
|
method: "mutation",
|
|
6883
6898
|
path: "api.cssVariables.delete",
|
|
6884
|
-
client: "deleteCssVariables"
|
|
6899
|
+
client: "deleteCssVariables",
|
|
6900
|
+
inputFieldTypes: { names: "array" }
|
|
6885
6901
|
},
|
|
6886
6902
|
{
|
|
6887
6903
|
command: "rewrite-css-variable-refs",
|
|
@@ -7055,7 +7071,8 @@ var publicApiOperationInputs = [
|
|
|
7055
7071
|
id: "assets.delete",
|
|
7056
7072
|
method: "mutation",
|
|
7057
7073
|
path: "api.assets.delete",
|
|
7058
|
-
client: "deleteAssets"
|
|
7074
|
+
client: "deleteAssets",
|
|
7075
|
+
inputFieldTypes: { assetIdsOrPrefixes: "array" }
|
|
7059
7076
|
}
|
|
7060
7077
|
];
|
|
7061
7078
|
var publicApiOperations = publicApiOperationInputs.map(withDefaultPermit);
|
|
@@ -10,12 +10,14 @@ type PublicApiOperationInput = {
|
|
|
10
10
|
client: string;
|
|
11
11
|
permit?: PublicApiOperationPermit;
|
|
12
12
|
invalidatesNamespaces?: readonly PublicApiOperationNamespace[];
|
|
13
|
+
inputFieldTypes?: Partial<Record<string, "array">>;
|
|
13
14
|
};
|
|
14
15
|
export type PublicApiOperation<Command extends string = string> = Omit<PublicApiOperationInput, "command" | "permit"> & {
|
|
15
16
|
command: Command;
|
|
16
17
|
permit: PublicApiOperationPermit;
|
|
17
18
|
description: string;
|
|
18
19
|
inputFields: readonly string[];
|
|
20
|
+
inputFieldTypes: Partial<Record<string, "array">>;
|
|
19
21
|
requiredOptions?: readonly string[];
|
|
20
22
|
examples: readonly string[];
|
|
21
23
|
localCapable: boolean;
|
|
@@ -214,12 +216,18 @@ declare const publicApiOperationInputs: readonly [{
|
|
|
214
216
|
readonly method: "mutation";
|
|
215
217
|
readonly path: "api.instances.append";
|
|
216
218
|
readonly client: "appendInstance";
|
|
219
|
+
readonly inputFieldTypes: {
|
|
220
|
+
readonly children: "array";
|
|
221
|
+
};
|
|
217
222
|
}, {
|
|
218
223
|
readonly command: "move-instance";
|
|
219
224
|
readonly id: "instances.move";
|
|
220
225
|
readonly method: "mutation";
|
|
221
226
|
readonly path: "api.instances.move";
|
|
222
227
|
readonly client: "moveInstance";
|
|
228
|
+
readonly inputFieldTypes: {
|
|
229
|
+
readonly moves: "array";
|
|
230
|
+
};
|
|
223
231
|
}, {
|
|
224
232
|
readonly command: "clone-instance";
|
|
225
233
|
readonly id: "instances.clone";
|
|
@@ -232,6 +240,9 @@ declare const publicApiOperationInputs: readonly [{
|
|
|
232
240
|
readonly method: "mutation";
|
|
233
241
|
readonly path: "api.instances.delete";
|
|
234
242
|
readonly client: "deleteInstance";
|
|
243
|
+
readonly inputFieldTypes: {
|
|
244
|
+
readonly instanceIds: "array";
|
|
245
|
+
};
|
|
235
246
|
}, {
|
|
236
247
|
readonly command: "update-props";
|
|
237
248
|
readonly id: "instances.updateProps";
|
|
@@ -239,6 +250,9 @@ declare const publicApiOperationInputs: readonly [{
|
|
|
239
250
|
readonly path: "api.instances.updateProps";
|
|
240
251
|
readonly client: "updateProps";
|
|
241
252
|
readonly permit: "edit";
|
|
253
|
+
readonly inputFieldTypes: {
|
|
254
|
+
readonly updates: "array";
|
|
255
|
+
};
|
|
242
256
|
}, {
|
|
243
257
|
readonly command: "delete-props";
|
|
244
258
|
readonly id: "instances.deleteProps";
|
|
@@ -246,12 +260,18 @@ declare const publicApiOperationInputs: readonly [{
|
|
|
246
260
|
readonly path: "api.instances.deleteProps";
|
|
247
261
|
readonly client: "deleteProps";
|
|
248
262
|
readonly permit: "edit";
|
|
263
|
+
readonly inputFieldTypes: {
|
|
264
|
+
readonly deletions: "array";
|
|
265
|
+
};
|
|
249
266
|
}, {
|
|
250
267
|
readonly command: "bind-props";
|
|
251
268
|
readonly id: "instances.bindProps";
|
|
252
269
|
readonly method: "mutation";
|
|
253
270
|
readonly path: "api.instances.bindProps";
|
|
254
271
|
readonly client: "bindProps";
|
|
272
|
+
readonly inputFieldTypes: {
|
|
273
|
+
readonly bindings: "array";
|
|
274
|
+
};
|
|
255
275
|
}, {
|
|
256
276
|
readonly command: "list-texts";
|
|
257
277
|
readonly id: "instances.listTexts";
|
|
@@ -277,12 +297,18 @@ declare const publicApiOperationInputs: readonly [{
|
|
|
277
297
|
readonly method: "mutation";
|
|
278
298
|
readonly path: "api.styles.updateDeclarations";
|
|
279
299
|
readonly client: "updateStyleDeclarations";
|
|
300
|
+
readonly inputFieldTypes: {
|
|
301
|
+
readonly updates: "array";
|
|
302
|
+
};
|
|
280
303
|
}, {
|
|
281
304
|
readonly command: "delete-styles";
|
|
282
305
|
readonly id: "styles.deleteDeclarations";
|
|
283
306
|
readonly method: "mutation";
|
|
284
307
|
readonly path: "api.styles.deleteDeclarations";
|
|
285
308
|
readonly client: "deleteStyleDeclarations";
|
|
309
|
+
readonly inputFieldTypes: {
|
|
310
|
+
readonly deletions: "array";
|
|
311
|
+
};
|
|
286
312
|
}, {
|
|
287
313
|
readonly command: "replace-styles";
|
|
288
314
|
readonly id: "styles.replaceValues";
|
|
@@ -301,36 +327,55 @@ declare const publicApiOperationInputs: readonly [{
|
|
|
301
327
|
readonly method: "mutation";
|
|
302
328
|
readonly path: "api.designTokens.create";
|
|
303
329
|
readonly client: "createDesignTokens";
|
|
330
|
+
readonly inputFieldTypes: {
|
|
331
|
+
readonly tokens: "array";
|
|
332
|
+
};
|
|
304
333
|
}, {
|
|
305
334
|
readonly command: "update-design-token-styles";
|
|
306
335
|
readonly id: "designTokens.updateStyles";
|
|
307
336
|
readonly method: "mutation";
|
|
308
337
|
readonly path: "api.designTokens.updateStyles";
|
|
309
338
|
readonly client: "updateDesignTokenStyles";
|
|
339
|
+
readonly inputFieldTypes: {
|
|
340
|
+
readonly updates: "array";
|
|
341
|
+
};
|
|
310
342
|
}, {
|
|
311
343
|
readonly command: "delete-design-token-styles";
|
|
312
344
|
readonly id: "designTokens.deleteStyles";
|
|
313
345
|
readonly method: "mutation";
|
|
314
346
|
readonly path: "api.designTokens.deleteStyles";
|
|
315
347
|
readonly client: "deleteDesignTokenStyles";
|
|
348
|
+
readonly inputFieldTypes: {
|
|
349
|
+
readonly deletions: "array";
|
|
350
|
+
};
|
|
316
351
|
}, {
|
|
317
352
|
readonly command: "attach-design-token";
|
|
318
353
|
readonly id: "designTokens.attach";
|
|
319
354
|
readonly method: "mutation";
|
|
320
355
|
readonly path: "api.designTokens.attach";
|
|
321
356
|
readonly client: "attachDesignToken";
|
|
357
|
+
readonly inputFieldTypes: {
|
|
358
|
+
readonly instanceIds: "array";
|
|
359
|
+
};
|
|
322
360
|
}, {
|
|
323
361
|
readonly command: "detach-design-token";
|
|
324
362
|
readonly id: "designTokens.detach";
|
|
325
363
|
readonly method: "mutation";
|
|
326
364
|
readonly path: "api.designTokens.detach";
|
|
327
365
|
readonly client: "detachDesignToken";
|
|
366
|
+
readonly inputFieldTypes: {
|
|
367
|
+
readonly instanceIds: "array";
|
|
368
|
+
};
|
|
328
369
|
}, {
|
|
329
370
|
readonly command: "extract-design-token";
|
|
330
371
|
readonly id: "designTokens.extract";
|
|
331
372
|
readonly method: "mutation";
|
|
332
373
|
readonly path: "api.designTokens.extract";
|
|
333
374
|
readonly client: "extractDesignToken";
|
|
375
|
+
readonly inputFieldTypes: {
|
|
376
|
+
readonly instanceIds: "array";
|
|
377
|
+
readonly removeLocalProps: "array";
|
|
378
|
+
};
|
|
334
379
|
}, {
|
|
335
380
|
readonly command: "list-css-variables";
|
|
336
381
|
readonly id: "cssVariables.list";
|
|
@@ -349,6 +394,9 @@ declare const publicApiOperationInputs: readonly [{
|
|
|
349
394
|
readonly method: "mutation";
|
|
350
395
|
readonly path: "api.cssVariables.delete";
|
|
351
396
|
readonly client: "deleteCssVariables";
|
|
397
|
+
readonly inputFieldTypes: {
|
|
398
|
+
readonly names: "array";
|
|
399
|
+
};
|
|
352
400
|
}, {
|
|
353
401
|
readonly command: "rewrite-css-variable-refs";
|
|
354
402
|
readonly id: "cssVariables.rewriteRefs";
|
|
@@ -499,6 +547,9 @@ declare const publicApiOperationInputs: readonly [{
|
|
|
499
547
|
readonly method: "mutation";
|
|
500
548
|
readonly path: "api.assets.delete";
|
|
501
549
|
readonly client: "deleteAssets";
|
|
550
|
+
readonly inputFieldTypes: {
|
|
551
|
+
readonly assetIdsOrPrefixes: "array";
|
|
552
|
+
};
|
|
502
553
|
}];
|
|
503
554
|
export declare const publicApiOperations: PublicApiOperation<"whoami" | "permissions" | "inspect" | "snapshot" | "apply-patch" | "list-pages" | "get-page" | "get-page-by-path" | "create-page" | "update-page" | "get-project-settings" | "update-project-settings" | "list-redirects" | "create-redirect" | "update-redirect" | "delete-redirect" | "list-breakpoints" | "create-breakpoint" | "update-breakpoint" | "delete-breakpoint" | "delete-page" | "duplicate-page" | "list-page-templates" | "create-page-from-template" | "list-folders" | "create-folder" | "update-folder" | "delete-folder" | "list-instances" | "inspect-instance" | "append-instance" | "move-instance" | "clone-instance" | "delete-instance" | "update-props" | "delete-props" | "bind-props" | "list-texts" | "update-text" | "get-styles" | "update-styles" | "delete-styles" | "replace-styles" | "list-design-tokens" | "create-design-token" | "update-design-token-styles" | "delete-design-token-styles" | "attach-design-token" | "detach-design-token" | "extract-design-token" | "list-css-variables" | "define-css-variable" | "delete-css-variable" | "rewrite-css-variable-refs" | "list-variables" | "create-variable" | "update-variable" | "delete-variable" | "list-resources" | "create-resource" | "update-resource" | "delete-resource" | "publish" | "list-publishes" | "get-publish-job" | "unpublish" | "list-domains" | "create-domain" | "update-domain" | "delete-domain" | "verify-domain" | "list-assets" | "upload-asset" | "upload-assets" | "find-asset-usage" | "replace-asset" | "delete-asset">[];
|
|
504
555
|
export type PublicApiCommand = (typeof publicApiOperationInputs)[number]["command"];
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/protocol",
|
|
3
|
-
"version": "0.274.
|
|
3
|
+
"version": "0.274.5",
|
|
4
4
|
"description": "Webstudio data exchange protocol contracts",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"zod": "^3.24.2",
|
|
10
|
-
"@webstudio-is/sdk": "0.274.
|
|
10
|
+
"@webstudio-is/sdk": "0.274.5"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"vitest": "^3.1.2",
|
|
14
|
-
"@webstudio-is/
|
|
15
|
-
"@webstudio-is/wsauth": "0.274.
|
|
16
|
-
"@webstudio-is/
|
|
14
|
+
"@webstudio-is/project-build": "0.0.0",
|
|
15
|
+
"@webstudio-is/wsauth": "0.274.5",
|
|
16
|
+
"@webstudio-is/tsconfig": "1.0.7"
|
|
17
17
|
},
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|