94fbabcdf9
* Notifications for when you are forwarded sats from a post Support notifications when a post for which you are forwarded gets zapped This is controlled by a new boolean flag in user settings * Send push notifications to forwarded users when they get forwarded sats * Add `Promise.allSettled` per PR feedback * Remove `FEE` act type when building forwarded zaps notifications Don't include `FEE` actions, only `TIP` actions to avoid "0 sats forwarded" notifications --------- Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
110 lines
1.8 KiB
JavaScript
110 lines
1.8 KiB
JavaScript
import { gql } from 'graphql-tag'
|
|
|
|
export default gql`
|
|
extend type Query {
|
|
notifications(cursor: String, inc: String): Notifications
|
|
}
|
|
|
|
extend type Mutation {
|
|
savePushSubscription(endpoint: String!, p256dh: String!, auth: String!, oldEndpoint: String): PushSubscription
|
|
deletePushSubscription(endpoint: String!): PushSubscription
|
|
}
|
|
|
|
type Votification {
|
|
id: ID!
|
|
earnedSats: Int!
|
|
item: Item!
|
|
sortTime: Date!
|
|
}
|
|
|
|
type ForwardedVotification {
|
|
id: ID!
|
|
earnedSats: Int!
|
|
item: Item!
|
|
sortTime: Date!
|
|
}
|
|
|
|
type FollowActivity {
|
|
id: ID!
|
|
item: Item!
|
|
sortTime: Date!
|
|
}
|
|
|
|
type Reply {
|
|
id: ID!
|
|
item: Item!
|
|
sortTime: Date!
|
|
}
|
|
|
|
type Mention {
|
|
id: ID!
|
|
mention: Boolean!
|
|
item: Item!
|
|
sortTime: Date!
|
|
}
|
|
|
|
type Invitification {
|
|
id: ID!
|
|
invite: Invite!
|
|
sortTime: Date!
|
|
}
|
|
|
|
type JobChanged {
|
|
id: ID!
|
|
item: Item!
|
|
sortTime: Date!
|
|
}
|
|
|
|
type EarnSources {
|
|
id: ID!
|
|
posts: Int!
|
|
comments: Int!
|
|
tipPosts: Int!
|
|
tipComments: Int!
|
|
}
|
|
|
|
type Streak {
|
|
id: ID!
|
|
sortTime: Date!
|
|
days: Int
|
|
}
|
|
|
|
type Earn {
|
|
id: ID!
|
|
earnedSats: Int!
|
|
minSortTime: Date!
|
|
sortTime: Date!
|
|
sources: EarnSources
|
|
}
|
|
|
|
type InvoicePaid {
|
|
id: ID!
|
|
earnedSats: Int!
|
|
invoice: Invoice!
|
|
sortTime: Date!
|
|
}
|
|
|
|
type Referral {
|
|
id: ID!
|
|
sortTime: Date!
|
|
}
|
|
|
|
union Notification = Reply | Votification | Mention
|
|
| Invitification | Earn | JobChanged | InvoicePaid | Referral
|
|
| Streak | FollowActivity | ForwardedVotification
|
|
|
|
type Notifications {
|
|
lastChecked: Date
|
|
cursor: String
|
|
notifications: [Notification!]!
|
|
}
|
|
|
|
type PushSubscription {
|
|
id: ID!
|
|
userId: ID!
|
|
endpoint: String!
|
|
p256dh: String!
|
|
auth: String!
|
|
}
|
|
`
|