UNPKG

596 BPlain TextView Raw
1/// <reference path="../typings/zetapush.d.ts" />
2
3const { Authentication, Client, services } = ZetaPush
4
5const client = new Client({
6 apiUrl: '',
7 sandboxId: '',
8 authentication: () => Authentication.simple({
9 login: 'login',
10 password: 'password'
11 })
12})
13
14client.onSuccessfulHandshake((authentication) => {
15 console.log(authentication);
16})
17
18client.connect()
19
20class Api extends services.Macro {
21 hello() {
22 return Promise.resolve('world')
23 }
24}
25
26const service = client.createAsyncMacroService({
27 Type: Api
28}) as Api
29
30service.hello().then((message) => {
31 console.log(message);
32})