diff --git a/api/lib/models.ts b/api/lib/models.ts index 4b92eb1fc..fe7c4c8dc 100644 --- a/api/lib/models.ts +++ b/api/lib/models.ts @@ -35,6 +35,7 @@ export default class Models { Layer: Layer; LayerIncoming: Modeler;; + LayerOutgoing: Modeler;; LayerTemplate: Modeler; LayerAlert: Modeler; @@ -61,6 +62,8 @@ export default class Models { this.Iconset = new Modeler(pg, pgtypes.Iconset); this.Layer = new Layer(pg); this.LayerIncoming = new Modeler(pg, pgtypes.LayerIncoming); + this.LayerOutgoing = new Modeler(pg, pgtypes.LayerOutgoing); + this.LayerAlert = new Modeler(pg, pgtypes.LayerAlert); this.LayerTemplate = new Modeler(pg, pgtypes.LayerTemplate); } diff --git a/api/lib/models/Layer.ts b/api/lib/models/Layer.ts index 882d427a2..1ba4c0124 100644 --- a/api/lib/models/Layer.ts +++ b/api/lib/models/Layer.ts @@ -14,6 +14,14 @@ export const Layer_Config = Type.Object({ })) }); +export const AugmentedLayerOutgoing = Type.Object({ + layer: Type.Integer(), + created: Type.String(), + updated: Type.String(), + environment: Type.Any(), + ephemeral: Type.Record(Type.String(), Type.String()), +}) + export const AugmentedLayerIncoming = Type.Object({ layer: Type.Integer(), created: Type.String(), @@ -49,7 +57,8 @@ export const AugmentedLayer = Type.Object({ timeout: Type.Integer(), priority: Type.Enum(Layer_Priority), - incoming: Type.Optional(AugmentedLayerIncoming) + incoming: Type.Optional(AugmentedLayerIncoming), + outgoing: Type.Optional(AugmentedLayerOutgoing) }); export default class LayerModel extends Modeler { @@ -88,6 +97,13 @@ export default class LayerModel extends Modeler { delete l.incoming; } + if (l.outgoing && l.outgoing.layer) { + if (typeof l.outgoing.ephemeral === 'string') l.outgoing.ephemeral = JSON.parse(l.outgoing.ephemeral) + if (typeof l.outgoing.environment === 'string') l.outgoing.environment = JSON.parse(l.outgoing.environment) + } else { + delete l.outgoing; + } + return l } @@ -146,6 +162,14 @@ export default class LayerModel extends Modeler { data: LayerIncoming.data, enabled_styles: LayerIncoming.enabled_styles, styles: LayerIncoming.styles, + }), + + outgoing: jsonBuildObject({ + layer: LayerIncoming.layer, + created: LayerIncoming.created, + updated: LayerIncoming.updated, + environment: LayerIncoming.environment, + ephemeral: LayerIncoming.ephemeral, }) }) .from(Layer) @@ -196,6 +220,14 @@ export default class LayerModel extends Modeler { data: LayerIncoming.data, enabled_styles: LayerIncoming.enabled_styles, styles: LayerIncoming.styles, + }), + + outgoing: jsonBuildObject({ + layer: LayerIncoming.layer, + created: LayerIncoming.created, + updated: LayerIncoming.updated, + environment: LayerIncoming.environment, + ephemeral: LayerIncoming.ephemeral, }) }) .from(Layer) diff --git a/api/migrations/0090_nosy_thunderbolts.sql b/api/migrations/0090_nosy_thunderbolts.sql new file mode 100644 index 000000000..03242efbd --- /dev/null +++ b/api/migrations/0090_nosy_thunderbolts.sql @@ -0,0 +1,9 @@ +CREATE TABLE "layers_outgoing" ( + "layer" integer PRIMARY KEY NOT NULL, + "created" timestamp with time zone DEFAULT Now() NOT NULL, + "updated" timestamp with time zone DEFAULT Now() NOT NULL, + "environment" json DEFAULT '{}'::json NOT NULL, + "ephemeral" json DEFAULT '{}'::json NOT NULL +); +--> statement-breakpoint +ALTER TABLE "layers_outgoing" ADD CONSTRAINT "layers_outgoing_layer_layers_id_fk" FOREIGN KEY ("layer") REFERENCES "public"."layers"("id") ON DELETE no action ON UPDATE no action; \ No newline at end of file diff --git a/api/migrations/meta/0090_snapshot.json b/api/migrations/meta/0090_snapshot.json new file mode 100644 index 000000000..6653a2838 --- /dev/null +++ b/api/migrations/meta/0090_snapshot.json @@ -0,0 +1,2471 @@ +{ + "id": "7a2a8003-7c6c-4eaf-a5ee-246c60d9d1a6", + "prevId": "ce5e2506-8ad5-4698-af0d-433cff4b3013", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.basemaps": { + "name": "basemaps", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'callsign'" + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "overlay": { + "name": "overlay", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "bounds": { + "name": "bounds", + "type": "GEOMETRY(POLYGON, 4326)", + "primaryKey": false, + "notNull": false + }, + "center": { + "name": "center", + "type": "GEOMETRY(POINT, 4326)", + "primaryKey": false, + "notNull": false + }, + "minzoom": { + "name": "minzoom", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "maxzoom": { + "name": "maxzoom", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 16 + }, + "collection": { + "name": "collection", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "format": { + "name": "format", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'png'" + }, + "style": { + "name": "style", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'zxy'" + }, + "styles": { + "name": "styles", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'[]'::json" + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'raster'" + } + }, + "indexes": { + "basemaps_username_idx": { + "name": "basemaps_username_idx", + "columns": [ + { + "expression": "username", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "basemaps_username_profile_username_fk": { + "name": "basemaps_username_profile_username_fk", + "tableFrom": "basemaps", + "tableTo": "profile", + "columnsFrom": [ + "username" + ], + "columnsTo": [ + "username" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "basemaps_collection_basemaps_collection_id_fk": { + "name": "basemaps_collection_basemaps_collection_id_fk", + "tableFrom": "basemaps", + "tableTo": "basemaps_collection", + "columnsFrom": [ + "collection" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.basemaps_collection": { + "name": "basemaps_collection", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.connections": { + "name": "connections", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "agency": { + "name": "agency", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "auth": { + "name": "auth", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.connection_sinks": { + "name": "connection_sinks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "connection": { + "name": "connection", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "body": { + "name": "body", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'::json" + }, + "logging": { + "name": "logging", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "connection_sinks_connection_connections_id_fk": { + "name": "connection_sinks_connection_connections_id_fk", + "tableFrom": "connection_sinks", + "tableTo": "connections", + "columnsFrom": [ + "connection" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.connection_tokens": { + "name": "connection_tokens", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "connection": { + "name": "connection", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + } + }, + "indexes": {}, + "foreignKeys": { + "connection_tokens_connection_connections_id_fk": { + "name": "connection_tokens_connection_connections_id_fk", + "tableFrom": "connection_tokens", + "tableTo": "connections", + "columnsFrom": [ + "connection" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.data": { + "name": "data", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "auto_transform": { + "name": "auto_transform", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "mission_sync": { + "name": "mission_sync", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "mission_diff": { + "name": "mission_diff", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "mission_role": { + "name": "mission_role", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'MISSION_SUBSCRIBER'" + }, + "mission_token": { + "name": "mission_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mission_groups": { + "name": "mission_groups", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "assets": { + "name": "assets", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'[\"*\"]'::json" + }, + "connection": { + "name": "connection", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "data_connection_connections_id_fk": { + "name": "data_connection_connections_id_fk", + "tableFrom": "data", + "tableTo": "connections", + "columnsFrom": [ + "connection" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.fusion_type": { + "name": "fusion_type", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "schema": { + "name": "schema", + "type": "json", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.icons": { + "name": "icons", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "iconset": { + "name": "iconset", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type2525b": { + "name": "type2525b", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "data": { + "name": "data", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "data_alt": { + "name": "data_alt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "icons_iconset_iconsets_uid_fk": { + "name": "icons_iconset_iconsets_uid_fk", + "tableFrom": "icons", + "tableTo": "iconsets", + "columnsFrom": [ + "iconset" + ], + "columnsTo": [ + "uid" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.iconsets": { + "name": "iconsets", + "schema": "", + "columns": { + "uid": { + "name": "uid", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "version": { + "name": "version", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "default_group": { + "name": "default_group", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "default_friendly": { + "name": "default_friendly", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "default_hostile": { + "name": "default_hostile", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "default_neutral": { + "name": "default_neutral", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "default_unknown": { + "name": "default_unknown", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "skip_resize": { + "name": "skip_resize", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "iconsets_username_idx": { + "name": "iconsets_username_idx", + "columns": [ + { + "expression": "username", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "iconsets_username_profile_username_fk": { + "name": "iconsets_username_profile_username_fk", + "tableFrom": "iconsets", + "tableTo": "profile", + "columnsFrom": [ + "username" + ], + "columnsTo": [ + "username" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.imports": { + "name": "imports", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'Pending'" + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "batch": { + "name": "batch", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "result": { + "name": "result", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'::json" + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mode": { + "name": "mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'Unknown'" + }, + "mode_id": { + "name": "mode_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "config": { + "name": "config", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'::json" + } + }, + "indexes": {}, + "foreignKeys": { + "imports_username_profile_username_fk": { + "name": "imports_username_profile_username_fk", + "tableFrom": "imports", + "tableTo": "profile", + "columnsFrom": [ + "username" + ], + "columnsTo": [ + "username" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.layers": { + "name": "layers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "uuid": { + "name": "uuid", + "type": "uuid", + "primaryKey": false, + "notNull": true, + "default": "gen_random_uuid()" + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "priority": { + "name": "priority", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'off'" + }, + "connection": { + "name": "connection", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "logging": { + "name": "logging", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "task": { + "name": "task", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "memory": { + "name": "memory", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 128 + }, + "timeout": { + "name": "timeout", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 128 + } + }, + "indexes": {}, + "foreignKeys": { + "layers_connection_connections_id_fk": { + "name": "layers_connection_connections_id_fk", + "tableFrom": "layers", + "tableTo": "connections", + "columnsFrom": [ + "connection" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "layers_connection_name_unique": { + "name": "layers_connection_name_unique", + "nullsNotDistinct": false, + "columns": [ + "connection", + "name" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.layer_alerts": { + "name": "layer_alerts", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "layer": { + "name": "layer", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'alert-circle'" + }, + "priority": { + "name": "priority", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'yellow'" + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'Details Unknown'" + }, + "hidden": { + "name": "hidden", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "layer_alerts_layer_layers_id_fk": { + "name": "layer_alerts_layer_layers_id_fk", + "tableFrom": "layer_alerts", + "tableTo": "layers", + "columnsFrom": [ + "layer" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.layers_incoming": { + "name": "layers_incoming", + "schema": "", + "columns": { + "layer": { + "name": "layer", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "cron": { + "name": "cron", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "webhooks": { + "name": "webhooks", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "alarm_period": { + "name": "alarm_period", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 30 + }, + "alarm_evals": { + "name": "alarm_evals", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 5 + }, + "alarm_points": { + "name": "alarm_points", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 4 + }, + "alarm_threshold": { + "name": "alarm_threshold", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "enabled_styles": { + "name": "enabled_styles", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "styles": { + "name": "styles", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'::json" + }, + "stale": { + "name": "stale", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 20 + }, + "environment": { + "name": "environment", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'::json" + }, + "ephemeral": { + "name": "ephemeral", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'::json" + }, + "config": { + "name": "config", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'::json" + }, + "data": { + "name": "data", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "layers_incoming_layer_layers_id_fk": { + "name": "layers_incoming_layer_layers_id_fk", + "tableFrom": "layers_incoming", + "tableTo": "layers", + "columnsFrom": [ + "layer" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "layers_incoming_data_data_id_fk": { + "name": "layers_incoming_data_data_id_fk", + "tableFrom": "layers_incoming", + "tableTo": "data", + "columnsFrom": [ + "data" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.layers_outgoing": { + "name": "layers_outgoing", + "schema": "", + "columns": { + "layer": { + "name": "layer", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "environment": { + "name": "environment", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'::json" + }, + "ephemeral": { + "name": "ephemeral", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'::json" + } + }, + "indexes": {}, + "foreignKeys": { + "layers_outgoing_layer_layers_id_fk": { + "name": "layers_outgoing_layer_layers_id_fk", + "tableFrom": "layers_outgoing", + "tableTo": "layers", + "columnsFrom": [ + "layer" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.layers_template": { + "name": "layers_template", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "datasync": { + "name": "datasync", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "priority": { + "name": "priority", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'off'" + }, + "enabled_styles": { + "name": "enabled_styles", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "styles": { + "name": "styles", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'::json" + }, + "logging": { + "name": "logging", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "stale": { + "name": "stale", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 20 + }, + "task": { + "name": "task", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "cron": { + "name": "cron", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "webhooks": { + "name": "webhooks", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "config": { + "name": "config", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'::json" + }, + "memory": { + "name": "memory", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 128 + }, + "timeout": { + "name": "timeout", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 128 + }, + "alarm_period": { + "name": "alarm_period", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 30 + }, + "alarm_evals": { + "name": "alarm_evals", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 5 + }, + "alarm_points": { + "name": "alarm_points", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 4 + }, + "alarm_threshold": { + "name": "alarm_threshold", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": {}, + "foreignKeys": { + "layers_template_username_profile_username_fk": { + "name": "layers_template_username_profile_username_fk", + "tableFrom": "layers_template", + "tableTo": "profile", + "columnsFrom": [ + "username" + ], + "columnsTo": [ + "username" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.profile": { + "name": "profile", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'Unknown'" + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "last_login": { + "name": "last_login", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "auth": { + "name": "auth", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "phone": { + "name": "phone", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "tak_callsign": { + "name": "tak_callsign", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'CloudTAK User'" + }, + "tak_remarks": { + "name": "tak_remarks", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'CloudTAK User'" + }, + "tak_group": { + "name": "tak_group", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'Orange'" + }, + "tak_role": { + "name": "tak_role", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'Team Member'" + }, + "tak_loc": { + "name": "tak_loc", + "type": "GEOMETRY(POINT, 4326)", + "primaryKey": false, + "notNull": false + }, + "tak_loc_freq": { + "name": "tak_loc_freq", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 2000 + }, + "display_stale": { + "name": "display_stale", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'10 Minutes'" + }, + "display_distance": { + "name": "display_distance", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'mile'" + }, + "display_elevation": { + "name": "display_elevation", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'feet'" + }, + "display_speed": { + "name": "display_speed", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'mi/h'" + }, + "display_projection": { + "name": "display_projection", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'globe'" + }, + "display_text": { + "name": "display_text", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'Medium'" + }, + "system_admin": { + "name": "system_admin", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "agency_admin": { + "name": "agency_admin", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'[]'::json" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.profile_chats": { + "name": "profile_chats", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chatroom": { + "name": "chatroom", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sender_callsign": { + "name": "sender_callsign", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sender_uid": { + "name": "sender_uid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "message_id": { + "name": "message_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "profile_chats_username_profile_username_fk": { + "name": "profile_chats_username_profile_username_fk", + "tableFrom": "profile_chats", + "tableTo": "profile", + "columnsFrom": [ + "username" + ], + "columnsTo": [ + "username" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.profile_features": { + "name": "profile_features", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'/'" + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "properties": { + "name": "properties", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'::json" + }, + "geometry": { + "name": "geometry", + "type": "GEOMETRY(GEOMETRYZ, 4326)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "profile_features_username_profile_username_fk": { + "name": "profile_features_username_profile_username_fk", + "tableFrom": "profile_features", + "tableTo": "profile", + "columnsFrom": [ + "username" + ], + "columnsTo": [ + "username" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.profile_fusion": { + "name": "profile_fusion", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fusion": { + "name": "fusion", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'::json" + } + }, + "indexes": {}, + "foreignKeys": { + "profile_fusion_username_profile_username_fk": { + "name": "profile_fusion_username_profile_username_fk", + "tableFrom": "profile_fusion", + "tableTo": "profile", + "columnsFrom": [ + "username" + ], + "columnsTo": [ + "username" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "profile_fusion_fusion_fusion_type_id_fk": { + "name": "profile_fusion_fusion_fusion_type_id_fk", + "tableFrom": "profile_fusion", + "tableTo": "fusion_type", + "columnsFrom": [ + "fusion" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.profile_interests": { + "name": "profile_interests", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "bounds": { + "name": "bounds", + "type": "GEOMETRY(POLYGON, 4326)", + "primaryKey": false, + "notNull": false + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + } + }, + "indexes": {}, + "foreignKeys": { + "profile_interests_username_profile_username_fk": { + "name": "profile_interests_username_profile_username_fk", + "tableFrom": "profile_interests", + "tableTo": "profile", + "columnsFrom": [ + "username" + ], + "columnsTo": [ + "username" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.profile_missions": { + "name": "profile_missions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "guid": { + "name": "guid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.profile_overlays": { + "name": "profile_overlays", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "pos": { + "name": "pos", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 5 + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'vector'" + }, + "opacity": { + "name": "opacity", + "type": "numeric", + "primaryKey": false, + "notNull": true, + "default": "'1'" + }, + "visible": { + "name": "visible", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "styles": { + "name": "styles", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'[]'::json" + }, + "mode": { + "name": "mode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mode_id": { + "name": "mode_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "profile_overlays_username_profile_username_fk": { + "name": "profile_overlays_username_profile_username_fk", + "tableFrom": "profile_overlays", + "tableTo": "profile", + "columnsFrom": [ + "username" + ], + "columnsTo": [ + "username" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "profile_overlays_username_url_unique": { + "name": "profile_overlays_username_url_unique", + "nullsNotDistinct": false, + "columns": [ + "username", + "url" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.server": { + "name": "server", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'Default'" + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "auth": { + "name": "auth", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'::json" + }, + "api": { + "name": "api", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "webtak": { + "name": "webtak", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.settings": { + "name": "settings", + "schema": "", + "columns": { + "key": { + "name": "key", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.spatial_ref_sys": { + "name": "spatial_ref_sys", + "schema": "", + "columns": { + "srid": { + "name": "srid", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "auth_name": { + "name": "auth_name", + "type": "varchar(256)", + "primaryKey": false, + "notNull": false + }, + "auth_srid": { + "name": "auth_srid", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "srtext": { + "name": "srtext", + "type": "varchar(2048)", + "primaryKey": false, + "notNull": false + }, + "proj4text": { + "name": "proj4text", + "type": "varchar(2048)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tasks": { + "name": "tasks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "prefix": { + "name": "prefix", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "repo": { + "name": "repo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "readme": { + "name": "readme", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "tasks_prefix_unique": { + "name": "tasks_prefix_unique", + "nullsNotDistinct": false, + "columns": [ + "prefix" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tokens": { + "name": "tokens", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.video_lease": { + "name": "video_lease", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created": { + "name": "created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "updated": { + "name": "updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "Now()" + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ephemeral": { + "name": "ephemeral", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "channel": { + "name": "channel", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "null" + }, + "expiration": { + "name": "expiration", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "Now() + INTERVAL 1 HOUR;" + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "stream_user": { + "name": "stream_user", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stream_pass": { + "name": "stream_pass", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "read_user": { + "name": "read_user", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "read_pass": { + "name": "read_pass", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "proxy": { + "name": "proxy", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "null" + } + }, + "indexes": {}, + "foreignKeys": { + "video_lease_username_profile_username_fk": { + "name": "video_lease_username_profile_username_fk", + "tableFrom": "video_lease", + "tableTo": "profile", + "columnsFrom": [ + "username" + ], + "columnsTo": [ + "username" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/api/migrations/meta/_journal.json b/api/migrations/meta/_journal.json index e194f1029..06240aba4 100644 --- a/api/migrations/meta/_journal.json +++ b/api/migrations/meta/_journal.json @@ -631,6 +631,13 @@ "when": 1738278981225, "tag": "0089_wise_fallen_one", "breakpoints": true + }, + { + "idx": 90, + "version": "7", + "when": 1738292998153, + "tag": "0090_nosy_thunderbolts", + "breakpoints": true } ] } \ No newline at end of file diff --git a/api/routes/connection-layer.ts b/api/routes/connection-layer.ts index 887d9a3f5..686f3d759 100644 --- a/api/routes/connection-layer.ts +++ b/api/routes/connection-layer.ts @@ -692,6 +692,10 @@ export default async function router(schema: Schema, config: Config) { await config.models.LayerIncoming.delete(req.params.layerid); } + if (layer.outgoing) { + await config.models.LayerOutgoing.delete(req.params.layerid); + } + config.events.delete(layer.id); await config.models.Layer.delete(req.params.layerid); diff --git a/api/web/src/derived-types.d.ts b/api/web/src/derived-types.d.ts index 7052b8a34..478c0e036 100644 --- a/api/web/src/derived-types.d.ts +++ b/api/web/src/derived-types.d.ts @@ -2712,12 +2712,14 @@ export interface paths { enabled: boolean; logging: boolean; task: string; - connection?: number; + connection: number; memory: number; timeout: number; priority: "high" | "low" | "off"; incoming?: { layer: number; + created: string; + updated: string; config: { timezone?: { timezone: string; @@ -2844,7 +2846,13 @@ export interface paths { environment: unknown; ephemeral: Record; data: number | null; - schema: unknown; + }; + outgoing?: { + layer: number; + created: string; + updated: string; + environment: unknown; + ephemeral: Record; }; }[]; }; @@ -2899,12 +2907,14 @@ export interface paths { enabled: boolean; logging: boolean; task: string; - connection?: number; + connection: number; memory: number; timeout: number; priority: "high" | "low" | "off"; incoming?: { layer: number; + created: string; + updated: string; config: { timezone?: { timezone: string; @@ -3031,7 +3041,13 @@ export interface paths { environment: unknown; ephemeral: Record; data: number | null; - schema: unknown; + }; + outgoing?: { + layer: number; + created: string; + updated: string; + environment: unknown; + ephemeral: Record; }; }; }; @@ -3201,6 +3217,8 @@ export interface paths { content: { "application/json": { layer: number; + created: string; + updated: string; config: { timezone?: { timezone: string; @@ -3327,7 +3345,6 @@ export interface paths { environment: unknown; ephemeral: Record; data: number | null; - schema: unknown; }; }; }; @@ -3507,6 +3524,8 @@ export interface paths { content: { "application/json": { layer: number; + created: string; + updated: string; config: { timezone?: { timezone: string; @@ -3633,7 +3652,6 @@ export interface paths { environment: unknown; ephemeral: Record; data: number | null; - schema: unknown; }; }; }; @@ -3678,12 +3696,14 @@ export interface paths { enabled: boolean; logging: boolean; task: string; - connection?: number; + connection: number; memory: number; timeout: number; priority: "high" | "low" | "off"; incoming?: { layer: number; + created: string; + updated: string; config: { timezone?: { timezone: string; @@ -3810,7 +3830,13 @@ export interface paths { environment: unknown; ephemeral: Record; data: number | null; - schema: unknown; + }; + outgoing?: { + layer: number; + created: string; + updated: string; + environment: unknown; + ephemeral: Record; }; }; }; @@ -3890,12 +3916,14 @@ export interface paths { enabled: boolean; logging: boolean; task: string; - connection?: number; + connection: number; memory: number; timeout: number; priority: "high" | "low" | "off"; incoming?: { layer: number; + created: string; + updated: string; config: { timezone?: { timezone: string; @@ -4022,7 +4050,13 @@ export interface paths { environment: unknown; ephemeral: Record; data: number | null; - schema: unknown; + }; + outgoing?: { + layer: number; + created: string; + updated: string; + environment: unknown; + ephemeral: Record; }; }; }; @@ -6394,6 +6428,8 @@ export interface paths { query: { /** @description Limit the number of responses returned */ limit: number; + /** @description Get Live Alarm state from CloudWatch */ + alarms: boolean; /** @description Iterate through "pages" of items based on the "limit" query param */ page: number; /** @description Order in which results are returned based on the "sort" query param */ @@ -6440,12 +6476,14 @@ export interface paths { enabled: boolean; logging: boolean; task: string; - connection?: number; + connection: number; memory: number; timeout: number; priority: "high" | "low" | "off"; incoming?: { layer: number; + created: string; + updated: string; config: { timezone?: { timezone: string; @@ -6572,7 +6610,13 @@ export interface paths { environment: unknown; ephemeral: Record; data: number | null; - schema: unknown; + }; + outgoing?: { + layer: number; + created: string; + updated: string; + environment: unknown; + ephemeral: Record; }; }[]; }; @@ -6602,7 +6646,10 @@ export interface paths { * */ get: { parameters: { - query?: never; + query: { + /** @description Get Live Alarm state from CloudWatch */ + alarms: boolean; + }; header?: never; path?: never; cookie?: never; @@ -6626,12 +6673,14 @@ export interface paths { enabled: boolean; logging: boolean; task: string; - connection?: number; + connection: number; memory: number; timeout: number; priority: "high" | "low" | "off"; incoming?: { layer: number; + created: string; + updated: string; config: { timezone?: { timezone: string; @@ -6758,7 +6807,13 @@ export interface paths { environment: unknown; ephemeral: Record; data: number | null; - schema: unknown; + }; + outgoing?: { + layer: number; + created: string; + updated: string; + environment: unknown; + ephemeral: Record; }; }; }; diff --git a/api/web/src/stores/base/overlay.ts b/api/web/src/stores/base/overlay.ts index 543733964..9113fae4f 100644 --- a/api/web/src/stores/base/overlay.ts +++ b/api/web/src/stores/base/overlay.ts @@ -265,9 +265,11 @@ export default class Overlay { for (const click of opts.clickable) { mapStore.map.on('mouseenter', click.id, () => { + if (mapStore.drawOptions.mode !== 'static') return; mapStore.map.getCanvas().style.cursor = 'pointer'; }) mapStore.map.on('mouseleave', click.id, () => { + if (mapStore.drawOptions.mode !== 'static') return; mapStore.map.getCanvas().style.cursor = ''; }) }