MCPcopy Index your code
hub / github.com/callstack/agent-device / parseConnectionProfile

Function parseConnectionProfile

src/cli/connection/cloud-profile.ts:82–97  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

80}
81
82function parseConnectionProfile(value: unknown): RemoteConfigProfile {
83 if (!value || typeof value !== 'object' || Array.isArray(value)) {
84 throw new AppError('COMMAND_FAILED', 'Cloud connection profile response is invalid.');
85 }
86 const connection = (value as CloudConnectionProfileResponse).connection;
87 if (!connection || typeof connection !== 'object') {
88 throw new AppError('COMMAND_FAILED', 'Cloud connection profile response is missing profile.');
89 }
90 if (connection.remoteConfigProfile !== undefined) {
91 return parseRemoteConfigProfile(connection.remoteConfigProfile);
92 }
93 throw new AppError(
94 'COMMAND_FAILED',
95 'Cloud connection profile did not include remoteConfigProfile.',
96 );
97}
98
99function parseRemoteConfigProfile(value: unknown): RemoteConfigProfile {
100 if (!value || typeof value !== 'object' || Array.isArray(value)) {

Callers 1

fetchConnectionProfileFunction · 0.85

Calls 1

parseRemoteConfigProfileFunction · 0.85

Tested by

no test coverage detected