@secrecy/lib 1.68.0-feat-anonymous-upload.1 → 1.68.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.
@@ -1,14 +1,14 @@
1
1
  export interface EncryptedFile {
2
- data: Uint8Array;
2
+ data: Uint8Array<ArrayBuffer>;
3
3
  md5: string;
4
4
  md5Encrypted: string;
5
5
  }
6
6
  export declare function secretStreamKeygen(): Uint8Array;
7
7
  export declare const CHUNK_SIZE = 8192;
8
- export interface Progress {
8
+ export interface SecretStreamProgress {
9
9
  percent: number;
10
10
  total: number;
11
11
  current: number;
12
12
  }
13
- export declare function encryptSecretStream(key: Uint8Array, data: Uint8Array, progress?: (progress: Progress) => Promise<void>, abort?: AbortController): Promise<EncryptedFile>;
14
- export declare function decryptSecretStream(key: Uint8Array, data: Uint8Array, progress?: (progress: Progress) => Promise<void>, abort?: AbortController): Promise<Uint8Array>;
13
+ export declare function encryptSecretStream(key: Uint8Array, data: Uint8Array<ArrayBuffer>, progress?: (progress: SecretStreamProgress) => Promise<void>, abort?: AbortController): Promise<EncryptedFile>;
14
+ export declare function decryptSecretStream(key: Uint8Array, data: Uint8Array<ArrayBuffer>, progress?: (progress: SecretStreamProgress) => Promise<void>, abort?: AbortController): Promise<Uint8Array<ArrayBuffer>>;
@@ -1,18 +1,14 @@
1
1
  import { z } from 'zod';
2
- export declare const clientErrorCodeKey: z.ZodEnum<["NOT_FOUND"]>;
2
+ export declare const clientErrorCodeKey: z.ZodEnum<{
3
+ NOT_FOUND: "NOT_FOUND";
4
+ }>;
3
5
  export type CLIENT_ERROR_CODE_KEY = z.infer<typeof clientErrorCodeKey>;
4
6
  export declare const clientError: z.ZodObject<{
5
7
  name: z.ZodLiteral<"ClientError">;
6
- code: z.ZodEnum<["NOT_FOUND"]>;
8
+ code: z.ZodEnum<{
9
+ NOT_FOUND: "NOT_FOUND";
10
+ }>;
7
11
  message: z.ZodString;
8
- }, "strip", z.ZodTypeAny, {
9
- name: "ClientError";
10
- message: string;
11
- code: "NOT_FOUND";
12
- }, {
13
- name: "ClientError";
14
- message: string;
15
- code: "NOT_FOUND";
16
- }>;
12
+ }, z.core.$strip>;
17
13
  export type ClientError = z.infer<typeof clientError>;
18
14
  export declare const isClientError: (input: unknown) => input is ClientError;
@@ -1,31 +1,31 @@
1
1
  import { z } from 'zod';
