@secrecy/lib 1.63.0-feat-orgs.6 → 1.64.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/dist/lib/base-client.js +1 -1
- package/dist/lib/client/SecrecyCloudClient.js +1 -1
- package/dist/lib/client/SecrecyMailClient.js +5 -1
- package/dist/lib/index.js +0 -1
- package/dist/types/base-client.d.ts +1 -2
- package/dist/types/client/SecrecyMailClient.d.ts +1 -1
- package/dist/types/client.d.ts +708 -1478
- package/dist/types/index.d.ts +0 -1
- package/package.json +2 -2
package/dist/lib/base-client.js
CHANGED
|
@@ -2,7 +2,7 @@ import { usersCache } from './cache.js';
|
|
|
2
2
|
import { getStorage } from './client/storage.js';
|
|
3
3
|
import { createTRPCClient, } from './client.js';
|
|
4
4
|
import { getPreferedEmail } from './utils.js';
|
|
5
|
-
|
|
5
|
+
async function getPublicUser(client, id) {
|
|
6
6
|
let user = usersCache.get(id);
|
|
7
7
|
if (user !== undefined) {
|
|
8
8
|
return user;
|
|
@@ -328,7 +328,7 @@ export class SecrecyCloudClient {
|
|
|
328
328
|
}
|
|
329
329
|
async shareNode(input, progress) {
|
|
330
330
|
// TODO: Validate input
|
|
331
|
-
const nodesMap = await this.#apiClient.cloud.shareNode.
|
|
331
|
+
const nodesMap = await this.#apiClient.cloud.shareNode.query(input);
|
|
332
332
|
const neededUserKey = Object.entries(nodesMap)
|
|
333
333
|
.filter(([, nodes]) => nodes.some((node) => node.includeKeys))
|
|
334
334
|
.map(([userId]) => userId);
|
|
@@ -36,7 +36,11 @@ export class SecrecyMailClient {
|
|
|
36
36
|
}
|
|
37
37
|
async create(data, customMessage) {
|
|
38
38
|
const mail = await this.createDraft(data);
|
|
39
|
-
|
|
39
|
+
const isSent = await this.sendDraft(mail.mailIntegrityId, customMessage);
|
|
40
|
+
if (!isSent) {
|
|
41
|
+
throw new Error('The mail does not sent!');
|
|
42
|
+
}
|
|
43
|
+
return { ...mail, type: 'sent' };
|
|
40
44
|
}
|
|
41
45
|
async waitingReceivedMails() {
|
|
42
46
|
const waitingReceivedMails = await this.#apiClient.mail.waitingReceived.query({});
|
package/dist/lib/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type ApiClient, type RouterOutputs, type RouterInputs, CreateTrpcClientOptions } from './client.js';
|
|
2
2
|
import { type InfuraNetwork, type PublicUser } from './index.js';
|
|
3
3
|
import { type SelfUser } from './client/types/user.js';
|
|
4
|
-
export declare function getPublicUser(client: ApiClient, id: string): Promise<PublicUser>;
|
|
5
4
|
export type SecrecyUrls = {
|
|
6
5
|
auth: string;
|
|
7
6
|
account: string;
|
|
@@ -25,7 +24,7 @@ export declare class BaseClient {
|
|
|
25
24
|
static getUser(userId: string, opts?: CreateTrpcClientOptions): Promise<PublicUser>;
|
|
26
25
|
getUser(userId: string): Promise<PublicUser>;
|
|
27
26
|
searchUsers(search: string): Promise<PublicUser[]>;
|
|
28
|
-
updateProfile(data: RouterInputs['user']['updateProfile']): Promise<Omit<SelfUser, 'account'
|
|
27
|
+
updateProfile(data: RouterInputs['user']['updateProfile']): Promise<Omit<SelfUser, 'account'>>;
|
|
29
28
|
static isCryptoTransactionDone({ idOrHash, network, opts, }: {
|
|
30
29
|
idOrHash: string;
|
|
31
30
|
network?: InfuraNetwork;
|
|
@@ -14,7 +14,7 @@ export declare class SecrecyMailClient {
|
|
|
14
14
|
deletedMails({ mailType, }: {
|
|
15
15
|
mailType: ApiMail['type'];
|
|
16
16
|
}): Promise<Mail[]>;
|
|
17
|
-
create(data: NewMail, customMessage?: string | null | undefined): Promise<
|
|
17
|
+
create(data: NewMail, customMessage?: string | null | undefined): Promise<SentMail>;
|
|
18
18
|
waitingReceivedMails(): Promise<WaitingReceivedMail[]>;
|
|
19
19
|
updateDraft(draftId: string, { body, subject, senderFiles, recipients, replyToId }: Partial<NewMail>): Promise<DraftMail>;
|
|
20
20
|
deleteDraft(draftId: string): Promise<boolean>;
|