@dstorage-tech/dstorage-sdk 0.0.4
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/LICENSE +21 -0
- package/README.md +530 -0
- package/dist/KeypairEncryptionAdapter-AE75YC4W-AOWNSH2M.mjs +9 -0
- package/dist/KeypairEncryptionAdapter-AE75YC4W-BAVHRNNJ.mjs +1 -0
- package/dist/KeypairEncryptionAdapter-AE75YC4W-BEYO4RUO.mjs +1 -0
- package/dist/KeypairEncryptionAdapter-AE75YC4W-VAOH6AAL.mjs +9 -0
- package/dist/KeypairEncryptionAdapter-XUKCLRFU-6ERIZN2M.mjs +1 -0
- package/dist/KeypairEncryptionAdapter-XUKCLRFU-AYDAZ2TZ.mjs +9 -0
- package/dist/KeypairEncryptionAdapter-XUKCLRFU-ERPYK5S4.mjs +8 -0
- package/dist/MnemonicEncryptionAdapter-J6IE5OKA-6DFVUVD6.mjs +1 -0
- package/dist/MnemonicEncryptionAdapter-J6IE5OKA-O5AJPX42.mjs +1 -0
- package/dist/MnemonicEncryptionAdapter-J6IE5OKA-SI6TBLTQ.mjs +9 -0
- package/dist/MnemonicEncryptionAdapter-J6IE5OKA-WEPFOTSJ.mjs +9 -0
- package/dist/MnemonicEncryptionAdapter-RCHUETBP-DZPBGQG6.mjs +8 -0
- package/dist/MnemonicEncryptionAdapter-RCHUETBP-ELAMJMMO.mjs +1 -0
- package/dist/MnemonicEncryptionAdapter-RCHUETBP-M7NHGSHO.mjs +9 -0
- package/dist/PasswordEncryptionAdapter-CWOXUGR4-2YZ64B4A.mjs +1 -0
- package/dist/PasswordEncryptionAdapter-CWOXUGR4-DCEGC2NX.mjs +1 -0
- package/dist/PasswordEncryptionAdapter-CWOXUGR4-QEGGYPFJ.mjs +13 -0
- package/dist/PasswordEncryptionAdapter-CWOXUGR4-ZYUBUYUI.mjs +13 -0
- package/dist/PasswordEncryptionAdapter-ECHND672-3DEFO6FP.mjs +13 -0
- package/dist/PasswordEncryptionAdapter-ECHND672-MUTHAMZY.mjs +12 -0
- package/dist/PasswordEncryptionAdapter-ECHND672-XVBPHPPT.mjs +1 -0
- package/dist/browser.d.mts +2418 -0
- package/dist/browser.mjs +5175 -0
- package/dist/chunk-25I6ZXUC.mjs +9403 -0
- package/dist/chunk-4X5K43JF.mjs +62 -0
- package/dist/chunk-4YMF57VY.mjs +1 -0
- package/dist/chunk-5MZ7FPPY.mjs +1 -0
- package/dist/chunk-5P4EW2YL.mjs +1 -0
- package/dist/chunk-5QOKJEH3.mjs +8 -0
- package/dist/chunk-5RW7SGA7.mjs +1 -0
- package/dist/chunk-62RSKZ6T.mjs +118 -0
- package/dist/chunk-6IAQVMSM.mjs +102 -0
- package/dist/chunk-BBJCQFWP.mjs +275 -0
- package/dist/chunk-BWLEAAFW.mjs +2599 -0
- package/dist/chunk-EYF3263P.mjs +2049 -0
- package/dist/chunk-FJ7LSZOW.mjs +5537 -0
- package/dist/chunk-GUYENY5N.mjs +1 -0
- package/dist/chunk-HDD6SUU4.mjs +276 -0
- package/dist/chunk-JMPRZK5D.mjs +62 -0
- package/dist/chunk-L5QD6GHB.mjs +101 -0
- package/dist/chunk-O37NHERH.mjs +17 -0
- package/dist/chunk-OLGVVM5Y.mjs +102 -0
- package/dist/chunk-PKHRAYFD.mjs +1 -0
- package/dist/chunk-PLAOCKSS.mjs +101 -0
- package/dist/chunk-QKA2DCR6.mjs +118 -0
- package/dist/chunk-RPSRFFXN.mjs +275 -0
- package/dist/chunk-TESUOXRJ.mjs +1 -0
- package/dist/chunk-TMLXCRJU.mjs +1 -0
- package/dist/chunk-TNRKN4LB.mjs +1 -0
- package/dist/chunk-TSZ37JDY.mjs +2596 -0
- package/dist/chunk-U3MS6KMF.mjs +1 -0
- package/dist/chunk-UBALMYIY.mjs +2049 -0
- package/dist/chunk-UDYXMII2.mjs +121 -0
- package/dist/chunk-UJCSKKID.mjs +30 -0
- package/dist/chunk-UOOF4V2Y.mjs +1 -0
- package/dist/chunk-VDZ7F7MP.mjs +1329 -0
- package/dist/chunk-X4LEBNK6.mjs +276 -0
- package/dist/chunk-Z2TH6U4C.mjs +3 -0
- package/dist/chunk-Z6DUAI5B.mjs +121 -0
- package/dist/chunk-ZEPZ4QDD.mjs +1 -0
- package/dist/chunk-ZGUY5EIR.mjs +1 -0
- package/dist/cjs-RMZ3L2IO.mjs +5 -0
- package/dist/contract-api-AO4RGPLT-4HRCMSCE.mjs +279 -0
- package/dist/contract-api-AO4RGPLT-ADH6ZDKC.mjs +279 -0
- package/dist/contract-api-AO4RGPLT-ENC72WCG.mjs +280 -0
- package/dist/contract-api-AO4RGPLT-PAMIPEI3.mjs +1 -0
- package/dist/contract-api-AO4RGPLT-W3RSVP5A.mjs +1 -0
- package/dist/contract-api-AO4RGPLT-WENYDV6I.mjs +1 -0
- package/dist/contract-api-TJ7JPHZA-6FUBJ6DS.mjs +279 -0
- package/dist/contract-api-TJ7JPHZA-ZWP3EH7D.mjs +279 -0
- package/dist/contracts/dataregistry/managed/keys/removeReference.prover +0 -0
- package/dist/contracts/dataregistry/managed/keys/removeReference.verifier +0 -0
- package/dist/contracts/dataregistry/managed/keys/storeReference.prover +0 -0
- package/dist/contracts/dataregistry/managed/keys/storeReference.verifier +0 -0
- package/dist/contracts/dataregistry/managed/keys/updateReference.prover +0 -0
- package/dist/contracts/dataregistry/managed/keys/updateReference.verifier +0 -0
- package/dist/contracts/dataregistry/managed/zkir/removeReference.bzkir +0 -0
- package/dist/contracts/dataregistry/managed/zkir/removeReference.zkir +138 -0
- package/dist/contracts/dataregistry/managed/zkir/storeReference.bzkir +0 -0
- package/dist/contracts/dataregistry/managed/zkir/storeReference.zkir +158 -0
- package/dist/contracts/dataregistry/managed/zkir/updateReference.bzkir +0 -0
- package/dist/contracts/dataregistry/managed/zkir/updateReference.zkir +190 -0
- package/dist/dataregistry-simulator-E6RTGGWT-5YEGBW7P.mjs +108 -0
- package/dist/dataregistry-simulator-E6RTGGWT-DJS4MHBD.mjs +109 -0
- package/dist/dataregistry-simulator-E6RTGGWT-QGCYR3VF.mjs +1 -0
- package/dist/dist-655VYUPJ.mjs +1 -0
- package/dist/dist-INTAFXQ7.mjs +65 -0
- package/dist/dist-MEZZWKP4.mjs +1 -0
- package/dist/dist-MOLWJ4Y7.mjs +64 -0
- package/dist/dist-UD4WRMYJ.mjs +65 -0
- package/dist/errors.d.mts +117 -0
- package/dist/errors.d.ts +117 -0
- package/dist/errors.js +2308 -0
- package/dist/errors.mjs +2278 -0
- package/dist/esm5-AGBDHMNS.mjs +1 -0
- package/dist/esm5-GFOBLUFI.mjs +350 -0
- package/dist/in-memory-private-state-NGOP37V7-DXWZE42Q.mjs +48 -0
- package/dist/in-memory-private-state-NGOP37V7-QXT3RUEH.mjs +49 -0
- package/dist/in-memory-private-state-NGOP37V7-XFJFNFCQ.mjs +1 -0
- package/dist/index.d.mts +2843 -0
- package/dist/index.d.ts +2843 -0
- package/dist/index.js +19639 -0
- package/dist/index.mjs +5177 -0
- package/package.json +87 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export { StorageErrorCode } from '@dstorage/storage/errors';
|
|
2
|
+
export { ChainErrorCode } from '@dstorage/chain/errors';
|
|
3
|
+
import { StorageProviderName } from './types.js';
|
|
4
|
+
|
|
5
|
+
declare class DStorageError extends Error {
|
|
6
|
+
readonly code: number;
|
|
7
|
+
readonly httpStatus?: number;
|
|
8
|
+
constructor(code: number, message: string, options?: ErrorOptions & {
|
|
9
|
+
httpStatus?: number;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
declare function isDStorageError(err: unknown): err is DStorageError;
|
|
13
|
+
declare const CryptoErrorCode: {
|
|
14
|
+
readonly WEBCRYPTO_NOT_AVAILABLE: 12000;
|
|
15
|
+
readonly BASE64URL_INVALID: 12001;
|
|
16
|
+
readonly MISSING_KEY_INPUT: 12002;
|
|
17
|
+
readonly MNEMONIC_TOO_SHORT: 12003;
|
|
18
|
+
readonly SEED_INVALID_LENGTH: 12004;
|
|
19
|
+
readonly MNEMONIC_INVALID: 12005;
|
|
20
|
+
readonly HEX_ODD_LENGTH: 12006;
|
|
21
|
+
readonly HEX_INVALID_CHARS: 12007;
|
|
22
|
+
readonly DEK_INVALID_LENGTH: 12008;
|
|
23
|
+
readonly WRAP_KEK_INVALID_LENGTH: 12009;
|
|
24
|
+
readonly UNWRAP_KEK_INVALID_LENGTH: 12010;
|
|
25
|
+
readonly ENVELOPE_EMPTY_WRAPPERS: 12011;
|
|
26
|
+
readonly XCHACHA_INVALID_STORAGE_ID_LEN: 12012;
|
|
27
|
+
readonly XCHACHA_PAYLOAD_MALFORMED: 12013;
|
|
28
|
+
readonly XCHACHA_STORAGE_ID_MALFORMED: 12014;
|
|
29
|
+
readonly MLKEM_SEED_INVALID_LENGTH: 12015;
|
|
30
|
+
readonly MLKEM_MISSING_CIPHERTEXT: 12016;
|
|
31
|
+
readonly MLKEM_UNKNOWN_ALGORITHM: 12017;
|
|
32
|
+
readonly MLKEM_UNKNOWN_VARIANT: 12018;
|
|
33
|
+
};
|
|
34
|
+
type CryptoErrorCode = (typeof CryptoErrorCode)[keyof typeof CryptoErrorCode];
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @dstorage/core — types.ts
|
|
38
|
+
* Top-level types for the dStorage SDK public API.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Payload included in both `StorePartialError.recovery` and the `"stored"`
|
|
43
|
+
* phase of `StoreProgress`. Contains enough information to retry a failed
|
|
44
|
+
* chain write via `registerReference()` without re-uploading.
|
|
45
|
+
*
|
|
46
|
+
* `keyEnvelope` is the DEK encrypted under the user's KEK — safe to persist
|
|
47
|
+
* (e.g. in localStorage or a database). It is `undefined` for public uploads
|
|
48
|
+
* since their on-chain reference does not depend on a content DEK.
|
|
49
|
+
*/
|
|
50
|
+
interface StoreRecovery {
|
|
51
|
+
storageId: string;
|
|
52
|
+
/** Storage provider that holds the content — required by registerReference(). */
|
|
53
|
+
storageProvider: StorageProviderName;
|
|
54
|
+
keyEnvelope: string | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* BLAKE3 hash of the ciphertext bytes stored at `storageId`, hex-encoded (64 chars).
|
|
57
|
+
* Pass to `registerReference()` to preserve the on-chain integrity check on the recovered reference.
|
|
58
|
+
*/
|
|
59
|
+
contentHash?: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
declare const CoreErrorCode: {
|
|
63
|
+
readonly METADATA_WITH_PUBLIC_UPLOAD: 10001;
|
|
64
|
+
readonly UPLOAD_NO_PROVIDERS: 10002;
|
|
65
|
+
readonly PUBLIC_UPLOAD_REQUIRES_SEED_PROVIDER: 10003;
|
|
66
|
+
readonly CHAIN_WRITE_FAILED: 10004;
|
|
67
|
+
readonly REGISTER_REF_REQUIRES_CHAIN: 10010;
|
|
68
|
+
readonly REGISTER_REF_REQUIRES_ENCRYPTION: 10011;
|
|
69
|
+
readonly UPDATE_UPLOAD_REQUIRES_CHAIN: 10020;
|
|
70
|
+
readonly UPDATE_UPLOAD_NOT_SUPPORTED: 10021;
|
|
71
|
+
readonly UPDATE_UPLOAD_REQUIRES_ENCRYPTION: 10022;
|
|
72
|
+
readonly ROTATE_KEYS_REQUIRES_CHAIN: 10023;
|
|
73
|
+
readonly ROTATE_KEYS_NOT_SUPPORTED: 10024;
|
|
74
|
+
readonly ROTATE_KEYS_REQUIRES_ENCRYPTION: 10025;
|
|
75
|
+
readonly DECRYPT_NO_PROVIDERS: 10030;
|
|
76
|
+
readonly DECRYPT_ENVELOPE_EMPTY: 10031;
|
|
77
|
+
readonly DECRYPT_ENVELOPE_MALFORMED: 10032;
|
|
78
|
+
readonly DECRYPT_NO_WRAPPER_MATCHED: 10033;
|
|
79
|
+
readonly UNWRAP_DEK_NO_PROVIDERS: 10034;
|
|
80
|
+
readonly UNWRAP_DEK_ENVELOPE_EMPTY: 10035;
|
|
81
|
+
readonly UNWRAP_DEK_ENVELOPE_MALFORMED: 10036;
|
|
82
|
+
readonly UNWRAP_DEK_NO_WRAPPER_MATCHED: 10037;
|
|
83
|
+
readonly DECRYPT_PAYLOAD_FAILED: 10038;
|
|
84
|
+
readonly RETRIEVE_BY_REF_ID_REQUIRES_CHAIN: 10050;
|
|
85
|
+
readonly REF_NOT_FOUND: 10051;
|
|
86
|
+
readonly STORAGE_ADAPTER_MISMATCH: 10052;
|
|
87
|
+
readonly RETRIEVE_BY_REF_ID_ENVELOPE_EMPTY: 10053;
|
|
88
|
+
readonly CONTENT_HASH_MISMATCH: 10054;
|
|
89
|
+
readonly LIST_REFS_REQUIRES_CHAIN: 10060;
|
|
90
|
+
readonly LIST_REFS_NOT_SUPPORTED: 10061;
|
|
91
|
+
readonly REMOVE_REF_REQUIRES_CHAIN: 10070;
|
|
92
|
+
readonly REMOVE_REF_NOT_SUPPORTED: 10071;
|
|
93
|
+
readonly META_TX_REQUIRES_ENCRYPTION: 10080;
|
|
94
|
+
readonly PREPARE_UPLOAD_NO_PROVIDERS: 10081;
|
|
95
|
+
readonly MANIFEST_INVALID_STRUCTURE: 10090;
|
|
96
|
+
readonly MANIFEST_CHUNK_COUNT_MISMATCH: 10091;
|
|
97
|
+
readonly MANIFEST_NOT_CONTIGUOUS: 10092;
|
|
98
|
+
readonly DECRYPT_CHUNK_FAILED: 10093;
|
|
99
|
+
readonly CHUNK_OVERFLOWS_TOTAL_SIZE: 10094;
|
|
100
|
+
readonly REASSEMBLY_SIZE_MISMATCH: 10095;
|
|
101
|
+
readonly NOT_INITIALIZED: 10100;
|
|
102
|
+
readonly META_TX_UNKNOWN_STEP: 10200;
|
|
103
|
+
readonly UNKNOWN_ERROR: 10999;
|
|
104
|
+
};
|
|
105
|
+
type CoreErrorCode = (typeof CoreErrorCode)[keyof typeof CoreErrorCode];
|
|
106
|
+
/**
|
|
107
|
+
* Thrown when `store()` succeeds at the storage layer but fails to write the
|
|
108
|
+
* on-chain reference. The content is permanently on the storage network — use
|
|
109
|
+
* `err.recovery` with `registerReference()` to retry only the chain write.
|
|
110
|
+
*/
|
|
111
|
+
declare class StorePartialError extends DStorageError {
|
|
112
|
+
readonly recovery: StoreRecovery;
|
|
113
|
+
constructor(recovery: StoreRecovery);
|
|
114
|
+
}
|
|
115
|
+
declare function isStorePartialError(err: unknown): err is StorePartialError;
|
|
116
|
+
|
|
117
|
+
export { CoreErrorCode, CryptoErrorCode, DStorageError, StorePartialError, isDStorageError, isStorePartialError };
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export { StorageErrorCode } from '@dstorage/storage/errors';
|
|
2
|
+
export { ChainErrorCode } from '@dstorage/chain/errors';
|
|
3
|
+
import { StorageProviderName } from './types.js';
|
|
4
|
+
|
|
5
|
+
declare class DStorageError extends Error {
|
|
6
|
+
readonly code: number;
|
|
7
|
+
readonly httpStatus?: number;
|
|
8
|
+
constructor(code: number, message: string, options?: ErrorOptions & {
|
|
9
|
+
httpStatus?: number;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
declare function isDStorageError(err: unknown): err is DStorageError;
|
|
13
|
+
declare const CryptoErrorCode: {
|
|
14
|
+
readonly WEBCRYPTO_NOT_AVAILABLE: 12000;
|
|
15
|
+
readonly BASE64URL_INVALID: 12001;
|
|
16
|
+
readonly MISSING_KEY_INPUT: 12002;
|
|
17
|
+
readonly MNEMONIC_TOO_SHORT: 12003;
|
|
18
|
+
readonly SEED_INVALID_LENGTH: 12004;
|
|
19
|
+
readonly MNEMONIC_INVALID: 12005;
|
|
20
|
+
readonly HEX_ODD_LENGTH: 12006;
|
|
21
|
+
readonly HEX_INVALID_CHARS: 12007;
|
|
22
|
+
readonly DEK_INVALID_LENGTH: 12008;
|
|
23
|
+
readonly WRAP_KEK_INVALID_LENGTH: 12009;
|
|
24
|
+
readonly UNWRAP_KEK_INVALID_LENGTH: 12010;
|
|
25
|
+
readonly ENVELOPE_EMPTY_WRAPPERS: 12011;
|
|
26
|
+
readonly XCHACHA_INVALID_STORAGE_ID_LEN: 12012;
|
|
27
|
+
readonly XCHACHA_PAYLOAD_MALFORMED: 12013;
|
|
28
|
+
readonly XCHACHA_STORAGE_ID_MALFORMED: 12014;
|
|
29
|
+
readonly MLKEM_SEED_INVALID_LENGTH: 12015;
|
|
30
|
+
readonly MLKEM_MISSING_CIPHERTEXT: 12016;
|
|
31
|
+
readonly MLKEM_UNKNOWN_ALGORITHM: 12017;
|
|
32
|
+
readonly MLKEM_UNKNOWN_VARIANT: 12018;
|
|
33
|
+
};
|
|
34
|
+
type CryptoErrorCode = (typeof CryptoErrorCode)[keyof typeof CryptoErrorCode];
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @dstorage/core — types.ts
|
|
38
|
+
* Top-level types for the dStorage SDK public API.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Payload included in both `StorePartialError.recovery` and the `"stored"`
|
|
43
|
+
* phase of `StoreProgress`. Contains enough information to retry a failed
|
|
44
|
+
* chain write via `registerReference()` without re-uploading.
|
|
45
|
+
*
|
|
46
|
+
* `keyEnvelope` is the DEK encrypted under the user's KEK — safe to persist
|
|
47
|
+
* (e.g. in localStorage or a database). It is `undefined` for public uploads
|
|
48
|
+
* since their on-chain reference does not depend on a content DEK.
|
|
49
|
+
*/
|
|
50
|
+
interface StoreRecovery {
|
|
51
|
+
storageId: string;
|
|
52
|
+
/** Storage provider that holds the content — required by registerReference(). */
|
|
53
|
+
storageProvider: StorageProviderName;
|
|
54
|
+
keyEnvelope: string | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* BLAKE3 hash of the ciphertext bytes stored at `storageId`, hex-encoded (64 chars).
|
|
57
|
+
* Pass to `registerReference()` to preserve the on-chain integrity check on the recovered reference.
|
|
58
|
+
*/
|
|
59
|
+
contentHash?: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
declare const CoreErrorCode: {
|
|
63
|
+
readonly METADATA_WITH_PUBLIC_UPLOAD: 10001;
|
|
64
|
+
readonly UPLOAD_NO_PROVIDERS: 10002;
|
|
65
|
+
readonly PUBLIC_UPLOAD_REQUIRES_SEED_PROVIDER: 10003;
|
|
66
|
+
readonly CHAIN_WRITE_FAILED: 10004;
|
|
67
|
+
readonly REGISTER_REF_REQUIRES_CHAIN: 10010;
|
|
68
|
+
readonly REGISTER_REF_REQUIRES_ENCRYPTION: 10011;
|
|
69
|
+
readonly UPDATE_UPLOAD_REQUIRES_CHAIN: 10020;
|
|
70
|
+
readonly UPDATE_UPLOAD_NOT_SUPPORTED: 10021;
|
|
71
|
+
readonly UPDATE_UPLOAD_REQUIRES_ENCRYPTION: 10022;
|
|
72
|
+
readonly ROTATE_KEYS_REQUIRES_CHAIN: 10023;
|
|
73
|
+
readonly ROTATE_KEYS_NOT_SUPPORTED: 10024;
|
|
74
|
+
readonly ROTATE_KEYS_REQUIRES_ENCRYPTION: 10025;
|
|
75
|
+
readonly DECRYPT_NO_PROVIDERS: 10030;
|
|
76
|
+
readonly DECRYPT_ENVELOPE_EMPTY: 10031;
|
|
77
|
+
readonly DECRYPT_ENVELOPE_MALFORMED: 10032;
|
|
78
|
+
readonly DECRYPT_NO_WRAPPER_MATCHED: 10033;
|
|
79
|
+
readonly UNWRAP_DEK_NO_PROVIDERS: 10034;
|
|
80
|
+
readonly UNWRAP_DEK_ENVELOPE_EMPTY: 10035;
|
|
81
|
+
readonly UNWRAP_DEK_ENVELOPE_MALFORMED: 10036;
|
|
82
|
+
readonly UNWRAP_DEK_NO_WRAPPER_MATCHED: 10037;
|
|
83
|
+
readonly DECRYPT_PAYLOAD_FAILED: 10038;
|
|
84
|
+
readonly RETRIEVE_BY_REF_ID_REQUIRES_CHAIN: 10050;
|
|
85
|
+
readonly REF_NOT_FOUND: 10051;
|
|
86
|
+
readonly STORAGE_ADAPTER_MISMATCH: 10052;
|
|
87
|
+
readonly RETRIEVE_BY_REF_ID_ENVELOPE_EMPTY: 10053;
|
|
88
|
+
readonly CONTENT_HASH_MISMATCH: 10054;
|
|
89
|
+
readonly LIST_REFS_REQUIRES_CHAIN: 10060;
|
|
90
|
+
readonly LIST_REFS_NOT_SUPPORTED: 10061;
|
|
91
|
+
readonly REMOVE_REF_REQUIRES_CHAIN: 10070;
|
|
92
|
+
readonly REMOVE_REF_NOT_SUPPORTED: 10071;
|
|
93
|
+
readonly META_TX_REQUIRES_ENCRYPTION: 10080;
|
|
94
|
+
readonly PREPARE_UPLOAD_NO_PROVIDERS: 10081;
|
|
95
|
+
readonly MANIFEST_INVALID_STRUCTURE: 10090;
|
|
96
|
+
readonly MANIFEST_CHUNK_COUNT_MISMATCH: 10091;
|
|
97
|
+
readonly MANIFEST_NOT_CONTIGUOUS: 10092;
|
|
98
|
+
readonly DECRYPT_CHUNK_FAILED: 10093;
|
|
99
|
+
readonly CHUNK_OVERFLOWS_TOTAL_SIZE: 10094;
|
|
100
|
+
readonly REASSEMBLY_SIZE_MISMATCH: 10095;
|
|
101
|
+
readonly NOT_INITIALIZED: 10100;
|
|
102
|
+
readonly META_TX_UNKNOWN_STEP: 10200;
|
|
103
|
+
readonly UNKNOWN_ERROR: 10999;
|
|
104
|
+
};
|
|
105
|
+
type CoreErrorCode = (typeof CoreErrorCode)[keyof typeof CoreErrorCode];
|
|
106
|
+
/**
|
|
107
|
+
* Thrown when `store()` succeeds at the storage layer but fails to write the
|
|
108
|
+
* on-chain reference. The content is permanently on the storage network — use
|
|
109
|
+
* `err.recovery` with `registerReference()` to retry only the chain write.
|
|
110
|
+
*/
|
|
111
|
+
declare class StorePartialError extends DStorageError {
|
|
112
|
+
readonly recovery: StoreRecovery;
|
|
113
|
+
constructor(recovery: StoreRecovery);
|
|
114
|
+
}
|
|
115
|
+
declare function isStorePartialError(err: unknown): err is StorePartialError;
|
|
116
|
+
|
|
117
|
+
export { CoreErrorCode, CryptoErrorCode, DStorageError, StorePartialError, isDStorageError, isStorePartialError };
|