2
- export declare const secrecyError: z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
2
+ export declare const secrecyError: z.ZodDiscriminatedUnion<[z.ZodObject<{
3
3
  name: z.ZodLiteral<"TRPCError">;
4
- code: z.ZodEnum<["PARSE_ERROR", "BAD_REQUEST", "INTERNAL_SERVER_ERROR", "NOT_IMPLEMENTED", "UNAUTHORIZED", "FORBIDDEN", "NOT_FOUND", "METHOD_NOT_SUPPORTED", "TIMEOUT", "CONFLICT", "PRECONDITION_FAILED", "PAYLOAD_TOO_LARGE", "UNPROCESSABLE_CONTENT", "TOO_MANY_REQUESTS", "CLIENT_CLOSED_REQUEST"]>;
4
+ code: z.ZodEnum<{
5
+ UNAUTHORIZED: "UNAUTHORIZED";
6
+ NOT_FOUND: "NOT_FOUND";
7
+ PARSE_ERROR: "PARSE_ERROR";
8
+ BAD_REQUEST: "BAD_REQUEST";
9
+ INTERNAL_SERVER_ERROR: "INTERNAL_SERVER_ERROR";
10
+ NOT_IMPLEMENTED: "NOT_IMPLEMENTED";
11
+ FORBIDDEN: "FORBIDDEN";
12
+ METHOD_NOT_SUPPORTED: "METHOD_NOT_SUPPORTED";
13
+ TIMEOUT: "TIMEOUT";
14
+ CONFLICT: "CONFLICT";
15
+ PRECONDITION_FAILED: "PRECONDITION_FAILED";
16
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
17
+ UNPROCESSABLE_CONTENT: "UNPROCESSABLE_CONTENT";
18
+ TOO_MANY_REQUESTS: "TOO_MANY_REQUESTS";
19
+ CLIENT_CLOSED_REQUEST: "CLIENT_CLOSED_REQUEST";
20
+ }>;
5
21
  message: z.ZodString;
6
22
  data: z.ZodOptional<z.ZodUnknown>;
7
- }, "strip", z.ZodTypeAny, {
8
- name: "TRPCError";
9
- message: string;
10
- code: "UNAUTHORIZED" | "NOT_FOUND" | "PARSE_ERROR" | "BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "FORBIDDEN" | "METHOD_NOT_SUPPORTED" | "TIMEOUT" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNPROCESSABLE_CONTENT" | "TOO_MANY_REQUESTS" | "CLIENT_CLOSED_REQUEST";
11
- data?: unknown;
12
- }, {
13
- name: "TRPCError";
14
- message: string;
15
- code: "UNAUTHORIZED" | "NOT_FOUND" | "PARSE_ERROR" | "BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "FORBIDDEN" | "METHOD_NOT_SUPPORTED" | "TIMEOUT" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNPROCESSABLE_CONTENT" | "TOO_MANY_REQUESTS" | "CLIENT_CLOSED_REQUEST";
16
- data?: unknown;
17
- }>, z.ZodObject<{
23
+ }, z.core.$strip>, z.ZodObject<{
18
24
  name: z.ZodLiteral<"ClientError">;
19
- code: z.ZodEnum<["NOT_FOUND"]>;
25
+ code: z.ZodEnum<{
26
+ NOT_FOUND: "NOT_FOUND";
27
+ }>;
20
28
  message: z.ZodString;
21
- }, "strip", z.ZodTypeAny, {
22
- name: "ClientError";
23
- message: string;
24
- code: "NOT_FOUND";
25
- }, {
26
- name: "ClientError";
27
- message: string;
28
- code: "NOT_FOUND";
29
- }>]>;
29
+ }, z.core.$strip>], "name">;
30
30
  export type SecrecyError = z.infer<typeof secrecyError>;
31
31
  export declare const isSecrecyError: (input: unknown) => input is SecrecyError;
@@ -1,21 +1,43 @@
1
1
  import { z } from 'zod';
2
- export declare const trpcErrorCodeKey: z.ZodEnum<["PARSE_ERROR", "BAD_REQUEST", "INTERNAL_SERVER_ERROR", "NOT_IMPLEMENTED", "UNAUTHORIZED", "FORBIDDEN", "NOT_FOUND", "METHOD_NOT_SUPPORTED", "TIMEOUT", "CONFLICT", "PRECONDITION_FAILED", "PAYLOAD_TOO_LARGE", "UNPROCESSABLE_CONTENT", "TOO_MANY_REQUESTS", "CLIENT_CLOSED_REQUEST"]>;
2
+ export declare const trpcErrorCodeKey: z.ZodEnum<{
3
+ UNAUTHORIZED: "UNAUTHORIZED";
4
+ NOT_FOUND: "NOT_FOUND";
5
+ PARSE_ERROR: "PARSE_ERROR";
6
+ BAD_REQUEST: "BAD_REQUEST";
7
+ INTERNAL_SERVER_ERROR: "INTERNAL_SERVER_ERROR";
8
+ NOT_IMPLEMENTED: "NOT_IMPLEMENTED";
9
+ FORBIDDEN: "FORBIDDEN";
10
+ METHOD_NOT_SUPPORTED: "METHOD_NOT_SUPPORTED";
11
+ TIMEOUT: "TIMEOUT";
12
+ CONFLICT: "CONFLICT";
13
+ PRECONDITION_FAILED: "PRECONDITION_FAILED";
14
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
15
+ UNPROCESSABLE_CONTENT: "UNPROCESSABLE_CONTENT";
16
+ TOO_MANY_REQUESTS: "TOO_MANY_REQUESTS";
17
+ CLIENT_CLOSED_REQUEST: "CLIENT_CLOSED_REQUEST";
18
+ }>;
3
19
  export type TRPC_ERROR_CODE_KEY = z.infer<typeof trpcErrorCodeKey>;
