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,46 @@
|
|
1
|
+
import admin from "./db.js";
|
2
|
+
import { options } from "./argvConfig.js";
|
3
|
+
import * as csvToJson from 'convert-csv-to-json';
|
4
|
+
import { ReportVisibility } from "../src/models/report-visibility.model"
|
5
|
+
import { ReportDefinitionSummary } from "../src/models/report-definitions-summary.model.js";
|
6
|
+
import { Company } from "../src/models/company.model.js";
|
7
|
+
|
8
|
+
let firestore = admin.firestore()
|
9
|
+
// let time = new Date().getTime()
|
10
|
+
let argv = options.args[0].split(',')
|
11
|
+
|
12
|
+
let reportVisibility = csvToJson.fieldDelimiter(',').getJsonFromCsv(argv[0]);
|
13
|
+
let reportSections = csvToJson.fieldDelimiter(',').getJsonFromCsv(reportVisibility[0]['report-sections']);
|
14
|
+
let reportSections_report = csvToJson.fieldDelimiter(',').getJsonFromCsv(reportSections[0]['reports']);
|
15
|
+
let reportSections_report_items = csvToJson.fieldDelimiter(',').getJsonFromCsv(reportSections_report[0]['items']);
|
16
|
+
|
17
|
+
let nickName = reportVisibility[0].nickname
|
18
|
+
delete reportVisibility[0].nickname;
|
19
|
+
delete reportSections_report_items[0].id
|
20
|
+
delete reportSections_report_items[1].id
|
21
|
+
let reportDefinitionSummary = ['Attendance','Team Attendance'];
|
22
|
+
let attendanceId = await ReportDefinitionSummary.getReportDefinitionSummaryId(firestore,nickName,reportDefinitionSummary[0]);
|
23
|
+
let teamAttendanceId = await ReportDefinitionSummary.getReportDefinitionSummaryId(firestore,nickName,reportDefinitionSummary[1]);
|
24
|
+
// reportSections_report[0].createdAt = time
|
25
|
+
reportSections_report[0].id = attendanceId
|
26
|
+
reportSections_report[0].items = []
|
27
|
+
reportSections_report[0].items.push(...reportSections_report_items);
|
28
|
+
const copy = await JSON.parse(JSON.stringify(reportSections_report[0]));
|
29
|
+
|
30
|
+
let mangersList = await Company.getMangersList(firestore,nickName);
|
31
|
+
let usersList = await Company.userIdbycompany(firestore,nickName);
|
32
|
+
for (let userId of usersList){
|
33
|
+
let doc:any = new Object()
|
34
|
+
doc.id = userId
|
35
|
+
doc['report-sections'] = []
|
36
|
+
doc['report-sections'].push(reportSections[0])
|
37
|
+
doc['report-sections'][0].reports = []
|
38
|
+
doc['report-sections'][0].reports.push(reportSections_report[0])
|
39
|
+
if(mangersList.includes(userId)){
|
40
|
+
copy.id = teamAttendanceId
|
41
|
+
// copy.createdAt = time
|
42
|
+
doc['report-sections'][0].reports.push(copy)
|
43
|
+
}
|
44
|
+
let reportId = await ReportVisibility.setReportVisibility(firestore,nickName,doc)
|
45
|
+
console.log(reportId)
|
46
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import admin from "./db.js";
|
2
|
+
import { options } from "./argvConfig.js";
|
3
|
+
import fs from "fs";
|
4
|
+
|
5
|
+
let firestore = admin.firestore()
|
6
|
+
const UsersWorkAreaInfo = fs.readFileSync(options.args[0], "utf-8");
|
7
|
+
const UsersWorkAreaArr = await JSON.parse(UsersWorkAreaInfo);
|
8
|
+
|
9
|
+
for(let user of UsersWorkAreaArr){
|
10
|
+
await firestore.collection("CustomCollections")
|
11
|
+
.doc("GC5BOfo2Ibma9CJ4NRpM")
|
12
|
+
.collection("Users")
|
13
|
+
.doc(user.id)
|
14
|
+
.set(user)
|
15
|
+
console.log(user)
|
16
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"submitUrl": "",
|
4
|
+
"field": {
|
5
|
+
"hint": "",
|
6
|
+
"icon": "",
|
7
|
+
"id": "SUM101",
|
8
|
+
"label": "Summary",
|
9
|
+
"value": ""
|
10
|
+
},
|
11
|
+
"label": "Summary",
|
12
|
+
"id": "",
|
13
|
+
"nextRole": "",
|
14
|
+
"type": "summary",
|
15
|
+
"nextCollection": "",
|
16
|
+
"value": "",
|
17
|
+
"fieldType": "Summary",
|
18
|
+
"buttonActionText": "Done",
|
19
|
+
"order": 2
|
20
|
+
}
|
21
|
+
]
|
@@ -0,0 +1,24 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"apiName": "Fountainhead (Insights)",
|
4
|
+
"endpoints": {},
|
5
|
+
"splashBgColor": "#ffffff",
|
6
|
+
"description": "",
|
7
|
+
"e10xSupport": false,
|
8
|
+
"names": "",
|
9
|
+
"nickname": "insights",
|
10
|
+
"links": "",
|
11
|
+
"id": "",
|
12
|
+
"accessTKN": "",
|
13
|
+
"apiId": "1",
|
14
|
+
"name": "Fountainhead (Insights)",
|
15
|
+
"image": "https://firebasestorage.googleapis.com/v0/b/mobioffice-dev.appspot.com/o/companies_logo%2FKG.png?alt=media&token=8b254ff9-b044-4a65-bed6-2c98d2180ecb",
|
16
|
+
"splashImage": "https://firebasestorage.googleapis.com/v0/b/mobioffice-dev.appspot.com/o/companies_logo%2Fkg_splash.png?alt=media&token=642bc2ec-cf4d-4bdf-9a22-c05d474b41ab",
|
17
|
+
"users": [
|
18
|
+
"pILnayaGnBeDXMPCYHjarhV392n1",
|
19
|
+
"uLZKlOCxAkf6kf2KuGaEMHMpJFk1",
|
20
|
+
"TvlJujE9cdOzQ8SMA7kHFjGOAur1"
|
21
|
+
],
|
22
|
+
"allowLocation": true
|
23
|
+
}
|
24
|
+
]
|
@@ -0,0 +1,13 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"darkColor": "#68C4FF",
|
4
|
+
"icon": "https://firebasestorage.googleapis.com/v0/b/mobioffice-flutter.appspot.com/o/icons%2Fout.svg?alt=media&token=ef1fb9ad-05ef-4e9c-a86e-5658ef3e5df4",
|
5
|
+
"activityFor": "b2Sc1WpvhHxTE4VKVmzG",
|
6
|
+
"description": "Check-In Visitor",
|
7
|
+
"lightColor": "#E9F4FB",
|
8
|
+
"id": "rqW17mLlFv44ru5n49mQ",
|
9
|
+
"title": "Check-In Visitor",
|
10
|
+
"url": "GO",
|
11
|
+
"order": 5
|
12
|
+
}
|
13
|
+
]
|
@@ -0,0 +1,43 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"color": "#0047AB",
|
4
|
+
"name": "WeldXpert",
|
5
|
+
"toHome": true,
|
6
|
+
"id": "mqBfTOsUJSK3pU8dtMCN",
|
7
|
+
"detailOf": "mqBfTOsUJSK3pU8dtMCN",
|
8
|
+
"data": [
|
9
|
+
{
|
10
|
+
"totalItems": "0",
|
11
|
+
"data": [
|
12
|
+
{
|
13
|
+
"Size": "",
|
14
|
+
"SDR": "",
|
15
|
+
"Wall Thickness": "",
|
16
|
+
"Internal Diameter": "",
|
17
|
+
"Bead Height": "",
|
18
|
+
"Heating Time": "",
|
19
|
+
"Heating Pressure": "",
|
20
|
+
"Changeover Time": "",
|
21
|
+
"Joining Pressure": { "Build Up Time": "", "Bar": "" },
|
22
|
+
"Cooling Time": "",
|
23
|
+
"Bead Min": "",
|
24
|
+
"Bead Max": "",
|
25
|
+
"Misalignment Allowed": "",
|
26
|
+
"Temperature": "200°C ~ 210°C"
|
27
|
+
}
|
28
|
+
],
|
29
|
+
"nextPage": 0,
|
30
|
+
"keys": ["weldingDetails"],
|
31
|
+
"halfPage": true,
|
32
|
+
"pageSize": "0",
|
33
|
+
"fullPage": false,
|
34
|
+
"type": "timer",
|
35
|
+
"url": "",
|
36
|
+
"autoAPICalled": false,
|
37
|
+
"id": "TIMER#1",
|
38
|
+
"isSSL": false,
|
39
|
+
"order": 0
|
40
|
+
}
|
41
|
+
]
|
42
|
+
}
|
43
|
+
]
|