1.0.2 • Published 1 month ago

@del-internet/sdk-cpe v1.0.2

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
1 month ago

CPE & ACS

This package written to work with Delinternet ACS service. the package contains only devices API's.

Usage

To use the package in you project do it like so:

import factory from '@del-internet/sdk-cpe';

const ACS = factory({ endpoint: 'acs.example.com' });

await ACS.devices.all() // to list all devices
await ACS.devices.find('device_id') // to get device by its id
...

Extending

to add more collection API you could create another collection like so:

///
...

import Collection from '../Collection';

export default class Tasks extends Collection<Task> {

  /**
   * Get collection uri.
   */
  protected abstract collection(): string {
    return 'tasks'
  }
}

then export you endpoint in index.ts:

export const factory = (config: Config) => {
  const client = new Client(config);
  const devices = new Devices(client);
  const tasks = new Tasks(client);

  return { client, devices, tasks };
};
1.0.2

1 month ago

1.0.1

2 months ago

1.0.0

2 months ago