-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #437 from impresso/develop
Release v3.0.2
- Loading branch information
Showing
7 changed files
with
45 additions
and
71 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Params } from '@feathersjs/feathers' | ||
import { SlimUser } from '../../authentication' | ||
|
||
interface ErrorsCollectorPayload { | ||
id: string | ||
url: string | ||
errorMessage: string | ||
stackTrace?: string | ||
origin?: string | ||
className?: string | ||
type?: string | ||
} | ||
|
||
interface ErrorContext extends ErrorsCollectorPayload { | ||
userId?: string | ||
timestamp: string // ISO 8601 | ||
} | ||
|
||
/* eslint-disable no-unused-vars */ | ||
export default class ErrorsCollector { | ||
async create(data: ErrorsCollectorPayload, params: Params) { | ||
const user: SlimUser | undefined = (params as any).user | ||
const context = { ...data, userId: user?.uid, timestamp: new Date().toISOString() } | ||
const message = `[WebApp Error] ${JSON.stringify(context)}` | ||
console.error(message) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { HookMap } from '@feathersjs/feathers' | ||
import { AppServices, ImpressoApplication } from '../../types' | ||
import { authenticateAround as authenticate } from '../../hooks/authenticate' | ||
|
||
export default { | ||
around: { | ||
all: [authenticate({ allowUnauthenticated: true })], | ||
}, | ||
} satisfies HookMap<ImpressoApplication, AppServices> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Application } from '@feathersjs/feathers' | ||
import Service from './errors-collector.class' | ||
import hooks from './errors-collector.hooks' | ||
|
||
export default function (app: Application) { | ||
app.use('/errors-collector', new Service()) | ||
app.service('errors-collector').hooks(hooks) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters