@wix/auto_sdk_automations_automations-v-2 1.0.84 → 1.0.86

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 +10 -10
  2. package/build/cjs/index.js +75 -74
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +82 -65
  5. package/build/cjs/index.typings.js +66 -65
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +66 -49
  8. package/build/cjs/meta.js +53 -52
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +10 -10
  11. package/build/es/index.mjs +75 -74
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +82 -65
  14. package/build/es/index.typings.mjs +66 -65
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +66 -49
  17. package/build/es/meta.mjs +53 -52
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +10 -10
  20. package/build/internal/cjs/index.js +75 -74
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +82 -65
  23. package/build/internal/cjs/index.typings.js +66 -65
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +66 -49
  26. package/build/internal/cjs/meta.js +53 -52
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +10 -10
  29. package/build/internal/es/index.mjs +75 -74
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +82 -65
  32. package/build/internal/es/index.typings.mjs +66 -65
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +66 -49
  35. package/build/internal/es/meta.mjs +53 -52
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -1,15 +1,7 @@
1
1
  import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { GetAutomationRevisionOptions, GetAutomationRevisionResponse, Automation, UpdateAutomation, BulkDeleteAutomationsResponse, GeneratePreinstalledAutomationOptions, GeneratePreinstalledAutomationResponse, QueryPreinstalledAutomationsForAppOptions, QueryPreinstalledAutomationsForAppResponse, GetAggregatedUsageInfoOptions, GetAggregatedUsageInfoResponse, CopyAutomationOptions, CopyAutomationResponse, CreateDraftAutomationOptions, CreateDraftAutomationResponse, GetOrCreateDraftAutomationResponse, UpdateDraftAutomation, UpdateDraftAutomationResponse, QueryAutomationsWithDraftsOptions, QueryAutomationsWithDraftsResponse, BulkCountAutomationsWithDraftsOptions, BulkCountAutomationsWithDraftsResponse, PublishDraftAutomationResponse, ValidateAutomationOptions, ValidateAutomationResponse, ValidateAutomationByIdOptions, ValidateAutomationByIdResponse, GenerateActionInputMappingFromTemplateOptions, GenerateActionInputMappingFromTemplateResponse, AutomationCreatedEnvelope, AutomationDeletedEnvelope, AutomationUpdatedEnvelope, AutomationQuery, QueryAutomationsOptions, typedQueryAutomations, AutomationsQueryBuilder } from './index.typings.js';
