@secrecy/lib 1.29.0-feat-upload-file-types.1 → 1.29.0-feat-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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
130
|
-
return uploadFile.
|
|
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({
|
package/dist/types/client.d.ts
CHANGED
|
@@ -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
|
-
|
|
4038
|
-
|
|
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
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
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
|
-
|
|
4063
|
-
|
|
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
|
-
|
|
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
|
-
|
|
4070
|
-
|
|
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
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
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
|
-
|
|
4095
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
};
|
|
@@ -4969,9 +4971,13 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
4969
4971
|
};
|
|
4970
4972
|
_input_in: {
|
|
4971
4973
|
id: string;
|
|
4974
|
+
} & {
|
|
4975
|
+
force?: boolean | undefined;
|
|
4972
4976
|
};
|
|
4973
4977
|
_input_out: {
|
|
4974
4978
|
id: string;
|
|
4979
|
+
} & {
|
|
4980
|
+
force?: boolean | undefined;
|
|
4975
4981
|
};
|
|
4976
4982
|
_output_in: {
|
|
4977
4983
|
isDeleted: boolean;
|
|
@@ -18140,12 +18146,14 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
18140
18146
|
_input_in: {
|
|
18141
18147
|
lastname?: string | null | undefined;
|
|
18142
18148
|
firstname?: string | null | undefined;
|
|
18149
|
+
avatar?: string | null | undefined;
|
|
18143
18150
|
isSearchable?: boolean | undefined;
|
|
18144
18151
|
lang?: "fr" | "en" | null | undefined;
|
|
18145
18152
|
};
|
|
18146
18153
|
_input_out: {
|
|
18147
18154
|
lastname?: string | null | undefined;
|
|
18148
18155
|
firstname?: string | null | undefined;
|
|
18156
|
+
avatar?: string | null | undefined;
|
|
18149
18157
|
isSearchable?: boolean | undefined;
|
|
18150
18158
|
lang?: "fr" | "en" | null | undefined;
|
|
18151
18159
|
};
|
|
@@ -18181,6 +18189,62 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
18181
18189
|
};
|
|
18182
18190
|
}, unknown>>;
|
|
18183
18191
|
};
|
|
18192
|
+
myApps: {
|
|
18193
|
+
query: import("@trpc/client").Resolver<import("@trpc/server").BuildProcedure<"query", {
|
|
18194
|
+
_config: import("@trpc/server").RootConfig<{
|
|
18195
|
+
ctx: {
|
|
18196
|
+
req: {
|
|
18197
|
+
headers: Headers;
|
|
18198
|
+
body: ReadableStream<Uint8Array> | null;
|
|
18199
|
+
};
|
|
18200
|
+
res: {
|
|
18201
|
+
headers: Headers;
|
|
18202
|
+
};
|
|
18203
|
+
session: SecrecySession | null;
|
|
18204
|
+
locale: Locales;
|
|
18205
|
+
ls: TranslationFunctions;
|
|
18206
|
+
};
|
|
18207
|
+
meta: object;
|
|
18208
|
+
errorShape: {
|
|
18209
|
+
message: string;
|
|
18210
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
|
|
18211
|
+
data: _trpc_server_dist_error_formatter.DefaultErrorData;
|
|
18212
|
+
} | {
|
|
18213
|
+
data: {
|
|
18214
|
+
zodError: import("zod").typeToFlattenedError<any, string> | null;
|
|
18215
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_KEY;
|
|
18216
|
+
httpStatus: number;
|
|
18217
|
+
path?: string;
|
|
18218
|
+
stack?: string;
|
|
18219
|
+
};
|
|
18220
|
+
message: string;
|
|
18221
|
+
code: import("@trpc/server/rpc").TRPC_ERROR_CODE_NUMBER;
|
|
18222
|
+
};
|
|
18223
|
+
transformer: typeof superjson;
|
|
18224
|
+
}>;
|
|
18225
|
+
_meta: object;
|
|
18226
|
+
_ctx_out: {
|
|
18227
|
+
session: SecrecySession;
|
|
18228
|
+
req: {
|
|
18229
|
+
headers: Headers;
|
|
18230
|
+
body: ReadableStream<Uint8Array> | null;
|
|
18231
|
+
};
|
|
18232
|
+
res: {
|
|
18233
|
+
headers: Headers;
|
|
18234
|
+
};
|
|
18235
|
+
locale: Locales;
|
|
18236
|
+
ls: TranslationFunctions;
|
|
18237
|
+
};
|
|
18238
|
+
_input_in: {};
|
|
18239
|
+
_input_out: {};
|
|
18240
|
+
_output_in: {
|
|
18241
|
+
apps: Record<string, string>;
|
|
18242
|
+
};
|
|
18243
|
+
_output_out: {
|
|
18244
|
+
apps: Record<string, string>;
|
|
18245
|
+
};
|
|
18246
|
+
}, unknown>>;
|
|
18247
|
+
};
|
|
18184
18248
|
};
|
|
18185
18249
|
};
|
|
18186
18250
|
export type ApiClient = ReturnType<typeof createTRPCClient>;
|
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-
|
|
5
|
+
"version": "1.29.0-feat-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-
|
|
77
|
+
"@secrecy/trpc-api-types": "1.27.0-feat-add-manage-user-data.2",
|
|
78
78
|
"@trpc/client": "10.45.2",
|
|
79
79
|
"@trpc/server": "10.45.2",
|
|
80
80
|
"@types/libsodium-wrappers-sumo": "^0.7.8",
|