@glissandoo/lib 1.0.16 → 1.0.18

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/helpers/auth.d.ts CHANGED
@@ -7,14 +7,14 @@ export interface AuthUserClaims {
7
7
  }
8
8
  export declare enum AuthErrors {
9
9
  NoSuperAdmin = "error.auth.notSuperadmin",
10
- NoGroupAdmin = "error.auth.notroupAdmin",
10
+ NoGroupAdmin = "error.auth.notGroupAdmin",
11
11
  NoGroups = "error.auth.notGroups",
12
12
  NoFederationAdmin = "error.auth.noFederationAdmin",
13
13
  NoPartnerhispAdmin = "error.auth.noPartnershipAdmin",
14
- Unautenticated = "Unautenticated"
14
+ Unauthenticated = "error.auth.unauthenticated"
15
15
  }
16
16
  export interface AuthURLParams {
17
17
  error?: string;
18
18
  return_to?: string;
19
19
  }
20
- export declare const getRedirectSignIn: (params: AuthURLParams) => string;
20
+ export declare const getRedirectSignIn: (params?: AuthURLParams | undefined) => string;
package/helpers/auth.js CHANGED
@@ -5,16 +5,18 @@ const SIGNIN_PAGE = 'https://auth.glissandoo.com/signin';
5
5
  var AuthErrors;
6
6
  (function (AuthErrors) {
7
7
  AuthErrors["NoSuperAdmin"] = "error.auth.notSuperadmin";
8
- AuthErrors["NoGroupAdmin"] = "error.auth.notroupAdmin";
8
+ AuthErrors["NoGroupAdmin"] = "error.auth.notGroupAdmin";
9
9
  AuthErrors["NoGroups"] = "error.auth.notGroups";
10
10
  AuthErrors["NoFederationAdmin"] = "error.auth.noFederationAdmin";
11
11
  AuthErrors["NoPartnerhispAdmin"] = "error.auth.noPartnershipAdmin";
12
- AuthErrors["Unautenticated"] = "Unautenticated";
12
+ AuthErrors["Unauthenticated"] = "error.auth.unauthenticated";
13
13
  })(AuthErrors = exports.AuthErrors || (exports.AuthErrors = {}));
14
14
  const getRedirectSignIn = (params) => {
15
15
  const url = new URL(SIGNIN_PAGE);
16
- for (const param of Object.entries(params)) {
17
- url.searchParams.set(param[0], param[1]);
16
+ if (params) {
17
+ for (const param of Object.entries(params)) {
18
+ url.searchParams.set(param[0], param[1]);
19
+ }
18
20
  }
19
21
  return url.toString();
20
22
  };
@@ -21,6 +21,7 @@ export default class User extends UserBasic<UserData> {
21
21
  get language(): import("../../lang").LanguagesTypes;
22
22
  get createdAt(): FirebaseFirestore.Timestamp;
23
23
  get intercomId(): string | null;
24
+ get groups(): string[];
24
25
  get groupsAdmin(): string[];
25
26
  get isAdmin(): boolean;
26
27
  get birthDate(): FirebaseFirestore.Timestamp | null;
@@ -66,6 +66,9 @@ class User extends basic_1.default {
66
66
  get intercomId() {
67
67
  return this.data.intercom_id || null;
68
68
  }
69
+ get groups() {
70
+ return this.data.groups || [];
71
+ }
69
72
  get groupsAdmin() {
70
73
  return this.data.groups_admin || [];
71
74
  }
@@ -53,6 +53,7 @@ export interface UserData extends UserBasicData {
53
53
  deletedAt: Timestamp | null;
54
54
  partnershipId: string | null;
55
55
  federationId: string | null;
56
+ groups: string[];
56
57
  groups_admin: string[];
57
58
  birthDate: Timestamp | null;
58
59
  /** @deprecated */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",