Skip to content
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

User accounts notifications #164

Conversation

ignazio-bovo
Copy link
Contributor

@ignazio-bovo ignazio-bovo commented Aug 10, 2023

Changelog

Implementation choices

  1. Notification are not deleted if referred entity has been deleted (eg. notification for a video posted is not deleted if a video is deleted later on). I have chosen this for simplicity of the implementation and also because I find it consistent with what most apps do (eg. chats with a deleted account on telegram)
  2. Together with point 1: there is no explicit way for a user to delete a notification (as this was not specified in the design)
  3. Two entities for displaying notification to the user EmailDeliveryNotification used to register an notification email delivery and InAppDeliveryNotification. Fetching data for notification center / studio should should use the InAppDeliveryNotification entity and from there walk to the desired Notification fields
  4. In order to keep both runtime related and off chain notification under a single entity I have used a tagged id:
    • Notification.id = OnChainNotification-${COUNTER} for runtime related notification
    • Notification.id = OffChainNotification-${COUNTER} for off chain related notification
      The migration for these ids will be slightly akward but doable
  5. The design requires for example when a nft is set on auction that the page link will direct the user to the video page with the nft widget open. @attemka confirmed that at the moment this is not possible, so I just have a redirect to the video page
  6. The email template color are black blue and white but it doesn't look as good as in the design (this is ok I guess as in v2 we will change the template for a digest-like email)
  7. Whenever some infomation is missing for the notification text (eg. untitled video, untitled channel and so on) a "" string is used
  8. The email notification will have for "unsuscribe" link the following: https://gleev.xyz/member/${membership.handle}/?tab=preferences confident that the user preferences will have their own dedicated tab @thesan

fix: add notification and template choice

feat: sketch mutation for setting the prefeences

fix: arguments for preference selection function

feat: add runtime notification data and notification preferences

fix: notification for runtime events

fix: add notification preference mutation

feat: add email strategy

fix: split Notification into onchain and offchain

fix: add channel created event notifiation

feat: distinguisher between member and channel notifiation

feat: enable offchain notification entities export

fix: notification preferences resolver

fix: migration

feat: default notification preferences

feat: start adding tests

fix: tests

fix: tests

fix: notificatino preference mutation and complete test

fix: add support for offchain dat

fix: missc

fix: format & fix build errors

fix: build and migrations

fix: bugs in setting notifications

fix: add case for notification mutation status

fix: build errors

fix: format

fix: data
export / import scripts allows to specify fields of entities which will be migrated
In this case runtime notification will be migrated partially by offchain and partiall
by handlers
fix: notifications

fix: misc
@ignazio-bovo
Copy link
Contributor Author

ignazio-bovo commented Aug 16, 2023

I think we should have some sort of basic integration-tests support in the Orion repo so that while making changes to the existing mappings, we don't introduce any bugs. I see /run-tests.sh file has been added but it does not seem to test anything. Do you plan to add/improve the tests in the same PR?

No, I tried to but it was taking too much time and I need to focus on other projects. I think this can be prioritized however
There is already some proposal #147 but not reviewed and not implemented yet

You are using the uniqueId function to assign Ids to some of the entities. This is not ideal as database entity IDs should not be completely random (could lead to ID collusion; though very very minimal chance) instead they should have some structure, either use crypto.randomUUID function or use uuid npm package for assigning IDs to entities.

Migrating to uuid would be too complex.
Also using the birthday paradox formula approximation:
with number of days = strings of variable length x Base64 encoded. So for x = 8 you would need square_root(1 trillion) = 1 million entities to have to have collision probability of about 1 - exp(- (1 trillion)/(2 * 64^8)) = .17%. I think it's safe. (userId is computed using x=32)

@zeeshanakram3
Copy link
Contributor

Migrating to uuid would be too complex. Also using the birthday paradox formula approximation: with number of days = strings of variable length x Base64 encoded. So for x = 8 you would need square_root(1 trillion) = 1 million entities to have to have collision probability of about 1 - exp(- (1 trillion)/(2 * 64^8)) = .17%. I think it's safe. (userId is computed using x=32)

Yeah, that's why I said very very minimal chance, ok, sounds good. Just make sure that we are using uniqueId(32)instead of uniqueId(8) in all new entities

@ignazio-bovo
Copy link
Contributor Author

I have refactored all the notification variants, so that text and link now have to be provided by:

  • front-end in case of inApp delivery
  • email scheduler in case of email delivery (this as agreed on the last Orion weekly is now part of the scope and it will be a PR following this)

Copy link
Contributor

@zeeshanakram3 zeeshanakram3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introducing the p-limit dependency breaks the both orion_processor & orion_graphql-server instances. The reason is that p-limit@4.0.0 is an ESM module & you can import an ESM module inside a common module. Downgrading to p-limit@3.1.0 fixes the problem

image

Also, please address the other comments

Comment on lines +5 to +15
export async function getNextIdForEntity(em: EntityManager, entityName: string): Promise<number> {
const id = parseInt(
(
await em.getRepository(NextEntityId).findOne({
where: { entityName },
lock: { mode: 'pessimistic_write' },
})
)?.nextId.toString() || '1'
)
return id
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to use Postgres SERIAL column type (see: https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL), instead of manually incrementing the entity ID in the application.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The data types smallserial, serial and bigserial are not true types, but merely a notational convenience for creating unique identifier columns"
So I don't think it will fit the case, as there will be just one row for the NextEntityId

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plus it would be complex to generate @ PrimaryGeneratedColumn for every column of the table, since it is not possible to do so with squid typegen

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the use of this file? I don't see this being referenced anywhere.

package.json Outdated
@@ -58,7 +60,10 @@
"handlebars": "^4.7.7",
"haversine-distance": "^1.2.1",
"lodash": "^4.17.21",
"mjml": "^4.14.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed that, mjml dependency seems to be unused

package.json Outdated
@@ -44,6 +45,7 @@
"@subsquid/typeorm-migration": "^0.1.4",
"@subsquid/typeorm-store": "^0.2.0",
"@types/lodash": "^4.14.189",
"@types/mjml": "^4.7.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like this is unused

package.json Outdated
@@ -58,7 +60,10 @@
"handlebars": "^4.7.7",
"haversine-distance": "^1.2.1",
"lodash": "^4.17.21",
"mjml": "^4.14.1",
"napi-macros": "^2.2.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused dependency

nft_history_entry: [`EXISTS(SELECT 1 FROM "event" WHERE "id"="event_id")`],
nft_activity: [`EXISTS(SELECT 1 FROM "event" WHERE "id"="event_id")`],
notification: [`EXISTS(SELECT 1 FROM "event" WHERE "id"="event_id")`],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even for the on-chain events we need to hide, we need to hide the status field from the view, because we don't to expose the information about when the notification was read in the public schema

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made the notification table hidden, for simplicity

src/server-extension/resolvers/ChannelsResolver/index.ts Outdated Show resolved Hide resolved
src/server-extension/resolvers/ChannelsResolver/index.ts Outdated Show resolved Hide resolved
src/server-extension/resolvers/ChannelsResolver/index.ts Outdated Show resolved Hide resolved
notificationType
)
// create notification (for the notification center)
const nextNotificationId = await getNextIdForEntity(em, notificationChainTag)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems incorrect? As the OnChainNotification & OffChainNotification entity names do not exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NextEntityId table contains pairs entityName and id it doesn't necessary impose that the entityName must be a table in the database. In other words it is just a table with counters

Copy link
Contributor

