@wix/auto_sdk_automations_automation-templates 1.0.0 → 1.0.1

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.
Files changed (37) hide show
  1. package/build/cjs/index.d.ts +17 -1
  2. package/build/cjs/index.js +78 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +1 -1
  5. package/build/cjs/index.typings.js +69 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +21 -2
  8. package/build/cjs/meta.js +58 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +17 -1
  11. package/build/es/index.mjs +77 -0
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +1 -1
  14. package/build/es/index.typings.mjs +68 -0
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +21 -2
  17. package/build/es/meta.mjs +57 -0
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +15 -3
  20. package/build/internal/cjs/index.js +78 -0
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +28 -1
  23. package/build/internal/cjs/index.typings.js +69 -0
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +21 -2
  26. package/build/internal/cjs/meta.js +58 -0
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +15 -3
  29. package/build/internal/es/index.mjs +77 -0
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +28 -1
  32. package/build/internal/es/index.typings.mjs +68 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +21 -2
  35. package/build/internal/es/meta.mjs +57 -0
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -937,6 +937,22 @@ interface UpdateDraftAutomationTemplateResponse {
937
937
  /** Updated draft AutomationTemplate. */
938
938
  automationTemplate?: AutomationTemplate;
939
939
  }
940
+ interface PublishDraftAutomationTemplateRequest {
941
+ /**
942
+ * ID of the draft AutomationTemplate to publish.
943
+ * @format GUID
944
+ */
945
+ automationTemplateId: string;
946
+ /**
947
+ * ID of the app to which the automation template belongs.
948
+ * @format GUID
949
+ */
950
+ appId: string;
951
+ }
952
+ interface PublishDraftAutomationTemplateResponse {
953
+ /** Published AutomationTemplate. */
954
+ automationTemplate?: AutomationTemplate;
955
+ }
940
956
  interface DeleteAutomationTemplateRequest {
941
957
  /**
942
958
  * App id of the AutomationTemplate to delete.
@@ -1488,4 +1504,4 @@ interface GenerateTemplateFromAutomationOptions {
1488
1504
  appId: string;
1489
1505
  }
1490
1506
 
1491
- export { type AIMetadata, type AccountInfo, type Action, type ActionEvent, type ActionInfoOneOf, type ActionSettings, type AppDefinedAction, type ApplicationOrigin, type AuditInfo, type AuditInfoIdOneOf, type AutoArchivePolicy, type Automation, type AutomationConfiguration, type AutomationOriginInfoOneOf, type AutomationSettings, type AutomationTemplate, type AutomationTemplateDeletedWithEntity, type AutomationTemplateSpecInfo, Category, type CategoryInfo, type CategoryWithLiterals, type CodeConditionAction, type CodeSnippet, type CommonCursorPaging, type CommonCursorPagingMetadata, type CommonCursors, CommonSortOrder, type CommonSortOrderWithLiterals, type CommonSorting, type ConditionAction, type ConditionExpressionGroup, type CreateAutomationTemplateOptions, type CreateAutomationTemplateRequest, type CreateAutomationTemplateResponse, type CreateDraftAutomationTemplateOptions, type CreateDraftAutomationTemplateRequest, type CreateDraftAutomationTemplateResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DelayAction, type DeleteAutomationTemplateRequest, type DeleteAutomationTemplateResponse, type Dimensions, Domain, type DomainEvent, type DomainEventBodyOneOf, type DomainWithLiterals, type DraftInfo, type Enrichment, type Enrichments, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type ExtendedFields, type Filter, type FilterValueSelection, type FilterableAppDefinedActions, type FutureDateActivationOffset, type GenerateTemplateFromAutomationOptions, type GenerateTemplateFromAutomationRequest, type GenerateTemplateFromAutomationResponse, type GetAutomationTemplateRequest, type GetAutomationTemplateResponse, type IdentificationData, type IdentificationDataIdOneOf, Language, type LanguageWithLiterals, type MergeAction, type MessageEnvelope, type Note, type Notes, type Offset, Operator, type OperatorWithLiterals, Origin, type OriginWithLiterals, type OutputAction, type Paging, type Path, type Position, type PreinstalledOrigin, type QueryAutomationTemplatesForAppOptions, type QueryAutomationTemplatesForAppRequest, type QueryAutomationTemplatesForAppResponse, type QueryV2, type QueryV2PagingMethodOneOf, type RateLimit, type RateLimitAction, type ResolveAutomationTemplatesRequest, type ResolveAutomationTemplatesResponse, type RestoreInfo, type SegmentInfo, type SetVariablesAction, SortOrder, type SortOrderWithLiterals, type Sorting, type SplitAction, Status, type StatusWithLiterals, type TemplateOrigin, TimeUnit, type TimeUnitWithLiterals, type Trigger, type TriggerSettings, Type, type TypeWithLiterals, type UpdateAutomationTemplate, type UpdateAutomationTemplateOptions, type UpdateAutomationTemplateRequest, type UpdateAutomationTemplateResponse, type UpdateDraftAutomationTemplate, type UpdateDraftAutomationTemplateOptions, type UpdateDraftAutomationTemplateRequest, type UpdateDraftAutomationTemplateResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals };
1507
+ export { type AIMetadata, type AccountInfo, type Action, type ActionEvent, type ActionInfoOneOf, type ActionSettings, type AppDefinedAction, type ApplicationOrigin, type AuditInfo, type AuditInfoIdOneOf, type AutoArchivePolicy, type Automation, type AutomationConfiguration, type AutomationOriginInfoOneOf, type AutomationSettings, type AutomationTemplate, type AutomationTemplateDeletedWithEntity, type AutomationTemplateSpecInfo, Category, type CategoryInfo, type CategoryWithLiterals, type CodeConditionAction, type CodeSnippet, type CommonCursorPaging, type CommonCursorPagingMetadata, type CommonCursors, CommonSortOrder, type CommonSortOrderWithLiterals, type CommonSorting, type ConditionAction, type ConditionExpressionGroup, type CreateAutomationTemplateOptions, type CreateAutomationTemplateRequest, type CreateAutomationTemplateResponse, type CreateDraftAutomationTemplateOptions, type CreateDraftAutomationTemplateRequest, type CreateDraftAutomationTemplateResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DelayAction, type DeleteAutomationTemplateRequest, type DeleteAutomationTemplateResponse, type Dimensions, Domain, type DomainEvent, type DomainEventBodyOneOf, type DomainWithLiterals, type DraftInfo, type Enrichment, type Enrichments, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type ExtendedFields, type Filter, type FilterValueSelection, type FilterableAppDefinedActions, type FutureDateActivationOffset, type GenerateTemplateFromAutomationOptions, type GenerateTemplateFromAutomationRequest, type GenerateTemplateFromAutomationResponse, type GetAutomationTemplateRequest, type GetAutomationTemplateResponse, type IdentificationData, type IdentificationDataIdOneOf, Language, type LanguageWithLiterals, type MergeAction, type MessageEnvelope, type Note, type Notes, type Offset, Operator, type OperatorWithLiterals, Origin, type OriginWithLiterals, type OutputAction, type Paging, type Path, type Position, type PreinstalledOrigin, type PublishDraftAutomationTemplateRequest, type PublishDraftAutomationTemplateResponse, type QueryAutomationTemplatesForAppOptions, type QueryAutomationTemplatesForAppRequest, type QueryAutomationTemplatesForAppResponse, type QueryV2, type QueryV2PagingMethodOneOf, type RateLimit, type RateLimitAction, type ResolveAutomationTemplatesRequest, type ResolveAutomationTemplatesResponse, type RestoreInfo, type SegmentInfo, type SetVariablesAction, SortOrder, type SortOrderWithLiterals, type Sorting, type SplitAction, Status, type StatusWithLiterals, type TemplateOrigin, TimeUnit, type TimeUnitWithLiterals, type Trigger, type TriggerSettings, Type, type TypeWithLiterals, type UpdateAutomationTemplate, type UpdateAutomationTemplateOptions, type UpdateAutomationTemplateRequest, type UpdateAutomationTemplateResponse, type UpdateDraftAutomationTemplate, type UpdateDraftAutomationTemplateOptions, type UpdateDraftAutomationTemplateRequest, type UpdateDraftAutomationTemplateResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals };
@@ -36,6 +36,7 @@ __export(index_exports, {
36
36
  deleteAutomationTemplate: () => deleteAutomationTemplate4,
37
37
  generateTemplateFromAutomation: () => generateTemplateFromAutomation4,
38
38
  getAutomationTemplate: () => getAutomationTemplate4,
39
+ publishDraftAutomationTemplate: () => publishDraftAutomationTemplate4,
39
40
  queryAutomationTemplatesForApp: () => queryAutomationTemplatesForApp4,
40
41
  resolveAutomationTemplates: () => resolveAutomationTemplates4,
41
42
  updateAutomationTemplate: () => updateAutomationTemplate4,
@@ -309,6 +310,42 @@ function updateDraftAutomationTemplate(payload) {
309
310
  }
310
311
  return __updateDraftAutomationTemplate;
311
312
  }
313
+ function publishDraftAutomationTemplate(payload) {
314
+ function __publishDraftAutomationTemplate({ host }) {
315
+ const metadata = {
316
+ entityFqdn: "wix.automations.templates.v1.automation_template",
317
+ method: "POST",
318
+ methodFqn: "wix.automations.templates.v1.AutomationTemplatesService.PublishDraftAutomationTemplate",
319
+ packageName: PACKAGE_NAME,
320
+ migrationOptions: {
321
+ optInTransformResponse: true
322
+ },
323
+ url: resolveWixAutomationsTemplatesV1AutomationTemplatesServiceUrl({
324
+ protoPath: "/v1/automation-templates/drafts/{automationTemplateId}/publish",
325
+ data: payload,
326
+ host
327
+ }),
328
+ data: payload,
329
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
330
+ {
331
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
332
+ paths: [
333
+ { path: "automationTemplate.createdDate" },
334
+ { path: "automationTemplate.updatedDate" },
335
+ { path: "automationTemplate.automation.createdDate" },
336
+ { path: "automationTemplate.automation.updatedDate" },
337
+ { path: "automationTemplate.automation.draftUpdatedDate" },
338
+ {
339
+ path: "automationTemplate.automation.autoArchivePolicy.archiveDate"
340
+ }
341
+ ]
342
+ }
343
+ ])
344
+ };
345
+ return metadata;
346
+ }
347
+ return __publishDraftAutomationTemplate;
348
+ }
312
349
  function deleteAutomationTemplate(payload) {
313
350
  function __deleteAutomationTemplate({ host }) {
314
351
  const metadata = {
@@ -675,6 +712,37 @@ async function updateDraftAutomationTemplate2(_id, automationTemplate, options)
675
712
  throw transformedError;
676
713
  }
677
714
  }
715
+ async function publishDraftAutomationTemplate2(automationTemplateId, appId) {
716
+ const { httpClient, sideEffects } = arguments[2];
717
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
718
+ automationTemplateId,
719
+ appId
720
+ });
721
+ const reqOpts = publishDraftAutomationTemplate(
722
+ payload
723
+ );
724
+ sideEffects?.onSiteCall?.();
725
+ try {
726
+ const result = await httpClient.request(reqOpts);
727
+ sideEffects?.onSuccess?.(result);
728
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
729
+ } catch (err) {
730
+ const transformedError = (0, import_transform_error.transformError)(
731
+ err,
732
+ {
733
+ spreadPathsToArguments: {},
734
+ explicitPathsToArguments: {
735
+ automationTemplateId: "$[0]",
736
+ appId: "$[1]"
737
+ },
738
+ singleArgumentUnchanged: false
739
+ },
740
+ ["automationTemplateId", "appId"]
741
+ );
742
+ sideEffects?.onError?.(err);
743
+ throw transformedError;
744
+ }
745
+ }
678
746
  async function deleteAutomationTemplate2(componentId, appId) {
679
747
  const { httpClient, sideEffects } = arguments[2];
680
748
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -826,6 +894,14 @@ function updateDraftAutomationTemplate3(httpClient) {
826
894
  { httpClient }
827
895
  );
828
896
  }
897
+ function publishDraftAutomationTemplate3(httpClient) {
898
+ return (automationTemplateId, appId) => publishDraftAutomationTemplate2(
899
+ automationTemplateId,
900
+ appId,
901
+ // @ts-ignore
902
+ { httpClient }
903
+ );
904
+ }
829
905
  function deleteAutomationTemplate3(httpClient) {
830
906
  return (componentId, appId) => deleteAutomationTemplate2(
831
907
  componentId,
@@ -865,6 +941,7 @@ var createDraftAutomationTemplate4 = /* @__PURE__ */ (0, import_rest_modules3.cr
865
941
  var getAutomationTemplate4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getAutomationTemplate3);
866
942
  var updateAutomationTemplate4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateAutomationTemplate3);
867
943
  var updateDraftAutomationTemplate4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateDraftAutomationTemplate3);
944
+ var publishDraftAutomationTemplate4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(publishDraftAutomationTemplate3);
868
945
  var deleteAutomationTemplate4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteAutomationTemplate3);
869
946
  var resolveAutomationTemplates4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(resolveAutomationTemplates3);
870
947
  var queryAutomationTemplatesForApp4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryAutomationTemplatesForApp3);
@@ -887,6 +964,7 @@ var generateTemplateFromAutomation4 = /* @__PURE__ */ (0, import_rest_modules3.c
887
964
  deleteAutomationTemplate,
888
965
  generateTemplateFromAutomation,
889
966
  getAutomationTemplate,
967
+ publishDraftAutomationTemplate,
890
968
  queryAutomationTemplatesForApp,
891
969
  resolveAutomationTemplates,
892
970
  updateAutomationTemplate,