@chisquare-tech/origine-ngx-apps-services 0.1.0 → 0.2.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.2.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",
|
|
@@ -56,6 +56,59 @@ interface Engine {
|
|
|
56
56
|
available: boolean;
|
|
57
57
|
tag?: string;
|
|
58
58
|
databases: boolean;
|
|
59
|
+
ha?: 'standby' | 'cluster' | '';
|
|
60
|
+
maxReplicas?: number;
|
|
61
|
+
dumps?: boolean;
|
|
62
|
+
console: 'sql' | 'keys' | 'streams' | 'queues';
|
|
63
|
+
parameters: Param[];
|
|
64
|
+
}
|
|
65
|
+
interface Param {
|
|
66
|
+
engine: string;
|
|
67
|
+
name: string;
|
|
68
|
+
kind: 'int' | 'float' | 'size' | 'duration' | 'bool' | 'enum';
|
|
69
|
+
min: number;
|
|
70
|
+
max: number;
|
|
71
|
+
enum?: string[];
|
|
72
|
+
restart: boolean;
|
|
73
|
+
default: string;
|
|
74
|
+
description: string;
|
|
75
|
+
value?: string;
|
|
76
|
+
}
|
|
77
|
+
interface Stream {
|
|
78
|
+
name: string;
|
|
79
|
+
subjects: string[];
|
|
80
|
+
maxAgeHours?: number;
|
|
81
|
+
maxMb?: number;
|
|
82
|
+
}
|
|
83
|
+
interface Dump {
|
|
84
|
+
id: string;
|
|
85
|
+
kind: 'export' | 'import';
|
|
86
|
+
source?: 'upload' | 'remote';
|
|
87
|
+
remote?: string;
|
|
88
|
+
database: string;
|
|
89
|
+
fileName?: string;
|
|
90
|
+
phase: 'uploading' | 'pending' | 'running' | 'completed' | 'failed';
|
|
91
|
+
bytes?: number;
|
|
92
|
+
error?: string;
|
|
93
|
+
createdBy: string;
|
|
94
|
+
createdAt: string;
|
|
95
|
+
stoppedAt?: string;
|
|
96
|
+
}
|
|
97
|
+
interface QueryResult {
|
|
98
|
+
columns: string[];
|
|
99
|
+
rows: string[][];
|
|
100
|
+
truncated: boolean;
|
|
101
|
+
command?: string;
|
|
102
|
+
rowsAffected?: number;
|
|
103
|
+
ms: number;
|
|
104
|
+
readOnly: boolean;
|
|
105
|
+
runsAs: string;
|
|
106
|
+
}
|
|
107
|
+
interface Inspection {
|
|
108
|
+
kind: 'keys' | 'streams' | 'queues';
|
|
109
|
+
items: Record<string, any>[];
|
|
110
|
+
cursor?: string;
|
|
111
|
+
detail?: Record<string, any>;
|
|
59
112
|
}
|
|
60
113
|
interface Plan {
|
|
61
114
|
id: string;
|
|
@@ -96,6 +149,8 @@ interface Summary {
|
|
|
96
149
|
createdAt: string;
|
|
97
150
|
deletedAt?: string;
|
|
98
151
|
purgeAt?: string;
|
|
152
|
+
nodes: number;
|
|
153
|
+
fork: boolean;
|
|
99
154
|
}
|
|
100
155
|
interface ServiceList {
|
|
101
156
|
items: Summary[];
|
|
@@ -133,6 +188,7 @@ interface Attachment {
|
|
|
133
188
|
database: string;
|
|
134
189
|
state: 'pending' | 'live' | 'failed' | string;
|
|
135
190
|
message: string;
|
|
191
|
+
ownUser?: boolean;
|
|
136
192
|
createdAt: string;
|
|
137
193
|
updatedAt: string;
|
|
138
194
|
}
|
|
@@ -187,6 +243,15 @@ interface Detail extends Summary {
|
|
|
187
243
|
provisionedAt?: string;
|
|
188
244
|
finalBackup: boolean;
|
|
189
245
|
canManage: boolean;
|
|
246
|
+
standby: boolean;
|
|
247
|
+
replicas: number;
|
|
248
|
+
readyNodes: number;
|
|
249
|
+
readHost?: string;
|
|
250
|
+
parameters: Param[];
|
|
251
|
+
streams: Stream[];
|
|
252
|
+
vhosts: string[] | null;
|
|
253
|
+
dumps: Dump[];
|
|
254
|
+
declaredBy?: string;
|
|
190
255
|
}
|
|
191
256
|
interface Revealed {
|
|
192
257
|
user: string;
|
|
@@ -258,7 +323,10 @@ interface CreateInput {
|
|
|
258
323
|
app: string;
|
|
259
324
|
environment?: string;
|
|
260
325
|
prefix?: string;
|
|
326
|
+
ownUser?: boolean;
|
|
261
327
|
};
|
|
328
|
+
standby?: boolean;
|
|
329
|
+
replicas?: number;
|
|
262
330
|
}
|
|
263
331
|
interface UpdateInput {
|
|
264
332
|
plan?: string;
|
|
@@ -269,10 +337,14 @@ interface UpdateInput {
|
|
|
269
337
|
maintenanceHour?: number;
|
|
270
338
|
publicEnabled?: boolean;
|
|
271
339
|
allowedCidrs?: string[];
|
|
340
|
+
standby?: boolean;
|
|
341
|
+
replicas?: number;
|
|
342
|
+
parameters?: Record<string, string>;
|
|
272
343
|
}
|
|
273
344
|
declare function apiMessage(err: any, fallback?: string): string;
|
|
274
345
|
declare class ServicesApi {
|
|
275
346
|
private readonly api;
|
|
347
|
+
private readonly http;
|
|
276
348
|
private i;
|
|
277
349
|
catalog(): Observable<Catalog>;
|
|
278
350
|
list(project: string): Observable<ServiceList>;
|
|
@@ -299,11 +371,38 @@ declare class ServicesApi {
|
|
|
299
371
|
app: string;
|
|
300
372
|
environment?: string;
|
|
301
373
|
prefix?: string;
|
|
374
|
+
ownUser?: boolean;
|
|
375
|
+
database?: string;
|
|
302
376
|
}): Observable<Attachment>;
|
|
303
377
|
detach(project: string, id: string, attachment: string): Observable<unknown>;
|
|
304
378
|
swap(project: string, id: string, from: string): Observable<unknown>;
|
|
305
379
|
metrics(project: string, id: string): Observable<Metrics>;
|
|
306
380
|
logs(project: string, id: string, kind: LogKind, limit?: number): Observable<Logs>;
|
|
381
|
+
addStream(project: string, id: string, s: Stream): Observable<Detail>;
|
|
382
|
+
removeStream(project: string, id: string, name: string): Observable<unknown>;
|
|
383
|
+
addVhost(project: string, id: string, name: string): Observable<Detail>;
|
|
384
|
+
removeVhost(project: string, id: string, name: string): Observable<unknown>;
|
|
385
|
+
fork(project: string, id: string, body: {
|
|
386
|
+
name?: string;
|
|
387
|
+
environment?: string;
|
|
388
|
+
plan?: string;
|
|
389
|
+
}): Observable<Detail>;
|
|
390
|
+
exportDump(project: string, id: string, database?: string): Observable<Dump>;
|
|
391
|
+
importRemote(project: string, id: string, database: string, remote: string): Observable<Dump>;
|
|
392
|
+
deleteDump(project: string, id: string, dump: string): Observable<unknown>;
|
|
393
|
+
/** Streams an uploaded dump to the cell (outside the JSON API: /x/services/…). */
|
|
394
|
+
importUpload(project: string, id: string, database: string, file: File): Observable<Dump>;
|
|
395
|
+
downloadDump(project: string, id: string, dump: string): Observable<Blob>;
|
|
396
|
+
query(project: string, id: string, body: {
|
|
397
|
+
database?: string;
|
|
398
|
+
statement: string;
|
|
399
|
+
write?: boolean;
|
|
400
|
+
}): Observable<QueryResult>;
|
|
401
|
+
inspect(project: string, id: string, body: {
|
|
402
|
+
pattern?: string;
|
|
403
|
+
cursor?: string;
|
|
404
|
+
item?: string;
|
|
405
|
+
}): Observable<Inspection>;
|
|
307
406
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ServicesApi, never>;
|
|
308
407
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ServicesApi>;
|
|
309
408
|
}
|
|
@@ -385,6 +484,7 @@ declare class ServicesListPage {
|
|
|
385
484
|
declare class ServicesNewPage {
|
|
386
485
|
protected readonly host: ServicesHost;
|
|
387
486
|
private readonly api;
|
|
487
|
+
private readonly route;
|
|
388
488
|
private readonly router;
|
|
389
489
|
protected readonly steps: {
|
|
390
490
|
n: number;
|
|
@@ -406,6 +506,9 @@ declare class ServicesNewPage {
|
|
|
406
506
|
protected readonly env: _angular_core.WritableSignal<string>;
|
|
407
507
|
protected readonly attach: _angular_core.WritableSignal<string>;
|
|
408
508
|
protected readonly hour: _angular_core.WritableSignal<number>;
|
|
509
|
+
protected readonly ha: _angular_core.WritableSignal<boolean>;
|
|
510
|
+
protected readonly nodes: _angular_core.Signal<2 | 1 | 3>;
|
|
511
|
+
protected readonly haLabel: _angular_core.Signal<string>;
|
|
409
512
|
protected readonly keep: _angular_core.WritableSignal<number>;
|
|
410
513
|
protected readonly busy: _angular_core.WritableSignal<boolean>;
|
|
411
514
|
protected readonly error: _angular_core.WritableSignal<string>;
|
|
@@ -491,6 +594,16 @@ declare class ServicePage {
|
|
|
491
594
|
protected readonly attApp: _angular_core.WritableSignal<string>;
|
|
492
595
|
protected readonly attEnv: _angular_core.WritableSignal<string>;
|
|
493
596
|
protected readonly attPrefix: _angular_core.WritableSignal<string>;
|
|
597
|
+
protected readonly attOwn: _angular_core.WritableSignal<boolean>;
|
|
598
|
+
protected readonly attVhost: _angular_core.WritableSignal<string>;
|
|
599
|
+
protected readonly subjects: _angular_core.WritableSignal<string>;
|
|
600
|
+
protected readonly maxAge: _angular_core.WritableSignal<number>;
|
|
601
|
+
protected readonly streamAges: {
|
|
602
|
+
h: number;
|
|
603
|
+
label: string;
|
|
604
|
+
}[];
|
|
605
|
+
protected readonly paramDraft: _angular_core.WritableSignal<Record<string, string>>;
|
|
606
|
+
protected readonly paramsChanged: _angular_core.Signal<boolean>;
|
|
494
607
|
protected readonly addingDb: _angular_core.WritableSignal<boolean>;
|
|
495
608
|
protected readonly dbName: _angular_core.WritableSignal<string>;
|
|
496
609
|
protected readonly addingUser: _angular_core.WritableSignal<boolean>;
|
|
@@ -506,7 +619,6 @@ declare class ServicePage {
|
|
|
506
619
|
protected readonly envVar: _angular_core.Signal<string>;
|
|
507
620
|
protected readonly plans: _angular_core.Signal<Plan[]>;
|
|
508
621
|
protected readonly region: _angular_core.Signal<string>;
|
|
509
|
-
protected readonly params: _angular_core.Signal<[string, string, string][]>;
|
|
510
622
|
protected readonly conn: _angular_core.Signal<_chisquare_tech_origine_ngx_apps_services.Connection | null>;
|
|
511
623
|
protected readonly snippetKeys: _angular_core.Signal<string[]>;
|
|
512
624
|
protected readonly backups: _angular_core.Signal<Backup[]>;
|
|
@@ -564,6 +676,19 @@ declare class ServicePage {
|
|
|
564
676
|
protected addCidr(d: Detail): void;
|
|
565
677
|
protected dropCidr(d: Detail, c: string): void;
|
|
566
678
|
protected remove(d: Detail, finalBackup: boolean): void;
|
|
679
|
+
protected nodesPrice(d: Detail): string;
|
|
680
|
+
protected refresh(): void;
|
|
681
|
+
protected snapshotName(d: Detail): string;
|
|
682
|
+
/** MySQL replicas come in pairs. */
|
|
683
|
+
protected step(d: Detail): number;
|
|
684
|
+
protected topology(d: Detail, standby: boolean, replicas: number): void;
|
|
685
|
+
protected setParam(p: Param, v: string): void;
|
|
686
|
+
protected paramNote(d: Detail): string;
|
|
687
|
+
protected saveParams(d: Detail): void;
|
|
688
|
+
protected addStream(d: Detail): void;
|
|
689
|
+
protected removeStream(d: Detail, name: string): void;
|
|
690
|
+
protected addVhost(d: Detail): void;
|
|
691
|
+
protected removeVhost(d: Detail, name: string): void;
|
|
567
692
|
protected undelete(d: Detail): void;
|
|
568
693
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ServicePage, never>;
|
|
569
694
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ServicePage, "o-service", never, {}, {}, never, never, true, never>;
|
|
@@ -636,5 +761,63 @@ declare class ServiceLogsTab {
|
|
|
636
761
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ServiceLogsTab, "o-svc-logs", never, { "projectKey": { "alias": "projectKey"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "service": { "alias": "service"; "required": false; "isSignal": true; }; "environment": { "alias": "environment"; "required": false; "isSignal": true; }; "debugLogs": { "alias": "debugLogs"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
637
762
|
}
|
|
638
763
|
|
|
639
|
-
|
|
640
|
-
|
|
764
|
+
declare class ServiceConsoleTab {
|
|
765
|
+
private readonly api;
|
|
766
|
+
readonly d: _angular_core.InputSignal<Detail>;
|
|
767
|
+
readonly projectKey: _angular_core.InputSignal<string>;
|
|
768
|
+
readonly kind: _angular_core.InputSignal<"sql" | "keys" | "streams" | "queues">;
|
|
769
|
+
protected readonly sql: _angular_core.Signal<boolean>;
|
|
770
|
+
protected readonly running: _angular_core.Signal<boolean>;
|
|
771
|
+
protected readonly runsAs: _angular_core.Signal<string>;
|
|
772
|
+
protected readonly stmt: _angular_core.WritableSignal<string>;
|
|
773
|
+
protected readonly db: _angular_core.WritableSignal<string>;
|
|
774
|
+
protected readonly write: _angular_core.WritableSignal<boolean>;
|
|
775
|
+
protected readonly busy: _angular_core.WritableSignal<boolean>;
|
|
776
|
+
protected readonly error: _angular_core.WritableSignal<string>;
|
|
777
|
+
protected readonly result: _angular_core.WritableSignal<QueryResult | null>;
|
|
778
|
+
protected readonly pattern: _angular_core.WritableSignal<string>;
|
|
779
|
+
protected readonly list: _angular_core.WritableSignal<Inspection | null>;
|
|
780
|
+
private last;
|
|
781
|
+
protected inspectorLine(): string;
|
|
782
|
+
protected runSql(): void;
|
|
783
|
+
protected resultLine(r: QueryResult): string;
|
|
784
|
+
protected inspect(cursor?: string, item?: string): void;
|
|
785
|
+
protected open(it: Record<string, any>): void;
|
|
786
|
+
protected label(it: Record<string, any>): string;
|
|
787
|
+
protected note(it: Record<string, any>): string;
|
|
788
|
+
protected pretty(v: unknown): string;
|
|
789
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ServiceConsoleTab, never>;
|
|
790
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ServiceConsoleTab, "o-svc-console", never, { "d": { "alias": "d"; "required": true; "isSignal": true; }; "projectKey": { "alias": "projectKey"; "required": true; "isSignal": true; }; "kind": { "alias": "kind"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
declare class ServiceDumpsCard {
|
|
794
|
+
private readonly api;
|
|
795
|
+
private readonly host;
|
|
796
|
+
private readonly router;
|
|
797
|
+
readonly d: _angular_core.InputSignal<Detail>;
|
|
798
|
+
readonly projectKey: _angular_core.InputSignal<string>;
|
|
799
|
+
readonly dumps: _angular_core.InputSignal<boolean>;
|
|
800
|
+
readonly done: _angular_core.OutputEmitterRef<string>;
|
|
801
|
+
readonly failed: _angular_core.OutputEmitterRef<string>;
|
|
802
|
+
protected readonly envs: string[];
|
|
803
|
+
protected readonly env: _angular_core.WritableSignal<string>;
|
|
804
|
+
protected readonly remote: _angular_core.WritableSignal<string>;
|
|
805
|
+
protected readonly busy: _angular_core.WritableSignal<boolean>;
|
|
806
|
+
protected readonly size: typeof bytes;
|
|
807
|
+
protected readonly when: (s?: string) => string;
|
|
808
|
+
protected hasBackup(): boolean;
|
|
809
|
+
protected tool(): string;
|
|
810
|
+
protected dot(x: Dump): string;
|
|
811
|
+
private go;
|
|
812
|
+
protected fork(): void;
|
|
813
|
+
protected exportDump(): void;
|
|
814
|
+
protected importRemote(): void;
|
|
815
|
+
protected upload(ev: Event): void;
|
|
816
|
+
protected download(x: Dump): void;
|
|
817
|
+
protected remove(x: Dump): void;
|
|
818
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ServiceDumpsCard, never>;
|
|
819
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ServiceDumpsCard, "o-svc-dumps", never, { "d": { "alias": "d"; "required": true; "isSignal": true; }; "projectKey": { "alias": "projectKey"; "required": true; "isSignal": true; }; "dumps": { "alias": "dumps"; "required": false; "isSignal": true; }; }, { "done": "done"; "failed": "failed"; }, never, never, true, never>;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
export { DAYS, ENGINE_COLOUR, LIFECYCLE, PRESETS, ServiceConsoleTab, ServiceDumpsCard, ServiceLogsTab, ServiceMetricsTab, ServicePage, ServicesApi, ServicesHost, ServicesListPage, ServicesNewPage, apiMessage, backupKind, backupsLine, bytes, fromLocalInput, hhmm, hhmmss, money, moving, num, pct, presetChip, ratio, shortDate, spark, sparkPath, stateChip, stateDot, toLocalInput, utcHour, when };
|
|
823
|
+
export type { Attachment, Backup, Catalog, Connection, CreateInput, Database, Detail, Dump, Engine, EngineVersion, Figure, Gauge, Inspection, LogKind, LogLine, Logs, Metrics, Param, Plan, PodView, QueryResult, Quota, Revealed, Rotation, ServiceList, ServicesApp, ServicesProject, State, Stream, Summary, UpdateInput, UserView };
|