@originals/sdk 1.1.0 → 1.4.2
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/package.json +3 -2
- package/src/did/DIDManager.ts +1 -1
- package/src/did/WebVHManager.ts +11 -2
- package/src/examples/create-module-original.ts +435 -0
- package/src/examples/full-lifecycle-flow.ts +514 -0
- package/src/examples/run.ts +59 -4
- package/src/index.ts +69 -3
- package/src/kinds/KindRegistry.ts +290 -0
- package/src/kinds/index.ts +74 -0
- package/src/kinds/types.ts +470 -0
- package/src/kinds/validators/AgentValidator.ts +257 -0
- package/src/kinds/validators/AppValidator.ts +211 -0
- package/src/kinds/validators/DatasetValidator.ts +242 -0
- package/src/kinds/validators/DocumentValidator.ts +311 -0
- package/src/kinds/validators/MediaValidator.ts +269 -0
- package/src/kinds/validators/ModuleValidator.ts +225 -0
- package/src/kinds/validators/base.ts +276 -0
- package/src/kinds/validators/index.ts +12 -0
- package/src/lifecycle/LifecycleManager.ts +909 -1
- package/src/resources/ResourceManager.ts +655 -0
- package/src/resources/index.ts +21 -0
- package/src/resources/types.ts +202 -0
- package/src/types/common.ts +1 -1
- package/src/vc/CredentialManager.ts +647 -2
- package/tests/integration/createTypedOriginal.test.ts +379 -0
- package/tests/performance/BatchOperations.perf.test.ts +2 -2
- package/tests/unit/kinds/KindRegistry.test.ts +329 -0
- package/tests/unit/kinds/types.test.ts +409 -0
- package/tests/unit/kinds/validators.test.ts +651 -0
- package/tests/unit/lifecycle/LifecycleManager.cleanapi.test.ts +441 -0
- package/tests/unit/resources/ResourceManager.test.ts +740 -0
- package/tests/unit/vc/CredentialManager.helpers.test.ts +527 -0
- package/tsconfig.json +0 -1
- package/.turbo/turbo-build.log +0 -1
- package/.turbo/turbo-test.log +0 -68353
- package/dist/adapters/FeeOracleMock.d.ts +0 -6
- package/dist/adapters/FeeOracleMock.js +0 -8
- package/dist/adapters/index.d.ts +0 -4
- package/dist/adapters/index.js +0 -4
- package/dist/adapters/providers/OrdHttpProvider.d.ts +0 -56
- package/dist/adapters/providers/OrdHttpProvider.js +0 -110
- package/dist/adapters/providers/OrdMockProvider.d.ts +0 -70
- package/dist/adapters/providers/OrdMockProvider.js +0 -75
- package/dist/adapters/types.d.ts +0 -71
- package/dist/adapters/types.js +0 -1
- package/dist/bitcoin/BitcoinManager.d.ts +0 -15
- package/dist/bitcoin/BitcoinManager.js +0 -262
- package/dist/bitcoin/BroadcastClient.d.ts +0 -30
- package/dist/bitcoin/BroadcastClient.js +0 -35
- package/dist/bitcoin/OrdinalsClient.d.ts +0 -21
- package/dist/bitcoin/OrdinalsClient.js +0 -105
- package/dist/bitcoin/PSBTBuilder.d.ts +0 -24
- package/dist/bitcoin/PSBTBuilder.js +0 -80
- package/dist/bitcoin/fee-calculation.d.ts +0 -14
- package/dist/bitcoin/fee-calculation.js +0 -31
- package/dist/bitcoin/providers/OrdNodeProvider.d.ts +0 -38
- package/dist/bitcoin/providers/OrdNodeProvider.js +0 -67
- package/dist/bitcoin/providers/OrdinalsProvider.d.ts +0 -33
- package/dist/bitcoin/providers/OrdinalsProvider.js +0 -50
- package/dist/bitcoin/providers/types.d.ts +0 -63
- package/dist/bitcoin/providers/types.js +0 -1
- package/dist/bitcoin/transactions/commit.d.ts +0 -89
- package/dist/bitcoin/transactions/commit.js +0 -311
- package/dist/bitcoin/transactions/index.d.ts +0 -7
- package/dist/bitcoin/transactions/index.js +0 -8
- package/dist/bitcoin/transfer.d.ts +0 -9
- package/dist/bitcoin/transfer.js +0 -26
- package/dist/bitcoin/utxo-selection.d.ts +0 -78
- package/dist/bitcoin/utxo-selection.js +0 -237
- package/dist/bitcoin/utxo.d.ts +0 -26
- package/dist/bitcoin/utxo.js +0 -78
- package/dist/contexts/credentials-v1.json +0 -195
- package/dist/contexts/credentials-v2-examples.json +0 -5
- package/dist/contexts/credentials-v2.json +0 -301
- package/dist/contexts/credentials.json +0 -195
- package/dist/contexts/data-integrity-v2.json +0 -81
- package/dist/contexts/dids.json +0 -57
- package/dist/contexts/ed255192020.json +0 -93
- package/dist/contexts/ordinals-plus.json +0 -23
- package/dist/contexts/originals.json +0 -22
- package/dist/core/OriginalsSDK.d.ts +0 -158
- package/dist/core/OriginalsSDK.js +0 -274
- package/dist/crypto/Multikey.d.ts +0 -30
- package/dist/crypto/Multikey.js +0 -149
- package/dist/crypto/Signer.d.ts +0 -21
- package/dist/crypto/Signer.js +0 -196
- package/dist/crypto/noble-init.d.ts +0 -18
- package/dist/crypto/noble-init.js +0 -106
- package/dist/did/BtcoDidResolver.d.ts +0 -57
- package/dist/did/BtcoDidResolver.js +0 -166
- package/dist/did/DIDManager.d.ts +0 -101
- package/dist/did/DIDManager.js +0 -493
- package/dist/did/Ed25519Verifier.d.ts +0 -30
- package/dist/did/Ed25519Verifier.js +0 -59
- package/dist/did/KeyManager.d.ts +0 -17
- package/dist/did/KeyManager.js +0 -207
- package/dist/did/WebVHManager.d.ts +0 -100
- package/dist/did/WebVHManager.js +0 -304
- package/dist/did/createBtcoDidDocument.d.ts +0 -10
- package/dist/did/createBtcoDidDocument.js +0 -42
- package/dist/did/providers/OrdinalsClientProviderAdapter.d.ts +0 -23
- package/dist/did/providers/OrdinalsClientProviderAdapter.js +0 -51
- package/dist/events/EventEmitter.d.ts +0 -115
- package/dist/events/EventEmitter.js +0 -198
- package/dist/events/index.d.ts +0 -7
- package/dist/events/index.js +0 -6
- package/dist/events/types.d.ts +0 -286
- package/dist/events/types.js +0 -9
- package/dist/examples/basic-usage.d.ts +0 -3
- package/dist/examples/basic-usage.js +0 -62
- package/dist/examples/run.d.ts +0 -1
- package/dist/examples/run.js +0 -4
- package/dist/index.d.ts +0 -39
- package/dist/index.js +0 -47
- package/dist/lifecycle/BatchOperations.d.ts +0 -147
- package/dist/lifecycle/BatchOperations.js +0 -251
- package/dist/lifecycle/LifecycleManager.d.ts +0 -116
- package/dist/lifecycle/LifecycleManager.js +0 -971
- package/dist/lifecycle/OriginalsAsset.d.ts +0 -164
- package/dist/lifecycle/OriginalsAsset.js +0 -380
- package/dist/lifecycle/ProvenanceQuery.d.ts +0 -126
- package/dist/lifecycle/ProvenanceQuery.js +0 -220
- package/dist/lifecycle/ResourceVersioning.d.ts +0 -73
- package/dist/lifecycle/ResourceVersioning.js +0 -127
- package/dist/migration/MigrationManager.d.ts +0 -86
- package/dist/migration/MigrationManager.js +0 -412
- package/dist/migration/audit/AuditLogger.d.ts +0 -51
- package/dist/migration/audit/AuditLogger.js +0 -156
- package/dist/migration/checkpoint/CheckpointManager.d.ts +0 -31
- package/dist/migration/checkpoint/CheckpointManager.js +0 -96
- package/dist/migration/checkpoint/CheckpointStorage.d.ts +0 -26
- package/dist/migration/checkpoint/CheckpointStorage.js +0 -89
- package/dist/migration/index.d.ts +0 -22
- package/dist/migration/index.js +0 -27
- package/dist/migration/operations/BaseMigration.d.ts +0 -48
- package/dist/migration/operations/BaseMigration.js +0 -83
- package/dist/migration/operations/PeerToBtcoMigration.d.ts +0 -25
- package/dist/migration/operations/PeerToBtcoMigration.js +0 -67
- package/dist/migration/operations/PeerToWebvhMigration.d.ts +0 -19
- package/dist/migration/operations/PeerToWebvhMigration.js +0 -46
- package/dist/migration/operations/WebvhToBtcoMigration.d.ts +0 -25
- package/dist/migration/operations/WebvhToBtcoMigration.js +0 -67
- package/dist/migration/rollback/RollbackManager.d.ts +0 -29
- package/dist/migration/rollback/RollbackManager.js +0 -146
- package/dist/migration/state/StateMachine.d.ts +0 -25
- package/dist/migration/state/StateMachine.js +0 -76
- package/dist/migration/state/StateTracker.d.ts +0 -36
- package/dist/migration/state/StateTracker.js +0 -123
- package/dist/migration/types.d.ts +0 -306
- package/dist/migration/types.js +0 -33
- package/dist/migration/validation/BitcoinValidator.d.ts +0 -13
- package/dist/migration/validation/BitcoinValidator.js +0 -83
- package/dist/migration/validation/CredentialValidator.d.ts +0 -13
- package/dist/migration/validation/CredentialValidator.js +0 -46
- package/dist/migration/validation/DIDCompatibilityValidator.d.ts +0 -16
- package/dist/migration/validation/DIDCompatibilityValidator.js +0 -127
- package/dist/migration/validation/LifecycleValidator.d.ts +0 -10
- package/dist/migration/validation/LifecycleValidator.js +0 -52
- package/dist/migration/validation/StorageValidator.d.ts +0 -10
- package/dist/migration/validation/StorageValidator.js +0 -65
- package/dist/migration/validation/ValidationPipeline.d.ts +0 -29
- package/dist/migration/validation/ValidationPipeline.js +0 -180
- package/dist/storage/LocalStorageAdapter.d.ts +0 -11
- package/dist/storage/LocalStorageAdapter.js +0 -53
- package/dist/storage/MemoryStorageAdapter.d.ts +0 -6
- package/dist/storage/MemoryStorageAdapter.js +0 -21
- package/dist/storage/StorageAdapter.d.ts +0 -16
- package/dist/storage/StorageAdapter.js +0 -1
- package/dist/storage/index.d.ts +0 -2
- package/dist/storage/index.js +0 -2
- package/dist/types/bitcoin.d.ts +0 -84
- package/dist/types/bitcoin.js +0 -1
- package/dist/types/common.d.ts +0 -82
- package/dist/types/common.js +0 -1
- package/dist/types/credentials.d.ts +0 -75
- package/dist/types/credentials.js +0 -1
- package/dist/types/did.d.ts +0 -26
- package/dist/types/did.js +0 -1
- package/dist/types/index.d.ts +0 -5
- package/dist/types/index.js +0 -5
- package/dist/types/network.d.ts +0 -78
- package/dist/types/network.js +0 -145
- package/dist/utils/EventLogger.d.ts +0 -71
- package/dist/utils/EventLogger.js +0 -232
- package/dist/utils/Logger.d.ts +0 -106
- package/dist/utils/Logger.js +0 -257
- package/dist/utils/MetricsCollector.d.ts +0 -110
- package/dist/utils/MetricsCollector.js +0 -264
- package/dist/utils/bitcoin-address.d.ts +0 -38
- package/dist/utils/bitcoin-address.js +0 -113
- package/dist/utils/cbor.d.ts +0 -2
- package/dist/utils/cbor.js +0 -9
- package/dist/utils/encoding.d.ts +0 -37
- package/dist/utils/encoding.js +0 -120
- package/dist/utils/hash.d.ts +0 -1
- package/dist/utils/hash.js +0 -5
- package/dist/utils/retry.d.ts +0 -10
- package/dist/utils/retry.js +0 -35
- package/dist/utils/satoshi-validation.d.ts +0 -60
- package/dist/utils/satoshi-validation.js +0 -156
- package/dist/utils/serialization.d.ts +0 -14
- package/dist/utils/serialization.js +0 -76
- package/dist/utils/telemetry.d.ts +0 -17
- package/dist/utils/telemetry.js +0 -24
- package/dist/utils/validation.d.ts +0 -5
- package/dist/utils/validation.js +0 -98
- package/dist/vc/CredentialManager.d.ts +0 -22
- package/dist/vc/CredentialManager.js +0 -227
- package/dist/vc/Issuer.d.ts +0 -27
- package/dist/vc/Issuer.js +0 -70
- package/dist/vc/Verifier.d.ts +0 -16
- package/dist/vc/Verifier.js +0 -50
- package/dist/vc/cryptosuites/bbs.d.ts +0 -44
- package/dist/vc/cryptosuites/bbs.js +0 -213
- package/dist/vc/cryptosuites/bbsSimple.d.ts +0 -9
- package/dist/vc/cryptosuites/bbsSimple.js +0 -12
- package/dist/vc/cryptosuites/eddsa.d.ts +0 -30
- package/dist/vc/cryptosuites/eddsa.js +0 -81
- package/dist/vc/documentLoader.d.ts +0 -16
- package/dist/vc/documentLoader.js +0 -59
- package/dist/vc/proofs/data-integrity.d.ts +0 -21
- package/dist/vc/proofs/data-integrity.js +0 -15
- package/dist/vc/utils/jsonld.d.ts +0 -2
- package/dist/vc/utils/jsonld.js +0 -15
- package/test/logs/did_webvh_QmQsRNhXxPSCSeLjpbKYcNMZj8b1kBQAoC6cZmkFAgmpHt_example_com.jsonl +0 -1
- package/test/logs/did_webvh_QmSQkpD58qxcqMWHYcEmDUn3wk7hHvJwzYTrZmhh6zjPQ8_example_com_users_alice123_profile.jsonl +0 -1
- package/test/logs/did_webvh_QmTMda6VW3cUPdKk5Yc3onnv1vdgEumvWWdP2noAYFSjeG_example_com.jsonl +0 -1
- package/test/logs/did_webvh_QmTkb8KnCYcsnKKDCY4eUQuKQdKJLrCinvhw13v3zETxpE_example_com_users_etc_passwd.jsonl +0 -1
- package/test/logs/did_webvh_QmTn9FdCfpXFDrxHH52pwB4iNrDFVvNDjJ5FQTcDbmM3Fg_example_com.jsonl +0 -1
- package/test/logs/did_webvh_QmUCQUi1xjtJjnSQ1XJZgKqcWgErx1v7E2dz4DAPraAyJP_example_com_etc_passwd.jsonl +0 -1
- package/test/logs/did_webvh_QmUENQJCDKBJVRS5BkL6zjaUvcRjkb9xHmy7foCgRjmv3W_example_com.jsonl +0 -1
- package/test/logs/did_webvh_QmUPdGyjYBEnQ3aQUkmqyyBKTyjvCP5RZQGiaEDeTtf6dc_example_com.jsonl +0 -1
- package/test/logs/did_webvh_QmUoHTuHMWzQM29ZFrE9VLtMxkZ5u869yqee8LwcCLN39M_example_com.jsonl +0 -1
- package/test/logs/did_webvh_QmUrnms8G65ggVKsr9oQeWrLUBuGChwQPPb2LCFvaoNxaw_example_com_users_alice.jsonl +0 -1
- package/test/logs/did_webvh_QmUwiw3eSXdHG1hPvoAGu3cuK5jF4aXRYDLBAjPXfv1qzb_example_com_level1_level2.jsonl +0 -1
- package/test/logs/did_webvh_QmW7bzKh6yFEKNAtmVsrPGvvsMHTUQdzJSNsTZkbuGFpbj_example_com_secret.jsonl +0 -1
- package/test/logs/did_webvh_QmXbFTFBBJ8zpjdz9WE1DNN44A2wprFmdvAubjSffeyoAG_example_com.jsonl +0 -1
- package/test/logs/did_webvh_QmXyVXFPCTffGb2mTUFDeMCsScjnpLWkyUkVkB6q6QoeBf_example_com_C_Windows_System32.jsonl +0 -1
- package/test/logs/did_webvh_QmZK9B81gxZtvo5fYHYKDtKt8zZfZZPhmCMhbujBJuRRzE_example_com_etc_passwd.jsonl +0 -1
- package/test/logs/did_webvh_QmbNLCVSdXSVLrwFBvCBQPAabjtRb1SGHjkGVyw3QUbfBL_example_com_users_etc_passwd.jsonl +0 -1
- package/test/logs/did_webvh_QmbeaicmGW3Q7Yzbqmftc8a9jLBngokveb5A2KVKfVGZRb_example_com_my_org_user_name_test_123.jsonl +0 -1
- package/test/logs/did_webvh_Qmdv7c7AjUreUfoKyvkN2UpAWTozxKsv99srQetPJMJEnp_example_com_users_etc_passwd.jsonl +0 -1
- package/test/logs/did_webvh_QmeioWY3uypYLkYpCXe9eCYnn4xBVruP9C1d79azMrTEHG_example_com.jsonl +0 -1
- package/test/logs/did_webvh_Qmf4QH5dsA6Ecr5HJ6KaJL9uJRyY8RxrQdqoRCM25DzvPi_example_com_users_alice.jsonl +0 -1
- package/tests/e2e/README.md +0 -97
- package/tests/e2e/example.spec.ts +0 -78
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resource types for the Originals SDK ResourceManager.
|
|
3
|
+
*
|
|
4
|
+
* Resources in the Originals protocol are immutable, content-addressed entities
|
|
5
|
+
* that can be versioned through a linked hash chain.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { AssetResource } from '../types/common';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Supported resource types for categorization
|
|
12
|
+
*/
|
|
13
|
+
export type ResourceType =
|
|
14
|
+
| 'image'
|
|
15
|
+
| 'text'
|
|
16
|
+
| 'code'
|
|
17
|
+
| 'data'
|
|
18
|
+
| 'audio'
|
|
19
|
+
| 'video'
|
|
20
|
+
| 'document'
|
|
21
|
+
| 'binary'
|
|
22
|
+
| 'other';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Options for creating a new resource
|
|
26
|
+
*/
|
|
27
|
+
export interface ResourceOptions {
|
|
28
|
+
/** Logical resource ID (optional - will be generated if not provided) */
|
|
29
|
+
id?: string;
|
|
30
|
+
|
|
31
|
+
/** Resource type category */
|
|
32
|
+
type: ResourceType;
|
|
33
|
+
|
|
34
|
+
/** MIME content type (e.g., 'text/plain', 'image/png') */
|
|
35
|
+
contentType: string;
|
|
36
|
+
|
|
37
|
+
/** Optional URL if resource is externally hosted */
|
|
38
|
+
url?: string;
|
|
39
|
+
|
|
40
|
+
/** Optional description of the resource */
|
|
41
|
+
description?: string;
|
|
42
|
+
|
|
43
|
+
/** Maximum allowed size in bytes (optional, uses default if not specified) */
|
|
44
|
+
maxSize?: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Options for updating an existing resource
|
|
49
|
+
*/
|
|
50
|
+
export interface ResourceUpdateOptions {
|
|
51
|
+
/** New content type (optional - inherits from previous version if not specified) */
|
|
52
|
+
contentType?: string;
|
|
53
|
+
|
|
54
|
+
/** Description of changes made in this version */
|
|
55
|
+
changes?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Result of resource validation
|
|
60
|
+
*/
|
|
61
|
+
export interface ResourceValidationResult {
|
|
62
|
+
/** Whether the resource is valid */
|
|
63
|
+
valid: boolean;
|
|
64
|
+
|
|
65
|
+
/** Array of error messages if validation failed */
|
|
66
|
+
errors: string[];
|
|
67
|
+
|
|
68
|
+
/** Array of warning messages (non-fatal issues) */
|
|
69
|
+
warnings: string[];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* A resource with its content and metadata
|
|
74
|
+
*/
|
|
75
|
+
export interface Resource extends AssetResource {
|
|
76
|
+
/** The actual content (for in-memory resources) */
|
|
77
|
+
content?: string;
|
|
78
|
+
|
|
79
|
+
/** Binary content as base64-encoded string */
|
|
80
|
+
contentBase64?: string;
|
|
81
|
+
|
|
82
|
+
/** Description of the resource */
|
|
83
|
+
description?: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Complete history of a resource including all versions
|
|
88
|
+
*/
|
|
89
|
+
export interface ResourceVersionHistory {
|
|
90
|
+
/** Logical resource ID (stable across all versions) */
|
|
91
|
+
resourceId: string;
|
|
92
|
+
|
|
93
|
+
/** All versions in chronological order (oldest first) */
|
|
94
|
+
versions: Resource[];
|
|
95
|
+
|
|
96
|
+
/** The current (latest) version */
|
|
97
|
+
currentVersion: Resource;
|
|
98
|
+
|
|
99
|
+
/** Total number of versions */
|
|
100
|
+
versionCount: number;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Configuration for the ResourceManager
|
|
105
|
+
*/
|
|
106
|
+
export interface ResourceManagerConfig {
|
|
107
|
+
/** Default maximum resource size in bytes (default: 10MB) */
|
|
108
|
+
defaultMaxSize?: number;
|
|
109
|
+
|
|
110
|
+
/** Whether to store content in memory (default: true) */
|
|
111
|
+
storeContent?: boolean;
|
|
112
|
+
|
|
113
|
+
/** Allowed MIME types (if empty, all types allowed) */
|
|
114
|
+
allowedContentTypes?: string[];
|
|
115
|
+
|
|
116
|
+
/** Whether to enable strict MIME type validation (default: true) */
|
|
117
|
+
strictMimeValidation?: boolean;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Common MIME types and their resource type mappings
|
|
122
|
+
*/
|
|
123
|
+
export const MIME_TYPE_MAP: Record<string, ResourceType> = {
|
|
124
|
+
// Images
|
|
125
|
+
'image/png': 'image',
|
|
126
|
+
'image/jpeg': 'image',
|
|
127
|
+
'image/gif': 'image',
|
|
128
|
+
'image/webp': 'image',
|
|
129
|
+
'image/svg+xml': 'image',
|
|
130
|
+
'image/bmp': 'image',
|
|
131
|
+
'image/tiff': 'image',
|
|
132
|
+
|
|
133
|
+
// Text
|
|
134
|
+
'text/plain': 'text',
|
|
135
|
+
'text/html': 'text',
|
|
136
|
+
'text/css': 'text',
|
|
137
|
+
'text/csv': 'text',
|
|
138
|
+
'text/markdown': 'text',
|
|
139
|
+
|
|
140
|
+
// Code
|
|
141
|
+
'text/javascript': 'code',
|
|
142
|
+
'application/javascript': 'code',
|
|
143
|
+
'text/typescript': 'code',
|
|
144
|
+
'application/typescript': 'code',
|
|
145
|
+
'text/x-python': 'code',
|
|
146
|
+
'application/x-python-code': 'code',
|
|
147
|
+
'text/x-rust': 'code',
|
|
148
|
+
'text/x-go': 'code',
|
|
149
|
+
'text/x-java': 'code',
|
|
150
|
+
'text/x-c': 'code',
|
|
151
|
+
'text/x-cpp': 'code',
|
|
152
|
+
|
|
153
|
+
// Data formats
|
|
154
|
+
'application/json': 'data',
|
|
155
|
+
'application/xml': 'data',
|
|
156
|
+
'text/xml': 'data',
|
|
157
|
+
'application/yaml': 'data',
|
|
158
|
+
'text/yaml': 'data',
|
|
159
|
+
'application/toml': 'data',
|
|
160
|
+
|
|
161
|
+
// Documents
|
|
162
|
+
'application/pdf': 'document',
|
|
163
|
+
'application/msword': 'document',
|
|
164
|
+
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'document',
|
|
165
|
+
'application/vnd.ms-excel': 'document',
|
|
166
|
+
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'document',
|
|
167
|
+
'application/vnd.ms-powerpoint': 'document',
|
|
168
|
+
'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'document',
|
|
169
|
+
|
|
170
|
+
// Audio
|
|
171
|
+
'audio/mpeg': 'audio',
|
|
172
|
+
'audio/mp3': 'audio',
|
|
173
|
+
'audio/wav': 'audio',
|
|
174
|
+
'audio/ogg': 'audio',
|
|
175
|
+
'audio/webm': 'audio',
|
|
176
|
+
'audio/flac': 'audio',
|
|
177
|
+
|
|
178
|
+
// Video
|
|
179
|
+
'video/mp4': 'video',
|
|
180
|
+
'video/webm': 'video',
|
|
181
|
+
'video/ogg': 'video',
|
|
182
|
+
'video/quicktime': 'video',
|
|
183
|
+
'video/x-msvideo': 'video',
|
|
184
|
+
|
|
185
|
+
// Binary
|
|
186
|
+
'application/octet-stream': 'binary',
|
|
187
|
+
'application/zip': 'binary',
|
|
188
|
+
'application/gzip': 'binary',
|
|
189
|
+
'application/x-tar': 'binary',
|
|
190
|
+
'application/wasm': 'binary',
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Default configuration values
|
|
195
|
+
*/
|
|
196
|
+
export const DEFAULT_RESOURCE_CONFIG: Required<ResourceManagerConfig> = {
|
|
197
|
+
defaultMaxSize: 10 * 1024 * 1024, // 10MB
|
|
198
|
+
storeContent: true,
|
|
199
|
+
allowedContentTypes: [],
|
|
200
|
+
strictMimeValidation: true,
|
|
201
|
+
};
|
|
202
|
+
|
package/src/types/common.ts
CHANGED
|
@@ -58,7 +58,7 @@ export interface KeyStore {
|
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* External signer interface for DID operations (compatible with didwebvh-ts)
|
|
61
|
-
* This allows integration with external key management systems like
|
|
61
|
+
* This allows integration with external key management systems like Turnkey
|
|
62
62
|
*/
|
|
63
63
|
export interface ExternalSigner {
|
|
64
64
|
/**
|