@chisquare-tech/origine-ngx-apps-services 0.2.4 → 0.4.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.4.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). */
|
|
@@ -60,6 +78,11 @@ interface Engine {
|
|
|
60
78
|
dumps?: boolean;
|
|
61
79
|
console: 'sql' | 'keys' | 'streams' | 'queues';
|
|
62
80
|
parameters: Param[];
|
|
81
|
+
/** The extensions a database may create (Postgres, D-30). */
|
|
82
|
+
extensions?: {
|
|
83
|
+
name: string;
|
|
84
|
+
description: string;
|
|
85
|
+
}[];
|
|
63
86
|
}
|
|
64
87
|
interface Param {
|
|
65
88
|
engine: string;
|
|
@@ -150,6 +173,9 @@ interface Summary {
|
|
|
150
173
|
purgeAt?: string;
|
|
151
174
|
nodes: number;
|
|
152
175
|
fork: boolean;
|
|
176
|
+
/** Where it runs (D-54): picked at creation, the organization's region by default. */
|
|
177
|
+
region?: string;
|
|
178
|
+
regionName?: string;
|
|
153
179
|
}
|
|
154
180
|
interface ServiceList {
|
|
155
181
|
items: Summary[];
|
|
@@ -159,6 +185,67 @@ interface Database {
|
|
|
159
185
|
name: string;
|
|
160
186
|
createdBy: string;
|
|
161
187
|
createdAt: string;
|
|
188
|
+
/** Postgres extensions asked for in it (V8-04), each created once the cell reports it. */
|
|
189
|
+
extensions?: {
|
|
190
|
+
name: string;
|
|
191
|
+
created: boolean;
|
|
192
|
+
}[];
|
|
193
|
+
}
|
|
194
|
+
/** A major version upgrade (V8-01). */
|
|
195
|
+
interface Upgrade {
|
|
196
|
+
id: string;
|
|
197
|
+
from: string;
|
|
198
|
+
to: string;
|
|
199
|
+
method: 'in-place' | 'new-instance' | string;
|
|
200
|
+
state: 'scheduled' | 'backing-up' | 'upgrading' | 'testing' | 'ready' | 'done' | 'failed' | 'canceled' | string;
|
|
201
|
+
at: string;
|
|
202
|
+
scheduled: boolean;
|
|
203
|
+
backup: string;
|
|
204
|
+
backupName?: string;
|
|
205
|
+
target?: string;
|
|
206
|
+
targetName?: string;
|
|
207
|
+
message?: string;
|
|
208
|
+
startedAt?: string;
|
|
209
|
+
finishedAt?: string;
|
|
210
|
+
}
|
|
211
|
+
interface UpgradeView {
|
|
212
|
+
current?: Upgrade;
|
|
213
|
+
offer: {
|
|
214
|
+
to?: string;
|
|
215
|
+
methods: string[];
|
|
216
|
+
refused?: string;
|
|
217
|
+
notes: string[];
|
|
218
|
+
};
|
|
219
|
+
running?: string;
|
|
220
|
+
}
|
|
221
|
+
/** Backup copies in another region (V8-02). */
|
|
222
|
+
interface CopyView {
|
|
223
|
+
region: string;
|
|
224
|
+
regionName: string;
|
|
225
|
+
last?: {
|
|
226
|
+
region: string;
|
|
227
|
+
at: string;
|
|
228
|
+
objects: number;
|
|
229
|
+
bytes: number;
|
|
230
|
+
copied: number;
|
|
231
|
+
deleted: number;
|
|
232
|
+
error?: string;
|
|
233
|
+
through?: string;
|
|
234
|
+
};
|
|
235
|
+
offered: {
|
|
236
|
+
id: string;
|
|
237
|
+
name: string;
|
|
238
|
+
}[];
|
|
239
|
+
}
|
|
240
|
+
/** Storage auto-grow (V8-04). */
|
|
241
|
+
interface StorageView {
|
|
242
|
+
autoGrow: boolean;
|
|
243
|
+
maxGb: number;
|
|
244
|
+
limitGb: number;
|
|
245
|
+
expandable?: boolean;
|
|
246
|
+
message?: string;
|
|
247
|
+
grownAt?: string;
|
|
248
|
+
atPercent: number;
|
|
162
249
|
}
|
|
163
250
|
interface UserView {
|
|
164
251
|
name: string;
|
|
@@ -167,6 +254,10 @@ interface UserView {
|
|
|
167
254
|
rotating: boolean;
|
|
168
255
|
attached: string[];
|
|
169
256
|
createdAt: string;
|
|
257
|
+
/** Its scheduled rotation: every rotateEveryDays days (0: none), next on nextRotation. */
|
|
258
|
+
rotateEveryDays: number;
|
|
259
|
+
rotatedAt?: string;
|
|
260
|
+
nextRotation?: string;
|
|
170
261
|
}
|
|
171
262
|
interface Backup {
|
|
172
263
|
name: string;
|
|
@@ -252,7 +343,8 @@ interface Detail extends Summary {
|
|
|
252
343
|
restoreBackup?: string;
|
|
253
344
|
provisionedAt?: string;
|
|
254
345
|
finalBackup: boolean;
|
|
255
|
-
|
|
346
|
+
/** The services capability ids the caller holds on this instance's environment (V4-01). */
|
|
347
|
+
caps: string[];
|
|
256
348
|
standby: boolean;
|
|
257
349
|
replicas: number;
|
|
258
350
|
readyNodes: number;
|
|
@@ -276,6 +368,10 @@ interface Detail extends Summary {
|
|
|
276
368
|
/** RabbitMQ: what the caller's role opens of the management UI. */
|
|
277
369
|
management?: 'admin' | 'read' | '';
|
|
278
370
|
restoreVolumes?: boolean;
|
|
371
|
+
upgrade?: UpgradeView;
|
|
372
|
+
copy?: CopyView;
|
|
373
|
+
storage?: StorageView;
|
|
374
|
+
restoreCopy?: boolean;
|
|
279
375
|
}
|
|
280
376
|
interface Revealed {
|
|
281
377
|
user: string;
|
|
@@ -340,6 +436,8 @@ interface CreateInput {
|
|
|
340
436
|
version?: string;
|
|
341
437
|
plan: string;
|
|
342
438
|
environment?: string;
|
|
439
|
+
/** The region it runs in (D-54): one of the regions on offer; the organization's when left out. */
|
|
440
|
+
region?: string;
|
|
343
441
|
database?: string;
|
|
344
442
|
backupHour?: number;
|
|
345
443
|
retentionDays?: number;
|
|
@@ -364,6 +462,11 @@ interface UpdateInput {
|
|
|
364
462
|
standby?: boolean;
|
|
365
463
|
replicas?: number;
|
|
366
464
|
parameters?: Record<string, string>;
|
|
465
|
+
/** V8-02: the region backups are copied to ('' stops copying and deletes the copies). */
|
|
466
|
+
copyRegion?: string;
|
|
467
|
+
/** V8-04: storage auto-grow and its cap in GB (0: the limit). */
|
|
468
|
+
autoGrow?: boolean;
|
|
469
|
+
autoGrowMaxGb?: number;
|
|
367
470
|
}
|
|
368
471
|
declare function apiMessage(err: any, fallback?: string): string;
|
|
369
472
|
declare class ServicesApi {
|
|
@@ -382,17 +485,29 @@ declare class ServicesApi {
|
|
|
382
485
|
removeDatabase(project: string, id: string, name: string): Observable<unknown>;
|
|
383
486
|
addUser(project: string, id: string, name: string, preset: string): Observable<unknown>;
|
|
384
487
|
removeUser(project: string, id: string, name: string): Observable<unknown>;
|
|
488
|
+
/** A user's scheduled rotation: every 30 to 365 days, or 0 for none (V0-22). */
|
|
489
|
+
setRotation(project: string, id: string, user: string, rotateEveryDays: number): Observable<Detail>;
|
|
385
490
|
rotate(project: string, id: string, user?: string, graceMinutes?: number): Observable<Rotation>;
|
|
386
491
|
retire(project: string, id: string, rotation: string): Observable<unknown>;
|
|
387
492
|
backupNow(project: string, id: string): Observable<unknown>;
|
|
388
493
|
deleteBackup(project: string, id: string, name: string): Observable<unknown>;
|
|
389
494
|
/** A link to a RabbitMQ instance's management UI, for the caller only (read-only for Developers). */
|
|
390
495
|
management(project: string, id: string): Observable<ManagementLink>;
|
|
496
|
+
/** A major version upgrade (V8-01): in place or into a new instance, now or in the maintenance window. */
|
|
497
|
+
upgrade(project: string, id: string, body: {
|
|
498
|
+
version?: string;
|
|
499
|
+
method: string;
|
|
500
|
+
when: 'now' | 'window';
|
|
501
|
+
}): Observable<Detail>;
|
|
502
|
+
cancelUpgrade(project: string, id: string): Observable<Detail>;
|
|
503
|
+
addExtension(project: string, id: string, database: string, name: string): Observable<Detail>;
|
|
504
|
+
removeExtension(project: string, id: string, database: string, name: string): Observable<Detail>;
|
|
391
505
|
restore(project: string, id: string, body: {
|
|
392
506
|
pointInTime?: string;
|
|
393
507
|
backup?: string;
|
|
394
508
|
name?: string;
|
|
395
509
|
volumes?: boolean;
|
|
510
|
+
region?: string;
|
|
396
511
|
}): Observable<Detail>;
|
|
397
512
|
attach(project: string, id: string, body: {
|
|
398
513
|
app: string;
|
|
@@ -493,6 +608,7 @@ declare class ServicesListPage {
|
|
|
493
608
|
protected readonly backups: typeof backupsLine;
|
|
494
609
|
protected readonly price: typeof money;
|
|
495
610
|
protected readonly rows: _angular_core.Signal<Summary[]>;
|
|
611
|
+
/** services.instance.create in some environment (V4-01). */
|
|
496
612
|
protected readonly canManage: _angular_core.Signal<boolean>;
|
|
497
613
|
protected readonly quotaLine: _angular_core.Signal<string>;
|
|
498
614
|
private readonly route;
|
|
@@ -538,13 +654,16 @@ declare class ServicesNewPage {
|
|
|
538
654
|
protected readonly attach: _angular_core.WritableSignal<string>;
|
|
539
655
|
protected readonly hour: _angular_core.WritableSignal<number>;
|
|
540
656
|
protected readonly ha: _angular_core.WritableSignal<boolean>;
|
|
541
|
-
protected readonly nodes: _angular_core.Signal<
|
|
657
|
+
protected readonly nodes: _angular_core.Signal<2 | 1 | 3>;
|
|
542
658
|
protected readonly haLabel: _angular_core.Signal<string>;
|
|
543
659
|
protected readonly keep: _angular_core.WritableSignal<number>;
|
|
544
660
|
protected readonly busy: _angular_core.WritableSignal<boolean>;
|
|
545
661
|
protected readonly error: _angular_core.WritableSignal<string>;
|
|
546
662
|
protected readonly engines: _angular_core.Signal<Engine[]>;
|
|
547
663
|
protected readonly plans: _angular_core.Signal<Plan[]>;
|
|
664
|
+
/** The regions on offer (D-54), the organization's picked for you; with one, the region is text. */
|
|
665
|
+
protected readonly regions: _angular_core.Signal<_chisquare_tech_origine_ngx_apps_services.ServicesRegion[]>;
|
|
666
|
+
protected readonly regionId: _angular_core.WritableSignal<string>;
|
|
548
667
|
protected readonly region: _angular_core.Signal<string>;
|
|
549
668
|
protected readonly versionLabel: _angular_core.Signal<string>;
|
|
550
669
|
protected readonly envs: _angular_core.Signal<string[]>;
|
|
@@ -651,7 +770,13 @@ declare class ServicePage {
|
|
|
651
770
|
protected readonly engine: _angular_core.Signal<Engine | null>;
|
|
652
771
|
protected readonly envVar: _angular_core.Signal<string>;
|
|
653
772
|
protected readonly plans: _angular_core.Signal<Plan[]>;
|
|
773
|
+
/** Where the instance runs (D-54): its own region, the organization's by default. */
|
|
654
774
|
protected readonly region: _angular_core.Signal<string>;
|
|
775
|
+
/** The region of the chosen app's chosen environment, when deploy says (D-54). */
|
|
776
|
+
protected readonly attRegion: _angular_core.Signal<string>;
|
|
777
|
+
/** An app attaches only to a service in its own region (D-54). */
|
|
778
|
+
protected readonly attOtherRegion: _angular_core.Signal<boolean>;
|
|
779
|
+
protected readonly rotationPeriods: number[];
|
|
655
780
|
protected readonly conn: _angular_core.Signal<_chisquare_tech_origine_ngx_apps_services.Connection | null>;
|
|
656
781
|
protected readonly snippetKeys: _angular_core.Signal<string[]>;
|
|
657
782
|
protected readonly backups: _angular_core.Signal<Backup[]>;
|
|
@@ -684,6 +809,14 @@ declare class ServicePage {
|
|
|
684
809
|
protected dialogTitle(dl: Dialog, d: Detail): string;
|
|
685
810
|
private run;
|
|
686
811
|
protected toggleReveal(d: Detail): void;
|
|
812
|
+
/** Whether the caller holds capability id on the instance's environment (V4-01). */
|
|
813
|
+
protected has(d: Detail, id: string): boolean;
|
|
814
|
+
/** A user's scheduled rotation (V0-22): every 30 to 365 days, or never. */
|
|
815
|
+
protected setRotation(d: Detail, user: string, days: number): void;
|
|
816
|
+
protected rotationLine(u: {
|
|
817
|
+
rotateEveryDays: number;
|
|
818
|
+
nextRotation?: string;
|
|
819
|
+
}): string;
|
|
687
820
|
protected attach(d: Detail): void;
|
|
688
821
|
protected detach(d: Detail, a: Attachment): void;
|
|
689
822
|
protected askRotate(d: Detail): void;
|
|
@@ -691,6 +824,9 @@ declare class ServicePage {
|
|
|
691
824
|
protected retire(d: Detail, r: Rotation): void;
|
|
692
825
|
protected addDb(d: Detail): void;
|
|
693
826
|
protected removeDb(d: Detail, name: string): void;
|
|
827
|
+
/** A Postgres extension from the allow-list (V8-04, D-30); what it needs comes with it. */
|
|
828
|
+
protected addExt(d: Detail, db: string, name: string): void;
|
|
829
|
+
protected dropExt(d: Detail, db: string, name: string): void;
|
|
694
830
|
protected addUser(d: Detail): void;
|
|
695
831
|
protected removeUser(d: Detail, name: string): void;
|
|
696
832
|
protected backupNow(d: Detail): void;
|
|
@@ -802,7 +938,9 @@ declare class ServiceConsoleTab {
|
|
|
802
938
|
private readonly api;
|
|
803
939
|
readonly d: _angular_core.InputSignal<Detail>;
|
|
804
940
|
readonly projectKey: _angular_core.InputSignal<string>;
|
|
805
|
-
|
|
941
|
+
/** The console and the inspector need services.connect on the instance's environment (V4-01). */
|
|
942
|
+
protected readonly may: _angular_core.Signal<boolean>;
|
|
943
|
+
readonly kind: _angular_core.InputSignal<"sql" | "keys" | "streams" | "queues">;
|
|
806
944
|
protected readonly sql: _angular_core.Signal<boolean>;
|
|
807
945
|
protected readonly running: _angular_core.Signal<boolean>;
|
|
808
946
|
protected readonly runsAs: _angular_core.Signal<string>;
|
|
@@ -833,6 +971,8 @@ declare class ServiceDumpsCard {
|
|
|
833
971
|
private readonly router;
|
|
834
972
|
readonly d: _angular_core.InputSignal<Detail>;
|
|
835
973
|
readonly projectKey: _angular_core.InputSignal<string>;
|
|
974
|
+
/** Whether the caller holds capability id on the instance's environment (V4-01). */
|
|
975
|
+
protected may(id: string): boolean;
|
|
836
976
|
readonly dumps: _angular_core.InputSignal<boolean>;
|
|
837
977
|
readonly done: _angular_core.OutputEmitterRef<string>;
|
|
838
978
|
readonly failed: _angular_core.OutputEmitterRef<string>;
|
|
@@ -857,4 +997,4 @@ declare class ServiceDumpsCard {
|
|
|
857
997
|
}
|
|
858
998
|
|
|
859
999
|
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 };
|
|
1000
|
+
export type { Attachment, Backup, Catalog, Connection, CopyView, 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, StorageView, Stream, Summary, UpdateInput, Upgrade, UpgradeView, UserView };
|