MCPcopy Create free account
hub / github.com/simstudioai/sim / fetchDeployedChatConfig

Function fetchDeployedChatConfig

apps/sim/hooks/queries/chats.ts:61–82  ·  view source on GitHub ↗
(
  identifier: string,
  signal?: AbortSignal
)

Source from the content-addressed store, hash-verified

59}
60
61async function fetchDeployedChatConfig(
62 identifier: string,
63 signal?: AbortSignal
64): Promise<DeployedChatConfigResult> {
65 try {
66 const config = await requestJson(getDeployedChatConfigContract, {
67 params: { identifier },
68 signal,
69 })
70 return { kind: 'config', config }
71 } catch (error) {
72 if (error instanceof ApiClientError && error.status === 401) {
73 const authType = AUTH_ERROR_MAP[error.message]
74 if (authType) {
75 return { kind: 'auth', authType }
76 }
77 throw new Error('Unauthorized', { cause: error })
78 }
79
80 throw error
81 }
82}
83
84/**
85 * Loads the public chat configuration for a deployed chat identifier.

Callers 1

useDeployedChatConfigFunction · 0.85

Calls 1

requestJsonFunction · 0.90

Tested by

no test coverage detected