|
| 1 | +import type { components, paths } from './api/index.js'; |
| 2 | +import * as callbacksIndex from '@openapi-qraft/react/callbacks'; |
| 3 | +import * as callbacks from '@openapi-qraft/react/callbacks/index'; |
| 4 | +import { useMutation } from '@openapi-qraft/react/callbacks/useMutation'; |
| 5 | +import { useQuery } from '@openapi-qraft/react/callbacks/useQuery'; |
| 6 | +import { |
| 7 | + createSecureRequestFn, |
| 8 | + QraftSecureRequestFn, |
| 9 | +} from '@openapi-qraft/react/Unstable_QraftSecureRequestFn'; |
| 10 | +import { createAPIClient as createAPIClientMjs } from './api/index.js'; |
| 11 | + |
| 12 | +console.log({} satisfies Partial<components>); |
| 13 | +console.log({} satisfies Partial<paths>); |
| 14 | + |
| 15 | +if (typeof createAPIClientMjs !== 'undefined') { |
| 16 | + console.log('Client is imported successfully from esm project.'); |
| 17 | +} else { |
| 18 | + console.error('Client is not imported from esm project.'); |
| 19 | + process.exit(1); |
| 20 | +} |
| 21 | + |
| 22 | +if (typeof callbacks !== 'undefined') { |
| 23 | + console.log('Callbacks are imported successfully from esm project.'); |
| 24 | +} else { |
| 25 | + console.error('Callbacks are not imported from esm project.'); |
| 26 | + process.exit(1); |
| 27 | +} |
| 28 | + |
| 29 | +if (typeof callbacksIndex !== 'undefined') { |
| 30 | + console.log('Callbacks index is imported successfully from esm project.'); |
| 31 | +} else { |
| 32 | + console.error('Callbacks index is not imported from esm project.'); |
| 33 | + process.exit(1); |
| 34 | +} |
| 35 | + |
| 36 | +if (typeof useMutation !== 'undefined') { |
| 37 | + console.log('useMutation is imported successfully from esm project.'); |
| 38 | +} else { |
| 39 | + console.error('useMutation is not imported from esm project.'); |
| 40 | + process.exit(1); |
| 41 | +} |
| 42 | + |
| 43 | +if (typeof useQuery !== 'undefined') { |
| 44 | + console.log('useQuery is imported successfully from esm project.'); |
| 45 | +} else { |
| 46 | + console.error('useQuery is not imported from esm project.'); |
| 47 | + process.exit(1); |
| 48 | +} |
| 49 | + |
| 50 | +if (typeof createSecureRequestFn !== 'undefined') { |
| 51 | + console.log( |
| 52 | + 'createSecureRequestFn is imported successfully from esm project.' |
| 53 | + ); |
| 54 | +} else { |
| 55 | + console.error('createSecureRequestFn is not imported from esm project.'); |
| 56 | + process.exit(1); |
| 57 | +} |
| 58 | + |
| 59 | +if (typeof QraftSecureRequestFn !== 'undefined') { |
| 60 | + console.log( |
| 61 | + 'QraftSecureRequestFn is imported successfully from esm project.' |
| 62 | + ); |
| 63 | +} else { |
| 64 | + console.error('QraftSecureRequestFn is not imported from esm project.'); |
| 65 | + process.exit(1); |
| 66 | +} |
0 commit comments