@emuanalytics/flow-engine-client 2.1.0 → 2.2.0
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 +9 -3
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +668 -0
- package/dist/index.d.mts +668 -0
- package/dist/index.d.ts +668 -0
- package/dist/index.mjs +1 -0
- package/package.json +33 -40
- package/dist/bundle.js.map +0 -7
- package/dist/cjs/index.js +0 -25
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/lib/__mocks__/client.js +0 -57
- package/dist/cjs/lib/__mocks__/client.js.map +0 -1
- package/dist/cjs/lib/api-interfaces.js +0 -6
- package/dist/cjs/lib/api-interfaces.js.map +0 -1
- package/dist/cjs/lib/apikey.endpoints.js +0 -31
- package/dist/cjs/lib/apikey.endpoints.js.map +0 -1
- package/dist/cjs/lib/appconfig.endpoints.js +0 -49
- package/dist/cjs/lib/appconfig.endpoints.js.map +0 -1
- package/dist/cjs/lib/application.endpoints.js +0 -31
- package/dist/cjs/lib/application.endpoints.js.map +0 -1
- package/dist/cjs/lib/auth.edpoints.js +0 -60
- package/dist/cjs/lib/auth.edpoints.js.map +0 -1
- package/dist/cjs/lib/base.endpoints.js +0 -78
- package/dist/cjs/lib/base.endpoints.js.map +0 -1
- package/dist/cjs/lib/client.js +0 -198
- package/dist/cjs/lib/client.js.map +0 -1
- package/dist/cjs/lib/contact-point.endpoints.js +0 -46
- package/dist/cjs/lib/contact-point.endpoints.js.map +0 -1
- package/dist/cjs/lib/database.endpoints.js +0 -39
- package/dist/cjs/lib/database.endpoints.js.map +0 -1
- package/dist/cjs/lib/dataset.endpoints.js +0 -88
- package/dist/cjs/lib/dataset.endpoints.js.map +0 -1
- package/dist/cjs/lib/errors.js +0 -36
- package/dist/cjs/lib/errors.js.map +0 -1
- package/dist/cjs/lib/job.endpoints.js +0 -46
- package/dist/cjs/lib/job.endpoints.js.map +0 -1
- package/dist/cjs/lib/map.endoints.js +0 -18
- package/dist/cjs/lib/map.endoints.js.map +0 -1
- package/dist/cjs/lib/maplayer.endpoints.js +0 -34
- package/dist/cjs/lib/maplayer.endpoints.js.map +0 -1
- package/dist/cjs/lib/media.endpoints.js +0 -106
- package/dist/cjs/lib/media.endpoints.js.map +0 -1
- package/dist/cjs/lib/pipeline-component.endpoints.js +0 -37
- package/dist/cjs/lib/pipeline-component.endpoints.js.map +0 -1
- package/dist/cjs/lib/pipeline-metric.endpoint.js +0 -31
- package/dist/cjs/lib/pipeline-metric.endpoint.js.map +0 -1
- package/dist/cjs/lib/pipeline.endpoints.js +0 -87
- package/dist/cjs/lib/pipeline.endpoints.js.map +0 -1
- package/dist/cjs/lib/style.endpoint.js +0 -31
- package/dist/cjs/lib/style.endpoint.js.map +0 -1
- package/dist/cjs/lib/tile-source.endpoints.js +0 -39
- package/dist/cjs/lib/tile-source.endpoints.js.map +0 -1
- package/dist/cjs/lib/tile.endpoints.js +0 -22
- package/dist/cjs/lib/tile.endpoints.js.map +0 -1
- package/dist/cjs/lib/upload.endpoints.js +0 -121
- package/dist/cjs/lib/upload.endpoints.js.map +0 -1
- package/dist/cjs/lib/user.endpoints.js +0 -36
- package/dist/cjs/lib/user.endpoints.js.map +0 -1
- package/dist/cjs/lib/web-socket-gateway.js +0 -160
- package/dist/cjs/lib/web-socket-gateway.js.map +0 -1
- package/dist/esm/index.js +0 -9
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/lib/__mocks__/client.js +0 -54
- package/dist/esm/lib/__mocks__/client.js.map +0 -1
- package/dist/esm/lib/api-interfaces.js +0 -5
- package/dist/esm/lib/api-interfaces.js.map +0 -1
- package/dist/esm/lib/apikey.endpoints.js +0 -28
- package/dist/esm/lib/apikey.endpoints.js.map +0 -1
- package/dist/esm/lib/appconfig.endpoints.js +0 -46
- package/dist/esm/lib/appconfig.endpoints.js.map +0 -1
- package/dist/esm/lib/application.endpoints.js +0 -28
- package/dist/esm/lib/application.endpoints.js.map +0 -1
- package/dist/esm/lib/auth.edpoints.js +0 -57
- package/dist/esm/lib/auth.edpoints.js.map +0 -1
- package/dist/esm/lib/base.endpoints.js +0 -75
- package/dist/esm/lib/base.endpoints.js.map +0 -1
- package/dist/esm/lib/client.js +0 -192
- package/dist/esm/lib/client.js.map +0 -1
- package/dist/esm/lib/contact-point.endpoints.js +0 -43
- package/dist/esm/lib/contact-point.endpoints.js.map +0 -1
- package/dist/esm/lib/database.endpoints.js +0 -36
- package/dist/esm/lib/database.endpoints.js.map +0 -1
- package/dist/esm/lib/dataset.endpoints.js +0 -85
- package/dist/esm/lib/dataset.endpoints.js.map +0 -1
- package/dist/esm/lib/errors.js +0 -33
- package/dist/esm/lib/errors.js.map +0 -1
- package/dist/esm/lib/job.endpoints.js +0 -43
- package/dist/esm/lib/job.endpoints.js.map +0 -1
- package/dist/esm/lib/map.endoints.js +0 -15
- package/dist/esm/lib/map.endoints.js.map +0 -1
- package/dist/esm/lib/maplayer.endpoints.js +0 -31
- package/dist/esm/lib/maplayer.endpoints.js.map +0 -1
- package/dist/esm/lib/media.endpoints.js +0 -100
- package/dist/esm/lib/media.endpoints.js.map +0 -1
- package/dist/esm/lib/pipeline-component.endpoints.js +0 -34
- package/dist/esm/lib/pipeline-component.endpoints.js.map +0 -1
- package/dist/esm/lib/pipeline-metric.endpoint.js +0 -28
- package/dist/esm/lib/pipeline-metric.endpoint.js.map +0 -1
- package/dist/esm/lib/pipeline.endpoints.js +0 -84
- package/dist/esm/lib/pipeline.endpoints.js.map +0 -1
- package/dist/esm/lib/style.endpoint.js +0 -28
- package/dist/esm/lib/style.endpoint.js.map +0 -1
- package/dist/esm/lib/tile-source.endpoints.js +0 -36
- package/dist/esm/lib/tile-source.endpoints.js.map +0 -1
- package/dist/esm/lib/tile.endpoints.js +0 -19
- package/dist/esm/lib/tile.endpoints.js.map +0 -1
- package/dist/esm/lib/upload.endpoints.js +0 -115
- package/dist/esm/lib/upload.endpoints.js.map +0 -1
- package/dist/esm/lib/user.endpoints.js +0 -33
- package/dist/esm/lib/user.endpoints.js.map +0 -1
- package/dist/esm/lib/web-socket-gateway.js +0 -157
- package/dist/esm/lib/web-socket-gateway.js.map +0 -1
- package/dist/types/index.d.ts +0 -9
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/lib/__mocks__/client.d.ts +0 -3
- package/dist/types/lib/__mocks__/client.d.ts.map +0 -1
- package/dist/types/lib/api-interfaces.d.ts +0 -314
- package/dist/types/lib/api-interfaces.d.ts.map +0 -1
- package/dist/types/lib/apikey.endpoints.d.ts +0 -10
- package/dist/types/lib/apikey.endpoints.d.ts.map +0 -1
- package/dist/types/lib/appconfig.endpoints.d.ts +0 -15
- package/dist/types/lib/appconfig.endpoints.d.ts.map +0 -1
- package/dist/types/lib/application.endpoints.d.ts +0 -10
- package/dist/types/lib/application.endpoints.d.ts.map +0 -1
- package/dist/types/lib/auth.edpoints.d.ts +0 -20
- package/dist/types/lib/auth.edpoints.d.ts.map +0 -1
- package/dist/types/lib/base.endpoints.d.ts +0 -20
- package/dist/types/lib/base.endpoints.d.ts.map +0 -1
- package/dist/types/lib/client.d.ts +0 -68
- package/dist/types/lib/client.d.ts.map +0 -1
- package/dist/types/lib/contact-point.endpoints.d.ts +0 -20
- package/dist/types/lib/contact-point.endpoints.d.ts.map +0 -1
- package/dist/types/lib/database.endpoints.d.ts +0 -11
- package/dist/types/lib/database.endpoints.d.ts.map +0 -1
- package/dist/types/lib/dataset.endpoints.d.ts +0 -26
- package/dist/types/lib/dataset.endpoints.d.ts.map +0 -1
- package/dist/types/lib/errors.d.ts +0 -9
- package/dist/types/lib/errors.d.ts.map +0 -1
- package/dist/types/lib/job.endpoints.d.ts +0 -15
- package/dist/types/lib/job.endpoints.d.ts.map +0 -1
- package/dist/types/lib/map.endoints.d.ts +0 -11
- package/dist/types/lib/map.endoints.d.ts.map +0 -1
- package/dist/types/lib/maplayer.endpoints.d.ts +0 -12
- package/dist/types/lib/maplayer.endpoints.d.ts.map +0 -1
- package/dist/types/lib/media.endpoints.d.ts +0 -20
- package/dist/types/lib/media.endpoints.d.ts.map +0 -1
- package/dist/types/lib/pipeline-component.endpoints.d.ts +0 -13
- package/dist/types/lib/pipeline-component.endpoints.d.ts.map +0 -1
- package/dist/types/lib/pipeline-metric.endpoint.d.ts +0 -10
- package/dist/types/lib/pipeline-metric.endpoint.d.ts.map +0 -1
- package/dist/types/lib/pipeline.endpoints.d.ts +0 -14
- package/dist/types/lib/pipeline.endpoints.d.ts.map +0 -1
- package/dist/types/lib/style.endpoint.d.ts +0 -10
- package/dist/types/lib/style.endpoint.d.ts.map +0 -1
- package/dist/types/lib/tile-source.endpoints.d.ts +0 -11
- package/dist/types/lib/tile-source.endpoints.d.ts.map +0 -1
- package/dist/types/lib/tile.endpoints.d.ts +0 -12
- package/dist/types/lib/tile.endpoints.d.ts.map +0 -1
- package/dist/types/lib/upload.endpoints.d.ts +0 -22
- package/dist/types/lib/upload.endpoints.d.ts.map +0 -1
- package/dist/types/lib/user.endpoints.d.ts +0 -11
- package/dist/types/lib/user.endpoints.d.ts.map +0 -1
- package/dist/types/lib/web-socket-gateway.d.ts +0 -42
- package/dist/types/lib/web-socket-gateway.d.ts.map +0 -1
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,668 @@
|
|
|
1
|
+
import Debug from 'debug';
|
|
2
|
+
import { Socket, ManagerOptions, SocketOptions } from 'socket.io-client';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Copyright © 2018 Emu Analytics
|
|
6
|
+
*/
|
|
7
|
+
interface IQuery {
|
|
8
|
+
filter?: {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
};
|
|
11
|
+
attributes?: string | string[];
|
|
12
|
+
join?: string | string[];
|
|
13
|
+
limit?: number;
|
|
14
|
+
offset?: number;
|
|
15
|
+
sort?: string | string[];
|
|
16
|
+
}
|
|
17
|
+
interface IBaseResource {
|
|
18
|
+
id: string;
|
|
19
|
+
}
|
|
20
|
+
interface IMetadata {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}
|
|
23
|
+
interface IPermissions {
|
|
24
|
+
[key: string]: {
|
|
25
|
+
[key: string]: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
interface IApiKey extends IBaseResource {
|
|
29
|
+
applicationId: string;
|
|
30
|
+
application?: IApplication;
|
|
31
|
+
id: string;
|
|
32
|
+
description: string;
|
|
33
|
+
type: 'app' | 'master';
|
|
34
|
+
permissions: IPermissions;
|
|
35
|
+
metadata: IMetadata;
|
|
36
|
+
userId: string;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
updatedAt: string;
|
|
39
|
+
}
|
|
40
|
+
interface IApplication extends IBaseResource {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
databases?: IDatabase[];
|
|
44
|
+
description: string;
|
|
45
|
+
contact: string;
|
|
46
|
+
metadata: IMetadata;
|
|
47
|
+
createdAt: string;
|
|
48
|
+
updatedAt: string;
|
|
49
|
+
}
|
|
50
|
+
interface IAppConfig extends IBaseResource {
|
|
51
|
+
applicationId: string;
|
|
52
|
+
config: object;
|
|
53
|
+
}
|
|
54
|
+
interface IDatabase extends IBaseResource {
|
|
55
|
+
applicationId: string;
|
|
56
|
+
application?: IApplication;
|
|
57
|
+
id: string;
|
|
58
|
+
type: string;
|
|
59
|
+
name: string;
|
|
60
|
+
default: boolean;
|
|
61
|
+
description: string;
|
|
62
|
+
host: string;
|
|
63
|
+
port: number;
|
|
64
|
+
user: string;
|
|
65
|
+
password: string;
|
|
66
|
+
db: string;
|
|
67
|
+
createdAt: string;
|
|
68
|
+
updatedAt: string;
|
|
69
|
+
}
|
|
70
|
+
interface IDatasetAttribute {
|
|
71
|
+
attribute: string;
|
|
72
|
+
type: string;
|
|
73
|
+
dbType: string;
|
|
74
|
+
isGeometry?: boolean;
|
|
75
|
+
srid?: number;
|
|
76
|
+
extent?: number[];
|
|
77
|
+
extentLngLat?: number[];
|
|
78
|
+
primaryKey?: boolean;
|
|
79
|
+
default?: string;
|
|
80
|
+
nullable?: boolean;
|
|
81
|
+
description?: string;
|
|
82
|
+
}
|
|
83
|
+
interface IDataset extends IBaseResource {
|
|
84
|
+
applicationId: string;
|
|
85
|
+
application?: IApplication;
|
|
86
|
+
id: string;
|
|
87
|
+
type: 'table' | 'sql';
|
|
88
|
+
source: string;
|
|
89
|
+
name: string;
|
|
90
|
+
databaseId: string;
|
|
91
|
+
database?: IDatabase;
|
|
92
|
+
description: string;
|
|
93
|
+
bytes: number;
|
|
94
|
+
metadata: IMetadata;
|
|
95
|
+
ownerId: string;
|
|
96
|
+
createdAt: string;
|
|
97
|
+
updatedAt: string;
|
|
98
|
+
attributes: IDatasetAttribute[];
|
|
99
|
+
options?: {
|
|
100
|
+
[key: string]: any;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
interface IMapLayer extends IBaseResource {
|
|
104
|
+
applicationId: string;
|
|
105
|
+
application?: IApplication;
|
|
106
|
+
ownerId: string;
|
|
107
|
+
createdAt: string;
|
|
108
|
+
updatedAt: string;
|
|
109
|
+
id: string;
|
|
110
|
+
name: string;
|
|
111
|
+
description: string;
|
|
112
|
+
layerSpec: any;
|
|
113
|
+
type: string;
|
|
114
|
+
group: string;
|
|
115
|
+
metadata: IMetadata;
|
|
116
|
+
}
|
|
117
|
+
type FileExportFormat = 'geojson' | 'gpkg' | 'shapefile';
|
|
118
|
+
interface ITileSource extends IBaseResource {
|
|
119
|
+
applicationId: string;
|
|
120
|
+
application?: IApplication;
|
|
121
|
+
metadata: IMetadata;
|
|
122
|
+
id: string;
|
|
123
|
+
type: string;
|
|
124
|
+
source: string;
|
|
125
|
+
attribution: string;
|
|
126
|
+
minZoom: number;
|
|
127
|
+
maxZoom: number;
|
|
128
|
+
headers: {
|
|
129
|
+
[key: string]: string;
|
|
130
|
+
};
|
|
131
|
+
extentLngLat: number[];
|
|
132
|
+
createdAt: string;
|
|
133
|
+
updatedAt: string;
|
|
134
|
+
}
|
|
135
|
+
interface IUpload extends IBaseResource {
|
|
136
|
+
id: string;
|
|
137
|
+
fileName: string;
|
|
138
|
+
path: string;
|
|
139
|
+
options: {
|
|
140
|
+
name: string;
|
|
141
|
+
description?: string;
|
|
142
|
+
datasetId: string;
|
|
143
|
+
attribution?: string;
|
|
144
|
+
schema?: string;
|
|
145
|
+
};
|
|
146
|
+
size: number;
|
|
147
|
+
status: string;
|
|
148
|
+
error: {
|
|
149
|
+
message: string;
|
|
150
|
+
stdout: string;
|
|
151
|
+
stderr: string;
|
|
152
|
+
};
|
|
153
|
+
applicationId: string;
|
|
154
|
+
application?: IApplication;
|
|
155
|
+
ownerId: string;
|
|
156
|
+
updatedAt: string;
|
|
157
|
+
createdAt: string;
|
|
158
|
+
}
|
|
159
|
+
interface IUser extends IBaseResource {
|
|
160
|
+
[key: string]: any;
|
|
161
|
+
}
|
|
162
|
+
interface IStyle extends IBaseResource {
|
|
163
|
+
[key: string]: any;
|
|
164
|
+
}
|
|
165
|
+
interface ITileSpec {
|
|
166
|
+
[key: string]: any;
|
|
167
|
+
}
|
|
168
|
+
interface IConfig {
|
|
169
|
+
version: {
|
|
170
|
+
tag: string;
|
|
171
|
+
hash: string;
|
|
172
|
+
timestamp: number;
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
interface ILoginResponse {
|
|
176
|
+
accessToken: string;
|
|
177
|
+
refreshToken: string;
|
|
178
|
+
}
|
|
179
|
+
interface ITokenRefreshResponse {
|
|
180
|
+
accessToken: string;
|
|
181
|
+
}
|
|
182
|
+
interface UsersMeResponse {
|
|
183
|
+
applicationId: string;
|
|
184
|
+
email: string;
|
|
185
|
+
firstName: string;
|
|
186
|
+
id: string;
|
|
187
|
+
lastName: string;
|
|
188
|
+
metadata: object;
|
|
189
|
+
roles: string[];
|
|
190
|
+
}
|
|
191
|
+
type JobStatus = 'pending' | 'processing' | 'done' | 'cancelled' | 'error';
|
|
192
|
+
interface IJob {
|
|
193
|
+
id: string;
|
|
194
|
+
applicationId: string;
|
|
195
|
+
ownerId?: string;
|
|
196
|
+
metadata: IMetadata;
|
|
197
|
+
type: string;
|
|
198
|
+
name?: string;
|
|
199
|
+
description?: string;
|
|
200
|
+
params: any;
|
|
201
|
+
status: JobStatus;
|
|
202
|
+
error?: object;
|
|
203
|
+
progress?: number;
|
|
204
|
+
progressText?: string;
|
|
205
|
+
datasetId?: string;
|
|
206
|
+
createdAt: string;
|
|
207
|
+
updatedAt: string;
|
|
208
|
+
}
|
|
209
|
+
interface IJobStatus {
|
|
210
|
+
status?: JobStatus;
|
|
211
|
+
error?: object;
|
|
212
|
+
progress?: number;
|
|
213
|
+
progressText?: string;
|
|
214
|
+
}
|
|
215
|
+
interface IJobSubmission {
|
|
216
|
+
type: string;
|
|
217
|
+
name?: string;
|
|
218
|
+
description?: string;
|
|
219
|
+
params: any;
|
|
220
|
+
}
|
|
221
|
+
interface IJobRequest {
|
|
222
|
+
type: string;
|
|
223
|
+
}
|
|
224
|
+
type IngestAction = 'insert' | 'upsert' | 'delete';
|
|
225
|
+
interface IIngestMessage {
|
|
226
|
+
datasetId: string;
|
|
227
|
+
action: IngestAction;
|
|
228
|
+
data: any;
|
|
229
|
+
}
|
|
230
|
+
interface IPipeline extends IBaseResource {
|
|
231
|
+
applicationId: string;
|
|
232
|
+
application?: IApplication;
|
|
233
|
+
id: string;
|
|
234
|
+
environment: string;
|
|
235
|
+
description: string;
|
|
236
|
+
config: Record<string, any>;
|
|
237
|
+
metadata: IMetadata;
|
|
238
|
+
startedAt: string;
|
|
239
|
+
heartbeatAt: string;
|
|
240
|
+
createdAt: string;
|
|
241
|
+
updatedAt: string;
|
|
242
|
+
components?: IPipelineComponent[];
|
|
243
|
+
}
|
|
244
|
+
interface IPipelineComponent extends IBaseResource {
|
|
245
|
+
id: string;
|
|
246
|
+
description: string;
|
|
247
|
+
config: Record<string, any>;
|
|
248
|
+
class: string;
|
|
249
|
+
type: string;
|
|
250
|
+
metadata: IMetadata;
|
|
251
|
+
index: number;
|
|
252
|
+
createdAt: string;
|
|
253
|
+
updatedAt: string;
|
|
254
|
+
metrics?: IPipelineMetric[];
|
|
255
|
+
}
|
|
256
|
+
interface IPipelineMetric extends IBaseResource {
|
|
257
|
+
id: string;
|
|
258
|
+
applicationId: string;
|
|
259
|
+
pipelineId: string;
|
|
260
|
+
componentId: string;
|
|
261
|
+
name: string;
|
|
262
|
+
type: string;
|
|
263
|
+
timestamp: string;
|
|
264
|
+
value: number;
|
|
265
|
+
labels: Record<string, string>;
|
|
266
|
+
createdAt: string;
|
|
267
|
+
updatedAt: string;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Contact point resource.
|
|
271
|
+
*/
|
|
272
|
+
interface IContactPoint extends IBaseResource {
|
|
273
|
+
id: string;
|
|
274
|
+
applicationId: string;
|
|
275
|
+
type: string;
|
|
276
|
+
description: string;
|
|
277
|
+
templates: string[];
|
|
278
|
+
recipients: string[];
|
|
279
|
+
/** Driver-specific host configuration for the contact point */
|
|
280
|
+
host: string;
|
|
281
|
+
/** Driver-specific port configuration for the contact point */
|
|
282
|
+
port: number;
|
|
283
|
+
/** Driver-specific user configuration for the contact point */
|
|
284
|
+
user: string;
|
|
285
|
+
/** Driver-specific password configuration for the contact point */
|
|
286
|
+
password: string;
|
|
287
|
+
metadata: IMetadata;
|
|
288
|
+
createdAt: string;
|
|
289
|
+
updatedAt: string;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Request body for sending a notification to a contact point.
|
|
293
|
+
*/
|
|
294
|
+
interface IContactPointSendRequest {
|
|
295
|
+
/** ID of the template to use for the notification */
|
|
296
|
+
template?: string;
|
|
297
|
+
/** Subject of the notification */
|
|
298
|
+
subject?: string;
|
|
299
|
+
/** Recipients of the notification */
|
|
300
|
+
recipients?: string[];
|
|
301
|
+
/** Template key/value data for expanding the notification template */
|
|
302
|
+
data?: any;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Media resource.
|
|
306
|
+
*/
|
|
307
|
+
interface IMedia extends IBaseResource {
|
|
308
|
+
id: string;
|
|
309
|
+
applicationId: string;
|
|
310
|
+
type: string;
|
|
311
|
+
mimeType: string;
|
|
312
|
+
fileName: string;
|
|
313
|
+
metadata: IMetadata;
|
|
314
|
+
createdAt: string;
|
|
315
|
+
updatedAt: string;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Copyright © 2018 Emu Analytics
|
|
320
|
+
*/
|
|
321
|
+
|
|
322
|
+
declare class BaseEndpoints<T extends IBaseResource> {
|
|
323
|
+
protected readonly client: Client;
|
|
324
|
+
private readonly resourcePath;
|
|
325
|
+
constructor(client: Client, resourcePath: string);
|
|
326
|
+
protected get resourceEndpoint(): string;
|
|
327
|
+
list(params?: IQuery): Promise<T[]>;
|
|
328
|
+
get(id: string, params?: Record<string, any>): Promise<T>;
|
|
329
|
+
create(data: Partial<T>, params?: Record<string, any>): Promise<T>;
|
|
330
|
+
update(id: string, data: Partial<T>, params?: Record<string, any>): Promise<T>;
|
|
331
|
+
delete(id: string, params?: Record<string, any>): Promise<any>;
|
|
332
|
+
getMetadata(id: string, key?: string, params?: Record<string, any>): Promise<any>;
|
|
333
|
+
setMetadata(id: string, key: string, value: any, params?: Record<string, any>): Promise<any>;
|
|
334
|
+
deleteMetadata(id: string, key: string, params?: Record<string, any>): Promise<any>;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Copyright © 2018 Emu Analytics
|
|
339
|
+
*/
|
|
340
|
+
|
|
341
|
+
declare class ApiKeyEndpoints extends BaseEndpoints<IApiKey> {
|
|
342
|
+
constructor(client: Client);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
declare enum WebSocketChannel {
|
|
346
|
+
System = "system",
|
|
347
|
+
AppConfig = "appconfig",
|
|
348
|
+
Dataset = "dataset/"
|
|
349
|
+
}
|
|
350
|
+
interface WebSocketPublishMessage {
|
|
351
|
+
channel: string;
|
|
352
|
+
messageType?: string;
|
|
353
|
+
payload: unknown;
|
|
354
|
+
}
|
|
355
|
+
interface WebSocketSubscribeMessage {
|
|
356
|
+
channel: string;
|
|
357
|
+
}
|
|
358
|
+
interface WebSocketErrorResponse {
|
|
359
|
+
status: 'error';
|
|
360
|
+
code: string;
|
|
361
|
+
message: string;
|
|
362
|
+
}
|
|
363
|
+
interface WebSocketOkResponse {
|
|
364
|
+
status: 'ok';
|
|
365
|
+
}
|
|
366
|
+
type WebSocketResponse = WebSocketOkResponse | WebSocketErrorResponse;
|
|
367
|
+
type WebSocketManagerOptions = Partial<ManagerOptions & SocketOptions>;
|
|
368
|
+
type WebSocketSubscribeCallback = (err: Error | null, msg?: WebSocketPublishMessage) => void;
|
|
369
|
+
type WebSocketUnsubscribeCallback = (err: Error | null) => void;
|
|
370
|
+
type WebSocketUnsubscriber = (cb?: WebSocketUnsubscribeCallback) => void;
|
|
371
|
+
declare class WebSocketGateway {
|
|
372
|
+
readonly client: Client;
|
|
373
|
+
private readonly options?;
|
|
374
|
+
private connected;
|
|
375
|
+
private subscribedChannels;
|
|
376
|
+
socket: Socket;
|
|
377
|
+
get isConnected(): boolean;
|
|
378
|
+
constructor(client: Client, options?: WebSocketManagerOptions | undefined);
|
|
379
|
+
connect(): Promise<void>;
|
|
380
|
+
disconnect(): Promise<void>;
|
|
381
|
+
subscribe(channel: string, cb: WebSocketSubscribeCallback): WebSocketUnsubscriber;
|
|
382
|
+
unsubscribe(channel: string, cb?: WebSocketUnsubscribeCallback): void;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Copyright © 2018 Emu Analytics
|
|
387
|
+
*/
|
|
388
|
+
|
|
389
|
+
declare class AppConfigEndpoints {
|
|
390
|
+
private readonly client;
|
|
391
|
+
constructor(client: Client);
|
|
392
|
+
private get resourceEndpoint();
|
|
393
|
+
get(path?: string, params?: Record<string, any>): Promise<any>;
|
|
394
|
+
set(path: string | null, value: any, params?: Record<string, any>): Promise<any>;
|
|
395
|
+
delete(path: string, params?: Record<string, any>): Promise<any>;
|
|
396
|
+
subscribe(cb: WebSocketSubscribeCallback): WebSocketUnsubscriber;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Copyright © 2018 Emu Analytics
|
|
401
|
+
*/
|
|
402
|
+
|
|
403
|
+
declare class ApplicationEndpoints extends BaseEndpoints<IApplication> {
|
|
404
|
+
constructor(client: Client);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Copyright © 2018 Emu Analytics
|
|
409
|
+
*/
|
|
410
|
+
|
|
411
|
+
declare class UserEndpoint extends BaseEndpoints<IUser> {
|
|
412
|
+
constructor(client: Client);
|
|
413
|
+
me(token: string): Promise<UsersMeResponse>;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Copyright © 2018 Emu Analytics
|
|
418
|
+
*/
|
|
419
|
+
|
|
420
|
+
declare class AuthEndpoints {
|
|
421
|
+
private readonly client;
|
|
422
|
+
users: UserEndpoint;
|
|
423
|
+
constructor(client: Client);
|
|
424
|
+
login(email: string, password: string, applicationId?: string): Promise<ILoginResponse>;
|
|
425
|
+
logout(accessToken: string, refreshToken: string): Promise<void>;
|
|
426
|
+
refresh(refreshToken: string, applicationId: string): Promise<ITokenRefreshResponse>;
|
|
427
|
+
changePassword(password: string, newPassword: string, token: string): Promise<void>;
|
|
428
|
+
signUp(firstName: string, lastName: string, email: string, password: string, applicationId: string, confirmUrl: string, redirectUrl?: string): Promise<void>;
|
|
429
|
+
confirmSignUp(email: string, token: string, redirect?: string): Promise<void>;
|
|
430
|
+
requestPasswordReset(email: string, applicationId: string, redirectUrl: string): Promise<void>;
|
|
431
|
+
resetPassword(email: string, password: string, applicationId: string, token: string): Promise<void>;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Copyright © 2018-present Emu Analytics
|
|
436
|
+
*/
|
|
437
|
+
|
|
438
|
+
declare class ContactPointEndpoints extends BaseEndpoints<IContactPoint> {
|
|
439
|
+
constructor(client: Client);
|
|
440
|
+
/**
|
|
441
|
+
* Send a notification to a contact point.
|
|
442
|
+
*/
|
|
443
|
+
send(contactPointId: string, params?: IContactPointSendRequest): Promise<void>;
|
|
444
|
+
/**
|
|
445
|
+
* Get a list of available contact point drivers. Supported types include 'email', 'slack', 'teams', 'sns'.
|
|
446
|
+
*
|
|
447
|
+
* Drivers have different required parameters - refer to documentation for details.
|
|
448
|
+
*/
|
|
449
|
+
drivers(): Promise<string[]>;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Copyright © 2018 Emu Analytics
|
|
454
|
+
*/
|
|
455
|
+
|
|
456
|
+
declare class DatabaseEndpoints extends BaseEndpoints<IDatabase> {
|
|
457
|
+
constructor(client: Client);
|
|
458
|
+
drivers(): Promise<string[]>;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Copyright © 2018 Emu Analytics
|
|
463
|
+
*/
|
|
464
|
+
|
|
465
|
+
interface DatasetQuery {
|
|
466
|
+
[key: string]: any;
|
|
467
|
+
}
|
|
468
|
+
type QueryOutputFormat = 'plain' | 'json' | 'csv' | 'geojson';
|
|
469
|
+
interface DatasetQueryOptions {
|
|
470
|
+
[param: string]: any;
|
|
471
|
+
format?: QueryOutputFormat;
|
|
472
|
+
explain?: boolean | string;
|
|
473
|
+
abortController?: AbortController;
|
|
474
|
+
}
|
|
475
|
+
declare class DatasetEndpoints extends BaseEndpoints<IDataset> {
|
|
476
|
+
constructor(client: Client);
|
|
477
|
+
query(datasetId: string | DatasetQuery, query?: DatasetQuery, params?: DatasetQueryOptions | QueryOutputFormat): Promise<any>;
|
|
478
|
+
ingest(ingestMessage: IIngestMessage, params?: Record<string, any>): Promise<any>;
|
|
479
|
+
getExportUrl(datasetId: string, format: FileExportFormat): string;
|
|
480
|
+
subscribe(datasetId: string, cb: WebSocketSubscribeCallback): WebSocketUnsubscriber;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Copyright © 2018 Emu Analytics
|
|
485
|
+
*/
|
|
486
|
+
|
|
487
|
+
declare class JobEndpoints extends BaseEndpoints<IJob> {
|
|
488
|
+
constructor(client: Client);
|
|
489
|
+
submit(submission: IJobSubmission): Promise<IJob>;
|
|
490
|
+
getStatus(jobId: string): Promise<IJobStatus>;
|
|
491
|
+
setStatus(jobId: string, status: IJobStatus): Promise<IJob>;
|
|
492
|
+
cancel(jobId: string): Promise<IJob>;
|
|
493
|
+
request(jobType: string): Promise<IJob>;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Copyright © 2018 Emu Analytics
|
|
498
|
+
*/
|
|
499
|
+
|
|
500
|
+
declare class MapEndpoints {
|
|
501
|
+
private readonly client;
|
|
502
|
+
constructor(client: Client);
|
|
503
|
+
get(id: string, params?: Record<string, any>): Promise<IStyle>;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Copyright © 2018 Emu Analytics
|
|
508
|
+
*/
|
|
509
|
+
|
|
510
|
+
declare class MapLayerEndpoints extends BaseEndpoints<IMapLayer> {
|
|
511
|
+
constructor(client: Client);
|
|
512
|
+
subscribe(cb: WebSocketSubscribeCallback): WebSocketUnsubscriber;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Copyright © 2018-present Emu Analytics
|
|
517
|
+
*/
|
|
518
|
+
|
|
519
|
+
interface IMediaUploadRequest {
|
|
520
|
+
type: string;
|
|
521
|
+
mimeType?: string;
|
|
522
|
+
metadata?: IMetadata;
|
|
523
|
+
fileName: string;
|
|
524
|
+
data: any;
|
|
525
|
+
}
|
|
526
|
+
declare class MediaEndpoints extends BaseEndpoints<IMedia> {
|
|
527
|
+
constructor(client: Client);
|
|
528
|
+
upload(mediaId: string, request: IMediaUploadRequest, params?: Record<string, any>): Promise<IMedia>;
|
|
529
|
+
content(mediaId: string): Promise<any>;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* Copyright © 2018-present Emu Analytics
|
|
534
|
+
*/
|
|
535
|
+
|
|
536
|
+
declare class PipelineMetricEndpoints extends BaseEndpoints<IPipelineMetric> {
|
|
537
|
+
constructor(client: Client, pipelineId: string, componentId: string);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Copyright © 2018-present Emu Analytics
|
|
542
|
+
*/
|
|
543
|
+
|
|
544
|
+
declare class PipelineComponentEndpoints extends BaseEndpoints<IPipelineComponent> {
|
|
545
|
+
private pipelineId;
|
|
546
|
+
constructor(client: Client, pipelineId: string);
|
|
547
|
+
metrics(componentId: string): PipelineMetricEndpoints;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Copyright © 2018-present Emu Analytics
|
|
552
|
+
*/
|
|
553
|
+
|
|
554
|
+
declare class PipelineEndpoints extends BaseEndpoints<IPipeline> {
|
|
555
|
+
constructor(client: Client);
|
|
556
|
+
components(pipelineId: string): PipelineComponentEndpoints;
|
|
557
|
+
heartbeat(id: string, params?: Record<string, any>): Promise<void>;
|
|
558
|
+
publishMetrics(metrics: object, params?: Record<string, any>): Promise<void>;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Copyright © 2018 Emu Analytics
|
|
563
|
+
*/
|
|
564
|
+
|
|
565
|
+
declare class StyleEndpoints extends BaseEndpoints<IStyle> {
|
|
566
|
+
constructor(client: Client);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Copyright © 2018 Emu Analytics
|
|
571
|
+
*/
|
|
572
|
+
|
|
573
|
+
declare class TileSourceEndpoints extends BaseEndpoints<ITileSource> {
|
|
574
|
+
constructor(client: Client);
|
|
575
|
+
drivers(): Promise<string[]>;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Copyright © 2018 Emu Analytics
|
|
580
|
+
*/
|
|
581
|
+
|
|
582
|
+
declare class TileEndpoints {
|
|
583
|
+
private readonly client;
|
|
584
|
+
constructor(client: Client);
|
|
585
|
+
getTileSpec(tilesourceId: string, params?: Record<string, any>): Promise<ITileSpec>;
|
|
586
|
+
getPreviewStyle(tilesourceId: string, params?: Record<string, any>): Promise<ITileSpec>;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
interface UploadOptions {
|
|
590
|
+
data: any;
|
|
591
|
+
filename: string;
|
|
592
|
+
datasetId?: string;
|
|
593
|
+
datasetName?: string;
|
|
594
|
+
datasetDescription?: string;
|
|
595
|
+
attribution?: string;
|
|
596
|
+
sourceSrid?: number;
|
|
597
|
+
targetSrid?: number;
|
|
598
|
+
schema?: string;
|
|
599
|
+
metadata?: any;
|
|
600
|
+
abortController?: AbortController;
|
|
601
|
+
progress?: (event: any) => void;
|
|
602
|
+
}
|
|
603
|
+
declare class UploadEndpoints extends BaseEndpoints<IUpload> {
|
|
604
|
+
constructor(client: Client);
|
|
605
|
+
upload(options: UploadOptions, params?: Record<string, any>): Promise<IUpload>;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
/**
|
|
609
|
+
* Copyright © 2018 Emu Analytics
|
|
610
|
+
*/
|
|
611
|
+
|
|
612
|
+
type ClientOptions = WebSocketManagerOptions;
|
|
613
|
+
declare class Client {
|
|
614
|
+
baseUrl: string;
|
|
615
|
+
readonly apiKey: string | null;
|
|
616
|
+
private readonly axios;
|
|
617
|
+
readonly debug: Debug.Debugger;
|
|
618
|
+
webSocketGateway: WebSocketGateway;
|
|
619
|
+
accessToken: string | null;
|
|
620
|
+
auth: AuthEndpoints;
|
|
621
|
+
tiles: TileEndpoints;
|
|
622
|
+
maps: MapEndpoints;
|
|
623
|
+
apiKeys: ApiKeyEndpoints;
|
|
624
|
+
applications: ApplicationEndpoints;
|
|
625
|
+
appconfig: AppConfigEndpoints;
|
|
626
|
+
contactpoints: ContactPointEndpoints;
|
|
627
|
+
databases: DatabaseEndpoints;
|
|
628
|
+
datasets: DatasetEndpoints;
|
|
629
|
+
styles: StyleEndpoints;
|
|
630
|
+
tileSources: TileSourceEndpoints;
|
|
631
|
+
uploads: UploadEndpoints;
|
|
632
|
+
jobs: JobEndpoints;
|
|
633
|
+
maplayers: MapLayerEndpoints;
|
|
634
|
+
media: MediaEndpoints;
|
|
635
|
+
pipelines: PipelineEndpoints;
|
|
636
|
+
useRequestInterceptor(interceptor: (config: any) => any): number;
|
|
637
|
+
ejectRequestInterceptor(id: number): void;
|
|
638
|
+
constructor(baseUrl: string, apiKey?: string | null, options?: ClientOptions);
|
|
639
|
+
connect(): Promise<void>;
|
|
640
|
+
disconnect(): Promise<void>;
|
|
641
|
+
config(): Promise<IConfig>;
|
|
642
|
+
_get(path: string, options?: any): Promise<any>;
|
|
643
|
+
_post(path: string, data: object, options?: any): Promise<any>;
|
|
644
|
+
_put(path: string, data: object, options?: any): Promise<any>;
|
|
645
|
+
_delete(path: string, options?: any): Promise<any>;
|
|
646
|
+
_subscribe(channel: string, cb: WebSocketSubscribeCallback): WebSocketUnsubscriber;
|
|
647
|
+
_unsubscribe(channel: string, cb?: WebSocketUnsubscribeCallback): void;
|
|
648
|
+
/**
|
|
649
|
+
* Normalize errors
|
|
650
|
+
* Throws a new error based on type of input error
|
|
651
|
+
*
|
|
652
|
+
* @param {AxiosError} e
|
|
653
|
+
*/
|
|
654
|
+
private handleError;
|
|
655
|
+
private headers;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
/**
|
|
659
|
+
* Copyright © 2018 Emu Analytics
|
|
660
|
+
*/
|
|
661
|
+
declare class FlowEngineError extends Error {
|
|
662
|
+
error: object | null;
|
|
663
|
+
statusCode: number;
|
|
664
|
+
constructor(message: string, underlyingError?: Error | null, statusCode?: number);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
export { BaseEndpoints, Client, FlowEngineError, WebSocketChannel, WebSocketGateway };
|
|
668
|
+
export type { ClientOptions, FileExportFormat, IApiKey, IAppConfig, IApplication, IBaseResource, IConfig, IContactPoint, IContactPointSendRequest, IDatabase, IDataset, IDatasetAttribute, IIngestMessage, IJob, IJobRequest, IJobStatus, IJobSubmission, ILoginResponse, IMapLayer, IMedia, IMetadata, IPermissions, IPipeline, IPipelineComponent, IPipelineMetric, IQuery, IStyle, ITileSource, ITileSpec, ITokenRefreshResponse, IUpload, IUser, IngestAction, JobStatus, UsersMeResponse, WebSocketErrorResponse, WebSocketManagerOptions, WebSocketOkResponse, WebSocketPublishMessage, WebSocketResponse, WebSocketSubscribeCallback, WebSocketSubscribeMessage, WebSocketUnsubscribeCallback, WebSocketUnsubscriber };
|