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