@wix/automations 1.0.20 → 1.0.21
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 +5 -5
- package/type-bundles/context.bundle.d.ts +282 -64
- package/type-bundles/index.bundle.d.ts +282 -64
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/automations",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"type-bundles"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@wix/automations_activations": "1.0.
|
|
22
|
-
"@wix/automations_automations-service": "1.0.
|
|
23
|
-
"@wix/automations_automations-service-v-2": "1.0.
|
|
21
|
+
"@wix/automations_activations": "1.0.17",
|
|
22
|
+
"@wix/automations_automations-service": "1.0.9",
|
|
23
|
+
"@wix/automations_automations-service-v-2": "1.0.9"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"glob": "^10.4.1",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"fqdn": ""
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
"falconPackageHash": "
|
|
48
|
+
"falconPackageHash": "57fda055d80edeb84d09cd78cd8f82a3a836815475f787d3e6fcc0dd"
|
|
49
49
|
}
|
|
@@ -1,3 +1,47 @@
|
|
|
1
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
2
|
+
interface HttpClient {
|
|
3
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
4
|
+
fetchWithAuth: typeof fetch;
|
|
5
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
6
|
+
}
|
|
7
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
8
|
+
type HttpResponse<T = any> = {
|
|
9
|
+
data: T;
|
|
10
|
+
status: number;
|
|
11
|
+
statusText: string;
|
|
12
|
+
headers: any;
|
|
13
|
+
request?: any;
|
|
14
|
+
};
|
|
15
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
16
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
17
|
+
url: string;
|
|
18
|
+
data?: Data;
|
|
19
|
+
params?: URLSearchParams;
|
|
20
|
+
} & APIMetadata;
|
|
21
|
+
type APIMetadata = {
|
|
22
|
+
methodFqn?: string;
|
|
23
|
+
entityFqdn?: string;
|
|
24
|
+
packageName?: string;
|
|
25
|
+
};
|
|
26
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
27
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
28
|
+
__type: 'event-definition';
|
|
29
|
+
type: Type;
|
|
30
|
+
isDomainEvent?: boolean;
|
|
31
|
+
transformations?: (envelope: unknown) => Payload;
|
|
32
|
+
__payload: Payload;
|
|
33
|
+
};
|
|
34
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
35
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
36
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
37
|
+
|
|
38
|
+
declare global {
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
40
|
+
interface SymbolConstructor {
|
|
41
|
+
readonly observable: symbol;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
1
45
|
/** Automation */
|
|
2
46
|
interface Automation$2 {
|
|
3
47
|
/**
|
|
@@ -1595,61 +1639,93 @@ interface GenerateActionInputMappingFromTemplateOptions {
|
|
|
1595
1639
|
actionInputMappingTemplate: Record<string, any> | null;
|
|
1596
1640
|
}
|
|
1597
1641
|
|
|
1598
|
-
|
|
1599
|
-
interface
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1642
|
+
declare function createAutomation$3(httpClient: HttpClient): CreateAutomationSignature$1;
|
|
1643
|
+
interface CreateAutomationSignature$1 {
|
|
1644
|
+
/**
|
|
1645
|
+
* Creates a new Automation
|
|
1646
|
+
* @param - Automation to be created
|
|
1647
|
+
* @returns The created Automation
|
|
1648
|
+
*/
|
|
1649
|
+
(automation: Automation$2): Promise<Automation$2 & AutomationNonNullableFields$1>;
|
|
1603
1650
|
}
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
}
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
}
|
|
1631
|
-
declare function
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1651
|
+
declare function getAutomation$3(httpClient: HttpClient): GetAutomationSignature$1;
|
|
1652
|
+
interface GetAutomationSignature$1 {
|
|
1653
|
+
/**
|
|
1654
|
+
* Get a Automation by id
|
|
1655
|
+
* @param - Automation ID
|
|
1656
|
+
* @returns Automation
|
|
1657
|
+
*/
|
|
1658
|
+
(automationId: string, options?: GetAutomationOptions$1 | undefined): Promise<Automation$2 & AutomationNonNullableFields$1>;
|
|
1659
|
+
}
|
|
1660
|
+
declare function updateAutomation$3(httpClient: HttpClient): UpdateAutomationSignature$1;
|
|
1661
|
+
interface UpdateAutomationSignature$1 {
|
|
1662
|
+
/**
|
|
1663
|
+
* Update a Automation, supports partial update
|
|
1664
|
+
* Pass the latest `revision` for a successful update
|
|
1665
|
+
* @param - Automation ID
|
|
1666
|
+
* @returns The updated Automation
|
|
1667
|
+
*/
|
|
1668
|
+
(_id: string | null, automation: UpdateAutomation$1): Promise<Automation$2 & AutomationNonNullableFields$1>;
|
|
1669
|
+
}
|
|
1670
|
+
declare function deleteAutomation$3(httpClient: HttpClient): DeleteAutomationSignature$1;
|
|
1671
|
+
interface DeleteAutomationSignature$1 {
|
|
1672
|
+
/**
|
|
1673
|
+
* Delete an Automation
|
|
1674
|
+
* @param - Id of the Automation to delete
|
|
1675
|
+
*/
|
|
1676
|
+
(automationId: string, options?: DeleteAutomationOptions | undefined): Promise<void>;
|
|
1677
|
+
}
|
|
1678
|
+
declare function queryAutomations$3(httpClient: HttpClient): QueryAutomationsSignature$1;
|
|
1679
|
+
interface QueryAutomationsSignature$1 {
|
|
1680
|
+
/**
|
|
1681
|
+
* Query Automations using [WQL - Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
|
|
1682
|
+
*/
|
|
1683
|
+
(options?: QueryAutomationsOptions | undefined): AutomationsQueryBuilder$1;
|
|
1684
|
+
}
|
|
1685
|
+
declare function overrideApplicationAutomation$1(httpClient: HttpClient): OverrideApplicationAutomationSignature;
|
|
1686
|
+
interface OverrideApplicationAutomationSignature {
|
|
1687
|
+
/**
|
|
1688
|
+
* Creates a new Automation
|
|
1689
|
+
* @param - Application Automation
|
|
1690
|
+
*/
|
|
1691
|
+
(automation: Automation$2): Promise<OverrideApplicationAutomationResponse & OverrideApplicationAutomationResponseNonNullableFields>;
|
|
1692
|
+
}
|
|
1693
|
+
declare function validateAutomationById$1(httpClient: HttpClient): ValidateAutomationByIdSignature;
|
|
1694
|
+
interface ValidateAutomationByIdSignature {
|
|
1695
|
+
/**
|
|
1696
|
+
* Validate Automation by Id
|
|
1697
|
+
* @param - Automation ID
|
|
1698
|
+
*/
|
|
1699
|
+
(automationId: string, options?: ValidateAutomationByIdOptions | undefined): Promise<ValidateAutomationByIdResponse & ValidateAutomationByIdResponseNonNullableFields>;
|
|
1700
|
+
}
|
|
1701
|
+
declare function validateAutomation$3(httpClient: HttpClient): ValidateAutomationSignature$1;
|
|
1702
|
+
interface ValidateAutomationSignature$1 {
|
|
1703
|
+
/**
|
|
1704
|
+
* Validate Automation
|
|
1705
|
+
* @param - Automation to validate
|
|
1706
|
+
*/
|
|
1707
|
+
(automation: Automation$2): Promise<ValidateAutomationResponse$1 & ValidateAutomationResponseNonNullableFields$1>;
|
|
1708
|
+
}
|
|
1709
|
+
declare function getAutomationActivationStats$1(httpClient: HttpClient): GetAutomationActivationStatsSignature;
|
|
1710
|
+
interface GetAutomationActivationStatsSignature {
|
|
1711
|
+
/** @param - Automation ID */
|
|
1712
|
+
(automationId: string, options?: GetAutomationActivationStatsOptions | undefined): Promise<GetAutomationActivationReportsResponse & GetAutomationActivationReportsResponseNonNullableFields>;
|
|
1713
|
+
}
|
|
1714
|
+
declare function getActionsQuotaInfo$1(httpClient: HttpClient): GetActionsQuotaInfoSignature;
|
|
1715
|
+
interface GetActionsQuotaInfoSignature {
|
|
1716
|
+
/**
|
|
1717
|
+
* Get actions quota information
|
|
1718
|
+
*/
|
|
1719
|
+
(): Promise<GetActionsQuotaInfoResponse$1 & GetActionsQuotaInfoResponseNonNullableFields>;
|
|
1720
|
+
}
|
|
1721
|
+
declare function generateActionInputMappingFromTemplate$1(httpClient: HttpClient): GenerateActionInputMappingFromTemplateSignature;
|
|
1722
|
+
interface GenerateActionInputMappingFromTemplateSignature {
|
|
1723
|
+
/**
|
|
1724
|
+
* Generate action input mapping from a template
|
|
1725
|
+
* @param - action app id
|
|
1726
|
+
*/
|
|
1727
|
+
(appId: string, options: GenerateActionInputMappingFromTemplateOptions): Promise<GenerateActionInputMappingFromTemplateResponse>;
|
|
1640
1728
|
}
|
|
1641
|
-
|
|
1642
|
-
declare function createAutomation$3(httpClient: HttpClient): (automation: Automation$2) => Promise<Automation$2 & AutomationNonNullableFields$1>;
|
|
1643
|
-
declare function getAutomation$3(httpClient: HttpClient): (automationId: string, options?: GetAutomationOptions$1) => Promise<Automation$2 & AutomationNonNullableFields$1>;
|
|
1644
|
-
declare function updateAutomation$3(httpClient: HttpClient): (_id: string | null, automation: UpdateAutomation$1) => Promise<Automation$2 & AutomationNonNullableFields$1>;
|
|
1645
|
-
declare function deleteAutomation$3(httpClient: HttpClient): (automationId: string, options?: DeleteAutomationOptions) => Promise<void>;
|
|
1646
|
-
declare function queryAutomations$3(httpClient: HttpClient): (options?: QueryAutomationsOptions) => AutomationsQueryBuilder$1;
|
|
1647
|
-
declare function overrideApplicationAutomation$1(httpClient: HttpClient): (automation: Automation$2) => Promise<OverrideApplicationAutomationResponse & OverrideApplicationAutomationResponseNonNullableFields>;
|
|
1648
|
-
declare function validateAutomationById$1(httpClient: HttpClient): (automationId: string, options?: ValidateAutomationByIdOptions) => Promise<ValidateAutomationByIdResponse & ValidateAutomationByIdResponseNonNullableFields>;
|
|
1649
|
-
declare function validateAutomation$3(httpClient: HttpClient): (automation: Automation$2) => Promise<ValidateAutomationResponse$1 & ValidateAutomationResponseNonNullableFields$1>;
|
|
1650
|
-
declare function getAutomationActivationStats$1(httpClient: HttpClient): (automationId: string, options?: GetAutomationActivationStatsOptions) => Promise<GetAutomationActivationReportsResponse & GetAutomationActivationReportsResponseNonNullableFields>;
|
|
1651
|
-
declare function getActionsQuotaInfo$1(httpClient: HttpClient): () => Promise<GetActionsQuotaInfoResponse$1 & GetActionsQuotaInfoResponseNonNullableFields>;
|
|
1652
|
-
declare function generateActionInputMappingFromTemplate$1(httpClient: HttpClient): (appId: string, options: GenerateActionInputMappingFromTemplateOptions) => Promise<GenerateActionInputMappingFromTemplateResponse>;
|
|
1653
1729
|
declare const onAutomationCreated$3: EventDefinition<AutomationCreatedEnvelope$1, "wix.automations.v1.automation_created">;
|
|
1654
1730
|
declare const onAutomationUpdated$3: EventDefinition<AutomationUpdatedEnvelope$1, "wix.automations.v1.automation_updated">;
|
|
1655
1731
|
declare const onAutomationDeleted$3: EventDefinition<AutomationDeletedEnvelope$1, "wix.automations.v1.automation_deleted">;
|
|
@@ -1684,18 +1760,23 @@ type _publicGenerateActionInputMappingFromTemplateType = typeof generateActionIn
|
|
|
1684
1760
|
declare const generateActionInputMappingFromTemplate: ReturnType<typeof createRESTModule$2<_publicGenerateActionInputMappingFromTemplateType>>;
|
|
1685
1761
|
|
|
1686
1762
|
type _publicOnAutomationCreatedType$1 = typeof onAutomationCreated$3;
|
|
1763
|
+
/** */
|
|
1687
1764
|
declare const onAutomationCreated$2: ReturnType<typeof createEventModule$2<_publicOnAutomationCreatedType>>;
|
|
1688
1765
|
|
|
1689
1766
|
type _publicOnAutomationUpdatedType$1 = typeof onAutomationUpdated$3;
|
|
1767
|
+
/** */
|
|
1690
1768
|
declare const onAutomationUpdated$2: ReturnType<typeof createEventModule$2<_publicOnAutomationUpdatedType>>;
|
|
1691
1769
|
|
|
1692
1770
|
type _publicOnAutomationDeletedType$1 = typeof onAutomationDeleted$3;
|
|
1771
|
+
/** */
|
|
1693
1772
|
declare const onAutomationDeleted$2: ReturnType<typeof createEventModule$2<_publicOnAutomationDeletedType>>;
|
|
1694
1773
|
|
|
1695
1774
|
type _publicOnAutomationUpdatedWithPreviousEntityType$1 = typeof onAutomationUpdatedWithPreviousEntity$3;
|
|
1775
|
+
/** */
|
|
1696
1776
|
declare const onAutomationUpdatedWithPreviousEntity$2: ReturnType<typeof createEventModule$2<_publicOnAutomationUpdatedWithPreviousEntityType>>;
|
|
1697
1777
|
|
|
1698
1778
|
type _publicOnAutomationDeletedWithEntityType$1 = typeof onAutomationDeletedWithEntity$3;
|
|
1779
|
+
/** */
|
|
1699
1780
|
declare const onAutomationDeletedWithEntity$2: ReturnType<typeof createEventModule$2<_publicOnAutomationDeletedWithEntityType>>;
|
|
1700
1781
|
|
|
1701
1782
|
type context$2_ActivationReport = ActivationReport;
|
|
@@ -3312,10 +3393,73 @@ interface ReportEventOptions {
|
|
|
3312
3393
|
idempotency?: Idempotency;
|
|
3313
3394
|
}
|
|
3314
3395
|
|
|
3315
|
-
declare function reportEvent$1(httpClient: HttpClient):
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3396
|
+
declare function reportEvent$1(httpClient: HttpClient): ReportEventSignature;
|
|
3397
|
+
interface ReportEventSignature {
|
|
3398
|
+
/**
|
|
3399
|
+
* Reports an event and activates site automations with the specified trigger key.
|
|
3400
|
+
*
|
|
3401
|
+
*
|
|
3402
|
+
* Only the app that created a trigger can report events for it.
|
|
3403
|
+
* This means other apps can't report events for your triggers,
|
|
3404
|
+
* and you can't report events for another app's triggers.
|
|
3405
|
+
*
|
|
3406
|
+
* If your app supports canceling events,
|
|
3407
|
+
* `externalEntityId` must be provided.
|
|
3408
|
+
* `externalEntityId` is required when calling [cancelEvent()](#cancel-event).
|
|
3409
|
+
* @param - Trigger key as defined in your app's trigger configuration
|
|
3410
|
+
* in the Wix Developers Center.
|
|
3411
|
+
* For example, `form_submitted` or `invoice_due`.
|
|
3412
|
+
*/
|
|
3413
|
+
(triggerKey: string, options?: ReportEventOptions | undefined): Promise<ReportEventResponse & ReportEventResponseNonNullableFields>;
|
|
3414
|
+
}
|
|
3415
|
+
declare function bulkReportEvent$1(httpClient: HttpClient): BulkReportEventSignature;
|
|
3416
|
+
interface BulkReportEventSignature {
|
|
3417
|
+
/**
|
|
3418
|
+
* Bulk reports events and activates site automations with the specified trigger key.
|
|
3419
|
+
* @param - Trigger key as defined in your app's trigger configuration
|
|
3420
|
+
* in the Wix Developers Center.
|
|
3421
|
+
* For example, `form_submitted` or `invoice_due`.
|
|
3422
|
+
* @param - Repeated list of event details for bulk reporting
|
|
3423
|
+
*/
|
|
3424
|
+
(triggerKey: string, eventsInfo: EventInfo[]): Promise<BulkReportEventResponse & BulkReportEventResponseNonNullableFields>;
|
|
3425
|
+
}
|
|
3426
|
+
declare function bulkCancelEvent$1(httpClient: HttpClient): BulkCancelEventSignature;
|
|
3427
|
+
interface BulkCancelEventSignature {
|
|
3428
|
+
/**
|
|
3429
|
+
* Bulk cancels any remaining actions for a trigger and external entities.
|
|
3430
|
+
* @param - Trigger key whose events you want to cancel.
|
|
3431
|
+
* For example, `form_submitted` or `invoice_due`.
|
|
3432
|
+
* @param - Repeated list of external_entity_id, representing the related resources' IDs
|
|
3433
|
+
*/
|
|
3434
|
+
(triggerKey: string, externalEntityIds: string[]): Promise<BulkCancelEventResponse & BulkCancelEventResponseNonNullableFields>;
|
|
3435
|
+
}
|
|
3436
|
+
declare function cancelEvent$1(httpClient: HttpClient): CancelEventSignature;
|
|
3437
|
+
interface CancelEventSignature {
|
|
3438
|
+
/**
|
|
3439
|
+
* Cancels any remaining actions for a trigger and external entity.
|
|
3440
|
+
*
|
|
3441
|
+
*
|
|
3442
|
+
* Events are not cancelable by default.
|
|
3443
|
+
* To make an event cancelable,
|
|
3444
|
+
* you must first pass an `externalEntityId`
|
|
3445
|
+
* and the applicable `triggerKey` to [reportEvent()](#report-event).
|
|
3446
|
+
* When you call cancelEvent() with the same `externalEntityId` and `triggerKey`,
|
|
3447
|
+
* the event is canceled,
|
|
3448
|
+
* as are all other events that share the `externalEntityId` and `triggerKey`.
|
|
3449
|
+
* @param - Trigger key whose event you want to cancel.
|
|
3450
|
+
* For example, `form_submitted` or `invoice_due`.
|
|
3451
|
+
* @param - ID of the related resource in GUID format.
|
|
3452
|
+
* For example, `fc81a355-3429-50fc-a4c7-def486e828f3`.
|
|
3453
|
+
*
|
|
3454
|
+
* Typically, this ID is defined in your system,
|
|
3455
|
+
* but you can also use any Wix resource GUID,
|
|
3456
|
+
* such as contact ID, member ID, or invoice ID.
|
|
3457
|
+
* See
|
|
3458
|
+
* [Choose the right `externalEntityId`](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/reporting-and-canceling-events#choose-the-right-externalentityid)
|
|
3459
|
+
* for more information.
|
|
3460
|
+
*/
|
|
3461
|
+
(triggerKey: string, externalEntityId: string): Promise<void>;
|
|
3462
|
+
}
|
|
3319
3463
|
declare const onActivationStatusChanged$1: EventDefinition<ActivationStatusChangedEnvelope, "wix.automations.v2.activation_activation_status_changed">;
|
|
3320
3464
|
|
|
3321
3465
|
declare function createRESTModule$1<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
|
|
@@ -3332,6 +3476,9 @@ type _publicCancelEventType = typeof cancelEvent$1;
|
|
|
3332
3476
|
declare const cancelEvent: ReturnType<typeof createRESTModule$1<_publicCancelEventType>>;
|
|
3333
3477
|
|
|
3334
3478
|
type _publicOnActivationStatusChangedType = typeof onActivationStatusChanged$1;
|
|
3479
|
+
/**
|
|
3480
|
+
* activation status changed message
|
|
3481
|
+
*/
|
|
3335
3482
|
declare const onActivationStatusChanged: ReturnType<typeof createEventModule$1<_publicOnActivationStatusChangedType>>;
|
|
3336
3483
|
|
|
3337
3484
|
type context$1_ActionActionOneOf = ActionActionOneOf;
|
|
@@ -4971,13 +5118,79 @@ interface ValidateAutomationOptions {
|
|
|
4971
5118
|
validationSettings?: ValidationSettings;
|
|
4972
5119
|
}
|
|
4973
5120
|
|
|
4974
|
-
declare function createAutomation$1(httpClient: HttpClient):
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
5121
|
+
declare function createAutomation$1(httpClient: HttpClient): CreateAutomationSignature;
|
|
5122
|
+
interface CreateAutomationSignature {
|
|
5123
|
+
/**
|
|
5124
|
+
* Creates an automation.
|
|
5125
|
+
* @param - Automation to be created.
|
|
5126
|
+
* @returns The created automation.
|
|
5127
|
+
*/
|
|
5128
|
+
(automation: Automation): Promise<Automation & AutomationNonNullableFields>;
|
|
5129
|
+
}
|
|
5130
|
+
declare function getAutomation$1(httpClient: HttpClient): GetAutomationSignature;
|
|
5131
|
+
interface GetAutomationSignature {
|
|
5132
|
+
/**
|
|
5133
|
+
* Retrieves an automation.
|
|
5134
|
+
* @param - Automation ID.
|
|
5135
|
+
* @returns The requested automation.
|
|
5136
|
+
*/
|
|
5137
|
+
(automationId: string, options?: GetAutomationOptions | undefined): Promise<Automation & AutomationNonNullableFields>;
|
|
5138
|
+
}
|
|
5139
|
+
declare function updateAutomation$1(httpClient: HttpClient): UpdateAutomationSignature;
|
|
5140
|
+
interface UpdateAutomationSignature {
|
|
5141
|
+
/**
|
|
5142
|
+
* Updates an automation.
|
|
5143
|
+
*
|
|
5144
|
+
* Each time the automation is updated,
|
|
5145
|
+
* `revision` increments by 1.
|
|
5146
|
+
* The current `revision` must be passed when updating the automation.
|
|
5147
|
+
* This ensures you're working with the latest automation
|
|
5148
|
+
* and prevents unintended overwrites.
|
|
5149
|
+
* @param - Automation ID.
|
|
5150
|
+
* @returns Updated automation.
|
|
5151
|
+
*/
|
|
5152
|
+
(_id: string | null, automation: UpdateAutomation): Promise<Automation & AutomationNonNullableFields>;
|
|
5153
|
+
}
|
|
5154
|
+
declare function deleteAutomation$1(httpClient: HttpClient): DeleteAutomationSignature;
|
|
5155
|
+
interface DeleteAutomationSignature {
|
|
5156
|
+
/**
|
|
5157
|
+
* Deletes an Automation.
|
|
5158
|
+
* @param - Automation ID.
|
|
5159
|
+
*/
|
|
5160
|
+
(automationId: string): Promise<void>;
|
|
5161
|
+
}
|
|
5162
|
+
declare function bulkDeleteAutomations$1(httpClient: HttpClient): BulkDeleteAutomationsSignature;
|
|
5163
|
+
interface BulkDeleteAutomationsSignature {
|
|
5164
|
+
/**
|
|
5165
|
+
* Deletes multiple automations.
|
|
5166
|
+
* @param - Automation IDs to delete.
|
|
5167
|
+
*/
|
|
5168
|
+
(automationIds: string[]): Promise<BulkDeleteAutomationsResponse & BulkDeleteAutomationsResponseNonNullableFields>;
|
|
5169
|
+
}
|
|
5170
|
+
declare function queryAutomations$1(httpClient: HttpClient): QueryAutomationsSignature;
|
|
5171
|
+
interface QueryAutomationsSignature {
|
|
5172
|
+
/**
|
|
5173
|
+
* Retrieves a list of automations. Max query filter depth is 3.
|
|
5174
|
+
*
|
|
5175
|
+
* Relevant automations for the query are returned. This includes automations created on the site and pre-installed automations.
|
|
5176
|
+
* If there's an existing override for a pre-installed automation, the override is returned in the query result.
|
|
5177
|
+
* The query only returns automations from apps that are installed on the site.
|
|
5178
|
+
*
|
|
5179
|
+
* To learn about working with _Query_ endpoints, see
|
|
5180
|
+
* [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
|
|
5181
|
+
* [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination),
|
|
5182
|
+
* and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
|
|
5183
|
+
*/
|
|
5184
|
+
(): AutomationsQueryBuilder;
|
|
5185
|
+
}
|
|
5186
|
+
declare function validateAutomation$1(httpClient: HttpClient): ValidateAutomationSignature;
|
|
5187
|
+
interface ValidateAutomationSignature {
|
|
5188
|
+
/**
|
|
5189
|
+
* Validates the automation without requiring the automation ID to be passed in.
|
|
5190
|
+
* @param - Automation to validate.
|
|
5191
|
+
*/
|
|
5192
|
+
(automation: Automation, options?: ValidateAutomationOptions | undefined): Promise<ValidateAutomationResponse & ValidateAutomationResponseNonNullableFields>;
|
|
5193
|
+
}
|
|
4981
5194
|
declare const onAutomationCreated$1: EventDefinition<AutomationCreatedEnvelope, "wix.automations.v2.automation_created">;
|
|
4982
5195
|
declare const onAutomationUpdated$1: EventDefinition<AutomationUpdatedEnvelope, "wix.automations.v2.automation_updated">;
|
|
4983
5196
|
declare const onAutomationDeleted$1: EventDefinition<AutomationDeletedEnvelope, "wix.automations.v2.automation_deleted">;
|
|
@@ -5004,18 +5217,23 @@ type _publicValidateAutomationType = typeof validateAutomation$1;
|
|
|
5004
5217
|
declare const validateAutomation: ReturnType<typeof createRESTModule<_publicValidateAutomationType>>;
|
|
5005
5218
|
|
|
5006
5219
|
type _publicOnAutomationCreatedType = typeof onAutomationCreated$1;
|
|
5220
|
+
/** */
|
|
5007
5221
|
declare const onAutomationCreated: ReturnType<typeof createEventModule<_publicOnAutomationCreatedType>>;
|
|
5008
5222
|
|
|
5009
5223
|
type _publicOnAutomationUpdatedType = typeof onAutomationUpdated$1;
|
|
5224
|
+
/** */
|
|
5010
5225
|
declare const onAutomationUpdated: ReturnType<typeof createEventModule<_publicOnAutomationUpdatedType>>;
|
|
5011
5226
|
|
|
5012
5227
|
type _publicOnAutomationDeletedType = typeof onAutomationDeleted$1;
|
|
5228
|
+
/** */
|
|
5013
5229
|
declare const onAutomationDeleted: ReturnType<typeof createEventModule<_publicOnAutomationDeletedType>>;
|
|
5014
5230
|
|
|
5015
5231
|
type _publicOnAutomationUpdatedWithPreviousEntityType = typeof onAutomationUpdatedWithPreviousEntity$1;
|
|
5232
|
+
/** */
|
|
5016
5233
|
declare const onAutomationUpdatedWithPreviousEntity: ReturnType<typeof createEventModule<_publicOnAutomationUpdatedWithPreviousEntityType>>;
|
|
5017
5234
|
|
|
5018
5235
|
type _publicOnAutomationDeletedWithEntityType = typeof onAutomationDeletedWithEntity$1;
|
|
5236
|
+
/** */
|
|
5019
5237
|
declare const onAutomationDeletedWithEntity: ReturnType<typeof createEventModule<_publicOnAutomationDeletedWithEntityType>>;
|
|
5020
5238
|
|
|
5021
5239
|
type context_Action = Action;
|
|
@@ -1,3 +1,47 @@
|
|
|
1
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
2
|
+
interface HttpClient {
|
|
3
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
4
|
+
fetchWithAuth: typeof fetch;
|
|
5
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
6
|
+
}
|
|
7
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
8
|
+
type HttpResponse<T = any> = {
|
|
9
|
+
data: T;
|
|
10
|
+
status: number;
|
|
11
|
+
statusText: string;
|
|
12
|
+
headers: any;
|
|
13
|
+
request?: any;
|
|
14
|
+
};
|
|
15
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
16
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
17
|
+
url: string;
|
|
18
|
+
data?: Data;
|
|
19
|
+
params?: URLSearchParams;
|
|
20
|
+
} & APIMetadata;
|
|
21
|
+
type APIMetadata = {
|
|
22
|
+
methodFqn?: string;
|
|
23
|
+
entityFqdn?: string;
|
|
24
|
+
packageName?: string;
|
|
25
|
+
};
|
|
26
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
27
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
28
|
+
__type: 'event-definition';
|
|
29
|
+
type: Type;
|
|
30
|
+
isDomainEvent?: boolean;
|
|
31
|
+
transformations?: (envelope: unknown) => Payload;
|
|
32
|
+
__payload: Payload;
|
|
33
|
+
};
|
|
34
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
35
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
36
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
37
|
+
|
|
38
|
+
declare global {
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
40
|
+
interface SymbolConstructor {
|
|
41
|
+
readonly observable: symbol;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
1
45
|
/** Automation */
|
|
2
46
|
interface Automation$2 {
|
|
3
47
|
/**
|
|
@@ -1595,61 +1639,93 @@ interface GenerateActionInputMappingFromTemplateOptions {
|
|
|
1595
1639
|
actionInputMappingTemplate: Record<string, any> | null;
|
|
1596
1640
|
}
|
|
1597
1641
|
|
|
1598
|
-
|
|
1599
|
-
interface
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1642
|
+
declare function createAutomation$3(httpClient: HttpClient): CreateAutomationSignature$1;
|
|
1643
|
+
interface CreateAutomationSignature$1 {
|
|
1644
|
+
/**
|
|
1645
|
+
* Creates a new Automation
|
|
1646
|
+
* @param - Automation to be created
|
|
1647
|
+
* @returns The created Automation
|
|
1648
|
+
*/
|
|
1649
|
+
(automation: Automation$2): Promise<Automation$2 & AutomationNonNullableFields$1>;
|
|
1603
1650
|
}
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
}
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
}
|
|
1631
|
-
declare function
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1651
|
+
declare function getAutomation$3(httpClient: HttpClient): GetAutomationSignature$1;
|
|
1652
|
+
interface GetAutomationSignature$1 {
|
|
1653
|
+
/**
|
|
1654
|
+
* Get a Automation by id
|
|
1655
|
+
* @param - Automation ID
|
|
1656
|
+
* @returns Automation
|
|
1657
|
+
*/
|
|
1658
|
+
(automationId: string, options?: GetAutomationOptions$1 | undefined): Promise<Automation$2 & AutomationNonNullableFields$1>;
|
|
1659
|
+
}
|
|
1660
|
+
declare function updateAutomation$3(httpClient: HttpClient): UpdateAutomationSignature$1;
|
|
1661
|
+
interface UpdateAutomationSignature$1 {
|
|
1662
|
+
/**
|
|
1663
|
+
* Update a Automation, supports partial update
|
|
1664
|
+
* Pass the latest `revision` for a successful update
|
|
1665
|
+
* @param - Automation ID
|
|
1666
|
+
* @returns The updated Automation
|
|
1667
|
+
*/
|
|
1668
|
+
(_id: string | null, automation: UpdateAutomation$1): Promise<Automation$2 & AutomationNonNullableFields$1>;
|
|
1669
|
+
}
|
|
1670
|
+
declare function deleteAutomation$3(httpClient: HttpClient): DeleteAutomationSignature$1;
|
|
1671
|
+
interface DeleteAutomationSignature$1 {
|
|
1672
|
+
/**
|
|
1673
|
+
* Delete an Automation
|
|
1674
|
+
* @param - Id of the Automation to delete
|
|
1675
|
+
*/
|
|
1676
|
+
(automationId: string, options?: DeleteAutomationOptions | undefined): Promise<void>;
|
|
1677
|
+
}
|
|
1678
|
+
declare function queryAutomations$3(httpClient: HttpClient): QueryAutomationsSignature$1;
|
|
1679
|
+
interface QueryAutomationsSignature$1 {
|
|
1680
|
+
/**
|
|
1681
|
+
* Query Automations using [WQL - Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
|
|
1682
|
+
*/
|
|
1683
|
+
(options?: QueryAutomationsOptions | undefined): AutomationsQueryBuilder$1;
|
|
1684
|
+
}
|
|
1685
|
+
declare function overrideApplicationAutomation$1(httpClient: HttpClient): OverrideApplicationAutomationSignature;
|
|
1686
|
+
interface OverrideApplicationAutomationSignature {
|
|
1687
|
+
/**
|
|
1688
|
+
* Creates a new Automation
|
|
1689
|
+
* @param - Application Automation
|
|
1690
|
+
*/
|
|
1691
|
+
(automation: Automation$2): Promise<OverrideApplicationAutomationResponse & OverrideApplicationAutomationResponseNonNullableFields>;
|
|
1692
|
+
}
|
|
1693
|
+
declare function validateAutomationById$1(httpClient: HttpClient): ValidateAutomationByIdSignature;
|
|
1694
|
+
interface ValidateAutomationByIdSignature {
|
|
1695
|
+
/**
|
|
1696
|
+
* Validate Automation by Id
|
|
1697
|
+
* @param - Automation ID
|
|
1698
|
+
*/
|
|
1699
|
+
(automationId: string, options?: ValidateAutomationByIdOptions | undefined): Promise<ValidateAutomationByIdResponse & ValidateAutomationByIdResponseNonNullableFields>;
|
|
1700
|
+
}
|
|
1701
|
+
declare function validateAutomation$3(httpClient: HttpClient): ValidateAutomationSignature$1;
|
|
1702
|
+
interface ValidateAutomationSignature$1 {
|
|
1703
|
+
/**
|
|
1704
|
+
* Validate Automation
|
|
1705
|
+
* @param - Automation to validate
|
|
1706
|
+
*/
|
|
1707
|
+
(automation: Automation$2): Promise<ValidateAutomationResponse$1 & ValidateAutomationResponseNonNullableFields$1>;
|
|
1708
|
+
}
|
|
1709
|
+
declare function getAutomationActivationStats$1(httpClient: HttpClient): GetAutomationActivationStatsSignature;
|
|
1710
|
+
interface GetAutomationActivationStatsSignature {
|
|
1711
|
+
/** @param - Automation ID */
|
|
1712
|
+
(automationId: string, options?: GetAutomationActivationStatsOptions | undefined): Promise<GetAutomationActivationReportsResponse & GetAutomationActivationReportsResponseNonNullableFields>;
|
|
1713
|
+
}
|
|
1714
|
+
declare function getActionsQuotaInfo$1(httpClient: HttpClient): GetActionsQuotaInfoSignature;
|
|
1715
|
+
interface GetActionsQuotaInfoSignature {
|
|
1716
|
+
/**
|
|
1717
|
+
* Get actions quota information
|
|
1718
|
+
*/
|
|
1719
|
+
(): Promise<GetActionsQuotaInfoResponse$1 & GetActionsQuotaInfoResponseNonNullableFields>;
|
|
1720
|
+
}
|
|
1721
|
+
declare function generateActionInputMappingFromTemplate$1(httpClient: HttpClient): GenerateActionInputMappingFromTemplateSignature;
|
|
1722
|
+
interface GenerateActionInputMappingFromTemplateSignature {
|
|
1723
|
+
/**
|
|
1724
|
+
* Generate action input mapping from a template
|
|
1725
|
+
* @param - action app id
|
|
1726
|
+
*/
|
|
1727
|
+
(appId: string, options: GenerateActionInputMappingFromTemplateOptions): Promise<GenerateActionInputMappingFromTemplateResponse>;
|
|
1640
1728
|
}
|
|
1641
|
-
|
|
1642
|
-
declare function createAutomation$3(httpClient: HttpClient): (automation: Automation$2) => Promise<Automation$2 & AutomationNonNullableFields$1>;
|
|
1643
|
-
declare function getAutomation$3(httpClient: HttpClient): (automationId: string, options?: GetAutomationOptions$1) => Promise<Automation$2 & AutomationNonNullableFields$1>;
|
|
1644
|
-
declare function updateAutomation$3(httpClient: HttpClient): (_id: string | null, automation: UpdateAutomation$1) => Promise<Automation$2 & AutomationNonNullableFields$1>;
|
|
1645
|
-
declare function deleteAutomation$3(httpClient: HttpClient): (automationId: string, options?: DeleteAutomationOptions) => Promise<void>;
|
|
1646
|
-
declare function queryAutomations$3(httpClient: HttpClient): (options?: QueryAutomationsOptions) => AutomationsQueryBuilder$1;
|
|
1647
|
-
declare function overrideApplicationAutomation$1(httpClient: HttpClient): (automation: Automation$2) => Promise<OverrideApplicationAutomationResponse & OverrideApplicationAutomationResponseNonNullableFields>;
|
|
1648
|
-
declare function validateAutomationById$1(httpClient: HttpClient): (automationId: string, options?: ValidateAutomationByIdOptions) => Promise<ValidateAutomationByIdResponse & ValidateAutomationByIdResponseNonNullableFields>;
|
|
1649
|
-
declare function validateAutomation$3(httpClient: HttpClient): (automation: Automation$2) => Promise<ValidateAutomationResponse$1 & ValidateAutomationResponseNonNullableFields$1>;
|
|
1650
|
-
declare function getAutomationActivationStats$1(httpClient: HttpClient): (automationId: string, options?: GetAutomationActivationStatsOptions) => Promise<GetAutomationActivationReportsResponse & GetAutomationActivationReportsResponseNonNullableFields>;
|
|
1651
|
-
declare function getActionsQuotaInfo$1(httpClient: HttpClient): () => Promise<GetActionsQuotaInfoResponse$1 & GetActionsQuotaInfoResponseNonNullableFields>;
|
|
1652
|
-
declare function generateActionInputMappingFromTemplate$1(httpClient: HttpClient): (appId: string, options: GenerateActionInputMappingFromTemplateOptions) => Promise<GenerateActionInputMappingFromTemplateResponse>;
|
|
1653
1729
|
declare const onAutomationCreated$3: EventDefinition<AutomationCreatedEnvelope$1, "wix.automations.v1.automation_created">;
|
|
1654
1730
|
declare const onAutomationUpdated$3: EventDefinition<AutomationUpdatedEnvelope$1, "wix.automations.v1.automation_updated">;
|
|
1655
1731
|
declare const onAutomationDeleted$3: EventDefinition<AutomationDeletedEnvelope$1, "wix.automations.v1.automation_deleted">;
|
|
@@ -1684,18 +1760,23 @@ type _publicGenerateActionInputMappingFromTemplateType = typeof generateActionIn
|
|
|
1684
1760
|
declare const generateActionInputMappingFromTemplate: ReturnType<typeof createRESTModule$2<_publicGenerateActionInputMappingFromTemplateType>>;
|
|
1685
1761
|
|
|
1686
1762
|
type _publicOnAutomationCreatedType$1 = typeof onAutomationCreated$3;
|
|
1763
|
+
/** */
|
|
1687
1764
|
declare const onAutomationCreated$2: ReturnType<typeof createEventModule$2<_publicOnAutomationCreatedType>>;
|
|
1688
1765
|
|
|
1689
1766
|
type _publicOnAutomationUpdatedType$1 = typeof onAutomationUpdated$3;
|
|
1767
|
+
/** */
|
|
1690
1768
|
declare const onAutomationUpdated$2: ReturnType<typeof createEventModule$2<_publicOnAutomationUpdatedType>>;
|
|
1691
1769
|
|
|
1692
1770
|
type _publicOnAutomationDeletedType$1 = typeof onAutomationDeleted$3;
|
|
1771
|
+
/** */
|
|
1693
1772
|
declare const onAutomationDeleted$2: ReturnType<typeof createEventModule$2<_publicOnAutomationDeletedType>>;
|
|
1694
1773
|
|
|
1695
1774
|
type _publicOnAutomationUpdatedWithPreviousEntityType$1 = typeof onAutomationUpdatedWithPreviousEntity$3;
|
|
1775
|
+
/** */
|
|
1696
1776
|
declare const onAutomationUpdatedWithPreviousEntity$2: ReturnType<typeof createEventModule$2<_publicOnAutomationUpdatedWithPreviousEntityType>>;
|
|
1697
1777
|
|
|
1698
1778
|
type _publicOnAutomationDeletedWithEntityType$1 = typeof onAutomationDeletedWithEntity$3;
|
|
1779
|
+
/** */
|
|
1699
1780
|
declare const onAutomationDeletedWithEntity$2: ReturnType<typeof createEventModule$2<_publicOnAutomationDeletedWithEntityType>>;
|
|
1700
1781
|
|
|
1701
1782
|
type index_d$2_ActivationReport = ActivationReport;
|
|
@@ -3312,10 +3393,73 @@ interface ReportEventOptions {
|
|
|
3312
3393
|
idempotency?: Idempotency;
|
|
3313
3394
|
}
|
|
3314
3395
|
|
|
3315
|
-
declare function reportEvent$1(httpClient: HttpClient):
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3396
|
+
declare function reportEvent$1(httpClient: HttpClient): ReportEventSignature;
|
|
3397
|
+
interface ReportEventSignature {
|
|
3398
|
+
/**
|
|
3399
|
+
* Reports an event and activates site automations with the specified trigger key.
|
|
3400
|
+
*
|
|
3401
|
+
*
|
|
3402
|
+
* Only the app that created a trigger can report events for it.
|
|
3403
|
+
* This means other apps can't report events for your triggers,
|
|
3404
|
+
* and you can't report events for another app's triggers.
|
|
3405
|
+
*
|
|
3406
|
+
* If your app supports canceling events,
|
|
3407
|
+
* `externalEntityId` must be provided.
|
|
3408
|
+
* `externalEntityId` is required when calling [cancelEvent()](#cancel-event).
|
|
3409
|
+
* @param - Trigger key as defined in your app's trigger configuration
|
|
3410
|
+
* in the Wix Developers Center.
|
|
3411
|
+
* For example, `form_submitted` or `invoice_due`.
|
|
3412
|
+
*/
|
|
3413
|
+
(triggerKey: string, options?: ReportEventOptions | undefined): Promise<ReportEventResponse & ReportEventResponseNonNullableFields>;
|
|
3414
|
+
}
|
|
3415
|
+
declare function bulkReportEvent$1(httpClient: HttpClient): BulkReportEventSignature;
|
|
3416
|
+
interface BulkReportEventSignature {
|
|
3417
|
+
/**
|
|
3418
|
+
* Bulk reports events and activates site automations with the specified trigger key.
|
|
3419
|
+
* @param - Trigger key as defined in your app's trigger configuration
|
|
3420
|
+
* in the Wix Developers Center.
|
|
3421
|
+
* For example, `form_submitted` or `invoice_due`.
|
|
3422
|
+
* @param - Repeated list of event details for bulk reporting
|
|
3423
|
+
*/
|
|
3424
|
+
(triggerKey: string, eventsInfo: EventInfo[]): Promise<BulkReportEventResponse & BulkReportEventResponseNonNullableFields>;
|
|
3425
|
+
}
|
|
3426
|
+
declare function bulkCancelEvent$1(httpClient: HttpClient): BulkCancelEventSignature;
|
|
3427
|
+
interface BulkCancelEventSignature {
|
|
3428
|
+
/**
|
|
3429
|
+
* Bulk cancels any remaining actions for a trigger and external entities.
|
|
3430
|
+
* @param - Trigger key whose events you want to cancel.
|
|
3431
|
+
* For example, `form_submitted` or `invoice_due`.
|
|
3432
|
+
* @param - Repeated list of external_entity_id, representing the related resources' IDs
|
|
3433
|
+
*/
|
|
3434
|
+
(triggerKey: string, externalEntityIds: string[]): Promise<BulkCancelEventResponse & BulkCancelEventResponseNonNullableFields>;
|
|
3435
|
+
}
|
|
3436
|
+
declare function cancelEvent$1(httpClient: HttpClient): CancelEventSignature;
|
|
3437
|
+
interface CancelEventSignature {
|
|
3438
|
+
/**
|
|
3439
|
+
* Cancels any remaining actions for a trigger and external entity.
|
|
3440
|
+
*
|
|
3441
|
+
*
|
|
3442
|
+
* Events are not cancelable by default.
|
|
3443
|
+
* To make an event cancelable,
|
|
3444
|
+
* you must first pass an `externalEntityId`
|
|
3445
|
+
* and the applicable `triggerKey` to [reportEvent()](#report-event).
|
|
3446
|
+
* When you call cancelEvent() with the same `externalEntityId` and `triggerKey`,
|
|
3447
|
+
* the event is canceled,
|
|
3448
|
+
* as are all other events that share the `externalEntityId` and `triggerKey`.
|
|
3449
|
+
* @param - Trigger key whose event you want to cancel.
|
|
3450
|
+
* For example, `form_submitted` or `invoice_due`.
|
|
3451
|
+
* @param - ID of the related resource in GUID format.
|
|
3452
|
+
* For example, `fc81a355-3429-50fc-a4c7-def486e828f3`.
|
|
3453
|
+
*
|
|
3454
|
+
* Typically, this ID is defined in your system,
|
|
3455
|
+
* but you can also use any Wix resource GUID,
|
|
3456
|
+
* such as contact ID, member ID, or invoice ID.
|
|
3457
|
+
* See
|
|
3458
|
+
* [Choose the right `externalEntityId`](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/reporting-and-canceling-events#choose-the-right-externalentityid)
|
|
3459
|
+
* for more information.
|
|
3460
|
+
*/
|
|
3461
|
+
(triggerKey: string, externalEntityId: string): Promise<void>;
|
|
3462
|
+
}
|
|
3319
3463
|
declare const onActivationStatusChanged$1: EventDefinition<ActivationStatusChangedEnvelope, "wix.automations.v2.activation_activation_status_changed">;
|
|
3320
3464
|
|
|
3321
3465
|
declare function createRESTModule$1<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
|
|
@@ -3332,6 +3476,9 @@ type _publicCancelEventType = typeof cancelEvent$1;
|
|
|
3332
3476
|
declare const cancelEvent: ReturnType<typeof createRESTModule$1<_publicCancelEventType>>;
|
|
3333
3477
|
|
|
3334
3478
|
type _publicOnActivationStatusChangedType = typeof onActivationStatusChanged$1;
|
|
3479
|
+
/**
|
|
3480
|
+
* activation status changed message
|
|
3481
|
+
*/
|
|
3335
3482
|
declare const onActivationStatusChanged: ReturnType<typeof createEventModule$1<_publicOnActivationStatusChangedType>>;
|
|
3336
3483
|
|
|
3337
3484
|
type index_d$1_ActionActionOneOf = ActionActionOneOf;
|
|
@@ -4971,13 +5118,79 @@ interface ValidateAutomationOptions {
|
|
|
4971
5118
|
validationSettings?: ValidationSettings;
|
|
4972
5119
|
}
|
|
4973
5120
|
|
|
4974
|
-
declare function createAutomation$1(httpClient: HttpClient):
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
5121
|
+
declare function createAutomation$1(httpClient: HttpClient): CreateAutomationSignature;
|
|
5122
|
+
interface CreateAutomationSignature {
|
|
5123
|
+
/**
|
|
5124
|
+
* Creates an automation.
|
|
5125
|
+
* @param - Automation to be created.
|
|
5126
|
+
* @returns The created automation.
|
|
5127
|
+
*/
|
|
5128
|
+
(automation: Automation): Promise<Automation & AutomationNonNullableFields>;
|
|
5129
|
+
}
|
|
5130
|
+
declare function getAutomation$1(httpClient: HttpClient): GetAutomationSignature;
|
|
5131
|
+
interface GetAutomationSignature {
|
|
5132
|
+
/**
|
|
5133
|
+
* Retrieves an automation.
|
|
5134
|
+
* @param - Automation ID.
|
|
5135
|
+
* @returns The requested automation.
|
|
5136
|
+
*/
|
|
5137
|
+
(automationId: string, options?: GetAutomationOptions | undefined): Promise<Automation & AutomationNonNullableFields>;
|
|
5138
|
+
}
|
|
5139
|
+
declare function updateAutomation$1(httpClient: HttpClient): UpdateAutomationSignature;
|
|
5140
|
+
interface UpdateAutomationSignature {
|
|
5141
|
+
/**
|
|
5142
|
+
* Updates an automation.
|
|
5143
|
+
*
|
|
5144
|
+
* Each time the automation is updated,
|
|
5145
|
+
* `revision` increments by 1.
|
|
5146
|
+
* The current `revision` must be passed when updating the automation.
|
|
5147
|
+
* This ensures you're working with the latest automation
|
|
5148
|
+
* and prevents unintended overwrites.
|
|
5149
|
+
* @param - Automation ID.
|
|
5150
|
+
* @returns Updated automation.
|
|
5151
|
+
*/
|
|
5152
|
+
(_id: string | null, automation: UpdateAutomation): Promise<Automation & AutomationNonNullableFields>;
|
|
5153
|
+
}
|
|
5154
|
+
declare function deleteAutomation$1(httpClient: HttpClient): DeleteAutomationSignature;
|
|
5155
|
+
interface DeleteAutomationSignature {
|
|
5156
|
+
/**
|
|
5157
|
+
* Deletes an Automation.
|
|
5158
|
+
* @param - Automation ID.
|
|
5159
|
+
*/
|
|
5160
|
+
(automationId: string): Promise<void>;
|
|
5161
|
+
}
|
|
5162
|
+
declare function bulkDeleteAutomations$1(httpClient: HttpClient): BulkDeleteAutomationsSignature;
|
|
5163
|
+
interface BulkDeleteAutomationsSignature {
|
|
5164
|
+
/**
|
|
5165
|
+
* Deletes multiple automations.
|
|
5166
|
+
* @param - Automation IDs to delete.
|
|
5167
|
+
*/
|
|
5168
|
+
(automationIds: string[]): Promise<BulkDeleteAutomationsResponse & BulkDeleteAutomationsResponseNonNullableFields>;
|
|
5169
|
+
}
|
|
5170
|
+
declare function queryAutomations$1(httpClient: HttpClient): QueryAutomationsSignature;
|
|
5171
|
+
interface QueryAutomationsSignature {
|
|
5172
|
+
/**
|
|
5173
|
+
* Retrieves a list of automations. Max query filter depth is 3.
|
|
5174
|
+
*
|
|
5175
|
+
* Relevant automations for the query are returned. This includes automations created on the site and pre-installed automations.
|
|
5176
|
+
* If there's an existing override for a pre-installed automation, the override is returned in the query result.
|
|
5177
|
+
* The query only returns automations from apps that are installed on the site.
|
|
5178
|
+
*
|
|
5179
|
+
* To learn about working with _Query_ endpoints, see
|
|
5180
|
+
* [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
|
|
5181
|
+
* [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination),
|
|
5182
|
+
* and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
|
|
5183
|
+
*/
|
|
5184
|
+
(): AutomationsQueryBuilder;
|
|
5185
|
+
}
|
|
5186
|
+
declare function validateAutomation$1(httpClient: HttpClient): ValidateAutomationSignature;
|
|
5187
|
+
interface ValidateAutomationSignature {
|
|
5188
|
+
/**
|
|
5189
|
+
* Validates the automation without requiring the automation ID to be passed in.
|
|
5190
|
+
* @param - Automation to validate.
|
|
5191
|
+
*/
|
|
5192
|
+
(automation: Automation, options?: ValidateAutomationOptions | undefined): Promise<ValidateAutomationResponse & ValidateAutomationResponseNonNullableFields>;
|
|
5193
|
+
}
|
|
4981
5194
|
declare const onAutomationCreated$1: EventDefinition<AutomationCreatedEnvelope, "wix.automations.v2.automation_created">;
|
|
4982
5195
|
declare const onAutomationUpdated$1: EventDefinition<AutomationUpdatedEnvelope, "wix.automations.v2.automation_updated">;
|
|
4983
5196
|
declare const onAutomationDeleted$1: EventDefinition<AutomationDeletedEnvelope, "wix.automations.v2.automation_deleted">;
|
|
@@ -5004,18 +5217,23 @@ type _publicValidateAutomationType = typeof validateAutomation$1;
|
|
|
5004
5217
|
declare const validateAutomation: ReturnType<typeof createRESTModule<_publicValidateAutomationType>>;
|
|
5005
5218
|
|
|
5006
5219
|
type _publicOnAutomationCreatedType = typeof onAutomationCreated$1;
|
|
5220
|
+
/** */
|
|
5007
5221
|
declare const onAutomationCreated: ReturnType<typeof createEventModule<_publicOnAutomationCreatedType>>;
|
|
5008
5222
|
|
|
5009
5223
|
type _publicOnAutomationUpdatedType = typeof onAutomationUpdated$1;
|
|
5224
|
+
/** */
|
|
5010
5225
|
declare const onAutomationUpdated: ReturnType<typeof createEventModule<_publicOnAutomationUpdatedType>>;
|
|
5011
5226
|
|
|
5012
5227
|
type _publicOnAutomationDeletedType = typeof onAutomationDeleted$1;
|
|
5228
|
+
/** */
|
|
5013
5229
|
declare const onAutomationDeleted: ReturnType<typeof createEventModule<_publicOnAutomationDeletedType>>;
|
|
5014
5230
|
|
|
5015
5231
|
type _publicOnAutomationUpdatedWithPreviousEntityType = typeof onAutomationUpdatedWithPreviousEntity$1;
|
|
5232
|
+
/** */
|
|
5016
5233
|
declare const onAutomationUpdatedWithPreviousEntity: ReturnType<typeof createEventModule<_publicOnAutomationUpdatedWithPreviousEntityType>>;
|
|
5017
5234
|
|
|
5018
5235
|
type _publicOnAutomationDeletedWithEntityType = typeof onAutomationDeletedWithEntity$1;
|
|
5236
|
+
/** */
|
|
5019
5237
|
declare const onAutomationDeletedWithEntity: ReturnType<typeof createEventModule<_publicOnAutomationDeletedWithEntityType>>;
|
|
5020
5238
|
|
|
5021
5239
|
type index_d_Action = Action;
|