1 | import { assertValidationError } from '../errors/utils/assertValidationError.mjs';
|
2 | import { StorageValidationErrorCode } from '../errors/types/validation.mjs';
|
3 |
|
4 |
|
5 |
|
6 | const resolvePrefix = ({ accessLevel, targetIdentityId, }) => {
|
7 | if (accessLevel === 'private') {
|
8 | assertValidationError(!!targetIdentityId, StorageValidationErrorCode.NoIdentityId);
|
9 | return `private/${targetIdentityId}/`;
|
10 | }
|
11 | else if (accessLevel === 'protected') {
|
12 | assertValidationError(!!targetIdentityId, StorageValidationErrorCode.NoIdentityId);
|
13 | return `protected/${targetIdentityId}/`;
|
14 | }
|
15 | else {
|
16 | return 'public/';
|
17 | }
|
18 | };
|
19 |
|
20 | export { resolvePrefix };
|
21 |
|