@zeeshanakram3 zeeshanakram3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An issue I discovered while testing again is that you can you cant mix up the use of overlay (in-memnory cache layer) & em (Entity manager) within the single transaction, especially if one data record you are querying using em was created using the overlay within the current transaction. this would lead to error crashin the orion processor. (see https://github.com/Joystream/orion/blob/c66eba0a805de28d13800b91e10588bef9fc6abc/docs/developer-guide/tutorials/adding-new-event-handlers.md#understanding-the-overlay)

For example, in ChannelCreatedEvent mapping, channel entity is being created using overlay (which means that it's not actually created on db, and it only exists in momry yet). and then in the addNotifications function (basically in getChannelTitle function), the entity is being directly fetch from the db (using em), which would result in error since entity does not exist yet.

src/mappings/content/channel.ts Outdated Show resolved Hide resolved
src/server-extension/resolvers/VideosResolver/index.ts Outdated Show resolved Hide resolved
@ignazio-bovo
Copy link
Contributor Author

I noticed the same issue also for email notifications, that's why I had to split entities in case we are using

  • entity manager
  • overlay

This should work, and it is simple but it is not the best approach, as the overlay has no mechanism to set whether a cached entity has been invalidated

Comment on lines 61 to 66
notificationDelivery.deliveryStatus = await executeMailDelivery(
appName,
store.getEm(),
toAccount,
content
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the on-chain notification delivery logic is still using the em instead of overlay, in executeMailDelivery function, so the delivery would fail if the cached content is not saved into the db

e.g here is the error in case of channel created event

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is not in the delivery, is in the content creation (as the error suggest)
It is trying to fetch the entity data (for some notification for which entity data is required) in order to construct the content from orion_db but the overlay hasn't flushed yet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to fix the link and the text construction part

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should no longer be a problem now since all notification data is provided at addNotification call site

feat: ♻️ refactor mail code

fix: ⚡ royalty price precision

fix: 🐛 PR comments

perf: ⚡ add max number of concurrent promises for fetching channel followers

fix: 🐛 PR comments

fix: 🐛 PR comments

fix: 🐛 PR comments

regenerate data

Update src/mappings/content/channel.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

Update src/server-extension/resolvers/VideosResolver/index.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

fix: 🐛 overlay vs orion_db for notification

Now notification are first written in the overlay (if deposited by processor) otherwise they are written directly into orion_db

fix: 🐛 overlay vs orion_db for notification

Now notification are first written in the overlay (if deposited by processor) otherwise they are written directly into orion_db

fix: 🐛 overlay vs orion_db for notification

Now notification are first written in the overlay (if deposited by processor) otherwise they are written directly into orion_db

fix: 🐛 separate mail sent by processor and those sent by server due to overlay presence

fix: 🐛 notification & notification on chain delivery mail deposit

fix: 🐛 notification & notification on chain delivery mail deposit

fix: 🐛 notification & notification on chain delivery mail deposit
edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers
edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers
edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers
edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers
edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers
edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers
edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers
Copy link
Contributor

@zeeshanakram3 zeeshanakram3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, there are still a few improvements that can be added, but that can be left for your notifications scheduler PR. So looks good.

@ignazio-bovo ignazio-bovo merged commit 9395557 into Joystream:orion_notifications Aug 25, 2023
4 checks passed
ignazio-bovo added a commit that referenced this pull request Nov 29, 2023
* User accounts notifications (#164)

* feat: squash all commits for notification demo

fix: add notification and template choice

feat: sketch mutation for setting the prefeences

fix: arguments for preference selection function

feat: add runtime notification data and notification preferences

fix: notification for runtime events

fix: add notification preference mutation

feat: add email strategy

fix: split Notification into onchain and offchain

fix: add channel created event notifiation

feat: distinguisher between member and channel notifiation

feat: enable offchain notification entities export

fix: notification preferences resolver

fix: migration

feat: default notification preferences

feat: start adding tests

fix: tests

fix: tests

fix: notificatino preference mutation and complete test

fix: add support for offchain dat

fix: missc

fix: format & fix build errors

fix: build and migrations

fix: bugs in setting notifications

fix: add case for notification mutation status

fix: build errors

fix: format

fix: data

* fix: remove non needed entity for migration

export / import scripts allows to specify fields of entities which will be migrated
In this case runtime notification will be migrated partially by offchain and partiall
by handlers

* feat: mark notifications as read

* fix: runtime notification migration generation

* feat: add event notification for video posted

* feat: add video comment

* feat: add chanel verification mutation

* feat: video excluded from app notifications

* feat: channel exclusion

* fix: Channel exclusion

* feat: notification deposit for video reaction

* feat: reaction for comment notification

* feat: refactor and add channel excluded mail template

* fix: email

* feat: regenerate migrations

fix: notifications

fix: misc

* fix: WS_SOURCE for archive

* feat: boilerplate code for notification testing

fix: gql subscriptions

* ♻️ Refactor into object mother like context

* 🩹 Fix: graphql client now working

* 🐛 Logged in client able to send mutation

* ✏️ Fix: set missing notification preferences

* 🩹 Match notification pref names with design

* 🩹 Match notification pref names with design

* 🩹 Fix: SetAccountNotificationPreference resolver

* ✅ Test: Channel created notification

* ✅ Test: FolloChannel notificatino

* ♻️ Ref: notification deposit function

* ✅ Test: Video posted

* ♻️ Ref: addNotification and notification type

* feat: 🎨 create extrinsic file and add make payment to channel

* feat: 🎨 add extra extrinsic for auction notifications

* feat: 🎨 add react to video, comment to video and send payment to channel extrinsics

* refactor: ✨ refactoring code in order to account for manual tests and nft issuance tx status

* feat: 🎨 improve test by adding start auction and start offer

* docs: 📝 review auction bid notification cases and added comments

* fix: 🐛 notify creator on video comment

* fix: 💚 build error

* feat: 🎨 add notification for featured video / nft

* fix: 🐛 channel follower user id

* fix: 🐛 review notification pref parsing

* feat: 🎨 migrate Account to Account with pref (all enabled)

* feat: 🎨 migration from Channel to Channel with verification

* feat: 🎨 offchain notifcations creation timestmap

* refactor: ♻️ Notification code rework to accomodate design specs

* fix: 🎨 notification delivery and fields

* feat: 🎨 no separate notifications

* migration order

* email function rework

* notifications rework

* refactor: ♻️ unify notifications

* fix: 💚 fix notification build error after schema changes

* feat: 🚚 rename and re org utils/notification directory

* fix: 💚 mappings/content/channels tsc errors

* refactor: 💚 fix content/comments and reactions / videos

* fix: 💚 fix content / nft notification deposit

* fix: 💚 channel / resolvers notification deposit

* fix: 💚 Video resolver notification deposit

* fix: 💚 admin resolvers

* fix: 💚 fix direct member payment notification deposit

* fix: 💚 fix notification resolvers

* feat: 🎨 add app root domain

* feat: 🎨 add notification links

* feat: 🎨 notification links

* feat: 🎨 set resolver for setting app_root_domain and notification center

* feat: 🎨 add email content with some formatting

* feat: 🎨 add verify channel resolver with approporiate ChannelVerification entity

* fix: 🔥 no events or notifications are removed

no events or notifications will be removed, since they are now tied to an account and at the mement we don't support account deletion

* feat: 🎨 add royalty payment

* fix: 💚 build errors

* fix: 🩹 patch squid middleware to return 401 for unauth

* fix: 💚 fix ci build

* feat: 🎨 migrate next entity id for account

* temporarely hide integration tests

* fix gitignore

* fix: 💚 eslint fixes

* prettier

* chore: 💚 generate migration data and bump versions

* feat: add channel verification to hidden entities

* feat: 🐛 migrations

* fix: 💚 CI checks on migrations

* notifications visible to accounts

* feat: 🔥 re-establish old visibility policy for notificatinos

* fix: misc

* fix: 🐛 misc fixes for migrations

* feat: 🎨 rename auctionExpired -> timedAuctionExpired and add notificatino for channel suspended

* feat: 🎨 channel suspension resolver

* feat: ✨ better emails

* fix: 🐛 royalty computation and notification id tag

* feat: 🎨 add notification timestamp

* fix: 🐛 purchased nft / channel payment / funds withdrawn notification text

* fix: 🐛 resolvers

* fix: 🐛 VideoHero and channel suspension resolvers

* feat: 💚 fix ci build

* fix: 💚 generate Data.js and add suspension to hidden entities

* fix: 🎨 add channel_suspended to migrated entities

* style: 💄 better name for computeRoyalty args

* fix: 💚 post rebase fixes

* fix: 💚 post rebase fixes

* fix: 💚 post rebase fixes

* Update src/mappings/content/nft.ts

Co-authored-by: attemka <attemka@gmail.com>

* Update src/mappings/content/nft.ts

Co-authored-by: attemka <attemka@gmail.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/mappings/content/channel.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/mappings/content/channel.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/server-extension/resolvers/NotificationResolver/index.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update package.json

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/server-extension/resolvers/VideosResolver/index.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/server-extension/resolvers/ChannelsResolver/index.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: 🐛 notification created only once when orion_db is active

* fix: 🎨 misc PR comment address

added non-visibility of notification_delivery_* entities

* feat: 🎨 exported state entity migrated

* fix: 🎨 remove joystream patched types

* fix: 🎨 add ypp status to better match the YTS code

* style: 💄 refactor code for page links

* fix: 🎨 setup text for notifications & regenerate schema

* fix: 🐛 PR comments

feat: ♻️ refactor mail code

fix: ⚡ royalty price precision

fix: 🐛 PR comments

perf: ⚡ add max number of concurrent promises for fetching channel followers

fix: 🐛 PR comments

fix: 🐛 PR comments

fix: 🐛 PR comments

regenerate data

Update src/mappings/content/channel.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

Update src/server-extension/resolvers/VideosResolver/index.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

fix: 🐛 overlay vs orion_db for notification

Now notification are first written in the overlay (if deposited by processor) otherwise they are written directly into orion_db

fix: 🐛 overlay vs orion_db for notification

Now notification are first written in the overlay (if deposited by processor) otherwise they are written directly into orion_db

fix: 🐛 overlay vs orion_db for notification

Now notification are first written in the overlay (if deposited by processor) otherwise they are written directly into orion_db

fix: 🐛 separate mail sent by processor and those sent by server due to overlay presence

fix: 🐛 notification & notification on chain delivery mail deposit

fix: 🐛 notification & notification on chain delivery mail deposit

fix: 🐛 notification & notification on chain delivery mail deposit

* fix: 🐛 rework channel notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework channel notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

---------

Co-authored-by: attemka <attemka@gmail.com>
Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: uninitialized access of NftPurchased type (#179)

* Orion notifications fixes (#195)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: 📝 update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: 🚑 fix accountId global counter not being migrated (#188)

* style: 🎨 schema & helpers refactor

feat: ✨ resolver for in app notification

* Update the recipient schema

* feat(notification v1): ✨ resolver for in-app notifications

* fix: 🎨 remove inApp delivery entity and inApp resolver no longer used

* fix: 🎨 make notification public and fix linter

* fix: 🐛 PR iter

* test: ✅ test setup missing notificationsj

* test: ✅ add test for set Featured nft

* fix: 🐛 misc fixes after testing

* added referrerChannelId to the Account entity

* fix: ✅ add all tests for missing notifications

* fix: ✅ add all tests for missing notifications

* ci: 💚 add a notifications tests

* fix: 🚨 linter fixes

* fix: 💚 regenerate typeorm-migration scripts

* fix: ✅ update bid related tests and clean test reports

* feat: 🎨 make channel excluded member notification

* feat: 🎨 make channel excluded member notification

* fix: ✨ add event data for channel

* style: 💄 remove unused variant

* fix: ✏️ re check all relation between notification preferences and entities

* fix: ✏️ re check all relation between notification preferences and entities

* fix: ✨ NotificationPreferences Object type for the graphql resolver

* fix: 🐛 distinguish between auction types

* fix: 🐛 distinguish between auction types

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>
Co-authored-by: attemka <attemka@gmail.com>

* fix: 🐛 Video Liked data unitialized (#204)

* Orion notifications video liked (#205)

* fix: 🐛 Video Liked data unitialized

* fix: 🐛 Video Liked data unitialized

* test: ✅ add test for video liked

* test: ✅ add test for video liked

* fix: comment id not added to notification data (#206)

* fix: 🐛 uninitialized notification data fields (#207)

* migrations to 3.1.0 with fix for Overlay data race during migration (#200)

* feat: 🎨 add migration for accounts and channels

* test: ✅ add network test folder

* feat: ✅ add archive dump and export to test migrations

* feat: 🐛 overlay and migration data race

* ci: 💚 add ci checks for migration

* fix: ⚰️ remove dead code

* Mail scheduler feature (#208)

* feat: ✨ start scheduler work

* test: ✅ add test setup

* feat: 🎨 review data model

* feat: 🎨 setup tests and refactor data model

* test: 🎨 add extra seed data

* feat: 🎨 EmailDelivey.status success status changed on sendNew

* feat: 🎨 report entities generated on sendNew

* feat: 🎨 add support for error status

* fix: 🐛 avoid rewriting failedDlivery field on EmailDelivery with old version

* fix: 🎨 add fk for inApp and email delivery no notification entity

* feat: 🎨 add max attempt config variable

* feat: 🎨 seed data for config variable

* fix: 🎨 refactor after rebase

* feat: ✅ start adding test boilerplate code

feat: 🎨 finalize delivery feature

feat: 💚 add ci checks with scheduler tests

fix: 🚨 fix linter

* feat: ⏪ rebase to orion_notifications

* Add an MJML template for email notifications

* Update the links

* Adjust the template after testing it

* Update email links, texts, and icons

* Add avatars in email notifications

* Format amounts of JOYs in the notifications

* Have notification nft links open the nft widget

* Point icon links to GH for now

* Fix the `formatJOY` function

* Add the missing email data

* Update the template for png icons

* Improve avatar code

* Remove unnecessary change

* feat: 🎨 config variables for email

* feat: ✨ add resolvers for setting variables

tested ✅

* feat: enable mail content and remove unused file

* fix: ✅ content delegated to Q&A

* fix: 📦 update package lock

---------

Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* Notifications/scheduler main (#210)

* feat: ✨ add main function invocation

* feat: ✨ make dbgen

* fix: 🎨 process env not being read for db connection (#212)

* 👥 Add member ids to `NotificationType` (#219)

* Add memberIds to some `NotificationType`

* Link to members by ids on emails

* Get member avatars by id on emails

* update notification branch with master (#220)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: 📝 update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: 🚑 fix accountId global counter not being migrated (#188)

* docs: 📝 add back up guide (#196)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated (#193)

* fix: 🎨 process env not being read for db connection

* test: 🧪 add test for email delivery entity deposit

* fix: 🐛 encoding issues with member handle (#214)

* fix: 🐛 encoding issues with member handle

* fix: 🐛 pr issues

* fix: 🐛 refactor and update changelog

* docs: update version number

* fix: 🚑 account counter (#215)

* fix: 🧪 failing test on migratinos

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* update with master (#233)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: 📝 update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: 🚑 fix accountId global counter not being migrated (#188)

* docs: 📝 add back up guide (#196)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated (#193)

* fix: 🐛 encoding issues with member handle (#214)

* fix: 🐛 encoding issues with member handle

* fix: 🐛 pr issues

* fix: 🐛 refactor and update changelog

* docs: update version number

* fix: 🚑 account counter (#215)

* Orion v3.0.3 (#224)

* Remove n+1 problem for StorageDataObject (#209)

* Remove n+1 problem for StorageDataObject

* Inform user about incorrect query

* fix: ✨ add global counter migratino to account for 303 (#217)

* Orion 303 final touches (#223)

* feat: ✨ add CORS origins for atlas local testing

* chore: 📝 adds 303 release notes

* Fix typos (#176)

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typo

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

---------

Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>

* Orion v3.0.4 - Release (#230)

* 🧮 Aggregate channel payments (#222)

* Fix channels `cumulativeRewardClaimed_DESC` order

* Aggregate channel payments

* Make `cumulativeRewardClaimed` and `cumulativeRewardPaid` non null

* Generate db migrations

* Rename the `cumulativeReward` field

* Re-generate db migrations

* Bump Orion's version

* feat: ⚡ add migration to version 3.0.4 for account id counter (#228)

---------

Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* 🔨 Fix the notification template (#234)

* Fix notification template

* Remove `!` from the email subject

* Fix asset links

* Notification branch fixes for issued arised during Q&A (#225)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: 📝 update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: 🚑 fix accountId global counter not being migrated (#188)

* docs: 📝 add back up guide (#196)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated (#193)

* fix: 🐛 encoding issues with member handle (#214)

* fix: 🐛 encoding issues with member handle

* fix: 🐛 pr issues

* fix: 🐛 refactor and update changelog

* docs: update version number

* fix: 🚑 account counter (#215)

* Orion v3.0.3 (#224)

* Remove n+1 problem for StorageDataObject (#209)

* Remove n+1 problem for StorageDataObject

* Inform user about incorrect query

* fix: ✨ add global counter migratino to account for 303 (#217)

* Orion 303 final touches (#223)

* feat: ✨ add CORS origins for atlas local testing

* chore: 📝 adds 303 release notes

* Fix typos (#176)

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typo

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

---------

Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>

* fix(notifications): uninitialized access fields

* fix(notifications): 🐛 add channelId to new auction

* Orion v3.0.4 - Release (#230)

* 🧮 Aggregate channel payments (#222)

* Fix channels `cumulativeRewardClaimed_DESC` order

* Aggregate channel payments

* Make `cumulativeRewardClaimed` and `cumulativeRewardPaid` non null

* Generate db migrations

* Rename the `cumulativeReward` field

* Re-generate db migrations

* Bump Orion's version

* feat: ⚡ add migration to version 3.0.4 for account id counter (#228)

---------

Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: ✨ changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Hotfix/3.1.0 (#240)

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: ✨ changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: 🚑 hotfix default value for channel weight no matter what

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: ✅ add test for comment reply and metadata

* fix: ✨ solve conflicts

* test: ✅ add test for channel verification + refactoring

* chore: 🚨 linter

* fix: 💚 add 10 seconds sleep time for CI checks

* fix: 🐛 channel excluded title

* docs: 📝 typo

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* 🩹 Fix JOY values in emails and footer (#241)

* Fix JOY values in emails

* Fix email footer

* Test `formatJOY` function

* Use `Number.toFixed` to rewrite `formatJOY`

* Fix demo emails

* 🔧 One more notification email fix (#254)

* Attempt to fix channel avatar on emails

* Improve email template

* Notifications/qa fixes (#250)

* fix: 🐛 unitialized access video posted + misc

* feat: ⚡ batch channel verification

* fix: ⚡ remove non necessary import

* Notifications/qa fixes (#255)

* fix: 🐛 unitialized access video posted + misc

* feat: ⚡ batch channel verification

* fix: ⚡ remove non necessary import

* feat: ✨ batch suspend channel and pLimits promises

* Notifications/qa fixes (#256)

* fix: 🐛 unitialized access video posted + misc

* feat: ⚡ batch channel verification

* fix: ⚡ remove non necessary import

* feat: ✨ batch suspend channel and pLimits promises

* fix: 🐛 typegraphql return type

* Notifications/qa fixes (#255)

* fix: 🐛 unitialized access video posted + misc

* feat: ⚡ batch channel verification

* fix: ⚡ remove non necessary import

* feat: ✨ batch suspend channel and pLimits promises

* fix: 🎨 import

* style: 💄 format

* Notifications/no self notifications (#258)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: 📝 update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: 🚑 fix accountId global counter not being migrated (#188)

* docs: 📝 add back up guide (#196)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated (#193)

* fix: 🐛 encoding issues with member handle (#214)

* fix: 🐛 encoding issues with member handle

* fix: 🐛 pr issues

* fix: 🐛 refactor and update changelog

* docs: update version number

* fix: 🚑 account counter (#215)

* Orion v3.0.3 (#224)

* Remove n+1 problem for StorageDataObject (#209)

* Remove n+1 problem for StorageDataObject

* Inform user about incorrect query

* fix: ✨ add global counter migratino to account for 303 (#217)

* Orion 303 final touches (#223)

* feat: ✨ add CORS origins for atlas local testing

* chore: 📝 adds 303 release notes

* Fix typos (#176)

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typo

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

---------

Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>

* Orion v3.0.4 - Release (#230)

* 🧮 Aggregate channel payments (#222)

* Fix channels `cumulativeRewardClaimed_DESC` order

* Aggregate channel payments

* Make `cumulativeRewardClaimed` and `cumulativeRewardPaid` non null

* Generate db migrations

* Rename the `cumulativeReward` field

* Re-generate db migrations

* Bump Orion's version

* feat: ⚡ add migration to version 3.0.4 for account id counter (#228)

---------

Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: ✨ changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Hotfix/3.1.0 (#240)

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: ✨ changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: 🚑 hotfix default value for channel weight no matter what

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* docs: 📝 documentation for email notificaions

* feat: 🐛 don't notify channel owner if he's reacting

* feat: 🐛 avoid sending notification for reaction to self comment

* fix: 🎨 pr comments

* fix: 💚 tests faliing on user liking his own video

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* 🤞 Fix the channel avatar url (#257)

* Extract the asset url logic

* Fix the channel avatar url

* Add a script to run the mail scheduler

* fix: 💚 ci error on globalem

* Memoize `getNotificationAvatar`

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* docs: 📝 changelog (#260)

* Cache avatars based on just type and id (#259)

---------

Co-authored-by: attemka <attemka@gmail.com>
Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
zeeshanakram3 added a commit that referenced this pull request Feb 27, 2024
* fix: 🐛 encoding issues with member handle (#214)

* fix: 🐛 encoding issues with member handle

* fix: 🐛 pr issues

* fix: 🐛 refactor and update changelog

* docs: update version number

* fix: 🚑 account counter (#215)

* Orion v3.0.3 (#224)

* Remove n+1 problem for StorageDataObject (#209)

* Remove n+1 problem for StorageDataObject

* Inform user about incorrect query

* fix: ✨ add global counter migratino to account for 303 (#217)

* Orion 303 final touches (#223)

* feat: ✨ add CORS origins for atlas local testing

* chore: 📝 adds 303 release notes

* Fix typos (#176)

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typo

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

---------

Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>

* Orion v3.0.4 - Release (#230)

* 🧮 Aggregate channel payments (#222)

* Fix channels `cumulativeRewardClaimed_DESC` order

* Aggregate channel payments

* Make `cumulativeRewardClaimed` and `cumulativeRewardPaid` non null

* Generate db migrations

* Rename the `cumulativeReward` field

* Re-generate db migrations

* Bump Orion's version

* feat: ⚡ add migration to version 3.0.4 for account id counter (#228)

---------

Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: ✨ changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Hotfix/3.1.0 (#240)

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: ✨ changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: 🚑 hotfix default value for channel weight no matter what

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Orion notifications final (#264)

* User accounts notifications (#164)

* feat: squash all commits for notification demo

fix: add notification and template choice

feat: sketch mutation for setting the prefeences

fix: arguments for preference selection function

feat: add runtime notification data and notification preferences

fix: notification for runtime events

fix: add notification preference mutation

feat: add email strategy

fix: split Notification into onchain and offchain

fix: add channel created event notifiation

feat: distinguisher between member and channel notifiation

feat: enable offchain notification entities export

fix: notification preferences resolver

fix: migration

feat: default notification preferences

feat: start adding tests

fix: tests

fix: tests

fix: notificatino preference mutation and complete test

fix: add support for offchain dat

fix: missc

fix: format & fix build errors

fix: build and migrations

fix: bugs in setting notifications

fix: add case for notification mutation status

fix: build errors

fix: format

fix: data

* fix: remove non needed entity for migration

export / import scripts allows to specify fields of entities which will be migrated
In this case runtime notification will be migrated partially by offchain and partiall
by handlers

* feat: mark notifications as read

* fix: runtime notification migration generation

* feat: add event notification for video posted

* feat: add video comment

* feat: add chanel verification mutation

* feat: video excluded from app notifications

* feat: channel exclusion

* fix: Channel exclusion

* feat: notification deposit for video reaction

* feat: reaction for comment notification

* feat: refactor and add channel excluded mail template

* fix: email

* feat: regenerate migrations

fix: notifications

fix: misc

* fix: WS_SOURCE for archive

* feat: boilerplate code for notification testing

fix: gql subscriptions

* ♻️ Refactor into object mother like context

* 🩹 Fix: graphql client now working

* 🐛 Logged in client able to send mutation

* ✏️ Fix: set missing notification preferences

* 🩹 Match notification pref names with design

* 🩹 Match notification pref names with design

* 🩹 Fix: SetAccountNotificationPreference resolver

* ✅ Test: Channel created notification

* ✅ Test: FolloChannel notificatino

* ♻️ Ref: notification deposit function

* ✅ Test: Video posted

* ♻️ Ref: addNotification and notification type

* feat: 🎨 create extrinsic file and add make payment to channel

* feat: 🎨 add extra extrinsic for auction notifications

* feat: 🎨 add react to video, comment to video and send payment to channel extrinsics

* refactor: ✨ refactoring code in order to account for manual tests and nft issuance tx status

* feat: 🎨 improve test by adding start auction and start offer

* docs: 📝 review auction bid notification cases and added comments

* fix: 🐛 notify creator on video comment

* fix: 💚 build error

* feat: 🎨 add notification for featured video / nft

* fix: 🐛 channel follower user id

* fix: 🐛 review notification pref parsing

* feat: 🎨 migrate Account to Account with pref (all enabled)

* feat: 🎨 migration from Channel to Channel with verification

* feat: 🎨 offchain notifcations creation timestmap

* refactor: ♻️ Notification code rework to accomodate design specs

* fix: 🎨 notification delivery and fields

* feat: 🎨 no separate notifications

* migration order

* email function rework

* notifications rework

* refactor: ♻️ unify notifications

* fix: 💚 fix notification build error after schema changes

* feat: 🚚 rename and re org utils/notification directory

* fix: 💚 mappings/content/channels tsc errors

* refactor: 💚 fix content/comments and reactions / videos

* fix: 💚 fix content / nft notification deposit

* fix: 💚 channel / resolvers notification deposit

* fix: 💚 Video resolver notification deposit

* fix: 💚 admin resolvers

* fix: 💚 fix direct member payment notification deposit

* fix: 💚 fix notification resolvers

* feat: 🎨 add app root domain

* feat: 🎨 add notification links

* feat: 🎨 notification links

* feat: 🎨 set resolver for setting app_root_domain and notification center

* feat: 🎨 add email content with some formatting

* feat: 🎨 add verify channel resolver with approporiate ChannelVerification entity

* fix: 🔥 no events or notifications are removed

no events or notifications will be removed, since they are now tied to an account and at the mement we don't support account deletion

* feat: 🎨 add royalty payment

* fix: 💚 build errors

* fix: 🩹 patch squid middleware to return 401 for unauth

* fix: 💚 fix ci build

* feat: 🎨 migrate next entity id for account

* temporarely hide integration tests

* fix gitignore

* fix: 💚 eslint fixes

* prettier

* chore: 💚 generate migration data and bump versions

* feat: add channel verification to hidden entities

* feat: 🐛 migrations

* fix: 💚 CI checks on migrations

* notifications visible to accounts

* feat: 🔥 re-establish old visibility policy for notificatinos

* fix: misc

* fix: 🐛 misc fixes for migrations

* feat: 🎨 rename auctionExpired -> timedAuctionExpired and add notificatino for channel suspended

* feat: 🎨 channel suspension resolver

* feat: ✨ better emails

* fix: 🐛 royalty computation and notification id tag

* feat: 🎨 add notification timestamp

* fix: 🐛 purchased nft / channel payment / funds withdrawn notification text

* fix: 🐛 resolvers

* fix: 🐛 VideoHero and channel suspension resolvers

* feat: 💚 fix ci build

* fix: 💚 generate Data.js and add suspension to hidden entities

* fix: 🎨 add channel_suspended to migrated entities

* style: 💄 better name for computeRoyalty args

* fix: 💚 post rebase fixes

* fix: 💚 post rebase fixes

* fix: 💚 post rebase fixes

* Update src/mappings/content/nft.ts

Co-authored-by: attemka <attemka@gmail.com>

* Update src/mappings/content/nft.ts

Co-authored-by: attemka <attemka@gmail.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/mappings/content/channel.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/mappings/content/channel.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/server-extension/resolvers/NotificationResolver/index.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update package.json

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/server-extension/resolvers/VideosResolver/index.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/server-extension/resolvers/ChannelsResolver/index.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: 🐛 notification created only once when orion_db is active

* fix: 🎨 misc PR comment address

added non-visibility of notification_delivery_* entities

* feat: 🎨 exported state entity migrated

* fix: 🎨 remove joystream patched types

* fix: 🎨 add ypp status to better match the YTS code

* style: 💄 refactor code for page links

* fix: 🎨 setup text for notifications & regenerate schema

* fix: 🐛 PR comments

feat: ♻️ refactor mail code

fix: ⚡ royalty price precision

fix: 🐛 PR comments

perf: ⚡ add max number of concurrent promises for fetching channel followers

fix: 🐛 PR comments

fix: 🐛 PR comments

fix: 🐛 PR comments

regenerate data

Update src/mappings/content/channel.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

Update src/server-extension/resolvers/VideosResolver/index.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

fix: 🐛 overlay vs orion_db for notification

Now notification are first written in the overlay (if deposited by processor) otherwise they are written directly into orion_db

fix: 🐛 overlay vs orion_db for notification

Now notification are first written in the overlay (if deposited by processor) otherwise they are written directly into orion_db

fix: 🐛 overlay vs orion_db for notification

Now notification are first written in the overlay (if deposited by processor) otherwise they are written directly into orion_db

fix: 🐛 separate mail sent by processor and those sent by server due to overlay presence

fix: 🐛 notification & notification on chain delivery mail deposit

fix: 🐛 notification & notification on chain delivery mail deposit

fix: 🐛 notification & notification on chain delivery mail deposit

* fix: 🐛 rework channel notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework channel notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

---------

Co-authored-by: attemka <attemka@gmail.com>
Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: uninitialized access of NftPurchased type (#179)

* Orion notifications fixes (#195)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: 📝 update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: 🚑 fix accountId global counter not being migrated (#188)

* style: 🎨 schema & helpers refactor

feat: ✨ resolver for in app notification

* Update the recipient schema

* feat(notification v1): ✨ resolver for in-app notifications

* fix: 🎨 remove inApp delivery entity and inApp resolver no longer used

* fix: 🎨 make notification public and fix linter

* fix: 🐛 PR iter

* test: ✅ test setup missing notificationsj

* test: ✅ add test for set Featured nft

* fix: 🐛 misc fixes after testing

* added referrerChannelId to the Account entity

* fix: ✅ add all tests for missing notifications

* fix: ✅ add all tests for missing notifications

* ci: 💚 add a notifications tests

* fix: 🚨 linter fixes

* fix: 💚 regenerate typeorm-migration scripts

* fix: ✅ update bid related tests and clean test reports

* feat: 🎨 make channel excluded member notification

* feat: 🎨 make channel excluded member notification

* fix: ✨ add event data for channel

* style: 💄 remove unused variant

* fix: ✏️ re check all relation between notification preferences and entities

* fix: ✏️ re check all relation between notification preferences and entities

* fix: ✨ NotificationPreferences Object type for the graphql resolver

* fix: 🐛 distinguish between auction types

* fix: 🐛 distinguish between auction types

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>
Co-authored-by: attemka <attemka@gmail.com>

* fix: 🐛 Video Liked data unitialized (#204)

* Orion notifications video liked (#205)

* fix: 🐛 Video Liked data unitialized

* fix: 🐛 Video Liked data unitialized

* test: ✅ add test for video liked

* test: ✅ add test for video liked

* fix: comment id not added to notification data (#206)

* fix: 🐛 uninitialized notification data fields (#207)

* migrations to 3.1.0 with fix for Overlay data race during migration (#200)

* feat: 🎨 add migration for accounts and channels

* test: ✅ add network test folder

* feat: ✅ add archive dump and export to test migrations

* feat: 🐛 overlay and migration data race

* ci: 💚 add ci checks for migration

* fix: ⚰️ remove dead code

* Mail scheduler feature (#208)

* feat: ✨ start scheduler work

* test: ✅ add test setup

* feat: 🎨 review data model

* feat: 🎨 setup tests and refactor data model

* test: 🎨 add extra seed data

* feat: 🎨 EmailDelivey.status success status changed on sendNew

* feat: 🎨 report entities generated on sendNew

* feat: 🎨 add support for error status

* fix: 🐛 avoid rewriting failedDlivery field on EmailDelivery with old version

* fix: 🎨 add fk for inApp and email delivery no notification entity

* feat: 🎨 add max attempt config variable

* feat: 🎨 seed data for config variable

* fix: 🎨 refactor after rebase

* feat: ✅ start adding test boilerplate code

feat: 🎨 finalize delivery feature

feat: 💚 add ci checks with scheduler tests

fix: 🚨 fix linter

* feat: ⏪ rebase to orion_notifications

* Add an MJML template for email notifications

* Update the links

* Adjust the template after testing it

* Update email links, texts, and icons

* Add avatars in email notifications

* Format amounts of JOYs in the notifications

* Have notification nft links open the nft widget

* Point icon links to GH for now

* Fix the `formatJOY` function

* Add the missing email data

* Update the template for png icons

* Improve avatar code

* Remove unnecessary change

* feat: 🎨 config variables for email

* feat: ✨ add resolvers for setting variables

tested ✅

* feat: enable mail content and remove unused file

* fix: ✅ content delegated to Q&A

* fix: 📦 update package lock

---------

Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* Notifications/scheduler main (#210)

* feat: ✨ add main function invocation

* feat: ✨ make dbgen

* fix: 🎨 process env not being read for db connection (#212)

* 👥 Add member ids to `NotificationType` (#219)

* Add memberIds to some `NotificationType`

* Link to members by ids on emails

* Get member avatars by id on emails

* update notification branch with master (#220)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: 📝 update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: 🚑 fix accountId global counter not being migrated (#188)

* docs: 📝 add back up guide (#196)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated (#193)

* fix: 🎨 process env not being read for db connection

* test: 🧪 add test for email delivery entity deposit

* fix: 🐛 encoding issues with member handle (#214)

* fix: 🐛 encoding issues with member handle

* fix: 🐛 pr issues

* fix: 🐛 refactor and update changelog

* docs: update version number

* fix: 🚑 account counter (#215)

* fix: 🧪 failing test on migratinos

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* update with master (#233)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: 📝 update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: 🚑 fix accountId global counter not being migrated (#188)

* docs: 📝 add back up guide (#196)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated (#193)

* fix: 🐛 encoding issues with member handle (#214)

* fix: 🐛 encoding issues with member handle

* fix: 🐛 pr issues

* fix: 🐛 refactor and update changelog

* docs: update version number

* fix: 🚑 account counter (#215)

* Orion v3.0.3 (#224)

* Remove n+1 problem for StorageDataObject (#209)

* Remove n+1 problem for StorageDataObject

* Inform user about incorrect query

* fix: ✨ add global counter migratino to account for 303 (#217)

* Orion 303 final touches (#223)

* feat: ✨ add CORS origins for atlas local testing

* chore: 📝 adds 303 release notes

* Fix typos (#176)

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typo

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

---------

Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>

* Orion v3.0.4 - Release (#230)

* 🧮 Aggregate channel payments (#222)

* Fix channels `cumulativeRewardClaimed_DESC` order

* Aggregate channel payments

* Make `cumulativeRewardClaimed` and `cumulativeRewardPaid` non null

* Generate db migrations

* Rename the `cumulativeReward` field

* Re-generate db migrations

* Bump Orion's version

* feat: ⚡ add migration to version 3.0.4 for account id counter (#228)

---------

Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* 🔨 Fix the notification template (#234)

* Fix notification template

* Remove `!` from the email subject

* Fix asset links

* Notification branch fixes for issued arised during Q&A (#225)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: 📝 update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: 🚑 fix accountId global counter not being migrated (#188)

* docs: 📝 add back up guide (#196)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated (#193)

* fix: 🐛 encoding issues with member handle (#214)

* fix: 🐛 encoding issues with member handle

* fix: 🐛 pr issues

* fix: 🐛 refactor and update changelog

* docs: update version number

* fix: 🚑 account counter (#215)

* Orion v3.0.3 (#224)

* Remove n+1 problem for StorageDataObject (#209)

* Remove n+1 problem for StorageDataObject

* Inform user about incorrect query

* fix: ✨ add global counter migratino to account for 303 (#217)

* Orion 303 final touches (#223)

* feat: ✨ add CORS origins for atlas local testing

* chore: 📝 adds 303 release notes

* Fix typos (#176)

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typo

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

---------

Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>

* fix(notifications): uninitialized access fields

* fix(notifications): 🐛 add channelId to new auction

* Orion v3.0.4 - Release (#230)

* 🧮 Aggregate channel payments (#222)

* Fix channels `cumulativeRewardClaimed_DESC` order

* Aggregate channel payments

* Make `cumulativeRewardClaimed` and `cumulativeRewardPaid` non null

* Generate db migrations

* Rename the `cumulativeReward` field

* Re-generate db migrations

* Bump Orion's version

* feat: ⚡ add migration to version 3.0.4 for account id counter (#228)

---------

Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: ✨ changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Hotfix/3.1.0 (#240)

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: ✨ changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: 🚑 hotfix default value for channel weight no matter what

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: ✅ add test for comment reply and metadata

* fix: ✨ solve conflicts

* test: ✅ add test for channel verification + refactoring

* chore: 🚨 linter

* fix: 💚 add 10 seconds sleep time for CI checks

* fix: 🐛 channel excluded title

* docs: 📝 typo

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* 🩹 Fix JOY values in emails and footer (#241)

* Fix JOY values in emails

* Fix email footer

* Test `formatJOY` function

* Use `Number.toFixed` to rewrite `formatJOY`

* Fix demo emails

* 🔧 One more notification email fix (#254)

* Attempt to fix channel avatar on emails

* Improve email template

* Notifications/qa fixes (#250)

* fix: 🐛 unitialized access video posted + misc

* feat: ⚡ batch channel verification

* fix: ⚡ remove non necessary import

* Notifications/qa fixes (#255)

* fix: 🐛 unitialized access video posted + misc

* feat: ⚡ batch channel verification

* fix: ⚡ remove non necessary import

* feat: ✨ batch suspend channel and pLimits promises

* Notifications/qa fixes (#256)

* fix: 🐛 unitialized access video posted + misc

* feat: ⚡ batch channel verification

* fix: ⚡ remove non necessary import

* feat: ✨ batch suspend channel and pLimits promises

* fix: 🐛 typegraphql return type

* Notifications/qa fixes (#255)

* fix: 🐛 unitialized access video posted + misc

* feat: ⚡ batch channel verification

* fix: ⚡ remove non necessary import

* feat: ✨ batch suspend channel and pLimits promises

* fix: 🎨 import

* style: 💄 format

* Notifications/no self notifications (#258)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: 📝 update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: 🚑 fix accountId global counter not being migrated (#188)

* docs: 📝 add back up guide (#196)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated (#193)

* fix: 🐛 encoding issues with member handle (#214)

* fix: 🐛 encoding issues with member handle

* fix: 🐛 pr issues

* fix: 🐛 refactor and update changelog

* docs: update version number

* fix: 🚑 account counter (#215)

* Orion v3.0.3 (#224)

* Remove n+1 problem for StorageDataObject (#209)

* Remove n+1 problem for StorageDataObject

* Inform user about incorrect query

* fix: ✨ add global counter migratino to account for 303 (#217)

* Orion 303 final touches (#223)

* feat: ✨ add CORS origins for atlas local testing

* chore: 📝 adds 303 release notes

* Fix typos (#176)

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typo

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

---------

Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>

* Orion v3.0.4 - Release (#230)

* 🧮 Aggregate channel payments (#222)

* Fix channels `cumulativeRewardClaimed_DESC` order

* Aggregate channel payments

* Make `cumulativeRewardClaimed` and `cumulativeRewardPaid` non null

* Generate db migrations

* Rename the `cumulativeReward` field

* Re-generate db migrations

* Bump Orion's version

* feat: ⚡ add migration to version 3.0.4 for account id counter (#228)

---------

Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: ✨ changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Hotfix/3.1.0 (#240)

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: ✨ changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: 🚑 hotfix default value for channel weight no matter what

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* docs: 📝 documentation for email notificaions

* feat: 🐛 don't notify channel owner if he's reacting

* feat: 🐛 avoid sending notification for reaction to self comment

* fix: 🎨 pr comments

* fix: 💚 tests faliing on user liking his own video

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* 🤞 Fix the channel avatar url (#257)

* Extract the asset url logic

* Fix the channel avatar url

* Add a script to run the mail scheduler

* fix: 💚 ci error on globalem

* Memoize `getNotificationAvatar`

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* docs: 📝 changelog (#260)

* Cache avatars based on just type and id (#259)

---------

Co-authored-by: attemka <attemka@gmail.com>
Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>

* fix: 🚑 remove extra return type from resolver (#265)

* Update .env

example .env updated with notification variables

* Fix/homepage scoring (#251)

* Update video relevance manager query

* Remove single video schedules for relevance recalc

* Fix namings

* Reformat query

* Revert "Remove single video schedules for relevance recalc"

This reverts commit 3a685b9

* Adjust logic for single channel recalc

* Unblock video relevance recalc only after processor reaches last exported block

* Increase global recalc interval

* Avoid query if set is empty

* Introduce smaller interval for scheduled channels

* Typo fix

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Linter

* Add video recalc on channel weight change

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update CHANGELOG.md

* email delivery attempt export (#271)

* Account id counter (#273)

* email delivery attempt export (#271)

* fix: 💚 remove falinig test on migration

since now we have dropped the new migration logic

* Update operator docs (#281)

* docs: 📝 improve operator example file configs

* docs: 📝 email notifications guide improvement

* fix: 📝 documentation .env archive endpoint variable

* fix: 📝 example env gateway_port:8000

* docs: rework deploy orion documentation

* docs: 📝 finalize deployment docs

* docs: 📝 minor improvements in the documentations

* Update README.md

* Extend session based on activity after initial expiry is over (#287)

* Index most used field for ordering (#246)

* Add required indexes to nft and video entity

* Regen migrations

* Add index at event timestamp field

* Regen migrations

* Regen migrations v2

* Regen migrations v3

* Fix/notification email title (#289)

* Add new property to each notification type

* Use new subject property in email

* Remove app name from subject

* Orion setup improvements (#288)

* fix: deadlock issue caused by migration scripts

* gitignore src/types/

* update nodejs version to node:18

* added 'generate-migrations' makefile  command to generate migrations

* add npm command to get graphql chema

* add opentelemetry tracing integration with graphql-server and auth-server

* update docker.yml github workflow

* fix: DistributionBucketsCache init bug

* Improved offchain import/export script

* fix: dockerfile

* fix: dockerfile

* fix eslint issues

* fix checks.yml github workflow

* regenerate db migration files

* fix: Don't expose db container ports

* fix notification errors

* merge upstream/master

* Version 3.2.1 (#290)

* fix: deadlock issue caused by migration scripts

* gitignore src/types/

* update nodejs version to node:18

* added 'generate-migrations' makefile  command to generate migrations

* add npm command to get graphql chema

* add opentelemetry tracing integration with graphql-server and auth-server

* update docker.yml github workflow

* fix: DistributionBucketsCache init bug

* Improved offchain import/export script

* fix: dockerfile

* fix: dockerfile

* fix eslint issues

* fix checks.yml github workflow

* regenerate db migration files

* fix: Don't expose db container ports

* fix notification errors

* merge upstream/master

* remove unused property 'globalCountersMigration' from OffchainState

* refactor notifications scripts

* bump package version and update changelog

* 🐉 Homepage language improvements (#295)

* Add language utils

* Add new property to schema

* Try to predict language for each video

* Generate new mappings

* 🦢 Switch language package (#296)

* Replace ngram package

* Remove fallback to metadata language

* Add language predition to the update mapping

* Changelog and version bump

* Orion db migrations and state export fixes (#298)

* read/write export.json file using big-json package

* patch @subsquid/typeorm-config & @subsquid/typeorm-migration packages to change 'squid-typeorm-migration apply' commad to apply a single migrations file too

* regenerate the postgres db migrations

* update package version and add changelog

* added custom migration to set orionLanguage to all of the processed videos

* update *-Data.js migration file

* rename *-Operator.js migrations file

* rename *-Indexes.js migrations file

* patch @subsquid/openreader and @subsquid/typeorm-codegen dependencies  include the db schema too in the generated postgres migrations, and a 'schema' directive to specify the schema of any entity

* create *-Admin.js migration to create an admin schema & user

* separate the view definitions from views migration file

* create JS script to create new views migrations file.

* add @Schema direcitve to hidden entities in graphql schema definitions

* regenerate db/migrations

* update 'generate-migrations' makefile command

* updated documentation for upgrading orion and entity visibility

* update CHANGELOG

* create VIEWs for hidden entities too

* fix: use snake case property names in createQueryBuilder instance methods

* fix: .gitignore not working

* fix lint issues

* re-generate db migrations

* Add is short field to video entity (#301)

* add isShort field to video entity

* regenerate db migrations

* remove @joystream/metadata-protobuf patch from assets/patches

* fix lint issue

* Disable both in Appp and eail notifications for video posted events (#299)

* bump package version and update CHANGELOG (#302)

* bump package version and update CHANGELOG

* change release version

* Simple public homefeed query and mutation (#304)

* update graphql schema

* add partial index on 'video.include_in_home_feed' field

* update video view definition to only include public videos

* regenerate migrations

* add dumbPublicFeedVideos custom query

* add setPublicFeedVideos mutation

* fix lint issue

* add arg to skip video IDs

* revert: update video view definition to only include public videos

* add feat. to unset public feed videos

* address requested change

* bump package version and update CHANGELOG

* commit register.html.mst file

* fix: notifications integration test

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>
Co-authored-by: attemka <attemka@gmail.com>
zeeshanakram3 added a commit that referenced this pull request Mar 5, 2024
* User accounts notifications (#164)

* feat: squash all commits for notification demo

fix: add notification and template choice

feat: sketch mutation for setting the prefeences

fix: arguments for preference selection function

feat: add runtime notification data and notification preferences

fix: notification for runtime events

fix: add notification preference mutation

feat: add email strategy

fix: split Notification into onchain and offchain

fix: add channel created event notifiation

feat: distinguisher between member and channel notifiation

feat: enable offchain notification entities export

fix: notification preferences resolver

fix: migration

feat: default notification preferences

feat: start adding tests

fix: tests

fix: tests

fix: notificatino preference mutation and complete test

fix: add support for offchain dat

fix: missc

fix: format & fix build errors

fix: build and migrations

fix: bugs in setting notifications

fix: add case for notification mutation status

fix: build errors

fix: format

fix: data

* fix: remove non needed entity for migration

export / import scripts allows to specify fields of entities which will be migrated
In this case runtime notification will be migrated partially by offchain and partiall
by handlers

* feat: mark notifications as read

* fix: runtime notification migration generation

* feat: add event notification for video posted

* feat: add video comment

* feat: add chanel verification mutation

* feat: video excluded from app notifications

* feat: channel exclusion

* fix: Channel exclusion

* feat: notification deposit for video reaction

* feat: reaction for comment notification

* feat: refactor and add channel excluded mail template

* fix: email

* feat: regenerate migrations

fix: notifications

fix: misc

* fix: WS_SOURCE for archive

* feat: boilerplate code for notification testing

fix: gql subscriptions

* ♻️ Refactor into object mother like context

* 🩹 Fix: graphql client now working

* 🐛 Logged in client able to send mutation

* ✏️ Fix: set missing notification preferences

* 🩹 Match notification pref names with design

* 🩹 Match notification pref names with design

* 🩹 Fix: SetAccountNotificationPreference resolver

* ✅ Test: Channel created notification

* ✅ Test: FolloChannel notificatino

* ♻️ Ref: notification deposit function

* ✅ Test: Video posted

* ♻️ Ref: addNotification and notification type

* feat: 🎨 create extrinsic file and add make payment to channel

* feat: 🎨 add extra extrinsic for auction notifications

* feat: 🎨 add react to video, comment to video and send payment to channel extrinsics

* refactor: ✨ refactoring code in order to account for manual tests and nft issuance tx status

* feat: 🎨 improve test by adding start auction and start offer

* docs: 📝 review auction bid notification cases and added comments

* fix: 🐛 notify creator on video comment

* fix: 💚 build error

* feat: 🎨 add notification for featured video / nft

* fix: 🐛 channel follower user id

* fix: 🐛 review notification pref parsing

* feat: 🎨 migrate Account to Account with pref (all enabled)

* feat: 🎨 migration from Channel to Channel with verification

* feat: 🎨 offchain notifcations creation timestmap

* refactor: ♻️ Notification code rework to accomodate design specs

* fix: 🎨 notification delivery and fields

* feat: 🎨 no separate notifications

* migration order

* email function rework

* notifications rework

* refactor: ♻️ unify notifications

* fix: 💚 fix notification build error after schema changes

* feat: 🚚 rename and re org utils/notification directory

* fix: 💚 mappings/content/channels tsc errors

* refactor: 💚 fix content/comments and reactions / videos

* fix: 💚 fix content / nft notification deposit

* fix: 💚 channel / resolvers notification deposit

* fix: 💚 Video resolver notification deposit

* fix: 💚 admin resolvers

* fix: 💚 fix direct member payment notification deposit

* fix: 💚 fix notification resolvers

* feat: 🎨 add app root domain

* feat: 🎨 add notification links

* feat: 🎨 notification links

* feat: 🎨 set resolver for setting app_root_domain and notification center

* feat: 🎨 add email content with some formatting

* feat: 🎨 add verify channel resolver with approporiate ChannelVerification entity

* fix: 🔥 no events or notifications are removed

no events or notifications will be removed, since they are now tied to an account and at the mement we don't support account deletion

* feat: 🎨 add royalty payment

* fix: 💚 build errors

* fix: 🩹 patch squid middleware to return 401 for unauth

* fix: 💚 fix ci build

* feat: 🎨 migrate next entity id for account

* temporarely hide integration tests

* fix gitignore

* fix: 💚 eslint fixes

* prettier

* chore: 💚 generate migration data and bump versions

* feat: add channel verification to hidden entities

* feat: 🐛 migrations

* fix: 💚 CI checks on migrations

* notifications visible to accounts

* feat: 🔥 re-establish old visibility policy for notificatinos

* fix: misc

* fix: 🐛 misc fixes for migrations

* feat: 🎨 rename auctionExpired -> timedAuctionExpired and add notificatino for channel suspended

* feat: 🎨 channel suspension resolver

* feat: ✨ better emails

* fix: 🐛 royalty computation and notification id tag

* feat: 🎨 add notification timestamp

* fix: 🐛 purchased nft / channel payment / funds withdrawn notification text

* fix: 🐛 resolvers

* fix: 🐛 VideoHero and channel suspension resolvers

* feat: 💚 fix ci build

* fix: 💚 generate Data.js and add suspension to hidden entities

* fix: 🎨 add channel_suspended to migrated entities

* style: 💄 better name for computeRoyalty args

* fix: 💚 post rebase fixes

* fix: 💚 post rebase fixes

* fix: 💚 post rebase fixes

* Update src/mappings/content/nft.ts

Co-authored-by: attemka <attemka@gmail.com>

* Update src/mappings/content/nft.ts

Co-authored-by: attemka <attemka@gmail.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/mappings/content/channel.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/mappings/content/channel.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/server-extension/resolvers/NotificationResolver/index.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update package.json

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/server-extension/resolvers/VideosResolver/index.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/server-extension/resolvers/ChannelsResolver/index.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: 🐛 notification created only once when orion_db is active

* fix: 🎨 misc PR comment address

added non-visibility of notification_delivery_* entities

* feat: 🎨 exported state entity migrated

* fix: 🎨 remove joystream patched types

* fix: 🎨 add ypp status to better match the YTS code

* style: 💄 refactor code for page links

* fix: 🎨 setup text for notifications & regenerate schema

* fix: 🐛 PR comments

feat: ♻️ refactor mail code

fix: ⚡ royalty price precision

fix: 🐛 PR comments

perf: ⚡ add max number of concurrent promises for fetching channel followers

fix: 🐛 PR comments

fix: 🐛 PR comments

fix: 🐛 PR comments

regenerate data

Update src/mappings/content/channel.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

Update src/server-extension/resolvers/VideosResolver/index.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

fix: 🐛 overlay vs orion_db for notification

Now notification are first written in the overlay (if deposited by processor) otherwise they are written directly into orion_db

fix: 🐛 overlay vs orion_db for notification

Now notification are first written in the overlay (if deposited by processor) otherwise they are written directly into orion_db

fix: 🐛 overlay vs orion_db for notification

Now notification are first written in the overlay (if deposited by processor) otherwise they are written directly into orion_db

fix: 🐛 separate mail sent by processor and those sent by server due to overlay presence

fix: 🐛 notification & notification on chain delivery mail deposit

fix: 🐛 notification & notification on chain delivery mail deposit

fix: 🐛 notification & notification on chain delivery mail deposit

* fix: 🐛 rework channel notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework channel notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: 🐛 rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

---------

Co-authored-by: attemka <attemka@gmail.com>
Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: uninitialized access of NftPurchased type (#179)

* Orion notifications fixes (#195)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: 📝 update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: 🚑 fix accountId global counter not being migrated (#188)

* style: 🎨 schema & helpers refactor

feat: ✨ resolver for in app notification

* Update the recipient schema

* feat(notification v1): ✨ resolver for in-app notifications

* fix: 🎨 remove inApp delivery entity and inApp resolver no longer used

* fix: 🎨 make notification public and fix linter

* fix: 🐛 PR iter

* test: ✅ test setup missing notificationsj

* test: ✅ add test for set Featured nft

* fix: 🐛 misc fixes after testing

* added referrerChannelId to the Account entity

* fix: ✅ add all tests for missing notifications

* fix: ✅ add all tests for missing notifications

* ci: 💚 add a notifications tests

* fix: 🚨 linter fixes

* fix: 💚 regenerate typeorm-migration scripts

* fix: ✅ update bid related tests and clean test reports

* feat: 🎨 make channel excluded member notification

* feat: 🎨 make channel excluded member notification

* fix: ✨ add event data for channel

* style: 💄 remove unused variant

* fix: ✏️ re check all relation between notification preferences and entities

* fix: ✏️ re check all relation between notification preferences and entities

* fix: ✨ NotificationPreferences Object type for the graphql resolver

* fix: 🐛 distinguish between auction types

* fix: 🐛 distinguish between auction types

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>
Co-authored-by: attemka <attemka@gmail.com>

* fix: 🐛 Video Liked data unitialized (#204)

* Orion notifications video liked (#205)

* fix: 🐛 Video Liked data unitialized

* fix: 🐛 Video Liked data unitialized

* test: ✅ add test for video liked

* test: ✅ add test for video liked

* fix: comment id not added to notification data (#206)

* fix: 🐛 uninitialized notification data fields (#207)

* migrations to 3.1.0 with fix for Overlay data race during migration (#200)

* feat: 🎨 add migration for accounts and channels

* test: ✅ add network test folder

* feat: ✅ add archive dump and export to test migrations

* feat: 🐛 overlay and migration data race

* ci: 💚 add ci checks for migration

* fix: ⚰️ remove dead code

* Mail scheduler feature (#208)

* feat: ✨ start scheduler work

* test: ✅ add test setup

* feat: 🎨 review data model

* feat: 🎨 setup tests and refactor data model

* test: 🎨 add extra seed data

* feat: 🎨 EmailDelivey.status success status changed on sendNew

* feat: 🎨 report entities generated on sendNew

* feat: 🎨 add support for error status

* fix: 🐛 avoid rewriting failedDlivery field on EmailDelivery with old version

* fix: 🎨 add fk for inApp and email delivery no notification entity

* feat: 🎨 add max attempt config variable

* feat: 🎨 seed data for config variable

* fix: 🎨 refactor after rebase

* feat: ✅ start adding test boilerplate code

feat: 🎨 finalize delivery feature

feat: 💚 add ci checks with scheduler tests

fix: 🚨 fix linter

* feat: ⏪ rebase to orion_notifications

* Add an MJML template for email notifications

* Update the links

* Adjust the template after testing it

* Update email links, texts, and icons

* Add avatars in email notifications

* Format amounts of JOYs in the notifications

* Have notification nft links open the nft widget

* Point icon links to GH for now

* Fix the `formatJOY` function

* Add the missing email data

* Update the template for png icons

* Improve avatar code

* Remove unnecessary change

* feat: 🎨 config variables for email

* feat: ✨ add resolvers for setting variables

tested ✅

* feat: enable mail content and remove unused file

* fix: ✅ content delegated to Q&A

* fix: 📦 update package lock

---------

Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* Notifications/scheduler main (#210)

* feat: ✨ add main function invocation

* feat: ✨ make dbgen

* fix: 🎨 process env not being read for db connection (#212)

* 👥 Add member ids to `NotificationType` (#219)

* Add memberIds to some `NotificationType`

* Link to members by ids on emails

* Get member avatars by id on emails

* update notification branch with master (#220)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: 📝 update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: 🚑 fix accountId global counter not being migrated (#188)

* docs: 📝 add back up guide (#196)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated (#193)

* fix: 🎨 process env not being read for db connection

* test: 🧪 add test for email delivery entity deposit

* fix: 🐛 encoding issues with member handle (#214)

* fix: 🐛 encoding issues with member handle

* fix: 🐛 pr issues

* fix: 🐛 refactor and update changelog

* docs: update version number

* fix: 🚑 account counter (#215)

* fix: 🧪 failing test on migratinos

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* update with master (#233)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: 📝 update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: 🚑 fix accountId global counter not being migrated (#188)

* docs: 📝 add back up guide (#196)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated (#193)

* fix: 🐛 encoding issues with member handle (#214)

* fix: 🐛 encoding issues with member handle

* fix: 🐛 pr issues

* fix: 🐛 refactor and update changelog

* docs: update version number

* fix: 🚑 account counter (#215)

* Orion v3.0.3 (#224)

* Remove n+1 problem for StorageDataObject (#209)

* Remove n+1 problem for StorageDataObject

* Inform user about incorrect query

* fix: ✨ add global counter migratino to account for 303 (#217)

* Orion 303 final touches (#223)

* feat: ✨ add CORS origins for atlas local testing

* chore: 📝 adds 303 release notes

* Fix typos (#176)

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typo

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

---------

Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>

* Orion v3.0.4 - Release (#230)

* 🧮 Aggregate channel payments (#222)

* Fix channels `cumulativeRewardClaimed_DESC` order

* Aggregate channel payments

* Make `cumulativeRewardClaimed` and `cumulativeRewardPaid` non null

* Generate db migrations

* Rename the `cumulativeReward` field

* Re-generate db migrations

* Bump Orion's version

* feat: ⚡ add migration to version 3.0.4 for account id counter (#228)

---------

Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* 🔨 Fix the notification template (#234)

* Fix notification template

* Remove `!` from the email subject

* Fix asset links

* Notification branch fixes for issued arised during Q&A (#225)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: 📝 update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: 🚑 fix accountId global counter not being migrated (#188)

* docs: 📝 add back up guide (#196)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated (#193)

* fix: 🐛 encoding issues with member handle (#214)

* fix: 🐛 encoding issues with member handle

* fix: 🐛 pr issues

* fix: 🐛 refactor and update changelog

* docs: update version number

* fix: 🚑 account counter (#215)

* Orion v3.0.3 (#224)

* Remove n+1 problem for StorageDataObject (#209)

* Remove n+1 problem for StorageDataObject

* Inform user about incorrect query

* fix: ✨ add global counter migratino to account for 303 (#217)

* Orion 303 final touches (#223)

* feat: ✨ add CORS origins for atlas local testing

* chore: 📝 adds 303 release notes

* Fix typos (#176)

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typo

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

---------

Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>

* fix(notifications): uninitialized access fields

* fix(notifications): 🐛 add channelId to new auction

* Orion v3.0.4 - Release (#230)

* 🧮 Aggregate channel payments (#222)

* Fix channels `cumulativeRewardClaimed_DESC` order

* Aggregate channel payments

* Make `cumulativeRewardClaimed` and `cumulativeRewardPaid` non null

* Generate db migrations

* Rename the `cumulativeReward` field

* Re-generate db migrations

* Bump Orion's version

* feat: ⚡ add migration to version 3.0.4 for account id counter (#228)

---------

Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: ✨ changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Hotfix/3.1.0 (#240)

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: ✨ changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: 🚑 hotfix default value for channel weight no matter what

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: ✅ add test for comment reply and metadata

* fix: ✨ solve conflicts

* test: ✅ add test for channel verification + refactoring

* chore: 🚨 linter

* fix: 💚 add 10 seconds sleep time for CI checks

* fix: 🐛 channel excluded title

* docs: 📝 typo

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* 🩹 Fix JOY values in emails and footer (#241)

* Fix JOY values in emails

* Fix email footer

* Test `formatJOY` function

* Use `Number.toFixed` to rewrite `formatJOY`

* Fix demo emails

* 🔧 One more notification email fix (#254)

* Attempt to fix channel avatar on emails

* Improve email template

* Notifications/qa fixes (#250)

* fix: 🐛 unitialized access video posted + misc

* feat: ⚡ batch channel verification

* fix: ⚡ remove non necessary import

* Notifications/qa fixes (#255)

* fix: 🐛 unitialized access video posted + misc

* feat: ⚡ batch channel verification

* fix: ⚡ remove non necessary import

* feat: ✨ batch suspend channel and pLimits promises

* Notifications/qa fixes (#256)

* fix: 🐛 unitialized access video posted + misc

* feat: ⚡ batch channel verification

* fix: ⚡ remove non necessary import

* feat: ✨ batch suspend channel and pLimits promises

* fix: 🐛 typegraphql return type

* Notifications/qa fixes (#255)

* fix: 🐛 unitialized access video posted + misc

* feat: ⚡ batch channel verification

* fix: ⚡ remove non necessary import

* feat: ✨ batch suspend channel and pLimits promises

* fix: 🎨 import

* style: 💄 format

* Post merge fixes

* Regen migrations

* Add new notifications to the schema

* Small changes to accomodate mappings notifications

* Add notifications (w/o events)

* Add rpc events to schema and mapping

* Create notifications types for revenue share

* Create future notifications orion event

* Create future notifications scheduler

* Cover notifications for CRT holders (revenue share, market, sale)

* Send buy, sell events for market and sale to channel instead of followers

* Add missing notifications data for emails

* Remove depricated patch

* Add lock file

* Formating

* Adjust sleep time for migrations tests

* Post merge fixes

* Update lock file

* Formatting

* Fix build and regen files

* Add is short field to video entity (#301)

* add isShort field to video entity

* regenerate db migrations

* remove @joystream/metadata-protobuf patch from assets/patches

* fix lint issue

* Disable both in Appp and eail notifications for video posted events (#299)

* bump package version and update CHANGELOG (#302)

* bump package version and update CHANGELOG

* change release version

* Simple public homefeed query and mutation (#304)

* update graphql schema

* add partial index on 'video.include_in_home_feed' field

* update video view definition to only include public videos

* regenerate migrations

* add dumbPublicFeedVideos custom query

* add setPublicFeedVideos mutation

* fix lint issue

* add arg to skip video IDs

* revert: update video view definition to only include public videos

* add feat. to unset public feed videos

* address requested change

* bump package version and update CHANGELOG

* Update `nara` from `master` (#300)

* Adds mappings for `ChannelAssetsDeletedByModerator` & `VideoAssetsDeletedByModerator` events (#199)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated

* Implements mappings for 'Content.VideoAssetsDeletedByModerator and 'Content.ChannelAssetsDeletedByModerator' runtime events

* remove unused import

* Nara/crt update (#244)

* feat: build orion

* feat: start generating schema

* fix: extra entities

* fixup!

* fix: continue implementing design specs

* fix: review and fix foreign key relationships

* fix: formatting

* fix: generation errors

* fix: add comment

* fix: relations

* fix: final review

* fixup!

* fix: add ending blocks

* fix: generate type & set typegen to ipv4

* fix: add support for event backward compatibility

* feat: start adding mappings

* fix: continue with mappnigs

* feat: init sale

* feat: patronage decreased to & fixed build

* feat: claim patronage event

* feat: tokens bought on amm

* feat: tokens sold on amm

* fix: add relation between sales and vesting schedules

* feat: add Tokens sold on sale vente

* feat: update upcoming sale

* feat: revenue share issued

* feat: member joined whitelist

* feat: amm deactivated

* feat: burned token

* feat: transfer policy changed to permissionless

* feat: sale finalized

* feat: finish mappings

* fix: review

* fix: remove cascade deletions

* fix: renaming & formatting

* fixup!

* fixup!

* fix: patched protobuf packages with token proto

* feat: update metadata and add event handler scheleton

* feat: token metadata

* feat: sale metadata

* fix: review comments

* fix: formatting

* fix: revenue

* Revert "fix: revenue"

This reverts commit 0821abe.

* fix: token status after sale

* fix: fixmes

* fix: formatting

* fix: funds accounting during sale

* fix: amount accounting

* fix: linter

* fix: review

* fix: review 2

* fix: review

* fix: linter

* feat: migration for new db scheam

* fix: update event versions

* fix: patch types with crt_release types

* fix: patch types

* fix: generate all events versions since mainnet

* fix: temp fix after event version generation

* fix: event versioning

* fix: add migration

* fix: mignations

* fix: solve channel not being added

* fix: add id to TokenChannel

* fix: non-nullable deleted field set

* fix: format

* feat: creator token init sale re enabling

* feat: re enable sale init code

* fix: update types

* fix: amm id

* fix: id computation for revenue share

* fix: amm id computation for token

* fix: issuer transfer accounting

* fix: amm tx id

* fix: destination accounting

* feat: minor fix on holder transfer processing

* fix: re-enable metadata

* fix: metadata parsing

* fix: post reword cleanup

* fix: format

* fix: silence ci checks

* fix: event version

* fix: address PR changes

I edited all the entity that have a composite index like TokenAccount so that they have
a synthetic ID and an optionally unique @Index

* fix: add hidden entities conditions

* fix: add extra fields to token in order to keep track of ongoing status

* fix: build errors

* fix: adapt mapping to new token fields

* fix: format

* feat: add trailer video entity

this is required so we can simply make trailer video hidden if video is hidden

* fix: linter

* chore: prettier

* fix: from PR review

* fix: vesting schedule schema & mappings

I have replaced the vesting schedule back to the original schema with:
- VestingSchedule: holding vesting schedule information such being amount agnostic
- VestedAccount: contains information regarded to a vested account, the goal is to mimic the
runtime logic

* fix: burning from vesting

* patch: metadata-protobuf package

* patch: metadata-protobuf package

* fix: generate migrations

* fix: purchase token on sale

* Update schema/token.graphql

Co-authored-by: Leszek Wiesner <leszek@jsgenesis.com>

* Update schema/token.graphql

Co-authored-by: Leszek Wiesner <leszek@jsgenesis.com>

* fix: address PR

* fix: hidden entities

* fix: migration ok

* feat: add extra check for migrations

* fix: docker network

* fix: format

* fix: remove unrequired constraint

* fix: 🐛 post rebase fixes

* feat: 🎨 add metadata processing for issue token

* feat(crt-v1): ✨ chain metadata for v 2003

* fix(crt-v1): 🚑 comment out view element for orion playgroud

* fix(crt-v1): 🎨 add playground config variable to .env

* feat: ✅ add tests

* fix(crt-v1): 📦 packages and patches

* fix(crt-v1): ✅ update entity id used and other minor fixes

* fix(crt-v1): ✅ update entity id used and other minor fixes

* test(crt-v1): 🐛 misc fixes to have tests working

* test(crt-v1): 🐛 misc fixes to have tests working

* fix(crt-v1): 🐛 metadata and trailer video

* feat(crt-v1): 🎨 update types

* fix(crt-v1): ✨ Add correct Ratio denomination (Permill)

* update with master

* fix: 🐛 metadata not being set

* fix: 🐛 parameters order

* test: 🧪 fixing integration tests

* test(crt-v1): 🧪 fix integration tests

* feat(crt-v1): ✨ last price for token and recovered field for rev share part

* feat: ✨ add resolver for dividend amount

* feat(crt-v1): ✨ start adding channel fields for trackingtotal revenue

* feat(crt-v1): ✨ add utils for royalty computation

* feat(crt-v1): ✨ cumulative revenue on channel

* feat(crt-v1): ✨ add resolver for transferrable amount

* fix(crt-v1): ✨ add `acquiredAt` to pinpoint latest vesting schedule for account

* Token metadata processing update

* Prettier

* chore(crt-v1): ⚡ dbgen

* fix(crt-v1): 🧪 fix integration tests

* fix(crt-v1): 🐛 missing fields in token sale vesting source

* test(crt-v1): 🧪 test for transferrable balance amount

* fix(crt-v1): 🐛 transferrable amount

* test: 🧪 update tests after resolver fix

* fix: 🐛 error on vesting schedules array

* fix: 🎨 CI fixes

* docs: update gitignore

* fix: 🚨 prettier

* build: 📌 chai depnedencies

---------

Co-authored-by: Leszek Wiesner <leszek@jsgenesis.com>
Co-authored-by: WRadoslaw <r.wyszynski00@gmail.com>

* Clear benefits even if not passed (#282)

* 🤑 Fix revenue share dividend estimation (#297)

* Fix on revenue share dividend estimation

* Fix type on result

* 🛕 Historical revenue share participants (#286)

* New field for revenue share

* Set potential revenue share particitants at the time of start

* fix: .gitignore not working

* fix lint issues

* re-generate db migrations

* commit register.html.mst file

* fix: notifications integration test

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>
Co-authored-by: Leszek Wiesner <leszek@jsgenesis.com>
Co-authored-by: WRadoslaw <r.wyszynski00@gmail.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* Revert "Update `nara` from `master` (#300)" (#306)

This reverts commit 887427c.

* generate auth api docs and types

* regenerate migrations

* address requested changes

* fix: auction AuctionWon/AuctionLost notifications preferences

* add notification preferences for CRT notifications

* add feature to do futures notifications delivery

* remove 'FutureNotificationOrionEvent' entity

* add default notification preferences for crt notification

* fix: email scheduler tests

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>
Co-authored-by: attemka <attemka@gmail.com>
Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
Co-authored-by: Leszek Wiesner <leszek@jsgenesis.com>
Co-authored-by: Zeeshan Akram <97m.zeeshan@gmail.com>
zeeshanakram3 added a commit that referenced this pull request Mar 14, 2024
* Adds mappings for `ChannelAssetsDeletedByModerator` & `VideoAssetsDeletedByModerator` events (#199)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated

* Implements mappings for 'Content.VideoAssetsDeletedByModerator and 'Content.ChannelAssetsDeletedByModerator' runtime events

* remove unused import

* Nara/crt update (#244)

* feat: build orion

* feat: start generating schema

* fix: extra entities

* fixup!

* fix: continue implementing design specs

* fix: review and fix foreign key relationships

* fix: formatting

* fix: generation errors

* fix: add comment

* fix: relations

* fix: final review

* fixup!

* fix: add ending blocks

* fix: generate type & set typegen to ipv4

* fix: add support for event backward compatibility

* feat: start adding mappings

* fix: continue with mappnigs

* feat: init sale

* feat: patronage decreased to & fixed build

* feat: claim patronage event

* feat: tokens bought on amm

* feat: tokens sold on amm

* fix: add relation between sales and vesting schedules

* feat: add Tokens sold on sale vente

* feat: update upcoming sale

* feat: revenue share issued

* feat: member joined whitelist

* feat: amm deactivated

* feat: burned token

* feat: transfer policy changed to permissionless

* feat: sale finalized

* feat: finish mappings

* fix: review

* fix: remove cascade deletions

* fix: renaming & formatting

* fixup!

* fixup!

* fix: patched protobuf packages with token proto

* feat: update metadata and add event handler scheleton

* feat: token metadata

* feat: sale metadata

* fix: review comments

* fix: formatting

* fix: revenue

* Revert "fix: revenue"

This reverts commit 0821abe1e5e19be37a8d9a25d621dd148f03be9c.

* fix: token status after sale

* fix: fixmes

* fix: formatting

* fix: funds accounting during sale

* fix: amount accounting

* fix: linter

* fix: review

* fix: review 2

* fix: review

* fix: linter

* feat: migration for new db scheam

* fix: update event versions

* fix: patch types with crt_release types

* fix: patch types

* fix: generate all events versions since mainnet

* fix: temp fix after event version generation

* fix: event versioning

* fix: add migration

* fix: mignations

* fix: solve channel not being added

* fix: add id to TokenChannel

* fix: non-nullable deleted field set

* fix: format

* feat: creator token init sale re enabling

* feat: re enable sale init code

* fix: update types

* fix: amm id

* fix: id computation for revenue share

* fix: amm id computation for token

* fix: issuer transfer accounting

* fix: amm tx id

* fix: destination accounting

* feat: minor fix on holder transfer processing

* fix: re-enable metadata

* fix: metadata parsing

* fix: post reword cleanup

* fix: format

* fix: silence ci checks

* fix: event version

* fix: address PR changes

I edited all the entity that have a composite index like TokenAccount so that they have
a synthetic ID and an optionally unique @index

* fix: add hidden entities conditions

* fix: add extra fields to token in order to keep track of ongoing status

* fix: build errors

* fix: adapt mapping to new token fields

* fix: format

* feat: add trailer video entity

this is required so we can simply make trailer video hidden if video is hidden

* fix: linter

* chore: prettier

* fix: from PR review

* fix: vesting schedule schema & mappings

I have replaced the vesting schedule back to the original schema with:
- VestingSchedule: holding vesting schedule information such being amount agnostic
- VestedAccount: contains information regarded to a vested account, the goal is to mimic the
runtime logic

* fix: burning from vesting

* patch: metadata-protobuf package

* patch: metadata-protobuf package

* fix: generate migrations

* fix: purchase token on sale

* Update schema/token.graphql

Co-authored-by: Leszek Wiesner <leszek@jsgenesis.com>

* Update schema/token.graphql

Co-authored-by: Leszek Wiesner <leszek@jsgenesis.com>

* fix: address PR

* fix: hidden entities

* fix: migration ok

* feat: add extra check for migrations

* fix: docker network

* fix: format

* fix: remove unrequired constraint

* fix: :bug: post rebase fixes

* feat: :art: add metadata processing for issue token

* feat(crt-v1): :sparkles: chain metadata for v 2003

* fix(crt-v1): :ambulance: comment out view element for orion playgroud

* fix(crt-v1): :art: add playground config variable to .env

* feat: :white_check_mark: add tests

* fix(crt-v1): :package: packages and patches

* fix(crt-v1): :white_check_mark: update entity id used and other minor fixes

* fix(crt-v1): :white_check_mark: update entity id used and other minor fixes

* test(crt-v1): :bug: misc fixes to have tests working

* test(crt-v1): :bug: misc fixes to have tests working

* fix(crt-v1): :bug: metadata and trailer video

* feat(crt-v1): :art: update types

* fix(crt-v1): :sparkles: Add correct Ratio denomination (Permill)

* update with master

* fix: :bug: metadata not being set

* fix: :bug: parameters order

* test: :test_tube: fixing integration tests

* test(crt-v1): :test_tube: fix integration tests

* feat(crt-v1): :sparkles: last price for token and recovered field for rev share part

* feat: :sparkles: add resolver for dividend amount

* feat(crt-v1): :sparkles: start adding channel fields for trackingtotal revenue

* feat(crt-v1): :sparkles: add utils for royalty computation

* feat(crt-v1): :sparkles: cumulative revenue on channel

* feat(crt-v1): :sparkles: add resolver for transferrable amount

* fix(crt-v1): :sparkles: add `acquiredAt` to pinpoint latest vesting schedule for account

* Token metadata processing update

* Prettier

* chore(crt-v1): :zap: dbgen

* fix(crt-v1): :test_tube: fix integration tests

* fix(crt-v1): :bug: missing fields in token sale vesting source

* test(crt-v1): :test_tube: test for transferrable balance amount

* fix(crt-v1): :bug: transferrable amount

* test: :test_tube: update tests after resolver fix

* fix: :bug: error on vesting schedules array

* fix: :art: CI fixes

* docs: update gitignore

* fix: :rotating_light: prettier

* build: :pushpin: chai depnedencies

---------

Co-authored-by: Leszek Wiesner <leszek@jsgenesis.com>
Co-authored-by: WRadoslaw <r.wyszynski00@gmail.com>

* Clear benefits even if not passed (#282)

* 🤑 Fix revenue share dividend estimation (#297)

* Fix on revenue share dividend estimation

* Fix type on result

* 🛕 Historical revenue share participants (#286)

* New field for revenue share

* Set potential revenue share particitants at the time of start

* Update `nara` from `master` (#307)

* fix: :bug: encoding issues with member handle (#214)

* fix: :bug: encoding issues with member handle

* fix: :bug: pr issues

* fix: :bug: refactor and update changelog

* docs: update version number

* fix: :ambulance: account counter (#215)

* Orion v3.0.3 (#224)

* Remove n+1 problem for StorageDataObject (#209)

* Remove n+1 problem for StorageDataObject

* Inform user about incorrect query

* fix: :sparkles: add global counter migratino to account for 303 (#217)

* Orion 303 final touches (#223)

* feat: :sparkles: add CORS origins for atlas local testing

* chore: :memo: adds 303 release notes

* Fix typos (#176)

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typo

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

---------

Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>

* Orion v3.0.4 - Release (#230)

* 🧮 Aggregate channel payments (#222)

* Fix channels `cumulativeRewardClaimed_DESC` order

* Aggregate channel payments

* Make `cumulativeRewardClaimed` and `cumulativeRewardPaid` non null

* Generate db migrations

* Rename the `cumulativeReward` field

* Re-generate db migrations

* Bump Orion's version

* feat: :zap: add migration to version 3.0.4 for account id counter (#228)

---------

Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: :sparkles: changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Hotfix/3.1.0 (#240)

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: :sparkles: changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: :ambulance: hotfix default value for channel weight no matter what

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Orion notifications final (#264)

* User accounts notifications (#164)

* feat: squash all commits for notification demo

fix: add notification and template choice

feat: sketch mutation for setting the prefeences

fix: arguments for preference selection function

feat: add runtime notification data and notification preferences

fix: notification for runtime events

fix: add notification preference mutation

feat: add email strategy

fix: split Notification into onchain and offchain

fix: add channel created event notifiation

feat: distinguisher between member and channel notifiation

feat: enable offchain notification entities export

fix: notification preferences resolver

fix: migration

feat: default notification preferences

feat: start adding tests

fix: tests

fix: tests

fix: notificatino preference mutation and complete test

fix: add support for offchain dat

fix: missc

fix: format & fix build errors

fix: build and migrations

fix: bugs in setting notifications

fix: add case for notification mutation status

fix: build errors

fix: format

fix: data

* fix: remove non needed entity for migration

export / import scripts allows to specify fields of entities which will be migrated
In this case runtime notification will be migrated partially by offchain and partiall
by handlers

* feat: mark notifications as read

* fix: runtime notification migration generation

* feat: add event notification for video posted

* feat: add video comment

* feat: add chanel verification mutation

* feat: video excluded from app notifications

* feat: channel exclusion

* fix: Channel exclusion

* feat: notification deposit for video reaction

* feat: reaction for comment notification

* feat: refactor and add channel excluded mail template

* fix: email

* feat: regenerate migrations

fix: notifications

fix: misc

* fix: WS_SOURCE for archive

* feat: boilerplate code for notification testing

fix: gql subscriptions

* :recycle: Refactor into object mother like context

* :adhesive_bandage: Fix: graphql client now working

* :bug: Logged in client able to send mutation

* :pencil2: Fix: set missing notification preferences

* :adhesive_bandage: Match notification pref names with design

* :adhesive_bandage: Match notification pref names with design

* :adhesive_bandage: Fix: SetAccountNotificationPreference resolver

* :white_check_mark: Test: Channel created notification

* :white_check_mark: Test: FolloChannel notificatino

* :recycle: Ref: notification deposit function

* :white_check_mark: Test: Video posted

* :recycle: Ref: addNotification and notification type

* feat: :art: create extrinsic file and add make payment to channel

* feat: :art: add extra extrinsic for auction notifications

* feat: :art: add react to video, comment to video and send payment to channel extrinsics

* refactor: :sparkles: refactoring code in order to account for manual tests and nft issuance tx status

* feat: :art: improve test by adding start auction and start offer

* docs: :memo: review auction bid notification cases and added comments

* fix: :bug: notify creator on video comment

* fix: :green_heart: build error

* feat: :art: add notification for featured video / nft

* fix: :bug: channel follower user id

* fix: :bug: review notification pref parsing

* feat: :art: migrate Account to Account with pref (all enabled)

* feat: :art: migration from Channel to Channel with verification

* feat: :art: offchain notifcations creation timestmap

* refactor: :recycle: Notification code rework to accomodate design specs

* fix: :art: notification delivery and fields

* feat: :art: no separate notifications

* migration order

* email function rework

* notifications rework

* refactor: :recycle: unify notifications

* fix: :green_heart: fix notification build error after schema changes

* feat: :truck: rename and re org utils/notification directory

* fix: :green_heart: mappings/content/channels tsc errors

* refactor: :green_heart: fix content/comments and reactions / videos

* fix: :green_heart: fix content / nft notification deposit

* fix: :green_heart: channel / resolvers notification deposit

* fix: :green_heart: Video resolver notification deposit

* fix: :green_heart: admin resolvers

* fix: :green_heart: fix direct member payment notification deposit

* fix: :green_heart: fix notification resolvers

* feat: :art: add app root domain

* feat: :art: add notification links

* feat: :art: notification links

* feat: :art: set resolver for setting app_root_domain and notification center

* feat: :art: add email content with some formatting

* feat: :art: add verify channel resolver with approporiate ChannelVerification entity

* fix: :fire: no events or notifications are removed

no events or notifications will be removed, since they are now tied to an account and at the mement we don't support account deletion

* feat: :art: add royalty payment

* fix: :green_heart: build errors

* fix: :adhesive_bandage: patch squid middleware to return 401 for unauth

* fix: :green_heart: fix ci build

* feat: :art: migrate next entity id for account

* temporarely hide integration tests

* fix gitignore

* fix: :green_heart: eslint fixes

* prettier

* chore: :green_heart: generate migration data and bump versions

* feat: add channel verification to hidden entities

* feat: :bug: migrations

* fix: :green_heart: CI checks on migrations

* notifications visible to accounts

* feat: :fire: re-establish old visibility policy for notificatinos

* fix: misc

* fix: :bug: misc fixes for migrations

* feat: :art: rename auctionExpired -> timedAuctionExpired and add notificatino for channel suspended

* feat: :art: channel suspension resolver

* feat: :sparkles: better emails

* fix: :bug: royalty computation and notification id tag

* feat: :art: add notification timestamp

* fix: :bug: purchased nft / channel payment / funds withdrawn notification text

* fix: :bug: resolvers

* fix: :bug: VideoHero and channel suspension resolvers

* feat: :green_heart: fix ci build

* fix: :green_heart: generate Data.js and add suspension to hidden entities

* fix: :art: add channel_suspended to migrated entities

* style: :lipstick: better name for computeRoyalty args

* fix: :green_heart: post rebase fixes

* fix: :green_heart: post rebase fixes

* fix: :green_heart: post rebase fixes

* Update src/mappings/content/nft.ts

Co-authored-by: attemka <attemka@gmail.com>

* Update src/mappings/content/nft.ts

Co-authored-by: attemka <attemka@gmail.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/mappings/content/channel.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/mappings/content/channel.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/server-extension/resolvers/NotificationResolver/index.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update package.json

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/server-extension/resolvers/VideosResolver/index.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update src/server-extension/resolvers/ChannelsResolver/index.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update schema/hidden.graphql

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: :bug: notification created only once when orion_db is active

* fix: :art: misc PR comment address

added non-visibility of notification_delivery_* entities

* feat: :art: exported state entity migrated

* fix: :art: remove joystream patched types

* fix: :art: add ypp status to better match the YTS code

* style: :lipstick: refactor code for page links

* fix: :art: setup text for notifications & regenerate schema

* fix: :bug: PR comments

feat: :recycle: refactor mail code

fix: :zap: royalty price precision

fix: :bug: PR comments

perf: :zap: add max number of concurrent promises for fetching channel followers

fix: :bug: PR comments

fix: :bug: PR comments

fix: :bug: PR comments

regenerate data

Update src/mappings/content/channel.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

Update src/server-extension/resolvers/VideosResolver/index.ts

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

fix: :bug: overlay vs orion_db for notification

Now notification are first written in the overlay (if deposited by processor) otherwise they are written directly into orion_db

fix: :bug: overlay vs orion_db for notification

Now notification are first written in the overlay (if deposited by processor) otherwise they are written directly into orion_db

fix: :bug: overlay vs orion_db for notification

Now notification are first written in the overlay (if deposited by processor) otherwise they are written directly into orion_db

fix: :bug: separate mail sent by processor and those sent by server due to overlay presence

fix: :bug: notification & notification on chain delivery mail deposit

fix: :bug: notification & notification on chain delivery mail deposit

fix: :bug: notification & notification on chain delivery mail deposit

* fix: :bug: rework channel notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: :bug: rework channel notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: :bug: rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: :bug: rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: :bug: rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: :bug: rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

* fix: :bug: rework notification data

edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers

---------

Co-authored-by: attemka <attemka@gmail.com>
Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: uninitialized access of NftPurchased type (#179)

* Orion notifications fixes (#195)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: :memo: update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: :ambulance: fix accountId global counter not being migrated (#188)

* style: :art: schema & helpers refactor

feat: :sparkles: resolver for in app notification

* Update the recipient schema

* feat(notification v1): :sparkles: resolver for in-app notifications

* fix: :art: remove inApp delivery entity and inApp resolver no longer used

* fix: :art: make notification public and fix linter

* fix: :bug: PR iter

* test: :white_check_mark: test setup missing notificationsj

* test: :white_check_mark: add test for set Featured nft

* fix: :bug: misc fixes after testing

* added referrerChannelId to the Account entity

* fix: :white_check_mark: add all tests for missing notifications

* fix: :white_check_mark: add all tests for missing notifications

* ci: :green_heart: add a notifications tests

* fix: :rotating_light: linter fixes

* fix: :green_heart: regenerate typeorm-migration scripts

* fix: :white_check_mark: update bid related tests and clean test reports

* feat: :art: make channel excluded member notification

* feat: :art: make channel excluded member notification

* fix: :sparkles: add event data for channel

* style: :lipstick: remove unused variant

* fix: :pencil2: re check all relation between notification preferences and entities

* fix: :pencil2: re check all relation between notification preferences and entities

* fix: :sparkles: NotificationPreferences Object type for the graphql resolver

* fix: :bug: distinguish between auction types

* fix: :bug: distinguish between auction types

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>
Co-authored-by: attemka <attemka@gmail.com>

* fix: :bug: Video Liked data unitialized (#204)

* Orion notifications video liked (#205)

* fix: :bug: Video Liked data unitialized

* fix: :bug: Video Liked data unitialized

* test: :white_check_mark: add test for video liked

* test: :white_check_mark: add test for video liked

* fix: comment id not added to notification data (#206)

* fix: :bug: uninitialized notification data fields (#207)

* migrations to 3.1.0 with fix for Overlay data race during migration (#200)

* feat: :art: add migration for accounts and channels

* test: :white_check_mark: add network test folder

* feat: :white_check_mark: add archive dump and export to test migrations

* feat: :bug: overlay and migration data race

* ci: :green_heart: add ci checks for migration

* fix: :coffin: remove dead code

* Mail scheduler feature (#208)

* feat: :sparkles: start scheduler work

* test: :white_check_mark: add test setup

* feat: :art: review data model

* feat: :art: setup tests and refactor data model

* test: :art: add extra seed data

* feat: :art: EmailDelivey.status success status changed on sendNew

* feat: :art: report entities generated on sendNew

* feat: :art: add support for error status

* fix: :bug: avoid rewriting failedDlivery field on EmailDelivery with old version

* fix: :art: add fk for inApp and email delivery no notification entity

* feat: :art: add max attempt config variable

* feat: :art: seed data for config variable

* fix: :art: refactor after rebase

* feat: :white_check_mark: start adding test boilerplate code

feat: :art: finalize delivery feature

feat: :green_heart: add ci checks with scheduler tests

fix: :rotating_light: fix linter

* feat: :rewind: rebase to orion_notifications

* Add an MJML template for email notifications

* Update the links

* Adjust the template after testing it

* Update email links, texts, and icons

* Add avatars in email notifications

* Format amounts of JOYs in the notifications

* Have notification nft links open the nft widget

* Point icon links to GH for now

* Fix the `formatJOY` function

* Add the missing email data

* Update the template for png icons

* Improve avatar code

* Remove unnecessary change

* feat: :art: config variables for email

* feat: :sparkles: add resolvers for setting variables

tested ✅

* feat: enable mail content and remove unused file

* fix: :white_check_mark: content delegated to Q&A

* fix: :package: update package lock

---------

Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* Notifications/scheduler main (#210)

* feat: :sparkles: add main function invocation

* feat: :sparkles: make dbgen

* fix: :art: process env not being read for db connection (#212)

* 👥 Add member ids to `NotificationType` (#219)

* Add memberIds to some `NotificationType`

* Link to members by ids on emails

* Get member avatars by id on emails

* update notification branch with master (#220)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: :memo: update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: :ambulance: fix accountId global counter not being migrated (#188)

* docs: :memo: add back up guide (#196)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated (#193)

* fix: :art: process env not being read for db connection

* test: :test_tube: add test for email delivery entity deposit

* fix: :bug: encoding issues with member handle (#214)

* fix: :bug: encoding issues with member handle

* fix: :bug: pr issues

* fix: :bug: refactor and update changelog

* docs: update version number

* fix: :ambulance: account counter (#215)

* fix: :test_tube: failing test on migratinos

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* update with master (#233)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: :memo: update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: :ambulance: fix accountId global counter not being migrated (#188)

* docs: :memo: add back up guide (#196)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated (#193)

* fix: :bug: encoding issues with member handle (#214)

* fix: :bug: encoding issues with member handle

* fix: :bug: pr issues

* fix: :bug: refactor and update changelog

* docs: update version number

* fix: :ambulance: account counter (#215)

* Orion v3.0.3 (#224)

* Remove n+1 problem for StorageDataObject (#209)

* Remove n+1 problem for StorageDataObject

* Inform user about incorrect query

* fix: :sparkles: add global counter migratino to account for 303 (#217)

* Orion 303 final touches (#223)

* feat: :sparkles: add CORS origins for atlas local testing

* chore: :memo: adds 303 release notes

* Fix typos (#176)

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typo

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

---------

Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>

* Orion v3.0.4 - Release (#230)

* 🧮 Aggregate channel payments (#222)

* Fix channels `cumulativeRewardClaimed_DESC` order

* Aggregate channel payments

* Make `cumulativeRewardClaimed` and `cumulativeRewardPaid` non null

* Generate db migrations

* Rename the `cumulativeReward` field

* Re-generate db migrations

* Bump Orion's version

* feat: :zap: add migration to version 3.0.4 for account id counter (#228)

---------

Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* 🔨 Fix the notification template (#234)

* Fix notification template

* Remove `!` from the email subject

* Fix asset links

* Notification branch fixes for issued arised during Q&A (#225)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: :memo: update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: :ambulance: fix accountId global counter not being migrated (#188)

* docs: :memo: add back up guide (#196)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated (#193)

* fix: :bug: encoding issues with member handle (#214)

* fix: :bug: encoding issues with member handle

* fix: :bug: pr issues

* fix: :bug: refactor and update changelog

* docs: update version number

* fix: :ambulance: account counter (#215)

* Orion v3.0.3 (#224)

* Remove n+1 problem for StorageDataObject (#209)

* Remove n+1 problem for StorageDataObject

* Inform user about incorrect query

* fix: :sparkles: add global counter migratino to account for 303 (#217)

* Orion 303 final touches (#223)

* feat: :sparkles: add CORS origins for atlas local testing

* chore: :memo: adds 303 release notes

* Fix typos (#176)

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typo

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

---------

Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>

* fix(notifications): uninitialized access fields

* fix(notifications): :bug: add channelId to new auction

* Orion v3.0.4 - Release (#230)

* 🧮 Aggregate channel payments (#222)

* Fix channels `cumulativeRewardClaimed_DESC` order

* Aggregate channel payments

* Make `cumulativeRewardClaimed` and `cumulativeRewardPaid` non null

* Generate db migrations

* Rename the `cumulativeReward` field

* Re-generate db migrations

* Bump Orion's version

* feat: :zap: add migration to version 3.0.4 for account id counter (#228)

---------

Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: :sparkles: changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Hotfix/3.1.0 (#240)

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: :sparkles: changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: :ambulance: hotfix default value for channel weight no matter what

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: :white_check_mark: add test for comment reply and metadata

* fix: :sparkles: solve conflicts

* test: :white_check_mark: add test for channel verification + refactoring

* chore: :rotating_light: linter

* fix: :green_heart: add 10 seconds sleep time for CI checks

* fix: :bug: channel excluded title

* docs: :memo: typo

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* 🩹 Fix JOY values in emails and footer (#241)

* Fix JOY values in emails

* Fix email footer

* Test `formatJOY` function

* Use `Number.toFixed` to rewrite `formatJOY`

* Fix demo emails

* 🔧 One more notification email fix (#254)

* Attempt to fix channel avatar on emails

* Improve email template

* Notifications/qa fixes (#250)

* fix: :bug: unitialized access video posted + misc

* feat: :zap: batch channel verification

* fix: :zap: remove non necessary import

* Notifications/qa fixes (#255)

* fix: :bug: unitialized access video posted + misc

* feat: :zap: batch channel verification

* fix: :zap: remove non necessary import

* feat: :sparkles: batch suspend channel and pLimits promises

* Notifications/qa fixes (#256)

* fix: :bug: unitialized access video posted + misc

* feat: :zap: batch channel verification

* fix: :zap: remove non necessary import

* feat: :sparkles: batch suspend channel and pLimits promises

* fix: :bug: typegraphql return type

* Notifications/qa fixes (#255)

* fix: :bug: unitialized access video posted + misc

* feat: :zap: batch channel verification

* fix: :zap: remove non necessary import

* feat: :sparkles: batch suspend channel and pLimits promises

* fix: :art: import

* style: :lipstick: format

* Notifications/no self notifications (#258)

* Update squid.yaml

fix: squid.yml version numbering

* Release PR: Orion v3.0.1 (#185)

* fix: processor's overlay bug (#170)

* atlas homepage query speed optimisation (#177)

* fix: gitignored src/model/generated

* add index on video.video_relevance field

* fix typo in developer guide docs

* regenerate db/migrations/*-Data.js file

* Fix/unblock graphql (#183)

* Make session optional and apply changes for auth handles

* Create new middleware for users and use it on some resolvers

* Remove remaining auth guards

* Small docs change

* Add middleware for channel report

* Prettier

* docs: :memo: update changelog (#184)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* fix: :ambulance: fix accountId global counter not being migrated (#188)

* docs: :memo: add back up guide (#196)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated (#193)

* fix: :bug: encoding issues with member handle (#214)

* fix: :bug: encoding issues with member handle

* fix: :bug: pr issues

* fix: :bug: refactor and update changelog

* docs: update version number

* fix: :ambulance: account counter (#215)

* Orion v3.0.3 (#224)

* Remove n+1 problem for StorageDataObject (#209)

* Remove n+1 problem for StorageDataObject

* Inform user about incorrect query

* fix: :sparkles: add global counter migratino to account for 303 (#217)

* Orion 303 final touches (#223)

* feat: :sparkles: add CORS origins for atlas local testing

* chore: :memo: adds 303 release notes

* Fix typos (#176)

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typo

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

* fix typos

---------

Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>

* Orion v3.0.4 - Release (#230)

* 🧮 Aggregate channel payments (#222)

* Fix channels `cumulativeRewardClaimed_DESC` order

* Aggregate channel payments

* Make `cumulativeRewardClaimed` and `cumulativeRewardPaid` non null

* Generate db migrations

* Rename the `cumulativeReward` field

* Re-generate db migrations

* Bump Orion's version

* feat: :zap: add migration to version 3.0.4 for account id counter (#228)

---------

Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: :sparkles: changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Hotfix/3.1.0 (#240)

* Orion v3.1.0 (#238)

* Add granular permissions support for Gateway operator users (#231)

* Add granular permissions support for Gateway operator users

* fix lint issues

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* Set Channel Weight (`setChannelsWeights`) mutation (#232)

* Add granular permissions support for Gateway operator users

* fix lint issues

* add mutation to set channel weight/bias for homepage video relevance

* revert docker-compose port change

* mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean

* bump package version

* update global migration counter map

* bumped package version & updated CHANGELOG

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* Postgres performance improvements (#235)

* add index in video.createdAt field

* add pg_stat_extenstion extenstion for queries stats

* docs: :sparkles: changelog and fix data-js (#237)

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* fix: :ambulance: hotfix default value for channel weight no matter what

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* docs: :memo: documentation for email notificaions

* feat: :bug: don't notify channel owner if he's reacting

* feat: :bug: avoid sending notification for reaction to self comment

* fix: :art: pr comments

* fix: :green_heart: tests faliing on user liking his own video

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>

* 🤞 Fix the channel avatar url (#257)

* Extract the asset url logic

* Fix the channel avatar url

* Add a script to run the mail scheduler

* fix: :green_heart: ci error on globalem

* Memoize `getNotificationAvatar`

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>

* docs: :memo: changelog (#260)

* Cache avatars based on just type and id (#259)

---------

Co-authored-by: attemka <attemka@gmail.com>
Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>

* fix: :ambulance: remove extra return type from resolver (#265)

* Update .env

example .env updated with notification variables

* Fix/homepage scoring (#251)

* Update video relevance manager query

* Remove single video schedules for relevance recalc

* Fix namings

* Reformat query

* Revert "Remove single video schedules for relevance recalc"

This reverts commit 3a685b97

* Adjust logic for single channel recalc

* Unblock video relevance recalc only after processor reaches last exported block

* Increase global recalc interval

* Avoid query if set is empty

* Introduce smaller interval for scheduled channels

* Typo fix

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Linter

* Add video recalc on channel weight change

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>

* Update CHANGELOG.md

* email delivery attempt export (#271)

* Account id counter (#273)

* email delivery attempt export (#271)

* fix: :green_heart: remove falinig test on migration

since now we have dropped the new migration logic

* Update operator docs (#281)

* docs: :memo: improve operator example file configs

* docs: :memo: email notifications guide improvement

* fix: :memo: documentation .env archive endpoint variable

* fix: :memo: example env gateway_port:8000

* docs: rework deploy orion documentation

* docs: :memo: finalize deployment docs

* docs: :memo: minor improvements in the documentations

* Update README.md

* Extend session based on activity after initial expiry is over (#287)

* Index most used field for ordering (#246)

* Add required indexes to nft and video entity

* Regen migrations

* Add index at event timestamp field

* Regen migrations

* Regen migrations v2

* Regen migrations v3

* Fix/notification email title (#289)

* Add new property to each notification type

* Use new subject property in email

* Remove app name from subject

* Orion setup improvements (#288)

* fix: deadlock issue caused by migration scripts

* gitignore src/types/

* update nodejs version to node:18

* added 'generate-migrations' makefile  command to generate migrations

* add npm command to get graphql chema

* add opentelemetry tracing integration with graphql-server and auth-server

* update docker.yml github workflow

* fix: DistributionBucketsCache init bug

* Improved offchain import/export script

* fix: dockerfile

* fix: dockerfile

* fix eslint issues

* fix checks.yml github workflow

* regenerate db migration files

* fix: Don't expose db container ports

* fix notification errors

* merge upstream/master

* Version 3.2.1 (#290)

* fix: deadlock issue caused by migration scripts

* gitignore src/types/

* update nodejs version to node:18

* added 'generate-migrations' makefile  command to generate migrations

* add npm command to get graphql chema

* add opentelemetry tracing integration with graphql-server and auth-server

* update docker.yml github workflow

* fix: DistributionBucketsCache init bug

* Improved offchain import/export script

* fix: dockerfile

* fix: dockerfile

* fix eslint issues

* fix checks.yml github workflow

* regenerate db migration files

* fix: Don't expose db container ports

* fix notification errors

* merge upstream/master

* remove unused property 'globalCountersMigration' from OffchainState

* refactor notifications scripts

* bump package version and update changelog

* 🐉 Homepage language improvements (#295)

* Add language utils

* Add new property to schema

* Try to predict language for each video

* Generate new mappings

* 🦢 Switch language package (#296)

* Replace ngram package

* Remove fallback to metadata language

* Add language predition to the update mapping

* Changelog and version bump

* Orion db migrations and state export fixes (#298)

* read/write export.json file using big-json package

* patch @subsquid/typeorm-config & @subsquid/typeorm-migration packages to change 'squid-typeorm-migration apply' commad to apply a single migrations file too

* regenerate the postgres db migrations

* update package version and add changelog

* added custom migration to set orionLanguage to all of the processed videos

* update *-Data.js migration file

* rename *-Operator.js migrations file

* rename *-Indexes.js migrations file

* patch @subsquid/openreader and @subsquid/typeorm-codegen dependencies  include the db schema too in the generated postgres migrations, and a 'schema' directive to specify the schema of any entity

* create *-Admin.js migration to create an admin schema & user

* separate the view definitions from views migration file

* create JS script to create new views migrations file.

* add @schema direcitve to hidden entities in graphql schema definitions

* regenerate db/migrations

* update 'generate-migrations' makefile command

* updated documentation for upgrading orion and entity visibility

* update CHANGELOG

* create VIEWs for hidden entities too

* fix: use snake case property names in createQueryBuilder instance methods

* fix: .gitignore not working

* fix lint issues

* re-generate db migrations

* Add is short field to video entity (#301)

* add isShort field to video entity

* regenerate db migrations

* remove @joystream/metadata-protobuf patch from assets/patches

* fix lint issue

* Disable both in Appp and eail notifications for video posted events (#299)

* bump package version and update CHANGELOG (#302)

* bump package version and update CHANGELOG

* change release version

* Simple public homefeed query and mutation (#304)

* update graphql schema

* add partial index on 'video.include_in_home_feed' field

* update video view definition to only include public videos

* regenerate migrations

* add dumbPublicFeedVideos custom query

* add setPublicFeedVideos mutation

* fix lint issue

* add arg to skip video IDs

* revert: update video view definition to only include public videos

* add feat. to unset public feed videos

* address requested change

* bump package version and update CHANGELOG

* commit register.html.mst file

* fix: notifications integration test

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>
Co-authored-by: omahs <73983677+omahs@users.noreply.github.com>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>
Co-authored-by: attemka <attemka@gmail.com>

* 🦿 CRT marketplace changes (#285)

* Add new field and index to creator token

* Add mutation to feature crts

* Schema typo fix

* Add is short field to video entity (#301)

* add isShort field to video entity

* regenerate db migrations

* remove @joystream/metadata-protobuf patch from assets/patches

* fix lint issue

* Disable both in Appp and eail notifications for video posted events (#299)

* bump package version and update CHANGELOG (#302)

* bump package version and update CHANGELOG

* change release version

* Simple public homefeed query and mutation (#304)

* update graphql schema

* add partial index on 'video.include_in_home_feed' field

* update video view definition to only include public videos

* regenerate migrations

* add dumbPublicFeedVideos custom query

* add setPublicFeedVideos mutation

* fix lint issue

* add arg to skip video IDs

* revert: update video view definition to only include public videos

* add feat. to unset public feed videos

* address requested change

* bump package version and update CHANGELOG

* Update `nara` from `master` (#300)

* Adds mappings for `ChannelAssetsDeletedByModerator` & `VideoAssetsDeletedByModerator` events (#199)

* mark 'VideoDeletedByModerator' & 'ChannelDeletedByModerator' events deprecated

* Implements mappings for 'Content.VideoAssetsDeletedByModerator and 'Content.ChannelAssetsDeletedByModerator' runtime events

* remove unused import

* Nara/crt update (#244)

* feat: build orion

* feat: start generating schema

* fix: extra entities

* fixup!

* fix: continue implementing design specs

* fix: review and fix foreign key relationships

* fix: formatting

* fix: generation errors

* fix: add comment

* fix: relations

* fix: final review

* fixup!

* fix: add ending blocks

* fix: generate type & set typegen to ipv4

* fix: add support for event backward compatibility

* feat: start adding mappings

* fix: continue with mappnigs

* feat: init sale

* feat: patronage decreased to & fixed build

* feat: claim patronage event

* feat: tokens bought on amm

* feat: tokens sold on amm

* fix: add relation between sales and vesting schedules

* feat: add Tokens sold on sale vente

* feat: update upcoming sale

* feat: revenue share issued

* feat: member joined whitelist

* feat: amm deactivated

* feat: burned token

* feat: transfer policy changed to permissionless

* feat: sale finalized

* feat: finish mappings

* fix: review

* fix: remove cascade deletions

* fix: renaming & formatting

* fixup!

* fixup!

* fix: patched protobuf packages with token proto

* feat: update metadata and add event handler scheleton

* feat: token metadata

* feat: sale metadata

* fix: review comments

* fix: formatting

* fix: revenue

* Revert "fix: revenue"

This reverts commit 0821abe1e5e19be37a8d9a25d621dd148f03be9c.

* fix: token status after sale

* fix: fixmes

* fix: formatting

* fix: funds accounting during sale

* fix: amount accounting

* fix: linter

* fix: review

* fix: review 2

* fix: review

* fix: linter

* feat: migration for new db scheam

* fix: update event versions

* fix: patch types with crt_release types

* fix: patch types

* fix: generate all events versions since mainnet

* fix: temp fix after event version generation

* fix: event versioning

* fix: add migration

* fix: mignations

* fix: solve channel not being added

* fix: add id to TokenChannel

* fix: non-nullable deleted field set

* fix: format

* feat: creator token init sale re enabling

* feat: re enable sale init code

* fix: update types

* fix: amm id

* fix: id computation for revenue share

* fix: amm id computation for token

* fix: issuer transfer accounting

* fix: amm tx id

* fix: destination accounting

* feat: minor fix on holder transfer processing

* fix: re-enable metadata

* fix: metadata parsing

* fix: post reword cleanup

* fix: format

* fix: silence ci checks

* fix: event version

* fix: address PR changes

I edited all the entity that have a composite index like TokenAccount so that they have
a synthetic ID and an optionally unique @index

* fix: add hidden entities conditions

* fix: add extra fields to token in order to keep track of ongoing status

* fix: build errors

* fix: adapt mapping to new token fields

* fix: format

* feat: add trailer video entity

this is required so we can simply make trailer video hidden if video is hidden

* fix: linter

* chore: prettier

* fix: from PR review

* fix: vesting schedule schema & mappings

I have replaced the vesting schedule back to the original schema with:
- VestingSchedule: holding vesting schedule information such being amount agnostic
- VestedAccount: contains information regarded to a vested account, the goal is to mimic the
runtime logic

* fix: burning from vesting

* patch: metadata-protobuf package

* patch: metadata-protobuf package

* fix: generate migrations

* fix: purchase token on sale

* Update schema/token.graphql

Co-authored-by: Leszek Wiesner <leszek@jsgenesis.com>

* Update schema/token.graphql

Co-authored-by: Leszek Wiesner <leszek@jsgenesis.com>

* fix: address PR

* fix: hidden entities

* fix: migration ok

* feat: add extra check for migrations

* fix: docker network

* fix: format

* fix: remove unrequired constraint

* fix: :bug: post rebase fixes

* feat: :art: add metadata processing for issue token

* feat(crt-v1): :sparkles: chain metadata for v 2003

* fix(crt-v1): :ambulance: comment out view element for orion playgroud

* fix(crt-v1): :art: add playground config variable to .env

* feat: :white_check_mark: add tests

* fix(crt-v1): :package: packages and patches

* fix(crt-v1): :white_check_mark: update entity id used and other minor fixes

* fix(crt-v1): :white_check_mark: update entity id used and other minor fixes

* test(crt-v1): :bug: misc fixes to have tests working

* test(crt-v1): :bug: misc fixes to have tests working

* fix(crt-v1): :bug: metadata and trailer video

* feat(crt-v1): :art: update types

* fix(crt-v1): :sparkles: Add correct Ratio denomination (Permill)

* update with master

* fix: :bug: metadata not being set

* fix: :bug: parameters order

* test: :test_tube: fixing integration tests

* test(crt-v1): :test_tube: fix integration tests

* feat(crt-v1): :sparkles: last price for token and recovered field for rev share part

* feat: :sparkles: add resolver for dividend amount

* feat(crt-v1): :sparkles: start adding channel fields for trackingtotal revenue

* feat(crt-v1): :sparkles: add utils for royalty computation

* feat(crt-v1): :sparkles: cumulative revenue on channel

* feat(crt-v1): :sparkles: add resolver for transferrable amount

* fix(crt-v1): :sparkles: add `acquiredAt` to pinpoint latest vesting schedule for account

* Token metadata processing update

* Prettier

* chore(crt-v1): :zap: dbgen

* fix(crt-v1): :test_tube: fix integration tests

* fix(crt-v1): :bug: missing fields in token sale vesting source

* test(crt-v1): :test_tube: test for transferrable balance amount

* fix(crt-v1): :bug: transferrable amount

* test: :test_tube: update tests after resolver fix

* fix: :bug: error on vesting schedules array

* fix: :art: CI fixes

* docs: update gitignore

* fix: :rotating_light: prettier

* build: :pushpin: chai depnedencies

---------

Co-authored-by: Leszek Wiesner <leszek@jsgenesis.com>
Co-authored-by: WRadoslaw <r.wyszynski00@gmail.com>

* Clear benefits even if not passed (#282)

* 🤑 Fix revenue share dividend estimation (#297)

* Fix on revenue share dividend estimation

* Fix type on result

* 🛕 Historical revenue share participants (#286)

* New field for revenue share

* Set potential revenue share particitants at the time of start

* fix: .gitignore not working

* fix lint issues

* re-generate db migrations

* commit register.html.mst file

* fix: notifications integration test

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>
Co-authored-by: Leszek Wiesner <leszek@jsgenesis.com>
Co-authored-by: WRadoslaw <r.wyszynski00@gmail.com>
Co-authored-by: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com>

* Revert "Update `nara` from `master` (#300)" (#306)

This reverts commit 887427c75548417dedc741f9b258f7d49e1a0b4e.

* generate auth api docs and types

---------

Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com>
Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>
Co-authored-by: Leszek Wiesner <leszek@jsgenesis.com>
Co-authored-by: Zeeshan Akram <97m.zeeshan@gmail.com>

* fix :re-generate migrations & set CreatorToken.isFeatured default value (#308)

* Feat/crt notifications (#267)

* User accounts notifications (#164)

* feat: squash all commits for notification demo

fix: add notification and template choice

feat: sketch mutation for setting the prefeences

fix: arguments for preference selection function

feat: add runtime notification data and notification preferences

fix: notification for runtime events

fix: add notification preference mutation

feat: add email strategy

fix: split Notification into onchain and offchain

fix: add channel created event notifiation

feat: distinguisher between member and channel notifiation

feat: enable offchain notification entities export

fix: notification preferences resolver

fix: migration

feat: default notification preferences

feat: start adding tests

fix: tests

fix: tests

fix: notificatino preference mutation and complete test

fix: add support for offchain dat

fix: missc

fix: format & fix build errors

fix: build and migrations

fix: bugs in setting notifications

fix: add case for notification mutation status

fix: build errors

fix: format

fix: data

* fix: remove non needed entity for migration

export / import scripts allows to specify fields of entities which will be migrated
In this case runtime notification will be migrated partially by offchain and partiall
by handlers

* feat: mark notifications as read

* fix: runtime notification migration generation

* feat: add event notification for video posted

* feat: add video comment

* feat: add chanel verification mutation

* feat: video excluded from app notifications

* feat: channel exclusion

* fix: Channel exclusion

* feat: notification deposit for video reaction

* feat: reaction for comment notifi…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants