@glissandoo/lib 1.8.0 → 1.9.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.
- package/functions/communication.d.ts +3 -3
- package/functions/event.d.ts +3 -0
- package/helpers/slate.d.ts +15 -0
- package/helpers/slate.js +2 -0
- package/helpers/utils.d.ts +2 -2
- package/helpers/utils.js +2 -3
- package/models/Communication/index.d.ts +1 -1
- package/models/Communication/types.d.ts +2 -2
- package/models/Evento/Player/index.d.ts +2 -0
- package/models/Evento/Player/index.js +6 -0
- package/models/Evento/index.d.ts +1 -0
- package/models/Evento/index.js +3 -0
- package/models/Evento/types.d.ts +2 -0
- package/package.json +1 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Descendant } from '../helpers/slate';
|
|
2
2
|
import { CommunicationType } from '../models/Communication/types';
|
|
3
3
|
export declare namespace CommunicationFbFunctionsTypes {
|
|
4
4
|
interface PublishParams {
|
|
5
5
|
commId: string;
|
|
6
6
|
groupId: string;
|
|
7
7
|
title: string;
|
|
8
|
-
message:
|
|
8
|
+
message: Descendant[];
|
|
9
9
|
recipients: string[];
|
|
10
10
|
templateId: string | null;
|
|
11
11
|
type: CommunicationType;
|
|
@@ -17,7 +17,7 @@ export declare namespace CommunicationFbFunctionsTypes {
|
|
|
17
17
|
commId: string;
|
|
18
18
|
groupId: string;
|
|
19
19
|
title: string;
|
|
20
|
-
message:
|
|
20
|
+
message: Descendant[];
|
|
21
21
|
recipients: string[];
|
|
22
22
|
templateId: string | null;
|
|
23
23
|
type: CommunicationType;
|
package/functions/event.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Descendant } from '../helpers/slate';
|
|
1
2
|
import { EventPlayerStatus } from '../models/Evento/Player/types';
|
|
2
3
|
import { EventRepeatPeriod, EventStage, EventType } from '../models/Evento/types';
|
|
3
4
|
export declare namespace EventoFbFunctionsTypes {
|
|
@@ -16,6 +17,7 @@ export declare namespace EventoFbFunctionsTypes {
|
|
|
16
17
|
datetimeEnd: number;
|
|
17
18
|
userIds: string[];
|
|
18
19
|
description: string | null;
|
|
20
|
+
descriptionSlate: Descendant[];
|
|
19
21
|
period: EventRepeatPeriod | null;
|
|
20
22
|
until: number | null;
|
|
21
23
|
timezone: string;
|
|
@@ -63,6 +65,7 @@ export declare namespace EventoFbFunctionsTypes {
|
|
|
63
65
|
scope: EditScope.Comments;
|
|
64
66
|
value: {
|
|
65
67
|
description: string | null;
|
|
68
|
+
descriptionSlate: Descendant[];
|
|
66
69
|
};
|
|
67
70
|
}
|
|
68
71
|
type EditCommentsParams = EditCommentsData & EditParamsBase;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare type Descendant = Element | Text;
|
|
2
|
+
export declare type Element = ExtendedType<'Element', BaseElement>;
|
|
3
|
+
export interface BaseElement {
|
|
4
|
+
children: Descendant[];
|
|
5
|
+
}
|
|
6
|
+
export declare type Text = ExtendedType<'Text', BaseText>;
|
|
7
|
+
export interface BaseText {
|
|
8
|
+
text: string;
|
|
9
|
+
}
|
|
10
|
+
declare type ExtendableTypes = 'Editor' | 'Element' | 'Text';
|
|
11
|
+
export interface CustomTypes {
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
export declare type ExtendedType<K extends ExtendableTypes, B> = unknown extends CustomTypes[K] ? B : CustomTypes[K];
|
|
15
|
+
export {};
|
package/helpers/slate.js
ADDED
package/helpers/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Node } from 'slate';
|
|
2
1
|
import { LanguagesTypes } from '../lang';
|
|
3
2
|
import { MetaNotificationData } from '../models/User/Notification/types';
|
|
3
|
+
import { Descendant } from './slate';
|
|
4
4
|
export declare const replaceVarsBrackets: (string: string, values: MetaNotificationData) => string;
|
|
5
5
|
export declare const replaceKeysNotification: (string: string, values: MetaNotificationData, lang: LanguagesTypes) => string;
|
|
6
|
-
export declare const serializeSlateBlock: (nodes:
|
|
6
|
+
export declare const serializeSlateBlock: (nodes: Descendant[]) => string;
|
package/helpers/utils.js
CHANGED
|
@@ -90,9 +90,8 @@ const serializeSlateBlock = (nodes) => {
|
|
|
90
90
|
if (children) {
|
|
91
91
|
return exports.serializeSlateBlock(children);
|
|
92
92
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
93
|
+
const text = get_1.default(node, 'text');
|
|
94
|
+
return text || '';
|
|
96
95
|
})
|
|
97
96
|
.join(' ');
|
|
98
97
|
};
|
|
@@ -6,7 +6,7 @@ export default class Communication extends Model<CommunicationData> {
|
|
|
6
6
|
protected lang: LanguagesTypes;
|
|
7
7
|
constructor(doc: DocumentSnapshot, lang?: LanguagesTypes);
|
|
8
8
|
get title(): string;
|
|
9
|
-
get message(): import("slate").
|
|
9
|
+
get message(): import("../../helpers/slate").Descendant[];
|
|
10
10
|
get promoter(): DocumentReference;
|
|
11
11
|
get promoterInfo(): import("../Group/types").GroupTinyData;
|
|
12
12
|
get owner(): DocumentReference;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentReference, Timestamp } from '@google-cloud/firestore';
|
|
2
|
-
import {
|
|
2
|
+
import { Descendant } from '../../helpers/slate';
|
|
3
3
|
import { GroupTinyData } from '../Group/types';
|
|
4
4
|
import { UserTinyData } from '../User/types';
|
|
5
5
|
export declare enum CommunicationType {
|
|
@@ -45,7 +45,7 @@ export interface CommunicationRecipientData {
|
|
|
45
45
|
}
|
|
46
46
|
export interface CommunicationData {
|
|
47
47
|
title: string;
|
|
48
|
-
message:
|
|
48
|
+
message: Descendant[];
|
|
49
49
|
type: CommunicationType;
|
|
50
50
|
readonly promoter: DocumentReference;
|
|
51
51
|
promoterInfo: GroupTinyData;
|
|
@@ -14,4 +14,6 @@ export default class EventoPlayer extends PlayerBasic<EventPlayerData> {
|
|
|
14
14
|
get isRollCallConfirmed(): boolean;
|
|
15
15
|
get isRollCallDeclined(): boolean;
|
|
16
16
|
get rollCalledAt(): firestore.Timestamp | null;
|
|
17
|
+
get reason(): import("./types").EventPlayerReason | null;
|
|
18
|
+
get note(): string | null;
|
|
17
19
|
}
|
|
@@ -41,5 +41,11 @@ class EventoPlayer extends basic_1.default {
|
|
|
41
41
|
get rollCalledAt() {
|
|
42
42
|
return this.data.rollCalledAt || null;
|
|
43
43
|
}
|
|
44
|
+
get reason() {
|
|
45
|
+
return this.data.reason || null;
|
|
46
|
+
}
|
|
47
|
+
get note() {
|
|
48
|
+
return this.data.note || null;
|
|
49
|
+
}
|
|
44
50
|
}
|
|
45
51
|
exports.default = EventoPlayer;
|
package/models/Evento/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export default class Evento extends EventoPromoter<EventData> {
|
|
|
10
10
|
get videoURL(): string | null;
|
|
11
11
|
get coverURL(): string | null;
|
|
12
12
|
get description(): string | null;
|
|
13
|
+
get descriptionSlate(): import("../../helpers/slate").Descendant[];
|
|
13
14
|
get owner(): DocumentReference;
|
|
14
15
|
get relEvents(): string[];
|
|
15
16
|
get isASerie(): boolean;
|
package/models/Evento/index.js
CHANGED
package/models/Evento/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DocumentReference, GeoPoint, Timestamp } from '@google-cloud/firestore';
|
|
2
|
+
import { Descendant } from '../../helpers/slate';
|
|
2
3
|
import { StageTemplate } from '../../helpers/types';
|
|
3
4
|
import { GroupBasicData } from '../Group/types';
|
|
4
5
|
import { PlayerBasicData } from '../Player/types';
|
|
@@ -68,6 +69,7 @@ export interface EventData extends EventPromoterData {
|
|
|
68
69
|
coverURL: string | null;
|
|
69
70
|
videoURL: string | null;
|
|
70
71
|
description: string | null;
|
|
72
|
+
descriptionSlate: Descendant[];
|
|
71
73
|
playerIds: string[];
|
|
72
74
|
players: Record<string, EventPlayerBasicData>;
|
|
73
75
|
repertoryIds: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glissandoo/lib",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Glissandoo library js",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/lodash": "^4.14.168",
|
|
31
31
|
"@types/node": "^12.19.13",
|
|
32
|
-
"@types/slate": "^0.47.8",
|
|
33
32
|
"@typescript-eslint/eslint-plugin": "^4.22.0",
|
|
34
33
|
"@typescript-eslint/parser": "^4.22.0",
|
|
35
34
|
"eslint": "^7.24.0",
|