@wix/blog 1.0.113
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 +3 -0
- package/build/cjs/index.js +26 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/src/blog-v3-category.http.d.ts +50 -0
- package/build/cjs/src/blog-v3-category.http.js +421 -0
- package/build/cjs/src/blog-v3-category.http.js.map +1 -0
- package/build/cjs/src/blog-v3-category.public.d.ts +11 -0
- package/build/cjs/src/blog-v3-category.public.js +50 -0
- package/build/cjs/src/blog-v3-category.public.js.map +1 -0
- package/build/cjs/src/blog-v3-category.types.d.ts +391 -0
- package/build/cjs/src/blog-v3-category.types.js +22 -0
- package/build/cjs/src/blog-v3-category.types.js.map +1 -0
- package/build/cjs/src/blog-v3-category.universal.d.ts +582 -0
- package/build/cjs/src/blog-v3-category.universal.js +460 -0
- package/build/cjs/src/blog-v3-category.universal.js.map +1 -0
- package/build/cjs/src/blog-v3-post.http.d.ts +81 -0
- package/build/cjs/src/blog-v3-post.http.js +844 -0
- package/build/cjs/src/blog-v3-post.http.js.map +1 -0
- package/build/cjs/src/blog-v3-post.public.d.ts +11 -0
- package/build/cjs/src/blog-v3-post.public.js +86 -0
- package/build/cjs/src/blog-v3-post.public.js.map +1 -0
- package/build/cjs/src/blog-v3-post.types.d.ts +2227 -0
- package/build/cjs/src/blog-v3-post.types.js +464 -0
- package/build/cjs/src/blog-v3-post.types.js.map +1 -0
- package/build/cjs/src/blog-v3-post.universal.d.ts +2488 -0
- package/build/cjs/src/blog-v3-post.universal.js +935 -0
- package/build/cjs/src/blog-v3-post.universal.js.map +1 -0
- package/build/cjs/src/blog-v3-tag.http.d.ts +45 -0
- package/build/cjs/src/blog-v3-tag.http.js +385 -0
- package/build/cjs/src/blog-v3-tag.http.js.map +1 -0
- package/build/cjs/src/blog-v3-tag.public.d.ts +10 -0
- package/build/cjs/src/blog-v3-tag.public.js +44 -0
- package/build/cjs/src/blog-v3-tag.public.js.map +1 -0
- package/build/cjs/src/blog-v3-tag.types.d.ts +345 -0
- package/build/cjs/src/blog-v3-tag.types.js +15 -0
- package/build/cjs/src/blog-v3-tag.types.js.map +1 -0
- package/build/cjs/src/blog-v3-tag.universal.d.ts +512 -0
- package/build/cjs/src/blog-v3-tag.universal.js +390 -0
- package/build/cjs/src/blog-v3-tag.universal.js.map +1 -0
- package/build/es/index.d.ts +3 -0
- package/build/es/index.js +4 -0
- package/build/es/index.js.map +1 -0
- package/build/es/src/blog-v3-category.http.d.ts +50 -0
- package/build/es/src/blog-v3-category.http.js +411 -0
- package/build/es/src/blog-v3-category.http.js.map +1 -0
- package/build/es/src/blog-v3-category.public.d.ts +11 -0
- package/build/es/src/blog-v3-category.public.js +38 -0
- package/build/es/src/blog-v3-category.public.js.map +1 -0
- package/build/es/src/blog-v3-category.types.d.ts +391 -0
- package/build/es/src/blog-v3-category.types.js +19 -0
- package/build/es/src/blog-v3-category.types.js.map +1 -0
- package/build/es/src/blog-v3-category.universal.d.ts +582 -0
- package/build/es/src/blog-v3-category.universal.js +431 -0
- package/build/es/src/blog-v3-category.universal.js.map +1 -0
- package/build/es/src/blog-v3-post.http.d.ts +81 -0
- package/build/es/src/blog-v3-post.http.js +834 -0
- package/build/es/src/blog-v3-post.http.js.map +1 -0
- package/build/es/src/blog-v3-post.public.d.ts +11 -0
- package/build/es/src/blog-v3-post.public.js +38 -0
- package/build/es/src/blog-v3-post.public.js.map +1 -0
- package/build/es/src/blog-v3-post.types.d.ts +2227 -0
- package/build/es/src/blog-v3-post.types.js +461 -0
- package/build/es/src/blog-v3-post.types.js.map +1 -0
- package/build/es/src/blog-v3-post.universal.d.ts +2488 -0
- package/build/es/src/blog-v3-post.universal.js +906 -0
- package/build/es/src/blog-v3-post.universal.js.map +1 -0
- package/build/es/src/blog-v3-tag.http.d.ts +45 -0
- package/build/es/src/blog-v3-tag.http.js +376 -0
- package/build/es/src/blog-v3-tag.http.js.map +1 -0
- package/build/es/src/blog-v3-tag.public.d.ts +10 -0
- package/build/es/src/blog-v3-tag.public.js +33 -0
- package/build/es/src/blog-v3-tag.public.js.map +1 -0
- package/build/es/src/blog-v3-tag.types.d.ts +345 -0
- package/build/es/src/blog-v3-tag.types.js +12 -0
- package/build/es/src/blog-v3-tag.types.js.map +1 -0
- package/build/es/src/blog-v3-tag.universal.d.ts +512 -0
- package/build/es/src/blog-v3-tag.universal.js +362 -0
- package/build/es/src/blog-v3-tag.universal.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
export declare const __debug: {
|
|
2
|
+
verboseLogging: {
|
|
3
|
+
on: () => boolean;
|
|
4
|
+
off: () => boolean;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export interface Tag {
|
|
8
|
+
/**
|
|
9
|
+
* Tag ID.
|
|
10
|
+
* @readonly
|
|
11
|
+
*/
|
|
12
|
+
_id?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Tag label.
|
|
15
|
+
*
|
|
16
|
+
*
|
|
17
|
+
* A blog cannot have two tags with the same label.
|
|
18
|
+
*/
|
|
19
|
+
label?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Part of a tag's URL that refers to a specific tag.
|
|
22
|
+
*
|
|
23
|
+
*
|
|
24
|
+
* For example, `'https:/example.com/tags/{my-tag-slug}'`.
|
|
25
|
+
*/
|
|
26
|
+
slug?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Date the tag was created.
|
|
29
|
+
* @readonly
|
|
30
|
+
*/
|
|
31
|
+
_createdDate?: Date;
|
|
32
|
+
/**
|
|
33
|
+
* Date the tag was updated.
|
|
34
|
+
* @readonly
|
|
35
|
+
*/
|
|
36
|
+
_updatedDate?: Date;
|
|
37
|
+
/**
|
|
38
|
+
* Number of posts with this tag, including unpublished draft posts.
|
|
39
|
+
* @readonly
|
|
40
|
+
*/
|
|
41
|
+
postCount?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Tag URL.
|
|
44
|
+
*
|
|
45
|
+
*
|
|
46
|
+
* The `url` directs you to a page that lists every post with the specified tag.
|
|
47
|
+
* @readonly
|
|
48
|
+
*/
|
|
49
|
+
url?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Number of published posts with this tag.
|
|
52
|
+
* @readonly
|
|
53
|
+
*/
|
|
54
|
+
publishedPostCount?: number;
|
|
55
|
+
/**
|
|
56
|
+
* ID of the tag's translations when [Wix Multilingual](https://support.wix.com/en/article/wix-multilingual-translating-your-blog) is installed on a site. All translations of a single tag will share the same `translationId`.
|
|
57
|
+
* @readonly
|
|
58
|
+
*/
|
|
59
|
+
translationId?: string | null;
|
|
60
|
+
/**
|
|
61
|
+
* Tag language.
|
|
62
|
+
*
|
|
63
|
+
*
|
|
64
|
+
* 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
|
|
65
|
+
* @readonly
|
|
66
|
+
*/
|
|
67
|
+
language?: string | null;
|
|
68
|
+
}
|
|
69
|
+
export interface GetOrCreateTagRequest {
|
|
70
|
+
/** Tag name. Unique per blog. */
|
|
71
|
+
label?: string;
|
|
72
|
+
/** Tag language. */
|
|
73
|
+
language?: string;
|
|
74
|
+
/**
|
|
75
|
+
* List of tag fields to be included if entities are present in the response.
|
|
76
|
+
* Base fieldset, which is default, will return all core tag properties.
|
|
77
|
+
* Example: When URL fieldset is selected, returned tag will have a set of base properties and tag url.
|
|
78
|
+
*/
|
|
79
|
+
fieldsets?: Field[];
|
|
80
|
+
}
|
|
81
|
+
export declare enum Field {
|
|
82
|
+
UNKNOWN = "UNKNOWN",
|
|
83
|
+
/** Includes Tag URL when present. */
|
|
84
|
+
URL = "URL"
|
|
85
|
+
}
|
|
86
|
+
export interface GetOrCreateTagResponse {
|
|
87
|
+
/** Tag info. */
|
|
88
|
+
tag?: Tag;
|
|
89
|
+
}
|
|
90
|
+
export interface CreateTagRequest {
|
|
91
|
+
/** Tag label. Unique per blog. */
|
|
92
|
+
label: string;
|
|
93
|
+
/** Tag language. */
|
|
94
|
+
language?: string;
|
|
95
|
+
/** Preferred tag slug. For example, 'tag-slug'. */
|
|
96
|
+
slug?: string | null;
|
|
97
|
+
/**
|
|
98
|
+
* List of tag fields to be included if entities are present in the response.
|
|
99
|
+
* Base fieldset, which is default, will return all core tag properties.
|
|
100
|
+
* Example: When URL fieldset is selected, returned tag will have a set of base properties and tag url.
|
|
101
|
+
*/
|
|
102
|
+
fieldsets?: Field[];
|
|
103
|
+
}
|
|
104
|
+
export interface CreateTagResponse {
|
|
105
|
+
/** Tag info. */
|
|
106
|
+
tag?: Tag;
|
|
107
|
+
}
|
|
108
|
+
export interface UpdateTagRequest {
|
|
109
|
+
/** Tag info. */
|
|
110
|
+
tag?: Tag;
|
|
111
|
+
/** Field mask of fields to update. */
|
|
112
|
+
fieldMask?: string[];
|
|
113
|
+
/**
|
|
114
|
+
* List of tag fields to be included if entities are present in the response.
|
|
115
|
+
* Base fieldset, which is default, will return all core tag properties.
|
|
116
|
+
* Example: When URL fieldset is selected, returned tag will have a set of base properties and tag url.
|
|
117
|
+
*/
|
|
118
|
+
fieldsets?: Field[];
|
|
119
|
+
}
|
|
120
|
+
export interface UpdateTagResponse {
|
|
121
|
+
/** Tag info. */
|
|
122
|
+
tag?: Tag;
|
|
123
|
+
}
|
|
124
|
+
export interface BulkCreateTagsRequest {
|
|
125
|
+
/** Tags to create. */
|
|
126
|
+
tags?: Tag[];
|
|
127
|
+
/** Whether to return the full created tag entities in the response. */
|
|
128
|
+
returnFullEntity?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* List of tag fields to be included if entities are present in the response.
|
|
131
|
+
* Base fieldset, which is default, will return all core tag properties.
|
|
132
|
+
* Example: When URL fieldset is selected, returned tag will have a set of base properties and tag url.
|
|
133
|
+
*/
|
|
134
|
+
fieldsets?: Field[];
|
|
135
|
+
}
|
|
136
|
+
export interface BulkCreateTagsResponse {
|
|
137
|
+
/** Tags created by bulk action. */
|
|
138
|
+
results?: BulkTagResult[];
|
|
139
|
+
/** Bulk action metadata. */
|
|
140
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
141
|
+
}
|
|
142
|
+
export interface BulkTagResult {
|
|
143
|
+
/** Bulk actions metadata for tag. */
|
|
144
|
+
itemMetadata?: ItemMetadata;
|
|
145
|
+
/** Optional created tag. */
|
|
146
|
+
item?: Tag;
|
|
147
|
+
}
|
|
148
|
+
export interface ItemMetadata {
|
|
149
|
+
/** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
|
|
150
|
+
_id?: string | null;
|
|
151
|
+
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
152
|
+
originalIndex?: number;
|
|
153
|
+
/** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
|
|
154
|
+
success?: boolean;
|
|
155
|
+
/** Details about the error in case of failure. */
|
|
156
|
+
error?: ApplicationError;
|
|
157
|
+
}
|
|
158
|
+
export interface ApplicationError {
|
|
159
|
+
code?: string;
|
|
160
|
+
description?: string;
|
|
161
|
+
data?: Record<string, any> | null;
|
|
162
|
+
}
|
|
163
|
+
export interface BulkActionMetadata {
|
|
164
|
+
/** Number of items that were successfully processed. */
|
|
165
|
+
totalSuccesses?: number;
|
|
166
|
+
/** Number of items that couldn't be processed. */
|
|
167
|
+
totalFailures?: number;
|
|
168
|
+
/** Number of failures without details because detailed failure threshold was exceeded. */
|
|
169
|
+
undetailedFailures?: number;
|
|
170
|
+
}
|
|
171
|
+
export interface GetTagByLabelRequest {
|
|
172
|
+
/** Tag label. */
|
|
173
|
+
label: string;
|
|
174
|
+
/** Tag language. */
|
|
175
|
+
language?: string | null;
|
|
176
|
+
/**
|
|
177
|
+
* List of tag fields to be included if entities are present in the response.
|
|
178
|
+
* Base fieldset, which is default, will return all core tag properties.
|
|
179
|
+
* Example: When URL fieldset is selected, returned tag will have a set of base properties and tag url.
|
|
180
|
+
*/
|
|
181
|
+
fieldsets?: Field[];
|
|
182
|
+
}
|
|
183
|
+
export interface GetTagByLabelResponse {
|
|
184
|
+
/** Tag info. */
|
|
185
|
+
tag?: Tag;
|
|
186
|
+
}
|
|
187
|
+
export interface GetTagRequest {
|
|
188
|
+
/** Tag ID. */
|
|
189
|
+
tagId: string;
|
|
190
|
+
/**
|
|
191
|
+
* List of tag fields to be included if entities are present in the response.
|
|
192
|
+
* Base fieldset, which is default, will return all core tag properties.
|
|
193
|
+
* Example: When URL fieldset is selected, returned tag will have a set of base properties and tag url.
|
|
194
|
+
*/
|
|
195
|
+
fieldsets?: Field[];
|
|
196
|
+
}
|
|
197
|
+
export interface GetTagResponse {
|
|
198
|
+
/** Tag info. */
|
|
199
|
+
tag?: Tag;
|
|
200
|
+
}
|
|
201
|
+
export interface GetTagBySlugRequest {
|
|
202
|
+
/** Slug of the tag to retrieve. */
|
|
203
|
+
slug: string;
|
|
204
|
+
/**
|
|
205
|
+
* List of tag fields to be included if entities are present in the response.
|
|
206
|
+
* Base fieldset, which is default, will return all core tag properties.
|
|
207
|
+
* Example: When URL fieldset is selected, returned tag will have a set of base properties and tag url.
|
|
208
|
+
*/
|
|
209
|
+
fieldsets?: Field[];
|
|
210
|
+
}
|
|
211
|
+
export interface GetTagBySlugResponse {
|
|
212
|
+
/** Tag info. */
|
|
213
|
+
tag?: Tag;
|
|
214
|
+
}
|
|
215
|
+
export interface QueryTagsRequest {
|
|
216
|
+
/** Query options. */
|
|
217
|
+
query?: PlatformQuery;
|
|
218
|
+
/**
|
|
219
|
+
* List of tag fields to be included if entities are present in the response.
|
|
220
|
+
* Base fieldset, which is default, will return all core tag properties.
|
|
221
|
+
* Example: When URL fieldset is selected, returned tag will have a set of base properties and tag url.
|
|
222
|
+
*/
|
|
223
|
+
fieldsets?: Field[];
|
|
224
|
+
}
|
|
225
|
+
export interface Sorting {
|
|
226
|
+
/** Name of the field to sort by. */
|
|
227
|
+
fieldName?: string;
|
|
228
|
+
/** Sort order. */
|
|
229
|
+
order?: SortOrder;
|
|
230
|
+
}
|
|
231
|
+
export declare enum SortOrder {
|
|
232
|
+
ASC = "ASC",
|
|
233
|
+
DESC = "DESC"
|
|
234
|
+
}
|
|
235
|
+
export interface Paging {
|
|
236
|
+
/** Number of items to load. */
|
|
237
|
+
limit?: number | null;
|
|
238
|
+
/** Number of items to skip in the current sort order. */
|
|
239
|
+
offset?: number | null;
|
|
240
|
+
}
|
|
241
|
+
export interface TagsFieldSet {
|
|
242
|
+
/** Includes tag URL when TRUE. Defaults to FALSE. */
|
|
243
|
+
includeUrl?: boolean;
|
|
244
|
+
}
|
|
245
|
+
export interface PlatformQuery extends PlatformQueryPagingMethodOneOf {
|
|
246
|
+
/**
|
|
247
|
+
* Filter object in the following format:
|
|
248
|
+
* `"filter" : {
|
|
249
|
+
* "fieldName1": "value1",
|
|
250
|
+
* "fieldName2":{"$operator":"value2"}
|
|
251
|
+
* }`
|
|
252
|
+
* Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
|
253
|
+
*/
|
|
254
|
+
filter?: Record<string, any> | null;
|
|
255
|
+
/**
|
|
256
|
+
* Sort object in the following format:
|
|
257
|
+
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
258
|
+
*/
|
|
259
|
+
sort?: Sorting[];
|
|
260
|
+
/** Paging options to limit and skip the number of items. */
|
|
261
|
+
paging?: Paging;
|
|
262
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
263
|
+
cursorPaging?: CursorPaging;
|
|
264
|
+
}
|
|
265
|
+
/** @oneof */
|
|
266
|
+
export interface PlatformQueryPagingMethodOneOf {
|
|
267
|
+
/** Paging options to limit and skip the number of items. */
|
|
268
|
+
paging?: Paging;
|
|
269
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
|
|
270
|
+
cursorPaging?: CursorPaging;
|
|
271
|
+
}
|
|
272
|
+
export interface CursorPaging {
|
|
273
|
+
/** Number of items to load. */
|
|
274
|
+
limit?: number | null;
|
|
275
|
+
/**
|
|
276
|
+
* Pointer to the next or previous page in the list of results.
|
|
277
|
+
*
|
|
278
|
+
* You can get the relevant cursor token
|
|
279
|
+
* from the `pagingMetadata` object in the previous call's response.
|
|
280
|
+
* Not relevant for the first request.
|
|
281
|
+
*/
|
|
282
|
+
cursor?: string | null;
|
|
283
|
+
}
|
|
284
|
+
export interface QueryTagsResponse {
|
|
285
|
+
/** List of tags. */
|
|
286
|
+
tags?: Tag[];
|
|
287
|
+
/** Details on the paged set of results returned. */
|
|
288
|
+
pagingMetadata?: PagingMetadataV2;
|
|
289
|
+
}
|
|
290
|
+
export interface MetaData {
|
|
291
|
+
/** Number of items returned in this response. */
|
|
292
|
+
count?: number;
|
|
293
|
+
/** Requested offset. */
|
|
294
|
+
offset?: number;
|
|
295
|
+
/** Total number of items that match the query. */
|
|
296
|
+
total?: number;
|
|
297
|
+
/** Pointer to the next or previous page in the list of results. */
|
|
298
|
+
cursor?: string | null;
|
|
299
|
+
}
|
|
300
|
+
export interface PagingMetadataV2 {
|
|
301
|
+
/** Number of items returned in the response. */
|
|
302
|
+
count?: number | null;
|
|
303
|
+
/** Offset that was requested. */
|
|
304
|
+
offset?: number | null;
|
|
305
|
+
/** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
|
|
306
|
+
total?: number | null;
|
|
307
|
+
/** Flag that indicates the server failed to calculate the `total` field. */
|
|
308
|
+
tooManyToCount?: boolean | null;
|
|
309
|
+
/** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
|
|
310
|
+
cursors?: Cursors;
|
|
311
|
+
}
|
|
312
|
+
export interface Cursors {
|
|
313
|
+
/** Cursor pointing to next page in the list of results. */
|
|
314
|
+
next?: string | null;
|
|
315
|
+
/** Cursor pointing to previous page in the list of results. */
|
|
316
|
+
prev?: string | null;
|
|
317
|
+
}
|
|
318
|
+
export interface ListTagsRequest extends ListTagsRequestPagingMethodOneOf {
|
|
319
|
+
/** Sorting options. For a list of sortable fields, see [Field Support for Filtering and Sorting](https://dev.wix.com/api/rest/community/blog/filter-and-sort). */
|
|
320
|
+
sort?: Sorting[];
|
|
321
|
+
/**
|
|
322
|
+
* List of tag fields to be included if entities are present in the response.
|
|
323
|
+
* Base fieldset, which is default, will return all core tag properties.
|
|
324
|
+
* Example: When URL fieldset is selected, returned tag will have a set of base properties and tag url.
|
|
325
|
+
*/
|
|
326
|
+
fieldsets?: Field[];
|
|
327
|
+
/** Paging options to limit and skip the number of items. */
|
|
328
|
+
paging?: Paging;
|
|
329
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `sort`. */
|
|
330
|
+
cursorPaging?: CursorPaging;
|
|
331
|
+
}
|
|
332
|
+
/** @oneof */
|
|
333
|
+
export interface ListTagsRequestPagingMethodOneOf {
|
|
334
|
+
/** Paging options to limit and skip the number of items. */
|
|
335
|
+
paging?: Paging;
|
|
336
|
+
/** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `sort`. */
|
|
337
|
+
cursorPaging?: CursorPaging;
|
|
338
|
+
}
|
|
339
|
+
export interface ListTagsResponse {
|
|
340
|
+
/** List of tags. */
|
|
341
|
+
tags?: Tag[];
|
|
342
|
+
/** Details on the paged set of results returned. */
|
|
343
|
+
metaData?: MetaData;
|
|
344
|
+
}
|
|
345
|
+
export interface DeleteTagRequest {
|
|
346
|
+
/** Tag ID. */
|
|
347
|
+
tagId: string;
|
|
348
|
+
}
|
|
349
|
+
export interface DeleteTagResponse {
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Creates a new tag with the provided label if the tag does not exist.
|
|
353
|
+
* @param label - Tag label. Unique per blog.
|
|
354
|
+
* @public
|
|
355
|
+
* @requiredField label
|
|
356
|
+
*/
|
|
357
|
+
export declare function createTag(label: string, options?: CreateTagOptions): Promise<CreateTagResponse>;
|
|
358
|
+
export interface CreateTagOptions {
|
|
359
|
+
/** Tag language. */
|
|
360
|
+
language?: string;
|
|
361
|
+
/** Preferred tag slug. For example, 'tag-slug'. */
|
|
362
|
+
slug?: string | null;
|
|
363
|
+
/**
|
|
364
|
+
* List of tag fields to be included if entities are present in the response.
|
|
365
|
+
* Base fieldset, which is default, will return all core tag properties.
|
|
366
|
+
* Example: When URL fieldset is selected, returned tag will have a set of base properties and tag url.
|
|
367
|
+
*/
|
|
368
|
+
fieldsets?: Field[];
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Gets a tag by the specified label.
|
|
372
|
+
*
|
|
373
|
+
* The `getTagByLabel()` function returns a Promise that resolves to a tag whose label matches the specified label.
|
|
374
|
+
* @param label - Tag label.
|
|
375
|
+
* @public
|
|
376
|
+
* @requiredField GetTagByLabelRequest
|
|
377
|
+
* @requiredField label
|
|
378
|
+
* @param options - Options specifying which additional fields to return.
|
|
379
|
+
*/
|
|
380
|
+
export declare function getTagByLabel(label: string, options?: GetTagByLabelOptions): Promise<GetTagByLabelResponse>;
|
|
381
|
+
export interface GetTagByLabelOptions {
|
|
382
|
+
/** Tag language. */
|
|
383
|
+
language?: string | null;
|
|
384
|
+
/**
|
|
385
|
+
* List of additional tag fields to be included in the response. By default, any fields not passed are not returned.
|
|
386
|
+
*
|
|
387
|
+
* Supported Values:
|
|
388
|
+
* `"URL"`
|
|
389
|
+
*/
|
|
390
|
+
fieldsets?: Field[];
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Gets a tag by the specified ID.
|
|
394
|
+
*
|
|
395
|
+
*
|
|
396
|
+
* The `getTag()` function returns a Promise that resolves to a tag whose ID matches the specified ID.
|
|
397
|
+
* @param tagId - Tag ID.
|
|
398
|
+
* @public
|
|
399
|
+
* @requiredField tagId
|
|
400
|
+
* @param options - Options specifying which additional fields to return.
|
|
401
|
+
*/
|
|
402
|
+
export declare function getTag(tagId: string, options?: GetTagOptions): Promise<GetTagResponse>;
|
|
403
|
+
export interface GetTagOptions {
|
|
404
|
+
/**
|
|
405
|
+
* List of additional tag fields to be included in the response. By default, any fields not passed are not returned.
|
|
406
|
+
*
|
|
407
|
+
* Supported Values:
|
|
408
|
+
* `"URL"`
|
|
409
|
+
*/
|
|
410
|
+
fieldsets?: Field[];
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Gets a tag by the specified slug.
|
|
414
|
+
*
|
|
415
|
+
*
|
|
416
|
+
* The `getTagBySlug()` function returns a Promise that resolves to a tag whose slug matches the specified slug.
|
|
417
|
+
*
|
|
418
|
+
* The `slug` is the end of a tag's URL that refers to a specific tag. For example, if a tag's URL is `https://example.com/blog/tag/{my-tag-slug}`, the slug is `my-tag-slug`. The slug is case-sensitive and derived from the tag's `label`.
|
|
419
|
+
* @param slug - Slug of the tag to retrieve.
|
|
420
|
+
* @public
|
|
421
|
+
* @requiredField slug
|
|
422
|
+
* @param options - Options specifying which additional fields to return.
|
|
423
|
+
*/
|
|
424
|
+
export declare function getTagBySlug(slug: string, options?: GetTagBySlugOptions): Promise<GetTagBySlugResponse>;
|
|
425
|
+
export interface GetTagBySlugOptions {
|
|
426
|
+
/**
|
|
427
|
+
* List of additional tag fields to be included in the response. By default, any fields not passed are not returned.
|
|
428
|
+
*
|
|
429
|
+
* Supported Values:
|
|
430
|
+
* `"URL"`
|
|
431
|
+
*/
|
|
432
|
+
fieldsets?: Field[];
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Creates a query to retrieve a list of tags.
|
|
436
|
+
*
|
|
437
|
+
*
|
|
438
|
+
* The `queryTags()` function builds a query to retrieve a list of up to 4,000 tags per language, and returns a [`TagsQueryBuilder`](https://www.wix.com/velo/reference/wix-blog-backend/tag/tagsquerybuilder) object.
|
|
439
|
+
*
|
|
440
|
+
* The returned object contains the query definition, which is typically used to run the query using the [`find()`](https://www.wix.com/velo/reference/wix-blog-backend/tag/tagsquerybuilder/find) function.
|
|
441
|
+
*
|
|
442
|
+
* You can refine the query by chaining `TagsQueryBuilder` functions onto the query. `TagsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTags()` returns.
|
|
443
|
+
*
|
|
444
|
+
* `queryTags()` runs with these `TagsQueryBuilder` defaults that can be overridden:
|
|
445
|
+
* - `limit(50)`
|
|
446
|
+
* - `ascending('_id')`
|
|
447
|
+
*
|
|
448
|
+
* The following `TagQueryBuilder` functions are supported for `queryTags()`. For a full description of the Tags object, see the object returned for the [`items`](https://www.wix.com/velo/reference/wix-blog-backend/tag/tagsqueryresult/items) property in [`TagsQueryResult`](https://www.wix.com/velo/reference/wix-blog-backend/post/queryposts).
|
|
449
|
+
* @public */
|
|
450
|
+
export declare function queryTags(): TagsQueryBuilder;
|
|
451
|
+
interface QueryOffsetResult {
|
|
452
|
+
currentPage: number;
|
|
453
|
+
totalPages: number;
|
|
454
|
+
totalCount: number;
|
|
455
|
+
hasNext: () => boolean;
|
|
456
|
+
hasPrev: () => boolean;
|
|
457
|
+
length: number;
|
|
458
|
+
pageSize: number;
|
|
459
|
+
}
|
|
460
|
+
export interface TagsQueryResult extends QueryOffsetResult {
|
|
461
|
+
items: Tag[];
|
|
462
|
+
query: TagsQueryBuilder;
|
|
463
|
+
next: () => Promise<TagsQueryResult>;
|
|
464
|
+
prev: () => Promise<TagsQueryResult>;
|
|
465
|
+
}
|
|
466
|
+
export interface TagsQueryBuilder {
|
|
467
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
468
|
+
* @param value - Value to compare against.
|
|
469
|
+
*/
|
|
470
|
+
eq: (propertyName: string, value: any) => TagsQueryBuilder;
|
|
471
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
472
|
+
* @param value - Value to compare against.
|
|
473
|
+
*/
|
|
474
|
+
ne: (propertyName: string, value: any) => TagsQueryBuilder;
|
|
475
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
476
|
+
* @param value - Value to compare against.
|
|
477
|
+
*/
|
|
478
|
+
ge: (propertyName: string, value: any) => TagsQueryBuilder;
|
|
479
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
480
|
+
* @param value - Value to compare against.
|
|
481
|
+
*/
|
|
482
|
+
gt: (propertyName: string, value: any) => TagsQueryBuilder;
|
|
483
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
484
|
+
* @param value - Value to compare against.
|
|
485
|
+
*/
|
|
486
|
+
le: (propertyName: string, value: any) => TagsQueryBuilder;
|
|
487
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
488
|
+
* @param value - Value to compare against.
|
|
489
|
+
*/
|
|
490
|
+
lt: (propertyName: string, value: any) => TagsQueryBuilder;
|
|
491
|
+
/** @param propertyName - Property whose value is compared with `string`.
|
|
492
|
+
* @param string - String to compare against. Case-insensitive.
|
|
493
|
+
*/
|
|
494
|
+
startsWith: (propertyName: string, value: string) => TagsQueryBuilder;
|
|
495
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
|
|
496
|
+
ascending: (...propertyNames: string[]) => TagsQueryBuilder;
|
|
497
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
|
|
498
|
+
descending: (...propertyNames: string[]) => TagsQueryBuilder;
|
|
499
|
+
/** @param limit - Number of items to return, which is also the `pageSize` of the results object. */
|
|
500
|
+
limit: (limit: number) => TagsQueryBuilder;
|
|
501
|
+
/** @param skip - Number of items to skip in the query results before returning the results. */
|
|
502
|
+
skip: (skip: number) => TagsQueryBuilder;
|
|
503
|
+
find: () => Promise<TagsQueryResult>;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Deletes a tag.
|
|
507
|
+
* @param tagId - Tag ID.
|
|
508
|
+
* @public
|
|
509
|
+
* @requiredField tagId
|
|
510
|
+
*/
|
|
511
|
+
export declare function deleteTag(tagId: string): Promise<void>;
|
|
512
|
+
export {};
|