@dohana/shared 1.0.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/README.md +27 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/consts/index.d.ts +1 -0
- package/dist/lib/consts/index.js +18 -0
- package/dist/lib/consts/index.js.map +1 -0
- package/dist/lib/consts/password-helper/index.d.ts +1 -0
- package/dist/lib/consts/password-helper/index.js +18 -0
- package/dist/lib/consts/password-helper/index.js.map +1 -0
- package/dist/lib/consts/password-helper/passwordHelper.d.ts +5 -0
- package/dist/lib/consts/password-helper/passwordHelper.js +9 -0
- package/dist/lib/consts/password-helper/passwordHelper.js.map +1 -0
- package/dist/lib/decorators/api-response.decorator.d.ts +2 -0
- package/dist/lib/decorators/api-response.decorator.js +19 -0
- package/dist/lib/decorators/api-response.decorator.js.map +1 -0
- package/dist/lib/decorators/external-api.decorator.d.ts +1 -0
- package/dist/lib/decorators/external-api.decorator.js +7 -0
- package/dist/lib/decorators/external-api.decorator.js.map +1 -0
- package/dist/lib/decorators/index.d.ts +2 -0
- package/dist/lib/decorators/index.js +19 -0
- package/dist/lib/decorators/index.js.map +1 -0
- package/dist/lib/dto/data-wrapper-dto.d.ts +9 -0
- package/dist/lib/dto/data-wrapper-dto.js +35 -0
- package/dist/lib/dto/data-wrapper-dto.js.map +1 -0
- package/dist/lib/dto/index.d.ts +6 -0
- package/dist/lib/dto/index.js +23 -0
- package/dist/lib/dto/index.js.map +1 -0
- package/dist/lib/dto/pagination-request.d.ts +4 -0
- package/dist/lib/dto/pagination-request.js +48 -0
- package/dist/lib/dto/pagination-request.js.map +1 -0
- package/dist/lib/dto/pagination-response.d.ts +8 -0
- package/dist/lib/dto/pagination-response.js +49 -0
- package/dist/lib/dto/pagination-response.js.map +1 -0
- package/dist/lib/dto/pagination-with-filters-request.d.ts +8 -0
- package/dist/lib/dto/pagination-with-filters-request.js +31 -0
- package/dist/lib/dto/pagination-with-filters-request.js.map +1 -0
- package/dist/lib/dto/shared/index.d.ts +1 -0
- package/dist/lib/dto/shared/index.js +18 -0
- package/dist/lib/dto/shared/index.js.map +1 -0
- package/dist/lib/dto/shared/shared.d.ts +13 -0
- package/dist/lib/dto/shared/shared.js +3 -0
- package/dist/lib/dto/shared/shared.js.map +1 -0
- package/dist/lib/dto/user/index.d.ts +1 -0
- package/dist/lib/dto/user/index.js +18 -0
- package/dist/lib/dto/user/index.js.map +1 -0
- package/dist/lib/dto/user/user-info.dto.d.ts +11 -0
- package/dist/lib/dto/user/user-info.dto.js +7 -0
- package/dist/lib/dto/user/user-info.dto.js.map +1 -0
- package/dist/lib/entities/area/index.d.ts +12 -0
- package/dist/lib/entities/area/index.js +3 -0
- package/dist/lib/entities/area/index.js.map +1 -0
- package/dist/lib/entities/article/index.d.ts +32 -0
- package/dist/lib/entities/article/index.js +3 -0
- package/dist/lib/entities/article/index.js.map +1 -0
- package/dist/lib/entities/index.d.ts +11 -0
- package/dist/lib/entities/index.js +28 -0
- package/dist/lib/entities/index.js.map +1 -0
- package/dist/lib/entities/investor/index.d.ts +23 -0
- package/dist/lib/entities/investor/index.js +3 -0
- package/dist/lib/entities/investor/index.js.map +1 -0
- package/dist/lib/entities/key-builder/index.d.ts +94 -0
- package/dist/lib/entities/key-builder/index.js +148 -0
- package/dist/lib/entities/key-builder/index.js.map +1 -0
- package/dist/lib/entities/notification/index.d.ts +3 -0
- package/dist/lib/entities/notification/index.js +20 -0
- package/dist/lib/entities/notification/index.js.map +1 -0
- package/dist/lib/entities/notification/notification-template.d.ts +12 -0
- package/dist/lib/entities/notification/notification-template.js +3 -0
- package/dist/lib/entities/notification/notification-template.js.map +1 -0
- package/dist/lib/entities/notification/notification.d.ts +12 -0
- package/dist/lib/entities/notification/notification.js +3 -0
- package/dist/lib/entities/notification/notification.js.map +1 -0
- package/dist/lib/entities/notification/subject.d.ts +5 -0
- package/dist/lib/entities/notification/subject.js +3 -0
- package/dist/lib/entities/notification/subject.js.map +1 -0
- package/dist/lib/entities/post/index.d.ts +58 -0
- package/dist/lib/entities/post/index.js +3 -0
- package/dist/lib/entities/post/index.js.map +1 -0
- package/dist/lib/entities/project/index.d.ts +29 -0
- package/dist/lib/entities/project/index.js +3 -0
- package/dist/lib/entities/project/index.js.map +1 -0
- package/dist/lib/entities/tag/index.d.ts +9 -0
- package/dist/lib/entities/tag/index.js +3 -0
- package/dist/lib/entities/tag/index.js.map +1 -0
- package/dist/lib/entities/transaction/index.d.ts +13 -0
- package/dist/lib/entities/transaction/index.js +3 -0
- package/dist/lib/entities/transaction/index.js.map +1 -0
- package/dist/lib/entities/user/index.d.ts +36 -0
- package/dist/lib/entities/user/index.js +18 -0
- package/dist/lib/entities/user/index.js.map +1 -0
- package/dist/lib/entities/user/user-token.d.ts +10 -0
- package/dist/lib/entities/user/user-token.js +3 -0
- package/dist/lib/entities/user/user-token.js.map +1 -0
- package/dist/lib/entities/wallet/index.d.ts +12 -0
- package/dist/lib/entities/wallet/index.js +18 -0
- package/dist/lib/entities/wallet/index.js.map +1 -0
- package/dist/lib/entities/wallet/wallet-type.enum.d.ts +4 -0
- package/dist/lib/entities/wallet/wallet-type.enum.js +9 -0
- package/dist/lib/entities/wallet/wallet-type.enum.js.map +1 -0
- package/dist/lib/exceptions/api.exception.d.ts +3 -0
- package/dist/lib/exceptions/api.exception.js +8 -0
- package/dist/lib/exceptions/api.exception.js.map +1 -0
- package/dist/lib/exceptions/db.exception.d.ts +2 -0
- package/dist/lib/exceptions/db.exception.js +7 -0
- package/dist/lib/exceptions/db.exception.js.map +1 -0
- package/dist/lib/exceptions/index.d.ts +3 -0
- package/dist/lib/exceptions/index.js +20 -0
- package/dist/lib/exceptions/index.js.map +1 -0
- package/dist/lib/exceptions/platform.exception.d.ts +2 -0
- package/dist/lib/exceptions/platform.exception.js +7 -0
- package/dist/lib/exceptions/platform.exception.js.map +1 -0
- package/dist/lib/services/index.d.ts +1 -0
- package/dist/lib/services/index.js +18 -0
- package/dist/lib/services/index.js.map +1 -0
- package/dist/lib/services/oauth-redirect.d.ts +22 -0
- package/dist/lib/services/oauth-redirect.js +89 -0
- package/dist/lib/services/oauth-redirect.js.map +1 -0
- package/dist/lib/shared/index.d.ts +10 -0
- package/dist/lib/shared/index.js +5 -0
- package/dist/lib/shared/index.js.map +1 -0
- package/dist/lib/types/area/area-level.enums.d.ts +6 -0
- package/dist/lib/types/area/area-level.enums.js +11 -0
- package/dist/lib/types/area/area-level.enums.js.map +1 -0
- package/dist/lib/types/area/index.d.ts +1 -0
- package/dist/lib/types/area/index.js +18 -0
- package/dist/lib/types/area/index.js.map +1 -0
- package/dist/lib/types/article/article-status.enum.d.ts +5 -0
- package/dist/lib/types/article/article-status.enum.js +10 -0
- package/dist/lib/types/article/article-status.enum.js.map +1 -0
- package/dist/lib/types/article/index.d.ts +3 -0
- package/dist/lib/types/article/index.js +19 -0
- package/dist/lib/types/article/index.js.map +1 -0
- package/dist/lib/types/article/up-down-vote-type.enum.d.ts +4 -0
- package/dist/lib/types/article/up-down-vote-type.enum.js +9 -0
- package/dist/lib/types/article/up-down-vote-type.enum.js.map +1 -0
- package/dist/lib/types/auth/auth.types.d.ts +25 -0
- package/dist/lib/types/auth/auth.types.js +18 -0
- package/dist/lib/types/auth/auth.types.js.map +1 -0
- package/dist/lib/types/auth/index.d.ts +1 -0
- package/dist/lib/types/auth/index.js +18 -0
- package/dist/lib/types/auth/index.js.map +1 -0
- package/dist/lib/types/index.d.ts +11 -0
- package/dist/lib/types/index.js +28 -0
- package/dist/lib/types/index.js.map +1 -0
- package/dist/lib/types/investor/index.d.ts +1 -0
- package/dist/lib/types/investor/index.js +18 -0
- package/dist/lib/types/investor/index.js.map +1 -0
- package/dist/lib/types/investor/investor.types.d.ts +1 -0
- package/dist/lib/types/investor/investor.types.js +3 -0
- package/dist/lib/types/investor/investor.types.js.map +1 -0
- package/dist/lib/types/notification/index.d.ts +3 -0
- package/dist/lib/types/notification/index.js +19 -0
- package/dist/lib/types/notification/index.js.map +1 -0
- package/dist/lib/types/notification/notification.status.d.ts +6 -0
- package/dist/lib/types/notification/notification.status.js +11 -0
- package/dist/lib/types/notification/notification.status.js.map +1 -0
- package/dist/lib/types/notification/notification.types.d.ts +4 -0
- package/dist/lib/types/notification/notification.types.js +9 -0
- package/dist/lib/types/notification/notification.types.js.map +1 -0
- package/dist/lib/types/pagination/index.d.ts +11 -0
- package/dist/lib/types/pagination/index.js +9 -0
- package/dist/lib/types/pagination/index.js.map +1 -0
- package/dist/lib/types/post/index.d.ts +4 -0
- package/dist/lib/types/post/index.js +21 -0
- package/dist/lib/types/post/index.js.map +1 -0
- package/dist/lib/types/post/post-status.enum.d.ts +6 -0
- package/dist/lib/types/post/post-status.enum.js +11 -0
- package/dist/lib/types/post/post-status.enum.js.map +1 -0
- package/dist/lib/types/post/post-type.enum.d.ts +4 -0
- package/dist/lib/types/post/post-type.enum.js +9 -0
- package/dist/lib/types/post/post-type.enum.js.map +1 -0
- package/dist/lib/types/post/post.types.d.ts +1 -0
- package/dist/lib/types/post/post.types.js +3 -0
- package/dist/lib/types/post/post.types.js.map +1 -0
- package/dist/lib/types/post/price-type.enum.d.ts +5 -0
- package/dist/lib/types/post/price-type.enum.js +10 -0
- package/dist/lib/types/post/price-type.enum.js.map +1 -0
- package/dist/lib/types/project/index.d.ts +2 -0
- package/dist/lib/types/project/index.js +19 -0
- package/dist/lib/types/project/index.js.map +1 -0
- package/dist/lib/types/project/project-status.enum.d.ts +6 -0
- package/dist/lib/types/project/project-status.enum.js +11 -0
- package/dist/lib/types/project/project-status.enum.js.map +1 -0
- package/dist/lib/types/project/project.types.d.ts +1 -0
- package/dist/lib/types/project/project.types.js +3 -0
- package/dist/lib/types/project/project.types.js.map +1 -0
- package/dist/lib/types/tag/index.d.ts +1 -0
- package/dist/lib/types/tag/index.js +3 -0
- package/dist/lib/types/tag/index.js.map +1 -0
- package/dist/lib/types/user/index.d.ts +4 -0
- package/dist/lib/types/user/index.js +19 -0
- package/dist/lib/types/user/index.js.map +1 -0
- package/dist/lib/types/user/user-plan.enum.d.ts +6 -0
- package/dist/lib/types/user/user-plan.enum.js +11 -0
- package/dist/lib/types/user/user-plan.enum.js.map +1 -0
- package/dist/lib/types/user/user.enums.d.ts +6 -0
- package/dist/lib/types/user/user.enums.js +12 -0
- package/dist/lib/types/user/user.enums.js.map +1 -0
- package/dist/lib/types/wallet/index.d.ts +2 -0
- package/dist/lib/types/wallet/index.js +3 -0
- package/dist/lib/types/wallet/index.js.map +1 -0
- package/dist/lib/utils/checkIsResponseError.d.ts +2 -0
- package/dist/lib/utils/checkIsResponseError.js +12 -0
- package/dist/lib/utils/checkIsResponseError.js.map +1 -0
- package/dist/lib/utils/common.d.ts +3 -0
- package/dist/lib/utils/common.js +30 -0
- package/dist/lib/utils/common.js.map +1 -0
- package/dist/lib/utils/email-normalization.d.ts +1 -0
- package/dist/lib/utils/email-normalization.js +49 -0
- package/dist/lib/utils/email-normalization.js.map +1 -0
- package/dist/lib/utils/env.d.ts +1 -0
- package/dist/lib/utils/env.js +67 -0
- package/dist/lib/utils/env.js.map +1 -0
- package/dist/lib/utils/hmac.d.ts +1 -0
- package/dist/lib/utils/hmac.js +10 -0
- package/dist/lib/utils/hmac.js.map +1 -0
- package/dist/lib/utils/index.d.ts +6 -0
- package/dist/lib/utils/index.js +23 -0
- package/dist/lib/utils/index.js.map +1 -0
- package/dist/lib/utils/ttl.d.ts +5 -0
- package/dist/lib/utils/ttl.js +47 -0
- package/dist/lib/utils/ttl.js.map +1 -0
- package/package.json +94 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/entities/article/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './area';
|
|
2
|
+
export * from './user';
|
|
3
|
+
export * from './key-builder';
|
|
4
|
+
export * from './investor';
|
|
5
|
+
export * from './post';
|
|
6
|
+
export * from './project';
|
|
7
|
+
export * from './article';
|
|
8
|
+
export * from './tag';
|
|
9
|
+
export * from './wallet';
|
|
10
|
+
export * from './transaction';
|
|
11
|
+
export * from './notification';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./area"), exports);
|
|
18
|
+
__exportStar(require("./user"), exports);
|
|
19
|
+
__exportStar(require("./key-builder"), exports);
|
|
20
|
+
__exportStar(require("./investor"), exports);
|
|
21
|
+
__exportStar(require("./post"), exports);
|
|
22
|
+
__exportStar(require("./project"), exports);
|
|
23
|
+
__exportStar(require("./article"), exports);
|
|
24
|
+
__exportStar(require("./tag"), exports);
|
|
25
|
+
__exportStar(require("./wallet"), exports);
|
|
26
|
+
__exportStar(require("./transaction"), exports);
|
|
27
|
+
__exportStar(require("./notification"), exports);
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,yCAAuB;AACvB,gDAA8B;AAC9B,6CAA2B;AAC3B,yCAAuB;AACvB,4CAA0B;AAC1B,4CAA0B;AAC1B,wCAAsB;AACtB,2CAAyB;AACzB,gDAA8B;AAC9B,iDAA+B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { InvestorId } from '../../types';
|
|
2
|
+
export interface IInvestor {
|
|
3
|
+
id: InvestorId;
|
|
4
|
+
name: string;
|
|
5
|
+
nameEn: string;
|
|
6
|
+
logo: string;
|
|
7
|
+
banner: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
founding?: Date;
|
|
10
|
+
numProject?: number;
|
|
11
|
+
phoneNumber?: string;
|
|
12
|
+
email?: string;
|
|
13
|
+
website?: string;
|
|
14
|
+
address?: string;
|
|
15
|
+
wardCode?: string;
|
|
16
|
+
districtCode?: string;
|
|
17
|
+
provinceCode?: string;
|
|
18
|
+
mainBusinessArea?: string;
|
|
19
|
+
verified?: number;
|
|
20
|
+
status?: string;
|
|
21
|
+
createdAt?: Date;
|
|
22
|
+
updatedAt?: Date;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/entities/investor/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export declare const buildCommonKey: ({ type, keyEntity, environmentIdPrefix, environmentId, identifierPrefix, identifier, }: {
|
|
2
|
+
type: CacheKeyTypeEnum;
|
|
3
|
+
keyEntity: CacheKeyPrefixEnum;
|
|
4
|
+
environmentIdPrefix?: OrgScopePrefixEnum;
|
|
5
|
+
environmentId: string;
|
|
6
|
+
identifierPrefix?: IdentifierPrefixEnum;
|
|
7
|
+
identifier: string;
|
|
8
|
+
}) => string;
|
|
9
|
+
export declare const buildCommonEnvironmentKey: ({ type, keyEntity, environmentIdPrefix, environmentId, }: {
|
|
10
|
+
type: CacheKeyTypeEnum;
|
|
11
|
+
keyEntity: CacheKeyPrefixEnum;
|
|
12
|
+
environmentIdPrefix?: OrgScopePrefixEnum;
|
|
13
|
+
environmentId: string;
|
|
14
|
+
}) => string;
|
|
15
|
+
declare const buildKeyById: ({ type, keyEntity, identifierPrefix, identifier, }: {
|
|
16
|
+
type: CacheKeyTypeEnum;
|
|
17
|
+
keyEntity: CacheKeyPrefixEnum;
|
|
18
|
+
identifierPrefix?: IdentifierPrefixEnum;
|
|
19
|
+
identifier: string;
|
|
20
|
+
}) => string;
|
|
21
|
+
export declare function prefixWrapper(prefixString: string): string;
|
|
22
|
+
export declare const QUERY_PREFIX = "#query#";
|
|
23
|
+
export declare enum CacheKeyPrefixEnum {
|
|
24
|
+
MESSAGE_COUNT = "message_count",
|
|
25
|
+
FEED = "feed",
|
|
26
|
+
SUBSCRIBER = "subscriber",
|
|
27
|
+
NOTIFICATION_TEMPLATE = "notification_template",
|
|
28
|
+
WORKFLOW_VARIABLES = "workflow_variables",
|
|
29
|
+
USER = "user",
|
|
30
|
+
INTEGRATION = "integration",
|
|
31
|
+
ENVIRONMENT_BY_API_KEY = "environment_by_api_key",
|
|
32
|
+
GROUPED_BLUEPRINTS = "grouped-blueprints",
|
|
33
|
+
AUTH_SERVICE = "auth_service",
|
|
34
|
+
MAXIMUM_API_RATE_LIMIT = "maximum_api_rate_limit",
|
|
35
|
+
EVALUATE_API_RATE_LIMIT = "evaluate_api_rate_limit",
|
|
36
|
+
SERVICE_CONFIG = "service_config"
|
|
37
|
+
}
|
|
38
|
+
export declare enum CacheKeyTypeEnum {
|
|
39
|
+
ENTITY = "entity",
|
|
40
|
+
QUERY = "query"
|
|
41
|
+
}
|
|
42
|
+
export declare enum IdentifierPrefixEnum {
|
|
43
|
+
ID = "i",
|
|
44
|
+
SUBSCRIBER_ID = "s",
|
|
45
|
+
TEMPLATE_IDENTIFIER = "t_i",
|
|
46
|
+
API_KEY = "a_k",
|
|
47
|
+
GROUPED_BLUEPRINT = "g_b",
|
|
48
|
+
API_RATE_LIMIT_CATEGORY = "a_r_l_c",
|
|
49
|
+
SERVICE_CONFIG = "s_c"
|
|
50
|
+
}
|
|
51
|
+
export declare enum ServiceConfigIdentifierEnum {
|
|
52
|
+
API_RATE_LIMIT_SERVICE_MAXIMUM = "api_rate_limit_service_maximum"
|
|
53
|
+
}
|
|
54
|
+
export declare enum OrgScopePrefixEnum {
|
|
55
|
+
ENVIRONMENT_ID = "e",
|
|
56
|
+
ORGANIZATION_ID = "o"
|
|
57
|
+
}
|
|
58
|
+
export declare const BLUEPRINT_IDENTIFIER = "blueprints/group-by-category";
|
|
59
|
+
declare const buildSubscriberKey: ({ subscriberId, _environmentId, }: {
|
|
60
|
+
subscriberId: string;
|
|
61
|
+
_environmentId: string;
|
|
62
|
+
}) => string;
|
|
63
|
+
declare const buildVariablesKey: ({ _environmentId, _organizationId, }: {
|
|
64
|
+
_environmentId: string;
|
|
65
|
+
_organizationId: string;
|
|
66
|
+
}) => string;
|
|
67
|
+
declare const buildUserKey: ({ id }: {
|
|
68
|
+
id: string;
|
|
69
|
+
}) => string;
|
|
70
|
+
declare const buildNotificationTemplateKey: ({ _id, _environmentId, }: {
|
|
71
|
+
_id: string;
|
|
72
|
+
_environmentId: string;
|
|
73
|
+
}) => string;
|
|
74
|
+
declare const buildNotificationTemplateIdentifierKey: ({ templateIdentifier, _environmentId, }: {
|
|
75
|
+
templateIdentifier: string;
|
|
76
|
+
_environmentId: string;
|
|
77
|
+
}) => string;
|
|
78
|
+
declare const buildEnvironmentByApiKey: ({ apiKey }: {
|
|
79
|
+
apiKey: string;
|
|
80
|
+
}) => string;
|
|
81
|
+
declare const buildGroupedBlueprintsKey: (environmentId: string) => string;
|
|
82
|
+
declare const buildAuthServiceKey: ({ apiKey }: {
|
|
83
|
+
apiKey: string;
|
|
84
|
+
}) => string;
|
|
85
|
+
declare const buildMaximumApiRateLimitKey: ({ apiRateLimitCategory, _environmentId, }: {
|
|
86
|
+
apiRateLimitCategory: string;
|
|
87
|
+
_environmentId: string;
|
|
88
|
+
}) => string;
|
|
89
|
+
declare const buildEvaluateApiRateLimitKey: ({ apiRateLimitCategory, _environmentId, }: {
|
|
90
|
+
apiRateLimitCategory: string;
|
|
91
|
+
_environmentId: string;
|
|
92
|
+
}) => string;
|
|
93
|
+
declare const buildServiceConfigApiRateLimitMaximumKey: () => string;
|
|
94
|
+
export { buildUserKey, buildSubscriberKey, buildNotificationTemplateKey, buildNotificationTemplateIdentifierKey, buildEnvironmentByApiKey, buildKeyById, buildGroupedBlueprintsKey, buildAuthServiceKey, buildMaximumApiRateLimitKey, buildEvaluateApiRateLimitKey, buildServiceConfigApiRateLimitMaximumKey, buildVariablesKey, };
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildVariablesKey = exports.buildServiceConfigApiRateLimitMaximumKey = exports.buildEvaluateApiRateLimitKey = exports.buildMaximumApiRateLimitKey = exports.buildAuthServiceKey = exports.buildGroupedBlueprintsKey = exports.buildKeyById = exports.buildEnvironmentByApiKey = exports.buildNotificationTemplateIdentifierKey = exports.buildNotificationTemplateKey = exports.buildSubscriberKey = exports.buildUserKey = exports.BLUEPRINT_IDENTIFIER = exports.OrgScopePrefixEnum = exports.ServiceConfigIdentifierEnum = exports.IdentifierPrefixEnum = exports.CacheKeyTypeEnum = exports.CacheKeyPrefixEnum = exports.QUERY_PREFIX = exports.buildCommonEnvironmentKey = exports.buildCommonKey = void 0;
|
|
4
|
+
exports.prefixWrapper = prefixWrapper;
|
|
5
|
+
const crypto_1 = require("crypto");
|
|
6
|
+
const buildCommonKey = ({ type, keyEntity, environmentIdPrefix = OrgScopePrefixEnum.ENVIRONMENT_ID, environmentId, identifierPrefix = IdentifierPrefixEnum.ID, identifier, }) => prefixWrapper(`${type}:${keyEntity}:${environmentIdPrefix}=${environmentId}:${identifierPrefix}=${identifier}`);
|
|
7
|
+
exports.buildCommonKey = buildCommonKey;
|
|
8
|
+
const buildCommonEnvironmentKey = ({ type, keyEntity, environmentIdPrefix = OrgScopePrefixEnum.ENVIRONMENT_ID, environmentId, }) => prefixWrapper(`${type}:${keyEntity}:${environmentIdPrefix}=${environmentId}`);
|
|
9
|
+
exports.buildCommonEnvironmentKey = buildCommonEnvironmentKey;
|
|
10
|
+
const buildKeyById = ({ type, keyEntity, identifierPrefix = IdentifierPrefixEnum.ID, identifier, }) => prefixWrapper(`${type}:${keyEntity}:${identifierPrefix}=${identifier}`);
|
|
11
|
+
exports.buildKeyById = buildKeyById;
|
|
12
|
+
function prefixWrapper(prefixString) {
|
|
13
|
+
return `{${prefixString}}`;
|
|
14
|
+
}
|
|
15
|
+
exports.QUERY_PREFIX = '#query#';
|
|
16
|
+
var CacheKeyPrefixEnum;
|
|
17
|
+
(function (CacheKeyPrefixEnum) {
|
|
18
|
+
CacheKeyPrefixEnum["MESSAGE_COUNT"] = "message_count";
|
|
19
|
+
CacheKeyPrefixEnum["FEED"] = "feed";
|
|
20
|
+
CacheKeyPrefixEnum["SUBSCRIBER"] = "subscriber";
|
|
21
|
+
CacheKeyPrefixEnum["NOTIFICATION_TEMPLATE"] = "notification_template";
|
|
22
|
+
CacheKeyPrefixEnum["WORKFLOW_VARIABLES"] = "workflow_variables";
|
|
23
|
+
CacheKeyPrefixEnum["USER"] = "user";
|
|
24
|
+
CacheKeyPrefixEnum["INTEGRATION"] = "integration";
|
|
25
|
+
CacheKeyPrefixEnum["ENVIRONMENT_BY_API_KEY"] = "environment_by_api_key";
|
|
26
|
+
CacheKeyPrefixEnum["GROUPED_BLUEPRINTS"] = "grouped-blueprints";
|
|
27
|
+
CacheKeyPrefixEnum["AUTH_SERVICE"] = "auth_service";
|
|
28
|
+
CacheKeyPrefixEnum["MAXIMUM_API_RATE_LIMIT"] = "maximum_api_rate_limit";
|
|
29
|
+
CacheKeyPrefixEnum["EVALUATE_API_RATE_LIMIT"] = "evaluate_api_rate_limit";
|
|
30
|
+
CacheKeyPrefixEnum["SERVICE_CONFIG"] = "service_config";
|
|
31
|
+
})(CacheKeyPrefixEnum || (exports.CacheKeyPrefixEnum = CacheKeyPrefixEnum = {}));
|
|
32
|
+
var CacheKeyTypeEnum;
|
|
33
|
+
(function (CacheKeyTypeEnum) {
|
|
34
|
+
CacheKeyTypeEnum["ENTITY"] = "entity";
|
|
35
|
+
CacheKeyTypeEnum["QUERY"] = "query";
|
|
36
|
+
})(CacheKeyTypeEnum || (exports.CacheKeyTypeEnum = CacheKeyTypeEnum = {}));
|
|
37
|
+
var IdentifierPrefixEnum;
|
|
38
|
+
(function (IdentifierPrefixEnum) {
|
|
39
|
+
IdentifierPrefixEnum["ID"] = "i";
|
|
40
|
+
IdentifierPrefixEnum["SUBSCRIBER_ID"] = "s";
|
|
41
|
+
IdentifierPrefixEnum["TEMPLATE_IDENTIFIER"] = "t_i";
|
|
42
|
+
IdentifierPrefixEnum["API_KEY"] = "a_k";
|
|
43
|
+
IdentifierPrefixEnum["GROUPED_BLUEPRINT"] = "g_b";
|
|
44
|
+
IdentifierPrefixEnum["API_RATE_LIMIT_CATEGORY"] = "a_r_l_c";
|
|
45
|
+
IdentifierPrefixEnum["SERVICE_CONFIG"] = "s_c";
|
|
46
|
+
})(IdentifierPrefixEnum || (exports.IdentifierPrefixEnum = IdentifierPrefixEnum = {}));
|
|
47
|
+
var ServiceConfigIdentifierEnum;
|
|
48
|
+
(function (ServiceConfigIdentifierEnum) {
|
|
49
|
+
ServiceConfigIdentifierEnum["API_RATE_LIMIT_SERVICE_MAXIMUM"] = "api_rate_limit_service_maximum";
|
|
50
|
+
})(ServiceConfigIdentifierEnum || (exports.ServiceConfigIdentifierEnum = ServiceConfigIdentifierEnum = {}));
|
|
51
|
+
var OrgScopePrefixEnum;
|
|
52
|
+
(function (OrgScopePrefixEnum) {
|
|
53
|
+
OrgScopePrefixEnum["ENVIRONMENT_ID"] = "e";
|
|
54
|
+
OrgScopePrefixEnum["ORGANIZATION_ID"] = "o";
|
|
55
|
+
})(OrgScopePrefixEnum || (exports.OrgScopePrefixEnum = OrgScopePrefixEnum = {}));
|
|
56
|
+
exports.BLUEPRINT_IDENTIFIER = 'blueprints/group-by-category';
|
|
57
|
+
const buildSubscriberKey = ({ subscriberId, _environmentId, }) => (0, exports.buildCommonKey)({
|
|
58
|
+
type: CacheKeyTypeEnum.ENTITY,
|
|
59
|
+
keyEntity: CacheKeyPrefixEnum.SUBSCRIBER,
|
|
60
|
+
environmentId: _environmentId,
|
|
61
|
+
identifierPrefix: IdentifierPrefixEnum.SUBSCRIBER_ID,
|
|
62
|
+
identifier: subscriberId,
|
|
63
|
+
});
|
|
64
|
+
exports.buildSubscriberKey = buildSubscriberKey;
|
|
65
|
+
const buildVariablesKey = ({ _environmentId, _organizationId, }) => (0, exports.buildCommonEnvironmentKey)({
|
|
66
|
+
type: CacheKeyTypeEnum.ENTITY,
|
|
67
|
+
keyEntity: CacheKeyPrefixEnum.WORKFLOW_VARIABLES,
|
|
68
|
+
environmentId: _environmentId,
|
|
69
|
+
});
|
|
70
|
+
exports.buildVariablesKey = buildVariablesKey;
|
|
71
|
+
const buildUserKey = ({ id }) => buildKeyById({
|
|
72
|
+
type: CacheKeyTypeEnum.ENTITY,
|
|
73
|
+
keyEntity: CacheKeyPrefixEnum.USER,
|
|
74
|
+
identifier: id,
|
|
75
|
+
});
|
|
76
|
+
exports.buildUserKey = buildUserKey;
|
|
77
|
+
const buildNotificationTemplateKey = ({ _id, _environmentId, }) => (0, exports.buildCommonKey)({
|
|
78
|
+
type: CacheKeyTypeEnum.ENTITY,
|
|
79
|
+
keyEntity: CacheKeyPrefixEnum.NOTIFICATION_TEMPLATE,
|
|
80
|
+
environmentId: _environmentId,
|
|
81
|
+
identifierPrefix: IdentifierPrefixEnum.ID,
|
|
82
|
+
identifier: _id,
|
|
83
|
+
});
|
|
84
|
+
exports.buildNotificationTemplateKey = buildNotificationTemplateKey;
|
|
85
|
+
const buildNotificationTemplateIdentifierKey = ({ templateIdentifier, _environmentId, }) => (0, exports.buildCommonKey)({
|
|
86
|
+
type: CacheKeyTypeEnum.ENTITY,
|
|
87
|
+
keyEntity: CacheKeyPrefixEnum.NOTIFICATION_TEMPLATE,
|
|
88
|
+
environmentId: _environmentId,
|
|
89
|
+
identifierPrefix: IdentifierPrefixEnum.TEMPLATE_IDENTIFIER,
|
|
90
|
+
identifier: templateIdentifier,
|
|
91
|
+
});
|
|
92
|
+
exports.buildNotificationTemplateIdentifierKey = buildNotificationTemplateIdentifierKey;
|
|
93
|
+
const buildEnvironmentByApiKey = ({ apiKey }) => buildKeyById({
|
|
94
|
+
type: CacheKeyTypeEnum.ENTITY,
|
|
95
|
+
keyEntity: CacheKeyPrefixEnum.ENVIRONMENT_BY_API_KEY,
|
|
96
|
+
identifier: apiKey,
|
|
97
|
+
identifierPrefix: IdentifierPrefixEnum.API_KEY,
|
|
98
|
+
});
|
|
99
|
+
exports.buildEnvironmentByApiKey = buildEnvironmentByApiKey;
|
|
100
|
+
const buildGroupedBlueprintsKey = (environmentId) => (0, exports.buildCommonKey)({
|
|
101
|
+
type: CacheKeyTypeEnum.ENTITY,
|
|
102
|
+
keyEntity: CacheKeyPrefixEnum.GROUPED_BLUEPRINTS,
|
|
103
|
+
environmentIdPrefix: OrgScopePrefixEnum.ORGANIZATION_ID,
|
|
104
|
+
environmentId: environmentId,
|
|
105
|
+
identifierPrefix: IdentifierPrefixEnum.GROUPED_BLUEPRINT,
|
|
106
|
+
identifier: exports.BLUEPRINT_IDENTIFIER,
|
|
107
|
+
});
|
|
108
|
+
exports.buildGroupedBlueprintsKey = buildGroupedBlueprintsKey;
|
|
109
|
+
const createHash = (apiKey) => {
|
|
110
|
+
const hash = (0, crypto_1.createHash)('sha256');
|
|
111
|
+
hash.update(apiKey);
|
|
112
|
+
return hash.digest('hex');
|
|
113
|
+
};
|
|
114
|
+
const buildAuthServiceKey = ({ apiKey }) => {
|
|
115
|
+
const apiKeyHash = createHash(apiKey);
|
|
116
|
+
return buildKeyById({
|
|
117
|
+
type: CacheKeyTypeEnum.ENTITY,
|
|
118
|
+
keyEntity: CacheKeyPrefixEnum.AUTH_SERVICE,
|
|
119
|
+
identifier: apiKeyHash,
|
|
120
|
+
identifierPrefix: IdentifierPrefixEnum.API_KEY,
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
exports.buildAuthServiceKey = buildAuthServiceKey;
|
|
124
|
+
const buildMaximumApiRateLimitKey = ({ apiRateLimitCategory, _environmentId, }) => (0, exports.buildCommonKey)({
|
|
125
|
+
type: CacheKeyTypeEnum.ENTITY,
|
|
126
|
+
keyEntity: CacheKeyPrefixEnum.MAXIMUM_API_RATE_LIMIT,
|
|
127
|
+
environmentId: _environmentId,
|
|
128
|
+
identifierPrefix: IdentifierPrefixEnum.API_RATE_LIMIT_CATEGORY,
|
|
129
|
+
identifier: apiRateLimitCategory,
|
|
130
|
+
});
|
|
131
|
+
exports.buildMaximumApiRateLimitKey = buildMaximumApiRateLimitKey;
|
|
132
|
+
const buildEvaluateApiRateLimitKey = ({ apiRateLimitCategory, _environmentId, }) => (0, exports.buildCommonKey)({
|
|
133
|
+
type: CacheKeyTypeEnum.ENTITY,
|
|
134
|
+
keyEntity: CacheKeyPrefixEnum.EVALUATE_API_RATE_LIMIT,
|
|
135
|
+
environmentId: _environmentId,
|
|
136
|
+
identifierPrefix: IdentifierPrefixEnum.API_RATE_LIMIT_CATEGORY,
|
|
137
|
+
identifier: apiRateLimitCategory,
|
|
138
|
+
});
|
|
139
|
+
exports.buildEvaluateApiRateLimitKey = buildEvaluateApiRateLimitKey;
|
|
140
|
+
const buildServiceConfigKey = (identifier) => buildKeyById({
|
|
141
|
+
type: CacheKeyTypeEnum.ENTITY,
|
|
142
|
+
keyEntity: CacheKeyPrefixEnum.SERVICE_CONFIG,
|
|
143
|
+
identifierPrefix: IdentifierPrefixEnum.SERVICE_CONFIG,
|
|
144
|
+
identifier,
|
|
145
|
+
});
|
|
146
|
+
const buildServiceConfigApiRateLimitMaximumKey = () => buildServiceConfigKey(ServiceConfigIdentifierEnum.API_RATE_LIMIT_SERVICE_MAXIMUM);
|
|
147
|
+
exports.buildServiceConfigApiRateLimitMaximumKey = buildServiceConfigApiRateLimitMaximumKey;
|
|
148
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/entities/key-builder/index.ts"],"names":[],"mappings":";;;AAwDA,sCAEC;AA1DD,mCAAwD;AAKjD,MAAM,cAAc,GAAG,CAAC,EAC7B,IAAI,EACJ,SAAS,EACT,mBAAmB,GAAG,kBAAkB,CAAC,cAAc,EACvD,aAAa,EACb,gBAAgB,GAAG,oBAAoB,CAAC,EAAE,EAC1C,UAAU,GAQX,EAAU,EAAE,CACX,aAAa,CACX,GAAG,IAAI,IAAI,SAAS,IAAI,mBAAmB,IAAI,aAAa,IAAI,gBAAgB,IAAI,UAAU,EAAE,CACjG,CAAC;AAjBS,QAAA,cAAc,kBAiBvB;AAKG,MAAM,yBAAyB,GAAG,CAAC,EACxC,IAAI,EACJ,SAAS,EACT,mBAAmB,GAAG,kBAAkB,CAAC,cAAc,EACvD,aAAa,GAMd,EAAU,EAAE,CACX,aAAa,CAAC,GAAG,IAAI,IAAI,SAAS,IAAI,mBAAmB,IAAI,aAAa,EAAE,CAAC,CAAC;AAXnE,QAAA,yBAAyB,6BAW0C;AAKhF,MAAM,YAAY,GAAG,CAAC,EACpB,IAAI,EACJ,SAAS,EACT,gBAAgB,GAAG,oBAAoB,CAAC,EAAE,EAC1C,UAAU,GAMX,EAAU,EAAE,CACX,aAAa,CAAC,GAAG,IAAI,IAAI,SAAS,IAAI,gBAAgB,IAAI,UAAU,EAAE,CAAC,CAAC;AA0MxE,oCAAY;AAxMd,SAAgB,aAAa,CAAC,YAAoB;IAChD,OAAO,IAAI,YAAY,GAAG,CAAC;AAC7B,CAAC;AAEY,QAAA,YAAY,GAAG,SAAS,CAAC;AAEtC,IAAY,k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AC,sBAAsB;IACpD,aAAa,EAAE,cAAc;IAC7B,gBAAgB,EAAE,oBAAoB,CAAC,uBAAuB;IAC9D,UAAU,EAAE,oBAAoB;CACjC,CAAC,CAAC;AAyCH,kEAA2B;AAvC7B,MAAM,4BAA4B,GAAG,CAAC,EACpC,oBAAoB,EACpB,cAAc,GAIf,EAAU,EAAE,CACX,IAAA,sBAAc,EAAC;IACb,IAAI,EAAE,gBAAgB,CAAC,MAAM;IAC7B,SAAS,EAAE,kBAAkB,CAAC,uBAAuB;IACrD,aAAa,EAAE,cAAc;IAC7B,gBAAgB,EAAE,oBAAoB,CAAC,uBAAuB;IAC9D,UAAU,EAAE,oBAAoB;CACjC,CAAC,CAAC;AA2BH,oEAA4B;AAzB9B,MAAM,qBAAqB,GAAG,CAC5B,UAAuC,EAC/B,EAAE,CACV,YAAY,CAAC;IACX,IAAI,EAAE,gBAAgB,CAAC,MAAM;IAC7B,SAAS,EAAE,kBAAkB,CAAC,cAAc;IAC5C,gBAAgB,EAAE,oBAAoB,CAAC,cAAc;IACrD,UAAU;CACX,CAAC,CAAC;AAEL,MAAM,wCAAwC,GAAG,GAAW,EAAE,CAC5D,qBAAqB,CACnB,2BAA2B,CAAC,8BAA8B,CAC3D,CAAC;AAaF,4FAAwC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./notification"), exports);
|
|
18
|
+
__exportStar(require("./subject"), exports);
|
|
19
|
+
__exportStar(require("./notification-template"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/entities/notification/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,4CAA0B;AAC1B,0DAAwC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Subject } from './subject';
|
|
2
|
+
import { UserId } from '../../types';
|
|
3
|
+
export interface NotificationTemplate {
|
|
4
|
+
type: string;
|
|
5
|
+
userId: UserId;
|
|
6
|
+
dataId: string;
|
|
7
|
+
subjects: Subject[];
|
|
8
|
+
subject_count?: number;
|
|
9
|
+
diObject?: Subject;
|
|
10
|
+
inObject?: Subject;
|
|
11
|
+
prObject?: Subject;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-template.js","sourceRoot":"","sources":["../../../../src/lib/entities/notification/notification-template.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NotificationId, NotificationStatus, NotificationTypes } from '../../types';
|
|
2
|
+
export interface INotification {
|
|
3
|
+
id?: NotificationId;
|
|
4
|
+
key: string;
|
|
5
|
+
type: NotificationTypes;
|
|
6
|
+
universalLink: string;
|
|
7
|
+
status: NotificationStatus;
|
|
8
|
+
highlights: string;
|
|
9
|
+
content: string;
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
updatedAt: Date;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.js","sourceRoot":"","sources":["../../../../src/lib/entities/notification/notification.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subject.js","sourceRoot":"","sources":["../../../../src/lib/entities/notification/subject.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { PostId, PostStatusEnum, PostTypeEnum, PriceTypeEnum } from '../../types';
|
|
2
|
+
import { IArea } from '../area';
|
|
3
|
+
import { ITag } from '../tag';
|
|
4
|
+
export interface IPost {
|
|
5
|
+
id?: PostId;
|
|
6
|
+
title: string;
|
|
7
|
+
subTitle?: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
address?: string;
|
|
11
|
+
wardCode?: string;
|
|
12
|
+
districtCode?: string;
|
|
13
|
+
provinceCode?: string;
|
|
14
|
+
userId: string;
|
|
15
|
+
phoneNumber: string;
|
|
16
|
+
contactName: string;
|
|
17
|
+
zalo?: string;
|
|
18
|
+
email?: string;
|
|
19
|
+
type: PostTypeEnum;
|
|
20
|
+
estateType?: string;
|
|
21
|
+
projectId: string;
|
|
22
|
+
price: number;
|
|
23
|
+
priceType: PriceTypeEnum;
|
|
24
|
+
constructionArea?: number;
|
|
25
|
+
frontage?: number;
|
|
26
|
+
direction?: string;
|
|
27
|
+
numBedrooms: number;
|
|
28
|
+
numToilets: number;
|
|
29
|
+
numFloors: number;
|
|
30
|
+
images?: string[];
|
|
31
|
+
videos?: string[];
|
|
32
|
+
status: PostStatusEnum;
|
|
33
|
+
position: string;
|
|
34
|
+
visibleFrom: Date;
|
|
35
|
+
visibleTo: Date;
|
|
36
|
+
numOfView?: number;
|
|
37
|
+
numOfShare?: number;
|
|
38
|
+
upvote?: number;
|
|
39
|
+
downvote?: number;
|
|
40
|
+
numOfClickContact?: number;
|
|
41
|
+
verified?: number;
|
|
42
|
+
visibility?: number;
|
|
43
|
+
completeTime?: string;
|
|
44
|
+
featured?: number;
|
|
45
|
+
companyName?: string;
|
|
46
|
+
legal?: string;
|
|
47
|
+
buildingSize?: string;
|
|
48
|
+
rankingPoint?: number;
|
|
49
|
+
ward?: IArea;
|
|
50
|
+
district?: IArea;
|
|
51
|
+
province?: IArea;
|
|
52
|
+
tags: ITag[];
|
|
53
|
+
createdBy?: string;
|
|
54
|
+
updatedBy?: string;
|
|
55
|
+
createdAt?: Date;
|
|
56
|
+
updatedAt?: Date;
|
|
57
|
+
featuredTop1: number;
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/entities/post/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ProjectId, ProjectStatusEnum } from '../../types';
|
|
2
|
+
import { IUser } from '../user';
|
|
3
|
+
export interface IProject {
|
|
4
|
+
id: ProjectId;
|
|
5
|
+
slug: string;
|
|
6
|
+
name: string;
|
|
7
|
+
nameEn: string;
|
|
8
|
+
images: string[];
|
|
9
|
+
banner?: string;
|
|
10
|
+
address?: string;
|
|
11
|
+
wardCode?: string;
|
|
12
|
+
districtCode?: string;
|
|
13
|
+
provinceCode?: string;
|
|
14
|
+
type?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
numApartment: number;
|
|
17
|
+
numBuilding: number;
|
|
18
|
+
constructionArea?: number;
|
|
19
|
+
constructionSite?: string;
|
|
20
|
+
status?: ProjectStatusEnum;
|
|
21
|
+
investorId?: string;
|
|
22
|
+
verified?: number;
|
|
23
|
+
featured?: number;
|
|
24
|
+
createdAt?: Date;
|
|
25
|
+
updatedAt?: Date;
|
|
26
|
+
user?: IUser;
|
|
27
|
+
phoneNumber?: string;
|
|
28
|
+
areaUnit: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/entities/project/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/entities/tag/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TransactionId, UserId, WalletId } from '../../types';
|
|
2
|
+
export interface ITransaction {
|
|
3
|
+
id: TransactionId;
|
|
4
|
+
code: string;
|
|
5
|
+
type: string;
|
|
6
|
+
walletId: WalletId;
|
|
7
|
+
userId: UserId;
|
|
8
|
+
currentAmount: number;
|
|
9
|
+
newAmount: number;
|
|
10
|
+
amount: number;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
updatedAt: Date;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/entities/transaction/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { UserId } from '../../types';
|
|
2
|
+
import { IUserToken } from './user-token';
|
|
3
|
+
export interface IUser {
|
|
4
|
+
id: UserId;
|
|
5
|
+
firstName: string;
|
|
6
|
+
lastName: string;
|
|
7
|
+
email: string;
|
|
8
|
+
username: string;
|
|
9
|
+
profilePicture: string;
|
|
10
|
+
password: string;
|
|
11
|
+
jobTitle: string;
|
|
12
|
+
bio: string;
|
|
13
|
+
urls: string;
|
|
14
|
+
roles?: string[];
|
|
15
|
+
plan: number;
|
|
16
|
+
status?: string;
|
|
17
|
+
dob?: Date;
|
|
18
|
+
createdAt: Date;
|
|
19
|
+
updatedAt: Date;
|
|
20
|
+
billingCode: string;
|
|
21
|
+
phoneNumber: string;
|
|
22
|
+
resetToken?: string;
|
|
23
|
+
tokens: IUserToken[];
|
|
24
|
+
resetTokenDate?: string;
|
|
25
|
+
resetTokenCount?: IUserResetTokenCount;
|
|
26
|
+
failedLogin?: IFailedLogin;
|
|
27
|
+
}
|
|
28
|
+
export interface IUserResetTokenCount {
|
|
29
|
+
reqInMinute: number;
|
|
30
|
+
reqInDay: number;
|
|
31
|
+
}
|
|
32
|
+
export interface IFailedLogin {
|
|
33
|
+
times: number;
|
|
34
|
+
lastFailedAttempt: string;
|
|
35
|
+
}
|
|
36
|
+
export * from './user-token';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./user-token"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/entities/user/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAyCA,+CAA6B"}
|