4
20
  export declare const serverError: z.ZodObject<{
5
21
  name: z.ZodLiteral<"TRPCError">;
6
- code: z.ZodEnum<["PARSE_ERROR", "BAD_REQUEST", "INTERNAL_SERVER_ERROR", "NOT_IMPLEMENTED", "UNAUTHORIZED", "FORBIDDEN", "NOT_FOUND", "METHOD_NOT_SUPPORTED", "TIMEOUT", "CONFLICT", "PRECONDITION_FAILED", "PAYLOAD_TOO_LARGE", "UNPROCESSABLE_CONTENT", "TOO_MANY_REQUESTS", "CLIENT_CLOSED_REQUEST"]>;
22
+ code: z.ZodEnum<{
23
+ UNAUTHORIZED: "UNAUTHORIZED";
24
+ NOT_FOUND: "NOT_FOUND";
25
+ PARSE_ERROR: "PARSE_ERROR";
26
+ BAD_REQUEST: "BAD_REQUEST";
27
+ INTERNAL_SERVER_ERROR: "INTERNAL_SERVER_ERROR";
28
+ NOT_IMPLEMENTED: "NOT_IMPLEMENTED";
29
+ FORBIDDEN: "FORBIDDEN";
30
+ METHOD_NOT_SUPPORTED: "METHOD_NOT_SUPPORTED";
31
+ TIMEOUT: "TIMEOUT";
32
+ CONFLICT: "CONFLICT";
33
+ PRECONDITION_FAILED: "PRECONDITION_FAILED";
34
+ PAYLOAD_TOO_LARGE: "PAYLOAD_TOO_LARGE";
35
+ UNPROCESSABLE_CONTENT: "UNPROCESSABLE_CONTENT";
36
+ TOO_MANY_REQUESTS: "TOO_MANY_REQUESTS";
37
+ CLIENT_CLOSED_REQUEST: "CLIENT_CLOSED_REQUEST";
38
+ }>;
7
39
  message: z.ZodString;
8
40
  data: z.ZodOptional<z.ZodUnknown>;
9
- }, "strip", z.ZodTypeAny, {
10
- name: "TRPCError";
11
- message: string;
12
- code: "UNAUTHORIZED" | "NOT_FOUND" | "PARSE_ERROR" | "BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "FORBIDDEN" | "METHOD_NOT_SUPPORTED" | "TIMEOUT" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNPROCESSABLE_CONTENT" | "TOO_MANY_REQUESTS" | "CLIENT_CLOSED_REQUEST";
13
- data?: unknown;
14
- }, {
15
- name: "TRPCError";
16
- message: string;
17
- code: "UNAUTHORIZED" | "NOT_FOUND" | "PARSE_ERROR" | "BAD_REQUEST" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "FORBIDDEN" | "METHOD_NOT_SUPPORTED" | "TIMEOUT" | "CONFLICT" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNPROCESSABLE_CONTENT" | "TOO_MANY_REQUESTS" | "CLIENT_CLOSED_REQUEST";
18
- data?: unknown;
19
- }>;
41
+ }, z.core.$strip>;
20
42
  export type ServerError = z.infer<typeof serverError>;
21
43
  export declare const isServerError: (input: unknown) => input is ServerError;
@@ -1,11 +1,11 @@
1
1
  export * from './client/index.js';
2
2
  export * from './crypto/index.js';
3
- export type { Progress } from './crypto/data.js';
3
+ export type { SecretStreamProgress } from './crypto/data.js';
4
4
  export { BaseClient } from './base-client.js';
5
5
  export type { Node, NodeFull, DataMetadata, SecrecyUserApp, BaseMail, ReceivedMail, SentMail, PublicUser, SelfUser, NodeSize, MailData, MailIntegrity, DraftMail, Mail, WaitingReceivedMail, KeyPair, } from './client/types/index.js';
6
6
  export * from './client/helpers.js';
7
7
  export * from './sodium.js';
8
8
  export * from './utils/store-buddy.js';
