@withstudiocms/sdk 0.1.0-beta.1 → 0.1.0

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 (55) hide show
  1. package/dist/consts.d.ts +10 -1
  2. package/dist/consts.js +12 -3
  3. package/dist/context.d.ts +36 -16
  4. package/dist/context.js +8 -1
  5. package/dist/errors.d.ts +9 -0
  6. package/dist/errors.js +6 -0
  7. package/dist/index.d.ts +341 -453
  8. package/dist/lib/pluginUtils.d.ts +4 -3
  9. package/dist/lib/pluginUtils.js +17 -10
  10. package/dist/lib/storage-manager.d.ts +10 -0
  11. package/dist/lib/storage-manager.js +17 -0
  12. package/dist/migrations/20251025T040912_init.d.ts +17 -0
  13. package/dist/migrations/20251025T040912_init.js +260 -0
  14. package/dist/migrations/20251130T150847_drop_deprecated.d.ts +13 -0
  15. package/dist/migrations/20251130T150847_drop_deprecated.js +262 -0
  16. package/dist/migrations/20251221T002125_url-mapping.d.ts +13 -0
  17. package/dist/migrations/20251221T002125_url-mapping.js +228 -0
  18. package/dist/migrator.d.ts +25 -0
  19. package/dist/migrator.js +21 -0
  20. package/dist/modules/auth/index.d.ts +60 -104
  21. package/dist/modules/auth/index.js +33 -9
  22. package/dist/modules/config/index.d.ts +5 -5
  23. package/dist/modules/config/index.js +26 -7
  24. package/dist/modules/delete/index.d.ts +2 -1
  25. package/dist/modules/delete/index.js +7 -2
  26. package/dist/modules/diffTracking/index.d.ts +8 -8
  27. package/dist/modules/diffTracking/index.js +7 -6
  28. package/dist/modules/get/index.d.ts +116 -16
  29. package/dist/modules/get/index.js +135 -22
  30. package/dist/modules/index.d.ts +326 -446
  31. package/dist/modules/init/index.d.ts +9 -9
  32. package/dist/modules/middleware/index.d.ts +2 -2
  33. package/dist/modules/notificationSettings/index.d.ts +3 -3
  34. package/dist/modules/plugins/index.d.ts +9 -8
  35. package/dist/modules/plugins/index.js +17 -6
  36. package/dist/modules/post/index.d.ts +29 -28
  37. package/dist/modules/post/index.js +47 -15
  38. package/dist/modules/resetTokenBucket/index.d.ts +1 -1
  39. package/dist/modules/resetTokenBucket/index.js +5 -2
  40. package/dist/modules/rest_api/index.d.ts +8 -8
  41. package/dist/modules/rest_api/index.js +7 -3
  42. package/dist/modules/update/index.d.ts +25 -25
  43. package/dist/modules/update/index.js +28 -10
  44. package/dist/modules/util/collectors.d.ts +14 -150
  45. package/dist/modules/util/collectors.js +41 -14
  46. package/dist/modules/util/folderTree.d.ts +4 -4
  47. package/dist/modules/util/folderTree.js +1 -1
  48. package/dist/modules/util/getFromNPM.d.ts +13 -5
  49. package/dist/modules/util/getFromNPM.js +8 -2
  50. package/dist/modules/util/index.d.ts +30 -166
  51. package/dist/modules/util/users.d.ts +7 -7
  52. package/dist/tables.d.ts +433 -0
  53. package/dist/tables.js +169 -0
  54. package/dist/types.d.ts +6 -7
  55. package/package.json +17 -5
