@hubspot/ui-extensions-dev-server 0.8.46 → 0.8.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/DevModeInterface.d.ts +1 -2
- package/dist/lib/DevModeInterface.js +0 -52
- package/dist/lib/DevModeParentInterface.d.ts +1 -1
- package/dist/lib/DevModeParentInterface.js +66 -0
- package/dist/lib/DevModeUnifiedInterface.d.ts +1 -12
- package/dist/lib/DevModeUnifiedInterface.js +20 -75
- package/dist/lib/types.d.ts +26 -15
- package/dist/lib/types.js +11 -0
- package/package.json +3 -3
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { ProjectComponentMap, AppExtensionMapping,
|
|
1
|
+
import { ProjectComponentMap, AppExtensionMapping, DevModeSetupArguments } from './types';
|
|
2
2
|
import { DevModeParentInterface } from './DevModeParentInterface';
|
|
3
3
|
declare class DevModeInterface extends DevModeParentInterface {
|
|
4
4
|
_generateAppExtensionMappings(components: ProjectComponentMap): AppExtensionMapping[];
|
|
5
5
|
setup(args: DevModeSetupArguments): Promise<void>;
|
|
6
|
-
start({ requestPorts, accountId, projectConfig, }: DevModeStartArguments): Promise<void>;
|
|
7
6
|
}
|
|
8
7
|
export { DevModeInterface as DevModeInterfaceNonSingleton };
|
|
9
8
|
declare const _default: DevModeInterface;
|
|
@@ -12,10 +12,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.DevModeInterfaceNonSingleton = void 0;
|
|
15
|
-
const dev_1 = require("./dev");
|
|
16
15
|
const constants_1 = require("./constants");
|
|
17
16
|
const config_1 = require("./config");
|
|
18
|
-
const DevServerState_1 = require("./DevServerState");
|
|
19
17
|
const DevModeParentInterface_1 = require("./DevModeParentInterface");
|
|
20
18
|
class DevModeInterface extends DevModeParentInterface_1.DevModeParentInterface {
|
|
21
19
|
_generateAppExtensionMappings(components) {
|
|
@@ -49,56 +47,6 @@ class DevModeInterface extends DevModeParentInterface_1.DevModeParentInterface {
|
|
|
49
47
|
yield this.parentSetup(args);
|
|
50
48
|
});
|
|
51
49
|
}
|
|
52
|
-
start({ requestPorts, accountId, projectConfig, }) {
|
|
53
|
-
var _a, _b, _c, _d;
|
|
54
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
this.logger.debug('Start function was invoked', {
|
|
56
|
-
accountId,
|
|
57
|
-
projectConfig,
|
|
58
|
-
});
|
|
59
|
-
if (this.isRunning) {
|
|
60
|
-
this.logger.debug('Dev server is already running, not starting again');
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
let expressPort = constants_1.EXPRESS_DEFAULT_PORT;
|
|
64
|
-
let webSocketPort = constants_1.WEBSOCKET_DEFAULT_PORT;
|
|
65
|
-
if (requestPorts) {
|
|
66
|
-
try {
|
|
67
|
-
const portData = yield requestPorts([
|
|
68
|
-
{ instanceId: constants_1.EXPRESS_SERVER_ID, port: constants_1.EXPRESS_DEFAULT_PORT },
|
|
69
|
-
{ instanceId: constants_1.VITE_DEV_SERVER_ID, port: constants_1.WEBSOCKET_DEFAULT_PORT },
|
|
70
|
-
]);
|
|
71
|
-
expressPort = portData[constants_1.EXPRESS_SERVER_ID];
|
|
72
|
-
webSocketPort = portData[constants_1.VITE_DEV_SERVER_ID];
|
|
73
|
-
}
|
|
74
|
-
catch (e) {
|
|
75
|
-
if ((e === null || e === void 0 ? void 0 : e.status) === 409) {
|
|
76
|
-
throw new Error('Another instance is already running. To proceed, please stop the existing server and try again.');
|
|
77
|
-
}
|
|
78
|
-
this.logger.debug('Call to port manager failed, using default ports');
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
const { proxy: localDevUrlMapping } = (0, config_1.loadLocalConfig)(((_b = (_a = this.configs) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.path) || '', this.logger) || {};
|
|
82
|
-
this.devServerState = new DevServerState_1.DevServerState({
|
|
83
|
-
localDevUrlMapping,
|
|
84
|
-
extensionConfigs: this.configs,
|
|
85
|
-
accountId,
|
|
86
|
-
platformVersion: this._getPlatformVersion(projectConfig),
|
|
87
|
-
expressPort,
|
|
88
|
-
webSocketPort,
|
|
89
|
-
logger: this.logger,
|
|
90
|
-
urls: this.urls,
|
|
91
|
-
appConfig: (_d = (_c = this.configs) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.appConfig,
|
|
92
|
-
});
|
|
93
|
-
this.shutdown = yield (0, dev_1.startDevMode)(this.devServerState);
|
|
94
|
-
const { extensionsMetadata } = this.devServerState;
|
|
95
|
-
extensionsMetadata.forEach((metadata) => {
|
|
96
|
-
const { config: { data: { title, appName }, }, } = metadata;
|
|
97
|
-
this.logger.info(`Running extension '${title}' from app '${appName}'`);
|
|
98
|
-
});
|
|
99
|
-
this.isRunning = true;
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
50
|
}
|
|
103
51
|
exports.DevModeInterfaceNonSingleton = DevModeInterface;
|
|
104
52
|
exports.default = new DevModeInterface();
|
|
@@ -9,11 +9,11 @@ export declare abstract class DevModeParentInterface {
|
|
|
9
9
|
isConfigured?: boolean;
|
|
10
10
|
isRunning?: boolean;
|
|
11
11
|
shutdown?: () => Promise<void>;
|
|
12
|
-
protected abstract start(args: DevModeStartArguments): Promise<void>;
|
|
13
12
|
protected abstract _generateAppExtensionMappings(components: ProjectComponentMap | UnifiedProjectComponentMap): AppExtensionMapping[];
|
|
14
13
|
_getPlatformVersion(projectConfig?: ProjectConfig): PlatformVersion;
|
|
15
14
|
_reset(): void;
|
|
16
15
|
parentSetup({ onUploadRequired, promptUser, logger, urls, setActiveApp, choices, }: DevModeBaseSetupArguments): Promise<void>;
|
|
16
|
+
start({ requestPorts, accountId, projectConfig, }: DevModeStartArguments): Promise<void>;
|
|
17
17
|
fileChange(filePath: string, __event: unknown): Promise<void>;
|
|
18
18
|
cleanup(): Promise<void>;
|
|
19
19
|
}
|
|
@@ -11,7 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.DevModeParentInterface = void 0;
|
|
13
13
|
const constants_1 = require("./constants");
|
|
14
|
+
const dev_1 = require("./dev");
|
|
15
|
+
const config_1 = require("./config");
|
|
16
|
+
const constants_2 = require("./constants");
|
|
14
17
|
const utils_1 = require("./utils");
|
|
18
|
+
const DevServerState_1 = require("./DevServerState");
|
|
15
19
|
const defaultLogger = {
|
|
16
20
|
info: (...args) => {
|
|
17
21
|
console.log(...args);
|
|
@@ -97,6 +101,68 @@ class DevModeParentInterface {
|
|
|
97
101
|
}
|
|
98
102
|
});
|
|
99
103
|
}
|
|
104
|
+
start({ requestPorts, accountId, projectConfig, }) {
|
|
105
|
+
var _a, _b, _c, _d;
|
|
106
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
+
this.logger.debug('Start function was invoked', {
|
|
108
|
+
accountId,
|
|
109
|
+
projectConfig,
|
|
110
|
+
});
|
|
111
|
+
if (this.isRunning) {
|
|
112
|
+
this.logger.debug('Dev server is already running, not starting again');
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
let expressPort = constants_2.EXPRESS_DEFAULT_PORT;
|
|
116
|
+
let webSocketPort = constants_2.WEBSOCKET_DEFAULT_PORT;
|
|
117
|
+
if (requestPorts) {
|
|
118
|
+
try {
|
|
119
|
+
const portData = yield requestPorts([
|
|
120
|
+
{ instanceId: constants_2.EXPRESS_SERVER_ID, port: constants_2.EXPRESS_DEFAULT_PORT },
|
|
121
|
+
{ instanceId: constants_2.VITE_DEV_SERVER_ID, port: constants_2.WEBSOCKET_DEFAULT_PORT },
|
|
122
|
+
]);
|
|
123
|
+
expressPort = portData[constants_2.EXPRESS_SERVER_ID];
|
|
124
|
+
webSocketPort = portData[constants_2.VITE_DEV_SERVER_ID];
|
|
125
|
+
}
|
|
126
|
+
catch (e) {
|
|
127
|
+
if ((e === null || e === void 0 ? void 0 : e.status) === 409) {
|
|
128
|
+
throw new Error('Another instance is already running. To proceed, please stop the existing server and try again.');
|
|
129
|
+
}
|
|
130
|
+
this.logger.debug('Call to port manager failed, using default ports');
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
const { proxy: localDevUrlMapping } = (0, config_1.loadLocalConfig)(((_b = (_a = this.configs) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.path) || '', this.logger) || {};
|
|
134
|
+
try {
|
|
135
|
+
this.devServerState = new DevServerState_1.DevServerState({
|
|
136
|
+
localDevUrlMapping,
|
|
137
|
+
extensionConfigs: this.configs,
|
|
138
|
+
accountId,
|
|
139
|
+
platformVersion: this._getPlatformVersion(projectConfig),
|
|
140
|
+
expressPort,
|
|
141
|
+
webSocketPort,
|
|
142
|
+
logger: this.logger,
|
|
143
|
+
urls: this.urls,
|
|
144
|
+
appConfig: (_d = (_c = this.configs) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.appConfig,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
catch (e) {
|
|
148
|
+
this.logger.debug('Error setting up DevServerState', e);
|
|
149
|
+
throw e;
|
|
150
|
+
}
|
|
151
|
+
try {
|
|
152
|
+
this.shutdown = yield (0, dev_1.startDevMode)(this.devServerState);
|
|
153
|
+
}
|
|
154
|
+
catch (e) {
|
|
155
|
+
this.logger.debug('Error starting dev mode', e);
|
|
156
|
+
throw e;
|
|
157
|
+
}
|
|
158
|
+
const { extensionsMetadata } = this.devServerState;
|
|
159
|
+
extensionsMetadata.forEach((metadata) => {
|
|
160
|
+
const { config: { data: { title, appName }, }, } = metadata;
|
|
161
|
+
this.logger.info(`Running extension '${title}' from app '${appName}'`);
|
|
162
|
+
});
|
|
163
|
+
this.isRunning = true;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
100
166
|
// The contract is for this to be async, so eslint can chill
|
|
101
167
|
// eslint-disable-next-line require-await
|
|
102
168
|
fileChange(filePath, __event) {
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AppExtensionMapping, UnifiedProjectComponentMap, UnifiedDevModeSetupArguments } from './types';
|
|
2
2
|
import { DevModeParentInterface } from './DevModeParentInterface';
|
|
3
|
-
interface StartArguments {
|
|
4
|
-
accountId?: number;
|
|
5
|
-
requestPorts?: (requestPortsData: Array<{
|
|
6
|
-
instanceId: string;
|
|
7
|
-
port?: number;
|
|
8
|
-
}>) => Promise<{
|
|
9
|
-
[instanceId: string]: number;
|
|
10
|
-
}>;
|
|
11
|
-
projectConfig?: ProjectConfig;
|
|
12
|
-
}
|
|
13
3
|
declare class DevModeUnifiedInterface extends DevModeParentInterface {
|
|
14
4
|
_generateAppExtensionMappings(components: UnifiedProjectComponentMap): AppExtensionMapping[];
|
|
15
5
|
setup(args: UnifiedDevModeSetupArguments): Promise<void>;
|
|
16
|
-
start({ requestPorts, accountId, projectConfig }: StartArguments): Promise<void>;
|
|
17
6
|
}
|
|
18
7
|
export { DevModeUnifiedInterface as DevModeUnifiedInterfaceNonSingleton };
|
|
19
8
|
declare const _default: DevModeUnifiedInterface;
|
|
@@ -16,28 +16,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.DevModeUnifiedInterfaceNonSingleton = void 0;
|
|
18
18
|
const path_1 = __importDefault(require("path"));
|
|
19
|
-
const dev_1 = require("./dev");
|
|
20
19
|
const constants_1 = require("./constants");
|
|
21
|
-
const
|
|
22
|
-
const DevServerState_1 = require("./DevServerState");
|
|
20
|
+
const types_1 = require("./types");
|
|
23
21
|
const DevModeParentInterface_1 = require("./DevModeParentInterface");
|
|
24
22
|
const utils_1 = require("./utils");
|
|
25
23
|
class DevModeUnifiedInterface extends DevModeParentInterface_1.DevModeParentInterface {
|
|
26
24
|
_generateAppExtensionMappings(components) {
|
|
27
25
|
var _a, _b, _c, _d;
|
|
28
26
|
const mappings = [];
|
|
29
|
-
// Loop over all of the
|
|
27
|
+
// Loop over all of the components that are passed in
|
|
30
28
|
const allComponentUids = Object.keys(components);
|
|
31
|
-
//
|
|
29
|
+
// Find the app component
|
|
32
30
|
const appUid = allComponentUids.find((componentUid) => {
|
|
33
|
-
return components[componentUid].componentType ===
|
|
31
|
+
return (components[componentUid].componentType ===
|
|
32
|
+
types_1.UnifiedComponentTypes.APPLICATION);
|
|
34
33
|
});
|
|
35
|
-
//
|
|
34
|
+
// This should fail a lot sooner (on the cli side), but added this just in case.
|
|
36
35
|
if (!appUid) {
|
|
36
|
+
this.logger.error('Application configuration is missing.');
|
|
37
37
|
return mappings;
|
|
38
38
|
}
|
|
39
39
|
const appData = components[appUid];
|
|
40
|
-
// Use the app data to generate the app config in the expected shape.
|
|
40
|
+
// Use the app data to generate the app config in the expected shape, to match old projects.
|
|
41
41
|
const appConfig = {
|
|
42
42
|
name: appData.config.name,
|
|
43
43
|
description: (_a = appData.config) === null || _a === void 0 ? void 0 : _a.description,
|
|
@@ -63,22 +63,21 @@ class DevModeUnifiedInterface extends DevModeParentInterface_1.DevModeParentInte
|
|
|
63
63
|
// Build the extension mapping data
|
|
64
64
|
extensionUids.forEach((extensionUid) => {
|
|
65
65
|
const extension = components[extensionUid];
|
|
66
|
+
// Update the extension entrypoint to be "relative" to the extension directory (eg from /app/card/card.jsx to ./card.jsx)
|
|
67
|
+
extension.config.entrypoint = `./${path_1.default.basename(extension.config.entrypoint)}`;
|
|
66
68
|
// Add them to the app config
|
|
67
69
|
switch (extension.componentType) {
|
|
68
|
-
case
|
|
70
|
+
case types_1.UnifiedComponentTypes.CARD:
|
|
69
71
|
default:
|
|
70
72
|
appConfig.extensions.crm.cards.push({
|
|
71
73
|
file: extension.config.entrypoint,
|
|
72
74
|
});
|
|
73
75
|
}
|
|
74
|
-
// Generate the name
|
|
76
|
+
// Generate the name and other extension data for the mapping.
|
|
75
77
|
const extensionName = `${appData.config.name}/${extension.config.name}`;
|
|
76
|
-
// Transform the type from a format like CRM_CARD to crm-card
|
|
77
|
-
const extensionType = extension.componentType
|
|
78
|
-
.toLowerCase()
|
|
79
|
-
.replace('_', '-');
|
|
80
78
|
const extensionOutput = (0, utils_1.getUrlSafeFileName)(path_1.default.resolve(extension.localDev.componentRoot, extension.config.entrypoint));
|
|
81
79
|
const filePath = path_1.default.resolve(extension.localDev.componentRoot, extension.config.entrypoint);
|
|
80
|
+
// Build the config in the correct shape
|
|
82
81
|
const extensionData = {
|
|
83
82
|
title: extension.config.name,
|
|
84
83
|
uid: extension.uid,
|
|
@@ -91,15 +90,17 @@ class DevModeUnifiedInterface extends DevModeParentInterface_1.DevModeParentInte
|
|
|
91
90
|
sourceId: `${appConfig.uid}::${extension.uid}`,
|
|
92
91
|
};
|
|
93
92
|
// Generate object types
|
|
94
|
-
extension.config.objectTypes
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
if (extension.config.objectTypes) {
|
|
94
|
+
extension.config.objectTypes.forEach((objectType) => {
|
|
95
|
+
extensionData.objectTypes.push({
|
|
96
|
+
name: objectType,
|
|
97
|
+
});
|
|
97
98
|
});
|
|
98
|
-
}
|
|
99
|
+
}
|
|
99
100
|
mappings.push({
|
|
100
101
|
name: extensionName,
|
|
101
102
|
value: {
|
|
102
|
-
type:
|
|
103
|
+
type: extension.componentType.toLowerCase(),
|
|
103
104
|
data: extensionData,
|
|
104
105
|
output: extensionOutput,
|
|
105
106
|
path: appData.localDev.componentRoot,
|
|
@@ -117,62 +118,6 @@ class DevModeUnifiedInterface extends DevModeParentInterface_1.DevModeParentInte
|
|
|
117
118
|
yield this.parentSetup(args);
|
|
118
119
|
});
|
|
119
120
|
}
|
|
120
|
-
start({ requestPorts, accountId, projectConfig }) {
|
|
121
|
-
var _a, _b, _c, _d;
|
|
122
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
-
this.logger.debug('Start function was invoked', {
|
|
124
|
-
accountId,
|
|
125
|
-
projectConfig,
|
|
126
|
-
});
|
|
127
|
-
if (this.isRunning) {
|
|
128
|
-
this.logger.debug('Dev server is already running, not starting again');
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
let expressPort = constants_1.EXPRESS_DEFAULT_PORT;
|
|
132
|
-
let webSocketPort = constants_1.WEBSOCKET_DEFAULT_PORT;
|
|
133
|
-
if (requestPorts) {
|
|
134
|
-
try {
|
|
135
|
-
const portData = yield requestPorts([
|
|
136
|
-
{ instanceId: constants_1.EXPRESS_SERVER_ID, port: constants_1.EXPRESS_DEFAULT_PORT },
|
|
137
|
-
{ instanceId: constants_1.VITE_DEV_SERVER_ID, port: constants_1.WEBSOCKET_DEFAULT_PORT },
|
|
138
|
-
]);
|
|
139
|
-
expressPort = portData[constants_1.EXPRESS_SERVER_ID];
|
|
140
|
-
webSocketPort = portData[constants_1.VITE_DEV_SERVER_ID];
|
|
141
|
-
}
|
|
142
|
-
catch (e) {
|
|
143
|
-
if ((e === null || e === void 0 ? void 0 : e.status) === 409) {
|
|
144
|
-
throw new Error('Another instance is already running. To proceed, please stop the existing server and try again.');
|
|
145
|
-
}
|
|
146
|
-
this.logger.debug('Call to port manager failed, using default ports');
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
const { proxy: localDevUrlMapping } = (0, config_1.loadLocalConfig)(((_b = (_a = this.configs) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.path) || '', this.logger) || {};
|
|
150
|
-
try {
|
|
151
|
-
this.devServerState = new DevServerState_1.DevServerState({
|
|
152
|
-
localDevUrlMapping,
|
|
153
|
-
extensionConfigs: this.configs,
|
|
154
|
-
accountId,
|
|
155
|
-
platformVersion: this._getPlatformVersion(projectConfig),
|
|
156
|
-
expressPort,
|
|
157
|
-
webSocketPort,
|
|
158
|
-
logger: this.logger,
|
|
159
|
-
urls: this.urls,
|
|
160
|
-
appConfig: (_d = (_c = this.configs) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.appConfig,
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
catch (e) {
|
|
164
|
-
this.logger.error('Error setting up DevServerState', e);
|
|
165
|
-
throw e;
|
|
166
|
-
}
|
|
167
|
-
this.shutdown = yield (0, dev_1.startDevMode)(this.devServerState);
|
|
168
|
-
const { extensionsMetadata } = this.devServerState;
|
|
169
|
-
extensionsMetadata.forEach((metadata) => {
|
|
170
|
-
const { config: { data: { title, appName }, }, } = metadata;
|
|
171
|
-
this.logger.info(`Running extension '${title}' from app '${appName}'`);
|
|
172
|
-
});
|
|
173
|
-
this.isRunning = true;
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
121
|
}
|
|
177
122
|
exports.DevModeUnifiedInterfaceNonSingleton = DevModeUnifiedInterface;
|
|
178
123
|
exports.default = new DevModeUnifiedInterface();
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -70,12 +70,16 @@ export interface PublicAppAuth {
|
|
|
70
70
|
optionalScopes: string[];
|
|
71
71
|
additionalScopes: string[];
|
|
72
72
|
}
|
|
73
|
+
export declare enum UnifiedAppAuthTypes {
|
|
74
|
+
OAUTH = "OAUTH",
|
|
75
|
+
STATIC = "STATIC"
|
|
76
|
+
}
|
|
73
77
|
export interface UnifiedAppAuth {
|
|
74
|
-
type:
|
|
75
|
-
redirectUrls
|
|
76
|
-
requiredScopes
|
|
77
|
-
optionalScopes
|
|
78
|
-
conditionallyRequiredScopes
|
|
78
|
+
type: UnifiedAppAuthTypes;
|
|
79
|
+
redirectUrls?: string[];
|
|
80
|
+
requiredScopes?: string[];
|
|
81
|
+
optionalScopes?: string[];
|
|
82
|
+
conditionallyRequiredScopes?: string[];
|
|
79
83
|
}
|
|
80
84
|
export type AppAuth = PublicAppAuth | UnifiedAppAuth;
|
|
81
85
|
export interface PublicAppConfig {
|
|
@@ -109,20 +113,27 @@ export interface ProjectComponent {
|
|
|
109
113
|
export interface ProjectComponentMap {
|
|
110
114
|
[key: string]: ProjectComponent;
|
|
111
115
|
}
|
|
112
|
-
export
|
|
116
|
+
export type UnifiedCardConfig = {
|
|
113
117
|
uid: string;
|
|
118
|
+
type: 'card';
|
|
114
119
|
config: {
|
|
115
120
|
name: string;
|
|
116
|
-
description
|
|
121
|
+
description?: string;
|
|
117
122
|
location: string;
|
|
118
123
|
entrypoint: string;
|
|
119
|
-
objectTypes
|
|
120
|
-
previewImage
|
|
124
|
+
objectTypes?: string[];
|
|
125
|
+
previewImage?: {
|
|
121
126
|
file: string;
|
|
122
127
|
altText: string;
|
|
123
128
|
};
|
|
124
129
|
};
|
|
125
|
-
|
|
130
|
+
};
|
|
131
|
+
export declare enum UnifiedComponentTypes {
|
|
132
|
+
CARD = "CARD",
|
|
133
|
+
APPLICATION = "APPLICATION"
|
|
134
|
+
}
|
|
135
|
+
export type UnifiedExtensionComponent = Omit<UnifiedCardConfig, 'type'> & {
|
|
136
|
+
componentType: UnifiedComponentTypes.CARD;
|
|
126
137
|
componentDeps: {
|
|
127
138
|
app: string;
|
|
128
139
|
};
|
|
@@ -132,27 +143,27 @@ export interface UnifiedExtensionComponent {
|
|
|
132
143
|
componentRoot: string;
|
|
133
144
|
componentConfigPath: string;
|
|
134
145
|
};
|
|
135
|
-
}
|
|
146
|
+
};
|
|
136
147
|
export interface UnifiedAppComponent {
|
|
137
148
|
uid: string;
|
|
138
149
|
config: {
|
|
139
150
|
description: string;
|
|
140
151
|
name: string;
|
|
141
|
-
logo
|
|
152
|
+
logo?: string;
|
|
142
153
|
auth: UnifiedAppAuth;
|
|
143
|
-
permittedUrls
|
|
154
|
+
permittedUrls?: {
|
|
144
155
|
fetch: string[];
|
|
145
156
|
iframe: string[];
|
|
146
157
|
img: string[];
|
|
147
158
|
};
|
|
148
|
-
support
|
|
159
|
+
support?: {
|
|
149
160
|
supportEmail: string;
|
|
150
161
|
documentationUrl: string;
|
|
151
162
|
supportUrl: string;
|
|
152
163
|
supportPhone: string;
|
|
153
164
|
};
|
|
154
165
|
};
|
|
155
|
-
componentType:
|
|
166
|
+
componentType: UnifiedComponentTypes.APPLICATION;
|
|
156
167
|
componentDeps: {};
|
|
157
168
|
metaFilePath: string;
|
|
158
169
|
files: {};
|
package/dist/lib/types.js
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnifiedComponentTypes = exports.UnifiedAppAuthTypes = void 0;
|
|
4
|
+
var UnifiedAppAuthTypes;
|
|
5
|
+
(function (UnifiedAppAuthTypes) {
|
|
6
|
+
UnifiedAppAuthTypes["OAUTH"] = "OAUTH";
|
|
7
|
+
UnifiedAppAuthTypes["STATIC"] = "STATIC";
|
|
8
|
+
})(UnifiedAppAuthTypes || (exports.UnifiedAppAuthTypes = UnifiedAppAuthTypes = {}));
|
|
9
|
+
var UnifiedComponentTypes;
|
|
10
|
+
(function (UnifiedComponentTypes) {
|
|
11
|
+
UnifiedComponentTypes["CARD"] = "CARD";
|
|
12
|
+
UnifiedComponentTypes["APPLICATION"] = "APPLICATION";
|
|
13
|
+
})(UnifiedComponentTypes || (exports.UnifiedComponentTypes = UnifiedComponentTypes = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/ui-extensions-dev-server",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.47",
|
|
4
4
|
"description": "",
|
|
5
5
|
"bin": {
|
|
6
6
|
"uie": "./dist/lib/bin/cli.js"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@hubspot/app-functions-dev-server": "0.8.
|
|
30
|
+
"@hubspot/app-functions-dev-server": "0.8.47",
|
|
31
31
|
"chalk": "5.4.1",
|
|
32
32
|
"commander": "13.0.0",
|
|
33
33
|
"cors": "2.8.5",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"optional": true
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "6aa0e60d7241a0218512617a5126df688f8fb894"
|
|
73
73
|
}
|