oro-sdk-apis 1.53.0 → 1.54.0-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.
- package/dist/models/practice.d.ts +34 -0
- package/dist/oro-sdk-apis.cjs.development.js +402 -819
- package/dist/oro-sdk-apis.cjs.development.js.map +1 -1
- package/dist/oro-sdk-apis.cjs.production.min.js +1 -1
- package/dist/oro-sdk-apis.cjs.production.min.js.map +1 -1
- package/dist/oro-sdk-apis.esm.js +402 -819
- package/dist/oro-sdk-apis.esm.js.map +1 -1
- package/dist/services/practice.d.ts +4 -4
- package/package.json +1 -1
- package/src/models/practice.ts +37 -1
- package/src/services/practice.ts +6 -5
- package/LICENSE +0 -21
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
import { Assignment, AssignmentRequest, PlanType, Practice, PracticeConfigKind, PracticeConfigs, PracticeInvoice, PracticePayment, PracticePaymentIntent, PracticePlan, PracticePlanPrices, PracticeWorkflow, PracticeWorkflowWithTagSpecialty, Practitioner, PractitionerLicense, PractitionerPreference, PractitionerQuota, PractitionerRole, WorkflowType } from '../models/practice';
|
1
|
+
import { PracticeAccount, Uuid } from '../models';
|
2
|
+
import { Assignment, AssignmentRequest, PaymentIntentRequestMetadata, PlanType, Practice, PracticeConfigKind, PracticeConfigs, PracticeInvoice, PracticePayment, PracticePaymentIntent, PracticePlan, PracticePlanPrices, PracticeWorkflow, PracticeWorkflowWithTagSpecialty, Practitioner, PractitionerLicense, PractitionerPreference, PractitionerQuota, PractitionerRole, WorkflowType } from '../models/practice';
|
3
3
|
import { APIService } from './api';
|
4
4
|
export declare class PracticeService {
|
5
5
|
private api;
|
@@ -76,10 +76,10 @@ export declare class PracticeService {
|
|
76
76
|
* @param isoLocality (optional) the desired locality
|
77
77
|
* @param url_subdomain (optional) the url of the sub domain (@bruno-morel need you to document that)
|
78
78
|
* @param promotionCode (optional) promotion code to apply
|
79
|
-
* @param
|
79
|
+
* @param requestMetadata (optional) the request metadata to use. If defined, when payment service call our hooks in practice, it will use it to do required action (create a consult, refill a consult, etc.).
|
80
80
|
* @returns
|
81
81
|
*/
|
82
|
-
practiceCreatePaymentsIntent(practiceUuid: Uuid, planId: number, userEmail: string, isoLocality?: string, url_subdomain?: string,
|
82
|
+
practiceCreatePaymentsIntent(practiceUuid: Uuid, planId: number, userEmail: string, isoLocality?: string, url_subdomain?: string, requestMetadata?: PaymentIntentRequestMetadata): Promise<PracticePaymentIntent>;
|
83
83
|
practiceGetPaymentsIntent(practiceUuid: Uuid, paymentIntentId: number): Promise<PracticePaymentIntent>;
|
84
84
|
/**
|
85
85
|
* Updates a PracticePaymentIntent
|
package/package.json
CHANGED
package/src/models/practice.ts
CHANGED
@@ -534,11 +534,47 @@ export interface PracticePaymentIntent {
|
|
534
534
|
* It will be used to create the consult when stripe use our hook.
|
535
535
|
*/
|
536
536
|
export interface ConsultRequestMetadata {
|
537
|
+
/**
|
538
|
+
* Defines the kind of `PaymentIntentRequestMetadata` it is
|
539
|
+
*
|
540
|
+
* Note: it can be `undefined` to handle backward compatibility when this interface didn't had a `kind`
|
541
|
+
*/
|
542
|
+
kind: 'ConsultRequestMetadata' | undefined
|
543
|
+
/**
|
544
|
+
* The specialty required by the consultation
|
545
|
+
*/
|
537
546
|
tagSpecialtyRequired: string
|
547
|
+
/**
|
548
|
+
* The locality required for the consultation in iso. COUNTRY (ISO 3166) - PROVINCE - COUNTY - CITY
|
549
|
+
*/
|
538
550
|
isoLocalityRequired?: string
|
551
|
+
/**
|
552
|
+
* The language required for the consultation. Should respect ISO 639-3 https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
|
553
|
+
*/
|
539
554
|
isoLanguageRequired: string
|
540
555
|
}
|
541
556
|
|
557
|
+
/**
|
558
|
+
* This interface is used as metadata when creating Stripe Invoice.
|
559
|
+
* It will be used to create the consult when stripe use our hook.
|
560
|
+
*/
|
561
|
+
export interface RefillTreatmentRequestMetadata {
|
562
|
+
/**
|
563
|
+
* Defines the kind of `PaymentIntentRequestMetadata` it is
|
564
|
+
*/
|
565
|
+
kind: 'RefillTreatmentRequestMetadata'
|
566
|
+
/**
|
567
|
+
* The consult uuid to refill
|
568
|
+
*/
|
569
|
+
consultUuid: string
|
570
|
+
}
|
571
|
+
|
572
|
+
/**
|
573
|
+
* This interface is used as metadata when creating Stripe Invoice.
|
574
|
+
* It will be used when stripe use our hook.
|
575
|
+
*/
|
576
|
+
export type PaymentIntentRequestMetadata = ConsultRequestMetadata | RefillTreatmentRequestMetadata
|
577
|
+
|
542
578
|
export interface AssignmentRequest {
|
543
579
|
uuidAssignor: string //defaulting for insertion to the default practice admin
|
544
580
|
uuidPractitioner?: string
|
@@ -716,4 +752,4 @@ export interface PracticeSecret {
|
|
716
752
|
* It's decrypted on the fly when returned by the api.
|
717
753
|
*/
|
718
754
|
payload: string
|
719
|
-
}
|
755
|
+
}
|
package/src/services/practice.ts
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
import { hashToBase64String } from '../helpers'
|
2
|
-
import {
|
2
|
+
import { PracticeAccount, Uuid } from '../models'
|
3
3
|
import {
|
4
4
|
Assignment,
|
5
5
|
AssignmentRequest,
|
6
|
+
PaymentIntentRequestMetadata,
|
6
7
|
PlanType,
|
7
8
|
Practice,
|
8
9
|
PracticeConfigKind,
|
@@ -122,7 +123,7 @@ export class PracticeService {
|
|
122
123
|
params: { kind },
|
123
124
|
})
|
124
125
|
}
|
125
|
-
|
126
|
+
|
126
127
|
public practiceGetWorkflow(
|
127
128
|
practiceUuid: Uuid,
|
128
129
|
workflowType: WorkflowType
|
@@ -193,7 +194,7 @@ export class PracticeService {
|
|
193
194
|
* @param isoLocality (optional) the desired locality
|
194
195
|
* @param url_subdomain (optional) the url of the sub domain (@bruno-morel need you to document that)
|
195
196
|
* @param promotionCode (optional) promotion code to apply
|
196
|
-
* @param
|
197
|
+
* @param requestMetadata (optional) the request metadata to use. If defined, when payment service call our hooks in practice, it will use it to do required action (create a consult, refill a consult, etc.).
|
197
198
|
* @returns
|
198
199
|
*/
|
199
200
|
public practiceCreatePaymentsIntent(
|
@@ -202,7 +203,7 @@ export class PracticeService {
|
|
202
203
|
userEmail: string,
|
203
204
|
isoLocality?: string,
|
204
205
|
url_subdomain?: string,
|
205
|
-
|
206
|
+
requestMetadata?: PaymentIntentRequestMetadata
|
206
207
|
): Promise<PracticePaymentIntent> {
|
207
208
|
return this.api.post<PracticePaymentIntent>(
|
208
209
|
`${this.baseURL}/v1/practices/${practiceUuid}/payments/intents/`,
|
@@ -210,7 +211,7 @@ export class PracticeService {
|
|
210
211
|
idPlan: planId,
|
211
212
|
hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined,
|
212
213
|
isoLocality,
|
213
|
-
|
214
|
+
requestMetadata,
|
214
215
|
},
|
215
216
|
{ params: { url_subdomain } }
|
216
217
|
)
|
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.
|