Socket
Socket
Sign inDemoInstall

@wix/blog_posts

Package Overview
Dependencies
Maintainers
26
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wix/blog_posts - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

10

build/cjs/src/blog-v3-post-posts.context.d.ts

@@ -1,1 +0,9 @@

import './blog-v3-post-posts.public';
import { getPost as publicGetPost, getPostBySlug as publicGetPostBySlug, listPosts as publicListPosts, queryPosts as publicQueryPosts, getPostMetrics as publicGetPostMetrics, queryPostCountStats as publicQueryPostCountStats, getTotalPosts as publicGetTotalPosts } from './blog-v3-post-posts.public';
import { BuildRESTFunction } from '@wix/sdk-types';
export declare const getPost: BuildRESTFunction<typeof publicGetPost>;
export declare const getPostBySlug: BuildRESTFunction<typeof publicGetPostBySlug>;
export declare const listPosts: BuildRESTFunction<typeof publicListPosts>;
export declare const queryPosts: BuildRESTFunction<typeof publicQueryPosts>;
export declare const getPostMetrics: BuildRESTFunction<typeof publicGetPostMetrics>;
export declare const queryPostCountStats: BuildRESTFunction<typeof publicQueryPostCountStats>;
export declare const getTotalPosts: BuildRESTFunction<typeof publicGetTotalPosts>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("./blog-v3-post-posts.public");
exports.getTotalPosts = exports.queryPostCountStats = exports.getPostMetrics = exports.queryPosts = exports.listPosts = exports.getPostBySlug = exports.getPost = void 0;
const blog_v3_post_posts_public_1 = require("./blog-v3-post-posts.public");
const getPost = (...args) => {
var _a;
const context =
// @ts-expect-error
typeof $wixContext !== 'undefined'
? // @ts-expect-error
$wixContext
: // @ts-expect-error
globalThis.__wix_context__;
if (!context) {
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
}
return context
.initWixModules(blog_v3_post_posts_public_1.getPost, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.apply(undefined, args);
};
exports.getPost = getPost;
const getPostBySlug = (...args) => {
var _a;
const context =
// @ts-expect-error
typeof $wixContext !== 'undefined'
? // @ts-expect-error
$wixContext
: // @ts-expect-error
globalThis.__wix_context__;
if (!context) {
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
}
return context
.initWixModules(blog_v3_post_posts_public_1.getPostBySlug, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.apply(undefined, args);
};
exports.getPostBySlug = getPostBySlug;
const listPosts = (...args) => {
var _a;
const context =
// @ts-expect-error
typeof $wixContext !== 'undefined'
? // @ts-expect-error
$wixContext
: // @ts-expect-error
globalThis.__wix_context__;
if (!context) {
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
}
return context
.initWixModules(blog_v3_post_posts_public_1.listPosts, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.apply(undefined, args);
};
exports.listPosts = listPosts;
const queryPosts = (...args) => {
var _a;
const context =
// @ts-expect-error
typeof $wixContext !== 'undefined'
? // @ts-expect-error
$wixContext
: // @ts-expect-error
globalThis.__wix_context__;
if (!context) {
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
}
return context
.initWixModules(blog_v3_post_posts_public_1.queryPosts, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.apply(undefined, args);
};
exports.queryPosts = queryPosts;
const getPostMetrics = (...args) => {
var _a;
const context =
// @ts-expect-error
typeof $wixContext !== 'undefined'
? // @ts-expect-error
$wixContext
: // @ts-expect-error
globalThis.__wix_context__;
if (!context) {
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
}
return context
.initWixModules(blog_v3_post_posts_public_1.getPostMetrics, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.apply(undefined, args);
};
exports.getPostMetrics = getPostMetrics;
const queryPostCountStats = (...args) => {
var _a;
const context =
// @ts-expect-error
typeof $wixContext !== 'undefined'
? // @ts-expect-error
$wixContext
: // @ts-expect-error
globalThis.__wix_context__;
if (!context) {
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
}
return context
.initWixModules(blog_v3_post_posts_public_1.queryPostCountStats, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.apply(undefined, args);
};
exports.queryPostCountStats = queryPostCountStats;
const getTotalPosts = (...args) => {
var _a;
const context =
// @ts-expect-error
typeof $wixContext !== 'undefined'
? // @ts-expect-error
$wixContext
: // @ts-expect-error
globalThis.__wix_context__;
if (!context) {
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
}
return context
.initWixModules(blog_v3_post_posts_public_1.getTotalPosts, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.apply(undefined, args);
};
exports.getTotalPosts = getTotalPosts;
//# sourceMappingURL=blog-v3-post-posts.context.js.map

305

build/cjs/src/blog-v3-post-posts.universal.js

@@ -38,2 +38,3 @@ "use strict";

const transform_error_1 = require("@wix/sdk-runtime/transform-error");
const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
const sdk_types_1 = require("@wix/sdk-types");

@@ -43,2 +44,7 @@ const ambassadorWixBlogV3Post = __importStar(require("./blog-v3-post-posts.http"));

const motion_edm_autogen_query_wrapper_1 = require("@wix/motion-edm-autogen-query-wrapper");
const image_1 = require("@wix/sdk-runtime/transformations/image");
const video_v2_1 = require("@wix/sdk-runtime/transformations/video-v2");
const video_1 = require("@wix/sdk-runtime/transformations/video");
const page_url_1 = require("@wix/sdk-runtime/transformations/page-url");
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
const _toVeloEntity = '$';

@@ -521,12 +527,2 @@ const _fromVeloEntity = '$';

const _coverMedia = { image: 'wix.common.Image', video: 'wix.common.Video' };
const _getPostBySlugRequest = {};
const _getPostBySlugResponse = { post: '_post' };
const _getPostMetricsRequest = {};
const _getPostMetricsResponse = {};
const _getPostRequest = {};
const _getPostResponse = { post: '_post' };
const _getTotalPostsRequest = {};
const _getTotalPostsResponse = {};
const _listPostsRequest = {};
const _listPostsResponse = { posts: '_post' };
const _media = { wixMedia: '_wixMedia' };

@@ -543,4 +539,2 @@ const _node = { nodes: '_node' };

const _postTranslation = { url: 'wix.common.PageUrl' };
const _queryPostCountStatsRequest = {};
const _queryPostCountStatsResponse = {};
const _queryPostsRequest = {};

@@ -711,38 +705,10 @@ const _queryPostsResponse = { posts: '_post' };

return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
const requestTransformation = {
postId: '$[0]',
fieldsToInclude: '$[1].fieldsToInclude',
fieldsets: '$[1].fieldsets',
};
const responseTransformation = '$.post';
var _a, _b, _c, _d;
// @ts-ignore
const { httpClient, sideEffects } = arguments_1[2];
const { toAmbassadorRequest } = (0, velo_1.serializer)({
rootSchema: _getPostRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = (0, velo_1.serializer)({
rootSchema: _getPostResponse,
depSchemas: {
_coverMedia,
_media,
_node,
_post,
_postTranslation,
_richContent,
_wixMedia,
},
fqdnTransformation: {
paths: [...['post']],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([postId, options], []);
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
postId: postId,
fieldsToInclude: options === null || options === void 0 ? void 0 : options.fieldsToInclude,
fieldsets: options === null || options === void 0 ? void 0 : options.fieldsets,
}, []);
const reqOpts = ambassadorWixBlogV3Post.getPost(payload);

@@ -753,3 +719,24 @@ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);

(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return fromJSON(result.data, ['post.rich_content']);
return (_c = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: page_url_1.transformRESTPageURLToSDKPageURL,
paths: [{ path: 'post.url' }, { path: 'post.translations.url' }],
},
{
transformFn: image_1.transformRESTImageToSDKImage,
paths: [
{ path: 'post.heroImage' },
{ path: 'post.coverMedia.image' },
{ path: 'post.media.wixMedia.image' },
],
},
{
transformFn: video_1.transformRESTVideoToSDKVideo,
paths: [{ path: 'post.coverMedia.video' }],
},
{
transformFn: video_v2_1.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'post.media.wixMedia.videoV2' }],
},
]), ['post.rich_content'])) === null || _c === void 0 ? void 0 : _c.post;
}

@@ -766,3 +753,3 @@ catch (err) {

}, ['postId', 'options']);
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
(_d = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _d === void 0 ? void 0 : _d.call(sideEffects, err);
throw transformedError;

@@ -798,37 +785,9 @@ }

var _a, _b, _c;
const requestTransformation = {
slug: '$[0]',
fieldsToInclude: '$[1].fieldsToInclude',
fieldsets: '$[1].fieldsets',
};
const responseTransformation = '$';
// @ts-ignore
const { httpClient, sideEffects } = arguments_2[2];
const { toAmbassadorRequest } = (0, velo_1.serializer)({
rootSchema: _getPostBySlugRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = (0, velo_1.serializer)({
rootSchema: _getPostBySlugResponse,
depSchemas: {
_coverMedia,
_media,
_node,
_post,
_postTranslation,
_richContent,
_wixMedia,
},
fqdnTransformation: {
paths: [...['post']],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([slug, options], []);
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
slug: slug,
fieldsToInclude: options === null || options === void 0 ? void 0 : options.fieldsToInclude,
fieldsets: options === null || options === void 0 ? void 0 : options.fieldsets,
}, []);
const reqOpts = ambassadorWixBlogV3Post.getPostBySlug(payload);

@@ -839,3 +798,24 @@ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);

(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return fromJSON(result.data, ['post.rich_content']);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: page_url_1.transformRESTPageURLToSDKPageURL,
paths: [{ path: 'post.url' }, { path: 'post.translations.url' }],
},
{
transformFn: image_1.transformRESTImageToSDKImage,
paths: [
{ path: 'post.heroImage' },
{ path: 'post.coverMedia.image' },
{ path: 'post.media.wixMedia.image' },
],
},
{
transformFn: video_1.transformRESTVideoToSDKVideo,
paths: [{ path: 'post.coverMedia.video' }],
},
{
transformFn: video_v2_1.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'post.media.wixMedia.videoV2' }],
},
]), ['post.rich_content']);
}

