@axcode/axcloud-sdk 0.2.0-dev.1e6c3d5 → 0.2.0-dev.5dc7e06
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/README.md +67 -0
- package/dist/barnsport.d.mts +39 -0
- package/dist/barnsport.d.ts +39 -0
- package/dist/barnsport.js +73 -0
- package/dist/barnsport.js.map +1 -0
- package/dist/barnsport.mjs +4 -0
- package/dist/barnsport.mjs.map +1 -0
- package/dist/chunk-2IVJTMRB.js +519 -0
- package/dist/chunk-2IVJTMRB.js.map +1 -0
- package/dist/chunk-7IPCZJ5Q.mjs +273 -0
- package/dist/chunk-7IPCZJ5Q.mjs.map +1 -0
- package/dist/chunk-7K5N3DQ4.js +231 -0
- package/dist/chunk-7K5N3DQ4.js.map +1 -0
- package/dist/chunk-CACQMQCJ.mjs +506 -0
- package/dist/chunk-CACQMQCJ.mjs.map +1 -0
- package/dist/chunk-PMMCOWL3.mjs +223 -0
- package/dist/chunk-PMMCOWL3.mjs.map +1 -0
- package/dist/chunk-ZOQAXLCZ.js +290 -0
- package/dist/chunk-ZOQAXLCZ.js.map +1 -0
- package/dist/client-FOpKwe3e.d.mts +75 -0
- package/dist/client-FOpKwe3e.d.ts +75 -0
- package/dist/index.d.mts +41 -819
- package/dist/index.d.ts +41 -819
- package/dist/index.js +130 -889
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -839
- package/dist/index.mjs.map +1 -1
- package/dist/public.d.mts +27 -0
- package/dist/public.d.ts +27 -0
- package/dist/public.js +131 -0
- package/dist/public.js.map +1 -0
- package/dist/public.mjs +99 -0
- package/dist/public.mjs.map +1 -0
- package/dist/useBarnsport-C6uDSuHf.d.mts +583 -0
- package/dist/useBarnsport-C6uDSuHf.d.ts +583 -0
- package/dist/useContent-1WbKvPY4.d.mts +508 -0
- package/dist/useContent-Cl7dvERE.d.ts +508 -0
- package/package.json +15 -5
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AxCloud API Client
|
|
3
|
+
*
|
|
4
|
+
* Fetch wrapper with authentication header injection and error handling.
|
|
5
|
+
*/
|
|
6
|
+
interface ClientConfig {
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
getAccessToken?: () => Promise<string | undefined>;
|
|
9
|
+
/** API key for public content endpoints */
|
|
10
|
+
apiKey?: string;
|
|
11
|
+
/** Default request timeout in milliseconds (default: 30000) */
|
|
12
|
+
timeout?: number;
|
|
13
|
+
}
|
|
14
|
+
interface RequestOptions extends Omit<RequestInit, 'body'> {
|
|
15
|
+
body?: unknown;
|
|
16
|
+
params?: Record<string, string | number | boolean | undefined>;
|
|
17
|
+
/** Request timeout in milliseconds (overrides client default) */
|
|
18
|
+
timeout?: number;
|
|
19
|
+
}
|
|
20
|
+
declare class AxCloudClient {
|
|
21
|
+
private baseUrl;
|
|
22
|
+
private getAccessToken?;
|
|
23
|
+
private apiKey?;
|
|
24
|
+
private defaultTimeout;
|
|
25
|
+
constructor(config: ClientConfig);
|
|
26
|
+
/**
|
|
27
|
+
* Update the access token getter (used when auth state changes)
|
|
28
|
+
*/
|
|
29
|
+
setAccessTokenGetter(getter: () => Promise<string | undefined>): void;
|
|
30
|
+
/**
|
|
31
|
+
* Build URL with query parameters
|
|
32
|
+
*/
|
|
33
|
+
private buildUrl;
|
|
34
|
+
/**
|
|
35
|
+
* API key should only be sent to public endpoints.
|
|
36
|
+
* This avoids leaking public keys to authenticated/internal routes.
|
|
37
|
+
*/
|
|
38
|
+
private shouldAttachApiKey;
|
|
39
|
+
/**
|
|
40
|
+
* Make an authenticated request
|
|
41
|
+
*/
|
|
42
|
+
request<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
43
|
+
/**
|
|
44
|
+
* GET request
|
|
45
|
+
*/
|
|
46
|
+
get<T>(path: string, params?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
47
|
+
/**
|
|
48
|
+
* POST request
|
|
49
|
+
*/
|
|
50
|
+
post<T>(path: string, body?: unknown): Promise<T>;
|
|
51
|
+
/**
|
|
52
|
+
* PUT request
|
|
53
|
+
*/
|
|
54
|
+
put<T>(path: string, body?: unknown): Promise<T>;
|
|
55
|
+
/**
|
|
56
|
+
* PATCH request
|
|
57
|
+
*/
|
|
58
|
+
patch<T>(path: string, body?: unknown): Promise<T>;
|
|
59
|
+
/**
|
|
60
|
+
* DELETE request
|
|
61
|
+
*/
|
|
62
|
+
delete<T>(path: string): Promise<T>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Create a client instance associated with a key (typically the provider instance)
|
|
66
|
+
* This allows multiple AxCloudProviders to coexist without conflicts
|
|
67
|
+
*/
|
|
68
|
+
declare function createClient(config: ClientConfig, key?: object): AxCloudClient;
|
|
69
|
+
/**
|
|
70
|
+
* Get a client instance by key
|
|
71
|
+
* @deprecated Use the client from useAxCloudContext() instead
|
|
72
|
+
*/
|
|
73
|
+
declare function getClient(key?: object): AxCloudClient;
|
|
74
|
+
|
|
75
|
+
export { AxCloudClient as A, createClient as c, getClient as g };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AxCloud API Client
|
|
3
|
+
*
|
|
4
|
+
* Fetch wrapper with authentication header injection and error handling.
|
|
5
|
+
*/
|
|
6
|
+
interface ClientConfig {
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
getAccessToken?: () => Promise<string | undefined>;
|
|
9
|
+
/** API key for public content endpoints */
|
|
10
|
+
apiKey?: string;
|
|
11
|
+
/** Default request timeout in milliseconds (default: 30000) */
|
|
12
|
+
timeout?: number;
|
|
13
|
+
}
|
|
14
|
+
interface RequestOptions extends Omit<RequestInit, 'body'> {
|
|
15
|
+
body?: unknown;
|
|
16
|
+
params?: Record<string, string | number | boolean | undefined>;
|
|
17
|
+
/** Request timeout in milliseconds (overrides client default) */
|
|
18
|
+
timeout?: number;
|
|
19
|
+
}
|
|
20
|
+
declare class AxCloudClient {
|
|
21
|
+
private baseUrl;
|
|
22
|
+
private getAccessToken?;
|
|
23
|
+
private apiKey?;
|
|
24
|
+
private defaultTimeout;
|
|
25
|
+
constructor(config: ClientConfig);
|
|
26
|
+
/**
|
|
27
|
+
* Update the access token getter (used when auth state changes)
|
|
28
|
+
*/
|
|
29
|
+
setAccessTokenGetter(getter: () => Promise<string | undefined>): void;
|
|
30
|
+
/**
|
|
31
|
+
* Build URL with query parameters
|
|
32
|
+
*/
|
|
33
|
+
private buildUrl;
|
|
34
|
+
/**
|
|
35
|
+
* API key should only be sent to public endpoints.
|
|
36
|
+
* This avoids leaking public keys to authenticated/internal routes.
|
|
37
|
+
*/
|
|
38
|
+
private shouldAttachApiKey;
|
|
39
|
+
/**
|
|
40
|
+
* Make an authenticated request
|
|
41
|
+
*/
|
|
42
|
+
request<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
43
|
+
/**
|
|
44
|
+
* GET request
|
|
45
|
+
*/
|
|
46
|
+
get<T>(path: string, params?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
47
|
+
/**
|
|
48
|
+
* POST request
|
|
49
|
+
*/
|
|
50
|
+
post<T>(path: string, body?: unknown): Promise<T>;
|
|
51
|
+
/**
|
|
52
|
+
* PUT request
|
|
53
|
+
*/
|
|
54
|
+
put<T>(path: string, body?: unknown): Promise<T>;
|
|
55
|
+
/**
|
|
56
|
+
* PATCH request
|
|
57
|
+
*/
|
|
58
|
+
patch<T>(path: string, body?: unknown): Promise<T>;
|
|
59
|
+
/**
|
|
60
|
+
* DELETE request
|
|
61
|
+
*/
|
|
62
|
+
delete<T>(path: string): Promise<T>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Create a client instance associated with a key (typically the provider instance)
|
|
66
|
+
* This allows multiple AxCloudProviders to coexist without conflicts
|
|
67
|
+
*/
|
|
68
|
+
declare function createClient(config: ClientConfig, key?: object): AxCloudClient;
|
|
69
|
+
/**
|
|
70
|
+
* Get a client instance by key
|
|
71
|
+
* @deprecated Use the client from useAxCloudContext() instead
|
|
72
|
+
*/
|
|
73
|
+
declare function getClient(key?: object): AxCloudClient;
|
|
74
|
+
|
|
75
|
+
export { AxCloudClient as A, createClient as c, getClient as g };
|