@evergis/api
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -88,16 +88,7 @@ /** | ||
/** | ||
* Basic information about a service. | ||
* The {ServiceInfoDc} provides information about the service. | ||
*/ | ||
export declare type ServiceInfoDc = { | ||
/** Type of the service. */ | ||
/** The type of the resource. */ | ||
type?: string; | ||
/** Additional parameters for the given service. */ | ||
parameters?: { | ||
/** */ | ||
Category?: string[]; | ||
/** */ | ||
Preview?: string[]; | ||
/** */ | ||
GeometryType?: string[]; | ||
}; | ||
/** Resource name. */ | ||
@@ -115,6 +106,26 @@ name?: string; | ||
preview?: string; | ||
/** The date when resource was created. */ | ||
createdDate?: string; | ||
/** The date when resource was last modified. */ | ||
changedDate?: string; | ||
/** Resource permissions. */ | ||
permissions?: 'none' | 'read' | 'write' | 'configure' | 'read,write' | 'read,write,configure'; | ||
permissions?: 'none' | 'configure' | 'write' | 'read' | 'read,write' | 'read,write,configure'; | ||
}; | ||
/** | ||
* Access control list for a security object. | ||
*/ | ||
export declare type AccessControlListDc = { | ||
/** All available permissions list. */ | ||
acl?: RolePermissionDc[]; | ||
}; | ||
/** | ||
* Roles permission | ||
*/ | ||
export declare type RolePermissionDc = { | ||
/** Role name. */ | ||
role?: string; | ||
/** Acl set */ | ||
permissions?: 'none' | 'configure' | 'write' | 'read' | 'read,write' | 'read,write,configure'; | ||
}; | ||
/** | ||
* The {TableListDc} class provides list of tables info SPCore.Connectors.Connectors.Base.Models.Data.TableInfoDc. | ||
@@ -148,4 +159,8 @@ */ | ||
preview?: string; | ||
/** The date when resource was created. */ | ||
createdDate?: string; | ||
/** The date when resource was last modified. */ | ||
changedDate?: string; | ||
/** Resource permissions. */ | ||
permissions?: 'none' | 'read' | 'write' | 'configure' | 'read,write' | 'read,write,configure'; | ||
permissions?: 'none' | 'configure' | 'write' | 'read' | 'read,write' | 'read,write,configure'; | ||
}; | ||
@@ -159,6 +174,3 @@ /** | ||
/** Access control list. */ | ||
acl?: { | ||
/** */ | ||
[key: string]: 'none' | 'read' | 'write' | 'configure' | 'read,write' | 'read,write,configure'; | ||
}; | ||
acl?: AccessControlListDc; | ||
/** Resource name. */ | ||
@@ -176,4 +188,8 @@ name?: string; | ||
preview?: string; | ||
/** The date when resource was created. */ | ||
createdDate?: string; | ||
/** The date when resource was last modified. */ | ||
changedDate?: string; | ||
/** Resource permissions. */ | ||
permissions?: 'none' | 'read' | 'write' | 'configure' | 'read,write' | 'read,write,configure'; | ||
permissions?: 'none' | 'configure' | 'write' | 'read' | 'read,write' | 'read,write,configure'; | ||
}; | ||
@@ -332,7 +348,7 @@ /** | ||
/** */ | ||
permissions?: 'none' | 'read' | 'write' | 'configure' | 'read,write' | 'read,write,configure'; | ||
permissions?: 'none' | 'configure' | 'write' | 'read' | 'read,write' | 'read,write,configure'; | ||
/** */ | ||
acl?: { | ||
/** */ | ||
[key: string]: 'none' | 'read' | 'write' | 'configure' | 'read,write' | 'read,write,configure'; | ||
[key: string]: 'none' | 'configure' | 'write' | 'read' | 'read,write' | 'read,write,configure'; | ||
}; | ||
@@ -386,3 +402,3 @@ /** */ | ||
/** Name of the service. */ | ||
name?: string; | ||
name: string; | ||
/** Human friendly name of the service. */ | ||
@@ -398,5 +414,5 @@ alias?: string; | ||
/** The zero point of the coordinates from which tiles are counted. */ | ||
origin?: IVector; | ||
origin?: number[]; | ||
/** Bounding rectangle of the scheme. */ | ||
boundingRectangle?: Rectangle2; | ||
boundingRectangle?: number[]; | ||
/** If true, positive side of 'Y' coordinate, will be in the reverse side. */ | ||
@@ -420,15 +436,2 @@ reversedY?: boolean; | ||
*/ | ||
export declare type Rectangle2 = { | ||
/** */ | ||
width?: number; | ||
/** */ | ||
height?: number; | ||
/** */ | ||
center?: IVector; | ||
/** */ | ||
halfSize?: IVector; | ||
}; | ||
/** | ||
* undefined | ||
*/ | ||
export declare type LodInfo = { | ||
@@ -453,3 +456,3 @@ /** */ | ||
/** Name of the service. */ | ||
name?: string; | ||
name: string; | ||
/** Human friendly name of the service. */ | ||
@@ -579,11 +582,9 @@ alias?: string; | ||
/** | ||
* undefined | ||
* Base class for client notifications. | ||
*/ | ||
export declare type IClientNotification = { | ||
/** */ | ||
export declare type ClientNotificationDc = { | ||
/** Tag of the notification. The notification tags are used for subscribing for certain types of notifications. */ | ||
tag?: string; | ||
/** */ | ||
/** Date when the notification was created by the server. */ | ||
date?: string; | ||
/** */ | ||
data?: any /** Unknown props */; | ||
}; | ||
@@ -619,4 +620,8 @@ /** | ||
preview?: string; | ||
/** The date when resource was created. */ | ||
createdDate?: string; | ||
/** The date when resource was last modified. */ | ||
changedDate?: string; | ||
/** Resource permissions. */ | ||
permissions?: 'none' | 'read' | 'write' | 'configure' | 'read,write' | 'read,write,configure'; | ||
permissions?: 'none' | 'configure' | 'write' | 'read' | 'read,write' | 'read,write,configure'; | ||
}; | ||
@@ -630,6 +635,3 @@ /** | ||
/** Access control list. */ | ||
acl?: { | ||
/** */ | ||
[key: string]: 'none' | 'read' | 'write' | 'configure' | 'read,write' | 'read,write,configure'; | ||
}; | ||
acl?: AccessControlListDc; | ||
/** Resource name. */ | ||
@@ -647,4 +649,8 @@ name?: string; | ||
preview?: string; | ||
/** The date when resource was created. */ | ||
createdDate?: string; | ||
/** The date when resource was last modified. */ | ||
changedDate?: string; | ||
/** Resource permissions. */ | ||
permissions?: 'none' | 'read' | 'write' | 'configure' | 'read,write' | 'read,write,configure'; | ||
permissions?: 'none' | 'configure' | 'write' | 'read' | 'read,write' | 'read,write,configure'; | ||
}; | ||
@@ -684,68 +690,4 @@ /** | ||
/** | ||
* undefined | ||
* Information necessary for adds/removes resources to/from catalog. | ||
*/ | ||
export declare type ImageContent = { | ||
/** */ | ||
imageData?: Stream; | ||
/** */ | ||
format?: 'Jpeg' | 'Png' | 'Png8' | 'Png24' | 'Png32'; | ||
}; | ||
/** | ||
* undefined | ||
*/ | ||
export declare type Stream = { | ||
/** */ | ||
canRead?: boolean; | ||
/** */ | ||
canSeek?: boolean; | ||
/** */ | ||
canTimeout?: boolean; | ||
/** */ | ||
canWrite?: boolean; | ||
/** */ | ||
length?: number; | ||
/** */ | ||
position?: number; | ||
/** */ | ||
readTimeout?: number; | ||
/** */ | ||
writeTimeout?: number; | ||
}; | ||
/** | ||
* A list of the catalog resources. | ||
*/ | ||
export declare type CatalogList = { | ||
/** The items of the response. */ | ||
items?: CatalogResourceInfoDc[]; | ||
/** */ | ||
totalCount?: number; | ||
/** */ | ||
offset?: number; | ||
/** */ | ||
limit?: number; | ||
}; | ||
/** | ||
* A catalog resource configuration data contract. | ||
*/ | ||
export declare type CatalogResourceInfoDc = { | ||
/** Resource type. */ | ||
type?: string; | ||
/** Resource name. */ | ||
name?: string; | ||
/** Name of the resource including its namespaces (names of the service managers that contain this service). */ | ||
fullName?: string; | ||
/** Resource alias. */ | ||
alias?: string; | ||
/** Resource owner. */ | ||
owner?: string; | ||
/** Resource description. */ | ||
description?: string; | ||
/** Resource preview. */ | ||
preview?: string; | ||
/** Resource permissions. */ | ||
permissions?: 'none' | 'read' | 'write' | 'configure' | 'read,write' | 'read,write,configure'; | ||
}; | ||
/** | ||
* Information necessary fo adds/removes resources to/from catalog. | ||
*/ | ||
export declare type CatalogDataDc = { | ||
@@ -755,3 +697,3 @@ /** The resource name. */ | ||
/** The user name. */ | ||
userName?: string; | ||
userNames?: string[]; | ||
}; | ||
@@ -906,2 +848,39 @@ /** | ||
/** | ||
* Print operation print map and map elements to png files. | ||
*/ | ||
export declare type PrintTaskParametersDc = { | ||
/** */ | ||
taskType?: string; | ||
/** The temp storage that is to be used as a target for writing the task results. */ | ||
targetStorageDescription?: SessionStaticTaskDataStorageDescription; | ||
/** Input template models for printing. */ | ||
templates?: TemplateModelDc[]; | ||
}; | ||
/** | ||
* undefined | ||
*/ | ||
export declare type SessionStaticTaskDataStorageDescription = { | ||
/** */ | ||
folderName?: string; | ||
}; | ||
/** | ||
* Base template model data contract. | ||
*/ | ||
export declare type TemplateModelDc = { | ||
/** The name of the result file. */ | ||
fileName?: string; | ||
/** File Format. */ | ||
fileFormat?: string; | ||
/** Gets or sets template name. */ | ||
templateName?: string; | ||
/** Gets or sets paper width. */ | ||
paperWidth?: number; | ||
/** Gets or sets paper height. */ | ||
paperHeight?: number; | ||
/** Gets or sets dpi. */ | ||
dpi?: number; | ||
/** Gets or sets paper margin. */ | ||
margin?: number[]; | ||
}; | ||
/** | ||
* Availability area builder operation considers the nearest availability zones around the input geometries and writes them | ||
@@ -1046,1 +1025,126 @@ into the target storage. | ||
}; | ||
/** | ||
* The result of uploading a file. | ||
*/ | ||
export declare type FileUploadResponse = { | ||
/** Id of the tile in the session static storage. */ | ||
fileId?: string; | ||
}; | ||
/** | ||
* undefined | ||
*/ | ||
export declare type ImageContent = { | ||
/** */ | ||
imageData?: Stream; | ||
/** */ | ||
format?: 'Jpeg' | 'Png' | 'Png8' | 'Png24' | 'Png32'; | ||
}; | ||
/** | ||
* undefined | ||
*/ | ||
export declare type Stream = { | ||
/** */ | ||
canRead?: boolean; | ||
/** */ | ||
canSeek?: boolean; | ||
/** */ | ||
canTimeout?: boolean; | ||
/** */ | ||
canWrite?: boolean; | ||
/** */ | ||
length?: number; | ||
/** */ | ||
position?: number; | ||
/** */ | ||
readTimeout?: number; | ||
/** */ | ||
writeTimeout?: number; | ||
}; | ||
/** | ||
* Base data contract for client notifications. | ||
*/ | ||
export declare type ClientNotificationDcTData = {}; | ||
/** | ||
* undefined | ||
*/ | ||
export declare type TData = {}; | ||
/** | ||
* Notification when a feature layer was modified. | ||
*/ | ||
export declare type LayerUpdatedNotificationDc = {}; | ||
/** | ||
* Detailed information about the modification made in a feature layer. | ||
*/ | ||
export declare type LayerUpdatedInfoDc = { | ||
/** Name of the layer that was changed. */ | ||
layerName?: string; | ||
/** Bounding box of changed zone. */ | ||
boundingBox?: IEnvelopeGeometry; | ||
/** Array of created ids. */ | ||
createdIds?: ObjectId[]; | ||
/** Array of updated ids. */ | ||
updatedIds?: ObjectId[]; | ||
/** Array of deleted ids. */ | ||
deletedIds?: ObjectId[]; | ||
}; | ||
/** | ||
* The status of the server task is changed. | ||
*/ | ||
export declare type TaskStatusChangeNotificationDc = {}; | ||
/** | ||
* Information about the updated task status. | ||
*/ | ||
export declare type TaskStatusChangedInfo = { | ||
/** Id of the task. */ | ||
taskId?: string; | ||
/** New status of the task. */ | ||
status?: string; | ||
/** Description of the status change. */ | ||
message?: string; | ||
}; | ||
/** | ||
* Service info for a tile service. | ||
*/ | ||
export declare type RemoteTileServiceInfoDc = {}; | ||
/** | ||
* Service info for a tile service. | ||
*/ | ||
export declare type TileServiceInfoDc = {}; | ||
/** | ||
* Service info for a feature layer service. | ||
*/ | ||
export declare type FeatureLayerServiceInfoDc = {}; | ||
/** | ||
* Common fields for service configurations. | ||
*/ | ||
export declare type ServiceConfigurationBaseDc = { | ||
/** Name of the service. */ | ||
name?: string; | ||
/** Human friendly name of the service. */ | ||
alias?: string; | ||
/** Description of the service. */ | ||
description?: string; | ||
}; | ||
/** | ||
* Information about composite service. | ||
*/ | ||
export declare type CompositeServiceInfoDc = {}; | ||
/** | ||
* Information about composite service layer. | ||
*/ | ||
export declare type CompositeLayerInfoDc = { | ||
/** Gets or sets composite layer info. */ | ||
layer?: ServiceInfoDc; | ||
/** Gets layer visibility. */ | ||
isVisible?: boolean; | ||
/** Gets layer opacity. */ | ||
opacity?: number; | ||
/** Gets minimum scale resolution. */ | ||
minResolution?: number; | ||
/** Gets maximum scale resolution. */ | ||
maxResolution?: number; | ||
/** Gets layer state. */ | ||
isValid?: boolean; | ||
/** Gets layer initialization error. */ | ||
error?: any /** Unknown props */; | ||
}; |
@@ -15,5 +15,5 @@ import { ResponsePromise } from 'ky'; | ||
export declare class HttpClient implements IHttpClient { | ||
private prefixUrl; | ||
private prefixUrl?; | ||
private ky; | ||
constructor(prefixUrl?: string); | ||
constructor(prefixUrl?: string | undefined); | ||
get(url: string, params?: SearchParams): ResponsePromise; | ||
@@ -20,0 +20,0 @@ post(url: string, body?: AllowedBody, params?: SearchParams): ResponsePromise; |
@@ -5,3 +5,3 @@ import ky from 'ky'; | ||
export class HttpClient { | ||
constructor(prefixUrl = '/') { | ||
constructor(prefixUrl) { | ||
this.prefixUrl = prefixUrl; | ||
@@ -8,0 +8,0 @@ this.ky = ky.extend({ prefixUrl }); |
@@ -21,2 +21,3 @@ import { Service } from './Service'; | ||
getById({ name, id }: GetByIdParams): Promise<FeatureDc>; | ||
getTilesLayerImage({ name, x, y, z }: GetTilesLayerImageParams): string; | ||
getLayerImage({ name, extent, size, extentSr, condition, }: GetLayerImageParams): string; | ||
@@ -77,2 +78,12 @@ getLayerExtent({ name, filterCondition, sr }: GetLayerExtentParams): Promise<EnvelopeDc>; | ||
}; | ||
export declare type GetTilesLayerImageParams = { | ||
/** Full name of the layer. */ | ||
name: string; | ||
/** X */ | ||
x: number; | ||
/** Y */ | ||
y: number; | ||
/** Z */ | ||
z: number; | ||
}; | ||
export declare type GetLayerImageParams = { | ||
@@ -79,0 +90,0 @@ /** Full name of the layer. */ |
@@ -88,4 +88,7 @@ /* | ||
} | ||
getTilesLayerImage({ name, x, y, z }) { | ||
return this.http.createUrl(`layers/${name}/tile/${z}/${x}/${y}`); | ||
} | ||
getLayerImage({ name, extent, size, extentSr, condition, }) { | ||
return this.http.createUrl(`layers/${name}/features/export`, { | ||
return this.http.createUrl(`layers/${name}/export`, { | ||
extent, | ||
@@ -99,3 +102,3 @@ size, | ||
return this.http | ||
.get(`layers/${name}/features/extent`, { filterCondition, sr }) | ||
.get(`layers/${name}/extent`, { filterCondition, sr }) | ||
.json(); | ||
@@ -102,0 +105,0 @@ } |
import { ServiceBase } from './ServiceBase'; | ||
import { IClientNotification } from './data-contracts'; | ||
import { ClientNotificationDc } from './data-contracts'; | ||
export declare class NotificationService extends ServiceBase { | ||
@@ -7,3 +7,3 @@ getSubscriptionList(): Promise<string[]>; | ||
unsubscribeOperation(tag?: string): Promise<void>; | ||
getNotifications(): Promise<IClientNotification[]>; | ||
getNotifications(): Promise<ClientNotificationDc[]>; | ||
} |
import { ServiceBase } from './ServiceBase'; | ||
import { CatalogList, CatalogDataDc } from './data-contracts'; | ||
import { ProjectsListDc, TableListDc, ServiceListDc, CatalogDataDc } from './data-contracts'; | ||
export declare class ResourceCatalog extends ServiceBase { | ||
getResourceList({ resourceType, query, types, offset, limit, orderByFields, }: GetResourceListParams): Promise<CatalogList>; | ||
getProjects({ query, offset, limit, orderByFields }: GetProjectsParams): Promise<ProjectsListDc>; | ||
getTables({ query, offset, limit, orderByFields }: GetTablesParams): Promise<TableListDc>; | ||
getLayers({ query, types, offset, limit, orderByFields }: GetLayersParams): Promise<ServiceListDc>; | ||
getResource({ resourceType, name }: GetResourceParams): Promise<void>; | ||
addResource({ resourceType, catalogData }: AddResourceParams): Promise<CatalogDataDc>; | ||
removeResource({ resourceType, resourceNames, userName, }: RemoveResourceParams): Promise<void>; | ||
removeResourcePost({ resourceType, catalogData }: RemoveResourcePostParams): Promise<void>; | ||
removeResource({ resourceType, resource, users }: RemoveResourceParams): Promise<void>; | ||
} | ||
export declare type GetResourceListParams = { | ||
/** Catalog resource type SPCore.Kernel.Tools.ResourceType */ | ||
resourceType: 'tables' | 'services' | 'projects'; | ||
export declare type GetProjectsParams = { | ||
/** Full text search filter that allow to query in alias and name fields. | ||
@@ -17,2 +17,28 @@ Additional, query string may contains special symbols for filter (by default search by full match) | ||
query?: string; | ||
/** Objects limit per response. */ | ||
offset?: number; | ||
/** Objects count have to skip. */ | ||
limit?: number; | ||
/** A list of {ResourceInfoDc} fields for sorting. If a field starts with {-} ordering is by descending. */ | ||
orderByFields?: string[]; | ||
}; | ||
export declare type GetTablesParams = { | ||
/** Full text search filter that allow to query in alias and name fields. | ||
Additional, query string may contains special symbols for filter (by default search by full match) | ||
1. '^' - search any value that begins with query. | ||
2. '@' - search any value that contains query. */ | ||
query?: string; | ||
/** Objects limit per response. */ | ||
offset?: number; | ||
/** Objects count have to skip. */ | ||
limit?: number; | ||
/** A list of {ResourceInfoDc} fields for sorting. If a field starts with {-} ordering is by descending. */ | ||
orderByFields?: string[]; | ||
}; | ||
export declare type GetLayersParams = { | ||
/** Full text search filter that allow to query in alias and name fields. | ||
Additional, query string may contains special symbols for filter (by default search by full match) | ||
1. '^' - search any value that begins with query. | ||
2. '@' - search any value that contains query. */ | ||
query?: string; | ||
/** Filter by services types in comma separated way. */ | ||
@@ -24,24 +50,24 @@ types?: string[]; | ||
limit?: number; | ||
/** A list of {CatalogResourceInfoDc} fields for sorting. If a field starts with {-} ordering is by descending. */ | ||
/** A list of {ResourceInfoDc} fields for sorting. If a field starts with {-} ordering is by descending. */ | ||
orderByFields?: string[]; | ||
}; | ||
export declare type GetResourceParams = { | ||
/** Resource type.SPCore.Kernel.Tools.ResourceType */ | ||
resourceType: 'tables' | 'layers' | 'projects'; | ||
/** Name of the resource. */ | ||
name: string; | ||
}; | ||
export declare type AddResourceParams = { | ||
/** Catalog resource type SPCore.Kernel.Tools.ResourceType. */ | ||
resourceType: 'tables' | 'services' | 'projects'; | ||
resourceType: 'tables' | 'layers' | 'projects'; | ||
/** Catalog data information SPCore.Connectors.Connectors.Base.Models.ResourceCatalog.CatalogDataDc. */ | ||
catalogData?: CatalogDataDc[]; | ||
catalogData?: CatalogDataDc; | ||
}; | ||
export declare type RemoveResourceParams = { | ||
/** Catalog resource type SPCore.Kernel.Tools.ResourceType. */ | ||
resourceType: 'tables' | 'services' | 'projects'; | ||
/** A collection of resources. */ | ||
resourceNames?: string[]; | ||
/** The user name. */ | ||
userName?: string; | ||
resourceType: 'tables' | 'layers' | 'projects'; | ||
/** Full name of the resource. */ | ||
resource?: string; | ||
/** A list of users. */ | ||
users?: string[]; | ||
}; | ||
export declare type RemoveResourcePostParams = { | ||
/** Catalog resource type SPCore.Kernel.Tools.ResourceType. */ | ||
resourceType: 'tables' | 'services' | 'projects'; | ||
/** Catalog data information SPCore.Connectors.Connectors.Base.Models.ResourceCatalog.CatalogDataDc */ | ||
catalogData?: CatalogDataDc[]; | ||
}; |
@@ -9,5 +9,15 @@ /* | ||
export class ResourceCatalog extends ServiceBase { | ||
getResourceList({ resourceType, query, types, offset, limit, orderByFields, }) { | ||
getProjects({ query, offset, limit, orderByFields }) { | ||
return this.http | ||
.get(`${this.name}/${resourceType}`, { | ||
.get(`${this.name}/projects`, { query, offset, limit, orderByFields }) | ||
.json(); | ||
} | ||
getTables({ query, offset, limit, orderByFields }) { | ||
return this.http | ||
.get(`${this.name}/tables`, { query, offset, limit, orderByFields }) | ||
.json(); | ||
} | ||
getLayers({ query, types, offset, limit, orderByFields }) { | ||
return this.http | ||
.get(`${this.name}/layers`, { | ||
query, | ||
@@ -21,2 +31,5 @@ types, | ||
} | ||
getResource({ resourceType, name }) { | ||
return this.http.get(`${this.name}/${resourceType}/${name}`).then(() => { }); | ||
} | ||
addResource({ resourceType, catalogData }) { | ||
@@ -27,13 +40,8 @@ return this.http | ||
} | ||
removeResource({ resourceType, resourceNames, userName, }) { | ||
removeResource({ resourceType, resource, users }) { | ||
return this.http | ||
.delete(`${this.name}/${resourceType}`, { resourceNames, userName }) | ||
.delete(`${this.name}/${resourceType}`, { resource, users }) | ||
.then(() => { }); | ||
} | ||
removeResourcePost({ resourceType, catalogData }) { | ||
return this.http | ||
.post(`${this.name}/${resourceType}/remove`, catalogData) | ||
.then(() => { }); | ||
} | ||
} | ||
//# sourceMappingURL=ResourceCatalog.js.map |
import { ServiceBase } from './ServiceBase'; | ||
import { TaskStatusDataDc, TaskInfoDc, TaskProgressDc, CopyTaskParametersDc, BufferTaskParametersDc, AvailabilityAreaTaskDc, UnionTaskParametersDc, SubtractionTaskParametersDc, FilterCopyTaskParametersDc, PipelineTaskParametersDc } from './data-contracts'; | ||
import { TaskStatusDataDc, TaskInfoDc, TaskProgressDc, CopyTaskParametersDc, BufferTaskParametersDc, PrintTaskParametersDc, AvailabilityAreaTaskDc, UnionTaskParametersDc, SubtractionTaskParametersDc, FilterCopyTaskParametersDc, PipelineTaskParametersDc } from './data-contracts'; | ||
export declare class SchedulerService extends ServiceBase { | ||
@@ -9,2 +9,3 @@ getTaskList({ owners, statuses, offset, limit }: GetTaskListParams): Promise<TaskStatusDataDc[]>; | ||
startBufferTask(parameters?: BufferTaskParametersDc): Promise<TaskStatusDataDc>; | ||
startPrintTask(parameters?: PrintTaskParametersDc): Promise<TaskStatusDataDc>; | ||
startRouteTask(parameters?: AvailabilityAreaTaskDc): Promise<TaskStatusDataDc>; | ||
@@ -11,0 +12,0 @@ startUnionTask(parameters?: UnionTaskParametersDc): Promise<TaskStatusDataDc>; |
@@ -32,2 +32,7 @@ /* | ||
} | ||
startPrintTask(parameters) { | ||
return this.http | ||
.post(`${this.name}/tasks`, parameters, { type: 'print' }) | ||
.json(); | ||
} | ||
startRouteTask(parameters) { | ||
@@ -34,0 +39,0 @@ return this.http |
import { Service } from './Service'; | ||
import { ServiceInfoDc } from './data-contracts'; | ||
import { ServiceInfoDc, AccessControlListDc } from './data-contracts'; | ||
export declare class ServiceBase extends Service { | ||
getServiceInfo(): Promise<ServiceInfoDc>; | ||
deleteService(): Promise<void>; | ||
getPermissions(): Promise<{ | ||
[key: string]: "none" | "read" | "write" | "configure" | "read,write" | "read,write,configure"; | ||
}>; | ||
setPermissions(acl?: any /** Unknown props */): Promise<{ | ||
[key: string]: "none" | "read" | "write" | "configure" | "read,write" | "read,write,configure"; | ||
}>; | ||
addPermissions(acl?: any /** Unknown props */): Promise<{ | ||
[key: string]: "none" | "read" | "write" | "configure" | "read,write" | "read,write,configure"; | ||
}>; | ||
removePermissions(acl?: any /** Unknown props */): Promise<{ | ||
[key: string]: "none" | "read" | "write" | "configure" | "read,write" | "read,write,configure"; | ||
}>; | ||
getPermissions(): Promise<AccessControlListDc>; | ||
setPermissions(Acl?: any[]): Promise<AccessControlListDc>; | ||
addPermissions(acl?: any /** Unknown props */): Promise<AccessControlListDc>; | ||
removePermissions(Acl?: any[]): Promise<AccessControlListDc>; | ||
getPreview(resourceName?: string): string; | ||
setPreview(file: FormData): Promise<void>; | ||
} |
@@ -16,13 +16,19 @@ /* | ||
getPermissions() { | ||
return this.http.get(`${this.name}/permissions`).json(); | ||
return this.http | ||
.get(`${this.name}/permissions`) | ||
.json(); | ||
} | ||
setPermissions(acl /** Unknown props */) { | ||
return this.http.post(`${this.name}/permissions`, null, { acl }).json(); | ||
setPermissions(Acl) { | ||
return this.http | ||
.post(`${this.name}/permissions`, null, { Acl }) | ||
.json(); | ||
} | ||
addPermissions(acl /** Unknown props */) { | ||
return this.http.post(`${this.name}/permissions/add`, null, { acl }).json(); | ||
return this.http | ||
.post(`${this.name}/permissions/add`, null, { acl }) | ||
.json(); | ||
} | ||
removePermissions(acl /** Unknown props */) { | ||
removePermissions(Acl) { | ||
return this.http | ||
.post(`${this.name}/permissions/remove`, null, { acl }) | ||
.post(`${this.name}/permissions/remove`, null, { Acl }) | ||
.json(); | ||
@@ -29,0 +35,0 @@ } |
import { ServiceBase } from './ServiceBase'; | ||
import { FileUploadResponse } from './data-contracts'; | ||
export declare class StaticContentService extends ServiceBase { | ||
downloadFile(fileName?: string): Promise<void>; | ||
uploadFile(file: FormData): Promise<{ | ||
fileId: string; | ||
}>; | ||
uploadFile(file: FormData): Promise<FileUploadResponse>; | ||
} |
@@ -5,2 +5,3 @@ import { HttpClient } from './__generated__/HttpClient'; | ||
import { AuthorizationData } from './__generated__/data-contracts'; | ||
import { Resources } from './services/Resources'; | ||
export declare type ApiParams = { | ||
@@ -14,2 +15,3 @@ url: string; | ||
private readonly wsUrl; | ||
readonly url: string; | ||
readonly layers: Layers; | ||
@@ -23,4 +25,5 @@ readonly tables: Tables; | ||
readonly import: Import; | ||
readonly resources: Resources; | ||
constructor({ url, wsUrl, config }: ApiParams); | ||
init(params: AuthorizationData): Promise<void>; | ||
} |
import { HttpClient } from './__generated__/HttpClient'; | ||
import { defaultApiConfig } from './defaultApiConfig'; | ||
import { Security, FileUpload, Import, Scheduler, Notification, Layers, Tables, Projects, } from './services'; | ||
import { Resources } from './services/Resources'; | ||
export class Api { | ||
constructor({ url, wsUrl, config = defaultApiConfig }) { | ||
this.http = new HttpClient(url); | ||
this.url = url; | ||
this.wsUrl = wsUrl || url; | ||
@@ -11,2 +13,3 @@ this.layers = new Layers(config.Layers, this.http); | ||
this.projects = new Projects(config.Projects, this.http); | ||
this.resources = new Resources(this.projects, this.layers); | ||
this.security = new Security(config.PostgresSecurityService, this.http); | ||
@@ -13,0 +16,0 @@ this.notification = new Notification(config.NotificationService, this.http); |
export { Api } from './Api'; | ||
export { SpatialProcessor } from './SpatialProcessor'; | ||
export { Notification, Security, FileUpload, Import, Scheduler, Layers, Projects, Tables, } from './services'; | ||
export { Tile, TileLayer, ViewLayer, SpDynamicLayer } from './layers'; | ||
export { EvergisTileLayer, EvergisDynamicLayer } from './layers'; | ||
export { HTTPError, TimeoutError, HttpClient, } from './__generated__/HttpClient'; | ||
export { DetailedTableInfoDc } from './__generated__/data-contracts'; |
export { Api } from './Api'; | ||
export { SpatialProcessor } from './SpatialProcessor'; | ||
export { Notification, Security, FileUpload, Import, Scheduler, Layers, Projects, Tables, } from './services'; | ||
export { Tile, TileLayer, ViewLayer, SpDynamicLayer } from './layers'; | ||
export { EvergisTileLayer, EvergisDynamicLayer } from './layers'; | ||
export { HTTPError, TimeoutError, HttpClient, } from './__generated__/HttpClient'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,3 +0,3 @@ | ||
export { Tile, TileLayer } from './Tile'; | ||
export { ViewLayer, SpDynamicLayer } from './ViewLayer'; | ||
export { EvergisTileLayer } from './EvergisTileLayer'; | ||
export { EvergisDynamicLayer } from './EvergisDynamicLayer'; | ||
export { LayersManager } from './LayersManager'; |
@@ -1,4 +0,4 @@ | ||
export { Tile, TileLayer } from './Tile'; | ||
export { ViewLayer, SpDynamicLayer } from './ViewLayer'; | ||
export { EvergisTileLayer } from './EvergisTileLayer'; | ||
export { EvergisDynamicLayer } from './EvergisDynamicLayer'; | ||
export { LayersManager } from './LayersManager'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,1 @@ | ||
import { Tile, ViewLayer } from './index'; | ||
import { Layers } from '../services'; | ||
@@ -8,4 +7,4 @@ import { IHttpClient } from '../__generated__/HttpClient'; | ||
constructor(layers: Layers, http: IHttpClient); | ||
getLayerService(name: string): Promise<Tile | ViewLayer | undefined>; | ||
getLayerService(name: string): Promise<any>; | ||
private getLayerInfo; | ||
} |
@@ -1,7 +0,7 @@ | ||
import { Tile, ViewLayer } from './index'; | ||
import { EvergisTileLayer, EvergisDynamicLayer } from './index'; | ||
const LayerServicesMap = { | ||
RemoteTileService: Tile, | ||
LocalTileService: Tile, | ||
PostgresLayerService: ViewLayer, | ||
StyledFeatureLayer: ViewLayer, | ||
RemoteTileService: EvergisTileLayer, | ||
LocalTileService: EvergisTileLayer, | ||
PostgresLayerService: EvergisDynamicLayer, | ||
StyledFeatureLayer: EvergisDynamicLayer, | ||
CompositeService: null, | ||
@@ -27,2 +27,3 @@ }; | ||
if (ServiceCtor) { | ||
// @ts-ignore | ||
return new ServiceCtor(withServicesPrefix(layerInfo), this.http); | ||
@@ -29,0 +30,0 @@ } |
@@ -1,8 +0,7 @@ | ||
import { TileService } from '../__generated__/TileService'; | ||
import { TileLayer } from '@evergis/sgis/es/layers/TileLayer'; | ||
import { Layer } from '@evergis/sgis/es/layers/Layer'; | ||
export { TileLayer }; | ||
export declare class Tile extends TileService { | ||
getTileUrl: (x: number, y: number, z: number) => string; | ||
layer: Layer; | ||
import { Api } from '../Api'; | ||
import { RemoteTileServiceConfigurationDc } from '../__generated__/data-contracts'; | ||
export declare class EvergisTileLayer extends TileLayer { | ||
name: string; | ||
constructor(configuration: RemoteTileServiceConfigurationDc, api: Api); | ||
} |
@@ -1,11 +0,14 @@ | ||
import { TileService } from '../__generated__/TileService'; | ||
import { TileLayer } from '@evergis/sgis/es/layers/TileLayer'; | ||
export { TileLayer }; | ||
export class Tile extends TileService { | ||
constructor() { | ||
super(...arguments); | ||
this.getTileUrl = (x, y, z) => this.getTile({ x, y, z }); | ||
this.layer = new TileLayer(this.getTileUrl); | ||
export class EvergisTileLayer extends TileLayer { | ||
constructor(configuration, api) { | ||
const getUrlMask = (x, y, z) => api.layers.getTilesLayerImage({ | ||
x, | ||
y, | ||
z, | ||
name: configuration.name, | ||
}); | ||
super(getUrlMask); | ||
this.name = configuration.name; | ||
} | ||
} | ||
//# sourceMappingURL=Tile.js.map |
@@ -1,23 +0,10 @@ | ||
import { Layer } from '@evergis/sgis/es/layers/Layer'; | ||
import { DynamicLayer } from '@evergis/sgis/es/layers/DynamicLayer'; | ||
import { Bbox } from '@evergis/sgis/es/Bbox'; | ||
import { FeatureLayer } from '../__generated__/FeatureLayer'; | ||
import { IHttpClient } from '../__generated__/HttpClient'; | ||
import { ServiceInfoDc } from '../__generated__/data-contracts'; | ||
import { EnvelopeDc } from '../__generated__/data-contracts'; | ||
export declare type GetImage = (bbox: Bbox, resolution: number) => string; | ||
export declare class SpDynamicLayer extends DynamicLayer { | ||
serviceName?: string | undefined; | ||
getImage?: GetImage; | ||
constructor(serviceName?: string, getImage?: GetImage); | ||
getUrl(bbox: Bbox, resolution: number): string | undefined; | ||
import { PostgresLayerServiceConfigurationDc } from '../__generated__/data-contracts'; | ||
import { Api } from '../Api'; | ||
export declare class EvergisDynamicLayer extends DynamicLayer { | ||
private api; | ||
name: string; | ||
constructor(configuration: PostgresLayerServiceConfigurationDc, api: Api); | ||
getUrl(bbox: Bbox, resolution: number): string; | ||
} | ||
export declare class ViewLayer extends FeatureLayer { | ||
protected info: ServiceInfoDc; | ||
protected http: IHttpClient; | ||
serviceName?: string; | ||
layer: Layer; | ||
constructor(info: ServiceInfoDc, http: IHttpClient); | ||
getExtent(filterCondition: string, sr: number): Promise<EnvelopeDc>; | ||
getImage: (bbox: Bbox, resolution: number) => string; | ||
} |
import { DynamicLayer } from '@evergis/sgis/es/layers/DynamicLayer'; | ||
import { FeatureLayer } from '../__generated__/FeatureLayer'; | ||
export class SpDynamicLayer extends DynamicLayer { | ||
constructor(serviceName, getImage) { | ||
export class EvergisDynamicLayer extends DynamicLayer { | ||
constructor(configuration, api) { | ||
super(); | ||
this.serviceName = serviceName; | ||
this.getImage = getImage; | ||
this.api = api; | ||
this.name = configuration.name; | ||
} | ||
getUrl(bbox, resolution) { | ||
return this.getImage && this.getImage(bbox, resolution); | ||
let imgWidth = Math.round((bbox.xMax - bbox.xMin) / resolution); | ||
let imgHeight = Math.round((bbox.yMax - bbox.yMin) / resolution); | ||
return this.api.layers.getLayerImage({ | ||
name: this.name, | ||
extent: bbox.coordinates, | ||
size: [imgWidth, imgHeight], | ||
extentSr: bbox.crs.wkid, | ||
}); | ||
} | ||
} | ||
export class ViewLayer extends FeatureLayer { | ||
constructor(info, http) { | ||
super(info, http); | ||
this.info = info; | ||
this.http = http; | ||
this.getImage = (bbox, resolution) => { | ||
let imgWidth = Math.round((bbox.xMax - bbox.xMin) / resolution); | ||
let imgHeight = Math.round((bbox.yMax - bbox.yMin) / resolution); | ||
return this.getLayerImage({ | ||
extent: bbox.coordinates, | ||
size: [imgWidth, imgHeight], | ||
extentSr: bbox.crs.wkid, | ||
}); | ||
}; | ||
this.serviceName = info.name; | ||
this.http = http; | ||
this.layer = new SpDynamicLayer(this.serviceName, this.getImage); | ||
} | ||
getExtent(filterCondition, sr) { | ||
return this.getLayerExtent({ filterCondition, sr }); | ||
} | ||
} | ||
//# sourceMappingURL=ViewLayer.js.map |
import { StaticContentService } from '../__generated__/StaticContentService'; | ||
export declare class FileUpload extends StaticContentService { | ||
upload(file: File): Promise<{ | ||
fileId: string; | ||
}>; | ||
upload(file: File): Promise<import("../__generated__/data-contracts").FileUploadResponse>; | ||
} |
@@ -1,15 +0,23 @@ | ||
import { PostgresLayerServiceConfigurationDc, ServiceListDc, StyledLayerServiceConfigurationDc } from '../__generated__/data-contracts'; | ||
import { PostgresLayerServiceConfigurationDc, RemoteTileServiceConfigurationDc, ServiceListDc, StyledLayerServiceConfigurationDc, ServiceInfoDc } from '../__generated__/data-contracts'; | ||
import { Layers as LayersService, GetLayersListParams } from '../__generated__/Layers'; | ||
export declare class Layers extends LayersService { | ||
getLayers(params: GetListParams): Promise<ServiceListDc>; | ||
getLayerInfos(layers: string[]): Promise<ServiceInfoDc[]>; | ||
getBasemaps(params: GetListParams): Promise<ServiceListDc>; | ||
createLayer(configuration: PostgresLayerServiceConfigurationDc): Promise<import("../__generated__/data-contracts").ServiceInfoDc>; | ||
createSubLayer(configuration: StyledLayerServiceConfigurationDc): Promise<import("../__generated__/data-contracts").ServiceInfoDc>; | ||
createTileLayer({ remote, ...configuration }: CreateTileLayerParams): Promise<import("../__generated__/data-contracts").ServiceInfoDc>; | ||
createLayer(configuration: PostgresLayerServiceConfigurationDc): Promise<ServiceInfoDc>; | ||
createSubLayer(configuration: StyledLayerServiceConfigurationDc): Promise<ServiceInfoDc>; | ||
createTileLayer({ remote, ...configuration }: CreateTileLayerParams): Promise<ServiceInfoDc>; | ||
updateLayer(name: string, configuration: PostgresLayerServiceConfigurationDc): Promise<void>; | ||
} | ||
export declare function isTileLayerService(layer: ServiceInfoDc): boolean | "" | undefined; | ||
declare type GetListParams = Omit<GetLayersListParams, 'types'>; | ||
declare type CreateTileLayerParams = { | ||
remote?: boolean; | ||
} & RemoteTileServiceConfigurationDc; | ||
export declare type LayersWithDeps = { | ||
layers: ServiceInfoDc[]; | ||
deps: { | ||
tables: string[]; | ||
}; | ||
}; | ||
export {}; |
import { Layers as LayersService, } from '../__generated__/Layers'; | ||
import { promiseAllIgnoreErrors } from '../utils/promiseAllIgnoreErrors'; | ||
export class Layers extends LayersService { | ||
@@ -9,2 +10,5 @@ getLayers(params) { | ||
} | ||
getLayerInfos(layers) { | ||
return promiseAllIgnoreErrors(layers.map(layer => this.getLayerInfo(layer))); | ||
} | ||
getBasemaps(params) { | ||
@@ -32,2 +36,5 @@ return this.getLayersList({ | ||
} | ||
export function isTileLayerService(layer) { | ||
return layer.type && /TileService/.test(layer.type); | ||
} | ||
//# sourceMappingURL=Layers.js.map |
import { Projects as ProjectsService } from '../__generated__/Projects'; | ||
import { ExtendedProjectInfoDc, ProjectContentItemDc, ProjectInfoDc } from '../__generated__/data-contracts'; | ||
export declare class Projects extends ProjectsService { | ||
getProjectInfos(projects: string[]): Promise<ExtendedProjectInfoDc[]>; | ||
} | ||
export declare function isProjectContentItems(v: ProjectContentItemDc[] | undefined | null): v is ProjectContentItemDc[]; | ||
export declare type ProjectsWithDeps = { | ||
projects: ProjectInfoDc[]; | ||
deps: { | ||
layers: string[]; | ||
tables: string[]; | ||
}; | ||
}; |
import { Projects as ProjectsService } from '../__generated__/Projects'; | ||
import { promiseAllIgnoreErrors } from '../utils/promiseAllIgnoreErrors'; | ||
export class Projects extends ProjectsService { | ||
getProjectInfos(projects) { | ||
return promiseAllIgnoreErrors(projects.map(project => this.getProjectInfo(project))); | ||
} | ||
} | ||
export function isProjectContentItems(v) { | ||
return v !== null && v !== undefined; | ||
} | ||
//# sourceMappingURL=Projects.js.map |
import { Tables as TablesService } from '../__generated__/Tables'; | ||
import { TableInfoDc } from '../__generated__/data-contracts'; | ||
export declare class Tables extends TablesService { | ||
getTableInfos(tables: string[]): Promise<TableInfoDc[]>; | ||
} |
import { Tables as TablesService } from '../__generated__/Tables'; | ||
import { promiseAllIgnoreErrors } from '../utils/promiseAllIgnoreErrors'; | ||
export class Tables extends TablesService { | ||
getTableInfos(tables) { | ||
return promiseAllIgnoreErrors(tables.map(table => this.getTableInfo(table))); | ||
} | ||
} | ||
//# sourceMappingURL=Tables.js.map |
{ | ||
"name": "@evergis/api", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"license": "ISC", | ||
@@ -30,4 +30,6 @@ "author": "everpoint", | ||
}, | ||
"peerDependencies": { | ||
"@evergis/sgis": ">0.5.0-alpha.1" | ||
}, | ||
"dependencies": { | ||
"@evergis/sgis": "^0.5.0-alpha.1", | ||
"ky": "^0.11.1", | ||
@@ -34,0 +36,0 @@ "query-string": "^6.7.0" |
@@ -1,27 +0,9 @@ | ||
# TSDX Bootstrap | ||
# @evergis/api | ||
This project was bootstrapped with [TSDX](https://github.com/jaredpalmer/tsdx). | ||
```javascript | ||
import { Api } from '@evergis/api'; | ||
## Local Development | ||
Below is a list of commands you will probably find useful. | ||
### `npm start` or `yarn start` | ||
Runs the project in development/watch mode. Your project will be rebuilt upon changes. TSDX has a special logger for you convenience. Error messages are pretty printed and formatted for compatibility VS Code's Problems tab. | ||
<img src="https://user-images.githubusercontent.com/4060187/52168303-574d3a00-26f6-11e9-9f3b-71dbec9ebfcb.gif" width="600" /> | ||
Your library will be rebuilt if you make edits. | ||
### `npm run build` or `yarn build` | ||
Bundles the package to the `dist` folder. | ||
The package is optimized and bundled with Rollup into multiple formats (CommonJS, UMD, and ES Module). | ||
<img src="https://user-images.githubusercontent.com/4060187/52168322-a98e5b00-26f6-11e9-8cf6-222d716b75ef.gif" width="600" /> | ||
### `npm test` or `yarn test` | ||
Runs the test watcher (Jest) in an interactive mode. | ||
By default, runs tests related to files changed since the last commit. | ||
const api = new Api({ | ||
url: '/', | ||
}); | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
164821
134
3210
10
- Removed@evergis/sgis@^0.5.0-alpha.1