@secrecy/lib 1.29.0-feat-upload-file-types.1 → 1.29.0-feat-add-manage-user-data.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.
@@ -70,11 +70,11 @@ export class SecrecyCloudClient {
70
70
  current: encryptedFile.byteLength,
71
71
  percent: 1,
72
72
  });
73
- return uploadFile.id;
73
+ return uploadFile.fileId;
74
74
  }
75
75
  const uploadPartEnded = async (md5, order) => {
76
76
  const { isUploadPartEnded } = await this.#apiClient.cloud.uploadFilePartEnd.mutate({
77
- fileId: uploadFile.id,
77
+ fileId: uploadFile.fileId,
78
78
  md5,
79
79
  order,
80
80
  });
@@ -82,7 +82,7 @@ export class SecrecyCloudClient {
82
82
  };
83
83
  const uploadEnded = async () => {
84
84
  const { isUploadEnded } = await this.#apiClient.cloud.uploadFileEnd.mutate({
85
- fileId: uploadFile.id,
85
+ fileId: uploadFile.fileId,
86
86
  });
87
87
  return isUploadEnded;
88
88
  };
@@ -113,7 +113,7 @@ export class SecrecyCloudClient {
113
113
  for (const [key, value] of Object.entries(part.fields)) {
114
114
  formData.append(key, value);
115
115
  }
116
- formData.append('file', new Blob([chunk.data]), `${uploadFile.id}-${chunk.order}`);
116
+ formData.append('file', new Blob([chunk.data]), `${uploadFile.fileId}-${chunk.order}`);
117
117
  await axios.post(part.url, formData, {
118
118
  onUploadProgress: (progressEvent) => {
119
119
  onProgress(part.order, progressEvent);
@@ -126,8 +126,8 @@ export class SecrecyCloudClient {
126
126
  await byPart(p);
127
127
  }));
128
128
  await uploadEnded();
129
- dataCache.set(uploadFile.id, fileBuffer);
130
- return uploadFile.id;
129
+ dataCache.set(uploadFile.fileId, fileBuffer);
130
+ return uploadFile.fileId;
131
131
  }
132
132
  async uploadFileInCloud({ file, name, nodeId, encryptProgress, uploadProgress, signal, }) {
133
133
  const fileId = await this.uploadFile({
@@ -185,6 +185,7 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
185
185
  avatar: string | null;
186
186
  isSearchable: boolean;
187
187
  }[];
188
+ currentUserId: string;
188
189
  };
189
190
  _output_out: {
190
191
  users: {
@@ -194,6 +195,7 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
194
195
  avatar: string | null;
195
196
  isSearchable: boolean;
196
197
  }[];
198
+ currentUserId: string;
197
199
  };
198
200
  }, unknown>>;
199
201
  };
@@ -1929,11 +1931,13 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
1929
1931
  };
1930
1932
  _output_in: {
1931
1933
  sessionId: string;
1934
+ userId: string;
1932
1935
  } & {
1933
1936
  masterKeySalt: string;
1934
1937
  };
1935
1938
  _output_out: {
1936
1939
  sessionId: string;
1940
+ userId: string;
1937
1941
  } & {
1938
1942
  masterKeySalt: string;
1939
1943
  };
@@ -3996,8 +4000,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
3996
4000
  min?: Date | undefined;
3997
4001
  } | undefined;
3998
4002
  size?: {
3999
- max?: bigint | undefined;
4000
- min?: bigint | undefined;
4003
+ max?: string | bigint | undefined;
4004
+ min?: string | bigint | undefined;
4001
4005
  } | undefined;
4002
4006
  appIds?: string[] | undefined;
4003
4007
  sharedCount?: {
@@ -4034,68 +4038,86 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
4034
4038
  } | undefined;
4035
4039
  };
4036
4040
  _output_in: {
4037
- keyPairs: {
4038
- appId: string;
4039
- pub: string;
4040
- encPriv: string;
4041
- }[];
4042
- nodes: {
4043
- id: string;
4044
- createdAt: Date;
4045
- deletedAt: Date | null;
4046
- name: string;
4047
- updatedAt: Date;
4048
- history: {
4049
- createdAt: Date;
4050
- fileId: string;
4051
- size: bigint;
4052
- storageType: "s3" | "lite";
4053
- }[];
4054
- access: {
4041
+ data: {
4042
+ keyPairs: {
4055
4043
  appId: string;
4056
- nameKey: string;
4057
- };
4058
- totalSize: bigint;
4059
- breadcrumb: {
4044
+ pub: string;
4045
+ encPriv: string;
4046
+ }[];
4047
+ nodes: {
4060
4048
  id: string;
4049
+ createdAt: Date;
4050
+ deletedAt: Date | null;
4061
4051
  name: string;
4062
- nameKey: string | null;
4063
- pubKey: string;
4052
+ updatedAt: Date;
4053
+ history: {
4054
+ createdAt: Date;
4055
+ fileId: string;
4056
+ size: bigint;
4057
+ storageType: "s3" | "lite";
4058
+ }[];
4059
+ access: {
4060
+ appId: string;
4061
+ nameKey: string;
4062
+ };
4063
+ totalSize: bigint;
4064
+ breadcrumb: {
4065
+ id: string;
4066
+ name: string;
4067
+ nameKey: string | null;
4068
+ pubKey: string;
4069
+ }[];
4070
+ sharedCount: number;
4064
4071
  }[];
4065
- sharedCount: number;
4066
- }[];
4072
+ };
4073
+ pagination: {
4074
+ next: number | null;
4075
+ prev: number | null;
4076
+ last: number;
4077
+ perPage: number;
4078
+ totalItems: number;
4079
+ };
4067
4080
  };
4068
4081
  _output_out: {
4069
- keyPairs: {
4070
- appId: string;
4071
- pub: string;
4072
- encPriv: string;
4073
- }[];
4074
- nodes: {
4075
- id: string;
4076
- createdAt: Date;
4077
- deletedAt: Date | null;
4078
- name: string;
4079
- updatedAt: Date;
4080
- history: {
4081
- createdAt: Date;
4082
- fileId: string;
4083
- size: bigint;
4084
- storageType: "s3" | "lite";
4085
- }[];
4086
- access: {
4082
+ data: {
4083
+ keyPairs: {
4087
4084
  appId: string;
4088
- nameKey: string;
4089
- };
4090
- totalSize: bigint;
4091
- breadcrumb: {
4085
+ pub: string;
4086
+ encPriv: string;
4087
+ }[];
4088
+ nodes: {
4092
4089
  id: string;
4090
+ createdAt: Date;
4091
+ deletedAt: Date | null;
4093
4092
  name: string;
4094
- nameKey: string | null;
4095
- pubKey: string;
4093
+ updatedAt: Date;
4094
+ history: {
4095
+ createdAt: Date;
4096
+ fileId: string;
4097
+ size: bigint;
4098
+ storageType: "s3" | "lite";
4099
+ }[];
4100
+ access: {
4101
+ appId: string;
4102
+ nameKey: string;
4103
+ };
4104
+ totalSize: bigint;
4105
+ breadcrumb: {
4106
+ id: string;
4107
+ name: string;
4108
+ nameKey: string | null;
4109
+ pubKey: string;
4110
+ }[];
4111
+ sharedCount: number;
4096
4112
  }[];
4097
- sharedCount: number;
4098
- }[];
4113
+ };
4114
+ pagination: {
4115
+ next: number | null;
4116
+ prev: number | null;
4117
+ last: number;
4118
+ perPage: number;
4119
+ totalItems: number;
4120
+ };
4099
4121
  };
4100
4122
  }, unknown>>;
4101
4123
  };
@@ -4354,12 +4376,7 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
4354
4376
  fileSizeBefore: bigint;
4355
4377
  };
4356
4378
  _output_in: {
4357
- id: string;
4358
- keyPair: {
4359
- pub: string;
4360
- encPriv: string;
4361
- };
4362
- key: string;
4379
+ fileId: string;
4363
4380
  filePartSize: bigint;
4364
4381
  parts: {
4365
4382
  fields: Record<string, string>;
@@ -4368,12 +4385,7 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
4368
4385
  }[];
4369
4386
  };
4370
4387
  _output_out: {
4371
- id: string;
4372
- keyPair: {
4373
- pub: string;
4374
- encPriv: string;
4375
- };
4376
- key: string;
4388
+ fileId: string;
4377
4389
  filePartSize: bigint;
4378
4390
  parts: {
4379
4391
  fields: Record<string, string>;
@@ -4447,19 +4459,9 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
4447
4459
  };
4448
4460
  _output_in: {
4449
4461
  id: string;
4450
- keyPair: {
4451
- pub: string;
4452
- encPriv: string;
4453
- };
4454
- key: string;
4455
4462
  };
4456
4463
  _output_out: {
4457
4464
  id: string;
4458
- keyPair: {
4459
- pub: string;
4460
- encPriv: string;
4461
- };
4462
- key: string;
4463
4465
  };
4464
4466
  }, unknown>>;
4465
4467
  };
@@ -18140,12 +18142,14 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
18140
18142
  _input_in: {
18141
18143
  lastname?: string | null | undefined;
18142
18144
  firstname?: string | null | undefined;
18145
+ avatar?: string | null | undefined;
18143
18146
  isSearchable?: boolean | undefined;
18144
18147
  lang?: "fr" | "en" | null | undefined;
18145
18148
  };
18146
18149
  _input_out: {
18147
18150
  lastname?: string | null | undefined;
18148
18151
  firstname?: string | null | undefined;
18152
+ avatar?: string | null | undefined;
18149
18153
  isSearchable?: boolean | undefined;
18150
18154
  lang?: "fr" | "en" | null | undefined;
18151
18155
  };
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.29.0-feat-upload-file-types.1",
5
+ "version": "1.29.0-feat-add-manage-user-data.1",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/anonymize-org/lib.git"
@@ -74,7 +74,7 @@
74
74
  },
75
75
  "dependencies": {
76
76
  "@secrecy/lib-utils": "^1.0.18",
77
- "@secrecy/trpc-api-types": "1.27.0-feat-file-upload-access.1",
77
+ "@secrecy/trpc-api-types": "1.27.0-feat-add-manage-user-data.1",
78
78
  "@trpc/client": "10.45.2",
79
79
  "@trpc/server": "10.45.2",
80
80
  "@types/libsodium-wrappers-sumo": "^0.7.8",