File tree Expand file tree Collapse file tree 2 files changed +36
-3
lines changed
Expand file tree Collapse file tree 2 files changed +36
-3
lines changed Original file line number Diff line number Diff line change 11import { http } from '../http' ;
22import { HubSpotPromise , QueryParams } from '../types/Http' ;
3- import { GetBuildStatusResponse , GetRoutesResponse } from '../types/Functions' ;
3+ import {
4+ GetBuildStatusResponse ,
5+ FunctionLog ,
6+ GetRoutesResponse ,
7+ GetFunctionLogsResponse ,
8+ } from '../types/Functions' ;
49
510const FUNCTION_API_PATH = 'cms/v3/functions' ;
611
@@ -16,7 +21,7 @@ export function getFunctionLogs(
1621 accountId : number ,
1722 route : string ,
1823 params : QueryParams = { }
19- ) : HubSpotPromise {
24+ ) : HubSpotPromise < GetFunctionLogsResponse > {
2025 const { limit = 5 } = params ;
2126
2227 return http . get ( accountId , {
@@ -28,7 +33,7 @@ export function getFunctionLogs(
2833export function getLatestFunctionLog (
2934 accountId : number ,
3035 route : string
31- ) : HubSpotPromise {
36+ ) : HubSpotPromise < FunctionLog > {
3237 return http . get ( accountId , {
3338 url : `${ FUNCTION_API_PATH } /results/by-route/${ encodeURIComponent (
3439 route
Original file line number Diff line number Diff line change @@ -69,3 +69,31 @@ export type FunctionInfo = {
6969export type FunctionOptions = {
7070 allowExistingFile ?: boolean ;
7171} ;
72+
73+ export type FunctionLog = {
74+ id : string ;
75+ executionTime : number ;
76+ log : string ;
77+ error : {
78+ message : string ;
79+ type : string ;
80+ stackTrace : string [ ] [ ] ;
81+ } ;
82+ status : string ;
83+ createdAt : number ;
84+ memory : string ;
85+ } ;
86+
87+ export type GetFunctionLogsResponse = {
88+ results : FunctionLog [ ] ;
89+ paging : {
90+ next : {
91+ after : string ;
92+ link : string ;
93+ } ;
94+ prev : {
95+ before : string ;
96+ link : string ;
97+ } ;
98+ } ;
99+ } ;
You can’t perform that action at this time.
0 commit comments