@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
package/esm/index.js
ADDED
package/esm/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC","sourcesContent":["/**\n * Copyright © 2022 Emu Analytics\n */\n\nexport * from './lib/client';\nexport * from './lib/api-interfaces';\nexport * from './lib/errors';\n"]}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
export interface IQuery {
|
|
5
|
+
filter?: {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
8
|
+
attributes?: string | string[];
|
|
9
|
+
join?: string | string[];
|
|
10
|
+
limit?: number;
|
|
11
|
+
offset?: number;
|
|
12
|
+
sort?: string | string[];
|
|
13
|
+
}
|
|
14
|
+
export interface IBaseResource {
|
|
15
|
+
id: string;
|
|
16
|
+
}
|
|
17
|
+
export interface IMetadata {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}
|
|
20
|
+
export interface IPermissions {
|
|
21
|
+
[key: string]: {
|
|
22
|
+
[key: string]: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface IApiKey extends IBaseResource {
|
|
26
|
+
applicationId: string;
|
|
27
|
+
application?: IApplication;
|
|
28
|
+
id: string;
|
|
29
|
+
description: string;
|
|
30
|
+
type: 'app' | 'master';
|
|
31
|
+
permissions: IPermissions;
|
|
32
|
+
metadata: IMetadata;
|
|
33
|
+
userId: string;
|
|
34
|
+
createdAt: string;
|
|
35
|
+
updatedAt: string;
|
|
36
|
+
}
|
|
37
|
+
export interface IApplication extends IBaseResource {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
databases?: IDatabase[];
|
|
41
|
+
description: string;
|
|
42
|
+
contact: string;
|
|
43
|
+
metadata: IMetadata;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
updatedAt: string;
|
|
46
|
+
}
|
|
47
|
+
export interface IAppConfig extends IBaseResource {
|
|
48
|
+
applicationId: string;
|
|
49
|
+
config: object;
|
|
50
|
+
}
|
|
51
|
+
export interface IDatabase extends IBaseResource {
|
|
52
|
+
applicationId: string;
|
|
53
|
+
application?: IApplication;
|
|
54
|
+
id: string;
|
|
55
|
+
type: string;
|
|
56
|
+
name: string;
|
|
57
|
+
default: boolean;
|
|
58
|
+
description: string;
|
|
59
|
+
host: string;
|
|
60
|
+
port: number;
|
|
61
|
+
user: string;
|
|
62
|
+
password: string;
|
|
63
|
+
db: string;
|
|
64
|
+
createdAt: string;
|
|
65
|
+
updatedAt: string;
|
|
66
|
+
}
|
|
67
|
+
export interface IDatasetAttribute {
|
|
68
|
+
attribute: string;
|
|
69
|
+
type: string;
|
|
70
|
+
dbType: string;
|
|
71
|
+
isGeometry?: boolean;
|
|
72
|
+
srid?: number;
|
|
73
|
+
extent?: number[];
|
|
74
|
+
extentLngLat?: number[];
|
|
75
|
+
primaryKey?: boolean;
|
|
76
|
+
default?: string;
|
|
77
|
+
nullable?: boolean;
|
|
78
|
+
description?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface IDataset extends IBaseResource {
|
|
81
|
+
applicationId: string;
|
|
82
|
+
application?: IApplication;
|
|
83
|
+
id: string;
|
|
84
|
+
type: 'table' | 'sql';
|
|
85
|
+
source: string;
|
|
86
|
+
name: string;
|
|
87
|
+
databaseId: string;
|
|
88
|
+
database?: IDatabase;
|
|
89
|
+
description: string;
|
|
90
|
+
bytes: number;
|
|
91
|
+
metadata: IMetadata;
|
|
92
|
+
ownerId: string;
|
|
93
|
+
createdAt: string;
|
|
94
|
+
updatedAt: string;
|
|
95
|
+
attributes: IDatasetAttribute[];
|
|
96
|
+
options?: {
|
|
97
|
+
[key: string]: any;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export declare type FileExportFormat = 'geojson' | 'gpkg' | 'shapefile';
|
|
101
|
+
export interface ITileSource extends IBaseResource {
|
|
102
|
+
applicationId: string;
|
|
103
|
+
application?: IApplication;
|
|
104
|
+
metadata: IMetadata;
|
|
105
|
+
id: string;
|
|
106
|
+
type: string;
|
|
107
|
+
source: string;
|
|
108
|
+
attribution: string;
|
|
109
|
+
minZoom: number;
|
|
110
|
+
maxZoom: number;
|
|
111
|
+
headers: {
|
|
112
|
+
[key: string]: string;
|
|
113
|
+
};
|
|
114
|
+
extentLngLat: number[];
|
|
115
|
+
createdAt: string;
|
|
116
|
+
updatedAt: string;
|
|
117
|
+
}
|
|
118
|
+
export interface IUpload extends IBaseResource {
|
|
119
|
+
id: string;
|
|
120
|
+
fileName: string;
|
|
121
|
+
path: string;
|
|
122
|
+
options: {
|
|
123
|
+
name: string;
|
|
124
|
+
description?: string;
|
|
125
|
+
datasetId: string;
|
|
126
|
+
attribution?: string;
|
|
127
|
+
schema?: string;
|
|
128
|
+
};
|
|
129
|
+
size: number;
|
|
130
|
+
status: string;
|
|
131
|
+
error: {
|
|
132
|
+
message: string;
|
|
133
|
+
stdout: string;
|
|
134
|
+
stderr: string;
|
|
135
|
+
};
|
|
136
|
+
applicationId: string;
|
|
137
|
+
application?: IApplication;
|
|
138
|
+
ownerId: string;
|
|
139
|
+
updatedAt: string;
|
|
140
|
+
createdAt: string;
|
|
141
|
+
}
|
|
142
|
+
export interface IUser extends IBaseResource {
|
|
143
|
+
[key: string]: any;
|
|
144
|
+
}
|
|
145
|
+
export interface IStyle extends IBaseResource {
|
|
146
|
+
[key: string]: any;
|
|
147
|
+
}
|
|
148
|
+
export interface ITileSpec {
|
|
149
|
+
[key: string]: any;
|
|
150
|
+
}
|
|
151
|
+
export interface IConfig {
|
|
152
|
+
version: {
|
|
153
|
+
tag: string;
|
|
154
|
+
hash: string;
|
|
155
|
+
timestamp: number;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
export interface ILoginResponse {
|
|
159
|
+
accessToken: string;
|
|
160
|
+
refreshToken: string;
|
|
161
|
+
}
|
|
162
|
+
export interface ITokenRefreshResponse {
|
|
163
|
+
accessToken: string;
|
|
164
|
+
}
|
|
165
|
+
export interface UsersMeResponse {
|
|
166
|
+
applicationId: string;
|
|
167
|
+
email: string;
|
|
168
|
+
firstName: string;
|
|
169
|
+
id: string;
|
|
170
|
+
lastName: string;
|
|
171
|
+
metadata: object;
|
|
172
|
+
roles: string[];
|
|
173
|
+
}
|
|
174
|
+
export declare type JobStatus = 'pending' | 'processing' | 'done' | 'cancelled' | 'error';
|
|
175
|
+
export interface IJob {
|
|
176
|
+
id: string;
|
|
177
|
+
applicationId: string;
|
|
178
|
+
ownerId?: string;
|
|
179
|
+
metadata: IMetadata;
|
|
180
|
+
type: string;
|
|
181
|
+
name?: string;
|
|
182
|
+
description?: string;
|
|
183
|
+
params: any;
|
|
184
|
+
status: JobStatus;
|
|
185
|
+
error?: object;
|
|
186
|
+
progress?: number;
|
|
187
|
+
progressText?: string;
|
|
188
|
+
datasetId?: string;
|
|
189
|
+
createdAt: string;
|
|
190
|
+
updatedAt: string;
|
|
191
|
+
}
|
|
192
|
+
export interface IJobStatus {
|
|
193
|
+
status?: JobStatus;
|
|
194
|
+
error?: object;
|
|
195
|
+
progress?: number;
|
|
196
|
+
progressText?: string;
|
|
197
|
+
}
|
|
198
|
+
export interface IJobSubmission {
|
|
199
|
+
type: string;
|
|
200
|
+
name?: string;
|
|
201
|
+
description?: string;
|
|
202
|
+
params: any;
|
|
203
|
+
}
|
|
204
|
+
export interface IJobRequest {
|
|
205
|
+
type: string;
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=api-interfaces.d.ts.map
|
|
@@ -0,0 +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,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,SAAS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CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,GAAG,CAAC;CACb;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +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"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
import { Client } from './client';
|
|
5
|
+
import { BaseEndpoints } from './base.endpoints';
|
|
6
|
+
import { IApiKey } from './api-interfaces';
|
|
7
|
+
export declare class ApiKeyEndpoints extends BaseEndpoints<IApiKey> {
|
|
8
|
+
constructor(client: Client);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=apikey.endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apikey.endpoints.d.ts","sourceRoot":"","sources":["../../src/lib/apikey.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,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,qBAAa,eAAgB,SAAQ,aAAa,CAAC,OAAO,CAAC;gBAC7C,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 ApiKeyEndpoints = /** @class */ (function (_super) {
|
|
21
|
+
__extends(ApiKeyEndpoints, _super);
|
|
22
|
+
function ApiKeyEndpoints(client) {
|
|
23
|
+
return _super.call(this, client, 'apikeys') || this;
|
|
24
|
+
}
|
|
25
|
+
return ApiKeyEndpoints;
|
|
26
|
+
}(BaseEndpoints));
|
|
27
|
+
export { ApiKeyEndpoints };
|
|
28
|
+
//# sourceMappingURL=apikey.endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apikey.endpoints.js","sourceRoot":"","sources":["../../src/lib/apikey.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;;;;;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD;IAAqC,mCAAsB;IACzD,yBAAY,MAAc;eACxB,kBAAM,MAAM,EAAE,SAAS,CAAC;IAC1B,CAAC;IACH,sBAAC;AAAD,CAAC,AAJD,CAAqC,aAAa,GAIjD","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { Client } from './client';\nimport { BaseEndpoints } from './base.endpoints';\nimport { IApiKey } from './api-interfaces';\n\nexport class ApiKeyEndpoints extends BaseEndpoints<IApiKey> {\n constructor(client: Client) {\n super(client, 'apikeys');\n }\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
import { Client } from './client';
|
|
5
|
+
import { IAppConfig } from './api-interfaces';
|
|
6
|
+
import { BaseEndpoints } from './base.endpoints';
|
|
7
|
+
export declare class AppConfigEndpoints extends BaseEndpoints<IAppConfig> {
|
|
8
|
+
constructor(client: Client);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=appconfig.endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appconfig.endpoints.d.ts","sourceRoot":"","sources":["../../src/lib/appconfig.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBAAa,kBAAmB,SAAQ,aAAa,CAAC,UAAU,CAAC;gBACnD,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 AppConfigEndpoints = /** @class */ (function (_super) {
|
|
21
|
+
__extends(AppConfigEndpoints, _super);
|
|
22
|
+
function AppConfigEndpoints(client) {
|
|
23
|
+
return _super.call(this, client, 'appconfig') || this;
|
|
24
|
+
}
|
|
25
|
+
return AppConfigEndpoints;
|
|
26
|
+
}(BaseEndpoints));
|
|
27
|
+
export { AppConfigEndpoints };
|
|
28
|
+
//# sourceMappingURL=appconfig.endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appconfig.endpoints.js","sourceRoot":"","sources":["../../src/lib/appconfig.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;;;;;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;IAAwC,sCAAyB;IAC/D,4BAAY,MAAc;eACxB,kBAAM,MAAM,EAAE,WAAW,CAAC;IAC5B,CAAC;IACH,yBAAC;AAAD,CAAC,AAJD,CAAwC,aAAa,GAIpD","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { Client } from './client';\nimport { IAppConfig } from './api-interfaces';\nimport { BaseEndpoints } from './base.endpoints';\n\nexport class AppConfigEndpoints extends BaseEndpoints<IAppConfig> {\n constructor(client: Client) {\n super(client, 'appconfig');\n }\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
import { Client } from './client';
|
|
5
|
+
import { BaseEndpoints } from './base.endpoints';
|
|
6
|
+
import { IApplication } from './api-interfaces';
|
|
7
|
+
export declare class ApplicationEndpoints extends BaseEndpoints<IApplication> {
|
|
8
|
+
constructor(client: Client);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=application.endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.endpoints.d.ts","sourceRoot":"","sources":["../../src/lib/application.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,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,qBAAa,oBAAqB,SAAQ,aAAa,CAAC,YAAY,CAAC;gBACvD,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 ApplicationEndpoints = /** @class */ (function (_super) {
|
|
21
|
+
__extends(ApplicationEndpoints, _super);
|
|
22
|
+
function ApplicationEndpoints(client) {
|
|
23
|
+
return _super.call(this, client, 'applications') || this;
|
|
24
|
+
}
|
|
25
|
+
return ApplicationEndpoints;
|
|
26
|
+
}(BaseEndpoints));
|
|
27
|
+
export { ApplicationEndpoints };
|
|
28
|
+
//# sourceMappingURL=application.endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.endpoints.js","sourceRoot":"","sources":["../../src/lib/application.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;;;;;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD;IAA0C,wCAA2B;IACnE,8BAAY,MAAc;eACxB,kBAAM,MAAM,EAAE,cAAc,CAAC;IAC/B,CAAC;IACH,2BAAC;AAAD,CAAC,AAJD,CAA0C,aAAa,GAItD","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { Client } from './client';\nimport { BaseEndpoints } from './base.endpoints';\nimport { IApplication } from './api-interfaces';\n\nexport class ApplicationEndpoints extends BaseEndpoints<IApplication> {\n constructor(client: Client) {\n super(client, 'applications');\n }\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
import { Client } from './client';
|
|
5
|
+
import { UserEndpoint } from './user.endpoints';
|
|
6
|
+
import { ILoginResponse, ITokenRefreshResponse } from './api-interfaces';
|
|
7
|
+
export declare class AuthEndpoints {
|
|
8
|
+
private readonly client;
|
|
9
|
+
users: UserEndpoint;
|
|
10
|
+
constructor(client: Client);
|
|
11
|
+
login(email: string, password: string, applicationId?: string): Promise<ILoginResponse>;
|
|
12
|
+
logout(accessToken: string, refreshToken: string): Promise<void>;
|
|
13
|
+
refresh(refreshToken: string, applicationId: string): Promise<ITokenRefreshResponse>;
|
|
14
|
+
changePassword(password: string, newPassword: string, token: string): Promise<void>;
|
|
15
|
+
signUp(firstName: string, lastName: string, email: string, password: string, applicationId: string, redirectUrl: string): Promise<void>;
|
|
16
|
+
requestPasswordReset(email: string, applicationId: string, redirectUrl: string): Promise<void>;
|
|
17
|
+
resetPassword(email: string, password: string, applicationId: string, token: string): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=auth.edpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.edpoints.d.ts","sourceRoot":"","sources":["../../src/lib/auth.edpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzE,qBAAa,aAAa;IAGZ,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,KAAK,eAAiC;gBAET,MAAM,EAAE,MAAM;IAE3C,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAIvF,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUhE,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAIpF,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAanF,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAYhB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9F,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGpG"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
import { UserEndpoint } from './user.endpoints';
|
|
5
|
+
var AuthEndpoints = /** @class */ (function () {
|
|
6
|
+
function AuthEndpoints(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
this.users = new UserEndpoint(this.client);
|
|
9
|
+
}
|
|
10
|
+
AuthEndpoints.prototype.login = function (email, password, applicationId) {
|
|
11
|
+
return this.client._post('/api/v1/auth/login', { email: email, password: password, applicationId: applicationId });
|
|
12
|
+
};
|
|
13
|
+
AuthEndpoints.prototype.logout = function (accessToken, refreshToken) {
|
|
14
|
+
return this.client._post('/api/v1/auth/logout', { refreshToken: refreshToken }, {
|
|
15
|
+
headers: { Authorization: "Bearer ".concat(accessToken) }
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
AuthEndpoints.prototype.refresh = function (refreshToken, applicationId) {
|
|
19
|
+
return this.client._post('/api/v1/auth/refresh', { refreshToken: refreshToken, applicationId: applicationId });
|
|
20
|
+
};
|
|
21
|
+
AuthEndpoints.prototype.changePassword = function (password, newPassword, token) {
|
|
22
|
+
return this.client._post('/api/v1/auth/changepassword', {
|
|
23
|
+
password: password,
|
|
24
|
+
newPassword: newPassword
|
|
25
|
+
}, {
|
|
26
|
+
headers: { Authorization: "Bearer ".concat(token) }
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
AuthEndpoints.prototype.signUp = function (firstName, lastName, email, password, applicationId, redirectUrl) {
|
|
30
|
+
return this.client._post('/api/v1/auth/signup', {
|
|
31
|
+
firstName: firstName,
|
|
32
|
+
lastName: lastName,
|
|
33
|
+
email: email,
|
|
34
|
+
password: password,
|
|
35
|
+
applicationId: applicationId,
|
|
36
|
+
confirmUrl: "".concat(this.client.baseUrl, "/api/v1/auth/confirmsignup"),
|
|
37
|
+
redirectUrl: redirectUrl
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
AuthEndpoints.prototype.requestPasswordReset = function (email, applicationId, redirectUrl) {
|
|
41
|
+
return this.client._post('/api/v1/auth/requestpasswordreset', { email: email, applicationId: applicationId, redirectUrl: redirectUrl });
|
|
42
|
+
};
|
|
43
|
+
AuthEndpoints.prototype.resetPassword = function (email, password, applicationId, token) {
|
|
44
|
+
return this.client._post('/api/v1/auth/resetpassword', { email: email, password: password, applicationId: applicationId, token: token });
|
|
45
|
+
};
|
|
46
|
+
return AuthEndpoints;
|
|
47
|
+
}());
|
|
48
|
+
export { AuthEndpoints };
|
|
49
|
+
//# sourceMappingURL=auth.edpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.edpoints.js","sourceRoot":"","sources":["../../src/lib/auth.edpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD;IAGE,uBAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAF3C,UAAK,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEQ,CAAC;IAE/C,6BAAK,GAAL,UAAM,KAAa,EAAE,QAAgB,EAAE,aAAsB;QAC3D,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,EAAE,EAAE,KAAK,OAAA,EAAE,QAAQ,UAAA,EAAE,aAAa,eAAA,EAAE,CAAC,CAAC;IACrF,CAAC;IAED,8BAAM,GAAN,UAAO,WAAmB,EAAE,YAAoB;QAC9C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,KAAa;QACjF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE,EAAE,KAAK,OAAA,EAAE,QAAQ,UAAA,EAAE,aAAa,eAAA,EAAE,KAAK,OAAA,EAAE,CAAC,CAAC;IACpG,CAAC;IACH,oBAAC;AAAD,CAAC,AA9DD,IA8DC","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { Client } from './client';\nimport { UserEndpoint } from './user.endpoints';\nimport { ILoginResponse, ITokenRefreshResponse } from './api-interfaces';\n\nexport class AuthEndpoints {\n users = new UserEndpoint(this.client);\n\n constructor(private readonly client: Client) {}\n\n login(email: string, password: string, applicationId?: string): Promise<ILoginResponse> {\n return this.client._post('/api/v1/auth/login', { email, password, applicationId });\n }\n\n logout(accessToken: string, refreshToken: string): Promise<void> {\n return this.client._post(\n '/api/v1/auth/logout',\n { refreshToken },\n {\n headers: { Authorization: `Bearer ${accessToken}` }\n }\n );\n }\n\n refresh(refreshToken: string, applicationId: string): Promise<ITokenRefreshResponse> {\n return this.client._post('/api/v1/auth/refresh', { refreshToken, applicationId });\n }\n\n changePassword(password: string, newPassword: string, token: string): Promise<void> {\n return this.client._post(\n '/api/v1/auth/changepassword',\n {\n password,\n newPassword\n },\n {\n headers: { Authorization: `Bearer ${token}` }\n }\n );\n }\n\n signUp(\n firstName: string,\n lastName: string,\n email: string,\n password: string,\n applicationId: string,\n redirectUrl: string\n ): Promise<void> {\n return this.client._post('/api/v1/auth/signup', {\n firstName,\n lastName,\n email,\n password,\n applicationId,\n confirmUrl: `${this.client.baseUrl}/api/v1/auth/confirmsignup`,\n redirectUrl\n });\n }\n\n requestPasswordReset(email: string, applicationId: string, redirectUrl: string): Promise<void> {\n return this.client._post('/api/v1/auth/requestpasswordreset', { email, applicationId, redirectUrl });\n }\n\n resetPassword(email: string, password: string, applicationId: string, token: string): Promise<void> {\n return this.client._post('/api/v1/auth/resetpassword', { email, password, applicationId, token });\n }\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
import { Client } from './client';
|
|
5
|
+
import { IBaseResource, IQuery } from './api-interfaces';
|
|
6
|
+
export declare class BaseEndpoints<T extends IBaseResource> {
|
|
7
|
+
protected readonly client: Client;
|
|
8
|
+
private readonly resourcePath;
|
|
9
|
+
constructor(client: Client, resourcePath: string);
|
|
10
|
+
protected get resourceEndpoint(): string;
|
|
11
|
+
list(params?: IQuery): Promise<T[]>;
|
|
12
|
+
get(id: string, params?: Record<string, any>): Promise<T>;
|
|
13
|
+
create(data: Partial<T>, params?: Record<string, any>): Promise<T>;
|
|
14
|
+
update(id: string, data: Partial<T>, params?: Record<string, any>): Promise<T>;
|
|
15
|
+
delete(id: string, params?: Record<string, any>): Promise<any>;
|
|
16
|
+
getMetadata(id: string, key?: string, params?: Record<string, any>): Promise<any>;
|
|
17
|
+
setMetadata(id: string, key: string, value: any, params?: Record<string, any>): Promise<any>;
|
|
18
|
+
deleteMetadata(id: string, key: string, params?: Record<string, any>): Promise<any>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=base.endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.endpoints.d.ts","sourceRoot":"","sources":["../../src/lib/base.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEzD,qBAAa,aAAa,CAAC,CAAC,SAAS,aAAa;IACpC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM;IAAE,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAA7C,MAAM,EAAE,MAAM,EAAmB,YAAY,EAAE,MAAM;IAEpF,SAAS,KAAK,gBAAgB,IAAI,MAAM,CAEvC;IAED,IAAI,CAAC,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
|
|
7
|
+
this.resourcePath = resourcePath;
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(BaseEndpoints.prototype, "resourceEndpoint", {
|
|
10
|
+
get: function () {
|
|
11
|
+
return "/api/v1/".concat(this.resourcePath);
|
|
12
|
+
},
|
|
13
|
+
enumerable: false,
|
|
14
|
+
configurable: true
|
|
15
|
+
});
|
|
16
|
+
BaseEndpoints.prototype.list = function (params) {
|
|
17
|
+
// Reformat filter for query string
|
|
18
|
+
if (params === null || params === void 0 ? void 0 : params.filter) {
|
|
19
|
+
var filter_1 = params.filter;
|
|
20
|
+
Object.keys(filter_1).forEach(function (key) {
|
|
21
|
+
params["filter[".concat(key, "]")] = filter_1[key];
|
|
22
|
+
});
|
|
23
|
+
delete params.filter;
|
|
24
|
+
}
|
|
25
|
+
return this.client._get(this.resourceEndpoint, { params: params });
|
|
26
|
+
};
|
|
27
|
+
BaseEndpoints.prototype.get = function (id, params) {
|
|
28
|
+
if (params === void 0) { params = {}; }
|
|
29
|
+
return this.client._get("".concat(this.resourceEndpoint, "/").concat(id), { params: params });
|
|
30
|
+
};
|
|
31
|
+
BaseEndpoints.prototype.create = function (data, params) {
|
|
32
|
+
if (params === void 0) { params = {}; }
|
|
33
|
+
return this.client._post("".concat(this.resourceEndpoint), data, { params: params });
|
|
34
|
+
};
|
|
35
|
+
BaseEndpoints.prototype.update = function (id, data, params) {
|
|
36
|
+
if (params === void 0) { params = {}; }
|
|
37
|
+
return this.client._put("".concat(this.resourceEndpoint, "/").concat(id), data, { params: params });
|
|
38
|
+
};
|
|
39
|
+
BaseEndpoints.prototype.delete = function (id, params) {
|
|
40
|
+
if (params === void 0) { params = {}; }
|
|
41
|
+
return this.client._delete("".concat(this.resourceEndpoint, "/").concat(id), { params: params });
|
|
42
|
+
};
|
|
43
|
+
BaseEndpoints.prototype.getMetadata = function (id, key, params) {
|
|
44
|
+
if (params === void 0) { params = {}; }
|
|
45
|
+
var endpoint = key
|
|
46
|
+
? "".concat(this.resourceEndpoint, "/").concat(id, "/metadata/").concat(key)
|
|
47
|
+
: "".concat(this.resourceEndpoint, "/").concat(id, "/metadata");
|
|
48
|
+
return this.client._get(endpoint, { params: params });
|
|
49
|
+
};
|
|
50
|
+
BaseEndpoints.prototype.setMetadata = function (id, key, value, params) {
|
|
51
|
+
if (params === void 0) { params = {}; }
|
|
52
|
+
return this.client._put("".concat(this.resourceEndpoint, "/").concat(id, "/metadata/").concat(key), value, {
|
|
53
|
+
headers: {
|
|
54
|
+
'Content-Type': 'application/json'
|
|
55
|
+
},
|
|
56
|
+
params: params
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
BaseEndpoints.prototype.deleteMetadata = function (id, key, params) {
|
|
60
|
+
if (params === void 0) { params = {}; }
|
|
61
|
+
return this.client._delete("".concat(this.resourceEndpoint, "/").concat(id, "/metadata/").concat(key), {
|
|
62
|
+
headers: {
|
|
63
|
+
'Content-Type': 'application/json'
|
|
64
|
+
},
|
|
65
|
+
params: params
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
return BaseEndpoints;
|
|
69
|
+
}());
|
|
70
|
+
export { BaseEndpoints };
|
|
71
|
+
//# sourceMappingURL=base.endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.endpoints.js","sourceRoot":"","sources":["../../src/lib/base.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;IACE,uBAA+B,MAAc,EAAmB,YAAoB;QAArD,WAAM,GAAN,MAAM,CAAQ;QAAmB,iBAAY,GAAZ,YAAY,CAAQ;IAAG,CAAC;IAExF,sBAAc,2CAAgB;aAA9B;YACE,OAAO,kBAAW,IAAI,CAAC,YAAY,CAAE,CAAC;QACxC,CAAC;;;OAAA;IAED,4BAAI,GAAJ,UAAK,MAAe;QAClB,mCAAmC;QACnC,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,EAAE;YAClB,IAAM,QAAM,GAAG,MAAM,CAAC,MAAM,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AAC;IAC3E,CAAC;IAED,mCAAW,GAAX,UAAY,EAAU,EAAE,GAAY,EAAE,MAAgC;QAAhC,uBAAA,EAAA,WAAgC;QACpE,IAAM,QAAQ,GAAG,GAAG;YAClB,CAAC,CAAC,UAAG,IAAI,CAAC,gBAAgB,cAAI,EAAE,uBAAa,GAAG,CAAE;YAClD,CAAC,CAAC,UAAG,IAAI,CAAC,gBAAgB,cAAI,EAAE,cAAW,CAAC;QAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,MAAM,QAAA,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,mCAAW,GAAX,UAAY,EAAU,EAAE,GAAW,EAAE,KAAU,EAAE,MAAgC;QAAhC,uBAAA,EAAA,WAAgC;QAC/E,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAG,IAAI,CAAC,gBAAgB,cAAI,EAAE,uBAAa,GAAG,CAAE,EAAE,KAAK,EAAE;YAC/E,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;YACD,MAAM,QAAA;SACP,CAAC,CAAC;IACL,CAAC;IAED,sCAAc,GAAd,UAAe,EAAU,EAAE,GAAW,EAAE,MAAgC;QAAhC,uBAAA,EAAA,WAAgC;QACtE,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAG,IAAI,CAAC,gBAAgB,cAAI,EAAE,uBAAa,GAAG,CAAE,EAAE;YAC3E,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;YACD,MAAM,QAAA;SACP,CAAC,CAAC;IACL,CAAC;IACH,oBAAC;AAAD,CAAC,AA5DD,IA4DC","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { Client } from './client';\nimport { IBaseResource, IQuery } from './api-interfaces';\n\nexport class BaseEndpoints<T extends IBaseResource> {\n constructor(protected readonly client: Client, private readonly resourcePath: string) {}\n\n protected get resourceEndpoint(): string {\n return `/api/v1/${this.resourcePath}`;\n }\n\n list(params?: IQuery): Promise<T[]> {\n // Reformat filter for query string\n if (params?.filter) {\n const filter = params.filter;\n Object.keys(filter).forEach(key => {\n (params as any)[`filter[${key}]`] = filter[key];\n });\n delete params.filter;\n }\n\n return this.client._get(this.resourceEndpoint, { params });\n }\n\n get(id: string, params: Record<string, any> = {}): Promise<T> {\n return this.client._get(`${this.resourceEndpoint}/${id}`, { params });\n }\n\n create(data: Partial<T>, params: Record<string, any> = {}): Promise<T> {\n return this.client._post(`${this.resourceEndpoint}`, data, { params });\n }\n\n update(id: string, data: Partial<T>, params: Record<string, any> = {}): Promise<T> {\n return this.client._put(`${this.resourceEndpoint}/${id}`, data, { params });\n }\n\n delete(id: string, params: Record<string, any> = {}) {\n return this.client._delete(`${this.resourceEndpoint}/${id}`, { params });\n }\n\n getMetadata(id: string, key?: string, params: Record<string, any> = {}): Promise<any> {\n const endpoint = key\n ? `${this.resourceEndpoint}/${id}/metadata/${key}`\n : `${this.resourceEndpoint}/${id}/metadata`;\n return this.client._get(endpoint, { params });\n }\n\n setMetadata(id: string, key: string, value: any, params: Record<string, any> = {}): Promise<any> {\n return this.client._put(`${this.resourceEndpoint}/${id}/metadata/${key}`, value, {\n headers: {\n 'Content-Type': 'application/json'\n },\n params\n });\n }\n\n deleteMetadata(id: string, key: string, params: Record<string, any> = {}): Promise<any> {\n return this.client._delete(`${this.resourceEndpoint}/${id}/metadata/${key}`, {\n headers: {\n 'Content-Type': 'application/json'\n },\n params\n });\n }\n}\n"]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2018 Emu Analytics
|
|
3
|
+
*/
|
|
4
|
+
import { AuthEndpoints } from './auth.edpoints';
|
|
5
|
+
import { IConfig } from './api-interfaces';
|
|
6
|
+
import { TileEndpoints } from './tile.endpoints';
|
|
7
|
+
import { StyleEndpoints } from './style.endpoint';
|
|
8
|
+
import { MapEndpoints } from './map.endoints';
|
|
9
|
+
import { ApiKeyEndpoints } from './apikey.endpoints';
|
|
10
|
+
import { ApplicationEndpoints } from './application.endpoints';
|
|
11
|
+
import { DatabaseEndpoints } from './database.endpoints';
|
|
12
|
+
import { DatasetEndpoints } from './dataset.endpoints';
|
|
13
|
+
import { TileSourceEndpoints } from './tile-source.endpoints';
|
|
14
|
+
import { UploadEndpoints } from './upload.endpoints';
|
|
15
|
+
import { AppConfigEndpoints } from './appconfig.endpoints';
|
|
16
|
+
import { JobEndpoints } from './job.endpoints';
|
|
17
|
+
export declare class Client {
|
|
18
|
+
baseUrl: string;
|
|
19
|
+
readonly apiKey: string | null;
|
|
20
|
+
private readonly axios;
|
|
21
|
+
accessToken: string | null;
|
|
22
|
+
auth: AuthEndpoints;
|
|
23
|
+
tiles: TileEndpoints;
|
|
24
|
+
maps: MapEndpoints;
|
|
25
|
+
apiKeys: ApiKeyEndpoints;
|
|
26
|
+
applications: ApplicationEndpoints;
|
|
27
|
+
appconfig: AppConfigEndpoints;
|
|
28
|
+
databases: DatabaseEndpoints;
|
|
29
|
+
datasets: DatasetEndpoints;
|
|
30
|
+
styles: StyleEndpoints;
|
|
31
|
+
tileSources: TileSourceEndpoints;
|
|
32
|
+
uploads: UploadEndpoints;
|
|
33
|
+
jobs: JobEndpoints;
|
|
34
|
+
constructor(baseUrl: string, apiKey?: string | null);
|
|
35
|
+
config(): Promise<IConfig>;
|
|
36
|
+
_get(path: string, options?: any): Promise<any>;
|
|
37
|
+
_post(path: string, data: object, options?: any): Promise<any>;
|
|
38
|
+
_put(path: string, data: object, options?: any): Promise<any>;
|
|
39
|
+
_delete(path: string, options?: any): Promise<any>;
|
|
40
|
+
/**
|
|
41
|
+
* Normalize errors
|
|
42
|
+
* Throws a new error based on type of input error
|
|
43
|
+
*
|
|
44
|
+
* @param {AxiosError} e
|
|
45
|
+
*/
|
|
46
|
+
private handleError;
|
|
47
|
+
private headers;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=client.d.ts.map
|