@emuanalytics/flow-engine-client 1.3.111 → 1.3.114
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/bundle.js +2 -2
- package/dist/bundle.js.map +4 -4
- package/dist/cjs/lib/api-interfaces.js.map +1 -1
- package/dist/cjs/lib/client.js +2 -0
- package/dist/cjs/lib/client.js.map +1 -1
- package/dist/cjs/lib/maplayer.endpoints.js +34 -0
- package/dist/cjs/lib/maplayer.endpoints.js.map +1 -0
- package/dist/esm/lib/api-interfaces.js.map +1 -1
- package/dist/esm/lib/client.js +2 -0
- package/dist/esm/lib/client.js.map +1 -1
- package/dist/esm/lib/maplayer.endpoints.js +31 -0
- package/dist/esm/lib/maplayer.endpoints.js.map +1 -0
- package/dist/types/lib/api-interfaces.d.ts +12 -0
- package/dist/types/lib/api-interfaces.d.ts.map +1 -1
- package/dist/types/lib/client.d.ts +2 -0
- package/dist/types/lib/client.d.ts.map +1 -1
- package/dist/types/lib/maplayer.endpoints.d.ts +12 -0
- package/dist/types/lib/maplayer.endpoints.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-interfaces.js","sourceRoot":"","sources":["../../../src/lib/api-interfaces.ts"],"names":[],"mappings":";AAAA;;GAEG","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nexport interface IQuery {\n filter?: { [key: string]: any };\n attributes?: string | string[];\n join?: string | string[];\n limit?: number;\n offset?: number;\n sort?: string | string[];\n}\n\nexport interface IBaseResource {\n id: string;\n}\n\nexport interface IMetadata {\n [key: string]: any;\n}\n\nexport interface IPermissions {\n [key: string]: { [key: string]: string };\n}\n\nexport interface IApiKey extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n id: string;\n description: string;\n type: 'app' | 'master';\n permissions: IPermissions;\n metadata: IMetadata;\n userId: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IApplication extends IBaseResource {\n id: string;\n name: string;\n databases?: IDatabase[];\n description: string;\n contact: string;\n metadata: IMetadata;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IAppConfig extends IBaseResource {\n applicationId: string;\n config: object;\n}\n\nexport interface IDatabase extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n id: string;\n type: string;\n name: string;\n default: boolean;\n description: string;\n host: string;\n port: number;\n user: string;\n password: string;\n db: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IDatasetAttribute {\n attribute: string;\n type: string;\n dbType: string;\n isGeometry?: boolean;\n srid?: number;\n extent?: number[];\n extentLngLat?: number[];\n primaryKey?: boolean;\n default?: string;\n nullable?: boolean;\n description?: string;\n}\n\nexport interface IDataset extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n id: string;\n type: 'table' | 'sql';\n source: string;\n name: string;\n databaseId: string;\n database?: IDatabase;\n description: string;\n bytes: number;\n metadata: IMetadata;\n ownerId: string;\n createdAt: string;\n updatedAt: string;\n attributes: IDatasetAttribute[];\n options?: { [key: string]: any };\n}\n\nexport type FileExportFormat = 'geojson' | 'gpkg' | 'shapefile';\n\nexport interface ITileSource extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n metadata: IMetadata;\n id: string;\n type: string;\n source: string;\n attribution: string;\n minZoom: number;\n maxZoom: number;\n headers: { [key: string]: string };\n extentLngLat: number[];\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IUpload extends IBaseResource {\n id: string;\n fileName: string;\n path: string;\n options: {\n name: string;\n description?: string;\n datasetId: string;\n attribution?: string;\n schema?: string;\n };\n size: number;\n status: string;\n error: { message: string; stdout: string; stderr: string };\n applicationId: string;\n application?: IApplication;\n ownerId: string;\n updatedAt: string;\n createdAt: string;\n}\n\nexport interface IUser extends IBaseResource {\n [key: string]: any;\n}\n\nexport interface IStyle extends IBaseResource {\n [key: string]: any;\n}\n\nexport interface ITileSpec {\n [key: string]: any;\n}\n\nexport interface IConfig {\n version: {\n tag: string;\n hash: string;\n timestamp: number;\n };\n}\n\nexport interface ILoginResponse {\n accessToken: string;\n refreshToken: string;\n}\n\nexport interface ITokenRefreshResponse {\n accessToken: string;\n}\n\nexport interface UsersMeResponse {\n applicationId: string;\n email: string;\n firstName: string;\n id: string;\n lastName: string;\n metadata: object;\n roles: string[];\n}\n\n/* Job resource */\nexport type JobStatus = 'pending' | 'processing' | 'done' | 'cancelled' | 'error';\n\nexport interface IJob {\n id: string;\n applicationId: string;\n ownerId?: string;\n metadata: IMetadata;\n type: string;\n name?: string;\n description?: string;\n params: any;\n status: JobStatus;\n error?: object;\n progress?: number;\n progressText?: string;\n datasetId?: string;\n createdAt: string;\n updatedAt: string;\n}\nexport interface IJobStatus {\n status?: JobStatus;\n error?: object;\n progress?: number;\n progressText?: string;\n}\n\nexport interface IJobSubmission {\n type: string;\n name?: string;\n description?: string;\n params: any;\n}\n\nexport interface IJobRequest {\n type: string;\n}\n\nexport type IngestAction = 'insert' | 'upsert' | 'delete';\nexport interface IIngestMessage {\n datasetId: string;\n action: IngestAction;\n data: any;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"api-interfaces.js","sourceRoot":"","sources":["../../../src/lib/api-interfaces.ts"],"names":[],"mappings":";AAAA;;GAEG","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nexport interface IQuery {\n filter?: { [key: string]: any };\n attributes?: string | string[];\n join?: string | string[];\n limit?: number;\n offset?: number;\n sort?: string | string[];\n}\n\nexport interface IBaseResource {\n id: string;\n}\n\nexport interface IMetadata {\n [key: string]: any;\n}\n\nexport interface IPermissions {\n [key: string]: { [key: string]: string };\n}\n\nexport interface IApiKey extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n id: string;\n description: string;\n type: 'app' | 'master';\n permissions: IPermissions;\n metadata: IMetadata;\n userId: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IApplication extends IBaseResource {\n id: string;\n name: string;\n databases?: IDatabase[];\n description: string;\n contact: string;\n metadata: IMetadata;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IAppConfig extends IBaseResource {\n applicationId: string;\n config: object;\n}\n\nexport interface IDatabase extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n id: string;\n type: string;\n name: string;\n default: boolean;\n description: string;\n host: string;\n port: number;\n user: string;\n password: string;\n db: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IDatasetAttribute {\n attribute: string;\n type: string;\n dbType: string;\n isGeometry?: boolean;\n srid?: number;\n extent?: number[];\n extentLngLat?: number[];\n primaryKey?: boolean;\n default?: string;\n nullable?: boolean;\n description?: string;\n}\n\nexport interface IDataset extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n id: string;\n type: 'table' | 'sql';\n source: string;\n name: string;\n databaseId: string;\n database?: IDatabase;\n description: string;\n bytes: number;\n metadata: IMetadata;\n ownerId: string;\n createdAt: string;\n updatedAt: string;\n attributes: IDatasetAttribute[];\n options?: { [key: string]: any };\n}\nexport interface IMapLayer extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n ownerId: string;\n createdAt: string;\n updatedAt: string;\n\n id: string;\n name: string;\n description: string;\n layerSpec: any;\n metadata: IMetadata;\n}\n\nexport type FileExportFormat = 'geojson' | 'gpkg' | 'shapefile';\n\nexport interface ITileSource extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n metadata: IMetadata;\n id: string;\n type: string;\n source: string;\n attribution: string;\n minZoom: number;\n maxZoom: number;\n headers: { [key: string]: string };\n extentLngLat: number[];\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IUpload extends IBaseResource {\n id: string;\n fileName: string;\n path: string;\n options: {\n name: string;\n description?: string;\n datasetId: string;\n attribution?: string;\n schema?: string;\n };\n size: number;\n status: string;\n error: { message: string; stdout: string; stderr: string };\n applicationId: string;\n application?: IApplication;\n ownerId: string;\n updatedAt: string;\n createdAt: string;\n}\n\nexport interface IUser extends IBaseResource {\n [key: string]: any;\n}\n\nexport interface IStyle extends IBaseResource {\n [key: string]: any;\n}\n\nexport interface ITileSpec {\n [key: string]: any;\n}\n\nexport interface IConfig {\n version: {\n tag: string;\n hash: string;\n timestamp: number;\n };\n}\n\nexport interface ILoginResponse {\n accessToken: string;\n refreshToken: string;\n}\n\nexport interface ITokenRefreshResponse {\n accessToken: string;\n}\n\nexport interface UsersMeResponse {\n applicationId: string;\n email: string;\n firstName: string;\n id: string;\n lastName: string;\n metadata: object;\n roles: string[];\n}\n\n/* Job resource */\nexport type JobStatus = 'pending' | 'processing' | 'done' | 'cancelled' | 'error';\n\nexport interface IJob {\n id: string;\n applicationId: string;\n ownerId?: string;\n metadata: IMetadata;\n type: string;\n name?: string;\n description?: string;\n params: any;\n status: JobStatus;\n error?: object;\n progress?: number;\n progressText?: string;\n datasetId?: string;\n createdAt: string;\n updatedAt: string;\n}\nexport interface IJobStatus {\n status?: JobStatus;\n error?: object;\n progress?: number;\n progressText?: string;\n}\n\nexport interface IJobSubmission {\n type: string;\n name?: string;\n description?: string;\n params: any;\n}\n\nexport interface IJobRequest {\n type: string;\n}\n\nexport type IngestAction = 'insert' | 'upsert' | 'delete';\nexport interface IIngestMessage {\n datasetId: string;\n action: IngestAction;\n data: any;\n}\n"]}
|
package/dist/cjs/lib/client.js
CHANGED
|
@@ -29,6 +29,7 @@ var dataset_endpoints_1 = require("./dataset.endpoints");
|
|
|
29
29
|
var errors_1 = require("./errors");
|
|
30
30
|
var job_endpoints_1 = require("./job.endpoints");
|
|
31
31
|
var map_endoints_1 = require("./map.endoints");
|
|
32
|
+
var maplayer_endpoints_1 = require("./maplayer.endpoints");
|
|
32
33
|
var style_endpoint_1 = require("./style.endpoint");
|
|
33
34
|
var tile_source_endpoints_1 = require("./tile-source.endpoints");
|
|
34
35
|
var tile_endpoints_1 = require("./tile.endpoints");
|
|
@@ -53,6 +54,7 @@ var Client = /** @class */ (function () {
|
|
|
53
54
|
this.tileSources = new tile_source_endpoints_1.TileSourceEndpoints(this);
|
|
54
55
|
this.uploads = new upload_endpoints_1.UploadEndpoints(this);
|
|
55
56
|
this.jobs = new job_endpoints_1.JobEndpoints(this);
|
|
57
|
+
this.maplayers = new maplayer_endpoints_1.MapLayerEndpoints(this);
|
|
56
58
|
this.axios = axios_1.default.create({
|
|
57
59
|
baseURL: baseUrl,
|
|
58
60
|
maxContentLength: 524288000,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/lib/client.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AAEH,gDAAyD;AACzD,+BAAuC;AAEvC,uDAAqD;AACrD,6DAA2D;AAC3D,iEAA+D;AAC/D,iDAAgD;AAChD,2DAAyD;AACzD,yDAAuD;AACvD,mCAA2C;AAC3C,iDAA+C;AAC/C,+CAA8C;AAC9C,mDAAkD;AAClD,iEAA8D;AAC9D,mDAAiD;AACjD,uDAAqD;AACrD,2DAM8B;AAI9B;IAqBE,gBAAmB,OAAe,EAAkB,MAA4B,EAAE,OAAuB;QAArD,uBAAA,EAAA,aAA4B;QAA7D,YAAO,GAAP,OAAO,CAAQ;QAAkB,WAAM,GAAN,MAAM,CAAsB;QAnBvE,UAAK,GAAG,IAAA,aAAK,EAAC,oBAAoB,CAAC,CAAC;QAI7C,gBAAW,GAAkB,IAAI,CAAC;QAElC,SAAI,GAAG,IAAI,6BAAa,CAAC,IAAI,CAAC,CAAC;QAC/B,UAAK,GAAG,IAAI,8BAAa,CAAC,IAAI,CAAC,CAAC;QAChC,SAAI,GAAG,IAAI,2BAAY,CAAC,IAAI,CAAC,CAAC;QAC9B,YAAO,GAAG,IAAI,kCAAe,CAAC,IAAI,CAAC,CAAC;QACpC,iBAAY,GAAG,IAAI,4CAAoB,CAAC,IAAI,CAAC,CAAC;QAC9C,cAAS,GAAG,IAAI,wCAAkB,CAAC,IAAI,CAAC,CAAC;QACzC,cAAS,GAAG,IAAI,sCAAiB,CAAC,IAAI,CAAC,CAAC;QACxC,aAAQ,GAAG,IAAI,oCAAgB,CAAC,IAAI,CAA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AO,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC;SACtD;QAED,2EAA2E;QAC3E,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,IAAI,iBAAU,IAAI,CAAC,WAAW,CAAE,CAAC;SAC/E;QAED,OAAO,EAAE,OAAO,SAAA,EAAE,CAAC;IACrB,CAAC;IACH,aAAC;AAAD,CAAC,AAzLD,IAyLC;AAzLY,wBAAM","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport Axios, { AxiosError, AxiosInstance } from 'axios';\nimport { debug as Debug } from 'debug';\nimport { IConfig } from './api-interfaces';\nimport { ApiKeyEndpoints } from './apikey.endpoints';\nimport { AppConfigEndpoints } from './appconfig.endpoints';\nimport { ApplicationEndpoints } from './application.endpoints';\nimport { AuthEndpoints } from './auth.edpoints';\nimport { DatabaseEndpoints } from './database.endpoints';\nimport { DatasetEndpoints } from './dataset.endpoints';\nimport { FlowEngineError } from './errors';\nimport { JobEndpoints } from './job.endpoints';\nimport { MapEndpoints } from './map.endoints';\nimport { StyleEndpoints } from './style.endpoint';\nimport { TileSourceEndpoints } from './tile-source.endpoints';\nimport { TileEndpoints } from './tile.endpoints';\nimport { UploadEndpoints } from './upload.endpoints';\nimport {\n WebSocketGateway,\n WebSocketManagerOptions,\n WebSocketSubscribeCallback,\n WebSocketUnsubscribeCallback,\n WebSocketUnsubscriber\n} from './web-socket-gateway';\n\nexport type ClientOptions = WebSocketManagerOptions;\n\nexport class Client {\n private readonly axios: AxiosInstance;\n readonly debug = Debug('flow-engine-client');\n\n public webSocketGateway: WebSocketGateway;\n\n accessToken: string | null = null;\n\n auth = new AuthEndpoints(this);\n tiles = new TileEndpoints(this);\n maps = new MapEndpoints(this);\n apiKeys = new ApiKeyEndpoints(this);\n applications = new ApplicationEndpoints(this);\n appconfig = new AppConfigEndpoints(this);\n databases = new DatabaseEndpoints(this);\n datasets = new DatasetEndpoints(this);\n styles = new StyleEndpoints(this);\n tileSources = new TileSourceEndpoints(this);\n uploads = new UploadEndpoints(this);\n jobs = new JobEndpoints(this);\n\n constructor(public baseUrl: string, public readonly apiKey: string | null = null, options?: ClientOptions) {\n this.axios = Axios.create({\n baseURL: baseUrl,\n maxContentLength: 524288000,\n transformResponse: [\n function transformResponse(data, headers) {\n if (headers?.['content-type']?.startsWith('application/json')) {\n // Force parsing of data if expected content type is JSON\n // This ensures that errors are thrown if JSON is truncated due to a query timeout\n // (default Axios behavior is simply to return a string if JSON parsing fails)\n return JSON.parse(data);\n }\n\n return data;\n }\n ]\n });\n\n this.webSocketGateway = new WebSocketGateway(this, options);\n }\n\n connect(): Promise<void> {\n return this.webSocketGateway.connect();\n }\n\n disconnect(): Promise<void> {\n return this.webSocketGateway.disconnect();\n }\n\n config(): Promise<IConfig> {\n return this._get('/api/v1/config');\n }\n\n _get(path: string, options: any = {}): Promise<any> {\n // Move apiKey from params\n if (options.params?.apiKey) {\n options.apiKey = options.params.apiKey;\n delete options.params.apiKey;\n }\n\n return this.axios({\n method: 'get',\n url: path,\n ...options,\n ...this.headers(options)\n })\n .then(res => res.data)\n .catch(this.handleError);\n }\n\n _post(path: string, data: object, options: any = {}): Promise<any> {\n // Move apiKey from params\n if (options.params?.apiKey) {\n options.apiKey = options.params.apiKey;\n delete options.params.apiKey;\n }\n\n return this.axios({\n method: 'post',\n url: path,\n data,\n maxContentLength: Infinity,\n maxBodyLength: Infinity,\n ...options,\n ...this.headers(options)\n })\n .then(res => res.data)\n .catch(this.handleError);\n }\n\n _put(path: string, data: object, options: any = {}): Promise<any> {\n // Move apiKey from params\n if (options.params?.apiKey) {\n options.apiKey = options.params.apiKey;\n delete options.params.apiKey;\n }\n\n return this.axios({\n method: 'put',\n url: path,\n data,\n ...options,\n ...this.headers(options)\n })\n .then(res => res.data)\n .catch(this.handleError);\n }\n\n _delete(path: string, options: any = {}): Promise<any> {\n // Move apiKey from params\n if (options.params?.apiKey) {\n options.apiKey = options.params.apiKey;\n delete options.params.apiKey;\n }\n\n return this.axios({\n method: 'delete',\n url: path,\n ...options,\n ...this.headers(options)\n })\n .then(res => res.data)\n .catch(this.handleError);\n }\n\n // Subscribe to named channel - errors and messages are delivered via the callback\n _subscribe(channel: string, cb: WebSocketSubscribeCallback): WebSocketUnsubscriber {\n if (!this.webSocketGateway.isConnected) {\n this.webSocketGateway.connect();\n }\n\n return this.webSocketGateway.subscribe(channel, cb);\n }\n\n // Unsubscribe from named channel - optional callback is called on completion\n _unsubscribe(channel: string, cb?: WebSocketUnsubscribeCallback) {\n if (!this.webSocketGateway.isConnected) {\n this.webSocketGateway.connect();\n }\n this.webSocketGateway.unsubscribe(channel, cb);\n }\n\n /**\n * Normalize errors\n * Throws a new error based on type of input error\n *\n * @param {AxiosError} e\n */\n private handleError(e: AxiosError) {\n // Flow API error\n if (e.response && e.response.data) {\n if (typeof e.response.data === 'object') {\n const data: any = e.response.data;\n throw new FlowEngineError(data.message || data.error, data.error, e.response.status);\n } else if (typeof e.response.data === 'string') {\n throw new FlowEngineError(e.response.data, null, e.response.status);\n }\n }\n\n // Generic error\n\n // Don't leak information in error\n const cleanError: any = e;\n delete cleanError.config;\n delete cleanError.request;\n delete cleanError.response;\n\n throw new FlowEngineError(cleanError.message, cleanError);\n }\n\n private headers(options: any) {\n const headers = options.headers || {};\n\n if (options.apiKey || this.apiKey) {\n headers['X-Api-Key'] = options.apiKey || this.apiKey;\n }\n\n // Add default auth header if token supplied and not already set in options\n if (this.accessToken) {\n headers.Authorization = headers.Authorization || `Bearer ${this.accessToken}`;\n }\n\n return { headers };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/lib/client.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AAEH,gDAAyD;AACzD,+BAAuC;AAEvC,uDAAqD;AACrD,6DAA2D;AAC3D,iEAA+D;AAC/D,iDAAgD;AAChD,2DAAyD;AACzD,yDAAuD;AAC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AxiosError, AxiosInstance } from 'axios';\nimport { debug as Debug } from 'debug';\nimport { IConfig } from './api-interfaces';\nimport { ApiKeyEndpoints } from './apikey.endpoints';\nimport { AppConfigEndpoints } from './appconfig.endpoints';\nimport { ApplicationEndpoints } from './application.endpoints';\nimport { AuthEndpoints } from './auth.edpoints';\nimport { DatabaseEndpoints } from './database.endpoints';\nimport { DatasetEndpoints } from './dataset.endpoints';\nimport { FlowEngineError } from './errors';\nimport { JobEndpoints } from './job.endpoints';\nimport { MapEndpoints } from './map.endoints';\nimport { MapLayerEndpoints } from './maplayer.endpoints';\nimport { StyleEndpoints } from './style.endpoint';\nimport { TileSourceEndpoints } from './tile-source.endpoints';\nimport { TileEndpoints } from './tile.endpoints';\nimport { UploadEndpoints } from './upload.endpoints';\nimport {\n WebSocketGateway,\n WebSocketManagerOptions,\n WebSocketSubscribeCallback,\n WebSocketUnsubscribeCallback,\n WebSocketUnsubscriber\n} from './web-socket-gateway';\n\nexport type ClientOptions = WebSocketManagerOptions;\n\nexport class Client {\n private readonly axios: AxiosInstance;\n readonly debug = Debug('flow-engine-client');\n\n public webSocketGateway: WebSocketGateway;\n\n accessToken: string | null = null;\n\n auth = new AuthEndpoints(this);\n tiles = new TileEndpoints(this);\n maps = new MapEndpoints(this);\n apiKeys = new ApiKeyEndpoints(this);\n applications = new ApplicationEndpoints(this);\n appconfig = new AppConfigEndpoints(this);\n databases = new DatabaseEndpoints(this);\n datasets = new DatasetEndpoints(this);\n styles = new StyleEndpoints(this);\n tileSources = new TileSourceEndpoints(this);\n uploads = new UploadEndpoints(this);\n jobs = new JobEndpoints(this);\n maplayers = new MapLayerEndpoints(this);\n\n constructor(public baseUrl: string, public readonly apiKey: string | null = null, options?: ClientOptions) {\n this.axios = Axios.create({\n baseURL: baseUrl,\n maxContentLength: 524288000,\n transformResponse: [\n function transformResponse(data, headers) {\n if (headers?.['content-type']?.startsWith('application/json')) {\n // Force parsing of data if expected content type is JSON\n // This ensures that errors are thrown if JSON is truncated due to a query timeout\n // (default Axios behavior is simply to return a string if JSON parsing fails)\n return JSON.parse(data);\n }\n\n return data;\n }\n ]\n });\n\n this.webSocketGateway = new WebSocketGateway(this, options);\n }\n\n connect(): Promise<void> {\n return this.webSocketGateway.connect();\n }\n\n disconnect(): Promise<void> {\n return this.webSocketGateway.disconnect();\n }\n\n config(): Promise<IConfig> {\n return this._get('/api/v1/config');\n }\n\n _get(path: string, options: any = {}): Promise<any> {\n // Move apiKey from params\n if (options.params?.apiKey) {\n options.apiKey = options.params.apiKey;\n delete options.params.apiKey;\n }\n\n return this.axios({\n method: 'get',\n url: path,\n ...options,\n ...this.headers(options)\n })\n .then(res => res.data)\n .catch(this.handleError);\n }\n\n _post(path: string, data: object, options: any = {}): Promise<any> {\n // Move apiKey from params\n if (options.params?.apiKey) {\n options.apiKey = options.params.apiKey;\n delete options.params.apiKey;\n }\n\n return this.axios({\n method: 'post',\n url: path,\n data,\n maxContentLength: Infinity,\n maxBodyLength: Infinity,\n ...options,\n ...this.headers(options)\n })\n .then(res => res.data)\n .catch(this.handleError);\n }\n\n _put(path: string, data: object, options: any = {}): Promise<any> {\n // Move apiKey from params\n if (options.params?.apiKey) {\n options.apiKey = options.params.apiKey;\n delete options.params.apiKey;\n }\n\n return this.axios({\n method: 'put',\n url: path,\n data,\n ...options,\n ...this.headers(options)\n })\n .then(res => res.data)\n .catch(this.handleError);\n }\n\n _delete(path: string, options: any = {}): Promise<any> {\n // Move apiKey from params\n if (options.params?.apiKey) {\n options.apiKey = options.params.apiKey;\n delete options.params.apiKey;\n }\n\n return this.axios({\n method: 'delete',\n url: path,\n ...options,\n ...this.headers(options)\n })\n .then(res => res.data)\n .catch(this.handleError);\n }\n\n // Subscribe to named channel - errors and messages are delivered via the callback\n _subscribe(channel: string, cb: WebSocketSubscribeCallback): WebSocketUnsubscriber {\n if (!this.webSocketGateway.isConnected) {\n this.webSocketGateway.connect();\n }\n\n return this.webSocketGateway.subscribe(channel, cb);\n }\n\n // Unsubscribe from named channel - optional callback is called on completion\n _unsubscribe(channel: string, cb?: WebSocketUnsubscribeCallback) {\n if (!this.webSocketGateway.isConnected) {\n this.webSocketGateway.connect();\n }\n this.webSocketGateway.unsubscribe(channel, cb);\n }\n\n /**\n * Normalize errors\n * Throws a new error based on type of input error\n *\n * @param {AxiosError} e\n */\n private handleError(e: AxiosError) {\n // Flow API error\n if (e.response && e.response.data) {\n if (typeof e.response.data === 'object') {\n const data: any = e.response.data;\n throw new FlowEngineError(data.message || data.error, data.error, e.response.status);\n } else if (typeof e.response.data === 'string') {\n throw new FlowEngineError(e.response.data, null, e.response.status);\n }\n }\n\n // Generic error\n\n // Don't leak information in error\n const cleanError: any = e;\n delete cleanError.config;\n delete cleanError.request;\n delete cleanError.response;\n\n throw new FlowEngineError(cleanError.message, cleanError);\n }\n\n private headers(options: any) {\n const headers = options.headers || {};\n\n if (options.apiKey || this.apiKey) {\n headers['X-Api-Key'] = options.apiKey || this.apiKey;\n }\n\n // Add default auth header if token supplied and not already set in options\n if (this.accessToken) {\n headers.Authorization = headers.Authorization || `Bearer ${this.accessToken}`;\n }\n\n return { headers };\n }\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright © 2018 Emu Analytics
|
|
4
|
+
*/
|
|
5
|
+
var __extends = (this && this.__extends) || (function () {
|
|
6
|
+
var extendStatics = function (d, b) {
|
|
7
|
+
extendStatics = Object.setPrototypeOf ||
|
|
8
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
9
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
10
|
+
return extendStatics(d, b);
|
|
11
|
+
};
|
|
12
|
+
return function (d, b) {
|
|
13
|
+
if (typeof b !== "function" && b !== null)
|
|
14
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
15
|
+
extendStatics(d, b);
|
|
16
|
+
function __() { this.constructor = d; }
|
|
17
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.MapLayerEndpoints = void 0;
|
|
22
|
+
var base_endpoints_1 = require("./base.endpoints");
|
|
23
|
+
var MapLayerEndpoints = /** @class */ (function (_super) {
|
|
24
|
+
__extends(MapLayerEndpoints, _super);
|
|
25
|
+
function MapLayerEndpoints(client) {
|
|
26
|
+
return _super.call(this, client, 'maplayers') || this;
|
|
27
|
+
}
|
|
28
|
+
MapLayerEndpoints.prototype.subscribe = function (cb) {
|
|
29
|
+
return this.client._subscribe("maplayers", cb);
|
|
30
|
+
};
|
|
31
|
+
return MapLayerEndpoints;
|
|
32
|
+
}(base_endpoints_1.BaseEndpoints));
|
|
33
|
+
exports.MapLayerEndpoints = MapLayerEndpoints;
|
|
34
|
+
//# sourceMappingURL=maplayer.endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maplayer.endpoints.js","sourceRoot":"","sources":["../../../src/lib/maplayer.endpoints.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;AAGH,mDAAiD;AAIjD;IAAuC,qCAAwB;IAC7D,2BAAY,MAAc;eACxB,kBAAM,MAAM,EAAE,WAAW,CAAC;IAC5B,CAAC;IAED,qCAAS,GAAT,UAAU,EAA8B;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;IACH,wBAAC;AAAD,CAAC,AARD,CAAuC,8BAAa,GAQnD;AARY,8CAAiB","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { IMapLayer } from './api-interfaces';\nimport { BaseEndpoints } from './base.endpoints';\nimport { Client } from './client';\nimport { WebSocketSubscribeCallback, WebSocketUnsubscriber } from './web-socket-gateway';\n\nexport class MapLayerEndpoints extends BaseEndpoints<IMapLayer> {\n constructor(client: Client) {\n super(client, 'maplayers');\n }\n\n subscribe(cb: WebSocketSubscribeCallback): WebSocketUnsubscriber {\n return this.client._subscribe(`maplayers`, cb);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-interfaces.js","sourceRoot":"","sources":["../../../src/lib/api-interfaces.ts"],"names":[],"mappings":"AAAA;;GAEG","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nexport interface IQuery {\n filter?: { [key: string]: any };\n attributes?: string | string[];\n join?: string | string[];\n limit?: number;\n offset?: number;\n sort?: string | string[];\n}\n\nexport interface IBaseResource {\n id: string;\n}\n\nexport interface IMetadata {\n [key: string]: any;\n}\n\nexport interface IPermissions {\n [key: string]: { [key: string]: string };\n}\n\nexport interface IApiKey extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n id: string;\n description: string;\n type: 'app' | 'master';\n permissions: IPermissions;\n metadata: IMetadata;\n userId: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IApplication extends IBaseResource {\n id: string;\n name: string;\n databases?: IDatabase[];\n description: string;\n contact: string;\n metadata: IMetadata;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IAppConfig extends IBaseResource {\n applicationId: string;\n config: object;\n}\n\nexport interface IDatabase extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n id: string;\n type: string;\n name: string;\n default: boolean;\n description: string;\n host: string;\n port: number;\n user: string;\n password: string;\n db: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IDatasetAttribute {\n attribute: string;\n type: string;\n dbType: string;\n isGeometry?: boolean;\n srid?: number;\n extent?: number[];\n extentLngLat?: number[];\n primaryKey?: boolean;\n default?: string;\n nullable?: boolean;\n description?: string;\n}\n\nexport interface IDataset extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n id: string;\n type: 'table' | 'sql';\n source: string;\n name: string;\n databaseId: string;\n database?: IDatabase;\n description: string;\n bytes: number;\n metadata: IMetadata;\n ownerId: string;\n createdAt: string;\n updatedAt: string;\n attributes: IDatasetAttribute[];\n options?: { [key: string]: any };\n}\n\nexport type FileExportFormat = 'geojson' | 'gpkg' | 'shapefile';\n\nexport interface ITileSource extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n metadata: IMetadata;\n id: string;\n type: string;\n source: string;\n attribution: string;\n minZoom: number;\n maxZoom: number;\n headers: { [key: string]: string };\n extentLngLat: number[];\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IUpload extends IBaseResource {\n id: string;\n fileName: string;\n path: string;\n options: {\n name: string;\n description?: string;\n datasetId: string;\n attribution?: string;\n schema?: string;\n };\n size: number;\n status: string;\n error: { message: string; stdout: string; stderr: string };\n applicationId: string;\n application?: IApplication;\n ownerId: string;\n updatedAt: string;\n createdAt: string;\n}\n\nexport interface IUser extends IBaseResource {\n [key: string]: any;\n}\n\nexport interface IStyle extends IBaseResource {\n [key: string]: any;\n}\n\nexport interface ITileSpec {\n [key: string]: any;\n}\n\nexport interface IConfig {\n version: {\n tag: string;\n hash: string;\n timestamp: number;\n };\n}\n\nexport interface ILoginResponse {\n accessToken: string;\n refreshToken: string;\n}\n\nexport interface ITokenRefreshResponse {\n accessToken: string;\n}\n\nexport interface UsersMeResponse {\n applicationId: string;\n email: string;\n firstName: string;\n id: string;\n lastName: string;\n metadata: object;\n roles: string[];\n}\n\n/* Job resource */\nexport type JobStatus = 'pending' | 'processing' | 'done' | 'cancelled' | 'error';\n\nexport interface IJob {\n id: string;\n applicationId: string;\n ownerId?: string;\n metadata: IMetadata;\n type: string;\n name?: string;\n description?: string;\n params: any;\n status: JobStatus;\n error?: object;\n progress?: number;\n progressText?: string;\n datasetId?: string;\n createdAt: string;\n updatedAt: string;\n}\nexport interface IJobStatus {\n status?: JobStatus;\n error?: object;\n progress?: number;\n progressText?: string;\n}\n\nexport interface IJobSubmission {\n type: string;\n name?: string;\n description?: string;\n params: any;\n}\n\nexport interface IJobRequest {\n type: string;\n}\n\nexport type IngestAction = 'insert' | 'upsert' | 'delete';\nexport interface IIngestMessage {\n datasetId: string;\n action: IngestAction;\n data: any;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"api-interfaces.js","sourceRoot":"","sources":["../../../src/lib/api-interfaces.ts"],"names":[],"mappings":"AAAA;;GAEG","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nexport interface IQuery {\n filter?: { [key: string]: any };\n attributes?: string | string[];\n join?: string | string[];\n limit?: number;\n offset?: number;\n sort?: string | string[];\n}\n\nexport interface IBaseResource {\n id: string;\n}\n\nexport interface IMetadata {\n [key: string]: any;\n}\n\nexport interface IPermissions {\n [key: string]: { [key: string]: string };\n}\n\nexport interface IApiKey extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n id: string;\n description: string;\n type: 'app' | 'master';\n permissions: IPermissions;\n metadata: IMetadata;\n userId: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IApplication extends IBaseResource {\n id: string;\n name: string;\n databases?: IDatabase[];\n description: string;\n contact: string;\n metadata: IMetadata;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IAppConfig extends IBaseResource {\n applicationId: string;\n config: object;\n}\n\nexport interface IDatabase extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n id: string;\n type: string;\n name: string;\n default: boolean;\n description: string;\n host: string;\n port: number;\n user: string;\n password: string;\n db: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IDatasetAttribute {\n attribute: string;\n type: string;\n dbType: string;\n isGeometry?: boolean;\n srid?: number;\n extent?: number[];\n extentLngLat?: number[];\n primaryKey?: boolean;\n default?: string;\n nullable?: boolean;\n description?: string;\n}\n\nexport interface IDataset extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n id: string;\n type: 'table' | 'sql';\n source: string;\n name: string;\n databaseId: string;\n database?: IDatabase;\n description: string;\n bytes: number;\n metadata: IMetadata;\n ownerId: string;\n createdAt: string;\n updatedAt: string;\n attributes: IDatasetAttribute[];\n options?: { [key: string]: any };\n}\nexport interface IMapLayer extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n ownerId: string;\n createdAt: string;\n updatedAt: string;\n\n id: string;\n name: string;\n description: string;\n layerSpec: any;\n metadata: IMetadata;\n}\n\nexport type FileExportFormat = 'geojson' | 'gpkg' | 'shapefile';\n\nexport interface ITileSource extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n metadata: IMetadata;\n id: string;\n type: string;\n source: string;\n attribution: string;\n minZoom: number;\n maxZoom: number;\n headers: { [key: string]: string };\n extentLngLat: number[];\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IUpload extends IBaseResource {\n id: string;\n fileName: string;\n path: string;\n options: {\n name: string;\n description?: string;\n datasetId: string;\n attribution?: string;\n schema?: string;\n };\n size: number;\n status: string;\n error: { message: string; stdout: string; stderr: string };\n applicationId: string;\n application?: IApplication;\n ownerId: string;\n updatedAt: string;\n createdAt: string;\n}\n\nexport interface IUser extends IBaseResource {\n [key: string]: any;\n}\n\nexport interface IStyle extends IBaseResource {\n [key: string]: any;\n}\n\nexport interface ITileSpec {\n [key: string]: any;\n}\n\nexport interface IConfig {\n version: {\n tag: string;\n hash: string;\n timestamp: number;\n };\n}\n\nexport interface ILoginResponse {\n accessToken: string;\n refreshToken: string;\n}\n\nexport interface ITokenRefreshResponse {\n accessToken: string;\n}\n\nexport interface UsersMeResponse {\n applicationId: string;\n email: string;\n firstName: string;\n id: string;\n lastName: string;\n metadata: object;\n roles: string[];\n}\n\n/* Job resource */\nexport type JobStatus = 'pending' | 'processing' | 'done' | 'cancelled' | 'error';\n\nexport interface IJob {\n id: string;\n applicationId: string;\n ownerId?: string;\n metadata: IMetadata;\n type: string;\n name?: string;\n description?: string;\n params: any;\n status: JobStatus;\n error?: object;\n progress?: number;\n progressText?: string;\n datasetId?: string;\n createdAt: string;\n updatedAt: string;\n}\nexport interface IJobStatus {\n status?: JobStatus;\n error?: object;\n progress?: number;\n progressText?: string;\n}\n\nexport interface IJobSubmission {\n type: string;\n name?: string;\n description?: string;\n params: any;\n}\n\nexport interface IJobRequest {\n type: string;\n}\n\nexport type IngestAction = 'insert' | 'upsert' | 'delete';\nexport interface IIngestMessage {\n datasetId: string;\n action: IngestAction;\n data: any;\n}\n"]}
|
package/dist/esm/lib/client.js
CHANGED
|
@@ -23,6 +23,7 @@ import { DatasetEndpoints } from './dataset.endpoints';
|
|
|
23
23
|
import { FlowEngineError } from './errors';
|
|
24
24
|
import { JobEndpoints } from './job.endpoints';
|
|
25
25
|
import { MapEndpoints } from './map.endoints';
|
|
26
|
+
import { MapLayerEndpoints } from './maplayer.endpoints';
|
|
26
27
|
import { StyleEndpoints } from './style.endpoint';
|
|
27
28
|
import { TileSourceEndpoints } from './tile-source.endpoints';
|
|
28
29
|
import { TileEndpoints } from './tile.endpoints';
|
|
@@ -47,6 +48,7 @@ var Client = /** @class */ (function () {
|
|
|
47
48
|
this.tileSources = new TileSourceEndpoints(this);
|
|
48
49
|
this.uploads = new UploadEndpoints(this);
|
|
49
50
|
this.jobs = new JobEndpoints(this);
|
|
51
|
+
this.maplayers = new MapLayerEndpoints(this);
|
|
50
52
|
this.axios = Axios.create({
|
|
51
53
|
baseURL: baseUrl,
|
|
52
54
|
maxContentLength: 524288000,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/lib/client.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;AAEH,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;A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tD;QAED,2EAA2E;QAC3E,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,IAAI,iBAAU,IAAI,CAAC,WAAW,CAAE,CAAC;SAC/E;QAED,OAAO,EAAE,OAAO,SAAA,EAAE,CAAC;IACrB,CAAC;IACH,aAAC;AAAD,CAAC,AAzLD,IAyLC","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport Axios, { AxiosError, AxiosInstance } from 'axios';\nimport { debug as Debug } from 'debug';\nimport { IConfig } from './api-interfaces';\nimport { ApiKeyEndpoints } from './apikey.endpoints';\nimport { AppConfigEndpoints } from './appconfig.endpoints';\nimport { ApplicationEndpoints } from './application.endpoints';\nimport { AuthEndpoints } from './auth.edpoints';\nimport { DatabaseEndpoints } from './database.endpoints';\nimport { DatasetEndpoints } from './dataset.endpoints';\nimport { FlowEngineError } from './errors';\nimport { JobEndpoints } from './job.endpoints';\nimport { MapEndpoints } from './map.endoints';\nimport { StyleEndpoints } from './style.endpoint';\nimport { TileSourceEndpoints } from './tile-source.endpoints';\nimport { TileEndpoints } from './tile.endpoints';\nimport { UploadEndpoints } from './upload.endpoints';\nimport {\n WebSocketGateway,\n WebSocketManagerOptions,\n WebSocketSubscribeCallback,\n WebSocketUnsubscribeCallback,\n WebSocketUnsubscriber\n} from './web-socket-gateway';\n\nexport type ClientOptions = WebSocketManagerOptions;\n\nexport class Client {\n private readonly axios: AxiosInstance;\n readonly debug = Debug('flow-engine-client');\n\n public webSocketGateway: WebSocketGateway;\n\n accessToken: string | null = null;\n\n auth = new AuthEndpoints(this);\n tiles = new TileEndpoints(this);\n maps = new MapEndpoints(this);\n apiKeys = new ApiKeyEndpoints(this);\n applications = new ApplicationEndpoints(this);\n appconfig = new AppConfigEndpoints(this);\n databases = new DatabaseEndpoints(this);\n datasets = new DatasetEndpoints(this);\n styles = new StyleEndpoints(this);\n tileSources = new TileSourceEndpoints(this);\n uploads = new UploadEndpoints(this);\n jobs = new JobEndpoints(this);\n\n constructor(public baseUrl: string, public readonly apiKey: string | null = null, options?: ClientOptions) {\n this.axios = Axios.create({\n baseURL: baseUrl,\n maxContentLength: 524288000,\n transformResponse: [\n function transformResponse(data, headers) {\n if (headers?.['content-type']?.startsWith('application/json')) {\n // Force parsing of data if expected content type is JSON\n // This ensures that errors are thrown if JSON is truncated due to a query timeout\n // (default Axios behavior is simply to return a string if JSON parsing fails)\n return JSON.parse(data);\n }\n\n return data;\n }\n ]\n });\n\n this.webSocketGateway = new WebSocketGateway(this, options);\n }\n\n connect(): Promise<void> {\n return this.webSocketGateway.connect();\n }\n\n disconnect(): Promise<void> {\n return this.webSocketGateway.disconnect();\n }\n\n config(): Promise<IConfig> {\n return this._get('/api/v1/config');\n }\n\n _get(path: string, options: any = {}): Promise<any> {\n // Move apiKey from params\n if (options.params?.apiKey) {\n options.apiKey = options.params.apiKey;\n delete options.params.apiKey;\n }\n\n return this.axios({\n method: 'get',\n url: path,\n ...options,\n ...this.headers(options)\n })\n .then(res => res.data)\n .catch(this.handleError);\n }\n\n _post(path: string, data: object, options: any = {}): Promise<any> {\n // Move apiKey from params\n if (options.params?.apiKey) {\n options.apiKey = options.params.apiKey;\n delete options.params.apiKey;\n }\n\n return this.axios({\n method: 'post',\n url: path,\n data,\n maxContentLength: Infinity,\n maxBodyLength: Infinity,\n ...options,\n ...this.headers(options)\n })\n .then(res => res.data)\n .catch(this.handleError);\n }\n\n _put(path: string, data: object, options: any = {}): Promise<any> {\n // Move apiKey from params\n if (options.params?.apiKey) {\n options.apiKey = options.params.apiKey;\n delete options.params.apiKey;\n }\n\n return this.axios({\n method: 'put',\n url: path,\n data,\n ...options,\n ...this.headers(options)\n })\n .then(res => res.data)\n .catch(this.handleError);\n }\n\n _delete(path: string, options: any = {}): Promise<any> {\n // Move apiKey from params\n if (options.params?.apiKey) {\n options.apiKey = options.params.apiKey;\n delete options.params.apiKey;\n }\n\n return this.axios({\n method: 'delete',\n url: path,\n ...options,\n ...this.headers(options)\n })\n .then(res => res.data)\n .catch(this.handleError);\n }\n\n // Subscribe to named channel - errors and messages are delivered via the callback\n _subscribe(channel: string, cb: WebSocketSubscribeCallback): WebSocketUnsubscriber {\n if (!this.webSocketGateway.isConnected) {\n this.webSocketGateway.connect();\n }\n\n return this.webSocketGateway.subscribe(channel, cb);\n }\n\n // Unsubscribe from named channel - optional callback is called on completion\n _unsubscribe(channel: string, cb?: WebSocketUnsubscribeCallback) {\n if (!this.webSocketGateway.isConnected) {\n this.webSocketGateway.connect();\n }\n this.webSocketGateway.unsubscribe(channel, cb);\n }\n\n /**\n * Normalize errors\n * Throws a new error based on type of input error\n *\n * @param {AxiosError} e\n */\n private handleError(e: AxiosError) {\n // Flow API error\n if (e.response && e.response.data) {\n if (typeof e.response.data === 'object') {\n const data: any = e.response.data;\n throw new FlowEngineError(data.message || data.error, data.error, e.response.status);\n } else if (typeof e.response.data === 'string') {\n throw new FlowEngineError(e.response.data, null, e.response.status);\n }\n }\n\n // Generic error\n\n // Don't leak information in error\n const cleanError: any = e;\n delete cleanError.config;\n delete cleanError.request;\n delete cleanError.response;\n\n throw new FlowEngineError(cleanError.message, cleanError);\n }\n\n private headers(options: any) {\n const headers = options.headers || {};\n\n if (options.apiKey || this.apiKey) {\n headers['X-Api-Key'] = options.apiKey || this.apiKey;\n }\n\n // Add default auth header if token supplied and not already set in options\n if (this.accessToken) {\n headers.Authorization = headers.Authorization || `Bearer ${this.accessToken}`;\n }\n\n return { headers };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/lib/client.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;AAEH,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uB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GAAf,UAAgB,OAAY;QAC1B,IAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;QAEtC,IAAI,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE;YACjC,OAAO,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC;SACtD;QAED,2EAA2E;QAC3E,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,IAAI,iBAAU,IAAI,CAAC,WAAW,CAAE,CAAC;SAC/E;QAED,OAAO,EAAE,OAAO,SAAA,EAAE,CAAC;IACrB,CAAC;IACH,aAAC;AAAD,CAAC,AA1LD,IA0LC","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport Axios, { AxiosError, AxiosInstance } from 'axios';\nimport { debug as Debug } from 'debug';\nimport { IConfig } from './api-interfaces';\nimport { ApiKeyEndpoints } from './apikey.endpoints';\nimport { AppConfigEndpoints } from './appconfig.endpoints';\nimport { ApplicationEndpoints } from './application.endpoints';\nimport { AuthEndpoints } from './auth.edpoints';\nimport { DatabaseEndpoints } from './database.endpoints';\nimport { DatasetEndpoints } from './dataset.endpoints';\nimport { FlowEngineError } from './errors';\nimport { JobEndpoints } from './job.endpoints';\nimport { MapEndpoints } from './map.endoints';\nimport { MapLayerEndpoints } from './maplayer.endpoints';\nimport { StyleEndpoints } from './style.endpoint';\nimport { TileSourceEndpoints } from './tile-source.endpoints';\nimport { TileEndpoints } from './tile.endpoints';\nimport { UploadEndpoints } from './upload.endpoints';\nimport {\n WebSocketGateway,\n WebSocketManagerOptions,\n WebSocketSubscribeCallback,\n WebSocketUnsubscribeCallback,\n WebSocketUnsubscriber\n} from './web-socket-gateway';\n\nexport type ClientOptions = WebSocketManagerOptions;\n\nexport class Client {\n private readonly axios: AxiosInstance;\n readonly debug = Debug('flow-engine-client');\n\n public webSocketGateway: WebSocketGateway;\n\n accessToken: string | null = null;\n\n auth = new AuthEndpoints(this);\n tiles = new TileEndpoints(this);\n maps = new MapEndpoints(this);\n apiKeys = new ApiKeyEndpoints(this);\n applications = new ApplicationEndpoints(this);\n appconfig = new AppConfigEndpoints(this);\n databases = new DatabaseEndpoints(this);\n datasets = new DatasetEndpoints(this);\n styles = new StyleEndpoints(this);\n tileSources = new TileSourceEndpoints(this);\n uploads = new UploadEndpoints(this);\n jobs = new JobEndpoints(this);\n maplayers = new MapLayerEndpoints(this);\n\n constructor(public baseUrl: string, public readonly apiKey: string | null = null, options?: ClientOptions) {\n this.axios = Axios.create({\n baseURL: baseUrl,\n maxContentLength: 524288000,\n transformResponse: [\n function transformResponse(data, headers) {\n if (headers?.['content-type']?.startsWith('application/json')) {\n // Force parsing of data if expected content type is JSON\n // This ensures that errors are thrown if JSON is truncated due to a query timeout\n // (default Axios behavior is simply to return a string if JSON parsing fails)\n return JSON.parse(data);\n }\n\n return data;\n }\n ]\n });\n\n this.webSocketGateway = new WebSocketGateway(this, options);\n }\n\n connect(): Promise<void> {\n return this.webSocketGateway.connect();\n }\n\n disconnect(): Promise<void> {\n return this.webSocketGateway.disconnect();\n }\n\n config(): Promise<IConfig> {\n return this._get('/api/v1/config');\n }\n\n _get(path: string, options: any = {}): Promise<any> {\n // Move apiKey from params\n if (options.params?.apiKey) {\n options.apiKey = options.params.apiKey;\n delete options.params.apiKey;\n }\n\n return this.axios({\n method: 'get',\n url: path,\n ...options,\n ...this.headers(options)\n })\n .then(res => res.data)\n .catch(this.handleError);\n }\n\n _post(path: string, data: object, options: any = {}): Promise<any> {\n // Move apiKey from params\n if (options.params?.apiKey) {\n options.apiKey = options.params.apiKey;\n delete options.params.apiKey;\n }\n\n return this.axios({\n method: 'post',\n url: path,\n data,\n maxContentLength: Infinity,\n maxBodyLength: Infinity,\n ...options,\n ...this.headers(options)\n })\n .then(res => res.data)\n .catch(this.handleError);\n }\n\n _put(path: string, data: object, options: any = {}): Promise<any> {\n // Move apiKey from params\n if (options.params?.apiKey) {\n options.apiKey = options.params.apiKey;\n delete options.params.apiKey;\n }\n\n return this.axios({\n method: 'put',\n url: path,\n data,\n ...options,\n ...this.headers(options)\n })\n .then(res => res.data)\n .catch(this.handleError);\n }\n\n _delete(path: string, options: any = {}): Promise<any> {\n // Move apiKey from params\n if (options.params?.apiKey) {\n options.apiKey = options.params.apiKey;\n delete options.params.apiKey;\n }\n\n return this.axios({\n method: 'delete',\n url: path,\n ...options,\n ...this.headers(options)\n })\n .then(res => res.data)\n .catch(this.handleError);\n }\n\n // Subscribe to named channel - errors and messages are delivered via the callback\n _subscribe(channel: string, cb: WebSocketSubscribeCallback): WebSocketUnsubscriber {\n if (!this.webSocketGateway.isConnected) {\n this.webSocketGateway.connect();\n }\n\n return this.webSocketGateway.subscribe(channel, cb);\n }\n\n // Unsubscribe from named channel - optional callback is called on completion\n _unsubscribe(channel: string, cb?: WebSocketUnsubscribeCallback) {\n if (!this.webSocketGateway.isConnected) {\n this.webSocketGateway.connect();\n }\n this.webSocketGateway.unsubscribe(channel, cb);\n }\n\n /**\n * Normalize errors\n * Throws a new error based on type of input error\n *\n * @param {AxiosError} e\n */\n private handleError(e: AxiosError) {\n // Flow API error\n if (e.response && e.response.data) {\n if (typeof e.response.data === 'object') {\n const data: any = e.response.data;\n throw new FlowEngineError(data.message || data.error, data.error, e.response.status);\n } else if (typeof e.response.data === 'string') {\n throw new FlowEngineError(e.response.data, null, e.response.status);\n }\n }\n\n // Generic error\n\n // Don't leak information in error\n const cleanError: any = e;\n delete cleanError.config;\n delete cleanError.request;\n delete cleanError.response;\n\n throw new FlowEngineError(cleanError.message, cleanError);\n }\n\n private headers(options: any) {\n const headers = options.headers || {};\n\n if (options.apiKey || this.apiKey) {\n headers['X-Api-Key'] = options.apiKey || this.apiKey;\n }\n\n // Add default auth header if token supplied and not already set in options\n if (this.accessToken) {\n headers.Authorization = headers.Authorization || `Bearer ${this.accessToken}`;\n }\n\n return { headers };\n }\n}\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
var __extends = (this && this.__extends) || (function () {
|
|
5
|
+
var extendStatics = function (d, b) {
|
|
6
|
+
extendStatics = Object.setPrototypeOf ||
|
|
7
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
8
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
9
|
+
return extendStatics(d, b);
|
|
10
|
+
};
|
|
11
|
+
return function (d, b) {
|
|
12
|
+
if (typeof b !== "function" && b !== null)
|
|
13
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
14
|
+
extendStatics(d, b);
|
|
15
|
+
function __() { this.constructor = d; }
|
|
16
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
17
|
+
};
|
|
18
|
+
})();
|
|
19
|
+
import { BaseEndpoints } from './base.endpoints';
|
|
20
|
+
var MapLayerEndpoints = /** @class */ (function (_super) {
|
|
21
|
+
__extends(MapLayerEndpoints, _super);
|
|
22
|
+
function MapLayerEndpoints(client) {
|
|
23
|
+
return _super.call(this, client, 'maplayers') || this;
|
|
24
|
+
}
|
|
25
|
+
MapLayerEndpoints.prototype.subscribe = function (cb) {
|
|
26
|
+
return this.client._subscribe("maplayers", cb);
|
|
27
|
+
};
|
|
28
|
+
return MapLayerEndpoints;
|
|
29
|
+
}(BaseEndpoints));
|
|
30
|
+
export { MapLayerEndpoints };
|
|
31
|
+
//# sourceMappingURL=maplayer.endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maplayer.endpoints.js","sourceRoot":"","sources":["../../../src/lib/maplayer.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;;;;;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD;IAAuC,qCAAwB;IAC7D,2BAAY,MAAc;eACxB,kBAAM,MAAM,EAAE,WAAW,CAAC;IAC5B,CAAC;IAED,qCAAS,GAAT,UAAU,EAA8B;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;IACH,wBAAC;AAAD,CAAC,AARD,CAAuC,aAAa,GAQnD","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { IMapLayer } from './api-interfaces';\nimport { BaseEndpoints } from './base.endpoints';\nimport { Client } from './client';\nimport { WebSocketSubscribeCallback, WebSocketUnsubscriber } from './web-socket-gateway';\n\nexport class MapLayerEndpoints extends BaseEndpoints<IMapLayer> {\n constructor(client: Client) {\n super(client, 'maplayers');\n }\n\n subscribe(cb: WebSocketSubscribeCallback): WebSocketUnsubscriber {\n return this.client._subscribe(`maplayers`, cb);\n }\n}\n"]}
|
|
@@ -97,6 +97,18 @@ export interface IDataset extends IBaseResource {
|
|
|
97
97
|
[key: string]: any;
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
+
export interface IMapLayer extends IBaseResource {
|
|
101
|
+
applicationId: string;
|
|
102
|
+
application?: IApplication;
|
|
103
|
+
ownerId: string;
|
|
104
|
+
createdAt: string;
|
|
105
|
+
updatedAt: string;
|
|
106
|
+
id: string;
|
|
107
|
+
name: string;
|
|
108
|
+
description: string;
|
|
109
|
+
layerSpec: any;
|
|
110
|
+
metadata: IMetadata;
|
|
111
|
+
}
|
|
100
112
|
export type FileExportFormat = 'geojson' | 'gpkg' | 'shapefile';
|
|
101
113
|
export interface ITileSource extends IBaseResource {
|
|
102
114
|
applicationId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-interfaces.d.ts","sourceRoot":"","sources":["../../../src/lib/api-interfaces.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,MAAM;IACrB,MAAM,CAAC,EAAE;QAAE,C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AE,GAAG,CAAC;CACb;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC1D,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,YAAY,CAAC;IACrB,IAAI,EAAE,GAAG,CAAC;CACX"}
|
|
@@ -11,6 +11,7 @@ import { DatabaseEndpoints } from './database.endpoints';
|
|
|
11
11
|
import { DatasetEndpoints } from './dataset.endpoints';
|
|
12
12
|
import { JobEndpoints } from './job.endpoints';
|
|
13
13
|
import { MapEndpoints } from './map.endoints';
|
|
14
|
+
import { MapLayerEndpoints } from './maplayer.endpoints';
|
|
14
15
|
import { StyleEndpoints } from './style.endpoint';
|
|
15
16
|
import { TileSourceEndpoints } from './tile-source.endpoints';
|
|
16
17
|
import { TileEndpoints } from './tile.endpoints';
|
|
@@ -36,6 +37,7 @@ export declare class Client {
|
|
|
36
37
|
tileSources: TileSourceEndpoints;
|
|
37
38
|
uploads: UploadEndpoints;
|
|
38
39
|
jobs: JobEndpoints;
|
|
40
|
+
maplayers: MapLayerEndpoints;
|
|
39
41
|
constructor(baseUrl: string, apiKey?: string | null, options?: ClientOptions);
|
|
40
42
|
connect(): Promise<void>;
|
|
41
43
|
disconnect(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/lib/client.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB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EAAE,MAAM,EAAE,OAAO,GAAE,GAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAoBlE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,GAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAkBjE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,GAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAkBtD,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,0BAA0B,GAAG,qBAAqB;IASlF,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,4BAA4B;IAO/D;;;;;OAKG;IACH,OAAO,CAAC,WAAW;IAsBnB,OAAO,CAAC,OAAO;CAchB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
import { IMapLayer } from './api-interfaces';
|
|
5
|
+
import { BaseEndpoints } from './base.endpoints';
|
|
6
|
+
import { Client } from './client';
|
|
7
|
+
import { WebSocketSubscribeCallback, WebSocketUnsubscriber } from './web-socket-gateway';
|
|
8
|
+
export declare class MapLayerEndpoints extends BaseEndpoints<IMapLayer> {
|
|
9
|
+
constructor(client: Client);
|
|
10
|
+
subscribe(cb: WebSocketSubscribeCallback): WebSocketUnsubscriber;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=maplayer.endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maplayer.endpoints.d.ts","sourceRoot":"","sources":["../../../src/lib/maplayer.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAEzF,qBAAa,iBAAkB,SAAQ,aAAa,CAAC,SAAS,CAAC;gBACjD,MAAM,EAAE,MAAM;IAI1B,SAAS,CAAC,EAAE,EAAE,0BAA0B,GAAG,qBAAqB;CAGjE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emuanalytics/flow-engine-client",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.114",
|
|
4
4
|
"description": "Flow Engine Client",
|
|
5
5
|
"author": "Robin Summerhill <robin.summerhill@emu-analytics.com>",
|
|
6
6
|
"license": "Copyright 2018 Emu Analytics Limited",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"git add"
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "e163337f1a2d9c60bccf8726f1e06817c369d778"
|
|
65
65
|
}
|