-
-
Notifications
You must be signed in to change notification settings - Fork 2
Initial version #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bludnic
wants to merge
46
commits into
master
Choose a base branch
from
dev
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
6d9d0fe
feat: retryNotify job
zasulskii f87cf29
feat: add logs
zasulskii aae9a93
feat: config validation, postinstall script
zasulskii 0fb0171
chore: fix index to config rename
zasulskii 89f3a90
fix: logger error message
zasulskii 2a32735
feat: refactor notification service, remove DI
zasulskii c267081
chore: remove unused file
zasulskii ac109d9
feat: shutdown, event-based txs
zasulskii 2ff63de
feat: fast transactions fetch after service is shutdown
zasulskii 63c5a07
feat: remove transactions jobs, refactor to transaction channel
zasulskii 2a68205
feat: transaction channel destroy
zasulskii 60f456d
refactor: message to messageMany while processing txs to notify
zasulskii 59defd6
fix: handle transaction ref to unsub from socket
zasulskii 23feef3
docs(README.md): register/unregister device transaction payload
bludnic cccf684
chore(package.json): upgrade husky
bludnic 1528248
chore: gitignore .env
bludnic 0649db0
chore(package.json): upgrade dependencies
bludnic a249cf7
fix(build): disable DTS (build error)
bludnic a0866f6
Merge remote-tracking branch 'origin/dev' into dev
bludnic 9077201
chore: gitignore package-lock.json
bludnic 0432d7d
chore(Node): enable source map support for stack traces
bludnic 71fd99b
chore: configure dotenv
bludnic d02b247
refactor: remove DATABASE_URL from config (use ENV instead)
bludnic d29d8b5
fix: unhandled error when processing a Signal Transaction
bludnic 7ac2cc3
chore: configure Vitest
bludnic d3a103e
chore(prisma): `deviceId` should be provided by the client
bludnic 3ad6f12
feat(zod): add runtime type for `SignalMessagePayload`
bludnic aa3c4d7
refactor: simplify fastify server
bludnic 9bc5571
refactor: simplify logger
bludnic 3f953dd
refactor(prisma): simplify `checkConnection()`
bludnic 9173b16
refactor(config): prettify
bludnic d14ddda
refactor(prettier): print semicolons at the ends of statements
bludnic bb23787
refactor: organize gitignore
bludnic e04a87f
chore(TypeScript): enable JSON modules
bludnic dfeebc4
refactor: simplify the config
bludnic c557205
chore(npm): add `typecheck` command
bludnic 7e88715
refactor(config): sort imports
bludnic 46af467
docs(README.md): provider should be uppercased
bludnic fdc0777
chore: add .env.example
bludnic 5d16a65
refactor(firebase): rename config example
bludnic 4695e4d
chore: upgrade fastify
bludnic 58599eb
chore(fastify): add zod validation
bludnic e5ffe76
refactor(TransactionsChannel): simplify
bludnic 3af6933
refactor: improve TransactionChannel
bludnic 2844196
feat(TransactionChannel): type on/emit methods
bludnic 3a9edbf
feat: refactor service
bludnic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -2,3 +2,6 @@ node_modules | |
| dist/ | ||
| .idea | ||
| firebase-credentials.json | ||
| logs/* | ||
| !/logs/.gitkeep | ||
| config.json5 | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ | |
| "lint": "eslint .", | ||
| "lint:fix": "eslint . --fix", | ||
| "format": "prettier --write ./src", | ||
| "postinstall": "husky install" | ||
| "postinstall": "husky install && prisma generate" | ||
| }, | ||
| "author": "ADAMANT Foundation <[email protected]>", | ||
| "license": "GPL-3.0", | ||
|
|
@@ -57,6 +57,7 @@ | |
| "firebase-admin": "^12.2.0", | ||
| "json5": "^2.2.3", | ||
| "node-cron": "^3.0.3", | ||
| "prisma": "^5.16.0" | ||
| "prisma": "^5.16.0", | ||
| "zod": "^3.23.8" | ||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
prisma/migrations/20240813133939_add_tx_to_notification/migration.sql
This file contains hidden or 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 @@ | ||
| /* | ||
| Warnings: | ||
|
|
||
| - Added the required column `admTx` to the `NotifyTransaction` table without a default value. This is not possible if the table is not empty. | ||
|
|
||
| */ | ||
| -- AlterTable | ||
| ALTER TABLE "NotifyTransaction" ADD COLUMN "admTx" JSONB NOT NULL; |
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,14 @@ | ||
| import { BaseNotificationInterface } from './baseNotification.js' | ||
| import { PushServiceProvider } from '../../types/models.js' | ||
|
|
||
| export class ApnsNotification implements BaseNotificationInterface { | ||
| provider = PushServiceProvider.APNS | ||
|
|
||
| message(): Promise<string> { | ||
| throw new Error('Not implemented') | ||
| } | ||
|
|
||
| messageMany() { | ||
| throw new Error('Not implemented') | ||
| } | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,22 @@ | ||
| import { z } from 'zod' | ||
|
|
||
| export const schema = z | ||
| .object({ | ||
| database: z.object({ | ||
| url: z.string() | ||
| }), | ||
| app: z.object({ | ||
| port: z.number() | ||
| }), | ||
| notificationExpiryHours: z.number(), | ||
| admNodes: z.array(z.string()), | ||
| passPhrase: z.string(), | ||
| notifyTxTypes: z.array(z.number()), | ||
| chatTxTypeIncludeSubtype: z.array(z.number()), | ||
| latestHeightToNotify: z.number() | ||
| }) | ||
| .strict() /* Throw error on unknown properties. This will help users to migrate from the | ||
| * older versions of the bot that use different config schema | ||
| */ | ||
|
|
||
| export type Schema = z.infer<typeof schema> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.