New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@dynamiccontrols/cloud-integration-server

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dynamiccontrols/cloud-integration-server

A TypeScript-based framework for building cloud integration servers for Dynamic Controls Home Automation System.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Cloud Integration Server

A TypeScript-based framework for building cloud integration servers for Dynamic Controls Home Automation System.

Usage

Extending the CloudIntegrationServer

Create a new class that extends CloudIntegrationServer and implement the abstract methods:

import { CloudIntegrationServer, LoggerInterface, CloudIntegrationServerOptions, type Context } from './src/cloudIntegrationServer';
import type { ExecuteRequestPayload, ExecuteResponsePayload, SyncResponsePayload } from './src/types';

class MyIntegrationServer extends CloudIntegrationServer {
  constructor(logger: LoggerInterface, options: CloudIntegrationServerOptions) {
    super(logger, options);
  }

  async handleExecute(request: ExecuteRequestPayload, context: Context): Promise<ExecuteResponsePayload> {
    // Implement your EXECUTE logic here
    // Handle device executions and optionally report state changes
    return { status: 'SUCCESS' };
  }

  async handleSync(context: Context): Promise<SyncResponsePayload> {
    // Implement your SYNC logic here
    // Return device information for synchronization
    return {
      agentUserId: 'user-id',
      devices: []
    };
  }
}

Starting the Server

const logger: LoggerInterface = {
  info: (message, meta) => console.log(message, meta),
  error: (message, meta) => console.error(message, meta)
};

const options: CloudIntegrationServerOptions = {
  port: 3000,
  path: '/api/integration',
  reportStateUrl: 'https://api.example.com/report-state',
  apiKey: 'your-api-key'
};

const server = new MyIntegrationServer(logger, options);
await server.start();

Methods

handleExecute(request, context)

Abstract method to handle EXECUTE requests. Implement device control logic here.

handleSync(context)

Abstract method to handle SYNC requests. Return device information for synchronization.

reportState(userId, payload)

Report device state changes to the configured report state URL.

Configuration

The server requires the following configuration options:

  • port: Server port number
  • path: API endpoint path
  • reportStateUrl: URL for reporting state changes
  • apiKey: API key for authentication when reporting state changes

Development

Building

npm run build

Testing

npm run build:test
npm test

FAQs

Package last updated on 09 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts