@tmlmobilidade/interfaces 20251222.1647.5 → 20251222.1756.6

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.
@@ -62,9 +62,7 @@ declare class AgenciesClass extends MongoCollectionClass<Agency, CreateAgencyDto
62
62
  }>>;
63
63
  protected getCollectionIndexes(): IndexDescription[];
64
64
  protected getCollectionName(): string;
65
- protected getCreateSchema(): z.ZodSchema;
66
65
  protected getEnvName(): string;
67
- protected getUpdateSchema(): z.ZodSchema;
68
66
  }
69
67
  export declare const agencies: AgenciesClass;
70
68
  export {};
@@ -1,11 +1,11 @@
1
1
  /* * */
2
2
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
3
- import { AgencySchema, UpdateAgencySchema } from '@tmlmobilidade/types';
3
+ import { CreateAgencySchema, UpdateAgencySchema } from '@tmlmobilidade/types';
4
4
  import { AsyncSingletonProxy } from '@tmlmobilidade/utils';
5
5
  /* * */
6
6
  class AgenciesClass extends MongoCollectionClass {
7
7
  static _instance;
8
- createSchema = AgencySchema;
8
+ createSchema = CreateAgencySchema;
9
9
  updateSchema = UpdateAgencySchema;
10
10
  constructor() {
11
11
  super();
@@ -34,15 +34,9 @@ class AgenciesClass extends MongoCollectionClass {
34
34
  getCollectionName() {
35
35
  return 'agencies';
36
36
  }
37
- getCreateSchema() {
38
- return AgencySchema;
39
- }
40
37
  getEnvName() {
41
38
  return 'DATABASE_URI';
42
39
  }
43
- getUpdateSchema() {
44
- return UpdateAgencySchema;
45
- }
46
40
  }
47
41
  /* * */
48
42
  export const agencies = AsyncSingletonProxy(AgenciesClass);
@@ -1,5 +1,5 @@
1
1
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
2
- import { Alert, CreateAlertDto, UpdateAlertDto } from '@tmlmobilidade/types';
2
+ import { type Alert, type CreateAlertDto, type UpdateAlertDto } from '@tmlmobilidade/types';
3
3
  import { IndexDescription } from 'mongodb';
4
4
  import { z } from 'zod';
5
5
  declare class AlertsClass extends MongoCollectionClass<Alert, CreateAlertDto, UpdateAlertDto> {
@@ -1,11 +1,11 @@
1
1
  /* * */
2
2
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
3
- import { AlertSchema, UpdateAlertSchema } from '@tmlmobilidade/types';
3
+ import { CreateAlertSchema, UpdateAlertSchema } from '@tmlmobilidade/types';
4
4
  import { AsyncSingletonProxy } from '@tmlmobilidade/utils';
5
5
  /* * */
6
6
  class AlertsClass extends MongoCollectionClass {
7
7
  static _instance;
8
- createSchema = AlertSchema;
8
+ createSchema = CreateAlertSchema;
9
9
  updateSchema = UpdateAlertSchema;
10
10
  constructor() {
11
11
  super();
@@ -1,11 +1,11 @@
1
1
  /* * */
2
2
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
3
- import { PermissionCatalog, RoleSchema, UpdateRoleSchema } from '@tmlmobilidade/types';
3
+ import { CreateRoleSchema, PermissionCatalog, UpdateRoleSchema } from '@tmlmobilidade/types';
4
4
  import { AsyncSingletonProxy } from '@tmlmobilidade/utils';
5
5
  /* * */
6
6
  class RolesClass extends MongoCollectionClass {
7
7
  static _instance;
8
- createSchema = RoleSchema;
8
+ createSchema = CreateRoleSchema;
9
9
  updateSchema = UpdateRoleSchema;
10
10
  constructor() {
11
11
  super();
@@ -1,5 +1,5 @@
1
1
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
2
- import { CreateSessionDto, Session, UpdateSessionDto } from '@tmlmobilidade/types';
2
+ import { type CreateSessionDto, Session, type UpdateSessionDto } from '@tmlmobilidade/types';
3
3
  import { IndexDescription } from 'mongodb';
4
4
  import { z } from 'zod';
5
5
  declare class SessionsClass extends MongoCollectionClass<Session, CreateSessionDto, UpdateSessionDto> {
@@ -1,12 +1,12 @@
1
1
  /* * */
2
2
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
3
- import { SessionSchema } from '@tmlmobilidade/types';
3
+ import { CreateSessionSchema, UpdateSessionSchema } from '@tmlmobilidade/types';
4
4
  import { AsyncSingletonProxy } from '@tmlmobilidade/utils';
5
5
  /* * */
6
6
  class SessionsClass extends MongoCollectionClass {
7
7
  static _instance;
8
- createSchema = SessionSchema;
9
- updateSchema = SessionSchema;
8
+ createSchema = CreateSessionSchema;
9
+ updateSchema = UpdateSessionSchema;
10
10
  constructor() {
11
11
  super();
12
12
  }
@@ -32,4 +32,5 @@ class SessionsClass extends MongoCollectionClass {
32
32
  return 'DATABASE_URI';
33
33
  }
34
34
  }
35
+ /* * */
35
36
  export const sessions = AsyncSingletonProxy(SessionsClass);
@@ -101,4 +101,5 @@ class UsersClass extends MongoCollectionClass {
101
101
  };
102
102
  }
103
103
  }
104
+ /* * */
104
105
  export const users = AsyncSingletonProxy(UsersClass);
@@ -39,4 +39,5 @@ class VerificationTokensClass extends MongoCollectionClass {
39
39
  return 'DATABASE_URI';
40
40
  }
41
41
  }
42
+ /* * */
42
43
  export const verificationTokens = AsyncSingletonProxy(VerificationTokensClass);
@@ -1,11 +1,11 @@
1
1
  /* * */
2
2
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
3
- import { AnnotationSchema, UpdateAnnotationSchema } from '@tmlmobilidade/types';
3
+ import { CreateAnnotationSchema, UpdateAnnotationSchema } from '@tmlmobilidade/types';
4
4
  import { AsyncSingletonProxy } from '@tmlmobilidade/utils';
5
5
  /* * */
6
6
  class AnnotationsClass extends MongoCollectionClass {
7
7
  static _instance;
8
- createSchema = AnnotationSchema;
8
+ createSchema = CreateAnnotationSchema;
9
9
  updateSchema = UpdateAnnotationSchema;
10
10
  constructor() {
11
11
  super();
@@ -1,5 +1,5 @@
1
1
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
2
- import { CreateNotificationDto, Notification, UpdateNotificationDto, User } from '@tmlmobilidade/types';
2
+ import { type CreateNotificationDto, type Notification, UpdateNotificationDto, User } from '@tmlmobilidade/types';
3
3
  import { IndexDescription } from 'mongodb';
4
4
  import { z } from 'zod';
5
5
  declare class NotificationsClass extends MongoCollectionClass<Notification, CreateNotificationDto, UpdateNotificationDto> {
@@ -11,7 +11,6 @@ declare class NotificationsClass extends MongoCollectionClass<Notification, Crea
11
11
  sendNotification(scope: string, topic: string, user: User, id: string, title: string, description: string): Promise<void>;
12
12
  protected getCollectionIndexes(): IndexDescription[];
13
13
  protected getCollectionName(): string;
14
- protected getCreateSchema(): z.ZodSchema;
15
14
  protected getEnvName(): string;
16
15
  /**
17
16
  * Collects all effective permissions of a user (direct + via roles),
@@ -4,12 +4,12 @@ import { roles } from '../auth/roles.js';
4
4
  import { users } from '../auth/users.js';
5
5
  import { getAppConfig } from '@tmlmobilidade/consts';
6
6
  import { sendNotificationEmail } from '@tmlmobilidade/emails';
7
- import { NotificationSchema, UpdateNotificationSchema } from '@tmlmobilidade/types';
7
+ import { CreateNotificationSchema, UpdateNotificationSchema } from '@tmlmobilidade/types';
8
8
  import { AsyncSingletonProxy, mergeObjects } from '@tmlmobilidade/utils';
9
9
  /* * */
10
10
  class NotificationsClass extends MongoCollectionClass {
11
11
  static _instance;
12
- createSchema = NotificationSchema;
12
+ createSchema = CreateNotificationSchema;
13
13
  updateSchema = UpdateNotificationSchema;
14
14
  constructor() {
15
15
  super();
@@ -79,9 +79,6 @@ class NotificationsClass extends MongoCollectionClass {
79
79
  getCollectionName() {
80
80
  return 'notifications';
81
81
  }
82
- getCreateSchema() {
83
- return NotificationSchema;
84
- }
85
82
  getEnvName() {
86
83
  return 'DATABASE_URI';
87
84
  }
@@ -110,4 +107,5 @@ class NotificationsClass extends MongoCollectionClass {
110
107
  return permission['resource']?.send_mail ?? false;
111
108
  }
112
109
  }
110
+ /* * */
113
111
  export const notifications = AsyncSingletonProxy(NotificationsClass);
@@ -1,5 +1,5 @@
1
1
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
2
- import { CreateOrganizationDto, Organization, UpdateOrganizationDto } from '@tmlmobilidade/types';
2
+ import { type CreateOrganizationDto, type Organization, type UpdateOrganizationDto } from '@tmlmobilidade/types';
3
3
  import { IndexDescription } from 'mongodb';
4
4
  import { z } from 'zod';
5
5
  declare class OrganizationsClass extends MongoCollectionClass<Organization, CreateOrganizationDto, UpdateOrganizationDto> {
@@ -10,7 +10,6 @@ declare class OrganizationsClass extends MongoCollectionClass<Organization, Crea
10
10
  static getInstance(): Promise<OrganizationsClass>;
11
11
  protected getCollectionIndexes(): IndexDescription[];
12
12
  protected getCollectionName(): string;
13
- protected getCreateSchema(): z.ZodSchema;
14
13
  protected getEnvName(): string;
15
14
  }
16
15
  export declare const organizations: OrganizationsClass;
@@ -1,11 +1,11 @@
1
1
  /* * */
2
2
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
3
- import { OrganizationSchema, UpdateOrganizationSchema } from '@tmlmobilidade/types';
3
+ import { CreateOrganizationSchema, UpdateOrganizationSchema } from '@tmlmobilidade/types';
4
4
  import { AsyncSingletonProxy } from '@tmlmobilidade/utils';
5
5
  /* * */
6
6
  class OrganizationsClass extends MongoCollectionClass {
7
7
  static _instance;
8
- createSchema = OrganizationSchema;
8
+ createSchema = CreateOrganizationSchema;
9
9
  updateSchema = UpdateOrganizationSchema;
10
10
  constructor() {
11
11
  super();
@@ -26,9 +26,6 @@ class OrganizationsClass extends MongoCollectionClass {
26
26
  getCollectionName() {
27
27
  return 'organizations';
28
28
  }
29
- getCreateSchema() {
30
- return OrganizationSchema;
31
- }
32
29
  getEnvName() {
33
30
  return 'DATABASE_URI';
34
31
  }
@@ -1,11 +1,11 @@
1
1
  /* * */
2
2
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
3
- import { PlanSchema, UpdatePlanSchema } from '@tmlmobilidade/types';
3
+ import { CreatePlanSchema, UpdatePlanSchema } from '@tmlmobilidade/types';
4
4
  import { AsyncSingletonProxy } from '@tmlmobilidade/utils';
5
5
  /* * */
6
6
  class PlansClass extends MongoCollectionClass {
7
7
  static _instance;
8
- createSchema = PlanSchema;
8
+ createSchema = CreatePlanSchema;
9
9
  updateSchema = UpdatePlanSchema;
10
10
  constructor() {
11
11
  super();
@@ -1,5 +1,5 @@
1
1
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
2
- import { CreateRideAcceptanceDto, RideAcceptance, UpdateRideAcceptanceDto } from '@tmlmobilidade/types';
2
+ import { type CreateRideAcceptanceDto, type RideAcceptance, type UpdateRideAcceptanceDto } from '@tmlmobilidade/types';
3
3
  import { IndexDescription, InsertOneOptions, UpdateOptions } from 'mongodb';
4
4
  import { z } from 'zod';
5
5
  declare class RideAcceptanceClass extends MongoCollectionClass<RideAcceptance, CreateRideAcceptanceDto, UpdateRideAcceptanceDto> {
@@ -2,12 +2,12 @@
2
2
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
3
3
  import { HttpException, HttpStatus } from '@tmlmobilidade/consts';
4
4
  import { Dates } from '@tmlmobilidade/dates';
5
- import { RideAcceptanceSchema, UpdateRideAcceptanceSchema } from '@tmlmobilidade/types';
5
+ import { CreateRideAcceptanceSchema, UpdateRideAcceptanceSchema } from '@tmlmobilidade/types';
6
6
  import { AsyncSingletonProxy, compareObjects, flattenObject } from '@tmlmobilidade/utils';
7
7
  /* * */
8
8
  class RideAcceptanceClass extends MongoCollectionClass {
9
9
  static _instance;
10
- createSchema = RideAcceptanceSchema;
10
+ createSchema = CreateRideAcceptanceSchema;
11
11
  updateSchema = UpdateRideAcceptanceSchema;
12
12
  constructor() {
13
13
  super();
@@ -1,5 +1,5 @@
1
1
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
2
- import { CreateRideDto, Ride, UpdateRideDto } from '@tmlmobilidade/types';
2
+ import { type CreateRideDto, type Ride, type UpdateRideDto } from '@tmlmobilidade/types';
3
3
  import { IndexDescription } from 'mongodb';
4
4
  import { z } from 'zod';
5
5
  declare class RidesClass extends MongoCollectionClass<Ride, CreateRideDto, UpdateRideDto> {
@@ -1,11 +1,11 @@
1
1
  /* * */
2
2
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
3
- import { RideSchema, UpdateRideSchema } from '@tmlmobilidade/types';
3
+ import { CreateRideSchema, UpdateRideSchema } from '@tmlmobilidade/types';
4
4
  import { AsyncSingletonProxy } from '@tmlmobilidade/utils';
5
5
  /* * */
6
6
  class RidesClass extends MongoCollectionClass {
7
7
  static _instance;
8
- createSchema = RideSchema;
8
+ createSchema = CreateRideSchema;
9
9
  updateSchema = UpdateRideSchema;
10
10
  constructor() {
11
11
  super();
@@ -1,11 +1,11 @@
1
1
  /* * */
2
2
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
3
- import { SamSchema, UpdateSamSchema } from '@tmlmobilidade/types';
3
+ import { CreateSamSchema, UpdateSamSchema } from '@tmlmobilidade/types';
4
4
  import { AsyncSingletonProxy } from '@tmlmobilidade/utils';
5
5
  /* * */
6
6
  class SamsClass extends MongoCollectionClass {
7
7
  static _instance;
8
- createSchema = SamSchema;
8
+ createSchema = CreateSamSchema;
9
9
  updateSchema = UpdateSamSchema;
10
10
  constructor() {
11
11
  super();
@@ -1,11 +1,11 @@
1
1
  /* * */
2
2
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
3
- import { StopSchema, UpdateStopSchema } from '@tmlmobilidade/types';
3
+ import { CreateStopSchema, UpdateStopSchema } from '@tmlmobilidade/types';
4
4
  import { AsyncSingletonProxy } from '@tmlmobilidade/utils';
5
5
  /* * */
6
6
  class StopsClass extends MongoCollectionClass {
7
7
  static _instance;
8
- createSchema = StopSchema;
8
+ createSchema = CreateStopSchema;
9
9
  updateSchema = UpdateStopSchema;
10
10
  constructor() {
11
11
  super();
@@ -1,5 +1,5 @@
1
1
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
2
- import { CreateZoneDto, UpdateZoneDto, Zone } from '@tmlmobilidade/types';
2
+ import { type CreateZoneDto, type UpdateZoneDto, type Zone } from '@tmlmobilidade/types';
3
3
  import { IndexDescription } from 'mongodb';
4
4
  import { z } from 'zod';
5
5
  declare class ZonesClass extends MongoCollectionClass<Zone, CreateZoneDto, UpdateZoneDto> {
@@ -1,11 +1,11 @@
1
1
  /* * */
2
2
  import { MongoCollectionClass } from '../../common/mongo-collection.js';
3
- import { UpdateZoneSchema, ZoneSchema } from '@tmlmobilidade/types';
3
+ import { CreateZoneSchema, UpdateZoneSchema } from '@tmlmobilidade/types';
4
4
  import { AsyncSingletonProxy } from '@tmlmobilidade/utils';
5
5
  /* * */
6
6
  class ZonesClass extends MongoCollectionClass {
7
7
  static _instance;
8
- createSchema = ZoneSchema;
8
+ createSchema = CreateZoneSchema;
9
9
  updateSchema = UpdateZoneSchema;
10
10
  constructor() {
11
11
  super();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/interfaces",
3
- "version": "20251222.1647.5",
3
+ "version": "20251222.1756.6",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"