@plusscommunities/pluss-maintenance-aws-forms 2.1.35-beta.0 → 2.1.39
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.
|
@@ -241,6 +241,21 @@ class ArchibusStrategy extends IntegrationStrategy {
|
|
|
241
241
|
trackedData,
|
|
242
242
|
});
|
|
243
243
|
|
|
244
|
+
// Skip API calls overnight (8pm–6am Sydney time)
|
|
245
|
+
const sydneyNow = new Date(
|
|
246
|
+
new Date().toLocaleString("en-US", { timeZone: "Australia/Sydney" }),
|
|
247
|
+
);
|
|
248
|
+
const sydneyHour = sydneyNow.getHours();
|
|
249
|
+
if (sydneyHour >= 20 || sydneyHour < 6) {
|
|
250
|
+
log(
|
|
251
|
+
"Archibus:RefreshFromSource",
|
|
252
|
+
"SkippedOvernight",
|
|
253
|
+
{ sydneyHour },
|
|
254
|
+
logId,
|
|
255
|
+
);
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
|
|
244
259
|
// If the external status is terminal, remove ActiveEntityType to exclude from sparse GSI
|
|
245
260
|
if (this.completedStatuses.includes(trackedData.status)) {
|
|
246
261
|
log(
|
|
@@ -255,6 +270,7 @@ class ArchibusStrategy extends IntegrationStrategy {
|
|
|
255
270
|
delete entity.ActiveEntityType;
|
|
256
271
|
await updateRef("externalentities", entity);
|
|
257
272
|
}
|
|
273
|
+
return false;
|
|
258
274
|
}
|
|
259
275
|
|
|
260
276
|
const request = await this.getRequest(externalId);
|
|
@@ -278,9 +294,21 @@ class ArchibusStrategy extends IntegrationStrategy {
|
|
|
278
294
|
"id",
|
|
279
295
|
requestId,
|
|
280
296
|
);
|
|
281
|
-
// check how the new status map to what is saved in Pluss
|
|
282
297
|
|
|
283
|
-
if (
|
|
298
|
+
if (!plussRequest) {
|
|
299
|
+
log(
|
|
300
|
+
"Archibus:RefreshFromSource",
|
|
301
|
+
"RequestDeletedLocally",
|
|
302
|
+
requestId,
|
|
303
|
+
logId,
|
|
304
|
+
);
|
|
305
|
+
const entityRowId = `${this.getEntityType()}_${externalId}`;
|
|
306
|
+
const entity = await getRef("externalentities", "RowId", entityRowId);
|
|
307
|
+
if (entity?.ActiveEntityType) {
|
|
308
|
+
delete entity.ActiveEntityType;
|
|
309
|
+
await updateRef("externalentities", entity);
|
|
310
|
+
}
|
|
311
|
+
} else if (statusToUse.Status !== plussRequest?.status) {
|
|
284
312
|
// save updated status
|
|
285
313
|
|
|
286
314
|
plussRequest = await editRef(
|
|
@@ -10,291 +10,289 @@ const indexQuery = require("@plusscommunities/pluss-core-aws/db/common/indexQuer
|
|
|
10
10
|
const { values } = require("../../values.config");
|
|
11
11
|
|
|
12
12
|
class SeeStuffStrategy extends IntegrationStrategy {
|
|
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
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
return true;
|
|
297
|
-
};
|
|
13
|
+
constructor(config) {
|
|
14
|
+
super();
|
|
15
|
+
this.baseUrl = config.BaseUrl; // base URL for the API
|
|
16
|
+
this.apiKeyHeader = config.APIKeyHeader; // header to use for API key
|
|
17
|
+
this.apiKey = config.APIKey; // API key
|
|
18
|
+
|
|
19
|
+
const url = new URL(this.baseUrl);
|
|
20
|
+
this.host = url.host;
|
|
21
|
+
|
|
22
|
+
this.siteMap = config.SiteMap ?? {};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Gets the entity type for the integration
|
|
27
|
+
*
|
|
28
|
+
* @returns {String} The entity type for the integration
|
|
29
|
+
*/
|
|
30
|
+
getEntityType = () => {
|
|
31
|
+
return `${values.serviceKey}_SeeStuff`;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Validates the integration
|
|
36
|
+
*
|
|
37
|
+
* @returns {Boolean} Whether the integration is valid
|
|
38
|
+
*/
|
|
39
|
+
isValidIntegration = () => {
|
|
40
|
+
return true;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Gets the refresh interval for the SeeStuff system
|
|
45
|
+
*
|
|
46
|
+
* @returns {Number} The refresh interval in milliseconds
|
|
47
|
+
*/
|
|
48
|
+
getRefreshInterval = () => {
|
|
49
|
+
return Number.MAX_SAFE_INTEGER; // should never refresh
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Creates a request in the SeeStuff system
|
|
54
|
+
*
|
|
55
|
+
* @param {Object} request - Request definition on Pluss
|
|
56
|
+
* @param {Object} mockResponse - Mock response from SeeStuff to simulate response
|
|
57
|
+
* @returns {Boolean} Whether the request was created on SeeStuff
|
|
58
|
+
*/
|
|
59
|
+
createRequest = async (request, mockResponse = null) => {
|
|
60
|
+
const logId = log("SeeStuff:CreateRequest", "Start", request);
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
// Get user details for room/address and CRMID
|
|
64
|
+
let userRoom = request.room || "";
|
|
65
|
+
let crmResidentId = "";
|
|
66
|
+
|
|
67
|
+
// Map site to location code if available
|
|
68
|
+
const location = this.siteMap[request.site];
|
|
69
|
+
if (!location) {
|
|
70
|
+
log("SeeStuff:CreateRequest", "LocationNotFound", request.site, logId);
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (request.userID) {
|
|
75
|
+
try {
|
|
76
|
+
// Look up user from users table
|
|
77
|
+
const user = await getRef("users", "Id", request.userID);
|
|
78
|
+
log("SeeStuff:CreateRequest", "User", user, logId);
|
|
79
|
+
|
|
80
|
+
if (user) {
|
|
81
|
+
// Get user's address/room
|
|
82
|
+
if (user.unit) {
|
|
83
|
+
userRoom = user.unit;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Get CRMID from user fields
|
|
87
|
+
try {
|
|
88
|
+
const crmIdField = await getRef(
|
|
89
|
+
"userfields",
|
|
90
|
+
"RowId",
|
|
91
|
+
getRowId(request.userID, "CRMID"),
|
|
92
|
+
);
|
|
93
|
+
if (crmIdField && crmIdField.Value) {
|
|
94
|
+
crmResidentId = crmIdField.Value;
|
|
95
|
+
}
|
|
96
|
+
log("SeeStuff:CreateRequest", "CRMID", crmResidentId, logId);
|
|
97
|
+
} catch (fieldError) {
|
|
98
|
+
log(
|
|
99
|
+
"SeeStuff:CreateRequest",
|
|
100
|
+
"CRMIDLookupError",
|
|
101
|
+
fieldError,
|
|
102
|
+
logId,
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
} catch (userError) {
|
|
107
|
+
log("SeeStuff:CreateRequest", "UserLookupError", userError, logId);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (_.isEmpty(crmResidentId)) {
|
|
112
|
+
// log an issue in the history
|
|
113
|
+
throw new Error("NoCRMResidentId");
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Format description similar to Archibus
|
|
117
|
+
const description = `${request.title}${
|
|
118
|
+
_.isEmpty(request.description) ? "" : `\n\n${request.description}`
|
|
119
|
+
}${_.isEmpty(request.room) ? "" : `\n\nLocation: ${request.room}`}${
|
|
120
|
+
_.isEmpty(request.userName) ? "" : `\n\nJob Type: ${request.type}`
|
|
121
|
+
}${
|
|
122
|
+
_.isEmpty(request.images)
|
|
123
|
+
? ""
|
|
124
|
+
: `\n\nImages: ${request.images.join("\n")}`
|
|
125
|
+
}`;
|
|
126
|
+
|
|
127
|
+
// Format date_reported
|
|
128
|
+
const dateReported = moment().format("YYYY-MM-DD HH:mm:ss");
|
|
129
|
+
|
|
130
|
+
// Build payload
|
|
131
|
+
const data = {
|
|
132
|
+
externalId: request.id,
|
|
133
|
+
description: description,
|
|
134
|
+
priority: "P3",
|
|
135
|
+
location: location,
|
|
136
|
+
room: userRoom,
|
|
137
|
+
date_reported: dateReported,
|
|
138
|
+
crmResidentId: crmResidentId,
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
log("SeeStuff:CreateRequest", "Request", data, logId);
|
|
142
|
+
|
|
143
|
+
const response =
|
|
144
|
+
mockResponse ??
|
|
145
|
+
(await axios({
|
|
146
|
+
method: "POST",
|
|
147
|
+
url: `${this.baseUrl}/assetmgmt/servicerequests`,
|
|
148
|
+
timeout: 30000,
|
|
149
|
+
headers: {
|
|
150
|
+
[this.apiKeyHeader]: this.apiKey,
|
|
151
|
+
"Content-Type": "application/json",
|
|
152
|
+
Host: this.host,
|
|
153
|
+
},
|
|
154
|
+
data,
|
|
155
|
+
}));
|
|
156
|
+
|
|
157
|
+
log("SeeStuff:CreateRequest", "Response", response.data, logId);
|
|
158
|
+
|
|
159
|
+
return true;
|
|
160
|
+
} catch (e) {
|
|
161
|
+
log("SeeStuff:CreateRequest", "Error", e, logId);
|
|
162
|
+
|
|
163
|
+
// Add history entry for failed integration
|
|
164
|
+
try {
|
|
165
|
+
const failedJob = await getRef(
|
|
166
|
+
values.tableNameMaintenance,
|
|
167
|
+
"id",
|
|
168
|
+
request.id,
|
|
169
|
+
);
|
|
170
|
+
if (!failedJob.history) failedJob.history = [];
|
|
171
|
+
failedJob.history.push({
|
|
172
|
+
timestamp: moment.utc().valueOf(),
|
|
173
|
+
EntryType: "ExternalIDSetFailed",
|
|
174
|
+
user: {
|
|
175
|
+
displayName: "SeeStuff Integration",
|
|
176
|
+
id: "system",
|
|
177
|
+
},
|
|
178
|
+
systemType: "SeeStuff",
|
|
179
|
+
error: e.message === "NoCRMResidentId" ? "No CRM ID found" : null,
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
await editRef(values.tableNameMaintenance, "id", request.id, {
|
|
183
|
+
history: failedJob.history,
|
|
184
|
+
});
|
|
185
|
+
} catch (historyError) {
|
|
186
|
+
log("SeeStuff:CreateRequest", "HistoryError", historyError, logId);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return false;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Fetches a request from the SeeStuff system
|
|
194
|
+
* Not implemented yet
|
|
195
|
+
*
|
|
196
|
+
* @param {String} externalId - Id of the request on SeeStuff
|
|
197
|
+
* @returns {Object} The request as it exists on SeeStuff
|
|
198
|
+
*/
|
|
199
|
+
getRequest = async (externalId) => {
|
|
200
|
+
return null;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Refreshes a request from the SeeStuff system
|
|
205
|
+
* Not implemented yet
|
|
206
|
+
*
|
|
207
|
+
* @param {String} requestId - Id of the request on Pluss
|
|
208
|
+
* @param {String} externalId - Id of the request on SeeStuff
|
|
209
|
+
* @param {Object} trackedData - The set of fields tracked
|
|
210
|
+
* @returns {Boolean} Whether the request had any changes on SeeStuff
|
|
211
|
+
*/
|
|
212
|
+
refreshFromSource = async (requestId, externalId, trackedData) => {
|
|
213
|
+
return false;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Get SeeStuff Id of the request
|
|
218
|
+
* Queries externalentities table to find the external ID
|
|
219
|
+
*
|
|
220
|
+
* @param {Object} request - Request definition on Pluss
|
|
221
|
+
* @returns {String} Id of the request on SeeStuff
|
|
222
|
+
*/
|
|
223
|
+
getExternalId = async (request) => {
|
|
224
|
+
const logId = log("SeeStuff:GetExternalId", "Start", { Id: request.id });
|
|
225
|
+
|
|
226
|
+
// get external id
|
|
227
|
+
const externalEntityQuery = await indexQuery("externalentities", {
|
|
228
|
+
IndexName: "InternalIdIndex",
|
|
229
|
+
KeyConditionExpression:
|
|
230
|
+
"EntityType = :entityType AND InternalId = :internalId",
|
|
231
|
+
ExpressionAttributeValues: {
|
|
232
|
+
":entityType": this.getEntityType(),
|
|
233
|
+
":internalId": request.id,
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
log(
|
|
238
|
+
"SeeStuff:GetExternalId",
|
|
239
|
+
"ExternalLength",
|
|
240
|
+
externalEntityQuery.Items.length,
|
|
241
|
+
logId,
|
|
242
|
+
);
|
|
243
|
+
if (_.isEmpty(externalEntityQuery.Items)) {
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
const externalId = externalEntityQuery.Items[0].ExternalId;
|
|
248
|
+
log("SeeStuff:GetExternalId", "ExternalId", externalId, logId);
|
|
249
|
+
|
|
250
|
+
return externalId;
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Perform actions when a task's status has changed
|
|
255
|
+
* Not implemented yet
|
|
256
|
+
*
|
|
257
|
+
* @param {Object} request - Request definition on Pluss
|
|
258
|
+
* @returns {Boolean} Represents whether the actions were successful
|
|
259
|
+
*/
|
|
260
|
+
onStatusChanged = async (request) => {
|
|
261
|
+
return true;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Perform actions when a comment has been added to a task
|
|
266
|
+
* Not implemented yet
|
|
267
|
+
*
|
|
268
|
+
* @param {Object} request - Request definition on Pluss
|
|
269
|
+
* @returns {Boolean} Represents whether the actions were successful
|
|
270
|
+
*/
|
|
271
|
+
onCommentAdded = async (request) => {
|
|
272
|
+
return true;
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Perform actions when a note has been added to a task
|
|
277
|
+
* Not implemented yet
|
|
278
|
+
*
|
|
279
|
+
* @param {Object} request - Request definition on Pluss
|
|
280
|
+
* @returns {Boolean} Represents whether the actions were successful
|
|
281
|
+
*/
|
|
282
|
+
onNotesAdded = async (request) => {
|
|
283
|
+
return true;
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Perform completion actions when a task is completed
|
|
288
|
+
* Not implemented yet
|
|
289
|
+
*
|
|
290
|
+
* @param {Object} request - Request definition on Pluss
|
|
291
|
+
* @returns {Boolean} Represents whether the actions were successful
|
|
292
|
+
*/
|
|
293
|
+
onCompleteRequest = async (request) => {
|
|
294
|
+
return true;
|
|
295
|
+
};
|
|
298
296
|
}
|
|
299
297
|
|
|
300
298
|
module.exports = SeeStuffStrategy;
|
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.39",
|
|
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 betapatch; 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",
|
|
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
|
}
|