@wix/workflows 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 +3 -0
- package/build/cjs/index.js +26 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/src/workflows-v1-card.http.d.ts +92 -0
- package/build/cjs/src/workflows-v1-card.http.js +339 -0
- package/build/cjs/src/workflows-v1-card.http.js.map +1 -0
- package/build/cjs/src/workflows-v1-card.public.d.ts +15 -0
- package/build/cjs/src/workflows-v1-card.public.js +57 -0
- package/build/cjs/src/workflows-v1-card.public.js.map +1 -0
- package/build/cjs/src/workflows-v1-card.types.d.ts +240 -0
- package/build/cjs/src/workflows-v1-card.types.js +14 -0
- package/build/cjs/src/workflows-v1-card.types.js.map +1 -0
- package/build/cjs/src/workflows-v1-card.universal.d.ts +449 -0
- package/build/cjs/src/workflows-v1-card.universal.js +569 -0
- package/build/cjs/src/workflows-v1-card.universal.js.map +1 -0
- package/build/cjs/src/workflows-v1-phase.http.d.ts +61 -0
- package/build/cjs/src/workflows-v1-phase.http.js +288 -0
- package/build/cjs/src/workflows-v1-phase.http.js.map +1 -0
- package/build/cjs/src/workflows-v1-phase.public.d.ts +14 -0
- package/build/cjs/src/workflows-v1-phase.public.js +51 -0
- package/build/cjs/src/workflows-v1-phase.public.js.map +1 -0
- package/build/cjs/src/workflows-v1-phase.types.d.ts +234 -0
- package/build/cjs/src/workflows-v1-phase.types.js +14 -0
- package/build/cjs/src/workflows-v1-phase.types.js.map +1 -0
- package/build/cjs/src/workflows-v1-phase.universal.d.ts +388 -0
- package/build/cjs/src/workflows-v1-phase.universal.js +488 -0
- package/build/cjs/src/workflows-v1-phase.universal.js.map +1 -0
- package/build/cjs/src/workflows-v1-workflow.http.d.ts +74 -0
- package/build/cjs/src/workflows-v1-workflow.http.js +315 -0
- package/build/cjs/src/workflows-v1-workflow.http.js.map +1 -0
- package/build/cjs/src/workflows-v1-workflow.public.d.ts +14 -0
- package/build/cjs/src/workflows-v1-workflow.public.js +51 -0
- package/build/cjs/src/workflows-v1-workflow.public.js.map +1 -0
- package/build/cjs/src/workflows-v1-workflow.types.d.ts +273 -0
- package/build/cjs/src/workflows-v1-workflow.types.js +14 -0
- package/build/cjs/src/workflows-v1-workflow.types.js.map +1 -0
- package/build/cjs/src/workflows-v1-workflow.universal.d.ts +424 -0
- package/build/cjs/src/workflows-v1-workflow.universal.js +478 -0
- package/build/cjs/src/workflows-v1-workflow.universal.js.map +1 -0
- package/build/es/index.d.ts +3 -0
- package/build/es/index.js +4 -0
- package/build/es/index.js.map +1 -0
- package/build/es/src/workflows-v1-card.http.d.ts +92 -0
- package/build/es/src/workflows-v1-card.http.js +328 -0
- package/build/es/src/workflows-v1-card.http.js.map +1 -0
- package/build/es/src/workflows-v1-card.public.d.ts +15 -0
- package/build/es/src/workflows-v1-card.public.js +44 -0
- package/build/es/src/workflows-v1-card.public.js.map +1 -0
- package/build/es/src/workflows-v1-card.types.d.ts +240 -0
- package/build/es/src/workflows-v1-card.types.js +11 -0
- package/build/es/src/workflows-v1-card.types.js.map +1 -0
- package/build/es/src/workflows-v1-card.universal.d.ts +449 -0
- package/build/es/src/workflows-v1-card.universal.js +539 -0
- package/build/es/src/workflows-v1-card.universal.js.map +1 -0
- package/build/es/src/workflows-v1-phase.http.d.ts +61 -0
- package/build/es/src/workflows-v1-phase.http.js +278 -0
- package/build/es/src/workflows-v1-phase.http.js.map +1 -0
- package/build/es/src/workflows-v1-phase.public.d.ts +14 -0
- package/build/es/src/workflows-v1-phase.public.js +39 -0
- package/build/es/src/workflows-v1-phase.public.js.map +1 -0
- package/build/es/src/workflows-v1-phase.types.d.ts +234 -0
- package/build/es/src/workflows-v1-phase.types.js +11 -0
- package/build/es/src/workflows-v1-phase.types.js.map +1 -0
- package/build/es/src/workflows-v1-phase.universal.d.ts +388 -0
- package/build/es/src/workflows-v1-phase.universal.js +459 -0
- package/build/es/src/workflows-v1-phase.universal.js.map +1 -0
- package/build/es/src/workflows-v1-workflow.http.d.ts +74 -0
- package/build/es/src/workflows-v1-workflow.http.js +305 -0
- package/build/es/src/workflows-v1-workflow.http.js.map +1 -0
- package/build/es/src/workflows-v1-workflow.public.d.ts +14 -0
- package/build/es/src/workflows-v1-workflow.public.js +39 -0
- package/build/es/src/workflows-v1-workflow.public.js.map +1 -0
- package/build/es/src/workflows-v1-workflow.types.d.ts +273 -0
- package/build/es/src/workflows-v1-workflow.types.js +11 -0
- package/build/es/src/workflows-v1-workflow.types.js.map +1 -0
- package/build/es/src/workflows-v1-workflow.universal.d.ts +424 -0
- package/build/es/src/workflows-v1-workflow.universal.js +449 -0
- package/build/es/src/workflows-v1-workflow.universal.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
24
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
25
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
26
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.movePhase = exports.deletePhase = exports.createPhase = exports.updatePhase = exports.getPhase = exports.listPhases = exports.queryPhases = exports.SortOrder = exports.AttachmentType = exports.__debug = void 0;
|
|
32
|
+
const velo_1 = require("@wix/metro-runtime/velo");
|
|
33
|
+
const ambassadorWixWorkflowsV1Phase = __importStar(require("./workflows-v1-phase.http"));
|
|
34
|
+
let __verbose = false;
|
|
35
|
+
function __log(...args) {
|
|
36
|
+
__verbose && console.log(...args);
|
|
37
|
+
}
|
|
38
|
+
function __inspect(obj) {
|
|
39
|
+
return obj;
|
|
40
|
+
}
|
|
41
|
+
exports.__debug = {
|
|
42
|
+
verboseLogging: {
|
|
43
|
+
on: () => (__verbose = true),
|
|
44
|
+
off: () => (__verbose = false),
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
const _toVeloEntity = '$';
|
|
48
|
+
const _fromVeloEntity = '$';
|
|
49
|
+
/** describes the supported types of attachments (currently only supports Contact which is the default type) */
|
|
50
|
+
var AttachmentType;
|
|
51
|
+
(function (AttachmentType) {
|
|
52
|
+
AttachmentType["ContactType"] = "ContactType";
|
|
53
|
+
})(AttachmentType = exports.AttachmentType || (exports.AttachmentType = {}));
|
|
54
|
+
var SortOrder;
|
|
55
|
+
(function (SortOrder) {
|
|
56
|
+
SortOrder["ASC"] = "ASC";
|
|
57
|
+
SortOrder["DESC"] = "DESC";
|
|
58
|
+
})(SortOrder = exports.SortOrder || (exports.SortOrder = {}));
|
|
59
|
+
const _createPhaseRequest = {};
|
|
60
|
+
const _createPhaseResponse = {};
|
|
61
|
+
const _deletePhaseRequest = {};
|
|
62
|
+
const _deletePhaseResponse = {};
|
|
63
|
+
const _getPhaseRequest = {};
|
|
64
|
+
const _getPhaseResponse = {};
|
|
65
|
+
const _listPhasesRequest = {};
|
|
66
|
+
const _listPhasesResponse = {};
|
|
67
|
+
const _movePhaseRequest = {};
|
|
68
|
+
const _movePhaseResponse = {};
|
|
69
|
+
const _queryPhasesRequest = {};
|
|
70
|
+
const _queryPhasesResponse = {};
|
|
71
|
+
const _updatePhaseRequest = {};
|
|
72
|
+
const _updatePhaseResponse = {};
|
|
73
|
+
/**
|
|
74
|
+
* Returns a list of phases according to:
|
|
75
|
+
* * paging: offset, limit
|
|
76
|
+
* * order: by some of the following fields: id, name, position
|
|
77
|
+
* * filter: by the following fields of PhaseInfo
|
|
78
|
+
* ** phaseInfo.id - Guid
|
|
79
|
+
* ** phaseInfo.name - Text
|
|
80
|
+
* ** phaseInfo.visibility - Text (Visible / Archived)
|
|
81
|
+
* @public
|
|
82
|
+
* @documentationMaturity preview
|
|
83
|
+
*/
|
|
84
|
+
function queryPhases(options) {
|
|
85
|
+
var _a, _b, _c;
|
|
86
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
87
|
+
const requestTransformation = { query: '$[0].query' };
|
|
88
|
+
const responseTransformation = '$';
|
|
89
|
+
// @ts-ignore
|
|
90
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
91
|
+
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
92
|
+
rootSchema: _queryPhasesRequest,
|
|
93
|
+
depSchemas: {},
|
|
94
|
+
fqdnTransformation: {
|
|
95
|
+
paths: [],
|
|
96
|
+
transformation: _fromVeloEntity,
|
|
97
|
+
},
|
|
98
|
+
customTransformation: requestTransformation,
|
|
99
|
+
});
|
|
100
|
+
const { fromJSON } = (0, velo_1.serializer)({
|
|
101
|
+
rootSchema: _queryPhasesResponse,
|
|
102
|
+
depSchemas: {},
|
|
103
|
+
fqdnTransformation: {
|
|
104
|
+
paths: [...['Array#phases']],
|
|
105
|
+
transformation: _toVeloEntity,
|
|
106
|
+
},
|
|
107
|
+
customTransformation: responseTransformation,
|
|
108
|
+
});
|
|
109
|
+
const payload = toAmbassadorRequest([options]);
|
|
110
|
+
const reqOpts = ambassadorWixWorkflowsV1Phase.queryPhases(payload);
|
|
111
|
+
__log(`"QueryPhases" sending request with: ${__inspect(reqOpts)}`);
|
|
112
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
113
|
+
try {
|
|
114
|
+
const result = yield httpClient.request(reqOpts);
|
|
115
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
116
|
+
return fromJSON(result.data);
|
|
117
|
+
}
|
|
118
|
+
catch (err) {
|
|
119
|
+
const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
|
|
120
|
+
'options',
|
|
121
|
+
]);
|
|
122
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
123
|
+
throw transformedError;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
exports.queryPhases = queryPhases;
|
|
128
|
+
/**
|
|
129
|
+
* Retrieves a list of active phases in the specified workflow.
|
|
130
|
+
*
|
|
131
|
+
* By default, the returned phases are sorted by their display order.
|
|
132
|
+
*
|
|
133
|
+
* The win phase is not an active phase
|
|
134
|
+
* and is therefore not returned with this endpoint.
|
|
135
|
+
* To get the win phase ID, use
|
|
136
|
+
* [Get Workflow](https://dev.wix.com/api/rest/workflows/workflows/workflows/get-workflow?branch=workflows).
|
|
137
|
+
* @param workflowId - ID of the workflow whose phases will be listed.
|
|
138
|
+
* @public
|
|
139
|
+
* @documentationMaturity preview
|
|
140
|
+
* @requiredField workflowId
|
|
141
|
+
*/
|
|
142
|
+
function listPhases(workflowId, options) {
|
|
143
|
+
var _a, _b, _c;
|
|
144
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
145
|
+
const requestTransformation = {
|
|
146
|
+
workflowId: '$[0]',
|
|
147
|
+
limit: '$[1].limit',
|
|
148
|
+
offset: '$[1].offset',
|
|
149
|
+
sort: '$[1].sort',
|
|
150
|
+
};
|
|
151
|
+
const responseTransformation = '$';
|
|
152
|
+
// @ts-ignore
|
|
153
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
154
|
+
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
155
|
+
rootSchema: _listPhasesRequest,
|
|
156
|
+
depSchemas: {},
|
|
157
|
+
fqdnTransformation: {
|
|
158
|
+
paths: [],
|
|
159
|
+
transformation: _fromVeloEntity,
|
|
160
|
+
},
|
|
161
|
+
customTransformation: requestTransformation,
|
|
162
|
+
});
|
|
163
|
+
const { fromJSON } = (0, velo_1.serializer)({
|
|
164
|
+
rootSchema: _listPhasesResponse,
|
|
165
|
+
depSchemas: {},
|
|
166
|
+
fqdnTransformation: {
|
|
167
|
+
paths: [...['Array#phases']],
|
|
168
|
+
transformation: _toVeloEntity,
|
|
169
|
+
},
|
|
170
|
+
customTransformation: responseTransformation,
|
|
171
|
+
});
|
|
172
|
+
const payload = toAmbassadorRequest([workflowId, options]);
|
|
173
|
+
const reqOpts = ambassadorWixWorkflowsV1Phase.listPhases(payload);
|
|
174
|
+
__log(`"ListPhases" sending request with: ${__inspect(reqOpts)}`);
|
|
175
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
176
|
+
try {
|
|
177
|
+
const result = yield httpClient.request(reqOpts);
|
|
178
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
179
|
+
return fromJSON(result.data);
|
|
180
|
+
}
|
|
181
|
+
catch (err) {
|
|
182
|
+
const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
|
|
183
|
+
'workflowId',
|
|
184
|
+
'options',
|
|
185
|
+
]);
|
|
186
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
187
|
+
throw transformedError;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
exports.listPhases = listPhases;
|
|
192
|
+
/**
|
|
193
|
+
* Retrieves a phase and its cards.
|
|
194
|
+
* @param _id - ID of the phase to retrieve.
|
|
195
|
+
* @public
|
|
196
|
+
* @documentationMaturity preview
|
|
197
|
+
* @requiredField _id
|
|
198
|
+
*/
|
|
199
|
+
function getPhase(_id) {
|
|
200
|
+
var _a, _b, _c;
|
|
201
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
202
|
+
const requestTransformation = { id: '$[0]' };
|
|
203
|
+
const responseTransformation = '$';
|
|
204
|
+
// @ts-ignore
|
|
205
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
206
|
+
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
207
|
+
rootSchema: _getPhaseRequest,
|
|
208
|
+
depSchemas: {},
|
|
209
|
+
fqdnTransformation: {
|
|
210
|
+
paths: [],
|
|
211
|
+
transformation: _fromVeloEntity,
|
|
212
|
+
},
|
|
213
|
+
customTransformation: requestTransformation,
|
|
214
|
+
});
|
|
215
|
+
const { fromJSON } = (0, velo_1.serializer)({
|
|
216
|
+
rootSchema: _getPhaseResponse,
|
|
217
|
+
depSchemas: {},
|
|
218
|
+
fqdnTransformation: {
|
|
219
|
+
paths: [...['phase']],
|
|
220
|
+
transformation: _toVeloEntity,
|
|
221
|
+
},
|
|
222
|
+
customTransformation: responseTransformation,
|
|
223
|
+
});
|
|
224
|
+
const payload = toAmbassadorRequest([_id]);
|
|
225
|
+
const reqOpts = ambassadorWixWorkflowsV1Phase.getPhase(payload);
|
|
226
|
+
__log(`"GetPhase" sending request with: ${__inspect(reqOpts)}`);
|
|
227
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
228
|
+
try {
|
|
229
|
+
const result = yield httpClient.request(reqOpts);
|
|
230
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
231
|
+
return fromJSON(result.data);
|
|
232
|
+
}
|
|
233
|
+
catch (err) {
|
|
234
|
+
const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
|
|
235
|
+
'_id',
|
|
236
|
+
]);
|
|
237
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
238
|
+
throw transformedError;
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
exports.getPhase = getPhase;
|
|
243
|
+
/**
|
|
244
|
+
* Updates a phase's name.
|
|
245
|
+
*
|
|
246
|
+
* To reorder phases, use
|
|
247
|
+
* [Move Phase](https://dev.wix.com/api/rest/workflows/workflows/phases/move-phase).
|
|
248
|
+
* To reorder or rename cards, use the
|
|
249
|
+
* [Cards API](https://dev.wix.com/api/rest/workflows/workflows/cards).
|
|
250
|
+
* @param _id - ID of the phase to update.
|
|
251
|
+
* @public
|
|
252
|
+
* @documentationMaturity preview
|
|
253
|
+
* @requiredField _id
|
|
254
|
+
*/
|
|
255
|
+
function updatePhase(_id, options) {
|
|
256
|
+
var _a, _b, _c;
|
|
257
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
258
|
+
const requestTransformation = { id: '$[0]', phase: '$[1].phase' };
|
|
259
|
+
const responseTransformation = '$';
|
|
260
|
+
// @ts-ignore
|
|
261
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
262
|
+
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
263
|
+
rootSchema: _updatePhaseRequest,
|
|
264
|
+
depSchemas: {},
|
|
265
|
+
fqdnTransformation: {
|
|
266
|
+
paths: [],
|
|
267
|
+
transformation: _fromVeloEntity,
|
|
268
|
+
},
|
|
269
|
+
customTransformation: requestTransformation,
|
|
270
|
+
});
|
|
271
|
+
const { fromJSON } = (0, velo_1.serializer)({
|
|
272
|
+
rootSchema: _updatePhaseResponse,
|
|
273
|
+
depSchemas: {},
|
|
274
|
+
fqdnTransformation: {
|
|
275
|
+
paths: [],
|
|
276
|
+
transformation: _toVeloEntity,
|
|
277
|
+
},
|
|
278
|
+
customTransformation: responseTransformation,
|
|
279
|
+
});
|
|
280
|
+
const payload = toAmbassadorRequest([_id, options]);
|
|
281
|
+
const reqOpts = ambassadorWixWorkflowsV1Phase.updatePhase(payload);
|
|
282
|
+
__log(`"UpdatePhase" sending request with: ${__inspect(reqOpts)}`);
|
|
283
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
284
|
+
try {
|
|
285
|
+
const result = yield httpClient.request(reqOpts);
|
|
286
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
287
|
+
return fromJSON(result.data);
|
|
288
|
+
}
|
|
289
|
+
catch (err) {
|
|
290
|
+
const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
|
|
291
|
+
'_id',
|
|
292
|
+
'options',
|
|
293
|
+
]);
|
|
294
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
295
|
+
throw transformedError;
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
exports.updatePhase = updatePhase;
|
|
300
|
+
/**
|
|
301
|
+
* Creates a new phase in the specified workflow.
|
|
302
|
+
*
|
|
303
|
+
* When creating a phase, you provide a `name` and an optional `position`.
|
|
304
|
+
*
|
|
305
|
+
* Phases are displayed according to their position from left to right,
|
|
306
|
+
* starting from `0` and incrementing by 1.
|
|
307
|
+
* If you create or move a phase to an existing position,
|
|
308
|
+
* the phase in that position and any subsequent phases
|
|
309
|
+
* are shifted to the right by 1.
|
|
310
|
+
*
|
|
311
|
+
* If `position` is not specified,
|
|
312
|
+
* the new phase is given the rightmost position.
|
|
313
|
+
* @param workflowId - ID of the workflow to create the phase in.
|
|
314
|
+
* @public
|
|
315
|
+
* @documentationMaturity preview
|
|
316
|
+
* @requiredField options.phase.name
|
|
317
|
+
* @requiredField workflowId
|
|
318
|
+
*/
|
|
319
|
+
function createPhase(workflowId, options) {
|
|
320
|
+
var _a, _b, _c;
|
|
321
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
322
|
+
const requestTransformation = {
|
|
323
|
+
workflowId: '$[0]',
|
|
324
|
+
phase: '$[1].phase',
|
|
325
|
+
position: '$[1].position',
|
|
326
|
+
};
|
|
327
|
+
const responseTransformation = '$';
|
|
328
|
+
// @ts-ignore
|
|
329
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
330
|
+
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
331
|
+
rootSchema: _createPhaseRequest,
|
|
332
|
+
depSchemas: {},
|
|
333
|
+
fqdnTransformation: {
|
|
334
|
+
paths: [],
|
|
335
|
+
transformation: _fromVeloEntity,
|
|
336
|
+
},
|
|
337
|
+
customTransformation: requestTransformation,
|
|
338
|
+
});
|
|
339
|
+
const { fromJSON } = (0, velo_1.serializer)({
|
|
340
|
+
rootSchema: _createPhaseResponse,
|
|
341
|
+
depSchemas: {},
|
|
342
|
+
fqdnTransformation: {
|
|
343
|
+
paths: [],
|
|
344
|
+
transformation: _toVeloEntity,
|
|
345
|
+
},
|
|
346
|
+
customTransformation: responseTransformation,
|
|
347
|
+
});
|
|
348
|
+
const payload = toAmbassadorRequest([workflowId, options]);
|
|
349
|
+
const reqOpts = ambassadorWixWorkflowsV1Phase.createPhase(payload);
|
|
350
|
+
__log(`"CreatePhase" sending request with: ${__inspect(reqOpts)}`);
|
|
351
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
352
|
+
try {
|
|
353
|
+
const result = yield httpClient.request(reqOpts);
|
|
354
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
355
|
+
return fromJSON(result.data);
|
|
356
|
+
}
|
|
357
|
+
catch (err) {
|
|
358
|
+
const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
|
|
359
|
+
'workflowId',
|
|
360
|
+
'options',
|
|
361
|
+
]);
|
|
362
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
363
|
+
throw transformedError;
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
exports.createPhase = createPhase;
|
|
368
|
+
/**
|
|
369
|
+
* Deletes a phase and its cards.
|
|
370
|
+
* @param _id - ID of the phase to delete.
|
|
371
|
+
* @public
|
|
372
|
+
* @documentationMaturity preview
|
|
373
|
+
* @requiredField _id
|
|
374
|
+
*/
|
|
375
|
+
function deletePhase(_id) {
|
|
376
|
+
var _a, _b, _c;
|
|
377
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
378
|
+
const requestTransformation = { id: '$[0]' };
|
|
379
|
+
const responseTransformation = '$';
|
|
380
|
+
// @ts-ignore
|
|
381
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
382
|
+
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
383
|
+
rootSchema: _deletePhaseRequest,
|
|
384
|
+
depSchemas: {},
|
|
385
|
+
fqdnTransformation: {
|
|
386
|
+
paths: [],
|
|
387
|
+
transformation: _fromVeloEntity,
|
|
388
|
+
},
|
|
389
|
+
customTransformation: requestTransformation,
|
|
390
|
+
});
|
|
391
|
+
const { fromJSON } = (0, velo_1.serializer)({
|
|
392
|
+
rootSchema: _deletePhaseResponse,
|
|
393
|
+
depSchemas: {},
|
|
394
|
+
fqdnTransformation: {
|
|
395
|
+
paths: [],
|
|
396
|
+
transformation: _toVeloEntity,
|
|
397
|
+
},
|
|
398
|
+
customTransformation: responseTransformation,
|
|
399
|
+
});
|
|
400
|
+
const payload = toAmbassadorRequest([_id]);
|
|
401
|
+
const reqOpts = ambassadorWixWorkflowsV1Phase.deletePhase(payload);
|
|
402
|
+
__log(`"DeletePhase" sending request with: ${__inspect(reqOpts)}`);
|
|
403
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
404
|
+
try {
|
|
405
|
+
const result = yield httpClient.request(reqOpts);
|
|
406
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
407
|
+
return fromJSON(result.data);
|
|
408
|
+
}
|
|
409
|
+
catch (err) {
|
|
410
|
+
const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
|
|
411
|
+
'_id',
|
|
412
|
+
]);
|
|
413
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
414
|
+
throw transformedError;
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
exports.deletePhase = deletePhase;
|
|
419
|
+
/**
|
|
420
|
+
* Moves a phase to a new position in its workflow.
|
|
421
|
+
*
|
|
422
|
+
* Phases are displayed according to their position from left to right,
|
|
423
|
+
* starting from `0` and incrementing by 1.
|
|
424
|
+
* If you create or move a phase to an existing position,
|
|
425
|
+
* the phase in that position and any subsequent phases
|
|
426
|
+
* are shifted to the right by 1.
|
|
427
|
+
* @param newPosition - New phase position, where the first phase is `0`.
|
|
428
|
+
*
|
|
429
|
+
* If a phase already occupies the specified position,
|
|
430
|
+
* that phase and any subsequent phases
|
|
431
|
+
* are shifted to the right by 1.
|
|
432
|
+
* @public
|
|
433
|
+
* @documentationMaturity preview
|
|
434
|
+
* @requiredField identifiers
|
|
435
|
+
* @requiredField identifiers.id
|
|
436
|
+
* @requiredField identifiers.workflowId
|
|
437
|
+
* @requiredField newPosition
|
|
438
|
+
*/
|
|
439
|
+
function movePhase(identifiers, newPosition) {
|
|
440
|
+
var _a, _b, _c;
|
|
441
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
442
|
+
const requestTransformation = {
|
|
443
|
+
workflowId: '$[0].workflowId',
|
|
444
|
+
id: '$[0]._id',
|
|
445
|
+
newPosition: '$[1]',
|
|
446
|
+
};
|
|
447
|
+
const responseTransformation = '$';
|
|
448
|
+
// @ts-ignore
|
|
449
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
450
|
+
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
451
|
+
rootSchema: _movePhaseRequest,
|
|
452
|
+
depSchemas: {},
|
|
453
|
+
fqdnTransformation: {
|
|
454
|
+
paths: [],
|
|
455
|
+
transformation: _fromVeloEntity,
|
|
456
|
+
},
|
|
457
|
+
customTransformation: requestTransformation,
|
|
458
|
+
});
|
|
459
|
+
const { fromJSON } = (0, velo_1.serializer)({
|
|
460
|
+
rootSchema: _movePhaseResponse,
|
|
461
|
+
depSchemas: {},
|
|
462
|
+
fqdnTransformation: {
|
|
463
|
+
paths: [],
|
|
464
|
+
transformation: _toVeloEntity,
|
|
465
|
+
},
|
|
466
|
+
customTransformation: responseTransformation,
|
|
467
|
+
});
|
|
468
|
+
const payload = toAmbassadorRequest([identifiers, newPosition]);
|
|
469
|
+
const reqOpts = ambassadorWixWorkflowsV1Phase.movePhase(payload);
|
|
470
|
+
__log(`"MovePhase" sending request with: ${__inspect(reqOpts)}`);
|
|
471
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
472
|
+
try {
|
|
473
|
+
const result = yield httpClient.request(reqOpts);
|
|
474
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
475
|
+
return fromJSON(result.data);
|
|
476
|
+
}
|
|
477
|
+
catch (err) {
|
|
478
|
+
const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
|
|
479
|
+
'identifiers',
|
|
480
|
+
'newPosition',
|
|
481
|
+
]);
|
|
482
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
483
|
+
throw transformedError;
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
exports.movePhase = movePhase;
|
|
488
|
+
//# sourceMappingURL=workflows-v1-phase.universal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflows-v1-phase.universal.js","sourceRoot":"","sources":["../../../src/workflows-v1-phase.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAqE;AAErE,yFAA2E;AAE3E,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,GAAQ;IACzB,OAAO,GAAG,CAAC;AACb,CAAC;AAEY,QAAA,OAAO,GAAG;IACrB,cAAc,EAAE;QACd,EA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MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,iBAAU,EAAC;YAC9B,UAAU,EAAE,kBAAkB;YAC9B,UAAU,EAAE,EAAE;YACd,kBAAkB,EAAE;gBAClB,KAAK,EAAE,EAAE;gBACT,cAAc,EAAE,aAAa;aAC9B;YACD,oBAAoB,EAAE,sBAAsB;SAC7C,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,mBAAmB,CAAC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;QAEhE,MAAM,OAAO,GAAG,6BAA6B,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAEjE,KAAK,CAAC,qCAAqC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAEjE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,+CAAvB,WAAW,CAAgB,CAAC;QAC5B,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACjD,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,+CAAtB,WAAW,EAAc,MAAM,CAAC,CAAC;YAEjC,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAQ,CAAC;SACrC;QAAC,OAAO,GAAQ,EAAE;YACjB,MAAM,gBAAgB,GAAG,IAAA,qBAAc,EAAC,GAAG,EAAE,qBAAqB,EAAE;gBAClE,aAAa;gBACb,aAAa;aACd,CAAC,CAAC;YACH,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,+CAApB,WAAW,EAAY,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;SACxB;;CACF;AA1DD,8BA0DC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { RequestOptionsFactory } from '@wix/sdk-types';
|
|
2
|
+
import { CreateWorkflowRequest, CreateWorkflowResponse, DeleteWorkflowRequest, DeleteWorkflowResponse, GetWorkflowRequest, GetWorkflowResponse, ListWorkflowsRequest, ListWorkflowsResponse, QueryWorkflowsRequest, QueryWorkflowsResponse, SetupWorkflowRequest, SetupWorkflowResponse, UpdateWorkflowRequest, UpdateWorkflowResponse } from './workflows-v1-workflow.types';
|
|
3
|
+
/**
|
|
4
|
+
* Retrieves a list of the site's workflows.
|
|
5
|
+
*
|
|
6
|
+
* By default,
|
|
7
|
+
* the returned workflows are sorted by `name` in ascending order.
|
|
8
|
+
* Sorting is applied lexicographically,
|
|
9
|
+
* so `"abc"` comes after `"XYZ"`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function listWorkflows(payload: ListWorkflowsRequest): RequestOptionsFactory<ListWorkflowsResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* Returns a list of workflows according to:
|
|
14
|
+
* * paging: offset, limit
|
|
15
|
+
* * order: by some of the following fields: id, name, createdAt
|
|
16
|
+
* * filter: by the following fields of WorkflowInfo
|
|
17
|
+
* ** workflowInfo.id - Guid
|
|
18
|
+
* ** workflowInfo.name - Text
|
|
19
|
+
* ** workflowInfo.createdAt - Date
|
|
20
|
+
* ** workflowInfo.visibility - Text (Visible / Archived)
|
|
21
|
+
* ** workflowInfo.winPhaseId - Guid
|
|
22
|
+
*/
|
|
23
|
+
export declare function queryWorkflows(payload: QueryWorkflowsRequest): RequestOptionsFactory<QueryWorkflowsResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves a workflow by ID.
|
|
26
|
+
*
|
|
27
|
+
* Use this endpoint to list all phases and the first cards for each phase.
|
|
28
|
+
*
|
|
29
|
+
* The returned workflow object contains all the active phases and the win phase.
|
|
30
|
+
* The active phases are available in the `phasesList.phases` array,
|
|
31
|
+
* and the win phase is available at `winPhase`.
|
|
32
|
+
* Each phase's ID is in the phase object at `info.id`.
|
|
33
|
+
* The phase ID is needed when
|
|
34
|
+
* [moving](https://dev.wix.com/api/rest/workflows/workflows/cards/move-card)
|
|
35
|
+
* or [restoring](https://dev.wix.com/api/rest/workflows/workflows/cards/restore-card)
|
|
36
|
+
* a card.
|
|
37
|
+
*
|
|
38
|
+
* By default, the workflow is returned with up to 10 cards per phase.
|
|
39
|
+
* You can change the number of cards returned
|
|
40
|
+
* with the `cardsInitialPageSize` parameter.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getWorkflow(payload: GetWorkflowRequest): RequestOptionsFactory<GetWorkflowResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* Updates a workflow's name or description.
|
|
45
|
+
*
|
|
46
|
+
* To rename or reorder phases or cards, use the
|
|
47
|
+
* [Phases API](https://dev.wix.com/api/rest/workflows/workflows/phases)
|
|
48
|
+
* or the
|
|
49
|
+
* [Cards API](https://dev.wix.com/api/rest/workflows/workflows/cards),
|
|
50
|
+
* respectively.
|
|
51
|
+
*/
|
|
52
|
+
export declare function updateWorkflow(payload: UpdateWorkflowRequest): RequestOptionsFactory<UpdateWorkflowResponse>;
|
|
53
|
+
/**
|
|
54
|
+
* Creates a new workflow.
|
|
55
|
+
*
|
|
56
|
+
* When creating a workflow, you provide a `name` and optional `description`,
|
|
57
|
+
* and the new workflow's `id` is returned.
|
|
58
|
+
* By default, the new workflow contains a `winPhase` named "Win".
|
|
59
|
+
* No other phases or cards are created.
|
|
60
|
+
*
|
|
61
|
+
* To continue building the workflow,
|
|
62
|
+
* use the returned workflow `id` to
|
|
63
|
+
* [create phases](https://dev.wix.com/api/rest/workflows/workflows/phases/create-phase)
|
|
64
|
+
* and [add cards](https://dev.wix.com/api/rest/drafts/workflows/cards/create-card)
|
|
65
|
+
* to the new phases.
|
|
66
|
+
*
|
|
67
|
+
* A site can have up to 30 workflows.
|
|
68
|
+
* When this limit is reached, calls to this endpoint result in a 403 error.
|
|
69
|
+
*/
|
|
70
|
+
export declare function createWorkflow(payload: CreateWorkflowRequest): RequestOptionsFactory<CreateWorkflowResponse>;
|
|
71
|
+
/** Deletes a workflow and its phases and cards. */
|
|
72
|
+
export declare function deleteWorkflow(payload: DeleteWorkflowRequest): RequestOptionsFactory<DeleteWorkflowResponse>;
|
|
73
|
+
/** Sets up the default workflow. */
|
|
74
|
+
export declare function setupWorkflow(payload: SetupWorkflowRequest): RequestOptionsFactory<SetupWorkflowResponse>;
|