@wix/auto_sdk_viewer_site-structure-service 1.0.0
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 +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.context.d.ts +6 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.context.js +11 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.context.js.map +1 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.http.d.ts +5 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.http.js +118 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.http.js.map +1 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.meta.d.ts +14 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.meta.js +66 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.meta.js.map +1 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.public.d.ts +20 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.public.js +21 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.public.js.map +1 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.types.d.ts +387 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.types.js +14 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.types.js.map +1 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.universal.d.ts +320 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.universal.js +135 -0
- package/build/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.context.d.ts +6 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.context.js +6 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.context.js.map +1 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.http.d.ts +5 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.http.js +113 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.http.js.map +1 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.meta.d.ts +14 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.meta.js +38 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.meta.js.map +1 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.public.d.ts +20 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.public.js +14 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.public.js.map +1 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.types.d.ts +387 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.types.js +11 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.types.js.map +1 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.universal.d.ts +320 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.universal.js +107 -0
- package/build/es/src/viewer-structure-v1-site-structure-item-site-structure-service.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.context.d.ts +6 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.context.js +11 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.context.js.map +1 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.http.d.ts +5 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.http.js +118 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.http.js.map +1 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.meta.d.ts +14 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.meta.js +66 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.meta.js.map +1 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.public.d.ts +20 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.public.js +21 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.public.js.map +1 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.types.d.ts +387 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.types.js +14 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.types.js.map +1 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.universal.d.ts +320 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.universal.js +135 -0
- package/build/internal/cjs/src/viewer-structure-v1-site-structure-item-site-structure-service.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.context.d.ts +6 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.context.js +6 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.context.js.map +1 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.http.d.ts +5 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.http.js +113 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.http.js.map +1 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.meta.d.ts +14 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.meta.js +38 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.meta.js.map +1 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.public.d.ts +20 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.public.js +14 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.public.js.map +1 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.types.d.ts +387 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.types.js +11 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.types.js.map +1 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.universal.d.ts +320 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.universal.js +107 -0
- package/build/internal/es/src/viewer-structure-v1-site-structure-item-site-structure-service.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
export interface SiteStructureItem {
|
|
2
|
+
/**
|
|
3
|
+
* The end goal: this field should contain a unique identifier for this site-structure item.\
|
|
4
|
+
* Currently it contains:
|
|
5
|
+
* - For site-structure integrated TPAs - the unique identifier provided by the TPA.
|
|
6
|
+
* - For all other item types - empty string.
|
|
7
|
+
*/
|
|
8
|
+
itemId?: string;
|
|
9
|
+
/**
|
|
10
|
+
* An identifier for the type of the item. One of:
|
|
11
|
+
* - For the site's static pages - "static_page".
|
|
12
|
+
* - For legacy integration TPAs - the TPA's app-def-id.
|
|
13
|
+
* - For TPAs with new site-structure integration - the item type identifier provided by the TPA. Commonly one of that TPA's supported sub-pages.
|
|
14
|
+
* - For items that are the result of a dynamic router - "dynamic-page".
|
|
15
|
+
*/
|
|
16
|
+
itemTypeIdentifier?: string;
|
|
17
|
+
/**
|
|
18
|
+
* An identifier for the source of the item. One of:
|
|
19
|
+
* - For the site's static pages - "editor".
|
|
20
|
+
* - For legacy integration TPAs - the TPA's app-def-id.
|
|
21
|
+
* - For TPAs with new site-structure integration - the TPA's app-def-id.
|
|
22
|
+
* - For items that are the result of a dynamic router - Wix-Code's app-def-id: '675bbcef-18d8-41f5-800e-131ec9e08762'.
|
|
23
|
+
*/
|
|
24
|
+
sourceId?: string;
|
|
25
|
+
/**
|
|
26
|
+
* An identifier for the configuration of the item. Used currently as some sort of a placeholder for further filtering.
|
|
27
|
+
* - 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).
|
|
28
|
+
* - For all other items types - empty string.
|
|
29
|
+
*/
|
|
30
|
+
configId?: string;
|
|
31
|
+
/**
|
|
32
|
+
* A human readable name string associated with the item.\
|
|
33
|
+
* Currently exists only for new TPA site-structure integration items, and contains the 'name' field provided by the TPA for that item.\
|
|
34
|
+
* This field is not guaranteed to be unique across the item list.
|
|
35
|
+
*/
|
|
36
|
+
name?: string | null;
|
|
37
|
+
/**
|
|
38
|
+
* Deprecated. Previously used for media content that is associated with an item.\
|
|
39
|
+
* See 'image' and 'video' fields of this message.
|
|
40
|
+
* @deprecated
|
|
41
|
+
*/
|
|
42
|
+
media?: MediaItem[];
|
|
43
|
+
/** A relative url path that can be used, with the site's base-url, to reach the page represented by this item. */
|
|
44
|
+
path?: string | null;
|
|
45
|
+
/**
|
|
46
|
+
* A timestamp representing the moment that this item was last changed.
|
|
47
|
+
* - For static pages - the site's last publish time.
|
|
48
|
+
* - For all kinds of TPAs - the last-modified field in the respective response item from the TPA.
|
|
49
|
+
* - 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).
|
|
50
|
+
*/
|
|
51
|
+
_updatedDate?: Date | null;
|
|
52
|
+
/**
|
|
53
|
+
* A value indicating whether the item is inactive or not. E.g. hidden product/finished event etc.\
|
|
54
|
+
* Currently exists only for new TPA site-structure integration items, and contains the 'inactive' field provided by the TPA for that item.
|
|
55
|
+
*/
|
|
56
|
+
inactive?: boolean | null;
|
|
57
|
+
/**
|
|
58
|
+
* A general free schema field to include further metadata related to this item.\
|
|
59
|
+
* Currently exists only for:\
|
|
60
|
+
* Static pages - a JSON that is the merge of:
|
|
61
|
+
* 1. The advancedSeoData JSON string that exists for the page in the master-page.
|
|
62
|
+
* 2. A JSON of the form:
|
|
63
|
+
* ```javascript
|
|
64
|
+
* {
|
|
65
|
+
* "seo_legacy": {
|
|
66
|
+
* "hidden_from_seo": true / false
|
|
67
|
+
* },
|
|
68
|
+
* "password_protected": true / false
|
|
69
|
+
* }
|
|
70
|
+
* ```
|
|
71
|
+
* New TPA site-structure integration items - the 'metadata' field provided by the TPA for that item.
|
|
72
|
+
*/
|
|
73
|
+
metadata?: Record<string, any> | null;
|
|
74
|
+
/**
|
|
75
|
+
* An image media metadata the is related to this item.\
|
|
76
|
+
* Currently exists only for new TPA site-structure integration items, and contains the 'image' field provided by the TPA for that item.
|
|
77
|
+
*/
|
|
78
|
+
image?: string[];
|
|
79
|
+
/**
|
|
80
|
+
* A video media metadata the is related to this item.\
|
|
81
|
+
* Currently exists only for new TPA site-structure integration items, and contains the 'video' field provided by the TPA for that item.
|
|
82
|
+
*/
|
|
83
|
+
video?: string[];
|
|
84
|
+
/** A value indicating whether the item is protected or not, by password or login. */
|
|
85
|
+
protected?: boolean | null;
|
|
86
|
+
/**
|
|
87
|
+
* 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.\
|
|
88
|
+
* For example:
|
|
89
|
+
* Blog has one post, translated to 2 languages (EN, FR):
|
|
90
|
+
* - EN item path is `/amazing-post`
|
|
91
|
+
* - FR item path is `/poste-incroyable
|
|
92
|
+
* Both of them might have different `item_id`, but will share the same `translation_id`, to be easily match together
|
|
93
|
+
* Currently only relevant for Blog
|
|
94
|
+
*/
|
|
95
|
+
translationId?: string;
|
|
96
|
+
/** A value indicating whether the item is a custom error page or not. */
|
|
97
|
+
isCustomErrorPage?: boolean | null;
|
|
98
|
+
}
|
|
99
|
+
/** Deprecated - Copy this message into your service, do not reference it */
|
|
100
|
+
export interface MediaItem extends MediaItemMediaOneOf {
|
|
101
|
+
/** WixMedia image */
|
|
102
|
+
image?: string;
|
|
103
|
+
/** WixMedia video */
|
|
104
|
+
video?: string;
|
|
105
|
+
/** WixMedia document */
|
|
106
|
+
document?: string;
|
|
107
|
+
}
|
|
108
|
+
/** @oneof */
|
|
109
|
+
export interface MediaItemMediaOneOf {
|
|
110
|
+
/** WixMedia image */
|
|
111
|
+
image?: string;
|
|
112
|
+
/** WixMedia video */
|
|
113
|
+
video?: string;
|
|
114
|
+
/** WixMedia document */
|
|
115
|
+
document?: string;
|
|
116
|
+
}
|
|
117
|
+
export interface FocalPoint {
|
|
118
|
+
/** X-coordinate of the focal point. */
|
|
119
|
+
x?: number;
|
|
120
|
+
/** Y-coordinate of the focal point. */
|
|
121
|
+
y?: number;
|
|
122
|
+
/** crop by height */
|
|
123
|
+
height?: number | null;
|
|
124
|
+
/** crop by width */
|
|
125
|
+
width?: number | null;
|
|
126
|
+
}
|
|
127
|
+
export interface VideoResolution {
|
|
128
|
+
/** Video URL. */
|
|
129
|
+
url?: string;
|
|
130
|
+
/** Video height. */
|
|
131
|
+
height?: number;
|
|
132
|
+
/** Video width. */
|
|
133
|
+
width?: number;
|
|
134
|
+
/** Video format for example, mp4, hls. */
|
|
135
|
+
format?: string;
|
|
136
|
+
}
|
|
137
|
+
export interface SiteStructureRequest {
|
|
138
|
+
/** An enum indicating whether the request is for the latest published version (0) or the latest saved version (1) of the site */
|
|
139
|
+
pageVersion?: PageSegment;
|
|
140
|
+
/**
|
|
141
|
+
* Pagination request metadata, currently applicable for:\
|
|
142
|
+
* - Queries filtered for items from a TPA that is part of the new-integration (TpaSiteStructureService)
|
|
143
|
+
* - Queries filtered for dynamic router items from the new dynamic-pages-router integration (DynamicSiteStructureService)
|
|
144
|
+
*/
|
|
145
|
+
paging?: CursorPaging;
|
|
146
|
+
/** Filtering metadata. Only items allowed by the filter will be returned. */
|
|
147
|
+
filter?: SiteStructureRequestFilter;
|
|
148
|
+
/** General sorting metadata. Currently not supported. */
|
|
149
|
+
sorting?: Sorting;
|
|
150
|
+
/** General field mask metadata. Currently not supported. */
|
|
151
|
+
fieldSet?: string[];
|
|
152
|
+
/** Language metadata. Contains 2 chars language code and/or 4 chars language tag. */
|
|
153
|
+
languageMetadata?: LanguageMetadata;
|
|
154
|
+
}
|
|
155
|
+
export declare enum PageSegment {
|
|
156
|
+
PUBLISHED = "PUBLISHED",
|
|
157
|
+
SAVED = "SAVED"
|
|
158
|
+
}
|
|
159
|
+
export interface CursorPaging {
|
|
160
|
+
/**
|
|
161
|
+
* Maximum number of items to return in the results.
|
|
162
|
+
* @max 100
|
|
163
|
+
*/
|
|
164
|
+
limit?: number | null;
|
|
165
|
+
/**
|
|
166
|
+
* Pointer to the next or previous page in the list of results.
|
|
167
|
+
*
|
|
168
|
+
* Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
|
|
169
|
+
* Not relevant for the first request.
|
|
170
|
+
* @maxLength 16000
|
|
171
|
+
*/
|
|
172
|
+
cursor?: string | null;
|
|
173
|
+
}
|
|
174
|
+
/** A filter metadata type. The filter forces an 'and' logic between all of its comprising parts. */
|
|
175
|
+
export interface SiteStructureRequestFilter {
|
|
176
|
+
/** In accordance to SiteStructureItem.item_type_identifier */
|
|
177
|
+
itemTypeIdentifier?: string;
|
|
178
|
+
/** In accordance to SiteStructureItem.source_id */
|
|
179
|
+
sourceId?: string;
|
|
180
|
+
/** In accordance to SiteStructureItem.config_id */
|
|
181
|
+
configId?: string;
|
|
182
|
+
}
|
|
183
|
+
export interface Sorting {
|
|
184
|
+
/**
|
|
185
|
+
* Name of the field to sort by.
|
|
186
|
+
* @maxLength 512
|
|
187
|
+
*/
|
|
188
|
+
fieldName?: string;
|
|
189
|
+
/** Sort order. */
|
|
190
|
+
order?: SortOrder;
|
|
191
|
+
}
|
|
192
|
+
export declare enum SortOrder {
|
|
193
|
+
ASC = "ASC",
|
|
194
|
+
DESC = "DESC"
|
|
195
|
+
}
|
|
196
|
+
export interface LanguageMetadata {
|
|
197
|
+
/**
|
|
198
|
+
* 2 chars language code (e.g. 'en')
|
|
199
|
+
* @format LANGUAGE
|
|
200
|
+
*/
|
|
201
|
+
code?: string;
|
|
202
|
+
/**
|
|
203
|
+
* 4 chars language tag (e.g. 'en-us')
|
|
204
|
+
* @format LANGUAGE_TAG
|
|
205
|
+
*/
|
|
206
|
+
tag?: string | null;
|
|
207
|
+
}
|
|
208
|
+
export interface SiteStructureResponse {
|
|
209
|
+
/** The total number of items to be returned, combining all paginated responses. */
|
|
210
|
+
totalResults?: number;
|
|
211
|
+
/** 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. */
|
|
212
|
+
pageData?: CursorPagingMetaData;
|
|
213
|
+
/** A list of all the result items. */
|
|
214
|
+
results?: SiteStructureItem[];
|
|
215
|
+
/** A list of errors that occurred during the fetch process (if any). */
|
|
216
|
+
errors?: SiteStructureFetchError[];
|
|
217
|
+
}
|
|
218
|
+
export interface CursorPagingMetaData {
|
|
219
|
+
/** The item count in the current page */
|
|
220
|
+
count?: number | null;
|
|
221
|
+
/** The cursor which will be used to query the next page */
|
|
222
|
+
cursor?: string | null;
|
|
223
|
+
}
|
|
224
|
+
export interface SiteStructureFetchError {
|
|
225
|
+
/**
|
|
226
|
+
* Error message
|
|
227
|
+
* @minLength 1
|
|
228
|
+
* @maxLength 1000
|
|
229
|
+
*/
|
|
230
|
+
errorMessage?: string;
|
|
231
|
+
/**
|
|
232
|
+
* if the fetch happened while fetching links from a TPA, this will hold the TPA appDefId
|
|
233
|
+
* @readonly
|
|
234
|
+
* @format GUID
|
|
235
|
+
*/
|
|
236
|
+
appId?: string | null;
|
|
237
|
+
}
|
|
238
|
+
export interface GetSiteStructureMetadataRequest {
|
|
239
|
+
/** Page's version */
|
|
240
|
+
pageVersion?: PageSegment;
|
|
241
|
+
}
|
|
242
|
+
export interface GetSiteStructureMetadataResponse {
|
|
243
|
+
/** A list of pages types */
|
|
244
|
+
pageTypes?: SitePageType[];
|
|
245
|
+
}
|
|
246
|
+
export interface SitePageType {
|
|
247
|
+
/** Type identifier */
|
|
248
|
+
itemTypeIdentifier?: string;
|
|
249
|
+
/** Site's page-type sourceId */
|
|
250
|
+
sourceId?: string;
|
|
251
|
+
/** Site's page-type configId */
|
|
252
|
+
configId?: string;
|
|
253
|
+
}
|
|
254
|
+
interface MediaItemNonNullableFields {
|
|
255
|
+
image: string;
|
|
256
|
+
video: string;
|
|
257
|
+
document: string;
|
|
258
|
+
}
|
|
259
|
+
interface SiteStructureItemNonNullableFields {
|
|
260
|
+
itemId: string;
|
|
261
|
+
itemTypeIdentifier: string;
|
|
262
|
+
sourceId: string;
|
|
263
|
+
configId: string;
|
|
264
|
+
media: MediaItemNonNullableFields[];
|
|
265
|
+
image: string[];
|
|
266
|
+
video: string[];
|
|
267
|
+
translationId: string;
|
|
268
|
+
}
|
|
269
|
+
interface SiteStructureFetchErrorNonNullableFields {
|
|
270
|
+
errorMessage: string;
|
|
271
|
+
}
|
|
272
|
+
export interface SiteStructureResponseNonNullableFields {
|
|
273
|
+
totalResults: number;
|
|
274
|
+
results: SiteStructureItemNonNullableFields[];
|
|
275
|
+
errors: SiteStructureFetchErrorNonNullableFields[];
|
|
276
|
+
}
|
|
277
|
+
interface SitePageTypeNonNullableFields {
|
|
278
|
+
itemTypeIdentifier: string;
|
|
279
|
+
sourceId: string;
|
|
280
|
+
configId: string;
|
|
281
|
+
pageIdentifiers: string[];
|
|
282
|
+
}
|
|
283
|
+
export interface GetSiteStructureMetadataResponseNonNullableFields {
|
|
284
|
+
pageTypes: SitePageTypeNonNullableFields[];
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Get Site's structure
|
|
288
|
+
* @public
|
|
289
|
+
* @fqn com.wixpress.structure.api.SiteStructureService.GetSiteStructure
|
|
290
|
+
*/
|
|
291
|
+
export declare function getSiteStructure(options?: GetSiteStructureOptions): Promise<SiteStructureResponse & SiteStructureResponseNonNullableFields>;
|
|
292
|
+
export interface GetSiteStructureOptions {
|
|
293
|
+
/** An enum indicating whether the request is for the latest published version (0) or the latest saved version (1) of the site */
|
|
294
|
+
pageVersion?: PageSegment;
|
|
295
|
+
/**
|
|
296
|
+
* Pagination request metadata, currently applicable for:\
|
|
297
|
+
* - Queries filtered for items from a TPA that is part of the new-integration (TpaSiteStructureService)
|
|
298
|
+
* - Queries filtered for dynamic router items from the new dynamic-pages-router integration (DynamicSiteStructureService)
|
|
299
|
+
*/
|
|
300
|
+
paging?: CursorPaging;
|
|
301
|
+
/** Filtering metadata. Only items allowed by the filter will be returned. */
|
|
302
|
+
filter?: SiteStructureRequestFilter;
|
|
303
|
+
/** General sorting metadata. Currently not supported. */
|
|
304
|
+
sorting?: Sorting;
|
|
305
|
+
/** General field mask metadata. Currently not supported. */
|
|
306
|
+
fieldSet?: string[];
|
|
307
|
+
/** Language metadata. Contains 2 chars language code and/or 4 chars language tag. */
|
|
308
|
+
languageMetadata?: LanguageMetadata;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Get Site's structure meta-data
|
|
312
|
+
* @public
|
|
313
|
+
* @fqn com.wixpress.structure.api.SiteStructureService.GetSiteStructureMetadata
|
|
314
|
+
*/
|
|
315
|
+
export declare function getSiteStructureMetadata(options?: GetSiteStructureMetadataOptions): Promise<GetSiteStructureMetadataResponse & GetSiteStructureMetadataResponseNonNullableFields>;
|
|
316
|
+
export interface GetSiteStructureMetadataOptions {
|
|
317
|
+
/** Page's version */
|
|
318
|
+
pageVersion?: PageSegment;
|
|
319
|
+
}
|
|
320
|
+
export {};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
|
|
2
|
+
import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
|
|
3
|
+
import * as ambassadorWixViewerStructureV1SiteStructureItem from './viewer-structure-v1-site-structure-item-site-structure-service.http.js';
|
|
4
|
+
import { transformRESTImageToSDKImage } from '@wix/sdk-runtime/transformations/image';
|
|
5
|
+
import { transformRESTVideoV2ToSDKVideoV2 } from '@wix/sdk-runtime/transformations/video-v2';
|
|
6
|
+
import { transformRESTVideoToSDKVideo } from '@wix/sdk-runtime/transformations/video';
|
|
7
|
+
import { transformRESTDocumentToSDKDocument } from '@wix/sdk-runtime/transformations/document';
|
|
8
|
+
import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
|
|
9
|
+
export var PageSegment;
|
|
10
|
+
(function (PageSegment) {
|
|
11
|
+
PageSegment["PUBLISHED"] = "PUBLISHED";
|
|
12
|
+
PageSegment["SAVED"] = "SAVED";
|
|
13
|
+
})(PageSegment || (PageSegment = {}));
|
|
14
|
+
export var SortOrder;
|
|
15
|
+
(function (SortOrder) {
|
|
16
|
+
SortOrder["ASC"] = "ASC";
|
|
17
|
+
SortOrder["DESC"] = "DESC";
|
|
18
|
+
})(SortOrder || (SortOrder = {}));
|
|
19
|
+
/**
|
|
20
|
+
* Get Site's structure
|
|
21
|
+
* @public
|
|
22
|
+
* @fqn com.wixpress.structure.api.SiteStructureService.GetSiteStructure
|
|
23
|
+
*/
|
|
24
|
+
export async function getSiteStructure(options) {
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
27
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
28
|
+
pageVersion: options?.pageVersion,
|
|
29
|
+
paging: options?.paging,
|
|
30
|
+
filter: options?.filter,
|
|
31
|
+
sorting: options?.sorting,
|
|
32
|
+
fieldSet: options?.fieldSet,
|
|
33
|
+
languageMetadata: options?.languageMetadata,
|
|
34
|
+
});
|
|
35
|
+
const reqOpts = ambassadorWixViewerStructureV1SiteStructureItem.getSiteStructure(payload);
|
|
36
|
+
sideEffects?.onSiteCall?.();
|
|
37
|
+
try {
|
|
38
|
+
const result = await httpClient.request(reqOpts);
|
|
39
|
+
sideEffects?.onSuccess?.(result);
|
|
40
|
+
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
|
41
|
+
{
|
|
42
|
+
transformFn: transformRESTImageToSDKImage,
|
|
43
|
+
paths: [
|
|
44
|
+
{ path: 'results.image', isRepeated: true },
|
|
45
|
+
{ path: 'results.media.image' },
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
50
|
+
paths: [{ path: 'results.video', isRepeated: true }],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
transformFn: transformRESTVideoToSDKVideo,
|
|
54
|
+
paths: [{ path: 'results.media.video' }],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
transformFn: transformRESTDocumentToSDKDocument,
|
|
58
|
+
paths: [{ path: 'results.media.document' }],
|
|
59
|
+
},
|
|
60
|
+
]));
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
const transformedError = sdkTransformError(err, {
|
|
64
|
+
spreadPathsToArguments: {},
|
|
65
|
+
explicitPathsToArguments: {
|
|
66
|
+
pageVersion: '$[0].pageVersion',
|
|
67
|
+
paging: '$[0].paging',
|
|
68
|
+
filter: '$[0].filter',
|
|
69
|
+
sorting: '$[0].sorting',
|
|
70
|
+
fieldSet: '$[0].fieldSet',
|
|
71
|
+
languageMetadata: '$[0].languageMetadata',
|
|
72
|
+
},
|
|
73
|
+
singleArgumentUnchanged: false,
|
|
74
|
+
}, ['options']);
|
|
75
|
+
sideEffects?.onError?.(err);
|
|
76
|
+
throw transformedError;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get Site's structure meta-data
|
|
81
|
+
* @public
|
|
82
|
+
* @fqn com.wixpress.structure.api.SiteStructureService.GetSiteStructureMetadata
|
|
83
|
+
*/
|
|
84
|
+
export async function getSiteStructureMetadata(options) {
|
|
85
|
+
// @ts-ignore
|
|
86
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
87
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
88
|
+
pageVersion: options?.pageVersion,
|
|
89
|
+
});
|
|
90
|
+
const reqOpts = ambassadorWixViewerStructureV1SiteStructureItem.getSiteStructureMetadata(payload);
|
|
91
|
+
sideEffects?.onSiteCall?.();
|
|
92
|
+
try {
|
|
93
|
+
const result = await httpClient.request(reqOpts);
|
|
94
|
+
sideEffects?.onSuccess?.(result);
|
|
95
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
const transformedError = sdkTransformError(err, {
|
|
99
|
+
spreadPathsToArguments: {},
|
|
100
|
+
explicitPathsToArguments: { pageVersion: '$[0].pageVersion' },
|
|
101
|
+
singleArgumentUnchanged: false,
|
|
102
|
+
}, ['options']);
|
|
103
|
+
sideEffects?.onError?.(err);
|
|
104
|
+
throw transformedError;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=viewer-structure-v1-site-structure-item-site-structure-service.universal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewer-structure-v1-site-structure-item-site-structure-service.universal.js","sourceRoot":"","sources":["../../../../src/viewer-structure-v1-site-structure-item-site-structure-service.universal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EACL,qCAAqC,EACrC,uCAAuC,GACxC,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,+CAA+C,MAAM,0EAA0E,CAAC;AAC5I,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,kCAAkC,EAAE,MAAM,2CAA2C,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,kDAAkD,CAAC;AAkKlF,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,sCAAuB,CAAA;IACvB,8BAAe,CAAA;AACjB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAsCD,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAyGD;;;;GAIG;AACH,MAAM,CAAC,KAAK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YAC7D,uBAAuB,EAAE,KAAK;SAC/B,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;QACF,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,gBAAgB,CAAC;IACzB,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wix/auto_sdk_viewer_site-structure-service",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"registry": "https://registry.npmjs.org/",
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"keywords": [],
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"main": "./build/cjs/index.js",
|
|
11
|
+
"types": "./build/es/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./build/es/index.js",
|
|
15
|
+
"require": "./build/cjs/index.js",
|
|
16
|
+
"types": "./build/es/index.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./package.json": "./package.json",
|
|
19
|
+
"./meta": {
|
|
20
|
+
"import": "./build/es/meta.js",
|
|
21
|
+
"require": "./build/cjs/meta.js",
|
|
22
|
+
"types": "./build/es/meta.d.ts"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"build",
|
|
27
|
+
"meta",
|
|
28
|
+
"service-plugins"
|
|
29
|
+
],
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@wix/sdk-runtime": "^0.3.35",
|
|
32
|
+
"@wix/sdk-types": "^1.12.4"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"typescript": "^5.3.2"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc -b tsconfig.json tsconfig.esm.json tsconfig.internal.json tsconfig.internal.esm.json",
|
|
39
|
+
"test": ":"
|
|
40
|
+
},
|
|
41
|
+
"wix": {
|
|
42
|
+
"artifact": {
|
|
43
|
+
"artifactId": "auto-sdk-viewer-site-structure-service",
|
|
44
|
+
"groupId": "com.wixpress.public-sdk-dependencies"
|
|
45
|
+
},
|
|
46
|
+
"sdkDependency": {
|
|
47
|
+
"fqdnNamespace": "siteStructureService",
|
|
48
|
+
"fqdn": "wix.viewer.structure.v1.site_structure_item"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"falconPackageHash": "a7593055a156f11d6a3c289db597535f3836e22ae5296f72950b7172"
|
|
52
|
+
}
|