@loomcore/api 0.1.15 → 0.1.16

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.
@@ -1,7 +1,7 @@
1
1
  import { PostgresDatabase } from "../index.js";
2
2
  import { randomUUID } from "crypto";
3
- import { UserService } from "../../../services/user.service.js";
4
3
  import { getSystemUserContext, initializeSystemUserContext } from "@loomcore/common/models";
4
+ import { AuthService } from "../../../services/auth.service.js";
5
5
  export class CreateAdminUserMigration {
6
6
  client;
7
7
  adminEmail;
@@ -16,10 +16,10 @@ export class CreateAdminUserMigration {
16
16
  const _id = randomUUID().toString();
17
17
  try {
18
18
  const database = new PostgresDatabase(this.client);
19
- const userService = new UserService(database);
19
+ const authService = new AuthService(database);
20
20
  initializeSystemUserContext(this.adminEmail, _orgId);
21
21
  const systemUserContext = getSystemUserContext();
22
- const adminUser = await userService.create(systemUserContext, {
22
+ const adminUser = await authService.createUser(systemUserContext, {
23
23
  _id: _id,
24
24
  _orgId: _orgId,
25
25
  email: this.adminEmail,
@@ -20,7 +20,7 @@ export declare class AuthService extends GenericApiService<IUser> {
20
20
  } | null>;
21
21
  getUserById(id: string): Promise<IUser | null>;
22
22
  getUserByEmail(email: string): Promise<IUser | null>;
23
- createUser(userContext: IUserContext, user: IUser): Promise<IUser | null>;
23
+ createUser(userContext: IUserContext, user: Partial<IUser>): Promise<IUser | null>;
24
24
  requestTokenUsingRefreshToken(req: Request): Promise<ITokenResponse | null>;
25
25
  changeLoggedInUsersPassword(userContext: IUserContext, body: any): Promise<UpdateResult>;
26
26
  changePassword(userContext: IUserContext, queryObject: any, password: string): Promise<UpdateResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomcore/api",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "private": false,
5
5
  "description": "Loom Core Api - An opinionated Node.js api using Typescript, Express, and MongoDb or PostgreSQL",
6
6
  "scripts": {