@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/cjs/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright © 2022 Emu Analytics
|
|
4
|
-
*/
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
__exportStar(require("./lib/client"), exports);
|
|
21
|
-
__exportStar(require("./lib/api-interfaces"), exports);
|
|
22
|
-
__exportStar(require("./lib/base.endpoints"), exports);
|
|
23
|
-
__exportStar(require("./lib/errors"), exports);
|
|
24
|
-
__exportStar(require("./lib/web-socket-gateway"), exports);
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,+CAA6B;AAC7B,uDAAqC;AACrC,uDAAqC;AACrC,+CAA6B;AAC7B,2DAAyC","sourcesContent":["/**\n * Copyright © 2022 Emu Analytics\n */\n\nexport * from './lib/client';\nexport * from './lib/api-interfaces';\nexport * from './lib/base.endpoints';\nexport * from './lib/errors';\nexport * from './lib/web-socket-gateway';\n"]}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.Client = void 0;
|
|
15
|
-
var client_1 = require("../client");
|
|
16
|
-
client_1.Client.prototype._get = function (path, options) {
|
|
17
|
-
var _a;
|
|
18
|
-
if (options === void 0) { options = {}; }
|
|
19
|
-
// Move apiKey from params
|
|
20
|
-
if ((_a = options.params) === null || _a === void 0 ? void 0 : _a.apiKey) {
|
|
21
|
-
options.apiKey = options.params.apiKey;
|
|
22
|
-
delete options.params.apiKey;
|
|
23
|
-
}
|
|
24
|
-
return __assign(__assign({ method: 'get', url: path }, options), this.headers(options));
|
|
25
|
-
};
|
|
26
|
-
client_1.Client.prototype._post = function (path, data, options) {
|
|
27
|
-
var _a;
|
|
28
|
-
if (options === void 0) { options = {}; }
|
|
29
|
-
// Move apiKey from params
|
|
30
|
-
if ((_a = options.params) === null || _a === void 0 ? void 0 : _a.apiKey) {
|
|
31
|
-
options.apiKey = options.params.apiKey;
|
|
32
|
-
delete options.params.apiKey;
|
|
33
|
-
}
|
|
34
|
-
return __assign(__assign({ method: 'post', url: path, data: data }, options), this.headers(options));
|
|
35
|
-
};
|
|
36
|
-
client_1.Client.prototype._put = function (path, data, options) {
|
|
37
|
-
var _a;
|
|
38
|
-
if (options === void 0) { options = {}; }
|
|
39
|
-
// Move apiKey from params
|
|
40
|
-
if ((_a = options.params) === null || _a === void 0 ? void 0 : _a.apiKey) {
|
|
41
|
-
options.apiKey = options.params.apiKey;
|
|
42
|
-
delete options.params.apiKey;
|
|
43
|
-
}
|
|
44
|
-
return __assign(__assign({ method: 'put', url: path, data: data }, options), this.headers(options));
|
|
45
|
-
};
|
|
46
|
-
client_1.Client.prototype._delete = function (path, options) {
|
|
47
|
-
var _a;
|
|
48
|
-
if (options === void 0) { options = {}; }
|
|
49
|
-
// Move apiKey from params
|
|
50
|
-
if ((_a = options.params) === null || _a === void 0 ? void 0 : _a.apiKey) {
|
|
51
|
-
options.apiKey = options.params.apiKey;
|
|
52
|
-
delete options.params.apiKey;
|
|
53
|
-
}
|
|
54
|
-
return __assign(__assign({ method: 'delete', url: path }, options), this.headers(options));
|
|
55
|
-
};
|
|
56
|
-
exports.Client = client_1.Client;
|
|
57
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/lib/__mocks__/client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oCAAiD;AAEjD,eAAU,CAAC,SAAS,CAAC,IAAI,GAAG,UAAS,IAAY,EAAE,OAAiB;;IAAjB,wBAAA,EAAA,YAAiB;IAClE,0BAA0B;IAC1B,IAAI,MAAA,OAAO,CAAC,MAAM,0CAAE,MAAM,EAAE,CAAC;QAC3B,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;QACvC,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;IAC/B,CAAC;IAED,2BACE,MAAM,EAAE,KAAK,EACb,GAAG,EAAE,IAAI,IACN,OAAO,GACN,IAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EACjC;AACJ,CAAC,CAAC;AAEF,eAAU,CAAC,SAAS,CAAC,KAAK,GAAG,UAAS,IAAY,EAAE,IAAY,EAAE,OAAiB;;IAAjB,wBAAA,EAAA,YAAiB;IACjF,0BAA0B;IAC1B,IAAI,MAAA,OAAO,CAAC,MAAM,0CAAE,MAAM,EAAE,CAAC;QAC3B,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;QACvC,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;IAC/B,CAAC;IAED,2BACE,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,IAAI,EACT,IAAI,MAAA,IACD,OAAO,GACN,IAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EACjC;AACJ,CAAC,CAAC;AAEF,eAAU,CAAC,SAAS,CAAC,IAAI,GAAG,UAAS,IAAY,EAAE,IAAY,EAAE,OAAiB;;IAAjB,wBAAA,EAAA,YAAiB;IAChF,0BAA0B;IAC1B,IAAI,MAAA,OAAO,CAAC,MAAM,0CAAE,MAAM,EAAE,CAAC;QAC3B,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;QACvC,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;IAC/B,CAAC;IAED,2BACE,MAAM,EAAE,KAAK,EACb,GAAG,EAAE,IAAI,EACT,IAAI,MAAA,IACD,OAAO,GACN,IAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EACjC;AACJ,CAAC,CAAC;AAEF,eAAU,CAAC,SAAS,CAAC,OAAO,GAAG,UAAS,IAAY,EAAE,OAAiB;;IAAjB,wBAAA,EAAA,YAAiB;IACrE,0BAA0B;IAC1B,IAAI,MAAA,OAAO,CAAC,MAAM,0CAAE,MAAM,EAAE,CAAC;QAC3B,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;QACvC,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;IAC/B,CAAC;IAED,2BACE,MAAM,EAAE,QAAQ,EAChB,GAAG,EAAE,IAAI,IACN,OAAO,GACN,IAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EACjC;AACJ,CAAC,CAAC;AAEW,QAAA,MAAM,GAAG,eAAU,CAAC","sourcesContent":["import { Client as MockClient } from '../client';\n\nMockClient.prototype._get = function(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 {\n method: 'get',\n url: path,\n ...options,\n ...(this as any).headers(options)\n };\n};\n\nMockClient.prototype._post = function(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 {\n method: 'post',\n url: path,\n data,\n ...options,\n ...(this as any).headers(options)\n };\n};\n\nMockClient.prototype._put = function(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 {\n method: 'put',\n url: path,\n data,\n ...options,\n ...(this as any).headers(options)\n };\n};\n\nMockClient.prototype._delete = function(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 {\n method: 'delete',\n url: path,\n ...options,\n ...(this as any).headers(options)\n };\n};\n\nexport const Client = MockClient;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api-interfaces.js","sourceRoot":"","sources":["../../../src/lib/api-interfaces.ts"],"names":[],"mappings":";AAAA;;GAEG","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nexport interface IQuery {\n filter?: { [key: string]: any };\n attributes?: string | string[];\n join?: string | string[];\n limit?: number;\n offset?: number;\n sort?: string | string[];\n}\n\nexport interface IBaseResource {\n id: string;\n}\n\nexport interface IMetadata {\n [key: string]: any;\n}\n\nexport interface IPermissions {\n [key: string]: { [key: string]: string };\n}\n\nexport interface IApiKey extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n id: string;\n description: string;\n type: 'app' | 'master';\n permissions: IPermissions;\n metadata: IMetadata;\n userId: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IApplication extends IBaseResource {\n id: string;\n name: string;\n databases?: IDatabase[];\n description: string;\n contact: string;\n metadata: IMetadata;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IAppConfig extends IBaseResource {\n applicationId: string;\n config: object;\n}\n\nexport interface IDatabase extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n id: string;\n type: string;\n name: string;\n default: boolean;\n description: string;\n host: string;\n port: number;\n user: string;\n password: string;\n db: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IDatasetAttribute {\n attribute: string;\n type: string;\n dbType: string;\n isGeometry?: boolean;\n srid?: number;\n extent?: number[];\n extentLngLat?: number[];\n primaryKey?: boolean;\n default?: string;\n nullable?: boolean;\n description?: string;\n}\n\nexport interface IDataset extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n id: string;\n type: 'table' | 'sql';\n source: string;\n name: string;\n databaseId: string;\n database?: IDatabase;\n description: string;\n bytes: number;\n metadata: IMetadata;\n ownerId: string;\n createdAt: string;\n updatedAt: string;\n attributes: IDatasetAttribute[];\n options?: { [key: string]: any };\n}\nexport interface IMapLayer extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n ownerId: string;\n createdAt: string;\n updatedAt: string;\n\n id: string;\n name: string;\n description: string;\n layerSpec: any;\n type: string;\n group: string;\n metadata: IMetadata;\n}\n\nexport type FileExportFormat = 'geojson' | 'gpkg' | 'shapefile';\n\nexport interface ITileSource extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n metadata: IMetadata;\n id: string;\n type: string;\n source: string;\n attribution: string;\n minZoom: number;\n maxZoom: number;\n headers: { [key: string]: string };\n extentLngLat: number[];\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface IUpload extends IBaseResource {\n id: string;\n fileName: string;\n path: string;\n options: {\n name: string;\n description?: string;\n datasetId: string;\n attribution?: string;\n schema?: string;\n };\n size: number;\n status: string;\n error: { message: string; stdout: string; stderr: string };\n applicationId: string;\n application?: IApplication;\n ownerId: string;\n updatedAt: string;\n createdAt: string;\n}\n\nexport interface IUser extends IBaseResource {\n [key: string]: any;\n}\n\nexport interface IStyle extends IBaseResource {\n [key: string]: any;\n}\n\nexport interface ITileSpec {\n [key: string]: any;\n}\n\nexport interface IConfig {\n version: {\n tag: string;\n hash: string;\n timestamp: number;\n };\n}\n\nexport interface ILoginResponse {\n accessToken: string;\n refreshToken: string;\n}\n\nexport interface ITokenRefreshResponse {\n accessToken: string;\n}\n\nexport interface UsersMeResponse {\n applicationId: string;\n email: string;\n firstName: string;\n id: string;\n lastName: string;\n metadata: object;\n roles: string[];\n}\n\n/* Job resource */\nexport type JobStatus = 'pending' | 'processing' | 'done' | 'cancelled' | 'error';\n\nexport interface IJob {\n id: string;\n applicationId: string;\n ownerId?: string;\n metadata: IMetadata;\n type: string;\n name?: string;\n description?: string;\n params: any;\n status: JobStatus;\n error?: object;\n progress?: number;\n progressText?: string;\n datasetId?: string;\n createdAt: string;\n updatedAt: string;\n}\nexport interface IJobStatus {\n status?: JobStatus;\n error?: object;\n progress?: number;\n progressText?: string;\n}\n\nexport interface IJobSubmission {\n type: string;\n name?: string;\n description?: string;\n params: any;\n}\n\nexport interface IJobRequest {\n type: string;\n}\n\nexport type IngestAction = 'insert' | 'upsert' | 'delete';\nexport interface IIngestMessage {\n datasetId: string;\n action: IngestAction;\n data: any;\n}\n\nexport interface IPipeline extends IBaseResource {\n applicationId: string;\n application?: IApplication;\n id: string;\n environment: string;\n description: string;\n config: Record<string, any>;\n metadata: IMetadata;\n startedAt: string;\n heartbeatAt: string;\n createdAt: string;\n updatedAt: string;\n components?: IPipelineComponent[];\n}\n\nexport interface IPipelineComponent extends IBaseResource {\n id: string;\n description: string;\n config: Record<string, any>;\n class: string;\n type: string;\n metadata: IMetadata;\n index: number;\n createdAt: string;\n updatedAt: string;\n metrics?: IPipelineMetric[];\n}\n\nexport interface IPipelineMetric extends IBaseResource {\n id: string;\n applicationId: string;\n pipelineId: string;\n componentId: string;\n name: string;\n type: string;\n timestamp: string;\n value: number;\n labels: Record<string, string>;\n createdAt: string;\n updatedAt: string;\n}\n\n/**\n * Contact point resource.\n */\nexport interface IContactPoint extends IBaseResource {\n id: string;\n applicationId: string;\n type: string;\n description: string;\n templates: string[];\n recipients: string[];\n /** Driver-specific host configuration for the contact point */\n host: string;\n /** Driver-specific port configuration for the contact point */\n port: number;\n /** Driver-specific user configuration for the contact point */\n user: string;\n /** Driver-specific password configuration for the contact point */\n password: string;\n metadata: IMetadata;\n createdAt: string;\n updatedAt: string;\n}\n\n/**\n * Request body for sending a notification to a contact point.\n */\nexport interface IContactPointSendRequest {\n /** ID of the template to use for the notification */\n template?: string;\n /** Subject of the notification */\n subject?: string;\n /** Recipients of the notification */\n recipients?: string[];\n /** Template key/value data for expanding the notification template */\n data?: any;\n}\n\n/**\n * Media resource.\n */\nexport interface IMedia extends IBaseResource {\n id: string;\n applicationId: string;\n type: string;\n mimeType: string;\n fileName: string;\n metadata: IMetadata;\n createdAt: string;\n updatedAt: string;\n}\n"]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright © 2018 Emu Analytics
|
|
4
|
-
*/
|
|
5
|
-
var __extends = (this && this.__extends) || (function () {
|
|
6
|
-
var extendStatics = function (d, b) {
|
|
7
|
-
extendStatics = Object.setPrototypeOf ||
|
|
8
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
9
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
10
|
-
return extendStatics(d, b);
|
|
11
|
-
};
|
|
12
|
-
return function (d, b) {
|
|
13
|
-
if (typeof b !== "function" && b !== null)
|
|
14
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
15
|
-
extendStatics(d, b);
|
|
16
|
-
function __() { this.constructor = d; }
|
|
17
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
18
|
-
};
|
|
19
|
-
})();
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.ApiKeyEndpoints = void 0;
|
|
22
|
-
var base_endpoints_1 = require("./base.endpoints");
|
|
23
|
-
var ApiKeyEndpoints = /** @class */ (function (_super) {
|
|
24
|
-
__extends(ApiKeyEndpoints, _super);
|
|
25
|
-
function ApiKeyEndpoints(client) {
|
|
26
|
-
return _super.call(this, client, 'apikeys') || this;
|
|
27
|
-
}
|
|
28
|
-
return ApiKeyEndpoints;
|
|
29
|
-
}(base_endpoints_1.BaseEndpoints));
|
|
30
|
-
exports.ApiKeyEndpoints = ApiKeyEndpoints;
|
|
31
|
-
//# sourceMappingURL=apikey.endpoints.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apikey.endpoints.js","sourceRoot":"","sources":["../../../src/lib/apikey.endpoints.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;AAGH,mDAAiD;AAGjD;IAAqC,mCAAsB;IACzD,yBAAY,MAAc;QACxB,OAAA,MAAK,YAAC,MAAM,EAAE,SAAS,CAAC,SAAC;IAC3B,CAAC;IACH,sBAAC;AAAD,CAAC,AAJD,CAAqC,8BAAa,GAIjD;AAJY,0CAAe","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"]}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright © 2018 Emu Analytics
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.AppConfigEndpoints = void 0;
|
|
7
|
-
var AppConfigEndpoints = /** @class */ (function () {
|
|
8
|
-
function AppConfigEndpoints(client) {
|
|
9
|
-
this.client = client;
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(AppConfigEndpoints.prototype, "resourceEndpoint", {
|
|
12
|
-
get: function () {
|
|
13
|
-
return "/api/v1/appconfig";
|
|
14
|
-
},
|
|
15
|
-
enumerable: false,
|
|
16
|
-
configurable: true
|
|
17
|
-
});
|
|
18
|
-
AppConfigEndpoints.prototype.get = function (path, params) {
|
|
19
|
-
if (params === void 0) { params = {}; }
|
|
20
|
-
return this.client._get(path ? "".concat(this.resourceEndpoint, "/").concat(path) : this.resourceEndpoint, { params: params });
|
|
21
|
-
};
|
|
22
|
-
AppConfigEndpoints.prototype.set = function (path, value, params) {
|
|
23
|
-
if (params === void 0) { params = {}; }
|
|
24
|
-
// Wrap primitives in value object
|
|
25
|
-
if (typeof value === 'string' ||
|
|
26
|
-
typeof value === 'number' ||
|
|
27
|
-
typeof value === 'boolean' ||
|
|
28
|
-
value === null ||
|
|
29
|
-
Array.isArray(value)) {
|
|
30
|
-
value = { value: value };
|
|
31
|
-
}
|
|
32
|
-
return this.client._put(path ? "".concat(this.resourceEndpoint, "/").concat(path) : this.resourceEndpoint, value, {
|
|
33
|
-
headers: {
|
|
34
|
-
'Content-Type': 'application/json'
|
|
35
|
-
},
|
|
36
|
-
params: params
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
AppConfigEndpoints.prototype.delete = function (path, params) {
|
|
40
|
-
if (params === void 0) { params = {}; }
|
|
41
|
-
return this.client._delete("".concat(this.resourceEndpoint, "/").concat(path), { params: params });
|
|
42
|
-
};
|
|
43
|
-
AppConfigEndpoints.prototype.subscribe = function (cb) {
|
|
44
|
-
return this.client._subscribe('appconfig', cb);
|
|
45
|
-
};
|
|
46
|
-
return AppConfigEndpoints;
|
|
47
|
-
}());
|
|
48
|
-
exports.AppConfigEndpoints = AppConfigEndpoints;
|
|
49
|
-
//# sourceMappingURL=appconfig.endpoints.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"appconfig.endpoints.js","sourceRoot":"","sources":["../../../src/lib/appconfig.endpoints.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAKH;IACE,4BAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C,sBAAY,gDAAgB;aAA5B;YACE,OAAO,mBAAmB,CAAC;QAC7B,CAAC;;;OAAA;IAED,gCAAG,GAAH,UAAI,IAAa,EAAE,MAAgC;QAAhC,uBAAA,EAAA,WAAgC;QACjD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,UAAG,IAAI,CAAC,gBAAgB,cAAI,IAAI,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,EAAE,EAAE,MAAM,QAAA,EAAE,CAAC,CAAC;IACzG,CAAC;IAED,gCAAG,GAAH,UAAI,IAAmB,EAAE,KAAU,EAAE,MAAgC;QAAhC,uBAAA,EAAA,WAAgC;QACnE,kCAAkC;QAClC,IACE,OAAO,KAAK,KAAK,QAAQ;YACzB,OAAO,KAAK,KAAK,QAAQ;YACzB,OAAO,KAAK,KAAK,SAAS;YAC1B,KAAK,KAAK,IAAI;YACd,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EACpB,CAAC;YACD,KAAK,GAAG,EAAE,KAAK,OAAA,EAAE,CAAC;QACpB,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,UAAG,IAAI,CAAC,gBAAgB,cAAI,IAAI,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,EAAE;YAChG,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;YACD,MAAM,QAAA;SACP,CAAC,CAAC;IACL,CAAC;IAED,mCAAM,GAAN,UAAO,IAAY,EAAE,MAAgC;QAAhC,uBAAA,EAAA,WAAgC;QACnD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAG,IAAI,CAAC,gBAAgB,cAAI,IAAI,CAAE,EAAE,EAAE,MAAM,QAAA,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,sCAAS,GAAT,UAAU,EAA8B;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;IACH,yBAAC;AAAD,CAAC,AAtCD,IAsCC;AAtCY,gDAAkB","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { Client } from './client';\nimport { WebSocketSubscribeCallback, WebSocketUnsubscriber } from './web-socket-gateway';\n\nexport class AppConfigEndpoints {\n constructor(private readonly client: Client) {}\n\n private get resourceEndpoint(): string {\n return `/api/v1/appconfig`;\n }\n\n get(path?: string, params: Record<string, any> = {}): Promise<any> {\n return this.client._get(path ? `${this.resourceEndpoint}/${path}` : this.resourceEndpoint, { params });\n }\n\n set(path: string | null, value: any, params: Record<string, any> = {}): Promise<any> {\n // Wrap primitives in value object\n if (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n value === null ||\n Array.isArray(value)\n ) {\n value = { value };\n }\n\n return this.client._put(path ? `${this.resourceEndpoint}/${path}` : this.resourceEndpoint, value, {\n headers: {\n 'Content-Type': 'application/json'\n },\n params\n });\n }\n\n delete(path: string, params: Record<string, any> = {}): Promise<any> {\n return this.client._delete(`${this.resourceEndpoint}/${path}`, { params });\n }\n\n subscribe(cb: WebSocketSubscribeCallback): WebSocketUnsubscriber {\n return this.client._subscribe('appconfig', cb);\n }\n}\n"]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright © 2018 Emu Analytics
|
|
4
|
-
*/
|
|
5
|
-
var __extends = (this && this.__extends) || (function () {
|
|
6
|
-
var extendStatics = function (d, b) {
|
|
7
|
-
extendStatics = Object.setPrototypeOf ||
|
|
8
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
9
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
10
|
-
return extendStatics(d, b);
|
|
11
|
-
};
|
|
12
|
-
return function (d, b) {
|
|
13
|
-
if (typeof b !== "function" && b !== null)
|
|
14
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
15
|
-
extendStatics(d, b);
|
|
16
|
-
function __() { this.constructor = d; }
|
|
17
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
18
|
-
};
|
|
19
|
-
})();
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.ApplicationEndpoints = void 0;
|
|
22
|
-
var base_endpoints_1 = require("./base.endpoints");
|
|
23
|
-
var ApplicationEndpoints = /** @class */ (function (_super) {
|
|
24
|
-
__extends(ApplicationEndpoints, _super);
|
|
25
|
-
function ApplicationEndpoints(client) {
|
|
26
|
-
return _super.call(this, client, 'applications') || this;
|
|
27
|
-
}
|
|
28
|
-
return ApplicationEndpoints;
|
|
29
|
-
}(base_endpoints_1.BaseEndpoints));
|
|
30
|
-
exports.ApplicationEndpoints = ApplicationEndpoints;
|
|
31
|
-
//# sourceMappingURL=application.endpoints.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"application.endpoints.js","sourceRoot":"","sources":["../../../src/lib/application.endpoints.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;AAGH,mDAAiD;AAGjD;IAA0C,wCAA2B;IACnE,8BAAY,MAAc;QACxB,OAAA,MAAK,YAAC,MAAM,EAAE,cAAc,CAAC,SAAC;IAChC,CAAC;IACH,2BAAC;AAAD,CAAC,AAJD,CAA0C,8BAAa,GAItD;AAJY,oDAAoB","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"]}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright © 2018 Emu Analytics
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.AuthEndpoints = void 0;
|
|
7
|
-
var user_endpoints_1 = require("./user.endpoints");
|
|
8
|
-
var AuthEndpoints = /** @class */ (function () {
|
|
9
|
-
function AuthEndpoints(client) {
|
|
10
|
-
this.client = client;
|
|
11
|
-
this.users = new user_endpoints_1.UserEndpoint(this.client);
|
|
12
|
-
}
|
|
13
|
-
AuthEndpoints.prototype.login = function (email, password, applicationId) {
|
|
14
|
-
return this.client._post('/api/v1/auth/login', { email: email, password: password, applicationId: applicationId });
|
|
15
|
-
};
|
|
16
|
-
AuthEndpoints.prototype.logout = function (accessToken, refreshToken) {
|
|
17
|
-
return this.client._post('/api/v1/auth/logout', { refreshToken: refreshToken }, {
|
|
18
|
-
headers: { Authorization: "Bearer ".concat(accessToken) }
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
AuthEndpoints.prototype.refresh = function (refreshToken, applicationId) {
|
|
22
|
-
return this.client._post('/api/v1/auth/refresh', { refreshToken: refreshToken, applicationId: applicationId });
|
|
23
|
-
};
|
|
24
|
-
AuthEndpoints.prototype.changePassword = function (password, newPassword, token) {
|
|
25
|
-
return this.client._post('/api/v1/auth/changepassword', {
|
|
26
|
-
password: password,
|
|
27
|
-
newPassword: newPassword
|
|
28
|
-
}, {
|
|
29
|
-
headers: { Authorization: "Bearer ".concat(token) }
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
AuthEndpoints.prototype.signUp = function (firstName, lastName, email, password, applicationId, confirmUrl, redirectUrl) {
|
|
33
|
-
// Support legacy signature, which was missing confirmUrl
|
|
34
|
-
if (!redirectUrl) {
|
|
35
|
-
redirectUrl = confirmUrl;
|
|
36
|
-
confirmUrl = "".concat(this.client.baseUrl, "/api/v1/auth/confirmsignup");
|
|
37
|
-
}
|
|
38
|
-
return this.client._post('/api/v1/auth/signup', {
|
|
39
|
-
firstName: firstName,
|
|
40
|
-
lastName: lastName,
|
|
41
|
-
email: email,
|
|
42
|
-
password: password,
|
|
43
|
-
applicationId: applicationId,
|
|
44
|
-
confirmUrl: confirmUrl,
|
|
45
|
-
redirectUrl: redirectUrl
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
AuthEndpoints.prototype.confirmSignUp = function (email, token, redirect) {
|
|
49
|
-
return this.client._get("/api/v1/auth/confirmsignup", { params: { email: email, token: token, redirect: redirect } });
|
|
50
|
-
};
|
|
51
|
-
AuthEndpoints.prototype.requestPasswordReset = function (email, applicationId, redirectUrl) {
|
|
52
|
-
return this.client._post('/api/v1/auth/requestpasswordreset', { email: email, applicationId: applicationId, redirectUrl: redirectUrl });
|
|
53
|
-
};
|
|
54
|
-
AuthEndpoints.prototype.resetPassword = function (email, password, applicationId, token) {
|
|
55
|
-
return this.client._post('/api/v1/auth/resetpassword', { email: email, password: password, applicationId: applicationId, token: token });
|
|
56
|
-
};
|
|
57
|
-
return AuthEndpoints;
|
|
58
|
-
}());
|
|
59
|
-
exports.AuthEndpoints = AuthEndpoints;
|
|
60
|
-
//# sourceMappingURL=auth.edpoints.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.edpoints.js","sourceRoot":"","sources":["../../../src/lib/auth.edpoints.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAIH,mDAAgD;AAEhD;IAGE,uBAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAF3C,UAAK,GAAG,IAAI,6BAAY,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,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,qBAAqB,EACrB,EAAE,YAAY,cAAA,EAAE,EAChB;YACE,OAAO,EAAE,EAAE,aAAa,EAAE,iBAAU,WAAW,CAAE,EAAE;SACpD,CACF,CAAC;IACJ,CAAC;IAED,+BAAO,GAAP,UAAQ,YAAoB,EAAE,aAAqB;QACjD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,EAAE,EAAE,YAAY,cAAA,EAAE,aAAa,eAAA,EAAE,CAAC,CAAC;IACpF,CAAC;IAED,sCAAc,GAAd,UAAe,QAAgB,EAAE,WAAmB,EAAE,KAAa;QACjE,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,6BAA6B,EAC7B;YACE,QAAQ,UAAA;YACR,WAAW,aAAA;SACZ,EACD;YACE,OAAO,EAAE,EAAE,aAAa,EAAE,iBAAU,KAAK,CAAE,EAAE;SAC9C,CACF,CAAC;IACJ,CAAC;IAED,8BAAM,GAAN,UACE,SAAiB,EACjB,QAAgB,EAChB,KAAa,EACb,QAAgB,EAChB,aAAqB,EACrB,UAAkB,EAClB,WAAoB;QAEpB,yDAAyD;QACzD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,WAAW,GAAG,UAAU,CAAC;YACzB,UAAU,GAAG,UAAG,IAAI,CAAC,MAAM,CAAC,OAAO,+BAA4B,CAAC;QAClE,CAAC;QAED,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE;YAC9C,SAAS,WAAA;YACT,QAAQ,UAAA;YACR,KAAK,OAAA;YACL,QAAQ,UAAA;YACR,aAAa,eAAA;YACb,UAAU,YAAA;YACV,WAAW,aAAA;SACZ,CAAC,CAAC;IACL,CAAC;IAED,qCAAa,GAAb,UAAc,KAAa,EAAE,KAAa,EAAE,QAAiB;QAC3D,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,QAAQ,UAAA,EAAE,EAAE,CAAC,CAAC;IAChG,CAAC;IAED,4CAAoB,GAApB,UAAqB,KAAa,EAAE,aAAqB,EAAE,WAAmB;QAC5E,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,mCAAmC,EAAE,EAAE,KAAK,OAAA,EAAE,aAAa,eAAA,EAAE,WAAW,aAAA,EAAE,CAAC,CAAC;IACvG,CAAC;IAED,qCAAa,GAAb,UAAc,KAAa,EAAE,QAAgB,EAAE,aAAqB,EAAE,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,AAzED,IAyEC;AAzEY,sCAAa","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { ILoginResponse, ITokenRefreshResponse } from './api-interfaces';\nimport { Client } from './client';\nimport { UserEndpoint } from './user.endpoints';\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 confirmUrl: string,\n redirectUrl?: string\n ): Promise<void> {\n // Support legacy signature, which was missing confirmUrl\n if (!redirectUrl) {\n redirectUrl = confirmUrl;\n confirmUrl = `${this.client.baseUrl}/api/v1/auth/confirmsignup`;\n }\n\n return this.client._post('/api/v1/auth/signup', {\n firstName,\n lastName,\n email,\n password,\n applicationId,\n confirmUrl,\n redirectUrl\n });\n }\n\n confirmSignUp(email: string, token: string, redirect?: string): Promise<void> {\n return this.client._get(`/api/v1/auth/confirmsignup`, { params: { email, token, redirect } });\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"]}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright © 2018 Emu Analytics
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.BaseEndpoints = void 0;
|
|
7
|
-
var BaseEndpoints = /** @class */ (function () {
|
|
8
|
-
function BaseEndpoints(client, resourcePath) {
|
|
9
|
-
this.client = client;
|
|
10
|
-
this.resourcePath = resourcePath;
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(BaseEndpoints.prototype, "resourceEndpoint", {
|
|
13
|
-
get: function () {
|
|
14
|
-
return "/api/v1/".concat(this.resourcePath);
|
|
15
|
-
},
|
|
16
|
-
enumerable: false,
|
|
17
|
-
configurable: true
|
|
18
|
-
});
|
|
19
|
-
BaseEndpoints.prototype.list = function (params) {
|
|
20
|
-
// Reformat filter for query string
|
|
21
|
-
if (params === null || params === void 0 ? void 0 : params.filter) {
|
|
22
|
-
var filter_1 = params.filter;
|
|
23
|
-
Object.keys(filter_1).forEach(function (key) {
|
|
24
|
-
params["filter[".concat(key, "]")] = filter_1[key];
|
|
25
|
-
});
|
|
26
|
-
delete params.filter;
|
|
27
|
-
}
|
|
28
|
-
return this.client._get(this.resourceEndpoint, { params: params });
|
|
29
|
-
};
|
|
30
|
-
BaseEndpoints.prototype.get = function (id, params) {
|
|
31
|
-
if (params === void 0) { params = {}; }
|
|
32
|
-
return this.client._get("".concat(this.resourceEndpoint, "/").concat(id), { params: params });
|
|
33
|
-
};
|
|
34
|
-
BaseEndpoints.prototype.create = function (data, params) {
|
|
35
|
-
if (params === void 0) { params = {}; }
|
|
36
|
-
return this.client._post("".concat(this.resourceEndpoint), data, { params: params });
|
|
37
|
-
};
|
|
38
|
-
BaseEndpoints.prototype.update = function (id, data, params) {
|
|
39
|
-
if (params === void 0) { params = {}; }
|
|
40
|
-
return this.client._put("".concat(this.resourceEndpoint, "/").concat(id), data, { params: params });
|
|
41
|
-
};
|
|
42
|
-
BaseEndpoints.prototype.delete = function (id, params) {
|
|
43
|
-
if (params === void 0) { params = {}; }
|
|
44
|
-
return this.client._delete("".concat(this.resourceEndpoint, "/").concat(id), { params: params });
|
|
45
|
-
};
|
|
46
|
-
BaseEndpoints.prototype.getMetadata = function (id, key, params) {
|
|
47
|
-
if (params === void 0) { params = {}; }
|
|
48
|
-
var endpoint = key
|
|
49
|
-
? "".concat(this.resourceEndpoint, "/").concat(id, "/metadata/").concat(key)
|
|
50
|
-
: "".concat(this.resourceEndpoint, "/").concat(id, "/metadata");
|
|
51
|
-
return this.client._get(endpoint, { params: params });
|
|
52
|
-
};
|
|
53
|
-
BaseEndpoints.prototype.setMetadata = function (id, key, value, params) {
|
|
54
|
-
if (params === void 0) { params = {}; }
|
|
55
|
-
// Wrap primitives in value object
|
|
56
|
-
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
57
|
-
value = { value: value };
|
|
58
|
-
}
|
|
59
|
-
return this.client._put("".concat(this.resourceEndpoint, "/").concat(id, "/metadata/").concat(key), value, {
|
|
60
|
-
headers: {
|
|
61
|
-
'Content-Type': 'application/json'
|
|
62
|
-
},
|
|
63
|
-
params: params
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
BaseEndpoints.prototype.deleteMetadata = function (id, key, params) {
|
|
67
|
-
if (params === void 0) { params = {}; }
|
|
68
|
-
return this.client._delete("".concat(this.resourceEndpoint, "/").concat(id, "/metadata/").concat(key), {
|
|
69
|
-
headers: {
|
|
70
|
-
'Content-Type': 'application/json'
|
|
71
|
-
},
|
|
72
|
-
params: params
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
return BaseEndpoints;
|
|
76
|
-
}());
|
|
77
|
-
exports.BaseEndpoints = BaseEndpoints;
|
|
78
|
-
//# sourceMappingURL=base.endpoints.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.endpoints.js","sourceRoot":"","sources":["../../../src/lib/base.endpoints.ts"],"names":[],"mappings":"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","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 // Wrap primitives in value object\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n value = { value };\n }\n\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"]}
|
package/dist/cjs/lib/client.js
DELETED
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Copyright © 2018 Emu Analytics
|
|
4
|
-
*/
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.Client = void 0;
|
|
21
|
-
var axios_1 = __importDefault(require("axios"));
|
|
22
|
-
var debug_1 = __importDefault(require("debug"));
|
|
23
|
-
var apikey_endpoints_1 = require("./apikey.endpoints");
|
|
24
|
-
var appconfig_endpoints_1 = require("./appconfig.endpoints");
|
|
25
|
-
var application_endpoints_1 = require("./application.endpoints");
|
|
26
|
-
var auth_edpoints_1 = require("./auth.edpoints");
|
|
27
|
-
var contact_point_endpoints_1 = require("./contact-point.endpoints");
|
|
28
|
-
var database_endpoints_1 = require("./database.endpoints");
|
|
29
|
-
var dataset_endpoints_1 = require("./dataset.endpoints");
|
|
30
|
-
var errors_1 = require("./errors");
|
|
31
|
-
var job_endpoints_1 = require("./job.endpoints");
|
|
32
|
-
var map_endoints_1 = require("./map.endoints");
|
|
33
|
-
var maplayer_endpoints_1 = require("./maplayer.endpoints");
|
|
34
|
-
var media_endpoints_1 = require("./media.endpoints");
|
|
35
|
-
var pipeline_endpoints_1 = require("./pipeline.endpoints");
|
|
36
|
-
var style_endpoint_1 = require("./style.endpoint");
|
|
37
|
-
var tile_source_endpoints_1 = require("./tile-source.endpoints");
|
|
38
|
-
var tile_endpoints_1 = require("./tile.endpoints");
|
|
39
|
-
var upload_endpoints_1 = require("./upload.endpoints");
|
|
40
|
-
var web_socket_gateway_1 = require("./web-socket-gateway");
|
|
41
|
-
var Client = /** @class */ (function () {
|
|
42
|
-
function Client(baseUrl, apiKey, options) {
|
|
43
|
-
if (apiKey === void 0) { apiKey = null; }
|
|
44
|
-
this.baseUrl = baseUrl;
|
|
45
|
-
this.apiKey = apiKey;
|
|
46
|
-
this.debug = (0, debug_1.default)('flow-engine-client');
|
|
47
|
-
this.accessToken = null;
|
|
48
|
-
this.auth = new auth_edpoints_1.AuthEndpoints(this);
|
|
49
|
-
this.tiles = new tile_endpoints_1.TileEndpoints(this);
|
|
50
|
-
this.maps = new map_endoints_1.MapEndpoints(this);
|
|
51
|
-
this.apiKeys = new apikey_endpoints_1.ApiKeyEndpoints(this);
|
|
52
|
-
this.applications = new application_endpoints_1.ApplicationEndpoints(this);
|
|
53
|
-
this.appconfig = new appconfig_endpoints_1.AppConfigEndpoints(this);
|
|
54
|
-
this.contactpoints = new contact_point_endpoints_1.ContactPointEndpoints(this);
|
|
55
|
-
this.databases = new database_endpoints_1.DatabaseEndpoints(this);
|
|
56
|
-
this.datasets = new dataset_endpoints_1.DatasetEndpoints(this);
|
|
57
|
-
this.styles = new style_endpoint_1.StyleEndpoints(this);
|
|
58
|
-
this.tileSources = new tile_source_endpoints_1.TileSourceEndpoints(this);
|
|
59
|
-
this.uploads = new upload_endpoints_1.UploadEndpoints(this);
|
|
60
|
-
this.jobs = new job_endpoints_1.JobEndpoints(this);
|
|
61
|
-
this.maplayers = new maplayer_endpoints_1.MapLayerEndpoints(this);
|
|
62
|
-
this.media = new media_endpoints_1.MediaEndpoints(this);
|
|
63
|
-
this.pipelines = new pipeline_endpoints_1.PipelineEndpoints(this);
|
|
64
|
-
this.axios = axios_1.default.create({
|
|
65
|
-
baseURL: baseUrl,
|
|
66
|
-
maxContentLength: 524288000,
|
|
67
|
-
transformResponse: [
|
|
68
|
-
function transformResponse(data, headers) {
|
|
69
|
-
var _a;
|
|
70
|
-
if ((_a = headers === null || headers === void 0 ? void 0 : headers['content-type']) === null || _a === void 0 ? void 0 : _a.startsWith('application/json')) {
|
|
71
|
-
// Force parsing of data if expected content type is JSON
|
|
72
|
-
// This ensures that errors are thrown if JSON is truncated due to a query timeout
|
|
73
|
-
// (default Axios behavior is simply to return a string if JSON parsing fails)
|
|
74
|
-
return JSON.parse(data);
|
|
75
|
-
}
|
|
76
|
-
return data;
|
|
77
|
-
}
|
|
78
|
-
]
|
|
79
|
-
});
|
|
80
|
-
this.webSocketGateway = new web_socket_gateway_1.WebSocketGateway(this, options);
|
|
81
|
-
}
|
|
82
|
-
Client.prototype.useRequestInterceptor = function (interceptor) {
|
|
83
|
-
return this.axios.interceptors.request.use(interceptor);
|
|
84
|
-
};
|
|
85
|
-
Client.prototype.ejectRequestInterceptor = function (id) {
|
|
86
|
-
this.axios.interceptors.request.eject(id);
|
|
87
|
-
};
|
|
88
|
-
Client.prototype.connect = function () {
|
|
89
|
-
return this.webSocketGateway.connect();
|
|
90
|
-
};
|
|
91
|
-
Client.prototype.disconnect = function () {
|
|
92
|
-
return this.webSocketGateway.disconnect();
|
|
93
|
-
};
|
|
94
|
-
Client.prototype.config = function () {
|
|
95
|
-
return this._get('/api/v1/config');
|
|
96
|
-
};
|
|
97
|
-
Client.prototype._get = function (path, options) {
|
|
98
|
-
var _a;
|
|
99
|
-
if (options === void 0) { options = {}; }
|
|
100
|
-
// Move apiKey from params
|
|
101
|
-
if ((_a = options.params) === null || _a === void 0 ? void 0 : _a.apiKey) {
|
|
102
|
-
options.apiKey = options.params.apiKey;
|
|
103
|
-
delete options.params.apiKey;
|
|
104
|
-
}
|
|
105
|
-
return this.axios(__assign(__assign({ method: 'get', url: path }, options), this.headers(options)))
|
|
106
|
-
.then(function (res) { return res.data; })
|
|
107
|
-
.catch(this.handleError);
|
|
108
|
-
};
|
|
109
|
-
Client.prototype._post = function (path, data, options) {
|
|
110
|
-
var _a;
|
|
111
|
-
if (options === void 0) { options = {}; }
|
|
112
|
-
// Move apiKey from params
|
|
113
|
-
if ((_a = options.params) === null || _a === void 0 ? void 0 : _a.apiKey) {
|
|
114
|
-
options.apiKey = options.params.apiKey;
|
|
115
|
-
delete options.params.apiKey;
|
|
116
|
-
}
|
|
117
|
-
return this.axios(__assign(__assign({ method: 'post', url: path, data: data, maxContentLength: Infinity, maxBodyLength: Infinity }, options), this.headers(options)))
|
|
118
|
-
.then(function (res) { return res.data; })
|
|
119
|
-
.catch(this.handleError);
|
|
120
|
-
};
|
|
121
|
-
Client.prototype._put = function (path, data, options) {
|
|
122
|
-
var _a;
|
|
123
|
-
if (options === void 0) { options = {}; }
|
|
124
|
-
// Move apiKey from params
|
|
125
|
-
if ((_a = options.params) === null || _a === void 0 ? void 0 : _a.apiKey) {
|
|
126
|
-
options.apiKey = options.params.apiKey;
|
|
127
|
-
delete options.params.apiKey;
|
|
128
|
-
}
|
|
129
|
-
return this.axios(__assign(__assign({ method: 'put', url: path, data: data }, options), this.headers(options)))
|
|
130
|
-
.then(function (res) { return res.data; })
|
|
131
|
-
.catch(this.handleError);
|
|
132
|
-
};
|
|
133
|
-
Client.prototype._delete = function (path, options) {
|
|
134
|
-
var _a;
|
|
135
|
-
if (options === void 0) { options = {}; }
|
|
136
|
-
// Move apiKey from params
|
|
137
|
-
if ((_a = options.params) === null || _a === void 0 ? void 0 : _a.apiKey) {
|
|
138
|
-
options.apiKey = options.params.apiKey;
|
|
139
|
-
delete options.params.apiKey;
|
|
140
|
-
}
|
|
141
|
-
return this.axios(__assign(__assign({ method: 'delete', url: path }, options), this.headers(options)))
|
|
142
|
-
.then(function (res) { return res.data; })
|
|
143
|
-
.catch(this.handleError);
|
|
144
|
-
};
|
|
145
|
-
// Subscribe to named channel - errors and messages are delivered via the callback
|
|
146
|
-
Client.prototype._subscribe = function (channel, cb) {
|
|
147
|
-
if (!this.webSocketGateway.isConnected) {
|
|
148
|
-
this.webSocketGateway.connect();
|
|
149
|
-
}
|
|
150
|
-
return this.webSocketGateway.subscribe(channel, cb);
|
|
151
|
-
};
|
|
152
|
-
// Unsubscribe from named channel - optional callback is called on completion
|
|
153
|
-
Client.prototype._unsubscribe = function (channel, cb) {
|
|
154
|
-
if (!this.webSocketGateway.isConnected) {
|
|
155
|
-
this.webSocketGateway.connect();
|
|
156
|
-
}
|
|
157
|
-
this.webSocketGateway.unsubscribe(channel, cb);
|
|
158
|
-
};
|
|
159
|
-
/**
|
|
160
|
-
* Normalize errors
|
|
161
|
-
* Throws a new error based on type of input error
|
|
162
|
-
*
|
|
163
|
-
* @param {AxiosError} e
|
|
164
|
-
*/
|
|
165
|
-
Client.prototype.handleError = function (e) {
|
|
166
|
-
// Flow API error
|
|
167
|
-
if (e.response && e.response.data) {
|
|
168
|
-
if (typeof e.response.data === 'object') {
|
|
169
|
-
var data = e.response.data;
|
|
170
|
-
throw new errors_1.FlowEngineError(data.message || data.error, data.error, e.response.status);
|
|
171
|
-
}
|
|
172
|
-
else if (typeof e.response.data === 'string') {
|
|
173
|
-
throw new errors_1.FlowEngineError(e.response.data, null, e.response.status);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
// Generic error
|
|
177
|
-
// Don't leak information in error
|
|
178
|
-
var cleanError = e;
|
|
179
|
-
delete cleanError.config;
|
|
180
|
-
delete cleanError.request;
|
|
181
|
-
delete cleanError.response;
|
|
182
|
-
throw new errors_1.FlowEngineError(cleanError.message, cleanError);
|
|
183
|
-
};
|
|
184
|
-
Client.prototype.headers = function (options) {
|
|
185
|
-
var headers = options.headers || {};
|
|
186
|
-
if (options.apiKey || this.apiKey) {
|
|
187
|
-
headers['X-Api-Key'] = options.apiKey || this.apiKey;
|
|
188
|
-
}
|
|
189
|
-
// Add default auth header if token supplied and not already set in options
|
|
190
|
-
if (this.accessToken) {
|
|
191
|
-
headers.Authorization = headers.Authorization || "Bearer ".concat(this.accessToken);
|
|
192
|
-
}
|
|
193
|
-
return { headers: headers };
|
|
194
|
-
};
|
|
195
|
-
return Client;
|
|
196
|
-
}());
|
|
197
|
-
exports.Client = Client;
|
|
198
|
-
//# sourceMappingURL=client.js.map
|