@azure/search-documents 11.3.0-alpha.20221107.1 → 11.3.0-alpha.20230123.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3336,8 +3336,11 @@ class SearchClient {
3336
3336
  const { span, updatedOptions } = createSpan("SearchClient-getDocumentsCount", options);
3337
3337
  try {
3338
3338
  let documentsCount = 0;
3339
- await this.client.documents.count(Object.assign(Object.assign({}, updatedOptions), { onResponse: (response) => {
3340
- documentsCount = Number(response.bodyAsText);
3339
+ await this.client.documents.count(Object.assign(Object.assign({}, updatedOptions), { onResponse: (rawResponse, flatResponse) => {
3340
+ documentsCount = Number(rawResponse.bodyAsText);
3341
+ if (updatedOptions.onResponse) {
3342
+ updatedOptions.onResponse(rawResponse, flatResponse);
3343
+ }
3341
3344
  } }));
3342
3345
  return documentsCount;
3343
3346
  }
@@ -3568,8 +3571,11 @@ class SearchClient {
3568
3571
  const { span, updatedOptions } = createSpan("SearchClient-indexDocuments", options);
3569
3572
  try {
3570
3573
  let status = 0;
3571
- const result = await this.client.documents.index({ actions: serialize(batch.actions) }, Object.assign(Object.assign({}, updatedOptions), { onResponse: (response) => {
3572
- status = response.status;
3574
+ const result = await this.client.documents.index({ actions: serialize(batch.actions) }, Object.assign(Object.assign({}, updatedOptions), { onResponse: (rawResponse, flatResponse) => {
3575
+ status = rawResponse.status;
3576
+ if (updatedOptions.onResponse) {
3577
+ updatedOptions.onResponse(rawResponse, flatResponse);
3578
+ }
3573
3579
  } }));
3574
3580
  if (options.throwOnAnyFailure && status === 207) {
3575
3581
  throw result;