Skip to content

Commit d8fe4b6

Browse files
committed
fix(react-doc): restore stripped exports and remove server-only dependency
1 parent b1d8b1a commit d8fe4b6

180 files changed

Lines changed: 613 additions & 523 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/sim/app/(auth)/reset-password/reset-password-form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface RequestResetFormProps {
1616
className?: string
1717
}
1818

19-
function RequestResetForm({
19+
export function RequestResetForm({
2020
email,
2121
onEmailChange,
2222
onSubmit,

apps/sim/app/(landing)/models/components/model-primitives.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
formatUpdatedAt,
99
} from '@/app/(landing)/models/utils'
1010

11-
function Breadcrumbs({ items }: { items: Array<{ label: string; href?: string }> }) {
11+
export function Breadcrumbs({ items }: { items: Array<{ label: string; href?: string }> }) {
1212
return (
1313
<nav
1414
aria-label='Breadcrumb'
@@ -59,7 +59,7 @@ export function ProviderIcon({
5959
)
6060
}
6161

62-
function StatCard({
62+
export function StatCard({
6363
label,
6464
value,
6565
compact = false,
@@ -84,7 +84,7 @@ function StatCard({
8484
)
8585
}
8686

87-
function DetailItem({ label, value }: { label: string; value: string }) {
87+
export function DetailItem({ label, value }: { label: string; value: string }) {
8888
return (
8989
<div className='rounded-[5px] border border-[var(--landing-border)] bg-[var(--landing-bg-card)] px-3 py-2'>
9090
<p className='font-martian-mono text-[var(--landing-text-subtle)] text-xs uppercase tracking-[0.1em]'>

apps/sim/app/(landing)/models/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export function formatUpdatedAt(date: string): string {
174174
}
175175
}
176176

177-
function formatCapabilityBoolean(
177+
export function formatCapabilityBoolean(
178178
value: boolean | undefined,
179179
{
180180
positive = 'Supported',
@@ -791,7 +791,7 @@ export function getLargestContextProviderModel(provider: CatalogProvider): Catal
791791
)
792792
}
793793

794-
function getProviderCapabilitySummary(provider: CatalogProvider): CapabilityFact[] {
794+
export function getProviderCapabilitySummary(provider: CatalogProvider): CapabilityFact[] {
795795
const reasoningCount = provider.models.filter(
796796
(model) => model.capabilities.reasoningEffort || model.capabilities.thinking
797797
).length

apps/sim/app/api/a2a/serve/[agentId]/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function createError(
7878
return { jsonrpc: '2.0', id, error: { code, message, data } }
7979
}
8080

81-
function isJSONRPCRequest(obj: unknown): obj is JSONRPCRequest {
81+
export function isJSONRPCRequest(obj: unknown): obj is JSONRPCRequest {
8282
if (!obj || typeof obj !== 'object') return false
8383
const r = obj as Record<string, unknown>
8484
return r.jsonrpc === '2.0' && typeof r.method === 'string' && r.id !== undefined
@@ -88,7 +88,7 @@ export function generateTaskId(): string {
8888
return generateId()
8989
}
9090

91-
function createTaskStatus(state: TaskState): { state: TaskState; timestamp: string } {
91+
export function createTaskStatus(state: TaskState): { state: TaskState; timestamp: string } {
9292
return { state, timestamp: new Date().toISOString() }
9393
}
9494

apps/sim/app/api/files/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class InvalidRequestError extends Error {
3535
}
3636
}
3737

38-
const contentTypeMap: Record<string, string> = {
38+
export const contentTypeMap: Record<string, string> = {
3939
txt: 'text/plain',
4040
csv: 'text/csv',
4141
json: 'application/json',

apps/sim/app/api/table/utils.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export function accessError(
108108
* Converts a TableAccessDenied result to an appropriate HTTP response.
109109
* Use with checkTableAccess or checkTableWriteAccess.
110110
*/
111-
function tableAccessError(
111+
export function tableAccessError(
112112
result: TableAccessDenied,
113113
requestId: string,
114114
context?: string
@@ -124,7 +124,7 @@ async function verifyTableWorkspace(tableId: string, workspaceId: string): Promi
124124
return table?.workspaceId === workspaceId
125125
}
126126

127-
function errorResponse(
127+
export function errorResponse(
128128
message: string,
129129
status: number,
130130
details?: unknown
@@ -136,23 +136,23 @@ function errorResponse(
136136
return NextResponse.json(body, { status })
137137
}
138138

139-
function badRequestResponse(message: string, details?: unknown) {
139+
export function badRequestResponse(message: string, details?: unknown) {
140140
return errorResponse(message, 400, details)
141141
}
142142

143-
function unauthorizedResponse(message = 'Authentication required') {
143+
export function unauthorizedResponse(message = 'Authentication required') {
144144
return errorResponse(message, 401)
145145
}
146146

147-
function forbiddenResponse(message = 'Access denied') {
147+
export function forbiddenResponse(message = 'Access denied') {
148148
return errorResponse(message, 403)
149149
}
150150

151-
function notFoundResponse(message = 'Resource not found') {
151+
export function notFoundResponse(message = 'Resource not found') {
152152
return errorResponse(message, 404)
153153
}
154154

155-
function serverErrorResponse(message = 'Internal server error') {
155+
export function serverErrorResponse(message = 'Internal server error') {
156156
return errorResponse(message, 500)
157157
}
158158

apps/sim/app/api/tools/mysql/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function validateWhereClause(where: string): void {
152152
}
153153
}
154154

155-
function sanitizeIdentifier(identifier: string): string {
155+
export function sanitizeIdentifier(identifier: string): string {
156156
if (identifier.includes('.')) {
157157
const parts = identifier.split('.')
158158
return parts.map((part) => sanitizeSingleIdentifier(part)).join('.')

apps/sim/app/api/tools/neo4j/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function validateCypherQuery(query: string): { isValid: boolean; error?:
5555
return { isValid: true }
5656
}
5757

58-
function sanitizeLabelName(name: string): string {
58+
export function sanitizeLabelName(name: string): string {
5959
if (!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(name)) {
6060
throw new Error(
6161
'Invalid label name. Must start with a letter and contain only letters, numbers, and underscores.'
@@ -64,7 +64,7 @@ function sanitizeLabelName(name: string): string {
6464
return name
6565
}
6666

67-
function sanitizePropertyKey(key: string): string {
67+
export function sanitizePropertyKey(key: string): string {
6868
if (!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(key)) {
6969
throw new Error(
7070
'Invalid property key. Must start with a letter and contain only letters, numbers, and underscores.'
@@ -73,7 +73,7 @@ function sanitizePropertyKey(key: string): string {
7373
return key
7474
}
7575

76-
function sanitizeRelationshipType(type: string): string {
76+
export function sanitizeRelationshipType(type: string): string {
7777
if (!/^[A-Z][A-Z0-9_]*$/.test(type)) {
7878
throw new Error(
7979
'Invalid relationship type. Must start with an uppercase letter and contain only uppercase letters, numbers, and underscores.'

apps/sim/app/api/tools/postgresql/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function validateQuery(query: string): { isValid: boolean; error?: string
6161
return { isValid: true }
6262
}
6363

64-
function sanitizeIdentifier(identifier: string): string {
64+
export function sanitizeIdentifier(identifier: string): string {
6565
if (identifier.includes('.')) {
6666
const parts = identifier.split('.')
6767
return parts.map((part) => sanitizeSingleIdentifier(part)).join('.')

apps/sim/app/api/tools/rds/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export function validateQuery(query: string): { isValid: boolean; error?: string
9393
return { isValid: true }
9494
}
9595

96-
function sanitizeIdentifier(identifier: string): string {
96+
export function sanitizeIdentifier(identifier: string): string {
9797
if (identifier.includes('.')) {
9898
const parts = identifier.split('.')
9999
return parts.map((part) => sanitizeSingleIdentifier(part)).join('.')

0 commit comments

Comments
 (0)