Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .agents/skills/add-block/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ sourceIds.forEach((id) => delete params[id]) // subblock ids are deleted
if (chosen !== undefined) params[group.canonicalId] = chosen
```

So by the time `tools.config.params(inputs)` runs (`executor/handlers/generic/generic-handler.ts`),
So by the time `tools.config.params(inputs)` runs (`executor/handlers/generic/handler.ts`),
`params.uploadFile` and `params.fileRef` are **gone** and the value is under `params.file`. Reading a
subblock id there yields `undefined` and silently sends no file.

Expand All @@ -359,7 +359,7 @@ and the first non-empty advanced value in advanced mode, so a stale value in the
never leak. `normalizeFileInput` then handles the JSON string that advanced-mode template resolution
produces.

Note that `generic-handler` merges rather than replaces (`{ ...inputs, ...transformedParams }`), so
Note that `generic/handler` merges rather than replaces (`{ ...inputs, ...transformedParams }`), so
omitting a key from the returned object does not strip it from what the tool receives. Tools simply
ignore params they do not declare.

Expand Down
4 changes: 2 additions & 2 deletions .agents/skills/add-integration/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,8 @@ File Downloads and Generated Files.
| Helper | Location | Purpose |
|--------|----------|---------|
| `normalizeFileInput` | `@/blocks/utils` | Normalize file params in block config |
| `processFilesToUserFiles` | `@/lib/uploads/utils/file-utils` | Convert raw inputs to UserFile[] |
| `downloadFileFromStorage` | `@/lib/uploads/utils/file-utils.server` | Get file Buffer from UserFile |
| `processFilesToUserFiles` | `@/lib/uploads/utils/file` | Convert raw inputs to UserFile[] |
| `downloadFileFromStorage` | `@/lib/uploads/utils/file.server` | Get file Buffer from UserFile |
| `FileToolProcessor` | `@/executor/utils/file-tool-processor` | Executor-side; stores declared file outputs (not called by tools) |
| `isUserFile` | `@/lib/core/utils/user-file` | Type guard for UserFile objects |
| `FileInputSchema` | `@/lib/uploads/utils/file-schemas` | Zod schema for file validation |
Expand Down
4 changes: 2 additions & 2 deletions .agents/skills/add-managed-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Read these live sources before editing; do not copy their current entries into t
2. `apps/sim/lib/execution/remote-sandbox/cli-tools.server.ts` — server-only recipes and recipe helpers.
3. `apps/sim/lib/execution/remote-sandbox/cli-tools.test.ts` — catalog and supply-chain invariants.
4. `apps/sim/lib/execution/remote-sandbox/cli-tools-boundary.test.ts` — client/server import boundary.
5. `apps/sim/lib/execution/remote-sandbox/sandbox-spec.ts` — content-addressed hash inputs.
5. `apps/sim/lib/execution/remote-sandbox/spec.ts` — content-addressed hash inputs.

Read `resolve.ts` and `e2b.ts` only when changing provisioning mechanics. A normal catalog addition should not require UI, API, database, resolver, or provider edits; those paths derive from the registries.

Expand Down Expand Up @@ -114,7 +114,7 @@ Never commit downloaded artifacts or credentials.
bun run --cwd apps/sim test \
lib/execution/remote-sandbox/cli-tools.test.ts \
lib/execution/remote-sandbox/cli-tools-boundary.test.ts \
lib/execution/remote-sandbox/sandbox-spec.test.ts \
lib/execution/remote-sandbox/spec.test.ts \
lib/execution/remote-sandbox/resolve.test.ts \
'app/workspace/[workspaceId]/settings/components/sandboxes/utils.test.ts'
```
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/migrate-application-operation/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Read these files completely before editing:
- `apps/sim/lib/api/server/routes/internal-json-route.ts`
- `apps/sim/lib/api/server/routes/v2-json-route.ts`
- `apps/sim/lib/auth/internal-delegation.ts`
- `apps/sim/lib/mothership/application/application-adapter.ts`
- `apps/sim/lib/mothership/application/adapter.ts`
- `apps/sim/lib/mothership/auth/application-delegation.ts`

Use the file domain only as a representative golden slice:
Expand Down
4 changes: 2 additions & 2 deletions .claude/rules/sim-sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ paths:
- "apps/sim/lib/execution/isolated-vm-worker.cjs"
- "apps/sim/lib/execution/isolated-vm.ts"
- "apps/sim/lib/execution/sandbox/**"
- "apps/sim/sandbox-tasks/**"
- "apps/sim/sandboxes/**"
---

