-
Notifications
You must be signed in to change notification settings - Fork 2
Enhance remote flow sources for CAP #201
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7e37342
Enhance remote flow sources for CAP
knewbury01 90457ae
Add adjusted expected files, forgot from prev commit
knewbury01 bb48b72
Revert accidental type change in CDS.qll
knewbury01 8658335
Apply review suggestions
knewbury01 71cabdd
Add missing expected file
knewbury01 f9ea162
Address review feedback RemoteFlowSources types
knewbury01 9912a37
Apply changes from review sync
knewbury01 22fb705
Add docs remoteflowsource cap
knewbury01 674fed2
Merge branch 'main' into knewbury01/fix-service-handler
jeongsoolee09 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
10 changes: 10 additions & 0 deletions
10
javascript/frameworks/cap/test/models/cds/remoteflowsources/remoteflowsource.expected
This file contains hidden or 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 |
---|---|---|
@@ -1,2 +1,12 @@ | ||
| srv/service1.js:6:29:6:31 | req | | ||
| srv/service2.js:5:27:5:29 | msg | | ||
| srv/service3nocds.js:6:43:6:45 | req | | ||
| srv/service3nocds.js:7:34:7:36 | req | | ||
| srv/service3nocds.js:11:28:11:30 | req | | ||
| srv/service3nocds.js:12:26:12:28 | req | | ||
| srv/service3nocds.js:19:34:19:36 | req | | ||
| srv/service4withcds.js:5:38:5:40 | req | | ||
| srv/service4withcds.js:6:43:6:45 | req | | ||
| srv/service4withcds.js:14:33:14:35 | req | | ||
| srv/service4withcds.js:15:38:15:40 | req | | ||
| srv/service4withcds.js:16:23:16:25 | req | |
This file contains hidden or 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
20 changes: 20 additions & 0 deletions
20
javascript/frameworks/cap/test/models/cds/remoteflowsources/srv/service3nocds.js
This file contains hidden or 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,20 @@ | ||
//this service unit test is a replica of requesthandler.js | ||
const cds = require("@sap/cds"); | ||
class BooksService extends cds.ApplicationService { | ||
init() { | ||
const { Books, Authors } = this.entities | ||
this.on('READ', [Books, Authors], req => req.target.data) //req | ||
this.on('UPDATE', Books, req => { //req | ||
let [ID] = req.params | ||
return Object.assign(Books.data[ID], req.data) | ||
}) | ||
this.after('READ', req => req.target.data) //req | ||
this.before('*', req => req.target.data) //req | ||
return super.init() | ||
} | ||
} | ||
module.exports = BooksService | ||
|
||
cds.serve('./test-service').with((srv) => { | ||
srv.before('READ', 'Books', (req) => req.reply([])) //req | ||
}) |
11 changes: 11 additions & 0 deletions
11
javascript/frameworks/cap/test/models/cds/remoteflowsources/srv/service4.cds
This file contains hidden or 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,11 @@ | ||
using { advanced_security.log_injection.sample_entities as db_schema } from '../db/schema'; | ||
|
||
service Service4 @(path: '/service-4') { | ||
/* Entity to send READ/GET about. */ | ||
entity Service4Entity as projection on db_schema.Entity4 excluding { Attribute4 } | ||
|
||
/* API to talk to other services. */ | ||
action send4 ( | ||
messageToPass: String | ||
) returns String; | ||
} |
17 changes: 17 additions & 0 deletions
17
javascript/frameworks/cap/test/models/cds/remoteflowsources/srv/service4withcds.js
This file contains hidden or 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,17 @@ | ||
const cds = require("@sap/cds"); | ||
|
||
class TestService extends cds.ApplicationService { | ||
init() { | ||
this.before('READ', 'Test', (req) => req.reply([])) //req | ||
this.after('READ', this.entities, req => req.target.data) //req | ||
return super.init() | ||
} | ||
} | ||
module.exports = TestService | ||
|
||
cds.serve('./test-service').with((srv) => { | ||
const { Test, Service4 } = this.entities | ||
srv.before('READ', 'Test', (req) => req.reply([])) //req | ||
srv.on('READ', [Test, Service4], req => req.target.data) //req | ||
srv.after('READ', req => req.target.data) //req | ||
}) |
4 changes: 3 additions & 1 deletion
4
javascript/frameworks/cap/test/models/cds/requesthandler/requesthandler.expected
This file contains hidden or 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
| requesthandler.js:5:43:5:45 | req | | ||
| requesthandler.js:6:34:6:36 | req | | ||
| requesthandler.js:16:34:16:36 | req | | ||
| requesthandler.js:10:28:10:30 | req | | ||
| requesthandler.js:11:26:11:28 | req | | ||
| requesthandler.js:18:34:18:36 | req | |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.