2
+ import { Automation, UpdateAutomation, BulkDeleteAutomationsResponse, GeneratePreinstalledAutomationOptions, GeneratePreinstalledAutomationResponse, QueryPreinstalledAutomationsForAppOptions, QueryPreinstalledAutomationsForAppResponse, GetAggregatedUsageInfoOptions, GetAggregatedUsageInfoResponse, CopyAutomationOptions, CopyAutomationResponse, CreateDraftAutomationOptions, CreateDraftAutomationResponse, GetOrCreateDraftAutomationResponse, UpdateDraftAutomation, UpdateDraftAutomationResponse, QueryAutomationsWithDraftsOptions, QueryAutomationsWithDraftsResponse, BulkCountAutomationsWithDraftsOptions, BulkCountAutomationsWithDraftsResponse, PublishDraftAutomationResponse, ValidateAutomationOptions, ValidateAutomationResponse, ValidateAutomationByIdOptions, ValidateAutomationByIdResponse, GenerateActionInputMappingFromTemplateOptions, GenerateActionInputMappingFromTemplateResponse, GetAutomationRevisionOptions, GetAutomationRevisionResponse, AutomationCreatedEnvelope, AutomationDeletedEnvelope, AutomationUpdatedEnvelope, AutomationQuery, QueryAutomationsOptions, typedQueryAutomations, AutomationsQueryBuilder } from './index.typings.js';
3
3
  export { AIMetadata, Action, ActionConfigurationError, ActionErrorType, ActionErrorTypeWithLiterals, ActionEvent, ActionInfoOneOf, ActionProviderQuotaInfo, ActionQuotaInfo, ActionSettings, ActionUsageSummary, ActionValidationError, ActionValidationErrorErrorOneOf, ActionValidationInfo, AdditionalInfo, AppDefinedAction, ApplicationError, ApplicationOrigin, Asset, AuditInfo, AuditInfoIdOneOf, AutoArchivePolicy, AutomationConfiguration, AutomationConfigurationError, AutomationErrorType, AutomationErrorTypeWithLiterals, AutomationOriginInfoOneOf, AutomationQuerySpec, AutomationSettings, AutomationValidationError, AutomationValidationErrorErrorOneOf, AutomationValidationErrorValidationErrorType, AutomationValidationErrorValidationErrorTypeWithLiterals, AutomationsQueryResult, BaseEventMetadata, BulkActionMetadata, BulkCountAutomationsWithDraftsRequest, BulkDeleteAutomationsRequest, BulkDeleteResult, CTA, CodeConditionAction, CodeSnippet, CommonQueryWithEntityContext, ConditionAction, ConditionExpressionGroup, CopyAutomationRequest, CreateAutomationRequest, CreateAutomationResponse, CreateDraftAutomationRequest, CreatePreinstalledAutomationRequest, CreatePreinstalledAutomationResponse, CreatedByAppIdUsageSummary, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DelayAction, DeleteAutomationRequest, DeleteAutomationResponse, DeleteContext, DeleteDraftAutomationRequest, DeleteDraftAutomationResponse, DeletePreinstalledAutomationRequest, DeletePreinstalledAutomationResponse, DeleteStatus, DeleteStatusWithLiterals, Dimensions, Domain, DomainEvent, DomainEventBodyOneOf, DomainWithLiterals, DraftInfo, DraftPublished, DraftsInfo, Empty, Enrichment, Enrichments, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, Filter, FilterValueSelection, FilterableAppDefinedActions, FutureDateActivationOffset, GenerateActionInputMappingFromTemplateRequest, GeneratePreinstalledAutomationRequest, GetActionsQuotaInfoRequest, GetActionsQuotaInfoResponse, GetAggregatedUsageInfoRequest, GetAutomationActionSchemaRequest, GetAutomationActionSchemaResponse, GetAutomationRequest, GetAutomationResponse, GetAutomationRevisionRequest, GetOrCreateDraftAutomationRequest, IdentificationData, IdentificationDataIdOneOf, ItemMetadata, Language, LanguageWithLiterals, MergeOverridePreinstalledWithRuntimeVersionRequest, MergeOverridePreinstalledWithRuntimeVersionResponse, MessageEnvelope, MetaSiteSpecialEvent, MetaSiteSpecialEventPayloadOneOf, MigrateVeloActionAutomationsRequest, MigrateVeloActionAutomationsResponse, Namespace, NamespaceChanged, NamespaceWithLiterals, Note, Notes, OdeditorAssigned, OdeditorUnassigned, Offset, Operator, OperatorWithLiterals, Origin, OriginAutomationInfo, OriginWithLiterals, OutputAction, Path, PicassoAssigned, PicassoUnassigned, Plan, Position, PreinstalledAutomationSpecInfo, PreinstalledOrigin, ProviderConfigurationError, PublishDraftAutomationRequest, QueryAutomationsRequest, QueryAutomationsResponse, QueryAutomationsWithDraftsRequest, QueryDraftAutomationsRequest, QueryDraftAutomationsResponse, QueryPreinstalledAutomationsForAppRequest, QueryPreinstalledAutomationsRequest, QueryPreinstalledAutomationsResponse, Quota, QuotaInfo, RateLimit, RateLimitAction, RequestedFields, RequestedFieldsWithLiterals, RestoreInfo, ServiceProvisioned, ServiceRemoved, SetVariablesAction, Severity, SeverityWithLiterals, SiteCreated, SiteCreatedContext, SiteCreatedContextWithLiterals, SiteDeleted, SiteHardDeleted, SiteMarkedAsTemplate, SiteMarkedAsWixSite, SitePublished, SitePurgedExternally, SiteRenamed, SiteTransferred, SiteUndeleted, SiteUnpublished, SiteUrlChanged, SortOrder, SortOrderWithLiterals, Sorting, SplitAction, State, StateWithLiterals, Status, StatusWithLiterals, StudioAssigned, StudioTwoAssigned, StudioTwoUnassigned, StudioUnassigned, TimeUnit, TimeUnitWithLiterals, Trigger, TriggerConfigurationError, TriggerErrorType, TriggerErrorTypeWithLiterals, TriggerSettings, TriggerUsageSummary, TriggerValidationError, TriggerValidationErrorErrorOneOf, TriggerValidationErrorValidationErrorType, TriggerValidationErrorValidationErrorTypeWithLiterals, Type, TypeWithLiterals, UpdateAutomationRequest, UpdateAutomationResponse, UpdateDraftAutomationRequest, UpdatePreinstalledAutomationRequest, UpdatePreinstalledAutomationResponse, UpgradeCTA, ValidateAutomationByIdRequest, ValidateAutomationRequest, ValidationErrorSeverity, ValidationErrorSeverityWithLiterals, ValidationErrorType, ValidationErrorTypeWithLiterals, ValidationResultStatus, ValidationResultStatusWithLiterals, ValidationSettings, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WixelAssigned, WixelUnassigned } from './index.typings.js';