# Sim Sandbox — Worker Security Policy
Expand Down Expand Up @@ -40,7 +40,7 @@ about what must **never** live in that process.
validation.

4. **Nothing that runs in the isolate is trusted, even if we wrote it**. The
task `bootstrap` and `finalize` strings in `apps/sim/sandbox-tasks/` execute
task `bootstrap` and `finalize` strings in `apps/sim/sandboxes/` execute
inside the isolate. They must treat `globalThis` as adversarial — no pulling
values from it that might have been mutated by user code. The hardening
script in `executeTask` undefines dangerous globals before user code runs.
Expand Down
4 changes: 2 additions & 2 deletions .cursor/rules/sim-sandbox.mdc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: "Isolated-vm sandbox worker security policy. Hard rules for anything that lives in the worker child process that runs user code."
globs: ["apps/sim/lib/execution/isolated-vm-worker.cjs","apps/sim/lib/execution/isolated-vm.ts","apps/sim/lib/execution/sandbox/**","apps/sim/sandbox-tasks/**"]
globs: ["apps/sim/lib/execution/isolated-vm-worker.cjs","apps/sim/lib/execution/isolated-vm.ts","apps/sim/lib/execution/sandbox/**","apps/sim/sandboxes/**"]
---

<!-- Generated from .claude/rules/sim-sandbox.md by `bun run skills:sync`. Edit the source, not this file. -->
Expand Down Expand Up @@ -38,7 +38,7 @@ about what must **never** live in that process.
validation.

4. **Nothing that runs in the isolate is trusted, even if we wrote it**. The
task `bootstrap` and `finalize` strings in `apps/sim/sandbox-tasks/` execute
task `bootstrap` and `finalize` strings in `apps/sim/sandboxes/` execute
inside the isolate. They must treat `globalThis` as adversarial — no pulling
values from it that might have been mutated by user code. The hardening
script in `executeTask` undefines dangerous globals before user code runs.
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/(auth)/login/login-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { normalizeEmail } from '@sim/utils/string'
import { useRouter, useSearchParams } from 'next/navigation'
import { requestJson } from '@/lib/api/client/request'
import { forgetPasswordContract } from '@/lib/api/contracts'
import { client } from '@/lib/auth/auth-client'
import { client } from '@/lib/auth/client'
import { getEnv, isFalsy } from '@/lib/core/config/env'
import { isSsoEnabled } from '@/lib/core/config/env-flags'
import { validateCallbackUrl } from '@/lib/core/security/input-validation'
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/(auth)/oauth/consent/consent-view.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { createRoot, type Root } from 'react-dom/client'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'

vi.mock('@/lib/auth/auth-client', () => authClientMock)
vi.mock('@/lib/auth/client', () => authClientMock)

import { OAuthConsentView } from '@/app/(auth)/oauth/consent/consent-view'
import { oauthProviderKeys } from '@/hooks/queries/oauth-provider'
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/(auth)/signup/signup-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useRouter, useSearchParams } from 'next/navigation'
import { usePostHog } from 'posthog-js/react'
import { trackFreebuffConversion } from '@/lib/analytics/freebuff'
import { trackGoogleEvent } from '@/lib/analytics/google'
import { client, useSession } from '@/lib/auth/auth-client'
import { client, useSession } from '@/lib/auth/client'
import { useTrackingConsent } from '@/lib/consent/tracking-consent'
import { getEnv, isFalsy } from '@/lib/core/config/env'
import { isSsoEnabled } from '@/lib/core/config/env-flags'
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/(auth)/verify/use-verification.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { nextNavigationMock } from '@sim/testing/mocks/next-navigation.mock'
import { createRoot, type Root } from 'react-dom/client'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'

vi.mock('@/lib/auth/auth-client', () => authClientMock)
vi.mock('@/lib/auth/client', () => authClientMock)
vi.mock('next/navigation', () => nextNavigationMock)

