sls-helper-plugin-janis
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -9,2 +9,10 @@ # Changelog | ||
## [1.2.0] - 2019-12-26 | ||
### Added | ||
- `apiSecrets` configuration in base hook | ||
- Sample service example in README | ||
### Fixed | ||
- `base` documentation updated with required fields | ||
## [1.1.0] - 2019-12-25 | ||
@@ -11,0 +19,0 @@ ### Changed |
@@ -5,3 +5,3 @@ 'use strict'; | ||
module.exports = ({ provider, custom, package: slsPackage, ...serviceConfig }, { serviceName, servicePort }) => { | ||
module.exports = ({ provider, custom, package: slsPackage, ...serviceConfig }, { serviceName, servicePort, apiSecrets }) => { | ||
@@ -112,6 +112,6 @@ if(!serviceName || typeof serviceName !== 'string') | ||
serviceApiSecret: { | ||
local: '', | ||
beta: '', | ||
qa: '', | ||
prod: '' | ||
local: (apiSecrets && apiSecrets.local) || '', | ||
beta: (apiSecrets && apiSecrets.beta) || '', | ||
qa: (apiSecrets && apiSecrets.qa) || '', | ||
prod: (apiSecrets && apiSecrets.prod) || '' | ||
}, | ||
@@ -118,0 +118,0 @@ |
{ | ||
"name": "sls-helper-plugin-janis", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "A Serverless Helper plugin to add custom helpers for JANIS Commerce", | ||
@@ -5,0 +5,0 @@ "main": "lib/plugin.js", |
@@ -14,2 +14,4 @@ # Serverless Helper Plugin JANIS | ||
| serviceName | string | The service name | **Required** | | | ||
| servicePort | number | The service port | **Required** | | | ||
| apiSecrets | Object | A mapping of stages to Service API Secret | | `undefined` | | ||
@@ -92,1 +94,65 @@ ### templates | ||
| listenersDirName | string | Indicates the path where the event listener files are placed | | 'event-listeners' | | ||
## Examples | ||
### Basic Service with one CRUD operation set and an event listener | ||
```js | ||
// serverless.js | ||
'use strict'; | ||
const { helper } = require('sls-helper'); // eslint-disable-line | ||
module.exports = helper({ | ||
hooks: [ | ||
['janis.base', { | ||
serviceName: 'Catalog', | ||
servicePort: 5000, | ||
apiSecrets: { | ||
beta: 'foo', | ||
qa: 'bar', | ||
prod: 'baz' | ||
} | ||
}], | ||
'janis.templates', | ||
'janis.authorizers', | ||
'janis.cors', | ||
['janis.apiList', { | ||
entityName: 'product', | ||
authorizer: 'FullAuthorizer', | ||
cors: true | ||
}], | ||
['janis.apiGet', { | ||
entityName: 'product', | ||
authorizer: 'FullAuthorizer', | ||
cors: true | ||
}] | ||
['janis.apiPost', { | ||
entityName: 'product', | ||
authorizer: 'FullAuthorizer', | ||
cors: true | ||
}], | ||
['janis.apiPut', { | ||
entityName: 'product', | ||
authorizer: 'FullAuthorizer', | ||
cors: true | ||
}], | ||
['janis.eventListener', { | ||
entityName: 'product', | ||
eventName: 'created', | ||
mustHaveClient: true | ||
}] | ||
] | ||
}, {}); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26112
156