diff --git a/api/lib/esri/layer.ts b/api/lib/esri/layer.ts index 6cf0ee013..56e4c8a74 100644 --- a/api/lib/esri/layer.ts +++ b/api/lib/esri/layer.ts @@ -4,7 +4,11 @@ import type { ESRILayer, ESRIField } from './types.js'; export default class Layer { layers: Array>; - constructor(layers: Array> = [DefaultLayer]) { + constructor(layers: Array> = [ + DefaultLayerPoints, + DefaultLayerLines, + DefaultLayerPolys, + ]) { this.layers = layers; } @@ -18,7 +22,165 @@ export default class Layer { } } -export const DefaultLayer: Static = { + +export const DefaultFields = [{ + "name": "objectid", + "type": "esriFieldTypeOID", + "actualType": "int", + "alias": "fid", + "sqlType": "sqlTypeInteger", + "length": 4, + "nullable": false, + "editable": false, + "domain": null, + "defaultValue": null +},{ + "name": "cotuid", + "type": "esriFieldTypeString", + "actualType": "nvarchar", + "alias": "cotuid1", + "sqlType": "sqlTypeNVarchar", + "length": 100, + "nullable": false, + "editable": true, + "domain": null, + "defaultValue": null +},{ + "name": "remarks", + "type": "esriFieldTypeString", + "actualType": "nvarchar", + "alias": "remarks", + "sqlType": "sqlTypeNVarchar", + "length": 2000, + "nullable": false, + "editable": true, + "domain": null, + "defaultValue": null +},{ + "name": "callsign", + "type": "esriFieldTypeString", + "actualType": "nvarchar", + "alias": "callsign", + "sqlType": "sqlTypeNVarchar", + "length": 100, + "nullable": true, + "editable": true, + "domain": null, + "defaultValue": null +},{ + "name": "type", + "type": "esriFieldTypeString", + "actualType": "nvarchar", + "alias": "type", + "sqlType": "sqlTypeNVarchar", + "length": 100, + "nullable": true, + "editable": true, + "domain": null, + "defaultValue": null +},{ + "name": "how", + "type": "esriFieldTypeString", + "actualType": "nvarchar", + "alias": "how", + "sqlType": "sqlTypeNVarchar", + "length": 100, + "nullable": true, + "editable": true, + "domain": null, + "defaultValue": null +},{ + "name": "time", + "type": "esriFieldTypeDate", + "actualType": "datetime2", + "alias": "time", + "sqlType": "sqlTypeTimestamp2", + "length": 100, + "nullable": true, + "editable": true, + "domain": null, + "defaultValue": null +},{ + "name": "start", + "type": "esriFieldTypeDate", + "actualType": "datetime2", + "alias": "start", + "sqlType": "sqlTypeTimestamp2", + "length": 100, + "nullable": true, + "editable": true, + "domain": null, + "defaultValue": null +},{ + "name": "stale", + "type": "esriFieldTypeDate", + "actualType": "datetime2", + "alias": "stale", + "sqlType": "sqlTypeTimestamp2", + "length": 100, + "nullable": true, + "editable": true, + "domain": null, + "defaultValue": null +}] + +export const DefaultLayerPolys: Static = { + id: 2, + name: 'TAK ETL Polys', + description: 'CoT message Polys', + type: 'Feature Layer', + displayField: 'callsign', + supportedQueryFormats: 'JSON', + capabilities: "Create,Delete,Query,Update,Editing,Extract,Sync", + geometryType: 'esriGeometryPolygon', + allowGeometryUpdates: true, + hasAttachments: false, + hasM: false, + hasZ: false, + objectIdField: 'objectid', + extent: { + xmin: -20037508.34, + ymin: -20048966.1, + xmax: 20037508.34, + ymax: 20048966.1, + spatialReference: { wkid: 102100, latestWkid: 3857 }, + }, + uniqueIdField: { + name: "objectid", + isSystemMaintained: true + }, + fields: DefaultFields +} + +export const DefaultLayerLines: Static = { + id: 1, + name: 'TAK ETL Lines', + description: 'CoT message Lines', + type: 'Feature Layer', + displayField: 'callsign', + supportedQueryFormats: 'JSON', + capabilities: "Create,Delete,Query,Update,Editing,Extract,Sync", + geometryType: 'esriGeometryLine', + allowGeometryUpdates: true, + hasAttachments: false, + hasM: false, + hasZ: false, + objectIdField: 'objectid', + extent: { + xmin: -20037508.34, + ymin: -20048966.1, + xmax: 20037508.34, + ymax: 20048966.1, + spatialReference: { wkid: 102100, latestWkid: 3857 }, + }, + uniqueIdField: { + name: "objectid", + isSystemMaintained: true + }, + fields: DefaultFields +} + +export const DefaultLayerPoints: Static = { id: 0, name: 'TAK ETL Points', description: 'CoT message Points', @@ -43,104 +205,5 @@ export const DefaultLayer: Static = { name: "objectid", isSystemMaintained: true }, - fields: [{ - "name": "objectid", - "type": "esriFieldTypeOID", - "actualType": "int", - "alias": "fid", - "sqlType": "sqlTypeInteger", - "length": 4, - "nullable": false, - "editable": false, - "domain": null, - "defaultValue": null - },{ - "name": "cotuid", - "type": "esriFieldTypeString", - "actualType": "nvarchar", - "alias": "cotuid1", - "sqlType": "sqlTypeNVarchar", - "length": 100, - "nullable": false, - "editable": true, - "domain": null, - "defaultValue": null - },{ - "name": "remarks", - "type": "esriFieldTypeString", - "actualType": "nvarchar", - "alias": "remarks", - "sqlType": "sqlTypeNVarchar", - "length": 2000, - "nullable": false, - "editable": true, - "domain": null, - "defaultValue": null - },{ - "name": "callsign", - "type": "esriFieldTypeString", - "actualType": "nvarchar", - "alias": "callsign", - "sqlType": "sqlTypeNVarchar", - "length": 100, - "nullable": true, - "editable": true, - "domain": null, - "defaultValue": null - },{ - "name": "type", - "type": "esriFieldTypeString", - "actualType": "nvarchar", - "alias": "type", - "sqlType": "sqlTypeNVarchar", - "length": 100, - "nullable": true, - "editable": true, - "domain": null, - "defaultValue": null - },{ - "name": "how", - "type": "esriFieldTypeString", - "actualType": "nvarchar", - "alias": "how", - "sqlType": "sqlTypeNVarchar", - "length": 100, - "nullable": true, - "editable": true, - "domain": null, - "defaultValue": null - },{ - "name": "time", - "type": "esriFieldTypeDate", - "actualType": "datetime2", - "alias": "time", - "sqlType": "sqlTypeTimestamp2", - "length": 100, - "nullable": true, - "editable": true, - "domain": null, - "defaultValue": null - },{ - "name": "start", - "type": "esriFieldTypeDate", - "actualType": "datetime2", - "alias": "start", - "sqlType": "sqlTypeTimestamp2", - "length": 100, - "nullable": true, - "editable": true, - "domain": null, - "defaultValue": null - },{ - "name": "stale", - "type": "esriFieldTypeDate", - "actualType": "datetime2", - "alias": "stale", - "sqlType": "sqlTypeTimestamp2", - "length": 100, - "nullable": true, - "editable": true, - "domain": null, - "defaultValue": null - }] + fields: DefaultFields } diff --git a/api/package-lock.json b/api/package-lock.json index 497d3b7e5..e0d6ddd6d 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -796,9 +796,9 @@ } }, "node_modules/@aws-sdk/client-lambda": { - "version": "3.658.1", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-lambda/-/client-lambda-3.658.1.tgz", - "integrity": "sha512-KmsbyvUYhNYyZWdgWTmVfbe+0MLiUj0Ah+50kwTeh6lozwf39LfiZv+gXigbCGDUYaVQuOJXxFgSdqdFx0eKDA==", + "version": "3.659.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-lambda/-/client-lambda-3.659.0.tgz", + "integrity": "sha512-0XBIcMBDm56iOjC0k1EjJR3ewXr2gFNtVRmdchtT7XPe2bYQY4L+K0Xk9TNLoEZAhFuFkh129I2pMrmlaDEl/Q==", "license": "Apache-2.0", "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", @@ -4813,9 +4813,9 @@ } }, "node_modules/@types/node": { - "version": "22.7.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.1.tgz", - "integrity": "sha512-adOMRLVmleuWs/5V/w5/l7o0chDK/az+5ncCsIapTKogsu/3MVWvSgP58qVTXi5IwpfGt8pMobNq9rOWtJyu5Q==", + "version": "22.7.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.3.tgz", + "integrity": "sha512-qXKfhXXqGTyBskvWEzJZPUxSslAiLaB6JGP1ic/XTH9ctGgzdgYguuLP1C601aRTSDNlLb0jbKqXjZ48GNraSA==", "license": "MIT", "dependencies": { "undici-types": "~6.19.2" @@ -7322,9 +7322,9 @@ "license": "MIT" }, "node_modules/fast-uri": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", - "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.2.tgz", + "integrity": "sha512-GR6f0hD7XXyNJa25Tb9BuIdN0tdr+0BMi6/CJPH3wJO1JjNG3n/VsSw38AwRdKZABm8lGbPfakLRkYzx2V9row==", "license": "MIT" }, "node_modules/fast-xml-parser": { @@ -9376,9 +9376,9 @@ } }, "node_modules/nise/node_modules/path-to-regexp": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.1.0.tgz", - "integrity": "sha512-Bqn3vc8CMHty6zuD+tG23s6v2kwxslHEhTj4eYaVKGIEB+YX/2wd0/rgXLFD9G9id9KCtbVy/3ZgmvZjpa0UdQ==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", + "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", "dev": true, "license": "MIT", "engines": { @@ -9654,9 +9654,9 @@ } }, "node_modules/package-json-from-dist": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", - "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", "license": "BlueOak-1.0.0" }, "node_modules/parent-module": {