@glissandoo/lib 1.4.5 → 1.4.7
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/index.d.ts +2 -0
- package/functions/index.js +2 -0
- package/functions/partnership.d.ts +11 -4
- package/functions/regions.js +2 -0
- package/helpers/types.d.ts +11 -0
- package/helpers/types.js +8 -0
- package/models/Federation/index.d.ts +4 -3
- package/models/Federation/types.d.ts +1 -11
- package/models/Federation/types.js +0 -6
- package/models/Partnership/Group/index.d.ts +2 -0
- package/models/Partnership/Group/index.js +6 -0
- package/models/Partnership/Group/types.d.ts +5 -1
- package/models/Partnership/index.d.ts +6 -5
- package/models/Partnership/index.js +9 -18
- package/models/Partnership/types.d.ts +4 -0
- package/package.json +1 -1
package/functions/index.d.ts
CHANGED
|
@@ -76,6 +76,8 @@ export declare enum FbFunctionName {
|
|
|
76
76
|
PartnershipEdit = "partnership-edit",
|
|
77
77
|
PartnershipGetBalance = "partnership-getBalance",
|
|
78
78
|
PartnershipOnUpdate = "partnership-onUpdate",
|
|
79
|
+
PartnershipAddConfirmedAdmin = "partnership-addConfirmedAdmin",
|
|
80
|
+
PartnershipRemoveAdmin = "partnership-removeAdmin",
|
|
79
81
|
PartnershipGetMandateRequest = "partnership-getMandateRequest",
|
|
80
82
|
PartnershipOnMandateCreated = "partnership-onMandateCreated",
|
|
81
83
|
PartnershipPlanAdd = "partnershipPlan-add",
|
package/functions/index.js
CHANGED
|
@@ -80,6 +80,8 @@ var FbFunctionName;
|
|
|
80
80
|
FbFunctionName["PartnershipEdit"] = "partnership-edit";
|
|
81
81
|
FbFunctionName["PartnershipGetBalance"] = "partnership-getBalance";
|
|
82
82
|
FbFunctionName["PartnershipOnUpdate"] = "partnership-onUpdate";
|
|
83
|
+
FbFunctionName["PartnershipAddConfirmedAdmin"] = "partnership-addConfirmedAdmin";
|
|
84
|
+
FbFunctionName["PartnershipRemoveAdmin"] = "partnership-removeAdmin";
|
|
83
85
|
FbFunctionName["PartnershipGetMandateRequest"] = "partnership-getMandateRequest";
|
|
84
86
|
FbFunctionName["PartnershipOnMandateCreated"] = "partnership-onMandateCreated";
|
|
85
87
|
FbFunctionName["PartnershipPlanAdd"] = "partnershipPlan-add";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BasicAddressData } from '../models/Partner/types';
|
|
2
|
-
import { LegalContactData } from '../models/Partnership/types';
|
|
3
2
|
export declare namespace PartnershipFbFunctionsTypes {
|
|
4
3
|
interface CreateParams {
|
|
5
4
|
displayName: string;
|
|
@@ -7,15 +6,23 @@ export declare namespace PartnershipFbFunctionsTypes {
|
|
|
7
6
|
email: string;
|
|
8
7
|
phone: string | null;
|
|
9
8
|
address: BasicAddressData;
|
|
10
|
-
legalContact: LegalContactData | null;
|
|
11
|
-
createLemonwayAccount: boolean;
|
|
12
|
-
administrators: string[];
|
|
13
9
|
partnershipId: string;
|
|
10
|
+
gocardlessCustomerId: string | null;
|
|
14
11
|
CIF: string | null;
|
|
15
12
|
}
|
|
16
13
|
type CreateResult = void;
|
|
17
14
|
type EditParams = CreateParams;
|
|
18
15
|
type EditResult = void;
|
|
16
|
+
interface AddConfirmedAdminParams {
|
|
17
|
+
partnershipId: string;
|
|
18
|
+
userId: string;
|
|
19
|
+
}
|
|
20
|
+
type AddConfirmedAdminResult = void;
|
|
21
|
+
interface RemoveAdminParams {
|
|
22
|
+
partnershipId: string;
|
|
23
|
+
email: string;
|
|
24
|
+
}
|
|
25
|
+
type RemoveAdminResult = void;
|
|
19
26
|
interface GetBalanceParams {
|
|
20
27
|
partnershipId: string;
|
|
21
28
|
}
|
package/functions/regions.js
CHANGED
|
@@ -86,6 +86,8 @@ const regionByFunctions = {
|
|
|
86
86
|
[index_1.FbFunctionName.PartnershipEdit]: GCloudRegions.EuropeWest6,
|
|
87
87
|
[index_1.FbFunctionName.PartnershipGetBalance]: GCloudRegions.EuropeWest6,
|
|
88
88
|
[index_1.FbFunctionName.PartnershipOnUpdate]: GCloudRegions.EuropeWest6,
|
|
89
|
+
[index_1.FbFunctionName.PartnershipAddConfirmedAdmin]: GCloudRegions.EuropeWest6,
|
|
90
|
+
[index_1.FbFunctionName.PartnershipRemoveAdmin]: GCloudRegions.EuropeWest6,
|
|
89
91
|
[index_1.FbFunctionName.PartnershipGetMandateRequest]: GCloudRegions.EuropeWest6,
|
|
90
92
|
[index_1.FbFunctionName.PartnershipOnMandateCreated]: GCloudRegions.EuropeWest6,
|
|
91
93
|
[index_1.FbFunctionName.PartnershipPlanAdd]: GCloudRegions.EuropeWest6,
|
package/helpers/types.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdminItemStatus = void 0;
|
|
4
|
+
var AdminItemStatus;
|
|
5
|
+
(function (AdminItemStatus) {
|
|
6
|
+
AdminItemStatus["Pending"] = "pending";
|
|
7
|
+
AdminItemStatus["Accepted"] = "accepted";
|
|
8
|
+
})(AdminItemStatus = exports.AdminItemStatus || (exports.AdminItemStatus = {}));
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { DocumentSnapshot } from '@google-cloud/firestore';
|
|
2
|
+
import { AdminItemStatus } from '../../helpers/types';
|
|
2
3
|
import Model from '../Model';
|
|
3
|
-
import {
|
|
4
|
+
import { FederationData } from './types';
|
|
4
5
|
export default class Federation extends Model<FederationData> {
|
|
5
6
|
constructor(doc: DocumentSnapshot);
|
|
6
7
|
get displayName(): string;
|
|
7
8
|
get email(): string | null;
|
|
8
9
|
get partnershipIds(): string[];
|
|
9
10
|
get adminIds(): string[];
|
|
10
|
-
get adminList(): import("
|
|
11
|
-
adminListByStatus(status: AdminItemStatus): import("
|
|
11
|
+
get adminList(): import("../../helpers/types").AdminItem[];
|
|
12
|
+
adminListByStatus(status: AdminItemStatus): import("../../helpers/types").AdminItem[];
|
|
12
13
|
isAdmin(userId: string): boolean;
|
|
13
14
|
get photoURL(): string;
|
|
14
15
|
get phone(): string | null;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { DocumentReference, Timestamp } from '@google-cloud/firestore';
|
|
2
|
+
import { AdminItem } from '../../helpers/types';
|
|
2
3
|
import { BasicAddressData } from '../Partner/types';
|
|
3
|
-
export declare enum AdminItemStatus {
|
|
4
|
-
Pending = "pending",
|
|
5
|
-
Accepted = "accepted"
|
|
6
|
-
}
|
|
7
|
-
export interface AdminItem {
|
|
8
|
-
id: string | null;
|
|
9
|
-
email: string;
|
|
10
|
-
displayName: string | null;
|
|
11
|
-
photoURL: string | null;
|
|
12
|
-
status: AdminItemStatus;
|
|
13
|
-
}
|
|
14
4
|
export interface FederationData {
|
|
15
5
|
displayName: string;
|
|
16
6
|
photoURL: string;
|
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AdminItemStatus = void 0;
|
|
4
|
-
var AdminItemStatus;
|
|
5
|
-
(function (AdminItemStatus) {
|
|
6
|
-
AdminItemStatus["Pending"] = "pending";
|
|
7
|
-
AdminItemStatus["Accepted"] = "accepted";
|
|
8
|
-
})(AdminItemStatus = exports.AdminItemStatus || (exports.AdminItemStatus = {}));
|
|
@@ -4,5 +4,7 @@ import GroupBasic from '../../Group/basic';
|
|
|
4
4
|
import { PartnershipGroupData } from './types';
|
|
5
5
|
export default class PartnershipGroup extends GroupBasic<PartnershipGroupData> {
|
|
6
6
|
constructor(doc: DocumentSnapshot, lang?: LanguagesTypes);
|
|
7
|
+
get linkedAt(): FirebaseFirestore.Timestamp;
|
|
8
|
+
get linkedBy(): FirebaseFirestore.DocumentReference<FirebaseFirestore.DocumentData>;
|
|
7
9
|
get partnershipId(): string;
|
|
8
10
|
}
|
|
@@ -10,6 +10,12 @@ class PartnershipGroup extends basic_1.default {
|
|
|
10
10
|
constructor(doc, lang = lang_1.defaultLocale) {
|
|
11
11
|
super(doc, lang);
|
|
12
12
|
}
|
|
13
|
+
get linkedAt() {
|
|
14
|
+
return this.data.linkedAt;
|
|
15
|
+
}
|
|
16
|
+
get linkedBy() {
|
|
17
|
+
return this.data.linkedBy;
|
|
18
|
+
}
|
|
13
19
|
get partnershipId() {
|
|
14
20
|
return get_1.default(this.ref, 'parent.parent.id');
|
|
15
21
|
}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
import { DocumentReference, Timestamp } from '@google-cloud/firestore';
|
|
1
2
|
import { GroupBasicData } from '../../Group/types';
|
|
2
|
-
export
|
|
3
|
+
export interface PartnershipGroupData extends GroupBasicData {
|
|
4
|
+
readonly linkedBy: DocumentReference;
|
|
5
|
+
readonly linkedAt: Timestamp;
|
|
6
|
+
}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { DocumentSnapshot } from '@google-cloud/firestore';
|
|
2
|
+
import { AdminItemStatus } from '../../helpers/types';
|
|
2
3
|
import PartnershipBasic from './basic';
|
|
3
|
-
import { PartnershipData
|
|
4
|
+
import { PartnershipData } from './types';
|
|
4
5
|
export default class Partnership extends PartnershipBasic<PartnershipData> {
|
|
5
6
|
constructor(doc: DocumentSnapshot);
|
|
6
7
|
get description(): string;
|
|
7
8
|
get admins(): string[];
|
|
8
|
-
get
|
|
9
|
+
get adminList(): import("../../helpers/types").AdminItem[];
|
|
10
|
+
adminListByStatus(status: AdminItemStatus): import("../../helpers/types").AdminItem[];
|
|
11
|
+
isAdmin(userId: string): boolean;
|
|
12
|
+
/** @deprecated */
|
|
9
13
|
get legalContact(): import("./types").LegalContactData | null;
|
|
10
14
|
get createdAt(): FirebaseFirestore.Timestamp;
|
|
11
|
-
private get verifiedAt();
|
|
12
|
-
get isVerified(): boolean;
|
|
13
15
|
private get deletedAt();
|
|
14
16
|
get isDeleted(): boolean;
|
|
15
17
|
get isActive(): boolean;
|
|
16
18
|
get federationIds(): string[];
|
|
17
19
|
get gocardlessCustomerId(): string | null;
|
|
18
|
-
isAdmin(userId: string): boolean;
|
|
19
20
|
}
|
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const basic_1 = __importDefault(require("./basic"));
|
|
7
|
-
const types_1 = require("./types");
|
|
8
7
|
class Partnership extends basic_1.default {
|
|
9
8
|
constructor(doc) {
|
|
10
9
|
super(doc);
|
|
@@ -15,27 +14,22 @@ class Partnership extends basic_1.default {
|
|
|
15
14
|
get admins() {
|
|
16
15
|
return this.data.administrators || [];
|
|
17
16
|
}
|
|
18
|
-
get
|
|
19
|
-
|
|
20
|
-
return types_1.PartnershipStatus.Deleted;
|
|
21
|
-
}
|
|
22
|
-
if (this.isVerified) {
|
|
23
|
-
return types_1.PartnershipStatus.Verified;
|
|
24
|
-
}
|
|
25
|
-
return types_1.PartnershipStatus.PendingVerification;
|
|
17
|
+
get adminList() {
|
|
18
|
+
return this.data.administratorsList || [];
|
|
26
19
|
}
|
|
20
|
+
adminListByStatus(status) {
|
|
21
|
+
return this.adminList.filter((item) => item.status === status);
|
|
22
|
+
}
|
|
23
|
+
isAdmin(userId) {
|
|
24
|
+
return this.admins.includes(userId);
|
|
25
|
+
}
|
|
26
|
+
/** @deprecated */
|
|
27
27
|
get legalContact() {
|
|
28
28
|
return this.data.legalContact;
|
|
29
29
|
}
|
|
30
30
|
get createdAt() {
|
|
31
31
|
return this.data.createdAt;
|
|
32
32
|
}
|
|
33
|
-
get verifiedAt() {
|
|
34
|
-
return this.data.verifiedAt || null;
|
|
35
|
-
}
|
|
36
|
-
get isVerified() {
|
|
37
|
-
return this.verifiedAt !== null;
|
|
38
|
-
}
|
|
39
33
|
get deletedAt() {
|
|
40
34
|
return this.data.deletedAt || null;
|
|
41
35
|
}
|
|
@@ -51,8 +45,5 @@ class Partnership extends basic_1.default {
|
|
|
51
45
|
get gocardlessCustomerId() {
|
|
52
46
|
return this.data.gocardlessCustomerId || null;
|
|
53
47
|
}
|
|
54
|
-
isAdmin(userId) {
|
|
55
|
-
return this.admins.includes(userId);
|
|
56
|
-
}
|
|
57
48
|
}
|
|
58
49
|
exports.default = Partnership;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Timestamp } from '@google-cloud/firestore';
|
|
2
|
+
import { AdminItem } from '../../helpers/types';
|
|
2
3
|
import { BasicAddressData } from '../Partner/types';
|
|
3
4
|
export declare enum PartnershipStatus {
|
|
4
5
|
Verified = "verified",
|
|
@@ -28,8 +29,11 @@ export interface PartnershipBasicData {
|
|
|
28
29
|
}
|
|
29
30
|
export interface PartnershipData extends PartnershipBasicData {
|
|
30
31
|
description: string;
|
|
32
|
+
/** @deprecated */
|
|
31
33
|
legalContact: LegalContactData | null;
|
|
32
34
|
administrators: string[];
|
|
35
|
+
administratorsList: AdminItem[];
|
|
36
|
+
/** @deprecated */
|
|
33
37
|
verifiedAt: Timestamp | null;
|
|
34
38
|
deletedAt: Timestamp | null;
|
|
35
39
|
federationIds: string[];
|