@@ -881,44 +861,16 @@ catch (err) {

var _a, _b, _c;
const requestTransformation = {
featured: '$[0].featured',
hashtags: '$[0].hashtags',
categoryIds: '$[0].categoryIds',
tagIds: '$[0].tagIds',
sort: '$[0].sort',
paging: '$[0].paging',
fieldsToInclude: '$[0].fieldsToInclude',
language: '$[0].language',
memberId: '$[0].memberId',
fieldsets: '$[0].fieldsets',
};
const responseTransformation = '$';
// @ts-ignore
const { httpClient, sideEffects } = arguments_3[1];
const { toAmbassadorRequest } = (0, velo_1.serializer)({
rootSchema: _listPostsRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = (0, velo_1.serializer)({
rootSchema: _listPostsResponse,
depSchemas: {
_coverMedia,
_media,
_node,
_post,
_postTranslation,
_richContent,
_wixMedia,
},
fqdnTransformation: {
paths: [...['Array#posts']],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([options], []);
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
featured: options === null || options === void 0 ? void 0 : options.featured,
hashtags: options === null || options === void 0 ? void 0 : options.hashtags,
categoryIds: options === null || options === void 0 ? void 0 : options.categoryIds,
tagIds: options === null || options === void 0 ? void 0 : options.tagIds,
sort: options === null || options === void 0 ? void 0 : options.sort,
paging: options === null || options === void 0 ? void 0 : options.paging,
fieldsToInclude: options === null || options === void 0 ? void 0 : options.fieldsToInclude,
language: options === null || options === void 0 ? void 0 : options.language,
memberId: options === null || options === void 0 ? void 0 : options.memberId,
fieldsets: options === null || options === void 0 ? void 0 : options.fieldsets,
}, []);
const reqOpts = ambassadorWixBlogV3Post.listPosts(payload);

@@ -929,3 +881,24 @@ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);

(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return fromJSON(result.data, ['posts.rich_content']);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: page_url_1.transformRESTPageURLToSDKPageURL,
paths: [{ path: 'posts.url' }, { path: 'posts.translations.url' }],
},
{
transformFn: image_1.transformRESTImageToSDKImage,
paths: [
{ path: 'posts.heroImage' },
{ path: 'posts.coverMedia.image' },
{ path: 'posts.media.wixMedia.image' },
],
},
{
transformFn: video_1.transformRESTVideoToSDKVideo,
paths: [{ path: 'posts.coverMedia.video' }],
},
{
transformFn: video_v2_1.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'posts.media.wixMedia.videoV2' }],
},
]), ['posts.rich_content']);
}

