@del-internet/sdk-cpe
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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 };
};

Readme

Keywords

Package Sidebar

Install

npm i @del-internet/sdk-cpe

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

30.4 kB

Total Files

18

Last publish

Collaborators

  • zareismail