@vulog/aima-client 1.0.8 → 1.0.10
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/index.d.mts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/package.json +2 -2
- package/src/getClient.ts +1 -0
- package/src/index.ts +2 -2
- package/src/types.ts +1 -0
package/dist/index.d.mts
CHANGED
|
@@ -14,11 +14,19 @@ type ClientOptions = {
|
|
|
14
14
|
onRefreshToken?: (refreshToken: string) => void;
|
|
15
15
|
onLog?: (...args: any[]) => void;
|
|
16
16
|
};
|
|
17
|
+
type ClientError = {
|
|
18
|
+
formattedError: {
|
|
19
|
+
status: number;
|
|
20
|
+
data: any;
|
|
21
|
+
};
|
|
22
|
+
originalError: any;
|
|
23
|
+
};
|
|
17
24
|
type Client = AxiosInstance & {
|
|
18
25
|
refreshToken?: string;
|
|
19
26
|
signInWithPassword: (username: string, password: string) => Promise<void>;
|
|
27
|
+
clientOptions: ClientOptions;
|
|
20
28
|
};
|
|
21
29
|
|
|
22
30
|
declare const getClient: (options: ClientOptions) => Client;
|
|
23
31
|
|
|
24
|
-
export { type ClientOptions, getClient };
|
|
32
|
+
export { type Client, type ClientError, type ClientOptions, getClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -14,11 +14,19 @@ type ClientOptions = {
|
|
|
14
14
|
onRefreshToken?: (refreshToken: string) => void;
|
|
15
15
|
onLog?: (...args: any[]) => void;
|
|
16
16
|
};
|
|
17
|
+
type ClientError = {
|
|
18
|
+
formattedError: {
|
|
19
|
+
status: number;
|
|
20
|
+
data: any;
|
|
21
|
+
};
|
|
22
|
+
originalError: any;
|
|
23
|
+
};
|
|
17
24
|
type Client = AxiosInstance & {
|
|
18
25
|
refreshToken?: string;
|
|
19
26
|
signInWithPassword: (username: string, password: string) => Promise<void>;
|
|
27
|
+
clientOptions: ClientOptions;
|
|
20
28
|
};
|
|
21
29
|
|
|
22
30
|
declare const getClient: (options: ClientOptions) => Client;
|
|
23
31
|
|
|
24
|
-
export { type ClientOptions, getClient };
|
|
32
|
+
export { type Client, type ClientError, type ClientOptions, getClient };
|
package/dist/index.js
CHANGED
|
@@ -141,6 +141,7 @@ var getClient = (options) => {
|
|
|
141
141
|
},
|
|
142
142
|
withCredentials: false
|
|
143
143
|
});
|
|
144
|
+
client.clientOptions = options;
|
|
144
145
|
const clientCredentialsAuthentification = async () => {
|
|
145
146
|
const params = new URLSearchParams();
|
|
146
147
|
params.append("client_id", options.clientId);
|
package/dist/index.mjs
CHANGED
|
@@ -105,6 +105,7 @@ var getClient = (options) => {
|
|
|
105
105
|
},
|
|
106
106
|
withCredentials: false
|
|
107
107
|
});
|
|
108
|
+
client.clientOptions = options;
|
|
108
109
|
const clientCredentialsAuthentification = async () => {
|
|
109
110
|
const params = new URLSearchParams();
|
|
110
111
|
params.append("client_id", options.clientId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vulog/aima-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"typescript": "^5.6.3",
|
|
34
34
|
"vitest": "^2.1.3"
|
|
35
35
|
},
|
|
36
|
-
"
|
|
36
|
+
"peerDependencies": {
|
|
37
37
|
"axios": "^1.7.7",
|
|
38
38
|
"lodash": "^4.17.21",
|
|
39
39
|
"lru-cache": "^11.0.1"
|
package/src/getClient.ts
CHANGED
package/src/index.ts
CHANGED