@plusscommunities/pluss-maintenance-aws-forms 2.1.39 → 2.1.41
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/package.json +62 -62
- package/requests/getRequests.js +30 -0
package/package.json
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
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
|
-
|
|
2
|
+
"name": "@plusscommunities/pluss-maintenance-aws-forms",
|
|
3
|
+
"version": "2.1.41",
|
|
4
|
+
"description": "Extension package to enable maintenance on Pluss Communities Platform",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"gc": "node ../../tools/gc ./",
|
|
7
|
+
"gs": "node ../../tools/gs ./ ../../strings/serverless.yml",
|
|
8
|
+
"betapatch": "npm version prepatch --preid=beta",
|
|
9
|
+
"patch": "npm version patch",
|
|
10
|
+
"deploy": "npm run gc && npm run gs && serverless deploy",
|
|
11
|
+
"betaupload": "rm -rf .serverless && npm i && npm publish --access public --tag beta",
|
|
12
|
+
"betaupload:p": "npm run betapatch && npm run betaupload",
|
|
13
|
+
"upload": "rm -rf .serverless && npm i && npm publish --access public",
|
|
14
|
+
"upload:p": "npm run patch && npm run upload",
|
|
15
|
+
"copy:add": "run(){ ext=${1:-default}; test -f values.config.$ext.js || cp values.config.default.js values.config.$ext.js; }; run",
|
|
16
|
+
"copy:get": "echo $npm_package_name",
|
|
17
|
+
"copy:set": "run(){ target='\\@plusscommunities\\/pluss-maintenance-aws'; ext=${1:-default}; [ $ext == 'default' ] && replace=$target || replace=$target'-'$ext; echo 'Setting target to '$replace; test -f values.config.$ext.js && cp -f values.config.$ext.js values.config.js; sed -i '' -e 's/'$target'.*\"/'$replace'\"/g' package.json; }; run",
|
|
18
|
+
"copy:deploy": "for file in `ls ./values.config.*.js`; do dup=`echo $file | sed 's/.*values\\.config\\.\\(.*\\)\\.js/\\1/'`; npm run copy:set $dup; npm run deploy; done; npm run copy:set; npm run gs;",
|
|
19
|
+
"copy:betaupload": "npm run betapach; for file in `ls ./values.config.*.js`; do dup=`echo $file | sed 's/.*values\\.config\\.\\(.*\\)\\.js/\\1/'`; npm run copy:set $dup; npm run betaupload; done; npm run copy:set;",
|
|
20
|
+
"copy:upload": "npm run patch; for file in `ls ./values.config.*.js`; do dup=`echo $file | sed 's/.*values\\.config\\.\\(.*\\)\\.js/\\1/'`; npm run copy:set $dup; npm run upload; done; npm run copy:set;",
|
|
21
|
+
"test": "jest tests -i"
|
|
22
|
+
},
|
|
23
|
+
"author": "Thorbjorn Kappel Davis",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@aws/dynamodb-auto-marshaller": "^0.7.1",
|
|
27
|
+
"@plusscommunities/pluss-core-aws": "2.0.24-beta.0",
|
|
28
|
+
"amazon-cognito-identity-js": "^2.0.19",
|
|
29
|
+
"aws-sdk": "^2.1591.0",
|
|
30
|
+
"axios": "^1.6.8",
|
|
31
|
+
"base64-arraybuffer": "^1.0.2",
|
|
32
|
+
"expo-server-sdk": "^3.0.1",
|
|
33
|
+
"https": "^1.0.0",
|
|
34
|
+
"lodash": "^4.17.10",
|
|
35
|
+
"moment": "^2.30.1",
|
|
36
|
+
"node-fetch": "^2.2.0",
|
|
37
|
+
"node-jose": "^1.0.0",
|
|
38
|
+
"nodemailer": "^6.9.12",
|
|
39
|
+
"twilio": "^3.18.0",
|
|
40
|
+
"uuid": "^2.0.3"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/jest": "^26.0.23",
|
|
44
|
+
"eslint-config-rallycoding": "^3.2.0",
|
|
45
|
+
"jest": "^29.0.0",
|
|
46
|
+
"jest-aws-sdk-mock": "^1.0.2",
|
|
47
|
+
"serverless-domain-manager": "^3.3.1",
|
|
48
|
+
"serverless-prune-plugin": "^1.4.1"
|
|
49
|
+
},
|
|
50
|
+
"files": [
|
|
51
|
+
"db/*",
|
|
52
|
+
"integration/*",
|
|
53
|
+
"requests/*",
|
|
54
|
+
"ticketing/*",
|
|
55
|
+
"*.js",
|
|
56
|
+
"package*.json"
|
|
57
|
+
],
|
|
58
|
+
"jest": {
|
|
59
|
+
"rootDir": "./",
|
|
60
|
+
"moduleNameMapper": {
|
|
61
|
+
"^./testing/(.*)$": "<rootDir>/testing/$1"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
64
|
}
|
package/requests/getRequests.js
CHANGED
|
@@ -93,12 +93,42 @@ module.exports = async (event) => {
|
|
|
93
93
|
log("getRequests", "FilteredOnType", jobs.length, logId);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
// filter on assignee (for users with tracking permission)
|
|
97
|
+
if (qParams.assignee) {
|
|
98
|
+
jobs = jobs.filter((j) => j.AssigneeId === qParams.assignee);
|
|
99
|
+
log("getRequests", "FilteredOnAssigneeFilter", jobs.length, logId);
|
|
100
|
+
}
|
|
101
|
+
|
|
96
102
|
// filter to assigned jobs
|
|
97
103
|
if (!authorised && assigneeTracking) {
|
|
98
104
|
jobs = jobs.filter((j) => j.AssigneeId === userId || j.userID === userId);
|
|
99
105
|
log("getRequests", "FilteredOnAssignee", jobs.length, logId);
|
|
100
106
|
}
|
|
101
107
|
|
|
108
|
+
// filter on time range
|
|
109
|
+
if (qParams.startTime) {
|
|
110
|
+
const startTime = parseInt(qParams.startTime, 10);
|
|
111
|
+
jobs = jobs.filter((j) => j.createdUnix >= startTime);
|
|
112
|
+
log("getRequests", "FilteredOnStartTime", jobs.length, logId);
|
|
113
|
+
}
|
|
114
|
+
if (qParams.endTime) {
|
|
115
|
+
const endTime = parseInt(qParams.endTime, 10);
|
|
116
|
+
jobs = jobs.filter((j) => j.createdUnix <= endTime);
|
|
117
|
+
log("getRequests", "FilteredOnEndTime", jobs.length, logId);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// filter on search text (jobId exact match, or room/title contains)
|
|
121
|
+
if (qParams.search) {
|
|
122
|
+
const searchLower = qParams.search.toLowerCase();
|
|
123
|
+
jobs = jobs.filter((j) => {
|
|
124
|
+
if (j.jobId && j.jobId === qParams.search) return true;
|
|
125
|
+
if (j.room && j.room.toLowerCase().indexOf(searchLower) > -1) return true;
|
|
126
|
+
if (j.title && j.title.toLowerCase().indexOf(searchLower) > -1) return true;
|
|
127
|
+
return false;
|
|
128
|
+
});
|
|
129
|
+
log("getRequests", "FilteredOnSearch", jobs.length, logId);
|
|
130
|
+
}
|
|
131
|
+
|
|
102
132
|
// compile results
|
|
103
133
|
const results = { Items: jobs, LastKey: result.LastEvaluatedKey };
|
|
104
134
|
log("getRequests", "Done", true, logId);
|