import * as _wix_sdk_types from '@wix/sdk-types';
import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types';
interface Folder {
/**
* Folder ID. Generated when a folder is created in the Media Manager.
* @maxLength 100
*/
_id?: string;
/**
* Folder name as it appears in the Media Manager.
* @maxLength 1000
*/
displayName?: string;
/**
* ID of the folder's parent folder.
Default: `media-root` folder.
* @maxLength 100
*/
parentFolderId?: string;
/**
* Date the folder was created.
* @readonly
*/
_createdDate?: Date | null;
/**
* Date the folder was updated.
* @readonly
*/
_updatedDate?: Date | null;
/**
* State of the folder.
* @readonly
*/
state?: StateWithLiterals;
/**
* Namespace of the folder.
* @internal
*/
namespace?: NamespaceWithLiterals;
/**
* Site ID the folder belongs to.
* @readonly
* @maxLength 100
*/
siteId?: string;
}
declare enum State {
OK = "OK",
DELETED = "DELETED"
}
/** @enumType */
type StateWithLiterals = State | 'OK' | 'DELETED';
declare enum Namespace {
/** No namespaces */
NO_NAMESPACE = "NO_NAMESPACE",
/** Custom namespace */
OTHERS = "OTHERS",
/** Wix videos */
WIX_VIDEO = "WIX_VIDEO",
/** Wix music */
WIX_MUSIC = "WIX_MUSIC",
/** Albums and art store */
ALBUMS_AND_ART_STORE = "ALBUMS_AND_ART_STORE",
/** Wix ecom */
WIX_ECOM = "WIX_ECOM",
/** Photo share */
PHOTO_SHARE_APP = "PHOTO_SHARE_APP",
/** Sharing app */
SHARING_APP = "SHARING_APP",
/** Chat (engage) */
CHAT = "CHAT",
/** Logo builder */
LOGO_BUILDER = "LOGO_BUILDER",
/** Albums old namespace */
ALBUMS_OLD = "ALBUMS_OLD",
/** Mobile chat */
CHAT_MOBILE = "CHAT_MOBILE",
/** Wix Forms */
WIX_FORMS = "WIX_FORMS",
/**
* Draft - files that will be deleted if not published
* @internal
*/
DRAFTS = "DRAFTS",
/** Wix legends */
WIX_LEGENDS = "WIX_LEGENDS",
/**
* Restricted Data
* @internal
*/
DATA_RESTRICTED = "DATA_RESTRICTED",
/** Portfolio */
PORTFOLIO = "PORTFOLIO",
/** LOGOS */
LOGOS = "LOGOS"
}
/** @enumType */
type NamespaceWithLiterals = Namespace | 'NO_NAMESPACE' | 'OTHERS' | 'WIX_VIDEO' | 'WIX_MUSIC' | 'ALBUMS_AND_ART_STORE' | 'WIX_ECOM' | 'PHOTO_SHARE_APP' | 'SHARING_APP' | 'CHAT' | 'LOGO_BUILDER' | 'ALBUMS_OLD' | 'CHAT_MOBILE' | 'WIX_FORMS' | 'WIX_LEGENDS' | 'PORTFOLIO' | 'LOGOS';
interface CreateFolderRequest {
/**
* Folder name that appears in the Media Manager.
* @maxLength 1000
*/
displayName: string;
/**
* ID of the folder's parent folder.
* @maxLength 100
*/
parentFolderId?: string | null;
/**
* The namespace this folder will be created under
* @internal
* @maxLength 100
*/
rawNamespace?: string | null;
/**
* The namespace this folder will be created under
* Note - Namespace value `Others` is not supported and will produce an error
* @internal
*/
namespace?: NamespaceWithLiterals;
}
interface CreateFolderResponse {
/** Information about the newly created folder. */
folder?: Folder;
}
interface GetFolderRequest {
/**
* Folder ID.
* @maxLength 100
*/
folderId: string;
}
interface GetFolderResponse {
/** Information about the folder. */
folder?: Folder;
}
interface ListFoldersRequest {
/**
* ID of the folder's parent folder.
*
* Default: `media-root` folder.
* @maxLength 100
*/
parentFolderId?: string | null;
/**
* Field name and order to sort by. One of:
*
* `displayName`
* `updatedDate`
*
* Default: `updatedDate` in `desc` order.
*/
sort?: CommonSorting;
/** Cursor and paging information. */
paging?: CursorPaging;
/**
* List folders of the specified namespace.
* @internal
* @maxLength 100
*/
rawNamespace?: string | null;
/**
* List folders of the specified namespace.
* Note - Namespace value `Others` is not supported and will produce an error
* @internal
*/
namespace?: NamespaceWithLiterals;
}
interface CommonSorting {
/**
* Name of the field to sort by.
* @maxLength 512
*/
fieldName?: string;
/** Sort order. */
order?: CommonSortOrderWithLiterals;
/**
* When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by
* a specific element from a collection, filter can/should be provided to ensure correct sort value is picked.
*
* If multiple filters are provided, they are combined with AND operator.
*
* Example:
* Given we have document like {"id": "1", "nestedField": [{"price": 10, "region": "EU"}, {"price": 20, "region": "US"}]}
* and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be
* { fieldName: "nestedField.price", "select_items_by": [{"nestedField.region": "US"}] }
* @internal
* @maxSize 10
*/
selectItemsBy?: Record[] | null;
/**
* Origin point for geo-distance sorting on a GEO field
* results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).
*/
origin?: AddressLocation;
}
declare enum CommonSortOrder {
ASC = "ASC",
DESC = "DESC"
}
/** @enumType */
type CommonSortOrderWithLiterals = CommonSortOrder | 'ASC' | 'DESC';
interface AddressLocation {
/** Address latitude. */
latitude?: number | null;
/** Address longitude. */
longitude?: number | null;
}
interface CursorPaging {
/**
* Maximum number of items to return in the results.
* @max 100
*/
limit?: number | null;
/**
* Pointer to the next or previous page in the list of results.
*
* Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
* Not relevant for the first request.
* @maxLength 16000
*/
cursor?: string | null;
}
interface ListFoldersResponse {
/**
* Information about the folders in the requested folder.
* @maxSize 200
*/
folders?: Folder[];
/** The next cursor if it exists. */
nextCursor?: PagingMetadataV2;
}
interface PagingMetadataV2 {
/** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
total?: number | null;
/** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
cursors?: Cursors;
/**
* Indicates if there are more results after the current page.
* If `true`, another page of results can be retrieved.
* If `false`, this is the last page.
* @internal
*/
hasNext?: boolean | null;
}
interface Cursors {
/**
* Cursor string pointing to the next page in the list of results.
* @maxLength 16000
*/
next?: string | null;
}
interface SearchFoldersRequest {
/**
* The root folder in the Media Manager to search in.
* For more information, see Root Folders in [Terminology](https://dev.wix.com/docs/rest/assets/media/media-manager/introduction#terminology).
*
*
* Default: `MEDIA_ROOT`.
*/
rootFolder?: RootFolderWithLiterals;
/**
* Field name and order to sort by. One of:
*
* `displayName`
* `updatedDate`
*
* Default: `updatedDate` in `desc` order.
*/
sort?: CommonSorting;
/** Cursor and paging information. */
paging?: CursorPaging;
/**
* Free text to match in searchable fields.
*
* For example, search for specific values in a folder's `displayName`.
* @maxLength 200
*/
search?: string | null;
/**
* Search folders of the specified namespace.
* @internal
* @maxLength 100
*/
rawNamespace?: string | null;
/**
* Search folders of the specified namespace.
* Note - Namespace value `Others` is not supported and will produce an error
* @internal
*/
namespace?: NamespaceWithLiterals;
/**
* Optional target site ID to search folders on a different site than the caller's.
* When provided, the caller must have MEDIA.SITE_MEDIA_FILES_READ permission on the target site.
* @internal
* @maxLength 100
*/
siteId?: string | null;
}
declare enum RootFolder {
/** Contains all files and folders in the Media Manager's **Site Files** tab in the UI. */
MEDIA_ROOT = "MEDIA_ROOT",
/** Contains all files and folders in the Media Manager's **Trash** tab in the UI. */
TRASH_ROOT = "TRASH_ROOT",
/** Contains all files and folders created by site visitors or members. */
VISITOR_UPLOADS_ROOT = "VISITOR_UPLOADS_ROOT"
}
/** @enumType */
type RootFolderWithLiterals = RootFolder | 'MEDIA_ROOT' | 'TRASH_ROOT' | 'VISITOR_UPLOADS_ROOT';
interface SearchFoldersResponse {
/**
* Retrieved folders that match the search criteria specified in the request.
*
* Each folder includes all standard folder information.
* @maxSize 200
*/
folders?: Folder[];
/** The next cursor if it exists. */
nextCursor?: PagingMetadataV2;
}
interface UpdateFolderRequest {
/** Folder to update. */
folder: Folder;
/**
* Set of fields to update. Fields that aren't included in `fieldMask.paths` are ignored.
* @internal
*/
fieldMask?: string[];
}
interface UpdateFolderResponse {
/** Information about the updated folder. */
folder?: Folder;
}
interface UnsupportedRequestValueError {
/**
* Optional A list of allowed values
* @maxSize 100
* @maxLength 200
*/
allowedValues?: string[];
/**
* The unsupported value send in the request
* @maxLength 200
*/
requestValue?: string;
}
interface GenerateFolderDownloadUrlRequest {
/**
* Folder ID.
* @maxLength 100
*/
folderId: string;
}
interface GenerateFolderDownloadUrlResponse {
/**
* URL for downloading a specific folder in the Media Manager.
* @format WEB_URL
*/
downloadUrl?: string;
}
interface BulkDeleteFoldersRequest {
/**
* IDs of the folders to move to the Media Manager's trash bin.
* @maxSize 100
* @maxLength 100
*/
folderIds: string[];
/**
* Whether the specified folders are permanently deleted.
* Default: `false`
*/
permanent?: boolean;
}
interface BulkDeleteFoldersResponse {
}
interface BulkRestoreFoldersFromTrashBinRequest {
/**
* IDs of the folders to restore from the Media Manager's trash bin.
* @maxSize 100
* @maxLength 100
*/
folderIds: string[];
}
interface BulkRestoreFoldersFromTrashBinResponse {
}
interface ListDeletedFoldersRequest {
/**
* ID of the folder's parent folder.
* @maxLength 100
*/
parentFolderId?: string | null;
/**
* Field name and order to sort by. One of:
* * `displayName`
* * `updatedDate`
* Default: `updatedDate` in `desc` order.
*/
sort?: CommonSorting;
/** Cursor and paging information. */
paging?: CursorPaging;
/**
* List folders of the specified namespace.
* @internal
* @maxLength 100
*/
rawNamespace?: string | null;
/**
* List folders of the specified namespace.
* Note - Namespace value `Others` is not supported and will produce an error
* @internal
*/
namespace?: NamespaceWithLiterals;
}
interface ListDeletedFoldersResponse {
/**
* List of folders in the Media Manager's trash bin.
* @maxSize 200
*/
folders?: Folder[];
/** The next cursor if it exists. */
nextCursor?: PagingMetadataV2;
}
interface QueryFoldersRequest {
/**
* Query options, including filter, sort, and cursor paging.
*
* See [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language) and
* [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging) for more information.
*/
query?: CursorQuery;
}
interface CursorQuery extends CursorQueryPagingMethodOneOf {
/**
* Cursor paging options.
*
* Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
*/
cursorPaging?: CursorPaging;
/**
* Filter object.
*
* Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).
*/
filter?: Record | null;
/**
* Sort object.
*
* Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).
* @maxSize 1
*/
sort?: Sorting[];
}
/** @oneof */
interface CursorQueryPagingMethodOneOf {
/**
* Cursor paging options.
*
* Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
*/
cursorPaging?: CursorPaging;
}
interface Sorting {
/**
* Name of the field to sort by.
* @maxLength 512
*/
fieldName?: string;
/**
* Sort order. Use `ASC` for ascending order or `DESC` for descending order.
*
* Default: `ASC`
*/
order?: SortOrderWithLiterals;
}
declare enum SortOrder {
ASC = "ASC",
DESC = "DESC"
}
/** @enumType */
type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
interface QueryFoldersResponse {
/**
* Retrieved folders that match the query.
* @maxSize 200
*/
folders?: Folder[];
/** Paging metadata, including the cursors for the next and previous pages. */
pagingMetadata?: PagingMetadataV2;
}
interface DomainEvent extends DomainEventBodyOneOf {
createdEvent?: EntityCreatedEvent;
updatedEvent?: EntityUpdatedEvent;
deletedEvent?: EntityDeletedEvent;
actionEvent?: ActionEvent;
/** Event ID. With this ID you can easily spot duplicated events and ignore them. */
_id?: string;
/**
* Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
* For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
*/
entityFqdn?: string;
/**
* Event action name, placed at the top level to make it easier for users to dispatch messages.
* For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
*/
slug?: string;
/** ID of the entity associated with the event. */
entityId?: string;
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
eventTime?: Date | null;
/**
* Whether the event was triggered as a result of a privacy regulation application
* (for example, GDPR).
*/
triggeredByAnonymizeRequest?: boolean | null;
/** If present, indicates the action that triggered the event. */
originatedFrom?: string | null;
/**
* A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.
* You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
*/
entityEventSequence?: string | null;
}
/** @oneof */
interface DomainEventBodyOneOf {
createdEvent?: EntityCreatedEvent;
updatedEvent?: EntityUpdatedEvent;
deletedEvent?: EntityDeletedEvent;
actionEvent?: ActionEvent;
}
interface EntityCreatedEvent {
entity?: string;
}
interface RestoreInfo {
deletedDate?: Date | null;
}
interface EntityUpdatedEvent {
/**
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
*/
currentEntity?: string;
}
interface EntityDeletedEvent {
/** Entity that was deleted. */
deletedEntity?: string | null;
}
interface ActionEvent {
body?: string;
}
interface MessageEnvelope {
/**
* App instance ID.
* @format GUID
*/
instanceId?: string | null;
/**
* Event type.
* @maxLength 150
*/
eventType?: string;
/** The identification type and identity data. */
identity?: IdentificationData;
/** Stringify payload. */
data?: string;
/** Details related to the account */
accountInfo?: AccountInfo;
}
interface IdentificationData extends IdentificationDataIdOneOf {
/**
* ID of a site visitor that has not logged in to the site.
* @format GUID
*/
anonymousVisitorId?: string;
/**
* ID of a site visitor that has logged in to the site.
* @format GUID
*/
memberId?: string;
/**
* ID of a Wix user (site owner, contributor, etc.).
* @format GUID
*/
wixUserId?: string;
/**
* ID of an app.
* @format GUID
*/
appId?: string;
/** @readonly */
identityType?: WebhookIdentityTypeWithLiterals;
}
/** @oneof */
interface IdentificationDataIdOneOf {
/**
* ID of a site visitor that has not logged in to the site.
* @format GUID
*/
anonymousVisitorId?: string;
/**
* ID of a site visitor that has logged in to the site.
* @format GUID
*/
memberId?: string;
/**
* ID of a Wix user (site owner, contributor, etc.).
* @format GUID
*/
wixUserId?: string;
/**
* ID of an app.
* @format GUID
*/
appId?: string;
}
declare enum WebhookIdentityType {
UNKNOWN = "UNKNOWN",
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
MEMBER = "MEMBER",
WIX_USER = "WIX_USER",
APP = "APP"
}
/** @enumType */
type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
interface AccountInfo {
/**
* ID of the Wix account associated with the event.
* @format GUID
*/
accountId?: string | null;
/**
* ID of the parent Wix account. Only included when accountId belongs to a child account.
* @format GUID
*/
parentAccountId?: string | null;
/**
* ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
* @format GUID
*/
siteId?: string | null;
}
/** @docsIgnore */
type UpdateFolderValidationErrors = {
ruleName?: 'FIELD_MASK_IS_EMPTY_OR_MISSING';
};
/**
* Creates a new folder in the Media Manager.
*
* Use the `parentFolderId` parameter to specify in which existing folder you want the new folder to be created.
* If no folder is specified, the new folder is created in the `media-root` folder.
* @param displayName - Folder name that appears in the Media Manager.
* @public
* @requiredField displayName
* @param options - Options for specifying where to create a folder.
* @permissionId MEDIA.SITE_MEDIA_FOLDERS_CREATE
* @applicableIdentity APP
* @fqn com.wix.media.site_media.v1.FoldersService.CreateFolder
*/
declare function createFolder(displayName: string, options?: CreateFolderOptions): Promise>;
interface CreateFolderOptions {
/**
* ID of the folder's parent folder.
* @maxLength 100
*/
parentFolderId?: string | null;
}
/**
* Gets information from a specific folder in the Media Manager.
* @param folderId - Folder ID.
* @public
* @requiredField folderId
* @permissionId MEDIA.SITE_MEDIA_FOLDERS_READ
* @applicableIdentity APP
* @returns Information about the folder.
* @fqn com.wix.media.site_media.v1.FoldersService.GetFolder
*/
declare function getFolder(folderId: string): Promise>;
/**
* Retrieves a list of folders in the Media Manager. To retrieve a list of folders within a specific folder in the Media Manager, specify the specific folder's ID in the `parentFolderId` parameter. If no folder is specified, the method retrieves a list of folders within the root folder of the Media Manager.
* @public
* @param options - Options to use when listing folders from the Media Manager.
* @permissionId MEDIA.SITE_MEDIA_FOLDERS_LIST
* @applicableIdentity APP
* @fqn com.wix.media.site_media.v1.FoldersService.ListFolders
*/
declare function listFolders(options?: ListFoldersOptions): Promise>;
interface ListFoldersOptions {
/**
* ID of the folder's parent folder.
*
* Default: `media-root` folder.
* @maxLength 100
*/
parentFolderId?: string | null;
/**
* Field name and order to sort by. One of:
*
* `displayName`
* `updatedDate`
*
* Default: `updatedDate` in `desc` order.
*/
sort?: CommonSorting;
/** Cursor and paging information. */
paging?: CursorPaging;
}
/**
* Retrieves a list of up to 200 folders with the specified filtering, sorting, and cursor paging.
*
* If no parameters are specified, the method returns all folders in the `MEDIA_ROOT` folder.
*
* ## Defaults
*
* Search Folders has the following default setting, which you can override:
* + Sorted by `updatedDate` in descending order.
*
* ## Filters
*
* When using filters for dates, you must use
* [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
*
* ## See also
*
* To learn about working with *Search* methods, see
* [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language) and
* [Sorting and Paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging).
* @public
* @param options - Options specifying which folders to search.
* @permissionId MEDIA.SITE_MEDIA_FOLDERS_LIST
* @applicableIdentity APP
* @fqn com.wix.media.site_media.v1.FoldersService.SearchFolders
*/
declare function searchFolders(options?: SearchFoldersOptions): Promise>;
interface SearchFoldersOptions {
/**
* The root folder in the Media Manager to search in.
* For more information, see Root Folders in [Terminology](https://dev.wix.com/docs/rest/assets/media/media-manager/introduction#terminology).
*
*
* Default: `MEDIA_ROOT`.
*/
rootFolder?: RootFolderWithLiterals;
/**
* Field name and order to sort by. One of:
*
* `displayName`
* `updatedDate`
*
* Default: `updatedDate` in `desc` order.
*/
sort?: CommonSorting;
/** Cursor and paging information. */
paging?: CursorPaging;
/**
* Free text to match in searchable fields.
*
* For example, search for specific values in a folder's `displayName`.
* @maxLength 200
*/
search?: string | null;
}
/**
* Updates a folder.
*
* You can use the `parentFolderId` parameter to move a folder from its current parent folder to a different parent folder.
* @param _id - Folder ID. Generated when a folder is created in the Media Manager.
* @public
* @requiredField _id
* @requiredField folder
* @param folder - Folder to update.
* @permissionId MEDIA.SITE_MEDIA_FOLDERS_UPDATE
* @applicableIdentity APP
* @returns Information about the updated folder.
* @fqn com.wix.media.site_media.v1.FoldersService.UpdateFolder
*/
declare function updateFolder(_id: string, folder: UpdateFolder): Promise & {
__validationErrorsType?: UpdateFolderValidationErrors;
}>;
interface UpdateFolder {
/**
* Folder ID. Generated when a folder is created in the Media Manager.
* @maxLength 100
*/
_id?: string;
/**
* Folder name as it appears in the Media Manager.
* @maxLength 1000
*/
displayName?: string;
/**
* ID of the folder's parent folder.
Default: `media-root` folder.
* @maxLength 100
*/
parentFolderId?: string;
/**
* Date the folder was created.
* @readonly
*/
_createdDate?: Date | null;
/**
* Date the folder was updated.
* @readonly
*/
_updatedDate?: Date | null;
/**
* State of the folder.
* @readonly
*/
state?: StateWithLiterals;
/**
* Namespace of the folder.
* @internal
*/
namespace?: NamespaceWithLiterals;
/**
* Site ID the folder belongs to.
* @readonly
* @maxLength 100
*/
siteId?: string;
}
/**
* Generates a URL for downloading a compressed file containing a specific folder in the Media Manager.
*
* The compressed file can contain sub-folders, and up to 1000 files.
* @param folderId - Folder ID.
* @public
* @requiredField folderId
* @permissionId MEDIA.SITE_MEDIA_FOLDERS_DOWNLOAD
* @applicableIdentity APP
* @fqn com.wix.media.site_media.v1.FoldersService.GenerateFolderDownloadUrl
*/
declare function generateFolderDownloadUrl(folderId: string): Promise>;
/**
* Temporarily deletes the specified folders from the Media Manager.
*
* The deleted folders are moved to the Media Manager's `trash-root` folder (trash bin) unless permanently deleted. To permanently delete folders, specify the `permanent` parameter with the value `true`. Permanently deleting folders isn't reversible, so make sure that the files in these folders aren't being used in a site or in any other way as the files will no longer be accessible.
*
* Note the following:
* * When a folder is deleted, the files in that folder are deleted.
* * The specified folders can be from different parent folders.
* * Moving multiple folders at once is an asynchronous action, and may take time for the changes to appear in the Media Manager.
* * Attempting to delete folders that are already in the trash bin doesn't result in an error.
* * If a site contains files from a deleted media folder, the files still appear on the site as the deleted folder is still in the Media Manager (in the trash bin).
* * You can also use the [Bulk Restore Folders From Trash Bin](https://dev.wix.com/docs/rest/assets/media/media-manager/folders/bulk-restore-folders-from-trash-bin) method to restore folders from the Media Manager's trash bin.
* @param folderIds - IDs of the folders to move to the Media Manager's trash bin.
* @public
* @requiredField folderIds
* @param options - Options to use when deleting folders.
* @permissionId MEDIA.SITE_MEDIA_FOLDERS_MOVE_TO_TRASH
* @applicableIdentity APP
* @fqn com.wix.media.site_media.v1.FoldersService.BulkDeleteFolders
*/
declare function bulkDeleteFolders(folderIds: string[], options?: BulkDeleteFoldersOptions): Promise;
interface BulkDeleteFoldersOptions {
/**
* Whether the specified folders are permanently deleted.
* Default: `false`
*/
permanent?: boolean;
}
/**
* Restores the specified folders from the Media Manager's trash bin, and moves them to their original locations in the Media Manager.
* @param folderIds - IDs of the folders to restore from the Media Manager's trash bin.
* @public
* @requiredField folderIds
* @permissionId MEDIA.SITE_MEDIA_FOLDERS_RESTORE_FROM_TRASH
* @applicableIdentity APP
* @fqn com.wix.media.site_media.v1.FoldersService.BulkRestoreFoldersFromTrashBin
*/
declare function bulkRestoreFoldersFromTrashBin(folderIds: string[]): Promise;
/**
* Retrieves a list of folders in the Media Manager's trash bin.
* @public
* @param options - Options to use when listing deleted folders from the trash bin.
* @permissionId MEDIA.SITE_MEDIA_FOLDERS_LIST_DELETED
* @applicableIdentity APP
* @fqn com.wix.media.site_media.v1.FoldersService.ListDeletedFolders
*/
declare function listDeletedFolders(options?: ListDeletedFoldersOptions): Promise>;
interface ListDeletedFoldersOptions {
/**
* ID of the folder's parent folder.
* @maxLength 100
*/
parentFolderId?: string | null;
/**
* Field name and order to sort by. One of:
* * `displayName`
* * `updatedDate`
* Default: `updatedDate` in `desc` order.
*/
sort?: CommonSorting;
/** Cursor and paging information. */
paging?: CursorPaging;
}
/**
* Retrieves a list of folders in the Media Manager, given the provided [cursor paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language#cursor-paging), filtering, and sorting.
*
* Up to 200 folders can be returned per request.
*
* To learn about working with *Query* methods, see
* [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language) and
* [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging)
* @public
* @permissionId MEDIA.SITE_MEDIA_FOLDERS_LIST
* @applicableIdentity APP
* @fqn com.wix.media.site_media.v1.FoldersService.QueryFolders
*/
declare function queryFolders(): FoldersQueryBuilder;
interface QueryCursorResult {
cursors: Cursors;
hasNext: () => boolean;
hasPrev: () => boolean;
length: number;
pageSize: number;
}
interface FoldersQueryResult extends QueryCursorResult {
items: Folder[];
query: FoldersQueryBuilder;
next: () => Promise;
prev: () => Promise;
}
interface FoldersQueryBuilder {
/** @param propertyName - Property whose value is compared with `value`.
* @param value - Value to compare against.
*/
eq: (propertyName: 'state', value: any) => FoldersQueryBuilder;
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
ascending: (...propertyNames: Array<'displayName' | '_updatedDate'>) => FoldersQueryBuilder;
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
descending: (...propertyNames: Array<'displayName' | '_updatedDate'>) => FoldersQueryBuilder;
/** @param limit - Number of items to return, which is also the `pageSize` of the results object. */
limit: (limit: number) => FoldersQueryBuilder;
/** @param cursor - A pointer to specific record */
skipTo: (cursor: string) => FoldersQueryBuilder;
find: () => Promise;
}
/**
* @hidden
* @fqn com.wix.media.site_media.v1.FoldersService.QueryFolders
* @requiredField query
*/
declare function typedQueryFolders(query: FolderQuery): Promise>;
interface FolderQuerySpec extends QuerySpec {
paging: 'cursor';
wql: [
{
fields: ['displayName'];
operators: [];
sort: 'BOTH';
},
{
fields: ['_updatedDate'];
operators: [];
sort: 'BOTH';
},
{
fields: ['state'];
operators: ['$eq'];
sort: 'NONE';
}
];
}
type CommonQueryWithEntityContext = Query;
type FolderQuery = {
/**
Cursor paging options.
Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
*/
cursorPaging?: {
/**
Maximum number of items to return in the results.
@max: 100
*/
limit?: NonNullable['limit'] | null;
/**
Pointer to the next or previous page in the list of results.
Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
Not relevant for the first request.
@maxLength: 16000
*/
cursor?: NonNullable['cursor'] | null;
};
/**
Filter object.
Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).
*/
filter?: CommonQueryWithEntityContext['filter'] | null;
/**
Sort object.
Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).
@maxSize: 1
*/
sort?: {
/**
Name of the field to sort by.
@maxLength: 512
*/
fieldName?: NonNullable[number]['fieldName'];
/**
Sort order. Use `ASC` for ascending order or `DESC` for descending order.
Default: `ASC`
*/
order?: NonNullable[number]['order'];
}[];
};
declare const utils: {
query: _wix_sdk_types.QueryHelpers;
};
export { type AccountInfo, type ActionEvent, type AddressLocation, type BulkDeleteFoldersOptions, type BulkDeleteFoldersRequest, type BulkDeleteFoldersResponse, type BulkRestoreFoldersFromTrashBinRequest, type BulkRestoreFoldersFromTrashBinResponse, type CommonQueryWithEntityContext, CommonSortOrder, type CommonSortOrderWithLiterals, type CommonSorting, type CreateFolderOptions, type CreateFolderRequest, type CreateFolderResponse, type CursorPaging, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type Folder, type FolderQuery, type FolderQuerySpec, type FoldersQueryBuilder, type FoldersQueryResult, type GenerateFolderDownloadUrlRequest, type GenerateFolderDownloadUrlResponse, type GetFolderRequest, type GetFolderResponse, type IdentificationData, type IdentificationDataIdOneOf, type ListDeletedFoldersOptions, type ListDeletedFoldersRequest, type ListDeletedFoldersResponse, type ListFoldersOptions, type ListFoldersRequest, type ListFoldersResponse, type MessageEnvelope, Namespace, type NamespaceWithLiterals, type PagingMetadataV2, type QueryFoldersRequest, type QueryFoldersResponse, type RestoreInfo, RootFolder, type RootFolderWithLiterals, type SearchFoldersOptions, type SearchFoldersRequest, type SearchFoldersResponse, SortOrder, type SortOrderWithLiterals, type Sorting, State, type StateWithLiterals, type UnsupportedRequestValueError, type UpdateFolder, type UpdateFolderRequest, type UpdateFolderResponse, type UpdateFolderValidationErrors, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkDeleteFolders, bulkRestoreFoldersFromTrashBin, createFolder, generateFolderDownloadUrl, getFolder, listDeletedFolders, listFolders, queryFolders, searchFolders, typedQueryFolders, updateFolder, utils };