@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.
Files changed (79) hide show
  1. package/build/cjs/index.d.ts +3 -0
  2. package/build/cjs/index.js +26 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/src/blog-v3-category.http.d.ts +50 -0
  5. package/build/cjs/src/blog-v3-category.http.js +421 -0
  6. package/build/cjs/src/blog-v3-category.http.js.map +1 -0
  7. package/build/cjs/src/blog-v3-category.public.d.ts +11 -0
  8. package/build/cjs/src/blog-v3-category.public.js +50 -0
  9. package/build/cjs/src/blog-v3-category.public.js.map +1 -0
  10. package/build/cjs/src/blog-v3-category.types.d.ts +391 -0
  11. package/build/cjs/src/blog-v3-category.types.js +22 -0
  12. package/build/cjs/src/blog-v3-category.types.js.map +1 -0
  13. package/build/cjs/src/blog-v3-category.universal.d.ts +582 -0
  14. package/build/cjs/src/blog-v3-category.universal.js +460 -0
  15. package/build/cjs/src/blog-v3-category.universal.js.map +1 -0
  16. package/build/cjs/src/blog-v3-post.http.d.ts +81 -0
  17. package/build/cjs/src/blog-v3-post.http.js +844 -0
  18. package/build/cjs/src/blog-v3-post.http.js.map +1 -0
  19. package/build/cjs/src/blog-v3-post.public.d.ts +11 -0
  20. package/build/cjs/src/blog-v3-post.public.js +86 -0
  21. package/build/cjs/src/blog-v3-post.public.js.map +1 -0
  22. package/build/cjs/src/blog-v3-post.types.d.ts +2227 -0
  23. package/build/cjs/src/blog-v3-post.types.js +464 -0
  24. package/build/cjs/src/blog-v3-post.types.js.map +1 -0
  25. package/build/cjs/src/blog-v3-post.universal.d.ts +2488 -0
  26. package/build/cjs/src/blog-v3-post.universal.js +935 -0
  27. package/build/cjs/src/blog-v3-post.universal.js.map +1 -0
  28. package/build/cjs/src/blog-v3-tag.http.d.ts +45 -0
  29. package/build/cjs/src/blog-v3-tag.http.js +385 -0
  30. package/build/cjs/src/blog-v3-tag.http.js.map +1 -0
  31. package/build/cjs/src/blog-v3-tag.public.d.ts +10 -0
  32. package/build/cjs/src/blog-v3-tag.public.js +44 -0
  33. package/build/cjs/src/blog-v3-tag.public.js.map +1 -0
  34. package/build/cjs/src/blog-v3-tag.types.d.ts +345 -0
  35. package/build/cjs/src/blog-v3-tag.types.js +15 -0
  36. package/build/cjs/src/blog-v3-tag.types.js.map +1 -0
  37. package/build/cjs/src/blog-v3-tag.universal.d.ts +512 -0
  38. package/build/cjs/src/blog-v3-tag.universal.js +390 -0
  39. package/build/cjs/src/blog-v3-tag.universal.js.map +1 -0
  40. package/build/es/index.d.ts +3 -0
  41. package/build/es/index.js +4 -0
  42. package/build/es/index.js.map +1 -0
  43. package/build/es/src/blog-v3-category.http.d.ts +50 -0
  44. package/build/es/src/blog-v3-category.http.js +411 -0
  45. package/build/es/src/blog-v3-category.http.js.map +1 -0
  46. package/build/es/src/blog-v3-category.public.d.ts +11 -0
  47. package/build/es/src/blog-v3-category.public.js +38 -0
  48. package/build/es/src/blog-v3-category.public.js.map +1 -0
  49. package/build/es/src/blog-v3-category.types.d.ts +391 -0
  50. package/build/es/src/blog-v3-category.types.js +19 -0
  51. package/build/es/src/blog-v3-category.types.js.map +1 -0
  52. package/build/es/src/blog-v3-category.universal.d.ts +582 -0
  53. package/build/es/src/blog-v3-category.universal.js +431 -0
  54. package/build/es/src/blog-v3-category.universal.js.map +1 -0
  55. package/build/es/src/blog-v3-post.http.d.ts +81 -0
  56. package/build/es/src/blog-v3-post.http.js +834 -0
  57. package/build/es/src/blog-v3-post.http.js.map +1 -0
  58. package/build/es/src/blog-v3-post.public.d.ts +11 -0
  59. package/build/es/src/blog-v3-post.public.js +38 -0
  60. package/build/es/src/blog-v3-post.public.js.map +1 -0
  61. package/build/es/src/blog-v3-post.types.d.ts +2227 -0
  62. package/build/es/src/blog-v3-post.types.js +461 -0
  63. package/build/es/src/blog-v3-post.types.js.map +1 -0
  64. package/build/es/src/blog-v3-post.universal.d.ts +2488 -0
  65. package/build/es/src/blog-v3-post.universal.js +906 -0
  66. package/build/es/src/blog-v3-post.universal.js.map +1 -0
  67. package/build/es/src/blog-v3-tag.http.d.ts +45 -0
  68. package/build/es/src/blog-v3-tag.http.js +376 -0
  69. package/build/es/src/blog-v3-tag.http.js.map +1 -0
  70. package/build/es/src/blog-v3-tag.public.d.ts +10 -0
  71. package/build/es/src/blog-v3-tag.public.js +33 -0
  72. package/build/es/src/blog-v3-tag.public.js.map +1 -0
  73. package/build/es/src/blog-v3-tag.types.d.ts +345 -0
  74. package/build/es/src/blog-v3-tag.types.js +12 -0
  75. package/build/es/src/blog-v3-tag.types.js.map +1 -0
  76. package/build/es/src/blog-v3-tag.universal.d.ts +512 -0
  77. package/build/es/src/blog-v3-tag.universal.js +362 -0
  78. package/build/es/src/blog-v3-tag.universal.js.map +1 -0
  79. package/package.json +37 -0
