@wix/auto_sdk_automations_automations-v-2 1.0.83 → 1.0.84
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 +10 -10
- package/build/cjs/index.js +74 -74
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +41 -41
- package/build/cjs/index.typings.js +65 -65
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +25 -25
- package/build/cjs/meta.js +52 -52
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +10 -10
- package/build/es/index.mjs +74 -74
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +41 -41
- package/build/es/index.typings.mjs +65 -65
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +25 -25
- package/build/es/meta.mjs +52 -52
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +10 -10
- package/build/internal/cjs/index.js +74 -74
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +41 -41
- package/build/internal/cjs/index.typings.js +65 -65
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +25 -25
- package/build/internal/cjs/meta.js +52 -52
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +10 -10
- package/build/internal/es/index.mjs +74 -74
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +41 -41
- package/build/internal/es/index.typings.mjs +65 -65
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +25 -25
- package/build/internal/es/meta.mjs +52 -52
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
package/build/es/index.d.mts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
|
-
import { Automation, UpdateAutomation, BulkDeleteAutomationsResponse, GeneratePreinstalledAutomationOptions, GeneratePreinstalledAutomationResponse, QueryPreinstalledAutomationsForAppOptions, QueryPreinstalledAutomationsForAppResponse, GetAggregatedUsageInfoOptions, GetAggregatedUsageInfoResponse, CopyAutomationOptions, CopyAutomationResponse, CreateDraftAutomationOptions, CreateDraftAutomationResponse, GetOrCreateDraftAutomationResponse, UpdateDraftAutomation, UpdateDraftAutomationResponse, QueryAutomationsWithDraftsOptions, QueryAutomationsWithDraftsResponse, BulkCountAutomationsWithDraftsOptions, BulkCountAutomationsWithDraftsResponse, PublishDraftAutomationResponse, ValidateAutomationOptions, ValidateAutomationResponse, ValidateAutomationByIdOptions, ValidateAutomationByIdResponse, GenerateActionInputMappingFromTemplateOptions, GenerateActionInputMappingFromTemplateResponse,
|
|
2
|
+
import { GetAutomationRevisionOptions, GetAutomationRevisionResponse, Automation, UpdateAutomation, BulkDeleteAutomationsResponse, GeneratePreinstalledAutomationOptions, GeneratePreinstalledAutomationResponse, QueryPreinstalledAutomationsForAppOptions, QueryPreinstalledAutomationsForAppResponse, GetAggregatedUsageInfoOptions, GetAggregatedUsageInfoResponse, CopyAutomationOptions, CopyAutomationResponse, CreateDraftAutomationOptions, CreateDraftAutomationResponse, GetOrCreateDraftAutomationResponse, UpdateDraftAutomation, UpdateDraftAutomationResponse, QueryAutomationsWithDraftsOptions, QueryAutomationsWithDraftsResponse, BulkCountAutomationsWithDraftsOptions, BulkCountAutomationsWithDraftsResponse, PublishDraftAutomationResponse, ValidateAutomationOptions, ValidateAutomationResponse, ValidateAutomationByIdOptions, ValidateAutomationByIdResponse, GenerateActionInputMappingFromTemplateOptions, GenerateActionInputMappingFromTemplateResponse, AutomationCreatedEnvelope, AutomationDeletedEnvelope, AutomationUpdatedEnvelope, AutomationQuery, QueryAutomationsOptions, typedQueryAutomations, AutomationsQueryBuilder } from './index.typings.mjs';
|
|
3
3
|
export { AIMetadata, Action, ActionConfigurationError, ActionErrorType, ActionErrorTypeWithLiterals, ActionEvent, ActionInfoOneOf, ActionProviderQuotaInfo, ActionQuotaInfo, ActionSettings, ActionUsageSummary, ActionValidationError, ActionValidationErrorErrorOneOf, ActionValidationInfo, AdditionalInfo, AppDefinedAction, ApplicationError, ApplicationOrigin, Asset, AuditInfo, AuditInfoIdOneOf, AutoArchivePolicy, AutomationConfiguration, AutomationConfigurationError, AutomationErrorType, AutomationErrorTypeWithLiterals, AutomationOriginInfoOneOf, AutomationQuerySpec, AutomationSettings, AutomationValidationError, AutomationValidationErrorErrorOneOf, AutomationValidationErrorValidationErrorType, AutomationValidationErrorValidationErrorTypeWithLiterals, AutomationsQueryResult, BaseEventMetadata, BulkActionMetadata, BulkCountAutomationsWithDraftsRequest, BulkDeleteAutomationsRequest, BulkDeleteResult, CTA, CodeConditionAction, CodeSnippet, CommonQueryWithEntityContext, ConditionAction, ConditionExpressionGroup, CopyAutomationRequest, CreateAutomationRequest, CreateAutomationResponse, CreateDraftAutomationRequest, CreatePreinstalledAutomationRequest, CreatePreinstalledAutomationResponse, CreatedByAppIdUsageSummary, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DelayAction, DeleteAutomationRequest, DeleteAutomationResponse, DeleteContext, DeleteDraftAutomationRequest, DeleteDraftAutomationResponse, DeletePreinstalledAutomationRequest, DeletePreinstalledAutomationResponse, DeleteStatus, DeleteStatusWithLiterals, Dimensions, Domain, DomainEvent, DomainEventBodyOneOf, DomainWithLiterals, DraftInfo, DraftPublished, DraftsInfo, Empty, Enrichment, Enrichments, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, Filter, FilterValueSelection, FilterableAppDefinedActions, FutureDateActivationOffset, GenerateActionInputMappingFromTemplateRequest, GeneratePreinstalledAutomationRequest, GetActionsQuotaInfoRequest, GetActionsQuotaInfoResponse, GetAggregatedUsageInfoRequest, GetAutomationActionSchemaRequest, GetAutomationActionSchemaResponse, GetAutomationRequest, GetAutomationResponse, GetAutomationRevisionRequest, GetOrCreateDraftAutomationRequest, IdentificationData, IdentificationDataIdOneOf, ItemMetadata, Language, LanguageWithLiterals, MergeOverridePreinstalledWithRuntimeVersionRequest, MergeOverridePreinstalledWithRuntimeVersionResponse, MessageEnvelope, MetaSiteSpecialEvent, MetaSiteSpecialEventPayloadOneOf, MigrateVeloActionAutomationsRequest, MigrateVeloActionAutomationsResponse, Namespace, NamespaceChanged, NamespaceWithLiterals, Note, Notes, OdeditorAssigned, OdeditorUnassigned, Offset, Operator, OperatorWithLiterals, Origin, OriginAutomationInfo, OriginWithLiterals, OutputAction, Path, PicassoAssigned, PicassoUnassigned, Plan, Position, PreinstalledAutomationSpecInfo, PreinstalledOrigin, ProviderConfigurationError, PublishDraftAutomationRequest, QueryAutomationsRequest, QueryAutomationsResponse, QueryAutomationsWithDraftsRequest, QueryDraftAutomationsRequest, QueryDraftAutomationsResponse, QueryPreinstalledAutomationsForAppRequest, QueryPreinstalledAutomationsRequest, QueryPreinstalledAutomationsResponse, Quota, QuotaInfo, RateLimit, RateLimitAction, RequestedFields, RequestedFieldsWithLiterals, RestoreInfo, ServiceProvisioned, ServiceRemoved, SetVariablesAction, Severity, SeverityWithLiterals, SiteCreated, SiteCreatedContext, SiteCreatedContextWithLiterals, SiteDeleted, SiteHardDeleted, SiteMarkedAsTemplate, SiteMarkedAsWixSite, SitePublished, SitePurgedExternally, SiteRenamed, SiteTransferred, SiteUndeleted, SiteUnpublished, SiteUrlChanged, SortOrder, SortOrderWithLiterals, Sorting, SplitAction, State, StateWithLiterals, Status, StatusWithLiterals, StudioAssigned, StudioTwoAssigned, StudioTwoUnassigned, StudioUnassigned, TimeUnit, TimeUnitWithLiterals, Trigger, TriggerConfigurationError, TriggerErrorType, TriggerErrorTypeWithLiterals, TriggerSettings, TriggerUsageSummary, TriggerValidationError, TriggerValidationErrorErrorOneOf, TriggerValidationErrorValidationErrorType, TriggerValidationErrorValidationErrorTypeWithLiterals, Type, TypeWithLiterals, UpdateAutomationRequest, UpdateAutomationResponse, UpdateDraftAutomationRequest, UpdatePreinstalledAutomationRequest, UpdatePreinstalledAutomationResponse, UpgradeCTA, ValidateAutomationByIdRequest, ValidateAutomationRequest, ValidationErrorSeverity, ValidationErrorSeverityWithLiterals, ValidationErrorType, ValidationErrorTypeWithLiterals, ValidationResultStatus, ValidationResultStatusWithLiterals, ValidationSettings, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WixelAssigned, WixelUnassigned } from './index.typings.mjs';
|
|
4
4
|
|
|
5
|
+
declare function getAutomationRevision$1(httpClient: HttpClient): GetAutomationRevisionSignature;
|
|
6
|
+
interface GetAutomationRevisionSignature {
|
|
7
|
+
/**
|
|
8
|
+
* Gets the specified automation revision.
|
|
9
|
+
* @param - Automation ID.
|
|
10
|
+
*/
|
|
11
|
+
(automationId: string, options?: GetAutomationRevisionOptions): Promise<NonNullablePaths<GetAutomationRevisionResponse, `automation.applicationInfo.appId` | `automation.preinstalledInfo.appId` | `automation.createdBy.userId` | `automation.createdBy.appId` | `automation.name` | `automation.configuration.status` | `automation.configuration.trigger.appId` | `automation.configuration.trigger.triggerKey` | `automation.configuration.trigger.filters` | `automation.configuration.trigger.filters.${number}._id` | `automation.configuration.trigger.filters.${number}.fieldKey` | `automation.configuration.trigger.filters.${number}.filterExpression` | `automation.configuration.trigger.scheduledEventOffset.preScheduledEventOffsetExpression` | `automation.configuration.trigger.scheduledEventOffset.scheduledEventOffsetTimeUnit` | `automation.configuration.trigger.rateLimit.maxActivationsExpression` | `automation.configuration.trigger.rateLimit.durationTimeUnit` | `automation.configuration.rootActionIds` | `automation.origin` | `automation.settings.hidden` | `automation.settings.readonly` | `automation.settings.disableDelete` | `automation.settings.disableStatusChange` | `automation.settings.actionSettings.permanentActionIds` | `automation.settings.actionSettings.readonlyActionIds` | `automation.archived`, 7>>;
|
|
12
|
+
}
|
|
5
13
|
declare function createAutomation$1(httpClient: HttpClient): CreateAutomationSignature;
|
|
6
14
|
interface CreateAutomationSignature {
|
|
7
15
|
/**
|
|
@@ -181,14 +189,6 @@ interface GenerateActionInputMappingFromTemplateSignature {
|
|
|
181
189
|
*/
|
|
182
190
|
(appId: string, options: NonNullablePaths<GenerateActionInputMappingFromTemplateOptions, `actionInputMappingTemplate` | `actionKey`, 2>): Promise<GenerateActionInputMappingFromTemplateResponse>;
|
|
183
191
|
}
|
|
184
|
-
declare function getAutomationRevision$1(httpClient: HttpClient): GetAutomationRevisionSignature;
|
|
185
|
-
interface GetAutomationRevisionSignature {
|
|
186
|
-
/**
|
|
187
|
-
* Gets the specified automation revision.
|
|
188
|
-
* @param - Automation ID.
|
|
189
|
-
*/
|
|
190
|
-
(automationId: string, options?: GetAutomationRevisionOptions): Promise<NonNullablePaths<GetAutomationRevisionResponse, `automation.applicationInfo.appId` | `automation.preinstalledInfo.appId` | `automation.createdBy.userId` | `automation.createdBy.appId` | `automation.name` | `automation.configuration.status` | `automation.configuration.trigger.appId` | `automation.configuration.trigger.triggerKey` | `automation.configuration.trigger.filters` | `automation.configuration.trigger.filters.${number}._id` | `automation.configuration.trigger.filters.${number}.fieldKey` | `automation.configuration.trigger.filters.${number}.filterExpression` | `automation.configuration.trigger.scheduledEventOffset.preScheduledEventOffsetExpression` | `automation.configuration.trigger.scheduledEventOffset.scheduledEventOffsetTimeUnit` | `automation.configuration.trigger.rateLimit.maxActivationsExpression` | `automation.configuration.trigger.rateLimit.durationTimeUnit` | `automation.configuration.rootActionIds` | `automation.origin` | `automation.settings.hidden` | `automation.settings.readonly` | `automation.settings.disableDelete` | `automation.settings.disableStatusChange` | `automation.settings.actionSettings.permanentActionIds` | `automation.settings.actionSettings.readonlyActionIds` | `automation.archived`, 7>>;
|
|
191
|
-
}
|
|
192
192
|
declare const onAutomationCreated$1: EventDefinition<AutomationCreatedEnvelope, "wix.automations.v2.automation_created">;
|
|
193
193
|
declare const onAutomationDeleted$1: EventDefinition<AutomationDeletedEnvelope, "wix.automations.v2.automation_deleted">;
|
|
194
194
|
declare const onAutomationUpdated$1: EventDefinition<AutomationUpdatedEnvelope, "wix.automations.v2.automation_updated">;
|
|
@@ -197,6 +197,7 @@ declare function customQueryAutomations(httpClient: HttpClient): {
|
|
|
197
197
|
(query: AutomationQuery, options?: QueryAutomationsOptions): ReturnType<typeof typedQueryAutomations>;
|
|
198
198
|
(options?: QueryAutomationsOptions): AutomationsQueryBuilder;
|
|
199
199
|
};
|
|
200
|
+
declare const getAutomationRevision: MaybeContext<BuildRESTFunction<typeof getAutomationRevision$1> & typeof getAutomationRevision$1>;
|
|
200
201
|
declare const createAutomation: MaybeContext<BuildRESTFunction<typeof createAutomation$1> & typeof createAutomation$1>;
|
|
201
202
|
declare const getAutomation: MaybeContext<BuildRESTFunction<typeof getAutomation$1> & typeof getAutomation$1>;
|
|
202
203
|
declare const updateAutomation: MaybeContext<BuildRESTFunction<typeof updateAutomation$1> & typeof updateAutomation$1>;
|
|
@@ -216,7 +217,6 @@ declare const publishDraftAutomation: MaybeContext<BuildRESTFunction<typeof publ
|
|
|
216
217
|
declare const validateAutomation: MaybeContext<BuildRESTFunction<typeof validateAutomation$1> & typeof validateAutomation$1>;
|
|
217
218
|
declare const validateAutomationById: MaybeContext<BuildRESTFunction<typeof validateAutomationById$1> & typeof validateAutomationById$1>;
|
|
218
219
|
declare const generateActionInputMappingFromTemplate: MaybeContext<BuildRESTFunction<typeof generateActionInputMappingFromTemplate$1> & typeof generateActionInputMappingFromTemplate$1>;
|
|
219
|
-
declare const getAutomationRevision: MaybeContext<BuildRESTFunction<typeof getAutomationRevision$1> & typeof getAutomationRevision$1>;
|
|
220
220
|
declare const queryAutomations: MaybeContext<BuildRESTFunction<typeof customQueryAutomations> & typeof customQueryAutomations>;
|
|
221
221
|
/**
|
|
222
222
|
* Triggered when a new automation is created.
|
package/build/es/index.mjs
CHANGED
|
@@ -19,7 +19,7 @@ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transform
|
|
|
19
19
|
import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transformations/field-mask";
|
|
20
20
|
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
21
21
|
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
22
|
-
function
|
|
22
|
+
function resolveWixAutomationsV2AutomationsServiceUrl(opts) {
|
|
23
23
|
const domainToMappings = {
|
|
24
24
|
"manage._base_domain_": [
|
|
25
25
|
{
|
|
@@ -58,7 +58,7 @@ function resolveWixAutomationsV2AutomationRevisionsServiceUrl(opts) {
|
|
|
58
58
|
};
|
|
59
59
|
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function resolveWixAutomationsV2AutomationRevisionsServiceUrl(opts) {
|
|
62
62
|
const domainToMappings = {
|
|
63
63
|
"manage._base_domain_": [
|
|
64
64
|
{
|
|
@@ -98,6 +98,38 @@ function resolveWixAutomationsV2AutomationsServiceUrl(opts) {
|
|
|
98
98
|
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
99
99
|
}
|
|
100
100
|
var PACKAGE_NAME = "@wix/auto_sdk_automations_automations-v-2";
|
|
101
|
+
function getAutomationRevision(payload) {
|
|
102
|
+
function __getAutomationRevision({ host }) {
|
|
103
|
+
const metadata = {
|
|
104
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
105
|
+
method: "GET",
|
|
106
|
+
methodFqn: "wix.automations.v2.AutomationRevisionsService.GetAutomationRevision",
|
|
107
|
+
packageName: PACKAGE_NAME,
|
|
108
|
+
migrationOptions: {
|
|
109
|
+
optInTransformResponse: true
|
|
110
|
+
},
|
|
111
|
+
url: resolveWixAutomationsV2AutomationRevisionsServiceUrl({
|
|
112
|
+
protoPath: "/v1/automation-revisions/{automationId}",
|
|
113
|
+
data: payload,
|
|
114
|
+
host
|
|
115
|
+
}),
|
|
116
|
+
params: toURLSearchParams(payload),
|
|
117
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
118
|
+
{
|
|
119
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
120
|
+
paths: [
|
|
121
|
+
{ path: "automation.createdDate" },
|
|
122
|
+
{ path: "automation.updatedDate" },
|
|
123
|
+
{ path: "automation.draftUpdatedDate" },
|
|
124
|
+
{ path: "automation.autoArchivePolicy.archiveDate" }
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
])
|
|
128
|
+
};
|
|
129
|
+
return metadata;
|
|
130
|
+
}
|
|
131
|
+
return __getAutomationRevision;
|
|
132
|
+
}
|
|
101
133
|
function createAutomation(payload) {
|
|
102
134
|
function __createAutomation({ host }) {
|
|
103
135
|
const serializedData = transformPaths(payload, [
|
|
@@ -735,38 +767,6 @@ function generateActionInputMappingFromTemplate(payload) {
|
|
|
735
767
|
}
|
|
736
768
|
return __generateActionInputMappingFromTemplate;
|
|
737
769
|
}
|
|
738
|
-
function getAutomationRevision(payload) {
|
|
739
|
-
function __getAutomationRevision({ host }) {
|
|
740
|
-
const metadata = {
|
|
741
|
-
entityFqdn: "wix.automations.v2.automation",
|
|
742
|
-
method: "GET",
|
|
743
|
-
methodFqn: "wix.automations.v2.AutomationRevisionsService.GetAutomationRevision",
|
|
744
|
-
packageName: PACKAGE_NAME,
|
|
745
|
-
migrationOptions: {
|
|
746
|
-
optInTransformResponse: true
|
|
747
|
-
},
|
|
748
|
-
url: resolveWixAutomationsV2AutomationRevisionsServiceUrl({
|
|
749
|
-
protoPath: "/v1/automation-revisions/{automationId}",
|
|
750
|
-
data: payload,
|
|
751
|
-
host
|
|
752
|
-
}),
|
|
753
|
-
params: toURLSearchParams(payload),
|
|
754
|
-
transformResponse: (payload2) => transformPaths(payload2, [
|
|
755
|
-
{
|
|
756
|
-
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
757
|
-
paths: [
|
|
758
|
-
{ path: "automation.createdDate" },
|
|
759
|
-
{ path: "automation.updatedDate" },
|
|
760
|
-
{ path: "automation.draftUpdatedDate" },
|
|
761
|
-
{ path: "automation.autoArchivePolicy.archiveDate" }
|
|
762
|
-
]
|
|
763
|
-
}
|
|
764
|
-
])
|
|
765
|
-
};
|
|
766
|
-
return metadata;
|
|
767
|
-
}
|
|
768
|
-
return __getAutomationRevision;
|
|
769
|
-
}
|
|
770
770
|
|
|
771
771
|
// src/automations-v2-automation-automations-v-2.universal.ts
|
|
772
772
|
import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
@@ -960,6 +960,37 @@ var AutomationErrorType = /* @__PURE__ */ ((AutomationErrorType2) => {
|
|
|
960
960
|
AutomationErrorType2["UNKNOWN_AUTOMATION_ERROR_TYPE"] = "UNKNOWN_AUTOMATION_ERROR_TYPE";
|
|
961
961
|
return AutomationErrorType2;
|
|
962
962
|
})(AutomationErrorType || {});
|
|
963
|
+
async function getAutomationRevision2(automationId, options) {
|
|
964
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
965
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
966
|
+
automationId,
|
|
967
|
+
revision: options?.revision,
|
|
968
|
+
fields: options?.fields
|
|
969
|
+
});
|
|
970
|
+
const reqOpts = getAutomationRevision(payload);
|
|
971
|
+
sideEffects?.onSiteCall?.();
|
|
972
|
+
try {
|
|
973
|
+
const result = await httpClient.request(reqOpts);
|
|
974
|
+
sideEffects?.onSuccess?.(result);
|
|
975
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
976
|
+
} catch (err) {
|
|
977
|
+
const transformedError = sdkTransformError(
|
|
978
|
+
err,
|
|
979
|
+
{
|
|
980
|
+
spreadPathsToArguments: {},
|
|
981
|
+
explicitPathsToArguments: {
|
|
982
|
+
automationId: "$[0]",
|
|
983
|
+
revision: "$[1].revision",
|
|
984
|
+
fields: "$[1].fields"
|
|
985
|
+
},
|
|
986
|
+
singleArgumentUnchanged: false
|
|
987
|
+
},
|
|
988
|
+
["automationId", "options"]
|
|
989
|
+
);
|
|
990
|
+
sideEffects?.onError?.(err);
|
|
991
|
+
throw transformedError;
|
|
992
|
+
}
|
|
993
|
+
}
|
|
963
994
|
async function createAutomation2(automation) {
|
|
964
995
|
const { httpClient, sideEffects } = arguments[1];
|
|
965
996
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
@@ -1535,39 +1566,16 @@ async function generateActionInputMappingFromTemplate2(appId, options) {
|
|
|
1535
1566
|
throw transformedError;
|
|
1536
1567
|
}
|
|
1537
1568
|
}
|
|
1538
|
-
async function getAutomationRevision2(automationId, options) {
|
|
1539
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1540
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1541
|
-
automationId,
|
|
1542
|
-
revision: options?.revision,
|
|
1543
|
-
fields: options?.fields
|
|
1544
|
-
});
|
|
1545
|
-
const reqOpts = getAutomationRevision(payload);
|
|
1546
|
-
sideEffects?.onSiteCall?.();
|
|
1547
|
-
try {
|
|
1548
|
-
const result = await httpClient.request(reqOpts);
|
|
1549
|
-
sideEffects?.onSuccess?.(result);
|
|
1550
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
1551
|
-
} catch (err) {
|
|
1552
|
-
const transformedError = sdkTransformError(
|
|
1553
|
-
err,
|
|
1554
|
-
{
|
|
1555
|
-
spreadPathsToArguments: {},
|
|
1556
|
-
explicitPathsToArguments: {
|
|
1557
|
-
automationId: "$[0]",
|
|
1558
|
-
revision: "$[1].revision",
|
|
1559
|
-
fields: "$[1].fields"
|
|
1560
|
-
},
|
|
1561
|
-
singleArgumentUnchanged: false
|
|
1562
|
-
},
|
|
1563
|
-
["automationId", "options"]
|
|
1564
|
-
);
|
|
1565
|
-
sideEffects?.onError?.(err);
|
|
1566
|
-
throw transformedError;
|
|
1567
|
-
}
|
|
1568
|
-
}
|
|
1569
1569
|
|
|
1570
1570
|
// src/automations-v2-automation-automations-v-2.public.ts
|
|
1571
|
+
function getAutomationRevision3(httpClient) {
|
|
1572
|
+
return (automationId, options) => getAutomationRevision2(
|
|
1573
|
+
automationId,
|
|
1574
|
+
options,
|
|
1575
|
+
// @ts-ignore
|
|
1576
|
+
{ httpClient }
|
|
1577
|
+
);
|
|
1578
|
+
}
|
|
1571
1579
|
function createAutomation3(httpClient) {
|
|
1572
1580
|
return (automation) => createAutomation2(
|
|
1573
1581
|
automation,
|
|
@@ -1723,14 +1731,6 @@ function generateActionInputMappingFromTemplate3(httpClient) {
|
|
|
1723
1731
|
{ httpClient }
|
|
1724
1732
|
);
|
|
1725
1733
|
}
|
|
1726
|
-
function getAutomationRevision3(httpClient) {
|
|
1727
|
-
return (automationId, options) => getAutomationRevision2(
|
|
1728
|
-
automationId,
|
|
1729
|
-
options,
|
|
1730
|
-
// @ts-ignore
|
|
1731
|
-
{ httpClient }
|
|
1732
|
-
);
|
|
1733
|
-
}
|
|
1734
1734
|
var onAutomationCreated = EventDefinition(
|
|
1735
1735
|
"wix.automations.v2.automation_created",
|
|
1736
1736
|
true,
|
|
@@ -1805,6 +1805,7 @@ function customQueryAutomations(httpClient) {
|
|
|
1805
1805
|
}
|
|
1806
1806
|
return overloadedQuery;
|
|
1807
1807
|
}
|
|
1808
|
+
var getAutomationRevision4 = /* @__PURE__ */ createRESTModule(getAutomationRevision3);
|
|
1808
1809
|
var createAutomation4 = /* @__PURE__ */ createRESTModule(createAutomation3);
|
|
1809
1810
|
var getAutomation4 = /* @__PURE__ */ createRESTModule(getAutomation3);
|
|
1810
1811
|
var updateAutomation4 = /* @__PURE__ */ createRESTModule(updateAutomation3);
|
|
@@ -1826,7 +1827,6 @@ var validateAutomationById4 = /* @__PURE__ */ createRESTModule(validateAutomatio
|
|
|
1826
1827
|
var generateActionInputMappingFromTemplate4 = /* @__PURE__ */ createRESTModule(
|
|
1827
1828
|
generateActionInputMappingFromTemplate3
|
|
1828
1829
|
);
|
|
1829
|
-
var getAutomationRevision4 = /* @__PURE__ */ createRESTModule(getAutomationRevision3);
|
|
1830
1830
|
var queryAutomations4 = /* @__PURE__ */ createRESTModule(customQueryAutomations);
|
|
1831
1831
|
var onAutomationCreated2 = createEventModule(
|
|
1832
1832
|
onAutomationCreated
|