oro-sdk-apis 1.0.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,6 +11,7 @@ ORO SDK apis package is intended to be run in browser or Node.js environment. It
11
11
  ## Local development
12
12
 
13
13
  > If you cannot see Jest types try opening this folder in a seperate VSCode window.
14
+
14
15
  ### Set up project
15
16
 
16
17
  ```bash
@@ -29,7 +30,17 @@ npm build # build
29
30
  If you need to link `oro-sdk-apis` to app please see https://github.com/OROHealth/oro-apis/blob/main/sdk/ts/README.md#linking-the-sdk-locally
30
31
 
31
32
  In all cases (node.js or app), you need to use:
33
+
32
34
  ```bash
33
35
  npm install
34
36
  npm run link:watch
35
- ```
37
+ ```
38
+
39
+ ### Publishing package
40
+
41
+ 1. (Only first time) Locally run `npm login` and use the creds in 1password (tech-team-oro) . This will create ~/.npmrc . You will require a OTP but it's sent on tech@orohealth.me so you should all have it.
42
+ 2. Run `docker-compose up --build sdk-apis-publisher`
43
+
44
+ #### Publishing `oro-sdk` and `oro-sdk-apis`
45
+
46
+ Cf. https://github.com/OROHealth/oro-apis/blob/bc91807d8059c9b50cb602f83911969188253d0f/sdk/ts/README.md#publishing-oro-sdk-and-oro-sdk-apis`
@@ -1,8 +1,10 @@
1
- export declare enum DiagnosisType {
1
+ export declare enum VisibilityType {
2
2
  Generic = "Generic",
3
3
  Private = "Private",
4
4
  Instance = "Instance"
5
5
  }
6
+ export declare type DiagnosisType = VisibilityType;
7
+ export declare type TreatmentType = VisibilityType;
6
8
  export interface DiagnosisRequest {
7
9
  uuid?: string;
8
10
  name: string;
@@ -25,6 +27,7 @@ export interface TreatmentRequest {
25
27
  name: string;
26
28
  description: string;
27
29
  urlMultimedia?: string;
30
+ type?: TreatmentType;
28
31
  }
29
32
  export interface Treatment extends TreatmentRequest {
30
33
  uuid: string;
@@ -37,10 +40,11 @@ export declare enum DrugType {
37
40
  }
38
41
  export interface DrugRequest {
39
42
  name: string;
40
- description: string;
43
+ description?: string;
41
44
  type: DrugType;
42
45
  language: string;
43
- sideEffects: string;
46
+ posology?: string;
47
+ sideEffects?: string;
44
48
  imageUrl?: string;
45
49
  parentUuid?: string;
46
50
  uuid?: string;
@@ -4,6 +4,8 @@ export declare class AuthenticationBadRequest extends Error {
4
4
  }
5
5
  export declare class AuthenticationServerError extends Error {
6
6
  }
7
+ export declare class AuthenticationUnconfirmedEmail extends Error {
8
+ }
7
9
  export declare class IdentityCreationFailed extends Error {
8
10
  }
9
11
  export declare class IdentityCreationBadRequest extends Error {
@@ -20,6 +20,7 @@ export interface AuthRecoverRequest {
20
20
  practiceUuid: string;
21
21
  email: string;
22
22
  }
23
+ export declare type IdentityResendConfirmEmailRequest = AuthRecoverRequest;
23
24
  export interface WhoAmIResponse {
24
25
  aud: string;
25
26
  exp: number;
@@ -1191,11 +1191,11 @@ var APIService = /*#__PURE__*/function (_AxiosService) {
1191
1191
  TaskStatus["Done"] = "Done";
1192
1192
  })(exports.TaskStatus || (exports.TaskStatus = {}));
1193
1193
 
1194
- (function (DiagnosisType) {
1195
- DiagnosisType["Generic"] = "Generic";
1196
- DiagnosisType["Private"] = "Private";
1197
- DiagnosisType["Instance"] = "Instance";
1198
- })(exports.DiagnosisType || (exports.DiagnosisType = {}));
1194
+ (function (VisibilityType) {
1195
+ VisibilityType["Generic"] = "Generic";
1196
+ VisibilityType["Private"] = "Private";
1197
+ VisibilityType["Instance"] = "Instance";
1198
+ })(exports.VisibilityType || (exports.VisibilityType = {}));
1199
1199
 
1200
1200
  (function (DrugType) {
1201
1201
  DrugType["Generic"] = "Generic";
@@ -1235,29 +1235,38 @@ var AuthenticationServerError = /*#__PURE__*/function (_Error3) {
1235
1235
 
1236
1236
  return AuthenticationServerError;
1237
1237
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1238
- var IdentityCreationFailed = /*#__PURE__*/function (_Error4) {
1239
- _inheritsLoose(IdentityCreationFailed, _Error4);
1238
+ var AuthenticationUnconfirmedEmail = /*#__PURE__*/function (_Error4) {
1239
+ _inheritsLoose(AuthenticationUnconfirmedEmail, _Error4);
1240
1240
 
1241
- function IdentityCreationFailed() {
1241
+ function AuthenticationUnconfirmedEmail() {
1242
1242
  return _Error4.apply(this, arguments) || this;
1243
1243
  }
1244
1244
 
1245
+ return AuthenticationUnconfirmedEmail;
1246
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
1247
+ var IdentityCreationFailed = /*#__PURE__*/function (_Error5) {
1248
+ _inheritsLoose(IdentityCreationFailed, _Error5);
1249
+
1250
+ function IdentityCreationFailed() {
1251
+ return _Error5.apply(this, arguments) || this;
1252
+ }
1253
+
1245
1254
  return IdentityCreationFailed;
1246
1255
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1247
- var IdentityCreationBadRequest = /*#__PURE__*/function (_Error5) {
1248
- _inheritsLoose(IdentityCreationBadRequest, _Error5);
1256
+ var IdentityCreationBadRequest = /*#__PURE__*/function (_Error6) {
1257
+ _inheritsLoose(IdentityCreationBadRequest, _Error6);
1249
1258
 
1250
1259
  function IdentityCreationBadRequest() {
1251
- return _Error5.apply(this, arguments) || this;
1260
+ return _Error6.apply(this, arguments) || this;
1252
1261
  }
1253
1262
 
1254
1263
  return IdentityCreationBadRequest;
1255
1264
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1256
- var IdentityCreationConflict = /*#__PURE__*/function (_Error6) {
1257
- _inheritsLoose(IdentityCreationConflict, _Error6);
1265
+ var IdentityCreationConflict = /*#__PURE__*/function (_Error7) {
1266
+ _inheritsLoose(IdentityCreationConflict, _Error7);
1258
1267
 
1259
1268
  function IdentityCreationConflict() {
1260
- return _Error6.apply(this, arguments) || this;
1269
+ return _Error7.apply(this, arguments) || this;
1261
1270
  }
1262
1271
 
1263
1272
  return IdentityCreationConflict;
@@ -1793,7 +1802,7 @@ var GuardService = /*#__PURE__*/function () {
1793
1802
  accessToken: resp.accessToken,
1794
1803
  refreshToken: resp.refreshToken
1795
1804
  });
1796
- _context.next = 19;
1805
+ _context.next = 20;
1797
1806
  break;
1798
1807
 
1799
1808
  case 8:
@@ -1801,31 +1810,34 @@ var GuardService = /*#__PURE__*/function () {
1801
1810
  _context.t0 = _context["catch"](0);
1802
1811
 
1803
1812
  if (!_context.t0.isAxiosError) {
1804
- _context.next = 18;
1813
+ _context.next = 19;
1805
1814
  break;
1806
1815
  }
1807
1816
 
1808
1817
  code = (_e$response = _context.t0.response) == null ? void 0 : _e$response.status;
1809
1818
  _context.t1 = code;
1810
- _context.next = _context.t1 === 400 ? 15 : _context.t1 === 500 ? 16 : _context.t1 === 401 ? 17 : 17;
1819
+ _context.next = _context.t1 === 400 ? 15 : _context.t1 === 424 ? 16 : _context.t1 === 500 ? 17 : _context.t1 === 401 ? 18 : 18;
1811
1820
  break;
1812
1821
 
1813
1822
  case 15:
1814
1823
  throw new AuthenticationBadRequest();
1815
1824
 
1816
1825
  case 16:
1817
- throw new AuthenticationServerError();
1826
+ throw new AuthenticationUnconfirmedEmail();
1818
1827
 
1819
1828
  case 17:
1820
- throw new AuthenticationFailed();
1829
+ throw new AuthenticationServerError();
1821
1830
 
1822
1831
  case 18:
1823
1832
  throw new AuthenticationFailed();
1824
1833
 
1825
1834
  case 19:
1826
- return _context.abrupt("return", resp);
1835
+ throw new AuthenticationFailed();
1827
1836
 
1828
1837
  case 20:
1838
+ return _context.abrupt("return", resp);
1839
+
1840
+ case 21:
1829
1841
  case "end":
1830
1842
  return _context.stop();
1831
1843
  }
@@ -2190,6 +2202,38 @@ var GuardService = /*#__PURE__*/function () {
2190
2202
  }
2191
2203
 
2192
2204
  return identityMFAQRCode;
2205
+ }()
2206
+ /**
2207
+ * Attempt to resend the email confirmation email
2208
+ *
2209
+ * @param req IdentityResendConfirmEmailRequest
2210
+ * @return void
2211
+ */
2212
+ ;
2213
+
2214
+ _proto.identitySendConfirmEmail =
2215
+ /*#__PURE__*/
2216
+ function () {
2217
+ var _identitySendConfirmEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(req) {
2218
+ return runtime_1.wrap(function _callee10$(_context10) {
2219
+ while (1) {
2220
+ switch (_context10.prev = _context10.next) {
2221
+ case 0:
2222
+ return _context10.abrupt("return", this.api.post(this.baseURL + "/v1/identity/confirm", req));
2223
+
2224
+ case 1:
2225
+ case "end":
2226
+ return _context10.stop();
2227
+ }
2228
+ }
2229
+ }, _callee10, this);
2230
+ }));
2231
+
2232
+ function identitySendConfirmEmail(_x11) {
2233
+ return _identitySendConfirmEmail.apply(this, arguments);
2234
+ }
2235
+
2236
+ return identitySendConfirmEmail;
2193
2237
  }();
2194
2238
 
2195
2239
  return GuardService;
@@ -3004,6 +3048,7 @@ exports.APIService = APIService;
3004
3048
  exports.AuthenticationBadRequest = AuthenticationBadRequest;
3005
3049
  exports.AuthenticationFailed = AuthenticationFailed;
3006
3050
  exports.AuthenticationServerError = AuthenticationServerError;
3051
+ exports.AuthenticationUnconfirmedEmail = AuthenticationUnconfirmedEmail;
3007
3052
  exports.AxiosService = AxiosService;
3008
3053
  exports.ConsultService = ConsultService;
3009
3054
  exports.DiagnosisService = DiagnosisService;