import { appendQueryParams } from './accountManagementUtils'; import { GetProfileDevicesRequest, GetProfilesByRecentDevicesRequest, GetDeviceByMacAddressRequest, } from './types/Admin'; import { AnalyticsQueryParams, ContentDetailQueryParams, TrafficAwarenessQueryParams, } from './types/Analytics'; import { GetCatalogsQueryRequest } from './types/Catalog'; import { GetConnectionsQueryRequest } from './types/Connection'; import { GetConnectorsQueryRequest } from './types/Connector'; import { Invoice } from './types/Invoice'; import { GetProductsQueryRequest } from './types/Product'; import { GetStripeCheckoutQueryRequest, GetStripeProductsQueryRequest, } from './types/Stripe'; export default { // libraries library: (query?: string) => `/library${query ? `?${query}` : ''}`, // folders devicesFolder: (query?: string) => `/v3/folders/devices${query ? `?${query}` : ''}`, libraryFolder: () => '/v3/folders/library', folders: () => '/v3/folders', folder: (folderId: string) => `/v3/folders/${folderId}`, folderMoveToFolder: (playlistId: string) => `/v3/folders/${playlistId}/actions/move_to_folder`, folderCopy: (folderId: string) => `/v3/folders/${folderId}/actions/copy`, //v4 folders v4DevicesFolder: (query?: string) => `/v4/folders/devices${query ? `?${query}` : ''}`, v4DevicesLibrary: () => '/v4/folders/library', v4DevicesLibraryLite: () => '/v4/folders/library-lite', // locations locations: (query?: string) => `/locations${query ? `?${query}` : ''}`, location: (locationId: string) => `/locations/${locationId}`, inviteUserToLocation: (locationId: string) => `/locations/${locationId}/invite_user`, removeUserFromLocation: (locationId: string) => `/locations/${locationId}/remove_user`, pendingLocations: () => '/locations/pending', moveDevices: (locationId: string) => `/locations/${locationId}/move_devices`, // devices devices: () => '/v3/devices', v4ReportingDevices: (query?: string) => `/v4/reporting/devices${query ? `?${query}` : ''}`, v5Device: () => '/v5/device', v5Devices: (query?: string) => `/v5/devices${query ? `?${query}` : ''}`, devicesRecentErrors: () => '/v4/devices/events/recent_errors', device: (deviceId: string) => `/v3/devices/${deviceId}`, deviceMoveToFolder: (deviceId: string) => `/v3/devices/${deviceId}/actions/move_to_folder`, devicesRegister: () => `/v3/devices/actions/register`, devicesAffectedDevices: () => `/v3/devices/actions/get_affected_devices`, devicePublish: (deviceId: string) => `/v3/devices/${deviceId}/actions/publish`, deviceRestart: (deviceId: string) => `/v3/devices/${deviceId}/actions/restart`, deviceReboot: (deviceId: string) => `/v3/devices/${deviceId}/actions/reboot`, deviceWifiMetrics: (deviceId: string) => `/v3/devices/${deviceId}/metrics/wifi`, deviceSYBSoundZone: (deviceId: string) => `/v3/devices/${deviceId}/syb/sound_zone`, deviceSYBGeneratePairingCode: (deviceId: string) => `/v3/devices/${deviceId}/actions/syb/generate_pairing_code`, deviceUnregister: (deviceId: string) => `/v3/devices/${deviceId}/actions/unregister`, deviceAISettings: (deviceId: string) => `/v4/devices/${deviceId}/ai_settings`, deviceAIVideo: (deviceId: string) => `/v4/devices/${deviceId}/ai_settings/video`, deviceAILicenseKey: (deviceId: string) => `/v4/devices/${deviceId}/license_key`, deviceBatchSettings: () => '/v4/devices/batch_management', deviceBatchStatus: () => '/v4/devices/batch_management/status', devicePerchviewSettings: (deviceId: string) => `/v4/devices/${deviceId}/perchview_service_settings`, deviceOwnPerchviewSettings: () => `/v4/device/perchview_service_settings`, deviceV2PerchviewSettings: (deviceId: string) => `/v4/devices/${deviceId}/perchview_service_settings/settings`, // device deviceHeartbeat: () => `/v3/device/heartbeat`, devicePublishedContent: () => `/v3/device/content/publish`, deviceAdContent: () => `/v3/device/content/ad`, devicePubnubAuth: () => `/v3/device/pubnub/auth`, deviceCharges: () => `/v4/device/charges`, deviceCharge: (chargeId: string) => `/v4/device/charges/${chargeId}`, deviceTerminalStatus: () => `/v5/device/terminal/status`, deviceTerminal: (deviceId: string) => `/v5/devices/${deviceId}/terminal`, // device service changes deviceService: (deviceId: string, serviceName: string) => `/v4/devices/${deviceId}/service/${serviceName}`, // playlists playlists: () => `/v3/playlists`, playlist: (playlistId: string) => `/v3/playlists/${playlistId}`, playlistMoveToFolder: (playlistId: string) => `/v3/playlists/${playlistId}/actions/move_to_folder`, playlistPlaybackContent: (playlistId: string) => `/v3/playlists/${playlistId}/playback_content`, playlistCopy: (playlistId: string) => `/v3/playlists/${playlistId}/actions/copy`, // presentations presentations: () => '/v3/presentations', presentation: (presentationId: string) => `/v3/presentations/${presentationId}`, presentationMoveToFolder: (presentationId: string) => `/v3/presentations/${presentationId}/actions/move_to_folder`, presentationCopy: (presentationId: string) => `/v3/presentations/${presentationId}/actions/copy`, getPresentationsList: (query?: string) => `/v4/reporting/presentations${query ? `?${query}` : ''}`, // applications applications: () => '/v3/applications', application: (id: string) => `/v3/applications/${id}`, applicationVersions: (applicationId: string) => `/v3/applications/${applicationId}/application_versions`, marketPlaceApplications: () => '/v3/applications/market_place', getProductList: (grantScope: string) => `/v4/applications/marketplace?grant_scope=${grantScope}`, getEXLicenses: () => '/v4/applications/ex_licenses', purchaseProduct: () => '/v4/applications/purchase', sendMarketPlaceInquiry: () => '/v3/applications/market_place_email_sales', // application verions applicationVersionToken: (applicationVersionId: string) => `/application_versions/${applicationVersionId}/token`, // themes themes: () => '/v3/themes', theme: (id: string) => `/v3/themes/${id}`, //fonts fonts: () => '/v3/fonts', // profiles profile: () => '/v3/profile', setRemoteAssistance: () => `/v3/profile/actions/set_remote_assistance`, unsubscribe: (profileId: string) => `/v3/profiles/${profileId}/actions/unsubscribe`, userStatus: (email: string) => `/v3/profiles/users/${email}`, onboarding: (query?: string) => `/profile/onboarding${query ? `?${query}` : ''}`, profileBillingAccounts: () => '/profile/billing_accounts', profileBillingPortalSession: () => '/profile/billing_portal_session', profileDeviceLicenses: () => '/profiles/device_licenses', // domain domain: () => '/v3/domain', domainInvite: () => '/v3/domain/actions/invite', domainProfileSetRole: (profileId: string) => `/v3/domain/profiles/${profileId}/actions/set_role`, // Enterprise Invite getDomainUsers: () => '/v4/domain/profiles', getPendingDomainUsers: () => '/v4/domain/invites/pending', validateEmail: () => '/v4/domain/invite/validate_email', inviteDomainUser: () => '/v4/domain/invite', updateDomainInvite: (inviteId: string) => `/v4/domain/invite/${inviteId}`, resendDomainInvite: (inviteId: string) => `/v4/domain/invite/${inviteId}/resend`, cancelDomainInvite: (inviteId: string) => `/v4/domain/invite/${inviteId}/cancel`, acceptDomainInvite: () => '/v4/domain/invite/action/accept', updateDomainUser: (profileId: string) => `/v4/domain/profiles/${profileId}`, // resource acls resourceACLs: () => '/v3/resource_acls', resourceACL: (aclId: string) => `/v3/resource_acls/${aclId}`, listResourceACLs: (resourceId: string) => `/v3/resources/${resourceId}/resource_acls`, resourceACLV5: (resourceId: string) => `/v5/resources/${resourceId}/share`, // playback reports playbackReports: () => '/v4/playback_reports', // admin masquerade: () => '/v3/admin/masquerade', // chargebee generateChargebeePortal: () => '/v3/chargebee/generate_portal', // support supportRemoteAssist: () => '/v3/support/actions/remote_assist', enableMultiTimeZone: (isDomainUser: boolean) => isDomainUser ? '/v3/domain/actions/set_is_multitimezone_enabled' : '/v3/profile/actions/set_is_multitimezone_enabled', // invoices getInvoices: () => '/v4/accounts/invoices', downloadInvoice: (contentDocumentId: Invoice['contentDocumentId']) => `/v4/accounts/invoice/${contentDocumentId}/download`, outstandingBalance: () => `/v4/accounts/invoices/outstanding_balance`, chargeInvoice: () => `/v4/accounts/payments/pay_invoice`, //user changeEmail: () => `/v4/accounts/change_email`, //payment captureContext: () => `/v4/accounts/payments/get_public_key`, //payment methods paymentMethods: () => `/v4/accounts/payments/methods`, //payment methods toggleInvoiceEmail: () => `/v4/accounts/invoices/toggle_email`, //account address getAccountAddress: () => `/v4/accounts/info`, updateAccountAddress: () => `/v4/accounts/address`, //countries getCountries: () => `/v4/accounts/state_country`, // support app getProfileDevices: (params: GetProfileDevicesRequest) => appendQueryParams(`/v4/admin/search/profile_devices`, params), getProfilesByRecentDevices: (params: GetProfilesByRecentDevicesRequest) => appendQueryParams(`/v4/admin/search/profiles_by_recent_devices`, params), disableDevice: () => `/v4/admin/actions/disable_customer_screen`, enableDevice: () => `/v4/admin/actions/enable_customer_screen`, getDeviceByMacAddress: (params: GetDeviceByMacAddressRequest) => appendQueryParams(`/v4/admin/search/device_by_mac`, params), updateAdminDevice: (deviceId: string) => `/v4/admin/device/${deviceId}`, // analytics getAnalytics: (params: AnalyticsQueryParams) => appendQueryParams('/v4/reporting/overview', params), getContentEngagement: (params: AnalyticsQueryParams) => appendQueryParams('/v4/reporting/content_engagement', params), getTrafficAwareness: (params: TrafficAwarenessQueryParams) => appendQueryParams('/v4/reporting/traffic', params), getTrafficAwarenessExport: (params: TrafficAwarenessQueryParams) => appendQueryParams('/v4/reporting/traffic/export', params), getContentEngagementExport: (params: AnalyticsQueryParams) => appendQueryParams('/v4/reporting/content_engagement/export', params), getContentEngagementClickExport: (params: AnalyticsQueryParams) => appendQueryParams('/v4/reporting/content_engagement/export/clicks', params), getProductEngagementExport: (params: AnalyticsQueryParams) => appendQueryParams('/v4/reporting/product/export', params), getLocations: () => '/v4/reporting/locations', getContentDetail: (params: ContentDetailQueryParams) => appendQueryParams('/v4/reporting/content_engagement/detail', params), // catalogs catalogs: (params: GetCatalogsQueryRequest = {}) => appendQueryParams('/catalogs', params), catalog: (id: string) => `/catalogs/${id}`, // catalogs products: (catalogId: string, params: GetProductsQueryRequest = {}) => appendQueryParams(`/catalogs/${catalogId}/products`, params), catalogLocations: (catalogId: string, params: GetProductsQueryRequest = {}) => appendQueryParams(`/catalogs/${catalogId}/locations`, params), // connections connections: (params: GetConnectionsQueryRequest = {}) => appendQueryParams('/connections', params), connection: (id: string) => `/connections/${id}`, // connectors connectors: (params: GetConnectorsQueryRequest) => appendQueryParams('/connectors', params), // stripe createCustomerPortalSession: () => '/stripe/create_customer_portal_session', stripeCheckout: (params: GetStripeCheckoutQueryRequest = {}) => appendQueryParams('/stripe/checkout', params), getStripeProducts: (params: GetStripeProductsQueryRequest = {}) => appendQueryParams('/stripe/products', params), };