@wix/auto_sdk_blog_categories 1.0.15 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { C as Category, a as CreateCategoryOptions, U as UpdateCategory, b as UpdateCategoryOptions, G as GetCategoryOptions, c as GetCategoryResponse, d as GetCategoryBySlugOptions, e as GetCategoryBySlugResponse, L as ListCategoriesOptions, f as ListCategoriesResponse, Q as QueryCategoriesOptions, g as CategoriesQueryBuilder, h as CategoryCreatedEnvelope, i as CategoryDeletedEnvelope, j as CategoryUpdatedEnvelope } from './blog-v3-category-categories.universal-CZqdXr9y.js';
3
- export { ab as ActionEvent, A as ApplicationError, af as BaseEventMetadata, N as BlogPaging, t as BulkActionMetadata, r as BulkCategoryResult, B as BulkCreateCategoriesRequest, q as BulkCreateCategoriesResponse, a1 as BulkDeleteCategoryRequest, a2 as BulkDeleteCategoryResponse, u as BulkUpdateCategoriesRequest, v as BulkUpdateCategoriesResponse, ah as CategoriesQueryResult, D as CategoryLanguageCount, n as CategoryTranslation, o as CreateCategoryRequest, p as CreateCategoryResponse, Z as CursorPaging, a0 as Cursors, a3 as DeleteCategoryRequest, a4 as DeleteCategoryResponse, a5 as DomainEvent, a6 as DomainEventBodyOneOf, a7 as EntityCreatedEvent, aa as EntityDeletedEvent, a9 as EntityUpdatedEvent, ag as EventMetadata, F as Field, m as FocalPoint, y as GetCategoriesCountByLanguageRequest, z as GetCategoriesCountByLanguageResponse, H as GetCategoryBySlugRequest, E as GetCategoryRequest, ad as IdentificationData, ae as IdentificationDataIdOneOf, I as InitialCategoriesCopied, s as ItemMetadata, K as Keyword, J as ListCategoriesRequest, M as MaskedCategory, ac as MessageEnvelope, O as MetaData, Y as Paging, $ as PagingMetadataV2, R as PlatformQuery, V as PlatformQueryPagingMethodOneOf, P as QueryCategoriesRequest, _ as QueryCategoriesResponse, a8 as RestoreInfo, k as SeoSchema, l as Settings, S as SortOrder, X as Sorting, T as Tag, w as UpdateCategoryRequest, x as UpdateCategoryResponse, W as WebhookIdentityType } from './blog-v3-category-categories.universal-CZqdXr9y.js';
2
+ import { Category, CreateCategoryOptions, UpdateCategory, UpdateCategoryOptions, GetCategoryOptions, GetCategoryResponse, GetCategoryBySlugOptions, GetCategoryBySlugResponse, ListCategoriesOptions, ListCategoriesResponse, QueryCategoriesOptions, CategoriesQueryBuilder, CategoryCreatedEnvelope, CategoryDeletedEnvelope, CategoryUpdatedEnvelope } from './index.typings.js';
3
+ export { ActionEvent, ApplicationError, BaseEventMetadata, BlogPaging, BulkActionMetadata, BulkCategoryResult, BulkCreateCategoriesRequest, BulkCreateCategoriesResponse, BulkDeleteCategoryRequest, BulkDeleteCategoryResponse, BulkUpdateCategoriesRequest, BulkUpdateCategoriesResponse, CategoriesQueryResult, CategoryLanguageCount, CategoryTranslation, CreateCategoryRequest, CreateCategoryResponse, CursorPaging, Cursors, DeleteCategoryRequest, DeleteCategoryResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, Field, FocalPoint, GetCategoriesCountByLanguageRequest, GetCategoriesCountByLanguageResponse, GetCategoryBySlugRequest, GetCategoryRequest, IdentificationData, IdentificationDataIdOneOf, InitialCategoriesCopied, ItemMetadata, Keyword, ListCategoriesRequest, MaskedCategory, MessageEnvelope, MetaData, Paging, PagingMetadataV2, PlatformQuery, PlatformQueryPagingMethodOneOf, QueryCategoriesRequest, QueryCategoriesResponse, RestoreInfo, SeoSchema, Settings, SortOrder, Sorting, Tag, UpdateCategoryRequest, UpdateCategoryResponse, WebhookIdentityType } from './index.typings.js';
4
4
 
5
5
  declare function createCategory$1(httpClient: HttpClient): CreateCategorySignature;
