@plusscommunities/pluss-maintenance-aws 2.0.2-beta.0 → 2.0.4-beta.0

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-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-maintenance-aws",
3
- "version": "2.0.2-beta.0",
3
+ "version": "2.0.4-beta.0",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-maintenance-aws",
3
- "version": "2.0.2-beta.0",
3
+ "version": "2.0.4-beta.0",
4
4
  "description": "Extension package to enable maintenance on Pluss Communities Platform",
5
5
  "scripts": {
6
- "gc": "run(){ node ../../tools/inject_config_ext ./ ${1} ${2}; }; run",
6
+ "gc": "run(){ node ../../tools/inject_config ${1} ${2}; node ../../tools/inject_config_ext ./; }; run",
7
7
  "gs": "run(){ node ../../tools/inject_serverless ${1}; }; run",
8
8
  "betapatch": "npm version prepatch --preid=beta",
9
9
  "patch": "npm version patch",
@@ -42,6 +42,7 @@
42
42
  "db/*",
43
43
  "ticketing/*",
44
44
  "*.js",
45
- "package*.json"
45
+ "package*.json",
46
+ "serverless.yml"
46
47
  ]
47
48
  }
package/serverless.yml ADDED
@@ -0,0 +1,390 @@
1
+ service: dev-maintenance
2
+
3
+ frameworkVersion: ">=1.1.0 <2.0.0"
4
+
5
+ provider:
6
+ name: aws
7
+ runtime: nodejs14.x
8
+ region: ap-southeast-2
9
+ profile: dev-serverless-admin
10
+ stage: dev
11
+ deploymentBucket: serverless.deploys.pluss60.${self:custom.client}.${self:provider.region}
12
+ environment:
13
+ tablePrefix: ${self:custom.tablePrefix}
14
+ iamRoleStatements:
15
+ - Effect: Allow
16
+ Action:
17
+ - dynamodb:Query
18
+ - dynamodb:Scan
19
+ - dynamodb:GetItem
20
+ - dynamodb:PutItem
21
+ - dynamodb:UpdateItem
22
+ - dynamodb:DeleteItem
23
+ Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/*"
24
+
25
+ plugins:
26
+ - serverless-domain-manager
27
+ - serverless-prune-plugin
28
+
29
+ custom:
30
+ client: dev
31
+ functionPrefix: ""
32
+ tablePrefix: ${self:custom.client}-${self:provider.stage}-
33
+ customDomain:
34
+ domainName: dev.pluss60-api.com
35
+ basePath: maintenance-${self:provider.stage}
36
+ stage: ${self:provider.stage}
37
+ createRoute53Record: true
38
+ securityPolicy: tls_1_2
39
+ prune:
40
+ automatic: true
41
+ number: 1
42
+
43
+ functions:
44
+ getJobType:
45
+ handler: getJobType.getJobType
46
+ tags: maintenance
47
+ memorySize: 256
48
+ timeout: 10
49
+ events:
50
+ - http:
51
+ path: ${self:custom.functionPrefix}getjobtype
52
+ method: post
53
+ cors:
54
+ origin: '*'
55
+ headers:
56
+ - Content-Type
57
+ - authkey
58
+ getJobTypes:
59
+ handler: getJobTypes.getJobTypes
60
+ tags: maintenance
61
+ memorySize: 256
62
+ timeout: 10
63
+ events:
64
+ - http:
65
+ path: ${self:custom.functionPrefix}getjobtypes
66
+ method: post
67
+ cors:
68
+ origin: '*'
69
+ headers:
70
+ - Content-Type
71
+ - authkey
72
+ createJobType:
73
+ handler: createJobType.createJobType
74
+ tags: maintenance
75
+ memorySize: 256
76
+ timeout: 10
77
+ events:
78
+ - http:
79
+ path: ${self:custom.functionPrefix}createJobType
80
+ method: post
81
+ cors:
82
+ origin: '*'
83
+ headers:
84
+ - Content-Type
85
+ - authkey
86
+ editJobType:
87
+ handler: editJobType.editJobType
88
+ tags: maintenance
89
+ memorySize: 256
90
+ timeout: 10
91
+ events:
92
+ - http:
93
+ path: ${self:custom.functionPrefix}editJobType
94
+ method: post
95
+ cors:
96
+ origin: '*'
97
+ headers:
98
+ - Content-Type
99
+ - authkey
100
+ deleteJobType:
101
+ handler: deleteJobType.deleteJobType
102
+ tags: maintenance
103
+ memorySize: 256
104
+ timeout: 10
105
+ events:
106
+ - http:
107
+ path: ${self:custom.functionPrefix}deleteJobType
108
+ method: post
109
+ cors:
110
+ origin: '*'
111
+ headers:
112
+ - Content-Type
113
+ - authkey
114
+ getJob:
115
+ handler: getJob.getJob
116
+ tags: maintenance
117
+ memorySize: 256
118
+ timeout: 10
119
+ events:
120
+ - http:
121
+ path: ${self:custom.functionPrefix}getJob
122
+ method: post
123
+ cors:
124
+ origin: '*'
125
+ headers:
126
+ - Content-Type
127
+ - authkey
128
+ getJobs:
129
+ handler: getJobs.getJobs
130
+ tags: maintenance
131
+ memorySize: 256
132
+ timeout: 10
133
+ events:
134
+ - http:
135
+ path: ${self:custom.functionPrefix}getJobs
136
+ method: post
137
+ cors:
138
+ origin: '*'
139
+ headers:
140
+ - Content-Type
141
+ - authkey
142
+ createJob:
143
+ handler: createJob.createJob
144
+ tags: maintenance
145
+ memorySize: 256
146
+ timeout: 10
147
+ events:
148
+ - http:
149
+ path: ${self:custom.functionPrefix}sendMaintenance
150
+ method: post
151
+ cors:
152
+ origin: '*'
153
+ headers:
154
+ - Content-Type
155
+ - authkey
156
+ editJob:
157
+ handler: editJob.editJob
158
+ tags: maintenance
159
+ memorySize: 256
160
+ timeout: 10
161
+ events:
162
+ - http:
163
+ path: ${self:custom.functionPrefix}editJob
164
+ method: post
165
+ cors:
166
+ origin: '*'
167
+ headers:
168
+ - Content-Type
169
+ - authkey
170
+ deleteJob:
171
+ handler: deleteJob.deleteJob
172
+ tags: maintenance
173
+ memorySize: 256
174
+ timeout: 10
175
+ events:
176
+ - http:
177
+ path: ${self:custom.functionPrefix}requests/remove
178
+ method: post
179
+ cors:
180
+ origin: '*'
181
+ headers:
182
+ - Content-Type
183
+ - authkey
184
+ editJobStatus:
185
+ handler: editJobStatus.editJobStatus
186
+ tags: maintenance
187
+ memorySize: 256
188
+ timeout: 10
189
+ events:
190
+ - http:
191
+ path: ${self:custom.functionPrefix}editJobStatus
192
+ method: post
193
+ cors:
194
+ origin: '*'
195
+ headers:
196
+ - Content-Type
197
+ - authkey
198
+ editNote:
199
+ handler: editNote.editNote
200
+ tags: maintenance
201
+ memorySize: 256
202
+ timeout: 10
203
+ events:
204
+ - http:
205
+ path: ${self:custom.functionPrefix}requests/note
206
+ method: post
207
+ cors:
208
+ origin: '*'
209
+ headers:
210
+ - Content-Type
211
+ - authkey
212
+ addTicket:
213
+ handler: ticketing/addTicket.addTicket
214
+ tags: maintenance
215
+ memorySize: 256
216
+ timeout: 10
217
+ events:
218
+ - http:
219
+ path: ${self:custom.functionPrefix}tickets/add
220
+ method: post
221
+ cors:
222
+ origin: '*'
223
+ headers:
224
+ - Content-Type
225
+ - authkey
226
+ editTicketStatus:
227
+ handler: ticketing/editTicketStatus.editTicketStatus
228
+ tags: maintenance
229
+ memorySize: 256
230
+ timeout: 10
231
+ events:
232
+ - http:
233
+ path: ${self:custom.functionPrefix}tickets/status
234
+ method: post
235
+ cors:
236
+ origin: '*'
237
+ headers:
238
+ - Content-Type
239
+ - authkey
240
+ deleteTicket:
241
+ handler: ticketing/deleteTicket.deleteTicket
242
+ tags: maintenance
243
+ memorySize: 256
244
+ timeout: 10
245
+ events:
246
+ - http:
247
+ path: ${self:custom.functionPrefix}tickets/delete
248
+ method: post
249
+ cors:
250
+ origin: '*'
251
+ headers:
252
+ - Content-Type
253
+ - authkey
254
+ getTickets:
255
+ handler: ticketing/getTickets.getTickets
256
+ tags: maintenance
257
+ memorySize: 256
258
+ timeout: 10
259
+ events:
260
+ - http:
261
+ path: ${self:custom.functionPrefix}tickets/get
262
+ method: get
263
+ cors:
264
+ origin: '*'
265
+ headers:
266
+ - Content-Type
267
+ - authkey
268
+ getTicket:
269
+ handler: ticketing/getTicket.getTicket
270
+ tags: maintenance
271
+ memorySize: 256
272
+ timeout: 10
273
+ events:
274
+ - http:
275
+ path: ${self:custom.functionPrefix}tickets/get/{id}
276
+ method: get
277
+ cors:
278
+ origin: '*'
279
+ headers:
280
+ - Content-Type
281
+ - authkey
282
+ jobChanged:
283
+ handler: jobChanged.jobChanged
284
+ memorySize: 2048
285
+ timeout: 30
286
+ events:
287
+ - stream:
288
+ type: dynamodb
289
+ batchSize: 1
290
+ startingPosition: LATEST
291
+ arn:
292
+ Fn::GetAtt:
293
+ - maintenance
294
+ - StreamArn
295
+ resources:
296
+ Resources:
297
+ jobtypes:
298
+ Type: "AWS::DynamoDB::Table"
299
+ DeletionPolicy: Retain
300
+ Properties:
301
+ AttributeDefinitions:
302
+ - AttributeName: id
303
+ AttributeType: S
304
+ - AttributeName: site
305
+ AttributeType: S
306
+ - AttributeName: typeName
307
+ AttributeType: S
308
+ KeySchema:
309
+ - AttributeName: id
310
+ KeyType: HASH
311
+ TableName: ${self:custom.tablePrefix}jobTypes
312
+ BillingMode: PAY_PER_REQUEST
313
+ PointInTimeRecoverySpecification:
314
+ PointInTimeRecoveryEnabled: true
315
+ StreamSpecification:
316
+ StreamViewType: NEW_AND_OLD_IMAGES
317
+ GlobalSecondaryIndexes:
318
+ - IndexName: JobTypeSiteIndex
319
+ KeySchema:
320
+ - AttributeName: site
321
+ KeyType: HASH
322
+ - AttributeName: typeName
323
+ KeyType: RANGE
324
+ Projection:
325
+ ProjectionType: ALL
326
+ maintenance:
327
+ Type: "AWS::DynamoDB::Table"
328
+ DeletionPolicy: Retain
329
+ Properties:
330
+ AttributeDefinitions:
331
+ - AttributeName: id
332
+ AttributeType: S
333
+ - AttributeName: site
334
+ AttributeType: S
335
+ - AttributeName: jobId
336
+ AttributeType: S
337
+ KeySchema:
338
+ - AttributeName: id
339
+ KeyType: HASH
340
+ TableName: ${self:custom.tablePrefix}maintenance
341
+ BillingMode: PAY_PER_REQUEST
342
+ PointInTimeRecoverySpecification:
343
+ PointInTimeRecoveryEnabled: true
344
+ StreamSpecification:
345
+ StreamViewType: NEW_AND_OLD_IMAGES
346
+ GlobalSecondaryIndexes:
347
+ - IndexName: MaintenanceSiteIndex
348
+ KeySchema:
349
+ - AttributeName: site
350
+ KeyType: HASH
351
+ Projection:
352
+ ProjectionType: ALL
353
+ - IndexName: MaintenanceSiteJobIdIndex
354
+ KeySchema:
355
+ - AttributeName: site
356
+ KeyType: HASH
357
+ - AttributeName: jobId
358
+ KeyType: RANGE
359
+ Projection:
360
+ ProjectionType: ALL
361
+ supporttickets:
362
+ Type: "AWS::DynamoDB::Table"
363
+ DeletionPolicy: Retain
364
+ Properties:
365
+ AttributeDefinitions:
366
+ - AttributeName: Id
367
+ AttributeType: S
368
+ - AttributeName: Site
369
+ AttributeType: S
370
+ - AttributeName: Status
371
+ AttributeType: S
372
+ KeySchema:
373
+ - AttributeName: Id
374
+ KeyType: HASH
375
+ TableName: ${self:custom.tablePrefix}supporttickets
376
+ BillingMode: PAY_PER_REQUEST
377
+ PointInTimeRecoverySpecification:
378
+ PointInTimeRecoveryEnabled: true
379
+ StreamSpecification:
380
+ StreamViewType: NEW_AND_OLD_IMAGES
381
+ GlobalSecondaryIndexes:
382
+ - IndexName: TicketsSiteStatusIndex
383
+ KeySchema:
384
+ - AttributeName: Site
385
+ KeyType: HASH
386
+ - AttributeName: Status
387
+ KeyType: RANGE
388
+ Projection:
389
+ ProjectionType: ALL
390
+