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.
Files changed (152) hide show
  1. package/dist/module.d.mts +9 -0
  2. package/dist/module.d.ts +9 -0
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +15 -1
  5. package/dist/runtime/auth/index.d.ts +3 -0
  6. package/dist/runtime/auth/index.js +3 -0
  7. package/dist/runtime/auth/index.mjs +3 -0
  8. package/dist/runtime/auth/permissions.d.ts +201 -0
  9. package/dist/runtime/auth/permissions.js +32 -0
  10. package/dist/runtime/auth/permissions.mjs +32 -0
  11. package/dist/runtime/auth/restricted-usernames.d.ts +25 -0
  12. package/dist/runtime/auth/restricted-usernames.js +236 -0
  13. package/dist/runtime/auth/restricted-usernames.mjs +236 -0
  14. package/dist/runtime/auth/utils.d.ts +10 -0
  15. package/dist/runtime/auth/utils.js +20 -0
  16. package/dist/runtime/auth/utils.mjs +20 -0
  17. package/dist/runtime/components/FloatingToolsOverlay.d.vue.ts +3 -0
  18. package/dist/runtime/components/FloatingToolsOverlay.vue +74 -0
  19. package/dist/runtime/components/FloatingToolsOverlay.vue.d.ts +3 -0
  20. package/dist/runtime/components/app/Footer.vue +1 -1
  21. package/dist/runtime/components/app/Header.vue +1 -1
  22. package/dist/runtime/components/app/Image.vue +1 -1
  23. package/dist/runtime/components/app/Logo.vue +1 -1
  24. package/dist/runtime/components/app/NewsletterSignup.vue +1 -1
  25. package/dist/runtime/components/app/ScrollToTop.vue +1 -1
  26. package/dist/runtime/components/cards/TeamCard.vue +1 -1
  27. package/dist/runtime/components/content/Callout.vue +1 -1
  28. package/dist/runtime/components/content/Section.vue +1 -1
  29. package/dist/runtime/components/dashboard/NotificationsSlideover.d.vue.ts +3 -0
  30. package/dist/runtime/components/dashboard/NotificationsSlideover.vue +49 -0
  31. package/dist/runtime/components/dashboard/NotificationsSlideover.vue.d.ts +3 -0
  32. package/dist/runtime/components/dashboard/QuickActions.d.vue.ts +3 -0
  33. package/dist/runtime/components/dashboard/QuickActions.vue +36 -0
  34. package/dist/runtime/components/dashboard/QuickActions.vue.d.ts +3 -0
  35. package/dist/runtime/components/dashboard/TeamsMenu.d.vue.ts +6 -0
  36. package/dist/runtime/components/dashboard/TeamsMenu.vue +77 -0
  37. package/dist/runtime/components/dashboard/TeamsMenu.vue.d.ts +6 -0
  38. package/dist/runtime/components/dashboard/customers/AddModal.d.vue.ts +3 -0
  39. package/dist/runtime/components/dashboard/customers/AddModal.vue +45 -0
  40. package/dist/runtime/components/dashboard/customers/AddModal.vue.d.ts +3 -0
  41. package/dist/runtime/components/dashboard/customers/DeleteModal.d.vue.ts +16 -0
  42. package/dist/runtime/components/dashboard/customers/DeleteModal.vue +28 -0
  43. package/dist/runtime/components/dashboard/customers/DeleteModal.vue.d.ts +16 -0
  44. package/dist/runtime/components/dashboard/floating-tools/FocusTimerTool.d.vue.ts +3 -0
  45. package/dist/runtime/components/dashboard/floating-tools/FocusTimerTool.vue +37 -0
  46. package/dist/runtime/components/dashboard/floating-tools/FocusTimerTool.vue.d.ts +3 -0
  47. package/dist/runtime/components/headings/H1.d.vue.ts +13 -0
  48. package/dist/runtime/components/headings/H1.vue +9 -0
  49. package/dist/runtime/components/headings/H1.vue.d.ts +13 -0
  50. package/dist/runtime/components/headings/H2.d.vue.ts +13 -0
  51. package/dist/runtime/components/headings/H2.vue +9 -0
  52. package/dist/runtime/components/headings/H2.vue.d.ts +13 -0
  53. package/dist/runtime/components/headings/H3.d.vue.ts +13 -0
  54. package/dist/runtime/components/headings/H3.vue +9 -0
  55. package/dist/runtime/components/headings/H3.vue.d.ts +13 -0
  56. package/dist/runtime/components/headings/H4.d.vue.ts +13 -0
  57. package/dist/runtime/components/headings/H4.vue +9 -0
  58. package/dist/runtime/components/headings/H4.vue.d.ts +13 -0
  59. package/dist/runtime/components/headings/H5.d.vue.ts +13 -0
  60. package/dist/runtime/components/headings/H5.vue +9 -0
  61. package/dist/runtime/components/headings/H5.vue.d.ts +13 -0
  62. package/dist/runtime/components/headings/H6.d.vue.ts +13 -0
  63. package/dist/runtime/components/headings/H6.vue +9 -0
  64. package/dist/runtime/components/headings/H6.vue.d.ts +13 -0
  65. package/dist/runtime/components/modals/ConfirmModal.d.vue.ts +3 -0
  66. package/dist/runtime/components/modals/ConfirmModal.vue +36 -0
  67. package/dist/runtime/components/modals/ConfirmModal.vue.d.ts +3 -0
  68. package/dist/runtime/components/nodes/LinkNode.vue +1 -1
  69. package/dist/runtime/components/nodes/TextNode.vue +1 -1
  70. package/dist/runtime/components/notes/NoteCard.d.vue.ts +31 -0
  71. package/dist/runtime/components/notes/NoteCard.vue +86 -0
  72. package/dist/runtime/components/notes/NoteCard.vue.d.ts +31 -0
  73. package/dist/runtime/components/notes/NoteModal.d.vue.ts +35 -0
  74. package/dist/runtime/components/notes/NoteModal.vue +224 -0
  75. package/dist/runtime/components/notes/NoteModal.vue.d.ts +35 -0
  76. package/dist/runtime/components/page/PageMention.vue +1 -1
  77. package/dist/runtime/components/page/PageSurround.vue +1 -1
  78. package/dist/runtime/components/page/PageTOC.vue +1 -1
  79. package/dist/runtime/components/swatches/ColorSwatch.vue +1 -1
  80. package/dist/runtime/components/swatches/FontSwatch.vue +1 -1
  81. package/dist/runtime/components/swatches/ImageSwatch.vue +1 -1
  82. package/dist/runtime/components/utilities/Placeholder.vue +1 -1
  83. package/dist/runtime/composables/app/index.d.ts +4 -0
  84. package/dist/runtime/composables/app/index.js +4 -0
  85. package/dist/runtime/composables/app/index.mjs +4 -0
  86. package/dist/runtime/composables/app/useApi.d.ts +9 -0
  87. package/dist/runtime/composables/app/useApi.js +56 -0
  88. package/dist/runtime/composables/app/useApi.mjs +56 -0
  89. package/dist/runtime/composables/app/useConfirm.d.ts +18 -0
  90. package/dist/runtime/composables/app/useConfirm.js +56 -0
  91. package/dist/runtime/composables/app/useConfirm.mjs +56 -0
  92. package/dist/runtime/composables/components/index.d.ts +1 -0
  93. package/dist/runtime/composables/components/index.js +1 -0
  94. package/dist/runtime/composables/components/index.mjs +1 -0
  95. package/dist/runtime/composables/dashboard/index.d.ts +5 -0
  96. package/dist/runtime/composables/dashboard/index.js +5 -0
  97. package/dist/runtime/composables/dashboard/index.mjs +5 -0
  98. package/dist/runtime/composables/dashboard/useDashboard.d.ts +3 -0
  99. package/dist/runtime/composables/dashboard/useDashboard.js +18 -0
  100. package/dist/runtime/composables/dashboard/useDashboard.mjs +18 -0
  101. package/dist/runtime/composables/dashboard/useFloatingTools.d.ts +19 -0
  102. package/dist/runtime/composables/dashboard/useFloatingTools.js +44 -0
  103. package/dist/runtime/composables/dashboard/useFloatingTools.mjs +44 -0
  104. package/dist/runtime/composables/dashboard/useFocusTimer.d.ts +44 -0
  105. package/dist/runtime/composables/dashboard/useFocusTimer.js +141 -0
  106. package/dist/runtime/composables/dashboard/useFocusTimer.mjs +141 -0
  107. package/dist/runtime/composables/dashboard/useNotes.d.ts +9 -0
  108. package/dist/runtime/composables/dashboard/useNotes.js +57 -0
  109. package/dist/runtime/composables/dashboard/useNotes.mjs +57 -0
  110. package/dist/runtime/composables/dashboard/useQuickActions.d.ts +15 -0
  111. package/dist/runtime/composables/dashboard/useQuickActions.js +19 -0
  112. package/dist/runtime/composables/dashboard/useQuickActions.mjs +19 -0
  113. package/dist/runtime/composables/index.d.ts +4 -7
  114. package/dist/runtime/composables/index.js +4 -7
  115. package/dist/runtime/composables/index.mjs +4 -7
  116. package/dist/runtime/composables/pages/index.d.ts +4 -0
  117. package/dist/runtime/composables/pages/index.js +4 -0
  118. package/dist/runtime/composables/pages/index.mjs +4 -0
  119. package/dist/runtime/composables/{useBlockEditor.d.ts → pages/useBlockEditor.d.ts} +131 -131
  120. package/dist/runtime/composables/{useInfobox.d.ts → pages/useInfobox.d.ts} +1 -1
  121. package/dist/runtime/composables/{usePageEditor.d.ts → pages/usePageEditor.d.ts} +1 -1
  122. package/dist/runtime/composables/{usePageRegistry.d.ts → pages/usePageRegistry.d.ts} +2 -2
  123. package/dist/runtime/db/auth.d.ts +2096 -0
  124. package/dist/runtime/db/auth.js +268 -0
  125. package/dist/runtime/db/auth.mjs +268 -0
  126. package/dist/runtime/db/index.d.ts +1 -0
  127. package/dist/runtime/db/index.js +1 -0
  128. package/dist/runtime/db/index.mjs +1 -0
  129. package/dist/runtime/types/index.d.ts +1 -0
  130. package/dist/runtime/types/index.js +1 -0
  131. package/dist/runtime/types/index.mjs +1 -0
  132. package/dist/runtime/types/utils.d.ts +51 -0
  133. package/dist/runtime/types/utils.js +0 -0
  134. package/dist/runtime/types/utils.mjs +0 -0
  135. package/package.json +4 -2
  136. /package/dist/runtime/composables/{useDateRange.d.ts → app/useDateRange.d.ts} +0 -0
  137. /package/dist/runtime/composables/{useDateRange.js → app/useDateRange.js} +0 -0
  138. /package/dist/runtime/composables/{useDateRange.mjs → app/useDateRange.mjs} +0 -0
  139. /package/dist/runtime/composables/{useHeaderStack.d.ts → app/useHeaderStack.d.ts} +0 -0
  140. /package/dist/runtime/composables/{useHeaderStack.js → app/useHeaderStack.js} +0 -0
  141. /package/dist/runtime/composables/{useHeaderStack.mjs → app/useHeaderStack.mjs} +0 -0
  142. /package/dist/runtime/composables/{useRC.d.ts → components/useRC.d.ts} +0 -0
  143. /package/dist/runtime/composables/{useRC.js → components/useRC.js} +0 -0
  144. /package/dist/runtime/composables/{useRC.mjs → components/useRC.mjs} +0 -0
  145. /package/dist/runtime/composables/{useBlockEditor.js → pages/useBlockEditor.js} +0 -0
  146. /package/dist/runtime/composables/{useBlockEditor.mjs → pages/useBlockEditor.mjs} +0 -0
  147. /package/dist/runtime/composables/{useInfobox.js → pages/useInfobox.js} +0 -0
  148. /package/dist/runtime/composables/{useInfobox.mjs → pages/useInfobox.mjs} +0 -0
  149. /package/dist/runtime/composables/{usePageEditor.js → pages/usePageEditor.js} +0 -0
  150. /package/dist/runtime/composables/{usePageEditor.mjs → pages/usePageEditor.mjs} +0 -0
  151. /package/dist/runtime/composables/{usePageRegistry.js → pages/usePageRegistry.js} +0 -0
  152. /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
+ }));
@@ -1 +1,2 @@
1
1
  export * from "./helpers.js";
2
+ export * from "./auth.js";
@@ -1 +1,2 @@
1
1
  export * from "./helpers.js";
2
+ export * from "./auth.js";
@@ -1 +1,2 @@
1
1
  export * from "./helpers.mjs";
2
+ export * from "./auth.mjs";
@@ -1,3 +1,4 @@
1
1
  export * from "./blocks.js";
2
2
  export * from "./pages.js";
3
3
  export * from "./schemas.js";
4
+ export * from "./utils.js";
@@ -1,3 +1,4 @@
1
1
  export * from "./blocks.js";
2
2
  export * from "./pages.js";
3
3
  export * from "./schemas.js";
4
+ export * from "./utils.js";
@@ -1,3 +1,4 @@
1
1
  export * from "./blocks.mjs";
2
2
  export * from "./pages.mjs";
3
3
  export * from "./schemas.mjs";
4
+ export * from "./utils.mjs";
@@ -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.37",
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",