@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,786 @@
|
|
|
1
|
+
import { type AppAlertDeliveryList, type AppAlertRule, type AppAlertRuleSpec, type AppAlertSettings, type AppAlertSlackCreateRequest, type AppAlertSubscription, type AppAlertWebhook, type AppAlertWebhookCreated, type AppAlertWebhookCreateRequest } from "./app-alerts.js";
|
|
2
|
+
import { type AppLiveWatch, type AppLiveWatchOptions } from "./app-live.js";
|
|
3
|
+
import { type AppMeeting, type AppMeetingAdvanceRequest, type AppMeetingCreate, type AppMeetingMinutes, type AppMeetingMinutesUpdate, type AppPlanMeetingSummary } from "./app-meetings.js";
|
|
4
|
+
import { type AppModelCalculateRequest, type AppModelCalculateResult, type AppModelCopyRequest, type AppModelCreate, type AppModelRun, type AppModelRunRequest, type AppModelVersionCreateRequest, type AppUncertaintyModel } from "./app-models.js";
|
|
5
|
+
import { type AppWebSocketFactory } from "./app-push.js";
|
|
6
|
+
export declare const APP_ITEM_SITE_KEY_HEADER = "X-Custd-Site-Key";
|
|
7
|
+
/** Carries the signed-in user's access token beside the link token. */
|
|
8
|
+
export declare const APP_ITEM_USER_TOKEN_HEADER = "X-Custd-User-Token";
|
|
9
|
+
export declare const APP_ITEM_OWNERSHIPS: {
|
|
10
|
+
readonly unowned: "unowned";
|
|
11
|
+
readonly yours: "yours";
|
|
12
|
+
readonly other: "other";
|
|
13
|
+
};
|
|
14
|
+
/** How the item's owner relates to the signed-in caller. */
|
|
15
|
+
export type AppItemOwnership = (typeof APP_ITEM_OWNERSHIPS)[keyof typeof APP_ITEM_OWNERSHIPS];
|
|
16
|
+
export declare const APP_ITEM_KINDS: {
|
|
17
|
+
readonly measurementProject: "measurement_project";
|
|
18
|
+
readonly linkCollection: "link_collection";
|
|
19
|
+
readonly uncertaintyModel: "uncertainty_model";
|
|
20
|
+
readonly meeting: "meeting";
|
|
21
|
+
readonly plan: "plan";
|
|
22
|
+
};
|
|
23
|
+
export type AppItemKind = (typeof APP_ITEM_KINDS)[keyof typeof APP_ITEM_KINDS];
|
|
24
|
+
export declare const APP_LINK_ROLES: {
|
|
25
|
+
readonly owner: "owner";
|
|
26
|
+
readonly share: "share";
|
|
27
|
+
};
|
|
28
|
+
export type AppLinkRole = (typeof APP_LINK_ROLES)[keyof typeof APP_LINK_ROLES];
|
|
29
|
+
export declare const APP_MEASUREMENT_PROJECT_KINDS: {
|
|
30
|
+
readonly deadlineForecast: "deadline_forecast";
|
|
31
|
+
readonly runwayForecast: "runway_forecast";
|
|
32
|
+
};
|
|
33
|
+
export type AppMeasurementProjectKind = (typeof APP_MEASUREMENT_PROJECT_KINDS)[keyof typeof APP_MEASUREMENT_PROJECT_KINDS];
|
|
34
|
+
export declare const APP_FORECAST_METHODS: {
|
|
35
|
+
readonly bootstrapQuantile: "bootstrap_quantile";
|
|
36
|
+
readonly bayesianLinearRegression: "bayesian_linear_regression";
|
|
37
|
+
readonly seasonal7Day: "seasonal_7_day";
|
|
38
|
+
};
|
|
39
|
+
export type AppForecastMethod = (typeof APP_FORECAST_METHODS)[keyof typeof APP_FORECAST_METHODS];
|
|
40
|
+
/** Problem codes the app routes answer with. */
|
|
41
|
+
export declare const APP_ITEM_ERROR_CODES: {
|
|
42
|
+
readonly keyRefused: "app_key_refused";
|
|
43
|
+
readonly linkRefused: "app_link_refused";
|
|
44
|
+
readonly readOnlyLink: "app_link_read_only";
|
|
45
|
+
readonly notFound: "app_item_not_found";
|
|
46
|
+
readonly wrongKind: "app_item_wrong_kind";
|
|
47
|
+
readonly createLimited: "app_item_create_limited";
|
|
48
|
+
readonly measurementLimit: "app_item_measurement_limit";
|
|
49
|
+
readonly seriesRequired: "app_item_series_required";
|
|
50
|
+
readonly collectionFull: "app_item_collection_full";
|
|
51
|
+
readonly notCollectable: "app_item_not_collectable";
|
|
52
|
+
readonly invalid: "app_item_invalid";
|
|
53
|
+
readonly forecastMissing: "app_forecast_missing";
|
|
54
|
+
/** Another user already owns the item. */
|
|
55
|
+
readonly claimed: "app_item_claimed";
|
|
56
|
+
/** The user access token does not sign anyone in to this app: sign in again. */
|
|
57
|
+
readonly userRefused: "app_user_refused";
|
|
58
|
+
/** The sign-in could not be checked right now; retry, and keep the user signed in. */
|
|
59
|
+
readonly userCheckUnavailable: "app_user_check_unavailable";
|
|
60
|
+
/** The route acts for a signed-in user and none was presented. */
|
|
61
|
+
readonly signInRequired: "app_sign_in_required";
|
|
62
|
+
/** The request never got an answer: offline, DNS, CORS refusal. */
|
|
63
|
+
readonly network: "network";
|
|
64
|
+
/** A success answer whose body was not JSON. */
|
|
65
|
+
readonly invalidResponse: "invalid_response";
|
|
66
|
+
/** The hosted app has no app data capability, or did not start. */
|
|
67
|
+
readonly unavailable: "app_data_unavailable";
|
|
68
|
+
};
|
|
69
|
+
export type AppMeasurementSeriesCreate = {
|
|
70
|
+
seriesCode: string;
|
|
71
|
+
name: string;
|
|
72
|
+
unitSlug: string;
|
|
73
|
+
unitLabel?: string;
|
|
74
|
+
completionDirection: string;
|
|
75
|
+
source: string;
|
|
76
|
+
};
|
|
77
|
+
export type AppMeasurementTargetCreate = {
|
|
78
|
+
targetCode: string;
|
|
79
|
+
name: string;
|
|
80
|
+
targetValue: number;
|
|
81
|
+
/** RFC 3339. */
|
|
82
|
+
targetDate?: string;
|
|
83
|
+
state: string;
|
|
84
|
+
};
|
|
85
|
+
/** The project a measurement_project item wraps. Custd chooses its project code. */
|
|
86
|
+
export type AppMeasurementProjectCreate = {
|
|
87
|
+
kind: AppMeasurementProjectKind;
|
|
88
|
+
name: string;
|
|
89
|
+
description?: string;
|
|
90
|
+
series: AppMeasurementSeriesCreate[];
|
|
91
|
+
target: AppMeasurementTargetCreate;
|
|
92
|
+
};
|
|
93
|
+
export type AppItemCreateRequest = {
|
|
94
|
+
kind: typeof APP_ITEM_KINDS.measurementProject;
|
|
95
|
+
/** Seconds without a change before the item is deleted: 60 to 31536000, default 7 days. */
|
|
96
|
+
idleExpirySeconds?: number;
|
|
97
|
+
measurementProject: AppMeasurementProjectCreate;
|
|
98
|
+
} | {
|
|
99
|
+
kind: typeof APP_ITEM_KINDS.linkCollection | typeof APP_ITEM_KINDS.plan;
|
|
100
|
+
idleExpirySeconds?: number;
|
|
101
|
+
name?: string;
|
|
102
|
+
} | {
|
|
103
|
+
kind: typeof APP_ITEM_KINDS.meeting;
|
|
104
|
+
idleExpirySeconds?: number;
|
|
105
|
+
meeting: AppMeetingCreate;
|
|
106
|
+
} | {
|
|
107
|
+
kind: typeof APP_ITEM_KINDS.uncertaintyModel;
|
|
108
|
+
idleExpirySeconds?: number;
|
|
109
|
+
uncertaintyModel: AppModelCreate;
|
|
110
|
+
};
|
|
111
|
+
/** Changes only the fields it names. */
|
|
112
|
+
export type AppProjectUpdateRequest = {
|
|
113
|
+
name?: string;
|
|
114
|
+
description?: string;
|
|
115
|
+
status?: string;
|
|
116
|
+
definitionOfDone?: string;
|
|
117
|
+
deliveryTargetDate?: string;
|
|
118
|
+
forecastMethod?: AppForecastMethod;
|
|
119
|
+
runSimilar?: boolean;
|
|
120
|
+
};
|
|
121
|
+
export type AppItemSettingsRequest = {
|
|
122
|
+
name?: string;
|
|
123
|
+
idleExpirySeconds?: number;
|
|
124
|
+
project?: AppProjectUpdateRequest;
|
|
125
|
+
};
|
|
126
|
+
export type AppPlanPart = {
|
|
127
|
+
itemUuid: string;
|
|
128
|
+
required: boolean;
|
|
129
|
+
prerequisites: string[];
|
|
130
|
+
};
|
|
131
|
+
export type AppPlan = {
|
|
132
|
+
name?: string;
|
|
133
|
+
revision: number;
|
|
134
|
+
deadline?: string;
|
|
135
|
+
parts: AppPlanPart[];
|
|
136
|
+
};
|
|
137
|
+
export type AppPlanForecast = {
|
|
138
|
+
revision: number;
|
|
139
|
+
asOf: string;
|
|
140
|
+
horizon: string;
|
|
141
|
+
model: string;
|
|
142
|
+
requiredParts: number;
|
|
143
|
+
completedParts: number;
|
|
144
|
+
missingParts: string[];
|
|
145
|
+
deadlineProbability?: number;
|
|
146
|
+
median?: string;
|
|
147
|
+
/** Median of the immediately preceding stored forecast, when available. */
|
|
148
|
+
previousMedian?: string;
|
|
149
|
+
lower?: string;
|
|
150
|
+
upper?: string;
|
|
151
|
+
horizonMissFraction?: number;
|
|
152
|
+
observedProgress?: AppPlanProgressPoint[];
|
|
153
|
+
projectedProgress?: AppPlanProgressBand[];
|
|
154
|
+
};
|
|
155
|
+
export type AppPlanProgressPoint = {
|
|
156
|
+
at: string;
|
|
157
|
+
completed: number;
|
|
158
|
+
};
|
|
159
|
+
export type AppPlanProgressBand = {
|
|
160
|
+
at: string;
|
|
161
|
+
lower: number;
|
|
162
|
+
median: number;
|
|
163
|
+
upper: number;
|
|
164
|
+
};
|
|
165
|
+
export type AppPlanUpdate = {
|
|
166
|
+
expectedRevision: number;
|
|
167
|
+
deadline?: string;
|
|
168
|
+
parts: Array<AppPlanPart & {
|
|
169
|
+
linkToken?: string;
|
|
170
|
+
}>;
|
|
171
|
+
};
|
|
172
|
+
export type AppMeasurementRow = {
|
|
173
|
+
/** Optional when the project has one series. */
|
|
174
|
+
seriesUuid?: string;
|
|
175
|
+
/** RFC 3339. */
|
|
176
|
+
observedAt: string;
|
|
177
|
+
value: number;
|
|
178
|
+
idempotencyKey?: string;
|
|
179
|
+
observationUuid?: string;
|
|
180
|
+
};
|
|
181
|
+
export type AppMeasurementBulkRequest = {
|
|
182
|
+
rows: AppMeasurementRow[];
|
|
183
|
+
};
|
|
184
|
+
export type AppEstimateCreateRequest = {
|
|
185
|
+
estimatedAt?: string;
|
|
186
|
+
lowDate: string;
|
|
187
|
+
highDate: string;
|
|
188
|
+
note?: string;
|
|
189
|
+
};
|
|
190
|
+
export type AppProjectCompleteRequest = {
|
|
191
|
+
completedAt: string;
|
|
192
|
+
};
|
|
193
|
+
/** A new run of a counter project: a sibling project sharing its series. */
|
|
194
|
+
export type AppRunCreateRequest = {
|
|
195
|
+
projectCode: string;
|
|
196
|
+
name?: string;
|
|
197
|
+
targetDate?: string;
|
|
198
|
+
};
|
|
199
|
+
/** Keyset paging for an item's runs or measurements: `after` is the previous page's `nextCursor`. */
|
|
200
|
+
export type AppItemPageOptions = {
|
|
201
|
+
item?: string;
|
|
202
|
+
after?: string;
|
|
203
|
+
limit?: number;
|
|
204
|
+
};
|
|
205
|
+
/** Measurement paging; `run` reads another run of the same series instead of the item's own. */
|
|
206
|
+
export type AppItemMeasurementPageOptions = AppItemPageOptions & {
|
|
207
|
+
run?: string;
|
|
208
|
+
};
|
|
209
|
+
export type AppItemRun = {
|
|
210
|
+
runUuid: string;
|
|
211
|
+
name: string;
|
|
212
|
+
status: string;
|
|
213
|
+
createdAt: string;
|
|
214
|
+
};
|
|
215
|
+
export type AppItemRunPage = {
|
|
216
|
+
runs: AppItemRun[];
|
|
217
|
+
nextCursor?: string;
|
|
218
|
+
};
|
|
219
|
+
export type AppItemMeasurement = {
|
|
220
|
+
observationUuid: string;
|
|
221
|
+
seriesUuid: string;
|
|
222
|
+
observedAt: string;
|
|
223
|
+
value: number;
|
|
224
|
+
};
|
|
225
|
+
export type AppItemMeasurementPage = {
|
|
226
|
+
runUuid: string;
|
|
227
|
+
rows: AppItemMeasurement[];
|
|
228
|
+
nextCursor?: string;
|
|
229
|
+
};
|
|
230
|
+
/** The token from an alert email's unsubscribe link. */
|
|
231
|
+
export type AppAlertUnsubscribeRequest = {
|
|
232
|
+
token: string;
|
|
233
|
+
};
|
|
234
|
+
export type AppLinkCollectionEntryAddRequest = {
|
|
235
|
+
/** A share (or owner) link token of another item of this app. */
|
|
236
|
+
token: string;
|
|
237
|
+
};
|
|
238
|
+
export type AppItem = {
|
|
239
|
+
itemUuid: string;
|
|
240
|
+
kind: AppItemKind;
|
|
241
|
+
role: AppLinkRole;
|
|
242
|
+
ownership: AppItemOwnership;
|
|
243
|
+
version: number;
|
|
244
|
+
idleExpirySeconds: number;
|
|
245
|
+
updatedAt: string;
|
|
246
|
+
expiresAt: string;
|
|
247
|
+
};
|
|
248
|
+
export type AppItemLink = {
|
|
249
|
+
linkUuid: string;
|
|
250
|
+
role: AppLinkRole;
|
|
251
|
+
/** The share token again, for share links created or rotated since recovery was enabled. */
|
|
252
|
+
shareToken?: string;
|
|
253
|
+
createdAt: string;
|
|
254
|
+
};
|
|
255
|
+
export type AppMeasurementSeries = {
|
|
256
|
+
seriesUuid: string;
|
|
257
|
+
seriesCode: string;
|
|
258
|
+
name: string;
|
|
259
|
+
unitSlug: string;
|
|
260
|
+
unitLabel?: string;
|
|
261
|
+
completionDirection: string;
|
|
262
|
+
source: string;
|
|
263
|
+
};
|
|
264
|
+
export type AppMeasurementTarget = {
|
|
265
|
+
targetUuid: string;
|
|
266
|
+
targetCode: string;
|
|
267
|
+
name: string;
|
|
268
|
+
targetValue: number;
|
|
269
|
+
targetDate?: string;
|
|
270
|
+
state: string;
|
|
271
|
+
completedAt?: string;
|
|
272
|
+
};
|
|
273
|
+
export type AppMeasurementProject = {
|
|
274
|
+
projectUuid: string;
|
|
275
|
+
projectCode: string;
|
|
276
|
+
kind: string;
|
|
277
|
+
status: string;
|
|
278
|
+
name: string;
|
|
279
|
+
description: string;
|
|
280
|
+
series?: AppMeasurementSeries[];
|
|
281
|
+
target?: AppMeasurementTarget;
|
|
282
|
+
delivery: {
|
|
283
|
+
definitionOfDone: string;
|
|
284
|
+
targetDate?: string;
|
|
285
|
+
completedAt?: string;
|
|
286
|
+
};
|
|
287
|
+
run: {
|
|
288
|
+
seriesRootUuid?: string;
|
|
289
|
+
similar: boolean;
|
|
290
|
+
forecastMethod?: string;
|
|
291
|
+
};
|
|
292
|
+
createdAt: string;
|
|
293
|
+
updatedAt: string;
|
|
294
|
+
};
|
|
295
|
+
export type AppProjectEstimate = {
|
|
296
|
+
estimateUuid: string;
|
|
297
|
+
estimatedAt: string;
|
|
298
|
+
lowDate: string;
|
|
299
|
+
highDate: string;
|
|
300
|
+
note: string;
|
|
301
|
+
};
|
|
302
|
+
export type AppProjectEstimateList = {
|
|
303
|
+
deliveryTargetDate?: string;
|
|
304
|
+
estimates: AppProjectEstimate[] | null;
|
|
305
|
+
latest?: {
|
|
306
|
+
estimate: AppProjectEstimate;
|
|
307
|
+
chanceByDeliveryTarget?: number;
|
|
308
|
+
ageDays: number;
|
|
309
|
+
movementDays?: number;
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
export type AppLinkCollectionEntry = {
|
|
313
|
+
entryUuid: string;
|
|
314
|
+
itemUuid: string;
|
|
315
|
+
kind: AppItemKind;
|
|
316
|
+
position: number;
|
|
317
|
+
/** The entry's share token, when its stored link is recoverable. */
|
|
318
|
+
shareToken?: string;
|
|
319
|
+
createdAt: string;
|
|
320
|
+
};
|
|
321
|
+
/** A counter item's progress toward its target. */
|
|
322
|
+
export type AppItemCounterProgress = {
|
|
323
|
+
current?: number;
|
|
324
|
+
percent?: number;
|
|
325
|
+
forecastP50?: string;
|
|
326
|
+
};
|
|
327
|
+
/** A model item's headline quantity at its 5th, 50th and 95th percentiles. */
|
|
328
|
+
export type AppModelPreview = {
|
|
329
|
+
quantity: string;
|
|
330
|
+
p5: number;
|
|
331
|
+
p50: number;
|
|
332
|
+
p95: number;
|
|
333
|
+
};
|
|
334
|
+
/** An item with its kind's content. `links` is listed for an owner link only. */
|
|
335
|
+
export type AppItemRead = {
|
|
336
|
+
item: AppItem;
|
|
337
|
+
links?: AppItemLink[];
|
|
338
|
+
measurementProject?: AppMeasurementProject;
|
|
339
|
+
estimates?: AppProjectEstimateList;
|
|
340
|
+
linkCollection?: {
|
|
341
|
+
name?: string;
|
|
342
|
+
entries: AppLinkCollectionEntry[] | null;
|
|
343
|
+
};
|
|
344
|
+
meeting?: AppMeeting;
|
|
345
|
+
meetingMinutes?: AppMeetingMinutes;
|
|
346
|
+
planMeetingSummaries?: AppPlanMeetingSummary[];
|
|
347
|
+
plan?: AppPlan;
|
|
348
|
+
uncertaintyModel?: AppUncertaintyModel;
|
|
349
|
+
measurementRuns?: {
|
|
350
|
+
runs: AppItemRun[] | null;
|
|
351
|
+
nextCursor?: string;
|
|
352
|
+
};
|
|
353
|
+
counterProgress?: AppItemCounterProgress;
|
|
354
|
+
modelPreview?: AppModelPreview;
|
|
355
|
+
};
|
|
356
|
+
/** A new item and its two links. Each token is shown this once: keep it, Custd cannot. */
|
|
357
|
+
export type AppItemCreated = {
|
|
358
|
+
item: AppItemRead;
|
|
359
|
+
ownerToken: string;
|
|
360
|
+
shareToken: string;
|
|
361
|
+
};
|
|
362
|
+
/** The replacement for a rotated link. The token is shown this once. */
|
|
363
|
+
export type AppItemLinkRotated = {
|
|
364
|
+
link: AppItemLink;
|
|
365
|
+
token: string;
|
|
366
|
+
};
|
|
367
|
+
export type AppMeasurementResult = {
|
|
368
|
+
rowIndex: number;
|
|
369
|
+
success: boolean;
|
|
370
|
+
observationUuid?: string;
|
|
371
|
+
status?: number;
|
|
372
|
+
type?: string;
|
|
373
|
+
title?: string;
|
|
374
|
+
detail?: string;
|
|
375
|
+
};
|
|
376
|
+
/** Each row's outcome. `completedTargetUuid` names a target an accepted measurement reached. */
|
|
377
|
+
export type AppMeasurementBulkResponse = {
|
|
378
|
+
importId: string;
|
|
379
|
+
accepted: number;
|
|
380
|
+
rejected: number;
|
|
381
|
+
results: AppMeasurementResult[] | null;
|
|
382
|
+
completedTargetUuid?: string;
|
|
383
|
+
};
|
|
384
|
+
/** One item of "my items", with its kind's name and short status so a list needs no reads. */
|
|
385
|
+
export type AppItemSummary = AppItem & {
|
|
386
|
+
/** The project's, meeting's or model's name; empty for a link collection. */
|
|
387
|
+
name: string;
|
|
388
|
+
/** The project's or meeting run's status; empty for a link collection or a model. */
|
|
389
|
+
status: string;
|
|
390
|
+
/** The code of a measurement project's first series. */
|
|
391
|
+
seriesCode?: string;
|
|
392
|
+
};
|
|
393
|
+
/** "My items": at most 200, most recently changed first. */
|
|
394
|
+
export type AppItemList = {
|
|
395
|
+
items: AppItemSummary[] | null;
|
|
396
|
+
};
|
|
397
|
+
export type AppForecastRunRequest = {
|
|
398
|
+
seed?: number;
|
|
399
|
+
sampleCount?: number;
|
|
400
|
+
method?: AppForecastMethod;
|
|
401
|
+
forecastFrom?: string;
|
|
402
|
+
};
|
|
403
|
+
export type AppForecastPoint = {
|
|
404
|
+
at: string;
|
|
405
|
+
value: number;
|
|
406
|
+
};
|
|
407
|
+
export type AppForecastInterval = {
|
|
408
|
+
confidence: number;
|
|
409
|
+
lower: string;
|
|
410
|
+
upper: string;
|
|
411
|
+
};
|
|
412
|
+
export type AppForecastWarning = {
|
|
413
|
+
code: string;
|
|
414
|
+
severity: string;
|
|
415
|
+
message: string;
|
|
416
|
+
};
|
|
417
|
+
export type AppForecastCounterResult = {
|
|
418
|
+
completionInterval?: AppForecastInterval;
|
|
419
|
+
deadlineProbability?: number;
|
|
420
|
+
rate?: {
|
|
421
|
+
perDay: number;
|
|
422
|
+
perHour: number;
|
|
423
|
+
perMinute: number;
|
|
424
|
+
perSecond: number;
|
|
425
|
+
};
|
|
426
|
+
pooledRunCount: number;
|
|
427
|
+
detail: {
|
|
428
|
+
arrivalHistogram: {
|
|
429
|
+
bins: {
|
|
430
|
+
start: string;
|
|
431
|
+
end: string;
|
|
432
|
+
count: number;
|
|
433
|
+
}[] | null;
|
|
434
|
+
neverCount: number;
|
|
435
|
+
};
|
|
436
|
+
posteriorLines: {
|
|
437
|
+
points: AppForecastPoint[] | null;
|
|
438
|
+
}[] | null;
|
|
439
|
+
};
|
|
440
|
+
};
|
|
441
|
+
export type AppForecastRun = {
|
|
442
|
+
forecastRunUuid: string;
|
|
443
|
+
projectUuid: string;
|
|
444
|
+
status: string;
|
|
445
|
+
method: string;
|
|
446
|
+
generatedAt: string;
|
|
447
|
+
inputCount: number;
|
|
448
|
+
sampleCount: number;
|
|
449
|
+
seed: number;
|
|
450
|
+
forecastFrom?: string;
|
|
451
|
+
percentiles: Record<string, string>;
|
|
452
|
+
warnings?: AppForecastWarning[] | null;
|
|
453
|
+
provenance: Record<string, string>;
|
|
454
|
+
counter?: AppForecastCounterResult;
|
|
455
|
+
};
|
|
456
|
+
export type AppForecastStorySnapshot = {
|
|
457
|
+
runUuid: string;
|
|
458
|
+
asOfAt: string;
|
|
459
|
+
generatedAt: string;
|
|
460
|
+
horizonEndAt?: string;
|
|
461
|
+
inputCount: number;
|
|
462
|
+
inputHash?: string;
|
|
463
|
+
intervalState: string;
|
|
464
|
+
method: string;
|
|
465
|
+
movement: string;
|
|
466
|
+
observedValue?: number;
|
|
467
|
+
outputProbability?: number;
|
|
468
|
+
percentiles: {
|
|
469
|
+
p10?: string;
|
|
470
|
+
p25?: string;
|
|
471
|
+
p50?: string;
|
|
472
|
+
p75?: string;
|
|
473
|
+
p90?: string;
|
|
474
|
+
};
|
|
475
|
+
sampleCount: number;
|
|
476
|
+
status: string;
|
|
477
|
+
warnings?: AppForecastWarning[] | null;
|
|
478
|
+
};
|
|
479
|
+
export type AppForecastStoryEstimate = {
|
|
480
|
+
estimatedAt: string;
|
|
481
|
+
low: string;
|
|
482
|
+
high: string;
|
|
483
|
+
note?: string;
|
|
484
|
+
widthDays: number;
|
|
485
|
+
movementDays?: number;
|
|
486
|
+
};
|
|
487
|
+
/** The story's compiled chart presentation. Its nested layers and tables are server-rendered. */
|
|
488
|
+
export type AppForecastStoryPresentation = {
|
|
489
|
+
version: number;
|
|
490
|
+
presetId: string;
|
|
491
|
+
renderer: string;
|
|
492
|
+
caption: string;
|
|
493
|
+
summary: string;
|
|
494
|
+
nonColorEncoding: string;
|
|
495
|
+
width: number;
|
|
496
|
+
height: number;
|
|
497
|
+
layers: unknown[] | null;
|
|
498
|
+
references: unknown[] | null;
|
|
499
|
+
tableColumns: unknown[] | null;
|
|
500
|
+
tableRows: unknown[] | null;
|
|
501
|
+
supportingTables?: unknown[] | null;
|
|
502
|
+
};
|
|
503
|
+
/** A linked prediction's story. Its history, outcomes and sources are passed through as served. */
|
|
504
|
+
export type AppForecastStoryPrediction = {
|
|
505
|
+
definitionUuid: string;
|
|
506
|
+
definitionKey: string;
|
|
507
|
+
displayName: string;
|
|
508
|
+
state: string;
|
|
509
|
+
qualityState: string;
|
|
510
|
+
current?: unknown;
|
|
511
|
+
evaluation?: unknown;
|
|
512
|
+
history: unknown[] | null;
|
|
513
|
+
outcomes: unknown[] | null;
|
|
514
|
+
contributions: unknown[] | null;
|
|
515
|
+
sources: unknown[] | null;
|
|
516
|
+
};
|
|
517
|
+
/** The project's measurements and forecast convergence. */
|
|
518
|
+
export type AppForecastStory = {
|
|
519
|
+
projectUuid: string;
|
|
520
|
+
projectName: string;
|
|
521
|
+
projectKind: string;
|
|
522
|
+
state: string;
|
|
523
|
+
currentSnapshotUuid?: string;
|
|
524
|
+
truncated: boolean;
|
|
525
|
+
target: {
|
|
526
|
+
available: boolean;
|
|
527
|
+
label: string;
|
|
528
|
+
value: number;
|
|
529
|
+
deadline?: string;
|
|
530
|
+
};
|
|
531
|
+
observations: {
|
|
532
|
+
observedAt: string;
|
|
533
|
+
value: number;
|
|
534
|
+
}[] | null;
|
|
535
|
+
snapshots: AppForecastStorySnapshot[] | null;
|
|
536
|
+
prediction?: AppForecastStoryPrediction;
|
|
537
|
+
delivery: {
|
|
538
|
+
targetDate?: string;
|
|
539
|
+
estimates: AppForecastStoryEstimate[] | null;
|
|
540
|
+
};
|
|
541
|
+
presentation: AppForecastStoryPresentation;
|
|
542
|
+
trust: {
|
|
543
|
+
state: string;
|
|
544
|
+
evidence: string;
|
|
545
|
+
observationCount: number;
|
|
546
|
+
snapshotCount: number;
|
|
547
|
+
};
|
|
548
|
+
provenance: {
|
|
549
|
+
owner: string;
|
|
550
|
+
generatedAt: string;
|
|
551
|
+
latestEngine?: string;
|
|
552
|
+
latestInputHash?: string;
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
/** A read with `If-None-Match`: new content and its ETag, or confirmation the last one holds. */
|
|
556
|
+
export type AppConditionalRead<T> = {
|
|
557
|
+
status: "modified";
|
|
558
|
+
data: T;
|
|
559
|
+
etag: string | null;
|
|
560
|
+
} | {
|
|
561
|
+
status: "not_modified";
|
|
562
|
+
etag: string;
|
|
563
|
+
};
|
|
564
|
+
export type AppReadOptions = {
|
|
565
|
+
/** Read an item of the presented link collection by its UUID. */
|
|
566
|
+
item?: string;
|
|
567
|
+
/** The ETag of the last read; the answer is `not_modified` while it holds. */
|
|
568
|
+
etag?: string;
|
|
569
|
+
};
|
|
570
|
+
export type AppProblem = {
|
|
571
|
+
type?: string;
|
|
572
|
+
title?: string;
|
|
573
|
+
status?: number;
|
|
574
|
+
detail?: string;
|
|
575
|
+
code?: string;
|
|
576
|
+
traceId?: string;
|
|
577
|
+
fields?: Record<string, string>;
|
|
578
|
+
retryability?: "none" | "bounded";
|
|
579
|
+
/** Per-element refusals; `subject` names the element, such as a model quantity. */
|
|
580
|
+
fieldErrors?: AppFieldError[];
|
|
581
|
+
};
|
|
582
|
+
export type AppFieldError = {
|
|
583
|
+
subject?: string;
|
|
584
|
+
field: string;
|
|
585
|
+
code: string;
|
|
586
|
+
message: string;
|
|
587
|
+
};
|
|
588
|
+
export declare class AppItemError extends Error {
|
|
589
|
+
/** HTTP status; null when no answer arrived. */
|
|
590
|
+
readonly status: number | null;
|
|
591
|
+
readonly code: string;
|
|
592
|
+
readonly problem?: AppProblem | undefined;
|
|
593
|
+
readonly name = "AppItemError";
|
|
594
|
+
constructor(
|
|
595
|
+
/** HTTP status; null when no answer arrived. */
|
|
596
|
+
status: number | null, code: string, problem?: AppProblem | undefined);
|
|
597
|
+
/** The user must sign in (again): their access token was refused, or none was sent. */
|
|
598
|
+
get signInNeeded(): boolean;
|
|
599
|
+
/** Alert email needs a verified address: the signed-in user must verify one first. */
|
|
600
|
+
get verifiedEmailNeeded(): boolean;
|
|
601
|
+
/** Retrying cannot help: the link, key or request itself was refused. */
|
|
602
|
+
get terminal(): boolean;
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* Who calls an item route: a link token (`Authorization: Bearer`), the signed-in user's access
|
|
606
|
+
* token (`X-Custd-User-Token`), or both. `send` is the one place that turns it into headers.
|
|
607
|
+
*/
|
|
608
|
+
export type AppItemCredential = {
|
|
609
|
+
linkToken?: string;
|
|
610
|
+
userToken?: string;
|
|
611
|
+
};
|
|
612
|
+
/**
|
|
613
|
+
* How a call reaches its item: a link token, or `{ item }` for an item the signed-in user owns,
|
|
614
|
+
* reached with their access token and no link.
|
|
615
|
+
*/
|
|
616
|
+
export type AppItemAccess = string | {
|
|
617
|
+
item: string;
|
|
618
|
+
};
|
|
619
|
+
export type AppItemsClientConfig = {
|
|
620
|
+
/** The API origin, as the hosted app's discovery file names it. */
|
|
621
|
+
apiBaseUrl: string;
|
|
622
|
+
/** The app's public Site key (`site_pk_...`). */
|
|
623
|
+
siteKey: string;
|
|
624
|
+
fetch?: typeof fetch;
|
|
625
|
+
/**
|
|
626
|
+
* The signed-in user's current access token, or nothing when signed out. Sent beside the link
|
|
627
|
+
* on every call; the hosted app reads it from its `BrowserSignIn`.
|
|
628
|
+
*/
|
|
629
|
+
userToken?: () => string | null | undefined;
|
|
630
|
+
/**
|
|
631
|
+
* Opens the realtime socket that pushes changes to watched reads. Defaults to the global
|
|
632
|
+
* WebSocket, unless you supplied your own `fetch`; then pass one here too. `null` keeps watched
|
|
633
|
+
* reads on polling only. Without push, or while it is down, watched reads poll as before.
|
|
634
|
+
*/
|
|
635
|
+
webSocket?: AppWebSocketFactory | null;
|
|
636
|
+
};
|
|
637
|
+
export declare class AppItemsClient {
|
|
638
|
+
private readonly baseUrl;
|
|
639
|
+
private readonly siteKey;
|
|
640
|
+
private readonly fetchImpl;
|
|
641
|
+
private readonly userToken;
|
|
642
|
+
private readonly live;
|
|
643
|
+
constructor(config: AppItemsClientConfig);
|
|
644
|
+
/** Builds the client from a hosted app's discovery file. */
|
|
645
|
+
static fromDiscovery(discovery: {
|
|
646
|
+
apiBaseUrl: string;
|
|
647
|
+
browserKey: string;
|
|
648
|
+
}, options?: Pick<AppItemsClientConfig, "fetch" | "userToken" | "webSocket">): AppItemsClient;
|
|
649
|
+
/**
|
|
650
|
+
* Creates an item with the Site key; a signed-in creator owns it at once. Keep both tokens:
|
|
651
|
+
* they are shown this once.
|
|
652
|
+
*/
|
|
653
|
+
createItem(request: AppItemCreateRequest): Promise<AppItemCreated>;
|
|
654
|
+
/** "My items": the live items the signed-in user owns in this app, most recently changed first. */
|
|
655
|
+
listMyItems(): Promise<AppItemList>;
|
|
656
|
+
/**
|
|
657
|
+
* Makes the signed-in holder of an owner link the item's owner. A repeat by the same user
|
|
658
|
+
* succeeds; an item another user owns is refused with `claimed`.
|
|
659
|
+
*/
|
|
660
|
+
/** Claims a link's item into the signed-in account; `item` names one item of a collection link. */
|
|
661
|
+
claim(ownerToken: string, item?: string): Promise<AppItemRead>;
|
|
662
|
+
readItem(access: AppItemAccess, options?: AppReadOptions): Promise<AppConditionalRead<AppItemRead>>;
|
|
663
|
+
planForecast(access: AppItemAccess, options?: Pick<AppReadOptions, "item">): Promise<AppPlanForecast>;
|
|
664
|
+
updatePlan(access: AppItemAccess, request: AppPlanUpdate): Promise<AppItemRead>;
|
|
665
|
+
updateSettings(access: AppItemAccess, request: AppItemSettingsRequest): Promise<AppItemRead>;
|
|
666
|
+
/** Records up to 1000 measurements; check each row's `success`. */
|
|
667
|
+
addMeasurements(access: AppItemAccess, request: AppMeasurementBulkRequest): Promise<AppMeasurementBulkResponse>;
|
|
668
|
+
/** Records measurements from a pasted CSV document. */
|
|
669
|
+
importMeasurementsCsv(access: AppItemAccess, csv: string): Promise<AppMeasurementBulkResponse>;
|
|
670
|
+
/** The counter project's runs, newest first. */
|
|
671
|
+
listRuns(access: AppItemAccess, options?: AppItemPageOptions): Promise<AppItemRunPage>;
|
|
672
|
+
/** Starts a new run of the counter project. Owner only. */
|
|
673
|
+
startRun(access: AppItemAccess, request: AppRunCreateRequest): Promise<AppItemRead>;
|
|
674
|
+
/** The item's recorded measurements, oldest first. */
|
|
675
|
+
listMeasurements(access: AppItemAccess, options?: AppItemMeasurementPageOptions): Promise<AppItemMeasurementPage>;
|
|
676
|
+
createEstimate(access: AppItemAccess, request: AppEstimateCreateRequest): Promise<AppProjectEstimate>;
|
|
677
|
+
complete(access: AppItemAccess, request: AppProjectCompleteRequest): Promise<AppItemRead>;
|
|
678
|
+
cancel(access: AppItemAccess): Promise<AppItemRead>;
|
|
679
|
+
reopen(access: AppItemAccess): Promise<AppItemRead>;
|
|
680
|
+
/** Adds the item a pasted link opens to a link collection. */
|
|
681
|
+
addEntry(access: AppItemAccess, request: AppLinkCollectionEntryAddRequest): Promise<AppLinkCollectionEntry>;
|
|
682
|
+
removeEntry(access: AppItemAccess, entryUuid: string): Promise<void>;
|
|
683
|
+
revokeLink(access: AppItemAccess, linkUuid: string): Promise<void>;
|
|
684
|
+
/** Replaces a link; the old token stops working. The new token is shown this once. */
|
|
685
|
+
rotateLink(access: AppItemAccess, linkUuid: string): Promise<AppItemLinkRotated>;
|
|
686
|
+
/** Runs the item's forecast. Owner link only. */
|
|
687
|
+
runForecast(access: AppItemAccess, request?: AppForecastRunRequest): Promise<AppForecastRun>;
|
|
688
|
+
/** The newest forecast run; a `forecastMissing` AppItemError until one exists. */
|
|
689
|
+
latestForecast(access: AppItemAccess, options?: AppReadOptions): Promise<AppConditionalRead<AppForecastRun>>;
|
|
690
|
+
forecastRun(access: AppItemAccess, runUuid: string, options?: AppReadOptions): Promise<AppConditionalRead<AppForecastRun>>;
|
|
691
|
+
forecastStory(access: AppItemAccess, options?: AppReadOptions): Promise<AppConditionalRead<AppForecastStory>>;
|
|
692
|
+
/** Saves a new immutable version of the item's model: the whole quantity list. Owner link only. */
|
|
693
|
+
addModelVersion(access: AppItemAccess, request: AppModelVersionCreateRequest): Promise<AppItemRead>;
|
|
694
|
+
/** Copies a version into a new model item with its own two links, each token shown this once. */
|
|
695
|
+
copyModel(access: AppItemAccess, request?: AppModelCopyRequest): Promise<AppItemCreated>;
|
|
696
|
+
/** Runs the item's model and stores the run, which becomes every viewer's latest. Owner link only. */
|
|
697
|
+
runModel(access: AppItemAccess, request: AppModelRunRequest): Promise<AppModelRun>;
|
|
698
|
+
/** Runs a version with some inputs set to other values and returns only `outputs`. Any link; never stored. */
|
|
699
|
+
calculateModel(access: AppItemAccess, request: AppModelCalculateRequest): Promise<AppModelCalculateResult>;
|
|
700
|
+
/** The newest model run; a `runMissing` AppItemError until one exists. */
|
|
701
|
+
latestModelRun(access: AppItemAccess, options?: AppReadOptions): Promise<AppConditionalRead<AppModelRun>>;
|
|
702
|
+
/** The item's alert rules, webhooks and the signed-in caller's email subscription. Owner only. */
|
|
703
|
+
alertSettings(access: AppItemAccess): Promise<AppAlertSettings>;
|
|
704
|
+
/** The item's newest alert deliveries, at most 100. Owner only. */
|
|
705
|
+
alertDeliveries(access: AppItemAccess): Promise<AppAlertDeliveryList>;
|
|
706
|
+
/** Adds a rule that fires once each time its condition becomes true. At most 10 per item. */
|
|
707
|
+
addAlertRule(access: AppItemAccess, rule: AppAlertRuleSpec): Promise<AppAlertRule>;
|
|
708
|
+
/** Removes a rule and its delivery history. */
|
|
709
|
+
removeAlertRule(access: AppItemAccess, ruleUuid: string): Promise<void>;
|
|
710
|
+
/** Registers a signed webhook. Its `signingSecret` is shown this once. At most 5 per item. */
|
|
711
|
+
addAlertWebhook(access: AppItemAccess, request: AppAlertWebhookCreateRequest): Promise<AppAlertWebhookCreated>;
|
|
712
|
+
/**
|
|
713
|
+
* Posts the item's alerts to a Slack incoming webhook as Slack messages. The URL is checked,
|
|
714
|
+
* stored sealed and never returned; it counts against the 5 webhooks per item.
|
|
715
|
+
*/
|
|
716
|
+
addAlertSlack(access: AppItemAccess, request: AppAlertSlackCreateRequest): Promise<AppAlertWebhook>;
|
|
717
|
+
/** Removes a webhook or Slack destination; its undelivered alerts go with it. */
|
|
718
|
+
removeAlertWebhook(access: AppItemAccess, webhookUuid: string): Promise<void>;
|
|
719
|
+
/**
|
|
720
|
+
* Emails the signed-in user's verified address when a rule fires; repeating it keeps one
|
|
721
|
+
* subscription. Refused with `app_sign_in_required` when signed out, `verifiedEmailNeeded` when
|
|
722
|
+
* the user has no verified address, and a retryable `emailCheckUnavailable`.
|
|
723
|
+
*/
|
|
724
|
+
subscribeAlertEmail(access: AppItemAccess): Promise<AppAlertSubscription>;
|
|
725
|
+
/** Stops the signed-in user's alert email. Repeating it succeeds. */
|
|
726
|
+
unsubscribeAlertEmail(access: AppItemAccess): Promise<void>;
|
|
727
|
+
/** The confirmation page an alert email's unsubscribe link opens, as HTML. It changes nothing. */
|
|
728
|
+
getAlertUnsubscribePage(token: string): Promise<string>;
|
|
729
|
+
/** Stops the alert email an unsubscribe link names; it needs no sign-in. Repeating it succeeds. */
|
|
730
|
+
unsubscribeAlertEmailByToken(request: AppAlertUnsubscribeRequest): Promise<void>;
|
|
731
|
+
/** Starts the meeting item's first block. Owner only. */
|
|
732
|
+
updateMeetingMinutes(access: AppItemAccess, request: AppMeetingMinutesUpdate): Promise<AppItemRead>;
|
|
733
|
+
startMeeting(access: AppItemAccess): Promise<AppItemRead>;
|
|
734
|
+
/**
|
|
735
|
+
* Finishes the block `blockUuid` names (the meeting's `currentBlockUuid`) and puts the next one
|
|
736
|
+
* on. Repeating the advance of the block that just finished returns the meeting unchanged; any
|
|
737
|
+
* other block is refused with a 409 `stepRefused`, after which watched reads poll at once.
|
|
738
|
+
*/
|
|
739
|
+
advanceMeeting(access: AppItemAccess, request: AppMeetingAdvanceRequest): Promise<AppItemRead>;
|
|
740
|
+
/** Ends the meeting now; blocks not reached are recorded as `not_run`. */
|
|
741
|
+
endMeeting(access: AppItemAccess): Promise<AppItemRead>;
|
|
742
|
+
/** A self-refreshing latest model run; `empty` until the first run exists. */
|
|
743
|
+
watchLatestModelRun(access: AppItemAccess, options?: AppLiveWatchOptions): AppLiveWatch<AppModelRun>;
|
|
744
|
+
/** A self-refreshing item read, shared by every caller watching the same item and link. */
|
|
745
|
+
watchItem(access: AppItemAccess, options?: AppLiveWatchOptions): AppLiveWatch<AppItemRead>;
|
|
746
|
+
/** A self-refreshing latest forecast; `empty` until the first run exists. */
|
|
747
|
+
watchLatestForecast(access: AppItemAccess, options?: AppLiveWatchOptions): AppLiveWatch<AppForecastRun>;
|
|
748
|
+
/** A self-refreshing forecast story. */
|
|
749
|
+
watchForecastStory(access: AppItemAccess, options?: AppLiveWatchOptions): AppLiveWatch<AppForecastStory>;
|
|
750
|
+
/** Polls every watched read now, for example after the signed-in user changed. */
|
|
751
|
+
refreshAll(): void;
|
|
752
|
+
private liveKey;
|
|
753
|
+
/** What a watched read subscribes with: its link, or the signed-in user's own item. */
|
|
754
|
+
private pushTarget;
|
|
755
|
+
/** The link or user-owned item a call reaches, with the signed-in user when there is one. */
|
|
756
|
+
private reach;
|
|
757
|
+
private signedIn;
|
|
758
|
+
private write;
|
|
759
|
+
private meetingStep;
|
|
760
|
+
private conditional;
|
|
761
|
+
private page;
|
|
762
|
+
private json;
|
|
763
|
+
private send;
|
|
764
|
+
}
|
|
765
|
+
export type AppItemLinkParts = {
|
|
766
|
+
/** The app's host, such as `counter.apps.custd.com`. */
|
|
767
|
+
host: string;
|
|
768
|
+
/** The page path of the item's kind, such as `c` for a counter. */
|
|
769
|
+
kindPath: string;
|
|
770
|
+
token: string;
|
|
771
|
+
};
|
|
772
|
+
/**
|
|
773
|
+
* The owner page: the token sits in the fragment, which browsers never send to a server, so no
|
|
774
|
+
* request log or page view records it.
|
|
775
|
+
*/
|
|
776
|
+
export declare function appItemOwnerUrl(parts: AppItemLinkParts): string;
|
|
777
|
+
/** The read-only share page. A share token may sit in the path because it only reads. */
|
|
778
|
+
export declare function appItemShareUrl(parts: AppItemLinkParts): string;
|
|
779
|
+
export type ParsedAppItemLink = {
|
|
780
|
+
token: string;
|
|
781
|
+
/** Known from the URL shape; absent for a bare token. */
|
|
782
|
+
role?: AppLinkRole;
|
|
783
|
+
kindPath?: string;
|
|
784
|
+
};
|
|
785
|
+
/** Reads a pasted owner URL, share URL or bare token. Returns null when it holds no link token. */
|
|
786
|
+
export declare function parseAppItemLink(input: string): ParsedAppItemLink | null;
|