@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.
Files changed (164) hide show
  1. package/dist/bundle.js +9 -3
  2. package/dist/index.cjs +1 -0
  3. package/dist/index.d.cts +668 -0
  4. package/dist/index.d.mts +668 -0
  5. package/dist/index.d.ts +668 -0
  6. package/dist/index.mjs +1 -0
  7. package/package.json +33 -40
  8. package/dist/bundle.js.map +0 -7
  9. package/dist/cjs/index.js +0 -25
  10. package/dist/cjs/index.js.map +0 -1
  11. package/dist/cjs/lib/__mocks__/client.js +0 -57
  12. package/dist/cjs/lib/__mocks__/client.js.map +0 -1
  13. package/dist/cjs/lib/api-interfaces.js +0 -6
  14. package/dist/cjs/lib/api-interfaces.js.map +0 -1
  15. package/dist/cjs/lib/apikey.endpoints.js +0 -31
  16. package/dist/cjs/lib/apikey.endpoints.js.map +0 -1
  17. package/dist/cjs/lib/appconfig.endpoints.js +0 -49
  18. package/dist/cjs/lib/appconfig.endpoints.js.map +0 -1
  19. package/dist/cjs/lib/application.endpoints.js +0 -31
  20. package/dist/cjs/lib/application.endpoints.js.map +0 -1
  21. package/dist/cjs/lib/auth.edpoints.js +0 -60
  22. package/dist/cjs/lib/auth.edpoints.js.map +0 -1
  23. package/dist/cjs/lib/base.endpoints.js +0 -78
  24. package/dist/cjs/lib/base.endpoints.js.map +0 -1
  25. package/dist/cjs/lib/client.js +0 -198
  26. package/dist/cjs/lib/client.js.map +0 -1
  27. package/dist/cjs/lib/contact-point.endpoints.js +0 -46
  28. package/dist/cjs/lib/contact-point.endpoints.js.map +0 -1
  29. package/dist/cjs/lib/database.endpoints.js +0 -39
  30. package/dist/cjs/lib/database.endpoints.js.map +0 -1
  31. package/dist/cjs/lib/dataset.endpoints.js +0 -88
  32. package/dist/cjs/lib/dataset.endpoints.js.map +0 -1
  33. package/dist/cjs/lib/errors.js +0 -36
  34. package/dist/cjs/lib/errors.js.map +0 -1
  35. package/dist/cjs/lib/job.endpoints.js +0 -46
  36. package/dist/cjs/lib/job.endpoints.js.map +0 -1
  37. package/dist/cjs/lib/map.endoints.js +0 -18
  38. package/dist/cjs/lib/map.endoints.js.map +0 -1
  39. package/dist/cjs/lib/maplayer.endpoints.js +0 -34
  40. package/dist/cjs/lib/maplayer.endpoints.js.map +0 -1
  41. package/dist/cjs/lib/media.endpoints.js +0 -106
  42. package/dist/cjs/lib/media.endpoints.js.map +0 -1
  43. package/dist/cjs/lib/pipeline-component.endpoints.js +0 -37
  44. package/dist/cjs/lib/pipeline-component.endpoints.js.map +0 -1
  45. package/dist/cjs/lib/pipeline-metric.endpoint.js +0 -31
  46. package/dist/cjs/lib/pipeline-metric.endpoint.js.map +0 -1
  47. package/dist/cjs/lib/pipeline.endpoints.js +0 -87
  48. package/dist/cjs/lib/pipeline.endpoints.js.map +0 -1
  49. package/dist/cjs/lib/style.endpoint.js +0 -31
  50. package/dist/cjs/lib/style.endpoint.js.map +0 -1
  51. package/dist/cjs/lib/tile-source.endpoints.js +0 -39
  52. package/dist/cjs/lib/tile-source.endpoints.js.map +0 -1
  53. package/dist/cjs/lib/tile.endpoints.js +0 -22
  54. package/dist/cjs/lib/tile.endpoints.js.map +0 -1
  55. package/dist/cjs/lib/upload.endpoints.js +0 -121
  56. package/dist/cjs/lib/upload.endpoints.js.map +0 -1
  57. package/dist/cjs/lib/user.endpoints.js +0 -36
  58. package/dist/cjs/lib/user.endpoints.js.map +0 -1
  59. package/dist/cjs/lib/web-socket-gateway.js +0 -160
  60. package/dist/cjs/lib/web-socket-gateway.js.map +0 -1
  61. package/dist/esm/index.js +0 -9
  62. package/dist/esm/index.js.map +0 -1
  63. package/dist/esm/lib/__mocks__/client.js +0 -54
  64. package/dist/esm/lib/__mocks__/client.js.map +0 -1
  65. package/dist/esm/lib/api-interfaces.js +0 -5
  66. package/dist/esm/lib/api-interfaces.js.map +0 -1
  67. package/dist/esm/lib/apikey.endpoints.js +0 -28
  68. package/dist/esm/lib/apikey.endpoints.js.map +0 -1
  69. package/dist/esm/lib/appconfig.endpoints.js +0 -46
  70. package/dist/esm/lib/appconfig.endpoints.js.map +0 -1
  71. package/dist/esm/lib/application.endpoints.js +0 -28
  72. package/dist/esm/lib/application.endpoints.js.map +0 -1
  73. package/dist/esm/lib/auth.edpoints.js +0 -57
  74. package/dist/esm/lib/auth.edpoints.js.map +0 -1
  75. package/dist/esm/lib/base.endpoints.js +0 -75
  76. package/dist/esm/lib/base.endpoints.js.map +0 -1
  77. package/dist/esm/lib/client.js +0 -192
  78. package/dist/esm/lib/client.js.map +0 -1
  79. package/dist/esm/lib/contact-point.endpoints.js +0 -43
  80. package/dist/esm/lib/contact-point.endpoints.js.map +0 -1
  81. package/dist/esm/lib/database.endpoints.js +0 -36
  82. package/dist/esm/lib/database.endpoints.js.map +0 -1
  83. package/dist/esm/lib/dataset.endpoints.js +0 -85
  84. package/dist/esm/lib/dataset.endpoints.js.map +0 -1
  85. package/dist/esm/lib/errors.js +0 -33
  86. package/dist/esm/lib/errors.js.map +0 -1
  87. package/dist/esm/lib/job.endpoints.js +0 -43
  88. package/dist/esm/lib/job.endpoints.js.map +0 -1
  89. package/dist/esm/lib/map.endoints.js +0 -15
  90. package/dist/esm/lib/map.endoints.js.map +0 -1
  91. package/dist/esm/lib/maplayer.endpoints.js +0 -31
  92. package/dist/esm/lib/maplayer.endpoints.js.map +0 -1
  93. package/dist/esm/lib/media.endpoints.js +0 -100
  94. package/dist/esm/lib/media.endpoints.js.map +0 -1
  95. package/dist/esm/lib/pipeline-component.endpoints.js +0 -34
  96. package/dist/esm/lib/pipeline-component.endpoints.js.map +0 -1
  97. package/dist/esm/lib/pipeline-metric.endpoint.js +0 -28
  98. package/dist/esm/lib/pipeline-metric.endpoint.js.map +0 -1
  99. package/dist/esm/lib/pipeline.endpoints.js +0 -84
  100. package/dist/esm/lib/pipeline.endpoints.js.map +0 -1
  101. package/dist/esm/lib/style.endpoint.js +0 -28
  102. package/dist/esm/lib/style.endpoint.js.map +0 -1
  103. package/dist/esm/lib/tile-source.endpoints.js +0 -36
  104. package/dist/esm/lib/tile-source.endpoints.js.map +0 -1
  105. package/dist/esm/lib/tile.endpoints.js +0 -19
  106. package/dist/esm/lib/tile.endpoints.js.map +0 -1
  107. package/dist/esm/lib/upload.endpoints.js +0 -115
  108. package/dist/esm/lib/upload.endpoints.js.map +0 -1
  109. package/dist/esm/lib/user.endpoints.js +0 -33
  110. package/dist/esm/lib/user.endpoints.js.map +0 -1
  111. package/dist/esm/lib/web-socket-gateway.js +0 -157
  112. package/dist/esm/lib/web-socket-gateway.js.map +0 -1
  113. package/dist/types/index.d.ts +0 -9
  114. package/dist/types/index.d.ts.map +0 -1
  115. package/dist/types/lib/__mocks__/client.d.ts +0 -3
  116. package/dist/types/lib/__mocks__/client.d.ts.map +0 -1
  117. package/dist/types/lib/api-interfaces.d.ts +0 -314
  118. package/dist/types/lib/api-interfaces.d.ts.map +0 -1
  119. package/dist/types/lib/apikey.endpoints.d.ts +0 -10
  120. package/dist/types/lib/apikey.endpoints.d.ts.map +0 -1
  121. package/dist/types/lib/appconfig.endpoints.d.ts +0 -15
  122. package/dist/types/lib/appconfig.endpoints.d.ts.map +0 -1
  123. package/dist/types/lib/application.endpoints.d.ts +0 -10
  124. package/dist/types/lib/application.endpoints.d.ts.map +0 -1
  125. package/dist/types/lib/auth.edpoints.d.ts +0 -20
  126. package/dist/types/lib/auth.edpoints.d.ts.map +0 -1
  127. package/dist/types/lib/base.endpoints.d.ts +0 -20
  128. package/dist/types/lib/base.endpoints.d.ts.map +0 -1
  129. package/dist/types/lib/client.d.ts +0 -68
  130. package/dist/types/lib/client.d.ts.map +0 -1
  131. package/dist/types/lib/contact-point.endpoints.d.ts +0 -20
  132. package/dist/types/lib/contact-point.endpoints.d.ts.map +0 -1
  133. package/dist/types/lib/database.endpoints.d.ts +0 -11
  134. package/dist/types/lib/database.endpoints.d.ts.map +0 -1
  135. package/dist/types/lib/dataset.endpoints.d.ts +0 -26
  136. package/dist/types/lib/dataset.endpoints.d.ts.map +0 -1
  137. package/dist/types/lib/errors.d.ts +0 -9
  138. package/dist/types/lib/errors.d.ts.map +0 -1
  139. package/dist/types/lib/job.endpoints.d.ts +0 -15
  140. package/dist/types/lib/job.endpoints.d.ts.map +0 -1
  141. package/dist/types/lib/map.endoints.d.ts +0 -11
  142. package/dist/types/lib/map.endoints.d.ts.map +0 -1
  143. package/dist/types/lib/maplayer.endpoints.d.ts +0 -12
  144. package/dist/types/lib/maplayer.endpoints.d.ts.map +0 -1
  145. package/dist/types/lib/media.endpoints.d.ts +0 -20
  146. package/dist/types/lib/media.endpoints.d.ts.map +0 -1
  147. package/dist/types/lib/pipeline-component.endpoints.d.ts +0 -13
  148. package/dist/types/lib/pipeline-component.endpoints.d.ts.map +0 -1
  149. package/dist/types/lib/pipeline-metric.endpoint.d.ts +0 -10
  150. package/dist/types/lib/pipeline-metric.endpoint.d.ts.map +0 -1
  151. package/dist/types/lib/pipeline.endpoints.d.ts +0 -14
  152. package/dist/types/lib/pipeline.endpoints.d.ts.map +0 -1
  153. package/dist/types/lib/style.endpoint.d.ts +0 -10
  154. package/dist/types/lib/style.endpoint.d.ts.map +0 -1
  155. package/dist/types/lib/tile-source.endpoints.d.ts +0 -11
  156. package/dist/types/lib/tile-source.endpoints.d.ts.map +0 -1
  157. package/dist/types/lib/tile.endpoints.d.ts +0 -12
  158. package/dist/types/lib/tile.endpoints.d.ts.map +0 -1
  159. package/dist/types/lib/upload.endpoints.d.ts +0 -22
  160. package/dist/types/lib/upload.endpoints.d.ts.map +0 -1
  161. package/dist/types/lib/user.endpoints.d.ts +0 -11
  162. package/dist/types/lib/user.endpoints.d.ts.map +0 -1
  163. package/dist/types/lib/web-socket-gateway.d.ts +0 -42
  164. package/dist/types/lib/web-socket-gateway.d.ts.map +0 -1
