@wix/auto_sdk_portfolio_projects 1.0.0
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 +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.context.d.ts +29 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.context.js +40 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.context.js.map +1 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.http.d.ts +42 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.http.js +634 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.http.js.map +1 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.meta.d.ts +30 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.meta.js +202 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.meta.js.map +1 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.public.d.ts +98 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.public.js +176 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.public.js.map +1 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.types.d.ts +1118 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.types.js +136 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.types.js.map +1 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.universal.d.ts +1446 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.universal.js +714 -0
- package/build/cjs/src/portfolio-projects-v1-project-projects.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/portfolio-projects-v1-project-projects.context.d.ts +29 -0
- package/build/es/src/portfolio-projects-v1-project-projects.context.js +29 -0
- package/build/es/src/portfolio-projects-v1-project-projects.context.js.map +1 -0
- package/build/es/src/portfolio-projects-v1-project-projects.http.d.ts +42 -0
- package/build/es/src/portfolio-projects-v1-project-projects.http.js +622 -0
- package/build/es/src/portfolio-projects-v1-project-projects.http.js.map +1 -0
- package/build/es/src/portfolio-projects-v1-project-projects.meta.d.ts +30 -0
- package/build/es/src/portfolio-projects-v1-project-projects.meta.js +167 -0
- package/build/es/src/portfolio-projects-v1-project-projects.meta.js.map +1 -0
- package/build/es/src/portfolio-projects-v1-project-projects.public.d.ts +98 -0
- package/build/es/src/portfolio-projects-v1-project-projects.public.js +156 -0
- package/build/es/src/portfolio-projects-v1-project-projects.public.js.map +1 -0
- package/build/es/src/portfolio-projects-v1-project-projects.types.d.ts +1118 -0
- package/build/es/src/portfolio-projects-v1-project-projects.types.js +133 -0
- package/build/es/src/portfolio-projects-v1-project-projects.types.js.map +1 -0
- package/build/es/src/portfolio-projects-v1-project-projects.universal.d.ts +1446 -0
- package/build/es/src/portfolio-projects-v1-project-projects.universal.js +679 -0
- package/build/es/src/portfolio-projects-v1-project-projects.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.context.d.ts +29 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.context.js +40 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.context.js.map +1 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.http.d.ts +42 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.http.js +634 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.http.js.map +1 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.meta.d.ts +30 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.meta.js +202 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.meta.js.map +1 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.public.d.ts +98 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.public.js +176 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.public.js.map +1 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.types.d.ts +1118 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.types.js +136 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.types.js.map +1 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.universal.d.ts +1446 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.universal.js +714 -0
- package/build/internal/cjs/src/portfolio-projects-v1-project-projects.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.context.d.ts +29 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.context.js +29 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.context.js.map +1 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.http.d.ts +42 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.http.js +622 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.http.js.map +1 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.meta.d.ts +30 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.meta.js +167 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.meta.js.map +1 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.public.d.ts +98 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.public.js +156 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.public.js.map +1 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.types.d.ts +1118 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.types.js +133 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.types.js.map +1 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.universal.d.ts +1446 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.universal.js +679 -0
- package/build/internal/es/src/portfolio-projects-v1-project-projects.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,714 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.queryProjectsWithCollectionInfo = exports.updateProjectOrderInCollection = exports.queryProjects = exports.deleteProject = exports.bulkUpdateProjects = exports.updateProject = exports.listProjects = exports.getProject = exports.createProject = exports.SortOrder = exports.WebhookIdentityType = exports.DeleteStatus = exports.Namespace = exports.SiteCreatedContext = exports.State = exports.SyncStatus = exports.ImageType = void 0;
|
|
27
|
+
const transform_error_1 = require("@wix/sdk-runtime/transform-error");
|
|
28
|
+
const query_builder_1 = require("@wix/sdk-runtime/query-builder");
|
|
29
|
+
const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
30
|
+
const ambassadorWixPortfolioProjectsV1Project = __importStar(require("./portfolio-projects-v1-project-projects.http.js"));
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
const image_1 = require("@wix/sdk-runtime/transformations/image");
|
|
33
|
+
const image_2 = require("@wix/sdk-runtime/transformations/image");
|
|
34
|
+
const video_v2_1 = require("@wix/sdk-runtime/transformations/video-v2");
|
|
35
|
+
const video_v2_2 = require("@wix/sdk-runtime/transformations/video-v2");
|
|
36
|
+
const page_url_v2_1 = require("@wix/sdk-runtime/transformations/page-url-v2");
|
|
37
|
+
const page_url_v2_2 = require("@wix/sdk-runtime/transformations/page-url-v2");
|
|
38
|
+
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
39
|
+
var ImageType;
|
|
40
|
+
(function (ImageType) {
|
|
41
|
+
ImageType["UNDEFINED"] = "UNDEFINED";
|
|
42
|
+
ImageType["WIX_MEDIA"] = "WIX_MEDIA";
|
|
43
|
+
ImageType["EXTERNAL"] = "EXTERNAL";
|
|
44
|
+
})(ImageType || (exports.ImageType = ImageType = {}));
|
|
45
|
+
var SyncStatus;
|
|
46
|
+
(function (SyncStatus) {
|
|
47
|
+
SyncStatus["SYNCED"] = "SYNCED";
|
|
48
|
+
SyncStatus["SYNCING"] = "SYNCING";
|
|
49
|
+
SyncStatus["NOT_SYNCED"] = "NOT_SYNCED";
|
|
50
|
+
})(SyncStatus || (exports.SyncStatus = SyncStatus = {}));
|
|
51
|
+
var State;
|
|
52
|
+
(function (State) {
|
|
53
|
+
State["UNKNOWN"] = "UNKNOWN";
|
|
54
|
+
State["ENABLED"] = "ENABLED";
|
|
55
|
+
State["DISABLED"] = "DISABLED";
|
|
56
|
+
State["PENDING"] = "PENDING";
|
|
57
|
+
State["DEMO"] = "DEMO";
|
|
58
|
+
})(State || (exports.State = State = {}));
|
|
59
|
+
var SiteCreatedContext;
|
|
60
|
+
(function (SiteCreatedContext) {
|
|
61
|
+
/** A valid option, we don't expose all reasons why site might be created. */
|
|
62
|
+
SiteCreatedContext["OTHER"] = "OTHER";
|
|
63
|
+
/** A meta site was created from template. */
|
|
64
|
+
SiteCreatedContext["FROM_TEMPLATE"] = "FROM_TEMPLATE";
|
|
65
|
+
/** A meta site was created by copying of the transfferred meta site. */
|
|
66
|
+
SiteCreatedContext["DUPLICATE_BY_SITE_TRANSFER"] = "DUPLICATE_BY_SITE_TRANSFER";
|
|
67
|
+
/** A copy of existing meta site. */
|
|
68
|
+
SiteCreatedContext["DUPLICATE"] = "DUPLICATE";
|
|
69
|
+
/** A meta site was created as a transfferred site (copy of the original), old flow, should die soon. */
|
|
70
|
+
SiteCreatedContext["OLD_SITE_TRANSFER"] = "OLD_SITE_TRANSFER";
|
|
71
|
+
/** deprecated A meta site was created for Flash editor. */
|
|
72
|
+
SiteCreatedContext["FLASH"] = "FLASH";
|
|
73
|
+
})(SiteCreatedContext || (exports.SiteCreatedContext = SiteCreatedContext = {}));
|
|
74
|
+
var Namespace;
|
|
75
|
+
(function (Namespace) {
|
|
76
|
+
Namespace["UNKNOWN_NAMESPACE"] = "UNKNOWN_NAMESPACE";
|
|
77
|
+
/** Default namespace for UGC sites. MetaSites with this namespace will be shown in a user's site list by default. */
|
|
78
|
+
Namespace["WIX"] = "WIX";
|
|
79
|
+
/** ShoutOut stand alone product. These are siteless (no actual Wix site, no HtmlWeb). MetaSites with this namespace will *not* be shown in a user's site list by default. */
|
|
80
|
+
Namespace["SHOUT_OUT"] = "SHOUT_OUT";
|
|
81
|
+
/** MetaSites created by the Albums product, they appear as part of the Albums app. MetaSites with this namespace will *not* be shown in a user's site list by default. */
|
|
82
|
+
Namespace["ALBUMS"] = "ALBUMS";
|
|
83
|
+
/** Part of the WixStores migration flow, a user tries to migrate and gets this site to view and if the user likes it then stores removes this namespace and deletes the old site with the old stores. MetaSites with this namespace will *not* be shown in a user's site list by default. */
|
|
84
|
+
Namespace["WIX_STORES_TEST_DRIVE"] = "WIX_STORES_TEST_DRIVE";
|
|
85
|
+
/** Hotels standalone (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
|
|
86
|
+
Namespace["HOTELS"] = "HOTELS";
|
|
87
|
+
/** Clubs siteless MetaSites, a club without a wix website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
|
|
88
|
+
Namespace["CLUBS"] = "CLUBS";
|
|
89
|
+
/** A partially created ADI website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
|
|
90
|
+
Namespace["ONBOARDING_DRAFT"] = "ONBOARDING_DRAFT";
|
|
91
|
+
/** AppBuilder for AppStudio / shmite (c). MetaSites with this namespace will *not* be shown in a user's site list by default. */
|
|
92
|
+
Namespace["DEV_SITE"] = "DEV_SITE";
|
|
93
|
+
/** LogoMaker websites offered to the user after logo purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
|
|
94
|
+
Namespace["LOGOS"] = "LOGOS";
|
|
95
|
+
/** VideoMaker websites offered to the user after video purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
|
|
96
|
+
Namespace["VIDEO_MAKER"] = "VIDEO_MAKER";
|
|
97
|
+
/** MetaSites with this namespace will *not* be shown in a user's site list by default. */
|
|
98
|
+
Namespace["PARTNER_DASHBOARD"] = "PARTNER_DASHBOARD";
|
|
99
|
+
/** MetaSites with this namespace will *not* be shown in a user's site list by default. */
|
|
100
|
+
Namespace["DEV_CENTER_COMPANY"] = "DEV_CENTER_COMPANY";
|
|
101
|
+
/**
|
|
102
|
+
* A draft created by HTML editor on open. Upon "first save" it will be moved to be of WIX domain.
|
|
103
|
+
*
|
|
104
|
+
* Meta site with this namespace will *not* be shown in a user's site list by default.
|
|
105
|
+
*/
|
|
106
|
+
Namespace["HTML_DRAFT"] = "HTML_DRAFT";
|
|
107
|
+
/**
|
|
108
|
+
* the user-journey for Fitness users who want to start from managing their business instead of designing their website.
|
|
109
|
+
* Will be accessible from Site List and will not have a website app.
|
|
110
|
+
* Once the user attaches a site, the site will become a regular wixsite.
|
|
111
|
+
*/
|
|
112
|
+
Namespace["SITELESS_BUSINESS"] = "SITELESS_BUSINESS";
|
|
113
|
+
/** Belongs to "strategic products" company. Supports new product in the creator's economy space. */
|
|
114
|
+
Namespace["CREATOR_ECONOMY"] = "CREATOR_ECONOMY";
|
|
115
|
+
/** It is to be used in the Business First efforts. */
|
|
116
|
+
Namespace["DASHBOARD_FIRST"] = "DASHBOARD_FIRST";
|
|
117
|
+
/** Bookings business flow with no site. */
|
|
118
|
+
Namespace["ANYWHERE"] = "ANYWHERE";
|
|
119
|
+
/** Namespace for Headless Backoffice with no editor */
|
|
120
|
+
Namespace["HEADLESS"] = "HEADLESS";
|
|
121
|
+
/**
|
|
122
|
+
* Namespace for master site that will exist in parent account that will be referenced by subaccounts
|
|
123
|
+
* The site will be used for account level CSM feature for enterprise
|
|
124
|
+
*/
|
|
125
|
+
Namespace["ACCOUNT_MASTER_CMS"] = "ACCOUNT_MASTER_CMS";
|
|
126
|
+
/** Rise.ai Siteless account management for Gift Cards and Store Credit. */
|
|
127
|
+
Namespace["RISE"] = "RISE";
|
|
128
|
+
/**
|
|
129
|
+
* As part of the branded app new funnel, users now can create a meta site that will be branded app first.
|
|
130
|
+
* There's a blank site behind the scene but it's blank).
|
|
131
|
+
* The Mobile company will be the owner of this namespace.
|
|
132
|
+
*/
|
|
133
|
+
Namespace["BRANDED_FIRST"] = "BRANDED_FIRST";
|
|
134
|
+
/** Nownia.com Siteless account management for Ai Scheduling Assistant. */
|
|
135
|
+
Namespace["NOWNIA"] = "NOWNIA";
|
|
136
|
+
/**
|
|
137
|
+
* UGC Templates are templates that are created by users for personal use and to sale to other users.
|
|
138
|
+
* The Partners company owns this namespace.
|
|
139
|
+
*/
|
|
140
|
+
Namespace["UGC_TEMPLATE"] = "UGC_TEMPLATE";
|
|
141
|
+
/** Codux Headless Sites */
|
|
142
|
+
Namespace["CODUX"] = "CODUX";
|
|
143
|
+
/** Bobb - AI Design Creator. */
|
|
144
|
+
Namespace["MEDIA_DESIGN_CREATOR"] = "MEDIA_DESIGN_CREATOR";
|
|
145
|
+
/**
|
|
146
|
+
* Shared Blog Site is a unique single site across Enterprise account,
|
|
147
|
+
* This site will hold all Blog posts related to the Marketing product.
|
|
148
|
+
*/
|
|
149
|
+
Namespace["SHARED_BLOG_ENTERPRISE"] = "SHARED_BLOG_ENTERPRISE";
|
|
150
|
+
})(Namespace || (exports.Namespace = Namespace = {}));
|
|
151
|
+
var DeleteStatus;
|
|
152
|
+
(function (DeleteStatus) {
|
|
153
|
+
DeleteStatus["UNKNOWN"] = "UNKNOWN";
|
|
154
|
+
DeleteStatus["TRASH"] = "TRASH";
|
|
155
|
+
DeleteStatus["DELETED"] = "DELETED";
|
|
156
|
+
DeleteStatus["PENDING_PURGE"] = "PENDING_PURGE";
|
|
157
|
+
})(DeleteStatus || (exports.DeleteStatus = DeleteStatus = {}));
|
|
158
|
+
var WebhookIdentityType;
|
|
159
|
+
(function (WebhookIdentityType) {
|
|
160
|
+
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
|
161
|
+
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
162
|
+
WebhookIdentityType["MEMBER"] = "MEMBER";
|
|
163
|
+
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
|
164
|
+
WebhookIdentityType["APP"] = "APP";
|
|
165
|
+
})(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
|
|
166
|
+
var SortOrder;
|
|
167
|
+
(function (SortOrder) {
|
|
168
|
+
SortOrder["ASC"] = "ASC";
|
|
169
|
+
SortOrder["DESC"] = "DESC";
|
|
170
|
+
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
171
|
+
/**
|
|
172
|
+
* Creates a project.
|
|
173
|
+
* @param project - Project to create.
|
|
174
|
+
* @public
|
|
175
|
+
* @documentationMaturity preview
|
|
176
|
+
* @requiredField project
|
|
177
|
+
* @permissionId PORTFOLIO.PROJECT_CREATE
|
|
178
|
+
* @permissionScope Manage Portfolio
|
|
179
|
+
* @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
|
|
180
|
+
* @applicableIdentity APP
|
|
181
|
+
* @returns Created project.
|
|
182
|
+
* @fqn com.wixpress.portfolio.projects.ProjectsService.CreateProject
|
|
183
|
+
*/
|
|
184
|
+
async function createProject(project) {
|
|
185
|
+
// @ts-ignore
|
|
186
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
187
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ project: project }), [
|
|
188
|
+
{
|
|
189
|
+
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
190
|
+
paths: [{ path: 'project.url' }],
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
194
|
+
paths: [{ path: 'project.coverImage.imageInfo' }],
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
|
|
198
|
+
paths: [{ path: 'project.coverVideo.videoInfo' }],
|
|
199
|
+
},
|
|
200
|
+
]);
|
|
201
|
+
const reqOpts = ambassadorWixPortfolioProjectsV1Project.createProject(payload);
|
|
202
|
+
sideEffects?.onSiteCall?.();
|
|
203
|
+
try {
|
|
204
|
+
const result = await httpClient.request(reqOpts);
|
|
205
|
+
sideEffects?.onSuccess?.(result);
|
|
206
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
207
|
+
{
|
|
208
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
209
|
+
paths: [{ path: 'project.url' }],
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
213
|
+
paths: [{ path: 'project.coverImage.imageInfo' }],
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
217
|
+
paths: [{ path: 'project.coverVideo.videoInfo' }],
|
|
218
|
+
},
|
|
219
|
+
]))?.project;
|
|
220
|
+
}
|
|
221
|
+
catch (err) {
|
|
222
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
223
|
+
spreadPathsToArguments: {},
|
|
224
|
+
explicitPathsToArguments: { project: '$[0]' },
|
|
225
|
+
singleArgumentUnchanged: false,
|
|
226
|
+
}, ['project']);
|
|
227
|
+
sideEffects?.onError?.(err);
|
|
228
|
+
throw transformedError;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
exports.createProject = createProject;
|
|
232
|
+
/**
|
|
233
|
+
* Retrieves a project.
|
|
234
|
+
* @param projectId - ID of the project to retrieve.
|
|
235
|
+
* @public
|
|
236
|
+
* @documentationMaturity preview
|
|
237
|
+
* @requiredField projectId
|
|
238
|
+
* @permissionId PORTFOLIO.PROJECT_READ
|
|
239
|
+
* @permissionScope Manage Portfolio
|
|
240
|
+
* @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
|
|
241
|
+
* @applicableIdentity APP
|
|
242
|
+
* @applicableIdentity VISITOR
|
|
243
|
+
* @returns The requested project.
|
|
244
|
+
* @fqn com.wixpress.portfolio.projects.ProjectsService.GetProject
|
|
245
|
+
*/
|
|
246
|
+
async function getProject(projectId, options) {
|
|
247
|
+
// @ts-ignore
|
|
248
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
249
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
250
|
+
projectId: projectId,
|
|
251
|
+
includePageUrl: options?.includePageUrl,
|
|
252
|
+
});
|
|
253
|
+
const reqOpts = ambassadorWixPortfolioProjectsV1Project.getProject(payload);
|
|
254
|
+
sideEffects?.onSiteCall?.();
|
|
255
|
+
try {
|
|
256
|
+
const result = await httpClient.request(reqOpts);
|
|
257
|
+
sideEffects?.onSuccess?.(result);
|
|
258
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
259
|
+
{
|
|
260
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
261
|
+
paths: [{ path: 'project.url' }],
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
265
|
+
paths: [{ path: 'project.coverImage.imageInfo' }],
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
269
|
+
paths: [{ path: 'project.coverVideo.videoInfo' }],
|
|
270
|
+
},
|
|
271
|
+
]))?.project;
|
|
272
|
+
}
|
|
273
|
+
catch (err) {
|
|
274
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
275
|
+
spreadPathsToArguments: {},
|
|
276
|
+
explicitPathsToArguments: {
|
|
277
|
+
projectId: '$[0]',
|
|
278
|
+
includePageUrl: '$[1].includePageUrl',
|
|
279
|
+
},
|
|
280
|
+
singleArgumentUnchanged: false,
|
|
281
|
+
}, ['projectId', 'options']);
|
|
282
|
+
sideEffects?.onError?.(err);
|
|
283
|
+
throw transformedError;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
exports.getProject = getProject;
|
|
287
|
+
/**
|
|
288
|
+
* Retrieves a list of all projects in a portfolio.
|
|
289
|
+
* @public
|
|
290
|
+
* @documentationMaturity preview
|
|
291
|
+
* @permissionId PORTFOLIO.PROJECT_READ
|
|
292
|
+
* @permissionScope Manage Portfolio
|
|
293
|
+
* @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
|
|
294
|
+
* @applicableIdentity APP
|
|
295
|
+
* @applicableIdentity VISITOR
|
|
296
|
+
* @fqn com.wixpress.portfolio.projects.ProjectsService.ListProjects
|
|
297
|
+
*/
|
|
298
|
+
async function listProjects(options) {
|
|
299
|
+
// @ts-ignore
|
|
300
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
301
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
302
|
+
paging: options?.paging,
|
|
303
|
+
includePageUrl: options?.includePageUrl,
|
|
304
|
+
});
|
|
305
|
+
const reqOpts = ambassadorWixPortfolioProjectsV1Project.listProjects(payload);
|
|
306
|
+
sideEffects?.onSiteCall?.();
|
|
307
|
+
try {
|
|
308
|
+
const result = await httpClient.request(reqOpts);
|
|
309
|
+
sideEffects?.onSuccess?.(result);
|
|
310
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
311
|
+
{
|
|
312
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
313
|
+
paths: [{ path: 'projects.url' }],
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
317
|
+
paths: [{ path: 'projects.coverImage.imageInfo' }],
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
321
|
+
paths: [{ path: 'projects.coverVideo.videoInfo' }],
|
|
322
|
+
},
|
|
323
|
+
]));
|
|
324
|
+
}
|
|
325
|
+
catch (err) {
|
|
326
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
327
|
+
spreadPathsToArguments: {},
|
|
328
|
+
explicitPathsToArguments: {
|
|
329
|
+
paging: '$[0].paging',
|
|
330
|
+
includePageUrl: '$[0].includePageUrl',
|
|
331
|
+
},
|
|
332
|
+
singleArgumentUnchanged: false,
|
|
333
|
+
}, ['options']);
|
|
334
|
+
sideEffects?.onError?.(err);
|
|
335
|
+
throw transformedError;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
exports.listProjects = listProjects;
|
|
339
|
+
/**
|
|
340
|
+
* Updates a project.
|
|
341
|
+
* @param _id - Project ID.
|
|
342
|
+
* @public
|
|
343
|
+
* @documentationMaturity preview
|
|
344
|
+
* @requiredField _id
|
|
345
|
+
* @requiredField project
|
|
346
|
+
* @requiredField project.revision
|
|
347
|
+
* @permissionId PORTFOLIO.PROJECT_UPDATE
|
|
348
|
+
* @permissionScope Manage Portfolio
|
|
349
|
+
* @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
|
|
350
|
+
* @applicableIdentity APP
|
|
351
|
+
* @returns Updated project.
|
|
352
|
+
* @fqn com.wixpress.portfolio.projects.ProjectsService.UpdateProject
|
|
353
|
+
*/
|
|
354
|
+
async function updateProject(_id, project) {
|
|
355
|
+
// @ts-ignore
|
|
356
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
357
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ project: { ...project, id: _id } }), [
|
|
358
|
+
{
|
|
359
|
+
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
360
|
+
paths: [{ path: 'project.url' }],
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
364
|
+
paths: [{ path: 'project.coverImage.imageInfo' }],
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
|
|
368
|
+
paths: [{ path: 'project.coverVideo.videoInfo' }],
|
|
369
|
+
},
|
|
370
|
+
]);
|
|
371
|
+
const reqOpts = ambassadorWixPortfolioProjectsV1Project.updateProject(payload);
|
|
372
|
+
sideEffects?.onSiteCall?.();
|
|
373
|
+
try {
|
|
374
|
+
const result = await httpClient.request(reqOpts);
|
|
375
|
+
sideEffects?.onSuccess?.(result);
|
|
376
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
377
|
+
{
|
|
378
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
379
|
+
paths: [{ path: 'project.url' }],
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
383
|
+
paths: [{ path: 'project.coverImage.imageInfo' }],
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
387
|
+
paths: [{ path: 'project.coverVideo.videoInfo' }],
|
|
388
|
+
},
|
|
389
|
+
]))?.project;
|
|
390
|
+
}
|
|
391
|
+
catch (err) {
|
|
392
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
393
|
+
spreadPathsToArguments: { project: '$[1]' },
|
|
394
|
+
explicitPathsToArguments: { 'project.id': '$[0]' },
|
|
395
|
+
singleArgumentUnchanged: false,
|
|
396
|
+
}, ['_id', 'project']);
|
|
397
|
+
sideEffects?.onError?.(err);
|
|
398
|
+
throw transformedError;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
exports.updateProject = updateProject;
|
|
402
|
+
/**
|
|
403
|
+
* Updates multiple projects.
|
|
404
|
+
* @public
|
|
405
|
+
* @documentationMaturity preview
|
|
406
|
+
* @requiredField options.projects.project
|
|
407
|
+
* @requiredField options.projects.project._id
|
|
408
|
+
* @requiredField options.projects.project.revision
|
|
409
|
+
* @permissionId PORTFOLIO.PROJECT_UPDATE
|
|
410
|
+
* @permissionScope Manage Portfolio
|
|
411
|
+
* @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
|
|
412
|
+
* @applicableIdentity APP
|
|
413
|
+
* @fqn com.wixpress.portfolio.projects.ProjectsService.BulkUpdateProjects
|
|
414
|
+
*/
|
|
415
|
+
async function bulkUpdateProjects(options) {
|
|
416
|
+
// @ts-ignore
|
|
417
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
418
|
+
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
419
|
+
projects: options?.projects,
|
|
420
|
+
returnFullEntity: options?.returnFullEntity,
|
|
421
|
+
}), [
|
|
422
|
+
{
|
|
423
|
+
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
424
|
+
paths: [{ path: 'projects.project.url' }],
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
transformFn: image_1.transformSDKImageToRESTImage,
|
|
428
|
+
paths: [{ path: 'projects.project.coverImage.imageInfo' }],
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
|
|
432
|
+
paths: [{ path: 'projects.project.coverVideo.videoInfo' }],
|
|
433
|
+
},
|
|
434
|
+
]);
|
|
435
|
+
const reqOpts = ambassadorWixPortfolioProjectsV1Project.bulkUpdateProjects(payload);
|
|
436
|
+
sideEffects?.onSiteCall?.();
|
|
437
|
+
try {
|
|
438
|
+
const result = await httpClient.request(reqOpts);
|
|
439
|
+
sideEffects?.onSuccess?.(result);
|
|
440
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
441
|
+
{
|
|
442
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
443
|
+
paths: [{ path: 'results.project.url' }],
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
447
|
+
paths: [{ path: 'results.project.coverImage.imageInfo' }],
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
451
|
+
paths: [{ path: 'results.project.coverVideo.videoInfo' }],
|
|
452
|
+
},
|
|
453
|
+
]));
|
|
454
|
+
}
|
|
455
|
+
catch (err) {
|
|
456
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
457
|
+
spreadPathsToArguments: {},
|
|
458
|
+
explicitPathsToArguments: {
|
|
459
|
+
projects: '$[0].projects',
|
|
460
|
+
returnFullEntity: '$[0].returnFullEntity',
|
|
461
|
+
},
|
|
462
|
+
singleArgumentUnchanged: false,
|
|
463
|
+
}, ['options']);
|
|
464
|
+
sideEffects?.onError?.(err);
|
|
465
|
+
throw transformedError;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
exports.bulkUpdateProjects = bulkUpdateProjects;
|
|
469
|
+
/**
|
|
470
|
+
* Deletes a project.
|
|
471
|
+
* @param projectId - ID of the project to delete.
|
|
472
|
+
* @public
|
|
473
|
+
* @documentationMaturity preview
|
|
474
|
+
* @requiredField projectId
|
|
475
|
+
* @permissionId PORTFOLIO.PROJECT_DELETE
|
|
476
|
+
* @permissionScope Manage Portfolio
|
|
477
|
+
* @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
|
|
478
|
+
* @applicableIdentity APP
|
|
479
|
+
* @fqn com.wixpress.portfolio.projects.ProjectsService.DeleteProject
|
|
480
|
+
*/
|
|
481
|
+
async function deleteProject(projectId) {
|
|
482
|
+
// @ts-ignore
|
|
483
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
484
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
485
|
+
projectId: projectId,
|
|
486
|
+
});
|
|
487
|
+
const reqOpts = ambassadorWixPortfolioProjectsV1Project.deleteProject(payload);
|
|
488
|
+
sideEffects?.onSiteCall?.();
|
|
489
|
+
try {
|
|
490
|
+
const result = await httpClient.request(reqOpts);
|
|
491
|
+
sideEffects?.onSuccess?.(result);
|
|
492
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
493
|
+
}
|
|
494
|
+
catch (err) {
|
|
495
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
496
|
+
spreadPathsToArguments: {},
|
|
497
|
+
explicitPathsToArguments: { projectId: '$[0]' },
|
|
498
|
+
singleArgumentUnchanged: false,
|
|
499
|
+
}, ['projectId']);
|
|
500
|
+
sideEffects?.onError?.(err);
|
|
501
|
+
throw transformedError;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
exports.deleteProject = deleteProject;
|
|
505
|
+
/**
|
|
506
|
+
* Creates a query to retrieve a list of projects.
|
|
507
|
+
*
|
|
508
|
+
* The `queryProjects()` method builds a query to retrieve a list of projects and returns a `ProjectsQueryBuilder` object.
|
|
509
|
+
*
|
|
510
|
+
* 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.
|
|
511
|
+
*
|
|
512
|
+
* 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.
|
|
513
|
+
*
|
|
514
|
+
* `queryProjects()` runs with the following `ProjectsQueryBuilder` defaults which you can override:
|
|
515
|
+
*
|
|
516
|
+
* + [`limit(100)`](https://dev.wix.com/docs/sdk/backend-modules/portfolio/projects/projects-query-builder/limit)
|
|
517
|
+
* + [`ascending('_id')`](https://dev.wix.com/docs/sdk/backend-modules/portfolio/projects/projects-query-builder/ascending)
|
|
518
|
+
*
|
|
519
|
+
* 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`.
|
|
520
|
+
* @public
|
|
521
|
+
* @documentationMaturity preview
|
|
522
|
+
* @permissionScope Manage Portfolio
|
|
523
|
+
* @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
|
|
524
|
+
* @permissionId PORTFOLIO.PROJECT_READ
|
|
525
|
+
* @applicableIdentity APP
|
|
526
|
+
* @applicableIdentity VISITOR
|
|
527
|
+
* @fqn com.wixpress.portfolio.projects.ProjectsService.QueryProjects
|
|
528
|
+
*/
|
|
529
|
+
function queryProjects(options) {
|
|
530
|
+
// @ts-ignore
|
|
531
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
532
|
+
return (0, query_builder_1.queryBuilder)({
|
|
533
|
+
func: async (payload) => {
|
|
534
|
+
const reqOpts = ambassadorWixPortfolioProjectsV1Project.queryProjects({
|
|
535
|
+
...payload,
|
|
536
|
+
...(options ?? {}),
|
|
537
|
+
});
|
|
538
|
+
sideEffects?.onSiteCall?.();
|
|
539
|
+
try {
|
|
540
|
+
const result = await httpClient.request(reqOpts);
|
|
541
|
+
sideEffects?.onSuccess?.(result);
|
|
542
|
+
return result;
|
|
543
|
+
}
|
|
544
|
+
catch (err) {
|
|
545
|
+
sideEffects?.onError?.(err);
|
|
546
|
+
throw err;
|
|
547
|
+
}
|
|
548
|
+
},
|
|
549
|
+
requestTransformer: (query) => {
|
|
550
|
+
const args = [query, options];
|
|
551
|
+
return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
552
|
+
...args?.[1],
|
|
553
|
+
query: args?.[0],
|
|
554
|
+
});
|
|
555
|
+
},
|
|
556
|
+
responseTransformer: ({ data }) => {
|
|
557
|
+
const transformedData = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(data, [
|
|
558
|
+
{
|
|
559
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
560
|
+
paths: [{ path: 'projects.url' }],
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
564
|
+
paths: [{ path: 'projects.coverImage.imageInfo' }],
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
568
|
+
paths: [{ path: 'projects.coverVideo.videoInfo' }],
|
|
569
|
+
},
|
|
570
|
+
]));
|
|
571
|
+
return {
|
|
572
|
+
items: transformedData?.projects,
|
|
573
|
+
pagingMetadata: transformedData?.metadata,
|
|
574
|
+
};
|
|
575
|
+
},
|
|
576
|
+
errorTransformer: (err) => {
|
|
577
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
578
|
+
spreadPathsToArguments: {},
|
|
579
|
+
explicitPathsToArguments: { query: '$[0]' },
|
|
580
|
+
singleArgumentUnchanged: false,
|
|
581
|
+
});
|
|
582
|
+
throw transformedError;
|
|
583
|
+
},
|
|
584
|
+
pagingMethod: 'CURSOR',
|
|
585
|
+
transformationPaths: {},
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
exports.queryProjects = queryProjects;
|
|
589
|
+
/**
|
|
590
|
+
* Deprecated - please use ProjectsInCollectionsService.UpdateProjectOrderInCollection instead
|
|
591
|
+
* our Client still use it
|
|
592
|
+
* @param sortOrder - Index that determines the placement of a project within the collection.
|
|
593
|
+
* @public
|
|
594
|
+
* @documentationMaturity preview
|
|
595
|
+
* @requiredField identifiers
|
|
596
|
+
* @requiredField identifiers.collectionId
|
|
597
|
+
* @requiredField identifiers.projectId
|
|
598
|
+
* @requiredField sortOrder
|
|
599
|
+
* @permissionId PORTFOLIO.PROJECT_UPDATE
|
|
600
|
+
* @permissionScope Manage Portfolio
|
|
601
|
+
* @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
|
|
602
|
+
* @applicableIdentity APP
|
|
603
|
+
* @fqn com.wixpress.portfolio.projects.ProjectsService.UpdateProjectOrderInCollection
|
|
604
|
+
* @deprecated
|
|
605
|
+
*/
|
|
606
|
+
async function updateProjectOrderInCollection(identifiers, sortOrder) {
|
|
607
|
+
// @ts-ignore
|
|
608
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
609
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
610
|
+
projectId: identifiers?.projectId,
|
|
611
|
+
collectionId: identifiers?.collectionId,
|
|
612
|
+
sortOrder: sortOrder,
|
|
613
|
+
});
|
|
614
|
+
const reqOpts = ambassadorWixPortfolioProjectsV1Project.updateProjectOrderInCollection(payload);
|
|
615
|
+
sideEffects?.onSiteCall?.();
|
|
616
|
+
try {
|
|
617
|
+
const result = await httpClient.request(reqOpts);
|
|
618
|
+
sideEffects?.onSuccess?.(result);
|
|
619
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
620
|
+
{
|
|
621
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
622
|
+
paths: [
|
|
623
|
+
{ path: 'project.project.url' },
|
|
624
|
+
{ path: 'projectInCollection.project.url' },
|
|
625
|
+
],
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
629
|
+
paths: [
|
|
630
|
+
{ path: 'project.project.coverImage.imageInfo' },
|
|
631
|
+
{ path: 'projectInCollection.project.coverImage.imageInfo' },
|
|
632
|
+
],
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
636
|
+
paths: [
|
|
637
|
+
{ path: 'project.project.coverVideo.videoInfo' },
|
|
638
|
+
{ path: 'projectInCollection.project.coverVideo.videoInfo' },
|
|
639
|
+
],
|
|
640
|
+
},
|
|
641
|
+
]));
|
|
642
|
+
}
|
|
643
|
+
catch (err) {
|
|
644
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
645
|
+
spreadPathsToArguments: {},
|
|
646
|
+
explicitPathsToArguments: {
|
|
647
|
+
projectId: '$[0].projectId',
|
|
648
|
+
collectionId: '$[0].collectionId',
|
|
649
|
+
sortOrder: '$[1]',
|
|
650
|
+
},
|
|
651
|
+
singleArgumentUnchanged: false,
|
|
652
|
+
}, ['identifiers', 'sortOrder']);
|
|
653
|
+
sideEffects?.onError?.(err);
|
|
654
|
+
throw transformedError;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
exports.updateProjectOrderInCollection = updateProjectOrderInCollection;
|
|
658
|
+
/**
|
|
659
|
+
* Deprecated - please use ProjectsInCollectionsService.QueryProjectsInCollections instead
|
|
660
|
+
* our Client still use it
|
|
661
|
+
* @param query - WQL expression
|
|
662
|
+
* @public
|
|
663
|
+
* @documentationMaturity preview
|
|
664
|
+
* @requiredField query
|
|
665
|
+
* @permissionId PORTFOLIO.PROJECT_READ
|
|
666
|
+
* @permissionScope Manage Portfolio
|
|
667
|
+
* @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
|
|
668
|
+
* @applicableIdentity APP
|
|
669
|
+
* @applicableIdentity VISITOR
|
|
670
|
+
* @fqn com.wixpress.portfolio.projects.ProjectsService.QueryProjectsWithCollectionInfo
|
|
671
|
+
* @deprecated
|
|
672
|
+
*/
|
|
673
|
+
async function queryProjectsWithCollectionInfo(query, options) {
|
|
674
|
+
// @ts-ignore
|
|
675
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
676
|
+
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
677
|
+
query: query,
|
|
678
|
+
includePageUrl: options?.includePageUrl,
|
|
679
|
+
});
|
|
680
|
+
const reqOpts = ambassadorWixPortfolioProjectsV1Project.queryProjectsWithCollectionInfo(payload);
|
|
681
|
+
sideEffects?.onSiteCall?.();
|
|
682
|
+
try {
|
|
683
|
+
const result = await httpClient.request(reqOpts);
|
|
684
|
+
sideEffects?.onSuccess?.(result);
|
|
685
|
+
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
686
|
+
{
|
|
687
|
+
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
688
|
+
paths: [{ path: 'projects.project.url' }],
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
transformFn: image_2.transformRESTImageToSDKImage,
|
|
692
|
+
paths: [{ path: 'projects.project.coverImage.imageInfo' }],
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
|
|
696
|
+
paths: [{ path: 'projects.project.coverVideo.videoInfo' }],
|
|
697
|
+
},
|
|
698
|
+
]));
|
|
699
|
+
}
|
|
700
|
+
catch (err) {
|
|
701
|
+
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
702
|
+
spreadPathsToArguments: {},
|
|
703
|
+
explicitPathsToArguments: {
|
|
704
|
+
query: '$[0]',
|
|
705
|
+
includePageUrl: '$[1].includePageUrl',
|
|
706
|
+
},
|
|
707
|
+
singleArgumentUnchanged: false,
|
|
708
|
+
}, ['query', 'options']);
|
|
709
|
+
sideEffects?.onError?.(err);
|
|
710
|
+
throw transformedError;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
exports.queryProjectsWithCollectionInfo = queryProjectsWithCollectionInfo;
|
|
714
|
+
//# sourceMappingURL=portfolio-projects-v1-project-projects.universal.js.map
|