@@ -256,6 +256,7 @@ while (true) {
256256
257257 const getAsyncCommand = ( ) : string => {
258258 if ( ! info ) return ''
259+ if ( info . isPublicApi ) throw new Error ( 'Async execution requires an API key' )
259260 const endpoint = getBaseEndpoint ( )
260261 const v2WorkflowPrefix = '/api/v2/workflows/'
261262 if ( ! endpoint . includes ( v2WorkflowPrefix ) || ! endpoint . endsWith ( '/execute' ) ) {
@@ -538,49 +539,51 @@ console.log(limits);`
538539 />
539540 </ div >
540541
541- < div >
542- < div className = 'mb-[6.5px] flex items-center justify-between' >
543- < Label className = 'block pl-0.5 font-medium text-[var(--text-primary)] text-small' >
544- Run workflow (async)
545- </ Label >
546- < div className = 'flex items-center gap-1.5' >
547- < Tooltip . Root >
548- < Tooltip . Trigger asChild >
549- < Button
550- variant = 'ghost'
551- onClick = { ( ) => handleCopy ( 'async' , getAsyncCommand ( ) ) }
552- aria-label = 'Copy command'
553- className = '!p-1.5 -my-1.5'
554- >
555- { copied . async ? < Check className = 'size-3' /> : < Clipboard className = 'size-3' /> }
556- </ Button >
557- </ Tooltip . Trigger >
558- < Tooltip . Content >
559- < span > { copied . async ? 'Copied' : 'Copy' } </ span >
560- </ Tooltip . Content >
561- </ Tooltip . Root >
562- < Combobox
563- size = 'sm'
564- className = '!w-fit !py-0.5 min-w-[100px] rounded-md px-[9px]'
565- options = { [
566- { label : 'Start Execution' , value : 'execute' } ,
567- { label : 'Check Status' , value : 'status' } ,
568- { label : 'Usage Limits' , value : 'rate-limits' } ,
569- ] }
570- value = { asyncExampleType }
571- onChange = { ( value ) => setAsyncExampleType ( value as AsyncExampleType ) }
572- align = 'end'
573- dropdownWidth = { 160 }
574- />
542+ { ! info . isPublicApi && (
543+ < div >
544+ < div className = 'mb-[6.5px] flex items-center justify-between' >
545+ < Label className = 'block pl-0.5 font-medium text-[var(--text-primary)] text-small' >
546+ Run workflow (async)
547+ </ Label >
548+ < div className = 'flex items-center gap-1.5' >
549+ < Tooltip . Root >
550+ < Tooltip . Trigger asChild >
551+ < Button
552+ variant = 'ghost'
553+ onClick = { ( ) => handleCopy ( 'async' , getAsyncCommand ( ) ) }
554+ aria-label = 'Copy command'
555+ className = '!p-1.5 -my-1.5'
556+ >
557+ { copied . async ? < Check className = 'size-3' /> : < Clipboard className = 'size-3' /> }
558+ </ Button >
559+ </ Tooltip . Trigger >
560+ < Tooltip . Content >
561+ < span > { copied . async ? 'Copied' : 'Copy' } </ span >
562+ </ Tooltip . Content >
563+ </ Tooltip . Root >
564+ < Combobox
565+ size = 'sm'
566+ className = '!w-fit !py-0.5 min-w-[100px] rounded-md px-[9px]'
567+ options = { [
568+ { label : 'Start Execution' , value : 'execute' } ,
569+ { label : 'Check Status' , value : 'status' } ,
570+ { label : 'Usage Limits' , value : 'rate-limits' } ,
571+ ] }
572+ value = { asyncExampleType }
573+ onChange = { ( value ) => setAsyncExampleType ( value as AsyncExampleType ) }
574+ align = 'end'
575+ dropdownWidth = { 160 }
576+ />
577+ </ div >
575578 </ div >
579+ < Code . Viewer
580+ code = { getAsyncCommand ( ) }
581+ language = { LANGUAGE_SYNTAX [ language ] }
582+ wrapText
583+ className = '!min-h-0 rounded-sm border border-[var(--border-1)]'
584+ />
576585 </ div >
577- < Code . Viewer
578- code = { getAsyncCommand ( ) }
579- language = { LANGUAGE_SYNTAX [ language ] }
580- wrapText
581- className = '!min-h-0 rounded-sm border border-[var(--border-1)]'
582- />
583- </ div >
586+ ) }
584587 </ div >
585588 )
586589}
0 commit comments