|
1 | 1 | import Err from '@openaddresses/batch-error'; |
| 2 | +import { Feature } from '@tak-ps/node-cot'; |
2 | 3 | import Schema from '@openaddresses/batch-schema'; |
3 | 4 | import type { Static, TSchema } from '@sinclair/typebox'; |
4 | 5 | import { Type } from '@sinclair/typebox'; |
5 | | -import ETL, { DataFlowType, SchemaType, handler as internal, local, InvocationType, fetch, InputFeatureCollection, InputFeature } from '@tak-ps/etl'; |
| 6 | +import ETL, { DataFlowType, SchemaType, handler as internal, local, InvocationType, fetch } from '@tak-ps/etl'; |
6 | 7 | import type { Event } from '@tak-ps/etl'; |
7 | 8 |
|
8 | 9 | export interface Share { |
@@ -41,7 +42,7 @@ const EphemeralStore = Type.Object({ |
41 | 42 | cachetime: Type.Optional(Type.Integer({ |
42 | 43 | description: 'Cache timestamp for the last time devices were synced via the API' |
43 | 44 | })), |
44 | | - devices: Type.Optional(Type.Record(Type.String(), InputFeature)) |
| 45 | + devices: Type.Optional(Type.Record(Type.String(), Feature.InputFeature)) |
45 | 46 | }) |
46 | 47 |
|
47 | 48 | const Input = Type.Object({ |
@@ -117,7 +118,7 @@ export default class Task extends ETL { |
117 | 118 | } |
118 | 119 |
|
119 | 120 | try { |
120 | | - const feat: Static<typeof InputFeature> = { |
| 121 | + const feat: Static<typeof Feature.InputFeature> = { |
121 | 122 | id: `inreach-${req.body.entityId}`, |
122 | 123 | type: 'Feature', |
123 | 124 | properties: { |
@@ -206,7 +207,7 @@ export default class Task extends ETL { |
206 | 207 |
|
207 | 208 | ephem.cachetime = new Date().getTime(); |
208 | 209 |
|
209 | | - const fc: Static<typeof InputFeatureCollection> = { |
| 210 | + const fc: Static<typeof Feature.InputFeatureCollection> = { |
210 | 211 | type: 'FeatureCollection', |
211 | 212 | features: latest.features.map((feature) => { |
212 | 213 | return { |
@@ -243,7 +244,7 @@ export default class Task extends ETL { |
243 | 244 | } else { |
244 | 245 | console.log('ok - reusing cached data'); |
245 | 246 |
|
246 | | - const fc: Static<typeof InputFeatureCollection> = { |
| 247 | + const fc: Static<typeof Feature.InputFeatureCollection> = { |
247 | 248 | type: 'FeatureCollection', |
248 | 249 | features: [] |
249 | 250 | }; |
|
0 commit comments