6
6
  interface CreateCategorySignature {
@@ -1,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  interface Category {
2
4
  /**
3
5
  * Category ID.
@@ -732,13 +734,77 @@ interface CategoryCreatedEnvelope {
732
734
  entity: Category;
733
735
  metadata: EventMetadata;
734
736
  }
737
+ /**
738
+ * Triggered when a category is created.
739
+ * @permissionScope Read Blog
740
+ * @permissionScopeId SCOPE.DC-BLOG.READ-BLOGS
741
+ * @permissionScope Manage Blog
742
+ * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
743
+ * @permissionScope Manage Blog
744
+ * @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
745
+ * @permissionScope Read Draft Blog Posts
746
+ * @permissionScopeId SCOPE.DC-BLOG.READ-DRAFT-POSTS
747
+ * @permissionId BLOG.READ-CATEGORY
748
+ * @webhook
749
+ * @eventType wix.blog.v3.category_created
750
+ * @serviceIdentifier com.wixpress.npm.communities.platformized.blog.v3.CategoryService
751
+ * @slug created
752
+ */
753
+ declare function onCategoryCreated(handler: (event: CategoryCreatedEnvelope) => void | Promise<void>): void;
735
754
  interface CategoryDeletedEnvelope {
736
755
  metadata: EventMetadata;
737
756
  }
757
+ /**
758
+ * Triggered when a category is deleted.
759
+ * @permissionScope Read Blog
760
+ * @permissionScopeId SCOPE.DC-BLOG.READ-BLOGS
761
+ * @permissionScope Manage Blog
762
+ * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
763
+ * @permissionScope Manage Blog
764
+ * @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
765
+ * @permissionScope Read Draft Blog Posts
766
+ * @permissionScopeId SCOPE.DC-BLOG.READ-DRAFT-POSTS
767
+ * @permissionId BLOG.READ-CATEGORY
768
+ * @webhook
769
+ * @eventType wix.blog.v3.category_deleted
770
+ * @serviceIdentifier com.wixpress.npm.communities.platformized.blog.v3.CategoryService
771
+ * @slug deleted
772
+ */
773
+ declare function onCategoryDeleted(handler: (event: CategoryDeletedEnvelope) => void | Promise<void>): void;
738
774
  interface CategoryUpdatedEnvelope {
739
775
  entity: Category;
740
776
  metadata: EventMetadata;
741
777
  }
778
+ /**
779
+ * Triggered when a category is updated.
780
+ * @permissionScope Read Blog
781
+ * @permissionScopeId SCOPE.DC-BLOG.READ-BLOGS
782
+ * @permissionScope Manage Blog
783
+ * @permissionScopeId SCOPE.DC-BLOG.MANAGE-BLOG
784
+ * @permissionScope Manage Blog
785
+ * @permissionScopeId SCOPE.BLOG.MANAGE-BLOG
786
+ * @permissionScope Read Draft Blog Posts
787
+ * @permissionScopeId SCOPE.DC-BLOG.READ-DRAFT-POSTS
788
+ * @permissionId BLOG.READ-CATEGORY
789
+ * @webhook
790
+ * @eventType wix.blog.v3.category_updated
791
+ * @serviceIdentifier com.wixpress.npm.communities.platformized.blog.v3.CategoryService
792
+ * @slug updated
793
+ */
794
+ declare function onCategoryUpdated(handler: (event: CategoryUpdatedEnvelope) => void | Promise<void>): void;
795
+ type CategoryNonNullablePaths = `_id` | `label` | `postCount` | `title` | `slug` | `seoData.tags` | `seoData.tags.${number}.type` | `seoData.tags.${number}.children` | `seoData.tags.${number}.custom` | `seoData.tags.${number}.disabled` | `seoData.settings.preventAutoRedirect` | `seoData.settings.keywords` | `seoData.settings.keywords.${number}.term` | `seoData.settings.keywords.${number}.isMain`;
796
+ /**
797
+ * Creates a category.
798
+ * @param category - Category info.
799
+ * @public
800
+ * @requiredField category
801
+ * @requiredField category.label
802
+ * @permissionId BLOG.CREATE-CATEGORY
803
+ * @applicableIdentity APP
804
+ * @returns Category info.
805
+ * @fqn com.wixpress.npm.communities.platformized.blog.v3.CategoryService.CreateCategory
806
+ */
807
+ declare function createCategory(category: NonNullablePaths<Category, `label`>, options?: CreateCategoryOptions): Promise<NonNullablePaths<Category, CategoryNonNullablePaths>>;
742
808
  interface CreateCategoryOptions {
743
809
  /**
744
810
  * List of additional category fields to include in the response. By default
@@ -750,6 +816,18 @@ interface CreateCategoryOptions {
750
816
  */
751
817
  fieldsets?: FieldWithLiterals[];
752
818
  }
819
+ /**
820
+ * Updates a category.
821
+ * @param _id - Category ID.
822
+ * @public
823
+ * @requiredField _id
824
+ * @requiredField category
825
+ * @permissionId BLOG.EDIT-CATEGORY
826
+ * @applicableIdentity APP
827
+ * @returns Category info.
828
+ * @fqn com.wixpress.npm.communities.platformized.blog.v3.CategoryService.UpdateCategory
829
+ */
830
+ declare function updateCategory(_id: string, category: UpdateCategory, options?: UpdateCategoryOptions): Promise<NonNullablePaths<Category, CategoryNonNullablePaths>>;
753
831
  interface UpdateCategory {
754
832
  /**
755
833
  * Category ID.
@@ -829,6 +907,20 @@ interface UpdateCategoryOptions {
829
907
  */
830
908
  fieldsets?: FieldWithLiterals[];
831
909
  }
910
+ /**
911
+ * Gets a category with the specified ID.
912
+ * @param categoryId - Category ID.
913
+ * @public
914
+ * @requiredField categoryId
915
+ * @param options - Options specifying which fields to return.
916
+ * @permissionId BLOG.READ-CATEGORY
917
+ * @applicableIdentity APP
918
+ * @applicableIdentity VISITOR
919
+ * @fqn com.wixpress.npm.communities.platformized.blog.v3.CategoryService.GetCategory
920
+ */
921
+ declare function getCategory(categoryId: string, options?: GetCategoryOptions): Promise<NonNullablePaths<GetCategoryResponse, {
922
+ [P in CategoryNonNullablePaths]: `category.${P}`;
923
+ }[CategoryNonNullablePaths]>>;
832
924
  interface GetCategoryOptions {
833
925
  /**
834
926
  * List of additional category fields to include in the response. By default
@@ -840,6 +932,26 @@ interface GetCategoryOptions {
840
932
  */
841
933
  fieldsets?: FieldWithLiterals[];
842
934
  }
935
+ /**
936
+ * Gets a category with the specified slug.
937
+ *
938
+ * The slug is at the end of the URL of a specific category.
939
+ * For example, if a category's URL is `https://example.com/blog/categories/famous-cats`, the slug is `famous-cats`.
940
+ * The slug is a case-sensitive string that is derived from the category's label, unless specified otherwise.
941
+ * @public
942
+ * @requiredField slug
943
+ * @param slug - Slug of the category to retrieve.
944
+ *
945
+ * The end of a category's URL. For example, `'https:/example.com/blog/category/{my-category-slug}'`. Case sensitive and generally based on the category `label` if not specified.
946
+ * @param options - Options specifying which fields to return.
947
+ * @permissionId BLOG.READ-CATEGORY
948
+ * @applicableIdentity APP
949
+ * @applicableIdentity VISITOR
950
+ * @fqn com.wixpress.npm.communities.platformized.blog.v3.CategoryService.GetCategoryBySlug
951
+ */
952
+ declare function getCategoryBySlug(slug: string, options?: GetCategoryBySlugOptions): Promise<NonNullablePaths<GetCategoryBySlugResponse, {
953
+ [P in CategoryNonNullablePaths]: `category.${P}`;
954
+ }[CategoryNonNullablePaths]>>;
843
955
  interface GetCategoryBySlugOptions {
844
956
  /**
845
957
  * List of additional category fields to include in the response. By default
@@ -857,6 +969,29 @@ interface GetCategoryBySlugOptions {
857
969
  */
858
970
  language?: string | null;
859
971
  }
972
+ /**
973
+ * Retrieves a list of up to 100 categories per request.
974
+ *
975
+ * If you pass a language filter to the method, it returns a list of up to 100 categories in the requested language.
976
+ *
977
+ * The categoies are displayed in order of their `displayPosition`, starting with `0`. The `displayPosition` is the position in which the categories
978
+ * are displayed in the Category Menu page. By default, categories get added to the bottom of the Category Menu page with a `displayPosition` of `-1`.
979
+ *
980
+ * List Categories runs with these defaults, which you can override:
981
+ * - `paging.limit` is `50`.
982
+ * - `paging.offset` is `0`.
983
+ *
984
+ * List Categories is sorted by `displayPosition` in descending order. This cannot be overridden.
985
+ * @public
986
+ * @param options - Filter and paging options.
987
+ * @permissionId BLOG.READ-CATEGORY
988
+ * @applicableIdentity APP
989
+ * @applicableIdentity VISITOR
990
+ * @fqn com.wixpress.npm.communities.platformized.blog.v3.CategoryService.ListCategories
991
+ */
992
+ declare function listCategories(options?: ListCategoriesOptions): Promise<NonNullablePaths<ListCategoriesResponse, {
993
+ [P in CategoryNonNullablePaths]: `categories.${number}.${P}`;
994
+ }[CategoryNonNullablePaths] | `metaData.count` | `metaData.offset` | `metaData.total`>>;
860
995
  interface ListCategoriesOptions {
861
996
  /** Pagination options. */
862
997
  paging?: BlogPaging;
@@ -879,6 +1014,29 @@ interface ListCategoriesOptions {
879
1014
  */
880
1015
  language?: string | null;
881
1016
  }
1017
+ /**
1018
+ * Creates a query to retrieve a list of categories.
1019
+ *
1020
+ *
1021
+ * The Query Categories method builds a query to retrieve a list of up to 100 categories per language, and returns a [`CategoriesQueryBuilder`](https://dev.wix.com/docs/sdk/backend-modules/blog/categories/categories-query-builder/ascending) object.
1022
+ *
1023
+ * The response contains the query definition, which is typically used to run the query using the [`find()`](https://dev.wix.com/docs/sdk/backend-modules/blog/categories/categories-query-builder/find) method.
1024
+ *
1025
+ * You can refine the query by chaining `CategoriesQueryBuilder` methods to the query. `CategoriesQueryBuilder` methods enable you to sort, filter, and control the results that Query Categories returns. Any methods chained to the Query Categories method are applied in the order that they are called.
1026
+ *
1027
+ * Query Categories runs with these `CategoriesQueryBuilder` defaults, which you can override.
1028
+ * - [`limit(100)`](https://dev.wix.com/docs/sdk/backend-modules/blog/categories/categories-query-builder/limit)
1029
+ * - [`ascending(displayPosition)`](https://dev.wix.com/docs/sdk/backend-modules/blog/categories/categories-query-builder/ascending)
1030
+ *
1031
+ * The following `CategoriesQueryBuilder` methods are supported for Query Categories. For a full description of the `Categories` object, see the response for the [`items`](https://dev.wix.com/docs/sdk/backend-modules/blog/categories/categories-query-result/items) property in [`CategoriesQueryResult`](https://www.wix.com/velo/reference/wix-blog-backend/categories/categoriesqueryresult).
1032
+ * @public
1033
+ * @param options - Options specifying which fields to return.
1034
+ * @permissionId BLOG.READ-CATEGORY
1035
+ * @applicableIdentity APP
1036
+ * @applicableIdentity VISITOR
1037
+ * @fqn com.wixpress.npm.communities.platformized.blog.v3.CategoryService.QueryCategories
1038
+ */
1039
+ declare function queryCategories(options?: QueryCategoriesOptions): CategoriesQueryBuilder;
882
1040
  interface QueryCategoriesOptions {
883
1041
  /**
884
1042
 
@@ -942,5 +1100,15 @@ interface CategoriesQueryBuilder {
942
1100
  skip: (skip: number) => CategoriesQueryBuilder;
943
1101
  find: () => Promise<CategoriesQueryResult>;
944
1102
  }
1103
+ /**
1104
+ * Deletes a category.
1105
+ * @param categoryId - Category ID.
1106
+ * @public
1107
+ * @requiredField categoryId
1108
+ * @permissionId BLOG.DELETE-CATEGORY
1109
+ * @applicableIdentity APP
1110
+ * @fqn com.wixpress.npm.communities.platformized.blog.v3.CategoryService.DeleteCategory
1111
+ */
1112
+ declare function deleteCategory(categoryId: string): Promise<void>;
945
1113
 
946
- export { type PagingMetadataV2 as $, type ApplicationError as A, type BulkCreateCategoriesRequest as B, type Category as C, type CategoryLanguageCount as D, type GetCategoryRequest as E, Field as F, type GetCategoryOptions as G, type GetCategoryBySlugRequest as H, type InitialCategoriesCopied as I, type ListCategoriesRequest as J, type Keyword as K, type ListCategoriesOptions as L, type MaskedCategory as M, type BlogPaging as N, type MetaData as O, type QueryCategoriesRequest as P, type QueryCategoriesOptions as Q, type PlatformQuery as R, SortOrder as S, type Tag as T, type UpdateCategory as U, type PlatformQueryPagingMethodOneOf as V, WebhookIdentityType as W, type Sorting as X, type Paging as Y, type CursorPaging as Z, type QueryCategoriesResponse as _, type CreateCategoryOptions as a, type Cursors as a0, type BulkDeleteCategoryRequest as a1, type BulkDeleteCategoryResponse as a2, type DeleteCategoryRequest as a3, type DeleteCategoryResponse as a4, type DomainEvent as a5, type DomainEventBodyOneOf as a6, type EntityCreatedEvent as a7, type RestoreInfo as a8, type EntityUpdatedEvent as a9, type EntityDeletedEvent as aa, type ActionEvent as ab, type MessageEnvelope as ac, type IdentificationData as ad, type IdentificationDataIdOneOf as ae, type BaseEventMetadata as af, type EventMetadata as ag, type CategoriesQueryResult as ah, type UpdateCategoryOptions as b, type GetCategoryResponse as c, type GetCategoryBySlugOptions as d, type GetCategoryBySlugResponse as e, type ListCategoriesResponse as f, type CategoriesQueryBuilder as g, type CategoryCreatedEnvelope as h, type CategoryDeletedEnvelope as i, type CategoryUpdatedEnvelope as j, type SeoSchema as k, type Settings as l, type FocalPoint as m, type CategoryTranslation as n, type CreateCategoryRequest as o, type CreateCategoryResponse as p, type BulkCreateCategoriesResponse as q, type BulkCategoryResult as r, type ItemMetadata as s, type BulkActionMetadata as t, type BulkUpdateCategoriesRequest as u, type BulkUpdateCategoriesResponse as v, type UpdateCategoryRequest as w, type UpdateCategoryResponse as x, type GetCategoriesCountByLanguageRequest as y, type GetCategoriesCountByLanguageResponse as z };
1114
+ export { type ActionEvent, type ApplicationError, type BaseEventMetadata, type BlogPaging, type BulkActionMetadata, type BulkCategoryResult, type BulkCreateCategoriesRequest, type BulkCreateCategoriesResponse, type BulkDeleteCategoryRequest, type BulkDeleteCategoryResponse, type BulkUpdateCategoriesRequest, type BulkUpdateCategoriesResponse, type CategoriesQueryBuilder, type CategoriesQueryResult, type Category, type CategoryCreatedEnvelope, type CategoryDeletedEnvelope, type CategoryLanguageCount, type CategoryTranslation, type CategoryUpdatedEnvelope, type CreateCategoryOptions, type CreateCategoryRequest, type CreateCategoryResponse, type CursorPaging, type Cursors, type DeleteCategoryRequest, type DeleteCategoryResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, Field, type FieldWithLiterals, type FocalPoint, type GetCategoriesCountByLanguageRequest, type GetCategoriesCountByLanguageResponse, type GetCategoryBySlugOptions, type GetCategoryBySlugRequest, type GetCategoryBySlugResponse, type GetCategoryOptions, type GetCategoryRequest, type GetCategoryResponse, type IdentificationData, type IdentificationDataIdOneOf, type InitialCategoriesCopied, type ItemMetadata, type Keyword, type ListCategoriesOptions, type ListCategoriesRequest, type ListCategoriesResponse, type MaskedCategory, type MessageEnvelope, type MetaData, type Paging, type PagingMetadataV2, type PlatformQuery, type PlatformQueryPagingMethodOneOf, type QueryCategoriesOptions, type QueryCategoriesRequest, type QueryCategoriesResponse, type RestoreInfo, type SeoSchema, type Settings, SortOrder, type SortOrderWithLiterals, type Sorting, type Tag, type UpdateCategory, type UpdateCategoryOptions, type UpdateCategoryRequest, type UpdateCategoryResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createCategory, deleteCategory, getCategory, getCategoryBySlug, listCategories, onCategoryCreated, onCategoryDeleted, onCategoryUpdated, queryCategories, updateCategory };