0.1.51 • Published 5 months ago
@isloth/user-service-interface v0.1.51
User Service Interface
This project provides an interface for interacting with the user-service.
Build Library
npm run prepare
Run Unit/Integration Tests
npm run test
Installation
npm install @iSloth/user-service-intarface
Frontend Create User Example
import { type ILogger, type ServiceConfig, ServiceConfigBuilder } from '@isloth/common-lib';
import { UserCreateRequest, UserCreateRequestBuilder } from '@isloth/user-service-interface';
// config
const config: ServiceConfig = new ServiceConfigBuilder()
.setProtocol('http')
.setHost('localhost')
.setPort(8100)
.setVersion('v1')
.build();
// optional logger
const logger: ILogger = {
info: (msg) => console.info(msg),
warn: (msg) => console.warn(msg),
error: (err) => console.error(err),
};
// user service with logger
const userService = new UserService(config, logger);
// const userService = new UserService(config); <-- for not having log from interface
// define create user request
const userCreateRequest: UserCreateRequest = UserCreateRequestBuilder()
.setUsername('valid username')
.setPassword('valid password')
.setPasswordConfirm('repeated password')
.setRole(UserRole.USER)
.setEmail('valid email')
.build();
// create user
return await userService.create(user);
0.1.51
5 months ago
0.1.50
5 months ago
0.1.49
6 months ago
0.1.48
6 months ago
0.1.47
6 months ago
0.1.46
6 months ago
0.1.45
6 months ago
0.1.44
6 months ago
0.1.43
6 months ago
0.1.42
6 months ago
0.1.41
6 months ago
0.1.40
6 months ago
0.1.39
6 months ago
0.1.38
6 months ago
0.1.37
6 months ago
0.1.36
6 months ago
0.1.35
6 months ago
0.1.34
6 months ago
0.1.33
6 months ago
0.1.32
6 months ago
0.1.31
6 months ago
0.1.30
6 months ago
0.1.29
6 months ago
0.1.28
6 months ago
0.1.27
6 months ago
0.1.26
6 months ago
0.1.25
6 months ago
0.1.24
6 months ago
0.1.23
6 months ago
0.1.22
6 months ago
0.1.21
6 months ago
0.1.20
7 months ago
0.1.19
7 months ago
0.1.18
7 months ago
0.1.17
7 months ago
0.1.16
7 months ago
0.1.15
7 months ago
0.1.14
7 months ago
0.1.13
7 months ago
0.1.12
7 months ago
0.1.11
7 months ago
0.1.10
7 months ago
0.1.9
7 months ago
0.1.8
8 months ago
0.1.7
8 months ago
0.1.6
8 months ago
0.1.5
8 months ago
0.1.4
8 months ago
0.1.3
8 months ago
0.1.2
8 months ago
0.1.1
8 months ago
0.1.0
9 months ago