MCPcopy Index your code
hub / github.com/simstudioai/sim / recordKnowledgeBaseOwnership

Function recordKnowledgeBaseOwnership

apps/sim/app/api/files/multipart/route.ts:98–113  ·  view source on GitHub ↗
(
  payload: UploadTokenPayload,
  key: string
)

Source from the content-addressed store, hash-verified

96 * from this binding, so every KB object must have one. No-op for other contexts.
97 */
98const recordKnowledgeBaseOwnership = async (
99 payload: UploadTokenPayload,
100 key: string
101): Promise<void> => {
102 if (payload.context !== 'knowledge-base' || !payload.workspaceId) {
103 return
104 }
105 await recordKnowledgeBaseFileOwnership({
106 key,
107 userId: payload.userId,
108 workspaceId: payload.workspaceId,
109 originalName: payload.fileName ?? key.split('/').pop() ?? key,
110 contentType: payload.contentType ?? 'application/octet-stream',
111 size: typeof payload.fileSize === 'number' ? payload.fileSize : 0,
112 })
113}
114
115export const POST = withRouteHandler(async (request: NextRequest) => {
116 try {

Callers 1

completeOneFunction · 0.85

Calls 1

Tested by

no test coverage detected