oro-sdk-apis 1.9.0 → 1.11.1-dev1

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.
@@ -0,0 +1,60 @@
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
+ }
@@ -0,0 +1 @@
1
+ export * from './clinia';
@@ -36,6 +36,7 @@ export interface WhoAmIResponse {
36
36
  export interface IdentityCreateRequest {
37
37
  practiceUuid: Uuid;
38
38
  email: string;
39
+ emailConfirmed?: boolean;
39
40
  password: Base64String;
40
41
  publicKey: Base64String;
41
42
  recoveryPassword: Base64String;
@@ -6,3 +6,4 @@ export * from './practice';
6
6
  export * from './shared';
7
7
  export * from './vault';
8
8
  export * from './workflow';
9
+ export * from './external';
@@ -1,3 +1,4 @@
1
+ import { PlaceData } from ".";
1
2
  export declare enum WorkflowType {
2
3
  Onboard = "Onboard",
3
4
  Followup = "Followup",
@@ -132,18 +133,7 @@ export declare type PracticeConfigPractitionerChatbox = PracticeConfig<PracticeC
132
133
  };
133
134
  }>;
134
135
  export declare type PracticeConfigPracticeOnlinePharmacy = PracticeConfig<PracticeConfigKind.PracticePharmacyPicker, {
135
- onlinePharmacy?: {
136
- name: string;
137
- id: string;
138
- phones: {
139
- countryCode: string;
140
- number: string;
141
- extension: string | null;
142
- type: string;
143
- isTollFree: boolean;
144
- province?: string;
145
- }[];
146
- };
136
+ onlinePharmacy?: PlaceData;
147
137
  }>;
148
138
  export declare type PracticeConfigPracticeCookieBanner = PracticeConfig<PracticeConfigKind.PracticeCookieBanner, {
149
139
  showCookieBanner?: boolean;
@@ -250,6 +240,15 @@ export interface PracticePaymentIntent {
250
240
  dateCreatedAt?: Date;
251
241
  dateUpdateAt?: Date;
252
242
  }
243
+ /**
244
+ * This interface is used as metadata when creating Stripe Invoice.
245
+ * It will be used to create the consult when stripe use our hook.
246
+ */
247
+ export interface ConsultRequestMetadata {
248
+ tagSpecialtyRequired: string;
249
+ isoLocalityRequired?: string;
250
+ isoLanguageRequired: string;
251
+ }
253
252
  export interface Assignment {
254
253
  id?: number;
255
254
  uuidPractice: string;
@@ -25,6 +25,8 @@ export interface LanguagePickerData extends ChoiceInputData {
25
25
  export interface EntryData {
26
26
  id?: number;
27
27
  label?: string;
28
+ hideLabel?: boolean;
29
+ minorLabel?: string;
28
30
  summaryLabel?: string;
29
31
  summaryHidden?: boolean;
30
32
  className?: string;
@@ -66,7 +68,7 @@ export interface GroupedGenericQuestionData<T, A = IndexedData<ChoiceInputData>>
66
68
  inlineLabel?: boolean;
67
69
  order?: number;
68
70
  }
69
- export declare type QuestionData = GenericQuestionData<'title' | 'paragraph' | 'checkbox', void> | GenericQuestionData<'text' | 'date' | 'number' | 'images' | 'images-alias' | 'body-parts' | 'pharmacy-picker' | 'place-address'> | GenericQuestionData<'checkbox-group' | 'select' | 'multiple', IndexedData<ChoiceInputData>> | GroupedGenericQuestionData<'radio', IndexedData<RadioInputData>> | GroupedGenericQuestionData<'radio-card', IndexedData<RadioCardInputData>> | GroupedGenericQuestionData<'language-picker', IndexedData<LanguagePickerData>>;
71
+ export declare type QuestionData = GenericQuestionData<'title' | 'paragraph' | 'checkbox', void> | GenericQuestionData<'text' | 'textArea' | 'hybrid' | 'date' | 'number' | 'images' | 'images-alias' | 'body-parts' | 'pharmacy-picker' | 'place-address'> | GenericQuestionData<'checkbox-group' | 'select' | 'multiple', IndexedData<ChoiceInputData>> | GroupedGenericQuestionData<'radio', IndexedData<RadioInputData>> | GroupedGenericQuestionData<'radio-card', IndexedData<RadioCardInputData>> | GroupedGenericQuestionData<'language-picker', IndexedData<LanguagePickerData>>;
70
72
  export interface FieldData {
71
73
  type: 'field';
72
74
  className?: string;
@@ -2250,6 +2250,70 @@ var GuardService = /*#__PURE__*/function () {
2250
2250
  }
2251
2251
 
2252
2252
  return identitySendConfirmEmail;
2253
+ }()
2254
+ /**
2255
+ * Get an identity using a customer email (format: customer+[b64Hash]@orohealth.me)
2256
+ *
2257
+ * @param email the customer email
2258
+ * @returns IdentityResponse
2259
+ */
2260
+ ;
2261
+
2262
+ _proto.identityGetByCustomerEmail =
2263
+ /*#__PURE__*/
2264
+ function () {
2265
+ var _identityGetByCustomerEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(email) {
2266
+ return runtime_1.wrap(function _callee11$(_context11) {
2267
+ while (1) {
2268
+ switch (_context11.prev = _context11.next) {
2269
+ case 0:
2270
+ return _context11.abrupt("return", this.identityGetByHash(email.substring(email.indexOf('+') + 1, email.indexOf('@'))));
2271
+
2272
+ case 1:
2273
+ case "end":
2274
+ return _context11.stop();
2275
+ }
2276
+ }
2277
+ }, _callee11, this);
2278
+ }));
2279
+
2280
+ function identityGetByCustomerEmail(_x13) {
2281
+ return _identityGetByCustomerEmail.apply(this, arguments);
2282
+ }
2283
+
2284
+ return identityGetByCustomerEmail;
2285
+ }()
2286
+ /**
2287
+ * Get an identity using a base64 hash
2288
+ *
2289
+ * @param b64Hash base64 hash of the identity
2290
+ * @returns IdentityResponse
2291
+ */
2292
+ ;
2293
+
2294
+ _proto.identityGetByHash =
2295
+ /*#__PURE__*/
2296
+ function () {
2297
+ var _identityGetByHash = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(b64Hash) {
2298
+ return runtime_1.wrap(function _callee12$(_context12) {
2299
+ while (1) {
2300
+ switch (_context12.prev = _context12.next) {
2301
+ case 0:
2302
+ return _context12.abrupt("return", this.identityGet(b64Hash.replace('+', '-').replace('/', '_')));
2303
+
2304
+ case 1:
2305
+ case "end":
2306
+ return _context12.stop();
2307
+ }
2308
+ }
2309
+ }, _callee12, this);
2310
+ }));
2311
+
2312
+ function identityGetByHash(_x14) {
2313
+ return _identityGetByHash.apply(this, arguments);
2314
+ }
2315
+
2316
+ return identityGetByHash;
2253
2317
  }();
