@hubspot/local-dev-lib 5.7.1 → 5.8.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.
@@ -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
+ }
@@ -17,6 +17,7 @@ export async function getAccessToken(personalAccessKey, env = ENVIRONMENTS.PROD,
17
17
  const response = axiosResponse.data;
18
18
  return {
19
19
  portalId: response.hubId,
20
+ userId: response.userId,
20
21
  accessToken: response.oauthAccessToken,
21
22
  expiresAt: moment(response.expiresAtMillis).toISOString(),
22
23
  scopeGroups: response.scopeGroups,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/local-dev-lib",
3
- "version": "5.7.1",
3
+ "version": "5.8.0",
4
4
  "type": "module",
5
5
  "description": "Provides library functionality for HubSpot local development tooling, including the HubSpot CLI",
6
6
  "files": [
@@ -82,6 +82,7 @@ export type EnabledFeaturesResponse = {
82
82
  };
83
83
  export type AccessToken = {
84
84
  portalId: number;
85
+ userId?: number;
85
86
  accessToken: string;
86
87
  expiresAt: string;
87
88
  scopeGroups: Array<string>;
@@ -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
+ };
@@ -0,0 +1 @@
1
+ export {};