Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug #3

Merged
merged 2 commits into from
May 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ module.exports = helper({
...functions,
...clientFunctions
]
}, {
package: {
include: [
// your packages
]
}
});
```
:warning: If they exist, delete the functions from the `./serverless/functions.json` file.
Expand All @@ -103,15 +97,14 @@ At ` ./schemas/event-listeners/id/client` add this file:
At ` ./events/src/id/` add this file:
- [client.yml](schemas/client.yml)


Finally, create or update `./.nycrc` to avoid coverage leaks:
```
{
"exclude": [
//... your files
src/event-listeners/id/client/created.js
src/models/client.js,
src/api/client/post.js
"src/event-listeners/id/client/created.js",
"src/models/client.js,
maguimarijuan marked this conversation as resolved.
Show resolved Hide resolved
"src/api/client/post.js"
]
}
```
Expand Down
2 changes: 1 addition & 1 deletion lib/client-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const path = require('path');

const modelPath = path.join(process.env.MS_PATH || '', 'models', 'client');
const modelPath = path.join(process.env.MS_PATH || '', 'models', 'client.js');

module.exports = [

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions schemas/base.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
components:

schemas:
schemas:

Clients:
description: The new clients to create
type: object
properties:
clients:
description: The client codes array
type: array
items:
description: The client code
type: string
readOnly: true
example:
clients:
- 'some-client'
- 'other-client'
Clients:
description: The new clients to create
type: object
properties:
clients:
description: The client codes array
type: array
items:
description: The client code
type: string
readOnly: true
example:
clients:
- 'some-client'
- 'other-client'
4 changes: 2 additions & 2 deletions schemas/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
entity: client
event: created
listeners:
- namespace: client
method: created-listener
- namespace: id-client
method: created-listener
60 changes: 30 additions & 30 deletions schemas/create.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
paths:

/client:
post:
x-janis-namespace: client
x-janis-method: create
operationId: createClient
tags:
- Client
summary: Create a new client
security:
- ApiKey: []
ApiSecret: []
requestBody:
description: The clients to create
required: true
/client:
post:
x-janis-namespace: client
x-janis-method: create
operationId: createClient
tags:
- Client
summary: Create a new client
security:
- ApiKey: []
ApiSecret: []
requestBody:
description: The clients to create
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Clients"
responses:
"200":
description: Client created
content:
application/json:
schema:
$ref: "#/components/schemas/Clients"
responses:
"200":
description: Client created
content:
application/json:
schema:
type: object
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"500":
$ref: "#/components/responses/InternalError"
type: object
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"500":
$ref: "#/components/responses/InternalError"
54 changes: 27 additions & 27 deletions schemas/created.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
paths:
/listener/client/created:
post:
x-janis-namespace: client
x-janis-method: created-listener
tags:
- Client
summary: Client created event listener
security:
- ApiKey: []
ApiSecret: []
description: Client created event listener
operationId: clientCreatedListener
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/listenerEvent'
responses:
'200':
$ref: '#/components/responses/GenericSuccess'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
/listener/id/client/created:
post:
x-janis-namespace: id-client
x-janis-method: created-listener
tags:
- Client
summary: Client created event listener
security:
- ApiKey: []
ApiSecret: []
description: Client created event listener
operationId: clientCreatedListener
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/listenerEvent'
responses:
'200':
$ref: '#/components/responses/GenericSuccess'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'