@wix/auto_sdk_automations_automations-v-2 1.0.85 → 1.0.86
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/cjs/index.d.ts
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
|
-
import {
|
|
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, GetAutomationRevisionOptions, GetAutomationRevisionResponse, AutomationCreatedEnvelope, AutomationDeletedEnvelope, AutomationUpdatedEnvelope, AutomationQuery, QueryAutomationsOptions, typedQueryAutomations, AutomationsQueryBuilder } from './index.typings.js';
|
|
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.js';
|
|
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
|
-
}
|
|
13
5
|
declare function createAutomation$1(httpClient: HttpClient): CreateAutomationSignature;
|
|
14
6
|
interface CreateAutomationSignature {
|
|
15
7
|
/**
|
|
@@ -189,6 +181,14 @@ interface GenerateActionInputMappingFromTemplateSignature {
|
|
|
189
181
|
*/
|
|
190
182
|
(appId: string, options: NonNullablePaths<GenerateActionInputMappingFromTemplateOptions, `actionInputMappingTemplate` | `actionKey`, 2>): Promise<GenerateActionInputMappingFromTemplateResponse>;
|
|
191
183
|
}
|
|
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,7 +197,6 @@ 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>;
|
|
201
200
|
declare const createAutomation: MaybeContext<BuildRESTFunction<typeof createAutomation$1> & typeof createAutomation$1>;
|
|
202
201
|
declare const getAutomation: MaybeContext<BuildRESTFunction<typeof getAutomation$1> & typeof getAutomation$1>;
|
|
203
202
|
declare const updateAutomation: MaybeContext<BuildRESTFunction<typeof updateAutomation$1> & typeof updateAutomation$1>;
|
|
@@ -217,6 +216,7 @@ declare const publishDraftAutomation: MaybeContext<BuildRESTFunction<typeof publ
|
|
|
217
216
|
declare const validateAutomation: MaybeContext<BuildRESTFunction<typeof validateAutomation$1> & typeof validateAutomation$1>;
|
|
218
217
|
declare const validateAutomationById: MaybeContext<BuildRESTFunction<typeof validateAutomationById$1> & typeof validateAutomationById$1>;
|
|
219
218
|
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/cjs/index.js
CHANGED
|
@@ -88,7 +88,7 @@ var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
|
88
88
|
var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
|
|
89
89
|
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
90
90
|
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
91
|
-
function
|
|
91
|
+
function resolveWixAutomationsV2AutomationRevisionsServiceUrl(opts) {
|
|
92
92
|
const domainToMappings = {
|
|
93
93
|
"manage._base_domain_": [
|
|
94
94
|
{
|
|
@@ -127,7 +127,7 @@ function resolveWixAutomationsV2AutomationsServiceUrl(opts) {
|
|
|
127
127
|
};
|
|
128
128
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function resolveWixAutomationsV2AutomationsServiceUrl(opts) {
|
|
131
131
|
const domainToMappings = {
|
|
132
132
|
"manage._base_domain_": [
|
|
133
133
|
{
|
|
@@ -167,38 +167,6 @@ function resolveWixAutomationsV2AutomationRevisionsServiceUrl(opts) {
|
|
|
167
167
|
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
168
168
|
}
|
|
169
169
|
var PACKAGE_NAME = "@wix/auto_sdk_automations_automations-v-2";
|
|
170
|
-
function getAutomationRevision(payload) {
|
|
171
|
-
function __getAutomationRevision({ host }) {
|
|
172
|
-
const metadata = {
|
|
173
|
-
entityFqdn: "wix.automations.v2.automation",
|
|
174
|
-
method: "GET",
|
|
175
|
-
methodFqn: "wix.automations.v2.AutomationRevisionsService.GetAutomationRevision",
|
|
176
|
-
packageName: PACKAGE_NAME,
|
|
177
|
-
migrationOptions: {
|
|
178
|
-
optInTransformResponse: true
|
|
179
|
-
},
|
|
180
|
-
url: resolveWixAutomationsV2AutomationRevisionsServiceUrl({
|
|
181
|
-
protoPath: "/v1/automation-revisions/{automationId}",
|
|
182
|
-
data: payload,
|
|
183
|
-
host
|
|
184
|
-
}),
|
|
185
|
-
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
186
|
-
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
187
|
-
{
|
|
188
|
-
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
189
|
-
paths: [
|
|
190
|
-
{ path: "automation.createdDate" },
|
|
191
|
-
{ path: "automation.updatedDate" },
|
|
192
|
-
{ path: "automation.draftUpdatedDate" },
|
|
193
|
-
{ path: "automation.autoArchivePolicy.archiveDate" }
|
|
194
|
-
]
|
|
195
|
-
}
|
|
196
|
-
])
|
|
197
|
-
};
|
|
198
|
-
return metadata;
|
|
199
|
-
}
|
|
200
|
-
return __getAutomationRevision;
|
|
201
|
-
}
|
|
202
170
|
function createAutomation(payload) {
|
|
203
171
|
function __createAutomation({ host }) {
|
|
204
172
|
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
@@ -836,6 +804,38 @@ function generateActionInputMappingFromTemplate(payload) {
|
|
|
836
804
|
}
|
|
837
805
|
return __generateActionInputMappingFromTemplate;
|
|
838
806
|
}
|
|
807
|
+
function getAutomationRevision(payload) {
|
|
808
|
+
function __getAutomationRevision({ host }) {
|
|
809
|
+
const metadata = {
|
|
810
|
+
entityFqdn: "wix.automations.v2.automation",
|
|
811
|
+
method: "GET",
|
|
812
|
+
methodFqn: "wix.automations.v2.AutomationRevisionsService.GetAutomationRevision",
|
|
813
|
+
packageName: PACKAGE_NAME,
|
|
814
|
+
migrationOptions: {
|
|
815
|
+
optInTransformResponse: true
|
|
816
|
+
},
|
|
817
|
+
url: resolveWixAutomationsV2AutomationRevisionsServiceUrl({
|
|
818
|
+
protoPath: "/v1/automation-revisions/{automationId}",
|
|
819
|
+
data: payload,
|
|
820
|
+
host
|
|
821
|
+
}),
|
|
822
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
823
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
824
|
+
{
|
|
825
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
826
|
+
paths: [
|
|
827
|
+
{ path: "automation.createdDate" },
|
|
828
|
+
{ path: "automation.updatedDate" },
|
|
829
|
+
{ path: "automation.draftUpdatedDate" },
|
|
830
|
+
{ path: "automation.autoArchivePolicy.archiveDate" }
|
|
831
|
+
]
|
|
832
|
+
}
|
|
833
|
+
])
|
|
834
|
+
};
|
|
835
|
+
return metadata;
|
|
836
|
+
}
|
|
837
|
+
return __getAutomationRevision;
|
|
838
|
+
}
|
|
839
839
|
|
|
840
840
|
// src/automations-v2-automation-automations-v-2.universal.ts
|
|
841
841
|
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
@@ -1030,37 +1030,6 @@ var AutomationErrorType = /* @__PURE__ */ ((AutomationErrorType2) => {
|
|
|
1030
1030
|
AutomationErrorType2["UNKNOWN_AUTOMATION_ERROR_TYPE"] = "UNKNOWN_AUTOMATION_ERROR_TYPE";
|
|
1031
1031
|
return AutomationErrorType2;
|
|
1032
1032
|
})(AutomationErrorType || {});
|
|
1033
|
-
async function getAutomationRevision2(automationId, options) {
|
|
1034
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1035
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1036
|
-
automationId,
|
|
1037
|
-
revision: options?.revision,
|
|
1038
|
-
fields: options?.fields
|
|
1039
|
-
});
|
|
1040
|
-
const reqOpts = getAutomationRevision(payload);
|
|
1041
|
-
sideEffects?.onSiteCall?.();
|
|
1042
|
-
try {
|
|
1043
|
-
const result = await httpClient.request(reqOpts);
|
|
1044
|
-
sideEffects?.onSuccess?.(result);
|
|
1045
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
1046
|
-
} catch (err) {
|
|
1047
|
-
const transformedError = (0, import_transform_error.transformError)(
|
|
1048
|
-
err,
|
|
1049
|
-
{
|
|
1050
|
-
spreadPathsToArguments: {},
|
|
1051
|
-
explicitPathsToArguments: {
|
|
1052
|
-
automationId: "$[0]",
|
|
1053
|
-
revision: "$[1].revision",
|
|
1054
|
-
fields: "$[1].fields"
|
|
1055
|
-
},
|
|
1056
|
-
singleArgumentUnchanged: false
|
|
1057
|
-
},
|
|
1058
|
-
["automationId", "options"]
|
|
1059
|
-
);
|
|
1060
|
-
sideEffects?.onError?.(err);
|
|
1061
|
-
throw transformedError;
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
1064
1033
|
async function createAutomation2(automation) {
|
|
1065
1034
|
const { httpClient, sideEffects } = arguments[1];
|
|
1066
1035
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -1636,16 +1605,39 @@ async function generateActionInputMappingFromTemplate2(appId, options) {
|
|
|
1636
1605
|
throw transformedError;
|
|
1637
1606
|
}
|
|
1638
1607
|
}
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
return (automationId, options) => getAutomationRevision2(
|
|
1608
|
+
async function getAutomationRevision2(automationId, options) {
|
|
1609
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1610
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1643
1611
|
automationId,
|
|
1644
|
-
options,
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
);
|
|
1612
|
+
revision: options?.revision,
|
|
1613
|
+
fields: options?.fields
|
|
1614
|
+
});
|
|
1615
|
+
const reqOpts = getAutomationRevision(payload);
|
|
1616
|
+
sideEffects?.onSiteCall?.();
|
|
1617
|
+
try {
|
|
1618
|
+
const result = await httpClient.request(reqOpts);
|
|
1619
|
+
sideEffects?.onSuccess?.(result);
|
|
1620
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
1621
|
+
} catch (err) {
|
|
1622
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
1623
|
+
err,
|
|
1624
|
+
{
|
|
1625
|
+
spreadPathsToArguments: {},
|
|
1626
|
+
explicitPathsToArguments: {
|
|
1627
|
+
automationId: "$[0]",
|
|
1628
|
+
revision: "$[1].revision",
|
|
1629
|
+
fields: "$[1].fields"
|
|
1630
|
+
},
|
|
1631
|
+
singleArgumentUnchanged: false
|
|
1632
|
+
},
|
|
1633
|
+
["automationId", "options"]
|
|
1634
|
+
);
|
|
1635
|
+
sideEffects?.onError?.(err);
|
|
1636
|
+
throw transformedError;
|
|
1637
|
+
}
|
|
1648
1638
|
}
|
|
1639
|
+
|
|
1640
|
+
// src/automations-v2-automation-automations-v-2.public.ts
|
|
1649
1641
|
function createAutomation3(httpClient) {
|
|
1650
1642
|
return (automation) => createAutomation2(
|
|
1651
1643
|
automation,
|
|
@@ -1801,6 +1793,14 @@ function generateActionInputMappingFromTemplate3(httpClient) {
|
|
|
1801
1793
|
{ httpClient }
|
|
1802
1794
|
);
|
|
1803
1795
|
}
|
|
1796
|
+
function getAutomationRevision3(httpClient) {
|
|
1797
|
+
return (automationId, options) => getAutomationRevision2(
|
|
1798
|
+
automationId,
|
|
1799
|
+
options,
|
|
1800
|
+
// @ts-ignore
|
|
1801
|
+
{ httpClient }
|
|
1802
|
+
);
|
|
1803
|
+
}
|
|
1804
1804
|
var onAutomationCreated = (0, import_sdk_types.EventDefinition)(
|
|
1805
1805
|
"wix.automations.v2.automation_created",
|
|
1806
1806
|
true,
|
|
@@ -1875,7 +1875,6 @@ function customQueryAutomations(httpClient) {
|
|
|
1875
1875
|
}
|
|
1876
1876
|
return overloadedQuery;
|
|
1877
1877
|
}
|
|
1878
|
-
var getAutomationRevision4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getAutomationRevision3);
|
|
1879
1878
|
var createAutomation4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createAutomation3);
|
|
1880
1879
|
var getAutomation4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getAutomation3);
|
|
1881
1880
|
var updateAutomation4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateAutomation3);
|
|
@@ -1897,6 +1896,7 @@ var validateAutomationById4 = /* @__PURE__ */ (0, import_rest_modules3.createRES
|
|
|
1897
1896
|
var generateActionInputMappingFromTemplate4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(
|
|
1898
1897
|
generateActionInputMappingFromTemplate3
|
|
1899
1898
|
);
|
|
1899
|
+
var getAutomationRevision4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getAutomationRevision3);
|
|
1900
1900
|
var queryAutomations4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryAutomations);
|
|
1901
1901
|
var onAutomationCreated2 = (0, import_event_definition_modules.createEventModule)(
|
|
1902
1902
|
onAutomationCreated
|