@mx-space/api-client 1.6.1 → 1.7.0

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.
@@ -31,7 +31,7 @@ export class AckController<ResponseWrapper> implements IController {
31
31
  }
32
32
 
33
33
  read(type: 'post' | 'note', id: string) {
34
- return this.proxy.ack.post<never>({
34
+ return this.proxy.post<never>({
35
35
  data: {
36
36
  type: 'read',
37
37
  payload: {
@@ -20,4 +20,4 @@ type IRequestAdapter<T = any, Response = undefined> = Readonly<(Response extends
20
20
  put<P = unknown>(url: string, options: Partial<RequestOptions>): IAdaptorRequestResponseType<P>;
21
21
  }>;
22
22
 
23
- export { IRequestAdapter as I, RequestOptions as R, IAdaptorRequestResponseType as a };
23
+ export type { IRequestAdapter as I, RequestOptions as R, IAdaptorRequestResponseType as a };
@@ -0,0 +1,23 @@
1
+ interface RequestOptions {
2
+ method?: string;
3
+ data?: Record<string, any>;
4
+ params?: Record<string, any> | URLSearchParams;
5
+ headers?: Record<string, string>;
6
+ [key: string]: any;
7
+ }
8
+
9
+ type IAdaptorRequestResponseType<P> = Promise<Record<string, any> & {
10
+ data: P;
11
+ }>;
12
+ type IRequestAdapter<T = any, Response = undefined> = Readonly<(Response extends undefined ? {} : {
13
+ responseWrapper: Response;
14
+ }) & {
15
+ default: T;
16
+ get<P = unknown>(url: string, options?: Omit<RequestOptions, 'data'>): IAdaptorRequestResponseType<P>;
17
+ post<P = unknown>(url: string, options: Partial<RequestOptions>): IAdaptorRequestResponseType<P>;
18
+ patch<P = unknown>(url: string, options: Partial<RequestOptions>): IAdaptorRequestResponseType<P>;
19
+ delete<P = unknown>(url: string, options?: Omit<RequestOptions, 'data'>): IAdaptorRequestResponseType<P>;
20
+ put<P = unknown>(url: string, options: Partial<RequestOptions>): IAdaptorRequestResponseType<P>;
21
+ }>;
22
+
23
+ export type { IRequestAdapter as I, RequestOptions as R, IAdaptorRequestResponseType as a };
@@ -1,4 +1,4 @@
1
- import { I as IRequestAdapter } from '../adapter-be44aa1e.js';
1
+ import { I as IRequestAdapter } from '../adapter-29diOMCR.cjs';
2
2
  import { AxiosInstance, AxiosResponse } from 'axios';
3
3
 
4
4
  declare const axiosAdaptor: IRequestAdapter<AxiosInstance, AxiosResponse<unknown>>;
@@ -1,4 +1,4 @@
1
- import { I as IRequestAdapter } from '../adapter-be44aa1e.js';
1
+ import { I as IRequestAdapter } from '../adapter-29diOMCR.js';
2
2
  import { AxiosInstance, AxiosResponse } from 'axios';
3
3
 
4
4
  declare const axiosAdaptor: IRequestAdapter<AxiosInstance, AxiosResponse<unknown>>;