@emuanalytics/flow-engine-client 1.3.31 → 1.3.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/bundle.js.map +1 -1
  3. package/esm/index.d.ts +7 -0
  4. package/esm/index.d.ts.map +1 -0
  5. package/esm/index.js +7 -0
  6. package/esm/index.js.map +1 -0
  7. package/esm/lib/api-interfaces.d.ts +207 -0
  8. package/esm/lib/api-interfaces.d.ts.map +1 -0
  9. package/esm/lib/api-interfaces.js +5 -0
  10. package/esm/lib/api-interfaces.js.map +1 -0
  11. package/esm/lib/apikey.endpoints.d.ts +10 -0
  12. package/esm/lib/apikey.endpoints.d.ts.map +1 -0
  13. package/esm/lib/apikey.endpoints.js +28 -0
  14. package/esm/lib/apikey.endpoints.js.map +1 -0
  15. package/esm/lib/appconfig.endpoints.d.ts +10 -0
  16. package/esm/lib/appconfig.endpoints.d.ts.map +1 -0
  17. package/esm/lib/appconfig.endpoints.js +28 -0
  18. package/esm/lib/appconfig.endpoints.js.map +1 -0
  19. package/esm/lib/application.endpoints.d.ts +10 -0
  20. package/esm/lib/application.endpoints.d.ts.map +1 -0
  21. package/esm/lib/application.endpoints.js +28 -0
  22. package/esm/lib/application.endpoints.js.map +1 -0
  23. package/esm/lib/auth.edpoints.d.ts +19 -0
  24. package/esm/lib/auth.edpoints.d.ts.map +1 -0
  25. package/esm/lib/auth.edpoints.js +49 -0
  26. package/esm/lib/auth.edpoints.js.map +1 -0
  27. package/esm/lib/base.endpoints.d.ts +20 -0
  28. package/esm/lib/base.endpoints.d.ts.map +1 -0
  29. package/esm/lib/base.endpoints.js +71 -0
  30. package/esm/lib/base.endpoints.js.map +1 -0
  31. package/esm/lib/client.d.ts +49 -0
  32. package/esm/lib/client.d.ts.map +1 -0
  33. package/esm/lib/client.js +142 -0
  34. package/esm/lib/client.js.map +1 -0
  35. package/esm/lib/database.endpoints.d.ts +11 -0
  36. package/esm/lib/database.endpoints.d.ts.map +1 -0
  37. package/esm/lib/database.endpoints.js +36 -0
  38. package/esm/lib/database.endpoints.js.map +1 -0
  39. package/esm/lib/dataset.endpoints.d.ts +22 -0
  40. package/esm/lib/dataset.endpoints.d.ts.map +1 -0
  41. package/esm/lib/dataset.endpoints.js +72 -0
  42. package/esm/lib/dataset.endpoints.js.map +1 -0
  43. package/esm/lib/errors.d.ts +9 -0
  44. package/esm/lib/errors.d.ts.map +1 -0
  45. package/esm/lib/errors.js +33 -0
  46. package/esm/lib/errors.js.map +1 -0
  47. package/esm/lib/job.endpoints.d.ts +15 -0
  48. package/esm/lib/job.endpoints.d.ts.map +1 -0
  49. package/esm/lib/job.endpoints.js +43 -0
  50. package/esm/lib/job.endpoints.js.map +1 -0
  51. package/esm/lib/map.endoints.d.ts +11 -0
  52. package/esm/lib/map.endoints.d.ts.map +1 -0
  53. package/esm/lib/map.endoints.js +15 -0
  54. package/esm/lib/map.endoints.js.map +1 -0
  55. package/esm/lib/style.endpoint.d.ts +10 -0
  56. package/esm/lib/style.endpoint.d.ts.map +1 -0
  57. package/esm/lib/style.endpoint.js +28 -0
  58. package/esm/lib/style.endpoint.js.map +1 -0
  59. package/esm/lib/tile-source.endpoints.d.ts +11 -0
  60. package/esm/lib/tile-source.endpoints.d.ts.map +1 -0
  61. package/esm/lib/tile-source.endpoints.js +36 -0
  62. package/esm/lib/tile-source.endpoints.js.map +1 -0
  63. package/esm/lib/tile.endpoints.d.ts +12 -0
  64. package/esm/lib/tile.endpoints.d.ts.map +1 -0
  65. package/esm/lib/tile.endpoints.js +19 -0
  66. package/esm/lib/tile.endpoints.js.map +1 -0
  67. package/esm/lib/upload.endpoints.d.ts +23 -0
  68. package/esm/lib/upload.endpoints.d.ts.map +1 -0
  69. package/esm/lib/upload.endpoints.js +105 -0
  70. package/esm/lib/upload.endpoints.js.map +1 -0
  71. package/esm/lib/user.endpoints.d.ts +11 -0
  72. package/esm/lib/user.endpoints.d.ts.map +1 -0
  73. package/esm/lib/user.endpoints.js +33 -0
  74. package/esm/lib/user.endpoints.js.map +1 -0
  75. package/lib/index.d.ts +7 -0
  76. package/lib/index.d.ts.map +1 -0
  77. package/lib/index.js +23 -0
  78. package/lib/index.js.map +1 -0
  79. package/lib/lib/api-interfaces.d.ts +207 -0
  80. package/lib/lib/api-interfaces.d.ts.map +1 -0
  81. package/lib/lib/api-interfaces.js +6 -0
  82. package/lib/lib/api-interfaces.js.map +1 -0
  83. package/lib/lib/apikey.endpoints.d.ts +10 -0
  84. package/lib/lib/apikey.endpoints.d.ts.map +1 -0
  85. package/lib/lib/apikey.endpoints.js +31 -0
  86. package/lib/lib/apikey.endpoints.js.map +1 -0
  87. package/lib/lib/appconfig.endpoints.d.ts +10 -0
  88. package/lib/lib/appconfig.endpoints.d.ts.map +1 -0
  89. package/lib/lib/appconfig.endpoints.js +31 -0
  90. package/lib/lib/appconfig.endpoints.js.map +1 -0
  91. package/lib/lib/application.endpoints.d.ts +10 -0
  92. package/lib/lib/application.endpoints.d.ts.map +1 -0
  93. package/lib/lib/application.endpoints.js +31 -0
  94. package/lib/lib/application.endpoints.js.map +1 -0
  95. package/lib/lib/auth.edpoints.d.ts +19 -0
  96. package/lib/lib/auth.edpoints.d.ts.map +1 -0
  97. package/lib/lib/auth.edpoints.js +52 -0
  98. package/lib/lib/auth.edpoints.js.map +1 -0
  99. package/lib/lib/base.endpoints.d.ts +20 -0
  100. package/lib/lib/base.endpoints.d.ts.map +1 -0
  101. package/lib/lib/base.endpoints.js +74 -0
  102. package/lib/lib/base.endpoints.js.map +1 -0
  103. package/lib/lib/client.d.ts +49 -0
  104. package/lib/lib/client.d.ts.map +1 -0
  105. package/lib/lib/client.js +148 -0
  106. package/lib/lib/client.js.map +1 -0
  107. package/lib/lib/database.endpoints.d.ts +11 -0
  108. package/lib/lib/database.endpoints.d.ts.map +1 -0
  109. package/lib/lib/database.endpoints.js +39 -0
  110. package/lib/lib/database.endpoints.js.map +1 -0
  111. package/lib/lib/dataset.endpoints.d.ts +22 -0
  112. package/lib/lib/dataset.endpoints.d.ts.map +1 -0
  113. package/lib/lib/dataset.endpoints.js +75 -0
  114. package/lib/lib/dataset.endpoints.js.map +1 -0
  115. package/lib/lib/errors.d.ts +9 -0
  116. package/lib/lib/errors.d.ts.map +1 -0
  117. package/lib/lib/errors.js +36 -0
  118. package/lib/lib/errors.js.map +1 -0
  119. package/lib/lib/job.endpoints.d.ts +15 -0
  120. package/lib/lib/job.endpoints.d.ts.map +1 -0
  121. package/lib/lib/job.endpoints.js +46 -0
  122. package/lib/lib/job.endpoints.js.map +1 -0
  123. package/lib/lib/map.endoints.d.ts +11 -0
  124. package/lib/lib/map.endoints.d.ts.map +1 -0
  125. package/lib/lib/map.endoints.js +18 -0
  126. package/lib/lib/map.endoints.js.map +1 -0
  127. package/lib/lib/style.endpoint.d.ts +10 -0
  128. package/lib/lib/style.endpoint.d.ts.map +1 -0
  129. package/lib/lib/style.endpoint.js +31 -0
  130. package/lib/lib/style.endpoint.js.map +1 -0
  131. package/lib/lib/tile-source.endpoints.d.ts +11 -0
  132. package/lib/lib/tile-source.endpoints.d.ts.map +1 -0
  133. package/lib/lib/tile-source.endpoints.js +39 -0
  134. package/lib/lib/tile-source.endpoints.js.map +1 -0
  135. package/lib/lib/tile.endpoints.d.ts +12 -0
  136. package/lib/lib/tile.endpoints.d.ts.map +1 -0
  137. package/lib/lib/tile.endpoints.js +22 -0
  138. package/lib/lib/tile.endpoints.js.map +1 -0
  139. package/lib/lib/upload.endpoints.d.ts +23 -0
  140. package/lib/lib/upload.endpoints.d.ts.map +1 -0
  141. package/lib/lib/upload.endpoints.js +111 -0
  142. package/lib/lib/upload.endpoints.js.map +1 -0
  143. package/lib/lib/user.endpoints.d.ts +11 -0
  144. package/lib/lib/user.endpoints.d.ts.map +1 -0
  145. package/lib/lib/user.endpoints.js +36 -0
  146. package/lib/lib/user.endpoints.js.map +1 -0
  147. package/package.json +3 -3
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright © 2018 Emu Analytics
3
+ */
4
+ export declare class FlowEngineError extends Error {
5
+ error: object | null;
6
+ statusCode: number;
7
+ constructor(message: string, underlyingError?: Error | null, statusCode?: number);
8
+ }
9
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,qBAAa,eAAgB,SAAQ,KAAK;IACxC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;gBAEP,OAAO,EAAE,MAAM,EAAE,eAAe,GAAE,KAAK,GAAG,IAAW,EAAE,UAAU,SAAM;CAQpF"}
@@ -0,0 +1,36 @@
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.FlowEngineError = void 0;
22
+ var FlowEngineError = /** @class */ (function (_super) {
23
+ __extends(FlowEngineError, _super);
24
+ function FlowEngineError(message, underlyingError, statusCode) {
25
+ if (underlyingError === void 0) { underlyingError = null; }
26
+ if (statusCode === void 0) { statusCode = 500; }
27
+ var _this = _super.call(this, message || 'Unknown Error') || this;
28
+ Object.setPrototypeOf(_this, FlowEngineError.prototype);
29
+ _this.statusCode = statusCode;
30
+ _this.error = underlyingError;
31
+ return _this;
32
+ }
33
+ return FlowEngineError;
34
+ }(Error));
35
+ exports.FlowEngineError = FlowEngineError;
36
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;AAEH;IAAqC,mCAAK;IAIxC,yBAAY,OAAe,EAAE,eAAoC,EAAE,UAAgB;QAAtD,gCAAA,EAAA,sBAAoC;QAAE,2BAAA,EAAA,gBAAgB;QAAnF,YACE,kBAAM,OAAO,IAAI,eAAe,CAAC,SAMlC;QAJC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;QAEvD,KAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,KAAI,CAAC,KAAK,GAAG,eAAe,CAAC;;IAC/B,CAAC;IACH,sBAAC;AAAD,CAAC,AAZD,CAAqC,KAAK,GAYzC;AAZY,0CAAe","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nexport class FlowEngineError extends Error {\n error: object | null;\n statusCode: number;\n\n constructor(message: string, underlyingError: Error | null = null, statusCode = 500) {\n super(message || 'Unknown Error');\n\n Object.setPrototypeOf(this, FlowEngineError.prototype);\n\n this.statusCode = statusCode;\n this.error = underlyingError;\n }\n}\n"]}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright © 2018 Emu Analytics
3
+ */
4
+ import { Client } from './client';
5
+ import { BaseEndpoints } from './base.endpoints';
6
+ import { IJob, IJobSubmission, IJobStatus } from './api-interfaces';
7
+ export declare class JobEndpoints extends BaseEndpoints<IJob> {
8
+ constructor(client: Client);
9
+ submit(submission: IJobSubmission): Promise<IJob>;
10
+ getStatus(jobId: string): Promise<IJobStatus>;
11
+ setStatus(jobId: string, status: IJobStatus): Promise<IJob>;
12
+ cancel(jobId: string): Promise<IJob>;
13
+ request(jobType: string): Promise<IJob>;
14
+ }
15
+ //# sourceMappingURL=job.endpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"job.endpoints.d.ts","sourceRoot":"","sources":["../../src/lib/job.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEpE,qBAAa,YAAa,SAAQ,aAAa,CAAC,IAAI,CAAC;gBACvC,MAAM,EAAE,MAAM;IAI1B,MAAM,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjD,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAI7C,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3D,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpC,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGxC"}
@@ -0,0 +1,46 @@
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.JobEndpoints = void 0;
22
+ var base_endpoints_1 = require("./base.endpoints");
23
+ var JobEndpoints = /** @class */ (function (_super) {
24
+ __extends(JobEndpoints, _super);
25
+ function JobEndpoints(client) {
26
+ return _super.call(this, client, 'jobs') || this;
27
+ }
28
+ JobEndpoints.prototype.submit = function (submission) {
29
+ return this.client._post("/api/v1/jobs/submit", submission);
30
+ };
31
+ JobEndpoints.prototype.getStatus = function (jobId) {
32
+ return this.client._get("/api/v1/jobs/".concat(jobId, "/status"));
33
+ };
34
+ JobEndpoints.prototype.setStatus = function (jobId, status) {
35
+ return this.client._post("/api/v1/jobs/".concat(jobId, "/status"), status);
36
+ };
37
+ JobEndpoints.prototype.cancel = function (jobId) {
38
+ return this.client._post("/api/v1/jobs/".concat(jobId, "/cancel"), {});
39
+ };
40
+ JobEndpoints.prototype.request = function (jobType) {
41
+ return this.client._post("/api/v1/jobs/request", { type: jobType });
42
+ };
43
+ return JobEndpoints;
44
+ }(base_endpoints_1.BaseEndpoints));
45
+ exports.JobEndpoints = JobEndpoints;
46
+ //# sourceMappingURL=job.endpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"job.endpoints.js","sourceRoot":"","sources":["../../src/lib/job.endpoints.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;AAGH,mDAAiD;AAGjD;IAAkC,gCAAmB;IACnD,sBAAY,MAAc;eACxB,kBAAM,MAAM,EAAE,MAAM,CAAC;IACvB,CAAC;IAED,6BAAM,GAAN,UAAO,UAA0B;QAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC;IAC9D,CAAC;IAED,gCAAS,GAAT,UAAU,KAAa;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,uBAAgB,KAAK,YAAS,CAAC,CAAC;IAC1D,CAAC;IAED,gCAAS,GAAT,UAAU,KAAa,EAAE,MAAkB;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAgB,KAAK,YAAS,EAAE,MAAM,CAAC,CAAC;IACnE,CAAC;IAED,6BAAM,GAAN,UAAO,KAAa;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAgB,KAAK,YAAS,EAAE,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED,8BAAO,GAAP,UAAQ,OAAe;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IACH,mBAAC;AAAD,CAAC,AAxBD,CAAkC,8BAAa,GAwB9C;AAxBY,oCAAY","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { Client } from './client';\nimport { BaseEndpoints } from './base.endpoints';\nimport { IJob, IJobSubmission, IJobStatus } from './api-interfaces';\n\nexport class JobEndpoints extends BaseEndpoints<IJob> {\n constructor(client: Client) {\n super(client, 'jobs');\n }\n\n submit(submission: IJobSubmission): Promise<IJob> {\n return this.client._post(`/api/v1/jobs/submit`, submission);\n }\n\n getStatus(jobId: string): Promise<IJobStatus> {\n return this.client._get(`/api/v1/jobs/${jobId}/status`);\n }\n\n setStatus(jobId: string, status: IJobStatus): Promise<IJob> {\n return this.client._post(`/api/v1/jobs/${jobId}/status`, status);\n }\n\n cancel(jobId: string): Promise<IJob> {\n return this.client._post(`/api/v1/jobs/${jobId}/cancel`, {});\n }\n\n request(jobType: string): Promise<IJob> {\n return this.client._post(`/api/v1/jobs/request`, { type: jobType });\n }\n}\n"]}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright © 2018 Emu Analytics
3
+ */
4
+ import { Client } from './client';
5
+ import { IStyle } from './api-interfaces';
6
+ export declare class MapEndpoints {
7
+ private readonly client;
8
+ constructor(client: Client);
9
+ get(id: string, params?: Record<string, any>): Promise<IStyle>;
10
+ }
11
+ //# sourceMappingURL=map.endoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map.endoints.d.ts","sourceRoot":"","sources":["../../src/lib/map.endoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAGnE"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright © 2018 Emu Analytics
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MapEndpoints = void 0;
7
+ var MapEndpoints = /** @class */ (function () {
8
+ function MapEndpoints(client) {
9
+ this.client = client;
10
+ }
11
+ MapEndpoints.prototype.get = function (id, params) {
12
+ if (params === void 0) { params = {}; }
13
+ return this.client._get("/maps/".concat(id, ".json"), { params: params });
14
+ };
15
+ return MapEndpoints;
16
+ }());
17
+ exports.MapEndpoints = MapEndpoints;
18
+ //# sourceMappingURL=map.endoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map.endoints.js","sourceRoot":"","sources":["../../src/lib/map.endoints.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAKH;IACE,sBAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C,0BAAG,GAAH,UAAI,EAAU,EAAE,MAAgC;QAAhC,uBAAA,EAAA,WAAgC;QAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAS,EAAE,UAAO,EAAE,EAAE,MAAM,QAAA,EAAE,CAAC,CAAC;IAC1D,CAAC;IACH,mBAAC;AAAD,CAAC,AAND,IAMC;AANY,oCAAY","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\n\nimport { Client } from './client';\nimport { IStyle } from './api-interfaces';\n\nexport class MapEndpoints {\n constructor(private readonly client: Client) {}\n\n get(id: string, params: Record<string, any> = {}): Promise<IStyle> {\n return this.client._get(`/maps/${id}.json`, { params });\n }\n}\n"]}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright © 2018 Emu Analytics
3
+ */
4
+ import { Client } from './client';
5
+ import { IStyle } from './api-interfaces';
6
+ import { BaseEndpoints } from './base.endpoints';
7
+ export declare class StyleEndpoints extends BaseEndpoints<IStyle> {
8
+ constructor(client: Client);
9
+ }
10
+ //# sourceMappingURL=style.endpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.endpoint.d.ts","sourceRoot":"","sources":["../../src/lib/style.endpoint.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBAAa,cAAe,SAAQ,aAAa,CAAC,MAAM,CAAC;gBAC3C,MAAM,EAAE,MAAM;CAG3B"}
@@ -0,0 +1,31 @@
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
@@ -0,0 +1 @@
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;eACxB,kBAAM,MAAM,EAAE,QAAQ,CAAC;IACzB,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"]}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright © 2018 Emu Analytics
3
+ */
4
+ import { Client } from './client';
5
+ import { BaseEndpoints } from './base.endpoints';
6
+ import { ITileSource } from './api-interfaces';
7
+ export declare class TileSourceEndpoints extends BaseEndpoints<ITileSource> {
8
+ constructor(client: Client);
9
+ drivers(): Promise<string[]>;
10
+ }
11
+ //# sourceMappingURL=tile-source.endpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tile-source.endpoints.d.ts","sourceRoot":"","sources":["../../src/lib/tile-source.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,qBAAa,mBAAoB,SAAQ,aAAa,CAAC,WAAW,CAAC;gBACrD,MAAM,EAAE,MAAM;IAI1B,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAQ7B"}
@@ -0,0 +1,39 @@
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
@@ -0,0 +1 @@
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;eACxB,kBAAM,MAAM,EAAE,aAAa,CAAC;IAC9B,CAAC;IAED,qCAAO,GAAP;QACE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,KAAK,CAAC,UAAA,CAAC;YAC5D,IAAI,CAAC,CAAC,UAAU,KAAK,GAAG,EAAE;gBACxB,8CAA8C;gBAC9C,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;aAChC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACH,0BAAC;AAAD,CAAC,AAbD,CAAyC,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"]}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright © 2018 Emu Analytics
3
+ */
4
+ import { Client } from './client';
5
+ import { ITileSpec } from './api-interfaces';
6
+ export declare class TileEndpoints {
7
+ private readonly client;
8
+ constructor(client: Client);
9
+ getTileSpec(tilesourceId: string, params?: Record<string, any>): Promise<ITileSpec>;
10
+ getPreviewStyle(tilesourceId: string, params?: Record<string, any>): Promise<ITileSpec>;
11
+ }
12
+ //# sourceMappingURL=tile.endpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tile.endpoints.d.ts","sourceRoot":"","sources":["../../src/lib/tile.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAIvF,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,OAAO,CAAC,SAAS,CAAC;CAG5F"}
@@ -0,0 +1,22 @@
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
@@ -0,0 +1 @@
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 { Client } from './client';\nimport { ITileSpec } from './api-interfaces';\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"]}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright © 2018 Emu Analytics
3
+ */
4
+ import { Client } from './client';
5
+ import { BaseEndpoints } from './base.endpoints';
6
+ import { IUpload } from './api-interfaces';
7
+ export interface UploadOptions {
8
+ data: any;
9
+ filename: string;
10
+ datasetId?: string;
11
+ datasetName?: string;
12
+ datasetDescription?: string;
13
+ attribution?: string;
14
+ sourceSrid?: number;
15
+ targetSrid?: number;
16
+ schema?: string;
17
+ progress?: (event: any) => void;
18
+ }
19
+ export declare class UploadEndpoints extends BaseEndpoints<IUpload> {
20
+ constructor(client: Client);
21
+ upload(options: UploadOptions, params?: Record<string, any>): Promise<IUpload>;
22
+ }
23
+ //# sourceMappingURL=upload.endpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.endpoints.d.ts","sourceRoot":"","sources":["../../src/lib/upload.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAK3C,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,GAAG,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CACjC;AAED,qBAAa,eAAgB,SAAQ,aAAa,CAAC,OAAO,CAAC;gBAC7C,MAAM,EAAE,MAAM;IAIpB,MAAM,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAkCzF"}
@@ -0,0 +1,111 @@
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;
28
+ return g = { next: verb(0), "throw": verb(1), "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 (_) 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
+ var base_endpoints_1 = require("./base.endpoints");
59
+ var form_data_1 = __importDefault(require("form-data"));
60
+ var UploadEndpoints = /** @class */ (function (_super) {
61
+ __extends(UploadEndpoints, _super);
62
+ function UploadEndpoints(client) {
63
+ return _super.call(this, client, 'uploads') || this;
64
+ }
65
+ UploadEndpoints.prototype.upload = function (options, params) {
66
+ if (params === void 0) { params = {}; }
67
+ return __awaiter(this, void 0, void 0, function () {
68
+ var form, upload;
69
+ return __generator(this, function (_a) {
70
+ switch (_a.label) {
71
+ case 0:
72
+ form = new form_data_1.default();
73
+ if (options.datasetName) {
74
+ form.append('name', options.datasetName);
75
+ }
76
+ if (options.datasetDescription) {
77
+ form.append('description', options.datasetDescription);
78
+ }
79
+ if (options.attribution) {
80
+ form.append('attribution', options.attribution);
81
+ }
82
+ if (options.datasetId) {
83
+ form.append('datasetId', options.datasetId);
84
+ }
85
+ if (options.sourceSrid) {
86
+ form.append('sourceSrid', options.sourceSrid);
87
+ }
88
+ if (options.targetSrid) {
89
+ form.append('targetSrid', options.targetSrid);
90
+ }
91
+ if (options.schema) {
92
+ form.append('schema', options.schema);
93
+ }
94
+ form.append('file', options.data, options.filename);
95
+ return [4 /*yield*/, this.client._post(this.resourceEndpoint, form, {
96
+ headers: form.getHeaders(),
97
+ params: params,
98
+ // Note that progress only works in the browser!!
99
+ onUploadProgress: options.progress
100
+ })];
101
+ case 1:
102
+ upload = _a.sent();
103
+ return [2 /*return*/, upload];
104
+ }
105
+ });
106
+ });
107
+ };
108
+ return UploadEndpoints;
109
+ }(base_endpoints_1.BaseEndpoints));
110
+ exports.UploadEndpoints = UploadEndpoints;
111
+ //# sourceMappingURL=upload.endpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.endpoints.js","sourceRoot":"","sources":["../../src/lib/upload.endpoints.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mDAAiD;AAEjD,wDAAiC;AAiBjC;IAAqC,mCAAsB;IACzD,yBAAY,MAAc;eACxB,kBAAM,MAAM,EAAE,SAAS,CAAC;IAC1B,CAAC;IAEK,gCAAM,GAAZ,UAAa,OAAsB,EAAE,MAAgC;QAAhC,uBAAA,EAAA,WAAgC;;;;;;wBAC7D,IAAI,GAAG,IAAI,mBAAQ,EAAE,CAAC;wBAC5B,IAAI,OAAO,CAAC,WAAW,EAAE;4BACvB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;yBAC1C;wBACD,IAAI,OAAO,CAAC,kBAAkB,EAAE;4BAC9B,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;yBACxD;wBACD,IAAI,OAAO,CAAC,WAAW,EAAE;4BACvB,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;yBACjD;wBACD,IAAI,OAAO,CAAC,SAAS,EAAE;4BACrB,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;yBAC7C;wBACD,IAAI,OAAO,CAAC,UAAU,EAAE;4BACtB,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;yBAC/C;wBACD,IAAI,OAAO,CAAC,UAAU,EAAE;4BACtB,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;yBAC/C;wBACD,IAAI,OAAO,CAAC,MAAM,EAAE;4BAClB,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;yBACvC;wBACD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;wBAE5B,qBAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,EAAE;gCAC3E,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE;gCAC1B,MAAM,QAAA;gCACN,iDAAiD;gCACjD,gBAAgB,EAAE,OAAO,CAAC,QAAQ;6BACnC,CAAC,EAAA;;wBALI,MAAM,GAAY,SAKtB;wBAEF,sBAAO,MAAM,EAAC;;;;KACf;IACH,sBAAC;AAAD,CAAC,AAvCD,CAAqC,8BAAa,GAuCjD;AAvCY,0CAAe","sourcesContent":["/**\n * Copyright © 2018 Emu Analytics\n */\nimport { Client } from './client';\nimport { BaseEndpoints } from './base.endpoints';\nimport { IUpload } from './api-interfaces';\nimport FormData from 'form-data';\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 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 form.append('file', options.data, options.filename);\n\n const upload: IUpload = await this.client._post(this.resourceEndpoint, form, {\n headers: form.getHeaders(),\n params,\n // Note that progress only works in the browser!!\n onUploadProgress: options.progress\n });\n\n return upload;\n }\n}\n"]}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright © 2018 Emu Analytics
3
+ */
4
+ import { Client } from './client';
5
+ import { IUser, UsersMeResponse } from './api-interfaces';
6
+ import { BaseEndpoints } from './base.endpoints';
7
+ export declare class UserEndpoint extends BaseEndpoints<IUser> {
8
+ constructor(client: Client);
9
+ me(token: string): Promise<UsersMeResponse>;
10
+ }
11
+ //# sourceMappingURL=user.endpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.endpoints.d.ts","sourceRoot":"","sources":["../../src/lib/user.endpoints.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBAAa,YAAa,SAAQ,aAAa,CAAC,KAAK,CAAC;gBACxC,MAAM,EAAE,MAAM;IAI1B,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;CAK5C"}
@@ -0,0 +1,36 @@
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
@@ -0,0 +1 @@
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;eACxB,kBAAM,MAAM,EAAE,YAAY,CAAC;IAC7B,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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emuanalytics/flow-engine-client",
3
- "version": "1.3.31",
3
+ "version": "1.3.34",
4
4
  "description": "Flow Engine Client",
5
5
  "author": "Robin Summerhill <robin.summerhill@emu-analytics.com>",
6
6
  "license": "Copyright 2018 Emu Analytics Limited",
@@ -9,7 +9,7 @@
9
9
  "module": "esm/index.js",
10
10
  "types": "lib/index.d.ts",
11
11
  "scripts": {
12
- "build": "npm run build:lib & npm run build:esm & npm run build:bundle",
12
+ "build": "npm run build:lib && npm run build:esm && npm run build:bundle",
13
13
  "build:lib": "tsc --outDir lib --module commonjs",
14
14
  "build:esm": "tsc --outDir esm --module es2015",
15
15
  "build:bundle": "esbuild src/index.ts --minify --bundle --sourcemap --target=chrome58,firefox57,safari11,edge16 --global-name=FlowEngineClient --outfile=dist/bundle.js",
@@ -60,5 +60,5 @@
60
60
  "git add"
61
61
  ]
62
62
  },
63
- "gitHead": "e5974a582bed28bf44655ee8ada5cf23987fa2a4"
63
+ "gitHead": "5a9000bf4cdf3a80e0fceb86700cdf8dcf1576ab"
64
64
  }