@secrecy/lib 1.7.0-integration-trpc-client.43 → 1.7.0-integration-trpc-client.45
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/lib/client/SecrecryCareClient.js +19 -0
- package/dist/lib/client/SecrecyAppClient.js +4 -4
- package/dist/lib/client/index.js +3 -0
- package/dist/types/client/SecrecryCareClient.d.ts +9 -0
- package/dist/types/client/SecrecyAppClient.d.ts +2 -2
- package/dist/types/client/index.d.ts +2 -0
- package/dist/types/client.d.ts +2719 -80
- package/package.json +2 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class SecrecyCareClient {
|
|
2
|
+
#client;
|
|
3
|
+
#keys;
|
|
4
|
+
#apiClient;
|
|
5
|
+
constructor(client, keys, apiClient) {
|
|
6
|
+
this.#client = client;
|
|
7
|
+
this.#keys = keys;
|
|
8
|
+
this.#apiClient = apiClient;
|
|
9
|
+
}
|
|
10
|
+
async getProfessional(input) {
|
|
11
|
+
return await this.#apiClient.care.professional.get.query(input);
|
|
12
|
+
}
|
|
13
|
+
async listProfessionals(input) {
|
|
14
|
+
return await this.#apiClient.care.professional.list.query(input);
|
|
15
|
+
}
|
|
16
|
+
async registerProfessional(input) {
|
|
17
|
+
return await this.#apiClient.care.professional.register.mutate(input);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -42,11 +42,11 @@ export class SecrecyAppClient {
|
|
|
42
42
|
async limits() {
|
|
43
43
|
return await this.#apiClient.application.limits.query({});
|
|
44
44
|
}
|
|
45
|
-
async
|
|
46
|
-
return await this.#apiClient.application.
|
|
45
|
+
async metrics() {
|
|
46
|
+
return await this.#apiClient.application.metrics.query({});
|
|
47
47
|
}
|
|
48
|
-
async
|
|
49
|
-
return await this.#apiClient.application.
|
|
48
|
+
async quotas() {
|
|
49
|
+
return await this.#apiClient.application.quotas.query({});
|
|
50
50
|
}
|
|
51
51
|
async updateNotifications(notifications) {
|
|
52
52
|
const updateAppNotifications = await this.#apiClient.application.updateNotification.mutate({
|
package/dist/lib/client/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { SecrecyDbClient } from './SecrecyDbClient.js';
|
|
|
9
9
|
import { SecrecyWalletClient } from './SecrecyWalletClient.js';
|
|
10
10
|
import { SecrecyPayClient } from './SecrecyPayClient.js';
|
|
11
11
|
import { SecrecyUserClient } from './SecrecyUserClient.js';
|
|
12
|
+
import { SecrecyCareClient } from './SecrecryCareClient.js';
|
|
12
13
|
export const encryptName = async (name, nameKey) => {
|
|
13
14
|
const { data } = await encryptSecretstream(sodium.from_hex(nameKey), sodium.from_string(name));
|
|
14
15
|
const nameEncrypted = sodium.to_hex(data);
|
|
@@ -16,6 +17,7 @@ export const encryptName = async (name, nameKey) => {
|
|
|
16
17
|
};
|
|
17
18
|
export class SecrecyClient extends BaseClient {
|
|
18
19
|
#keys;
|
|
20
|
+
care;
|
|
19
21
|
cloud;
|
|
20
22
|
mail;
|
|
21
23
|
app;
|
|
@@ -26,6 +28,7 @@ export class SecrecyClient extends BaseClient {
|
|
|
26
28
|
constructor(uaSession, uaKeys, uaJwt) {
|
|
27
29
|
super(uaSession);
|
|
28
30
|
this.#keys = uaKeys;
|
|
31
|
+
this.care = new SecrecyCareClient(this, this.#keys, this.client);
|
|
29
32
|
this.cloud = new SecrecyCloudClient(this, this.#keys, this.client);
|
|
30
33
|
this.mail = new SecrecyMailClient(this, this.#keys, this.client);
|
|
31
34
|
this.app = new SecrecyAppClient(uaJwt, this, this.#keys, this.client);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SecrecyClient, KeyPair } from '../index.js';
|
|
2
|
+
import type { ApiClient, RouterInputs, RouterOutputs } from '../client.js';
|
|
3
|
+
export declare class SecrecyCareClient {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(client: SecrecyClient, keys: KeyPair, apiClient: ApiClient);
|
|
6
|
+
getProfessional(input: RouterInputs['care']['professional']['get']): Promise<RouterOutputs['care']['professional']['get']>;
|
|
7
|
+
listProfessionals(input: RouterInputs['care']['professional']['list']): Promise<RouterOutputs['care']['professional']['list']>;
|
|
8
|
+
registerProfessional(input: RouterInputs['care']['professional']['register']): Promise<RouterOutputs['care']['professional']['register']>;
|
|
9
|
+
}
|
|
@@ -10,8 +10,8 @@ export declare class SecrecyAppClient {
|
|
|
10
10
|
get userId(): string;
|
|
11
11
|
getJwt(): Promise<string>;
|
|
12
12
|
limits(): Promise<RouterOutputs['application']['limits']>;
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
metrics(): Promise<RouterOutputs['application']['metrics']>;
|
|
14
|
+
quotas(): Promise<RouterOutputs['application']['quotas']>;
|
|
15
15
|
updateNotifications(notifications: Partial<UserAppNotifications>): Promise<UserAppNotifications>;
|
|
16
16
|
notifications(): Promise<UserAppNotifications>;
|
|
17
17
|
userPublicKey(userId: string): Promise<string>;
|
|
@@ -9,11 +9,13 @@ import { SecrecyPayClient } from './SecrecyPayClient.js';
|
|
|
9
9
|
import { type RouterInputs } from '../client.js';
|
|
10
10
|
import { type KeyPair } from './types/index.js';
|
|
11
11
|
import { SecrecyUserClient } from './SecrecyUserClient.js';
|
|
12
|
+
import { SecrecyCareClient } from './SecrecryCareClient.js';
|
|
12
13
|
export type NewMail = Pick<RouterInputs['mail']['createDraft'], 'body' | 'subject' | 'senderFiles' | 'recipients' | 'replyToId'>;
|
|
13
14
|
export type ProgressCallback = (progress: Progress) => Promise<void>;
|
|
14
15
|
export declare const encryptName: (name: string, nameKey: string) => Promise<string>;
|
|
15
16
|
export declare class SecrecyClient extends BaseClient {
|
|
16
17
|
#private;
|
|
18
|
+
care: SecrecyCareClient;
|
|
17
19
|
cloud: SecrecyCloudClient;
|
|
18
20
|
mail: SecrecyMailClient;
|
|
19
21
|
app: SecrecyAppClient;
|