@ahoo-wang/fetcher-wow 1.6.0 → 1.6.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.
@@ -1,7 +1,7 @@
1
1
  import { ClientOptions } from '../types';
2
2
  import { CommandRequest } from './commandRequest';
3
3
  import { CommandResult, CommandResultEventStream } from './commandResult';
4
- import { ResultExtractor } from '@ahoo-wang/fetcher';
4
+ import { RequestOptions } from '@ahoo-wang/fetcher';
5
5
  /**
6
6
  * Command Client for sending commands to the server.
7
7
  *
@@ -53,13 +53,15 @@ export declare class CommandClient {
53
53
  * @template R The type of the result to be returned
54
54
  * @param path - The endpoint path to send the command to
55
55
  * @param commandHttpRequest - The command HTTP request containing headers, method, and body
56
- * @param extractor - Function to extract the result from the response, defaults to JSON extractor
57
- * @param attributes - Optional shared attributes that can be accessed by interceptors
58
- * throughout the request lifecycle. These attributes allow passing
59
- * custom data between different interceptors.
56
+ * @param options - Request options including result extractor and attributes
57
+ * @param options.resultExtractor - Function to extract the desired result from the exchange.
58
+ * Defaults to ExchangeResultExtractor which returns the entire exchange object.
59
+ * @param options.attributes - Optional shared attributes that can be accessed by interceptors
60
+ * throughout the request lifecycle. These attributes allow passing
61
+ * custom data between different interceptors.
60
62
  * @returns A promise that resolves to the extracted result of type R
61
63
  */
62
- protected sendCommand<R>(path: string, commandHttpRequest: CommandRequest, extractor?: ResultExtractor<any>, attributes?: Record<string, any>): Promise<R>;
64
+ protected sendCommand<R>(path: string, commandHttpRequest: CommandRequest, options?: RequestOptions): Promise<R>;
63
65
  /**
64
66
  * Send a command to the server and wait for the result.
65
67
  *
@@ -1 +1 @@
1
- {"version":3,"file":"commandClient.d.ts","sourceRoot":"","sources":["../../src/command/commandClient.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACL,K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