@kedaruma/revlm-client 1.0.6 → 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,6 +1,8 @@
1
+ import { User as User$1 } from '@kedaruma/revlm-shared/models/user-types';
1
2
  import { Timestamp, Long } from 'bson';
3
+ import * as bson from 'bson';
4
+ export { bson as BSON };
2
5
  export { ObjectId as ObjectID, ObjectId } from 'bson';
3
- import { User as User$1 } from '@kedaruma/revlm-shared/models/user-types';
4
6
 
5
7
  type RevlmErrorResponse = {
6
8
  ok: false;
@@ -163,6 +165,9 @@ type EmailPasswordCredential = {
163
165
  email: string;
164
166
  password: string;
165
167
  };
168
+ type UserInput = Omit<User$1, 'userType'> & {
169
+ userType: User$1['userType'] | string;
170
+ };
166
171
  type RevlmOptions = {
167
172
  fetchImpl?: typeof fetch;
168
173
  defaultHeaders?: Record<string, string>;
@@ -200,7 +205,7 @@ declare class Revlm {
200
205
  private request;
201
206
  login(authId: string, password: string): Promise<LoginResponse>;
202
207
  provisionalLogin(authId: string): Promise<ProvisionalLoginResponse>;
203
- registerUser(user: any, password: string): Promise<RevlmResponse<any>>;
208
+ registerUser(user: UserInput, password: string): Promise<RevlmResponse<any>>;
204
209
  deleteUser(params: {
205
210
  _id?: any;
206
211
  authId?: string;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
+ import { User as User$1 } from '@kedaruma/revlm-shared/models/user-types';
1
2
  import { Timestamp, Long } from 'bson';
3
+ import * as bson from 'bson';
4
+ export { bson as BSON };
2
5
  export { ObjectId as ObjectID, ObjectId } from 'bson';
3
- import { User as User$1 } from '@kedaruma/revlm-shared/models/user-types';
4
6
 
5
7
  type RevlmErrorResponse = {
6
8
  ok: false;
@@ -163,6 +165,9 @@ type EmailPasswordCredential = {
163
165
  email: string;
164
166
  password: string;
165
167
  };
168
+ type UserInput = Omit<User$1, 'userType'> & {
169
+ userType: User$1['userType'] | string;
170
+ };
166
171
  type RevlmOptions = {
167
172
  fetchImpl?: typeof fetch;
168
173
  defaultHeaders?: Record<string, string>;
@@ -200,7 +205,7 @@ declare class Revlm {
200
205
  private request;
201
206
  login(authId: string, password: string): Promise<LoginResponse>;
202
207
  provisionalLogin(authId: string): Promise<ProvisionalLoginResponse>;
203
- registerUser(user: any, password: string): Promise<RevlmResponse<any>>;
208
+ registerUser(user: UserInput, password: string): Promise<RevlmResponse<any>>;
204
209
  deleteUser(params: {
205
210
  _id?: any;
206
211
  authId?: string;
package/dist/index.js CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,12 +17,21 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // src/index.ts
21
31
  var index_exports = {};
22
32
  __export(index_exports, {
23
33
  App: () => App,
34
+ BSON: () => BSON,
24
35
  Credentials: () => Credentials,
25
36
  MdbCollection: () => MdbCollection,
26
37
  MongoDBService: () => MongoDBService,
@@ -337,7 +348,7 @@ var App = class {
337
348
  this.__revlm = new Revlm(baseUrl, opts);
338
349
  this.emailPasswordAuth = {
339
350
  registerUser: async (email, password) => {
340
- return this.__revlm.registerUser({ authId: email, userType: "user", roles: [] }, password);
351
+ return this.__revlm.registerUser({ authId: email, userType: "user", roles: ["user"] }, password);
341
352
  },
342
353
  deleteUser: async (email) => {
343
354
  return this.__revlm.deleteUser({ authId: email });
@@ -395,9 +406,11 @@ var App = class {
395
406
 
396
407
  // src/index.ts
397
408
  var import_bson2 = require("bson");
409
+ var BSON = __toESM(require("bson"));
398
410
  // Annotate the CommonJS export names for ESM import in node:
399
411
  0 && (module.exports = {
400
412
  App,
413
+ BSON,
401
414
  Credentials,
402
415
  MdbCollection,
403
416
  MongoDBService,
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 });
@@ -361,8 +361,10 @@ var App = class {
361
361
 
362
362
  // src/index.ts
363
363
  import { ObjectId, ObjectId as ObjectId2 } from "bson";
364
+ import * as BSON from "bson";
364
365
  export {
365
366
  App,
367
+ BSON,
366
368
  Credentials,
367
369
  MdbCollection,
368
370
  MongoDBService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kedaruma/revlm-client",
3
- "version": "1.0.6",
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"