diff --git a/resources/scripts/api/account/api-keys.ts b/resources/scripts/api/account/api-keys.ts index 66217a587..326e2e3b9 100644 --- a/resources/scripts/api/account/api-keys.ts +++ b/resources/scripts/api/account/api-keys.ts @@ -1,7 +1,7 @@ import useSWR, { SWRConfiguration, SWRResponse } from 'swr'; import http, { FractalResponseList } from '@/api/http'; -import Transformers from '@transformers'; -import { PersonalAccessToken } from '@models'; +import Transformers from '@definitions/user/transformers'; +import { PersonalAccessToken } from '@definitions/user/models'; import { AxiosError } from 'axios'; import useUserSWRContextKey from '@/plugins/useUserSWRContextKey'; diff --git a/resources/scripts/api/account/security-keys.ts b/resources/scripts/api/account/security-keys.ts index d2a9af9fd..2f5763cf8 100644 --- a/resources/scripts/api/account/security-keys.ts +++ b/resources/scripts/api/account/security-keys.ts @@ -1,7 +1,7 @@ import useSWR, { SWRConfiguration, SWRResponse } from 'swr'; import http, { FractalResponseList } from '@/api/http'; -import Transformers from '@transformers'; -import { SecurityKey } from '@models'; +import Transformers from '@definitions/user/transformers'; +import { SecurityKey } from '@definitions/user/models'; import { AxiosError } from 'axios'; import { base64Decode, bufferDecode, bufferEncode, decodeSecurityKeyCredentials } from '@/helpers'; import { LoginResponse } from '@/api/auth/login'; diff --git a/resources/scripts/api/definitions/admin/models.d.ts b/resources/scripts/api/definitions/admin/models.d.ts new file mode 100644 index 000000000..e69de29bb diff --git a/resources/scripts/api/definitions/admin/transformers.ts b/resources/scripts/api/definitions/admin/transformers.ts new file mode 100644 index 000000000..e69de29bb diff --git a/resources/scripts/api/types/models.d.ts b/resources/scripts/api/definitions/user/models.d.ts similarity index 100% rename from resources/scripts/api/types/models.d.ts rename to resources/scripts/api/definitions/user/models.d.ts diff --git a/resources/scripts/api/types/transformers.ts b/resources/scripts/api/definitions/user/transformers.ts similarity index 95% rename from resources/scripts/api/types/transformers.ts rename to resources/scripts/api/definitions/user/transformers.ts index cf7b000a3..6edf9ce8f 100644 --- a/resources/scripts/api/types/transformers.ts +++ b/resources/scripts/api/definitions/user/transformers.ts @@ -1,4 +1,4 @@ -import * as Models from '@models'; +import * as Models from './models'; export default class Transformers { static toSecurityKey (data: Record): Models.SecurityKey { diff --git a/resources/scripts/components/dashboard/security/AddSecurityKeyForm.tsx b/resources/scripts/components/dashboard/security/AddSecurityKeyForm.tsx index 01a184162..8f7dc822f 100644 --- a/resources/scripts/components/dashboard/security/AddSecurityKeyForm.tsx +++ b/resources/scripts/components/dashboard/security/AddSecurityKeyForm.tsx @@ -1,4 +1,4 @@ -import { SecurityKey } from '@models'; +import { SecurityKey } from '@definitions/user/models'; import { useFlashKey } from '@/plugins/useFlash'; import { Form, Formik, FormikHelpers } from 'formik'; import { registerSecurityKey } from '@/api/account/security-keys'; diff --git a/tsconfig.json b/tsconfig.json index ac41d53cd..8ce55c40b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,11 +26,8 @@ "@feature/*": [ "./resources/scripts/components/server/features/*" ], - "@models": [ - "./resources/scripts/api/types/models.d.ts" - ], - "@transformers": [ - "./resources/scripts/api/types/transformers.ts" + "@definitions/*": [ + "./resources/scripts/api/definitions/*" ] }, "plugins": [ diff --git a/webpack.config.js b/webpack.config.js index 22cd3c18d..e1c9ebb06 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -78,8 +78,7 @@ module.exports = { extensions: ['.ts', '.tsx', '.js', '.json'], alias: { '@': path.join(__dirname, '/resources/scripts'), - '@models': path.join(__dirname, '/resources/scripts/api/types/models.d.ts'), - '@transformers': path.join(__dirname, '/resources/scripts/api/types/transformers.ts'), + '@definitions': path.join(__dirname, '/resources/scripts/api/definitions'), '@feature': path.join(__dirname, '/resources/scripts/components/server/features'), 'react-dom': '@hot-loader/react-dom', },