@glissandoo/lib 1.102.12 → 1.102.14
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/event.d.ts +19 -3
- package/functions/event.js +2 -0
- package/functions/partnershipGroup.d.ts +2 -1
- package/functions/partnershipPartner.d.ts +2 -2
- package/functions/partnershipPayment.d.ts +1 -2
- package/functions/partnershipPlan.d.ts +1 -2
- package/functions/partnershipSubscription.d.ts +3 -6
- package/helpers/appScenes.d.ts +22 -17
- package/helpers/appScenes.js +21 -16
- package/helpers/notifications/index.d.ts +2 -0
- package/helpers/notifications/index.js +10 -0
- package/lang/ca.json +13 -1
- package/lang/de.json +13 -1
- package/lang/en.json +13 -1
- package/lang/es.json +13 -1
- package/lang/eu.json +13 -1
- package/lang/fr.json +13 -1
- package/lang/gl.json +13 -1
- package/lang/it.json +13 -1
- package/lang/nl.json +15 -3
- package/lang/pt.json +13 -1
- package/models/Evento/index.d.ts +2 -0
- package/models/Evento/index.js +6 -0
- package/models/Evento/types.d.ts +2 -0
- package/models/Notification/types.d.ts +6 -0
- package/models/Notification/types.js +6 -0
- package/models/Partnership/Partner/index.d.ts +6 -1
- package/models/Partnership/Partner/index.js +11 -2
- package/models/Partnership/Partner/types.d.ts +3 -7
- package/models/Partnership/Payment/index.d.ts +2 -3
- package/models/Partnership/Payment/index.js +1 -1
- package/models/Partnership/Payment/types.d.ts +6 -2
- package/models/Partnership/Payment/types.js +7 -1
- package/models/Partnership/Plan/index.d.ts +2 -2
- package/models/Partnership/Plan/index.js +11 -4
- package/models/Partnership/Plan/types.d.ts +4 -8
- package/models/Partnership/Plan/types.js +0 -7
- package/models/Partnership/Subscription/index.d.ts +2 -1
- package/models/Partnership/Subscription/index.js +4 -1
- package/models/Partnership/Subscription/types.d.ts +5 -1
- package/models/User/index.d.ts +2 -0
- package/models/User/index.js +6 -0
- package/models/User/types.d.ts +1 -0
- package/package.json +13 -13
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const utils_1 = require("../../../helpers/utils");
|
|
7
7
|
const lang_1 = __importDefault(require("../../Model/lang"));
|
|
8
|
-
const types_1 = require("
|
|
8
|
+
const types_1 = require("./types");
|
|
9
9
|
class PartnershipPayment extends lang_1.default {
|
|
10
10
|
get partnershipId() {
|
|
11
11
|
return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Timestamp } from '@google-cloud/firestore';
|
|
2
|
-
|
|
2
|
+
export declare enum PaymentMethod {
|
|
3
|
+
Cash = "CASH",
|
|
4
|
+
Transfer = "TRANSFER",
|
|
5
|
+
SEPA = "SEPA"
|
|
6
|
+
}
|
|
3
7
|
export declare enum PaymentStatus {
|
|
4
8
|
Pending = "pending",
|
|
5
9
|
Charged = "charged",
|
|
@@ -13,7 +17,7 @@ export interface PaymentStatusHistoryItem {
|
|
|
13
17
|
export interface PartnershipPaymentData {
|
|
14
18
|
title: string;
|
|
15
19
|
amount: number;
|
|
16
|
-
paymentMethod: PaymentMethod;
|
|
20
|
+
paymentMethod: PaymentMethod | null;
|
|
17
21
|
subscriptionId: string | null;
|
|
18
22
|
partnerId: string;
|
|
19
23
|
status: PaymentStatus;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PaymentStatus = void 0;
|
|
3
|
+
exports.PaymentStatus = exports.PaymentMethod = void 0;
|
|
4
|
+
var PaymentMethod;
|
|
5
|
+
(function (PaymentMethod) {
|
|
6
|
+
PaymentMethod["Cash"] = "CASH";
|
|
7
|
+
PaymentMethod["Transfer"] = "TRANSFER";
|
|
8
|
+
PaymentMethod["SEPA"] = "SEPA";
|
|
9
|
+
})(PaymentMethod = exports.PaymentMethod || (exports.PaymentMethod = {}));
|
|
4
10
|
var PaymentStatus;
|
|
5
11
|
(function (PaymentStatus) {
|
|
6
12
|
PaymentStatus["Pending"] = "pending";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ModelWithLang from '../../Model/lang';
|
|
2
|
-
import { PartnershipPlanData } from './types';
|
|
2
|
+
import { PartnershipPlanBasicData, PartnershipPlanData } from './types';
|
|
3
3
|
export default class PartnershipPlan extends ModelWithLang<PartnershipPlanData> {
|
|
4
|
+
get basicInfo(): PartnershipPlanBasicData;
|
|
4
5
|
get partnershipId(): string;
|
|
5
6
|
private setPaymentDay;
|
|
6
7
|
private setPaymentMonth;
|
|
@@ -14,7 +15,6 @@ export default class PartnershipPlan extends ModelWithLang<PartnershipPlanData>
|
|
|
14
15
|
get schedule(): import("./types").PlanScheduleType;
|
|
15
16
|
get isAnnuallySchedule(): boolean;
|
|
16
17
|
get isPaymentDayEndOfMonth(): boolean;
|
|
17
|
-
get paymentMethod(): import("./types").PaymentMethod;
|
|
18
18
|
get subscriptionsCount(): number;
|
|
19
19
|
get hasSubscriptions(): boolean;
|
|
20
20
|
get createdAt(): FirebaseFirestore.Timestamp;
|
|
@@ -4,10 +4,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const date_fns_1 = require("date-fns");
|
|
7
|
+
const isNumber_1 = __importDefault(require("lodash/isNumber"));
|
|
7
8
|
const utils_1 = require("../../../helpers/utils");
|
|
8
9
|
const lang_1 = __importDefault(require("../../Model/lang"));
|
|
9
|
-
const isNumber_1 = __importDefault(require("lodash/isNumber"));
|
|
10
10
|
class PartnershipPlan extends lang_1.default {
|
|
11
|
+
get basicInfo() {
|
|
12
|
+
return {
|
|
13
|
+
name: this.name,
|
|
14
|
+
price: this.price,
|
|
15
|
+
schedule: this.schedule,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
11
18
|
get partnershipId() {
|
|
12
19
|
return (0, utils_1.at)(this.ref.path.split('/'), 1) || '';
|
|
13
20
|
}
|
|
@@ -53,9 +60,9 @@ class PartnershipPlan extends lang_1.default {
|
|
|
53
60
|
get isPaymentDayEndOfMonth() {
|
|
54
61
|
return this.schedule.paymentDay === -1;
|
|
55
62
|
}
|
|
56
|
-
get paymentMethod() {
|
|
57
|
-
|
|
58
|
-
}
|
|
63
|
+
// get paymentMethod() {
|
|
64
|
+
// return this.data.paymentMethod;
|
|
65
|
+
// }
|
|
59
66
|
get subscriptionsCount() {
|
|
60
67
|
return this.data.subscriptionsCount || 0;
|
|
61
68
|
}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { Timestamp } from '@google-cloud/firestore';
|
|
2
|
-
export declare enum PaymentMethod {
|
|
3
|
-
Cash = "CASH",
|
|
4
|
-
Transfer = "TRANSFER",
|
|
5
|
-
SEPA = "SEPA"
|
|
6
|
-
}
|
|
7
2
|
export interface PlanScheduleType {
|
|
8
3
|
periodInMonths: number;
|
|
9
4
|
paymentDay: number;
|
|
10
5
|
paymentMonth: number | null;
|
|
11
6
|
}
|
|
12
|
-
export interface
|
|
7
|
+
export interface PartnershipPlanBasicData {
|
|
13
8
|
name: string;
|
|
14
|
-
description: string;
|
|
15
9
|
price: number;
|
|
16
10
|
schedule: PlanScheduleType;
|
|
17
|
-
|
|
11
|
+
}
|
|
12
|
+
export interface PartnershipPlanData extends PartnershipPlanBasicData {
|
|
13
|
+
description: string;
|
|
18
14
|
subscriptionsCount: number;
|
|
19
15
|
createdAt: Timestamp;
|
|
20
16
|
createdBy: string;
|
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PaymentMethod = void 0;
|
|
4
|
-
var PaymentMethod;
|
|
5
|
-
(function (PaymentMethod) {
|
|
6
|
-
PaymentMethod["Cash"] = "CASH";
|
|
7
|
-
PaymentMethod["Transfer"] = "TRANSFER";
|
|
8
|
-
PaymentMethod["SEPA"] = "SEPA";
|
|
9
|
-
})(PaymentMethod = exports.PaymentMethod || (exports.PaymentMethod = {}));
|
|
@@ -4,7 +4,8 @@ export default class PartnershipSubscription extends Model<PartnershipSubscripti
|
|
|
4
4
|
get partnershipId(): string;
|
|
5
5
|
get planId(): string;
|
|
6
6
|
get partnerId(): string;
|
|
7
|
-
get
|
|
7
|
+
get partnerInfo(): import("../../User/types").UserTinyData;
|
|
8
|
+
get nextPaymentDate(): FirebaseFirestore.Timestamp | null;
|
|
8
9
|
get endDate(): FirebaseFirestore.Timestamp | null;
|
|
9
10
|
get isEnded(): boolean;
|
|
10
11
|
get createdAt(): FirebaseFirestore.Timestamp;
|
|
@@ -16,8 +16,11 @@ class PartnershipSubscription extends Model_1.default {
|
|
|
16
16
|
get partnerId() {
|
|
17
17
|
return this.data.partnerId;
|
|
18
18
|
}
|
|
19
|
+
get partnerInfo() {
|
|
20
|
+
return this.data.partnerInfo;
|
|
21
|
+
}
|
|
19
22
|
get nextPaymentDate() {
|
|
20
|
-
return this.data.nextPaymentDate;
|
|
23
|
+
return this.data.nextPaymentDate || null;
|
|
21
24
|
}
|
|
22
25
|
get endDate() {
|
|
23
26
|
return this.data.endDate || null;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { Timestamp } from '@google-cloud/firestore';
|
|
2
|
+
import { UserTinyData } from '../../User/types';
|
|
3
|
+
import { PartnershipPlanBasicData } from '../Plan/types';
|
|
2
4
|
export interface PartnershipSubscriptionData {
|
|
3
5
|
planId: string;
|
|
4
6
|
partnerId: string;
|
|
5
|
-
|
|
7
|
+
partnerInfo: UserTinyData;
|
|
8
|
+
planInfo: PartnershipPlanBasicData;
|
|
9
|
+
nextPaymentDate: Timestamp | null;
|
|
6
10
|
endDate: Timestamp | null;
|
|
7
11
|
createdAt: Timestamp;
|
|
8
12
|
createdBy: string;
|
package/models/User/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export default class User extends UserExtended<UserData> {
|
|
|
15
15
|
get pushToken(): string | null;
|
|
16
16
|
get tokens(): string[];
|
|
17
17
|
get notifications(): number;
|
|
18
|
+
get notificationsByGroup(): Record<string, number>;
|
|
18
19
|
get language(): LanguagesTypes;
|
|
19
20
|
get createdAt(): FirebaseFirestore.Timestamp;
|
|
20
21
|
get intercomId(): string | null;
|
|
@@ -50,6 +51,7 @@ export default class User extends UserExtended<UserData> {
|
|
|
50
51
|
default_events_filter: UserEventsFilter;
|
|
51
52
|
}[T];
|
|
52
53
|
getNotificationSetting(key: UserNotificationSettings): boolean;
|
|
54
|
+
getNotificationByGroup(groupId: string): number;
|
|
53
55
|
get registerVia(): import("./types").UserRegisterVia;
|
|
54
56
|
get lastAppLoginAt(): FirebaseFirestore.Timestamp | null;
|
|
55
57
|
get lastWebLoginAt(): FirebaseFirestore.Timestamp | null;
|
package/models/User/index.js
CHANGED
|
@@ -46,6 +46,9 @@ class User extends extended_1.default {
|
|
|
46
46
|
get notifications() {
|
|
47
47
|
return this.data.notifications || 0;
|
|
48
48
|
}
|
|
49
|
+
get notificationsByGroup() {
|
|
50
|
+
return this.data.notificationsByGroup || {};
|
|
51
|
+
}
|
|
49
52
|
get language() {
|
|
50
53
|
return this.data.language || lang_1.defaultLocale;
|
|
51
54
|
}
|
|
@@ -131,6 +134,9 @@ class User extends extended_1.default {
|
|
|
131
134
|
getNotificationSetting(key) {
|
|
132
135
|
return this.data.notificationSettings[key];
|
|
133
136
|
}
|
|
137
|
+
getNotificationByGroup(groupId) {
|
|
138
|
+
return groupId in this.notificationsByGroup ? this.notificationsByGroup[groupId] : 0;
|
|
139
|
+
}
|
|
134
140
|
get registerVia() {
|
|
135
141
|
return this.data.registerVia || null;
|
|
136
142
|
}
|
package/models/User/types.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ export interface UserData extends UserExtendedData {
|
|
|
69
69
|
description: string | null;
|
|
70
70
|
createdAt: Timestamp;
|
|
71
71
|
notifications: number;
|
|
72
|
+
notificationsByGroup: Record<string, number>;
|
|
72
73
|
pushToken: string | null;
|
|
73
74
|
tokens: string[];
|
|
74
75
|
deletedAt: Timestamp | null;
|
package/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glissandoo/lib",
|
|
3
|
-
"version": "1.102.
|
|
3
|
+
"version": "1.102.14",
|
|
4
4
|
"description": "Glissandoo library js",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"tsc": "cp package.json ./lib && tsc",
|
|
9
|
-
"build": "npm run tsc",
|
|
10
|
-
"build:watch": "npm run tsc -- --watch",
|
|
11
8
|
"build:link": "tsc",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
9
|
+
"build:watch": "npm run tsc -- --watch",
|
|
10
|
+
"build": "npm run tsc",
|
|
14
11
|
"format:single": "prettier --write",
|
|
15
|
-
"
|
|
12
|
+
"format": "prettier --write \"src/**/*.ts\" \"src/lang/*.json\"",
|
|
13
|
+
"link": "cp package.json ./lib && cd ./lib && npm link",
|
|
16
14
|
"lint:single": "eslint",
|
|
15
|
+
"lint": "eslint --ext .ts ./src",
|
|
16
|
+
"postversion": "git push && git push --tags",
|
|
17
17
|
"prepare": "rm -rf ./lib && npm run build:link",
|
|
18
|
-
"set-husky": "node scripts/setHusky.js",
|
|
19
18
|
"preversion": "npm run lint",
|
|
20
|
-
"version": "npm run format && git add -A src && ./publish.sh",
|
|
21
|
-
"postversion": "git push && git push --tags",
|
|
22
19
|
"publish:beta": "npm publish --tag beta",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
20
|
+
"set-husky": "node scripts/setHusky.js",
|
|
21
|
+
"supabase:types": "supabase gen types typescript --local > src/types/supabase/generated.ts; prettier --write src/types/supabase/generated.ts",
|
|
22
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
25
23
|
"translation:download": "localazy download",
|
|
26
|
-
"
|
|
24
|
+
"translation:upload": "localazy upload",
|
|
25
|
+
"tsc": "cp package.json ./lib && tsc",
|
|
26
|
+
"version": "npm run format && git add -A src && ./publish.sh"
|
|
27
27
|
},
|
|
28
28
|
"author": "Glissandoo",
|
|
29
29
|
"license": "ISC",
|