@haakco/custd-sdk 2.4.0 → 3.71.2
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/LICENSE +21 -0
- package/README.md +586 -40
- package/dist/admin-accounting-evidence.d.ts +48 -0
- package/dist/admin-accounting-evidence.js +24 -0
- package/dist/admin-app-releases.d.ts +116 -0
- package/dist/admin-app-releases.js +8 -0
- package/dist/admin-apps.d.ts +120 -0
- package/dist/admin-apps.js +47 -0
- package/dist/admin-auth-project-domain.d.ts +125 -0
- package/dist/admin-auth-project-domain.js +37 -0
- package/dist/admin-auth-projects.d.ts +989 -0
- package/dist/admin-auth-projects.js +527 -0
- package/dist/admin-campaign-email.d.ts +120 -0
- package/dist/admin-campaign-email.js +64 -0
- package/dist/admin-client-setup.d.ts +22 -0
- package/dist/admin-client-setup.js +11 -1
- package/dist/admin-data-scopes.d.ts +93 -0
- package/dist/admin-data-scopes.js +154 -0
- package/dist/admin-email-relay.d.ts +66 -0
- package/dist/admin-email-relay.js +25 -0
- package/dist/admin-environment-policy.d.ts +32 -0
- package/dist/admin-environment-policy.js +26 -0
- package/dist/admin-error-issues.d.ts +91 -0
- package/dist/admin-error-issues.js +52 -0
- package/dist/admin-event-types.d.ts +57 -0
- package/dist/admin-event-types.js +28 -0
- package/dist/admin-impersonation.d.ts +48 -0
- package/dist/admin-impersonation.js +27 -0
- package/dist/admin-ingest-claims.d.ts +35 -0
- package/dist/admin-ingest-claims.js +26 -0
- package/dist/admin-managed-audit.d.ts +13 -0
- package/dist/admin-managed-audit.js +13 -0
- package/dist/admin-measurement-projects.d.ts +166 -0
- package/dist/admin-measurement-projects.js +120 -0
- package/dist/admin-notification-destinations.d.ts +31 -0
- package/dist/admin-notification-destinations.js +19 -0
- package/dist/admin-notification-webhooks.d.ts +64 -0
- package/dist/admin-notification-webhooks.js +42 -0
- package/dist/admin-oauth-client-admissions.d.ts +65 -0
- package/dist/admin-oauth-client-admissions.js +46 -0
- package/dist/admin-offboarding.d.ts +20 -6
- package/dist/admin-offboarding.js +27 -6
- package/dist/admin-predictions.d.ts +127 -8
- package/dist/admin-predictions.js +22 -12
- package/dist/admin-privacy-erasures.d.ts +24 -12
- package/dist/admin-privacy-erasures.js +3 -2
- package/dist/admin-retention.d.ts +72 -24
- package/dist/admin-retention.js +38 -13
- package/dist/admin-rls.d.ts +94 -0
- package/dist/admin-rls.js +33 -0
- package/dist/admin-sdk-usage.d.ts +41 -0
- package/dist/admin-sdk-usage.js +23 -0
- package/dist/admin-site-ai.d.ts +72 -0
- package/dist/admin-site-ai.js +1 -0
- package/dist/admin-site-analytics.d.ts +52 -0
- package/dist/admin-site-analytics.js +14 -0
- package/dist/admin-site-audit-pages.d.ts +76 -0
- package/dist/admin-site-audit-pages.js +27 -0
- package/dist/admin-site-campaign-links.d.ts +40 -0
- package/dist/admin-site-campaign-links.js +9 -0
- package/dist/admin-site-domains.d.ts +733 -0
- package/dist/admin-site-domains.js +768 -0
- package/dist/admin-site-export.d.ts +76 -0
- package/dist/admin-site-export.js +15 -0
- package/dist/admin-site-insights-tasks.d.ts +44 -0
- package/dist/admin-site-insights-tasks.js +28 -0
- package/dist/admin-site-insights.d.ts +527 -0
- package/dist/admin-site-insights.js +61 -0
- package/dist/admin-site-links.d.ts +87 -0
- package/dist/admin-site-links.js +16 -0
- package/dist/admin-site-monitors.d.ts +110 -0
- package/dist/admin-site-monitors.js +25 -0
- package/dist/admin-site-next-actions.d.ts +93 -0
- package/dist/admin-site-next-actions.js +36 -0
- package/dist/admin-site-page-queries.d.ts +63 -0
- package/dist/admin-site-page-queries.js +20 -0
- package/dist/admin-site-rankings.d.ts +98 -0
- package/dist/admin-site-rankings.js +46 -0
- package/dist/admin-site-regional-trends.d.ts +30 -0
- package/dist/admin-site-regional-trends.js +1 -0
- package/dist/admin-site-saved-reports.d.ts +45 -0
- package/dist/admin-site-saved-reports.js +13 -0
- package/dist/admin-site-search-pool.d.ts +77 -0
- package/dist/admin-site-search-pool.js +41 -0
- package/dist/admin-site-search-value.d.ts +97 -0
- package/dist/admin-site-search-value.js +29 -0
- package/dist/admin-site-status-page.d.ts +57 -0
- package/dist/admin-site-status-page.js +10 -0
- package/dist/admin-site-traffic.d.ts +145 -0
- package/dist/admin-site-traffic.js +32 -0
- package/dist/admin-site-web-data.d.ts +258 -0
- package/dist/admin-site-web-data.js +60 -0
- package/dist/admin-subject-exports.d.ts +58 -27
- package/dist/admin-subject-exports.js +32 -16
- package/dist/admin-support-access.d.ts +32 -0
- package/dist/admin-support-access.js +21 -0
- package/dist/admin-system.d.ts +283 -0
- package/dist/admin-system.js +65 -0
- package/dist/admin-tenant-storage.d.ts +22 -14
- package/dist/admin-tenant-storage.js +13 -14
- package/dist/admin-timeplans.d.ts +276 -2
- package/dist/admin-timeplans.js +54 -0
- package/dist/admin-uncertainty-models.d.ts +42 -0
- package/dist/admin-uncertainty-models.js +53 -0
- package/dist/admin-usage.d.ts +124 -0
- package/dist/admin-usage.js +169 -0
- package/dist/admin-users.d.ts +124 -0
- package/dist/admin-users.js +82 -0
- package/dist/admin-workflow-timings.d.ts +367 -0
- package/dist/admin-workflow-timings.js +117 -0
- package/dist/analytics-events.d.ts +82 -0
- package/dist/analytics-events.js +157 -0
- package/dist/analytics-reads.d.ts +81 -0
- package/dist/analytics-reads.js +5 -0
- package/dist/app-account.d.ts +84 -0
- package/dist/app-account.js +177 -0
- package/dist/app-alerts.d.ts +120 -0
- package/dist/app-alerts.js +44 -0
- package/dist/app-items.d.ts +786 -0
- package/dist/app-items.js +524 -0
- package/dist/app-live.d.ts +84 -0
- package/dist/app-live.js +228 -0
- package/dist/app-meetings.d.ts +95 -0
- package/dist/app-meetings.js +26 -0
- package/dist/app-models.d.ts +271 -0
- package/dist/app-models.js +83 -0
- package/dist/app-push.d.ts +64 -0
- package/dist/app-push.js +178 -0
- package/dist/backend-lifecycle.d.ts +2 -2
- package/dist/browser-manifest.json +5 -5
- package/dist/browser-script-BWnwDjAC.js +711 -0
- package/dist/browser-sign-in.d.ts +153 -0
- package/dist/browser-sign-in.js +410 -0
- package/dist/browser-tracker.d.ts +95 -0
- package/dist/browser-tracker.js +362 -40
- package/dist/browser-web-vitals.d.ts +22 -0
- package/dist/browser-web-vitals.js +116 -0
- package/dist/browser.d.ts +9 -0
- package/dist/browser.js +9 -0
- package/dist/download-stream.d.ts +16 -0
- package/dist/download-stream.js +55 -0
- package/dist/error-capture.d.ts +62 -0
- package/dist/error-capture.js +168 -0
- package/dist/hosted-app.d.ts +115 -0
- package/dist/hosted-app.js +275 -0
- package/dist/index.d.ts +1168 -154
- package/dist/index.js +682 -162
- package/dist/ingest-operations.d.ts +483 -0
- package/dist/ingest-operations.js +154 -0
- package/dist/measurement.d.ts +164 -0
- package/dist/measurement.js +104 -0
- package/dist/parsers.d.ts +149 -0
- package/dist/parsers.js +115 -0
- package/dist/public-reads.d.ts +79 -0
- package/dist/public-reads.js +57 -0
- package/dist/reporting-catalogue.d.ts +264 -0
- package/dist/reporting-catalogue.js +5 -0
- package/dist/response-lists.d.ts +16 -0
- package/dist/response-lists.generated.d.ts +7 -0
- package/dist/response-lists.generated.js +1927 -0
- package/dist/response-lists.js +70 -0
- package/dist/response-validation.d.ts +30 -0
- package/dist/response-validation.js +94 -0
- package/dist/schema-registry.d.ts +45 -0
- package/dist/schema-registry.js +9 -0
- package/dist/secure-url.d.ts +4 -0
- package/dist/secure-url.js +23 -0
- package/dist/site-ai-owner.d.ts +34 -0
- package/dist/site-ai-owner.js +99 -0
- package/dist/site-monitor-reports.d.ts +15 -0
- package/dist/site-monitor-reports.js +87 -0
- package/dist/testing/fake-custd.d.ts +150 -0
- package/dist/testing/fake-custd.js +842 -0
- package/dist/testing/fake-results.d.ts +30 -0
- package/dist/testing/fake-results.js +293 -0
- package/dist/testing.d.ts +2 -0
- package/dist/testing.js +3 -0
- package/dist/version.d.ts +2 -2
- package/dist/version.js +1 -1
- package/package.json +25 -14
- package/dist/browser-script-BvgjdZSO.js +0 -429
- package/dist/fixtures.d.ts +0 -10
- package/dist/fixtures.js +0 -57
package/dist/analytics-events.js
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
// It reads a tenant's own ingested events, including payloads, behind the dedicated
|
|
4
4
|
// `events.read` scope. Effective-tenant authority is enforced server-side, so the caller
|
|
5
5
|
// never supplies a tenant slug — the credential already names the tenant.
|
|
6
|
+
import { optionalInteger, optionalRecord, optionalString, requireBoolean, requireInteger, requireObjectList, requireRecord, requireString, } from "./response-validation.js";
|
|
7
|
+
const ANALYTICS_RANGE_QUERY_SOURCES = ["", "auto", "duckdb"];
|
|
8
|
+
/** The longest inclusive range the service accepts, in days. */
|
|
9
|
+
export const ANALYTICS_MAX_RANGE_DAYS = 120;
|
|
10
|
+
/** The only bucket granularity the service supports today. */
|
|
11
|
+
export const ANALYTICS_RANGE_GROUP_BY = "day";
|
|
6
12
|
/** The server accepts at most this many label filters on one query. */
|
|
7
13
|
export const ANALYTICS_MAX_LABEL_FILTERS = 4;
|
|
8
14
|
export class AnalyticsEventClient {
|
|
@@ -35,6 +41,157 @@ export class AnalyticsEventClient {
|
|
|
35
41
|
if (labelFilters.length > 0) {
|
|
36
42
|
body.labelFilters = labelFilters;
|
|
37
43
|
}
|
|
44
|
+
appendLogDimensionFilters(body, request);
|
|
38
45
|
return this.request("POST", "/analytics/query", body, options);
|
|
39
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Query this tenant's own events across an inclusive date range.
|
|
49
|
+
*
|
|
50
|
+
* Only the documented public fields are serialised. As with {@link query}, the internal
|
|
51
|
+
* `anonymousId` predicate and `countOnly` flag are absent from the service's public JSON
|
|
52
|
+
* contract and cannot be transmitted by a caller passing extra properties.
|
|
53
|
+
*/
|
|
54
|
+
async queryRange(request, options) {
|
|
55
|
+
const labelFilters = request.labelFilters ?? [];
|
|
56
|
+
if (labelFilters.length > ANALYTICS_MAX_LABEL_FILTERS) {
|
|
57
|
+
throw new RangeError(`custd: analytics range query accepts at most ${ANALYTICS_MAX_LABEL_FILTERS} label filters, received ${labelFilters.length}`);
|
|
58
|
+
}
|
|
59
|
+
if (request.groupBy !== undefined && request.groupBy !== ANALYTICS_RANGE_GROUP_BY) {
|
|
60
|
+
throw new RangeError(`custd: analytics range query groupBy must be "${ANALYTICS_RANGE_GROUP_BY}"`);
|
|
61
|
+
}
|
|
62
|
+
if (request.source !== undefined && !ANALYTICS_RANGE_QUERY_SOURCES.includes(request.source)) {
|
|
63
|
+
throw new RangeError(`custd: analytics range query source must be one of ${ANALYTICS_RANGE_QUERY_SOURCES.filter((value) => value !== "").join(", ")}`);
|
|
64
|
+
}
|
|
65
|
+
assertRangeWithinLimit(request.from, request.to);
|
|
66
|
+
const body = { from: request.from, to: request.to };
|
|
67
|
+
if (request.eventType !== undefined) {
|
|
68
|
+
body.eventType = request.eventType;
|
|
69
|
+
}
|
|
70
|
+
if (request.limit !== undefined) {
|
|
71
|
+
body.limit = request.limit;
|
|
72
|
+
}
|
|
73
|
+
if (request.source !== undefined && request.source !== "") {
|
|
74
|
+
body.source = request.source;
|
|
75
|
+
}
|
|
76
|
+
if (request.groupBy !== undefined) {
|
|
77
|
+
body.groupBy = request.groupBy;
|
|
78
|
+
}
|
|
79
|
+
if (labelFilters.length > 0) {
|
|
80
|
+
body.labelFilters = labelFilters;
|
|
81
|
+
}
|
|
82
|
+
appendLogDimensionFilters(body, request);
|
|
83
|
+
const value = await this.request("POST", "/analytics/query-range", body, options);
|
|
84
|
+
return assertRangeQueryResponse(value);
|
|
85
|
+
}
|
|
86
|
+
/** Counts the sessions active on one site now. A 503 means realtime counts are unavailable: hide them. */
|
|
87
|
+
activeNow(siteUuid, options) {
|
|
88
|
+
if (siteUuid.trim() === "")
|
|
89
|
+
return Promise.reject(new Error("custd: active-now requires a site"));
|
|
90
|
+
return this.request("GET", `/analytics/active-now?${new URLSearchParams({ site: siteUuid })}`, undefined, options);
|
|
91
|
+
}
|
|
92
|
+
/** Returns the tenant's stored-event overview. */
|
|
93
|
+
async dashboardSummary(options) {
|
|
94
|
+
const wire = await this.request("GET", "/analytics/dashboard-summary", undefined, options);
|
|
95
|
+
return decodeAnalyticsDashboardSummary(wire);
|
|
96
|
+
}
|
|
97
|
+
/** Counts the tenant's events on one UTC day, optionally of one event type. */
|
|
98
|
+
eventCount(query, options) {
|
|
99
|
+
if (query.date.trim() === "")
|
|
100
|
+
return Promise.reject(new Error("custd: event count requires a date"));
|
|
101
|
+
const params = new URLSearchParams({ date: query.date });
|
|
102
|
+
if (query.eventType)
|
|
103
|
+
params.set("eventType", query.eventType);
|
|
104
|
+
return this.request("GET", `/telemetry/event-count?${params}`, undefined, options);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// appendLogDimensionFilters copies the promoted log-dimension filters onto the
|
|
108
|
+
// body, omitting each unset or empty one so it never narrows the query. It is
|
|
109
|
+
// shared by the day and range queries, which carry the same filter set.
|
|
110
|
+
function appendLogDimensionFilters(body, request) {
|
|
111
|
+
if (request.severity) {
|
|
112
|
+
body.severity = request.severity;
|
|
113
|
+
}
|
|
114
|
+
if (request.service) {
|
|
115
|
+
body.service = request.service;
|
|
116
|
+
}
|
|
117
|
+
if (request.subClient) {
|
|
118
|
+
body.subClient = request.subClient;
|
|
119
|
+
}
|
|
120
|
+
if (request.resource) {
|
|
121
|
+
body.resource = request.resource;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/** Reject locally what the service would reject anyway, so it never costs a round trip. */
|
|
125
|
+
function assertRangeWithinLimit(from, to) {
|
|
126
|
+
const fromMs = parseUTCDay(from, "from");
|
|
127
|
+
const toMs = parseUTCDay(to, "to");
|
|
128
|
+
if (toMs < fromMs) {
|
|
129
|
+
throw new RangeError("custd: analytics range query to must not be before from");
|
|
130
|
+
}
|
|
131
|
+
const days = Math.round((toMs - fromMs) / 86400000) + 1;
|
|
132
|
+
if (days > ANALYTICS_MAX_RANGE_DAYS) {
|
|
133
|
+
throw new RangeError(`custd: analytics range query spans ${days} days, the maximum is ${ANALYTICS_MAX_RANGE_DAYS}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function parseUTCDay(value, field) {
|
|
137
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value);
|
|
138
|
+
if (match === null) {
|
|
139
|
+
throw new RangeError(`custd: analytics range query ${field} must be YYYY-MM-DD`);
|
|
140
|
+
}
|
|
141
|
+
const ms = Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3]));
|
|
142
|
+
if (new Date(ms).toISOString().slice(0, 10) !== value) {
|
|
143
|
+
throw new RangeError(`custd: analytics range query ${field} must be YYYY-MM-DD`);
|
|
144
|
+
}
|
|
145
|
+
return ms;
|
|
146
|
+
}
|
|
147
|
+
// assertRangeQueryResponse validates the named range response DTO. The service
|
|
148
|
+
// emits every required field, so a truncated or wrongly shaped body fails here
|
|
149
|
+
// instead of surfacing as a zero-valued result.
|
|
150
|
+
function assertRangeQueryResponse(value) {
|
|
151
|
+
const context = "analytics range response";
|
|
152
|
+
const response = requireRecord(value, context);
|
|
153
|
+
for (const [index, row] of requireObjectList(response, "rows", context).entries()) {
|
|
154
|
+
// A row is an open column bag, but `payload` is a declared object field, so
|
|
155
|
+
// a present null or array fails instead of being passed through.
|
|
156
|
+
optionalRecord(row, "payload", `${context} rows[${index}]`);
|
|
157
|
+
}
|
|
158
|
+
requireInteger(response, "count", context);
|
|
159
|
+
for (const [index, bucket] of requireObjectList(response, "buckets", context).entries()) {
|
|
160
|
+
const bucketContext = `${context} buckets[${index}]`;
|
|
161
|
+
requireString(bucket, "date", bucketContext);
|
|
162
|
+
requireInteger(bucket, "count", bucketContext);
|
|
163
|
+
requireString(bucket, "source", bucketContext);
|
|
164
|
+
requireBoolean(bucket, "complete", bucketContext);
|
|
165
|
+
requireInteger(bucket, "queryDurationMs", bucketContext);
|
|
166
|
+
optionalInteger(bucket, "parquetUriCount", bucketContext);
|
|
167
|
+
optionalString(bucket, "message", bucketContext);
|
|
168
|
+
}
|
|
169
|
+
for (const [index, source] of requireObjectList(response, "sources", context).entries()) {
|
|
170
|
+
const sourceContext = `${context} sources[${index}]`;
|
|
171
|
+
requireString(source, "name", sourceContext);
|
|
172
|
+
requireInteger(source, "count", sourceContext);
|
|
173
|
+
requireBoolean(source, "complete", sourceContext);
|
|
174
|
+
requireBoolean(source, "fresh", sourceContext);
|
|
175
|
+
requireInteger(source, "queryDurationMs", sourceContext);
|
|
176
|
+
requireInteger(source, "freshnessLagMs", sourceContext);
|
|
177
|
+
optionalInteger(source, "parquetUriCount", sourceContext);
|
|
178
|
+
optionalString(source, "message", sourceContext);
|
|
179
|
+
}
|
|
180
|
+
const timing = requireRecord(response.timing, `${context} timing`);
|
|
181
|
+
requireInteger(timing, "eventLagP50Ms", `${context} timing`);
|
|
182
|
+
requireInteger(timing, "eventLagP95Ms", `${context} timing`);
|
|
183
|
+
requireInteger(timing, "eventLagMaxMs", `${context} timing`);
|
|
184
|
+
requireInteger(timing, "queryDurationMs", `${context} timing`);
|
|
185
|
+
requireInteger(timing, "snapshotAgeMs", `${context} timing`);
|
|
186
|
+
optionalString(timing, "oldestEventTimestamp", `${context} timing`);
|
|
187
|
+
optionalString(timing, "newestEventTimestamp", `${context} timing`);
|
|
188
|
+
return response;
|
|
189
|
+
}
|
|
190
|
+
/** Decodes a dashboard summary, turning JSON null lists into empty ones. */
|
|
191
|
+
function decodeAnalyticsDashboardSummary(wire) {
|
|
192
|
+
return {
|
|
193
|
+
...wire,
|
|
194
|
+
loadedDays: wire.loadedDays ?? [],
|
|
195
|
+
dogfood: { sources: wire.dogfood?.sources ?? [], metrics: wire.dogfood?.metrics ?? [] },
|
|
196
|
+
};
|
|
40
197
|
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tenant analytics reads beside the event query: the realtime active-visitor count, the
|
|
3
|
+
* stored-event dashboard summary and the per-day event count. The credential names the tenant.
|
|
4
|
+
*/
|
|
5
|
+
/** How many sessions were active on one site within the window. */
|
|
6
|
+
export type AnalyticsActiveNow = {
|
|
7
|
+
activeNow: number;
|
|
8
|
+
windowSeconds: number;
|
|
9
|
+
};
|
|
10
|
+
export type AnalyticsDashboardTenant = {
|
|
11
|
+
companySlug: string;
|
|
12
|
+
};
|
|
13
|
+
/** The tenant's stored events. The timestamps are null while nothing is stored. */
|
|
14
|
+
export type AnalyticsDashboardEvents = {
|
|
15
|
+
total: number;
|
|
16
|
+
oldestEventAt: string | null;
|
|
17
|
+
latestEventAt: string | null;
|
|
18
|
+
latestReceivedAt: string | null;
|
|
19
|
+
loadedDayCount: number;
|
|
20
|
+
};
|
|
21
|
+
/** The span of days with stored events. */
|
|
22
|
+
export type AnalyticsDashboardCoverage = {
|
|
23
|
+
firstDay: string;
|
|
24
|
+
lastDay: string;
|
|
25
|
+
loadedDayCount: number;
|
|
26
|
+
};
|
|
27
|
+
/** One stored day and its archive state. */
|
|
28
|
+
export type AnalyticsDashboardLoadedDay = {
|
|
29
|
+
date: string;
|
|
30
|
+
eventCount: number;
|
|
31
|
+
archiveStatus: string;
|
|
32
|
+
archiveVerifiedAt: string | null;
|
|
33
|
+
queryHref: string;
|
|
34
|
+
};
|
|
35
|
+
/** One internal source's delivery health. */
|
|
36
|
+
export type AnalyticsDashboardDogfoodSource = {
|
|
37
|
+
sourceSystem: string;
|
|
38
|
+
sourceCompany: string;
|
|
39
|
+
environment: string;
|
|
40
|
+
eventCount: number;
|
|
41
|
+
latestEventAt: string | null;
|
|
42
|
+
latestEventType: string;
|
|
43
|
+
failureCount: number;
|
|
44
|
+
rejectionCount: number;
|
|
45
|
+
status: string;
|
|
46
|
+
};
|
|
47
|
+
/** One internal operational metric. */
|
|
48
|
+
export type AnalyticsDashboardDogfoodMetric = {
|
|
49
|
+
sourceSystem: string;
|
|
50
|
+
service: string;
|
|
51
|
+
metricName: string;
|
|
52
|
+
metricKind: string;
|
|
53
|
+
value: number;
|
|
54
|
+
unit: string;
|
|
55
|
+
windowStart: string | null;
|
|
56
|
+
windowEnd: string | null;
|
|
57
|
+
route?: string;
|
|
58
|
+
status?: string;
|
|
59
|
+
};
|
|
60
|
+
/** The internal dogfood view; empty for client tenants. */
|
|
61
|
+
export type AnalyticsDashboardDogfood = {
|
|
62
|
+
sources: AnalyticsDashboardDogfoodSource[];
|
|
63
|
+
metrics: AnalyticsDashboardDogfoodMetric[];
|
|
64
|
+
};
|
|
65
|
+
/** The tenant's stored-event overview. */
|
|
66
|
+
export type AnalyticsDashboardSummary = {
|
|
67
|
+
tenant: AnalyticsDashboardTenant;
|
|
68
|
+
events: AnalyticsDashboardEvents;
|
|
69
|
+
coverage: AnalyticsDashboardCoverage;
|
|
70
|
+
loadedDays: AnalyticsDashboardLoadedDay[];
|
|
71
|
+
dogfood: AnalyticsDashboardDogfood;
|
|
72
|
+
generatedAt: string;
|
|
73
|
+
};
|
|
74
|
+
/** Counts the tenant's events on one UTC day (YYYY-MM-DD), optionally of one event type. */
|
|
75
|
+
export type AnalyticsEventCountQuery = {
|
|
76
|
+
date: string;
|
|
77
|
+
eventType?: string;
|
|
78
|
+
};
|
|
79
|
+
export type AnalyticsEventCount = {
|
|
80
|
+
count: number;
|
|
81
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export type CreateAppAccountEntryOptions = {
|
|
2
|
+
/** The trusted issuer that authenticated this application session. */
|
|
3
|
+
issuer: string;
|
|
4
|
+
/** The registered application's serialized HTTPS origin. */
|
|
5
|
+
applicationOrigin: string;
|
|
6
|
+
accessToken: string;
|
|
7
|
+
/**
|
|
8
|
+
* The page on the application origin hosted settings links back to, such as "/mine". Defaults to
|
|
9
|
+
* the application's home. Never pass the current URL blindly: a fragment or path may hold a link token.
|
|
10
|
+
*/
|
|
11
|
+
returnPath?: string;
|
|
12
|
+
fetch?: typeof globalThis.fetch;
|
|
13
|
+
};
|
|
14
|
+
export type AppAccountEntry = {
|
|
15
|
+
actionUrl: string;
|
|
16
|
+
/** A short-lived, one-use credential for the form body. Keep it out of URLs and logs. */
|
|
17
|
+
ticket: string;
|
|
18
|
+
};
|
|
19
|
+
/** Issue a hosted settings entry ticket for the remembered application session. */
|
|
20
|
+
export declare function createAppAccountEntry(options: CreateAppAccountEntryOptions): Promise<AppAccountEntry>;
|
|
21
|
+
export type OpenAppAccountSettingsOptions = Omit<CreateAppAccountEntryOptions, "applicationOrigin"> & {
|
|
22
|
+
/** Defaults to the page's own origin, which must be registered for the application. */
|
|
23
|
+
applicationOrigin?: string;
|
|
24
|
+
/** Defaults to the page's document; pass one in tests. */
|
|
25
|
+
document?: Document;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Open hosted account settings in the same tab from a browser app. It asks the issuer for a one-use
|
|
29
|
+
* ticket and posts it in a native form, so settings shows a verified link back to the app.
|
|
30
|
+
*/
|
|
31
|
+
export declare function openAppAccountSettings(options: OpenAppAccountSettingsOptions): Promise<void>;
|
|
32
|
+
export declare class AppAccountEntryError extends Error {
|
|
33
|
+
readonly status: number;
|
|
34
|
+
constructor(status: number);
|
|
35
|
+
}
|
|
36
|
+
export type CurrentAppProfileField = {
|
|
37
|
+
fieldKey: string;
|
|
38
|
+
value?: string;
|
|
39
|
+
present: boolean;
|
|
40
|
+
/** Remains true after an explicit clear so apps do not import the old value again. */
|
|
41
|
+
initialized: boolean;
|
|
42
|
+
required: boolean;
|
|
43
|
+
editableBy: string;
|
|
44
|
+
editable: boolean;
|
|
45
|
+
};
|
|
46
|
+
export type CurrentAppProfile = {
|
|
47
|
+
fields: CurrentAppProfileField[];
|
|
48
|
+
managedPhoto?: boolean;
|
|
49
|
+
};
|
|
50
|
+
export type CurrentAppProfileUpdate = {
|
|
51
|
+
values: {
|
|
52
|
+
fieldKey: string;
|
|
53
|
+
value: string;
|
|
54
|
+
}[];
|
|
55
|
+
};
|
|
56
|
+
export type CurrentAppProfileClientConfig = {
|
|
57
|
+
apiBaseUrl: string;
|
|
58
|
+
/** Returns the current end-user access token with the application's profile scope. */
|
|
59
|
+
accessToken: () => string | Promise<string>;
|
|
60
|
+
fetch?: typeof globalThis.fetch;
|
|
61
|
+
};
|
|
62
|
+
export declare class CurrentAppProfileError extends Error {
|
|
63
|
+
readonly status: number;
|
|
64
|
+
constructor(status: number);
|
|
65
|
+
}
|
|
66
|
+
export declare class CurrentAppProfileClient {
|
|
67
|
+
private readonly config;
|
|
68
|
+
private readonly origin;
|
|
69
|
+
private readonly fetch;
|
|
70
|
+
constructor(config: CurrentAppProfileClientConfig);
|
|
71
|
+
read(): Promise<CurrentAppProfile>;
|
|
72
|
+
update(update: CurrentAppProfileUpdate): Promise<CurrentAppProfile>;
|
|
73
|
+
/** Fill only previously uninitialized fields and return the current profile. */
|
|
74
|
+
initialize(update: CurrentAppProfileUpdate): Promise<CurrentAppProfile>;
|
|
75
|
+
private writeFields;
|
|
76
|
+
readPhoto(): Promise<Blob>;
|
|
77
|
+
uploadPhoto(photo: Blob): Promise<CurrentAppProfile>;
|
|
78
|
+
/** Fill a previously uninitialized photo and return the current profile. */
|
|
79
|
+
initializePhoto(photo: Blob): Promise<CurrentAppProfile>;
|
|
80
|
+
private writePhoto;
|
|
81
|
+
removePhoto(): Promise<CurrentAppProfile>;
|
|
82
|
+
private profile;
|
|
83
|
+
private request;
|
|
84
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { optionalString, requireBoolean, requireObjectList, requireRecord, requireString, } from "./response-validation.js";
|
|
2
|
+
function appHttpsUrl(value) {
|
|
3
|
+
const url = new URL(value);
|
|
4
|
+
if (url.protocol !== "https:" || url.username || url.password) {
|
|
5
|
+
throw new TypeError("custd: app account URLs must use HTTPS without credentials");
|
|
6
|
+
}
|
|
7
|
+
return url;
|
|
8
|
+
}
|
|
9
|
+
/** The issuer's bound on a return path. */
|
|
10
|
+
const maxReturnPathBytes = 512;
|
|
11
|
+
function validReturnPath(path) {
|
|
12
|
+
if (new TextEncoder().encode(path).length > maxReturnPathBytes || !path.startsWith("/") || path.startsWith("//")) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
// No backslash, fragment, whitespace or control character: the issuer refuses each of them.
|
|
16
|
+
return [...path].every((char) => char !== "\\" && char !== "#" && char.charCodeAt(0) > 0x20 && char.charCodeAt(0) !== 0x7f);
|
|
17
|
+
}
|
|
18
|
+
/** Issue a hosted settings entry ticket for the remembered application session. */
|
|
19
|
+
export async function createAppAccountEntry(options) {
|
|
20
|
+
const issuer = appHttpsUrl(options.issuer);
|
|
21
|
+
if (options.issuer !== issuer.origin && options.issuer !== `${issuer.origin}/`) {
|
|
22
|
+
throw new TypeError("custd: account entry requires an HTTPS issuer origin");
|
|
23
|
+
}
|
|
24
|
+
const applicationOrigin = appHttpsUrl(options.applicationOrigin).origin;
|
|
25
|
+
if (applicationOrigin !== options.applicationOrigin) {
|
|
26
|
+
throw new TypeError("custd: account entry requires a serialized application origin");
|
|
27
|
+
}
|
|
28
|
+
if (options.returnPath !== undefined && !validReturnPath(options.returnPath)) {
|
|
29
|
+
throw new TypeError("custd: account return path must be a path on the application origin");
|
|
30
|
+
}
|
|
31
|
+
const actionUrl = `${issuer.origin}/settings/entry`;
|
|
32
|
+
const response = await requestWithAppGrant(options.fetch ?? globalThis.fetch.bind(globalThis), options.accessToken, new URL(`${actionUrl}/ticket`), {
|
|
33
|
+
method: "POST",
|
|
34
|
+
headers: { "Content-Type": "application/json" },
|
|
35
|
+
body: JSON.stringify(options.returnPath === undefined
|
|
36
|
+
? { applicationOrigin }
|
|
37
|
+
: { applicationOrigin, returnPath: options.returnPath }),
|
|
38
|
+
});
|
|
39
|
+
if (!response.ok)
|
|
40
|
+
throw new AppAccountEntryError(response.status);
|
|
41
|
+
const entry = requireRecord(await response.json().catch(() => {
|
|
42
|
+
throw new TypeError("custd: invalid app account entry response");
|
|
43
|
+
}), "app account entry");
|
|
44
|
+
const ticket = requireString(entry, "ticket", "app account entry");
|
|
45
|
+
if (entry.actionUrl !== actionUrl || !/^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$/.test(ticket)) {
|
|
46
|
+
throw new TypeError("custd: invalid app account entry response");
|
|
47
|
+
}
|
|
48
|
+
return { actionUrl, ticket };
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Open hosted account settings in the same tab from a browser app. It asks the issuer for a one-use
|
|
52
|
+
* ticket and posts it in a native form, so settings shows a verified link back to the app.
|
|
53
|
+
*/
|
|
54
|
+
export async function openAppAccountSettings(options) {
|
|
55
|
+
const page = options.document ?? globalThis.document;
|
|
56
|
+
const entry = await createAppAccountEntry({
|
|
57
|
+
...options,
|
|
58
|
+
applicationOrigin: options.applicationOrigin ?? globalThis.location.origin,
|
|
59
|
+
});
|
|
60
|
+
const form = page.createElement("form");
|
|
61
|
+
form.method = "post";
|
|
62
|
+
form.action = entry.actionUrl;
|
|
63
|
+
form.target = "_self";
|
|
64
|
+
form.hidden = true;
|
|
65
|
+
const ticket = page.createElement("input");
|
|
66
|
+
ticket.type = "hidden";
|
|
67
|
+
ticket.name = "ticket";
|
|
68
|
+
ticket.value = entry.ticket;
|
|
69
|
+
form.append(ticket);
|
|
70
|
+
page.body.append(form);
|
|
71
|
+
form.submit();
|
|
72
|
+
}
|
|
73
|
+
export class AppAccountEntryError extends Error {
|
|
74
|
+
constructor(status) {
|
|
75
|
+
super(`custd: app account entry request failed (HTTP ${status})`);
|
|
76
|
+
this.status = status;
|
|
77
|
+
this.name = "AppAccountEntryError";
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export class CurrentAppProfileError extends Error {
|
|
81
|
+
constructor(status) {
|
|
82
|
+
super(`custd: current app profile request failed (HTTP ${status})`);
|
|
83
|
+
this.status = status;
|
|
84
|
+
this.name = "CurrentAppProfileError";
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const profilePath = "/api/v1/app/profile";
|
|
88
|
+
const photoPath = `${profilePath}/photo`;
|
|
89
|
+
const maxPhotoBytes = 256 * 1024;
|
|
90
|
+
const profileContext = "current app profile";
|
|
91
|
+
export class CurrentAppProfileClient {
|
|
92
|
+
constructor(config) {
|
|
93
|
+
this.config = config;
|
|
94
|
+
this.origin = appHttpsUrl(config.apiBaseUrl).origin;
|
|
95
|
+
this.fetch = config.fetch ?? globalThis.fetch.bind(globalThis);
|
|
96
|
+
}
|
|
97
|
+
read() {
|
|
98
|
+
return this.profile(profilePath, { method: "GET" });
|
|
99
|
+
}
|
|
100
|
+
update(update) {
|
|
101
|
+
return this.writeFields("PATCH", update);
|
|
102
|
+
}
|
|
103
|
+
/** Fill only previously uninitialized fields and return the current profile. */
|
|
104
|
+
initialize(update) {
|
|
105
|
+
return this.writeFields("POST", update);
|
|
106
|
+
}
|
|
107
|
+
writeFields(method, update) {
|
|
108
|
+
return this.profile(profilePath, {
|
|
109
|
+
method,
|
|
110
|
+
headers: { "Content-Type": "application/json" },
|
|
111
|
+
body: JSON.stringify(update),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
async readPhoto() {
|
|
115
|
+
const response = await this.request(photoPath, { method: "GET" });
|
|
116
|
+
const photo = await response.blob();
|
|
117
|
+
validatePhoto(photo);
|
|
118
|
+
return photo;
|
|
119
|
+
}
|
|
120
|
+
uploadPhoto(photo) {
|
|
121
|
+
return this.writePhoto("PUT", photo);
|
|
122
|
+
}
|
|
123
|
+
/** Fill a previously uninitialized photo and return the current profile. */
|
|
124
|
+
initializePhoto(photo) {
|
|
125
|
+
return this.writePhoto("POST", photo);
|
|
126
|
+
}
|
|
127
|
+
writePhoto(method, photo) {
|
|
128
|
+
validatePhoto(photo);
|
|
129
|
+
return this.profile(photoPath, { method, headers: { "Content-Type": photo.type }, body: photo });
|
|
130
|
+
}
|
|
131
|
+
removePhoto() {
|
|
132
|
+
return this.profile(photoPath, { method: "DELETE" });
|
|
133
|
+
}
|
|
134
|
+
async profile(path, init) {
|
|
135
|
+
const response = await this.request(path, init);
|
|
136
|
+
return decodeProfile(await response.json());
|
|
137
|
+
}
|
|
138
|
+
async request(path, init) {
|
|
139
|
+
const response = await requestWithAppGrant(this.fetch, await this.config.accessToken(), new URL(path, this.origin), init);
|
|
140
|
+
if (!response.ok)
|
|
141
|
+
throw new CurrentAppProfileError(response.status);
|
|
142
|
+
return response;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
function requestWithAppGrant(fetcher, token, url, init) {
|
|
146
|
+
if (!token || /\s/.test(token))
|
|
147
|
+
throw new TypeError("custd: application access token is required");
|
|
148
|
+
const headers = new Headers(init.headers);
|
|
149
|
+
headers.set("Authorization", `Bearer ${token}`);
|
|
150
|
+
return fetcher(url, { ...init, headers, redirect: "error", credentials: "omit", cache: "no-store" });
|
|
151
|
+
}
|
|
152
|
+
function validatePhoto(photo) {
|
|
153
|
+
if (!["image/png", "image/webp"].includes(photo.type) || photo.size === 0 || photo.size > maxPhotoBytes) {
|
|
154
|
+
throw new TypeError("custd: app profile photo must be PNG or WebP and at most 256 KiB");
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function decodeProfile(json) {
|
|
158
|
+
const record = requireRecord(json, profileContext);
|
|
159
|
+
const fields = requireObjectList(record, "fields", profileContext).map(decodeField);
|
|
160
|
+
if (record.managedPhoto === undefined)
|
|
161
|
+
return { fields };
|
|
162
|
+
return { fields, managedPhoto: requireBoolean(record, "managedPhoto", profileContext) };
|
|
163
|
+
}
|
|
164
|
+
function decodeField(record) {
|
|
165
|
+
const field = {
|
|
166
|
+
fieldKey: requireString(record, "fieldKey", profileContext),
|
|
167
|
+
present: requireBoolean(record, "present", profileContext),
|
|
168
|
+
initialized: record.initialized === undefined ? false : requireBoolean(record, "initialized", profileContext),
|
|
169
|
+
required: requireBoolean(record, "required", profileContext),
|
|
170
|
+
editableBy: requireString(record, "editableBy", profileContext),
|
|
171
|
+
editable: requireBoolean(record, "editable", profileContext),
|
|
172
|
+
};
|
|
173
|
+
optionalString(record, "value", profileContext);
|
|
174
|
+
if (typeof record.value === "string")
|
|
175
|
+
field.value = record.value;
|
|
176
|
+
return field;
|
|
177
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export declare const APP_ALERT_RULE_TYPES: {
|
|
2
|
+
/** The chance of finishing by the deadline fell below `threshold`. */
|
|
3
|
+
readonly deadlineProbabilityBelow: "deadline_probability_below";
|
|
4
|
+
/** The named model output's 95th percentile rose above the threshold. */
|
|
5
|
+
readonly modelRangeAbove: "model_range_above";
|
|
6
|
+
readonly targetReached: "target_reached";
|
|
7
|
+
/** No new estimate for `staleDays`. */
|
|
8
|
+
readonly estimateStale: "estimate_stale";
|
|
9
|
+
/** The forecast's upper completion bound moved on or before the deadline. */
|
|
10
|
+
readonly forecastMovedInsideTarget: "forecast_moved_inside_target";
|
|
11
|
+
};
|
|
12
|
+
export type AppAlertRuleType = (typeof APP_ALERT_RULE_TYPES)[keyof typeof APP_ALERT_RULE_TYPES];
|
|
13
|
+
export declare const APP_ALERT_CHANNELS: {
|
|
14
|
+
readonly webhook: "webhook";
|
|
15
|
+
readonly slack: "slack";
|
|
16
|
+
readonly email: "email";
|
|
17
|
+
};
|
|
18
|
+
export type AppAlertChannel = (typeof APP_ALERT_CHANNELS)[keyof typeof APP_ALERT_CHANNELS];
|
|
19
|
+
export declare const APP_ALERT_DELIVERY_OUTCOMES: {
|
|
20
|
+
readonly pending: "pending";
|
|
21
|
+
readonly sent: "sent";
|
|
22
|
+
readonly failed: "failed";
|
|
23
|
+
};
|
|
24
|
+
export type AppAlertDeliveryOutcome = (typeof APP_ALERT_DELIVERY_OUTCOMES)[keyof typeof APP_ALERT_DELIVERY_OUTCOMES];
|
|
25
|
+
/** Problem codes the alert routes answer with. */
|
|
26
|
+
export declare const APP_ALERT_ERROR_CODES: {
|
|
27
|
+
readonly notFound: "app_alert_not_found";
|
|
28
|
+
/** The item holds as many rules, webhooks or subscriptions as it may. */
|
|
29
|
+
readonly limit: "app_alert_limit";
|
|
30
|
+
/** The signed-in user has no verified email address to send alerts to: verify one first. */
|
|
31
|
+
readonly noVerifiedEmail: "app_alert_no_verified_email";
|
|
32
|
+
/** The user's email address could not be checked right now; retry. */
|
|
33
|
+
readonly emailCheckUnavailable: "app_alert_email_check_unavailable";
|
|
34
|
+
/** The rule's parameters do not match its type. */
|
|
35
|
+
readonly ruleInvalid: "app_alert_rule_invalid";
|
|
36
|
+
/** This deployment cannot deliver webhooks or email right now. */
|
|
37
|
+
readonly deliveryUnavailable: "app_alert_delivery_unavailable";
|
|
38
|
+
};
|
|
39
|
+
/** A rule's type and parameters. */
|
|
40
|
+
export type AppAlertRuleSpec = {
|
|
41
|
+
type: AppAlertRuleType;
|
|
42
|
+
/** A probability in (0, 1) or a finite model output threshold, depending on the rule. */
|
|
43
|
+
threshold?: number;
|
|
44
|
+
/** The quantity whose range is monitored by `model_range_above`. */
|
|
45
|
+
modelOutput?: string;
|
|
46
|
+
/** Days without a new estimate, 1 to 365; `estimate_stale` only. */
|
|
47
|
+
staleDays?: number;
|
|
48
|
+
};
|
|
49
|
+
/** One rule and the state it last saw. It fires again only after `conditionMet` clears. */
|
|
50
|
+
export type AppAlertRule = AppAlertRuleSpec & {
|
|
51
|
+
ruleUuid: string;
|
|
52
|
+
conditionMet: boolean;
|
|
53
|
+
/** How many times the condition has become true. */
|
|
54
|
+
crossings: number;
|
|
55
|
+
createdAt: string;
|
|
56
|
+
};
|
|
57
|
+
export type AppAlertWebhookCreateRequest = {
|
|
58
|
+
/** HTTPS URL on port 443 that resolves only to public addresses. */
|
|
59
|
+
endpoint: string;
|
|
60
|
+
};
|
|
61
|
+
/** How a destination is delivered: signed Custd JSON, or a Slack message. */
|
|
62
|
+
export declare const APP_ALERT_DESTINATION_KINDS: {
|
|
63
|
+
readonly webhook: "webhook";
|
|
64
|
+
readonly slack: "slack";
|
|
65
|
+
};
|
|
66
|
+
export type AppAlertDestinationKind = (typeof APP_ALERT_DESTINATION_KINDS)[keyof typeof APP_ALERT_DESTINATION_KINDS];
|
|
67
|
+
export type AppAlertSlackCreateRequest = {
|
|
68
|
+
/** Slack incoming-webhook URL, `https://hooks.slack.com/services/...`. It is the secret: stored sealed, never shown again. */
|
|
69
|
+
webhookUrl: string;
|
|
70
|
+
};
|
|
71
|
+
/** One destination: a signed webhook or a Slack incoming webhook, whose `endpoint` is only a hint of its URL. */
|
|
72
|
+
export type AppAlertWebhook = {
|
|
73
|
+
webhookUuid: string;
|
|
74
|
+
kind: AppAlertDestinationKind;
|
|
75
|
+
endpoint: string;
|
|
76
|
+
createdAt: string;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* A new webhook and its signing secret, shown this once: keep it, Custd cannot. Every delivery is
|
|
80
|
+
* a POST with `X-Custd-Delivery-Id`, `X-Custd-Timestamp` and `X-Custd-Signature: v1=<hex
|
|
81
|
+
* HMAC-SHA256 of "<timestamp>.<body>" under the secret>`.
|
|
82
|
+
*/
|
|
83
|
+
export type AppAlertWebhookCreated = {
|
|
84
|
+
webhook: AppAlertWebhook;
|
|
85
|
+
signingSecret: string;
|
|
86
|
+
};
|
|
87
|
+
/** The signed-in user's email subscription; the address is their verified one. */
|
|
88
|
+
export type AppAlertSubscription = {
|
|
89
|
+
subscriptionUuid: string;
|
|
90
|
+
createdAt: string;
|
|
91
|
+
};
|
|
92
|
+
/** Everything an owner manages on the item's alerts. */
|
|
93
|
+
export type AppAlertSettings = {
|
|
94
|
+
rules: AppAlertRule[] | null;
|
|
95
|
+
webhooks: AppAlertWebhook[] | null;
|
|
96
|
+
/** The signed-in caller's own subscription; absent when there is none or no one is signed in. */
|
|
97
|
+
subscription?: AppAlertSubscription;
|
|
98
|
+
/** Whether this deployment can deliver webhooks and email at all. */
|
|
99
|
+
deliveryAvailable: boolean;
|
|
100
|
+
};
|
|
101
|
+
/** One delivery of one rule crossing to one destination. */
|
|
102
|
+
export type AppAlertDelivery = {
|
|
103
|
+
/** Matches the webhook's `X-Custd-Delivery-Id`. */
|
|
104
|
+
deliveryUuid: string;
|
|
105
|
+
ruleUuid: string;
|
|
106
|
+
ruleType: AppAlertRuleType;
|
|
107
|
+
crossing: number;
|
|
108
|
+
channel: AppAlertChannel;
|
|
109
|
+
webhookUuid?: string;
|
|
110
|
+
outcome: AppAlertDeliveryOutcome;
|
|
111
|
+
attempts: number;
|
|
112
|
+
lastErrorClass?: string;
|
|
113
|
+
lastStatusCode?: number;
|
|
114
|
+
createdAt: string;
|
|
115
|
+
updatedAt: string;
|
|
116
|
+
};
|
|
117
|
+
/** The item's newest deliveries, at most 100. */
|
|
118
|
+
export type AppAlertDeliveryList = {
|
|
119
|
+
deliveries: AppAlertDelivery[] | null;
|
|
120
|
+
};
|