@wix/auto_sdk_automations_automations-v-2 1.0.83 → 1.0.85

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
@@ -88,17 +88,19 @@ interface AIMetadata {
88
88
  }
89
89
  interface ActionSettings {
90
90
  /**
91
- * Permanent actions. PermanentAction's skipActionExpression cannot be modified.
91
+ * IDs of actions whose `skipActionExpression` can't be modified.
92
92
  *
93
- * When empty, all actions can be set as skipped
93
+ * An action's `skipActionExpression` determines whether the action is skipped. Including an action's ID in this array makes its `skipActionExpression` permanent, so it can't be changed.
94
+ *
95
+ * When empty, the `skipActionExpression` of all actions can be edited.
94
96
  * @maxSize 30
95
97
  * @format GUID
96
98
  */
97
99
  permanentActionIds?: string[];
98
100
  /**
99
- * Read-only actions. Read-only actions cannot be edited.
101
+ * IDs of read-only actions. Read-only actions cannot be modified.
100
102
  *
101
- * When empty, all actions are editable.
103
+ * When empty and the automation's `settings.readonly` is `false`, all actions are modifiable.
102
104
  * @maxSize 30
103
105
  * @format GUID
104
106
  */
@@ -308,15 +310,29 @@ declare enum Type {
308
310
  UNKNOWN_ACTION_TYPE = "UNKNOWN_ACTION_TYPE",
309
311
  /** Defined by a [Wix app](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation#app-defined-action). This action type is available in the site dashboard. */
310
312
  APP_DEFINED = "APP_DEFINED",
311
- /** Condition. This determines which action runs next. */
313
+ /**
314
+ * Condition action. Evaluates a condition to determine which action runs next.
315
+ *
316
+ * Learn more about [adding and setting up conditions](https://support.wix.com/en/article/the-new-automation-builder-understanding-conditions-operators) in Wix Automations.
317
+ *
318
+ * > **Note**: When `skipActionExpression` evaluates to `true`, the actions in `conditionInfo.truePostActionIds` run and those in `conditionInfo.falsePostActionIds` are skipped.
319
+ */
312
320
  CONDITION = "CONDITION",
321
+ /**
322
+ * Code condition action. Evaluates custom code to determine which action runs next.
323
+ *
324
+ * Learn more about [adding and setting up conditions](https://support.wix.com/en/article/the-new-automation-builder-understanding-conditions-operators) in Wix Automations.
325
+ *
326
+ * > **Note**: When `skipActionExpression` evaluates to `true`, the actions in `codeConditionInfo.truePostActionIds` run and those in `codeConditionInfo.falsePostActionIds` are skipped.
327
+ */
328
+ CODE_CONDITION = "CODE_CONDITION",
313
329
  /** Delay. The automation must wait before executing the next step. */
314
330
  DELAY = "DELAY",
315
331
  /** Rate-limiter. This stops the automation flow if the subsequent action has reached its maximum allowed executions. */
316
332
  RATE_LIMIT = "RATE_LIMIT"
317
333
  }
318
334
  /** @enumType */
319
- type TypeWithLiterals = Type | 'UNKNOWN_ACTION_TYPE' | 'APP_DEFINED' | 'CONDITION' | 'DELAY' | 'RATE_LIMIT';
335
+ type TypeWithLiterals = Type | 'UNKNOWN_ACTION_TYPE' | 'APP_DEFINED' | 'CONDITION' | 'CODE_CONDITION' | 'DELAY' | 'RATE_LIMIT';
320
336
  interface AppDefinedAction {
321
337
  /**
322
338
  * ID of the app that defines the action.
@@ -534,15 +550,15 @@ interface Trigger {
534
550
  overrideSchema?: Record<string, any> | null;
535
551
  }
536
552
  interface Action extends ActionInfoOneOf {
537
- /** Details of the action when its `type` is `APP_DEFINED`. */
553
+ /** Details of the action whose `type` is `APP_DEFINED`. */
538
554
  appDefinedInfo?: AppDefinedAction;
539
- /** Details of the action when its `type` is `CONDITION`. */
555
+ /** Details of the action whose `type` is `CONDITION`. */
540
556
  conditionInfo?: ConditionAction;
541
- /** Details of the action when its `type` is `CODE_CONDITION`. */
557
+ /** Details of the action whose `type` is `CODE_CONDITION`. */
542
558
  codeConditionInfo?: CodeConditionAction;
543
- /** Details of the action when its `type` is `DELAY`. */
559
+ /** Details of the action whose `type` is `DELAY`. */
544
560
  delayInfo?: DelayAction;
545
- /** Details of the action when its `type` is `RATE_LIMIT`. */
561
+ /** Details of the action whose `type` is `RATE_LIMIT`. */
546
562
  rateLimitInfo?: RateLimitAction;
547
563
  /**
548
564
  * Action ID.
@@ -570,24 +586,24 @@ interface Action extends ActionInfoOneOf {
570
586
  */
571
587
  namespace?: string | null;
572
588
  /**
573
- * Evaluated to boolean to decide whether the action is skipped.
574
- * For ConditionAction: if skipped, true_post_action_ids execute; false_post_action_ids are skipped
575
- * SplitAction and OutputAction do not support skip_action_expression
589
+ * Evaluated to determine whether the action is skipped. When evaluated to `true`, the action is skipped. Otherwise, the action runs.
590
+ *
591
+ * When empty, the action runs.
576
592
  * @maxLength 1000
577
593
  */
578
594
  skipActionExpression?: string | null;
579
595
  }
580
596
  /** @oneof */
581
597
  interface ActionInfoOneOf {
582
- /** Details of the action when its `type` is `APP_DEFINED`. */
598
+ /** Details of the action whose `type` is `APP_DEFINED`. */
583
599
  appDefinedInfo?: AppDefinedAction;
584
- /** Details of the action when its `type` is `CONDITION`. */
600
+ /** Details of the action whose `type` is `CONDITION`. */
585
601
  conditionInfo?: ConditionAction;
586
- /** Details of the action when its `type` is `CODE_CONDITION`. */
602
+ /** Details of the action whose `type` is `CODE_CONDITION`. */
587
603
  codeConditionInfo?: CodeConditionAction;
588
- /** Details of the action when its `type` is `DELAY`. */
604
+ /** Details of the action whose `type` is `DELAY`. */
589
605
  delayInfo?: DelayAction;
590
- /** Details of the action when its `type` is `RATE_LIMIT`. */
606
+ /** Details of the action whose `type` is `RATE_LIMIT`. */
591
607
  rateLimitInfo?: RateLimitAction;
592
608
  }
593
609
  interface FilterableAppDefinedActions {
@@ -651,11 +667,12 @@ interface AutomationSettings {
651
667
  hidden?: boolean;
652
668
  /**
653
669
  * Whether the automation is read-only.
654
- * If true - modifications to the automation trigger or action/s are disabled.
655
- * **Note**: this setting takes precedent over triggerSettings/actionSettings.
656
- * If false - allows selective read-only settings via those fields.
657
670
  *
658
- * Default: `false`
671
+ * When `true`, site owners can't modify the automation or any of its actions. When `false`, users can configure specific actions as skippable or read-only using `settings.actionSettings`.
672
+ *
673
+ * Default: `false`.
674
+ *
675
+ * > **Note**: Setting `readOnly` to `true` overrides `settings.actionSettings`.
659
676
  */
660
677
  readonly?: boolean;
661
678
  /**
@@ -665,7 +682,7 @@ interface AutomationSettings {
665
682
  */
666
683
  disableDelete?: boolean;
667
684
  /**
668
- * Whether to disable the option to change the automation's `configuration.status`, for example from `ACTIVE` to `INACTIVE`.
685
+ * Whether to disable the option to change the automation's `configuration.status`.
669
686
  *
670
687
  * Default: `false`.
671
688
  */
@@ -864,9 +881,19 @@ declare enum WebhookIdentityType {
864
881
  }
865
882
  /** @enumType */
866
883
  type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
867
- interface CreateAutomationRequest {
868
- /** Automation to create. */
869
- automation: Automation;
884
+ interface GetAutomationRevisionRequest {
885
+ /**
886
+ * Automation ID.
887
+ * @format GUID
888
+ */
889
+ automationId: string;
890
+ /** Revision number. */
891
+ revision?: string | null;
892
+ /**
893
+ * Requested fields.
894
+ * @maxSize 20
895
+ */
896
+ fields?: RequestedFieldsWithLiterals[];
870
897
  }
871
898
  declare enum RequestedFields {
872
899
  UNKNOWN_REQUESTED_FIELD = "UNKNOWN_REQUESTED_FIELD",
@@ -875,6 +902,14 @@ declare enum RequestedFields {
875
902
  }
876
903
  /** @enumType */
877
904
  type RequestedFieldsWithLiterals = RequestedFields | 'UNKNOWN_REQUESTED_FIELD' | 'OVERRIDE_SCHEMA';
905
+ interface GetAutomationRevisionResponse {
906
+ /** Automation revision. */
907
+ automation?: Automation;
908
+ }
909
+ interface CreateAutomationRequest {
910
+ /** Automation to create. */
911
+ automation: Automation;
912
+ }
878
913
  interface CreateAutomationResponse {
879
914
  /** Details of the created automation. */
880
915
  automation?: Automation;
@@ -2398,24 +2433,6 @@ interface MergeOverridePreinstalledWithRuntimeVersionResponse {
2398
2433
  /** The merged automation after applying the latest runtime version of the preinstalled automation. */
2399
2434
  automation?: Automation;
2400
2435
  }
2401
- interface GetAutomationRevisionRequest {
2402
- /**
2403
- * Automation ID.
2404
- * @format GUID
2405
- */
2406
- automationId: string;
2407
- /** Revision number. */
2408
- revision?: string | null;
2409
- /**
2410
- * Requested fields.
2411
- * @maxSize 20
2412
- */
2413
- fields?: RequestedFieldsWithLiterals[];
2414
- }
2415
- interface GetAutomationRevisionResponse {
2416
- /** Automation revision. */
2417
- automation?: Automation;
2418
- }
2419
2436
  interface BaseEventMetadata {
2420
2437
  /**
2421
2438
  * App instance ID.
@@ -2519,6 +2536,26 @@ interface AutomationUpdatedEnvelope {
2519
2536
  * @documentationMaturity preview
2520
2537
  */
2521
2538
  declare function onAutomationUpdated(handler: (event: AutomationUpdatedEnvelope) => void | Promise<void>): void;
2539
+ /**
2540
+ * Gets the specified automation revision.
2541
+ * @param automationId - Automation ID.
2542
+ * @public
2543
+ * @documentationMaturity preview
2544
+ * @requiredField automationId
2545
+ * @permissionId AUTOMATIONS.AUTOMATION_REVISION_READ
2546
+ * @applicableIdentity APP
2547
+ * @fqn wix.automations.v2.AutomationRevisionsService.GetAutomationRevision
2548
+ */
2549
+ declare function getAutomationRevision(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>>;
2550
+ interface GetAutomationRevisionOptions {
2551
+ /** Revision number. */
2552
+ revision?: string | null;
2553
+ /**
2554
+ * Requested fields.
2555
+ * @maxSize 20
2556
+ */
2557
+ fields?: RequestedFieldsWithLiterals[];
2558
+ }
2522
2559
  /**
2523
2560
  * Creates an automation.
2524
2561
  * @param automation - Automation to create.
@@ -3194,25 +3231,5 @@ interface GenerateActionInputMappingFromTemplateOptions {
3194
3231
  /** Action input mapping template the action SPI provider will generate input mapping from. */
3195
3232
  actionInputMappingTemplate: Record<string, any> | null;
3196
3233
  }
3197
- /**
3198
- * Gets the specified automation revision.
3199
- * @param automationId - Automation ID.
3200
- * @public
3201
- * @documentationMaturity preview
3202
- * @requiredField automationId
3203
- * @permissionId AUTOMATIONS.AUTOMATION_REVISION_READ
3204
- * @applicableIdentity APP
3205
- * @fqn wix.automations.v2.AutomationRevisionsService.GetAutomationRevision
3206
- */
3207
- declare function getAutomationRevision(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>>;
3208
- interface GetAutomationRevisionOptions {
3209
- /** Revision number. */
3210
- revision?: string | null;
3211
- /**
3212
- * Requested fields.
3213
- * @maxSize 20
3214
- */
3215
- fields?: RequestedFieldsWithLiterals[];
3216
- }
3217
3234
 
3218
3235
  export { type AIMetadata, type Action, type ActionConfigurationError, ActionErrorType, type ActionErrorTypeWithLiterals, type ActionEvent, type ActionInfoOneOf, type ActionProviderQuotaInfo, type ActionQuotaInfo, type ActionSettings, type ActionUsageSummary, type ActionValidationError, type ActionValidationErrorErrorOneOf, type ActionValidationInfo, type AdditionalInfo, type AppDefinedAction, type ApplicationError, type ApplicationOrigin, type Asset, type AuditInfo, type AuditInfoIdOneOf, type AutoArchivePolicy, type Automation, type AutomationConfiguration, type AutomationConfigurationError, type AutomationCreatedEnvelope, type AutomationDeletedEnvelope, AutomationErrorType, type AutomationErrorTypeWithLiterals, type AutomationOriginInfoOneOf, type AutomationQuery, type AutomationQuerySpec, type AutomationSettings, type AutomationUpdatedEnvelope, type AutomationValidationError, type AutomationValidationErrorErrorOneOf, AutomationValidationErrorValidationErrorType, type AutomationValidationErrorValidationErrorTypeWithLiterals, type AutomationsQueryBuilder, type AutomationsQueryResult, type BaseEventMetadata, type BulkActionMetadata, type BulkCountAutomationsWithDraftsOptions, type BulkCountAutomationsWithDraftsRequest, type BulkCountAutomationsWithDraftsResponse, type BulkDeleteAutomationsRequest, type BulkDeleteAutomationsResponse, type BulkDeleteResult, type CTA, type CodeConditionAction, type CodeSnippet, type CommonQueryWithEntityContext, type ConditionAction, type ConditionExpressionGroup, type CopyAutomationOptions, type CopyAutomationRequest, type CopyAutomationResponse, type CreateAutomationRequest, type CreateAutomationResponse, type CreateDraftAutomationOptions, type CreateDraftAutomationRequest, type CreateDraftAutomationResponse, type CreatePreinstalledAutomationRequest, type CreatePreinstalledAutomationResponse, type CreatedByAppIdUsageSummary, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DelayAction, type DeleteAutomationRequest, type DeleteAutomationResponse, type DeleteContext, type DeleteDraftAutomationRequest, type DeleteDraftAutomationResponse, type DeletePreinstalledAutomationRequest, type DeletePreinstalledAutomationResponse, DeleteStatus, type DeleteStatusWithLiterals, type Dimensions, Domain, type DomainEvent, type DomainEventBodyOneOf, type DomainWithLiterals, type DraftInfo, type DraftPublished, type DraftsInfo, type Empty, type Enrichment, type Enrichments, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type Filter, type FilterValueSelection, type FilterableAppDefinedActions, type FutureDateActivationOffset, type GenerateActionInputMappingFromTemplateOptions, type GenerateActionInputMappingFromTemplateRequest, type GenerateActionInputMappingFromTemplateResponse, type GeneratePreinstalledAutomationOptions, type GeneratePreinstalledAutomationRequest, type GeneratePreinstalledAutomationResponse, type GetActionsQuotaInfoRequest, type GetActionsQuotaInfoResponse, type GetAggregatedUsageInfoOptions, type GetAggregatedUsageInfoRequest, type GetAggregatedUsageInfoResponse, type GetAutomationActionSchemaRequest, type GetAutomationActionSchemaResponse, type GetAutomationRequest, type GetAutomationResponse, type GetAutomationRevisionOptions, type GetAutomationRevisionRequest, type GetAutomationRevisionResponse, type GetOrCreateDraftAutomationRequest, type GetOrCreateDraftAutomationResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, Language, type LanguageWithLiterals, type MergeOverridePreinstalledWithRuntimeVersionRequest, type MergeOverridePreinstalledWithRuntimeVersionResponse, type MessageEnvelope, type MetaSiteSpecialEvent, type MetaSiteSpecialEventPayloadOneOf, type MigrateVeloActionAutomationsRequest, type MigrateVeloActionAutomationsResponse, Namespace, type NamespaceChanged, type NamespaceWithLiterals, type Note, type Notes, type OdeditorAssigned, type OdeditorUnassigned, type Offset, Operator, type OperatorWithLiterals, Origin, type OriginAutomationInfo, type OriginWithLiterals, type OutputAction, type Path, type PicassoAssigned, type PicassoUnassigned, type Plan, type Position, type PreinstalledAutomationSpecInfo, type PreinstalledOrigin, type ProviderConfigurationError, type PublishDraftAutomationRequest, type PublishDraftAutomationResponse, type QueryAutomationsOptions, type QueryAutomationsRequest, type QueryAutomationsResponse, type QueryAutomationsWithDraftsOptions, type QueryAutomationsWithDraftsRequest, type QueryAutomationsWithDraftsResponse, type QueryDraftAutomationsRequest, type QueryDraftAutomationsResponse, type QueryPreinstalledAutomationsForAppOptions, type QueryPreinstalledAutomationsForAppRequest, type QueryPreinstalledAutomationsForAppResponse, type QueryPreinstalledAutomationsRequest, type QueryPreinstalledAutomationsResponse, type Quota, type QuotaInfo, type RateLimit, type RateLimitAction, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, type ServiceProvisioned, type ServiceRemoved, type SetVariablesAction, Severity, type SeverityWithLiterals, type SiteCreated, SiteCreatedContext, type SiteCreatedContextWithLiterals, type SiteDeleted, type SiteHardDeleted, type SiteMarkedAsTemplate, type SiteMarkedAsWixSite, type SitePublished, type SitePurgedExternally, type SiteRenamed, type SiteTransferred, type SiteUndeleted, type SiteUnpublished, type SiteUrlChanged, SortOrder, type SortOrderWithLiterals, type Sorting, type SplitAction, State, type StateWithLiterals, Status, type StatusWithLiterals, type StudioAssigned, type StudioTwoAssigned, type StudioTwoUnassigned, type StudioUnassigned, TimeUnit, type TimeUnitWithLiterals, type Trigger, type TriggerConfigurationError, TriggerErrorType, type TriggerErrorTypeWithLiterals, type TriggerSettings, type TriggerUsageSummary, type TriggerValidationError, type TriggerValidationErrorErrorOneOf, TriggerValidationErrorValidationErrorType, type TriggerValidationErrorValidationErrorTypeWithLiterals, Type, type TypeWithLiterals, type UpdateAutomation, type UpdateAutomationRequest, type UpdateAutomationResponse, type UpdateDraftAutomation, type UpdateDraftAutomationRequest, type UpdateDraftAutomationResponse, type UpdatePreinstalledAutomationRequest, type UpdatePreinstalledAutomationResponse, type UpgradeCTA, type ValidateAutomationByIdOptions, type ValidateAutomationByIdRequest, type ValidateAutomationByIdResponse, type ValidateAutomationOptions, type ValidateAutomationRequest, type ValidateAutomationResponse, ValidationErrorSeverity, type ValidationErrorSeverityWithLiterals, ValidationErrorType, type ValidationErrorTypeWithLiterals, ValidationResultStatus, type ValidationResultStatusWithLiterals, type ValidationSettings, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, type WixelAssigned, type WixelUnassigned, bulkCountAutomationsWithDrafts, bulkDeleteAutomations, copyAutomation, createAutomation, createDraftAutomation, deleteAutomation, deleteDraftAutomation, generateActionInputMappingFromTemplate, generatePreinstalledAutomation, getAggregatedUsageInfo, getAutomation, getAutomationRevision, getOrCreateDraftAutomation, onAutomationCreated, onAutomationDeleted, onAutomationUpdated, publishDraftAutomation, queryAutomations, queryAutomationsWithDrafts, queryPreinstalledAutomationsForApp, typedQueryAutomations, updateAutomation, updateDraftAutomation, validateAutomation, validateAutomationById };
@@ -13,7 +13,7 @@ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transform
13
13
  import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
14
14
  import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
15
15
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
16
- function resolveWixAutomationsV2AutomationRevisionsServiceUrl(opts) {
16
+ function resolveWixAutomationsV2AutomationsServiceUrl(opts) {
17
17
  const domainToMappings = {
18
18
  "manage._base_domain_": [
19
19
  {
@@ -52,7 +52,7 @@ function resolveWixAutomationsV2AutomationRevisionsServiceUrl(opts) {
52
52
  };
53
53
  return resolveUrl(Object.assign(opts, { domainToMappings }));
54
54
  }
55
- function resolveWixAutomationsV2AutomationsServiceUrl(opts) {
55
+ function resolveWixAutomationsV2AutomationRevisionsServiceUrl(opts) {
56
56
  const domainToMappings = {
57
57
  "manage._base_domain_": [
58
58
  {
@@ -92,6 +92,38 @@ function resolveWixAutomationsV2AutomationsServiceUrl(opts) {
92
92
  return resolveUrl(Object.assign(opts, { domainToMappings }));
93
93
  }
94
94
  var PACKAGE_NAME = "@wix/auto_sdk_automations_automations-v-2";
95
+ function getAutomationRevision(payload) {
96
+ function __getAutomationRevision({ host }) {
97
+ const metadata = {
98
+ entityFqdn: "wix.automations.v2.automation",
99
+ method: "GET",
100
+ methodFqn: "wix.automations.v2.AutomationRevisionsService.GetAutomationRevision",
101
+ packageName: PACKAGE_NAME,
102
+ migrationOptions: {
103
+ optInTransformResponse: true
104
+ },
105
+ url: resolveWixAutomationsV2AutomationRevisionsServiceUrl({
106
+ protoPath: "/v1/automation-revisions/{automationId}",
107
+ data: payload,
108
+ host
109
+ }),
110
+ params: toURLSearchParams(payload),
111
+ transformResponse: (payload2) => transformPaths(payload2, [
112
+ {
113
+ transformFn: transformRESTTimestampToSDKTimestamp,
114
+ paths: [
115
+ { path: "automation.createdDate" },
116
+ { path: "automation.updatedDate" },
117
+ { path: "automation.draftUpdatedDate" },
118
+ { path: "automation.autoArchivePolicy.archiveDate" }
119
+ ]
120
+ }
121
+ ])
122
+ };
123
+ return metadata;
124
+ }
125
+ return __getAutomationRevision;
126
+ }
95
127
  function createAutomation(payload) {
96
128
  function __createAutomation({ host }) {
97
129
  const serializedData = transformPaths(payload, [
@@ -729,38 +761,6 @@ function generateActionInputMappingFromTemplate(payload) {
729
761
  }
730
762
  return __generateActionInputMappingFromTemplate;
731
763
  }
732
- function getAutomationRevision(payload) {
733
- function __getAutomationRevision({ host }) {
734
- const metadata = {
735
- entityFqdn: "wix.automations.v2.automation",
736
- method: "GET",
737
- methodFqn: "wix.automations.v2.AutomationRevisionsService.GetAutomationRevision",
738
- packageName: PACKAGE_NAME,
739
- migrationOptions: {
740
- optInTransformResponse: true
741
- },
742
- url: resolveWixAutomationsV2AutomationRevisionsServiceUrl({
743
- protoPath: "/v1/automation-revisions/{automationId}",
744
- data: payload,
745
- host
746
- }),
747
- params: toURLSearchParams(payload),
748
- transformResponse: (payload2) => transformPaths(payload2, [
749
- {
750
- transformFn: transformRESTTimestampToSDKTimestamp,
751
- paths: [
752
- { path: "automation.createdDate" },
753
- { path: "automation.updatedDate" },
754
- { path: "automation.draftUpdatedDate" },
755
- { path: "automation.autoArchivePolicy.archiveDate" }
756
- ]
757
- }
758
- ])
759
- };
760
- return metadata;
761
- }
762
- return __getAutomationRevision;
763
- }
764
764
 
765
765
  // src/automations-v2-automation-automations-v-2.universal.ts
766
766
  import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
@@ -794,6 +794,7 @@ var Type = /* @__PURE__ */ ((Type2) => {
794
794
  Type2["UNKNOWN_ACTION_TYPE"] = "UNKNOWN_ACTION_TYPE";
795
795
  Type2["APP_DEFINED"] = "APP_DEFINED";
796
796
  Type2["CONDITION"] = "CONDITION";
797
+ Type2["CODE_CONDITION"] = "CODE_CONDITION";
797
798
  Type2["DELAY"] = "DELAY";
798
799
  Type2["RATE_LIMIT"] = "RATE_LIMIT";
799
800
  return Type2;
@@ -954,6 +955,37 @@ var AutomationErrorType = /* @__PURE__ */ ((AutomationErrorType2) => {
954
955
  AutomationErrorType2["UNKNOWN_AUTOMATION_ERROR_TYPE"] = "UNKNOWN_AUTOMATION_ERROR_TYPE";
955
956
  return AutomationErrorType2;
956
957
  })(AutomationErrorType || {});
958
+ async function getAutomationRevision2(automationId, options) {
959
+ const { httpClient, sideEffects } = arguments[2];
960
+ const payload = renameKeysFromSDKRequestToRESTRequest({
961
+ automationId,
962
+ revision: options?.revision,
963
+ fields: options?.fields
964
+ });
965
+ const reqOpts = getAutomationRevision(payload);
966
+ sideEffects?.onSiteCall?.();
967
+ try {
968
+ const result = await httpClient.request(reqOpts);
969
+ sideEffects?.onSuccess?.(result);
970
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
971
+ } catch (err) {
972
+ const transformedError = sdkTransformError(
973
+ err,
974
+ {
975
+ spreadPathsToArguments: {},
976
+ explicitPathsToArguments: {
977
+ automationId: "$[0]",
978
+ revision: "$[1].revision",
979
+ fields: "$[1].fields"
980
+ },
981
+ singleArgumentUnchanged: false
982
+ },
983
+ ["automationId", "options"]
984
+ );
985
+ sideEffects?.onError?.(err);
986
+ throw transformedError;
987
+ }
988
+ }
957
989
  async function createAutomation2(automation) {
958
990
  const { httpClient, sideEffects } = arguments[1];
959
991
  const payload = renameKeysFromSDKRequestToRESTRequest({
@@ -1529,37 +1561,6 @@ async function generateActionInputMappingFromTemplate2(appId, options) {
1529
1561
  throw transformedError;
1530
1562
  }
1531
1563
  }
1532
- async function getAutomationRevision2(automationId, options) {
1533
- const { httpClient, sideEffects } = arguments[2];
1534
- const payload = renameKeysFromSDKRequestToRESTRequest({
1535
- automationId,
1536
- revision: options?.revision,
1537
- fields: options?.fields
1538
- });
1539
- const reqOpts = getAutomationRevision(payload);
1540
- sideEffects?.onSiteCall?.();
1541
- try {
1542
- const result = await httpClient.request(reqOpts);
1543
- sideEffects?.onSuccess?.(result);
1544
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1545
- } catch (err) {
1546
- const transformedError = sdkTransformError(
1547
- err,
1548
- {
1549
- spreadPathsToArguments: {},
1550
- explicitPathsToArguments: {
1551
- automationId: "$[0]",
1552
- revision: "$[1].revision",
1553
- fields: "$[1].fields"
1554
- },
1555
- singleArgumentUnchanged: false
1556
- },
1557
- ["automationId", "options"]
1558
- );
1559
- sideEffects?.onError?.(err);
1560
- throw transformedError;
1561
- }
1562
- }
1563
1564
  export {
1564
1565
  ActionErrorType,
1565
1566
  AutomationErrorType,