0.0.2-alpha.0 • Published 2 years ago

@vcd/angular-client v0.0.2-alpha.0

Weekly downloads
1
License
BSD-2
Repository
-
Last release
2 years ago

Usage examples

Authenticating

If you don't have an existing session, you can create one:

ngOnInit(): void {
this.client.login('username', 'org', 'pa$$w0rd').subscribe(() => {
console.log(`logged into ${this.client.organization} as ${this.client.username}`);
});

If you already have an existing session (because you're acting as a UI extension and have access to the authentication token for example) you can simply set the authentication of the client instance to use the Bearer token:

ngOnInit(): void {
this.client.setAuthentication(bearerToken).subscribe(() => {
console.log(`logged into ${this.client.organization} as ${this.client.username}`);
});

Querying the API

The query builder can be used to quickly create API calls that are compatible with the query service:

this.client.query(Query.Builder.ofType('virtualCenter'))).pipe(

tap(queryResult  =>  console.log(`Virtual centers: ${queryResult.total}`))

).subscribe();
0.0.2-alpha.9

2 years ago

0.0.2-alpha.8

2 years ago

0.0.2-alpha.7

3 years ago

0.0.2-alpha.6

3 years ago

0.0.2-alpha.5

3 years ago

0.0.2-alpha.4

3 years ago

0.0.2-alpha.2

3 years ago

0.0.2-alpha.3

3 years ago

0.0.2-alpha.1

3 years ago

0.0.2-alpha.0

3 years ago