1.5.3 • Published 4 years ago

@funxtion/ng-funxtion-api-client v1.5.3

Weekly downloads
535
License
-
Repository
-
Last release
4 years ago

Funxtion API Client for Angular

This is an Angular library for communication with the Funxtion API v2.

Installation

npm i @funxtion/ng-funxtion-api-client

Dependencies

OAuth 2

[Manfred Steyer's Angular OAuth 2](https://manfredsteyer.github.io/angular-oauth2-oidc/docs/)

npm i angular-oauth2-oidc

This service can be accessed through FunxtionApiClientService.oauth.

JSON API

[Ghidoz' Angular 2 JSON API](https://github.com/ghidoz/angular2-jsonapi)

npm i angular2-jsonapi

This service can be accessed through FunxtionApiClientService.datastore.

Refreshing of tokens happens automatically in the OauthService for logged in users. This service also passes the tokens to the DatastoreService.

Environment

Implement the EnvironmentVariables interface on your environment file. Do this for both your local and production environment files.

Usage

AppModule

import { NgModule } from '@angular/core';
import { FunxtionApiClientModule, FunxtionApiClientService } from '@funxtion/ng-funxtion-api-client';

@NgModule({
    imports: [FunxtionApiClientModule],
    providers: [FunxtionApiClientService]
})
export class AppModule {}

AppComponent

import { FunxtionApiClientService } from '@funxtion/ng-funxtion-api-client';
import { environment } from '../environments/environment';

export class AppComponent {
    constructor(private funxtion: FunxtionApiClientService) {
        this.funxtion.setup(environment).then(() => {
            // optionally listen for API errors
            this.funxtion.datastore.error$.subscribe((error) => {
                // handle the error(s)
            });

            // other logic for the app
        });
    }
}

Services

In addition to the third party services mentioned in the [dependencies section](#dependencies), the library contains the following custom services:

UserService

Use this service for managing user actions.

Properties

  • data (User model)
  • password (can be used for form model binding, gets erased after login and register)

Methods

  • login
  • logout
  • register
  • getUser

ClientService

Use this service for managing client actions.

Properties

  • data (Client model)

Methods

  • getClient
1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.4.8

4 years ago

1.5.0

4 years ago

1.5.0-beta.0

4 years ago

1.4.7

4 years ago

1.4.6

4 years ago

1.4.6-rc.0

4 years ago

1.3.28

4 years ago

1.4.5

4 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.1-beta-url

4 years ago

1.4.1-beta-a

4 years ago

1.4.1-beta

4 years ago

1.3.27

4 years ago

1.3.26

4 years ago

1.3.24

4 years ago

1.3.25

4 years ago

1.3.23

4 years ago

1.3.22

4 years ago

1.3.21

4 years ago

1.3.20

4 years ago

1.3.19

4 years ago

1.3.18

5 years ago

1.3.17

5 years ago

1.4.0-rc.0

5 years ago

1.3.16

5 years ago

1.3.14

5 years ago

1.3.15

5 years ago

1.3.13

5 years ago

1.3.12

5 years ago

1.3.11-beta2

5 years ago

1.3.11-beta3

5 years ago

1.3.11-beta

5 years ago

1.3.10

5 years ago

1.3.9

5 years ago

1.3.8

5 years ago

1.3.7

5 years ago

1.3.6

5 years ago

1.3.5

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.1-beta.15

5 years ago

1.2.1-beta.14

5 years ago

1.2.1-beta.13

5 years ago

1.2.1-beta.12

5 years ago

1.2.1-beta.11

5 years ago

1.2.1-beta.10

5 years ago

1.2.1-beta.9

5 years ago

1.2.1-beta.8

5 years ago

1.2.1-beta.7

5 years ago

1.2.1-beta.6

5 years ago

1.2.1-beta.5

5 years ago

1.2.1-beta.4

5 years ago

1.2.1-beta.3

5 years ago

1.2.1-beta.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0-beta.3

5 years ago

1.1.0-beta.2

5 years ago

1.1.0-beta.1

5 years ago

1.1.0-beta.0

5 years ago