4
4
 
5
- declare function getAutomationRevision$1(httpClient: HttpClient): GetAutomationRevisionSignature;
6
- interface GetAutomationRevisionSignature {
7
- /**
8
- * Gets the specified automation revision.
9
- * @param - Automation ID.
10
- */
11
- (automationId: string, options?: GetAutomationRevisionOptions): Promise<NonNullablePaths<GetAutomationRevisionResponse, `automation.applicationInfo.appId` | `automation.preinstalledInfo.appId` | `automation.createdBy.userId` | `automation.createdBy.appId` | `automation.name` | `automation.configuration.status` | `automation.configuration.trigger.appId` | `automation.configuration.trigger.triggerKey` | `automation.configuration.trigger.filters` | `automation.configuration.trigger.filters.${number}._id` | `automation.configuration.trigger.filters.${number}.fieldKey` | `automation.configuration.trigger.filters.${number}.filterExpression` | `automation.configuration.trigger.scheduledEventOffset.preScheduledEventOffsetExpression` | `automation.configuration.trigger.scheduledEventOffset.scheduledEventOffsetTimeUnit` | `automation.configuration.trigger.rateLimit.maxActivationsExpression` | `automation.configuration.trigger.rateLimit.durationTimeUnit` | `automation.configuration.rootActionIds` | `automation.origin` | `automation.settings.hidden` | `automation.settings.readonly` | `automation.settings.disableDelete` | `automation.settings.disableStatusChange` | `automation.settings.actionSettings.permanentActionIds` | `automation.settings.actionSettings.readonlyActionIds` | `automation.archived`, 7>>;
12
- }
13
5
  declare function createAutomation$1(httpClient: HttpClient): CreateAutomationSignature;
14
6
  interface CreateAutomationSignature {
15
7
  /**
@@ -189,6 +181,14 @@ interface GenerateActionInputMappingFromTemplateSignature {
189
181
  */
190
182
  (appId: string, options: NonNullablePaths<GenerateActionInputMappingFromTemplateOptions, `actionInputMappingTemplate` | `actionKey`, 2>): Promise<GenerateActionInputMappingFromTemplateResponse>;
191
183
  }
184
+ declare function getAutomationRevision$1(httpClient: HttpClient): GetAutomationRevisionSignature;
185
+ interface GetAutomationRevisionSignature {
186
+ /**
187
+ * Gets the specified automation revision.
188
+ * @param - Automation ID.
189
+ */
190
+ (automationId: string, options?: GetAutomationRevisionOptions): Promise<NonNullablePaths<GetAutomationRevisionResponse, `automation.applicationInfo.appId` | `automation.preinstalledInfo.appId` | `automation.createdBy.userId` | `automation.createdBy.appId` | `automation.name` | `automation.configuration.status` | `automation.configuration.trigger.appId` | `automation.configuration.trigger.triggerKey` | `automation.configuration.trigger.filters` | `automation.configuration.trigger.filters.${number}._id` | `automation.configuration.trigger.filters.${number}.fieldKey` | `automation.configuration.trigger.filters.${number}.filterExpression` | `automation.configuration.trigger.scheduledEventOffset.preScheduledEventOffsetExpression` | `automation.configuration.trigger.scheduledEventOffset.scheduledEventOffsetTimeUnit` | `automation.configuration.trigger.rateLimit.maxActivationsExpression` | `automation.configuration.trigger.rateLimit.durationTimeUnit` | `automation.configuration.rootActionIds` | `automation.origin` | `automation.settings.hidden` | `automation.settings.readonly` | `automation.settings.disableDelete` | `automation.settings.disableStatusChange` | `automation.settings.actionSettings.permanentActionIds` | `automation.settings.actionSettings.readonlyActionIds` | `automation.archived`, 7>>;
191
+ }
192
192
  declare const onAutomationCreated$1: EventDefinition<AutomationCreatedEnvelope, "wix.automations.v2.automation_created">;