@@ -0,0 +1,460 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
22
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
+ return new (P || (P = Promise))(function (resolve, reject) {
24
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
27
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
28
+ });
29
+ };
30
+ Object.defineProperty(exports, "__esModule", { value: true });
31
+ exports.deleteCategory = exports.queryCategories = exports.listCategories = exports.getCategoryBySlug = exports.getCategory = exports.updateCategory = exports.createCategory = exports.SortOrder = exports.Field = exports.__debug = void 0;
32
+ const velo_1 = require("@wix/metro-runtime/velo");
33
+ const ambassadorWixBlogV3Category = __importStar(require("./blog-v3-category.http"));
34
+ // @ts-ignore
35
+ const motion_edm_autogen_query_wrapper_1 = require("@wix/motion-edm-autogen-query-wrapper");
36
+ let __verbose = false;
37
+ function __log(...args) {
38
+ __verbose && console.log(...args);
39
+ }
40
+ function __inspect(obj) {
41
+ return obj;
42
+ }
43
+ exports.__debug = {
44
+ verboseLogging: {
45
+ on: () => (__verbose = true),
46
+ off: () => (__verbose = false),
47
+ },
48
+ };
49
+ const _toVeloEntity = '$';
50
+ const _fromVeloEntity = '$';
51
+ var Field;
52
+ (function (Field) {
53
+ Field["UNKNOWN"] = "UNKNOWN";
54
+ /** Includes Category url. */
55
+ Field["URL"] = "URL";
56
+ /**
57
+ * Includes internal id field.
58
+ * Reserved for internal use
59
+ */
60
+ Field["INTERNAL_ID"] = "INTERNAL_ID";
61
+ /** Includes SEO data. */
62
+ Field["SEO"] = "SEO";
63
+ })(Field = exports.Field || (exports.Field = {}));
64
+ var SortOrder;
65
+ (function (SortOrder) {
66
+ SortOrder["ASC"] = "ASC";
67
+ SortOrder["DESC"] = "DESC";
68
+ })(SortOrder = exports.SortOrder || (exports.SortOrder = {}));
69
+ const _category = {
70
+ url: 'wix.common.PageUrl',
71
+ coverImage: 'wix.common.Image',
72
+ coverMedia: '_coverMedia',
73
+ };
74
+ const _coverMedia = { image: 'wix.common.Image', video: 'wix.common.Video' };
75
+ const _createCategoryRequest = { category: '_category' };
76
+ const _createCategoryResponse = { category: '_category' };
77
+ const _deleteCategoryRequest = {};
78
+ const _deleteCategoryResponse = {};
79
+ const _getCategoryBySlugRequest = {};
80
+ const _getCategoryBySlugResponse = { category: '_category' };
81
+ const _getCategoryRequest = {};
82
+ const _getCategoryResponse = { category: '_category' };
83
+ const _listCategoriesRequest = {};
84
+ const _listCategoriesResponse = { categories: '_category' };
85
+ const _queryCategoriesRequest = {};
86
+ const _queryCategoriesResponse = { categories: '_category' };
87
+ const _updateCategoryRequest = { category: '_category' };
88
+ const _updateCategoryResponse = { category: '_category' };
89
+ /**
90
+ * Creates a category.
91
+ * @param category - Category info.
92
+ * @public
93
+ * @requiredField category
94
+ * @requiredField category.label
95
+ */
96
+ function createCategory(category, options) {
97
+ return __awaiter(this, arguments, void 0, function* () {
98
+ const requestTransformation = {
99
+ category: '$[0]',
100
+ fieldsets: '$[1].fieldsets',
101
+ };
102
+ const responseTransformation = '$';
103
+ // @ts-ignore
104
+ const httpClient = arguments[2].httpClient;
105
+ const { toAmbassadorRequest } = velo_1.serializer({
106
+ rootSchema: _createCategoryRequest,
107
+ depSchemas: { _category, _coverMedia },
108
+ fqdnTransformation: {
109
+ paths: [...['category']],
110
+ transformation: _fromVeloEntity,
111
+ },
112
+ customTransformation: requestTransformation,
113
+ });
114
+ const { fromJSON } = velo_1.serializer({
115
+ rootSchema: _createCategoryResponse,
116
+ depSchemas: { _category, _coverMedia },
117
+ fqdnTransformation: {
118
+ paths: [...['category']],
119
+ transformation: _toVeloEntity,
120
+ },
121
+ customTransformation: responseTransformation,
122
+ });
123
+ const payload = toAmbassadorRequest([category, options]);
124
+ const reqOpts = ambassadorWixBlogV3Category.createCategory(payload);
125
+ __log(`"CreateCategory" sending request with: ${__inspect(reqOpts)}`);
126
+ try {
127
+ const { data } = yield httpClient.request(reqOpts);
128
+ return fromJSON(data);
129
+ }
130
+ catch (err) {
131
+ const transformedError = velo_1.transformError(err, requestTransformation, [
132
+ 'category',
133
+ 'options',
134
+ ]);
135
+ throw transformedError;
136
+ }
137
+ });
138
+ }
139
+ exports.createCategory = createCategory;
140
+ /**
141
+ * Updates a category.
142
+ * @param _id - Category ID.
143
+ * @public
144
+ * @requiredField _id
145
+ * @requiredField category
146
+ */
147
+ function updateCategory(_id, category, options) {
148
+ return __awaiter(this, arguments, void 0, function* () {
149
+ const requestTransformation = {
150
+ category: { '*': '$[1]', id: '$[0]' },
151
+ fieldMask: '$[2].fieldMask',
152
+ fieldsets: '$[2].fieldsets',
153
+ };
154
+ const responseTransformation = '$';
155
+ // @ts-ignore
156
+ const httpClient = arguments[3].httpClient;
157
+ const { toAmbassadorRequest } = velo_1.serializer({
158
+ rootSchema: _updateCategoryRequest,
159
+ depSchemas: { _category, _coverMedia },
160
+ fqdnTransformation: {
161
+ paths: [...['category']],
162
+ transformation: _fromVeloEntity,
163
+ },
164
+ customTransformation: requestTransformation,
165
+ });
166
+ const { fromJSON } = velo_1.serializer({
167
+ rootSchema: _updateCategoryResponse,
168
+ depSchemas: { _category, _coverMedia },
169
+ fqdnTransformation: {
170
+ paths: [...['category']],
171
+ transformation: _toVeloEntity,
172
+ },
173
+ customTransformation: responseTransformation,
174
+ });
175
+ const payload = toAmbassadorRequest([_id, category, options]);
176
+ const reqOpts = ambassadorWixBlogV3Category.updateCategory(payload);
177
+ __log(`"UpdateCategory" sending request with: ${__inspect(reqOpts)}`);
178
+ try {
179
+ const { data } = yield httpClient.request(reqOpts);
180
+ return fromJSON(data);
181
+ }
182
+ catch (err) {
183
+ const transformedError = velo_1.transformError(err, requestTransformation, [
184
+ '_id',
185
+ 'category',
186
+ 'options',
187
+ ]);
188
+ throw transformedError;
189
+ }
190
+ });
191
+ }
192
+ exports.updateCategory = updateCategory;
193
+ /**
194
+ * Gets a category by the specified ID.
195
+ *
196
+ *
197
+ * The `getCategory()` function returns a Promise that resolves to a category whose ID matches the specified ID.
198
+ *
199
+ * @param categoryId - Category ID.
200
+ * @public
201
+ * @requiredField categoryId
202
+ * @param options - Options specifying which fields to return.
203
+ */
204
+ function getCategory(categoryId, options) {
205
+ return __awaiter(this, arguments, void 0, function* () {
206
+ const requestTransformation = {
207
+ categoryId: '$[0]',
208
+ fieldsets: '$[1].fieldsets',
209
+ };
210
+ const responseTransformation = '$';
211
+ // @ts-ignore
212
+ const httpClient = arguments[2].httpClient;
213
+ const { toAmbassadorRequest } = velo_1.serializer({
214
+ rootSchema: _getCategoryRequest,
215
+ depSchemas: {},
216
+ fqdnTransformation: {
217
+ paths: [],
218
+ transformation: _fromVeloEntity,
219
+ },
220
+ customTransformation: requestTransformation,
221
+ });
222
+ const { fromJSON } = velo_1.serializer({
223
+ rootSchema: _getCategoryResponse,
224
+ depSchemas: { _category, _coverMedia },
225
+ fqdnTransformation: {
226
+ paths: [...['category']],
227
+ transformation: _toVeloEntity,
228
+ },
229
+ customTransformation: responseTransformation,
230
+ });
231
+ const payload = toAmbassadorRequest([categoryId, options]);
232
+ const reqOpts = ambassadorWixBlogV3Category.getCategory(payload);
233
+ __log(`"GetCategory" sending request with: ${__inspect(reqOpts)}`);
234
+ try {
235
+ const { data } = yield httpClient.request(reqOpts);
236
+ return fromJSON(data);
237
+ }
238
+ catch (err) {
239
+ const transformedError = velo_1.transformError(err, requestTransformation, [
240
+ 'categoryId',
241
+ 'options',
242
+ ]);
243
+ throw transformedError;
244
+ }
245
+ });
246
+ }
247
+ exports.getCategory = getCategory;
248
+ /**
249
+ * Gets a category by the specified slug.
250
+ *
251
+ *
252
+ * The `getCategoryBySlug()` function returns a Promise that resolves to a category whose slug matches the specified slug.
253
+ *
254
+ * The `slug` is the end of a category's URL that refers to a specific category. For example, if a category's URL is `https://example.com/blog/category/{my-category-slug}`, the slug is `my-post-slug`. The slug is case-sensitive string that is generally derived from the category's `label`, unless specified otherwise.
255
+ *
256
+ * @public
257
+ * @requiredField GetCategoryBySlugRequest
258
+ * @requiredField slug
259
+ * @param slug - Slug of the category to retrieve.
260
+ *
261
+ * The end of a category's URL. For example, `'https:/example.com/blog/category/{my-category-slug}'`. Case sensitive and generally based on the category `label` if not specified.
262
+ * @param options - Options specifying which fields to return.
263
+ */
264
+ function getCategoryBySlug(slug, options) {
265
+ return __awaiter(this, arguments, void 0, function* () {
266
+ const requestTransformation = { slug: '$[0]', fieldsets: '$[1].fieldsets' };
267
+ const responseTransformation = '$';
268
+ // @ts-ignore
269
+ const httpClient = arguments[2].httpClient;
270
+ const { toAmbassadorRequest } = velo_1.serializer({
271
+ rootSchema: _getCategoryBySlugRequest,
272
+ depSchemas: {},
273
+ fqdnTransformation: {
274
+ paths: [],
275
+ transformation: _fromVeloEntity,
276
+ },
277
+ customTransformation: requestTransformation,
278
+ });
279
+ const { fromJSON } = velo_1.serializer({
280
+ rootSchema: _getCategoryBySlugResponse,
281
+ depSchemas: { _category, _coverMedia },
282
+ fqdnTransformation: {
283
+ paths: [...['category']],
284
+ transformation: _toVeloEntity,
285
+ },
286
+ customTransformation: responseTransformation,
287
+ });
288
+ const payload = toAmbassadorRequest([slug, options]);
289
+ const reqOpts = ambassadorWixBlogV3Category.getCategoryBySlug(payload);
290
+ __log(`"GetCategoryBySlug" sending request with: ${__inspect(reqOpts)}`);
291
+ try {
292
+ const { data } = yield httpClient.request(reqOpts);
293
+ return fromJSON(data);
294
+ }
295
+ catch (err) {
296
+ const transformedError = velo_1.transformError(err, requestTransformation, [
297
+ 'slug',
298
+ 'options',
299
+ ]);
300
+ throw transformedError;
301
+ }
302
+ });
303
+ }
304
+ exports.getCategoryBySlug = getCategoryBySlug;
305
+ /**
306
+ * Retrieves a list of categories.
307
+ *
308
+ *
309
+ * The `listCategories()` function returns a Promise that resolves to a list of up to 100 categories per language in order of their `displayPosition` starting with `0`. The `displayPosition` is the position in which the categories are displayed in the Category Menu page. By default, categories get added to the bottom of the Category Menu with a `displayPosition` of `-1`.
310
+ * @public
311
+ * @param options - Filter and paging options.
312
+ */
313
+ function listCategories(options) {
314
+ return __awaiter(this, arguments, void 0, function* () {
315
+ const requestTransformation = {
316
+ paging: '$[0].paging',
317
+ fieldsets: '$[0].fieldsets',
318
+ };
319
+ const responseTransformation = '$';
320
+ // @ts-ignore
321
+ const httpClient = arguments[1].httpClient;
322
+ const { toAmbassadorRequest } = velo_1.serializer({
323
+ rootSchema: _listCategoriesRequest,
324
+ depSchemas: {},
325
+ fqdnTransformation: {
326
+ paths: [],
327
+ transformation: _fromVeloEntity,
328
+ },
329
+ customTransformation: requestTransformation,
330
+ });
331
+ const { fromJSON } = velo_1.serializer({
332
+ rootSchema: _listCategoriesResponse,
333
+ depSchemas: { _category, _coverMedia },
334
+ fqdnTransformation: {
335
+ paths: [...['Array#categories']],
336
+ transformation: _toVeloEntity,
337
+ },
338
+ customTransformation: responseTransformation,
339
+ });
340
+ const payload = toAmbassadorRequest([options]);
341
+ const reqOpts = ambassadorWixBlogV3Category.listCategories(payload);
342
+ __log(`"ListCategories" sending request with: ${__inspect(reqOpts)}`);
343
+ try {
344
+ const { data } = yield httpClient.request(reqOpts);
345
+ return fromJSON(data);
346
+ }
347
+ catch (err) {
348
+ const transformedError = velo_1.transformError(err, requestTransformation, [
349
+ 'options',
350
+ ]);
351
+ throw transformedError;
352
+ }
353
+ });
354
+ }
355
+ exports.listCategories = listCategories;
356
+ /**
357
+ * Creates a query to retrieve a list of categories.
358
+ *
359
+ *
360
+ * The `queryCategories()` function builds a query to retrieve a list of up to 100 categories per language, and returns a [`CategoriesQueryBuilder`](https://www.wix.com/velo/reference/wix-blog-backend/category/categoriesquerybuilder) object.
361
+ *
362
+ * 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/category/categoriesquerybuilder/find) function.
363
+ *
364
+ * You can refine the query by chaining `CategoriesQueryBuilder` functions to the query. `CategoriesQueryBuilder` functions enable you to sort, filter, and control the results that `queryCategories` returns. Any functions chained to the `queryCategories()` function are applied in the order that they are called.
365
+ *
366
+ * `queryCategories()` runs with these `CategoriesQueryBuilder` defaults, which you can override.
367
+ * - [`limit(100)`](https://www.wix.com/velo/reference/wix-blog-backend/category/categoriesquerybuilder/limit)
368
+ * - [`ascending(displayPosition)`](https://www.wix.com/velo/reference/wix-blog-backend/category/categoriesquerybuilder/ascending)
369
+ *
370
+ * The following `CategoriesQueryBuilder` functions are supported for `queryCategories()`. For a full description of the `Categories` object, see the object returned for the [`items`](https://www.wix.com/velo/reference/wix-blog-backend/category/categoriesqueryresult/items) property in [`CategoriesQueryResult`](https://www.wix.com/velo/reference/wix-blog-backend/category/categoriesqueryresult).
371
+ * @public */
372
+ function queryCategories() {
373
+ const requestTransformation = { '*': '$[1]', query: '$[0]' };
374
+ const responseTransformation = {
375
+ items: '$.categories',
376
+ pagingMetadata: '$.pagingMetadata',
377
+ };
378
+ // @ts-ignore
379
+ const httpClient = arguments[0].httpClient;
380
+ const { toAmbassadorRequest } = velo_1.serializer({
381
+ rootSchema: _queryCategoriesRequest,
382
+ depSchemas: {},
383
+ fqdnTransformation: {
384
+ paths: [],
385
+ transformation: _fromVeloEntity,
386
+ },
387
+ customTransformation: requestTransformation,
388
+ });
389
+ const { fromJSON } = velo_1.serializer({
390
+ rootSchema: _queryCategoriesResponse,
391
+ depSchemas: { _category, _coverMedia },
392
+ fqdnTransformation: {
393
+ paths: [...['Array#categories']],
394
+ transformation: _toVeloEntity,
395
+ },
396
+ customTransformation: responseTransformation,
397
+ });
398
+ return motion_edm_autogen_query_wrapper_1.wrapWithQueryBuilder({
399
+ func: (payload) => {
400
+ const reqOpts = ambassadorWixBlogV3Category.queryCategories(payload);
401
+ return httpClient.request(reqOpts);
402
+ },
403
+ requestTransformer: (...args) => toAmbassadorRequest(args),
404
+ responseTransformer: ({ data }) => fromJSON(data),
405
+ errorTransformer: (err) => {
406
+ const transformedError = velo_1.transformError(err, requestTransformation);
407
+ throw transformedError;
408
+ },
409
+ pagingMethod: 'OFFSET',
410
+ transformationPaths: velo_1.resolveQueryFieldsTransformationPaths(_toVeloEntity),
411
+ })({ cursorWithEmptyFilterAndSort: true });
412
+ }
413
+ exports.queryCategories = queryCategories;
414
+ /**
415
+ * Deletes a category.
416
+ * @param categoryId - Category ID.
417
+ * @public
418
+ * @requiredField categoryId
419
+ */
420
+ function deleteCategory(categoryId) {
421
+ return __awaiter(this, arguments, void 0, function* () {
422
+ const requestTransformation = { categoryId: '$[0]' };
423
+ const responseTransformation = '$';
424
+ // @ts-ignore
425
+ const httpClient = arguments[1].httpClient;
426
+ const { toAmbassadorRequest } = velo_1.serializer({
427
+ rootSchema: _deleteCategoryRequest,
428
+ depSchemas: {},
429
+ fqdnTransformation: {
430
+ paths: [],
431
+ transformation: _fromVeloEntity,
432
+ },
433
+ customTransformation: requestTransformation,
434
+ });
435
+ const { fromJSON } = velo_1.serializer({
436
+ rootSchema: _deleteCategoryResponse,
437
+ depSchemas: {},
438
+ fqdnTransformation: {
439
+ paths: [],
440
+ transformation: _toVeloEntity,
441
+ },
442
+ customTransformation: responseTransformation,
443
+ });
444
+ const payload = toAmbassadorRequest([categoryId]);
445
+ const reqOpts = ambassadorWixBlogV3Category.deleteCategory(payload);
446
+ __log(`"DeleteCategory" sending request with: ${__inspect(reqOpts)}`);
447
+ try {
448
+ const { data } = yield httpClient.request(reqOpts);
449
+ return fromJSON(data);
450
+ }
451
+ catch (err) {
452
+ const transformedError = velo_1.transformError(err, requestTransformation, [
453
+ 'categoryId',
454
+ ]);
455
+ throw transformedError;
456
+ }
457
+ });
458
+ }
459
+ exports.deleteCategory = deleteCategory;
460
+ //# sourceMappingURL=blog-v3-category.universal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blog-v3-category.universal.js","sourceRoot":"","sources":["../../../src/blog-v3-category.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAIiC;AAEjC,qFAAuE;AACvE,aAAa;AACb,4FAA6E;AAE7E,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IA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,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAEnD,OAAO,QAAQ,CAAC,IAAI,CAAQ,CAAC;SAC9B;QAAC,OAAO,GAAQ,EAAE;YACjB,MAAM,gBAAgB,GAAG,qBAAc,CAAC,GAAG,EAAE,qBAAqB,EAAE;gBAClE,YAAY;aACb,CAAC,CAAC;YAEH,MAAM,gBAAgB,CAAC;SACxB;IACH,CAAC;CAAA;AA5CD,wCA4CC"}
@@ -0,0 +1,81 @@
1
+ import { RequestOptionsFactory } from '@wix/sdk-types';
2
+ import { GetTotalPostsRequest, GetTotalPostsResponse, QueryPostCountStatsRequest, QueryPostCountStatsResponse, GetPostBySlugRequest, GetPostBySlugResponse, GetPostMetricsRequest, GetPostMetricsResponse, GetPostRequest, GetPostResponse, ListPostsRequest, ListPostsResponse, QueryPostsRequest, QueryPostsResponse } from './blog-v3-post.types';
3
+ /**
4
+ * Gets a post by the specified ID.
5
+ *
6
+ *
7
+ * The `getPost()` function returns a Promise that resolves to a post whose ID matches the given ID.
8
+ *
9
+ */
10
+ export declare function getPost(payload: GetPostRequest): RequestOptionsFactory<GetPostResponse>;
11
+ /**
12
+ * Gets a post by the provided slug.
13
+ *
14
+ *
15
+ * The `getPostBySlug()` function returns a Promise that resolves to a post whose slug matches the given slug.
16
+ *
17
+ * The `slug` is the end of a post's URL that refers to a specific post. For example, if a post's URL is `https:/example.com/blog/post/my-post-slug`, the slug is `my-post-slug`. The slug is case-sensitive, and is generally derived from the post title, unless specified otherwise.
18
+ */
19
+ export declare function getPostBySlug(payload: GetPostBySlugRequest): RequestOptionsFactory<GetPostBySlugResponse>;
20
+ /**
21
+ * Retrieves a list of published posts.
22
+ *
23
+ *
24
+ * The `listPosts()` function returns a Promise that resolves to a list of up to 100 published posts.
25
+ *
26
+ * Using the `options` parameter, you can filter your list of posts, set the amount of posts to be returned, and sort your list in a specified order.
27
+ *
28
+ * By default, the list is sorted by `firstPublishedDate` in descending order, and the amount of posts returned is 50.
29
+ */
30
+ export declare function listPosts(payload: ListPostsRequest): RequestOptionsFactory<ListPostsResponse>;
31
+ /**
32
+ * Creates a query to retrieve a list of posts.
33
+ *
34
+ *
35
+ * The `queryPosts()` function builds a query to retrieve a list of up to 100 posts, and returns a [`PostsQueryBuilder`](https://www.wix.com/velo/reference/wix-blog-backend/post/postsquerybuilder) object.
36
+ *
37
+ * 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/post/postsquerybuilder/find) function.
38
+ *
39
+ * You can refine the query by chaining `PostsQueryBuilder` functions onto the query. `PostsQueryBuilder` functions enable you to sort, filter, and control the results that `queryPosts()` returns.
40
+ *
41
+ * `queryPosts()` runs with these `PostsQueryBuilder` defaults that can be overridden:
42
+ * + `limit(50)`
43
+ * + `descending('firstPublishedDate')`
44
+ *
45
+ * Note that the default limit is `'50'`, but the max limit is `'100'`.
46
+ *
47
+ * To learn how to query posts, refer to the table below.
48
+ *
49
+ * The following `PostsQueryBuilder` functions are supported for the `queryPosts()` function. For a full description of the Posts object, see the object returned for the `items` property in `PostsQueryResult`.
50
+ */
51
+ export declare function queryPosts(payload: QueryPostsRequest): RequestOptionsFactory<QueryPostsResponse>;
52
+ /**
53
+ * Gets a specified post's metrics.
54
+ *
55
+ *
56
+ * The `getPostMetrics()` function returns a Promise that resolves to the specified post's metrics.
57
+ *
58
+ * A post's metrics include the comments, likes, and views the post receives.
59
+ */
60
+ export declare function getPostMetrics(payload: GetPostMetricsRequest): RequestOptionsFactory<GetPostMetricsResponse>;
61
+ /**
62
+ * Retrieves the number of published posts per month within a specified time range.
63
+ *
64
+ *
65
+ * The `queryPostCountStats()` function returns a Promise that resolves to the number of posts per month within the specified time range.
66
+ *
67
+ * You can set the time range using the `rangeStart` and `months` properties. The time range always starts on the 1st of the month set in `rangeStart`. It includes the number of `months` following `rangeStart`. For example, if `rangeStart` is set to `'2022-03-13'` and `months` is set to `4`, the time range will be from `'2022-03-01'` until `'2022-06-30'`. Notice that the time range ends on the last of the month.
68
+ *
69
+ * >**Note:** If there are no published posts in a specific month, that month is not included in the response. For example, let's say a blog has `0` posts dated in February 2022. `months` and `rangeStart` are set to `3` and `'2022-01-01'` respectively. Your result will only include the `postCount` from January and March.
70
+ */
71
+ export declare function queryPostCountStats(payload: QueryPostCountStatsRequest): RequestOptionsFactory<QueryPostCountStatsResponse>;
72
+ /**
73
+ * Gets the total amount of published posts on the blog.
74
+ *
75
+ *
76
+ * The `getTotalPosts()` function returns a Promise that resolves to the total amount of published posts on your blog's site.
77
+ *
78
+ *
79
+ * You can use the `language` option to filter posts for a specified language.
80
+ */
81
+ export declare function getTotalPosts(payload: GetTotalPostsRequest): RequestOptionsFactory<GetTotalPostsResponse>;