Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sls-helper-plugin-janis

Package Overview
Dependencies
Maintainers
1
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sls-helper-plugin-janis - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

8

CHANGELOG.md

@@ -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

10

lib/service/base.js

@@ -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
}]
]
}, {});
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc