@wix/auto_sdk_automations_automations-v-2 1.0.3 → 1.0.5

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 (134) hide show
  1. package/build/{internal/cjs/src/automations-v2-automation-automations-v-2.universal.d.ts → automations-v2-automation-automations-v-2.universal-BVuQcd6J.d.mts} +223 -567
  2. package/build/{cjs/src/automations-v2-automation-automations-v-2.universal.d.ts → automations-v2-automation-automations-v-2.universal-BVuQcd6J.d.ts} +223 -567
  3. package/build/index.d.mts +202 -0
  4. package/build/index.d.ts +202 -0
  5. package/build/index.js +1562 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +1498 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/internal/{es/src/automations-v2-automation-automations-v-2.universal.d.ts → automations-v2-automation-automations-v-2.universal-BVuQcd6J.d.mts} +223 -567
  10. package/build/{es/src/automations-v2-automation-automations-v-2.universal.d.ts → internal/automations-v2-automation-automations-v-2.universal-BVuQcd6J.d.ts} +223 -567
  11. package/build/internal/index.d.mts +202 -0
  12. package/build/internal/index.d.ts +202 -0
  13. package/build/internal/index.js +1562 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +1498 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/internal/meta.d.mts +1167 -0
  18. package/build/internal/meta.d.ts +1167 -0
  19. package/build/internal/meta.js +963 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +920 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/meta.d.mts +1167 -0
  24. package/build/meta.d.ts +1167 -0
  25. package/build/meta.js +963 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +920 -0
  28. package/build/meta.mjs.map +1 -0
  29. package/package.json +13 -12
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/automations-v2-automation-automations-v-2.context.d.ts +0 -37
  40. package/build/cjs/src/automations-v2-automation-automations-v-2.context.js +0 -61
  41. package/build/cjs/src/automations-v2-automation-automations-v-2.context.js.map +0 -1
  42. package/build/cjs/src/automations-v2-automation-automations-v-2.http.d.ts +0 -74
  43. package/build/cjs/src/automations-v2-automation-automations-v-2.http.js +0 -666
  44. package/build/cjs/src/automations-v2-automation-automations-v-2.http.js.map +0 -1
  45. package/build/cjs/src/automations-v2-automation-automations-v-2.meta.d.ts +0 -49
  46. package/build/cjs/src/automations-v2-automation-automations-v-2.meta.js +0 -351
  47. package/build/cjs/src/automations-v2-automation-automations-v-2.meta.js.map +0 -1
  48. package/build/cjs/src/automations-v2-automation-automations-v-2.public.d.ts +0 -172
  49. package/build/cjs/src/automations-v2-automation-automations-v-2.public.js +0 -167
  50. package/build/cjs/src/automations-v2-automation-automations-v-2.public.js.map +0 -1
  51. package/build/cjs/src/automations-v2-automation-automations-v-2.types.d.ts +0 -2222
  52. package/build/cjs/src/automations-v2-automation-automations-v-2.types.js +0 -275
  53. package/build/cjs/src/automations-v2-automation-automations-v-2.types.js.map +0 -1
  54. package/build/cjs/src/automations-v2-automation-automations-v-2.universal.js +0 -1024
  55. package/build/cjs/src/automations-v2-automation-automations-v-2.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/package.json +0 -3
  66. package/build/es/src/automations-v2-automation-automations-v-2.context.d.ts +0 -37
  67. package/build/es/src/automations-v2-automation-automations-v-2.context.js +0 -37
  68. package/build/es/src/automations-v2-automation-automations-v-2.context.js.map +0 -1
  69. package/build/es/src/automations-v2-automation-automations-v-2.http.d.ts +0 -74
  70. package/build/es/src/automations-v2-automation-automations-v-2.http.js +0 -646
  71. package/build/es/src/automations-v2-automation-automations-v-2.http.js.map +0 -1
  72. package/build/es/src/automations-v2-automation-automations-v-2.meta.d.ts +0 -49
  73. package/build/es/src/automations-v2-automation-automations-v-2.meta.js +0 -308
  74. package/build/es/src/automations-v2-automation-automations-v-2.meta.js.map +0 -1
  75. package/build/es/src/automations-v2-automation-automations-v-2.public.d.ts +0 -172
  76. package/build/es/src/automations-v2-automation-automations-v-2.public.js +0 -126
  77. package/build/es/src/automations-v2-automation-automations-v-2.public.js.map +0 -1
  78. package/build/es/src/automations-v2-automation-automations-v-2.types.d.ts +0 -2222
  79. package/build/es/src/automations-v2-automation-automations-v-2.types.js +0 -272
  80. package/build/es/src/automations-v2-automation-automations-v-2.types.js.map +0 -1
  81. package/build/es/src/automations-v2-automation-automations-v-2.universal.js +0 -981
  82. package/build/es/src/automations-v2-automation-automations-v-2.universal.js.map +0 -1
  83. package/build/internal/cjs/index.d.ts +0 -1
  84. package/build/internal/cjs/index.js +0 -18
  85. package/build/internal/cjs/index.js.map +0 -1
  86. package/build/internal/cjs/index.typings.d.ts +0 -1
  87. package/build/internal/cjs/index.typings.js +0 -18
  88. package/build/internal/cjs/index.typings.js.map +0 -1
  89. package/build/internal/cjs/meta.d.ts +0 -1
  90. package/build/internal/cjs/meta.js +0 -18
  91. package/build/internal/cjs/meta.js.map +0 -1
  92. package/build/internal/cjs/src/automations-v2-automation-automations-v-2.context.d.ts +0 -37
  93. package/build/internal/cjs/src/automations-v2-automation-automations-v-2.context.js +0 -61
  94. package/build/internal/cjs/src/automations-v2-automation-automations-v-2.context.js.map +0 -1
  95. package/build/internal/cjs/src/automations-v2-automation-automations-v-2.http.d.ts +0 -74
  96. package/build/internal/cjs/src/automations-v2-automation-automations-v-2.http.js +0 -666
  97. package/build/internal/cjs/src/automations-v2-automation-automations-v-2.http.js.map +0 -1
  98. package/build/internal/cjs/src/automations-v2-automation-automations-v-2.meta.d.ts +0 -49
  99. package/build/internal/cjs/src/automations-v2-automation-automations-v-2.meta.js +0 -351
  100. package/build/internal/cjs/src/automations-v2-automation-automations-v-2.meta.js.map +0 -1
  101. package/build/internal/cjs/src/automations-v2-automation-automations-v-2.public.d.ts +0 -172
  102. package/build/internal/cjs/src/automations-v2-automation-automations-v-2.public.js +0 -167
  103. package/build/internal/cjs/src/automations-v2-automation-automations-v-2.public.js.map +0 -1
  104. package/build/internal/cjs/src/automations-v2-automation-automations-v-2.types.d.ts +0 -2222
  105. package/build/internal/cjs/src/automations-v2-automation-automations-v-2.types.js +0 -275
  106. package/build/internal/cjs/src/automations-v2-automation-automations-v-2.types.js.map +0 -1
  107. package/build/internal/cjs/src/automations-v2-automation-automations-v-2.universal.js +0 -1024
  108. package/build/internal/cjs/src/automations-v2-automation-automations-v-2.universal.js.map +0 -1
  109. package/build/internal/es/index.d.ts +0 -1
  110. package/build/internal/es/index.js +0 -2
  111. package/build/internal/es/index.js.map +0 -1
  112. package/build/internal/es/index.typings.d.ts +0 -1
  113. package/build/internal/es/index.typings.js +0 -2
  114. package/build/internal/es/index.typings.js.map +0 -1
  115. package/build/internal/es/meta.d.ts +0 -1
  116. package/build/internal/es/meta.js +0 -2
  117. package/build/internal/es/meta.js.map +0 -1
  118. package/build/internal/es/src/automations-v2-automation-automations-v-2.context.d.ts +0 -37
  119. package/build/internal/es/src/automations-v2-automation-automations-v-2.context.js +0 -37
  120. package/build/internal/es/src/automations-v2-automation-automations-v-2.context.js.map +0 -1
  121. package/build/internal/es/src/automations-v2-automation-automations-v-2.http.d.ts +0 -74
  122. package/build/internal/es/src/automations-v2-automation-automations-v-2.http.js +0 -646
  123. package/build/internal/es/src/automations-v2-automation-automations-v-2.http.js.map +0 -1
  124. package/build/internal/es/src/automations-v2-automation-automations-v-2.meta.d.ts +0 -49
  125. package/build/internal/es/src/automations-v2-automation-automations-v-2.meta.js +0 -308
  126. package/build/internal/es/src/automations-v2-automation-automations-v-2.meta.js.map +0 -1
  127. package/build/internal/es/src/automations-v2-automation-automations-v-2.public.d.ts +0 -172
  128. package/build/internal/es/src/automations-v2-automation-automations-v-2.public.js +0 -126
  129. package/build/internal/es/src/automations-v2-automation-automations-v-2.public.js.map +0 -1
  130. package/build/internal/es/src/automations-v2-automation-automations-v-2.types.d.ts +0 -2222
  131. package/build/internal/es/src/automations-v2-automation-automations-v-2.types.js +0 -272
  132. package/build/internal/es/src/automations-v2-automation-automations-v-2.types.js.map +0 -1
  133. package/build/internal/es/src/automations-v2-automation-automations-v-2.universal.js +0 -981
  134. package/build/internal/es/src/automations-v2-automation-automations-v-2.universal.js.map +0 -1
