@adobe/genstudio-extensibility-sdk
Version:
GenStudio Extensibility SDK
49 lines (48 loc) • 2.27 kB
JavaScript
;
/*
Copyright 2025 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.SelectContentExtensionService = exports.SelectContentExtensionServiceError = void 0;
class SelectContentExtensionServiceError extends Error {
constructor(message) {
super(message);
this.name = "SelectContentExtensionServiceError";
}
}
exports.SelectContentExtensionServiceError = SelectContentExtensionServiceError;
class SelectContentExtensionService {
/**
* Sync the selected assets
* @param connection - The guest connection to the host
* @returns the current selected assets and the total count of left assets
*/
static async sync(connection, extensionId) {
if (!connection) {
throw new SelectContentExtensionServiceError("Connection is required to sync selected assets");
}
// @ts-ignore Remote API is handled through postMessage
return connection.host.api.selectContentExtension.sync(extensionId);
}
/**
* Set the selected assets
* @param extensionId - the extension id of the content select content add ons
* @param assets - the selected assets
*/
static setSelectedAssets(connection, extensionId, assets) {
if (!connection) {
throw new SelectContentExtensionServiceError("Connection is required to set selected assets");
}
// @ts-ignore Remote API is handled through postMessage
return connection.host.api.selectContentExtension.setSelectedAssets(extensionId, assets);
}
}
exports.SelectContentExtensionService = SelectContentExtensionService;
//# sourceMappingURL=select-content-extension-service.js.map