@wix/auto_sdk_portfolio_project-items 1.0.16 → 1.0.18

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.
@@ -1,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  interface Item extends ItemMetadataOneOf {
2
4
  /** Information about the Wix Media image. */
3
5
  image?: Image;
@@ -70,6 +72,8 @@ declare enum ImageType {
70
72
  WIX_MEDIA = "WIX_MEDIA",
71
73
  EXTERNAL = "EXTERNAL"
72
74
  }
75
+ /** @enumType */
76
+ type ImageTypeWithLiterals = ImageType | 'UNDEFINED' | 'WIX_MEDIA' | 'EXTERNAL';
73
77
  interface Point {
74
78
  /** X-coordinate of the focal point. */
75
79
  x?: number;
@@ -377,20 +381,20 @@ interface QueryProjectItemsRequest {
377
381
  query?: QueryV2;
378
382
  }
379
383
  interface QueryV2 extends QueryV2PagingMethodOneOf {
380
- /** Paging options to limit and skip the number of items. */
384
+ /** Paging options to limit and offset the number of items. */
381
385
  paging?: Paging;
382
386
  /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
383
387
  cursorPaging?: CursorPaging;
384
388
  /**
385
389
  * Filter object.
386
390
  *
387
- * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
391
+ * Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).
388
392
  */
389
393
  filter?: Record<string, any> | null;
390
394
  /**
391
395
  * Sort object.
392
396
  *
393
- * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
397
+ * Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).
394
398
  */
395
399
  sort?: Sorting[];
396
400
  /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
@@ -400,7 +404,7 @@ interface QueryV2 extends QueryV2PagingMethodOneOf {
400
404
  }
401
405
  /** @oneof */
402
406
  interface QueryV2PagingMethodOneOf {
403
- /** Paging options to limit and skip the number of items. */
407
+ /** Paging options to limit and offset the number of items. */
404
408
  paging?: Paging;
405
409
  /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
406
410
  cursorPaging?: CursorPaging;
@@ -768,13 +772,69 @@ interface ProjectItemCreatedEnvelope {
768
772
  entity: Item;
769
773
  metadata: EventMetadata;
770
774
  }
775
+ /**
776
+ * Triggered when a project item is created.
777
+ * @permissionScope Manage Portfolio
778
+ * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
779
+ * @permissionId PORTFOLIO.PROJECT_ITEM_READ
780
+ * @webhook
781
+ * @eventType wix.portfolio.project_items.v1.project_item_created
782
+ * @slug created
783
+ * @documentationMaturity preview
784
+ */
785
+ declare function onProjectItemCreated(handler: (event: ProjectItemCreatedEnvelope) => void | Promise<void>): void;
771
786
  interface ProjectItemDeletedEnvelope {
772
787
  metadata: EventMetadata;
773
788
  }
789
+ /**
790
+ * Triggered when a project item is deleted.
791
+ * @permissionScope Manage Portfolio
792
+ * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
793
+ * @permissionId PORTFOLIO.PROJECT_ITEM_READ
794
+ * @webhook
795
+ * @eventType wix.portfolio.project_items.v1.project_item_deleted
796
+ * @slug deleted
797
+ * @documentationMaturity preview
798
+ */
799
+ declare function onProjectItemDeleted(handler: (event: ProjectItemDeletedEnvelope) => void | Promise<void>): void;
774
800
  interface ProjectItemUpdatedEnvelope {
775
801
  entity: Item;
776
802
  metadata: EventMetadata;
777
803
  }
804
+ /**
805
+ * Triggered when a project item is updated.
806
+ * @permissionScope Manage Portfolio
807
+ * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO
808
+ * @permissionId PORTFOLIO.PROJECT_ITEM_READ
809
+ * @webhook
810
+ * @eventType wix.portfolio.project_items.v1.project_item_updated
811
+ * @slug updated
812
+ * @documentationMaturity preview
813
+ */
814
+ declare function onProjectItemUpdated(handler: (event: ProjectItemUpdatedEnvelope) => void | Promise<void>): void;
815
+ type ProjectItemNonNullablePaths = `image.focalPoint.x` | `image.focalPoint.y` | `type`;
816
+ /**
817
+ * Creates a project item.
818
+ * @param item - Project item to create.
819
+ * @public
820
+ * @requiredField item
821
+ * @permissionId PORTFOLIO.PROJECT_ITEM_CREATE
822
+ * @applicableIdentity APP
823
+ * @returns Newly created project item.
824
+ * @fqn com.wixpress.portfolio.projectitems.ProjectItemsService.CreateProjectItem
825
+ */
826
+ declare function createProjectItem(item: Item): Promise<NonNullablePaths<Item, ProjectItemNonNullablePaths>>;
827
+ /**
828
+ * Creates multiple project items.
829
+ * @public
830
+ * @requiredField options.items
831
+ * @permissionId PORTFOLIO.PROJECT_ITEM_CREATE
832
+ * @applicableIdentity APP
833
+ * @fqn com.wixpress.portfolio.projectitems.ProjectItemsService.BulkCreateProjectItems
834
+ */
835
+ declare function bulkCreateProjectItems(options?: NonNullablePaths<BulkCreateProjectItemsOptions, `items`>): Promise<NonNullablePaths<BulkCreateProjectItemsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | {
836
+ [P in ProjectItemNonNullablePaths]: `results.${number}.item.${P}`;
837
+ }[ProjectItemNonNullablePaths] | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`>>;
778
838
  interface BulkCreateProjectItemsOptions {
779
839
  /**
780
840
  * Project items to create.
@@ -785,10 +845,47 @@ interface BulkCreateProjectItemsOptions {
785
845
  /** Whether to include the created project items in the response. Set to `true` to receive the project items in the response. Default: `false` */
786
846
  returnFullEntity?: boolean | null;
787
847
  }
848
+ /**
849
+ * Retrieves a project item.
850
+ * @param itemId - Project item ID.
851
+ * @public
852
+ * @requiredField itemId
853
+ * @permissionId PORTFOLIO.PROJECT_ITEM_READ
854
+ * @applicableIdentity APP
855
+ * @applicableIdentity VISITOR
856
+ * @returns Project item.
857
+ * @fqn com.wixpress.portfolio.projectitems.ProjectItemsService.GetProjectItem
858
+ */
859
+ declare function getProjectItem(itemId: string): Promise<NonNullablePaths<Item, ProjectItemNonNullablePaths>>;
860
+ /**
861
+ * Retrieves a list of all project items in the specified project.
862
+ * @param projectId - Project ID.
863
+ * @public
864
+ * @requiredField projectId
865
+ * @permissionId PORTFOLIO.PROJECT_ITEM_READ
866
+ * @applicableIdentity APP
867
+ * @applicableIdentity VISITOR
868
+ * @fqn com.wixpress.portfolio.projectitems.ProjectItemsService.ListProjectItems
869
+ */
870
+ declare function listProjectItems(projectId: string, options?: ListProjectItemsOptions): Promise<NonNullablePaths<ListProjectItemsResponse, {
871
+ [P in ProjectItemNonNullablePaths]: `items.${number}.${P}`;
872
+ }[ProjectItemNonNullablePaths]>>;
788
873
  interface ListProjectItemsOptions {
789
874
  /** Maximum number of items to return in the results. */
790
875
  paging?: Paging;
791
876
  }
877
+ /**
878
+ * Updates a project item.
879
+ * @param _id - Project item ID.
880
+ * @public
881
+ * @requiredField _id
882
+ * @requiredField item
883
+ * @permissionId PORTFOLIO.PROJECT_ITEM_UPDATE
884
+ * @applicableIdentity APP
885
+ * @returns The updated project item.
886
+ * @fqn com.wixpress.portfolio.projectitems.ProjectItemsService.UpdateProjectItem
887
+ */
888
+ declare function updateProjectItem(_id: string, item: UpdateProjectItem): Promise<NonNullablePaths<Item, ProjectItemNonNullablePaths>>;
792
889
  interface UpdateProjectItem {
793
890
  /** Information about the Wix Media image. */
794
891
  image?: Image;
@@ -833,6 +930,18 @@ interface UpdateProjectItem {
833
930
  /** Project item link. */
834
931
  link?: Link;
835
932
  }
933
+ /**
934
+ * Updates multiple project items.
935
+ * @public
936
+ * @requiredField options.items.item
937
+ * @requiredField options.items.item._id
938
+ * @permissionId PORTFOLIO.PROJECT_ITEM_UPDATE
939
+ * @applicableIdentity APP
940
+ * @fqn com.wixpress.portfolio.projectitems.ProjectItemsService.BulkUpdateProjectItems
941
+ */
942
+ declare function bulkUpdateProjectItems(options?: NonNullablePaths<BulkUpdateProjectItemsOptions, `items.${number}.item` | `items.${number}.item._id`>): Promise<NonNullablePaths<BulkUpdateProjectItemsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | {
943
+ [P in ProjectItemNonNullablePaths]: `results.${number}.item.${P}`;
944
+ }[ProjectItemNonNullablePaths] | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`>>;
836
945
  interface BulkUpdateProjectItemsOptions {
837
946
  /**
838
947
  * items to be updated.
@@ -842,6 +951,26 @@ interface BulkUpdateProjectItemsOptions {
842
951
  /** Whether to include the updated project items in the response. Set to `true` to receive the project items in the response. Default: `false` */
843
952
  returnFullEntity?: boolean | null;
844
953
  }
954
+ /**
955
+ * Deletes a project item.
956
+ * @param itemId - ID of the project item to delete.
957
+ * @public
958
+ * @requiredField itemId
959
+ * @permissionId PORTFOLIO.PROJECT_ITEM_DELETE
960
+ * @applicableIdentity APP
961
+ * @fqn com.wixpress.portfolio.projectitems.ProjectItemsService.DeleteProjectItem
962
+ */
963
+ declare function deleteProjectItem(itemId: string): Promise<NonNullablePaths<DeleteProjectItemResponse, `projectId` | `itemId`>>;
964
+ /**
965
+ * Deletes multiple project items.
966
+ * @public
967
+ * @requiredField options
968
+ * @requiredField options.itemIds
969
+ * @permissionId PORTFOLIO.PROJECT_ITEM_DELETE
970
+ * @applicableIdentity APP
971
+ * @fqn com.wixpress.portfolio.projectitems.ProjectItemsService.BulkDeleteProjectItems
972
+ */
973
+ declare function bulkDeleteProjectItems(options: NonNullablePaths<BulkDeleteProjectItemsOptions, `itemIds`>): Promise<NonNullablePaths<BulkDeleteProjectItemsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `results.${number}.itemId` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`>>;
845
974
  interface BulkDeleteProjectItemsOptions {
846
975
  /**
847
976
  * Project item IDs.
@@ -851,6 +980,24 @@ interface BulkDeleteProjectItemsOptions {
851
980
  */
852
981
  itemIds: string[];
853
982
  }
983
+ /**
984
+ * Duplicates project items from one project (the origin) to another project (the target).
985
+ *
986
+ * <blockquote class="important">
987
+ * <strong>Important:</strong>
988
+ *
989
+ * Both the origin and target projects must exist before calling this method.
990
+ * </blockquote>
991
+ * @param originProjectId - ID of the project containing the items to duplicate.
992
+ * @public
993
+ * @requiredField options
994
+ * @requiredField options.targetProjectId
995
+ * @requiredField originProjectId
996
+ * @permissionId PORTFOLIO.PROJECT_ITEM_CREATE
997
+ * @applicableIdentity APP
998
+ * @fqn com.wixpress.portfolio.projectitems.ProjectItemsService.DuplicateProjectItems
999
+ */
1000
+ declare function duplicateProjectItems(originProjectId: string, options: NonNullablePaths<DuplicateProjectItemsOptions, `targetProjectId`>): Promise<NonNullablePaths<DuplicateProjectItemsResponse, `projectId` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`>>;
854
1001
  interface DuplicateProjectItemsOptions {
855
1002
  /**
856
1003
  * ID of the project where the duplicated items will be added.
@@ -858,5 +1005,15 @@ interface DuplicateProjectItemsOptions {
858
1005
  */
859
1006
  targetProjectId: string;
860
1007
  }
1008
+ /**
1009
+ * Generate media token for project items
1010
+ * @param mediaIds - Media ids of requested project items
1011
+ * @public
1012
+ * @requiredField mediaIds
1013
+ * @permissionId PORTFOLIO.PROJECT_ITEM_CREATE
1014
+ * @applicableIdentity APP
1015
+ * @fqn com.wixpress.portfolio.portfolioapp.MediaService.GenerateTokenForProjectItems
1016
+ */
1017
+ declare function generateTokenForProjectItems(mediaIds: string[]): Promise<NonNullablePaths<GenerateTokenForProjectItemsResponse, `mediaTokens` | `mediaTokens.${number}.mediaId` | `mediaTokens.${number}.mediaToken`>>;
861
1018
 
862
- export { type CursorPaging as $, type App as A, type BulkCreateProjectItemsOptions as B, type CustomTag as C, type DeleteProjectItemResponse as D, type ItemMetadata as E, type File as F, type GenerateTokenForProjectItemsResponse as G, type ApplicationError as H, type Item as I, type BulkActionMetadata as J, type GetProjectItemRequest as K, type ListProjectItemsOptions as L, type GetProjectItemResponse as M, type ListProjectItemsRequest as N, type Paging as O, type ProjectItemCreatedEnvelope as P, type PagingMetadataV2 as Q, type Cursors as R, SortOrder as S, Type as T, type UpdateProjectItem as U, type Video as V, WebhookIdentityType as W, type QueryProjectItemsRequest as X, type QueryV2 as Y, type QueryV2PagingMethodOneOf as Z, type Sorting as _, type BulkCreateProjectItemsResponse as a, type QueryProjectItemsResponse as a0, type UpdateProjectItemRequest as a1, type UpdateProjectItemResponse as a2, type BulkUpdateProjectItemsRequest as a3, type MaskedItem as a4, type BulkUpdateProjectItemResult as a5, type DeleteProjectItemRequest as a6, type BulkDeleteProjectItemsRequest as a7, type BulkDeleteProjectItemResult as a8, type CreateProjectGalleryRequest as a9, type CreateProjectGalleryResponse as aa, type DomainEvent as ab, type DomainEventBodyOneOf as ac, type EntityCreatedEvent as ad, type RestoreInfo as ae, type EntityUpdatedEvent as af, type EntityDeletedEvent as ag, type ActionEvent as ah, type Empty as ai, type DeletedProjectRestored as aj, type DuplicateProjectItemsRequest as ak, type MessageEnvelope as al, type IdentificationData as am, type IdentificationDataIdOneOf as an, type GenerateTokenForProjectItemsRequest as ao, type ProjectItemMediaToken as ap, type BaseEventMetadata as aq, type EventMetadata as ar, type ListProjectItemsResponse as b, type BulkUpdateProjectItemsOptions as c, type BulkUpdateProjectItemsResponse as d, type BulkDeleteProjectItemsOptions as e, type BulkDeleteProjectItemsResponse as f, type DuplicateProjectItemsOptions as g, type DuplicateProjectItemsResponse as h, type ProjectItemDeletedEnvelope as i, type ProjectItemUpdatedEnvelope as j, ImageType as k, type ItemMetadataOneOf as l, type Image as m, type Point as n, type UnsharpMasking as o, type VideoResolution as p, type Tags as q, type Link as r, type InvalidateCache as s, type InvalidateCacheGetByOneOf as t, type Page as u, type URI as v, type CreateProjectItemRequest as w, type CreateProjectItemResponse as x, type BulkCreateProjectItemsRequest as y, type BulkCreateProjectItemResult as z };
1019
+ export { type ActionEvent, type App, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkCreateProjectItemResult, type BulkCreateProjectItemsOptions, type BulkCreateProjectItemsRequest, type BulkCreateProjectItemsResponse, type BulkDeleteProjectItemResult, type BulkDeleteProjectItemsOptions, type BulkDeleteProjectItemsRequest, type BulkDeleteProjectItemsResponse, type BulkUpdateProjectItemResult, type BulkUpdateProjectItemsOptions, type BulkUpdateProjectItemsRequest, type BulkUpdateProjectItemsResponse, type CreateProjectGalleryRequest, type CreateProjectGalleryResponse, type CreateProjectItemRequest, type CreateProjectItemResponse, type CursorPaging, type Cursors, type CustomTag, type DeleteProjectItemRequest, type DeleteProjectItemResponse, type DeletedProjectRestored, type DomainEvent, type DomainEventBodyOneOf, type DuplicateProjectItemsOptions, type DuplicateProjectItemsRequest, type DuplicateProjectItemsResponse, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type File, type GenerateTokenForProjectItemsRequest, type GenerateTokenForProjectItemsResponse, type GetProjectItemRequest, type GetProjectItemResponse, type IdentificationData, type IdentificationDataIdOneOf, type Image, ImageType, type ImageTypeWithLiterals, type InvalidateCache, type InvalidateCacheGetByOneOf, type Item, type ItemMetadata, type ItemMetadataOneOf, type Link, type ListProjectItemsOptions, type ListProjectItemsRequest, type ListProjectItemsResponse, type MaskedItem, type MessageEnvelope, type Page, type Paging, type PagingMetadataV2, type Point, type ProjectItemCreatedEnvelope, type ProjectItemDeletedEnvelope, type ProjectItemMediaToken, type ProjectItemUpdatedEnvelope, type QueryProjectItemsRequest, type QueryProjectItemsResponse, type QueryV2, type QueryV2PagingMethodOneOf, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type Tags, Type, type TypeWithLiterals, type URI, type UnsharpMasking, type UpdateProjectItem, type UpdateProjectItemRequest, type UpdateProjectItemResponse, type Video, type VideoResolution, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkCreateProjectItems, bulkDeleteProjectItems, bulkUpdateProjectItems, createProjectItem, deleteProjectItem, duplicateProjectItems, generateTokenForProjectItems, getProjectItem, listProjectItems, onProjectItemCreated, onProjectItemDeleted, onProjectItemUpdated, updateProjectItem };