@wix/auto_sdk_automations_automations-v-2 1.0.4 → 1.0.6
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/{internal/cjs/src/automations-v2-automation-automations-v-2.universal.d.ts → cjs/automations-v2-automation-automations-v-2.universal-CUoGClWF.d.ts} +220 -567
- package/build/cjs/index.d.ts +202 -1
- package/build/cjs/index.js +1555 -15
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/meta.d.ts +1167 -1
- package/build/cjs/meta.js +960 -15
- package/build/cjs/meta.js.map +1 -1
- package/build/{cjs/src/automations-v2-automation-automations-v-2.universal.d.ts → es/automations-v2-automation-automations-v-2.universal-CUoGClWF.d.mts} +220 -567
- package/build/es/index.d.mts +202 -0
- package/build/es/index.mjs +1494 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/meta.d.mts +1167 -0
- package/build/es/meta.mjs +920 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/internal/{es/src/automations-v2-automation-automations-v-2.universal.d.ts → cjs/automations-v2-automation-automations-v-2.universal-CUoGClWF.d.ts} +220 -567
- package/build/internal/cjs/index.d.ts +202 -1
- package/build/internal/cjs/index.js +1555 -15
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +1167 -1
- package/build/internal/cjs/meta.js +960 -15
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/{es/src/automations-v2-automation-automations-v-2.universal.d.ts → internal/es/automations-v2-automation-automations-v-2.universal-CUoGClWF.d.mts} +220 -567
- package/build/internal/es/index.d.mts +202 -0
- package/build/internal/es/index.mjs +1494 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +1167 -0
- package/build/internal/es/meta.mjs +920 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/package.json +9 -8
- package/build/cjs/index.typings.d.ts +0 -1
- package/build/cjs/index.typings.js +0 -18
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/src/automations-v2-automation-automations-v-2.context.d.ts +0 -37
- package/build/cjs/src/automations-v2-automation-automations-v-2.context.js +0 -61
- package/build/cjs/src/automations-v2-automation-automations-v-2.context.js.map +0 -1
- package/build/cjs/src/automations-v2-automation-automations-v-2.http.d.ts +0 -74
- package/build/cjs/src/automations-v2-automation-automations-v-2.http.js +0 -666
- package/build/cjs/src/automations-v2-automation-automations-v-2.http.js.map +0 -1
- package/build/cjs/src/automations-v2-automation-automations-v-2.meta.d.ts +0 -49
- package/build/cjs/src/automations-v2-automation-automations-v-2.meta.js +0 -351
- package/build/cjs/src/automations-v2-automation-automations-v-2.meta.js.map +0 -1
- package/build/cjs/src/automations-v2-automation-automations-v-2.public.d.ts +0 -172
- package/build/cjs/src/automations-v2-automation-automations-v-2.public.js +0 -167
- package/build/cjs/src/automations-v2-automation-automations-v-2.public.js.map +0 -1
- package/build/cjs/src/automations-v2-automation-automations-v-2.types.d.ts +0 -2223
- package/build/cjs/src/automations-v2-automation-automations-v-2.types.js +0 -276
- package/build/cjs/src/automations-v2-automation-automations-v-2.types.js.map +0 -1
- package/build/cjs/src/automations-v2-automation-automations-v-2.universal.js +0 -1025
- package/build/cjs/src/automations-v2-automation-automations-v-2.universal.js.map +0 -1
- package/build/es/index.d.ts +0 -1
- package/build/es/index.js +0 -2
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -1
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/meta.d.ts +0 -1
- package/build/es/meta.js +0 -2
- package/build/es/meta.js.map +0 -1
- package/build/es/src/automations-v2-automation-automations-v-2.context.d.ts +0 -37
- package/build/es/src/automations-v2-automation-automations-v-2.context.js +0 -37
- package/build/es/src/automations-v2-automation-automations-v-2.context.js.map +0 -1
- package/build/es/src/automations-v2-automation-automations-v-2.http.d.ts +0 -74
- package/build/es/src/automations-v2-automation-automations-v-2.http.js +0 -646
- package/build/es/src/automations-v2-automation-automations-v-2.http.js.map +0 -1
- package/build/es/src/automations-v2-automation-automations-v-2.meta.d.ts +0 -49
- package/build/es/src/automations-v2-automation-automations-v-2.meta.js +0 -308
- package/build/es/src/automations-v2-automation-automations-v-2.meta.js.map +0 -1
- package/build/es/src/automations-v2-automation-automations-v-2.public.d.ts +0 -172
- package/build/es/src/automations-v2-automation-automations-v-2.public.js +0 -126
- package/build/es/src/automations-v2-automation-automations-v-2.public.js.map +0 -1
- package/build/es/src/automations-v2-automation-automations-v-2.types.d.ts +0 -2223
- package/build/es/src/automations-v2-automation-automations-v-2.types.js +0 -273
- package/build/es/src/automations-v2-automation-automations-v-2.types.js.map +0 -1
- package/build/es/src/automations-v2-automation-automations-v-2.universal.js +0 -982
- package/build/es/src/automations-v2-automation-automations-v-2.universal.js.map +0 -1
- package/build/internal/cjs/index.typings.d.ts +0 -1
- package/build/internal/cjs/index.typings.js +0 -18
- package/build/internal/cjs/index.typings.js.map +0 -1
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.context.d.ts +0 -37
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.context.js +0 -61
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.context.js.map +0 -1
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.http.d.ts +0 -74
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.http.js +0 -666
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.http.js.map +0 -1
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.meta.d.ts +0 -49
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.meta.js +0 -351
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.meta.js.map +0 -1
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.public.d.ts +0 -172
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.public.js +0 -167
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.public.js.map +0 -1
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.types.d.ts +0 -2223
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.types.js +0 -276
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.types.js.map +0 -1
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.universal.js +0 -1025
- package/build/internal/cjs/src/automations-v2-automation-automations-v-2.universal.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -1
- package/build/internal/es/index.js +0 -2
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -1
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/meta.d.ts +0 -1
- package/build/internal/es/meta.js +0 -2
- package/build/internal/es/meta.js.map +0 -1
- package/build/internal/es/src/automations-v2-automation-automations-v-2.context.d.ts +0 -37
- package/build/internal/es/src/automations-v2-automation-automations-v-2.context.js +0 -37
- package/build/internal/es/src/automations-v2-automation-automations-v-2.context.js.map +0 -1
- package/build/internal/es/src/automations-v2-automation-automations-v-2.http.d.ts +0 -74
- package/build/internal/es/src/automations-v2-automation-automations-v-2.http.js +0 -646
- package/build/internal/es/src/automations-v2-automation-automations-v-2.http.js.map +0 -1
- package/build/internal/es/src/automations-v2-automation-automations-v-2.meta.d.ts +0 -49
- package/build/internal/es/src/automations-v2-automation-automations-v-2.meta.js +0 -308
- package/build/internal/es/src/automations-v2-automation-automations-v-2.meta.js.map +0 -1
- package/build/internal/es/src/automations-v2-automation-automations-v-2.public.d.ts +0 -172
- package/build/internal/es/src/automations-v2-automation-automations-v-2.public.js +0 -126
- package/build/internal/es/src/automations-v2-automation-automations-v-2.public.js.map +0 -1
- package/build/internal/es/src/automations-v2-automation-automations-v-2.types.d.ts +0 -2223
- package/build/internal/es/src/automations-v2-automation-automations-v-2.types.js +0 -273
- package/build/internal/es/src/automations-v2-automation-automations-v-2.types.js.map +0 -1
- package/build/internal/es/src/automations-v2-automation-automations-v-2.universal.js +0 -982
- package/build/internal/es/src/automations-v2-automation-automations-v-2.universal.js.map +0 -1
|
@@ -0,0 +1,1494 @@
|
|
|
1
|
+
// src/automations-v2-automation-automations-v-2.public.ts
|
|
2
|
+
import { renameKeysFromRESTResponseToSDKResponse as renameKeysFromRESTResponseToSDKResponse2 } from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
3
|
+
import { transformRESTTimestampToSDKTimestamp as transformRESTTimestampToSDKTimestamp2 } from "@wix/sdk-runtime/transformations/timestamp";
|
|
4
|
+
import { transformPaths as transformPaths3 } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
5
|
+
import { EventDefinition } from "@wix/sdk-types";
|
|
6
|
+
|
|
7
|
+
// src/automations-v2-automation-automations-v-2.universal.ts
|
|
8
|
+
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
9
|
+
import { queryBuilder } from "@wix/sdk-runtime/query-builder";
|
|
10
|
+
import {
|
|
11
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
12
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
13
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
14
|
+
|
|
15
|
+
// src/automations-v2-automation-automations-v-2.http.ts
|
|
16
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
17
|
+
import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
18
|
+
import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
19
|
+
import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
|
|
20
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
21
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
22
|
+
function resolveWixAutomationsV2AutomationRevisionsServiceUrl(opts) {
|
|
23
|
+
const domainToMappings = {
|
|
24
|
+
"manage._base_domain_": [
|
|
25
|
+
{
|
|
26
|
+
srcPath: "/automations-service",
|
|
27
|
+
destPath: ""
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
srcPath: "/_api/automations-service",
|
|
31
|
+
destPath: "/api"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"platform.rise.ai": [
|
|
35
|
+
{
|
|
36
|
+
srcPath: "/v2/automations",
|
|
37
|
+
destPath: ""
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"www.wixapis.com": [
|
|
41
|
+
{
|
|
42
|
+
srcPath: "/automations-service",
|
|
43
|
+
destPath: ""
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"*.dev.wix-code.com": [
|
|
47
|
+
{
|
|
48
|
+
srcPath: "/automations-service",
|
|
49
|
+
destPath: ""
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
_: [
|
|
53
|
+
{
|
|
54
|
+
srcPath: "/automations-service",
|
|
55
|
+
destPath: ""
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
};
|
|
59
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
60
|
+
}
|
|
61
|
+
function resolveWixAutomationsV2AutomationsServiceUrl(opts) {
|
|
62
|
+
const domainToMappings = {
|
|
63
|
+
"manage._base_domain_": [
|
|
64
|
+
{
|
|
65
|
+
srcPath: "/automations-service",
|
|
66
|
+
destPath: ""
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
srcPath: "/_api/automations-service",
|
|
70
|
+
destPath: "/api"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"platform.rise.ai": [
|
|
74
|
+
{
|
|
75
|
+
srcPath: "/v2/automations",
|
|
76
|
+
destPath: ""
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"www.wixapis.com": [
|
|
80
|
+
{
|
|
81
|
+
srcPath: "/automations-service",
|
|
82
|
+
destPath: ""
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"*.dev.wix-code.com": [
|
|
86
|
+
{
|
|
87
|
+
srcPath: "/automations-service",
|
|
88
|
+
destPath: ""
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
_: [
|
|
92
|
+
{
|
|
93
|
+
srcPath: "/automations-service",
|
|
94
|
+
destPath: ""
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
};
|
|
98
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
99
|
+
}
|
|
100
|
+
var PACKAGE_NAME = "@wix/auto_sdk_automations_automations-v-2";
|
|
101
|
+
function createAutomation(payload) {
|
|
102
|
+
function __createAutomation({ host }) {
|
|
103
|
+
const serializedData = transformPaths(payload, [
|
|
104
|
+
{
|
|
105
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
106
|
+
paths: [
|
|
107
|
+
{ path: "automation.createdDate" },
|
|
108
|
+
{ path: "automation.updatedDate" },
|
|
109
|
+
{ path: "automation.draftUpdatedDate" }
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
]);
|
|
113
|
+
const metadata = {
|
|
114
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
115
|
+
method: "POST",
|
|
116
|
+
methodFqn: "wix.automations.v2.AutomationsService.CreateAutomation",
|
|
117
|
+
packageName: PACKAGE_NAME,
|
|
118
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
119
|
+
protoPath: "/v2/automations",
|
|
120
|
+
data: serializedData,
|
|
121
|
+
host
|
|
122
|
+
}),
|
|
123
|
+
data: serializedData,
|
|
124
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
125
|
+
{
|
|
126
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
127
|
+
paths: [
|
|
128
|
+
{ path: "automation.createdDate" },
|
|
129
|
+
{ path: "automation.updatedDate" },
|
|
130
|
+
{ path: "automation.draftUpdatedDate" }
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
])
|
|
134
|
+
};
|
|
135
|
+
return metadata;
|
|
136
|
+
}
|
|
137
|
+
return __createAutomation;
|
|
138
|
+
}
|
|
139
|
+
function getAutomation(payload) {
|
|
140
|
+
function __getAutomation({ host }) {
|
|
141
|
+
const metadata = {
|
|
142
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
143
|
+
method: "GET",
|
|
144
|
+
methodFqn: "wix.automations.v2.AutomationsService.GetAutomation",
|
|
145
|
+
packageName: PACKAGE_NAME,
|
|
146
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
147
|
+
protoPath: "/v2/automations/{automationId}",
|
|
148
|
+
data: payload,
|
|
149
|
+
host
|
|
150
|
+
}),
|
|
151
|
+
params: toURLSearchParams(payload),
|
|
152
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
153
|
+
{
|
|
154
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
155
|
+
paths: [
|
|
156
|
+
{ path: "automation.createdDate" },
|
|
157
|
+
{ path: "automation.updatedDate" },
|
|
158
|
+
{ path: "automation.draftUpdatedDate" }
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
])
|
|
162
|
+
};
|
|
163
|
+
return metadata;
|
|
164
|
+
}
|
|
165
|
+
return __getAutomation;
|
|
166
|
+
}
|
|
167
|
+
function updateAutomation(payload) {
|
|
168
|
+
function __updateAutomation({ host }) {
|
|
169
|
+
const serializedData = transformPaths(payload, [
|
|
170
|
+
{
|
|
171
|
+
transformFn: transformSDKFieldMaskToRESTFieldMask,
|
|
172
|
+
paths: [{ path: "fieldMask" }]
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
176
|
+
paths: [
|
|
177
|
+
{ path: "automation.createdDate" },
|
|
178
|
+
{ path: "automation.updatedDate" },
|
|
179
|
+
{ path: "automation.draftUpdatedDate" }
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
]);
|
|
183
|
+
const metadata = {
|
|
184
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
185
|
+
method: "PATCH",
|
|
186
|
+
methodFqn: "wix.automations.v2.AutomationsService.UpdateAutomation",
|
|
187
|
+
packageName: PACKAGE_NAME,
|
|
188
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
189
|
+
protoPath: "/v2/automations/{automation.id}",
|
|
190
|
+
data: serializedData,
|
|
191
|
+
host
|
|
192
|
+
}),
|
|
193
|
+
data: serializedData,
|
|
194
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
195
|
+
{
|
|
196
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
197
|
+
paths: [
|
|
198
|
+
{ path: "automation.createdDate" },
|
|
199
|
+
{ path: "automation.updatedDate" },
|
|
200
|
+
{ path: "automation.draftUpdatedDate" }
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
])
|
|
204
|
+
};
|
|
205
|
+
return metadata;
|
|
206
|
+
}
|
|
207
|
+
return __updateAutomation;
|
|
208
|
+
}
|
|
209
|
+
function deleteAutomation(payload) {
|
|
210
|
+
function __deleteAutomation({ host }) {
|
|
211
|
+
const metadata = {
|
|
212
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
213
|
+
method: "DELETE",
|
|
214
|
+
methodFqn: "wix.automations.v2.AutomationsService.DeleteAutomation",
|
|
215
|
+
packageName: PACKAGE_NAME,
|
|
216
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
217
|
+
protoPath: "/v2/automations/{automationId}",
|
|
218
|
+
data: payload,
|
|
219
|
+
host
|
|
220
|
+
}),
|
|
221
|
+
params: toURLSearchParams(payload)
|
|
222
|
+
};
|
|
223
|
+
return metadata;
|
|
224
|
+
}
|
|
225
|
+
return __deleteAutomation;
|
|
226
|
+
}
|
|
227
|
+
function bulkDeleteAutomations(payload) {
|
|
228
|
+
function __bulkDeleteAutomations({ host }) {
|
|
229
|
+
const metadata = {
|
|
230
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
231
|
+
method: "POST",
|
|
232
|
+
methodFqn: "wix.automations.v2.AutomationsService.BulkDeleteAutomations",
|
|
233
|
+
packageName: PACKAGE_NAME,
|
|
234
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
235
|
+
protoPath: "/v2/bulk/automations/delete",
|
|
236
|
+
data: payload,
|
|
237
|
+
host
|
|
238
|
+
}),
|
|
239
|
+
data: payload
|
|
240
|
+
};
|
|
241
|
+
return metadata;
|
|
242
|
+
}
|
|
243
|
+
return __bulkDeleteAutomations;
|
|
244
|
+
}
|
|
245
|
+
function generatePreinstalledAutomation(payload) {
|
|
246
|
+
function __generatePreinstalledAutomation({ host }) {
|
|
247
|
+
const serializedData = transformPaths(payload, [
|
|
248
|
+
{
|
|
249
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
250
|
+
paths: [
|
|
251
|
+
{ path: "automation.createdDate" },
|
|
252
|
+
{ path: "automation.updatedDate" },
|
|
253
|
+
{ path: "automation.draftUpdatedDate" }
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
]);
|
|
257
|
+
const metadata = {
|
|
258
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
259
|
+
method: "POST",
|
|
260
|
+
methodFqn: "wix.automations.v2.AutomationsService.GeneratePreinstalledAutomation",
|
|
261
|
+
packageName: PACKAGE_NAME,
|
|
262
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
263
|
+
protoPath: "/v2/preinstalled-automation/generate",
|
|
264
|
+
data: serializedData,
|
|
265
|
+
host
|
|
266
|
+
}),
|
|
267
|
+
data: serializedData,
|
|
268
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
269
|
+
{
|
|
270
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
271
|
+
paths: [
|
|
272
|
+
{ path: "automation.createdDate" },
|
|
273
|
+
{ path: "automation.updatedDate" },
|
|
274
|
+
{ path: "automation.draftUpdatedDate" }
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
])
|
|
278
|
+
};
|
|
279
|
+
return metadata;
|
|
280
|
+
}
|
|
281
|
+
return __generatePreinstalledAutomation;
|
|
282
|
+
}
|
|
283
|
+
function queryAutomations(payload) {
|
|
284
|
+
function __queryAutomations({ host }) {
|
|
285
|
+
const metadata = {
|
|
286
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
287
|
+
method: "POST",
|
|
288
|
+
methodFqn: "wix.automations.v2.AutomationsService.QueryAutomations",
|
|
289
|
+
packageName: PACKAGE_NAME,
|
|
290
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
291
|
+
protoPath: "/v2/automations/query",
|
|
292
|
+
data: payload,
|
|
293
|
+
host
|
|
294
|
+
}),
|
|
295
|
+
data: payload,
|
|
296
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
297
|
+
{
|
|
298
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
299
|
+
paths: [
|
|
300
|
+
{ path: "automations.createdDate" },
|
|
301
|
+
{ path: "automations.updatedDate" },
|
|
302
|
+
{ path: "automations.draftUpdatedDate" }
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
])
|
|
306
|
+
};
|
|
307
|
+
return metadata;
|
|
308
|
+
}
|
|
309
|
+
return __queryAutomations;
|
|
310
|
+
}
|
|
311
|
+
function copyAutomation(payload) {
|
|
312
|
+
function __copyAutomation({ host }) {
|
|
313
|
+
const serializedData = transformPaths(payload, [
|
|
314
|
+
{
|
|
315
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
316
|
+
paths: [
|
|
317
|
+
{ path: "automation.createdDate" },
|
|
318
|
+
{ path: "automation.updatedDate" },
|
|
319
|
+
{ path: "automation.draftUpdatedDate" }
|
|
320
|
+
]
|
|
321
|
+
}
|
|
322
|
+
]);
|
|
323
|
+
const metadata = {
|
|
324
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
325
|
+
method: "POST",
|
|
326
|
+
methodFqn: "wix.automations.v2.AutomationsService.CopyAutomation",
|
|
327
|
+
packageName: PACKAGE_NAME,
|
|
328
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
329
|
+
protoPath: "/v2/automations/{automationId}/copy",
|
|
330
|
+
data: serializedData,
|
|
331
|
+
host
|
|
332
|
+
}),
|
|
333
|
+
data: serializedData,
|
|
334
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
335
|
+
{
|
|
336
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
337
|
+
paths: [
|
|
338
|
+
{ path: "automation.createdDate" },
|
|
339
|
+
{ path: "automation.updatedDate" },
|
|
340
|
+
{ path: "automation.draftUpdatedDate" }
|
|
341
|
+
]
|
|
342
|
+
}
|
|
343
|
+
])
|
|
344
|
+
};
|
|
345
|
+
return metadata;
|
|
346
|
+
}
|
|
347
|
+
return __copyAutomation;
|
|
348
|
+
}
|
|
349
|
+
function createDraftAutomation(payload) {
|
|
350
|
+
function __createDraftAutomation({ host }) {
|
|
351
|
+
const serializedData = transformPaths(payload, [
|
|
352
|
+
{
|
|
353
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
354
|
+
paths: [
|
|
355
|
+
{ path: "automation.createdDate" },
|
|
356
|
+
{ path: "automation.updatedDate" },
|
|
357
|
+
{ path: "automation.draftUpdatedDate" }
|
|
358
|
+
]
|
|
359
|
+
}
|
|
360
|
+
]);
|
|
361
|
+
const metadata = {
|
|
362
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
363
|
+
method: "POST",
|
|
364
|
+
methodFqn: "wix.automations.v2.AutomationsService.CreateDraftAutomation",
|
|
365
|
+
packageName: PACKAGE_NAME,
|
|
366
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
367
|
+
protoPath: "/v2/automations/drafts",
|
|
368
|
+
data: serializedData,
|
|
369
|
+
host
|
|
370
|
+
}),
|
|
371
|
+
data: serializedData,
|
|
372
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
373
|
+
{
|
|
374
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
375
|
+
paths: [
|
|
376
|
+
{ path: "automation.createdDate" },
|
|
377
|
+
{ path: "automation.updatedDate" },
|
|
378
|
+
{ path: "automation.draftUpdatedDate" }
|
|
379
|
+
]
|
|
380
|
+
}
|
|
381
|
+
])
|
|
382
|
+
};
|
|
383
|
+
return metadata;
|
|
384
|
+
}
|
|
385
|
+
return __createDraftAutomation;
|
|
386
|
+
}
|
|
387
|
+
function getOrCreateDraftAutomation(payload) {
|
|
388
|
+
function __getOrCreateDraftAutomation({ host }) {
|
|
389
|
+
const metadata = {
|
|
390
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
391
|
+
method: "POST",
|
|
392
|
+
methodFqn: "wix.automations.v2.AutomationsService.GetOrCreateDraftAutomation",
|
|
393
|
+
packageName: PACKAGE_NAME,
|
|
394
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
395
|
+
protoPath: "/v2/automations/drafts/get-or-create/original-automation-id/{originalAutomationId}",
|
|
396
|
+
data: payload,
|
|
397
|
+
host
|
|
398
|
+
}),
|
|
399
|
+
data: payload,
|
|
400
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
401
|
+
{
|
|
402
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
403
|
+
paths: [
|
|
404
|
+
{ path: "automation.createdDate" },
|
|
405
|
+
{ path: "automation.updatedDate" },
|
|
406
|
+
{ path: "automation.draftUpdatedDate" }
|
|
407
|
+
]
|
|
408
|
+
}
|
|
409
|
+
])
|
|
410
|
+
};
|
|
411
|
+
return metadata;
|
|
412
|
+
}
|
|
413
|
+
return __getOrCreateDraftAutomation;
|
|
414
|
+
}
|
|
415
|
+
function updateDraftAutomation(payload) {
|
|
416
|
+
function __updateDraftAutomation({ host }) {
|
|
417
|
+
const serializedData = transformPaths(payload, [
|
|
418
|
+
{
|
|
419
|
+
transformFn: transformSDKFieldMaskToRESTFieldMask,
|
|
420
|
+
paths: [{ path: "fieldMask" }]
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
424
|
+
paths: [
|
|
425
|
+
{ path: "automation.createdDate" },
|
|
426
|
+
{ path: "automation.updatedDate" },
|
|
427
|
+
{ path: "automation.draftUpdatedDate" }
|
|
428
|
+
]
|
|
429
|
+
}
|
|
430
|
+
]);
|
|
431
|
+
const metadata = {
|
|
432
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
433
|
+
method: "PATCH",
|
|
434
|
+
methodFqn: "wix.automations.v2.AutomationsService.UpdateDraftAutomation",
|
|
435
|
+
packageName: PACKAGE_NAME,
|
|
436
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
437
|
+
protoPath: "/v2/automations/drafts/{automation.id}",
|
|
438
|
+
data: serializedData,
|
|
439
|
+
host
|
|
440
|
+
}),
|
|
441
|
+
data: serializedData,
|
|
442
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
443
|
+
{
|
|
444
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
445
|
+
paths: [
|
|
446
|
+
{ path: "automation.createdDate" },
|
|
447
|
+
{ path: "automation.updatedDate" },
|
|
448
|
+
{ path: "automation.draftUpdatedDate" }
|
|
449
|
+
]
|
|
450
|
+
}
|
|
451
|
+
])
|
|
452
|
+
};
|
|
453
|
+
return metadata;
|
|
454
|
+
}
|
|
455
|
+
return __updateDraftAutomation;
|
|
456
|
+
}
|
|
457
|
+
function queryAutomationsWithDrafts(payload) {
|
|
458
|
+
function __queryAutomationsWithDrafts({ host }) {
|
|
459
|
+
const metadata = {
|
|
460
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
461
|
+
method: "POST",
|
|
462
|
+
methodFqn: "wix.automations.v2.AutomationsService.QueryAutomationsWithDrafts",
|
|
463
|
+
packageName: PACKAGE_NAME,
|
|
464
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
465
|
+
protoPath: "/v2/automations/query-with-drafts",
|
|
466
|
+
data: payload,
|
|
467
|
+
host
|
|
468
|
+
}),
|
|
469
|
+
data: payload,
|
|
470
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
471
|
+
{
|
|
472
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
473
|
+
paths: [
|
|
474
|
+
{ path: "automations.createdDate" },
|
|
475
|
+
{ path: "automations.updatedDate" },
|
|
476
|
+
{ path: "automations.draftUpdatedDate" }
|
|
477
|
+
]
|
|
478
|
+
}
|
|
479
|
+
])
|
|
480
|
+
};
|
|
481
|
+
return metadata;
|
|
482
|
+
}
|
|
483
|
+
return __queryAutomationsWithDrafts;
|
|
484
|
+
}
|
|
485
|
+
function deleteDraftAutomation(payload) {
|
|
486
|
+
function __deleteDraftAutomation({ host }) {
|
|
487
|
+
const metadata = {
|
|
488
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
489
|
+
method: "DELETE",
|
|
490
|
+
methodFqn: "wix.automations.v2.AutomationsService.DeleteDraftAutomation",
|
|
491
|
+
packageName: PACKAGE_NAME,
|
|
492
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
493
|
+
protoPath: "/v2/automations/drafts/{automationId}",
|
|
494
|
+
data: payload,
|
|
495
|
+
host
|
|
496
|
+
}),
|
|
497
|
+
params: toURLSearchParams(payload)
|
|
498
|
+
};
|
|
499
|
+
return metadata;
|
|
500
|
+
}
|
|
501
|
+
return __deleteDraftAutomation;
|
|
502
|
+
}
|
|
503
|
+
function publishDraftAutomation(payload) {
|
|
504
|
+
function __publishDraftAutomation({ host }) {
|
|
505
|
+
const metadata = {
|
|
506
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
507
|
+
method: "POST",
|
|
508
|
+
methodFqn: "wix.automations.v2.AutomationsService.PublishDraftAutomation",
|
|
509
|
+
packageName: PACKAGE_NAME,
|
|
510
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
511
|
+
protoPath: "/v2/automations/drafts/{automationId}/publish",
|
|
512
|
+
data: payload,
|
|
513
|
+
host
|
|
514
|
+
}),
|
|
515
|
+
data: payload,
|
|
516
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
517
|
+
{
|
|
518
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
519
|
+
paths: [
|
|
520
|
+
{ path: "automation.createdDate" },
|
|
521
|
+
{ path: "automation.updatedDate" },
|
|
522
|
+
{ path: "automation.draftUpdatedDate" }
|
|
523
|
+
]
|
|
524
|
+
}
|
|
525
|
+
])
|
|
526
|
+
};
|
|
527
|
+
return metadata;
|
|
528
|
+
}
|
|
529
|
+
return __publishDraftAutomation;
|
|
530
|
+
}
|
|
531
|
+
function validateAutomation(payload) {
|
|
532
|
+
function __validateAutomation({ host }) {
|
|
533
|
+
const serializedData = transformPaths(payload, [
|
|
534
|
+
{
|
|
535
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
536
|
+
paths: [
|
|
537
|
+
{ path: "automation.createdDate" },
|
|
538
|
+
{ path: "automation.updatedDate" },
|
|
539
|
+
{ path: "automation.draftUpdatedDate" }
|
|
540
|
+
]
|
|
541
|
+
}
|
|
542
|
+
]);
|
|
543
|
+
const metadata = {
|
|
544
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
545
|
+
method: "POST",
|
|
546
|
+
methodFqn: "wix.automations.v2.AutomationsService.ValidateAutomation",
|
|
547
|
+
packageName: PACKAGE_NAME,
|
|
548
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
549
|
+
protoPath: "/v2/automations/validate",
|
|
550
|
+
data: serializedData,
|
|
551
|
+
host
|
|
552
|
+
}),
|
|
553
|
+
data: serializedData
|
|
554
|
+
};
|
|
555
|
+
return metadata;
|
|
556
|
+
}
|
|
557
|
+
return __validateAutomation;
|
|
558
|
+
}
|
|
559
|
+
function validateAutomationById(payload) {
|
|
560
|
+
function __validateAutomationById({ host }) {
|
|
561
|
+
const metadata = {
|
|
562
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
563
|
+
method: "POST",
|
|
564
|
+
methodFqn: "wix.automations.v2.AutomationsService.ValidateAutomationById",
|
|
565
|
+
packageName: PACKAGE_NAME,
|
|
566
|
+
url: resolveWixAutomationsV2AutomationsServiceUrl({
|
|
567
|
+
protoPath: "/v2/automations/{automationId}/validate",
|
|
568
|
+
data: payload,
|
|
569
|
+
host
|
|
570
|
+
}),
|
|
571
|
+
data: payload
|
|
572
|
+
};
|
|
573
|
+
return metadata;
|
|
574
|
+
}
|
|
575
|
+
return __validateAutomationById;
|
|
576
|
+
}
|
|
577
|
+
function getAutomationRevision(payload) {
|
|
578
|
+
function __getAutomationRevision({ host }) {
|
|
579
|
+
const metadata = {
|
|
580
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
581
|
+
method: "GET",
|
|
582
|
+
methodFqn: "wix.automations.v2.AutomationRevisionsService.GetAutomationRevision",
|
|
583
|
+
packageName: PACKAGE_NAME,
|
|
584
|
+
url: resolveWixAutomationsV2AutomationRevisionsServiceUrl({
|
|
585
|
+
protoPath: "/v1/automation-revisions/{automationId}",
|
|
586
|
+
data: payload,
|
|
587
|
+
host
|
|
588
|
+
}),
|
|
589
|
+
params: toURLSearchParams(payload),
|
|
590
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
591
|
+
{
|
|
592
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
593
|
+
paths: [
|
|
594
|
+
{ path: "automation.createdDate" },
|
|
595
|
+
{ path: "automation.updatedDate" },
|
|
596
|
+
{ path: "automation.draftUpdatedDate" }
|
|
597
|
+
]
|
|
598
|
+
}
|
|
599
|
+
])
|
|
600
|
+
};
|
|
601
|
+
return metadata;
|
|
602
|
+
}
|
|
603
|
+
return __getAutomationRevision;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
// src/automations-v2-automation-automations-v-2.universal.ts
|
|
607
|
+
import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
608
|
+
var Domain = /* @__PURE__ */ ((Domain2) => {
|
|
609
|
+
Domain2["USER"] = "USER";
|
|
610
|
+
Domain2["WIX"] = "WIX";
|
|
611
|
+
Domain2["WIX_ACCOUNT"] = "WIX_ACCOUNT";
|
|
612
|
+
return Domain2;
|
|
613
|
+
})(Domain || {});
|
|
614
|
+
var TimeUnit = /* @__PURE__ */ ((TimeUnit2) => {
|
|
615
|
+
TimeUnit2["UNKNOWN_TIME_UNIT"] = "UNKNOWN_TIME_UNIT";
|
|
616
|
+
TimeUnit2["MINUTES"] = "MINUTES";
|
|
617
|
+
TimeUnit2["HOURS"] = "HOURS";
|
|
618
|
+
TimeUnit2["DAYS"] = "DAYS";
|
|
619
|
+
TimeUnit2["WEEKS"] = "WEEKS";
|
|
620
|
+
TimeUnit2["MONTHS"] = "MONTHS";
|
|
621
|
+
return TimeUnit2;
|
|
622
|
+
})(TimeUnit || {});
|
|
623
|
+
var Operator = /* @__PURE__ */ ((Operator2) => {
|
|
624
|
+
Operator2["UNKNOWN_OPERATOR"] = "UNKNOWN_OPERATOR";
|
|
625
|
+
Operator2["OR"] = "OR";
|
|
626
|
+
Operator2["AND"] = "AND";
|
|
627
|
+
return Operator2;
|
|
628
|
+
})(Operator || {});
|
|
629
|
+
var Type = /* @__PURE__ */ ((Type2) => {
|
|
630
|
+
Type2["UNKNOWN_ACTION_TYPE"] = "UNKNOWN_ACTION_TYPE";
|
|
631
|
+
Type2["APP_DEFINED"] = "APP_DEFINED";
|
|
632
|
+
Type2["CONDITION"] = "CONDITION";
|
|
633
|
+
Type2["DELAY"] = "DELAY";
|
|
634
|
+
Type2["RATE_LIMIT"] = "RATE_LIMIT";
|
|
635
|
+
return Type2;
|
|
636
|
+
})(Type || {});
|
|
637
|
+
var Status = /* @__PURE__ */ ((Status2) => {
|
|
638
|
+
Status2["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
|
|
639
|
+
Status2["ACTIVE"] = "ACTIVE";
|
|
640
|
+
Status2["INACTIVE"] = "INACTIVE";
|
|
641
|
+
return Status2;
|
|
642
|
+
})(Status || {});
|
|
643
|
+
var Origin = /* @__PURE__ */ ((Origin2) => {
|
|
644
|
+
Origin2["UNKNOWN_ORIGIN"] = "UNKNOWN_ORIGIN";
|
|
645
|
+
Origin2["USER"] = "USER";
|
|
646
|
+
Origin2["APPLICATION"] = "APPLICATION";
|
|
647
|
+
Origin2["PREINSTALLED"] = "PREINSTALLED";
|
|
648
|
+
return Origin2;
|
|
649
|
+
})(Origin || {});
|
|
650
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
651
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
652
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
653
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
654
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
655
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
656
|
+
return WebhookIdentityType2;
|
|
657
|
+
})(WebhookIdentityType || {});
|
|
658
|
+
var Language = /* @__PURE__ */ ((Language2) => {
|
|
659
|
+
Language2["UNKNOWN_LANGUAGE"] = "UNKNOWN_LANGUAGE";
|
|
660
|
+
Language2["JAVASCRIPT"] = "JAVASCRIPT";
|
|
661
|
+
return Language2;
|
|
662
|
+
})(Language || {});
|
|
663
|
+
var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
|
|
664
|
+
RequestedFields2["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
|
|
665
|
+
RequestedFields2["OVERRIDE_SCHEMA"] = "OVERRIDE_SCHEMA";
|
|
666
|
+
return RequestedFields2;
|
|
667
|
+
})(RequestedFields || {});
|
|
668
|
+
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
669
|
+
SortOrder2["ASC"] = "ASC";
|
|
670
|
+
SortOrder2["DESC"] = "DESC";
|
|
671
|
+
return SortOrder2;
|
|
672
|
+
})(SortOrder || {});
|
|
673
|
+
var State = /* @__PURE__ */ ((State2) => {
|
|
674
|
+
State2["UNKNOWN"] = "UNKNOWN";
|
|
675
|
+
State2["ENABLED"] = "ENABLED";
|
|
676
|
+
State2["DISABLED"] = "DISABLED";
|
|
677
|
+
State2["PENDING"] = "PENDING";
|
|
678
|
+
State2["DEMO"] = "DEMO";
|
|
679
|
+
return State2;
|
|
680
|
+
})(State || {});
|
|
681
|
+
var SiteCreatedContext = /* @__PURE__ */ ((SiteCreatedContext2) => {
|
|
682
|
+
SiteCreatedContext2["OTHER"] = "OTHER";
|
|
683
|
+
SiteCreatedContext2["FROM_TEMPLATE"] = "FROM_TEMPLATE";
|
|
684
|
+
SiteCreatedContext2["DUPLICATE_BY_SITE_TRANSFER"] = "DUPLICATE_BY_SITE_TRANSFER";
|
|
685
|
+
SiteCreatedContext2["DUPLICATE"] = "DUPLICATE";
|
|
686
|
+
SiteCreatedContext2["OLD_SITE_TRANSFER"] = "OLD_SITE_TRANSFER";
|
|
687
|
+
SiteCreatedContext2["FLASH"] = "FLASH";
|
|
688
|
+
return SiteCreatedContext2;
|
|
689
|
+
})(SiteCreatedContext || {});
|
|
690
|
+
var Namespace = /* @__PURE__ */ ((Namespace2) => {
|
|
691
|
+
Namespace2["UNKNOWN_NAMESPACE"] = "UNKNOWN_NAMESPACE";
|
|
692
|
+
Namespace2["WIX"] = "WIX";
|
|
693
|
+
Namespace2["SHOUT_OUT"] = "SHOUT_OUT";
|
|
694
|
+
Namespace2["ALBUMS"] = "ALBUMS";
|
|
695
|
+
Namespace2["WIX_STORES_TEST_DRIVE"] = "WIX_STORES_TEST_DRIVE";
|
|
696
|
+
Namespace2["HOTELS"] = "HOTELS";
|
|
697
|
+
Namespace2["CLUBS"] = "CLUBS";
|
|
698
|
+
Namespace2["ONBOARDING_DRAFT"] = "ONBOARDING_DRAFT";
|
|
699
|
+
Namespace2["DEV_SITE"] = "DEV_SITE";
|
|
700
|
+
Namespace2["LOGOS"] = "LOGOS";
|
|
701
|
+
Namespace2["VIDEO_MAKER"] = "VIDEO_MAKER";
|
|
702
|
+
Namespace2["PARTNER_DASHBOARD"] = "PARTNER_DASHBOARD";
|
|
703
|
+
Namespace2["DEV_CENTER_COMPANY"] = "DEV_CENTER_COMPANY";
|
|
704
|
+
Namespace2["HTML_DRAFT"] = "HTML_DRAFT";
|
|
705
|
+
Namespace2["SITELESS_BUSINESS"] = "SITELESS_BUSINESS";
|
|
706
|
+
Namespace2["CREATOR_ECONOMY"] = "CREATOR_ECONOMY";
|
|
707
|
+
Namespace2["DASHBOARD_FIRST"] = "DASHBOARD_FIRST";
|
|
708
|
+
Namespace2["ANYWHERE"] = "ANYWHERE";
|
|
709
|
+
Namespace2["HEADLESS"] = "HEADLESS";
|
|
710
|
+
Namespace2["ACCOUNT_MASTER_CMS"] = "ACCOUNT_MASTER_CMS";
|
|
711
|
+
Namespace2["RISE"] = "RISE";
|
|
712
|
+
Namespace2["BRANDED_FIRST"] = "BRANDED_FIRST";
|
|
713
|
+
Namespace2["NOWNIA"] = "NOWNIA";
|
|
714
|
+
Namespace2["UGC_TEMPLATE"] = "UGC_TEMPLATE";
|
|
715
|
+
Namespace2["CODUX"] = "CODUX";
|
|
716
|
+
Namespace2["MEDIA_DESIGN_CREATOR"] = "MEDIA_DESIGN_CREATOR";
|
|
717
|
+
Namespace2["SHARED_BLOG_ENTERPRISE"] = "SHARED_BLOG_ENTERPRISE";
|
|
718
|
+
Namespace2["STANDALONE_FORMS"] = "STANDALONE_FORMS";
|
|
719
|
+
Namespace2["STANDALONE_EVENTS"] = "STANDALONE_EVENTS";
|
|
720
|
+
Namespace2["MIMIR"] = "MIMIR";
|
|
721
|
+
return Namespace2;
|
|
722
|
+
})(Namespace || {});
|
|
723
|
+
var DeleteStatus = /* @__PURE__ */ ((DeleteStatus2) => {
|
|
724
|
+
DeleteStatus2["UNKNOWN"] = "UNKNOWN";
|
|
725
|
+
DeleteStatus2["TRASH"] = "TRASH";
|
|
726
|
+
DeleteStatus2["DELETED"] = "DELETED";
|
|
727
|
+
DeleteStatus2["PENDING_PURGE"] = "PENDING_PURGE";
|
|
728
|
+
DeleteStatus2["PURGED_EXTERNALLY"] = "PURGED_EXTERNALLY";
|
|
729
|
+
return DeleteStatus2;
|
|
730
|
+
})(DeleteStatus || {});
|
|
731
|
+
var TriggerValidationErrorValidationErrorType = /* @__PURE__ */ ((TriggerValidationErrorValidationErrorType2) => {
|
|
732
|
+
TriggerValidationErrorValidationErrorType2["UNKNOWN_VALIDATION_ERROR_TYPE"] = "UNKNOWN_VALIDATION_ERROR_TYPE";
|
|
733
|
+
TriggerValidationErrorValidationErrorType2["CONFIGURATION_ERROR"] = "CONFIGURATION_ERROR";
|
|
734
|
+
TriggerValidationErrorValidationErrorType2["PROVIDER_ERROR"] = "PROVIDER_ERROR";
|
|
735
|
+
return TriggerValidationErrorValidationErrorType2;
|
|
736
|
+
})(TriggerValidationErrorValidationErrorType || {});
|
|
737
|
+
var TriggerErrorType = /* @__PURE__ */ ((TriggerErrorType2) => {
|
|
738
|
+
TriggerErrorType2["UNKNOWN_TRIGGER_ERROR_TYPE"] = "UNKNOWN_TRIGGER_ERROR_TYPE";
|
|
739
|
+
TriggerErrorType2["NOT_FOUND"] = "NOT_FOUND";
|
|
740
|
+
TriggerErrorType2["APP_NOT_INSTALLED"] = "APP_NOT_INSTALLED";
|
|
741
|
+
TriggerErrorType2["MODERATION_MISMATCH"] = "MODERATION_MISMATCH";
|
|
742
|
+
TriggerErrorType2["DEPRECATED"] = "DEPRECATED";
|
|
743
|
+
TriggerErrorType2["INVALID_TRIGGER_KEY"] = "INVALID_TRIGGER_KEY";
|
|
744
|
+
TriggerErrorType2["INVALID_FILTER_FIELD_KEY"] = "INVALID_FILTER_FIELD_KEY";
|
|
745
|
+
TriggerErrorType2["INVALID_FILTER_EXPRESSION"] = "INVALID_FILTER_EXPRESSION";
|
|
746
|
+
return TriggerErrorType2;
|
|
747
|
+
})(TriggerErrorType || {});
|
|
748
|
+
var ValidationErrorSeverity = /* @__PURE__ */ ((ValidationErrorSeverity2) => {
|
|
749
|
+
ValidationErrorSeverity2["UNKNOWN_VALIDATION_ERROR_SEVERITY"] = "UNKNOWN_VALIDATION_ERROR_SEVERITY";
|
|
750
|
+
ValidationErrorSeverity2["WARNING"] = "WARNING";
|
|
751
|
+
ValidationErrorSeverity2["ERROR"] = "ERROR";
|
|
752
|
+
return ValidationErrorSeverity2;
|
|
753
|
+
})(ValidationErrorSeverity || {});
|
|
754
|
+
var ValidationErrorType = /* @__PURE__ */ ((ValidationErrorType2) => {
|
|
755
|
+
ValidationErrorType2["UNKNOWN_VALIDATION_ERROR_TYPE"] = "UNKNOWN_VALIDATION_ERROR_TYPE";
|
|
756
|
+
ValidationErrorType2["CONFIGURATION_ERROR"] = "CONFIGURATION_ERROR";
|
|
757
|
+
ValidationErrorType2["PROVIDER_ERROR"] = "PROVIDER_ERROR";
|
|
758
|
+
return ValidationErrorType2;
|
|
759
|
+
})(ValidationErrorType || {});
|
|
760
|
+
var ActionErrorType = /* @__PURE__ */ ((ActionErrorType2) => {
|
|
761
|
+
ActionErrorType2["UNKNOWN_ACTION_ERROR_TYPE"] = "UNKNOWN_ACTION_ERROR_TYPE";
|
|
762
|
+
ActionErrorType2["NOT_FOUND"] = "NOT_FOUND";
|
|
763
|
+
ActionErrorType2["APP_NOT_INSTALLED"] = "APP_NOT_INSTALLED";
|
|
764
|
+
ActionErrorType2["MODERATION_MISMATCH"] = "MODERATION_MISMATCH";
|
|
765
|
+
ActionErrorType2["DEPRECATED"] = "DEPRECATED";
|
|
766
|
+
ActionErrorType2["INVALID_ACTION_KEY"] = "INVALID_ACTION_KEY";
|
|
767
|
+
ActionErrorType2["INVALID_MAPPING"] = "INVALID_MAPPING";
|
|
768
|
+
ActionErrorType2["MAPPING_TYPE_MISMATCH"] = "MAPPING_TYPE_MISMATCH";
|
|
769
|
+
ActionErrorType2["MAPPING_MISSING_REQUIRED_FIELD"] = "MAPPING_MISSING_REQUIRED_FIELD";
|
|
770
|
+
ActionErrorType2["MAPPING_SCHEMA_MISMATCH"] = "MAPPING_SCHEMA_MISMATCH";
|
|
771
|
+
ActionErrorType2["MAPPING_VARIABLE_MISSING_FROM_SCHEMA"] = "MAPPING_VARIABLE_MISSING_FROM_SCHEMA";
|
|
772
|
+
ActionErrorType2["SAMPLE_CODE_RUN_FAILED"] = "SAMPLE_CODE_RUN_FAILED";
|
|
773
|
+
return ActionErrorType2;
|
|
774
|
+
})(ActionErrorType || {});
|
|
775
|
+
var AutomationValidationErrorValidationErrorType = /* @__PURE__ */ ((AutomationValidationErrorValidationErrorType2) => {
|
|
776
|
+
AutomationValidationErrorValidationErrorType2["UNKNOWN_VALIDATION_ERROR_TYPE"] = "UNKNOWN_VALIDATION_ERROR_TYPE";
|
|
777
|
+
AutomationValidationErrorValidationErrorType2["CONFIGURATION_ERROR"] = "CONFIGURATION_ERROR";
|
|
778
|
+
AutomationValidationErrorValidationErrorType2["PROVIDER_ERROR"] = "PROVIDER_ERROR";
|
|
779
|
+
return AutomationValidationErrorValidationErrorType2;
|
|
780
|
+
})(AutomationValidationErrorValidationErrorType || {});
|
|
781
|
+
var AutomationErrorType = /* @__PURE__ */ ((AutomationErrorType2) => {
|
|
782
|
+
AutomationErrorType2["UNKNOWN_AUTOMATION_ERROR_TYPE"] = "UNKNOWN_AUTOMATION_ERROR_TYPE";
|
|
783
|
+
return AutomationErrorType2;
|
|
784
|
+
})(AutomationErrorType || {});
|
|
785
|
+
async function createAutomation2(automation) {
|
|
786
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
787
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
788
|
+
automation
|
|
789
|
+
});
|
|
790
|
+
const reqOpts = createAutomation(payload);
|
|
791
|
+
sideEffects?.onSiteCall?.();
|
|
792
|
+
try {
|
|
793
|
+
const result = await httpClient.request(reqOpts);
|
|
794
|
+
sideEffects?.onSuccess?.(result);
|
|
795
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.automation;
|
|
796
|
+
} catch (err) {
|
|
797
|
+
const transformedError = sdkTransformError(
|
|
798
|
+
err,
|
|
799
|
+
{
|
|
800
|
+
spreadPathsToArguments: {},
|
|
801
|
+
explicitPathsToArguments: { automation: "$[0]" },
|
|
802
|
+
singleArgumentUnchanged: false
|
|
803
|
+
},
|
|
804
|
+
["automation"]
|
|
805
|
+
);
|
|
806
|
+
sideEffects?.onError?.(err);
|
|
807
|
+
throw transformedError;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
async function getAutomation2(automationId) {
|
|
811
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
812
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
813
|
+
automationId
|
|
814
|
+
});
|
|
815
|
+
const reqOpts = getAutomation(payload);
|
|
816
|
+
sideEffects?.onSiteCall?.();
|
|
817
|
+
try {
|
|
818
|
+
const result = await httpClient.request(reqOpts);
|
|
819
|
+
sideEffects?.onSuccess?.(result);
|
|
820
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.automation;
|
|
821
|
+
} catch (err) {
|
|
822
|
+
const transformedError = sdkTransformError(
|
|
823
|
+
err,
|
|
824
|
+
{
|
|
825
|
+
spreadPathsToArguments: {},
|
|
826
|
+
explicitPathsToArguments: { automationId: "$[0]" },
|
|
827
|
+
singleArgumentUnchanged: false
|
|
828
|
+
},
|
|
829
|
+
["automationId"]
|
|
830
|
+
);
|
|
831
|
+
sideEffects?.onError?.(err);
|
|
832
|
+
throw transformedError;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
async function updateAutomation2(_id, automation) {
|
|
836
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
837
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
838
|
+
automation: { ...automation, id: _id }
|
|
839
|
+
});
|
|
840
|
+
const reqOpts = updateAutomation(payload);
|
|
841
|
+
sideEffects?.onSiteCall?.();
|
|
842
|
+
try {
|
|
843
|
+
const result = await httpClient.request(reqOpts);
|
|
844
|
+
sideEffects?.onSuccess?.(result);
|
|
845
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.automation;
|
|
846
|
+
} catch (err) {
|
|
847
|
+
const transformedError = sdkTransformError(
|
|
848
|
+
err,
|
|
849
|
+
{
|
|
850
|
+
spreadPathsToArguments: { automation: "$[1]" },
|
|
851
|
+
explicitPathsToArguments: { "automation.id": "$[0]" },
|
|
852
|
+
singleArgumentUnchanged: false
|
|
853
|
+
},
|
|
854
|
+
["_id", "automation"]
|
|
855
|
+
);
|
|
856
|
+
sideEffects?.onError?.(err);
|
|
857
|
+
throw transformedError;
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
async function deleteAutomation2(automationId) {
|
|
861
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
862
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
863
|
+
automationId
|
|
864
|
+
});
|
|
865
|
+
const reqOpts = deleteAutomation(payload);
|
|
866
|
+
sideEffects?.onSiteCall?.();
|
|
867
|
+
try {
|
|
868
|
+
const result = await httpClient.request(reqOpts);
|
|
869
|
+
sideEffects?.onSuccess?.(result);
|
|
870
|
+
} catch (err) {
|
|
871
|
+
const transformedError = sdkTransformError(
|
|
872
|
+
err,
|
|
873
|
+
{
|
|
874
|
+
spreadPathsToArguments: {},
|
|
875
|
+
explicitPathsToArguments: { automationId: "$[0]" },
|
|
876
|
+
singleArgumentUnchanged: false
|
|
877
|
+
},
|
|
878
|
+
["automationId"]
|
|
879
|
+
);
|
|
880
|
+
sideEffects?.onError?.(err);
|
|
881
|
+
throw transformedError;
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
async function bulkDeleteAutomations2(automationIds) {
|
|
885
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
886
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
887
|
+
automationIds
|
|
888
|
+
});
|
|
889
|
+
const reqOpts = bulkDeleteAutomations(payload);
|
|
890
|
+
sideEffects?.onSiteCall?.();
|
|
891
|
+
try {
|
|
892
|
+
const result = await httpClient.request(reqOpts);
|
|
893
|
+
sideEffects?.onSuccess?.(result);
|
|
894
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
895
|
+
} catch (err) {
|
|
896
|
+
const transformedError = sdkTransformError(
|
|
897
|
+
err,
|
|
898
|
+
{
|
|
899
|
+
spreadPathsToArguments: {},
|
|
900
|
+
explicitPathsToArguments: { automationIds: "$[0]" },
|
|
901
|
+
singleArgumentUnchanged: false
|
|
902
|
+
},
|
|
903
|
+
["automationIds"]
|
|
904
|
+
);
|
|
905
|
+
sideEffects?.onError?.(err);
|
|
906
|
+
throw transformedError;
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
async function generatePreinstalledAutomation2(automation, options) {
|
|
910
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
911
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
912
|
+
automation,
|
|
913
|
+
appId: options?.appId
|
|
914
|
+
});
|
|
915
|
+
const reqOpts = generatePreinstalledAutomation(
|
|
916
|
+
payload
|
|
917
|
+
);
|
|
918
|
+
sideEffects?.onSiteCall?.();
|
|
919
|
+
try {
|
|
920
|
+
const result = await httpClient.request(reqOpts);
|
|
921
|
+
sideEffects?.onSuccess?.(result);
|
|
922
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
923
|
+
} catch (err) {
|
|
924
|
+
const transformedError = sdkTransformError(
|
|
925
|
+
err,
|
|
926
|
+
{
|
|
927
|
+
spreadPathsToArguments: {},
|
|
928
|
+
explicitPathsToArguments: { automation: "$[0]", appId: "$[1].appId" },
|
|
929
|
+
singleArgumentUnchanged: false
|
|
930
|
+
},
|
|
931
|
+
["automation", "options"]
|
|
932
|
+
);
|
|
933
|
+
sideEffects?.onError?.(err);
|
|
934
|
+
throw transformedError;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
function queryAutomations2() {
|
|
938
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
939
|
+
return queryBuilder({
|
|
940
|
+
func: async (payload) => {
|
|
941
|
+
const reqOpts = queryAutomations(payload);
|
|
942
|
+
sideEffects?.onSiteCall?.();
|
|
943
|
+
try {
|
|
944
|
+
const result = await httpClient.request(reqOpts);
|
|
945
|
+
sideEffects?.onSuccess?.(result);
|
|
946
|
+
return result;
|
|
947
|
+
} catch (err) {
|
|
948
|
+
sideEffects?.onError?.(err);
|
|
949
|
+
throw err;
|
|
950
|
+
}
|
|
951
|
+
},
|
|
952
|
+
requestTransformer: (query) => {
|
|
953
|
+
const args = [query, {}];
|
|
954
|
+
return renameKeysFromSDKRequestToRESTRequest({
|
|
955
|
+
...args?.[1],
|
|
956
|
+
query: args?.[0]
|
|
957
|
+
});
|
|
958
|
+
},
|
|
959
|
+
responseTransformer: ({ data }) => {
|
|
960
|
+
const transformedData = renameKeysFromRESTResponseToSDKResponse(
|
|
961
|
+
transformPaths2(data, [])
|
|
962
|
+
);
|
|
963
|
+
return {
|
|
964
|
+
items: transformedData?.automations,
|
|
965
|
+
pagingMetadata: transformedData?.pagingMetadata
|
|
966
|
+
};
|
|
967
|
+
},
|
|
968
|
+
errorTransformer: (err) => {
|
|
969
|
+
const transformedError = sdkTransformError(err, {
|
|
970
|
+
spreadPathsToArguments: {},
|
|
971
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
972
|
+
singleArgumentUnchanged: false
|
|
973
|
+
});
|
|
974
|
+
throw transformedError;
|
|
975
|
+
},
|
|
976
|
+
pagingMethod: "CURSOR",
|
|
977
|
+
transformationPaths: {}
|
|
978
|
+
});
|
|
979
|
+
}
|
|
980
|
+
async function copyAutomation2(automationId, options) {
|
|
981
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
982
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
983
|
+
automationId,
|
|
984
|
+
origin: options?.origin,
|
|
985
|
+
automation: options?.automation
|
|
986
|
+
});
|
|
987
|
+
const reqOpts = copyAutomation(payload);
|
|
988
|
+
sideEffects?.onSiteCall?.();
|
|
989
|
+
try {
|
|
990
|
+
const result = await httpClient.request(reqOpts);
|
|
991
|
+
sideEffects?.onSuccess?.(result);
|
|
992
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
993
|
+
} catch (err) {
|
|
994
|
+
const transformedError = sdkTransformError(
|
|
995
|
+
err,
|
|
996
|
+
{
|
|
997
|
+
spreadPathsToArguments: {},
|
|
998
|
+
explicitPathsToArguments: {
|
|
999
|
+
automationId: "$[0]",
|
|
1000
|
+
origin: "$[1].origin",
|
|
1001
|
+
automation: "$[1].automation"
|
|
1002
|
+
},
|
|
1003
|
+
singleArgumentUnchanged: false
|
|
1004
|
+
},
|
|
1005
|
+
["automationId", "options"]
|
|
1006
|
+
);
|
|
1007
|
+
sideEffects?.onError?.(err);
|
|
1008
|
+
throw transformedError;
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
async function createDraftAutomation2(options) {
|
|
1012
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1013
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1014
|
+
automation: options?.automation
|
|
1015
|
+
});
|
|
1016
|
+
const reqOpts = createDraftAutomation(payload);
|
|
1017
|
+
sideEffects?.onSiteCall?.();
|
|
1018
|
+
try {
|
|
1019
|
+
const result = await httpClient.request(reqOpts);
|
|
1020
|
+
sideEffects?.onSuccess?.(result);
|
|
1021
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
1022
|
+
} catch (err) {
|
|
1023
|
+
const transformedError = sdkTransformError(
|
|
1024
|
+
err,
|
|
1025
|
+
{
|
|
1026
|
+
spreadPathsToArguments: {},
|
|
1027
|
+
explicitPathsToArguments: { automation: "$[0].automation" },
|
|
1028
|
+
singleArgumentUnchanged: false
|
|
1029
|
+
},
|
|
1030
|
+
["options"]
|
|
1031
|
+
);
|
|
1032
|
+
sideEffects?.onError?.(err);
|
|
1033
|
+
throw transformedError;
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
async function getOrCreateDraftAutomation2(originalAutomationId) {
|
|
1037
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1038
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1039
|
+
originalAutomationId
|
|
1040
|
+
});
|
|
1041
|
+
const reqOpts = getOrCreateDraftAutomation(payload);
|
|
1042
|
+
sideEffects?.onSiteCall?.();
|
|
1043
|
+
try {
|
|
1044
|
+
const result = await httpClient.request(reqOpts);
|
|
1045
|
+
sideEffects?.onSuccess?.(result);
|
|
1046
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
1047
|
+
} catch (err) {
|
|
1048
|
+
const transformedError = sdkTransformError(
|
|
1049
|
+
err,
|
|
1050
|
+
{
|
|
1051
|
+
spreadPathsToArguments: {},
|
|
1052
|
+
explicitPathsToArguments: { originalAutomationId: "$[0]" },
|
|
1053
|
+
singleArgumentUnchanged: false
|
|
1054
|
+
},
|
|
1055
|
+
["originalAutomationId"]
|
|
1056
|
+
);
|
|
1057
|
+
sideEffects?.onError?.(err);
|
|
1058
|
+
throw transformedError;
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
async function updateDraftAutomation2(_id, automation) {
|
|
1062
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1063
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1064
|
+
automation: { ...automation, id: _id }
|
|
1065
|
+
});
|
|
1066
|
+
const reqOpts = updateDraftAutomation(payload);
|
|
1067
|
+
sideEffects?.onSiteCall?.();
|
|
1068
|
+
try {
|
|
1069
|
+
const result = await httpClient.request(reqOpts);
|
|
1070
|
+
sideEffects?.onSuccess?.(result);
|
|
1071
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
1072
|
+
} catch (err) {
|
|
1073
|
+
const transformedError = sdkTransformError(
|
|
1074
|
+
err,
|
|
1075
|
+
{
|
|
1076
|
+
spreadPathsToArguments: { automation: "$[1]" },
|
|
1077
|
+
explicitPathsToArguments: { "automation.id": "$[0]" },
|
|
1078
|
+
singleArgumentUnchanged: false
|
|
1079
|
+
},
|
|
1080
|
+
["_id", "automation"]
|
|
1081
|
+
);
|
|
1082
|
+
sideEffects?.onError?.(err);
|
|
1083
|
+
throw transformedError;
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
async function queryAutomationsWithDrafts2(options) {
|
|
1087
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1088
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1089
|
+
query: options?.query
|
|
1090
|
+
});
|
|
1091
|
+
const reqOpts = queryAutomationsWithDrafts(payload);
|
|
1092
|
+
sideEffects?.onSiteCall?.();
|
|
1093
|
+
try {
|
|
1094
|
+
const result = await httpClient.request(reqOpts);
|
|
1095
|
+
sideEffects?.onSuccess?.(result);
|
|
1096
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
1097
|
+
} catch (err) {
|
|
1098
|
+
const transformedError = sdkTransformError(
|
|
1099
|
+
err,
|
|
1100
|
+
{
|
|
1101
|
+
spreadPathsToArguments: {},
|
|
1102
|
+
explicitPathsToArguments: { query: "$[0].query" },
|
|
1103
|
+
singleArgumentUnchanged: false
|
|
1104
|
+
},
|
|
1105
|
+
["options"]
|
|
1106
|
+
);
|
|
1107
|
+
sideEffects?.onError?.(err);
|
|
1108
|
+
throw transformedError;
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
async function deleteDraftAutomation2(automationId) {
|
|
1112
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1113
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1114
|
+
automationId
|
|
1115
|
+
});
|
|
1116
|
+
const reqOpts = deleteDraftAutomation(payload);
|
|
1117
|
+
sideEffects?.onSiteCall?.();
|
|
1118
|
+
try {
|
|
1119
|
+
const result = await httpClient.request(reqOpts);
|
|
1120
|
+
sideEffects?.onSuccess?.(result);
|
|
1121
|
+
} catch (err) {
|
|
1122
|
+
const transformedError = sdkTransformError(
|
|
1123
|
+
err,
|
|
1124
|
+
{
|
|
1125
|
+
spreadPathsToArguments: {},
|
|
1126
|
+
explicitPathsToArguments: { automationId: "$[0]" },
|
|
1127
|
+
singleArgumentUnchanged: false
|
|
1128
|
+
},
|
|
1129
|
+
["automationId"]
|
|
1130
|
+
);
|
|
1131
|
+
sideEffects?.onError?.(err);
|
|
1132
|
+
throw transformedError;
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
async function publishDraftAutomation2(automationId) {
|
|
1136
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1137
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1138
|
+
automationId
|
|
1139
|
+
});
|
|
1140
|
+
const reqOpts = publishDraftAutomation(payload);
|
|
1141
|
+
sideEffects?.onSiteCall?.();
|
|
1142
|
+
try {
|
|
1143
|
+
const result = await httpClient.request(reqOpts);
|
|
1144
|
+
sideEffects?.onSuccess?.(result);
|
|
1145
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
1146
|
+
} catch (err) {
|
|
1147
|
+
const transformedError = sdkTransformError(
|
|
1148
|
+
err,
|
|
1149
|
+
{
|
|
1150
|
+
spreadPathsToArguments: {},
|
|
1151
|
+
explicitPathsToArguments: { automationId: "$[0]" },
|
|
1152
|
+
singleArgumentUnchanged: false
|
|
1153
|
+
},
|
|
1154
|
+
["automationId"]
|
|
1155
|
+
);
|
|
1156
|
+
sideEffects?.onError?.(err);
|
|
1157
|
+
throw transformedError;
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
async function validateAutomation2(automation, options) {
|
|
1161
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1162
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1163
|
+
automation,
|
|
1164
|
+
validationSettings: options?.validationSettings
|
|
1165
|
+
});
|
|
1166
|
+
const reqOpts = validateAutomation(payload);
|
|
1167
|
+
sideEffects?.onSiteCall?.();
|
|
1168
|
+
try {
|
|
1169
|
+
const result = await httpClient.request(reqOpts);
|
|
1170
|
+
sideEffects?.onSuccess?.(result);
|
|
1171
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
1172
|
+
} catch (err) {
|
|
1173
|
+
const transformedError = sdkTransformError(
|
|
1174
|
+
err,
|
|
1175
|
+
{
|
|
1176
|
+
spreadPathsToArguments: {},
|
|
1177
|
+
explicitPathsToArguments: {
|
|
1178
|
+
automation: "$[0]",
|
|
1179
|
+
validationSettings: "$[1].validationSettings"
|
|
1180
|
+
},
|
|
1181
|
+
singleArgumentUnchanged: false
|
|
1182
|
+
},
|
|
1183
|
+
["automation", "options"]
|
|
1184
|
+
);
|
|
1185
|
+
sideEffects?.onError?.(err);
|
|
1186
|
+
throw transformedError;
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
async function validateAutomationById2(automationId, options) {
|
|
1190
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1191
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1192
|
+
automationId,
|
|
1193
|
+
validationSettings: options?.validationSettings
|
|
1194
|
+
});
|
|
1195
|
+
const reqOpts = validateAutomationById(payload);
|
|
1196
|
+
sideEffects?.onSiteCall?.();
|
|
1197
|
+
try {
|
|
1198
|
+
const result = await httpClient.request(reqOpts);
|
|
1199
|
+
sideEffects?.onSuccess?.(result);
|
|
1200
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
1201
|
+
} catch (err) {
|
|
1202
|
+
const transformedError = sdkTransformError(
|
|
1203
|
+
err,
|
|
1204
|
+
{
|
|
1205
|
+
spreadPathsToArguments: {},
|
|
1206
|
+
explicitPathsToArguments: {
|
|
1207
|
+
automationId: "$[0]",
|
|
1208
|
+
validationSettings: "$[1].validationSettings"
|
|
1209
|
+
},
|
|
1210
|
+
singleArgumentUnchanged: false
|
|
1211
|
+
},
|
|
1212
|
+
["automationId", "options"]
|
|
1213
|
+
);
|
|
1214
|
+
sideEffects?.onError?.(err);
|
|
1215
|
+
throw transformedError;
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
async function getAutomationRevision2(automationId, options) {
|
|
1219
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1220
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1221
|
+
automationId,
|
|
1222
|
+
revision: options?.revision,
|
|
1223
|
+
fields: options?.fields
|
|
1224
|
+
});
|
|
1225
|
+
const reqOpts = getAutomationRevision(payload);
|
|
1226
|
+
sideEffects?.onSiteCall?.();
|
|
1227
|
+
try {
|
|
1228
|
+
const result = await httpClient.request(reqOpts);
|
|
1229
|
+
sideEffects?.onSuccess?.(result);
|
|
1230
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
1231
|
+
} catch (err) {
|
|
1232
|
+
const transformedError = sdkTransformError(
|
|
1233
|
+
err,
|
|
1234
|
+
{
|
|
1235
|
+
spreadPathsToArguments: {},
|
|
1236
|
+
explicitPathsToArguments: {
|
|
1237
|
+
automationId: "$[0]",
|
|
1238
|
+
revision: "$[1].revision",
|
|
1239
|
+
fields: "$[1].fields"
|
|
1240
|
+
},
|
|
1241
|
+
singleArgumentUnchanged: false
|
|
1242
|
+
},
|
|
1243
|
+
["automationId", "options"]
|
|
1244
|
+
);
|
|
1245
|
+
sideEffects?.onError?.(err);
|
|
1246
|
+
throw transformedError;
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
// src/automations-v2-automation-automations-v-2.public.ts
|
|
1251
|
+
function createAutomation3(httpClient) {
|
|
1252
|
+
return (automation) => createAutomation2(
|
|
1253
|
+
automation,
|
|
1254
|
+
// @ts-ignore
|
|
1255
|
+
{ httpClient }
|
|
1256
|
+
);
|
|
1257
|
+
}
|
|
1258
|
+
function getAutomation3(httpClient) {
|
|
1259
|
+
return (automationId) => getAutomation2(
|
|
1260
|
+
automationId,
|
|
1261
|
+
// @ts-ignore
|
|
1262
|
+
{ httpClient }
|
|
1263
|
+
);
|
|
1264
|
+
}
|
|
1265
|
+
function updateAutomation3(httpClient) {
|
|
1266
|
+
return (_id, automation) => updateAutomation2(
|
|
1267
|
+
_id,
|
|
1268
|
+
automation,
|
|
1269
|
+
// @ts-ignore
|
|
1270
|
+
{ httpClient }
|
|
1271
|
+
);
|
|
1272
|
+
}
|
|
1273
|
+
function deleteAutomation3(httpClient) {
|
|
1274
|
+
return (automationId) => deleteAutomation2(
|
|
1275
|
+
automationId,
|
|
1276
|
+
// @ts-ignore
|
|
1277
|
+
{ httpClient }
|
|
1278
|
+
);
|
|
1279
|
+
}
|
|
1280
|
+
function bulkDeleteAutomations3(httpClient) {
|
|
1281
|
+
return (automationIds) => bulkDeleteAutomations2(
|
|
1282
|
+
automationIds,
|
|
1283
|
+
// @ts-ignore
|
|
1284
|
+
{ httpClient }
|
|
1285
|
+
);
|
|
1286
|
+
}
|
|
1287
|
+
function generatePreinstalledAutomation3(httpClient) {
|
|
1288
|
+
return (automation, options) => generatePreinstalledAutomation2(
|
|
1289
|
+
automation,
|
|
1290
|
+
options,
|
|
1291
|
+
// @ts-ignore
|
|
1292
|
+
{ httpClient }
|
|
1293
|
+
);
|
|
1294
|
+
}
|
|
1295
|
+
function queryAutomations3(httpClient) {
|
|
1296
|
+
return () => queryAutomations2(
|
|
1297
|
+
// @ts-ignore
|
|
1298
|
+
{ httpClient }
|
|
1299
|
+
);
|
|
1300
|
+
}
|
|
1301
|
+
function copyAutomation3(httpClient) {
|
|
1302
|
+
return (automationId, options) => copyAutomation2(
|
|
1303
|
+
automationId,
|
|
1304
|
+
options,
|
|
1305
|
+
// @ts-ignore
|
|
1306
|
+
{ httpClient }
|
|
1307
|
+
);
|
|
1308
|
+
}
|
|
1309
|
+
function createDraftAutomation3(httpClient) {
|
|
1310
|
+
return (options) => createDraftAutomation2(
|
|
1311
|
+
options,
|
|
1312
|
+
// @ts-ignore
|
|
1313
|
+
{ httpClient }
|
|
1314
|
+
);
|
|
1315
|
+
}
|
|
1316
|
+
function getOrCreateDraftAutomation3(httpClient) {
|
|
1317
|
+
return (originalAutomationId) => getOrCreateDraftAutomation2(
|
|
1318
|
+
originalAutomationId,
|
|
1319
|
+
// @ts-ignore
|
|
1320
|
+
{ httpClient }
|
|
1321
|
+
);
|
|
1322
|
+
}
|
|
1323
|
+
function updateDraftAutomation3(httpClient) {
|
|
1324
|
+
return (_id, automation) => updateDraftAutomation2(
|
|
1325
|
+
_id,
|
|
1326
|
+
automation,
|
|
1327
|
+
// @ts-ignore
|
|
1328
|
+
{ httpClient }
|
|
1329
|
+
);
|
|
1330
|
+
}
|
|
1331
|
+
function queryAutomationsWithDrafts3(httpClient) {
|
|
1332
|
+
return (options) => queryAutomationsWithDrafts2(
|
|
1333
|
+
options,
|
|
1334
|
+
// @ts-ignore
|
|
1335
|
+
{ httpClient }
|
|
1336
|
+
);
|
|
1337
|
+
}
|
|
1338
|
+
function deleteDraftAutomation3(httpClient) {
|
|
1339
|
+
return (automationId) => deleteDraftAutomation2(
|
|
1340
|
+
automationId,
|
|
1341
|
+
// @ts-ignore
|
|
1342
|
+
{ httpClient }
|
|
1343
|
+
);
|
|
1344
|
+
}
|
|
1345
|
+
function publishDraftAutomation3(httpClient) {
|
|
1346
|
+
return (automationId) => publishDraftAutomation2(
|
|
1347
|
+
automationId,
|
|
1348
|
+
// @ts-ignore
|
|
1349
|
+
{ httpClient }
|
|
1350
|
+
);
|
|
1351
|
+
}
|
|
1352
|
+
function validateAutomation3(httpClient) {
|
|
1353
|
+
return (automation, options) => validateAutomation2(
|
|
1354
|
+
automation,
|
|
1355
|
+
options,
|
|
1356
|
+
// @ts-ignore
|
|
1357
|
+
{ httpClient }
|
|
1358
|
+
);
|
|
1359
|
+
}
|
|
1360
|
+
function validateAutomationById3(httpClient) {
|
|
1361
|
+
return (automationId, options) => validateAutomationById2(
|
|
1362
|
+
automationId,
|
|
1363
|
+
options,
|
|
1364
|
+
// @ts-ignore
|
|
1365
|
+
{ httpClient }
|
|
1366
|
+
);
|
|
1367
|
+
}
|
|
1368
|
+
function getAutomationRevision3(httpClient) {
|
|
1369
|
+
return (automationId, options) => getAutomationRevision2(
|
|
1370
|
+
automationId,
|
|
1371
|
+
options,
|
|
1372
|
+
// @ts-ignore
|
|
1373
|
+
{ httpClient }
|
|
1374
|
+
);
|
|
1375
|
+
}
|
|
1376
|
+
var onAutomationCreated = EventDefinition(
|
|
1377
|
+
"wix.automations.v2.automation_created",
|
|
1378
|
+
true,
|
|
1379
|
+
(event) => renameKeysFromRESTResponseToSDKResponse2(
|
|
1380
|
+
transformPaths3(event, [
|
|
1381
|
+
{
|
|
1382
|
+
transformFn: transformRESTTimestampToSDKTimestamp2,
|
|
1383
|
+
paths: [
|
|
1384
|
+
{ path: "entity.createdDate" },
|
|
1385
|
+
{ path: "entity.updatedDate" },
|
|
1386
|
+
{ path: "entity.draftUpdatedDate" },
|
|
1387
|
+
{ path: "metadata.eventTime" }
|
|
1388
|
+
]
|
|
1389
|
+
}
|
|
1390
|
+
])
|
|
1391
|
+
)
|
|
1392
|
+
)();
|
|
1393
|
+
var onAutomationDeleted = EventDefinition(
|
|
1394
|
+
"wix.automations.v2.automation_deleted",
|
|
1395
|
+
true,
|
|
1396
|
+
(event) => renameKeysFromRESTResponseToSDKResponse2(
|
|
1397
|
+
transformPaths3(event, [
|
|
1398
|
+
{
|
|
1399
|
+
transformFn: transformRESTTimestampToSDKTimestamp2,
|
|
1400
|
+
paths: [
|
|
1401
|
+
{ path: "entity.createdDate" },
|
|
1402
|
+
{ path: "entity.updatedDate" },
|
|
1403
|
+
{ path: "entity.draftUpdatedDate" },
|
|
1404
|
+
{ path: "metadata.eventTime" }
|
|
1405
|
+
]
|
|
1406
|
+
}
|
|
1407
|
+
])
|
|
1408
|
+
)
|
|
1409
|
+
)();
|
|
1410
|
+
var onAutomationUpdated = EventDefinition(
|
|
1411
|
+
"wix.automations.v2.automation_updated",
|
|
1412
|
+
true,
|
|
1413
|
+
(event) => renameKeysFromRESTResponseToSDKResponse2(
|
|
1414
|
+
transformPaths3(event, [
|
|
1415
|
+
{
|
|
1416
|
+
transformFn: transformRESTTimestampToSDKTimestamp2,
|
|
1417
|
+
paths: [
|
|
1418
|
+
{ path: "entity.createdDate" },
|
|
1419
|
+
{ path: "entity.updatedDate" },
|
|
1420
|
+
{ path: "entity.draftUpdatedDate" },
|
|
1421
|
+
{ path: "metadata.eventTime" }
|
|
1422
|
+
]
|
|
1423
|
+
}
|
|
1424
|
+
])
|
|
1425
|
+
)
|
|
1426
|
+
)();
|
|
1427
|
+
|
|
1428
|
+
// src/automations-v2-automation-automations-v-2.context.ts
|
|
1429
|
+
import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
|
|
1430
|
+
import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
|
|
1431
|
+
var createAutomation4 = /* @__PURE__ */ createRESTModule(createAutomation3);
|
|
1432
|
+
var getAutomation4 = /* @__PURE__ */ createRESTModule(getAutomation3);
|
|
1433
|
+
var updateAutomation4 = /* @__PURE__ */ createRESTModule(updateAutomation3);
|
|
1434
|
+
var deleteAutomation4 = /* @__PURE__ */ createRESTModule(deleteAutomation3);
|
|
1435
|
+
var bulkDeleteAutomations4 = /* @__PURE__ */ createRESTModule(bulkDeleteAutomations3);
|
|
1436
|
+
var generatePreinstalledAutomation4 = /* @__PURE__ */ createRESTModule(generatePreinstalledAutomation3);
|
|
1437
|
+
var queryAutomations4 = /* @__PURE__ */ createRESTModule(queryAutomations3);
|
|
1438
|
+
var copyAutomation4 = /* @__PURE__ */ createRESTModule(copyAutomation3);
|
|
1439
|
+
var createDraftAutomation4 = /* @__PURE__ */ createRESTModule(createDraftAutomation3);
|
|
1440
|
+
var getOrCreateDraftAutomation4 = /* @__PURE__ */ createRESTModule(getOrCreateDraftAutomation3);
|
|
1441
|
+
var updateDraftAutomation4 = /* @__PURE__ */ createRESTModule(updateDraftAutomation3);
|
|
1442
|
+
var queryAutomationsWithDrafts4 = /* @__PURE__ */ createRESTModule(queryAutomationsWithDrafts3);
|
|
1443
|
+
var deleteDraftAutomation4 = /* @__PURE__ */ createRESTModule(deleteDraftAutomation3);
|
|
1444
|
+
var publishDraftAutomation4 = /* @__PURE__ */ createRESTModule(publishDraftAutomation3);
|
|
1445
|
+
var validateAutomation4 = /* @__PURE__ */ createRESTModule(validateAutomation3);
|
|
1446
|
+
var validateAutomationById4 = /* @__PURE__ */ createRESTModule(validateAutomationById3);
|
|
1447
|
+
var getAutomationRevision4 = /* @__PURE__ */ createRESTModule(getAutomationRevision3);
|
|
1448
|
+
var onAutomationCreated2 = createEventModule(onAutomationCreated);
|
|
1449
|
+
var onAutomationDeleted2 = createEventModule(onAutomationDeleted);
|
|
1450
|
+
var onAutomationUpdated2 = createEventModule(onAutomationUpdated);
|
|
1451
|
+
export {
|
|
1452
|
+
ActionErrorType,
|
|
1453
|
+
AutomationErrorType,
|
|
1454
|
+
AutomationValidationErrorValidationErrorType,
|
|
1455
|
+
DeleteStatus,
|
|
1456
|
+
Domain,
|
|
1457
|
+
Language,
|
|
1458
|
+
Namespace,
|
|
1459
|
+
Operator,
|
|
1460
|
+
Origin,
|
|
1461
|
+
RequestedFields,
|
|
1462
|
+
SiteCreatedContext,
|
|
1463
|
+
SortOrder,
|
|
1464
|
+
State,
|
|
1465
|
+
Status,
|
|
1466
|
+
TimeUnit,
|
|
1467
|
+
TriggerErrorType,
|
|
1468
|
+
TriggerValidationErrorValidationErrorType,
|
|
1469
|
+
Type,
|
|
1470
|
+
ValidationErrorSeverity,
|
|
1471
|
+
ValidationErrorType,
|
|
1472
|
+
WebhookIdentityType,
|
|
1473
|
+
bulkDeleteAutomations4 as bulkDeleteAutomations,
|
|
1474
|
+
copyAutomation4 as copyAutomation,
|
|
1475
|
+
createAutomation4 as createAutomation,
|
|
1476
|
+
createDraftAutomation4 as createDraftAutomation,
|
|
1477
|
+
deleteAutomation4 as deleteAutomation,
|
|
1478
|
+
deleteDraftAutomation4 as deleteDraftAutomation,
|
|
1479
|
+
generatePreinstalledAutomation4 as generatePreinstalledAutomation,
|
|
1480
|
+
getAutomation4 as getAutomation,
|
|
1481
|
+
getAutomationRevision4 as getAutomationRevision,
|
|
1482
|
+
getOrCreateDraftAutomation4 as getOrCreateDraftAutomation,
|
|
1483
|
+
onAutomationCreated2 as onAutomationCreated,
|
|
1484
|
+
onAutomationDeleted2 as onAutomationDeleted,
|
|
1485
|
+
onAutomationUpdated2 as onAutomationUpdated,
|
|
1486
|
+
publishDraftAutomation4 as publishDraftAutomation,
|
|
1487
|
+
queryAutomations4 as queryAutomations,
|
|
1488
|
+
queryAutomationsWithDrafts4 as queryAutomationsWithDrafts,
|
|
1489
|
+
updateAutomation4 as updateAutomation,
|
|
1490
|
+
updateDraftAutomation4 as updateDraftAutomation,
|
|
1491
|
+
validateAutomation4 as validateAutomation,
|
|
1492
|
+
validateAutomationById4 as validateAutomationById
|
|
1493
|
+
};
|
|
1494
|
+
//# sourceMappingURL=index.mjs.map
|