@placeos/ts-client 4.2.3 → 4.2.4
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/http/functions.d.ts +1 -1
- package/dist/http/mock.d.ts +6 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1230 -1189
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/http/functions.ts +57 -23
- package/src/http/mock.ts +25 -11
package/dist/http/functions.d.ts
CHANGED
|
@@ -60,4 +60,4 @@ export declare function transform(resp: Response, type: HttpResponseType, header
|
|
|
60
60
|
* @param url URL of the request endpoint
|
|
61
61
|
* @param options Options to add to the request
|
|
62
62
|
*/
|
|
63
|
-
export declare function request(method: HttpVerb, url: string, options: HttpOptions, is_mock?: () => boolean, mock_handler?: (m: HttpVerb, url: string, body?: any) => Observable<
|
|
63
|
+
export declare function request(method: HttpVerb, url: string, options: HttpOptions, is_mock?: () => boolean, mock_handler?: (m: HttpVerb, url: string, body?: any) => Observable<HashMap | string | void> | null, success?: (e: Response, t: HttpResponseType) => Promise<HttpResponse>): Observable<HttpResponse>;
|
package/dist/http/mock.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare function clearMockEndpoints(handler_map?: HashMap<MockHttpRequest
|
|
|
32
32
|
* @param handler_map Handler map to query for the request handler.
|
|
33
33
|
* Defaults to the global handler map
|
|
34
34
|
*/
|
|
35
|
-
export declare function mockRequest
|
|
35
|
+
export declare function mockRequest(method: HttpVerb, url: string, body?: any, handler_map?: HashMap<MockHttpRequestHandler>): Observable<HashMap | string | void> | null;
|
|
36
36
|
/**
|
|
37
37
|
* @private
|
|
38
38
|
* Find a request handler for the given URL and method
|
|
@@ -55,3 +55,8 @@ export declare function processRequest<T = any>(url: string, handler: MockHttpRe
|
|
|
55
55
|
* @param request Request contents
|
|
56
56
|
*/
|
|
57
57
|
export declare function onMockRequest(handler: MockHttpRequestHandler, request: MockHttpRequest): Observable<any>;
|
|
58
|
+
/**
|
|
59
|
+
* Get a list of the method + endpoints that have been mocked
|
|
60
|
+
* @returns List of the method + endpoint that have been mocked
|
|
61
|
+
*/
|
|
62
|
+
export declare function listMockedEndpoints(): string[];
|