@feltmaps/js-sdk 1.6.0 → 1.7.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.cjs +1 -1
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +1 -1
- package/dist/{controller-C5gGWnaM.d.cts → controller-o3EwSJvB.d.cts} +258 -4
- package/dist/{controller-C5gGWnaM.d.ts → controller-o3EwSJvB.d.ts} +258 -4
- package/dist/handler.cjs +1 -1
- package/dist/handler.d.cts +148 -7
- package/dist/handler.d.ts +148 -7
- package/dist/handler.js +1 -1
- package/package.json +2 -1
|
@@ -5782,6 +5782,7 @@ interface LayerBoundaries {
|
|
|
5782
5782
|
}
|
|
5783
5783
|
|
|
5784
5784
|
declare const AggregateMethodSchema: z.ZodEnum<["avg", "max", "min", "sum", "median"]>;
|
|
5785
|
+
declare const PrecomputedAggregateMethodSchema: z.ZodEnum<["avg", "max", "min", "sum", "count"]>;
|
|
5785
5786
|
declare const AggregationConfigSchema: z.ZodObject<{
|
|
5786
5787
|
/**
|
|
5787
5788
|
* The operation to use on the values from the features in the layer
|
|
@@ -5831,6 +5832,12 @@ interface AggregationConfig extends zInfer<typeof AggregationConfigSchema> {
|
|
|
5831
5832
|
* @group Stats
|
|
5832
5833
|
*/
|
|
5833
5834
|
type AggregationMethod = z.infer<typeof AggregateMethodSchema>;
|
|
5835
|
+
/**
|
|
5836
|
+
* The method to use for the precomputed aggregation.
|
|
5837
|
+
*
|
|
5838
|
+
* @group Stats
|
|
5839
|
+
*/
|
|
5840
|
+
type PrecomputedAggregationMethod = z.infer<typeof PrecomputedAggregateMethodSchema>;
|
|
5834
5841
|
/**
|
|
5835
5842
|
* Defines how to aggregate a value across features in a layer with multiple aggregations
|
|
5836
5843
|
* returned at once.
|
|
@@ -6468,6 +6475,227 @@ interface GetLayerCalculationParams<T extends AggregationMethod | "count"> exten
|
|
|
6468
6475
|
*/
|
|
6469
6476
|
aggregation: MultiAggregationConfig<T>;
|
|
6470
6477
|
}
|
|
6478
|
+
declare const GridTypeSchema: z.ZodEnum<["h3"]>;
|
|
6479
|
+
/**
|
|
6480
|
+
* The type of grid to use for precomputed aggregate values.
|
|
6481
|
+
*
|
|
6482
|
+
* @group Stats
|
|
6483
|
+
*/
|
|
6484
|
+
type GridType = z.infer<typeof GridTypeSchema>;
|
|
6485
|
+
declare const CountGridConfigSchema: z.ZodObject<{
|
|
6486
|
+
type: z.ZodEnum<["h3"]>;
|
|
6487
|
+
/**
|
|
6488
|
+
* The resolution of the grid to use for the precomputed calculation.
|
|
6489
|
+
*/
|
|
6490
|
+
resolution: z.ZodNumber;
|
|
6491
|
+
method: z.ZodEnum<["count"]>;
|
|
6492
|
+
}, "strip", z.ZodTypeAny, {
|
|
6493
|
+
type: "h3";
|
|
6494
|
+
method: "count";
|
|
6495
|
+
resolution: number;
|
|
6496
|
+
}, {
|
|
6497
|
+
type: "h3";
|
|
6498
|
+
method: "count";
|
|
6499
|
+
resolution: number;
|
|
6500
|
+
}>;
|
|
6501
|
+
/**
|
|
6502
|
+
* The grid configuration for a count-based precomputed aggregate value. Compared to the
|
|
6503
|
+
* {@link AggregatedGridConfig}, the `attribute` property is not required, because the count
|
|
6504
|
+
* is the same regardless of the attribute.
|
|
6505
|
+
*
|
|
6506
|
+
* Used inside {@link GetLayerPrecomputedCalculationParams}.
|
|
6507
|
+
*
|
|
6508
|
+
* @group Stats
|
|
6509
|
+
*/
|
|
6510
|
+
interface CountGridConfig extends zInfer<typeof CountGridConfigSchema> {
|
|
6511
|
+
/**
|
|
6512
|
+
* The type of grid to use for the precomputed calculation.
|
|
6513
|
+
*/
|
|
6514
|
+
type: GridType;
|
|
6515
|
+
/**
|
|
6516
|
+
* The method to use for the precomputed calculation, which in this case is always "count".
|
|
6517
|
+
*/
|
|
6518
|
+
method: Extract<PrecomputedAggregationMethod, "count">;
|
|
6519
|
+
}
|
|
6520
|
+
declare const AggregatedGridConfigSchema: z.ZodObject<{
|
|
6521
|
+
type: z.ZodEnum<["h3"]>;
|
|
6522
|
+
/**
|
|
6523
|
+
* The resolution of the grid to use for the precomputed calculation.
|
|
6524
|
+
*/
|
|
6525
|
+
resolution: z.ZodNumber;
|
|
6526
|
+
method: z.ZodEnum<["avg", "max", "min", "sum"]>;
|
|
6527
|
+
/**
|
|
6528
|
+
* The attribute to use for the precomputed calculation.
|
|
6529
|
+
*
|
|
6530
|
+
* This must be a numeric attribute;
|
|
6531
|
+
*/
|
|
6532
|
+
attribute: z.ZodString;
|
|
6533
|
+
}, "strip", z.ZodTypeAny, {
|
|
6534
|
+
type: "h3";
|
|
6535
|
+
attribute: string;
|
|
6536
|
+
method: "avg" | "max" | "min" | "sum";
|
|
6537
|
+
resolution: number;
|
|
6538
|
+
}, {
|
|
6539
|
+
type: "h3";
|
|
6540
|
+
attribute: string;
|
|
6541
|
+
method: "avg" | "max" | "min" | "sum";
|
|
6542
|
+
resolution: number;
|
|
6543
|
+
}>;
|
|
6544
|
+
/**
|
|
6545
|
+
* The grid configuration for an aggregated precomputed aggregate value. This requires
|
|
6546
|
+
* an `attribute` property, because the numeric aggregation requires it.
|
|
6547
|
+
*
|
|
6548
|
+
* If you just want to count the features in each grid cell, use the {@link CountGridConfig}
|
|
6549
|
+
* instead, where you are not required to specify an `attribute`.
|
|
6550
|
+
*
|
|
6551
|
+
* Used inside {@link GetLayerPrecomputedCalculationParams}.
|
|
6552
|
+
*
|
|
6553
|
+
* @group Stats
|
|
6554
|
+
*/
|
|
6555
|
+
interface AggregatedGridConfig extends zInfer<typeof AggregatedGridConfigSchema> {
|
|
6556
|
+
/**
|
|
6557
|
+
* The type of grid to use for the precomputed calculation.
|
|
6558
|
+
*/
|
|
6559
|
+
type: GridType;
|
|
6560
|
+
/**
|
|
6561
|
+
* The method to use for the precomputed calculation.
|
|
6562
|
+
*/
|
|
6563
|
+
method: Exclude<PrecomputedAggregationMethod, "count">;
|
|
6564
|
+
}
|
|
6565
|
+
/**
|
|
6566
|
+
* Describes the type of grid to use for precomputed aggregate values.
|
|
6567
|
+
*
|
|
6568
|
+
* @group Stats
|
|
6569
|
+
*/
|
|
6570
|
+
type GridConfig = CountGridConfig | AggregatedGridConfig;
|
|
6571
|
+
declare const GetLayerPrecomputedCalculationParamsSchema: z.ZodObject<{
|
|
6572
|
+
/**
|
|
6573
|
+
* The ID of the layer to calculate an aggregate value for.
|
|
6574
|
+
*/
|
|
6575
|
+
layerId: z.ZodString;
|
|
6576
|
+
boundary: z.ZodOptional<z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{
|
|
6577
|
+
type: z.ZodLiteral<"Polygon">;
|
|
6578
|
+
coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">;
|
|
6579
|
+
}, "strip", z.ZodTypeAny, {
|
|
6580
|
+
type: "Polygon";
|
|
6581
|
+
coordinates: [number, number][][];
|
|
6582
|
+
}, {
|
|
6583
|
+
type: "Polygon";
|
|
6584
|
+
coordinates: [number, number][][];
|
|
6585
|
+
}>, z.ZodObject<{
|
|
6586
|
+
type: z.ZodLiteral<"MultiPolygon">;
|
|
6587
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">, "many">;
|
|
6588
|
+
}, "strip", z.ZodTypeAny, {
|
|
6589
|
+
type: "MultiPolygon";
|
|
6590
|
+
coordinates: [number, number][][][];
|
|
6591
|
+
}, {
|
|
6592
|
+
type: "MultiPolygon";
|
|
6593
|
+
coordinates: [number, number][][][];
|
|
6594
|
+
}>, z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">]>>;
|
|
6595
|
+
filters: z.ZodOptional<z.ZodUnion<[z.ZodType<FilterTernary, z.ZodTypeDef, FilterTernary>, z.ZodUnion<[z.ZodTuple<[z.ZodUnion<[z.ZodString, z.ZodNull]>, z.ZodEnum<["in", "ni"]>, z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>, "many">, z.ZodNull]>], null>, z.ZodTuple<[z.ZodUnion<[z.ZodString, z.ZodNull]>, z.ZodEnum<["lt", "gt", "le", "ge", "eq", "ne", "cn", "nc", "is", "isnt"]>, z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>], null>]>, z.ZodNull, z.ZodBoolean]>>;
|
|
6596
|
+
/**
|
|
6597
|
+
* The type of grid to use for the precomputed calculation.
|
|
6598
|
+
*/
|
|
6599
|
+
gridConfig: z.ZodUnion<[z.ZodObject<{
|
|
6600
|
+
type: z.ZodEnum<["h3"]>;
|
|
6601
|
+
/**
|
|
6602
|
+
* The resolution of the grid to use for the precomputed calculation.
|
|
6603
|
+
*/
|
|
6604
|
+
resolution: z.ZodNumber;
|
|
6605
|
+
method: z.ZodEnum<["count"]>;
|
|
6606
|
+
}, "strip", z.ZodTypeAny, {
|
|
6607
|
+
type: "h3";
|
|
6608
|
+
method: "count";
|
|
6609
|
+
resolution: number;
|
|
6610
|
+
}, {
|
|
6611
|
+
type: "h3";
|
|
6612
|
+
method: "count";
|
|
6613
|
+
resolution: number;
|
|
6614
|
+
}>, z.ZodObject<{
|
|
6615
|
+
type: z.ZodEnum<["h3"]>;
|
|
6616
|
+
/**
|
|
6617
|
+
* The resolution of the grid to use for the precomputed calculation.
|
|
6618
|
+
*/
|
|
6619
|
+
resolution: z.ZodNumber;
|
|
6620
|
+
method: z.ZodEnum<["avg", "max", "min", "sum"]>;
|
|
6621
|
+
/**
|
|
6622
|
+
* The attribute to use for the precomputed calculation.
|
|
6623
|
+
*
|
|
6624
|
+
* This must be a numeric attribute;
|
|
6625
|
+
*/
|
|
6626
|
+
attribute: z.ZodString;
|
|
6627
|
+
}, "strip", z.ZodTypeAny, {
|
|
6628
|
+
type: "h3";
|
|
6629
|
+
attribute: string;
|
|
6630
|
+
method: "avg" | "max" | "min" | "sum";
|
|
6631
|
+
resolution: number;
|
|
6632
|
+
}, {
|
|
6633
|
+
type: "h3";
|
|
6634
|
+
attribute: string;
|
|
6635
|
+
method: "avg" | "max" | "min" | "sum";
|
|
6636
|
+
resolution: number;
|
|
6637
|
+
}>]>;
|
|
6638
|
+
}, "strip", z.ZodTypeAny, {
|
|
6639
|
+
layerId: string;
|
|
6640
|
+
gridConfig: {
|
|
6641
|
+
type: "h3";
|
|
6642
|
+
method: "count";
|
|
6643
|
+
resolution: number;
|
|
6644
|
+
} | {
|
|
6645
|
+
type: "h3";
|
|
6646
|
+
attribute: string;
|
|
6647
|
+
method: "avg" | "max" | "min" | "sum";
|
|
6648
|
+
resolution: number;
|
|
6649
|
+
};
|
|
6650
|
+
boundary?: [number, number, number, number] | [number, number][] | {
|
|
6651
|
+
type: "Polygon";
|
|
6652
|
+
coordinates: [number, number][][];
|
|
6653
|
+
} | {
|
|
6654
|
+
type: "MultiPolygon";
|
|
6655
|
+
coordinates: [number, number][][][];
|
|
6656
|
+
} | undefined;
|
|
6657
|
+
filters?: boolean | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | FilterTernary | null | undefined;
|
|
6658
|
+
}, {
|
|
6659
|
+
layerId: string;
|
|
6660
|
+
gridConfig: {
|
|
6661
|
+
type: "h3";
|
|
6662
|
+
method: "count";
|
|
6663
|
+
resolution: number;
|
|
6664
|
+
} | {
|
|
6665
|
+
type: "h3";
|
|
6666
|
+
attribute: string;
|
|
6667
|
+
method: "avg" | "max" | "min" | "sum";
|
|
6668
|
+
resolution: number;
|
|
6669
|
+
};
|
|
6670
|
+
boundary?: [number, number, number, number] | [number, number][] | {
|
|
6671
|
+
type: "Polygon";
|
|
6672
|
+
coordinates: [number, number][][];
|
|
6673
|
+
} | {
|
|
6674
|
+
type: "MultiPolygon";
|
|
6675
|
+
coordinates: [number, number][][][];
|
|
6676
|
+
} | undefined;
|
|
6677
|
+
filters?: boolean | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | FilterTernary | null | undefined;
|
|
6678
|
+
}>;
|
|
6679
|
+
/**
|
|
6680
|
+
* The parameters for calculating a single aggregate value for a layer, passed to
|
|
6681
|
+
* the {@link LayersController.getPrecomputedAggregates} method.
|
|
6682
|
+
*
|
|
6683
|
+
* @group Stats
|
|
6684
|
+
*/
|
|
6685
|
+
interface GetLayerPrecomputedCalculationParams extends z.infer<typeof GetLayerPrecomputedCalculationParamsSchema> {
|
|
6686
|
+
/**
|
|
6687
|
+
* Attribute filters for the features to include when calculating the aggregate value.
|
|
6688
|
+
*/
|
|
6689
|
+
filters?: Filters;
|
|
6690
|
+
/**
|
|
6691
|
+
* The spatial boundary for the features to include when calculating the aggregate value.
|
|
6692
|
+
*/
|
|
6693
|
+
boundary?: GeometryFilter;
|
|
6694
|
+
/**
|
|
6695
|
+
* The grid configuration to use for the precomputed calculation.
|
|
6696
|
+
*/
|
|
6697
|
+
gridConfig: GridConfig;
|
|
6698
|
+
}
|
|
6471
6699
|
|
|
6472
6700
|
/**
|
|
6473
6701
|
* The Layers controller allows you to get information about the layers on the
|
|
@@ -7236,6 +7464,33 @@ interface LayersController {
|
|
|
7236
7464
|
* ```
|
|
7237
7465
|
*/
|
|
7238
7466
|
getAggregates<T extends AggregationMethod | "count">(params: GetLayerCalculationParams<T>): Promise<Record<T, number | null>>;
|
|
7467
|
+
/**
|
|
7468
|
+
* Calculates aggregates for spatial cells of a layer.
|
|
7469
|
+
*
|
|
7470
|
+
* @remarks
|
|
7471
|
+
* Performs statistical calculations on spatial cells of a layer, returning min, max, avg, sum, and count. You can focus your calculation on specific areas or subsets
|
|
7472
|
+
* of your data using boundaries and filters. When using the count method, an attribute is not required.
|
|
7473
|
+
*
|
|
7474
|
+
* @example
|
|
7475
|
+
* ```typescript
|
|
7476
|
+
* const aggregates = await felt.getPrecomputedAggregates({
|
|
7477
|
+
* layerId: "buildings",
|
|
7478
|
+
* gridConfig: {
|
|
7479
|
+
* type: "h3",
|
|
7480
|
+
* resolution: 10,
|
|
7481
|
+
* method: "avg",
|
|
7482
|
+
* attribute: "assessed_value"
|
|
7483
|
+
* },
|
|
7484
|
+
* });
|
|
7485
|
+
* ```
|
|
7486
|
+
*/
|
|
7487
|
+
getPrecomputedAggregates(params: GetLayerPrecomputedCalculationParams): Promise<{
|
|
7488
|
+
avg: number | null;
|
|
7489
|
+
max: number | null;
|
|
7490
|
+
min: number | null;
|
|
7491
|
+
sum: number | null;
|
|
7492
|
+
count: number | null;
|
|
7493
|
+
}>;
|
|
7239
7494
|
/**
|
|
7240
7495
|
* Get the schema for a layer.
|
|
7241
7496
|
*
|
|
@@ -7597,9 +7852,8 @@ interface SelectionController {
|
|
|
7597
7852
|
}): Promise<void>;
|
|
7598
7853
|
}
|
|
7599
7854
|
|
|
7600
|
-
|
|
7601
|
-
type
|
|
7602
|
-
type ConfigurableToolType = keyof ToolSettingsMap;
|
|
7855
|
+
type ToolType = "circle" | "highlighter" | "line" | "link" | "marker" | "note" | "pin" | "polygon" | "route" | "text";
|
|
7856
|
+
type ConfigurableToolType = Exclude<ToolType, "link">;
|
|
7603
7857
|
declare const PinToolSettingsSchema: z.ZodObject<{
|
|
7604
7858
|
symbol: z.ZodString;
|
|
7605
7859
|
color: z.ZodString;
|
|
@@ -8513,4 +8767,4 @@ interface FeltController extends ViewportController, UiController, LayersControl
|
|
|
8513
8767
|
iframe: HTMLIFrameElement | null;
|
|
8514
8768
|
}
|
|
8515
8769
|
|
|
8516
|
-
export type { LayerChangeCallbackParams as $, TextElementUpdate as A, ElementsController as B, CircleElementCreate as C, MapInteractionEvent as D, Element as E, FeltController as F, GetElementGroupsConstraint as G, HighlighterElementCreate as H, ImageElementCreate as I, InteractionsController as J, CreateLayersFromGeoJsonParams as K, LinkElementRead as L, MarkerElementCreate as M, NoteElementCreate as N, DataOnlyLayer as O, PathElementCreate as P, FeltTiledVectorSource as Q, GeoJsonDataVectorSource as R, GeoJsonFileVectorSource as S, TextElementCreate as T, UiControlsOptions as U, ViewportCenterZoom as V, GeoJsonUrlVectorSource as W, GetLayerGroupsConstraint as X, GetLayersConstraint as Y, GetRenderedFeaturesConstraint as Z, Layer as _, CircleElementRead as a,
|
|
8770
|
+
export type { LayerChangeCallbackParams as $, TextElementUpdate as A, ElementsController as B, CircleElementCreate as C, MapInteractionEvent as D, Element as E, FeltController as F, GetElementGroupsConstraint as G, HighlighterElementCreate as H, ImageElementCreate as I, InteractionsController as J, CreateLayersFromGeoJsonParams as K, LinkElementRead as L, MarkerElementCreate as M, NoteElementCreate as N, DataOnlyLayer as O, PathElementCreate as P, FeltTiledVectorSource as Q, GeoJsonDataVectorSource as R, GeoJsonFileVectorSource as S, TextElementCreate as T, UiControlsOptions as U, ViewportCenterZoom as V, GeoJsonUrlVectorSource as W, GetLayerGroupsConstraint as X, GetLayersConstraint as Y, GetRenderedFeaturesConstraint as Z, Layer as _, CircleElementRead as a, LngLatTuple as a$, LayerCommon as a0, LayerGroup as a1, LayerGroupChangeCallbackParams as a2, LayerProcessingStatus as a3, LegendItem as a4, LegendItemChangeCallbackParams as a5, LegendItemIdentifier as a6, LegendItemsConstraint as a7, RasterBand as a8, RasterLayer as a9, GetLayerCategoriesParams as aA, GetLayerHistogramBin as aB, GetLayerHistogramParams as aC, GetLayerPrecomputedCalculationParams as aD, GridConfig as aE, GridType as aF, MultiAggregationConfig as aG, PrecomputedAggregationMethod as aH, ValueConfiguration as aI, LayersController as aJ, MapDetails as aK, MiscController as aL, ElementGroupNode as aM, ElementNode as aN, EntityNode as aO, FeatureNode as aP, FeatureSelection as aQ, LayerGroupNode as aR, LayerNode as aS, SelectionController as aT, FeltBoundary as aU, FeltZoom as aV, GeoJsonFeature as aW, GeoJsonGeometry as aX, GeoJsonProperties as aY, LatLng as aZ, LineStringGeometry as a_, RasterLayerSource as aa, UpdateLayerParams as ab, VectorLayer as ac, LayerFeature as ad, RasterValue as ae, LayerSchema as af, LayerSchemaAttribute as ag, LayerSchemaBooleanAttribute as ah, LayerSchemaCommonAttribute as ai, LayerSchemaDateAttribute as aj, LayerSchemaDateTimeAttribute as ak, LayerSchemaNumericAttribute as al, LayerSchemaTextAttribute as am, FilterExpression as an, FilterLogicGate as ao, FilterTernary as ap, Filters as aq, GeometryFilter as ar, LayerBoundaries as as, LayerFilters as at, AggregatedGridConfig as au, AggregationConfig as av, AggregationMethod as aw, CountGridConfig as ax, GetLayerCalculationParams as ay, GetLayerCategoriesGroup as az, CircleElementUpdate as b, MultiLineStringGeometry as b0, MultiPointGeometry as b1, MultiPolygonGeometry as b2, PointGeometry as b3, PolygonGeometry as b4, SetVisibilityRequest as b5, SortConfig as b6, SortDirection as b7, CircleToolSettings as b8, ConfigurableToolType as b9, HighlighterToolSettings as ba, InputToolSettings as bb, LineToolSettings as bc, MarkerToolSettings as bd, NoteToolSettings as be, PinToolSettings as bf, PlaceFrame as bg, PlaceSymbol as bh, PolygonToolSettings as bi, RouteToolSettings as bj, TextToolSettings as bk, ToolSettingsChangeEvent as bl, ToolSettingsMap as bm, ToolType as bn, ToolsController as bo, UiOnMapInteractionsOptions as bp, UiController as bq, SetViewportCenterZoomParams as br, ViewportConstraints as bs, ViewportFitBoundsParams as bt, ViewportState as bu, ViewportController as bv, UnwrapPromise as bw, UnionToIntersection as bx, PromiseOrNot as by, ElementChangeCallbackParams as c, ElementCreate as d, ElementGroup as e, ElementGroupChangeCallbackParams as f, ElementUpdate as g, GetElementsConstraint as h, HighlighterElementRead as i, HighlighterElementUpdate as j, ImageElementRead as k, ImageElementUpdate as l, MarkerElementRead as m, MarkerElementUpdate as n, NoteElementRead as o, NoteElementUpdate as p, PathElementRead as q, PathElementUpdate as r, PlaceElementCreate as s, PlaceElementRead as t, PlaceElementUpdate as u, PolygonElementCreate as v, PolygonElementRead as w, PolygonElementUpdate as x, TextElementRead as y, zInfer as z };
|
package/dist/handler.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var oe=Object.defineProperty;var lt=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var mt=Object.prototype.hasOwnProperty;var ct=(r,l)=>{for(var E in l)oe(r,E,{get:l[E],enumerable:!0})},gt=(r,l,E,P)=>{if(l&&typeof l=="object"||typeof l=="function")for(let C of pt(l))!mt.call(r,C)&&C!==E&&oe(r,C,{get:()=>l[C],enumerable:!(P=lt(l,C))||P.enumerable});return r};var yt=r=>gt(oe({},"__esModule",{value:!0}),r);var fr={};ct(fr,{createMessageHandler:()=>mr});module.exports=yt(fr);var g=require("zod");var d=require("zod");var S=require("zod");function t(r,l){return S.z.strictObject({type:S.z.literal(r),params:l})}function h(r,l){return S.z.strictObject({eventName:S.z.literal(r),id:S.z.string(),options:l})}function p(r){return S.z.strictObject({eventName:S.z.literal(r),id:S.z.string()})}var s=require("zod"),H=s.z.number(),J=s.z.number(),Z=s.z.object({latitude:J,longitude:H}),G=s.z.tuple([H,J]),w=s.z.object({type:s.z.literal("Polygon"),coordinates:s.z.array(s.z.array(G).min(4).refine(r=>r[0][0]===r[r.length-1][0]&&r[0][1]===r[r.length-1][1],"The last point of each ring must be identical to the first"))}),q=s.z.object({type:s.z.literal("MultiPolygon"),coordinates:s.z.array(w.shape.coordinates)}),dt=s.z.object({type:s.z.literal("LineString"),coordinates:s.z.array(G).min(2)}),U=s.z.object({type:s.z.literal("MultiLineString"),coordinates:s.z.array(dt.shape.coordinates)}),fe=s.z.number().min(1).max(23),x=s.z.tuple([H,J,H,J]),z=s.z.object({show:s.z.array(s.z.string()).optional(),hide:s.z.array(s.z.string()).optional()}),ut=s.z.enum(["asc","desc"]),W=s.z.object({attribute:s.z.string(),direction:ut});var e=require("zod");var f=e.z.object({id:e.z.string(),groupId:e.z.string().nullable(),color:e.z.string(),name:e.z.string().nullable(),description:e.z.string().nullable(),attributes:e.z.record(e.z.string(),e.z.unknown()),interaction:e.z.enum(["default","locked"]).optional()}),$=e.z.object({imageUrl:e.z.string().nullable()}),ae=e.z.object({strokeOpacity:e.z.number(),strokeWidth:e.z.number(),strokeStyle:e.z.enum(["solid","dashed","dotted"])}),ht=e.z.enum(["meter","kilometer","foot","mile"]),_=f.extend($.shape).extend({type:e.z.literal("Place"),coordinates:G,symbol:e.z.string(),frame:e.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:e.z.boolean()}),O=f.extend($.shape).extend(ae.shape).extend({type:e.z.literal("Path"),coordinates:U.shape.coordinates,distanceMarker:e.z.boolean(),routingMode:e.z.enum(["driving","cycling","walking","flying"]).nullable(),endCaps:e.z.boolean()}),v=f.extend($.shape).extend(ae.shape).extend({type:e.z.literal("Polygon"),coordinates:w.shape.coordinates,fillOpacity:e.z.number().min(0).max(1),areaMarker:e.z.boolean()}),Q=f.extend($.shape).extend(ae.shape).extend({type:e.z.literal("Circle"),center:G,radius:e.z.number(),radiusMarker:e.z.boolean(),radiusDisplayAngle:e.z.number(),radiusDisplayUnit:ht.nullable(),fillOpacity:e.z.number().min(0).max(1)}),j=f.extend({type:e.z.literal("Marker"),coordinates:U.shape.coordinates,opacity:e.z.number().min(0).max(1),size:e.z.number().min(0).max(100),zoom:e.z.number().min(0).max(23)}),R=f.extend({type:e.z.literal("Highlighter"),coordinates:q.shape.coordinates,renderHoles:e.z.boolean(),opacity:e.z.number().min(0).max(1)}),Se=e.z.object({position:G,rotation:e.z.number(),scale:e.z.number(),zoom:e.z.number().min(0).max(23),text:e.z.string(),align:e.z.enum(["left","center","right"]),style:e.z.enum(["italic","light","regular","caps"]),name:e.z.string()}),re=f.extend(Se.shape).extend({type:e.z.literal("Text")}),ne=f.extend(Se.shape).extend({type:e.z.literal("Note"),widthScale:e.z.number().min(0)}),N=f.extend({type:e.z.literal("Image"),coordinates:U.shape.coordinates,imageUrl:e.z.string(),opacity:e.z.number().min(0).max(1)}).omit({color:!0}),ft=f.extend({type:e.z.literal("Link"),coordinates:U.shape.coordinates,url:e.z.string()}),F={type:!0,coordinates:!0},L={id:!0},ie=_.partial().extend(_.pick(F).shape).omit(L),K=O.partial().extend(O.pick(F).shape).omit(L),se=v.partial().extend(v.pick(F).shape).omit(L),le=Q.partial().extend(Q.pick({type:!0,center:!0,radius:!0}).shape).omit(L),pe=j.partial().extend(j.pick(F).shape).omit(L),me=R.partial().extend(R.pick(F).shape).omit(L),ce=re.partial().omit({...L,name:!0,type:!0}).extend({type:e.z.literal("Text"),text:e.z.string()}),ge=ne.partial().omit({...L,name:!0,type:!0}).extend({type:e.z.literal("Note"),text:e.z.string()}),St=N.partial().extend(N.pick({...F,imageUrl:!0}).shape).omit(L),xe=e.z.discriminatedUnion("type",[ie,K,se,le,pe,me,St,ce,ge]);var Cr=O.omit({coordinates:!0}),Gr=v.omit({coordinates:!0});var Ir=j.omit({coordinates:!0}),Tr=R.omit({coordinates:!0});var Er=N.omit({coordinates:!0}),zr=ft.omit({coordinates:!0}),b={type:!0,id:!0},xt=_.partial().extend(_.pick(b).shape),Lt=O.partial().extend(O.pick(b).shape),bt=v.partial().extend(v.pick(b).shape),Mt=Q.partial().extend(Q.pick(b).shape),Ct=j.partial().extend(j.pick(b).shape),Gt=R.partial().extend(R.pick(b).shape),It=re.partial().extend(re.pick(b).shape).omit({name:!0}),Tt=ne.partial().extend(ne.pick(b).shape).omit({name:!0}),Et=N.partial().extend(N.pick(b).shape),Le=e.z.discriminatedUnion("type",[xt,Lt,bt,Mt,Ct,Gt,It,Tt,Et]),be=e.z.object({ids:e.z.array(e.z.string()).optional()}),Me=e.z.object({ids:e.z.array(e.z.string()).optional()});var zt=t("getElement",d.z.string()),Pt=t("getElementGeometry",d.z.string()),Ft=t("getElements",be.optional()),kt=t("getElementGroup",d.z.string()),Vt=t("getElementGroups",Me.optional()),wt=t("setElementGroupVisibility",z),Ut=h("onElementChange",d.z.object({id:d.z.string()})),Ot=p("onElementCreate"),vt=p("onElementCreateEnd"),jt=h("onElementDelete",d.z.object({id:d.z.string()})),Rt=h("onElementGroupChange",d.z.object({id:d.z.string()})),Nt=t("createElement",xe),At=t("updateElement",Le),Bt=t("deleteElement",d.z.string()),Ce={methods:[zt,Pt,Ft,kt,Vt,wt,Nt,At,Bt],listeners:[Ut,Ot,vt,jt,Rt]};var Dt=p("onPointerClick"),Ht=p("onPointerMove"),Ge={methods:null,listeners:[Dt,Ht]};var a=require("zod");var i=require("zod");var Jt=i.z.enum(["in","ni"]),Zt=i.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),jr=i.z.enum(["and","or"]),Ie=i.z.union([i.z.number(),i.z.string(),i.z.boolean(),i.z.null()]),Te=i.z.string().or(i.z.null()),qt=i.z.tuple([Te,Jt,i.z.array(Ie).or(i.z.null())]),Wt=i.z.tuple([Te,Zt,Ie]),ye=i.z.union([qt,Wt]),de=i.z.tuple([i.z.lazy(()=>i.z.union([de,ye,i.z.null(),i.z.boolean()])),i.z.enum(["and","or"]),i.z.lazy(()=>i.z.union([de,ye,i.z.null(),i.z.boolean()]))]),I=i.z.union([de,ye,i.z.null(),i.z.boolean()]),T=i.z.union([x,w,q,i.z.array(G)]);var n=require("zod");var Ee=n.z.enum(["avg","max","min","sum","median"]),_t=n.z.object({method:Ee,attribute:n.z.string()}),Qt=n.z.object({methods:n.z.array(n.z.union([Ee,n.z.literal("count")])),attribute:n.z.string().optional()}),ze=n.z.object({boundary:T.optional(),filters:I.optional(),aggregation:_t.optional()}),Pe=n.z.object({layerId:n.z.string(),attribute:n.z.string(),limit:n.z.number().optional(),boundary:T.optional(),filters:I.optional(),values:ze.optional()}),Ar=n.z.object({key:n.z.union([n.z.number(),n.z.string(),n.z.boolean()]),value:n.z.number().nullable()}),$t=n.z.object({type:n.z.literal("equal-intervals"),count:n.z.number()}),Kt=n.z.object({type:n.z.literal("time-interval"),interval:n.z.enum(["hour","day","week","month","year"])}),Fe=n.z.object({layerId:n.z.string(),attribute:n.z.string(),steps:n.z.union([$t,Kt,n.z.array(n.z.number())]),boundary:T.optional(),filters:I.optional(),values:ze.optional()}),Br=n.z.object({min:n.z.number(),max:n.z.number(),value:n.z.number()}),ke=n.z.object({layerId:n.z.string(),boundary:T.optional(),filters:I.optional(),aggregation:Qt});var o=require("zod");var Jr=o.z.enum(["processing","completed","failed","incomplete"]),Ve=o.z.object({type:o.z.literal("geoJsonUrl"),url:o.z.string().url(),refreshInterval:o.z.number().min(250).max(5*60*1e3).nullable().optional()}),we=o.z.object({type:o.z.literal("geoJsonData"),data:o.z.object({}).passthrough().or(o.z.instanceof(ArrayBuffer))}),Ue=o.z.object({type:o.z.literal("geoJsonFile"),file:o.z.instanceof(File)}),Oe=o.z.object({id:o.z.string(),style:o.z.object({}).passthrough().optional(),shownInLegend:o.z.boolean().optional(),name:o.z.string().optional(),caption:o.z.string().optional(),description:o.z.string().optional(),bounds:x.optional(),source:o.z.union([Ve,we,Ue]).optional()}),ve=o.z.object({ids:o.z.array(o.z.string()).optional()}),je=o.z.object({ids:o.z.array(o.z.string()).optional()}),k=o.z.object({id:o.z.string(),layerId:o.z.string()}),Re=o.z.object({ids:k.array().optional(),layerIds:o.z.string().array().optional()}),Ne=o.z.object({layerIds:o.z.array(o.z.string()).optional(),areaQuery:o.z.union([o.z.object({coordinates:Z}),o.z.object({boundary:x})]).optional()}),Xt=o.z.object({Point:o.z.object({}).passthrough().optional(),Line:o.z.object({}).passthrough().optional(),Polygon:o.z.object({}).passthrough().optional()}),Ae=o.z.object({source:o.z.union([Ve,we,Ue]),name:o.z.string(),bounds:x.optional(),caption:o.z.string().optional(),description:o.z.string().optional(),geometryStyles:Xt.optional()});var Yt=t("getLayer",a.z.string()),eo=t("getLayers",ve.optional()),to=t("setLayerVisibility",z),oo=h("onLayerChange",a.z.object({id:a.z.string()})),ro=t("setLayerStyle",a.z.object({id:a.z.string(),style:a.z.object({}).passthrough()})),no=t("setLayerLegendVisibility",z),ao=t("createLayersFromGeoJson",Ae),io=t("updateLayer",Oe),so=t("deleteLayer",a.z.string()),lo=t("getLayerGroup",a.z.string()),po=t("getLayerGroups",je.optional()),mo=t("setLayerGroupVisibility",z),co=t("setLayerGroupLegendVisibility",z),go=h("onLayerGroupChange",a.z.object({id:a.z.string()})),yo=t("getLegendItem",k),uo=t("getLegendItems",Re.optional()),ho=h("onLegendItemChange",k),fo=t("setLegendItemVisibility",a.z.object({show:k.array().optional(),hide:k.array().optional()})),So=t("getLayerFilters",a.z.string()),xo=t("setLayerFilters",a.z.object({layerId:a.z.string(),filters:I,note:a.z.string().optional()})),Lo=h("onLayerFiltersChange",a.z.object({layerId:a.z.string()})),bo=t("getLayerBoundaries",a.z.string()),Mo=t("setLayerBoundary",a.z.object({layerIds:a.z.array(a.z.string()),boundary:T.nullable()})),Co=h("onLayerBoundariesChange",a.z.object({layerId:a.z.string()})),Go=t("getRenderedFeatures",Ne.optional()),Io=t("getFeature",a.z.object({id:a.z.string().or(a.z.number()),layerId:a.z.string()})),To=t("getFeatures",a.z.object({layerId:a.z.string(),filters:I.optional(),sorting:W.optional(),boundary:T.optional(),search:a.z.string().optional(),pagination:a.z.string().optional().nullish()})),Eo=t("getGeoJsonFeature",a.z.object({id:a.z.string().or(a.z.number()),layerId:a.z.string()})),zo=t("getCategoryData",Pe),Po=t("getHistogramData",Fe),Fo=t("getAggregates",ke),ko=t("getLayerSchema",a.z.string()),Be={methods:[Yt,eo,to,ro,no,ao,so,io,lo,po,mo,co,yo,uo,fo,So,xo,bo,Mo,Go,Io,To,Eo,zo,Po,Fo,ko],listeners:[oo,go,ho,Lo,Co]};var De=require("zod");var Vo=t("getMapDetails",De.z.undefined()),He={methods:[Vo],listeners:[]};var A=require("zod");var M=require("zod"),Je=M.z.object({id:M.z.string().or(M.z.number()),layerId:M.z.string(),showPopup:M.z.boolean().optional(),fitViewport:M.z.boolean().or(M.z.object({maxZoom:M.z.number()})).optional()});var wo=t("getSelection",A.z.undefined()),Uo=p("onSelectionChange"),Oo=t("selectFeature",Je),vo=t("clearSelection",A.z.object({features:A.z.boolean().optional(),elements:A.z.boolean().optional()}).optional()),Ze={methods:[wo,Oo,vo],listeners:[Uo]};var $e=require("zod");var m=require("zod");var qe=["pin","line","route","polygon","circle","marker","highlighter","text","note"],We=m.z.enum([...qe,"link"]),_e=m.z.enum(qe),jo=ie.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:m.z.enum(["enter name","add another","select"])}).required(),Ro=K.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),No=K.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),Ao=se.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),Bo=le.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),Do=pe.pick({color:!0,opacity:!0,size:!0}).required(),Ho=me.pick({color:!0,opacity:!0,renderHoles:!0}).extend({size:m.z.number().min(0).max(200)}).required(),Jo=ce.pick({color:!0,align:!0,style:!0}).required(),Zo=ge.pick({color:!0,align:!0,style:!0}).required(),Qe=m.z.discriminatedUnion("tool",[jo.partial().extend({tool:m.z.literal("pin")}),Ro.partial().extend({tool:m.z.literal("line")}),No.partial().extend({tool:m.z.literal("route")}),Ao.partial().extend({tool:m.z.literal("polygon")}),Bo.partial().extend({tool:m.z.literal("circle")}),Do.partial().extend({tool:m.z.literal("marker")}),Ho.partial().extend({tool:m.z.literal("highlighter")}),Jo.partial().extend({tool:m.z.literal("text")}),Zo.partial().extend({tool:m.z.literal("note")})]);var qo=t("setTool",We.nullable()),Wo=t("getTool",$e.z.undefined()),_o=p("onToolChange"),Qo=t("setToolSettings",Qe),$o=t("getToolSettings",_e),Ko=p("onToolSettingsChange"),Ke={methods:[qo,Wo,Qo,$o],listeners:[_o,Ko]};var X=require("zod");var c=require("zod"),Xe=c.z.object({showLegend:c.z.boolean().optional(),cooperativeGestures:c.z.boolean().optional(),fullScreenButton:c.z.boolean().optional(),geolocation:c.z.boolean().optional(),zoomControls:c.z.boolean().optional(),scaleBar:c.z.boolean().optional()}),Ye=c.z.object({featureSelectPanel:c.z.boolean().optional(),featureHoverPanel:c.z.boolean().optional(),elementSelectPanel:c.z.boolean().optional(),linkClickOpen:c.z.boolean().optional(),imageLightboxOpen:c.z.boolean().optional()});var Xo=t("updateUiControls",Xe),Yo=t("setOnMapInteractionsUi",Ye),er=t("showLayerDataTable",X.z.object({layerId:X.z.string(),sorting:W.optional()}).optional()),tr=t("hideLayerDataTable",X.z.undefined()),et={methods:[Xo,Yo,er,tr],listeners:null};var ue=require("zod");var B=require("zod");var Y=B.z.object({center:Z,zoom:fe}),tt=B.z.object({center:Y.shape.center.optional(),zoom:Y.shape.zoom.optional()}),ot=B.z.object({minZoom:Y.shape.zoom.nullish(),maxZoom:Y.shape.zoom.nullish(),bounds:x.nullish()}).nullable(),rt=B.z.object({bounds:x});var or=t("getViewport",ue.z.undefined()),rr=t("setViewport",tt),nr=t("getViewportConstraints",ue.z.undefined()),ar=t("setViewportConstraints",ot),ir=t("fitViewportToBounds",rt),sr=p("onViewportMove"),lr=p("onViewportMoveEnd"),pr=p("onMapIdle"),nt={methods:[rr,or,nr,ar,ir],listeners:[sr,lr,pr]};var he=[et,nt,Be,Ce,Ze,Ge,Ke,He];function mr(r,l,E){let P=new Map;async function C(u){if(!ur.safeParse(u.data).success){E?.onUnknownMessage?.(u.data);return}let D=st.safeParse(u.data);if(!D.success){E?.onInvalidMessage?.(u.data,D.error),u.ports[0]?.postMessage(at(D.error.message));return}let{data:y}=D;if(y.type==="felt.ready")u.ports[0]?.postMessage(!0);else if(y.type==="felt.addListener"){if(y.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let V="options"in y.event?{options:"options"in y.event?y.event.options:void 0,handler:te=>{u.ports[0]?.postMessage(te)}}:{handler:te=>{u.ports[0]?.postMessage(te)}},ee=l.listeners[y.event.eventName](V);P.set(y.event.id,ee)}else if(y.type==="felt.removeListener")P.get(y.id)?.(),P.delete(y.id);else try{let V=l.methods[y.type],ee=await V(y.params);u.ports[0]?.postMessage(ee)}catch(V){u.ports[0]?.postMessage(at(V))}}return r.addEventListener("message",C),()=>{r.removeEventListener("message",C)}}var it={methods:he.map(r=>r.methods??[]).flat(),listeners:he.map(r=>r.listeners??[]).flat()},cr=g.z.discriminatedUnion("eventName",[g.z.strictObject({eventName:g.z.literal("")}),...it.listeners]),gr=g.z.strictObject({type:g.z.literal("felt.addListener"),event:cr}),yr=g.z.strictObject({type:g.z.literal("felt.removeListener"),id:g.z.string()}),dr=g.z.strictObject({type:g.z.literal("felt.ready")}),st=g.z.discriminatedUnion("type",[dr,gr,yr,...it.methods]),ur=g.z.object({type:g.z.enum(st.options.map(r=>r.shape.type.value))});function at(r){return{__error__:hr(r)}}function hr(r){return r instanceof Error?r.message:typeof r=="object"&&r!==null&&"message"in r?String(r.message):typeof r=="string"?r:"Unknown error"}0&&(module.exports={createMessageHandler});
|
|
1
|
+
"use strict";var oe=Object.defineProperty;var mt=Object.getOwnPropertyDescriptor;var gt=Object.getOwnPropertyNames;var yt=Object.prototype.hasOwnProperty;var dt=(n,l)=>{for(var P in l)oe(n,P,{get:l[P],enumerable:!0})},ut=(n,l,P,z)=>{if(l&&typeof l=="object"||typeof l=="function")for(let I of gt(l))!yt.call(n,I)&&I!==P&&oe(n,I,{get:()=>l[I],enumerable:!(z=mt(l,I))||z.enumerable});return n};var ht=n=>ut(oe({},"__esModule",{value:!0}),n);var Ir={};dt(Ir,{createMessageHandler:()=>Sr});module.exports=ht(Ir);var g=require("zod");var d=require("zod");var S=require("zod");function t(n,l){return S.z.strictObject({type:S.z.literal(n),params:l})}function h(n,l){return S.z.strictObject({eventName:S.z.literal(n),id:S.z.string(),options:l})}function p(n){return S.z.strictObject({eventName:S.z.literal(n),id:S.z.string()})}var s=require("zod"),H=s.z.number(),J=s.z.number(),Z=s.z.object({latitude:J,longitude:H}),T=s.z.tuple([H,J]),w=s.z.object({type:s.z.literal("Polygon"),coordinates:s.z.array(s.z.array(T).min(4).refine(n=>n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1],"The last point of each ring must be identical to the first"))}),q=s.z.object({type:s.z.literal("MultiPolygon"),coordinates:s.z.array(w.shape.coordinates)}),ft=s.z.object({type:s.z.literal("LineString"),coordinates:s.z.array(T).min(2)}),U=s.z.object({type:s.z.literal("MultiLineString"),coordinates:s.z.array(ft.shape.coordinates)}),fe=s.z.number().min(1).max(23),x=s.z.tuple([H,J,H,J]),E=s.z.object({show:s.z.array(s.z.string()).optional(),hide:s.z.array(s.z.string()).optional()}),St=s.z.enum(["asc","desc"]),W=s.z.object({attribute:s.z.string(),direction:St});var e=require("zod");var f=e.z.object({id:e.z.string(),groupId:e.z.string().nullable(),color:e.z.string(),name:e.z.string().nullable(),description:e.z.string().nullable(),attributes:e.z.record(e.z.string(),e.z.unknown()),interaction:e.z.enum(["default","locked"]).optional()}),$=e.z.object({imageUrl:e.z.string().nullable()}),ae=e.z.object({strokeOpacity:e.z.number(),strokeWidth:e.z.number(),strokeStyle:e.z.enum(["solid","dashed","dotted"])}),xt=e.z.enum(["meter","kilometer","foot","mile"]),_=f.extend($.shape).extend({type:e.z.literal("Place"),coordinates:T,symbol:e.z.string(),frame:e.z.enum(["frame-circle","frame-square"]).nullable(),hideLabel:e.z.boolean()}),O=f.extend($.shape).extend(ae.shape).extend({type:e.z.literal("Path"),coordinates:U.shape.coordinates,distanceMarker:e.z.boolean(),routingMode:e.z.enum(["driving","cycling","walking","flying"]).nullable(),endCaps:e.z.boolean()}),j=f.extend($.shape).extend(ae.shape).extend({type:e.z.literal("Polygon"),coordinates:w.shape.coordinates,fillOpacity:e.z.number().min(0).max(1),areaMarker:e.z.boolean()}),Q=f.extend($.shape).extend(ae.shape).extend({type:e.z.literal("Circle"),center:T,radius:e.z.number(),radiusMarker:e.z.boolean(),radiusDisplayAngle:e.z.number(),radiusDisplayUnit:xt.nullable(),fillOpacity:e.z.number().min(0).max(1)}),v=f.extend({type:e.z.literal("Marker"),coordinates:U.shape.coordinates,opacity:e.z.number().min(0).max(1),size:e.z.number().min(0).max(100),zoom:e.z.number().min(0).max(23)}),R=f.extend({type:e.z.literal("Highlighter"),coordinates:q.shape.coordinates,renderHoles:e.z.boolean(),opacity:e.z.number().min(0).max(1)}),Se=e.z.object({position:T,rotation:e.z.number(),scale:e.z.number(),zoom:e.z.number().min(0).max(23),text:e.z.string(),align:e.z.enum(["left","center","right"]),style:e.z.enum(["italic","light","regular","caps"]),name:e.z.string()}),re=f.extend(Se.shape).extend({type:e.z.literal("Text")}),ne=f.extend(Se.shape).extend({type:e.z.literal("Note"),widthScale:e.z.number().min(0)}),N=f.extend({type:e.z.literal("Image"),coordinates:U.shape.coordinates,imageUrl:e.z.string(),opacity:e.z.number().min(0).max(1)}).omit({color:!0}),Lt=f.extend({type:e.z.literal("Link"),coordinates:U.shape.coordinates,url:e.z.string()}),F={type:!0,coordinates:!0},L={id:!0},ie=_.partial().extend(_.pick(F).shape).omit(L),K=O.partial().extend(O.pick(F).shape).omit(L),se=j.partial().extend(j.pick(F).shape).omit(L),le=Q.partial().extend(Q.pick({type:!0,center:!0,radius:!0}).shape).omit(L),pe=v.partial().extend(v.pick(F).shape).omit(L),ce=R.partial().extend(R.pick(F).shape).omit(L),me=re.partial().omit({...L,name:!0,type:!0}).extend({type:e.z.literal("Text"),text:e.z.string()}),ge=ne.partial().omit({...L,name:!0,type:!0}).extend({type:e.z.literal("Note"),text:e.z.string()}),bt=N.partial().extend(N.pick({...F,imageUrl:!0}).shape).omit(L),xe=e.z.discriminatedUnion("type",[ie,K,se,le,pe,ce,bt,me,ge]);var kr=O.omit({coordinates:!0}),Vr=j.omit({coordinates:!0});var wr=v.omit({coordinates:!0}),Ur=R.omit({coordinates:!0});var Or=N.omit({coordinates:!0}),jr=Lt.omit({coordinates:!0}),b={type:!0,id:!0},Mt=_.partial().extend(_.pick(b).shape),Ct=O.partial().extend(O.pick(b).shape),Gt=j.partial().extend(j.pick(b).shape),It=Q.partial().extend(Q.pick(b).shape),Tt=v.partial().extend(v.pick(b).shape),Pt=R.partial().extend(R.pick(b).shape),Et=re.partial().extend(re.pick(b).shape).omit({name:!0}),zt=ne.partial().extend(ne.pick(b).shape).omit({name:!0}),Ft=N.partial().extend(N.pick(b).shape),Le=e.z.discriminatedUnion("type",[Mt,Ct,Gt,It,Tt,Pt,Et,zt,Ft]),be=e.z.object({ids:e.z.array(e.z.string()).optional()}),Me=e.z.object({ids:e.z.array(e.z.string()).optional()});var kt=t("getElement",d.z.string()),Vt=t("getElementGeometry",d.z.string()),wt=t("getElements",be.optional()),Ut=t("getElementGroup",d.z.string()),Ot=t("getElementGroups",Me.optional()),jt=t("setElementGroupVisibility",E),vt=h("onElementChange",d.z.object({id:d.z.string()})),Rt=p("onElementCreate"),Nt=p("onElementCreateEnd"),At=h("onElementDelete",d.z.object({id:d.z.string()})),Bt=h("onElementGroupChange",d.z.object({id:d.z.string()})),Dt=t("createElement",xe),Ht=t("updateElement",Le),Jt=t("deleteElement",d.z.string()),Ce={methods:[kt,Vt,wt,Ut,Ot,jt,Dt,Ht,Jt],listeners:[vt,Rt,Nt,At,Bt]};var Zt=p("onPointerClick"),qt=p("onPointerMove"),Ge={methods:null,listeners:[Zt,qt]};var a=require("zod");var i=require("zod");var Wt=i.z.enum(["in","ni"]),_t=i.z.enum(["lt","gt","le","ge","eq","ne","cn","nc","is","isnt"]),Zr=i.z.enum(["and","or"]),Ie=i.z.union([i.z.number(),i.z.string(),i.z.boolean(),i.z.null()]),Te=i.z.string().or(i.z.null()),Qt=i.z.tuple([Te,Wt,i.z.array(Ie).or(i.z.null())]),$t=i.z.tuple([Te,_t,Ie]),ye=i.z.union([Qt,$t]),de=i.z.tuple([i.z.lazy(()=>i.z.union([de,ye,i.z.null(),i.z.boolean()])),i.z.enum(["and","or"]),i.z.lazy(()=>i.z.union([de,ye,i.z.null(),i.z.boolean()]))]),M=i.z.union([de,ye,i.z.null(),i.z.boolean()]),C=i.z.union([x,w,q,i.z.array(T)]);var o=require("zod");var Pe=o.z.enum(["avg","max","min","sum","median"]),Ee=o.z.enum(["avg","max","min","sum","count"]),Kt=o.z.object({method:Pe,attribute:o.z.string()}),Xt=o.z.object({methods:o.z.array(o.z.union([Pe,o.z.literal("count")])),attribute:o.z.string().optional()}),ze=o.z.object({boundary:C.optional(),filters:M.optional(),aggregation:Kt.optional()}),Fe=o.z.object({layerId:o.z.string(),attribute:o.z.string(),limit:o.z.number().optional(),boundary:C.optional(),filters:M.optional(),values:ze.optional()}),_r=o.z.object({key:o.z.union([o.z.number(),o.z.string(),o.z.boolean()]),value:o.z.number().nullable()}),Yt=o.z.object({type:o.z.literal("equal-intervals"),count:o.z.number()}),eo=o.z.object({type:o.z.literal("time-interval"),interval:o.z.enum(["hour","day","week","month","year"])}),ke=o.z.object({layerId:o.z.string(),attribute:o.z.string(),steps:o.z.union([Yt,eo,o.z.array(o.z.number())]),boundary:C.optional(),filters:M.optional(),values:ze.optional()}),Qr=o.z.object({min:o.z.number(),max:o.z.number(),value:o.z.number()}),Ve=o.z.object({layerId:o.z.string(),boundary:C.optional(),filters:M.optional(),aggregation:Xt}),we=o.z.enum(["h3"]),to=o.z.object({type:we,resolution:o.z.number(),method:Ee.extract(["count"])}),oo=o.z.object({type:we,resolution:o.z.number(),method:Ee.exclude(["count"]),attribute:o.z.string()}),ro=o.z.union([to,oo]),Ue=o.z.object({layerId:o.z.string(),boundary:C.optional(),filters:M.optional(),gridConfig:ro});var r=require("zod");var Xr=r.z.enum(["processing","completed","failed","incomplete"]),Oe=r.z.object({type:r.z.literal("geoJsonUrl"),url:r.z.string().url(),refreshInterval:r.z.number().min(250).max(5*60*1e3).nullable().optional()}),je=r.z.object({type:r.z.literal("geoJsonData"),data:r.z.object({}).passthrough().or(r.z.instanceof(ArrayBuffer))}),ve=r.z.object({type:r.z.literal("geoJsonFile"),file:r.z.instanceof(File)}),Re=r.z.object({id:r.z.string(),style:r.z.object({}).passthrough().optional(),shownInLegend:r.z.boolean().optional(),name:r.z.string().optional(),caption:r.z.string().optional(),description:r.z.string().optional(),bounds:x.optional(),source:r.z.union([Oe,je,ve]).optional()}),Ne=r.z.object({ids:r.z.array(r.z.string()).optional()}),Ae=r.z.object({ids:r.z.array(r.z.string()).optional()}),k=r.z.object({id:r.z.string(),layerId:r.z.string()}),Be=r.z.object({ids:k.array().optional(),layerIds:r.z.string().array().optional()}),De=r.z.object({layerIds:r.z.array(r.z.string()).optional(),areaQuery:r.z.union([r.z.object({coordinates:Z}),r.z.object({boundary:x})]).optional()}),no=r.z.object({Point:r.z.object({}).passthrough().optional(),Line:r.z.object({}).passthrough().optional(),Polygon:r.z.object({}).passthrough().optional()}),He=r.z.object({source:r.z.union([Oe,je,ve]),name:r.z.string(),bounds:x.optional(),caption:r.z.string().optional(),description:r.z.string().optional(),geometryStyles:no.optional()});var ao=t("getLayer",a.z.string()),io=t("getLayers",Ne.optional()),so=t("setLayerVisibility",E),lo=h("onLayerChange",a.z.object({id:a.z.string()})),po=t("setLayerStyle",a.z.object({id:a.z.string(),style:a.z.object({}).passthrough()})),co=t("setLayerLegendVisibility",E),mo=t("createLayersFromGeoJson",He),go=t("updateLayer",Re),yo=t("deleteLayer",a.z.string()),uo=t("getLayerGroup",a.z.string()),ho=t("getLayerGroups",Ae.optional()),fo=t("setLayerGroupVisibility",E),So=t("setLayerGroupLegendVisibility",E),xo=h("onLayerGroupChange",a.z.object({id:a.z.string()})),Lo=t("getLegendItem",k),bo=t("getLegendItems",Be.optional()),Mo=h("onLegendItemChange",k),Co=t("setLegendItemVisibility",a.z.object({show:k.array().optional(),hide:k.array().optional()})),Go=t("getLayerFilters",a.z.string()),Io=t("setLayerFilters",a.z.object({layerId:a.z.string(),filters:M,note:a.z.string().optional()})),To=h("onLayerFiltersChange",a.z.object({layerId:a.z.string()})),Po=t("getLayerBoundaries",a.z.string()),Eo=t("setLayerBoundary",a.z.object({layerIds:a.z.array(a.z.string()),boundary:C.nullable()})),zo=h("onLayerBoundariesChange",a.z.object({layerId:a.z.string()})),Fo=t("getRenderedFeatures",De.optional()),ko=t("getFeature",a.z.object({id:a.z.string().or(a.z.number()),layerId:a.z.string()})),Vo=t("getFeatures",a.z.object({layerId:a.z.string(),filters:M.optional(),sorting:W.optional(),boundary:C.optional(),search:a.z.string().optional(),pagination:a.z.string().optional().nullish()})),wo=t("getGeoJsonFeature",a.z.object({id:a.z.string().or(a.z.number()),layerId:a.z.string()})),Uo=t("getCategoryData",Fe),Oo=t("getHistogramData",ke),jo=t("getAggregates",Ve),vo=t("getPrecomputedAggregates",Ue),Ro=t("getLayerSchema",a.z.string()),Je={methods:[ao,io,so,po,co,mo,yo,go,uo,ho,fo,So,Lo,bo,Co,Go,Io,Po,Eo,Fo,ko,Vo,wo,Uo,Oo,jo,vo,Ro],listeners:[lo,xo,Mo,To,zo]};var Ze=require("zod");var No=t("getMapDetails",Ze.z.undefined()),qe={methods:[No],listeners:[]};var A=require("zod");var G=require("zod"),We=G.z.object({id:G.z.string().or(G.z.number()),layerId:G.z.string(),showPopup:G.z.boolean().optional(),fitViewport:G.z.boolean().or(G.z.object({maxZoom:G.z.number()})).optional()});var Ao=t("getSelection",A.z.undefined()),Bo=p("onSelectionChange"),Do=t("selectFeature",We),Ho=t("clearSelection",A.z.object({features:A.z.boolean().optional(),elements:A.z.boolean().optional()}).optional()),_e={methods:[Ao,Do,Ho],listeners:[Bo]};var Ye=require("zod");var c=require("zod");var Qe=["circle","highlighter","line","marker","note","pin","polygon","route","text"],Jo=[...Qe,"link"],$e=c.z.enum(Jo),Ke=c.z.enum(Qe),Zo=ie.pick({color:!0,symbol:!0,frame:!0}).extend({afterCreation:c.z.enum(["enter name","add another","select"])}).required(),qo=K.pick({color:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0}).required(),Wo=K.pick({color:!0,routingMode:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,distanceMarker:!0,endCaps:!0}).required(),_o=se.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,areaMarker:!0}).required(),Qo=le.pick({color:!0,fillOpacity:!0,strokeOpacity:!0,strokeWidth:!0,strokeStyle:!0,radiusMarker:!0}).required(),$o=pe.pick({color:!0,opacity:!0,size:!0}).required(),Ko=ce.pick({color:!0,opacity:!0,renderHoles:!0}).extend({size:c.z.number().min(0).max(200)}).required(),Xo=me.pick({color:!0,align:!0,style:!0}).required(),Yo=ge.pick({color:!0,align:!0,style:!0}).required(),Xe=c.z.discriminatedUnion("tool",[Zo.partial().extend({tool:c.z.literal("pin")}),qo.partial().extend({tool:c.z.literal("line")}),Wo.partial().extend({tool:c.z.literal("route")}),_o.partial().extend({tool:c.z.literal("polygon")}),Qo.partial().extend({tool:c.z.literal("circle")}),$o.partial().extend({tool:c.z.literal("marker")}),Ko.partial().extend({tool:c.z.literal("highlighter")}),Xo.partial().extend({tool:c.z.literal("text")}),Yo.partial().extend({tool:c.z.literal("note")})]);var er=t("setTool",$e.nullable()),tr=t("getTool",Ye.z.undefined()),or=p("onToolChange"),rr=t("setToolSettings",Xe),nr=t("getToolSettings",Ke),ar=p("onToolSettingsChange"),et={methods:[er,tr,rr,nr],listeners:[or,ar]};var X=require("zod");var m=require("zod"),tt=m.z.object({showLegend:m.z.boolean().optional(),cooperativeGestures:m.z.boolean().optional(),fullScreenButton:m.z.boolean().optional(),geolocation:m.z.boolean().optional(),zoomControls:m.z.boolean().optional(),scaleBar:m.z.boolean().optional()}),ot=m.z.object({featureSelectPanel:m.z.boolean().optional(),featureHoverPanel:m.z.boolean().optional(),elementSelectPanel:m.z.boolean().optional(),linkClickOpen:m.z.boolean().optional(),imageLightboxOpen:m.z.boolean().optional()});var ir=t("updateUiControls",tt),sr=t("setOnMapInteractionsUi",ot),lr=t("showLayerDataTable",X.z.object({layerId:X.z.string(),sorting:W.optional()}).optional()),pr=t("hideLayerDataTable",X.z.undefined()),rt={methods:[ir,sr,lr,pr],listeners:null};var ue=require("zod");var B=require("zod");var Y=B.z.object({center:Z,zoom:fe}),nt=B.z.object({center:Y.shape.center.optional(),zoom:Y.shape.zoom.optional()}),at=B.z.object({minZoom:Y.shape.zoom.nullish(),maxZoom:Y.shape.zoom.nullish(),bounds:x.nullish()}).nullable(),it=B.z.object({bounds:x});var cr=t("getViewport",ue.z.undefined()),mr=t("setViewport",nt),gr=t("getViewportConstraints",ue.z.undefined()),yr=t("setViewportConstraints",at),dr=t("fitViewportToBounds",it),ur=p("onViewportMove"),hr=p("onViewportMoveEnd"),fr=p("onMapIdle"),st={methods:[mr,cr,gr,yr,dr],listeners:[ur,hr,fr]};var he=[rt,st,Je,Ce,_e,Ge,et,qe];function Sr(n,l,P){let z=new Map;async function I(u){if(!Cr.safeParse(u.data).success){P?.onUnknownMessage?.(u.data);return}let D=ct.safeParse(u.data);if(!D.success){P?.onInvalidMessage?.(u.data,D.error),u.ports[0]?.postMessage(lt(D.error.message));return}let{data:y}=D;if(y.type==="felt.ready")u.ports[0]?.postMessage(!0);else if(y.type==="felt.addListener"){if(y.event.eventName==="")throw new Error("felt.addListener eventName cannot be empty");let V="options"in y.event?{options:"options"in y.event?y.event.options:void 0,handler:te=>{u.ports[0]?.postMessage(te)}}:{handler:te=>{u.ports[0]?.postMessage(te)}},ee=l.listeners[y.event.eventName](V);z.set(y.event.id,ee)}else if(y.type==="felt.removeListener")z.get(y.id)?.(),z.delete(y.id);else try{let V=l.methods[y.type],ee=await V(y.params);u.ports[0]?.postMessage(ee)}catch(V){u.ports[0]?.postMessage(lt(V))}}return n.addEventListener("message",I),()=>{n.removeEventListener("message",I)}}var pt={methods:he.map(n=>n.methods??[]).flat(),listeners:he.map(n=>n.listeners??[]).flat()},xr=g.z.discriminatedUnion("eventName",[g.z.strictObject({eventName:g.z.literal("")}),...pt.listeners]),Lr=g.z.strictObject({type:g.z.literal("felt.addListener"),event:xr}),br=g.z.strictObject({type:g.z.literal("felt.removeListener"),id:g.z.string()}),Mr=g.z.strictObject({type:g.z.literal("felt.ready")}),ct=g.z.discriminatedUnion("type",[Mr,Lr,br,...pt.methods]),Cr=g.z.object({type:g.z.enum(ct.options.map(n=>n.shape.type.value))});function lt(n){return{__error__:Gr(n)}}function Gr(n){return n instanceof Error?n.message:typeof n=="object"&&n!==null&&"message"in n?String(n.message):typeof n=="string"?n:"Unknown error"}0&&(module.exports={createMessageHandler});
|
package/dist/handler.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z, ZodError } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { bw as UnwrapPromise, F as FeltController, z as zInfer, c as ElementChangeCallbackParams, f as ElementGroupChangeCallbackParams, E as Element, D as MapInteractionEvent, $ as LayerChangeCallbackParams, a2 as LayerGroupChangeCallbackParams, a5 as LegendItemChangeCallbackParams, at as LayerFilters, as as LayerBoundaries, ap as FilterTernary, aO as EntityNode, bn as ToolType, bl as ToolSettingsChangeEvent, bu as ViewportState, bx as UnionToIntersection, by as PromiseOrNot } from './controller-o3EwSJvB.cjs';
|
|
3
3
|
|
|
4
4
|
type FeltControllerFunctions = Omit<FeltController, "iframe">;
|
|
5
5
|
type Method<TRequest extends {
|
|
@@ -3435,6 +3435,146 @@ declare const GetLayerCalculationMessage: z.ZodObject<{
|
|
|
3435
3435
|
};
|
|
3436
3436
|
type: "getAggregates";
|
|
3437
3437
|
}>;
|
|
3438
|
+
declare const GetLayerPrecomputedCalculationMessage: z.ZodObject<{
|
|
3439
|
+
type: z.ZodLiteral<"getPrecomputedAggregates">;
|
|
3440
|
+
params: z.ZodObject<{
|
|
3441
|
+
layerId: z.ZodString;
|
|
3442
|
+
boundary: z.ZodOptional<z.ZodUnion<[z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>, z.ZodObject<{
|
|
3443
|
+
type: z.ZodLiteral<"Polygon">;
|
|
3444
|
+
coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">;
|
|
3445
|
+
}, "strip", z.ZodTypeAny, {
|
|
3446
|
+
type: "Polygon";
|
|
3447
|
+
coordinates: [number, number][][];
|
|
3448
|
+
}, {
|
|
3449
|
+
type: "Polygon";
|
|
3450
|
+
coordinates: [number, number][][];
|
|
3451
|
+
}>, z.ZodObject<{
|
|
3452
|
+
type: z.ZodLiteral<"MultiPolygon">;
|
|
3453
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">, [number, number][], [number, number][]>, "many">, "many">;
|
|
3454
|
+
}, "strip", z.ZodTypeAny, {
|
|
3455
|
+
type: "MultiPolygon";
|
|
3456
|
+
coordinates: [number, number][][][];
|
|
3457
|
+
}, {
|
|
3458
|
+
type: "MultiPolygon";
|
|
3459
|
+
coordinates: [number, number][][][];
|
|
3460
|
+
}>, z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>, "many">]>>;
|
|
3461
|
+
filters: z.ZodOptional<z.ZodUnion<[z.ZodType<FilterTernary, z.ZodTypeDef, FilterTernary>, z.ZodUnion<[z.ZodTuple<[z.ZodUnion<[z.ZodString, z.ZodNull]>, z.ZodEnum<["in", "ni"]>, z.ZodUnion<[z.ZodArray<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>, "many">, z.ZodNull]>], null>, z.ZodTuple<[z.ZodUnion<[z.ZodString, z.ZodNull]>, z.ZodEnum<["lt", "gt", "le", "ge", "eq", "ne", "cn", "nc", "is", "isnt"]>, z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull]>], null>]>, z.ZodNull, z.ZodBoolean]>>;
|
|
3462
|
+
gridConfig: z.ZodUnion<[z.ZodObject<{
|
|
3463
|
+
type: z.ZodEnum<["h3"]>;
|
|
3464
|
+
resolution: z.ZodNumber;
|
|
3465
|
+
method: z.ZodEnum<["count"]>;
|
|
3466
|
+
}, "strip", z.ZodTypeAny, {
|
|
3467
|
+
type: "h3";
|
|
3468
|
+
method: "count";
|
|
3469
|
+
resolution: number;
|
|
3470
|
+
}, {
|
|
3471
|
+
type: "h3";
|
|
3472
|
+
method: "count";
|
|
3473
|
+
resolution: number;
|
|
3474
|
+
}>, z.ZodObject<{
|
|
3475
|
+
type: z.ZodEnum<["h3"]>;
|
|
3476
|
+
resolution: z.ZodNumber;
|
|
3477
|
+
method: z.ZodEnum<["avg", "max", "min", "sum"]>;
|
|
3478
|
+
attribute: z.ZodString;
|
|
3479
|
+
}, "strip", z.ZodTypeAny, {
|
|
3480
|
+
type: "h3";
|
|
3481
|
+
attribute: string;
|
|
3482
|
+
method: "avg" | "max" | "min" | "sum";
|
|
3483
|
+
resolution: number;
|
|
3484
|
+
}, {
|
|
3485
|
+
type: "h3";
|
|
3486
|
+
attribute: string;
|
|
3487
|
+
method: "avg" | "max" | "min" | "sum";
|
|
3488
|
+
resolution: number;
|
|
3489
|
+
}>]>;
|
|
3490
|
+
}, "strip", z.ZodTypeAny, {
|
|
3491
|
+
layerId: string;
|
|
3492
|
+
gridConfig: {
|
|
3493
|
+
type: "h3";
|
|
3494
|
+
method: "count";
|
|
3495
|
+
resolution: number;
|
|
3496
|
+
} | {
|
|
3497
|
+
type: "h3";
|
|
3498
|
+
attribute: string;
|
|
3499
|
+
method: "avg" | "max" | "min" | "sum";
|
|
3500
|
+
resolution: number;
|
|
3501
|
+
};
|
|
3502
|
+
boundary?: [number, number, number, number] | [number, number][] | {
|
|
3503
|
+
type: "Polygon";
|
|
3504
|
+
coordinates: [number, number][][];
|
|
3505
|
+
} | {
|
|
3506
|
+
type: "MultiPolygon";
|
|
3507
|
+
coordinates: [number, number][][][];
|
|
3508
|
+
} | undefined;
|
|
3509
|
+
filters?: boolean | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | FilterTernary | null | undefined;
|
|
3510
|
+
}, {
|
|
3511
|
+
layerId: string;
|
|
3512
|
+
gridConfig: {
|
|
3513
|
+
type: "h3";
|
|
3514
|
+
method: "count";
|
|
3515
|
+
resolution: number;
|
|
3516
|
+
} | {
|
|
3517
|
+
type: "h3";
|
|
3518
|
+
attribute: string;
|
|
3519
|
+
method: "avg" | "max" | "min" | "sum";
|
|
3520
|
+
resolution: number;
|
|
3521
|
+
};
|
|
3522
|
+
boundary?: [number, number, number, number] | [number, number][] | {
|
|
3523
|
+
type: "Polygon";
|
|
3524
|
+
coordinates: [number, number][][];
|
|
3525
|
+
} | {
|
|
3526
|
+
type: "MultiPolygon";
|
|
3527
|
+
coordinates: [number, number][][][];
|
|
3528
|
+
} | undefined;
|
|
3529
|
+
filters?: boolean | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | FilterTernary | null | undefined;
|
|
3530
|
+
}>;
|
|
3531
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
3532
|
+
params: {
|
|
3533
|
+
layerId: string;
|
|
3534
|
+
gridConfig: {
|
|
3535
|
+
type: "h3";
|
|
3536
|
+
method: "count";
|
|
3537
|
+
resolution: number;
|
|
3538
|
+
} | {
|
|
3539
|
+
type: "h3";
|
|
3540
|
+
attribute: string;
|
|
3541
|
+
method: "avg" | "max" | "min" | "sum";
|
|
3542
|
+
resolution: number;
|
|
3543
|
+
};
|
|
3544
|
+
boundary?: [number, number, number, number] | [number, number][] | {
|
|
3545
|
+
type: "Polygon";
|
|
3546
|
+
coordinates: [number, number][][];
|
|
3547
|
+
} | {
|
|
3548
|
+
type: "MultiPolygon";
|
|
3549
|
+
coordinates: [number, number][][][];
|
|
3550
|
+
} | undefined;
|
|
3551
|
+
filters?: boolean | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | FilterTernary | null | undefined;
|
|
3552
|
+
};
|
|
3553
|
+
type: "getPrecomputedAggregates";
|
|
3554
|
+
}, {
|
|
3555
|
+
params: {
|
|
3556
|
+
layerId: string;
|
|
3557
|
+
gridConfig: {
|
|
3558
|
+
type: "h3";
|
|
3559
|
+
method: "count";
|
|
3560
|
+
resolution: number;
|
|
3561
|
+
} | {
|
|
3562
|
+
type: "h3";
|
|
3563
|
+
attribute: string;
|
|
3564
|
+
method: "avg" | "max" | "min" | "sum";
|
|
3565
|
+
resolution: number;
|
|
3566
|
+
};
|
|
3567
|
+
boundary?: [number, number, number, number] | [number, number][] | {
|
|
3568
|
+
type: "Polygon";
|
|
3569
|
+
coordinates: [number, number][][];
|
|
3570
|
+
} | {
|
|
3571
|
+
type: "MultiPolygon";
|
|
3572
|
+
coordinates: [number, number][][][];
|
|
3573
|
+
} | undefined;
|
|
3574
|
+
filters?: boolean | [string | null, "in" | "ni", (string | number | boolean | null)[] | null] | [string | null, "lt" | "gt" | "le" | "ge" | "eq" | "ne" | "cn" | "nc" | "is" | "isnt", string | number | boolean | null] | FilterTernary | null | undefined;
|
|
3575
|
+
};
|
|
3576
|
+
type: "getPrecomputedAggregates";
|
|
3577
|
+
}>;
|
|
3438
3578
|
declare const GetLayerSchemaMessage: z.ZodObject<{
|
|
3439
3579
|
type: z.ZodLiteral<"getLayerSchema">;
|
|
3440
3580
|
params: z.ZodString;
|
|
@@ -3473,6 +3613,7 @@ type LayersSchema = {
|
|
|
3473
3613
|
getCategoryData: Method<zInfer<typeof GetLayerCategoriesMessage>>;
|
|
3474
3614
|
getHistogramData: Method<zInfer<typeof GetLayerHistogramMessage>>;
|
|
3475
3615
|
getAggregates: Method<zInfer<typeof GetLayerCalculationMessage>>;
|
|
3616
|
+
getPrecomputedAggregates: Method<zInfer<typeof GetLayerPrecomputedCalculationMessage>>;
|
|
3476
3617
|
getLayerSchema: Method<zInfer<typeof GetLayerSchemaMessage>>;
|
|
3477
3618
|
};
|
|
3478
3619
|
listeners: {
|
|
@@ -3600,12 +3741,12 @@ type SelectionSchema = {
|
|
|
3600
3741
|
|
|
3601
3742
|
declare const SetToolMessage: z.ZodObject<{
|
|
3602
3743
|
type: z.ZodLiteral<"setTool">;
|
|
3603
|
-
params: z.ZodNullable<z.ZodEnum<["
|
|
3744
|
+
params: z.ZodNullable<z.ZodEnum<["circle", "highlighter", "line", "marker", "note", "pin", "polygon", "route", "text", "link"]>>;
|
|
3604
3745
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
3605
|
-
params: "text" | "note" | "
|
|
3746
|
+
params: "text" | "note" | "circle" | "highlighter" | "line" | "link" | "marker" | "pin" | "polygon" | "route" | null;
|
|
3606
3747
|
type: "setTool";
|
|
3607
3748
|
}, {
|
|
3608
|
-
params: "text" | "note" | "
|
|
3749
|
+
params: "text" | "note" | "circle" | "highlighter" | "line" | "link" | "marker" | "pin" | "polygon" | "route" | null;
|
|
3609
3750
|
type: "setTool";
|
|
3610
3751
|
}>;
|
|
3611
3752
|
declare const GetToolMessage: z.ZodObject<{
|
|
@@ -3934,12 +4075,12 @@ declare const SetToolSettingsMessage: z.ZodObject<{
|
|
|
3934
4075
|
}>;
|
|
3935
4076
|
declare const GetToolSettingsMessage: z.ZodObject<{
|
|
3936
4077
|
type: z.ZodLiteral<"getToolSettings">;
|
|
3937
|
-
params: z.ZodEnum<["
|
|
4078
|
+
params: z.ZodEnum<["circle", "highlighter", "line", "marker", "note", "pin", "polygon", "route", "text"]>;
|
|
3938
4079
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
3939
|
-
params: "text" | "note" | "
|
|
4080
|
+
params: "text" | "note" | "circle" | "highlighter" | "line" | "marker" | "pin" | "polygon" | "route";
|
|
3940
4081
|
type: "getToolSettings";
|
|
3941
4082
|
}, {
|
|
3942
|
-
params: "text" | "note" | "
|
|
4083
|
+
params: "text" | "note" | "circle" | "highlighter" | "line" | "marker" | "pin" | "polygon" | "route";
|
|
3943
4084
|
type: "getToolSettings";
|
|
3944
4085
|
}>;
|
|
3945
4086
|
type ToolsSchema = {
|