@atlasauth/backend 0.18.0 → 0.20.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/CHANGELOG.md +46 -0
- package/dist/backchannel-handlers.d.ts +87 -0
- package/dist/backchannel-handlers.js +137 -0
- package/dist/backchannel-handlers.js.map +1 -0
- package/dist/client/activity.d.ts +13 -2
- package/dist/client/activity.js.map +1 -1
- package/dist/client/audit-logs.d.ts +7 -0
- package/dist/client/audit-logs.js.map +1 -1
- package/dist/client/compliance.d.ts +216 -0
- package/dist/client/compliance.js +77 -0
- package/dist/client/compliance.js.map +1 -0
- package/dist/client/credentials.d.ts +427 -0
- package/dist/client/credentials.js +162 -0
- package/dist/client/credentials.js.map +1 -0
- package/dist/client/data-subject-requests.d.ts +36 -1
- package/dist/client/data-subject-requests.js.map +1 -1
- package/dist/client/design.d.ts +48 -0
- package/dist/client/design.js +9 -0
- package/dist/client/design.js.map +1 -1
- package/dist/client/entitlement-overrides.d.ts +30 -0
- package/dist/client/entitlement-overrides.js +9 -0
- package/dist/client/entitlement-overrides.js.map +1 -1
- package/dist/client/env.d.ts +16 -0
- package/dist/client/env.js +38 -0
- package/dist/client/env.js.map +1 -0
- package/dist/client/error.d.ts +12 -0
- package/dist/client/error.js +6 -0
- package/dist/client/error.js.map +1 -1
- package/dist/client/index.d.ts +321 -7
- package/dist/client/index.js +39 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/instance.d.ts +414 -3
- package/dist/client/instance.js +77 -3
- package/dist/client/instance.js.map +1 -1
- package/dist/client/integrations.d.ts +107 -0
- package/dist/client/integrations.js +25 -0
- package/dist/client/integrations.js.map +1 -0
- package/dist/client/messaging.d.ts +18 -4
- package/dist/client/messaging.js +6 -2
- package/dist/client/messaging.js.map +1 -1
- package/dist/client/oauth-clients.d.ts +18 -3
- package/dist/client/oauth-clients.js +4 -2
- package/dist/client/oauth-clients.js.map +1 -1
- package/dist/client/operator.d.ts +100 -0
- package/dist/client/operator.js +132 -0
- package/dist/client/operator.js.map +1 -0
- package/dist/client/platform.d.ts +250 -9
- package/dist/client/platform.js +88 -6
- package/dist/client/platform.js.map +1 -1
- package/dist/client/privacy.d.ts +127 -0
- package/dist/client/privacy.js +44 -0
- package/dist/client/privacy.js.map +1 -0
- package/dist/client/referrals.d.ts +53 -6
- package/dist/client/referrals.js +9 -0
- package/dist/client/referrals.js.map +1 -1
- package/dist/client/request.d.ts +58 -1
- package/dist/client/request.js +6 -2
- package/dist/client/request.js.map +1 -1
- package/dist/client/sealed-box.d.ts +7 -0
- package/dist/client/sealed-box.js +62 -0
- package/dist/client/sealed-box.js.map +1 -0
- package/dist/client/sessions.d.ts +16 -5
- package/dist/client/sessions.js +7 -10
- package/dist/client/sessions.js.map +1 -1
- package/dist/client/status.d.ts +200 -0
- package/dist/client/status.js +54 -0
- package/dist/client/status.js.map +1 -0
- package/dist/client/users.d.ts +2 -0
- package/dist/client/users.js.map +1 -1
- package/dist/client/webhooks.d.ts +265 -13
- package/dist/client/webhooks.js +52 -3
- package/dist/client/webhooks.js.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.js +19 -4
- package/dist/index.js.map +1 -1
- package/dist/oidc.d.ts +75 -1
- package/dist/oidc.js +48 -0
- package/dist/oidc.js.map +1 -1
- package/dist/referral-test-calls.d.ts +26 -13
- package/dist/referral-test-calls.js +40 -14
- package/dist/referral-test-calls.js.map +1 -1
- package/dist/testing.d.ts +45 -6
- package/dist/testing.js +37 -2
- package/dist/testing.js.map +1 -1
- package/dist/verify.d.ts +9 -0
- package/dist/verify.js.map +1 -1
- package/dist/webhooks.d.ts +8 -0
- package/dist/webhooks.js +13 -4
- package/dist/webhooks.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { type RequestFn } from './request';
|
|
2
|
+
/**
|
|
3
|
+
* Atlas service status for your instance: the incident subscription (owner
|
|
4
|
+
* email, `status_incident.*` webhooks, a private RSS / Atom feed) filtered by
|
|
5
|
+
* region, component and impact; the incidents that concern you; and the
|
|
6
|
+
* upstream status pages (any Statuspage-compatible URL) your app depends on.
|
|
7
|
+
*
|
|
8
|
+
* The public Statuspage-compatible feed itself needs no key:
|
|
9
|
+
* `https://<frontend api>/v1/status/api/v2/summary.json` (and the other
|
|
10
|
+
* Statuspage files, RSS and Atom) — point any status page at it.
|
|
11
|
+
*/
|
|
12
|
+
export type StatusComponentId = 'frontend_api' | 'backend_api' | 'database' | 'cache' | 'background_jobs';
|
|
13
|
+
export type StatusImpact = 'none' | 'minor' | 'major' | 'critical';
|
|
14
|
+
export type StatusIncidentStatus = 'investigating' | 'identified' | 'monitoring' | 'resolved' | 'scheduled' | 'in_progress' | 'completed';
|
|
15
|
+
export type StatusDependencyState = 'operational' | 'degraded' | 'partial_outage' | 'major_outage' | 'maintenance' | 'unknown';
|
|
16
|
+
/** `GET /v1/status` (public). */
|
|
17
|
+
export interface ServiceStatus {
|
|
18
|
+
object: 'status';
|
|
19
|
+
status: 'operational' | 'degraded' | 'major_outage';
|
|
20
|
+
updated_at: number;
|
|
21
|
+
regions: string[];
|
|
22
|
+
groups: Array<{
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
component_ids: string[];
|
|
26
|
+
}>;
|
|
27
|
+
components: Array<{
|
|
28
|
+
id: StatusComponentId;
|
|
29
|
+
name: string;
|
|
30
|
+
status: 'operational' | 'degraded' | 'major_outage' | 'unknown';
|
|
31
|
+
description: string;
|
|
32
|
+
group: string;
|
|
33
|
+
regions: string[];
|
|
34
|
+
}>;
|
|
35
|
+
incidents: Array<{
|
|
36
|
+
id: string;
|
|
37
|
+
kind: 'incident' | 'maintenance';
|
|
38
|
+
title: string;
|
|
39
|
+
status: StatusIncidentStatus;
|
|
40
|
+
impact: StatusImpact;
|
|
41
|
+
regions: string[];
|
|
42
|
+
component_ids: string[];
|
|
43
|
+
started_at: number;
|
|
44
|
+
resolved_at: number | null;
|
|
45
|
+
updated_at: number;
|
|
46
|
+
}>;
|
|
47
|
+
}
|
|
48
|
+
export interface StatusSubscription {
|
|
49
|
+
object: 'status_subscription';
|
|
50
|
+
/** A subscription exists (it may be disabled). */
|
|
51
|
+
subscribed: boolean;
|
|
52
|
+
enabled: boolean;
|
|
53
|
+
/** [] = every region. */
|
|
54
|
+
regions: string[];
|
|
55
|
+
/** [] = every component. */
|
|
56
|
+
component_ids: StatusComponentId[];
|
|
57
|
+
min_impact: 'minor' | 'major' | 'critical';
|
|
58
|
+
include_maintenance: boolean;
|
|
59
|
+
email_owners: boolean;
|
|
60
|
+
webhook: boolean;
|
|
61
|
+
/** The private feed; treat it as a secret (`rotateFeed` replaces it). */
|
|
62
|
+
rss_url: string | null;
|
|
63
|
+
atom_url: string | null;
|
|
64
|
+
available_regions: string[];
|
|
65
|
+
available_components: Array<{
|
|
66
|
+
id: StatusComponentId;
|
|
67
|
+
name: string;
|
|
68
|
+
}>;
|
|
69
|
+
updated_at: number | null;
|
|
70
|
+
}
|
|
71
|
+
export interface UpdateStatusSubscriptionBody {
|
|
72
|
+
enabled?: boolean;
|
|
73
|
+
regions?: string[];
|
|
74
|
+
component_ids?: StatusComponentId[];
|
|
75
|
+
min_impact?: 'minor' | 'major' | 'critical';
|
|
76
|
+
include_maintenance?: boolean;
|
|
77
|
+
email_owners?: boolean;
|
|
78
|
+
webhook?: boolean;
|
|
79
|
+
}
|
|
80
|
+
export interface StatusIncidentUpdate {
|
|
81
|
+
id: string;
|
|
82
|
+
status: StatusIncidentStatus;
|
|
83
|
+
body: string;
|
|
84
|
+
created_at: number;
|
|
85
|
+
}
|
|
86
|
+
export interface StatusIncident {
|
|
87
|
+
object: 'status_incident';
|
|
88
|
+
id: string;
|
|
89
|
+
kind: 'incident' | 'maintenance';
|
|
90
|
+
title: string;
|
|
91
|
+
status: StatusIncidentStatus;
|
|
92
|
+
impact: StatusImpact;
|
|
93
|
+
regions: string[];
|
|
94
|
+
component_ids: string[];
|
|
95
|
+
started_at: number;
|
|
96
|
+
resolved_at: number | null;
|
|
97
|
+
updated_at: number;
|
|
98
|
+
source: 'atlas' | 'import' | (string & {});
|
|
99
|
+
scheduled_for: number | null;
|
|
100
|
+
scheduled_until: number | null;
|
|
101
|
+
/** Oldest first. */
|
|
102
|
+
updates: StatusIncidentUpdate[];
|
|
103
|
+
}
|
|
104
|
+
/** `data` of the `status_incident.created` / `updated` / `resolved` webhook events. */
|
|
105
|
+
export interface StatusIncidentEventData {
|
|
106
|
+
object: 'status_incident';
|
|
107
|
+
id: string;
|
|
108
|
+
kind: 'incident' | 'maintenance';
|
|
109
|
+
title: string;
|
|
110
|
+
status: StatusIncidentStatus;
|
|
111
|
+
impact: StatusImpact;
|
|
112
|
+
regions: string[];
|
|
113
|
+
component_ids: string[];
|
|
114
|
+
/** The part of the incident that matches your subscription. */
|
|
115
|
+
affected_regions: string[];
|
|
116
|
+
affected_component_ids: string[];
|
|
117
|
+
started_at: number;
|
|
118
|
+
resolved_at: number | null;
|
|
119
|
+
update: StatusIncidentUpdate;
|
|
120
|
+
/** The incident on the status page. */
|
|
121
|
+
url: string;
|
|
122
|
+
}
|
|
123
|
+
export interface StatusDependency {
|
|
124
|
+
object: 'status_dependency';
|
|
125
|
+
id: string;
|
|
126
|
+
name: string;
|
|
127
|
+
/** Base URL of the Statuspage-compatible page (Atlas reads `{url}/api/v2/summary.json`). */
|
|
128
|
+
url: string;
|
|
129
|
+
component_filter: string[];
|
|
130
|
+
enabled: boolean;
|
|
131
|
+
state: StatusDependencyState;
|
|
132
|
+
indicator: string | null;
|
|
133
|
+
description: string | null;
|
|
134
|
+
components: Array<{
|
|
135
|
+
id: string;
|
|
136
|
+
name: string;
|
|
137
|
+
status: string;
|
|
138
|
+
}>;
|
|
139
|
+
incidents: Array<{
|
|
140
|
+
id: string;
|
|
141
|
+
name: string;
|
|
142
|
+
status: string;
|
|
143
|
+
impact: string;
|
|
144
|
+
updatedAt: string | null;
|
|
145
|
+
}>;
|
|
146
|
+
last_checked_at: number | null;
|
|
147
|
+
last_success_at: number | null;
|
|
148
|
+
last_error: string | null;
|
|
149
|
+
/** The last check failed or none has succeeded yet: `state` may be out of date. */
|
|
150
|
+
stale: boolean;
|
|
151
|
+
created_at: number;
|
|
152
|
+
}
|
|
153
|
+
export interface CreateStatusDependencyBody {
|
|
154
|
+
name: string;
|
|
155
|
+
url: string;
|
|
156
|
+
component_filter?: string[];
|
|
157
|
+
enabled?: boolean;
|
|
158
|
+
}
|
|
159
|
+
export interface UpdateStatusDependencyBody {
|
|
160
|
+
name?: string;
|
|
161
|
+
component_filter?: string[];
|
|
162
|
+
enabled?: boolean;
|
|
163
|
+
}
|
|
164
|
+
export declare function statusResource(request: RequestFn): {
|
|
165
|
+
/** `GET /v1/status` — the public service status (components with group and regions, open incidents). */
|
|
166
|
+
service(): Promise<ServiceStatus>;
|
|
167
|
+
/** `GET /v1/instance/status_subscription`. */
|
|
168
|
+
getSubscription(): Promise<StatusSubscription>;
|
|
169
|
+
/** `PUT /v1/instance/status_subscription` — create or change it; only the fields sent change. */
|
|
170
|
+
updateSubscription(body: UpdateStatusSubscriptionBody): Promise<StatusSubscription>;
|
|
171
|
+
/** `DELETE /v1/instance/status_subscription` — turn it off (settings are kept). */
|
|
172
|
+
disableSubscription(): Promise<StatusSubscription>;
|
|
173
|
+
/** `POST /v1/instance/status_subscription/rotate_feed` — a new private feed URL; the old one 404s. */
|
|
174
|
+
rotateFeed(): Promise<StatusSubscription>;
|
|
175
|
+
/** `GET /v1/instance/status_incidents` — incidents that concern this instance, newest first. */
|
|
176
|
+
listIncidents(params?: {
|
|
177
|
+
open?: boolean;
|
|
178
|
+
limit?: number;
|
|
179
|
+
}): Promise<{
|
|
180
|
+
object: "list";
|
|
181
|
+
data: StatusIncident[];
|
|
182
|
+
}>;
|
|
183
|
+
/** `GET /v1/instance/status_dependencies` — with `state`, the worst among the enabled ones. */
|
|
184
|
+
listDependencies(): Promise<{
|
|
185
|
+
object: "list";
|
|
186
|
+
data: StatusDependency[];
|
|
187
|
+
state: StatusDependencyState;
|
|
188
|
+
}>;
|
|
189
|
+
/** `POST /v1/instance/status_dependencies` — read at once; the answer carries the state or `last_error`. */
|
|
190
|
+
createDependency(body: CreateStatusDependencyBody): Promise<StatusDependency>;
|
|
191
|
+
getDependency(id: string): Promise<StatusDependency>;
|
|
192
|
+
updateDependency(id: string, body: UpdateStatusDependencyBody): Promise<StatusDependency>;
|
|
193
|
+
deleteDependency(id: string): Promise<{
|
|
194
|
+
object: "status_dependency";
|
|
195
|
+
id: string;
|
|
196
|
+
deleted: true;
|
|
197
|
+
}>;
|
|
198
|
+
/** `POST /v1/instance/status_dependencies/:id/refresh` — read the page now. */
|
|
199
|
+
refreshDependency(id: string): Promise<StatusDependency>;
|
|
200
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.statusResource = statusResource;
|
|
4
|
+
const request_1 = require("./request");
|
|
5
|
+
function statusResource(request) {
|
|
6
|
+
return {
|
|
7
|
+
/** `GET /v1/status` — the public service status (components with group and regions, open incidents). */
|
|
8
|
+
service() {
|
|
9
|
+
return request({ method: 'GET', path: '/v1/status' });
|
|
10
|
+
},
|
|
11
|
+
/** `GET /v1/instance/status_subscription`. */
|
|
12
|
+
getSubscription() {
|
|
13
|
+
return request({ method: 'GET', path: '/v1/instance/status_subscription' });
|
|
14
|
+
},
|
|
15
|
+
/** `PUT /v1/instance/status_subscription` — create or change it; only the fields sent change. */
|
|
16
|
+
updateSubscription(body) {
|
|
17
|
+
return request({ method: 'PUT', path: '/v1/instance/status_subscription', body });
|
|
18
|
+
},
|
|
19
|
+
/** `DELETE /v1/instance/status_subscription` — turn it off (settings are kept). */
|
|
20
|
+
disableSubscription() {
|
|
21
|
+
return request({ method: 'DELETE', path: '/v1/instance/status_subscription' });
|
|
22
|
+
},
|
|
23
|
+
/** `POST /v1/instance/status_subscription/rotate_feed` — a new private feed URL; the old one 404s. */
|
|
24
|
+
rotateFeed() {
|
|
25
|
+
return request({ method: 'POST', path: '/v1/instance/status_subscription/rotate_feed' });
|
|
26
|
+
},
|
|
27
|
+
/** `GET /v1/instance/status_incidents` — incidents that concern this instance, newest first. */
|
|
28
|
+
listIncidents(params = {}) {
|
|
29
|
+
return request({ method: 'GET', path: '/v1/instance/status_incidents', query: { ...params } });
|
|
30
|
+
},
|
|
31
|
+
/** `GET /v1/instance/status_dependencies` — with `state`, the worst among the enabled ones. */
|
|
32
|
+
listDependencies() {
|
|
33
|
+
return request({ method: 'GET', path: '/v1/instance/status_dependencies' });
|
|
34
|
+
},
|
|
35
|
+
/** `POST /v1/instance/status_dependencies` — read at once; the answer carries the state or `last_error`. */
|
|
36
|
+
createDependency(body) {
|
|
37
|
+
return request({ method: 'POST', path: '/v1/instance/status_dependencies', body });
|
|
38
|
+
},
|
|
39
|
+
getDependency(id) {
|
|
40
|
+
return request({ method: 'GET', path: `/v1/instance/status_dependencies/${(0, request_1.enc)(id)}` });
|
|
41
|
+
},
|
|
42
|
+
updateDependency(id, body) {
|
|
43
|
+
return request({ method: 'PATCH', path: `/v1/instance/status_dependencies/${(0, request_1.enc)(id)}`, body });
|
|
44
|
+
},
|
|
45
|
+
deleteDependency(id) {
|
|
46
|
+
return request({ method: 'DELETE', path: `/v1/instance/status_dependencies/${(0, request_1.enc)(id)}` });
|
|
47
|
+
},
|
|
48
|
+
/** `POST /v1/instance/status_dependencies/:id/refresh` — read the page now. */
|
|
49
|
+
refreshDependency(id) {
|
|
50
|
+
return request({ method: 'POST', path: `/v1/instance/status_dependencies/${(0, request_1.enc)(id)}/refresh` });
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/client/status.ts"],"names":[],"mappings":";;AA8JA,wCAgDC;AA9MD,uCAAgD;AA8JhD,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,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,oCAAoC,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACzF,CAAC;QACD,gBAAgB,CAAC,EAAU,EAAE,IAAgC;YAC3D,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,oCAAoC,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QACjG,CAAC;QACD,gBAAgB,CAAC,EAAU;YACzB,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,oCAAoC,IAAA,aAAG,EAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5F,CAAC;QACD,+EAA+E;QAC/E,iBAAiB,CAAC,EAAU;YAC1B,OAAO,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,oCAAoC,IAAA,aAAG,EAAC,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC;QAClG,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/client/users.d.ts
CHANGED
|
@@ -199,6 +199,8 @@ export interface ListUsersParams extends CursorParams {
|
|
|
199
199
|
offset?: number;
|
|
200
200
|
/** Adds `total_count` (a COUNT over the filters) to the page. */
|
|
201
201
|
include_total_count?: boolean;
|
|
202
|
+
/** Also list soft-deleted users still in their scrub window (each with `deleted_at` set). Default false. */
|
|
203
|
+
include_deleted?: boolean;
|
|
202
204
|
}
|
|
203
205
|
export interface CreateUserBody {
|
|
204
206
|
email_address: string;
|
package/dist/client/users.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/client/users.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/client/users.ts"],"names":[],"mappings":";;AAgQA,sCA+cC;AA/sBD,u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AAC,EAAU,EAAE,IAA8B;gBACjD,OAAO,OAAO,CAAC;oBACb,MAAM,EAAE,MAAM;oBACd,IAAI,EAAE,aAAa,IAAA,aAAG,EAAC,EAAE,CAAC,qBAAqB;oBAC/C,IAAI;iBACL,CAAC,CAAC;YACL,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,13 +1,98 @@
|
|
|
1
|
+
import { type ProvisioningFields, type ProvisioningInput, type ProvisioningMetadata } from './compliance';
|
|
1
2
|
import { type RequestFn } from './request';
|
|
2
|
-
export
|
|
3
|
+
export type WebhookDestinationType = 'https' | 'aws_eventbridge' | 'gcp_pubsub' | 'cloudflare_queue';
|
|
4
|
+
/** Where deliveries go. Credentials are never returned. */
|
|
5
|
+
export type WebhookDestination = {
|
|
6
|
+
type: 'https';
|
|
7
|
+
} | {
|
|
8
|
+
type: 'aws_eventbridge';
|
|
9
|
+
region: string;
|
|
10
|
+
event_bus_name: string;
|
|
11
|
+
source?: string;
|
|
12
|
+
} | {
|
|
13
|
+
type: 'gcp_pubsub';
|
|
14
|
+
project_id: string;
|
|
15
|
+
topic_id: string;
|
|
16
|
+
} | {
|
|
17
|
+
type: 'cloudflare_queue';
|
|
18
|
+
account_id: string;
|
|
19
|
+
queue_id: string;
|
|
20
|
+
};
|
|
21
|
+
/** Your own credentials for an event destination (stored encrypted, write-only). */
|
|
22
|
+
export type WebhookDestinationCredentials = {
|
|
23
|
+
access_key_id: string;
|
|
24
|
+
secret_access_key: string;
|
|
25
|
+
session_token?: string;
|
|
26
|
+
} | {
|
|
27
|
+
service_account_json: string | Record<string, unknown>;
|
|
28
|
+
} | {
|
|
29
|
+
api_token: string;
|
|
30
|
+
};
|
|
31
|
+
export interface WebhookLastFailure {
|
|
32
|
+
at: number;
|
|
33
|
+
status: number | null;
|
|
34
|
+
error: string | null;
|
|
35
|
+
}
|
|
36
|
+
export interface WebhookAutoDisableRule {
|
|
37
|
+
after_failing_ms: number;
|
|
38
|
+
after_consecutive_failures: number;
|
|
39
|
+
consecutive_failures_min_failing_ms: number;
|
|
40
|
+
description: string;
|
|
41
|
+
}
|
|
42
|
+
export interface WebhookRetention {
|
|
43
|
+
events_days: number;
|
|
44
|
+
delivery_log_days: number;
|
|
45
|
+
replay_window_days: number;
|
|
46
|
+
}
|
|
47
|
+
export interface WebhookEndpoint extends ProvisioningFields {
|
|
3
48
|
object: 'webhook_endpoint';
|
|
4
49
|
id: string;
|
|
50
|
+
/** The HTTPS receiver, or a descriptor such as `aws-eventbridge://us-east-1/default`. */
|
|
5
51
|
url: string;
|
|
52
|
+
description?: string | null;
|
|
6
53
|
enabled_events: string[];
|
|
54
|
+
/** Which names `*` delivers under. */
|
|
55
|
+
event_naming?: 'canonical' | 'legacy';
|
|
7
56
|
active: boolean;
|
|
57
|
+
/** A third-party receiver: preflight does not flag its host. */
|
|
58
|
+
external?: boolean;
|
|
59
|
+
signature_versions?: Array<'v1' | 'v2'>;
|
|
60
|
+
destination?: WebhookDestination & {
|
|
61
|
+
credentials_set?: boolean;
|
|
62
|
+
};
|
|
63
|
+
health?: 'healthy' | 'failing' | 'disabled';
|
|
8
64
|
/** Start of the current failure streak (epoch ms), or null when the last delivery succeeded. */
|
|
9
65
|
failing_since?: number | null;
|
|
66
|
+
/** Start of the streak that preceded the last re-enable (epoch ms); what `since: 'failing_since'` resolves to once the live streak is cleared. */
|
|
67
|
+
last_failing_since?: number | null;
|
|
10
68
|
disabled_at: number | null;
|
|
69
|
+
last_success_at?: number | null;
|
|
70
|
+
last_failure?: WebhookLastFailure | null;
|
|
71
|
+
consecutive_failures?: number;
|
|
72
|
+
/** Share of attempts in the last 24 hours that succeeded (0–1), null with none. */
|
|
73
|
+
success_rate_24h?: number | null;
|
|
74
|
+
attempts_24h?: {
|
|
75
|
+
succeeded: number;
|
|
76
|
+
failed: number;
|
|
77
|
+
};
|
|
78
|
+
/** Who is emailed when it fails; null = the account's owners. */
|
|
79
|
+
alert_contacts?: string[] | null;
|
|
80
|
+
alerts_sent?: {
|
|
81
|
+
first_sent_at: number | null;
|
|
82
|
+
second_sent_at: number | null;
|
|
83
|
+
disabled_sent_at: number | null;
|
|
84
|
+
};
|
|
85
|
+
auto_disable?: WebhookAutoDisableRule;
|
|
86
|
+
/** On an update that re-enabled the endpoint: the replay that re-sends what it missed. */
|
|
87
|
+
replay?: {
|
|
88
|
+
since: number;
|
|
89
|
+
method: 'POST';
|
|
90
|
+
path: string;
|
|
91
|
+
note: string;
|
|
92
|
+
} | null;
|
|
93
|
+
/** On create / upsert: whether this call created it. */
|
|
94
|
+
created?: boolean;
|
|
95
|
+
updated_at?: number;
|
|
11
96
|
/**
|
|
12
97
|
* While a secret rotation overlap is open: when the previous secret stops
|
|
13
98
|
* signing deliveries (epoch ms). Until then every delivery carries two
|
|
@@ -16,16 +101,33 @@ export interface WebhookEndpoint {
|
|
|
16
101
|
previous_secret_expires_at?: number | null;
|
|
17
102
|
created_at: number;
|
|
18
103
|
}
|
|
19
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* What a response sealed with `X-Secret-Recipient` (the client's
|
|
106
|
+
* `secretRecipient` option) says it sealed: each listed field arrives as
|
|
107
|
+
* `sealed_<field>` instead of in plaintext.
|
|
108
|
+
*/
|
|
109
|
+
export interface SecretsSealed {
|
|
110
|
+
algorithm: string;
|
|
111
|
+
recipient: string;
|
|
112
|
+
fields: string[];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Create reveals the signing secret (`whsec_...`) exactly once. With a
|
|
116
|
+
* `secretRecipient` it arrives as `sealed_secret` (open it with
|
|
117
|
+
* `openSealedSecret`) and `secret` is absent.
|
|
118
|
+
*/
|
|
20
119
|
export interface WebhookEndpointWithSecret extends WebhookEndpoint {
|
|
21
120
|
secret: string;
|
|
121
|
+
sealed_secret?: string;
|
|
122
|
+
secrets_sealed?: SecretsSealed;
|
|
22
123
|
}
|
|
23
124
|
export interface WebhookDelivery {
|
|
24
125
|
object: 'webhook_delivery';
|
|
25
126
|
id: string;
|
|
26
127
|
event_id: string;
|
|
27
|
-
/** The event
|
|
128
|
+
/** The name the event was delivered as, or null once the event has passed its retention. */
|
|
28
129
|
event_type?: string | null;
|
|
130
|
+
latency_ms?: number | null;
|
|
29
131
|
attempt_number: number;
|
|
30
132
|
max_attempts?: number;
|
|
31
133
|
/** The payload that was sent (null once the event has passed its retention). */
|
|
@@ -45,16 +147,95 @@ export interface WebhookDelivery {
|
|
|
45
147
|
delivered_at: number | null;
|
|
46
148
|
created_at: number;
|
|
47
149
|
}
|
|
48
|
-
export interface
|
|
49
|
-
|
|
50
|
-
/** Each entry is `"*"` or a known event name. */
|
|
150
|
+
export interface WebhookEndpointSettings {
|
|
151
|
+
/** Each entry is `"*"` or an event name (canonical or a deprecated spelling). */
|
|
51
152
|
enabled_events?: string[];
|
|
153
|
+
event_naming?: 'canonical' | 'legacy';
|
|
154
|
+
external?: boolean;
|
|
155
|
+
signature_versions?: Array<'v1' | 'v2'>;
|
|
156
|
+
/** Up to 20 addresses; null = the account's owners. */
|
|
157
|
+
alert_contacts?: string[] | null;
|
|
158
|
+
description?: string | null;
|
|
159
|
+
/** An event destination instead of an HTTPS url. */
|
|
160
|
+
destination?: WebhookDestination;
|
|
161
|
+
destination_credentials?: WebhookDestinationCredentials;
|
|
162
|
+
}
|
|
163
|
+
export interface CreateWebhookEndpointBody extends WebhookEndpointSettings, ProvisioningInput {
|
|
164
|
+
/** Required unless `destination` is an event destination. */
|
|
165
|
+
url?: string;
|
|
52
166
|
}
|
|
53
167
|
/** Change an endpoint in place. The signing secret is kept. */
|
|
54
|
-
export interface UpdateWebhookEndpointBody {
|
|
168
|
+
export interface UpdateWebhookEndpointBody extends WebhookEndpointSettings {
|
|
55
169
|
url?: string;
|
|
56
|
-
enabled_events?: string[];
|
|
57
170
|
active?: boolean;
|
|
171
|
+
/** Replaces the provisioning metadata. */
|
|
172
|
+
metadata?: ProvisioningMetadata;
|
|
173
|
+
}
|
|
174
|
+
/** Find-or-create by url. */
|
|
175
|
+
export interface UpsertWebhookEndpointBody extends WebhookEndpointSettings {
|
|
176
|
+
url: string;
|
|
177
|
+
}
|
|
178
|
+
/** The inline result of `test(id, { wait })`. */
|
|
179
|
+
export interface WebhookTestResult {
|
|
180
|
+
object: 'webhook_test_result';
|
|
181
|
+
delivery_id: string;
|
|
182
|
+
event_id: string;
|
|
183
|
+
status: 'success' | 'failed';
|
|
184
|
+
http_status: number | null;
|
|
185
|
+
latency_ms: number | null;
|
|
186
|
+
response_snippet: string | null;
|
|
187
|
+
error: string | null;
|
|
188
|
+
signature_header_sent: string | null;
|
|
189
|
+
will_retry: boolean;
|
|
190
|
+
}
|
|
191
|
+
export interface WebhookWindow {
|
|
192
|
+
/** Epoch ms or ISO 8601 (at most 90 days ago), or the keyword `'failing_since'` for the endpoint's own failure streak. */
|
|
193
|
+
since?: number | string;
|
|
194
|
+
until?: number | string;
|
|
195
|
+
}
|
|
196
|
+
export interface WebhookBulkResult {
|
|
197
|
+
object: 'webhook_redelivery' | 'webhook_replay';
|
|
198
|
+
endpoint_id: string;
|
|
199
|
+
queued: number;
|
|
200
|
+
events_considered?: number;
|
|
201
|
+
has_more: boolean;
|
|
202
|
+
/** Pass as `since` to continue. */
|
|
203
|
+
next_since: number | null;
|
|
204
|
+
retention: WebhookRetention;
|
|
205
|
+
}
|
|
206
|
+
export interface EgressIps {
|
|
207
|
+
object: 'egress_ips';
|
|
208
|
+
/** false: this deployment does not send from fixed addresses. */
|
|
209
|
+
static: boolean;
|
|
210
|
+
ipv4: string[];
|
|
211
|
+
ipv6: string[];
|
|
212
|
+
applies_to: string[];
|
|
213
|
+
note: string;
|
|
214
|
+
}
|
|
215
|
+
export type DeliveryTargetKind = 'webhook_endpoint' | 'referral_connection' | 'backchannel_receiver' | 'integration';
|
|
216
|
+
export interface DeliveryHealth {
|
|
217
|
+
object: 'delivery_health';
|
|
218
|
+
kind: DeliveryTargetKind;
|
|
219
|
+
target_id: string;
|
|
220
|
+
url: string | null;
|
|
221
|
+
label: string | null;
|
|
222
|
+
state: 'healthy' | 'failing' | 'disabled';
|
|
223
|
+
failing_since: number | null;
|
|
224
|
+
disabled_at: number | null;
|
|
225
|
+
last_success_at: number | null;
|
|
226
|
+
last_failure: WebhookLastFailure | null;
|
|
227
|
+
consecutive_failures: number;
|
|
228
|
+
success_rate_24h: number | null;
|
|
229
|
+
attempts_24h: {
|
|
230
|
+
succeeded: number;
|
|
231
|
+
failed: number;
|
|
232
|
+
};
|
|
233
|
+
alert_contacts: string[] | null;
|
|
234
|
+
alerts: {
|
|
235
|
+
first_sent_at: number | null;
|
|
236
|
+
second_sent_at: number | null;
|
|
237
|
+
disabled_sent_at: number | null;
|
|
238
|
+
};
|
|
58
239
|
}
|
|
59
240
|
/** One subscribable event, described. */
|
|
60
241
|
export interface WebhookEventCatalogEntry {
|
|
@@ -62,8 +243,18 @@ export interface WebhookEventCatalogEntry {
|
|
|
62
243
|
description: string;
|
|
63
244
|
/** Who should act on it, e.g. `rp_sessions`, `rp_accounts`, `dsar`. Empty: no relying party needs it. */
|
|
64
245
|
relevant_for: string[];
|
|
65
|
-
/** Set on a
|
|
246
|
+
/** Set on a deprecated spelling: subscribe to this canonical event instead. */
|
|
66
247
|
deprecated_alias_of?: string;
|
|
248
|
+
/** `rename`: sent whenever the canonical event is; `companion`: only for some occurrences. */
|
|
249
|
+
alias_kind?: 'rename' | 'companion';
|
|
250
|
+
deprecated_at?: string;
|
|
251
|
+
/** After this the deprecated spelling is no longer sent (ISO 8601). */
|
|
252
|
+
sunset_at?: string;
|
|
253
|
+
/** JSON pointer to this event's payload schema in the OpenAPI document (`components.schemas.WebhookEvent.<name>`). */
|
|
254
|
+
payload_schema?: string;
|
|
255
|
+
version?: number;
|
|
256
|
+
/** When the event became available (YYYY-MM-DD). */
|
|
257
|
+
since?: string;
|
|
67
258
|
}
|
|
68
259
|
/** The endpoint list plus the delivery settings that apply to every endpoint. */
|
|
69
260
|
export interface WebhookEndpointList {
|
|
@@ -81,11 +272,23 @@ export interface WebhookEndpointList {
|
|
|
81
272
|
retry_schedule_ms?: number[];
|
|
82
273
|
/** Delivery attempts per event before it is marked failed. */
|
|
83
274
|
max_attempts?: number;
|
|
275
|
+
auto_disable?: WebhookAutoDisableRule;
|
|
276
|
+
retention?: WebhookRetention;
|
|
277
|
+
signature_versions?: string[];
|
|
278
|
+
destination_types?: Array<{
|
|
279
|
+
type: WebhookDestinationType;
|
|
280
|
+
name: string;
|
|
281
|
+
config: string[];
|
|
282
|
+
credentials: string[];
|
|
283
|
+
}>;
|
|
84
284
|
}
|
|
85
285
|
export interface WebhookSigningSecret {
|
|
86
286
|
object: 'webhook_secret';
|
|
87
|
-
/** The `whsec_...` signing secret. */
|
|
287
|
+
/** The `whsec_...` signing secret (absent when sealed: see `sealed_secret`). */
|
|
88
288
|
secret: string;
|
|
289
|
+
/** With a `secretRecipient`: the secret sealed to it. */
|
|
290
|
+
sealed_secret?: string;
|
|
291
|
+
secrets_sealed?: SecretsSealed;
|
|
89
292
|
/** On a rotation: the overlap applied, in seconds. */
|
|
90
293
|
overlap_seconds?: number;
|
|
91
294
|
/** On a rotation: when the previous secret stops signing deliveries (epoch ms), or null when it already has. */
|
|
@@ -110,12 +313,33 @@ export interface WebhookDeliveryQueued {
|
|
|
110
313
|
note: string;
|
|
111
314
|
}
|
|
112
315
|
export interface ListWebhookDeliveriesParams {
|
|
113
|
-
/** How many deliveries to return (1–
|
|
316
|
+
/** How many deliveries to return (1–1000, default 50). */
|
|
114
317
|
limit?: number;
|
|
318
|
+
starting_after?: string;
|
|
319
|
+
status?: 'pending' | 'success' | 'failed';
|
|
320
|
+
/** Comma-separated event names. */
|
|
321
|
+
event_type?: string;
|
|
322
|
+
/** Epoch ms or ISO 8601. */
|
|
323
|
+
since?: number | string;
|
|
324
|
+
until?: number | string;
|
|
115
325
|
}
|
|
116
326
|
export declare function webhooksResource(request: RequestFn): {
|
|
117
327
|
endpoints: {
|
|
118
|
-
|
|
328
|
+
/** `includeDeprecated` adds the deprecated event spellings to the catalogue. */
|
|
329
|
+
/** `metadata` filters on provisioning tags (`?metadata[key]=value`). */
|
|
330
|
+
list(opts?: {
|
|
331
|
+
includeDeprecated?: boolean;
|
|
332
|
+
metadata?: ProvisioningMetadata;
|
|
333
|
+
}): Promise<WebhookEndpointList>;
|
|
334
|
+
get(id: string): Promise<WebhookEndpoint>;
|
|
335
|
+
/**
|
|
336
|
+
* Find-or-create by url: updates the endpoint with this url to `body`, or
|
|
337
|
+
* creates it (then `secret` is in the result, once). Safe to run on every deploy.
|
|
338
|
+
*/
|
|
339
|
+
upsertByUrl(body: UpsertWebhookEndpointBody, idempotencyKey?: string): Promise<WebhookEndpoint & {
|
|
340
|
+
secret?: string;
|
|
341
|
+
created: boolean;
|
|
342
|
+
}>;
|
|
119
343
|
/** Update url, enabled_events or active. The signing secret is kept. */
|
|
120
344
|
update(id: string, body: UpdateWebhookEndpointBody): Promise<WebhookEndpoint>;
|
|
121
345
|
/** Show the current signing secret again. Audited. */
|
|
@@ -126,8 +350,23 @@ export declare function webhooksResource(request: RequestFn): {
|
|
|
126
350
|
* every delivery is signed with both, so a verifier holding either passes.
|
|
127
351
|
*/
|
|
128
352
|
rotateSecret(id: string, body?: RotateWebhookSecretBody): Promise<WebhookSigningSecret>;
|
|
129
|
-
/** Send a synthetic `webhook.test` event to this endpoint only. */
|
|
353
|
+
/** Send a synthetic `webhook.test` event to this endpoint only (queued for the worker). */
|
|
130
354
|
test(id: string): Promise<WebhookDeliveryQueued>;
|
|
355
|
+
/**
|
|
356
|
+
* Send `webhook.test` now and return the result: status, HTTP status,
|
|
357
|
+
* latency, response snippet, error and the signature header sent.
|
|
358
|
+
* `wait` is at most 10 s (`'10s'`, `'5000ms'`).
|
|
359
|
+
*/
|
|
360
|
+
testNow(id: string, wait?: string): Promise<WebhookTestResult>;
|
|
361
|
+
/** Bulk redeliver every event whose latest attempt in the window has `status` (default failed). */
|
|
362
|
+
redeliverWindow(id: string, body?: WebhookWindow & {
|
|
363
|
+
status?: "failed" | "success";
|
|
364
|
+
}, idempotencyKey?: string): Promise<WebhookBulkResult>;
|
|
365
|
+
/** Re-send everything since `since` the endpoint subscribes to and has not received. */
|
|
366
|
+
replay(id: string, body: WebhookWindow & {
|
|
367
|
+
since: number | string;
|
|
368
|
+
event_type?: string;
|
|
369
|
+
}, idempotencyKey?: string): Promise<WebhookBulkResult>;
|
|
131
370
|
/** Redeliver a past event as a fresh attempt (409 once past its retention). */
|
|
132
371
|
redeliver(id: string, deliveryId: string): Promise<WebhookDeliveryQueued>;
|
|
133
372
|
create(body: CreateWebhookEndpointBody, idempotencyKey?: string): Promise<WebhookEndpointWithSecret>;
|
|
@@ -143,6 +382,19 @@ export declare function webhooksResource(request: RequestFn): {
|
|
|
143
382
|
has_more: boolean;
|
|
144
383
|
next_cursor?: string | null;
|
|
145
384
|
}>;
|
|
385
|
+
/** The addresses deliveries leave from (public). */
|
|
386
|
+
egressIps(): Promise<EgressIps>;
|
|
387
|
+
/** Delivery health of every outbound target (webhooks, referral connection, back-channel receivers, integrations). */
|
|
388
|
+
health(params?: {
|
|
389
|
+
kind?: DeliveryTargetKind;
|
|
390
|
+
state?: "unhealthy" | "all";
|
|
391
|
+
}): Promise<{
|
|
392
|
+
data: DeliveryHealth[];
|
|
393
|
+
has_more: boolean;
|
|
394
|
+
unhealthy_count: number;
|
|
395
|
+
}>;
|
|
396
|
+
/** Set who is emailed when a target fails (null = the account's owners). */
|
|
397
|
+
setAlertContacts(kind: DeliveryTargetKind, targetId: string, alertContacts: string[] | null): Promise<DeliveryHealth>;
|
|
146
398
|
/** Redeliver a past event (same as `endpoints.redeliver`). */
|
|
147
399
|
redeliver(endpointId: string, deliveryId: string): Promise<WebhookDeliveryQueued>;
|
|
148
400
|
};
|