-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: add batch request content #354
base: main
Are you sure you want to change the base?
Conversation
method: string; | ||
url: string; | ||
headers?: Record<string, string> | null; | ||
body?: Record<string, any> | null; |
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.
What if the body is a stream?
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.
@rkodev please avoid resolving conversation until a consensus has been reached. It makes progress much harder to track reviewers' side.
src/content/BatchRequestContent.ts
Outdated
const method = requestInformation.httpMethod?.toString(); | ||
|
||
return { | ||
id: createGuid(), |
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.
The user should still have the ability to pass in their own id, incase they want to use it retreive the response.
* @param {string} requestId - The request id value | ||
* @returns The Response object instance for the particular request | ||
*/ | ||
public getResponseById(requestId: string): BatchResponse | undefined { |
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 believe we are missing overloads that take in a parsablefactory or type parameter to deserialize the response body to the desired object type.
*/ | ||
private readonly errorMappings: ErrorMappings | undefined; | ||
|
||
constructor(requestAdapter: RequestAdapter, errorMappings?: ErrorMappings) { |
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.
missing doc comment for the constructor
* To get the iterator for the responses | ||
* @returns The Iterable generator for the response objects | ||
*/ | ||
public *getResponsesIterator(): IterableIterator<[string, BatchResponse]> { |
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.
public *getResponsesIterator(): IterableIterator<[string, BatchResponse]> { | |
public getResponsesIterator(): IterableIterator<[string, BatchResponse]> { |
Is this a typo? or a new syntax I don't know about?
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.
export interface BatchResponse { | ||
id: string; | ||
headers?: Record<string, string> | null; | ||
body?: ArrayBuffer | null; |
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.
once they get a batch response (item?), if the payload is structured/a parsable, how can they get from the body to the deseiralized payload?
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 believe this is a will be resolved by implementing #354 (comment) ?
Closes #5
Add support for batching