@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
package/build/es/index.d.mts
CHANGED
|
@@ -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.mjs';
|
|
2
|
+
import { Project, GetProjectOptions, ListProjectsOptions, ListProjectsResponse, UpdateProject, BulkUpdateProjectsOptions, BulkUpdateProjectsResponse, DeleteProjectResponse, UpdateProjectOrderInCollectionIdentifiers, UpdateProjectOrderInCollectionResponse, QueryV2, QueryProjectsWithCollectionInfoOptions, QueryProjectWithCollectionInfoResponse, ProjectCreatedEnvelope, ProjectDeletedEnvelope, ProjectUpdatedEnvelope, typedQueryProjects, QueryProjectsOptions, ProjectsQueryBuilder } from './index.typings.mjs';
|
|
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.mjs';
|
|
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
|
*/
|
package/build/es/index.mjs
CHANGED
|
@@ -1107,6 +1107,47 @@ function queryProjects2(options) {
|
|
|
1107
1107
|
transformationPaths: {}
|
|
1108
1108
|
});
|
|
1109
1109
|
}
|
|
1110
|
+
async function typedQueryProjects(query, options) {
|
|
1111
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1112
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1113
|
+
query,
|
|
1114
|
+
...options
|
|
1115
|
+
});
|
|
1116
|
+
const reqOpts = queryProjects(payload);
|
|
1117
|
+
sideEffects?.onSiteCall?.();
|
|
1118
|
+
try {
|
|
1119
|
+
const result = await httpClient.request(reqOpts);
|
|
1120
|
+
sideEffects?.onSuccess?.(result);
|
|
1121
|
+
return renameKeysFromRESTResponseToSDKResponse(
|
|
1122
|
+
transformPaths2(result.data, [
|
|
1123
|
+
{
|
|
1124
|
+
transformFn: transformRESTPageURLV2ToSDKPageURLV2,
|
|
1125
|
+
paths: [{ path: "projects.url" }]
|
|
1126
|
+
},
|
|
1127
|
+
{
|
|
1128
|
+
transformFn: transformRESTImageToSDKImage,
|
|
1129
|
+
paths: [{ path: "projects.coverImage.imageInfo" }]
|
|
1130
|
+
},
|
|
1131
|
+
{
|
|
1132
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
1133
|
+
paths: [{ path: "projects.coverVideo.videoInfo" }]
|
|
1134
|
+
}
|
|
1135
|
+
])
|
|
1136
|
+
);
|
|
1137
|
+
} catch (err) {
|
|
1138
|
+
const transformedError = sdkTransformError(
|
|
1139
|
+
err,
|
|
1140
|
+
{
|
|
1141
|
+
spreadPathsToArguments: {},
|
|
1142
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
1143
|
+
singleArgumentUnchanged: false
|
|
1144
|
+
},
|
|
1145
|
+
["query", "options"]
|
|
1146
|
+
);
|
|
1147
|
+
sideEffects?.onError?.(err);
|
|
1148
|
+
throw transformedError;
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1110
1151
|
async function updateProjectOrderInCollection2(identifiers, sortOrder) {
|
|
1111
1152
|
const { httpClient, sideEffects } = arguments[2];
|
|
1112
1153
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
@@ -1263,6 +1304,14 @@ function queryProjects3(httpClient) {
|
|
|
1263
1304
|
{ httpClient }
|
|
1264
1305
|
);
|
|
1265
1306
|
}
|
|
1307
|
+
function typedQueryProjects2(httpClient) {
|
|
1308
|
+
return (query, options) => typedQueryProjects(
|
|
1309
|
+
query,
|
|
1310
|
+
options,
|
|
1311
|
+
// @ts-ignore
|
|
1312
|
+
{ httpClient }
|
|
1313
|
+
);
|
|
1314
|
+
}
|
|
1266
1315
|
function updateProjectOrderInCollection3(httpClient) {
|
|
1267
1316
|
return (identifiers, sortOrder) => updateProjectOrderInCollection2(
|
|
1268
1317
|
identifiers,
|
|
@@ -1400,15 +1449,27 @@ var onProjectUpdated = EventDefinition(
|
|
|
1400
1449
|
// src/portfolio-projects-v1-project-projects.context.ts
|
|
1401
1450
|
import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
|
|
1402
1451
|
import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
|
|
1452
|
+
import { createQueryOverloadRouter } from "@wix/sdk-runtime/query-method-router";
|
|
1453
|
+
function customQueryProjects(httpClient) {
|
|
1454
|
+
const router = createQueryOverloadRouter({
|
|
1455
|
+
builderQueryFunction: (options) => queryProjects3(httpClient)(options),
|
|
1456
|
+
typedQueryFunction: (query, options) => typedQueryProjects2(httpClient)(query, options),
|
|
1457
|
+
hasOptionsParameter: true
|
|
1458
|
+
});
|
|
1459
|
+
function overloadedQuery(queryOrOptions, options) {
|
|
1460
|
+
return router(...arguments);
|
|
1461
|
+
}
|
|
1462
|
+
return overloadedQuery;
|
|
1463
|
+
}
|
|
1403
1464
|
var createProject4 = /* @__PURE__ */ createRESTModule(createProject3);
|
|
1404
1465
|
var getProject4 = /* @__PURE__ */ createRESTModule(getProject3);
|
|
1405
1466
|
var listProjects4 = /* @__PURE__ */ createRESTModule(listProjects3);
|
|
1406
1467
|
var updateProject4 = /* @__PURE__ */ createRESTModule(updateProject3);
|
|
1407
1468
|
var bulkUpdateProjects4 = /* @__PURE__ */ createRESTModule(bulkUpdateProjects3);
|
|
1408
1469
|
var deleteProject4 = /* @__PURE__ */ createRESTModule(deleteProject3);
|
|
1409
|
-
var queryProjects4 = /* @__PURE__ */ createRESTModule(queryProjects3);
|
|
1410
1470
|
var updateProjectOrderInCollection4 = /* @__PURE__ */ createRESTModule(updateProjectOrderInCollection3);
|
|
1411
1471
|
var queryProjectsWithCollectionInfo4 = /* @__PURE__ */ createRESTModule(queryProjectsWithCollectionInfo3);
|
|
1472
|
+
var queryProjects4 = /* @__PURE__ */ createRESTModule(customQueryProjects);
|
|
1412
1473
|
var onProjectCreated2 = createEventModule(onProjectCreated);
|
|
1413
1474
|
var onProjectDeleted2 = createEventModule(onProjectDeleted);
|
|
1414
1475
|
var onProjectUpdated2 = createEventModule(onProjectUpdated);
|