rimelight-components 2.1.37 → 2.1.39
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/module.d.mts +9 -0
- package/dist/module.d.ts +9 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +15 -1
- package/dist/runtime/auth/index.d.ts +3 -0
- package/dist/runtime/auth/index.js +3 -0
- package/dist/runtime/auth/index.mjs +3 -0
- package/dist/runtime/auth/permissions.d.ts +201 -0
- package/dist/runtime/auth/permissions.js +32 -0
- package/dist/runtime/auth/permissions.mjs +32 -0
- package/dist/runtime/auth/restricted-usernames.d.ts +25 -0
- package/dist/runtime/auth/restricted-usernames.js +236 -0
- package/dist/runtime/auth/restricted-usernames.mjs +236 -0
- package/dist/runtime/auth/utils.d.ts +10 -0
- package/dist/runtime/auth/utils.js +20 -0
- package/dist/runtime/auth/utils.mjs +20 -0
- package/dist/runtime/components/FloatingToolsOverlay.d.vue.ts +3 -0
- package/dist/runtime/components/FloatingToolsOverlay.vue +74 -0
- package/dist/runtime/components/FloatingToolsOverlay.vue.d.ts +3 -0
- package/dist/runtime/components/app/Footer.vue +1 -1
- package/dist/runtime/components/app/Header.vue +1 -1
- package/dist/runtime/components/app/Image.vue +1 -1
- package/dist/runtime/components/app/Logo.vue +1 -1
- package/dist/runtime/components/app/NewsletterSignup.vue +1 -1
- package/dist/runtime/components/app/ScrollToTop.vue +1 -1
- package/dist/runtime/components/cards/TeamCard.vue +1 -1
- package/dist/runtime/components/content/Callout.vue +1 -1
- package/dist/runtime/components/content/Section.vue +1 -1
- package/dist/runtime/components/dashboard/NotificationsSlideover.d.vue.ts +3 -0
- package/dist/runtime/components/dashboard/NotificationsSlideover.vue +49 -0
- package/dist/runtime/components/dashboard/NotificationsSlideover.vue.d.ts +3 -0
- package/dist/runtime/components/dashboard/QuickActions.d.vue.ts +3 -0
- package/dist/runtime/components/dashboard/QuickActions.vue +36 -0
- package/dist/runtime/components/dashboard/QuickActions.vue.d.ts +3 -0
- package/dist/runtime/components/dashboard/TeamsMenu.d.vue.ts +6 -0
- package/dist/runtime/components/dashboard/TeamsMenu.vue +77 -0
- package/dist/runtime/components/dashboard/TeamsMenu.vue.d.ts +6 -0
- package/dist/runtime/components/dashboard/customers/AddModal.d.vue.ts +3 -0
- package/dist/runtime/components/dashboard/customers/AddModal.vue +45 -0
- package/dist/runtime/components/dashboard/customers/AddModal.vue.d.ts +3 -0
- package/dist/runtime/components/dashboard/customers/DeleteModal.d.vue.ts +16 -0
- package/dist/runtime/components/dashboard/customers/DeleteModal.vue +28 -0
- package/dist/runtime/components/dashboard/customers/DeleteModal.vue.d.ts +16 -0
- package/dist/runtime/components/dashboard/floating-tools/FocusTimerTool.d.vue.ts +3 -0
- package/dist/runtime/components/dashboard/floating-tools/FocusTimerTool.vue +37 -0
- package/dist/runtime/components/dashboard/floating-tools/FocusTimerTool.vue.d.ts +3 -0
- package/dist/runtime/components/headings/H1.d.vue.ts +13 -0
- package/dist/runtime/components/headings/H1.vue +9 -0
- package/dist/runtime/components/headings/H1.vue.d.ts +13 -0
- package/dist/runtime/components/headings/H2.d.vue.ts +13 -0
- package/dist/runtime/components/headings/H2.vue +9 -0
- package/dist/runtime/components/headings/H2.vue.d.ts +13 -0
- package/dist/runtime/components/headings/H3.d.vue.ts +13 -0
- package/dist/runtime/components/headings/H3.vue +9 -0
- package/dist/runtime/components/headings/H3.vue.d.ts +13 -0
- package/dist/runtime/components/headings/H4.d.vue.ts +13 -0
- package/dist/runtime/components/headings/H4.vue +9 -0
- package/dist/runtime/components/headings/H4.vue.d.ts +13 -0
- package/dist/runtime/components/headings/H5.d.vue.ts +13 -0
- package/dist/runtime/components/headings/H5.vue +9 -0
- package/dist/runtime/components/headings/H5.vue.d.ts +13 -0
- package/dist/runtime/components/headings/H6.d.vue.ts +13 -0
- package/dist/runtime/components/headings/H6.vue +9 -0
- package/dist/runtime/components/headings/H6.vue.d.ts +13 -0
- package/dist/runtime/components/modals/ConfirmModal.d.vue.ts +3 -0
- package/dist/runtime/components/modals/ConfirmModal.vue +36 -0
- package/dist/runtime/components/modals/ConfirmModal.vue.d.ts +3 -0
- package/dist/runtime/components/nodes/LinkNode.vue +1 -1
- package/dist/runtime/components/nodes/TextNode.vue +1 -1
- package/dist/runtime/components/notes/NoteCard.d.vue.ts +31 -0
- package/dist/runtime/components/notes/NoteCard.vue +86 -0
- package/dist/runtime/components/notes/NoteCard.vue.d.ts +31 -0
- package/dist/runtime/components/notes/NoteModal.d.vue.ts +35 -0
- package/dist/runtime/components/notes/NoteModal.vue +224 -0
- package/dist/runtime/components/notes/NoteModal.vue.d.ts +35 -0
- package/dist/runtime/components/page/PageMention.vue +1 -1
- package/dist/runtime/components/page/PageSurround.vue +1 -1
- package/dist/runtime/components/page/PageTOC.vue +1 -1
- package/dist/runtime/components/swatches/ColorSwatch.vue +1 -1
- package/dist/runtime/components/swatches/FontSwatch.vue +1 -1
- package/dist/runtime/components/swatches/ImageSwatch.vue +1 -1
- package/dist/runtime/components/utilities/Placeholder.vue +1 -1
- package/dist/runtime/composables/app/index.d.ts +4 -0
- package/dist/runtime/composables/app/index.js +4 -0
- package/dist/runtime/composables/app/index.mjs +4 -0
- package/dist/runtime/composables/app/useApi.d.ts +9 -0
- package/dist/runtime/composables/app/useApi.js +56 -0
- package/dist/runtime/composables/app/useApi.mjs +56 -0
- package/dist/runtime/composables/app/useConfirm.d.ts +18 -0
- package/dist/runtime/composables/app/useConfirm.js +56 -0
- package/dist/runtime/composables/app/useConfirm.mjs +56 -0
- package/dist/runtime/composables/components/index.d.ts +1 -0
- package/dist/runtime/composables/components/index.js +1 -0
- package/dist/runtime/composables/components/index.mjs +1 -0
- package/dist/runtime/composables/dashboard/index.d.ts +5 -0
- package/dist/runtime/composables/dashboard/index.js +5 -0
- package/dist/runtime/composables/dashboard/index.mjs +5 -0
- package/dist/runtime/composables/dashboard/useDashboard.d.ts +3 -0
- package/dist/runtime/composables/dashboard/useDashboard.js +18 -0
- package/dist/runtime/composables/dashboard/useDashboard.mjs +18 -0
- package/dist/runtime/composables/dashboard/useFloatingTools.d.ts +19 -0
- package/dist/runtime/composables/dashboard/useFloatingTools.js +44 -0
- package/dist/runtime/composables/dashboard/useFloatingTools.mjs +44 -0
- package/dist/runtime/composables/dashboard/useFocusTimer.d.ts +44 -0
- package/dist/runtime/composables/dashboard/useFocusTimer.js +141 -0
- package/dist/runtime/composables/dashboard/useFocusTimer.mjs +141 -0
- package/dist/runtime/composables/dashboard/useNotes.d.ts +9 -0
- package/dist/runtime/composables/dashboard/useNotes.js +57 -0
- package/dist/runtime/composables/dashboard/useNotes.mjs +57 -0
- package/dist/runtime/composables/dashboard/useQuickActions.d.ts +15 -0
- package/dist/runtime/composables/dashboard/useQuickActions.js +19 -0
- package/dist/runtime/composables/dashboard/useQuickActions.mjs +19 -0
- package/dist/runtime/composables/index.d.ts +4 -7
- package/dist/runtime/composables/index.js +4 -7
- package/dist/runtime/composables/index.mjs +4 -7
- package/dist/runtime/composables/pages/index.d.ts +4 -0
- package/dist/runtime/composables/pages/index.js +4 -0
- package/dist/runtime/composables/pages/index.mjs +4 -0
- package/dist/runtime/composables/{useBlockEditor.d.ts → pages/useBlockEditor.d.ts} +131 -131
- package/dist/runtime/composables/{useInfobox.d.ts → pages/useInfobox.d.ts} +1 -1
- package/dist/runtime/composables/{usePageEditor.d.ts → pages/usePageEditor.d.ts} +1 -1
- package/dist/runtime/composables/{usePageRegistry.d.ts → pages/usePageRegistry.d.ts} +2 -2
- package/dist/runtime/db/auth.d.ts +2096 -0
- package/dist/runtime/db/auth.js +268 -0
- package/dist/runtime/db/auth.mjs +268 -0
- package/dist/runtime/db/index.d.ts +1 -0
- package/dist/runtime/db/index.js +1 -0
- package/dist/runtime/db/index.mjs +1 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/index.mjs +1 -0
- package/dist/runtime/types/utils.d.ts +51 -0
- package/dist/runtime/types/utils.js +0 -0
- package/dist/runtime/types/utils.mjs +0 -0
- package/package.json +4 -2
- /package/dist/runtime/composables/{useDateRange.d.ts → app/useDateRange.d.ts} +0 -0
- /package/dist/runtime/composables/{useDateRange.js → app/useDateRange.js} +0 -0
- /package/dist/runtime/composables/{useDateRange.mjs → app/useDateRange.mjs} +0 -0
- /package/dist/runtime/composables/{useHeaderStack.d.ts → app/useHeaderStack.d.ts} +0 -0
- /package/dist/runtime/composables/{useHeaderStack.js → app/useHeaderStack.js} +0 -0
- /package/dist/runtime/composables/{useHeaderStack.mjs → app/useHeaderStack.mjs} +0 -0
- /package/dist/runtime/composables/{useRC.d.ts → components/useRC.d.ts} +0 -0
- /package/dist/runtime/composables/{useRC.js → components/useRC.js} +0 -0
- /package/dist/runtime/composables/{useRC.mjs → components/useRC.mjs} +0 -0
- /package/dist/runtime/composables/{useBlockEditor.js → pages/useBlockEditor.js} +0 -0
- /package/dist/runtime/composables/{useBlockEditor.mjs → pages/useBlockEditor.mjs} +0 -0
- /package/dist/runtime/composables/{useInfobox.js → pages/useInfobox.js} +0 -0
- /package/dist/runtime/composables/{useInfobox.mjs → pages/useInfobox.mjs} +0 -0
- /package/dist/runtime/composables/{usePageEditor.js → pages/usePageEditor.js} +0 -0
- /package/dist/runtime/composables/{usePageEditor.mjs → pages/usePageEditor.mjs} +0 -0
- /package/dist/runtime/composables/{usePageRegistry.js → pages/usePageRegistry.js} +0 -0
- /package/dist/runtime/composables/{usePageRegistry.mjs → pages/usePageRegistry.mjs} +0 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { relations } from "drizzle-orm";
|
|
2
|
+
import {
|
|
3
|
+
bigint,
|
|
4
|
+
boolean,
|
|
5
|
+
index,
|
|
6
|
+
integer,
|
|
7
|
+
pgTable,
|
|
8
|
+
primaryKey,
|
|
9
|
+
text,
|
|
10
|
+
timestamp,
|
|
11
|
+
uniqueIndex,
|
|
12
|
+
uuid
|
|
13
|
+
} from "drizzle-orm/pg-core";
|
|
14
|
+
import { id, timestamps } from "./helpers.js";
|
|
15
|
+
export const user = pgTable(
|
|
16
|
+
"user",
|
|
17
|
+
{
|
|
18
|
+
id: id.primaryKey(),
|
|
19
|
+
name: text("name").notNull(),
|
|
20
|
+
tag: text("tag").notNull().default("0000"),
|
|
21
|
+
email: text("email").notNull().unique(),
|
|
22
|
+
emailVerified: boolean("email_verified").default(false).notNull(),
|
|
23
|
+
image: text("image"),
|
|
24
|
+
firstName: text("first_name").notNull(),
|
|
25
|
+
lastName: text("last_name").notNull(),
|
|
26
|
+
availability: text("availability").$type().notNull().default("available"),
|
|
27
|
+
status: text("status"),
|
|
28
|
+
...timestamps,
|
|
29
|
+
role: text("role"),
|
|
30
|
+
banned: boolean("banned").default(false),
|
|
31
|
+
banReason: text("ban_reason"),
|
|
32
|
+
banExpires: timestamp("ban_expires"),
|
|
33
|
+
publicKey: text("public_key"),
|
|
34
|
+
encryptedPrivateKey: text("encrypted_private_key"),
|
|
35
|
+
derivationSalt: text("derivation_salt")
|
|
36
|
+
},
|
|
37
|
+
(table) => ({
|
|
38
|
+
nameTagUnique: uniqueIndex("user_name_tag_unique").on(table.name, table.tag)
|
|
39
|
+
})
|
|
40
|
+
);
|
|
41
|
+
export const session = pgTable(
|
|
42
|
+
"session",
|
|
43
|
+
{
|
|
44
|
+
id: id.primaryKey(),
|
|
45
|
+
expiresAt: timestamp("expires_at").notNull(),
|
|
46
|
+
token: text("token").notNull().unique(),
|
|
47
|
+
...timestamps,
|
|
48
|
+
ipAddress: text("ip_address"),
|
|
49
|
+
userAgent: text("user_agent"),
|
|
50
|
+
userId: uuid("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
51
|
+
impersonatedBy: text("impersonated_by"),
|
|
52
|
+
activeOrganizationId: uuid("active_organization_id"),
|
|
53
|
+
activeTeamId: uuid("active_team_id")
|
|
54
|
+
},
|
|
55
|
+
(table) => [index("session_userId_idx").on(table.userId)]
|
|
56
|
+
);
|
|
57
|
+
export const account = pgTable(
|
|
58
|
+
"account",
|
|
59
|
+
{
|
|
60
|
+
id: id.primaryKey(),
|
|
61
|
+
accountId: text("account_id").notNull(),
|
|
62
|
+
providerId: text("provider_id").notNull(),
|
|
63
|
+
userId: uuid("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
64
|
+
accessToken: text("access_token"),
|
|
65
|
+
refreshToken: text("refresh_token"),
|
|
66
|
+
idToken: text("id_token"),
|
|
67
|
+
accessTokenExpiresAt: timestamp("access_token_expires_at"),
|
|
68
|
+
refreshTokenExpiresAt: timestamp("refresh_token_expires_at"),
|
|
69
|
+
scope: text("scope"),
|
|
70
|
+
password: text("password"),
|
|
71
|
+
...timestamps
|
|
72
|
+
},
|
|
73
|
+
(table) => [index("account_userId_idx").on(table.userId)]
|
|
74
|
+
);
|
|
75
|
+
export const verification = pgTable(
|
|
76
|
+
"verification",
|
|
77
|
+
{
|
|
78
|
+
id: id.primaryKey(),
|
|
79
|
+
identifier: text("identifier").notNull(),
|
|
80
|
+
value: text("value").notNull(),
|
|
81
|
+
expiresAt: timestamp("expires_at").notNull(),
|
|
82
|
+
...timestamps
|
|
83
|
+
},
|
|
84
|
+
(table) => [index("verification_identifier_idx").on(table.identifier)]
|
|
85
|
+
);
|
|
86
|
+
export const rateLimit = pgTable("rate_limit", {
|
|
87
|
+
id: id.primaryKey(),
|
|
88
|
+
key: text("key"),
|
|
89
|
+
count: integer("count"),
|
|
90
|
+
lastRequest: bigint("last_request", { mode: "number" })
|
|
91
|
+
});
|
|
92
|
+
export const organization = pgTable("organization", {
|
|
93
|
+
id: id.primaryKey(),
|
|
94
|
+
name: text("name").notNull(),
|
|
95
|
+
slug: text("slug").notNull().unique(),
|
|
96
|
+
logo: text("logo"),
|
|
97
|
+
...timestamps,
|
|
98
|
+
metadata: text("metadata")
|
|
99
|
+
});
|
|
100
|
+
export const member = pgTable(
|
|
101
|
+
"member",
|
|
102
|
+
{
|
|
103
|
+
id: id.primaryKey(),
|
|
104
|
+
organizationId: uuid("organization_id").notNull().references(() => organization.id, { onDelete: "cascade" }),
|
|
105
|
+
userId: uuid("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
106
|
+
role: text("role").default("member").notNull(),
|
|
107
|
+
...timestamps
|
|
108
|
+
},
|
|
109
|
+
(table) => [
|
|
110
|
+
index("member_organizationId_idx").on(table.organizationId),
|
|
111
|
+
index("member_userId_idx").on(table.userId)
|
|
112
|
+
]
|
|
113
|
+
);
|
|
114
|
+
export const invitation = pgTable(
|
|
115
|
+
"invitation",
|
|
116
|
+
{
|
|
117
|
+
id: id.primaryKey(),
|
|
118
|
+
organizationId: uuid("organization_id").notNull().references(() => organization.id, { onDelete: "cascade" }),
|
|
119
|
+
email: text("email").notNull(),
|
|
120
|
+
role: text("role"),
|
|
121
|
+
status: text("status").default("pending").notNull(),
|
|
122
|
+
expiresAt: timestamp("expires_at").notNull(),
|
|
123
|
+
...timestamps,
|
|
124
|
+
inviterId: uuid("inviter_id").notNull().references(() => user.id, { onDelete: "cascade" })
|
|
125
|
+
},
|
|
126
|
+
(table) => [
|
|
127
|
+
index("invitation_organizationId_idx").on(table.organizationId),
|
|
128
|
+
index("invitation_email_idx").on(table.email)
|
|
129
|
+
]
|
|
130
|
+
);
|
|
131
|
+
export const team = pgTable(
|
|
132
|
+
"team",
|
|
133
|
+
{
|
|
134
|
+
id: id.primaryKey(),
|
|
135
|
+
name: text("name").notNull(),
|
|
136
|
+
organizationId: uuid("organization_id").notNull().references(() => organization.id, { onDelete: "cascade" }),
|
|
137
|
+
parentId: uuid("parent_id").references(() => team.id, {
|
|
138
|
+
onDelete: "cascade"
|
|
139
|
+
}),
|
|
140
|
+
...timestamps,
|
|
141
|
+
metadata: text("metadata")
|
|
142
|
+
},
|
|
143
|
+
(table) => [index("team_organizationId_idx").on(table.organizationId)]
|
|
144
|
+
);
|
|
145
|
+
export const teamMember = pgTable("team_member", {
|
|
146
|
+
id: id.primaryKey(),
|
|
147
|
+
teamId: uuid("team_id").notNull(),
|
|
148
|
+
userId: uuid("user_id").notNull(),
|
|
149
|
+
role: text("role").notNull(),
|
|
150
|
+
...timestamps
|
|
151
|
+
});
|
|
152
|
+
export const note = pgTable("note", {
|
|
153
|
+
id: id.primaryKey(),
|
|
154
|
+
userId: uuid("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
155
|
+
title: text("title"),
|
|
156
|
+
content: text("content"),
|
|
157
|
+
isPinned: boolean("is_pinned").default(false).notNull(),
|
|
158
|
+
isArchived: boolean("is_archived").default(false).notNull(),
|
|
159
|
+
...timestamps
|
|
160
|
+
});
|
|
161
|
+
export const noteLabel = pgTable("noteLabel", {
|
|
162
|
+
id: id.primaryKey(),
|
|
163
|
+
userId: uuid("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
164
|
+
name: text("name").notNull(),
|
|
165
|
+
...timestamps
|
|
166
|
+
});
|
|
167
|
+
export const note_noteLabel = pgTable(
|
|
168
|
+
"note_noteLabel",
|
|
169
|
+
{
|
|
170
|
+
noteId: uuid("note_id").notNull().references(() => note.id, { onDelete: "cascade" }),
|
|
171
|
+
labelId: uuid("label_id").notNull().references(() => noteLabel.id, { onDelete: "cascade" })
|
|
172
|
+
},
|
|
173
|
+
(t) => ({
|
|
174
|
+
pk: primaryKey({ columns: [t.noteId, t.labelId] })
|
|
175
|
+
})
|
|
176
|
+
);
|
|
177
|
+
export const userRelations = relations(user, ({ many }) => ({
|
|
178
|
+
sessions: many(session),
|
|
179
|
+
accounts: many(account),
|
|
180
|
+
members: many(member),
|
|
181
|
+
invitations: many(invitation),
|
|
182
|
+
notes: many(note),
|
|
183
|
+
noteLabels: many(noteLabel)
|
|
184
|
+
}));
|
|
185
|
+
export const sessionRelations = relations(session, ({ one }) => ({
|
|
186
|
+
user: one(user, {
|
|
187
|
+
fields: [session.userId],
|
|
188
|
+
references: [user.id]
|
|
189
|
+
})
|
|
190
|
+
}));
|
|
191
|
+
export const accountRelations = relations(account, ({ one }) => ({
|
|
192
|
+
user: one(user, {
|
|
193
|
+
fields: [account.userId],
|
|
194
|
+
references: [user.id]
|
|
195
|
+
})
|
|
196
|
+
}));
|
|
197
|
+
export const organizationRelations = relations(organization, ({ many }) => ({
|
|
198
|
+
members: many(member),
|
|
199
|
+
invitations: many(invitation),
|
|
200
|
+
teams: many(team)
|
|
201
|
+
}));
|
|
202
|
+
export const memberRelations = relations(member, ({ one }) => ({
|
|
203
|
+
organization: one(organization, {
|
|
204
|
+
fields: [member.organizationId],
|
|
205
|
+
references: [organization.id]
|
|
206
|
+
}),
|
|
207
|
+
user: one(user, {
|
|
208
|
+
fields: [member.userId],
|
|
209
|
+
references: [user.id]
|
|
210
|
+
})
|
|
211
|
+
}));
|
|
212
|
+
export const invitationRelations = relations(invitation, ({ one }) => ({
|
|
213
|
+
organization: one(organization, {
|
|
214
|
+
fields: [invitation.organizationId],
|
|
215
|
+
references: [organization.id]
|
|
216
|
+
}),
|
|
217
|
+
user: one(user, {
|
|
218
|
+
fields: [invitation.inviterId],
|
|
219
|
+
references: [user.id]
|
|
220
|
+
})
|
|
221
|
+
}));
|
|
222
|
+
export const teamRelations = relations(team, ({ one, many }) => ({
|
|
223
|
+
organization: one(organization, {
|
|
224
|
+
fields: [team.organizationId],
|
|
225
|
+
references: [organization.id]
|
|
226
|
+
}),
|
|
227
|
+
parentTeam: one(team, {
|
|
228
|
+
fields: [team.parentId],
|
|
229
|
+
references: [team.id],
|
|
230
|
+
relationName: "subteams"
|
|
231
|
+
}),
|
|
232
|
+
subteams: many(team, { relationName: "subteams" }),
|
|
233
|
+
members: many(teamMember)
|
|
234
|
+
}));
|
|
235
|
+
export const teamMemberRelations = relations(teamMember, ({ one }) => ({
|
|
236
|
+
team: one(team, {
|
|
237
|
+
fields: [teamMember.teamId],
|
|
238
|
+
references: [team.id]
|
|
239
|
+
}),
|
|
240
|
+
user: one(user, {
|
|
241
|
+
fields: [teamMember.userId],
|
|
242
|
+
references: [user.id]
|
|
243
|
+
})
|
|
244
|
+
}));
|
|
245
|
+
export const noteRelations = relations(note, ({ one, many }) => ({
|
|
246
|
+
user: one(user, {
|
|
247
|
+
fields: [note.userId],
|
|
248
|
+
references: [user.id]
|
|
249
|
+
}),
|
|
250
|
+
noteLabels: many(note_noteLabel)
|
|
251
|
+
}));
|
|
252
|
+
export const noteLabelRelations = relations(noteLabel, ({ one, many }) => ({
|
|
253
|
+
user: one(user, {
|
|
254
|
+
fields: [noteLabel.userId],
|
|
255
|
+
references: [user.id]
|
|
256
|
+
}),
|
|
257
|
+
noteLabels: many(note_noteLabel)
|
|
258
|
+
}));
|
|
259
|
+
export const note_noteLabelRelations = relations(note_noteLabel, ({ one }) => ({
|
|
260
|
+
note: one(note, {
|
|
261
|
+
fields: [note_noteLabel.noteId],
|
|
262
|
+
references: [note.id]
|
|
263
|
+
}),
|
|
264
|
+
label: one(noteLabel, {
|
|
265
|
+
fields: [note_noteLabel.labelId],
|
|
266
|
+
references: [noteLabel.id]
|
|
267
|
+
})
|
|
268
|
+
}));
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { relations } from "drizzle-orm";
|
|
2
|
+
import {
|
|
3
|
+
bigint,
|
|
4
|
+
boolean,
|
|
5
|
+
index,
|
|
6
|
+
integer,
|
|
7
|
+
pgTable,
|
|
8
|
+
primaryKey,
|
|
9
|
+
text,
|
|
10
|
+
timestamp,
|
|
11
|
+
uniqueIndex,
|
|
12
|
+
uuid
|
|
13
|
+
} from "drizzle-orm/pg-core";
|
|
14
|
+
import { id, timestamps } from "./helpers.mjs";
|
|
15
|
+
export const user = pgTable(
|
|
16
|
+
"user",
|
|
17
|
+
{
|
|
18
|
+
id: id.primaryKey(),
|
|
19
|
+
name: text("name").notNull(),
|
|
20
|
+
tag: text("tag").notNull().default("0000"),
|
|
21
|
+
email: text("email").notNull().unique(),
|
|
22
|
+
emailVerified: boolean("email_verified").default(false).notNull(),
|
|
23
|
+
image: text("image"),
|
|
24
|
+
firstName: text("first_name").notNull(),
|
|
25
|
+
lastName: text("last_name").notNull(),
|
|
26
|
+
availability: text("availability").$type().notNull().default("available"),
|
|
27
|
+
status: text("status"),
|
|
28
|
+
...timestamps,
|
|
29
|
+
role: text("role"),
|
|
30
|
+
banned: boolean("banned").default(false),
|
|
31
|
+
banReason: text("ban_reason"),
|
|
32
|
+
banExpires: timestamp("ban_expires"),
|
|
33
|
+
publicKey: text("public_key"),
|
|
34
|
+
encryptedPrivateKey: text("encrypted_private_key"),
|
|
35
|
+
derivationSalt: text("derivation_salt")
|
|
36
|
+
},
|
|
37
|
+
(table) => ({
|
|
38
|
+
nameTagUnique: uniqueIndex("user_name_tag_unique").on(table.name, table.tag)
|
|
39
|
+
})
|
|
40
|
+
);
|
|
41
|
+
export const session = pgTable(
|
|
42
|
+
"session",
|
|
43
|
+
{
|
|
44
|
+
id: id.primaryKey(),
|
|
45
|
+
expiresAt: timestamp("expires_at").notNull(),
|
|
46
|
+
token: text("token").notNull().unique(),
|
|
47
|
+
...timestamps,
|
|
48
|
+
ipAddress: text("ip_address"),
|
|
49
|
+
userAgent: text("user_agent"),
|
|
50
|
+
userId: uuid("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
51
|
+
impersonatedBy: text("impersonated_by"),
|
|
52
|
+
activeOrganizationId: uuid("active_organization_id"),
|
|
53
|
+
activeTeamId: uuid("active_team_id")
|
|
54
|
+
},
|
|
55
|
+
(table) => [index("session_userId_idx").on(table.userId)]
|
|
56
|
+
);
|
|
57
|
+
export const account = pgTable(
|
|
58
|
+
"account",
|
|
59
|
+
{
|
|
60
|
+
id: id.primaryKey(),
|
|
61
|
+
accountId: text("account_id").notNull(),
|
|
62
|
+
providerId: text("provider_id").notNull(),
|
|
63
|
+
userId: uuid("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
64
|
+
accessToken: text("access_token"),
|
|
65
|
+
refreshToken: text("refresh_token"),
|
|
66
|
+
idToken: text("id_token"),
|
|
67
|
+
accessTokenExpiresAt: timestamp("access_token_expires_at"),
|
|
68
|
+
refreshTokenExpiresAt: timestamp("refresh_token_expires_at"),
|
|
69
|
+
scope: text("scope"),
|
|
70
|
+
password: text("password"),
|
|
71
|
+
...timestamps
|
|
72
|
+
},
|
|
73
|
+
(table) => [index("account_userId_idx").on(table.userId)]
|
|
74
|
+
);
|
|
75
|
+
export const verification = pgTable(
|
|
76
|
+
"verification",
|
|
77
|
+
{
|
|
78
|
+
id: id.primaryKey(),
|
|
79
|
+
identifier: text("identifier").notNull(),
|
|
80
|
+
value: text("value").notNull(),
|
|
81
|
+
expiresAt: timestamp("expires_at").notNull(),
|
|
82
|
+
...timestamps
|
|
83
|
+
},
|
|
84
|
+
(table) => [index("verification_identifier_idx").on(table.identifier)]
|
|
85
|
+
);
|
|
86
|
+
export const rateLimit = pgTable("rate_limit", {
|
|
87
|
+
id: id.primaryKey(),
|
|
88
|
+
key: text("key"),
|
|
89
|
+
count: integer("count"),
|
|
90
|
+
lastRequest: bigint("last_request", { mode: "number" })
|
|
91
|
+
});
|
|
92
|
+
export const organization = pgTable("organization", {
|
|
93
|
+
id: id.primaryKey(),
|
|
94
|
+
name: text("name").notNull(),
|
|
95
|
+
slug: text("slug").notNull().unique(),
|
|
96
|
+
logo: text("logo"),
|
|
97
|
+
...timestamps,
|
|
98
|
+
metadata: text("metadata")
|
|
99
|
+
});
|
|
100
|
+
export const member = pgTable(
|
|
101
|
+
"member",
|
|
102
|
+
{
|
|
103
|
+
id: id.primaryKey(),
|
|
104
|
+
organizationId: uuid("organization_id").notNull().references(() => organization.id, { onDelete: "cascade" }),
|
|
105
|
+
userId: uuid("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
106
|
+
role: text("role").default("member").notNull(),
|
|
107
|
+
...timestamps
|
|
108
|
+
},
|
|
109
|
+
(table) => [
|
|
110
|
+
index("member_organizationId_idx").on(table.organizationId),
|
|
111
|
+
index("member_userId_idx").on(table.userId)
|
|
112
|
+
]
|
|
113
|
+
);
|
|
114
|
+
export const invitation = pgTable(
|
|
115
|
+
"invitation",
|
|
116
|
+
{
|
|
117
|
+
id: id.primaryKey(),
|
|
118
|
+
organizationId: uuid("organization_id").notNull().references(() => organization.id, { onDelete: "cascade" }),
|
|
119
|
+
email: text("email").notNull(),
|
|
120
|
+
role: text("role"),
|
|
121
|
+
status: text("status").default("pending").notNull(),
|
|
122
|
+
expiresAt: timestamp("expires_at").notNull(),
|
|
123
|
+
...timestamps,
|
|
124
|
+
inviterId: uuid("inviter_id").notNull().references(() => user.id, { onDelete: "cascade" })
|
|
125
|
+
},
|
|
126
|
+
(table) => [
|
|
127
|
+
index("invitation_organizationId_idx").on(table.organizationId),
|
|
128
|
+
index("invitation_email_idx").on(table.email)
|
|
129
|
+
]
|
|
130
|
+
);
|
|
131
|
+
export const team = pgTable(
|
|
132
|
+
"team",
|
|
133
|
+
{
|
|
134
|
+
id: id.primaryKey(),
|
|
135
|
+
name: text("name").notNull(),
|
|
136
|
+
organizationId: uuid("organization_id").notNull().references(() => organization.id, { onDelete: "cascade" }),
|
|
137
|
+
parentId: uuid("parent_id").references(() => team.id, {
|
|
138
|
+
onDelete: "cascade"
|
|
139
|
+
}),
|
|
140
|
+
...timestamps,
|
|
141
|
+
metadata: text("metadata")
|
|
142
|
+
},
|
|
143
|
+
(table) => [index("team_organizationId_idx").on(table.organizationId)]
|
|
144
|
+
);
|
|
145
|
+
export const teamMember = pgTable("team_member", {
|
|
146
|
+
id: id.primaryKey(),
|
|
147
|
+
teamId: uuid("team_id").notNull(),
|
|
148
|
+
userId: uuid("user_id").notNull(),
|
|
149
|
+
role: text("role").notNull(),
|
|
150
|
+
...timestamps
|
|
151
|
+
});
|
|
152
|
+
export const note = pgTable("note", {
|
|
153
|
+
id: id.primaryKey(),
|
|
154
|
+
userId: uuid("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
155
|
+
title: text("title"),
|
|
156
|
+
content: text("content"),
|
|
157
|
+
isPinned: boolean("is_pinned").default(false).notNull(),
|
|
158
|
+
isArchived: boolean("is_archived").default(false).notNull(),
|
|
159
|
+
...timestamps
|
|
160
|
+
});
|
|
161
|
+
export const noteLabel = pgTable("noteLabel", {
|
|
162
|
+
id: id.primaryKey(),
|
|
163
|
+
userId: uuid("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
164
|
+
name: text("name").notNull(),
|
|
165
|
+
...timestamps
|
|
166
|
+
});
|
|
167
|
+
export const note_noteLabel = pgTable(
|
|
168
|
+
"note_noteLabel",
|
|
169
|
+
{
|
|
170
|
+
noteId: uuid("note_id").notNull().references(() => note.id, { onDelete: "cascade" }),
|
|
171
|
+
labelId: uuid("label_id").notNull().references(() => noteLabel.id, { onDelete: "cascade" })
|
|
172
|
+
},
|
|
173
|
+
(t) => ({
|
|
174
|
+
pk: primaryKey({ columns: [t.noteId, t.labelId] })
|
|
175
|
+
})
|
|
176
|
+
);
|
|
177
|
+
export const userRelations = relations(user, ({ many }) => ({
|
|
178
|
+
sessions: many(session),
|
|
179
|
+
accounts: many(account),
|
|
180
|
+
members: many(member),
|
|
181
|
+
invitations: many(invitation),
|
|
182
|
+
notes: many(note),
|
|
183
|
+
noteLabels: many(noteLabel)
|
|
184
|
+
}));
|
|
185
|
+
export const sessionRelations = relations(session, ({ one }) => ({
|
|
186
|
+
user: one(user, {
|
|
187
|
+
fields: [session.userId],
|
|
188
|
+
references: [user.id]
|
|
189
|
+
})
|
|
190
|
+
}));
|
|
191
|
+
export const accountRelations = relations(account, ({ one }) => ({
|
|
192
|
+
user: one(user, {
|
|
193
|
+
fields: [account.userId],
|
|
194
|
+
references: [user.id]
|
|
195
|
+
})
|
|
196
|
+
}));
|
|
197
|
+
export const organizationRelations = relations(organization, ({ many }) => ({
|
|
198
|
+
members: many(member),
|
|
199
|
+
invitations: many(invitation),
|
|
200
|
+
teams: many(team)
|
|
201
|
+
}));
|
|
202
|
+
export const memberRelations = relations(member, ({ one }) => ({
|
|
203
|
+
organization: one(organization, {
|
|
204
|
+
fields: [member.organizationId],
|
|
205
|
+
references: [organization.id]
|
|
206
|
+
}),
|
|
207
|
+
user: one(user, {
|
|
208
|
+
fields: [member.userId],
|
|
209
|
+
references: [user.id]
|
|
210
|
+
})
|
|
211
|
+
}));
|
|
212
|
+
export const invitationRelations = relations(invitation, ({ one }) => ({
|
|
213
|
+
organization: one(organization, {
|
|
214
|
+
fields: [invitation.organizationId],
|
|
215
|
+
references: [organization.id]
|
|
216
|
+
}),
|
|
217
|
+
user: one(user, {
|
|
218
|
+
fields: [invitation.inviterId],
|
|
219
|
+
references: [user.id]
|
|
220
|
+
})
|
|
221
|
+
}));
|
|
222
|
+
export const teamRelations = relations(team, ({ one, many }) => ({
|
|
223
|
+
organization: one(organization, {
|
|
224
|
+
fields: [team.organizationId],
|
|
225
|
+
references: [organization.id]
|
|
226
|
+
}),
|
|
227
|
+
parentTeam: one(team, {
|
|
228
|
+
fields: [team.parentId],
|
|
229
|
+
references: [team.id],
|
|
230
|
+
relationName: "subteams"
|
|
231
|
+
}),
|
|
232
|
+
subteams: many(team, { relationName: "subteams" }),
|
|
233
|
+
members: many(teamMember)
|
|
234
|
+
}));
|
|
235
|
+
export const teamMemberRelations = relations(teamMember, ({ one }) => ({
|
|
236
|
+
team: one(team, {
|
|
237
|
+
fields: [teamMember.teamId],
|
|
238
|
+
references: [team.id]
|
|
239
|
+
}),
|
|
240
|
+
user: one(user, {
|
|
241
|
+
fields: [teamMember.userId],
|
|
242
|
+
references: [user.id]
|
|
243
|
+
})
|
|
244
|
+
}));
|
|
245
|
+
export const noteRelations = relations(note, ({ one, many }) => ({
|
|
246
|
+
user: one(user, {
|
|
247
|
+
fields: [note.userId],
|
|
248
|
+
references: [user.id]
|
|
249
|
+
}),
|
|
250
|
+
noteLabels: many(note_noteLabel)
|
|
251
|
+
}));
|
|
252
|
+
export const noteLabelRelations = relations(noteLabel, ({ one, many }) => ({
|
|
253
|
+
user: one(user, {
|
|
254
|
+
fields: [noteLabel.userId],
|
|
255
|
+
references: [user.id]
|
|
256
|
+
}),
|
|
257
|
+
noteLabels: many(note_noteLabel)
|
|
258
|
+
}));
|
|
259
|
+
export const note_noteLabelRelations = relations(note_noteLabel, ({ one }) => ({
|
|
260
|
+
note: one(note, {
|
|
261
|
+
fields: [note_noteLabel.noteId],
|
|
262
|
+
references: [note.id]
|
|
263
|
+
}),
|
|
264
|
+
label: one(noteLabel, {
|
|
265
|
+
fields: [note_noteLabel.labelId],
|
|
266
|
+
references: [noteLabel.id]
|
|
267
|
+
})
|
|
268
|
+
}));
|
package/dist/runtime/db/index.js
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { AvatarProps } from "@nuxt/ui";
|
|
2
|
+
export type UserStatus = "subscribed" | "unsubscribed" | "bounced";
|
|
3
|
+
export type SaleStatus = "paid" | "failed" | "refunded";
|
|
4
|
+
export interface User {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
email: string;
|
|
8
|
+
avatar?: AvatarProps;
|
|
9
|
+
status: UserStatus;
|
|
10
|
+
location: string;
|
|
11
|
+
}
|
|
12
|
+
export interface Mail {
|
|
13
|
+
id: number;
|
|
14
|
+
unread?: boolean;
|
|
15
|
+
from: User;
|
|
16
|
+
subject: string;
|
|
17
|
+
body: string;
|
|
18
|
+
date: string;
|
|
19
|
+
}
|
|
20
|
+
export interface Member {
|
|
21
|
+
name: string;
|
|
22
|
+
username: string;
|
|
23
|
+
role: "member" | "owner";
|
|
24
|
+
avatar: AvatarProps;
|
|
25
|
+
}
|
|
26
|
+
export interface Stat {
|
|
27
|
+
title: string;
|
|
28
|
+
icon: string;
|
|
29
|
+
value: number | string;
|
|
30
|
+
variation: number;
|
|
31
|
+
formatter?: (value: number) => string;
|
|
32
|
+
}
|
|
33
|
+
export interface Sale {
|
|
34
|
+
id: string;
|
|
35
|
+
date: string;
|
|
36
|
+
status: SaleStatus;
|
|
37
|
+
email: string;
|
|
38
|
+
amount: number;
|
|
39
|
+
}
|
|
40
|
+
export interface Notification {
|
|
41
|
+
id: number;
|
|
42
|
+
unread?: boolean;
|
|
43
|
+
sender: User;
|
|
44
|
+
body: string;
|
|
45
|
+
date: string;
|
|
46
|
+
}
|
|
47
|
+
export type Period = "daily" | "weekly" | "monthly";
|
|
48
|
+
export interface Range {
|
|
49
|
+
start: Date;
|
|
50
|
+
end: Date;
|
|
51
|
+
}
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rimelight-components",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.39",
|
|
4
4
|
"description": "A component library by Rimelight Entertainment.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nuxt",
|
|
@@ -69,10 +69,11 @@
|
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"@nuxt/kit": "^4.3.0",
|
|
72
|
+
"@tauri-apps/plugin-http": "^2.5.6",
|
|
72
73
|
"@vueuse/core": "^14.1.0",
|
|
74
|
+
"better-auth": "^1.4.18",
|
|
73
75
|
"date-fns": "^4.1.0",
|
|
74
76
|
"defu": "^6.1.4",
|
|
75
|
-
"drizzle-orm": "^0.45.1",
|
|
76
77
|
"tailwind-variants": "^3.2.2",
|
|
77
78
|
"uuid": "^13.0.0",
|
|
78
79
|
"vue": "^3.5.27",
|
|
@@ -90,6 +91,7 @@
|
|
|
90
91
|
"@types/node": "latest",
|
|
91
92
|
"@vueuse/nuxt": "^14.1.0",
|
|
92
93
|
"changelogen": "^0.6.2",
|
|
94
|
+
"drizzle-orm": "^0.45.1",
|
|
93
95
|
"nuxt": "^4.3.0",
|
|
94
96
|
"oxfmt": "^0.18.0",
|
|
95
97
|
"oxlint": "^1.41.0",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|