193
193
  declare const onAutomationDeleted$1: EventDefinition<AutomationDeletedEnvelope, "wix.automations.v2.automation_deleted">;
194
194
  declare const onAutomationUpdated$1: EventDefinition<AutomationUpdatedEnvelope, "wix.automations.v2.automation_updated">;
@@ -197,7 +197,6 @@ declare function customQueryAutomations(httpClient: HttpClient): {
197
197
  (query: AutomationQuery, options?: QueryAutomationsOptions): ReturnType<typeof typedQueryAutomations>;
198
198
  (options?: QueryAutomationsOptions): AutomationsQueryBuilder;
199
199
  };
200
- declare const getAutomationRevision: MaybeContext<BuildRESTFunction<typeof getAutomationRevision$1> & typeof getAutomationRevision$1>;
201
200
  declare const createAutomation: MaybeContext<BuildRESTFunction<typeof createAutomation$1> & typeof createAutomation$1>;
202
201
  declare const getAutomation: MaybeContext<BuildRESTFunction<typeof getAutomation$1> & typeof getAutomation$1>;
203
202
  declare const updateAutomation: MaybeContext<BuildRESTFunction<typeof updateAutomation$1> & typeof updateAutomation$1>;
@@ -217,6 +216,7 @@ declare const publishDraftAutomation: MaybeContext<BuildRESTFunction<typeof publ
217
216
  declare const validateAutomation: MaybeContext<BuildRESTFunction<typeof validateAutomation$1> & typeof validateAutomation$1>;
218
217
  declare const validateAutomationById: MaybeContext<BuildRESTFunction<typeof validateAutomationById$1> & typeof validateAutomationById$1>;
219
218
  declare const generateActionInputMappingFromTemplate: MaybeContext<BuildRESTFunction<typeof generateActionInputMappingFromTemplate$1> & typeof generateActionInputMappingFromTemplate$1>;
219
+ declare const getAutomationRevision: MaybeContext<BuildRESTFunction<typeof getAutomationRevision$1> & typeof getAutomationRevision$1>;
220
220
  declare const queryAutomations: MaybeContext<BuildRESTFunction<typeof customQueryAutomations> & typeof customQueryAutomations>;
