index.d.ts
3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
import {FilterQuery,UpdateQuery,FindAndModifyWriteOpResultObject,OptionalId,ClientSession,DeleteWriteOpResultObject,UpdateWriteOpResult} from 'mongodb'
import {AxiosPromise,AxiosRequestConfig} from 'axios'
export class Utils {
/**
* @description Testasdfasdfasdf
* @param {String} str
* @returns {String}
*/
static printf(str) { }
}
export const ENV = {
DB_URL : "",
DB_NAME : "",
DB_PORT : "",
DB_USERNAME : "",
DB_PASSWORD : ""
}
export const ConnectMongo ={
initial = async function():void{},
getDB = function():InterfaceDBAction{}
};
export const AppApi = {
initial : Function(),
addPostMethod : async function(uri:string,processor:Processor):void{} ,
addGetMethod : async function(uri:string,processor:Processor):void{} ,
startApp : function():void{}
};
export class Network {
/**
*
* @param {String} url
* @param {*} params
* @param {AxiosRequestConfig} config
*/
static async requestPost(url, params = {}, config = {}):JSON {}
/**
*
* @param {String} urlWithParams
* @param {AxiosRequestConfig} config
*/
static async requestGet(urlWithParams, config = {}):JSON {}
}
/***
*
*
* External class
*/
class ServiceData{
body:JSON;
headers:JSON;
}
class Processor {
process(sv:ServiceData) :JSON {}
}
class InterfaceDBAction {
/**
* Select * From
* @param {String} collectionName
* @param {*} queryCondition
* @param {Object} filter
* @returns {Promise<Array>}
*/
async find(collectionName, queryCondition = {}, filter = {}) {
}
/**
* Select * From Where Only One Data
* @param {String} collectionName
* @param {*} queryCondition
*/
async findOne(collectionName, queryCondition = {}) {
}
/**
* Insert One Data
* @param {String} collectionName
* @param {OptionalId<Object>} data
* @param {ClientSession} session
*/
async insertOne(collectionName, data = {} , session = undefined) {}
/**
* Update Data
* @param {String} collectionName
* @param {FilterQuery<Object>} queryCondition
* @param {*} updateValue
* @param {ClientSession} session
* @return {UpdateWriteOpResult}
*/
async updateOne(collectionName, queryCondition = {}, updateValue = {}, session = undefined) {}
/**
* Update Many Data
* @param {String} collectionName
* @param {*} queryCondition
* @param {*} updateValue
* @param {ClientSession} session
*/
async updateMany(collectionName, queryCondition = {}, updateValue = {} ,session = undefined) {}
/**
* Delete From
* @param {String} collectionName
* @param {*} queryCondition
* @param {ClientSession} session
*
* @return {DeleteWriteOpResultObject}
*/
async deleteMany(collectionName, queryCondition,session = undefined) {}
/**
* @description Find a document and update it in one atomic operation. Requires a write lock for the duration of the operation.
* http://mongodb.github.io/node-mongodb-native/3.3/api/Collection.html#findOneAndUpdate
* @param {String} collectionName
* @param {FilterQuery<Object>} queryCondition
* @param {UpdateQuery<Object>} updateValue
*
* @returns {FindAndModifyWriteOpResultObject<Object>}
*/
async findOneAndUpdate(collectionName, queryCondition = {}, updateValue = {}) {}
/**
* @description https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline
* @param {String} collectionName
* @param {Object[]} pipeline
*/
async aggregate(collectionName, pipeline = {}) {}
/**
* @returns {ClientSession}
*/
async CreateSession (){}
}