@@ -1,87 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copyright © 2018-present 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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
21
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
22
- return new (P || (P = Promise))(function (resolve, reject) {
23
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
24
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
25
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
26
- step((generator = generator.apply(thisArg, _arguments || [])).next());
27
- });
28
- };
29
- var __generator = (this && this.__generator) || function (thisArg, body) {
30
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
31
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
32
- function verb(n) { return function (v) { return step([n, v]); }; }
33
- function step(op) {
34
- if (f) throw new TypeError("Generator is already executing.");
35
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
36
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
37
- if (y = 0, t) op = [op[0] & 2, t.value];
38
- switch (op[0]) {
39
- case 0: case 1: t = op; break;
40
- case 4: _.label++; return { value: op[1], done: false };
41
- case 5: _.label++; y = op[1]; op = [0]; continue;
42
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
43
- default:
44
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
45
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
46
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
47
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
48
- if (t[2]) _.ops.pop();
49
- _.trys.pop(); continue;
50
- }
51
- op = body.call(thisArg, _);
52
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
53
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
54
- }
55
- };
56
- Object.defineProperty(exports, "__esModule", { value: true });
57
- exports.PipelineEndpoints = void 0;
58
- var base_endpoints_1 = require("./base.endpoints");
59
- var pipeline_component_endpoints_1 = require("./pipeline-component.endpoints");
60
- var PipelineEndpoints = /** @class */ (function (_super) {
61
- __extends(PipelineEndpoints, _super);
62
- function PipelineEndpoints(client) {
63
- return _super.call(this, client, 'pipelines') || this;
64
- }
65
- PipelineEndpoints.prototype.components = function (pipelineId) {
66
- return new pipeline_component_endpoints_1.PipelineComponentEndpoints(this.client, pipelineId);
67
- };
68
- PipelineEndpoints.prototype.heartbeat = function (id_1) {
69
- return __awaiter(this, arguments, void 0, function (id, params) {
70
- if (params === void 0) { params = {}; }
71
- return __generator(this, function (_a) {
72
- return [2 /*return*/, this.client._post("".concat(this.resourceEndpoint, "/").concat(id, "/heartbeat"), { params: params })];
73
- });
74
- });
75
- };
76
- PipelineEndpoints.prototype.publishMetrics = function (metrics_1) {
77
- return __awaiter(this, arguments, void 0, function (metrics, params) {
78
- if (params === void 0) { params = {}; }
79
- return __generator(this, function (_a) {
80
- return [2 /*return*/, this.client._post("".concat(this.resourceEndpoint, "/publish-metrics"), metrics, { params: params })];
81
- });
82
- });
83
- };
84
- return PipelineEndpoints;
85
- }(base_endpoints_1.BaseEndpoints));
86
- exports.PipelineEndpoints = PipelineEndpoints;
87
- //# sourceMappingURL=pipeline.endpoints.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pipeline.endpoints.js","sourceRoot":"","sources":["../../../src/lib/pipeline.endpoints.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,mDAAiD;AAEjD,+EAA4E;AAE5E;IAAuC,qCAAwB;IAC7D,2BAAY,MAAc;QACxB,OAAA,MAAK,YAAC,MAAM,EAAE,WAAW,CAAC,SAAC;IAC7B,CAAC;IAED,sCAAU,GAAV,UAAW,UAAkB;QAC3B,OAAO,IAAI,yDAA0B,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACjE,CAAC;IAEK,qCAAS,GAAf;4DAAgB,EAAU,EAAE,MAAgC;YAAhC,uBAAA,EAAA,WAAgC;;gBAC1D,sBAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAG,IAAI,CAAC,gBAAgB,cAAI,EAAE,eAAY,EAAE,EAAE,MAAM,QAAA,EAAE,CAAC,EAAC;;;KAClF;IAEK,0CAAc,GAApB;4DAAqB,OAAe,EAAE,MAAgC;YAAhC,uBAAA,EAAA,WAAgC;;gBACpE,sBAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAG,IAAI,CAAC,gBAAgB,qBAAkB,EAAE,OAAO,EAAE,EAAE,MAAM,QAAA,EAAE,CAAC,EAAC;;;KAC3F;IACH,wBAAC;AAAD,CAAC,AAhBD,CAAuC,8BAAa,GAgBnD;AAhBY,8CAAiB","sourcesContent":["/**\n * Copyright © 2018-present Emu Analytics\n */\n\nimport { IPipeline } from './api-interfaces';\nimport { BaseEndpoints } from './base.endpoints';\nimport { Client } from './client';\nimport { PipelineComponentEndpoints } from './pipeline-component.endpoints';\n\nexport class PipelineEndpoints extends BaseEndpoints<IPipeline> {\n constructor(client: Client) {\n super(client, 'pipelines');\n }\n\n components(pipelineId: string) {\n return new PipelineComponentEndpoints(this.client, pipelineId);\n }\n\n async heartbeat(id: string, params: Record<string, any> = {}): Promise<void> {\n return this.client._post(`${this.resourceEndpoint}/${id}/heartbeat`, { params });\n }\n\n async publishMetrics(metrics: object, params: Record<string, any> = {}): Promise<void> {\n return this.client._post(`${this.resourceEndpoint}/publish-metrics`, metrics, { params });\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.StyleEndpoints = void 0;
22
- var base_endpoints_1 = require("./base.endpoints");
23
- var StyleEndpoints = /** @class */ (function (_super) {
24
- __extends(StyleEndpoints, _super);
25
- function StyleEndpoints(client) {
26
- return _super.call(this, client, 'styles') || this;
27
- }
28
- return StyleEndpoints;
29
- }(base_endpoints_1.BaseEndpoints));
30
- exports.StyleEndpoints = StyleEndpoints;
31
- //# sourceMappingURL=style.endpoint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"style.endpoint.js","sourceRoot":"","sources":["../../../src/lib/style.endpoint.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;AAIH,mDAAiD;AAEjD;IAAoC,kCAAqB;IACvD,wBAAY,MAAc;QACxB,OAAA,MAAK,YAAC,MAAM,EAAE,QAAQ,CAAC,SAAC;IAC1B,CAAC;IACH,qBAAC;AAAD,CAAC,AAJD,CAAoC,8BAAa,GAIhD;AAJY,wCAAc","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { Client } from './client';\nimport { IStyle } from './api-interfaces';\nimport { BaseEndpoints } from './base.endpoints';\n\nexport class StyleEndpoints extends BaseEndpoints<IStyle> {\n constructor(client: Client) {\n super(client, 'styles');\n }\n}\n"]}
@@ -1,39 +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.TileSourceEndpoints = void 0;
22
- var base_endpoints_1 = require("./base.endpoints");
23
- var TileSourceEndpoints = /** @class */ (function (_super) {
24
- __extends(TileSourceEndpoints, _super);
25
- function TileSourceEndpoints(client) {
26
- return _super.call(this, client, 'tilesources') || this;
27
- }
28
- TileSourceEndpoints.prototype.drivers = function () {
29
- return this.client._get("/api/v1/tilesources/drivers").catch(function (e) {
30
- if (e.statusCode === 404) {
31
- // Backwards compatibility for pre-1.0.0 Flo.w
32
- return ['tilelive', 'dataset'];
33
- }
34
- });
35
- };
36
- return TileSourceEndpoints;
37
- }(base_endpoints_1.BaseEndpoints));
38
- exports.TileSourceEndpoints = TileSourceEndpoints;
39
- //# sourceMappingURL=tile-source.endpoints.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tile-source.endpoints.js","sourceRoot":"","sources":["../../../src/lib/tile-source.endpoints.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;AAGH,mDAAiD;AAGjD;IAAyC,uCAA0B;IACjE,6BAAY,MAAc;QACxB,OAAA,MAAK,YAAC,MAAM,EAAE,aAAa,CAAC,SAAC;IAC/B,CAAC;IAED,qCAAO,GAAP;QACE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,KAAK,CAAC,UAAA,CAAC;YAC5D,IAAI,CAAC,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;gBACzB,8CAA8C;gBAC9C,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;YACjC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACH,0BAAC;AAAD,CAAC,AAbD,CAAyC,8BAAa,GAarD;AAbY,kDAAmB","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { Client } from './client';\nimport { BaseEndpoints } from './base.endpoints';\nimport { ITileSource } from './api-interfaces';\n\nexport class TileSourceEndpoints extends BaseEndpoints<ITileSource> {\n constructor(client: Client) {\n super(client, 'tilesources');\n }\n\n drivers(): Promise<string[]> {\n return this.client._get(`/api/v1/tilesources/drivers`).catch(e => {\n if (e.statusCode === 404) {\n // Backwards compatibility for pre-1.0.0 Flo.w\n return ['tilelive', 'dataset'];\n }\n });\n }\n}\n"]}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- /**
3
- * Copyright © 2018 Emu Analytics
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.TileEndpoints = void 0;
7
- var TileEndpoints = /** @class */ (function () {
8
- function TileEndpoints(client) {
9
- this.client = client;
10
- }
11
- TileEndpoints.prototype.getTileSpec = function (tilesourceId, params) {
12
- if (params === void 0) { params = {}; }
13
- return this.client._get("/tiles/".concat(tilesourceId, "/index.json"), { params: params });
14
- };
15
- TileEndpoints.prototype.getPreviewStyle = function (tilesourceId, params) {
16
- if (params === void 0) { params = {}; }
17
- return this.client._get("/tiles/".concat(tilesourceId, "/style.json"), { params: params });
18
- };
19
- return TileEndpoints;
20
- }());
21
- exports.TileEndpoints = TileEndpoints;
22
- //# sourceMappingURL=tile.endpoints.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tile.endpoints.js","sourceRoot":"","sources":["../../../src/lib/tile.endpoints.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAKH;IACE,uBAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C,mCAAW,GAAX,UAAY,YAAoB,EAAE,MAAgC;QAAhC,uBAAA,EAAA,WAAgC;QAChE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAU,YAAY,gBAAa,EAAE,EAAE,MAAM,QAAA,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,uCAAe,GAAf,UAAgB,YAAoB,EAAE,MAAgC;QAAhC,uBAAA,EAAA,WAAgC;QACpE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAU,YAAY,gBAAa,EAAE,EAAE,MAAM,QAAA,EAAE,CAAC,CAAC;IAC3E,CAAC;IACH,oBAAC;AAAD,CAAC,AAVD,IAUC;AAVY,sCAAa","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { ITileSpec } from './api-interfaces';\nimport { Client } from './client';\n\nexport class TileEndpoints {\n constructor(private readonly client: Client) {}\n\n getTileSpec(tilesourceId: string, params: Record<string, any> = {}): Promise<ITileSpec> {\n return this.client._get(`/tiles/${tilesourceId}/index.json`, { params });\n }\n\n getPreviewStyle(tilesourceId: string, params: Record<string, any> = {}): Promise<ITileSpec> {\n return this.client._get(`/tiles/${tilesourceId}/style.json`, { params });\n }\n}\n"]}
@@ -1,121 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
- var __importDefault = (this && this.__importDefault) || function (mod) {
54
- return (mod && mod.__esModule) ? mod : { "default": mod };
55
- };
56
- Object.defineProperty(exports, "__esModule", { value: true });
57
- exports.UploadEndpoints = void 0;
58
- /**
59
- * Copyright © 2018 Emu Analytics
60
- */
61
- var form_data_1 = __importDefault(require("form-data"));
62
- var base_endpoints_1 = require("./base.endpoints");
63
- var UploadEndpoints = /** @class */ (function (_super) {
64
- __extends(UploadEndpoints, _super);
65
- function UploadEndpoints(client) {
66
- return _super.call(this, client, 'uploads') || this;
67
- }
68
- UploadEndpoints.prototype.upload = function (options_1) {
69
- return __awaiter(this, arguments, void 0, function (options, params) {
70
- var form, upload;
71
- var _a, _b, _c;
72
- if (params === void 0) { params = {}; }
73
- return __generator(this, function (_d) {
74
- switch (_d.label) {
75
- case 0:
76
- form = new form_data_1.default();
77
- if (options.datasetName) {
78
- form.append('name', options.datasetName);
79
- }
80
- if (options.datasetDescription) {
81
- form.append('description', options.datasetDescription);
82
- }
83
- if (options.attribution) {
84
- form.append('attribution', options.attribution);
85
- }
86
- if (options.datasetId) {
87
- form.append('datasetId', options.datasetId);
88
- }
89
- if (options.sourceSrid) {
90
- form.append('sourceSrid', options.sourceSrid);
91
- }
92
- if (options.targetSrid) {
93
- form.append('targetSrid', options.targetSrid);
94
- }
95
- if (options.schema) {
96
- form.append('schema', options.schema);
97
- }
98
- if (options.metadata) {
99
- form.append('metadata', JSON.stringify(options.metadata));
100
- }
101
- form.append('file', options.data, options.filename);
102
- return [4 /*yield*/, this.client._post(this.resourceEndpoint, form, {
103
- // Note - only Node FormData supports getHeaders
104
- headers: (_b = (_a = form.getHeaders) === null || _a === void 0 ? void 0 : _a.call(form)) !== null && _b !== void 0 ? _b : { 'Content-Type': 'multipart/form-data' },
105
- // Add abort signal
106
- signal: (_c = options.abortController) === null || _c === void 0 ? void 0 : _c.signal,
107
- params: params,
108
- // Note that progress only works in the browser!!
109
- onUploadProgress: options.progress
110
- })];
111
- case 1:
112
- upload = _d.sent();
113
- return [2 /*return*/, upload];
114
- }
115
- });
116
- });
117
- };
118
- return UploadEndpoints;
119
- }(base_endpoints_1.BaseEndpoints));
120
- exports.UploadEndpoints = UploadEndpoints;
121
- //# sourceMappingURL=upload.endpoints.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload.endpoints.js","sourceRoot":"","sources":["../../../src/lib/upload.endpoints.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,wDAAiC;AAEjC,mDAAiD;AAoBjD;IAAqC,mCAAsB;IACzD,yBAAY,MAAc;QACxB,OAAA,MAAK,YAAC,MAAM,EAAE,SAAS,CAAC,SAAC;IAC3B,CAAC;IAEK,gCAAM,GAAZ;4DAAa,OAAsB,EAAE,MAAgC;;;YAAhC,uBAAA,EAAA,WAAgC;;;;wBAC7D,IAAI,GAAG,IAAI,mBAAQ,EA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C,IAAI,CAAC,gBAAgB,EAAE,IAAI,EAAE;gCAC3E,gDAAgD;gCAChD,OAAO,EAAE,MAAA,MAAA,IAAI,CAAC,UAAU,oDAAI,mCAAI,EAAE,cAAc,EAAE,qBAAqB,EAAE;gCACzE,mBAAmB;gCACnB,MAAM,EAAE,MAAA,OAAO,CAAC,eAAe,0CAAE,MAAM;gCACvC,MAAM,QAAA;gCACN,iDAAiD;gCACjD,gBAAgB,EAAE,OAAO,CAAC,QAAQ;6BACnC,CAAC,EAAA;;wBARI,MAAM,GAAY,SAQtB;wBAEF,sBAAO,MAAM,EAAC;;;;KACf;IACH,sBAAC;AAAD,CAAC,AA7CD,CAAqC,8BAAa,GA6CjD;AA7CY,0CAAe","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\nimport FormData from 'form-data';\nimport { IUpload } from './api-interfaces';\nimport { BaseEndpoints } from './base.endpoints';\nimport { Client } from './client';\n\ndeclare var process: any;\n\nexport interface UploadOptions {\n data: any;\n filename: string;\n datasetId?: string;\n datasetName?: string;\n datasetDescription?: string;\n attribution?: string;\n sourceSrid?: number;\n targetSrid?: number;\n schema?: string;\n metadata?: any;\n abortController?: AbortController;\n progress?: (event: any) => void;\n}\n\nexport class UploadEndpoints extends BaseEndpoints<IUpload> {\n constructor(client: Client) {\n super(client, 'uploads');\n }\n\n async upload(options: UploadOptions, params: Record<string, any> = {}): Promise<IUpload> {\n const form = new FormData();\n if (options.datasetName) {\n form.append('name', options.datasetName);\n }\n if (options.datasetDescription) {\n form.append('description', options.datasetDescription);\n }\n if (options.attribution) {\n form.append('attribution', options.attribution);\n }\n if (options.datasetId) {\n form.append('datasetId', options.datasetId);\n }\n if (options.sourceSrid) {\n form.append('sourceSrid', options.sourceSrid);\n }\n if (options.targetSrid) {\n form.append('targetSrid', options.targetSrid);\n }\n if (options.schema) {\n form.append('schema', options.schema);\n }\n if (options.metadata) {\n form.append('metadata', JSON.stringify(options.metadata));\n }\n form.append('file', options.data, options.filename);\n\n const upload: IUpload = await this.client._post(this.resourceEndpoint, form, {\n // Note - only Node FormData supports getHeaders\n headers: form.getHeaders?.() ?? { 'Content-Type': 'multipart/form-data' },\n // Add abort signal\n signal: options.abortController?.signal,\n params,\n // Note that progress only works in the browser!!\n onUploadProgress: options.progress\n });\n\n return upload;\n }\n}\n"]}
@@ -1,36 +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.UserEndpoint = void 0;
22
- var base_endpoints_1 = require("./base.endpoints");
23
- var UserEndpoint = /** @class */ (function (_super) {
24
- __extends(UserEndpoint, _super);
25
- function UserEndpoint(client) {
26
- return _super.call(this, client, 'auth/users') || this;
27
- }
28
- UserEndpoint.prototype.me = function (token) {
29
- return this.client._get("".concat(this.resourceEndpoint, "/me"), {
30
- headers: { Authorization: "Bearer ".concat(token) }
31
- });
32
- };
33
- return UserEndpoint;
34
- }(base_endpoints_1.BaseEndpoints));
35
- exports.UserEndpoint = UserEndpoint;
36
- //# sourceMappingURL=user.endpoints.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.endpoints.js","sourceRoot":"","sources":["../../../src/lib/user.endpoints.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;AAIH,mDAAiD;AAEjD;IAAkC,gCAAoB;IACpD,sBAAY,MAAc;QACxB,OAAA,MAAK,YAAC,MAAM,EAAE,YAAY,CAAC,SAAC;IAC9B,CAAC;IAED,yBAAE,GAAF,UAAG,KAAa;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAG,IAAI,CAAC,gBAAgB,QAAK,EAAE;YACrD,OAAO,EAAE,EAAE,aAAa,EAAE,iBAAU,KAAK,CAAE,EAAE;SAC9C,CAAC,CAAC;IACL,CAAC;IACH,mBAAC;AAAD,CAAC,AAVD,CAAkC,8BAAa,GAU9C;AAVY,oCAAY","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { Client } from './client';\nimport { IUser, UsersMeResponse } from './api-interfaces';\nimport { BaseEndpoints } from './base.endpoints';\n\nexport class UserEndpoint extends BaseEndpoints<IUser> {\n constructor(client: Client) {\n super(client, 'auth/users');\n }\n\n me(token: string): Promise<UsersMeResponse> {\n return this.client._get(`${this.resourceEndpoint}/me`, {\n headers: { Authorization: `Bearer ${token}` }\n });\n }\n}\n"]}
@@ -1,160 +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.WebSocketGateway = exports.WebSocketChannel = void 0;
15
- var socket_io_client_1 = require("socket.io-client");
16
- var WebSocketChannel;
17
- (function (WebSocketChannel) {
18
- WebSocketChannel["System"] = "system";
19
- WebSocketChannel["AppConfig"] = "appconfig";
20
- WebSocketChannel["Dataset"] = "dataset/";
21
- })(WebSocketChannel || (exports.WebSocketChannel = WebSocketChannel = {}));
22
- var WebSocketGateway = /** @class */ (function () {
23
- function WebSocketGateway(client, options) {
24
- this.client = client;
25
- this.options = options;
26
- this.connected = false;
27
- this.subscribedChannels = new Set();
28
- }
29
- Object.defineProperty(WebSocketGateway.prototype, "isConnected", {
30
- get: function () {
31
- return this.connected;
32
- },
33
- enumerable: false,
34
- configurable: true
35
- });
36
- WebSocketGateway.prototype.connect = function () {
37
- var _this = this;
38
- if (this.isConnected) {
39
- return Promise.resolve();
40
- }
41
- return new Promise(function (resolve, reject) {
42
- var socket = (0, socket_io_client_1.io)(_this.client.baseUrl, __assign(__assign({}, _this.options), { autoConnect: false, auth: function (cb) {
43
- var authHeaders = {};
44
- if (_this.client.apiKey) {
45
- authHeaders['x-api-key'] = _this.client.apiKey;
46
- }
47
- if (_this.client.accessToken) {
48
- authHeaders['x-socket-token'] = "Bearer ".concat(_this.client.accessToken);
49
- }
50
- cb(authHeaders);
51
- } }));
52
- socket.on('connect', function () {
53
- _this.client.debug("Socket connected: ".concat(socket.id));
54
- if (_this.subscribedChannels.size) {
55
- _this.subscribedChannels.forEach(function (channel) {
56
- socket.emit('subscribe', { channel: channel }, function (resp) {
57
- if (resp.status === 'error') {
58
- console.error("Error re-subscribing to channel '".concat(channel), resp);
59
- }
60
- else {
61
- _this.client.debug("Re-subscribed to channel '".concat(channel));
62
- }
63
- });
64
- });
65
- }
66
- });
67
- socket.io.on('reconnect_attempt', function (attempt) {
68
- _this.client.debug("Socket reconnect attempt: ".concat(attempt));
69
- });
70
- socket.io.on('reconnect_error', function (error) {
71
- _this.client.debug("Socket reconnect error: ".concat(error.message));
72
- });
73
- socket.io.on('reconnect_failed', function () {
74
- _this.client.debug("Socket reconnect failed");
75
- });
76
- socket.io.on('reconnect', function () {
77
- _this.client.debug("Socket reconnected");
78
- });
79
- socket.on('disconnect', function (reason) {
80
- _this.client.debug("Socket disconnected: ".concat(reason));
81
- });
82
- socket.on('error', function (e) {
83
- _this.client.debug("Socket error: ".concat(e.messaage));
84
- });
85
- _this.socket = socket;
86
- _this.connected = true;
87
- socket.on('connect', function () {
88
- resolve();
89
- });
90
- socket.connect();
91
- });
92
- };
93
- WebSocketGateway.prototype.disconnect = function () {
94
- var _this = this;
95
- if (!this.isConnected) {
96
- return Promise.resolve();
97
- }
98
- return new Promise(function (resolve) {
99
- _this.socket.once('disconnect', function () {
100
- _this.connected = false;
101
- resolve();
102
- });
103
- _this.socket.disconnect();
104
- });
105
- };
106
- WebSocketGateway.prototype.subscribe = function (channel, cb) {
107
- var _this = this;
108
- if (!this.isConnected) {
109
- throw new Error('WebSocketGateway is not initialized');
110
- }
111
- this.client.debug("Subscribing to channel '".concat(channel));
112
- // Discriminating 'message' event listener that only responds to messages sent to 'channel'
113
- var listener = function (msg) {
114
- if (msg.channel === channel) {
115
- cb(null, msg);
116
- }
117
- };
118
- // Unsubscriber
119
- var unsubscribe = function (unsubscribeCb) {
120
- _this.socket.off('message', listener);
121
- _this.unsubscribe(channel, unsubscribeCb);
122
- };
123
- // Subscribe and bind listener
124
- this.socket.emit('subscribe', { channel: channel }, function (resp) {
125
- if (resp.status === 'error') {
126
- _this.client.debug("Error subscribed to channel '".concat(channel), resp);
127
- return cb(new Error(resp.message));
128
- }
129
- _this.subscribedChannels.add(channel);
130
- _this.client.debug("Subscribed to channel '".concat(channel));
131
- _this.socket.on('message', listener);
132
- });
133
- return unsubscribe;
134
- };
135
- WebSocketGateway.prototype.unsubscribe = function (channel, cb) {
136
- var _this = this;
137
- if (!this.isConnected) {
138
- throw new Error('WebSocketGateway is not initialized');
139
- }
140
- this.client.debug("Unsubscribing from channel '".concat(channel));
141
- this.socket.emit('unsubscribe', { channel: channel }, function (resp) {
142
- if (resp.status === 'error') {
143
- _this.client.debug("Error unsubscribing from channel '".concat(channel), resp);
144
- if (cb) {
145
- cb(new Error(resp.message));
146
- }
147
- }
148
- else {
149
- _this.subscribedChannels.delete(channel);
150
- _this.client.debug("Unsubscribed from channel '".concat(channel));
151
- if (cb) {
152
- cb(null);
153
- }
154
- }
155
- });
156
- };
157
- return WebSocketGateway;
158
- }());
159
- exports.WebSocketGateway = WebSocketGateway;
160
- //# sourceMappingURL=web-socket-gateway.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"web-socket-gateway.js","sourceRoot":"","sources":["../../../src/lib/web-socket-gateway.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qDAA6E;AAG7E,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,2CAAuB,CAAA;IACvB,wCAAoB,CAAA;AACtB,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B;AA4BD;IAUE,0BAA4B,MAAc,EAAmB,OAAiC;QAAlE,WAAM,GAAN,MAAM,CAAQ;QAAmB,YAAO,GAAP,OAAO,CAA0B;QATtF,cAAS,GAAG,KAAK,CAAC;QAClB,uBAAkB,GAAG,IAAI,GAAG,EAAU,CAAC;IAQkD,CAAC;IAJlG,sBAAI,yCAAW;aAAf;YACE,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;;;OAAA;IAID,kCAAO,GAAP;QAAA,iBA0EC;QAzEC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;QAED,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;YACjC,IAAM,MAAM,GAAG,IAAA,qBAAE,EAAC,KAAI,CAAC,MAAM,CAAC,OAAO,wBAChC,KAAI,CAAC,OAAO,KACf,WAAW,EAAE,KAAK,EAClB,IAAI,EAAE,UAAA,EAAE;oBACN,IAAM,WAAW,GAA2B,EAAE,CAAC;oBAE/C,IAAI,KAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;wBACvB,WAAW,CAAC,WAAW,CAAC,GAAG,KAAI,CAAC,MAAM,CAAC,MAAM,CAAC;oBAChD,CAAC;oBAED,IAAI,KAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;wBAC5B,WAAW,CAAC,gBAAgB,CAAC,GAAG,iBAAU,KAAI,CAAC,MAAM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nBC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACzD,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,sCAA+B,OAAO,CAAE,CAAC,CAAC;QAC5D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,OAAO,SAAA,EAAE,EAAE,UAAC,IAAuB;YACnE,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;gBAC5B,KAAI,CAAC,MAAM,CAAC,KAAK,CAAC,4CAAqC,OAAO,CAAE,EAAE,IAAI,CAAC,CAAC;gBACxE,IAAI,EAAE,EAAE,CAAC;oBACP,EAAE,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC9B,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,KAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBACxC,KAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qCAA8B,OAAO,CAAE,CAAC,CAAC;gBAC3D,IAAI,EAAE,EAAE,CAAC;oBACP,EAAE,CAAC,IAAI,CAAC,CAAC;gBACX,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACH,uBAAC;AAAD,CAAC,AA9JD,IA8JC;AA9JY,4CAAgB","sourcesContent":["import { io, ManagerOptions, Socket, SocketOptions } from 'socket.io-client';\nimport { Client } from './client';\n\nexport enum WebSocketChannel {\n System = 'system',\n AppConfig = 'appconfig',\n Dataset = 'dataset/'\n}\n\nexport interface WebSocketPublishMessage {\n channel: string;\n messageType?: string;\n payload: unknown;\n}\n\nexport interface WebSocketSubscribeMessage {\n channel: string;\n}\n\nexport interface WebSocketErrorResponse {\n status: 'error';\n code: string;\n message: string;\n}\n\nexport interface WebSocketOkResponse {\n status: 'ok';\n}\n\nexport type WebSocketResponse = WebSocketOkResponse | WebSocketErrorResponse;\nexport type WebSocketManagerOptions = Partial<ManagerOptions & SocketOptions>;\nexport type WebSocketSubscribeCallback = (err: Error | null, msg?: WebSocketPublishMessage) => void;\nexport type WebSocketUnsubscribeCallback = (err: Error | null) => void;\nexport type WebSocketUnsubscriber = (cb?: WebSocketUnsubscribeCallback) => void;\n\nexport class WebSocketGateway {\n private connected = false;\n private subscribedChannels = new Set<string>();\n\n socket!: Socket;\n\n get isConnected(): boolean {\n return this.connected;\n }\n\n constructor(public readonly client: Client, private readonly options?: WebSocketManagerOptions) {}\n\n connect(): Promise<void> {\n if (this.isConnected) {\n return Promise.resolve();\n }\n\n return new Promise((resolve, reject) => {\n const socket = io(this.client.baseUrl, {\n ...this.options,\n autoConnect: false,\n auth: cb => {\n const authHeaders: Record<string, string> = {};\n\n if (this.client.apiKey) {\n authHeaders['x-api-key'] = this.client.apiKey;\n }\n\n if (this.client.accessToken) {\n authHeaders['x-socket-token'] = `Bearer ${this.client.accessToken}`;\n }\n\n cb(authHeaders);\n }\n });\n\n socket.on('connect', () => {\n this.client.debug(`Socket connected: ${socket.id}`);\n\n if (this.subscribedChannels.size) {\n this.subscribedChannels.forEach(channel => {\n socket.emit('subscribe', { channel }, (resp: WebSocketResponse) => {\n if (resp.status === 'error') {\n console.error(`Error re-subscribing to channel '${channel}`, resp);\n } else {\n this.client.debug(`Re-subscribed to channel '${channel}`);\n }\n });\n });\n }\n });\n\n socket.io.on('reconnect_attempt', (attempt: number) => {\n this.client.debug(`Socket reconnect attempt: ${attempt}`);\n });\n\n socket.io.on('reconnect_error', (error: Error) => {\n this.client.debug(`Socket reconnect error: ${error.message}`);\n });\n\n socket.io.on('reconnect_failed', () => {\n this.client.debug(`Socket reconnect failed`);\n });\n\n socket.io.on('reconnect', () => {\n this.client.debug(`Socket reconnected`);\n });\n\n socket.on('disconnect', reason => {\n this.client.debug(`Socket disconnected: ${reason}`);\n });\n\n socket.on('error', e => {\n this.client.debug(`Socket error: ${e.messaage}`);\n });\n\n this.socket = socket;\n\n this.connected = true;\n\n socket.on('connect', () => {\n resolve();\n });\n\n socket.connect();\n });\n }\n\n disconnect(): Promise<void> {\n if (!this.isConnected) {\n return Promise.resolve();\n }\n\n return new Promise(resolve => {\n this.socket.once('disconnect', () => {\n this.connected = false;\n resolve();\n });\n this.socket.disconnect();\n });\n }\n\n subscribe(channel: string, cb: WebSocketSubscribeCallback): WebSocketUnsubscriber {\n if (!this.isConnected) {\n throw new Error('WebSocketGateway is not initialized');\n }\n\n this.client.debug(`Subscribing to channel '${channel}`);\n\n // Discriminating 'message' event listener that only responds to messages sent to 'channel'\n const listener = (msg: WebSocketPublishMessage) => {\n if (msg.channel === channel) {\n cb(null, msg);\n }\n };\n\n // Unsubscriber\n const unsubscribe = (unsubscribeCb?: WebSocketUnsubscribeCallback) => {\n this.socket.off('message', listener);\n this.unsubscribe(channel, unsubscribeCb);\n };\n\n // Subscribe and bind listener\n this.socket.emit('subscribe', { channel }, (resp: WebSocketResponse) => {\n if (resp.status === 'error') {\n this.client.debug(`Error subscribed to channel '${channel}`, resp);\n return cb(new Error(resp.message));\n }\n\n this.subscribedChannels.add(channel);\n this.client.debug(`Subscribed to channel '${channel}`);\n this.socket.on('message', listener);\n });\n\n return unsubscribe;\n }\n\n unsubscribe(channel: string, cb?: WebSocketUnsubscribeCallback) {\n if (!this.isConnected) {\n throw new Error('WebSocketGateway is not initialized');\n }\n\n this.client.debug(`Unsubscribing from channel '${channel}`);\n this.socket.emit('unsubscribe', { channel }, (resp: WebSocketResponse) => {\n if (resp.status === 'error') {\n this.client.debug(`Error unsubscribing from channel '${channel}`, resp);\n if (cb) {\n cb(new Error(resp.message));\n }\n } else {\n this.subscribedChannels.delete(channel);\n this.client.debug(`Unsubscribed from channel '${channel}`);\n if (cb) {\n cb(null);\n }\n }\n });\n }\n}\n"]}
package/dist/esm/index.js DELETED
@@ -1,9 +0,0 @@
1
- /**
2
- * Copyright © 2022 Emu Analytics
3
- */
4
- export * from './lib/client';
5
- export * from './lib/api-interfaces';
6
- export * from './lib/base.endpoints';
7
- export * from './lib/errors';
8
- export * from './lib/web-socket-gateway';
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC","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,54 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { Client as MockClient } from '../client';
13
- MockClient.prototype._get = function (path, options) {
14
- var _a;
15
- if (options === void 0) { options = {}; }
16
- // Move apiKey from params
17
- if ((_a = options.params) === null || _a === void 0 ? void 0 : _a.apiKey) {
18
- options.apiKey = options.params.apiKey;
19
- delete options.params.apiKey;
20
- }
21
- return __assign(__assign({ method: 'get', url: path }, options), this.headers(options));
22
- };
23
- MockClient.prototype._post = function (path, data, options) {
24
- var _a;
25
- if (options === void 0) { options = {}; }
26
- // Move apiKey from params
27
- if ((_a = options.params) === null || _a === void 0 ? void 0 : _a.apiKey) {
28
- options.apiKey = options.params.apiKey;
29
- delete options.params.apiKey;
30
- }
31
- return __assign(__assign({ method: 'post', url: path, data: data }, options), this.headers(options));
32
- };
33
- MockClient.prototype._put = function (path, data, options) {
34
- var _a;
35
- if (options === void 0) { options = {}; }
36
- // Move apiKey from params
37
- if ((_a = options.params) === null || _a === void 0 ? void 0 : _a.apiKey) {
38
- options.apiKey = options.params.apiKey;
39
- delete options.params.apiKey;
40
- }
41
- return __assign(__assign({ method: 'put', url: path, data: data }, options), this.headers(options));
42
- };
43
- MockClient.prototype._delete = function (path, options) {
44
- var _a;
45
- if (options === void 0) { options = {}; }
46
- // Move apiKey from params
47
- if ((_a = options.params) === null || _a === void 0 ? void 0 : _a.apiKey) {
48
- options.apiKey = options.params.apiKey;
49
- delete options.params.apiKey;
50
- }
51
- return __assign(__assign({ method: 'delete', url: path }, options), this.headers(options));
52
- };
53
- export var Client = MockClient;
54
- //# sourceMappingURL=client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/lib/__mocks__/client.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,WAAW,CAAC;AAEjD,UAAU,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,UAAU,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,UAAU,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,UAAU,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;AAEF,MAAM,CAAC,IAAM,MAAM,GAAG,UAAU,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"]}