@wix/blog 1.0.237 → 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 -663
  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 -807
  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 -663
  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 -807
  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,1585 +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.listDraftPosts = exports.bulkDeleteDraftPosts = exports.removeFromTrashBin = exports.deleteDraftPost = exports.updateDraftPost = exports.getDraftPost = exports.listDeletedDraftPosts = exports.bulkUpdateDraftPosts = exports.bulkCreateDraftPosts = exports.createDraftPost = exports.onDraftDeleted = exports.onDraftUpdated = exports.onDraftCreated = exports.TotalDraftPostsGroupingField = exports.SortOrder = exports.GetDraftPostsSort = exports.Action = exports.Field = exports.Type = exports.ModerationStatusStatus = exports.Status = 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.ButtonDataType = exports.PluginContainerDataAlignment = exports.WidthType = exports.NodeType = exports.Origin = void 0;
36
- exports.publishDraftPost = exports.queryDraftPosts = exports.restoreFromTrashBin = exports.getDeletedDraftPost = void 0;
37
- const velo_1 = require("@wix/metro-runtime/velo");
38
- const transform_error_1 = require("@wix/sdk-runtime/transform-error");
39
- const sdk_types_1 = require("@wix/sdk-types");
40
- const ambassadorWixBlogV3Draft = __importStar(require("./blog-v3-draft.http"));
41
- // @ts-ignore
42
- const motion_edm_autogen_query_wrapper_1 = require("@wix/motion-edm-autogen-query-wrapper");
43
- const _toVeloEntity = '$';
44
- const _fromVeloEntity = '$';
45
- var Origin;
46
- (function (Origin) {
47
- Origin["UNKNOWN"] = "UNKNOWN";
48
- /** Changed by admin */
49
- Origin["ADMIN"] = "ADMIN";
50
- /** Categories were changed */
51
- Origin["ADD_CATEGORIES"] = "ADD_CATEGORIES";
52
- /** Saved automatically */
53
- Origin["AUTO_SAVE"] = "AUTO_SAVE";
54
- /** Copied from template */
55
- Origin["COPY_TEMPLATE"] = "COPY_TEMPLATE";
56
- /** Imported */
57
- Origin["IMPORT"] = "IMPORT";
58
- /** Imported in bulk */
59
- Origin["IMPORT_BULK"] = "IMPORT_BULK";
60
- /** Imported with html import */
61
- Origin["IMPORT_HTML"] = "IMPORT_HTML";
62
- /** Patch import */
63
- Origin["IMPORT_PATCH"] = "IMPORT_PATCH";
64
- /** Changed language */
65
- Origin["LANGUAGE_CHANGE"] = "LANGUAGE_CHANGE";
66
- /** Saved manually */
67
- Origin["MANUAL_SAVE"] = "MANUAL_SAVE";
68
- /** Affected by migration */
69
- Origin["MIGRATION"] = "MIGRATION";
70
- /** Affected by moderation */
71
- Origin["MODERATION"] = "MODERATION";
72
- /** Moved to trash */
73
- Origin["MOVE_TO_TRASH"] = "MOVE_TO_TRASH";
74
- /** Pricing plans were changed */
75
- Origin["PRICING_PLANS_CHANGE"] = "PRICING_PLANS_CHANGE";
76
- /** Was provisioned */
77
- Origin["PROVISION"] = "PROVISION";
78
- /** Was published */
79
- Origin["PUBLISH"] = "PUBLISH";
80
- /** Owner was reassigned */
81
- Origin["REASSIGN_OWNER"] = "REASSIGN_OWNER";
82
- /** Was reblogged */
83
- Origin["REBLOG"] = "REBLOG";
84
- /** Was restored */
85
- Origin["RESTORE"] = "RESTORE";
86
- /** Reverted to draft */
87
- Origin["REVERT_TO_DRAFT"] = "REVERT_TO_DRAFT";
88
- /** Was translated */
89
- Origin["TRANSLATION"] = "TRANSLATION";
90
- /** Was unpublished */
91
- Origin["UNPUBLISH"] = "UNPUBLISH";
92
- /** Was unscheduled */
93
- Origin["UNSCHEDULE"] = "UNSCHEDULE";
94
- /** New edit session started which updated editing_session_id id */
95
- Origin["NEW_EDIT_SESSION"] = "NEW_EDIT_SESSION";
96
- /** Was scheduled by Later */
97
- Origin["SCHEDULING_SERVICE_SCHEDULE"] = "SCHEDULING_SERVICE_SCHEDULE";
98
- /** Was unscheduled by Later */
99
- Origin["SCHEDULING_SERVICE_UNSCHEDULE"] = "SCHEDULING_SERVICE_UNSCHEDULE";
100
- /** Was published by Later */
101
- Origin["SCHEDULING_SERVICE_PUBLISH"] = "SCHEDULING_SERVICE_PUBLISH";
102
- /** Was scheduled */
103
- Origin["SCHEDULE"] = "SCHEDULE";
104
- /** Was removed from moderation */
105
- Origin["REMOVE_FROM_MODERATION"] = "REMOVE_FROM_MODERATION";
106
- /** Was rejected from moderation */
107
- Origin["REJECT_FROM_MODERATION"] = "REJECT_FROM_MODERATION";
108
- /** Was approved in moderation */
109
- Origin["APPROVE_IN_MODERATION"] = "APPROVE_IN_MODERATION";
110
- /** Tag was deleted */
111
- Origin["DELETE_TAG"] = "DELETE_TAG";
112
- /** Post was pinned */
113
- Origin["PIN"] = "PIN";
114
- /** Post was unpinned */
115
- Origin["UNPIN"] = "UNPIN";
116
- })(Origin || (exports.Origin = Origin = {}));
117
- var NodeType;
118
- (function (NodeType) {
119
- NodeType["PARAGRAPH"] = "PARAGRAPH";
120
- NodeType["TEXT"] = "TEXT";
121
- NodeType["HEADING"] = "HEADING";
122
- NodeType["BULLETED_LIST"] = "BULLETED_LIST";
123
- NodeType["ORDERED_LIST"] = "ORDERED_LIST";
124
- NodeType["LIST_ITEM"] = "LIST_ITEM";
125
- NodeType["BLOCKQUOTE"] = "BLOCKQUOTE";
126
- NodeType["CODE_BLOCK"] = "CODE_BLOCK";
127
- NodeType["VIDEO"] = "VIDEO";
128
- NodeType["DIVIDER"] = "DIVIDER";
129
- NodeType["FILE"] = "FILE";
130
- NodeType["GALLERY"] = "GALLERY";
131
- NodeType["GIF"] = "GIF";
132
- NodeType["HTML"] = "HTML";
133
- NodeType["IMAGE"] = "IMAGE";
134
- NodeType["LINK_PREVIEW"] = "LINK_PREVIEW";
135
- NodeType["MAP"] = "MAP";
136
- NodeType["POLL"] = "POLL";
137
- NodeType["APP_EMBED"] = "APP_EMBED";
138
- NodeType["BUTTON"] = "BUTTON";
139
- NodeType["COLLAPSIBLE_LIST"] = "COLLAPSIBLE_LIST";
140
- NodeType["TABLE"] = "TABLE";
141
- NodeType["EMBED"] = "EMBED";
142
- NodeType["COLLAPSIBLE_ITEM"] = "COLLAPSIBLE_ITEM";
143
- NodeType["COLLAPSIBLE_ITEM_TITLE"] = "COLLAPSIBLE_ITEM_TITLE";
144
- NodeType["COLLAPSIBLE_ITEM_BODY"] = "COLLAPSIBLE_ITEM_BODY";
145
- NodeType["TABLE_CELL"] = "TABLE_CELL";
146
- NodeType["TABLE_ROW"] = "TABLE_ROW";
147
- NodeType["EXTERNAL"] = "EXTERNAL";
148
- NodeType["AUDIO"] = "AUDIO";
149
- })(NodeType || (exports.NodeType = NodeType = {}));
150
- var WidthType;
151
- (function (WidthType) {
152
- /** Width matches the content width */
153
- WidthType["CONTENT"] = "CONTENT";
154
- /** Small Width */
155
- WidthType["SMALL"] = "SMALL";
156
- /** Width will match the original asset width */
157
- WidthType["ORIGINAL"] = "ORIGINAL";
158
- /** coast-to-coast display */
159
- WidthType["FULL_WIDTH"] = "FULL_WIDTH";
160
- })(WidthType || (exports.WidthType = WidthType = {}));
161
- var PluginContainerDataAlignment;
162
- (function (PluginContainerDataAlignment) {
163
- /** Center Alignment */
164
- PluginContainerDataAlignment["CENTER"] = "CENTER";
165
- /** Left Alignment */
166
- PluginContainerDataAlignment["LEFT"] = "LEFT";
167
- /** Right Alignment */
168
- PluginContainerDataAlignment["RIGHT"] = "RIGHT";
169
- })(PluginContainerDataAlignment || (exports.PluginContainerDataAlignment = PluginContainerDataAlignment = {}));
170
- var ButtonDataType;
171
- (function (ButtonDataType) {
172
- /** Regular link button */
173
- ButtonDataType["LINK"] = "LINK";
174
- /** Triggers custom action that is defined in plugin configuration by the consumer */
175
- ButtonDataType["ACTION"] = "ACTION";
176
- })(ButtonDataType || (exports.ButtonDataType = ButtonDataType = {}));
177
- var Target;
178
- (function (Target) {
179
- /** Opens the linked document in the same frame as it was clicked (this is default) */
180
- Target["SELF"] = "SELF";
181
- /** Opens the linked document in a new window or tab */
182
- Target["BLANK"] = "BLANK";
183
- /** Opens the linked document in the parent frame */
184
- Target["PARENT"] = "PARENT";
185
- /** Opens the linked document in the full body of the window */
186
- Target["TOP"] = "TOP";
187
- })(Target || (exports.Target = Target = {}));
188
- var TextAlignment;
189
- (function (TextAlignment) {
190
- /** browser default, eqivalent to `initial` */
191
- TextAlignment["AUTO"] = "AUTO";
192
- /** Left align */
193
- TextAlignment["LEFT"] = "LEFT";
194
- /** Right align */
195
- TextAlignment["RIGHT"] = "RIGHT";
196
- /** Center align */
197
- TextAlignment["CENTER"] = "CENTER";
198
- /** 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. */
199
- TextAlignment["JUSTIFY"] = "JUSTIFY";
200
- })(TextAlignment || (exports.TextAlignment = TextAlignment = {}));
201
- var LineStyle;
202
- (function (LineStyle) {
203
- /** Single Line */
204
- LineStyle["SINGLE"] = "SINGLE";
205
- /** Double Line */
206
- LineStyle["DOUBLE"] = "DOUBLE";
207
- /** Dashed Line */
208
- LineStyle["DASHED"] = "DASHED";
209
- /** Dotted Line */
210
- LineStyle["DOTTED"] = "DOTTED";
211
- })(LineStyle || (exports.LineStyle = LineStyle = {}));
212
- var Width;
213
- (function (Width) {
214
- /** Large line */
215
- Width["LARGE"] = "LARGE";
216
- /** Medium line */
217
- Width["MEDIUM"] = "MEDIUM";
218
- /** Small line */
219
- Width["SMALL"] = "SMALL";
220
- })(Width || (exports.Width = Width = {}));
221
- var Alignment;
222
- (function (Alignment) {
223
- /** Center alignment */
224
- Alignment["CENTER"] = "CENTER";
225
- /** Left alignment */
226
- Alignment["LEFT"] = "LEFT";
227
- /** Right alignment */
228
- Alignment["RIGHT"] = "RIGHT";
229
- })(Alignment || (exports.Alignment = Alignment = {}));
230
- var ViewMode;
231
- (function (ViewMode) {
232
- /** No PDF view */
233
- ViewMode["NONE"] = "NONE";
234
- /** Full PDF view */
235
- ViewMode["FULL"] = "FULL";
236
- /** Mini PDF view */
237
- ViewMode["MINI"] = "MINI";
238
- })(ViewMode || (exports.ViewMode = ViewMode = {}));
239
- var LayoutType;
240
- (function (LayoutType) {
241
- /** Collage type */
242
- LayoutType["COLLAGE"] = "COLLAGE";
243
- /** Masonry type */
244
- LayoutType["MASONRY"] = "MASONRY";
245
- /** Grid type */
246
- LayoutType["GRID"] = "GRID";
247
- /** Thumbnail type */
248
- LayoutType["THUMBNAIL"] = "THUMBNAIL";
249
- /** Slider type */
250
- LayoutType["SLIDER"] = "SLIDER";
251
- /** Slideshow type */
252
- LayoutType["SLIDESHOW"] = "SLIDESHOW";
253
- /** Panorama type */
254
- LayoutType["PANORAMA"] = "PANORAMA";
255
- /** Column type */
256
- LayoutType["COLUMN"] = "COLUMN";
257
- /** Magic type */
258
- LayoutType["MAGIC"] = "MAGIC";
259
- /** Fullsize images type */
260
- LayoutType["FULLSIZE"] = "FULLSIZE";
261
- })(LayoutType || (exports.LayoutType = LayoutType = {}));
262
- var Orientation;
263
- (function (Orientation) {
264
- /** Rows Orientation */
265
- Orientation["ROWS"] = "ROWS";
266
- /** Columns Orientation */
267
- Orientation["COLUMNS"] = "COLUMNS";
268
- })(Orientation || (exports.Orientation = Orientation = {}));
269
- var Crop;
270
- (function (Crop) {
271
- /** Crop to fill */
272
- Crop["FILL"] = "FILL";
273
- /** Crop to fit */
274
- Crop["FIT"] = "FIT";
275
- })(Crop || (exports.Crop = Crop = {}));
276
- var ThumbnailsAlignment;
277
- (function (ThumbnailsAlignment) {
278
- /** Top alignment */
279
- ThumbnailsAlignment["TOP"] = "TOP";
280
- /** Right alignment */
281
- ThumbnailsAlignment["RIGHT"] = "RIGHT";
282
- /** Bottom alignment */
283
- ThumbnailsAlignment["BOTTOM"] = "BOTTOM";
284
- /** Left alignment */
285
- ThumbnailsAlignment["LEFT"] = "LEFT";
286
- /** No thumbnail */
287
- ThumbnailsAlignment["NONE"] = "NONE";
288
- })(ThumbnailsAlignment || (exports.ThumbnailsAlignment = ThumbnailsAlignment = {}));
289
- var Source;
290
- (function (Source) {
291
- Source["HTML"] = "HTML";
292
- Source["ADSENSE"] = "ADSENSE";
293
- })(Source || (exports.Source = Source = {}));
294
- var MapType;
295
- (function (MapType) {
296
- /** Roadmap map type */
297
- MapType["ROADMAP"] = "ROADMAP";
298
- /** Satellite map type */
299
- MapType["SATELITE"] = "SATELITE";
300
- /** Hybrid map type */
301
- MapType["HYBRID"] = "HYBRID";
302
- /** Terrain map type */
303
- MapType["TERRAIN"] = "TERRAIN";
304
- })(MapType || (exports.MapType = MapType = {}));
305
- var ViewRole;
306
- (function (ViewRole) {
307
- /** Only Poll creator can view the results */
308
- ViewRole["CREATOR"] = "CREATOR";
309
- /** Anyone who voted can see the results */
310
- ViewRole["VOTERS"] = "VOTERS";
311
- /** Anyone can see the results, even if one didn't vote */
312
- ViewRole["EVERYONE"] = "EVERYONE";
313
- })(ViewRole || (exports.ViewRole = ViewRole = {}));
314
- var VoteRole;
315
- (function (VoteRole) {
316
- /** Logged in member */
317
- VoteRole["SITE_MEMBERS"] = "SITE_MEMBERS";
318
- /** Anyone */
319
- VoteRole["ALL"] = "ALL";
320
- })(VoteRole || (exports.VoteRole = VoteRole = {}));
321
- var PollLayoutType;
322
- (function (PollLayoutType) {
323
- /** List */
324
- PollLayoutType["LIST"] = "LIST";
325
- /** Grid */
326
- PollLayoutType["GRID"] = "GRID";
327
- })(PollLayoutType || (exports.PollLayoutType = PollLayoutType = {}));
328
- var PollLayoutDirection;
329
- (function (PollLayoutDirection) {
330
- /** Left-to-right */
331
- PollLayoutDirection["LTR"] = "LTR";
332
- /** Right-to-left */
333
- PollLayoutDirection["RTL"] = "RTL";
334
- })(PollLayoutDirection || (exports.PollLayoutDirection = PollLayoutDirection = {}));
335
- var BackgroundType;
336
- (function (BackgroundType) {
337
- /** Color background type */
338
- BackgroundType["COLOR"] = "COLOR";
339
- /** Image background type */
340
- BackgroundType["IMAGE"] = "IMAGE";
341
- /** Gradiant background type */
342
- BackgroundType["GRADIENT"] = "GRADIENT";
343
- })(BackgroundType || (exports.BackgroundType = BackgroundType = {}));
344
- var DecorationType;
345
- (function (DecorationType) {
346
- DecorationType["BOLD"] = "BOLD";
347
- DecorationType["ITALIC"] = "ITALIC";
348
- DecorationType["UNDERLINE"] = "UNDERLINE";
349
- DecorationType["SPOILER"] = "SPOILER";
350
- DecorationType["ANCHOR"] = "ANCHOR";
351
- DecorationType["MENTION"] = "MENTION";
352
- DecorationType["LINK"] = "LINK";
353
- DecorationType["COLOR"] = "COLOR";
354
- DecorationType["FONT_SIZE"] = "FONT_SIZE";
355
- DecorationType["EXTERNAL"] = "EXTERNAL";
356
- })(DecorationType || (exports.DecorationType = DecorationType = {}));
357
- var FontType;
358
- (function (FontType) {
359
- FontType["PX"] = "PX";
360
- FontType["EM"] = "EM";
361
- })(FontType || (exports.FontType = FontType = {}));
362
- var AppType;
363
- (function (AppType) {
364
- AppType["PRODUCT"] = "PRODUCT";
365
- AppType["EVENT"] = "EVENT";
366
- AppType["BOOKING"] = "BOOKING";
367
- })(AppType || (exports.AppType = AppType = {}));
368
- var InitialExpandedItems;
369
- (function (InitialExpandedItems) {
370
- /** First item will be expended initally */
371
- InitialExpandedItems["FIRST"] = "FIRST";
372
- /** All items will expended initally */
373
- InitialExpandedItems["ALL"] = "ALL";
374
- /** All items collapsed initally */
375
- InitialExpandedItems["NONE"] = "NONE";
376
- })(InitialExpandedItems || (exports.InitialExpandedItems = InitialExpandedItems = {}));
377
- var Direction;
378
- (function (Direction) {
379
- /** Left-to-right */
380
- Direction["LTR"] = "LTR";
381
- /** Right-to-left */
382
- Direction["RTL"] = "RTL";
383
- })(Direction || (exports.Direction = Direction = {}));
384
- var VerticalAlignment;
385
- (function (VerticalAlignment) {
386
- /** Top alignment */
387
- VerticalAlignment["TOP"] = "TOP";
388
- /** Middle alignment */
389
- VerticalAlignment["MIDDLE"] = "MIDDLE";
390
- /** Bottom alignment */
391
- VerticalAlignment["BOTTOM"] = "BOTTOM";
392
- })(VerticalAlignment || (exports.VerticalAlignment = VerticalAlignment = {}));
393
- /**
394
- * `NullValue` is a singleton enumeration to represent the null value for the
395
- * `Value` type union.
396
- *
397
- * The JSON representation for `NullValue` is JSON `null`.
398
- */
399
- var NullValue;
400
- (function (NullValue) {
401
- /** Null value. */
402
- NullValue["NULL_VALUE"] = "NULL_VALUE";
403
- })(NullValue || (exports.NullValue = NullValue = {}));
404
- var Status;
405
- (function (Status) {
406
- Status["UNKNOWN"] = "UNKNOWN";
407
- /** Status indicating the draft post is published. */
408
- Status["PUBLISHED"] = "PUBLISHED";
409
- /** Status indicating the draft post is unpublished. */
410
- Status["UNPUBLISHED"] = "UNPUBLISHED";
411
- /** Status indicating the draft post is scheduled for publication. */
412
- Status["SCHEDULED"] = "SCHEDULED";
413
- /** Status indicating the draft post is deleted. */
414
- Status["DELETED"] = "DELETED";
415
- /**
416
- * Deprecated. Use `IN_REVIEW` instead. Status indicating the draft post is in review.
417
- * Target removal date 2024-06-30
418
- * Reserved for internal use.
419
- */
420
- Status["IN_MODERATION"] = "IN_MODERATION";
421
- /** Status indicating the draft post is in review. */
422
- Status["IN_REVIEW"] = "IN_REVIEW";
423
- })(Status || (exports.Status = Status = {}));
424
- var ModerationStatusStatus;
425
- (function (ModerationStatusStatus) {
426
- ModerationStatusStatus["UNKNOWN"] = "UNKNOWN";
427
- ModerationStatusStatus["APPROVED"] = "APPROVED";
428
- ModerationStatusStatus["REJECTED"] = "REJECTED";
429
- })(ModerationStatusStatus || (exports.ModerationStatusStatus = ModerationStatusStatus = {}));
430
- var Type;
431
- (function (Type) {
432
- Type["UNKNOWN"] = "UNKNOWN";
433
- /** Manually saved. */
434
- Type["MANUAL"] = "MANUAL";
435
- /** Triggered by autosave. */
436
- Type["AUTO_SAVE"] = "AUTO_SAVE";
437
- /** Copied from template during provisioning flow. */
438
- Type["PROVISIONING"] = "PROVISIONING";
439
- /** Imported from another blog. */
440
- Type["IMPORT"] = "IMPORT";
441
- })(Type || (exports.Type = Type = {}));
442
- var Field;
443
- (function (Field) {
444
- Field["UNKNOWN"] = "UNKNOWN";
445
- /** Includes draft post preview URL. */
446
- Field["URL"] = "URL";
447
- /**
448
- * Includes internal id field.
449
- * Reserved for internal use.
450
- */
451
- Field["INTERNAL_ID"] = "INTERNAL_ID";
452
- /** Includes content field. */
453
- Field["CONTENT"] = "CONTENT";
454
- /** Includes rich content field. */
455
- Field["RICH_CONTENT"] = "RICH_CONTENT";
456
- /** Includes draft post translations when present. */
457
- Field["TRANSLATIONS"] = "TRANSLATIONS";
458
- /** If the user has not set excerpt, returns the one autogenerated from content. */
459
- Field["GENERATED_EXCERPT"] = "GENERATED_EXCERPT";
460
- })(Field || (exports.Field = Field = {}));
461
- var Action;
462
- (function (Action) {
463
- /** Update draft post properties. */
464
- Action["UPDATE"] = "UPDATE";
465
- /** Update and publish draft post. */
466
- Action["UPDATE_PUBLISH"] = "UPDATE_PUBLISH";
467
- /** Update and schedule draft post. */
468
- Action["UPDATE_SCHEDULE"] = "UPDATE_SCHEDULE";
469
- /** Update and revert to draft a published post. */
470
- Action["UPDATE_REVERT_TO_DRAFT"] = "UPDATE_REVERT_TO_DRAFT";
471
- /** Update draft and cancel post scheduling. */
472
- Action["UPDATE_CANCEL_SCHEDULE"] = "UPDATE_CANCEL_SCHEDULE";
473
- /** Update and reject draft post in moderation. */
474
- Action["UPDATE_REJECT"] = "UPDATE_REJECT";
475
- /** Update published draft post. */
476
- Action["UPDATE_PUBLICATION"] = "UPDATE_PUBLICATION";
477
- })(Action || (exports.Action = Action = {}));
478
- var GetDraftPostsSort;
479
- (function (GetDraftPostsSort) {
480
- /** Sorting by editing date descending. */
481
- GetDraftPostsSort["EDITING_DATE_DESC"] = "EDITING_DATE_DESC";
482
- /** Sorting by editing date ascending. */
483
- GetDraftPostsSort["EDITING_DATE_ASC"] = "EDITING_DATE_ASC";
484
- })(GetDraftPostsSort || (exports.GetDraftPostsSort = GetDraftPostsSort = {}));
485
- var SortOrder;
486
- (function (SortOrder) {
487
- SortOrder["ASC"] = "ASC";
488
- SortOrder["DESC"] = "DESC";
489
- })(SortOrder || (exports.SortOrder = SortOrder = {}));
490
- var TotalDraftPostsGroupingField;
491
- (function (TotalDraftPostsGroupingField) {
492
- /** Groups results by status. */
493
- TotalDraftPostsGroupingField["STATUS"] = "STATUS";
494
- /** Groups results by language. */
495
- TotalDraftPostsGroupingField["LANGUAGE"] = "LANGUAGE";
496
- })(TotalDraftPostsGroupingField || (exports.TotalDraftPostsGroupingField = TotalDraftPostsGroupingField = {}));
497
- const _bulkCreateDraftPostsRequest = { draftPosts: '_draftPost' };
498
- const _bulkCreateDraftPostsResponse = { results: '_bulkDraftPostResult' };
499
- const _bulkDeleteDraftPostsRequest = {};
500
- const _bulkDeleteDraftPostsResponse = { results: '_bulkDraftPostResult' };
501
- const _bulkDraftPostResult = { item: '_draftPost' };
502
- const _bulkUpdateDraftPostsRequest = { draftPosts: '_maskedDraftPosts' };
503
- const _bulkUpdateDraftPostsResponse = { results: '_bulkDraftPostResult' };
504
- const _coverMedia = { image: 'wix.common.Image', video: 'wix.common.Video' };
505
- const _createDraftPostRequest = { draftPost: '_draftPost' };
506
- const _createDraftPostResponse = { draftPost: '_draftPost' };
507
- const _deleteDraftPostRequest = {};
508
- const _deleteDraftPostResponse = {};
509
- const _draftPost = {
510
- heroImage: 'wix.common.Image',
511
- url: 'wix.common.PageUrl',
512
- coverMedia: '_coverMedia',
513
- richContent: '_richContent',
514
- media: '_media',
515
- translations: '_draftPostTranslation',
516
- };
517
- const _draftPostTranslation = { url: 'wix.common.PageUrl' };
518
- const _getDeletedDraftPostRequest = {};
519
- const _getDeletedDraftPostResponse = { draftPost: '_draftPost' };
520
- const _getDraftPostRequest = {};
521
- const _getDraftPostResponse = { draftPost: '_draftPost' };
522
- const _listDeletedDraftPostsRequest = {};
523
- const _listDeletedDraftPostsResponse = { draftPosts: '_draftPost' };
524
- const _listDraftPostsRequest = {};
525
- const _listDraftPostsResponse = { draftPosts: '_draftPost' };
526
- const _maskedDraftPosts = { draftPost: '_draftPost' };
527
- const _media = { wixMedia: '_wixMedia' };
528
- const _node = { nodes: '_node' };
529
- const _publishDraftPostRequest = {};
530
- const _publishDraftPostResponse = {};
531
- const _queryDraftPostsRequest = {};
532
- const _queryDraftPostsResponse = { draftPosts: '_draftPost' };
533
- const _removeFromTrashBinRequest = {};
534
- const _removeFromTrashBinResponse = {};
535
- const _restoreFromTrashBinRequest = {};
536
- const _restoreFromTrashBinResponse = { draftPost: '_draftPost' };
537
- const _richContent = { nodes: '_node' };
538
- const _updateDraftPostRequest = { draftPost: '_draftPost' };
539
- const _updateDraftPostResponse = { draftPost: '_draftPost' };
540
- const _wixMedia = { image: 'wix.common.Image', videoV2: 'wix.common.VideoV2' };
541
- exports.onDraftCreated = (0, sdk_types_1.EventDefinition)('wix.blog.v3.draft_created')();
542
- exports.onDraftUpdated = (0, sdk_types_1.EventDefinition)('wix.blog.v3.draft_updated')();
543
- exports.onDraftDeleted = (0, sdk_types_1.EventDefinition)('wix.blog.v3.draft_deleted')();
544
- /**
545
- * Creates a draft post.
546
- *
547
- * The draft post's `memberId` is required for third-party apps.
548
- * @param draftPost - Draft post to create.
549
- * @public
550
- * @requiredField draftPost
551
- * @requiredField draftPost.title
552
- * @param options - Options for creating a draft post.
553
- * @permissionScope Manage Blog
554
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
555
- * @applicableIdentity APP
556
- */
557
- function createDraftPost(draftPost, options) {
558
- var _a, _b, _c;
559
- return __awaiter(this, arguments, void 0, function* () {
560
- const requestTransformation = {
561
- draftPost: '$[0]',
562
- publish: '$[1].publish',
563
- fieldsets: '$[1].fieldsets',
564
- };
565
- const responseTransformation = '$';
566
- // @ts-ignore
567
- const { httpClient, sideEffects } = arguments[2];
568
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
569
- rootSchema: _createDraftPostRequest,
570
- depSchemas: {
571
- _coverMedia,
572
- _draftPost,
573
- _draftPostTranslation,
574
- _media,
575
- _node,
576
- _richContent,
577
- _wixMedia,
578
- },
579
- fqdnTransformation: {
580
- paths: [...['draftPost']],
581
- transformation: _fromVeloEntity,
582
- },
583
- customTransformation: requestTransformation,
584
- });
585
- const { fromJSON } = (0, velo_1.serializer)({
586
- rootSchema: _createDraftPostResponse,
587
- depSchemas: {
588
- _coverMedia,
589
- _draftPost,
590
- _draftPostTranslation,
591
- _media,
592
- _node,
593
- _richContent,
594
- _wixMedia,
595
- },
596
- fqdnTransformation: {
597
- paths: [...['draftPost']],
598
- transformation: _toVeloEntity,
599
- },
600
- customTransformation: responseTransformation,
601
- });
602
- const payload = toAmbassadorRequest([draftPost, options]);
603
- const reqOpts = ambassadorWixBlogV3Draft.createDraftPost(payload);
604
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
605
- try {
606
- const result = yield httpClient.request(reqOpts);
607
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
608
- return fromJSON(result.data);
609
- }
610
- catch (err) {
611
- const transformedError = (0, transform_error_1.transformError)(err, {
612
- spreadPathsToArguments: {},
613
- explicitPathsToArguments: {
614
- draftPost: '$[0]',
615
- publish: '$[1].publish',
616
- fieldsets: '$[1].fieldsets',
617
- },
618
- singleArgumentUnchanged: false,
619
- }, ['draftPost', 'options']);
620
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
621
- throw transformedError;
622
- }
623
- });
624
- }
625
- exports.createDraftPost = createDraftPost;
626
- /**
627
- * Creates multiple draft posts.
628
- * @param draftPosts - Draft posts to create.
629
- * @public
630
- * @documentationMaturity preview
631
- * @requiredField draftPosts
632
- * @requiredField draftPosts.title
633
- * @permissionScope Manage Blog
634
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
635
- * @permissionScope Manage Members
636
- * @permissionScopeId SCOPE.DC-MEMBERS.MANAGE-MEMBERS
637
- * @permissionScope Manage Bookings Services and Settings
638
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
639
- * @permissionScope Read Members and Contacts - all read permissions
640
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
641
- * @permissionScope Read Members
642
- * @permissionScopeId SCOPE.DC-MEMBERS.READ-MEMBERS
643
- * @permissionScope Manage Members and Contacts - all permissions
644
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
645
- * @applicableIdentity APP
646
- * @applicableIdentity MEMBER
647
- * @applicableIdentity VISITOR
648
- */
649
- function bulkCreateDraftPosts(draftPosts, options) {
650
- var _a, _b, _c;
651
- return __awaiter(this, arguments, void 0, function* () {
652
- const requestTransformation = {
653
- draftPosts: '$[0]',
654
- publish: '$[1].publish',
655
- returnFullEntity: '$[1].returnFullEntity',
656
- fieldsets: '$[1].fieldsets',
657
- };
658
- const responseTransformation = '$';
659
- // @ts-ignore
660
- const { httpClient, sideEffects } = arguments[2];
661
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
662
- rootSchema: _bulkCreateDraftPostsRequest,
663
- depSchemas: {
664
- _coverMedia,
665
- _draftPost,
666
- _draftPostTranslation,
667
- _media,
668
- _node,
669
- _richContent,
670
- _wixMedia,
671
- },
672
- fqdnTransformation: {
673
- paths: [...['Array#draftPosts']],
674
- transformation: _fromVeloEntity,
675
- },
676
- customTransformation: requestTransformation,
677
- });
678
- const { fromJSON } = (0, velo_1.serializer)({
679
- rootSchema: _bulkCreateDraftPostsResponse,
680
- depSchemas: {
681
- _bulkDraftPostResult,
682
- _coverMedia,
683
- _draftPost,
684
- _draftPostTranslation,
685
- _media,
686
- _node,
687
- _richContent,
688
- _wixMedia,
689
- },
690
- fqdnTransformation: {
691
- paths: [...['Array#results.item']],
692
- transformation: _toVeloEntity,
693
- },
694
- customTransformation: responseTransformation,
695
- });
696
- const payload = toAmbassadorRequest([draftPosts, options]);
697
- const reqOpts = ambassadorWixBlogV3Draft.bulkCreateDraftPosts(payload);
698
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
699
- try {
700
- const result = yield httpClient.request(reqOpts);
701
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
702
- return fromJSON(result.data);
703
- }
704
- catch (err) {
705
- const transformedError = (0, transform_error_1.transformError)(err, {
706
- spreadPathsToArguments: {},
707
- explicitPathsToArguments: {
708
- draftPosts: '$[0]',
709
- publish: '$[1].publish',
710
- returnFullEntity: '$[1].returnFullEntity',
711
- fieldsets: '$[1].fieldsets',
712
- },
713
- singleArgumentUnchanged: false,
714
- }, ['draftPosts', 'options']);
715
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
716
- throw transformedError;
717
- }
718
- });
719
- }
720
- exports.bulkCreateDraftPosts = bulkCreateDraftPosts;
721
- /**
722
- * Updates multiple draft posts.
723
- * @public
724
- * @requiredField options.draftPosts.draftPost
725
- * @requiredField options.draftPosts.draftPost._id
726
- * @param options - Options for updating multiple draft posts.
727
- * @permissionScope Manage Blog
728
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
729
- * @permissionScope Manage Members
730
- * @permissionScopeId SCOPE.DC-MEMBERS.MANAGE-MEMBERS
731
- * @permissionScope Manage Bookings Services and Settings
732
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
733
- * @permissionScope Read Members and Contacts - all read permissions
734
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
735
- * @permissionScope Read Members
736
- * @permissionScopeId SCOPE.DC-MEMBERS.READ-MEMBERS
737
- * @permissionScope Manage Members and Contacts - all permissions
738
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
739
- * @applicableIdentity APP
740
- * @applicableIdentity MEMBER
741
- * @applicableIdentity VISITOR
742
- */
743
- function bulkUpdateDraftPosts(options) {
744
- var _a, _b, _c;
745
- return __awaiter(this, arguments, void 0, function* () {
746
- const requestTransformation = {
747
- draftPosts: '$[0].draftPosts',
748
- action: '$[0].action',
749
- scheduledPublishDate: '$[0].scheduledPublishDate',
750
- returnFullEntity: '$[0].returnFullEntity',
751
- fieldsets: '$[0].fieldsets',
752
- };
753
- const responseTransformation = '$';
754
- // @ts-ignore
755
- const { httpClient, sideEffects } = arguments[1];
756
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
757
- rootSchema: _bulkUpdateDraftPostsRequest,
758
- depSchemas: {
759
- _coverMedia,
760
- _draftPost,
761
- _draftPostTranslation,
762
- _maskedDraftPosts,
763
- _media,
764
- _node,
765
- _richContent,
766
- _wixMedia,
767
- },
768
- fqdnTransformation: {
769
- paths: [...['Array#draftPosts.draftPost']],
770
- transformation: _fromVeloEntity,
771
- },
772
- customTransformation: requestTransformation,
773
- });
774
- const { fromJSON } = (0, velo_1.serializer)({
775
- rootSchema: _bulkUpdateDraftPostsResponse,
776
- depSchemas: {
777
- _bulkDraftPostResult,
778
- _coverMedia,
779
- _draftPost,
780
- _draftPostTranslation,
781
- _media,
782
- _node,
783
- _richContent,
784
- _wixMedia,
785
- },
786
- fqdnTransformation: {
787
- paths: [...['Array#results.item']],
788
- transformation: _toVeloEntity,
789
- },
790
- customTransformation: responseTransformation,
791
- });
792
- const payload = toAmbassadorRequest([options]);
793
- const reqOpts = ambassadorWixBlogV3Draft.bulkUpdateDraftPosts(payload);
794
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
795
- try {
796
- const result = yield httpClient.request(reqOpts);
797
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
798
- return fromJSON(result.data);
799
- }
800
- catch (err) {
801
- const transformedError = (0, transform_error_1.transformError)(err, {
802
- spreadPathsToArguments: {},
803
- explicitPathsToArguments: {
804
- draftPosts: '$[0].draftPosts',
805
- action: '$[0].action',
806
- scheduledPublishDate: '$[0].scheduledPublishDate',
807
- returnFullEntity: '$[0].returnFullEntity',
808
- fieldsets: '$[0].fieldsets',
809
- },
810
- singleArgumentUnchanged: false,
811
- }, ['options']);
812
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
813
- throw transformedError;
814
- }
815
- });
816
- }
817
- exports.bulkUpdateDraftPosts = bulkUpdateDraftPosts;
818
- /**
819
- * Retrieves a list of up to 100 deleted draft posts.
820
- *
821
- * List Deleted Draft Posts runs with these defaults, which you can override:
822
- * - `editedDate` is sorted in descending order. In this case,`editedDate` implies the date the post was deleted.
823
- * - `paging.limit` is `50`.
824
- * - `paging.offset` is `0`.
825
- * @public
826
- * @param options - Options for listing deleted draft posts.
827
- * @permissionScope Manage Blog
828
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
829
- * @applicableIdentity APP
830
- */
831
- function listDeletedDraftPosts(options) {
832
- var _a, _b, _c;
833
- return __awaiter(this, arguments, void 0, function* () {
834
- const requestTransformation = {
835
- language: '$[0].language',
836
- sort: '$[0].sort',
837
- paging: '$[0].paging',
838
- fieldsets: '$[0].fieldsets',
839
- draftPostIds: '$[0].draftPostIds',
840
- };
841
- const responseTransformation = '$';
842
- // @ts-ignore
843
- const { httpClient, sideEffects } = arguments[1];
844
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
845
- rootSchema: _listDeletedDraftPostsRequest,
846
- depSchemas: {},
847
- fqdnTransformation: {
848
- paths: [],
849
- transformation: _fromVeloEntity,
850
- },
851
- customTransformation: requestTransformation,
852
- });
853
- const { fromJSON } = (0, velo_1.serializer)({
854
- rootSchema: _listDeletedDraftPostsResponse,
855
- depSchemas: {
856
- _coverMedia,
857
- _draftPost,
858
- _draftPostTranslation,
859
- _media,
860
- _node,
861
- _richContent,
862
- _wixMedia,
863
- },
864
- fqdnTransformation: {
865
- paths: [...['Array#draftPosts']],
866
- transformation: _toVeloEntity,
867
- },
868
- customTransformation: responseTransformation,
869
- });
870
- const payload = toAmbassadorRequest([options]);
871
- const reqOpts = ambassadorWixBlogV3Draft.listDeletedDraftPosts(payload);
872
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
873
- try {
874
- const result = yield httpClient.request(reqOpts);
875
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
876
- return fromJSON(result.data);
877
- }
878
- catch (err) {
879
- const transformedError = (0, transform_error_1.transformError)(err, {
880
- spreadPathsToArguments: {},
881
- explicitPathsToArguments: {
882
- language: '$[0].language',
883
- sort: '$[0].sort',
884
- paging: '$[0].paging',
885
- fieldsets: '$[0].fieldsets',
886
- draftPostIds: '$[0].draftPostIds',
887
- },
888
- singleArgumentUnchanged: false,
889
- }, ['options']);
890
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
891
- throw transformedError;
892
- }
893
- });
894
- }
895
- exports.listDeletedDraftPosts = listDeletedDraftPosts;
896
- /**
897
- * Gets a draft post by the provided ID.
898
- *
899
- * Uses the provided `draftPostId` to retrieve a draft post.
900
- * @param draftPostId - Draft post ID.
901
- * @public
902
- * @requiredField draftPostId
903
- * @param options - Options for getting a draft post.
904
- * @permissionScope Manage Blog
905
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
906
- * @applicableIdentity APP
907
- */
908
- function getDraftPost(draftPostId, options) {
909
- var _a, _b, _c;
910
- return __awaiter(this, arguments, void 0, function* () {
911
- const requestTransformation = {
912
- draftPostId: '$[0]',
913
- fieldsets: '$[1].fieldsets',
914
- };
915
- const responseTransformation = '$';
916
- // @ts-ignore
917
- const { httpClient, sideEffects } = arguments[2];
918
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
919
- rootSchema: _getDraftPostRequest,
920
- depSchemas: {},
921
- fqdnTransformation: {
922
- paths: [],
923
- transformation: _fromVeloEntity,
924
- },
925
- customTransformation: requestTransformation,
926
- });
927
- const { fromJSON } = (0, velo_1.serializer)({
928
- rootSchema: _getDraftPostResponse,
929
- depSchemas: {
930
- _coverMedia,
931
- _draftPost,
932
- _draftPostTranslation,
933
- _media,
934
- _node,
935
- _richContent,
936
- _wixMedia,
937
- },
938
- fqdnTransformation: {
939
- paths: [...['draftPost']],
940
- transformation: _toVeloEntity,
941
- },
942
- customTransformation: responseTransformation,
943
- });
944
- const payload = toAmbassadorRequest([draftPostId, options]);
945
- const reqOpts = ambassadorWixBlogV3Draft.getDraftPost(payload);
946
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
947
- try {
948
- const result = yield httpClient.request(reqOpts);
949
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
950
- return fromJSON(result.data);
951
- }
952
- catch (err) {
953
- const transformedError = (0, transform_error_1.transformError)(err, {
954
- spreadPathsToArguments: {},
955
- explicitPathsToArguments: {
956
- draftPostId: '$[0]',
957
- fieldsets: '$[1].fieldsets',
958
- },
959
- singleArgumentUnchanged: false,
960
- }, ['draftPostId', 'options']);
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.getDraftPost = getDraftPost;
967
- /**
968
- * Updates a specified draft post.
969
- * @param _id - Draft post ID.
970
- * @public
971
- * @requiredField _id
972
- * @requiredField draftPost
973
- * @param options - Options for updating a draft post.
974
- * @param draftPost - Draft Post info.
975
- * @permissionScope Manage Blog
976
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
977
- * @permissionScope Manage Members
978
- * @permissionScopeId SCOPE.DC-MEMBERS.MANAGE-MEMBERS
979
- * @permissionScope Manage Bookings Services and Settings
980
- * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION
981
- * @permissionScope Read Members and Contacts - all read permissions
982
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
983
- * @permissionScope Read Members
984
- * @permissionScopeId SCOPE.DC-MEMBERS.READ-MEMBERS
985
- * @permissionScope Manage Members and Contacts - all permissions
986
- * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
987
- * @applicableIdentity APP
988
- * @applicableIdentity MEMBER
989
- * @applicableIdentity VISITOR
990
- */
991
- function updateDraftPost(_id, draftPost, options) {
992
- var _a, _b, _c;
993
- return __awaiter(this, arguments, void 0, function* () {
994
- const requestTransformation = {
995
- draftPost: { '*': '$[1]', id: '$[0]' },
996
- action: '$[2].action',
997
- scheduledPublishDate: '$[2].scheduledPublishDate',
998
- fieldsets: '$[2].fieldsets',
999
- };
1000
- const responseTransformation = '$';
1001
- // @ts-ignore
1002
- const { httpClient, sideEffects } = arguments[3];
1003
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1004
- rootSchema: _updateDraftPostRequest,
1005
- depSchemas: {
1006
- _coverMedia,
1007
- _draftPost,
1008
- _draftPostTranslation,
1009
- _media,
1010
- _node,
1011
- _richContent,
1012
- _wixMedia,
1013
- },
1014
- fqdnTransformation: {
1015
- paths: [...['draftPost']],
1016
- transformation: _fromVeloEntity,
1017
- },
1018
- customTransformation: requestTransformation,
1019
- });
1020
- const { fromJSON } = (0, velo_1.serializer)({
1021
- rootSchema: _updateDraftPostResponse,
1022
- depSchemas: {
1023
- _coverMedia,
1024
- _draftPost,
1025
- _draftPostTranslation,
1026
- _media,
1027
- _node,
1028
- _richContent,
1029
- _wixMedia,
1030
- },
1031
- fqdnTransformation: {
1032
- paths: [...['draftPost']],
1033
- transformation: _toVeloEntity,
1034
- },
1035
- customTransformation: responseTransformation,
1036
- });
1037
- const payload = toAmbassadorRequest([_id, draftPost, options]);
1038
- const reqOpts = ambassadorWixBlogV3Draft.updateDraftPost(payload);
1039
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1040
- try {
1041
- const result = yield httpClient.request(reqOpts);
1042
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1043
- return fromJSON(result.data);
1044
- }
1045
- catch (err) {
1046
- const transformedError = (0, transform_error_1.transformError)(err, {
1047
- spreadPathsToArguments: { draftPost: '$[1]' },
1048
- explicitPathsToArguments: {
1049
- 'draftPost.id': '$[0]',
1050
- action: '$[2].action',
1051
- scheduledPublishDate: '$[2].scheduledPublishDate',
1052
- fieldsets: '$[2].fieldsets',
1053
- },
1054
- singleArgumentUnchanged: false,
1055
- }, ['_id', 'draftPost', 'options']);
1056
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1057
- throw transformedError;
1058
- }
1059
- });
1060
- }
1061
- exports.updateDraftPost = updateDraftPost;
1062
- /**
1063
- * Moves a draft post with the provided ID to the trash bin.
1064
- * A published post can also be deleted by its provided `draftPostId`.
1065
- *
1066
- * The optional `permanent` field enables you to delete a post permanently, bypassing the trash bin. When a draft post is deleted this way, it can't be restored.
1067
- * @param draftPostId - Draft post ID.
1068
- * @public
1069
- * @requiredField draftPostId
1070
- * @param options - Options for deleting a draft post.
1071
- * @permissionScope Manage Blog
1072
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1073
- * @applicableIdentity APP
1074
- */
1075
- function deleteDraftPost(draftPostId, options) {
1076
- var _a, _b, _c;
1077
- return __awaiter(this, arguments, void 0, function* () {
1078
- const requestTransformation = {
1079
- draftPostId: '$[0]',
1080
- permanent: '$[1].permanent',
1081
- };
1082
- const responseTransformation = '$';
1083
- // @ts-ignore
1084
- const { httpClient, sideEffects } = arguments[2];
1085
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1086
- rootSchema: _deleteDraftPostRequest,
1087
- depSchemas: {},
1088
- fqdnTransformation: {
1089
- paths: [],
1090
- transformation: _fromVeloEntity,
1091
- },
1092
- customTransformation: requestTransformation,
1093
- });
1094
- const { fromJSON } = (0, velo_1.serializer)({
1095
- rootSchema: _deleteDraftPostResponse,
1096
- depSchemas: {},
1097
- fqdnTransformation: {
1098
- paths: [],
1099
- transformation: _toVeloEntity,
1100
- },
1101
- customTransformation: responseTransformation,
1102
- });
1103
- const payload = toAmbassadorRequest([draftPostId, options]);
1104
- const reqOpts = ambassadorWixBlogV3Draft.deleteDraftPost(payload);
1105
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1106
- try {
1107
- const result = yield httpClient.request(reqOpts);
1108
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1109
- }
1110
- catch (err) {
1111
- const transformedError = (0, transform_error_1.transformError)(err, {
1112
- spreadPathsToArguments: {},
1113
- explicitPathsToArguments: {
1114
- draftPostId: '$[0]',
1115
- permanent: '$[1].permanent',
1116
- },
1117
- singleArgumentUnchanged: false,
1118
- }, ['draftPostId', 'options']);
1119
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1120
- throw transformedError;
1121
- }
1122
- });
1123
- }
1124
- exports.deleteDraftPost = deleteDraftPost;
1125
- /**
1126
- * Permanently deletes a draft post by the provided ID from the trash bin.
1127
- *
1128
- * Uses the provided `draftPostId` to permanently delete a draft post from the trash bin. This action is permanent and cannot be reversed.
1129
- * @param draftPostId - Draft post ID.
1130
- * @public
1131
- * @requiredField draftPostId
1132
- * @permissionScope Manage Blog
1133
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1134
- * @applicableIdentity APP
1135
- */
1136
- function removeFromTrashBin(draftPostId) {
1137
- var _a, _b, _c;
1138
- return __awaiter(this, arguments, void 0, function* () {
1139
- const requestTransformation = { draftPostId: '$[0]' };
1140
- const responseTransformation = '$';
1141
- // @ts-ignore
1142
- const { httpClient, sideEffects } = arguments[1];
1143
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1144
- rootSchema: _removeFromTrashBinRequest,
1145
- depSchemas: {},
1146
- fqdnTransformation: {
1147
- paths: [],
1148
- transformation: _fromVeloEntity,
1149
- },
1150
- customTransformation: requestTransformation,
1151
- });
1152
- const { fromJSON } = (0, velo_1.serializer)({
1153
- rootSchema: _removeFromTrashBinResponse,
1154
- depSchemas: {},
1155
- fqdnTransformation: {
1156
- paths: [],
1157
- transformation: _toVeloEntity,
1158
- },
1159
- customTransformation: responseTransformation,
1160
- });
1161
- const payload = toAmbassadorRequest([draftPostId]);
1162
- const reqOpts = ambassadorWixBlogV3Draft.removeFromTrashBin(payload);
1163
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1164
- try {
1165
- const result = yield httpClient.request(reqOpts);
1166
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1167
- }
1168
- catch (err) {
1169
- const transformedError = (0, transform_error_1.transformError)(err, {
1170
- spreadPathsToArguments: {},
1171
- explicitPathsToArguments: { draftPostId: '$[0]' },
1172
- singleArgumentUnchanged: false,
1173
- }, ['draftPostId']);
1174
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1175
- throw transformedError;
1176
- }
1177
- });
1178
- }
1179
- exports.removeFromTrashBin = removeFromTrashBin;
1180
- /**
1181
- * Bulk Deletes draft posts with the provided IDs.
1182
- * @param postIds - Post IDs.
1183
- * @public
1184
- * @documentationMaturity preview
1185
- * @requiredField postIds
1186
- * @permissionScope Manage Blog
1187
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1188
- * @applicableIdentity APP
1189
- */
1190
- function bulkDeleteDraftPosts(postIds, options) {
1191
- var _a, _b, _c;
1192
- return __awaiter(this, arguments, void 0, function* () {
1193
- const requestTransformation = {
1194
- postIds: '$[0]',
1195
- permanent: '$[1].permanent',
1196
- };
1197
- const responseTransformation = '$';
1198
- // @ts-ignore
1199
- const { httpClient, sideEffects } = arguments[2];
1200
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1201
- rootSchema: _bulkDeleteDraftPostsRequest,
1202
- depSchemas: {},
1203
- fqdnTransformation: {
1204
- paths: [],
1205
- transformation: _fromVeloEntity,
1206
- },
1207
- customTransformation: requestTransformation,
1208
- });
1209
- const { fromJSON } = (0, velo_1.serializer)({
1210
- rootSchema: _bulkDeleteDraftPostsResponse,
1211
- depSchemas: {
1212
- _bulkDraftPostResult,
1213
- _coverMedia,
1214
- _draftPost,
1215
- _draftPostTranslation,
1216
- _media,
1217
- _node,
1218
- _richContent,
1219
- _wixMedia,
1220
- },
1221
- fqdnTransformation: {
1222
- paths: [...['Array#results.item']],
1223
- transformation: _toVeloEntity,
1224
- },
1225
- customTransformation: responseTransformation,
1226
- });
1227
- const payload = toAmbassadorRequest([postIds, options]);
1228
- const reqOpts = ambassadorWixBlogV3Draft.bulkDeleteDraftPosts(payload);
1229
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1230
- try {
1231
- const result = yield httpClient.request(reqOpts);
1232
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1233
- return fromJSON(result.data);
1234
- }
1235
- catch (err) {
1236
- const transformedError = (0, transform_error_1.transformError)(err, {
1237
- spreadPathsToArguments: {},
1238
- explicitPathsToArguments: {
1239
- postIds: '$[0]',
1240
- permanent: '$[1].permanent',
1241
- },
1242
- singleArgumentUnchanged: false,
1243
- }, ['postIds', 'options']);
1244
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1245
- throw transformedError;
1246
- }
1247
- });
1248
- }
1249
- exports.bulkDeleteDraftPosts = bulkDeleteDraftPosts;
1250
- /**
1251
- * Retrieves a list of up to 100 draft posts per request.
1252
- *
1253
- * List Draft Posts runs with these defaults, which you can override:
1254
- * - `editedDate` is sorted in descending order.
1255
- * - `paging.limit` is `50`.
1256
- * - `paging.offset` is `0`.
1257
- * @public
1258
- * @param options - Options for listing multiple draft posts.
1259
- * @permissionScope Manage Blog
1260
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1261
- * @applicableIdentity APP
1262
- */
1263
- function listDraftPosts(options) {
1264
- var _a, _b, _c;
1265
- return __awaiter(this, arguments, void 0, function* () {
1266
- const requestTransformation = {
1267
- status: '$[0].status',
1268
- language: '$[0].language',
1269
- sort: '$[0].sort',
1270
- paging: '$[0].paging',
1271
- fieldsets: '$[0].fieldsets',
1272
- };
1273
- const responseTransformation = '$';
1274
- // @ts-ignore
1275
- const { httpClient, sideEffects } = arguments[1];
1276
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1277
- rootSchema: _listDraftPostsRequest,
1278
- depSchemas: {},
1279
- fqdnTransformation: {
1280
- paths: [],
1281
- transformation: _fromVeloEntity,
1282
- },
1283
- customTransformation: requestTransformation,
1284
- });
1285
- const { fromJSON } = (0, velo_1.serializer)({
1286
- rootSchema: _listDraftPostsResponse,
1287
- depSchemas: {
1288
- _coverMedia,
1289
- _draftPost,
1290
- _draftPostTranslation,
1291
- _media,
1292
- _node,
1293
- _richContent,
1294
- _wixMedia,
1295
- },
1296
- fqdnTransformation: {
1297
- paths: [...['Array#draftPosts']],
1298
- transformation: _toVeloEntity,
1299
- },
1300
- customTransformation: responseTransformation,
1301
- });
1302
- const payload = toAmbassadorRequest([options]);
1303
- const reqOpts = ambassadorWixBlogV3Draft.listDraftPosts(payload);
1304
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1305
- try {
1306
- const result = yield httpClient.request(reqOpts);
1307
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1308
- return fromJSON(result.data);
1309
- }
1310
- catch (err) {
1311
- const transformedError = (0, transform_error_1.transformError)(err, {
1312
- spreadPathsToArguments: {},
1313
- explicitPathsToArguments: {
1314
- status: '$[0].status',
1315
- language: '$[0].language',
1316
- sort: '$[0].sort',
1317
- paging: '$[0].paging',
1318
- fieldsets: '$[0].fieldsets',
1319
- },
1320
- singleArgumentUnchanged: false,
1321
- }, ['options']);
1322
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1323
- throw transformedError;
1324
- }
1325
- });
1326
- }
1327
- exports.listDraftPosts = listDraftPosts;
1328
- /**
1329
- * Gets a deleted draft post from the trash bin by the provided ID.
1330
- *
1331
- * Uses the provided `draftPostId` to retrieve a previously deleted draft post from the trash bin.
1332
- * @param draftPostId - Draft post ID.
1333
- * @public
1334
- * @requiredField draftPostId
1335
- * @permissionScope Manage Blog
1336
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1337
- * @applicableIdentity APP
1338
- */
1339
- function getDeletedDraftPost(draftPostId) {
1340
- var _a, _b, _c;
1341
- return __awaiter(this, arguments, void 0, function* () {
1342
- const requestTransformation = { draftPostId: '$[0]' };
1343
- const responseTransformation = '$';
1344
- // @ts-ignore
1345
- const { httpClient, sideEffects } = arguments[1];
1346
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1347
- rootSchema: _getDeletedDraftPostRequest,
1348
- depSchemas: {},
1349
- fqdnTransformation: {
1350
- paths: [],
1351
- transformation: _fromVeloEntity,
1352
- },
1353
- customTransformation: requestTransformation,
1354
- });
1355
- const { fromJSON } = (0, velo_1.serializer)({
1356
- rootSchema: _getDeletedDraftPostResponse,
1357
- depSchemas: {
1358
- _coverMedia,
1359
- _draftPost,
1360
- _draftPostTranslation,
1361
- _media,
1362
- _node,
1363
- _richContent,
1364
- _wixMedia,
1365
- },
1366
- fqdnTransformation: {
1367
- paths: [...['draftPost']],
1368
- transformation: _toVeloEntity,
1369
- },
1370
- customTransformation: responseTransformation,
1371
- });
1372
- const payload = toAmbassadorRequest([draftPostId]);
1373
- const reqOpts = ambassadorWixBlogV3Draft.getDeletedDraftPost(payload);
1374
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1375
- try {
1376
- const result = yield httpClient.request(reqOpts);
1377
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1378
- return fromJSON(result.data);
1379
- }
1380
- catch (err) {
1381
- const transformedError = (0, transform_error_1.transformError)(err, {
1382
- spreadPathsToArguments: {},
1383
- explicitPathsToArguments: { draftPostId: '$[0]' },
1384
- singleArgumentUnchanged: false,
1385
- }, ['draftPostId']);
1386
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1387
- throw transformedError;
1388
- }
1389
- });
1390
- }
1391
- exports.getDeletedDraftPost = getDeletedDraftPost;
1392
- /**
1393
- * Restores a deleted draft post from the trash bin by the provided ID.
1394
- *
1395
- * Uses the `draftPostId` to restore a deleted draft post from the trash bin.
1396
- * @param draftPostId - Draft post ID.
1397
- * @public
1398
- * @requiredField draftPostId
1399
- * @permissionScope Manage Blog
1400
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1401
- * @applicableIdentity APP
1402
- */
1403
- function restoreFromTrashBin(draftPostId) {
1404
- var _a, _b, _c;
1405
- return __awaiter(this, arguments, void 0, function* () {
1406
- const requestTransformation = { draftPostId: '$[0]' };
1407
- const responseTransformation = '$';
1408
- // @ts-ignore
1409
- const { httpClient, sideEffects } = arguments[1];
1410
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1411
- rootSchema: _restoreFromTrashBinRequest,
1412
- depSchemas: {},
1413
- fqdnTransformation: {
1414
- paths: [],
1415
- transformation: _fromVeloEntity,
1416
- },
1417
- customTransformation: requestTransformation,
1418
- });
1419
- const { fromJSON } = (0, velo_1.serializer)({
1420
- rootSchema: _restoreFromTrashBinResponse,
1421
- depSchemas: {
1422
- _coverMedia,
1423
- _draftPost,
1424
- _draftPostTranslation,
1425
- _media,
1426
- _node,
1427
- _richContent,
1428
- _wixMedia,
1429
- },
1430
- fqdnTransformation: {
1431
- paths: [...['draftPost']],
1432
- transformation: _toVeloEntity,
1433
- },
1434
- customTransformation: responseTransformation,
1435
- });
1436
- const payload = toAmbassadorRequest([draftPostId]);
1437
- const reqOpts = ambassadorWixBlogV3Draft.restoreFromTrashBin(payload);
1438
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1439
- try {
1440
- const result = yield httpClient.request(reqOpts);
1441
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1442
- return fromJSON(result.data);
1443
- }
1444
- catch (err) {
1445
- const transformedError = (0, transform_error_1.transformError)(err, {
1446
- spreadPathsToArguments: {},
1447
- explicitPathsToArguments: { draftPostId: '$[0]' },
1448
- singleArgumentUnchanged: false,
1449
- }, ['draftPostId']);
1450
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1451
- throw transformedError;
1452
- }
1453
- });
1454
- }
1455
- exports.restoreFromTrashBin = restoreFromTrashBin;
1456
- /**
1457
- * Retrieves a list of up to 100 draft posts, given the provided paging, filtering, and sorting.
1458
- *
1459
- * Query Draft Posts runs with these defaults, which you can override:
1460
- * - `editedDate` is sorted in `DESC` order.
1461
- * - `paging.limit` is `50`.
1462
- * - `paging.offset` is `0`.
1463
- * @public
1464
- * @param options - Options for querying draft posts.
1465
- * @permissionScope Manage Blog
1466
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1467
- * @applicableIdentity APP
1468
- */
1469
- function queryDraftPosts(options) {
1470
- const requestTransformation = { '*': '$[1]', query: '$[0]' };
1471
- const responseTransformation = {
1472
- items: '$.draftPosts',
1473
- pagingMetadata: '$.pagingMetadata',
1474
- };
1475
- // @ts-ignore
1476
- const { httpClient, sideEffects } = arguments[1];
1477
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1478
- rootSchema: _queryDraftPostsRequest,
1479
- depSchemas: {},
1480
- fqdnTransformation: {
1481
- paths: [],
1482
- transformation: _fromVeloEntity,
1483
- },
1484
- customTransformation: requestTransformation,
1485
- });
1486
- const { fromJSON } = (0, velo_1.serializer)({
1487
- rootSchema: _queryDraftPostsResponse,
1488
- depSchemas: {
1489
- _coverMedia,
1490
- _draftPost,
1491
- _draftPostTranslation,
1492
- _media,
1493
- _node,
1494
- _richContent,
1495
- _wixMedia,
1496
- },
1497
- fqdnTransformation: {
1498
- paths: [...['Array#draftPosts']],
1499
- transformation: _toVeloEntity,
1500
- },
1501
- customTransformation: responseTransformation,
1502
- });
1503
- return (0, motion_edm_autogen_query_wrapper_1.wrapWithQueryBuilder)({
1504
- func: (payload) => __awaiter(this, void 0, void 0, function* () {
1505
- var _a, _b, _c;
1506
- const reqOpts = ambassadorWixBlogV3Draft.queryDraftPosts(Object.assign(Object.assign({}, payload), (options !== null && options !== void 0 ? options : {})));
1507
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1508
- try {
1509
- const result = yield httpClient.request(reqOpts);
1510
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1511
- return result;
1512
- }
1513
- catch (err) {
1514
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1515
- throw err;
1516
- }
1517
- }),
1518
- requestTransformer: (...args) => toAmbassadorRequest(args),
1519
- responseTransformer: ({ data }) => fromJSON(data),
1520
- errorTransformer: (err) => {
1521
- const transformedError = (0, velo_1.transformError)(err, requestTransformation);
1522
- throw transformedError;
1523
- },
1524
- pagingMethod: 'CURSOR',
1525
- transformationPaths: (0, velo_1.resolveQueryFieldsTransformationPaths)(_toVeloEntity),
1526
- })({ cursorWithEmptyFilterAndSort: true });
1527
- }
1528
- exports.queryDraftPosts = queryDraftPosts;
1529
- /**
1530
- * Publishes a specified draft post by ID. This creates a new post entity with the data from the draft post.
1531
- *
1532
- * If the specified draft post was already published, the published post will be updated with the latest values from the draft post entity.
1533
- * @param draftPostId - Draft post ID.
1534
- * @public
1535
- * @requiredField draftPostId
1536
- * @permissionScope Manage Blog
1537
- * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
1538
- * @applicableIdentity APP
1539
- */
1540
- function publishDraftPost(draftPostId) {
1541
- var _a, _b, _c;
1542
- return __awaiter(this, arguments, void 0, function* () {
1543
- const requestTransformation = { draftPostId: '$[0]' };
1544
- const responseTransformation = '$';
1545
- // @ts-ignore
1546
- const { httpClient, sideEffects } = arguments[1];
1547
- const { toAmbassadorRequest } = (0, velo_1.serializer)({
1548
- rootSchema: _publishDraftPostRequest,
1549
- depSchemas: {},
1550
- fqdnTransformation: {
1551
- paths: [],
1552
- transformation: _fromVeloEntity,
1553
- },
1554
- customTransformation: requestTransformation,
1555
- });
1556
- const { fromJSON } = (0, velo_1.serializer)({
1557
- rootSchema: _publishDraftPostResponse,
1558
- depSchemas: {},
1559
- fqdnTransformation: {
1560
- paths: [],
1561
- transformation: _toVeloEntity,
1562
- },
1563
- customTransformation: responseTransformation,
1564
- });
1565
- const payload = toAmbassadorRequest([draftPostId]);
1566
- const reqOpts = ambassadorWixBlogV3Draft.publishDraftPost(payload);
1567
- (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
1568
- try {
1569
- const result = yield httpClient.request(reqOpts);
1570
- (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
1571
- return fromJSON(result.data);
1572
- }
1573
- catch (err) {
1574
- const transformedError = (0, transform_error_1.transformError)(err, {
1575
- spreadPathsToArguments: {},
1576
- explicitPathsToArguments: { draftPostId: '$[0]' },
1577
- singleArgumentUnchanged: false,
1578
- }, ['draftPostId']);
1579
- (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
1580
- throw transformedError;
1581
- }
1582
- });
1583
- }
1584
- exports.publishDraftPost = publishDraftPost;
1585
- //# sourceMappingURL=blog-v3-draft.universal.js.map