my-typescript-library-rahul52us 1.0.2 → 1.0.4
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/repository/schemas/organisation.schema.js +3 -1
- package/dist/repository/schemas/organisation.schema.js.map +1 -1
- package/dist/types/caches/memcache.cache.d.ts +0 -0
- package/dist/types/caches/redis.cache.d.ts +0 -0
- package/dist/types/config/auth/passportConfig.d.ts +1 -0
- package/dist/types/constants/billing.constant.d.ts +4 -0
- package/dist/types/constants/send-mail-type.constant.d.ts +8 -0
- package/dist/types/constants/status.constant.d.ts +3 -0
- package/dist/types/controllers/auth.controller.d.ts +4 -0
- package/dist/types/controllers/license/license.controller.d.ts +11 -0
- package/dist/types/controllers/rbac/express.def.d.ts +7 -0
- package/dist/types/controllers/rbac/rbac.controller.d.ts +9 -0
- package/dist/types/controllers/rbac/roles.d.ts +2 -0
- package/dist/types/helpers/compile-email-template.d.ts +19 -0
- package/dist/types/helpers/genarateRandomkey.d.ts +2 -0
- package/dist/types/helpers/hashing.helper.d.ts +2 -0
- package/dist/types/helpers/jwt.helper.d.ts +9 -0
- package/dist/types/helpers/string.helper.d.ts +8 -0
- package/dist/types/libs/mail.d.ts +1 -0
- package/dist/types/middlewares/logger.middleware.d.ts +4 -0
- package/dist/types/repository/accountdetails.repository.d.ts +20 -0
- package/dist/types/repository/document.repository.d.ts +52 -0
- package/dist/types/repository/filesystem.repository.d.ts +3 -0
- package/dist/types/repository/form.repository.d.ts +43 -0
- package/dist/types/repository/log.repository.d.ts +12 -0
- package/dist/types/repository/notifications.repository.d.ts +31 -0
- package/dist/types/repository/organisation.repository.d.ts +60 -0
- package/dist/types/repository/profile.repository.d.ts +52 -0
- package/dist/types/repository/role.repository.d.ts +13 -0
- package/dist/types/repository/schemas/WorkflowSettingsScheme.d.ts +3 -0
- package/dist/types/repository/schemas/accountdetails.schema.d.ts +20 -0
- package/dist/types/repository/schemas/accounts.schema.d.ts +20 -0
- package/dist/types/repository/schemas/document.schema.d.ts +26 -0
- package/dist/types/repository/schemas/extracted.schema.d.ts +10 -0
- package/dist/types/repository/schemas/fileSystem.schema.d.ts +10 -0
- package/dist/types/repository/schemas/form.schema.d.ts +3 -0
- package/dist/types/repository/schemas/log.schema.d.ts +13 -0
- package/dist/types/repository/schemas/notifications.schema.d.ts +13 -0
- package/dist/types/repository/schemas/organisation.schema.d.ts +50 -0
- package/dist/types/repository/schemas/profile.schema.d.ts +19 -0
- package/dist/types/repository/schemas/role.schema.d.ts +12 -0
- package/dist/types/repository/schemas/tokens.schema.d.ts +8 -0
- package/dist/types/repository/schemas/userrole.schema.d.ts +13 -0
- package/dist/types/repository/schemas/workflow.schema.d.ts +3 -0
- package/dist/types/repository/user.repository.d.ts +178 -0
- package/dist/types/repository/user_tokens.repository.d.ts +39 -0
- package/dist/types/repository/userrole.repository.d.ts +13 -0
- package/dist/types/repository/workflow.repository.d.ts +36 -0
- package/dist/types/repository/workflowSetting.schema.d.ts +11 -0
- package/dist/types/routes/accountdetails.route.d.ts +2 -0
- package/dist/types/routes/auth.route.d.ts +2 -0
- package/dist/types/routes/document.route.d.ts +2 -0
- package/dist/types/routes/fileSystem.route.d.ts +2 -0
- package/dist/types/routes/form.route.d.ts +2 -0
- package/dist/types/routes/index.d.ts +2 -0
- package/dist/types/routes/log.route.d.ts +2 -0
- package/dist/types/routes/notifications.route.d.ts +2 -0
- package/dist/types/routes/org.route.d.ts +2 -0
- package/dist/types/routes/profile.route.d.ts +2 -0
- package/dist/types/routes/role.route.d.ts +2 -0
- package/dist/types/routes/user.route.d.ts +2 -0
- package/dist/types/routes/userrole.route.d.ts +2 -0
- package/dist/types/routes/workflow.route.d.ts +2 -0
- package/dist/types/server.d.ts +15 -0
- package/dist/types/services/authentication/change-password.service.d.ts +15 -0
- package/dist/types/services/authentication/forgot-password.service.d.ts +2 -0
- package/dist/types/services/authentication/getuser.service.d.ts +22 -0
- package/dist/types/services/authentication/index.d.ts +8 -0
- package/dist/types/services/authentication/login.service.d.ts +26 -0
- package/dist/types/services/authentication/register.admin.service.d.ts +8 -0
- package/dist/types/services/authentication/register.service.d.ts +12 -0
- package/dist/types/services/authentication/resend-email.service.d.ts +2 -0
- package/dist/types/services/authentication/reset-password.service.d.ts +2 -0
- package/dist/types/services/authentication/verify-email.service.d.ts +7 -0
- package/dist/types/services/document/document.services.d.ts +68 -0
- package/dist/types/services/fileSystem/fileSystem.service.d.ts +5 -0
- package/dist/types/services/form/form.service.d.ts +14 -0
- package/dist/types/services/logs/log.service.d.ts +11 -0
- package/dist/types/services/logs/vendorLog.service.d.ts +11 -0
- package/dist/types/services/notifications/notifications.service.d.ts +25 -0
- package/dist/types/services/organisation/organisation.service.d.ts +45 -0
- package/dist/types/services/profile/profile.services.d.ts +4 -0
- package/dist/types/services/roles/role.services.d.ts +51 -0
- package/dist/types/services/statement/accountdetails.service.d.ts +3 -0
- package/dist/types/services/userroles/userrole.service.d.ts +25 -0
- package/dist/types/services/workflow/workSettings.service.d.ts +13 -0
- package/dist/types/services/workflow/workflow.service.d.ts +95 -0
- package/dist/types/setupModal.d.ts +9 -0
- package/dist/types/utils/axios-instance.d.ts +2 -0
- package/dist/types/utils/common.d.ts +15 -0
- package/dist/types/utils/commonfile.d.ts +0 -0
- package/dist/types/utils/cookie.d.ts +6 -0
- package/dist/types/utils/env.d.ts +15 -0
- package/dist/types/utils/folder-path.d.ts +6 -0
- package/dist/types/utils/format-date-db.d.ts +2 -0
- package/dist/types/utils/log.service.d.ts +1 -0
- package/dist/types/utils/logger.d.ts +3 -0
- package/dist/types/validations/authenticate.validation.d.ts +17 -0
- package/dist/types/validations/authenticate.validation.test.d.ts +1 -0
- package/package.json +62 -1
- package/src/repository/schemas/accounts.schema.ts +4 -4
- package/src/repository/schemas/organisation.schema.ts +26 -25
- package/tsconfig.json +3 -1
- package/types/index.d.ts +2 -1
|
@@ -24,7 +24,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
27
|
-
|
|
27
|
+
// Define the Organisation schema
|
|
28
|
+
const OrganisationSchema = new mongoose_1.Schema({
|
|
28
29
|
name: {
|
|
29
30
|
type: String,
|
|
30
31
|
trim: true,
|
|
@@ -144,5 +145,6 @@ const OrganisationSchema = new mongoose_1.default.Schema({
|
|
|
144
145
|
ref: "organisation",
|
|
145
146
|
},
|
|
146
147
|
});
|
|
148
|
+
// Export the mongoose model with the generic typing
|
|
147
149
|
exports.default = mongoose_1.default.model("Organisation", OrganisationSchema);
|
|
148
150
|
//# sourceMappingURL=organisation.schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organisation.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/organisation.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"organisation.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/organisation.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA4C;AAsD5C,iCAAiC;AACjC,MAAM,kBAAkB,GAAW,IAAI,iBAAM,CAAC;IAC5C,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,CAAC,IAAI,EAAE,kBAAkB,CAAC;QACpC,MAAM,EAAE,KAAK;KACd;IACD,WAAW,EAAE;QACX,IAAI,EAAE;YACJ;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE,MAAM;iBACb;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,MAAM;iBACb;gBACD,SAAS,EAAE;oBACT;wBACE,IAAI,EAAE;4BACJ,IAAI,EAAE,MAAM;yBACb;wBACD,MAAM,EAAE;4BACN,IAAI,EAAE,MAAM;yBACb;wBACD,QAAQ,EAAE;4BACR,IAAI,EAAE,MAAM;yBACb;qBACF;iBACF;aACF;SACF;KACF;IACD,KAAK,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,mBAAmB,CAAC;KACtC;IACD,GAAG,EAAE;QACH,IAAI,EAAE,MAAM;KACb;IACD,cAAc,EAAE;QACd;YACE,YAAY,EAAE;gBACZ,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,IAAI;aACf;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,IAAI;aACf;SACF;KACF;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,cAAc;KACxB;IACD,OAAO,EAAE;QACP,IAAI,EAAE,MAAM;KACb;IACD,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,MAAM;SACb;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM;SACb;KACF;IACD,WAAW,EAAE;QACX,IAAI,EAAE,MAAM;KACb;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM;KACb;IACD,YAAY,EAAE;QACZ,IAAI,EAAE;YACJ;gBACE,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,QAAQ;wBAC3B,GAAG,EAAE,UAAU;qBAChB;iBACF;aACF;SACF;QACD,KAAK,EAAE;YACL;gBACE,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,QAAQ;wBAC3B,GAAG,EAAE,UAAU;qBAChB;iBACF;aACF;SACF;QACD,GAAG,EAAE;YACH;gBACE,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,QAAQ;wBAC3B,GAAG,EAAE,UAAU;qBAChB;iBACF;aACF;SACF;QACD,eAAe,EAAE;YACf;gBACE,KAAK,EAAE;oBACL;wBACE,IAAI,EAAE,iBAAM,CAAC,KAAK,CAAC,QAAQ;wBAC3B,GAAG,EAAE,UAAU;qBAChB;iBACF;aACF;SACF;KACF;IACD,WAAW,EAAE;QACX,IAAI,EAAE,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACpC,GAAG,EAAE,cAAc;KACpB;CACF,CAAC,CAAC;AAEH,oDAAoD;AACpD,kBAAe,kBAAQ,CAAC,KAAK,CAAgB,cAAc,EAAE,kBAAkB,CAAC,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NextFunction, Response } from "express";
|
|
2
|
+
import "../config/auth/passportConfig";
|
|
3
|
+
export declare function authenticateJWT(req: any, res: Response, next: NextFunction): Promise<void>;
|
|
4
|
+
export declare function authorizeJWT(req: any, res: Response, next: NextFunction): Promise<void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Request, Response, NextFunction } from 'express';
|
|
2
|
+
interface UserRequest extends Request {
|
|
3
|
+
user?: {
|
|
4
|
+
permission: string[];
|
|
5
|
+
role: string;
|
|
6
|
+
company: string;
|
|
7
|
+
license: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare const getLicense: (req: UserRequest, res: Response, next: NextFunction) => Promise<void | Response<any, Record<string, any>>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Request, NextFunction } from "express";
|
|
2
|
+
interface UserRequest extends Request {
|
|
3
|
+
user?: {
|
|
4
|
+
permission: string[];
|
|
5
|
+
role: "string";
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export declare function grantAccess(action: string, object: string): (req: UserRequest, res: any, next: NextFunction) => Promise<any>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
fileName: string;
|
|
3
|
+
data: {
|
|
4
|
+
date?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
url?: string;
|
|
7
|
+
teamName?: string;
|
|
8
|
+
link?: string;
|
|
9
|
+
workflow_name?: string;
|
|
10
|
+
password?: string;
|
|
11
|
+
username?: string;
|
|
12
|
+
level?: string;
|
|
13
|
+
role?: string;
|
|
14
|
+
designation?: string;
|
|
15
|
+
verifyTokenUrl?: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default function compileEmailTemplate({ fileName, data }: Props): Promise<string>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function sendMail(to: string, subject: string, html: string, attachmentBase64String?: string, cc?: string | string[]): Promise<boolean>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
export type StatementData = {
|
|
3
|
+
_id?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
address?: string;
|
|
6
|
+
createdAt?: string;
|
|
7
|
+
updatedAt?: string;
|
|
8
|
+
deletedAt?: string;
|
|
9
|
+
city?: string;
|
|
10
|
+
pincode?: string;
|
|
11
|
+
state?: string;
|
|
12
|
+
country?: string;
|
|
13
|
+
gstin?: string;
|
|
14
|
+
openingbalance?: string;
|
|
15
|
+
billedamount?: string;
|
|
16
|
+
amountreceived?: string;
|
|
17
|
+
balancedue?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function createAccount(data: StatementData): Promise<mongoose.Types.ObjectId | Error | string>;
|
|
20
|
+
export declare function getAccount(searchValue: string, sort: string | null, skip: string | null, limit: string | null): Promise<any>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { IDocument } from "./schemas/document.schema";
|
|
2
|
+
import mongoose from "mongoose";
|
|
3
|
+
export declare function getCount(userId: string, level: string | null, exchangeType?: string | null, billType?: string | null): Promise<any[]>;
|
|
4
|
+
export declare function createPendingApproval(data: IDocument): Promise<any>;
|
|
5
|
+
export declare const findOneByDocumentIdAndDelete: (data: any) => Promise<{
|
|
6
|
+
status: string;
|
|
7
|
+
data: string;
|
|
8
|
+
message?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
status: string;
|
|
11
|
+
message: any;
|
|
12
|
+
data?: undefined;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function getAllDocument(noOfLevels: number, workflow: string, searchValue: string, status: string, company: string, userId: any, differentiateFirstLevel: any, level: string, sort: string | null, limit: string | null, page: string | null, exchangeType: any | null, billType: string | null, manual: string | null, startDate: any, endDate: any, searchField: any, dateFilterKey: string, sortByKey: string, additionalFiles: string[]): Promise<{
|
|
15
|
+
data: any;
|
|
16
|
+
totalPages: number;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function getDocumentCount(company: string, noOfLevels: number, workflow: string, userId: string, exchangeType: string, level: string, status: string, dateFrom: any, dateTo: any, dateFilterKey: string, differentiateFirstLevel: boolean): Promise<any>;
|
|
19
|
+
export declare function getDocumentCountByLevelAndStatus(company: string, noOfLevels: number, approvals: any[], workflow: string, userId: string, differentiateFirstLevel: boolean, level: string | null, dateTo: Date | string, dateFrom: Date | string, exchangeType?: string | null, dateFilterKey?: string): Promise<any[]>;
|
|
20
|
+
export declare function countDocumentsByLevelAndStatus(userId: string, level: string, status: string, exchangeType: string | null, billType: string | null): Promise<any[]>;
|
|
21
|
+
export declare function getDocumentCountDetails(userId: string, level: string, status: string, exchangeType: string | null, billType: string | null): Promise<any[]>;
|
|
22
|
+
export declare function getAllPendingApproval(searchValue: string, company: string, userId: string, sort: string | null, limit: string | null, page: string | null, exchangeType: string | null, billType: string | null): Promise<{
|
|
23
|
+
data: any[];
|
|
24
|
+
totalPages: number;
|
|
25
|
+
}>;
|
|
26
|
+
export declare function getPendingApproval(searchValue: string, company: string, userId: string, sort: string | null, limit: string | null, page: string | null, exchangeType: string | null, billType: string | null): Promise<{
|
|
27
|
+
data: any[];
|
|
28
|
+
totalPages: number;
|
|
29
|
+
}>;
|
|
30
|
+
export declare function updateDocument(id: string, data: any): Promise<any>;
|
|
31
|
+
export declare function getPendingApprovalDocument(searchValue: string, company: string, userId: string, sort: string | null, skip: string | null, limit: string | null, exchangeType: string | null, billType: string | null, approvalLevel: number | null): Promise<{
|
|
32
|
+
data: any[];
|
|
33
|
+
}>;
|
|
34
|
+
export declare function updateComment(id: string, data: Partial<IDocument>): Promise<mongoose.UpdateWriteOpResult>;
|
|
35
|
+
export declare function updateStatus(data: Partial<IDocument>): Promise<mongoose.UpdateWriteOpResult>;
|
|
36
|
+
export declare function updateFile(id: string, data: any): Promise<mongoose.UpdateWriteOpResult>;
|
|
37
|
+
export declare function updateAlternativeDocument(id: string, data: any): Promise<mongoose.UpdateWriteOpResult>;
|
|
38
|
+
export declare function getDocument(id: any): Promise<any>;
|
|
39
|
+
export declare const getDocumentByStatus: (req: any, status: any) => Promise<any[]>;
|
|
40
|
+
export declare function getPendingDash(req: any): Promise<{
|
|
41
|
+
data: any[];
|
|
42
|
+
totalCount: number;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const getDashChartdata: (data: any) => Promise<any[]>;
|
|
45
|
+
export declare const deleteSingleDocument: (data: any) => Promise<{
|
|
46
|
+
status: string;
|
|
47
|
+
data: any;
|
|
48
|
+
}>;
|
|
49
|
+
export declare const deleteAllDocuments: () => Promise<{
|
|
50
|
+
status: string;
|
|
51
|
+
data: any;
|
|
52
|
+
}>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose" />
|
|
25
|
+
/// <reference types="passport-local-mongoose" />
|
|
26
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
27
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
28
|
+
export type FormData = {
|
|
29
|
+
_id?: string;
|
|
30
|
+
username: string;
|
|
31
|
+
name: string;
|
|
32
|
+
values: any;
|
|
33
|
+
createdAt?: Date;
|
|
34
|
+
updatedAt?: Date;
|
|
35
|
+
deletedAt?: Date;
|
|
36
|
+
};
|
|
37
|
+
export declare function createForm(FormData: FormData): Promise<any>;
|
|
38
|
+
export declare function getallForm(searchValue: string, company: string, userId: string, page: number, limit: number, searchField: any, workflow: any): Promise<{
|
|
39
|
+
data: any[];
|
|
40
|
+
totalPages: number;
|
|
41
|
+
}>;
|
|
42
|
+
export declare function getForm(data: any): Promise<any>;
|
|
43
|
+
export declare function updateForm(id: string, data: any): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type LogsProfile = {
|
|
2
|
+
_id?: string;
|
|
3
|
+
message: string;
|
|
4
|
+
logtype: string;
|
|
5
|
+
statuscode?: number;
|
|
6
|
+
type: string;
|
|
7
|
+
created_At?: string;
|
|
8
|
+
company?: string;
|
|
9
|
+
user?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function createLog(LogsProfile: LogsProfile): Promise<any>;
|
|
12
|
+
export declare function getLogs(searchValue: string, company: string, userId: string): Promise<any>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
type NotificationsData = {
|
|
3
|
+
user: string;
|
|
4
|
+
receiver: string;
|
|
5
|
+
seenBy: string;
|
|
6
|
+
message: string;
|
|
7
|
+
documentId: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function createNotifications(data: NotificationsData): Promise<any>;
|
|
10
|
+
/**
|
|
11
|
+
* Retrieve all notifications for a user by their user id
|
|
12
|
+
* @param {string} userId
|
|
13
|
+
* @param {boolean} read - optional flag to filter by read/unread status
|
|
14
|
+
* @returns {Promise<NotificationsData[]>} array of notification objects
|
|
15
|
+
*/
|
|
16
|
+
export declare function getUnreadNotificationsCount(data: any): Promise<number>;
|
|
17
|
+
export declare function getUnreadNotifications(data: any): Promise<any>;
|
|
18
|
+
export declare function getReadNotifications(req: any): Promise<any>;
|
|
19
|
+
export declare function findNotifications(id: string): Promise<any>;
|
|
20
|
+
export declare function deleteAllNotifications(): Promise<Error | mongoose.mongo.DeleteResult>;
|
|
21
|
+
export declare function getAllNotifications(user: any, type: any): Promise<any>;
|
|
22
|
+
export declare function markAllNotificationsAsRead(userId: string): Promise<any>;
|
|
23
|
+
/**
|
|
24
|
+
// * Update a notification by its _id
|
|
25
|
+
// * @param {string} id - the _id of the notification to update
|
|
26
|
+
// * @param {NotificationsUpdateData} updateData - the new data to update the notification with
|
|
27
|
+
// * @returns {Promise<void>}
|
|
28
|
+
*/
|
|
29
|
+
export declare function updateNotifications(id: string, updateData: NotificationsData): Promise<any>;
|
|
30
|
+
export declare function deleteNotifications(id: string): Promise<any>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
type address = {
|
|
3
|
+
shipping: any;
|
|
4
|
+
billing: any;
|
|
5
|
+
};
|
|
6
|
+
type OrgProfile = {
|
|
7
|
+
email?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
domain?: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
gstin?: string;
|
|
12
|
+
pan?: string;
|
|
13
|
+
license: string;
|
|
14
|
+
address?: address;
|
|
15
|
+
bankDetails?: any;
|
|
16
|
+
certificates?: any;
|
|
17
|
+
gstinformation?: string;
|
|
18
|
+
customerOrg?: string;
|
|
19
|
+
compliances?: any;
|
|
20
|
+
};
|
|
21
|
+
type findOrg = {
|
|
22
|
+
orgId?: string;
|
|
23
|
+
pan?: string;
|
|
24
|
+
gstin?: string;
|
|
25
|
+
type?: string;
|
|
26
|
+
license?: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* find organisation in mongodb in Organisation collection
|
|
30
|
+
* @param {findOrg} {id - Object Id of the organisation
|
|
31
|
+
* @param {findOrg} type - type of the organisation
|
|
32
|
+
* @param {findOrg} pan - PAN of the organisation
|
|
33
|
+
* @param {findOrg} gstin} - GSTIN of the organisation
|
|
34
|
+
*/
|
|
35
|
+
export declare function findOrg({ orgId, pan, gstin, type }: findOrg): Promise<object>;
|
|
36
|
+
/**
|
|
37
|
+
* Create organisation in mongodb in Organisation collection
|
|
38
|
+
* @param {OrgProfile} orgData
|
|
39
|
+
* @returns Promise
|
|
40
|
+
*/
|
|
41
|
+
export declare function createOrg(orgData: OrgProfile): Promise<any | Error>;
|
|
42
|
+
/**
|
|
43
|
+
* Update organisation profile in mongodb in Organisation collection
|
|
44
|
+
* @param {string} id
|
|
45
|
+
* @param {OrgProfile} data
|
|
46
|
+
*/
|
|
47
|
+
export declare function updateOrg(id: string, data: OrgProfile): Promise<object>;
|
|
48
|
+
export declare function findOrgById(orgId: string): Promise<{
|
|
49
|
+
type: string;
|
|
50
|
+
license: string;
|
|
51
|
+
} | null>;
|
|
52
|
+
export declare function updateorganisation(id: string, data: Partial<OrgProfile>): Promise<any>;
|
|
53
|
+
export declare function findOrgDetails(id: string): Promise<mongoose.Document<unknown, {}, import("./schemas/organisation.schema").IOrganisation> & import("./schemas/organisation.schema").IOrganisation & Required<{
|
|
54
|
+
_id: unknown;
|
|
55
|
+
}> & {
|
|
56
|
+
__v: number;
|
|
57
|
+
}>;
|
|
58
|
+
export declare function getOrgDetails(searchValue: string, company: string, userId: string, sort: string | null, skip: string | null, limit: string | null): Promise<any>;
|
|
59
|
+
export declare function getCompliancesDetails(searchValue: string, company: string, userId: string, sort: string | null, skip: string | null, limit: string | null): Promise<any[] | Error>;
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose" />
|
|
25
|
+
/// <reference types="passport-local-mongoose" />
|
|
26
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
27
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
28
|
+
import { profile } from './schemas/profile.schema';
|
|
29
|
+
export type accountDetailsData = {
|
|
30
|
+
name: string;
|
|
31
|
+
email: string;
|
|
32
|
+
gstTreatment: string;
|
|
33
|
+
businessGSTIN: string;
|
|
34
|
+
billingAddressArea: string;
|
|
35
|
+
billingAddressCity: string;
|
|
36
|
+
billingAddressState: string;
|
|
37
|
+
billingAddressCountry: string;
|
|
38
|
+
billingAddressPinCode: string;
|
|
39
|
+
shippingAddressArea: string;
|
|
40
|
+
shippingAddressCity: string;
|
|
41
|
+
shippingAddressState: string;
|
|
42
|
+
shippingAddressCountry: string;
|
|
43
|
+
shippingAddressPinCode: string;
|
|
44
|
+
};
|
|
45
|
+
export declare function createProfile(accountDetailsData: profile): Promise<any>;
|
|
46
|
+
export declare function updateProfile(id: string, data: accountDetailsData): Promise<Error | import("mongoose").UpdateWriteOpResult>;
|
|
47
|
+
export declare function getProfile(id: string): Promise<Error | (import("mongoose").Document<unknown, {}, profile> & profile & Required<{
|
|
48
|
+
_id: unknown;
|
|
49
|
+
}> & {
|
|
50
|
+
__v: number;
|
|
51
|
+
})>;
|
|
52
|
+
export declare function getAllProfile(searchValue: string): Promise<any>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IRole } from './schemas/role.schema';
|
|
2
|
+
import mongoose from 'mongoose';
|
|
3
|
+
export { IRole };
|
|
4
|
+
export declare function createRolePermission(data: IRole): Promise<unknown>;
|
|
5
|
+
export declare function updateRolePermission(id: string, data: Partial<IRole>): Promise<any>;
|
|
6
|
+
export declare function getRole(id: string): Promise<Error | (mongoose.Document<unknown, {}, IRole> & IRole & Required<{
|
|
7
|
+
_id: unknown;
|
|
8
|
+
}> & {
|
|
9
|
+
__v: number;
|
|
10
|
+
})>;
|
|
11
|
+
export declare function deleteRolePermission(id: string): Promise<any>;
|
|
12
|
+
export declare function getRolePermission(id: string): Promise<any>;
|
|
13
|
+
export declare function getAllRolePermissions(searchValue: string, company: string, sort: string | null, skip: string | null, limit: string | null): Promise<IRole[]>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import mongoose, { Document } from "mongoose";
|
|
2
|
+
interface AccountDetails extends Document {
|
|
3
|
+
_id: mongoose.Types.ObjectId;
|
|
4
|
+
name?: string;
|
|
5
|
+
address?: string;
|
|
6
|
+
createdAt?: string;
|
|
7
|
+
updatedAt?: string;
|
|
8
|
+
deletedAt?: string;
|
|
9
|
+
city?: string;
|
|
10
|
+
pincode?: string;
|
|
11
|
+
state?: string;
|
|
12
|
+
country?: string;
|
|
13
|
+
gstin?: string;
|
|
14
|
+
openingbalance?: string;
|
|
15
|
+
billedamount?: string;
|
|
16
|
+
amountreceived?: string;
|
|
17
|
+
balancedue?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const _default: mongoose.PassportLocalModel<AccountDetails>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import mongoose, { Document } from "mongoose";
|
|
2
|
+
export interface IAccount extends Document {
|
|
3
|
+
name: string;
|
|
4
|
+
username: string;
|
|
5
|
+
moNumber: string;
|
|
6
|
+
role?: boolean;
|
|
7
|
+
userType?: string;
|
|
8
|
+
approvalType?: string;
|
|
9
|
+
avatarUrl?: string;
|
|
10
|
+
is_active?: boolean;
|
|
11
|
+
createdAt?: string;
|
|
12
|
+
updatedAt?: string;
|
|
13
|
+
deletedAt?: string;
|
|
14
|
+
company?: string;
|
|
15
|
+
permission?: string[];
|
|
16
|
+
setPassword(password: string, cb: (err: any, user: this) => void): void;
|
|
17
|
+
clientOrg?: "string";
|
|
18
|
+
}
|
|
19
|
+
declare const _default: mongoose.PassportLocalModel<IAccount>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import mongoose, { Schema } from "mongoose";
|
|
2
|
+
export interface IDocument extends Document {
|
|
3
|
+
documentId?: string;
|
|
4
|
+
status?: string;
|
|
5
|
+
created_At?: Date;
|
|
6
|
+
updated_At?: Date;
|
|
7
|
+
deleted_At?: Date;
|
|
8
|
+
file?: mongoose.Types.ObjectId;
|
|
9
|
+
values?: Object;
|
|
10
|
+
document?: string;
|
|
11
|
+
approval?: IApproval[];
|
|
12
|
+
user?: string;
|
|
13
|
+
tags?: any;
|
|
14
|
+
additionalFiles?: any;
|
|
15
|
+
}
|
|
16
|
+
export interface IApproval extends Document {
|
|
17
|
+
comment?: string;
|
|
18
|
+
status: string;
|
|
19
|
+
level: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
userId?: mongoose.Types.ObjectId;
|
|
22
|
+
createdAt: any;
|
|
23
|
+
}
|
|
24
|
+
export declare const DocumentSchema: Schema;
|
|
25
|
+
declare const _default: mongoose.PassportLocalModel<IDocument>;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import mongoose, { Document, Date } from "mongoose";
|
|
2
|
+
export interface IExtracted extends Document {
|
|
3
|
+
created_At?: Date;
|
|
4
|
+
updated_At?: Date;
|
|
5
|
+
deleted_At?: Date;
|
|
6
|
+
fileId?: string;
|
|
7
|
+
data: object;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: mongoose.PassportLocalModel<IExtracted>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import mongoose, { Document } from "mongoose";
|
|
2
|
+
interface IfileSystemSchema extends Document {
|
|
3
|
+
fileId: mongoose.Types.ObjectId;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: mongoose.Model<IfileSystemSchema, {}, {}, {}, mongoose.Document<unknown, {}, IfileSystemSchema> & IfileSystemSchema & Required<{
|
|
6
|
+
_id: unknown;
|
|
7
|
+
}> & {
|
|
8
|
+
__v: number;
|
|
9
|
+
}, any>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import mongoose, { Schema, Document } from 'mongoose';
|
|
2
|
+
export interface ILog extends Document {
|
|
3
|
+
message: string;
|
|
4
|
+
type: string;
|
|
5
|
+
logtype: string;
|
|
6
|
+
created_At: Date;
|
|
7
|
+
company?: string;
|
|
8
|
+
user?: string;
|
|
9
|
+
statuscode?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const LogSchema: Schema;
|
|
12
|
+
declare const _default: mongoose.PassportLocalModel<ILog>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import mongoose, { Document } from "mongoose";
|
|
2
|
+
export interface INotifications extends Document {
|
|
3
|
+
role?: string;
|
|
4
|
+
user?: string;
|
|
5
|
+
receiver?: string;
|
|
6
|
+
documentId?: string;
|
|
7
|
+
message: string;
|
|
8
|
+
seen?: any;
|
|
9
|
+
notificationType: string;
|
|
10
|
+
deletedAt?: any;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: mongoose.PassportLocalModel<INotifications>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { Document } from 'mongoose';
|
|
3
|
+
export interface IGSTInformation {
|
|
4
|
+
gsttreatment: string;
|
|
5
|
+
businessgst: string;
|
|
6
|
+
}
|
|
7
|
+
export type Address = {
|
|
8
|
+
billing?: {
|
|
9
|
+
street: string;
|
|
10
|
+
city: string;
|
|
11
|
+
state: string;
|
|
12
|
+
pin: string;
|
|
13
|
+
country: string;
|
|
14
|
+
phone: string;
|
|
15
|
+
};
|
|
16
|
+
shipping?: {
|
|
17
|
+
street: string;
|
|
18
|
+
city: string;
|
|
19
|
+
state: string;
|
|
20
|
+
pin: string;
|
|
21
|
+
country: string;
|
|
22
|
+
phone: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export interface IComplianceItem {
|
|
26
|
+
date: string;
|
|
27
|
+
status: string;
|
|
28
|
+
moreinfo: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ICompliance {
|
|
31
|
+
type: string;
|
|
32
|
+
file: string;
|
|
33
|
+
info: object;
|
|
34
|
+
compliant: IComplianceItem[];
|
|
35
|
+
}
|
|
36
|
+
export interface IOrganisation extends Document {
|
|
37
|
+
name: string;
|
|
38
|
+
compliances: ICompliance[];
|
|
39
|
+
domain?: string;
|
|
40
|
+
type?: string;
|
|
41
|
+
gstin: string;
|
|
42
|
+
pan?: string;
|
|
43
|
+
license: string;
|
|
44
|
+
address: Address;
|
|
45
|
+
gstinformation?: IGSTInformation[];
|
|
46
|
+
customerOrg?: string;
|
|
47
|
+
deposits?: object;
|
|
48
|
+
}
|
|
49
|
+
declare const _default: mongoose.PassportLocalModel<IOrganisation>;
|
|
50
|
+
export default _default;
|