221
221
  /**
222
222
  * Triggered when a new automation is created.
@@ -88,7 +88,7 @@ var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
88
88
  var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
89
89
  var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
90
90
  var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
91
- function resolveWixAutomationsV2AutomationsServiceUrl(opts) {
91
+ function resolveWixAutomationsV2AutomationRevisionsServiceUrl(opts) {
92
92
  const domainToMappings = {
93
93
  "manage._base_domain_": [
94
94
  {
@@ -127,7 +127,7 @@ function resolveWixAutomationsV2AutomationsServiceUrl(opts) {
127
127
  };
128
128
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
129
129
  }
130
- function resolveWixAutomationsV2AutomationRevisionsServiceUrl(opts) {
130
+ function resolveWixAutomationsV2AutomationsServiceUrl(opts) {
131
131
  const domainToMappings = {
132
132
  "manage._base_domain_": [
133
133
  {
@@ -167,38 +167,6 @@ function resolveWixAutomationsV2AutomationRevisionsServiceUrl(opts) {
167
167
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
168
168
  }
169
169
  var PACKAGE_NAME = "@wix/auto_sdk_automations_automations-v-2";
170
- function getAutomationRevision(payload) {
171
- function __getAutomationRevision({ host }) {
172
- const metadata = {
173
- entityFqdn: "wix.automations.v2.automation",
174
- method: "GET",
175
- methodFqn: "wix.automations.v2.AutomationRevisionsService.GetAutomationRevision",
176
- packageName: PACKAGE_NAME,
177
- migrationOptions: {
178
- optInTransformResponse: true
179
- },
180
- url: resolveWixAutomationsV2AutomationRevisionsServiceUrl({
181
- protoPath: "/v1/automation-revisions/{automationId}",
182
- data: payload,
183
- host
184
- }),
185
- params: (0, import_rest_modules.toURLSearchParams)(payload),
186
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
187
- {
188
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
189
- paths: [
190
- { path: "automation.createdDate" },
191
- { path: "automation.updatedDate" },
192
- { path: "automation.draftUpdatedDate" },
193
- { path: "automation.autoArchivePolicy.archiveDate" }
194
- ]
195
- }
196
- ])
197
- };
198
- return metadata;
199
- }
200
- return __getAutomationRevision;
201
- }
202
170
  function createAutomation(payload) {
203
171
  function __createAutomation({ host }) {
204
172
  const serializedData = (0, import_transform_paths.transformPaths)(payload, [
@@ -836,6 +804,38 @@ function generateActionInputMappingFromTemplate(payload) {
836
804
  }
837
805
  return __generateActionInputMappingFromTemplate;
838
806
  }
807
+ function getAutomationRevision(payload) {
808
+ function __getAutomationRevision({ host }) {
809
+ const metadata = {
810
+ entityFqdn: "wix.automations.v2.automation",
811
+ method: "GET",
812
+ methodFqn: "wix.automations.v2.AutomationRevisionsService.GetAutomationRevision",
813
+ packageName: PACKAGE_NAME,
814
+ migrationOptions: {
815
+ optInTransformResponse: true
816
+ },
817
+ url: resolveWixAutomationsV2AutomationRevisionsServiceUrl({
818
+ protoPath: "/v1/automation-revisions/{automationId}",
819
+ data: payload,
820
+ host
821
+ }),
822
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
823
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
824
+ {
825
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
826
+ paths: [
827
+ { path: "automation.createdDate" },
828
+ { path: "automation.updatedDate" },
829
+ { path: "automation.draftUpdatedDate" },
830
+ { path: "automation.autoArchivePolicy.archiveDate" }
831
+ ]
832
+ }
833
+ ])
834
+ };
835
+ return metadata;
836
+ }
837
+ return __getAutomationRevision;
838
+ }
839
839
 
840
840
  // src/automations-v2-automation-automations-v-2.universal.ts
841
841
  var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
@@ -869,6 +869,7 @@ var Type = /* @__PURE__ */ ((Type2) => {
869
869
  Type2["UNKNOWN_ACTION_TYPE"] = "UNKNOWN_ACTION_TYPE";
870
870
  Type2["APP_DEFINED"] = "APP_DEFINED";
871
871
  Type2["CONDITION"] = "CONDITION";
872
+ Type2["CODE_CONDITION"] = "CODE_CONDITION";
872
873
  Type2["DELAY"] = "DELAY";
873
874
  Type2["RATE_LIMIT"] = "RATE_LIMIT";
874
875
  return Type2;
@@ -1029,37 +1030,6 @@ var AutomationErrorType = /* @__PURE__ */ ((AutomationErrorType2) => {
1029
1030
  AutomationErrorType2["UNKNOWN_AUTOMATION_ERROR_TYPE"] = "UNKNOWN_AUTOMATION_ERROR_TYPE";
1030
1031
  return AutomationErrorType2;
1031
1032
  })(AutomationErrorType || {});
1032
- async function getAutomationRevision2(automationId, options) {
1033
- const { httpClient, sideEffects } = arguments[2];
1034
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1035
- automationId,
1036
- revision: options?.revision,
1037
- fields: options?.fields
1038
- });
1039
- const reqOpts = getAutomationRevision(payload);
1040
- sideEffects?.onSiteCall?.();
1041
- try {
1042
- const result = await httpClient.request(reqOpts);
1043
- sideEffects?.onSuccess?.(result);
1044
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
1045
- } catch (err) {
1046
- const transformedError = (0, import_transform_error.transformError)(
1047
- err,
1048
- {
1049
- spreadPathsToArguments: {},
1050
- explicitPathsToArguments: {
1051
- automationId: "$[0]",
1052
- revision: "$[1].revision",
1053
- fields: "$[1].fields"
1054
- },
1055
- singleArgumentUnchanged: false
1056
- },
1057
- ["automationId", "options"]
1058
- );
1059
- sideEffects?.onError?.(err);
1060
- throw transformedError;
1061
- }
1062
- }
1063
1033
  async function createAutomation2(automation) {
1064
1034
  const { httpClient, sideEffects } = arguments[1];
1065
1035
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -1635,16 +1605,39 @@ async function generateActionInputMappingFromTemplate2(appId, options) {
1635
1605
  throw transformedError;
1636
1606
  }
1637
1607
  }
