@wix/auto_sdk_automations_action-catalog 1.0.31 → 1.0.33

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 +11 -3
  2. package/build/cjs/index.js +87 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +61 -5
  5. package/build/cjs/index.typings.js +78 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +33 -6
  8. package/build/cjs/meta.js +58 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +11 -3
  11. package/build/es/index.mjs +86 -0
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +61 -5
  14. package/build/es/index.typings.mjs +77 -0
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +33 -6
  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 +11 -3
  20. package/build/internal/cjs/index.js +87 -0
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +61 -5
  23. package/build/internal/cjs/index.typings.js +78 -0
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +33 -6
  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 +11 -3
  29. package/build/internal/es/index.mjs +86 -0
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +61 -5
  32. package/build/internal/es/index.typings.mjs +77 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +33 -6
  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
@@ -334,6 +334,29 @@ interface GetRuntimeActionResponse {
334
334
  /** Action Configuration */
335
335
  action?: Action;
336
336
  }
337
+ interface GetLatestActionRequest {
338
+ /**
339
+ * ID of the app that defines the action.
340
+ * @format GUID
341
+ */
342
+ appId: string;
343
+ /**
344
+ * Action key.
345
+ * @minLength 5
346
+ * @maxLength 50
347
+ */
348
+ actionKey: string;
349
+ /**
350
+ * Whether to apply translations to the action.
351
+ *
352
+ * Default: `false`
353
+ */
354
+ translate?: boolean | null;
355
+ }
356
+ interface GetLatestActionResponse {
357
+ /** The requested action. */
358
+ action?: Action;
359
+ }
337
360
  interface GetActionDynamicInputSchemaRequest {
338
361
  /**
339
362
  * The App ID of the action's owner.
@@ -881,19 +904,19 @@ declare enum WebhookIdentityType {
881
904
  }
882
905
  /** @enumType */
883
906
  type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
884
- interface AccountDetails {
907
+ interface AccountInfo {
885
908
  /**
886
- * ID of the account.
909
+ * ID of the Wix account associated with the event.
887
910
  * @format GUID
888
911
  */
889
912
  accountId?: string | null;
890
913
  /**
891
- * ID of the parent account.
914
+ * ID of the parent Wix account. Only included when accountId belongs to a child account.
892
915
  * @format GUID
893
916
  */
894
917
  parentAccountId?: string | null;
895
918
  /**
896
- * ID of the site, if applicable.
919
+ * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
897
920
  * @format GUID
898
921
  */
899
922
  siteId?: string | null;
@@ -1060,6 +1083,39 @@ interface GetRuntimeActionIdentifiers {
1060
1083
  /** Action key */
1061
1084
  actionKey: string;
1062
1085
  }
1086
+ /**
1087
+ * Retrieves the latest version of an action by its app ID and action key.
1088
+ * @public
1089
+ * @documentationMaturity preview
1090
+ * @requiredField identifiers
1091
+ * @requiredField identifiers.actionKey
1092
+ * @requiredField identifiers.appId
1093
+ * @permissionId AUTOMATIONS.ACTION_READ
1094
+ * @applicableIdentity APP
1095
+ * @fqn wix.automations.actioncatalog.v1.ActionCatalogService.GetLatestAction
1096
+ */
1097
+ declare function getLatestAction(identifiers: NonNullablePaths<GetLatestActionIdentifiers, `actionKey` | `appId`, 2>, options?: GetLatestActionOptions): Promise<NonNullablePaths<GetLatestActionResponse, `action.appId` | `action.actionKey` | `action.implementedMethods.validateConfiguration` | `action.implementedMethods.duplicateInputMapping` | `action.implementedMethods.generateApplicationAutomationInputMapping` | `action.implementedMethods.getQuotaInfo` | `action.implementedMethods.onBeforeSave` | `action.implementedMethods.onReset` | `action.implementedMethods.generateActionInputMappingFromTemplate` | `action.implementedMethods.onRemove` | `action.implementedMethods.getDynamicInputSchema` | `action.implementedMethods.mergeInputMappings` | `action.implementedMethods.getDynamicOutputSchema` | `action.implementedMethods.generateInputMappingFromIntent` | `action.executionType` | `action.interfaceConfiguration.type`, 4>>;
1098
+ interface GetLatestActionIdentifiers {
1099
+ /**
1100
+ * ID of the app that defines the action.
1101
+ * @format GUID
1102
+ */
1103
+ appId: string;
1104
+ /**
1105
+ * Action key.
1106
+ * @minLength 5
1107
+ * @maxLength 50
1108
+ */
1109
+ actionKey: string;
1110
+ }
1111
+ interface GetLatestActionOptions {
1112
+ /**
1113
+ * Whether to apply translations to the action.
1114
+ *
1115
+ * Default: `false`
1116
+ */
1117
+ translate?: boolean | null;
1118
+ }
1063
1119
  /**
1064
1120
  * Returns action dynamic schema and ui schema for the given action key and input mapping (action config)
1065
1121
  * @param appId - The App ID of the action's owner.
@@ -1173,4 +1229,4 @@ interface GetActionDynamicOutputSchemaOptions {
1173
1229
  */
1174
1230
  declare function bulkGetActionDynamicOutputSchemas(actionsInputMappings: ActionInputMappings[]): Promise<NonNullablePaths<BulkGetActionDynamicOutputSchemasResponse, `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`, 6>>;
1175
1231
 
1176
- export { type AccountDetails, type Action, type ActionEvent, type ActionInputMappings, type ActionSpecInfo, type AdditionalInformationRequiredInfo, type ApplicationError, type BulkActionMetadata, type BulkActionOutputSchemaResult, type BulkGetActionDynamicOutputSchemasRequest, type BulkGetActionDynamicOutputSchemasResponse, type CommonCursorPaging, type CommonCursors, type CommonPaging, type CommonPagingMetadataV2, type CommonQueryV2, type CommonQueryV2PagingMethodOneOf, CommonSortOrder, type CommonSortOrderWithLiterals, type CommonSorting, type CopyInputMappingOptions, type CopyInputMappingRequest, type CopyInputMappingResponse, type CreateActionOptions, type CreateActionRequest, type CreateActionResponse, type CursorPaging, type Cursors, type DeleteActionOptions, type DeleteActionRequest, type DeleteActionResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, ExecutionType, type ExecutionTypeWithLiterals, ExperimentActionType, type ExperimentActionTypeWithLiterals, type FocalPoint, type GenerateInputMappingFromIntentRequest, type GenerateInputMappingFromIntentResponse, type GenerateInputMappingFromIntentResponseStatusInfoOneOf, type GenericOptions, type GetActionDynamicInputSchemaOptions, type GetActionDynamicInputSchemaRequest, type GetActionDynamicInputSchemaResponse, type GetActionDynamicOutputSchemaOptions, type GetActionDynamicOutputSchemaRequest, type GetActionDynamicOutputSchemaResponse, type GetRuntimeActionIdentifiers, type GetRuntimeActionRequest, type GetRuntimeActionResponse, type IdentificationData, type IdentificationDataIdOneOf, type ImplementedMethods, type InputMappingGeneratedInfo, type IntegrationOptions, IntegrationType, type IntegrationTypeWithLiterals, type InterfaceConfiguration, type InterfaceConfigurationOptionsOneOf, type ItemMetadata, type MessageEnvelope, type Metadata, type MigrateComponentToActionRequest, type MigrateComponentToActionResponse, type Paging, type PagingMetadataV2, type QueryActionsRequest, type QueryActionsResponse, type QueryV2, type QueryV2PagingMethodOneOf, type ResolveActionsOptions, type ResolveActionsRequest, type ResolveActionsResponse, type RestoreInfo, type RetryExperimentCreation, SortOrder, type SortOrderWithLiterals, type Sorting, type Source, type SourceOptionsOneOf, SourceType, type SourceTypeWithLiterals, Status, type StatusWithLiterals, Type, type TypeWithLiterals, type UpdateActionOptions, type UpdateActionRequest, type UpdateActionResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, type WidgetComponentOptions, type WixApiOptions, bulkGetActionDynamicOutputSchemas, copyInputMapping, createAction, deleteAction, getActionDynamicInputSchema, getActionDynamicOutputSchema, getRuntimeAction, resolveActions, updateAction };
1232
+ export { type AccountInfo, type Action, type ActionEvent, type ActionInputMappings, type ActionSpecInfo, type AdditionalInformationRequiredInfo, type ApplicationError, type BulkActionMetadata, type BulkActionOutputSchemaResult, type BulkGetActionDynamicOutputSchemasRequest, type BulkGetActionDynamicOutputSchemasResponse, type CommonCursorPaging, type CommonCursors, type CommonPaging, type CommonPagingMetadataV2, type CommonQueryV2, type CommonQueryV2PagingMethodOneOf, CommonSortOrder, type CommonSortOrderWithLiterals, type CommonSorting, type CopyInputMappingOptions, type CopyInputMappingRequest, type CopyInputMappingResponse, type CreateActionOptions, type CreateActionRequest, type CreateActionResponse, type CursorPaging, type Cursors, type DeleteActionOptions, type DeleteActionRequest, type DeleteActionResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, ExecutionType, type ExecutionTypeWithLiterals, ExperimentActionType, type ExperimentActionTypeWithLiterals, type FocalPoint, type GenerateInputMappingFromIntentRequest, type GenerateInputMappingFromIntentResponse, type GenerateInputMappingFromIntentResponseStatusInfoOneOf, type GenericOptions, type GetActionDynamicInputSchemaOptions, type GetActionDynamicInputSchemaRequest, type GetActionDynamicInputSchemaResponse, type GetActionDynamicOutputSchemaOptions, type GetActionDynamicOutputSchemaRequest, type GetActionDynamicOutputSchemaResponse, type GetLatestActionIdentifiers, type GetLatestActionOptions, type GetLatestActionRequest, type GetLatestActionResponse, type GetRuntimeActionIdentifiers, type GetRuntimeActionRequest, type GetRuntimeActionResponse, type IdentificationData, type IdentificationDataIdOneOf, type ImplementedMethods, type InputMappingGeneratedInfo, type IntegrationOptions, IntegrationType, type IntegrationTypeWithLiterals, type InterfaceConfiguration, type InterfaceConfigurationOptionsOneOf, type ItemMetadata, type MessageEnvelope, type Metadata, type MigrateComponentToActionRequest, type MigrateComponentToActionResponse, type Paging, type PagingMetadataV2, type QueryActionsRequest, type QueryActionsResponse, type QueryV2, type QueryV2PagingMethodOneOf, type ResolveActionsOptions, type ResolveActionsRequest, type ResolveActionsResponse, type RestoreInfo, type RetryExperimentCreation, SortOrder, type SortOrderWithLiterals, type Sorting, type Source, type SourceOptionsOneOf, SourceType, type SourceTypeWithLiterals, Status, type StatusWithLiterals, Type, type TypeWithLiterals, type UpdateActionOptions, type UpdateActionRequest, type UpdateActionResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, type WidgetComponentOptions, type WixApiOptions, bulkGetActionDynamicOutputSchemas, copyInputMapping, createAction, deleteAction, getActionDynamicInputSchema, getActionDynamicOutputSchema, getLatestAction, getRuntimeAction, resolveActions, updateAction };
@@ -35,6 +35,7 @@ __export(index_typings_exports, {
35
35
  deleteAction: () => deleteAction2,
36
36
  getActionDynamicInputSchema: () => getActionDynamicInputSchema2,
37
37
  getActionDynamicOutputSchema: () => getActionDynamicOutputSchema2,
38
+ getLatestAction: () => getLatestAction2,
38
39
  getRuntimeAction: () => getRuntimeAction2,
39
40
  resolveActions: () => resolveActions2,
40
41
  updateAction: () => updateAction2
@@ -286,6 +287,44 @@ function getRuntimeAction(payload) {
286
287
  }
287
288
  return __getRuntimeAction;
288
289
  }
290
+ function getLatestAction(payload) {
291
+ function __getLatestAction({ host }) {
292
+ const metadata = {
293
+ entityFqdn: "wix.automations.actioncatalog.v1.action",
294
+ method: "GET",
295
+ methodFqn: "wix.automations.actioncatalog.v1.ActionCatalogService.GetLatestAction",
296
+ packageName: PACKAGE_NAME,
297
+ migrationOptions: {
298
+ optInTransformResponse: true
299
+ },
300
+ url: resolveWixAutomationsActioncatalogV1ActionCatalogServiceUrl({
301
+ protoPath: "/v1/actions/latest/apps/{appId}/keys/{actionKey}",
302
+ data: payload,
303
+ host
304
+ }),
305
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
306
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
307
+ {
308
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
309
+ paths: [
310
+ { path: "action.createdDate" },
311
+ { path: "action.updatedDate" },
312
+ { path: "action.icon.urlExpirationDate" }
313
+ ]
314
+ },
315
+ {
316
+ transformFn: import_float2.transformRESTFloatToSDKFloat,
317
+ paths: [
318
+ { path: "action.icon.focalPoint.x" },
319
+ { path: "action.icon.focalPoint.y" }
320
+ ]
321
+ }
322
+ ])
323
+ };
324
+ return metadata;
325
+ }
326
+ return __getLatestAction;
327
+ }
289
328
  function getActionDynamicInputSchema(payload) {
290
329
  function __getActionDynamicInputSchema({ host }) {
291
330
  const metadata = {
@@ -621,6 +660,44 @@ async function getRuntimeAction2(identifiers) {
621
660
  throw transformedError;
622
661
  }
623
662
  }
663
+ async function getLatestAction2(identifiers, options) {
664
+ const { httpClient, sideEffects } = arguments[2];
665
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
666
+ appId: identifiers?.appId,
667
+ actionKey: identifiers?.actionKey,
668
+ translate: options?.translate
669
+ });
670
+ const reqOpts = getLatestAction(payload);
671
+ sideEffects?.onSiteCall?.();
672
+ try {
673
+ const result = await httpClient.request(reqOpts);
674
+ sideEffects?.onSuccess?.(result);
675
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
676
+ (0, import_transform_paths2.transformPaths)(result.data, [
677
+ {
678
+ transformFn: import_image2.transformRESTImageToSDKImage,
679
+ paths: [{ path: "action.icon" }]
680
+ }
681
+ ])
682
+ );
683
+ } catch (err) {
684
+ const transformedError = (0, import_transform_error.transformError)(
685
+ err,
686
+ {
687
+ spreadPathsToArguments: {},
688
+ explicitPathsToArguments: {
689
+ appId: "$[0].appId",
690
+ actionKey: "$[0].actionKey",
691
+ translate: "$[1].translate"
692
+ },
693
+ singleArgumentUnchanged: false
694
+ },
695
+ ["identifiers", "options"]
696
+ );
697
+ sideEffects?.onError?.(err);
698
+ throw transformedError;
699
+ }
700
+ }
624
701
  async function getActionDynamicInputSchema2(appId, options) {
625
702
  const { httpClient, sideEffects } = arguments[2];
626
703
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -794,6 +871,7 @@ async function bulkGetActionDynamicOutputSchemas2(actionsInputMappings) {
794
871
  deleteAction,
795
872
  getActionDynamicInputSchema,
796
873
  getActionDynamicOutputSchema,
874
+ getLatestAction,
797
875
  getRuntimeAction,
798
876
  resolveActions,
799
877
  updateAction