@wix/auto_sdk_automations_automations-v-2 1.0.8 → 1.0.9

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