import Base, { MaybeRaw } from "../../../Base"; import { AuditLog } from "../../../interfaces/auditor"; import { Asset, AssetFilter, AssetPermission, AssetSearchContext, CreateAsset, Mentionable, PatchAsset, Resolution, SubscriptionFilter, Upload, VTTThumbnail } from "../../../interfaces/cosmo/asset"; import { Sorting } from "../../../interfaces/global"; /** * @class Asset * @extends Base * * @remarks * **Under development, breaking changes possible** * * Represents an Asset resource in Cosmo, providing methods to interact with the Asset API. */ export declare class CosmoAsset extends Base { protected getEndpoint(endpoint: string): string; /** * Browse assets * * @param orgName Name of the Organization * @param spaceName Name of the Space * @param context Context to search in (e.g., ORGANIZATION, TRASH, SHARE) * @param limit Maximum number of Assets to return * @param page Page number for pagination * @param spaceName Name of Space to restrict search (mandatory if context is not ORGANIZATION) * @param namespace Name of Namespace to restrict search * @param parentId ID of parent (folder, etc.) to restrict search * @param shareId ID of Share to restrict search (mandatory if context is SHARE) * @param assetFilter Filter criteria for Assets * @param sorting Sorting criteria for the results * @returns List of found Assets */ browse({ orgName, spaceName, context, limit, page, namespace, parentId, shareId, assetFilter, sorting, }: { orgName: string; spaceName: string; context: AssetSearchContext; limit?: number; page?: number; namespace?: string[] | string; parentId?: string; shareId?: string; assetFilter?: AssetFilter[]; sorting?: Sorting; }, raw?: { raw: R; }): Promise>; /** * Create a new Asset in Cosmo inside the specified Organization and Space. * @remarks * ** Under development, breaking changes possible** * @param orgName Name of the Organization * @param spaceName Name of the Space * @param createAsset The Asset to be created * @returns The created asset */ createAsset(orgName: string, spaceName: string, createAsset: CreateAsset, raw?: { raw: R; }): Promise>; /** * Bulk move or copy multiple assets to a new parent. * @remarks * ** Under development, breaking changes possible** * @param orgName Name of the Organization * @param spaceName Name of the Space * @param newParentId (optional) ID of the new parent Asset to which the assets will be moved. Assets will be moved to the root if not provided. * @param assetIdList List of Asset IDs to be moved to trash * @param copy Whether to copy (true) or move (false) the assets * @returns The moved assets */ bulkMove(orgName: string, spaceName: string, assetIdList: string[], newParentId?: string, copy?: boolean, raw?: { raw: R; }): Promise>; /** * Attach an asset to a location. * @remarks * ** Under development, breaking changes possible** * @param orgName Name of the Organization * @param spaceName Name of the Space * @param assetId ID of the Asset to be attached * @param locationId ID of the Location to which the Asset will be attached to * @returns 204 No Content if successful */ attachAssetToLocation(orgName: string, spaceName: string, assetId: string, locationId: string, raw?: { raw: R; }): Promise>; /** * Patch an asset. * @remarks * ** Under development, breaking changes possible** * @param orgName Name of the Organization * @param spaceName Name of the Space * @param assetId ID of the Asset to be attached * @param patchAsset The Asset to be patched * @returns The patched asset */ patchAsset(orgName: string, spaceName: string, assetId: string, patchAsset: PatchAsset, raw?: { raw: R; }): Promise>; /** * Get an asset by its ID. * @remarks * ** Under development, breaking changes possible** * @param orgName Name of the Organization * @param spaceName Name of the Space * @param assetId ID of the Asset to be attached * @param namespace Optional Namespaces of which information should be included in the returned object * @param includePermissions Whether to include permissions in the result or not * @returns The requested asset */ getAsset(orgName: string, spaceName: string, assetId: string, namespace?: string | string[], includePermissions?: boolean, raw?: { raw: R; }): Promise>; /** * Delete multiple assets permanently by their IDs. * @remarks * ** Under development, breaking changes possible** * @param orgName Name of the Organization * @param spaceName Name of the Space * @param assetIds IDs of the Assets to delete * @param force If asset is folder and force is set to false, it will only succeed if the folder is empty. If set to true, it will always succeed, but delete all children in the process * @returns 204 No Content if successful */ deleteAssets(orgName: string, spaceName: string, assetIds: string[], force?: boolean, raw?: { raw: R; }): Promise>; /** * Request download URLs for multiple assets. * @remarks * ** Under development, breaking changes possible** * @param orgName Name of the Organization * @param spaceName Name of the Space * @param assetIdList List of Asset IDs for which download URLs are requested * @param resolution The desired resolution for the download URLs * @returns A map of Asset IDs to their download URLs */ requestDownloadUrls(orgName: string, spaceName: string, assetIdList: string[], resolution: Resolution, raw?: { raw: R; }): Promise>>; /** * Upload an asset. * @remarks * ** Under development, breaking changes possible** * ** Check this endpoint for currency as it looks outdated.** * @param token An upload token for the asset * @returns The uploaded asset */ uploadAsset(token: string, raw?: { raw: R; }): Promise>; /** * Move assets to the trash bin. * @remarks * ** Under development, breaking changes possible** * @param orgName Name of the Organization * @param spaceName Name of the Space * @param assetIdList List of Asset IDs to be moved to trash * @returns The moved assets */ moveAssetsToTrash(orgName: string, spaceName: string, assetIdList: string[], raw?: { raw: R; }): Promise>; /** * Fetch permissions for a group of assets. * @remarks * ** Under development, breaking changes possible** * @param orgName Name of the Organization * @param spaceName Name of the Space * @param assetIdList List of Asset IDs to be moved to trash * @returns A map of Asset IDs to their permissions */ fetchAssetPermissions(orgName: string, spaceName: string, assetIdList: string[], raw?: { raw: R; }): Promise>>; /** * Fetches the activity log for a specific asset within a given organization and space. * * @param {string} orgName - The name of the organization that owns the space. * @param {string} spaceName - The name of the space containing the asset. * @param {string} assetId - The unique identifier of the asset whose activity is being fetched. * @param {number} limit - The maximum number of audit log entries to retrieve per page. * @param {number} page - The page number to retrieve (for pagination). * @returns {Promise} A promise that resolves to an array of `AuditLog` objects representing the asset’s activity history. */ fetchAssetActivity(orgName: string, spaceName: string, assetId: string, limit: number, page: number, raw?: { raw: R; }): Promise>; /** * Fetches the assets vtt as plain text * * @param {string} orgName - The name of the organization that owns the space. * @param {string} spaceName - The name of the space containing the asset. * @param {string} assetId - The unique identifier of the asset whose VTT file is being fetched. * @returns {Promise} The assets VTT file as plain text. */ fetchAssetVtt(orgName: string, spaceName: string, assetId: string, raw?: { raw: R; }): Promise>; /** * Fetches an assets VTT file and parses it to return an array of VTTThumbnail objects. * * @param {string} url - The URL of the VTT file to fetch and parse. * @param {string} keepAuthHeader - Keep the current set Authorization header. Otherwise it will be unset since S3 denies it. * @returns {Promise} A promise that resolves to an array of `VTTThumbnail` objects representing the asset’s thumbnails. */ fetchAndParseAssetVTT(url: string, keepAuthHeader?: boolean, raw?: { raw: R; }): Promise>; /** * Rename an asset. * @remarks * ** Under development, breaking changes possible** * @param orgName Name of the Organization * @param spaceName Name of the Space * @param assetId ID of the Asset to be renamed * @returns The renamed asset */ renameAsset(orgName: string, spaceName: string, assetId: string, newName: string, raw?: { raw: R; }): Promise>; /** * Move assets out of trash and therewith recover them. * @remarks * ** Under development, breaking changes possible** * @param orgName Name of the Organization * @param spaceName Name of the Space * @param assetIdList List of Asset IDs to be moved out of trash * @returns The moved assets */ moveAssetsOutOfTrash(orgName: string, spaceName: string, assetIdList: string[], raw?: { raw: R; }): Promise>; /** * Attach a tag to an asset or replace an existing one. * @remarks * ** Under development, breaking changes possible** * @param orgName Name of the Organization * @param spaceName Name of the Space * @param namespaceName Name of the namespace * @param assetId ID of the Asset to be attached * @param tagName Name of the tag * @returns The updated asset */ attachTagToAsset(orgName: string, spaceName: string, namespaceName: string, assetId: string, tagName: string, raw?: { raw: R; }): Promise>; /** * Remove a tag from an asset. * @remarks * ** Under development, breaking changes possible** * @param orgName Name of the Organization * @param spaceName Name of the Space * @param namespaceName Name of the Namespace * @param assetId ID of the Asset to be attached * @returns The updated asset */ removeTagFromAsset(orgName: string, spaceName: string, namespaceName: string, assetId: string, raw?: { raw: R; }): Promise>; /** * List users allowed to be mentioned in a comment of an asset. * @param assetId ID of the Asset * @param limit Maximum number of users to return * @param page Page number for pagination * @returns A list of users allowed to be mentioned in a comment of the asset */ listUsersAllowedToMention(orgName: string, spaceName: string, assetId: string, limit?: number, page?: number, raw?: { raw: R; }): Promise>; /** * Clone one or more assets within a space. * * This operation creates copies of the specified assets in the same organization and space. * * @param orgName Name of the Organization * @param spaceName Name of the Space * @param assetIds List of Asset IDs to be cloned. If folder IDs are specified, they will be recursively cloned. * @param parentId (optional) Id of parent asset of the newly cloned asset. If undefined will default to space as parent. * @returns The cloned assets */ cloneAsset(orgName: string, spaceName: string, assetIds: string[], parentId?: string, raw?: { raw: R; }): Promise>; /** * Subscribe to notifications for a specific asset or all assets in a space. * * @param orgName Name of the Organization * @param spaceName Name of the Space * @param assetId (optional) ID of the Asset to subscribe to. If not provided, subscribes to the space. * @param filters (optional) Subscription configuration. If 'filters' is omitted or empty, all notification types will be sent. * @param raw * @returns 204 No Content if successful */ subscribe(orgName: string, spaceName: string, assetId?: string, filters?: SubscriptionFilter[], raw?: { raw: R; }): Promise>; /** * Unsubscribe from notifications for a specific asset or all assets in a space. * * @param orgName Name of the Organization * @param spaceName Name of the Space * @param assetId (optional) ID of the Asset to unsubscribe from. If not provided, unsubscribes from the space. * @returns 204 No Content if successful */ unsubscribe(orgName: string, spaceName: string, assetId?: string, raw?: { raw: R; }): Promise>; }