@edifice.io/rest-client-base 2.5.4-feat-ENABLING-562.20251216132919 → 2.5.4-feat-ENABLING-562.20251216141508
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/node/cli.js +54 -0
- package/package.json +8 -4
- package/dist/browser/src/client/adapters/fetch-adapter.d.ts +0 -12
- package/dist/browser/src/client/adapters/http-adapter.d.ts +0 -8
- package/dist/browser/src/client/adapters/http-service-adapter.d.ts +0 -14
- package/dist/browser/src/client/base-api.client.d.ts +0 -29
- package/dist/browser/src/client/errors/api-error.d.ts +0 -11
- package/dist/browser/src/client/index.d.ts +0 -5
- package/dist/browser/src/decorators/custom-type.decorator.browser.d.ts +0 -3
- package/dist/browser/src/decorators/custom-type.decorator.node.d.ts +0 -3
- package/dist/browser/src/index.d.ts +0 -2
- package/dist/browser/tsconfig.browser.tsbuildinfo +0 -1
- package/dist/browser/vite.config.browser.d.ts +0 -2
- package/dist/browser/vite.config.node.d.ts +0 -2
- package/dist/browser/vite.config.react-native.d.ts +0 -2
- package/dist/node/src/client/adapters/fetch-adapter.d.ts +0 -12
- package/dist/node/src/client/adapters/http-adapter.d.ts +0 -8
- package/dist/node/src/client/adapters/http-service-adapter.d.ts +0 -14
- package/dist/node/src/client/base-api.client.d.ts +0 -29
- package/dist/node/src/client/errors/api-error.d.ts +0 -11
- package/dist/node/src/client/index.d.ts +0 -5
- package/dist/node/src/decorators/custom-type.decorator.browser.d.ts +0 -3
- package/dist/node/src/decorators/custom-type.decorator.node.d.ts +0 -3
- package/dist/node/src/index.d.ts +0 -2
- package/dist/node/tsconfig.tsbuildinfo +0 -1
- package/dist/node/vite.config.browser.d.ts +0 -2
- package/dist/node/vite.config.node.d.ts +0 -2
- package/dist/node/vite.config.react-native.d.ts +0 -2
- package/dist/react-native/src/client/adapters/fetch-adapter.d.ts +0 -12
- package/dist/react-native/src/client/adapters/http-adapter.d.ts +0 -8
- package/dist/react-native/src/client/adapters/http-service-adapter.d.ts +0 -14
- package/dist/react-native/src/client/base-api.client.d.ts +0 -29
- package/dist/react-native/src/client/errors/api-error.d.ts +0 -11
- package/dist/react-native/src/client/index.d.ts +0 -5
- package/dist/react-native/src/decorators/custom-type.decorator.browser.d.ts +0 -3
- package/dist/react-native/src/decorators/custom-type.decorator.node.d.ts +0 -3
- package/dist/react-native/src/index.d.ts +0 -2
- package/dist/react-native/tsconfig.browser.tsbuildinfo +0 -1
- package/dist/react-native/vite.config.browser.d.ts +0 -2
- package/dist/react-native/vite.config.node.d.ts +0 -2
- package/dist/react-native/vite.config.react-native.d.ts +0 -2
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { HttpAdapter } from './http-adapter';
|
|
2
|
-
export declare class FetchAdapter implements HttpAdapter {
|
|
3
|
-
private readonly fetchImpl;
|
|
4
|
-
constructor(fetchImpl?: typeof fetch);
|
|
5
|
-
private handleResponse;
|
|
6
|
-
get<T>(url: string, headers?: Record<string, string>): Promise<T>;
|
|
7
|
-
post<T>(url: string, body: unknown, headers?: Record<string, string>): Promise<T>;
|
|
8
|
-
put<T>(url: string, body: unknown, headers?: Record<string, string>): Promise<T>;
|
|
9
|
-
patch<T>(url: string, body: unknown, headers?: Record<string, string>): Promise<T>;
|
|
10
|
-
delete<T>(url: string, headers?: Record<string, string>): Promise<T>;
|
|
11
|
-
deleteWithBody<T>(url: string, body: unknown, headers?: Record<string, string>): Promise<T>;
|
|
12
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export interface HttpAdapter {
|
|
2
|
-
get<T>(url: string, headers?: Record<string, string>): Promise<T>;
|
|
3
|
-
post<T>(url: string, body: unknown, headers?: Record<string, string>): Promise<T>;
|
|
4
|
-
put<T>(url: string, body: unknown, headers?: Record<string, string>): Promise<T>;
|
|
5
|
-
patch<T>(url: string, body: unknown, headers?: Record<string, string>): Promise<T>;
|
|
6
|
-
delete<T>(url: string, headers?: Record<string, string>): Promise<T>;
|
|
7
|
-
deleteWithBody<T>(url: string, body: unknown, headers?: Record<string, string>): Promise<T>;
|
|
8
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { odeServices } from '@edifice.io/client';
|
|
2
|
-
import { HttpAdapter } from './http-adapter';
|
|
3
|
-
type HttpService = ReturnType<typeof odeServices.http>;
|
|
4
|
-
export declare class HttpServiceAdapter implements HttpAdapter {
|
|
5
|
-
private readonly httpService;
|
|
6
|
-
constructor(httpService: HttpService);
|
|
7
|
-
get<T>(url: string, headers?: Record<string, string>): Promise<T>;
|
|
8
|
-
post<T>(url: string, body: unknown, headers?: Record<string, string>): Promise<T>;
|
|
9
|
-
put<T>(url: string, body: unknown, headers?: Record<string, string>): Promise<T>;
|
|
10
|
-
patch<T>(url: string, body: unknown, headers?: Record<string, string>): Promise<T>;
|
|
11
|
-
delete<T>(url: string, headers?: Record<string, string>): Promise<T>;
|
|
12
|
-
deleteWithBody<T>(url: string, body: unknown, headers?: Record<string, string>): Promise<T>;
|
|
13
|
-
}
|
|
14
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { HttpAdapter } from './adapters/http-adapter';
|
|
2
|
-
import type { odeServices } from '@edifice.io/client';
|
|
3
|
-
type HttpService = ReturnType<typeof odeServices.http>;
|
|
4
|
-
export type FetchFunction = typeof fetch;
|
|
5
|
-
export interface ApiClientOptions {
|
|
6
|
-
baseUrl?: string;
|
|
7
|
-
defaultHeaders?: Record<string, string>;
|
|
8
|
-
fetchImpl?: typeof fetch;
|
|
9
|
-
httpService?: HttpService;
|
|
10
|
-
httpAdapter?: HttpAdapter;
|
|
11
|
-
}
|
|
12
|
-
export interface RequestOptions {
|
|
13
|
-
headers?: Record<string, string>;
|
|
14
|
-
}
|
|
15
|
-
export declare abstract class BaseApiClient {
|
|
16
|
-
protected readonly baseUrl: string;
|
|
17
|
-
protected readonly defaultHeaders: Record<string, string>;
|
|
18
|
-
protected readonly httpAdapter: HttpAdapter;
|
|
19
|
-
constructor(options?: ApiClientOptions);
|
|
20
|
-
protected get<T>(endpoint: string, queryParams?: URLSearchParams, options?: RequestOptions): Promise<T>;
|
|
21
|
-
protected post<T, U = unknown>(endpoint: string, body: U, queryParams?: URLSearchParams, options?: RequestOptions): Promise<T>;
|
|
22
|
-
protected put<T, U = unknown>(endpoint: string, body: U, queryParams?: URLSearchParams, options?: RequestOptions): Promise<T>;
|
|
23
|
-
protected patch<T, U = unknown>(endpoint: string, body: U, queryParams?: URLSearchParams, options?: RequestOptions): Promise<T>;
|
|
24
|
-
protected delete<T = void>(endpoint: string, queryParams?: URLSearchParams, options?: RequestOptions): Promise<T>;
|
|
25
|
-
protected deleteWithBody<T, U = unknown>(endpoint: string, body: U, queryParams?: URLSearchParams, options?: RequestOptions): Promise<T>;
|
|
26
|
-
protected buildUrl(endpoint: string, queryParams?: URLSearchParams): string;
|
|
27
|
-
protected buildHeaders(additionalHeaders?: Record<string, string>): Record<string, string>;
|
|
28
|
-
}
|
|
29
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare class ApiError extends Error {
|
|
2
|
-
private _response;
|
|
3
|
-
private _jsonData;
|
|
4
|
-
private _textData;
|
|
5
|
-
constructor(response: Response, message?: string);
|
|
6
|
-
response(): Response;
|
|
7
|
-
status(): number;
|
|
8
|
-
statusText(): string;
|
|
9
|
-
json(): Promise<unknown>;
|
|
10
|
-
text(): Promise<string>;
|
|
11
|
-
}
|