@openupstream/sdk 0.4.0 → 0.9.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/dist/index.d.ts +52 -4
- package/dist/index.js +100 -11
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +110 -12
- package/dist/internal.js +83 -10
- package/dist/internal.js.map +1 -1
- package/dist/model.d.ts +198 -6
- package/dist/model.js +40 -2
- package/dist/model.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
*
|
|
8
8
|
* The API surface is defined here first and implemented in control-plane/.
|
|
9
9
|
*/
|
|
10
|
-
export declare const SDK_VERSION = "0.
|
|
10
|
+
export declare const SDK_VERSION = "0.9.1";
|
|
11
11
|
export * from './model.js';
|
|
12
12
|
export * from './internal.js';
|
|
13
|
-
import type { Account, AccountInput, Bucket, BucketDetails, BucketInput, CliLogin, CustomDomainInput, DatabaseDetails, DatabaseInput, DatabasePatch, Domain, Id, JobDetails, JobInput, JobPatch, JobRun, JobRunInput, LogEntry, LogQuery, Project, ProjectInput, ProjectUsage, Route, RouteInput, Secret, SecretInput, ServiceDetails, ServiceInput, ServicePatch } from './model.js';
|
|
13
|
+
import type { Account, AccountInput, Bucket, BucketDetails, BucketInput, CliLogin, CustomDomainInput, DatabaseDetails, DatabaseInput, DatabasePatch, DatabaseProxy, DatabaseProxyInput, Domain, Id, JobDetails, JobInput, JobPatch, JobRun, JobRunInput, LogEntry, LogQuery, NodesReport, AccountToken, AccountTokenInput, AccountTokenPatch, AccountTokenRoll, AccountTokenWithSecret, Grant, GrantInput, Member, MemberPatch, Project, ProjectInput, ProjectUsage, Route, RouteInput, Secret, SecretInput, ServiceDetails, ServiceInput, ServicePatch, SiteDescriptionInput, SiteDetails, SiteInfo } from './model.js';
|
|
14
14
|
/** The API is under `/api` of the platform's host (ARCHITECTURE.md, decision 120). */
|
|
15
15
|
export declare const DEFAULT_API_URL = "https://console.openupstream.com/api";
|
|
16
16
|
export interface ClientOptions {
|
|
17
17
|
baseUrl?: string;
|
|
18
|
-
/** A madAuth session token, an access token of `oup`,
|
|
18
|
+
/** A madAuth session token, an access token of `oup`, one of the user's madAuth API keys (`madauth_…`) or an Account token (`oup_tok_…`). */
|
|
19
19
|
token: string;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
@@ -54,6 +54,44 @@ export declare class OpenUpstreamClient {
|
|
|
54
54
|
listAccounts(): Promise<ApiResult<Account[]>>;
|
|
55
55
|
/** A new Account, with the caller as its first Member. */
|
|
56
56
|
createAccount(input: AccountInput): Promise<ApiResult<Account>>;
|
|
57
|
+
/** The Account's Members with their roles and grants; owners and developers see all, a Member without a role themselves. */
|
|
58
|
+
listMembers(accountId: Id): Promise<ApiResult<Member[]>>;
|
|
59
|
+
/** Gives a Member another role; owners only, never with an API key. An Account always keeps an owner (409). */
|
|
60
|
+
updateMember(accountId: Id, memberId: Id, patch: MemberPatch): Promise<ApiResult<Member>>;
|
|
61
|
+
/**
|
|
62
|
+
* Gives a Member access to one Database at a level, or another level
|
|
63
|
+
* (decision 139); owners only, never with an API key. A lower level drops
|
|
64
|
+
* the Member's Postgres roles above it while they have no role.
|
|
65
|
+
*/
|
|
66
|
+
setGrant(accountId: Id, memberId: Id, databaseId: Id, input: GrantInput): Promise<ApiResult<Grant>>;
|
|
67
|
+
/** Takes a Member's grant on a Database away, and with it their Postgres roles there while they have no role. */
|
|
68
|
+
removeGrant(accountId: Id, memberId: Id, databaseId: Id): Promise<ApiResult<void>>;
|
|
69
|
+
/**
|
|
70
|
+
* Removes a Member, `me` for the caller (leaving the Account); others
|
|
71
|
+
* only by an owner, never with an API key. Their Postgres roles in the
|
|
72
|
+
* Account's Databases are dropped. An Account always keeps an owner (409).
|
|
73
|
+
*/
|
|
74
|
+
removeMember(accountId: Id, memberId: Id | 'me'): Promise<ApiResult<void>>;
|
|
75
|
+
/** The Account's tokens, without their secrets; owners and developers see them, never with an Account token. */
|
|
76
|
+
listAccountTokens(accountId: Id): Promise<ApiResult<AccountToken[]>>;
|
|
77
|
+
/** A new Account token and its secret, shown only now (decision 144); owners only, never with an API key. */
|
|
78
|
+
createAccountToken(accountId: Id, input: AccountTokenInput): Promise<ApiResult<AccountTokenWithSecret>>;
|
|
79
|
+
/** Renames an Account token or changes its role; owners only, never with an API key. */
|
|
80
|
+
updateAccountToken(accountId: Id, tokenId: Id, patch: AccountTokenPatch): Promise<ApiResult<AccountToken>>;
|
|
81
|
+
/** A new secret and expiry for an Account token; the previous secret works 24 hours more. Owners only. */
|
|
82
|
+
rollAccountToken(accountId: Id, tokenId: Id, input: AccountTokenRoll): Promise<ApiResult<AccountTokenWithSecret>>;
|
|
83
|
+
/** Revokes an Account token at once and drops its Postgres roles; owners only, never with an API key. */
|
|
84
|
+
deleteAccountToken(accountId: Id, tokenId: Id): Promise<ApiResult<void>>;
|
|
85
|
+
/** Gives an Account token access to one Database at a level, or another level; as setGrant for a Member. */
|
|
86
|
+
setAccountTokenGrant(accountId: Id, tokenId: Id, databaseId: Id, input: GrantInput): Promise<ApiResult<Grant>>;
|
|
87
|
+
/** Takes an Account token's grant on a Database away, and with it its Postgres roles there while it has no role. */
|
|
88
|
+
removeAccountTokenGrant(accountId: Id, tokenId: Id, databaseId: Id): Promise<ApiResult<void>>;
|
|
89
|
+
/** The compute Sites, where Databases, Services and Jobs can run; one is the default. */
|
|
90
|
+
listSites(): Promise<ApiResult<SiteInfo[]>>;
|
|
91
|
+
/** Every node and what is wrong with the Site labels; only for madAuth's `admin` role, signed in (ADR-0008). */
|
|
92
|
+
listNodes(): Promise<ApiResult<NodesReport>>;
|
|
93
|
+
/** Names a Site, or removes its name with null; only for madAuth's `admin` role, signed in (ADR-0009). */
|
|
94
|
+
setSiteDescription(site: string, input: SiteDescriptionInput): Promise<ApiResult<SiteDetails>>;
|
|
57
95
|
listProjects(): Promise<ApiResult<Project[]>>;
|
|
58
96
|
createProject(input: ProjectInput): Promise<ApiResult<Project>>;
|
|
59
97
|
getProject(projectId: Id): Promise<ApiResult<Project>>;
|
|
@@ -63,6 +101,12 @@ export declare class OpenUpstreamClient {
|
|
|
63
101
|
getUsage(projectId: Id): Promise<ApiResult<ProjectUsage>>;
|
|
64
102
|
listDatabases(projectId: Id): Promise<ApiResult<DatabaseDetails[]>>;
|
|
65
103
|
createDatabase(projectId: Id, input: DatabaseInput): Promise<ApiResult<DatabaseDetails>>;
|
|
104
|
+
/**
|
|
105
|
+
* The caller's own Postgres role for the Database at a level, created on
|
|
106
|
+
* the first ask, and the tunnel to reach it with (decision 126). An API
|
|
107
|
+
* key gets roles of its own and needs `openupstream:write`.
|
|
108
|
+
*/
|
|
109
|
+
openDatabaseProxy(projectId: Id, databaseId: Id, input?: DatabaseProxyInput): Promise<ApiResult<DatabaseProxy>>;
|
|
66
110
|
getDatabase(projectId: Id, databaseId: Id): Promise<ApiResult<DatabaseDetails>>;
|
|
67
111
|
/** Resizes the Database; the operator applies it within one pass (`resizing` until then). */
|
|
68
112
|
updateDatabase(projectId: Id, databaseId: Id, patch: DatabasePatch): Promise<ApiResult<DatabaseDetails>>;
|
|
@@ -129,5 +173,9 @@ export declare class OpenUpstreamClient {
|
|
|
129
173
|
* the caller learns what to change; the HTTP status text without either.
|
|
130
174
|
*/
|
|
131
175
|
export declare function errorMessage(body: unknown, statusText: string): string;
|
|
132
|
-
/**
|
|
176
|
+
/**
|
|
177
|
+
* The JSON values of a body of NDJSON, one per non-empty line. Read with a
|
|
178
|
+
* reader, not `for await` over the body, which Safari does not have; a
|
|
179
|
+
* consumer that stops early cancels the body, which ends the request.
|
|
180
|
+
*/
|
|
133
181
|
export declare function ndjsonLines<T>(body: ReadableStream<Uint8Array>): AsyncIterable<T>;
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* The API surface is defined here first and implemented in control-plane/.
|
|
9
9
|
*/
|
|
10
|
-
export const SDK_VERSION = '0.
|
|
10
|
+
export const SDK_VERSION = '0.9.1';
|
|
11
11
|
export * from './model.js';
|
|
12
12
|
export * from './internal.js';
|
|
13
13
|
/** The API is under `/api` of the platform's host (ARCHITECTURE.md, decision 120). */
|
|
@@ -39,6 +39,74 @@ export class OpenUpstreamClient {
|
|
|
39
39
|
createAccount(input) {
|
|
40
40
|
return this.#call('POST', '/v1/accounts', input);
|
|
41
41
|
}
|
|
42
|
+
/** The Account's Members with their roles and grants; owners and developers see all, a Member without a role themselves. */
|
|
43
|
+
listMembers(accountId) {
|
|
44
|
+
return this.#call('GET', `/v1/accounts/${encodeURIComponent(accountId)}/members`);
|
|
45
|
+
}
|
|
46
|
+
/** Gives a Member another role; owners only, never with an API key. An Account always keeps an owner (409). */
|
|
47
|
+
updateMember(accountId, memberId, patch) {
|
|
48
|
+
return this.#call('PATCH', `/v1/accounts/${encodeURIComponent(accountId)}/members/${encodeURIComponent(memberId)}`, patch);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Gives a Member access to one Database at a level, or another level
|
|
52
|
+
* (decision 139); owners only, never with an API key. A lower level drops
|
|
53
|
+
* the Member's Postgres roles above it while they have no role.
|
|
54
|
+
*/
|
|
55
|
+
setGrant(accountId, memberId, databaseId, input) {
|
|
56
|
+
return this.#call('PUT', grantPath(accountId, memberId, databaseId), input);
|
|
57
|
+
}
|
|
58
|
+
/** Takes a Member's grant on a Database away, and with it their Postgres roles there while they have no role. */
|
|
59
|
+
removeGrant(accountId, memberId, databaseId) {
|
|
60
|
+
return this.#call('DELETE', grantPath(accountId, memberId, databaseId));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Removes a Member, `me` for the caller (leaving the Account); others
|
|
64
|
+
* only by an owner, never with an API key. Their Postgres roles in the
|
|
65
|
+
* Account's Databases are dropped. An Account always keeps an owner (409).
|
|
66
|
+
*/
|
|
67
|
+
removeMember(accountId, memberId) {
|
|
68
|
+
return this.#call('DELETE', `/v1/accounts/${encodeURIComponent(accountId)}/members/${encodeURIComponent(memberId)}`);
|
|
69
|
+
}
|
|
70
|
+
/** The Account's tokens, without their secrets; owners and developers see them, never with an Account token. */
|
|
71
|
+
listAccountTokens(accountId) {
|
|
72
|
+
return this.#call('GET', accountTokenPath(accountId));
|
|
73
|
+
}
|
|
74
|
+
/** A new Account token and its secret, shown only now (decision 144); owners only, never with an API key. */
|
|
75
|
+
createAccountToken(accountId, input) {
|
|
76
|
+
return this.#call('POST', accountTokenPath(accountId), input);
|
|
77
|
+
}
|
|
78
|
+
/** Renames an Account token or changes its role; owners only, never with an API key. */
|
|
79
|
+
updateAccountToken(accountId, tokenId, patch) {
|
|
80
|
+
return this.#call('PATCH', accountTokenPath(accountId, tokenId), patch);
|
|
81
|
+
}
|
|
82
|
+
/** A new secret and expiry for an Account token; the previous secret works 24 hours more. Owners only. */
|
|
83
|
+
rollAccountToken(accountId, tokenId, input) {
|
|
84
|
+
return this.#call('POST', `${accountTokenPath(accountId, tokenId)}/roll`, input);
|
|
85
|
+
}
|
|
86
|
+
/** Revokes an Account token at once and drops its Postgres roles; owners only, never with an API key. */
|
|
87
|
+
deleteAccountToken(accountId, tokenId) {
|
|
88
|
+
return this.#call('DELETE', accountTokenPath(accountId, tokenId));
|
|
89
|
+
}
|
|
90
|
+
/** Gives an Account token access to one Database at a level, or another level; as setGrant for a Member. */
|
|
91
|
+
setAccountTokenGrant(accountId, tokenId, databaseId, input) {
|
|
92
|
+
return this.#call('PUT', `${accountTokenPath(accountId, tokenId)}/grants/${encodeURIComponent(databaseId)}`, input);
|
|
93
|
+
}
|
|
94
|
+
/** Takes an Account token's grant on a Database away, and with it its Postgres roles there while it has no role. */
|
|
95
|
+
removeAccountTokenGrant(accountId, tokenId, databaseId) {
|
|
96
|
+
return this.#call('DELETE', `${accountTokenPath(accountId, tokenId)}/grants/${encodeURIComponent(databaseId)}`);
|
|
97
|
+
}
|
|
98
|
+
/** The compute Sites, where Databases, Services and Jobs can run; one is the default. */
|
|
99
|
+
listSites() {
|
|
100
|
+
return this.#call('GET', '/v1/sites');
|
|
101
|
+
}
|
|
102
|
+
/** Every node and what is wrong with the Site labels; only for madAuth's `admin` role, signed in (ADR-0008). */
|
|
103
|
+
listNodes() {
|
|
104
|
+
return this.#call('GET', '/v1/admin/nodes');
|
|
105
|
+
}
|
|
106
|
+
/** Names a Site, or removes its name with null; only for madAuth's `admin` role, signed in (ADR-0009). */
|
|
107
|
+
setSiteDescription(site, input) {
|
|
108
|
+
return this.#call('PUT', `/v1/admin/sites/${encodeURIComponent(site)}`, input);
|
|
109
|
+
}
|
|
42
110
|
listProjects() {
|
|
43
111
|
return this.#call('GET', '/v1/projects');
|
|
44
112
|
}
|
|
@@ -62,6 +130,14 @@ export class OpenUpstreamClient {
|
|
|
62
130
|
createDatabase(projectId, input) {
|
|
63
131
|
return this.#call('POST', `/v1/projects/${encodeURIComponent(projectId)}/databases`, input);
|
|
64
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* The caller's own Postgres role for the Database at a level, created on
|
|
135
|
+
* the first ask, and the tunnel to reach it with (decision 126). An API
|
|
136
|
+
* key gets roles of its own and needs `openupstream:write`.
|
|
137
|
+
*/
|
|
138
|
+
openDatabaseProxy(projectId, databaseId, input = {}) {
|
|
139
|
+
return this.#call('POST', `/v1/projects/${encodeURIComponent(projectId)}/databases/${encodeURIComponent(databaseId)}/proxy`, input);
|
|
140
|
+
}
|
|
65
141
|
getDatabase(projectId, databaseId) {
|
|
66
142
|
return this.#call('GET', `/v1/projects/${encodeURIComponent(projectId)}/databases/${encodeURIComponent(databaseId)}`);
|
|
67
143
|
}
|
|
@@ -251,6 +327,8 @@ export function errorMessage(body, statusText) {
|
|
|
251
327
|
: []);
|
|
252
328
|
return details.length === 0 ? body.error : `${body.error} (${details.join('; ')})`;
|
|
253
329
|
}
|
|
330
|
+
const accountTokenPath = (accountId, tokenId) => `/v1/accounts/${encodeURIComponent(accountId)}/account-tokens${tokenId === undefined ? '' : `/${encodeURIComponent(tokenId)}`}`;
|
|
331
|
+
const grantPath = (accountId, memberId, databaseId) => `/v1/accounts/${encodeURIComponent(accountId)}/members/${encodeURIComponent(memberId)}/grants/${encodeURIComponent(databaseId)}`;
|
|
254
332
|
const logSearch = (query) => {
|
|
255
333
|
const params = new URLSearchParams({
|
|
256
334
|
...(query.tail === undefined ? {} : { tail: String(query.tail) }),
|
|
@@ -258,21 +336,32 @@ const logSearch = (query) => {
|
|
|
258
336
|
}).toString();
|
|
259
337
|
return params === '' ? '' : `?${params}`;
|
|
260
338
|
};
|
|
261
|
-
/**
|
|
339
|
+
/**
|
|
340
|
+
* The JSON values of a body of NDJSON, one per non-empty line. Read with a
|
|
341
|
+
* reader, not `for await` over the body, which Safari does not have; a
|
|
342
|
+
* consumer that stops early cancels the body, which ends the request.
|
|
343
|
+
*/
|
|
262
344
|
export async function* ndjsonLines(body) {
|
|
263
345
|
const decoder = new TextDecoder();
|
|
346
|
+
const reader = body.getReader();
|
|
264
347
|
let pending = '';
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
348
|
+
try {
|
|
349
|
+
for (let chunk = await reader.read(); !chunk.done; chunk = await reader.read()) {
|
|
350
|
+
pending += decoder.decode(chunk.value, { stream: true });
|
|
351
|
+
const lines = pending.split('\n');
|
|
352
|
+
pending = lines.pop() ?? '';
|
|
353
|
+
for (const line of lines.filter((candidate) => candidate.trim() !== '')) {
|
|
354
|
+
yield JSON.parse(line);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
const last = pending + decoder.decode();
|
|
358
|
+
if (last.trim() !== '') {
|
|
359
|
+
yield JSON.parse(last);
|
|
271
360
|
}
|
|
272
361
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
362
|
+
finally {
|
|
363
|
+
// Also after an error or an abort, where cancelling again changes nothing.
|
|
364
|
+
await reader.cancel().catch(() => undefined);
|
|
276
365
|
}
|
|
277
366
|
}
|
|
278
367
|
//# sourceMappingUR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AC,GAAG,EAAE,IAAI,EAAE,CAAC;YAC5B,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;gBACtE,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAM,CAAC;YAChC,CAAC;QACL,CAAC;QACD,MAAM,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;QACxC,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACrB,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAM,CAAC;QAChC,CAAC;IACL,CAAC;YAAS,CAAC;QACP,2EAA2E;QAC3E,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IACjD,CAAC;AACL,CAAC"}
|
package/dist/internal.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* public API: it is served on its own port, never routed by ingress, and
|
|
5
5
|
* callers authenticate with their Kubernetes ServiceAccount token.
|
|
6
6
|
*/
|
|
7
|
-
import type { Account, Database, DatabaseConnection, Domain, Id, Job, Member, Project, ResourceKind, Route, Service, Site, UsageUnit } from './model.js';
|
|
7
|
+
import type { Account, Database, DatabaseAccess, DatabaseConnection, Domain, Id, Job, Member, Project, ResourceKind, Route, Service, Site, UsageUnit } from './model.js';
|
|
8
8
|
/**
|
|
9
9
|
* Kubernetes names, by id (ARCHITECTURE.md, decision 42): the operators
|
|
10
10
|
* create these objects, the control plane reads and deletes them.
|
|
@@ -14,10 +14,73 @@ export declare const projectNamespace: (projectId: Id) => string;
|
|
|
14
14
|
export declare const clusterName: (database: Pick<Database, "id">) => string;
|
|
15
15
|
/** Cannot share the Cluster's name, nor `<cluster>-rw`, which the Cluster's own Service takes. */
|
|
16
16
|
export declare const poolerName: (database: Pick<Database, "id">) => string;
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* The Database's second Pooler, of type `ro`: to its standby, never to its
|
|
19
|
+
* primary (decision 157). The restart guard pauses only `poolerName`'s.
|
|
20
|
+
*/
|
|
21
|
+
export declare const readPoolerName: (database: Pick<Database, "id">) => string;
|
|
22
|
+
/**
|
|
23
|
+
* The CPU each instance of a Database is guaranteed (decision 151): one core
|
|
24
|
+
* per 4 GiB of its memory, the ratio of the compute servers (16 threads,
|
|
25
|
+
* 64 GB), as a Kubernetes request with no limit, so it uses idle cores too.
|
|
26
|
+
*/
|
|
27
|
+
export declare const DATABASE_MILLICORES_PER_GIB = 250;
|
|
28
|
+
export declare const databaseCpuMillicores: (memoryMb: number) => number;
|
|
29
|
+
/** The Cluster's own Service to its primary, which CloudNativePG names. */
|
|
30
|
+
export declare const primaryServiceName: (database: Pick<Database, "id">) => string;
|
|
31
|
+
/**
|
|
32
|
+
* Where a Project's database tunnel is served (decision 126): a host of its
|
|
33
|
+
* own under the customer domain, covered by the default Domains' wildcard
|
|
34
|
+
* record and certificate. No default Domain can take it: theirs end in a
|
|
35
|
+
* hyphen and 8 characters, a Project id in 12.
|
|
36
|
+
*/
|
|
37
|
+
export declare const tunnelHostname: (projectId: Id, customerDomain: string) => string;
|
|
38
|
+
/** The forwarder's Deployment in a Project's namespace (decision 126). */
|
|
39
|
+
export declare const DATABASE_TUNNEL = "database-tunnel";
|
|
40
|
+
/** Its pods, by label; the control plane deletes them to end every tunnel of the Project (decision 143). */
|
|
41
|
+
export declare const DATABASE_TUNNEL_PODS = "openupstream.io/component=database-tunnel";
|
|
42
|
+
/** What the tunnel reaches at a level: the Pooler, or the primary at `owner`, so session advisory locks work. */
|
|
43
|
+
export type DatabaseTunnelTarget = 'pooler' | 'primary';
|
|
44
|
+
export declare const tunnelTargetOf: (access: DatabaseAccess) => DatabaseTunnelTarget;
|
|
45
|
+
/** The tunnel's path on its host, which names the Database and the target. */
|
|
46
|
+
export declare const tunnelPath: (databaseId: Id, target: DatabaseTunnelTarget) => string;
|
|
47
|
+
export declare const TUNNEL_PATH: RegExp;
|
|
48
|
+
/** A caller's Postgres role: its level and its row's id, 46 characters, under Postgres's 63. */
|
|
49
|
+
export declare const databaseRoleName: (role: {
|
|
50
|
+
readonly id: Id;
|
|
51
|
+
readonly access: DatabaseAccess;
|
|
52
|
+
}) => string;
|
|
53
|
+
/** The `kubernetes.io/basic-auth` Secret in the Project's namespace that CloudNativePG reads a role's password from. */
|
|
54
|
+
export declare const databaseRoleSecret: (role: {
|
|
55
|
+
readonly id: Id;
|
|
56
|
+
}) => string;
|
|
57
|
+
/** One caller's role in a Database, as the Databases operator adds it to the Cluster. */
|
|
58
|
+
export interface DatabaseRoleRow {
|
|
59
|
+
readonly id: Id;
|
|
60
|
+
readonly access: DatabaseAccess;
|
|
61
|
+
/** Taken from its caller (decision 143): the Cluster drops it (`ensure: absent`). */
|
|
62
|
+
readonly dropped?: true;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The Secret with the Database's `app` user and its `password`: written by
|
|
66
|
+
* the control plane (decision 156), or generated by CloudNativePG for a
|
|
67
|
+
* Database from before.
|
|
68
|
+
*/
|
|
18
69
|
export declare const databaseAppSecret: (database: Pick<Database, "id">) => string;
|
|
70
|
+
/**
|
|
71
|
+
* The Secret with the SCRAM verifier of the `app` user's password, which
|
|
72
|
+
* the Cluster of a Database with `appCredentials` names as its application
|
|
73
|
+
* Secret (decision 156); the control plane writes both.
|
|
74
|
+
*/
|
|
75
|
+
export declare const databaseAppVerifierSecret: (database: Pick<Database, "id">) => string;
|
|
19
76
|
/** Where the Project's Services and Jobs reach the Database: its Pooler, inside the cluster. */
|
|
20
77
|
export declare const databaseConnection: (database: Pick<Database, "id" | "projectId">) => DatabaseConnection;
|
|
78
|
+
/**
|
|
79
|
+
* Where they reach its standby, for queries that must not load the primary
|
|
80
|
+
* and may read slightly old data (decision 157): the Database's `ro` Pooler.
|
|
81
|
+
* Nothing answers there while no standby is ready.
|
|
82
|
+
*/
|
|
83
|
+
export declare const databaseReadConnection: (database: Pick<Database, "id" | "projectId">) => DatabaseConnection;
|
|
21
84
|
/**
|
|
22
85
|
* The Kubernetes Secret in a Project's namespace that holds all its Secrets'
|
|
23
86
|
* values; the control plane writes it, Services and Jobs read it with `envFrom`.
|
|
@@ -63,6 +126,18 @@ export declare const INTERNAL_ROUTES_PATH = "/internal/v1/routes";
|
|
|
63
126
|
export declare const INTERNAL_SERVICES_PATH = "/internal/v1/services";
|
|
64
127
|
/** `GET` lists every Job with its Project, for the Jobs operator. */
|
|
65
128
|
export declare const INTERNAL_JOBS_PATH = "/internal/v1/jobs";
|
|
129
|
+
/**
|
|
130
|
+
* For the madAuth sidecar, which passes on madAuth's events (decision 143):
|
|
131
|
+
* `DELETE <path>/<user id>` removes a user madAuth deleted from every
|
|
132
|
+
* Account; `DELETE <path>/<user id>/api-keys/<key id>` drops the Postgres
|
|
133
|
+
* roles of a key madAuth revoked. Both answer 204, also when there was
|
|
134
|
+
* nothing to do, so a retry is harmless.
|
|
135
|
+
*/
|
|
136
|
+
export declare const INTERNAL_USERS_PATH = "/internal/v1/users";
|
|
137
|
+
/** A madAuth user or API key id in a path: `usr_` and base64url, kept to URL-safe characters. */
|
|
138
|
+
export declare const MADAUTH_ID: RegExp;
|
|
139
|
+
export declare const internalUserPath: (subject: string) => string;
|
|
140
|
+
export declare const internalApiKeyPath: (subject: string, apiKeyId: string) => string;
|
|
66
141
|
/** An Account's usage of one month: `${INTERNAL_ACCOUNTS_PATH}/{id}/usage?month=YYYY-MM`, for the billing service. */
|
|
67
142
|
export declare const internalUsagePath: (accountId: Id, month: string) => string;
|
|
68
143
|
/**
|
|
@@ -124,7 +199,7 @@ export interface DomainRouting {
|
|
|
124
199
|
readonly routes: readonly RoutedPath[];
|
|
125
200
|
}
|
|
126
201
|
export interface AccountRecord extends Account {
|
|
127
|
-
readonly members: readonly Pick<Member, 'authSubject' | 'email'>[];
|
|
202
|
+
readonly members: readonly Pick<Member, 'authSubject' | 'email' | 'role'>[];
|
|
128
203
|
}
|
|
129
204
|
/** One Service as the Services operator needs it. */
|
|
130
205
|
export interface ServiceRow {
|
|
@@ -132,7 +207,7 @@ export interface ServiceRow {
|
|
|
132
207
|
readonly service: Pick<Service, 'id' | 'name' | 'image' | 'imageDigest' | 'replicas' | 'memoryMb' | 'cpuMillicores' | 'port'>;
|
|
133
208
|
/** What the Deployment runs: `<registry>/<repository>@<digest>`. */
|
|
134
209
|
readonly pinnedImage: string;
|
|
135
|
-
/** Where a single replica runs: the Service's homeSite, else the Project's oldest Database's, else
|
|
210
|
+
/** Where a single replica runs: the Service's homeSite, else the Project's oldest Database's, else the default Site. */
|
|
136
211
|
readonly site: Site;
|
|
137
212
|
/**
|
|
138
213
|
* The version of the Project's Secrets in its Kubernetes Secret: it
|
|
@@ -146,6 +221,17 @@ export interface ServiceRow {
|
|
|
146
221
|
}
|
|
147
222
|
/** A Database as a Service's or Job's row names it. */
|
|
148
223
|
export type RowDatabase = Pick<Database, 'id' | 'name'>;
|
|
224
|
+
/** Every node carries its Site's id in this label (ADR-0007). */
|
|
225
|
+
export declare const ZONE_LABEL = "topology.kubernetes.io/zone";
|
|
226
|
+
/** `true` on the nodes of a compute Site, where Databases, Services and Jobs run. */
|
|
227
|
+
export declare const COMPUTE_SITE_LABEL = "openupstream.io/compute-site";
|
|
228
|
+
/** `true` on the nodes of the one compute Site that is the default Home site. */
|
|
229
|
+
export declare const DEFAULT_SITE_LABEL = "openupstream.io/default-site";
|
|
230
|
+
/**
|
|
231
|
+
* The taint (`true`, `NoSchedule`) on every node outside the compute Sites:
|
|
232
|
+
* only etcd, Garage, Loki and the node agents tolerate it.
|
|
233
|
+
*/
|
|
234
|
+
export declare const QUORUM_ONLY_TAINT = "openupstream.io/quorum-only";
|
|
149
235
|
/** On a Service's Deployment and a Job's CronJob: the spec version it was applied from (serviceSpecVersion, jobSpecVersion). */
|
|
150
236
|
export declare const SPEC_VERSION_ANNOTATION = "openupstream.io/spec-version";
|
|
151
237
|
/**
|
|
@@ -161,7 +247,7 @@ export interface JobRow {
|
|
|
161
247
|
readonly job: Pick<Job, 'id' | 'name' | 'image' | 'imageDigest' | 'command' | 'args' | 'memoryMb' | 'cpuMillicores' | 'timeoutSeconds' | 'schedule' | 'timeZone'>;
|
|
162
248
|
/** What its runs start: `<registry>/<repository>@<digest>`. */
|
|
163
249
|
readonly pinnedImage: string;
|
|
164
|
-
/** Where its runs go: the Job's homeSite, else the Project's oldest Database's, else
|
|
250
|
+
/** Where its runs go: the Job's homeSite, else the Project's oldest Database's, else the default Site. */
|
|
165
251
|
readonly site: Site;
|
|
166
252
|
/** The Project's live Databases, oldest first: its runs get a DATABASE_URL for each (decision 97). */
|
|
167
253
|
readonly databases: readonly RowDatabase[];
|
|
@@ -184,13 +270,28 @@ export interface DatabaseRow {
|
|
|
184
270
|
* so it no longer depends on the source's ObjectStore.
|
|
185
271
|
*/
|
|
186
272
|
readonly restoring?: boolean;
|
|
273
|
+
/** The callers' own roles in this Database (decision 126), oldest first. */
|
|
274
|
+
readonly roles?: readonly DatabaseRoleRow[];
|
|
275
|
+
/**
|
|
276
|
+
* The control plane holds the `app` user's password and writes its
|
|
277
|
+
* Secrets (decision 156): the Cluster then reads the verifier from
|
|
278
|
+
* `databaseAppVerifierSecret`. Absent for a Database from before.
|
|
279
|
+
*/
|
|
280
|
+
readonly appCredentials?: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* The Project's tunnel host (tunnelHostname), on every row of a Project
|
|
283
|
+
* that has a role in any Database: the operator then runs the tunnel's
|
|
284
|
+
* forwarder there.
|
|
285
|
+
*/
|
|
286
|
+
readonly tunnelHostname?: string;
|
|
187
287
|
}
|
|
188
288
|
/**
|
|
189
289
|
* The platform's own Account, Project and Databases: the control plane's
|
|
190
290
|
* state (`database`) and madAuth's users (`authDatabase`). The bootstrap
|
|
191
291
|
* creates these Databases once; the control plane seeds these rows at
|
|
192
|
-
* startup, and from then on the operator
|
|
193
|
-
* customer's. Fixed ids, so bootstrap and control
|
|
292
|
+
* startup, in the default Site (ADR-0007), and from then on the operator
|
|
293
|
+
* reconciles them like any customer's. Fixed ids, so bootstrap and control
|
|
294
|
+
* plane agree.
|
|
194
295
|
*/
|
|
195
296
|
export declare const PLATFORM: {
|
|
196
297
|
readonly account: {
|
|
@@ -208,7 +309,6 @@ export declare const PLATFORM: {
|
|
|
208
309
|
readonly id: "00000000-0000-4000-8000-000000000003";
|
|
209
310
|
readonly projectId: "00000000-0000-4000-8000-000000000002";
|
|
210
311
|
readonly name: "control-plane";
|
|
211
|
-
readonly homeSite: "hetzner-fsn1";
|
|
212
312
|
readonly memoryMb: 512;
|
|
213
313
|
readonly storageGb: 5;
|
|
214
314
|
readonly autoGrow: true;
|
|
@@ -219,7 +319,6 @@ export declare const PLATFORM: {
|
|
|
219
319
|
readonly id: "00000000-0000-4000-8000-000000000004";
|
|
220
320
|
readonly projectId: "00000000-0000-4000-8000-000000000002";
|
|
221
321
|
readonly name: "auth";
|
|
222
|
-
readonly homeSite: "hetzner-fsn1";
|
|
223
322
|
readonly memoryMb: 512;
|
|
224
323
|
readonly storageGb: 2;
|
|
225
324
|
readonly autoGrow: true;
|
|
@@ -231,7 +330,6 @@ export declare const PLATFORM: {
|
|
|
231
330
|
readonly id: "00000000-0000-4000-8000-000000000005";
|
|
232
331
|
readonly projectId: "00000000-0000-4000-8000-000000000002";
|
|
233
332
|
readonly name: "billing";
|
|
234
|
-
readonly homeSite: "hetzner-fsn1";
|
|
235
333
|
readonly memoryMb: 512;
|
|
236
334
|
readonly storageGb: 2;
|
|
237
335
|
readonly autoGrow: true;
|
|
@@ -239,5 +337,5 @@ export declare const PLATFORM: {
|
|
|
239
337
|
readonly createdAt: "2026-10-20T00:00:00Z";
|
|
240
338
|
};
|
|
241
339
|
};
|
|
242
|
-
/** The platform's Database rows, as the operator
|
|
243
|
-
export declare const
|
|
340
|
+
/** The platform's Database rows, as the bootstrap gives them to the operator: in `homeSite`, the default Site. */
|
|
341
|
+
export declare const platformRows: (homeSite: Site) => DatabaseRow[];
|
package/dist/internal.js
CHANGED
|
@@ -7,8 +7,51 @@ export const projectNamespace = (projectId) => `project-${projectId}`;
|
|
|
7
7
|
export const clusterName = (database) => `db-${database.id}`;
|
|
8
8
|
/** Cannot share the Cluster's name, nor `<cluster>-rw`, which the Cluster's own Service takes. */
|
|
9
9
|
export const poolerName = (database) => `${clusterName(database)}-pooler`;
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* The Database's second Pooler, of type `ro`: to its standby, never to its
|
|
12
|
+
* primary (decision 157). The restart guard pauses only `poolerName`'s.
|
|
13
|
+
*/
|
|
14
|
+
export const readPoolerName = (database) => `${poolerName(database)}-ro`;
|
|
15
|
+
/**
|
|
16
|
+
* The CPU each instance of a Database is guaranteed (decision 151): one core
|
|
17
|
+
* per 4 GiB of its memory, the ratio of the compute servers (16 threads,
|
|
18
|
+
* 64 GB), as a Kubernetes request with no limit, so it uses idle cores too.
|
|
19
|
+
*/
|
|
20
|
+
export const DATABASE_MILLICORES_PER_GIB = 250;
|
|
21
|
+
export const databaseCpuMillicores = (memoryMb) => Math.ceil((memoryMb * DATABASE_MILLICORES_PER_GIB) / 1024);
|
|
22
|
+
/** The Cluster's own Service to its primary, which CloudNativePG names. */
|
|
23
|
+
export const primaryServiceName = (database) => `${clusterName(database)}-rw`;
|
|
24
|
+
/**
|
|
25
|
+
* Where a Project's database tunnel is served (decision 126): a host of its
|
|
26
|
+
* own under the customer domain, covered by the default Domains' wildcard
|
|
27
|
+
* record and certificate. No default Domain can take it: theirs end in a
|
|
28
|
+
* hyphen and 8 characters, a Project id in 12.
|
|
29
|
+
*/
|
|
30
|
+
export const tunnelHostname = (projectId, customerDomain) => `pg-${projectId}.${customerDomain}`;
|
|
31
|
+
/** The forwarder's Deployment in a Project's namespace (decision 126). */
|
|
32
|
+
export const DATABASE_TUNNEL = 'database-tunnel';
|
|
33
|
+
/** Its pods, by label; the control plane deletes them to end every tunnel of the Project (decision 143). */
|
|
34
|
+
export const DATABASE_TUNNEL_PODS = `openupstream.io/component=${DATABASE_TUNNEL}`;
|
|
35
|
+
export const tunnelTargetOf = (access) => (access === 'owner' ? 'primary' : 'pooler');
|
|
36
|
+
/** The tunnel's path on its host, which names the Database and the target. */
|
|
37
|
+
export const tunnelPath = (databaseId, target) => `/databases/${databaseId}/${target}`;
|
|
38
|
+
export const TUNNEL_PATH = /^\/databases\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\/(pooler|primary)$/;
|
|
39
|
+
/** A caller's Postgres role: its level and its row's id, 46 characters, under Postgres's 63. */
|
|
40
|
+
export const databaseRoleName = (role) => `oup_${role.access}_${role.id.replaceAll('-', '')}`;
|
|
41
|
+
/** The `kubernetes.io/basic-auth` Secret in the Project's namespace that CloudNativePG reads a role's password from. */
|
|
42
|
+
export const databaseRoleSecret = (role) => `pg-role-${role.id}`;
|
|
43
|
+
/**
|
|
44
|
+
* The Secret with the Database's `app` user and its `password`: written by
|
|
45
|
+
* the control plane (decision 156), or generated by CloudNativePG for a
|
|
46
|
+
* Database from before.
|
|
47
|
+
*/
|
|
11
48
|
export const databaseAppSecret = (database) => `${clusterName(database)}-app`;
|
|
49
|
+
/**
|
|
50
|
+
* The Secret with the SCRAM verifier of the `app` user's password, which
|
|
51
|
+
* the Cluster of a Database with `appCredentials` names as its application
|
|
52
|
+
* Secret (decision 156); the control plane writes both.
|
|
53
|
+
*/
|
|
54
|
+
export const databaseAppVerifierSecret = (database) => `${clusterName(database)}-app-scram`;
|
|
12
55
|
/** Where the Project's Services and Jobs reach the Database: its Pooler, inside the cluster. */
|
|
13
56
|
export const databaseConnection = (database) => ({
|
|
14
57
|
host: `${poolerName(database)}.${projectNamespace(database.projectId)}.svc.cluster.local`,
|
|
@@ -16,6 +59,15 @@ export const databaseConnection = (database) => ({
|
|
|
16
59
|
database: 'app',
|
|
17
60
|
user: 'app',
|
|
18
61
|
});
|
|
62
|
+
/**
|
|
63
|
+
* Where they reach its standby, for queries that must not load the primary
|
|
64
|
+
* and may read slightly old data (decision 157): the Database's `ro` Pooler.
|
|
65
|
+
* Nothing answers there while no standby is ready.
|
|
66
|
+
*/
|
|
67
|
+
export const databaseReadConnection = (database) => ({
|
|
68
|
+
...databaseConnection(database),
|
|
69
|
+
host: `${readPoolerName(database)}.${projectNamespace(database.projectId)}.svc.cluster.local`,
|
|
70
|
+
});
|
|
19
71
|
/**
|
|
20
72
|
* The Kubernetes Secret in a Project's namespace that holds all its Secrets'
|
|
21
73
|
* values; the control plane writes it, Services and Jobs read it with `envFrom`.
|
|
@@ -61,6 +113,18 @@ export const INTERNAL_ROUTES_PATH = '/internal/v1/routes';
|
|
|
61
113
|
export const INTERNAL_SERVICES_PATH = '/internal/v1/services';
|
|
62
114
|
/** `GET` lists every Job with its Project, for the Jobs operator. */
|
|
63
115
|
export const INTERNAL_JOBS_PATH = '/internal/v1/jobs';
|
|
116
|
+
/**
|
|
117
|
+
* For the madAuth sidecar, which passes on madAuth's events (decision 143):
|
|
118
|
+
* `DELETE <path>/<user id>` removes a user madAuth deleted from every
|
|
119
|
+
* Account; `DELETE <path>/<user id>/api-keys/<key id>` drops the Postgres
|
|
120
|
+
* roles of a key madAuth revoked. Both answer 204, also when there was
|
|
121
|
+
* nothing to do, so a retry is harmless.
|
|
122
|
+
*/
|
|
123
|
+
export const INTERNAL_USERS_PATH = '/internal/v1/users';
|
|
124
|
+
/** A madAuth user or API key id in a path: `usr_` and base64url, kept to URL-safe characters. */
|
|
125
|
+
export const MADAUTH_ID = /^[A-Za-z0-9_-]{1,128}$/;
|
|
126
|
+
export const internalUserPath = (subject) => `${INTERNAL_USERS_PATH}/${subject}`;
|
|
127
|
+
export const internalApiKeyPath = (subject, apiKeyId) => `${INTERNAL_USERS_PATH}/${subject}/api-keys/${apiKeyId}`;
|
|
64
128
|
/** An Account's usage of one month: `${INTERNAL_ACCOUNTS_PATH}/{id}/usage?month=YYYY-MM`, for the billing service. */
|
|
65
129
|
export const internalUsagePath = (accountId, month) => `${INTERNAL_ACCOUNTS_PATH}/${accountId}/usage?month=${month}`;
|
|
66
130
|
/**
|
|
@@ -70,6 +134,17 @@ export const internalUsagePath = (accountId, month) => `${INTERNAL_ACCOUNTS_PATH
|
|
|
70
134
|
* metering reads the Resource from them.
|
|
71
135
|
*/
|
|
72
136
|
export const ingressRouteName = (domainId, resource) => `domain-${domainId}-${resource.kind === 'bucket' ? 'bucket' : 'svc'}-${resource.id}`;
|
|
137
|
+
/** Every node carries its Site's id in this label (ADR-0007). */
|
|
138
|
+
export const ZONE_LABEL = 'topology.kubernetes.io/zone';
|
|
139
|
+
/** `true` on the nodes of a compute Site, where Databases, Services and Jobs run. */
|
|
140
|
+
export const COMPUTE_SITE_LABEL = 'openupstream.io/compute-site';
|
|
141
|
+
/** `true` on the nodes of the one compute Site that is the default Home site. */
|
|
142
|
+
export const DEFAULT_SITE_LABEL = 'openupstream.io/default-site';
|
|
143
|
+
/**
|
|
144
|
+
* The taint (`true`, `NoSchedule`) on every node outside the compute Sites:
|
|
145
|
+
* only etcd, Garage, Loki and the node agents tolerate it.
|
|
146
|
+
*/
|
|
147
|
+
export const QUORUM_ONLY_TAINT = 'openupstream.io/quorum-only';
|
|
73
148
|
/** On a Service's Deployment and a Job's CronJob: the spec version it was applied from (serviceSpecVersion, jobSpecVersion). */
|
|
74
149
|
export const SPEC_VERSION_ANNOTATION = 'openupstream.io/spec-version';
|
|
75
150
|
/**
|
|
@@ -111,8 +186,9 @@ export const jobSpecVersion = (row) => JSON.stringify([
|
|
|
111
186
|
* The platform's own Account, Project and Databases: the control plane's
|
|
112
187
|
* state (`database`) and madAuth's users (`authDatabase`). The bootstrap
|
|
113
188
|
* creates these Databases once; the control plane seeds these rows at
|
|
114
|
-
* startup, and from then on the operator
|
|
115
|
-
* customer's. Fixed ids, so bootstrap and control
|
|
189
|
+
* startup, in the default Site (ADR-0007), and from then on the operator
|
|
190
|
+
* reconciles them like any customer's. Fixed ids, so bootstrap and control
|
|
191
|
+
* plane agree.
|
|
116
192
|
*/
|
|
117
193
|
export const PLATFORM = {
|
|
118
194
|
account: {
|
|
@@ -130,7 +206,6 @@ export const PLATFORM = {
|
|
|
130
206
|
id: '00000000-0000-4000-8000-000000000003',
|
|
131
207
|
projectId: '00000000-0000-4000-8000-000000000002',
|
|
132
208
|
name: 'control-plane',
|
|
133
|
-
homeSite: 'hetzner-fsn1',
|
|
134
209
|
memoryMb: 512,
|
|
135
210
|
storageGb: 5,
|
|
136
211
|
autoGrow: true,
|
|
@@ -141,7 +216,6 @@ export const PLATFORM = {
|
|
|
141
216
|
id: '00000000-0000-4000-8000-000000000004',
|
|
142
217
|
projectId: '00000000-0000-4000-8000-000000000002',
|
|
143
218
|
name: 'auth',
|
|
144
|
-
homeSite: 'hetzner-fsn1',
|
|
145
219
|
memoryMb: 512,
|
|
146
220
|
storageGb: 2,
|
|
147
221
|
autoGrow: true,
|
|
@@ -153,7 +227,6 @@ export const PLATFORM = {
|
|
|
153
227
|
id: '00000000-0000-4000-8000-000000000005',
|
|
154
228
|
projectId: '00000000-0000-4000-8000-000000000002',
|
|
155
229
|
name: 'billing',
|
|
156
|
-
homeSite: 'hetzner-fsn1',
|
|
157
230
|
memoryMb: 512,
|
|
158
231
|
storageGb: 2,
|
|
159
232
|
autoGrow: true,
|
|
@@ -161,9 +234,9 @@ export const PLATFORM = {
|
|
|
161
234
|
createdAt: '2026-10-20T00:00:00Z',
|
|
162
235
|
},
|
|
163
236
|
};
|
|
164
|
-
/** The platform's Database rows, as the operator
|
|
165
|
-
export const
|
|
166
|
-
{ project: PLATFORM.project, database: PLATFORM.database },
|
|
167
|
-
{ project: PLATFORM.project, database: PLATFORM.authDatabase },
|
|
237
|
+
/** The platform's Database rows, as the bootstrap gives them to the operator: in `homeSite`, the default Site. */
|
|
238
|
+
export const platformRows = (homeSite) => [
|
|
239
|
+
{ project: PLATFORM.project, database: { ...PLATFORM.database, homeSite } },
|
|
240
|
+
{ project: PLATFORM.project, database: { ...PLATFORM.authDatabase, homeSite } },
|
|
168
241
|
];
|
|
169
242
|
//# sourceMappingURL=internal.js.map
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAa,EAAU,EAAE,CAAC,WAAW,SAAS,EAAE,CAAC;AAElF,qGAAqG;AACrG,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAA8B,EAAU,EAAE,CAAC,MAAM,QAAQ,CAAC,EAAE,EAAE,CAAC;AAE3F,kGAAkG;AAClG,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAA8B,EAAU,EAAE,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC;AAExG,
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAa,EAAU,EAAE,CAAC,WAAW,SAAS,EAAE,CAAC;AAElF,qGAAqG;AACrG,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAA8B,EAAU,EAAE,CAAC,MAAM,QAAQ,CAAC,EAAE,EAAE,CAAC;AAE3F,kGAAkG;AAClG,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAA8B,EAAU,EAAE,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC;AAExG;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAA8B,EAAU,EAAE,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC;AAEvG;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAE/C,MAAM,CAAC,MAAM,q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,EAAE,SAAS;QACf,QAAQ,EAAE,GAAG;QACb,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,IAAI;QACd,YAAY,EAAE,IAAI;QAClB,SAAS,EAAE,sBAAsB;KACpC;CAOJ,CAAC;AAEF,kHAAkH;AAClH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAc,EAAiB,EAAE,CAAC;IAC3D,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,GAAG,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE;IAC3E,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,GAAG,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,EAAE;CAClF,CAAC"}
|
package/dist/model.d.ts
CHANGED
|
@@ -6,9 +6,72 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export type Id = string;
|
|
8
8
|
export type Timestamp = string;
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
/**
|
|
10
|
+
* A Site's id: its nodes' `topology.kubernetes.io/zone` label, so a
|
|
11
|
+
* Kubernetes label value (ADR-0007). Which Sites exist is the
|
|
12
|
+
* installation's: `GET /v1/sites` lists the compute Sites, where Databases,
|
|
13
|
+
* Services and Jobs run.
|
|
14
|
+
*/
|
|
15
|
+
export type Site = string;
|
|
16
|
+
export declare const SITE_ID: RegExp;
|
|
17
|
+
/** A compute Site (`GET /v1/sites`). */
|
|
18
|
+
export interface SiteInfo {
|
|
19
|
+
id: Site;
|
|
20
|
+
/** What the installation's admins call it (e.g. `Falkenstein (Hetzner)`); null until they name it. */
|
|
21
|
+
description: string | null;
|
|
22
|
+
/** Whether it is the Home site of what is created without one. */
|
|
23
|
+
default: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* What can be wrong with the nodes' Site labels (ADR-0008): the rules the
|
|
27
|
+
* install checks, which the control plane checks again while the cluster
|
|
28
|
+
* runs. Each has an alert of its own.
|
|
29
|
+
*/
|
|
30
|
+
export declare const SITE_PROBLEMS: readonly ["node-without-site", "node-neither-compute-nor-quorum", "node-compute-and-quorum", "site-mixed-compute", "site-mixed-default", "default-site-missing", "default-site-not-unique", "default-site-not-compute", "compute-sites-below-two", "sites-below-three"];
|
|
31
|
+
export type SiteProblemKind = (typeof SITE_PROBLEMS)[number];
|
|
32
|
+
/** One thing wrong with the Site labels, and the command that fixes it. */
|
|
33
|
+
export interface SiteProblem {
|
|
34
|
+
kind: SiteProblemKind;
|
|
35
|
+
/** The node it is about; null when it is about a Site or the whole cluster. */
|
|
36
|
+
node: string | null;
|
|
37
|
+
/** The Site it is about; null when it is about the whole cluster or a node without one. */
|
|
38
|
+
site: Site | null;
|
|
39
|
+
/** What is wrong, in a sentence. */
|
|
40
|
+
message: string;
|
|
41
|
+
/** The `kubectl` command that fixes it; `<…>` marks what the operator chooses. */
|
|
42
|
+
fix: string;
|
|
43
|
+
}
|
|
44
|
+
/** A node of the cluster as its labels place it (`GET /v1/admin/nodes`). */
|
|
45
|
+
export interface NodeInfo {
|
|
46
|
+
name: string;
|
|
47
|
+
/** Its Site (its zone label); null when it has none. */
|
|
48
|
+
site: Site | null;
|
|
49
|
+
/** Labelled a node of a compute Site. */
|
|
50
|
+
compute: boolean;
|
|
51
|
+
/** Labelled a node of the default Site. */
|
|
52
|
+
default: boolean;
|
|
53
|
+
/** Tainted quorum-only: only etcd, Garage, Loki and the node agents run there. */
|
|
54
|
+
quorumOnly: boolean;
|
|
55
|
+
/** Kubernetes reports it Ready. */
|
|
56
|
+
ready: boolean;
|
|
57
|
+
createdAt: Timestamp;
|
|
58
|
+
}
|
|
59
|
+
/** A Site as the installation's admins see it: compute or not, with its description (`GET /v1/admin/nodes`). */
|
|
60
|
+
export interface SiteDetails extends SiteInfo {
|
|
61
|
+
/** Its nodes are labelled compute: Databases, Services and Jobs run there. */
|
|
62
|
+
compute: boolean;
|
|
63
|
+
}
|
|
64
|
+
/** A Site's description, set by an admin; null removes it, so the id is shown alone (ADR-0009). */
|
|
65
|
+
export interface SiteDescriptionInput {
|
|
66
|
+
description: string | null;
|
|
67
|
+
}
|
|
68
|
+
/** Every Site and node and what is wrong with the Site labels, for the installation's admins. */
|
|
69
|
+
export interface NodesReport {
|
|
70
|
+
/** Every Site that has a node, by id. */
|
|
71
|
+
sites: SiteDetails[];
|
|
72
|
+
nodes: NodeInfo[];
|
|
73
|
+
problems: SiteProblem[];
|
|
74
|
+
}
|
|
12
75
|
/** The customer: pays, receives one invoice, owns Projects. */
|
|
13
76
|
export interface Account {
|
|
14
77
|
id: Id;
|
|
@@ -19,7 +82,16 @@ export interface Account {
|
|
|
19
82
|
* empty when it may. Existing Resources keep running.
|
|
20
83
|
*/
|
|
21
84
|
holds: string[];
|
|
85
|
+
/** The caller's role in the Account (`GET /v1/accounts`); null without one. */
|
|
86
|
+
role?: MemberRole | null;
|
|
22
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* What a Member may do in the whole Account (decision 138): `owner`
|
|
90
|
+
* everything, the Account's Members included; `developer` every Project and
|
|
91
|
+
* everything in it.
|
|
92
|
+
*/
|
|
93
|
+
export declare const MEMBER_ROLES: readonly ["owner", "developer"];
|
|
94
|
+
export type MemberRole = (typeof MEMBER_ROLES)[number];
|
|
23
95
|
/** A person who can sign in to an Account. Sign-in is madAuth's. */
|
|
24
96
|
export interface Member {
|
|
25
97
|
id: Id;
|
|
@@ -27,8 +99,94 @@ export interface Member {
|
|
|
27
99
|
/** The madAuth subject this Member signs in as. */
|
|
28
100
|
authSubject: string;
|
|
29
101
|
email: string;
|
|
102
|
+
/** null: the Member reaches only what their grants give them. */
|
|
103
|
+
role: MemberRole | null;
|
|
104
|
+
/** Their grants, oldest first; they count only while the Member has no role (decision 139). */
|
|
105
|
+
grants: Grant[];
|
|
30
106
|
createdAt: Timestamp;
|
|
31
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Changes a Member's role; only an owner may, with a session or `oup login`,
|
|
110
|
+
* never an API key. null leaves them only their grants: their Postgres roles
|
|
111
|
+
* above what the grants allow are dropped (decision 143).
|
|
112
|
+
*/
|
|
113
|
+
export interface MemberPatch {
|
|
114
|
+
role: MemberRole | null;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Access for one Member to one Database at a level (decision 139): they see
|
|
118
|
+
* the Database and its Project's name and open `oup pg proxy` at that level
|
|
119
|
+
* or below (decision 140), nothing else of the Project. A Member with a role
|
|
120
|
+
* needs none.
|
|
121
|
+
*/
|
|
122
|
+
export interface Grant {
|
|
123
|
+
databaseId: Id;
|
|
124
|
+
databaseName: string;
|
|
125
|
+
projectId: Id;
|
|
126
|
+
projectName: string;
|
|
127
|
+
access: DatabaseAccess;
|
|
128
|
+
createdAt: Timestamp;
|
|
129
|
+
}
|
|
130
|
+
/** Gives a Member or an Account token a grant, or another level; owners only, never with an API key. */
|
|
131
|
+
export interface GrantInput {
|
|
132
|
+
access: DatabaseAccess;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* What an Account token may do in the whole Account (decision 144):
|
|
136
|
+
* `developer`, as a Member with that role; never `owner`, so a token
|
|
137
|
+
* cannot manage the Account.
|
|
138
|
+
*/
|
|
139
|
+
export declare const ACCOUNT_TOKEN_ROLES: readonly ["developer"];
|
|
140
|
+
export type AccountTokenRole = (typeof ACCOUNT_TOKEN_ROLES)[number];
|
|
141
|
+
/** How an Account token's secret starts; `oup` and the SDK send it like an API key (`OUP_API_KEY`). */
|
|
142
|
+
export declare const ACCOUNT_TOKEN_PREFIX = "oup_tok_";
|
|
143
|
+
/** An Account token expires at most this many days after it is created or rolled. */
|
|
144
|
+
export declare const ACCOUNT_TOKEN_MAX_DAYS = 365;
|
|
145
|
+
/**
|
|
146
|
+
* A named secret that belongs to the Account, not to a person, for CI, BI
|
|
147
|
+
* tools and scripts outside the platform (decision 144). It has the
|
|
148
|
+
* developer role or grants, and keeps working when the Member who made it
|
|
149
|
+
* leaves. The secret is shown once, when it is created or rolled.
|
|
150
|
+
*/
|
|
151
|
+
export interface AccountToken {
|
|
152
|
+
id: Id;
|
|
153
|
+
accountId: Id;
|
|
154
|
+
/** DNS label, unique within the Account. */
|
|
155
|
+
name: string;
|
|
156
|
+
/** null: the token reaches only what its grants give. */
|
|
157
|
+
role: AccountTokenRole | null;
|
|
158
|
+
/** Its grants, oldest first; they count only while the token has no role. */
|
|
159
|
+
grants: Grant[];
|
|
160
|
+
expiresAt: Timestamp;
|
|
161
|
+
/** The last request made with it, to the minute; null if none yet. */
|
|
162
|
+
lastUsedAt: Timestamp | null;
|
|
163
|
+
createdAt: Timestamp;
|
|
164
|
+
}
|
|
165
|
+
/** A new Account token; owners only, with a session or `oup login`. */
|
|
166
|
+
export interface AccountTokenInput {
|
|
167
|
+
name: string;
|
|
168
|
+
/** Default null: only its grants, given afterwards. */
|
|
169
|
+
role?: AccountTokenRole | null;
|
|
170
|
+
/** In the future, at most ACCOUNT_TOKEN_MAX_DAYS away. */
|
|
171
|
+
expiresAt: Timestamp;
|
|
172
|
+
}
|
|
173
|
+
/** Renames an Account token or changes its role; a lost role drops its Postgres roles its grants do not allow. */
|
|
174
|
+
export interface AccountTokenPatch {
|
|
175
|
+
name?: string;
|
|
176
|
+
role?: AccountTokenRole | null;
|
|
177
|
+
}
|
|
178
|
+
/** A new secret for an Account token, with a new expiry; its name, rights and Postgres roles stay. */
|
|
179
|
+
export interface AccountTokenRoll {
|
|
180
|
+
/** In the future, at most ACCOUNT_TOKEN_MAX_DAYS away. */
|
|
181
|
+
expiresAt: Timestamp;
|
|
182
|
+
}
|
|
183
|
+
/** The answer to creating or rolling an Account token: the only time its secret is shown. */
|
|
184
|
+
export interface AccountTokenWithSecret extends AccountToken {
|
|
185
|
+
/** `oup_tok_…`. */
|
|
186
|
+
secret: string;
|
|
187
|
+
/** After a roll: until when the previous secret still works (24 hours at most); absent when none does. */
|
|
188
|
+
previousSecretValidUntil?: Timestamp;
|
|
189
|
+
}
|
|
32
190
|
/** The unit of isolation and lifecycle; deleting it deletes everything in it. */
|
|
33
191
|
export interface Project {
|
|
34
192
|
id: Id;
|
|
@@ -87,7 +245,7 @@ export interface ProjectInput {
|
|
|
87
245
|
name: string;
|
|
88
246
|
}
|
|
89
247
|
/**
|
|
90
|
-
* Creates a Database; homeSite defaults to `
|
|
248
|
+
* Creates a Database; homeSite defaults to the default Site (`GET /v1/sites`). With
|
|
91
249
|
* `restoreFrom`, it starts as a copy of that Database instead of empty.
|
|
92
250
|
*/
|
|
93
251
|
export interface DatabaseInput {
|
|
@@ -139,6 +297,40 @@ export interface DatabaseConnection {
|
|
|
139
297
|
export interface DatabaseDetails extends Database {
|
|
140
298
|
state: DatabaseState;
|
|
141
299
|
connection: DatabaseConnection;
|
|
300
|
+
/**
|
|
301
|
+
* Where the Project's Services and Jobs reach the Database's standby,
|
|
302
|
+
* read-only (decision 157): for queries that must not load the primary
|
|
303
|
+
* and may read data a moment old. They get it as
|
|
304
|
+
* `DATABASE_READ_URL_<NAME>`, the oldest Database's also as
|
|
305
|
+
* `DATABASE_READ_URL`. Connections fail while no standby is ready (a
|
|
306
|
+
* restart of the standby; after a failover until the other Site is
|
|
307
|
+
* back), and always on an installation with a single node.
|
|
308
|
+
*/
|
|
309
|
+
readConnection: DatabaseConnection;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* How much a caller's own Postgres role may do through `oup pg proxy`
|
|
313
|
+
* (decision 126, ADR-0005): read every table; also write rows; or act as
|
|
314
|
+
* `app`, the role the Project's Services connect as, so migrations work.
|
|
315
|
+
*/
|
|
316
|
+
export declare const DATABASE_ACCESS_LEVELS: readonly ["read", "write", "owner"];
|
|
317
|
+
export type DatabaseAccess = (typeof DATABASE_ACCESS_LEVELS)[number];
|
|
318
|
+
/** Asks for the caller's role at a level; `read` when none is given. */
|
|
319
|
+
export interface DatabaseProxyInput {
|
|
320
|
+
access?: DatabaseAccess;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* The caller's own role for a Database at one level, and the tunnel that
|
|
324
|
+
* reaches it: `oup pg proxy` carries local connections through `tunnelUrl`
|
|
325
|
+
* (a WebSocket, with the caller's token) and the client logs in as `user`
|
|
326
|
+
* with `password`. The same role and password every time it is asked.
|
|
327
|
+
*/
|
|
328
|
+
export interface DatabaseProxy {
|
|
329
|
+
access: DatabaseAccess;
|
|
330
|
+
user: string;
|
|
331
|
+
password: string;
|
|
332
|
+
database: string;
|
|
333
|
+
tunnelUrl: string;
|
|
142
334
|
}
|
|
143
335
|
/**
|
|
144
336
|
* A Bucket's name: a hostname label of 3 to 63 lowercase letters, digits
|
|
@@ -223,7 +415,7 @@ export interface Service {
|
|
|
223
415
|
port: number | null;
|
|
224
416
|
/**
|
|
225
417
|
* Where a single replica runs; null: the Home site of the Project's oldest
|
|
226
|
-
* Database, or
|
|
418
|
+
* Database, or the default Site. Two or more replicas spread over the compute Sites.
|
|
227
419
|
*/
|
|
228
420
|
homeSite: Site | null;
|
|
229
421
|
/** Whether the image is pulled with registry credentials. */
|
|
@@ -312,7 +504,7 @@ export interface Job {
|
|
|
312
504
|
schedule: string | null;
|
|
313
505
|
/** IANA time zone the schedule is read in, e.g. `Europe/Berlin`; null: UTC. */
|
|
314
506
|
timeZone: string | null;
|
|
315
|
-
/** Where its runs go; null: the Home site of the Project's oldest Database, or
|
|
507
|
+
/** Where its runs go; null: the Home site of the Project's oldest Database, or the default Site. */
|
|
316
508
|
homeSite: Site | null;
|
|
317
509
|
/** Whether the image is pulled with registry credentials. */
|
|
318
510
|
registryAuth: boolean;
|
package/dist/model.js
CHANGED
|
@@ -4,8 +4,40 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Ids are UUIDs, timestamps RFC 3339 strings.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
export const SITE_ID = /^[A-Za-z0-9]([-A-Za-z0-9_.]{0,61}[A-Za-z0-9])?$/;
|
|
8
|
+
/**
|
|
9
|
+
* What can be wrong with the nodes' Site labels (ADR-0008): the rules the
|
|
10
|
+
* install checks, which the control plane checks again while the cluster
|
|
11
|
+
* runs. Each has an alert of its own.
|
|
12
|
+
*/
|
|
13
|
+
export const SITE_PROBLEMS = [
|
|
14
|
+
'node-without-site',
|
|
15
|
+
'node-neither-compute-nor-quorum',
|
|
16
|
+
'node-compute-and-quorum',
|
|
17
|
+
'site-mixed-compute',
|
|
18
|
+
'site-mixed-default',
|
|
19
|
+
'default-site-missing',
|
|
20
|
+
'default-site-not-unique',
|
|
21
|
+
'default-site-not-compute',
|
|
22
|
+
'compute-sites-below-two',
|
|
23
|
+
'sites-below-three',
|
|
24
|
+
];
|
|
25
|
+
/**
|
|
26
|
+
* What a Member may do in the whole Account (decision 138): `owner`
|
|
27
|
+
* everything, the Account's Members included; `developer` every Project and
|
|
28
|
+
* everything in it.
|
|
29
|
+
*/
|
|
30
|
+
export const MEMBER_ROLES = ['owner', 'developer'];
|
|
31
|
+
/**
|
|
32
|
+
* What an Account token may do in the whole Account (decision 144):
|
|
33
|
+
* `developer`, as a Member with that role; never `owner`, so a token
|
|
34
|
+
* cannot manage the Account.
|
|
35
|
+
*/
|
|
36
|
+
export const ACCOUNT_TOKEN_ROLES = ['developer'];
|
|
37
|
+
/** How an Account token's secret starts; `oup` and the SDK send it like an API key (`OUP_API_KEY`). */
|
|
38
|
+
export const ACCOUNT_TOKEN_PREFIX = 'oup_tok_';
|
|
39
|
+
/** An Account token expires at most this many days after it is created or rolled. */
|
|
40
|
+
export const ACCOUNT_TOKEN_MAX_DAYS = 365;
|
|
9
41
|
/** Postgres always runs with at least this much memory. */
|
|
10
42
|
export const DATABASE_MIN_MEMORY_MB = 256;
|
|
11
43
|
/**
|
|
@@ -17,6 +49,12 @@ export const API_KEY_SCOPES = {
|
|
|
17
49
|
read: 'openupstream:read',
|
|
18
50
|
write: 'openupstream:write',
|
|
19
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* How much a caller's own Postgres role may do through `oup pg proxy`
|
|
54
|
+
* (decision 126, ADR-0005): read every table; also write rows; or act as
|
|
55
|
+
* `app`, the role the Project's Services connect as, so migrations work.
|
|
56
|
+
*/
|
|
57
|
+
export const DATABASE_ACCESS_LEVELS = ['read', 'write', 'owner'];
|
|
20
58
|
/**
|
|
21
59
|
* A Bucket's name: a hostname label of 3 to 63 lowercase letters, digits
|
|
22
60
|
* and hyphens, neither starting nor ending with a hyphen.
|
package/dist/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,MAAM,CAAC,MAAM,OAAO,GAAG,iDAAiD,CAAC;AAWzE;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,mBAAmB;IACnB,iCAAiC;IACjC,yBAAyB;IACzB,oBAAoB;IACpB,oBAAoB;IACpB,sBAAsB;IACtB,yBAAyB;IACzB,0BAA0B;IAC1B,yBAAyB;IACzB,mBAAmB;CACb,CAAC;AAiEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,WAAW,CAAU,CAAC;AA8C5D;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,WAAW,CAAU,CAAC;AAG1D,uGAAuG;AACvG,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;AAE/C,qFAAqF;AACrF,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AA6D1C,2DAA2D;AAC3D,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAsC1C;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,IAAI,EAAE,mBAAmB;IACzB,KAAK,EAAE,oBAAoB;CACrB,CAAC;AA6EX;;;;GAIG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