@inweb/client 25.4.1 → 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.
@@ -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
@@ -132,7 +132,7 @@ export declare class User {
132
132
  */
133
133
  get projectsLimit(): number;
134
134
  /**
135
- * The user's API key.
135
+ * The user's access token (API key). Use {@link Client.signInWithToken()} to log in using token.
136
136
  *
137
137
  * @readonly
138
138
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inweb/client",
3
- "version": "25.4.1",
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": "~25.4.1"
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 {
package/src/Api/User.ts CHANGED
@@ -233,7 +233,7 @@ export class User {
233
233
  }
234
234
 
235
235
  /**
236
- * The user's API key.
236
+ * The user's access token (API key). Use {@link Client.signInWithToken()} to log in using token.
237
237
  *
238
238
  * @readonly
239
239
  */