@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.
Files changed (72) hide show
  1. package/dist/config/constants.d.ts +3 -3
  2. package/dist/config/constants.js +3 -4
  3. package/dist/config/env.d.ts +6 -9
  4. package/dist/config/service.d.ts +13 -13
  5. package/dist/core/client.d.ts +41 -54
  6. package/dist/core/client.js +56 -68
  7. package/dist/core/errors.d.ts +6 -6
  8. package/dist/core/metadata/encrypted-metadata.d.ts +8 -13
  9. package/dist/core/metadata/kms-metadata.d.ts +36 -68
  10. package/dist/core/metadata/lit-metadata.d.ts +28 -63
  11. package/dist/crypto/adapters/kms-crypto-adapter.d.ts +137 -172
  12. package/dist/crypto/adapters/lit-crypto-adapter.d.ts +86 -107
  13. package/dist/crypto/factories.browser.d.ts +5 -9
  14. package/dist/crypto/factories.browser.js +7 -15
  15. package/dist/crypto/factories.node.d.ts +6 -13
  16. package/dist/crypto/factories.node.js +13 -19
  17. package/dist/crypto/index.d.ts +5 -5
  18. package/dist/crypto/index.js +5 -5
  19. package/dist/crypto/symmetric/generic-aes-ctr-streaming-crypto.d.ts +54 -58
  20. package/dist/crypto/symmetric/generic-aes-ctr-streaming-crypto.js +146 -174
  21. package/dist/crypto/symmetric/node-aes-cbc-crypto.d.ts +32 -36
  22. package/dist/crypto/symmetric/node-aes-cbc-crypto.js +95 -101
  23. package/dist/examples/decrypt-test.d.ts +2 -2
  24. package/dist/examples/decrypt-test.js +69 -78
  25. package/dist/examples/encrypt-test.d.ts +3 -5
  26. package/dist/examples/encrypt-test.js +55 -58
  27. package/dist/handlers/decrypt-handler.d.ts +5 -19
  28. package/dist/handlers/encrypt-handler.d.ts +3 -9
  29. package/dist/handlers/encrypt-handler.js +57 -93
  30. package/dist/index.d.ts +2 -2
  31. package/dist/index.js +2 -2
  32. package/dist/protocols/lit.d.ts +9 -33
  33. package/dist/protocols/lit.js +98 -134
  34. package/dist/test/cid-verification.spec.d.ts +2 -2
  35. package/dist/test/cid-verification.spec.js +313 -341
  36. package/dist/test/crypto-compatibility.spec.d.ts +2 -2
  37. package/dist/test/crypto-compatibility.spec.js +120 -184
  38. package/dist/test/crypto-counter-security.spec.d.ts +2 -2
  39. package/dist/test/crypto-counter-security.spec.js +138 -177
  40. package/dist/test/crypto-streaming.spec.d.ts +2 -2
  41. package/dist/test/crypto-streaming.spec.js +126 -208
  42. package/dist/test/encrypted-metadata.spec.d.ts +2 -2
  43. package/dist/test/encrypted-metadata.spec.js +62 -89
  44. package/dist/test/factories.spec.d.ts +2 -2
  45. package/dist/test/factories.spec.js +139 -275
  46. package/dist/test/file-metadata.spec.d.ts +2 -2
  47. package/dist/test/file-metadata.spec.js +416 -472
  48. package/dist/test/fixtures/test-fixtures.d.ts +20 -25
  49. package/dist/test/fixtures/test-fixtures.js +53 -61
  50. package/dist/test/helpers/test-file-utils.d.ts +14 -19
  51. package/dist/test/helpers/test-file-utils.js +76 -78
  52. package/dist/test/https-enforcement.spec.d.ts +2 -2
  53. package/dist/test/https-enforcement.spec.js +124 -278
  54. package/dist/test/kms-crypto-adapter.spec.d.ts +2 -2
  55. package/dist/test/kms-crypto-adapter.spec.js +304 -473
  56. package/dist/test/lit-crypto-adapter.spec.d.ts +2 -2
  57. package/dist/test/lit-crypto-adapter.spec.js +118 -206
  58. package/dist/test/memory-efficiency.spec.d.ts +2 -2
  59. package/dist/test/memory-efficiency.spec.js +87 -100
  60. package/dist/test/mocks/key-manager.d.ts +38 -71
  61. package/dist/test/mocks/key-manager.js +113 -129
  62. package/dist/test/node-crypto-adapter.spec.d.ts +2 -2
  63. package/dist/test/node-crypto-adapter.spec.js +102 -155
  64. package/dist/test/node-generic-crypto-adapter.spec.d.ts +2 -2
  65. package/dist/test/node-generic-crypto-adapter.spec.js +94 -134
  66. package/dist/test/setup.d.ts +2 -2
  67. package/dist/test/setup.js +9 -8
  68. package/dist/tsconfig.spec.tsbuildinfo +1 -1
  69. package/dist/types.d.ts +181 -219
  70. package/dist/utils/file-metadata.d.ts +13 -19
  71. package/dist/utils.d.ts +5 -14
  72. package/package.json +4 -4
