1.3.4 • Published 5 years ago
cep-spy v1.3.4
cep-spy
Slim, no-dependency utility to dynamically reveal all information about current Adobe host application, active panel using it and even it's sibling CEP extensions, all without needing CSInterface.
Installation
npm install cep-spyUsage
// Via import:
import spy from "cep-spy";
// Via require:
const spy = require("cep-spy").default;Examples:
CEP-Spy returns as an object with various pre-calculated values and helper functions:
import spy from "cep-spy";
console.log(spy);
Some are simple wrappers around CSInterface's functions but returning more useful formats (no need to always JSON.parse), some return values that CSInterface doesn't even offer but are useful (localhost port, extension version, environment, etc)
Launch the current localhost of the panel without knowing the app, panel, or localhost:
import spy from "cep-spy";
spy.launchLocalhost(); // Launches in default browser
console.log(spy.localhost); // Returns `http://localhost:####`Easily get absolute values about your panel/environment regardless of OS:
const spy = require("cep-spy").default;
console.log(spy.path.root); // Returns 'C:/Users/.../[your-panel-root]'
console.log(spy.extVersion); // Returns '1.0.0', as defined in manifest.xml
console.log(spy.isDev); // Returns BOOL true if bombino and while hot reloading
console.log(spy.appName); // Returns 'ILST' or current <HostList> param of host appSpy on all your colleagues:
import spy from "cep-spy";
let siblings = spy.getAllExtensions();
console.log(siblings);
API
Static values
path.rootSTRING: The absolute path (pre-treated) of the current extensionpath.userDataSTRING: The absolute path (pre-treated) to CS'suserDatapath.commonFilesSTRING: The absolute path (pre-treated) to CS'scommonFilespath.myDocumentsSTRING: The absolute path (pre-treated) to CS'smyDocumentspath.hostApplicationSTRING: The absolute path (pre-treated) to the app'shostApplicationexecutablepackageOBJECT: The JSON-parsed contents of the panel's rootpackage.jsonfileextIDSTRING:idof the current extension as seen in manifest.xml (egcom.adobe.panel)authorSTRING/OBJECT: Returns theauthorparameter ofpackage.json, either as a string or an Object withname,email, andurlkey-values.extNameSTRING: Proper name as displayed in Menu of the current extensionextVersionSTRING: The major, minor, micro versioning of the extension (eg1.x.x) in manifest.xmlextOBJECT: Object containing CSInterface data for current extension (height, mainPath, width, windowType, etc.)localhostSTRING: The direct URL including"https://localhost:"of the current extensionisDevBOOL: True if extension"sdocument.locationcontains"localhost"(if bombino panel during hot reload for development)appNameSTRING: The 4-letter app identifier from<HostList>(eg"ILST","AEFT")appLocaleSTRING: The language/region locale identifier (eg"en_US")appVersionSTRING: The major/minor/micro of the host app (eg24.0.0)userAgentSTRING: If OS isWindowsorMaccepVersionSTRING: The major/minor/micro of CEP enginehostCapabilitiesOBJECT: The extended parameters for host under the same name in CSInterfaceuserIdSTRING:CSInterface.getCurrentImsUserId()wrapper (returns null often)extsARRAY: Array of all CEP extensions (as objects with base data) in current host app.
Functions
getAllExtensions(): Returns array of all extension data including version from each manifest.xmlgetExtData(id): Returns extension data object of matchingidopenExtension(ext): Requests a given extension launch by extension data objectgetVersion(ext): Returns a major/minor/micro from given extension data objectlaunchLocalhost(): Launches any given localhost or the current extension's localhost if nonelaunchHomepage(): Launches the homepage given inpackage.json'shomepageattributelaunchGitRepo(): Launches the GitHub repo link given inpackage.json'srepositoryattribute
1.3.4
5 years ago
1.3.3
5 years ago
1.3.1
5 years ago
1.3.0
5 years ago
1.2.9
5 years ago
1.2.8
5 years ago
1.2.7
5 years ago
1.2.6
5 years ago
1.2.5
5 years ago
1.2.4
5 years ago
1.2.3
5 years ago
1.2.2
5 years ago
1.2.0
5 years ago
1.2.1
5 years ago
1.1.4
5 years ago
1.1.3
5 years ago
1.1.2
5 years ago
1.1.11
6 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.0.0
6 years ago