@wix/auto_sdk_seo_seo-patterns 1.0.0 → 1.0.2
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/cjs/index.d.ts +18 -36
- package/build/cjs/index.js +3 -15
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +98 -128
- package/build/cjs/index.typings.js +3 -15
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +76 -60
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.d.ts +0 -3
- package/build/cjs/schemas.js +54 -65
- package/build/cjs/schemas.js.map +1 -1
- package/build/es/index.d.mts +18 -36
- package/build/es/index.mjs +3 -15
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +98 -128
- package/build/es/index.typings.mjs +3 -15
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +76 -60
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.d.mts +0 -3
- package/build/es/schemas.mjs +54 -65
- package/build/es/schemas.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +18 -36
- package/build/internal/cjs/index.js +3 -15
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +107 -113
- package/build/internal/cjs/index.typings.js +3 -15
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +85 -45
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +0 -3
- package/build/internal/cjs/schemas.js +54 -65
- package/build/internal/cjs/schemas.js.map +1 -1
- package/build/internal/es/index.d.mts +18 -36
- package/build/internal/es/index.mjs +3 -15
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +107 -113
- package/build/internal/es/index.typings.mjs +3 -15
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +85 -45
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +0 -3
- package/build/internal/es/schemas.mjs +54 -65
- package/build/internal/es/schemas.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@ import { NonNullablePaths } from '@wix/sdk-types';
|
|
|
4
4
|
* An SEO pattern is a template of SEO tags defined for one page type, such as every blog
|
|
5
5
|
* post or every store product. A pattern's tags may contain variables, written as
|
|
6
6
|
* `{{variable}}`, that are filled in with each item's own values when its page renders,
|
|
7
|
-
* so a
|
|
7
|
+
* so a Wix user sets the tags for a whole page type once instead of item by item.
|
|
8
8
|
*
|
|
9
9
|
* Every page type always has a pattern in effect. When a site has no pattern of its own
|
|
10
10
|
* for a page type, the built-in Wix default applies, and `source` reports which of the
|
|
@@ -26,14 +26,6 @@ interface SeoPattern {
|
|
|
26
26
|
/**
|
|
27
27
|
* Page type the pattern applies to. For example, `STATIC_PAGE`, `BLOG_POST`, or
|
|
28
28
|
* `STORES_PRODUCT`.
|
|
29
|
-
*
|
|
30
|
-
* Calling with a page type Wix doesn't recognize fails with `UNSUPPORTED_PAGE_TYPE`,
|
|
31
|
-
* and the error lists the page types that are supported. For a page type provided by a
|
|
32
|
-
* Wix app, such as `BLOG_POST`, the app must be installed on the site.
|
|
33
|
-
*
|
|
34
|
-
* Page types aren't the same set as the item types of the Item SEO Tags API: a page
|
|
35
|
-
* type can support a pattern without supporting tags set per item, and the other way
|
|
36
|
-
* round.
|
|
37
29
|
* @maxLength 100
|
|
38
30
|
* @readonly
|
|
39
31
|
*/
|
|
@@ -42,9 +34,7 @@ interface SeoPattern {
|
|
|
42
34
|
* ID of a single page built from a Wix Data collection, when the pattern applies to
|
|
43
35
|
* that page alone rather than to the whole page type.
|
|
44
36
|
*
|
|
45
|
-
* Supported only for the `WIX_DATA_PAGE_ITEM` page type.
|
|
46
|
-
* pattern for the type, and passing a page ID for one of those fails with
|
|
47
|
-
* `PAGE_ID_NOT_SUPPORTED`.
|
|
37
|
+
* Supported only for the `WIX_DATA_PAGE_ITEM` page type.
|
|
48
38
|
* @maxLength 200
|
|
49
39
|
*/
|
|
50
40
|
pageId?: string | null;
|
|
@@ -53,16 +43,14 @@ interface SeoPattern {
|
|
|
53
43
|
* default.
|
|
54
44
|
*
|
|
55
45
|
* Empty when the site has no pattern of its own, in which case `defaultPattern`
|
|
56
|
-
* applies.
|
|
57
|
-
* tag templates you want the page type to have.
|
|
46
|
+
* applies.
|
|
58
47
|
*/
|
|
59
48
|
pattern?: SeoPatternBlob;
|
|
60
49
|
/**
|
|
61
50
|
* The pattern Wix provides for the page type, which applies whenever the site has no
|
|
62
51
|
* pattern of its own.
|
|
63
52
|
*
|
|
64
|
-
* Always returned, so you can
|
|
65
|
-
* from, and see what a reset would restore.
|
|
53
|
+
* Always returned, so you can see what a reset would restore.
|
|
66
54
|
* @readonly
|
|
67
55
|
*/
|
|
68
56
|
defaultPattern?: SeoPatternBlob;
|
|
@@ -81,12 +69,13 @@ interface SeoPattern {
|
|
|
81
69
|
*/
|
|
82
70
|
language?: string | null;
|
|
83
71
|
/**
|
|
84
|
-
* What made the most recent change to the pattern, for example a user or the site
|
|
72
|
+
* What made the most recent change to the pattern, for example a Wix user or the site
|
|
85
73
|
* migration flow. Derived from the caller, not from the request.
|
|
86
74
|
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
75
|
+
* Reported only on the response to a write, and on the event the write emits. It isn't
|
|
76
|
+
* stored with the pattern, so Get SEO Pattern and List SEO Patterns always report
|
|
77
|
+
* `ORIGIN_UNSPECIFIED`, as does a write by a caller Wix doesn't identify as a specific
|
|
78
|
+
* origin.
|
|
90
79
|
* @readonly
|
|
91
80
|
*/
|
|
92
81
|
origin?: OriginWithLiterals;
|
|
@@ -102,10 +91,13 @@ interface SeoPatternBlob {
|
|
|
102
91
|
/**
|
|
103
92
|
* The pattern's SEO tag templates.
|
|
104
93
|
*
|
|
105
|
-
* A tag may reference only the variables the page type offers. Call List SEO Pattern
|
|
106
|
-
* Variables
|
|
94
|
+
* A tag may reference only the variables the page type offers. Call [List SEO Pattern
|
|
95
|
+
* Variables](https://dev.wix.com/docs/api-reference/business-management/seo/seo-pattern-v1/list-seo-pattern-variables)
|
|
96
|
+
* for the page type to retrieve them.
|
|
107
97
|
*
|
|
108
|
-
*
|
|
98
|
+
* A tag whose `disabled` or `custom` value is itself a variable is returned with that
|
|
99
|
+
* value unset, because those fields are booleans. The behavior still applies when the
|
|
100
|
+
* page renders.
|
|
109
101
|
* @maxSize 100
|
|
110
102
|
*/
|
|
111
103
|
tags?: Tag[];
|
|
@@ -127,7 +119,15 @@ interface Tag {
|
|
|
127
119
|
meta?: Record<string, any> | null;
|
|
128
120
|
/** SEO tag inner content. For example, `<title> inner content </title>`. */
|
|
129
121
|
children?: string;
|
|
130
|
-
/**
|
|
122
|
+
/**
|
|
123
|
+
* Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages).
|
|
124
|
+
*
|
|
125
|
+
* Limitation: when `ResolveStaticPageSeoTags` is called without `seoData`, the per-page SEO data is read
|
|
126
|
+
* only from the Vibe/Wix-managed-headless override store. That store holds nothing for classic Wix Editor
|
|
127
|
+
* or Wix Studio pages, so custom tags saved on those pages are missing from the response entirely. For
|
|
128
|
+
* those pages `false` therefore does not mean "not a custom tag" — it means this API could not tell.
|
|
129
|
+
* Pass `seoData` explicitly to resolve against a known set of tags.
|
|
130
|
+
*/
|
|
131
131
|
custom?: boolean;
|
|
132
132
|
/** Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines. */
|
|
133
133
|
disabled?: boolean;
|
|
@@ -176,16 +176,15 @@ interface GetSeoPatternRequest {
|
|
|
176
176
|
* ID of a single page built from a Wix Data collection, to retrieve the pattern of that
|
|
177
177
|
* page alone.
|
|
178
178
|
*
|
|
179
|
-
* Supported only for the `WIX_DATA_PAGE_ITEM` page type.
|
|
180
|
-
* pattern for the type, and passing a page ID for one of those fails with
|
|
181
|
-
* `PAGE_ID_NOT_SUPPORTED`.
|
|
179
|
+
* Supported only for the `WIX_DATA_PAGE_ITEM` page type.
|
|
182
180
|
* @maxLength 200
|
|
183
181
|
*/
|
|
184
182
|
pageId?: string | null;
|
|
185
183
|
/**
|
|
186
|
-
* Not supported yet.
|
|
184
|
+
* Not supported yet.
|
|
187
185
|
*
|
|
188
|
-
* To address a single page built from a Wix Data collection,
|
|
186
|
+
* To address a single page built from a Wix Data collection, specify its `pageId`.
|
|
187
|
+
* @internal
|
|
189
188
|
* @maxLength 200
|
|
190
189
|
*/
|
|
191
190
|
collectionName?: string | null;
|
|
@@ -221,6 +220,9 @@ interface ListSeoPatternVariablesResponse {
|
|
|
221
220
|
/**
|
|
222
221
|
* Variables a pattern for this page type may use in its tags. For example,
|
|
223
222
|
* `{{product.name}}` in a title template.
|
|
223
|
+
*
|
|
224
|
+
* A variable can appear more than once, with different `userVisible` values, when both
|
|
225
|
+
* the site and the page type offer it. Either entry can be used in a pattern.
|
|
224
226
|
* @maxSize 500
|
|
225
227
|
*/
|
|
226
228
|
variables?: SeoPatternVariable[];
|
|
@@ -244,17 +246,18 @@ interface SeoPatternVariable {
|
|
|
244
246
|
*/
|
|
245
247
|
key?: string;
|
|
246
248
|
/**
|
|
247
|
-
* Whether
|
|
249
|
+
* Whether the variable appears in the list shown to Wix users editing the pattern in the
|
|
250
|
+
* dashboard.
|
|
248
251
|
*
|
|
249
|
-
* `false` doesn't prevent a pattern from using the variable. It marks a variable
|
|
250
|
-
*
|
|
252
|
+
* `false` doesn't prevent a pattern from using the variable. It marks a variable that's
|
|
253
|
+
* kept out of the dashboard's list, typically because it's only meaningful in certain
|
|
251
254
|
* cases.
|
|
252
255
|
*/
|
|
253
256
|
userVisible?: boolean;
|
|
254
257
|
}
|
|
255
258
|
interface CreateSeoPatternRequest {
|
|
256
259
|
/**
|
|
257
|
-
* Page type
|
|
260
|
+
* Page type to create a pattern for. For example, `STATIC_PAGE`, `BLOG_POST`, or
|
|
258
261
|
* `STORES_PRODUCT`.
|
|
259
262
|
* @maxLength 100
|
|
260
263
|
*/
|
|
@@ -293,14 +296,14 @@ interface SetSeoPatternRequest {
|
|
|
293
296
|
/**
|
|
294
297
|
* Fields to update.
|
|
295
298
|
*
|
|
296
|
-
*
|
|
297
|
-
* or a read-only field fails with `INVALID_FIELD_MASK`.
|
|
299
|
+
* Supported properties: `pattern`
|
|
298
300
|
*/
|
|
299
301
|
fieldMask: string[];
|
|
300
302
|
/**
|
|
301
|
-
* Not supported yet.
|
|
303
|
+
* Not supported yet.
|
|
302
304
|
*
|
|
303
|
-
* To address a single page built from a Wix Data collection,
|
|
305
|
+
* To address a single page built from a Wix Data collection, specify its `pageId`.
|
|
306
|
+
* @internal
|
|
304
307
|
* @maxLength 200
|
|
305
308
|
*/
|
|
306
309
|
collectionName?: string | null;
|
|
@@ -308,9 +311,7 @@ interface SetSeoPatternRequest {
|
|
|
308
311
|
* ID of a single page built from a Wix Data collection, to change the pattern of that
|
|
309
312
|
* page alone.
|
|
310
313
|
*
|
|
311
|
-
* Supported only for the `WIX_DATA_PAGE_ITEM` page type.
|
|
312
|
-
* pattern for the type, and passing a page ID for one of those fails with
|
|
313
|
-
* `PAGE_ID_NOT_SUPPORTED`.
|
|
314
|
+
* Supported only for the `WIX_DATA_PAGE_ITEM` page type.
|
|
314
315
|
* @maxLength 200
|
|
315
316
|
*/
|
|
316
317
|
pageId?: string | null;
|
|
@@ -327,9 +328,10 @@ interface ResetSeoPatternToDefaultRequest {
|
|
|
327
328
|
*/
|
|
328
329
|
pageType: string;
|
|
329
330
|
/**
|
|
330
|
-
* Not supported yet.
|
|
331
|
+
* Not supported yet.
|
|
331
332
|
*
|
|
332
|
-
* To address a single page built from a Wix Data collection,
|
|
333
|
+
* To address a single page built from a Wix Data collection, specify its `pageId`.
|
|
334
|
+
* @internal
|
|
333
335
|
* @maxLength 200
|
|
334
336
|
*/
|
|
335
337
|
collectionName?: string | null;
|
|
@@ -337,9 +339,7 @@ interface ResetSeoPatternToDefaultRequest {
|
|
|
337
339
|
* ID of a single page built from a Wix Data collection, to reset the pattern of that
|
|
338
340
|
* page alone.
|
|
339
341
|
*
|
|
340
|
-
* Supported only for the `WIX_DATA_PAGE_ITEM` page type.
|
|
341
|
-
* pattern for the type, and passing a page ID for one of those fails with
|
|
342
|
-
* `PAGE_ID_NOT_SUPPORTED`.
|
|
342
|
+
* Supported only for the `WIX_DATA_PAGE_ITEM` page type.
|
|
343
343
|
* @maxLength 200
|
|
344
344
|
*/
|
|
345
345
|
pageId?: string | null;
|
|
@@ -509,12 +509,28 @@ type GetSeoPatternApplicationErrors = {
|
|
|
509
509
|
code?: 'UNSUPPORTED_PAGE_TYPE';
|
|
510
510
|
description?: string;
|
|
511
511
|
data?: Record<string, any>;
|
|
512
|
+
} | {
|
|
513
|
+
code?: 'PAGE_TYPE_NOT_ON_SITE';
|
|
514
|
+
description?: string;
|
|
515
|
+
data?: Record<string, any>;
|
|
516
|
+
} | {
|
|
517
|
+
code?: 'PAGE_ID_NOT_SUPPORTED';
|
|
518
|
+
description?: string;
|
|
519
|
+
data?: Record<string, any>;
|
|
520
|
+
} | {
|
|
521
|
+
code?: 'COLLECTION_NAME_NOT_SUPPORTED';
|
|
522
|
+
description?: string;
|
|
523
|
+
data?: Record<string, any>;
|
|
512
524
|
};
|
|
513
525
|
/** @docsIgnore */
|
|
514
526
|
type ListSeoPatternVariablesApplicationErrors = {
|
|
515
527
|
code?: 'UNSUPPORTED_PAGE_TYPE';
|
|
516
528
|
description?: string;
|
|
517
529
|
data?: Record<string, any>;
|
|
530
|
+
} | {
|
|
531
|
+
code?: 'PAGE_TYPE_NOT_ON_SITE';
|
|
532
|
+
description?: string;
|
|
533
|
+
data?: Record<string, any>;
|
|
518
534
|
};
|
|
519
535
|
/** @docsIgnore */
|
|
520
536
|
type CreateSeoPatternApplicationErrors = {
|
|
@@ -529,6 +545,14 @@ type CreateSeoPatternApplicationErrors = {
|
|
|
529
545
|
code?: 'PATTERN_ALREADY_EXISTS';
|
|
530
546
|
description?: string;
|
|
531
547
|
data?: Record<string, any>;
|
|
548
|
+
} | {
|
|
549
|
+
code?: 'PAGE_TYPE_NOT_ON_SITE';
|
|
550
|
+
description?: string;
|
|
551
|
+
data?: Record<string, any>;
|
|
552
|
+
} | {
|
|
553
|
+
code?: 'PAGE_ID_NOT_SUPPORTED';
|
|
554
|
+
description?: string;
|
|
555
|
+
data?: Record<string, any>;
|
|
532
556
|
};
|
|
533
557
|
/** @docsIgnore */
|
|
534
558
|
type SetSeoPatternApplicationErrors = {
|
|
@@ -547,6 +571,14 @@ type SetSeoPatternApplicationErrors = {
|
|
|
547
571
|
code?: 'PATTERN_NOT_FOUND';
|
|
548
572
|
description?: string;
|
|
549
573
|
data?: Record<string, any>;
|
|
574
|
+
} | {
|
|
575
|
+
code?: 'PAGE_ID_NOT_SUPPORTED';
|
|
576
|
+
description?: string;
|
|
577
|
+
data?: Record<string, any>;
|
|
578
|
+
} | {
|
|
579
|
+
code?: 'COLLECTION_NAME_NOT_SUPPORTED';
|
|
580
|
+
description?: string;
|
|
581
|
+
data?: Record<string, any>;
|
|
550
582
|
};
|
|
551
583
|
/** @docsIgnore */
|
|
552
584
|
type ResetSeoPatternToDefaultApplicationErrors = {
|
|
@@ -557,16 +589,21 @@ type ResetSeoPatternToDefaultApplicationErrors = {
|
|
|
557
589
|
code?: 'PATTERN_NOT_FOUND';
|
|
558
590
|
description?: string;
|
|
559
591
|
data?: Record<string, any>;
|
|
592
|
+
} | {
|
|
593
|
+
code?: 'PAGE_ID_NOT_SUPPORTED';
|
|
594
|
+
description?: string;
|
|
595
|
+
data?: Record<string, any>;
|
|
596
|
+
} | {
|
|
597
|
+
code?: 'COLLECTION_NAME_NOT_SUPPORTED';
|
|
598
|
+
description?: string;
|
|
599
|
+
data?: Record<string, any>;
|
|
560
600
|
};
|
|
561
601
|
/**
|
|
562
602
|
* Retrieves the SEO pattern in effect for a page type.
|
|
563
603
|
*
|
|
564
|
-
* The response contains
|
|
565
|
-
*
|
|
566
|
-
*
|
|
567
|
-
*
|
|
568
|
-
* Fails with `PAGE_TYPE_NOT_ON_SITE` if the page type comes from a Wix app that isn't
|
|
569
|
-
* installed on the site.
|
|
604
|
+
* The response contains the site's own pattern in `pattern`, and the pattern Wix
|
|
605
|
+
* provides in `defaultPattern`. `source` reports which of the two is in effect.
|
|
606
|
+
* `pattern` is empty when the site has no pattern of its own.
|
|
570
607
|
* @param pageType - Page type whose pattern to retrieve. For example, `STATIC_PAGE`, `BLOG_POST`, or
|
|
571
608
|
* `STORES_PRODUCT`.
|
|
572
609
|
* @public
|
|
@@ -585,30 +622,17 @@ interface GetSeoPatternOptions {
|
|
|
585
622
|
* ID of a single page built from a Wix Data collection, to retrieve the pattern of that
|
|
586
623
|
* page alone.
|
|
587
624
|
*
|
|
588
|
-
* Supported only for the `WIX_DATA_PAGE_ITEM` page type.
|
|
589
|
-
* pattern for the type, and passing a page ID for one of those fails with
|
|
590
|
-
* `PAGE_ID_NOT_SUPPORTED`.
|
|
625
|
+
* Supported only for the `WIX_DATA_PAGE_ITEM` page type.
|
|
591
626
|
* @maxLength 200
|
|
592
627
|
*/
|
|
593
628
|
pageId?: string | null;
|
|
594
|
-
/**
|
|
595
|
-
* Not supported yet. Passing a value fails with `COLLECTION_NAME_NOT_SUPPORTED`.
|
|
596
|
-
*
|
|
597
|
-
* To address a single page built from a Wix Data collection, pass its `pageId`.
|
|
598
|
-
* @maxLength 200
|
|
599
|
-
*/
|
|
600
|
-
collectionName?: string | null;
|
|
601
629
|
}
|
|
602
630
|
/**
|
|
603
631
|
* Retrieves the patterns stored for a site, one per page type.
|
|
604
632
|
*
|
|
605
|
-
* Only page types that have had a pattern
|
|
606
|
-
*
|
|
607
|
-
*
|
|
608
|
-
* `pattern` and `source` of `PATTERN_SOURCE_DEFAULT`.
|
|
609
|
-
*
|
|
610
|
-
* The response isn't paged. A site has a bounded number of page types, and all of them
|
|
611
|
-
* are returned in one call.
|
|
633
|
+
* Only returns page types that have had a pattern of the site's own stored, so a page
|
|
634
|
+
* type that has never had one is absent. A page type that was reset to its default remains in the
|
|
635
|
+
* list, with an empty `pattern` and `source` of `PATTERN_SOURCE_DEFAULT`.
|
|
612
636
|
* @public
|
|
613
637
|
* @documentationMaturity preview
|
|
614
638
|
* @permissionId wix-seo.read
|
|
@@ -620,15 +644,11 @@ declare function listSeoPatterns(): Promise<NonNullablePaths<ListSeoPatternsResp
|
|
|
620
644
|
/**
|
|
621
645
|
* Retrieves the variables a pattern for a page type may reference.
|
|
622
646
|
*
|
|
623
|
-
*
|
|
624
|
-
*
|
|
625
|
-
* `INVALID_PATTERN`.
|
|
647
|
+
* Call this method to retrieve the valid variables for a page type before writing a
|
|
648
|
+
* pattern.
|
|
626
649
|
*
|
|
627
650
|
* Variables for the page's own tags and variables for its structured data are returned
|
|
628
651
|
* in separate fields, and a pattern may use either.
|
|
629
|
-
*
|
|
630
|
-
* Fails with `PAGE_TYPE_NOT_ON_SITE` if the page type comes from a Wix app that isn't
|
|
631
|
-
* installed on the site.
|
|
632
652
|
* @param pageType - Page type whose variables to retrieve. For example, `STATIC_PAGE`, `BLOG_POST`, or
|
|
633
653
|
* `STORES_PRODUCT`.
|
|
634
654
|
* @public
|
|
@@ -645,16 +665,12 @@ declare function listSeoPatternVariables(pageType: string): Promise<NonNullableP
|
|
|
645
665
|
/**
|
|
646
666
|
* Creates a pattern for a page type that's still on its Wix default.
|
|
647
667
|
*
|
|
648
|
-
* The pattern must contain at least one tag.
|
|
649
|
-
*
|
|
650
|
-
* nothing. To leave a page type on its Wix default, create nothing for it.
|
|
668
|
+
* The pattern must contain at least one tag. To leave a page type on its Wix default,
|
|
669
|
+
* create nothing for it.
|
|
651
670
|
*
|
|
652
|
-
* To change a pattern that already exists, call Set SEO
|
|
653
|
-
* pattern
|
|
654
|
-
*
|
|
655
|
-
* Fails with `PAGE_TYPE_NOT_ON_SITE` if the page type comes from a Wix app that isn't
|
|
656
|
-
* installed on the site.
|
|
657
|
-
* @param pageType - Page type whose pattern to create a pattern for. For example, `STATIC_PAGE`, `BLOG_POST`, or
|
|
671
|
+
* To change a pattern that already exists, call [Set SEO
|
|
672
|
+
* Pattern](https://dev.wix.com/docs/api-reference/business-management/seo/seo-pattern-v1/set-seo-pattern).
|
|
673
|
+
* @param pageType - Page type to create a pattern for. For example, `STATIC_PAGE`, `BLOG_POST`, or
|
|
658
674
|
* `STORES_PRODUCT`.
|
|
659
675
|
* @param seoPattern - Pattern to create for the page type.
|
|
660
676
|
*
|
|
@@ -681,9 +697,10 @@ declare function createSeoPattern(pageType: string, seoPattern: SeoPattern): Pro
|
|
|
681
697
|
* pattern first and send back the complete set you want it to have. Sending an empty
|
|
682
698
|
* pattern clears it, which returns the page type to its Wix default.
|
|
683
699
|
*
|
|
684
|
-
* This method changes a pattern that already exists rather than creating one
|
|
685
|
-
* type still on its Wix default
|
|
686
|
-
*
|
|
700
|
+
* This method changes a pattern that already exists rather than creating one. For a page
|
|
701
|
+
* type still on its Wix default, call [Create SEO
|
|
702
|
+
* Pattern](https://dev.wix.com/docs/api-reference/business-management/seo/seo-pattern-v1/create-seo-pattern)
|
|
703
|
+
* instead.
|
|
687
704
|
*
|
|
688
705
|
* A pattern has no revision, and the site's SEO settings in the dashboard write to the
|
|
689
706
|
* same pattern. The last write wins, so retrieve the pattern immediately before writing
|
|
@@ -711,24 +728,14 @@ interface SetSeoPatternOptions {
|
|
|
711
728
|
/**
|
|
712
729
|
* Fields to update.
|
|
713
730
|
*
|
|
714
|
-
*
|
|
715
|
-
* or a read-only field fails with `INVALID_FIELD_MASK`.
|
|
731
|
+
* Supported properties: `pattern`
|
|
716
732
|
*/
|
|
717
733
|
fieldMask: string[];
|
|
718
|
-
/**
|
|
719
|
-
* Not supported yet. Passing a value fails with `COLLECTION_NAME_NOT_SUPPORTED`.
|
|
720
|
-
*
|
|
721
|
-
* To address a single page built from a Wix Data collection, pass its `pageId`.
|
|
722
|
-
* @maxLength 200
|
|
723
|
-
*/
|
|
724
|
-
collectionName?: string | null;
|
|
725
734
|
/**
|
|
726
735
|
* ID of a single page built from a Wix Data collection, to change the pattern of that
|
|
727
736
|
* page alone.
|
|
728
737
|
*
|
|
729
|
-
* Supported only for the `WIX_DATA_PAGE_ITEM` page type.
|
|
730
|
-
* pattern for the type, and passing a page ID for one of those fails with
|
|
731
|
-
* `PAGE_ID_NOT_SUPPORTED`.
|
|
738
|
+
* Supported only for the `WIX_DATA_PAGE_ITEM` page type.
|
|
732
739
|
* @maxLength 200
|
|
733
740
|
*/
|
|
734
741
|
pageId?: string | null;
|
|
@@ -737,11 +744,7 @@ interface SetSeoPatternOptions {
|
|
|
737
744
|
* Removes the pattern a site has for a page type, so the Wix default applies again.
|
|
738
745
|
*
|
|
739
746
|
* The response reports the page type after the reset, with an empty `pattern` and
|
|
740
|
-
* `source` of `PATTERN_SOURCE_DEFAULT`.
|
|
741
|
-
* SEO Patterns, with the same empty pattern.
|
|
742
|
-
*
|
|
743
|
-
* Fails with `PATTERN_NOT_FOUND` if the page type is already on its Wix default, so
|
|
744
|
-
* there's nothing to reset.
|
|
747
|
+
* `source` of `PATTERN_SOURCE_DEFAULT`.
|
|
745
748
|
* @param pageType - Page type whose pattern to reset. For example, `STATIC_PAGE`, `BLOG_POST`, or
|
|
746
749
|
* `STORES_PRODUCT`.
|
|
747
750
|
* @public
|
|
@@ -755,20 +758,11 @@ declare function resetSeoPatternToDefault(pageType: string, options?: ResetSeoPa
|
|
|
755
758
|
__applicationErrorsType?: ResetSeoPatternToDefaultApplicationErrors;
|
|
756
759
|
}>;
|
|
757
760
|
interface ResetSeoPatternToDefaultOptions {
|
|
758
|
-
/**
|
|
759
|
-
* Not supported yet. Passing a value fails with `COLLECTION_NAME_NOT_SUPPORTED`.
|
|
760
|
-
*
|
|
761
|
-
* To address a single page built from a Wix Data collection, pass its `pageId`.
|
|
762
|
-
* @maxLength 200
|
|
763
|
-
*/
|
|
764
|
-
collectionName?: string | null;
|
|
765
761
|
/**
|
|
766
762
|
* ID of a single page built from a Wix Data collection, to reset the pattern of that
|
|
767
763
|
* page alone.
|
|
768
764
|
*
|
|
769
|
-
* Supported only for the `WIX_DATA_PAGE_ITEM` page type.
|
|
770
|
-
* pattern for the type, and passing a page ID for one of those fails with
|
|
771
|
-
* `PAGE_ID_NOT_SUPPORTED`.
|
|
765
|
+
* Supported only for the `WIX_DATA_PAGE_ITEM` page type.
|
|
772
766
|
* @maxLength 200
|
|
773
767
|
*/
|
|
774
768
|
pageId?: string | null;
|
|
@@ -187,8 +187,7 @@ async function getSeoPattern2(pageType, options) {
|
|
|
187
187
|
const { httpClient, sideEffects } = arguments[2];
|
|
188
188
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
189
189
|
pageType,
|
|
190
|
-
pageId: options?.pageId
|
|
191
|
-
collectionName: options?.collectionName
|
|
190
|
+
pageId: options?.pageId
|
|
192
191
|
});
|
|
193
192
|
const reqOpts = getSeoPattern(payload);
|
|
194
193
|
sideEffects?.onSiteCall?.();
|
|
@@ -201,11 +200,7 @@ async function getSeoPattern2(pageType, options) {
|
|
|
201
200
|
err,
|
|
202
201
|
{
|
|
203
202
|
spreadPathsToArguments: {},
|
|
204
|
-
explicitPathsToArguments: {
|
|
205
|
-
pageType: "$[0]",
|
|
206
|
-
pageId: "$[1].pageId",
|
|
207
|
-
collectionName: "$[1].collectionName"
|
|
208
|
-
},
|
|
203
|
+
explicitPathsToArguments: { pageType: "$[0]", pageId: "$[1].pageId" },
|
|
209
204
|
singleArgumentUnchanged: false
|
|
210
205
|
},
|
|
211
206
|
["pageType", "options"]
|
|
@@ -292,7 +287,6 @@ async function setSeoPattern2(pageType, seoPattern, options) {
|
|
|
292
287
|
pageType,
|
|
293
288
|
seoPattern,
|
|
294
289
|
fieldMask: options?.fieldMask,
|
|
295
|
-
collectionName: options?.collectionName,
|
|
296
290
|
pageId: options?.pageId
|
|
297
291
|
});
|
|
298
292
|
const reqOpts = setSeoPattern(payload);
|
|
@@ -310,7 +304,6 @@ async function setSeoPattern2(pageType, seoPattern, options) {
|
|
|
310
304
|
pageType: "$[0]",
|
|
311
305
|
seoPattern: "$[1]",
|
|
312
306
|
fieldMask: "$[2].fieldMask",
|
|
313
|
-
collectionName: "$[2].collectionName",
|
|
314
307
|
pageId: "$[2].pageId"
|
|
315
308
|
},
|
|
316
309
|
singleArgumentUnchanged: false
|
|
@@ -325,7 +318,6 @@ async function resetSeoPatternToDefault2(pageType, options) {
|
|
|
325
318
|
const { httpClient, sideEffects } = arguments[2];
|
|
326
319
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
327
320
|
pageType,
|
|
328
|
-
collectionName: options?.collectionName,
|
|
329
321
|
pageId: options?.pageId
|
|
330
322
|
});
|
|
331
323
|
const reqOpts = resetSeoPatternToDefault(payload);
|
|
@@ -339,11 +331,7 @@ async function resetSeoPatternToDefault2(pageType, options) {
|
|
|
339
331
|
err,
|
|
340
332
|
{
|
|
341
333
|
spreadPathsToArguments: {},
|
|
342
|
-
explicitPathsToArguments: {
|
|
343
|
-
pageType: "$[0]",
|
|
344
|
-
collectionName: "$[1].collectionName",
|
|
345
|
-
pageId: "$[1].pageId"
|
|
346
|
-
},
|
|
334
|
+
explicitPathsToArguments: { pageType: "$[0]", pageId: "$[1].pageId" },
|
|
347
335
|
singleArgumentUnchanged: false
|
|
348
336
|
},
|
|
349
337
|
["pageType", "options"]
|