@wix/blog 1.0.238 → 1.0.239

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 (169) hide show
  1. package/build/cjs/context.d.ts +4 -4
  2. package/build/cjs/context.js +4 -4
  3. package/build/cjs/context.js.map +1 -1
  4. package/build/cjs/index.d.ts +4 -4
  5. package/build/cjs/index.js +4 -4
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +4 -4
  8. package/build/cjs/meta.js +4 -4
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/context.d.ts +4 -4
  11. package/build/es/context.js +4 -4
  12. package/build/es/context.js.map +1 -1
  13. package/build/es/index.d.ts +4 -4
  14. package/build/es/index.js +4 -4
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +4 -4
  17. package/build/es/meta.js +4 -4
  18. package/build/es/meta.js.map +1 -1
  19. package/package.json +14 -9
  20. package/build/cjs/index.typings.d.ts +0 -4
  21. package/build/cjs/index.typings.js +0 -31
  22. package/build/cjs/index.typings.js.map +0 -1
  23. package/build/cjs/src/blog-v3-category.context.d.ts +0 -6
  24. package/build/cjs/src/blog-v3-category.context.js +0 -53
  25. package/build/cjs/src/blog-v3-category.context.js.map +0 -1
  26. package/build/cjs/src/blog-v3-category.http.d.ts +0 -43
  27. package/build/cjs/src/blog-v3-category.http.js +0 -355
  28. package/build/cjs/src/blog-v3-category.http.js.map +0 -1
  29. package/build/cjs/src/blog-v3-category.meta.d.ts +0 -20
  30. package/build/cjs/src/blog-v3-category.meta.js +0 -104
  31. package/build/cjs/src/blog-v3-category.meta.js.map +0 -1
  32. package/build/cjs/src/blog-v3-category.public.d.ts +0 -43
  33. package/build/cjs/src/blog-v3-category.public.js +0 -37
  34. package/build/cjs/src/blog-v3-category.public.js.map +0 -1
  35. package/build/cjs/src/blog-v3-category.types.d.ts +0 -910
  36. package/build/cjs/src/blog-v3-category.types.js +0 -24
  37. package/build/cjs/src/blog-v3-category.types.js.map +0 -1
  38. package/build/cjs/src/blog-v3-category.universal.d.ts +0 -956
  39. package/build/cjs/src/blog-v3-category.universal.js +0 -383
  40. package/build/cjs/src/blog-v3-category.universal.js.map +0 -1
  41. package/build/cjs/src/blog-v3-draft.context.d.ts +0 -16
  42. package/build/cjs/src/blog-v3-draft.context.js +0 -173
  43. package/build/cjs/src/blog-v3-draft.context.js.map +0 -1
  44. package/build/cjs/src/blog-v3-draft.http.d.ts +0 -79
  45. package/build/cjs/src/blog-v3-draft.http.js +0 -1498
  46. package/build/cjs/src/blog-v3-draft.http.js.map +0 -1
  47. package/build/cjs/src/blog-v3-draft.meta.d.ts +0 -40
  48. package/build/cjs/src/blog-v3-draft.meta.js +0 -294
  49. package/build/cjs/src/blog-v3-draft.meta.js.map +0 -1
  50. package/build/cjs/src/blog-v3-draft.public.d.ts +0 -22
  51. package/build/cjs/src/blog-v3-draft.public.js +0 -133
  52. package/build/cjs/src/blog-v3-draft.public.js.map +0 -1
  53. package/build/cjs/src/blog-v3-draft.types.d.ts +0 -9171
  54. package/build/cjs/src/blog-v3-draft.types.js +0 -456
  55. package/build/cjs/src/blog-v3-draft.types.js.map +0 -1
  56. package/build/cjs/src/blog-v3-draft.universal.d.ts +0 -8816
  57. package/build/cjs/src/blog-v3-draft.universal.js +0 -1585
  58. package/build/cjs/src/blog-v3-draft.universal.js.map +0 -1
  59. package/build/cjs/src/blog-v3-post.context.d.ts +0 -9
  60. package/build/cjs/src/blog-v3-post.context.js +0 -89
  61. package/build/cjs/src/blog-v3-post.context.js.map +0 -1
  62. package/build/cjs/src/blog-v3-post.http.d.ts +0 -80
  63. package/build/cjs/src/blog-v3-post.http.js +0 -893
  64. package/build/cjs/src/blog-v3-post.http.js.map +0 -1
  65. package/build/cjs/src/blog-v3-post.meta.d.ts +0 -25
  66. package/build/cjs/src/blog-v3-post.meta.js +0 -161
  67. package/build/cjs/src/blog-v3-post.meta.js.map +0 -1
  68. package/build/cjs/src/blog-v3-post.public.d.ts +0 -548
  69. package/build/cjs/src/blog-v3-post.public.js +0 -94
  70. package/build/cjs/src/blog-v3-post.public.js.map +0 -1
  71. package/build/cjs/src/blog-v3-post.types.d.ts +0 -5238
  72. package/build/cjs/src/blog-v3-post.types.js +0 -478
  73. package/build/cjs/src/blog-v3-post.types.js.map +0 -1
  74. package/build/cjs/src/blog-v3-post.universal.d.ts +0 -5216
  75. package/build/cjs/src/blog-v3-post.universal.js +0 -1112
  76. package/build/cjs/src/blog-v3-post.universal.js.map +0 -1
  77. package/build/cjs/src/blog-v3-tag.context.d.ts +0 -6
  78. package/build/cjs/src/blog-v3-tag.context.js +0 -53
  79. package/build/cjs/src/blog-v3-tag.context.js.map +0 -1
  80. package/build/cjs/src/blog-v3-tag.http.d.ts +0 -40
  81. package/build/cjs/src/blog-v3-tag.http.js +0 -348
  82. package/build/cjs/src/blog-v3-tag.http.js.map +0 -1
  83. package/build/cjs/src/blog-v3-tag.meta.d.ts +0 -22
  84. package/build/cjs/src/blog-v3-tag.meta.js +0 -104
  85. package/build/cjs/src/blog-v3-tag.meta.js.map +0 -1
  86. package/build/cjs/src/blog-v3-tag.public.d.ts +0 -20
  87. package/build/cjs/src/blog-v3-tag.public.js +0 -37
  88. package/build/cjs/src/blog-v3-tag.public.js.map +0 -1
  89. package/build/cjs/src/blog-v3-tag.types.d.ts +0 -675
  90. package/build/cjs/src/blog-v3-tag.types.js +0 -17
  91. package/build/cjs/src/blog-v3-tag.types.js.map +0 -1
  92. package/build/cjs/src/blog-v3-tag.universal.d.ts +0 -819
  93. package/build/cjs/src/blog-v3-tag.universal.js +0 -364
  94. package/build/cjs/src/blog-v3-tag.universal.js.map +0 -1
  95. package/build/es/index.typings.d.ts +0 -4
  96. package/build/es/index.typings.js +0 -5
  97. package/build/es/index.typings.js.map +0 -1
  98. package/build/es/src/blog-v3-category.context.d.ts +0 -6
  99. package/build/es/src/blog-v3-category.context.js +0 -46
  100. package/build/es/src/blog-v3-category.context.js.map +0 -1
  101. package/build/es/src/blog-v3-category.http.d.ts +0 -43
  102. package/build/es/src/blog-v3-category.http.js +0 -348
  103. package/build/es/src/blog-v3-category.http.js.map +0 -1
  104. package/build/es/src/blog-v3-category.meta.d.ts +0 -20
  105. package/build/es/src/blog-v3-category.meta.js +0 -74
  106. package/build/es/src/blog-v3-category.meta.js.map +0 -1
  107. package/build/es/src/blog-v3-category.public.d.ts +0 -43
  108. package/build/es/src/blog-v3-category.public.js +0 -25
  109. package/build/es/src/blog-v3-category.public.js.map +0 -1
  110. package/build/es/src/blog-v3-category.types.d.ts +0 -910
  111. package/build/es/src/blog-v3-category.types.js +0 -21
  112. package/build/es/src/blog-v3-category.types.js.map +0 -1
  113. package/build/es/src/blog-v3-category.universal.d.ts +0 -956
  114. package/build/es/src/blog-v3-category.universal.js +0 -353
  115. package/build/es/src/blog-v3-category.universal.js.map +0 -1
  116. package/build/es/src/blog-v3-draft.context.d.ts +0 -16
  117. package/build/es/src/blog-v3-draft.context.js +0 -156
  118. package/build/es/src/blog-v3-draft.context.js.map +0 -1
  119. package/build/es/src/blog-v3-draft.http.d.ts +0 -79
  120. package/build/es/src/blog-v3-draft.http.js +0 -1481
  121. package/build/es/src/blog-v3-draft.http.js.map +0 -1
  122. package/build/es/src/blog-v3-draft.meta.d.ts +0 -40
  123. package/build/es/src/blog-v3-draft.meta.js +0 -254
  124. package/build/es/src/blog-v3-draft.meta.js.map +0 -1
  125. package/build/es/src/blog-v3-draft.public.d.ts +0 -22
  126. package/build/es/src/blog-v3-draft.public.js +0 -75
  127. package/build/es/src/blog-v3-draft.public.js.map +0 -1
  128. package/build/es/src/blog-v3-draft.types.d.ts +0 -9171
  129. package/build/es/src/blog-v3-draft.types.js +0 -453
  130. package/build/es/src/blog-v3-draft.types.js.map +0 -1
  131. package/build/es/src/blog-v3-draft.universal.d.ts +0 -8816
  132. package/build/es/src/blog-v3-draft.universal.js +0 -1544
  133. package/build/es/src/blog-v3-draft.universal.js.map +0 -1
  134. package/build/es/src/blog-v3-post.context.d.ts +0 -9
  135. package/build/es/src/blog-v3-post.context.js +0 -79
  136. package/build/es/src/blog-v3-post.context.js.map +0 -1
  137. package/build/es/src/blog-v3-post.http.d.ts +0 -80
  138. package/build/es/src/blog-v3-post.http.js +0 -883
  139. package/build/es/src/blog-v3-post.http.js.map +0 -1
  140. package/build/es/src/blog-v3-post.meta.d.ts +0 -25
  141. package/build/es/src/blog-v3-post.meta.js +0 -128
  142. package/build/es/src/blog-v3-post.meta.js.map +0 -1
  143. package/build/es/src/blog-v3-post.public.d.ts +0 -548
  144. package/build/es/src/blog-v3-post.public.js +0 -40
  145. package/build/es/src/blog-v3-post.public.js.map +0 -1
  146. package/build/es/src/blog-v3-post.types.d.ts +0 -5238
  147. package/build/es/src/blog-v3-post.types.js +0 -475
  148. package/build/es/src/blog-v3-post.types.js.map +0 -1
  149. package/build/es/src/blog-v3-post.universal.d.ts +0 -5216
  150. package/build/es/src/blog-v3-post.universal.js +0 -1079
  151. package/build/es/src/blog-v3-post.universal.js.map +0 -1
  152. package/build/es/src/blog-v3-tag.context.d.ts +0 -6
  153. package/build/es/src/blog-v3-tag.context.js +0 -46
  154. package/build/es/src/blog-v3-tag.context.js.map +0 -1
  155. package/build/es/src/blog-v3-tag.http.d.ts +0 -40
  156. package/build/es/src/blog-v3-tag.http.js +0 -341
  157. package/build/es/src/blog-v3-tag.http.js.map +0 -1
  158. package/build/es/src/blog-v3-tag.meta.d.ts +0 -22
  159. package/build/es/src/blog-v3-tag.meta.js +0 -74
  160. package/build/es/src/blog-v3-tag.meta.js.map +0 -1
  161. package/build/es/src/blog-v3-tag.public.d.ts +0 -20
  162. package/build/es/src/blog-v3-tag.public.js +0 -25
  163. package/build/es/src/blog-v3-tag.public.js.map +0 -1
  164. package/build/es/src/blog-v3-tag.types.d.ts +0 -675
  165. package/build/es/src/blog-v3-tag.types.js +0 -14
  166. package/build/es/src/blog-v3-tag.types.js.map +0 -1
  167. package/build/es/src/blog-v3-tag.universal.d.ts +0 -819
  168. package/build/es/src/blog-v3-tag.universal.js +0 -334
  169. package/build/es/src/blog-v3-tag.universal.js.map +0 -1
