@metriport/api-sdk 18.14.1-alpha.0 → 18.14.2-alpha.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 (225) hide show
  1. package/dist/scratch-embed-token.d.ts +10 -0
  2. package/dist/scratch-embed-token.d.ts.map +1 -0
  3. package/dist/scratch-embed-token.js +87 -0
  4. package/dist/scratch-embed-token.js.map +1 -0
  5. package/package.json +3 -3
  6. package/dist/src/devices/client/metriport.d.ts +0 -181
  7. package/dist/src/devices/client/metriport.d.ts.map +0 -1
  8. package/dist/src/devices/client/metriport.js +0 -263
  9. package/dist/src/devices/client/metriport.js.map +0 -1
  10. package/dist/src/devices/client/models/get-connect-token-response.d.ts +0 -4
  11. package/dist/src/devices/client/models/get-connect-token-response.d.ts.map +0 -1
  12. package/dist/src/devices/client/models/get-connect-token-response.js +0 -3
  13. package/dist/src/devices/client/models/get-connect-token-response.js.map +0 -1
  14. package/dist/src/devices/client/models/get-connected-users-response.d.ts +0 -5
  15. package/dist/src/devices/client/models/get-connected-users-response.d.ts.map +0 -1
  16. package/dist/src/devices/client/models/get-connected-users-response.js +0 -3
  17. package/dist/src/devices/client/models/get-connected-users-response.js.map +0 -1
  18. package/dist/src/devices/client/models/get-metriport-user-id-response.d.ts +0 -4
  19. package/dist/src/devices/client/models/get-metriport-user-id-response.d.ts.map +0 -1
  20. package/dist/src/devices/client/models/get-metriport-user-id-response.js +0 -3
  21. package/dist/src/devices/client/models/get-metriport-user-id-response.js.map +0 -1
  22. package/dist/src/devices/client/models/settings-response.d.ts +0 -6
  23. package/dist/src/devices/client/models/settings-response.d.ts.map +0 -1
  24. package/dist/src/devices/client/models/settings-response.js +0 -3
  25. package/dist/src/devices/client/models/settings-response.js.map +0 -1
  26. package/dist/src/devices/client/models/webhook-status-response.d.ts +0 -7
  27. package/dist/src/devices/client/models/webhook-status-response.d.ts.map +0 -1
  28. package/dist/src/devices/client/models/webhook-status-response.js +0 -3
  29. package/dist/src/devices/client/models/webhook-status-response.js.map +0 -1
  30. package/dist/src/devices/client/util/date-util.d.ts +0 -2
  31. package/dist/src/devices/client/util/date-util.d.ts.map +0 -1
  32. package/dist/src/devices/client/util/date-util.js +0 -16
  33. package/dist/src/devices/client/util/date-util.js.map +0 -1
  34. package/dist/src/devices/client/util/timezone-util.d.ts +0 -2
  35. package/dist/src/devices/client/util/timezone-util.d.ts.map +0 -1
  36. package/dist/src/devices/client/util/timezone-util.js +0 -20
  37. package/dist/src/devices/client/util/timezone-util.js.map +0 -1
  38. package/dist/src/devices/models/activity.d.ts +0 -22
  39. package/dist/src/devices/models/activity.d.ts.map +0 -1
  40. package/dist/src/devices/models/activity.js +0 -3
  41. package/dist/src/devices/models/activity.js.map +0 -1
  42. package/dist/src/devices/models/biometrics.d.ts +0 -17
  43. package/dist/src/devices/models/biometrics.d.ts.map +0 -1
  44. package/dist/src/devices/models/biometrics.js +0 -3
  45. package/dist/src/devices/models/biometrics.js.map +0 -1
  46. package/dist/src/devices/models/body.d.ts +0 -13
  47. package/dist/src/devices/models/body.d.ts.map +0 -1
  48. package/dist/src/devices/models/body.js +0 -3
  49. package/dist/src/devices/models/body.js.map +0 -1
  50. package/dist/src/devices/models/common/activity-durations.d.ts +0 -19
  51. package/dist/src/devices/models/common/activity-durations.d.ts.map +0 -1
  52. package/dist/src/devices/models/common/activity-durations.js +0 -3
  53. package/dist/src/devices/models/common/activity-durations.js.map +0 -1
  54. package/dist/src/devices/models/common/activity-log.d.ts +0 -32
  55. package/dist/src/devices/models/common/activity-log.d.ts.map +0 -1
  56. package/dist/src/devices/models/common/activity-log.js +0 -3
  57. package/dist/src/devices/models/common/activity-log.js.map +0 -1
  58. package/dist/src/devices/models/common/activity-movement.d.ts +0 -16
  59. package/dist/src/devices/models/common/activity-movement.d.ts.map +0 -1
  60. package/dist/src/devices/models/common/activity-movement.js +0 -3
  61. package/dist/src/devices/models/common/activity-movement.js.map +0 -1
  62. package/dist/src/devices/models/common/aminos.d.ts +0 -23
  63. package/dist/src/devices/models/common/aminos.d.ts.map +0 -1
  64. package/dist/src/devices/models/common/aminos.js +0 -3
  65. package/dist/src/devices/models/common/aminos.js.map +0 -1
  66. package/dist/src/devices/models/common/blood-glucose.d.ts +0 -6
  67. package/dist/src/devices/models/common/blood-glucose.d.ts.map +0 -1
  68. package/dist/src/devices/models/common/blood-glucose.js +0 -3
  69. package/dist/src/devices/models/common/blood-glucose.js.map +0 -1
  70. package/dist/src/devices/models/common/blood-pressure.d.ts +0 -10
  71. package/dist/src/devices/models/common/blood-pressure.d.ts.map +0 -1
  72. package/dist/src/devices/models/common/blood-pressure.js +0 -3
  73. package/dist/src/devices/models/common/blood-pressure.js.map +0 -1
  74. package/dist/src/devices/models/common/connected-user-info.d.ts +0 -6
  75. package/dist/src/devices/models/common/connected-user-info.d.ts.map +0 -1
  76. package/dist/src/devices/models/common/connected-user-info.js +0 -3
  77. package/dist/src/devices/models/common/connected-user-info.js.map +0 -1
  78. package/dist/src/devices/models/common/energy-expenditure.d.ts +0 -7
  79. package/dist/src/devices/models/common/energy-expenditure.d.ts.map +0 -1
  80. package/dist/src/devices/models/common/energy-expenditure.js +0 -3
  81. package/dist/src/devices/models/common/energy-expenditure.js.map +0 -1
  82. package/dist/src/devices/models/common/food.d.ts +0 -15
  83. package/dist/src/devices/models/common/food.d.ts.map +0 -1
  84. package/dist/src/devices/models/common/food.js +0 -3
  85. package/dist/src/devices/models/common/food.js.map +0 -1
  86. package/dist/src/devices/models/common/heart-rate-variability.d.ts +0 -12
  87. package/dist/src/devices/models/common/heart-rate-variability.d.ts.map +0 -1
  88. package/dist/src/devices/models/common/heart-rate-variability.js +0 -3
  89. package/dist/src/devices/models/common/heart-rate-variability.js.map +0 -1
  90. package/dist/src/devices/models/common/heart-rate.d.ts +0 -9
  91. package/dist/src/devices/models/common/heart-rate.d.ts.map +0 -1
  92. package/dist/src/devices/models/common/heart-rate.js +0 -3
  93. package/dist/src/devices/models/common/heart-rate.js.map +0 -1
  94. package/dist/src/devices/models/common/lat-lon.d.ts +0 -5
  95. package/dist/src/devices/models/common/lat-lon.d.ts.map +0 -1
  96. package/dist/src/devices/models/common/lat-lon.js +0 -3
  97. package/dist/src/devices/models/common/lat-lon.js.map +0 -1
  98. package/dist/src/devices/models/common/macros.d.ts +0 -14
  99. package/dist/src/devices/models/common/macros.d.ts.map +0 -1
  100. package/dist/src/devices/models/common/macros.js +0 -3
  101. package/dist/src/devices/models/common/macros.js.map +0 -1
  102. package/dist/src/devices/models/common/metadata.d.ts +0 -10
  103. package/dist/src/devices/models/common/metadata.d.ts.map +0 -1
  104. package/dist/src/devices/models/common/metadata.js +0 -3
  105. package/dist/src/devices/models/common/metadata.js.map +0 -1
  106. package/dist/src/devices/models/common/micros.d.ts +0 -28
  107. package/dist/src/devices/models/common/micros.d.ts.map +0 -1
  108. package/dist/src/devices/models/common/micros.js +0 -3
  109. package/dist/src/devices/models/common/micros.js.map +0 -1
  110. package/dist/src/devices/models/common/provider-source.d.ts +0 -13
  111. package/dist/src/devices/models/common/provider-source.d.ts.map +0 -1
  112. package/dist/src/devices/models/common/provider-source.js +0 -17
  113. package/dist/src/devices/models/common/provider-source.js.map +0 -1
  114. package/dist/src/devices/models/common/respiration.d.ts +0 -18
  115. package/dist/src/devices/models/common/respiration.d.ts.map +0 -1
  116. package/dist/src/devices/models/common/respiration.js +0 -3
  117. package/dist/src/devices/models/common/respiration.js.map +0 -1
  118. package/dist/src/devices/models/common/sample.d.ts +0 -8
  119. package/dist/src/devices/models/common/sample.d.ts.map +0 -1
  120. package/dist/src/devices/models/common/sample.js +0 -3
  121. package/dist/src/devices/models/common/sample.js.map +0 -1
  122. package/dist/src/devices/models/common/sex.d.ts +0 -2
  123. package/dist/src/devices/models/common/sex.d.ts.map +0 -1
  124. package/dist/src/devices/models/common/sex.js +0 -3
  125. package/dist/src/devices/models/common/sex.js.map +0 -1
  126. package/dist/src/devices/models/common/source-info.d.ts +0 -8
  127. package/dist/src/devices/models/common/source-info.d.ts.map +0 -1
  128. package/dist/src/devices/models/common/source-info.js +0 -3
  129. package/dist/src/devices/models/common/source-info.js.map +0 -1
  130. package/dist/src/devices/models/common/source-type.d.ts +0 -5
  131. package/dist/src/devices/models/common/source-type.d.ts.map +0 -1
  132. package/dist/src/devices/models/common/source-type.js +0 -9
  133. package/dist/src/devices/models/common/source-type.js.map +0 -1
  134. package/dist/src/devices/models/common/temperature.d.ts +0 -13
  135. package/dist/src/devices/models/common/temperature.d.ts.map +0 -1
  136. package/dist/src/devices/models/common/temperature.js +0 -3
  137. package/dist/src/devices/models/common/temperature.js.map +0 -1
  138. package/dist/src/devices/models/metriport-data.d.ts +0 -5
  139. package/dist/src/devices/models/metriport-data.d.ts.map +0 -1
  140. package/dist/src/devices/models/metriport-data.js +0 -3
  141. package/dist/src/devices/models/metriport-data.js.map +0 -1
  142. package/dist/src/devices/models/nutrition.d.ts +0 -14
  143. package/dist/src/devices/models/nutrition.d.ts.map +0 -1
  144. package/dist/src/devices/models/nutrition.js +0 -3
  145. package/dist/src/devices/models/nutrition.js.map +0 -1
  146. package/dist/src/devices/models/sleep.d.ts +0 -29
  147. package/dist/src/devices/models/sleep.d.ts.map +0 -1
  148. package/dist/src/devices/models/sleep.js +0 -3
  149. package/dist/src/devices/models/sleep.js.map +0 -1
  150. package/dist/src/devices/models/user.d.ts +0 -14
  151. package/dist/src/devices/models/user.d.ts.map +0 -1
  152. package/dist/src/devices/models/user.js +0 -3
  153. package/dist/src/devices/models/user.js.map +0 -1
  154. package/dist/src/index.d.ts +0 -30
  155. package/dist/src/index.d.ts.map +0 -1
  156. package/dist/src/index.js +0 -76
  157. package/dist/src/index.js.map +0 -1
  158. package/dist/src/medical/client/metriport.d.ts +0 -598
  159. package/dist/src/medical/client/metriport.d.ts.map +0 -1
  160. package/dist/src/medical/client/metriport.js +0 -956
  161. package/dist/src/medical/client/metriport.js.map +0 -1
  162. package/dist/src/medical/models/common/address.d.ts +0 -158
  163. package/dist/src/medical/models/common/address.d.ts.map +0 -1
  164. package/dist/src/medical/models/common/address.js +0 -29
  165. package/dist/src/medical/models/common/address.js.map +0 -1
  166. package/dist/src/medical/models/common/base-update.d.ts +0 -16
  167. package/dist/src/medical/models/common/base-update.d.ts.map +0 -1
  168. package/dist/src/medical/models/common/base-update.js +0 -13
  169. package/dist/src/medical/models/common/base-update.js.map +0 -1
  170. package/dist/src/medical/models/common/medical-data-source.d.ts +0 -5
  171. package/dist/src/medical/models/common/medical-data-source.d.ts.map +0 -1
  172. package/dist/src/medical/models/common/medical-data-source.js +0 -9
  173. package/dist/src/medical/models/common/medical-data-source.js.map +0 -1
  174. package/dist/src/medical/models/common/us-data.d.ts +0 -111
  175. package/dist/src/medical/models/common/us-data.d.ts.map +0 -1
  176. package/dist/src/medical/models/common/us-data.js +0 -12
  177. package/dist/src/medical/models/common/us-data.js.map +0 -1
  178. package/dist/src/medical/models/demographics.d.ts +0 -903
  179. package/dist/src/medical/models/demographics.d.ts.map +0 -1
  180. package/dist/src/medical/models/demographics.js +0 -60
  181. package/dist/src/medical/models/demographics.js.map +0 -1
  182. package/dist/src/medical/models/document.d.ts +0 -290
  183. package/dist/src/medical/models/document.d.ts.map +0 -1
  184. package/dist/src/medical/models/document.js +0 -45
  185. package/dist/src/medical/models/document.js.map +0 -1
  186. package/dist/src/medical/models/embed-token.d.ts +0 -7
  187. package/dist/src/medical/models/embed-token.d.ts.map +0 -1
  188. package/dist/src/medical/models/embed-token.js +0 -3
  189. package/dist/src/medical/models/embed-token.js.map +0 -1
  190. package/dist/src/medical/models/facility.d.ts +0 -458
  191. package/dist/src/medical/models/facility.d.ts.map +0 -1
  192. package/dist/src/medical/models/facility.js +0 -22
  193. package/dist/src/medical/models/facility.js.map +0 -1
  194. package/dist/src/medical/models/fhir.d.ts +0 -109
  195. package/dist/src/medical/models/fhir.d.ts.map +0 -1
  196. package/dist/src/medical/models/fhir.js +0 -33
  197. package/dist/src/medical/models/fhir.js.map +0 -1
  198. package/dist/src/medical/models/medicalRecordStatus.d.ts +0 -5
  199. package/dist/src/medical/models/medicalRecordStatus.d.ts.map +0 -1
  200. package/dist/src/medical/models/medicalRecordStatus.js +0 -3
  201. package/dist/src/medical/models/medicalRecordStatus.js.map +0 -1
  202. package/dist/src/medical/models/network-entry.d.ts +0 -11
  203. package/dist/src/medical/models/network-entry.d.ts.map +0 -1
  204. package/dist/src/medical/models/network-entry.js +0 -3
  205. package/dist/src/medical/models/network-entry.js.map +0 -1
  206. package/dist/src/medical/models/organization.d.ts +0 -269
  207. package/dist/src/medical/models/organization.d.ts.map +0 -1
  208. package/dist/src/medical/models/organization.js +0 -20
  209. package/dist/src/medical/models/organization.js.map +0 -1
  210. package/dist/src/medical/models/patient.d.ts +0 -2406
  211. package/dist/src/medical/models/patient.d.ts.map +0 -1
  212. package/dist/src/medical/models/patient.js +0 -25
  213. package/dist/src/medical/models/patient.js.map +0 -1
  214. package/dist/src/medical/models/patientDTO.d.ts +0 -56
  215. package/dist/src/medical/models/patientDTO.d.ts.map +0 -1
  216. package/dist/src/medical/models/patientDTO.js +0 -3
  217. package/dist/src/medical/models/patientDTO.js.map +0 -1
  218. package/dist/src/medical/models/settings-response.d.ts +0 -6
  219. package/dist/src/medical/models/settings-response.d.ts.map +0 -1
  220. package/dist/src/medical/models/settings-response.js +0 -3
  221. package/dist/src/medical/models/settings-response.js.map +0 -1
  222. package/dist/src/shared.d.ts +0 -7
  223. package/dist/src/shared.d.ts.map +0 -1
  224. package/dist/src/shared.js +0 -19
  225. package/dist/src/shared.js.map +0 -1
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Scratch file to test embed token creation.
3
+ *
4
+ * Usage: mpp api-sdk && npx ts-node src/scratch-embed-token.ts
5
+ *
6
+ * Make sure to set your API key before running.
7
+ */
8
+ export declare function getEnvVar(varName: string): string | undefined;
9
+ export declare function getEnvVarOrFail(varName: string): string;
10
+ //# sourceMappingURL=scratch-embed-token.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scratch-embed-token.d.ts","sourceRoot":"","sources":["../src/scratch-embed-token.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE7D;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMvD"}
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ /**
3
+ * Scratch file to test embed token creation.
4
+ *
5
+ * Usage: mpp api-sdk && npx ts-node src/scratch-embed-token.ts
6
+ *
7
+ * Make sure to set your API key before running.
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
25
+ var __importStar = (this && this.__importStar) || (function () {
26
+ var ownKeys = function(o) {
27
+ ownKeys = Object.getOwnPropertyNames || function (o) {
28
+ var ar = [];
29
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
+ return ar;
31
+ };
32
+ return ownKeys(o);
33
+ };
34
+ return function (mod) {
35
+ if (mod && mod.__esModule) return mod;
36
+ var result = {};
37
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
+ __setModuleDefault(result, mod);
39
+ return result;
40
+ };
41
+ })();
42
+ Object.defineProperty(exports, "__esModule", { value: true });
43
+ exports.getEnvVar = getEnvVar;
44
+ exports.getEnvVarOrFail = getEnvVarOrFail;
45
+ const dotenv = __importStar(require("dotenv"));
46
+ dotenv.config();
47
+ // keep that ^ on top
48
+ function getEnvVar(varName) {
49
+ return process.env[varName];
50
+ }
51
+ function getEnvVarOrFail(varName) {
52
+ const value = getEnvVar(varName);
53
+ if (!value || value.trim().length < 1) {
54
+ throw new Error(`Missing ${varName} env var`);
55
+ }
56
+ return value;
57
+ }
58
+ const metriport_1 = require("./medical/client/metriport");
59
+ // staging
60
+ const API_KEY = getEnvVarOrFail("API_KEY");
61
+ const BASE_URL = getEnvVarOrFail("BASE_URL");
62
+ const PATIENT_ID = getEnvVarOrFail("PATIENT_ID");
63
+ async function testEmbedToken() {
64
+ console.log("=== Testing Embed Token ===\n");
65
+ const metriport = new metriport_1.MetriportMedicalApi(API_KEY, { baseAddress: BASE_URL });
66
+ const response = await metriport.createEmbedToken({
67
+ expirationInSeconds: 7200, // 2 hour
68
+ });
69
+ const url = BASE_URL.includes("staging")
70
+ ? "https://ehr.staging.metriport.com"
71
+ : "http://localhost:3020";
72
+ console.log("Token:", response.token);
73
+ console.log("\nPatient View URL:", `${url}/embed/app/patient/${PATIENT_ID}#access_token=${response.token}`);
74
+ console.log("\nTCM View URL:", `${url}/embed/app/transitions-of-care#access_token=${response.token}`);
75
+ console.log("\n");
76
+ }
77
+ async function main() {
78
+ try {
79
+ await testEmbedToken();
80
+ console.log("=== Done ===");
81
+ }
82
+ catch (error) {
83
+ console.error("Error:", error);
84
+ }
85
+ }
86
+ main();
87
+ //# sourceMappingURL=scratch-embed-token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scratch-embed-token.js","sourceRoot":"","sources":["../src/scratch-embed-token.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,MAAY,MAAM,mCAAe;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAChB,qBAAqB;AAEr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K,EAAE,CACtE,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC;QACH,MAAM,cAAc,EAAE,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC9B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACjC,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metriport/api-sdk",
3
- "version": "18.14.1-alpha.0",
3
+ "version": "18.14.2-alpha.0",
4
4
  "description": "Metriport helps you access and manage health and medical data, through a single open source API.",
5
5
  "author": "Metriport Inc. <contact@metriport.com>",
6
6
  "homepage": "https://metriport.com/",
@@ -58,7 +58,7 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@medplum/fhirtypes": "^2.0.32",
61
- "@metriport/shared": "^0.33.5-alpha.0",
61
+ "@metriport/shared": "^0.33.6-alpha.0",
62
62
  "axios": "^1.15.0",
63
63
  "dayjs": "^1.11.7",
64
64
  "dotenv": "^16.3.1",
@@ -78,5 +78,5 @@
78
78
  "ts-jest": "29.4.11",
79
79
  "typescript": "6.0.3"
80
80
  },
81
- "gitHead": "13424015b8574aed6f3129ca4ad84bc3c8593c3e"
81
+ "gitHead": "944f6eee327687bf29061ac9fd5ab82981d477d7"
82
82
  }
@@ -1,181 +0,0 @@
1
- import { Activity } from "../models/activity";
2
- import { Biometrics } from "../models/biometrics";
3
- import { Body } from "../models/body";
4
- import { ConnectedUserInfo } from "../models/common/connected-user-info";
5
- import { ProviderSource } from "../models/common/provider-source";
6
- import { Nutrition } from "../models/nutrition";
7
- import { Sleep } from "../models/sleep";
8
- import { User } from "../models/user";
9
- import { SettingsResponse } from "./models/settings-response";
10
- import { WebhookStatusResponse } from "./models/webhook-status-response";
11
- export type Options = {
12
- sandbox?: boolean;
13
- timeout?: number;
14
- baseAddress?: string;
15
- };
16
- export declare class MetriportDevicesApi {
17
- private api;
18
- /**
19
- * Creates a new instance of the Metriport Devices API client.
20
- *
21
- * @param apiKey - Your Metriport API key.
22
- * @param options - Optional parameters
23
- * @param options.sandbox - Indicates whether to connect to the sandbox, default false.
24
- * @param options.timeout - Connection timeout in milliseconds, default 20 seconds.
25
- */
26
- constructor(apiKey: string, options?: Options);
27
- /**
28
- * For your given user ID, returns the Metriport user ID used for identifying
29
- * the user and making subsequent calls for the user's data.
30
- *
31
- * @param {string} appUserId - The unique ID for the user in your app.
32
- * @returns The userId of the user.
33
- */
34
- getMetriportUserId(appUserId: string): Promise<string>;
35
- /**
36
- * For your given user ID, returns the user's connected providers
37
- *
38
- * @param {string} userId - The unique ID for the user in your app.
39
- * @returns Object containing array of connected providers.
40
- */
41
- getConnectedProviders(userId: string): Promise<{
42
- connectedProviders: string[];
43
- }>;
44
- /**
45
- * Returns all your users and their connected providers.
46
- *
47
- * @returns List of connected users, containing their ids and providers.
48
- */
49
- getConnectedUsers(): Promise<{
50
- connectedUsers: ConnectedUserInfo[];
51
- }>;
52
- /**
53
- * For the given user ID, get a token to be used for a Metriport Connect session.
54
- *
55
- * @param {string} userId - The user ID of the user that will be using the Connect widget.
56
- * @returns The Metriport Connect session token.
57
- */
58
- getConnectToken(userId: string): Promise<string>;
59
- /**
60
- * For the given user ID, revokes the user's access to the specified provider.
61
- *
62
- * @param {string} userId - The user ID of the user for which to revoke access.
63
- * @param {ProviderSource} provider - The data provider to revoke access to.
64
- * @returns void.
65
- */
66
- revokeUserAccessToProvider(userId: string, provider: ProviderSource): Promise<void>;
67
- /**
68
- * For the given user ID, revokes access tokens for all providers and deletes the user.
69
- *
70
- * @param {string} userId - The user ID of the user to be deleted.
71
- * @returns void.
72
- */
73
- deleteUser(userId: string): Promise<void>;
74
- /**
75
- * Connects the user to a remote patient monitoring (RPM) device provider.
76
- *
77
- * @param {string} provider - A healthcare data provider (currently only includes `tenovi`).
78
- * @param {string} token - The connect token that was generated by the getConnectToken method.
79
- * @param {string[]} deviceIds - A list of device IDs to connect to the user.
80
- * @param {string} deviceUserId - The user ID (patient ID, for Tenovi) of the user that is connected to the device.
81
- */
82
- connectRpmProvider(provider: ProviderSource.tenovi, token: string, deviceIds: string[], deviceUserId: string): Promise<void>;
83
- /**
84
- * Disconnects a single RPM device from the user.
85
- * @param userId - The Metriport user ID of the user to disconnect the given device from.
86
- * @param provider - The RPM device provider (currently only includes `tenovi`).
87
- * @param deviceId - The HWI ID of the device to be disconnected.
88
- * @param x_tenovi_api_key - Your Tenovi API key.
89
- * @param x_tenovi_client_name - Your Tenovi Client name.
90
- */
91
- disconnectDevice(userId: string, provider: ProviderSource.tenovi, deviceId: string, x_tenovi_api_key: string, x_tenovi_client_name: string): Promise<void>;
92
- /**
93
- * Gets the activity info for the specified user ID and date.
94
- *
95
- * @param {string} userId - The userId of the user you want to get data for.
96
- * @param {string} date - The date you want to get the data for (YYYY-MM-DD).
97
- * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles).
98
- * @returns An array of activity data from each connected provider.
99
- */
100
- getActivityData(userId: string, date: string, timezoneId?: string): Promise<Activity[]>;
101
- /**
102
- * Gets the body data for the specified user ID and date.
103
- *
104
- * @param {string} userId - The userId of the user you want to get data for.
105
- * @param {string} date - The date you want to get the data for (YYYY-MM-DD).
106
- * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles).
107
- * @returns An array of body data from each connected provider.
108
- */
109
- getBodyData(userId: string, date: string, timezoneId?: string): Promise<Body[]>;
110
- /**
111
- * Gets the biometrics data for the specified user ID and date.
112
- *
113
- * @param {string} userId - The userId of the user you want to get data for.
114
- * @param {string} date - The date you want to get the data for (YYYY-MM-DD).
115
- * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles).
116
- * @returns An array of biometrics data from each connected provider.
117
- */
118
- getBiometricsData(userId: string, date: string, timezoneId?: string): Promise<Biometrics[]>;
119
- /**
120
- * Gets the nutrition data for the specified user ID and date.
121
- *
122
- * @param {string} userId - The userId of the user you want to get data for.
123
- * @param {string} date - The date you want to get the data for (YYYY-MM-DD).
124
- * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles).
125
- * @returns An array of nutrition data from each connected provider.
126
- */
127
- getNutritionData(userId: string, date: string, timezoneId?: string): Promise<Nutrition[]>;
128
- /**
129
- * Gets the sleep data for the specified user ID and date.
130
- *
131
- * @param {string} userId - The userId of the user you want to get data for.
132
- * @param {string} date - The date you want to get the data for (YYYY-MM-DD).
133
- * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles).
134
- * @returns An array of sleep data from each connected provider.
135
- */
136
- getSleepData(userId: string, date: string, timezoneId?: string): Promise<Sleep[]>;
137
- /**
138
- * Gets the user info for the specified user ID and date.
139
- *
140
- * @param {string} userId - The userId of the user you want to get data for.
141
- * @param {string} date - The date you want to get the data for (YYYY-MM-DD).
142
- * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles).
143
- * @returns An array of user data from each connected provider.
144
- */
145
- getUserData(userId: string, date: string, timezoneId?: string): Promise<User[]>;
146
- /**
147
- * If the userId is empty or the date is not in the correct format, throw an error. Otherwise, return
148
- * an object with the userId and date.
149
- *
150
- * @param {string} userId - The userId of the user you want to get the data for.
151
- * @param {string} date - The date to get the user's data for.
152
- * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles).
153
- * @returns an object with the userId and date properties.
154
- */
155
- private validateAndBuildParams;
156
- /**
157
- * Gets the settings for your account.
158
- *
159
- * @returns Your account settings.
160
- */
161
- getSettings(): Promise<SettingsResponse>;
162
- /**
163
- * Update the settings for your account.
164
- *
165
- * @returns Your updated account settings.
166
- */
167
- updateSettings(webhookUrl: string): Promise<SettingsResponse>;
168
- /**
169
- * Gets the status of communication with your app's webhook.
170
- *
171
- * @returns The status of communication with your app's webhook.
172
- */
173
- getWebhookStatus(): Promise<WebhookStatusResponse>;
174
- /**
175
- * Retries failed webhook requests.
176
- *
177
- * @returns void
178
- */
179
- retryWebhookRequests(): Promise<void>;
180
- }
181
- //# sourceMappingURL=metriport.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metriport.d.ts","sourceRoot":"","sources":["../../../../src/devices/client/metriport.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAItC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAIzE,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,GAAG,CAAgB;IAE3B;;;;;;;OAOG;gBACS,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,OAAY;IAUjD;;;;;;OAMG;IACG,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAO5D;;;;;OAKG;IACG,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,kBAAkB,EAAE,MAAM,E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;;;OAOG;IACG,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAO/F;;;;;;;OAOG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAOvF;;;;;;;OAOG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAOrF;;;;;;;;OAQG;IACH,OAAO,CAAC,sBAAsB;IAQ9B;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAK9C;;;;OAIG;IACG,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAOnE;;;;OAIG;IACG,gBAAgB,IAAI,OAAO,CAAC,qBAAqB,CAAC;IAKxD;;;;OAIG;IACG,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5C"}
@@ -1,263 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.MetriportDevicesApi = void 0;
7
- const axios_1 = __importDefault(require("axios"));
8
- const shared_1 = require("../../shared");
9
- const date_util_1 = require("./util/date-util");
10
- const timezone_util_1 = require("./util/timezone-util");
11
- class MetriportDevicesApi {
12
- api;
13
- /**
14
- * Creates a new instance of the Metriport Devices API client.
15
- *
16
- * @param apiKey - Your Metriport API key.
17
- * @param options - Optional parameters
18
- * @param options.sandbox - Indicates whether to connect to the sandbox, default false.
19
- * @param options.timeout - Connection timeout in milliseconds, default 20 seconds.
20
- */
21
- constructor(apiKey, options = {}) {
22
- const { sandbox, timeout } = options;
23
- const baseURL = options.baseAddress || (sandbox ? shared_1.BASE_ADDRESS_SANDBOX : shared_1.BASE_ADDRESS);
24
- this.api = axios_1.default.create({
25
- timeout: timeout ?? shared_1.DEFAULT_AXIOS_TIMEOUT_MILLIS,
26
- baseURL,
27
- headers: { [shared_1.API_KEY_HEADER]: apiKey },
28
- });
29
- }
30
- /**
31
- * For your given user ID, returns the Metriport user ID used for identifying
32
- * the user and making subsequent calls for the user's data.
33
- *
34
- * @param {string} appUserId - The unique ID for the user in your app.
35
- * @returns The userId of the user.
36
- */
37
- async getMetriportUserId(appUserId) {
38
- const resp = await this.api.post("/user", null, {
39
- params: { appUserId: appUserId },
40
- });
41
- return resp.data.userId;
42
- }
43
- /**
44
- * For your given user ID, returns the user's connected providers
45
- *
46
- * @param {string} userId - The unique ID for the user in your app.
47
- * @returns Object containing array of connected providers.
48
- */
49
- async getConnectedProviders(userId) {
50
- const resp = await this.api.get(`/user/${userId}/connected-providers`);
51
- return resp.data;
52
- }
53
- /**
54
- * Returns all your users and their connected providers.
55
- *
56
- * @returns List of connected users, containing their ids and providers.
57
- */
58
- async getConnectedUsers() {
59
- const resp = await this.api.get("/user");
60
- return resp.data;
61
- }
62
- /**
63
- * For the given user ID, get a token to be used for a Metriport Connect session.
64
- *
65
- * @param {string} userId - The user ID of the user that will be using the Connect widget.
66
- * @returns The Metriport Connect session token.
67
- */
68
- async getConnectToken(userId) {
69
- const resp = await this.api.get("/user/connect/token", {
70
- params: { userId: userId },
71
- });
72
- return resp.data.token;
73
- }
74
- /**
75
- * For the given user ID, revokes the user's access to the specified provider.
76
- *
77
- * @param {string} userId - The user ID of the user for which to revoke access.
78
- * @param {ProviderSource} provider - The data provider to revoke access to.
79
- * @returns void.
80
- */
81
- async revokeUserAccessToProvider(userId, provider) {
82
- await this.api.delete(`/user/${userId}/revoke`, {
83
- params: { provider: provider.toString() },
84
- });
85
- }
86
- /**
87
- * For the given user ID, revokes access tokens for all providers and deletes the user.
88
- *
89
- * @param {string} userId - The user ID of the user to be deleted.
90
- * @returns void.
91
- */
92
- async deleteUser(userId) {
93
- await this.api.delete(`/user/${userId}`);
94
- }
95
- /**
96
- * Connects the user to a remote patient monitoring (RPM) device provider.
97
- *
98
- * @param {string} provider - A healthcare data provider (currently only includes `tenovi`).
99
- * @param {string} token - The connect token that was generated by the getConnectToken method.
100
- * @param {string[]} deviceIds - A list of device IDs to connect to the user.
101
- * @param {string} deviceUserId - The user ID (patient ID, for Tenovi) of the user that is connected to the device.
102
- */
103
- async connectRpmProvider(provider, token, deviceIds, deviceUserId) {
104
- await this.api.post(`/connect/rpm/${provider}/?token=${token}&deviceIds=${deviceIds.join(",")}&deviceUserId=${deviceUserId}`);
105
- }
106
- /**
107
- * Disconnects a single RPM device from the user.
108
- * @param userId - The Metriport user ID of the user to disconnect the given device from.
109
- * @param provider - The RPM device provider (currently only includes `tenovi`).
110
- * @param deviceId - The HWI ID of the device to be disconnected.
111
- * @param x_tenovi_api_key - Your Tenovi API key.
112
- * @param x_tenovi_client_name - Your Tenovi Client name.
113
- */
114
- async disconnectDevice(userId, provider, deviceId, x_tenovi_api_key, x_tenovi_client_name) {
115
- await this.api.delete(`/user/${userId}/device/?provider=${provider}&deviceId=${deviceId}`, {
116
- headers: {
117
- "x-tenovi-api-key": x_tenovi_api_key,
118
- "x-tenovi-client-name": x_tenovi_client_name,
119
- },
120
- });
121
- }
122
- /**
123
- * Gets the activity info for the specified user ID and date.
124
- *
125
- * @param {string} userId - The userId of the user you want to get data for.
126
- * @param {string} date - The date you want to get the data for (YYYY-MM-DD).
127
- * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles).
128
- * @returns An array of activity data from each connected provider.
129
- */
130
- async getActivityData(userId, date, timezoneId) {
131
- const resp = await this.api.get("/activity", {
132
- params: this.validateAndBuildParams(userId, date, timezoneId),
133
- });
134
- return resp.data;
135
- }
136
- /**
137
- * Gets the body data for the specified user ID and date.
138
- *
139
- * @param {string} userId - The userId of the user you want to get data for.
140
- * @param {string} date - The date you want to get the data for (YYYY-MM-DD).
141
- * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles).
142
- * @returns An array of body data from each connected provider.
143
- */
144
- async getBodyData(userId, date, timezoneId) {
145
- const resp = await this.api.get("/body", {
146
- params: this.validateAndBuildParams(userId, date, timezoneId),
147
- });
148
- return resp.data;
149
- }
150
- /**
151
- * Gets the biometrics data for the specified user ID and date.
152
- *
153
- * @param {string} userId - The userId of the user you want to get data for.
154
- * @param {string} date - The date you want to get the data for (YYYY-MM-DD).
155
- * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles).
156
- * @returns An array of biometrics data from each connected provider.
157
- */
158
- async getBiometricsData(userId, date, timezoneId) {
159
- const resp = await this.api.get("/biometrics", {
160
- params: this.validateAndBuildParams(userId, date, timezoneId),
161
- });
162
- return resp.data;
163
- }
164
- /**
165
- * Gets the nutrition data for the specified user ID and date.
166
- *
167
- * @param {string} userId - The userId of the user you want to get data for.
168
- * @param {string} date - The date you want to get the data for (YYYY-MM-DD).
169
- * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles).
170
- * @returns An array of nutrition data from each connected provider.
171
- */
172
- async getNutritionData(userId, date, timezoneId) {
173
- const resp = await this.api.get("/nutrition", {
174
- params: this.validateAndBuildParams(userId, date, timezoneId),
175
- });
176
- return resp.data;
177
- }
178
- /**
179
- * Gets the sleep data for the specified user ID and date.
180
- *
181
- * @param {string} userId - The userId of the user you want to get data for.
182
- * @param {string} date - The date you want to get the data for (YYYY-MM-DD).
183
- * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles).
184
- * @returns An array of sleep data from each connected provider.
185
- */
186
- async getSleepData(userId, date, timezoneId) {
187
- const resp = await this.api.get("/sleep", {
188
- params: this.validateAndBuildParams(userId, date, timezoneId),
189
- });
190
- return resp.data;
191
- }
192
- /**
193
- * Gets the user info for the specified user ID and date.
194
- *
195
- * @param {string} userId - The userId of the user you want to get data for.
196
- * @param {string} date - The date you want to get the data for (YYYY-MM-DD).
197
- * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles).
198
- * @returns An array of user data from each connected provider.
199
- */
200
- async getUserData(userId, date, timezoneId) {
201
- const resp = await this.api.get("/user", {
202
- params: this.validateAndBuildParams(userId, date, timezoneId),
203
- });
204
- return resp.data;
205
- }
206
- /**
207
- * If the userId is empty or the date is not in the correct format, throw an error. Otherwise, return
208
- * an object with the userId and date.
209
- *
210
- * @param {string} userId - The userId of the user you want to get the data for.
211
- * @param {string} date - The date to get the user's data for.
212
- * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles).
213
- * @returns an object with the userId and date properties.
214
- */
215
- validateAndBuildParams(userId, date, timezoneId) {
216
- if (userId.trim().length < 1)
217
- throw Error(`userId must not be empty!`);
218
- if (!(0, date_util_1.dateIsValid)(date))
219
- throw Error(`date must be in format YYYY-MM-DD!`);
220
- if (timezoneId && !(0, timezone_util_1.isValidTimezone)(timezoneId))
221
- throw Error(`timezoneId must be a valid timezoneId!`);
222
- return { userId, date, timezoneId };
223
- }
224
- /**
225
- * Gets the settings for your account.
226
- *
227
- * @returns Your account settings.
228
- */
229
- async getSettings() {
230
- const resp = await this.api.get("/settings");
231
- return resp.data;
232
- }
233
- /**
234
- * Update the settings for your account.
235
- *
236
- * @returns Your updated account settings.
237
- */
238
- async updateSettings(webhookUrl) {
239
- const resp = await this.api.post("/settings", {
240
- webhookUrl,
241
- });
242
- return resp.data;
243
- }
244
- /**
245
- * Gets the status of communication with your app's webhook.
246
- *
247
- * @returns The status of communication with your app's webhook.
248
- */
249
- async getWebhookStatus() {
250
- const resp = await this.api.get("/settings/webhook");
251
- return resp.data;
252
- }
253
- /**
254
- * Retries failed webhook requests.
255
- *
256
- * @returns void
257
- */
258
- async retryWebhookRequests() {
259
- await this.api.post("/settings/webhook/retry");
260
- }
261
- }
262
- exports.MetriportDevicesApi = MetriportDevicesApi;
263
- //# sourceMappingURL=metriport.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metriport.js","sourceRoot":"","sources":["../../../../src/devices/client/metriport.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA6C;AAC7C,yCAKsB;AActB,gDAA+C;AAC/C,wDAAuD;AAQvD,MAAa,mBAAmB;IACtB,GAAG,CAAgB;IAE3B;;;;;;;OAOG;IACH,YAAY,MAAc,EAAE,UAAmB,EAAE;QAC/C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;QACrC,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,6BAAoB,CAAC,CAAC,CAAC,qBAAY,CAAC,CAAC;QACvF,IAAI,CAAC,GAAG,GAAG,eAAK,CAAC,MAAM,CAAC;YACtB,OAAO,EAAE,OAAO,IAAI,qCAA4B;YAChD,OAAO;YACP,OAAO,EAAE,EAAE,CAAC,uBAAc,CAAC,EAAE,MAAM,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,kBAAkB,CAAC,SAAiB;QACxC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAA6B,OAAO,EAAE,IAAI,EAAE;YAC1E,MAAM,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE;SACjC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,qBAAqB,CAAC,MAAc;QACxC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAC7B,SAAS,MAAM,sBAAsB,CACtC,CAAC;QAEF,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,iBAAiB;QACrB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,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AmB,WAAW,CAAC,CAAC;QAC/D,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,cAAc,CAAC,UAAkB;QACrC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAmB,WAAW,EAAE;YAC9D,UAAU;SACX,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,gBAAgB;QACpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAwB,mBAAmB,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,oBAAoB;QACxB,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IACjD,CAAC;CACF;AAlSD,kDAkSC"}
@@ -1,4 +0,0 @@
1
- export interface GetConnectTokenResponse {
2
- token: string;
3
- }
4
- //# sourceMappingURL=get-connect-token-response.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-connect-token-response.d.ts","sourceRoot":"","sources":["../../../../../src/devices/client/models/get-connect-token-response.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=get-connect-token-response.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-connect-token-response.js","sourceRoot":"","sources":["../../../../../src/devices/client/models/get-connect-token-response.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- import { ConnectedUserInfo } from "../../models/common/connected-user-info";
2
- export interface GetConnectedUsersResponse {
3
- connectedUsers: ConnectedUserInfo[];
4
- }
5
- //# sourceMappingURL=get-connected-users-response.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-connected-users-response.d.ts","sourceRoot":"","sources":["../../../../../src/devices/client/models/get-connected-users-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE5E,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,iBAAiB,EAAE,CAAC;CACrC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=get-connected-users-response.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-connected-users-response.js","sourceRoot":"","sources":["../../../../../src/devices/client/models/get-connected-users-response.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export interface GetMetriportUserIDResponse {
2
- userId: string;
3
- }
4
- //# sourceMappingURL=get-metriport-user-id-response.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-metriport-user-id-response.d.ts","sourceRoot":"","sources":["../../../../../src/devices/client/models/get-metriport-user-id-response.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=get-metriport-user-id-response.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-metriport-user-id-response.js","sourceRoot":"","sources":["../../../../../src/devices/client/models/get-metriport-user-id-response.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- export interface SettingsResponse {
2
- id: string;
3
- webhookUrl?: string | null;
4
- webhookKey?: string | null;
5
- }
6
- //# sourceMappingURL=settings-response.d.ts.map