mezon-js 2.11.2 → 2.11.3
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/api.gen.ts +4 -0
- package/client.ts +5 -1
- package/dist/api.gen.d.ts +2 -0
- package/dist/client.d.ts +1 -1
- package/dist/mezon-js.cjs.js +4 -2
- package/dist/mezon-js.esm.mjs +4 -2
- package/package.json +1 -1
package/api.gen.ts
CHANGED
@@ -2259,6 +2259,10 @@ export interface ApiSessionLogoutRequest {
|
|
2259
2259
|
refresh_token?: string;
|
2260
2260
|
//Session token to log out.
|
2261
2261
|
token?: string;
|
2262
|
+
// device_id to log out.
|
2263
|
+
device_id?: string;
|
2264
|
+
// platform
|
2265
|
+
platform?: string;
|
2262
2266
|
}
|
2263
2267
|
|
2264
2268
|
/** Authenticate against the server with a refresh token. */
|
package/client.ts
CHANGED
@@ -2358,7 +2358,9 @@ export class Client {
|
|
2358
2358
|
async sessionLogout(
|
2359
2359
|
session: Session,
|
2360
2360
|
token: string,
|
2361
|
-
refreshToken: string
|
2361
|
+
refreshToken: string,
|
2362
|
+
deviceId: string,
|
2363
|
+
platform: string
|
2362
2364
|
): Promise<boolean> {
|
2363
2365
|
if (
|
2364
2366
|
this.autoRefreshSession &&
|
@@ -2372,6 +2374,8 @@ export class Client {
|
|
2372
2374
|
.sessionLogout(session.token, {
|
2373
2375
|
refresh_token: refreshToken,
|
2374
2376
|
token: token,
|
2377
|
+
device_id: deviceId,
|
2378
|
+
platform: platform
|
2375
2379
|
})
|
2376
2380
|
.then((response: any) => {
|
2377
2381
|
return response !== undefined;
|
package/dist/api.gen.d.ts
CHANGED
@@ -1298,6 +1298,8 @@ export interface ApiSession {
|
|
1298
1298
|
export interface ApiSessionLogoutRequest {
|
1299
1299
|
refresh_token?: string;
|
1300
1300
|
token?: string;
|
1301
|
+
device_id?: string;
|
1302
|
+
platform?: string;
|
1301
1303
|
}
|
1302
1304
|
/** Authenticate against the server with a refresh token. */
|
1303
1305
|
export interface ApiSessionRefreshRequest {
|
package/dist/client.d.ts
CHANGED
@@ -478,7 +478,7 @@ export declare class Client {
|
|
478
478
|
/** Execute an RPC function on the server. */
|
479
479
|
rpcHttpKey(httpKey: string, id: string, input?: object): Promise<RpcResponse>;
|
480
480
|
/** Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user. */
|
481
|
-
sessionLogout(session: Session, token: string, refreshToken: string): Promise<boolean>;
|
481
|
+
sessionLogout(session: Session, token: string, refreshToken: string, deviceId: string, platform: string): Promise<boolean>;
|
482
482
|
/** Refresh a user's session using a refresh token retrieved from a previous authentication request. */
|
483
483
|
sessionRefresh(session: Session, vars?: Record<string, string>): Promise<Session>;
|
484
484
|
/** Remove the Apple ID from the social profiles on the current user's account. */
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -9475,14 +9475,16 @@ var Client = class {
|
|
9475
9475
|
});
|
9476
9476
|
}
|
9477
9477
|
/** Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user. */
|
9478
|
-
sessionLogout(session, token, refreshToken) {
|
9478
|
+
sessionLogout(session, token, refreshToken, deviceId, platform) {
|
9479
9479
|
return __async(this, null, function* () {
|
9480
9480
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
9481
9481
|
yield this.sessionRefresh(session);
|
9482
9482
|
}
|
9483
9483
|
return this.apiClient.sessionLogout(session.token, {
|
9484
9484
|
refresh_token: refreshToken,
|
9485
|
-
token
|
9485
|
+
token,
|
9486
|
+
device_id: deviceId,
|
9487
|
+
platform
|
9486
9488
|
}).then((response) => {
|
9487
9489
|
return response !== void 0;
|
9488
9490
|
});
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -9441,14 +9441,16 @@ var Client = class {
|
|
9441
9441
|
});
|
9442
9442
|
}
|
9443
9443
|
/** Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user. */
|
9444
|
-
sessionLogout(session, token, refreshToken) {
|
9444
|
+
sessionLogout(session, token, refreshToken, deviceId, platform) {
|
9445
9445
|
return __async(this, null, function* () {
|
9446
9446
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
9447
9447
|
yield this.sessionRefresh(session);
|
9448
9448
|
}
|
9449
9449
|
return this.apiClient.sessionLogout(session.token, {
|
9450
9450
|
refresh_token: refreshToken,
|
9451
|
-
token
|
9451
|
+
token,
|
9452
|
+
device_id: deviceId,
|
9453
|
+
platform
|
9452
9454
|
}).then((response) => {
|
9453
9455
|
return response !== void 0;
|
9454
9456
|
});
|