@road-labs/map-sdk 0.0.28-rc.6 → 0.0.28-rc.7
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/README.md +5 -9
- package/dist/components/AnalyticsOverlay/AnalyticsOverlay.d.ts +1 -0
- package/dist/components/CustomMarker/CustomMarker.d.ts +2 -1
- package/dist/contexts/Map.d.ts +16 -1
- package/dist/i18n.d.ts +10 -1
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2960 -2603
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +25 -7
- package/dist/utils/buckets.d.ts +2 -0
- package/dist/utils/buckets.test.d.ts +1 -0
- package/dist/utils/formatters.d.ts +1 -1
- package/dist/utils/i18n.test.d.ts +1 -0
- package/dist/utils/location.d.ts +1 -1
- package/dist/utils/request.d.ts +15 -4
- package/dist/utils/request.test.d.ts +1 -0
- package/dist/utils/status.d.ts +9 -0
- package/dist/utils/status.test.d.ts +1 -0
- package/dist/utils/statusFilters.d.ts +15 -0
- package/dist/utils/statusFilters.test.d.ts +1 -0
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
type PublishingMode = "PUBLISHING_MODE_PUBLIC" | "PUBLISHING_MODE_PRIVATE";
|
|
2
|
+
export type MapKind = "roaming" | "cpo";
|
|
2
3
|
export type FilterConfiguration = {
|
|
3
4
|
showOperatorOnly?: string;
|
|
4
5
|
preferredOperators: string[];
|
|
@@ -10,6 +11,26 @@ export type FilterConfiguration = {
|
|
|
10
11
|
showExcludeOperatorFilter?: boolean;
|
|
11
12
|
showPaymentMethodFilter?: boolean;
|
|
12
13
|
operators?: string[];
|
|
14
|
+
showAnalytics?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type AnalyticsBucket = {
|
|
17
|
+
name: string;
|
|
18
|
+
count: number;
|
|
19
|
+
};
|
|
20
|
+
export type Analytics = {
|
|
21
|
+
context: "cpo" | "msp";
|
|
22
|
+
locations: {
|
|
23
|
+
total: number;
|
|
24
|
+
};
|
|
25
|
+
evses: {
|
|
26
|
+
total: number;
|
|
27
|
+
byStatus?: AnalyticsBucket[];
|
|
28
|
+
};
|
|
29
|
+
connectors: {
|
|
30
|
+
total: number;
|
|
31
|
+
byPowerType: AnalyticsBucket[];
|
|
32
|
+
byOcppStatus?: AnalyticsBucket[];
|
|
33
|
+
};
|
|
13
34
|
};
|
|
14
35
|
export type RoadMapOptions = {
|
|
15
36
|
gestureHandling: string;
|
|
@@ -43,7 +64,6 @@ export type RoadMapOptions = {
|
|
|
43
64
|
evseId?: string;
|
|
44
65
|
from?: string;
|
|
45
66
|
to?: string;
|
|
46
|
-
context: "cpo" | "msp";
|
|
47
67
|
onMarkerClicked?: ({ ids }: {
|
|
48
68
|
ids: any;
|
|
49
69
|
}) => {};
|
|
@@ -80,12 +100,10 @@ export type GeohashItem = {
|
|
|
80
100
|
lat: number;
|
|
81
101
|
lon: number;
|
|
82
102
|
};
|
|
83
|
-
statuses:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
];
|
|
103
|
+
statuses: Array<{
|
|
104
|
+
name: string;
|
|
105
|
+
count: number;
|
|
106
|
+
}>;
|
|
89
107
|
count: number;
|
|
90
108
|
};
|
|
91
109
|
export type OcpiPriceComponent = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -17,4 +17,4 @@ export declare function getSocketText(connector: any): string;
|
|
|
17
17
|
export declare function formatConnectorStandard(value: any): any;
|
|
18
18
|
export declare function getStatusLabel(t: MapContextType["t"], status: any): string;
|
|
19
19
|
export declare function getLocationLabel(t: MapContextType["t"], location: any): string;
|
|
20
|
-
export declare function getStatusColorFromEvses(evses?: any[]):
|
|
20
|
+
export declare function getStatusColorFromEvses(evses?: any[]): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/utils/location.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getColorForStatus(status: any):
|
|
1
|
+
export declare function getColorForStatus(status: any): string;
|
package/dist/utils/request.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RemoteConfig } from '../types';
|
|
1
|
+
import { Analytics, MapKind, RemoteConfig } from '../types';
|
|
2
2
|
type RequestOptionsType = {
|
|
3
3
|
method?: string;
|
|
4
4
|
body?: string;
|
|
@@ -9,11 +9,22 @@ type RequestOptionsType = {
|
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
11
|
export declare function request(url: string, options?: RequestOptionsType): Promise<any>;
|
|
12
|
-
export declare function
|
|
12
|
+
export declare function buildSearchBody(limitToLocationIds: string[], props: Record<string, any>): {
|
|
13
|
+
chargingAccessibility: any;
|
|
14
|
+
searchPhrase: any;
|
|
15
|
+
excludeOperator: any;
|
|
16
|
+
authMethodCapabilities: any;
|
|
17
|
+
operator?: any[];
|
|
18
|
+
locationIds: string[];
|
|
19
|
+
};
|
|
20
|
+
export declare function mapSearchPath(apiRoot: string, kind: MapKind, endpoint: "search" | "analytics"): string;
|
|
21
|
+
export declare function _fetchGeohashes(apiRoot: any, version: any, authorization: any, limitToLocationIds: any, { precision, ...props }: {
|
|
13
22
|
[x: string]: any;
|
|
14
23
|
precision: any;
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
}, kind?: MapKind): Promise<any>;
|
|
25
|
+
export declare function _fetchAnalytics(apiRoot: any, version: any, authorization: any, limitToLocationIds: any, props: any, kind?: MapKind): Promise<{
|
|
26
|
+
data: Analytics;
|
|
27
|
+
}>;
|
|
17
28
|
export declare function _fetchTariffs(apiRoot: any, version: any, authorization: any, { origin, ids }: {
|
|
18
29
|
origin: any;
|
|
19
30
|
ids: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LabelsType } from '../i18n';
|
|
2
|
+
import { MapKind } from '../types';
|
|
3
|
+
export declare function normaliseStatus(status?: string): string;
|
|
4
|
+
export declare function getStatusColor(status?: string, kind?: MapKind): string;
|
|
5
|
+
export declare function getStatusLabelKey(status?: string): keyof LabelsType;
|
|
6
|
+
export declare function pickMarkerColor(statuses?: Array<{
|
|
7
|
+
name: string;
|
|
8
|
+
count: number;
|
|
9
|
+
}>, kind?: MapKind): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LabelsType } from '../i18n';
|
|
2
|
+
import { MapKind } from '../types';
|
|
3
|
+
export type StatusFilterOption = {
|
|
4
|
+
id: string;
|
|
5
|
+
labelKey: keyof LabelsType;
|
|
6
|
+
values: string[];
|
|
7
|
+
color: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function getStatusFilterOptions(kind?: MapKind): StatusFilterOption[];
|
|
10
|
+
export declare function toggleOption(action: "remove" | "add", existing: string[], values: string[]): string[];
|
|
11
|
+
export declare function findStatusFilterOption(kind: MapKind | undefined, status: string): StatusFilterOption | undefined;
|
|
12
|
+
export declare function isStatusFilterActive(kind: MapKind | undefined, selected: string[], status: string): boolean;
|
|
13
|
+
export declare function toggleStatusFilter(kind: MapKind | undefined, selected: string[], status: string): string[] | undefined;
|
|
14
|
+
export declare function withoutStatusFilter(filters: Record<string, any> | undefined): Record<string, any>;
|
|
15
|
+
export declare function statusForLocations(kind: MapKind | undefined, status: string[] | undefined): string[] | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|