@hubspot/ui-extensions-dev-server 1.1.5 → 1.1.7
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/DevServerState.d.ts +1 -1
- package/dist/lib/ExtensionsWebSocket.js +26 -2
- package/dist/lib/__tests__/ExtensionsWebSocket.spec.js +42 -8
- package/dist/lib/__tests__/app-functions/context.spec.d.ts +1 -0
- package/dist/lib/__tests__/app-functions/context.spec.js +101 -0
- package/dist/lib/__tests__/app-functions/errorReporter.spec.d.ts +1 -0
- package/dist/lib/__tests__/app-functions/errorReporter.spec.js +102 -0
- package/dist/lib/__tests__/app-functions/executor_v20231.spec.d.ts +1 -0
- package/dist/lib/__tests__/app-functions/executor_v20231.spec.js +168 -0
- package/dist/lib/__tests__/app-functions/executor_v20232.spec.d.ts +1 -0
- package/dist/lib/__tests__/app-functions/executor_v20232.spec.js +190 -0
- package/dist/lib/__tests__/app-functions/fixtures/constants.d.ts +18 -0
- package/dist/lib/__tests__/app-functions/fixtures/constants.js +139 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-async-fails.cjs +8 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-async-fails.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-async-succeeds.cjs +8 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-async-succeeds.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-callback-on-promise-rejected.cjs +8 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-callback-on-promise-rejected.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-callback-on-promise-resolved.cjs +8 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-callback-on-promise-resolved.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-does-not-export-main.cjs +4 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-does-not-export-main.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-echos-input.cjs +8 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-echos-input.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-logs.cjs +10 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-logs.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-returns-function.cjs +4 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-returns-function.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-returns-promise-rejected.cjs +7 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-returns-promise-rejected.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-returns-promise-resolved.cjs +7 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-returns-promise-resolved.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-returns-text.cjs +4 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-returns-text.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-returns-undefined.cjs +4 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-returns-undefined.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-throws-error.cjs +4 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-throws-error.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-times-out.cjs +10 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-times-out.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-undeclared.cjs +4 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-undeclared.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-uses-secret.cjs +14 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.1/app.functions/func-uses-secret.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-async-fails.cjs +5 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-async-fails.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-async-succeeds.cjs +5 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-async-succeeds.d.cts +3 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-calls-callback.cjs +4 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-calls-callback.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-does-not-export-main.cjs +4 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-does-not-export-main.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-echos-input.cjs +8 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-echos-input.d.cts +5 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-logs.cjs +10 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-logs.d.cts +3 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-returns-function.cjs +4 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-returns-function.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-returns-implicitly.cjs +7 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-returns-implicitly.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-returns-promise-rejected.cjs +4 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-returns-promise-rejected.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-returns-promise-resolved.cjs +4 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-returns-promise-resolved.d.cts +3 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-returns-text.cjs +4 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-returns-text.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-returns-undefined.cjs +4 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-returns-undefined.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-throws-error.cjs +4 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-throws-error.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-times-out.cjs +12 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-times-out.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-undeclared.cjs +4 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-undeclared.d.cts +1 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-uses-secret.cjs +14 -0
- package/dist/lib/__tests__/app-functions/fixtures/v2023.2/app.functions/func-uses-secret.d.cts +4 -0
- package/dist/lib/__tests__/app-functions/secrets.spec.d.ts +1 -0
- package/dist/lib/__tests__/app-functions/secrets.spec.js +278 -0
- package/dist/lib/__tests__/app-functions/services/AppProxyService.spec.d.ts +1 -0
- package/dist/lib/__tests__/app-functions/services/AppProxyService.spec.js +667 -0
- package/dist/lib/__tests__/app-functions/services/PrivateAppUserTokenManager.spec.d.ts +1 -0
- package/dist/lib/__tests__/app-functions/services/PrivateAppUserTokenManager.spec.js +243 -0
- package/dist/lib/__tests__/app-functions/services/services_v20231.spec.d.ts +1 -0
- package/dist/lib/__tests__/app-functions/services/services_v20231.spec.js +319 -0
- package/dist/lib/__tests__/app-functions/services/services_v20232.spec.d.ts +1 -0
- package/dist/lib/__tests__/app-functions/services/services_v20232.spec.js +302 -0
- package/dist/lib/__tests__/app-functions/setup.d.ts +1 -0
- package/dist/lib/__tests__/app-functions/setup.js +7 -0
- package/dist/lib/__tests__/app-functions/signing.spec.d.ts +1 -0
- package/dist/lib/__tests__/app-functions/signing.spec.js +460 -0
- package/dist/lib/__tests__/ast.spec.js +1 -1
- package/dist/lib/__tests__/server.spec.js +24 -2
- package/dist/lib/app-functions/api/privateAppUserToken.d.ts +16 -0
- package/dist/lib/app-functions/api/privateAppUserToken.js +28 -0
- package/dist/lib/app-functions/config.d.ts +4 -0
- package/dist/lib/app-functions/config.js +48 -0
- package/dist/lib/app-functions/constants.d.ts +26 -0
- package/dist/lib/app-functions/constants.js +63 -0
- package/dist/lib/app-functions/context.d.ts +3 -0
- package/dist/lib/app-functions/context.js +65 -0
- package/dist/lib/app-functions/errorReporter.d.ts +22 -0
- package/dist/lib/app-functions/errorReporter.js +42 -0
- package/dist/lib/app-functions/errors.d.ts +44 -0
- package/dist/lib/app-functions/errors.js +82 -0
- package/dist/lib/app-functions/executor.d.ts +3 -0
- package/dist/lib/app-functions/executor.js +131 -0
- package/dist/lib/app-functions/index.d.ts +4 -0
- package/dist/lib/app-functions/index.js +4 -0
- package/dist/lib/app-functions/secrets.d.ts +5 -0
- package/dist/lib/app-functions/secrets.js +55 -0
- package/dist/lib/app-functions/services/AppFunctionExecutionService.d.ts +2 -0
- package/dist/lib/app-functions/services/AppFunctionExecutionService.js +55 -0
- package/dist/lib/app-functions/services/AppProxyService.d.ts +5 -0
- package/dist/lib/app-functions/services/AppProxyService.js +196 -0
- package/dist/lib/app-functions/services/PrivateAppUserTokenManager.d.ts +22 -0
- package/dist/lib/app-functions/services/PrivateAppUserTokenManager.js +185 -0
- package/dist/lib/app-functions/services/constants.d.ts +4 -0
- package/dist/lib/app-functions/services/constants.js +4 -0
- package/dist/lib/app-functions/services/index.d.ts +3 -0
- package/dist/lib/app-functions/services/index.js +3 -0
- package/dist/lib/app-functions/services/messages.d.ts +14 -0
- package/dist/lib/app-functions/services/messages.js +36 -0
- package/dist/lib/app-functions/signing.d.ts +29 -0
- package/dist/lib/app-functions/signing.js +51 -0
- package/dist/lib/app-functions/types.d.ts +172 -0
- package/dist/lib/app-functions/types.js +6 -0
- package/dist/lib/app-functions/utils.d.ts +15 -0
- package/dist/lib/app-functions/utils.js +28 -0
- package/dist/lib/ast.js +2 -1
- package/dist/lib/server.js +15 -4
- package/dist/lib/types.d.ts +2 -2
- package/package.json +9 -6
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { PLATFORM_VERSION } from './constants.ts';
|
|
2
|
+
export interface AppFunctionsManifest {
|
|
3
|
+
runtime: string;
|
|
4
|
+
version: string;
|
|
5
|
+
appFunctions: {
|
|
6
|
+
[name: string]: FunctionDeclaration;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
interface FunctionDeclaration {
|
|
10
|
+
/** relative path to the function source file */
|
|
11
|
+
file: string;
|
|
12
|
+
/** list of secret names */
|
|
13
|
+
secrets: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface MultiFunctionInfo {
|
|
16
|
+
srcDir: string;
|
|
17
|
+
distDir?: string;
|
|
18
|
+
appFunctions: {
|
|
19
|
+
[name: string]: FunctionDeclaration;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface SingleFunctionInfo {
|
|
23
|
+
srcDir: string;
|
|
24
|
+
distDir?: string;
|
|
25
|
+
/** name of the app function */
|
|
26
|
+
name: string;
|
|
27
|
+
/** relative path to the function source file */
|
|
28
|
+
file: string;
|
|
29
|
+
/** list of secret names */
|
|
30
|
+
secrets: string[];
|
|
31
|
+
}
|
|
32
|
+
export type PlatformVersion = (typeof PLATFORM_VERSION)[keyof typeof PLATFORM_VERSION];
|
|
33
|
+
export interface ServiceConfiguration {
|
|
34
|
+
accountId: number;
|
|
35
|
+
app: ApplicationInfo;
|
|
36
|
+
functionTimeoutMs: number;
|
|
37
|
+
hubspotApiOrigin: string;
|
|
38
|
+
hubspotWebsiteOrigin: string;
|
|
39
|
+
logger: Pick<typeof console, 'debug' | 'info' | 'warn' | 'error'>;
|
|
40
|
+
platformVersion: PlatformVersion;
|
|
41
|
+
}
|
|
42
|
+
export interface ApplicationInfo {
|
|
43
|
+
/** absolute path of the app directory (ex: "/path/to/src/app/") */
|
|
44
|
+
path: string;
|
|
45
|
+
/** parsed app.json */
|
|
46
|
+
config?: {
|
|
47
|
+
name: string;
|
|
48
|
+
description: string;
|
|
49
|
+
scopes: string[];
|
|
50
|
+
public: boolean;
|
|
51
|
+
extensions: unknown;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Interface for app function execution requests from UI extensions.
|
|
56
|
+
* It should be consistent with the types declared in
|
|
57
|
+
* - ui-extensions-remote-renderer
|
|
58
|
+
* - CRMExtensibility (execution service backend)
|
|
59
|
+
*/
|
|
60
|
+
export interface ServerlessExecutionRequest {
|
|
61
|
+
appId: number;
|
|
62
|
+
extensibleCardId: number;
|
|
63
|
+
serverlessFunction: string;
|
|
64
|
+
location: ExtensionPointName;
|
|
65
|
+
objectQuery?: ObjectQuery;
|
|
66
|
+
parameters?: JsonValue;
|
|
67
|
+
event?: {
|
|
68
|
+
type: 'SERVERLESS_ACTION_HOOK';
|
|
69
|
+
payload: JsonValue;
|
|
70
|
+
};
|
|
71
|
+
objectId?: number;
|
|
72
|
+
objectTypeId?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface ObjectQuery {
|
|
75
|
+
objectId: number;
|
|
76
|
+
objectTypeId: string;
|
|
77
|
+
objectPropertyNames: string[];
|
|
78
|
+
}
|
|
79
|
+
export type ExtensionPointName = 'uie.playground.middle' | 'crm.record.tab' | 'crm.record.sidebar';
|
|
80
|
+
/**
|
|
81
|
+
* App function signature
|
|
82
|
+
*/
|
|
83
|
+
export type AppFunction = (context: FunctionContext, sendResponse: FunctionCallback) => Promise<void>;
|
|
84
|
+
export type FunctionCallback = (response: JsonValue) => void;
|
|
85
|
+
export interface FunctionContext {
|
|
86
|
+
parameters?: JsonValue;
|
|
87
|
+
event?: {
|
|
88
|
+
type: 'SERVERLESS_ACTION_HOOK';
|
|
89
|
+
payload: JsonValue;
|
|
90
|
+
};
|
|
91
|
+
propertiesToSend?: {
|
|
92
|
+
[name: string]: unknown;
|
|
93
|
+
};
|
|
94
|
+
secrets?: {
|
|
95
|
+
[name: string]: string;
|
|
96
|
+
} & {
|
|
97
|
+
PRIVATE_APP_ACCESS_TOKEN?: string;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export interface ApiException extends Error {
|
|
101
|
+
code: number;
|
|
102
|
+
}
|
|
103
|
+
export declare function isApiException(err: unknown): err is ApiException;
|
|
104
|
+
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
105
|
+
[key: string]: JsonValue;
|
|
106
|
+
};
|
|
107
|
+
export interface LocalExecutionInputs {
|
|
108
|
+
appId?: number;
|
|
109
|
+
objectQuery?: ServerlessExecutionRequest['objectQuery'];
|
|
110
|
+
parameters?: ServerlessExecutionRequest['parameters'];
|
|
111
|
+
event?: ServerlessExecutionRequest['event'];
|
|
112
|
+
}
|
|
113
|
+
export interface LocalDevUrlMapping {
|
|
114
|
+
[hostUrl: string]: string;
|
|
115
|
+
}
|
|
116
|
+
export interface ProxyServiceConfig {
|
|
117
|
+
logger: Pick<typeof console, 'debug' | 'info' | 'warn' | 'error'>;
|
|
118
|
+
localDevUrlMapping: LocalDevUrlMapping;
|
|
119
|
+
accountId: number;
|
|
120
|
+
allowedUrls: string[];
|
|
121
|
+
}
|
|
122
|
+
interface Context {
|
|
123
|
+
correlationId: string[];
|
|
124
|
+
httpMethod: string[];
|
|
125
|
+
appServerStatusCode?: string[];
|
|
126
|
+
portalId: string[];
|
|
127
|
+
requestUri: string[];
|
|
128
|
+
}
|
|
129
|
+
export interface AppProxyServiceSuccessResponse {
|
|
130
|
+
status: 'success';
|
|
131
|
+
responseBody: unknown;
|
|
132
|
+
context: Context;
|
|
133
|
+
}
|
|
134
|
+
export interface AppProxyServiceErrorResponse {
|
|
135
|
+
status: 'error';
|
|
136
|
+
category: string;
|
|
137
|
+
message: string;
|
|
138
|
+
context: Context;
|
|
139
|
+
errors?: unknown[];
|
|
140
|
+
responseBody?: unknown;
|
|
141
|
+
}
|
|
142
|
+
export type AppProxyServiceResponse = AppProxyServiceSuccessResponse | AppProxyServiceErrorResponse;
|
|
143
|
+
export interface ProxyServerError {
|
|
144
|
+
status: number;
|
|
145
|
+
data?: unknown;
|
|
146
|
+
message: string;
|
|
147
|
+
category: string;
|
|
148
|
+
}
|
|
149
|
+
export interface ProxyRequest {
|
|
150
|
+
requestUri: string;
|
|
151
|
+
method: string;
|
|
152
|
+
requestTimeoutMillis: number;
|
|
153
|
+
requestBody: unknown;
|
|
154
|
+
requestHeaders?: Record<string, string>;
|
|
155
|
+
}
|
|
156
|
+
export type PrivateAppUserToken = {
|
|
157
|
+
userId: number;
|
|
158
|
+
portalId: number;
|
|
159
|
+
appId: number;
|
|
160
|
+
scopeGroups: string[];
|
|
161
|
+
userTokenKey: string;
|
|
162
|
+
expiresAt: string;
|
|
163
|
+
clientId: string;
|
|
164
|
+
privateAppTokenInfo?: {
|
|
165
|
+
userId: number;
|
|
166
|
+
portalId: number;
|
|
167
|
+
appId: number;
|
|
168
|
+
scopeGroups: string[];
|
|
169
|
+
expiresAt: string;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type PropertyMap = {
|
|
2
|
+
[key: string]: unknown;
|
|
3
|
+
};
|
|
4
|
+
export declare function filterMap(properties: PropertyMap, filterKeys: string[]): PropertyMap;
|
|
5
|
+
interface Diffs {
|
|
6
|
+
added: string[];
|
|
7
|
+
deleted: string[];
|
|
8
|
+
}
|
|
9
|
+
export declare function diffLists(before: string[], after: string[]): Diffs;
|
|
10
|
+
export declare function formatSeconds(ms: number, fractionDigits?: number): string;
|
|
11
|
+
export declare class UnhandledPlatformVersionError extends Error {
|
|
12
|
+
constructor(platformVersion: never);
|
|
13
|
+
}
|
|
14
|
+
export declare function throwUnhandledPlatformVersionError(platformVersion: never): never;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function filterMap(properties, filterKeys) {
|
|
2
|
+
return Object.keys(properties)
|
|
3
|
+
.filter((key) => filterKeys.includes(key))
|
|
4
|
+
.reduce((result, key) => {
|
|
5
|
+
result[key] = properties[key];
|
|
6
|
+
return result;
|
|
7
|
+
}, {});
|
|
8
|
+
}
|
|
9
|
+
export function diffLists(before, after) {
|
|
10
|
+
return {
|
|
11
|
+
added: after.filter((item) => !before.includes(item)),
|
|
12
|
+
deleted: before.filter((item) => !after.includes(item)),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function formatSeconds(ms, fractionDigits = 0) {
|
|
16
|
+
const seconds = Number(ms / 1000.0);
|
|
17
|
+
return seconds > 1
|
|
18
|
+
? `${seconds.toFixed(fractionDigits)} seconds`
|
|
19
|
+
: `${seconds.toFixed(fractionDigits)} second`;
|
|
20
|
+
}
|
|
21
|
+
export class UnhandledPlatformVersionError extends Error {
|
|
22
|
+
constructor(platformVersion) {
|
|
23
|
+
super(`Unsupported platform version "${platformVersion}"`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function throwUnhandledPlatformVersionError(platformVersion) {
|
|
27
|
+
throw new UnhandledPlatformVersionError(platformVersion);
|
|
28
|
+
}
|
package/dist/lib/ast.js
CHANGED
|
@@ -183,7 +183,8 @@ function _processAssociationsHook(node, output) {
|
|
|
183
183
|
type: propertyType,
|
|
184
184
|
toObjectTypeId,
|
|
185
185
|
requestProperties: propertiesArray,
|
|
186
|
-
paginationOptions
|
|
186
|
+
// We need to only store paginationOptions if it's not an empty object. Otherwise it causes BE validation issues.
|
|
187
|
+
...(Object.keys(paginationOptions).length > 0 && { paginationOptions }),
|
|
187
188
|
options: otherOptions,
|
|
188
189
|
},
|
|
189
190
|
});
|
package/dist/lib/server.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import cors from 'cors';
|
|
3
|
-
import { PROXY_CAPABILITY, SERVER_CAPABILITIES } from "./constants.js";
|
|
3
|
+
import { PROXY_CAPABILITY, SERVER_CAPABILITIES, WEBSOCKET_MESSAGE_VERSION, } from "./constants.js";
|
|
4
4
|
import extensionsService from "./extensionsService.js";
|
|
5
|
-
import { AppFunctionExecutionService, AppProxyService, } from
|
|
5
|
+
import { AppFunctionExecutionService, AppProxyService, } from "./app-functions/services/index.js";
|
|
6
6
|
import { extractAllowedUrls } from "./utils.js";
|
|
7
7
|
import { ExtensionsWebSocket } from "./ExtensionsWebSocket.js";
|
|
8
8
|
function listen(app, port) {
|
|
@@ -80,8 +80,19 @@ async function startDevServer({ devServerState, viteDevServer, }) {
|
|
|
80
80
|
httpServer: server,
|
|
81
81
|
shutdown: async function shutdown() {
|
|
82
82
|
try {
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
// Notify browsers before closing
|
|
84
|
+
const ws = devServerState.extensionsWebSocket;
|
|
85
|
+
if (ws) {
|
|
86
|
+
devServerState.logger.debug('Sending shutdown message to connected browsers');
|
|
87
|
+
devServerState.extensionsMetadata?.forEach((metadata) => {
|
|
88
|
+
ws.broadcast({
|
|
89
|
+
...metadata.baseMessage,
|
|
90
|
+
version: WEBSOCKET_MESSAGE_VERSION,
|
|
91
|
+
event: 'shutdown',
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// Close WebSocket server to reject new connections
|
|
85
96
|
await devServerState.getExtensionsWebSocket().close();
|
|
86
97
|
// Close HTTP server
|
|
87
98
|
await new Promise((resolve) => {
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PLATFORM_VERSION, PRIVATE_APP, PUBLIC_APP } from './constants.ts';
|
|
2
|
-
import { LocalDevUrlMapping } from '
|
|
2
|
+
import { LocalDevUrlMapping } from './app-functions/types.ts';
|
|
3
3
|
export interface ObjectTypes {
|
|
4
4
|
name: string;
|
|
5
5
|
}
|
|
@@ -216,7 +216,7 @@ export type DataDependency = {
|
|
|
216
216
|
type: 'CrmRecordAssociationProperties';
|
|
217
217
|
toObjectTypeId: string;
|
|
218
218
|
requestProperties: string[];
|
|
219
|
-
paginationOptions
|
|
219
|
+
paginationOptions?: {
|
|
220
220
|
[key: string]: any;
|
|
221
221
|
};
|
|
222
222
|
options: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/ui-extensions-dev-server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,10 +33,13 @@
|
|
|
33
33
|
],
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@hubspot/
|
|
36
|
+
"@hubspot/api-client": "12.0.1",
|
|
37
|
+
"@hubspot/local-dev-lib": "5.1.1",
|
|
38
|
+
"@sentry/node": "10.37.0",
|
|
39
|
+
"axios": "1.13.5",
|
|
37
40
|
"chalk": "5.4.1",
|
|
38
41
|
"commander": "13.1.0",
|
|
39
|
-
"cors": "2.8.
|
|
42
|
+
"cors": "2.8.6",
|
|
40
43
|
"detect-port": "2.1.0",
|
|
41
44
|
"estraverse": "5.3.0",
|
|
42
45
|
"express": "5.1.0",
|
|
@@ -47,7 +50,6 @@
|
|
|
47
50
|
},
|
|
48
51
|
"devDependencies": {
|
|
49
52
|
"@changesets/cli": "^2.29.7",
|
|
50
|
-
"@hubspot/local-dev-lib": "^3.19.2",
|
|
51
53
|
"@types/cors": "^2.8.19",
|
|
52
54
|
"@types/estree": "^1.0.5",
|
|
53
55
|
"@types/express": "^5.0.3",
|
|
@@ -57,14 +59,15 @@
|
|
|
57
59
|
"@typescript-eslint/parser": "^8.44.1",
|
|
58
60
|
"acorn": "^8.15.0",
|
|
59
61
|
"ava": "5.3.1",
|
|
60
|
-
"axios": "1.12.2",
|
|
61
62
|
"eslint": "^8.56.0",
|
|
62
63
|
"eslint-plugin-import": "^2.31.0",
|
|
63
64
|
"husky": "^9.1.7",
|
|
64
65
|
"lint-staged": "^10.5.4",
|
|
66
|
+
"memfs": "^4.9.3",
|
|
67
|
+
"node-mocks-http": "^1.12.2",
|
|
65
68
|
"prettier": "^3.6.2",
|
|
66
69
|
"typescript": "^5.9.2",
|
|
67
|
-
"vitest": "^
|
|
70
|
+
"vitest": "^4.0.18"
|
|
68
71
|
},
|
|
69
72
|
"engines": {
|
|
70
73
|
"node": ">=18"
|