@merkaly/api 0.29.1 → 0.30.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/dist/account/auth/auth.d.ts +16 -0
- package/dist/account/auth/index.d.ts +1 -0
- package/dist/account/auth/index.js +1 -0
- package/dist/account/auth/team.enum.d.ts +4 -0
- package/dist/account/auth/team.enum.js +8 -0
- package/dist/app.types.d.ts +2 -0
- package/dist/settings/organization/organization.contract.d.ts +18 -2
- package/dist/settings/organization/organization.d.ts +5 -0
- package/dist/settings/organization/organization.enum.d.ts +14 -0
- package/dist/settings/organization/organization.enum.js +16 -0
- package/dist/settings/organization/request.validator.d.ts +3 -2
- package/dist/settings/organization/request.validator.js +25 -5
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AccountTeamAssignableRole } from './team.enum.js';
|
|
1
2
|
export interface AccountAuthIdentity {
|
|
2
3
|
connection: string;
|
|
3
4
|
isSocial: boolean;
|
|
@@ -66,3 +67,18 @@ export interface AccountAuthOrganizationInvitation {
|
|
|
66
67
|
};
|
|
67
68
|
roles?: string[];
|
|
68
69
|
}
|
|
70
|
+
export interface AccountTeamInvitation {
|
|
71
|
+
createdAt?: string;
|
|
72
|
+
email: string;
|
|
73
|
+
expiresAt?: string;
|
|
74
|
+
id: string;
|
|
75
|
+
inviter?: string;
|
|
76
|
+
role?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface AccountTeamInvitationPayload {
|
|
79
|
+
email: string;
|
|
80
|
+
role: AccountTeamAssignableRole;
|
|
81
|
+
}
|
|
82
|
+
export interface AccountTeamMemberRolePayload {
|
|
83
|
+
role: AccountTeamAssignableRole;
|
|
84
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const ACCOUNT_TEAM_MANAGER_ROLES: readonly ["MK_ADMIN", "MK_SUPERADMIN", "ORG_ADMIN", "ORG_OWNER"];
|
|
2
|
+
export declare const ACCOUNT_TEAM_ASSIGNABLE_ROLES: readonly ["ORG_ADMIN", "ORG_MANAGER"];
|
|
3
|
+
export declare const ACCOUNT_TEAM_LOCKED_ROLES: readonly ["MK_ADMIN", "MK_SUPERADMIN", "ORG_OWNER"];
|
|
4
|
+
export type AccountTeamAssignableRole = (typeof ACCOUNT_TEAM_ASSIGNABLE_ROLES)[number];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const ACCOUNT_TEAM_MANAGER_ROLES = [
|
|
2
|
+
'MK_ADMIN',
|
|
3
|
+
'MK_SUPERADMIN',
|
|
4
|
+
'ORG_ADMIN',
|
|
5
|
+
'ORG_OWNER',
|
|
6
|
+
];
|
|
7
|
+
export const ACCOUNT_TEAM_ASSIGNABLE_ROLES = ['ORG_ADMIN', 'ORG_MANAGER'];
|
|
8
|
+
export const ACCOUNT_TEAM_LOCKED_ROLES = ['MK_ADMIN', 'MK_SUPERADMIN', 'ORG_OWNER'];
|
package/dist/app.types.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export interface Auth0JwtPayload {
|
|
|
4
4
|
exp: number;
|
|
5
5
|
iss: string;
|
|
6
6
|
aud: string | string[];
|
|
7
|
+
azp?: string;
|
|
7
8
|
org_id?: string;
|
|
8
9
|
'https://merka.ly/authorization'?: {
|
|
9
10
|
roles: string[];
|
|
@@ -11,6 +12,7 @@ export interface Auth0JwtPayload {
|
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
14
|
export interface AppAuth {
|
|
15
|
+
clientId?: string;
|
|
14
16
|
expiresAt: Date;
|
|
15
17
|
issuedAt: Date;
|
|
16
18
|
orgId?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SettingsOrganizationEnum } from './organization.enum.js';
|
|
1
|
+
import { SettingsOrganizationEnum, SettingsOrganizationSocialEnum } from './organization.enum.js';
|
|
2
2
|
export interface SettingsOrganizationLocationContract {
|
|
3
3
|
lat?: number;
|
|
4
4
|
lng?: number;
|
|
@@ -12,9 +12,11 @@ export interface SettingsOrganizationAddressContract {
|
|
|
12
12
|
location?: SettingsOrganizationLocationContract;
|
|
13
13
|
state?: string;
|
|
14
14
|
}
|
|
15
|
+
export type SettingsOrganizationSocialContract = Partial<Record<SettingsOrganizationSocialEnum, string>>;
|
|
15
16
|
export interface SettingsOrganizationContactContract {
|
|
16
17
|
email?: string;
|
|
17
18
|
phone?: string;
|
|
19
|
+
social?: SettingsOrganizationSocialContract;
|
|
18
20
|
website?: string;
|
|
19
21
|
}
|
|
20
22
|
export interface SettingsOrganizationLocalizationContract {
|
|
@@ -29,13 +31,24 @@ export interface SettingsOrganizationIdentityContract {
|
|
|
29
31
|
}
|
|
30
32
|
export interface SettingsOrganizationBrandingContract {
|
|
31
33
|
description?: string;
|
|
34
|
+
favicon?: string;
|
|
32
35
|
logo?: string;
|
|
36
|
+
ogImage?: string;
|
|
37
|
+
primaryColor?: string;
|
|
38
|
+
}
|
|
39
|
+
export type SettingsOrganizationBrandingImage = 'favicon' | 'logo' | 'ogImage';
|
|
40
|
+
export interface SettingsOrganizationBrandingStoredContract extends SettingsOrganizationBrandingContract {
|
|
41
|
+
keys?: Partial<Record<SettingsOrganizationBrandingImage, string>>;
|
|
33
42
|
}
|
|
34
43
|
export interface SettingsOrganizationBillingContract {
|
|
35
44
|
email?: string;
|
|
36
45
|
}
|
|
37
46
|
export type SettingsOrganizationSecurityContract = Record<string, unknown>;
|
|
38
47
|
export type SettingsOrganizationSequenceContract = Record<string, unknown>;
|
|
48
|
+
export interface SettingsOrganizationStoreContract {
|
|
49
|
+
host: string;
|
|
50
|
+
url: string;
|
|
51
|
+
}
|
|
39
52
|
export interface SettingsOrganizationProfileContract {
|
|
40
53
|
address: SettingsOrganizationAddressContract;
|
|
41
54
|
billing: SettingsOrganizationBillingContract;
|
|
@@ -44,10 +57,13 @@ export interface SettingsOrganizationProfileContract {
|
|
|
44
57
|
identity: SettingsOrganizationIdentityContract;
|
|
45
58
|
localization: SettingsOrganizationLocalizationContract;
|
|
46
59
|
}
|
|
60
|
+
export interface SettingsOrganizationProfileResponse extends SettingsOrganizationProfileContract {
|
|
61
|
+
store: SettingsOrganizationStoreContract;
|
|
62
|
+
}
|
|
47
63
|
export interface SettingsOrganizationValueMap {
|
|
48
64
|
[SettingsOrganizationEnum.ORGANIZATION_ADDRESS]: SettingsOrganizationAddressContract;
|
|
49
65
|
[SettingsOrganizationEnum.ORGANIZATION_BILLING]: SettingsOrganizationBillingContract;
|
|
50
|
-
[SettingsOrganizationEnum.ORGANIZATION_BRANDING]:
|
|
66
|
+
[SettingsOrganizationEnum.ORGANIZATION_BRANDING]: SettingsOrganizationBrandingStoredContract;
|
|
51
67
|
[SettingsOrganizationEnum.ORGANIZATION_CONTACT]: SettingsOrganizationContactContract;
|
|
52
68
|
[SettingsOrganizationEnum.ORGANIZATION_IDENTITY]: SettingsOrganizationIdentityContract;
|
|
53
69
|
[SettingsOrganizationEnum.ORGANIZATION_LOCALIZATION]: SettingsOrganizationLocalizationContract;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SettingsOrganizationSocialContract } from './organization.contract.js';
|
|
1
2
|
export interface SettingsOrganizationSelectOption {
|
|
2
3
|
text: string;
|
|
3
4
|
value: string;
|
|
@@ -9,6 +10,10 @@ export interface SettingsOrganizationProfileMeta {
|
|
|
9
10
|
export interface SettingsOrganizationStoreProfile {
|
|
10
11
|
description?: string;
|
|
11
12
|
email?: string;
|
|
13
|
+
favicon?: string;
|
|
12
14
|
logo?: string;
|
|
13
15
|
name: string;
|
|
16
|
+
ogImage?: string;
|
|
17
|
+
primaryColor?: string;
|
|
18
|
+
social?: SettingsOrganizationSocialContract;
|
|
14
19
|
}
|
|
@@ -8,3 +8,17 @@ export declare enum SettingsOrganizationEnum {
|
|
|
8
8
|
ORGANIZATION_SECURITY = "organization.security",
|
|
9
9
|
ORGANIZATION_SEQUENCE = "organization.sequence"
|
|
10
10
|
}
|
|
11
|
+
export declare enum SettingsOrganizationBrandingAssetEnum {
|
|
12
|
+
FAVICON = "favicon",
|
|
13
|
+
LOGO = "logo",
|
|
14
|
+
OG_IMAGE = "og-image"
|
|
15
|
+
}
|
|
16
|
+
export declare enum SettingsOrganizationSocialEnum {
|
|
17
|
+
FACEBOOK = "facebook",
|
|
18
|
+
INSTAGRAM = "instagram",
|
|
19
|
+
LINKEDIN = "linkedin",
|
|
20
|
+
TIKTOK = "tiktok",
|
|
21
|
+
WHATSAPP = "whatsapp",
|
|
22
|
+
X = "x",
|
|
23
|
+
YOUTUBE = "youtube"
|
|
24
|
+
}
|
|
@@ -9,3 +9,19 @@ export var SettingsOrganizationEnum;
|
|
|
9
9
|
SettingsOrganizationEnum["ORGANIZATION_SECURITY"] = "organization.security";
|
|
10
10
|
SettingsOrganizationEnum["ORGANIZATION_SEQUENCE"] = "organization.sequence";
|
|
11
11
|
})(SettingsOrganizationEnum || (SettingsOrganizationEnum = {}));
|
|
12
|
+
export var SettingsOrganizationBrandingAssetEnum;
|
|
13
|
+
(function (SettingsOrganizationBrandingAssetEnum) {
|
|
14
|
+
SettingsOrganizationBrandingAssetEnum["FAVICON"] = "favicon";
|
|
15
|
+
SettingsOrganizationBrandingAssetEnum["LOGO"] = "logo";
|
|
16
|
+
SettingsOrganizationBrandingAssetEnum["OG_IMAGE"] = "og-image";
|
|
17
|
+
})(SettingsOrganizationBrandingAssetEnum || (SettingsOrganizationBrandingAssetEnum = {}));
|
|
18
|
+
export var SettingsOrganizationSocialEnum;
|
|
19
|
+
(function (SettingsOrganizationSocialEnum) {
|
|
20
|
+
SettingsOrganizationSocialEnum["FACEBOOK"] = "facebook";
|
|
21
|
+
SettingsOrganizationSocialEnum["INSTAGRAM"] = "instagram";
|
|
22
|
+
SettingsOrganizationSocialEnum["LINKEDIN"] = "linkedin";
|
|
23
|
+
SettingsOrganizationSocialEnum["TIKTOK"] = "tiktok";
|
|
24
|
+
SettingsOrganizationSocialEnum["WHATSAPP"] = "whatsapp";
|
|
25
|
+
SettingsOrganizationSocialEnum["X"] = "x";
|
|
26
|
+
SettingsOrganizationSocialEnum["YOUTUBE"] = "youtube";
|
|
27
|
+
})(SettingsOrganizationSocialEnum || (SettingsOrganizationSocialEnum = {}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbstractRequestValidator } from '../../abstract.validator.js';
|
|
2
|
-
import type { SettingsOrganizationAddressContract, SettingsOrganizationBillingContract, SettingsOrganizationBrandingContract, SettingsOrganizationContactContract, SettingsOrganizationIdentityContract, SettingsOrganizationLocalizationContract, SettingsOrganizationLocationContract, SettingsOrganizationProfileContract } from './organization.contract.js';
|
|
2
|
+
import type { SettingsOrganizationAddressContract, SettingsOrganizationBillingContract, SettingsOrganizationBrandingContract, SettingsOrganizationContactContract, SettingsOrganizationIdentityContract, SettingsOrganizationLocalizationContract, SettingsOrganizationLocationContract, SettingsOrganizationProfileContract, SettingsOrganizationSocialContract } from './organization.contract.js';
|
|
3
3
|
export declare class UpdateOrganizationLocationRequestValidator extends AbstractRequestValidator {
|
|
4
4
|
lat?: number;
|
|
5
5
|
lng?: number;
|
|
@@ -18,6 +18,7 @@ export declare class UpdateOrganizationAddressRequestValidator extends AbstractR
|
|
|
18
18
|
export declare class UpdateOrganizationContactRequestValidator extends AbstractRequestValidator {
|
|
19
19
|
email?: string;
|
|
20
20
|
phone?: string;
|
|
21
|
+
social?: SettingsOrganizationSocialContract;
|
|
21
22
|
website?: string;
|
|
22
23
|
constructor(contact?: SettingsOrganizationContactContract);
|
|
23
24
|
}
|
|
@@ -35,7 +36,7 @@ export declare class UpdateOrganizationIdentityRequestValidator extends Abstract
|
|
|
35
36
|
}
|
|
36
37
|
export declare class UpdateOrganizationBrandingRequestValidator extends AbstractRequestValidator {
|
|
37
38
|
description?: string;
|
|
38
|
-
|
|
39
|
+
primaryColor?: string;
|
|
39
40
|
constructor(branding?: SettingsOrganizationBrandingContract);
|
|
40
41
|
}
|
|
41
42
|
export declare class UpdateOrganizationBillingRequestValidator extends AbstractRequestValidator {
|
|
@@ -10,6 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
import * as class_transformer_1 from "class-transformer";
|
|
12
12
|
import * as class_validator_1 from "class-validator";
|
|
13
|
+
import * as organization_enum_1 from './organization.enum.js';
|
|
13
14
|
import * as abstract_validator_1 from '../../abstract.validator.js';
|
|
14
15
|
export class UpdateOrganizationLocationRequestValidator extends abstract_validator_1.AbstractRequestValidator {
|
|
15
16
|
lat;
|
|
@@ -91,14 +92,29 @@ __decorate([
|
|
|
91
92
|
(0, class_validator_1.IsOptional)(),
|
|
92
93
|
__metadata("design:type", String)
|
|
93
94
|
], UpdateOrganizationAddressRequestValidator.prototype, "state", void 0);
|
|
95
|
+
const SOCIAL_KEYS = Object.values(organization_enum_1.SettingsOrganizationSocialEnum);
|
|
96
|
+
const isSocialLink = (value) => value === '' ||
|
|
97
|
+
(typeof value === 'string' &&
|
|
98
|
+
value.length <= 2048 &&
|
|
99
|
+
(0, class_validator_1.isURL)(value, { protocols: ['https'], require_protocol: true }));
|
|
100
|
+
const IsSocialLinks = () => (0, class_validator_1.ValidateBy)({
|
|
101
|
+
name: 'isSocialLinks',
|
|
102
|
+
validator: {
|
|
103
|
+
defaultMessage: () => `$property keys must be one of ${SOCIAL_KEYS.join(', ')} and values https URLs`,
|
|
104
|
+
validate: (value) => (0, class_validator_1.isObject)(value) &&
|
|
105
|
+
Object.entries(value).every(([key, link]) => SOCIAL_KEYS.includes(key) && isSocialLink(link)),
|
|
106
|
+
},
|
|
107
|
+
});
|
|
94
108
|
export class UpdateOrganizationContactRequestValidator extends abstract_validator_1.AbstractRequestValidator {
|
|
95
109
|
email;
|
|
96
110
|
phone;
|
|
111
|
+
social;
|
|
97
112
|
website;
|
|
98
113
|
constructor(contact) {
|
|
99
114
|
super();
|
|
100
115
|
this.email = contact?.email;
|
|
101
116
|
this.phone = contact?.phone;
|
|
117
|
+
this.social = { ...contact?.social };
|
|
102
118
|
this.website = contact?.website;
|
|
103
119
|
}
|
|
104
120
|
}
|
|
@@ -114,6 +130,11 @@ __decorate([
|
|
|
114
130
|
(0, class_validator_1.IsOptional)(),
|
|
115
131
|
__metadata("design:type", String)
|
|
116
132
|
], UpdateOrganizationContactRequestValidator.prototype, "phone", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
IsSocialLinks(),
|
|
135
|
+
(0, class_validator_1.IsOptional)(),
|
|
136
|
+
__metadata("design:type", Object)
|
|
137
|
+
], UpdateOrganizationContactRequestValidator.prototype, "social", void 0);
|
|
117
138
|
__decorate([
|
|
118
139
|
(0, class_validator_1.IsString)(),
|
|
119
140
|
(0, class_validator_1.Length)(0, 2048),
|
|
@@ -180,11 +201,11 @@ __decorate([
|
|
|
180
201
|
], UpdateOrganizationIdentityRequestValidator.prototype, "taxId", void 0);
|
|
181
202
|
export class UpdateOrganizationBrandingRequestValidator extends abstract_validator_1.AbstractRequestValidator {
|
|
182
203
|
description;
|
|
183
|
-
|
|
204
|
+
primaryColor;
|
|
184
205
|
constructor(branding) {
|
|
185
206
|
super();
|
|
186
207
|
this.description = branding?.description;
|
|
187
|
-
this.
|
|
208
|
+
this.primaryColor = branding?.primaryColor;
|
|
188
209
|
}
|
|
189
210
|
}
|
|
190
211
|
__decorate([
|
|
@@ -194,11 +215,10 @@ __decorate([
|
|
|
194
215
|
__metadata("design:type", String)
|
|
195
216
|
], UpdateOrganizationBrandingRequestValidator.prototype, "description", void 0);
|
|
196
217
|
__decorate([
|
|
197
|
-
(0, class_validator_1.
|
|
198
|
-
(0, class_validator_1.Length)(0, 2048),
|
|
218
|
+
(0, class_validator_1.Matches)(/^(#[0-9a-f]{6})?$/i, { message: '$property must be a #RRGGBB color' }),
|
|
199
219
|
(0, class_validator_1.IsOptional)(),
|
|
200
220
|
__metadata("design:type", String)
|
|
201
|
-
], UpdateOrganizationBrandingRequestValidator.prototype, "
|
|
221
|
+
], UpdateOrganizationBrandingRequestValidator.prototype, "primaryColor", void 0);
|
|
202
222
|
export class UpdateOrganizationBillingRequestValidator extends abstract_validator_1.AbstractRequestValidator {
|
|
203
223
|
email;
|
|
204
224
|
constructor(billing) {
|