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