@storacha/encrypt-upload-client 1.1.58 → 1.1.59
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 +4 -4
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const STORACHA_LIT_ACTION_CID:
|
|
2
|
-
export const GATEWAY_URL: URL
|
|
3
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
1
|
+
export const STORACHA_LIT_ACTION_CID: "QmWSLN9m2Noj3kp8rx76yfQ9U7U1Mzjj3kGVpCr891Mjn1";
|
|
2
|
+
export const GATEWAY_URL: URL;
|
|
3
|
+
//# sourceMappingURL=constants.d.ts.map
|
package/dist/config/constants.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export const STORACHA_LIT_ACTION_CID =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//# sourceMappingURL=constants.js.map
|
|
1
|
+
export const STORACHA_LIT_ACTION_CID = 'QmWSLN9m2Noj3kp8rx76yfQ9U7U1Mzjj3kGVpCr891Mjn1';
|
|
2
|
+
export const GATEWAY_URL = new URL('https://w3s.link');
|
|
3
|
+
//# sourceMappingURL=constants.js.map
|
package/dist/config/env.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
export default env
|
|
1
|
+
export default env;
|
|
2
2
|
declare const env: Schema.InferStruct<{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}>
|
|
9
|
-
import { Schema } from '@ucanto/core'
|
|
10
|
-
//# sourceMappingURL=env.d.ts.map
|
|
3
|
+
LIT_NETWORK: Schema.DefaultSchema<"custom" | "datil" | "datil-dev" | "datil-test", unknown>;
|
|
4
|
+
LIT_DEBUG: Schema.DefaultSchema<boolean, unknown>;
|
|
5
|
+
}>;
|
|
6
|
+
import { Schema } from '@ucanto/core';
|
|
7
|
+
//# sourceMappingURL=env.d.ts.map
|
package/dist/config/service.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export const accessServiceURL: URL
|
|
2
|
-
export const accessServicePrincipal: client.PrincipalView<
|
|
3
|
-
export const accessServiceConnection: client.ConnectionView<any
|
|
4
|
-
export const uploadServiceURL: URL
|
|
5
|
-
export const uploadServicePrincipal: client.PrincipalView<
|
|
6
|
-
export const uploadServiceConnection: client.ConnectionView<any
|
|
7
|
-
export const filecoinServiceURL: URL
|
|
8
|
-
export const filecoinServicePrincipal: client.PrincipalView<
|
|
9
|
-
export const filecoinServiceConnection: client.ConnectionView<any
|
|
1
|
+
export const accessServiceURL: URL;
|
|
2
|
+
export const accessServicePrincipal: client.PrincipalView<"did:web:web3.storage">;
|
|
3
|
+
export const accessServiceConnection: client.ConnectionView<any>;
|
|
4
|
+
export const uploadServiceURL: URL;
|
|
5
|
+
export const uploadServicePrincipal: client.PrincipalView<"did:web:web3.storage">;
|
|
6
|
+
export const uploadServiceConnection: client.ConnectionView<any>;
|
|
7
|
+
export const filecoinServiceURL: URL;
|
|
8
|
+
export const filecoinServicePrincipal: client.PrincipalView<"did:web:web3.storage">;
|
|
9
|
+
export const filecoinServiceConnection: client.ConnectionView<any>;
|
|
10
10
|
/** @type {import('@storacha/client/types').ServiceConf} */
|
|
11
|
-
export const serviceConf: import(
|
|
12
|
-
export const receiptsEndpoint: URL
|
|
13
|
-
import * as client from '@ucanto/client'
|
|
14
|
-
//# sourceMappingURL=service.d.ts.map
|
|
11
|
+
export const serviceConf: import("@storacha/client/types").ServiceConf;
|
|
12
|
+
export const receiptsEndpoint: URL;
|
|
13
|
+
import * as client from '@ucanto/client';
|
|
14
|
+
//# sourceMappingURL=service.d.ts.map
|
package/dist/core/client.d.ts
CHANGED
|
@@ -1,57 +1,44 @@
|
|
|
1
1
|
/** @implements {Type.EncryptedClient} */
|
|
2
2
|
export class EncryptedClient implements Type.EncryptedClient {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Retrieve and decrypt a file from the Storacha network
|
|
43
|
-
*
|
|
44
|
-
* @param {Type.AnyLink} cid - The link to the file to retrieve
|
|
45
|
-
* @param {Type.DecryptionConfig} decryptionConfig - User-provided decryption config
|
|
46
|
-
* @returns {Promise<Type.DecryptionResult>} - The decrypted file with metadata
|
|
47
|
-
*/
|
|
48
|
-
retrieveAndDecryptFile(
|
|
49
|
-
cid: Type.AnyLink,
|
|
50
|
-
decryptionConfig: Type.DecryptionConfig
|
|
51
|
-
): Promise<Type.DecryptionResult>
|
|
3
|
+
/**
|
|
4
|
+
* @param {import('@storacha/client').Client} storachaClient
|
|
5
|
+
* @param {Type.CryptoAdapter} cryptoAdapter
|
|
6
|
+
* @param {URL} gatewayURL
|
|
7
|
+
*/
|
|
8
|
+
constructor(storachaClient: import("@storacha/client").Client, cryptoAdapter: Type.CryptoAdapter, gatewayURL: URL);
|
|
9
|
+
/**
|
|
10
|
+
* @type {Type.CryptoAdapter}
|
|
11
|
+
* @protected
|
|
12
|
+
*/
|
|
13
|
+
protected _cryptoAdapter: Type.CryptoAdapter;
|
|
14
|
+
/**
|
|
15
|
+
* @type {import('@storacha/client').Client}
|
|
16
|
+
* @protected
|
|
17
|
+
*/
|
|
18
|
+
protected _storachaClient: import("@storacha/client").Client;
|
|
19
|
+
/**
|
|
20
|
+
* @type {URL}
|
|
21
|
+
* @protected
|
|
22
|
+
*/
|
|
23
|
+
protected _gatewayURL: URL;
|
|
24
|
+
/**
|
|
25
|
+
* Encrypt and upload a file to the Storacha network
|
|
26
|
+
*
|
|
27
|
+
* @param {Type.BlobLike} file - The file to upload
|
|
28
|
+
* @param {Type.EncryptionConfig} encryptionConfig - User-provided encryption configuration
|
|
29
|
+
* @param {Type.UploadOptions} [uploadOptions] - User-provided upload options
|
|
30
|
+
* @returns {Promise<Type.AnyLink>} - The link to the uploaded file
|
|
31
|
+
*/
|
|
32
|
+
encryptAndUploadFile(file: Type.BlobLike, encryptionConfig: Type.EncryptionConfig, uploadOptions?: Type.UploadOptions): Promise<Type.AnyLink>;
|
|
33
|
+
/**
|
|
34
|
+
* Retrieve and decrypt a file from the Storacha network
|
|
35
|
+
*
|
|
36
|
+
* @param {Type.AnyLink} cid - The link to the file to retrieve
|
|
37
|
+
* @param {Type.DecryptionConfig} decryptionConfig - User-provided decryption config
|
|
38
|
+
* @returns {Promise<Type.DecryptionResult>} - The decrypted file with metadata
|
|
39
|
+
*/
|
|
40
|
+
retrieveAndDecryptFile(cid: Type.AnyLink, decryptionConfig: Type.DecryptionConfig): Promise<Type.DecryptionResult>;
|
|
52
41
|
}
|
|
53
|
-
export function create(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
import * as Type from '../types.js'
|
|
57
|
-
//# sourceMappingURL=client.d.ts.map
|
|
42
|
+
export function create(options: Type.EncryptedClientOptions): Promise<EncryptedClient>;
|
|
43
|
+
import * as Type from '../types.js';
|
|
44
|
+
//# sourceMappingURL=client.d.ts.map
|
package/dist/core/client.js
CHANGED
|
@@ -1,67 +1,55 @@
|
|
|
1
|
-
import * as Type from '../types.js'
|
|
2
|
-
import { GATEWAY_URL } from '../config/constants.js'
|
|
3
|
-
import { encryptAndUpload } from '../handlers/encrypt-handler.js'
|
|
4
|
-
import { retrieveAndDecrypt } from '../handlers/decrypt-handler.js'
|
|
1
|
+
import * as Type from '../types.js';
|
|
2
|
+
import { GATEWAY_URL } from '../config/constants.js';
|
|
3
|
+
import { encryptAndUpload } from '../handlers/encrypt-handler.js';
|
|
4
|
+
import { retrieveAndDecrypt } from '../handlers/decrypt-handler.js';
|
|
5
5
|
/** @implements {Type.EncryptedClient} */
|
|
6
6
|
export class EncryptedClient {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
* @param {Type.DecryptionConfig} decryptionConfig - User-provided decryption config
|
|
54
|
-
* @returns {Promise<Type.DecryptionResult>} - The decrypted file with metadata
|
|
55
|
-
*/
|
|
56
|
-
async retrieveAndDecryptFile(cid, decryptionConfig) {
|
|
57
|
-
return retrieveAndDecrypt(
|
|
58
|
-
this._storachaClient,
|
|
59
|
-
this._cryptoAdapter,
|
|
60
|
-
this._gatewayURL,
|
|
61
|
-
cid,
|
|
62
|
-
decryptionConfig
|
|
63
|
-
)
|
|
64
|
-
}
|
|
7
|
+
/**
|
|
8
|
+
* @type {Type.CryptoAdapter}
|
|
9
|
+
* @protected
|
|
10
|
+
*/
|
|
11
|
+
_cryptoAdapter;
|
|
12
|
+
/**
|
|
13
|
+
* @type {import('@storacha/client').Client}
|
|
14
|
+
* @protected
|
|
15
|
+
*/
|
|
16
|
+
_storachaClient;
|
|
17
|
+
/**
|
|
18
|
+
* @type {URL}
|
|
19
|
+
* @protected
|
|
20
|
+
*/
|
|
21
|
+
_gatewayURL;
|
|
22
|
+
/**
|
|
23
|
+
* @param {import('@storacha/client').Client} storachaClient
|
|
24
|
+
* @param {Type.CryptoAdapter} cryptoAdapter
|
|
25
|
+
* @param {URL} gatewayURL
|
|
26
|
+
*/
|
|
27
|
+
constructor(storachaClient, cryptoAdapter, gatewayURL) {
|
|
28
|
+
this._storachaClient = storachaClient;
|
|
29
|
+
this._cryptoAdapter = cryptoAdapter;
|
|
30
|
+
this._gatewayURL = gatewayURL;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Encrypt and upload a file to the Storacha network
|
|
34
|
+
*
|
|
35
|
+
* @param {Type.BlobLike} file - The file to upload
|
|
36
|
+
* @param {Type.EncryptionConfig} encryptionConfig - User-provided encryption configuration
|
|
37
|
+
* @param {Type.UploadOptions} [uploadOptions] - User-provided upload options
|
|
38
|
+
* @returns {Promise<Type.AnyLink>} - The link to the uploaded file
|
|
39
|
+
*/
|
|
40
|
+
async encryptAndUploadFile(file, encryptionConfig, uploadOptions = {}) {
|
|
41
|
+
return encryptAndUpload(this._storachaClient, this._cryptoAdapter, file, encryptionConfig, uploadOptions);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Retrieve and decrypt a file from the Storacha network
|
|
45
|
+
*
|
|
46
|
+
* @param {Type.AnyLink} cid - The link to the file to retrieve
|
|
47
|
+
* @param {Type.DecryptionConfig} decryptionConfig - User-provided decryption config
|
|
48
|
+
* @returns {Promise<Type.DecryptionResult>} - The decrypted file with metadata
|
|
49
|
+
*/
|
|
50
|
+
async retrieveAndDecryptFile(cid, decryptionConfig) {
|
|
51
|
+
return retrieveAndDecrypt(this._storachaClient, this._cryptoAdapter, this._gatewayURL, cid, decryptionConfig);
|
|
52
|
+
}
|
|
65
53
|
}
|
|
66
54
|
/**
|
|
67
55
|
* Creates a new EncryptedClient.
|
|
@@ -71,9 +59,9 @@ export class EncryptedClient {
|
|
|
71
59
|
* @param {Type.EncryptedClientOptions} options
|
|
72
60
|
*/
|
|
73
61
|
export const create = async (options) => {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=client.js.map
|
|
62
|
+
const cryptoAdapter = options.cryptoAdapter;
|
|
63
|
+
const gatewayURL = options.gatewayURL ?? GATEWAY_URL;
|
|
64
|
+
const storachaClient = options.storachaClient;
|
|
65
|
+
return new EncryptedClient(storachaClient, cryptoAdapter, gatewayURL);
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=client.js.map
|
package/dist/core/errors.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export class UnknownFormat extends Failure {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
/** @param {string} [reason] */
|
|
3
|
+
constructor(reason?: string);
|
|
4
|
+
name: "UnknownFormat";
|
|
5
|
+
#private;
|
|
6
6
|
}
|
|
7
|
-
import { Failure } from '@ucanto/core'
|
|
8
|
-
//# sourceMappingURL=errors.d.ts.map
|
|
7
|
+
import { Failure } from '@ucanto/core';
|
|
8
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
export function extract(archive: Uint8Array): any
|
|
2
|
-
export function create(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export function isVersionSupported(version: string): boolean
|
|
10
|
-
import * as LitMetadata from './lit-metadata.js'
|
|
11
|
-
import * as KMSMetadata from './kms-metadata.js'
|
|
12
|
-
export { LitMetadata, KMSMetadata }
|
|
13
|
-
//# sourceMappingURL=encrypted-metadata.d.ts.map
|
|
1
|
+
export function extract(archive: Uint8Array): any;
|
|
2
|
+
export function create(strategy: "lit" | "kms", data: any): import("../../types.js").LitMetadataView | import("../../types.js").KMSMetadataView;
|
|
3
|
+
export function getSupportedVersions(): string[];
|
|
4
|
+
export function isVersionSupported(version: string): boolean;
|
|
5
|
+
import * as LitMetadata from './lit-metadata.js';
|
|
6
|
+
import * as KMSMetadata from './kms-metadata.js';
|
|
7
|
+
export { LitMetadata, KMSMetadata };
|
|
8
|
+
//# sourceMappingURL=encrypted-metadata.d.ts.map
|
|
@@ -1,68 +1,36 @@
|
|
|
1
|
-
export const version:
|
|
2
|
-
export const KMSMetadataSchema: Schema.VariantSchema<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
any
|
|
38
|
-
>
|
|
39
|
-
},
|
|
40
|
-
unknown
|
|
41
|
-
>
|
|
42
|
-
export function create(
|
|
43
|
-
kmsMetadataInput: Types.KMSMetadata | Types.KMSMetadataInput
|
|
44
|
-
): Types.KMSMetadataView
|
|
45
|
-
export function toJSON(
|
|
46
|
-
kmsMetadata: Types.KMSMetadataView
|
|
47
|
-
): Types.KMSMetadataInput
|
|
48
|
-
export function parse(
|
|
49
|
-
kmsMetadataInput: Types.KMSMetadataInput
|
|
50
|
-
): Types.KMSMetadata
|
|
51
|
-
export function archiveBlock(
|
|
52
|
-
kmsMetadataInput: Types.KMSMetadata
|
|
53
|
-
): Promise<import('@ucanto/interface').Block>
|
|
54
|
-
export function archive(
|
|
55
|
-
kmsMetadata: Types.KMSMetadata
|
|
56
|
-
): Promise<Types.Result<Uint8Array>>
|
|
57
|
-
export function extract(
|
|
58
|
-
archive: Uint8Array
|
|
59
|
-
): Types.Result<Types.KMSMetadataView, Types.UnknownFormat>
|
|
60
|
-
export function view({
|
|
61
|
-
root,
|
|
62
|
-
}: {
|
|
63
|
-
root: Types.IPLDBlock
|
|
64
|
-
}): Types.Result<Types.KMSMetadataView, Types.UnknownFormat>
|
|
65
|
-
import * as Link from 'multiformats/link'
|
|
66
|
-
import { Schema } from '@ucanto/core'
|
|
67
|
-
import * as Types from '../../types.js'
|
|
68
|
-
//# sourceMappingURL=kms-metadata.d.ts.map
|
|
1
|
+
export const version: "encrypted-metadata@0.2";
|
|
2
|
+
export const KMSMetadataSchema: Schema.VariantSchema<{
|
|
3
|
+
"encrypted-metadata@0.2": Schema.StructSchema<{
|
|
4
|
+
encryptedDataCID: Schema.Schema<Link.Link<unknown, number, number, 0 | 1>, any>;
|
|
5
|
+
encryptedSymmetricKey: Schema.StringSchema<string, unknown>;
|
|
6
|
+
space: Schema.StringSchema<string, unknown>;
|
|
7
|
+
kms: Schema.StructSchema<{
|
|
8
|
+
provider: Schema.StringSchema<string, unknown>;
|
|
9
|
+
keyId: Schema.StringSchema<string, unknown>;
|
|
10
|
+
algorithm: Schema.StringSchema<string, unknown>;
|
|
11
|
+
}, any>;
|
|
12
|
+
}, unknown>;
|
|
13
|
+
}, unknown>;
|
|
14
|
+
export const KMSMetadataInputSchema: Schema.StructSchema<{
|
|
15
|
+
encryptedDataCID: Schema.StringSchema<string, unknown>;
|
|
16
|
+
encryptedSymmetricKey: Schema.StringSchema<string, unknown>;
|
|
17
|
+
space: Schema.StringSchema<string, unknown>;
|
|
18
|
+
kms: Schema.StructSchema<{
|
|
19
|
+
provider: Schema.StringSchema<string, unknown>;
|
|
20
|
+
keyId: Schema.StringSchema<string, unknown>;
|
|
21
|
+
algorithm: Schema.StringSchema<string, unknown>;
|
|
22
|
+
}, any>;
|
|
23
|
+
}, unknown>;
|
|
24
|
+
export function create(kmsMetadataInput: Types.KMSMetadata | Types.KMSMetadataInput): Types.KMSMetadataView;
|
|
25
|
+
export function toJSON(kmsMetadata: Types.KMSMetadataView): Types.KMSMetadataInput;
|
|
26
|
+
export function parse(kmsMetadataInput: Types.KMSMetadataInput): Types.KMSMetadata;
|
|
27
|
+
export function archiveBlock(kmsMetadataInput: Types.KMSMetadata): Promise<import("@ucanto/interface").Block>;
|
|
28
|
+
export function archive(kmsMetadata: Types.KMSMetadata): Promise<Types.Result<Uint8Array>>;
|
|
29
|
+
export function extract(archive: Uint8Array): Types.Result<Types.KMSMetadataView, Types.UnknownFormat>;
|
|
30
|
+
export function view({ root }: {
|
|
31
|
+
root: Types.IPLDBlock;
|
|
32
|
+
}): Types.Result<Types.KMSMetadataView, Types.UnknownFormat>;
|
|
33
|
+
import * as Link from 'multiformats/link';
|
|
34
|
+
import { Schema } from '@ucanto/core';
|
|
35
|
+
import * as Types from '../../types.js';
|
|
36
|
+
//# sourceMappingURL=kms-metadata.d.ts.map
|
|
@@ -1,63 +1,28 @@
|
|
|
1
|
-
export const version:
|
|
2
|
-
export const LitMetadataSchema: Schema.VariantSchema<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
plaintextKeyHash: Schema.StringSchema<string, unknown>
|
|
30
|
-
accessControlConditions: Schema.Schema<
|
|
31
|
-
Schema.Dictionary<string, unknown>[],
|
|
32
|
-
unknown
|
|
33
|
-
>
|
|
34
|
-
},
|
|
35
|
-
unknown
|
|
36
|
-
>
|
|
37
|
-
export function create(
|
|
38
|
-
encryptedMetadataInput: Types.LitMetadata | Types.LitMetadataInput
|
|
39
|
-
): Types.LitMetadataView
|
|
40
|
-
export function toJSON(
|
|
41
|
-
encryptedMetadata: Types.LitMetadataView
|
|
42
|
-
): Types.LitMetadataInput
|
|
43
|
-
export function parse(
|
|
44
|
-
encryptedMetadataInput: Types.LitMetadataInput
|
|
45
|
-
): Types.LitMetadata
|
|
46
|
-
export function archiveBlock(
|
|
47
|
-
encryptedMetadataInput: Types.LitMetadata
|
|
48
|
-
): Promise<import('@ucanto/interface').Block>
|
|
49
|
-
export function archive(
|
|
50
|
-
encryptedMetadata: Types.LitMetadata
|
|
51
|
-
): Promise<Types.Result<Uint8Array>>
|
|
52
|
-
export function extract(
|
|
53
|
-
archive: Uint8Array
|
|
54
|
-
): Types.Result<Types.LitMetadataView, Types.UnknownFormat>
|
|
55
|
-
export function view({
|
|
56
|
-
root,
|
|
57
|
-
}: {
|
|
58
|
-
root: Types.IPLDBlock
|
|
59
|
-
}): Types.Result<Types.LitMetadataView, Types.UnknownFormat>
|
|
60
|
-
import * as Link from 'multiformats/link'
|
|
61
|
-
import { Schema } from '@ucanto/core'
|
|
62
|
-
import * as Types from '../../types.js'
|
|
63
|
-
//# sourceMappingURL=lit-metadata.d.ts.map
|
|
1
|
+
export const version: "encrypted-metadata@0.1";
|
|
2
|
+
export const LitMetadataSchema: Schema.VariantSchema<{
|
|
3
|
+
"encrypted-metadata@0.1": Schema.StructSchema<{
|
|
4
|
+
encryptedDataCID: Schema.Schema<Link.Link<unknown, number, number, 0 | 1>, any>;
|
|
5
|
+
identityBoundCiphertext: Schema.Schema<Uint8Array<ArrayBufferLike>, unknown>;
|
|
6
|
+
plaintextKeyHash: Schema.Schema<Uint8Array<ArrayBufferLike>, unknown>;
|
|
7
|
+
accessControlConditions: Schema.Schema<Schema.Dictionary<string, unknown>[], unknown>;
|
|
8
|
+
}, unknown>;
|
|
9
|
+
}, unknown>;
|
|
10
|
+
export const LitMetadataInputSchema: Schema.StructSchema<{
|
|
11
|
+
encryptedDataCID: Schema.StringSchema<string, unknown>;
|
|
12
|
+
identityBoundCiphertext: Schema.StringSchema<string, unknown>;
|
|
13
|
+
plaintextKeyHash: Schema.StringSchema<string, unknown>;
|
|
14
|
+
accessControlConditions: Schema.Schema<Schema.Dictionary<string, unknown>[], unknown>;
|
|
15
|
+
}, unknown>;
|
|
16
|
+
export function create(encryptedMetadataInput: Types.LitMetadata | Types.LitMetadataInput): Types.LitMetadataView;
|
|
17
|
+
export function toJSON(encryptedMetadata: Types.LitMetadataView): Types.LitMetadataInput;
|
|
18
|
+
export function parse(encryptedMetadataInput: Types.LitMetadataInput): Types.LitMetadata;
|
|
19
|
+
export function archiveBlock(encryptedMetadataInput: Types.LitMetadata): Promise<import("@ucanto/interface").Block>;
|
|
20
|
+
export function archive(encryptedMetadata: Types.LitMetadata): Promise<Types.Result<Uint8Array>>;
|
|
21
|
+
export function extract(archive: Uint8Array): Types.Result<Types.LitMetadataView, Types.UnknownFormat>;
|
|
22
|
+
export function view({ root }: {
|
|
23
|
+
root: Types.IPLDBlock;
|
|
24
|
+
}): Types.Result<Types.LitMetadataView, Types.UnknownFormat>;
|
|
25
|
+
import * as Link from 'multiformats/link';
|
|
26
|
+
import { Schema } from '@ucanto/core';
|
|
27
|
+
import * as Types from '../../types.js';
|
|
28
|
+
//# sourceMappingURL=lit-metadata.d.ts.map
|