@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
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accounting evidence: the purchases, balances and corrections a tenant records against a metered
|
|
3
|
+
* quantity. A correction supersedes or targets an earlier record instead of editing it.
|
|
4
|
+
*/
|
|
5
|
+
import type { RequestOptions } from "./index.js";
|
|
6
|
+
export type AccountingEvidenceKind = "purchase" | "balance" | "correction";
|
|
7
|
+
/** UCUM unit codes the evidence quantities accept. */
|
|
8
|
+
export type AccountingEvidenceUnit = "W" | "kW" | "Wh" | "kWh" | "V" | "A" | "L" | "Cel" | "By" | "1";
|
|
9
|
+
type AccountingEvidenceFields = {
|
|
10
|
+
id: string;
|
|
11
|
+
kind: AccountingEvidenceKind;
|
|
12
|
+
unit: AccountingEvidenceUnit;
|
|
13
|
+
effectiveAt: string;
|
|
14
|
+
observedAt: string;
|
|
15
|
+
reason: string;
|
|
16
|
+
auditCorrelationId: string;
|
|
17
|
+
quantity?: number;
|
|
18
|
+
balance?: number;
|
|
19
|
+
delta?: number;
|
|
20
|
+
supersedesId?: string;
|
|
21
|
+
targetId?: string;
|
|
22
|
+
targetKind?: AccountingEvidenceKind;
|
|
23
|
+
};
|
|
24
|
+
export type AccountingEvidenceCreateRequest = AccountingEvidenceFields;
|
|
25
|
+
/** One recorded evidence item, with the tenant and actor the server attributed it to. */
|
|
26
|
+
export type AccountingEvidence = AccountingEvidenceFields & {
|
|
27
|
+
tenantKey: string;
|
|
28
|
+
actor: string;
|
|
29
|
+
};
|
|
30
|
+
export type AccountingEvidenceListResponse = {
|
|
31
|
+
evidence: AccountingEvidence[];
|
|
32
|
+
};
|
|
33
|
+
export type AccountingEvidenceResponse = {
|
|
34
|
+
evidence: AccountingEvidence;
|
|
35
|
+
};
|
|
36
|
+
/** `asOf` reads the evidence as it stood at an RFC3339 instant. */
|
|
37
|
+
export type AccountingEvidenceListQuery = {
|
|
38
|
+
asOf?: string;
|
|
39
|
+
limit?: number;
|
|
40
|
+
};
|
|
41
|
+
type AdminRequester = <T>(method: string, path: string, body?: unknown, options?: RequestOptions) => Promise<T>;
|
|
42
|
+
export declare class AccountingEvidenceAdminClient {
|
|
43
|
+
private readonly request;
|
|
44
|
+
constructor(request: AdminRequester);
|
|
45
|
+
list(query?: AccountingEvidenceListQuery, options?: RequestOptions): Promise<AccountingEvidenceListResponse>;
|
|
46
|
+
create(body: AccountingEvidenceCreateRequest, options?: RequestOptions): Promise<AccountingEvidenceResponse>;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accounting evidence: the purchases, balances and corrections a tenant records against a metered
|
|
3
|
+
* quantity. A correction supersedes or targets an earlier record instead of editing it.
|
|
4
|
+
*/
|
|
5
|
+
const evidencePath = "/accounting/evidence";
|
|
6
|
+
export class AccountingEvidenceAdminClient {
|
|
7
|
+
constructor(request) {
|
|
8
|
+
this.request = request;
|
|
9
|
+
}
|
|
10
|
+
async list(query = {}, options) {
|
|
11
|
+
const params = new URLSearchParams();
|
|
12
|
+
if (query.asOf !== undefined)
|
|
13
|
+
params.set("asOf", query.asOf);
|
|
14
|
+
if (query.limit !== undefined)
|
|
15
|
+
params.set("limit", String(query.limit));
|
|
16
|
+
const encoded = params.toString();
|
|
17
|
+
const path = encoded ? `${evidencePath}?${encoded}` : evidencePath;
|
|
18
|
+
const list = await this.request("GET", path, undefined, options);
|
|
19
|
+
return { evidence: list.evidence ?? [] };
|
|
20
|
+
}
|
|
21
|
+
create(body, options) {
|
|
22
|
+
return this.request("POST", evidencePath, body, options);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A hosted environment's releases. A release is created from its manifest,
|
|
3
|
+
* each listed file is uploaded as raw bytes, the release is verified once every
|
|
4
|
+
* file reads back intact, and a verified release is promoted to the
|
|
5
|
+
* environment's host. The environment must have hosting enabled in its desired
|
|
6
|
+
* state. The operations live on `admin.authProjects`.
|
|
7
|
+
*/
|
|
8
|
+
/** A pending release accepts uploads; a verified release accepts none and can be promoted. */
|
|
9
|
+
export type AppReleaseState = "pending" | "verified";
|
|
10
|
+
/** The caching a cache rule applies to the files it matches. */
|
|
11
|
+
export type AppReleaseCacheMode = "immutable" | "revalidate" | "short" | "no-store";
|
|
12
|
+
/** Who may frame the routes a header rule matches. */
|
|
13
|
+
export type AppReleaseFramingMode = "deny" | "same-origin" | "any";
|
|
14
|
+
/** One manifest file. `sha256` is the lowercase hex digest of the bytes the upload must carry. */
|
|
15
|
+
export type AppReleaseFile = {
|
|
16
|
+
path: string;
|
|
17
|
+
size: number;
|
|
18
|
+
sha256: string;
|
|
19
|
+
contentType: string;
|
|
20
|
+
};
|
|
21
|
+
/** Serves `file` for any path under `prefix` that names no file. */
|
|
22
|
+
export type AppReleaseSpaFallback = {
|
|
23
|
+
prefix: string;
|
|
24
|
+
file: string;
|
|
25
|
+
};
|
|
26
|
+
/** One extra response header. */
|
|
27
|
+
export type AppReleaseResponseHeader = {
|
|
28
|
+
name: string;
|
|
29
|
+
value: string;
|
|
30
|
+
};
|
|
31
|
+
/** Sets framing and extra response headers on a route. */
|
|
32
|
+
export type AppReleaseHeaderRule = {
|
|
33
|
+
route: string;
|
|
34
|
+
framing?: AppReleaseFramingMode;
|
|
35
|
+
headers?: AppReleaseResponseHeader[];
|
|
36
|
+
};
|
|
37
|
+
/** Applies a cache mode to the files `match` selects. */
|
|
38
|
+
export type AppReleaseCacheRule = {
|
|
39
|
+
match: string;
|
|
40
|
+
mode: AppReleaseCacheMode;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* A route the host serves with share previews. `route` has exactly one `*` segment, which carries the
|
|
44
|
+
* share token; `kind` is the item kind the link must open. `title` and `description` may use
|
|
45
|
+
* `{{field}}` placeholders, and `cardTemplate` names the release file the card renders from.
|
|
46
|
+
*/
|
|
47
|
+
export type AppReleaseShareableRoute = {
|
|
48
|
+
route: string;
|
|
49
|
+
kind: string;
|
|
50
|
+
cardTemplate: string;
|
|
51
|
+
title: string;
|
|
52
|
+
description?: string;
|
|
53
|
+
};
|
|
54
|
+
/** The app's own share card, required whenever the release declares shareable routes. */
|
|
55
|
+
export type AppReleaseSiteCard = {
|
|
56
|
+
title: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
cardTemplate: string;
|
|
59
|
+
};
|
|
60
|
+
/** How the host serves the release. `indexFile` defaults to `index.html` on the server. */
|
|
61
|
+
export type AppReleaseRouting = {
|
|
62
|
+
indexFile?: string;
|
|
63
|
+
notFoundPage?: string;
|
|
64
|
+
spaFallbacks?: AppReleaseSpaFallback[];
|
|
65
|
+
headers?: AppReleaseHeaderRule[];
|
|
66
|
+
cache?: AppReleaseCacheRule[];
|
|
67
|
+
shareableRoutes?: AppReleaseShareableRoute[];
|
|
68
|
+
siteCard?: AppReleaseSiteCard;
|
|
69
|
+
};
|
|
70
|
+
/** A new release's files and routing. The server assigns the identifier and creation time. */
|
|
71
|
+
export type AppReleaseCreateRequest = {
|
|
72
|
+
files: AppReleaseFile[];
|
|
73
|
+
routing: AppReleaseRouting;
|
|
74
|
+
/** A short human label for the release. */
|
|
75
|
+
label?: string;
|
|
76
|
+
};
|
|
77
|
+
/** The stored manifest of one release. */
|
|
78
|
+
export type AppReleaseManifest = {
|
|
79
|
+
version: number;
|
|
80
|
+
releaseId: string;
|
|
81
|
+
createdAt: string;
|
|
82
|
+
files: AppReleaseFile[];
|
|
83
|
+
routing: AppReleaseRouting;
|
|
84
|
+
};
|
|
85
|
+
/** One release in a list, without its file manifest. */
|
|
86
|
+
export type AppReleaseSummary = {
|
|
87
|
+
releaseId: string;
|
|
88
|
+
state: AppReleaseState;
|
|
89
|
+
active: boolean;
|
|
90
|
+
label?: string;
|
|
91
|
+
fileCount: number;
|
|
92
|
+
totalBytes: number;
|
|
93
|
+
createdAt: string;
|
|
94
|
+
verifiedAt?: string;
|
|
95
|
+
};
|
|
96
|
+
/** One stored release with its manifest. */
|
|
97
|
+
export type AppRelease = AppReleaseSummary & {
|
|
98
|
+
manifest: AppReleaseManifest;
|
|
99
|
+
};
|
|
100
|
+
/** An environment's most recent releases, newest first. */
|
|
101
|
+
export type AppReleaseList = {
|
|
102
|
+
releases: AppReleaseSummary[];
|
|
103
|
+
};
|
|
104
|
+
/** The receipt for one stored release file. */
|
|
105
|
+
export type AppReleaseUploadedFile = {
|
|
106
|
+
path: string;
|
|
107
|
+
size: number;
|
|
108
|
+
sha256: string;
|
|
109
|
+
};
|
|
110
|
+
/** The receipt for one promotion. `previousReleaseId` is absent when nothing was served before. */
|
|
111
|
+
export type AppReleasePromotion = {
|
|
112
|
+
releaseId: string;
|
|
113
|
+
host: string;
|
|
114
|
+
previousReleaseId?: string;
|
|
115
|
+
promotedAt: string;
|
|
116
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A hosted environment's releases. A release is created from its manifest,
|
|
3
|
+
* each listed file is uploaded as raw bytes, the release is verified once every
|
|
4
|
+
* file reads back intact, and a verified release is promoted to the
|
|
5
|
+
* environment's host. The environment must have hosting enabled in its desired
|
|
6
|
+
* state. The operations live on `admin.authProjects`.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apps: a hosted application served at `<slug>.<apps domain>`, made of an auth
|
|
3
|
+
* project whose production environment is hosted. An app is addressed by its
|
|
4
|
+
* slug, which comes from its name; one the caller cannot see answers
|
|
5
|
+
* `app_not_found`, exactly like one that does not exist. Releases are deployed
|
|
6
|
+
* through the environment's release routes. The operations live on
|
|
7
|
+
* `admin.authProjects`.
|
|
8
|
+
*/
|
|
9
|
+
import type { AppReleaseSummary } from "./admin-app-releases.js";
|
|
10
|
+
/** An app's one status. A list shows the worst first. */
|
|
11
|
+
export declare const APP_STATUSES: {
|
|
12
|
+
readonly needsAttention: "needs_attention";
|
|
13
|
+
readonly removalUnfinished: "removal_unfinished";
|
|
14
|
+
readonly live: "live";
|
|
15
|
+
readonly notDeployed: "not_deployed";
|
|
16
|
+
readonly paused: "paused";
|
|
17
|
+
readonly offboarded: "offboarded";
|
|
18
|
+
};
|
|
19
|
+
export type AppStatus = (typeof APP_STATUSES)[keyof typeof APP_STATUSES];
|
|
20
|
+
/** Why an app needs attention. The set is closed. */
|
|
21
|
+
export declare const APP_REASON_CODES: {
|
|
22
|
+
readonly siteRegistrationIncomplete: "site_registration_incomplete";
|
|
23
|
+
readonly signInNotReady: "sign_in_not_ready";
|
|
24
|
+
};
|
|
25
|
+
export type AppReasonCode = (typeof APP_REASON_CODES)[keyof typeof APP_REASON_CODES];
|
|
26
|
+
/** Problem codes the app routes answer with. */
|
|
27
|
+
export declare const APP_ERROR_CODES: {
|
|
28
|
+
readonly notFound: "app_not_found";
|
|
29
|
+
readonly nameTaken: "app_name_taken";
|
|
30
|
+
readonly nameInvalid: "app_name_invalid";
|
|
31
|
+
/** Repeat the same body and Idempotency-Key to finish the create. */
|
|
32
|
+
readonly setupIncomplete: "app_setup_incomplete";
|
|
33
|
+
/** Repeat the same pause or resume with the same Idempotency-Key to finish it. */
|
|
34
|
+
readonly hostingIncomplete: "app_hosting_incomplete";
|
|
35
|
+
/** Repeat the same repair with the same Idempotency-Key to finish it. */
|
|
36
|
+
readonly repairIncomplete: "app_repair_incomplete";
|
|
37
|
+
readonly signInModeInvalid: "app_sign_in_mode_invalid";
|
|
38
|
+
/** Resume the app before changing its sign-in. */
|
|
39
|
+
readonly signInHostingOff: "app_sign_in_hosting_off";
|
|
40
|
+
readonly signInApplyPending: "app_sign_in_apply_pending";
|
|
41
|
+
};
|
|
42
|
+
/** Whether a created app's traffic reports are published. */
|
|
43
|
+
export type AppTrafficReporting = "ready" | "unavailable";
|
|
44
|
+
/** A new app: its name, from which the address is derived, and whether people sign in (invite-only). */
|
|
45
|
+
export type AppCreateRequest = {
|
|
46
|
+
name: string;
|
|
47
|
+
signIn?: boolean;
|
|
48
|
+
};
|
|
49
|
+
export type AppReason = {
|
|
50
|
+
code: AppReasonCode;
|
|
51
|
+
message: string;
|
|
52
|
+
};
|
|
53
|
+
/** One app as the list shows it. */
|
|
54
|
+
export type AppSummary = {
|
|
55
|
+
appId: string;
|
|
56
|
+
slug: string;
|
|
57
|
+
name: string;
|
|
58
|
+
environmentId: string;
|
|
59
|
+
host: string;
|
|
60
|
+
url: string;
|
|
61
|
+
siteUuid?: string;
|
|
62
|
+
status: AppStatus;
|
|
63
|
+
reason?: AppReason;
|
|
64
|
+
signIn: boolean;
|
|
65
|
+
activeReleaseId?: string;
|
|
66
|
+
servingSince?: string;
|
|
67
|
+
};
|
|
68
|
+
/** The receipt for one create. `replayed` is true when the same Idempotency-Key had already created it. */
|
|
69
|
+
export type AppCreation = {
|
|
70
|
+
app: AppSummary;
|
|
71
|
+
replayed: boolean;
|
|
72
|
+
trafficReporting: AppTrafficReporting;
|
|
73
|
+
};
|
|
74
|
+
/** One page of the caller's apps, worst status first. Pass `nextAfter` as the next call's `after`. */
|
|
75
|
+
export type AppListResponse = {
|
|
76
|
+
apps: AppSummary[] | null;
|
|
77
|
+
nextAfter?: string;
|
|
78
|
+
};
|
|
79
|
+
/** One app with its latest release, how many releases it keeps and its live owner and share links. */
|
|
80
|
+
export type AppOverview = {
|
|
81
|
+
app: AppSummary;
|
|
82
|
+
latestRelease?: AppReleaseSummary;
|
|
83
|
+
releaseCount: number;
|
|
84
|
+
ownerLinks: number;
|
|
85
|
+
shareLinks: number;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* A CI credential holding `apps.releases.write` that reaches only this app's release routes and
|
|
89
|
+
* its read. The secret is in this response only: hand it to the caller's secret store.
|
|
90
|
+
*/
|
|
91
|
+
export type AppDeployCredential = {
|
|
92
|
+
clientId: string;
|
|
93
|
+
clientSecret: string;
|
|
94
|
+
app: string;
|
|
95
|
+
scope: string;
|
|
96
|
+
};
|
|
97
|
+
/** One deploy credential as the list shows it. Its secret was shown only when it was created. */
|
|
98
|
+
export type AppDeployCredentialSummary = {
|
|
99
|
+
clientId: string;
|
|
100
|
+
createdAt: string;
|
|
101
|
+
};
|
|
102
|
+
export type AppDeployCredentialList = {
|
|
103
|
+
credentials: AppDeployCredentialSummary[];
|
|
104
|
+
};
|
|
105
|
+
/** Who may sign in to an app. */
|
|
106
|
+
export declare const APP_SIGN_IN_MODES: {
|
|
107
|
+
readonly off: "off";
|
|
108
|
+
readonly inviteOnly: "invite_only";
|
|
109
|
+
readonly open: "open";
|
|
110
|
+
};
|
|
111
|
+
export type AppSignInMode = (typeof APP_SIGN_IN_MODES)[keyof typeof APP_SIGN_IN_MODES];
|
|
112
|
+
/**
|
|
113
|
+
* A sign-in change, made against the environment revision Auth Project Status reports. Off pauses
|
|
114
|
+
* login and keeps accounts and the directory; turning it on provisions the directory if needed.
|
|
115
|
+
*/
|
|
116
|
+
export type AppSignInRequest = {
|
|
117
|
+
mode: AppSignInMode;
|
|
118
|
+
expectedRevision: number;
|
|
119
|
+
};
|
|
120
|
+
export declare function appPath(slug: string): string;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apps: a hosted application served at `<slug>.<apps domain>`, made of an auth
|
|
3
|
+
* project whose production environment is hosted. An app is addressed by its
|
|
4
|
+
* slug, which comes from its name; one the caller cannot see answers
|
|
5
|
+
* `app_not_found`, exactly like one that does not exist. Releases are deployed
|
|
6
|
+
* through the environment's release routes. The operations live on
|
|
7
|
+
* `admin.authProjects`.
|
|
8
|
+
*/
|
|
9
|
+
/** An app's one status. A list shows the worst first. */
|
|
10
|
+
export const APP_STATUSES = {
|
|
11
|
+
needsAttention: "needs_attention",
|
|
12
|
+
removalUnfinished: "removal_unfinished",
|
|
13
|
+
live: "live",
|
|
14
|
+
notDeployed: "not_deployed",
|
|
15
|
+
paused: "paused",
|
|
16
|
+
offboarded: "offboarded",
|
|
17
|
+
};
|
|
18
|
+
/** Why an app needs attention. The set is closed. */
|
|
19
|
+
export const APP_REASON_CODES = {
|
|
20
|
+
siteRegistrationIncomplete: "site_registration_incomplete",
|
|
21
|
+
signInNotReady: "sign_in_not_ready",
|
|
22
|
+
};
|
|
23
|
+
/** Problem codes the app routes answer with. */
|
|
24
|
+
export const APP_ERROR_CODES = {
|
|
25
|
+
notFound: "app_not_found",
|
|
26
|
+
nameTaken: "app_name_taken",
|
|
27
|
+
nameInvalid: "app_name_invalid",
|
|
28
|
+
/** Repeat the same body and Idempotency-Key to finish the create. */
|
|
29
|
+
setupIncomplete: "app_setup_incomplete",
|
|
30
|
+
/** Repeat the same pause or resume with the same Idempotency-Key to finish it. */
|
|
31
|
+
hostingIncomplete: "app_hosting_incomplete",
|
|
32
|
+
/** Repeat the same repair with the same Idempotency-Key to finish it. */
|
|
33
|
+
repairIncomplete: "app_repair_incomplete",
|
|
34
|
+
signInModeInvalid: "app_sign_in_mode_invalid",
|
|
35
|
+
/** Resume the app before changing its sign-in. */
|
|
36
|
+
signInHostingOff: "app_sign_in_hosting_off",
|
|
37
|
+
signInApplyPending: "app_sign_in_apply_pending",
|
|
38
|
+
};
|
|
39
|
+
/** Who may sign in to an app. */
|
|
40
|
+
export const APP_SIGN_IN_MODES = {
|
|
41
|
+
off: "off",
|
|
42
|
+
inviteOnly: "invite_only",
|
|
43
|
+
open: "open",
|
|
44
|
+
};
|
|
45
|
+
export function appPath(slug) {
|
|
46
|
+
return `/apps/${encodeURIComponent(slug)}`;
|
|
47
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { AppItemKind, AppLinkRole } from "./app-items.js";
|
|
2
|
+
/** Where an environment's authentication hostname is in its activation. */
|
|
3
|
+
export declare const AUTH_PROJECT_DOMAIN_STATUSES: {
|
|
4
|
+
readonly pending: "pending";
|
|
5
|
+
readonly active: "active";
|
|
6
|
+
readonly proofWithdrawn: "proof-withdrawn";
|
|
7
|
+
readonly disabled: "disabled";
|
|
8
|
+
readonly releasing: "releasing";
|
|
9
|
+
};
|
|
10
|
+
export type AuthProjectDomainStatus = (typeof AUTH_PROJECT_DOMAIN_STATUSES)[keyof typeof AUTH_PROJECT_DOMAIN_STATUSES];
|
|
11
|
+
/** Whether the realm holds installed capacity. */
|
|
12
|
+
export declare const AUTH_PROJECT_DOMAIN_LIFECYCLES: {
|
|
13
|
+
readonly unclaimed: "unclaimed";
|
|
14
|
+
readonly admitted: "admitted";
|
|
15
|
+
readonly paused: "paused";
|
|
16
|
+
readonly retiring: "retiring";
|
|
17
|
+
readonly retired: "retired";
|
|
18
|
+
};
|
|
19
|
+
export type AuthProjectDomainLifecycle = (typeof AUTH_PROJECT_DOMAIN_LIFECYCLES)[keyof typeof AUTH_PROJECT_DOMAIN_LIFECYCLES];
|
|
20
|
+
/** Whether the realm runs the images it is expected to. */
|
|
21
|
+
export declare const AUTH_PROJECT_DOMAIN_CONVERGENCES: {
|
|
22
|
+
readonly converged: "converged";
|
|
23
|
+
readonly drifted: "drifted";
|
|
24
|
+
readonly notRunning: "not-running";
|
|
25
|
+
readonly unverified: "unverified";
|
|
26
|
+
readonly rollingOut: "rolling-out";
|
|
27
|
+
};
|
|
28
|
+
export type AuthProjectDomainConvergence = (typeof AUTH_PROJECT_DOMAIN_CONVERGENCES)[keyof typeof AUTH_PROJECT_DOMAIN_CONVERGENCES];
|
|
29
|
+
/** Where the realm's expected image identity comes from. */
|
|
30
|
+
export declare const AUTH_PROJECT_DOMAIN_IMAGE_SOURCES: {
|
|
31
|
+
readonly releaseDefault: "release-default";
|
|
32
|
+
readonly override: "override";
|
|
33
|
+
readonly undeclared: "undeclared";
|
|
34
|
+
};
|
|
35
|
+
export type AuthProjectDomainImageSource = (typeof AUTH_PROJECT_DOMAIN_IMAGE_SOURCES)[keyof typeof AUTH_PROJECT_DOMAIN_IMAGE_SOURCES];
|
|
36
|
+
/** The realm workload an incident image override pins. */
|
|
37
|
+
export declare const AUTH_PROJECT_DOMAIN_IMAGE_COMPONENTS: {
|
|
38
|
+
readonly gateway: "gateway";
|
|
39
|
+
readonly hydra: "hydra";
|
|
40
|
+
};
|
|
41
|
+
export type AuthProjectDomainImageComponent = (typeof AUTH_PROJECT_DOMAIN_IMAGE_COMPONENTS)[keyof typeof AUTH_PROJECT_DOMAIN_IMAGE_COMPONENTS];
|
|
42
|
+
/** Reserve a verified Site domain's hostname for the environment. */
|
|
43
|
+
export type AuthProjectDomainBindRequest = {
|
|
44
|
+
siteDomainId: string;
|
|
45
|
+
host: string;
|
|
46
|
+
};
|
|
47
|
+
/** Reserve a platform-generated issuer hostname, attested by a Site domain. Operators only. */
|
|
48
|
+
export type AuthProjectDomainMintRequest = {
|
|
49
|
+
siteDomainId: string;
|
|
50
|
+
};
|
|
51
|
+
/** Pin one realm component to an exact image until expiresAt, for an incident. */
|
|
52
|
+
export type AuthProjectDomainImageOverrideRequest = {
|
|
53
|
+
component: AuthProjectDomainImageComponent;
|
|
54
|
+
imageDigest: string;
|
|
55
|
+
incidentReference: string;
|
|
56
|
+
expiresAt: string;
|
|
57
|
+
};
|
|
58
|
+
export type AuthProjectDomainImageSet = {
|
|
59
|
+
gateway?: string;
|
|
60
|
+
hydra?: string;
|
|
61
|
+
};
|
|
62
|
+
/** The realm's active or last incident image override. */
|
|
63
|
+
export type AuthProjectDomainImageOverride = {
|
|
64
|
+
component: AuthProjectDomainImageComponent;
|
|
65
|
+
imageDigest: string;
|
|
66
|
+
incidentReference: string;
|
|
67
|
+
actorKind: string;
|
|
68
|
+
actorSubject?: string;
|
|
69
|
+
receiptId: string;
|
|
70
|
+
state: string;
|
|
71
|
+
setAt: string;
|
|
72
|
+
expiresAt: string;
|
|
73
|
+
endedAt?: string;
|
|
74
|
+
endedBy?: string;
|
|
75
|
+
};
|
|
76
|
+
export type AuthProjectDomainImages = {
|
|
77
|
+
expected: AuthProjectDomainImageSet;
|
|
78
|
+
running: AuthProjectDomainImageSet;
|
|
79
|
+
source: AuthProjectDomainImageSource;
|
|
80
|
+
convergence: AuthProjectDomainConvergence;
|
|
81
|
+
override?: AuthProjectDomainImageOverride;
|
|
82
|
+
};
|
|
83
|
+
/** The TXT record that proves the hostname. */
|
|
84
|
+
export type AuthProjectDomainDNSProof = {
|
|
85
|
+
recordName: string;
|
|
86
|
+
recordValue: string;
|
|
87
|
+
};
|
|
88
|
+
/** An environment's authentication hostname, its state and the DNS records it needs. */
|
|
89
|
+
export type AuthProjectDomainBinding = {
|
|
90
|
+
environmentId: string;
|
|
91
|
+
slotRef?: string;
|
|
92
|
+
siteDomainId?: string;
|
|
93
|
+
host: string;
|
|
94
|
+
issuer: string;
|
|
95
|
+
status: AuthProjectDomainStatus;
|
|
96
|
+
lifecycle: AuthProjectDomainLifecycle;
|
|
97
|
+
intentRevision: number;
|
|
98
|
+
images: AuthProjectDomainImages;
|
|
99
|
+
dnsTarget?: string;
|
|
100
|
+
dnsProof?: AuthProjectDomainDNSProof;
|
|
101
|
+
createdAt: string;
|
|
102
|
+
observedAt?: string;
|
|
103
|
+
certificateExpiresAt?: string;
|
|
104
|
+
};
|
|
105
|
+
/** The realm's stored brand logo. */
|
|
106
|
+
export type AuthProjectBrandLogo = {
|
|
107
|
+
contentType: string;
|
|
108
|
+
updatedAt: string;
|
|
109
|
+
byteSize: number;
|
|
110
|
+
width: number;
|
|
111
|
+
height: number;
|
|
112
|
+
};
|
|
113
|
+
/** One owner or share link to an app item in the environment. */
|
|
114
|
+
export type AuthProjectAppLink = {
|
|
115
|
+
linkUuid: string;
|
|
116
|
+
itemUuid: string;
|
|
117
|
+
kind: AppItemKind;
|
|
118
|
+
role: AppLinkRole;
|
|
119
|
+
createdAt: string;
|
|
120
|
+
/** When the item expires unless it changes; its links stop working then. */
|
|
121
|
+
itemExpiresAt: string;
|
|
122
|
+
};
|
|
123
|
+
export type AuthProjectAppLinkList = {
|
|
124
|
+
links: AuthProjectAppLink[];
|
|
125
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Types for an auth-project environment's authentication domain, its realm brand logo and its
|
|
2
|
+
// app item links. The operations live on `admin.authProjects`.
|
|
3
|
+
/** Where an environment's authentication hostname is in its activation. */
|
|
4
|
+
export const AUTH_PROJECT_DOMAIN_STATUSES = {
|
|
5
|
+
pending: "pending",
|
|
6
|
+
active: "active",
|
|
7
|
+
proofWithdrawn: "proof-withdrawn",
|
|
8
|
+
disabled: "disabled",
|
|
9
|
+
releasing: "releasing",
|
|
10
|
+
};
|
|
11
|
+
/** Whether the realm holds installed capacity. */
|
|
12
|
+
export const AUTH_PROJECT_DOMAIN_LIFECYCLES = {
|
|
13
|
+
unclaimed: "unclaimed",
|
|
14
|
+
admitted: "admitted",
|
|
15
|
+
paused: "paused",
|
|
16
|
+
retiring: "retiring",
|
|
17
|
+
retired: "retired",
|
|
18
|
+
};
|
|
19
|
+
/** Whether the realm runs the images it is expected to. */
|
|
20
|
+
export const AUTH_PROJECT_DOMAIN_CONVERGENCES = {
|
|
21
|
+
converged: "converged",
|
|
22
|
+
drifted: "drifted",
|
|
23
|
+
notRunning: "not-running",
|
|
24
|
+
unverified: "unverified",
|
|
25
|
+
rollingOut: "rolling-out",
|
|
26
|
+
};
|
|
27
|
+
/** Where the realm's expected image identity comes from. */
|
|
28
|
+
export const AUTH_PROJECT_DOMAIN_IMAGE_SOURCES = {
|
|
29
|
+
releaseDefault: "release-default",
|
|
30
|
+
override: "override",
|
|
31
|
+
undeclared: "undeclared",
|
|
32
|
+
};
|
|
33
|
+
/** The realm workload an incident image override pins. */
|
|
34
|
+
export const AUTH_PROJECT_DOMAIN_IMAGE_COMPONENTS = {
|
|
35
|
+
gateway: "gateway",
|
|
36
|
+
hydra: "hydra",
|
|
37
|
+
};
|