@rlyle1179/serverless-aws-batch 1.0.26 → 1.0.30

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/index.js CHANGED
@@ -51,6 +51,10 @@ class ServerlessAWSBatch {
51
51
  .then(batchenvironment.generateAWSBatchTemplate)
52
52
  .then(batchtask.compileBatchTasks),
53
53
 
54
+ 'after:aws:common:moveArtifactsToPackage:move': () => BbPromise.bind(this)
55
+ .then((e) => {
56
+ console.log("after:aws:common:moveArtifactsToPackage:move:", e );
57
+ }),
54
58
  'after:package:createDeploymentArtifacts': () => BbPromise.bind(this)
55
59
  .then(docker.buildDockerImage),
56
60
 
package/lib/schedule.js CHANGED
@@ -59,10 +59,17 @@ module.exports.schedule = (event, context, callback) => {
59
59
  batch.submitJob(params, function(err, data) {
60
60
  let response;
61
61
 
62
+ const jsonHeaders = {
63
+ 'Content-Type': 'application/json',
64
+ 'Access-Control-Allow-Origin': '*', // Required for CORS support to work
65
+ 'Access-Control-Allow-Credentials': true // Required for cookies, authorization headers with HTTPS
66
+ }
67
+
62
68
  if (err) {
63
69
  console.log(`Error submitting job: ${err}`, err.stack);
64
70
  response = {
65
71
  statusCode: 500,
72
+ headers: jsonHeaders,
66
73
  body: JSON.stringify({
67
74
  'error': err
68
75
  })
@@ -72,6 +79,7 @@ module.exports.schedule = (event, context, callback) => {
72
79
  console.log(`Submitted job: ${JSON.stringify(data, null, 2)}`);
73
80
  response = {
74
81
  statusCode: 200,
82
+ headers: jsonHeaders,
75
83
  body: JSON.stringify({
76
84
  data
77
85
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rlyle1179/serverless-aws-batch",
3
- "version": "1.0.26",
3
+ "version": "1.0.30",
4
4
  "description": "Serverless Framework Plugin for interacting with AWS Batch",
5
5
  "main": "index.js",
6
6
  "scripts": {