oro-sdk 2.1.4-dev1.0 → 2.2.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.
Files changed (63) hide show
  1. package/README.md +26 -34
  2. package/dist/client.d.ts +4 -4
  3. package/dist/helpers/client.d.ts +1 -1
  4. package/dist/helpers/patient-registration.d.ts +1 -1
  5. package/dist/helpers/vault-grants.d.ts +1 -1
  6. package/dist/helpers/workflow.d.ts +1 -1
  7. package/dist/index.d.ts +15 -1
  8. package/dist/models/client.d.ts +1 -1
  9. package/dist/models/error.d.ts +0 -14
  10. package/dist/models/index.d.ts +0 -7
  11. package/dist/oro-sdk.cjs.development.js +313 -2367
  12. package/dist/oro-sdk.cjs.development.js.map +1 -1
  13. package/dist/oro-sdk.cjs.production.min.js +1 -1
  14. package/dist/oro-sdk.cjs.production.min.js.map +1 -1
  15. package/dist/oro-sdk.esm.js +246 -2344
  16. package/dist/oro-sdk.esm.js.map +1 -1
  17. package/dist/sdk-revision/client.d.ts +2 -2
  18. package/dist/services/index.d.ts +0 -9
  19. package/package.json +4 -1
  20. package/src/client.ts +161 -435
  21. package/src/helpers/client.ts +1 -1
  22. package/src/helpers/patient-registration.ts +85 -166
  23. package/src/helpers/vault-grants.ts +1 -1
  24. package/src/helpers/workflow.ts +21 -59
  25. package/src/index.ts +42 -28
  26. package/src/models/client.ts +1 -1
  27. package/src/models/error.ts +6 -13
  28. package/src/models/index.ts +0 -7
  29. package/src/sdk-revision/client.ts +25 -20
  30. package/src/services/external/clinia.ts +1 -1
  31. package/src/services/index.ts +0 -9
  32. package/dist/models/consult.d.ts +0 -102
  33. package/dist/models/diagnosis.d.ts +0 -122
  34. package/dist/models/guard.d.ts +0 -119
  35. package/dist/models/practice.d.ts +0 -353
  36. package/dist/models/shared.d.ts +0 -8
  37. package/dist/models/vault.d.ts +0 -124
  38. package/dist/models/workflow.d.ts +0 -106
  39. package/dist/services/api.d.ts +0 -11
  40. package/dist/services/axios.d.ts +0 -14
  41. package/dist/services/consult.d.ts +0 -54
  42. package/dist/services/diagnosis.d.ts +0 -44
  43. package/dist/services/guard.d.ts +0 -92
  44. package/dist/services/practice.d.ts +0 -100
  45. package/dist/services/teller.d.ts +0 -9
  46. package/dist/services/vault.d.ts +0 -54
  47. package/dist/services/workflow.d.ts +0 -21
  48. package/src/models/consult.ts +0 -110
  49. package/src/models/diagnosis.ts +0 -141
  50. package/src/models/guard.ts +0 -136
  51. package/src/models/practice.ts +0 -411
  52. package/src/models/shared.ts +0 -6
  53. package/src/models/vault.ts +0 -158
  54. package/src/models/workflow.ts +0 -142
  55. package/src/services/api.ts +0 -77
  56. package/src/services/axios.ts +0 -91
  57. package/src/services/consult.ts +0 -265
  58. package/src/services/diagnosis.ts +0 -144
  59. package/src/services/guard.ts +0 -228
  60. package/src/services/practice.ts +0 -537
  61. package/src/services/teller.ts +0 -39
  62. package/src/services/vault.ts +0 -178
  63. package/src/services/workflow.ts +0 -36
