@dstorage-tech/dstorage-sdk 0.0.5 → 0.0.8

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 (34) hide show
  1. package/README.md +22 -4
  2. package/dist/KeypairEncryptionAdapter-EOBRCIGP-5PFPNLLA.mjs +8 -0
  3. package/dist/{KeypairEncryptionAdapter-XUKCLRFU-AYDAZ2TZ.mjs → KeypairEncryptionAdapter-EOBRCIGP-FLPJIL26.mjs} +3 -3
  4. package/dist/{MnemonicEncryptionAdapter-RCHUETBP-M7NHGSHO.mjs → MnemonicEncryptionAdapter-S56YG63Q-B3F3TO3T.mjs} +3 -3
  5. package/dist/MnemonicEncryptionAdapter-S56YG63Q-POTD74UN.mjs +8 -0
  6. package/dist/{PasswordEncryptionAdapter-ECHND672-MUTHAMZY.mjs → PasswordEncryptionAdapter-B2UG7MWB-M4C3KJ4S.mjs} +3 -3
  7. package/dist/{PasswordEncryptionAdapter-ECHND672-3DEFO6FP.mjs → PasswordEncryptionAdapter-B2UG7MWB-QCSOIQJA.mjs} +3 -3
  8. package/dist/browser.d.mts +92 -196
  9. package/dist/browser.mjs +1886 -2139
  10. package/dist/{chunk-HDD6SUU4.mjs → chunk-42O7KEL4.mjs} +30 -11
  11. package/dist/{chunk-X4LEBNK6.mjs → chunk-5F3HZ2RJ.mjs} +30 -11
  12. package/dist/{chunk-6IAQVMSM.mjs → chunk-E73HFT6J.mjs} +5 -5
  13. package/dist/{chunk-UDYXMII2.mjs → chunk-EOPUNIUH.mjs} +5 -5
  14. package/dist/{chunk-O37NHERH.mjs → chunk-L6WCT64V.mjs} +4 -2
  15. package/dist/{chunk-4X5K43JF.mjs → chunk-M3F2LR3B.mjs} +3 -1
  16. package/dist/{chunk-JMPRZK5D.mjs → chunk-O6COTUD4.mjs} +3 -1
  17. package/dist/{chunk-BWLEAAFW.mjs → chunk-PCXBQRCO.mjs} +55 -2056
  18. package/dist/{chunk-OLGVVM5Y.mjs → chunk-QFJ2Y4XE.mjs} +5 -5
  19. package/dist/{chunk-Z6DUAI5B.mjs → chunk-XW4RZG2X.mjs} +5 -5
  20. package/dist/{contract-api-TJ7JPHZA-6FUBJ6DS.mjs → contract-api-NUY4UEKE-ZANT3ICG.mjs} +3 -3
  21. package/dist/{contract-api-AO4RGPLT-ENC72WCG.mjs → contract-api-P6YEDYQ6-2X6BMD64.mjs} +3 -3
  22. package/dist/{dist-INTAFXQ7.mjs → dist-AGNOIJI4.mjs} +3 -1
  23. package/dist/{dist-MOLWJ4Y7.mjs → dist-J4JUJ2J5.mjs} +3 -1
  24. package/dist/errors.d.mts +2 -3
  25. package/dist/errors.d.ts +2 -3
  26. package/dist/errors.js +10 -2059
  27. package/dist/errors.mjs +10 -2059
  28. package/dist/index.d.mts +109 -196
  29. package/dist/index.d.ts +109 -196
  30. package/dist/index.js +2106 -4347
  31. package/dist/index.mjs +1941 -2194
  32. package/package.json +3 -2
  33. package/dist/KeypairEncryptionAdapter-XUKCLRFU-ERPYK5S4.mjs +0 -8
  34. package/dist/MnemonicEncryptionAdapter-RCHUETBP-DZPBGQG6.mjs +0 -8
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  EncryptionErrorCode
3
- } from "./chunk-O37NHERH.mjs";
3
+ } from "./chunk-L6WCT64V.mjs";
4
4
  import {
5
5
  DStorageError,
6
6
  KeyDeriver,
7
7
  deriveKek,
8
8
  unwrapKey,
9
9
  wrapKey
10
- } from "./chunk-BWLEAAFW.mjs";
10
+ } from "./chunk-PCXBQRCO.mjs";
11
11
 
