@secrecy/lib 1.79.1 → 1.80.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.
@@ -9,11 +9,15 @@ export class SecrecyGroupClient {
9
9
  if (!groupIdentity) {
10
10
  throw new Error('Group identity not found');
11
11
  }
12
+ const groupPriv = this.#client.keyPairs[groupIdentity.identityPubKey];
13
+ if (!groupPriv) {
14
+ throw new Error('Group private key not found');
15
+ }
12
16
  const opts = {
13
17
  pubKey: input.pubKey,
14
18
  role: input.role,
15
19
  id: input.id,
16
- encPriv: sodium.to_hex(encryptCryptoBox(sodium.from_hex(groupIdentity.identityPubKey), input.pubKey, this.#client.currentIdentityPrivateKey)),
20
+ encPriv: sodium.to_hex(encryptCryptoBox(sodium.from_hex(groupPriv), input.pubKey, this.#client.currentIdentityPrivateKey)),
17
21
  };
18
22
  return this.#client.apiClient.group.addMember.mutate({
19
23
  ...opts,
@@ -6,6 +6,9 @@ export class SecrecyOrganizationClient {
6
6
  async create(input) {
7
7
  return this.#client.apiClient.org.create.mutate(input);
8
8
  }
9
+ async byId(input) {
10
+ return this.#client.apiClient.org.byId.query(input);
11
+ }
9
12
  async update(input) {
10
13
  return this.#client.apiClient.org.update.mutate(input);
11
14
  }
@@ -4,6 +4,7 @@ export declare class SecrecyOrganizationClient {
4
4
  #private;
5
5
  constructor(client: SecrecyClient);
6
6
  create(input: RouterInputs['org']['create']): Promise<RouterOutputs['org']['create']>;
7
+ byId(input: RouterInputs['org']['byId']): Promise<RouterOutputs['org']['byId']>;
7
8
  update(input: Omit<RouterInputs['org']['update'], 'billingProfileStripeCustomerId'>): Promise<RouterOutputs['org']['update']>;
8
9
  addMember(input: RouterInputs['org']['addMember']): Promise<RouterOutputs['org']['addMember']>;
9
10
  removeMember(input: RouterInputs['org']['removeMember']): Promise<RouterOutputs['org']['removeMember']>;
@@ -5003,7 +5003,6 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
5003
5003
  }>;
5004
5004
  list: import("@trpc/server").TRPCQueryProcedure<{
5005
5005
  input: {
5006
- [x: string]: never;
5007
5006
  orgId?: string | null | undefined;
5008
5007
  };
5009
5008
  output: {
@@ -11358,7 +11357,6 @@ export declare const getTrpcGuestClient: ({ url }?: {
11358
11357
  }>;
11359
11358
  list: import("@trpc/server").TRPCQueryProcedure<{
11360
11359
  input: {
11361
- [x: string]: never;
11362
11360
  orgId?: string | null | undefined;
11363
11361
  };
11364
11362
  output: {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@secrecy/lib",
3
3
  "author": "Anonymize <anonymize@gmail.com>",
4
4
  "description": "Anonymize Secrecy Library",
5
- "version": "1.79.1",
5
+ "version": "1.80.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/anonymize-org/lib.git"
@@ -76,7 +76,7 @@
76
76
  },
77
77
  "dependencies": {
78
78
  "@js-temporal/polyfill": "^0.5.1",
79
- "@secrecy/trpc-api-types": "1.35.2",
79
+ "@secrecy/trpc-api-types": "1.35.7",
80
80
  "@trpc/client": "11.6.0",
81
81
  "@trpc/server": "^11.6.0",
82
82
  "@types/libsodium-wrappers-sumo": "^0.7.8",