@@ -0,0 +1,433 @@
1
+ import { Schema } from '@withstudiocms/effect';
2
+ import { Table } from '@withstudiocms/kysely/core/schema';
3
+ /**
4
+ * StudioCMS Users Table Definition
5
+ */
6
+ export declare const StudioCMSUsersTable: Table<{
7
+ id: typeof Schema.String;
8
+ url: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
9
+ name: typeof Schema.String;
10
+ email: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
11
+ avatar: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
12
+ username: typeof Schema.String;
13
+ password: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
14
+ updatedAt: Schema.Schema<import("kysely").ColumnType<Date, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<typeof Schema.DateFromString, typeof Schema.String, typeof Schema.String>;
15
+ createdAt: Schema.Schema<import("kysely").ColumnType<Date, string | undefined, undefined>, import("kysely").ColumnType<string, string | undefined, undefined>, never> & import("@withstudiocms/kysely/core/schema").OptionalColumnTypes<typeof Schema.DateFromString, typeof Schema.String, typeof Schema.Never>;
16
+ emailVerified: Schema.transform<typeof Schema.Number, typeof Schema.Boolean>;
17
+ notifications: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
18
+ }>;
19
+ /**
20
+ * StudioCMS OAuth Accounts Table Definition
21
+ */
22
+ export declare const StudioCMSOAuthAccounts: Table<{
23
+ providerUserId: typeof Schema.String;
24
+ provider: typeof Schema.String;
25
+ userId: typeof Schema.String;
26
+ }>;
27
+ /**
28
+ * StudioCMS Sessions Table Definition
29
+ */
30
+ export declare const StudioCMSSessionTable: Table<{
31
+ id: typeof Schema.String;
32
+ userId: typeof Schema.String;
33
+ expiresAt: Schema.Schema<import("kysely").ColumnType<Date, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<typeof Schema.DateFromString, typeof Schema.String, typeof Schema.String>;
34
+ }>;
35
+ /**
36
+ * StudioCMS Permissions Table Definition
37
+ */
38
+ export declare const StudioCMSPermissions: Table<{
39
+ user: typeof Schema.String;
40
+ rank: Schema.Literal<["owner", "admin", "editor", "visitor", "unknown"]>;
41
+ }>;
42
+ /**
43
+ * StudioCMS API Keys Table Definition
44
+ */
45
+ export declare const StudioCMSAPIKeys: Table<{
46
+ id: typeof Schema.String;
47
+ userId: typeof Schema.String;
48
+ key: typeof Schema.String;
49
+ creationDate: Schema.Schema<import("kysely").ColumnType<Date, string | undefined, undefined>, import("kysely").ColumnType<string, string | undefined, undefined>, never> & import("@withstudiocms/kysely/core/schema").OptionalColumnTypes<typeof Schema.DateFromString, typeof Schema.String, typeof Schema.Never>;
50
+ description: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
51
+ }>;
52
+ /**
53
+ * StudioCMS User Reset Tokens Table Definition
54
+ */
55
+ export declare const StudioCMSUserResetTokens: Table<{
56
+ id: typeof Schema.String;
57
+ userId: typeof Schema.String;
58
+ token: typeof Schema.String;
59
+ }>;
60
+ /**
61
+ * StudioCMS Page Folder Structure Table Definition
62
+ */
63
+ export declare const StudioCMSPageFolderStructure: Table<{
64
+ id: typeof Schema.String;
65
+ name: typeof Schema.String;
66
+ parent: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
67
+ }>;
68
+ /**
69
+ * StudioCMS Page Data Table Definition
70
+ */
71
+ export declare const StudioCMSPageData: Table<{
72
+ id: typeof Schema.String;
73
+ package: typeof Schema.String;
74
+ title: typeof Schema.String;
75
+ description: typeof Schema.String;
76
+ showOnNav: Schema.transform<typeof Schema.Number, typeof Schema.Boolean>;
77
+ publishedAt: Schema.Schema<import("kysely").ColumnType<Date, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<typeof Schema.DateFromString, typeof Schema.String, typeof Schema.String>;
78
+ updatedAt: Schema.Schema<import("kysely").ColumnType<Date, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<typeof Schema.DateFromString, typeof Schema.String, typeof Schema.String>;
79
+ slug: typeof Schema.String;
80
+ contentLang: typeof Schema.String;
81
+ heroImage: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
82
+ categories: Schema.Schema<import("kysely").ColumnType<readonly string[], string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Array$<typeof Schema.String>>, typeof Schema.String, typeof Schema.String>;
83
+ tags: Schema.Schema<import("kysely").ColumnType<readonly string[], string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Array$<typeof Schema.String>>, typeof Schema.String, typeof Schema.String>;
84
+ authorId: typeof Schema.String;
85
+ contributorIds: Schema.Schema<import("kysely").ColumnType<readonly string[], string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Array$<typeof Schema.String>>, typeof Schema.String, typeof Schema.String>;
86
+ showAuthor: Schema.transform<typeof Schema.Number, typeof Schema.Boolean>;
87
+ showContributors: Schema.transform<typeof Schema.Number, typeof Schema.Boolean>;
88
+ parentFolder: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
89
+ draft: Schema.transform<typeof Schema.Number, typeof Schema.Boolean>;
90
+ augments: Schema.Schema<import("kysely").ColumnType<readonly string[], string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Array$<typeof Schema.String>>, typeof Schema.String, typeof Schema.String>;
91
+ }>;
92
+ /**
93
+ * StudioCMS Diff Tracking Table Definition
94
+ */
95
+ export declare const StudioCMSDiffTracking: Table<{
96
+ id: typeof Schema.String;
97
+ userId: typeof Schema.String;
98
+ pageId: typeof Schema.String;
99
+ timestamp: Schema.Schema<import("kysely").ColumnType<Date, string | undefined, undefined>, import("kysely").ColumnType<string, string | undefined, undefined>, never> & import("@withstudiocms/kysely/core/schema").OptionalColumnTypes<typeof Schema.DateFromString, typeof Schema.String, typeof Schema.Never>;
100
+ pageMetaData: Schema.Schema<import("kysely").ColumnType<{
101
+ readonly [x: string]: unknown;
102
+ }, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, typeof Schema.String, typeof Schema.String>;
103
+ pageContentStart: typeof Schema.String;
104
+ diff: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
105
+ }>;
106
+ /**
107
+ * StudioCMS Page Data Tags Table Definition
108
+ */
109
+ export declare const StudioCMSPageDataTags: Table<{
110
+ id: typeof Schema.Number;
111
+ description: typeof Schema.String;
112
+ name: typeof Schema.String;
113
+ slug: typeof Schema.String;
114
+ meta: Schema.Schema<import("kysely").ColumnType<{
115
+ readonly [x: string]: unknown;
116
+ }, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, typeof Schema.String, typeof Schema.String>;
117
+ }>;
118
+ /**
119
+ * StudioCMS Page Data Categories Table Definition
120
+ */
121
+ export declare const StudioCMSPageDataCategories: Table<{
122
+ id: typeof Schema.Number;
123
+ parent: Schema.optional<Schema.NullishOr<typeof Schema.Number>>;
124
+ description: typeof Schema.String;
125
+ name: typeof Schema.String;
126
+ slug: typeof Schema.String;
127
+ meta: Schema.Schema<import("kysely").ColumnType<{
128
+ readonly [x: string]: unknown;
129
+ }, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, typeof Schema.String, typeof Schema.String>;
130
+ }>;
131
+ /**
132
+ * StudioCMS Page Content Table Definition
133
+ */
134
+ export declare const StudioCMSPageContent: Table<{
135
+ id: typeof Schema.String;
136
+ contentId: typeof Schema.String;
137
+ contentLang: typeof Schema.String;
138
+ content: typeof Schema.String;
139
+ }>;
140
+ /**
141
+ * StudioCMS Email Verification Tokens Table Definition
142
+ */
143
+ export declare const StudioCMSEmailVerificationTokens: Table<{
144
+ id: typeof Schema.String;
145
+ userId: typeof Schema.String;
146
+ token: typeof Schema.String;
147
+ expiresAt: Schema.Schema<import("kysely").ColumnType<Date, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<typeof Schema.DateFromString, typeof Schema.String, typeof Schema.String>;
148
+ }>;
149
+ /**
150
+ * StudioCMS Plugin Data Table Definition
151
+ */
152
+ export declare const StudioCMSPluginData: Table<{
153
+ id: typeof Schema.String;
154
+ data: Schema.Schema<import("kysely").ColumnType<{
155
+ readonly [x: string]: unknown;
156
+ }, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, typeof Schema.String, typeof Schema.String>;
157
+ }>;
158
+ /**
159
+ * StudioCMS Dynamic Config Settings Table Definition
160
+ */
161
+ export declare const StudioCMSDynamicConfigSettings: Table<{
162
+ id: typeof Schema.String;
163
+ data: Schema.Schema<import("kysely").ColumnType<{
164
+ readonly [x: string]: unknown;
165
+ }, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, typeof Schema.String, typeof Schema.String>;
166
+ }>;
167
+ export declare const StudioCMSStorageManagerUrlMappings: Table<{
168
+ identifier: typeof Schema.String;
169
+ url: typeof Schema.String;
170
+ isPermanent: Schema.Schema<import("kysely").ColumnType<boolean, number, number>, import("kysely").ColumnType<number, boolean, boolean>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.Number, typeof Schema.Boolean>, Schema.transform<typeof Schema.Boolean, typeof Schema.Number>, Schema.transform<typeof Schema.Boolean, typeof Schema.Number>>;
171
+ expiresAt: Schema.optional<Schema.NullishOr<typeof Schema.Number>>;
172
+ createdAt: Schema.Schema<import("kysely").ColumnType<number, number | undefined, undefined>, import("kysely").ColumnType<number, number | undefined, undefined>, never> & import("@withstudiocms/kysely/core/schema").OptionalColumnTypes<typeof Schema.Number, typeof Schema.Number, typeof Schema.Never>;
173
+ updatedAt: typeof Schema.Number;
174
+ }>;
175
+ /**
176
+ * Complete StudioCMS Database Schema Definition
177
+ */
178
+ export declare const StudioCMSDatabaseSchema: Schema.Struct<{
179
+ StudioCMSUsersTable: Table<{
180
+ id: typeof Schema.String;
181
+ url: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
182
+ name: typeof Schema.String;
183
+ email: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
184
+ avatar: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
185
+ username: typeof Schema.String;
186
+ password: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
187
+ updatedAt: Schema.Schema<import("kysely").ColumnType<Date, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<typeof Schema.DateFromString, typeof Schema.String, typeof Schema.String>;
188
+ createdAt: Schema.Schema<import("kysely").ColumnType<Date, string | undefined, undefined>, import("kysely").ColumnType<string, string | undefined, undefined>, never> & import("@withstudiocms/kysely/core/schema").OptionalColumnTypes<typeof Schema.DateFromString, typeof Schema.String, typeof Schema.Never>;
189
+ emailVerified: Schema.transform<typeof Schema.Number, typeof Schema.Boolean>;
190
+ notifications: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
191
+ }>;
192
+ StudioCMSOAuthAccounts: Table<{
193
+ providerUserId: typeof Schema.String;
194
+ provider: typeof Schema.String;
195
+ userId: typeof Schema.String;
196
+ }>;
197
+ StudioCMSSessionTable: Table<{
198
+ id: typeof Schema.String;
199
+ userId: typeof Schema.String;
200
+ expiresAt: Schema.Schema<import("kysely").ColumnType<Date, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<typeof Schema.DateFromString, typeof Schema.String, typeof Schema.String>;
201
+ }>;
202
+ StudioCMSAPIKeys: Table<{
203
+ id: typeof Schema.String;
204
+ userId: typeof Schema.String;
205
+ key: typeof Schema.String;
206
+ creationDate: Schema.Schema<import("kysely").ColumnType<Date, string | undefined, undefined>, import("kysely").ColumnType<string, string | undefined, undefined>, never> & import("@withstudiocms/kysely/core/schema").OptionalColumnTypes<typeof Schema.DateFromString, typeof Schema.String, typeof Schema.Never>;
207
+ description: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
208
+ }>;
209
+ StudioCMSUserResetTokens: Table<{
210
+ id: typeof Schema.String;
211
+ userId: typeof Schema.String;
212
+ token: typeof Schema.String;
213
+ }>;
214
+ StudioCMSPermissions: Table<{
215
+ user: typeof Schema.String;
216
+ rank: Schema.Literal<["owner", "admin", "editor", "visitor", "unknown"]>;
217
+ }>;
218
+ StudioCMSPageFolderStructure: Table<{
219
+ id: typeof Schema.String;
220
+ name: typeof Schema.String;
221
+ parent: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
222
+ }>;
223
+ StudioCMSPageData: Table<{
224
+ id: typeof Schema.String;
225
+ package: typeof Schema.String;
226
+ title: typeof Schema.String;
227
+ description: typeof Schema.String;
228
+ showOnNav: Schema.transform<typeof Schema.Number, typeof Schema.Boolean>;
229
+ publishedAt: Schema.Schema<import("kysely").ColumnType<Date, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<typeof Schema.DateFromString, typeof Schema.String, typeof Schema.String>;
230
+ updatedAt: Schema.Schema<import("kysely").ColumnType<Date, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<typeof Schema.DateFromString, typeof Schema.String, typeof Schema.String>;
231
+ slug: typeof Schema.String;
232
+ contentLang: typeof Schema.String;
233
+ heroImage: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
234
+ categories: Schema.Schema<import("kysely").ColumnType<readonly string[], string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Array$<typeof Schema.String>>, typeof Schema.String, typeof Schema.String>;
235
+ tags: Schema.Schema<import("kysely").ColumnType<readonly string[], string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Array$<typeof Schema.String>>, typeof Schema.String, typeof Schema.String>;
236
+ authorId: typeof Schema.String;
237
+ contributorIds: Schema.Schema<import("kysely").ColumnType<readonly string[], string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Array$<typeof Schema.String>>, typeof Schema.String, typeof Schema.String>;
238
+ showAuthor: Schema.transform<typeof Schema.Number, typeof Schema.Boolean>;
239
+ showContributors: Schema.transform<typeof Schema.Number, typeof Schema.Boolean>;
240
+ parentFolder: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
241
+ draft: Schema.transform<typeof Schema.Number, typeof Schema.Boolean>;
242
+ augments: Schema.Schema<import("kysely").ColumnType<readonly string[], string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Array$<typeof Schema.String>>, typeof Schema.String, typeof Schema.String>;
243
+ }>;
244
+ StudioCMSDiffTracking: Table<{
245
+ id: typeof Schema.String;
246
+ userId: typeof Schema.String;
247
+ pageId: typeof Schema.String;
248
+ timestamp: Schema.Schema<import("kysely").ColumnType<Date, string | undefined, undefined>, import("kysely").ColumnType<string, string | undefined, undefined>, never> & import("@withstudiocms/kysely/core/schema").OptionalColumnTypes<typeof Schema.DateFromString, typeof Schema.String, typeof Schema.Never>;
249
+ pageMetaData: Schema.Schema<import("kysely").ColumnType<{
250
+ readonly [x: string]: unknown;
251
+ }, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, typeof Schema.String, typeof Schema.String>;
252
+ pageContentStart: typeof Schema.String;
253
+ diff: Schema.optional<Schema.NullishOr<typeof Schema.String>>;
254
+ }>;
255
+ StudioCMSPageDataTags: Table<{
256
+ id: typeof Schema.Number;
257
+ description: typeof Schema.String;
258
+ name: typeof Schema.String;
259
+ slug: typeof Schema.String;
260
+ meta: Schema.Schema<import("kysely").ColumnType<{
261
+ readonly [x: string]: unknown;
262
+ }, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, typeof Schema.String, typeof Schema.String>;
263
+ }>;
264
+ StudioCMSPageDataCategories: Table<{
265
+ id: typeof Schema.Number;
266
+ parent: Schema.optional<Schema.NullishOr<typeof Schema.Number>>;
267
+ description: typeof Schema.String;
268
+ name: typeof Schema.String;
269
+ slug: typeof Schema.String;
270
+ meta: Schema.Schema<import("kysely").ColumnType<{
271
+ readonly [x: string]: unknown;
272
+ }, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, typeof Schema.String, typeof Schema.String>;
273
+ }>;
274
+ StudioCMSPageContent: Table<{
275
+ id: typeof Schema.String;
276
+ contentId: typeof Schema.String;
277
+ contentLang: typeof Schema.String;
278
+ content: typeof Schema.String;
279
+ }>;
280
+ StudioCMSEmailVerificationTokens: Table<{
281
+ id: typeof Schema.String;
282
+ userId: typeof Schema.String;
283
+ token: typeof Schema.String;
284
+ expiresAt: Schema.Schema<import("kysely").ColumnType<Date, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<typeof Schema.DateFromString, typeof Schema.String, typeof Schema.String>;
285
+ }>;
286
+ StudioCMSPluginData: Table<{
287
+ id: typeof Schema.String;
288
+ data: Schema.Schema<import("kysely").ColumnType<{
289
+ readonly [x: string]: unknown;
290
+ }, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, typeof Schema.String, typeof Schema.String>;
291
+ }>;
292
+ StudioCMSDynamicConfigSettings: Table<{
293
+ id: typeof Schema.String;
294
+ data: Schema.Schema<import("kysely").ColumnType<{
295
+ readonly [x: string]: unknown;
296
+ }, string, string>, import("kysely").ColumnType<string, string, string>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>>, typeof Schema.String, typeof Schema.String>;
297
+ }>;
298
+ StudioCMSStorageManagerUrlMappings: Table<{
299
+ identifier: typeof Schema.String;
300
+ url: typeof Schema.String;
301
+ isPermanent: Schema.Schema<import("kysely").ColumnType<boolean, number, number>, import("kysely").ColumnType<number, boolean, boolean>, never> & import("@withstudiocms/kysely/core/schema").ColumnTypes<Schema.transform<typeof Schema.Number, typeof Schema.Boolean>, Schema.transform<typeof Schema.Boolean, typeof Schema.Number>, Schema.transform<typeof Schema.Boolean, typeof Schema.Number>>;
302
+ expiresAt: Schema.optional<Schema.NullishOr<typeof Schema.Number>>;
303
+ createdAt: Schema.Schema<import("kysely").ColumnType<number, number | undefined, undefined>, import("kysely").ColumnType<number, number | undefined, undefined>, never> & import("@withstudiocms/kysely/core/schema").OptionalColumnTypes<typeof Schema.Number, typeof Schema.Number, typeof Schema.Never>;
304
+ updatedAt: typeof Schema.Number;
305
+ }>;
306
+ }>;
307
+ /**
308
+ * Encoded StudioCMS Database Schema
309
+ */
310
+ declare const StudioCMSDatabaseSchemaEncoded: {
311
+ readonly StudioCMSUsersTable: {
312
+ readonly id: string;
313
+ readonly name: string;
314
+ readonly username: string;
315
+ readonly updatedAt: import("kysely").ColumnType<string, string, string>;
316
+ readonly createdAt: import("kysely").ColumnType<string, string | undefined, undefined>;
317
+ readonly emailVerified: number;
318
+ readonly url?: string | null | undefined;
319
+ readonly email?: string | null | undefined;
320
+ readonly avatar?: string | null | undefined;
321
+ readonly password?: string | null | undefined;
322
+ readonly notifications?: string | null | undefined;
323
+ };
324
+ readonly StudioCMSOAuthAccounts: {
325
+ readonly providerUserId: string;
326
+ readonly provider: string;
327
+ readonly userId: string;
328
+ };
329
+ readonly StudioCMSSessionTable: {
330
+ readonly id: string;
331
+ readonly userId: string;
332
+ readonly expiresAt: import("kysely").ColumnType<string, string, string>;
333
+ };
334
+ readonly StudioCMSAPIKeys: {
335
+ readonly id: string;
336
+ readonly userId: string;
337
+ readonly key: string;
338
+ readonly creationDate: import("kysely").ColumnType<string, string | undefined, undefined>;
339
+ readonly description?: string | null | undefined;
340
+ };
341
+ readonly StudioCMSUserResetTokens: {
342
+ readonly id: string;
343
+ readonly userId: string;
344
+ readonly token: string;
345
+ };
346
+ readonly StudioCMSPermissions: {
347
+ readonly user: string;
348
+ readonly rank: "owner" | "admin" | "editor" | "visitor" | "unknown";
349
+ };
350
+ readonly StudioCMSPageFolderStructure: {
351
+ readonly id: string;
352
+ readonly name: string;
353
+ readonly parent?: string | null | undefined;
354
+ };
355
+ readonly StudioCMSPageData: {
356
+ readonly id: string;
357
+ readonly updatedAt: import("kysely").ColumnType<string, string, string>;
358
+ readonly description: string;
359
+ readonly package: string;
360
+ readonly title: string;
361
+ readonly showOnNav: number;
362
+ readonly publishedAt: import("kysely").ColumnType<string, string, string>;
363
+ readonly slug: string;
364
+ readonly contentLang: string;
365
+ readonly categories: import("kysely").ColumnType<string, string, string>;
366
+ readonly tags: import("kysely").ColumnType<string, string, string>;
367
+ readonly authorId: string;
368
+ readonly contributorIds: import("kysely").ColumnType<string, string, string>;
369
+ readonly showAuthor: number;
370
+ readonly showContributors: number;
371
+ readonly draft: number;
372
+ readonly augments: import("kysely").ColumnType<string, string, string>;
373
+ readonly heroImage?: string | null | undefined;
374
+ readonly parentFolder?: string | null | undefined;
375
+ };
376
+ readonly StudioCMSDiffTracking: {
377
+ readonly id: string;
378
+ readonly userId: string;
379
+ readonly pageId: string;
380
+ readonly timestamp: import("kysely").ColumnType<string, string | undefined, undefined>;
381
+ readonly pageMetaData: import("kysely").ColumnType<string, string, string>;
382
+ readonly pageContentStart: string;
383
+ readonly diff?: string | null | undefined;
384
+ };
385
+ readonly StudioCMSPageDataTags: {
386
+ readonly id: number;
387
+ readonly name: string;
388
+ readonly description: string;
389
+ readonly slug: string;
390
+ readonly meta: import("kysely").ColumnType<string, string, string>;
391
+ };
392
+ readonly StudioCMSPageDataCategories: {
393
+ readonly id: number;
394
+ readonly name: string;
395
+ readonly description: string;
396
+ readonly slug: string;
397
+ readonly meta: import("kysely").ColumnType<string, string, string>;
398
+ readonly parent?: number | null | undefined;
399
+ };
400
+ readonly StudioCMSPageContent: {
401
+ readonly id: string;
402
+ readonly contentLang: string;
403
+ readonly contentId: string;
404
+ readonly content: string;
405
+ };
406
+ readonly StudioCMSEmailVerificationTokens: {
407
+ readonly id: string;
408
+ readonly userId: string;
409
+ readonly expiresAt: import("kysely").ColumnType<string, string, string>;
410
+ readonly token: string;
411
+ };
412
+ readonly StudioCMSPluginData: {
413
+ readonly id: string;
414
+ readonly data: import("kysely").ColumnType<string, string, string>;
415
+ };
416
+ readonly StudioCMSDynamicConfigSettings: {
417
+ readonly id: string;
418
+ readonly data: import("kysely").ColumnType<string, string, string>;
419
+ };
420
+ readonly StudioCMSStorageManagerUrlMappings: {
421
+ readonly url: string;
422
+ readonly updatedAt: number;
423
+ readonly createdAt: import("kysely").ColumnType<number, number | undefined, undefined>;
424
+ readonly identifier: string;
425
+ readonly isPermanent: import("kysely").ColumnType<number, boolean, boolean>;
426
+ readonly expiresAt?: number | null | undefined;
427
+ };
428
+ };
429
+ /**
430
+ * Type representing the StudioCMS Database Schema.
431
+ */
432
+ export type StudioCMSDatabaseSchema = typeof StudioCMSDatabaseSchemaEncoded;
433
+ export {};
package/dist/tables.js ADDED
@@ -0,0 +1,169 @@
1
+ import { Schema } from "@withstudiocms/effect";
2
+ import {
3
+ BooleanFromNumber,
4
+ ColumnType,
5
+ CreatedAtDate,
6
+ Database,
7
+ DateFromString,
8
+ encodeDatabase,
9
+ JSONObjectFromString,
10
+ NumberFromBoolean,
11
+ OptionalColumnType,
12
+ StringArrayFromString,
13
+ Table
14
+ } from "@withstudiocms/kysely/core/schema";
15
+ const StudioCMSUsersTable = Table({
16
+ id: Schema.String,
17
+ url: Schema.optional(Schema.NullishOr(Schema.String)),
18
+ name: Schema.String,
19
+ email: Schema.optional(Schema.NullishOr(Schema.String)),
20
+ avatar: Schema.optional(Schema.NullishOr(Schema.String)),
21
+ username: Schema.String,
22
+ password: Schema.optional(Schema.NullishOr(Schema.String)),
23
+ updatedAt: DateFromString,
24
+ createdAt: CreatedAtDate,
25
+ emailVerified: BooleanFromNumber,
26
+ notifications: Schema.optional(Schema.NullishOr(Schema.String))
27
+ });
28
+ const StudioCMSOAuthAccounts = Table({
29
+ providerUserId: Schema.String,
30
+ provider: Schema.String,
31
+ userId: Schema.String
32
+ });
33
+ const StudioCMSSessionTable = Table({
34
+ id: Schema.String,
35
+ userId: Schema.String,
36
+ expiresAt: DateFromString
37
+ });
38
+ const StudioCMSPermissions = Table({
39
+ user: Schema.String,
40
+ rank: Schema.Literal("owner", "admin", "editor", "visitor", "unknown")
41
+ });
42
+ const StudioCMSAPIKeys = Table({
43
+ id: Schema.String,
44
+ userId: Schema.String,
45
+ key: Schema.String,
46
+ creationDate: CreatedAtDate,
47
+ description: Schema.optional(Schema.NullishOr(Schema.String))
48
+ });
49
+ const StudioCMSUserResetTokens = Table({
50
+ id: Schema.String,
51
+ userId: Schema.String,
52
+ token: Schema.String
53
+ });
54
+ const StudioCMSPageFolderStructure = Table({
55
+ id: Schema.String,
56
+ name: Schema.String,
57
+ parent: Schema.optional(Schema.NullishOr(Schema.String))
58
+ });
59
+ const StudioCMSPageData = Table({
60
+ id: Schema.String,
61
+ package: Schema.String,
62
+ title: Schema.String,
63
+ description: Schema.String,
64
+ showOnNav: BooleanFromNumber,
65
+ publishedAt: DateFromString,
66
+ updatedAt: DateFromString,
67
+ slug: Schema.String,
68
+ contentLang: Schema.String,
69
+ heroImage: Schema.optional(Schema.NullishOr(Schema.String)),
70
+ categories: ColumnType(StringArrayFromString, Schema.String, Schema.String),
71
+ tags: ColumnType(StringArrayFromString, Schema.String, Schema.String),
72
+ authorId: Schema.String,
73
+ contributorIds: ColumnType(StringArrayFromString, Schema.String, Schema.String),
74
+ showAuthor: BooleanFromNumber,
75
+ showContributors: BooleanFromNumber,
76
+ parentFolder: Schema.optional(Schema.NullishOr(Schema.String)),
77
+ draft: BooleanFromNumber,
78
+ augments: ColumnType(StringArrayFromString, Schema.String, Schema.String)
79
+ });
80
+ const StudioCMSDiffTracking = Table({
81
+ id: Schema.String,
82
+ userId: Schema.String,
83
+ pageId: Schema.String,
84
+ timestamp: CreatedAtDate,
85
+ pageMetaData: ColumnType(JSONObjectFromString, Schema.String, Schema.String),
86
+ pageContentStart: Schema.String,
87
+ diff: Schema.optional(Schema.NullishOr(Schema.String))
88
+ });
89
+ const StudioCMSPageDataTags = Table({
90
+ id: Schema.Number,
91
+ description: Schema.String,
92
+ name: Schema.String,
93
+ slug: Schema.String,
94
+ meta: ColumnType(JSONObjectFromString, Schema.String, Schema.String)
95
+ });
96
+ const StudioCMSPageDataCategories = Table({
97
+ id: Schema.Number,
98
+ parent: Schema.optional(Schema.NullishOr(Schema.Number)),
99
+ description: Schema.String,
100
+ name: Schema.String,
101
+ slug: Schema.String,
102
+ meta: ColumnType(JSONObjectFromString, Schema.String, Schema.String)
103
+ });
104
+ const StudioCMSPageContent = Table({
105
+ id: Schema.String,
106
+ contentId: Schema.String,
107
+ contentLang: Schema.String,
108
+ content: Schema.String
109
+ });
110
+ const StudioCMSEmailVerificationTokens = Table({
111
+ id: Schema.String,
112
+ userId: Schema.String,
113
+ token: Schema.String,
114
+ expiresAt: DateFromString
115
+ });
116
+ const StudioCMSPluginData = Table({
117
+ id: Schema.String,
118
+ data: ColumnType(JSONObjectFromString, Schema.String, Schema.String)
119
+ });
120
+ const StudioCMSDynamicConfigSettings = Table({
121
+ id: Schema.String,
122
+ data: ColumnType(JSONObjectFromString, Schema.String, Schema.String)
123
+ });
124
+ const StudioCMSStorageManagerUrlMappings = Table({
125
+ identifier: Schema.String,
126
+ url: Schema.String,
127
+ isPermanent: ColumnType(BooleanFromNumber, NumberFromBoolean, NumberFromBoolean),
128
+ expiresAt: Schema.optional(Schema.NullishOr(Schema.Number)),
129
+ createdAt: OptionalColumnType(Schema.Number, Schema.Number, Schema.Never),
130
+ updatedAt: Schema.Number
131
+ });
132
+ const StudioCMSDatabaseSchema = Database({
133
+ StudioCMSUsersTable,
134
+ StudioCMSOAuthAccounts,
135
+ StudioCMSSessionTable,
136
+ StudioCMSAPIKeys,
137
+ StudioCMSUserResetTokens,
138
+ StudioCMSPermissions,
139
+ StudioCMSPageFolderStructure,
140
+ StudioCMSPageData,
141
+ StudioCMSDiffTracking,
142
+ StudioCMSPageDataTags,
143
+ StudioCMSPageDataCategories,
144
+ StudioCMSPageContent,
145
+ StudioCMSEmailVerificationTokens,
146
+ StudioCMSPluginData,
147
+ StudioCMSDynamicConfigSettings,
148
+ StudioCMSStorageManagerUrlMappings
149
+ });
150
+ const StudioCMSDatabaseSchemaEncoded = encodeDatabase(StudioCMSDatabaseSchema);
151
+ export {
152
+ StudioCMSAPIKeys,
153
+ StudioCMSDatabaseSchema,
154
+ StudioCMSDiffTracking,
155
+ StudioCMSDynamicConfigSettings,
156
+ StudioCMSEmailVerificationTokens,
157
+ StudioCMSOAuthAccounts,
158
+ StudioCMSPageContent,
159
+ StudioCMSPageData,
160
+ StudioCMSPageDataCategories,
161
+ StudioCMSPageDataTags,
162
+ StudioCMSPageFolderStructure,
163
+ StudioCMSPermissions,
164
+ StudioCMSPluginData,
165
+ StudioCMSSessionTable,
166
+ StudioCMSStorageManagerUrlMappings,
167
+ StudioCMSUserResetTokens,
168
+ StudioCMSUsersTable
169
+ };
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { Effect } from '@withstudiocms/effect';
2
- import type { DBCallbackFailure, OptionalNullable } from '@withstudiocms/kysely/core/client';
2
+ import type { DBCallbackFailure } from '@withstudiocms/kysely/core/client';
3
3
  import type { DatabaseError } from '@withstudiocms/kysely/core/errors';
