@wix/auto_sdk_automations_automations-v-2 1.0.7 → 1.0.9
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/build/cjs/index.d.ts +9 -3
- package/build/cjs/index.js +55 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/{automations-v2-automation-automations-v-2.universal-BsNMNocV.d.ts → index.typings.d.ts} +353 -1
- package/build/cjs/index.typings.js +1436 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +27 -2
- package/build/cjs/meta.js +40 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +9 -3
- package/build/es/index.mjs +54 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/{automations-v2-automation-automations-v-2.universal-BsNMNocV.d.mts → index.typings.d.mts} +353 -1
- package/build/es/index.typings.mjs +1373 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +27 -2
- package/build/es/meta.mjs +39 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +9 -3
- package/build/internal/cjs/index.js +55 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/{automations-v2-automation-automations-v-2.universal-BsNMNocV.d.ts → index.typings.d.ts} +353 -1
- package/build/internal/cjs/index.typings.js +1436 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +27 -2
- package/build/internal/cjs/meta.js +40 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +9 -3
- package/build/internal/es/index.mjs +54 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/{automations-v2-automation-automations-v-2.universal-BsNMNocV.d.mts → index.typings.d.mts} +353 -1
- package/build/internal/es/index.typings.mjs +1373 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +27 -2
- package/build/internal/es/meta.mjs +39 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
1
3
|
interface Automation extends AutomationOriginInfoOneOf {
|
|
2
4
|
/** When the origin of the automation is `APPLICATION`, the details of the app that created it. */
|
|
3
5
|
applicationInfo?: ApplicationOrigin;
|
|
@@ -112,6 +114,8 @@ declare enum Domain {
|
|
|
112
114
|
/** Wix account-level domain. */
|
|
113
115
|
WIX_ACCOUNT = "WIX_ACCOUNT"
|
|
114
116
|
}
|
|
117
|
+
/** @enumType */
|
|
118
|
+
type DomainWithLiterals = Domain | 'USER' | 'WIX' | 'WIX_ACCOUNT';
|
|
115
119
|
interface Enrichment {
|
|
116
120
|
/**
|
|
117
121
|
* Enrichment input mappings.
|
|
@@ -1198,6 +1202,19 @@ interface Cursors {
|
|
|
1198
1202
|
*/
|
|
1199
1203
|
prev?: string | null;
|
|
1200
1204
|
}
|
|
1205
|
+
interface QueryPreinstalledAutomationsRequest {
|
|
1206
|
+
/**
|
|
1207
|
+
* Query.
|
|
1208
|
+
* Learn more about [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language).
|
|
1209
|
+
*/
|
|
1210
|
+
query?: CursorQuery;
|
|
1211
|
+
}
|
|
1212
|
+
interface QueryPreinstalledAutomationsResponse {
|
|
1213
|
+
/** Automations. */
|
|
1214
|
+
automations?: Automation[];
|
|
1215
|
+
/** Paging metadata. */
|
|
1216
|
+
pagingMetadata?: CursorPagingMetadata;
|
|
1217
|
+
}
|
|
1201
1218
|
interface QueryAutomationsRequest {
|
|
1202
1219
|
/**
|
|
1203
1220
|
* Query.
|
|
@@ -1790,6 +1807,29 @@ interface DraftsInfo {
|
|
|
1790
1807
|
*/
|
|
1791
1808
|
draftAutomationIds?: string[];
|
|
1792
1809
|
}
|
|
1810
|
+
interface BulkCountAutomationsWithDraftsRequest {
|
|
1811
|
+
/**
|
|
1812
|
+
* Array of filters in the following format:
|
|
1813
|
+
*
|
|
1814
|
+
* `"filter" :
|
|
1815
|
+
* [{
|
|
1816
|
+
* "fieldName1": "value1",
|
|
1817
|
+
* "fieldName2":{"$operator":"value2"}
|
|
1818
|
+
* }, {
|
|
1819
|
+
* "fieldName3": "value3",
|
|
1820
|
+
* "fieldName4":{"$operator":"value4"}
|
|
1821
|
+
* }]`
|
|
1822
|
+
*
|
|
1823
|
+
* Learn more about [filters in API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language#filters).
|
|
1824
|
+
* @minSize 1
|
|
1825
|
+
* @maxSize 3
|
|
1826
|
+
*/
|
|
1827
|
+
filters?: Record<string, any>[] | null;
|
|
1828
|
+
}
|
|
1829
|
+
interface BulkCountAutomationsWithDraftsResponse {
|
|
1830
|
+
/** Total automations count */
|
|
1831
|
+
counts?: number[];
|
|
1832
|
+
}
|
|
1793
1833
|
interface DeleteDraftAutomationRequest {
|
|
1794
1834
|
/**
|
|
1795
1835
|
* ID of the draft automation to delete.
|
|
@@ -2265,14 +2305,103 @@ interface AutomationCreatedEnvelope {
|
|
|
2265
2305
|
entity: Automation;
|
|
2266
2306
|
metadata: EventMetadata;
|
|
2267
2307
|
}
|
|
2308
|
+
/**
|
|
2309
|
+
* Triggered when a new automation is created.
|
|
2310
|
+
* @permissionScope Manage Stores
|
|
2311
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
2312
|
+
* @permissionScope Set Up Automations
|
|
2313
|
+
* @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
|
|
2314
|
+
* @permissionId AUTOMATIONS.AUTOMATION_READ
|
|
2315
|
+
* @webhook
|
|
2316
|
+
* @eventType wix.automations.v2.automation_created
|
|
2317
|
+
* @slug created
|
|
2318
|
+
* @documentationMaturity preview
|
|
2319
|
+
*/
|
|
2320
|
+
declare function onAutomationCreated(handler: (event: AutomationCreatedEnvelope) => void | Promise<void>): void;
|
|
2268
2321
|
interface AutomationDeletedEnvelope {
|
|
2269
2322
|
entity: Automation;
|
|
2270
2323
|
metadata: EventMetadata;
|
|
2271
2324
|
}
|
|
2325
|
+
/**
|
|
2326
|
+
* Triggered when an automation is deleted.
|
|
2327
|
+
* @permissionScope Manage Stores
|
|
2328
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
2329
|
+
* @permissionScope Set Up Automations
|
|
2330
|
+
* @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
|
|
2331
|
+
* @permissionId AUTOMATIONS.AUTOMATION_READ
|
|
2332
|
+
* @webhook
|
|
2333
|
+
* @eventType wix.automations.v2.automation_deleted
|
|
2334
|
+
* @slug deleted
|
|
2335
|
+
* @documentationMaturity preview
|
|
2336
|
+
*/
|
|
2337
|
+
declare function onAutomationDeleted(handler: (event: AutomationDeletedEnvelope) => void | Promise<void>): void;
|
|
2272
2338
|
interface AutomationUpdatedEnvelope {
|
|
2273
2339
|
entity: Automation;
|
|
2274
2340
|
metadata: EventMetadata;
|
|
2275
2341
|
}
|
|
2342
|
+
/**
|
|
2343
|
+
* Triggered when an automation is updated.
|
|
2344
|
+
* @permissionScope Manage Stores
|
|
2345
|
+
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
2346
|
+
* @permissionScope Set Up Automations
|
|
2347
|
+
* @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS
|
|
2348
|
+
* @permissionId AUTOMATIONS.AUTOMATION_READ
|
|
2349
|
+
* @webhook
|
|
2350
|
+
* @eventType wix.automations.v2.automation_updated
|
|
2351
|
+
* @slug updated
|
|
2352
|
+
* @documentationMaturity preview
|
|
2353
|
+
*/
|
|
2354
|
+
declare function onAutomationUpdated(handler: (event: AutomationUpdatedEnvelope) => void | Promise<void>): void;
|
|
2355
|
+
type AutomationNonNullablePaths = `applicationInfo.appId` | `preinstalledInfo.appId` | `createdBy.userId` | `createdBy.appId` | `updatedBy.userId` | `updatedBy.appId` | `name` | `configuration.status` | `configuration.trigger.appId` | `configuration.trigger.triggerKey` | `configuration.trigger.filters` | `configuration.trigger.filters.${number}._id` | `configuration.trigger.filters.${number}.fieldKey` | `configuration.trigger.filters.${number}.filterExpression` | `configuration.trigger.scheduledEventOffset.preScheduledEventOffsetExpression` | `configuration.trigger.scheduledEventOffset.scheduledEventOffsetTimeUnit` | `configuration.trigger.rateLimit.maxActivationsExpression` | `configuration.trigger.rateLimit.durationTimeUnit` | `configuration.rootActionIds` | `origin` | `settings.hidden` | `settings.readonly` | `settings.disableDelete` | `settings.disableStatusChange` | `settings.actionSettings.permanentActionIds` | `settings.actionSettings.readonlyActionIds` | `settings.actionSettings.disableDelayAddition` | `settings.actionSettings.disableConditionAddition` | `archived`;
|
|
2356
|
+
/**
|
|
2357
|
+
* Creates an automation.
|
|
2358
|
+
* @param automation - Automation to create.
|
|
2359
|
+
* @public
|
|
2360
|
+
* @documentationMaturity preview
|
|
2361
|
+
* @requiredField automation
|
|
2362
|
+
* @requiredField automation.configuration
|
|
2363
|
+
* @requiredField automation.configuration.actions
|
|
2364
|
+
* @requiredField automation.configuration.rootActionIds
|
|
2365
|
+
* @requiredField automation.configuration.status
|
|
2366
|
+
* @requiredField automation.configuration.trigger
|
|
2367
|
+
* @requiredField automation.configuration.trigger.appId
|
|
2368
|
+
* @requiredField automation.configuration.trigger.triggerKey
|
|
2369
|
+
* @requiredField automation.name
|
|
2370
|
+
* @requiredField automation.origin
|
|
2371
|
+
* @permissionId AUTOMATIONS.AUTOMATION_CREATE
|
|
2372
|
+
* @applicableIdentity APP
|
|
2373
|
+
* @returns Details of the created automation.
|
|
2374
|
+
* @fqn wix.automations.v2.AutomationsService.CreateAutomation
|
|
2375
|
+
*/
|
|
2376
|
+
declare function createAutomation(automation: NonNullablePaths<Automation, `configuration` | `configuration.actions` | `configuration.rootActionIds` | `configuration.status` | `configuration.trigger` | `configuration.trigger.appId` | `configuration.trigger.triggerKey` | `name` | `origin`>): Promise<NonNullablePaths<Automation, AutomationNonNullablePaths>>;
|
|
2377
|
+
/**
|
|
2378
|
+
* Retrieves an automation by ID.
|
|
2379
|
+
* @param automationId - Automation ID.
|
|
2380
|
+
* @public
|
|
2381
|
+
* @documentationMaturity preview
|
|
2382
|
+
* @requiredField automationId
|
|
2383
|
+
* @permissionId AUTOMATIONS.AUTOMATION_READ
|
|
2384
|
+
* @applicableIdentity APP
|
|
2385
|
+
* @returns Retrieved automation.
|
|
2386
|
+
* @fqn wix.automations.v2.AutomationsService.GetAutomation
|
|
2387
|
+
*/
|
|
2388
|
+
declare function getAutomation(automationId: string): Promise<NonNullablePaths<Automation, AutomationNonNullablePaths>>;
|
|
2389
|
+
/**
|
|
2390
|
+
* Updates the specified automation.
|
|
2391
|
+
*
|
|
2392
|
+
* When an automation is updated, its `revision` property is incremented by 1. When updating an automation, you must specify the current revision number.
|
|
2393
|
+
* @param _id - Automation ID.
|
|
2394
|
+
* @public
|
|
2395
|
+
* @documentationMaturity preview
|
|
2396
|
+
* @requiredField _id
|
|
2397
|
+
* @requiredField automation
|
|
2398
|
+
* @requiredField automation.revision
|
|
2399
|
+
* @permissionId AUTOMATIONS.AUTOMATION_UPDATE
|
|
2400
|
+
* @applicableIdentity APP
|
|
2401
|
+
* @returns Updated automation.
|
|
2402
|
+
* @fqn wix.automations.v2.AutomationsService.UpdateAutomation
|
|
2403
|
+
*/
|
|
2404
|
+
declare function updateAutomation(_id: string, automation: NonNullablePaths<UpdateAutomation, `revision`>): Promise<NonNullablePaths<Automation, AutomationNonNullablePaths>>;
|
|
2276
2405
|
interface UpdateAutomation {
|
|
2277
2406
|
/** When the origin of the automation is `APPLICATION`, the details of the app that created it. */
|
|
2278
2407
|
applicationInfo?: ApplicationOrigin;
|
|
@@ -2342,6 +2471,43 @@ interface UpdateAutomation {
|
|
|
2342
2471
|
*/
|
|
2343
2472
|
archived?: boolean;
|
|
2344
2473
|
}
|
|
2474
|
+
/**
|
|
2475
|
+
* Deletes the specified automation.
|
|
2476
|
+
* @param automationId - Automation ID.
|
|
2477
|
+
* @public
|
|
2478
|
+
* @documentationMaturity preview
|
|
2479
|
+
* @requiredField automationId
|
|
2480
|
+
* @permissionId AUTOMATIONS.AUTOMATION_DELETE
|
|
2481
|
+
* @applicableIdentity APP
|
|
2482
|
+
* @fqn wix.automations.v2.AutomationsService.DeleteAutomation
|
|
2483
|
+
*/
|
|
2484
|
+
declare function deleteAutomation(automationId: string): Promise<void>;
|
|
2485
|
+
/**
|
|
2486
|
+
* Deletes one or more automations.
|
|
2487
|
+
* @param automationIds - IDs of the automations to delete.
|
|
2488
|
+
* @public
|
|
2489
|
+
* @documentationMaturity preview
|
|
2490
|
+
* @requiredField automationIds
|
|
2491
|
+
* @permissionId AUTOMATIONS.AUTOMATION_DELETE
|
|
2492
|
+
* @applicableIdentity APP
|
|
2493
|
+
* @fqn wix.automations.v2.AutomationsService.BulkDeleteAutomations
|
|
2494
|
+
*/
|
|
2495
|
+
declare function bulkDeleteAutomations(automationIds: string[]): Promise<NonNullablePaths<BulkDeleteAutomationsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`>>;
|
|
2496
|
+
/**
|
|
2497
|
+
* Generates a preinstalled automation from another automation.
|
|
2498
|
+
*
|
|
2499
|
+
* Calls the action providers for changes needed to make a preinstalled automation, such as changes made to email template.
|
|
2500
|
+
*
|
|
2501
|
+
* > **Note**: You must have an account permission to edit an app.
|
|
2502
|
+
* @param automation - Automation.
|
|
2503
|
+
* @public
|
|
2504
|
+
* @documentationMaturity preview
|
|
2505
|
+
* @requiredField automation
|
|
2506
|
+
* @fqn wix.automations.v2.AutomationsService.GeneratePreinstalledAutomation
|
|
2507
|
+
*/
|
|
2508
|
+
declare function generatePreinstalledAutomation(automation: Automation, options?: GeneratePreinstalledAutomationOptions): Promise<NonNullablePaths<GeneratePreinstalledAutomationResponse, {
|
|
2509
|
+
[P in AutomationNonNullablePaths]: `automation.${P}`;
|
|
2510
|
+
}[AutomationNonNullablePaths]>>;
|
|
2345
2511
|
interface GeneratePreinstalledAutomationOptions {
|
|
2346
2512
|
/**
|
|
2347
2513
|
* ID of the app to which the automation belongs.
|
|
@@ -2349,6 +2515,19 @@ interface GeneratePreinstalledAutomationOptions {
|
|
|
2349
2515
|
*/
|
|
2350
2516
|
appId?: string;
|
|
2351
2517
|
}
|
|
2518
|
+
/**
|
|
2519
|
+
* Retrieves a list of automations. This includes both automations overridden on a site and preinstalled automations. If a preinstalled automation has been overridden on the site, the method returns the override automation.
|
|
2520
|
+
*
|
|
2521
|
+
* > **Note**: The method only returns automations by apps installed on the site.
|
|
2522
|
+
*
|
|
2523
|
+
* Learn more about [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
|
|
2524
|
+
* @public
|
|
2525
|
+
* @documentationMaturity preview
|
|
2526
|
+
* @permissionId AUTOMATIONS.AUTOMATION_READ
|
|
2527
|
+
* @applicableIdentity APP
|
|
2528
|
+
* @fqn wix.automations.v2.AutomationsService.QueryAutomations
|
|
2529
|
+
*/
|
|
2530
|
+
declare function queryAutomations(): AutomationsQueryBuilder;
|
|
2352
2531
|
interface QueryCursorResult {
|
|
2353
2532
|
cursors: Cursors;
|
|
2354
2533
|
hasNext: () => boolean;
|
|
@@ -2431,6 +2610,15 @@ interface AutomationsQueryBuilder {
|
|
|
2431
2610
|
/** @documentationMaturity preview */
|
|
2432
2611
|
find: () => Promise<AutomationsQueryResult>;
|
|
2433
2612
|
}
|
|
2613
|
+
/**
|
|
2614
|
+
* Get aggregated info
|
|
2615
|
+
* @public
|
|
2616
|
+
* @documentationMaturity preview
|
|
2617
|
+
* @permissionId AUTOMATIONS.AUTOMATION_READ
|
|
2618
|
+
* @applicableIdentity APP
|
|
2619
|
+
* @fqn wix.automations.v2.AutomationsService.GetAggregatedUsageInfo
|
|
2620
|
+
*/
|
|
2621
|
+
declare function getAggregatedUsageInfo(options?: GetAggregatedUsageInfoOptions): Promise<NonNullablePaths<GetAggregatedUsageInfoResponse, `triggersUsageSummary` | `triggersUsageSummary.${number}.appId` | `triggersUsageSummary.${number}.triggerKey` | `triggersUsageSummary.${number}.automationsCount` | `actionsUsageSummary` | `actionsUsageSummary.${number}.appId` | `actionsUsageSummary.${number}.actionKey` | `actionsUsageSummary.${number}.automationsCount`>>;
|
|
2434
2622
|
interface GetAggregatedUsageInfoOptions {
|
|
2435
2623
|
/**
|
|
2436
2624
|
* Filter in the following format:
|
|
@@ -2445,16 +2633,72 @@ interface GetAggregatedUsageInfoOptions {
|
|
|
2445
2633
|
*/
|
|
2446
2634
|
filter?: Record<string, any> | null;
|
|
2447
2635
|
}
|
|
2636
|
+
/**
|
|
2637
|
+
* Creates a copy of an action with a new ID, and changes the action's input mapping if necessary.
|
|
2638
|
+
*
|
|
2639
|
+
* The action copy isn't saved automatically. To save it, the user must perform an action
|
|
2640
|
+
* such as clicking the **Save** button.
|
|
2641
|
+
* @param automationId - ID of the automation to copy.
|
|
2642
|
+
* @public
|
|
2643
|
+
* @documentationMaturity preview
|
|
2644
|
+
* @requiredField automationId
|
|
2645
|
+
* @permissionId AUTOMATIONS.AUTOMATION_COPY
|
|
2646
|
+
* @applicableIdentity APP
|
|
2647
|
+
* @fqn wix.automations.v2.AutomationsService.CopyAutomation
|
|
2648
|
+
*/
|
|
2649
|
+
declare function copyAutomation(automationId: string, options?: CopyAutomationOptions): Promise<NonNullablePaths<CopyAutomationResponse, {
|
|
2650
|
+
[P in AutomationNonNullablePaths]: `automation.${P}`;
|
|
2651
|
+
}[AutomationNonNullablePaths]>>;
|
|
2448
2652
|
interface CopyAutomationOptions {
|
|
2449
2653
|
/** Origin of the automation to copy. */
|
|
2450
2654
|
origin?: OriginWithLiterals;
|
|
2451
2655
|
/** Automation to copy. Skips fetching by ID. */
|
|
2452
2656
|
automation?: Automation;
|
|
2453
2657
|
}
|
|
2658
|
+
/**
|
|
2659
|
+
* Creates a draft automation.
|
|
2660
|
+
* @public
|
|
2661
|
+
* @documentationMaturity preview
|
|
2662
|
+
* @permissionId AUTOMATIONS.AUTOMATION_DRAFT_CREATE
|
|
2663
|
+
* @applicableIdentity APP
|
|
2664
|
+
* @fqn wix.automations.v2.AutomationsService.CreateDraftAutomation
|
|
2665
|
+
*/
|
|
2666
|
+
declare function createDraftAutomation(options?: CreateDraftAutomationOptions): Promise<NonNullablePaths<CreateDraftAutomationResponse, {
|
|
2667
|
+
[P in AutomationNonNullablePaths]: `automation.${P}`;
|
|
2668
|
+
}[AutomationNonNullablePaths]>>;
|
|
2454
2669
|
interface CreateDraftAutomationOptions {
|
|
2455
2670
|
/** Draft automation to create. */
|
|
2456
2671
|
automation?: Automation;
|
|
2457
2672
|
}
|
|
2673
|
+
/**
|
|
2674
|
+
* Retrieves the draft of the specified automation. If a draft doesn't exist, the method creates one.
|
|
2675
|
+
*
|
|
2676
|
+
* > **Note**: If the specified automation is a draft, the method returns it.
|
|
2677
|
+
* @param originalAutomationId - ID of the original automation on which the draft is based.
|
|
2678
|
+
* @public
|
|
2679
|
+
* @documentationMaturity preview
|
|
2680
|
+
* @requiredField originalAutomationId
|
|
2681
|
+
* @permissionId AUTOMATIONS.AUTOMATION_DRAFT_CREATE
|
|
2682
|
+
* @applicableIdentity APP
|
|
2683
|
+
* @fqn wix.automations.v2.AutomationsService.GetOrCreateDraftAutomation
|
|
2684
|
+
*/
|
|
2685
|
+
declare function getOrCreateDraftAutomation(originalAutomationId: string): Promise<NonNullablePaths<GetOrCreateDraftAutomationResponse, {
|
|
2686
|
+
[P in AutomationNonNullablePaths]: `automation.${P}`;
|
|
2687
|
+
}[AutomationNonNullablePaths]>>;
|
|
2688
|
+
/**
|
|
2689
|
+
* Updates a draft automation.
|
|
2690
|
+
* @param _id - Automation ID.
|
|
2691
|
+
* @public
|
|
2692
|
+
* @documentationMaturity preview
|
|
2693
|
+
* @requiredField _id
|
|
2694
|
+
* @requiredField automation
|
|
2695
|
+
* @permissionId AUTOMATIONS.AUTOMATION_DRAFT_UPDATE
|
|
2696
|
+
* @applicableIdentity APP
|
|
2697
|
+
* @fqn wix.automations.v2.AutomationsService.UpdateDraftAutomation
|
|
2698
|
+
*/
|
|
2699
|
+
declare function updateDraftAutomation(_id: string, automation: UpdateDraftAutomation): Promise<NonNullablePaths<UpdateDraftAutomationResponse, {
|
|
2700
|
+
[P in AutomationNonNullablePaths]: `automation.${P}`;
|
|
2701
|
+
}[AutomationNonNullablePaths]>>;
|
|
2458
2702
|
interface UpdateDraftAutomation {
|
|
2459
2703
|
/** When the origin of the automation is `APPLICATION`, the details of the app that created it. */
|
|
2460
2704
|
applicationInfo?: ApplicationOrigin;
|
|
@@ -2524,6 +2768,29 @@ interface UpdateDraftAutomation {
|
|
|
2524
2768
|
*/
|
|
2525
2769
|
archived?: boolean;
|
|
2526
2770
|
}
|
|
2771
|
+
/**
|
|
2772
|
+
* Retrieves a list of automations, including drafts. Max query filter depth is 3.
|
|
2773
|
+
*
|
|
2774
|
+
* Relevant automations for the query are returned. This includes automations created on the site and pre-installed automations.
|
|
2775
|
+
* If there's an existing override for a pre-installed automation, the override is returned in the query result.
|
|
2776
|
+
* The query only returns automations from apps that are installed on the site.
|
|
2777
|
+
*
|
|
2778
|
+
* - new drafts that are not related to existing automations will be returned in the list
|
|
2779
|
+
* - the response will contain a map of originalAutomationId => relatedDrafts
|
|
2780
|
+
*
|
|
2781
|
+
* To learn about working with _Query_ endpoints, see
|
|
2782
|
+
* [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
|
|
2783
|
+
* [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination),
|
|
2784
|
+
* and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
|
|
2785
|
+
* @public
|
|
2786
|
+
* @documentationMaturity preview
|
|
2787
|
+
* @permissionId AUTOMATIONS.AUTOMATION_DRAFT_READ
|
|
2788
|
+
* @applicableIdentity APP
|
|
2789
|
+
* @fqn wix.automations.v2.AutomationsService.QueryAutomationsWithDrafts
|
|
2790
|
+
*/
|
|
2791
|
+
declare function queryAutomationsWithDrafts(options?: QueryAutomationsWithDraftsOptions): Promise<NonNullablePaths<QueryAutomationsWithDraftsResponse, {
|
|
2792
|
+
[P in AutomationNonNullablePaths]: `automations.${number}.${P}`;
|
|
2793
|
+
}[AutomationNonNullablePaths]>>;
|
|
2527
2794
|
interface QueryAutomationsWithDraftsOptions {
|
|
2528
2795
|
/**
|
|
2529
2796
|
* Query.
|
|
@@ -2532,14 +2799,99 @@ interface QueryAutomationsWithDraftsOptions {
|
|
|
2532
2799
|
*/
|
|
2533
2800
|
query?: CursorQuery;
|
|
2534
2801
|
}
|
|
2802
|
+
/** @public
|
|
2803
|
+
* @documentationMaturity preview
|
|
2804
|
+
* @permissionId AUTOMATIONS.AUTOMATION_DRAFT_READ
|
|
2805
|
+
* @applicableIdentity APP
|
|
2806
|
+
* @fqn wix.automations.v2.AutomationsService.BulkCountAutomationsWithDrafts
|
|
2807
|
+
*/
|
|
2808
|
+
declare function bulkCountAutomationsWithDrafts(options?: BulkCountAutomationsWithDraftsOptions): Promise<NonNullablePaths<BulkCountAutomationsWithDraftsResponse, `counts`>>;
|
|
2809
|
+
interface BulkCountAutomationsWithDraftsOptions {
|
|
2810
|
+
/**
|
|
2811
|
+
* Array of filters in the following format:
|
|
2812
|
+
*
|
|
2813
|
+
* `"filter" :
|
|
2814
|
+
* [{
|
|
2815
|
+
* "fieldName1": "value1",
|
|
2816
|
+
* "fieldName2":{"$operator":"value2"}
|
|
2817
|
+
* }, {
|
|
2818
|
+
* "fieldName3": "value3",
|
|
2819
|
+
* "fieldName4":{"$operator":"value4"}
|
|
2820
|
+
* }]`
|
|
2821
|
+
*
|
|
2822
|
+
* Learn more about [filters in API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language#filters).
|
|
2823
|
+
* @minSize 1
|
|
2824
|
+
* @maxSize 3
|
|
2825
|
+
*/
|
|
2826
|
+
filters?: Record<string, any>[] | null;
|
|
2827
|
+
}
|
|
2828
|
+
/**
|
|
2829
|
+
* Deletes a draft automation.
|
|
2830
|
+
* @param automationId - ID of the draft automation to delete.
|
|
2831
|
+
* @public
|
|
2832
|
+
* @documentationMaturity preview
|
|
2833
|
+
* @requiredField automationId
|
|
2834
|
+
* @permissionId AUTOMATIONS.AUTOMATION_DRAFT_DELETE
|
|
2835
|
+
* @applicableIdentity APP
|
|
2836
|
+
* @fqn wix.automations.v2.AutomationsService.DeleteDraftAutomation
|
|
2837
|
+
*/
|
|
2838
|
+
declare function deleteDraftAutomation(automationId: string): Promise<void>;
|
|
2839
|
+
/**
|
|
2840
|
+
* Publishes a draft automation. This applies any changes to the live automation.
|
|
2841
|
+
* @param automationId - ID of the draft automation to publish.
|
|
2842
|
+
* @public
|
|
2843
|
+
* @documentationMaturity preview
|
|
2844
|
+
* @requiredField automationId
|
|
2845
|
+
* @permissionId AUTOMATIONS.AUTOMATION_UPDATE
|
|
2846
|
+
* @applicableIdentity APP
|
|
2847
|
+
* @fqn wix.automations.v2.AutomationsService.PublishDraftAutomation
|
|
2848
|
+
*/
|
|
2849
|
+
declare function publishDraftAutomation(automationId: string): Promise<NonNullablePaths<PublishDraftAutomationResponse, {
|
|
2850
|
+
[P in AutomationNonNullablePaths]: `automation.${P}`;
|
|
2851
|
+
}[AutomationNonNullablePaths]>>;
|
|
2852
|
+
/**
|
|
2853
|
+
* Validates the specified automation.
|
|
2854
|
+
* @param automation - Automation to validate.
|
|
2855
|
+
* @public
|
|
2856
|
+
* @documentationMaturity preview
|
|
2857
|
+
* @requiredField automation
|
|
2858
|
+
* @permissionId AUTOMATIONS.AUTOMATION_VALIDATE
|
|
2859
|
+
* @applicableIdentity APP
|
|
2860
|
+
* @fqn wix.automations.v2.AutomationsService.ValidateAutomation
|
|
2861
|
+
*/
|
|
2862
|
+
declare function validateAutomation(automation: Automation, options?: ValidateAutomationOptions): Promise<NonNullablePaths<ValidateAutomationResponse, `valid` | `triggerValidationErrors` | `triggerValidationErrors.${number}.configurationError.errorType` | `triggerValidationErrors.${number}.providerConfigurationError.message` | `triggerValidationErrors.${number}.providerConfigurationError.title` | `triggerValidationErrors.${number}.errorType` | `triggerValidationErrors.${number}.severity` | `actionValidationInfo` | `actionValidationInfo.${number}.appId` | `actionValidationInfo.${number}.actionKey` | `automationValidationErrors` | `automationValidationErrors.${number}.configurationError.errorType` | `automationValidationErrors.${number}.providerConfigurationError.message` | `automationValidationErrors.${number}.providerConfigurationError.title` | `automationValidationErrors.${number}.errorType` | `automationValidationErrors.${number}.severity`>>;
|
|
2535
2863
|
interface ValidateAutomationOptions {
|
|
2536
2864
|
/** Automation validation settings. */
|
|
2537
2865
|
validationSettings?: ValidationSettings;
|
|
2538
2866
|
}
|
|
2867
|
+
/**
|
|
2868
|
+
* Validates the automation specified by ID.
|
|
2869
|
+
* @param automationId - Automation ID.
|
|
2870
|
+
* @public
|
|
2871
|
+
* @documentationMaturity preview
|
|
2872
|
+
* @requiredField automationId
|
|
2873
|
+
* @permissionId AUTOMATIONS.AUTOMATION_VALIDATE
|
|
2874
|
+
* @applicableIdentity APP
|
|
2875
|
+
* @fqn wix.automations.v2.AutomationsService.ValidateAutomationById
|
|
2876
|
+
*/
|
|
2877
|
+
declare function validateAutomationById(automationId: string, options?: ValidateAutomationByIdOptions): Promise<NonNullablePaths<ValidateAutomationByIdResponse, `valid` | `triggerValidationErrors` | `triggerValidationErrors.${number}.configurationError.errorType` | `triggerValidationErrors.${number}.providerConfigurationError.message` | `triggerValidationErrors.${number}.providerConfigurationError.title` | `triggerValidationErrors.${number}.errorType` | `triggerValidationErrors.${number}.severity` | `actionValidationInfo` | `actionValidationInfo.${number}.appId` | `actionValidationInfo.${number}.actionKey` | `automationValidationErrors` | `automationValidationErrors.${number}.configurationError.errorType` | `automationValidationErrors.${number}.providerConfigurationError.message` | `automationValidationErrors.${number}.providerConfigurationError.title` | `automationValidationErrors.${number}.errorType` | `automationValidationErrors.${number}.severity`>>;
|
|
2539
2878
|
interface ValidateAutomationByIdOptions {
|
|
2540
2879
|
/** Validation settings. */
|
|
2541
2880
|
validationSettings?: ValidationSettings;
|
|
2542
2881
|
}
|
|
2882
|
+
/**
|
|
2883
|
+
* Gets the specified automation revision.
|
|
2884
|
+
* @param automationId - Automation ID.
|
|
2885
|
+
* @public
|
|
2886
|
+
* @documentationMaturity preview
|
|
2887
|
+
* @requiredField automationId
|
|
2888
|
+
* @permissionId AUTOMATIONS.AUTOMATION_REVISION_READ
|
|
2889
|
+
* @applicableIdentity APP
|
|
2890
|
+
* @fqn wix.automations.v2.AutomationRevisionsService.GetAutomationRevision
|
|
2891
|
+
*/
|
|
2892
|
+
declare function getAutomationRevision(automationId: string, options?: GetAutomationRevisionOptions): Promise<NonNullablePaths<GetAutomationRevisionResponse, {
|
|
2893
|
+
[P in AutomationNonNullablePaths]: `automation.${P}`;
|
|
2894
|
+
}[AutomationNonNullablePaths]>>;
|
|
2543
2895
|
interface GetAutomationRevisionOptions {
|
|
2544
2896
|
/** Revision number. */
|
|
2545
2897
|
revision?: string | null;
|
|
@@ -2550,4 +2902,4 @@ interface GetAutomationRevisionOptions {
|
|
|
2550
2902
|
fields?: RequestedFieldsWithLiterals[];
|
|
2551
2903
|
}
|
|
2552
2904
|
|
|
2553
|
-
export { type
|
|
2905
|
+
export { type Action, type ActionConfigurationError, ActionErrorType, type ActionErrorTypeWithLiterals, type ActionEvent, type ActionInfoOneOf, type ActionProviderQuotaInfo, type ActionQuotaInfo, type ActionSettings, type ActionUsageSummary, type ActionValidationError, type ActionValidationErrorErrorOneOf, type ActionValidationInfo, type AdditionalInfo, type AppDefinedAction, type ApplicationError, type ApplicationOrigin, type Asset, type AuditInfo, type AuditInfoIdOneOf, type Automation, type AutomationConfiguration, type AutomationConfigurationError, type AutomationCreatedEnvelope, type AutomationDeletedEnvelope, AutomationErrorType, type AutomationErrorTypeWithLiterals, type AutomationMigrationRequest, type AutomationOriginInfoOneOf, type AutomationSettings, type AutomationUpdatedEnvelope, type AutomationValidationError, type AutomationValidationErrorErrorOneOf, AutomationValidationErrorValidationErrorType, type AutomationValidationErrorValidationErrorTypeWithLiterals, type AutomationsQueryBuilder, type AutomationsQueryResult, type BaseEventMetadata, type BulkActionMetadata, type BulkCountAutomationsWithDraftsOptions, type BulkCountAutomationsWithDraftsRequest, type BulkCountAutomationsWithDraftsResponse, type BulkDeleteAutomationsRequest, type BulkDeleteAutomationsResponse, type BulkDeleteResult, type CTA, type CodeConditionAction, type CodeSnippet, type ConditionAction, type ConditionExpressionGroup, type CopyAutomationOptions, type CopyAutomationRequest, type CopyAutomationResponse, type CreateAutomationRequest, type CreateAutomationResponse, type CreateDraftAutomationOptions, type CreateDraftAutomationRequest, type CreateDraftAutomationResponse, type CreatePreinstalledAutomationRequest, type CreatePreinstalledAutomationResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DelayAction, type DeleteAutomationRequest, type DeleteAutomationResponse, type DeleteContext, type DeleteDraftAutomationRequest, type DeleteDraftAutomationResponse, type DeletePreinstalledAutomationRequest, type DeletePreinstalledAutomationResponse, DeleteStatus, type DeleteStatusWithLiterals, type DeletedWithEntity, Domain, type DomainEvent, type DomainEventBodyOneOf, type DomainWithLiterals, type DraftInfo, type DraftPublished, type DraftsInfo, type Empty, type Enrichment, type Enrichments, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type Filter, type FilterValueSelection, type FilterableAppDefinedActions, type FutureDateActivationOffset, type GeneratePreinstalledAutomationOptions, type GeneratePreinstalledAutomationRequest, type GeneratePreinstalledAutomationResponse, type GetActionsQuotaInfoRequest, type GetActionsQuotaInfoResponse, type GetAggregatedUsageInfoOptions, type GetAggregatedUsageInfoRequest, type GetAggregatedUsageInfoResponse, type GetAutomationActionSchemaRequest, type GetAutomationActionSchemaResponse, type GetAutomationRequest, type GetAutomationResponse, type GetAutomationRevisionOptions, type GetAutomationRevisionRequest, type GetAutomationRevisionResponse, type GetOrCreateDraftAutomationRequest, type GetOrCreateDraftAutomationResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, Language, type LanguageWithLiterals, type MessageEnvelope, type MetaSiteSpecialEvent, type MetaSiteSpecialEventPayloadOneOf, type MigrateVeloActionAutomationsRequest, type MigrateVeloActionAutomationsResponse, Namespace, type NamespaceChanged, type NamespaceWithLiterals, type OdeditorAssigned, type OdeditorUnassigned, Operator, type OperatorWithLiterals, Origin, type OriginAutomationInfo, type OriginWithLiterals, type OutputAction, type Path, type PicassoAssigned, type PicassoUnassigned, type Plan, type PreinstalledAutomationSpecInfo, type PreinstalledOrigin, type ProviderConfigurationError, type PublishDraftAutomationRequest, type PublishDraftAutomationResponse, type QueryAutomationsRequest, type QueryAutomationsResponse, type QueryAutomationsWithDraftsOptions, type QueryAutomationsWithDraftsRequest, type QueryAutomationsWithDraftsResponse, type QueryPreinstalledAutomationsForAppRequest, type QueryPreinstalledAutomationsForAppResponse, type QueryPreinstalledAutomationsRequest, type QueryPreinstalledAutomationsResponse, type Quota, type QuotaInfo, type RateLimit, type RateLimitAction, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, type ServiceProvisioned, type ServiceRemoved, type SetVariablesAction, type SiteCreated, SiteCreatedContext, type SiteCreatedContextWithLiterals, type SiteDeleted, type SiteHardDeleted, type SiteMarkedAsTemplate, type SiteMarkedAsWixSite, type SitePublished, type SitePurgedExternally, type SiteRenamed, type SiteTransferred, type SiteUndeleted, type SiteUnpublished, type SiteUrlChanged, SortOrder, type SortOrderWithLiterals, type Sorting, type SplitAction, State, type StateWithLiterals, Status, type StatusWithLiterals, type StudioAssigned, type StudioUnassigned, type TestUpdateApplicationAutomationRequest, type TestUpdateApplicationAutomationResponse, TimeUnit, type TimeUnitWithLiterals, type Trigger, type TriggerConfigurationError, TriggerErrorType, type TriggerErrorTypeWithLiterals, type TriggerUsageSummary, type TriggerValidationError, type TriggerValidationErrorErrorOneOf, TriggerValidationErrorValidationErrorType, type TriggerValidationErrorValidationErrorTypeWithLiterals, Type, type TypeWithLiterals, type UpdateApplicationAutomationsRequest, type UpdateApplicationAutomationsResponse, type UpdateAutomation, type UpdateAutomationRequest, type UpdateAutomationResponse, type UpdateDraftAutomation, type UpdateDraftAutomationRequest, type UpdateDraftAutomationResponse, type UpdatePreinstalledAutomationRequest, type UpdatePreinstalledAutomationResponse, type UpdatedWithPreviousEntity, type UpgradeCTA, type ValidateAutomationByIdOptions, type ValidateAutomationByIdRequest, type ValidateAutomationByIdResponse, type ValidateAutomationOptions, type ValidateAutomationRequest, type ValidateAutomationResponse, ValidationErrorSeverity, type ValidationErrorSeverityWithLiterals, ValidationErrorType, type ValidationErrorTypeWithLiterals, type ValidationSettings, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkCountAutomationsWithDrafts, bulkDeleteAutomations, copyAutomation, createAutomation, createDraftAutomation, deleteAutomation, deleteDraftAutomation, generatePreinstalledAutomation, getAggregatedUsageInfo, getAutomation, getAutomationRevision, getOrCreateDraftAutomation, onAutomationCreated, onAutomationDeleted, onAutomationUpdated, publishDraftAutomation, queryAutomations, queryAutomationsWithDrafts, updateAutomation, updateDraftAutomation, validateAutomation, validateAutomationById };
|