@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.
Files changed (79) hide show
  1. package/build/cjs/index.d.ts +3 -0
  2. package/build/cjs/index.js +26 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/src/workflows-v1-card.http.d.ts +92 -0
  5. package/build/cjs/src/workflows-v1-card.http.js +339 -0
  6. package/build/cjs/src/workflows-v1-card.http.js.map +1 -0
  7. package/build/cjs/src/workflows-v1-card.public.d.ts +15 -0
  8. package/build/cjs/src/workflows-v1-card.public.js +57 -0
  9. package/build/cjs/src/workflows-v1-card.public.js.map +1 -0
  10. package/build/cjs/src/workflows-v1-card.types.d.ts +240 -0
  11. package/build/cjs/src/workflows-v1-card.types.js +14 -0
  12. package/build/cjs/src/workflows-v1-card.types.js.map +1 -0
  13. package/build/cjs/src/workflows-v1-card.universal.d.ts +449 -0
  14. package/build/cjs/src/workflows-v1-card.universal.js +569 -0
  15. package/build/cjs/src/workflows-v1-card.universal.js.map +1 -0
  16. package/build/cjs/src/workflows-v1-phase.http.d.ts +61 -0
  17. package/build/cjs/src/workflows-v1-phase.http.js +288 -0
  18. package/build/cjs/src/workflows-v1-phase.http.js.map +1 -0
  19. package/build/cjs/src/workflows-v1-phase.public.d.ts +14 -0
  20. package/build/cjs/src/workflows-v1-phase.public.js +51 -0
  21. package/build/cjs/src/workflows-v1-phase.public.js.map +1 -0
  22. package/build/cjs/src/workflows-v1-phase.types.d.ts +234 -0
  23. package/build/cjs/src/workflows-v1-phase.types.js +14 -0
  24. package/build/cjs/src/workflows-v1-phase.types.js.map +1 -0
  25. package/build/cjs/src/workflows-v1-phase.universal.d.ts +388 -0
  26. package/build/cjs/src/workflows-v1-phase.universal.js +488 -0
  27. package/build/cjs/src/workflows-v1-phase.universal.js.map +1 -0
  28. package/build/cjs/src/workflows-v1-workflow.http.d.ts +74 -0
  29. package/build/cjs/src/workflows-v1-workflow.http.js +315 -0
  30. package/build/cjs/src/workflows-v1-workflow.http.js.map +1 -0
  31. package/build/cjs/src/workflows-v1-workflow.public.d.ts +14 -0
  32. package/build/cjs/src/workflows-v1-workflow.public.js +51 -0
  33. package/build/cjs/src/workflows-v1-workflow.public.js.map +1 -0
  34. package/build/cjs/src/workflows-v1-workflow.types.d.ts +273 -0
  35. package/build/cjs/src/workflows-v1-workflow.types.js +14 -0
  36. package/build/cjs/src/workflows-v1-workflow.types.js.map +1 -0
  37. package/build/cjs/src/workflows-v1-workflow.universal.d.ts +424 -0
  38. package/build/cjs/src/workflows-v1-workflow.universal.js +478 -0
  39. package/build/cjs/src/workflows-v1-workflow.universal.js.map +1 -0
  40. package/build/es/index.d.ts +3 -0
  41. package/build/es/index.js +4 -0
  42. package/build/es/index.js.map +1 -0
  43. package/build/es/src/workflows-v1-card.http.d.ts +92 -0
  44. package/build/es/src/workflows-v1-card.http.js +328 -0
  45. package/build/es/src/workflows-v1-card.http.js.map +1 -0
  46. package/build/es/src/workflows-v1-card.public.d.ts +15 -0
  47. package/build/es/src/workflows-v1-card.public.js +44 -0
  48. package/build/es/src/workflows-v1-card.public.js.map +1 -0
  49. package/build/es/src/workflows-v1-card.types.d.ts +240 -0
  50. package/build/es/src/workflows-v1-card.types.js +11 -0
  51. package/build/es/src/workflows-v1-card.types.js.map +1 -0
  52. package/build/es/src/workflows-v1-card.universal.d.ts +449 -0
  53. package/build/es/src/workflows-v1-card.universal.js +539 -0
  54. package/build/es/src/workflows-v1-card.universal.js.map +1 -0
  55. package/build/es/src/workflows-v1-phase.http.d.ts +61 -0
  56. package/build/es/src/workflows-v1-phase.http.js +278 -0
  57. package/build/es/src/workflows-v1-phase.http.js.map +1 -0
  58. package/build/es/src/workflows-v1-phase.public.d.ts +14 -0
  59. package/build/es/src/workflows-v1-phase.public.js +39 -0
  60. package/build/es/src/workflows-v1-phase.public.js.map +1 -0
  61. package/build/es/src/workflows-v1-phase.types.d.ts +234 -0
  62. package/build/es/src/workflows-v1-phase.types.js +11 -0
  63. package/build/es/src/workflows-v1-phase.types.js.map +1 -0
  64. package/build/es/src/workflows-v1-phase.universal.d.ts +388 -0
  65. package/build/es/src/workflows-v1-phase.universal.js +459 -0
  66. package/build/es/src/workflows-v1-phase.universal.js.map +1 -0
  67. package/build/es/src/workflows-v1-workflow.http.d.ts +74 -0
  68. package/build/es/src/workflows-v1-workflow.http.js +305 -0
  69. package/build/es/src/workflows-v1-workflow.http.js.map +1 -0
  70. package/build/es/src/workflows-v1-workflow.public.d.ts +14 -0
  71. package/build/es/src/workflows-v1-workflow.public.js +39 -0
  72. package/build/es/src/workflows-v1-workflow.public.js.map +1 -0
  73. package/build/es/src/workflows-v1-workflow.types.d.ts +273 -0
  74. package/build/es/src/workflows-v1-workflow.types.js +11 -0
  75. package/build/es/src/workflows-v1-workflow.types.js.map +1 -0
  76. package/build/es/src/workflows-v1-workflow.universal.d.ts +424 -0
  77. package/build/es/src/workflows-v1-workflow.universal.js +449 -0
  78. package/build/es/src/workflows-v1-workflow.universal.js.map +1 -0
  79. package/package.json +37 -0
