@wix/auto_sdk_blog_categories 1.0.24 → 1.0.25
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.
- package/build/cjs/index.d.ts +10 -25
- package/build/cjs/index.js +61 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +8 -1
- package/build/cjs/index.typings.js +42 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/es/index.d.mts +10 -25
- package/build/es/index.mjs +61 -1
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +8 -1
- package/build/es/index.typings.mjs +41 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +10 -25
- package/build/internal/cjs/index.js +61 -1
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +8 -1
- package/build/internal/cjs/index.typings.js +42 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/es/index.d.mts +10 -25
- package/build/internal/es/index.mjs +61 -1
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +8 -1
- package/build/internal/es/index.typings.mjs +41 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/package.json +3 -3
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
|
-
import { Category, CreateCategoryOptions, UpdateCategory, UpdateCategoryOptions, GetCategoryOptions, GetCategoryResponse, GetCategoryBySlugOptions, GetCategoryBySlugResponse, ListCategoriesOptions, ListCategoriesResponse,
|
|
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, FieldWithLiterals, FocalPoint, GetCategoriesCountByLanguageRequest, GetCategoriesCountByLanguageResponse, GetCategoryBySlugRequest, GetCategoryRequest, IdentificationData, IdentificationDataIdOneOf, InitialCategoriesCopied, ItemMetadata, Keyword, ListCategoriesRequest, MaskedCategory, MessageEnvelope, MetaData, Paging, PagingMetadataV2,
|
|
2
|
+
import { Category, CreateCategoryOptions, UpdateCategory, UpdateCategoryOptions, GetCategoryOptions, GetCategoryResponse, GetCategoryBySlugOptions, GetCategoryBySlugResponse, ListCategoriesOptions, ListCategoriesResponse, CategoryCreatedEnvelope, CategoryDeletedEnvelope, CategoryUpdatedEnvelope, PlatformQuery, typedQueryCategories, QueryCategoriesOptions, CategoriesQueryBuilder } 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, FieldWithLiterals, FocalPoint, GetCategoriesCountByLanguageRequest, GetCategoriesCountByLanguageResponse, GetCategoryBySlugRequest, GetCategoryRequest, IdentificationData, IdentificationDataIdOneOf, InitialCategoriesCopied, ItemMetadata, Keyword, ListCategoriesRequest, MaskedCategory, MessageEnvelope, MetaData, Paging, PagingMetadataV2, PlatformQueryPagingMethodOneOf, QueryCategoriesRequest, QueryCategoriesResponse, RestoreInfo, SeoSchema, Settings, SortOrder, SortOrderWithLiterals, Sorting, Tag, UpdateCategoryRequest, UpdateCategoryResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
|
|
4
4
|
|
|
5
5
|
declare function createCategory$1(httpClient: HttpClient): CreateCategorySignature;
|
|
6
6
|
interface CreateCategorySignature {
|
|
@@ -63,27 +63,6 @@ interface ListCategoriesSignature {
|
|
|
63
63
|
*/
|
|
64
64
|
(options?: ListCategoriesOptions): Promise<NonNullablePaths<ListCategoriesResponse, `categories` | `categories.${number}._id` | `categories.${number}.label` | `categories.${number}.postCount` | `categories.${number}.title` | `categories.${number}.slug` | `categories.${number}.seoData.settings.preventAutoRedirect` | `metaData.count` | `metaData.offset` | `metaData.total`, 6>>;
|
|
65
65
|
}
|
|
66
|
-
declare function queryCategories$1(httpClient: HttpClient): QueryCategoriesSignature;
|
|
67
|
-
interface QueryCategoriesSignature {
|
|
68
|
-
/**
|
|
69
|
-
* Creates a query to retrieve a list of categories.
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* 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.
|
|
73
|
-
*
|
|
74
|
-
* 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.
|
|
75
|
-
*
|
|
76
|
-
* 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.
|
|
77
|
-
*
|
|
78
|
-
* Query Categories runs with these `CategoriesQueryBuilder` defaults, which you can override.
|
|
79
|
-
* - [`limit(100)`](https://dev.wix.com/docs/sdk/backend-modules/blog/categories/categories-query-builder/limit)
|
|
80
|
-
* - [`ascending(displayPosition)`](https://dev.wix.com/docs/sdk/backend-modules/blog/categories/categories-query-builder/ascending)
|
|
81
|
-
*
|
|
82
|
-
* 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).
|
|
83
|
-
* @param - Options specifying which fields to return.
|
|
84
|
-
*/
|
|
85
|
-
(options?: QueryCategoriesOptions): CategoriesQueryBuilder;
|
|
86
|
-
}
|
|
87
66
|
declare function deleteCategory$1(httpClient: HttpClient): DeleteCategorySignature;
|
|
88
67
|
interface DeleteCategorySignature {
|
|
89
68
|
/**
|
|
@@ -96,13 +75,19 @@ declare const onCategoryCreated$1: EventDefinition<CategoryCreatedEnvelope, "wix
|
|
|
96
75
|
declare const onCategoryDeleted$1: EventDefinition<CategoryDeletedEnvelope, "wix.blog.v3.category_deleted">;
|
|
97
76
|
declare const onCategoryUpdated$1: EventDefinition<CategoryUpdatedEnvelope, "wix.blog.v3.category_updated">;
|
|
98
77
|
|
|
78
|
+
declare function customQueryCategories(httpClient: HttpClient): {
|
|
79
|
+
(query: PlatformQuery): ReturnType<typeof typedQueryCategories>;
|
|
80
|
+
(query: PlatformQuery, options: QueryCategoriesOptions): ReturnType<typeof typedQueryCategories>;
|
|
81
|
+
(): CategoriesQueryBuilder;
|
|
82
|
+
(options: QueryCategoriesOptions): CategoriesQueryBuilder;
|
|
83
|
+
};
|
|
99
84
|
declare const createCategory: MaybeContext<BuildRESTFunction<typeof createCategory$1> & typeof createCategory$1>;
|
|
100
85
|
declare const updateCategory: MaybeContext<BuildRESTFunction<typeof updateCategory$1> & typeof updateCategory$1>;
|
|
101
86
|
declare const getCategory: MaybeContext<BuildRESTFunction<typeof getCategory$1> & typeof getCategory$1>;
|
|
102
87
|
declare const getCategoryBySlug: MaybeContext<BuildRESTFunction<typeof getCategoryBySlug$1> & typeof getCategoryBySlug$1>;
|
|
103
88
|
declare const listCategories: MaybeContext<BuildRESTFunction<typeof listCategories$1> & typeof listCategories$1>;
|
|
104
|
-
declare const queryCategories: MaybeContext<BuildRESTFunction<typeof queryCategories$1> & typeof queryCategories$1>;
|
|
105
89
|
declare const deleteCategory: MaybeContext<BuildRESTFunction<typeof deleteCategory$1> & typeof deleteCategory$1>;
|
|
90
|
+
declare const queryCategories: MaybeContext<BuildRESTFunction<typeof customQueryCategories> & typeof customQueryCategories>;
|
|
106
91
|
/**
|
|
107
92
|
* Triggered when a category is created.
|
|
108
93
|
*/
|
|
@@ -116,4 +101,4 @@ declare const onCategoryDeleted: BuildEventDefinition<typeof onCategoryDeleted$1
|
|
|
116
101
|
*/
|
|
117
102
|
declare const onCategoryUpdated: BuildEventDefinition<typeof onCategoryUpdated$1> & typeof onCategoryUpdated$1;
|
|
118
103
|
|
|
119
|
-
export { CategoriesQueryBuilder, Category, CategoryCreatedEnvelope, CategoryDeletedEnvelope, CategoryUpdatedEnvelope, CreateCategoryOptions, GetCategoryBySlugOptions, GetCategoryBySlugResponse, GetCategoryOptions, GetCategoryResponse, ListCategoriesOptions, ListCategoriesResponse, QueryCategoriesOptions, UpdateCategory, UpdateCategoryOptions, createCategory, deleteCategory, getCategory, getCategoryBySlug, listCategories, onCategoryCreated, onCategoryDeleted, onCategoryUpdated, queryCategories, updateCategory };
|
|
104
|
+
export { CategoriesQueryBuilder, Category, CategoryCreatedEnvelope, CategoryDeletedEnvelope, CategoryUpdatedEnvelope, CreateCategoryOptions, GetCategoryBySlugOptions, GetCategoryBySlugResponse, GetCategoryOptions, GetCategoryResponse, ListCategoriesOptions, ListCategoriesResponse, PlatformQuery, QueryCategoriesOptions, UpdateCategory, UpdateCategoryOptions, createCategory, deleteCategory, getCategory, getCategoryBySlug, listCategories, onCategoryCreated, onCategoryDeleted, onCategoryUpdated, queryCategories, updateCategory };
|
package/build/cjs/index.js
CHANGED
|
@@ -774,6 +774,46 @@ function queryCategories2(options) {
|
|
|
774
774
|
transformationPaths: {}
|
|
775
775
|
});
|
|
776
776
|
}
|
|
777
|
+
async function typedQueryCategories(query, options) {
|
|
778
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
779
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
780
|
+
query,
|
|
781
|
+
...options
|
|
782
|
+
});
|
|
783
|
+
const reqOpts = queryCategories(payload);
|
|
784
|
+
sideEffects?.onSiteCall?.();
|
|
785
|
+
try {
|
|
786
|
+
const result = await httpClient.request(reqOpts);
|
|
787
|
+
sideEffects?.onSuccess?.(result);
|
|
788
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
789
|
+
(0, import_transform_paths2.transformPaths)(result.data, [
|
|
790
|
+
{
|
|
791
|
+
transformFn: import_page_url2.transformRESTPageURLToSDKPageURL,
|
|
792
|
+
paths: [
|
|
793
|
+
{ path: "categories.url" },
|
|
794
|
+
{ path: "categories.translations.url" }
|
|
795
|
+
]
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
transformFn: import_image2.transformRESTImageToSDKImage,
|
|
799
|
+
paths: [{ path: "categories.coverImage" }]
|
|
800
|
+
}
|
|
801
|
+
])
|
|
802
|
+
);
|
|
803
|
+
} catch (err) {
|
|
804
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
805
|
+
err,
|
|
806
|
+
{
|
|
807
|
+
spreadPathsToArguments: {},
|
|
808
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
809
|
+
singleArgumentUnchanged: false
|
|
810
|
+
},
|
|
811
|
+
["query", "options"]
|
|
812
|
+
);
|
|
813
|
+
sideEffects?.onError?.(err);
|
|
814
|
+
throw transformedError;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
777
817
|
async function deleteCategory2(categoryId) {
|
|
778
818
|
const { httpClient, sideEffects } = arguments[1];
|
|
779
819
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -847,6 +887,14 @@ function queryCategories3(httpClient) {
|
|
|
847
887
|
{ httpClient }
|
|
848
888
|
);
|
|
849
889
|
}
|
|
890
|
+
function typedQueryCategories2(httpClient) {
|
|
891
|
+
return (query, options) => typedQueryCategories(
|
|
892
|
+
query,
|
|
893
|
+
options,
|
|
894
|
+
// @ts-ignore
|
|
895
|
+
{ httpClient }
|
|
896
|
+
);
|
|
897
|
+
}
|
|
850
898
|
function deleteCategory3(httpClient) {
|
|
851
899
|
return (categoryId) => deleteCategory2(
|
|
852
900
|
categoryId,
|
|
@@ -930,13 +978,25 @@ var onCategoryUpdated = (0, import_sdk_types.EventDefinition)(
|
|
|
930
978
|
// src/blog-v3-category-categories.context.ts
|
|
931
979
|
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
932
980
|
var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
|
|
981
|
+
var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
|
|
982
|
+
function customQueryCategories(httpClient) {
|
|
983
|
+
const router = (0, import_query_method_router.createQueryOverloadRouter)({
|
|
984
|
+
builderQueryFunction: (options) => queryCategories3(httpClient)(options),
|
|
985
|
+
typedQueryFunction: (query, options) => typedQueryCategories2(httpClient)(query, options),
|
|
986
|
+
hasOptionsParameter: true
|
|
987
|
+
});
|
|
988
|
+
function overloadedQuery(queryOrOptions, options) {
|
|
989
|
+
return router(...arguments);
|
|
990
|
+
}
|
|
991
|
+
return overloadedQuery;
|
|
992
|
+
}
|
|
933
993
|
var createCategory4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createCategory3);
|
|
934
994
|
var updateCategory4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateCategory3);
|
|
935
995
|
var getCategory4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getCategory3);
|
|
936
996
|
var getCategoryBySlug4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getCategoryBySlug3);
|
|
937
997
|
var listCategories4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(listCategories3);
|
|
938
|
-
var queryCategories4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryCategories3);
|
|
939
998
|
var deleteCategory4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteCategory3);
|
|
999
|
+
var queryCategories4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryCategories);
|
|
940
1000
|
var onCategoryCreated2 = (0, import_event_definition_modules.createEventModule)(onCategoryCreated);
|
|
941
1001
|
var onCategoryDeleted2 = (0, import_event_definition_modules.createEventModule)(onCategoryDeleted);
|
|
942
1002
|
var onCategoryUpdated2 = (0, import_event_definition_modules.createEventModule)(onCategoryUpdated);
|