@hubspot/local-dev-lib 0.7.10-experimental.0 → 0.7.11-experimental.0
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/api/appLogs.d.ts +4 -0
- package/api/appLogs.js +13 -0
- package/api/appsDev.d.ts +1 -0
- package/api/appsDev.js +10 -0
- package/lib/archive.js +3 -2
- package/package.json +4 -3
- package/types/AppLogs.d.ts +80 -0
- package/types/AppLogs.js +1 -0
package/api/appLogs.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { HubSpotPromise } from '../types/Http.js';
|
|
2
|
+
import { AppLogDetailsResponse, SearchLogsRequest, SearchLogsResponse, SystemType } from '../types/AppLogs.js';
|
|
3
|
+
export declare function searchAppLogs(accountId: number, appId: number, requestBody: SearchLogsRequest): HubSpotPromise<SearchLogsResponse>;
|
|
4
|
+
export declare function getAppLogDetails(accountId: number, appId: number, systemType: SystemType, uuid: string): HubSpotPromise<AppLogDetailsResponse>;
|
package/api/appLogs.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { http } from '../http/index.js';
|
|
2
|
+
const APP_LOGS_API_PATH = 'developers/logs';
|
|
3
|
+
export function searchAppLogs(accountId, appId, requestBody) {
|
|
4
|
+
return http.post(accountId, {
|
|
5
|
+
url: `${APP_LOGS_API_PATH}/search/${appId}`,
|
|
6
|
+
data: requestBody,
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
export function getAppLogDetails(accountId, appId, systemType, uuid) {
|
|
10
|
+
return http.get(accountId, {
|
|
11
|
+
url: `${APP_LOGS_API_PATH}/details/${appId}/${systemType}/${uuid}`,
|
|
12
|
+
});
|
|
13
|
+
}
|
package/api/appsDev.d.ts
CHANGED
|
@@ -5,5 +5,6 @@ export declare function fetchPublicAppDeveloperTestAccountInstallData(appId: num
|
|
|
5
5
|
export declare function fetchPublicAppProductionInstallCounts(appId: number, accountId: number): HubSpotPromise<PublicAppInstallCounts>;
|
|
6
6
|
export declare function fetchPublicAppMetadata(appId: number, accountId: number): HubSpotPromise<PublicApp>;
|
|
7
7
|
export declare function installStaticAuthAppOnTestAccount(appId: number, accountId: number, scopeGroupIds: number[]): HubSpotPromise<void>;
|
|
8
|
+
export declare function installStaticAuthAppOnCurrentAccount(appId: number, accountId: number, scopeGroupIds: number[]): HubSpotPromise<void>;
|
|
8
9
|
export declare function fetchAppMetadataByUid(appUid: string, accountId: number): HubSpotPromise<PublicApp>;
|
|
9
10
|
export declare function fetchAppMetadataBySourceId(projectId: number, appUid: string, accountId: number): HubSpotPromise<PublicApp>;
|
package/api/appsDev.js
CHANGED
|
@@ -31,6 +31,16 @@ export function installStaticAuthAppOnTestAccount(appId, accountId, scopeGroupId
|
|
|
31
31
|
},
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
+
export function installStaticAuthAppOnCurrentAccount(appId, accountId, scopeGroupIds) {
|
|
35
|
+
return http.post(accountId, {
|
|
36
|
+
url: `${APPS_HUBLETS_API_PATH}/current-account`,
|
|
37
|
+
data: {
|
|
38
|
+
appId,
|
|
39
|
+
targetInstallPortalId: accountId,
|
|
40
|
+
scopeGroupIds,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
34
44
|
export function fetchAppMetadataByUid(appUid, accountId) {
|
|
35
45
|
return http.get(accountId, {
|
|
36
46
|
url: `${APPS_DEV_API_PATH}/full/portal/sourceId`,
|
package/lib/archive.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'fs-extra';
|
|
2
2
|
import path, { join } from 'path';
|
|
3
3
|
import { tmpdir } from 'os';
|
|
4
|
-
import
|
|
4
|
+
import unzipper from 'unzipper';
|
|
5
5
|
import { logger } from './logger.js';
|
|
6
6
|
import { i18n } from '../utils/lang.js';
|
|
7
7
|
import { FileSystemError } from '../models/FileSystemError.js';
|
|
@@ -39,7 +39,8 @@ async function extractZip(name, zip, hideLogs = false) {
|
|
|
39
39
|
// Extract zip
|
|
40
40
|
try {
|
|
41
41
|
const tmpExtractPath = join(result.tmpDir, 'extracted');
|
|
42
|
-
await
|
|
42
|
+
const directory = await unzipper.Open.file(tmpZipPath);
|
|
43
|
+
await directory.extract({ path: tmpExtractPath });
|
|
43
44
|
result.extractDir = tmpExtractPath;
|
|
44
45
|
}
|
|
45
46
|
catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/local-dev-lib",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.11-experimental.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Provides library functionality for HubSpot local development tooling, including the HubSpot CLI",
|
|
6
6
|
"files": [
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@types/js-yaml": "^4.0.5",
|
|
38
38
|
"@types/node": "^20.14.8",
|
|
39
39
|
"@types/unixify": "^1.0.0",
|
|
40
|
+
"@types/unzipper": "^0.10.11",
|
|
40
41
|
"@typescript-eslint/eslint-plugin": "^8.30.1",
|
|
41
42
|
"@typescript-eslint/parser": "^8.11.0",
|
|
42
43
|
"eslint": "^9.38.0",
|
|
@@ -78,7 +79,6 @@
|
|
|
78
79
|
"cors": "2.8.5",
|
|
79
80
|
"debounce": "1.2.1",
|
|
80
81
|
"express": "4.22.1",
|
|
81
|
-
"extract-zip": "2.0.1",
|
|
82
82
|
"findup-sync": "5.0.0",
|
|
83
83
|
"form-data": "^4.0.4",
|
|
84
84
|
"fs-extra": "11.2.0",
|
|
@@ -90,7 +90,8 @@
|
|
|
90
90
|
"p-queue": "^7.0.0",
|
|
91
91
|
"prettier": "^3.6.2",
|
|
92
92
|
"semver": "6.3.1",
|
|
93
|
-
"unixify": "1.0.0"
|
|
93
|
+
"unixify": "1.0.0",
|
|
94
|
+
"unzipper": "0.12.3"
|
|
94
95
|
},
|
|
95
96
|
"engines": {
|
|
96
97
|
"node": ">=20.0.0"
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export type SystemType = 'CRM_LEGACY_CARD' | 'CRM_EXTENSIBILITY_CARD' | 'WEBHOOKS' | 'API_CALL' | 'APP_SETTINGS' | 'SERVERLESS_EXECUTION' | 'PROXY_EXECUTION' | 'EXTENSION_RENDER' | 'EXTENSION_LOG' | 'SERVERLESS_GATEWAY_EXECUTION' | 'ACCEPTANCE_TEST' | 'OAUTH_AUTHORIZATION';
|
|
2
|
+
export type ResultsOrder = 'ASC' | 'DESC';
|
|
3
|
+
export type LogSearchQuery = {
|
|
4
|
+
loggingSystemType: SystemType;
|
|
5
|
+
logId?: string;
|
|
6
|
+
limit: number;
|
|
7
|
+
offset: number;
|
|
8
|
+
startTime?: number;
|
|
9
|
+
endTime?: number;
|
|
10
|
+
errorTypes: string[];
|
|
11
|
+
resultsOrder: ResultsOrder;
|
|
12
|
+
portalId?: number;
|
|
13
|
+
correlationGroupId?: string;
|
|
14
|
+
traceId?: string;
|
|
15
|
+
label?: string;
|
|
16
|
+
};
|
|
17
|
+
export type SearchLogsRequest = {
|
|
18
|
+
query: LogSearchQuery;
|
|
19
|
+
after?: string;
|
|
20
|
+
limit: number;
|
|
21
|
+
};
|
|
22
|
+
export type NextPage = {
|
|
23
|
+
after: string;
|
|
24
|
+
link?: string;
|
|
25
|
+
};
|
|
26
|
+
export type ForwardPaging = {
|
|
27
|
+
next?: NextPage;
|
|
28
|
+
};
|
|
29
|
+
export type AppLogEntry = {
|
|
30
|
+
id: string;
|
|
31
|
+
loggingSystemType: string;
|
|
32
|
+
requestExecutionTimestamp: number;
|
|
33
|
+
portalId: number;
|
|
34
|
+
traceId: string;
|
|
35
|
+
parentId: string;
|
|
36
|
+
label: string;
|
|
37
|
+
responseReceivedTimestamp: number;
|
|
38
|
+
duration: number;
|
|
39
|
+
errorType?: string;
|
|
40
|
+
appId: number;
|
|
41
|
+
[key: string]: unknown;
|
|
42
|
+
};
|
|
43
|
+
export type SearchLogsResponse = {
|
|
44
|
+
results: AppLogEntry[];
|
|
45
|
+
paging?: ForwardPaging;
|
|
46
|
+
};
|
|
47
|
+
export type AppLogDetails = {
|
|
48
|
+
loggingSystemType: string;
|
|
49
|
+
id: string;
|
|
50
|
+
requestExecutionTimestamp: number;
|
|
51
|
+
portalId?: number;
|
|
52
|
+
traceId?: string;
|
|
53
|
+
parentId?: string;
|
|
54
|
+
label?: string;
|
|
55
|
+
traceparentId?: string;
|
|
56
|
+
correlationGroupId?: string;
|
|
57
|
+
parentLogId?: string;
|
|
58
|
+
responseReceivedTimestamp?: number;
|
|
59
|
+
duration?: number;
|
|
60
|
+
errorType?: string;
|
|
61
|
+
appId: number;
|
|
62
|
+
serverlessFunction?: string;
|
|
63
|
+
location?: string;
|
|
64
|
+
userId?: number;
|
|
65
|
+
requestBody?: string;
|
|
66
|
+
responseBody?: string;
|
|
67
|
+
validatedResponse?: string;
|
|
68
|
+
extraInfo?: Record<string, string>;
|
|
69
|
+
errorMessage?: string;
|
|
70
|
+
cardId?: number;
|
|
71
|
+
objectTypeId?: string;
|
|
72
|
+
objectId?: number;
|
|
73
|
+
cardName?: string;
|
|
74
|
+
traceRoot?: boolean;
|
|
75
|
+
[key: string]: unknown;
|
|
76
|
+
};
|
|
77
|
+
export type AppLogDetailsResponse = {
|
|
78
|
+
log: AppLogDetails;
|
|
79
|
+
consoleOutput?: string;
|
|
80
|
+
};
|
package/types/AppLogs.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|