oro-sdk 2.2.0 → 2.5.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.
- package/README.md +49 -31
- package/dist/client.d.ts +4 -4
- package/dist/helpers/client.d.ts +1 -1
- package/dist/helpers/patient-registration.d.ts +1 -1
- package/dist/helpers/vault-grants.d.ts +1 -1
- package/dist/helpers/workflow.d.ts +1 -1
- package/dist/index.d.ts +15 -1
- package/dist/models/client.d.ts +1 -1
- package/dist/models/error.d.ts +0 -14
- package/dist/models/index.d.ts +0 -7
- package/dist/oro-sdk.cjs.development.js +313 -2367
- package/dist/oro-sdk.cjs.development.js.map +1 -1
- package/dist/oro-sdk.cjs.production.min.js +1 -1
- package/dist/oro-sdk.cjs.production.min.js.map +1 -1
- package/dist/oro-sdk.esm.js +246 -2344
- package/dist/oro-sdk.esm.js.map +1 -1
- package/dist/sdk-revision/client.d.ts +2 -2
- package/dist/services/index.d.ts +0 -9
- package/package.json +4 -1
- package/src/client.ts +161 -435
- package/src/helpers/client.ts +1 -1
- package/src/helpers/patient-registration.ts +85 -166
- package/src/helpers/vault-grants.ts +1 -1
- package/src/helpers/workflow.ts +21 -59
- package/src/index.ts +42 -28
- package/src/models/client.ts +1 -1
- package/src/models/error.ts +6 -13
- package/src/models/index.ts +0 -7
- package/src/sdk-revision/client.ts +25 -20
- package/src/services/external/clinia.ts +1 -1
- package/src/services/index.ts +0 -9
- package/dist/models/consult.d.ts +0 -102
- package/dist/models/diagnosis.d.ts +0 -122
- package/dist/models/guard.d.ts +0 -119
- package/dist/models/practice.d.ts +0 -353
- package/dist/models/shared.d.ts +0 -8
- package/dist/models/vault.d.ts +0 -124
- package/dist/models/workflow.d.ts +0 -106
- package/dist/services/api.d.ts +0 -11
- package/dist/services/axios.d.ts +0 -14
- package/dist/services/consult.d.ts +0 -54
- package/dist/services/diagnosis.d.ts +0 -44
- package/dist/services/guard.d.ts +0 -92
- package/dist/services/practice.d.ts +0 -100
- package/dist/services/teller.d.ts +0 -9
- package/dist/services/vault.d.ts +0 -54
- package/dist/services/workflow.d.ts +0 -21
- package/src/models/consult.ts +0 -110
- package/src/models/diagnosis.ts +0 -141
- package/src/models/guard.ts +0 -136
- package/src/models/practice.ts +0 -411
- package/src/models/shared.ts +0 -6
- package/src/models/vault.ts +0 -158
- package/src/models/workflow.ts +0 -142
- package/src/services/api.ts +0 -77
- package/src/services/axios.ts +0 -91
- package/src/services/consult.ts +0 -265
- package/src/services/diagnosis.ts +0 -144
- package/src/services/guard.ts +0 -228
- package/src/services/practice.ts +0 -537
- package/src/services/teller.ts +0 -39
- package/src/services/vault.ts +0 -178
- package/src/services/workflow.ts +0 -36
package/README.md
CHANGED
@@ -4,13 +4,14 @@ ORO SDK package is intended to be run in browser only. It contains everything ne
|
|
4
4
|
|
5
5
|
## Requirements
|
6
6
|
|
7
|
-
- npm 6.14.
|
7
|
+
- npm >=6.14.13
|
8
8
|
|
9
9
|
> Powered by [tsdx](https://github.com/formium/tsdx)
|
10
10
|
|
11
11
|
## Local development
|
12
12
|
|
13
13
|
> If you cannot see Jest types try opening this folder in a seperate VSCode window.
|
14
|
+
|
14
15
|
### Set up project
|
15
16
|
|
16
17
|
```bash
|
@@ -24,49 +25,66 @@ npm start # watch
|
|
24
25
|
npm build # build
|
25
26
|
```
|
26
27
|
|
27
|
-
### Linking the
|
28
|
+
### Linking and running the app with sdk
|
28
29
|
|
29
|
-
|
30
|
-
```
|
31
|
-
❯ npm -v
|
32
|
-
6.14.13
|
30
|
+
#### First you need to publish locally the `oro-sdk`
|
33
31
|
|
34
|
-
|
35
|
-
v14.17.0
|
36
|
-
```
|
37
|
-
In **`oro-apis/sdk/js`**:
|
32
|
+
Two cases are possible:
|
38
33
|
|
39
|
-
|
34
|
+
1. You are updating `oro-apis/sdk/ts`:
|
40
35
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
36
|
+
In **`oro-apis/sdk/ts`**:
|
37
|
+
|
38
|
+
```bash
|
39
|
+
npm install
|
40
|
+
npm run link:watch
|
41
|
+
```
|
42
|
+
|
43
|
+
2. You are updating `oro-apis/sdk/apis`:
|
44
|
+
|
45
|
+
In **`oro-apis/sdk/apis`**:
|
46
|
+
|
47
|
+
```bash
|
48
|
+
npm install
|
49
|
+
npm run link:watch
|
50
|
+
```
|
51
|
+
|
52
|
+
In **`oro-apis/sdk/ts`**:
|
53
|
+
|
54
|
+
```bash
|
55
|
+
npm install
|
56
|
+
npm uninstall oro-sdk-apis # optional
|
57
|
+
npm run link:watch:apis
|
58
|
+
```
|
59
|
+
|
60
|
+
#### Then you need to link it locally to the app
|
45
61
|
|
46
62
|
In **`oro-apps/web`**:
|
47
63
|
|
48
64
|
```bash
|
49
|
-
npm uninstall oro-sdk
|
50
|
-
npm link
|
65
|
+
npm uninstall oro-sdk # optional
|
66
|
+
npm run dev:link
|
51
67
|
```
|
52
68
|
|
53
|
-
|
69
|
+
### Publishing package
|
54
70
|
|
55
|
-
|
56
|
-
|
57
|
-
//const module = await import('oro-toolbox')
|
58
|
-
```
|
71
|
+
1. (Only first time) Locally run `npm login` and use the creds in 1password (tech-team-oro) . This will create ~/.npmrc . You will require a OTP but it's sent on tech@orohealth.me so you should all have it.
|
72
|
+
2. Run `docker-compose up --build sdk-publisher`
|
59
73
|
|
60
|
-
|
74
|
+
#### Versioning of `oro-sdk` and `oro-sdk-apis`
|
61
75
|
|
62
|
-
|
63
|
-
sirv('PATH_TO_oro-apis/sdk/js/node_modules/oro-toolbox', { dev }),
|
64
|
-
```
|
76
|
+
As `oro-sdk-apis` is a dependency of `oro-sdk`, if you do some changes on `oro-sdk-apis` you will need to update `oro-sdk` and web app as well.
|
65
77
|
|
66
|
-
|
78
|
+
The versionning should be the same for `oro-sdk-apis` and `oro-sdk`. In other words, as we are using semantic versioning if we update patch/minor/major version of `oro-sdk-apis` we must update the same on `oro-sdk`.
|
67
79
|
|
68
|
-
|
69
|
-
|
70
|
-
|
80
|
+
>Example:
|
81
|
+
>
|
82
|
+
>I want to update the minor version of `oro-sdk-apis`: 1.2.5 -> 1.3.0
|
83
|
+
>
|
84
|
+
>Then I also need to update `package.json` of `oro-sdk` with the dependency `oro-sdk-apis@1.3.0` and I update the minor version of `oro-sdk`: 2.3.2 -> 2.4.0
|
85
|
+
|
86
|
+
You then need to publish packages in following order: `oro-sdk-apis`, `oro-sdk`:
|
87
|
+
|
88
|
+
Then, you update web app dependencies with `oro-sdk@2.4.0`
|
71
89
|
|
72
|
-
|
90
|
+
Done.
|
package/dist/client.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
+
import { Consult, ConsultRequest, ConsultService, DataCreateResponse, DiagnosisService, Document, DocumentType, Grant, GuardService, IdentityResponse, LocalizedData, LockboxManifest, Meta, Metadata, MetadataCategory, PopulatedWorkflowData, Practice, PracticeService, TellerService, TokenData, TosAndCpAcceptanceRequest, Uuid, VaultIndex, VaultService, WorkflowData, WorkflowService } from 'oro-sdk-apis';
|
1
2
|
import * as OroToolbox from 'oro-toolbox';
|
2
|
-
import {
|
3
|
-
import { ConsultService, DiagnosisService, GuardService, PracticeService, TellerService, VaultService, WorkflowService } from './services';
|
3
|
+
import { LocalEncryptedData, RecoveryData, RegisterPatientOutput, UserPreference } from './models';
|
4
4
|
export declare class OroClient {
|
5
5
|
private toolbox;
|
6
6
|
tellerClient: TellerService;
|
@@ -19,7 +19,7 @@ export declare class OroClient {
|
|
19
19
|
constructor(toolbox: typeof OroToolbox, tellerClient: TellerService, vaultClient: VaultService, guardClient: GuardService, practiceClient: PracticeService, consultClient: ConsultService, workflowClient: WorkflowService, diagnosisClient: DiagnosisService, authenticationCallback?: ((err: Error) => void) | undefined);
|
20
20
|
/**
|
21
21
|
* clears the vaultIndex and cached metadata grants
|
22
|
-
|
22
|
+
*/
|
23
23
|
cleanIndex(): Promise<void>;
|
24
24
|
/**
|
25
25
|
* Generates an RSA key pair and password payload (rsa private key encrypted with the password)
|
@@ -70,7 +70,7 @@ export declare class OroClient {
|
|
70
70
|
* @throws IncompleteAuthentication if rsa is not set
|
71
71
|
* @calls authenticationCallback if rsa is not set
|
72
72
|
*/
|
73
|
-
localDecryptJsonPayload({ encryptedKey, encryptedData
|
73
|
+
localDecryptJsonPayload({ encryptedKey, encryptedData }: LocalEncryptedData): any;
|
74
74
|
/**
|
75
75
|
* Effectively kills your "session"
|
76
76
|
*/
|
package/dist/helpers/client.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { PopulatedWorkflowData, MetadataCategory, SelectedAnswersData } from '
|
1
|
+
import { PopulatedWorkflowData, MetadataCategory, SelectedAnswersData } from 'oro-sdk-apis';
|
2
2
|
import { PersonalInformations } from '../models/client';
|
3
3
|
/**
|
4
4
|
* This function extract PersonalInformations from data input object coming from workflow
|
@@ -1,5 +1,5 @@
|
|
1
|
+
import { ConsultRequest, MetadataCategory, Uuid, WorkflowData } from 'oro-sdk-apis';
|
1
2
|
import { OroClient, RegisterPatientOutput } from '..';
|
2
|
-
import { ConsultRequest, MetadataCategory, Uuid, WorkflowData } from '../models';
|
3
3
|
export declare function registerPatient(patientUuid: Uuid, consultRequest: ConsultRequest, workflow: WorkflowData, oroClient: OroClient, masterKey?: Uuid, recoveryQA?: {
|
4
4
|
recoverySecurityQuestions: string[];
|
5
5
|
recoverySecurityAnswers: string[];
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { CryptoRSA } from "oro-toolbox";
|
2
|
-
import { EncryptedIndexEntry, Grant } from "
|
2
|
+
import { EncryptedIndexEntry, Grant } from "oro-sdk-apis";
|
3
3
|
/**
|
4
4
|
* Decrypts and returns the encrypted grants
|
5
5
|
* If something went wrong during decryption, that grant will be removed from the list
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { MetadataCategory, PopulatedWorkflowData, SelectedAnswerData, SelectedAnswersData, WorkflowData, WorkflowUploadedImage } from '
|
1
|
+
import { MetadataCategory, PopulatedWorkflowData, SelectedAnswerData, SelectedAnswersData, WorkflowData, WorkflowUploadedImage } from 'oro-sdk-apis';
|
2
2
|
export declare function filterTriggeredAnsweredWithKind(workflowData: WorkflowData, kind: 'text' | 'date' | 'number' | 'images' | 'images-alias' | 'body-parts' | 'pharmacy-picker'): Promise<SelectedAnswerData[]>;
|
3
3
|
/**
|
4
4
|
* Filters and Populates the `selectedAnswers` from the workflow by
|
package/dist/index.d.ts
CHANGED
@@ -2,8 +2,22 @@ import { OroClient } from './client';
|
|
2
2
|
import * as OroToolboxNamespace from 'oro-toolbox';
|
3
3
|
export declare type OroToolbox = typeof OroToolboxNamespace;
|
4
4
|
export declare let wasmPath: string;
|
5
|
-
|
5
|
+
/**
|
6
|
+
* This function helps you to initialize and OroClient instance
|
7
|
+
* @param toolbox the OroToolbox object
|
8
|
+
* @param tellerBaseURL the teller service base URL
|
9
|
+
* @param vaultBaseURL the vault service base URL
|
10
|
+
* @param guardBaseURL the guard service base URL
|
11
|
+
* @param practiceBaseURL the practice service base URL
|
12
|
+
* @param consultBaseURL the consult service base URL
|
13
|
+
* @param workflowBaseURL the workflow service base URL
|
14
|
+
* @param diagnosisBaseURL the diagnosis service base URL
|
15
|
+
* @param authenticationCallback (optional) authenticationCallback the authentification callback
|
16
|
+
* @returns an instance of OroClient
|
17
|
+
*/
|
18
|
+
declare const init: (toolbox: OroToolbox, tellerBaseURL: string, vaultBaseURL: string, guardBaseURL: string, practiceBaseURL: string, consultBaseURL: string, workflowBaseURL: string, diagnosisBaseURL: string, authenticationCallback?: ((err: Error) => void) | undefined) => OroClient;
|
6
19
|
export { OroClient } from './client';
|
20
|
+
export * from 'oro-sdk-apis';
|
7
21
|
export * from './models';
|
8
22
|
export * from './helpers';
|
9
23
|
export * from './services';
|
package/dist/models/client.d.ts
CHANGED
package/dist/models/error.d.ts
CHANGED
@@ -6,21 +6,7 @@ export declare class MissingLockbox extends Error {
|
|
6
6
|
}
|
7
7
|
export declare class MissingLockboxOwner extends Error {
|
8
8
|
}
|
9
|
-
export declare class IndexBuildError extends Error {
|
10
|
-
}
|
11
9
|
export declare class AssociatedLockboxNotFound extends Error {
|
12
10
|
}
|
13
11
|
export declare class WorkflowAnswersMissingError extends Error {
|
14
12
|
}
|
15
|
-
export declare class AuthenticationFailed extends Error {
|
16
|
-
}
|
17
|
-
export declare class AuthenticationBadRequest extends Error {
|
18
|
-
}
|
19
|
-
export declare class AuthenticationServerError extends Error {
|
20
|
-
}
|
21
|
-
export declare class IdentityCreationFailed extends Error {
|
22
|
-
}
|
23
|
-
export declare class IdentityCreationBadRequest extends Error {
|
24
|
-
}
|
25
|
-
export declare class IdentityCreationConflict extends Error {
|
26
|
-
}
|
package/dist/models/index.d.ts
CHANGED