@kedaruma/revlm-client 1.0.30 → 1.0.34
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 +14 -13
- package/dist/index.d.ts +14 -13
- package/dist/index.js +4 -4
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { User
|
|
1
|
+
import { User } from '@kedaruma/revlm-shared/models/user-types';
|
|
2
|
+
export { User, UserBase } from '@kedaruma/revlm-shared/models/user-types';
|
|
2
3
|
import * as bson from 'bson';
|
|
3
4
|
import { Timestamp, Long } from 'bson';
|
|
4
5
|
|
|
@@ -12,7 +13,7 @@ type RevlmErrorResponse = {
|
|
|
12
13
|
type LoginSuccess = {
|
|
13
14
|
ok: true;
|
|
14
15
|
token: string;
|
|
15
|
-
user: User
|
|
16
|
+
user: User;
|
|
16
17
|
};
|
|
17
18
|
type LoginResponse = LoginSuccess | RevlmErrorResponse;
|
|
18
19
|
type ProvisionalLoginSuccess = {
|
|
@@ -23,7 +24,7 @@ type ProvisionalLoginSuccess = {
|
|
|
23
24
|
type ProvisionalLoginResponse = ProvisionalLoginSuccess | RevlmErrorResponse;
|
|
24
25
|
type RegisterUserSuccess = {
|
|
25
26
|
ok: true;
|
|
26
|
-
user: User
|
|
27
|
+
user: User;
|
|
27
28
|
};
|
|
28
29
|
type RegisterUserResponse = RegisterUserSuccess | RevlmErrorResponse;
|
|
29
30
|
type DeleteUserSuccess = {
|
|
@@ -166,8 +167,8 @@ type EmailPasswordCredential = {
|
|
|
166
167
|
email: string;
|
|
167
168
|
password: string;
|
|
168
169
|
};
|
|
169
|
-
type UserInput = Omit<User
|
|
170
|
-
userType: User
|
|
170
|
+
type UserInput = Omit<User, 'userType'> & {
|
|
171
|
+
userType: User['userType'] | string;
|
|
171
172
|
};
|
|
172
173
|
type RevlmOptions = {
|
|
173
174
|
fetchImpl?: typeof fetch;
|
|
@@ -228,7 +229,7 @@ declare class MongoDBService {
|
|
|
228
229
|
declare class Credentials {
|
|
229
230
|
static emailPassword(email: string, password: string): EmailPasswordCredential;
|
|
230
231
|
}
|
|
231
|
-
declare class
|
|
232
|
+
declare class RevlmUser {
|
|
232
233
|
private _app;
|
|
233
234
|
private _token;
|
|
234
235
|
private _profile;
|
|
@@ -253,13 +254,13 @@ declare class App {
|
|
|
253
254
|
constructor(baseUrl: string, opts?: RevlmOptions & {
|
|
254
255
|
id?: string;
|
|
255
256
|
});
|
|
256
|
-
get currentUser():
|
|
257
|
-
get allUsers(): Record<string,
|
|
258
|
-
logIn(cred: EmailPasswordCredential): Promise<
|
|
259
|
-
switchUser(user:
|
|
260
|
-
removeUser(user:
|
|
257
|
+
get currentUser(): RevlmUser | null;
|
|
258
|
+
get allUsers(): Record<string, RevlmUser>;
|
|
259
|
+
logIn(cred: EmailPasswordCredential): Promise<RevlmUser>;
|
|
260
|
+
switchUser(user: RevlmUser): RevlmUser;
|
|
261
|
+
removeUser(user: RevlmUser): Promise<void>;
|
|
261
262
|
logOut(): Promise<void>;
|
|
262
|
-
deleteUser(user:
|
|
263
|
+
deleteUser(user: RevlmUser): Promise<void>;
|
|
263
264
|
}
|
|
264
265
|
|
|
265
266
|
declare const ObjectId: typeof bson.ObjectId;
|
|
@@ -268,4 +269,4 @@ declare const BSON: typeof bson & {
|
|
|
268
269
|
ObjectID: typeof bson.ObjectId;
|
|
269
270
|
};
|
|
270
271
|
|
|
271
|
-
export { type AggregatePipelineStage, App, BSON, type BaseChangeEvent, type ChangeEvent, type ChangeEventId, type CountOptions, Credentials, type DeleteEvent, type DeleteResult, type DeleteUserResponse, type DeleteUserSuccess, type Document, type DocumentKey, type DocumentNamespace, type DropDatabaseEvent, type DropEvent, type Filter, type FindOneAndModifyOptions, type FindOneOptions, type FindOptions, type InsertEvent, type InsertManyResult, type InsertOneResult, type InvalidateEvent, type LoginResponse, type LoginSuccess, MdbCollection, MongoDBService, type NewDocument, ObjectID, ObjectId, type OperationType, type ProvisionalLoginResponse, type ProvisionalLoginSuccess, type RegisterUserResponse, type RegisterUserSuccess, type RenameEvent, type ReplaceEvent, Revlm, RevlmDBDatabase, type RevlmErrorResponse, type RevlmOptions, type RevlmResponse, type Update, type UpdateDescription, type UpdateEvent, type UpdateOptions, type UpdateResult,
|
|
272
|
+
export { type AggregatePipelineStage, App, BSON, type BaseChangeEvent, type ChangeEvent, type ChangeEventId, type CountOptions, Credentials, type DeleteEvent, type DeleteResult, type DeleteUserResponse, type DeleteUserSuccess, type Document, type DocumentKey, type DocumentNamespace, type DropDatabaseEvent, type DropEvent, type Filter, type FindOneAndModifyOptions, type FindOneOptions, type FindOptions, type InsertEvent, type InsertManyResult, type InsertOneResult, type InvalidateEvent, type LoginResponse, type LoginSuccess, MdbCollection, MongoDBService, type NewDocument, ObjectID, ObjectId, type OperationType, type ProvisionalLoginResponse, type ProvisionalLoginSuccess, type RegisterUserResponse, type RegisterUserSuccess, type RenameEvent, type ReplaceEvent, Revlm, RevlmDBDatabase, type RevlmErrorResponse, type RevlmOptions, type RevlmResponse, RevlmUser, type Update, type UpdateDescription, type UpdateEvent, type UpdateOptions, type UpdateResult, type WatchOptionsFilter, type WatchOptionsIds };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { User
|
|
1
|
+
import { User } from '@kedaruma/revlm-shared/models/user-types';
|
|
2
|
+
export { User, UserBase } from '@kedaruma/revlm-shared/models/user-types';
|
|
2
3
|
import * as bson from 'bson';
|
|
3
4
|
import { Timestamp, Long } from 'bson';
|
|
4
5
|
|
|
@@ -12,7 +13,7 @@ type RevlmErrorResponse = {
|
|
|
12
13
|
type LoginSuccess = {
|
|
13
14
|
ok: true;
|
|
14
15
|
token: string;
|
|
15
|
-
user: User
|
|
16
|
+
user: User;
|
|
16
17
|
};
|
|
17
18
|
type LoginResponse = LoginSuccess | RevlmErrorResponse;
|
|
18
19
|
type ProvisionalLoginSuccess = {
|
|
@@ -23,7 +24,7 @@ type ProvisionalLoginSuccess = {
|
|
|
23
24
|
type ProvisionalLoginResponse = ProvisionalLoginSuccess | RevlmErrorResponse;
|
|
24
25
|
type RegisterUserSuccess = {
|
|
25
26
|
ok: true;
|
|
26
|
-
user: User
|
|
27
|
+
user: User;
|
|
27
28
|
};
|
|
28
29
|
type RegisterUserResponse = RegisterUserSuccess | RevlmErrorResponse;
|
|
29
30
|
type DeleteUserSuccess = {
|
|
@@ -166,8 +167,8 @@ type EmailPasswordCredential = {
|
|
|
166
167
|
email: string;
|
|
167
168
|
password: string;
|
|
168
169
|
};
|
|
169
|
-
type UserInput = Omit<User
|
|
170
|
-
userType: User
|
|
170
|
+
type UserInput = Omit<User, 'userType'> & {
|
|
171
|
+
userType: User['userType'] | string;
|
|
171
172
|
};
|
|
172
173
|
type RevlmOptions = {
|
|
173
174
|
fetchImpl?: typeof fetch;
|
|
@@ -228,7 +229,7 @@ declare class MongoDBService {
|
|
|
228
229
|
declare class Credentials {
|
|
229
230
|
static emailPassword(email: string, password: string): EmailPasswordCredential;
|
|
230
231
|
}
|
|
231
|
-
declare class
|
|
232
|
+
declare class RevlmUser {
|
|
232
233
|
private _app;
|
|
233
234
|
private _token;
|
|
234
235
|
private _profile;
|
|
@@ -253,13 +254,13 @@ declare class App {
|
|
|
253
254
|
constructor(baseUrl: string, opts?: RevlmOptions & {
|
|
254
255
|
id?: string;
|
|
255
256
|
});
|
|
256
|
-
get currentUser():
|
|
257
|
-
get allUsers(): Record<string,
|
|
258
|
-
logIn(cred: EmailPasswordCredential): Promise<
|
|
259
|
-
switchUser(user:
|
|
260
|
-
removeUser(user:
|
|
257
|
+
get currentUser(): RevlmUser | null;
|
|
258
|
+
get allUsers(): Record<string, RevlmUser>;
|
|
259
|
+
logIn(cred: EmailPasswordCredential): Promise<RevlmUser>;
|
|
260
|
+
switchUser(user: RevlmUser): RevlmUser;
|
|
261
|
+
removeUser(user: RevlmUser): Promise<void>;
|
|
261
262
|
logOut(): Promise<void>;
|
|
262
|
-
deleteUser(user:
|
|
263
|
+
deleteUser(user: RevlmUser): Promise<void>;
|
|
263
264
|
}
|
|
264
265
|
|
|
265
266
|
declare const ObjectId: typeof bson.ObjectId;
|
|
@@ -268,4 +269,4 @@ declare const BSON: typeof bson & {
|
|
|
268
269
|
ObjectID: typeof bson.ObjectId;
|
|
269
270
|
};
|
|
270
271
|
|
|
271
|
-
export { type AggregatePipelineStage, App, BSON, type BaseChangeEvent, type ChangeEvent, type ChangeEventId, type CountOptions, Credentials, type DeleteEvent, type DeleteResult, type DeleteUserResponse, type DeleteUserSuccess, type Document, type DocumentKey, type DocumentNamespace, type DropDatabaseEvent, type DropEvent, type Filter, type FindOneAndModifyOptions, type FindOneOptions, type FindOptions, type InsertEvent, type InsertManyResult, type InsertOneResult, type InvalidateEvent, type LoginResponse, type LoginSuccess, MdbCollection, MongoDBService, type NewDocument, ObjectID, ObjectId, type OperationType, type ProvisionalLoginResponse, type ProvisionalLoginSuccess, type RegisterUserResponse, type RegisterUserSuccess, type RenameEvent, type ReplaceEvent, Revlm, RevlmDBDatabase, type RevlmErrorResponse, type RevlmOptions, type RevlmResponse, type Update, type UpdateDescription, type UpdateEvent, type UpdateOptions, type UpdateResult,
|
|
272
|
+
export { type AggregatePipelineStage, App, BSON, type BaseChangeEvent, type ChangeEvent, type ChangeEventId, type CountOptions, Credentials, type DeleteEvent, type DeleteResult, type DeleteUserResponse, type DeleteUserSuccess, type Document, type DocumentKey, type DocumentNamespace, type DropDatabaseEvent, type DropEvent, type Filter, type FindOneAndModifyOptions, type FindOneOptions, type FindOptions, type InsertEvent, type InsertManyResult, type InsertOneResult, type InvalidateEvent, type LoginResponse, type LoginSuccess, MdbCollection, MongoDBService, type NewDocument, ObjectID, ObjectId, type OperationType, type ProvisionalLoginResponse, type ProvisionalLoginSuccess, type RegisterUserResponse, type RegisterUserSuccess, type RenameEvent, type ReplaceEvent, Revlm, RevlmDBDatabase, type RevlmErrorResponse, type RevlmOptions, type RevlmResponse, RevlmUser, type Update, type UpdateDescription, type UpdateEvent, type UpdateOptions, type UpdateResult, type WatchOptionsFilter, type WatchOptionsIds };
|
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ __export(index_exports, {
|
|
|
39
39
|
ObjectId: () => ObjectId2,
|
|
40
40
|
Revlm: () => Revlm,
|
|
41
41
|
RevlmDBDatabase: () => RevlmDBDatabase,
|
|
42
|
-
|
|
42
|
+
RevlmUser: () => RevlmUser
|
|
43
43
|
});
|
|
44
44
|
module.exports = __toCommonJS(index_exports);
|
|
45
45
|
|
|
@@ -327,7 +327,7 @@ var Credentials = class {
|
|
|
327
327
|
return { type: "emailPassword", email, password };
|
|
328
328
|
}
|
|
329
329
|
};
|
|
330
|
-
var
|
|
330
|
+
var RevlmUser = class {
|
|
331
331
|
_app;
|
|
332
332
|
_token;
|
|
333
333
|
_profile;
|
|
@@ -400,7 +400,7 @@ var App = class {
|
|
|
400
400
|
throw err;
|
|
401
401
|
}
|
|
402
402
|
this.__revlm.setToken(res.token);
|
|
403
|
-
const user = new
|
|
403
|
+
const user = new RevlmUser(this, res.token, res.user);
|
|
404
404
|
const userId = user.id || "current";
|
|
405
405
|
this._users[userId] = user;
|
|
406
406
|
this._currentUser = user;
|
|
@@ -449,5 +449,5 @@ var BSON = Object.assign({}, bson, { ObjectID: bson.ObjectId });
|
|
|
449
449
|
ObjectId,
|
|
450
450
|
Revlm,
|
|
451
451
|
RevlmDBDatabase,
|
|
452
|
-
|
|
452
|
+
RevlmUser
|
|
453
453
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -284,7 +284,7 @@ var Credentials = class {
|
|
|
284
284
|
return { type: "emailPassword", email, password };
|
|
285
285
|
}
|
|
286
286
|
};
|
|
287
|
-
var
|
|
287
|
+
var RevlmUser = class {
|
|
288
288
|
_app;
|
|
289
289
|
_token;
|
|
290
290
|
_profile;
|
|
@@ -357,7 +357,7 @@ var App = class {
|
|
|
357
357
|
throw err;
|
|
358
358
|
}
|
|
359
359
|
this.__revlm.setToken(res.token);
|
|
360
|
-
const user = new
|
|
360
|
+
const user = new RevlmUser(this, res.token, res.user);
|
|
361
361
|
const userId = user.id || "current";
|
|
362
362
|
this._users[userId] = user;
|
|
363
363
|
this._currentUser = user;
|
|
@@ -405,5 +405,5 @@ export {
|
|
|
405
405
|
ObjectId2 as ObjectId,
|
|
406
406
|
Revlm,
|
|
407
407
|
RevlmDBDatabase,
|
|
408
|
-
|
|
408
|
+
RevlmUser
|
|
409
409
|
};
|