@adobe/ccweb-add-on-manifest
Version:
Manifest models and validation rules for Adobe Creative Cloud Web Add-on.
170 lines (168 loc) • 6.09 kB
JavaScript
/********************************************************************************
* MIT License
* © Copyright 2023 Adobe. All rights reserved.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
********************************************************************************/
/**
* Note: This enum expects values wrt manifest permission properties to support iframe allow permissions.
*/
export var Allow;
(function (Allow) {
Allow["camera"] = "camera";
Allow["microphone"] = "microphone";
Allow["clipboard"] = "clipboard";
})(Allow || (Allow = {}));
/**
* Types of entrypoints that add-ons support.
*/
export var EntrypointType;
(function (EntrypointType) {
/**
* Widget entrypoint type.
*/
EntrypointType["WIDGET"] = "widget";
/**
* Command entrypoint type.
*/
EntrypointType["COMMAND"] = "command";
/**
* Script entrypoint type.
* add-ons with script entrypoint type can use only the document sandbox APIs.
*/
EntrypointType["SCRIPT"] = "script";
/**
* Panel entrypoint type.
*/
EntrypointType["PANEL"] = "panel";
/**
* Share entrypoint type.
*/
EntrypointType["SHARE"] = "share";
/**
* Content hub entrypoint type.
*/
EntrypointType["CONTENT_HUB"] = "content-hub";
/**
* Mobile media audio entrypoint type.
*/
EntrypointType["MOBILE_MEDIA_AUDIO"] = "mobile.media.audio";
/**
* Mobile your stuff files entrypoint type.
*/
EntrypointType["MOBILE_YOUR_STUFF_FILES"] = "mobile.your-stuff.files";
/**
* Mobile more entrypoint type.
*/
EntrypointType["MOBILE_MORE"] = "mobile.more";
/**
* Schedule entrypoint type.
*/
EntrypointType["SCHEDULE"] = "schedule";
/**
* Contextual replace entrypoint type.
*/
EntrypointType["CONTEXTUAL_REPLACE"] = "contextual.replace";
/**
* Contextual upload entrypoint type.
*/
EntrypointType["CONTEXTUAL_UPLOAD"] = "contextual.upload";
/**
* Contextual bulk create entrypoint type.
*/
EntrypointType["CONTEXTUAL_BULK_CREATE"] = "contextual.bulk-create";
/**
* Import hub entrypoint type.
*/
EntrypointType["IMPORT_HUB"] = "import-hub";
/**
* Quick action entrypoint type.
*/
EntrypointType["QUICK_ACTION"] = "quick-action";
/**
* Content hub home (L1) entrypoint type.
*/
EntrypointType["CONTENT_HUB_HOME"] = "content-hub-home";
})(EntrypointType || (EntrypointType = {}));
/**
* Defines the Error Type other than avj libray validations for the Manifest
*/
export const OTHER_MANIFEST_ERRORS = {
ManifestVersionType: {
instancePath: "/manifestVersion",
message: "Manifest version should be a number"
},
InvalidManifestVersion: {
instancePath: "/manifestVersion",
message: "Invalid manifest version"
},
EmptyEntrypoint: {
instancePath: "/entryPoints",
message: "At least one entrypoint should be defined"
},
EmptyIcon: {
instancePath: "/icon",
message: "At least one icon should be defined"
},
TestIdRequired: {
instancePath: "/testId",
message: "testId should be defined in manifest for developer workflow"
},
InvalidClipboardPermission: {
instancePath: "/entryPoints/permissions/clipboard",
message: "Clipboard read permission is not allowed for this AddOn"
},
RestrictedPrivilegedApis: {
instancePath: "/requirements/privilegedApis",
message: "Privileged apis are not allowed for this add-on"
},
AdditionPropertyExperimentalApis: {
instancePath: "/requirements/experimentalApis",
message: "Experimental apis are not supported for production add-ons"
},
DocumentSandboxWithScript: {
instancePath: "/entryPoints/documentSandbox",
message: "Manifest entrypoint should have either 'documentSandbox' or 'script', not both"
},
InvalidHostDomain: {
instancePath: "/entryPoints/hostDomain",
message: "Manifest entrypoint should have valid hostDomain"
},
RestrictedContentHubEntrypoint: {
instancePath: "/entryPoints/type",
message: "Entrypoint type 'content-hub' is allowed only for privileged add-ons"
},
RestrictedFormsSandboxProperty: {
instancePath: "/entryPoints/permissions/sandbox",
message: `Sandbox property "allow-forms" is not allowed for this AddOn`
},
RestrictedScriptEntrypoint: {
instancePath: "/entryPoints/type",
message: "Entrypoint type 'script' is allowed only for add-ons created in the code-playground"
}
};
export var AddOnLogLevel;
(function (AddOnLogLevel) {
AddOnLogLevel["information"] = "information";
AddOnLogLevel["warning"] = "warning";
AddOnLogLevel["error"] = "error";
})(AddOnLogLevel || (AddOnLogLevel = {}));
export function isIframeEntryPointType(entryPointType) {
return entryPointType !== EntrypointType.SCRIPT;
}
//# sourceMappingURL=AddOnManifestTypes.js.map