@@ -1,1024 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.getAutomationRevision = exports.validateAutomationById = exports.validateAutomation = exports.publishDraftAutomation = exports.deleteDraftAutomation = exports.queryAutomationsWithDrafts = exports.updateDraftAutomation = exports.getOrCreateDraftAutomation = exports.createDraftAutomation = exports.copyAutomation = exports.queryAutomations = exports.generatePreinstalledAutomation = exports.bulkDeleteAutomations = exports.deleteAutomation = exports.updateAutomation = exports.getAutomation = exports.createAutomation = exports.AutomationErrorType = exports.AutomationValidationErrorValidationErrorType = exports.ActionErrorType = exports.ValidationErrorType = exports.ValidationErrorSeverity = exports.TriggerErrorType = exports.TriggerValidationErrorValidationErrorType = exports.DeleteStatus = exports.Namespace = exports.SiteCreatedContext = exports.State = exports.SortOrder = exports.RequestedFields = exports.Language = exports.WebhookIdentityType = exports.Origin = exports.Status = exports.Type = exports.Operator = exports.TimeUnit = exports.Domain = void 0;
27
- const transform_error_1 = require("@wix/sdk-runtime/transform-error");
28
- const query_builder_1 = require("@wix/sdk-runtime/query-builder");
29
- const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
30
- const ambassadorWixAutomationsV2Automation = __importStar(require("./automations-v2-automation-automations-v-2.http.js"));
31
- // @ts-ignore
32
- const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
33
- var Domain;
34
- (function (Domain) {
35
- /** User domain (default). */
36
- Domain["USER"] = "USER";
37
- /** Wix domain. */
38
- Domain["WIX"] = "WIX";
39
- /** Wix account-level domain. */
40
- Domain["WIX_ACCOUNT"] = "WIX_ACCOUNT";
41
- })(Domain || (exports.Domain = Domain = {}));
42
- var TimeUnit;
43
- (function (TimeUnit) {
44
- TimeUnit["UNKNOWN_TIME_UNIT"] = "UNKNOWN_TIME_UNIT";
45
- /** Minutes. */
46
- TimeUnit["MINUTES"] = "MINUTES";
47
- /** Hours. */
48
- TimeUnit["HOURS"] = "HOURS";
49
- /** Days. */
50
- TimeUnit["DAYS"] = "DAYS";
51
- /** Weeks. */
52
- TimeUnit["WEEKS"] = "WEEKS";
53
- /** Months. */
54
- TimeUnit["MONTHS"] = "MONTHS";
55
- })(TimeUnit || (exports.TimeUnit = TimeUnit = {}));
56
- var Operator;
57
- (function (Operator) {
58
- /** Unknown. */
59
- Operator["UNKNOWN_OPERATOR"] = "UNKNOWN_OPERATOR";
60
- /** `OR` operator. */
61
- Operator["OR"] = "OR";
62
- /** `AND` operator. */
63
- Operator["AND"] = "AND";
64
- })(Operator || (exports.Operator = Operator = {}));
65
- var Type;
66
- (function (Type) {
67
- /** Based on the trigger. */
68
- Type["UNKNOWN_ACTION_TYPE"] = "UNKNOWN_ACTION_TYPE";
69
- /** Defined by a [Wix app](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/about-automation-configuration#app-defined-actions). This action type is available in the site dashboard. */
70
- Type["APP_DEFINED"] = "APP_DEFINED";
71
- /** Condition. This determines which action runs next. */
72
- Type["CONDITION"] = "CONDITION";
73
- /** Delay. The automation must wait before executing the next step. */
74
- Type["DELAY"] = "DELAY";
75
- /** Rate-limiter. This stops the automation flow if the subsequent action has reached its maximum allowed executions. */
76
- Type["RATE_LIMIT"] = "RATE_LIMIT";
77
- })(Type || (exports.Type = Type = {}));
78
- var Status;
79
- (function (Status) {
80
- /** Unknown. */
81
- Status["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
82
- /** Active. Active automations can be triggered. */
83
- Status["ACTIVE"] = "ACTIVE";
84
- /** Inactive. Inactive automations cannot be triggered. */
85
- Status["INACTIVE"] = "INACTIVE";
86
- })(Status || (exports.Status = Status = {}));
87
- var Origin;
88
- (function (Origin) {
89
- /** Default value. */
90
- Origin["UNKNOWN_ORIGIN"] = "UNKNOWN_ORIGIN";
91
- /** Created by a [Wix user](https://dev.wix.com/docs/build-apps/get-started/overview/glossary#wix-user). */
92
- Origin["USER"] = "USER";
93
- /** Created by a [Wix app](https://dev.wix.com/docs/build-apps/get-started/overview/glossary#wix-app) for a particular site. */
94
- Origin["APPLICATION"] = "APPLICATION";
95
- /** [Preinstalled automation](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/pre-installed-automations/about-pre-installed-automations). */
96
- Origin["PREINSTALLED"] = "PREINSTALLED";
97
- })(Origin || (exports.Origin = Origin = {}));
98
- var WebhookIdentityType;
99
- (function (WebhookIdentityType) {
100
- WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
101
- WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
102
- WebhookIdentityType["MEMBER"] = "MEMBER";
103
- WebhookIdentityType["WIX_USER"] = "WIX_USER";
104
- WebhookIdentityType["APP"] = "APP";
105
- })(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
106
- var Language;
107
- (function (Language) {
108
- /** Unknown. */
109
- Language["UNKNOWN_LANGUAGE"] = "UNKNOWN_LANGUAGE";
110
- /** `JAVASCRIPT` language. */
111
- Language["JAVASCRIPT"] = "JAVASCRIPT";
112
- })(Language || (exports.Language = Language = {}));
113
- var RequestedFields;
114
- (function (RequestedFields) {
115
- RequestedFields["UNKNOWN_REQUESTED_FIELD"] = "UNKNOWN_REQUESTED_FIELD";
116
- /** whether to return in response `configuration.trigger.override_output_schema` field and in `configuration.actions` the `override_output_schema` field */
117
- RequestedFields["OVERRIDE_SCHEMA"] = "OVERRIDE_SCHEMA";
118
- })(RequestedFields || (exports.RequestedFields = RequestedFields = {}));
119
- var SortOrder;
120
- (function (SortOrder) {
121
- SortOrder["ASC"] = "ASC";
122
- SortOrder["DESC"] = "DESC";
123
- })(SortOrder || (exports.SortOrder = SortOrder = {}));
124
- var State;
125
- (function (State) {
126
- State["UNKNOWN"] = "UNKNOWN";
127
- State["ENABLED"] = "ENABLED";
128
- State["DISABLED"] = "DISABLED";
129
- State["PENDING"] = "PENDING";
130
- State["DEMO"] = "DEMO";
131
- })(State || (exports.State = State = {}));
132
- var SiteCreatedContext;
133
- (function (SiteCreatedContext) {
134
- /** A valid option, we don't expose all reasons why site might be created. */
135
- SiteCreatedContext["OTHER"] = "OTHER";
136
- /** A meta site was created from template. */
137
- SiteCreatedContext["FROM_TEMPLATE"] = "FROM_TEMPLATE";
138
- /** A meta site was created by copying of the transfferred meta site. */
139
- SiteCreatedContext["DUPLICATE_BY_SITE_TRANSFER"] = "DUPLICATE_BY_SITE_TRANSFER";
140
- /** A copy of existing meta site. */
141
- SiteCreatedContext["DUPLICATE"] = "DUPLICATE";
142
- /** A meta site was created as a transfferred site (copy of the original), old flow, should die soon. */
143
- SiteCreatedContext["OLD_SITE_TRANSFER"] = "OLD_SITE_TRANSFER";
144
- /** deprecated A meta site was created for Flash editor. */
145
- SiteCreatedContext["FLASH"] = "FLASH";
146
- })(SiteCreatedContext || (exports.SiteCreatedContext = SiteCreatedContext = {}));
147
- var Namespace;
148
- (function (Namespace) {
149
- Namespace["UNKNOWN_NAMESPACE"] = "UNKNOWN_NAMESPACE";
150
- /** Default namespace for UGC sites. MetaSites with this namespace will be shown in a user's site list by default. */
151
- Namespace["WIX"] = "WIX";
152
- /** ShoutOut stand alone product. These are siteless (no actual Wix site, no HtmlWeb). MetaSites with this namespace will *not* be shown in a user's site list by default. */
153
- Namespace["SHOUT_OUT"] = "SHOUT_OUT";
154
- /** MetaSites created by the Albums product, they appear as part of the Albums app. MetaSites with this namespace will *not* be shown in a user's site list by default. */
155
- Namespace["ALBUMS"] = "ALBUMS";
156
- /** Part of the WixStores migration flow, a user tries to migrate and gets this site to view and if the user likes it then stores removes this namespace and deletes the old site with the old stores. MetaSites with this namespace will *not* be shown in a user's site list by default. */
157
- Namespace["WIX_STORES_TEST_DRIVE"] = "WIX_STORES_TEST_DRIVE";
158
- /** Hotels standalone (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
159
- Namespace["HOTELS"] = "HOTELS";
160
- /** Clubs siteless MetaSites, a club without a wix website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
161
- Namespace["CLUBS"] = "CLUBS";
162
- /** A partially created ADI website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
163
- Namespace["ONBOARDING_DRAFT"] = "ONBOARDING_DRAFT";
164
- /** AppBuilder for AppStudio / shmite (c). MetaSites with this namespace will *not* be shown in a user's site list by default. */
165
- Namespace["DEV_SITE"] = "DEV_SITE";
166
- /** LogoMaker websites offered to the user after logo purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
167
- Namespace["LOGOS"] = "LOGOS";
168
- /** VideoMaker websites offered to the user after video purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
169
- Namespace["VIDEO_MAKER"] = "VIDEO_MAKER";
170
- /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
171
- Namespace["PARTNER_DASHBOARD"] = "PARTNER_DASHBOARD";
172
- /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
173
- Namespace["DEV_CENTER_COMPANY"] = "DEV_CENTER_COMPANY";
174
- /**
175
- * A draft created by HTML editor on open. Upon "first save" it will be moved to be of WIX domain.
176
- *
177
- * Meta site with this namespace will *not* be shown in a user's site list by default.
178
- */
179
- Namespace["HTML_DRAFT"] = "HTML_DRAFT";
180
- /**
181
- * the user-journey for Fitness users who want to start from managing their business instead of designing their website.
182
- * Will be accessible from Site List and will not have a website app.
183
- * Once the user attaches a site, the site will become a regular wixsite.
184
- */
185
- Namespace["SITELESS_BUSINESS"] = "SITELESS_BUSINESS";
186
- /** Belongs to "strategic products" company. Supports new product in the creator's economy space. */
187
- Namespace["CREATOR_ECONOMY"] = "CREATOR_ECONOMY";
188
- /** It is to be used in the Business First efforts. */
189
- Namespace["DASHBOARD_FIRST"] = "DASHBOARD_FIRST";
190
- /** Bookings business flow with no site. */
191
- Namespace["ANYWHERE"] = "ANYWHERE";
192
- /** Namespace for Headless Backoffice with no editor */
193
- Namespace["HEADLESS"] = "HEADLESS";
194
- /**
195
- * Namespace for master site that will exist in parent account that will be referenced by subaccounts
196
- * The site will be used for account level CSM feature for enterprise
197
- */
198
- Namespace["ACCOUNT_MASTER_CMS"] = "ACCOUNT_MASTER_CMS";
199
- /** Rise.ai Siteless account management for Gift Cards and Store Credit. */
200
- Namespace["RISE"] = "RISE";
201
- /**
202
- * As part of the branded app new funnel, users now can create a meta site that will be branded app first.
203
- * There's a blank site behind the scene but it's blank).
204
- * The Mobile company will be the owner of this namespace.
205
- */
206
- Namespace["BRANDED_FIRST"] = "BRANDED_FIRST";
207
- /** Nownia.com Siteless account management for Ai Scheduling Assistant. */
208
- Namespace["NOWNIA"] = "NOWNIA";
209
- /**
210
- * UGC Templates are templates that are created by users for personal use and to sale to other users.
211
- * The Partners company owns this namespace.
212
- */
213
- Namespace["UGC_TEMPLATE"] = "UGC_TEMPLATE";
214
- /** Codux Headless Sites */
215
- Namespace["CODUX"] = "CODUX";
216
- /** Bobb - AI Design Creator. */
217
- Namespace["MEDIA_DESIGN_CREATOR"] = "MEDIA_DESIGN_CREATOR";
218
- /**
219
- * Shared Blog Site is a unique single site across Enterprise account,
220
- * This site will hold all Blog posts related to the Marketing product.
221
- */
222
- Namespace["SHARED_BLOG_ENTERPRISE"] = "SHARED_BLOG_ENTERPRISE";
223
- /** Standalone forms (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
224
- Namespace["STANDALONE_FORMS"] = "STANDALONE_FORMS";
225
- /** Standalone events (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
226
- Namespace["STANDALONE_EVENTS"] = "STANDALONE_EVENTS";
227
- /** MIMIR - Siteless account for MIMIR Ai Job runner. */
228
- Namespace["MIMIR"] = "MIMIR";
229
- })(Namespace || (exports.Namespace = Namespace = {}));
230
- var DeleteStatus;
231
- (function (DeleteStatus) {
232
- DeleteStatus["UNKNOWN"] = "UNKNOWN";
233
- DeleteStatus["TRASH"] = "TRASH";
234
- DeleteStatus["DELETED"] = "DELETED";
235
- DeleteStatus["PENDING_PURGE"] = "PENDING_PURGE";
236
- DeleteStatus["PURGED_EXTERNALLY"] = "PURGED_EXTERNALLY";
237
- })(DeleteStatus || (exports.DeleteStatus = DeleteStatus = {}));
238
- var TriggerValidationErrorValidationErrorType;
239
- (function (TriggerValidationErrorValidationErrorType) {
240
- TriggerValidationErrorValidationErrorType["UNKNOWN_VALIDATION_ERROR_TYPE"] = "UNKNOWN_VALIDATION_ERROR_TYPE";
241
- /** Configuration error. */
242
- TriggerValidationErrorValidationErrorType["CONFIGURATION_ERROR"] = "CONFIGURATION_ERROR";
243
- /** Provider error. */
244
- TriggerValidationErrorValidationErrorType["PROVIDER_ERROR"] = "PROVIDER_ERROR";
245
- })(TriggerValidationErrorValidationErrorType || (exports.TriggerValidationErrorValidationErrorType = TriggerValidationErrorValidationErrorType = {}));
246
- var TriggerErrorType;
247
- (function (TriggerErrorType) {
248
- TriggerErrorType["UNKNOWN_TRIGGER_ERROR_TYPE"] = "UNKNOWN_TRIGGER_ERROR_TYPE";
249
- /** Trigger not found. */
250
- TriggerErrorType["NOT_FOUND"] = "NOT_FOUND";
251
- /** App not installed. */
252
- TriggerErrorType["APP_NOT_INSTALLED"] = "APP_NOT_INSTALLED";
253
- /** Moderation mismatch. */
254
- TriggerErrorType["MODERATION_MISMATCH"] = "MODERATION_MISMATCH";
255
- /** Deprecated. */
256
- TriggerErrorType["DEPRECATED"] = "DEPRECATED";
257
- /** Invalid trigger key. */
258
- TriggerErrorType["INVALID_TRIGGER_KEY"] = "INVALID_TRIGGER_KEY";
259
- /** Invalid filter field key. */
260
- TriggerErrorType["INVALID_FILTER_FIELD_KEY"] = "INVALID_FILTER_FIELD_KEY";
261
- /** Invalid filter expression. */
262
- TriggerErrorType["INVALID_FILTER_EXPRESSION"] = "INVALID_FILTER_EXPRESSION";
263
- })(TriggerErrorType || (exports.TriggerErrorType = TriggerErrorType = {}));
264
- var ValidationErrorSeverity;
265
- (function (ValidationErrorSeverity) {
266
- ValidationErrorSeverity["UNKNOWN_VALIDATION_ERROR_SEVERITY"] = "UNKNOWN_VALIDATION_ERROR_SEVERITY";
267
- /** Warning. */
268
- ValidationErrorSeverity["WARNING"] = "WARNING";
269
- /** Error. */
270
- ValidationErrorSeverity["ERROR"] = "ERROR";
271
- })(ValidationErrorSeverity || (exports.ValidationErrorSeverity = ValidationErrorSeverity = {}));
272
- var ValidationErrorType;
273
- (function (ValidationErrorType) {
274
- ValidationErrorType["UNKNOWN_VALIDATION_ERROR_TYPE"] = "UNKNOWN_VALIDATION_ERROR_TYPE";
275
- /** Configuration error. */
276
- ValidationErrorType["CONFIGURATION_ERROR"] = "CONFIGURATION_ERROR";
277
- /** Provider error. */
278
- ValidationErrorType["PROVIDER_ERROR"] = "PROVIDER_ERROR";
279
- })(ValidationErrorType || (exports.ValidationErrorType = ValidationErrorType = {}));
280
- var ActionErrorType;
281
- (function (ActionErrorType) {
282
- ActionErrorType["UNKNOWN_ACTION_ERROR_TYPE"] = "UNKNOWN_ACTION_ERROR_TYPE";
283
- ActionErrorType["NOT_FOUND"] = "NOT_FOUND";
284
- ActionErrorType["APP_NOT_INSTALLED"] = "APP_NOT_INSTALLED";
285
- ActionErrorType["MODERATION_MISMATCH"] = "MODERATION_MISMATCH";
286
- ActionErrorType["DEPRECATED"] = "DEPRECATED";
287
- ActionErrorType["INVALID_ACTION_KEY"] = "INVALID_ACTION_KEY";
288
- ActionErrorType["INVALID_MAPPING"] = "INVALID_MAPPING";
289
- ActionErrorType["MAPPING_TYPE_MISMATCH"] = "MAPPING_TYPE_MISMATCH";
290
- ActionErrorType["MAPPING_MISSING_REQUIRED_FIELD"] = "MAPPING_MISSING_REQUIRED_FIELD";
291
- ActionErrorType["MAPPING_SCHEMA_MISMATCH"] = "MAPPING_SCHEMA_MISMATCH";
292
- ActionErrorType["MAPPING_VARIABLE_MISSING_FROM_SCHEMA"] = "MAPPING_VARIABLE_MISSING_FROM_SCHEMA";
293
- })(ActionErrorType || (exports.ActionErrorType = ActionErrorType = {}));
294
- var AutomationValidationErrorValidationErrorType;
295
- (function (AutomationValidationErrorValidationErrorType) {
296
- AutomationValidationErrorValidationErrorType["UNKNOWN_VALIDATION_ERROR_TYPE"] = "UNKNOWN_VALIDATION_ERROR_TYPE";
297
- AutomationValidationErrorValidationErrorType["CONFIGURATION_ERROR"] = "CONFIGURATION_ERROR";
298
- AutomationValidationErrorValidationErrorType["PROVIDER_ERROR"] = "PROVIDER_ERROR";
299
- })(AutomationValidationErrorValidationErrorType || (exports.AutomationValidationErrorValidationErrorType = AutomationValidationErrorValidationErrorType = {}));
300
- var AutomationErrorType;
301
- (function (AutomationErrorType) {
302
- AutomationErrorType["UNKNOWN_AUTOMATION_ERROR_TYPE"] = "UNKNOWN_AUTOMATION_ERROR_TYPE";
303
- })(AutomationErrorType || (exports.AutomationErrorType = AutomationErrorType = {}));
304
- /**
305
- * Creates an automation.
306
- * @param automation - Automation to create.
307
- * @public
308
- * @documentationMaturity preview
309
- * @requiredField automation
310
- * @requiredField automation.configuration
311
- * @requiredField automation.configuration.actions
312
- * @requiredField automation.configuration.rootActionIds
313
- * @requiredField automation.configuration.status
314
- * @requiredField automation.configuration.trigger
315
- * @requiredField automation.configuration.trigger.appId
316
- * @requiredField automation.configuration.trigger.triggerKey
317
- * @requiredField automation.name
318
- * @requiredField automation.origin
319
- * @permissionId AUTOMATIONS.AUTOMATION_CREATE
320
- * @permissionScope Manage Stores
321
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
322
- * @permissionScope Set Up Automations
323
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
324
- * @applicableIdentity APP
325
- * @returns Details of the created automation.
326
- * @fqn wix.automations.v2.AutomationsService.CreateAutomation
327
- */
328
- async function createAutomation(automation) {
329
- // @ts-ignore
330
- const { httpClient, sideEffects } = arguments[1];
331
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
332
- automation: automation,
333
- });
334
- const reqOpts = ambassadorWixAutomationsV2Automation.createAutomation(payload);
335
- sideEffects?.onSiteCall?.();
336
- try {
337
- const result = await httpClient.request(reqOpts);
338
- sideEffects?.onSuccess?.(result);
339
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.automation;
340
- }
341
- catch (err) {
342
- const transformedError = (0, transform_error_1.transformError)(err, {
343
- spreadPathsToArguments: {},
344
- explicitPathsToArguments: { automation: '$[0]' },
345
- singleArgumentUnchanged: false,
346
- }, ['automation']);
347
- sideEffects?.onError?.(err);
348
- throw transformedError;
349
- }
350
- }
351
- exports.createAutomation = createAutomation;
352
- /**
353
- * Retrieves an automation by ID.
354
- * @param automationId - Automation ID.
355
- * @public
356
- * @documentationMaturity preview
357
- * @requiredField automationId
358
- * @permissionId AUTOMATIONS.AUTOMATION_READ
359
- * @permissionScope Manage Stores
360
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
361
- * @permissionScope Set Up Automations
362
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
363
- * @applicableIdentity APP
364
- * @returns Retrieved automation.
365
- * @fqn wix.automations.v2.AutomationsService.GetAutomation
366
- */
367
- async function getAutomation(automationId) {
368
- // @ts-ignore
369
- const { httpClient, sideEffects } = arguments[1];
370
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
371
- automationId: automationId,
372
- });
373
- const reqOpts = ambassadorWixAutomationsV2Automation.getAutomation(payload);
374
- sideEffects?.onSiteCall?.();
375
- try {
376
- const result = await httpClient.request(reqOpts);
377
- sideEffects?.onSuccess?.(result);
378
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.automation;
379
- }
380
- catch (err) {
381
- const transformedError = (0, transform_error_1.transformError)(err, {
382
- spreadPathsToArguments: {},
383
- explicitPathsToArguments: { automationId: '$[0]' },
384
- singleArgumentUnchanged: false,
385
- }, ['automationId']);
386
- sideEffects?.onError?.(err);
387
- throw transformedError;
388
- }
389
- }
390
- exports.getAutomation = getAutomation;
391
- /**
392
- * Updates the specified automation.
393
- *
394
- * When an automation is updated, its `revision` property is incremented by 1. When updating an automation, you must specify the current revision number.
395
- * @param _id - Automation ID.
396
- * @public
397
- * @documentationMaturity preview
398
- * @requiredField _id
399
- * @requiredField automation
400
- * @requiredField automation.revision
401
- * @permissionId AUTOMATIONS.AUTOMATION_UPDATE
402
- * @permissionScope Manage Stores
403
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
404
- * @permissionScope Set Up Automations
405
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
406
- * @applicableIdentity APP
407
- * @returns Updated automation.
408
- * @fqn wix.automations.v2.AutomationsService.UpdateAutomation
409
- */
410
- async function updateAutomation(_id, automation) {
411
- // @ts-ignore
412
- const { httpClient, sideEffects } = arguments[2];
413
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
414
- automation: { ...automation, id: _id },
415
- });
416
- const reqOpts = ambassadorWixAutomationsV2Automation.updateAutomation(payload);
417
- sideEffects?.onSiteCall?.();
418
- try {
419
- const result = await httpClient.request(reqOpts);
420
- sideEffects?.onSuccess?.(result);
421
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data)?.automation;
422
- }
423
- catch (err) {
424
- const transformedError = (0, transform_error_1.transformError)(err, {
425
- spreadPathsToArguments: { automation: '$[1]' },
426
- explicitPathsToArguments: { 'automation.id': '$[0]' },
427
- singleArgumentUnchanged: false,
428
- }, ['_id', 'automation']);
429
- sideEffects?.onError?.(err);
430
- throw transformedError;
431
- }
432
- }
433
- exports.updateAutomation = updateAutomation;
434
- /**
435
- * Deletes the specified automation.
436
- * @param automationId - Automation ID.
437
- * @public
438
- * @documentationMaturity preview
439
- * @requiredField automationId
440
- * @permissionId AUTOMATIONS.AUTOMATION_DELETE
441
- * @permissionScope Manage Stores
442
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
443
- * @permissionScope Set Up Automations
444
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
445
- * @applicableIdentity APP
446
- * @fqn wix.automations.v2.AutomationsService.DeleteAutomation
447
- */
448
- async function deleteAutomation(automationId) {
449
- // @ts-ignore
450
- const { httpClient, sideEffects } = arguments[1];
451
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
452
- automationId: automationId,
453
- });
454
- const reqOpts = ambassadorWixAutomationsV2Automation.deleteAutomation(payload);
455
- sideEffects?.onSiteCall?.();
456
- try {
457
- const result = await httpClient.request(reqOpts);
458
- sideEffects?.onSuccess?.(result);
459
- }
460
- catch (err) {
461
- const transformedError = (0, transform_error_1.transformError)(err, {
462
- spreadPathsToArguments: {},
463
- explicitPathsToArguments: { automationId: '$[0]' },
464
- singleArgumentUnchanged: false,
465
- }, ['automationId']);
466
- sideEffects?.onError?.(err);
467
- throw transformedError;
468
- }
469
- }
470
- exports.deleteAutomation = deleteAutomation;
471
- /**
472
- * Deletes one or more automations.
473
- * @param automationIds - IDs of the automations to delete.
474
- * @public
475
- * @documentationMaturity preview
476
- * @requiredField automationIds
477
- * @permissionId AUTOMATIONS.AUTOMATION_DELETE
478
- * @permissionScope Manage Stores
479
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
480
- * @permissionScope Set Up Automations
481
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
482
- * @applicableIdentity APP
483
- * @fqn wix.automations.v2.AutomationsService.BulkDeleteAutomations
484
- */
485
- async function bulkDeleteAutomations(automationIds) {
486
- // @ts-ignore
487
- const { httpClient, sideEffects } = arguments[1];
488
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
489
- automationIds: automationIds,
490
- });
491
- const reqOpts = ambassadorWixAutomationsV2Automation.bulkDeleteAutomations(payload);
492
- sideEffects?.onSiteCall?.();
493
- try {
494
- const result = await httpClient.request(reqOpts);
495
- sideEffects?.onSuccess?.(result);
496
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
497
- }
498
- catch (err) {
499
- const transformedError = (0, transform_error_1.transformError)(err, {
500
- spreadPathsToArguments: {},
501
- explicitPathsToArguments: { automationIds: '$[0]' },
502
- singleArgumentUnchanged: false,
503
- }, ['automationIds']);
504
- sideEffects?.onError?.(err);
505
- throw transformedError;
506
- }
507
- }
508
- exports.bulkDeleteAutomations = bulkDeleteAutomations;
509
- /**
510
- * Generates a preinstalled automation from another automation.
511
- *
512
- * Calls the action providers for changes needed to make a preinstalled automation, such as changes made to email template.
513
- *
514
- * > **Note**: You must have an account permission to edit an app.
515
- * @param automation - Automation.
516
- * @public
517
- * @documentationMaturity preview
518
- * @requiredField automation
519
- * @fqn wix.automations.v2.AutomationsService.GeneratePreinstalledAutomation
520
- */
521
- async function generatePreinstalledAutomation(automation, options) {
522
- // @ts-ignore
523
- const { httpClient, sideEffects } = arguments[2];
524
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
525
- automation: automation,
526
- appId: options?.appId,
527
- });
528
- const reqOpts = ambassadorWixAutomationsV2Automation.generatePreinstalledAutomation(payload);
529
- sideEffects?.onSiteCall?.();
530
- try {
531
- const result = await httpClient.request(reqOpts);
532
- sideEffects?.onSuccess?.(result);
533
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
534
- }
535
- catch (err) {
536
- const transformedError = (0, transform_error_1.transformError)(err, {
537
- spreadPathsToArguments: {},
538
- explicitPathsToArguments: { automation: '$[0]', appId: '$[1].appId' },
539
- singleArgumentUnchanged: false,
540
- }, ['automation', 'options']);
541
- sideEffects?.onError?.(err);
542
- throw transformedError;
543
- }
544
- }
545
- exports.generatePreinstalledAutomation = generatePreinstalledAutomation;
546
- /**
547
- * Retrieves a list of automations. This includes both automations overridden on a site and preinstalled automations. If a preinstalled automation has been overridden on the site, the method returns the override automation.
548
- *
549
- * > **Note**: The method only returns automations by apps installed on the site.
550
- *
551
- * Learn more about [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
552
- * @public
553
- * @documentationMaturity preview
554
- * @permissionScope Manage Stores
555
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
556
- * @permissionScope Set Up Automations
557
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
558
- * @permissionId AUTOMATIONS.AUTOMATION_READ
559
- * @applicableIdentity APP
560
- * @fqn wix.automations.v2.AutomationsService.QueryAutomations
561
- */
562
- function queryAutomations(options) {
563
- // @ts-ignore
564
- const { httpClient, sideEffects } = arguments[1];
565
- return (0, query_builder_1.queryBuilder)({
566
- func: async (payload) => {
567
- const reqOpts = ambassadorWixAutomationsV2Automation.queryAutomations({
568
- ...payload,
569
- ...(options ?? {}),
570
- });
571
- sideEffects?.onSiteCall?.();
572
- try {
573
- const result = await httpClient.request(reqOpts);
574
- sideEffects?.onSuccess?.(result);
575
- return result;
576
- }
577
- catch (err) {
578
- sideEffects?.onError?.(err);
579
- throw err;
580
- }
581
- },
582
- requestTransformer: (query) => {
583
- const args = [query, options];
584
- return (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
585
- ...args?.[1],
586
- query: args?.[0],
587
- });
588
- },
589
- responseTransformer: ({ data }) => {
590
- const transformedData = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(data, []));
591
- return {
592
- items: transformedData?.automations,
593
- pagingMetadata: transformedData?.pagingMetadata,
594
- };
595
- },
596
- errorTransformer: (err) => {
597
- const transformedError = (0, transform_error_1.transformError)(err, {
598
- spreadPathsToArguments: {},
599
- explicitPathsToArguments: { query: '$[0]' },
600
- singleArgumentUnchanged: false,
601
- });
602
- throw transformedError;
603
- },
604
- pagingMethod: 'CURSOR',
605
- transformationPaths: {},
606
- });
607
- }
608
- exports.queryAutomations = queryAutomations;
609
- /**
610
- * Creates a copy of an action with a new ID, and changes the action's input mapping if necessary.
611
- *
612
- * The action copy isn't saved automatically. To save it, the user must perform an action
613
- * such as clicking the **Save** button.
614
- * @param automationId - ID of the automation to copy.
615
- * @public
616
- * @documentationMaturity preview
617
- * @requiredField automationId
618
- * @permissionId AUTOMATIONS.AUTOMATION_COPY
619
- * @permissionScope Manage Stores
620
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
621
- * @permissionScope Set Up Automations
622
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
623
- * @applicableIdentity APP
624
- * @fqn wix.automations.v2.AutomationsService.CopyAutomation
625
- */
626
- async function copyAutomation(automationId, options) {
627
- // @ts-ignore
628
- const { httpClient, sideEffects } = arguments[2];
629
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
630
- automationId: automationId,
631
- origin: options?.origin,
632
- automation: options?.automation,
633
- });
634
- const reqOpts = ambassadorWixAutomationsV2Automation.copyAutomation(payload);
635
- sideEffects?.onSiteCall?.();
636
- try {
637
- const result = await httpClient.request(reqOpts);
638
- sideEffects?.onSuccess?.(result);
639
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
640
- }
641
- catch (err) {
642
- const transformedError = (0, transform_error_1.transformError)(err, {
643
- spreadPathsToArguments: {},
644
- explicitPathsToArguments: {
645
- automationId: '$[0]',
646
- origin: '$[1].origin',
647
- automation: '$[1].automation',
648
- },
649
- singleArgumentUnchanged: false,
650
- }, ['automationId', 'options']);
651
- sideEffects?.onError?.(err);
652
- throw transformedError;
653
- }
654
- }
655
- exports.copyAutomation = copyAutomation;
656
- /**
657
- * Creates a draft automation.
658
- * @public
659
- * @documentationMaturity preview
660
- * @permissionId AUTOMATIONS.AUTOMATION_DRAFT_CREATE
661
- * @permissionScope Manage Stores
662
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
663
- * @permissionScope Set Up Automations
664
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
665
- * @applicableIdentity APP
666
- * @fqn wix.automations.v2.AutomationsService.CreateDraftAutomation
667
- */
668
- async function createDraftAutomation(options) {
669
- // @ts-ignore
670
- const { httpClient, sideEffects } = arguments[1];
671
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
672
- automation: options?.automation,
673
- });
674
- const reqOpts = ambassadorWixAutomationsV2Automation.createDraftAutomation(payload);
675
- sideEffects?.onSiteCall?.();
676
- try {
677
- const result = await httpClient.request(reqOpts);
678
- sideEffects?.onSuccess?.(result);
679
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
680
- }
681
- catch (err) {
682
- const transformedError = (0, transform_error_1.transformError)(err, {
683
- spreadPathsToArguments: {},
684
- explicitPathsToArguments: { automation: '$[0].automation' },
685
- singleArgumentUnchanged: false,
686
- }, ['options']);
687
- sideEffects?.onError?.(err);
688
- throw transformedError;
689
- }
690
- }
691
- exports.createDraftAutomation = createDraftAutomation;
692
- /**
693
- * Retrieves the draft of the specified automation. If a draft doesn't exist, the method creates one.
694
- *
695
- * > **Note**: If the specified automation is a draft, the method returns it.
696
- * @param originalAutomationId - ID of the original automation on which the draft is based.
697
- * @public
698
- * @documentationMaturity preview
699
- * @requiredField originalAutomationId
700
- * @permissionId AUTOMATIONS.AUTOMATION_DRAFT_CREATE
701
- * @permissionScope Manage Stores
702
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
703
- * @permissionScope Set Up Automations
704
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
705
- * @applicableIdentity APP
706
- * @fqn wix.automations.v2.AutomationsService.GetOrCreateDraftAutomation
707
- */
708
- async function getOrCreateDraftAutomation(originalAutomationId) {
709
- // @ts-ignore
710
- const { httpClient, sideEffects } = arguments[1];
711
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
712
- originalAutomationId: originalAutomationId,
713
- });
714
- const reqOpts = ambassadorWixAutomationsV2Automation.getOrCreateDraftAutomation(payload);
715
- sideEffects?.onSiteCall?.();
716
- try {
717
- const result = await httpClient.request(reqOpts);
718
- sideEffects?.onSuccess?.(result);
719
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
720
- }
721
- catch (err) {
722
- const transformedError = (0, transform_error_1.transformError)(err, {
723
- spreadPathsToArguments: {},
724
- explicitPathsToArguments: { originalAutomationId: '$[0]' },
725
- singleArgumentUnchanged: false,
726
- }, ['originalAutomationId']);
727
- sideEffects?.onError?.(err);
728
- throw transformedError;
729
- }
730
- }
731
- exports.getOrCreateDraftAutomation = getOrCreateDraftAutomation;
732
- /**
733
- * Updates a draft automation.
734
- * @param _id - Automation ID.
735
- * @public
736
- * @documentationMaturity preview
737
- * @requiredField _id
738
- * @requiredField automation
739
- * @permissionId AUTOMATIONS.AUTOMATION_DRAFT_UPDATE
740
- * @permissionScope Manage Stores
741
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
742
- * @permissionScope Set Up Automations
743
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
744
- * @applicableIdentity APP
745
- * @fqn wix.automations.v2.AutomationsService.UpdateDraftAutomation
746
- */
747
- async function updateDraftAutomation(_id, automation) {
748
- // @ts-ignore
749
- const { httpClient, sideEffects } = arguments[2];
750
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
751
- automation: { ...automation, id: _id },
752
- });
753
- const reqOpts = ambassadorWixAutomationsV2Automation.updateDraftAutomation(payload);
754
- sideEffects?.onSiteCall?.();
755
- try {
756
- const result = await httpClient.request(reqOpts);
757
- sideEffects?.onSuccess?.(result);
758
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
759
- }
760
- catch (err) {
761
- const transformedError = (0, transform_error_1.transformError)(err, {
762
- spreadPathsToArguments: { automation: '$[1]' },
763
- explicitPathsToArguments: { 'automation.id': '$[0]' },
764
- singleArgumentUnchanged: false,
765
- }, ['_id', 'automation']);
766
- sideEffects?.onError?.(err);
767
- throw transformedError;
768
- }
769
- }
770
- exports.updateDraftAutomation = updateDraftAutomation;
771
- /**
772
- * Retrieves a list of automations, including drafts. Max query filter depth is 3.
773
- *
774
- * Relevant automations for the query are returned. This includes automations created on the site and pre-installed automations.
775
- * If there's an existing override for a pre-installed automation, the override is returned in the query result.
776
- * The query only returns automations from apps that are installed on the site.
777
- *
778
- * - new drafts that are not related to existing automations will be returned in the list
779
- * - the response will contain a map of originalAutomationId => relatedDrafts
780
- *
781
- * To learn about working with _Query_ endpoints, see
782
- * [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
783
- * [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination),
784
- * and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
785
- * @public
786
- * @documentationMaturity preview
787
- * @permissionId AUTOMATIONS.AUTOMATION_DRAFT_READ
788
- * @permissionScope Manage Stores
789
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
790
- * @permissionScope Manage Restaurants - all permissions
791
- * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
792
- * @permissionScope Set Up Automations
793
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
794
- * @applicableIdentity APP
795
- * @fqn wix.automations.v2.AutomationsService.QueryAutomationsWithDrafts
796
- */
797
- async function queryAutomationsWithDrafts(options) {
798
- // @ts-ignore
799
- const { httpClient, sideEffects } = arguments[1];
800
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
801
- query: options?.query,
802
- });
803
- const reqOpts = ambassadorWixAutomationsV2Automation.queryAutomationsWithDrafts(payload);
804
- sideEffects?.onSiteCall?.();
805
- try {
806
- const result = await httpClient.request(reqOpts);
807
- sideEffects?.onSuccess?.(result);
808
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
809
- }
810
- catch (err) {
811
- const transformedError = (0, transform_error_1.transformError)(err, {
812
- spreadPathsToArguments: {},
813
- explicitPathsToArguments: { query: '$[0].query' },
814
- singleArgumentUnchanged: false,
815
- }, ['options']);
816
- sideEffects?.onError?.(err);
817
- throw transformedError;
818
- }
819
- }
820
- exports.queryAutomationsWithDrafts = queryAutomationsWithDrafts;
821
- /**
822
- * Deletes a draft automation.
823
- * @param automationId - ID of the draft automation to delete.
824
- * @public
825
- * @documentationMaturity preview
826
- * @requiredField automationId
827
- * @permissionId AUTOMATIONS.AUTOMATION_DRAFT_DELETE
828
- * @permissionScope Manage Stores
829
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
830
- * @permissionScope Set Up Automations
831
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
832
- * @applicableIdentity APP
833
- * @fqn wix.automations.v2.AutomationsService.DeleteDraftAutomation
834
- */
835
- async function deleteDraftAutomation(automationId) {
836
- // @ts-ignore
837
- const { httpClient, sideEffects } = arguments[1];
838
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
839
- automationId: automationId,
840
- });
841
- const reqOpts = ambassadorWixAutomationsV2Automation.deleteDraftAutomation(payload);
842
- sideEffects?.onSiteCall?.();
843
- try {
844
- const result = await httpClient.request(reqOpts);
845
- sideEffects?.onSuccess?.(result);
846
- }
847
- catch (err) {
848
- const transformedError = (0, transform_error_1.transformError)(err, {
849
- spreadPathsToArguments: {},
850
- explicitPathsToArguments: { automationId: '$[0]' },
851
- singleArgumentUnchanged: false,
852
- }, ['automationId']);
853
- sideEffects?.onError?.(err);
854
- throw transformedError;
855
- }
856
- }
857
- exports.deleteDraftAutomation = deleteDraftAutomation;
858
- /**
859
- * Publishes a draft automation. This applies any changes to the live automation.
860
- * @param automationId - ID of the draft automation to publish.
861
- * @public
862
- * @documentationMaturity preview
863
- * @requiredField automationId
864
- * @permissionId AUTOMATIONS.AUTOMATION_UPDATE
865
- * @permissionScope Manage Stores
866
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
867
- * @permissionScope Set Up Automations
868
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
869
- * @applicableIdentity APP
870
- * @fqn wix.automations.v2.AutomationsService.PublishDraftAutomation
871
- */
872
- async function publishDraftAutomation(automationId) {
873
- // @ts-ignore
874
- const { httpClient, sideEffects } = arguments[1];
875
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
876
- automationId: automationId,
877
- });
878
- const reqOpts = ambassadorWixAutomationsV2Automation.publishDraftAutomation(payload);
879
- sideEffects?.onSiteCall?.();
880
- try {
881
- const result = await httpClient.request(reqOpts);
882
- sideEffects?.onSuccess?.(result);
883
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
884
- }
885
- catch (err) {
886
- const transformedError = (0, transform_error_1.transformError)(err, {
887
- spreadPathsToArguments: {},
888
- explicitPathsToArguments: { automationId: '$[0]' },
889
- singleArgumentUnchanged: false,
890
- }, ['automationId']);
891
- sideEffects?.onError?.(err);
892
- throw transformedError;
893
- }
894
- }
895
- exports.publishDraftAutomation = publishDraftAutomation;
896
- /**
897
- * Validates the specified automation.
898
- * @param automation - Automation to validate.
899
- * @public
900
- * @documentationMaturity preview
901
- * @requiredField automation
902
- * @permissionId AUTOMATIONS.AUTOMATION_VALIDATE
903
- * @permissionScope Manage Stores
904
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
905
- * @permissionScope Set Up Automations
906
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
907
- * @applicableIdentity APP
908
- * @fqn wix.automations.v2.AutomationsService.ValidateAutomation
909
- */
910
- async function validateAutomation(automation, options) {
911
- // @ts-ignore
912
- const { httpClient, sideEffects } = arguments[2];
913
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
914
- automation: automation,
915
- validationSettings: options?.validationSettings,
916
- });
917
- const reqOpts = ambassadorWixAutomationsV2Automation.validateAutomation(payload);
918
- sideEffects?.onSiteCall?.();
919
- try {
920
- const result = await httpClient.request(reqOpts);
921
- sideEffects?.onSuccess?.(result);
922
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
923
- }
924
- catch (err) {
925
- const transformedError = (0, transform_error_1.transformError)(err, {
926
- spreadPathsToArguments: {},
927
- explicitPathsToArguments: {
928
- automation: '$[0]',
929
- validationSettings: '$[1].validationSettings',
930
- },
931
- singleArgumentUnchanged: false,
932
- }, ['automation', 'options']);
933
- sideEffects?.onError?.(err);
934
- throw transformedError;
935
- }
936
- }
937
- exports.validateAutomation = validateAutomation;
938
- /**
939
- * Validates the automation specified by ID.
940
- * @param automationId - Automation ID.
941
- * @public
942
- * @documentationMaturity preview
943
- * @requiredField automationId
944
- * @permissionId AUTOMATIONS.AUTOMATION_VALIDATE
945
- * @permissionScope Manage Stores
946
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
947
- * @permissionScope Set Up Automations
948
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
949
- * @applicableIdentity APP
950
- * @fqn wix.automations.v2.AutomationsService.ValidateAutomationById
951
- */
952
- async function validateAutomationById(automationId, options) {
953
- // @ts-ignore
954
- const { httpClient, sideEffects } = arguments[2];
955
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
956
- automationId: automationId,
957
- validationSettings: options?.validationSettings,
958
- });
959
- const reqOpts = ambassadorWixAutomationsV2Automation.validateAutomationById(payload);
960
- sideEffects?.onSiteCall?.();
961
- try {
962
- const result = await httpClient.request(reqOpts);
963
- sideEffects?.onSuccess?.(result);
964
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
965
- }
966
- catch (err) {
967
- const transformedError = (0, transform_error_1.transformError)(err, {
968
- spreadPathsToArguments: {},
969
- explicitPathsToArguments: {
970
- automationId: '$[0]',
971
- validationSettings: '$[1].validationSettings',
972
- },
973
- singleArgumentUnchanged: false,
974
- }, ['automationId', 'options']);
975
- sideEffects?.onError?.(err);
976
- throw transformedError;
977
- }
978
- }
979
- exports.validateAutomationById = validateAutomationById;
980
- /**
981
- * Gets the specified automation revision.
982
- * @param automationId - Automation ID.
983
- * @public
984
- * @documentationMaturity preview
985
- * @requiredField automationId
986
- * @permissionId AUTOMATIONS.AUTOMATION_REVISION_READ
987
- * @permissionScope Manage Stores
988
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
989
- * @permissionScope Set Up Automations
990
- * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
991
- * @applicableIdentity APP
992
- * @fqn wix.automations.v2.AutomationRevisionsService.GetAutomationRevision
993
- */
994
- async function getAutomationRevision(automationId, options) {
995
- // @ts-ignore
996
- const { httpClient, sideEffects } = arguments[2];
997
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
998
- automationId: automationId,
999
- revision: options?.revision,
1000
- fields: options?.fields,
1001
- });
1002
- const reqOpts = ambassadorWixAutomationsV2Automation.getAutomationRevision(payload);
1003
- sideEffects?.onSiteCall?.();
1004
- try {
1005
- const result = await httpClient.request(reqOpts);
1006
- sideEffects?.onSuccess?.(result);
1007
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
1008
- }
1009
- catch (err) {
1010
- const transformedError = (0, transform_error_1.transformError)(err, {
1011
- spreadPathsToArguments: {},
1012
- explicitPathsToArguments: {
1013
- automationId: '$[0]',
1014
- revision: '$[1].revision',
1015
- fields: '$[1].fields',
1016
- },
1017
- singleArgumentUnchanged: false,
1018
- }, ['automationId', 'options']);
1019
- sideEffects?.onError?.(err);
1020
- throw transformedError;
1021
- }
1022
- }
1023
- exports.getAutomationRevision = getAutomationRevision;
1024
- //# sourceMappingURL=automations-v2-automation-automations-v-2.universal.js.map