@wix/auto_sdk_viewer_site-structure-service 1.0.14 → 1.0.15
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/schemas.d.ts +102 -0
- package/build/cjs/schemas.js +216 -0
- package/build/cjs/schemas.js.map +1 -0
- package/build/es/schemas.d.mts +102 -0
- package/build/es/schemas.mjs +176 -0
- package/build/es/schemas.mjs.map +1 -0
- package/build/internal/cjs/schemas.d.ts +102 -0
- package/build/internal/cjs/schemas.js +216 -0
- package/build/internal/cjs/schemas.js.map +1 -0
- package/build/internal/es/schemas.d.mts +102 -0
- package/build/internal/es/schemas.mjs +176 -0
- package/build/internal/es/schemas.mjs.map +1 -0
- package/package.json +12 -5
- package/schemas/package.json +3 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const GetSiteStructureRequest: z.ZodObject<{
|
|
4
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
5
|
+
pageVersion: z.ZodOptional<z.ZodEnum<{
|
|
6
|
+
PUBLISHED: "PUBLISHED";
|
|
7
|
+
SAVED: "SAVED";
|
|
8
|
+
}>>;
|
|
9
|
+
paging: z.ZodOptional<z.ZodObject<{
|
|
10
|
+
limit: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
11
|
+
cursor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
filter: z.ZodOptional<z.ZodObject<{
|
|
14
|
+
itemTypeIdentifier: z.ZodOptional<z.ZodString>;
|
|
15
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
16
|
+
configId: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
sorting: z.ZodOptional<z.ZodObject<{
|
|
19
|
+
fieldName: z.ZodOptional<z.ZodString>;
|
|
20
|
+
order: z.ZodOptional<z.ZodEnum<{
|
|
21
|
+
ASC: "ASC";
|
|
22
|
+
DESC: "DESC";
|
|
23
|
+
}>>;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
fieldSet: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
26
|
+
languageMetadata: z.ZodOptional<z.ZodObject<{
|
|
27
|
+
code: z.ZodOptional<z.ZodString>;
|
|
28
|
+
tag: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
branchId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
declare const GetSiteStructureResponse: z.ZodObject<{
|
|
34
|
+
totalResults: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
pageData: z.ZodOptional<z.ZodObject<{
|
|
36
|
+
count: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
37
|
+
cursor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
results: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
40
|
+
itemId: z.ZodOptional<z.ZodString>;
|
|
41
|
+
itemTypeIdentifier: z.ZodOptional<z.ZodString>;
|
|
42
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
43
|
+
configId: z.ZodOptional<z.ZodString>;
|
|
44
|
+
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
45
|
+
media: z.ZodOptional<z.ZodArray<z.ZodIntersection<z.ZodObject<{}, z.core.$strip>, z.ZodXor<readonly [z.ZodObject<{
|
|
46
|
+
image: z.ZodOptional<z.ZodNever>;
|
|
47
|
+
video: z.ZodOptional<z.ZodNever>;
|
|
48
|
+
document: z.ZodOptional<z.ZodNever>;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
video: z.ZodOptional<z.ZodNever>;
|
|
51
|
+
document: z.ZodOptional<z.ZodNever>;
|
|
52
|
+
image: z.ZodString;
|
|
53
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
54
|
+
image: z.ZodOptional<z.ZodNever>;
|
|
55
|
+
document: z.ZodOptional<z.ZodNever>;
|
|
56
|
+
video: z.ZodString;
|
|
57
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
58
|
+
image: z.ZodOptional<z.ZodNever>;
|
|
59
|
+
video: z.ZodOptional<z.ZodNever>;
|
|
60
|
+
document: z.ZodString;
|
|
61
|
+
}, z.core.$strip>]>>>>;
|
|
62
|
+
path: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
63
|
+
_updatedDate: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
64
|
+
inactive: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
65
|
+
metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
66
|
+
image: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
67
|
+
video: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
68
|
+
protected: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
69
|
+
translationId: z.ZodOptional<z.ZodString>;
|
|
70
|
+
isCustomErrorPage: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
71
|
+
}, z.core.$strip>>>;
|
|
72
|
+
errors: z.ZodOptional<z.ZodArray<z.ZodIntersection<z.ZodObject<{
|
|
73
|
+
errorMessage: z.ZodOptional<z.ZodString>;
|
|
74
|
+
appId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
75
|
+
}, z.core.$strip>, z.ZodXor<readonly [z.ZodObject<{
|
|
76
|
+
itemTypeId: z.ZodOptional<z.ZodNever>;
|
|
77
|
+
routerPrefix: z.ZodOptional<z.ZodNever>;
|
|
78
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
79
|
+
routerPrefix: z.ZodOptional<z.ZodNever>;
|
|
80
|
+
itemTypeId: z.ZodString;
|
|
81
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
82
|
+
itemTypeId: z.ZodOptional<z.ZodNever>;
|
|
83
|
+
routerPrefix: z.ZodString;
|
|
84
|
+
}, z.core.$strip>]>>>>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
declare const GetSiteStructureMetadataRequest: z.ZodObject<{
|
|
87
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
88
|
+
pageVersion: z.ZodOptional<z.ZodEnum<{
|
|
89
|
+
PUBLISHED: "PUBLISHED";
|
|
90
|
+
SAVED: "SAVED";
|
|
91
|
+
}>>;
|
|
92
|
+
}, z.core.$strip>>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
declare const GetSiteStructureMetadataResponse: z.ZodObject<{
|
|
95
|
+
pageTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
96
|
+
itemTypeIdentifier: z.ZodOptional<z.ZodString>;
|
|
97
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
98
|
+
configId: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, z.core.$strip>>>;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
|
|
102
|
+
export { GetSiteStructureMetadataRequest, GetSiteStructureMetadataResponse, GetSiteStructureRequest, GetSiteStructureResponse };
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// schemas.ts
|
|
31
|
+
var schemas_exports = {};
|
|
32
|
+
__export(schemas_exports, {
|
|
33
|
+
GetSiteStructureMetadataRequest: () => GetSiteStructureMetadataRequest,
|
|
34
|
+
GetSiteStructureMetadataResponse: () => GetSiteStructureMetadataResponse,
|
|
35
|
+
GetSiteStructureRequest: () => GetSiteStructureRequest,
|
|
36
|
+
GetSiteStructureResponse: () => GetSiteStructureResponse
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(schemas_exports);
|
|
39
|
+
|
|
40
|
+
// src/viewer-structure-v1-site-structure-item-site-structure-service.schemas.ts
|
|
41
|
+
var z = __toESM(require("zod"));
|
|
42
|
+
var GetSiteStructureRequest = z.object({
|
|
43
|
+
options: z.object({
|
|
44
|
+
pageVersion: z.enum(["PUBLISHED", "SAVED"]).optional(),
|
|
45
|
+
paging: z.object({
|
|
46
|
+
limit: z.number().int().describe("Maximum number of items to return in the results.").min(0).max(100).optional().nullable(),
|
|
47
|
+
cursor: z.string().describe(
|
|
48
|
+
"Pointer to the next or previous page in the list of results.\n\nPass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\nNot relevant for the first request."
|
|
49
|
+
).max(16e3).optional().nullable()
|
|
50
|
+
}).describe(
|
|
51
|
+
"Pagination request metadata, currently applicable for:\\\n- Queries filtered for items from a TPA that is part of the new-integration (TpaSiteStructureService)\n- Queries filtered for dynamic router items from the new dynamic-pages-router integration (DynamicSiteStructureService)"
|
|
52
|
+
).optional(),
|
|
53
|
+
filter: z.object({
|
|
54
|
+
itemTypeIdentifier: z.string().describe("In accordance to SiteStructureItem.item_type_identifier").optional(),
|
|
55
|
+
sourceId: z.string().describe("In accordance to SiteStructureItem.source_id").optional(),
|
|
56
|
+
configId: z.string().describe("In accordance to SiteStructureItem.config_id").optional()
|
|
57
|
+
}).describe(
|
|
58
|
+
"Filtering metadata. Only items allowed by the filter will be returned."
|
|
59
|
+
).optional(),
|
|
60
|
+
sorting: z.object({
|
|
61
|
+
fieldName: z.string().describe("Name of the field to sort by.").max(512).optional(),
|
|
62
|
+
order: z.enum(["ASC", "DESC"]).optional()
|
|
63
|
+
}).describe("General sorting metadata. Currently not supported.").optional(),
|
|
64
|
+
fieldSet: z.array(z.string()).optional(),
|
|
65
|
+
languageMetadata: z.object({
|
|
66
|
+
code: z.string().describe("2 chars language code (e.g. 'en')").optional(),
|
|
67
|
+
tag: z.string().describe("4 chars language tag (e.g. 'en-us')").optional().nullable()
|
|
68
|
+
}).describe(
|
|
69
|
+
"Language metadata. Contains 2 chars language code and/or 4 chars language tag."
|
|
70
|
+
).optional(),
|
|
71
|
+
branchId: z.string().describe(
|
|
72
|
+
"Used to identify the branch of the site for which the structure is requested."
|
|
73
|
+
).regex(
|
|
74
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
75
|
+
"Must be a valid GUID"
|
|
76
|
+
).optional().nullable()
|
|
77
|
+
}).optional()
|
|
78
|
+
});
|
|
79
|
+
var GetSiteStructureResponse = z.object({
|
|
80
|
+
totalResults: z.number().int().describe(
|
|
81
|
+
"The total number of items to be returned, combining all paginated responses."
|
|
82
|
+
).optional(),
|
|
83
|
+
pageData: z.object({
|
|
84
|
+
count: z.number().int().describe("The item count in the current page").optional().nullable(),
|
|
85
|
+
cursor: z.string().describe("The cursor which will be used to query the next page").optional().nullable()
|
|
86
|
+
}).describe(
|
|
87
|
+
"A cursor based paging response metadata, including the item count in the current page and a cursor string to be used for querying of the next page."
|
|
88
|
+
).optional(),
|
|
89
|
+
results: z.array(
|
|
90
|
+
z.object({
|
|
91
|
+
itemId: z.string().describe(
|
|
92
|
+
"The end goal: this field should contain a unique identifier for this site-structure item.\\\nCurrently it contains:\n- For site-structure integrated TPAs - the unique identifier provided by the TPA.\n- For all other item types - empty string."
|
|
93
|
+
).optional(),
|
|
94
|
+
itemTypeIdentifier: z.string().describe(
|
|
95
|
+
`An identifier for the type of the item. One of:
|
|
96
|
+
- For the site's static pages - "static_page".
|
|
97
|
+
- For legacy integration TPAs - the TPA's app-def-id.
|
|
98
|
+
- For TPAs with new site-structure integration - the item type identifier provided by the TPA. Commonly one of that TPA's supported sub-pages.
|
|
99
|
+
- For items that are the result of a dynamic router - "dynamic-page".`
|
|
100
|
+
).optional(),
|
|
101
|
+
sourceId: z.string().describe(
|
|
102
|
+
`An identifier for the source of the item. One of:
|
|
103
|
+
- For the site's static pages - "editor".
|
|
104
|
+
- For legacy integration TPAs - the TPA's app-def-id.
|
|
105
|
+
- For TPAs with new site-structure integration - the TPA's app-def-id.
|
|
106
|
+
- For items that are the result of a dataBinding router - Wix-Data's app-def-id: 'e593b0bd-b783-45b8-97c2-873d42aacaf4'.
|
|
107
|
+
- For items that are the result of a dynamic router - Wix-Code's app-def-id: '675bbcef-18d8-41f5-800e-131ec9e08762'.`
|
|
108
|
+
).optional(),
|
|
109
|
+
configId: z.string().describe(
|
|
110
|
+
`An identifier for the configuration of the item. Used currently as some sort of a placeholder for further filtering.
|
|
111
|
+
- For items of type "dynamic-page" - The 'prefix' field that is part of the router-config object of the router that is related to this item (see WixCodeDynamicRouterResolver).
|
|
112
|
+
- For all other items types - empty string.`
|
|
113
|
+
).optional(),
|
|
114
|
+
name: z.string().describe(
|
|
115
|
+
"A human readable name string associated with the item.\\\nCurrently exists only for new TPA site-structure integration items, and contains the 'name' field provided by the TPA for that item.\\\nThis field is not guaranteed to be unique across the item list."
|
|
116
|
+
).optional().nullable(),
|
|
117
|
+
media: z.array(
|
|
118
|
+
z.intersection(
|
|
119
|
+
z.object({}),
|
|
120
|
+
z.xor([
|
|
121
|
+
z.object({
|
|
122
|
+
image: z.never().optional(),
|
|
123
|
+
video: z.never().optional(),
|
|
124
|
+
document: z.never().optional()
|
|
125
|
+
}),
|
|
126
|
+
z.object({
|
|
127
|
+
video: z.never().optional(),
|
|
128
|
+
document: z.never().optional(),
|
|
129
|
+
image: z.string().describe("WixMedia image")
|
|
130
|
+
}),
|
|
131
|
+
z.object({
|
|
132
|
+
image: z.never().optional(),
|
|
133
|
+
document: z.never().optional(),
|
|
134
|
+
video: z.string().describe("WixMedia video")
|
|
135
|
+
}),
|
|
136
|
+
z.object({
|
|
137
|
+
image: z.never().optional(),
|
|
138
|
+
video: z.never().optional(),
|
|
139
|
+
document: z.string().describe("WixMedia document")
|
|
140
|
+
})
|
|
141
|
+
])
|
|
142
|
+
)
|
|
143
|
+
).optional(),
|
|
144
|
+
path: z.string().describe(
|
|
145
|
+
"A relative url path that can be used, with the site's base-url, to reach the page represented by this item."
|
|
146
|
+
).optional().nullable(),
|
|
147
|
+
_updatedDate: z.date().describe(
|
|
148
|
+
"A timestamp representing the moment that this item was last changed.\n- For static pages - the site's last publish time.\n- For all kinds of TPAs - the last-modified field in the respective response item from the TPA.\n- For items that are the result of a dynamic router - the content of the 'lastModified' optional field in the response item from Wix-Code's RPC endpoint, or, if missing, the site's last publish time. (see WixCodeDynamicRouterResolver)."
|
|
149
|
+
).optional().nullable(),
|
|
150
|
+
inactive: z.boolean().describe(
|
|
151
|
+
"A value indicating whether the item is inactive or not. E.g. hidden product/finished event etc.\\\nCurrently exists only for new TPA site-structure integration items, and contains the 'inactive' field provided by the TPA for that item."
|
|
152
|
+
).optional().nullable(),
|
|
153
|
+
metadata: z.record(z.string(), z.any()).describe(
|
|
154
|
+
'A general free schema field to include further metadata related to this item.\\\nCurrently exists only for:\\\nStatic pages - a JSON that is the merge of:\n1. The advancedSeoData JSON string that exists for the page in the master-page.\n2. A JSON of the form:\n```javascript\n{\n"seo_legacy": {\n"hidden_from_seo": true / false\n},\n"password_protected": true / false\n}\n```\nNew TPA site-structure integration items - the \'metadata\' field provided by the TPA for that item.'
|
|
155
|
+
).optional().nullable(),
|
|
156
|
+
image: z.array(z.string()).optional(),
|
|
157
|
+
video: z.array(z.string()).optional(),
|
|
158
|
+
protected: z.boolean().describe(
|
|
159
|
+
"A value indicating whether the item is protected or not, by password or login."
|
|
160
|
+
).optional().nullable(),
|
|
161
|
+
translationId: z.string().describe(
|
|
162
|
+
"ID of the translations of the item. As same item can have multiple instances, one for each language, we can match them by this ID.\\\nFor example:\nBlog has one post, translated to 2 languages (EN, FR):\n- EN item path is `/amazing-post`\n- FR item path is `/poste-incroyable\nBoth of them might have different `item_id`, but will share the same `translation_id`, to be easily match together\nCurrently only relevant for Blog"
|
|
163
|
+
).optional(),
|
|
164
|
+
isCustomErrorPage: z.boolean().describe(
|
|
165
|
+
"A value indicating whether the item is a custom error page or not."
|
|
166
|
+
).optional().nullable()
|
|
167
|
+
})
|
|
168
|
+
).optional(),
|
|
169
|
+
errors: z.array(
|
|
170
|
+
z.intersection(
|
|
171
|
+
z.object({
|
|
172
|
+
errorMessage: z.string().describe("Error message").min(1).max(1e3).optional(),
|
|
173
|
+
appId: z.string().describe(
|
|
174
|
+
"if the fetch happened while fetching links from a TPA, this will hold the TPA appDefId"
|
|
175
|
+
).regex(
|
|
176
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
177
|
+
"Must be a valid GUID"
|
|
178
|
+
).optional().nullable()
|
|
179
|
+
}),
|
|
180
|
+
z.xor([
|
|
181
|
+
z.object({
|
|
182
|
+
itemTypeId: z.never().optional(),
|
|
183
|
+
routerPrefix: z.never().optional()
|
|
184
|
+
}),
|
|
185
|
+
z.object({
|
|
186
|
+
routerPrefix: z.never().optional(),
|
|
187
|
+
itemTypeId: z.string().describe("item type id of the failed fetch").min(1).max(200)
|
|
188
|
+
}),
|
|
189
|
+
z.object({
|
|
190
|
+
itemTypeId: z.never().optional(),
|
|
191
|
+
routerPrefix: z.string().describe("for dynamic pages: router prefix of the failed fetch").min(1).max(200)
|
|
192
|
+
})
|
|
193
|
+
])
|
|
194
|
+
)
|
|
195
|
+
).optional()
|
|
196
|
+
});
|
|
197
|
+
var GetSiteStructureMetadataRequest = z.object({
|
|
198
|
+
options: z.object({ pageVersion: z.enum(["PUBLISHED", "SAVED"]).optional() }).optional()
|
|
199
|
+
});
|
|
200
|
+
var GetSiteStructureMetadataResponse = z.object({
|
|
201
|
+
pageTypes: z.array(
|
|
202
|
+
z.object({
|
|
203
|
+
itemTypeIdentifier: z.string().describe("Type identifier").optional(),
|
|
204
|
+
sourceId: z.string().describe("Site's page-type sourceId").optional(),
|
|
205
|
+
configId: z.string().describe("Site's page-type configId").optional()
|
|
206
|
+
})
|
|
207
|
+
).optional()
|
|
208
|
+
});
|
|
209
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
210
|
+
0 && (module.exports = {
|
|
211
|
+
GetSiteStructureMetadataRequest,
|
|
212
|
+
GetSiteStructureMetadataResponse,
|
|
213
|
+
GetSiteStructureRequest,
|
|
214
|
+
GetSiteStructureResponse
|
|
215
|
+
});
|
|
216
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../schemas.ts","../../src/viewer-structure-v1-site-structure-item-site-structure-service.schemas.ts"],"sourcesContent":["export * from './src/viewer-structure-v1-site-structure-item-site-structure-service.schemas.js';\n","import * as z from 'zod';\n\nexport const GetSiteStructureRequest = z.object({\n options: z\n .object({\n pageVersion: z.enum(['PUBLISHED', 'SAVED']).optional(),\n paging: z\n .object({\n limit: z\n .number()\n .int()\n .describe('Maximum number of items to return in the results.')\n .min(0)\n .max(100)\n .optional()\n .nullable(),\n cursor: z\n .string()\n .describe(\n \"Pointer to the next or previous page in the list of results.\\n\\nPass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\\nNot relevant for the first request.\"\n )\n .max(16000)\n .optional()\n .nullable(),\n })\n .describe(\n 'Pagination request metadata, currently applicable for:\\\\\\n- Queries filtered for items from a TPA that is part of the new-integration (TpaSiteStructureService)\\n- Queries filtered for dynamic router items from the new dynamic-pages-router integration (DynamicSiteStructureService)'\n )\n .optional(),\n filter: z\n .object({\n itemTypeIdentifier: z\n .string()\n .describe('In accordance to SiteStructureItem.item_type_identifier')\n .optional(),\n sourceId: z\n .string()\n .describe('In accordance to SiteStructureItem.source_id')\n .optional(),\n configId: z\n .string()\n .describe('In accordance to SiteStructureItem.config_id')\n .optional(),\n })\n .describe(\n 'Filtering metadata. Only items allowed by the filter will be returned.'\n )\n .optional(),\n sorting: z\n .object({\n fieldName: z\n .string()\n .describe('Name of the field to sort by.')\n .max(512)\n .optional(),\n order: z.enum(['ASC', 'DESC']).optional(),\n })\n .describe('General sorting metadata. Currently not supported.')\n .optional(),\n fieldSet: z.array(z.string()).optional(),\n languageMetadata: z\n .object({\n code: z\n .string()\n .describe(\"2 chars language code (e.g. 'en')\")\n .optional(),\n tag: z\n .string()\n .describe(\"4 chars language tag (e.g. 'en-us')\")\n .optional()\n .nullable(),\n })\n .describe(\n 'Language metadata. Contains 2 chars language code and/or 4 chars language tag.'\n )\n .optional(),\n branchId: z\n .string()\n .describe(\n 'Used to identify the branch of the site for which the structure is requested.'\n )\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional()\n .nullable(),\n })\n .optional(),\n});\nexport const GetSiteStructureResponse = z.object({\n totalResults: z\n .number()\n .int()\n .describe(\n 'The total number of items to be returned, combining all paginated responses.'\n )\n .optional(),\n pageData: z\n .object({\n count: z\n .number()\n .int()\n .describe('The item count in the current page')\n .optional()\n .nullable(),\n cursor: z\n .string()\n .describe('The cursor which will be used to query the next page')\n .optional()\n .nullable(),\n })\n .describe(\n 'A cursor based paging response metadata, including the item count in the current page and a cursor string to be used for querying of the next page.'\n )\n .optional(),\n results: z\n .array(\n z.object({\n itemId: z\n .string()\n .describe(\n 'The end goal: this field should contain a unique identifier for this site-structure item.\\\\\\nCurrently it contains:\\n- For site-structure integrated TPAs - the unique identifier provided by the TPA.\\n- For all other item types - empty string.'\n )\n .optional(),\n itemTypeIdentifier: z\n .string()\n .describe(\n 'An identifier for the type of the item. One of:\\n- For the site\\'s static pages - \"static_page\".\\n- For legacy integration TPAs - the TPA\\'s app-def-id.\\n- For TPAs with new site-structure integration - the item type identifier provided by the TPA. Commonly one of that TPA\\'s supported sub-pages.\\n- For items that are the result of a dynamic router - \"dynamic-page\".'\n )\n .optional(),\n sourceId: z\n .string()\n .describe(\n \"An identifier for the source of the item. One of:\\n- For the site's static pages - \\\"editor\\\".\\n- For legacy integration TPAs - the TPA's app-def-id.\\n- For TPAs with new site-structure integration - the TPA's app-def-id.\\n- For items that are the result of a dataBinding router - Wix-Data's app-def-id: 'e593b0bd-b783-45b8-97c2-873d42aacaf4'.\\n- For items that are the result of a dynamic router - Wix-Code's app-def-id: '675bbcef-18d8-41f5-800e-131ec9e08762'.\"\n )\n .optional(),\n configId: z\n .string()\n .describe(\n 'An identifier for the configuration of the item. Used currently as some sort of a placeholder for further filtering.\\n- For items of type \"dynamic-page\" - The \\'prefix\\' field that is part of the router-config object of the router that is related to this item (see WixCodeDynamicRouterResolver).\\n- For all other items types - empty string.'\n )\n .optional(),\n name: z\n .string()\n .describe(\n \"A human readable name string associated with the item.\\\\\\nCurrently exists only for new TPA site-structure integration items, and contains the 'name' field provided by the TPA for that item.\\\\\\nThis field is not guaranteed to be unique across the item list.\"\n )\n .optional()\n .nullable(),\n media: z\n .array(\n z.intersection(\n z.object({}),\n z.xor([\n z.object({\n image: z.never().optional(),\n video: z.never().optional(),\n document: z.never().optional(),\n }),\n z.object({\n video: z.never().optional(),\n document: z.never().optional(),\n image: z.string().describe('WixMedia image'),\n }),\n z.object({\n image: z.never().optional(),\n document: z.never().optional(),\n video: z.string().describe('WixMedia video'),\n }),\n z.object({\n image: z.never().optional(),\n video: z.never().optional(),\n document: z.string().describe('WixMedia document'),\n }),\n ])\n )\n )\n .optional(),\n path: z\n .string()\n .describe(\n \"A relative url path that can be used, with the site's base-url, to reach the page represented by this item.\"\n )\n .optional()\n .nullable(),\n _updatedDate: z\n .date()\n .describe(\n \"A timestamp representing the moment that this item was last changed.\\n- For static pages - the site's last publish time.\\n- For all kinds of TPAs - the last-modified field in the respective response item from the TPA.\\n- For items that are the result of a dynamic router - the content of the 'lastModified' optional field in the response item from Wix-Code's RPC endpoint, or, if missing, the site's last publish time. (see WixCodeDynamicRouterResolver).\"\n )\n .optional()\n .nullable(),\n inactive: z\n .boolean()\n .describe(\n \"A value indicating whether the item is inactive or not. E.g. hidden product/finished event etc.\\\\\\nCurrently exists only for new TPA site-structure integration items, and contains the 'inactive' field provided by the TPA for that item.\"\n )\n .optional()\n .nullable(),\n metadata: z\n .record(z.string(), z.any())\n .describe(\n 'A general free schema field to include further metadata related to this item.\\\\\\nCurrently exists only for:\\\\\\nStatic pages - a JSON that is the merge of:\\n1. The advancedSeoData JSON string that exists for the page in the master-page.\\n2. A JSON of the form:\\n```javascript\\n{\\n\"seo_legacy\": {\\n\"hidden_from_seo\": true / false\\n},\\n\"password_protected\": true / false\\n}\\n```\\nNew TPA site-structure integration items - the \\'metadata\\' field provided by the TPA for that item.'\n )\n .optional()\n .nullable(),\n image: z.array(z.string()).optional(),\n video: z.array(z.string()).optional(),\n protected: z\n .boolean()\n .describe(\n 'A value indicating whether the item is protected or not, by password or login.'\n )\n .optional()\n .nullable(),\n translationId: z\n .string()\n .describe(\n 'ID of the translations of the item. As same item can have multiple instances, one for each language, we can match them by this ID.\\\\\\nFor example:\\nBlog has one post, translated to 2 languages (EN, FR):\\n- EN item path is `/amazing-post`\\n- FR item path is `/poste-incroyable\\nBoth of them might have different `item_id`, but will share the same `translation_id`, to be easily match together\\nCurrently only relevant for Blog'\n )\n .optional(),\n isCustomErrorPage: z\n .boolean()\n .describe(\n 'A value indicating whether the item is a custom error page or not.'\n )\n .optional()\n .nullable(),\n })\n )\n .optional(),\n errors: z\n .array(\n z.intersection(\n z.object({\n errorMessage: z\n .string()\n .describe('Error message')\n .min(1)\n .max(1000)\n .optional(),\n appId: z\n .string()\n .describe(\n 'if the fetch happened while fetching links from a TPA, this will hold the TPA appDefId'\n )\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional()\n .nullable(),\n }),\n z.xor([\n z.object({\n itemTypeId: z.never().optional(),\n routerPrefix: z.never().optional(),\n }),\n z.object({\n routerPrefix: z.never().optional(),\n itemTypeId: z\n .string()\n .describe('item type id of the failed fetch')\n .min(1)\n .max(200),\n }),\n z.object({\n itemTypeId: z.never().optional(),\n routerPrefix: z\n .string()\n .describe('for dynamic pages: router prefix of the failed fetch')\n .min(1)\n .max(200),\n }),\n ])\n )\n )\n .optional(),\n});\nexport const GetSiteStructureMetadataRequest = z.object({\n options: z\n .object({ pageVersion: z.enum(['PUBLISHED', 'SAVED']).optional() })\n .optional(),\n});\nexport const GetSiteStructureMetadataResponse = z.object({\n pageTypes: z\n .array(\n z.object({\n itemTypeIdentifier: z.string().describe('Type identifier').optional(),\n sourceId: z.string().describe(\"Site's page-type sourceId\").optional(),\n configId: z.string().describe(\"Site's page-type configId\").optional(),\n })\n )\n .optional(),\n});\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const GetSiteStructureRequest: z.ZodObject<{
|
|
4
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
5
|
+
pageVersion: z.ZodOptional<z.ZodEnum<{
|
|
6
|
+
PUBLISHED: "PUBLISHED";
|
|
7
|
+
SAVED: "SAVED";
|
|
8
|
+
}>>;
|
|
9
|
+
paging: z.ZodOptional<z.ZodObject<{
|
|
10
|
+
limit: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
11
|
+
cursor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
filter: z.ZodOptional<z.ZodObject<{
|
|
14
|
+
itemTypeIdentifier: z.ZodOptional<z.ZodString>;
|
|
15
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
16
|
+
configId: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
sorting: z.ZodOptional<z.ZodObject<{
|
|
19
|
+
fieldName: z.ZodOptional<z.ZodString>;
|
|
20
|
+
order: z.ZodOptional<z.ZodEnum<{
|
|
21
|
+
ASC: "ASC";
|
|
22
|
+
DESC: "DESC";
|
|
23
|
+
}>>;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
fieldSet: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
26
|
+
languageMetadata: z.ZodOptional<z.ZodObject<{
|
|
27
|
+
code: z.ZodOptional<z.ZodString>;
|
|
28
|
+
tag: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
branchId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
declare const GetSiteStructureResponse: z.ZodObject<{
|
|
34
|
+
totalResults: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
pageData: z.ZodOptional<z.ZodObject<{
|
|
36
|
+
count: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
37
|
+
cursor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
results: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
40
|
+
itemId: z.ZodOptional<z.ZodString>;
|
|
41
|
+
itemTypeIdentifier: z.ZodOptional<z.ZodString>;
|
|
42
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
43
|
+
configId: z.ZodOptional<z.ZodString>;
|
|
44
|
+
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
45
|
+
media: z.ZodOptional<z.ZodArray<z.ZodIntersection<z.ZodObject<{}, z.core.$strip>, z.ZodXor<readonly [z.ZodObject<{
|
|
46
|
+
image: z.ZodOptional<z.ZodNever>;
|
|
47
|
+
video: z.ZodOptional<z.ZodNever>;
|
|
48
|
+
document: z.ZodOptional<z.ZodNever>;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
video: z.ZodOptional<z.ZodNever>;
|
|
51
|
+
document: z.ZodOptional<z.ZodNever>;
|
|
52
|
+
image: z.ZodString;
|
|
53
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
54
|
+
image: z.ZodOptional<z.ZodNever>;
|
|
55
|
+
document: z.ZodOptional<z.ZodNever>;
|
|
56
|
+
video: z.ZodString;
|
|
57
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
58
|
+
image: z.ZodOptional<z.ZodNever>;
|
|
59
|
+
video: z.ZodOptional<z.ZodNever>;
|
|
60
|
+
document: z.ZodString;
|
|
61
|
+
}, z.core.$strip>]>>>>;
|
|
62
|
+
path: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
63
|
+
_updatedDate: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
64
|
+
inactive: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
65
|
+
metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
66
|
+
image: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
67
|
+
video: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
68
|
+
protected: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
69
|
+
translationId: z.ZodOptional<z.ZodString>;
|
|
70
|
+
isCustomErrorPage: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
71
|
+
}, z.core.$strip>>>;
|
|
72
|
+
errors: z.ZodOptional<z.ZodArray<z.ZodIntersection<z.ZodObject<{
|
|
73
|
+
errorMessage: z.ZodOptional<z.ZodString>;
|
|
74
|
+
appId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
75
|
+
}, z.core.$strip>, z.ZodXor<readonly [z.ZodObject<{
|
|
76
|
+
itemTypeId: z.ZodOptional<z.ZodNever>;
|
|
77
|
+
routerPrefix: z.ZodOptional<z.ZodNever>;
|
|
78
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
79
|
+
routerPrefix: z.ZodOptional<z.ZodNever>;
|
|
80
|
+
itemTypeId: z.ZodString;
|
|
81
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
82
|
+
itemTypeId: z.ZodOptional<z.ZodNever>;
|
|
83
|
+
routerPrefix: z.ZodString;
|
|
84
|
+
}, z.core.$strip>]>>>>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
declare const GetSiteStructureMetadataRequest: z.ZodObject<{
|
|
87
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
88
|
+
pageVersion: z.ZodOptional<z.ZodEnum<{
|
|
89
|
+
PUBLISHED: "PUBLISHED";
|
|
90
|
+
SAVED: "SAVED";
|
|
91
|
+
}>>;
|
|
92
|
+
}, z.core.$strip>>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
declare const GetSiteStructureMetadataResponse: z.ZodObject<{
|
|
95
|
+
pageTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
96
|
+
itemTypeIdentifier: z.ZodOptional<z.ZodString>;
|
|
97
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
98
|
+
configId: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, z.core.$strip>>>;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
|
|
102
|
+
export { GetSiteStructureMetadataRequest, GetSiteStructureMetadataResponse, GetSiteStructureRequest, GetSiteStructureResponse };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// src/viewer-structure-v1-site-structure-item-site-structure-service.schemas.ts
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
var GetSiteStructureRequest = z.object({
|
|
4
|
+
options: z.object({
|
|
5
|
+
pageVersion: z.enum(["PUBLISHED", "SAVED"]).optional(),
|
|
6
|
+
paging: z.object({
|
|
7
|
+
limit: z.number().int().describe("Maximum number of items to return in the results.").min(0).max(100).optional().nullable(),
|
|
8
|
+
cursor: z.string().describe(
|
|
9
|
+
"Pointer to the next or previous page in the list of results.\n\nPass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\nNot relevant for the first request."
|
|
10
|
+
).max(16e3).optional().nullable()
|
|
11
|
+
}).describe(
|
|
12
|
+
"Pagination request metadata, currently applicable for:\\\n- Queries filtered for items from a TPA that is part of the new-integration (TpaSiteStructureService)\n- Queries filtered for dynamic router items from the new dynamic-pages-router integration (DynamicSiteStructureService)"
|
|
13
|
+
).optional(),
|
|
14
|
+
filter: z.object({
|
|
15
|
+
itemTypeIdentifier: z.string().describe("In accordance to SiteStructureItem.item_type_identifier").optional(),
|
|
16
|
+
sourceId: z.string().describe("In accordance to SiteStructureItem.source_id").optional(),
|
|
17
|
+
configId: z.string().describe("In accordance to SiteStructureItem.config_id").optional()
|
|
18
|
+
}).describe(
|
|
19
|
+
"Filtering metadata. Only items allowed by the filter will be returned."
|
|
20
|
+
).optional(),
|
|
21
|
+
sorting: z.object({
|
|
22
|
+
fieldName: z.string().describe("Name of the field to sort by.").max(512).optional(),
|
|
23
|
+
order: z.enum(["ASC", "DESC"]).optional()
|
|
24
|
+
}).describe("General sorting metadata. Currently not supported.").optional(),
|
|
25
|
+
fieldSet: z.array(z.string()).optional(),
|
|
26
|
+
languageMetadata: z.object({
|
|
27
|
+
code: z.string().describe("2 chars language code (e.g. 'en')").optional(),
|
|
28
|
+
tag: z.string().describe("4 chars language tag (e.g. 'en-us')").optional().nullable()
|
|
29
|
+
}).describe(
|
|
30
|
+
"Language metadata. Contains 2 chars language code and/or 4 chars language tag."
|
|
31
|
+
).optional(),
|
|
32
|
+
branchId: z.string().describe(
|
|
33
|
+
"Used to identify the branch of the site for which the structure is requested."
|
|
34
|
+
).regex(
|
|
35
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
36
|
+
"Must be a valid GUID"
|
|
37
|
+
).optional().nullable()
|
|
38
|
+
}).optional()
|
|
39
|
+
});
|
|
40
|
+
var GetSiteStructureResponse = z.object({
|
|
41
|
+
totalResults: z.number().int().describe(
|
|
42
|
+
"The total number of items to be returned, combining all paginated responses."
|
|
43
|
+
).optional(),
|
|
44
|
+
pageData: z.object({
|
|
45
|
+
count: z.number().int().describe("The item count in the current page").optional().nullable(),
|
|
46
|
+
cursor: z.string().describe("The cursor which will be used to query the next page").optional().nullable()
|
|
47
|
+
}).describe(
|
|
48
|
+
"A cursor based paging response metadata, including the item count in the current page and a cursor string to be used for querying of the next page."
|
|
49
|
+
).optional(),
|
|
50
|
+
results: z.array(
|
|
51
|
+
z.object({
|
|
52
|
+
itemId: z.string().describe(
|
|
53
|
+
"The end goal: this field should contain a unique identifier for this site-structure item.\\\nCurrently it contains:\n- For site-structure integrated TPAs - the unique identifier provided by the TPA.\n- For all other item types - empty string."
|
|
54
|
+
).optional(),
|
|
55
|
+
itemTypeIdentifier: z.string().describe(
|
|
56
|
+
`An identifier for the type of the item. One of:
|
|
57
|
+
- For the site's static pages - "static_page".
|
|
58
|
+
- For legacy integration TPAs - the TPA's app-def-id.
|
|
59
|
+
- For TPAs with new site-structure integration - the item type identifier provided by the TPA. Commonly one of that TPA's supported sub-pages.
|
|
60
|
+
- For items that are the result of a dynamic router - "dynamic-page".`
|
|
61
|
+
).optional(),
|
|
62
|
+
sourceId: z.string().describe(
|
|
63
|
+
`An identifier for the source of the item. One of:
|
|
64
|
+
- For the site's static pages - "editor".
|
|
65
|
+
- For legacy integration TPAs - the TPA's app-def-id.
|
|
66
|
+
- For TPAs with new site-structure integration - the TPA's app-def-id.
|
|
67
|
+
- For items that are the result of a dataBinding router - Wix-Data's app-def-id: 'e593b0bd-b783-45b8-97c2-873d42aacaf4'.
|
|
68
|
+
- For items that are the result of a dynamic router - Wix-Code's app-def-id: '675bbcef-18d8-41f5-800e-131ec9e08762'.`
|
|
69
|
+
).optional(),
|
|
70
|
+
configId: z.string().describe(
|
|
71
|
+
`An identifier for the configuration of the item. Used currently as some sort of a placeholder for further filtering.
|
|
72
|
+
- For items of type "dynamic-page" - The 'prefix' field that is part of the router-config object of the router that is related to this item (see WixCodeDynamicRouterResolver).
|
|
73
|
+
- For all other items types - empty string.`
|
|
74
|
+
).optional(),
|
|
75
|
+
name: z.string().describe(
|
|
76
|
+
"A human readable name string associated with the item.\\\nCurrently exists only for new TPA site-structure integration items, and contains the 'name' field provided by the TPA for that item.\\\nThis field is not guaranteed to be unique across the item list."
|
|
77
|
+
).optional().nullable(),
|
|
78
|
+
media: z.array(
|
|
79
|
+
z.intersection(
|
|
80
|
+
z.object({}),
|
|
81
|
+
z.xor([
|
|
82
|
+
z.object({
|
|
83
|
+
image: z.never().optional(),
|
|
84
|
+
video: z.never().optional(),
|
|
85
|
+
document: z.never().optional()
|
|
86
|
+
}),
|
|
87
|
+
z.object({
|
|
88
|
+
video: z.never().optional(),
|
|
89
|
+
document: z.never().optional(),
|
|
90
|
+
image: z.string().describe("WixMedia image")
|
|
91
|
+
}),
|
|
92
|
+
z.object({
|
|
93
|
+
image: z.never().optional(),
|
|
94
|
+
document: z.never().optional(),
|
|
95
|
+
video: z.string().describe("WixMedia video")
|
|
96
|
+
}),
|
|
97
|
+
z.object({
|
|
98
|
+
image: z.never().optional(),
|
|
99
|
+
video: z.never().optional(),
|
|
100
|
+
document: z.string().describe("WixMedia document")
|
|
101
|
+
})
|
|
102
|
+
])
|
|
103
|
+
)
|
|
104
|
+
).optional(),
|
|
105
|
+
path: z.string().describe(
|
|
106
|
+
"A relative url path that can be used, with the site's base-url, to reach the page represented by this item."
|
|
107
|
+
).optional().nullable(),
|
|
108
|
+
_updatedDate: z.date().describe(
|
|
109
|
+
"A timestamp representing the moment that this item was last changed.\n- For static pages - the site's last publish time.\n- For all kinds of TPAs - the last-modified field in the respective response item from the TPA.\n- For items that are the result of a dynamic router - the content of the 'lastModified' optional field in the response item from Wix-Code's RPC endpoint, or, if missing, the site's last publish time. (see WixCodeDynamicRouterResolver)."
|
|
110
|
+
).optional().nullable(),
|
|
111
|
+
inactive: z.boolean().describe(
|
|
112
|
+
"A value indicating whether the item is inactive or not. E.g. hidden product/finished event etc.\\\nCurrently exists only for new TPA site-structure integration items, and contains the 'inactive' field provided by the TPA for that item."
|
|
113
|
+
).optional().nullable(),
|
|
114
|
+
metadata: z.record(z.string(), z.any()).describe(
|
|
115
|
+
'A general free schema field to include further metadata related to this item.\\\nCurrently exists only for:\\\nStatic pages - a JSON that is the merge of:\n1. The advancedSeoData JSON string that exists for the page in the master-page.\n2. A JSON of the form:\n```javascript\n{\n"seo_legacy": {\n"hidden_from_seo": true / false\n},\n"password_protected": true / false\n}\n```\nNew TPA site-structure integration items - the \'metadata\' field provided by the TPA for that item.'
|
|
116
|
+
).optional().nullable(),
|
|
117
|
+
image: z.array(z.string()).optional(),
|
|
118
|
+
video: z.array(z.string()).optional(),
|
|
119
|
+
protected: z.boolean().describe(
|
|
120
|
+
"A value indicating whether the item is protected or not, by password or login."
|
|
121
|
+
).optional().nullable(),
|
|
122
|
+
translationId: z.string().describe(
|
|
123
|
+
"ID of the translations of the item. As same item can have multiple instances, one for each language, we can match them by this ID.\\\nFor example:\nBlog has one post, translated to 2 languages (EN, FR):\n- EN item path is `/amazing-post`\n- FR item path is `/poste-incroyable\nBoth of them might have different `item_id`, but will share the same `translation_id`, to be easily match together\nCurrently only relevant for Blog"
|
|
124
|
+
).optional(),
|
|
125
|
+
isCustomErrorPage: z.boolean().describe(
|
|
126
|
+
"A value indicating whether the item is a custom error page or not."
|
|
127
|
+
).optional().nullable()
|
|
128
|
+
})
|
|
129
|
+
).optional(),
|
|
130
|
+
errors: z.array(
|
|
131
|
+
z.intersection(
|
|
132
|
+
z.object({
|
|
133
|
+
errorMessage: z.string().describe("Error message").min(1).max(1e3).optional(),
|
|
134
|
+
appId: z.string().describe(
|
|
135
|
+
"if the fetch happened while fetching links from a TPA, this will hold the TPA appDefId"
|
|
136
|
+
).regex(
|
|
137
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
138
|
+
"Must be a valid GUID"
|
|
139
|
+
).optional().nullable()
|
|
140
|
+
}),
|
|
141
|
+
z.xor([
|
|
142
|
+
z.object({
|
|
143
|
+
itemTypeId: z.never().optional(),
|
|
144
|
+
routerPrefix: z.never().optional()
|
|
145
|
+
}),
|
|
146
|
+
z.object({
|
|
147
|
+
routerPrefix: z.never().optional(),
|
|
148
|
+
itemTypeId: z.string().describe("item type id of the failed fetch").min(1).max(200)
|
|
149
|
+
}),
|
|
150
|
+
z.object({
|
|
151
|
+
itemTypeId: z.never().optional(),
|
|
152
|
+
routerPrefix: z.string().describe("for dynamic pages: router prefix of the failed fetch").min(1).max(200)
|
|
153
|
+
})
|
|
154
|
+
])
|
|
155
|
+
)
|
|
156
|
+
).optional()
|
|
157
|
+
});
|
|
158
|
+
var GetSiteStructureMetadataRequest = z.object({
|
|
159
|
+
options: z.object({ pageVersion: z.enum(["PUBLISHED", "SAVED"]).optional() }).optional()
|
|
160
|
+
});
|
|
161
|
+
var GetSiteStructureMetadataResponse = z.object({
|
|
162
|
+
pageTypes: z.array(
|
|
163
|
+
z.object({
|
|
164
|
+
itemTypeIdentifier: z.string().describe("Type identifier").optional(),
|
|
165
|
+
sourceId: z.string().describe("Site's page-type sourceId").optional(),
|
|
166
|
+
configId: z.string().describe("Site's page-type configId").optional()
|
|
167
|
+
})
|
|
168
|
+
).optional()
|
|
169
|
+
});
|
|
170
|
+
export {
|
|
171
|
+
GetSiteStructureMetadataRequest,
|
|
172
|
+
GetSiteStructureMetadataResponse,
|
|
173
|
+
GetSiteStructureRequest,
|
|
174
|
+
GetSiteStructureResponse
|
|
175
|
+
};
|
|
176
|
+
//# sourceMappingURL=schemas.mjs.map
|