-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi.constants.ts
More file actions
68 lines (58 loc) · 2.3 KB
/
Copy pathapi.constants.ts
File metadata and controls
68 lines (58 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
export const MAX_LIMIT = 100;
export const OKAPI_PREFIX = 'okapi';
export const OKAPI_CONFIG = 'okapi_config';
export const EDITOR_API_BASE_PATH = 'EDITOR_API_BASE_PATH';
// API endpoints
export const BIBFRAME_API_ENDPOINT = '/linked-data/resource';
export const INVENTORY_API_ENDPOINT = '/linked-data/inventory-instance';
export const PROFILE_API_ENDPOINT = '/linked-data/profile';
export const PROFILE_METADATA_API_ENDPOINT = '/linked-data/profile/metadata';
export const PROFILE_PREFERRED_API_ENDPOINT = '/linked-data/profile/preferred';
export const PROFILE_SETTINGS_PATH = 'settings';
export const AUTHORITY_ASSIGNMENT_CHECK_API_ENDPOINT = '/linked-data/authority-assignment-check';
export const IMPORT_JSON_FILE_API_ENDPOINT = '/linked-data/import/file';
export const IMPORT_JSON_URL_API_ENDPOINT = '/linked-data/import/url';
export const HUB_IMPORT_API_ENDPOINT = '/linked-data/hub';
export const SEARCH_API_ENDPOINT = {
RESOURCES: '/search/linked-data/works',
AUTHORITIES_SEARCH: '/search/authorities',
AUTHORITIES_BROWSE: '/browse/authorities',
AUTHORITIES_LOCAL: '/search/linked-data/authorities',
HUBS_EXTERNAL: 'https://id.loc.gov/resources/hubs/suggest2/',
HUBS_LOCAL: '/search/linked-data/hubs',
};
export const MARC_PREVIEW_ENDPOINT = {
AUTHORITY: '/source-storage/records/:recordId/formatted?idType=AUTHORITY',
};
export const SOURCE_API_ENDPOINT = {
AUTHORITY: '/authority-source-files',
};
export const SOURCE_API_RESPONSE_KEY = {
AUTHORITY: 'authoritySourceFiles',
};
export const FACETS_API_ENDPOINT = {
AUTHORITY: '/search/authorities/facets',
};
export const DEFAULT_PAGES_METADATA = {
totalElements: 0,
totalPages: 0,
};
export enum ApiErrorCodes {
AlreadyExists = 'already_exists',
RequiredPrimaryMainTitle = 'required_primary_main_title',
LccnDoesNotMatchPattern = 'lccn_does_not_match_pattern',
LccnNotUnique = 'lccn_not_unique',
ProfileSettingsNameNotUnique = 'profile_settings_name_not_unique',
NotBlank = 'must not be blank',
FailedDependency = 'failed_dependency',
NotFound = 'not_found',
Mapping = 'mapping',
GenericBadRequest = 'generic_bad_request',
Server = 'server',
}
export enum ExternalResourceIdType {
Inventory = 'inventory',
}
export const GET_RESOURCE_BY_TYPE_URIS = {
[ExternalResourceIdType.Inventory]: `${INVENTORY_API_ENDPOINT}/:recordId/preview`,
};