@@ -1,1079 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { serializer, transformError, resolveQueryFieldsTransformationPaths, } from '@wix/metro-runtime/velo';
11
- import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
12
- import { EventDefinition } from '@wix/sdk-types';
13
- import * as ambassadorWixBlogV3Post from './blog-v3-post.http';
14
- // @ts-ignore
15
- import { wrapWithQueryBuilder } from '@wix/motion-edm-autogen-query-wrapper';
16
- const _toVeloEntity = '$';
17
- const _fromVeloEntity = '$';
18
- export var NodeType;
19
- (function (NodeType) {
20
- NodeType["PARAGRAPH"] = "PARAGRAPH";
21
- NodeType["TEXT"] = "TEXT";
22
- NodeType["HEADING"] = "HEADING";
23
- NodeType["BULLETED_LIST"] = "BULLETED_LIST";
24
- NodeType["ORDERED_LIST"] = "ORDERED_LIST";
25
- NodeType["LIST_ITEM"] = "LIST_ITEM";
26
- NodeType["BLOCKQUOTE"] = "BLOCKQUOTE";
27
- NodeType["CODE_BLOCK"] = "CODE_BLOCK";
28
- NodeType["VIDEO"] = "VIDEO";
29
- NodeType["DIVIDER"] = "DIVIDER";
30
- NodeType["FILE"] = "FILE";
31
- NodeType["GALLERY"] = "GALLERY";
32
- NodeType["GIF"] = "GIF";
33
- NodeType["HTML"] = "HTML";
34
- NodeType["IMAGE"] = "IMAGE";
35
- NodeType["LINK_PREVIEW"] = "LINK_PREVIEW";
36
- NodeType["MAP"] = "MAP";
37
- NodeType["POLL"] = "POLL";
38
- NodeType["APP_EMBED"] = "APP_EMBED";
39
- NodeType["BUTTON"] = "BUTTON";
40
- NodeType["COLLAPSIBLE_LIST"] = "COLLAPSIBLE_LIST";
41
- NodeType["TABLE"] = "TABLE";
42
- NodeType["EMBED"] = "EMBED";
43
- NodeType["COLLAPSIBLE_ITEM"] = "COLLAPSIBLE_ITEM";
44
- NodeType["COLLAPSIBLE_ITEM_TITLE"] = "COLLAPSIBLE_ITEM_TITLE";
45
- NodeType["COLLAPSIBLE_ITEM_BODY"] = "COLLAPSIBLE_ITEM_BODY";
46
- NodeType["TABLE_CELL"] = "TABLE_CELL";
47
- NodeType["TABLE_ROW"] = "TABLE_ROW";
48
- NodeType["EXTERNAL"] = "EXTERNAL";
49
- NodeType["AUDIO"] = "AUDIO";
50
- })(NodeType || (NodeType = {}));
51
- export var WidthType;
52
- (function (WidthType) {
53
- /** Width matches the content width */
54
- WidthType["CONTENT"] = "CONTENT";
55
- /** Small Width */
56
- WidthType["SMALL"] = "SMALL";
57
- /** Width will match the original asset width */
58
- WidthType["ORIGINAL"] = "ORIGINAL";
59
- /** coast-to-coast display */
60
- WidthType["FULL_WIDTH"] = "FULL_WIDTH";
61
- })(WidthType || (WidthType = {}));
62
- export var PluginContainerDataAlignment;
63
- (function (PluginContainerDataAlignment) {
64
- /** Center Alignment */
65
- PluginContainerDataAlignment["CENTER"] = "CENTER";
66
- /** Left Alignment */
67
- PluginContainerDataAlignment["LEFT"] = "LEFT";
68
- /** Right Alignment */
69
- PluginContainerDataAlignment["RIGHT"] = "RIGHT";
70
- })(PluginContainerDataAlignment || (PluginContainerDataAlignment = {}));
71
- export var Type;
72
- (function (Type) {
73
- /** Regular link button */
74
- Type["LINK"] = "LINK";
75
- /** Triggers custom action that is defined in plugin configuration by the consumer */
76
- Type["ACTION"] = "ACTION";
77
- })(Type || (Type = {}));
78
- export var Target;
79
- (function (Target) {
80
- /** Opens the linked document in the same frame as it was clicked (this is default) */
81
- Target["SELF"] = "SELF";
82
- /** Opens the linked document in a new window or tab */
83
- Target["BLANK"] = "BLANK";
84
- /** Opens the linked document in the parent frame */
85
- Target["PARENT"] = "PARENT";
86
- /** Opens the linked document in the full body of the window */
87
- Target["TOP"] = "TOP";
88
- })(Target || (Target = {}));
89
- export var TextAlignment;
90
- (function (TextAlignment) {
91
- /** browser default, eqivalent to `initial` */
92
- TextAlignment["AUTO"] = "AUTO";
93
- /** Left align */
94
- TextAlignment["LEFT"] = "LEFT";
95
- /** Right align */
96
- TextAlignment["RIGHT"] = "RIGHT";
97
- /** Center align */
98
- TextAlignment["CENTER"] = "CENTER";
99
- /** Text is spaced to line up its left and right edges to the left and right edges of the line box, except for the last line. */
100
- TextAlignment["JUSTIFY"] = "JUSTIFY";
101
- })(TextAlignment || (TextAlignment = {}));
102
- export var LineStyle;
103
- (function (LineStyle) {
104
- /** Single Line */
105
- LineStyle["SINGLE"] = "SINGLE";
106
- /** Double Line */
107
- LineStyle["DOUBLE"] = "DOUBLE";
108
- /** Dashed Line */
109
- LineStyle["DASHED"] = "DASHED";
110
- /** Dotted Line */
111
- LineStyle["DOTTED"] = "DOTTED";
112
- })(LineStyle || (LineStyle = {}));
113
- export var Width;
114
- (function (Width) {
115
- /** Large line */
116
- Width["LARGE"] = "LARGE";
117
- /** Medium line */
118
- Width["MEDIUM"] = "MEDIUM";
119
- /** Small line */
120
- Width["SMALL"] = "SMALL";
121
- })(Width || (Width = {}));
122
- export var Alignment;
123
- (function (Alignment) {
124
- /** Center alignment */
125
- Alignment["CENTER"] = "CENTER";
126
- /** Left alignment */
127
- Alignment["LEFT"] = "LEFT";
128
- /** Right alignment */
129
- Alignment["RIGHT"] = "RIGHT";
130
- })(Alignment || (Alignment = {}));
131
- export var ViewMode;
132
- (function (ViewMode) {
133
- /** No PDF view */
134
- ViewMode["NONE"] = "NONE";
135
- /** Full PDF view */
136
- ViewMode["FULL"] = "FULL";
137
- /** Mini PDF view */
138
- ViewMode["MINI"] = "MINI";
139
- })(ViewMode || (ViewMode = {}));
140
- export var LayoutType;
141
- (function (LayoutType) {
142
- /** Collage type */
143
- LayoutType["COLLAGE"] = "COLLAGE";
144
- /** Masonry type */
145
- LayoutType["MASONRY"] = "MASONRY";
146
- /** Grid type */
147
- LayoutType["GRID"] = "GRID";
148
- /** Thumbnail type */
149
- LayoutType["THUMBNAIL"] = "THUMBNAIL";
150
- /** Slider type */
151
- LayoutType["SLIDER"] = "SLIDER";
152
- /** Slideshow type */
153
- LayoutType["SLIDESHOW"] = "SLIDESHOW";
154
- /** Panorama type */
155
- LayoutType["PANORAMA"] = "PANORAMA";
156
- /** Column type */
157
- LayoutType["COLUMN"] = "COLUMN";
158
- /** Magic type */
159
- LayoutType["MAGIC"] = "MAGIC";
160
- /** Fullsize images type */
161
- LayoutType["FULLSIZE"] = "FULLSIZE";
162
- })(LayoutType || (LayoutType = {}));
163
- export var Orientation;
164
- (function (Orientation) {
165
- /** Rows Orientation */
166
- Orientation["ROWS"] = "ROWS";
167
- /** Columns Orientation */
168
- Orientation["COLUMNS"] = "COLUMNS";
169
- })(Orientation || (Orientation = {}));
170
- export var Crop;
171
- (function (Crop) {
172
- /** Crop to fill */
173
- Crop["FILL"] = "FILL";
174
- /** Crop to fit */
175
- Crop["FIT"] = "FIT";
176
- })(Crop || (Crop = {}));
177
- export var ThumbnailsAlignment;
178
- (function (ThumbnailsAlignment) {
179
- /** Top alignment */
180
- ThumbnailsAlignment["TOP"] = "TOP";
181
- /** Right alignment */
182
- ThumbnailsAlignment["RIGHT"] = "RIGHT";
183
- /** Bottom alignment */
184
- ThumbnailsAlignment["BOTTOM"] = "BOTTOM";
185
- /** Left alignment */
186
- ThumbnailsAlignment["LEFT"] = "LEFT";
187
- /** No thumbnail */
188
- ThumbnailsAlignment["NONE"] = "NONE";
189
- })(ThumbnailsAlignment || (ThumbnailsAlignment = {}));
190
- export var Source;
191
- (function (Source) {
192
- Source["HTML"] = "HTML";
193
- Source["ADSENSE"] = "ADSENSE";
194
- })(Source || (Source = {}));
195
- export var MapType;
196
- (function (MapType) {
197
- /** Roadmap map type */
198
- MapType["ROADMAP"] = "ROADMAP";
199
- /** Satellite map type */
200
- MapType["SATELITE"] = "SATELITE";
201
- /** Hybrid map type */
202
- MapType["HYBRID"] = "HYBRID";
203
- /** Terrain map type */
204
- MapType["TERRAIN"] = "TERRAIN";
205
- })(MapType || (MapType = {}));
206
- export var ViewRole;
207
- (function (ViewRole) {
208
- /** Only Poll creator can view the results */
209
- ViewRole["CREATOR"] = "CREATOR";
210
- /** Anyone who voted can see the results */
211
- ViewRole["VOTERS"] = "VOTERS";
212
- /** Anyone can see the results, even if one didn't vote */
213
- ViewRole["EVERYONE"] = "EVERYONE";
214
- })(ViewRole || (ViewRole = {}));
215
- export var VoteRole;
216
- (function (VoteRole) {
217
- /** Logged in member */
218
- VoteRole["SITE_MEMBERS"] = "SITE_MEMBERS";
219
- /** Anyone */
220
- VoteRole["ALL"] = "ALL";
221
- })(VoteRole || (VoteRole = {}));
222
- export var PollLayoutType;
223
- (function (PollLayoutType) {
224
- /** List */
225
- PollLayoutType["LIST"] = "LIST";
226
- /** Grid */
227
- PollLayoutType["GRID"] = "GRID";
228
- })(PollLayoutType || (PollLayoutType = {}));
229
- export var PollLayoutDirection;
230
- (function (PollLayoutDirection) {
231
- /** Left-to-right */
232
- PollLayoutDirection["LTR"] = "LTR";
233
- /** Right-to-left */
234
- PollLayoutDirection["RTL"] = "RTL";
235
- })(PollLayoutDirection || (PollLayoutDirection = {}));
236
- export var BackgroundType;
237
- (function (BackgroundType) {
238
- /** Color background type */
239
- BackgroundType["COLOR"] = "COLOR";
240
- /** Image background type */
241
- BackgroundType["IMAGE"] = "IMAGE";
242
- /** Gradiant background type */
243
- BackgroundType["GRADIENT"] = "GRADIENT";
244
- })(BackgroundType || (BackgroundType = {}));
245
- export var DecorationType;
246
- (function (DecorationType) {
247
- DecorationType["BOLD"] = "BOLD";
248
- DecorationType["ITALIC"] = "ITALIC";
249
- DecorationType["UNDERLINE"] = "UNDERLINE";
250
- DecorationType["SPOILER"] = "SPOILER";
251
- DecorationType["ANCHOR"] = "ANCHOR";
252
- DecorationType["MENTION"] = "MENTION";
253
- DecorationType["LINK"] = "LINK";
254
- DecorationType["COLOR"] = "COLOR";
255
- DecorationType["FONT_SIZE"] = "FONT_SIZE";
256
- DecorationType["EXTERNAL"] = "EXTERNAL";
257
- })(DecorationType || (DecorationType = {}));
258
- export var FontType;
259
- (function (FontType) {
260
- FontType["PX"] = "PX";
261
- FontType["EM"] = "EM";
262
- })(FontType || (FontType = {}));
263
- export var AppType;
264
- (function (AppType) {
265
- AppType["PRODUCT"] = "PRODUCT";
266
- AppType["EVENT"] = "EVENT";
267
- AppType["BOOKING"] = "BOOKING";
268
- })(AppType || (AppType = {}));
269
- export var InitialExpandedItems;
270
- (function (InitialExpandedItems) {
271
- /** First item will be expended initally */
272
- InitialExpandedItems["FIRST"] = "FIRST";
273
- /** All items will expended initally */
274
- InitialExpandedItems["ALL"] = "ALL";
275
- /** All items collapsed initally */
276
- InitialExpandedItems["NONE"] = "NONE";
277
- })(InitialExpandedItems || (InitialExpandedItems = {}));
278
- export var Direction;
279
- (function (Direction) {
280
- /** Left-to-right */
281
- Direction["LTR"] = "LTR";
282
- /** Right-to-left */
283
- Direction["RTL"] = "RTL";
284
- })(Direction || (Direction = {}));
285
- export var VerticalAlignment;
286
- (function (VerticalAlignment) {
287
- /** Top alignment */
288
- VerticalAlignment["TOP"] = "TOP";
289
- /** Middle alignment */
290
- VerticalAlignment["MIDDLE"] = "MIDDLE";
291
- /** Bottom alignment */
292
- VerticalAlignment["BOTTOM"] = "BOTTOM";
293
- })(VerticalAlignment || (VerticalAlignment = {}));
294
- /**
295
- * `NullValue` is a singleton enumeration to represent the null value for the
296
- * `Value` type union.
297
- *
298
- * The JSON representation for `NullValue` is JSON `null`.
299
- */
300
- export var NullValue;
301
- (function (NullValue) {
302
- /** Null value. */
303
- NullValue["NULL_VALUE"] = "NULL_VALUE";
304
- })(NullValue || (NullValue = {}));
305
- export var ModerationStatusStatus;
306
- (function (ModerationStatusStatus) {
307
- ModerationStatusStatus["UNKNOWN"] = "UNKNOWN";
308
- ModerationStatusStatus["APPROVED"] = "APPROVED";
309
- ModerationStatusStatus["REJECTED"] = "REJECTED";
310
- })(ModerationStatusStatus || (ModerationStatusStatus = {}));
311
- export var GetPostsSort;
312
- (function (GetPostsSort) {
313
- /** Sorting by publishing date descending with pinned posts first. The default value */
314
- GetPostsSort["FEED"] = "FEED";
315
- /** Sorting by publishing date ascending */
316
- GetPostsSort["PUBLISHED_DATE_ASC"] = "PUBLISHED_DATE_ASC";
317
- /** Sorting by publishing date descending */
318
- GetPostsSort["PUBLISHED_DATE_DESC"] = "PUBLISHED_DATE_DESC";
319
- /** Sorting by view count descending */
320
- GetPostsSort["VIEW_COUNT"] = "VIEW_COUNT";
321
- /** Sorting by like count descending */
322
- GetPostsSort["LIKE_COUNT"] = "LIKE_COUNT";
323
- /** Sorting by title ascending */
324
- GetPostsSort["TITLE_ASC"] = "TITLE_ASC";
325
- /** Sorting by title descending */
326
- GetPostsSort["TITLE_DESC"] = "TITLE_DESC";
327
- /** Sorting by post rating descending. */
328
- GetPostsSort["RATING"] = "RATING";
329
- })(GetPostsSort || (GetPostsSort = {}));
330
- export var PostFieldField;
331
- (function (PostFieldField) {
332
- PostFieldField["UNKNOWN"] = "UNKNOWN";
333
- /** Deprecated use `METRICS` instead */
334
- PostFieldField["COUNTERS"] = "COUNTERS";
335
- /** Includes Post url when present */
336
- PostFieldField["URL"] = "URL";
337
- /** Includes Post content text string when present */
338
- PostFieldField["CONTENT_TEXT"] = "CONTENT_TEXT";
339
- /** Includes Post metrics when present */
340
- PostFieldField["METRICS"] = "METRICS";
341
- /** Includes SEO data */
342
- PostFieldField["SEO"] = "SEO";
343
- /**
344
- * Includes Post content as a stringified DraftJS document
345
- * Reserved for internal use
346
- */
347
- PostFieldField["CONTENT"] = "CONTENT";
348
- /**
349
- * Includes internal id field
350
- * Reserved for internal use
351
- */
352
- PostFieldField["INTERNAL_ID"] = "INTERNAL_ID";
353
- /** Includes post owners Contact Id */
354
- PostFieldField["CONTACT_ID"] = "CONTACT_ID";
355
- /** Includes post rich content */
356
- PostFieldField["RICH_CONTENT"] = "RICH_CONTENT";
357
- /** Includes post rich content string */
358
- PostFieldField["RICH_CONTENT_STRING"] = "RICH_CONTENT_STRING";
359
- /** Includes compressed post rich content string */
360
- PostFieldField["RICH_CONTENT_COMPRESSED"] = "RICH_CONTENT_COMPRESSED";
361
- /** Includes post translations */
362
- PostFieldField["TRANSLATIONS"] = "TRANSLATIONS";
363
- })(PostFieldField || (PostFieldField = {}));
364
- export var GetPostTemplatesSort;
365
- (function (GetPostTemplatesSort) {
366
- /** Sorting by publishing date ascending */
367
- GetPostTemplatesSort["PUBLISHED_DATE_ASC"] = "PUBLISHED_DATE_ASC";
368
- /** Sorting by publishing date descending */
369
- GetPostTemplatesSort["PUBLISHED_DATE_DESC"] = "PUBLISHED_DATE_DESC";
370
- })(GetPostTemplatesSort || (GetPostTemplatesSort = {}));
371
- export var Origin;
372
- (function (Origin) {
373
- Origin["UNKNOWN"] = "UNKNOWN";
374
- /** Changed by admin */
375
- Origin["ADMIN"] = "ADMIN";
376
- /** Categories were changed */
377
- Origin["ADD_CATEGORIES"] = "ADD_CATEGORIES";
378
- /** Saved automatically */
379
- Origin["AUTO_SAVE"] = "AUTO_SAVE";
380
- /** Copied from template */
381
- Origin["COPY_TEMPLATE"] = "COPY_TEMPLATE";
382
- /** Imported */
383
- Origin["IMPORT"] = "IMPORT";
384
- /** Imported in bulk */
385
- Origin["IMPORT_BULK"] = "IMPORT_BULK";
386
- /** Imported with html import */
387
- Origin["IMPORT_HTML"] = "IMPORT_HTML";
388
- /** Patch import */
389
- Origin["IMPORT_PATCH"] = "IMPORT_PATCH";
390
- /** Changed language */
391
- Origin["LANGUAGE_CHANGE"] = "LANGUAGE_CHANGE";
392
- /** Saved manually */
393
- Origin["MANUAL_SAVE"] = "MANUAL_SAVE";
394
- /** Affected by migration */
395
- Origin["MIGRATION"] = "MIGRATION";
396
- /** Affected by moderation */
397
- Origin["MODERATION"] = "MODERATION";
398
- /** Moved to trash */
399
- Origin["MOVE_TO_TRASH"] = "MOVE_TO_TRASH";
400
- /** Pricing plans were changed */
401
- Origin["PRICING_PLANS_CHANGE"] = "PRICING_PLANS_CHANGE";
402
- /** Was provisioned */
403
- Origin["PROVISION"] = "PROVISION";
404
- /** Was published */
405
- Origin["PUBLISH"] = "PUBLISH";
406
- /** Owner was reassigned */
407
- Origin["REASSIGN_OWNER"] = "REASSIGN_OWNER";
408
- /** Was reblogged */
409
- Origin["REBLOG"] = "REBLOG";
410
- /** Was restored */
411
- Origin["RESTORE"] = "RESTORE";
412
- /** Reverted to draft */
413
- Origin["REVERT_TO_DRAFT"] = "REVERT_TO_DRAFT";
414
- /** Was translated */
415
- Origin["TRANSLATION"] = "TRANSLATION";
416
- /** Was unpublished */
417
- Origin["UNPUBLISH"] = "UNPUBLISH";
418
- /** Was unscheduled */
419
- Origin["UNSCHEDULE"] = "UNSCHEDULE";
420
- /** New edit session started which updated editing_session_id id */
421
- Origin["NEW_EDIT_SESSION"] = "NEW_EDIT_SESSION";
422
- /** Was scheduled by Later */
423
- Origin["SCHEDULING_SERVICE_SCHEDULE"] = "SCHEDULING_SERVICE_SCHEDULE";
424
- /** Was unscheduled by Later */
425
- Origin["SCHEDULING_SERVICE_UNSCHEDULE"] = "SCHEDULING_SERVICE_UNSCHEDULE";
426
- /** Was published by Later */
427
- Origin["SCHEDULING_SERVICE_PUBLISH"] = "SCHEDULING_SERVICE_PUBLISH";
428
- /** Was scheduled */
429
- Origin["SCHEDULE"] = "SCHEDULE";
430
- /** Was removed from moderation */
431
- Origin["REMOVE_FROM_MODERATION"] = "REMOVE_FROM_MODERATION";
432
- /** Was rejected from moderation */
433
- Origin["REJECT_FROM_MODERATION"] = "REJECT_FROM_MODERATION";
434
- /** Was approved in moderation */
435
- Origin["APPROVE_IN_MODERATION"] = "APPROVE_IN_MODERATION";
436
- /** Tag was deleted */
437
- Origin["DELETE_TAG"] = "DELETE_TAG";
438
- /** Post was pinned */
439
- Origin["PIN"] = "PIN";
440
- /** Post was unpinned */
441
- Origin["UNPIN"] = "UNPIN";
442
- })(Origin || (Origin = {}));
443
- export var Status;
444
- (function (Status) {
445
- Status["UNKNOWN"] = "UNKNOWN";
446
- /** Status indicating the draft post is published. */
447
- Status["PUBLISHED"] = "PUBLISHED";
448
- /** Status indicating the draft post is unpublished. */
449
- Status["UNPUBLISHED"] = "UNPUBLISHED";
450
- /** Status indicating the draft post is scheduled for publication. */
451
- Status["SCHEDULED"] = "SCHEDULED";
452
- /** Status indicating the draft post is deleted. */
453
- Status["DELETED"] = "DELETED";
454
- /**
455
- * Deprecated. Use `IN_REVIEW` instead. Status indicating the draft post is in review.
456
- * Target removal date 2024-06-30
457
- * Reserved for internal use.
458
- */
459
- Status["IN_MODERATION"] = "IN_MODERATION";
460
- /** Status indicating the draft post is in review. */
461
- Status["IN_REVIEW"] = "IN_REVIEW";
462
- })(Status || (Status = {}));
463
- export var Field;
464
- (function (Field) {
465
- Field["UNKNOWN"] = "UNKNOWN";
466
- /** Total comments field. */
467
- Field["TOTAL_COMMENTS"] = "TOTAL_COMMENTS";
468
- /** Like count field. */
469
- Field["LIKE_COUNT"] = "LIKE_COUNT";
470
- /** View count field. */
471
- Field["VIEW_COUNT"] = "VIEW_COUNT";
472
- /** Rating count field */
473
- Field["RATING_COUNT"] = "RATING_COUNT";
474
- })(Field || (Field = {}));
475
- export var SortOrder;
476
- (function (SortOrder) {
477
- SortOrder["ASC"] = "ASC";
478
- SortOrder["DESC"] = "DESC";
479
- })(SortOrder || (SortOrder = {}));
480
- export var QueryPublicationsCountStatsRequestOrder;
481
- (function (QueryPublicationsCountStatsRequestOrder) {
482
- QueryPublicationsCountStatsRequestOrder["UNKNOWN"] = "UNKNOWN";
483
- QueryPublicationsCountStatsRequestOrder["OLDEST"] = "OLDEST";
484
- QueryPublicationsCountStatsRequestOrder["NEWEST"] = "NEWEST";
485
- })(QueryPublicationsCountStatsRequestOrder || (QueryPublicationsCountStatsRequestOrder = {}));
486
- export var Order;
487
- (function (Order) {
488
- Order["UNKNOWN"] = "UNKNOWN";
489
- Order["OLDEST"] = "OLDEST";
490
- Order["NEWEST"] = "NEWEST";
491
- })(Order || (Order = {}));
492
- const _coverMedia = { image: 'wix.common.Image', video: 'wix.common.Video' };
493
- const _getPostBySlugRequest = {};
494
- const _getPostBySlugResponse = { post: '_post' };
495
- const _getPostMetricsRequest = {};
496
- const _getPostMetricsResponse = {};
497
- const _getPostRequest = {};
498
- const _getPostResponse = { post: '_post' };
499
- const _getTotalPostsRequest = {};
500
- const _getTotalPostsResponse = {};
501
- const _listPostsRequest = {};
502
- const _listPostsResponse = { posts: '_post' };
503
- const _media = { wixMedia: '_wixMedia' };
504
- const _node = { nodes: '_node' };
505
- const _post = {
506
- url: 'wix.common.PageUrl',
507
- heroImage: 'wix.common.Image',
508
- coverMedia: '_coverMedia',
509
- richContent: '_richContent',
510
- media: '_media',
511
- translations: '_postTranslation',
512
- };
513
- const _postTranslation = { url: 'wix.common.PageUrl' };
514
- const _queryPostCountStatsRequest = {};
515
- const _queryPostCountStatsResponse = {};
516
- const _queryPostsRequest = {};
517
- const _queryPostsResponse = { posts: '_post' };
518
- const _richContent = { nodes: '_node' };
519
- const _wixMedia = { image: 'wix.common.Image', videoV2: 'wix.common.VideoV2' };
520
- export const onPostCreated = EventDefinition('wix.blog.v3.post_created')();
521
- export const onPostUpdated = EventDefinition('wix.blog.v3.post_updated')();
522
- export const onPostDeleted = EventDefinition('wix.blog.v3.post_deleted')();
523
- export const onPostLiked = EventDefinition('wix.blog.v3.post_liked')();
524
- export const onPostUnliked = EventDefinition('wix.blog.v3.post_unliked')();
525
- /**
526
- * Gets a post by the specified ID.
527
- *
528
- *
529
- * The `getPost()` function returns a Promise that resolves to a post whose ID matches the given ID.
530
- *
531
- * @param postId - Post ID.
532
- * @public
533
- * @requiredField postId
534
- * @param options - Options specifying which fields to return.
535
- * @permissionScope Read Blog
536
- * @permissionScopeId SCOPE.DC-BLOG.READ-BLOGS
537
- * @permissionScope Manage Blog
538
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
539
- * @permissionScope Read Draft Blog Posts
540
- * @permissionScopeId SCOPE.DC-BLOG.READ-DRAFT-POSTS
541
- * @applicableIdentity APP
542
- * @applicableIdentity VISITOR
543
- * @returns Fulfilled - The requested post.
544
- */
545
- export function getPost(postId, options) {
546
- var _a, _b, _c;
547
- return __awaiter(this, arguments, void 0, function* () {
548
- const requestTransformation = {
549
- postId: '$[0]',
550
- fieldsToInclude: '$[1].fieldsToInclude',
551
- fieldsets: '$[1].fieldsets',
552
- };
553
- const responseTransformation = '$.post';
554
- // @ts-ignore
555
- const { httpClient, sideEffects } = arguments[2];
556
- const { toAmbassadorRequest } = serializer({
557
- rootSchema: _getPostRequest,
558
- depSchemas: {},
559
- fqdnTransformation: {
560
- paths: [],
561
- transformation: _fromVeloEntity,
562
- },
563
- customTransformation: requestTransformation,
564
- });
565
- const { fromJSON } = serializer({
566
- rootSchema: _getPostResponse,
567
- depSchemas: {
568
- _coverMedia,
569
- _media,
570
- _node,
571
- _post,
572
- _postTranslation,
573
- _richContent,
574
- _wixMedia,
575
- },
576
- fqdnTransformation: {
577
- paths: [...['post']],
578
- transformation: _toVeloEntity,
579
- },
580
- customTransformation: responseTransformation,
581
- });
582
- const payload = toAmbassadorRequest([postId, options], []);
583
- const reqOpts = ambassadorWixBlogV3Post.getPost(payload);
584
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
585
- try {
586
- const result = yield httpClient.request(reqOpts);
587
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
588
- return fromJSON(result.data, ['post.rich_content']);
589
- }
590
- catch (err) {
591
- const transformedError = sdkTransformError(err, {
592
- spreadPathsToArguments: {},
593
- explicitPathsToArguments: {
594
- postId: '$[0]',
595
- fieldsToInclude: '$[1].fieldsToInclude',
596
- fieldsets: '$[1].fieldsets',
597
- },
598
- singleArgumentUnchanged: false,
599
- }, ['postId', 'options']);
600
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
601
- throw transformedError;
602
- }
603
- });
604
- }
605
- /**
606
- * Gets a post by the provided slug.
607
- *
608
- *
609
- * The `getPostBySlug()` function returns a Promise that resolves to a post whose slug matches the given slug.
610
- *
611
- * 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.
612
- * @public
613
- * @requiredField slug
614
- * @param options - Options specifying which fields to return.
615
- * @param slug - Slug of the post to retrieve.
616
- *
617
- * The end of a post's URL, for example, `https:/example.com/blog/post/my-post-slug`. Case sensitive and generally based on the post title if not specified.
618
- * @permissionScope Read Blog
619
- * @permissionScopeId SCOPE.DC-BLOG.READ-BLOGS
620
- * @permissionScope Manage Blog
621
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
622
- * @permissionScope Read Draft Blog Posts
623
- * @permissionScopeId SCOPE.DC-BLOG.READ-DRAFT-POSTS
624
- * @applicableIdentity APP
625
- * @applicableIdentity VISITOR
626
- * @returns Fulfilled - The requested post.
627
- */
628
- export function getPostBySlug(slug, options) {
629
- var _a, _b, _c;
630
- return __awaiter(this, arguments, void 0, function* () {
631
- const requestTransformation = {
632
- slug: '$[0]',
633
- fieldsToInclude: '$[1].fieldsToInclude',
634
- fieldsets: '$[1].fieldsets',
635
- };
636
- const responseTransformation = '$';
637
- // @ts-ignore
638
- const { httpClient, sideEffects } = arguments[2];
639
- const { toAmbassadorRequest } = serializer({
640
- rootSchema: _getPostBySlugRequest,
641
- depSchemas: {},
642
- fqdnTransformation: {
643
- paths: [],
644
- transformation: _fromVeloEntity,
645
- },
646
- customTransformation: requestTransformation,
647
- });
648
- const { fromJSON } = serializer({
649
- rootSchema: _getPostBySlugResponse,
650
- depSchemas: {
651
- _coverMedia,
652
- _media,
653
- _node,
654
- _post,
655
- _postTranslation,
656
- _richContent,
657
- _wixMedia,
658
- },
659
- fqdnTransformation: {
660
- paths: [...['post']],
661
- transformation: _toVeloEntity,
662
- },
663
- customTransformation: responseTransformation,
664
- });
665
- const payload = toAmbassadorRequest([slug, options], []);
666
- const reqOpts = ambassadorWixBlogV3Post.getPostBySlug(payload);
667
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
668
- try {
669
- const result = yield httpClient.request(reqOpts);
670
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
671
- return fromJSON(result.data, ['post.rich_content']);
672
- }
673
- catch (err) {
674
- const transformedError = sdkTransformError(err, {
675
- spreadPathsToArguments: {},
676
- explicitPathsToArguments: {
677
- slug: '$[0]',
678
- fieldsToInclude: '$[1].fieldsToInclude',
679
- fieldsets: '$[1].fieldsets',
680
- },
681
- singleArgumentUnchanged: false,
682
- }, ['slug', 'options']);
683
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
684
- throw transformedError;
685
- }
686
- });
687
- }
688
- /**
689
- * Retrieves a list of published posts.
690
- *
691
- *
692
- * The `listPosts()` function returns a Promise that resolves to a list of up to 100 published posts.
693
- *
694
- * 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.
695
- *
696
- * By default, the list is sorted by `firstPublishedDate` in descending order, and the amount of posts returned is 50.
697
- * @public
698
- * @param options - Sort, filter, and paging options.
699
- * @permissionScope Read Blog
700
- * @permissionScopeId SCOPE.DC-BLOG.READ-BLOGS
701
- * @permissionScope Manage Blog
702
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
703
- * @permissionScope Read Draft Blog Posts
704
- * @permissionScopeId SCOPE.DC-BLOG.READ-DRAFT-POSTS
705
- * @applicableIdentity APP
706
- * @applicableIdentity VISITOR
707
- * @returns Fulfilled - List of retrieved posts.
708
- */
709
- export function listPosts(options) {
710
- var _a, _b, _c;
711
- return __awaiter(this, arguments, void 0, function* () {
712
- const requestTransformation = {
713
- featured: '$[0].featured',
714
- hashtags: '$[0].hashtags',
715
- categoryIds: '$[0].categoryIds',
716
- tagIds: '$[0].tagIds',
717
- sort: '$[0].sort',
718
- paging: '$[0].paging',
719
- fieldsToInclude: '$[0].fieldsToInclude',
720
- language: '$[0].language',
721
- memberId: '$[0].memberId',
722
- fieldsets: '$[0].fieldsets',
723
- };
724
- const responseTransformation = '$';
725
- // @ts-ignore
726
- const { httpClient, sideEffects } = arguments[1];
727
- const { toAmbassadorRequest } = serializer({
728
- rootSchema: _listPostsRequest,
729
- depSchemas: {},
730
- fqdnTransformation: {
731
- paths: [],
732
- transformation: _fromVeloEntity,
733
- },
734
- customTransformation: requestTransformation,
735
- });
736
- const { fromJSON } = serializer({
737
- rootSchema: _listPostsResponse,
738
- depSchemas: {
739
- _coverMedia,
740
- _media,
741
- _node,
742
- _post,
743
- _postTranslation,
744
- _richContent,
745
- _wixMedia,
746
- },
747
- fqdnTransformation: {
748
- paths: [...['Array#posts']],
749
- transformation: _toVeloEntity,
750
- },
751
- customTransformation: responseTransformation,
752
- });
753
- const payload = toAmbassadorRequest([options], []);
754
- const reqOpts = ambassadorWixBlogV3Post.listPosts(payload);
755
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
756
- try {
757
- const result = yield httpClient.request(reqOpts);
758
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
759
- return fromJSON(result.data, ['posts.rich_content']);
760
- }
761
- catch (err) {
762
- const transformedError = sdkTransformError(err, {
763
- spreadPathsToArguments: {},
764
- explicitPathsToArguments: {
765
- featured: '$[0].featured',
766
- hashtags: '$[0].hashtags',
767
- categoryIds: '$[0].categoryIds',
768
- tagIds: '$[0].tagIds',
769
- sort: '$[0].sort',
770
- paging: '$[0].paging',
771
- fieldsToInclude: '$[0].fieldsToInclude',
772
- language: '$[0].language',
773
- memberId: '$[0].memberId',
774
- fieldsets: '$[0].fieldsets',
775
- },
776
- singleArgumentUnchanged: false,
777
- }, ['options']);
778
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
779
- throw transformedError;
780
- }
781
- });
782
- }
783
- /**
784
- * Creates a query to retrieve a list of posts.
785
- *
786
- *
787
- * 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/posts/postsquerybuilder) object.
788
- *
789
- * 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/posts/postsquerybuilder/find) function.
790
- *
791
- * 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.
792
- *
793
- * `queryPosts()` runs with these `PostsQueryBuilder` defaults that can be overridden:
794
- * + [`limit(50)`](https://www.wix.com/velo/reference/wix-blog-backend/posts/postsquerybuilder/limit)
795
- * + [`descending('firstPublishedDate')`](https://www.wix.com/velo/reference/wix-blog-backend/posts/postsquerybuilder/descending)
796
- *
797
- * Note that the default limit is `'50'`, but the max limit is `'100'`.
798
- *
799
- * To learn how to query posts, refer to the table below.
800
- *
801
- * 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`](https://www.wix.com/velo/reference/wix-blog-backend/posts/postsqueryresult/items) property in [`PostsQueryResult`](https://www.wix.com/velo/reference/wix-blog-backend/posts/postsqueryresult).
802
- * @public
803
- * @param options - Options specifying which fields to return.
804
- * @permissionScope Read Blog
805
- * @permissionScopeId SCOPE.DC-BLOG.READ-BLOGS
806
- * @permissionScope Manage Blog
807
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
808
- * @permissionScope Read Draft Blog Posts
809
- * @permissionScopeId SCOPE.DC-BLOG.READ-DRAFT-POSTS
810
- * @applicableIdentity APP
811
- * @applicableIdentity VISITOR
812
- */
813
- export function queryPosts(options) {
814
- const requestTransformation = { '*': '$[1]', query: '$[0]' };
815
- const responseTransformation = {
816
- items: '$.posts',
817
- pagingMetadata: '$.pagingMetadata',
818
- };
819
- // @ts-ignore
820
- const { httpClient, sideEffects } = arguments[1];
821
- const { toAmbassadorRequest } = serializer({
822
- rootSchema: _queryPostsRequest,
823
- depSchemas: {},
824
- fqdnTransformation: {
825
- paths: [],
826
- transformation: _fromVeloEntity,
827
- },
828
- customTransformation: requestTransformation,
829
- });
830
- const { fromJSON } = serializer({
831
- rootSchema: _queryPostsResponse,
832
- depSchemas: {
833
- _coverMedia,
834
- _media,
835
- _node,
836
- _post,
837
- _postTranslation,
838
- _richContent,
839
- _wixMedia,
840
- },
841
- fqdnTransformation: {
842
- paths: [...['Array#posts']],
843
- transformation: _toVeloEntity,
844
- },
845
- customTransformation: responseTransformation,
846
- });
847
- return wrapWithQueryBuilder({
848
- func: (payload) => __awaiter(this, void 0, void 0, function* () {
849
- var _a, _b, _c;
850
- const reqOpts = ambassadorWixBlogV3Post.queryPosts(Object.assign(Object.assign({}, payload), (options !== null && options !== void 0 ? options : {})));
851
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
852
- try {
853
- const result = yield httpClient.request(reqOpts);
854
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
855
- return result;
856
- }
857
- catch (err) {
858
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
859
- throw err;
860
- }
861
- }),
862
- requestTransformer: (...args) => toAmbassadorRequest(args, []),
863
- responseTransformer: ({ data }) => fromJSON(data, ['posts.rich_content']),
864
- errorTransformer: (err) => {
865
- const transformedError = transformError(err, requestTransformation);
866
- throw transformedError;
867
- },
868
- pagingMethod: 'CURSOR',
869
- transformationPaths: resolveQueryFieldsTransformationPaths(_toVeloEntity),
870
- })({ cursorWithEmptyFilterAndSort: true });
871
- }
872
- /**
873
- * Gets a specified post's metrics.
874
- *
875
- *
876
- * The `getPostMetrics()` function returns a Promise that resolves to the specified post's metrics.
877
- *
878
- * A post's metrics include the comments, likes, and views the post receives.
879
- * @param postId - Post ID.
880
- * @public
881
- * @requiredField postId
882
- * @permissionScope Read Blog
883
- * @permissionScopeId SCOPE.DC-BLOG.READ-BLOGS
884
- * @permissionScope Manage Blog
885
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
886
- * @permissionScope Read Draft Blog Posts
887
- * @permissionScopeId SCOPE.DC-BLOG.READ-DRAFT-POSTS
888
- * @applicableIdentity APP
889
- * @applicableIdentity VISITOR
890
- * @returns Fulfilled - Post metrics.
891
- */
892
- export function getPostMetrics(postId) {
893
- var _a, _b, _c;
894
- return __awaiter(this, arguments, void 0, function* () {
895
- const requestTransformation = { postId: '$[0]' };
896
- const responseTransformation = '$';
897
- // @ts-ignore
898
- const { httpClient, sideEffects } = arguments[1];
899
- const { toAmbassadorRequest } = serializer({
900
- rootSchema: _getPostMetricsRequest,
901
- depSchemas: {},
902
- fqdnTransformation: {
903
- paths: [],
904
- transformation: _fromVeloEntity,
905
- },
906
- customTransformation: requestTransformation,
907
- });
908
- const { fromJSON } = serializer({
909
- rootSchema: _getPostMetricsResponse,
910
- depSchemas: {},
911
- fqdnTransformation: {
912
- paths: [],
913
- transformation: _toVeloEntity,
914
- },
915
- customTransformation: responseTransformation,
916
- });
917
- const payload = toAmbassadorRequest([postId], []);
918
- const reqOpts = ambassadorWixBlogV3Post.getPostMetrics(payload);
919
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
920
- try {
921
- const result = yield httpClient.request(reqOpts);
922
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
923
- return fromJSON(result.data, []);
924
- }
925
- catch (err) {
926
- const transformedError = sdkTransformError(err, {
927
- spreadPathsToArguments: {},
928
- explicitPathsToArguments: { postId: '$[0]' },
929
- singleArgumentUnchanged: false,
930
- }, ['postId']);
931
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
932
- throw transformedError;
933
- }
934
- });
935
- }
936
- /**
937
- * Retrieves the number of published posts per month within a specified time range.
938
- *
939
- *
940
- * The `queryPostCountStats()` function returns a Promise that resolves to the number of posts per month within the specified time range.
941
- *
942
- * You can set the time range using the `rangeStart` and `months` properties. The time range always starts on the 1st day of the month set in `rangeStart` and 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'`. The time range ends on the last day of the month.
943
- *
944
- * >**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. If `rangeStart` is set to `'2022-01-01'` and `months` is set to `3`, the response includes `postCount` values for January and March, but not February.
945
- * @public
946
- * @param options - Options specifying time frame, sort, and filter.
947
- * @permissionScope Read Blog
948
- * @permissionScopeId SCOPE.DC-BLOG.READ-BLOGS
949
- * @permissionScope Manage Blog
950
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
951
- * @permissionScope Read Draft Blog Posts
952
- * @permissionScopeId SCOPE.DC-BLOG.READ-DRAFT-POSTS
953
- * @applicableIdentity APP
954
- * @applicableIdentity VISITOR
955
- * @returns Fulfilled - Post count stats.
956
- */
957
- export function queryPostCountStats(options) {
958
- var _a, _b, _c;
959
- return __awaiter(this, arguments, void 0, function* () {
960
- const requestTransformation = {
961
- rangeStart: '$[0].rangeStart',
962
- rangeEnd: '$[0].rangeEnd',
963
- order: '$[0].order',
964
- months: '$[0].months',
965
- language: '$[0].language',
966
- timeZone: '$[0].timeZone',
967
- };
968
- const responseTransformation = '$';
969
- // @ts-ignore
970
- const { httpClient, sideEffects } = arguments[1];
971
- const { toAmbassadorRequest } = serializer({
972
- rootSchema: _queryPostCountStatsRequest,
973
- depSchemas: {},
974
- fqdnTransformation: {
975
- paths: [],
976
- transformation: _fromVeloEntity,
977
- },
978
- customTransformation: requestTransformation,
979
- });
980
- const { fromJSON } = serializer({
981
- rootSchema: _queryPostCountStatsResponse,
982
- depSchemas: {},
983
- fqdnTransformation: {
984
- paths: [],
985
- transformation: _toVeloEntity,
986
- },
987
- customTransformation: responseTransformation,
988
- });
989
- const payload = toAmbassadorRequest([options], []);
990
- const reqOpts = ambassadorWixBlogV3Post.queryPostCountStats(payload);
991
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
992
- try {
993
- const result = yield httpClient.request(reqOpts);
994
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
995
- return fromJSON(result.data, []);
996
- }
997
- catch (err) {
998
- const transformedError = sdkTransformError(err, {
999
- spreadPathsToArguments: {},
1000
- explicitPathsToArguments: {
1001
- rangeStart: '$[0].rangeStart',
1002
- rangeEnd: '$[0].rangeEnd',
1003
- order: '$[0].order',
1004
- months: '$[0].months',
1005
- language: '$[0].language',
1006
- timeZone: '$[0].timeZone',
1007
- },
1008
- singleArgumentUnchanged: false,
1009
- }, ['options']);
1010
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1011
- throw transformedError;
1012
- }
1013
- });
1014
- }
1015
- /**
1016
- * Gets the total amount of published posts on the blog.
1017
- *
1018
- *
1019
- * The `getTotalPosts()` function returns a Promise that resolves to the total amount of published posts on your blog's site.
1020
- *
1021
- *
1022
- * You can use the `language` option to filter posts for a specified language.
1023
- * @public
1024
- * @param options - Language Options.
1025
- * @permissionScope Read Blog
1026
- * @permissionScopeId SCOPE.DC-BLOG.READ-BLOGS
1027
- * @permissionScope Manage Blog
1028
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1029
- * @permissionScope Read Draft Blog Posts
1030
- * @permissionScopeId SCOPE.DC-BLOG.READ-DRAFT-POSTS
1031
- * @applicableIdentity APP
1032
- * @applicableIdentity VISITOR
1033
- * @returns Fulfilled - Total number of posts.
1034
- */
1035
- export function getTotalPosts(options) {
1036
- var _a, _b, _c;
1037
- return __awaiter(this, arguments, void 0, function* () {
1038
- const requestTransformation = { language: '$[0].language' };
1039
- const responseTransformation = '$';
1040
- // @ts-ignore
1041
- const { httpClient, sideEffects } = arguments[1];
1042
- const { toAmbassadorRequest } = serializer({
1043
- rootSchema: _getTotalPostsRequest,
1044
- depSchemas: {},
1045
- fqdnTransformation: {
1046
- paths: [],
1047
- transformation: _fromVeloEntity,
1048
- },
1049
- customTransformation: requestTransformation,
1050
- });
1051
- const { fromJSON } = serializer({
1052
- rootSchema: _getTotalPostsResponse,
1053
- depSchemas: {},
1054
- fqdnTransformation: {
1055
- paths: [],
1056
- transformation: _toVeloEntity,
1057
- },
1058
- customTransformation: responseTransformation,
1059
- });
1060
- const payload = toAmbassadorRequest([options], []);
1061
- const reqOpts = ambassadorWixBlogV3Post.getTotalPosts(payload);
1062
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1063
- try {
1064
- const result = yield httpClient.request(reqOpts);
1065
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1066
- return fromJSON(result.data, []);
1067
- }
1068
- catch (err) {
1069
- const transformedError = sdkTransformError(err, {
1070
- spreadPathsToArguments: {},
1071
- explicitPathsToArguments: { language: '$[0].language' },
1072
- singleArgumentUnchanged: false,
1073
- }, ['options']);
1074
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1075
- throw transformedError;
1076
- }
1077
- });
1078
- }
1079
- //# sourceMappingURL=blog-v3-post.universal.js.map