diff --git a/src/api/network-connections-sensor/content-types/network-connections-sensor/schema.json b/src/api/network-connections-sensor/content-types/network-connections-sensor/schema.json new file mode 100644 index 0000000..5f993b9 --- /dev/null +++ b/src/api/network-connections-sensor/content-types/network-connections-sensor/schema.json @@ -0,0 +1,44 @@ +{ + "kind": "collectionType", + "collectionName": "network_connections_sensors", + "info": { + "singularName": "network-connections-sensor", + "pluralName": "network-connections-sensors", + "displayName": "Sensor: Network Connections", + "description": "" + }, + "options": { + "draftAndPublish": false + }, + "attributes": { + "type": { + "type": "enumeration", + "enum": [ + "wifi", + "cable", + "spacenet" + ] + }, + "value": { + "type": "integer", + "required": true + }, + "machines": { + "type": "component", + "repeatable": true, + "component": "network.machine" + }, + "location": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "text" + }, + "lastchange": { + "type": "biginteger" + } + } +} diff --git a/src/api/network-connections-sensor/controllers/network-connections-sensor.ts b/src/api/network-connections-sensor/controllers/network-connections-sensor.ts new file mode 100644 index 0000000..cfe3837 --- /dev/null +++ b/src/api/network-connections-sensor/controllers/network-connections-sensor.ts @@ -0,0 +1,7 @@ +/** + * network-connections-sensor controller + */ + +import { factories } from '@strapi/strapi' + +export default factories.createCoreController('api::network-connections-sensor.network-connections-sensor'); diff --git a/src/api/network-connections-sensor/routes/network-connections-sensor.ts b/src/api/network-connections-sensor/routes/network-connections-sensor.ts new file mode 100644 index 0000000..18bcec9 --- /dev/null +++ b/src/api/network-connections-sensor/routes/network-connections-sensor.ts @@ -0,0 +1,7 @@ +/** + * network-connections-sensor router + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreRouter('api::network-connections-sensor.network-connections-sensor'); diff --git a/src/api/network-connections-sensor/services/network-connections-sensor.ts b/src/api/network-connections-sensor/services/network-connections-sensor.ts new file mode 100644 index 0000000..8672b53 --- /dev/null +++ b/src/api/network-connections-sensor/services/network-connections-sensor.ts @@ -0,0 +1,7 @@ +/** + * network-connections-sensor service + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreService('api::network-connections-sensor.network-connections-sensor'); diff --git a/src/components/network/machine.json b/src/components/network/machine.json new file mode 100644 index 0000000..ca11ef6 --- /dev/null +++ b/src/components/network/machine.json @@ -0,0 +1,17 @@ +{ + "collectionName": "components_network_machines", + "info": { + "displayName": "Machine", + "icon": "oneToMany" + }, + "options": {}, + "attributes": { + "name": { + "type": "string" + }, + "mac": { + "type": "string", + "required": true + } + } +} diff --git a/types/generated/components.d.ts b/types/generated/components.d.ts index 8ed7058..7d7dacb 100644 --- a/types/generated/components.d.ts +++ b/types/generated/components.d.ts @@ -186,6 +186,18 @@ export interface MembershipPlans extends Struct.ComponentSchema { }; } +export interface NetworkMachine extends Struct.ComponentSchema { + collectionName: 'components_network_machines'; + info: { + displayName: 'Machine'; + icon: 'oneToMany'; + }; + attributes: { + mac: Schema.Attribute.String & Schema.Attribute.Required; + name: Schema.Attribute.String; + }; +} + export interface StateStateIcon extends Struct.ComponentSchema { collectionName: 'components_state_state_icons'; info: { @@ -270,6 +282,7 @@ declare module '@strapi/strapi' { 'hackspace.spacefed': HackspaceSpacefed; 'location.area': LocationArea; 'membership.plans': MembershipPlans; + 'network.machine': NetworkMachine; 'state.state-icon': StateStateIcon; 'wind.direction': WindDirection; 'wind.elevation': WindElevation; diff --git a/types/generated/contentTypes.d.ts b/types/generated/contentTypes.d.ts index 72caadc..f62d2a8 100644 --- a/types/generated/contentTypes.d.ts +++ b/types/generated/contentTypes.d.ts @@ -611,6 +611,42 @@ export interface ApiHumiditySensorHumiditySensor }; } +export interface ApiNetworkConnectionsSensorNetworkConnectionsSensor + extends Struct.CollectionTypeSchema { + collectionName: 'network_connections_sensors'; + info: { + description: ''; + displayName: 'Sensor: Network Connections'; + pluralName: 'network-connections-sensors'; + singularName: 'network-connections-sensor'; + }; + options: { + draftAndPublish: false; + }; + attributes: { + createdAt: Schema.Attribute.DateTime; + createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + description: Schema.Attribute.Text; + lastchange: Schema.Attribute.BigInteger; + locale: Schema.Attribute.String & Schema.Attribute.Private; + localizations: Schema.Attribute.Relation< + 'oneToMany', + 'api::network-connections-sensor.network-connections-sensor' + > & + Schema.Attribute.Private; + location: Schema.Attribute.String; + machines: Schema.Attribute.Component<'network.machine', true>; + name: Schema.Attribute.String; + publishedAt: Schema.Attribute.DateTime; + type: Schema.Attribute.Enumeration<['wifi', 'cable', 'spacenet']>; + updatedAt: Schema.Attribute.DateTime; + updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + value: Schema.Attribute.Integer & Schema.Attribute.Required; + }; +} + export interface ApiPowerConsumptionSensorPowerConsumptionSensor extends Struct.CollectionTypeSchema { collectionName: 'power_consumption_sensors'; @@ -1348,6 +1384,7 @@ declare module '@strapi/strapi' { 'api::event.event': ApiEventEvent; 'api::hackspace.hackspace': ApiHackspaceHackspace; 'api::humidity-sensor.humidity-sensor': ApiHumiditySensorHumiditySensor; + 'api::network-connections-sensor.network-connections-sensor': ApiNetworkConnectionsSensorNetworkConnectionsSensor; 'api::power-consumption-sensor.power-consumption-sensor': ApiPowerConsumptionSensorPowerConsumptionSensor; 'api::power-generation-sensor.power-generation-sensor': ApiPowerGenerationSensorPowerGenerationSensor; 'api::radiation-sensor.radiation-sensor': ApiRadiationSensorRadiationSensor;