///
import { Express as Express$1, Request, Response, NextFunction } from 'express';
import { Logger } from 'log4js';
import { Geometry } from 'geojson';
type DataId = string;
declare enum MapKind {
Real = "Real",
Virtual = "Virtual"
}
type IconKey = {
type: 'system' | 'original';
id: string;
};
type IconDefine = IconKey & {
caption: string;
imagePath: string;
defaultColor?: string;
useMaps: MapKind[];
};
declare enum FeatureType {
STRUCTURE = "STRUCTURE",
ROAD = "ROAD",
EARTH = "EARTH",
FOREST = "FOREST",
AREA = "AREA",
TRACK = "TRACK",
STATIC_IMAGE = "STATIC_IMAGE"
}
type GeocoderIdInfo = {
map: 'osm';
osm_type: string;
osm_id: number;
} | {
map: 'mapbox';
id: string;
};
type GeoProperties = {
featureType: FeatureType.STRUCTURE;
icon?: IconKey;
mark?: {
key: IconKey;
speed: number;
};
color?: string;
} | {
featureType: FeatureType.ROAD;
width: string;
} | {
featureType: FeatureType.EARTH | FeatureType.FOREST;
radius?: number;
} | {
featureType: FeatureType.AREA;
radius?: number;
geocoderId?: GeocoderIdInfo;
color?: string;
} | {
featureType: FeatureType.TRACK;
min_zoom: number;
max_zoom: number;
} | ({
featureType: FeatureType.STATIC_IMAGE;
opacity?: number;
} & ({
url: string;
} | {
base64: string;
}));
declare enum DatasourceLocationKindType {
VirtualItem = "VirtualItem",
RealItem = "RealItem",
Track = "Track",
StaticImage = "StaticImage",
None = "None"
}
type ItemDatasourceConfig = {
kind: DatasourceLocationKindType.Track | DatasourceLocationKindType.VirtualItem;
} | {
kind: DatasourceLocationKindType.RealItem;
drawableArea: boolean;
defaultIcon?: IconKey;
} | {
kind: DatasourceLocationKindType.StaticImage;
};
type ContentDatasourceConfig = {
linkableToItem: boolean;
readonly?: boolean;
fields: ContentFieldDefine[];
};
type ContentFieldDefine = {
key: string;
type: 'title' | 'string' | 'date' | 'url' | 'text' | 'category' | 'single-category' | 'number' | 'image';
label: string;
readonly?: boolean;
} | {
key: string;
type: 'link';
label: string;
databaseId: string;
bidirectional?: {
fieldKey: string;
};
};
type LocationFieldDefine = {
type: 'point';
fields: {
latitude: string;
longitude: string;
radius?: string;
};
} | {
type: 'geojson';
fields: {
geojson: string;
};
} | {
type: 'track';
fields: {
gpxfile: string;
};
} | {
type: 'static-image';
fields: {
image: string;
extent: string;
opacity?: string;
};
};
type ContentValue = {
type: 'title' | 'string' | 'text' | 'date' | 'url';
value: string;
} | {
type: 'number';
value: number;
} | {
type: 'category' | 'single-category';
value: string[];
} | {
type: 'image';
value: number[];
} | {
type: 'link';
value: {
dataId: DataId;
name: string;
}[];
};
type ContentValueInput = Exclude | {
type: 'image';
value: ({
type: 'url';
url: string;
} | {
type: 'base64';
fileName: string;
base64: string;
})[];
} | {
type: 'link';
value: DataId[];
};
type ContentValueMapInput = {
[key: string]: ContentValueInput['value'];
};
type ContentValueMap = {
[key: string]: ContentValue['value'];
};
type Maybe = T | null;
type InputMaybe = Maybe;
type Exact = {
[K in keyof T]: T[K];
};
type MakeOptional = Omit & {
[SubKey in K]?: Maybe;
};
type MakeMaybe = Omit & {
[SubKey in K]: Maybe;
};
type MakeEmpty = {
[_ in K]?: never;
};
type Incremental = T | {
[P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never;
};
type Scalars = {
ID: {
input: string;
output: string;
};
String: {
input: string;
output: string;
};
Boolean: {
input: boolean;
output: boolean;
};
Int: {
input: number;
output: number;
};
Float: {
input: number;
output: number;
};
ContentDatasourceConfig: {
input: ContentDatasourceConfig;
output: ContentDatasourceConfig;
};
ContentValueMap: {
input: ContentValueMap;
output: ContentValueMap;
};
ContentValueMapInput: {
input: ContentValueMapInput;
output: ContentValueMapInput;
};
DataId: {
input: DataId;
output: DataId;
};
GeoProperties: {
input: GeoProperties;
output: GeoProperties;
};
GeocoderIdInfo: {
input: GeocoderIdInfo;
output: GeocoderIdInfo;
};
Geometry: {
input: Geometry;
output: Geometry;
};
IconDefine: {
input: IconDefine;
output: IconDefine;
};
IconKey: {
input: IconKey;
output: IconKey;
};
ItemDatasourceConfig: {
input: ItemDatasourceConfig;
output: ItemDatasourceConfig;
};
JSON: {
input: any;
output: any;
};
MapKind: {
input: MapKind;
output: MapKind;
};
};
declare enum Auth {
Admin = "Admin",
Edit = "Edit",
None = "None",
Request = "Request",
View = "View"
}
declare enum ConnectErrorType {
Forbidden = "Forbidden",
IllegalError = "IllegalError",
NoAuthenticate = "NoAuthenticate",
OperationForbidden = "OperationForbidden",
Requesting = "Requesting",
SessionTimeout = "SessionTimeout",
Unauthorized = "Unauthorized",
UndefinedMap = "UndefinedMap"
}
declare enum ItemLabelMode {
Hidden = "hidden",
RealShow = "realShow",
Show = "show",
VirtualShow = "virtualShow"
}
type MapDefine = {
defaultMapKind: Scalars['MapKind']['output'];
name: Scalars['String']['output'];
options: MapPageOptions;
originalIcons: Array;
useMaps: Array;
};
type MapPageOptions = {
contentsSortCondition?: Maybe;
guestUserAuthLevel: Auth;
itemLabel?: Maybe;
newUserAuthLevel: Auth;
options?: Maybe>;
popupMode?: Maybe;
usePanels?: Maybe>;
};
declare enum PopupMode {
Hidden = "hidden",
Maximum = "maximum",
Minimum = "minimum",
OnlyImage = "onlyImage"
}
declare enum SortCondition {
CreatedAtAsc = "CreatedAtAsc",
CreatedAtDesc = "CreatedAtDesc",
DateAsc = "DateAsc",
DateDesc = "DateDesc",
UpdatedAtAsc = "UpdatedAtAsc",
UpdatedAtDesc = "UpdatedAtDesc"
}
type User = {
authLv: Auth;
id: Scalars['ID']['output'];
name: Scalars['String']['output'];
};
declare enum PublicRange {
Public = "Public",
Private = "Private"
}
type MapPageInfoTable = {
map_page_id: string;
title: string;
use_maps: string;
default_map: MapKind;
public_range: PublicRange;
options?: MapPageOptions;
description?: string;
thumbnail?: string;
odba_connection: OdbaConnection;
last_edited_time: string;
};
type MapPageInfoTableForRegist = Omit & {
options?: string;
odba_connection: string;
};
interface OdbaConnection {
type: string;
}
type ContentsDefine = {
fields: ContentFieldDefine[];
sort?: {
order: 'asc' | 'desc';
} & ({
type: 'field';
fieldKey: string;
} | {
type: 'update_datetime';
});
};
type DataSourceTable = {
data_source_id: string;
location_define: LocationFieldDefine | null;
contents_define: ContentsDefine | null;
odba_connection: OdbaConnection;
last_edited_time: string;
} & ({
location_kind: DatasourceLocationKindType.None | DatasourceLocationKindType.RealItem | DatasourceLocationKindType.Track | DatasourceLocationKindType.StaticImage;
config: DatasourceTblConfigForContent;
} | {
location_kind: DatasourceLocationKindType.VirtualItem;
config: {};
});
type DataSourceTableForRegist = Omit & {
config: string;
location_define: string | null;
contents_define: string | null;
odba_connection: string;
};
type DatasourceTblConfigForContent = Omit;
type MapDataSourceLinkTable = {
map_page_id: string;
data_source_id: string;
datasource_name: string;
group_name?: string[];
order_num?: number;
mdl_config: MapDataSourceLinkConfig;
last_edited_time: string;
};
type MapDataSourceLinkTableForRegist = Omit & {
group_name?: string;
mdl_config: string;
};
type MapDataSourceLinkConfig = {
location_kind: DatasourceLocationKindType.RealItem;
initialVisible: boolean;
contentFieldKeyList: string[];
unclickable?: boolean;
defaultIconKey?: IconKey;
} | {
location_kind: DatasourceLocationKindType.Track | DatasourceLocationKindType.StaticImage;
initialVisible: boolean;
contentFieldKeyList: string[];
} | {
location_kind: DatasourceLocationKindType.VirtualItem;
contentFieldKeyList: string[];
} | {
location_kind: DatasourceLocationKindType.None;
contentFieldKeyList: string[];
};
type DatasTable = {
data_id: DataId;
data_source_id: string;
original_id: string;
last_edited_time: string;
};
type GeometryItemsTable = {
geometry_item_id: number;
data_id: DataId;
min_zoom: number;
max_zoom: number;
feature: any;
geo_properties: string;
static_image?: string;
};
type ContentsTable = {
data_id: DataId;
contents?: ContentValueMap;
date?: string;
};
type ContentsTableForRegist = Omit & {
contents?: string;
date?: Date;
};
type ImagesTable = {
image_id: number;
data_id: DataId;
field_key: string;
thumbnail: string;
medium: string;
};
type DataLinkTable = {
from_data_id: DataId;
from_field_key: string;
to_data_id: DataId;
last_edited_time: string;
};
type OriginalIconsTable = {
icon_page_id: string;
map_page_id: string;
use_maps: string;
caption: string;
base64: string;
last_edited_time: string;
};
type ContentBelongMapView = {
content_id: DataId;
item_id: DataId;
deep: number;
item_datasource_id: string;
map_kind: MapKind;
map_page_id: string;
};
type CurrentMap = {
mapId: string;
mapKind: MapKind;
};
type APIDefine = {
uri: string;
method: 'post' | 'get';
resultType: 'json' | 'blob' | 'string' | 'none';
param: PARAM;
result: RESULT;
};
type CommonParam = {
currentMap: CurrentMap;
};
declare const OdbaRegistDataAPI: APIDefine;
type OdbaRegistDataParam = CommonParam & {
dataSourceId: string;
item?: {
geometry: GeoJSON.Geometry;
geoProperties: GeoProperties;
};
contents?: ContentValueMapInput;
linkItems?: {
id: DataId;
fieldKey?: string;
}[];
};
declare const OdbaUpdateDataAPI: APIDefine;
type OdbaUpdateDataParam = CommonParam & {
target: {
type: 'dataId';
id: DataId;
} | {
type: 'originalId';
originalId: string;
};
item?: {
geometry: GeoJSON.Geometry;
geoProperties: GeoProperties;
} | null;
contents?: ContentValueMapInput;
};
declare const OdbaRemoveDataAPI: APIDefine;
type OdbaRemoveDataParam = CommonParam & {
id: DataId;
};
declare const OdbaUnlinkDataAPI: APIDefine;
type OdbaUnlinkDataParam = CommonParam & {
id: DataId;
parent: DataId;
fieldKey: string;
};
declare const OdbaGetUncachedDataAPI: APIDefine;
type OdbaGetUncachedDataParam = CommonParam & {
dataSourceId: string;
nextToken?: string;
keyword?: string;
};
type OdbaGetUncachedDataResult = {
contents: {
originalId: string;
title: string;
overview?: string;
hasImage?: boolean;
}[];
nextToken?: string;
};
declare const OdbaLinkDataAPI: APIDefine;
type OdbaLinkDataParam = CommonParam & ({
type: 'dataId';
id: DataId;
} | {
type: 'originalId';
originalId: string;
}) & {
parent: DataId;
fieldKey?: string;
};
declare const OdbaGetImageUrlAPI: APIDefine;
type OdbaGetImageUrlParam = CommonParam & {
id: DataId;
};
declare const OdbaGetLinkableContentsAPI: APIDefine;
type OdbaGetLinkableContentsResult = {
contents: {
datasourceId: string;
name: string;
}[];
};
type UpdateContentLinkCacheParam = {
currentMap: CurrentMap;
contentId: DataId;
parent: {
itemId: DataId;
} | {
contentId: DataId;
};
};
declare abstract class OdbaInterface {
abstract registData: (param: OdbaRegistDataParam) => Promise;
abstract updateData: (param: OdbaUpdateDataParam) => Promise;
abstract removeData: (param: OdbaRemoveDataParam) => Promise;
abstract getUncachedData: OdbaAPIFunc;
abstract linkData: (param: OdbaLinkDataParam) => Promise;
abstract unlinkData: (param: OdbaUnlinkDataParam) => Promise;
abstract getImageUrl: (param: OdbaGetImageUrlParam) => Promise;
abstract getLinkableContents: (currentMap: CurrentMap) => Promise;
}
type OdbaAPIFuncParam = {
param: PARAM;
};
type OdbaAPIFunc = (param: OdbaAPIFuncParam) => Promise;
type OdbaAPICallDefine = {
define: APIDefine;
func: OdbaAPIFunc;
};
declare function initializeOdba(app: Express$1, odba: OdbaInterface, logger: Logger): void;
declare function registAPIs(app: Express$1, apiList: OdbaAPICallDefine[], logger: Logger): void;
type BroadcastItemParam = {
operation: 'data-insert' | 'data-update';
targets: DataId[];
} | {
operation: 'data-delete';
targets: {
id: DataId;
map: {
id: string;
kind: MapKind;
}[];
}[];
} | {
operation: 'datasource-define-update';
datasourceId: string;
};
declare function callBroadcast(param: BroadcastItemParam): Promise;
declare function callOdbaApi>(api: API, param: API['param']): Promise;
declare function registFile(file: Express.Multer.File): Promise;
type MapInfo = {
auth_lv: Auth;
name: string;
};
type UserAuthData = {
maps: {
[mapId: string]: MapInfo;
};
};
declare abstract class AuthManagementInterface {
abstract initialize(): Promise;
abstract checkJwt(req: Request, res: Response, next: NextFunction): void;
abstract getUserMapList(userId: string): Promise;
abstract getUserInfo(userId: string, mapId: string): Promise;
abstract requestForEnterMap(param: {
userId: string;
mapId: string;
name: string;
newUserAuthLevel: Auth;
}): Promise;
abstract getUserList(mapId: string): Promise;
abstract updateUserAuth(param: {
mapId: string;
userId: string;
authLv: Auth;
}): Promise;
}
declare function initializeOriginalAuth(app: Express$1, authManagement: AuthManagementInterface, logger: Logger): void;
declare const sleep: (sec: number) => Promise;
declare function convertKmToLonLat(p: number[], km: number): number;
export { APIDefine, Auth, AuthManagementInterface, BroadcastItemParam, ConnectErrorType, ContentBelongMapView, ContentDatasourceConfig, ContentFieldDefine, ContentValue, ContentValueInput, ContentValueMap, ContentValueMapInput, ContentsDefine, ContentsTable, ContentsTableForRegist, CurrentMap, DataId, DataLinkTable, DataSourceTable, DataSourceTableForRegist, DatasTable, DatasourceLocationKindType, DatasourceTblConfigForContent, Exact, FeatureType, GeoProperties, GeocoderIdInfo, GeometryItemsTable, IconDefine, IconKey, ImagesTable, Incremental, InputMaybe, ItemDatasourceConfig, ItemLabelMode, LocationFieldDefine, MakeEmpty, MakeMaybe, MakeOptional, MapDataSourceLinkConfig, MapDataSourceLinkTable, MapDataSourceLinkTableForRegist, MapDefine, MapInfo, MapKind, MapPageInfoTable, MapPageInfoTableForRegist, MapPageOptions, Maybe, OdbaAPICallDefine, OdbaAPIFunc, OdbaConnection, OdbaGetImageUrlAPI, OdbaGetImageUrlParam, OdbaGetLinkableContentsAPI, OdbaGetLinkableContentsResult, OdbaGetUncachedDataAPI, OdbaGetUncachedDataParam, OdbaGetUncachedDataResult, OdbaInterface, OdbaLinkDataAPI, OdbaLinkDataParam, OdbaRegistDataAPI, OdbaRegistDataParam, OdbaRemoveDataAPI, OdbaRemoveDataParam, OdbaUnlinkDataAPI, OdbaUnlinkDataParam, OdbaUpdateDataAPI, OdbaUpdateDataParam, OriginalIconsTable, PopupMode, PublicRange, Scalars, SortCondition, UpdateContentLinkCacheParam, User, UserAuthData, callBroadcast, callOdbaApi, convertKmToLonLat, initializeOdba, initializeOriginalAuth, registAPIs, registFile, sleep };