import { useVerification } from '@/app/(auth)/verify/use-verification'
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/(auth)/verify/use-verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useEffect, useState } from 'react'
import { createLogger } from '@sim/logger'
import { normalizeEmail } from '@sim/utils/string'
import { useSearchParams } from 'next/navigation'
import { client, useSession } from '@/lib/auth/auth-client'
import { client, useSession } from '@/lib/auth/client'
import { SSO_REQUIRED_ERROR_CODE } from '@/lib/auth/constants'
import { validateCallbackUrl } from '@/lib/core/security/input-validation'
import { DEFAULT_POST_AUTH_ROUTE, POST_AUTH_REDIRECT_STORAGE_KEY } from '@/app/(auth)/auth-redirect'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { sleep } from '@sim/utils/helpers'
import { getDocumentIcon } from '@/components/icons/document-icons'
import { isSafeHttpUrl } from '@/lib/core/utils/urls'
import { saveBlob } from '@/lib/uploads/client/download'
import { tryInferContextFromKey } from '@/lib/uploads/utils/file-utils'
import { tryInferContextFromKey } from '@/lib/uploads/utils/file'
import type { ChatFile } from '@/app/(interfaces)/chat/components/message/message'

const logger = createLogger('ChatFileDownload')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { Table } from '@sim/emcn/icons'
import { SlackIcon } from '@/components/icons'
import { ActivityStatus } from '@/components/ui/activity-status'
import {
getToolInProgressTitle,
getToolStatusDisplayTitle,
} from '@/lib/mothership/tools/tool-display'
import { getToolInProgressTitle, getToolStatusDisplayTitle } from '@/lib/mothership/tools/display'
import type {
ToolActivityPresentation,
ToolCallItemProps,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/_shell/providers/browser-telemetry.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const { session, consent, settings, start, stop } = vi.hoisted(() => {
}
})

