@storacha/encrypt-upload-client 1.1.58 → 1.1.60
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.
- package/dist/config/constants.d.ts +3 -3
- package/dist/config/constants.js +3 -4
- package/dist/config/env.d.ts +6 -9
- package/dist/config/service.d.ts +13 -13
- package/dist/core/client.d.ts +41 -54
- package/dist/core/client.js +56 -68
- package/dist/core/errors.d.ts +6 -6
- package/dist/core/metadata/encrypted-metadata.d.ts +8 -13
- package/dist/core/metadata/kms-metadata.d.ts +36 -68
- package/dist/core/metadata/lit-metadata.d.ts +28 -63
- package/dist/crypto/adapters/kms-crypto-adapter.d.ts +137 -172
- package/dist/crypto/adapters/lit-crypto-adapter.d.ts +86 -107
- package/dist/crypto/factories.browser.d.ts +5 -9
- package/dist/crypto/factories.browser.js +7 -15
- package/dist/crypto/factories.node.d.ts +6 -13
- package/dist/crypto/factories.node.js +13 -19
- package/dist/crypto/index.d.ts +5 -5
- package/dist/crypto/index.js +5 -5
- package/dist/crypto/symmetric/generic-aes-ctr-streaming-crypto.d.ts +54 -58
- package/dist/crypto/symmetric/generic-aes-ctr-streaming-crypto.js +146 -174
- package/dist/crypto/symmetric/node-aes-cbc-crypto.d.ts +32 -36
- package/dist/crypto/symmetric/node-aes-cbc-crypto.js +95 -101
- package/dist/examples/decrypt-test.d.ts +2 -2
- package/dist/examples/decrypt-test.js +69 -78
- package/dist/examples/encrypt-test.d.ts +3 -5
- package/dist/examples/encrypt-test.js +55 -58
- package/dist/handlers/decrypt-handler.d.ts +5 -19
- package/dist/handlers/encrypt-handler.d.ts +3 -9
- package/dist/handlers/encrypt-handler.js +57 -93
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/protocols/lit.d.ts +9 -33
- package/dist/protocols/lit.js +98 -134
- package/dist/test/cid-verification.spec.d.ts +2 -2
- package/dist/test/cid-verification.spec.js +313 -341
- package/dist/test/crypto-compatibility.spec.d.ts +2 -2
- package/dist/test/crypto-compatibility.spec.js +120 -184
- package/dist/test/crypto-counter-security.spec.d.ts +2 -2
- package/dist/test/crypto-counter-security.spec.js +138 -177
- package/dist/test/crypto-streaming.spec.d.ts +2 -2
- package/dist/test/crypto-streaming.spec.js +126 -208
- package/dist/test/encrypted-metadata.spec.d.ts +2 -2
- package/dist/test/encrypted-metadata.spec.js +62 -89
- package/dist/test/factories.spec.d.ts +2 -2
- package/dist/test/factories.spec.js +139 -275
- package/dist/test/file-metadata.spec.d.ts +2 -2
- package/dist/test/file-metadata.spec.js +416 -472
- package/dist/test/fixtures/test-fixtures.d.ts +20 -25
- package/dist/test/fixtures/test-fixtures.js +53 -61
- package/dist/test/helpers/test-file-utils.d.ts +14 -19
- package/dist/test/helpers/test-file-utils.js +76 -78
- package/dist/test/https-enforcement.spec.d.ts +2 -2
- package/dist/test/https-enforcement.spec.js +124 -278
- package/dist/test/kms-crypto-adapter.spec.d.ts +2 -2
- package/dist/test/kms-crypto-adapter.spec.js +304 -473
- package/dist/test/lit-crypto-adapter.spec.d.ts +2 -2
- package/dist/test/lit-crypto-adapter.spec.js +118 -206
- package/dist/test/memory-efficiency.spec.d.ts +2 -2
- package/dist/test/memory-efficiency.spec.js +87 -100
- package/dist/test/mocks/key-manager.d.ts +38 -71
- package/dist/test/mocks/key-manager.js +113 -129
- package/dist/test/node-crypto-adapter.spec.d.ts +2 -2
- package/dist/test/node-crypto-adapter.spec.js +102 -155
- package/dist/test/node-generic-crypto-adapter.spec.d.ts +2 -2
- package/dist/test/node-generic-crypto-adapter.spec.js +94 -134
- package/dist/test/setup.d.ts +2 -2
- package/dist/test/setup.js +9 -8
- package/dist/tsconfig.spec.tsbuildinfo +1 -1
- package/dist/types.d.ts +181 -219
- package/dist/utils/file-metadata.d.ts +13 -19
- package/dist/utils.d.ts +5 -14
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -1,271 +1,233 @@
|
|
|
1
|
-
import { Wallet } from 'ethers'
|
|
2
|
-
import { UnknownLink } from 'multiformats'
|
|
3
|
-
import { Client as StorachaClient } from '@storacha/client'
|
|
4
|
-
import { Result, Failure, Block, Proof } from '@ucanto/interface'
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Signer,
|
|
15
|
-
DID,
|
|
16
|
-
SigAlg,
|
|
17
|
-
UploadOptions,
|
|
18
|
-
} from '@storacha/client/types'
|
|
19
|
-
export type { IPLDBlock } from '@ucanto/interface'
|
|
20
|
-
export type { SpaceDID } from '@storacha/capabilities/types'
|
|
21
|
-
export type { UnknownFormat } from '@storacha/capabilities/types'
|
|
22
|
-
export type { Result, UnknownLink }
|
|
23
|
-
export type { BlobLike, AnyLink }
|
|
24
|
-
export type { UploadOptions } from '@storacha/client/types'
|
|
25
|
-
import type { SpaceDID } from '@storacha/capabilities/types'
|
|
1
|
+
import { Wallet } from 'ethers';
|
|
2
|
+
import { UnknownLink } from 'multiformats';
|
|
3
|
+
import { Client as StorachaClient } from '@storacha/client';
|
|
4
|
+
import { Result, Failure, Block, Proof } from '@ucanto/interface';
|
|
5
|
+
import { AccessControlConditions, AuthMethod, AuthSig, SessionSigsMap } from '@lit-protocol/types';
|
|
6
|
+
import type { BlobLike, AnyLink, Signer, DID, SigAlg, UploadOptions } from '@storacha/client/types';
|
|
7
|
+
export type { IPLDBlock } from '@ucanto/interface';
|
|
8
|
+
export type { SpaceDID } from '@storacha/capabilities/types';
|
|
9
|
+
export type { UnknownFormat } from '@storacha/capabilities/types';
|
|
10
|
+
export type { Result, UnknownLink };
|
|
11
|
+
export type { BlobLike, AnyLink };
|
|
12
|
+
export type { UploadOptions } from '@storacha/client/types';
|
|
13
|
+
import type { SpaceDID } from '@storacha/capabilities/types';
|
|
26
14
|
export interface FileMetadata {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
15
|
+
name: string;
|
|
16
|
+
type: string;
|
|
17
|
+
extension: string;
|
|
18
|
+
metadata?: Record<string, unknown>;
|
|
31
19
|
}
|
|
32
20
|
export interface DecryptionResult {
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
stream: ReadableStream;
|
|
22
|
+
fileMetadata?: FileMetadata;
|
|
35
23
|
}
|
|
36
24
|
export interface EncryptedClient {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
config: EncryptionConfig,
|
|
40
|
-
uploadOptions?: UploadOptions
|
|
41
|
-
): Promise<AnyLink>
|
|
42
|
-
retrieveAndDecryptFile(
|
|
43
|
-
cid: AnyLink,
|
|
44
|
-
decryptionConfig: DecryptionConfig
|
|
45
|
-
): Promise<DecryptionResult>
|
|
25
|
+
encryptAndUploadFile(file: BlobLike, config: EncryptionConfig, uploadOptions?: UploadOptions): Promise<AnyLink>;
|
|
26
|
+
retrieveAndDecryptFile(cid: AnyLink, decryptionConfig: DecryptionConfig): Promise<DecryptionResult>;
|
|
46
27
|
}
|
|
47
28
|
export type EncryptedClientOptions = {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
29
|
+
storachaClient: StorachaClient;
|
|
30
|
+
cryptoAdapter: CryptoAdapter;
|
|
31
|
+
gatewayURL?: URL;
|
|
32
|
+
};
|
|
52
33
|
export interface EncryptOutput {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
34
|
+
key: Uint8Array;
|
|
35
|
+
iv: Uint8Array;
|
|
36
|
+
encryptedStream: ReadableStream;
|
|
56
37
|
}
|
|
57
38
|
export interface SymmetricCrypto {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
splitKeyAndIV(combined: Uint8Array): {
|
|
66
|
-
key: Uint8Array
|
|
67
|
-
iv: Uint8Array
|
|
68
|
-
}
|
|
39
|
+
encryptStream(data: BlobLike): Promise<EncryptOutput>;
|
|
40
|
+
decryptStream(encryptedData: ReadableStream, key: Uint8Array, iv: Uint8Array): Promise<ReadableStream>;
|
|
41
|
+
combineKeyAndIV(key: Uint8Array, iv: Uint8Array): Uint8Array;
|
|
42
|
+
splitKeyAndIV(combined: Uint8Array): {
|
|
43
|
+
key: Uint8Array;
|
|
44
|
+
iv: Uint8Array;
|
|
45
|
+
};
|
|
69
46
|
}
|
|
70
47
|
export interface CryptoAdapter {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
): Promise<{
|
|
92
|
-
key: Uint8Array
|
|
93
|
-
iv: Uint8Array
|
|
94
|
-
}>
|
|
95
|
-
extractEncryptedMetadata(car: Uint8Array): ExtractedMetadata
|
|
96
|
-
getEncryptedKey(metadata: ExtractedMetadata): string
|
|
97
|
-
encodeMetadata(
|
|
98
|
-
encryptedDataCID: string,
|
|
99
|
-
encryptedKey: string,
|
|
100
|
-
metadata: LitKeyMetadata | KMSKeyMetadata
|
|
101
|
-
): Promise<{
|
|
102
|
-
cid: AnyLink
|
|
103
|
-
bytes: Uint8Array
|
|
104
|
-
}>
|
|
48
|
+
encryptStream(data: BlobLike): Promise<EncryptOutput>;
|
|
49
|
+
decryptStream(encryptedData: ReadableStream, key: Uint8Array, iv: Uint8Array): Promise<ReadableStream>;
|
|
50
|
+
encryptSymmetricKey(key: Uint8Array, iv: Uint8Array, encryptionConfig: EncryptionConfig): Promise<EncryptedKeyResult>;
|
|
51
|
+
decryptSymmetricKey(encryptedKey: string, configs: {
|
|
52
|
+
decryptionConfig: DecryptionConfig;
|
|
53
|
+
metadata: ExtractedMetadata;
|
|
54
|
+
resourceCID: AnyLink;
|
|
55
|
+
issuer: Signer<DID, SigAlg>;
|
|
56
|
+
audience: DID;
|
|
57
|
+
}): Promise<{
|
|
58
|
+
key: Uint8Array;
|
|
59
|
+
iv: Uint8Array;
|
|
60
|
+
}>;
|
|
61
|
+
extractEncryptedMetadata(car: Uint8Array): ExtractedMetadata;
|
|
62
|
+
getEncryptedKey(metadata: ExtractedMetadata): string;
|
|
63
|
+
encodeMetadata(encryptedDataCID: string, encryptedKey: string, metadata: LitKeyMetadata | KMSKeyMetadata): Promise<{
|
|
64
|
+
cid: AnyLink;
|
|
65
|
+
bytes: Uint8Array;
|
|
66
|
+
}>;
|
|
105
67
|
}
|
|
106
68
|
export interface EncryptionConfig {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
69
|
+
/**
|
|
70
|
+
* The issuer of the encryption request
|
|
71
|
+
*/
|
|
72
|
+
issuer: Signer<DID, SigAlg>;
|
|
73
|
+
/**
|
|
74
|
+
* The DID of the space to encrypt the file for
|
|
75
|
+
*/
|
|
76
|
+
spaceDID: SpaceDID;
|
|
77
|
+
/**
|
|
78
|
+
* Proofs to access the space
|
|
79
|
+
*/
|
|
80
|
+
proofs?: Proof[];
|
|
81
|
+
/**
|
|
82
|
+
* The location of the KMS key to use for encryption
|
|
83
|
+
*/
|
|
84
|
+
location?: string;
|
|
85
|
+
/**
|
|
86
|
+
* The keyring of the KMS key to use for encryption
|
|
87
|
+
*/
|
|
88
|
+
keyring?: string;
|
|
89
|
+
/**
|
|
90
|
+
* File metadata to embed in encrypted file
|
|
91
|
+
*/
|
|
92
|
+
fileMetadata?: FileMetadata;
|
|
131
93
|
}
|
|
132
94
|
export interface DecryptionConfig {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
95
|
+
decryptDelegation: Proof;
|
|
96
|
+
spaceDID: SpaceDID;
|
|
97
|
+
/**
|
|
98
|
+
* Proofs to access the space
|
|
99
|
+
*/
|
|
100
|
+
proofs?: Proof[];
|
|
101
|
+
wallet?: Wallet;
|
|
102
|
+
sessionSigs?: SessionSigsMap;
|
|
103
|
+
pkpPublicKey?: string;
|
|
104
|
+
authMethod?: AuthMethod;
|
|
143
105
|
}
|
|
144
106
|
export interface EncryptedKeyResult {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
107
|
+
strategy: EncryptionStrategy;
|
|
108
|
+
encryptedKey: string;
|
|
109
|
+
metadata: LitKeyMetadata | KMSKeyMetadata;
|
|
148
110
|
}
|
|
149
|
-
export type EncryptionStrategy = 'lit' | 'kms'
|
|
111
|
+
export type EncryptionStrategy = 'lit' | 'kms';
|
|
150
112
|
export interface LitKeyMetadata {
|
|
151
|
-
|
|
152
|
-
|
|
113
|
+
plaintextKeyHash: string;
|
|
114
|
+
accessControlConditions: AccessControlConditions;
|
|
153
115
|
}
|
|
154
116
|
export interface KMSKeyMetadata {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
117
|
+
space: SpaceDID;
|
|
118
|
+
kms: {
|
|
119
|
+
provider: string;
|
|
120
|
+
keyId: string;
|
|
121
|
+
algorithm: string;
|
|
122
|
+
};
|
|
161
123
|
}
|
|
162
124
|
export type EncryptionPayload = {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
export type GenericAccessControlCondition = [Record<string, any>]
|
|
125
|
+
strategy: EncryptionStrategy;
|
|
126
|
+
encryptedKey: string;
|
|
127
|
+
metadata: LitKeyMetadata | KMSKeyMetadata;
|
|
128
|
+
encryptedBlobLike: BlobLike;
|
|
129
|
+
};
|
|
130
|
+
export type GenericAccessControlCondition = [Record<string, any>];
|
|
169
131
|
export interface LitMetadataInput {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
132
|
+
encryptedDataCID: string;
|
|
133
|
+
identityBoundCiphertext: string;
|
|
134
|
+
plaintextKeyHash: string;
|
|
135
|
+
accessControlConditions: AccessControlConditions;
|
|
174
136
|
}
|
|
175
137
|
export interface LitMetadata {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
138
|
+
encryptedDataCID: UnknownLink;
|
|
139
|
+
identityBoundCiphertext: Uint8Array;
|
|
140
|
+
plaintextKeyHash: Uint8Array;
|
|
141
|
+
accessControlConditions: AccessControlConditions;
|
|
180
142
|
}
|
|
181
143
|
export interface LitMetadataView extends LitMetadata {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
144
|
+
/** Encode it to a CAR file. */
|
|
145
|
+
archiveBlock(): Promise<Block>;
|
|
146
|
+
toJSON(): LitMetadataInput;
|
|
185
147
|
}
|
|
186
148
|
export interface KMSMetadata {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
149
|
+
encryptedDataCID: UnknownLink;
|
|
150
|
+
encryptedSymmetricKey: string;
|
|
151
|
+
space: SpaceDID;
|
|
152
|
+
kms: {
|
|
153
|
+
provider: string;
|
|
154
|
+
keyId: string;
|
|
155
|
+
algorithm: string;
|
|
156
|
+
};
|
|
195
157
|
}
|
|
196
158
|
export interface KMSMetadataInput {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
159
|
+
encryptedDataCID: string;
|
|
160
|
+
encryptedSymmetricKey: string;
|
|
161
|
+
space: string;
|
|
162
|
+
kms: {
|
|
163
|
+
provider: string;
|
|
164
|
+
keyId: string;
|
|
165
|
+
algorithm: string;
|
|
166
|
+
};
|
|
205
167
|
}
|
|
206
168
|
export interface KMSMetadataView extends KMSMetadata {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
169
|
+
/** Encode it to a CAR file. */
|
|
170
|
+
archiveBlock(): Promise<Block>;
|
|
171
|
+
toJSON(): KMSMetadataInput;
|
|
210
172
|
}
|
|
211
173
|
export interface DecodeFailure extends Failure {
|
|
212
|
-
|
|
174
|
+
name: 'DecodeFailure';
|
|
213
175
|
}
|
|
214
176
|
export interface SessionSignatureOptions {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
177
|
+
wallet: Wallet;
|
|
178
|
+
accessControlConditions: AccessControlConditions;
|
|
179
|
+
dataToEncryptHash: string;
|
|
180
|
+
expiration?: string;
|
|
181
|
+
capabilityAuthSigs?: AuthSig[];
|
|
220
182
|
}
|
|
221
183
|
export interface PkpSessionSignatureOptions {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
184
|
+
pkpPublicKey: string;
|
|
185
|
+
authMethod: AuthMethod;
|
|
186
|
+
accessControlConditions: AccessControlConditions;
|
|
187
|
+
dataToEncryptHash: string;
|
|
188
|
+
expiration?: string;
|
|
189
|
+
capabilityAuthSigs?: AuthSig[];
|
|
228
190
|
}
|
|
229
191
|
export interface LitPkpSigner {
|
|
230
|
-
|
|
231
|
-
|
|
192
|
+
pkpPublicKey: string;
|
|
193
|
+
authMethod: AuthMethod;
|
|
232
194
|
}
|
|
233
195
|
export interface LitWalletSigner {
|
|
234
|
-
|
|
196
|
+
wallet: Wallet;
|
|
235
197
|
}
|
|
236
198
|
export interface CreateDecryptWrappedInvocationOptions {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
199
|
+
decryptDelegation: Proof;
|
|
200
|
+
issuer: Signer<DID, SigAlg>;
|
|
201
|
+
audience: `did:${string}:${string}`;
|
|
202
|
+
spaceDID: `did:key:${string}`;
|
|
203
|
+
resourceCID: AnyLink;
|
|
204
|
+
expiration: number;
|
|
243
205
|
}
|
|
244
206
|
export interface ExecuteUcanValidationOptions {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
export type ExtractedMetadata = LitExtractedMetadata | KMSExtractedMetadata
|
|
207
|
+
sessionSigs: SessionSigsMap;
|
|
208
|
+
spaceDID: `did:key:${string}`;
|
|
209
|
+
identityBoundCiphertext: string;
|
|
210
|
+
plaintextKeyHash: string;
|
|
211
|
+
accessControlConditions: AccessControlConditions;
|
|
212
|
+
wrappedInvocationJSON: string;
|
|
213
|
+
}
|
|
214
|
+
export type ExtractedMetadata = LitExtractedMetadata | KMSExtractedMetadata;
|
|
253
215
|
export interface LitExtractedMetadata {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
216
|
+
strategy: 'lit';
|
|
217
|
+
encryptedDataCID: string;
|
|
218
|
+
identityBoundCiphertext: string;
|
|
219
|
+
plaintextKeyHash: string;
|
|
220
|
+
accessControlConditions: AccessControlConditions;
|
|
259
221
|
}
|
|
260
222
|
export interface KMSExtractedMetadata {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
//# sourceMappingURL=types.d.ts.map
|
|
223
|
+
strategy: 'kms';
|
|
224
|
+
encryptedDataCID: string;
|
|
225
|
+
encryptedSymmetricKey: string;
|
|
226
|
+
space: SpaceDID;
|
|
227
|
+
kms: {
|
|
228
|
+
provider: string;
|
|
229
|
+
keyId: string;
|
|
230
|
+
algorithm: string;
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
export const FileMetadataSchema: Schema.StructSchema<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
unknown
|
|
9
|
-
>
|
|
10
|
-
export function createFileWithMetadata(
|
|
11
|
-
file: Type.BlobLike,
|
|
12
|
-
metadata?: Type.FileMetadata
|
|
13
|
-
): Blob
|
|
1
|
+
export const FileMetadataSchema: Schema.StructSchema<{
|
|
2
|
+
name: Schema.StringSchema<string, unknown>;
|
|
3
|
+
type: Schema.StringSchema<string, unknown>;
|
|
4
|
+
extension: Schema.StringSchema<string, unknown>;
|
|
5
|
+
metadata: Schema.Schema<unknown, any>;
|
|
6
|
+
}, unknown>;
|
|
7
|
+
export function createFileWithMetadata(file: Type.BlobLike, metadata?: Type.FileMetadata): Blob;
|
|
14
8
|
export function extractFileMetadata(decryptedStream: ReadableStream): Promise<{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
import { Schema } from '@ucanto/core'
|
|
19
|
-
import * as Type from '../types.js'
|
|
20
|
-
//# sourceMappingURL=file-metadata.d.ts.map
|
|
9
|
+
fileStream: ReadableStream;
|
|
10
|
+
fileMetadata?: Type.FileMetadata;
|
|
11
|
+
}>;
|
|
12
|
+
import { Schema } from '@ucanto/core';
|
|
13
|
+
import * as Type from '../types.js';
|
|
14
|
+
//# sourceMappingURL=file-metadata.d.ts.map
|
package/dist/utils.d.ts
CHANGED
|
@@ -3,22 +3,13 @@
|
|
|
3
3
|
* @param {string} str
|
|
4
4
|
* @returns {Uint8Array}
|
|
5
5
|
*/
|
|
6
|
-
export function stringToBytes(str: string): Uint8Array
|
|
6
|
+
export function stringToBytes(str: string): Uint8Array;
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
9
9
|
* @param {Uint8Array} bytes
|
|
10
10
|
* @returns {string}
|
|
11
11
|
*/
|
|
12
|
-
export function bytesToString(bytes: Uint8Array): string
|
|
13
|
-
export function createDecryptWrappedInvocation({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
spaceDID,
|
|
17
|
-
resourceCID,
|
|
18
|
-
audience,
|
|
19
|
-
expiration,
|
|
20
|
-
}: Type.CreateDecryptWrappedInvocationOptions): Promise<
|
|
21
|
-
import('@ucanto/server').ToString<Uint8Array<ArrayBufferLike>, string>
|
|
22
|
-
>
|
|
23
|
-
import * as Type from './types.js'
|
|
24
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
12
|
+
export function bytesToString(bytes: Uint8Array): string;
|
|
13
|
+
export function createDecryptWrappedInvocation({ decryptDelegation, issuer, spaceDID, resourceCID, audience, expiration, }: Type.CreateDecryptWrappedInvocationOptions): Promise<import("@ucanto/server").ToString<Uint8Array<ArrayBufferLike>, string>>;
|
|
14
|
+
import * as Type from './types.js';
|
|
15
|
+
//# sourceMappingURL=utils.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storacha/encrypt-upload-client",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.60",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"description": "Client for upload and download encrypted files",
|
|
7
7
|
"author": "Storacha",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"ethers": "5.7.1",
|
|
81
81
|
"ipfs-unixfs-exporter": "^10.0.0",
|
|
82
82
|
"multiformats": "^13.3.6",
|
|
83
|
-
"@storacha/client": "^1.8.15",
|
|
84
83
|
"@storacha/upload-client": "^1.3.6",
|
|
84
|
+
"@storacha/client": "^1.8.17",
|
|
85
85
|
"@storacha/capabilities": "^1.12.0"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|