@honeybadger-io/js 6.5.2 → 6.6.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/dist/browser/honeybadger.js +10 -4
- package/dist/browser/honeybadger.js.map +1 -1
- package/dist/browser/honeybadger.min.js +1 -1
- package/dist/browser/honeybadger.min.js.map +1 -1
- package/dist/browser/transport.d.ts +4 -1
- package/dist/server/checkins-manager/checkin.d.ts +31 -0
- package/dist/server/checkins-manager/client.d.ts +21 -0
- package/dist/server/checkins-manager/index.d.ts +15 -0
- package/dist/server/checkins-manager/types.d.ts +66 -0
- package/dist/server/checkins-sync-exec.d.ts +2 -0
- package/dist/server/checkins-sync-exec.js +885 -0
- package/dist/server/checkins-sync-exec.js.map +1 -0
- package/dist/server/checkins-sync.d.ts +2 -0
- package/dist/server/honeybadger.d.ts +9 -5
- package/dist/server/honeybadger.js +507 -66
- package/dist/server/honeybadger.js.map +1 -1
- package/dist/server/transport.d.ts +4 -1
- package/dist/server/util.d.ts +1 -0
- package/package.json +11 -6
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Types } from '@honeybadger-io/core';
|
|
2
2
|
export declare class BrowserTransport implements Types.Transport {
|
|
3
|
-
|
|
3
|
+
private headers;
|
|
4
|
+
constructor(headers?: Record<string, string>);
|
|
5
|
+
defaultHeaders(): Record<string, string>;
|
|
6
|
+
send<T>(options: Types.TransportOptions, payload?: T): Promise<{
|
|
4
7
|
statusCode: number;
|
|
5
8
|
body: string;
|
|
6
9
|
}>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CheckinDto, CheckinPayload, CheckinResponsePayload } from './types/types';
|
|
2
|
+
export declare class Checkin implements CheckinDto {
|
|
3
|
+
id?: string;
|
|
4
|
+
projectId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
scheduleType: 'simple' | 'cron';
|
|
7
|
+
slug?: string;
|
|
8
|
+
reportPeriod?: string;
|
|
9
|
+
gracePeriod?: string;
|
|
10
|
+
cronSchedule?: string;
|
|
11
|
+
cronTimezone?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Only set when the checkin has been deleted
|
|
14
|
+
* after an update request.
|
|
15
|
+
* Note: this property exists only locally.
|
|
16
|
+
*/
|
|
17
|
+
private deleted;
|
|
18
|
+
constructor(props: CheckinDto);
|
|
19
|
+
isDeleted(): boolean;
|
|
20
|
+
markAsDeleted(): void;
|
|
21
|
+
validate(): void;
|
|
22
|
+
asRequestPayload(): CheckinPayload;
|
|
23
|
+
/**
|
|
24
|
+
* Compares two checkins, usually the one from the API and the one from the config file.
|
|
25
|
+
* If the one in the config file does not match the checkin from the API,
|
|
26
|
+
* then we issue an update request.
|
|
27
|
+
*/
|
|
28
|
+
isInSync(other: Checkin): boolean;
|
|
29
|
+
static fromResponsePayload(projectId: string, payload: CheckinResponsePayload): Checkin;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=checkin.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Types } from '@honeybadger-io/core';
|
|
2
|
+
import { Checkin } from './types/checkin';
|
|
3
|
+
export declare class CheckinsClient {
|
|
4
|
+
private readonly BASE_URL;
|
|
5
|
+
private readonly cache;
|
|
6
|
+
private readonly config;
|
|
7
|
+
private readonly logger;
|
|
8
|
+
private readonly transport;
|
|
9
|
+
constructor(config: {
|
|
10
|
+
personalAuthToken: string;
|
|
11
|
+
logger: Types.Logger;
|
|
12
|
+
}, transport: Types.Transport);
|
|
13
|
+
listForProject(projectId: string): Promise<Checkin[]>;
|
|
14
|
+
get(projectId: string, checkinId: string): Promise<Checkin>;
|
|
15
|
+
create(checkin: Checkin): Promise<Checkin>;
|
|
16
|
+
update(checkin: Checkin): Promise<Checkin>;
|
|
17
|
+
remove(checkin: Checkin): Promise<void>;
|
|
18
|
+
private getHeaders;
|
|
19
|
+
private getErrorMessage;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Types } from '@honeybadger-io/core';
|
|
2
|
+
import { CheckinsClient } from './types/client';
|
|
3
|
+
import { CheckinsConfig } from './types/types';
|
|
4
|
+
import { Checkin } from './types/checkin';
|
|
5
|
+
export declare class CheckinsManager {
|
|
6
|
+
private readonly client;
|
|
7
|
+
config: Required<CheckinsConfig>;
|
|
8
|
+
logger: Types.Logger;
|
|
9
|
+
constructor(config: Partial<CheckinsConfig>, client?: CheckinsClient);
|
|
10
|
+
sync(): Promise<Checkin[]>;
|
|
11
|
+
private getLocalCheckins;
|
|
12
|
+
private createOrUpdate;
|
|
13
|
+
private remove;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Types } from '@honeybadger-io/core';
|
|
2
|
+
export declare type CheckinDto = {
|
|
3
|
+
/**
|
|
4
|
+
* Checkin identifier.
|
|
5
|
+
*/
|
|
6
|
+
id?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Checkin name.
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* Checkin slug.
|
|
13
|
+
*/
|
|
14
|
+
slug?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Valid values are "simple" or "cron".
|
|
17
|
+
* If you specify "cron", then the "cron_schedule" field is required.
|
|
18
|
+
*/
|
|
19
|
+
scheduleType: 'simple' | 'cron';
|
|
20
|
+
/**
|
|
21
|
+
* For simple check-ins, the amount of time that can elapse before the check-in is reported as missing.
|
|
22
|
+
* E.g., "1 day" would require a hit to the API daily to maintain the "reporting" status.
|
|
23
|
+
* Valid time periods are "minute", "hour", "day", "week", and "month": "5 minutes", "7 days", etc.
|
|
24
|
+
*/
|
|
25
|
+
reportPeriod?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The amount of time to allow a job to not report before it's reported as missing.
|
|
28
|
+
* Valid values are the same as the report_report field.
|
|
29
|
+
*/
|
|
30
|
+
gracePeriod?: string;
|
|
31
|
+
/**
|
|
32
|
+
* For a scheduleType of "cron", the cron-compatible string that defines when the job should be expected to hit the API.
|
|
33
|
+
*/
|
|
34
|
+
cronSchedule?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The timezone setting for your server that is running the cron job to be monitored.
|
|
37
|
+
* Valid timezone values are listed here {@link https://docs.honeybadger.io/api/check-ins/timezones here}.
|
|
38
|
+
*/
|
|
39
|
+
cronTimezone?: string;
|
|
40
|
+
/**
|
|
41
|
+
* The project ID that this checkin belongs to.
|
|
42
|
+
*/
|
|
43
|
+
projectId: string;
|
|
44
|
+
};
|
|
45
|
+
export declare type CheckinsConfig = {
|
|
46
|
+
debug?: boolean;
|
|
47
|
+
logger?: Types.Logger;
|
|
48
|
+
personalAuthToken: string;
|
|
49
|
+
checkins: CheckinDto[];
|
|
50
|
+
};
|
|
51
|
+
export declare type CheckinPayload = {
|
|
52
|
+
name: string;
|
|
53
|
+
slug?: string;
|
|
54
|
+
schedule_type: 'simple' | 'cron';
|
|
55
|
+
report_period?: string;
|
|
56
|
+
grace_period?: string;
|
|
57
|
+
cron_schedule?: string;
|
|
58
|
+
cron_timezone?: string;
|
|
59
|
+
};
|
|
60
|
+
export declare type CheckinTransportPayload = {
|
|
61
|
+
check_in: CheckinPayload;
|
|
62
|
+
};
|
|
63
|
+
export declare type CheckinResponsePayload = {
|
|
64
|
+
id: string;
|
|
65
|
+
} & CheckinPayload;
|
|
66
|
+
//# sourceMappingURL=types.d.ts.map
|