-
Notifications
You must be signed in to change notification settings - Fork 9
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
Remove exchangeId from submit endpoint paths #182
Conversation
|
TBDocs Report 🛑 Errors: 0 @tbdex/protocol
@tbdex/http-client
@tbdex/http-server
TBDocs Report Updated at 2024-02-21T23:57:04Z |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #182 +/- ##
=======================================
Coverage 92.52% 92.52%
=======================================
Files 37 37
Lines 3011 3011
Branches 326 326
=======================================
Hits 2786 2786
Misses 225 225
|
@@ -77,7 +77,7 @@ describe('client', () => { | |||
expect(e.statusCode).to.exist | |||
expect(e.details).to.exist | |||
expect(e.recipientDid).to.equal(pfiDid.uri) | |||
expect(e.url).to.equal(`https://localhost:9000/exchanges/${rfq.metadata.exchangeId}/rfq`) | |||
expect(e.url).to.equal(`https://localhost:9000/exchanges/rfq`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for creating an exchange, this should be https://localhost:9000/exchanges
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(e.url).to.equal(`https://localhost:9000/exchanges/rfq`) | |
expect(e.url).to.equal(`https://localhost:9000/exchanges`) |
@@ -140,22 +140,22 @@ export class TbdexHttpServer { | |||
listen(port: number | string, callback?: () => void) { | |||
const { offeringsApi, exchangesApi, pfiDid } = this | |||
|
|||
this.api.post('/exchanges/:exchangeId/rfq', (req: Request, res: Response) => | |||
this.api.post('/exchanges/rfq', (req: Request, res: Response) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.api.post('/exchanges/rfq', (req: Request, res: Response) => | |
this.api.post('/exchanges', (req: Request, res: Response) => |
@@ -23,7 +23,7 @@ describe('POST /exchanges/:exchangeId/rfq', () => { | |||
}) | |||
|
|||
it('returns a 400 if no request body is provided', async () => { | |||
const resp = await fetch('http://localhost:8000/exchanges/123/rfq', { | |||
const resp = await fetch('http://localhost:8000/exchanges/rfq', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const resp = await fetch('http://localhost:8000/exchanges/rfq', { | |
const resp = await fetch('http://localhost:8000/exchanges', { |
@@ -38,7 +38,7 @@ describe('POST /exchanges/:exchangeId/rfq', () => { | |||
}) | |||
|
|||
it('returns a 400 if request body is not a valid json object', async () => { | |||
const resp = await fetch('http://localhost:8000/exchanges/123/rfq', { | |||
const resp = await fetch('http://localhost:8000/exchanges/rfq', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const resp = await fetch('http://localhost:8000/exchanges/rfq', { | |
const resp = await fetch('http://localhost:8000/exchanges', { |
@@ -59,7 +59,7 @@ describe('POST /exchanges/:exchangeId/rfq', () => { | |||
const rfq = await DevTools.createRfq({ sender: aliceDid, receiver: pfiDid }) | |||
await rfq.sign(aliceDid) | |||
|
|||
const resp = await fetch('http://localhost:8000/exchanges/123/rfq', { | |||
const resp = await fetch('http://localhost:8000/exchanges/rfq', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const resp = await fetch('http://localhost:8000/exchanges/rfq', { | |
const resp = await fetch('http://localhost:8000/exchanges', { |
@@ -198,7 +198,7 @@ describe('POST /exchanges/:exchangeId/rfq', () => { | |||
}) | |||
await rfq.sign(aliceDid) | |||
|
|||
const resp = await fetch('http://localhost:8000/exchanges/123/rfq', { | |||
const resp = await fetch('http://localhost:8000/exchanges/rfq', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const resp = await fetch('http://localhost:8000/exchanges/rfq', { | |
const resp = await fetch('http://localhost:8000/exchanges', { |
@@ -303,7 +303,7 @@ describe('POST /exchanges/:exchangeId/rfq', () => { | |||
}) | |||
|
|||
it('returns a 202 if RFQ is accepted', async () => { | |||
const resp = await fetch('http://localhost:8000/exchanges/123/rfq', { | |||
const resp = await fetch('http://localhost:8000/exchanges/rfq', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const resp = await fetch('http://localhost:8000/exchanges/rfq', { | |
const resp = await fetch('http://localhost:8000/exchanges', { |
@@ -318,7 +318,7 @@ describe('POST /exchanges/:exchangeId/rfq', () => { | |||
}) | |||
api.onSubmitRfq(callbackSpy) | |||
|
|||
const resp = await fetch('http://localhost:8000/exchanges/123/rfq', { | |||
const resp = await fetch('http://localhost:8000/exchanges/rfq', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const resp = await fetch('http://localhost:8000/exchanges/rfq', { | |
const resp = await fetch('http://localhost:8000/exchanges', { |
@@ -343,7 +343,7 @@ describe('POST /exchanges/:exchangeId/rfq', () => { | |||
|
|||
const replyTo = 'https://tbdex.io/example' | |||
|
|||
const resp = await fetch('http://localhost:8000/exchanges/123/rfq', { | |||
const resp = await fetch('http://localhost:8000/exchanges/rfq', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const resp = await fetch('http://localhost:8000/exchanges/rfq', { | |
const resp = await fetch('http://localhost:8000/exchanges', { |
const pfiServiceEndpoint = await TbdexHttpClient.getPfiServiceEndpoint(pfiDid) | ||
const apiRoute = `${pfiServiceEndpoint}/exchanges/${exchangeId}/${kind}` | ||
const apiRoute = `${pfiServiceEndpoint}/exchanges/${kind}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only add ${kind}
if not RFQ
Implements spec change TBD54566975/tbdex#243 TBD54566975/tbdex#225