Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update dependencies and migrate backend definition syntax #11

Merged
merged 6 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 12 additions & 19 deletions apps/api/lib/IoTApplication.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
import {
registerKIoTP,
EventIoTPlatformErrorSave,
Module as KIoTPModule,
} from '@kuzzleio/iot-platform-backend';
import { registerKIoTP, EventIoTPlatformErrorSave, Module } from '@kuzzleio/iot-platform-backend';
import { Backend } from 'kuzzle';

import { registerExempleTenant } from './modules/tenant_exemple';
import { Module } from './modules/shared';
import { DevicesModule } from './modules/devices';
import { MeasuresModule } from './modules/measures/MeasuresModule';
import { WorkflowsModule } from './modules/workflows';
import { TenantExample } from './modules/tenant_example/TenantExample';

export type IoTApplicationConfig = {
someValue: string;
};

export class IoTApplication extends Backend {
private readonly kiotpModules: KIoTPModule[] = [];

private modules: Module[] = [];

get appConfig() {
Expand All @@ -27,36 +20,36 @@ export class IoTApplication extends Backend {
constructor() {
super('iot-application');

// ? Enable logger to debug level on stdout
// this.config.content.plugins['kuzzle-plugin-logger'].services.stdout.level = 'debug';

this.hook.register<EventIoTPlatformErrorSave>('iot-platform:error:save', ({ error }) => {
this.log.error(error);
});

// this.config.content.plugins['kuzzle-plugin-logger'].services.stdout.level = 'debug';

etrousset marked this conversation as resolved.
Show resolved Hide resolved
this.kiotpModules = registerKIoTP(this);
this.modules = registerKIoTP(this, false);

// Register custom modules here
this.modules.push(new MeasuresModule(this)); // Register the measures models for your application
this.modules.push(new DevicesModule(this)); // Register the devices models and decoders for your application
this.modules.push(new WorkflowsModule(this)); // Register the Workflows, Tasks, Predicates for your application

for (const module of this.modules) {
module.register();
}

// Register the exemple tenant that will be used to demonstrate the application
// Register the example tenant that will be used to demonstrate the application
// It defines a tenant with :
// * custom asset model,
// * custom roles, profiles, and policies,
// * additionnal data collections
this.modules.push(new TenantExample(this));

registerExempleTenant(this);
for (const module of this.modules) {
module.register();
}
}

async start() {
await super.start();

for (const module of this.kiotpModules) {
for (const module of this.modules) {
await module.init();
}

Expand Down
77 changes: 0 additions & 77 deletions apps/api/lib/modules/air_quality/assets/Room.ts

This file was deleted.

11 changes: 0 additions & 11 deletions apps/api/lib/modules/air_quality/assets/index.ts

This file was deleted.

55 changes: 0 additions & 55 deletions apps/api/lib/modules/air_quality/devices/Airly.ts

This file was deleted.

79 changes: 0 additions & 79 deletions apps/api/lib/modules/air_quality/devices/AirlyDecoder.ts

This file was deleted.

9 changes: 0 additions & 9 deletions apps/api/lib/modules/air_quality/devices/CO2Measurement.ts

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading