@wix/auto_sdk_portfolio_projects 1.0.33 → 1.0.35
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 +9 -23
- package/build/cjs/index.js +62 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +48 -1
- package/build/cjs/index.typings.js +43 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +42 -1
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +9 -23
- package/build/es/index.mjs +62 -1
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +48 -1
- package/build/es/index.typings.mjs +42 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +42 -1
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +9 -23
- package/build/internal/cjs/index.js +62 -1
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +48 -1
- package/build/internal/cjs/index.typings.js +43 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +42 -1
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +9 -23
- package/build/internal/es/index.mjs +62 -1
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +48 -1
- package/build/internal/es/index.typings.mjs +42 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +42 -1
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
|
-
import { Project, GetProjectOptions, ListProjectsOptions, ListProjectsResponse, UpdateProject, BulkUpdateProjectsOptions, BulkUpdateProjectsResponse, DeleteProjectResponse,
|
|
3
|
-
export { ActionEvent, App, ApplicationError, Asset, BaseEventMetadata, BulkActionMetadata, BulkUpdateProjectsRequest, BulkUpdateProjectsResult, CreateNewPortfolioAppRequest, CreateNewPortfolioAppResponse, CreateProjectRequest, CreateProjectResponse, CursorPaging, Cursors, CustomTag, DeleteContext, DeleteProjectRequest, DeleteStatus, DeleteStatusWithLiterals, DeletedProjectRestored, DetailsLink, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, File, GetProjectPageDataRequest, GetProjectPageDataResponse, GetProjectRequest, GetProjectResponse, IdentificationData, IdentificationDataIdOneOf, Image, ImageType, ImageTypeWithLiterals, InvalidateCache, InvalidateCacheGetByOneOf, ItemMetadata, Keyword, ListProjectsRequest, MaskedProject, MenuSettingUpdatedEvent, MessageEnvelope, MetaSiteSpecialEvent, MetaSiteSpecialEventPayloadOneOf, Namespace, NamespaceChanged, NamespaceWithLiterals, OdeditorAssigned, OdeditorUnassigned, Page, Paging, PagingMetadataV2, PicassoAssigned, PicassoUnassigned, Point, Position, PositionWithLiterals, ProjectCoverOneOf, ProjectDetail, ProjectDetailValueOneOf, ProjectSlug, ProjectSource, ProjectsInCollections, ProjectsQueryResult, QueryProjectWithCollectionInfoRequest, QueryProjectsRequest, QueryProjectsResponse, QueryV2PagingMethodOneOf, RestoreInfo, RestoreProjectFromTrashBinRequest, RestoreProjectFromTrashBinResponse, SeoSchema, ServiceProvisioned, ServiceRemoved, Settings, SiteCreated, SiteCreatedContext, SiteCreatedContextWithLiterals, SiteDeleted, SiteHardDeleted, SiteMarkedAsTemplate, SiteMarkedAsWixSite, SitePublished, SitePurgedExternally, SiteRenamed, SiteTransferred, SiteUndeleted, SiteUnpublished, SiteUrlChanged, SortOrder, SortOrderWithLiterals, Sorting, State, StateWithLiterals, StudioAssigned, StudioUnassigned, SyncProjectWithCollectionMappings, SyncStatus, SyncStatusWithLiterals, Tag, URI, UnsharpMasking, UpdateProjectOrderInCollectionRequest, UpdateProjectRequest, UpdateProjectResponse, Video, VideoResolution, Watermark, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WixelAssigned, WixelUnassigned } from './index.typings.js';
|
|
2
|
+
import { Project, GetProjectOptions, ListProjectsOptions, ListProjectsResponse, UpdateProject, BulkUpdateProjectsOptions, BulkUpdateProjectsResponse, DeleteProjectResponse, UpdateProjectOrderInCollectionIdentifiers, UpdateProjectOrderInCollectionResponse, QueryV2, QueryProjectsWithCollectionInfoOptions, QueryProjectWithCollectionInfoResponse, ProjectCreatedEnvelope, ProjectDeletedEnvelope, ProjectUpdatedEnvelope, typedQueryProjects, QueryProjectsOptions, ProjectsQueryBuilder } from './index.typings.js';
|
|
3
|
+
export { ActionEvent, App, ApplicationError, Asset, BaseEventMetadata, BulkActionMetadata, BulkUpdateProjectsRequest, BulkUpdateProjectsResult, CreateNewPortfolioAppRequest, CreateNewPortfolioAppResponse, CreateProjectRequest, CreateProjectResponse, CursorPaging, Cursors, CustomTag, DeleteContext, DeleteProjectRequest, DeleteStatus, DeleteStatusWithLiterals, DeletedProjectRestored, DetailsLink, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, File, GetAdjacentProjectInfoRequest, GetAdjacentProjectInfoResponse, GetProjectPageDataRequest, GetProjectPageDataResponse, GetProjectRequest, GetProjectResponse, IdentificationData, IdentificationDataIdOneOf, Image, ImageType, ImageTypeWithLiterals, InvalidateCache, InvalidateCacheGetByOneOf, ItemMetadata, Keyword, ListProjectsRequest, MaskedProject, MenuSettingUpdatedEvent, MessageEnvelope, MetaSiteSpecialEvent, MetaSiteSpecialEventPayloadOneOf, Namespace, NamespaceChanged, NamespaceWithLiterals, OdeditorAssigned, OdeditorUnassigned, Page, Paging, PagingMetadataV2, PicassoAssigned, PicassoUnassigned, Point, Position, PositionWithLiterals, ProjectCoverOneOf, ProjectDetail, ProjectDetailValueOneOf, ProjectInfo, ProjectSlug, ProjectSource, ProjectsInCollections, ProjectsQueryResult, QueryProjectWithCollectionInfoRequest, QueryProjectsRequest, QueryProjectsResponse, QueryV2PagingMethodOneOf, RestoreInfo, RestoreProjectFromTrashBinRequest, RestoreProjectFromTrashBinResponse, SeoSchema, ServiceProvisioned, ServiceRemoved, Settings, SiteCreated, SiteCreatedContext, SiteCreatedContextWithLiterals, SiteDeleted, SiteHardDeleted, SiteMarkedAsTemplate, SiteMarkedAsWixSite, SitePublished, SitePurgedExternally, SiteRenamed, SiteTransferred, SiteUndeleted, SiteUnpublished, SiteUrlChanged, SortOrder, SortOrderWithLiterals, Sorting, State, StateWithLiterals, StudioAssigned, StudioTwoAssigned, StudioTwoUnassigned, StudioUnassigned, SyncProjectWithCollectionMappings, SyncStatus, SyncStatusWithLiterals, Tag, URI, UnsharpMasking, UpdateProjectOrderInCollectionRequest, UpdateProjectRequest, UpdateProjectResponse, Video, VideoResolution, Watermark, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WixelAssigned, WixelUnassigned } from './index.typings.js';
|
|
4
4
|
|
|
5
5
|
declare function createProject$1(httpClient: HttpClient): CreateProjectSignature;
|
|
6
6
|
interface CreateProjectSignature {
|
|
@@ -53,26 +53,6 @@ interface DeleteProjectSignature {
|
|
|
53
53
|
*/
|
|
54
54
|
(projectId: string): Promise<NonNullablePaths<DeleteProjectResponse, `projectId`, 2>>;
|
|
55
55
|
}
|
|
56
|
-
declare function queryProjects$1(httpClient: HttpClient): QueryProjectsSignature;
|
|
57
|
-
interface QueryProjectsSignature {
|
|
58
|
-
/**
|
|
59
|
-
* Creates a query to retrieve a list of projects.
|
|
60
|
-
*
|
|
61
|
-
* The `queryProjects()` method builds a query to retrieve a list of projects and returns a `ProjectsQueryBuilder` object.
|
|
62
|
-
*
|
|
63
|
-
* The returned object contains the query definition, which is used to run the query using the [`find()`](https://dev.wix.com/docs/sdk/backend-modules/portfolio/projects/projects-query-builder/find) method.
|
|
64
|
-
*
|
|
65
|
-
* You can refine the query by chaining `ProjectsQueryBuilder` methods onto the query. `ProjectsQueryBuilder` methods enable you to filter, sort, and control the results that `queryProjects()` returns.
|
|
66
|
-
*
|
|
67
|
-
* `queryProjects()` runs with the following `ProjectsQueryBuilder` defaults which you can override:
|
|
68
|
-
*
|
|
69
|
-
* + [`limit(100)`](https://dev.wix.com/docs/sdk/backend-modules/portfolio/projects/projects-query-builder/limit)
|
|
70
|
-
* + [`ascending('_id')`](https://dev.wix.com/docs/sdk/backend-modules/portfolio/projects/projects-query-builder/ascending)
|
|
71
|
-
*
|
|
72
|
-
* The following `ProjectsQueryBuilder` methods are supported for `queryProjects()`. For a full description of the operations object, see the object returned for the [`items`](https://dev.wix.com/docs/sdk/backend-modules/portfolio/projects/projects-query-result/items) property in `ProjectsQueryResult`.
|
|
73
|
-
*/
|
|
74
|
-
(options?: QueryProjectsOptions): ProjectsQueryBuilder;
|
|
75
|
-
}
|
|
76
56
|
declare function updateProjectOrderInCollection$1(httpClient: HttpClient): UpdateProjectOrderInCollectionSignature;
|
|
77
57
|
interface UpdateProjectOrderInCollectionSignature {
|
|
78
58
|
/**
|
|
@@ -97,15 +77,21 @@ declare const onProjectCreated$1: EventDefinition<ProjectCreatedEnvelope, "wix.p
|
|
|
97
77
|
declare const onProjectDeleted$1: EventDefinition<ProjectDeletedEnvelope, "wix.portfolio.projects.v1.project_deleted">;
|
|
98
78
|
declare const onProjectUpdated$1: EventDefinition<ProjectUpdatedEnvelope, "wix.portfolio.projects.v1.project_updated">;
|
|
99
79
|
|
|
80
|
+
declare function customQueryProjects(httpClient: HttpClient): {
|
|
81
|
+
(query: QueryV2): ReturnType<typeof typedQueryProjects>;
|
|
82
|
+
(query: QueryV2, options: QueryProjectsOptions): ReturnType<typeof typedQueryProjects>;
|
|
83
|
+
(): ProjectsQueryBuilder;
|
|
84
|
+
(options: QueryProjectsOptions): ProjectsQueryBuilder;
|
|
85
|
+
};
|
|
100
86
|
declare const createProject: MaybeContext<BuildRESTFunction<typeof createProject$1> & typeof createProject$1>;
|
|
101
87
|
declare const getProject: MaybeContext<BuildRESTFunction<typeof getProject$1> & typeof getProject$1>;
|
|
102
88
|
declare const listProjects: MaybeContext<BuildRESTFunction<typeof listProjects$1> & typeof listProjects$1>;
|
|
103
89
|
declare const updateProject: MaybeContext<BuildRESTFunction<typeof updateProject$1> & typeof updateProject$1>;
|
|
104
90
|
declare const bulkUpdateProjects: MaybeContext<BuildRESTFunction<typeof bulkUpdateProjects$1> & typeof bulkUpdateProjects$1>;
|
|
105
91
|
declare const deleteProject: MaybeContext<BuildRESTFunction<typeof deleteProject$1> & typeof deleteProject$1>;
|
|
106
|
-
declare const queryProjects: MaybeContext<BuildRESTFunction<typeof queryProjects$1> & typeof queryProjects$1>;
|
|
107
92
|
declare const updateProjectOrderInCollection: MaybeContext<BuildRESTFunction<typeof updateProjectOrderInCollection$1> & typeof updateProjectOrderInCollection$1>;
|
|
108
93
|
declare const queryProjectsWithCollectionInfo: MaybeContext<BuildRESTFunction<typeof queryProjectsWithCollectionInfo$1> & typeof queryProjectsWithCollectionInfo$1>;
|
|
94
|
+
declare const queryProjects: MaybeContext<BuildRESTFunction<typeof customQueryProjects> & typeof customQueryProjects>;
|
|
109
95
|
/**
|
|
110
96
|
* Triggered when a project is created.
|
|
111
97
|
*/
|
|
@@ -1150,6 +1150,47 @@ function queryProjects2(options) {
|
|
|
1150
1150
|
transformationPaths: {}
|
|
1151
1151
|
});
|
|
1152
1152
|
}
|
|
1153
|
+
async function typedQueryProjects(query, options) {
|
|
1154
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1155
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1156
|
+
query,
|
|
1157
|
+
...options
|
|
1158
|
+
});
|
|
1159
|
+
const reqOpts = queryProjects(payload);
|
|
1160
|
+
sideEffects?.onSiteCall?.();
|
|
1161
|
+
try {
|
|
1162
|
+
const result = await httpClient.request(reqOpts);
|
|
1163
|
+
sideEffects?.onSuccess?.(result);
|
|
1164
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
1165
|
+
(0, import_transform_paths2.transformPaths)(result.data, [
|
|
1166
|
+
{
|
|
1167
|
+
transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
|
|
1168
|
+
paths: [{ path: "projects.url" }]
|
|
1169
|
+
},
|
|
1170
|
+
{
|
|
1171
|
+
transformFn: import_image2.transformRESTImageToSDKImage,
|
|
1172
|
+
paths: [{ path: "projects.coverImage.imageInfo" }]
|
|
1173
|
+
},
|
|
1174
|
+
{
|
|
1175
|
+
transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
|
|
1176
|
+
paths: [{ path: "projects.coverVideo.videoInfo" }]
|
|
1177
|
+
}
|
|
1178
|
+
])
|
|
1179
|
+
);
|
|
1180
|
+
} catch (err) {
|
|
1181
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
1182
|
+
err,
|
|
1183
|
+
{
|
|
1184
|
+
spreadPathsToArguments: {},
|
|
1185
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
1186
|
+
singleArgumentUnchanged: false
|
|
1187
|
+
},
|
|
1188
|
+
["query", "options"]
|
|
1189
|
+
);
|
|
1190
|
+
sideEffects?.onError?.(err);
|
|
1191
|
+
throw transformedError;
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1153
1194
|
async function updateProjectOrderInCollection2(identifiers, sortOrder) {
|
|
1154
1195
|
const { httpClient, sideEffects } = arguments[2];
|
|
1155
1196
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -1306,6 +1347,14 @@ function queryProjects3(httpClient) {
|
|
|
1306
1347
|
{ httpClient }
|
|
1307
1348
|
);
|
|
1308
1349
|
}
|
|
1350
|
+
function typedQueryProjects2(httpClient) {
|
|
1351
|
+
return (query, options) => typedQueryProjects(
|
|
1352
|
+
query,
|
|
1353
|
+
options,
|
|
1354
|
+
// @ts-ignore
|
|
1355
|
+
{ httpClient }
|
|
1356
|
+
);
|
|
1357
|
+
}
|
|
1309
1358
|
function updateProjectOrderInCollection3(httpClient) {
|
|
1310
1359
|
return (identifiers, sortOrder) => updateProjectOrderInCollection2(
|
|
1311
1360
|
identifiers,
|
|
@@ -1443,15 +1492,27 @@ var onProjectUpdated = (0, import_sdk_types.EventDefinition)(
|
|
|
1443
1492
|
// src/portfolio-projects-v1-project-projects.context.ts
|
|
1444
1493
|
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
1445
1494
|
var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
|
|
1495
|
+
var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
|
|
1496
|
+
function customQueryProjects(httpClient) {
|
|
1497
|
+
const router = (0, import_query_method_router.createQueryOverloadRouter)({
|
|
1498
|
+
builderQueryFunction: (options) => queryProjects3(httpClient)(options),
|
|
1499
|
+
typedQueryFunction: (query, options) => typedQueryProjects2(httpClient)(query, options),
|
|
1500
|
+
hasOptionsParameter: true
|
|
1501
|
+
});
|
|
1502
|
+
function overloadedQuery(queryOrOptions, options) {
|
|
1503
|
+
return router(...arguments);
|
|
1504
|
+
}
|
|
1505
|
+
return overloadedQuery;
|
|
1506
|
+
}
|
|
1446
1507
|
var createProject4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createProject3);
|
|
1447
1508
|
var getProject4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getProject3);
|
|
1448
1509
|
var listProjects4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(listProjects3);
|
|
1449
1510
|
var updateProject4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateProject3);
|
|
1450
1511
|
var bulkUpdateProjects4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkUpdateProjects3);
|
|
1451
1512
|
var deleteProject4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteProject3);
|
|
1452
|
-
var queryProjects4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryProjects3);
|
|
1453
1513
|
var updateProjectOrderInCollection4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateProjectOrderInCollection3);
|
|
1454
1514
|
var queryProjectsWithCollectionInfo4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryProjectsWithCollectionInfo3);
|
|
1515
|
+
var queryProjects4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryProjects);
|
|
1455
1516
|
var onProjectCreated2 = (0, import_event_definition_modules.createEventModule)(onProjectCreated);
|
|
1456
1517
|
var onProjectDeleted2 = (0, import_event_definition_modules.createEventModule)(onProjectDeleted);
|
|
1457
1518
|
var onProjectUpdated2 = (0, import_event_definition_modules.createEventModule)(onProjectUpdated);
|