@haakco/custd-sdk 0.0.0-stage → 3.71.1
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/README.md +958 -2
- 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 +122 -0
- package/dist/admin-client-setup.js +408 -0
- package/dist/admin-data-labels.d.ts +124 -0
- package/dist/admin-data-labels.js +51 -0
- 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 +123 -0
- package/dist/admin-offboarding.js +129 -0
- package/dist/admin-predictions.d.ts +266 -0
- package/dist/admin-predictions.js +93 -0
- package/dist/admin-privacy-erasures.d.ts +74 -0
- package/dist/admin-privacy-erasures.js +73 -0
- package/dist/admin-retention.d.ts +99 -0
- package/dist/admin-retention.js +60 -0
- 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 +79 -0
- package/dist/admin-subject-exports.js +44 -0
- 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 +35 -0
- package/dist/admin-tenant-storage.js +24 -0
- package/dist/admin-timeplans.d.ts +512 -0
- package/dist/admin-timeplans.js +200 -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 +167 -0
- package/dist/analytics-events.js +197 -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 +85 -0
- package/dist/backend-lifecycle.js +212 -0
- package/dist/browser-manifest.json +7 -0
- package/dist/browser-script-BWnwDjAC.js +711 -0
- package/dist/browser-script.d.ts +1 -0
- package/dist/browser-script.js +5 -0
- package/dist/browser-sign-in.d.ts +153 -0
- package/dist/browser-sign-in.js +410 -0
- package/dist/browser-tracker.d.ts +142 -0
- package/dist/browser-tracker.js +775 -0
- package/dist/browser-web-vitals.d.ts +22 -0
- package/dist/browser-web-vitals.js +116 -0
- package/dist/browser.d.ts +10 -0
- package/dist/browser.js +10 -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 +2324 -0
- package/dist/index.js +2226 -0
- 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/mobile-adapter.d.ts +25 -0
- package/dist/mobile-adapter.js +57 -0
- package/dist/mobile-context.d.ts +32 -0
- package/dist/mobile-context.js +156 -0
- package/dist/mobile-queue.d.ts +22 -0
- package/dist/mobile-queue.js +73 -0
- package/dist/oauth.d.ts +1 -0
- package/dist/oauth.js +8 -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/reporting-state.d.ts +46 -0
- package/dist/reporting-state.js +76 -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/runtime-readiness.d.ts +30 -0
- package/dist/runtime-readiness.js +150 -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 +10 -0
- package/dist/version.js +10 -0
- package/package.json +57 -4
|
@@ -0,0 +1,524 @@
|
|
|
1
|
+
// Browser data access for hosted apps: create an item with the app's Site key, then read and
|
|
2
|
+
// change it with its owner link, or only read it with its share link. A link token travels only
|
|
3
|
+
// in the Authorization header: never in a URL, a log line or an error message.
|
|
4
|
+
import { APP_ALERT_ERROR_CODES, } from "./app-alerts.js";
|
|
5
|
+
import { APP_LIVE_STATUSES, AppLiveRegistry, } from "./app-live.js";
|
|
6
|
+
import { APP_MEETING_ERROR_CODES, } from "./app-meetings.js";
|
|
7
|
+
import { APP_MODEL_ERROR_CODES, } from "./app-models.js";
|
|
8
|
+
import { AppPushChannel, appRealtimeUrl, globalWebSocketFactory, } from "./app-push.js";
|
|
9
|
+
import { emptyAppNullLists } from "./response-lists.js";
|
|
10
|
+
export const APP_ITEM_SITE_KEY_HEADER = "X-Custd-Site-Key";
|
|
11
|
+
/** Carries the signed-in user's access token beside the link token. */
|
|
12
|
+
export const APP_ITEM_USER_TOKEN_HEADER = "X-Custd-User-Token";
|
|
13
|
+
export const APP_ITEM_OWNERSHIPS = {
|
|
14
|
+
unowned: "unowned",
|
|
15
|
+
yours: "yours",
|
|
16
|
+
other: "other",
|
|
17
|
+
};
|
|
18
|
+
export const APP_ITEM_KINDS = {
|
|
19
|
+
measurementProject: "measurement_project",
|
|
20
|
+
linkCollection: "link_collection",
|
|
21
|
+
uncertaintyModel: "uncertainty_model",
|
|
22
|
+
meeting: "meeting",
|
|
23
|
+
plan: "plan",
|
|
24
|
+
};
|
|
25
|
+
export const APP_LINK_ROLES = {
|
|
26
|
+
owner: "owner",
|
|
27
|
+
share: "share",
|
|
28
|
+
};
|
|
29
|
+
export const APP_MEASUREMENT_PROJECT_KINDS = {
|
|
30
|
+
deadlineForecast: "deadline_forecast",
|
|
31
|
+
runwayForecast: "runway_forecast",
|
|
32
|
+
};
|
|
33
|
+
export const APP_FORECAST_METHODS = {
|
|
34
|
+
bootstrapQuantile: "bootstrap_quantile",
|
|
35
|
+
bayesianLinearRegression: "bayesian_linear_regression",
|
|
36
|
+
seasonal7Day: "seasonal_7_day",
|
|
37
|
+
};
|
|
38
|
+
/** Problem codes the app routes answer with. */
|
|
39
|
+
export const APP_ITEM_ERROR_CODES = {
|
|
40
|
+
keyRefused: "app_key_refused",
|
|
41
|
+
linkRefused: "app_link_refused",
|
|
42
|
+
readOnlyLink: "app_link_read_only",
|
|
43
|
+
notFound: "app_item_not_found",
|
|
44
|
+
wrongKind: "app_item_wrong_kind",
|
|
45
|
+
createLimited: "app_item_create_limited",
|
|
46
|
+
measurementLimit: "app_item_measurement_limit",
|
|
47
|
+
seriesRequired: "app_item_series_required",
|
|
48
|
+
collectionFull: "app_item_collection_full",
|
|
49
|
+
notCollectable: "app_item_not_collectable",
|
|
50
|
+
invalid: "app_item_invalid",
|
|
51
|
+
forecastMissing: "app_forecast_missing",
|
|
52
|
+
/** Another user already owns the item. */
|
|
53
|
+
claimed: "app_item_claimed",
|
|
54
|
+
/** The user access token does not sign anyone in to this app: sign in again. */
|
|
55
|
+
userRefused: "app_user_refused",
|
|
56
|
+
/** The sign-in could not be checked right now; retry, and keep the user signed in. */
|
|
57
|
+
userCheckUnavailable: "app_user_check_unavailable",
|
|
58
|
+
/** The route acts for a signed-in user and none was presented. */
|
|
59
|
+
signInRequired: "app_sign_in_required",
|
|
60
|
+
/** The request never got an answer: offline, DNS, CORS refusal. */
|
|
61
|
+
network: "network",
|
|
62
|
+
/** A success answer whose body was not JSON. */
|
|
63
|
+
invalidResponse: "invalid_response",
|
|
64
|
+
/** The hosted app has no app data capability, or did not start. */
|
|
65
|
+
unavailable: "app_data_unavailable",
|
|
66
|
+
};
|
|
67
|
+
export class AppItemError extends Error {
|
|
68
|
+
constructor(
|
|
69
|
+
/** HTTP status; null when no answer arrived. */
|
|
70
|
+
status, code, problem) {
|
|
71
|
+
super(`custd: app item request failed [status=${status ?? "none"} code=${code}]`);
|
|
72
|
+
this.status = status;
|
|
73
|
+
this.code = code;
|
|
74
|
+
this.problem = problem;
|
|
75
|
+
this.name = "AppItemError";
|
|
76
|
+
}
|
|
77
|
+
/** The user must sign in (again): their access token was refused, or none was sent. */
|
|
78
|
+
get signInNeeded() {
|
|
79
|
+
return this.code === APP_ITEM_ERROR_CODES.userRefused || this.code === APP_ITEM_ERROR_CODES.signInRequired;
|
|
80
|
+
}
|
|
81
|
+
/** Alert email needs a verified address: the signed-in user must verify one first. */
|
|
82
|
+
get verifiedEmailNeeded() {
|
|
83
|
+
return this.code === APP_ALERT_ERROR_CODES.noVerifiedEmail;
|
|
84
|
+
}
|
|
85
|
+
/** Retrying cannot help: the link, key or request itself was refused. */
|
|
86
|
+
get terminal() {
|
|
87
|
+
return (this.status !== null && this.status >= 400 && this.status < 500 && this.status !== 408 && this.status !== 429);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const ITEMS_PATH = "/api/v1/app/items";
|
|
91
|
+
const ITEM_PATH = "/api/v1/app/item";
|
|
92
|
+
const FORECAST_PATH = "/api/v1/app/forecast";
|
|
93
|
+
const MODELS_PATH = "/api/v1/app/models";
|
|
94
|
+
const ALERTS_PATH = `${ITEM_PATH}/alerts`;
|
|
95
|
+
const MEETING_PATH = `${ITEM_PATH}/meeting`;
|
|
96
|
+
export class AppItemsClient {
|
|
97
|
+
constructor(config) {
|
|
98
|
+
this.baseUrl = config.apiBaseUrl.replace(/\/+$/, "");
|
|
99
|
+
this.siteKey = config.siteKey;
|
|
100
|
+
this.fetchImpl = config.fetch ?? ((input, init) => globalThis.fetch(input, init));
|
|
101
|
+
this.userToken = config.userToken;
|
|
102
|
+
const createSocket = config.webSocket === undefined ? (config.fetch ? undefined : globalWebSocketFactory()) : config.webSocket;
|
|
103
|
+
this.live = new AppLiveRegistry(createSocket ? new AppPushChannel(appRealtimeUrl(this.baseUrl), this.siteKey, createSocket) : undefined);
|
|
104
|
+
}
|
|
105
|
+
/** Builds the client from a hosted app's discovery file. */
|
|
106
|
+
static fromDiscovery(discovery, options = {}) {
|
|
107
|
+
return new AppItemsClient({
|
|
108
|
+
apiBaseUrl: discovery.apiBaseUrl,
|
|
109
|
+
siteKey: discovery.browserKey,
|
|
110
|
+
fetch: options.fetch,
|
|
111
|
+
userToken: options.userToken,
|
|
112
|
+
webSocket: options.webSocket,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Creates an item with the Site key; a signed-in creator owns it at once. Keep both tokens:
|
|
117
|
+
* they are shown this once.
|
|
118
|
+
*/
|
|
119
|
+
async createItem(request) {
|
|
120
|
+
return this.json({ method: "POST", path: ITEMS_PATH, body: request, ...this.signedIn() });
|
|
121
|
+
}
|
|
122
|
+
/** "My items": the live items the signed-in user owns in this app, most recently changed first. */
|
|
123
|
+
async listMyItems() {
|
|
124
|
+
return this.json({ method: "GET", path: ITEMS_PATH, ...this.signedIn() });
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Makes the signed-in holder of an owner link the item's owner. A repeat by the same user
|
|
128
|
+
* succeeds; an item another user owns is refused with `claimed`.
|
|
129
|
+
*/
|
|
130
|
+
/** Claims a link's item into the signed-in account; `item` names one item of a collection link. */
|
|
131
|
+
async claim(ownerToken, item) {
|
|
132
|
+
const { credential } = this.reach(ownerToken);
|
|
133
|
+
const result = await this.json({ method: "POST", path: `${ITEM_PATH}/claim`, credential, item });
|
|
134
|
+
this.live.refreshToken(accessKey(ownerToken));
|
|
135
|
+
return result;
|
|
136
|
+
}
|
|
137
|
+
readItem(access, options = {}) {
|
|
138
|
+
return this.conditional(ITEM_PATH, access, options);
|
|
139
|
+
}
|
|
140
|
+
planForecast(access, options = {}) {
|
|
141
|
+
const reached = this.reach(access);
|
|
142
|
+
return this.json({
|
|
143
|
+
method: "GET",
|
|
144
|
+
path: `${ITEM_PATH}/plan/forecast`,
|
|
145
|
+
credential: reached.credential,
|
|
146
|
+
item: options.item ?? reached.item,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
updatePlan(access, request) {
|
|
150
|
+
return this.write(access, "PATCH", `${ITEM_PATH}/plan`, request);
|
|
151
|
+
}
|
|
152
|
+
updateSettings(access, request) {
|
|
153
|
+
return this.write(access, "PATCH", ITEM_PATH, request);
|
|
154
|
+
}
|
|
155
|
+
/** Records up to 1000 measurements; check each row's `success`. */
|
|
156
|
+
addMeasurements(access, request) {
|
|
157
|
+
return this.write(access, "POST", `${ITEM_PATH}/measurements`, request);
|
|
158
|
+
}
|
|
159
|
+
/** Records measurements from a pasted CSV document. */
|
|
160
|
+
importMeasurementsCsv(access, csv) {
|
|
161
|
+
return this.write(access, "POST", `${ITEM_PATH}/measurements/csv`, { csv });
|
|
162
|
+
}
|
|
163
|
+
/** The counter project's runs, newest first. */
|
|
164
|
+
async listRuns(access, options = {}) {
|
|
165
|
+
const page = await this.page(`${ITEM_PATH}/runs`, access, options.item, {
|
|
166
|
+
after: options.after,
|
|
167
|
+
limit: options.limit,
|
|
168
|
+
});
|
|
169
|
+
return { ...page, runs: page.runs ?? [] };
|
|
170
|
+
}
|
|
171
|
+
/** Starts a new run of the counter project. Owner only. */
|
|
172
|
+
startRun(access, request) {
|
|
173
|
+
return this.write(access, "POST", `${ITEM_PATH}/runs`, request);
|
|
174
|
+
}
|
|
175
|
+
/** The item's recorded measurements, oldest first. */
|
|
176
|
+
async listMeasurements(access, options = {}) {
|
|
177
|
+
const page = await this.page(`${ITEM_PATH}/measurements`, access, options.item, { after: options.after, limit: options.limit, run: options.run });
|
|
178
|
+
return { ...page, rows: page.rows ?? [] };
|
|
179
|
+
}
|
|
180
|
+
createEstimate(access, request) {
|
|
181
|
+
return this.write(access, "POST", `${ITEM_PATH}/estimates`, request);
|
|
182
|
+
}
|
|
183
|
+
complete(access, request) {
|
|
184
|
+
return this.write(access, "POST", `${ITEM_PATH}/complete`, request);
|
|
185
|
+
}
|
|
186
|
+
cancel(access) {
|
|
187
|
+
return this.write(access, "POST", `${ITEM_PATH}/cancel`);
|
|
188
|
+
}
|
|
189
|
+
reopen(access) {
|
|
190
|
+
return this.write(access, "POST", `${ITEM_PATH}/reopen`);
|
|
191
|
+
}
|
|
192
|
+
/** Adds the item a pasted link opens to a link collection. */
|
|
193
|
+
addEntry(access, request) {
|
|
194
|
+
return this.write(access, "POST", `${ITEM_PATH}/entries`, request);
|
|
195
|
+
}
|
|
196
|
+
async removeEntry(access, entryUuid) {
|
|
197
|
+
await this.write(access, "DELETE", `${ITEM_PATH}/entries/${encodeURIComponent(entryUuid)}`);
|
|
198
|
+
}
|
|
199
|
+
async revokeLink(access, linkUuid) {
|
|
200
|
+
await this.write(access, "DELETE", `${ITEM_PATH}/links/${encodeURIComponent(linkUuid)}`);
|
|
201
|
+
}
|
|
202
|
+
/** Replaces a link; the old token stops working. The new token is shown this once. */
|
|
203
|
+
rotateLink(access, linkUuid) {
|
|
204
|
+
return this.write(access, "POST", `${ITEM_PATH}/links/${encodeURIComponent(linkUuid)}/rotate`);
|
|
205
|
+
}
|
|
206
|
+
/** Runs the item's forecast. Owner link only. */
|
|
207
|
+
runForecast(access, request = {}) {
|
|
208
|
+
return this.write(access, "POST", `${FORECAST_PATH}/runs`, request);
|
|
209
|
+
}
|
|
210
|
+
/** The newest forecast run; a `forecastMissing` AppItemError until one exists. */
|
|
211
|
+
latestForecast(access, options = {}) {
|
|
212
|
+
return this.conditional(`${FORECAST_PATH}/latest`, access, options);
|
|
213
|
+
}
|
|
214
|
+
forecastRun(access, runUuid, options = {}) {
|
|
215
|
+
return this.conditional(`${FORECAST_PATH}/runs/${encodeURIComponent(runUuid)}`, access, options);
|
|
216
|
+
}
|
|
217
|
+
forecastStory(access, options = {}) {
|
|
218
|
+
return this.conditional(`${FORECAST_PATH}/story`, access, options);
|
|
219
|
+
}
|
|
220
|
+
/** Saves a new immutable version of the item's model: the whole quantity list. Owner link only. */
|
|
221
|
+
addModelVersion(access, request) {
|
|
222
|
+
return this.write(access, "POST", `${ITEM_PATH}/model/versions`, request);
|
|
223
|
+
}
|
|
224
|
+
/** Copies a version into a new model item with its own two links, each token shown this once. */
|
|
225
|
+
copyModel(access, request = {}) {
|
|
226
|
+
return this.write(access, "POST", `${ITEM_PATH}/model/copy`, request);
|
|
227
|
+
}
|
|
228
|
+
/** Runs the item's model and stores the run, which becomes every viewer's latest. Owner link only. */
|
|
229
|
+
runModel(access, request) {
|
|
230
|
+
return this.write(access, "POST", `${MODELS_PATH}/runs`, request);
|
|
231
|
+
}
|
|
232
|
+
/** Runs a version with some inputs set to other values and returns only `outputs`. Any link; never stored. */
|
|
233
|
+
calculateModel(access, request) {
|
|
234
|
+
return this.json({
|
|
235
|
+
method: "POST",
|
|
236
|
+
path: `${MODELS_PATH}/calculate`,
|
|
237
|
+
body: request,
|
|
238
|
+
...this.reach(access),
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/** The newest model run; a `runMissing` AppItemError until one exists. */
|
|
242
|
+
latestModelRun(access, options = {}) {
|
|
243
|
+
return this.conditional(`${MODELS_PATH}/latest`, access, options);
|
|
244
|
+
}
|
|
245
|
+
/** The item's alert rules, webhooks and the signed-in caller's email subscription. Owner only. */
|
|
246
|
+
alertSettings(access) {
|
|
247
|
+
return this.json({ method: "GET", path: ALERTS_PATH, ...this.reach(access) });
|
|
248
|
+
}
|
|
249
|
+
/** The item's newest alert deliveries, at most 100. Owner only. */
|
|
250
|
+
alertDeliveries(access) {
|
|
251
|
+
return this.json({ method: "GET", path: `${ALERTS_PATH}/deliveries`, ...this.reach(access) });
|
|
252
|
+
}
|
|
253
|
+
/** Adds a rule that fires once each time its condition becomes true. At most 10 per item. */
|
|
254
|
+
addAlertRule(access, rule) {
|
|
255
|
+
return this.json({ method: "POST", path: `${ALERTS_PATH}/rules`, body: rule, ...this.reach(access) });
|
|
256
|
+
}
|
|
257
|
+
/** Removes a rule and its delivery history. */
|
|
258
|
+
async removeAlertRule(access, ruleUuid) {
|
|
259
|
+
await this.json({
|
|
260
|
+
method: "DELETE",
|
|
261
|
+
path: `${ALERTS_PATH}/rules/${encodeURIComponent(ruleUuid)}`,
|
|
262
|
+
...this.reach(access),
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
/** Registers a signed webhook. Its `signingSecret` is shown this once. At most 5 per item. */
|
|
266
|
+
addAlertWebhook(access, request) {
|
|
267
|
+
return this.json({
|
|
268
|
+
method: "POST",
|
|
269
|
+
path: `${ALERTS_PATH}/webhooks`,
|
|
270
|
+
body: request,
|
|
271
|
+
...this.reach(access),
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Posts the item's alerts to a Slack incoming webhook as Slack messages. The URL is checked,
|
|
276
|
+
* stored sealed and never returned; it counts against the 5 webhooks per item.
|
|
277
|
+
*/
|
|
278
|
+
addAlertSlack(access, request) {
|
|
279
|
+
return this.json({
|
|
280
|
+
method: "POST",
|
|
281
|
+
path: `${ALERTS_PATH}/slack`,
|
|
282
|
+
body: request,
|
|
283
|
+
...this.reach(access),
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
/** Removes a webhook or Slack destination; its undelivered alerts go with it. */
|
|
287
|
+
async removeAlertWebhook(access, webhookUuid) {
|
|
288
|
+
await this.json({
|
|
289
|
+
method: "DELETE",
|
|
290
|
+
path: `${ALERTS_PATH}/webhooks/${encodeURIComponent(webhookUuid)}`,
|
|
291
|
+
...this.reach(access),
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Emails the signed-in user's verified address when a rule fires; repeating it keeps one
|
|
296
|
+
* subscription. Refused with `app_sign_in_required` when signed out, `verifiedEmailNeeded` when
|
|
297
|
+
* the user has no verified address, and a retryable `emailCheckUnavailable`.
|
|
298
|
+
*/
|
|
299
|
+
subscribeAlertEmail(access) {
|
|
300
|
+
return this.json({
|
|
301
|
+
method: "PUT",
|
|
302
|
+
path: `${ALERTS_PATH}/subscription`,
|
|
303
|
+
...this.reach(access),
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
/** Stops the signed-in user's alert email. Repeating it succeeds. */
|
|
307
|
+
async unsubscribeAlertEmail(access) {
|
|
308
|
+
await this.json({ method: "DELETE", path: `${ALERTS_PATH}/subscription`, ...this.reach(access) });
|
|
309
|
+
}
|
|
310
|
+
/** The confirmation page an alert email's unsubscribe link opens, as HTML. It changes nothing. */
|
|
311
|
+
async getAlertUnsubscribePage(token) {
|
|
312
|
+
const response = await this.send({ method: "GET", path: `${ALERTS_PATH}/unsubscribe`, query: { token } });
|
|
313
|
+
return response.text();
|
|
314
|
+
}
|
|
315
|
+
/** Stops the alert email an unsubscribe link names; it needs no sign-in. Repeating it succeeds. */
|
|
316
|
+
async unsubscribeAlertEmailByToken(request) {
|
|
317
|
+
await this.json({ method: "POST", path: `${ALERTS_PATH}/unsubscribe`, body: request });
|
|
318
|
+
}
|
|
319
|
+
/** Starts the meeting item's first block. Owner only. */
|
|
320
|
+
updateMeetingMinutes(access, request) {
|
|
321
|
+
return this.write(access, "PATCH", `${ITEM_PATH}/meeting/minutes`, request);
|
|
322
|
+
}
|
|
323
|
+
startMeeting(access) {
|
|
324
|
+
return this.meetingStep(access, "start");
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Finishes the block `blockUuid` names (the meeting's `currentBlockUuid`) and puts the next one
|
|
328
|
+
* on. Repeating the advance of the block that just finished returns the meeting unchanged; any
|
|
329
|
+
* other block is refused with a 409 `stepRefused`, after which watched reads poll at once.
|
|
330
|
+
*/
|
|
331
|
+
advanceMeeting(access, request) {
|
|
332
|
+
return this.meetingStep(access, "advance", request);
|
|
333
|
+
}
|
|
334
|
+
/** Ends the meeting now; blocks not reached are recorded as `not_run`. */
|
|
335
|
+
endMeeting(access) {
|
|
336
|
+
return this.meetingStep(access, "end");
|
|
337
|
+
}
|
|
338
|
+
/** A self-refreshing latest model run; `empty` until the first run exists. */
|
|
339
|
+
watchLatestModelRun(access, options = {}) {
|
|
340
|
+
return this.live.watch(this.liveKey(access, "model_latest", options.item), accessKey(access), options, (etag) => this.latestModelRun(access, { item: options.item, etag }).catch(noModelRunYet), this.pushTarget(access, options.item));
|
|
341
|
+
}
|
|
342
|
+
/** A self-refreshing item read, shared by every caller watching the same item and link. */
|
|
343
|
+
watchItem(access, options = {}) {
|
|
344
|
+
return this.live.watch(this.liveKey(access, "item", options.item), accessKey(access), options, (etag) => this.readItem(access, { item: options.item, etag }), this.pushTarget(access, options.item));
|
|
345
|
+
}
|
|
346
|
+
/** A self-refreshing latest forecast; `empty` until the first run exists. */
|
|
347
|
+
watchLatestForecast(access, options = {}) {
|
|
348
|
+
return this.live.watch(this.liveKey(access, "forecast_latest", options.item), accessKey(access), options, (etag) => this.latestForecast(access, { item: options.item, etag }).catch(noForecastYet), this.pushTarget(access, options.item));
|
|
349
|
+
}
|
|
350
|
+
/** A self-refreshing forecast story. */
|
|
351
|
+
watchForecastStory(access, options = {}) {
|
|
352
|
+
return this.live.watch(this.liveKey(access, "forecast_story", options.item), accessKey(access), options, (etag) => this.forecastStory(access, { item: options.item, etag }), this.pushTarget(access, options.item));
|
|
353
|
+
}
|
|
354
|
+
/** Polls every watched read now, for example after the signed-in user changed. */
|
|
355
|
+
refreshAll() {
|
|
356
|
+
this.live.refreshAll();
|
|
357
|
+
}
|
|
358
|
+
liveKey(access, resource, item) {
|
|
359
|
+
return `${resource}\u0000${item ?? ""}\u0000${accessKey(access)}`;
|
|
360
|
+
}
|
|
361
|
+
/** What a watched read subscribes with: its link, or the signed-in user's own item. */
|
|
362
|
+
pushTarget(access, item) {
|
|
363
|
+
const userToken = () => this.userToken?.()?.trim() || undefined;
|
|
364
|
+
if (typeof access === "string")
|
|
365
|
+
return { linkToken: access, item, userToken };
|
|
366
|
+
return { item: item ?? access.item, userToken };
|
|
367
|
+
}
|
|
368
|
+
/** The link or user-owned item a call reaches, with the signed-in user when there is one. */
|
|
369
|
+
reach(access) {
|
|
370
|
+
const userToken = this.userToken?.()?.trim() || undefined;
|
|
371
|
+
if (typeof access === "string")
|
|
372
|
+
return { credential: { linkToken: access, userToken } };
|
|
373
|
+
return { credential: { userToken }, item: access.item };
|
|
374
|
+
}
|
|
375
|
+
signedIn() {
|
|
376
|
+
return { credential: { userToken: this.userToken?.()?.trim() || undefined } };
|
|
377
|
+
}
|
|
378
|
+
async write(access, method, path, body) {
|
|
379
|
+
const result = await this.json({ method, path, body, ...this.reach(access) });
|
|
380
|
+
this.live.refreshToken(accessKey(access));
|
|
381
|
+
return result;
|
|
382
|
+
}
|
|
383
|
+
async meetingStep(access, step, body) {
|
|
384
|
+
try {
|
|
385
|
+
return await this.write(access, "POST", `${MEETING_PATH}/${step}`, body);
|
|
386
|
+
}
|
|
387
|
+
catch (error) {
|
|
388
|
+
// A refused step means this page's view is behind: show watchers the meeting as it is.
|
|
389
|
+
if (error instanceof AppItemError && error.code === APP_MEETING_ERROR_CODES.stepRefused) {
|
|
390
|
+
this.live.refreshToken(accessKey(access));
|
|
391
|
+
}
|
|
392
|
+
throw error;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
async conditional(path, access, options) {
|
|
396
|
+
const reached = this.reach(access);
|
|
397
|
+
const response = await this.send({
|
|
398
|
+
method: "GET",
|
|
399
|
+
path,
|
|
400
|
+
credential: reached.credential,
|
|
401
|
+
item: options.item ?? reached.item,
|
|
402
|
+
etag: options.etag,
|
|
403
|
+
});
|
|
404
|
+
if (response.status === 304)
|
|
405
|
+
return { status: "not_modified", etag: response.headers.get("etag") ?? options.etag ?? "" };
|
|
406
|
+
const data = emptyAppNullLists("GET", path, (await response.json().catch(() => {
|
|
407
|
+
throw new AppItemError(response.status, APP_ITEM_ERROR_CODES.invalidResponse);
|
|
408
|
+
})));
|
|
409
|
+
return { status: "modified", data, etag: response.headers.get("etag") };
|
|
410
|
+
}
|
|
411
|
+
page(path, access, item, query) {
|
|
412
|
+
const reached = this.reach(access);
|
|
413
|
+
return this.json({
|
|
414
|
+
method: "GET",
|
|
415
|
+
path,
|
|
416
|
+
credential: reached.credential,
|
|
417
|
+
item: item ?? reached.item,
|
|
418
|
+
query: Object.fromEntries(Object.entries(query).map(([name, value]) => [name, value?.toString()])),
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
async json(request) {
|
|
422
|
+
const response = await this.send(request);
|
|
423
|
+
if (response.status === 204)
|
|
424
|
+
return null;
|
|
425
|
+
return emptyAppNullLists(request.method, request.path, (await response.json()));
|
|
426
|
+
}
|
|
427
|
+
async send(request) {
|
|
428
|
+
const url = new URL(`${this.baseUrl}${request.path}`);
|
|
429
|
+
if (request.item)
|
|
430
|
+
url.searchParams.set("item", request.item);
|
|
431
|
+
for (const [name, value] of Object.entries(request.query ?? {})) {
|
|
432
|
+
if (value !== undefined)
|
|
433
|
+
url.searchParams.set(name, value);
|
|
434
|
+
}
|
|
435
|
+
// Only the headers the app routes' preflight allows.
|
|
436
|
+
const headers = { [APP_ITEM_SITE_KEY_HEADER]: this.siteKey };
|
|
437
|
+
if (request.credential?.linkToken)
|
|
438
|
+
headers.Authorization = `Bearer ${request.credential.linkToken}`;
|
|
439
|
+
if (request.credential?.userToken)
|
|
440
|
+
headers[APP_ITEM_USER_TOKEN_HEADER] = request.credential.userToken;
|
|
441
|
+
if (request.etag)
|
|
442
|
+
headers["If-None-Match"] = request.etag;
|
|
443
|
+
if (request.body !== undefined)
|
|
444
|
+
headers["Content-Type"] = "application/json";
|
|
445
|
+
let response;
|
|
446
|
+
try {
|
|
447
|
+
response = await this.fetchImpl(url.toString(), {
|
|
448
|
+
method: request.method,
|
|
449
|
+
headers,
|
|
450
|
+
body: request.body === undefined ? undefined : JSON.stringify(request.body),
|
|
451
|
+
credentials: "omit",
|
|
452
|
+
cache: "no-store",
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
catch {
|
|
456
|
+
throw new AppItemError(null, APP_ITEM_ERROR_CODES.network);
|
|
457
|
+
}
|
|
458
|
+
if (response.ok || response.status === 304)
|
|
459
|
+
return response;
|
|
460
|
+
throw await problemError(response);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
function accessKey(access) {
|
|
464
|
+
return typeof access === "string" ? access : `item:${access.item}`;
|
|
465
|
+
}
|
|
466
|
+
async function problemError(response) {
|
|
467
|
+
const body = await response.json().catch(() => null);
|
|
468
|
+
const problem = isRecord(body) ? body : undefined;
|
|
469
|
+
const code = typeof problem?.code === "string" && problem.code !== "" ? problem.code : `http_${response.status}`;
|
|
470
|
+
return new AppItemError(response.status, code, problem);
|
|
471
|
+
}
|
|
472
|
+
/** A missing forecast is an empty answer, not a failure: polling carries on until a run lands. */
|
|
473
|
+
function noForecastYet(error) {
|
|
474
|
+
if (error instanceof AppItemError && error.code === APP_ITEM_ERROR_CODES.forecastMissing) {
|
|
475
|
+
return { status: APP_LIVE_STATUSES.empty };
|
|
476
|
+
}
|
|
477
|
+
throw error;
|
|
478
|
+
}
|
|
479
|
+
function noModelRunYet(error) {
|
|
480
|
+
if (error instanceof AppItemError && error.code === APP_MODEL_ERROR_CODES.runMissing) {
|
|
481
|
+
return { status: APP_LIVE_STATUSES.empty };
|
|
482
|
+
}
|
|
483
|
+
throw error;
|
|
484
|
+
}
|
|
485
|
+
function isRecord(value) {
|
|
486
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
487
|
+
}
|
|
488
|
+
// ---- Links ----
|
|
489
|
+
/** A link token is 32 random bytes as unpadded base64url. */
|
|
490
|
+
const LINK_TOKEN_PATTERN = /^[A-Za-z0-9_-]{43}$/;
|
|
491
|
+
/**
|
|
492
|
+
* The owner page: the token sits in the fragment, which browsers never send to a server, so no
|
|
493
|
+
* request log or page view records it.
|
|
494
|
+
*/
|
|
495
|
+
export function appItemOwnerUrl(parts) {
|
|
496
|
+
return `https://${parts.host}/edit/${encodeURIComponent(parts.kindPath)}#${parts.token}`;
|
|
497
|
+
}
|
|
498
|
+
/** The read-only share page. A share token may sit in the path because it only reads. */
|
|
499
|
+
export function appItemShareUrl(parts) {
|
|
500
|
+
return `https://${parts.host}/${encodeURIComponent(parts.kindPath)}/${parts.token}`;
|
|
501
|
+
}
|
|
502
|
+
/** Reads a pasted owner URL, share URL or bare token. Returns null when it holds no link token. */
|
|
503
|
+
export function parseAppItemLink(input) {
|
|
504
|
+
const value = input.trim();
|
|
505
|
+
if (LINK_TOKEN_PATTERN.test(value))
|
|
506
|
+
return { token: value };
|
|
507
|
+
let url;
|
|
508
|
+
try {
|
|
509
|
+
url = new URL(value);
|
|
510
|
+
}
|
|
511
|
+
catch {
|
|
512
|
+
return null;
|
|
513
|
+
}
|
|
514
|
+
const segments = url.pathname.split("/").filter((segment) => segment !== "");
|
|
515
|
+
const fragment = url.hash.replace(/^#/, "");
|
|
516
|
+
if (segments[0] === "edit" && segments.length === 2 && LINK_TOKEN_PATTERN.test(fragment)) {
|
|
517
|
+
return { token: fragment, role: APP_LINK_ROLES.owner, kindPath: segments[1] };
|
|
518
|
+
}
|
|
519
|
+
const last = segments[segments.length - 1];
|
|
520
|
+
if (segments.length === 2 && last !== undefined && LINK_TOKEN_PATTERN.test(last)) {
|
|
521
|
+
return { token: last, role: APP_LINK_ROLES.share, kindPath: segments[0] };
|
|
522
|
+
}
|
|
523
|
+
return null;
|
|
524
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { AppConditionalRead, AppItemError } from "./app-items.js";
|
|
2
|
+
import type { AppPushChannel, AppPushTarget } from "./app-push.js";
|
|
3
|
+
export declare const APP_LIVE_STATUSES: {
|
|
4
|
+
/** No answer yet. */
|
|
5
|
+
readonly loading: "loading";
|
|
6
|
+
/** The last poll confirmed the data. */
|
|
7
|
+
readonly fresh: "fresh";
|
|
8
|
+
/** The last poll confirmed there is nothing yet, such as no forecast run. */
|
|
9
|
+
readonly empty: "empty";
|
|
10
|
+
/** The data is from an earlier poll; the last one failed and is being retried. */
|
|
11
|
+
readonly stale: "stale";
|
|
12
|
+
/** The last poll got no answer; retried with backoff and as soon as the browser is online. */
|
|
13
|
+
readonly offline: "offline";
|
|
14
|
+
/** Refused (link revoked or expired, key refused), or failing before any data arrived. */
|
|
15
|
+
readonly error: "error";
|
|
16
|
+
};
|
|
17
|
+
export type AppLiveStatus = (typeof APP_LIVE_STATUSES)[keyof typeof APP_LIVE_STATUSES];
|
|
18
|
+
/**
|
|
19
|
+
* A watched read. `lastUpdatedAt` is when the server last confirmed the data, including a 304.
|
|
20
|
+
* Data from an earlier poll is kept through stale, offline and error states.
|
|
21
|
+
*/
|
|
22
|
+
export type AppLiveState<T> = {
|
|
23
|
+
status: typeof APP_LIVE_STATUSES.loading;
|
|
24
|
+
} | {
|
|
25
|
+
status: typeof APP_LIVE_STATUSES.fresh;
|
|
26
|
+
data: T;
|
|
27
|
+
lastUpdatedAt: Date;
|
|
28
|
+
} | {
|
|
29
|
+
status: typeof APP_LIVE_STATUSES.empty;
|
|
30
|
+
lastUpdatedAt: Date;
|
|
31
|
+
} | {
|
|
32
|
+
status: typeof APP_LIVE_STATUSES.stale;
|
|
33
|
+
data: T;
|
|
34
|
+
lastUpdatedAt: Date;
|
|
35
|
+
error: AppItemError;
|
|
36
|
+
} | {
|
|
37
|
+
status: typeof APP_LIVE_STATUSES.offline;
|
|
38
|
+
data?: T;
|
|
39
|
+
lastUpdatedAt?: Date;
|
|
40
|
+
error: AppItemError;
|
|
41
|
+
} | {
|
|
42
|
+
status: typeof APP_LIVE_STATUSES.error;
|
|
43
|
+
data?: T;
|
|
44
|
+
lastUpdatedAt?: Date;
|
|
45
|
+
error: AppItemError;
|
|
46
|
+
/** False when retrying cannot help; polling has stopped until `refresh()`. */
|
|
47
|
+
retrying: boolean;
|
|
48
|
+
};
|
|
49
|
+
export type AppLiveWatchOptions = {
|
|
50
|
+
/** Read an item of the presented link collection by its UUID. */
|
|
51
|
+
item?: string;
|
|
52
|
+
/** Poll interval; the first watcher of a shared poller sets it. Default 5000. */
|
|
53
|
+
intervalMs?: number;
|
|
54
|
+
/** Longest wait between retries while polls fail. Default 60000. */
|
|
55
|
+
maxBackoffMs?: number;
|
|
56
|
+
};
|
|
57
|
+
/** A handle on a shared poller. Polling runs while at least one listener is subscribed. */
|
|
58
|
+
export type AppLiveWatch<T> = {
|
|
59
|
+
getState: () => AppLiveState<T>;
|
|
60
|
+
subscribe: (listener: () => void) => () => void;
|
|
61
|
+
/** Polls now, for example after a change made elsewhere. */
|
|
62
|
+
refresh: () => void;
|
|
63
|
+
};
|
|
64
|
+
export declare const APP_LIVE_DEFAULT_INTERVAL_MS = 5000;
|
|
65
|
+
/** The safety poll interval while pushed changes carry a read. */
|
|
66
|
+
export declare const APP_LIVE_PUSHED_INTERVAL_MS = 60000;
|
|
67
|
+
/** A conditional read, or an answer that there is nothing to read yet. */
|
|
68
|
+
export type AppLiveRead<T> = AppConditionalRead<T> | {
|
|
69
|
+
status: typeof APP_LIVE_STATUSES.empty;
|
|
70
|
+
};
|
|
71
|
+
type Loader<T> = (etag: string | undefined) => Promise<AppLiveRead<T>>;
|
|
72
|
+
/** The pollers of one client, keyed by resource, collection item and link. */
|
|
73
|
+
export declare class AppLiveRegistry {
|
|
74
|
+
private readonly push?;
|
|
75
|
+
private readonly pollers;
|
|
76
|
+
/** `push`, when given, carries pushed changes for every read watched with a push target. */
|
|
77
|
+
constructor(push?: AppPushChannel | undefined);
|
|
78
|
+
watch<T>(key: string, token: string, options: AppLiveWatchOptions, load: Loader<T>, pushTarget?: AppPushTarget): AppLiveWatch<T>;
|
|
79
|
+
/** Polls every watched read now, and resubscribes pushed reads whose user token changed. */
|
|
80
|
+
refreshAll(): void;
|
|
81
|
+
/** Polls every watched read of this link now, after a change made through it. */
|
|
82
|
+
refreshToken(token: string): void;
|
|
83
|
+
}
|
|
84
|
+
export {};
|