mobioffice-cli 0.0.1
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/.prettierrc +4 -0
- package/README.md +1 -0
- package/a.js +3 -0
- package/lib/index.js +87 -0
- package/package.json +50 -0
- package/scripts/1.ts +1300 -0
- package/scripts/GCloudPubSub/pub-sub-config.json +12 -0
- package/scripts/GCloudPubSub/visitorAutoRejection.ts +86 -0
- package/scripts/actions/assignUsersFromOneActionToOther.ts +64 -0
- package/scripts/actions/assignUsersListToAction.ts +81 -0
- package/scripts/actions/getActionsListOfUser.ts +42 -0
- package/scripts/actions/getCompanyUserDetails.ts +49 -0
- package/scripts/actions/giveActionToUser.ts +41 -0
- package/scripts/actions/giveUsersToActivitySelector.ts +56 -0
- package/scripts/actions/groupActionsInActivitySelector.ts +101 -0
- package/scripts/actions/modifySummaryReportDB.ts +42 -0
- package/scripts/actions/setUrlToActionStep.ts +18 -0
- package/scripts/actions/syncMySqlAttendanceDBWithFirebase.ts +93 -0
- package/scripts/actions/syncMySqlMeetingsDBWithFirebase.ts +103 -0
- package/scripts/actions/test.ts +29 -0
- package/scripts/actions/transferFeedsOldIdToNew.ts +40 -0
- package/scripts/actions/transformUserIntoManager.ts +89 -0
- package/scripts/argvConfig.js +9 -0
- package/scripts/backUpData/testCode.ts +131 -0
- package/scripts/benaraScripts/addWorkAreaMap.ts +46 -0
- package/scripts/benaraScripts/add_customers.ts +26 -0
- package/scripts/benaraScripts/add_customers_contact.ts +27 -0
- package/scripts/benaraScripts/add_empty_work_area.ts +17 -0
- package/scripts/benaraScripts/assignManagers.ts +35 -0
- package/scripts/benaraScripts/changeCheckInFlag.ts +45 -0
- package/scripts/benaraScripts/createCustomerContactsList.ts +170 -0
- package/scripts/benaraScripts/createUserByDeletingOldUser.ts +70 -0
- package/scripts/benaraScripts/createUsersAreaMapCollection.ts +23 -0
- package/scripts/benaraScripts/createWorkAreaMap.ts +24 -0
- package/scripts/benaraScripts/mapWorkAreasToUsers.ts +112 -0
- package/scripts/companies_data.json +2496 -0
- package/scripts/create_or_update_users.ts +31 -0
- package/scripts/csvToJson/csvToJson.ts +90 -0
- package/scripts/csvToJson/users.json +3896 -0
- package/scripts/db.js +27 -0
- package/scripts/db.json +13 -0
- package/scripts/dbMySql.ts +63 -0
- package/scripts/delete_action_steps.ts +11 -0
- package/scripts/delete_user.ts +71 -0
- package/scripts/dev_companies_data.json +613 -0
- package/scripts/enroll.xlsx +0 -0
- package/scripts/export_users.ts +72 -0
- package/scripts/files/visitorManagementFiles/displayScreen.json +70 -0
- package/scripts/files/visitorManagementFiles/init_report_visibility.ts +79 -0
- package/scripts/firebaseConfig.js +12 -0
- package/scripts/firebaseDocs/deleteIncommingCollection.ts +47 -0
- package/scripts/firebaseDocs/updateDoc.ts +43 -0
- package/scripts/getActionDataIntoJSON/getActionData.ts +68 -0
- package/scripts/get_attendance_by_any_date.ts +14 -0
- package/scripts/get_attendance_by_month.ts +12 -0
- package/scripts/get_attendance_monthly_by_team.ts +11 -0
- package/scripts/get_daily_report.ts +10 -0
- package/scripts/get_mangers.ts +13 -0
- package/scripts/grant_user_license.ts +18 -0
- package/scripts/init_CustomCollection.ts +16 -0
- package/scripts/init_action_steps.ts +28 -0
- package/scripts/init_actions.ts +31 -0
- package/scripts/init_company.ts +18 -0
- package/scripts/init_customer_mysql.ts +12 -0
- package/scripts/init_feed.ts +4 -0
- package/scripts/init_feed_details_screen.ts +14 -0
- package/scripts/init_geofence.ts +26 -0
- package/scripts/init_print_details_screen.ts +14 -0
- package/scripts/init_report_actions.ts +24 -0
- package/scripts/init_report_definition_detail.ts +26 -0
- package/scripts/init_report_definition_summary.ts +16 -0
- package/scripts/init_report_visibility.ts +46 -0
- package/scripts/init_user_customcollection.ts +16 -0
- package/scripts/json/action.json +21 -0
- package/scripts/json/company.json +24 -0
- package/scripts/json/report-action.json +13 -0
- package/scripts/json/report-def-deet.json +43 -0
- package/scripts/json/resp.json +784 -0
- package/scripts/json/steps.json +24 -0
- package/scripts/json/test.ts +49 -0
- package/scripts/mysqlConfig.ts +9 -0
- package/scripts/revoke_or_extend_license.ts +14 -0
- package/scripts/stream.js +4 -0
- package/scripts/testing1.ts +35 -0
- package/scripts/update/doc.json +20 -0
- package/scripts/update/getDocByPath.ts +34 -0
- package/scripts/update/updateDocByPath.ts +47 -0
- package/scripts/update/updateUsersOfCompanies.ts +58 -0
- package/scripts/update_actions.ts +19 -0
- package/scripts/update_actions_steps.ts +19 -0
- package/scripts/update_company.ts +19 -0
- package/scripts/update_geofence.ts +20 -0
- package/scripts/update_managers.ts +16 -0
- package/scripts/visitorMgmt/createArea.ts +68 -0
- package/scripts/visitorMgmt/createArea.txt +3 -0
- package/scripts/visitorMgmt/createVisitorPathInstructionDocs.ts +130 -0
- package/scripts/visitorMgmt/createVisitorPathInstructionDocs.txt +18 -0
- package/scripts/visitorMgmt/encryptDateString.ts +71 -0
- package/scripts/visitorMgmt/makeHostsManagersOfEachOther.ts +117 -0
- package/scripts/whatsapp_gupshup/sendMessage.ts +97 -0
- package/src/index.ts +87 -0
- package/src/models/Feed-Details-Screen.model.ts +29 -0
- package/src/models/action.model.ts +355 -0
- package/src/models/actions/doffing.ts +71 -0
- package/src/models/actions/folding.ts +39 -0
- package/src/models/attendance.model.ts +615 -0
- package/src/models/cicoPost.model.ts +20 -0
- package/src/models/company.model.ts +975 -0
- package/src/models/contact-us/resquest.model.ts +87 -0
- package/src/models/crud/crud.ts +30 -0
- package/src/models/customCollection.model.ts +47 -0
- package/src/models/customer/customer.model.ts +85 -0
- package/src/models/deviceChangeReq.ts +150 -0
- package/src/models/dispatch.model.ts +99 -0
- package/src/models/feed.models.ts +104 -0
- package/src/models/geofence.model.ts +61 -0
- package/src/models/leaveApplicationPost.model.ts +79 -0
- package/src/models/license.model.ts +215 -0
- package/src/models/log.model.ts +25 -0
- package/src/models/meeting.model.ts +80 -0
- package/src/models/meter.model.ts +62 -0
- package/src/models/missingPunchPost.model.ts +84 -0
- package/src/models/offline.model.ts +1133 -0
- package/src/models/post.model.ts +105 -0
- package/src/models/printDetailsScreen.model.ts +30 -0
- package/src/models/pushNotifications/pushNotification.model.ts +17 -0
- package/src/models/report-actions.model.ts +57 -0
- package/src/models/report-definition-details.model.ts +89 -0
- package/src/models/report-definition.model.ts +26 -0
- package/src/models/report-definitions-summary.model.ts +59 -0
- package/src/models/report-detail-data.model.ts +49 -0
- package/src/models/report-visibility.model.ts +44 -0
- package/src/models/report.model.ts +179 -0
- package/src/models/reportGenerator.model.ts +883 -0
- package/src/models/response.model.ts +31 -0
- package/src/models/steps.factory.model.ts +195 -0
- package/src/models/storeGupShupLog.model.ts +49 -0
- package/src/models/summary.model.ts +63 -0
- package/src/models/tasks/sub-task-group.model.ts +173 -0
- package/src/models/tasks/tags.model.ts +113 -0
- package/src/models/tasks/task-group.model.ts +172 -0
- package/src/models/tasks/task.model.ts +681 -0
- package/src/models/tempCollection.model.ts +398 -0
- package/src/models/user.model.ts +319 -0
- package/src/models/utility.model.ts +100 -0
- package/src/models/visitorManagement/acknowledgement.model.ts +71 -0
- package/src/models/visitorManagement/invite.model.ts +406 -0
- package/src/models/visitorManagement/newIn.model.ts +82 -0
- package/src/models/visitorManagement/selfServe.model.ts +58 -0
- package/src/models/worklogPost.model.ts +8 -0
- package/src/services/customer.ts +382 -0
- package/src/services/meeting.ts +123 -0
- package/test/1.ts +13 -0
- package/test/db.js +19 -0
- package/test/firebaseConfig.js +1 -0
- package/tsconfig.json +16 -0
@@ -0,0 +1,71 @@
|
|
1
|
+
import { createCipheriv, createDecipheriv, randomBytes } from 'crypto';
|
2
|
+
import { Utilities } from '../../src/models/utility.model';
|
3
|
+
import { createInterface } from 'readline';
|
4
|
+
|
5
|
+
const readLineInterface = createInterface({
|
6
|
+
input: process.stdin,
|
7
|
+
output: process.stdout
|
8
|
+
})
|
9
|
+
|
10
|
+
const readLine = Utilities.readLineAsync;
|
11
|
+
const readLineClose = Utilities.readLineClose;
|
12
|
+
|
13
|
+
async function encryptAString(secretText: string) {
|
14
|
+
try {
|
15
|
+
// Encryption
|
16
|
+
const algorithm = 'aes-256-cbc';
|
17
|
+
const key = "wearethebestoneswearethebestones"; // Replace with your secret key
|
18
|
+
// const iv = randomBytes(16); // Initialization Vector
|
19
|
+
const iv = "wearethebestones"; // Initialization Vector
|
20
|
+
|
21
|
+
const cipher = createCipheriv(algorithm, key, iv);
|
22
|
+
let encryptedString = cipher.update(secretText, 'utf8', 'hex');
|
23
|
+
encryptedString += cipher.final('hex');
|
24
|
+
return {
|
25
|
+
encryptedString,
|
26
|
+
key,
|
27
|
+
iv
|
28
|
+
};
|
29
|
+
} catch(error) {
|
30
|
+
console.log(error.message);
|
31
|
+
throw {
|
32
|
+
message: error.message
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
async function decryptEncryptedStr(encryptedString: string, key, iv) {
|
38
|
+
try {
|
39
|
+
const algorithm = 'aes-256-cbc';
|
40
|
+
// Decryption
|
41
|
+
const decipher = createDecipheriv(algorithm, key, iv);
|
42
|
+
let decryptedString = decipher.update(encryptedString, 'hex', 'utf8');
|
43
|
+
decryptedString += decipher.final('utf8');
|
44
|
+
return decryptedString;
|
45
|
+
} catch(error) {
|
46
|
+
console.log(error.message);
|
47
|
+
throw {
|
48
|
+
message: error.message
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
async function main() {
|
54
|
+
try {
|
55
|
+
const secretText: any = await readLine("Provide secret text: ", readLineInterface);
|
56
|
+
const encryptionPayload = await encryptAString(secretText);
|
57
|
+
const encStr = encryptionPayload.encryptedString;
|
58
|
+
const key = encryptionPayload.key;
|
59
|
+
const iv = encryptionPayload.iv;
|
60
|
+
console.log("Encrypted String:", encStr);
|
61
|
+
const decryptedString = await decryptEncryptedStr(encStr, key, iv);
|
62
|
+
console.log("Decrypted String:", decryptedString);
|
63
|
+
console.log(JSON.parse(decryptedString));
|
64
|
+
readLineClose(readLineInterface);
|
65
|
+
} catch(error) {
|
66
|
+
console.log(error.message)
|
67
|
+
readLineClose(readLineInterface);
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
main();
|
@@ -0,0 +1,117 @@
|
|
1
|
+
import admin from "../db";
|
2
|
+
import { Utilities } from "../../src/models/utility.model";
|
3
|
+
import { createInterface } from "readline";
|
4
|
+
import { Company } from "../../src/models/company.model";
|
5
|
+
import { report } from "process";
|
6
|
+
|
7
|
+
const readLine = Utilities.readLineAsync;
|
8
|
+
const readLineClose = Utilities.readLineClose;
|
9
|
+
|
10
|
+
const readLineInterface = createInterface({
|
11
|
+
input: process.stdin,
|
12
|
+
output: process.stdout
|
13
|
+
})
|
14
|
+
|
15
|
+
async function makeHostsManagersOfEachOther() {
|
16
|
+
try {
|
17
|
+
const firestore = admin.firestore();
|
18
|
+
const companyNickname: any = await readLine("Enter company Nick name: ", readLineInterface);
|
19
|
+
const companyId = await Company.getCompanyIdByNickName(firestore, companyNickname);
|
20
|
+
console.log("Found companyId: ", companyId)
|
21
|
+
const usersList = await firestore.collection("Companies")
|
22
|
+
.doc(companyId)
|
23
|
+
.collection("Users")
|
24
|
+
.get();
|
25
|
+
const hosts: any = [];
|
26
|
+
const others: any = [];
|
27
|
+
usersList.docs.forEach((doc) => {
|
28
|
+
const roles = doc.data().roles;
|
29
|
+
if (roles.includes("host")) {
|
30
|
+
hosts.push(doc.data())
|
31
|
+
} else {
|
32
|
+
others.push(doc.data())
|
33
|
+
}
|
34
|
+
})
|
35
|
+
// console.log("others", others);
|
36
|
+
const reportingToInfo = hosts.map((hostInfo) => {
|
37
|
+
return {
|
38
|
+
name: hostInfo.name,
|
39
|
+
id: hostInfo.id
|
40
|
+
}
|
41
|
+
})
|
42
|
+
const reportingToIds: any[] = []
|
43
|
+
const reportingToNames: any[] = []
|
44
|
+
reportingToInfo.forEach((obj) => {
|
45
|
+
if (obj.name !== "Samyak Jain") {
|
46
|
+
reportingToIds.push(obj.id);
|
47
|
+
reportingToNames.push(obj.name);
|
48
|
+
}
|
49
|
+
})
|
50
|
+
console.log(reportingToIds);
|
51
|
+
console.log(reportingToNames);
|
52
|
+
const exceptions = ["Meet Patel", "Harmi"];
|
53
|
+
const usersToUpdate: any[] = [];
|
54
|
+
others.forEach((obj) => {
|
55
|
+
if (!exceptions.includes(obj.name)) {
|
56
|
+
usersToUpdate.push({
|
57
|
+
name: obj.name,
|
58
|
+
id: obj.id
|
59
|
+
});
|
60
|
+
}
|
61
|
+
})
|
62
|
+
await Promise.all(usersToUpdate.map(async (user) => {
|
63
|
+
const userFirebaseDoc = await firestore.collection("Companies")
|
64
|
+
.doc(companyId)
|
65
|
+
.collection("Users")
|
66
|
+
.doc(user.id)
|
67
|
+
.get();
|
68
|
+
let updatedUserInfo: any = userFirebaseDoc.data();
|
69
|
+
updatedUserInfo.reportingTo = reportingToIds;
|
70
|
+
updatedUserInfo.managers = reportingToNames;
|
71
|
+
userFirebaseDoc.ref.set(updatedUserInfo);
|
72
|
+
}))
|
73
|
+
console.log(usersToUpdate);
|
74
|
+
// others.forEach(())
|
75
|
+
// const hostManagerMap = {};
|
76
|
+
// console.log(reportingToInfo);
|
77
|
+
// reportingToInfo.forEach((hostInfo) => {
|
78
|
+
// const reportingToIdArrOfCurrHost: any = [];
|
79
|
+
// const reportingToNameArr: any = [];
|
80
|
+
// reportingToInfo.forEach((obj) => {
|
81
|
+
// if (hostInfo.id !== obj.id && obj.name !== 'Samyak Jain') {
|
82
|
+
// reportingToIdArrOfCurrHost.push(obj.id)
|
83
|
+
// reportingToNameArr.push(obj.name);
|
84
|
+
// }
|
85
|
+
// })
|
86
|
+
// hostManagerMap[hostInfo.id] = {
|
87
|
+
// reportingTo: reportingToIdArrOfCurrHost,
|
88
|
+
// managers: reportingToNameArr
|
89
|
+
// }
|
90
|
+
// })
|
91
|
+
// console.log(hostManagerMap);
|
92
|
+
// await Promise.all(hosts.map((async (hostInfo) => {
|
93
|
+
// const hostFirebaseDoc = await firestore.collection("Companies")
|
94
|
+
// .doc(companyId)
|
95
|
+
// .collection("Users")
|
96
|
+
// .doc(hostInfo.id)
|
97
|
+
// .get();
|
98
|
+
// const updatedHostDoc: any = hostFirebaseDoc.data();
|
99
|
+
// if (updatedHostDoc.name !== "Samyak Jain") {
|
100
|
+
// updatedHostDoc.reportingTo = hostManagerMap[updatedHostDoc.id].reportingTo;
|
101
|
+
// updatedHostDoc.managers = hostManagerMap[updatedHostDoc.id].managers;
|
102
|
+
// console.log(updatedHostDoc);
|
103
|
+
// // await hostFirebaseDoc.ref.set(updatedHostDoc);
|
104
|
+
// }
|
105
|
+
// })))
|
106
|
+
readLineClose(readLineInterface);
|
107
|
+
} catch(error) {
|
108
|
+
console.log(error);
|
109
|
+
readLineClose(readLineInterface);
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
async function main() {
|
114
|
+
await makeHostsManagersOfEachOther();
|
115
|
+
}
|
116
|
+
|
117
|
+
main();
|
@@ -0,0 +1,97 @@
|
|
1
|
+
import fetchNpmNode from "isomorphic-fetch";
|
2
|
+
import { Utilities } from "../../src/models/utility.model";
|
3
|
+
import { createInterface } from "readline";
|
4
|
+
const readLineAsync = Utilities.readLineAsync;
|
5
|
+
const readLineClose = Utilities.readLineClose;
|
6
|
+
const readLineInterface = createInterface({
|
7
|
+
input: process.stdin,
|
8
|
+
output: process.stdout
|
9
|
+
});
|
10
|
+
const companyName = "Mobioffice";
|
11
|
+
|
12
|
+
async function sendMessage() {
|
13
|
+
try {
|
14
|
+
const phoneNumberListStr: any = await readLineAsync("Please provide comma separated 10 digit phone numbers: ", readLineInterface);
|
15
|
+
const phoneNumbers = phoneNumberListStr.split(",").map((phnNum) => {
|
16
|
+
return phnNum.trim();
|
17
|
+
});
|
18
|
+
const areNumbersValid = phoneNumbers.every((phone) => phone.length == 10);
|
19
|
+
if (!areNumbersValid) {
|
20
|
+
throw {
|
21
|
+
message: "Some of the phone numbers are not of 10 digits"
|
22
|
+
}
|
23
|
+
}
|
24
|
+
const templateId: any = await readLineAsync("Please enter the template Name: ", readLineInterface);
|
25
|
+
console.log(phoneNumbers);
|
26
|
+
let dataString = template_dataString_map[templateId].dataString;
|
27
|
+
if (!dataString) {
|
28
|
+
throw {
|
29
|
+
message: "templateId you provided is not invalid"
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
const result = await Promise.all(phoneNumbers.map(async (destinationNumber, idx ) => {
|
34
|
+
const dataStringToSend = dataString.replace("__destinationNumber__", destinationNumber);
|
35
|
+
console.log(dataStringToSend);
|
36
|
+
const resp1: any = await fetchNpmNode(gupshup_Whatsapp_gate.api_url, {
|
37
|
+
method: "POST",
|
38
|
+
body: dataStringToSend,
|
39
|
+
headers: {
|
40
|
+
apikey: gupshup_Whatsapp_gate.api_key,
|
41
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
42
|
+
},
|
43
|
+
});
|
44
|
+
return {
|
45
|
+
response1: resp1
|
46
|
+
}
|
47
|
+
}))
|
48
|
+
console.log("-----------result---------", result);
|
49
|
+
} catch(error) {
|
50
|
+
console.log("Error:", error.message);
|
51
|
+
} finally {
|
52
|
+
readLineClose(readLineInterface);
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
sendMessage();
|
57
|
+
|
58
|
+
const gupshup_Whatsapp_host = {
|
59
|
+
api_key: "anqheagsugk5ilfmeyuzuv4k0p5f0xsi",
|
60
|
+
api_url: "https://api.gupshup.io/sm/api/v1/template/msg",
|
61
|
+
channel: "whatsapp",
|
62
|
+
source: "919925039603",
|
63
|
+
templateId_host_instructions: "89f46092-28fe-4ddf-8a11-b5da8c34e89e",
|
64
|
+
}
|
65
|
+
|
66
|
+
const gupshup_Whatsapp_gate = {
|
67
|
+
api_key: "anqheagsugk5ilfmeyuzuv4k0p5f0xsi",
|
68
|
+
api_url: "https://api.gupshup.io/sm/api/v1/template/msg",
|
69
|
+
channel: "whatsapp",
|
70
|
+
source: "919925039603",
|
71
|
+
templateId_atGate_instructions: "37dbb2e4-d7cb-4df1-86f3-35fc6ceafaf4",
|
72
|
+
}
|
73
|
+
|
74
|
+
const template_dataString_map = {
|
75
|
+
"89f46092-28fe-4ddf-8a11-b5da8c34e89e": {
|
76
|
+
requirementMsgs: ["Please provide comma separated 10 digit phone numbers: ", "Please provide visitor name", "Please provide area name", "Please provide"],
|
77
|
+
dataString: `'channel=${gupshup_Whatsapp_gate.channel}&source=${gupshup_Whatsapp_gate.source}&destination=__destinationNumber__&src.name=mymobioffice&template=%7B%22id%22:%22${gupshup_Whatsapp_gate.templateId_atGate_instructions}%22,%22params%22:%5B%22${companyName}%22,%22__visitorName__%22,%22__hostName__%22,%22__areaName__%22%5D%7D'`,
|
78
|
+
},
|
79
|
+
"37dbb2e4-d7cb-4df1-86f3-35fc6ceafaf4": {
|
80
|
+
requirementMsgs: ["Please provide comma separated 10 digit phone numbers: ", ],
|
81
|
+
dataString: `'channel=${gupshup_Whatsapp_host.channel}&source=${gupshup_Whatsapp_host.source}&destination=__destinationNumber__&src.name=mymobioffice&template=%7B%22id%22:%22${gupshup_Whatsapp_host.templateId_host_instructions}%22,%22params%22:%5B%22${companyName}%22,%22__visitorName__%22,%22__hostName__%22%5D%7D'`
|
82
|
+
},
|
83
|
+
"vmVideoMsg": {
|
84
|
+
requirementMsgs: ["Please provide comma separated 10 digit phone numbers: ", ],
|
85
|
+
dataString: 'channel=whatsapp&source=919925039603&destination=__destinationNumber__&src.name=mymobioffice&template=%7B%22id%22:%22fc4fff94-d495-4278-b288-58f12ee089ad%22,%22params%22:%5B%5D%7D&message=%7B%22type%22:%22video%22,%22video%22:%7B%22id%22:%22c8711d40-7e88-4eb7-b3f8-bd298d733116%22%7D%7D&'
|
86
|
+
},
|
87
|
+
"e2dcfdb4-1cef-4a6e-90ec-e70f0274e209": {
|
88
|
+
requirementMsgs: [],
|
89
|
+
dataString: 'channel=whatsapp&source=919925039603&destination=__destinationNumber__&src.name=mymobioffice&template=%7B%22id%22:%22e2dcfdb4-1cef-4a6e-90ec-e70f0274e209%22,%22params%22:%5B%226%22,%22__DATE__%22,%22__URL__%22%5D%7D'
|
90
|
+
},
|
91
|
+
"49f26e4c-93b4-4e87-bc30-569ea7eb2e31": {
|
92
|
+
requirementMsgs: [],
|
93
|
+
dataString: 'channel=whatsapp&source=919925039603&destination=__destinationNumber__&src.name=mymobioffice&template=%7B%22id%22:%2249f26e4c-93b4-4e87-bc30-569ea7eb2e31%22,%22params%22:%5B%22Tarun Chelumalla%22,%22Mobi office%22,%22Tarun%22,%2203:00%20pm%20on%2021/11/2023%22%5D%7D&message=%7B%22type%22:%22image%22,%22image%22:%7B%22link%22:%22https://www.simplilearn.com/ice9/free_resources_article_thumb/what_is_image_Processing.jpg%22%7D%7D&'
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
// 'channel=whatsapp&source=919925039603&destination=__destinationNumber__&src.name=mymobioffice&template=%7B%22id%22:%22fc4fff94-d495-4278-b288-58f12ee089ad%22,%22params%22:%5B%5D%7D&message=%7B%22type%22:%22video%22,%22video%22:%7B%22id%22:%22c8711d40-7e88-4eb7-b3f8-bd298d733116%22%7D%7D&'
|
package/src/index.ts
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
import { Company } from "./models/company.model";
|
2
|
+
import { License } from "./models/license.model";
|
3
|
+
import { Attendance } from "./models/attendance.model";
|
4
|
+
import { Report } from "./models/report.model";
|
5
|
+
import { Offline } from "./models/offline.model";
|
6
|
+
import { Feeds } from "./models/feed.models";
|
7
|
+
import { ReportDefinitionDetail } from "./models/report-definition-details.model";
|
8
|
+
import { ReportVisibility } from "./models/report-visibility.model";
|
9
|
+
import { User } from "./models/user.model";
|
10
|
+
import { Action } from "./models/action.model";
|
11
|
+
import { Geofence } from "./models/geofence.model";
|
12
|
+
import { Post } from "./models/post.model";
|
13
|
+
import { CheckInCheckOutPost } from "./models/cicoPost.model";
|
14
|
+
import { WorklogPost } from "./models/worklogPost.model";
|
15
|
+
import { MissingPunch } from "./models/missingPunchPost.model";
|
16
|
+
import { HttpResponseAndErrorHandling } from "./models/response.model";
|
17
|
+
import { CustomCollection } from "./models/customCollection.model";
|
18
|
+
import { CustomerServices } from "./services/customer";
|
19
|
+
import { TempCollection } from "./models/tempCollection.model";
|
20
|
+
import { Customer } from "./models/customer/customer.model";
|
21
|
+
import { MeetingSummary } from "./models/meeting.model";
|
22
|
+
import { MeetingServices } from "./services/meeting";
|
23
|
+
import { Dispatch } from "./models/dispatch.model";
|
24
|
+
import { Doffing } from "./models/actions/doffing";
|
25
|
+
import { Folding } from "./models/actions/folding";
|
26
|
+
import { Logs } from "./models/log.model";
|
27
|
+
import { Meter } from "./models/meter.model";
|
28
|
+
import { DeviceChangeReq } from "./models/deviceChangeReq";
|
29
|
+
import { PushNotifications } from "./models/pushNotifications/pushNotification.model";
|
30
|
+
import { NewIn } from "./models/visitorManagement/newIn.model";
|
31
|
+
import { Invitation } from "./models/visitorManagement/invite.model";
|
32
|
+
import { Acknowledgement } from "./models/visitorManagement/acknowledgement.model";
|
33
|
+
import { Utilities } from "./models/utility.model";
|
34
|
+
import { Task } from "./models/tasks/task.model";
|
35
|
+
import { TaskGroup } from "./models/tasks/task-group.model";
|
36
|
+
import { Tag } from "./models/tasks/tags.model";
|
37
|
+
import { SubTaskGroup } from "./models/tasks/sub-task-group.model";
|
38
|
+
import { Summary } from "./models/summary.model";
|
39
|
+
import { Request } from "./models/contact-us/resquest.model";
|
40
|
+
import { ReportGenerator } from "./models/reportGenerator.model";
|
41
|
+
import { LeaveApplication } from "./models/leaveApplicationPost.model";
|
42
|
+
import { GupShupLogs } from "./models/storeGupShupLog.model";
|
43
|
+
|
44
|
+
export {
|
45
|
+
Action,
|
46
|
+
User,
|
47
|
+
Company,
|
48
|
+
License,
|
49
|
+
Attendance,
|
50
|
+
Report,
|
51
|
+
Offline,
|
52
|
+
Feeds,
|
53
|
+
ReportDefinitionDetail,
|
54
|
+
ReportVisibility,
|
55
|
+
Geofence,
|
56
|
+
Post,
|
57
|
+
CheckInCheckOutPost,
|
58
|
+
WorklogPost,
|
59
|
+
MissingPunch,
|
60
|
+
HttpResponseAndErrorHandling,
|
61
|
+
CustomCollection,
|
62
|
+
CustomerServices,
|
63
|
+
TempCollection,
|
64
|
+
Customer,
|
65
|
+
MeetingSummary,
|
66
|
+
MeetingServices,
|
67
|
+
Dispatch,
|
68
|
+
Doffing,
|
69
|
+
Folding,
|
70
|
+
Logs,
|
71
|
+
Meter,
|
72
|
+
DeviceChangeReq,
|
73
|
+
PushNotifications,
|
74
|
+
NewIn,
|
75
|
+
Invitation,
|
76
|
+
Acknowledgement,
|
77
|
+
Utilities,
|
78
|
+
Task,
|
79
|
+
TaskGroup,
|
80
|
+
Tag,
|
81
|
+
SubTaskGroup,
|
82
|
+
Summary,
|
83
|
+
Request,
|
84
|
+
ReportGenerator,
|
85
|
+
LeaveApplication,
|
86
|
+
GupShupLogs
|
87
|
+
};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import * as admin from 'firebase-admin';
|
2
|
+
import { Company } from './company.model';
|
3
|
+
|
4
|
+
class FeedDetailsScreen {
|
5
|
+
|
6
|
+
static async createFeedDetailsScreen(firestore:admin.firestore.Firestore,nickName:string,data:any){
|
7
|
+
let companyId = await Company.getCompanyIdbyNickname(firestore,nickName);
|
8
|
+
let snapshot = firestore
|
9
|
+
.collection("Companies")
|
10
|
+
.doc(companyId)
|
11
|
+
.collection("Feed-Details-Screen").doc()
|
12
|
+
data.id = snapshot.id
|
13
|
+
await snapshot.set(data)
|
14
|
+
return data
|
15
|
+
}
|
16
|
+
|
17
|
+
static async updateFeedDetailsScreen(firestore:admin.firestore.Firestore,nickName:string,data:any){
|
18
|
+
let companyId = await Company.getCompanyIdbyNickname(firestore,nickName);
|
19
|
+
let snapshot = await firestore
|
20
|
+
.collection("Companies")
|
21
|
+
.doc(companyId)
|
22
|
+
.collection("Feed-Details-Screen").where("actionName","==",data.actionName).get()
|
23
|
+
snapshot.forEach((doc)=>{
|
24
|
+
doc.ref.update(data)
|
25
|
+
})
|
26
|
+
}
|
27
|
+
|
28
|
+
}
|
29
|
+
export { FeedDetailsScreen };
|