oro-sdk 2.13.0 → 2.15.1

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,63 +1,4 @@
1
- export declare type FacetFilter = 'type:PHARMACY' | 'type:CLINIC' | 'type:PHARMACY_VIRTUAL';
2
- export interface CliniaResponse<T> {
3
- facets: any;
4
- meta: {
5
- query: string;
6
- page: number;
7
- numPages: number;
8
- perPage: number;
9
- total: number;
10
- };
11
- records: T[];
12
- }
13
- export interface PlaceData {
14
- id: string;
15
- documentType: string;
16
- type: string;
17
- name: string;
18
- address: AddressData;
19
- geoPoint: GeoPointData;
20
- distance: number;
21
- onlineBookingUrl: string;
22
- openingHours: Map<string, Array<IntervalData>>;
23
- phones: Array<PhoneData>;
24
- socials: Array<SocialData>;
25
- note: string;
26
- services: Array<string>;
27
- owner: string;
28
- }
29
- export interface AddressData {
30
- streetAddress: string;
31
- suiteNumber: string;
32
- postalCode: string;
33
- neighborhood: string;
34
- locality: string;
35
- place: string;
36
- region: string;
37
- regionCode: string;
38
- country: string;
39
- countryCode: string;
40
- }
41
- export interface PhoneData {
42
- number: string;
43
- extension: string;
44
- countryCode: string;
45
- type: 'MAIN' | 'ALTERNATE' | 'RECEPTION' | 'FAX' | 'TEXT_TELEPHONE_TTY' | 'INFO' | 'OTHER';
46
- isTollFree: boolean;
47
- province?: string;
48
- }
49
- export interface IntervalData {
50
- start: string;
51
- end: string;
52
- }
53
- export interface GeoPointData {
54
- lat: number;
55
- lng: number;
56
- }
57
- export interface SocialData {
58
- url: string;
59
- type: string;
60
- }
1
+ import { CliniaResponse, FacetFilter, PlaceData } from "oro-sdk-apis";
61
2
  export declare class CliniaService {
62
3
  private url;
63
4
  private locale?;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.13.0",
2
+ "version": "2.15.1",
3
3
  "main": "dist/index.js",
4
4
  "typings": "dist/index.d.ts",
5
5
  "files": [
@@ -59,7 +59,7 @@
59
59
  "form-data": "^4.0.0",
60
60
  "formdata-node": "^4.3.1",
61
61
  "idb-keyval": "^5.0.6",
62
- "oro-sdk-apis": "1.9.0",
62
+ "oro-sdk-apis": "1.11.1",
63
63
  "oro-toolbox": "0.0.6",
64
64
  "uuid": "^8.3.2"
65
65
  }
package/src/client.ts CHANGED
@@ -109,7 +109,8 @@ export class OroClient {
109
109
  practice: Practice,
110
110
  tosAndCpAcceptance: TosAndCpAcceptanceRequest,
111
111
  tokenData?: TokenData,
112
- subscription?: boolean
112
+ subscription?: boolean,
113
+ skipEmailValidation?: boolean
113
114
  ): Promise<IdentityResponse> {
114
115
  this.rsa = new CryptoRSA()
115
116
  const privateKey = this.rsa.private()
@@ -119,9 +120,12 @@ export class OroClient {
119
120
 
120
121
  const hashedPassword = this.toolbox.hashStringToBase64(this.toolbox.hashStringToBase64(password))
121
122
 
123
+ const emailConfirmed = !!skipEmailValidation
124
+
122
125
  const signupRequest: IdentityCreateRequest = {
123
126
  practiceUuid: practice.uuid,
124
127
  email: email.toLowerCase(),
128
+ emailConfirmed,
125
129
  password: hashedPassword,
126
130
  publicKey: this.toolbox.encodeToBase64(this.rsa.public()),
127
131
  recoveryPassword,
@@ -1415,7 +1419,7 @@ export class OroClient {
1415
1419
  recoverySecurityAnswers: string[],
1416
1420
  threshold: number
1417
1421
  ) {
1418
- let shards: SecretShard[] = (await this.guardClient.identityGet(id)).recoverySecurityQuestions
1422
+ let shards: SecretShard[] = (await this.guardClient.identityGet(id)).recoverySecurityQuestions!
1419
1423
  let answeredShards = shards
1420
1424
  .filter((shard: any) => {
1421
1425
  // filters all answered security questions
@@ -1470,7 +1474,7 @@ export class OroClient {
1470
1474
  * @param masterKey
1471
1475
  */
1472
1476
  public async recoverPrivateKeyFromMasterKey(id: Uuid, masterKey: string) {
1473
- let recoveryPayload = (await this.guardClient.identityGet(id)).recoveryMasterKey
1477
+ let recoveryPayload = (await this.guardClient.identityGet(id)).recoveryMasterKey!
1474
1478
  let symmetricDecryptor = this.toolbox.CryptoChaCha.fromPassphrase(masterKey)
1475
1479
  let privateKey = symmetricDecryptor.base64PayloadDecryptToBytes(recoveryPayload)
1476
1480
  this.rsa = this.toolbox.CryptoRSA.fromKey(privateKey)
@@ -1,79 +1,4 @@
1
- import { AxiosService } from "oro-sdk-apis"
2
-
3
- export type FacetFilter = 'type:PHARMACY' | 'type:CLINIC' | 'type:PHARMACY_VIRTUAL'
4
-
5
- export interface CliniaResponse<T> {
6
- facets: any
7
- meta: {
8
- query: string
9
- page: number
10
- numPages: number
11
- perPage: number
12
- total: number
13
- }
14
- records: T[]
15
- }
16
-
17
- export interface PlaceData {
18
- id: string // The Clinia Id of the resource.
19
- documentType: string // Type of document. This will always be set to health_facility.
20
- type: string // The type of the resource. Possible Place types are detailed here.
21
- name: string // The name of the resource.
22
- address: AddressData // The address of the resource.
23
- geoPoint: GeoPointData // The coordinates of the resource. Useful to locate resource on a map.
24
- distance: number // The distance (in meters) the is from the location used to filter the query.
25
- onlineBookingUrl: string // The url for the online booking system of the resource.
26
- openingHours: Map<string, Array<IntervalData>> // The opening hours of the resource. This object has integers from 1 to 7 as keys, representing days of the week from Monday to Sunday as per ISO 8601.
27
- phones: Array<PhoneData> // Phones associated with this resource.
28
- socials: Array<SocialData> // The social links of the resource. Can be a website or a social media link.
29
- note: string // Special notes on the resource.
30
- services: Array<string> // The services offered by the resource.
31
- owner: string // The owner of the resource in the Clinia ecosystem.
32
- }
33
-
34
- export interface AddressData {
35
- streetAddress: string // Street number plus route name.
36
- suiteNumber: string // Suite, door, appartment number.
37
- postalCode: string // Postal code.
38
- neighborhood: string // Neighborhood.
39
- locality: string // Locality.
40
- place: string // City.
41
- region: string // Name of the region.
42
- regionCode: string // ISO 3166-2 region code.
43
- country: string // Name of the country.
44
- countryCode: string // ISO 3166 country code
45
- }
46
-
47
- export interface PhoneData {
48
- number: string //The phone number.
49
- extension: string //The extension of the phone number.
50
- countryCode: string //The country code associated with this phone number.
51
- type:
52
- | 'MAIN'
53
- | 'ALTERNATE'
54
- | 'RECEPTION'
55
- | 'FAX'
56
- | 'TEXT_TELEPHONE_TTY'
57
- | 'INFO'
58
- | 'OTHER' //The type of phone.
59
- isTollFree: boolean //If the number is toll free or not.
60
- province?: string //If the number is specific to a province
61
- }
62
-
63
- export interface IntervalData {
64
- start: string // Start time of the time interval. Format is HH:mm.
65
- end: string // End time of the time interval. Format is HH:mm.
66
- }
67
-
68
- export interface GeoPointData {
69
- lat: number // Latitude
70
- lng: number // Longitude
71
- }
72
-
73
- export interface SocialData {
74
- url: string // Url representing the link.
75
- type: string // Type of link.
76
- }
1
+ import { AxiosService, CliniaResponse, FacetFilter, PlaceData } from "oro-sdk-apis"
77
2
 
78
3
  export class CliniaService {
79
4
  private api: AxiosService