@@ -0,0 +1,569 @@
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.restoreCard = exports.moveCard = exports.deleteCard = exports.createCard = exports.updateCard = exports.getCard = exports.listCards = exports.queryCards = exports.SortOrder = exports.AttachmentType = exports.__debug = void 0;
32
+ const velo_1 = require("@wix/metro-runtime/velo");
33
+ const ambassadorWixWorkflowsV1Card = __importStar(require("./workflows-v1-card.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 _createCardRequest = {};
60
+ const _createCardResponse = {};
61
+ const _deleteCardRequest = {};
62
+ const _deleteCardResponse = {};
63
+ const _getCardRequest = {};
64
+ const _getCardResponse = {};
65
+ const _listCardsRequest = {};
66
+ const _listCardsResponse = {};
67
+ const _moveCardRequest = {};
68
+ const _moveCardResponse = {};
69
+ const _queryCardsRequest = {};
70
+ const _queryCardsResponse = {};
71
+ const _restoreCardRequest = {};
72
+ const _restoreCardResponse = {};
73
+ const _updateCardRequest = {};
74
+ const _updateCardResponse = {};
75
+ /**
76
+ * Returns a list of cards according to:
77
+ * * paging: offset, limit
78
+ * * order: by some of the following fields: id, name, createdAt, updatedAt, position, phaseId
79
+ * * filter: by the following fields of CardInfo
80
+ * ** cardInfo.id - Guid
81
+ * ** cardInfo.name - Text
82
+ * ** cardInfo.source - Text
83
+ * ** cardInfo.position - Number
84
+ * ** cardInfo.createdAt - Date
85
+ * ** cardInfo.updatedAt - Date
86
+ * ** cardInfo.primaryAttachment.contactId - Guid
87
+ * ** cardInfo.visibility - Text (Visible / Archived)
88
+ * @public
89
+ * @documentationMaturity preview
90
+ */
91
+ function queryCards(options) {
92
+ var _a, _b, _c;
93
+ return __awaiter(this, arguments, void 0, function* () {
94
+ const requestTransformation = { query: '$[0].query' };
95
+ const responseTransformation = '$';
96
+ // @ts-ignore
97
+ const { httpClient, sideEffects } = arguments[1];
98
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
99
+ rootSchema: _queryCardsRequest,
100
+ depSchemas: {},
101
+ fqdnTransformation: {
102
+ paths: [],
103
+ transformation: _fromVeloEntity,
104
+ },
105
+ customTransformation: requestTransformation,
106
+ });
107
+ const { fromJSON } = (0, velo_1.serializer)({
108
+ rootSchema: _queryCardsResponse,
109
+ depSchemas: {},
110
+ fqdnTransformation: {
111
+ paths: [...['Array#cards']],
112
+ transformation: _toVeloEntity,
113
+ },
114
+ customTransformation: responseTransformation,
115
+ });
116
+ const payload = toAmbassadorRequest([options]);
117
+ const reqOpts = ambassadorWixWorkflowsV1Card.queryCards(payload);
118
+ __log(`"QueryCards" sending request with: ${__inspect(reqOpts)}`);
119
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
120
+ try {
121
+ const result = yield httpClient.request(reqOpts);
122
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
123
+ return fromJSON(result.data);
124
+ }
125
+ catch (err) {
126
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
127
+ 'options',
128
+ ]);
129
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
130
+ throw transformedError;
131
+ }
132
+ });
133
+ }
134
+ exports.queryCards = queryCards;
135
+ /**
136
+ * Retrieves a list of cards in the specified workflow.
137
+ *
138
+ * By default, the returned cards are sorted by their display order.
139
+ * @param workflowId - ID of the workflow whose cards will be listed.
140
+ * @public
141
+ * @documentationMaturity preview
142
+ * @requiredField workflowId
143
+ */
144
+ function listCards(workflowId, options) {
145
+ var _a, _b, _c;
146
+ return __awaiter(this, arguments, void 0, function* () {
147
+ const requestTransformation = {
148
+ workflowId: '$[0]',
149
+ phaseId: '$[1].phaseId',
150
+ limit: '$[1].limit',
151
+ offset: '$[1].offset',
152
+ attachmentValue: '$[1].attachmentValue',
153
+ fetchArchived: '$[1].fetchArchived',
154
+ sort: '$[1].sort',
155
+ };
156
+ const responseTransformation = '$';
157
+ // @ts-ignore
158
+ const { httpClient, sideEffects } = arguments[2];
159
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
160
+ rootSchema: _listCardsRequest,
161
+ depSchemas: {},
162
+ fqdnTransformation: {
163
+ paths: [],
164
+ transformation: _fromVeloEntity,
165
+ },
166
+ customTransformation: requestTransformation,
167
+ });
168
+ const { fromJSON } = (0, velo_1.serializer)({
169
+ rootSchema: _listCardsResponse,
170
+ depSchemas: {},
171
+ fqdnTransformation: {
172
+ paths: [...['Array#cards']],
173
+ transformation: _toVeloEntity,
174
+ },
175
+ customTransformation: responseTransformation,
176
+ });
177
+ const payload = toAmbassadorRequest([workflowId, options]);
178
+ const reqOpts = ambassadorWixWorkflowsV1Card.listCards(payload);
179
+ __log(`"ListCards" sending request with: ${__inspect(reqOpts)}`);
180
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
181
+ try {
182
+ const result = yield httpClient.request(reqOpts);
183
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
184
+ return fromJSON(result.data);
185
+ }
186
+ catch (err) {
187
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
188
+ 'workflowId',
189
+ 'options',
190
+ ]);
191
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
192
+ throw transformedError;
193
+ }
194
+ });
195
+ }
196
+ exports.listCards = listCards;
197
+ /**
198
+ * Retrieves a card.
199
+ *
200
+ * If the specified card is archived, an empty object is returned.
201
+ * You can restore the card with
202
+ * [Restore Card](https://dev.wix.com/api/rest/workflows/workflows/cards/restore-card).
203
+ * @param _id - ID of the card to retrieve.
204
+ * @public
205
+ * @documentationMaturity preview
206
+ * @requiredField _id
207
+ */
208
+ function getCard(_id) {
209
+ var _a, _b, _c;
210
+ return __awaiter(this, arguments, void 0, function* () {
211
+ const requestTransformation = { id: '$[0]' };
212
+ const responseTransformation = '$';
213
+ // @ts-ignore
214
+ const { httpClient, sideEffects } = arguments[1];
215
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
216
+ rootSchema: _getCardRequest,
217
+ depSchemas: {},
218
+ fqdnTransformation: {
219
+ paths: [],
220
+ transformation: _fromVeloEntity,
221
+ },
222
+ customTransformation: requestTransformation,
223
+ });
224
+ const { fromJSON } = (0, velo_1.serializer)({
225
+ rootSchema: _getCardResponse,
226
+ depSchemas: {},
227
+ fqdnTransformation: {
228
+ paths: [...['card']],
229
+ transformation: _toVeloEntity,
230
+ },
231
+ customTransformation: responseTransformation,
232
+ });
233
+ const payload = toAmbassadorRequest([_id]);
234
+ const reqOpts = ambassadorWixWorkflowsV1Card.getCard(payload);
235
+ __log(`"GetCard" sending request with: ${__inspect(reqOpts)}`);
236
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
237
+ try {
238
+ const result = yield httpClient.request(reqOpts);
239
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
240
+ return fromJSON(result.data);
241
+ }
242
+ catch (err) {
243
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
244
+ '_id',
245
+ ]);
246
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
247
+ throw transformedError;
248
+ }
249
+ });
250
+ }
251
+ exports.getCard = getCard;
252
+ /**
253
+ * Updates a card's properties.
254
+ *
255
+ * To reorder cards, use
256
+ * [Move Card](https://dev.wix.com/api/rest/workflows/workflows/cards/move-card).
257
+ * To archive or restore a card, use
258
+ * [Archive Card](https://dev.wix.com/api/rest/workflows/workflows/cards/archive-card)
259
+ * or [Restore Card](https://dev.wix.com/api/rest/workflows/workflows/cards/restore-card),
260
+ * respectively.
261
+ * @param _id - ID of the card to update.
262
+ * @public
263
+ * @documentationMaturity preview
264
+ * @requiredField _id
265
+ */
266
+ function updateCard(_id, options) {
267
+ var _a, _b, _c;
268
+ return __awaiter(this, arguments, void 0, function* () {
269
+ const requestTransformation = { id: '$[0]', cardInfo: '$[1].cardInfo' };
270
+ const responseTransformation = '$';
271
+ // @ts-ignore
272
+ const { httpClient, sideEffects } = arguments[2];
273
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
274
+ rootSchema: _updateCardRequest,
275
+ depSchemas: {},
276
+ fqdnTransformation: {
277
+ paths: [],
278
+ transformation: _fromVeloEntity,
279
+ },
280
+ customTransformation: requestTransformation,
281
+ });
282
+ const { fromJSON } = (0, velo_1.serializer)({
283
+ rootSchema: _updateCardResponse,
284
+ depSchemas: {},
285
+ fqdnTransformation: {
286
+ paths: [],
287
+ transformation: _toVeloEntity,
288
+ },
289
+ customTransformation: responseTransformation,
290
+ });
291
+ const payload = toAmbassadorRequest([_id, options]);
292
+ const reqOpts = ambassadorWixWorkflowsV1Card.updateCard(payload);
293
+ __log(`"UpdateCard" sending request with: ${__inspect(reqOpts)}`);
294
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
295
+ try {
296
+ const result = yield httpClient.request(reqOpts);
297
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
298
+ return fromJSON(result.data);
299
+ }
300
+ catch (err) {
301
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
302
+ '_id',
303
+ 'options',
304
+ ]);
305
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
306
+ throw transformedError;
307
+ }
308
+ });
309
+ }
310
+ exports.updateCard = updateCard;
311
+ /**
312
+ * Creates a new card in the specified phase and workflow.
313
+ *
314
+ * When creating a card, you provide a `name` and an optional `position`.
315
+ *
316
+ * Cards are displayed according to their position from top to bottom,
317
+ * starting from `0` and incrementing by 1.
318
+ * If you create or move a card to an existing position,
319
+ * the card in that position and any subsequent cards
320
+ * are shifted down by 1.
321
+ *
322
+ * If `position` is not specified,
323
+ * the new card is given the bottom position.
324
+ * @public
325
+ * @documentationMaturity preview
326
+ * @requiredField identifiers
327
+ * @requiredField identifiers.phaseId
328
+ * @requiredField identifiers.workflowId
329
+ */
330
+ function createCard(identifiers, options) {
331
+ var _a, _b, _c;
332
+ return __awaiter(this, arguments, void 0, function* () {
333
+ const requestTransformation = {
334
+ workflowId: '$[0].workflowId',
335
+ phaseId: '$[0].phaseId',
336
+ card: '$[1].card',
337
+ position: '$[1].position',
338
+ };
339
+ const responseTransformation = '$';
340
+ // @ts-ignore
341
+ const { httpClient, sideEffects } = arguments[2];
342
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
343
+ rootSchema: _createCardRequest,
344
+ depSchemas: {},
345
+ fqdnTransformation: {
346
+ paths: [],
347
+ transformation: _fromVeloEntity,
348
+ },
349
+ customTransformation: requestTransformation,
350
+ });
351
+ const { fromJSON } = (0, velo_1.serializer)({
352
+ rootSchema: _createCardResponse,
353
+ depSchemas: {},
354
+ fqdnTransformation: {
355
+ paths: [],
356
+ transformation: _toVeloEntity,
357
+ },
358
+ customTransformation: responseTransformation,
359
+ });
360
+ const payload = toAmbassadorRequest([identifiers, options]);
361
+ const reqOpts = ambassadorWixWorkflowsV1Card.createCard(payload);
362
+ __log(`"CreateCard" sending request with: ${__inspect(reqOpts)}`);
363
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
364
+ try {
365
+ const result = yield httpClient.request(reqOpts);
366
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
367
+ return fromJSON(result.data);
368
+ }
369
+ catch (err) {
370
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
371
+ 'identifiers',
372
+ 'options',
373
+ ]);
374
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
375
+ throw transformedError;
376
+ }
377
+ });
378
+ }
379
+ exports.createCard = createCard;
380
+ /**
381
+ * Deletes a card from a workflow.
382
+ *
383
+ * Deleted cards are removed from the workflow completely and can't be restored.
384
+ * To keep the card available for site contributors, use
385
+ * [Archive Card](https://dev.wix.com/api/rest/workflows/workflows/cards/archive-card)
386
+ * instead.
387
+ *
388
+ * After a card is deleted,
389
+ * its attached contact can be attached to another card in an active phase.
390
+ * @param _id - ID of the card to delete.
391
+ * @public
392
+ * @documentationMaturity preview
393
+ * @requiredField _id
394
+ */
395
+ function deleteCard(_id) {
396
+ var _a, _b, _c;
397
+ return __awaiter(this, arguments, void 0, function* () {
398
+ const requestTransformation = { id: '$[0]' };
399
+ const responseTransformation = '$';
400
+ // @ts-ignore
401
+ const { httpClient, sideEffects } = arguments[1];
402
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
403
+ rootSchema: _deleteCardRequest,
404
+ depSchemas: {},
405
+ fqdnTransformation: {
406
+ paths: [],
407
+ transformation: _fromVeloEntity,
408
+ },
409
+ customTransformation: requestTransformation,
410
+ });
411
+ const { fromJSON } = (0, velo_1.serializer)({
412
+ rootSchema: _deleteCardResponse,
413
+ depSchemas: {},
414
+ fqdnTransformation: {
415
+ paths: [],
416
+ transformation: _toVeloEntity,
417
+ },
418
+ customTransformation: responseTransformation,
419
+ });
420
+ const payload = toAmbassadorRequest([_id]);
421
+ const reqOpts = ambassadorWixWorkflowsV1Card.deleteCard(payload);
422
+ __log(`"DeleteCard" sending request with: ${__inspect(reqOpts)}`);
423
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
424
+ try {
425
+ const result = yield httpClient.request(reqOpts);
426
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
427
+ return fromJSON(result.data);
428
+ }
429
+ catch (err) {
430
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
431
+ '_id',
432
+ ]);
433
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
434
+ throw transformedError;
435
+ }
436
+ });
437
+ }
438
+ exports.deleteCard = deleteCard;
439
+ /**
440
+ * Moves a card to another phase or a new position within the current phase.
441
+ *
442
+ * To move a card, the new phase ID must be provided.
443
+ * You can use
444
+ * [Get Workflow](https://dev.wix.com/api/rest/workflows/workflows/workflows/get-workflow)
445
+ * to get IDs for all the phases in the workflow,
446
+ * including the win phase.
447
+ *
448
+ * If a card is moved to the win phase,
449
+ * its attached contact can be attached to another card in an active phase.
450
+ * @param _id - ID of the card to move.
451
+ * @public
452
+ * @documentationMaturity preview
453
+ * @requiredField _id
454
+ */
455
+ function moveCard(_id, options) {
456
+ var _a, _b, _c;
457
+ return __awaiter(this, arguments, void 0, function* () {
458
+ const requestTransformation = {
459
+ id: '$[0]',
460
+ newPhaseId: '$[1].newPhaseId',
461
+ newPosition: '$[1].newPosition',
462
+ };
463
+ const responseTransformation = '$';
464
+ // @ts-ignore
465
+ const { httpClient, sideEffects } = arguments[2];
466
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
467
+ rootSchema: _moveCardRequest,
468
+ depSchemas: {},
469
+ fqdnTransformation: {
470
+ paths: [],
471
+ transformation: _fromVeloEntity,
472
+ },
473
+ customTransformation: requestTransformation,
474
+ });
475
+ const { fromJSON } = (0, velo_1.serializer)({
476
+ rootSchema: _moveCardResponse,
477
+ depSchemas: {},
478
+ fqdnTransformation: {
479
+ paths: [],
480
+ transformation: _toVeloEntity,
481
+ },
482
+ customTransformation: responseTransformation,
483
+ });
484
+ const payload = toAmbassadorRequest([_id, options]);
485
+ const reqOpts = ambassadorWixWorkflowsV1Card.moveCard(payload);
486
+ __log(`"MoveCard" sending request with: ${__inspect(reqOpts)}`);
487
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
488
+ try {
489
+ const result = yield httpClient.request(reqOpts);
490
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
491
+ return fromJSON(result.data);
492
+ }
493
+ catch (err) {
494
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
495
+ '_id',
496
+ 'options',
497
+ ]);
498
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
499
+ throw transformedError;
500
+ }
501
+ });
502
+ }
503
+ exports.moveCard = moveCard;
504
+ /**
505
+ * Restores an archived card to the specified phase.
506
+ *
507
+ * To restore a card, the new phase ID must be provided.
508
+ * You can use
509
+ * [Get Workflow](https://dev.wix.com/api/rest/workflows/workflows/workflows/get-workflow)
510
+ * to get IDs for all the phases in the workflow,
511
+ * including the win phase.
512
+ * @param _id - ID of the card to restore.
513
+ * @param newPhaseId - ID of the phase to restore the card to.
514
+ * @public
515
+ * @documentationMaturity preview
516
+ * @requiredField _id
517
+ * @requiredField newPhaseId
518
+ */
519
+ function restoreCard(_id, newPhaseId, options) {
520
+ var _a, _b, _c;
521
+ return __awaiter(this, arguments, void 0, function* () {
522
+ const requestTransformation = {
523
+ id: '$[0]',
524
+ newPhaseId: '$[1]',
525
+ newPosition: '$[2].newPosition',
526
+ };
527
+ const responseTransformation = '$';
528
+ // @ts-ignore
529
+ const { httpClient, sideEffects } = arguments[3];
530
+ const { toAmbassadorRequest } = (0, velo_1.serializer)({
531
+ rootSchema: _restoreCardRequest,
532
+ depSchemas: {},
533
+ fqdnTransformation: {
534
+ paths: [],
535
+ transformation: _fromVeloEntity,
536
+ },
537
+ customTransformation: requestTransformation,
538
+ });
539
+ const { fromJSON } = (0, velo_1.serializer)({
540
+ rootSchema: _restoreCardResponse,
541
+ depSchemas: {},
542
+ fqdnTransformation: {
543
+ paths: [],
544
+ transformation: _toVeloEntity,
545
+ },
546
+ customTransformation: responseTransformation,
547
+ });
548
+ const payload = toAmbassadorRequest([_id, newPhaseId, options]);
549
+ const reqOpts = ambassadorWixWorkflowsV1Card.restoreCard(payload);
550
+ __log(`"RestoreCard" sending request with: ${__inspect(reqOpts)}`);
551
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
552
+ try {
553
+ const result = yield httpClient.request(reqOpts);
554
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
555
+ return fromJSON(result.data);
556
+ }
557
+ catch (err) {
558
+ const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
559
+ '_id',
560
+ 'newPhaseId',
561
+ 'options',
562
+ ]);
563
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
564
+ throw transformedError;
565
+ }
566
+ });
567
+ }
568
+ exports.restoreCard = restoreCard;
569
+ //# sourceMappingURL=workflows-v1-card.universal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows-v1-card.universal.js","sourceRoot":"","sources":["../../../src/workflows-v1-card.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAqE;AAErE,uFAAyE;AAEzE,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,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;QAC5B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;KAC/B;CACF,CAAC;AACF,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;AAiE5B,+GAA+G;AAC/G,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,6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,CAAC,CAAC;YACH,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,+CAApB,WAAW,EAAY,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;SACxB;;CACF;AA5DD,kCA4DC"}
@@ -0,0 +1,61 @@
1
+ import { RequestOptionsFactory } from '@wix/sdk-types';
2
+ import { CreatePhaseRequest, CreatePhaseResponse, DeletePhaseRequest, DeletePhaseResponse, GetPhaseRequest, GetPhaseResponse, ListPhasesRequest, ListPhasesResponse, MovePhaseRequest, MovePhaseResponse, QueryPhasesRequest, QueryPhasesResponse, UpdatePhaseRequest, UpdatePhaseResponse } from './workflows-v1-phase.types';
3
+ /**
4
+ * Returns a list of phases according to:
5
+ * * paging: offset, limit
6
+ * * order: by some of the following fields: id, name, position
7
+ * * filter: by the following fields of PhaseInfo
8
+ * ** phaseInfo.id - Guid
9
+ * ** phaseInfo.name - Text
10
+ * ** phaseInfo.visibility - Text (Visible / Archived)
11
+ */
12
+ export declare function queryPhases(payload: QueryPhasesRequest): RequestOptionsFactory<QueryPhasesResponse>;
13
+ /**
14
+ * Retrieves a list of active phases in the specified workflow.
15
+ *
16
+ * By default, the returned phases are sorted by their display order.
17
+ *
18
+ * The win phase is not an active phase
19
+ * and is therefore not returned with this endpoint.
20
+ * To get the win phase ID, use
21
+ * [Get Workflow](https://dev.wix.com/api/rest/workflows/workflows/workflows/get-workflow?branch=workflows).
22
+ */
23
+ export declare function listPhases(payload: ListPhasesRequest): RequestOptionsFactory<ListPhasesResponse>;
24
+ /** Retrieves a phase and its cards. */
25
+ export declare function getPhase(payload: GetPhaseRequest): RequestOptionsFactory<GetPhaseResponse>;
26
+ /**
27
+ * Updates a phase's name.
28
+ *
29
+ * To reorder phases, use
30
+ * [Move Phase](https://dev.wix.com/api/rest/workflows/workflows/phases/move-phase).
31
+ * To reorder or rename cards, use the
32
+ * [Cards API](https://dev.wix.com/api/rest/workflows/workflows/cards).
33
+ */
34
+ export declare function updatePhase(payload: UpdatePhaseRequest): RequestOptionsFactory<UpdatePhaseResponse>;
35
+ /**
36
+ * Creates a new phase in the specified workflow.
37
+ *
38
+ * When creating a phase, you provide a `name` and an optional `position`.
39
+ *
40
+ * Phases are displayed according to their position from left to right,
41
+ * starting from `0` and incrementing by 1.
42
+ * If you create or move a phase to an existing position,
43
+ * the phase in that position and any subsequent phases
44
+ * are shifted to the right by 1.
45
+ *
46
+ * If `position` is not specified,
47
+ * the new phase is given the rightmost position.
48
+ */
49
+ export declare function createPhase(payload: CreatePhaseRequest): RequestOptionsFactory<CreatePhaseResponse>;
50
+ /** Deletes a phase and its cards. */
51
+ export declare function deletePhase(payload: DeletePhaseRequest): RequestOptionsFactory<DeletePhaseResponse>;
52
+ /**
53
+ * Moves a phase to a new position in its workflow.
54
+ *
55
+ * Phases are displayed according to their position from left to right,
56
+ * starting from `0` and incrementing by 1.
57
+ * If you create or move a phase to an existing position,
58
+ * the phase in that position and any subsequent phases
59
+ * are shifted to the right by 1.
60
+ */
61
+ export declare function movePhase(payload: MovePhaseRequest): RequestOptionsFactory<MovePhaseResponse>;