@emuanalytics/flow-engine-client 1.3.31 → 1.3.34
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/CHANGELOG.md +57 -0
- package/dist/bundle.js.map +1 -1
- package/esm/index.d.ts +7 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +7 -0
- package/esm/index.js.map +1 -0
- package/esm/lib/api-interfaces.d.ts +207 -0
- package/esm/lib/api-interfaces.d.ts.map +1 -0
- package/esm/lib/api-interfaces.js +5 -0
- package/esm/lib/api-interfaces.js.map +1 -0
- package/esm/lib/apikey.endpoints.d.ts +10 -0
- package/esm/lib/apikey.endpoints.d.ts.map +1 -0
- package/esm/lib/apikey.endpoints.js +28 -0
- package/esm/lib/apikey.endpoints.js.map +1 -0
- package/esm/lib/appconfig.endpoints.d.ts +10 -0
- package/esm/lib/appconfig.endpoints.d.ts.map +1 -0
- package/esm/lib/appconfig.endpoints.js +28 -0
- package/esm/lib/appconfig.endpoints.js.map +1 -0
- package/esm/lib/application.endpoints.d.ts +10 -0
- package/esm/lib/application.endpoints.d.ts.map +1 -0
- package/esm/lib/application.endpoints.js +28 -0
- package/esm/lib/application.endpoints.js.map +1 -0
- package/esm/lib/auth.edpoints.d.ts +19 -0
- package/esm/lib/auth.edpoints.d.ts.map +1 -0
- package/esm/lib/auth.edpoints.js +49 -0
- package/esm/lib/auth.edpoints.js.map +1 -0
- package/esm/lib/base.endpoints.d.ts +20 -0
- package/esm/lib/base.endpoints.d.ts.map +1 -0
- package/esm/lib/base.endpoints.js +71 -0
- package/esm/lib/base.endpoints.js.map +1 -0
- package/esm/lib/client.d.ts +49 -0
- package/esm/lib/client.d.ts.map +1 -0
- package/esm/lib/client.js +142 -0
- package/esm/lib/client.js.map +1 -0
- package/esm/lib/database.endpoints.d.ts +11 -0
- package/esm/lib/database.endpoints.d.ts.map +1 -0
- package/esm/lib/database.endpoints.js +36 -0
- package/esm/lib/database.endpoints.js.map +1 -0
- package/esm/lib/dataset.endpoints.d.ts +22 -0
- package/esm/lib/dataset.endpoints.d.ts.map +1 -0
- package/esm/lib/dataset.endpoints.js +72 -0
- package/esm/lib/dataset.endpoints.js.map +1 -0
- package/esm/lib/errors.d.ts +9 -0
- package/esm/lib/errors.d.ts.map +1 -0
- package/esm/lib/errors.js +33 -0
- package/esm/lib/errors.js.map +1 -0
- package/esm/lib/job.endpoints.d.ts +15 -0
- package/esm/lib/job.endpoints.d.ts.map +1 -0
- package/esm/lib/job.endpoints.js +43 -0
- package/esm/lib/job.endpoints.js.map +1 -0
- package/esm/lib/map.endoints.d.ts +11 -0
- package/esm/lib/map.endoints.d.ts.map +1 -0
- package/esm/lib/map.endoints.js +15 -0
- package/esm/lib/map.endoints.js.map +1 -0
- package/esm/lib/style.endpoint.d.ts +10 -0
- package/esm/lib/style.endpoint.d.ts.map +1 -0
- package/esm/lib/style.endpoint.js +28 -0
- package/esm/lib/style.endpoint.js.map +1 -0
- package/esm/lib/tile-source.endpoints.d.ts +11 -0
- package/esm/lib/tile-source.endpoints.d.ts.map +1 -0
- package/esm/lib/tile-source.endpoints.js +36 -0
- package/esm/lib/tile-source.endpoints.js.map +1 -0
- package/esm/lib/tile.endpoints.d.ts +12 -0
- package/esm/lib/tile.endpoints.d.ts.map +1 -0
- package/esm/lib/tile.endpoints.js +19 -0
- package/esm/lib/tile.endpoints.js.map +1 -0
- package/esm/lib/upload.endpoints.d.ts +23 -0
- package/esm/lib/upload.endpoints.d.ts.map +1 -0
- package/esm/lib/upload.endpoints.js +105 -0
- package/esm/lib/upload.endpoints.js.map +1 -0
- package/esm/lib/user.endpoints.d.ts +11 -0
- package/esm/lib/user.endpoints.d.ts.map +1 -0
- package/esm/lib/user.endpoints.js +33 -0
- package/esm/lib/user.endpoints.js.map +1 -0
- package/lib/index.d.ts +7 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +23 -0
- package/lib/index.js.map +1 -0
- package/lib/lib/api-interfaces.d.ts +207 -0
- package/lib/lib/api-interfaces.d.ts.map +1 -0
- package/lib/lib/api-interfaces.js +6 -0
- package/lib/lib/api-interfaces.js.map +1 -0
- package/lib/lib/apikey.endpoints.d.ts +10 -0
- package/lib/lib/apikey.endpoints.d.ts.map +1 -0
- package/lib/lib/apikey.endpoints.js +31 -0
- package/lib/lib/apikey.endpoints.js.map +1 -0
- package/lib/lib/appconfig.endpoints.d.ts +10 -0
- package/lib/lib/appconfig.endpoints.d.ts.map +1 -0
- package/lib/lib/appconfig.endpoints.js +31 -0
- package/lib/lib/appconfig.endpoints.js.map +1 -0
- package/lib/lib/application.endpoints.d.ts +10 -0
- package/lib/lib/application.endpoints.d.ts.map +1 -0
- package/lib/lib/application.endpoints.js +31 -0
- package/lib/lib/application.endpoints.js.map +1 -0
- package/lib/lib/auth.edpoints.d.ts +19 -0
- package/lib/lib/auth.edpoints.d.ts.map +1 -0
- package/lib/lib/auth.edpoints.js +52 -0
- package/lib/lib/auth.edpoints.js.map +1 -0
- package/lib/lib/base.endpoints.d.ts +20 -0
- package/lib/lib/base.endpoints.d.ts.map +1 -0
- package/lib/lib/base.endpoints.js +74 -0
- package/lib/lib/base.endpoints.js.map +1 -0
- package/lib/lib/client.d.ts +49 -0
- package/lib/lib/client.d.ts.map +1 -0
- package/lib/lib/client.js +148 -0
- package/lib/lib/client.js.map +1 -0
- package/lib/lib/database.endpoints.d.ts +11 -0
- package/lib/lib/database.endpoints.d.ts.map +1 -0
- package/lib/lib/database.endpoints.js +39 -0
- package/lib/lib/database.endpoints.js.map +1 -0
- package/lib/lib/dataset.endpoints.d.ts +22 -0
- package/lib/lib/dataset.endpoints.d.ts.map +1 -0
- package/lib/lib/dataset.endpoints.js +75 -0
- package/lib/lib/dataset.endpoints.js.map +1 -0
- package/lib/lib/errors.d.ts +9 -0
- package/lib/lib/errors.d.ts.map +1 -0
- package/lib/lib/errors.js +36 -0
- package/lib/lib/errors.js.map +1 -0
- package/lib/lib/job.endpoints.d.ts +15 -0
- package/lib/lib/job.endpoints.d.ts.map +1 -0
- package/lib/lib/job.endpoints.js +46 -0
- package/lib/lib/job.endpoints.js.map +1 -0
- package/lib/lib/map.endoints.d.ts +11 -0
- package/lib/lib/map.endoints.d.ts.map +1 -0
- package/lib/lib/map.endoints.js +18 -0
- package/lib/lib/map.endoints.js.map +1 -0
- package/lib/lib/style.endpoint.d.ts +10 -0
- package/lib/lib/style.endpoint.d.ts.map +1 -0
- package/lib/lib/style.endpoint.js +31 -0
- package/lib/lib/style.endpoint.js.map +1 -0
- package/lib/lib/tile-source.endpoints.d.ts +11 -0
- package/lib/lib/tile-source.endpoints.d.ts.map +1 -0
- package/lib/lib/tile-source.endpoints.js +39 -0
- package/lib/lib/tile-source.endpoints.js.map +1 -0
- package/lib/lib/tile.endpoints.d.ts +12 -0
- package/lib/lib/tile.endpoints.d.ts.map +1 -0
- package/lib/lib/tile.endpoints.js +22 -0
- package/lib/lib/tile.endpoints.js.map +1 -0
- package/lib/lib/upload.endpoints.d.ts +23 -0
- package/lib/lib/upload.endpoints.d.ts.map +1 -0
- package/lib/lib/upload.endpoints.js +111 -0
- package/lib/lib/upload.endpoints.js.map +1 -0
- package/lib/lib/user.endpoints.d.ts +11 -0
- package/lib/lib/user.endpoints.d.ts.map +1 -0
- package/lib/lib/user.endpoints.js +36 -0
- package/lib/lib/user.endpoints.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/lib/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,E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,GAAG,OAAO,CAAC,GAAG,CAAC;IAkBjE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,GAAQ,GAAG,OAAO,CAAC,GAAG,CAAC;IAiBtD;;;;;OAKG;IACH,OAAO,CAAC,WAAW;IAsBnB,OAAO,CAAC,OAAO;CAchB"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
var __assign = (this && this.__assign) || function () {
|
|
5
|
+
__assign = Object.assign || function(t) {
|
|
6
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
7
|
+
s = arguments[i];
|
|
8
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
9
|
+
t[p] = s[p];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
return __assign.apply(this, arguments);
|
|
14
|
+
};
|
|
15
|
+
import Axios from 'axios';
|
|
16
|
+
import { FlowEngineError } from './errors';
|
|
17
|
+
import { AuthEndpoints } from './auth.edpoints';
|
|
18
|
+
import { TileEndpoints } from './tile.endpoints';
|
|
19
|
+
import { StyleEndpoints } from './style.endpoint';
|
|
20
|
+
import { MapEndpoints } from './map.endoints';
|
|
21
|
+
import { ApiKeyEndpoints } from './apikey.endpoints';
|
|
22
|
+
import { ApplicationEndpoints } from './application.endpoints';
|
|
23
|
+
import { DatabaseEndpoints } from './database.endpoints';
|
|
24
|
+
import { DatasetEndpoints } from './dataset.endpoints';
|
|
25
|
+
import { TileSourceEndpoints } from './tile-source.endpoints';
|
|
26
|
+
import { UploadEndpoints } from './upload.endpoints';
|
|
27
|
+
import { AppConfigEndpoints } from './appconfig.endpoints';
|
|
28
|
+
import { JobEndpoints } from './job.endpoints';
|
|
29
|
+
var Client = /** @class */ (function () {
|
|
30
|
+
function Client(baseUrl, apiKey) {
|
|
31
|
+
if (apiKey === void 0) { apiKey = null; }
|
|
32
|
+
this.baseUrl = baseUrl;
|
|
33
|
+
this.apiKey = apiKey;
|
|
34
|
+
this.accessToken = null;
|
|
35
|
+
this.auth = new AuthEndpoints(this);
|
|
36
|
+
this.tiles = new TileEndpoints(this);
|
|
37
|
+
this.maps = new MapEndpoints(this);
|
|
38
|
+
this.apiKeys = new ApiKeyEndpoints(this);
|
|
39
|
+
this.applications = new ApplicationEndpoints(this);
|
|
40
|
+
this.appconfig = new AppConfigEndpoints(this);
|
|
41
|
+
this.databases = new DatabaseEndpoints(this);
|
|
42
|
+
this.datasets = new DatasetEndpoints(this);
|
|
43
|
+
this.styles = new StyleEndpoints(this);
|
|
44
|
+
this.tileSources = new TileSourceEndpoints(this);
|
|
45
|
+
this.uploads = new UploadEndpoints(this);
|
|
46
|
+
this.jobs = new JobEndpoints(this);
|
|
47
|
+
this.axios = Axios.create({
|
|
48
|
+
baseURL: baseUrl,
|
|
49
|
+
maxContentLength: 524288000
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
Client.prototype.config = function () {
|
|
53
|
+
return this._get('/api/v1/config');
|
|
54
|
+
};
|
|
55
|
+
Client.prototype._get = function (path, options) {
|
|
56
|
+
var _a;
|
|
57
|
+
if (options === void 0) { options = {}; }
|
|
58
|
+
// Move apiKey from params
|
|
59
|
+
if ((_a = options.params) === null || _a === void 0 ? void 0 : _a.apiKey) {
|
|
60
|
+
options.apiKey = options.params.apiKey;
|
|
61
|
+
delete options.params.apiKey;
|
|
62
|
+
}
|
|
63
|
+
return this.axios(__assign(__assign({ method: 'get', url: path }, options), this.headers(options)))
|
|
64
|
+
.then(function (res) { return res.data; })
|
|
65
|
+
.catch(this.handleError);
|
|
66
|
+
};
|
|
67
|
+
Client.prototype._post = function (path, data, options) {
|
|
68
|
+
var _a;
|
|
69
|
+
if (options === void 0) { options = {}; }
|
|
70
|
+
// Move apiKey from params
|
|
71
|
+
if ((_a = options.params) === null || _a === void 0 ? void 0 : _a.apiKey) {
|
|
72
|
+
options.apiKey = options.params.apiKey;
|
|
73
|
+
delete options.params.apiKey;
|
|
74
|
+
}
|
|
75
|
+
return this.axios(__assign(__assign({ method: 'post', url: path, data: data, maxContentLength: Infinity, maxBodyLength: Infinity }, options), this.headers(options)))
|
|
76
|
+
.then(function (res) { return res.data; })
|
|
77
|
+
.catch(this.handleError);
|
|
78
|
+
};
|
|
79
|
+
Client.prototype._put = function (path, data, options) {
|
|
80
|
+
var _a;
|
|
81
|
+
if (options === void 0) { options = {}; }
|
|
82
|
+
// Move apiKey from params
|
|
83
|
+
if ((_a = options.params) === null || _a === void 0 ? void 0 : _a.apiKey) {
|
|
84
|
+
options.apiKey = options.params.apiKey;
|
|
85
|
+
delete options.params.apiKey;
|
|
86
|
+
}
|
|
87
|
+
return this.axios(__assign(__assign({ method: 'put', url: path, data: data }, options), this.headers(options)))
|
|
88
|
+
.then(function (res) { return res.data; })
|
|
89
|
+
.catch(this.handleError);
|
|
90
|
+
};
|
|
91
|
+
Client.prototype._delete = function (path, options) {
|
|
92
|
+
var _a;
|
|
93
|
+
if (options === void 0) { options = {}; }
|
|
94
|
+
// Move apiKey from params
|
|
95
|
+
if ((_a = options.params) === null || _a === void 0 ? void 0 : _a.apiKey) {
|
|
96
|
+
options.apiKey = options.params.apiKey;
|
|
97
|
+
delete options.params.apiKey;
|
|
98
|
+
}
|
|
99
|
+
return this.axios(__assign(__assign({ method: 'delete', url: path }, options), this.headers(options)))
|
|
100
|
+
.then(function (res) { return res.data; })
|
|
101
|
+
.catch(this.handleError);
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Normalize errors
|
|
105
|
+
* Throws a new error based on type of input error
|
|
106
|
+
*
|
|
107
|
+
* @param {AxiosError} e
|
|
108
|
+
*/
|
|
109
|
+
Client.prototype.handleError = function (e) {
|
|
110
|
+
// Flow API error
|
|
111
|
+
if (e.response && e.response.data) {
|
|
112
|
+
if (typeof e.response.data === 'object') {
|
|
113
|
+
var data = e.response.data;
|
|
114
|
+
throw new FlowEngineError(data.message || data.error, data.error, e.response.status);
|
|
115
|
+
}
|
|
116
|
+
else if (typeof e.response.data === 'string') {
|
|
117
|
+
throw new FlowEngineError(e.response.data, null, e.response.status);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// Generic error
|
|
121
|
+
// Don't leak information in error
|
|
122
|
+
var cleanError = e;
|
|
123
|
+
delete cleanError.config;
|
|
124
|
+
delete cleanError.request;
|
|
125
|
+
delete cleanError.response;
|
|
126
|
+
throw new FlowEngineError(cleanError.message, cleanError);
|
|
127
|
+
};
|
|
128
|
+
Client.prototype.headers = function (options) {
|
|
129
|
+
var headers = options.headers || {};
|
|
130
|
+
if (options.apiKey || this.apiKey) {
|
|
131
|
+
headers['X-Api-Key'] = options.apiKey || this.apiKey;
|
|
132
|
+
}
|
|
133
|
+
// Add default auth header if token supplied and not already set in options
|
|
134
|
+
if (this.accessToken) {
|
|
135
|
+
headers.Authorization = headers.Authorization || "Bearer ".concat(this.accessToken);
|
|
136
|
+
}
|
|
137
|
+
return { headers: headers };
|
|
138
|
+
};
|
|
139
|
+
return Client;
|
|
140
|
+
}());
|
|
141
|
+
export { Client };
|
|
142
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +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,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAA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AAI,CAAC,WAAW,CAAE,CAAC;SAC/E;QAED,OAAO,EAAE,OAAO,SAAA,EAAE,CAAC;IACrB,CAAC;IACH,aAAC;AAAD,CAAC,AA/ID,IA+IC","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport Axios, { AxiosError, AxiosInstance } from 'axios';\nimport { FlowEngineError } from './errors';\nimport { AuthEndpoints } from './auth.edpoints';\nimport { IConfig } from './api-interfaces';\nimport { TileEndpoints } from './tile.endpoints';\nimport { StyleEndpoints } from './style.endpoint';\nimport { MapEndpoints } from './map.endoints';\nimport { ApiKeyEndpoints } from './apikey.endpoints';\nimport { ApplicationEndpoints } from './application.endpoints';\nimport { DatabaseEndpoints } from './database.endpoints';\nimport { DatasetEndpoints } from './dataset.endpoints';\nimport { TileSourceEndpoints } from './tile-source.endpoints';\nimport { UploadEndpoints } from './upload.endpoints';\nimport { AppConfigEndpoints } from './appconfig.endpoints';\nimport { JobEndpoints } from './job.endpoints';\n\nexport class Client {\n private readonly axios: AxiosInstance;\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) {\n this.axios = Axios.create({\n baseURL: baseUrl,\n maxContentLength: 524288000\n });\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 /**\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,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
import { Client } from './client';
|
|
5
|
+
import { BaseEndpoints } from './base.endpoints';
|
|
6
|
+
import { IDatabase } from './api-interfaces';
|
|
7
|
+
export declare class DatabaseEndpoints extends BaseEndpoints<IDatabase> {
|
|
8
|
+
constructor(client: Client);
|
|
9
|
+
drivers(): Promise<string[]>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=database.endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.endpoints.d.ts","sourceRoot":"","sources":["../../src/lib/database.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBAAa,iBAAkB,SAAQ,aAAa,CAAC,SAAS,CAAC;gBACjD,MAAM,EAAE,MAAM;IAI1B,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAQ7B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 DatabaseEndpoints = /** @class */ (function (_super) {
|
|
21
|
+
__extends(DatabaseEndpoints, _super);
|
|
22
|
+
function DatabaseEndpoints(client) {
|
|
23
|
+
return _super.call(this, client, 'databases') || this;
|
|
24
|
+
}
|
|
25
|
+
DatabaseEndpoints.prototype.drivers = function () {
|
|
26
|
+
return this.client._get("/api/v1/databases/drivers").catch(function (e) {
|
|
27
|
+
if (e.status === 404) {
|
|
28
|
+
// Backwards compatibility for pre-1.0.0 Flo.w
|
|
29
|
+
return ['postgis', 'postgis-mapnik'];
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
return DatabaseEndpoints;
|
|
34
|
+
}(BaseEndpoints));
|
|
35
|
+
export { DatabaseEndpoints };
|
|
36
|
+
//# sourceMappingURL=database.endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.endpoints.js","sourceRoot":"","sources":["../../src/lib/database.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;;;;;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD;IAAuC,qCAAwB;IAC7D,2BAAY,MAAc;eACxB,kBAAM,MAAM,EAAE,WAAW,CAAC;IAC5B,CAAC;IAED,mCAAO,GAAP;QACE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC,KAAK,CAAC,UAAA,CAAC;YAC1D,IAAI,CAAC,CAAC,MAAM,KAAK,GAAG,EAAE;gBACpB,8CAA8C;gBAC9C,OAAO,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;aACtC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACH,wBAAC;AAAD,CAAC,AAbD,CAAuC,aAAa,GAanD","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { Client } from './client';\nimport { BaseEndpoints } from './base.endpoints';\nimport { IDatabase } from './api-interfaces';\n\nexport class DatabaseEndpoints extends BaseEndpoints<IDatabase> {\n constructor(client: Client) {\n super(client, 'databases');\n }\n\n drivers(): Promise<string[]> {\n return this.client._get(`/api/v1/databases/drivers`).catch(e => {\n if (e.status === 404) {\n // Backwards compatibility for pre-1.0.0 Flo.w\n return ['postgis', 'postgis-mapnik'];\n }\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
import { Client } from './client';
|
|
5
|
+
import { BaseEndpoints } from './base.endpoints';
|
|
6
|
+
import { IDataset, FileExportFormat } from './api-interfaces';
|
|
7
|
+
export interface DatasetQuery {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
declare type QueryOutputFormat = 'plain' | 'json' | 'csv' | 'geojson';
|
|
11
|
+
export interface DatasetQueryOptions {
|
|
12
|
+
[param: string]: any;
|
|
13
|
+
format?: QueryOutputFormat;
|
|
14
|
+
explain?: boolean | string;
|
|
15
|
+
}
|
|
16
|
+
export declare class DatasetEndpoints extends BaseEndpoints<IDataset> {
|
|
17
|
+
constructor(client: Client);
|
|
18
|
+
query(datasetId: string | DatasetQuery, query?: DatasetQuery, params?: DatasetQueryOptions | QueryOutputFormat): Promise<any>;
|
|
19
|
+
getExportUrl(datasetId: string, format: FileExportFormat): string;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=dataset.endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataset.endpoints.d.ts","sourceRoot":"","sources":["../../src/lib/dataset.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAG9D,MAAM,WAAW,YAAY;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,aAAK,iBAAiB,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;AAE9D,MAAM,WAAW,mBAAmB;IAClC,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;IACrB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC5B;AAED,qBAAa,gBAAiB,SAAQ,aAAa,CAAC,QAAQ,CAAC;gBAC/C,MAAM,EAAE,MAAM;IAI1B,KAAK,CACH,SAAS,EAAE,MAAM,GAAG,YAAY,EAChC,KAAK,GAAE,YAAiB,EACxB,MAAM,GAAE,mBAAmB,GAAG,iBAAsB,GACnD,OAAO,CAAC,GAAG,CAAC;IA+Bf,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,MAAM;CAMlE"}
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
var __assign = (this && this.__assign) || function () {
|
|
20
|
+
__assign = Object.assign || function(t) {
|
|
21
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
22
|
+
s = arguments[i];
|
|
23
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
24
|
+
t[p] = s[p];
|
|
25
|
+
}
|
|
26
|
+
return t;
|
|
27
|
+
};
|
|
28
|
+
return __assign.apply(this, arguments);
|
|
29
|
+
};
|
|
30
|
+
import { BaseEndpoints } from './base.endpoints';
|
|
31
|
+
var DatasetEndpoints = /** @class */ (function (_super) {
|
|
32
|
+
__extends(DatasetEndpoints, _super);
|
|
33
|
+
function DatasetEndpoints(client) {
|
|
34
|
+
return _super.call(this, client, 'datasets') || this;
|
|
35
|
+
}
|
|
36
|
+
DatasetEndpoints.prototype.query = function (datasetId, query, params) {
|
|
37
|
+
if (query === void 0) { query = {}; }
|
|
38
|
+
if (params === void 0) { params = {}; }
|
|
39
|
+
// Support Flo.w RDF-style query definition
|
|
40
|
+
if (typeof datasetId === 'object') {
|
|
41
|
+
params = __assign(__assign({}, datasetId.params), { format: datasetId.format || 'json' });
|
|
42
|
+
query = datasetId;
|
|
43
|
+
datasetId = query.datasetId;
|
|
44
|
+
delete query.datasetId;
|
|
45
|
+
delete query.format;
|
|
46
|
+
}
|
|
47
|
+
if (typeof params === 'string') {
|
|
48
|
+
params = { format: params };
|
|
49
|
+
}
|
|
50
|
+
return this.client
|
|
51
|
+
._post("/api/v1/datasets/".concat(datasetId, "/query"), query, {
|
|
52
|
+
params: __assign(__assign({}, params), { format: params.format || 'json', explain: params.explain || false })
|
|
53
|
+
})
|
|
54
|
+
.catch(function (e) {
|
|
55
|
+
if (e.message === 'Network Error') {
|
|
56
|
+
throw new Error('Query timed out');
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
throw e;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
DatasetEndpoints.prototype.getExportUrl = function (datasetId, format) {
|
|
64
|
+
var credentials = this.client.accessToken
|
|
65
|
+
? "accesstoken=".concat(this.client.accessToken)
|
|
66
|
+
: "apikey=".concat(this.client.apiKey);
|
|
67
|
+
return "".concat(this.client.baseUrl, "/api/v1/datasets/").concat(datasetId, "/export?format=").concat(format, "&").concat(credentials);
|
|
68
|
+
};
|
|
69
|
+
return DatasetEndpoints;
|
|
70
|
+
}(BaseEndpoints));
|
|
71
|
+
export { DatasetEndpoints };
|
|
72
|
+
//# sourceMappingURL=dataset.endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataset.endpoints.js","sourceRoot":"","sources":["../../src/lib/dataset.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAgBjD;IAAsC,oCAAuB;IAC3D,0BAAY,MAAc;eACxB,kBAAM,MAAM,EAAE,UAAU,CAAC;IAC3B,CAAC;IAED,gCAAK,GAAL,UACE,SAAgC,EAChC,KAAwB,EACxB,MAAoD;QADpD,sBAAA,EAAA,UAAwB;QACxB,uBAAA,EAAA,WAAoD;QAEpD,2CAA2C;QAC3C,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE;YACjC,MAAM,yBAAQ,SAAS,CAAC,MAAM,KAAE,MAAM,EAAE,SAAS,CAAC,MAAM,IAAI,MAAM,GAAE,CAAC;YACrE,KAAK,GAAG,SAAS,CAAC;YAClB,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;YAC5B,OAAO,KAAK,CAAC,SAAS,CAAC;YACvB,OAAO,KAAK,CAAC,MAAM,CAAC;SACrB;QAED,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;YAC9B,MAAM,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;SAC7B;QAED,OAAO,IAAI,CAAC,MAAM;aACf,KAAK,CAAC,2BAAoB,SAAS,WAAQ,EAAE,KAAK,EAAE;YACnD,MAAM,wBACD,MAAM,KACT,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,MAAM,EAC/B,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,KAAK,GACjC;SACF,CAAC;aACD,KAAK,CAAC,UAAA,CAAC;YACN,IAAI,CAAC,CAAC,OAAO,KAAK,eAAe,EAAE;gBACjC,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;aACpC;iBAAM;gBACL,MAAM,CAAC,CAAC;aACT;QACH,CAAC,CAAC,CAAC;IACP,CAAC;IAED,uCAAY,GAAZ,UAAa,SAAiB,EAAE,MAAwB;QACtD,IAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW;YACzC,CAAC,CAAC,sBAAe,IAAI,CAAC,MAAM,CAAC,WAAW,CAAE;YAC1C,CAAC,CAAC,iBAAU,IAAI,CAAC,MAAM,CAAC,MAAM,CAAE,CAAC;QACnC,OAAO,UAAG,IAAI,CAAC,MAAM,CAAC,OAAO,8BAAoB,SAAS,4BAAkB,MAAM,cAAI,WAAW,CAAE,CAAC;IACtG,CAAC;IACH,uBAAC;AAAD,CAAC,AA9CD,CAAsC,aAAa,GA8ClD","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { Client } from './client';\nimport { BaseEndpoints } from './base.endpoints';\nimport { IDataset, FileExportFormat } from './api-interfaces';\nimport { type } from 'os';\n\nexport interface DatasetQuery {\n [key: string]: any;\n}\n\ntype QueryOutputFormat = 'plain' | 'json' | 'csv' | 'geojson';\n\nexport interface DatasetQueryOptions {\n [param: string]: any;\n format?: QueryOutputFormat;\n explain?: boolean | string;\n}\n\nexport class DatasetEndpoints extends BaseEndpoints<IDataset> {\n constructor(client: Client) {\n super(client, 'datasets');\n }\n\n query(\n datasetId: string | DatasetQuery,\n query: DatasetQuery = {},\n params: DatasetQueryOptions | QueryOutputFormat = {}\n ): Promise<any> {\n // Support Flo.w RDF-style query definition\n if (typeof datasetId === 'object') {\n params = { ...datasetId.params, format: datasetId.format || 'json' };\n query = datasetId;\n datasetId = query.datasetId;\n delete query.datasetId;\n delete query.format;\n }\n\n if (typeof params === 'string') {\n params = { format: params };\n }\n\n return this.client\n ._post(`/api/v1/datasets/${datasetId}/query`, query, {\n params: {\n ...params,\n format: params.format || 'json',\n explain: params.explain || false\n }\n })\n .catch(e => {\n if (e.message === 'Network Error') {\n throw new Error('Query timed out');\n } else {\n throw e;\n }\n });\n }\n\n getExportUrl(datasetId: string, format: FileExportFormat): string {\n const credentials = this.client.accessToken\n ? `accesstoken=${this.client.accessToken}`\n : `apikey=${this.client.apiKey}`;\n return `${this.client.baseUrl}/api/v1/datasets/${datasetId}/export?format=${format}&${credentials}`;\n }\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
export declare class FlowEngineError extends Error {
|
|
5
|
+
error: object | null;
|
|
6
|
+
statusCode: number;
|
|
7
|
+
constructor(message: string, underlyingError?: Error | null, statusCode?: number);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,qBAAa,eAAgB,SAAQ,KAAK;IACxC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;gBAEP,OAAO,EAAE,MAAM,EAAE,eAAe,GAAE,KAAK,GAAG,IAAW,EAAE,UAAU,SAAM;CAQpF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
var FlowEngineError = /** @class */ (function (_super) {
|
|
20
|
+
__extends(FlowEngineError, _super);
|
|
21
|
+
function FlowEngineError(message, underlyingError, statusCode) {
|
|
22
|
+
if (underlyingError === void 0) { underlyingError = null; }
|
|
23
|
+
if (statusCode === void 0) { statusCode = 500; }
|
|
24
|
+
var _this = _super.call(this, message || 'Unknown Error') || this;
|
|
25
|
+
Object.setPrototypeOf(_this, FlowEngineError.prototype);
|
|
26
|
+
_this.statusCode = statusCode;
|
|
27
|
+
_this.error = underlyingError;
|
|
28
|
+
return _this;
|
|
29
|
+
}
|
|
30
|
+
return FlowEngineError;
|
|
31
|
+
}(Error));
|
|
32
|
+
export { FlowEngineError };
|
|
33
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH;IAAqC,mCAAK;IAIxC,yBAAY,OAAe,EAAE,eAAoC,EAAE,UAAgB;QAAtD,gCAAA,EAAA,sBAAoC;QAAE,2BAAA,EAAA,gBAAgB;QAAnF,YACE,kBAAM,OAAO,IAAI,eAAe,CAAC,SAMlC;QAJC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;QAEvD,KAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,KAAI,CAAC,KAAK,GAAG,eAAe,CAAC;;IAC/B,CAAC;IACH,sBAAC;AAAD,CAAC,AAZD,CAAqC,KAAK,GAYzC","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nexport class FlowEngineError extends Error {\n error: object | null;\n statusCode: number;\n\n constructor(message: string, underlyingError: Error | null = null, statusCode = 500) {\n super(message || 'Unknown Error');\n\n Object.setPrototypeOf(this, FlowEngineError.prototype);\n\n this.statusCode = statusCode;\n this.error = underlyingError;\n }\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
import { Client } from './client';
|
|
5
|
+
import { BaseEndpoints } from './base.endpoints';
|
|
6
|
+
import { IJob, IJobSubmission, IJobStatus } from './api-interfaces';
|
|
7
|
+
export declare class JobEndpoints extends BaseEndpoints<IJob> {
|
|
8
|
+
constructor(client: Client);
|
|
9
|
+
submit(submission: IJobSubmission): Promise<IJob>;
|
|
10
|
+
getStatus(jobId: string): Promise<IJobStatus>;
|
|
11
|
+
setStatus(jobId: string, status: IJobStatus): Promise<IJob>;
|
|
12
|
+
cancel(jobId: string): Promise<IJob>;
|
|
13
|
+
request(jobType: string): Promise<IJob>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=job.endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job.endpoints.d.ts","sourceRoot":"","sources":["../../src/lib/job.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEpE,qBAAa,YAAa,SAAQ,aAAa,CAAC,IAAI,CAAC;gBACvC,MAAM,EAAE,MAAM;IAI1B,MAAM,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjD,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAI7C,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3D,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpC,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGxC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 JobEndpoints = /** @class */ (function (_super) {
|
|
21
|
+
__extends(JobEndpoints, _super);
|
|
22
|
+
function JobEndpoints(client) {
|
|
23
|
+
return _super.call(this, client, 'jobs') || this;
|
|
24
|
+
}
|
|
25
|
+
JobEndpoints.prototype.submit = function (submission) {
|
|
26
|
+
return this.client._post("/api/v1/jobs/submit", submission);
|
|
27
|
+
};
|
|
28
|
+
JobEndpoints.prototype.getStatus = function (jobId) {
|
|
29
|
+
return this.client._get("/api/v1/jobs/".concat(jobId, "/status"));
|
|
30
|
+
};
|
|
31
|
+
JobEndpoints.prototype.setStatus = function (jobId, status) {
|
|
32
|
+
return this.client._post("/api/v1/jobs/".concat(jobId, "/status"), status);
|
|
33
|
+
};
|
|
34
|
+
JobEndpoints.prototype.cancel = function (jobId) {
|
|
35
|
+
return this.client._post("/api/v1/jobs/".concat(jobId, "/cancel"), {});
|
|
36
|
+
};
|
|
37
|
+
JobEndpoints.prototype.request = function (jobType) {
|
|
38
|
+
return this.client._post("/api/v1/jobs/request", { type: jobType });
|
|
39
|
+
};
|
|
40
|
+
return JobEndpoints;
|
|
41
|
+
}(BaseEndpoints));
|
|
42
|
+
export { JobEndpoints };
|
|
43
|
+
//# sourceMappingURL=job.endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job.endpoints.js","sourceRoot":"","sources":["../../src/lib/job.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;;;;;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD;IAAkC,gCAAmB;IACnD,sBAAY,MAAc;eACxB,kBAAM,MAAM,EAAE,MAAM,CAAC;IACvB,CAAC;IAED,6BAAM,GAAN,UAAO,UAA0B;QAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC;IAC9D,CAAC;IAED,gCAAS,GAAT,UAAU,KAAa;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,uBAAgB,KAAK,YAAS,CAAC,CAAC;IAC1D,CAAC;IAED,gCAAS,GAAT,UAAU,KAAa,EAAE,MAAkB;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAgB,KAAK,YAAS,EAAE,MAAM,CAAC,CAAC;IACnE,CAAC;IAED,6BAAM,GAAN,UAAO,KAAa;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAgB,KAAK,YAAS,EAAE,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED,8BAAO,GAAP,UAAQ,OAAe;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IACH,mBAAC;AAAD,CAAC,AAxBD,CAAkC,aAAa,GAwB9C","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { Client } from './client';\nimport { BaseEndpoints } from './base.endpoints';\nimport { IJob, IJobSubmission, IJobStatus } from './api-interfaces';\n\nexport class JobEndpoints extends BaseEndpoints<IJob> {\n constructor(client: Client) {\n super(client, 'jobs');\n }\n\n submit(submission: IJobSubmission): Promise<IJob> {\n return this.client._post(`/api/v1/jobs/submit`, submission);\n }\n\n getStatus(jobId: string): Promise<IJobStatus> {\n return this.client._get(`/api/v1/jobs/${jobId}/status`);\n }\n\n setStatus(jobId: string, status: IJobStatus): Promise<IJob> {\n return this.client._post(`/api/v1/jobs/${jobId}/status`, status);\n }\n\n cancel(jobId: string): Promise<IJob> {\n return this.client._post(`/api/v1/jobs/${jobId}/cancel`, {});\n }\n\n request(jobType: string): Promise<IJob> {\n return this.client._post(`/api/v1/jobs/request`, { type: jobType });\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
import { Client } from './client';
|
|
5
|
+
import { IStyle } from './api-interfaces';
|
|
6
|
+
export declare class MapEndpoints {
|
|
7
|
+
private readonly client;
|
|
8
|
+
constructor(client: Client);
|
|
9
|
+
get(id: string, params?: Record<string, any>): Promise<IStyle>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=map.endoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map.endoints.d.ts","sourceRoot":"","sources":["../../src/lib/map.endoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAGnE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
var MapEndpoints = /** @class */ (function () {
|
|
5
|
+
function MapEndpoints(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
MapEndpoints.prototype.get = function (id, params) {
|
|
9
|
+
if (params === void 0) { params = {}; }
|
|
10
|
+
return this.client._get("/maps/".concat(id, ".json"), { params: params });
|
|
11
|
+
};
|
|
12
|
+
return MapEndpoints;
|
|
13
|
+
}());
|
|
14
|
+
export { MapEndpoints };
|
|
15
|
+
//# sourceMappingURL=map.endoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map.endoints.js","sourceRoot":"","sources":["../../src/lib/map.endoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;IACE,sBAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C,0BAAG,GAAH,UAAI,EAAU,EAAE,MAAgC;QAAhC,uBAAA,EAAA,WAAgC;QAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAS,EAAE,UAAO,EAAE,EAAE,MAAM,QAAA,EAAE,CAAC,CAAC;IAC1D,CAAC;IACH,mBAAC;AAAD,CAAC,AAND,IAMC","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { Client } from './client';\nimport { IStyle } from './api-interfaces';\n\nexport class MapEndpoints {\n constructor(private readonly client: Client) {}\n\n get(id: string, params: Record<string, any> = {}): Promise<IStyle> {\n return this.client._get(`/maps/${id}.json`, { params });\n }\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
import { Client } from './client';
|
|
5
|
+
import { IStyle } from './api-interfaces';
|
|
6
|
+
import { BaseEndpoints } from './base.endpoints';
|
|
7
|
+
export declare class StyleEndpoints extends BaseEndpoints<IStyle> {
|
|
8
|
+
constructor(client: Client);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=style.endpoint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.endpoint.d.ts","sourceRoot":"","sources":["../../src/lib/style.endpoint.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBAAa,cAAe,SAAQ,aAAa,CAAC,MAAM,CAAC;gBAC3C,MAAM,EAAE,MAAM;CAG3B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 StyleEndpoints = /** @class */ (function (_super) {
|
|
21
|
+
__extends(StyleEndpoints, _super);
|
|
22
|
+
function StyleEndpoints(client) {
|
|
23
|
+
return _super.call(this, client, 'styles') || this;
|
|
24
|
+
}
|
|
25
|
+
return StyleEndpoints;
|
|
26
|
+
}(BaseEndpoints));
|
|
27
|
+
export { StyleEndpoints };
|
|
28
|
+
//# sourceMappingURL=style.endpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.endpoint.js","sourceRoot":"","sources":["../../src/lib/style.endpoint.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;;;;;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;IAAoC,kCAAqB;IACvD,wBAAY,MAAc;eACxB,kBAAM,MAAM,EAAE,QAAQ,CAAC;IACzB,CAAC;IACH,qBAAC;AAAD,CAAC,AAJD,CAAoC,aAAa,GAIhD","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { Client } from './client';\nimport { IStyle } from './api-interfaces';\nimport { BaseEndpoints } from './base.endpoints';\n\nexport class StyleEndpoints extends BaseEndpoints<IStyle> {\n constructor(client: Client) {\n super(client, 'styles');\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
import { Client } from './client';
|
|
5
|
+
import { BaseEndpoints } from './base.endpoints';
|
|
6
|
+
import { ITileSource } from './api-interfaces';
|
|
7
|
+
export declare class TileSourceEndpoints extends BaseEndpoints<ITileSource> {
|
|
8
|
+
constructor(client: Client);
|
|
9
|
+
drivers(): Promise<string[]>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=tile-source.endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile-source.endpoints.d.ts","sourceRoot":"","sources":["../../src/lib/tile-source.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,qBAAa,mBAAoB,SAAQ,aAAa,CAAC,WAAW,CAAC;gBACrD,MAAM,EAAE,MAAM;IAI1B,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAQ7B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 TileSourceEndpoints = /** @class */ (function (_super) {
|
|
21
|
+
__extends(TileSourceEndpoints, _super);
|
|
22
|
+
function TileSourceEndpoints(client) {
|
|
23
|
+
return _super.call(this, client, 'tilesources') || this;
|
|
24
|
+
}
|
|
25
|
+
TileSourceEndpoints.prototype.drivers = function () {
|
|
26
|
+
return this.client._get("/api/v1/tilesources/drivers").catch(function (e) {
|
|
27
|
+
if (e.statusCode === 404) {
|
|
28
|
+
// Backwards compatibility for pre-1.0.0 Flo.w
|
|
29
|
+
return ['tilelive', 'dataset'];
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
return TileSourceEndpoints;
|
|
34
|
+
}(BaseEndpoints));
|
|
35
|
+
export { TileSourceEndpoints };
|
|
36
|
+
//# sourceMappingURL=tile-source.endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile-source.endpoints.js","sourceRoot":"","sources":["../../src/lib/tile-source.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;;;;;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD;IAAyC,uCAA0B;IACjE,6BAAY,MAAc;eACxB,kBAAM,MAAM,EAAE,aAAa,CAAC;IAC9B,CAAC;IAED,qCAAO,GAAP;QACE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,KAAK,CAAC,UAAA,CAAC;YAC5D,IAAI,CAAC,CAAC,UAAU,KAAK,GAAG,EAAE;gBACxB,8CAA8C;gBAC9C,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;aAChC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACH,0BAAC;AAAD,CAAC,AAbD,CAAyC,aAAa,GAarD","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { Client } from './client';\nimport { BaseEndpoints } from './base.endpoints';\nimport { ITileSource } from './api-interfaces';\n\nexport class TileSourceEndpoints extends BaseEndpoints<ITileSource> {\n constructor(client: Client) {\n super(client, 'tilesources');\n }\n\n drivers(): Promise<string[]> {\n return this.client._get(`/api/v1/tilesources/drivers`).catch(e => {\n if (e.statusCode === 404) {\n // Backwards compatibility for pre-1.0.0 Flo.w\n return ['tilelive', 'dataset'];\n }\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
import { Client } from './client';
|
|
5
|
+
import { ITileSpec } from './api-interfaces';
|
|
6
|
+
export declare class TileEndpoints {
|
|
7
|
+
private readonly client;
|
|
8
|
+
constructor(client: Client);
|
|
9
|
+
getTileSpec(tilesourceId: string, params?: Record<string, any>): Promise<ITileSpec>;
|
|
10
|
+
getPreviewStyle(tilesourceId: string, params?: Record<string, any>): Promise<ITileSpec>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=tile.endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile.endpoints.d.ts","sourceRoot":"","sources":["../../src/lib/tile.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAIvF,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,OAAO,CAAC,SAAS,CAAC;CAG5F"}
|