@kedaruma/revlm-client 1.0.8 → 1.0.9

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 CHANGED
@@ -1,8 +1,8 @@
1
+ import { User as User$1 } from '@kedaruma/revlm-shared/models/user-types';
1
2
  import { Timestamp, Long } from 'bson';
2
3
  import * as bson from 'bson';
3
4
  export { bson as BSON };
4
5
  export { ObjectId as ObjectID, ObjectId } from 'bson';
5
- import { User as User$1 } from '@kedaruma/revlm-shared/models/user-types';
6
6
 
7
7
  type RevlmErrorResponse = {
8
8
  ok: false;
@@ -165,6 +165,9 @@ type EmailPasswordCredential = {
165
165
  email: string;
166
166
  password: string;
167
167
  };
168
+ type UserInput = Omit<User$1, 'userType'> & {
169
+ userType: User$1['userType'] | string;
170
+ };
168
171
  type RevlmOptions = {
169
172
  fetchImpl?: typeof fetch;
170
173
  defaultHeaders?: Record<string, string>;
@@ -202,7 +205,7 @@ declare class Revlm {
202
205
  private request;
203
206
  login(authId: string, password: string): Promise<LoginResponse>;
204
207
  provisionalLogin(authId: string): Promise<ProvisionalLoginResponse>;
205
- registerUser(user: any, password: string): Promise<RevlmResponse<any>>;
208
+ registerUser(user: UserInput, password: string): Promise<RevlmResponse<any>>;
206
209
  deleteUser(params: {
207
210
  _id?: any;
208
211
  authId?: string;
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
+ import { User as User$1 } from '@kedaruma/revlm-shared/models/user-types';
1
2
  import { Timestamp, Long } from 'bson';
2
3
  import * as bson from 'bson';
3
4
  export { bson as BSON };
4
5
  export { ObjectId as ObjectID, ObjectId } from 'bson';
5
- import { User as User$1 } from '@kedaruma/revlm-shared/models/user-types';
6
6
 
7
7
  type RevlmErrorResponse = {
8
8
  ok: false;
@@ -165,6 +165,9 @@ type EmailPasswordCredential = {
165
165
  email: string;
166
166
  password: string;
167
167
  };
168
+ type UserInput = Omit<User$1, 'userType'> & {
169
+ userType: User$1['userType'] | string;
170
+ };
168
171
  type RevlmOptions = {
169
172
  fetchImpl?: typeof fetch;
170
173
  defaultHeaders?: Record<string, string>;
@@ -202,7 +205,7 @@ declare class Revlm {
202
205
  private request;
203
206
  login(authId: string, password: string): Promise<LoginResponse>;
204
207
  provisionalLogin(authId: string): Promise<ProvisionalLoginResponse>;
205
- registerUser(user: any, password: string): Promise<RevlmResponse<any>>;
208
+ registerUser(user: UserInput, password: string): Promise<RevlmResponse<any>>;
206
209
  deleteUser(params: {
207
210
  _id?: any;
208
211
  authId?: string;
package/dist/index.js CHANGED
@@ -348,7 +348,7 @@ var App = class {
348
348
  this.__revlm = new Revlm(baseUrl, opts);
349
349
  this.emailPasswordAuth = {
350
350
  registerUser: async (email, password) => {
351
- return this.__revlm.registerUser({ authId: email, userType: "user", roles: [] }, password);
351
+ return this.__revlm.registerUser({ authId: email, userType: "user", roles: ["user"] }, password);
352
352
  },
353
353
  deleteUser: async (email) => {
354
354
  return this.__revlm.deleteUser({ authId: email });
package/dist/index.mjs CHANGED
@@ -303,7 +303,7 @@ var App = class {
303
303
  this.__revlm = new Revlm(baseUrl, opts);
304
304
  this.emailPasswordAuth = {
305
305
  registerUser: async (email, password) => {
306
- return this.__revlm.registerUser({ authId: email, userType: "user", roles: [] }, password);
306
+ return this.__revlm.registerUser({ authId: email, userType: "user", roles: ["user"] }, password);
307
307
  },
308
308
  deleteUser: async (email) => {
309
309
  return this.__revlm.deleteUser({ authId: email });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kedaruma/revlm-client",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "private": false,
5
5
  "description": "TypeScript client SDK for talking to the Revlm server replacement for MongoDB Realm.",
6
6
  "keywords": [
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "bson": "^6.10.4",
40
40
  "dotenv": "^17.2.3",
41
- "@kedaruma/revlm-shared": "1.0.2"
41
+ "@kedaruma/revlm-shared": "1.0.3"
42
42
  },
43
43
  "devDependencies": {
44
44
  "tsup": "^8.5.1"