@glissandoo/lib 1.7.10 → 1.8.0

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,3 +1,4 @@
1
+ import { EventPlayerReason } from '../models/Evento/Player/types';
1
2
  export declare namespace EventoPlayerFbFunctionsTypes {
2
3
  enum SwitchAssistanceActions {
3
4
  Confirm = "confirm",
@@ -9,6 +10,12 @@ export declare namespace EventoPlayerFbFunctionsTypes {
9
10
  action: SwitchAssistanceActions;
10
11
  }
11
12
  type SwitchAssistanceResult = void;
13
+ interface SetReasonAttendanceParams {
14
+ eventId: string;
15
+ note: string | null;
16
+ reason: EventPlayerReason | null;
17
+ }
18
+ type SetReasonAttendanceResult = void;
12
19
  interface EditParams {
13
20
  eventId: string;
14
21
  userIds: string[];
@@ -11,6 +11,7 @@ export declare enum FbFunctionName {
11
11
  EventOnUpdate = "event-onUpdate",
12
12
  EventPlayerEdit = "eventPlayer-edit",
13
13
  EventPlayerSwitchAssistance = "eventPlayer-switchAssistance",
14
+ EventPlayerSetReasonAttendance = "eventPlayer-setReasonAttendance",
14
15
  EventPublish = "event-publish",
15
16
  EventRemove = "event-remove",
16
17
  EventRepertoryDownloadPdf = "eventRepertory-downloadPdf",
@@ -94,6 +95,8 @@ export declare enum FbFunctionName {
94
95
  SubscriptionPaymentSchedule = "subscription-paymentSchedule",
95
96
  SubscriptionResume = "subscription-resume",
96
97
  UserOnCreateDoc = "user-onCreateDoc",
98
+ UserOnLogin = "user-onLogin",
99
+ UserOnSignUp = "user-onSignUp",
97
100
  UserOnUpdate = "user-onUpdate",
98
101
  UserRegister = "user-register",
99
102
  WebhookLemonway = "webhook-lemonway"
@@ -15,6 +15,7 @@ var FbFunctionName;
15
15
  FbFunctionName["EventOnUpdate"] = "event-onUpdate";
16
16
  FbFunctionName["EventPlayerEdit"] = "eventPlayer-edit";
17
17
  FbFunctionName["EventPlayerSwitchAssistance"] = "eventPlayer-switchAssistance";
18
+ FbFunctionName["EventPlayerSetReasonAttendance"] = "eventPlayer-setReasonAttendance";
18
19
  FbFunctionName["EventPublish"] = "event-publish";
19
20
  FbFunctionName["EventRemove"] = "event-remove";
20
21
  FbFunctionName["EventRepertoryDownloadPdf"] = "eventRepertory-downloadPdf";
@@ -98,6 +99,8 @@ var FbFunctionName;
98
99
  FbFunctionName["SubscriptionPaymentSchedule"] = "subscription-paymentSchedule";
99
100
  FbFunctionName["SubscriptionResume"] = "subscription-resume";
100
101
  FbFunctionName["UserOnCreateDoc"] = "user-onCreateDoc";
102
+ FbFunctionName["UserOnLogin"] = "user-onLogin";
103
+ FbFunctionName["UserOnSignUp"] = "user-onSignUp";
101
104
  FbFunctionName["UserOnUpdate"] = "user-onUpdate";
102
105
  FbFunctionName["UserRegister"] = "user-register";
103
106
  FbFunctionName["WebhookLemonway"] = "webhook-lemonway";
@@ -13,6 +13,8 @@ const regionByFunctions = {
13
13
  [index_1.FbFunctionName.UserRegister]: GCloudRegions.UsCentral1,
14
14
  [index_1.FbFunctionName.UserOnCreateDoc]: GCloudRegions.UsCentral1,
15
15
  [index_1.FbFunctionName.UserOnUpdate]: GCloudRegions.UsCentral1,
16
+ [index_1.FbFunctionName.UserOnLogin]: GCloudRegions.EuropeWest6,
17
+ [index_1.FbFunctionName.UserOnSignUp]: GCloudRegions.EuropeWest6,
16
18
  [index_1.FbFunctionName.JWTGenerate]: GCloudRegions.EuropeWest6,
17
19
  [index_1.FbFunctionName.GroupPublish]: GCloudRegions.EuropeWest6,
18
20
  [index_1.FbFunctionName.GroupEdit]: GCloudRegions.EuropeWest6,
@@ -51,6 +53,7 @@ const regionByFunctions = {
51
53
  [index_1.FbFunctionName.EventOnCreate]: GCloudRegions.UsCentral1,
52
54
  [index_1.FbFunctionName.EventOnUpdate]: GCloudRegions.UsCentral1,
53
55
  [index_1.FbFunctionName.EventPlayerSwitchAssistance]: GCloudRegions.UsCentral1,
56
+ [index_1.FbFunctionName.EventPlayerSetReasonAttendance]: GCloudRegions.EuropeWest6,
54
57
  [index_1.FbFunctionName.EventPlayerEdit]: GCloudRegions.UsCentral1,
55
58
  [index_1.FbFunctionName.EventRepertoryEdit]: GCloudRegions.UsCentral1,
56
59
  [index_1.FbFunctionName.EventRepertoryDownloadPdf]: GCloudRegions.EuropeWest6,
@@ -0,0 +1,6 @@
1
+ import { EventPlayerReason, EventPlayerStatus } from '../models/Evento/Player/types';
2
+ export declare const reasonEmojis: Record<EventPlayerReason, string>;
3
+ export declare const getOptionsByType: (type: EventPlayerStatus) => {
4
+ id: EventPlayerReason;
5
+ emoji: string;
6
+ }[];
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getOptionsByType = exports.reasonEmojis = void 0;
4
+ const types_1 = require("../models/Evento/Player/types");
5
+ exports.reasonEmojis = {
6
+ [types_1.EventPlayerReason.ArrivingLate]: '⏱',
7
+ [types_1.EventPlayerReason.LeavingEarly]: '🏃',
8
+ [types_1.EventPlayerReason.Sick]: '🤒',
9
+ [types_1.EventPlayerReason.Vacation]: '🏖',
10
+ [types_1.EventPlayerReason.Other]: '✏️',
11
+ };
12
+ const reasonsByType = {
13
+ [types_1.EventPlayerStatus.Confirmed]: [
14
+ types_1.EventPlayerReason.ArrivingLate,
15
+ types_1.EventPlayerReason.LeavingEarly,
16
+ types_1.EventPlayerReason.Other,
17
+ ],
18
+ [types_1.EventPlayerStatus.Declined]: [
19
+ types_1.EventPlayerReason.Vacation,
20
+ types_1.EventPlayerReason.Sick,
21
+ types_1.EventPlayerReason.Other,
22
+ ],
23
+ };
24
+ const getOptionsByType = (type) => {
25
+ const reasons = Object.values(reasonsByType[type] || {});
26
+ return reasons.map((id) => ({
27
+ id,
28
+ emoji: exports.reasonEmojis[id],
29
+ }));
30
+ };
31
+ exports.getOptionsByType = getOptionsByType;
@@ -4,6 +4,13 @@ export declare enum EventPlayerStatus {
4
4
  Confirmed = "confirmed",
5
5
  Declined = "declined"
6
6
  }
7
+ export declare enum EventPlayerReason {
8
+ Sick = "Sick",
9
+ Vacation = "Vacation",
10
+ ArrivingLate = "ArrivingLate",
11
+ LeavingEarly = "LeavingEarly",
12
+ Other = "Other"
13
+ }
7
14
  export interface EventPlayerData extends EventPlayerBasicData {
8
15
  joinedAt: Timestamp;
9
16
  rollCalledAt: Timestamp | null;
@@ -1,8 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EventPlayerStatus = void 0;
3
+ exports.EventPlayerReason = exports.EventPlayerStatus = void 0;
4
4
  var EventPlayerStatus;
5
5
  (function (EventPlayerStatus) {
6
6
  EventPlayerStatus["Confirmed"] = "confirmed";
7
7
  EventPlayerStatus["Declined"] = "declined";
8
8
  })(EventPlayerStatus = exports.EventPlayerStatus || (exports.EventPlayerStatus = {}));
9
+ var EventPlayerReason;
10
+ (function (EventPlayerReason) {
11
+ EventPlayerReason["Sick"] = "Sick";
12
+ EventPlayerReason["Vacation"] = "Vacation";
13
+ EventPlayerReason["ArrivingLate"] = "ArrivingLate";
14
+ EventPlayerReason["LeavingEarly"] = "LeavingEarly";
15
+ EventPlayerReason["Other"] = "Other";
16
+ })(EventPlayerReason = exports.EventPlayerReason || (exports.EventPlayerReason = {}));
@@ -3,7 +3,7 @@ import { StageTemplate } from '../../helpers/types';
3
3
  import { GroupBasicData } from '../Group/types';
4
4
  import { PlayerBasicData } from '../Player/types';
5
5
  import { ThemeBasicData } from '../Repertory/types';
6
- import { EventPlayerStatus } from './Player/types';
6
+ import { EventPlayerReason, EventPlayerStatus } from './Player/types';
7
7
  export declare enum EventFiles {
8
8
  StageThumbnail = "stageThumbnail.png",
9
9
  StagePDF = "stage.pdf",
@@ -35,6 +35,8 @@ export interface EventViewer {
35
35
  }
36
36
  export declare type EventStage = Pick<StageTemplate, 'boardMap' | 'boardSettings'>;
37
37
  export interface EventPlayerBasicData extends PlayerBasicData {
38
+ note?: string | null;
39
+ reason?: EventPlayerReason | null;
38
40
  status: EventPlayerStatus | null;
39
41
  rollcall: EventPlayerStatus | null;
40
42
  }
@@ -48,4 +48,5 @@ export default class User extends UserBasic<UserData> {
48
48
  };
49
49
  getAppConfig(value: UserAppConfig): string | import("./types").UserEventsFilter | null;
50
50
  get registerVia(): import("./types").UserRegisterVia;
51
+ get lastAppLoginAt(): FirebaseFirestore.Timestamp | null;
51
52
  }
@@ -122,5 +122,8 @@ class User extends basic_1.default {
122
122
  get registerVia() {
123
123
  return this.data.registerVia || null;
124
124
  }
125
+ get lastAppLoginAt() {
126
+ return this.data.lastAppLoginAt || null;
127
+ }
125
128
  }
126
129
  exports.default = User;
@@ -64,6 +64,7 @@ export interface UserData extends UserBasicData {
64
64
  [UserAppConfig.DefaultEventsFilter]: UserEventsFilter;
65
65
  };
66
66
  registerVia: UserRegisterVia;
67
+ lastAppLoginAt: Timestamp | null;
67
68
  }
68
69
  export interface AUserBasicData extends UserBasicData {
69
70
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.7.10",
3
+ "version": "1.8.0",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",