@tmlmobilidade/interfaces 20250915.1329.1 → 20250915.1518.13

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.
@@ -1,6 +1,6 @@
1
1
  import { MongoCollectionClass } from '../../mongo-collection.js';
2
2
  import { CreateOrganizationDto, Organization, UpdateOrganizationDto } from '@tmlmobilidade/types';
3
- import { Filter, FindOptions, IndexDescription } from 'mongodb';
3
+ import { IndexDescription } from 'mongodb';
4
4
  import { z } from 'zod';
5
5
  declare class OrganizationsClass extends MongoCollectionClass<Organization, CreateOrganizationDto, UpdateOrganizationDto> {
6
6
  private static _instance;
@@ -8,46 +8,6 @@ declare class OrganizationsClass extends MongoCollectionClass<Organization, Crea
8
8
  protected updateSchema: z.ZodSchema;
9
9
  private constructor();
10
10
  static getInstance(): Promise<OrganizationsClass>;
11
- /**
12
- * Finds a document by its ID.
13
- *
14
- * @param id - The ID of the document to find
15
- * @returns A promise that resolves to the matching document or null if not found
16
- */
17
- findById(id: string, options?: FindOptions<Organization>): Promise<{
18
- _id: string;
19
- created_at: number & {
20
- __brand: "UnixTimestamp";
21
- };
22
- updated_at: number & {
23
- __brand: "UnixTimestamp";
24
- };
25
- home_links: string[];
26
- home_wikis: string[];
27
- longname: string;
28
- shortname: string;
29
- created_by?: string | undefined;
30
- updated_by?: string | undefined;
31
- logo?: string | null | undefined;
32
- theme?: string | null | undefined;
33
- } | null>;
34
- findOne(filter: Filter<Organization>): Promise<import("mongodb").WithId<{
35
- _id: string;
36
- created_at: number & {
37
- __brand: "UnixTimestamp";
38
- };
39
- updated_at: number & {
40
- __brand: "UnixTimestamp";
41
- };
42
- home_links: string[];
43
- home_wikis: string[];
44
- longname: string;
45
- shortname: string;
46
- created_by?: string | undefined;
47
- updated_by?: string | undefined;
48
- logo?: string | null | undefined;
49
- theme?: string | null | undefined;
50
- }> | null>;
51
11
  protected getCollectionIndexes(): IndexDescription[];
52
12
  protected getCollectionName(): string;
53
13
  protected getCreateSchema(): z.ZodSchema;
@@ -18,26 +18,6 @@ class OrganizationsClass extends MongoCollectionClass {
18
18
  }
19
19
  return OrganizationsClass._instance;
20
20
  }
21
- /**
22
- * Finds a document by its ID.
23
- *
24
- * @param id - The ID of the document to find
25
- * @returns A promise that resolves to the matching document or null if not found
26
- */
27
- async findById(id, options) {
28
- const organization = await this.mongoCollection.findOne({ _id: id }, options);
29
- if (!organization) {
30
- return null;
31
- }
32
- return organization;
33
- }
34
- async findOne(filter) {
35
- const organization = await this.mongoCollection.findOne(filter);
36
- if (!organization) {
37
- return null;
38
- }
39
- return organization;
40
- }
41
21
  getCollectionIndexes() {
42
22
  return [
43
23
  { background: true, key: { name: 1 }, unique: true },
@@ -45,6 +45,7 @@ declare class StopsClass extends MongoCollectionClass<Stop, CreateStopDto, Updat
45
45
  type: "note";
46
46
  created_by?: string | undefined;
47
47
  updated_by?: string | undefined;
48
+ metadata?: Record<string, unknown> | null | undefined;
48
49
  } | {
49
50
  _id: string;
50
51
  created_at: number & {
@@ -57,6 +58,7 @@ declare class StopsClass extends MongoCollectionClass<Stop, CreateStopDto, Updat
57
58
  updated_by: "system";
58
59
  message: string;
59
60
  type: "system_info";
61
+ metadata?: Record<string, unknown> | null | undefined;
60
62
  } | {
61
63
  _id: string;
62
64
  created_at: number & {
@@ -65,11 +67,12 @@ declare class StopsClass extends MongoCollectionClass<Stop, CreateStopDto, Updat
65
67
  updated_at: number & {
66
68
  __brand: "UnixTimestamp";
67
69
  };
68
- type: "statusChanged";
69
- curr_status: string;
70
- prev_status: string;
70
+ type: "status_changed";
71
+ curr_status: string | boolean;
72
+ prev_status: string | boolean;
71
73
  created_by?: string | undefined;
72
74
  updated_by?: string | undefined;
75
+ metadata?: Record<string, unknown> | null | undefined;
73
76
  })[];
74
77
  is_archived: boolean;
75
78
  jurisdiction: "unknown" | "ip" | "municipality" | "other";
@@ -142,6 +145,7 @@ declare class StopsClass extends MongoCollectionClass<Stop, CreateStopDto, Updat
142
145
  type: "note";
143
146
  created_by?: string | undefined;
144
147
  updated_by?: string | undefined;
148
+ metadata?: Record<string, unknown> | null | undefined;
145
149
  } | {
146
150
  _id: string;
147
151
  created_at: number & {
@@ -154,6 +158,7 @@ declare class StopsClass extends MongoCollectionClass<Stop, CreateStopDto, Updat
154
158
  updated_by: "system";
155
159
  message: string;
156
160
  type: "system_info";
161
+ metadata?: Record<string, unknown> | null | undefined;
157
162
  } | {
158
163
  _id: string;
159
164
  created_at: number & {
@@ -162,11 +167,12 @@ declare class StopsClass extends MongoCollectionClass<Stop, CreateStopDto, Updat
162
167
  updated_at: number & {
163
168
  __brand: "UnixTimestamp";
164
169
  };
165
- type: "statusChanged";
166
- curr_status: string;
167
- prev_status: string;
170
+ type: "status_changed";
171
+ curr_status: string | boolean;
172
+ prev_status: string | boolean;
168
173
  created_by?: string | undefined;
169
174
  updated_by?: string | undefined;
175
+ metadata?: Record<string, unknown> | null | undefined;
170
176
  })[];
171
177
  is_archived: boolean;
172
178
  jurisdiction: "unknown" | "ip" | "municipality" | "other";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/interfaces",
3
- "version": "20250915.1329.1",
3
+ "version": "20250915.1518.13",
4
4
  "author": "João de Vasconcelos & Jusi Monteiro",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "homepage": "https://github.com/tmlmobilidade/services#readme",