@notidotbot/noti-api-client 1.9.61 → 1.9.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/classes/guildBadges.d.ts +18 -0
- package/dist/classes/guildBadges.js +16 -0
- package/dist/classes/guildDrops.d.ts +29 -0
- package/dist/classes/guildDrops.js +20 -0
- package/dist/classes/guildGiveaway.d.ts +28 -1
- package/dist/classes/guildGiveaway.js +14 -0
- package/dist/classes/publicDrops.d.ts +147 -0
- package/dist/classes/publicDrops.js +54 -0
- package/dist/classes/publicGiveaways.d.ts +152 -0
- package/dist/classes/publicGiveaways.js +80 -0
- package/dist/core/manager.d.ts +4 -0
- package/dist/core/manager.js +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +10 -1
- package/dist/other/bitfields.d.ts +8 -2
- package/dist/other/bitfields.js +6 -0
- package/dist/other/features.d.ts +1 -1
- package/dist/other/features.js +3 -0
- package/dist/other/giveawayClaims.d.ts +23 -0
- package/dist/other/giveawayClaims.js +33 -0
- package/dist/other/zod/giveaways.zod.d.ts +19 -0
- package/dist/other/zod/giveaways.zod.js +12 -0
- package/dist/other/zod/guild.zod.d.ts +2 -0
- package/dist/other/zod/guild.zod.js +2 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/prisma/generated/ts-prisma.d.ts +303 -58
- package/prisma/schema/models/giveaways.prisma +43 -0
- package/prisma/schema/models/guild.prisma +3 -0
- package/prisma/schema/schema.prisma +6 -0
|
@@ -33,6 +33,43 @@ model GuildGiveaway {
|
|
|
33
33
|
roleBonuses GuildGiveawayRoleBonus[]
|
|
34
34
|
requirements GuildGiveawayRequirements?
|
|
35
35
|
bypassRequirementsRoles String[]
|
|
36
|
+
|
|
37
|
+
// Claim to win (phases/giveaway-claims/). Null window = no claiming, the original behaviour.
|
|
38
|
+
claimWindowMinutes Int?
|
|
39
|
+
claimRound Int @default(0)
|
|
40
|
+
claimFinishedAt DateTime?
|
|
41
|
+
claimMessageId String?
|
|
42
|
+
winners GuildGiveawayWinner[]
|
|
43
|
+
|
|
44
|
+
winnerRoleId String?
|
|
45
|
+
winnerRoleRemoveAfterDays Int?
|
|
46
|
+
dmWinners Boolean?
|
|
47
|
+
|
|
48
|
+
// Public giveaways page: null follows the server's `publicGiveaways`, true/false overrides it.
|
|
49
|
+
publicListing Boolean?
|
|
50
|
+
|
|
51
|
+
// The public page scans running giveaways across every server.
|
|
52
|
+
@@index([endedAt, startedAt])
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// One row per user drawn as a winner, per giveaway. `winnerIds` on the giveaway still means "current
|
|
56
|
+
// winners" for every existing reader; this table holds the claim state behind it. The unique pair is
|
|
57
|
+
// what makes "never draw someone who already won a round" a property of the table.
|
|
58
|
+
model GuildGiveawayWinner {
|
|
59
|
+
dbId String @id @default(uuid())
|
|
60
|
+
|
|
61
|
+
userId String
|
|
62
|
+
round Int
|
|
63
|
+
status GiveawayWinnerStatusEnum
|
|
64
|
+
claimDeadline DateTime?
|
|
65
|
+
claimedAt DateTime?
|
|
66
|
+
createdAt DateTime @default(now())
|
|
67
|
+
|
|
68
|
+
guildGiveawayId String
|
|
69
|
+
guildGiveaway GuildGiveaway? @relation(fields: [guildGiveawayId], references: [dbId], onUpdate: Cascade, onDelete: Cascade)
|
|
70
|
+
|
|
71
|
+
@@unique([guildGiveawayId, userId])
|
|
72
|
+
@@index([guildGiveawayId, status])
|
|
36
73
|
}
|
|
37
74
|
|
|
38
75
|
model GuildGiveawayEntry {
|
|
@@ -44,6 +81,11 @@ model GuildGiveawayEntry {
|
|
|
44
81
|
|
|
45
82
|
guildGiveawayId String
|
|
46
83
|
guildGiveaway GuildGiveaway? @relation(fields: [guildGiveawayId], references: [dbId], onUpdate: Cascade, onDelete: Cascade)
|
|
84
|
+
|
|
85
|
+
// One entry per user per giveaway, enforced here rather than by an in-memory check that two fast clicks
|
|
86
|
+
// could both pass. Run src/scripts/dedupe-giveaway-entries.ts --apply BEFORE the push that adds this.
|
|
87
|
+
@@unique([guildGiveawayId, userId])
|
|
88
|
+
@@index([guildGiveawayId])
|
|
47
89
|
}
|
|
48
90
|
|
|
49
91
|
model GuildGiveawayFilter {
|
|
@@ -76,6 +118,7 @@ model GuildGiveawayRequirements {
|
|
|
76
118
|
boostingServer Boolean?
|
|
77
119
|
messageCount Int?
|
|
78
120
|
roles String[]
|
|
121
|
+
minAccountAgeDays Int?
|
|
79
122
|
|
|
80
123
|
guildGiveawayId String @unique
|
|
81
124
|
guildGiveaway GuildGiveaway? @relation(fields: [guildGiveawayId], references: [dbId], onUpdate: Cascade, onDelete: Cascade)
|
|
@@ -32,6 +32,9 @@ model Guild {
|
|
|
32
32
|
|
|
33
33
|
disableDoubleVoteEntry Boolean?
|
|
34
34
|
giveawayLogsChannelId String?
|
|
35
|
+
// Public giveaways page. Written only by /data/guild/:guildId/public-giveaways (updatePublicGiveawaySettings).
|
|
36
|
+
publicGiveaways Boolean @default(true)
|
|
37
|
+
giveawayJoinLinks Boolean @default(false)
|
|
35
38
|
|
|
36
39
|
randomMessages GuildRandomMessage[]
|
|
37
40
|
|