steelseries-sonar-sdk 0.1.1 → 0.2.2
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.
- package/dist/consts/fetch-options-put.d.ts +3 -0
- package/{src/enums.ts → dist/enums.d.ts} +34 -41
- package/dist/exceptions.d.ts +32 -0
- package/dist/functions/audio/get-audio-data-classic.d.ts +7 -0
- package/dist/functions/audio/get-audio-data-stream.d.ts +7 -0
- package/dist/functions/audio/get-audio-mode.d.ts +7 -0
- package/dist/functions/audio/set-audio-mode.d.ts +8 -0
- package/dist/functions/audio/set-channel-mute-classic.d.ts +9 -0
- package/dist/functions/audio/set-channel-mute-streamer.d.ts +10 -0
- package/dist/functions/audio/set-channel-volume-classic.d.ts +9 -0
- package/dist/functions/audio/set-channel-volume-streamer.d.ts +10 -0
- package/dist/functions/chatmix/get-chat-mix-state.d.ts +7 -0
- package/dist/functions/chatmix/set-chat-mix-balance.d.ts +7 -0
- package/dist/functions/converters/convert-channel-to-api.d.ts +3 -0
- package/dist/functions/converters/convert-chat-mix-balance-to-api.d.ts +2 -0
- package/dist/functions/converters/convert-chat-mix-balance-to-user.d.ts +2 -0
- package/dist/functions/converters/convert-profile-channel-to-api.d.ts +3 -0
- package/dist/functions/converters/convert-profile-channel-to-user.d.ts +3 -0
- package/dist/functions/converters/convert-volume-to-api.d.ts +1 -0
- package/dist/functions/converters/convert-volume-to-user.d.ts +1 -0
- package/dist/functions/devices/get-audio-devices.d.ts +3 -0
- package/dist/functions/devices/set-audio-device.d.ts +3 -0
- package/dist/functions/endpoint/get-app-endpoint.d.ts +14 -0
- package/dist/functions/endpoint/get-sonar-endpoint-cached.d.ts +1 -0
- package/dist/functions/endpoint/get-sonar-endpoint.d.ts +14 -0
- package/dist/functions/profile/get-channel-profiles.d.ts +3 -0
- package/dist/functions/profile/get-selected-profiles.d.ts +2 -0
- package/dist/functions/profile/set-selected-profile.d.ts +2 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +874 -0
- package/{src/sonar/models/audio-settings/chatmix-data.ts → dist/sonar/models/audio-settings/chatmix-data.d.ts} +4 -5
- package/dist/sonar/models/audio-settings/enums/audio-mode.d.ts +4 -0
- package/dist/sonar/models/audio-settings/enums/chat-mix-state.d.ts +6 -0
- package/dist/sonar/models/audio-settings/enums/device-data-flow.d.ts +5 -0
- package/dist/sonar/models/audio-settings/enums/device-default-roles.d.ts +6 -0
- package/dist/sonar/models/audio-settings/enums/device-role.d.ts +9 -0
- package/dist/sonar/models/audio-settings/enums/device-state.d.ts +8 -0
- package/dist/sonar/models/audio-settings/enums/sonar-channel.d.ts +8 -0
- package/dist/sonar/models/audio-settings/enums/streaming-path.d.ts +4 -0
- package/dist/sonar/models/audio-settings/volume-info-classic.d.ts +4 -0
- package/dist/sonar/models/audio-settings/volume-info-streamer.d.ts +10 -0
- package/dist/sonar/models/audio-settings/volume-settings-classic.d.ts +9 -0
- package/dist/sonar/models/audio-settings/volume-settings-streamer.d.ts +9 -0
- package/dist/sonar/models/config/config.d.ts +8 -0
- package/dist/sonar/models/config/enums/VirtualAudioDevice.d.ts +7 -0
- package/dist/sonar/models/devices/audio-device.d.ts +16 -0
- package/dist/sonar/models/devices/changed-device.d.ts +6 -0
- package/dist/sonar/requests/audio-devices/change-audio-device.d.ts +3 -0
- package/dist/sonar/requests/audio-devices/request-audio-devices.d.ts +9 -0
- package/dist/sonar/requests/chatmix/change-chat-mix-balance.d.ts +2 -0
- package/dist/sonar/requests/chatmix/request-chat-mix-state.d.ts +2 -0
- package/dist/sonar/requests/mode/change-audio-mode.d.ts +2 -0
- package/dist/sonar/requests/mode/request-audio-mode.d.ts +2 -0
- package/dist/sonar/requests/profiles/change-selected-config.d.ts +2 -0
- package/dist/sonar/requests/profiles/request-configs.d.ts +3 -0
- package/dist/sonar/requests/profiles/request-selected-configs.d.ts +2 -0
- package/dist/sonar/requests/volume-settings/change-volume-level-classic.d.ts +3 -0
- package/dist/sonar/requests/volume-settings/change-volume-level-streamer.d.ts +4 -0
- package/dist/sonar/requests/volume-settings/change-volume-mute-classic.d.ts +3 -0
- package/dist/sonar/requests/volume-settings/change-volume-mute-streamer.d.ts +4 -0
- package/dist/sonar/requests/volume-settings/request-volume-settings-classic.d.ts +2 -0
- package/dist/sonar/requests/volume-settings/request-volume-settings-streamer.d.ts +2 -0
- package/dist/types/audio-device.d.ts +6 -0
- package/dist/types/changed-device.d.ts +6 -0
- package/dist/types/channel-volume-classic.d.ts +4 -0
- package/dist/types/channel-volume-streamer-path.d.ts +4 -0
- package/dist/types/channel-volume-streamer.d.ts +5 -0
- package/dist/types/channel-volumes-classic.d.ts +7 -0
- package/dist/types/channel-volumes-streamer.d.ts +7 -0
- package/dist/types/chat-mix-data.d.ts +6 -0
- package/dist/types/profile-option.d.ts +8 -0
- package/package.json +7 -3
- package/.gitattributes +0 -8
- package/.github/workflows/tests.yml +0 -18
- package/.vscode/extensions.json +0 -8
- package/.vscode/settings.json +0 -33
- package/_.todo +0 -4
- package/biome.json +0 -62
- package/http/sonar.http +0 -104
- package/src/consts/fetch-options-put.ts +0 -3
- package/src/exceptions.ts +0 -45
- package/src/functions/audio/get-audio-data-classic.ts +0 -31
- package/src/functions/audio/get-audio-data-stream.ts +0 -37
- package/src/functions/audio/get-audio-mode.ts +0 -11
- package/src/functions/audio/set-audio-mode.ts +0 -12
- package/src/functions/audio/set-channel-mute-classic.ts +0 -35
- package/src/functions/audio/set-channel-mute-streamer.ts +0 -41
- package/src/functions/audio/set-channel-volume-classic.ts +0 -37
- package/src/functions/audio/set-channel-volume-streamer.ts +0 -43
- package/src/functions/chatmix/get-chat-mix-state.ts +0 -20
- package/src/functions/chatmix/set-chat-mix-balance.ts +0 -22
- package/src/functions/converters/convert-channel-to-api.ts +0 -19
- package/src/functions/converters/convert-chat-mix-balance-to-api.ts +0 -6
- package/src/functions/converters/convert-chat-mix-balance-to-user.ts +0 -7
- package/src/functions/converters/convert-profile-channel-to-api.ts +0 -19
- package/src/functions/converters/convert-profile-channel-to-user.ts +0 -19
- package/src/functions/converters/convert-volume-to-api.ts +0 -5
- package/src/functions/converters/convert-volume-to-user.ts +0 -6
- package/src/functions/devices/get-audio-devices.ts +0 -40
- package/src/functions/devices/set-audio-device.ts +0 -19
- package/src/functions/endpoint/get-app-endpoint.ts +0 -73
- package/src/functions/endpoint/get-sonar-endpoint-cached.ts +0 -28
- package/src/functions/endpoint/get-sonar-endpoint.ts +0 -88
- package/src/functions/profile/get-channel-profiles.ts +0 -26
- package/src/functions/profile/get-selected-profiles.ts +0 -17
- package/src/functions/profile/set-selected-profile.ts +0 -17
- package/src/index.ts +0 -41
- package/src/sonar/models/audio-settings/enums/audio-mode.ts +0 -4
- package/src/sonar/models/audio-settings/enums/chat-mix-state.ts +0 -6
- package/src/sonar/models/audio-settings/enums/device-data-flow.ts +0 -5
- package/src/sonar/models/audio-settings/enums/device-default-roles.ts +0 -6
- package/src/sonar/models/audio-settings/enums/device-role.ts +0 -9
- package/src/sonar/models/audio-settings/enums/device-state.ts +0 -8
- package/src/sonar/models/audio-settings/enums/sonar-channel.ts +0 -8
- package/src/sonar/models/audio-settings/enums/streaming-path.ts +0 -4
- package/src/sonar/models/audio-settings/volume-info-classic.ts +0 -4
- package/src/sonar/models/audio-settings/volume-info-streamer.ts +0 -10
- package/src/sonar/models/audio-settings/volume-settings-classic.ts +0 -13
- package/src/sonar/models/audio-settings/volume-settings-streamer.ts +0 -13
- package/src/sonar/models/config/config.ts +0 -9
- package/src/sonar/models/config/enums/VirtualAudioDevice.ts +0 -7
- package/src/sonar/models/devices/audio-device.ts +0 -17
- package/src/sonar/models/devices/changed-device.ts +0 -7
- package/src/sonar/requests/audio-devices/change-audio-device.ts +0 -37
- package/src/sonar/requests/audio-devices/request-audio-devices.ts +0 -42
- package/src/sonar/requests/chatmix/change-chat-mix-balance.ts +0 -25
- package/src/sonar/requests/chatmix/request-chat-mix-state.ts +0 -24
- package/src/sonar/requests/mode/change-audio-mode.ts +0 -24
- package/src/sonar/requests/mode/request-audio-mode.ts +0 -24
- package/src/sonar/requests/profiles/change-selected-config.ts +0 -25
- package/src/sonar/requests/profiles/request-configs.ts +0 -24
- package/src/sonar/requests/profiles/request-selected-configs.ts +0 -22
- package/src/sonar/requests/volume-settings/change-volume-level-classic.ts +0 -27
- package/src/sonar/requests/volume-settings/change-volume-level-streamer.ts +0 -29
- package/src/sonar/requests/volume-settings/change-volume-mute-classic.ts +0 -27
- package/src/sonar/requests/volume-settings/change-volume-mute-streamer.ts +0 -29
- package/src/sonar/requests/volume-settings/request-volume-settings-classic.ts +0 -22
- package/src/sonar/requests/volume-settings/request-volume-settings-streamer.ts +0 -22
- package/src/types/audio-device.ts +0 -7
- package/src/types/changed-device.ts +0 -7
- package/src/types/channel-volume-classic.ts +0 -4
- package/src/types/channel-volume-streamer-path.ts +0 -4
- package/src/types/channel-volume-streamer.ts +0 -6
- package/src/types/channel-volumes-classic.ts +0 -8
- package/src/types/channel-volumes-streamer.ts +0 -8
- package/src/types/chat-mix-data.ts +0 -7
- package/src/types/profile-option.ts +0 -9
- package/tests/e2e/audio/get-audio-data-classic.real.test.ts +0 -11
- package/tests/e2e/audio/get-audio-data-stream.real.test.ts +0 -11
- package/tests/e2e/audio/get-audio-mode.real.test.ts +0 -12
- package/tests/e2e/audio/set-audio-mode.real.test.ts +0 -20
- package/tests/e2e/audio/set-channel-mute-classic.real.test.ts +0 -18
- package/tests/e2e/audio/set-channel-mute-streamer.real.test.ts +0 -18
- package/tests/e2e/audio/set-channel-volume-classic.real.test.ts +0 -17
- package/tests/e2e/audio/set-channel-volume-streamer.real.test.ts +0 -22
- package/tests/e2e/chatmix/get-chat-mix-state.real.test.ts +0 -25
- package/tests/e2e/chatmix/set-chat-mix-balance.real.test.ts +0 -25
- package/tests/e2e/devices/get-audio-devices.real.test.ts +0 -29
- package/tests/e2e/devices/set-audio-device.real.test.ts +0 -32
- package/tests/e2e/enpoint/get-app-endpoint.real.test.ts +0 -19
- package/tests/e2e/enpoint/get-sonar-endpoint-cached.real.test.ts +0 -32
- package/tests/e2e/enpoint/get-sonar-endpoint.real.test.ts +0 -21
- package/tests/e2e/profiles/get-channel-profiles.real.test.ts +0 -21
- package/tests/e2e/profiles/get-selected-profiles.real.test.ts +0 -11
- package/tests/e2e/profiles/set-selected-profile.real.test.ts +0 -17
- package/tests/helpers/get-endpoint-e2e.ts +0 -8
- package/tests/unit/audio/get-audio-data-classic.test.ts +0 -57
- package/tests/unit/audio/get-audio-data-stream.test.ts +0 -65
- package/tests/unit/audio/get-audio-mode.test.ts +0 -58
- package/tests/unit/audio/set-audio-mode.test.ts +0 -66
- package/tests/unit/audio/set-channel-mute-classic.test.ts +0 -58
- package/tests/unit/audio/set-channel-mute-streamer.test.ts +0 -64
- package/tests/unit/audio/set-channel-volume-classic.test.ts +0 -58
- package/tests/unit/audio/set-channel-volume-streamer.test.ts +0 -64
- package/tests/unit/chatmix/get-chat-mix-state.test.ts +0 -70
- package/tests/unit/chatmix/set-chat-mix-balance.test.ts +0 -58
- package/tests/unit/devices/get-audio-devices.test.ts +0 -59
- package/tests/unit/devices/set-audio-devices.test.ts +0 -62
- package/tests/unit/endpoint/get-app-endpoint.test.ts +0 -72
- package/tests/unit/endpoint/get-sonar-endpoint-cached.test.ts +0 -93
- package/tests/unit/endpoint/get-sonar-endpoint.test.ts +0 -140
- package/tests/unit/profiles/get-channel-profiles.test.ts +0 -91
- package/tests/unit/profiles/get-selected-profiles.test.ts +0 -64
- package/tests/unit/profiles/set-selected-profile.test.ts +0 -55
- package/tsconfig.json +0 -36
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { SonarRequestException } from '@/exceptions'
|
|
2
|
-
import type { VolumeSettingsClassic } from '@/sonar/models/audio-settings/volume-settings-classic'
|
|
3
|
-
|
|
4
|
-
export async function requestVolumeSettingsClassic(sonarEndpoint: string): Promise<VolumeSettingsClassic> {
|
|
5
|
-
let response: Response
|
|
6
|
-
try {
|
|
7
|
-
const url = new URL(`${sonarEndpoint}/volumeSettings/classic`)
|
|
8
|
-
response = await fetch(url)
|
|
9
|
-
} catch (error) {
|
|
10
|
-
throw new SonarRequestException({ innerException: error as Error })
|
|
11
|
-
}
|
|
12
|
-
if (response.ok) {
|
|
13
|
-
const data = (await response.json()) as VolumeSettingsClassic
|
|
14
|
-
if (data?.masters?.classic == null) {
|
|
15
|
-
throw new SonarRequestException({ innerException: new Error('Missing required data in response.') })
|
|
16
|
-
}
|
|
17
|
-
return data
|
|
18
|
-
} else {
|
|
19
|
-
const data = (await response.json()) as { error: string }
|
|
20
|
-
throw new SonarRequestException({ innerException: new Error(data?.error ?? data) })
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { SonarRequestException } from '@/exceptions'
|
|
2
|
-
import type { VolumeSettingsStreamer } from '@/sonar/models/audio-settings/volume-settings-streamer'
|
|
3
|
-
|
|
4
|
-
export async function requestVolumeSettingsStreamer(sonarEndpoint: string): Promise<VolumeSettingsStreamer> {
|
|
5
|
-
let response: Response
|
|
6
|
-
try {
|
|
7
|
-
const url = new URL(`${sonarEndpoint}/volumeSettings/streamer`)
|
|
8
|
-
response = await fetch(url)
|
|
9
|
-
} catch (error) {
|
|
10
|
-
throw new SonarRequestException({ innerException: error as Error })
|
|
11
|
-
}
|
|
12
|
-
if (response.ok) {
|
|
13
|
-
const data = (await response.json()) as VolumeSettingsStreamer
|
|
14
|
-
if (data?.masters?.stream == null) {
|
|
15
|
-
throw new SonarRequestException({ innerException: new Error('Missing required data in response.') })
|
|
16
|
-
}
|
|
17
|
-
return data
|
|
18
|
-
} else {
|
|
19
|
-
const data = (await response.json()) as { error: string }
|
|
20
|
-
throw new SonarRequestException({ innerException: new Error(data?.error ?? data) })
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { AudioChannel } from '@/enums'
|
|
2
|
-
import type { ChannelVolumeClassic } from '@/types/channel-volume-classic'
|
|
3
|
-
|
|
4
|
-
export type ChannelVolumesClassic = {
|
|
5
|
-
[AudioChannel.Master]: ChannelVolumeClassic
|
|
6
|
-
} & {
|
|
7
|
-
[K in Exclude<AudioChannel, 'master'>]?: ChannelVolumeClassic
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { AudioChannel } from '@/enums'
|
|
2
|
-
import type { ChannelVolumeStreamer } from '@/types/channel-volume-streamer'
|
|
3
|
-
|
|
4
|
-
export type ChannelVolumesStreamer = {
|
|
5
|
-
[AudioChannel.Master]: ChannelVolumeStreamer
|
|
6
|
-
} & {
|
|
7
|
-
[K in AudioChannel]?: ChannelVolumeStreamer
|
|
8
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test'
|
|
2
|
-
import { getEndpointEndToEnd } from 'tests/helpers/get-endpoint-e2e'
|
|
3
|
-
import { getAudioDataClassic } from '@/functions/audio/get-audio-data-classic'
|
|
4
|
-
|
|
5
|
-
describe('getAudioDataClassic', () => {
|
|
6
|
-
it('returns audio data', async () => {
|
|
7
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
8
|
-
const result = await getAudioDataClassic(sonarEndpoint)
|
|
9
|
-
expect(result.master.volume).toBeGreaterThan(0)
|
|
10
|
-
})
|
|
11
|
-
})
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test'
|
|
2
|
-
import { getEndpointEndToEnd } from 'tests/helpers/get-endpoint-e2e'
|
|
3
|
-
import { getAudioDataStream } from '@/functions/audio/get-audio-data-stream'
|
|
4
|
-
|
|
5
|
-
describe('getAudioDataStreamer', () => {
|
|
6
|
-
it('returns audio data', async () => {
|
|
7
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
8
|
-
const result = await getAudioDataStream(sonarEndpoint)
|
|
9
|
-
expect(result.master.monitoring.volume).toBeGreaterThan(0)
|
|
10
|
-
})
|
|
11
|
-
})
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test'
|
|
2
|
-
import { getEndpointEndToEnd } from 'tests/helpers/get-endpoint-e2e'
|
|
3
|
-
import { AudioMode } from '@/enums'
|
|
4
|
-
import { getAudioMode } from '@/functions/audio/get-audio-mode'
|
|
5
|
-
|
|
6
|
-
describe('getAudioMode', () => {
|
|
7
|
-
it('returns an audio mode', async () => {
|
|
8
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
9
|
-
const result = await getAudioMode(sonarEndpoint)
|
|
10
|
-
expect(result).toBeOneOf(Object.values(AudioMode))
|
|
11
|
-
})
|
|
12
|
-
})
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test'
|
|
2
|
-
import { getEndpointEndToEnd } from 'tests/helpers/get-endpoint-e2e'
|
|
3
|
-
import { AudioMode } from '@/enums'
|
|
4
|
-
import { setAudioMode } from '@/functions/audio/set-audio-mode'
|
|
5
|
-
|
|
6
|
-
describe('setAudioMode', () => {
|
|
7
|
-
it('returns classic when set to classic', async () => {
|
|
8
|
-
const expectedAudioMode: AudioMode = AudioMode.Classic
|
|
9
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
10
|
-
const result = await setAudioMode(sonarEndpoint, expectedAudioMode)
|
|
11
|
-
expect(result).toBe(expectedAudioMode)
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
it('returns streamer when set to streamer', async () => {
|
|
15
|
-
const expectedAudioMode: AudioMode = AudioMode.Streamer
|
|
16
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
17
|
-
const result = await setAudioMode(sonarEndpoint, expectedAudioMode)
|
|
18
|
-
expect(result).toBe(expectedAudioMode)
|
|
19
|
-
})
|
|
20
|
-
})
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test'
|
|
2
|
-
import { getEndpointEndToEnd } from 'tests/helpers/get-endpoint-e2e'
|
|
3
|
-
import { AudioChannel, AudioMode } from '@/enums'
|
|
4
|
-
import { setChannelMuteClassic } from '@/functions/audio/set-channel-mute-classic'
|
|
5
|
-
import { setAudioMode } from '@/index'
|
|
6
|
-
|
|
7
|
-
describe('setChannelMuteClassic', () => {
|
|
8
|
-
it('returns muted false', async () => {
|
|
9
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
10
|
-
|
|
11
|
-
await setAudioMode(sonarEndpoint, AudioMode.Classic)
|
|
12
|
-
const initial = await setChannelMuteClassic(sonarEndpoint, true, AudioChannel.Game)
|
|
13
|
-
const expected = await setChannelMuteClassic(sonarEndpoint, false, AudioChannel.Game)
|
|
14
|
-
|
|
15
|
-
expect(initial.isMuted).toBeTrue()
|
|
16
|
-
expect(expected.isMuted).toBeFalse()
|
|
17
|
-
})
|
|
18
|
-
})
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test'
|
|
2
|
-
import { getEndpointEndToEnd } from 'tests/helpers/get-endpoint-e2e'
|
|
3
|
-
import { AudioChannel, AudioMode, StreamerPath } from '@/enums'
|
|
4
|
-
import { setChannelMuteStreamer } from '@/functions/audio/set-channel-mute-streamer'
|
|
5
|
-
import { setAudioMode } from '@/index'
|
|
6
|
-
|
|
7
|
-
describe('setChannelMuteStreamer', () => {
|
|
8
|
-
it('returns muted false', async () => {
|
|
9
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
10
|
-
|
|
11
|
-
await setAudioMode(sonarEndpoint, AudioMode.Streamer)
|
|
12
|
-
const initial = await setChannelMuteStreamer(sonarEndpoint, true, AudioChannel.Game, StreamerPath.Streaming)
|
|
13
|
-
const expected = await setChannelMuteStreamer(sonarEndpoint, false, AudioChannel.Game, StreamerPath.Streaming)
|
|
14
|
-
|
|
15
|
-
expect(initial.isMuted).toBeTrue()
|
|
16
|
-
expect(expected.isMuted).toBeFalse()
|
|
17
|
-
})
|
|
18
|
-
})
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test'
|
|
2
|
-
import { getEndpointEndToEnd } from 'tests/helpers/get-endpoint-e2e'
|
|
3
|
-
import { AudioChannel, AudioMode } from '@/enums'
|
|
4
|
-
import { setChannelVolumeClassic } from '@/functions/audio/set-channel-volume-classic'
|
|
5
|
-
import { setAudioMode } from '@/index'
|
|
6
|
-
|
|
7
|
-
describe('setChannelVolumeClassic', () => {
|
|
8
|
-
it('returns new volume', async () => {
|
|
9
|
-
const expectedVolume = 39
|
|
10
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
11
|
-
|
|
12
|
-
await setAudioMode(sonarEndpoint, AudioMode.Classic)
|
|
13
|
-
const result = await setChannelVolumeClassic(sonarEndpoint, expectedVolume, AudioChannel.Master)
|
|
14
|
-
|
|
15
|
-
expect(result.volume).toBe(expectedVolume)
|
|
16
|
-
})
|
|
17
|
-
})
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test'
|
|
2
|
-
import { getEndpointEndToEnd } from 'tests/helpers/get-endpoint-e2e'
|
|
3
|
-
import { AudioChannel, AudioMode, StreamerPath } from '@/enums'
|
|
4
|
-
import { setChannelVolumeStreamer } from '@/functions/audio/set-channel-volume-streamer'
|
|
5
|
-
import { setAudioMode } from '@/index'
|
|
6
|
-
|
|
7
|
-
describe('setChannelVolumeStreamer', () => {
|
|
8
|
-
it('returns new volume', async () => {
|
|
9
|
-
const expectedVolume = 39
|
|
10
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
11
|
-
|
|
12
|
-
await setAudioMode(sonarEndpoint, AudioMode.Streamer)
|
|
13
|
-
const result = await setChannelVolumeStreamer(
|
|
14
|
-
sonarEndpoint,
|
|
15
|
-
expectedVolume,
|
|
16
|
-
AudioChannel.Master,
|
|
17
|
-
StreamerPath.Monitoring
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
expect(result.volume).toBe(expectedVolume)
|
|
21
|
-
})
|
|
22
|
-
})
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test'
|
|
2
|
-
import { getEndpointEndToEnd } from 'tests/helpers/get-endpoint-e2e'
|
|
3
|
-
import { AudioMode, ChatMixState } from '@/enums'
|
|
4
|
-
import { setAudioMode } from '@/functions/audio/set-audio-mode'
|
|
5
|
-
import { getChatMixState } from '@/functions/chatmix/get-chat-mix-state'
|
|
6
|
-
|
|
7
|
-
describe('getChatMixState', () => {
|
|
8
|
-
it('returns enabled state when classic', async () => {
|
|
9
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
10
|
-
await setAudioMode(sonarEndpoint, AudioMode.Classic)
|
|
11
|
-
const result = await getChatMixState(sonarEndpoint)
|
|
12
|
-
expect(result).not.toBeNull()
|
|
13
|
-
expect(result.state).toBe(ChatMixState.Enabled)
|
|
14
|
-
expect(result.isEnabled).toBeTrue()
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
it('returns disabled state when streamer', async () => {
|
|
18
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
19
|
-
await setAudioMode(sonarEndpoint, AudioMode.Streamer)
|
|
20
|
-
const result = await getChatMixState(sonarEndpoint)
|
|
21
|
-
expect(result).not.toBeNull()
|
|
22
|
-
expect(result.state).toBe(ChatMixState.FiniteWheel)
|
|
23
|
-
expect(result.isEnabled).toBeFalse()
|
|
24
|
-
})
|
|
25
|
-
})
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test'
|
|
2
|
-
import { getEndpointEndToEnd } from 'tests/helpers/get-endpoint-e2e'
|
|
3
|
-
import { AudioMode, ChatMixState } from '@/enums'
|
|
4
|
-
import { SonarRequestException } from '@/exceptions'
|
|
5
|
-
import { setAudioMode } from '@/functions/audio/set-audio-mode'
|
|
6
|
-
import { setChatMixBalance } from '@/functions/chatmix/set-chat-mix-balance'
|
|
7
|
-
|
|
8
|
-
describe('setChatBalance', () => {
|
|
9
|
-
it('returns balance when classic mode', async () => {
|
|
10
|
-
const expectedBalance = 70
|
|
11
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
12
|
-
await setAudioMode(sonarEndpoint, AudioMode.Classic)
|
|
13
|
-
const result = await setChatMixBalance(sonarEndpoint, expectedBalance)
|
|
14
|
-
expect(result).not.toBeNull()
|
|
15
|
-
expect(result.state).toBe(ChatMixState.Enabled)
|
|
16
|
-
expect(result.isEnabled).toBeTrue()
|
|
17
|
-
expect(result.chatBalance).toBe(expectedBalance)
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
it('throws when streamer mode enabled', async () => {
|
|
21
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
22
|
-
await setAudioMode(sonarEndpoint, AudioMode.Streamer)
|
|
23
|
-
expect(setChatMixBalance(sonarEndpoint, 0)).rejects.toThrow(SonarRequestException)
|
|
24
|
-
})
|
|
25
|
-
})
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test'
|
|
2
|
-
import { getEndpointEndToEnd } from 'tests/helpers/get-endpoint-e2e'
|
|
3
|
-
import { DeviceFlow } from '@/enums'
|
|
4
|
-
import { getAudioDevices } from '@/functions/devices/get-audio-devices'
|
|
5
|
-
|
|
6
|
-
describe('getAudioDevices', () => {
|
|
7
|
-
it('returns audio devices for input', async () => {
|
|
8
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
9
|
-
const result = await getAudioDevices(sonarEndpoint, DeviceFlow.Input)
|
|
10
|
-
expect(result.length).toBeGreaterThan(0)
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
it('returns audio devices for output', async () => {
|
|
14
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
15
|
-
const result = await getAudioDevices(sonarEndpoint, DeviceFlow.Output)
|
|
16
|
-
expect(result.length).toBeGreaterThan(0)
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
it('returns combined audio devices for all', async () => {
|
|
20
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
21
|
-
const resultInput = await getAudioDevices(sonarEndpoint, DeviceFlow.Input)
|
|
22
|
-
const resultOutput = await getAudioDevices(sonarEndpoint, DeviceFlow.Output)
|
|
23
|
-
const resultAll = await getAudioDevices(sonarEndpoint)
|
|
24
|
-
expect(resultInput.length).toBeGreaterThan(0)
|
|
25
|
-
expect(resultOutput.length).toBeGreaterThan(0)
|
|
26
|
-
expect(resultAll.length).toBeGreaterThan(0)
|
|
27
|
-
expect(resultAll.length).toBe(resultInput.length + resultOutput.length)
|
|
28
|
-
})
|
|
29
|
-
})
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test'
|
|
2
|
-
import { getEndpointEndToEnd } from 'tests/helpers/get-endpoint-e2e'
|
|
3
|
-
import { DeviceChannel } from '@/enums'
|
|
4
|
-
import { setAudioDevice } from '@/functions/devices/set-audio-device'
|
|
5
|
-
|
|
6
|
-
const OUTPUT_DEVICE_ID = '{0.0.0.00000000}.{0e5b2eb2-8d10-4e5f-b757-59a3e15def98}'
|
|
7
|
-
const INPUT_DEVICE_ID = '{0.0.1.00000000}.{7b82ae46-28f8-4adb-bdd2-fa08863bc5b7}'
|
|
8
|
-
|
|
9
|
-
describe('setAudioDevice', () => {
|
|
10
|
-
it('throws when input set to output', async () => {
|
|
11
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
12
|
-
expect(setAudioDevice(sonarEndpoint, DeviceChannel.Mic, OUTPUT_DEVICE_ID)).rejects.toThrow()
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
it('returns set audio devices for all output', async () => {
|
|
16
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
17
|
-
const result = await setAudioDevice(sonarEndpoint, DeviceChannel.Output, OUTPUT_DEVICE_ID)
|
|
18
|
-
expect(result.length).toBe(4)
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
it('returns set audio device for output-aux', async () => {
|
|
22
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
23
|
-
const result = await setAudioDevice(sonarEndpoint, DeviceChannel.Aux, OUTPUT_DEVICE_ID)
|
|
24
|
-
expect(result.length).toBe(1)
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
it('returns set audio device for input', async () => {
|
|
28
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
29
|
-
const result = await setAudioDevice(sonarEndpoint, DeviceChannel.Mic, INPUT_DEVICE_ID)
|
|
30
|
-
expect(result.length).toBe(1)
|
|
31
|
-
})
|
|
32
|
-
})
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { afterEach, describe, expect, it } from 'bun:test'
|
|
2
|
-
import { getAppEndpoint } from '@/functions/endpoint/get-app-endpoint'
|
|
3
|
-
|
|
4
|
-
const logs: string[] = []
|
|
5
|
-
|
|
6
|
-
afterEach(() => {
|
|
7
|
-
for (const log of logs) {
|
|
8
|
-
console.log(log)
|
|
9
|
-
}
|
|
10
|
-
logs.length = 0
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
describe('getAppEndpoint', () => {
|
|
14
|
-
it('returns ggEncryptedAddress', async () => {
|
|
15
|
-
const result = await getAppEndpoint()
|
|
16
|
-
expect(result).toBeString()
|
|
17
|
-
logs.push(`> app address: ${result}`)
|
|
18
|
-
})
|
|
19
|
-
})
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { afterEach, describe, expect, it, spyOn } from 'bun:test'
|
|
2
|
-
import { getAppEndpoint } from '@/functions/endpoint/get-app-endpoint'
|
|
3
|
-
import { getSonarEndpointCached } from '@/functions/endpoint/get-sonar-endpoint-cached'
|
|
4
|
-
|
|
5
|
-
const logs: string[] = []
|
|
6
|
-
|
|
7
|
-
afterEach(() => {
|
|
8
|
-
for (const log of logs) {
|
|
9
|
-
console.log(log)
|
|
10
|
-
}
|
|
11
|
-
logs.length = 0
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
const spy = spyOn(globalThis, 'fetch')
|
|
15
|
-
|
|
16
|
-
describe('getSonarEndpointCached', () => {
|
|
17
|
-
it('returns sonarAddress', async () => {
|
|
18
|
-
const appAddress = await getAppEndpoint()
|
|
19
|
-
const sonarAddress = await getSonarEndpointCached(appAddress)
|
|
20
|
-
expect(sonarAddress).toBeString()
|
|
21
|
-
logs.push(`> sonar address: ${sonarAddress}`)
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
it('returns cached sonarAddress', async () => {
|
|
25
|
-
const appAddress = await getAppEndpoint()
|
|
26
|
-
await getSonarEndpointCached(appAddress)
|
|
27
|
-
const sonarAddress = await getSonarEndpointCached(appAddress)
|
|
28
|
-
expect(sonarAddress).toBeString()
|
|
29
|
-
expect(spy).toHaveBeenCalledTimes(1)
|
|
30
|
-
logs.push(`> sonar address: ${sonarAddress}`)
|
|
31
|
-
})
|
|
32
|
-
})
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { afterEach, describe, expect, it } from 'bun:test'
|
|
2
|
-
import { getAppEndpoint } from '@/functions/endpoint/get-app-endpoint'
|
|
3
|
-
import { getSonarEndpoint } from '@/functions/endpoint/get-sonar-endpoint'
|
|
4
|
-
|
|
5
|
-
const logs: string[] = []
|
|
6
|
-
|
|
7
|
-
afterEach(() => {
|
|
8
|
-
for (const log of logs) {
|
|
9
|
-
console.log(log)
|
|
10
|
-
}
|
|
11
|
-
logs.length = 0
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
describe('getSonarEndpoint', () => {
|
|
15
|
-
it('returns sonarAddress', async () => {
|
|
16
|
-
const appAddress = await getAppEndpoint()
|
|
17
|
-
const sonarAddress = await getSonarEndpoint(appAddress)
|
|
18
|
-
expect(sonarAddress).toBeString()
|
|
19
|
-
logs.push(`> sonar address: ${sonarAddress}`)
|
|
20
|
-
})
|
|
21
|
-
})
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test'
|
|
2
|
-
import { getEndpointEndToEnd } from 'tests/helpers/get-endpoint-e2e'
|
|
3
|
-
import { ProfileChannel } from '@/enums'
|
|
4
|
-
import { getChannelProfiles } from '@/functions/profile/get-channel-profiles'
|
|
5
|
-
|
|
6
|
-
describe('getChannelProfiles', () => {
|
|
7
|
-
it('returns list of profiles', async () => {
|
|
8
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
9
|
-
const result = await getChannelProfiles(sonarEndpoint, ProfileChannel.Game)
|
|
10
|
-
expect(result.length).toBeGreaterThan(1)
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
it('returns list of favorite profiles only', async () => {
|
|
14
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
15
|
-
const allProfiles = await getChannelProfiles(sonarEndpoint, ProfileChannel.Game)
|
|
16
|
-
const favoriteProfiles = await getChannelProfiles(sonarEndpoint, ProfileChannel.Game, true)
|
|
17
|
-
expect(allProfiles.length).toBeGreaterThan(1)
|
|
18
|
-
expect(favoriteProfiles.length).toBeGreaterThan(1)
|
|
19
|
-
expect(favoriteProfiles.length).toBeLessThan(allProfiles.length)
|
|
20
|
-
})
|
|
21
|
-
})
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test'
|
|
2
|
-
import { getEndpointEndToEnd } from 'tests/helpers/get-endpoint-e2e'
|
|
3
|
-
import { getSelectedProfiles } from '@/functions/profile/get-selected-profiles'
|
|
4
|
-
|
|
5
|
-
describe('getSelectedProfiles', () => {
|
|
6
|
-
it('returns list of selected profiles', async () => {
|
|
7
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
8
|
-
const result = await getSelectedProfiles(sonarEndpoint)
|
|
9
|
-
expect(result.length).toBeGreaterThanOrEqual(2)
|
|
10
|
-
})
|
|
11
|
-
})
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'bun:test'
|
|
2
|
-
import { getEndpointEndToEnd } from 'tests/helpers/get-endpoint-e2e'
|
|
3
|
-
import { setSelectedProfile } from '@/functions/profile/set-selected-profile'
|
|
4
|
-
|
|
5
|
-
const INITIAL_PROFILE = 'e6979db3-3e00-4399-b58c-6f026c9ef6ba'
|
|
6
|
-
const CHANGED_PROFILE = 'c55f5f17-db23-4b0e-805c-02fd3ba39636'
|
|
7
|
-
|
|
8
|
-
describe('setSelectedProfiles', () => {
|
|
9
|
-
it('sets profile successfully', async () => {
|
|
10
|
-
const sonarEndpoint = await getEndpointEndToEnd()
|
|
11
|
-
const initial = await setSelectedProfile(sonarEndpoint, INITIAL_PROFILE)
|
|
12
|
-
const changed = await setSelectedProfile(sonarEndpoint, CHANGED_PROFILE)
|
|
13
|
-
expect(initial.id).toBe(INITIAL_PROFILE)
|
|
14
|
-
expect(changed.id).toBe(CHANGED_PROFILE)
|
|
15
|
-
expect(initial.id).not.toBe(changed.id)
|
|
16
|
-
})
|
|
17
|
-
})
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { getAppEndpoint } from '../../src/functions/endpoint/get-app-endpoint'
|
|
2
|
-
import { getSonarEndpoint } from '../../src/functions/endpoint/get-sonar-endpoint'
|
|
3
|
-
|
|
4
|
-
export async function getEndpointEndToEnd() {
|
|
5
|
-
const appEndpoint = await getAppEndpoint()
|
|
6
|
-
const sonarEndpoint = await getSonarEndpoint(appEndpoint)
|
|
7
|
-
return sonarEndpoint
|
|
8
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, it } from 'bun:test'
|
|
2
|
-
import { SonarRequestException } from '@/exceptions'
|
|
3
|
-
import { getAudioDataClassic } from '@/functions/audio/get-audio-data-classic'
|
|
4
|
-
|
|
5
|
-
let originalFetch: typeof fetch
|
|
6
|
-
|
|
7
|
-
const request = () => getAudioDataClassic('https://localhost')
|
|
8
|
-
|
|
9
|
-
describe('getAudioDataClassic', () => {
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
originalFetch = globalThis.fetch
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
afterEach(() => {
|
|
15
|
-
globalThis.fetch = originalFetch
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
it('throws SonarException when response not 200', async () => {
|
|
19
|
-
globalThis.fetch = (async () =>
|
|
20
|
-
({
|
|
21
|
-
ok: false,
|
|
22
|
-
json: async () => 'Some error occurred'
|
|
23
|
-
}) as Response) as unknown as typeof fetch
|
|
24
|
-
|
|
25
|
-
expect(request()).rejects.toThrow(SonarRequestException)
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
it('throws SonarException when response 200 but not data', async () => {
|
|
29
|
-
globalThis.fetch = (async () =>
|
|
30
|
-
({
|
|
31
|
-
ok: true,
|
|
32
|
-
json: async () => ({})
|
|
33
|
-
}) as Response) as unknown as typeof fetch
|
|
34
|
-
|
|
35
|
-
expect(request()).rejects.toThrow(SonarRequestException)
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
it('return data when response 200', async () => {
|
|
39
|
-
globalThis.fetch = (async () =>
|
|
40
|
-
({
|
|
41
|
-
ok: true,
|
|
42
|
-
json: async () => ({
|
|
43
|
-
masters: {
|
|
44
|
-
classic: {
|
|
45
|
-
volume: 0.49,
|
|
46
|
-
muted: false
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
devices: {}
|
|
50
|
-
})
|
|
51
|
-
}) as Response) as unknown as typeof fetch
|
|
52
|
-
|
|
53
|
-
const response = await request()
|
|
54
|
-
expect(response.master.volume).toBe(49)
|
|
55
|
-
expect(response.master.isMuted).toBe(false)
|
|
56
|
-
})
|
|
57
|
-
})
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, it } from 'bun:test'
|
|
2
|
-
import { SonarRequestException } from '@/exceptions'
|
|
3
|
-
import { getAudioDataStream } from '@/functions/audio/get-audio-data-stream'
|
|
4
|
-
|
|
5
|
-
let originalFetch: typeof fetch
|
|
6
|
-
|
|
7
|
-
const request = () => getAudioDataStream('https://localhost')
|
|
8
|
-
|
|
9
|
-
describe('getAudioDataStream', () => {
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
originalFetch = globalThis.fetch
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
afterEach(() => {
|
|
15
|
-
globalThis.fetch = originalFetch
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
it('throws SonarException when response not 200', async () => {
|
|
19
|
-
globalThis.fetch = (async () =>
|
|
20
|
-
({
|
|
21
|
-
ok: false,
|
|
22
|
-
json: async () => 'Some error occurred'
|
|
23
|
-
}) as Response) as unknown as typeof fetch
|
|
24
|
-
|
|
25
|
-
expect(request()).rejects.toThrow(SonarRequestException)
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
it('throws SonarException when response 200 but not data', async () => {
|
|
29
|
-
globalThis.fetch = (async () =>
|
|
30
|
-
({
|
|
31
|
-
ok: true,
|
|
32
|
-
json: async () => ({})
|
|
33
|
-
}) as Response) as unknown as typeof fetch
|
|
34
|
-
|
|
35
|
-
expect(request()).rejects.toThrow(SonarRequestException)
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
it('return data when response 200', async () => {
|
|
39
|
-
globalThis.fetch = (async () =>
|
|
40
|
-
({
|
|
41
|
-
ok: true,
|
|
42
|
-
json: async () => ({
|
|
43
|
-
masters: {
|
|
44
|
-
stream: {
|
|
45
|
-
streaming: {
|
|
46
|
-
volume: 0.49,
|
|
47
|
-
muted: true
|
|
48
|
-
},
|
|
49
|
-
monitoring: {
|
|
50
|
-
volume: 0.48,
|
|
51
|
-
muted: false
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
devices: {}
|
|
56
|
-
})
|
|
57
|
-
}) as Response) as unknown as typeof fetch
|
|
58
|
-
|
|
59
|
-
const response = await request()
|
|
60
|
-
expect(response.master.streaming.volume).toBe(49)
|
|
61
|
-
expect(response.master.streaming.isMuted).toBe(true)
|
|
62
|
-
expect(response.master.monitoring.volume).toBe(48)
|
|
63
|
-
expect(response.master.monitoring.isMuted).toBe(false)
|
|
64
|
-
})
|
|
65
|
-
})
|