@@ -1,178 +0,0 @@
1
- import { APIService } from './api'
2
- import {
3
- DataCreateResponse,
4
- DataResponse,
5
- GrantedLockboxes,
6
- LockboxCreateResponse,
7
- LockboxDataRequest,
8
- LockboxGrantRequest,
9
- LockboxManifest,
10
- SharedSecretResponse,
11
- Uuid,
12
- EncryptedVaultIndex,
13
- IndexKey,
14
- EncryptedIndexEntry
15
- } from '../models'
16
-
17
- export class VaultService {
18
- constructor(private api: APIService, private baseURL: string) { }
19
-
20
- public async lockboxCreate(lockboxMetadata?: Object): Promise<LockboxCreateResponse> {
21
- return this.api.post<LockboxCreateResponse>(
22
- `${this.baseURL}/v1/lockbox`,
23
- lockboxMetadata
24
- )
25
- }
26
-
27
- public async lockboxMetadataAdd(
28
- lockboxUuid: Uuid,
29
- lockboxMetadata: Object,
30
- lockboxOwnerUuid?: Uuid
31
- ): Promise<LockboxCreateResponse> {
32
- return this.api.put<LockboxCreateResponse>(
33
- `${this.baseURL}/v1/lockbox/${lockboxUuid}`,
34
- lockboxMetadata,
35
- { params: { lockbox_owner_uuid: lockboxOwnerUuid } }
36
- )
37
- }
38
-
39
- public async lockboxSecretGet(
40
- lockboxUuid: Uuid,
41
- lockboxOwnerUuid?: Uuid
42
- ): Promise<SharedSecretResponse> {
43
- return this.api.get<SharedSecretResponse>(
44
- `${this.baseURL}/v1/lockboxes/${lockboxUuid}/secret`,
45
- { params: { lockbox_owner_uuid: lockboxOwnerUuid } }
46
- )
47
- }
48
-
49
- public async lockboxGrant(
50
- lockboxUuid: Uuid,
51
- req: LockboxGrantRequest,
52
- lockboxOwnerUuid?: Uuid
53
- ): Promise<void> {
54
- return this.api.post<void>(
55
- `${this.baseURL}/v1/lockboxes/${lockboxUuid}/grant`,
56
- req,
57
- { params: { lockbox_owner_uuid: lockboxOwnerUuid } }
58
- )
59
- }
60
-
61
- /**
62
- * Get all lockboxes granted to user
63
- * @param filter filter of lockbox metadata
64
- * @returns decrypted lockboxes granted to user
65
- */
66
- public async grantsGet(): Promise<GrantedLockboxes> {
67
- return this.api.get<GrantedLockboxes>(`${this.baseURL}/v1/grants`)
68
- }
69
-
70
- /**
71
- * This function create or update a data into the vault.
72
- * @note At creation it is necessary to have all `req` filled
73
- * @note When setting `previousDataUuid` you are updating the data. `req` metadata fields are optional.
74
- * @param lockboxUuid The lockbox uuid the data will be stored in
75
- * @param req The request (please see notes)
76
- * @param lockboxOwnerUuid The uuid of the owner of the lockbox (@deprecated)
77
- * @param previousDataUuid The data uuid of the data you want to update
78
- * @returns
79
- */
80
- public async lockboxDataStore(
81
- lockboxUuid: Uuid,
82
- req: LockboxDataRequest,
83
- lockboxOwnerUuid?: Uuid,
84
- previousDataUuid?: Uuid
85
- ): Promise<DataCreateResponse> {
86
- return this.api.post<DataCreateResponse>(
87
- `${this.baseURL}/v1/lockboxes/${lockboxUuid}/data`,
88
- req,
89
- {
90
- params: {
91
- lockbox_owner_uuid: lockboxOwnerUuid,
92
- data_uuid: previousDataUuid,
93
- },
94
- }
95
- )
96
- }
97
-
98
- public async lockboxDataGet(
99
- lockboxUuid: Uuid,
100
- dataUuid: Uuid,
101
- lockboxOwnerUuid?: Uuid,
102
- stream: boolean = true
103
- ): Promise<DataResponse> {
104
- let data = await this.api.get(
105
- `${this.baseURL}/v1/lockboxes/${lockboxUuid}/data/${dataUuid}`,
106
- { params: { lockbox_owner_uuid: lockboxOwnerUuid, stream } }
107
- )
108
-
109
- // returned as stream, we need to put inside a DataResponse object
110
- if (stream)
111
- return { data }
112
-
113
- return data
114
- }
115
-
116
- public async lockboxManifestGet(
117
- lockboxUuid: Uuid,
118
- filter?: Object,
119
- lockboxOwnerUuid?: Uuid
120
- ): Promise<LockboxManifest> {
121
- return this.api.get(`${this.baseURL}/v1/lockboxes/${lockboxUuid}`, {
122
- params: { lockbox_owner_uuid: lockboxOwnerUuid, filter },
123
- })
124
- }
125
-
126
- public async lockboxMetadataGet(
127
- lockboxUuid: Uuid,
128
- fields: string[],
129
- groupby: string[],
130
- filter?: Object,
131
- lockboxOwnerUuid?: Uuid
132
- ): Promise<any[]> {
133
- return this.api.get(`${this.baseURL}/v1/lockboxes/${lockboxUuid}/metadata`, {
134
- params: { lockbox_owner_uuid: lockboxOwnerUuid, fields, groupby, filter },
135
- })
136
- }
137
-
138
- /**
139
- * inserts or updates encrypted index entries
140
- * @note if the index data is being inserted for a user other than the requester, use `indexOwnerUuid`
141
- * @note if a uuid for an entry is provided, the service will perform an update
142
- * @param entries the encrypted index data
143
- * @param indexOwnerUuid
144
- */
145
- public async vaultIndexPut(entries: EncryptedVaultIndex, indexOwnerUuid?: Uuid): Promise<void> {
146
- return this.api.put(`${this.baseURL}/v1/index`,
147
- entries,
148
- {
149
- params: {
150
- index_owner_uuid: indexOwnerUuid,
151
- },
152
- }
153
- )
154
- }
155
-
156
- /**
157
- * inserts or updates index snapshot for the provided index owner
158
- * @note if the index data is being inserted for a user other than the requester, use `indexOwnerUuid`
159
- * @param entry the encrypted index snapshot
160
- */
161
- public async vaultIndexSnapshotPut(entry: EncryptedIndexEntry): Promise<void> {
162
- return this.api.put(`${this.baseURL}/v1/index-snapshot`, entry)
163
- }
164
-
165
- /**
166
- * Retrieves the encrypted index from the vault for the requesting user
167
- * @note index keys can be specified to narrow the scope of index being requested
168
- * @param indexKeys accepted index fields determined by vault
169
- * @param identifiers: an array of unique_hashes or consultation uuids used to identify an index entry
170
- * @param timestamp the minimum timestamp that index entries were created
171
- * @returns the encrypted index
172
- */
173
- public async vaultIndexGet(indexKeys: IndexKey[], identifiers?: string[], timestamp?: Date): Promise<EncryptedVaultIndex> {
174
- return this.api.get<EncryptedVaultIndex>(`${this.baseURL}/v1/index`, {
175
- params: { index_keys: indexKeys, identifiers, timestamp },
176
- })
177
- }
178
- }
@@ -1,36 +0,0 @@
1
- import { WorkflowData } from '../models/workflow'
2
- import { APIService } from './api'
3
-
4
- export class WorkflowService {
5
- private v1Url: string
6
-
7
- constructor(private api: APIService, url: string) {
8
- this.v1Url = `${url}/v1`
9
- }
10
-
11
- /**
12
- * This function returns all workflows
13
- * @returns desired workflow
14
- */
15
- public getWorkflows(): Promise<WorkflowData[]> {
16
- return this.api.get<WorkflowData[]>(`${this.v1Url}/workflows`)
17
- }
18
-
19
- /**
20
- * This function retrieves a workflow. If `locale` is not found, it will try to find 'en' version of it.
21
- * By default, will return most recent workflow of a specific `id`. `createdAt` can be used to select older version.
22
- * @param id The uuid of the workflow
23
- * @param locale (optional) The desired locale of the workflow (default: 'en')
24
- * @param createdAt (optional) The creation date of the workflow (also used for versionning)
25
- * @returns desired workflow
26
- */
27
- public getWorkflow(
28
- id: string,
29
- locale?: string,
30
- createdAt?: string
31
- ): Promise<WorkflowData> {
32
- return this.api.get<WorkflowData>(`${this.v1Url}/workflows/${id}`, {
33
- params: { locale, createdAt },
34
- })
35
- }
36
- }