@chisquare-tech/origine-ngx-apps-services 0.2.3 → 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.2.3",
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 caller's capabilities on the project: view, resources.manage (Maintainer+), … */
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). */
@@ -54,7 +72,6 @@ interface Engine {
54
72
  pitr: boolean;
55
73
  port: number;
56
74
  available: boolean;
57
- tag?: string;
58
75
  databases: boolean;
59
76
  ha?: 'standby' | 'replica' | 'cluster' | '';
60
77
  maxReplicas?: number;
@@ -151,6 +168,9 @@ interface Summary {
151
168
  purgeAt?: string;
152
169
  nodes: number;
153
170
  fork: boolean;
171
+ /** Where it runs (D-54): picked at creation, the organization's region by default. */
172
+ region?: string;
173
+ regionName?: string;
154
174
  }
155
175
  interface ServiceList {
156
176
  items: Summary[];
@@ -168,6 +188,10 @@ interface UserView {
168
188
  rotating: boolean;
169
189
  attached: string[];
170
190
  createdAt: string;
191
+ /** Its scheduled rotation: every rotateEveryDays days (0: none), next on nextRotation. */
192
+ rotateEveryDays: number;
193
+ rotatedAt?: string;
194
+ nextRotation?: string;
171
195
  }
172
196
  interface Backup {
173
197
  name: string;
@@ -253,7 +277,8 @@ interface Detail extends Summary {
253
277
  restoreBackup?: string;
254
278
  provisionedAt?: string;
255
279
  finalBackup: boolean;
256
- canManage: boolean;
280
+ /** The services capability ids the caller holds on this instance's environment (V4-01). */
281
+ caps: string[];
257
282
  standby: boolean;
258
283
  replicas: number;
259
284
  readyNodes: number;
@@ -341,6 +366,8 @@ interface CreateInput {
341
366
  version?: string;
342
367
  plan: string;
343
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;
344
371
  database?: string;
345
372
  backupHour?: number;
346
373
  retentionDays?: number;
@@ -383,6 +410,8 @@ declare class ServicesApi {
383
410
  removeDatabase(project: string, id: string, name: string): Observable<unknown>;
384
411
  addUser(project: string, id: string, name: string, preset: string): Observable<unknown>;
385
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>;
386
415
  rotate(project: string, id: string, user?: string, graceMinutes?: number): Observable<Rotation>;
387
416
  retire(project: string, id: string, rotation: string): Observable<unknown>;
388
417
  backupNow(project: string, id: string): Observable<unknown>;
@@ -494,6 +523,7 @@ declare class ServicesListPage {
494
523
  protected readonly backups: typeof backupsLine;
495
524
  protected readonly price: typeof money;
496
525
  protected readonly rows: _angular_core.Signal<Summary[]>;
526
+ /** services.instance.create in some environment (V4-01). */
497
527
  protected readonly canManage: _angular_core.Signal<boolean>;
498
528
  protected readonly quotaLine: _angular_core.Signal<string>;
499
529
  private readonly route;
@@ -546,6 +576,9 @@ declare class ServicesNewPage {
546
576
  protected readonly error: _angular_core.WritableSignal<string>;
547
577
  protected readonly engines: _angular_core.Signal<Engine[]>;
548
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>;
549
582
  protected readonly region: _angular_core.Signal<string>;
550
583
  protected readonly versionLabel: _angular_core.Signal<string>;
551
584
  protected readonly envs: _angular_core.Signal<string[]>;
@@ -652,7 +685,13 @@ declare class ServicePage {
652
685
  protected readonly engine: _angular_core.Signal<Engine | null>;
653
686
  protected readonly envVar: _angular_core.Signal<string>;
654
687
  protected readonly plans: _angular_core.Signal<Plan[]>;
688
+ /** Where the instance runs (D-54): its own region, the organization's by default. */
655
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[];
656
695
  protected readonly conn: _angular_core.Signal<_chisquare_tech_origine_ngx_apps_services.Connection | null>;
657
696
  protected readonly snippetKeys: _angular_core.Signal<string[]>;
658
697
  protected readonly backups: _angular_core.Signal<Backup[]>;
@@ -685,6 +724,14 @@ declare class ServicePage {
685
724
  protected dialogTitle(dl: Dialog, d: Detail): string;
686
725
  private run;
687
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;
688
735
  protected attach(d: Detail): void;
689
736
  protected detach(d: Detail, a: Attachment): void;
690
737
  protected askRotate(d: Detail): void;
@@ -803,6 +850,8 @@ declare class ServiceConsoleTab {
803
850
  private readonly api;
804
851
  readonly d: _angular_core.InputSignal<Detail>;
805
852
  readonly projectKey: _angular_core.InputSignal<string>;
853
+ /** The console and the inspector need services.connect on the instance's environment (V4-01). */
854
+ protected readonly may: _angular_core.Signal<boolean>;
806
855
  readonly kind: _angular_core.InputSignal<"sql" | "keys" | "streams" | "queues">;
807
856
  protected readonly sql: _angular_core.Signal<boolean>;
808
857
  protected readonly running: _angular_core.Signal<boolean>;
@@ -834,6 +883,8 @@ declare class ServiceDumpsCard {
834
883
  private readonly router;
835
884
  readonly d: _angular_core.InputSignal<Detail>;
836
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;
837
888
  readonly dumps: _angular_core.InputSignal<boolean>;
838
889
  readonly done: _angular_core.OutputEmitterRef<string>;
839
890
  readonly failed: _angular_core.OutputEmitterRef<string>;
@@ -858,4 +909,4 @@ declare class ServiceDumpsCard {
858
909
  }
859
910
 
860
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 };
861
- 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 };