@secrecy/lib 1.52.0-feat-public-data-link.2 → 1.53.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.
|
@@ -15,6 +15,7 @@ import { promiseAllLimit } from '../utils/promise.js';
|
|
|
15
15
|
import { kiloToBytes } from '../utils.js';
|
|
16
16
|
// import { md5 } from "../worker/index.js";
|
|
17
17
|
// import { firstValueFrom, of } from "rxjs";
|
|
18
|
+
import { fileTypeFromBlob, fileTypeFromBuffer } from 'file-type';
|
|
18
19
|
export class SecrecyCloudClient {
|
|
19
20
|
#client;
|
|
20
21
|
#keys;
|
|
@@ -49,12 +50,26 @@ export class SecrecyCloudClient {
|
|
|
49
50
|
}
|
|
50
51
|
return internalNodeFullToNodeFull(node);
|
|
51
52
|
}
|
|
52
|
-
async uploadData({ storageType, data, encrypted = true, encryptProgress, uploadProgress, signal, }) {
|
|
53
|
+
async uploadData({ storageType, data, encrypted = true, encryptProgress, uploadProgress, signal, meta, }) {
|
|
54
|
+
let filetype;
|
|
55
|
+
if (meta === true) {
|
|
56
|
+
filetype = await (data instanceof File
|
|
57
|
+
? fileTypeFromBlob(data)
|
|
58
|
+
: fileTypeFromBuffer(data));
|
|
59
|
+
}
|
|
60
|
+
else if (typeof meta !== 'undefined') {
|
|
61
|
+
filetype = meta;
|
|
62
|
+
}
|
|
63
|
+
else if (!encrypted) {
|
|
64
|
+
filetype = await (data instanceof File
|
|
65
|
+
? fileTypeFromBlob(data)
|
|
66
|
+
: fileTypeFromBuffer(data));
|
|
67
|
+
}
|
|
53
68
|
const dataBuffer = data instanceof File ? new Uint8Array(await data.arrayBuffer()) : data;
|
|
54
69
|
if (storageType === 'lite' && dataBuffer.byteLength > kiloToBytes(4500)) {
|
|
55
70
|
throw new Error('The data is too big for lite upload!');
|
|
56
71
|
}
|
|
57
|
-
const compressed = compress(dataBuffer);
|
|
72
|
+
const compressed = encrypted ? compress(dataBuffer) : dataBuffer;
|
|
58
73
|
const dataKey = encrypted ? secretStreamKeygen() : null;
|
|
59
74
|
const { data: encryptedData, md5: md5Data, md5Encrypted, } = dataKey
|
|
60
75
|
? await encrypt(dataKey, compressed, encryptProgress, signal)
|
|
@@ -80,12 +95,15 @@ export class SecrecyCloudClient {
|
|
|
80
95
|
key: sodium.to_hex(encryptedDataKey),
|
|
81
96
|
md5Encrypted,
|
|
82
97
|
md5: md5Data,
|
|
98
|
+
...filetype,
|
|
83
99
|
}
|
|
84
100
|
: {
|
|
85
101
|
type: 'unencrypted',
|
|
86
102
|
content: Buffer.from(encryptedData),
|
|
87
103
|
md5: md5Data,
|
|
104
|
+
sizeEncrypted: undefined,
|
|
88
105
|
size: BigInt(dataBuffer.byteLength),
|
|
106
|
+
...filetype,
|
|
89
107
|
};
|
|
90
108
|
const uploadData = await this.#apiClient.cloud.uploadLiteData.mutate(uploadDataArgs, { signal });
|
|
91
109
|
await uploadProgress?.({
|
|
@@ -99,6 +117,7 @@ export class SecrecyCloudClient {
|
|
|
99
117
|
size: uploadDataArgs.size,
|
|
100
118
|
sizeEncrypted: uploadDataArgs.sizeEncrypted ?? null,
|
|
101
119
|
data: dataBuffer,
|
|
120
|
+
...filetype,
|
|
102
121
|
});
|
|
103
122
|
return {
|
|
104
123
|
object: 'lite',
|
|
@@ -114,11 +133,14 @@ export class SecrecyCloudClient {
|
|
|
114
133
|
key: sodium.to_hex(encryptedDataKey),
|
|
115
134
|
md5Encrypted,
|
|
116
135
|
md5: md5Data,
|
|
136
|
+
...filetype,
|
|
117
137
|
}
|
|
118
138
|
: {
|
|
119
139
|
type: 'unencrypted',
|
|
120
140
|
md5: md5Data,
|
|
121
141
|
size: BigInt(dataBuffer.byteLength),
|
|
142
|
+
sizeEncrypted: undefined,
|
|
143
|
+
...filetype,
|
|
122
144
|
};
|
|
123
145
|
const uploadDataCaller = storageType === 's3'
|
|
124
146
|
? this.#apiClient.cloud.uploadData
|
|
@@ -141,6 +163,7 @@ export class SecrecyCloudClient {
|
|
|
141
163
|
size: uploadDataArgs.size,
|
|
142
164
|
sizeEncrypted: uploadDataArgs.sizeEncrypted ?? null,
|
|
143
165
|
data: dataBuffer,
|
|
166
|
+
...filetype,
|
|
144
167
|
});
|
|
145
168
|
return {
|
|
146
169
|
object: storageType,
|
|
@@ -199,6 +222,7 @@ export class SecrecyCloudClient {
|
|
|
199
222
|
size: uploadDataArgs.size,
|
|
200
223
|
sizeEncrypted: uploadDataArgs.sizeEncrypted ?? null,
|
|
201
224
|
data: dataBuffer,
|
|
225
|
+
...filetype,
|
|
202
226
|
});
|
|
203
227
|
return {
|
|
204
228
|
object: storageType,
|
|
@@ -666,6 +690,8 @@ export class SecrecyCloudClient {
|
|
|
666
690
|
sizeEncrypted: dataContent.sizeEncrypted,
|
|
667
691
|
storageType: dataContent.storageType,
|
|
668
692
|
data: decompressed,
|
|
693
|
+
mime: dataContent.mime ?? undefined,
|
|
694
|
+
ext: dataContent.ext ?? undefined,
|
|
669
695
|
});
|
|
670
696
|
return {
|
|
671
697
|
id: dataContent.id,
|
|
@@ -673,6 +699,8 @@ export class SecrecyCloudClient {
|
|
|
673
699
|
sizeEncrypted: dataContent.sizeEncrypted,
|
|
674
700
|
storageType: dataContent.storageType,
|
|
675
701
|
data: decompressed,
|
|
702
|
+
mime: dataContent.mime ?? undefined,
|
|
703
|
+
ext: dataContent.ext ?? undefined,
|
|
676
704
|
};
|
|
677
705
|
}
|
|
678
706
|
}
|
|
@@ -2,6 +2,7 @@ import type { ProgressCallback, SecrecyClient } from '../index.js';
|
|
|
2
2
|
import type { DataMetadata, DataStorageType, KeyPair, LocalData, Node, NodeFull, NodeType, Rights } from './types/index.js';
|
|
3
3
|
import { type RouterInputs, type ApiClient, type RouterOutputs } from '../client.js';
|
|
4
4
|
import { type DownloadProgress } from '../types.js';
|
|
5
|
+
import { FileTypeResult } from 'file-type';
|
|
5
6
|
export declare class SecrecyCloudClient {
|
|
6
7
|
#private;
|
|
7
8
|
constructor(client: SecrecyClient, keys: KeyPair, apiClient: ApiClient);
|
|
@@ -9,13 +10,14 @@ export declare class SecrecyCloudClient {
|
|
|
9
10
|
dataId: string;
|
|
10
11
|
nodeId: string;
|
|
11
12
|
}): Promise<NodeFull>;
|
|
12
|
-
uploadData({ storageType, data, encrypted, encryptProgress, uploadProgress, signal, }: {
|
|
13
|
+
uploadData({ storageType, data, encrypted, encryptProgress, uploadProgress, signal, meta, }: {
|
|
13
14
|
storageType: DataStorageType;
|
|
14
15
|
data: globalThis.File | Uint8Array;
|
|
15
16
|
encrypted?: boolean;
|
|
16
17
|
encryptProgress?: ProgressCallback;
|
|
17
18
|
uploadProgress?: ProgressCallback;
|
|
18
19
|
signal?: AbortSignal;
|
|
20
|
+
meta?: FileTypeResult | true;
|
|
19
21
|
}): Promise<{
|
|
20
22
|
id: string;
|
|
21
23
|
object: DataStorageType;
|
|
@@ -8,6 +8,8 @@ export type LocalData = {
|
|
|
8
8
|
size: bigint;
|
|
9
9
|
sizeEncrypted: bigint | null;
|
|
10
10
|
data: Uint8Array;
|
|
11
|
+
mime?: string;
|
|
12
|
+
ext?: string;
|
|
11
13
|
};
|
|
12
14
|
export type DataMetadata = Pick<ApiData, 'id' | 'size' | 'sizeEncrypted' | 'md5' | 'md5Encrypted' | 'createdAt'>;
|
|
13
15
|
export type InternalData = DataMetadata & {
|
package/dist/types/client.d.ts
CHANGED
|
@@ -2093,6 +2093,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2093
2093
|
userAppAppId: string;
|
|
2094
2094
|
sizeEncrypted: bigint | null;
|
|
2095
2095
|
md5Encrypted: string | null;
|
|
2096
|
+
mime: string | null;
|
|
2097
|
+
ext: string | null;
|
|
2096
2098
|
validatedAt: Date | null;
|
|
2097
2099
|
restoreSince: Date | null;
|
|
2098
2100
|
access: {
|
|
@@ -2110,6 +2112,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2110
2112
|
userAppAppId: string;
|
|
2111
2113
|
sizeEncrypted: bigint | null;
|
|
2112
2114
|
md5Encrypted: string | null;
|
|
2115
|
+
mime: string | null;
|
|
2116
|
+
ext: string | null;
|
|
2113
2117
|
validatedAt: Date | null;
|
|
2114
2118
|
restoreSince: Date | null;
|
|
2115
2119
|
access: {
|
|
@@ -2240,6 +2244,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2240
2244
|
userAppAppId: string;
|
|
2241
2245
|
sizeEncrypted: bigint | null;
|
|
2242
2246
|
md5Encrypted: string | null;
|
|
2247
|
+
mime: string | null;
|
|
2248
|
+
ext: string | null;
|
|
2243
2249
|
validatedAt: Date | null;
|
|
2244
2250
|
restoreSince: Date | null;
|
|
2245
2251
|
access: {
|
|
@@ -2257,6 +2263,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2257
2263
|
userAppAppId: string;
|
|
2258
2264
|
sizeEncrypted: bigint | null;
|
|
2259
2265
|
md5Encrypted: string | null;
|
|
2266
|
+
mime: string | null;
|
|
2267
|
+
ext: string | null;
|
|
2260
2268
|
validatedAt: Date | null;
|
|
2261
2269
|
restoreSince: Date | null;
|
|
2262
2270
|
access: {
|
|
@@ -2426,6 +2434,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2426
2434
|
userAppAppId: string;
|
|
2427
2435
|
sizeEncrypted: bigint | null;
|
|
2428
2436
|
md5Encrypted: string | null;
|
|
2437
|
+
mime: string | null;
|
|
2438
|
+
ext: string | null;
|
|
2429
2439
|
validatedAt: Date | null;
|
|
2430
2440
|
restoreSince: Date | null;
|
|
2431
2441
|
access: {
|
|
@@ -2443,6 +2453,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2443
2453
|
userAppAppId: string;
|
|
2444
2454
|
sizeEncrypted: bigint | null;
|
|
2445
2455
|
md5Encrypted: string | null;
|
|
2456
|
+
mime: string | null;
|
|
2457
|
+
ext: string | null;
|
|
2446
2458
|
validatedAt: Date | null;
|
|
2447
2459
|
restoreSince: Date | null;
|
|
2448
2460
|
access: {
|
|
@@ -2491,6 +2503,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2491
2503
|
md5: string;
|
|
2492
2504
|
sizeEncrypted: bigint | null;
|
|
2493
2505
|
md5Encrypted: string | null;
|
|
2506
|
+
mime: string | null;
|
|
2507
|
+
ext: string | null;
|
|
2494
2508
|
senderPublicKey: string;
|
|
2495
2509
|
maybeParts: {
|
|
2496
2510
|
md5: string;
|
|
@@ -2507,6 +2521,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2507
2521
|
md5: string;
|
|
2508
2522
|
sizeEncrypted: bigint | null;
|
|
2509
2523
|
md5Encrypted: string | null;
|
|
2524
|
+
mime: string | null;
|
|
2525
|
+
ext: string | null;
|
|
2510
2526
|
maybeParts: {
|
|
2511
2527
|
md5: string;
|
|
2512
2528
|
order: number;
|
|
@@ -2522,6 +2538,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2522
2538
|
md5: string;
|
|
2523
2539
|
sizeEncrypted: bigint | null;
|
|
2524
2540
|
md5Encrypted: string | null;
|
|
2541
|
+
mime: string | null;
|
|
2542
|
+
ext: string | null;
|
|
2525
2543
|
parts: {
|
|
2526
2544
|
md5: string;
|
|
2527
2545
|
order: number;
|
|
@@ -2537,6 +2555,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2537
2555
|
md5: string;
|
|
2538
2556
|
sizeEncrypted: bigint | null;
|
|
2539
2557
|
md5Encrypted: string | null;
|
|
2558
|
+
mime: string | null;
|
|
2559
|
+
ext: string | null;
|
|
2540
2560
|
content: Buffer;
|
|
2541
2561
|
publicKey: string;
|
|
2542
2562
|
};
|
|
@@ -2549,6 +2569,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2549
2569
|
md5: string;
|
|
2550
2570
|
sizeEncrypted: bigint | null;
|
|
2551
2571
|
md5Encrypted: string | null;
|
|
2572
|
+
mime: string | null;
|
|
2573
|
+
ext: string | null;
|
|
2552
2574
|
senderPublicKey: string;
|
|
2553
2575
|
maybeParts: {
|
|
2554
2576
|
md5: string;
|
|
@@ -2565,6 +2587,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2565
2587
|
md5: string;
|
|
2566
2588
|
sizeEncrypted: bigint | null;
|
|
2567
2589
|
md5Encrypted: string | null;
|
|
2590
|
+
mime: string | null;
|
|
2591
|
+
ext: string | null;
|
|
2568
2592
|
maybeParts: {
|
|
2569
2593
|
md5: string;
|
|
2570
2594
|
order: number;
|
|
@@ -2580,6 +2604,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2580
2604
|
md5: string;
|
|
2581
2605
|
sizeEncrypted: bigint | null;
|
|
2582
2606
|
md5Encrypted: string | null;
|
|
2607
|
+
mime: string | null;
|
|
2608
|
+
ext: string | null;
|
|
2583
2609
|
parts: {
|
|
2584
2610
|
md5: string;
|
|
2585
2611
|
order: number;
|
|
@@ -2595,6 +2621,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2595
2621
|
md5: string;
|
|
2596
2622
|
sizeEncrypted: bigint | null;
|
|
2597
2623
|
md5Encrypted: string | null;
|
|
2624
|
+
mime: string | null;
|
|
2625
|
+
ext: string | null;
|
|
2598
2626
|
content: Buffer;
|
|
2599
2627
|
publicKey: string;
|
|
2600
2628
|
};
|
|
@@ -2639,6 +2667,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2639
2667
|
md5: string;
|
|
2640
2668
|
sizeEncrypted: bigint | null;
|
|
2641
2669
|
md5Encrypted: string | null;
|
|
2670
|
+
mime: string | null;
|
|
2671
|
+
ext: string | null;
|
|
2642
2672
|
senderPublicKey: string;
|
|
2643
2673
|
maybeParts: {
|
|
2644
2674
|
md5: string;
|
|
@@ -2655,6 +2685,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2655
2685
|
md5: string;
|
|
2656
2686
|
sizeEncrypted: bigint | null;
|
|
2657
2687
|
md5Encrypted: string | null;
|
|
2688
|
+
mime: string | null;
|
|
2689
|
+
ext: string | null;
|
|
2658
2690
|
maybeParts: {
|
|
2659
2691
|
md5: string;
|
|
2660
2692
|
order: number;
|
|
@@ -2670,6 +2702,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2670
2702
|
md5: string;
|
|
2671
2703
|
sizeEncrypted: bigint | null;
|
|
2672
2704
|
md5Encrypted: string | null;
|
|
2705
|
+
mime: string | null;
|
|
2706
|
+
ext: string | null;
|
|
2673
2707
|
parts: {
|
|
2674
2708
|
md5: string;
|
|
2675
2709
|
order: number;
|
|
@@ -2685,6 +2719,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2685
2719
|
md5: string;
|
|
2686
2720
|
sizeEncrypted: bigint | null;
|
|
2687
2721
|
md5Encrypted: string | null;
|
|
2722
|
+
mime: string | null;
|
|
2723
|
+
ext: string | null;
|
|
2688
2724
|
content: Buffer;
|
|
2689
2725
|
publicKey: string;
|
|
2690
2726
|
})[];
|
|
@@ -2697,6 +2733,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2697
2733
|
md5: string;
|
|
2698
2734
|
sizeEncrypted: bigint | null;
|
|
2699
2735
|
md5Encrypted: string | null;
|
|
2736
|
+
mime: string | null;
|
|
2737
|
+
ext: string | null;
|
|
2700
2738
|
senderPublicKey: string;
|
|
2701
2739
|
maybeParts: {
|
|
2702
2740
|
md5: string;
|
|
@@ -2713,6 +2751,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2713
2751
|
md5: string;
|
|
2714
2752
|
sizeEncrypted: bigint | null;
|
|
2715
2753
|
md5Encrypted: string | null;
|
|
2754
|
+
mime: string | null;
|
|
2755
|
+
ext: string | null;
|
|
2716
2756
|
maybeParts: {
|
|
2717
2757
|
md5: string;
|
|
2718
2758
|
order: number;
|
|
@@ -2728,6 +2768,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2728
2768
|
md5: string;
|
|
2729
2769
|
sizeEncrypted: bigint | null;
|
|
2730
2770
|
md5Encrypted: string | null;
|
|
2771
|
+
mime: string | null;
|
|
2772
|
+
ext: string | null;
|
|
2731
2773
|
parts: {
|
|
2732
2774
|
md5: string;
|
|
2733
2775
|
order: number;
|
|
@@ -2743,6 +2785,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2743
2785
|
md5: string;
|
|
2744
2786
|
sizeEncrypted: bigint | null;
|
|
2745
2787
|
md5Encrypted: string | null;
|
|
2788
|
+
mime: string | null;
|
|
2789
|
+
ext: string | null;
|
|
2746
2790
|
content: Buffer;
|
|
2747
2791
|
publicKey: string;
|
|
2748
2792
|
})[];
|
|
@@ -2911,6 +2955,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2911
2955
|
userAppAppId: string;
|
|
2912
2956
|
sizeEncrypted: bigint | null;
|
|
2913
2957
|
md5Encrypted: string | null;
|
|
2958
|
+
mime: string | null;
|
|
2959
|
+
ext: string | null;
|
|
2914
2960
|
validatedAt: Date | null;
|
|
2915
2961
|
restoreSince: Date | null;
|
|
2916
2962
|
access: {
|
|
@@ -2928,6 +2974,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
2928
2974
|
userAppAppId: string;
|
|
2929
2975
|
sizeEncrypted: bigint | null;
|
|
2930
2976
|
md5Encrypted: string | null;
|
|
2977
|
+
mime: string | null;
|
|
2978
|
+
ext: string | null;
|
|
2931
2979
|
validatedAt: Date | null;
|
|
2932
2980
|
restoreSince: Date | null;
|
|
2933
2981
|
access: {
|
|
@@ -3058,6 +3106,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
3058
3106
|
userAppAppId: string;
|
|
3059
3107
|
sizeEncrypted: bigint | null;
|
|
3060
3108
|
md5Encrypted: string | null;
|
|
3109
|
+
mime: string | null;
|
|
3110
|
+
ext: string | null;
|
|
3061
3111
|
validatedAt: Date | null;
|
|
3062
3112
|
restoreSince: Date | null;
|
|
3063
3113
|
access: {
|
|
@@ -3075,6 +3125,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
3075
3125
|
userAppAppId: string;
|
|
3076
3126
|
sizeEncrypted: bigint | null;
|
|
3077
3127
|
md5Encrypted: string | null;
|
|
3128
|
+
mime: string | null;
|
|
3129
|
+
ext: string | null;
|
|
3078
3130
|
validatedAt: Date | null;
|
|
3079
3131
|
restoreSince: Date | null;
|
|
3080
3132
|
access: {
|
|
@@ -3445,10 +3497,14 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
3445
3497
|
md5: string;
|
|
3446
3498
|
sizeEncrypted: bigint;
|
|
3447
3499
|
md5Encrypted: string;
|
|
3500
|
+
mime?: string | undefined;
|
|
3501
|
+
ext?: string | undefined;
|
|
3448
3502
|
} | {
|
|
3449
3503
|
type: "unencrypted";
|
|
3450
3504
|
size: bigint;
|
|
3451
3505
|
md5: string;
|
|
3506
|
+
mime?: string | undefined;
|
|
3507
|
+
ext?: string | undefined;
|
|
3452
3508
|
};
|
|
3453
3509
|
_input_out: {
|
|
3454
3510
|
type: "encrypted";
|
|
@@ -3457,10 +3513,14 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
3457
3513
|
md5: string;
|
|
3458
3514
|
sizeEncrypted: bigint;
|
|
3459
3515
|
md5Encrypted: string;
|
|
3516
|
+
mime?: string | undefined;
|
|
3517
|
+
ext?: string | undefined;
|
|
3460
3518
|
} | {
|
|
3461
3519
|
type: "unencrypted";
|
|
3462
3520
|
size: bigint;
|
|
3463
3521
|
md5: string;
|
|
3522
|
+
mime?: string | undefined;
|
|
3523
|
+
ext?: string | undefined;
|
|
3464
3524
|
};
|
|
3465
3525
|
_output_in: {
|
|
3466
3526
|
id: string;
|
|
@@ -3523,10 +3583,14 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
3523
3583
|
md5: string;
|
|
3524
3584
|
sizeEncrypted: bigint;
|
|
3525
3585
|
md5Encrypted: string;
|
|
3586
|
+
mime?: string | undefined;
|
|
3587
|
+
ext?: string | undefined;
|
|
3526
3588
|
} | {
|
|
3527
3589
|
type: "unencrypted";
|
|
3528
3590
|
size: bigint;
|
|
3529
3591
|
md5: string;
|
|
3592
|
+
mime?: string | undefined;
|
|
3593
|
+
ext?: string | undefined;
|
|
3530
3594
|
};
|
|
3531
3595
|
_input_out: {
|
|
3532
3596
|
type: "encrypted";
|
|
@@ -3535,10 +3599,14 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
3535
3599
|
md5: string;
|
|
3536
3600
|
sizeEncrypted: bigint;
|
|
3537
3601
|
md5Encrypted: string;
|
|
3602
|
+
mime?: string | undefined;
|
|
3603
|
+
ext?: string | undefined;
|
|
3538
3604
|
} | {
|
|
3539
3605
|
type: "unencrypted";
|
|
3540
3606
|
size: bigint;
|
|
3541
3607
|
md5: string;
|
|
3608
|
+
mime?: string | undefined;
|
|
3609
|
+
ext?: string | undefined;
|
|
3542
3610
|
};
|
|
3543
3611
|
_output_in: {
|
|
3544
3612
|
id: string;
|
|
@@ -3602,11 +3670,15 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
3602
3670
|
sizeEncrypted: bigint;
|
|
3603
3671
|
md5Encrypted: string;
|
|
3604
3672
|
content: Buffer;
|
|
3673
|
+
mime?: string | undefined;
|
|
3674
|
+
ext?: string | undefined;
|
|
3605
3675
|
} | {
|
|
3606
3676
|
type: "unencrypted";
|
|
3607
3677
|
size: bigint;
|
|
3608
3678
|
md5: string;
|
|
3609
3679
|
content: Buffer;
|
|
3680
|
+
mime?: string | undefined;
|
|
3681
|
+
ext?: string | undefined;
|
|
3610
3682
|
};
|
|
3611
3683
|
_input_out: {
|
|
3612
3684
|
type: "encrypted";
|
|
@@ -3616,11 +3688,15 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
3616
3688
|
sizeEncrypted: bigint;
|
|
3617
3689
|
md5Encrypted: string;
|
|
3618
3690
|
content: Buffer;
|
|
3691
|
+
mime?: string | undefined;
|
|
3692
|
+
ext?: string | undefined;
|
|
3619
3693
|
} | {
|
|
3620
3694
|
type: "unencrypted";
|
|
3621
3695
|
size: bigint;
|
|
3622
3696
|
md5: string;
|
|
3623
3697
|
content: Buffer;
|
|
3698
|
+
mime?: string | undefined;
|
|
3699
|
+
ext?: string | undefined;
|
|
3624
3700
|
};
|
|
3625
3701
|
_output_in: {
|
|
3626
3702
|
id: string;
|
|
@@ -4005,6 +4081,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
4005
4081
|
userAppAppId: string;
|
|
4006
4082
|
sizeEncrypted: bigint | null;
|
|
4007
4083
|
md5Encrypted: string | null;
|
|
4084
|
+
mime: string | null;
|
|
4085
|
+
ext: string | null;
|
|
4008
4086
|
validatedAt: Date | null;
|
|
4009
4087
|
restoreSince: Date | null;
|
|
4010
4088
|
access: {
|
|
@@ -4022,6 +4100,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
4022
4100
|
userAppAppId: string;
|
|
4023
4101
|
sizeEncrypted: bigint | null;
|
|
4024
4102
|
md5Encrypted: string | null;
|
|
4103
|
+
mime: string | null;
|
|
4104
|
+
ext: string | null;
|
|
4025
4105
|
validatedAt: Date | null;
|
|
4026
4106
|
restoreSince: Date | null;
|
|
4027
4107
|
access: {
|
|
@@ -4152,6 +4232,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
4152
4232
|
userAppAppId: string;
|
|
4153
4233
|
sizeEncrypted: bigint | null;
|
|
4154
4234
|
md5Encrypted: string | null;
|
|
4235
|
+
mime: string | null;
|
|
4236
|
+
ext: string | null;
|
|
4155
4237
|
validatedAt: Date | null;
|
|
4156
4238
|
restoreSince: Date | null;
|
|
4157
4239
|
access: {
|
|
@@ -4169,6 +4251,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
4169
4251
|
userAppAppId: string;
|
|
4170
4252
|
sizeEncrypted: bigint | null;
|
|
4171
4253
|
md5Encrypted: string | null;
|
|
4254
|
+
mime: string | null;
|
|
4255
|
+
ext: string | null;
|
|
4172
4256
|
validatedAt: Date | null;
|
|
4173
4257
|
restoreSince: Date | null;
|
|
4174
4258
|
access: {
|
|
@@ -4817,6 +4901,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
4817
4901
|
userAppAppId: string;
|
|
4818
4902
|
sizeEncrypted: bigint | null;
|
|
4819
4903
|
md5Encrypted: string | null;
|
|
4904
|
+
mime: string | null;
|
|
4905
|
+
ext: string | null;
|
|
4820
4906
|
validatedAt: Date | null;
|
|
4821
4907
|
restoreSince: Date | null;
|
|
4822
4908
|
access: {
|
|
@@ -4834,6 +4920,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
4834
4920
|
userAppAppId: string;
|
|
4835
4921
|
sizeEncrypted: bigint | null;
|
|
4836
4922
|
md5Encrypted: string | null;
|
|
4923
|
+
mime: string | null;
|
|
4924
|
+
ext: string | null;
|
|
4837
4925
|
validatedAt: Date | null;
|
|
4838
4926
|
restoreSince: Date | null;
|
|
4839
4927
|
access: {
|
|
@@ -4964,6 +5052,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
4964
5052
|
userAppAppId: string;
|
|
4965
5053
|
sizeEncrypted: bigint | null;
|
|
4966
5054
|
md5Encrypted: string | null;
|
|
5055
|
+
mime: string | null;
|
|
5056
|
+
ext: string | null;
|
|
4967
5057
|
validatedAt: Date | null;
|
|
4968
5058
|
restoreSince: Date | null;
|
|
4969
5059
|
access: {
|
|
@@ -4981,6 +5071,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
4981
5071
|
userAppAppId: string;
|
|
4982
5072
|
sizeEncrypted: bigint | null;
|
|
4983
5073
|
md5Encrypted: string | null;
|
|
5074
|
+
mime: string | null;
|
|
5075
|
+
ext: string | null;
|
|
4984
5076
|
validatedAt: Date | null;
|
|
4985
5077
|
restoreSince: Date | null;
|
|
4986
5078
|
access: {
|
|
@@ -5603,6 +5695,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
5603
5695
|
userAppAppId: string;
|
|
5604
5696
|
sizeEncrypted: bigint | null;
|
|
5605
5697
|
md5Encrypted: string | null;
|
|
5698
|
+
mime: string | null;
|
|
5699
|
+
ext: string | null;
|
|
5606
5700
|
validatedAt: Date | null;
|
|
5607
5701
|
restoreSince: Date | null;
|
|
5608
5702
|
access: {
|
|
@@ -5620,6 +5714,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
5620
5714
|
userAppAppId: string;
|
|
5621
5715
|
sizeEncrypted: bigint | null;
|
|
5622
5716
|
md5Encrypted: string | null;
|
|
5717
|
+
mime: string | null;
|
|
5718
|
+
ext: string | null;
|
|
5623
5719
|
validatedAt: Date | null;
|
|
5624
5720
|
restoreSince: Date | null;
|
|
5625
5721
|
access: {
|
|
@@ -5750,6 +5846,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
5750
5846
|
userAppAppId: string;
|
|
5751
5847
|
sizeEncrypted: bigint | null;
|
|
5752
5848
|
md5Encrypted: string | null;
|
|
5849
|
+
mime: string | null;
|
|
5850
|
+
ext: string | null;
|
|
5753
5851
|
validatedAt: Date | null;
|
|
5754
5852
|
restoreSince: Date | null;
|
|
5755
5853
|
access: {
|
|
@@ -5767,6 +5865,8 @@ export declare const createTRPCClient: (session?: string | null | undefined, onA
|
|
|
5767
5865
|
userAppAppId: string;
|
|
5768
5866
|
sizeEncrypted: bigint | null;
|
|
5769
5867
|
md5Encrypted: string | null;
|
|
5868
|
+
mime: string | null;
|
|
5869
|
+
ext: string | null;
|
|
5770
5870
|
validatedAt: Date | null;
|
|
5771
5871
|
restoreSince: Date | null;
|
|
5772
5872
|
access: {
|
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.
|
|
5
|
+
"version": "1.53.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/anonymize-org/lib.git"
|
|
@@ -74,13 +74,14 @@
|
|
|
74
74
|
"typescript": "^5.6.2"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@secrecy/trpc-api-types": "1.33.0-feat-
|
|
77
|
+
"@secrecy/trpc-api-types": "1.33.0-feat-mime-types.3",
|
|
78
78
|
"@trpc/client": "10.45.2",
|
|
79
79
|
"@trpc/server": "10.45.2",
|
|
80
80
|
"@types/libsodium-wrappers-sumo": "^0.7.8",
|
|
81
81
|
"axios": "^1.7.7",
|
|
82
82
|
"bson": "^6.8.0",
|
|
83
83
|
"ethers": "^6.13.2",
|
|
84
|
+
"file-type": "^19.6.0",
|
|
84
85
|
"jsonwebtoken": "^9.0.2",
|
|
85
86
|
"ky": "^1.7.2",
|
|
86
87
|
"libsodium-wrappers-sumo": "^0.7.15",
|