9
- export type { UserAppNotifications, UserAppSettings, InfuraNetwork, UserData, DownloadProgress, } from './types.js';
9
+ export type { UserAppNotifications, UserAppSettings, InfuraNetwork, UserData, Progress, } from './types.js';
10
10
  export * from './error/index.js';
11
11
  export type { Rights } from './client/types/node.js';
@@ -1,2 +1,2 @@
1
- export declare function compress(data: Uint8Array): Uint8Array;
2
- export declare function decompress(data: Uint8Array): Uint8Array;
1
+ export declare function compress(data: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
2
+ export declare function decompress(data: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer>;
@@ -0,0 +1,2 @@
1
+ import superjson from 'superjson';
2
+ export declare const transformer: typeof superjson;
@@ -1,9 +1,8 @@
1
- import type { DownloadProgress as DLProgress } from 'ky';
1
+ export type { Progress } from 'ky';
2
2
  import { type RouterOutputs, type RouterInputs } from './client.js';
3
3
  export type InfuraNetwork = NonNullable<RouterInputs['crypto']['isTransactionDone']['network']>;
4
4
  export type UserAppNotifications = RouterOutputs['application']['notification'];
5
5
  export type UserAppSettings = RouterOutputs['application']['settings'];
6
- export type DownloadProgress = DLProgress;
7
6
  export type UserData<T extends Record<string, unknown> = Record<string, unknown>> = {
8
7
  isSuperuser: boolean;
9
8
  isSearchable: boolean;
@@ -1,3 +1,3 @@
1
- export declare function concatenate(...arrays: Uint8Array[]): Uint8Array;
1
+ export declare function concatenate<T extends ArrayBufferLike>(...arrays: Uint8Array<T>[]): Uint8Array<T>;
2
2
  export declare function enumerate<T>(iterable: Iterable<T>): IterableIterator<[number, T]>;
3
- export declare function chunks(arr: Uint8Array, n: number): Generator<Uint8Array, void, unknown>;
3
+ export declare function chunks(arr: Uint8Array<ArrayBuffer>, n: number): Generator<Uint8Array<ArrayBuffer>, void, unknown>;
@@ -1,3 +1,3 @@
1
- import { type EncryptedFile, type Progress } from '../crypto/data.js';
2
- export declare const encrypt: (key: Uint8Array, dataToEncrypt: Uint8Array, progress?: (progress: Progress) => Promise<void>, signal?: AbortSignal) => Promise<EncryptedFile>;
3
- export declare const decrypt: (key: Uint8Array, dataToDecrypt: Uint8Array, progress?: (progress: Progress) => Promise<void>, signal?: AbortSignal) => Promise<Uint8Array>;
1
+ import { type EncryptedFile, type SecretStreamProgress } from '../crypto/data.js';
2
+ export declare const encrypt: (key: Uint8Array, dataToEncrypt: Uint8Array<ArrayBuffer>, progress?: (progress: SecretStreamProgress) => Promise<void>, signal?: AbortSignal) => Promise<EncryptedFile>;
3
+ export declare const decrypt: (key: Uint8Array, dataToDecrypt: Uint8Array<ArrayBuffer>, progress?: (progress: SecretStreamProgress) => Promise<void>, signal?: AbortSignal) => Promise<Uint8Array<ArrayBuffer>>;
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.68.0-feat-anonymous-upload.1",
5
+ "version": "1.68.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/anonymize-org/lib.git"
@@ -39,55 +39,56 @@
39
39
  "clean": "rimraf dist",
40
40
  "lint": "eslint . --cache --cache-location 'node_modules/.cache/.eslintcache'",
41
41
  "lint:fix": "eslint . --fix --cache --cache-location 'node_modules/.cache/.eslintcache'",
42
- "format": "prettier \"**/*.{ts,tsx,md,mdx,json}\" --check --cache --cache-location='node_modules/.cache/.prettiercache'",
43
- "format:fix": "prettier \"**/*.{ts,tsx,md,mdx,json}\" --check --write --cache --cache-location='node_modules/.cache/.prettiercache'",
42
+ "format": "prettier \"**/*.{ts,tsx,md,mdx,json}\" --check --cache --cache-strategy content --cache-location='node_modules/.cache/.prettiercache'",
43
+ "format:fix": "prettier \"**/*.{ts,tsx,md,mdx,json}\" --check --write --cache --cache-strategy content --cache-location='node_modules/.cache/.prettiercache'",
44
44
  "docs": "typedoc",
45
45
  "prepublish": "bun run build",
46
- "typecheck": "tsc --noEmit",
46
+ "check-types": "tsc --noEmit",
47
47
  "build": "tsc -p tsconfig.build.json",
48
48
  "prepare": "husky",
49
49
  "semantic-release": "semantic-release"
50
50
  },
51
51
  "devDependencies": {
52
- "@commitlint/cli": "^19.6.0",
53
- "@commitlint/config-conventional": "^19.6.0",
54
- "@prisma/client": "5.22.0",
55
- "@types/bun": "^1.1.14",
56
- "@types/jsonwebtoken": "^9.0.7",
52
+ "@commitlint/cli": "^19.8.1",
53
+ "@commitlint/config-conventional": "^19.8.1",
54
+ "@prisma/client": "6.15.0",
55
+ "@types/bun": "^1.2.21",
56
+ "@types/jsonwebtoken": "^9.0.10",
57
57
  "@types/spark-md5": "^3.0.5",
58
- "@typescript-eslint/eslint-plugin": "^8.16.0",
59
- "@typescript-eslint/parser": "^8.16.0",
60
- "eslint": "^9.15.0",
61
- "eslint-config-love": "^107.0.0",
62
- "eslint-config-prettier": "^9.1.0",
63
- "eslint-plugin-import": "^2.31.0",
64
- "eslint-plugin-n": "^17.14.0",
58
+ "@typescript-eslint/eslint-plugin": "^8.43.0",
59
+ "@typescript-eslint/parser": "^8.43.0",
60
+ "eslint": "^9.35.0",
61
+ "eslint-config-love": "^125.0.0",
62
+ "eslint-config-prettier": "^10.1.8",
63
+ "eslint-plugin-import": "^2.32.0",
64
+ "eslint-plugin-n": "^17.21.3",
65
65
  "eslint-plugin-promise": "^7.2.1",
66
66
  "husky": "^9.1.7",
67
67
  "npm-run-all": "^4.1.5",
68
- "prettier": "^3.4.1",
68
+ "prettier": "^3.6.2",
69
69
  "rimraf": "^6.0.1",
70
- "semantic-release": "^24.2.0",
71
- "typedoc": "^0.27.0",
72
- "typedoc-plugin-markdown": "^4.2.10",
73
- "typedoc-plugin-missing-exports": "^3.1.0",
74
- "typescript": "^5.7.2"
70
+ "semantic-release": "^24.2.8",
71
+ "typedoc": "^0.28.12",
72
+ "typedoc-plugin-markdown": "^4.8.1",
73
+ "typedoc-plugin-missing-exports": "^4.1.0",
74
+ "typescript": "^5.9.2"
75
75
  },
76
76
  "dependencies": {
77
- "@secrecy/trpc-api-types": "1.33.0-feat-unlog-upload.4",
78
- "@trpc/client": "10.45.2",
79
- "@trpc/server": "10.45.2",
77
+ "@js-temporal/polyfill": "^0.5.1",
78
+ "@secrecy/trpc-api-types": "1.33.0-feat-next15.14",
79
+ "@trpc/client": "11.5.1",
80
+ "@trpc/server": "11.5.1",
80
81
  "@types/libsodium-wrappers-sumo": "^0.7.8",
81
- "axios": "^1.7.8",
82
- "bson": "^6.10.0",
83
- "ethers": "^6.13.4",
84
- "file-type": "^19.6.0",
82
+ "axios": "^1.11.0",
83
+ "bson": "^6.10.4",
84
+ "ethers": "^6.15.0",
85
+ "file-type": "^21.0.0",
85
86
  "jsonwebtoken": "^9.0.2",
86
- "ky": "^1.7.2",
87
+ "ky": "^1.10.0",
87
88
  "libsodium-wrappers-sumo": "^0.7.15",
88
- "lru-cache": "^11.0.2",
89
+ "lru-cache": "^11.2.1",
89
90
  "spark-md5": "^3.0.2",
90
- "superjson": "2.2.1",
91
- "zod": "3.23.8"
91
+ "superjson": "2.2.2",
92
+ "zod": "4.1.7"
92
93
  }
93
94
  }