From c3d74c5ccbc1851097f3835bd23c09a932cf7538 Mon Sep 17 00:00:00 2001 From: Tom Gobich Date: Sun, 22 Dec 2024 11:59:12 -0500 Subject: [PATCH] fixed: build errors --- app/dtos/session_log.ts | 1 - app/models/notification.ts | 14 +++++++------- components.d.ts | 4 ---- database/factories/collection_factory.ts | 11 +++++------ package-lock.json | 8 ++++++++ package.json | 2 ++ 6 files changed, 22 insertions(+), 18 deletions(-) diff --git a/app/dtos/session_log.ts b/app/dtos/session_log.ts index 085837e..a68d1bf 100644 --- a/app/dtos/session_log.ts +++ b/app/dtos/session_log.ts @@ -1,7 +1,6 @@ import { BaseModelDto } from '@adocasts.com/dto/base' import SessionLog from '#models/session_log' import UserDto from '#dtos/user' -import type { UAParser } from 'ua-parser-js' export default class SessionLogDto extends BaseModelDto { declare id: number diff --git a/app/models/notification.ts b/app/models/notification.ts index bf51710..81afef0 100644 --- a/app/models/notification.ts +++ b/app/models/notification.ts @@ -7,7 +7,6 @@ import Profile from '#models/profile' import AppBaseModel from '#models/app_base_model' import NotificationTypes from '#enums/notification_types' import NotImplementedException from '#exceptions/not_implemented_exception' -import Emitter from '@adonisjs/core/services/emitter' export default class Notification extends AppBaseModel { @column({ isPrimary: true }) @@ -103,14 +102,15 @@ export default class Notification extends AppBaseModel { } async trySendEmail( - userId: number, - trx: TransactionClientContract | undefined | null = undefined + _userId: number, + _trx: TransactionClientContract | undefined | null = undefined ) { - const user = await User.query().where({ id: userId }).preload('profile').firstOrFail() + throw new NotImplementedException('Email notification sending is not implemented yet') + // const user = await User.query().where({ id: userId }).preload('profile').firstOrFail() - if (!this.isEmailEnabled(user.profile)) return - if (!trx) return Emitter.emit('notification:send', { notification: this, user }) + // if (!this.isEmailEnabled(user.profile)) return + // if (!trx) return emitter.emit('notification:send', { notification: this, user }) - trx.on('commit', () => Emitter.emit('notification:send', { notification: this, user })) + // trx.on('commit', () => emitter.emit('notification:send', { notification: this, user })) } } diff --git a/components.d.ts b/components.d.ts index 499f3df..bccd40b 100644 --- a/components.d.ts +++ b/components.d.ts @@ -92,10 +92,8 @@ declare module 'vue' { DropdownMenuSubContent: typeof import('./inertia/components/ui/dropdown-menu/DropdownMenuSubContent.vue')['default'] DropdownMenuSubTrigger: typeof import('./inertia/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue')['default'] DropdownMenuTrigger: typeof import('./inertia/components/ui/dropdown-menu/DropdownMenuTrigger.vue')['default'] - FilePicker: typeof import('./inertia/components/FilePicker.vue')['default'] FormDialog: typeof import('./inertia/components/FormDialog.vue')['default'] FormInput: typeof import('./inertia/components/FormInput.vue')['default'] - ImageUpload: typeof import('./inertia/components/ImageUpload.vue')['default'] Input: typeof import('./inertia/components/ui/input/Input.vue')['default'] Label: typeof import('./inertia/components/ui/label/Label.vue')['default'] Menubar: typeof import('./inertia/components/ui/menubar/Menubar.vue')['default'] @@ -168,10 +166,8 @@ declare module 'vue' { TagsInputItemText: typeof import('./inertia/components/ui/tags-input/TagsInputItemText.vue')['default'] TaxonomyTags: typeof import('./inertia/components/TaxonomyTags.vue')['default'] Textarea: typeof import('./inertia/components/ui/textarea/Textarea.vue')['default'] - TipTapCodeBlockNode: typeof import('./inertia/components/TipTapCodeBlockNode.vue')['default'] TipTapCommandPallete: typeof import('./inertia/components/TipTapCommandPallete.vue')['default'] TipTapEditor: typeof import('./inertia/components/TipTapEditor.vue')['default'] - TipTipCodeBlockNode: typeof import('./inertia/components/TipTipCodeBlockNode.vue')['default'] ToastManager: typeof import('./inertia/components/ToastManager.vue')['default'] Tooltip: typeof import('./inertia/components/ui/tooltip/Tooltip.vue')['default'] TooltipContent: typeof import('./inertia/components/ui/tooltip/TooltipContent.vue')['default'] diff --git a/database/factories/collection_factory.ts b/database/factories/collection_factory.ts index f5d9229..1a71104 100644 --- a/database/factories/collection_factory.ts +++ b/database/factories/collection_factory.ts @@ -5,12 +5,11 @@ import { PostFactory } from '#factories/post_factory' import { AssetFactory } from '#factories/asset_factory' import CollectionTypes from '#enums/collection_types' -export const CollectionFactory = Factory - .define(Collection, ({ faker }) => ({ - name: faker.commerce.productName(), - description: faker.lorem.sentence(), - collectionTypeId: CollectionTypes.SERIES - })) +export const CollectionFactory = Factory.define(Collection, ({ faker }) => ({ + name: faker.commerce.productName(), + description: faker.lorem.sentence(), + collectionTypeId: CollectionTypes.SERIES, +})) .relation('owner', () => UserFactory) .relation('posts', () => PostFactory) .relation('children', () => CollectionFactory) diff --git a/package-lock.json b/package-lock.json index 0f77296..409d177 100644 --- a/package-lock.json +++ b/package-lock.json @@ -88,6 +88,7 @@ "@japa/plugin-adonisjs": "^3.0.1", "@japa/runner": "^3.1.4", "@swc/core": "1.7.26", + "@types/dinero.js": "^1.9.4", "@types/js-cookie": "^3.0.6", "@types/luxon": "^3.4.2", "@types/node": "^22.7.5", @@ -3805,6 +3806,13 @@ "integrity": "sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ==", "license": "MIT" }, + "node_modules/@types/dinero.js": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@types/dinero.js/-/dinero.js-1.9.4.tgz", + "integrity": "sha512-mtJnan4ajy9MqvoJGVXu0tC9EAAzFjeoKc3d+8AW+H/Od9+8IiC59ymjrZF+JdTToyDvkLReacTsc50Z8eYr6Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", diff --git a/package.json b/package.json index 7f35c04..57bfca8 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "#abilities/*": "./app/abilities/*.js", "#strategies/*": "./app/strategies/*.js", "#database/*": "./database/*.js", + "#factories/*": "./database/factories/*.js", "#tests/*": "./tests/*.js", "#start/*": "./start/*.js", "#config/*": "./config/*.js" @@ -44,6 +45,7 @@ "@japa/plugin-adonisjs": "^3.0.1", "@japa/runner": "^3.1.4", "@swc/core": "1.7.26", + "@types/dinero.js": "^1.9.4", "@types/js-cookie": "^3.0.6", "@types/luxon": "^3.4.2", "@types/node": "^22.7.5",