oro-sdk-apis 1.14.0 → 1.16.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.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This function return a base64 string representation of a hashed string
3
+ * @param value the string to hash
4
+ * @returns a base64 string representation of a hashed value
5
+ */
6
+ export declare function hashToBase64String(value: string): string;
@@ -0,0 +1,2 @@
1
+ export * from './hash';
2
+ export * from './init';
@@ -0,0 +1,9 @@
1
+ import { ServiceCollection, ServiceCollectionRequest } from '../models';
2
+ /**
3
+ * This function is used to initialize services with a provided url
4
+ * @param services an object containing the url of the services to init
5
+ * @param authenticationCallback (optional) the authentification callback. Called when the token were not able to be refreshed.
6
+ * @param useLocalStorage (default: true) if true store tokens into local storage (only for browsers)
7
+ * @returns an instance of each services with a provided url
8
+ */
9
+ export declare const init: (services: ServiceCollectionRequest, authenticationCallback?: ((err: Error, practiceUuid?: string | undefined) => void) | undefined, useLocalStorage?: boolean) => ServiceCollection;
package/dist/index.d.ts CHANGED
@@ -1,27 +1,5 @@
1
- import { TellerService, VaultService, GuardService, PracticeService, ConsultService, WorkflowService, DiagnosisService } from './services';
2
- /**
3
- * This function is used to initialize services with a provided url
4
- * @param services an object containing the url of the services to init
5
- * @param (optional) authenticationCallback the authentification callback
6
- * @returns an instance of each services with a provided url
7
- */
8
- declare const init: (services: {
9
- tellerBaseURL?: string;
10
- vaultBaseURL?: string;
11
- guardBaseURL?: string;
12
- practiceBaseURL?: string;
13
- consultBaseURL?: string;
14
- workflowBaseURL?: string;
15
- diagnosisBaseURL?: string;
16
- }, authenticationCallback?: ((err: Error) => void) | undefined) => {
17
- tellerService: TellerService | undefined;
18
- practiceService: PracticeService | undefined;
19
- consultService: ConsultService | undefined;
20
- vaultService: VaultService | undefined;
21
- guardService: GuardService | undefined;
22
- workflowService: WorkflowService | undefined;
23
- diagnosisService: DiagnosisService | undefined;
24
- };
1
+ import { init } from './helpers';
2
+ export * from './helpers';
25
3
  export * from './models';
26
4
  export * from './services';
27
5
  export default init;
@@ -1,4 +1,5 @@
1
1
  import { Uuid, Base64String, TokenData, RFC3339Date, Url } from './';
2
+ import { AllRoleType } from './practice';
2
3
  export declare type AuthRefreshFunc = (refreshToken?: string) => Promise<AuthTokenResponse>;
3
4
  export interface Tokens {
4
5
  accessToken?: string;
@@ -13,9 +14,18 @@ export interface AuthTokenRequest {
13
14
  export interface AuthTokenResponse {
14
15
  accessToken: string;
15
16
  tokenType: string;
16
- refreshToken: string;
17
+ refreshToken?: string;
17
18
  expiresIn: number;
18
19
  }
20
+ /**
21
+ * This interface is used to request a M2M token as a service
22
+ */
23
+ export interface M2MTokenRequest {
24
+ clientId: string;
25
+ clientSecret: string;
26
+ requestedScopes: string[];
27
+ practiceUuid: string;
28
+ }
19
29
  export interface AuthRecoverRequest {
20
30
  practiceUuid: string;
21
31
  email: string;
@@ -119,3 +129,6 @@ export interface LegalData {
119
129
  rpAcceptedVersion: Url;
120
130
  rpAcceptedAtIP?: string;
121
131
  }
132
+ export declare type RoleBasedScopes = AllRoleType;
133
+ export declare type PermissionBasedScopes = 'consult.consults.get' | 'consult.consults.post' | 'practice.assignments.post';
134
+ export declare type AllScopes = RoleBasedScopes | PermissionBasedScopes;
@@ -1,7 +1,9 @@
1
1
  export * from './consult';
2
2
  export * from './diagnosis';
3
3
  export * from './error';
4
+ export * from './external';
4
5
  export * from './guard';
6
+ export * from './init';
5
7
  export * from './practice';
6
8
  export * from './shared';
7
9
  export * from './vault';
@@ -0,0 +1,26 @@
1
+ import { APIService, ConsultService, DiagnosisService, GuardService, PracticeService, TellerService, VaultService, WorkflowService } from '../services';
2
+ /**
3
+ * This interface represents a collection of service urls you need to initialize
4
+ */
5
+ export interface ServiceCollectionRequest {
6
+ tellerBaseURL?: string;
7
+ vaultBaseURL?: string;
8
+ guardBaseURL?: string;
9
+ practiceBaseURL?: string;
10
+ consultBaseURL?: string;
11
+ workflowBaseURL?: string;
12
+ diagnosisBaseURL?: string;
13
+ }
14
+ /**
15
+ * This interface represents a collection of service
16
+ */
17
+ export interface ServiceCollection {
18
+ apiService: APIService;
19
+ tellerService?: TellerService;
20
+ practiceService?: PracticeService;
21
+ consultService?: ConsultService;
22
+ vaultService?: VaultService;
23
+ guardService?: GuardService;
24
+ workflowService?: WorkflowService;
25
+ diagnosisService?: DiagnosisService;
26
+ }
@@ -1,4 +1,4 @@
1
- import { PlaceData } from ".";
1
+ import { PlaceData } from '.';
2
2
  export declare enum WorkflowType {
3
3
  Onboard = "Onboard",
4
4
  Followup = "Followup",
@@ -249,8 +249,17 @@ export interface ConsultRequestMetadata {
249
249
  isoLocalityRequired?: string;
250
250
  isoLanguageRequired: string;
251
251
  }
252
- export interface Assignment {
253
- id?: number;
252
+ export interface AssignmentRequest {
253
+ uuidAssignor: string;
254
+ uuidPractitioner?: string;
255
+ status?: AssignmentStatus;
256
+ uuidConsult?: string;
257
+ tagSpecialty?: string;
258
+ isoLocality?: string;
259
+ isoLanguage?: string;
260
+ }
261
+ export declare type Assignment = {
262
+ id: number;
254
263
  uuidPractice: string;
255
264
  uuidAssignor: string;
256
265
  uuidPractitioner?: string;
@@ -258,7 +267,7 @@ export interface Assignment {
258
267
  uuidConsult?: string;
259
268
  tagSpecialty?: string;
260
269
  timeAssigned?: string;
261
- }
270
+ };
262
271
  export interface PractitionerRole {
263
272
  id?: number;
264
273
  uuidPractice: string;