@tmlmobilidade/interfaces 20251031.1036.20 → 20251103.1255.55

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,4 +1,4 @@
1
- import { CreateUserDto, LoginDto, Permission, Session, User } from '@tmlmobilidade/types';
1
+ import { CreateUserDto, LoginDto, OneOrTheOther, Permission, Session, User } from '@tmlmobilidade/types';
2
2
  declare class AuthProvider {
3
3
  private static _instance;
4
4
  /**
@@ -7,14 +7,15 @@ declare class AuthProvider {
7
7
  static getInstance(): Promise<AuthProvider>;
8
8
  /**
9
9
  * Get Permissions for a user based on their session token or user_id.
10
- * @param params - Object containing either sessionToken or user_id
10
+ * @param sessionToken - The session token (optional if user_id is provided)
11
+ * @param user_id - The user ID (optional if sessionToken is provided)
11
12
  * @returns The permissions that the user has
12
13
  */
13
- getPermissions<T>(params: {
14
+ getPermissions<T>(params: OneOrTheOther<{
14
15
  sessionToken: string;
15
- } | {
16
+ }, {
16
17
  user_id: string;
17
- }): Promise<Permission<T>[]>;
18
+ }>): Promise<Permission<T>[]>;
18
19
  /**
19
20
  * Gets a user by their session token.
20
21
  * @param sessionToken The session token to look up.
@@ -18,7 +18,8 @@ class AuthProvider {
18
18
  }
19
19
  /**
20
20
  * Get Permissions for a user based on their session token or user_id.
21
- * @param params - Object containing either sessionToken or user_id
21
+ * @param sessionToken - The session token (optional if user_id is provided)
22
+ * @param user_id - The user ID (optional if sessionToken is provided)
22
23
  * @returns The permissions that the user has
23
24
  */
24
25
  async getPermissions(params) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/interfaces",
3
- "version": "20251031.1036.20",
3
+ "version": "20251103.1255.55",
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",