forked from novuhq/novu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(framework): add first five schemas for providers (novuhq#6039)
Co-authored-by: Richard Fontein <[email protected]>
- Loading branch information
1 parent
d5a7f29
commit 7a65b6f
Showing
30 changed files
with
3,197 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Devtool | ||
|
||
`devtool.ts`, `schema_output.json` and `schema_input.json` is meant to be used to extract json schema object from openapi json. | ||
Put you openapi json in `schema_input.json` and change line 9 in `devtool.ts` to the path where the schema object you need are located. run `npm run devtool` and open `schema_output.json` and copy the result from there. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { writeFileSync } from 'fs'; | ||
|
||
import $RefParser from '@apidevtools/json-schema-ref-parser'; | ||
|
||
const main = async () => { | ||
const parser = new $RefParser(); | ||
const schema = await parser.dereference(__dirname + '/schema_input.json'); | ||
// Edit this path to target the JSON schema that the send message endpoint uses | ||
const body = schema['components']['schemas']['api.v2010.account.message']; | ||
writeFileSync(__dirname + '/schema_output.json', JSON.stringify(body, null, 2)); | ||
|
||
console.log('schema.json updated'); | ||
}; | ||
|
||
main(); |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -547,7 +547,11 @@ describe('Novu Client', () => { | |
} as const, | ||
providers: { | ||
sendgrid: async ({ controls, outputs }) => ({ | ||
ipPoolName: `${controls.foo} ${outputs.subject}`, | ||
ip_pool_name: `${controls.foo} ${outputs.subject}`, | ||
from: { | ||
email: '[email protected]', | ||
name: 'Test', | ||
}, | ||
}), | ||
}, | ||
}); | ||
|
@@ -571,7 +575,12 @@ describe('Novu Client', () => { | |
|
||
const executionResult = await client.executeWorkflow(event); | ||
|
||
expect(executionResult.providers).toEqual({ sendgrid: { ipPoolName: 'foo Subject' } }); | ||
expect(executionResult.providers).toEqual({ | ||
sendgrid: { | ||
ip_pool_name: 'foo Subject', | ||
from: { email: '[email protected]', name: 'Test' }, | ||
}, | ||
}); | ||
}); | ||
|
||
it('should preview with mocked payload during preview', async () => { | ||
|
Oops, something went wrong.