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.
@@ -1,6 +1,6 @@
1
- import { APIService } from './api';
2
1
  import type { AxiosAuthRefreshRequestConfig } from 'axios-auth-refresh';
3
- import { AuthTokenRequest, AuthTokenResponse, AuthRecoverRequest, IdentityCreateRequest, IdentityUpdateRequest, IdentityResponse, QRCodeResponse, Uuid, WhoAmIResponse, Base64String, Tokens } from '../models';
2
+ import { AuthRecoverRequest, AuthTokenRequest, AuthTokenResponse, Base64String, IdentityCreateRequest, IdentityResendConfirmEmailRequest, IdentityResponse, IdentityUpdateRequest, QRCodeResponse, Tokens, Uuid, WhoAmIResponse } from '../models';
3
+ import { APIService } from './api';
4
4
  export interface GuardRequestConfig extends AxiosAuthRefreshRequestConfig {
5
5
  useRefreshToken: boolean;
6
6
  }
@@ -89,4 +89,11 @@ export declare class GuardService {
89
89
  * @returns QRCodeResponse
90
90
  */
91
91
  identityMFAQRCode(identityID: Uuid, password: Base64String): Promise<QRCodeResponse>;
92
+ /**
93
+ * Attempt to resend the email confirmation email
94
+ *
95
+ * @param req IdentityResendConfirmEmailRequest
96
+ * @return void
97
+ */
98
+ identitySendConfirmEmail(req: IdentityResendConfirmEmailRequest): Promise<void>;
92
99
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.0",
2
+ "version": "1.4.0",
3
3
  "main": "dist/index.js",
4
4
  "typings": "dist/index.d.ts",
5
5
  "files": [
@@ -1,9 +1,13 @@
1
- export enum DiagnosisType {
1
+ export enum VisibilityType {
2
2
  Generic = 'Generic',
3
3
  Private = 'Private',
4
4
  Instance = 'Instance',
5
5
  }
6
6
 
7
+ export type DiagnosisType = VisibilityType
8
+
9
+ export type TreatmentType = VisibilityType
10
+
7
11
  export interface DiagnosisRequest {
8
12
  uuid?: string
9
13
  name: string
@@ -28,6 +32,7 @@ export interface TreatmentRequest {
28
32
  name: string
29
33
  description: string
30
34
  urlMultimedia?: string
35
+ type?: TreatmentType
31
36
  }
32
37
 
33
38
  export interface Treatment extends TreatmentRequest {
@@ -43,15 +48,15 @@ export enum DrugType {
43
48
 
44
49
  export interface DrugRequest {
45
50
  name: string // name of the drug
46
- description: string // Description of the drug
51
+ description?: string // Description of the drug
47
52
  type: DrugType // Entry type
48
53
  language: string // drug locale
49
- sideEffects: string // Side effects of the drug
54
+ posology?: string // drug posology
55
+ sideEffects?: string // Side effects of the drug
50
56
  imageUrl?: string // Image URL to the drug
51
57
  parentUuid?: string // (optional) parent uuid of the drug. In case of DrugType.Instance
52
58
  uuid?: string // uuid of the drug (will be used as parentUuid in case of creation of new drug)
53
59
  }
54
-
55
60
  export interface Drug extends DrugRequest {
56
61
  uuid: string
57
62
  uuidPractice: string
@@ -1,6 +1,7 @@
1
1
  export class AuthenticationFailed extends Error { }
2
2
  export class AuthenticationBadRequest extends Error { }
3
3
  export class AuthenticationServerError extends Error { }
4
+ export class AuthenticationUnconfirmedEmail extends Error { }
4
5
  export class IdentityCreationFailed extends Error { }
5
6
  export class IdentityCreationBadRequest extends Error { }
6
7
  export class IdentityCreationConflict extends Error { }
@@ -26,6 +26,8 @@ export interface AuthRecoverRequest {
26
26
  email: string
27
27
  }
28
28
 
29
+ export type IdentityResendConfirmEmailRequest = AuthRecoverRequest
30
+
29
31
  export interface WhoAmIResponse {
30
32
  aud: string
31
33
  exp: number
@@ -1,26 +1,14 @@
1
- import { APIService } from './api'
1
+ import { AxiosError } from 'axios'
2
2
  import type { AxiosAuthRefreshRequestConfig } from 'axios-auth-refresh'
3
3
  import {
4
- AuthTokenRequest,
5
- AuthTokenResponse,
6
- AuthRecoverRequest,
7
- IdentityCreateRequest,
8
- IdentityUpdateRequest,
9
- IdentityResponse,
10
- QRCodeRequest,
11
- QRCodeResponse,
12
- Uuid,
13
- WhoAmIResponse,
14
- Base64String,
15
- AuthenticationFailed,
16
- IdentityCreationFailed,
17
4
  AuthenticationBadRequest,
18
- AuthenticationServerError,
19
- IdentityCreationBadRequest,
20
- IdentityCreationConflict,
21
- Tokens
5
+ AuthenticationFailed, AuthenticationServerError, AuthenticationUnconfirmedEmail, AuthRecoverRequest, AuthTokenRequest,
6
+ AuthTokenResponse, Base64String, IdentityCreateRequest, IdentityCreationBadRequest,
7
+ IdentityCreationConflict, IdentityCreationFailed, IdentityResendConfirmEmailRequest, IdentityResponse, IdentityUpdateRequest, QRCodeRequest,
8
+ QRCodeResponse, Tokens, Uuid,
9
+ WhoAmIResponse
22
10
  } from '../models'
23
- import { AxiosError } from 'axios'
11
+ import { APIService } from './api'
24
12
 
25
13
  export interface GuardRequestConfig extends AxiosAuthRefreshRequestConfig {
26
14
  useRefreshToken : boolean
@@ -37,12 +25,12 @@ export class GuardService {
37
25
 
38
26
  /**
39
27
  * Will replace access and refresh tokens with `tokens`
40
- *
41
- * Note:
28
+ *
29
+ * Note:
42
30
  * ```typescript
43
31
  * setTokens({accessToken: undefined, refreshToken: 'aTokenValue'}) // will erase accessToken and set refreshToken with 'aTokenValue'
44
32
  * setTokens({refreshToken: 'aTokenValue'}) // will keep actual value of accessToken and set refreshToken with 'aTokenValue'
45
- *
33
+ *
46
34
  * ```
47
35
  * @param tokens
48
36
  */
@@ -77,6 +65,8 @@ export class GuardService {
77
65
  switch (code) {
78
66
  case 400:
79
67
  throw new AuthenticationBadRequest()
68
+ case 424:
69
+ throw new AuthenticationUnconfirmedEmail()
80
70
  case 500:
81
71
  throw new AuthenticationServerError()
82
72
  case 401:
@@ -224,5 +214,15 @@ export class GuardService {
224
214
  const req: QRCodeRequest = { password }
225
215
  return this.api.post<QRCodeResponse>(`${this.baseURL}/v1/identities/${identityID}/mfa`, req, { headers: { 'Accept': 'application/json' } })
226
216
  }
217
+
218
+ /**
219
+ * Attempt to resend the email confirmation email
220
+ *
221
+ * @param req IdentityResendConfirmEmailRequest
222
+ * @return void
223
+ */
224
+ public async identitySendConfirmEmail(req : IdentityResendConfirmEmailRequest): Promise<void> {
225
+ return this.api.post<void>(`${this.baseURL}/v1/identity/confirm`, req)
226
+ }
227
227
  }
228
228
 
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 ORO Health Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.