Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
maguimarijuan committed Apr 30, 2020
1 parent a84c01b commit f9ae70d
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 87 deletions.
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,
"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'

0 comments on commit f9ae70d

Please sign in to comment.