@@ -1,3 +1,3 @@
1
- export const STORACHA_LIT_ACTION_CID: 'QmWSLN9m2Noj3kp8rx76yfQ9U7U1Mzjj3kGVpCr891Mjn1'
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
@@ -1,4 +1,3 @@
1
- export const STORACHA_LIT_ACTION_CID =
2
- 'QmWSLN9m2Noj3kp8rx76yfQ9U7U1Mzjj3kGVpCr891Mjn1'
3
- export const GATEWAY_URL = new URL('https://w3s.link')
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
@@ -1,10 +1,7 @@
1
- export default env
1
+ export default env;
2
2
  declare const env: Schema.InferStruct<{
3
- LIT_NETWORK: Schema.DefaultSchema<
4
- 'custom' | 'datil' | 'datil-dev' | 'datil-test',
5
- unknown
6
- >
7
- LIT_DEBUG: Schema.DefaultSchema<boolean, unknown>
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
@@ -1,14 +1,14 @@
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>
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('@storacha/client/types').ServiceConf
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
@@ -1,57 +1,44 @@
1
1
  /** @implements {Type.EncryptedClient} */
2
2
  export class EncryptedClient implements Type.EncryptedClient {
3
- /**
4
- * @param {import('@storacha/client').Client} storachaClient
5
- * @param {Type.CryptoAdapter} cryptoAdapter
6
- * @param {URL} gatewayURL
7
- */
8
- constructor(
9
- storachaClient: import('@storacha/client').Client,
10
- cryptoAdapter: Type.CryptoAdapter,
11
- gatewayURL: URL
12
- )
13
- /**
14
- * @type {Type.CryptoAdapter}
15
- * @protected
16
- */
17
- protected _cryptoAdapter: Type.CryptoAdapter
18
- /**
19
- * @type {import('@storacha/client').Client}
20
- * @protected
21
- */
22
- protected _storachaClient: import('@storacha/client').Client
23
- /**
24
- * @type {URL}
25
- * @protected
26
- */
27
- protected _gatewayURL: URL
28
- /**
29
- * Encrypt and upload a file to the Storacha network
30
- *
31
- * @param {Type.BlobLike} file - The file to upload
32
- * @param {Type.EncryptionConfig} encryptionConfig - User-provided encryption configuration
33
- * @param {Type.UploadOptions} [uploadOptions] - User-provided upload options
34
- * @returns {Promise<Type.AnyLink>} - The link to the uploaded file
35
- */
36
- encryptAndUploadFile(
37
- file: Type.BlobLike,
38
- encryptionConfig: Type.EncryptionConfig,
39
- uploadOptions?: Type.UploadOptions
40
- ): Promise<Type.AnyLink>
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
- options: Type.EncryptedClientOptions
55
- ): Promise<EncryptedClient>
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
@@ -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
- * @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(
42
- this._storachaClient,
43
- this._cryptoAdapter,
44
- file,
45
- encryptionConfig,
46
- uploadOptions
47
- )
48
- }
49
- /**
50
- * Retrieve and decrypt a file from the Storacha network
51
- *
52
- * @param {Type.AnyLink} cid - The link to the file to retrieve
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
- const cryptoAdapter = options.cryptoAdapter
75
- const gatewayURL = options.gatewayURL ?? GATEWAY_URL
76
- const storachaClient = options.storachaClient
77
- return new EncryptedClient(storachaClient, cryptoAdapter, gatewayURL)
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
@@ -1,8 +1,8 @@
1
1
  export class UnknownFormat extends Failure {
2
- /** @param {string} [reason] */
3
- constructor(reason?: string)
4
- name: 'UnknownFormat'
5
- #private
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
- strategy: 'lit' | 'kms',
4
- data: any
5
- ):
6
- | import('../../types.js').LitMetadataView
7
- | import('../../types.js').KMSMetadataView
8
- export function getSupportedVersions(): string[]
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: 'encrypted-metadata@0.2'
2
- export const KMSMetadataSchema: Schema.VariantSchema<
3
- {
4
- 'encrypted-metadata@0.2': Schema.StructSchema<
5
- {
6
- encryptedDataCID: Schema.Schema<
7
- Link.Link<unknown, number, number, 0 | 1>,
8
- any
9
- >
10
- encryptedSymmetricKey: Schema.StringSchema<string, unknown>
11
- space: Schema.StringSchema<string, unknown>
12
- kms: Schema.StructSchema<
13
- {
14
- provider: Schema.StringSchema<string, unknown>
15
- keyId: Schema.StringSchema<string, unknown>
16
- algorithm: Schema.StringSchema<string, unknown>
17
- },
18
- any
19
- >
20
- },
21
- unknown
22
- >
23
- },
24
- unknown
25
- >
26
- export const KMSMetadataInputSchema: Schema.StructSchema<
27
- {
28
- encryptedDataCID: Schema.StringSchema<string, unknown>
29
- encryptedSymmetricKey: Schema.StringSchema<string, unknown>
30
- space: Schema.StringSchema<string, unknown>
31
- kms: Schema.StructSchema<
32
- {
33
- provider: Schema.StringSchema<string, unknown>
34
- keyId: Schema.StringSchema<string, unknown>
35
- algorithm: Schema.StringSchema<string, unknown>
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: 'encrypted-metadata@0.1'
2
- export const LitMetadataSchema: Schema.VariantSchema<
3
- {
4
- 'encrypted-metadata@0.1': Schema.StructSchema<
5
- {
6
- encryptedDataCID: Schema.Schema<
7
- Link.Link<unknown, number, number, 0 | 1>,
8
- any
9
- >
10
- identityBoundCiphertext: Schema.Schema<
11
- Uint8Array<ArrayBufferLike>,
12
- unknown
13
- >
14
- plaintextKeyHash: Schema.Schema<Uint8Array<ArrayBufferLike>, unknown>
15
- accessControlConditions: Schema.Schema<
16
- Schema.Dictionary<string, unknown>[],
17
- unknown
18
- >
19
- },
20
- unknown
21
- >
22
- },
23
- unknown
24
- >
25
- export const LitMetadataInputSchema: Schema.StructSchema<
26
- {
27
- encryptedDataCID: Schema.StringSchema<string, unknown>
28
- identityBoundCiphertext: Schema.StringSchema<string, unknown>
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