@@ -1065,25 +1038,5 @@ catch (err) {

var _a, _b, _c;
const requestTransformation = { postId: '$[0]' };
const responseTransformation = '$';
// @ts-ignore
const { httpClient, sideEffects } = arguments_4[1];
const { toAmbassadorRequest } = (0, velo_1.serializer)({
rootSchema: _getPostMetricsRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = (0, velo_1.serializer)({
rootSchema: _getPostMetricsResponse,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([postId], []);
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ postId: postId }, []);
const reqOpts = ambassadorWixBlogV3Post.getPostMetrics(payload);

@@ -1094,3 +1047,3 @@ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);

(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return fromJSON(result.data, []);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data, []);
}

@@ -1132,32 +1085,12 @@ catch (err) {

var _a, _b, _c;
const requestTransformation = {
rangeStart: '$[0].rangeStart',
rangeEnd: '$[0].rangeEnd',
order: '$[0].order',
months: '$[0].months',
language: '$[0].language',
timeZone: '$[0].timeZone',
};
const responseTransformation = '$';
// @ts-ignore
const { httpClient, sideEffects } = arguments_5[1];
const { toAmbassadorRequest } = (0, velo_1.serializer)({
rootSchema: _queryPostCountStatsRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = (0, velo_1.serializer)({
rootSchema: _queryPostCountStatsResponse,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([options], []);
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
rangeStart: options === null || options === void 0 ? void 0 : options.rangeStart,
rangeEnd: options === null || options === void 0 ? void 0 : options.rangeEnd,
order: options === null || options === void 0 ? void 0 : options.order,
months: options === null || options === void 0 ? void 0 : options.months,
language: options === null || options === void 0 ? void 0 : options.language,
timeZone: options === null || options === void 0 ? void 0 : options.timeZone,
}, []);
const reqOpts = ambassadorWixBlogV3Post.queryPostCountStats(payload);

@@ -1168,3 +1101,3 @@ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);

(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return fromJSON(result.data, []);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data, []);
}

@@ -1212,25 +1145,5 @@ catch (err) {

var _a, _b, _c;
const requestTransformation = { language: '$[0].language' };
const responseTransformation = '$';
// @ts-ignore
const { httpClient, sideEffects } = arguments_6[1];
const { toAmbassadorRequest } = (0, velo_1.serializer)({
rootSchema: _getTotalPostsRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = (0, velo_1.serializer)({
rootSchema: _getTotalPostsResponse,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([options], []);
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ language: options === null || options === void 0 ? void 0 : options.language }, []);
const reqOpts = ambassadorWixBlogV3Post.getTotalPosts(payload);

@@ -1241,3 +1154,3 @@ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);

(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return fromJSON(result.data, []);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data, []);
}

@@ -1244,0 +1157,0 @@ catch (err) {

@@ -1,1 +0,9 @@

import './blog-v3-post-posts.public';
import { getPost as publicGetPost, getPostBySlug as publicGetPostBySlug, listPosts as publicListPosts, queryPosts as publicQueryPosts, getPostMetrics as publicGetPostMetrics, queryPostCountStats as publicQueryPostCountStats, getTotalPosts as publicGetTotalPosts } from './blog-v3-post-posts.public';
import { BuildRESTFunction } from '@wix/sdk-types';
export declare const getPost: BuildRESTFunction<typeof publicGetPost>;
export declare const getPostBySlug: BuildRESTFunction<typeof publicGetPostBySlug>;
export declare const listPosts: BuildRESTFunction<typeof publicListPosts>;
export declare const queryPosts: BuildRESTFunction<typeof publicQueryPosts>;
export declare const getPostMetrics: BuildRESTFunction<typeof publicGetPostMetrics>;
export declare const queryPostCountStats: BuildRESTFunction<typeof publicQueryPostCountStats>;
export declare const getTotalPosts: BuildRESTFunction<typeof publicGetTotalPosts>;

@@ -1,2 +0,114 @@

import './blog-v3-post-posts.public';
import { getPost as publicGetPost, getPostBySlug as publicGetPostBySlug, listPosts as publicListPosts, queryPosts as publicQueryPosts, getPostMetrics as publicGetPostMetrics, queryPostCountStats as publicQueryPostCountStats, getTotalPosts as publicGetTotalPosts, } from './blog-v3-post-posts.public';
export const getPost = (...args) => {
var _a;
const context =
// @ts-expect-error
typeof $wixContext !== 'undefined'
? // @ts-expect-error
$wixContext
: // @ts-expect-error
globalThis.__wix_context__;
if (!context) {
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
}
return context
.initWixModules(publicGetPost, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.apply(undefined, args);
};
export const getPostBySlug = (...args) => {
var _a;
const context =
// @ts-expect-error
typeof $wixContext !== 'undefined'
? // @ts-expect-error
$wixContext
: // @ts-expect-error
globalThis.__wix_context__;
if (!context) {
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
}
return context
.initWixModules(publicGetPostBySlug, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.apply(undefined, args);
};
export const listPosts = (...args) => {
var _a;
const context =
// @ts-expect-error
typeof $wixContext !== 'undefined'
? // @ts-expect-error
$wixContext
: // @ts-expect-error
globalThis.__wix_context__;
if (!context) {
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
}
return context
.initWixModules(publicListPosts, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.apply(undefined, args);
};
export const queryPosts = (...args) => {
var _a;
const context =
// @ts-expect-error
typeof $wixContext !== 'undefined'
? // @ts-expect-error
$wixContext
: // @ts-expect-error
globalThis.__wix_context__;
if (!context) {
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
}
return context
.initWixModules(publicQueryPosts, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.apply(undefined, args);
};
export const getPostMetrics = (...args) => {
var _a;
const context =
// @ts-expect-error
typeof $wixContext !== 'undefined'
? // @ts-expect-error
$wixContext
: // @ts-expect-error
globalThis.__wix_context__;
if (!context) {
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
}
return context
.initWixModules(publicGetPostMetrics, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.apply(undefined, args);
};
export const queryPostCountStats = (...args) => {
var _a;
const context =
// @ts-expect-error
typeof $wixContext !== 'undefined'
? // @ts-expect-error
$wixContext
: // @ts-expect-error
globalThis.__wix_context__;
if (!context) {
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
}
return context
.initWixModules(publicQueryPostCountStats, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.apply(undefined, args);
};
export const getTotalPosts = (...args) => {
var _a;
const context =
// @ts-expect-error
typeof $wixContext !== 'undefined'
? // @ts-expect-error
$wixContext
: // @ts-expect-error
globalThis.__wix_context__;
if (!context) {
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules');
}
return context
.initWixModules(publicGetTotalPosts, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.apply(undefined, args);
};
//# sourceMappingURL=blog-v3-post-posts.context.js.map

@@ -12,2 +12,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
import { EventDefinition } from '@wix/sdk-types';

@@ -17,2 +18,7 @@ import * as ambassadorWixBlogV3Post from './blog-v3-post-posts.http';

import { wrapWithQueryBuilder } from '@wix/motion-edm-autogen-query-wrapper';
import { transformRESTImageToSDKImage } from '@wix/sdk-runtime/transformations/image';
import { transformRESTVideoV2ToSDKVideoV2 } from '@wix/sdk-runtime/transformations/video-v2';
import { transformRESTVideoToSDKVideo } from '@wix/sdk-runtime/transformations/video';
import { transformRESTPageURLToSDKPageURL } from '@wix/sdk-runtime/transformations/page-url';
import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
const _toVeloEntity = '$';

@@ -495,12 +501,2 @@ const _fromVeloEntity = '$';

const _coverMedia = { image: 'wix.common.Image', video: 'wix.common.Video' };
const _getPostBySlugRequest = {};
const _getPostBySlugResponse = { post: '_post' };
const _getPostMetricsRequest = {};
const _getPostMetricsResponse = {};
const _getPostRequest = {};
const _getPostResponse = { post: '_post' };
const _getTotalPostsRequest = {};
const _getTotalPostsResponse = {};
const _listPostsRequest = {};
const _listPostsResponse = { posts: '_post' };
const _media = { wixMedia: '_wixMedia' };

@@ -517,4 +513,2 @@ const _node = { nodes: '_node' };

const _postTranslation = { url: 'wix.common.PageUrl' };
const _queryPostCountStatsRequest = {};
const _queryPostCountStatsResponse = {};
const _queryPostsRequest = {};

@@ -685,38 +679,10 @@ const _queryPostsResponse = { posts: '_post' };

return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
const requestTransformation = {
postId: '$[0]',
fieldsToInclude: '$[1].fieldsToInclude',
fieldsets: '$[1].fieldsets',
};
const responseTransformation = '$.post';
var _a, _b, _c, _d;
// @ts-ignore
const { httpClient, sideEffects } = arguments_1[2];
const { toAmbassadorRequest } = serializer({
rootSchema: _getPostRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = serializer({
rootSchema: _getPostResponse,
depSchemas: {
_coverMedia,
_media,
_node,
_post,
_postTranslation,
_richContent,
_wixMedia,
},
fqdnTransformation: {
paths: [...['post']],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([postId, options], []);
const payload = renameKeysFromSDKRequestToRESTRequest({
postId: postId,
fieldsToInclude: options === null || options === void 0 ? void 0 : options.fieldsToInclude,
fieldsets: options === null || options === void 0 ? void 0 : options.fieldsets,
}, []);
const reqOpts = ambassadorWixBlogV3Post.getPost(payload);

@@ -727,3 +693,24 @@ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);

(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return fromJSON(result.data, ['post.rich_content']);
return (_c = renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformRESTPageURLToSDKPageURL,
paths: [{ path: 'post.url' }, { path: 'post.translations.url' }],
},
{
transformFn: transformRESTImageToSDKImage,
paths: [
{ path: 'post.heroImage' },
{ path: 'post.coverMedia.image' },
{ path: 'post.media.wixMedia.image' },
],
},
{
transformFn: transformRESTVideoToSDKVideo,
paths: [{ path: 'post.coverMedia.video' }],
},
{
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'post.media.wixMedia.videoV2' }],
},
]), ['post.rich_content'])) === null || _c === void 0 ? void 0 : _c.post;
}

@@ -740,3 +727,3 @@ catch (err) {

}, ['postId', 'options']);
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
(_d = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _d === void 0 ? void 0 : _d.call(sideEffects, err);
throw transformedError;

@@ -771,37 +758,9 @@ }

var _a, _b, _c;
const requestTransformation = {
slug: '$[0]',
fieldsToInclude: '$[1].fieldsToInclude',
fieldsets: '$[1].fieldsets',
};
const responseTransformation = '$';
// @ts-ignore
const { httpClient, sideEffects } = arguments_2[2];
const { toAmbassadorRequest } = serializer({
rootSchema: _getPostBySlugRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = serializer({
rootSchema: _getPostBySlugResponse,
depSchemas: {
_coverMedia,
_media,
_node,
_post,
_postTranslation,
_richContent,
_wixMedia,
},
fqdnTransformation: {
paths: [...['post']],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([slug, options], []);
const payload = renameKeysFromSDKRequestToRESTRequest({
slug: slug,
fieldsToInclude: options === null || options === void 0 ? void 0 : options.fieldsToInclude,
fieldsets: options === null || options === void 0 ? void 0 : options.fieldsets,
}, []);
const reqOpts = ambassadorWixBlogV3Post.getPostBySlug(payload);

@@ -812,3 +771,24 @@ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);

(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return fromJSON(result.data, ['post.rich_content']);
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformRESTPageURLToSDKPageURL,
paths: [{ path: 'post.url' }, { path: 'post.translations.url' }],
},
{
transformFn: transformRESTImageToSDKImage,
paths: [
{ path: 'post.heroImage' },
{ path: 'post.coverMedia.image' },
{ path: 'post.media.wixMedia.image' },
],
},
{
transformFn: transformRESTVideoToSDKVideo,
paths: [{ path: 'post.coverMedia.video' }],
},
{
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'post.media.wixMedia.videoV2' }],
},
]), ['post.rich_content']);
}

@@ -853,44 +833,16 @@ catch (err) {

var _a, _b, _c;
const requestTransformation = {
featured: '$[0].featured',
hashtags: '$[0].hashtags',
categoryIds: '$[0].categoryIds',
tagIds: '$[0].tagIds',
sort: '$[0].sort',
paging: '$[0].paging',
fieldsToInclude: '$[0].fieldsToInclude',
language: '$[0].language',
memberId: '$[0].memberId',
fieldsets: '$[0].fieldsets',
};
const responseTransformation = '$';
// @ts-ignore
const { httpClient, sideEffects } = arguments_3[1];
const { toAmbassadorRequest } = serializer({
rootSchema: _listPostsRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = serializer({
rootSchema: _listPostsResponse,
depSchemas: {
_coverMedia,
_media,
_node,
_post,
_postTranslation,
_richContent,
_wixMedia,
},
fqdnTransformation: {
paths: [...['Array#posts']],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([options], []);
const payload = renameKeysFromSDKRequestToRESTRequest({
featured: options === null || options === void 0 ? void 0 : options.featured,
hashtags: options === null || options === void 0 ? void 0 : options.hashtags,
categoryIds: options === null || options === void 0 ? void 0 : options.categoryIds,
tagIds: options === null || options === void 0 ? void 0 : options.tagIds,
sort: options === null || options === void 0 ? void 0 : options.sort,
paging: options === null || options === void 0 ? void 0 : options.paging,
fieldsToInclude: options === null || options === void 0 ? void 0 : options.fieldsToInclude,
language: options === null || options === void 0 ? void 0 : options.language,
memberId: options === null || options === void 0 ? void 0 : options.memberId,
fieldsets: options === null || options === void 0 ? void 0 : options.fieldsets,
}, []);
const reqOpts = ambassadorWixBlogV3Post.listPosts(payload);

@@ -901,3 +853,24 @@ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);

(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return fromJSON(result.data, ['posts.rich_content']);
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformRESTPageURLToSDKPageURL,
paths: [{ path: 'posts.url' }, { path: 'posts.translations.url' }],
},
{
transformFn: transformRESTImageToSDKImage,
paths: [
{ path: 'posts.heroImage' },
{ path: 'posts.coverMedia.image' },
{ path: 'posts.media.wixMedia.image' },
],
},
{
transformFn: transformRESTVideoToSDKVideo,
paths: [{ path: 'posts.coverMedia.video' }],
},
{
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'posts.media.wixMedia.videoV2' }],
},
]), ['posts.rich_content']);
}

@@ -1035,25 +1008,5 @@ catch (err) {

var _a, _b, _c;
const requestTransformation = { postId: '$[0]' };
const responseTransformation = '$';
// @ts-ignore
const { httpClient, sideEffects } = arguments_4[1];
const { toAmbassadorRequest } = serializer({
rootSchema: _getPostMetricsRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = serializer({
rootSchema: _getPostMetricsResponse,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([postId], []);
const payload = renameKeysFromSDKRequestToRESTRequest({ postId: postId }, []);
const reqOpts = ambassadorWixBlogV3Post.getPostMetrics(payload);

@@ -1064,3 +1017,3 @@ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);

(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return fromJSON(result.data, []);
return renameKeysFromRESTResponseToSDKResponse(result.data, []);
}

@@ -1101,32 +1054,12 @@ catch (err) {

var _a, _b, _c;
const requestTransformation = {
rangeStart: '$[0].rangeStart',
rangeEnd: '$[0].rangeEnd',
order: '$[0].order',
months: '$[0].months',
language: '$[0].language',
timeZone: '$[0].timeZone',
};
const responseTransformation = '$';
// @ts-ignore
const { httpClient, sideEffects } = arguments_5[1];
const { toAmbassadorRequest } = serializer({
rootSchema: _queryPostCountStatsRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = serializer({
rootSchema: _queryPostCountStatsResponse,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([options], []);
const payload = renameKeysFromSDKRequestToRESTRequest({
rangeStart: options === null || options === void 0 ? void 0 : options.rangeStart,
rangeEnd: options === null || options === void 0 ? void 0 : options.rangeEnd,
order: options === null || options === void 0 ? void 0 : options.order,
months: options === null || options === void 0 ? void 0 : options.months,
language: options === null || options === void 0 ? void 0 : options.language,
timeZone: options === null || options === void 0 ? void 0 : options.timeZone,
}, []);
const reqOpts = ambassadorWixBlogV3Post.queryPostCountStats(payload);

@@ -1137,3 +1070,3 @@ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);

(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return fromJSON(result.data, []);
return renameKeysFromRESTResponseToSDKResponse(result.data, []);
}

@@ -1180,25 +1113,5 @@ catch (err) {

var _a, _b, _c;
const requestTransformation = { language: '$[0].language' };
const responseTransformation = '$';
// @ts-ignore
const { httpClient, sideEffects } = arguments_6[1];
const { toAmbassadorRequest } = serializer({
rootSchema: _getTotalPostsRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = serializer({
rootSchema: _getTotalPostsResponse,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([options], []);
const payload = renameKeysFromSDKRequestToRESTRequest({ language: options === null || options === void 0 ? void 0 : options.language }, []);
const reqOpts = ambassadorWixBlogV3Post.getTotalPosts(payload);

@@ -1209,3 +1122,3 @@ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);

(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return fromJSON(result.data, []);
return renameKeysFromRESTResponseToSDKResponse(result.data, []);
}

@@ -1212,0 +1125,0 @@ catch (err) {

{
"name": "@wix/blog_posts",
"version": "1.0.9",
"version": "1.0.10",
"publishConfig": {

@@ -21,3 +21,3 @@ "registry": "https://registry.npmjs.org/",

"@wix/motion-edm-autogen-query-wrapper": "^1.0.37",
"@wix/sdk-runtime": "^0.2.7",
"@wix/sdk-runtime": "^0.2.10",
"@wix/sdk-types": "^1.5.11"

@@ -43,3 +43,3 @@ },

},
"falconPackageHash": "d0bd610b048ba50ac3bfdbe966242efb898638c999ce605207690d83"
"falconPackageHash": "9c9521e04969466433d7043f762e038c18940eb1f73a10c4ed28a66a"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc