Socket
Socket
Sign inDemoInstall

@outreach/extensibility-sdk

Package Overview
Dependencies
Maintainers
197
Versions
180
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@outreach/extensibility-sdk - npm Package Compare versions

Comparing version 0.3.8 to 0.3.9

1

dist/index.js

@@ -148,2 +148,3 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {

__exportStar(require("./manifest/extensions/tiles/TileExtension"), exports);
__exportStar(require("./legacy/Translator"), exports);
var Task = /** @class */ (function () {

@@ -150,0 +151,0 @@ function Task() {

332

dist/legacy/translator.js
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAppManifest = exports.getAddonManifest = void 0;
exports.Translator = void 0;
var AccountContextKeys_1 = require("../context/keys/AccountContextKeys");

@@ -17,173 +17,177 @@ var OpportunityContextKeys_1 = require("../context/keys/OpportunityContextKeys");

var Locale_1 = require("../sdk/Locale");
var getAddonManifest = function (app, ext) {
var _a;
var manifestType = null;
switch (ext.type) {
case ShellExtensionType_1.ShellExtensionType.APPLICATION:
manifestType = 'left-side-menu';
break;
case TabExtensionType_1.TabExtensionType.ACCOUNT:
manifestType = 'tab-account';
break;
case TabExtensionType_1.TabExtensionType.PROSPECT:
manifestType = 'tab-prospect';
break;
case TabExtensionType_1.TabExtensionType.OPPORTUNITY:
manifestType = 'tab-opportunity';
break;
var Translator = /** @class */ (function () {
function Translator() {
}
if (!manifestType) {
console.error('Unsupported addon manifest for:', { app: app, ext: ext });
return null;
}
var manifestStore = null;
switch (app.store.type) {
case StoreType_1.StoreType.PRIVATE:
manifestStore = 'personal';
break;
case StoreType_1.StoreType.INTERNAL:
manifestStore = 'private';
break;
case StoreType_1.StoreType.PUBLIC:
manifestStore = 'public';
break;
}
if (!manifestStore) {
console.error('Unsupported addon manifest store for:', { app: app, ext: ext });
return null;
}
var appExt = ext.type === ShellExtensionType_1.ShellExtensionType.APPLICATION;
var tabExt = ext.type === TabExtensionType_1.TabExtensionType.ACCOUNT ||
ext.type === TabExtensionType_1.TabExtensionType.PROSPECT ||
ext.type === TabExtensionType_1.TabExtensionType.OPPORTUNITY;
var manifestV1 = {
author: app.store.author,
categories: ((_a = app.store.categories) === null || _a === void 0 ? void 0 : _a.map(function (p) { return p.toString(); })) || [],
configuration: app.configuration || [],
context: ext.context.map(function (c) { return c.toString(); }),
description: app.store.description,
host: {
icon: ext.host.icon,
url: ext.host.url,
notificationsUrl: appExt ? ext.host.notificationsUrl || '' : '',
type: manifestType,
environment: {
fullWidth: tabExt ? ext.fullWidth : true,
decoration: appExt ? ext.host.decoration : 'none',
Translator.getAddonManifest = function (app, ext) {
var _a;
var manifestType = null;
switch (ext.type) {
case ShellExtensionType_1.ShellExtensionType.APPLICATION:
manifestType = 'left-side-menu';
break;
case TabExtensionType_1.TabExtensionType.ACCOUNT:
manifestType = 'tab-account';
break;
case TabExtensionType_1.TabExtensionType.PROSPECT:
manifestType = 'tab-prospect';
break;
case TabExtensionType_1.TabExtensionType.OPPORTUNITY:
manifestType = 'tab-opportunity';
break;
}
if (!manifestType) {
console.error('Unsupported addon manifest for:', { app: app, ext: ext });
return null;
}
var manifestStore = null;
switch (app.store.type) {
case StoreType_1.StoreType.PRIVATE:
manifestStore = 'personal';
break;
case StoreType_1.StoreType.INTERNAL:
manifestStore = 'private';
break;
case StoreType_1.StoreType.PUBLIC:
manifestStore = 'public';
break;
}
if (!manifestStore) {
console.error('Unsupported addon manifest store for:', { app: app, ext: ext });
return null;
}
var appExt = ext.type === ShellExtensionType_1.ShellExtensionType.APPLICATION;
var tabExt = ext.type === TabExtensionType_1.TabExtensionType.ACCOUNT ||
ext.type === TabExtensionType_1.TabExtensionType.PROSPECT ||
ext.type === TabExtensionType_1.TabExtensionType.OPPORTUNITY;
var manifestV1 = {
author: app.store.author,
categories: ((_a = app.store.categories) === null || _a === void 0 ? void 0 : _a.map(function (p) { return p.toString(); })) || [],
configuration: app.configuration || [],
context: ext.context.map(function (c) { return c.toString(); }),
description: app.store.description,
host: {
icon: ext.host.icon,
url: ext.host.url,
notificationsUrl: appExt ? ext.host.notificationsUrl || '' : '',
type: manifestType,
environment: {
fullWidth: tabExt ? ext.fullWidth : true,
decoration: appExt ? ext.host.decoration : 'none',
},
},
},
identifier: ext.identifier,
store: manifestStore,
title: app.store.title,
version: app.store.version,
api: app.api,
medias: app.store.medias,
identifier: ext.identifier,
store: manifestStore,
title: app.store.title,
version: app.store.version,
api: app.api,
medias: app.store.medias,
};
return manifestV1;
};
return manifestV1;
};
exports.getAddonManifest = getAddonManifest;
/**
* Converts collection of addon "v1" manifests to
* a single application "v2" application.
*
* @param {ManifestV1[]} appManifests
* @return {*} {(Application | null)}
*/
var getAppManifest = function (appManifests) {
var _a;
if (appManifests.length === 0) {
return null;
}
var firstExt = appManifests[0];
var storeType = StoreType_1.StoreType.PRIVATE;
if (firstExt.store === 'private') {
storeType = StoreType_1.StoreType.INTERNAL;
}
else if (firstExt.store === 'public') {
storeType = StoreType_1.StoreType.PUBLIC;
}
var app = {
store: {
author: {
company: firstExt.author.company,
email: 'no@email.com',
privacyUrl: firstExt.author.privacyUrl,
termsOfUseUrl: firstExt.author.termsOfUseUrl,
websiteUrl: firstExt.author.websiteUrl,
/**
* Converts collection of addon "v1" manifests to
* a single application "v2" application.
*
* @param {ManifestV1[]} appManifests
* @return {*} {(Application | null)}
*/
Translator.getAppManifest = function (appManifests) {
var _a;
if (appManifests.length === 0) {
return null;
}
var firstExt = appManifests[0];
var storeType = StoreType_1.StoreType.PRIVATE;
if (firstExt.store === 'private') {
storeType = StoreType_1.StoreType.INTERNAL;
}
else if (firstExt.store === 'public') {
storeType = StoreType_1.StoreType.PUBLIC;
}
var app = {
store: {
author: {
company: firstExt.author.company,
email: 'no@email.com',
privacyUrl: firstExt.author.privacyUrl,
termsOfUseUrl: firstExt.author.termsOfUseUrl,
websiteUrl: firstExt.author.websiteUrl,
},
categories: ((_a = firstExt.categories) === null || _a === void 0 ? void 0 : _a.map(function (ctg) { return Category_1.Category[ctg]; })) || [],
description: firstExt.description,
icon: firstExt.host.icon,
identifier: firstExt.identifier,
medias: firstExt.medias,
locales: [Locale_1.Locale.ENGLISH],
headline: firstExt.title,
title: firstExt.title,
version: firstExt.version,
type: storeType,
},
categories: ((_a = firstExt.categories) === null || _a === void 0 ? void 0 : _a.map(function (ctg) { return Category_1.Category[ctg]; })) || [],
description: firstExt.description,
icon: firstExt.host.icon,
identifier: firstExt.identifier,
medias: firstExt.medias,
locales: [Locale_1.Locale.ENGLISH],
headline: firstExt.title,
title: firstExt.title,
version: firstExt.version,
type: storeType,
},
extensions: [],
api: firstExt.api,
configuration: firstExt.configuration,
};
appManifests.forEach(function (ext) {
var _a;
if (ext.host.type === 'left-side-menu') {
var extension = new ApplicationShellExtension_1.ApplicationShellExtension();
extension.title = ext.title;
extension.identifier = ext.identifier;
extension.host = new ShellExtensionHost_1.ShellExtensionHost();
extension.host.icon = ext.host.icon;
extension.host.url = ext.host.url;
extension.host.notificationsUrl = ext.host.notificationsUrl;
extension.host.decoration = DecorationStyle_1.DecorationStyle.FULL;
if (ext.host.environment) {
switch (ext.host.environment.decoration) {
case 'none':
extension.host.decoration = DecorationStyle_1.DecorationStyle.NONE;
extensions: [],
api: firstExt.api,
configuration: firstExt.configuration,
};
appManifests.forEach(function (ext) {
var _a;
if (ext.host.type === 'left-side-menu') {
var extension = new ApplicationShellExtension_1.ApplicationShellExtension();
extension.title = ext.title;
extension.identifier = ext.identifier;
extension.host = new ShellExtensionHost_1.ShellExtensionHost();
extension.host.icon = ext.host.icon;
extension.host.url = ext.host.url;
extension.host.notificationsUrl = ext.host.notificationsUrl;
extension.host.decoration = DecorationStyle_1.DecorationStyle.FULL;
if (ext.host.environment) {
switch (ext.host.environment.decoration) {
case 'none':
extension.host.decoration = DecorationStyle_1.DecorationStyle.NONE;
break;
case 'simple':
extension.host.decoration = DecorationStyle_1.DecorationStyle.SIMPLE;
break;
case 'full':
extension.host.decoration = DecorationStyle_1.DecorationStyle.FULL;
break;
}
}
app.extensions.push(extension);
}
else {
var extension = void 0;
switch (ext.host.type) {
case 'tab-account':
extension = new AccountTabExtension_1.AccountTabExtension();
break;
case 'simple':
extension.host.decoration = DecorationStyle_1.DecorationStyle.SIMPLE;
case 'tab-opportunity':
extension = new OpportunityTabExtension_1.OpportunityTabExtension();
break;
case 'full':
extension.host.decoration = DecorationStyle_1.DecorationStyle.FULL;
case 'tab-prospect':
extension = new ProspectTabExtension_1.ProspectTabExtension();
break;
default:
throw new Error('Unknown v1 host type:' + ext.host.type);
}
extension.identifier = ext.identifier;
extension.title = ext.title;
extension.description = ext.description;
extension.host = new ShellExtensionHost_1.ShellExtensionHost();
extension.host.icon = ext.host.icon;
extension.host.url = ext.host.url;
extension.fullWidth = ((_a = ext.host.environment) === null || _a === void 0 ? void 0 : _a.fullWidth) || false;
extension.context = ext.context.map(function (ctx) {
return AccountContextKeys_1.AccountContextKeys[ctx] ||
ProspectContextKeys_1.ProspectContextKeys[ctx] ||
OpportunityContextKeys_1.OpportunityContextKeys[ctx];
});
extension.version = ext.version;
app.extensions.push(extension);
}
app.extensions.push(extension);
}
else {
var extension = void 0;
switch (ext.host.type) {
case 'tab-account':
extension = new AccountTabExtension_1.AccountTabExtension();
break;
case 'tab-opportunity':
extension = new OpportunityTabExtension_1.OpportunityTabExtension();
break;
case 'tab-prospect':
extension = new ProspectTabExtension_1.ProspectTabExtension();
break;
default:
throw new Error('Unknown v1 host type:' + ext.host.type);
}
extension.identifier = ext.identifier;
extension.title = ext.title;
extension.description = ext.description;
extension.host = new ShellExtensionHost_1.ShellExtensionHost();
extension.host.icon = ext.host.icon;
extension.host.url = ext.host.url;
extension.fullWidth = ((_a = ext.host.environment) === null || _a === void 0 ? void 0 : _a.fullWidth) || false;
extension.context = ext.context.map(function (ctx) {
return AccountContextKeys_1.AccountContextKeys[ctx] ||
ProspectContextKeys_1.ProspectContextKeys[ctx] ||
OpportunityContextKeys_1.OpportunityContextKeys[ctx];
});
extension.version = ext.version;
app.extensions.push(extension);
}
});
return app;
};
exports.getAppManifest = getAppManifest;
//# sourceMappingURL=translator.js.map
});
return app;
};
return Translator;
}());
exports.Translator = Translator;
//# sourceMappingURL=Translator.js.map
{
"name": "@outreach/extensibility-sdk",
"license": "MIT",
"version": "0.3.8",
"version": "0.3.9",
"private": false,

@@ -6,0 +6,0 @@ "contributors": [

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc