MCPcopy Create free account
hub / github.com/arctic-cli/interface / formatRefreshParts

Function formatRefreshParts

packages/arctic/src/provider/usage.ts:1026–1040  ·  view source on GitHub ↗
(parts: {
      refreshToken: string
      projectId?: string
      managedProjectId?: string
    })

Source from the content-addressed store, hash-verified

1024 }
1025
1026 function formatRefreshParts(parts: {
1027 refreshToken: string
1028 projectId?: string
1029 managedProjectId?: string
1030 }): string {
1031 if (!parts.refreshToken) {
1032 return ""
1033 }
1034 if (!parts.projectId && !parts.managedProjectId) {
1035 return parts.refreshToken
1036 }
1037 const projectSegment = parts.projectId ?? ""
1038 const managedSegment = parts.managedProjectId ?? ""
1039 return `${parts.refreshToken}|${projectSegment}|${managedSegment}`
1040 }
1041
1042 async function ensureGoogleAccessToken(auth: Extract<Auth.Info, { type: "oauth" }>, providerID: string): Promise<string> {
1043 const refreshParts = parseRefreshParts(auth.refresh)

Callers 1

ensureProjectContextFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected