@wix/auto_sdk_blog_likes 1.0.0

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 (39) hide show
  1. package/build/cjs/index.d.ts +64 -0
  2. package/build/cjs/index.js +517 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +629 -0
  5. package/build/cjs/index.typings.js +413 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +440 -0
  8. package/build/cjs/meta.js +333 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/es/index.d.mts +64 -0
  11. package/build/es/index.mjs +485 -0
  12. package/build/es/index.mjs.map +1 -0
  13. package/build/es/index.typings.d.mts +629 -0
  14. package/build/es/index.typings.mjs +382 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/es/meta.d.mts +440 -0
  17. package/build/es/meta.mjs +300 -0
  18. package/build/es/meta.mjs.map +1 -0
  19. package/build/es/package.json +3 -0
  20. package/build/internal/cjs/index.d.ts +64 -0
  21. package/build/internal/cjs/index.js +517 -0
  22. package/build/internal/cjs/index.js.map +1 -0
  23. package/build/internal/cjs/index.typings.d.ts +629 -0
  24. package/build/internal/cjs/index.typings.js +413 -0
  25. package/build/internal/cjs/index.typings.js.map +1 -0
  26. package/build/internal/cjs/meta.d.ts +440 -0
  27. package/build/internal/cjs/meta.js +333 -0
  28. package/build/internal/cjs/meta.js.map +1 -0
  29. package/build/internal/es/index.d.mts +64 -0
  30. package/build/internal/es/index.mjs +485 -0
  31. package/build/internal/es/index.mjs.map +1 -0
  32. package/build/internal/es/index.typings.d.mts +629 -0
  33. package/build/internal/es/index.typings.mjs +382 -0
  34. package/build/internal/es/index.typings.mjs.map +1 -0
  35. package/build/internal/es/meta.d.mts +440 -0
  36. package/build/internal/es/meta.mjs +300 -0
  37. package/build/internal/es/meta.mjs.map +1 -0
  38. package/meta/package.json +3 -0
  39. package/package.json +54 -0
@@ -0,0 +1,413 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.typings.ts
21
+ var index_typings_exports = {};
22
+ __export(index_typings_exports, {
23
+ SortOrder: () => SortOrder,
24
+ WebhookIdentityType: () => WebhookIdentityType,
25
+ createLike: () => createLike2,
26
+ deleteLike: () => deleteLike2,
27
+ deleteLikeByFqdnAndEntityId: () => deleteLikeByFqdnAndEntityId2,
28
+ getLike: () => getLike2,
29
+ queryLikes: () => queryLikes2,
30
+ typedQueryLikes: () => typedQueryLikes
31
+ });
32
+ module.exports = __toCommonJS(index_typings_exports);
33
+
34
+ // src/blog-v1-like-likes.universal.ts
35
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
36
+ var import_query_builder = require("@wix/sdk-runtime/query-builder");
37
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
38
+
39
+ // src/blog-v1-like-likes.http.ts
40
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
41
+ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
42
+ var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
43
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
44
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
45
+ function resolveWixBlogV1LikeServiceUrl(opts) {
46
+ const domainToMappings = {
47
+ _: [
48
+ {
49
+ srcPath: "/_api/blog-like-service",
50
+ destPath: ""
51
+ }
52
+ ],
53
+ "api._api_base_domain_": [
54
+ {
55
+ srcPath: "/blog-like-service",
56
+ destPath: ""
57
+ }
58
+ ],
59
+ "social-blog._base_domain_": [
60
+ {
61
+ srcPath: "/_api/blog-like-service",
62
+ destPath: ""
63
+ }
64
+ ],
65
+ "manage._base_domain_": [
66
+ {
67
+ srcPath: "/_api/blog-like-service",
68
+ destPath: ""
69
+ }
70
+ ],
71
+ "apps._base_domain_": [
72
+ {
73
+ srcPath: "/_api/blog-like-service",
74
+ destPath: ""
75
+ }
76
+ ],
77
+ "www.wixapis.com": [
78
+ {
79
+ srcPath: "/blog/v1/likes",
80
+ destPath: "/v1/likes"
81
+ }
82
+ ],
83
+ "*.dev.wix-code.com": [
84
+ {
85
+ srcPath: "/blog/v1/likes",
86
+ destPath: "/v1/likes"
87
+ }
88
+ ]
89
+ };
90
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
91
+ }
92
+ var PACKAGE_NAME = "@wix/auto_sdk_blog_likes";
93
+ function createLike(payload) {
94
+ function __createLike({ host }) {
95
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
96
+ {
97
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
98
+ paths: [{ path: "like.createdDate" }]
99
+ }
100
+ ]);
101
+ const metadata = {
102
+ entityFqdn: "wix.blog.v1.like",
103
+ method: "POST",
104
+ methodFqn: "wix.blog.v1.LikeService.CreateLike",
105
+ packageName: PACKAGE_NAME,
106
+ migrationOptions: {
107
+ optInTransformResponse: true
108
+ },
109
+ url: resolveWixBlogV1LikeServiceUrl({
110
+ protoPath: "/v1/likes",
111
+ data: serializedData,
112
+ host
113
+ }),
114
+ data: serializedData,
115
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
116
+ {
117
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
118
+ paths: [{ path: "like.createdDate" }]
119
+ }
120
+ ])
121
+ };
122
+ return metadata;
123
+ }
124
+ return __createLike;
125
+ }
126
+ function getLike(payload) {
127
+ function __getLike({ host }) {
128
+ const metadata = {
129
+ entityFqdn: "wix.blog.v1.like",
130
+ method: "GET",
131
+ methodFqn: "wix.blog.v1.LikeService.GetLike",
132
+ packageName: PACKAGE_NAME,
133
+ migrationOptions: {
134
+ optInTransformResponse: true
135
+ },
136
+ url: resolveWixBlogV1LikeServiceUrl({
137
+ protoPath: "/v1/likes/{likeId}",
138
+ data: payload,
139
+ host
140
+ }),
141
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
142
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
143
+ {
144
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
145
+ paths: [{ path: "like.createdDate" }]
146
+ }
147
+ ])
148
+ };
149
+ return metadata;
150
+ }
151
+ return __getLike;
152
+ }
153
+ function queryLikes(payload) {
154
+ function __queryLikes({ host }) {
155
+ const metadata = {
156
+ entityFqdn: "wix.blog.v1.like",
157
+ method: "POST",
158
+ methodFqn: "wix.blog.v1.LikeService.QueryLikes",
159
+ packageName: PACKAGE_NAME,
160
+ migrationOptions: {
161
+ optInTransformResponse: true
162
+ },
163
+ url: resolveWixBlogV1LikeServiceUrl({
164
+ protoPath: "/v1/likes/query",
165
+ data: payload,
166
+ host
167
+ }),
168
+ data: payload,
169
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
170
+ {
171
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
172
+ paths: [{ path: "likes.createdDate" }]
173
+ }
174
+ ])
175
+ };
176
+ return metadata;
177
+ }
178
+ return __queryLikes;
179
+ }
180
+ function deleteLike(payload) {
181
+ function __deleteLike({ host }) {
182
+ const metadata = {
183
+ entityFqdn: "wix.blog.v1.like",
184
+ method: "DELETE",
185
+ methodFqn: "wix.blog.v1.LikeService.DeleteLike",
186
+ packageName: PACKAGE_NAME,
187
+ migrationOptions: {
188
+ optInTransformResponse: true
189
+ },
190
+ url: resolveWixBlogV1LikeServiceUrl({
191
+ protoPath: "/v1/likes/{likeId}",
192
+ data: payload,
193
+ host
194
+ }),
195
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
196
+ };
197
+ return metadata;
198
+ }
199
+ return __deleteLike;
200
+ }
201
+ function deleteLikeByFqdnAndEntityId(payload) {
202
+ function __deleteLikeByFqdnAndEntityId({ host }) {
203
+ const metadata = {
204
+ entityFqdn: "wix.blog.v1.like",
205
+ method: "DELETE",
206
+ methodFqn: "wix.blog.v1.LikeService.DeleteLikeByFqdnAndEntityId",
207
+ packageName: PACKAGE_NAME,
208
+ migrationOptions: {
209
+ optInTransformResponse: true
210
+ },
211
+ url: resolveWixBlogV1LikeServiceUrl({
212
+ protoPath: "/v1/likes/fqdn/{fqdn}/entity-id/{entityId}",
213
+ data: payload,
214
+ host
215
+ }),
216
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
217
+ };
218
+ return metadata;
219
+ }
220
+ return __deleteLikeByFqdnAndEntityId;
221
+ }
222
+
223
+ // src/blog-v1-like-likes.universal.ts
224
+ var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
225
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
226
+ SortOrder2["ASC"] = "ASC";
227
+ SortOrder2["DESC"] = "DESC";
228
+ return SortOrder2;
229
+ })(SortOrder || {});
230
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
231
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
232
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
233
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
234
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
235
+ WebhookIdentityType2["APP"] = "APP";
236
+ return WebhookIdentityType2;
237
+ })(WebhookIdentityType || {});
238
+ async function createLike2(options) {
239
+ const { httpClient, sideEffects } = arguments[1];
240
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
241
+ like: options?.like
242
+ });
243
+ const reqOpts = createLike(payload);
244
+ sideEffects?.onSiteCall?.();
245
+ try {
246
+ const result = await httpClient.request(reqOpts);
247
+ sideEffects?.onSuccess?.(result);
248
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.like;
249
+ } catch (err) {
250
+ const transformedError = (0, import_transform_error.transformError)(
251
+ err,
252
+ {
253
+ spreadPathsToArguments: {},
254
+ explicitPathsToArguments: { like: "$[0].like" },
255
+ singleArgumentUnchanged: false
256
+ },
257
+ ["options"]
258
+ );
259
+ sideEffects?.onError?.(err);
260
+ throw transformedError;
261
+ }
262
+ }
263
+ async function getLike2(likeId) {
264
+ const { httpClient, sideEffects } = arguments[1];
265
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ likeId });
266
+ const reqOpts = getLike(payload);
267
+ sideEffects?.onSiteCall?.();
268
+ try {
269
+ const result = await httpClient.request(reqOpts);
270
+ sideEffects?.onSuccess?.(result);
271
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.like;
272
+ } catch (err) {
273
+ const transformedError = (0, import_transform_error.transformError)(
274
+ err,
275
+ {
276
+ spreadPathsToArguments: {},
277
+ explicitPathsToArguments: { likeId: "$[0]" },
278
+ singleArgumentUnchanged: false
279
+ },
280
+ ["likeId"]
281
+ );
282
+ sideEffects?.onError?.(err);
283
+ throw transformedError;
284
+ }
285
+ }
286
+ function queryLikes2() {
287
+ const { httpClient, sideEffects } = arguments[0];
288
+ return (0, import_query_builder.queryBuilder)({
289
+ func: async (payload) => {
290
+ const reqOpts = queryLikes(payload);
291
+ sideEffects?.onSiteCall?.();
292
+ try {
293
+ const result = await httpClient.request(reqOpts);
294
+ sideEffects?.onSuccess?.(result);
295
+ return result;
296
+ } catch (err) {
297
+ sideEffects?.onError?.(err);
298
+ throw err;
299
+ }
300
+ },
301
+ requestTransformer: (query) => {
302
+ const args = [query, {}];
303
+ return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
304
+ ...args?.[1],
305
+ query: args?.[0]
306
+ });
307
+ },
308
+ responseTransformer: ({ data }) => {
309
+ const transformedData = (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
310
+ (0, import_transform_paths2.transformPaths)(data, [])
311
+ );
312
+ return {
313
+ items: transformedData?.likes,
314
+ pagingMetadata: transformedData?.pagingMetadata
315
+ };
316
+ },
317
+ errorTransformer: (err) => {
318
+ const transformedError = (0, import_transform_error.transformError)(err, {
319
+ spreadPathsToArguments: {},
320
+ explicitPathsToArguments: { query: "$[0]" },
321
+ singleArgumentUnchanged: false
322
+ });
323
+ throw transformedError;
324
+ },
325
+ pagingMethod: "CURSOR",
326
+ transformationPaths: {}
327
+ });
328
+ }
329
+ async function typedQueryLikes(query) {
330
+ const { httpClient, sideEffects } = arguments[1];
331
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
332
+ const reqOpts = queryLikes(payload);
333
+ sideEffects?.onSiteCall?.();
334
+ try {
335
+ const result = await httpClient.request(reqOpts);
336
+ sideEffects?.onSuccess?.(result);
337
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
338
+ } catch (err) {
339
+ const transformedError = (0, import_transform_error.transformError)(
340
+ err,
341
+ {
342
+ spreadPathsToArguments: {},
343
+ explicitPathsToArguments: { query: "$[0]" },
344
+ singleArgumentUnchanged: false
345
+ },
346
+ ["query"]
347
+ );
348
+ sideEffects?.onError?.(err);
349
+ throw transformedError;
350
+ }
351
+ }
352
+ async function deleteLike2(likeId) {
353
+ const { httpClient, sideEffects } = arguments[1];
354
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ likeId });
355
+ const reqOpts = deleteLike(payload);
356
+ sideEffects?.onSiteCall?.();
357
+ try {
358
+ const result = await httpClient.request(reqOpts);
359
+ sideEffects?.onSuccess?.(result);
360
+ } catch (err) {
361
+ const transformedError = (0, import_transform_error.transformError)(
362
+ err,
363
+ {
364
+ spreadPathsToArguments: {},
365
+ explicitPathsToArguments: { likeId: "$[0]" },
366
+ singleArgumentUnchanged: false
367
+ },
368
+ ["likeId"]
369
+ );
370
+ sideEffects?.onError?.(err);
371
+ throw transformedError;
372
+ }
373
+ }
374
+ async function deleteLikeByFqdnAndEntityId2(identifiers) {
375
+ const { httpClient, sideEffects } = arguments[1];
376
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
377
+ fqdn: identifiers?.fqdn,
378
+ entityId: identifiers?.entityId
379
+ });
380
+ const reqOpts = deleteLikeByFqdnAndEntityId(payload);
381
+ sideEffects?.onSiteCall?.();
382
+ try {
383
+ const result = await httpClient.request(reqOpts);
384
+ sideEffects?.onSuccess?.(result);
385
+ } catch (err) {
386
+ const transformedError = (0, import_transform_error.transformError)(
387
+ err,
388
+ {
389
+ spreadPathsToArguments: {},
390
+ explicitPathsToArguments: {
391
+ fqdn: "$[0].fqdn",
392
+ entityId: "$[0].entityId"
393
+ },
394
+ singleArgumentUnchanged: false
395
+ },
396
+ ["identifiers"]
397
+ );
398
+ sideEffects?.onError?.(err);
399
+ throw transformedError;
400
+ }
401
+ }
402
+ // Annotate the CommonJS export names for ESM import in node:
403
+ 0 && (module.exports = {
404
+ SortOrder,
405
+ WebhookIdentityType,
406
+ createLike,
407
+ deleteLike,
408
+ deleteLikeByFqdnAndEntityId,
409
+ getLike,
410
+ queryLikes,
411
+ typedQueryLikes
412
+ });
413
+ //# sourceMappingURL=index.typings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/blog-v1-like-likes.universal.ts","../../src/blog-v1-like-likes.http.ts"],"sourcesContent":["export * from './src/blog-v1-like-likes.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, HttpResponse, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBlogV1Like from './blog-v1-like-likes.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\n/**\n * A like represents a user's positive reaction to blog content.\n *\n * Likes are associated with specific blog content using their FQDN (fully qualified domain name) and entity ID,\n * allowing likes to be created for various types of blog content such as posts or comments.\n */\nexport interface Like {\n /**\n * Like ID.\n * @immutable\n * @format GUID\n */\n _id?: string | null;\n /**\n * Date and time the like was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * ID of the specific blog content being liked, such as a blog post or comment.\n * @format GUID\n */\n entityId?: string | null;\n /**\n * Fully qualified domain name that identifies the type of blog content being liked. For example, `wix.blog.v3.post` for blog posts.\n * @maxLength 256\n */\n fqdn?: string | null;\n}\n\nexport interface CreateLikeRequest {\n /** Like to create. */\n like?: Like;\n}\n\nexport interface CreateLikeResponse {\n /** Created like. */\n like?: Like;\n}\n\nexport interface GetLikeRequest {\n /**\n * Like ID.\n * @format GUID\n */\n likeId: string | null;\n}\n\nexport interface GetLikeResponse {\n /** Retrieved like. */\n like?: Like;\n}\n\nexport interface GetLikeByFqdnAndEntityIdRequest {\n /**\n * Fully qualified domain name that identifies the type of blog content being liked. For example, `wix.blog.v3.post` for blog posts.\n * @maxLength 256\n */\n fqdn?: string | null;\n /**\n * ID of the liked entity.\n * @format GUID\n */\n entityId?: string | null;\n}\n\nexport interface GetLikeByFqdnAndEntityIdResponse {\n /** Retrieved like. */\n like?: Like;\n}\n\nexport interface QueryLikesRequest {\n /** Query options. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language) for more details. */\n query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n /**\n * Filter object.\n *\n * Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object.\n *\n * Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).\n * @maxSize 5\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /**\n * Cursor paging options.\n *\n * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface QueryLikesResponse {\n /** Retrieved likes. */\n likes?: Like[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface CountLikesRequest {\n /**\n * Fully qualified domain name of the liked entity. For example, `wix.blog.v3.post`.\n * @maxLength 256\n */\n fqdn?: string | null;\n /**\n * User identity ID.\n * @format GUID\n */\n identityId?: string | null;\n}\n\nexport interface CountLikesResponse {\n /** Number of likes. */\n count?: number;\n}\n\nexport interface DeleteLikeRequest {\n /**\n * ID of the like to delete.\n * @format GUID\n */\n likeId: string | null;\n}\n\nexport interface DeleteLikeResponse {}\n\nexport interface DeleteLikeByFqdnAndEntityIdRequest {\n /**\n * Fully qualified domain name that identifies the type of blog content being liked. For example, `wix.blog.v3.post` for blog posts.\n * @maxLength 256\n */\n fqdn: string | null;\n /**\n * ID of the specific blog content being liked.\n * @format GUID\n */\n entityId: string | null;\n}\n\nexport interface DeleteLikeByFqdnAndEntityIdResponse {}\n\nexport interface BulkCreateLikesMigrationRequest {\n /**\n * Likes to create.\n * @minSize 1\n * @maxSize 50\n */\n likes?: MigrationLike[];\n}\n\n/** Like object used for migration purposes with additional user identity fields. */\nexport interface MigrationLike {\n /** Date and time the like was created. */\n _createdDate?: Date | null;\n /**\n * ID of the liked entity.\n * @format GUID\n */\n entityId?: string | null;\n /**\n * ID of the member who created the like.\n * @format GUID\n */\n memberId?: string | null;\n /**\n * ID of the anonymous user who created the like.\n * @format GUID\n */\n anonymousUserId?: string | null;\n}\n\nexport interface BulkCreateLikesMigrationResponse {\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata;\n /** Metadata for each created like. */\n itemMetadata?: ItemMetadata[];\n}\n\nexport interface BulkActionMetadata {\n /** Number of items that were successfully processed. */\n totalSuccesses?: number;\n /** Number of items that couldn't be processed. */\n totalFailures?: number;\n /** Number of failures without details because detailed failure threshold was exceeded. */\n undetailedFailures?: number;\n}\n\nexport interface ItemMetadata {\n /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */\n _id?: string | null;\n /** Index of the item within the request array. Allows for correlation between request and response items. */\n originalIndex?: number;\n /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */\n success?: boolean;\n /** Details about the error in case of failure. */\n error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string;\n /** Description of the error. */\n description?: string;\n /** Data related to the error. */\n data?: Record<string, any> | null;\n}\n\nexport interface CountLikesMigrationRequest {}\n\nexport interface CountLikesMigrationResponse {\n /** Total number of likes. */\n count?: number;\n}\n\nexport interface QueryLikesMigrationRequest {\n /** Query options. */\n query?: CursorQuery;\n}\n\nexport interface QueryLikesMigrationResponse {\n /** Retrieved likes. */\n likes?: Like[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface Empty {}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\nexport interface LikeCreatedEnvelope {\n entity: Like;\n metadata: EventMetadata;\n}\n\n/**\n * Triggers when a like is created.\n * @permissionScope Read Blog\n * @permissionScopeId SCOPE.DC-BLOG.READ-BLOGS\n * @permissionScope Manage Blog\n * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG\n * @permissionScope Read Draft Blog Posts\n * @permissionScopeId SCOPE.DC-BLOG.READ-DRAFT-POSTS\n * @permissionId BLOG.LIKE_READ\n * @webhook\n * @eventType wix.blog.v1.like_created\n * @slug created\n * @documentationMaturity preview\n */\nexport declare function onLikeCreated(\n handler: (event: LikeCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface LikeDeletedEnvelope {\n entity: Like;\n metadata: EventMetadata;\n}\n\n/**\n * Triggers when a like is deleted.\n * @permissionScope Read Blog\n * @permissionScopeId SCOPE.DC-BLOG.READ-BLOGS\n * @permissionScope Manage Blog\n * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG\n * @permissionScope Read Draft Blog Posts\n * @permissionScopeId SCOPE.DC-BLOG.READ-DRAFT-POSTS\n * @permissionId BLOG.LIKE_READ\n * @webhook\n * @eventType wix.blog.v1.like_deleted\n * @slug deleted\n * @documentationMaturity preview\n */\nexport declare function onLikeDeleted(\n handler: (event: LikeDeletedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a like for blog content.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/go-headless/coding/rest-api/visitors-and-members/make-api-calls-with-oauth).\n * @public\n * @documentationMaturity preview\n * @requiredField options.like.entityId\n * @requiredField options.like.fqdn\n * @permissionId BLOG.LIKE_CREATE\n * @applicableIdentity APP\n * @returns Created like.\n * @fqn wix.blog.v1.LikeService.CreateLike\n */\nexport async function createLike(\n options?: NonNullablePaths<\n CreateLikeOptions,\n `like.entityId` | `like.fqdn`,\n 3\n >\n): Promise<Like> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n like: options?.like,\n });\n\n const reqOpts = ambassadorWixBlogV1Like.createLike(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.like!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { like: '$[0].like' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface CreateLikeOptions {\n /** Like to create. */\n like?: Like;\n}\n\n/**\n * Retrieves a like.\n * @param likeId - Like ID.\n * @public\n * @documentationMaturity preview\n * @requiredField likeId\n * @permissionId BLOG.LIKE_READ\n * @applicableIdentity APP\n * @returns Retrieved like.\n * @fqn wix.blog.v1.LikeService.GetLike\n */\nexport async function getLike(likeId: string): Promise<Like> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ likeId: likeId });\n\n const reqOpts = ambassadorWixBlogV1Like.getLike(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.like!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { likeId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['likeId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of likes, given the provided paging, filtering, and sorting.\n *\n * Up to 100 likes can be returned per request.\n *\n * Query Likes runs with these defaults, which you can override:\n *\n * - `createdDate` is sorted in `DESC` order\n * - `paging.limit` is `50`\n * - `paging.offset` is `0`\n *\n * For field support for filters and sorting, see [Supported Filters and Sorting](https://dev.wix.com/docs/api-reference/business-solutions/blog/likes/supported-filters-and-sorting).\n *\n * To learn how to query likes, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language).\n * @public\n * @documentationMaturity preview\n * @permissionId BLOG.LIKE_READ\n * @applicableIdentity APP\n * @fqn wix.blog.v1.LikeService.QueryLikes\n */\nexport function queryLikes(): LikesQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<Like, 'CURSOR', QueryLikesRequest, QueryLikesResponse>({\n func: async (payload: QueryLikesRequest) => {\n const reqOpts = ambassadorWixBlogV1Like.queryLikes(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n return result;\n } catch (err) {\n sideEffects?.onError?.(err);\n throw err;\n }\n },\n requestTransformer: (query: QueryLikesRequest['query']) => {\n const args = [query, {}] as [QueryLikesRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryLikesResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.likes,\n pagingMetadata: transformedData?.pagingMetadata,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n });\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface LikesQueryResult extends QueryCursorResult {\n items: Like[];\n query: LikesQueryBuilder;\n next: () => Promise<LikesQueryResult>;\n prev: () => Promise<LikesQueryResult>;\n}\n\nexport interface LikesQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n eq: (\n propertyName: '_id' | 'entityId' | 'fqdn',\n value: any\n ) => LikesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ne: (\n propertyName: '_id' | 'entityId' | 'fqdn',\n value: any\n ) => LikesQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName: '_id' | 'entityId' | 'fqdn',\n value: any\n ) => LikesQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object.\n * @documentationMaturity preview\n */\n limit: (limit: number) => LikesQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => LikesQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<LikesQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.blog.v1.LikeService.QueryLikes\n * @requiredField query\n */\nexport async function typedQueryLikes(\n query: CursorQuery\n): Promise<NonNullablePaths<QueryLikesResponse, `likes`, 2>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });\n\n const reqOpts = ambassadorWixBlogV1Like.queryLikes(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['query']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Deletes a like.\n * @param likeId - ID of the like to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField likeId\n * @permissionId BLOG.LIKE_DELETE\n * @applicableIdentity APP\n * @fqn wix.blog.v1.LikeService.DeleteLike\n */\nexport async function deleteLike(likeId: string): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ likeId: likeId });\n\n const reqOpts = ambassadorWixBlogV1Like.deleteLike(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { likeId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['likeId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Deletes a site visitors' or members' like by blog content FQDN and entity ID.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/go-headless/coding/rest-api/visitors-and-members/make-api-calls-with-oauth).\n * @public\n * @documentationMaturity preview\n * @requiredField identifiers\n * @requiredField identifiers.entityId\n * @requiredField identifiers.fqdn\n * @permissionId BLOG.LIKE_DELETE\n * @applicableIdentity APP\n * @fqn wix.blog.v1.LikeService.DeleteLikeByFqdnAndEntityId\n */\nexport async function deleteLikeByFqdnAndEntityId(\n identifiers: NonNullablePaths<\n DeleteLikeByFqdnAndEntityIdIdentifiers,\n `entityId` | `fqdn`,\n 2\n >\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n fqdn: identifiers?.fqdn,\n entityId: identifiers?.entityId,\n });\n\n const reqOpts = ambassadorWixBlogV1Like.deleteLikeByFqdnAndEntityId(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n fqdn: '$[0].fqdn',\n entityId: '$[0].entityId',\n },\n singleArgumentUnchanged: false,\n },\n ['identifiers']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface DeleteLikeByFqdnAndEntityIdIdentifiers {\n /**\n * Fully qualified domain name that identifies the type of blog content being liked. For example, `wix.blog.v3.post` for blog posts.\n * @maxLength 256\n */\n fqdn: string | null;\n /**\n * ID of the specific blog content being liked.\n * @format GUID\n */\n entityId: string | null;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBlogV1LikeServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n _: [\n {\n srcPath: '/_api/blog-like-service',\n destPath: '',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/blog-like-service',\n destPath: '',\n },\n ],\n 'social-blog._base_domain_': [\n {\n srcPath: '/_api/blog-like-service',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/blog-like-service',\n destPath: '',\n },\n ],\n 'apps._base_domain_': [\n {\n srcPath: '/_api/blog-like-service',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/blog/v1/likes',\n destPath: '/v1/likes',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/blog/v1/likes',\n destPath: '/v1/likes',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_blog_likes';\n\n/**\n * Creates a like for blog content.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/go-headless/coding/rest-api/visitors-and-members/make-api-calls-with-oauth).\n */\nexport function createLike(payload: object): RequestOptionsFactory<any> {\n function __createLike({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'like.createdDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.blog.v1.like',\n method: 'POST' as any,\n methodFqn: 'wix.blog.v1.LikeService.CreateLike',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBlogV1LikeServiceUrl({\n protoPath: '/v1/likes',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'like.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createLike;\n}\n\n/** Retrieves a like. */\nexport function getLike(payload: object): RequestOptionsFactory<any> {\n function __getLike({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.blog.v1.like',\n method: 'GET' as any,\n methodFqn: 'wix.blog.v1.LikeService.GetLike',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBlogV1LikeServiceUrl({\n protoPath: '/v1/likes/{likeId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'like.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getLike;\n}\n\n/**\n * Retrieves a list of likes, given the provided paging, filtering, and sorting.\n *\n * Up to 100 likes can be returned per request.\n *\n * Query Likes runs with these defaults, which you can override:\n *\n * - `createdDate` is sorted in `DESC` order\n * - `paging.limit` is `50`\n * - `paging.offset` is `0`\n *\n * For field support for filters and sorting, see [Supported Filters and Sorting](https://dev.wix.com/docs/api-reference/business-solutions/blog/likes/supported-filters-and-sorting).\n *\n * To learn how to query likes, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language).\n */\nexport function queryLikes(payload: object): RequestOptionsFactory<any> {\n function __queryLikes({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.blog.v1.like',\n method: 'POST' as any,\n methodFqn: 'wix.blog.v1.LikeService.QueryLikes',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBlogV1LikeServiceUrl({\n protoPath: '/v1/likes/query',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'likes.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryLikes;\n}\n\n/** Deletes a like. */\nexport function deleteLike(payload: object): RequestOptionsFactory<any> {\n function __deleteLike({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.blog.v1.like',\n method: 'DELETE' as any,\n methodFqn: 'wix.blog.v1.LikeService.DeleteLike',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBlogV1LikeServiceUrl({\n protoPath: '/v1/likes/{likeId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteLike;\n}\n\n/**\n * Deletes a site visitors' or members' like by blog content FQDN and entity ID.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/go-headless/coding/rest-api/visitors-and-members/make-api-calls-with-oauth).\n */\nexport function deleteLikeByFqdnAndEntityId(\n payload: object\n): RequestOptionsFactory<any> {\n function __deleteLikeByFqdnAndEntityId({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.blog.v1.like',\n method: 'DELETE' as any,\n methodFqn: 'wix.blog.v1.LikeService.DeleteLikeByFqdnAndEntityId',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBlogV1LikeServiceUrl({\n protoPath: '/v1/likes/fqdn/{fqdn}/entity-id/{entityId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteLikeByFqdnAndEntityId;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAAA;AAAA,EAAA,kBAAAC;AAAA,EAAA,mCAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,+BACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,6BAA6B;AAAA,MAC3B;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AA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AAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD,MAAM,aAAa;AAAA,IACnB,UAAU,aAAa;AAAA,EACzB,CAAC;AAED,QAAM,UAAkC,4BAA4B,OAAO;AAE3E,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAJ;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,MAAM;AAAA,UACN,UAAU;AAAA,QACZ;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,aAAa;AAAA,IAChB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["createLike","deleteLike","deleteLikeByFqdnAndEntityId","getLike","queryLikes","import_timestamp","import_rest_modules","payload","import_transform_paths","SortOrder","WebhookIdentityType","createLike","sdkTransformError","getLike","queryLikes","deleteLike","deleteLikeByFqdnAndEntityId"]}