@tmlmobilidade/go-interfaces-labdb 20261020.1221.25 → 20261020.1829.37

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.
@@ -0,0 +1,9 @@
1
+ import { ClickHouseInterfaceTemplate } from '../interface.template.js';
2
+ import { ClickHouseClient } from '@tmlmobilidade/go-clients-clickhouse';
3
+ import { type SimplifiedAgency } from '@tmlmobilidade/go-types-core';
4
+ export declare class CoreDatabase {
5
+ readonly simplifiedAgencies: ClickHouseInterfaceTemplate<SimplifiedAgency>;
6
+ private readonly databaseName;
7
+ constructor(client: ClickHouseClient);
8
+ init(): Promise<void>;
9
+ }
@@ -0,0 +1,21 @@
1
+ /* * */
2
+ import { ClickHouseInterfaceTemplate } from '../interface.template.js';
3
+ import { simplifiedAgenciesTableSchema } from '../schemas/core.js';
4
+ /* * */
5
+ export class CoreDatabase {
6
+ //
7
+ simplifiedAgencies;
8
+ databaseName = 'core';
9
+ constructor(client) {
10
+ //
11
+ this.simplifiedAgencies = new ClickHouseInterfaceTemplate(client, this.databaseName, 'simplified_agencies', simplifiedAgenciesTableSchema, {
12
+ engine: 'ReplacingMergeTree(updated_at)',
13
+ orderBy: ['_id'],
14
+ });
15
+ }
16
+ async init() {
17
+ await Promise.all([
18
+ this.simplifiedAgencies.init(),
19
+ ]);
20
+ }
21
+ }
@@ -1,4 +1,5 @@
1
1
  import { ClickHouseClient, queryEachStatementFromFile, queryFromFile, queryFromString } from '@tmlmobilidade/go-clients-clickhouse';
2
+ import { CoreDatabase } from './databases/core.js';
2
3
  import { HubDatabase } from './databases/hub.js';
3
4
  import { InfrastructureDatabase } from './databases/infrastructure.js';
4
5
  import { OperationDatabase } from './databases/operation.js';
@@ -6,6 +7,7 @@ import { PerformanceDatabase } from './databases/performance.js';
6
7
  import { SimplifiedApexDatabase } from './databases/simplified-apex.js';
7
8
  declare class LabDbClass {
8
9
  private static _instance;
10
+ readonly core: CoreDatabase;
9
11
  readonly hub: HubDatabase;
10
12
  readonly infrastructure: InfrastructureDatabase;
11
13
  readonly operation: OperationDatabase;
package/dist/interface.js CHANGED
@@ -1,6 +1,7 @@
1
1
  /* * */
2
2
  import { ClickHouseDatabaseClient, queryEachStatementFromFile, queryFromFile, queryFromString } from '@tmlmobilidade/go-clients-clickhouse';
3
3
  import { asyncSingletonProxy } from '@tmlmobilidade/go-utils-exec';
4
+ import { CoreDatabase } from './databases/core.js';
4
5
  import { HubDatabase } from './databases/hub.js';
5
6
  import { InfrastructureDatabase } from './databases/infrastructure.js';
6
7
  import { OperationDatabase } from './databases/operation.js';
@@ -10,6 +11,7 @@ import { SimplifiedApexDatabase } from './databases/simplified-apex.js';
10
11
  class LabDbClass {
11
12
  //
12
13
  static _instance = null;
14
+ core;
13
15
  hub;
14
16
  infrastructure;
15
17
  operation;
@@ -18,6 +20,7 @@ class LabDbClass {
18
20
  clickhouseClient;
19
21
  constructor(client) {
20
22
  this.clickhouseClient = client;
23
+ this.core = new CoreDatabase(this.clickhouseClient);
21
24
  this.hub = new HubDatabase(this.clickhouseClient);
22
25
  this.infrastructure = new InfrastructureDatabase(this.clickhouseClient);
23
26
  this.operation = new OperationDatabase(this.clickhouseClient);
@@ -62,6 +65,7 @@ class LabDbClass {
62
65
  }
63
66
  async init() {
64
67
  await Promise.all([
68
+ this.core.init(),
65
69
  this.hub.init(),
66
70
  this.infrastructure.init(),
67
71
  this.operation.init(),
@@ -0,0 +1,3 @@
1
+ import { type ClickHouseTableSchema } from '@tmlmobilidade/go-clients-clickhouse';
2
+ import { type SimplifiedAgency } from '@tmlmobilidade/go-types-core';
3
+ export declare const simplifiedAgenciesTableSchema: ClickHouseTableSchema<SimplifiedAgency>;
@@ -0,0 +1,13 @@
1
+ /* * */
2
+ /* * */
3
+ export const simplifiedAgenciesTableSchema = {
4
+ _id: { type: 'String' },
5
+ code: { type: 'String' },
6
+ created_at: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
7
+ name: { type: 'String' },
8
+ primary_language: { type: 'String' },
9
+ pta_name: { type: 'String' },
10
+ short_name: { type: 'String' },
11
+ timezone: { type: 'String' },
12
+ updated_at: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
13
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/go-interfaces-labdb",
3
- "version": "20261020.1221.25",
3
+ "version": "20261020.1829.37",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"
@@ -38,6 +38,7 @@
38
38
  "dependencies": {
39
39
  "@tmlmobilidade/go-clients-clickhouse": "*",
40
40
  "@tmlmobilidade/go-types-apex": "*",
41
+ "@tmlmobilidade/go-types-core": "*",
41
42
  "@tmlmobilidade/go-types-hub": "*",
42
43
  "@tmlmobilidade/go-types-infrastructure": "*",
43
44
  "@tmlmobilidade/go-types-operation": "*",