@keetanetwork/anchor 0.0.39 → 0.0.41

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 (95) hide show
  1. package/client/index.d.ts +6 -0
  2. package/client/index.d.ts.map +1 -1
  3. package/client/index.js +7 -0
  4. package/client/index.js.map +1 -1
  5. package/lib/block-listener.d.ts +93 -0
  6. package/lib/block-listener.d.ts.map +1 -0
  7. package/lib/block-listener.js +259 -0
  8. package/lib/block-listener.js.map +1 -0
  9. package/lib/error.d.ts.map +1 -1
  10. package/lib/error.js +3 -1
  11. package/lib/error.js.map +1 -1
  12. package/lib/http-server/index.d.ts +14 -1
  13. package/lib/http-server/index.d.ts.map +1 -1
  14. package/lib/http-server/index.js +86 -7
  15. package/lib/http-server/index.js.map +1 -1
  16. package/lib/queue/index.d.ts +20 -5
  17. package/lib/queue/index.d.ts.map +1 -1
  18. package/lib/queue/index.js +52 -17
  19. package/lib/queue/index.js.map +1 -1
  20. package/lib/resolver.d.ts +57 -0
  21. package/lib/resolver.d.ts.map +1 -1
  22. package/lib/resolver.js +864 -250
  23. package/lib/resolver.js.map +1 -1
  24. package/npm-shrinkwrap.json +4 -4
  25. package/package.json +1 -1
  26. package/services/asset-movement/client.d.ts +9 -2
  27. package/services/asset-movement/client.d.ts.map +1 -1
  28. package/services/asset-movement/client.js +35 -2
  29. package/services/asset-movement/client.js.map +1 -1
  30. package/services/asset-movement/common.d.ts +1 -0
  31. package/services/asset-movement/common.d.ts.map +1 -1
  32. package/services/asset-movement/common.js +75 -0
  33. package/services/asset-movement/common.js.map +1 -1
  34. package/services/asset-movement/server.d.ts +0 -10
  35. package/services/asset-movement/server.d.ts.map +1 -1
  36. package/services/asset-movement/server.js +0 -2
  37. package/services/asset-movement/server.js.map +1 -1
  38. package/services/fx/common.d.ts +1 -1
  39. package/services/fx/common.js.map +1 -1
  40. package/services/fx/server.d.ts +37 -6
  41. package/services/fx/server.d.ts.map +1 -1
  42. package/services/fx/server.js +207 -66
  43. package/services/fx/server.js.map +1 -1
  44. package/services/storage/client.d.ts +332 -0
  45. package/services/storage/client.d.ts.map +1 -0
  46. package/services/storage/client.js +1078 -0
  47. package/services/storage/client.js.map +1 -0
  48. package/services/storage/clients/contacts.d.ts +94 -0
  49. package/services/storage/clients/contacts.d.ts.map +1 -0
  50. package/services/storage/clients/contacts.generated.d.ts +3 -0
  51. package/services/storage/clients/contacts.generated.d.ts.map +1 -0
  52. package/services/storage/clients/contacts.generated.js +1197 -0
  53. package/services/storage/clients/contacts.generated.js.map +1 -0
  54. package/services/storage/clients/contacts.js +141 -0
  55. package/services/storage/clients/contacts.js.map +1 -0
  56. package/services/storage/common.d.ts +667 -0
  57. package/services/storage/common.d.ts.map +1 -0
  58. package/services/storage/common.generated.d.ts +17 -0
  59. package/services/storage/common.generated.d.ts.map +1 -0
  60. package/services/storage/common.generated.js +863 -0
  61. package/services/storage/common.generated.js.map +1 -0
  62. package/services/storage/common.js +587 -0
  63. package/services/storage/common.js.map +1 -0
  64. package/services/storage/lib/validators.d.ts +64 -0
  65. package/services/storage/lib/validators.d.ts.map +1 -0
  66. package/services/storage/lib/validators.js +82 -0
  67. package/services/storage/lib/validators.js.map +1 -0
  68. package/services/storage/server.d.ts +127 -0
  69. package/services/storage/server.d.ts.map +1 -0
  70. package/services/storage/server.js +626 -0
  71. package/services/storage/server.js.map +1 -0
  72. package/services/storage/test-utils.d.ts +70 -0
  73. package/services/storage/test-utils.d.ts.map +1 -0
  74. package/services/storage/test-utils.js +347 -0
  75. package/services/storage/test-utils.js.map +1 -0
  76. package/services/storage/utils.d.ts +3 -0
  77. package/services/storage/utils.d.ts.map +1 -0
  78. package/services/storage/utils.js +10 -0
  79. package/services/storage/utils.js.map +1 -0
  80. package/services/username/client.d.ts +145 -0
  81. package/services/username/client.d.ts.map +1 -0
  82. package/services/username/client.js +681 -0
  83. package/services/username/client.js.map +1 -0
  84. package/services/username/common.d.ts +136 -0
  85. package/services/username/common.d.ts.map +1 -0
  86. package/services/username/common.generated.d.ts +13 -0
  87. package/services/username/common.generated.d.ts.map +1 -0
  88. package/services/username/common.generated.js +256 -0
  89. package/services/username/common.generated.js.map +1 -0
  90. package/services/username/common.js +226 -0
  91. package/services/username/common.js.map +1 -0
  92. package/services/username/server.d.ts +49 -0
  93. package/services/username/server.d.ts.map +1 -0
  94. package/services/username/server.js +262 -0
  95. package/services/username/server.js.map +1 -0
