@wix/automations 1.0.1 → 1.0.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/automations",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -18,10 +18,9 @@
18
18
  "type-bundles"
19
19
  ],
20
20
  "dependencies": {
21
- "@wix/automations_activations": "1.0.1"
21
+ "@wix/automations_activations": "1.0.3"
22
22
  },
23
23
  "devDependencies": {
24
- "@wix/sdk": "https://cdn.dev.wixpress.com/@wix/sdk/02e8069ab2fd783e0e6a080fc7d590e76cb26ab93c8389574286305b.tar.gz",
25
24
  "glob": "^10.4.1",
26
25
  "rollup": "^4.18.0",
27
26
  "rollup-plugin-dts": "^6.1.1",
@@ -43,5 +42,5 @@
43
42
  "fqdn": ""
44
43
  }
45
44
  },
46
- "falconPackageHash": "f0c42f8903bf1086d84e2a85883e16df90579831b07cd73911689f97"
45
+ "falconPackageHash": "641a4c55793cbdf6738d8058ba414a81c1317e5e40414c5588f7c4b3"
47
46
  }
@@ -228,6 +228,15 @@ interface RateLimitAction {
228
228
  /** actions to run in parallel after this action finishes */
229
229
  postActionIds?: string[];
230
230
  }
231
+ interface OutputAction {
232
+ /**
233
+ * Output action output mapping
234
+ * {
235
+ * "to": "{{ var(contact.email) }}"
236
+ * }
237
+ */
238
+ outputMapping?: Record<string, any> | null;
239
+ }
231
240
  declare enum AutomationConfigurationStatus {
232
241
  /** unused */
233
242
  UNKNOWN_STATUS = "UNKNOWN_STATUS",
@@ -358,6 +367,30 @@ interface AutomationSettings {
358
367
  /** Automation's action settings */
359
368
  actionSettings?: ActionSettings;
360
369
  }
370
+ interface ActivationStatus {
371
+ /** Activation's ID. */
372
+ _id?: string;
373
+ /** Configuration's ID. */
374
+ configurationId?: string;
375
+ /** Configuration's Correlation ID. */
376
+ configurationCorrelationId?: string;
377
+ /** Activation's status. */
378
+ status?: Status;
379
+ /** Activation's error reason (if there is one). */
380
+ errorReason?: string | null;
381
+ }
382
+ declare enum Status {
383
+ UNKNOWN_STATUS = "UNKNOWN_STATUS",
384
+ STARTED = "STARTED",
385
+ ENDED = "ENDED",
386
+ ERROR = "ERROR",
387
+ SCHEDULED = "SCHEDULED",
388
+ FROM_SCHEDULER = "FROM_SCHEDULER",
389
+ RETRY = "RETRY",
390
+ RESUMED = "RESUMED",
391
+ PAUSED = "PAUSED",
392
+ ACTION_SKIPPED = "ACTION_SKIPPED"
393
+ }
361
394
  interface ActivationStatusChanged extends ActivationStatusChangedStatusInfoOneOf {
362
395
  /** Initiated status information */
363
396
  initiatedInfo?: InitiatedStatusInfo;
@@ -457,6 +490,184 @@ interface ActivationStatusChangedFailedStatusInfo {
457
490
  */
458
491
  errorCode?: string | null;
459
492
  }
493
+ interface ScheduleRequest {
494
+ schedule?: Schedule;
495
+ }
496
+ interface Schedule {
497
+ /** @readonly */
498
+ _id?: string | null;
499
+ /** doesn't have to be unique. example: triggerName+entityId */
500
+ identifier?: string;
501
+ configurationCorrelationId?: string;
502
+ activationId?: string;
503
+ scheduledAction?: ScheduledAction;
504
+ /** Raw domain event, not enriched */
505
+ eventPayload?: string;
506
+ /** @readonly */
507
+ scheduleStatus?: ScheduleStatus;
508
+ /** @readonly */
509
+ scheduleDate?: Date;
510
+ /** @readonly */
511
+ _createdDate?: Date;
512
+ /** @readonly */
513
+ _updatedDate?: Date;
514
+ overrideable?: boolean | null;
515
+ triggerInfo?: TriggerInfo;
516
+ automation?: Automation;
517
+ }
518
+ interface ScheduledAction {
519
+ /** Action's id. */
520
+ _id?: string;
521
+ /** decide how long we should wait */
522
+ delay?: Delay;
523
+ }
524
+ interface Delay extends DelayOfOneOf {
525
+ simple?: SimpleDelay;
526
+ /**
527
+ * jsonata expression - sleep until the given date
528
+ * for example: $toMillis(MyObject.Date) + 2*1000*60*60*24) -> will schedule 2 days after MyObject.Date
529
+ */
530
+ dateExpression?: string;
531
+ }
532
+ /** @oneof */
533
+ interface DelayOfOneOf {
534
+ simple?: SimpleDelay;
535
+ /**
536
+ * jsonata expression - sleep until the given date
537
+ * for example: $toMillis(MyObject.Date) + 2*1000*60*60*24) -> will schedule 2 days after MyObject.Date
538
+ */
539
+ dateExpression?: string;
540
+ }
541
+ interface SimpleDelay {
542
+ value?: number;
543
+ units?: Units;
544
+ /** Optional, used if provided: Jsonata expression that evaluates to a number of milliseconds to wait */
545
+ delayExpression?: string | null;
546
+ }
547
+ declare enum Units {
548
+ UNKNOWN = "UNKNOWN",
549
+ MINUTES = "MINUTES",
550
+ HOURS = "HOURS",
551
+ DAYS = "DAYS"
552
+ }
553
+ declare enum ScheduleStatus {
554
+ UNKNOWN_SCHEDULE_STATUS = "UNKNOWN_SCHEDULE_STATUS",
555
+ PENDING = "PENDING",
556
+ CANCELLED = "CANCELLED",
557
+ DONE = "DONE"
558
+ }
559
+ interface TriggerInfo {
560
+ /** App id of the initial trigger. */
561
+ appId?: string;
562
+ /** Trigger key of the initial trigger. */
563
+ triggerKey?: string;
564
+ }
565
+ interface ScheduleResponse {
566
+ _id?: string;
567
+ }
568
+ interface CancelPendingScheduleRequest extends CancelPendingScheduleRequestByOneOf {
569
+ _id?: string;
570
+ identifier?: string;
571
+ configurationCorrelationId?: string;
572
+ activationId?: string;
573
+ identifierPattern?: string;
574
+ }
575
+ /** @oneof */
576
+ interface CancelPendingScheduleRequestByOneOf {
577
+ _id?: string;
578
+ identifier?: string;
579
+ configurationCorrelationId?: string;
580
+ activationId?: string;
581
+ identifierPattern?: string;
582
+ }
583
+ interface CancelPendingScheduleResponse {
584
+ }
585
+ interface UpdatePendingSchedulesPayloadRequest {
586
+ identifier?: string;
587
+ eventPayload?: string;
588
+ }
589
+ interface UpdatePendingSchedulesPayloadResponse {
590
+ }
591
+ interface DomainEvent extends DomainEventBodyOneOf {
592
+ createdEvent?: EntityCreatedEvent;
593
+ updatedEvent?: EntityUpdatedEvent;
594
+ deletedEvent?: EntityDeletedEvent;
595
+ actionEvent?: ActionEvent;
596
+ /**
597
+ * Unique event ID.
598
+ * Allows clients to ignore duplicate webhooks.
599
+ */
600
+ _id?: string;
601
+ /**
602
+ * Assumes actions are also always typed to an entity_type
603
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
604
+ */
605
+ entityFqdn?: string;
606
+ /**
607
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
608
+ * This is although the created/updated/deleted notion is duplication of the oneof types
609
+ * Example: created/updated/deleted/started/completed/email_opened
610
+ */
611
+ slug?: string;
612
+ /** ID of the entity associated with the event. */
613
+ entityId?: string;
614
+ /** Event timestamp. */
615
+ eventTime?: Date;
616
+ /**
617
+ * Whether the event was triggered as a result of a privacy regulation application
618
+ * (for example, GDPR).
619
+ */
620
+ triggeredByAnonymizeRequest?: boolean | null;
621
+ /** If present, indicates the action that triggered the event. */
622
+ originatedFrom?: string | null;
623
+ /**
624
+ * A sequence number defining the order of updates to the underlying entity.
625
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
626
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
627
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
628
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
629
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
630
+ */
631
+ entityEventSequence?: string | null;
632
+ }
633
+ /** @oneof */
634
+ interface DomainEventBodyOneOf {
635
+ createdEvent?: EntityCreatedEvent;
636
+ updatedEvent?: EntityUpdatedEvent;
637
+ deletedEvent?: EntityDeletedEvent;
638
+ actionEvent?: ActionEvent;
639
+ }
640
+ interface EntityCreatedEvent {
641
+ entity?: string;
642
+ }
643
+ interface UndeleteInfo {
644
+ deletedDate?: Date;
645
+ }
646
+ interface EntityUpdatedEvent {
647
+ /**
648
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
649
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
650
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
651
+ */
652
+ currentEntity?: string;
653
+ }
654
+ interface EntityDeletedEvent {
655
+ /** Entity that was deleted */
656
+ deletedEntity?: string | null;
657
+ }
658
+ interface ActionEvent {
659
+ body?: string;
660
+ }
661
+ interface MessageEnvelope {
662
+ /** App instance ID. */
663
+ instanceId?: string | null;
664
+ /** Event type. */
665
+ eventType?: string;
666
+ /** The identification type and identity data. */
667
+ identity?: IdentificationData;
668
+ /** Stringify payload. */
669
+ data?: string;
670
+ }
460
671
  interface IdentificationData extends IdentificationDataIdOneOf {
461
672
  /** ID of a site visitor that has not logged in to the site. */
462
673
  anonymousVisitorId?: string;
@@ -487,6 +698,489 @@ declare enum WebhookIdentityType {
487
698
  WIX_USER = "WIX_USER",
488
699
  APP = "APP"
489
700
  }
701
+ interface ActivationRequest {
702
+ /** Activation's ID. */
703
+ activationId?: string;
704
+ /** Configuration's ID. */
705
+ configurationId?: string;
706
+ configurationCorrelationId?: string;
707
+ /** Received event name. */
708
+ eventName?: string;
709
+ /** Received event slug. */
710
+ eventSlug?: string | null;
711
+ /** Received event payload. */
712
+ eventPayload?: string | null;
713
+ /** List of action data. */
714
+ actions?: ActionData[];
715
+ /** External ID. */
716
+ externalId?: string;
717
+ /** The source of this activation */
718
+ source?: ActivationSource;
719
+ /** Actions tree */
720
+ actionsMap?: ActionsData;
721
+ /** Automation V2. Used for reporting domain event until activation request will be deprecated. */
722
+ automation?: Automation;
723
+ /** Trigger entity for the activation, available for v2 and v3 automations only */
724
+ triggerSchema?: Record<string, any> | null;
725
+ }
726
+ interface Runtime {
727
+ }
728
+ interface Scheduler {
729
+ scheduleId?: string | null;
730
+ }
731
+ interface AsyncAction {
732
+ }
733
+ interface ActionData {
734
+ /**
735
+ * Action's id.
736
+ * @readonly
737
+ */
738
+ _id?: string | null;
739
+ /** Action's data. */
740
+ action?: Action;
741
+ }
742
+ interface Action extends ActionActionOneOf {
743
+ service?: Service;
744
+ systemHelper?: SystemHelper;
745
+ spiAction?: SpiAction;
746
+ }
747
+ /** @oneof */
748
+ interface ActionActionOneOf {
749
+ service?: Service;
750
+ systemHelper?: SystemHelper;
751
+ spiAction?: SpiAction;
752
+ }
753
+ interface ServiceMapping {
754
+ /** Sevice name. */
755
+ name?: string;
756
+ /** Method name. */
757
+ method?: string;
758
+ }
759
+ interface IfFilter {
760
+ /** If filter's condition. */
761
+ condition?: string;
762
+ /** If's true post actions. */
763
+ truePostActions?: ActionData[];
764
+ /** If's false post actions. */
765
+ falsePostActions?: ActionData[];
766
+ /** If's true post actions ids. */
767
+ truePostActionsIds?: string[];
768
+ /** If's false post actions ids. */
769
+ falsePostActionsIds?: string[];
770
+ }
771
+ interface SwitchFilter {
772
+ /** Switch's filter cases. */
773
+ cases?: Case[];
774
+ }
775
+ interface Case {
776
+ /** Case's condition. */
777
+ condition?: any;
778
+ /** Case's post actions. */
779
+ postActions?: ActionData[];
780
+ /** Case's post actions ids. */
781
+ postActionsIds?: string[];
782
+ }
783
+ interface DelayHelper {
784
+ /** jsonata expression, for example: triggerName + eventId */
785
+ scheduleIdentifier?: string;
786
+ /** decide how long we should wait */
787
+ delay?: Delay;
788
+ /** Delay's post actions. */
789
+ postActions?: ActionData[];
790
+ /**
791
+ * Optional: if true, any new schedule with the same schedule identifier will override the existing one.
792
+ * If false, the new schedule will be ignored.
793
+ */
794
+ overrideable?: boolean | null;
795
+ /** Delay's post actions ids. */
796
+ postActionsIds?: string[];
797
+ }
798
+ interface RateLimiting {
799
+ /** The maximum number of activations allowed in the given time frame */
800
+ maxNumOfActivations?: number;
801
+ /** Optional, used if provided: A jsonata expression that evaluates to the maximum number of activations allowed in the given time frame */
802
+ maxNumOfActivationsExpression?: string | null;
803
+ /** If given - the time frame in minutes, otherwise, for life */
804
+ timeFrameInMinutes?: number | null;
805
+ /** Optional, used if provided - A jsonata expression that evaluates to the time frame in minutes, otherwise, for life */
806
+ timeFrameInMinutesExpression?: string | null;
807
+ /** The jsonata to use to extract the entity/resource key from the enriched event payload */
808
+ keyJsonata?: string;
809
+ /** The actions to perform if this rate limiting action succeeded - meaning we are still in the allowed number of activations in the given time frame */
810
+ postActions?: ActionData[];
811
+ /** The ids of actions to perform if this rate limiting action succeeded - meaning we are still in the allowed number of activations in the given time frame */
812
+ postActionsIds?: string[];
813
+ }
814
+ interface ConditionFilter {
815
+ /** condition evaluates to `true` if either of the blocks evaluate to `true` (aka OR between all). */
816
+ conditionBlocks?: ConditionBlock[];
817
+ /** Actions to perform when condition_blocks evaluates to `true`. */
818
+ postActions?: ActionData[];
819
+ /** Action's post actions ids. */
820
+ postActionsIds?: string[];
821
+ /** Actions to perform when condition_blocks evaluates to `false`. */
822
+ elsePostActions?: ActionData[];
823
+ }
824
+ declare enum BlockType {
825
+ UNKNOWN = "UNKNOWN",
826
+ OR = "OR",
827
+ AND = "AND"
828
+ }
829
+ interface ConditionBlock {
830
+ type?: BlockType;
831
+ lineExpressions?: string[];
832
+ }
833
+ interface Output {
834
+ /** The jsonata to use to produce the output */
835
+ outputMapping?: string;
836
+ }
837
+ interface Service {
838
+ /** Action's service mapping. */
839
+ serviceMapping?: ServiceMapping;
840
+ /**
841
+ * Action's input mapping.
842
+ * Jsonata description of the input this service gets.
843
+ */
844
+ inputMapping?: string | null;
845
+ /**
846
+ * Action's output mapping.
847
+ * Jsonata description of the output this service returns.
848
+ */
849
+ outputMapping?: string | null;
850
+ /** Action's post actions. */
851
+ postActions?: ActionData[];
852
+ /** Action's post actions ids. */
853
+ postActionsIds?: string[];
854
+ /** The namespace of the action */
855
+ namespace?: string | null;
856
+ }
857
+ interface SystemHelper extends SystemHelperHelperOneOf {
858
+ ifFilter?: IfFilter;
859
+ switchFilter?: SwitchFilter;
860
+ delay?: DelayHelper;
861
+ rateLimiting?: RateLimiting;
862
+ conditionFilter?: ConditionFilter;
863
+ output?: Output;
864
+ }
865
+ /** @oneof */
866
+ interface SystemHelperHelperOneOf {
867
+ ifFilter?: IfFilter;
868
+ switchFilter?: SwitchFilter;
869
+ delay?: DelayHelper;
870
+ rateLimiting?: RateLimiting;
871
+ conditionFilter?: ConditionFilter;
872
+ output?: Output;
873
+ }
874
+ interface SpiAction {
875
+ /** The App Def Id of the action provider */
876
+ appDefId?: string;
877
+ /** Identifier for this action - human readable action key - unique per app def id */
878
+ actionKey?: string;
879
+ /** The configuration of the user for this action, can include params that are taken from the trigger event payload */
880
+ userActionConfig?: string | null;
881
+ /** The post action to execute after this action */
882
+ postActions?: ActionData[];
883
+ /** The output configuration of the user for this action, can include params that are taken from the trigger event payload */
884
+ userOutputActionConfig?: string | null;
885
+ /**
886
+ * optional skip condition expression for current action
887
+ * decides whether to skip the action before executing it's post actions
888
+ */
889
+ skipConditionExpression?: string | null;
890
+ /** Action's post actions ids. */
891
+ postActionsIds?: string[];
892
+ /** The namespace of the action */
893
+ namespace?: string | null;
894
+ }
895
+ interface ActivationSource extends ActivationSourceOfOneOf {
896
+ runtime?: Runtime;
897
+ scheduler?: Scheduler;
898
+ asyncAction?: AsyncAction;
899
+ }
900
+ /** @oneof */
901
+ interface ActivationSourceOfOneOf {
902
+ runtime?: Runtime;
903
+ scheduler?: Scheduler;
904
+ asyncAction?: AsyncAction;
905
+ }
906
+ interface ActionsData {
907
+ /** Ids of the first level actions. */
908
+ rootActionIds?: string[];
909
+ /** Map of action id to action data. */
910
+ actions?: Record<string, Action>;
911
+ }
912
+ interface ActionStatus {
913
+ /** Action's status. */
914
+ _id?: string;
915
+ /** Activation's ID. */
916
+ activationId?: string;
917
+ /** Action's name. */
918
+ actionName?: string | null;
919
+ /** Action's status. */
920
+ status?: Status;
921
+ /** Action's error reason (if there is one). */
922
+ errorReason?: string | null;
923
+ /** Activation external id. */
924
+ activationExternalId?: string;
925
+ /** Trigger app id. */
926
+ triggerAppId?: string | null;
927
+ /** Trigger key. */
928
+ triggerKey?: string | null;
929
+ /** The configuration correlation id */
930
+ configurationCorrelationId?: string | null;
931
+ }
932
+ interface BatchActivationRequest {
933
+ /** List of Activation-Request. */
934
+ activationRequests?: ActivationRequest[];
935
+ }
936
+ interface Empty {
937
+ }
938
+ interface ActivationActionStatusChanged extends ActivationActionStatusChangedStatusInfoOneOf {
939
+ /** Started status information */
940
+ startedInfo?: StartedStatusInfo;
941
+ /** Ended status information */
942
+ endedInfo?: EndedStatusInfo;
943
+ /** Failed status information */
944
+ failedInfo?: FailedStatusInfo;
945
+ /** Action ID */
946
+ _id?: string;
947
+ /** Activation ID */
948
+ activationId?: string;
949
+ /** Automation info */
950
+ automationInfo?: AutomationInfo;
951
+ /** Action type */
952
+ type?: Type;
953
+ /** Event date */
954
+ statusChangedDate?: Date;
955
+ /** Action activation status */
956
+ status?: ActivationActionStatusChangedStatus;
957
+ }
958
+ /** @oneof */
959
+ interface ActivationActionStatusChangedStatusInfoOneOf {
960
+ /** Started status information */
961
+ startedInfo?: StartedStatusInfo;
962
+ /** Ended status information */
963
+ endedInfo?: EndedStatusInfo;
964
+ /** Failed status information */
965
+ failedInfo?: FailedStatusInfo;
966
+ }
967
+ interface StartedStatusInfoAppDefinedActionInfo {
968
+ /** Action input */
969
+ input?: Record<string, any> | null;
970
+ }
971
+ interface DelayActionInfo {
972
+ /** Indicates when this action becomes completed and the activation will move to the post actions */
973
+ date?: Date;
974
+ }
975
+ interface ExpressionEvaluationResult {
976
+ /** Indicates if the expression was evaluated to true or false */
977
+ passed?: boolean;
978
+ /** Indicates if there was an error in the evaluation process */
979
+ error?: boolean;
980
+ }
981
+ interface AppDefinedActionInfo {
982
+ /** The output that the action implementer returned */
983
+ output?: Record<string, any> | null;
984
+ }
985
+ interface ConditionActionInfo {
986
+ /** Indicates that the condition `if` clause evaluated to `true` */
987
+ passed?: boolean;
988
+ /** Collects results per each expression evaluation that took place */
989
+ expressionResults?: Record<string, ExpressionEvaluationResult>;
990
+ }
991
+ interface RateLimitActionInfo {
992
+ /** Indicates if the rate limiter passed (not reached the quota) */
993
+ passed?: boolean;
994
+ }
995
+ interface AutomationInfo extends AutomationInfoOriginInfoOneOf {
996
+ /** Application info */
997
+ applicationInfo?: ApplicationOrigin;
998
+ /** Preinstalled info */
999
+ preinstalledInfo?: PreinstalledOrigin;
1000
+ /** Automation ID */
1001
+ _id?: string;
1002
+ /** Origin type */
1003
+ origin?: Origin;
1004
+ }
1005
+ /** @oneof */
1006
+ interface AutomationInfoOriginInfoOneOf {
1007
+ /** Application info */
1008
+ applicationInfo?: ApplicationOrigin;
1009
+ /** Preinstalled info */
1010
+ preinstalledInfo?: PreinstalledOrigin;
1011
+ }
1012
+ declare enum ActivationActionStatusChangedStatus {
1013
+ UNKNOWN_ACTION_ACTIVATION_STATUS = "UNKNOWN_ACTION_ACTIVATION_STATUS",
1014
+ /**
1015
+ * Indicating that action activation has been started and it's in progress
1016
+ * Relevant to action types: APP_DEFINED, DELAY
1017
+ */
1018
+ STARTED = "STARTED",
1019
+ /**
1020
+ * Indicating that the action activation is completed without errors
1021
+ * Relevant to action types: APP_DEFINED, DELAY, CONDITION, RATE_LIMIT
1022
+ */
1023
+ ENDED = "ENDED",
1024
+ /**
1025
+ * Indicating that the action is skipped and post actions will not start
1026
+ * Relevant to action types: APP_DEFINED
1027
+ */
1028
+ SKIPPED = "SKIPPED",
1029
+ /**
1030
+ * Indicating that the action failed
1031
+ * Relevant to action types: APP_DEFINED, DELAY, RATE_LIMIT
1032
+ */
1033
+ FAILED = "FAILED"
1034
+ }
1035
+ interface StartedStatusInfo extends StartedStatusInfoTypeInfoOneOf {
1036
+ /** APP DEFINED action additional info */
1037
+ appDefinedActionInfo?: StartedStatusInfoAppDefinedActionInfo;
1038
+ /** Delay action additional info */
1039
+ delayActionInfo?: DelayActionInfo;
1040
+ }
1041
+ /** @oneof */
1042
+ interface StartedStatusInfoTypeInfoOneOf {
1043
+ /** APP DEFINED action additional info */
1044
+ appDefinedActionInfo?: StartedStatusInfoAppDefinedActionInfo;
1045
+ /** Delay action additional info */
1046
+ delayActionInfo?: DelayActionInfo;
1047
+ }
1048
+ interface EndedStatusInfo extends EndedStatusInfoTypeInfoOneOf {
1049
+ /** APP DEFINED action additional info */
1050
+ appDefinedActionInfo?: AppDefinedActionInfo;
1051
+ /** Condition action additional info */
1052
+ conditionActionInfo?: ConditionActionInfo;
1053
+ /** Rate limit action additional info */
1054
+ rateLimitActionInfo?: RateLimitActionInfo;
1055
+ }
1056
+ /** @oneof */
1057
+ interface EndedStatusInfoTypeInfoOneOf {
1058
+ /** APP DEFINED action additional info */
1059
+ appDefinedActionInfo?: AppDefinedActionInfo;
1060
+ /** Condition action additional info */
1061
+ conditionActionInfo?: ConditionActionInfo;
1062
+ /** Rate limit action additional info */
1063
+ rateLimitActionInfo?: RateLimitActionInfo;
1064
+ }
1065
+ interface FailedStatusInfo {
1066
+ /** Error description */
1067
+ errorDescription?: string;
1068
+ /** Error code */
1069
+ errorCode?: string | null;
1070
+ }
1071
+ interface ActivationResumeAfterDelay {
1072
+ /** Activation identifier */
1073
+ _id?: string;
1074
+ /** Activation schedule identifier */
1075
+ scheduleId?: string;
1076
+ /** Activation schedule due date */
1077
+ scheduleDate?: Date;
1078
+ /** Activation payload */
1079
+ payload?: Record<string, any> | null;
1080
+ /** Activation Automation */
1081
+ automation?: Automation;
1082
+ /** Scheduled action identifier - with the intent to execute that action's post actions */
1083
+ scheduledActionId?: string;
1084
+ /** Optional - external entity id that this activation is related to */
1085
+ externalEntityId?: string | null;
1086
+ }
1087
+ interface ActionCompletedRequest {
1088
+ /** The execution identifier that was given to the spi provider when we invoked the action */
1089
+ executionIdentifier?: string;
1090
+ /** The result of invoking the action. Must conform to the output schema configured by the action provider. */
1091
+ result?: Record<string, any> | null;
1092
+ }
1093
+ interface RefreshPayloadRequest {
1094
+ /** Application definition ID. */
1095
+ appDefId?: string;
1096
+ /** Trigger key. */
1097
+ triggerKey?: string;
1098
+ /** Payload to refresh. */
1099
+ payload?: Record<string, any> | null;
1100
+ /** External entity ID. */
1101
+ externalEntityId?: string | null;
1102
+ }
1103
+ interface RefreshPayloadResponse {
1104
+ /** Updated payload. */
1105
+ payload?: Record<string, any> | null;
1106
+ /** If the automation activation should be canceled (default is false) */
1107
+ cancelActivation?: boolean | null;
1108
+ }
1109
+ interface RunAutomationRequest {
1110
+ /** App of the automation trigger */
1111
+ appId?: string;
1112
+ /** Trigger key of the action */
1113
+ triggerKey?: string;
1114
+ /** Payload of the triggered event */
1115
+ triggerPayload?: Record<string, any> | null;
1116
+ /** Specific automation id to run */
1117
+ automationId?: string;
1118
+ }
1119
+ interface RunAutomationResponse {
1120
+ /** Automation activation output payload */
1121
+ output?: Record<string, any> | null;
1122
+ }
1123
+ interface ActivationScheduleRequested {
1124
+ /** Activation identifier */
1125
+ _id?: string;
1126
+ /** Activation schedule request date */
1127
+ requestedDate?: Date;
1128
+ /** Activation schedule due date */
1129
+ scheduleDate?: Date;
1130
+ /** Activation payload */
1131
+ payload?: Record<string, any> | null;
1132
+ /** Activation Automation */
1133
+ automation?: Automation;
1134
+ /** Optional - external entity id that this activation is related to */
1135
+ externalEntityId?: string | null;
1136
+ }
1137
+ interface ActivationContinuedAfterSchedule {
1138
+ /** Activation identifier */
1139
+ _id?: string;
1140
+ /** Activation Automation */
1141
+ automation?: Automation;
1142
+ }
1143
+ interface ReportEventRequest {
1144
+ /**
1145
+ * Trigger key as defined in your app's trigger configuration
1146
+ * in the Wix Developers Center.
1147
+ * For example, `form_submitted` or `invoice_due`.
1148
+ */
1149
+ triggerKey: string;
1150
+ /**
1151
+ * Event payload, formatted as key:value pairs.
1152
+ * Must comply with the payload schema
1153
+ * if you provided one when configuring your trigger.
1154
+ *
1155
+ * Key names can include only alphanumeric characters or underscores
1156
+ * (`A-Z`, `a-z`, `0-9`, `_`).
1157
+ * They cannot start with an underscore.
1158
+ *
1159
+ * Values can be strings, numbers, integers, booleans, or arrays.
1160
+ * If a value is an array, the array items must be objects,
1161
+ * and nested object properties must be
1162
+ * strings, numbers, integers, or booleans only.
1163
+ */
1164
+ payload?: Record<string, any> | null;
1165
+ /**
1166
+ * ID of the related resource in GUID format.
1167
+ * For example, `fc81a355-3429-50fc-a4c7-def486e828f3`.
1168
+ *
1169
+ * Required if your app needs to
1170
+ * [cancel the event](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/cancel-event)
1171
+ * if the automation becomes no longer relevant.
1172
+ *
1173
+ * Typically, this ID is defined in your system,
1174
+ * but you can also use any Wix resource GUID,
1175
+ * such as contact ID, member ID, or invoice ID.
1176
+ * See
1177
+ * [Choose the right `externalEntityId`](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/reporting-and-canceling-events#about-canceling-events)
1178
+ * for more information.
1179
+ */
1180
+ externalEntityId?: string | null;
1181
+ /** Idempotency information for the event */
1182
+ idempotency?: Idempotency;
1183
+ }
490
1184
  interface Idempotency {
491
1185
  /**
492
1186
  * A unique identifier for the event.
@@ -501,6 +1195,16 @@ interface ReportEventResponse {
501
1195
  /** The activation IDs of triggered ReportEvents. */
502
1196
  activationIds?: string[];
503
1197
  }
1198
+ interface BulkReportEventRequest {
1199
+ /**
1200
+ * Trigger key as defined in your app's trigger configuration
1201
+ * in the Wix Developers Center.
1202
+ * For example, `form_submitted` or `invoice_due`.
1203
+ */
1204
+ triggerKey: string;
1205
+ /** Repeated list of event details for bulk reporting */
1206
+ eventsInfo: EventInfo[];
1207
+ }
504
1208
  interface EventInfo {
505
1209
  /**
506
1210
  * Event payload, formatted as key:value pairs.
@@ -555,6 +1259,15 @@ interface BulkActionMetadata {
555
1259
  /** Number of failures without details because detailed failure threshold was exceeded. */
556
1260
  undetailedFailures?: number;
557
1261
  }
1262
+ interface BulkCancelEventRequest {
1263
+ /**
1264
+ * Trigger key whose events you want to cancel.
1265
+ * For example, `form_submitted` or `invoice_due`.
1266
+ */
1267
+ triggerKey: string;
1268
+ /** Repeated list of external_entity_id, representing the related resources' IDs */
1269
+ externalEntityIds: string[];
1270
+ }
558
1271
  interface BulkCancelEventResponse {
559
1272
  /** Trigger key related to the cancelled event */
560
1273
  triggerKey?: string;
@@ -569,6 +1282,114 @@ interface BulkCancelEventResult {
569
1282
  /** ID of the related resource in GUID format */
570
1283
  externalEntityId?: string;
571
1284
  }
1285
+ interface CancelEventRequest {
1286
+ /**
1287
+ * ID of the related resource in GUID format.
1288
+ * For example, `fc81a355-3429-50fc-a4c7-def486e828f3`.
1289
+ *
1290
+ * Typically, this ID is defined in your system,
1291
+ * but you can also use any Wix resource GUID,
1292
+ * such as contact ID, member ID, or invoice ID.
1293
+ * See
1294
+ * [Choose the right `externalEntityId`](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/reporting-and-canceling-events#choose-the-right-externalentityid)
1295
+ * for more information.
1296
+ */
1297
+ externalEntityId: string;
1298
+ /**
1299
+ * Trigger key whose event you want to cancel.
1300
+ * For example, `form_submitted` or `invoice_due`.
1301
+ */
1302
+ triggerKey: string;
1303
+ }
1304
+ interface CancelEventResponse {
1305
+ }
1306
+ interface V1RunAutomationRequest extends V1RunAutomationRequestIdentifierOneOf {
1307
+ /** a preinstalled automation identifier */
1308
+ preinstalledIdentifier?: PreinstalledIdentifier;
1309
+ /** a automation of any type identifier that will be available in future */
1310
+ automationIdentifier?: AutomationIdentifier;
1311
+ /** identifier MUST be either AUTOMATION or PREINSTALLED */
1312
+ identifierType?: IdentifierType;
1313
+ /**
1314
+ * Event payload, formatted as key:value pairs.
1315
+ * Must comply with the payload schema
1316
+ * if you provided one when configuring your trigger.
1317
+ *
1318
+ * Key names can include only alphanumeric characters or underscores
1319
+ * (`A-Z`, `a-z`, `0-9`, `_`).
1320
+ * They cannot start with an underscore.
1321
+ *
1322
+ * Values can be strings, numbers, integers, booleans, or arrays.
1323
+ * If a value is an array, the array items must be objects,
1324
+ * and nested object properties must be
1325
+ * strings, numbers, integers, or booleans only.
1326
+ */
1327
+ payload?: Record<string, any> | null;
1328
+ }
1329
+ /** @oneof */
1330
+ interface V1RunAutomationRequestIdentifierOneOf {
1331
+ /** a preinstalled automation identifier */
1332
+ preinstalledIdentifier?: PreinstalledIdentifier;
1333
+ /** a automation of any type identifier that will be available in future */
1334
+ automationIdentifier?: AutomationIdentifier;
1335
+ }
1336
+ declare enum IdentifierType {
1337
+ UNKNOWN_IDENTIFIER = "UNKNOWN_IDENTIFIER",
1338
+ PREINSTALLED = "PREINSTALLED",
1339
+ AUTOMATION = "AUTOMATION"
1340
+ }
1341
+ interface PreinstalledIdentifier {
1342
+ /** identifier for the application of the preinstalled */
1343
+ appId?: string;
1344
+ /** application component id */
1345
+ componentId?: string;
1346
+ }
1347
+ interface AutomationIdentifier {
1348
+ /** automation id */
1349
+ automationId?: string;
1350
+ }
1351
+ interface V1RunAutomationResponse {
1352
+ }
1353
+ interface ReportDomainEventRequest {
1354
+ /** trigger app id */
1355
+ triggerAppId?: string;
1356
+ /** report event request */
1357
+ reportEventRequest?: ReportEventRequest;
1358
+ }
1359
+ interface ReportDomainEventResponse {
1360
+ }
1361
+ interface ExecuteFromActionRequest {
1362
+ /** Requested action id */
1363
+ actionId?: string;
1364
+ /** Optional: an activation id to link this action to */
1365
+ activationId?: string | null;
1366
+ /** Activation payload */
1367
+ payload?: Record<string, any> | null;
1368
+ /** Configuration correlation id to run this action from */
1369
+ configurationCorrelationId?: string;
1370
+ /** Optional - schedule id that this action was scheduled from */
1371
+ scheduleId?: string | null;
1372
+ /** Optional - an external entity id that this execution is related to */
1373
+ externalEntityId?: string | null;
1374
+ /** Optional - Activation automation */
1375
+ automation?: Automation;
1376
+ }
1377
+ interface ExecuteFromActionResponse {
1378
+ }
1379
+ interface ActivationScheduleCompleted {
1380
+ /** Activation identifier */
1381
+ _id?: string;
1382
+ /** Activation schedule identifier */
1383
+ scheduleId?: string;
1384
+ /** Activation schedule due date */
1385
+ scheduleDate?: Date;
1386
+ /** Activation payload */
1387
+ payload?: Record<string, any> | null;
1388
+ /** Activation Automation */
1389
+ automation?: Automation;
1390
+ /** Optional - external entity id that this activation is related to */
1391
+ externalEntityId?: string | null;
1392
+ }
572
1393
  interface ReportEventResponseNonNullableFields {
573
1394
  activationIds: string[];
574
1395
  }
@@ -719,6 +1540,8 @@ interface CancelEventOptions {
719
1540
  type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
720
1541
  interface HttpClient {
721
1542
  request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
1543
+ fetchWithAuth: typeof fetch;
1544
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
722
1545
  }
723
1546
  type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
724
1547
  type HttpResponse<T = any> = {
@@ -744,32 +1567,203 @@ type EventDefinition<Payload = unknown, Type extends string = string> = {
744
1567
  __type: 'event-definition';
745
1568
  type: Type;
746
1569
  isDomainEvent?: boolean;
747
- transformations?: unknown;
1570
+ transformations?: (envelope: unknown) => Payload;
748
1571
  __payload: Payload;
749
1572
  };
750
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
1573
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
751
1574
  type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
752
1575
  type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
753
1576
 
754
- declare function reportEvent$1(httpClient: HttpClient): (triggerKey: string, options?: ReportEventOptions) => Promise<ReportEventResponse & ReportEventResponseNonNullableFields>;
755
- declare function bulkReportEvent$1(httpClient: HttpClient): (triggerKey: string, options: BulkReportEventOptions) => Promise<BulkReportEventResponse & BulkReportEventResponseNonNullableFields>;
756
- declare function bulkCancelEvent$1(httpClient: HttpClient): (triggerKey: string, options: BulkCancelEventOptions) => Promise<BulkCancelEventResponse & BulkCancelEventResponseNonNullableFields>;
757
- declare function cancelEvent$1(httpClient: HttpClient): (externalEntityId: string, options: CancelEventOptions) => Promise<void>;
758
- declare const onActivationStatusChanged$1: EventDefinition<ActivationStatusChangedEnvelope, "wix.automations.v2.activation_activation_status_changed">;
1577
+ declare global {
1578
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1579
+ interface SymbolConstructor {
1580
+ readonly observable: symbol;
1581
+ }
1582
+ }
1583
+
1584
+ declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
1585
+
1586
+ declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
759
1587
 
760
- declare const reportEvent: BuildRESTFunction<typeof reportEvent$1>;
761
- declare const bulkReportEvent: BuildRESTFunction<typeof bulkReportEvent$1>;
762
- declare const bulkCancelEvent: BuildRESTFunction<typeof bulkCancelEvent$1>;
763
- declare const cancelEvent: BuildRESTFunction<typeof cancelEvent$1>;
764
- declare const onActivationStatusChanged: BuildEventDefinition<typeof onActivationStatusChanged$1>;
1588
+ declare const reportEvent: ReturnType<typeof createRESTModule<typeof publicReportEvent>>;
1589
+ declare const bulkReportEvent: ReturnType<typeof createRESTModule<typeof publicBulkReportEvent>>;
1590
+ declare const bulkCancelEvent: ReturnType<typeof createRESTModule<typeof publicBulkCancelEvent>>;
1591
+ declare const cancelEvent: ReturnType<typeof createRESTModule<typeof publicCancelEvent>>;
1592
+ declare const onActivationStatusChanged: ReturnType<typeof createEventModule<typeof publicOnActivationStatusChanged>>;
765
1593
 
1594
+ type context_Action = Action;
1595
+ type context_ActionActionOneOf = ActionActionOneOf;
1596
+ type context_ActionCompletedRequest = ActionCompletedRequest;
1597
+ type context_ActionData = ActionData;
1598
+ type context_ActionEvent = ActionEvent;
1599
+ type context_ActionSettings = ActionSettings;
1600
+ type context_ActionStatus = ActionStatus;
1601
+ type context_ActionsData = ActionsData;
1602
+ type context_Activation = Activation;
1603
+ type context_ActivationActionStatusChanged = ActivationActionStatusChanged;
1604
+ type context_ActivationActionStatusChangedStatus = ActivationActionStatusChangedStatus;
1605
+ declare const context_ActivationActionStatusChangedStatus: typeof ActivationActionStatusChangedStatus;
1606
+ type context_ActivationActionStatusChangedStatusInfoOneOf = ActivationActionStatusChangedStatusInfoOneOf;
1607
+ type context_ActivationContinuedAfterSchedule = ActivationContinuedAfterSchedule;
1608
+ type context_ActivationRequest = ActivationRequest;
1609
+ type context_ActivationResumeAfterDelay = ActivationResumeAfterDelay;
1610
+ type context_ActivationScheduleCompleted = ActivationScheduleCompleted;
1611
+ type context_ActivationScheduleRequested = ActivationScheduleRequested;
1612
+ type context_ActivationSource = ActivationSource;
1613
+ type context_ActivationSourceOfOneOf = ActivationSourceOfOneOf;
1614
+ type context_ActivationStatus = ActivationStatus;
1615
+ type context_ActivationStatusChanged = ActivationStatusChanged;
1616
+ type context_ActivationStatusChangedEnvelope = ActivationStatusChangedEnvelope;
1617
+ type context_ActivationStatusChangedFailedStatusInfo = ActivationStatusChangedFailedStatusInfo;
1618
+ type context_ActivationStatusChangedStatus = ActivationStatusChangedStatus;
1619
+ declare const context_ActivationStatusChangedStatus: typeof ActivationStatusChangedStatus;
1620
+ type context_ActivationStatusChangedStatusInfoOneOf = ActivationStatusChangedStatusInfoOneOf;
1621
+ type context_AppDefinedAction = AppDefinedAction;
1622
+ type context_AppDefinedActionInfo = AppDefinedActionInfo;
1623
+ type context_ApplicationError = ApplicationError;
1624
+ type context_ApplicationOrigin = ApplicationOrigin;
1625
+ type context_AsyncAction = AsyncAction;
1626
+ type context_AuditInfo = AuditInfo;
1627
+ type context_AuditInfoIdOneOf = AuditInfoIdOneOf;
1628
+ type context_Automation = Automation;
1629
+ type context_AutomationConfiguration = AutomationConfiguration;
1630
+ type context_AutomationConfigurationAction = AutomationConfigurationAction;
1631
+ type context_AutomationConfigurationActionInfoOneOf = AutomationConfigurationActionInfoOneOf;
1632
+ type context_AutomationConfigurationStatus = AutomationConfigurationStatus;
1633
+ declare const context_AutomationConfigurationStatus: typeof AutomationConfigurationStatus;
1634
+ type context_AutomationIdentifier = AutomationIdentifier;
1635
+ type context_AutomationInfo = AutomationInfo;
1636
+ type context_AutomationInfoOriginInfoOneOf = AutomationInfoOriginInfoOneOf;
1637
+ type context_AutomationOriginInfoOneOf = AutomationOriginInfoOneOf;
1638
+ type context_AutomationSettings = AutomationSettings;
1639
+ type context_BaseEventMetadata = BaseEventMetadata;
1640
+ type context_BatchActivationRequest = BatchActivationRequest;
1641
+ type context_BlockType = BlockType;
1642
+ declare const context_BlockType: typeof BlockType;
1643
+ type context_BulkActionMetadata = BulkActionMetadata;
1644
+ type context_BulkCancelEventOptions = BulkCancelEventOptions;
1645
+ type context_BulkCancelEventRequest = BulkCancelEventRequest;
1646
+ type context_BulkCancelEventResponse = BulkCancelEventResponse;
1647
+ type context_BulkCancelEventResponseNonNullableFields = BulkCancelEventResponseNonNullableFields;
1648
+ type context_BulkCancelEventResult = BulkCancelEventResult;
1649
+ type context_BulkReportEventOptions = BulkReportEventOptions;
1650
+ type context_BulkReportEventRequest = BulkReportEventRequest;
1651
+ type context_BulkReportEventResponse = BulkReportEventResponse;
1652
+ type context_BulkReportEventResponseNonNullableFields = BulkReportEventResponseNonNullableFields;
1653
+ type context_BulkReportEventResult = BulkReportEventResult;
1654
+ type context_CancelEventOptions = CancelEventOptions;
1655
+ type context_CancelEventRequest = CancelEventRequest;
1656
+ type context_CancelEventResponse = CancelEventResponse;
1657
+ type context_CancelPendingScheduleRequest = CancelPendingScheduleRequest;
1658
+ type context_CancelPendingScheduleRequestByOneOf = CancelPendingScheduleRequestByOneOf;
1659
+ type context_CancelPendingScheduleResponse = CancelPendingScheduleResponse;
1660
+ type context_CancellationReason = CancellationReason;
1661
+ declare const context_CancellationReason: typeof CancellationReason;
1662
+ type context_CancelledStatusInfo = CancelledStatusInfo;
1663
+ type context_Case = Case;
1664
+ type context_ConditionAction = ConditionAction;
1665
+ type context_ConditionActionInfo = ConditionActionInfo;
1666
+ type context_ConditionBlock = ConditionBlock;
1667
+ type context_ConditionExpressionGroup = ConditionExpressionGroup;
1668
+ type context_ConditionFilter = ConditionFilter;
1669
+ type context_Delay = Delay;
1670
+ type context_DelayAction = DelayAction;
1671
+ type context_DelayActionInfo = DelayActionInfo;
1672
+ type context_DelayHelper = DelayHelper;
1673
+ type context_DelayOfOneOf = DelayOfOneOf;
1674
+ type context_DomainEvent = DomainEvent;
1675
+ type context_DomainEventBodyOneOf = DomainEventBodyOneOf;
1676
+ type context_Empty = Empty;
1677
+ type context_EndedStatusInfo = EndedStatusInfo;
1678
+ type context_EndedStatusInfoTypeInfoOneOf = EndedStatusInfoTypeInfoOneOf;
1679
+ type context_EntityCreatedEvent = EntityCreatedEvent;
1680
+ type context_EntityDeletedEvent = EntityDeletedEvent;
1681
+ type context_EntityUpdatedEvent = EntityUpdatedEvent;
1682
+ type context_EventInfo = EventInfo;
1683
+ type context_EventMetadata = EventMetadata;
1684
+ type context_ExecuteFromActionRequest = ExecuteFromActionRequest;
1685
+ type context_ExecuteFromActionResponse = ExecuteFromActionResponse;
1686
+ type context_ExpressionEvaluationResult = ExpressionEvaluationResult;
1687
+ type context_FailedStatusInfo = FailedStatusInfo;
1688
+ type context_Filter = Filter;
1689
+ type context_FutureDateActivationOffset = FutureDateActivationOffset;
1690
+ type context_Idempotency = Idempotency;
1691
+ type context_IdentificationData = IdentificationData;
1692
+ type context_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
1693
+ type context_IdentifierType = IdentifierType;
1694
+ declare const context_IdentifierType: typeof IdentifierType;
1695
+ type context_Identity = Identity;
1696
+ type context_IfFilter = IfFilter;
1697
+ type context_InitiatedStatusInfo = InitiatedStatusInfo;
1698
+ type context_ItemMetadata = ItemMetadata;
1699
+ type context_MessageEnvelope = MessageEnvelope;
1700
+ type context_Operator = Operator;
1701
+ declare const context_Operator: typeof Operator;
1702
+ type context_Origin = Origin;
1703
+ declare const context_Origin: typeof Origin;
1704
+ type context_Output = Output;
1705
+ type context_OutputAction = OutputAction;
1706
+ type context_PreinstalledIdentifier = PreinstalledIdentifier;
1707
+ type context_PreinstalledOrigin = PreinstalledOrigin;
1708
+ type context_RateLimitAction = RateLimitAction;
1709
+ type context_RateLimitActionInfo = RateLimitActionInfo;
1710
+ type context_RateLimiting = RateLimiting;
1711
+ type context_RefreshPayloadRequest = RefreshPayloadRequest;
1712
+ type context_RefreshPayloadResponse = RefreshPayloadResponse;
1713
+ type context_ReportDomainEventRequest = ReportDomainEventRequest;
1714
+ type context_ReportDomainEventResponse = ReportDomainEventResponse;
1715
+ type context_ReportEventOptions = ReportEventOptions;
1716
+ type context_ReportEventRequest = ReportEventRequest;
1717
+ type context_ReportEventResponse = ReportEventResponse;
1718
+ type context_ReportEventResponseNonNullableFields = ReportEventResponseNonNullableFields;
1719
+ type context_RunAutomationRequest = RunAutomationRequest;
1720
+ type context_RunAutomationResponse = RunAutomationResponse;
1721
+ type context_Runtime = Runtime;
1722
+ type context_Schedule = Schedule;
1723
+ type context_ScheduleRequest = ScheduleRequest;
1724
+ type context_ScheduleResponse = ScheduleResponse;
1725
+ type context_ScheduleStatus = ScheduleStatus;
1726
+ declare const context_ScheduleStatus: typeof ScheduleStatus;
1727
+ type context_ScheduledAction = ScheduledAction;
1728
+ type context_ScheduledStatusInfo = ScheduledStatusInfo;
1729
+ type context_Scheduler = Scheduler;
1730
+ type context_Service = Service;
1731
+ type context_ServiceMapping = ServiceMapping;
1732
+ type context_SimpleDelay = SimpleDelay;
1733
+ type context_SpiAction = SpiAction;
1734
+ type context_StartedStatusInfo = StartedStatusInfo;
1735
+ type context_StartedStatusInfoAppDefinedActionInfo = StartedStatusInfoAppDefinedActionInfo;
1736
+ type context_StartedStatusInfoTypeInfoOneOf = StartedStatusInfoTypeInfoOneOf;
1737
+ type context_Status = Status;
1738
+ declare const context_Status: typeof Status;
1739
+ type context_SwitchFilter = SwitchFilter;
1740
+ type context_SystemHelper = SystemHelper;
1741
+ type context_SystemHelperHelperOneOf = SystemHelperHelperOneOf;
1742
+ type context_Target = Target;
1743
+ declare const context_Target: typeof Target;
1744
+ type context_TimeUnit = TimeUnit;
1745
+ declare const context_TimeUnit: typeof TimeUnit;
1746
+ type context_Trigger = Trigger;
1747
+ type context_TriggerInfo = TriggerInfo;
1748
+ type context_Type = Type;
1749
+ declare const context_Type: typeof Type;
1750
+ type context_UndeleteInfo = UndeleteInfo;
1751
+ type context_Units = Units;
1752
+ declare const context_Units: typeof Units;
1753
+ type context_UpdatePendingSchedulesPayloadRequest = UpdatePendingSchedulesPayloadRequest;
1754
+ type context_UpdatePendingSchedulesPayloadResponse = UpdatePendingSchedulesPayloadResponse;
1755
+ type context_V1RunAutomationRequest = V1RunAutomationRequest;
1756
+ type context_V1RunAutomationRequestIdentifierOneOf = V1RunAutomationRequestIdentifierOneOf;
1757
+ type context_V1RunAutomationResponse = V1RunAutomationResponse;
1758
+ type context_WebhookIdentityType = WebhookIdentityType;
1759
+ declare const context_WebhookIdentityType: typeof WebhookIdentityType;
766
1760
  declare const context_bulkCancelEvent: typeof bulkCancelEvent;
767
1761
  declare const context_bulkReportEvent: typeof bulkReportEvent;
768
1762
  declare const context_cancelEvent: typeof cancelEvent;
769
1763
  declare const context_onActivationStatusChanged: typeof onActivationStatusChanged;
770
1764
  declare const context_reportEvent: typeof reportEvent;
771
1765
  declare namespace context {
772
- export { context_bulkCancelEvent as bulkCancelEvent, context_bulkReportEvent as bulkReportEvent, context_cancelEvent as cancelEvent, context_onActivationStatusChanged as onActivationStatusChanged, context_reportEvent as reportEvent };
1766
+ export { type context_Action as Action, type context_ActionActionOneOf as ActionActionOneOf, type context_ActionCompletedRequest as ActionCompletedRequest, type context_ActionData as ActionData, type context_ActionEvent as ActionEvent, type context_ActionSettings as ActionSettings, type context_ActionStatus as ActionStatus, type context_ActionsData as ActionsData, type context_Activation as Activation, type context_ActivationActionStatusChanged as ActivationActionStatusChanged, context_ActivationActionStatusChangedStatus as ActivationActionStatusChangedStatus, type context_ActivationActionStatusChangedStatusInfoOneOf as ActivationActionStatusChangedStatusInfoOneOf, type context_ActivationContinuedAfterSchedule as ActivationContinuedAfterSchedule, type context_ActivationRequest as ActivationRequest, type context_ActivationResumeAfterDelay as ActivationResumeAfterDelay, type context_ActivationScheduleCompleted as ActivationScheduleCompleted, type context_ActivationScheduleRequested as ActivationScheduleRequested, type context_ActivationSource as ActivationSource, type context_ActivationSourceOfOneOf as ActivationSourceOfOneOf, type context_ActivationStatus as ActivationStatus, type context_ActivationStatusChanged as ActivationStatusChanged, type context_ActivationStatusChangedEnvelope as ActivationStatusChangedEnvelope, type context_ActivationStatusChangedFailedStatusInfo as ActivationStatusChangedFailedStatusInfo, context_ActivationStatusChangedStatus as ActivationStatusChangedStatus, type context_ActivationStatusChangedStatusInfoOneOf as ActivationStatusChangedStatusInfoOneOf, type context_AppDefinedAction as AppDefinedAction, type context_AppDefinedActionInfo as AppDefinedActionInfo, type context_ApplicationError as ApplicationError, type context_ApplicationOrigin as ApplicationOrigin, type context_AsyncAction as AsyncAction, type context_AuditInfo as AuditInfo, type context_AuditInfoIdOneOf as AuditInfoIdOneOf, type context_Automation as Automation, type context_AutomationConfiguration as AutomationConfiguration, type context_AutomationConfigurationAction as AutomationConfigurationAction, type context_AutomationConfigurationActionInfoOneOf as AutomationConfigurationActionInfoOneOf, context_AutomationConfigurationStatus as AutomationConfigurationStatus, type context_AutomationIdentifier as AutomationIdentifier, type context_AutomationInfo as AutomationInfo, type context_AutomationInfoOriginInfoOneOf as AutomationInfoOriginInfoOneOf, type context_AutomationOriginInfoOneOf as AutomationOriginInfoOneOf, type context_AutomationSettings as AutomationSettings, type context_BaseEventMetadata as BaseEventMetadata, type context_BatchActivationRequest as BatchActivationRequest, context_BlockType as BlockType, type context_BulkActionMetadata as BulkActionMetadata, type context_BulkCancelEventOptions as BulkCancelEventOptions, type context_BulkCancelEventRequest as BulkCancelEventRequest, type context_BulkCancelEventResponse as BulkCancelEventResponse, type context_BulkCancelEventResponseNonNullableFields as BulkCancelEventResponseNonNullableFields, type context_BulkCancelEventResult as BulkCancelEventResult, type context_BulkReportEventOptions as BulkReportEventOptions, type context_BulkReportEventRequest as BulkReportEventRequest, type context_BulkReportEventResponse as BulkReportEventResponse, type context_BulkReportEventResponseNonNullableFields as BulkReportEventResponseNonNullableFields, type context_BulkReportEventResult as BulkReportEventResult, type context_CancelEventOptions as CancelEventOptions, type context_CancelEventRequest as CancelEventRequest, type context_CancelEventResponse as CancelEventResponse, type context_CancelPendingScheduleRequest as CancelPendingScheduleRequest, type context_CancelPendingScheduleRequestByOneOf as CancelPendingScheduleRequestByOneOf, type context_CancelPendingScheduleResponse as CancelPendingScheduleResponse, context_CancellationReason as CancellationReason, type context_CancelledStatusInfo as CancelledStatusInfo, type context_Case as Case, type context_ConditionAction as ConditionAction, type context_ConditionActionInfo as ConditionActionInfo, type context_ConditionBlock as ConditionBlock, type context_ConditionExpressionGroup as ConditionExpressionGroup, type context_ConditionFilter as ConditionFilter, type context_Delay as Delay, type context_DelayAction as DelayAction, type context_DelayActionInfo as DelayActionInfo, type context_DelayHelper as DelayHelper, type context_DelayOfOneOf as DelayOfOneOf, type context_DomainEvent as DomainEvent, type context_DomainEventBodyOneOf as DomainEventBodyOneOf, type context_Empty as Empty, type context_EndedStatusInfo as EndedStatusInfo, type context_EndedStatusInfoTypeInfoOneOf as EndedStatusInfoTypeInfoOneOf, type context_EntityCreatedEvent as EntityCreatedEvent, type context_EntityDeletedEvent as EntityDeletedEvent, type context_EntityUpdatedEvent as EntityUpdatedEvent, type context_EventInfo as EventInfo, type context_EventMetadata as EventMetadata, type context_ExecuteFromActionRequest as ExecuteFromActionRequest, type context_ExecuteFromActionResponse as ExecuteFromActionResponse, type context_ExpressionEvaluationResult as ExpressionEvaluationResult, type context_FailedStatusInfo as FailedStatusInfo, type context_Filter as Filter, type context_FutureDateActivationOffset as FutureDateActivationOffset, type context_Idempotency as Idempotency, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, context_IdentifierType as IdentifierType, type context_Identity as Identity, type context_IfFilter as IfFilter, type context_InitiatedStatusInfo as InitiatedStatusInfo, type context_ItemMetadata as ItemMetadata, type context_MessageEnvelope as MessageEnvelope, context_Operator as Operator, context_Origin as Origin, type context_Output as Output, type context_OutputAction as OutputAction, type context_PreinstalledIdentifier as PreinstalledIdentifier, type context_PreinstalledOrigin as PreinstalledOrigin, type context_RateLimitAction as RateLimitAction, type context_RateLimitActionInfo as RateLimitActionInfo, type context_RateLimiting as RateLimiting, type context_RefreshPayloadRequest as RefreshPayloadRequest, type context_RefreshPayloadResponse as RefreshPayloadResponse, type context_ReportDomainEventRequest as ReportDomainEventRequest, type context_ReportDomainEventResponse as ReportDomainEventResponse, type context_ReportEventOptions as ReportEventOptions, type context_ReportEventRequest as ReportEventRequest, type context_ReportEventResponse as ReportEventResponse, type context_ReportEventResponseNonNullableFields as ReportEventResponseNonNullableFields, type context_RunAutomationRequest as RunAutomationRequest, type context_RunAutomationResponse as RunAutomationResponse, type context_Runtime as Runtime, type context_Schedule as Schedule, type context_ScheduleRequest as ScheduleRequest, type context_ScheduleResponse as ScheduleResponse, context_ScheduleStatus as ScheduleStatus, type context_ScheduledAction as ScheduledAction, type context_ScheduledStatusInfo as ScheduledStatusInfo, type context_Scheduler as Scheduler, type context_Service as Service, type context_ServiceMapping as ServiceMapping, type context_SimpleDelay as SimpleDelay, type context_SpiAction as SpiAction, type context_StartedStatusInfo as StartedStatusInfo, type context_StartedStatusInfoAppDefinedActionInfo as StartedStatusInfoAppDefinedActionInfo, type context_StartedStatusInfoTypeInfoOneOf as StartedStatusInfoTypeInfoOneOf, context_Status as Status, type context_SwitchFilter as SwitchFilter, type context_SystemHelper as SystemHelper, type context_SystemHelperHelperOneOf as SystemHelperHelperOneOf, context_Target as Target, context_TimeUnit as TimeUnit, type context_Trigger as Trigger, type context_TriggerInfo as TriggerInfo, context_Type as Type, type context_UndeleteInfo as UndeleteInfo, context_Units as Units, type context_UpdatePendingSchedulesPayloadRequest as UpdatePendingSchedulesPayloadRequest, type context_UpdatePendingSchedulesPayloadResponse as UpdatePendingSchedulesPayloadResponse, type context_V1RunAutomationRequest as V1RunAutomationRequest, type context_V1RunAutomationRequestIdentifierOneOf as V1RunAutomationRequestIdentifierOneOf, type context_V1RunAutomationResponse as V1RunAutomationResponse, context_WebhookIdentityType as WebhookIdentityType, context_bulkCancelEvent as bulkCancelEvent, context_bulkReportEvent as bulkReportEvent, context_cancelEvent as cancelEvent, context_onActivationStatusChanged as onActivationStatusChanged, context_reportEvent as reportEvent };
773
1767
  }
774
1768
 
775
1769
  export { context as activations };
@@ -640,6 +640,9 @@ interface DomainEventBodyOneOf {
640
640
  interface EntityCreatedEvent {
641
641
  entity?: string;
642
642
  }
643
+ interface UndeleteInfo {
644
+ deletedDate?: Date;
645
+ }
643
646
  interface EntityUpdatedEvent {
644
647
  /**
645
648
  * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
@@ -1373,9 +1376,6 @@ interface ExecuteFromActionRequest {
1373
1376
  }
1374
1377
  interface ExecuteFromActionResponse {
1375
1378
  }
1376
- interface UndeleteInfo {
1377
- deletedDate?: Date;
1378
- }
1379
1379
  interface ActivationScheduleCompleted {
1380
1380
  /** Activation identifier */
1381
1381
  _id?: string;
@@ -1539,6 +1539,8 @@ interface CancelEventOptions {
1539
1539
 
1540
1540
  interface HttpClient {
1541
1541
  request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
1542
+ fetchWithAuth: typeof fetch;
1543
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
1542
1544
  }
1543
1545
  type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
1544
1546
  type HttpResponse<T = any> = {
@@ -1563,10 +1565,17 @@ type EventDefinition<Payload = unknown, Type extends string = string> = {
1563
1565
  __type: 'event-definition';
1564
1566
  type: Type;
1565
1567
  isDomainEvent?: boolean;
1566
- transformations?: unknown;
1568
+ transformations?: (envelope: unknown) => Payload;
1567
1569
  __payload: Payload;
1568
1570
  };
1569
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
1571
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
1572
+
1573
+ declare global {
1574
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1575
+ interface SymbolConstructor {
1576
+ readonly observable: symbol;
1577
+ }
1578
+ }
1570
1579
 
1571
1580
  declare const __metadata: {
1572
1581
  PACKAGE_NAME: string;