@wix/auto_sdk_automations_automations-v-2 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/automations-v2-automation-automations-v-2.context.d.ts +37 -0
- package/build/cjs/src/automations-v2-automation-automations-v-2.context.js +60 -0
- package/build/cjs/src/automations-v2-automation-automations-v-2.context.js.map +1 -0
- package/build/cjs/src/automations-v2-automation-automations-v-2.http.d.ts +74 -0
- package/build/cjs/src/automations-v2-automation-automations-v-2.http.js +666 -0
- package/build/cjs/src/automations-v2-automation-automations-v-2.http.js.map +1 -0
- package/build/cjs/src/automations-v2-automation-automations-v-2.meta.d.ts +49 -0
- package/build/cjs/src/automations-v2-automation-automations-v-2.meta.js +351 -0
- package/build/cjs/src/automations-v2-automation-automations-v-2.meta.js.map +1 -0
- package/build/cjs/src/automations-v2-automation-automations-v-2.public.d.ts +172 -0
- package/build/cjs/src/automations-v2-automation-automations-v-2.public.js +166 -0
- package/build/cjs/src/automations-v2-automation-automations-v-2.public.js.map +1 -0
- package/build/cjs/src/automations-v2-automation-automations-v-2.types.d.ts +2153 -0
- package/build/cjs/src/automations-v2-automation-automations-v-2.types.js +268 -0
- package/build/cjs/src/automations-v2-automation-automations-v-2.types.js.map +1 -0
- package/build/cjs/src/automations-v2-automation-automations-v-2.universal.d.ts +2804 -0
- package/build/cjs/src/automations-v2-automation-automations-v-2.universal.js +1015 -0
- package/build/cjs/src/automations-v2-automation-automations-v-2.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/automations-v2-automation-automations-v-2.context.d.ts +37 -0
- package/build/es/src/automations-v2-automation-automations-v-2.context.js +37 -0
- package/build/es/src/automations-v2-automation-automations-v-2.context.js.map +1 -0
- package/build/es/src/automations-v2-automation-automations-v-2.http.d.ts +74 -0
- package/build/es/src/automations-v2-automation-automations-v-2.http.js +646 -0
- package/build/es/src/automations-v2-automation-automations-v-2.http.js.map +1 -0
- package/build/es/src/automations-v2-automation-automations-v-2.meta.d.ts +49 -0
- package/build/es/src/automations-v2-automation-automations-v-2.meta.js +308 -0
- package/build/es/src/automations-v2-automation-automations-v-2.meta.js.map +1 -0
- package/build/es/src/automations-v2-automation-automations-v-2.public.d.ts +172 -0
- package/build/es/src/automations-v2-automation-automations-v-2.public.js +126 -0
- package/build/es/src/automations-v2-automation-automations-v-2.public.js.map +1 -0
- package/build/es/src/automations-v2-automation-automations-v-2.types.d.ts +2153 -0
- package/build/es/src/automations-v2-automation-automations-v-2.types.js +265 -0
- package/build/es/src/automations-v2-automation-automations-v-2.types.js.map +1 -0
- package/build/es/src/automations-v2-automation-automations-v-2.universal.d.ts +2804 -0
- package/build/es/src/automations-v2-automation-automations-v-2.universal.js +972 -0
- package/build/es/src/automations-v2-automation-automations-v-2.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/automations-v2-automation-automations-v-2.context.d.ts +37 -0
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.context.js +60 -0
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.context.js.map +1 -0
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.http.d.ts +74 -0
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.http.js +666 -0
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.http.js.map +1 -0
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.meta.d.ts +49 -0
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.meta.js +351 -0
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.meta.js.map +1 -0
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.public.d.ts +172 -0
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.public.js +166 -0
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.public.js.map +1 -0
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.types.d.ts +2153 -0
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.types.js +268 -0
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.types.js.map +1 -0
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.universal.d.ts +2804 -0
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.universal.js +1015 -0
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.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/automations-v2-automation-automations-v-2.context.d.ts +37 -0
- package/build/internal/es/src/automations-v2-automation-automations-v-2.context.js +37 -0
- package/build/internal/es/src/automations-v2-automation-automations-v-2.context.js.map +1 -0
- package/build/internal/es/src/automations-v2-automation-automations-v-2.http.d.ts +74 -0
- package/build/internal/es/src/automations-v2-automation-automations-v-2.http.js +646 -0
- package/build/internal/es/src/automations-v2-automation-automations-v-2.http.js.map +1 -0
- package/build/internal/es/src/automations-v2-automation-automations-v-2.meta.d.ts +49 -0
- package/build/internal/es/src/automations-v2-automation-automations-v-2.meta.js +308 -0
- package/build/internal/es/src/automations-v2-automation-automations-v-2.meta.js.map +1 -0
- package/build/internal/es/src/automations-v2-automation-automations-v-2.public.d.ts +172 -0
- package/build/internal/es/src/automations-v2-automation-automations-v-2.public.js +126 -0
- package/build/internal/es/src/automations-v2-automation-automations-v-2.public.js.map +1 -0
- package/build/internal/es/src/automations-v2-automation-automations-v-2.types.d.ts +2153 -0
- package/build/internal/es/src/automations-v2-automation-automations-v-2.types.js +265 -0
- package/build/internal/es/src/automations-v2-automation-automations-v-2.types.js.map +1 -0
- package/build/internal/es/src/automations-v2-automation-automations-v-2.universal.d.ts +2804 -0
- package/build/internal/es/src/automations-v2-automation-automations-v-2.universal.js +972 -0
- package/build/internal/es/src/automations-v2-automation-automations-v-2.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,666 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAutomationRevision = exports.validateAutomationById = exports.validateAutomation = exports.publishDraftAutomation = exports.deleteDraftAutomation = exports.queryAutomationsWithDrafts = exports.updateDraftAutomation = exports.getOrCreateDraftAutomation = exports.createDraftAutomation = exports.copyAutomation = exports.queryAutomations = exports.generatePreinstalledAutomation = exports.bulkDeleteAutomations = exports.deleteAutomation = exports.updateAutomation = exports.getAutomation = exports.createAutomation = void 0;
|
|
4
|
+
const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
|
|
5
|
+
const timestamp_1 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
6
|
+
const timestamp_2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
7
|
+
const field_mask_1 = require("@wix/sdk-runtime/transformations/field-mask");
|
|
8
|
+
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
9
|
+
const rest_modules_2 = require("@wix/sdk-runtime/rest-modules");
|
|
10
|
+
function resolveWixAutomationsV2AutomationRevisionsServiceUrl(opts) {
|
|
11
|
+
const domainToMappings = {
|
|
12
|
+
'manage._base_domain_': [
|
|
13
|
+
{
|
|
14
|
+
srcPath: '/automations-service',
|
|
15
|
+
destPath: '',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
srcPath: '/_api/automations-service',
|
|
19
|
+
destPath: '/api',
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
'platform.rise.ai': [
|
|
23
|
+
{
|
|
24
|
+
srcPath: '/v2/automations',
|
|
25
|
+
destPath: '',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
'www.wixapis.com': [
|
|
29
|
+
{
|
|
30
|
+
srcPath: '/automations-service',
|
|
31
|
+
destPath: '',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
'*.dev.wix-code.com': [
|
|
35
|
+
{
|
|
36
|
+
srcPath: '/automations-service',
|
|
37
|
+
destPath: '',
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
_: [
|
|
41
|
+
{
|
|
42
|
+
srcPath: '/automations-service',
|
|
43
|
+
destPath: '',
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
48
|
+
}
|
|
49
|
+
function resolveWixAutomationsV2AutomationsServiceUrl(opts) {
|
|
50
|
+
const domainToMappings = {
|
|
51
|
+
'manage._base_domain_': [
|
|
52
|
+
{
|
|
53
|
+
srcPath: '/automations-service',
|
|
54
|
+
destPath: '',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
srcPath: '/_api/automations-service',
|
|
58
|
+
destPath: '/api',
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
'platform.rise.ai': [
|
|
62
|
+
{
|
|
63
|
+
srcPath: '/v2/automations',
|
|
64
|
+
destPath: '',
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
'www.wixapis.com': [
|
|
68
|
+
{
|
|
69
|
+
srcPath: '/automations-service',
|
|
70
|
+
destPath: '',
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
'*.dev.wix-code.com': [
|
|
74
|
+
{
|
|
75
|
+
srcPath: '/automations-service',
|
|
76
|
+
destPath: '',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
_: [
|
|
80
|
+
{
|
|
81
|
+
srcPath: '/automations-service',
|
|
82
|
+
destPath: '',
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
};
|
|
86
|
+
return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
87
|
+
}
|
|
88
|
+
const PACKAGE_NAME = '@wix/auto_sdk_automations_automations-v-2';
|
|
89
|
+
/** Creates an automation. */
|
|
90
|
+
function createAutomation(payload) {
|
|
91
|
+
function __createAutomation({ host }) {
|
|
92
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
93
|
+
{
|
|
94
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
95
|
+
paths: [
|
|
96
|
+
{ path: 'automation.createdDate' },
|
|
97
|
+
{ path: 'automation.updatedDate' },
|
|
98
|
+
{ path: 'automation.draftUpdatedDate' },
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
]);
|
|
102
|
+
const metadata = {
|
|
103
|
+
entityFqdn: 'wix.automations.v2.automation',
|
|
104
|
+
method: 'POST',
|
|
105
|
+
methodFqn: 'wix.automations.v2.AutomationsService.CreateAutomation',
|
|
106
|
+
packageName: PACKAGE_NAME,
|
|
107
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
108
|
+
protoPath: '/v2/automations',
|
|
109
|
+
data: serializedData,
|
|
110
|
+
host,
|
|
111
|
+
}),
|
|
112
|
+
data: serializedData,
|
|
113
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
114
|
+
{
|
|
115
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
116
|
+
paths: [
|
|
117
|
+
{ path: 'automation.createdDate' },
|
|
118
|
+
{ path: 'automation.updatedDate' },
|
|
119
|
+
{ path: 'automation.draftUpdatedDate' },
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
]),
|
|
123
|
+
};
|
|
124
|
+
return metadata;
|
|
125
|
+
}
|
|
126
|
+
return __createAutomation;
|
|
127
|
+
}
|
|
128
|
+
exports.createAutomation = createAutomation;
|
|
129
|
+
/** Retrieves an automation by ID. */
|
|
130
|
+
function getAutomation(payload) {
|
|
131
|
+
function __getAutomation({ host }) {
|
|
132
|
+
const metadata = {
|
|
133
|
+
entityFqdn: 'wix.automations.v2.automation',
|
|
134
|
+
method: 'GET',
|
|
135
|
+
methodFqn: 'wix.automations.v2.AutomationsService.GetAutomation',
|
|
136
|
+
packageName: PACKAGE_NAME,
|
|
137
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
138
|
+
protoPath: '/v2/automations/{automationId}',
|
|
139
|
+
data: payload,
|
|
140
|
+
host,
|
|
141
|
+
}),
|
|
142
|
+
params: (0, rest_modules_1.toURLSearchParams)(payload),
|
|
143
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
144
|
+
{
|
|
145
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
146
|
+
paths: [
|
|
147
|
+
{ path: 'automation.createdDate' },
|
|
148
|
+
{ path: 'automation.updatedDate' },
|
|
149
|
+
{ path: 'automation.draftUpdatedDate' },
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
]),
|
|
153
|
+
};
|
|
154
|
+
return metadata;
|
|
155
|
+
}
|
|
156
|
+
return __getAutomation;
|
|
157
|
+
}
|
|
158
|
+
exports.getAutomation = getAutomation;
|
|
159
|
+
/**
|
|
160
|
+
* Updates the specified automation.
|
|
161
|
+
*
|
|
162
|
+
* When an automation is updated, its `revision` property is incremented by 1. When updating an automation, you must specify the current revision number.
|
|
163
|
+
*/
|
|
164
|
+
function updateAutomation(payload) {
|
|
165
|
+
function __updateAutomation({ host }) {
|
|
166
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
167
|
+
{
|
|
168
|
+
transformFn: field_mask_1.transformSDKFieldMaskToRESTFieldMask,
|
|
169
|
+
paths: [{ path: 'fieldMask' }],
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
173
|
+
paths: [
|
|
174
|
+
{ path: 'automation.createdDate' },
|
|
175
|
+
{ path: 'automation.updatedDate' },
|
|
176
|
+
{ path: 'automation.draftUpdatedDate' },
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
]);
|
|
180
|
+
const metadata = {
|
|
181
|
+
entityFqdn: 'wix.automations.v2.automation',
|
|
182
|
+
method: 'PATCH',
|
|
183
|
+
methodFqn: 'wix.automations.v2.AutomationsService.UpdateAutomation',
|
|
184
|
+
packageName: PACKAGE_NAME,
|
|
185
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
186
|
+
protoPath: '/v2/automations/{automation.id}',
|
|
187
|
+
data: serializedData,
|
|
188
|
+
host,
|
|
189
|
+
}),
|
|
190
|
+
data: serializedData,
|
|
191
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
192
|
+
{
|
|
193
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
194
|
+
paths: [
|
|
195
|
+
{ path: 'automation.createdDate' },
|
|
196
|
+
{ path: 'automation.updatedDate' },
|
|
197
|
+
{ path: 'automation.draftUpdatedDate' },
|
|
198
|
+
],
|
|
199
|
+
},
|
|
200
|
+
]),
|
|
201
|
+
};
|
|
202
|
+
return metadata;
|
|
203
|
+
}
|
|
204
|
+
return __updateAutomation;
|
|
205
|
+
}
|
|
206
|
+
exports.updateAutomation = updateAutomation;
|
|
207
|
+
/** Deletes the specified automation. */
|
|
208
|
+
function deleteAutomation(payload) {
|
|
209
|
+
function __deleteAutomation({ host }) {
|
|
210
|
+
const metadata = {
|
|
211
|
+
entityFqdn: 'wix.automations.v2.automation',
|
|
212
|
+
method: 'DELETE',
|
|
213
|
+
methodFqn: 'wix.automations.v2.AutomationsService.DeleteAutomation',
|
|
214
|
+
packageName: PACKAGE_NAME,
|
|
215
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
216
|
+
protoPath: '/v2/automations/{automationId}',
|
|
217
|
+
data: payload,
|
|
218
|
+
host,
|
|
219
|
+
}),
|
|
220
|
+
params: (0, rest_modules_1.toURLSearchParams)(payload),
|
|
221
|
+
};
|
|
222
|
+
return metadata;
|
|
223
|
+
}
|
|
224
|
+
return __deleteAutomation;
|
|
225
|
+
}
|
|
226
|
+
exports.deleteAutomation = deleteAutomation;
|
|
227
|
+
/** Deletes one or more automations. */
|
|
228
|
+
function bulkDeleteAutomations(payload) {
|
|
229
|
+
function __bulkDeleteAutomations({ host }) {
|
|
230
|
+
const metadata = {
|
|
231
|
+
entityFqdn: 'wix.automations.v2.automation',
|
|
232
|
+
method: 'POST',
|
|
233
|
+
methodFqn: 'wix.automations.v2.AutomationsService.BulkDeleteAutomations',
|
|
234
|
+
packageName: PACKAGE_NAME,
|
|
235
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
236
|
+
protoPath: '/v2/bulk/automations/delete',
|
|
237
|
+
data: payload,
|
|
238
|
+
host,
|
|
239
|
+
}),
|
|
240
|
+
data: payload,
|
|
241
|
+
};
|
|
242
|
+
return metadata;
|
|
243
|
+
}
|
|
244
|
+
return __bulkDeleteAutomations;
|
|
245
|
+
}
|
|
246
|
+
exports.bulkDeleteAutomations = bulkDeleteAutomations;
|
|
247
|
+
/**
|
|
248
|
+
* Generates a preinstalled automation from another automation.
|
|
249
|
+
*
|
|
250
|
+
* Calls the action providers for changes needed to make a preinstalled automation, such as changes made to email template.
|
|
251
|
+
*
|
|
252
|
+
* > **Note**: You must have an account permission to edit an app.
|
|
253
|
+
*/
|
|
254
|
+
function generatePreinstalledAutomation(payload) {
|
|
255
|
+
function __generatePreinstalledAutomation({ host }) {
|
|
256
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
257
|
+
{
|
|
258
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
259
|
+
paths: [
|
|
260
|
+
{ path: 'automation.createdDate' },
|
|
261
|
+
{ path: 'automation.updatedDate' },
|
|
262
|
+
{ path: 'automation.draftUpdatedDate' },
|
|
263
|
+
],
|
|
264
|
+
},
|
|
265
|
+
]);
|
|
266
|
+
const metadata = {
|
|
267
|
+
entityFqdn: 'wix.automations.v2.automation',
|
|
268
|
+
method: 'POST',
|
|
269
|
+
methodFqn: 'wix.automations.v2.AutomationsService.GeneratePreinstalledAutomation',
|
|
270
|
+
packageName: PACKAGE_NAME,
|
|
271
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
272
|
+
protoPath: '/v2/preinstalled-automation/generate',
|
|
273
|
+
data: serializedData,
|
|
274
|
+
host,
|
|
275
|
+
}),
|
|
276
|
+
data: serializedData,
|
|
277
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
278
|
+
{
|
|
279
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
280
|
+
paths: [
|
|
281
|
+
{ path: 'automation.createdDate' },
|
|
282
|
+
{ path: 'automation.updatedDate' },
|
|
283
|
+
{ path: 'automation.draftUpdatedDate' },
|
|
284
|
+
],
|
|
285
|
+
},
|
|
286
|
+
]),
|
|
287
|
+
};
|
|
288
|
+
return metadata;
|
|
289
|
+
}
|
|
290
|
+
return __generatePreinstalledAutomation;
|
|
291
|
+
}
|
|
292
|
+
exports.generatePreinstalledAutomation = generatePreinstalledAutomation;
|
|
293
|
+
/**
|
|
294
|
+
* Retrieves a list of automations. This includes both automations overridden on a site and preinstalled automations. If a preinstalled automation has been overridden on the site, the method returns the override automation.
|
|
295
|
+
*
|
|
296
|
+
* > **Note**: The method only returns automations by apps installed on the site.
|
|
297
|
+
*
|
|
298
|
+
* Learn more about [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
|
|
299
|
+
*/
|
|
300
|
+
function queryAutomations(payload) {
|
|
301
|
+
function __queryAutomations({ host }) {
|
|
302
|
+
const metadata = {
|
|
303
|
+
entityFqdn: 'wix.automations.v2.automation',
|
|
304
|
+
method: 'POST',
|
|
305
|
+
methodFqn: 'wix.automations.v2.AutomationsService.QueryAutomations',
|
|
306
|
+
packageName: PACKAGE_NAME,
|
|
307
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
308
|
+
protoPath: '/v2/automations/query',
|
|
309
|
+
data: payload,
|
|
310
|
+
host,
|
|
311
|
+
}),
|
|
312
|
+
data: payload,
|
|
313
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
314
|
+
{
|
|
315
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
316
|
+
paths: [
|
|
317
|
+
{ path: 'automations.createdDate' },
|
|
318
|
+
{ path: 'automations.updatedDate' },
|
|
319
|
+
{ path: 'automations.draftUpdatedDate' },
|
|
320
|
+
],
|
|
321
|
+
},
|
|
322
|
+
]),
|
|
323
|
+
};
|
|
324
|
+
return metadata;
|
|
325
|
+
}
|
|
326
|
+
return __queryAutomations;
|
|
327
|
+
}
|
|
328
|
+
exports.queryAutomations = queryAutomations;
|
|
329
|
+
/**
|
|
330
|
+
* Creates a copy of an action with a new ID, and changes the action's input mapping if necessary.
|
|
331
|
+
*
|
|
332
|
+
* The action copy isn't saved automatically. To save it, the user must perform an action
|
|
333
|
+
* such as clicking the **Save** button.
|
|
334
|
+
*/
|
|
335
|
+
function copyAutomation(payload) {
|
|
336
|
+
function __copyAutomation({ host }) {
|
|
337
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
338
|
+
{
|
|
339
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
340
|
+
paths: [
|
|
341
|
+
{ path: 'automation.createdDate' },
|
|
342
|
+
{ path: 'automation.updatedDate' },
|
|
343
|
+
{ path: 'automation.draftUpdatedDate' },
|
|
344
|
+
],
|
|
345
|
+
},
|
|
346
|
+
]);
|
|
347
|
+
const metadata = {
|
|
348
|
+
entityFqdn: 'wix.automations.v2.automation',
|
|
349
|
+
method: 'POST',
|
|
350
|
+
methodFqn: 'wix.automations.v2.AutomationsService.CopyAutomation',
|
|
351
|
+
packageName: PACKAGE_NAME,
|
|
352
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
353
|
+
protoPath: '/v2/automations/{automationId}/copy',
|
|
354
|
+
data: serializedData,
|
|
355
|
+
host,
|
|
356
|
+
}),
|
|
357
|
+
data: serializedData,
|
|
358
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
359
|
+
{
|
|
360
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
361
|
+
paths: [
|
|
362
|
+
{ path: 'automation.createdDate' },
|
|
363
|
+
{ path: 'automation.updatedDate' },
|
|
364
|
+
{ path: 'automation.draftUpdatedDate' },
|
|
365
|
+
],
|
|
366
|
+
},
|
|
367
|
+
]),
|
|
368
|
+
};
|
|
369
|
+
return metadata;
|
|
370
|
+
}
|
|
371
|
+
return __copyAutomation;
|
|
372
|
+
}
|
|
373
|
+
exports.copyAutomation = copyAutomation;
|
|
374
|
+
/** Creates a draft automation. */
|
|
375
|
+
function createDraftAutomation(payload) {
|
|
376
|
+
function __createDraftAutomation({ host }) {
|
|
377
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
378
|
+
{
|
|
379
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
380
|
+
paths: [
|
|
381
|
+
{ path: 'automation.createdDate' },
|
|
382
|
+
{ path: 'automation.updatedDate' },
|
|
383
|
+
{ path: 'automation.draftUpdatedDate' },
|
|
384
|
+
],
|
|
385
|
+
},
|
|
386
|
+
]);
|
|
387
|
+
const metadata = {
|
|
388
|
+
entityFqdn: 'wix.automations.v2.automation',
|
|
389
|
+
method: 'POST',
|
|
390
|
+
methodFqn: 'wix.automations.v2.AutomationsService.CreateDraftAutomation',
|
|
391
|
+
packageName: PACKAGE_NAME,
|
|
392
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
393
|
+
protoPath: '/v2/automations/drafts',
|
|
394
|
+
data: serializedData,
|
|
395
|
+
host,
|
|
396
|
+
}),
|
|
397
|
+
data: serializedData,
|
|
398
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
399
|
+
{
|
|
400
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
401
|
+
paths: [
|
|
402
|
+
{ path: 'automation.createdDate' },
|
|
403
|
+
{ path: 'automation.updatedDate' },
|
|
404
|
+
{ path: 'automation.draftUpdatedDate' },
|
|
405
|
+
],
|
|
406
|
+
},
|
|
407
|
+
]),
|
|
408
|
+
};
|
|
409
|
+
return metadata;
|
|
410
|
+
}
|
|
411
|
+
return __createDraftAutomation;
|
|
412
|
+
}
|
|
413
|
+
exports.createDraftAutomation = createDraftAutomation;
|
|
414
|
+
/**
|
|
415
|
+
* Retrieves the draft of the specified automation. If a draft doesn't exist, the method creates one.
|
|
416
|
+
*
|
|
417
|
+
* > **Note**: If the specified automation is a draft, the method returns it.
|
|
418
|
+
*/
|
|
419
|
+
function getOrCreateDraftAutomation(payload) {
|
|
420
|
+
function __getOrCreateDraftAutomation({ host }) {
|
|
421
|
+
const metadata = {
|
|
422
|
+
entityFqdn: 'wix.automations.v2.automation',
|
|
423
|
+
method: 'POST',
|
|
424
|
+
methodFqn: 'wix.automations.v2.AutomationsService.GetOrCreateDraftAutomation',
|
|
425
|
+
packageName: PACKAGE_NAME,
|
|
426
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
427
|
+
protoPath: '/v2/automations/drafts/get-or-create/original-automation-id/{originalAutomationId}',
|
|
428
|
+
data: payload,
|
|
429
|
+
host,
|
|
430
|
+
}),
|
|
431
|
+
data: payload,
|
|
432
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
433
|
+
{
|
|
434
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
435
|
+
paths: [
|
|
436
|
+
{ path: 'automation.createdDate' },
|
|
437
|
+
{ path: 'automation.updatedDate' },
|
|
438
|
+
{ path: 'automation.draftUpdatedDate' },
|
|
439
|
+
],
|
|
440
|
+
},
|
|
441
|
+
]),
|
|
442
|
+
};
|
|
443
|
+
return metadata;
|
|
444
|
+
}
|
|
445
|
+
return __getOrCreateDraftAutomation;
|
|
446
|
+
}
|
|
447
|
+
exports.getOrCreateDraftAutomation = getOrCreateDraftAutomation;
|
|
448
|
+
/** Updates a draft automation. */
|
|
449
|
+
function updateDraftAutomation(payload) {
|
|
450
|
+
function __updateDraftAutomation({ host }) {
|
|
451
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
452
|
+
{
|
|
453
|
+
transformFn: field_mask_1.transformSDKFieldMaskToRESTFieldMask,
|
|
454
|
+
paths: [{ path: 'fieldMask' }],
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
458
|
+
paths: [
|
|
459
|
+
{ path: 'automation.createdDate' },
|
|
460
|
+
{ path: 'automation.updatedDate' },
|
|
461
|
+
{ path: 'automation.draftUpdatedDate' },
|
|
462
|
+
],
|
|
463
|
+
},
|
|
464
|
+
]);
|
|
465
|
+
const metadata = {
|
|
466
|
+
entityFqdn: 'wix.automations.v2.automation',
|
|
467
|
+
method: 'PATCH',
|
|
468
|
+
methodFqn: 'wix.automations.v2.AutomationsService.UpdateDraftAutomation',
|
|
469
|
+
packageName: PACKAGE_NAME,
|
|
470
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
471
|
+
protoPath: '/v2/automations/drafts/{automation.id}',
|
|
472
|
+
data: serializedData,
|
|
473
|
+
host,
|
|
474
|
+
}),
|
|
475
|
+
data: serializedData,
|
|
476
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
477
|
+
{
|
|
478
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
479
|
+
paths: [
|
|
480
|
+
{ path: 'automation.createdDate' },
|
|
481
|
+
{ path: 'automation.updatedDate' },
|
|
482
|
+
{ path: 'automation.draftUpdatedDate' },
|
|
483
|
+
],
|
|
484
|
+
},
|
|
485
|
+
]),
|
|
486
|
+
};
|
|
487
|
+
return metadata;
|
|
488
|
+
}
|
|
489
|
+
return __updateDraftAutomation;
|
|
490
|
+
}
|
|
491
|
+
exports.updateDraftAutomation = updateDraftAutomation;
|
|
492
|
+
/**
|
|
493
|
+
* Retrieves a list of automations, including drafts. Max query filter depth is 3.
|
|
494
|
+
*
|
|
495
|
+
* Relevant automations for the query are returned. This includes automations created on the site and pre-installed automations.
|
|
496
|
+
* If there's an existing override for a pre-installed automation, the override is returned in the query result.
|
|
497
|
+
* The query only returns automations from apps that are installed on the site.
|
|
498
|
+
*
|
|
499
|
+
* - new drafts that are not related to existing automations will be returned in the list
|
|
500
|
+
* - the response will contain a map of originalAutomationId => relatedDrafts
|
|
501
|
+
*
|
|
502
|
+
* To learn about working with _Query_ endpoints, see
|
|
503
|
+
* [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
|
|
504
|
+
* [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination),
|
|
505
|
+
* and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
|
|
506
|
+
*/
|
|
507
|
+
function queryAutomationsWithDrafts(payload) {
|
|
508
|
+
function __queryAutomationsWithDrafts({ host }) {
|
|
509
|
+
const metadata = {
|
|
510
|
+
entityFqdn: 'wix.automations.v2.automation',
|
|
511
|
+
method: 'POST',
|
|
512
|
+
methodFqn: 'wix.automations.v2.AutomationsService.QueryAutomationsWithDrafts',
|
|
513
|
+
packageName: PACKAGE_NAME,
|
|
514
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
515
|
+
protoPath: '/v2/automations/query-with-drafts',
|
|
516
|
+
data: payload,
|
|
517
|
+
host,
|
|
518
|
+
}),
|
|
519
|
+
data: payload,
|
|
520
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
521
|
+
{
|
|
522
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
523
|
+
paths: [
|
|
524
|
+
{ path: 'automations.createdDate' },
|
|
525
|
+
{ path: 'automations.updatedDate' },
|
|
526
|
+
{ path: 'automations.draftUpdatedDate' },
|
|
527
|
+
],
|
|
528
|
+
},
|
|
529
|
+
]),
|
|
530
|
+
};
|
|
531
|
+
return metadata;
|
|
532
|
+
}
|
|
533
|
+
return __queryAutomationsWithDrafts;
|
|
534
|
+
}
|
|
535
|
+
exports.queryAutomationsWithDrafts = queryAutomationsWithDrafts;
|
|
536
|
+
/** Deletes a draft automation. */
|
|
537
|
+
function deleteDraftAutomation(payload) {
|
|
538
|
+
function __deleteDraftAutomation({ host }) {
|
|
539
|
+
const metadata = {
|
|
540
|
+
entityFqdn: 'wix.automations.v2.automation',
|
|
541
|
+
method: 'DELETE',
|
|
542
|
+
methodFqn: 'wix.automations.v2.AutomationsService.DeleteDraftAutomation',
|
|
543
|
+
packageName: PACKAGE_NAME,
|
|
544
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
545
|
+
protoPath: '/v2/automations/drafts/{automationId}',
|
|
546
|
+
data: payload,
|
|
547
|
+
host,
|
|
548
|
+
}),
|
|
549
|
+
params: (0, rest_modules_1.toURLSearchParams)(payload),
|
|
550
|
+
};
|
|
551
|
+
return metadata;
|
|
552
|
+
}
|
|
553
|
+
return __deleteDraftAutomation;
|
|
554
|
+
}
|
|
555
|
+
exports.deleteDraftAutomation = deleteDraftAutomation;
|
|
556
|
+
/** Publishes a draft automation. This applies any changes to the live automation. */
|
|
557
|
+
function publishDraftAutomation(payload) {
|
|
558
|
+
function __publishDraftAutomation({ host }) {
|
|
559
|
+
const metadata = {
|
|
560
|
+
entityFqdn: 'wix.automations.v2.automation',
|
|
561
|
+
method: 'POST',
|
|
562
|
+
methodFqn: 'wix.automations.v2.AutomationsService.PublishDraftAutomation',
|
|
563
|
+
packageName: PACKAGE_NAME,
|
|
564
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
565
|
+
protoPath: '/v2/automations/drafts/{automationId}/publish',
|
|
566
|
+
data: payload,
|
|
567
|
+
host,
|
|
568
|
+
}),
|
|
569
|
+
data: payload,
|
|
570
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
571
|
+
{
|
|
572
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
573
|
+
paths: [
|
|
574
|
+
{ path: 'automation.createdDate' },
|
|
575
|
+
{ path: 'automation.updatedDate' },
|
|
576
|
+
{ path: 'automation.draftUpdatedDate' },
|
|
577
|
+
],
|
|
578
|
+
},
|
|
579
|
+
]),
|
|
580
|
+
};
|
|
581
|
+
return metadata;
|
|
582
|
+
}
|
|
583
|
+
return __publishDraftAutomation;
|
|
584
|
+
}
|
|
585
|
+
exports.publishDraftAutomation = publishDraftAutomation;
|
|
586
|
+
/** Validates the specified automation. */
|
|
587
|
+
function validateAutomation(payload) {
|
|
588
|
+
function __validateAutomation({ host }) {
|
|
589
|
+
const serializedData = (0, transform_paths_1.transformPaths)(payload, [
|
|
590
|
+
{
|
|
591
|
+
transformFn: timestamp_1.transformSDKTimestampToRESTTimestamp,
|
|
592
|
+
paths: [
|
|
593
|
+
{ path: 'automation.createdDate' },
|
|
594
|
+
{ path: 'automation.updatedDate' },
|
|
595
|
+
{ path: 'automation.draftUpdatedDate' },
|
|
596
|
+
],
|
|
597
|
+
},
|
|
598
|
+
]);
|
|
599
|
+
const metadata = {
|
|
600
|
+
entityFqdn: 'wix.automations.v2.automation',
|
|
601
|
+
method: 'POST',
|
|
602
|
+
methodFqn: 'wix.automations.v2.AutomationsService.ValidateAutomation',
|
|
603
|
+
packageName: PACKAGE_NAME,
|
|
604
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
605
|
+
protoPath: '/v2/automations/validate',
|
|
606
|
+
data: serializedData,
|
|
607
|
+
host,
|
|
608
|
+
}),
|
|
609
|
+
data: serializedData,
|
|
610
|
+
};
|
|
611
|
+
return metadata;
|
|
612
|
+
}
|
|
613
|
+
return __validateAutomation;
|
|
614
|
+
}
|
|
615
|
+
exports.validateAutomation = validateAutomation;
|
|
616
|
+
/** Validates the automation specified by ID. */
|
|
617
|
+
function validateAutomationById(payload) {
|
|
618
|
+
function __validateAutomationById({ host }) {
|
|
619
|
+
const metadata = {
|
|
620
|
+
entityFqdn: 'wix.automations.v2.automation',
|
|
621
|
+
method: 'POST',
|
|
622
|
+
methodFqn: 'wix.automations.v2.AutomationsService.ValidateAutomationById',
|
|
623
|
+
packageName: PACKAGE_NAME,
|
|
624
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
625
|
+
protoPath: '/v2/automations/{automationId}/validate',
|
|
626
|
+
data: payload,
|
|
627
|
+
host,
|
|
628
|
+
}),
|
|
629
|
+
data: payload,
|
|
630
|
+
};
|
|
631
|
+
return metadata;
|
|
632
|
+
}
|
|
633
|
+
return __validateAutomationById;
|
|
634
|
+
}
|
|
635
|
+
exports.validateAutomationById = validateAutomationById;
|
|
636
|
+
/** Gets the specified automation revision. */
|
|
637
|
+
function getAutomationRevision(payload) {
|
|
638
|
+
function __getAutomationRevision({ host }) {
|
|
639
|
+
const metadata = {
|
|
640
|
+
entityFqdn: 'wix.automations.v2.automation',
|
|
641
|
+
method: 'GET',
|
|
642
|
+
methodFqn: 'wix.automations.v2.AutomationRevisionsService.GetAutomationRevision',
|
|
643
|
+
packageName: PACKAGE_NAME,
|
|
644
|
+
url: resolveWixAutomationsV2AutomationRevisionsServiceUrl({
|
|
645
|
+
protoPath: '/v1/automation-revisions/{automationId}',
|
|
646
|
+
data: payload,
|
|
647
|
+
host,
|
|
648
|
+
}),
|
|
649
|
+
params: (0, rest_modules_1.toURLSearchParams)(payload),
|
|
650
|
+
transformResponse: (payload) => (0, transform_paths_1.transformPaths)(payload, [
|
|
651
|
+
{
|
|
652
|
+
transformFn: timestamp_2.transformRESTTimestampToSDKTimestamp,
|
|
653
|
+
paths: [
|
|
654
|
+
{ path: 'automation.createdDate' },
|
|
655
|
+
{ path: 'automation.updatedDate' },
|
|
656
|
+
{ path: 'automation.draftUpdatedDate' },
|
|
657
|
+
],
|
|
658
|
+
},
|
|
659
|
+
]),
|
|
660
|
+
};
|
|
661
|
+
return metadata;
|
|
662
|
+
}
|
|
663
|
+
return __getAutomationRevision;
|
|
664
|
+
}
|
|
665
|
+
exports.getAutomationRevision = getAutomationRevision;
|
|
666
|
+
//# sourceMappingURL=automations-v2-automation-automations-v-2.http.js.map
|