Uh oh!
There was an error while loading. Please reload this page.
feat: support for making installation string generation dynamic - #269
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| } | ||
| const { installation } = target.clientsById[clientId || target.info.default]; | ||
| const results = this.requests.map(request => (installation ? installation(request, options) : false)); |
There was a problem hiding this comment.
i don't totally follow why this is an array. is it because you can pass several HAR files into this library?
There was a problem hiding this comment.
yeah that's correct. it's not something we've ever done and is just holdoverr from upstream
kanadgupta
left a comment
There was a problem hiding this comment.
looks great ty! reminder to publish this as a breaking change
| expect(result).toBe('This was generated from a custom client.'); | ||
| const install = snippet.installation('node', 'custom')[0]; | ||
| expect(install).toBe('brew install https://httpbin.org/anything'); |
| return results; | ||
| } | ||
| installation(targetId: TargetId, clientId?: ClientId, options?: any) { |
There was a problem hiding this comment.
sorry one more thing — wanna make this return type a little stricter?
| installation(targetId: TargetId,clientId?: ClientId,options?: any){ | |
| installation(targetId: TargetId,clientId?: ClientId,options?: any): (string|false)[]{ |
There was a problem hiding this comment.
the inferred type is a little messy atm:
HTTPSnippet.installation(targetId: TargetId, clientId?: ClientId, options?: any): (string | false)[] | boolean[]
There was a problem hiding this comment.
going to do isolateddeclarations in a followup
🧰 Changes
We're working on some enhancements for HTTP snippet generation for external partners and need to make plugin installation strings dynamic -- this reworks how
installationis set up on a client basis to allow for this.