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