vi.mock('@/lib/auth/auth-client', () => authClientMock)
vi.mock('@/lib/auth/client', () => authClientMock)
vi.mock('@/lib/consent/tracking-consent', () => ({ useTrackingConsent: () => consent }))
vi.mock('@/hooks/queries/general-settings', () => ({ useGeneralSettings: () => settings }))
vi.mock('@/lib/telemetry/browser', () => ({ startBrowserTelemetry: start }))
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/_shell/providers/browser-telemetry.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import { useEffect, useSyncExternalStore } from 'react'
import { useSession } from '@/lib/auth/auth-client'
import { useSession } from '@/lib/auth/client'
import {
getStoredMeasurementPermission,
subscribeStoredMeasurementPermission,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/_shell/providers/session-provider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { createRoot, type Root } from 'react-dom/client'
import { beforeEach, describe, expect, it, vi } from 'vitest'

vi.mock('@/lib/auth/auth-client', () => authClientMock)
vi.mock('@/lib/auth/client', () => authClientMock)

vi.mock('posthog-js', () => ({
default: {
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/_shell/providers/session-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type React from 'react'
import { createContext, useEffect, useMemo } from 'react'
import { createLogger } from '@sim/logger'
import { useQueryClient } from '@tanstack/react-query'
import { client } from '@/lib/auth/auth-client'
import { client } from '@/lib/auth/client'
import {
type AppSession,
extractSessionDataFromAuthClientResult,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/api/billing/update-cost/route.integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ vi.mock('@/lib/mothership/request/http', async (importOriginal) => ({
import {
BILLING_ACCOUNT_DECISION_HEADER,
serializeAccountBillingDecisionHeader,
} from '@/lib/billing/core/billing-attribution'
} from '@/lib/billing/core/attribution'
import { claimTerminalPeriod } from '@/lib/billing/cycle-close'
import { POST } from '@/app/api/billing/update-cost/route'

Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/api/billing/update-cost/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ vi.mock('@/lib/mothership/request/otel', () => mothershipOtelMock)

vi.mock('@/lib/billing/core/usage-log', () => billingUsageLogMock)

vi.mock('@/lib/billing/core/billing-attribution', () => billingAttributionMock)
vi.mock('@/lib/billing/core/attribution', () => billingAttributionMock)

vi.mock('@/lib/billing/core/billing', () => billingCoreMock)

Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/api/billing/update-cost/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
requireBillingCallbackAttribution,
resolveLegacyV0BillingAttribution,
toBillingContext,
} from '@/lib/billing/core/billing-attribution'
} from '@/lib/billing/core/attribution'
import {
type MidRunUsageVerdict,
readMidRunAccountUsageVerdict,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/api/chat/manage/[id]/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const mocks = vi.hoisted(() => ({

vi.mock('@sim/audit', () => auditMock)
vi.mock('@sim/platform-authz/workspace', () => workspaceAuthzMock)
vi.mock('@/lib/workspaces/application/workspace-context', () => workspaceContextMock)
vi.mock('@/lib/workspaces/application/context', () => workspaceContextMock)
vi.mock('@/lib/chat-deployments/queries', () => ({
getChatDeploymentWithWorkspace: mocks.getChatDeploymentWithWorkspace,
getChatDeploymentIdOwningIdentifier: mocks.getIdentifierOwner,
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/app/api/copilot/api-keys/validate/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ const SELF_HOSTED_OPAQUE_WORKSPACE_VALIDATE_BODY = {
workspaceId: 'local-self-hosted-workspace',
} as const

vi.mock('@/lib/billing/core/billing-attribution', async (importOriginal) => ({
...(await importOriginal<typeof import('@/lib/billing/core/billing-attribution')>()),
vi.mock('@/lib/billing/core/attribution', async (importOriginal) => ({
...(await importOriginal<typeof import('@/lib/billing/core/attribution')>()),
BILLING_ACCOUNT_DECISION_HEADER: 'x-sim-billing-account-decision',
BILLING_ATTRIBUTION_HEADER: 'x-sim-billing-attribution',
BILLING_REQUEST_ID_HEADER: 'x-sim-billing-request-id',
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/api/copilot/api-keys/validate/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
resolveOrganizationBillingAttribution,
serializeAccountBillingDecisionHeader,
serializeBillingAttributionHeader,
} from '@/lib/billing/core/billing-attribution'
} from '@/lib/billing/core/attribution'
import {
readMidRunAccountUsageVerdict,
readMidRunUsageVerdict,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/api/copilot/chat/abort/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ vi.mock('@/lib/mothership/request/session/explicit-abort', () => ({
const { mockChatContext } = vi.hoisted(() => ({
mockChatContext: vi.fn(),
}))
vi.mock('@/lib/workspaces/application/workspace-context', () => workspaceContextMock)
vi.mock('@/lib/workspaces/application/context', () => workspaceContextMock)
vi.mock('@/lib/auth/ban', () => authBanMock)
vi.mock('@/lib/mothership/chat/application/context', () => ({
resolveOwnedChatContext: mockChatContext,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/api/credentials/[id]/members/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const mocks = vi.hoisted(() => ({

vi.mock('@sim/audit', () => auditMock)
vi.mock('@sim/platform-authz/workspace', () => workspaceAuthzMock)
vi.mock('@/lib/workspaces/application/workspace-context', () => workspaceContextMock)
vi.mock('@/lib/workspaces/application/context', () => workspaceContextMock)
vi.mock('@/lib/credentials/members', () => ({
leaveCredentialMembership: vi.fn(),
listCredentialMembers: mocks.listMembers,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/api/credentials/[id]/members/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
listCredentialMembersUseCase,
removeCredentialMemberUseCase,
upsertCredentialMemberUseCase,
} from '@/lib/credentials/application/credential-members'
} from '@/lib/credentials/application/members'
import { credentialOperations } from '@/lib/credentials/application/operations'

const rateLimit = internalRateLimits.none({ reason: 'Preserve existing internal behavior' })
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/api/credentials/[id]/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const mocks = vi.hoisted(() => ({
remove: vi.fn(),
}))

vi.mock('@/lib/credentials/application/credential-crud', () => ({
vi.mock('@/lib/credentials/application/crud', () => ({
CredentialProviderOperationError: class CredentialProviderOperationError extends Error {},
getWorkspaceCredentialUseCase: {
operation: { id: 'credentials.read' },
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/api/credentials/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
import {
getWorkspaceCredentialUseCase,
updateWorkspaceCredentialUseCase,
} from '@/lib/credentials/application/credential-crud'
} from '@/lib/credentials/application/crud'
import { credentialOperations } from '@/lib/credentials/application/operations'
import { toWorkspaceCredential } from '@/lib/credentials/application/presentation'
import { deleteCredentialUseCase } from '@/lib/credentials/application/service-account'
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/api/credentials/memberships/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import {
leaveCredentialMembershipUseCase,
listCredentialMembershipsUseCase,
} from '@/lib/credentials/application/credential-members'
} from '@/lib/credentials/application/members'
import { credentialUserOperations } from '@/lib/credentials/application/operations'

const rateLimit = internalRateLimits.none({ reason: 'Preserve existing internal behavior' })
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/api/credentials/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ vi.mock('@/lib/integrations/credential-visibility.server', () => ({

vi.mock('@/lib/workspaces/permissions/utils', () => permissionsMock)

vi.mock('@/lib/workspaces/application/workspace-context', () => workspaceContextMock)
vi.mock('@/lib/workspaces/application/context', () => workspaceContextMock)

vi.mock('@sim/platform-authz/workspace', () => workspaceAuthzMock)

Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/api/credentials/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import {
createWorkspaceCredential,
listInternalCredentials,
} from '@/lib/credentials/application/credential-crud'
} from '@/lib/credentials/application/crud'
import { credentialOperations } from '@/lib/credentials/application/operations'
import { toWorkspaceCredential } from '@/lib/credentials/application/presentation'

Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/api/custom-blocks/[id]/usages/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'
import { OrchestrationError } from '@/lib/core/orchestration/types'

vi.mock('@sim/platform-authz/workspace', () => workspaceAuthzMock)
vi.mock('@/lib/workspaces/application/workspace-context', () => workspaceContextMock)
vi.mock('@/lib/workspaces/application/context', () => workspaceContextMock)

vi.mock('@/lib/workflows/custom-blocks/operations', () => customBlockOperationsMock)

Expand Down
4 changes: 2 additions & 2 deletions apps/sim/app/api/files/authorization.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const { mockFindWorkspaceFileVersionKeys } = vi.hoisted(() => ({
mockFindWorkspaceFileVersionKeys: vi.fn(),
}))

vi.mock('@/lib/uploads/contexts/workspace/workspace-file-versions', () => ({
vi.mock('@/lib/uploads/contexts/workspace/file-version-store', () => ({
findWorkspaceFileVersionKeys: mockFindWorkspaceFileVersionKeys,
}))

Expand All @@ -39,7 +39,7 @@ vi.mock('@/lib/uploads/config', () => uploadsConfigMock)

vi.mock('@/lib/uploads/server/metadata', () => uploadsMetadataMock)

vi.mock('@/lib/uploads/utils/file-utils', () => fileUtilsMock)
vi.mock('@/lib/uploads/utils/file', () => fileUtilsMock)

vi.mock('@/lib/workspaces/permissions/utils', () => permissionsMock)

Expand Down
4 changes: 2 additions & 2 deletions apps/sim/app/api/files/authorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import {
import { type KnowledgeReadAccess, knowledgeReadAccessBatches } from '@/lib/knowledge/read-access'
import { getFileMetadata } from '@/lib/uploads'
import type { StorageContext } from '@/lib/uploads/config'
import { findWorkspaceFileVersionKeys } from '@/lib/uploads/contexts/workspace/workspace-file-versions'
import { findWorkspaceFileVersionKeys } from '@/lib/uploads/contexts/workspace/file-version-store'
import type { StorageConfig } from '@/lib/uploads/core/storage-client'
import { getFileMetadataByKey } from '@/lib/uploads/server/metadata'
import { isWorkspaceScopedContext } from '@/lib/uploads/shared/types'
import { inferContextFromKey } from '@/lib/uploads/utils/file-utils'
import { inferContextFromKey } from '@/lib/uploads/utils/file'
import { getUserEntityPermissions } from '@/lib/workspaces/permissions/utils'

const logger = createLogger('FileAuthorization')
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/api/files/delete/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
import type { StorageContext } from '@/lib/uploads/config'
import { deleteFile } from '@/lib/uploads/core/storage-service'
import { deleteFileMetadata } from '@/lib/uploads/server/metadata'
import { extractStorageKey, inferContextFromKey } from '@/lib/uploads/utils/file-utils'
import { extractStorageKey, inferContextFromKey } from '@/lib/uploads/utils/file'
import { verifyFileAccess, verifyKBFileWriteAccess } from '@/app/api/files/authorization'
import {
createFileErrorResponse,
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/api/files/export/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
import { getFileMetadataById } from '@/lib/uploads/server/metadata'
import { getWorkspaceFileSize } from '@/lib/uploads/shared/types'
import { storedFileId } from '@/lib/uploads/utils/embedded-image-ref'
import { formatFileSize } from '@/lib/uploads/utils/file-utils'
import { formatFileSize } from '@/lib/uploads/utils/file'
import { verifyFileAccess } from '@/app/api/files/authorization'
import { encodeFilenameForHeader } from '@/app/api/files/utils'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { mockEnforceRateLimit, mockValidateDeploymentAuth, mockResolveServableDoc
})
)

vi.mock('@/lib/public-shares/share-manager', () => publicSharesMock)
vi.mock('@/lib/public-shares/manager', () => publicSharesMock)

vi.mock('@/lib/public-shares/rate-limit', () => ({
enforcePublicFileRateLimit: mockEnforceRateLimit,
Expand Down
Loading
Loading