4
- import type { StudioCMSAPIKeys, StudioCMSDiffTracking, StudioCMSDynamicConfigSettings, StudioCMSEmailVerificationTokens, StudioCMSOAuthAccounts, StudioCMSPageContent, StudioCMSPageData, StudioCMSPageDataCategories, StudioCMSPageDataTags, StudioCMSPageFolderStructure, StudioCMSPermissions, StudioCMSPluginData, StudioCMSSessionTable, StudioCMSUserResetTokens, StudioCMSUsersTable } from '@withstudiocms/kysely/tables';
4
+ import type { StudioCMSAPIKeys, StudioCMSDiffTracking, StudioCMSDynamicConfigSettings, StudioCMSEmailVerificationTokens, StudioCMSOAuthAccounts, StudioCMSPageContent, StudioCMSPageData, StudioCMSPageDataCategories, StudioCMSPageDataTags, StudioCMSPageFolderStructure, StudioCMSPermissions, StudioCMSPluginData, StudioCMSSessionTable, StudioCMSUserResetTokens, StudioCMSUsersTable } from './tables.js';
5
5
  export * from './lib/pluginUtils.js';
6
6
  export type tsPageDataCategories = typeof StudioCMSPageDataCategories;
7
7
  export type tsPageDataTags = typeof StudioCMSPageDataTags;
