2015-06-05 11:06:36 +02:00
|
|
|
'use strict';
|
|
|
|
|
2015-05-29 01:54:56 +02:00
|
|
|
import AppConstants from './application_constants';
|
2015-08-11 14:47:28 +02:00
|
|
|
|
|
|
|
import getPrizeApiUrls from '../components/whitelabel/prize/constants/prize_api_urls';
|
|
|
|
import getWalletApiUrls from '../components/whitelabel/wallet/constants/wallet_api_urls';
|
|
|
|
|
2015-07-14 21:15:10 +02:00
|
|
|
import { update } from '../utils/general_utils';
|
|
|
|
|
2015-05-29 01:54:56 +02:00
|
|
|
|
2015-08-07 15:08:02 +02:00
|
|
|
let ApiUrls = {
|
2015-06-22 17:33:25 +02:00
|
|
|
'applications': AppConstants.apiEndpoint + 'applications/',
|
|
|
|
'application_token_refresh': AppConstants.apiEndpoint + 'applications/refresh_token/',
|
2015-06-23 13:55:05 +02:00
|
|
|
'blob_digitalworks': AppConstants.apiEndpoint + 'blob/digitalworks/',
|
2015-06-29 16:15:41 +02:00
|
|
|
'blob_otherdatas': AppConstants.apiEndpoint + 'blob/otherdatas/',
|
2015-08-31 17:29:43 +02:00
|
|
|
'blob_contracts': AppConstants.apiEndpoint + 'blob/contracts/',
|
2015-11-09 17:52:09 +01:00
|
|
|
'blob_thumbnails': AppConstants.apiEndpoint + 'blob/thumbnails/',
|
2015-06-25 14:39:39 +02:00
|
|
|
'coa': AppConstants.apiEndpoint + 'coa/${id}/',
|
|
|
|
'coa_create': AppConstants.apiEndpoint + 'coa/',
|
|
|
|
'coa_verify': AppConstants.apiEndpoint + 'coa/verify_coa/',
|
2015-06-09 17:53:44 +02:00
|
|
|
'edition': AppConstants.apiEndpoint + 'editions/${bitcoin_id}/',
|
2015-06-16 09:02:48 +02:00
|
|
|
'edition_delete': AppConstants.apiEndpoint + 'editions/${edition_id}/',
|
2015-07-13 14:10:46 +02:00
|
|
|
'edition_remove_from_collection': AppConstants.apiEndpoint + 'ownership/shares/editions/${edition_id}/',
|
2015-07-10 13:54:25 +02:00
|
|
|
'editions': AppConstants.apiEndpoint + 'editions/', // this should be moved to the one below
|
2015-06-16 10:58:41 +02:00
|
|
|
'editions_list': AppConstants.apiEndpoint + 'pieces/${piece_id}/editions/',
|
2015-06-30 10:42:58 +02:00
|
|
|
'licenses': AppConstants.apiEndpoint + 'ownership/licenses/',
|
2015-08-21 15:04:38 +02:00
|
|
|
'note_private_edition': AppConstants.apiEndpoint + 'note/private/editions/',
|
|
|
|
'note_private_piece': AppConstants.apiEndpoint + 'note/private/pieces/',
|
|
|
|
'note_public_edition': AppConstants.apiEndpoint + 'note/public/editions/',
|
|
|
|
'note_public_piece': AppConstants.apiEndpoint + 'note/public/pieces/',
|
2015-09-03 14:15:00 +02:00
|
|
|
'notification_piecelist': AppConstants.apiEndpoint + 'notifications/pieces/',
|
2015-09-03 15:17:12 +02:00
|
|
|
'notification_piece': AppConstants.apiEndpoint + 'notifications/pieces/${piece_id}/',
|
2015-09-03 14:15:00 +02:00
|
|
|
'notification_editionlist': AppConstants.apiEndpoint + 'notifications/editions/',
|
2015-09-03 15:17:12 +02:00
|
|
|
'notification_edition': AppConstants.apiEndpoint + 'notifications/editions/${edition_id}/',
|
2015-09-04 11:49:55 +02:00
|
|
|
'notification_contractagreementlist': AppConstants.apiEndpoint + 'notifications/contract_agreements/',
|
2015-09-02 14:39:32 +02:00
|
|
|
'ownership_contract_agreements': AppConstants.apiEndpoint + 'ownership/contract_agreements/',
|
2015-09-07 12:03:59 +02:00
|
|
|
'ownership_contract_agreements_confirm': AppConstants.apiEndpoint + 'ownership/contract_agreements/${contract_agreement_id}/accept/',
|
|
|
|
'ownership_contract_agreements_deny': AppConstants.apiEndpoint + 'ownership/contract_agreements/${contract_agreement_id}/reject/',
|
2015-06-09 17:53:44 +02:00
|
|
|
'ownership_consigns': AppConstants.apiEndpoint + 'ownership/consigns/',
|
2015-06-16 09:02:48 +02:00
|
|
|
'ownership_consigns_confirm': AppConstants.apiEndpoint + 'ownership/consigns/confirm/',
|
|
|
|
'ownership_consigns_deny': AppConstants.apiEndpoint + 'ownership/consigns/deny/',
|
2015-09-29 18:09:34 +02:00
|
|
|
'ownership_consigns_withdraw': AppConstants.apiEndpoint + 'ownership/consigns/withdraw/',
|
2015-07-15 14:48:51 +02:00
|
|
|
'ownership_loans_pieces': AppConstants.apiEndpoint + 'ownership/loans/pieces/',
|
2015-08-24 10:48:40 +02:00
|
|
|
'ownership_loans_pieces_confirm': AppConstants.apiEndpoint + 'ownership/loans/pieces/confirm/',
|
|
|
|
'ownership_loans_pieces_deny': AppConstants.apiEndpoint + 'ownership/loans/pieces/deny/',
|
2015-08-26 09:50:38 +02:00
|
|
|
'ownership_loans_pieces_request': AppConstants.apiEndpoint + 'ownership/loans/pieces/request/',
|
2015-08-27 11:38:21 +02:00
|
|
|
'ownership_loans_pieces_request_confirm': AppConstants.apiEndpoint + 'ownership/loans/pieces/request_confirm/',
|
|
|
|
'ownership_loans_pieces_request_deny': AppConstants.apiEndpoint + 'ownership/loans/pieces/request_deny/',
|
2015-07-15 14:48:51 +02:00
|
|
|
'ownership_loans_editions': AppConstants.apiEndpoint + 'ownership/loans/editions/',
|
2015-07-15 16:56:11 +02:00
|
|
|
'ownership_loans_confirm': AppConstants.apiEndpoint + 'ownership/loans/editions/confirm/',
|
|
|
|
'ownership_loans_deny': AppConstants.apiEndpoint + 'ownership/loans/editions/deny/',
|
2015-07-10 20:00:35 +02:00
|
|
|
'ownership_shares_editions': AppConstants.apiEndpoint + 'ownership/shares/editions/',
|
2015-07-13 14:10:46 +02:00
|
|
|
'ownership_shares_pieces': AppConstants.apiEndpoint + 'ownership/shares/pieces/',
|
2015-06-16 10:58:41 +02:00
|
|
|
'ownership_transfers': AppConstants.apiEndpoint + 'ownership/transfers/',
|
2015-06-26 11:44:35 +02:00
|
|
|
'ownership_transfers_withdraw': AppConstants.apiEndpoint + 'ownership/transfers/withdraw/',
|
2015-06-16 10:58:41 +02:00
|
|
|
'ownership_unconsigns': AppConstants.apiEndpoint + 'ownership/unconsigns/',
|
|
|
|
'ownership_unconsigns_deny': AppConstants.apiEndpoint + 'ownership/unconsigns/deny/',
|
|
|
|
'ownership_unconsigns_request': AppConstants.apiEndpoint + 'ownership/unconsigns/request/',
|
2015-09-07 10:23:39 +02:00
|
|
|
'ownership_contract': AppConstants.apiEndpoint + 'ownership/contracts/${contract_id}/',
|
2015-09-04 11:49:55 +02:00
|
|
|
'ownership_contract_list': AppConstants.apiEndpoint + 'ownership/contracts/',
|
2015-07-08 22:54:07 +02:00
|
|
|
'piece': AppConstants.apiEndpoint + 'pieces/${piece_id}/',
|
2015-06-16 10:58:41 +02:00
|
|
|
'piece_extradata': AppConstants.apiEndpoint + 'pieces/${piece_id}/extradata/',
|
|
|
|
'pieces_list': AppConstants.apiEndpoint + 'pieces/',
|
2015-07-13 23:57:16 +02:00
|
|
|
'piece_remove_from_collection': AppConstants.apiEndpoint + 'ownership/shares/pieces/${piece_id}/',
|
2015-06-11 15:57:19 +02:00
|
|
|
'user': AppConstants.apiEndpoint + 'users/',
|
2015-06-11 17:22:11 +02:00
|
|
|
'users_login': AppConstants.apiEndpoint + 'users/login/',
|
2015-06-15 12:36:27 +02:00
|
|
|
'users_logout': AppConstants.apiEndpoint + 'users/logout/',
|
2015-06-16 10:58:41 +02:00
|
|
|
'users_password_reset': AppConstants.apiEndpoint + 'users/reset_password/',
|
2015-06-11 17:22:11 +02:00
|
|
|
'users_password_reset_request': AppConstants.apiEndpoint + 'users/request_reset_password/',
|
2015-06-17 17:48:23 +02:00
|
|
|
'users_signup': AppConstants.apiEndpoint + 'users/',
|
2015-06-18 19:03:03 +02:00
|
|
|
'users_username': AppConstants.apiEndpoint + 'users/username/',
|
2015-07-27 14:39:19 +02:00
|
|
|
'users_profile': AppConstants.apiEndpoint + 'users/profile/',
|
2015-06-29 15:58:47 +02:00
|
|
|
'wallet_settings': AppConstants.apiEndpoint + 'users/wallet_settings/',
|
2015-11-27 03:24:37 +01:00
|
|
|
'webhook': AppConstants.apiEndpoint + 'webhooks/${webhook_id}/',
|
|
|
|
'webhooks': AppConstants.apiEndpoint + 'webhooks/',
|
|
|
|
'webhooks_events': AppConstants.apiEndpoint + 'webhooks/events/',
|
2015-06-30 15:41:39 +02:00
|
|
|
'whitelabel_settings': AppConstants.apiEndpoint + 'whitelabel/settings/${subdomain}/',
|
2016-02-17 11:38:01 +01:00
|
|
|
'delete_s3_file': AppConstants.serverUrl + 's3/delete/',
|
|
|
|
'sign_url_s3': AppConstants.serverUrl + 's3/sign_url/'
|
2015-05-29 01:54:56 +02:00
|
|
|
};
|
|
|
|
|
2015-07-14 21:15:10 +02:00
|
|
|
|
|
|
|
export function updateApiUrls(type, subdomain) {
|
|
|
|
let newUrls = {};
|
|
|
|
|
|
|
|
if (type === 'prize') {
|
|
|
|
newUrls = getPrizeApiUrls(subdomain);
|
2015-08-11 14:47:28 +02:00
|
|
|
} else if(type === 'wallet') {
|
|
|
|
newUrls = getWalletApiUrls(subdomain);
|
2015-07-14 21:15:10 +02:00
|
|
|
}
|
2015-08-07 15:08:02 +02:00
|
|
|
update(ApiUrls, newUrls);
|
2015-07-14 21:15:10 +02:00
|
|
|
}
|
|
|
|
|
2015-08-07 15:08:02 +02:00
|
|
|
export default ApiUrls;
|