12
- // ../encryption/dist/chunk-SW62VRE3.mjs
12
+ // ../encryption/dist/chunk-SOX5GKK4.mjs
13
13
  var MnemonicEncryptionAdapter = class {
14
14
  constructor(input) {
15
15
  this.name = "mnemonic";
@@ -73,8 +73,8 @@ var MnemonicEncryptionAdapter = class {
73
73
  * @param variant ML-KEM variant. Default: "mlkem768".
74
74
  */
75
75
  async intoKeypairEncryptionAdapter(context, variant) {
76
- const { KeypairEncryptionAdapter } = await import("./KeypairEncryptionAdapter-XUKCLRFU-ERPYK5S4.mjs");
77
- const { mlkemGenerateKeypairFromSeed } = await import("./dist-MOLWJ4Y7.mjs");
76
+ const { KeypairEncryptionAdapter } = await import("./KeypairEncryptionAdapter-EOBRCIGP-FLPJIL26.mjs");
77
+ const { mlkemGenerateKeypairFromSeed } = await import("./dist-AGNOIJI4.mjs");
78
78
  const kekMaterial = await this.kekMaterialPromise;
79
79
  const mlkemBits = await globalThis.crypto.subtle.deriveBits(
80
80
  {
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  EncryptionErrorCode
3
- } from "./chunk-O37NHERH.mjs";
3
+ } from "./chunk-L6WCT64V.mjs";
4
4
  import {
5
5
  DStorageError,
6
6
  mlkemGenerateKeypair,
7
7
  mlkemUnwrapDek,
8
8
  mlkemWrapDek
9
- } from "./chunk-BWLEAAFW.mjs";
9
+ } from "./chunk-PCXBQRCO.mjs";
10
10
 
11
- // ../encryption/dist/chunk-NAJYQ4J6.mjs
11
+ // ../encryption/dist/chunk-A7BIR2QB.mjs
12
12
  var KeypairEncryptionAdapter = class _KeypairEncryptionAdapter {
13
13
  constructor(pk, sk, context, variant) {
14
14
  this.publicKey = pk;
@@ -64,7 +64,7 @@ var KeypairEncryptionAdapter = class _KeypairEncryptionAdapter {
64
64
  * @param variant Default: "mlkem768"
65
65
  */
66
66
  static async fromMnemonic(input, context, variant = "mlkem768") {
67
- const { MnemonicEncryptionAdapter } = await import("./MnemonicEncryptionAdapter-RCHUETBP-DZPBGQG6.mjs");
67
+ const { MnemonicEncryptionAdapter } = await import("./MnemonicEncryptionAdapter-S56YG63Q-POTD74UN.mjs");
68
68
  const ms = new MnemonicEncryptionAdapter(input);
69
69
  return ms.intoKeypairEncryptionAdapter(context, variant);
70
70
  }
@@ -84,7 +84,7 @@ var KeypairEncryptionAdapter = class _KeypairEncryptionAdapter {
84
84
  * @param params Optional custom scrypt params
85
85
  */
86
86
  static async fromPassword(password, salt, context, variant = "mlkem768", params) {
87
- const { PasswordEncryptionAdapter } = await import("./PasswordEncryptionAdapter-ECHND672-MUTHAMZY.mjs");
87
+ const { PasswordEncryptionAdapter } = await import("./PasswordEncryptionAdapter-B2UG7MWB-M4C3KJ4S.mjs");
88
88
  const ps = new PasswordEncryptionAdapter({
89
89
  password,
90
90
  salt,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ChainErrorCode
3
- } from "./chunk-JMPRZK5D.mjs";
3
+ } from "./chunk-M3F2LR3B.mjs";
4
4
  import {
5
5
  DStorageError
6
- } from "./chunk-BWLEAAFW.mjs";
6
+ } from "./chunk-PCXBQRCO.mjs";
7
7
  import {
8
8
  CompiledDataRegistryContract,
9
9
  createDataRegistryPrivateState,
@@ -17,7 +17,7 @@ import {
17
17
  __toESM
18
18
  } from "./chunk-UJCSKKID.mjs";
19
19
 
20
- // ../chain/dist/contract-api-TJ7JPHZA.mjs
20
+ // ../chain/dist/contract-api-NUY4UEKE.mjs
21
21
  var import_rxjs = __toESM(require_cjs(), 1);
22
22
  import {
23
23
  deployContract,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ChainErrorCode
3
- } from "./chunk-4X5K43JF.mjs";
3
+ } from "./chunk-O6COTUD4.mjs";
4
4
  import {
5
5
  DStorageError
6
- } from "./chunk-BWLEAAFW.mjs";
6
+ } from "./chunk-PCXBQRCO.mjs";
7
7
  import {
8
8
  CompiledDataRegistryContract,
9
9
  createDataRegistryPrivateState,
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-FJ7LSZOW.mjs";
20
20
  import "./chunk-5QOKJEH3.mjs";
21
21
 
22
- // ../chain/dist/contract-api-AO4RGPLT.mjs
22
+ // ../chain/dist/contract-api-P6YEDYQ6.mjs
23
23
  import {
24
24
  deployContract,
25
25
  findDeployedContract,
@@ -25,11 +25,12 @@ import {
25
25
  mlkemUnwrapDek,
26
26
  mlkemWrapDek,
27
27
  parseKeyEnvelope,
28
+ readResponseTextWithLimit,
28
29
  serializeKeyEnvelope,
29
30
  serializeXChaChaPayload,
30
31
  unwrapKey,
31
32
  wrapKey
32
- } from "./chunk-BWLEAAFW.mjs";
33
+ } from "./chunk-PCXBQRCO.mjs";
33
34
  import "./chunk-UJCSKKID.mjs";
34
35
  export {
35
36
  CryptoErrorCode,
@@ -58,6 +59,7 @@ export {
58
59
  mlkemUnwrapDek,
59
60
  mlkemWrapDek,
60
61
  parseKeyEnvelope,
62
+ readResponseTextWithLimit,
61
63
  serializeKeyEnvelope,
62
64
  serializeXChaChaPayload,
63
65
  unwrapKey,
@@ -25,11 +25,12 @@ import {
25
25
  mlkemUnwrapDek,
26
26
  mlkemWrapDek,
27
27
  parseKeyEnvelope,
28
+ readResponseTextWithLimit,
28
29
  serializeKeyEnvelope,
29
30
  serializeXChaChaPayload,
30
31
  unwrapKey,
31
32
  wrapKey
32
- } from "./chunk-BWLEAAFW.mjs";
33
+ } from "./chunk-PCXBQRCO.mjs";
33
34
  export {
34
35
  CryptoErrorCode,
35
36
  DStorageError,
@@ -57,6 +58,7 @@ export {
57
58
  mlkemUnwrapDek,
58
59
  mlkemWrapDek,
59
60
  parseKeyEnvelope,
61
+ readResponseTextWithLimit,
60
62
  serializeKeyEnvelope,
61
63
  serializeXChaChaPayload,
62
64
  unwrapKey,
package/dist/errors.d.mts CHANGED
@@ -86,20 +86,19 @@ declare const CoreErrorCode: {
86
86
  readonly STORAGE_ADAPTER_MISMATCH: 10052;
87
87
  readonly RETRIEVE_BY_REF_ID_ENVELOPE_EMPTY: 10053;
88
88
  readonly CONTENT_HASH_MISMATCH: 10054;
89
+ readonly METADATA_PARSE_FAILED: 10055;
89
90
  readonly LIST_REFS_REQUIRES_CHAIN: 10060;
90
91
  readonly LIST_REFS_NOT_SUPPORTED: 10061;
91
92
  readonly REMOVE_REF_REQUIRES_CHAIN: 10070;
92
93
  readonly REMOVE_REF_NOT_SUPPORTED: 10071;
93
- readonly META_TX_REQUIRES_ENCRYPTION: 10080;
94
- readonly PREPARE_UPLOAD_NO_PROVIDERS: 10081;
95
94
  readonly MANIFEST_INVALID_STRUCTURE: 10090;
96
95
  readonly MANIFEST_CHUNK_COUNT_MISMATCH: 10091;
97
96
  readonly MANIFEST_NOT_CONTIGUOUS: 10092;
98
97
  readonly DECRYPT_CHUNK_FAILED: 10093;
99
98
  readonly CHUNK_OVERFLOWS_TOTAL_SIZE: 10094;
100
99
  readonly REASSEMBLY_SIZE_MISMATCH: 10095;
100
+ readonly MANIFEST_PARSE_FAILED: 10096;
101
101
  readonly NOT_INITIALIZED: 10100;
102
- readonly META_TX_UNKNOWN_STEP: 10200;
103
102
  readonly UNKNOWN_ERROR: 10999;
104
103
  };
105
104
  type CoreErrorCode = (typeof CoreErrorCode)[keyof typeof CoreErrorCode];
package/dist/errors.d.ts CHANGED
@@ -86,20 +86,19 @@ declare const CoreErrorCode: {
86
86
  readonly STORAGE_ADAPTER_MISMATCH: 10052;
87
87
  readonly RETRIEVE_BY_REF_ID_ENVELOPE_EMPTY: 10053;
88
88
  readonly CONTENT_HASH_MISMATCH: 10054;
89
+ readonly METADATA_PARSE_FAILED: 10055;
89
90
  readonly LIST_REFS_REQUIRES_CHAIN: 10060;
90
91
  readonly LIST_REFS_NOT_SUPPORTED: 10061;
91
92
  readonly REMOVE_REF_REQUIRES_CHAIN: 10070;
92
93
  readonly REMOVE_REF_NOT_SUPPORTED: 10071;
93
- readonly META_TX_REQUIRES_ENCRYPTION: 10080;
94
- readonly PREPARE_UPLOAD_NO_PROVIDERS: 10081;
95
94
  readonly MANIFEST_INVALID_STRUCTURE: 10090;
96
95
  readonly MANIFEST_CHUNK_COUNT_MISMATCH: 10091;
97
96
  readonly MANIFEST_NOT_CONTIGUOUS: 10092;
98
97
  readonly DECRYPT_CHUNK_FAILED: 10093;
99
98
  readonly CHUNK_OVERFLOWS_TOTAL_SIZE: 10094;
100
99
  readonly REASSEMBLY_SIZE_MISMATCH: 10095;
100
+ readonly MANIFEST_PARSE_FAILED: 10096;
101
101
  readonly NOT_INITIALIZED: 10100;
102
- readonly META_TX_UNKNOWN_STEP: 10200;
103
102
  readonly UNKNOWN_ERROR: 10999;
104
103
  };
105
104
  type CoreErrorCode = (typeof CoreErrorCode)[keyof typeof CoreErrorCode];