@@ -74,8 +74,8 @@ export interface CombinedPageData extends PageDataStripped {
74
74
  multiLangContent: tsPageContentSelect[];
75
75
  defaultContent: tsPageContentSelect | undefined;
76
76
  urlRoute: string;
77
- authorData: tsUsersSelect | undefined;
78
- contributorsData: tsUsersSelect[];
77
+ authorData: Omit<tsUsersSelect, 'email' | 'password'> | undefined;
78
+ contributorsData: Omit<tsUsersSelect, 'email' | 'password'>[];
79
79
  }
80
80
  /**
81
81
  * Represents page data containing only metadata fields, excluding multilingual and default content.
@@ -129,10 +129,10 @@ export interface FolderListItem {
129
129
  * @param input - An object containing an optional nullable `id` string.
130
130
  * @returns An effect that yields the dynamic configuration entry or a database error.
131
131
  */
132
- export type DbQueryFn = (input: OptionalNullable<{
132
+ export type DbQueryFn = (input: {
133
133
  readonly id: string;
134
134
  readonly data: string;
135
- }>) => Effect.Effect<{
135
+ }) => Effect.Effect<{
136
136
  readonly id: string;
137
137
  readonly data: {
138
138
  readonly [x: string]: unknown;
@@ -189,7 +189,6 @@ export interface StudioCMSSiteConfig extends StudioCMSDynamicConfigBase {
189
189
  diffPerPage?: number | undefined;
190
190
  gridItems?: string[];
191
191
  enableMailer?: boolean | undefined;
192
- hideDefaultIndex?: boolean | undefined;
193
192
  }
194
193
  /**
195
194
  * Represents the mailer configuration type for StudioCMS.