2254
2318
 
2255
2319
  return GuardService;
@@ -2402,13 +2466,26 @@ var PracticeService = /*#__PURE__*/function () {
2402
2466
 
2403
2467
  _proto.getPaymentIntentHashedEmail = function getPaymentIntentHashedEmail(email) {
2404
2468
  return _.Buffer.from(hash_js.sha256().update(email.toLowerCase()).digest('hex'), 'hex').toString('base64');
2405
- };
2469
+ }
2470
+ /**
2471
+ * Creates a PracticePaymentIntent
2472
+ * @param practiceUuid the uuid of the practice
2473
+ * @param planId the plan id to use
2474
+ * @param userEmail the email address of the user
2475
+ * @param isoLocality (optional) the desired locality
2476
+ * @param url_subdomain (optional) the url of the sub domain (@bruno-morel need you to document that)
2477
+ * @param promotionCode (optional) promotion code to apply
2478
+ * @param consultRequest (optional) consult request to use. If defined, when payment service call our hooks in practice, it will try to create a consult with these infos.
2479
+ * @returns
2480
+ */
2481
+ ;
2406
2482
 
2407
- _proto.practiceCreatePaymentsIntent = function practiceCreatePaymentsIntent(practiceUuid, planId, userEmail, isoLocality, url_subdomain, promotionCode) {
2483
+ _proto.practiceCreatePaymentsIntent = function practiceCreatePaymentsIntent(practiceUuid, planId, userEmail, isoLocality, url_subdomain, promotionCode, consultRequest) {
2408
2484
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/", {
2409
2485
  idPlan: planId,
2410
2486
  hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined,
2411
- isoLocality: isoLocality
2487
+ isoLocality: isoLocality,
2488
+ consultRequest: consultRequest
2412
2489
  }, {
2413
2490
  params: {
2414
2491
  url_subdomain: url_subdomain,