@secrecy/lib 1.62.0-feat-storage-providers.4 → 1.62.0-feat-node-sharing.2

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,7 +1,5 @@
1
- import type { Node, ApiNode, InternalNode, ApiNodeFull, InternalNodeFull, NodeFull, KeyPair, ApiNodeParent } from '../types/index.js';
2
- export declare function apiNodeToInternal(apiNode: ApiNode | ApiNodeParent | ApiNodeFull, keyPair: KeyPair): Promise<InternalNode | InternalNodeFull>;
1
+ import type { Node, ApiNode, ApiNodeFull, InternalNodeFull, NodeFull, KeyPair, ApiNodeParent } from '../types/index.js';
3
2
  export declare function apiNodeFullToInternalFull(apiNodeFull: ApiNodeFull, keyPair: KeyPair): Promise<InternalNodeFull>;
4
- export declare function internalNodeToNode(internal: InternalNode): Node;
5
3
  export declare function internalNodeFullToNodeFull(internal: InternalNodeFull): NodeFull;
6
4
  export declare function apiNodeToExternalNodeFull(apiNodeFull: ApiNodeFull, keyPair: KeyPair): Promise<NodeFull>;
7
5
  export declare function apiNodeToExternal(apiNode: ApiNode | ApiNodeParent, keyPair: KeyPair): Promise<Node>;
@@ -1,25 +1,10 @@
1
1
  import { type RouterOutputs } from '../../client.js';
2
2
  export type ApiData = NonNullable<RouterOutputs['cloud']['dataById']>;
3
- export type ApiExtendedData = NonNullable<RouterOutputs['cloud']['dataContentById']>;
4
- export type S3DataStorageInput = {
5
- protocol: 's3';
6
- provider: 'scaleway' | 'ovh';
7
- mode: 'standard' | 'glacier';
8
- region: string;
9
- };
10
- export type MongoStorageInput = {
11
- protocol: 'mongo';
12
- provider: 'secrecy';
13
- mode: 'standard';
14
- region: string;
15
- };
16
- export type DataStorageInput = S3DataStorageInput | MongoStorageInput;
17
- export type DataStorage = ApiData['storage'];
18
- export type DataStorageProtocol = ApiData['storage']['protocol'];
19
- export type DataStorageProvider = ApiData['storage']['provider'];
3
+ export type ApiExtendedData = NonNullable<RouterOutputs['cloud']['dataContentByIds'][number]>;
4
+ export type DataStorageType = ApiData['storageType'];
20
5
  export type LocalData = {
21
6
  id: string;
22
- storage: DataStorageInput;
7
+ storageType: DataStorageType;
23
8
  size: bigint;
24
9
  sizeEncrypted: bigint | null;
25
10
  data: Uint8Array;
@@ -43,10 +43,30 @@ export type NodeFull<T extends NodeBreadcrumbItem = NodeBreadcrumbItem, U extend
43
43
  current?: V;
44
44
  history: V[];
45
45
  };
46
+ export type InternalMinimalNodeForEncryption = {
47
+ id: string;
48
+ type: NodeType;
49
+ name: string;
50
+ access: {
51
+ nameKey: string;
52
+ };
53
+ history: {
54
+ id: string;
55
+ key: string;
56
+ }[];
57
+ };
46
58
  export type InternalNode = Node<InternalNodeBreadcrumbItem, NameKey>;
47
59
  export type InternalNodeFull = NodeFull<InternalNodeBreadcrumbItem, NameKey, InternalData>;
48
60
  export type ApiNode = RouterOutputs['cloud']['nodeById'];
49
61
  export type ApiNodeFull = RouterOutputs['cloud']['nodeFullById'];
50
62
  export type ApiNodeParent = NonNullable<RouterOutputs['cloud']['nodeFullById']['parent']>;
51
63
  export type NodeType = ApiNode['type'];
64
+ export type EncryptedNodeInfos = {
65
+ id: string;
66
+ nameKey: string | null;
67
+ data: {
68
+ id: string;
69
+ key: string | null;
70
+ }[];
71
+ };
52
72
  export {};