@resolveio/server-lib 20.1.1 → 20.1.3
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/methods.ts +170 -5
- package/package.json +1 -1
- package/publications.ts +3 -0
package/methods.ts
CHANGED
|
@@ -1,34 +1,199 @@
|
|
|
1
|
+
import { PaginationOptions } from './models/pagination.model';
|
|
2
|
+
import { UserModel } from './models/user.model';
|
|
3
|
+
|
|
1
4
|
export function SERVER_METHODS(manager) {
|
|
2
5
|
return {
|
|
3
6
|
cronEmailMergedDocsCleanUp: (cb?: Function): Promise<any> => {
|
|
4
7
|
return manager.call('cronEmailMergedDocsCleanUp', cb);
|
|
5
8
|
},
|
|
9
|
+
stuckCronJob: (cb?: Function): Promise<any> => {
|
|
10
|
+
return manager.call('stuckCronJob', cb);
|
|
11
|
+
},
|
|
12
|
+
reportbuilderCronJob: (data: Object, cb?: Function): Promise<any> => {
|
|
13
|
+
return manager.call('reportbuilderCronJob', data, cb);
|
|
14
|
+
},
|
|
6
15
|
insertErrorLog: (message, data, cb?: Function): Promise<any> => {
|
|
7
16
|
return manager.call('insertErrorLog', message, data, cb);
|
|
8
17
|
},
|
|
18
|
+
insertSubscriptionLog: (type, subscription, collection_name, subData, cb?: Function): Promise<any> => {
|
|
19
|
+
return manager.call('insertSubscriptionLog', type, subscription, collection_name, subData, cb);
|
|
20
|
+
},
|
|
21
|
+
insertMethodLatencyLog: (method, cb?: Function): Promise<any> => {
|
|
22
|
+
return manager.call('insertMethodLatencyLog', method, cb);
|
|
23
|
+
},
|
|
24
|
+
superadminAPM: (date_start: Date, date_end: Date, graphInterval, cb?: Function): Promise<any> => {
|
|
25
|
+
return manager.call('superadminAPM', date_start, date_end, graphInterval, cb);
|
|
26
|
+
},
|
|
9
27
|
collectionListAll: (cb?: Function): Promise<any> => {
|
|
10
28
|
return manager.call('collectionListAll', cb);
|
|
11
29
|
},
|
|
12
|
-
|
|
30
|
+
collectionListRB: (cb?: Function): Promise<any> => {
|
|
31
|
+
return manager.call('collectionListRB', cb);
|
|
32
|
+
},
|
|
33
|
+
findOne: (collection: string, query = {}, cb?: Function): Promise<any> => {
|
|
34
|
+
return manager.call('findOne', collection, query, cb);
|
|
35
|
+
},
|
|
36
|
+
find: (collection: string, query = {}, sortQuery = {}, cb?: Function): Promise<any> => {
|
|
37
|
+
return manager.call('find', collection, query, sortQuery, cb);
|
|
38
|
+
},
|
|
39
|
+
findWithOptions: (collection: string, query: Object, options: PaginationOptions, cb?: Function): Promise<any> => {
|
|
40
|
+
return manager.call('findWithOptions', collection, query, options, cb);
|
|
41
|
+
},
|
|
42
|
+
insertDocument: (collection: string, document: Object, cb?: Function): Promise<any> => {
|
|
43
|
+
return manager.call('insertDocument', collection, document, cb);
|
|
44
|
+
},
|
|
45
|
+
insertManyDocuments: (collection: string, documents: Object[], cb?: Function): Promise<any> => {
|
|
46
|
+
return manager.call('insertManyDocuments', collection, documents, cb);
|
|
47
|
+
},
|
|
48
|
+
updateDocument: (collection: string, f_document: Object, cb?: Function): Promise<any> => {
|
|
49
|
+
return manager.call('updateDocument', collection, f_document, cb);
|
|
50
|
+
},
|
|
51
|
+
updateDocumentProps: (collection: string, doc_id: string, updateParams: any[], doc__v?: number, cb?: Function): Promise<any> => {
|
|
52
|
+
return manager.call('updateDocumentProps', collection, doc_id, updateParams, doc__v, cb);
|
|
53
|
+
},
|
|
54
|
+
updateDocumentOffline: (collection: string, f_document: Object, cb?: Function): Promise<any> => {
|
|
55
|
+
return manager.call('updateDocumentOffline', collection, f_document, cb);
|
|
56
|
+
},
|
|
57
|
+
updateDocumentPropsOffline: (collection: string, doc_id: string, updateParams: any[], doc__v: number, cb?: Function): Promise<any> => {
|
|
58
|
+
return manager.call('updateDocumentPropsOffline', collection, doc_id, updateParams, doc__v, cb);
|
|
59
|
+
},
|
|
60
|
+
removeDocument: (collection: string, doc_id: string, cb?: Function): Promise<any> => {
|
|
61
|
+
return manager.call('removeDocument', collection, doc_id, cb);
|
|
62
|
+
},
|
|
63
|
+
removeDocumentWithQuery: (collection: string, query: Object, cb?: Function): Promise<any> => {
|
|
64
|
+
return manager.call('removeDocumentWithQuery', collection, query, cb);
|
|
65
|
+
},
|
|
66
|
+
removeDocumentsWithQuery: (collection: string, query: Object, cb?: Function): Promise<any> => {
|
|
67
|
+
return manager.call('removeDocumentsWithQuery', collection, query, cb);
|
|
68
|
+
},
|
|
69
|
+
uploadFileAndSave: (fileName: string, fileData: string, fileSize: number, fileOrder: number, fileType: string, compress: Boolean, cb?: Function): Promise<any> => {
|
|
13
70
|
return manager.call('uploadFileAndSave', fileName, fileData, fileSize, fileOrder, fileType, compress, cb);
|
|
14
71
|
},
|
|
72
|
+
uploadNonPDFFileAndSave: (fileName: string, fileData: string, fileSize: number, fileOrder: number, fileType: string, cb?: Function): Promise<any> => {
|
|
73
|
+
return manager.call('uploadNonPDFFileAndSave', fileName, fileData, fileSize, fileOrder, fileType, cb);
|
|
74
|
+
},
|
|
75
|
+
uploadNonPDFBufferAndSave: (fileName: string, fileData: Buffer, fileSize: number, fileOrder: number, fileType: string, cb?: Function): Promise<any> => {
|
|
76
|
+
return manager.call('uploadNonPDFBufferAndSave', fileName, fileData, fileSize, fileOrder, fileType, cb);
|
|
77
|
+
},
|
|
78
|
+
uploadNonPDFStreamAndSave: (fileName: string, fileData: string, fileOrder: number, fileType: string, cb?: Function): Promise<any> => {
|
|
79
|
+
return manager.call('uploadNonPDFStreamAndSave', fileName, fileData, fileOrder, fileType, cb);
|
|
80
|
+
},
|
|
81
|
+
deleteFiles: (keys: string[], cb?: Function): Promise<any> => {
|
|
82
|
+
return manager.call('deleteFiles', keys, cb);
|
|
83
|
+
},
|
|
84
|
+
deleteFile: (key: string, cb?: Function): Promise<any> => {
|
|
85
|
+
return manager.call('deleteFile', key, cb);
|
|
86
|
+
},
|
|
87
|
+
deleteFileWithId: (id_file: string, cb?: Function): Promise<any> => {
|
|
88
|
+
return manager.call('deleteFileWithId', id_file, cb);
|
|
89
|
+
},
|
|
90
|
+
getSignedUrlsAndFilesWithId: (ids: string[], expires: number, cb?: Function): Promise<any> => {
|
|
91
|
+
return manager.call('getSignedUrlsAndFilesWithId', ids, expires, cb);
|
|
92
|
+
},
|
|
93
|
+
getSignedUrlWithId: (id_file: string, expires: number, cb?: Function): Promise<any> => {
|
|
94
|
+
return manager.call('getSignedUrlWithId', id_file, expires, cb);
|
|
95
|
+
},
|
|
96
|
+
getSignedUrlUSEast1BucketAndKey: (bucket: string, key: string, expires: number, cb?: Function): Promise<any> => {
|
|
97
|
+
return manager.call('getSignedUrlUSEast1BucketAndKey', bucket, key, expires, cb);
|
|
98
|
+
},
|
|
99
|
+
getSignedUrl: (key: string, expires: number, cb?: Function): Promise<any> => {
|
|
100
|
+
return manager.call('getSignedUrl', key, expires, cb);
|
|
101
|
+
},
|
|
102
|
+
getSignedUrls: (keys: string[], expires: number, cb?: Function): Promise<any> => {
|
|
103
|
+
return manager.call('getSignedUrls', keys, expires, cb);
|
|
104
|
+
},
|
|
105
|
+
getDataURIfromURL: (url: string, cb?: Function): Promise<any> => {
|
|
106
|
+
return manager.call('getDataURIfromURL', url, cb);
|
|
107
|
+
},
|
|
108
|
+
emailFile: (id_file: string, email: string, additional_message, cb?: Function): Promise<any> => {
|
|
109
|
+
return manager.call('emailFile', id_file, email, additional_message, cb);
|
|
110
|
+
},
|
|
15
111
|
generatePDF: (html, fileName, orientation = 'portrait', fontSize = '12px', upload = false, uploadFileOrder = -1, uploadFileType = '', cb?: Function): Promise<any> => {
|
|
16
|
-
return manager.call('generatePDF', html, fileName, orientation
|
|
112
|
+
return manager.call('generatePDF', html, fileName, orientation, fontSize, upload, uploadFileOrder, uploadFileType, cb);
|
|
113
|
+
},
|
|
114
|
+
generatePDFNoPageNumber: (html, fileName, orientation = 'portrait', fontSize = '12px', upload = false, uploadFileOrder = -1, uploadFileType = '', cb?: Function): Promise<any> => {
|
|
115
|
+
return manager.call('generatePDFNoPageNumber', html, fileName, orientation, fontSize, upload, uploadFileOrder, uploadFileType, cb);
|
|
116
|
+
},
|
|
117
|
+
mergePDFResolve: (fileKeys: string[], fileName: string, fileType?: string, cb?: Function): Promise<any> => {
|
|
118
|
+
return manager.call('mergePDFResolve', fileKeys, fileName, fileType, cb);
|
|
119
|
+
},
|
|
120
|
+
mergePDFResolveNoSave: (fileKeys: string[], cb?: Function): Promise<any> => {
|
|
121
|
+
return manager.call('mergePDFResolveNoSave', fileKeys, cb);
|
|
122
|
+
},
|
|
123
|
+
mergePDFResolveHtml: (htmls: string[], fileName: string, fileType?: string, save = true, cb?: Function): Promise<any> => {
|
|
124
|
+
return manager.call('mergePDFResolveHtml', htmls, fileName, fileType, save, cb);
|
|
17
125
|
},
|
|
18
126
|
incorrectUser: (old_user, new_user, client_subs, cb?: Function): Promise<any> => {
|
|
19
127
|
return manager.call('incorrectUser', old_user, new_user, client_subs, cb);
|
|
20
128
|
},
|
|
21
|
-
|
|
129
|
+
reloadWS: (id_ws, cb?: Function): Promise<any> => {
|
|
130
|
+
return manager.call('reloadWS', id_ws, cb);
|
|
131
|
+
},
|
|
132
|
+
reconnectWS: (id_ws, cb?: Function): Promise<any> => {
|
|
133
|
+
return manager.call('reconnectWS', id_ws, cb);
|
|
134
|
+
},
|
|
135
|
+
disconnectWS: (id_ws, cb?: Function): Promise<any> => {
|
|
136
|
+
return manager.call('disconnectWS', id_ws, cb);
|
|
137
|
+
},
|
|
138
|
+
createUserAndEmailEnrollment: (newUser: UserModel, sendEnrollmentEmail = true, cb?: Function): Promise<any> => {
|
|
139
|
+
return manager.call('createUserAndEmailEnrollment', newUser, sendEnrollmentEmail, cb);
|
|
140
|
+
},
|
|
141
|
+
resetUserPassword: (userId: string, cb?: Function): Promise<any> => {
|
|
142
|
+
return manager.call('resetUserPassword', userId, cb);
|
|
143
|
+
},
|
|
144
|
+
setUserPassword: (userId: string, password: string, cb?: Function): Promise<any> => {
|
|
145
|
+
return manager.call('setUserPassword', userId, password, cb);
|
|
146
|
+
},
|
|
147
|
+
superadminMonitorGraphData: (date_start: Date, date_end: Date, collection: string, instance: string, client: string, graphInterval: string, variable: string, variableType: string, cb?: Function): Promise<any> => {
|
|
22
148
|
return manager.call('superadminMonitorGraphData', date_start, date_end, collection, instance, client, graphInterval, variable, variableType, cb);
|
|
23
149
|
},
|
|
150
|
+
superadminMonitorTableData: (date_start: Date, date_end: Date, collection: string, instance: string, client: string, graphInterval: string, variable: string, variableType: string, cb?: Function): Promise<any> => {
|
|
151
|
+
return manager.call('superadminMonitorTableData', date_start, date_end, collection, instance, client, graphInterval, variable, variableType, cb);
|
|
152
|
+
},
|
|
153
|
+
monitorMongos: (cb?: Function): Promise<any> => {
|
|
154
|
+
return manager.call('monitorMongos', cb);
|
|
155
|
+
},
|
|
156
|
+
monitorCPUs: (cb?: Function): Promise<any> => {
|
|
157
|
+
return manager.call('monitorCPUs', cb);
|
|
158
|
+
},
|
|
159
|
+
monitorMemorys: (cb?: Function): Promise<any> => {
|
|
160
|
+
return manager.call('monitorMemorys', cb);
|
|
161
|
+
},
|
|
24
162
|
supportCreateBillingUser: (user, cb?: Function): Promise<any> => {
|
|
25
163
|
return manager.call('supportCreateBillingUser', user, cb);
|
|
26
164
|
},
|
|
27
|
-
|
|
165
|
+
supportGetSupportTicketWithId: (id_support_ticket, cb?: Function): Promise<any> => {
|
|
166
|
+
return manager.call('supportGetSupportTicketWithId', id_support_ticket, cb);
|
|
167
|
+
},
|
|
168
|
+
supportInsertSupportTicket: (supportTicket, cb?: Function): Promise<any> => {
|
|
169
|
+
return manager.call('supportInsertSupportTicket', supportTicket, cb);
|
|
170
|
+
},
|
|
171
|
+
supportUpdateSupportTicket: (supportTicket, cb?: Function): Promise<any> => {
|
|
172
|
+
return manager.call('supportUpdateSupportTicket', supportTicket, cb);
|
|
173
|
+
},
|
|
174
|
+
supportticketsWithOptions: (options, searchString, filters, cb?: Function): Promise<any> => {
|
|
175
|
+
return manager.call('supportticketsWithOptions', options, searchString, filters, cb);
|
|
176
|
+
},
|
|
177
|
+
supportticketCount: (searchString, filters, cb?: Function): Promise<any> => {
|
|
178
|
+
return manager.call('supportticketCount', searchString, filters, cb);
|
|
179
|
+
},
|
|
180
|
+
reportBuilderBuildTree: (collection_root: string, cb?: Function): Promise<any> => {
|
|
28
181
|
return manager.call('reportBuilderBuildTree', collection_root, cb);
|
|
29
182
|
},
|
|
30
|
-
|
|
183
|
+
reportBuilderGetDistinctValue: (treeLeaf, cb?: Function): Promise<any> => {
|
|
184
|
+
return manager.call('reportBuilderGetDistinctValue', treeLeaf, cb);
|
|
185
|
+
},
|
|
186
|
+
reportBuilderGetResults: (reportType: string, rootCollectionName: string, rootOptions: PaginationOptions, filters: any[] = [], filterArrays: any[] = [], filterArrayFields: any[] = [], selectedFields: any[] = [], customFields: any[] = [], groupsRow: any[] = [], fieldsTotal: any[] = [], fieldsLink: any[] = [], date_field = '', date_interval = '', displayType = '', cb?: Function): Promise<any> => {
|
|
187
|
+
return manager.call('reportBuilderGetResults', reportType, rootCollectionName, rootOptions, filters, filterArrays, filterArrayFields, selectedFields, customFields, groupsRow, fieldsTotal, fieldsLink, date_field, date_interval, displayType, cb);
|
|
188
|
+
},
|
|
189
|
+
incCounter: (counterType: string, cb?: Function): Promise<any> => {
|
|
31
190
|
return manager.call('incCounter', counterType, cb);
|
|
32
191
|
},
|
|
192
|
+
countCollectionWithQuery: (collectionType: string, query: Object, cb?: Function): Promise<any> => {
|
|
193
|
+
return manager.call('countCollectionWithQuery', collectionType, query, cb);
|
|
194
|
+
},
|
|
195
|
+
countCollection: (collectionType: string, cb?: Function): Promise<any> => {
|
|
196
|
+
return manager.call('countCollection', collectionType, cb);
|
|
197
|
+
},
|
|
33
198
|
};
|
|
34
199
|
}
|
package/package.json
CHANGED
package/publications.ts
CHANGED
|
@@ -15,6 +15,9 @@ export function SERVER_PUBLICATIONS(manager) {
|
|
|
15
15
|
reportbuilderreports: (cb?: Function): Promise<any> => {
|
|
16
16
|
return manager.subscribe('reportbuilderreports', cb);
|
|
17
17
|
},
|
|
18
|
+
methodlatencies: (cb?: Function): Promise<any> => {
|
|
19
|
+
return manager.subscribe('methodlatencies', cb);
|
|
20
|
+
},
|
|
18
21
|
userGuides: (cb?: Function): Promise<any> => {
|
|
19
22
|
return manager.subscribe('userGuides', cb);
|
|
20
23
|
},
|