@@ -0,0 +1,667 @@
1
+ import type { lib as KeetaNetLib } from '@keetanetwork/keetanet-client';
2
+ import type { HTTPSignedField } from '../../lib/http-server/common.js';
3
+ import type { Signable } from '../../lib/utils/signing.js';
4
+ import { KeetaAnchorUserError, KeetaAnchorUserValidationError } from '../../lib/error.js';
5
+ import { Buffer } from '../../lib/utils/buffer.js';
6
+ /**
7
+ * Type alias for a KeetaNet Account instance.
8
+ * Used throughout the storage service for account authentication and signing.
9
+ */
10
+ export type KeetaNetAccount = InstanceType<typeof KeetaNetLib.Account>;
11
+ /** Content type for JSON payloads */
12
+ export declare const CONTENT_TYPE_JSON = "application/json";
13
+ /** Content type for binary/octet-stream payloads */
14
+ export declare const CONTENT_TYPE_OCTET_STREAM = "application/octet-stream";
15
+ /** Default TTL for signed URLs in seconds (1 hour) */
16
+ export declare const DEFAULT_SIGNED_URL_TTL_SECONDS = 3600;
17
+ /**
18
+ * Visibility of a storage object
19
+ */
20
+ export type StorageObjectVisibility = 'public' | 'private';
21
+ /**
22
+ * Metadata for a stored object
23
+ */
24
+ export type StorageObjectMetadata = {
25
+ /**
26
+ * Full path (the unique ID)
27
+ */
28
+ path: string;
29
+ /**
30
+ * Owner's identifier
31
+ */
32
+ owner: string;
33
+ /**
34
+ * Plaintext tags (searchable)
35
+ */
36
+ tags: string[];
37
+ /**
38
+ * Visibility setting
39
+ */
40
+ visibility: StorageObjectVisibility;
41
+ /**
42
+ * Size in bytes
43
+ */
44
+ size: number;
45
+ /**
46
+ * ISO timestamp of creation
47
+ */
48
+ createdAt: string;
49
+ /**
50
+ * ISO timestamp of last update
51
+ */
52
+ updatedAt?: string;
53
+ };
54
+ /**
55
+ * Criteria for searching storage objects.
56
+ * Note: Content/keyword search is not supported (content is encrypted).
57
+ */
58
+ export type SearchCriteria = {
59
+ /**
60
+ * Match objects with paths starting with this prefix
61
+ * e.g., "/user/keeta1abc.../contacts/"
62
+ */
63
+ pathPrefix?: string;
64
+ /**
65
+ * Match objects that have ANY of these tags
66
+ */
67
+ tags?: string[];
68
+ /**
69
+ * Match path segment (filename portion)
70
+ */
71
+ name?: string;
72
+ /**
73
+ * Filter by owner's public key
74
+ */
75
+ owner?: string;
76
+ /**
77
+ * Include objects in nested paths (default: false)
78
+ */
79
+ recursive?: boolean;
80
+ /**
81
+ * Filter by visibility.
82
+ * When 'public', allows searching public objects outside caller's namespace.
83
+ */
84
+ visibility?: StorageObjectVisibility;
85
+ };
86
+ /**
87
+ * Pagination options for search
88
+ */
89
+ export type SearchPagination = {
90
+ /**
91
+ * Cursor for pagination (from previous response)
92
+ */
93
+ cursor?: string;
94
+ /**
95
+ * Maximum number of results to return
96
+ */
97
+ limit?: number;
98
+ };
99
+ /**
100
+ * Search results with pagination
101
+ */
102
+ export type SearchResults = {
103
+ /**
104
+ * Matching objects
105
+ */
106
+ results: StorageObjectMetadata[];
107
+ /**
108
+ * Cursor for next page (undefined if no more results)
109
+ */
110
+ nextCursor?: string;
111
+ };
112
+ /**
113
+ * Quota configuration for the storage service
114
+ */
115
+ export type QuotaConfig = {
116
+ /**
117
+ * Maximum size in bytes per object
118
+ */
119
+ maxObjectSize: number;
120
+ /**
121
+ * Maximum number of objects per user
122
+ */
123
+ maxObjectsPerUser: number;
124
+ /**
125
+ * Maximum total storage in bytes per user
126
+ */
127
+ maxStoragePerUser: number;
128
+ /**
129
+ * Maximum number of results per search request
130
+ */
131
+ maxSearchLimit: number;
132
+ /**
133
+ * Maximum TTL in seconds for signed URLs
134
+ */
135
+ maxSignedUrlTTL: number;
136
+ };
137
+ /**
138
+ * Per-user quota limits.
139
+ * Subset of QuotaConfig that can be overridden on a per-user basis.
140
+ */
141
+ export type QuotaLimits = Pick<QuotaConfig, 'maxObjectsPerUser' | 'maxStoragePerUser' | 'maxObjectSize'>;
142
+ /**
143
+ * Current quota status for a user.
144
+ * Backends must provide objectCount and totalSize.
145
+ */
146
+ export type QuotaStatus = {
147
+ /**
148
+ * Current number of objects
149
+ */
150
+ objectCount: number;
151
+ /**
152
+ * Current total size in bytes
153
+ */
154
+ totalSize: number;
155
+ /**
156
+ * Remaining objects allowed (optional, server computes if absent)
157
+ */
158
+ remainingObjects?: number;
159
+ /**
160
+ * Remaining storage in bytes (optional, server computes if absent)
161
+ */
162
+ remainingSize?: number;
163
+ };
164
+ /**
165
+ * Client-side request to put (create/update) an object
166
+ */
167
+ export type KeetaStorageAnchorPutClientRequest = {
168
+ account?: KeetaNetAccount;
169
+ path: string;
170
+ data: string;
171
+ tags?: string[];
172
+ visibility?: StorageObjectVisibility;
173
+ };
174
+ /**
175
+ * Server-side request to put an object
176
+ */
177
+ export type KeetaStorageAnchorPutRequest = {
178
+ account?: string;
179
+ signed?: HTTPSignedField;
180
+ path: string;
181
+ data: string;
182
+ tags?: string[];
183
+ visibility?: StorageObjectVisibility;
184
+ };
185
+ /**
186
+ * Configuration for a contacts client.
187
+ * Contacts are stored in a subdirectory of the account's working directory.
188
+ */
189
+ export type ContactsClientConfig = {
190
+ /**
191
+ * The account to use for the contacts client.
192
+ */
193
+ account: KeetaNetAccount;
194
+ /**
195
+ * The base path for the contacts client.
196
+ */
197
+ basePath: string;
198
+ };
199
+ /**
200
+ * Generic response type for storage operations.
201
+ */
202
+ export type StorageResponse<T> = ({
203
+ ok: true;
204
+ } & T) | {
205
+ ok: false;
206
+ error: string;
207
+ };
208
+ export type KeetaStorageAnchorPutResponse = StorageResponse<{
209
+ object: StorageObjectMetadata;
210
+ }>;
211
+ export declare function getKeetaStorageAnchorPutRequestSigningData(input: {
212
+ path: string;
213
+ visibility?: StorageObjectVisibility;
214
+ tags?: string[];
215
+ }): Signable;
216
+ /**
217
+ * Client-side request to get an object
218
+ */
219
+ export type KeetaStorageAnchorGetClientRequest = {
220
+ account?: KeetaNetAccount;
221
+ path: string;
222
+ };
223
+ /**
224
+ * Server-side request to get an object
225
+ */
226
+ export type KeetaStorageAnchorGetRequest = {
227
+ account?: string;
228
+ signed?: HTTPSignedField;
229
+ path: string;
230
+ };
231
+ export type KeetaStorageAnchorGetResponse = StorageResponse<{
232
+ data: string;
233
+ object: StorageObjectMetadata;
234
+ }>;
235
+ export declare function getKeetaStorageAnchorGetRequestSigningData(input: KeetaStorageAnchorGetRequest): Signable;
236
+ /**
237
+ * Client-side request to delete an object
238
+ */
239
+ export type KeetaStorageAnchorDeleteClientRequest = {
240
+ account?: KeetaNetAccount;
241
+ /**
242
+ * Path to the object
243
+ */
244
+ path: string;
245
+ };
246
+ /**
247
+ * Server-side request to delete an object
248
+ */
249
+ export type KeetaStorageAnchorDeleteRequest = {
250
+ account?: string;
251
+ signed?: HTTPSignedField;
252
+ /**
253
+ * Path to the object
254
+ */
255
+ path: string;
256
+ };
257
+ export type KeetaStorageAnchorDeleteResponse = StorageResponse<{
258
+ deleted: boolean;
259
+ }>;
260
+ export declare function getKeetaStorageAnchorDeleteRequestSigningData(input: KeetaStorageAnchorDeleteRequest): Signable;
261
+ /**
262
+ * Client-side request to search objects
263
+ */
264
+ export type KeetaStorageAnchorSearchClientRequest = {
265
+ account?: KeetaNetAccount;
266
+ criteria: SearchCriteria;
267
+ pagination?: SearchPagination;
268
+ };
269
+ /**
270
+ * Server-side request to search objects
271
+ */
272
+ export type KeetaStorageAnchorSearchRequest = {
273
+ account?: string;
274
+ signed?: HTTPSignedField;
275
+ criteria: SearchCriteria;
276
+ pagination?: SearchPagination;
277
+ };
278
+ export type KeetaStorageAnchorSearchResponse = StorageResponse<{
279
+ results: StorageObjectMetadata[];
280
+ nextCursor?: string;
281
+ }>;
282
+ export declare function getKeetaStorageAnchorSearchRequestSigningData(input: KeetaStorageAnchorSearchRequest): Signable;
283
+ /**
284
+ * Client-side request to get quota status
285
+ */
286
+ export type KeetaStorageAnchorQuotaClientRequest = {
287
+ account?: KeetaNetAccount;
288
+ };
289
+ /**
290
+ * Server-side request to get quota status
291
+ */
292
+ export type KeetaStorageAnchorQuotaRequest = {
293
+ account?: string;
294
+ signed?: HTTPSignedField;
295
+ };
296
+ export type KeetaStorageAnchorQuotaResponse = StorageResponse<{
297
+ quota: QuotaStatus;
298
+ }>;
299
+ /**
300
+ * Get signing data for quota requests.
301
+ * The input is unused because quota requests don't need request-specific signing -
302
+ * authentication alone is sufficient.
303
+ *
304
+ * The parameter was kept for API consistency with other signing functions.
305
+ */
306
+ export declare function getKeetaStorageAnchorQuotaRequestSigningData(_ignoreInput: KeetaStorageAnchorQuotaRequest): Signable;
307
+ declare class KeetaStorageAnchorDocumentNotFoundError extends KeetaAnchorUserError {
308
+ static readonly name: string;
309
+ private readonly KeetaStorageAnchorDocumentNotFoundErrorObjectTypeID;
310
+ private static readonly KeetaStorageAnchorDocumentNotFoundErrorObjectTypeID;
311
+ constructor(message?: string);
312
+ static isInstance(input: unknown): input is KeetaStorageAnchorDocumentNotFoundError;
313
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorDocumentNotFoundError>;
314
+ }
315
+ declare class KeetaStorageAnchorAccessDeniedError extends KeetaAnchorUserError {
316
+ static readonly name: string;
317
+ private readonly KeetaStorageAnchorAccessDeniedErrorObjectTypeID;
318
+ private static readonly KeetaStorageAnchorAccessDeniedErrorObjectTypeID;
319
+ constructor(message?: string);
320
+ static isInstance(input: unknown): input is KeetaStorageAnchorAccessDeniedError;
321
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorAccessDeniedError>;
322
+ }
323
+ declare class KeetaStorageAnchorInvalidPathError extends KeetaAnchorUserValidationError {
324
+ static readonly name: string;
325
+ private readonly KeetaStorageAnchorInvalidPathErrorObjectTypeID;
326
+ private static readonly KeetaStorageAnchorInvalidPathErrorObjectTypeID;
327
+ constructor(message?: string);
328
+ static isInstance(input: unknown): input is KeetaStorageAnchorInvalidPathError;
329
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorInvalidPathError>;
330
+ }
331
+ type QuotaExceededType = 'maxObjectSize' | 'maxObjectsPerUser' | 'maxStoragePerUser';
332
+ declare class KeetaStorageAnchorQuotaExceededError extends KeetaAnchorUserError {
333
+ static readonly name: string;
334
+ private readonly KeetaStorageAnchorQuotaExceededErrorObjectTypeID;
335
+ private static readonly KeetaStorageAnchorQuotaExceededErrorObjectTypeID;
336
+ /** Which quota limit was exceeded */
337
+ readonly quotaType: QuotaExceededType;
338
+ /** The configured maximum for the exceeded quota */
339
+ readonly limit: number;
340
+ /** The current or attempted value that exceeded the limit */
341
+ readonly current: number;
342
+ constructor(options: {
343
+ quotaType: QuotaExceededType;
344
+ limit: number;
345
+ current: number;
346
+ message?: string;
347
+ });
348
+ static isInstance(input: unknown): input is KeetaStorageAnchorQuotaExceededError;
349
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorQuotaExceededError>;
350
+ }
351
+ declare class KeetaStorageAnchorPrincipalRequiredError extends KeetaAnchorUserError {
352
+ static readonly name: string;
353
+ private readonly KeetaStorageAnchorPrincipalRequiredErrorObjectTypeID;
354
+ private static readonly KeetaStorageAnchorPrincipalRequiredErrorObjectTypeID;
355
+ constructor(message?: string);
356
+ static isInstance(input: unknown): input is KeetaStorageAnchorPrincipalRequiredError;
357
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorPrincipalRequiredError>;
358
+ }
359
+ declare class KeetaStorageAnchorValidationFailedError extends KeetaAnchorUserValidationError {
360
+ static readonly name: string;
361
+ private readonly KeetaStorageAnchorValidationFailedErrorObjectTypeID;
362
+ private static readonly KeetaStorageAnchorValidationFailedErrorObjectTypeID;
363
+ constructor(message?: string);
364
+ get statusCode(): number;
365
+ static isInstance(input: unknown): input is KeetaStorageAnchorValidationFailedError;
366
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorValidationFailedError>;
367
+ }
368
+ declare class KeetaStorageAnchorSignatureExpiredError extends KeetaAnchorUserError {
369
+ static readonly name: string;
370
+ private readonly KeetaStorageAnchorSignatureExpiredErrorObjectTypeID;
371
+ private static readonly KeetaStorageAnchorSignatureExpiredErrorObjectTypeID;
372
+ constructor(message?: string);
373
+ static isInstance(input: unknown): input is KeetaStorageAnchorSignatureExpiredError;
374
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorSignatureExpiredError>;
375
+ }
376
+ declare class KeetaStorageAnchorSignatureInvalidError extends KeetaAnchorUserError {
377
+ static readonly name: string;
378
+ private readonly KeetaStorageAnchorSignatureInvalidErrorObjectTypeID;
379
+ private static readonly KeetaStorageAnchorSignatureInvalidErrorObjectTypeID;
380
+ constructor(message?: string);
381
+ static isInstance(input: unknown): input is KeetaStorageAnchorSignatureInvalidError;
382
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorSignatureInvalidError>;
383
+ }
384
+ declare class KeetaStorageAnchorPrivateKeyRequiredError extends KeetaAnchorUserError {
385
+ static readonly name: string;
386
+ private readonly KeetaStorageAnchorPrivateKeyRequiredErrorObjectTypeID;
387
+ private static readonly KeetaStorageAnchorPrivateKeyRequiredErrorObjectTypeID;
388
+ constructor(message?: string);
389
+ static isInstance(input: unknown): input is KeetaStorageAnchorPrivateKeyRequiredError;
390
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorPrivateKeyRequiredError>;
391
+ }
392
+ declare class KeetaStorageAnchorServiceUnavailableError extends KeetaAnchorUserError {
393
+ static readonly name: string;
394
+ private readonly KeetaStorageAnchorServiceUnavailableErrorObjectTypeID;
395
+ private static readonly KeetaStorageAnchorServiceUnavailableErrorObjectTypeID;
396
+ constructor(message?: string);
397
+ static isInstance(input: unknown): input is KeetaStorageAnchorServiceUnavailableError;
398
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorServiceUnavailableError>;
399
+ }
400
+ declare class KeetaStorageAnchorSignerRequiredError extends KeetaAnchorUserError {
401
+ static readonly name: string;
402
+ private readonly KeetaStorageAnchorSignerRequiredErrorObjectTypeID;
403
+ private static readonly KeetaStorageAnchorSignerRequiredErrorObjectTypeID;
404
+ constructor(message?: string);
405
+ static isInstance(input: unknown): input is KeetaStorageAnchorSignerRequiredError;
406
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorSignerRequiredError>;
407
+ }
408
+ declare class KeetaStorageAnchorAccountRequiredError extends KeetaAnchorUserError {
409
+ static readonly name: string;
410
+ private readonly KeetaStorageAnchorAccountRequiredErrorObjectTypeID;
411
+ private static readonly KeetaStorageAnchorAccountRequiredErrorObjectTypeID;
412
+ constructor(message?: string);
413
+ static isInstance(input: unknown): input is KeetaStorageAnchorAccountRequiredError;
414
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorAccountRequiredError>;
415
+ }
416
+ declare class KeetaStorageAnchorOperationNotSupportedError extends KeetaAnchorUserError {
417
+ static readonly name: string;
418
+ private readonly KeetaStorageAnchorOperationNotSupportedErrorObjectTypeID;
419
+ private static readonly KeetaStorageAnchorOperationNotSupportedErrorObjectTypeID;
420
+ constructor(operation?: string);
421
+ static isInstance(input: unknown): input is KeetaStorageAnchorOperationNotSupportedError;
422
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorOperationNotSupportedError>;
423
+ }
424
+ declare class KeetaStorageAnchorUnsupportedAuthMethodError extends KeetaAnchorUserError {
425
+ static readonly name: string;
426
+ private readonly KeetaStorageAnchorUnsupportedAuthMethodErrorObjectTypeID;
427
+ private static readonly KeetaStorageAnchorUnsupportedAuthMethodErrorObjectTypeID;
428
+ constructor(method?: string);
429
+ static isInstance(input: unknown): input is KeetaStorageAnchorUnsupportedAuthMethodError;
430
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorUnsupportedAuthMethodError>;
431
+ }
432
+ declare class KeetaStorageAnchorInvalidResponseError extends KeetaAnchorUserError {
433
+ static readonly name: string;
434
+ private readonly KeetaStorageAnchorInvalidResponseErrorObjectTypeID;
435
+ private static readonly KeetaStorageAnchorInvalidResponseErrorObjectTypeID;
436
+ constructor(details?: string);
437
+ static isInstance(input: unknown): input is KeetaStorageAnchorInvalidResponseError;
438
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorInvalidResponseError>;
439
+ }
440
+ declare class KeetaStorageAnchorInvalidAnchorAccountError extends KeetaAnchorUserError {
441
+ static readonly name: string;
442
+ private readonly KeetaStorageAnchorInvalidAnchorAccountErrorObjectTypeID;
443
+ private static readonly KeetaStorageAnchorInvalidAnchorAccountErrorObjectTypeID;
444
+ constructor(publicKey?: string);
445
+ static isInstance(input: unknown): input is KeetaStorageAnchorInvalidAnchorAccountError;
446
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorInvalidAnchorAccountError>;
447
+ }
448
+ declare class KeetaStorageAnchorInvariantViolationError extends KeetaAnchorUserError {
449
+ static readonly name: string;
450
+ private readonly KeetaStorageAnchorInvariantViolationErrorObjectTypeID;
451
+ private static readonly KeetaStorageAnchorInvariantViolationErrorObjectTypeID;
452
+ constructor(message?: string);
453
+ static isInstance(input: unknown): input is KeetaStorageAnchorInvariantViolationError;
454
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorInvariantViolationError>;
455
+ }
456
+ declare class KeetaStorageAnchorInvalidTagError extends KeetaAnchorUserValidationError {
457
+ static readonly name: string;
458
+ private readonly KeetaStorageAnchorInvalidTagErrorObjectTypeID;
459
+ private static readonly KeetaStorageAnchorInvalidTagErrorObjectTypeID;
460
+ constructor(message?: string);
461
+ static isInstance(input: unknown): input is KeetaStorageAnchorInvalidTagError;
462
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorInvalidTagError>;
463
+ }
464
+ declare class KeetaStorageAnchorInvalidMetadataError extends KeetaAnchorUserValidationError {
465
+ static readonly name: string;
466
+ private readonly KeetaStorageAnchorInvalidMetadataErrorObjectTypeID;
467
+ private static readonly KeetaStorageAnchorInvalidMetadataErrorObjectTypeID;
468
+ constructor(reason?: string);
469
+ static isInstance(input: unknown): input is KeetaStorageAnchorInvalidMetadataError;
470
+ static fromJSON(input: unknown): Promise<KeetaStorageAnchorInvalidMetadataError>;
471
+ }
472
+ export declare const Errors: {
473
+ DocumentNotFound: typeof KeetaStorageAnchorDocumentNotFoundError;
474
+ AccessDenied: typeof KeetaStorageAnchorAccessDeniedError;
475
+ InvalidPath: typeof KeetaStorageAnchorInvalidPathError;
476
+ QuotaExceeded: typeof KeetaStorageAnchorQuotaExceededError;
477
+ AnchorPrincipalRequired: typeof KeetaStorageAnchorPrincipalRequiredError;
478
+ ValidationFailed: typeof KeetaStorageAnchorValidationFailedError;
479
+ SignatureExpired: typeof KeetaStorageAnchorSignatureExpiredError;
480
+ SignatureInvalid: typeof KeetaStorageAnchorSignatureInvalidError;
481
+ PrivateKeyRequired: typeof KeetaStorageAnchorPrivateKeyRequiredError;
482
+ ServiceUnavailable: typeof KeetaStorageAnchorServiceUnavailableError;
483
+ SignerRequired: typeof KeetaStorageAnchorSignerRequiredError;
484
+ AccountRequired: typeof KeetaStorageAnchorAccountRequiredError;
485
+ OperationNotSupported: typeof KeetaStorageAnchorOperationNotSupportedError;
486
+ UnsupportedAuthMethod: typeof KeetaStorageAnchorUnsupportedAuthMethodError;
487
+ InvalidResponse: typeof KeetaStorageAnchorInvalidResponseError;
488
+ InvalidAnchorAccount: typeof KeetaStorageAnchorInvalidAnchorAccountError;
489
+ InvariantViolation: typeof KeetaStorageAnchorInvariantViolationError;
490
+ InvalidTag: typeof KeetaStorageAnchorInvalidTagError;
491
+ InvalidMetadata: typeof KeetaStorageAnchorInvalidMetadataError;
492
+ };
493
+ /**
494
+ * Metadata input for put operations.
495
+ * Provided by the client when storing an object.
496
+ */
497
+ export type StoragePutMetadata = {
498
+ /** Owner's identifier */
499
+ owner: string;
500
+ /** Tags for categorization and search */
501
+ tags: string[];
502
+ /** Access visibility setting */
503
+ visibility: StorageObjectVisibility;
504
+ };
505
+ /**
506
+ * Result of a get operation.
507
+ * Contains both the raw encrypted data and the object metadata.
508
+ */
509
+ export type StorageGetResult = {
510
+ /** Raw encrypted data (EncryptedContainer) */
511
+ data: Buffer;
512
+ /** Object metadata */
513
+ metadata: StorageObjectMetadata;
514
+ };
515
+ /**
516
+ * Represents a pending upload quota reservation.
517
+ * Used to reserve quota before an upload and track in-flight uploads.
518
+ */
519
+ export interface UploadReservation {
520
+ /** Unique identifier for this reservation */
521
+ id: string;
522
+ /** Owner's identifier */
523
+ owner: string;
524
+ /** Target path for the upload */
525
+ path: string;
526
+ /** Reserved size in bytes */
527
+ size: number;
528
+ /** When the reservation was created */
529
+ createdAt: string;
530
+ /** When the reservation expires - hint for stale cleanup */
531
+ expiresAt: string;
532
+ }
533
+ /**
534
+ * Core CRUD operations for storage.
535
+ * All backends must implement these operations.
536
+ */
537
+ export interface StorageBackend {
538
+ /**
539
+ * Store/update an object at the given path
540
+ */
541
+ put(path: string, data: Buffer, metadata: StoragePutMetadata): Promise<StorageObjectMetadata>;
542
+ /**
543
+ * Retrieve an object by path
544
+ */
545
+ get(path: string): Promise<StorageGetResult | null>;
546
+ /**
547
+ * Delete an object by path
548
+ */
549
+ delete(path: string): Promise<boolean>;
550
+ }
551
+ /**
552
+ * Search capability interface.
553
+ * Optional for backends that don't support indexing (e.g., simple S3-only backends).
554
+ */
555
+ export interface SearchableStorage {
556
+ /**
557
+ * Search for objects matching criteria
558
+ */
559
+ search(criteria: SearchCriteria, pagination: SearchPagination): Promise<SearchResults>;
560
+ }
561
+ /**
562
+ * Quota management with upload reservations.
563
+ * Handles quota tracking and reservation-based upload flow.
564
+ */
565
+ export interface QuotaManagedStorage {
566
+ /**
567
+ * Get quota status for a user.
568
+ * Includes both actual usage and pending reservations.
569
+ */
570
+ getQuotaStatus(owner: string): Promise<QuotaStatus>;
571
+ /**
572
+ * Get per-user quota limits.
573
+ * Return null to use global defaults.
574
+ * @param owner - Owner's identifier
575
+ */
576
+ getQuotaLimits?(owner: string): Promise<QuotaLimits | null>;
577
+ /**
578
+ * Reserve quota for an upcoming upload.
579
+ *
580
+ * @param owner - Owner's identifier
581
+ * @param path - Target path for the upload
582
+ * @param size - Size in bytes to reserve
583
+ * @param options.ttlMs - Optional TTL in milliseconds for the reservation
584
+ * @param options.quotaLimits - Optional quota limits to enforce (overrides backend defaults)
585
+ *
586
+ * @returns Reservation that must be committed or released
587
+ *
588
+ * @throws QuotaExceeded if reservation would exceed limits
589
+ */
590
+ reserveUpload(owner: string, path: string, size: number, options?: {
591
+ ttlMs?: number;
592
+ quotaLimits?: Pick<QuotaConfig, 'maxObjectsPerUser' | 'maxStoragePerUser'>;
593
+ }): Promise<UploadReservation>;
594
+ /**
595
+ * Commit a reservation after successful upload.
596
+ * Call after put() succeeds to finalize the quota usage.
597
+ * @param reservationId - ID of the reservation to commit
598
+ */
599
+ commitUpload(reservationId: string): Promise<void>;
600
+ /**
601
+ * Release a reservation (upload failed or cancelled).
602
+ * Frees the reserved quota.
603
+ * @param reservationId - ID of the reservation to release
604
+ */
605
+ releaseUpload(reservationId: string): Promise<void>;
606
+ }
607
+ /**
608
+ * Full storage backend combining all capabilities.
609
+ * Use this type when a backend supports CRUD, search, and quota management.
610
+ */
611
+ export type FullStorageBackend = StorageBackend & SearchableStorage & QuotaManagedStorage;
612
+ /**
613
+ * Generic interface for path policies.
614
+ * Each implementation defines its own parsed type and access control logic.
615
+ * Storage Anchors are free to implement whatever pathname structure they wish.
616
+ */
617
+ export interface PathPolicy<TPathInfo> {
618
+ /**
619
+ * Parse a path into its components.
620
+ * @returns TPathInfo if valid, null otherwise
621
+ */
622
+ parse(path: string): TPathInfo | null;
623
+ /**
624
+ * Validate a path and return its components.
625
+ * @throws Errors.InvalidPath if the path is invalid
626
+ */
627
+ validate(path: string): TPathInfo;
628
+ /**
629
+ * Check if a path is valid.
630
+ */
631
+ isValid(path: string): boolean;
632
+ /**
633
+ * Check if the account has access to perform the operation on the parsed path.
634
+ * @returns true if access is allowed, false otherwise
635
+ */
636
+ checkAccess(account: KeetaNetAccount, parsed: TPathInfo, operation: 'get' | 'put' | 'delete' | 'search' | 'metadata'): boolean;
637
+ /**
638
+ * Get the account authorized to sign pre-signed URLs for this path.
639
+ * Used for public object access verification.
640
+ *
641
+ * @returns The account if only that account can sign (owner-restricted), or `null` if any account can sign
642
+ */
643
+ getAuthorizedSigner(parsed: TPathInfo): KeetaNetAccount | null;
644
+ /**
645
+ * Validate metadata for a path.
646
+ * Called during PUT and metadata update operations.
647
+ * @param parsed - The parsed path info
648
+ * @param metadata - The metadata to validate
649
+ * @throws Errors.InvalidMetadata if metadata violates path constraints
650
+ */
651
+ validateMetadata?(parsed: TPathInfo, metadata: StoragePutMetadata): void;
652
+ }
653
+ /**
654
+ * Parse the decrypted plaintext from an EncryptedContainer.
655
+ * The payload is expected to be JSON with mimeType and base64-encoded data,
656
+ * keeping the mimeType encrypted along with the content.
657
+ *
658
+ * @param plaintext - The decrypted plaintext from an EncryptedContainer
659
+ *
660
+ * @returns Object containing mimeType and content Buffer
661
+ */
662
+ export declare function parseContainerPayload(plaintext: ArrayBuffer): {
663
+ mimeType: string;
664
+ content: Buffer;
665
+ };
666
+ export {};
667
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/services/storage/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,IAAI,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAE,MAAM,EAA2B,MAAM,2BAA2B,CAAC;AAE5E;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;AAIvE,qCAAqC;AACrC,eAAO,MAAM,iB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