Socket
Socket
Sign inDemoInstall

@wix/blog

Package Overview
Dependencies
Maintainers
16
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wix/blog - npm Package Compare versions

Comparing version 1.0.128 to 1.0.129

8

build/cjs/src/blog-v3-category.http.d.ts
import { RequestOptionsFactory } from '@wix/sdk-types';
import { CreateCategoryRequest, CreateCategoryResponse, DeleteCategoryRequest, DeleteCategoryResponse, GetCategoryBySlugRequest, GetCategoryBySlugResponse, GetCategoryRequest, GetCategoryResponse, ListCategoriesRequest, ListCategoriesResponse, QueryCategoriesRequest, QueryCategoriesResponse, UpdateCategoryRequest, UpdateCategoryResponse } from './blog-v3-category.types';
/** Creates a category. */
export declare function createCategory(payload: CreateCategoryRequest): RequestOptionsFactory<CreateCategoryResponse>;
/** Updates a category. */
export declare function updateCategory(payload: UpdateCategoryRequest): RequestOptionsFactory<UpdateCategoryResponse>;
import { GetCategoryBySlugRequest, GetCategoryBySlugResponse, GetCategoryRequest, GetCategoryResponse, ListCategoriesRequest, ListCategoriesResponse, QueryCategoriesRequest, QueryCategoriesResponse } from './blog-v3-category.types';
/**

@@ -49,3 +45,1 @@ * Gets a category by the specified ID.

export declare function queryCategories(payload: QueryCategoriesRequest): RequestOptionsFactory<QueryCategoriesResponse>;
/** Deletes a category. */
export declare function deleteCategory(payload: DeleteCategoryRequest): RequestOptionsFactory<DeleteCategoryResponse>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deleteCategory = exports.queryCategories = exports.listCategories = exports.getCategoryBySlug = exports.getCategory = exports.updateCategory = exports.createCategory = void 0;
exports.queryCategories = exports.listCategories = exports.getCategoryBySlug = exports.getCategory = void 0;
const metro_runtime_1 = require("@wix/metro-runtime");

@@ -9,6 +9,2 @@ const ambassador_1 = require("@wix/metro-runtime/ambassador");

const _coverMedia = { image: '_image', video: '_video' };
const _createCategoryRequest = { category: '_category' };
const _createCategoryResponse = { category: '_category' };
const _deleteCategoryRequest = {};
const _deleteCategoryResponse = {};
const _getCategoryBySlugRequest = {};

@@ -23,7 +19,2 @@ const _getCategoryBySlugResponse = { category: '_category' };

const _queryCategoriesResponse = { categories: '_category' };
const _updateCategoryRequest = {
fieldMask: 'google.protobuf.FieldMask',
category: '_category',
};
const _updateCategoryResponse = { category: '_category' };
const _video = { thumbnail: '_image' };

@@ -229,52 +220,2 @@ function resolveComWixpressNpmCommunitiesPlatformizedBlogV3CategoryServiceUrl(opts) {

}
/** Creates a category. */
function createCategory(payload) {
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_createCategoryRequest, { _category, _coverMedia, _image, _video });
const { fromJSON: fromRes } = ambassador_1.serializer(_createCategoryResponse, {
_category,
_coverMedia,
_image,
_video,
});
function __createCategory({ host }) {
const serializedData = toReq(payload);
const metadata = {
method: 'POST',
url: resolveComWixpressNpmCommunitiesPlatformizedBlogV3CategoryServiceUrl({ protoPath: '/v3/categories', data: serializedData, host }),
data: serializedData,
transformResponse: fromRes,
};
return metadata;
}
__createCategory.fromReq = fromReq;
return __createCategory;
}
exports.createCategory = createCategory;
/** Updates a category. */
function updateCategory(payload) {
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_updateCategoryRequest, { _category, _coverMedia, _image, _video });
const { fromJSON: fromRes } = ambassador_1.serializer(_updateCategoryResponse, {
_category,
_coverMedia,
_image,
_video,
});
function __updateCategory({ host }) {
const serializedData = toReq(payload);
const metadata = {
method: 'PATCH',
url: resolveComWixpressNpmCommunitiesPlatformizedBlogV3CategoryServiceUrl({
protoPath: '/v3/categories/{category.id}',
data: serializedData,
host,
}),
data: serializedData,
transformResponse: fromRes,
};
return metadata;
}
__updateCategory.fromReq = fromReq;
return __updateCategory;
}
exports.updateCategory = updateCategory;
/**

@@ -406,20 +347,2 @@ * Gets a category by the specified ID.

exports.queryCategories = queryCategories;
/** Deletes a category. */
function deleteCategory(payload) {
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_deleteCategoryRequest, {});
const { fromJSON: fromRes } = ambassador_1.serializer(_deleteCategoryResponse, {});
function __deleteCategory({ host }) {
const serializedData = toReq(payload);
const metadata = {
method: 'DELETE',
url: resolveComWixpressNpmCommunitiesPlatformizedBlogV3CategoryServiceUrl({ protoPath: '/v3/categories/{categoryId}', data: serializedData, host }),
params: metro_runtime_1.toURLSearchParams(serializedData),
transformResponse: fromRes,
};
return metadata;
}
__deleteCategory.fromReq = fromReq;
return __deleteCategory;
}
exports.deleteCategory = deleteCategory;
//# sourceMappingURL=blog-v3-category.http.js.map

7

build/cjs/src/blog-v3-category.public.d.ts
import { HttpClient } from '@wix/sdk-types';
import { Category, UpdateCategory, CreateCategoryOptions, GetCategoryBySlugOptions, GetCategoryOptions, ListCategoriesOptions, QueryCategoriesOptions, UpdateCategoryOptions } from './blog-v3-category.universal';
export declare function createCategory(httpClient: HttpClient): (category: Category, options?: CreateCategoryOptions | undefined) => Promise<import("./blog-v3-category.universal").CreateCategoryResponse>;
export declare function updateCategory(httpClient: HttpClient): (_id: string, category: UpdateCategory, options?: UpdateCategoryOptions | undefined) => Promise<import("./blog-v3-category.universal").UpdateCategoryResponse>;
import { GetCategoryBySlugOptions, GetCategoryOptions, ListCategoriesOptions, QueryCategoriesOptions } from './blog-v3-category.universal';
export declare function getCategory(httpClient: HttpClient): (categoryId: string, options?: GetCategoryOptions | undefined) => Promise<import("./blog-v3-category.universal").GetCategoryResponse>;

@@ -9,4 +7,3 @@ export declare function getCategoryBySlug(httpClient: HttpClient): (slug: string, options?: GetCategoryBySlugOptions | undefined) => Promise<import("./blog-v3-category.universal").GetCategoryBySlugResponse>;

