open-index/open-npm huggingface dataset:
npm package: @realcommerce/rc-login
Description: A login component with jwt. uses rc-utils auth service to call the backend (look at rc-utils documentation) cg
Latest version: 0.0.88

##rcUI package

A login component with jwt.
uses rc-utils auth service to call the backend (look at rc-utils documentation)
cg

## Install

```typescript
npm i @realcommerce/rc-login --save
```

## Api
```typescript
import { RcLoginModule } from '@realcommerce/rc-login'; 


@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    RcLoginModule
    ...
  ],
  
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

```

## components
* ## rc-login
###Example
```typescript
<lib-rc-login [usePassword]="false" 
              [useOtp]="true" 
              [returnUrl]="yourReturnUrl">
</lib-rc-login>
```

* ## rc-otp

### Example

```typescript
<lib-rc-otp [isInSendOtp]="isInSendOtp"
            [phoneNumber]="phoneNumber"
            [username]="username"
            [recaptchaResponse]="recaptchaResponse"
            [returnUrl]="'/'" >
</lib-rc-otp>
```
### Author
**Yacov Barboi**
npm package: @realcommerce/rc-number
Description: Format a number to a template viewable string  Contain rcNumber.service and rcNumber.pipe.
Latest version: 1.0.4

##rcNumber package

Format a number to a template viewable string 
Contain rcNumber.service and rcNumber.pipe.

Use rcNumber pipe in order to convert a float / int number into a formatted string 


## Install

```typescript
npm i @realcommerce/rc-number
```

---

## Api
```typescript
import { RcNumberModule } from '@realcommerce/rc-number.module'; 

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    RcNumberModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
```

## Optional params
1. decimals: number - how much decimals digit to return (default 2)
2. round: boolean - round number after decimal digits cut (default false)

## Example
```typescript
<div>{{ 1234.5678 | rcNumber }}</div>
```
will produce 1,234.56


### Author
**Zion Ben Yacov**
npm package: @realcommerce/rc-utils
Description: A collection of UI components / directives / pipes
Latest version: 1.0.16

##rcUtils package

A collection of UI components / directives / pipes 

## Install

```typescript
npm i @realcommerce/rc-utils --save

```


## Api
```typescript
import { RcUiModule } from '@realcommerce/rc-utils'; 

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    RcUtilsModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
```

## Services
* ## rc-auth.service

makes the calls to the server and saves the token to the storage
you should inject the environemt with the baseUrl field ie:
###Example
```typescript

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    RcUtilsModule
  ],
  providers: [{ provide: 'ENVIRONMENT', useValue: environment },
  ....
],
  bootstrap: [AppComponent]
})

environment.ts :

export const environment = {
  baseUrl: 'http://localhost:xxx/',
};

```
then you can inject and use it, note that it is used by rc-login (check rc-login documentation)
so you can just use the rc login for the default implementation.

the endpoints in the server should have the following signature (if needed):

api.post(this.authUrl + '/Login', { username, password, recaptchaToken })
api.post(this.authUrl + '/OTPSend', { username: username, phoneNumber, recaptchaToken })
api.post(this.authUrl + GenerateToken`, userClaims);
api.get(this.authUrl + '/RefreshToken',  headers: new HttpHeaders().set('refreshToken', refreshToken) })


## Interceptors
* ## jwt.interceptor

adds bearer token to each request, caches the request in case of 401 to try to refresh the token,
then if the refresh succeded - processes the cached request again.
if you want to use it you should provide the interceptor ie:

```typescript
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    RcUtilsModule
  ],
  providers: [{ provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true },
  ....
],
  bootstrap: [AppComponent]
})
```

###Example


### Authors
**Zion Ben Yacov, Yacov Barboi**