@inweb/client 25.4.0 → 25.4.2
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/client.js +17 -6
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +5 -2
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Client.d.ts +12 -3
- package/lib/Api/User.d.ts +1 -1
- package/package.json +2 -2
- package/src/Api/Client.ts +15 -3
- package/src/Api/User.ts +1 -1
package/lib/Api/Client.d.ts
CHANGED
|
@@ -92,13 +92,22 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
|
|
|
92
92
|
*/
|
|
93
93
|
signInWithEmail(email: string, password: string): Promise<User>;
|
|
94
94
|
/**
|
|
95
|
-
* Log in an existing user using API Key.
|
|
95
|
+
* Log in an existing user using access token (API Key).
|
|
96
96
|
*
|
|
97
97
|
* @async
|
|
98
|
-
* @param token - An access token for authentication request. See
|
|
99
|
-
* {@link User#token | User.token} for more details.
|
|
98
|
+
* @param token - An access token for authentication request. See {@link User.token} for more details.
|
|
100
99
|
*/
|
|
101
100
|
signInWithToken(token: string): Promise<User>;
|
|
101
|
+
/**
|
|
102
|
+
* Get the list of server indentity providers.
|
|
103
|
+
*
|
|
104
|
+
* To sign in with the provider in your web application:
|
|
105
|
+
*
|
|
106
|
+
* - Open the `provider.url` link using `window.open()`.
|
|
107
|
+
* - Add a `/oauth` path (server-defined) handler to the router. In this handler, show an error
|
|
108
|
+
* message if the `error` search parameter is present, or log in with the `token` search parameter.
|
|
109
|
+
*/
|
|
110
|
+
getIdentityProviders(): Promise<any>;
|
|
102
111
|
private setCurrentUser;
|
|
103
112
|
private clearCurrentUser;
|
|
104
113
|
/**
|
package/lib/Api/User.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inweb/client",
|
|
3
|
-
"version": "25.4.
|
|
3
|
+
"version": "25.4.2",
|
|
4
4
|
"description": "JavaScript REST API client for the Open Cloud Server",
|
|
5
5
|
"homepage": "https://cloud.opendesign.com/docs/index.html",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
"ts-docs": "typedoc"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@inweb/eventemitter2": "
|
|
29
|
+
"@inweb/eventemitter2": "~25.4.2"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/Api/Client.ts
CHANGED
|
@@ -205,11 +205,10 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
/**
|
|
208
|
-
* Log in an existing user using API Key.
|
|
208
|
+
* Log in an existing user using access token (API Key).
|
|
209
209
|
*
|
|
210
210
|
* @async
|
|
211
|
-
* @param token - An access token for authentication request. See
|
|
212
|
-
* {@link User#token | User.token} for more details.
|
|
211
|
+
* @param token - An access token for authentication request. See {@link User.token} for more details.
|
|
213
212
|
*/
|
|
214
213
|
async signInWithToken(token: string): Promise<User> {
|
|
215
214
|
this._httpClient.headers = { Authorization: token };
|
|
@@ -218,6 +217,19 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
218
217
|
return this.setCurrentUser(data);
|
|
219
218
|
}
|
|
220
219
|
|
|
220
|
+
/**
|
|
221
|
+
* Get the list of server indentity providers.
|
|
222
|
+
*
|
|
223
|
+
* To sign in with the provider in your web application:
|
|
224
|
+
*
|
|
225
|
+
* - Open the `provider.url` link using `window.open()`.
|
|
226
|
+
* - Add a `/oauth` path (server-defined) handler to the router. In this handler, show an error
|
|
227
|
+
* message if the `error` search parameter is present, or log in with the `token` search parameter.
|
|
228
|
+
*/
|
|
229
|
+
getIdentityProviders(): Promise<any> {
|
|
230
|
+
return this._httpClient.get("/identity").then((response) => response.json());
|
|
231
|
+
}
|
|
232
|
+
|
|
221
233
|
// Save the current logged in user information for internal use.
|
|
222
234
|
|
|
223
235
|
private setCurrentUser(data: any): User {
|