1638
-
1639
- // src/automations-v2-automation-automations-v-2.public.ts
1640
- function getAutomationRevision3(httpClient) {
1641
- return (automationId, options) => getAutomationRevision2(
1608
+ async function getAutomationRevision2(automationId, options) {
1609
+ const { httpClient, sideEffects } = arguments[2];
1610
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1642
1611
  automationId,
1643
- options,
1644
- // @ts-ignore
1645
- { httpClient }
1646
- );
1612
+ revision: options?.revision,
1613
+ fields: options?.fields
1614
+ });
1615
+ const reqOpts = getAutomationRevision(payload);
1616
+ sideEffects?.onSiteCall?.();
1617
+ try {
1618
+ const result = await httpClient.request(reqOpts);
1619
+ sideEffects?.onSuccess?.(result);
1620
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
1621
+ } catch (err) {
1622
+ const transformedError = (0, import_transform_error.transformError)(
1623
+ err,
1624
+ {
1625
+ spreadPathsToArguments: {},
1626
+ explicitPathsToArguments: {
1627
+ automationId: "$[0]",
1628
+ revision: "$[1].revision",
1629
+ fields: "$[1].fields"
1630
+ },
1631
+ singleArgumentUnchanged: false
1632
+ },
1633
+ ["automationId", "options"]
1634
+ );
1635
+ sideEffects?.onError?.(err);
1636
+ throw transformedError;
1637
+ }
1647
1638
  }
1639
+
1640
+ // src/automations-v2-automation-automations-v-2.public.ts
1648
1641
  function createAutomation3(httpClient) {
1649
1642
  return (automation) => createAutomation2(
1650
1643
  automation,
@@ -1800,6 +1793,14 @@ function generateActionInputMappingFromTemplate3(httpClient) {
1800
1793
  { httpClient }
1801
1794
  );
1802
1795
  }
1796
+ function getAutomationRevision3(httpClient) {
1797
+ return (automationId, options) => getAutomationRevision2(
1798
+ automationId,
1799
+ options,
1800
+ // @ts-ignore
1801
+ { httpClient }
1802
+ );
1803
+ }
1803
1804
  var onAutomationCreated = (0, import_sdk_types.EventDefinition)(
1804
1805
  "wix.automations.v2.automation_created",
1805
1806
  true,
@@ -1874,7 +1875,6 @@ function customQueryAutomations(httpClient) {
1874
1875
  }
1875
1876
  return overloadedQuery;
1876
1877
  }
1877
- var getAutomationRevision4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getAutomationRevision3);
1878
1878
  var createAutomation4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createAutomation3);
1879
1879
  var getAutomation4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getAutomation3);
1880
1880
  var updateAutomation4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateAutomation3);
@@ -1896,6 +1896,7 @@ var validateAutomationById4 = /* @__PURE__ */ (0, import_rest_modules3.createRES
1896
1896
  var generateActionInputMappingFromTemplate4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(
1897
1897
  generateActionInputMappingFromTemplate3
1898
1898
  );
1899
+ var getAutomationRevision4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getAutomationRevision3);
1899
1900
  var queryAutomations4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryAutomations);
1900
1901
  var onAutomationCreated2 = (0, import_event_definition_modules.createEventModule)(
1901
1902
  onAutomationCreated