export declare function queryCategories(httpClient: HttpClient): (options?: QueryCategoriesOptions | undefined) => import("./blog-v3-category.universal").CategoriesQueryBuilder;
export declare function deleteCategory(httpClient: HttpClient): (categoryId: string) => Promise<void>;
export { Field, SortOrder } from './blog-v3-category.universal';
export { Category, CoverMedia, CoverMediaMediaOneOf, SeoSchema, Tag, Settings, InitialCategoriesCopied, CreateCategoryRequest, CreateCategoryResponse, BulkCreateCategoriesRequest, BulkCreateCategoriesResponse, BulkCategoryResult, ItemMetadata, ApplicationError, BulkActionMetadata, UpdateCategoryRequest, UpdateCategoryResponse, GetCategoryRequest, GetCategoryResponse, GetCategoryBySlugRequest, GetCategoryBySlugResponse, ListCategoriesRequest, BlogPaging, ListCategoriesResponse, MetaData, QueryCategoriesRequest, Sorting, PlatformQuery, PlatformQueryPagingMethodOneOf, Paging, CursorPaging, QueryCategoriesResponse, PagingMetadataV2, Cursors, DeleteCategoryRequest, DeleteCategoryResponse, CreateCategoryOptions, UpdateCategory, UpdateCategoryOptions, GetCategoryOptions, GetCategoryBySlugOptions, ListCategoriesOptions, QueryCategoriesOptions, CategoriesQueryResult, CategoriesQueryBuilder, } from './blog-v3-category.universal';
export { Category, CoverMedia, CoverMediaMediaOneOf, SeoSchema, Tag, Settings, InitialCategoriesCopied, CreateCategoryRequest, CreateCategoryResponse, BulkCreateCategoriesRequest, BulkCreateCategoriesResponse, BulkCategoryResult, ItemMetadata, ApplicationError, BulkActionMetadata, UpdateCategoryRequest, UpdateCategoryResponse, GetCategoryRequest, GetCategoryResponse, GetCategoryBySlugRequest, GetCategoryBySlugResponse, ListCategoriesRequest, BlogPaging, ListCategoriesResponse, MetaData, QueryCategoriesRequest, Sorting, PlatformQuery, PlatformQueryPagingMethodOneOf, Paging, CursorPaging, QueryCategoriesResponse, PagingMetadataV2, Cursors, DeleteCategoryRequest, DeleteCategoryResponse, GetCategoryOptions, GetCategoryBySlugOptions, ListCategoriesOptions, QueryCategoriesOptions, CategoriesQueryResult, CategoriesQueryBuilder, } from './blog-v3-category.universal';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SortOrder = exports.Field = exports.deleteCategory = exports.queryCategories = exports.listCategories = exports.getCategoryBySlug = exports.getCategory = exports.updateCategory = exports.createCategory = void 0;
exports.SortOrder = exports.Field = exports.queryCategories = exports.listCategories = exports.getCategoryBySlug = exports.getCategory = void 0;
const blog_v3_category_universal_1 = require("./blog-v3-category.universal");
function createCategory(httpClient) {
return (category, options) => blog_v3_category_universal_1.createCategory(category, options,
// @ts-ignore
{ httpClient });
}
exports.createCategory = createCategory;
function updateCategory(httpClient) {
return (_id, category, options) => blog_v3_category_universal_1.updateCategory(_id, category, options,
// @ts-ignore
{ httpClient });
}
exports.updateCategory = updateCategory;
function getCategory(httpClient) {

@@ -41,8 +29,2 @@ return (categoryId, options) => blog_v3_category_universal_1.getCategory(categoryId, options,

exports.queryCategories = queryCategories;
function deleteCategory(httpClient) {
return (categoryId) => blog_v3_category_universal_1.deleteCategory(categoryId,
// @ts-ignore
{ httpClient });
}
exports.deleteCategory = deleteCategory;
var blog_v3_category_universal_2 = require("./blog-v3-category.universal");

@@ -49,0 +31,0 @@ Object.defineProperty(exports, "Field", { enumerable: true, get: function () { return blog_v3_category_universal_2.Field; } });

@@ -173,3 +173,3 @@ export interface Category {

/** Category info. */
category: Category;
category?: Category;
/**

@@ -247,3 +247,3 @@ * List of category fields to be included in the response if the entities are present.

/** Category info. */
category: Category;
category?: Category;
/** Field mask of fields to update. */

@@ -471,5 +471,5 @@ fieldMask?: string[];

/** Category ID. */
categoryId: string;
categoryId?: string;
}
export interface DeleteCategoryResponse {
}

@@ -126,3 +126,3 @@ export declare const __debug: {

/** Category info. */
category: Category;
category?: Category;
/**

@@ -200,3 +200,3 @@ * List of category fields to be included in the response if the entities are present.

/** Category info. */
category: Category;
category?: Category;
/** Field mask of fields to update. */

@@ -425,3 +425,3 @@ fieldMask?: string[];

/** Category ID. */
categoryId: string;
categoryId?: string;
}

@@ -431,98 +431,2 @@ export interface DeleteCategoryResponse {

/**
* Creates a category.
* @param category - Category info.
* @public
* @requiredField category
* @requiredField category.label
*/
export declare function createCategory(category: Category, options?: CreateCategoryOptions): Promise<CreateCategoryResponse>;
export interface CreateCategoryOptions {
/**
* List of category fields to be included in the response if the entities are present.
* Base default fieldset returns all core category properties (all properties that are not a supported fieldset value).
* For example, when `URL` fieldset is selected, returned category will include the set of base properties and the category's preview url.
*/
fieldsets?: Field[];
}
/**
* Updates a category.
* @param _id - Category ID.
* @public
* @requiredField _id
* @requiredField category
*/
export declare function updateCategory(_id: string, category: UpdateCategory, options?: UpdateCategoryOptions): Promise<UpdateCategoryResponse>;
export interface UpdateCategory {
/**
* Category ID.
* @readonly
*/
_id?: string;
/** Category label. Displayed in the Category Menu. */
label?: string;
/**
* Number of posts in the category.
* @readonly
*/
postCount?: number;
/**
* Category URL.
*
*
* The `url` directs you to a page that lists every post with the specified category.
*
* @readonly
*/
url?: string;
/** Category description. */
description?: string | null;
/** Category title. */
title?: string;
/** Reserved for internal use. */
coverMedia?: CoverMedia;
/**
* Reserved for internal use.
* @readonly
*/
oldRank?: number;
/** Reserved for internal use. */
rank?: number | null;
/** Position of the category in the [Category Menu](https://support.wix.com/en/article/wix-blog-adding-and-customizing-a-category-menu). Categories with lower display position are displayed first. */
displayPosition?: number | null;
/** ID of the category's translations when [Wix Multilingual](https://wix.wixanswers.com/app/kb/article/36837a9d-5d22-4fa1-9a80-1b99b7f82b5e/en) is installed on a site. All translations of a single category will share the same `translationId`. */
translationId?: string | null;
/**
* Category Language.
*
* 2-letter language code in [ISO 639-1 format](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
*/
language?: string;
/**
* Part of a category's URL that refers to a specific category.
*
*
* For example, `'https:/example.com/blog/category/{my-category-slug}'`.
*/
slug?: string;
/**
* Reserved for internal use.
* @readonly
*/
internalId?: string | null;
/** SEO data. */
seoData?: SeoSchema;
/** Category cover image. */
coverImage?: string;
}
export interface UpdateCategoryOptions {
/** Field mask of fields to update. */
fieldMask?: string[];
/**
* List of category fields to be included in the response if the entities are present.
* Base default fieldset returns all core category properties (all properties that are not a supported fieldset value).
* For example, when `URL` fieldset is selected, returned category will include the set of base properties and the category's preview url.
*/
fieldsets?: Field[];
}
/**
* Gets a category by the specified ID.

@@ -683,9 +587,2 @@ *

}
/**
* Deletes a category.
* @param categoryId - Category ID.
* @public
* @requiredField categoryId
*/
export declare function deleteCategory(categoryId: string): Promise<void>;
export {};

@@ -31,3 +31,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.deleteCategory = exports.queryCategories = exports.listCategories = exports.getCategoryBySlug = exports.getCategory = exports.updateCategory = exports.createCategory = exports.SortOrder = exports.Field = exports.__debug = void 0;
exports.queryCategories = exports.listCategories = exports.getCategoryBySlug = exports.getCategory = exports.SortOrder = exports.Field = exports.__debug = void 0;
const velo_1 = require("@wix/metro-runtime/velo");

@@ -76,6 +76,2 @@ const ambassadorWixBlogV3Category = __importStar(require("./blog-v3-category.http"));

const _coverMedia = { image: 'wix.common.Image', video: 'wix.common.Video' };
const _createCategoryRequest = { category: '_category' };
const _createCategoryResponse = { category: '_category' };
const _deleteCategoryRequest = {};
const _deleteCategoryResponse = {};
const _getCategoryBySlugRequest = {};

@@ -89,109 +85,3 @@ const _getCategoryBySlugResponse = { category: '_category' };

const _queryCategoriesResponse = { categories: '_category' };
const _updateCategoryRequest = { category: '_category' };
const _updateCategoryResponse = { category: '_category' };
/**
* Creates a category.
* @param category - Category info.
* @public
* @requiredField category
* @requiredField category.label
*/
function createCategory(category, options) {
return __awaiter(this, arguments, void 0, function* () {
const requestTransformation = {
category: '$[0]',
fieldsets: '$[1].fieldsets',
};
const responseTransformation = '$';
// @ts-ignore
const httpClient = arguments[2].httpClient;
const { toAmbassadorRequest } = velo_1.serializer({
rootSchema: _createCategoryRequest,
depSchemas: { _category, _coverMedia },
fqdnTransformation: {
paths: [...['category']],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = velo_1.serializer({
rootSchema: _createCategoryResponse,
depSchemas: { _category, _coverMedia },
fqdnTransformation: {
paths: [...['category']],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([category, options]);
const reqOpts = ambassadorWixBlogV3Category.createCategory(payload);
__log(`"CreateCategory" sending request with: ${__inspect(reqOpts)}`);
try {
const { data } = yield httpClient.request(reqOpts);
return fromJSON(data);
}
catch (err) {
const transformedError = velo_1.transformError(err, requestTransformation, [
'category',
'options',
]);
throw transformedError;
}
});
}
exports.createCategory = createCategory;
/**
* Updates a category.
* @param _id - Category ID.
* @public
* @requiredField _id
* @requiredField category
*/
function updateCategory(_id, category, options) {
return __awaiter(this, arguments, void 0, function* () {
const requestTransformation = {
category: { '*': '$[1]', id: '$[0]' },
fieldMask: '$[2].fieldMask',
fieldsets: '$[2].fieldsets',
};
const responseTransformation = '$';
// @ts-ignore
const httpClient = arguments[3].httpClient;
const { toAmbassadorRequest } = velo_1.serializer({
rootSchema: _updateCategoryRequest,
depSchemas: { _category, _coverMedia },
fqdnTransformation: {
paths: [...['category']],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = velo_1.serializer({
rootSchema: _updateCategoryResponse,
depSchemas: { _category, _coverMedia },
fqdnTransformation: {
paths: [...['category']],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([_id, category, options]);
const reqOpts = ambassadorWixBlogV3Category.updateCategory(payload);
__log(`"UpdateCategory" sending request with: ${__inspect(reqOpts)}`);
try {
const { data } = yield httpClient.request(reqOpts);
return fromJSON(data);
}
catch (err) {
const transformedError = velo_1.transformError(err, requestTransformation, [
'_id',
'category',
'options',
]);
throw transformedError;
}
});
}
exports.updateCategory = updateCategory;
/**
* Gets a category by the specified ID.

@@ -423,48 +313,2 @@ *

exports.queryCategories = queryCategories;
/**
* Deletes a category.
* @param categoryId - Category ID.
* @public
* @requiredField categoryId
*/
function deleteCategory(categoryId) {
return __awaiter(this, arguments, void 0, function* () {
const requestTransformation = { categoryId: '$[0]' };
const responseTransformation = '$';
// @ts-ignore
const httpClient = arguments[1].httpClient;
const { toAmbassadorRequest } = velo_1.serializer({
rootSchema: _deleteCategoryRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = velo_1.serializer({
rootSchema: _deleteCategoryResponse,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([categoryId]);
const reqOpts = ambassadorWixBlogV3Category.deleteCategory(payload);
__log(`"DeleteCategory" sending request with: ${__inspect(reqOpts)}`);
try {
const { data } = yield httpClient.request(reqOpts);
return fromJSON(data);
}
catch (err) {
const transformedError = velo_1.transformError(err, requestTransformation, [
'categoryId',
]);
throw transformedError;
}
});
}
exports.deleteCategory = deleteCategory;
//# sourceMappingURL=blog-v3-category.universal.js.map
import { RequestOptionsFactory } from '@wix/sdk-types';
import { CreateTagRequest, CreateTagResponse, DeleteTagRequest, DeleteTagResponse, GetTagByLabelRequest, GetTagByLabelResponse, GetTagBySlugRequest, GetTagBySlugResponse, GetTagRequest, GetTagResponse, QueryTagsRequest, QueryTagsResponse } from './blog-v3-tag.types';
/** Creates a new tag with the provided label if the tag does not already exist. */
export declare function createTag(payload: CreateTagRequest): RequestOptionsFactory<CreateTagResponse>;
import { GetTagByLabelRequest, GetTagByLabelResponse, GetTagBySlugRequest, GetTagBySlugResponse, GetTagRequest, GetTagResponse, QueryTagsRequest, QueryTagsResponse } from './blog-v3-tag.types';
/**

@@ -44,3 +42,1 @@ * Gets a tag by the specified label.

export declare function queryTags(payload: QueryTagsRequest): RequestOptionsFactory<QueryTagsResponse>;
/** Deletes a tag. */
export declare function deleteTag(payload: DeleteTagRequest): RequestOptionsFactory<DeleteTagResponse>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deleteTag = exports.queryTags = exports.getTagBySlug = exports.getTag = exports.getTagByLabel = exports.createTag = void 0;
exports.queryTags = exports.getTagBySlug = exports.getTag = exports.getTagByLabel = void 0;
const metro_runtime_1 = require("@wix/metro-runtime");
const ambassador_1 = require("@wix/metro-runtime/ambassador");
const metro_runtime_2 = require("@wix/metro-runtime");
const _createTagRequest = {};
const _createTagResponse = { tag: '_tag' };
const _deleteTagRequest = {};
const _deleteTagResponse = {};
const _getTagByLabelRequest = {};

@@ -222,24 +218,2 @@ const _getTagByLabelResponse = { tag: '_tag' };

}
/** Creates a new tag with the provided label if the tag does not already exist. */
function createTag(payload) {
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_createTagRequest, {});
const { fromJSON: fromRes } = ambassador_1.serializer(_createTagResponse, { _tag });
function __createTag({ host }) {
const serializedData = toReq(payload);
const metadata = {
method: 'POST',
url: resolveComWixpressNpmCommunitiesPlatformizedBlogTagServiceUrl({
protoPath: '/v3/tags',
data: serializedData,
host,
}),
data: serializedData,
transformResponse: fromRes,
};
return metadata;
}
__createTag.fromReq = fromReq;
return __createTag;
}
exports.createTag = createTag;
/**

@@ -364,24 +338,2 @@ * Gets a tag by the specified label.

exports.queryTags = queryTags;
/** Deletes a tag. */
function deleteTag(payload) {
const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_deleteTagRequest, {});
const { fromJSON: fromRes } = ambassador_1.serializer(_deleteTagResponse, {});
function __deleteTag({ host }) {
const serializedData = toReq(payload);
const metadata = {
method: 'DELETE',
url: resolveComWixpressNpmCommunitiesPlatformizedBlogTagServiceUrl({
protoPath: '/v3/tags/{tagId}',
data: serializedData,
host,
}),
params: metro_runtime_1.toURLSearchParams(serializedData),
transformResponse: fromRes,
};
return metadata;
}
__deleteTag.fromReq = fromReq;
return __deleteTag;
}
exports.deleteTag = deleteTag;
//# sourceMappingURL=blog-v3-tag.http.js.map
import { HttpClient } from '@wix/sdk-types';
import { CreateTagOptions, GetTagByLabelOptions, GetTagBySlugOptions, GetTagOptions, QueryTagsOptions } from './blog-v3-tag.universal';
export declare function createTag(httpClient: HttpClient): (label: string, options?: CreateTagOptions | undefined) => Promise<import("./blog-v3-tag.universal").CreateTagResponse>;
import { GetTagByLabelOptions, GetTagBySlugOptions, GetTagOptions, QueryTagsOptions } from './blog-v3-tag.universal';
export declare function getTagByLabel(httpClient: HttpClient): (label: string, options?: GetTagByLabelOptions | undefined) => Promise<import("./blog-v3-tag.universal").GetTagByLabelResponse>;

@@ -8,4 +7,3 @@ export declare function getTag(httpClient: HttpClient): (tagId: string, options?: GetTagOptions | undefined) => Promise<import("./blog-v3-tag.universal").GetTagResponse>;

export declare function queryTags(httpClient: HttpClient): (options?: QueryTagsOptions | undefined) => import("./blog-v3-tag.universal").TagsQueryBuilder;
export declare function deleteTag(httpClient: HttpClient): (tagId: string) => Promise<void>;
export { Field, SortOrder } from './blog-v3-tag.universal';
export { Tag, InitialTagsCopied, GetOrCreateTagRequest, GetOrCreateTagResponse, CreateTagRequest, CreateTagResponse, UpdateTagRequest, UpdateTagResponse, BulkCreateTagsRequest, BulkCreateTagsResponse, BulkTagResult, ItemMetadata, ApplicationError, BulkActionMetadata, GetTagByLabelRequest, GetTagByLabelResponse, GetTagRequest, GetTagResponse, GetTagBySlugRequest, GetTagBySlugResponse, QueryTagsRequest, Sorting, Paging, TagsFieldSet, PlatformQuery, PlatformQueryPagingMethodOneOf, CursorPaging, QueryTagsResponse, MetaData, PagingMetadataV2, Cursors, ListTagsRequest, ListTagsRequestPagingMethodOneOf, ListTagsResponse, DeleteTagRequest, DeleteTagResponse, CreateTagOptions, GetTagByLabelOptions, GetTagOptions, GetTagBySlugOptions, QueryTagsOptions, TagsQueryResult, TagsQueryBuilder, } from './blog-v3-tag.universal';
export { Tag, InitialTagsCopied, GetOrCreateTagRequest, GetOrCreateTagResponse, CreateTagRequest, CreateTagResponse, UpdateTagRequest, UpdateTagResponse, BulkCreateTagsRequest, BulkCreateTagsResponse, BulkTagResult, ItemMetadata, ApplicationError, BulkActionMetadata, GetTagByLabelRequest, GetTagByLabelResponse, GetTagRequest, GetTagResponse, GetTagBySlugRequest, GetTagBySlugResponse, QueryTagsRequest, Sorting, Paging, TagsFieldSet, PlatformQuery, PlatformQueryPagingMethodOneOf, CursorPaging, QueryTagsResponse, MetaData, PagingMetadataV2, Cursors, ListTagsRequest, ListTagsRequestPagingMethodOneOf, ListTagsResponse, DeleteTagRequest, DeleteTagResponse, GetTagByLabelOptions, GetTagOptions, GetTagBySlugOptions, QueryTagsOptions, TagsQueryResult, TagsQueryBuilder, } from './blog-v3-tag.universal';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SortOrder = exports.Field = exports.deleteTag = exports.queryTags = exports.getTagBySlug = exports.getTag = exports.getTagByLabel = exports.createTag = void 0;
exports.SortOrder = exports.Field = exports.queryTags = exports.getTagBySlug = exports.getTag = exports.getTagByLabel = void 0;
const blog_v3_tag_universal_1 = require("./blog-v3-tag.universal");
function createTag(httpClient) {
return (label, options) => blog_v3_tag_universal_1.createTag(label, options,
// @ts-ignore
{ httpClient });
}
exports.createTag = createTag;
function getTagByLabel(httpClient) {

@@ -35,8 +29,2 @@ return (label, options) => blog_v3_tag_universal_1.getTagByLabel(label, options,

exports.queryTags = queryTags;
function deleteTag(httpClient) {
return (tagId) => blog_v3_tag_universal_1.deleteTag(tagId,
// @ts-ignore
{ httpClient });
}
exports.deleteTag = deleteTag;
var blog_v3_tag_universal_2 = require("./blog-v3-tag.universal");

@@ -43,0 +31,0 @@ Object.defineProperty(exports, "Field", { enumerable: true, get: function () { return blog_v3_tag_universal_2.Field; } });

@@ -93,3 +93,3 @@ export interface Tag {

/** Tag label. Unique per blog. */
label: string;
label?: string;
/**

@@ -413,5 +413,5 @@ * Tag language.

/** Tag ID. */
tagId: string;
tagId?: string;
}
export interface DeleteTagResponse {
}

@@ -99,3 +99,3 @@ export declare const __debug: {

/** Tag label. Unique per blog. */
label: string;
label?: string;
/**

@@ -419,3 +419,3 @@ * Tag language.

/** Tag ID. */
tagId: string;
tagId?: string;
}

@@ -425,25 +425,2 @@ export interface DeleteTagResponse {

/**
* Creates a new tag with the provided label if the tag does not already exist.
* @param label - Tag label. Unique per blog.
* @public
* @requiredField label
*/
export declare function createTag(label: string, options?: CreateTagOptions): Promise<CreateTagResponse>;
export interface CreateTagOptions {
/**
* Tag language.
*
* 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
*/
language?: string;
/** Preferred tag slug. For example, 'tag-slug'. */
slug?: string | null;
/**
* List of tag fields to be included in the response if the entities are present.
* Base default fieldset returns all core tag properties (all properties that are not a supported fieldset value).
* For example, when `URL` fieldset is selected, returned tag will include the set of base properties and the tag's preview url.
*/
fieldsets?: Field[];
}
/**
* Gets a tag by the specified label.

@@ -599,9 +576,2 @@ *

}
/**
* Deletes a tag.
* @param tagId - Tag ID.
* @public
* @requiredField tagId
*/
export declare function deleteTag(tagId: string): Promise<void>;
export {};

@@ -31,3 +31,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.deleteTag = exports.queryTags = exports.getTagBySlug = exports.getTag = exports.getTagByLabel = exports.createTag = exports.SortOrder = exports.Field = exports.__debug = void 0;
exports.queryTags = exports.getTagBySlug = exports.getTag = exports.getTagByLabel = exports.SortOrder = exports.Field = exports.__debug = void 0;
const velo_1 = require("@wix/metro-runtime/velo");

@@ -63,6 +63,2 @@ const ambassadorWixBlogV3Tag = __importStar(require("./blog-v3-tag.http"));

})(SortOrder = exports.SortOrder || (exports.SortOrder = {}));
const _createTagRequest = {};
const _createTagResponse = { tag: '_tag' };
const _deleteTagRequest = {};
const _deleteTagResponse = {};
const _getTagByLabelRequest = {};

@@ -78,54 +74,2 @@ const _getTagByLabelResponse = { tag: '_tag' };

/**
* Creates a new tag with the provided label if the tag does not already exist.
* @param label - Tag label. Unique per blog.
* @public
* @requiredField label
*/
function createTag(label, options) {
return __awaiter(this, arguments, void 0, function* () {
const requestTransformation = {
label: '$[0]',
language: '$[1].language',
slug: '$[1].slug',
fieldsets: '$[1].fieldsets',
};
const responseTransformation = '$';
// @ts-ignore
const httpClient = arguments[2].httpClient;
const { toAmbassadorRequest } = velo_1.serializer({
rootSchema: _createTagRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = velo_1.serializer({
rootSchema: _createTagResponse,
depSchemas: { _tag },
fqdnTransformation: {
paths: [...['tag']],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([label, options]);
const reqOpts = ambassadorWixBlogV3Tag.createTag(payload);
__log(`"CreateTag" sending request with: ${__inspect(reqOpts)}`);
try {
const { data } = yield httpClient.request(reqOpts);
return fromJSON(data);
}
catch (err) {
const transformedError = velo_1.transformError(err, requestTransformation, [
'label',
'options',
]);
throw transformedError;
}
});
}
exports.createTag = createTag;
/**
* Gets a tag by the specified label.

@@ -356,48 +300,2 @@ *

exports.queryTags = queryTags;
/**
* Deletes a tag.
* @param tagId - Tag ID.
* @public
* @requiredField tagId
*/
function deleteTag(tagId) {
return __awaiter(this, arguments, void 0, function* () {
const requestTransformation = { tagId: '$[0]' };
const responseTransformation = '$';
// @ts-ignore
const httpClient = arguments[1].httpClient;
const { toAmbassadorRequest } = velo_1.serializer({
rootSchema: _deleteTagRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = velo_1.serializer({
rootSchema: _deleteTagResponse,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([tagId]);
const reqOpts = ambassadorWixBlogV3Tag.deleteTag(payload);
__log(`"DeleteTag" sending request with: ${__inspect(reqOpts)}`);
try {
const { data } = yield httpClient.request(reqOpts);
return fromJSON(data);
}
catch (err) {
const transformedError = velo_1.transformError(err, requestTransformation, [
'tagId',
]);
throw transformedError;
}
});
}
exports.deleteTag = deleteTag;
//# sourceMappingURL=blog-v3-tag.universal.js.map
import { RequestOptionsFactory } from '@wix/sdk-types';
import { CreateCategoryRequest, CreateCategoryResponse, DeleteCategoryRequest, DeleteCategoryResponse, GetCategoryBySlugRequest, GetCategoryBySlugResponse, GetCategoryRequest, GetCategoryResponse, ListCategoriesRequest, ListCategoriesResponse, QueryCategoriesRequest, QueryCategoriesResponse, UpdateCategoryRequest, UpdateCategoryResponse } from './blog-v3-category.types';
/** Creates a category. */
export declare function createCategory(payload: CreateCategoryRequest): RequestOptionsFactory<CreateCategoryResponse>;
/** Updates a category. */
export declare function updateCategory(payload: UpdateCategoryRequest): RequestOptionsFactory<UpdateCategoryResponse>;
import { GetCategoryBySlugRequest, GetCategoryBySlugResponse, GetCategoryRequest, GetCategoryResponse, ListCategoriesRequest, ListCategoriesResponse, QueryCategoriesRequest, QueryCategoriesResponse } from './blog-v3-category.types';
/**

@@ -49,3 +45,1 @@ * Gets a category by the specified ID.

export declare function queryCategories(payload: QueryCategoriesRequest): RequestOptionsFactory<QueryCategoriesResponse>;
/** Deletes a category. */
export declare function deleteCategory(payload: DeleteCategoryRequest): RequestOptionsFactory<DeleteCategoryResponse>;

@@ -6,6 +6,2 @@ import { toURLSearchParams } from '@wix/metro-runtime';

const _coverMedia = { image: '_image', video: '_video' };
const _createCategoryRequest = { category: '_category' };
const _createCategoryResponse = { category: '_category' };
const _deleteCategoryRequest = {};
const _deleteCategoryResponse = {};
const _getCategoryBySlugRequest = {};

@@ -20,7 +16,2 @@ const _getCategoryBySlugResponse = { category: '_category' };

const _queryCategoriesResponse = { categories: '_category' };
const _updateCategoryRequest = {
fieldMask: 'google.protobuf.FieldMask',
category: '_category',
};
const _updateCategoryResponse = { category: '_category' };
const _video = { thumbnail: '_image' };

@@ -226,50 +217,2 @@ function resolveComWixpressNpmCommunitiesPlatformizedBlogV3CategoryServiceUrl(opts) {

}
/** Creates a category. */
export function createCategory(payload) {
const { toJSON: toReq, fromJSON: fromReq } = serializer(_createCategoryRequest, { _category, _coverMedia, _image, _video });
const { fromJSON: fromRes } = serializer(_createCategoryResponse, {
_category,
_coverMedia,
_image,
_video,
});
function __createCategory({ host }) {
const serializedData = toReq(payload);
const metadata = {
method: 'POST',
url: resolveComWixpressNpmCommunitiesPlatformizedBlogV3CategoryServiceUrl({ protoPath: '/v3/categories', data: serializedData, host }),
data: serializedData,
transformResponse: fromRes,
};
return metadata;
}
__createCategory.fromReq = fromReq;
return __createCategory;
}
/** Updates a category. */
export function updateCategory(payload) {
const { toJSON: toReq, fromJSON: fromReq } = serializer(_updateCategoryRequest, { _category, _coverMedia, _image, _video });
const { fromJSON: fromRes } = serializer(_updateCategoryResponse, {
_category,
_coverMedia,
_image,
_video,
});
function __updateCategory({ host }) {
const serializedData = toReq(payload);
const metadata = {
method: 'PATCH',
url: resolveComWixpressNpmCommunitiesPlatformizedBlogV3CategoryServiceUrl({
protoPath: '/v3/categories/{category.id}',
data: serializedData,
host,
}),
data: serializedData,
transformResponse: fromRes,
};
return metadata;
}
__updateCategory.fromReq = fromReq;
return __updateCategory;
}
/**

@@ -397,19 +340,2 @@ * Gets a category by the specified ID.

}
/** Deletes a category. */
export function deleteCategory(payload) {
const { toJSON: toReq, fromJSON: fromReq } = serializer(_deleteCategoryRequest, {});
const { fromJSON: fromRes } = serializer(_deleteCategoryResponse, {});
function __deleteCategory({ host }) {
const serializedData = toReq(payload);
const metadata = {
method: 'DELETE',
url: resolveComWixpressNpmCommunitiesPlatformizedBlogV3CategoryServiceUrl({ protoPath: '/v3/categories/{categoryId}', data: serializedData, host }),
params: toURLSearchParams(serializedData),
transformResponse: fromRes,
};
return metadata;
}
__deleteCategory.fromReq = fromReq;
return __deleteCategory;
}
//# sourceMappingURL=blog-v3-category.http.js.map
import { HttpClient } from '@wix/sdk-types';
import { Category, UpdateCategory, CreateCategoryOptions, GetCategoryBySlugOptions, GetCategoryOptions, ListCategoriesOptions, QueryCategoriesOptions, UpdateCategoryOptions } from './blog-v3-category.universal';
export declare function createCategory(httpClient: HttpClient): (category: Category, options?: CreateCategoryOptions | undefined) => Promise<import("./blog-v3-category.universal").CreateCategoryResponse>;
export declare function updateCategory(httpClient: HttpClient): (_id: string, category: UpdateCategory, options?: UpdateCategoryOptions | undefined) => Promise<import("./blog-v3-category.universal").UpdateCategoryResponse>;
import { GetCategoryBySlugOptions, GetCategoryOptions, ListCategoriesOptions, QueryCategoriesOptions } from './blog-v3-category.universal';
export declare function getCategory(httpClient: HttpClient): (categoryId: string, options?: GetCategoryOptions | undefined) => Promise<import("./blog-v3-category.universal").GetCategoryResponse>;

@@ -9,4 +7,3 @@ export declare function getCategoryBySlug(httpClient: HttpClient): (slug: string, options?: GetCategoryBySlugOptions | undefined) => Promise<import("./blog-v3-category.universal").GetCategoryBySlugResponse>;

export declare function queryCategories(httpClient: HttpClient): (options?: QueryCategoriesOptions | undefined) => import("./blog-v3-category.universal").CategoriesQueryBuilder;
export declare function deleteCategory(httpClient: HttpClient): (categoryId: string) => Promise<void>;
export { Field, SortOrder } from './blog-v3-category.universal';
export { Category, CoverMedia, CoverMediaMediaOneOf, SeoSchema, Tag, Settings, InitialCategoriesCopied, CreateCategoryRequest, CreateCategoryResponse, BulkCreateCategoriesRequest, BulkCreateCategoriesResponse, BulkCategoryResult, ItemMetadata, ApplicationError, BulkActionMetadata, UpdateCategoryRequest, UpdateCategoryResponse, GetCategoryRequest, GetCategoryResponse, GetCategoryBySlugRequest, GetCategoryBySlugResponse, ListCategoriesRequest, BlogPaging, ListCategoriesResponse, MetaData, QueryCategoriesRequest, Sorting, PlatformQuery, PlatformQueryPagingMethodOneOf, Paging, CursorPaging, QueryCategoriesResponse, PagingMetadataV2, Cursors, DeleteCategoryRequest, DeleteCategoryResponse, CreateCategoryOptions, UpdateCategory, UpdateCategoryOptions, GetCategoryOptions, GetCategoryBySlugOptions, ListCategoriesOptions, QueryCategoriesOptions, CategoriesQueryResult, CategoriesQueryBuilder, } from './blog-v3-category.universal';
export { Category, CoverMedia, CoverMediaMediaOneOf, SeoSchema, Tag, Settings, InitialCategoriesCopied, CreateCategoryRequest, CreateCategoryResponse, BulkCreateCategoriesRequest, BulkCreateCategoriesResponse, BulkCategoryResult, ItemMetadata, ApplicationError, BulkActionMetadata, UpdateCategoryRequest, UpdateCategoryResponse, GetCategoryRequest, GetCategoryResponse, GetCategoryBySlugRequest, GetCategoryBySlugResponse, ListCategoriesRequest, BlogPaging, ListCategoriesResponse, MetaData, QueryCategoriesRequest, Sorting, PlatformQuery, PlatformQueryPagingMethodOneOf, Paging, CursorPaging, QueryCategoriesResponse, PagingMetadataV2, Cursors, DeleteCategoryRequest, DeleteCategoryResponse, GetCategoryOptions, GetCategoryBySlugOptions, ListCategoriesOptions, QueryCategoriesOptions, CategoriesQueryResult, CategoriesQueryBuilder, } from './blog-v3-category.universal';

@@ -1,12 +0,2 @@

import { createCategory as universalCreateCategory, updateCategory as universalUpdateCategory, getCategory as universalGetCategory, getCategoryBySlug as universalGetCategoryBySlug, listCategories as universalListCategories, queryCategories as universalQueryCategories, deleteCategory as universalDeleteCategory, } from './blog-v3-category.universal';
export function createCategory(httpClient) {
return (category, options) => universalCreateCategory(category, options,
// @ts-ignore
{ httpClient });
}
export function updateCategory(httpClient) {
return (_id, category, options) => universalUpdateCategory(_id, category, options,
// @ts-ignore
{ httpClient });
}
import { getCategory as universalGetCategory, getCategoryBySlug as universalGetCategoryBySlug, listCategories as universalListCategories, queryCategories as universalQueryCategories, } from './blog-v3-category.universal';
export function getCategory(httpClient) {

@@ -32,8 +22,3 @@ return (categoryId, options) => universalGetCategory(categoryId, options,

}
export function deleteCategory(httpClient) {
return (categoryId) => universalDeleteCategory(categoryId,
// @ts-ignore
{ httpClient });
}
export { Field, SortOrder } from './blog-v3-category.universal';
//# sourceMappingURL=blog-v3-category.public.js.map

@@ -173,3 +173,3 @@ export interface Category {

/** Category info. */
category: Category;
category?: Category;
/**

@@ -247,3 +247,3 @@ * List of category fields to be included in the response if the entities are present.

/** Category info. */
category: Category;
category?: Category;
/** Field mask of fields to update. */

@@ -471,5 +471,5 @@ fieldMask?: string[];

/** Category ID. */
categoryId: string;
categoryId?: string;
}
export interface DeleteCategoryResponse {
}

@@ -126,3 +126,3 @@ export declare const __debug: {

/** Category info. */
category: Category;
category?: Category;
/**

@@ -200,3 +200,3 @@ * List of category fields to be included in the response if the entities are present.

/** Category info. */
category: Category;
category?: Category;
/** Field mask of fields to update. */

@@ -425,3 +425,3 @@ fieldMask?: string[];

/** Category ID. */
categoryId: string;
categoryId?: string;
}

@@ -431,98 +431,2 @@ export interface DeleteCategoryResponse {

/**
* Creates a category.
* @param category - Category info.
* @public
* @requiredField category
* @requiredField category.label
*/
export declare function createCategory(category: Category, options?: CreateCategoryOptions): Promise<CreateCategoryResponse>;
export interface CreateCategoryOptions {
/**
* List of category fields to be included in the response if the entities are present.
* Base default fieldset returns all core category properties (all properties that are not a supported fieldset value).
* For example, when `URL` fieldset is selected, returned category will include the set of base properties and the category's preview url.
*/
fieldsets?: Field[];
}
/**
* Updates a category.
* @param _id - Category ID.
* @public
* @requiredField _id
* @requiredField category
*/
export declare function updateCategory(_id: string, category: UpdateCategory, options?: UpdateCategoryOptions): Promise<UpdateCategoryResponse>;
export interface UpdateCategory {
/**
* Category ID.
* @readonly
*/
_id?: string;
/** Category label. Displayed in the Category Menu. */
label?: string;
/**
* Number of posts in the category.
* @readonly
*/
postCount?: number;
/**
* Category URL.
*
*
* The `url` directs you to a page that lists every post with the specified category.
*
* @readonly
*/
url?: string;
/** Category description. */
description?: string | null;
/** Category title. */
title?: string;
/** Reserved for internal use. */
coverMedia?: CoverMedia;
/**
* Reserved for internal use.
* @readonly
*/
oldRank?: number;
/** Reserved for internal use. */
rank?: number | null;
/** Position of the category in the [Category Menu](https://support.wix.com/en/article/wix-blog-adding-and-customizing-a-category-menu). Categories with lower display position are displayed first. */
displayPosition?: number | null;
/** ID of the category's translations when [Wix Multilingual](https://wix.wixanswers.com/app/kb/article/36837a9d-5d22-4fa1-9a80-1b99b7f82b5e/en) is installed on a site. All translations of a single category will share the same `translationId`. */
translationId?: string | null;
/**
* Category Language.
*
* 2-letter language code in [ISO 639-1 format](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
*/
language?: string;
/**
* Part of a category's URL that refers to a specific category.
*
*
* For example, `'https:/example.com/blog/category/{my-category-slug}'`.
*/
slug?: string;
/**
* Reserved for internal use.
* @readonly
*/
internalId?: string | null;
/** SEO data. */
seoData?: SeoSchema;
/** Category cover image. */
coverImage?: string;
}
export interface UpdateCategoryOptions {
/** Field mask of fields to update. */
fieldMask?: string[];
/**
* List of category fields to be included in the response if the entities are present.
* Base default fieldset returns all core category properties (all properties that are not a supported fieldset value).
* For example, when `URL` fieldset is selected, returned category will include the set of base properties and the category's preview url.
*/
fieldsets?: Field[];
}
/**
* Gets a category by the specified ID.

@@ -683,9 +587,2 @@ *

}
/**
* Deletes a category.
* @param categoryId - Category ID.
* @public
* @requiredField categoryId
*/
export declare function deleteCategory(categoryId: string): Promise<void>;
export {};

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

const _coverMedia = { image: 'wix.common.Image', video: 'wix.common.Video' };
const _createCategoryRequest = { category: '_category' };
const _createCategoryResponse = { category: '_category' };
const _deleteCategoryRequest = {};
const _deleteCategoryResponse = {};
const _getCategoryBySlugRequest = {};

@@ -66,107 +62,3 @@ const _getCategoryBySlugResponse = { category: '_category' };

const _queryCategoriesResponse = { categories: '_category' };
const _updateCategoryRequest = { category: '_category' };
const _updateCategoryResponse = { category: '_category' };
/**
* Creates a category.
* @param category - Category info.
* @public
* @requiredField category
* @requiredField category.label
*/
export function createCategory(category, options) {
return __awaiter(this, arguments, void 0, function* () {
const requestTransformation = {
category: '$[0]',
fieldsets: '$[1].fieldsets',
};
const responseTransformation = '$';
// @ts-ignore
const httpClient = arguments[2].httpClient;
const { toAmbassadorRequest } = serializer({
rootSchema: _createCategoryRequest,
depSchemas: { _category, _coverMedia },
fqdnTransformation: {
paths: [...['category']],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = serializer({
rootSchema: _createCategoryResponse,
depSchemas: { _category, _coverMedia },
fqdnTransformation: {
paths: [...['category']],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([category, options]);
const reqOpts = ambassadorWixBlogV3Category.createCategory(payload);
__log(`"CreateCategory" sending request with: ${__inspect(reqOpts)}`);
try {
const { data } = yield httpClient.request(reqOpts);
return fromJSON(data);
}
catch (err) {
const transformedError = transformError(err, requestTransformation, [
'category',
'options',
]);
throw transformedError;
}
});
}
/**
* Updates a category.
* @param _id - Category ID.
* @public
* @requiredField _id
* @requiredField category
*/
export function updateCategory(_id, category, options) {
return __awaiter(this, arguments, void 0, function* () {
const requestTransformation = {
category: { '*': '$[1]', id: '$[0]' },
fieldMask: '$[2].fieldMask',
fieldsets: '$[2].fieldsets',
};
const responseTransformation = '$';
// @ts-ignore
const httpClient = arguments[3].httpClient;
const { toAmbassadorRequest } = serializer({
rootSchema: _updateCategoryRequest,
depSchemas: { _category, _coverMedia },
fqdnTransformation: {
paths: [...['category']],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = serializer({
rootSchema: _updateCategoryResponse,
depSchemas: { _category, _coverMedia },
fqdnTransformation: {
paths: [...['category']],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([_id, category, options]);
const reqOpts = ambassadorWixBlogV3Category.updateCategory(payload);
__log(`"UpdateCategory" sending request with: ${__inspect(reqOpts)}`);
try {
const { data } = yield httpClient.request(reqOpts);
return fromJSON(data);
}
catch (err) {
const transformedError = transformError(err, requestTransformation, [
'_id',
'category',
'options',
]);
throw transformedError;
}
});
}
/**
* Gets a category by the specified ID.

@@ -394,47 +286,2 @@ *

}
/**
* Deletes a category.
* @param categoryId - Category ID.
* @public
* @requiredField categoryId
*/
export function deleteCategory(categoryId) {
return __awaiter(this, arguments, void 0, function* () {
const requestTransformation = { categoryId: '$[0]' };
const responseTransformation = '$';
// @ts-ignore
const httpClient = arguments[1].httpClient;
const { toAmbassadorRequest } = serializer({
rootSchema: _deleteCategoryRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = serializer({
rootSchema: _deleteCategoryResponse,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([categoryId]);
const reqOpts = ambassadorWixBlogV3Category.deleteCategory(payload);
__log(`"DeleteCategory" sending request with: ${__inspect(reqOpts)}`);
try {
const { data } = yield httpClient.request(reqOpts);
return fromJSON(data);
}
catch (err) {
const transformedError = transformError(err, requestTransformation, [
'categoryId',
]);
throw transformedError;
}
});
}
//# sourceMappingURL=blog-v3-category.universal.js.map
import { RequestOptionsFactory } from '@wix/sdk-types';
import { CreateTagRequest, CreateTagResponse, DeleteTagRequest, DeleteTagResponse, GetTagByLabelRequest, GetTagByLabelResponse, GetTagBySlugRequest, GetTagBySlugResponse, GetTagRequest, GetTagResponse, QueryTagsRequest, QueryTagsResponse } from './blog-v3-tag.types';
/** Creates a new tag with the provided label if the tag does not already exist. */
export declare function createTag(payload: CreateTagRequest): RequestOptionsFactory<CreateTagResponse>;
import { GetTagByLabelRequest, GetTagByLabelResponse, GetTagBySlugRequest, GetTagBySlugResponse, GetTagRequest, GetTagResponse, QueryTagsRequest, QueryTagsResponse } from './blog-v3-tag.types';
/**

@@ -44,3 +42,1 @@ * Gets a tag by the specified label.

export declare function queryTags(payload: QueryTagsRequest): RequestOptionsFactory<QueryTagsResponse>;
/** Deletes a tag. */
export declare function deleteTag(payload: DeleteTagRequest): RequestOptionsFactory<DeleteTagResponse>;
import { toURLSearchParams } from '@wix/metro-runtime';
import { serializer } from '@wix/metro-runtime/ambassador';
import { resolveUrl } from '@wix/metro-runtime';
const _createTagRequest = {};
const _createTagResponse = { tag: '_tag' };
const _deleteTagRequest = {};
const _deleteTagResponse = {};
const _getTagByLabelRequest = {};

@@ -219,23 +215,2 @@ const _getTagByLabelResponse = { tag: '_tag' };

}
/** Creates a new tag with the provided label if the tag does not already exist. */
export function createTag(payload) {
const { toJSON: toReq, fromJSON: fromReq } = serializer(_createTagRequest, {});
const { fromJSON: fromRes } = serializer(_createTagResponse, { _tag });
function __createTag({ host }) {
const serializedData = toReq(payload);
const metadata = {
method: 'POST',
url: resolveComWixpressNpmCommunitiesPlatformizedBlogTagServiceUrl({
protoPath: '/v3/tags',
data: serializedData,
host,
}),
data: serializedData,
transformResponse: fromRes,
};
return metadata;
}
__createTag.fromReq = fromReq;
return __createTag;
}
/**

@@ -356,23 +331,2 @@ * Gets a tag by the specified label.

}
/** Deletes a tag. */
export function deleteTag(payload) {
const { toJSON: toReq, fromJSON: fromReq } = serializer(_deleteTagRequest, {});
const { fromJSON: fromRes } = serializer(_deleteTagResponse, {});
function __deleteTag({ host }) {
const serializedData = toReq(payload);
const metadata = {
method: 'DELETE',
url: resolveComWixpressNpmCommunitiesPlatformizedBlogTagServiceUrl({
protoPath: '/v3/tags/{tagId}',
data: serializedData,
host,
}),
params: toURLSearchParams(serializedData),
transformResponse: fromRes,
};
return metadata;
}
__deleteTag.fromReq = fromReq;
return __deleteTag;
}
//# sourceMappingURL=blog-v3-tag.http.js.map
import { HttpClient } from '@wix/sdk-types';
import { CreateTagOptions, GetTagByLabelOptions, GetTagBySlugOptions, GetTagOptions, QueryTagsOptions } from './blog-v3-tag.universal';
export declare function createTag(httpClient: HttpClient): (label: string, options?: CreateTagOptions | undefined) => Promise<import("./blog-v3-tag.universal").CreateTagResponse>;
import { GetTagByLabelOptions, GetTagBySlugOptions, GetTagOptions, QueryTagsOptions } from './blog-v3-tag.universal';
export declare function getTagByLabel(httpClient: HttpClient): (label: string, options?: GetTagByLabelOptions | undefined) => Promise<import("./blog-v3-tag.universal").GetTagByLabelResponse>;

@@ -8,4 +7,3 @@ export declare function getTag(httpClient: HttpClient): (tagId: string, options?: GetTagOptions | undefined) => Promise<import("./blog-v3-tag.universal").GetTagResponse>;

export declare function queryTags(httpClient: HttpClient): (options?: QueryTagsOptions | undefined) => import("./blog-v3-tag.universal").TagsQueryBuilder;
export declare function deleteTag(httpClient: HttpClient): (tagId: string) => Promise<void>;
export { Field, SortOrder } from './blog-v3-tag.universal';
export { Tag, InitialTagsCopied, GetOrCreateTagRequest, GetOrCreateTagResponse, CreateTagRequest, CreateTagResponse, UpdateTagRequest, UpdateTagResponse, BulkCreateTagsRequest, BulkCreateTagsResponse, BulkTagResult, ItemMetadata, ApplicationError, BulkActionMetadata, GetTagByLabelRequest, GetTagByLabelResponse, GetTagRequest, GetTagResponse, GetTagBySlugRequest, GetTagBySlugResponse, QueryTagsRequest, Sorting, Paging, TagsFieldSet, PlatformQuery, PlatformQueryPagingMethodOneOf, CursorPaging, QueryTagsResponse, MetaData, PagingMetadataV2, Cursors, ListTagsRequest, ListTagsRequestPagingMethodOneOf, ListTagsResponse, DeleteTagRequest, DeleteTagResponse, CreateTagOptions, GetTagByLabelOptions, GetTagOptions, GetTagBySlugOptions, QueryTagsOptions, TagsQueryResult, TagsQueryBuilder, } from './blog-v3-tag.universal';
export { Tag, InitialTagsCopied, GetOrCreateTagRequest, GetOrCreateTagResponse, CreateTagRequest, CreateTagResponse, UpdateTagRequest, UpdateTagResponse, BulkCreateTagsRequest, BulkCreateTagsResponse, BulkTagResult, ItemMetadata, ApplicationError, BulkActionMetadata, GetTagByLabelRequest, GetTagByLabelResponse, GetTagRequest, GetTagResponse, GetTagBySlugRequest, GetTagBySlugResponse, QueryTagsRequest, Sorting, Paging, TagsFieldSet, PlatformQuery, PlatformQueryPagingMethodOneOf, CursorPaging, QueryTagsResponse, MetaData, PagingMetadataV2, Cursors, ListTagsRequest, ListTagsRequestPagingMethodOneOf, ListTagsResponse, DeleteTagRequest, DeleteTagResponse, GetTagByLabelOptions, GetTagOptions, GetTagBySlugOptions, QueryTagsOptions, TagsQueryResult, TagsQueryBuilder, } from './blog-v3-tag.universal';

@@ -1,7 +0,2 @@

import { createTag as universalCreateTag, getTagByLabel as universalGetTagByLabel, getTag as universalGetTag, getTagBySlug as universalGetTagBySlug, queryTags as universalQueryTags, deleteTag as universalDeleteTag, } from './blog-v3-tag.universal';
export function createTag(httpClient) {
return (label, options) => universalCreateTag(label, options,
// @ts-ignore
{ httpClient });
}
import { getTagByLabel as universalGetTagByLabel, getTag as universalGetTag, getTagBySlug as universalGetTagBySlug, queryTags as universalQueryTags, } from './blog-v3-tag.universal';
export function getTagByLabel(httpClient) {

@@ -27,8 +22,3 @@ return (label, options) => universalGetTagByLabel(label, options,

}
export function deleteTag(httpClient) {
return (tagId) => universalDeleteTag(tagId,
// @ts-ignore
{ httpClient });
}
export { Field, SortOrder } from './blog-v3-tag.universal';
//# sourceMappingURL=blog-v3-tag.public.js.map

@@ -93,3 +93,3 @@ export interface Tag {

/** Tag label. Unique per blog. */
label: string;
label?: string;
/**

@@ -413,5 +413,5 @@ * Tag language.

/** Tag ID. */
tagId: string;
tagId?: string;
}
export interface DeleteTagResponse {
}

@@ -99,3 +99,3 @@ export declare const __debug: {

/** Tag label. Unique per blog. */
label: string;
label?: string;
/**

@@ -419,3 +419,3 @@ * Tag language.

/** Tag ID. */
tagId: string;
tagId?: string;
}

@@ -425,25 +425,2 @@ export interface DeleteTagResponse {

/**
* Creates a new tag with the provided label if the tag does not already exist.
* @param label - Tag label. Unique per blog.
* @public
* @requiredField label
*/
export declare function createTag(label: string, options?: CreateTagOptions): Promise<CreateTagResponse>;
export interface CreateTagOptions {
/**
* Tag language.
*
* 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
*/
language?: string;
/** Preferred tag slug. For example, 'tag-slug'. */
slug?: string | null;
/**
* List of tag fields to be included in the response if the entities are present.
* Base default fieldset returns all core tag properties (all properties that are not a supported fieldset value).
* For example, when `URL` fieldset is selected, returned tag will include the set of base properties and the tag's preview url.
*/
fieldsets?: Field[];
}
/**
* Gets a tag by the specified label.

@@ -599,9 +576,2 @@ *

}
/**
* Deletes a tag.
* @param tagId - Tag ID.
* @public
* @requiredField tagId
*/
export declare function deleteTag(tagId: string): Promise<void>;
export {};

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

})(SortOrder || (SortOrder = {}));
const _createTagRequest = {};
const _createTagResponse = { tag: '_tag' };
const _deleteTagRequest = {};
const _deleteTagResponse = {};
const _getTagByLabelRequest = {};

@@ -55,53 +51,2 @@ const _getTagByLabelResponse = { tag: '_tag' };

/**
* Creates a new tag with the provided label if the tag does not already exist.
* @param label - Tag label. Unique per blog.
* @public
* @requiredField label
*/
export function createTag(label, options) {
return __awaiter(this, arguments, void 0, function* () {
const requestTransformation = {
label: '$[0]',
language: '$[1].language',
slug: '$[1].slug',
fieldsets: '$[1].fieldsets',
};
const responseTransformation = '$';
// @ts-ignore
const httpClient = arguments[2].httpClient;
const { toAmbassadorRequest } = serializer({
rootSchema: _createTagRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = serializer({
rootSchema: _createTagResponse,
depSchemas: { _tag },
fqdnTransformation: {
paths: [...['tag']],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([label, options]);
const reqOpts = ambassadorWixBlogV3Tag.createTag(payload);
__log(`"CreateTag" sending request with: ${__inspect(reqOpts)}`);
try {
const { data } = yield httpClient.request(reqOpts);
return fromJSON(data);
}
catch (err) {
const transformedError = transformError(err, requestTransformation, [
'label',
'options',
]);
throw transformedError;
}
});
}
/**
* Gets a tag by the specified label.

@@ -328,47 +273,2 @@ *

}
/**
* Deletes a tag.
* @param tagId - Tag ID.
* @public
* @requiredField tagId
*/
export function deleteTag(tagId) {
return __awaiter(this, arguments, void 0, function* () {
const requestTransformation = { tagId: '$[0]' };
const responseTransformation = '$';
// @ts-ignore
const httpClient = arguments[1].httpClient;
const { toAmbassadorRequest } = serializer({
rootSchema: _deleteTagRequest,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _fromVeloEntity,
},
customTransformation: requestTransformation,
});
const { fromJSON } = serializer({
rootSchema: _deleteTagResponse,
depSchemas: {},
fqdnTransformation: {
paths: [],
transformation: _toVeloEntity,
},
customTransformation: responseTransformation,
});
const payload = toAmbassadorRequest([tagId]);
const reqOpts = ambassadorWixBlogV3Tag.deleteTag(payload);
__log(`"DeleteTag" sending request with: ${__inspect(reqOpts)}`);
try {
const { data } = yield httpClient.request(reqOpts);
return fromJSON(data);
}
catch (err) {
const transformedError = transformError(err, requestTransformation, [
'tagId',
]);
throw transformedError;
}
});
}
//# sourceMappingURL=blog-v3-tag.universal.js.map
{
"name": "@wix/blog",
"version": "1.0.128",
"version": "1.0.129",
"publishConfig": {

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

},
"falconPackageHash": "d93fa48740b28c75f13e587e878d7977e8a809916ba94fdc861b9bf2"
"falconPackageHash": "22e27d9daadab1c70d79dd5b8704812647312e6506e323810c75c9f7"
}

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

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

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