@chisquare-tech/origine-ngx-apps-services 0.2.4 → 0.3.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chisquare-tech/origine-ngx-apps-services",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Origine's Services module screens: managed Postgres, MySQL and Valkey — the list with quota, the create wizard, and the instance page (connection details, attachments, databases and users, backups and PITR, metrics, logs, settings).",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,16 +8,24 @@ interface ServicesProject {
|
|
|
8
8
|
id: string;
|
|
9
9
|
key: string;
|
|
10
10
|
name: string;
|
|
11
|
-
/** The
|
|
12
|
-
capabilities: string[];
|
|
13
|
-
/** The organization's region, as the wizard shows it ("EU · Frankfurt"). */
|
|
11
|
+
/** The organization's region, the default for a new service, as the wizard shows it ("EU · Frankfurt"). */
|
|
14
12
|
region?: string;
|
|
15
13
|
archivedAt?: string;
|
|
16
14
|
}
|
|
15
|
+
/** A region a new service can run in (D-54), as the host offers it. */
|
|
16
|
+
interface ServicesRegion {
|
|
17
|
+
id: string;
|
|
18
|
+
/** Its name as the organization's screens show it ("EU · Frankfurt"). */
|
|
19
|
+
name: string;
|
|
20
|
+
/** The organization's region: a new service's default. */
|
|
21
|
+
default?: boolean;
|
|
22
|
+
}
|
|
17
23
|
/** An app services can be attached to, with the environments it runs in. */
|
|
18
24
|
interface ServicesApp {
|
|
19
25
|
name: string;
|
|
20
26
|
environments: string[];
|
|
27
|
+
/** The region each environment runs in, by environment (D-54), when deploy says. */
|
|
28
|
+
regions?: Record<string, string>;
|
|
21
29
|
}
|
|
22
30
|
/**
|
|
23
31
|
* What the Services screens need from the app that mounts them (cloud/web provides it, as it
|
|
@@ -27,6 +35,16 @@ interface ServicesApp {
|
|
|
27
35
|
declare abstract class ServicesHost {
|
|
28
36
|
abstract readonly project: Signal<ServicesProject | null>;
|
|
29
37
|
abstract readonly projectLoaded: Signal<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the caller holds capability id on the project (V4-01): for every environment, or for a
|
|
40
|
+
* protected or unprotected one. An instance's own page reads Detail.caps, for its environment.
|
|
41
|
+
*/
|
|
42
|
+
abstract can(id: string, env?: 'protected' | 'unprotected'): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The regions on offer for a new service, the organization's marked default (D-54). With none or
|
|
45
|
+
* one there is nothing to pick, and the wizard shows the region as text.
|
|
46
|
+
*/
|
|
47
|
+
regions?(): ServicesRegion[];
|
|
30
48
|
/** A router link to a path inside the current project ('' is its overview). */
|
|
31
49
|
abstract link(path?: string): string[];
|
|
32
50
|
/** The project's apps; empty when there are none (attaching then takes a typed name). */
|
|
@@ -150,6 +168,9 @@ interface Summary {
|
|
|
150
168
|
purgeAt?: string;
|
|
151
169
|
nodes: number;
|
|
152
170
|
fork: boolean;
|
|
171
|
+
/** Where it runs (D-54): picked at creation, the organization's region by default. */
|
|
172
|
+
region?: string;
|
|
173
|
+
regionName?: string;
|
|
153
174
|
}
|
|
154
175
|
interface ServiceList {
|
|
155
176
|
items: Summary[];
|
|
@@ -167,6 +188,10 @@ interface UserView {
|
|
|
167
188
|
rotating: boolean;
|
|
168
189
|
attached: string[];
|
|
169
190
|
createdAt: string;
|
|
191
|
+
/** Its scheduled rotation: every rotateEveryDays days (0: none), next on nextRotation. */
|
|
192
|
+
rotateEveryDays: number;
|
|
193
|
+
rotatedAt?: string;
|
|
194
|
+
nextRotation?: string;
|
|
170
195
|
}
|
|
171
196
|
interface Backup {
|
|
172
197
|
name: string;
|
|
@@ -252,7 +277,8 @@ interface Detail extends Summary {
|
|
|
252
277
|
restoreBackup?: string;
|
|
253
278
|
provisionedAt?: string;
|
|
254
279
|
finalBackup: boolean;
|
|
255
|
-
|
|
280
|
+
/** The services capability ids the caller holds on this instance's environment (V4-01). */
|
|
281
|
+
caps: string[];
|
|
256
282
|
standby: boolean;
|
|
257
283
|
replicas: number;
|
|
258
284
|
readyNodes: number;
|
|
@@ -340,6 +366,8 @@ interface CreateInput {
|
|
|
340
366
|
version?: string;
|
|
341
367
|
plan: string;
|
|
342
368
|
environment?: string;
|
|
369
|
+
/** The region it runs in (D-54): one of the regions on offer; the organization's when left out. */
|
|
370
|
+
region?: string;
|
|
343
371
|
database?: string;
|
|
344
372
|
backupHour?: number;
|
|
345
373
|
retentionDays?: number;
|
|
@@ -382,6 +410,8 @@ declare class ServicesApi {
|
|
|
382
410
|
removeDatabase(project: string, id: string, name: string): Observable<unknown>;
|
|
383
411
|
addUser(project: string, id: string, name: string, preset: string): Observable<unknown>;
|
|
384
412
|
removeUser(project: string, id: string, name: string): Observable<unknown>;
|
|
413
|
+
/** A user's scheduled rotation: every 30 to 365 days, or 0 for none (V0-22). */
|
|
414
|
+
setRotation(project: string, id: string, user: string, rotateEveryDays: number): Observable<Detail>;
|
|
385
415
|
rotate(project: string, id: string, user?: string, graceMinutes?: number): Observable<Rotation>;
|
|
386
416
|
retire(project: string, id: string, rotation: string): Observable<unknown>;
|
|
387
417
|
backupNow(project: string, id: string): Observable<unknown>;
|
|
@@ -493,6 +523,7 @@ declare class ServicesListPage {
|
|
|
493
523
|
protected readonly backups: typeof backupsLine;
|
|
494
524
|
protected readonly price: typeof money;
|
|
495
525
|
protected readonly rows: _angular_core.Signal<Summary[]>;
|
|
526
|
+
/** services.instance.create in some environment (V4-01). */
|
|
496
527
|
protected readonly canManage: _angular_core.Signal<boolean>;
|
|
497
528
|
protected readonly quotaLine: _angular_core.Signal<string>;
|
|
498
529
|
private readonly route;
|
|
@@ -538,13 +569,16 @@ declare class ServicesNewPage {
|
|
|
538
569
|
protected readonly attach: _angular_core.WritableSignal<string>;
|
|
539
570
|
protected readonly hour: _angular_core.WritableSignal<number>;
|
|
540
571
|
protected readonly ha: _angular_core.WritableSignal<boolean>;
|
|
541
|
-
protected readonly nodes: _angular_core.Signal<
|
|
572
|
+
protected readonly nodes: _angular_core.Signal<2 | 1 | 3>;
|
|
542
573
|
protected readonly haLabel: _angular_core.Signal<string>;
|
|
543
574
|
protected readonly keep: _angular_core.WritableSignal<number>;
|
|
544
575
|
protected readonly busy: _angular_core.WritableSignal<boolean>;
|
|
545
576
|
protected readonly error: _angular_core.WritableSignal<string>;
|
|
546
577
|
protected readonly engines: _angular_core.Signal<Engine[]>;
|
|
547
578
|
protected readonly plans: _angular_core.Signal<Plan[]>;
|
|
579
|
+
/** The regions on offer (D-54), the organization's picked for you; with one, the region is text. */
|
|
580
|
+
protected readonly regions: _angular_core.Signal<_chisquare_tech_origine_ngx_apps_services.ServicesRegion[]>;
|
|
581
|
+
protected readonly regionId: _angular_core.WritableSignal<string>;
|
|
548
582
|
protected readonly region: _angular_core.Signal<string>;
|
|
549
583
|
protected readonly versionLabel: _angular_core.Signal<string>;
|
|
550
584
|
protected readonly envs: _angular_core.Signal<string[]>;
|
|
@@ -651,7 +685,13 @@ declare class ServicePage {
|
|
|
651
685
|
protected readonly engine: _angular_core.Signal<Engine | null>;
|
|
652
686
|
protected readonly envVar: _angular_core.Signal<string>;
|
|
653
687
|
protected readonly plans: _angular_core.Signal<Plan[]>;
|
|
688
|
+
/** Where the instance runs (D-54): its own region, the organization's by default. */
|
|
654
689
|
protected readonly region: _angular_core.Signal<string>;
|
|
690
|
+
/** The region of the chosen app's chosen environment, when deploy says (D-54). */
|
|
691
|
+
protected readonly attRegion: _angular_core.Signal<string>;
|
|
692
|
+
/** An app attaches only to a service in its own region (D-54). */
|
|
693
|
+
protected readonly attOtherRegion: _angular_core.Signal<boolean>;
|
|
694
|
+
protected readonly rotationPeriods: number[];
|
|
655
695
|
protected readonly conn: _angular_core.Signal<_chisquare_tech_origine_ngx_apps_services.Connection | null>;
|
|
656
696
|
protected readonly snippetKeys: _angular_core.Signal<string[]>;
|
|
657
697
|
protected readonly backups: _angular_core.Signal<Backup[]>;
|
|
@@ -684,6 +724,14 @@ declare class ServicePage {
|
|
|
684
724
|
protected dialogTitle(dl: Dialog, d: Detail): string;
|
|
685
725
|
private run;
|
|
686
726
|
protected toggleReveal(d: Detail): void;
|
|
727
|
+
/** Whether the caller holds capability id on the instance's environment (V4-01). */
|
|
728
|
+
protected has(d: Detail, id: string): boolean;
|
|
729
|
+
/** A user's scheduled rotation (V0-22): every 30 to 365 days, or never. */
|
|
730
|
+
protected setRotation(d: Detail, user: string, days: number): void;
|
|
731
|
+
protected rotationLine(u: {
|
|
732
|
+
rotateEveryDays: number;
|
|
733
|
+
nextRotation?: string;
|
|
734
|
+
}): string;
|
|
687
735
|
protected attach(d: Detail): void;
|
|
688
736
|
protected detach(d: Detail, a: Attachment): void;
|
|
689
737
|
protected askRotate(d: Detail): void;
|
|
@@ -802,7 +850,9 @@ declare class ServiceConsoleTab {
|
|
|
802
850
|
private readonly api;
|
|
803
851
|
readonly d: _angular_core.InputSignal<Detail>;
|
|
804
852
|
readonly projectKey: _angular_core.InputSignal<string>;
|
|
805
|
-
|
|
853
|
+
/** The console and the inspector need services.connect on the instance's environment (V4-01). */
|
|
854
|
+
protected readonly may: _angular_core.Signal<boolean>;
|
|
855
|
+
readonly kind: _angular_core.InputSignal<"sql" | "keys" | "streams" | "queues">;
|
|
806
856
|
protected readonly sql: _angular_core.Signal<boolean>;
|
|
807
857
|
protected readonly running: _angular_core.Signal<boolean>;
|
|
808
858
|
protected readonly runsAs: _angular_core.Signal<string>;
|
|
@@ -833,6 +883,8 @@ declare class ServiceDumpsCard {
|
|
|
833
883
|
private readonly router;
|
|
834
884
|
readonly d: _angular_core.InputSignal<Detail>;
|
|
835
885
|
readonly projectKey: _angular_core.InputSignal<string>;
|
|
886
|
+
/** Whether the caller holds capability id on the instance's environment (V4-01). */
|
|
887
|
+
protected may(id: string): boolean;
|
|
836
888
|
readonly dumps: _angular_core.InputSignal<boolean>;
|
|
837
889
|
readonly done: _angular_core.OutputEmitterRef<string>;
|
|
838
890
|
readonly failed: _angular_core.OutputEmitterRef<string>;
|
|
@@ -857,4 +909,4 @@ declare class ServiceDumpsCard {
|
|
|
857
909
|
}
|
|
858
910
|
|
|
859
911
|
export { DAYS, ENGINE_COLOUR, HIDDEN_POLL_MS, LIFECYCLE, PRESETS, ServiceConsoleTab, ServiceDumpsCard, ServiceLogsTab, ServiceMetricsTab, ServicePage, ServicesApi, ServicesHost, ServicesListPage, ServicesNewPage, apiMessage, backupKind, backupsLine, bytes, fromLocalInput, hhmm, hhmmss, money, moving, num, pct, pollDelay, presetChip, ratio, shortDate, spark, sparkPath, stateChip, stateDot, toLocalInput, utcHour, when };
|
|
860
|
-
export type { Attachment, Backup, Catalog, Connection, CreateInput, Database, Detail, Dump, Engine, EngineVersion, Figure, Gauge, Inspection, LogKind, LogLine, Logs, ManagementLink, Metrics, Param, Plan, PodView, QueryResult, Quota, Revealed, Rotation, ServiceList, ServicesApp, ServicesProject, State, Stream, Summary, UpdateInput, UserView };
|
|
912
|
+
export type { Attachment, Backup, Catalog, Connection, CreateInput, Database, Detail, Dump, Engine, EngineVersion, Figure, Gauge, Inspection, LogKind, LogLine, Logs, ManagementLink, Metrics, Param, Plan, PodView, QueryResult, Quota, Revealed, Rotation, ServiceList, ServicesApp, ServicesProject, ServicesRegion, State, Stream, Summary, UpdateInput, UserView };
|