@glissandoo/lib 1.60.0 → 1.61.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/auth.js +1 -2
- package/functions/communication.js +1 -2
- package/functions/communicationComment.js +1 -2
- package/functions/customer.js +1 -2
- package/functions/customerGroup.js +1 -2
- package/functions/event.js +2 -5
- package/functions/eventPlayer.js +2 -5
- package/functions/eventRepertory.js +1 -2
- package/functions/federation.js +1 -2
- package/functions/federationPartnership.js +1 -2
- package/functions/group.js +1 -2
- package/functions/groupPlayer.js +1 -2
- package/functions/groupRepertory.js +1 -2
- package/functions/index.js +2 -5
- package/functions/jwt.js +1 -2
- package/functions/misc.js +1 -2
- package/functions/notification.js +1 -2
- package/functions/partner.js +1 -2
- package/functions/partnership.js +1 -2
- package/functions/partnershipGroup.js +1 -2
- package/functions/partnershipPlan.js +1 -2
- package/functions/regions.js +124 -128
- package/functions/subscription.js +1 -2
- package/functions/user.js +1 -2
- package/helpers/appScenes.js +2 -5
- package/helpers/audios.js +5 -9
- package/helpers/auth.js +5 -9
- package/helpers/badges.js +10 -19
- package/helpers/collections.js +2 -5
- package/helpers/countries.js +1 -4
- package/helpers/dlinks.js +2 -5
- package/helpers/errors.js +2 -5
- package/helpers/fileSections/index.js +5 -8
- package/helpers/fileSections/orders.js +11 -16
- package/helpers/glissandooAdmin.js +2 -6
- package/helpers/instruments/index.js +3 -6
- package/helpers/instruments/lists.js +11 -19
- package/helpers/musicStyles/index.js +29 -36
- package/helpers/musicStyles/orders.js +174 -179
- package/helpers/notifications/index.js +119 -122
- package/helpers/notifications/placeholders.js +18 -26
- package/helpers/objects.js +15 -23
- package/helpers/payments.js +5 -8
- package/helpers/plans.js +6 -9
- package/helpers/rates.js +2 -6
- package/helpers/reasons.js +17 -21
- package/helpers/slate.js +5 -12
- package/helpers/styles.js +1 -4
- package/helpers/ts-extras/array-includes.js +1 -5
- package/helpers/ts-extras/as-mutable.js +1 -5
- package/helpers/ts-extras/assert-error.js +1 -5
- package/helpers/ts-extras/index.js +15 -33
- package/helpers/ts-extras/is-defined.js +1 -5
- package/helpers/ts-extras/is-empty.js +1 -5
- package/helpers/ts-extras/is-finite.js +1 -4
- package/helpers/ts-extras/is-infinite.js +1 -5
- package/helpers/ts-extras/is-integer.js +1 -4
- package/helpers/ts-extras/is-present.js +1 -5
- package/helpers/ts-extras/is-safe-integer.js +1 -4
- package/helpers/ts-extras/object-entries.js +1 -4
- package/helpers/ts-extras/object-from-entries.js +1 -4
- package/helpers/ts-extras/object-has-own.js +1 -5
- package/helpers/ts-extras/object-keys.js +1 -4
- package/helpers/ts-extras/set-has.js +1 -5
- package/helpers/types.js +2 -5
- package/helpers/utils.js +8 -16
- package/lang/index.js +42 -51
- package/models/Communication/Comment/index.d.ts +4 -4
- package/models/Communication/Comment/index.js +5 -12
- package/models/Communication/Comment/types.js +1 -2
- package/models/Communication/index.d.ts +3 -2
- package/models/Communication/index.js +15 -21
- package/models/Communication/types.js +4 -7
- package/models/Counters/Group/Analytics/index.d.ts +2 -3
- package/models/Counters/Group/Analytics/index.js +5 -12
- package/models/Counters/Group/Analytics/types.js +2 -5
- package/models/Counters/Group/index.d.ts +2 -3
- package/models/Counters/Group/index.js +2 -8
- package/models/Counters/Group/types.js +1 -2
- package/models/Counters/event.d.ts +2 -2
- package/models/Counters/event.js +2 -8
- package/models/Counters/index.d.ts +2 -3
- package/models/Counters/index.js +2 -8
- package/models/Counters/types.js +1 -2
- package/models/Customer/Group/index.d.ts +2 -2
- package/models/Customer/Group/index.js +7 -14
- package/models/Customer/Group/types.js +1 -2
- package/models/Customer/basic.d.ts +2 -3
- package/models/Customer/basic.js +4 -10
- package/models/Customer/index.d.ts +2 -2
- package/models/Customer/index.js +5 -11
- package/models/Customer/types.js +2 -5
- package/models/Evento/Player/basic.js +10 -11
- package/models/Evento/Player/index.d.ts +4 -4
- package/models/Evento/Player/index.js +12 -18
- package/models/Evento/Player/types.js +4 -7
- package/models/Evento/Repertory/index.d.ts +3 -3
- package/models/Evento/Repertory/index.js +3 -10
- package/models/Evento/Repertory/types.js +1 -2
- package/models/Evento/basic.d.ts +2 -2
- package/models/Evento/basic.js +12 -18
- package/models/Evento/index.d.ts +3 -2
- package/models/Evento/index.js +32 -38
- package/models/Evento/promoter.d.ts +3 -2
- package/models/Evento/promoter.js +2 -8
- package/models/Evento/tiny.js +9 -9
- package/models/Evento/types.js +14 -17
- package/models/Federation/Partnership/index.d.ts +2 -2
- package/models/Federation/Partnership/index.js +3 -10
- package/models/Federation/Partnership/types.js +1 -2
- package/models/Federation/index.d.ts +2 -3
- package/models/Federation/index.js +7 -13
- package/models/Federation/types.js +1 -2
- package/models/Group/Analytics/index.d.ts +3 -4
- package/models/Group/Analytics/index.js +5 -12
- package/models/Group/Analytics/types.js +2 -5
- package/models/Group/Event/index.d.ts +2 -2
- package/models/Group/Event/index.js +6 -12
- package/models/Group/Event/types.js +1 -2
- package/models/Group/Player/Event/index.d.ts +2 -2
- package/models/Group/Player/Event/index.js +11 -18
- package/models/Group/Player/Event/types.js +1 -2
- package/models/Group/Player/Log/index.d.ts +2 -3
- package/models/Group/Player/Log/index.js +2 -8
- package/models/Group/Player/Log/types.js +1 -2
- package/models/Group/Player/index.d.ts +5 -5
- package/models/Group/Player/index.js +18 -24
- package/models/Group/Player/types.js +2 -5
- package/models/Group/Repertory/File/Section/index.js +12 -16
- package/models/Group/Repertory/File/Section/types.js +2 -5
- package/models/Group/Repertory/File/index.js +11 -12
- package/models/Group/Repertory/File/types.js +1 -2
- package/models/Group/Repertory/FilePath/index.js +12 -15
- package/models/Group/Repertory/index.d.ts +8 -8
- package/models/Group/Repertory/index.js +25 -32
- package/models/Group/Repertory/types.js +2 -5
- package/models/Group/StageTemplate/index.d.ts +2 -3
- package/models/Group/StageTemplate/index.js +2 -8
- package/models/Group/StageTemplate/types.js +1 -2
- package/models/Group/basic.d.ts +2 -2
- package/models/Group/basic.js +5 -11
- package/models/Group/index.d.ts +3 -2
- package/models/Group/index.js +41 -47
- package/models/Group/types.js +14 -17
- package/models/Instrument/group.js +6 -11
- package/models/Instrument/index.js +8 -9
- package/models/Metrics/index.d.ts +4 -5
- package/models/Metrics/index.js +10 -16
- package/models/Metrics/types.js +1 -2
- package/models/Model/index.d.ts +15 -3
- package/models/Model/index.js +8 -7
- package/models/Model/lang.d.ts +2 -3
- package/models/Model/lang.js +5 -10
- package/models/MusicStyle/index.js +9 -10
- package/models/Notification/index.d.ts +4 -5
- package/models/Notification/index.js +2 -8
- package/models/Notification/types.js +2 -5
- package/models/Partner/basic.d.ts +2 -2
- package/models/Partner/basic.js +6 -12
- package/models/Partner/index.d.ts +2 -2
- package/models/Partner/index.js +4 -10
- package/models/Partner/tiny.d.ts +2 -3
- package/models/Partner/tiny.js +2 -8
- package/models/Partner/types.js +2 -5
- package/models/Partnership/Group/index.d.ts +2 -2
- package/models/Partnership/Group/index.js +5 -12
- package/models/Partnership/Group/types.js +1 -2
- package/models/Partnership/Partner/Subscription/index.d.ts +2 -2
- package/models/Partnership/Partner/Subscription/index.js +8 -15
- package/models/Partnership/Partner/Subscription/types.js +2 -5
- package/models/Partnership/Partner/index.d.ts +2 -2
- package/models/Partnership/Partner/index.js +3 -10
- package/models/Partnership/Partner/types.js +1 -2
- package/models/Partnership/Payment/index.d.ts +2 -2
- package/models/Partnership/Payment/index.js +2 -8
- package/models/Partnership/Payment/types.js +1 -2
- package/models/Partnership/Plan/basic.d.ts +2 -3
- package/models/Partnership/Plan/basic.js +12 -18
- package/models/Partnership/Plan/index.d.ts +2 -2
- package/models/Partnership/Plan/index.js +3 -10
- package/models/Partnership/Plan/types.js +2 -5
- package/models/Partnership/basic.d.ts +2 -3
- package/models/Partnership/basic.js +4 -10
- package/models/Partnership/index.d.ts +2 -2
- package/models/Partnership/index.js +5 -11
- package/models/Partnership/types.js +4 -7
- package/models/Payment/basic.d.ts +3 -4
- package/models/Payment/basic.js +7 -13
- package/models/Payment/index.d.ts +2 -2
- package/models/Payment/index.js +2 -8
- package/models/Payment/types.js +4 -7
- package/models/Player/basic.d.ts +2 -2
- package/models/Player/basic.js +4 -10
- package/models/Player/types.js +1 -2
- package/models/Repertory/basic.d.ts +2 -3
- package/models/Repertory/basic.js +2 -8
- package/models/Repertory/types.js +1 -2
- package/models/User/Group/index.d.ts +2 -2
- package/models/User/Group/index.js +8 -15
- package/models/User/Group/types.js +1 -2
- package/models/User/Notification/index.d.ts +6 -6
- package/models/User/Notification/index.js +18 -20
- package/models/User/Notification/types.js +1 -2
- package/models/User/basic.d.ts +2 -2
- package/models/User/basic.js +4 -10
- package/models/User/index.d.ts +2 -2
- package/models/User/index.js +18 -24
- package/models/User/types.js +12 -15
- package/models/WebhookEvent/index.d.ts +2 -3
- package/models/WebhookEvent/index.js +2 -8
- package/models/WebhookEvent/types.js +2 -5
- package/package.json +1 -1
- package/types/firestore.js +2 -5
- package/types/messagebirdChatWidget.js +1 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { DocumentSnapshot } from '@google-cloud/firestore';
|
|
2
1
|
import { LanguagesTypes } from '../../../lang';
|
|
3
2
|
import GroupBasic from '../../Group/basic';
|
|
4
3
|
import { GroupPlayerRole } from '../../Group/Player/types';
|
|
4
|
+
import { DocumentModel } from '../../Model';
|
|
5
5
|
import { UserGroupData } from './types';
|
|
6
6
|
export default class UserGroup extends GroupBasic<UserGroupData> {
|
|
7
|
-
constructor(doc:
|
|
7
|
+
constructor(doc: DocumentModel, lang?: LanguagesTypes);
|
|
8
8
|
get groupId(): string;
|
|
9
9
|
get mainInstrument(): import("../../../helpers/instruments").InstrumentId;
|
|
10
10
|
get instrument(): string;
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const lodash_1 = require("lodash");
|
|
7
|
-
const lang_1 = require("../../../lang");
|
|
8
|
-
const basic_1 = __importDefault(require("../../Group/basic"));
|
|
9
|
-
const types_1 = require("../../Group/Player/types");
|
|
10
|
-
class UserGroup extends basic_1.default {
|
|
11
|
-
constructor(doc, lang = lang_1.defaultLocale) {
|
|
1
|
+
import { defaultLocale, getTranslation } from '../../../lang';
|
|
2
|
+
import GroupBasic from '../../Group/basic';
|
|
3
|
+
import { GroupPlayerRole } from '../../Group/Player/types';
|
|
4
|
+
export default class UserGroup extends GroupBasic {
|
|
5
|
+
constructor(doc, lang = defaultLocale) {
|
|
12
6
|
super(doc, lang);
|
|
13
7
|
}
|
|
14
8
|
get groupId() {
|
|
15
|
-
return
|
|
9
|
+
return this.ref.path.split('/').at(-3);
|
|
16
10
|
}
|
|
17
11
|
get mainInstrument() {
|
|
18
12
|
return this.data.mainInstrument;
|
|
19
13
|
}
|
|
20
14
|
get instrument() {
|
|
21
|
-
const translation =
|
|
15
|
+
const translation = getTranslation(`instruments.${this.mainInstrument}`, this.lang);
|
|
22
16
|
return translation || this.mainInstrument;
|
|
23
17
|
}
|
|
24
18
|
get instruments() {
|
|
@@ -28,10 +22,9 @@ class UserGroup extends basic_1.default {
|
|
|
28
22
|
return this.data.role;
|
|
29
23
|
}
|
|
30
24
|
get isAdmin() {
|
|
31
|
-
return this.data.role ===
|
|
25
|
+
return this.data.role === GroupPlayerRole.Admin;
|
|
32
26
|
}
|
|
33
27
|
get joinedAt() {
|
|
34
28
|
return this.data.joinedAt;
|
|
35
29
|
}
|
|
36
30
|
}
|
|
37
|
-
exports.default = UserGroup;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as firestore from '@google-cloud/firestore';
|
|
2
1
|
import { LanguagesTypes } from '../../../lang';
|
|
3
|
-
import Model from '../../Model';
|
|
2
|
+
import Model, { DocumentModel } from '../../Model';
|
|
4
3
|
import { UserNotificationData } from './types';
|
|
5
4
|
export default class Notification extends Model<UserNotificationData> {
|
|
6
5
|
private lang;
|
|
7
|
-
constructor(doc:
|
|
6
|
+
constructor(doc: DocumentModel, lang?: LanguagesTypes);
|
|
8
7
|
private getTranslationByAction;
|
|
9
|
-
protected get references():
|
|
8
|
+
protected get references(): FirebaseFirestore.DocumentReference<FirebaseFirestore.DocumentData, FirebaseFirestore.DocumentData>[];
|
|
9
|
+
get userId(): string;
|
|
10
10
|
get photoURL(): string;
|
|
11
11
|
get meta(): import("./types").MetaNotificationData;
|
|
12
12
|
get action(): import("../../Notification/types").NotificationActions;
|
|
@@ -18,9 +18,9 @@ export default class Notification extends Model<UserNotificationData> {
|
|
|
18
18
|
get scene(): string;
|
|
19
19
|
get propsScene(): Record<string, string>;
|
|
20
20
|
get url(): string;
|
|
21
|
-
get createdAt():
|
|
21
|
+
get createdAt(): FirebaseFirestore.Timestamp;
|
|
22
22
|
get timestamp(): number;
|
|
23
|
-
get sendedAt():
|
|
23
|
+
get sendedAt(): FirebaseFirestore.Timestamp | null;
|
|
24
24
|
private get readedAt();
|
|
25
25
|
get isReaded(): boolean;
|
|
26
26
|
}
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const lang_1 = require("../../../lang");
|
|
9
|
-
const Model_1 = __importDefault(require("../../Model"));
|
|
10
|
-
class Notification extends Model_1.default {
|
|
11
|
-
constructor(doc, lang = lang_1.defaultLocale) {
|
|
1
|
+
import { get } from 'lodash';
|
|
2
|
+
import { replaceKeysNotification, replaceVarsBrackets, } from '../../../helpers/notifications/placeholders';
|
|
3
|
+
import { defaultLocale, getTranslation } from '../../../lang';
|
|
4
|
+
import Model from '../../Model';
|
|
5
|
+
export default class Notification extends Model {
|
|
6
|
+
lang;
|
|
7
|
+
constructor(doc, lang = defaultLocale) {
|
|
12
8
|
super(doc);
|
|
13
|
-
this.getTranslationByAction = (key) => {
|
|
14
|
-
const translation = (0, lang_1.getTranslation)(`${this.action}.${key}`, this.lang);
|
|
15
|
-
return !translation
|
|
16
|
-
? this.action
|
|
17
|
-
: (0, placeholders_1.replaceKeysNotification)(translation, this.meta, this.lang);
|
|
18
|
-
};
|
|
19
9
|
this.lang = lang;
|
|
20
10
|
}
|
|
11
|
+
getTranslationByAction = (key) => {
|
|
12
|
+
const translation = getTranslation(`${this.action}.${key}`, this.lang);
|
|
13
|
+
return !translation
|
|
14
|
+
? this.action
|
|
15
|
+
: replaceKeysNotification(translation, this.meta, this.lang);
|
|
16
|
+
};
|
|
21
17
|
// Uso para consultas
|
|
22
18
|
get references() {
|
|
23
19
|
return this.data.references || [];
|
|
24
20
|
}
|
|
21
|
+
get userId() {
|
|
22
|
+
return this.ref.path.split('/').at(-3);
|
|
23
|
+
}
|
|
25
24
|
get photoURL() {
|
|
26
25
|
return this.data.photoURL;
|
|
27
26
|
}
|
|
@@ -32,7 +31,7 @@ class Notification extends Model_1.default {
|
|
|
32
31
|
return this.data.action;
|
|
33
32
|
}
|
|
34
33
|
get cleanPhotoURL() {
|
|
35
|
-
return this.isAvatar ?
|
|
34
|
+
return this.isAvatar ? replaceVarsBrackets(this.photoURL, this.meta) : this.photoURL;
|
|
36
35
|
}
|
|
37
36
|
get isAvatar() {
|
|
38
37
|
return this.photoURL.slice(0, 1) === '[' && this.photoURL.slice(-1) === ']';
|
|
@@ -42,7 +41,7 @@ class Notification extends Model_1.default {
|
|
|
42
41
|
return null;
|
|
43
42
|
}
|
|
44
43
|
const params = this.photoURL.substr(1).slice(0, -1).split('.');
|
|
45
|
-
return
|
|
44
|
+
return get(this.meta, [params[0], params[1]]) || null;
|
|
46
45
|
}
|
|
47
46
|
get title() {
|
|
48
47
|
return this.getTranslationByAction('title');
|
|
@@ -75,4 +74,3 @@ class Notification extends Model_1.default {
|
|
|
75
74
|
return this.readedAt !== null;
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
|
-
exports.default = Notification;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/models/User/basic.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DocumentSnapshot } from '@google-cloud/firestore';
|
|
2
1
|
import { LanguagesTypes } from '../../lang';
|
|
2
|
+
import { DocumentModel } from '../Model';
|
|
3
3
|
import ModelWithLang from '../Model/lang';
|
|
4
4
|
import { UserBasicData, UserTinyData } from './types';
|
|
5
5
|
export default class UserBasic<D> extends ModelWithLang<D & UserBasicData> {
|
|
6
|
-
constructor(doc:
|
|
6
|
+
constructor(doc: DocumentModel, lang?: LanguagesTypes);
|
|
7
7
|
get tinyInfo(): UserTinyData;
|
|
8
8
|
get basicInfo(): UserBasicData;
|
|
9
9
|
get displayName(): string;
|
package/models/User/basic.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const lang_1 = require("../../lang");
|
|
7
|
-
const lang_2 = __importDefault(require("../Model/lang"));
|
|
8
|
-
class UserBasic extends lang_2.default {
|
|
9
|
-
constructor(doc, lang = lang_1.defaultLocale) {
|
|
1
|
+
import { defaultLocale } from '../../lang';
|
|
2
|
+
import ModelWithLang from '../Model/lang';
|
|
3
|
+
export default class UserBasic extends ModelWithLang {
|
|
4
|
+
constructor(doc, lang = defaultLocale) {
|
|
10
5
|
super(doc, lang);
|
|
11
6
|
}
|
|
12
7
|
get tinyInfo() {
|
|
@@ -32,4 +27,3 @@ class UserBasic extends lang_2.default {
|
|
|
32
27
|
return this.data.photoURL;
|
|
33
28
|
}
|
|
34
29
|
}
|
|
35
|
-
exports.default = UserBasic;
|
package/models/User/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DocumentSnapshot } from '@google-cloud/firestore';
|
|
2
1
|
import { LanguagesTypes } from '../../lang';
|
|
2
|
+
import { DocumentModel } from '../Model';
|
|
3
3
|
import UserBasic from './basic';
|
|
4
4
|
import { UserAppConfig, UserData, UserEmailSettings, UserNotificationSettings, UserRole } from './types';
|
|
5
5
|
export default class User extends UserBasic<UserData> {
|
|
6
|
-
constructor(doc:
|
|
6
|
+
constructor(doc: DocumentModel);
|
|
7
7
|
get name(): string;
|
|
8
8
|
get lastName(): string;
|
|
9
9
|
get locality(): string | null;
|
package/models/User/index.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const utils_1 = require("../../helpers/utils");
|
|
11
|
-
const lang_1 = require("../../lang");
|
|
12
|
-
const basic_1 = __importDefault(require("./basic"));
|
|
13
|
-
const types_1 = require("./types");
|
|
14
|
-
class User extends basic_1.default {
|
|
1
|
+
import { isNull, isString } from 'lodash';
|
|
2
|
+
import { CollectionNames } from '../../helpers/collections';
|
|
3
|
+
import { getGlissandooAdminEntityURL } from '../../helpers/glissandooAdmin';
|
|
4
|
+
import { mapToArray } from '../../helpers/objects';
|
|
5
|
+
import { enumToObj } from '../../helpers/utils';
|
|
6
|
+
import { defaultLocale } from '../../lang';
|
|
7
|
+
import UserBasic from './basic';
|
|
8
|
+
import { UserEmailSettings, UserNotificationSettings, UserRole, } from './types';
|
|
9
|
+
export default class User extends UserBasic {
|
|
15
10
|
constructor(doc) {
|
|
16
|
-
super(doc, doc.get('language') ||
|
|
11
|
+
super(doc, doc.get('language') || defaultLocale);
|
|
17
12
|
}
|
|
18
13
|
get name() {
|
|
19
14
|
return this.data.name;
|
|
@@ -34,13 +29,13 @@ class User extends basic_1.default {
|
|
|
34
29
|
return this.data.email;
|
|
35
30
|
}
|
|
36
31
|
get hasRegistrationComplete() {
|
|
37
|
-
return
|
|
32
|
+
return isString(this.displayName) && isString(this.photoURL) && isString(this.email);
|
|
38
33
|
}
|
|
39
34
|
get role() {
|
|
40
35
|
return this.data.role;
|
|
41
36
|
}
|
|
42
37
|
get isSuperAdmin() {
|
|
43
|
-
return this.role ===
|
|
38
|
+
return this.role === UserRole.SuperAdmin;
|
|
44
39
|
}
|
|
45
40
|
get description() {
|
|
46
41
|
return this.data.description || null;
|
|
@@ -61,7 +56,7 @@ class User extends basic_1.default {
|
|
|
61
56
|
return this.data.notifications || 0;
|
|
62
57
|
}
|
|
63
58
|
get language() {
|
|
64
|
-
return this.data.language ||
|
|
59
|
+
return this.data.language || defaultLocale;
|
|
65
60
|
}
|
|
66
61
|
get createdAt() {
|
|
67
62
|
return this.data.createdAt;
|
|
@@ -85,10 +80,10 @@ class User extends basic_1.default {
|
|
|
85
80
|
return this.data.birthDate;
|
|
86
81
|
}
|
|
87
82
|
get notificationSettings() {
|
|
88
|
-
return this.data.notificationSettings ||
|
|
83
|
+
return this.data.notificationSettings || enumToObj(UserNotificationSettings, true);
|
|
89
84
|
}
|
|
90
85
|
get emailSettings() {
|
|
91
|
-
return this.data.emailSettings ||
|
|
86
|
+
return this.data.emailSettings || enumToObj(UserEmailSettings, true);
|
|
92
87
|
}
|
|
93
88
|
get isActive() {
|
|
94
89
|
return !this.isDeleted && this.hasRegistrationComplete;
|
|
@@ -97,7 +92,7 @@ class User extends basic_1.default {
|
|
|
97
92
|
return this.data.deletedAt || null;
|
|
98
93
|
}
|
|
99
94
|
get isDeleted() {
|
|
100
|
-
return !this.exists || !
|
|
95
|
+
return !this.exists || !isNull(this.deletedAt);
|
|
101
96
|
}
|
|
102
97
|
get appConfig() {
|
|
103
98
|
return this.data.appConfig || {};
|
|
@@ -118,7 +113,7 @@ class User extends basic_1.default {
|
|
|
118
113
|
return this.data.lastWebLoginAt || null;
|
|
119
114
|
}
|
|
120
115
|
get glissandooAdminUrl() {
|
|
121
|
-
return
|
|
116
|
+
return getGlissandooAdminEntityURL(CollectionNames.User, this.id);
|
|
122
117
|
}
|
|
123
118
|
get customerIds() {
|
|
124
119
|
return this.data.customerIds || [];
|
|
@@ -127,7 +122,6 @@ class User extends basic_1.default {
|
|
|
127
122
|
return this.data.devices || {};
|
|
128
123
|
}
|
|
129
124
|
get devicesList() {
|
|
130
|
-
return
|
|
125
|
+
return mapToArray(this.devices);
|
|
131
126
|
}
|
|
132
127
|
}
|
|
133
|
-
exports.default = User;
|
package/models/User/types.js
CHANGED
|
@@ -1,37 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserEventsFilter = exports.UserEmailSettings = exports.UserNotificationSettings = exports.UserAppConfig = exports.UserRegisterVia = exports.UserRole = void 0;
|
|
4
|
-
var UserRole;
|
|
1
|
+
export var UserRole;
|
|
5
2
|
(function (UserRole) {
|
|
6
3
|
UserRole["SuperAdmin"] = "admin";
|
|
7
4
|
UserRole["User"] = "user";
|
|
8
|
-
})(UserRole
|
|
9
|
-
var UserRegisterVia;
|
|
5
|
+
})(UserRole || (UserRole = {}));
|
|
6
|
+
export var UserRegisterVia;
|
|
10
7
|
(function (UserRegisterVia) {
|
|
11
8
|
UserRegisterVia["Web"] = "web";
|
|
12
9
|
UserRegisterVia["App"] = "app";
|
|
13
|
-
})(UserRegisterVia
|
|
14
|
-
var UserAppConfig;
|
|
10
|
+
})(UserRegisterVia || (UserRegisterVia = {}));
|
|
11
|
+
export var UserAppConfig;
|
|
15
12
|
(function (UserAppConfig) {
|
|
16
13
|
UserAppConfig["DefaultGroupId"] = "default_group_id";
|
|
17
14
|
UserAppConfig["DefaultEventsFilter"] = "default_events_filter";
|
|
18
|
-
})(UserAppConfig
|
|
19
|
-
var UserNotificationSettings;
|
|
15
|
+
})(UserAppConfig || (UserAppConfig = {}));
|
|
16
|
+
export var UserNotificationSettings;
|
|
20
17
|
(function (UserNotificationSettings) {
|
|
21
18
|
UserNotificationSettings["AttendanceConfirmed"] = "enabled_attendance_confirmed";
|
|
22
19
|
UserNotificationSettings["AttendanceDeclined"] = "enabled_attendance_declined";
|
|
23
20
|
UserNotificationSettings["InterestConfirmed"] = "enabled_interest_confirmed";
|
|
24
21
|
UserNotificationSettings["InterestLost"] = "enabled_interest_lost";
|
|
25
|
-
})(UserNotificationSettings
|
|
26
|
-
var UserEmailSettings;
|
|
22
|
+
})(UserNotificationSettings || (UserNotificationSettings = {}));
|
|
23
|
+
export var UserEmailSettings;
|
|
27
24
|
(function (UserEmailSettings) {
|
|
28
25
|
UserEmailSettings["ReminderBiweeklyEvents"] = "enabled_reminder_biweekly_events";
|
|
29
|
-
})(UserEmailSettings
|
|
30
|
-
var UserEventsFilter;
|
|
26
|
+
})(UserEmailSettings || (UserEmailSettings = {}));
|
|
27
|
+
export var UserEventsFilter;
|
|
31
28
|
(function (UserEventsFilter) {
|
|
32
29
|
UserEventsFilter[UserEventsFilter["Month"] = 1] = "Month";
|
|
33
30
|
UserEventsFilter[UserEventsFilter["Trimonth"] = 3] = "Trimonth";
|
|
34
31
|
UserEventsFilter[UserEventsFilter["SemiAnnual"] = 6] = "SemiAnnual";
|
|
35
32
|
UserEventsFilter[UserEventsFilter["Annual"] = 12] = "Annual";
|
|
36
33
|
UserEventsFilter[UserEventsFilter["Always"] = 1000] = "Always";
|
|
37
|
-
})(UserEventsFilter
|
|
34
|
+
})(UserEventsFilter || (UserEventsFilter = {}));
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import Model from '../Model';
|
|
1
|
+
import Model, { DocumentModel } from '../Model';
|
|
3
2
|
import { BaseWebhookEventData } from './types';
|
|
4
3
|
export default class WebhookEvent extends Model<BaseWebhookEventData> {
|
|
5
|
-
constructor(doc:
|
|
4
|
+
constructor(doc: DocumentModel);
|
|
6
5
|
get originalId(): string;
|
|
7
6
|
get body(): unknown;
|
|
8
7
|
get source(): import("./types").WebhookEventSource;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const Model_1 = __importDefault(require("../Model"));
|
|
7
|
-
class WebhookEvent extends Model_1.default {
|
|
1
|
+
import Model from '../Model';
|
|
2
|
+
export default class WebhookEvent extends Model {
|
|
8
3
|
constructor(doc) {
|
|
9
4
|
super(doc);
|
|
10
5
|
}
|
|
@@ -21,4 +16,3 @@ class WebhookEvent extends Model_1.default {
|
|
|
21
16
|
return this.data.createdAt;
|
|
22
17
|
}
|
|
23
18
|
}
|
|
24
|
-
exports.default = WebhookEvent;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebhookEventSource = void 0;
|
|
4
|
-
var WebhookEventSource;
|
|
1
|
+
export var WebhookEventSource;
|
|
5
2
|
(function (WebhookEventSource) {
|
|
6
3
|
WebhookEventSource["stripe"] = "stripe";
|
|
7
4
|
WebhookEventSource["messageBird"] = "messageBird";
|
|
8
5
|
WebhookEventSource["gocardless"] = "gocardless";
|
|
9
|
-
})(WebhookEventSource
|
|
6
|
+
})(WebhookEventSource || (WebhookEventSource = {}));
|
package/package.json
CHANGED
package/types/firestore.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*!
|
|
3
2
|
* Copyright 2020 Google LLC
|
|
4
3
|
*
|
|
@@ -14,8 +13,6 @@
|
|
|
14
13
|
* See the License for the specific language governing permissions and
|
|
15
14
|
* limitations under the License.
|
|
16
15
|
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.GrpcStatus = void 0;
|
|
19
16
|
/**
|
|
20
17
|
* The v1beta1 Veneer client. This client provides access to to the underlying
|
|
21
18
|
* Firestore v1beta1 RPCs.
|
|
@@ -35,7 +32,7 @@ exports.GrpcStatus = void 0;
|
|
|
35
32
|
/**
|
|
36
33
|
* Status codes returned by Firestore's gRPC calls.
|
|
37
34
|
*/
|
|
38
|
-
var GrpcStatus;
|
|
35
|
+
export var GrpcStatus;
|
|
39
36
|
(function (GrpcStatus) {
|
|
40
37
|
GrpcStatus[GrpcStatus["OK"] = 0] = "OK";
|
|
41
38
|
GrpcStatus[GrpcStatus["CANCELLED"] = 1] = "CANCELLED";
|
|
@@ -54,4 +51,4 @@ var GrpcStatus;
|
|
|
54
51
|
GrpcStatus[GrpcStatus["UNAVAILABLE"] = 14] = "UNAVAILABLE";
|
|
55
52
|
GrpcStatus[GrpcStatus["DATA_LOSS"] = 15] = "DATA_LOSS";
|
|
56
53
|
GrpcStatus[GrpcStatus["UNAUTHENTICATED"] = 16] = "UNAUTHENTICATED";
|
|
57
|
-
})(GrpcStatus
|
|
54
|
+
})(GrpcStatus || (GrpcStatus = {}));
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|