@withstudiocms/sdk 0.0.0-beta.0 → 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 (85) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +21 -0
  3. package/dist/cache.d.ts +109 -0
  4. package/dist/cache.js +94 -0
  5. package/dist/consts.d.ts +37 -0
  6. package/dist/consts.js +35 -0
  7. package/dist/context.d.ts +208 -0
  8. package/dist/context.js +40 -0
  9. package/dist/errors.d.ts +9 -0
  10. package/dist/errors.js +6 -0
  11. package/dist/index.d.ts +1024 -0
  12. package/dist/index.js +24 -0
  13. package/dist/lib/diff.d.ts +39 -0
  14. package/dist/lib/diff.js +29 -0
  15. package/dist/lib/logger.d.ts +31 -0
  16. package/dist/lib/logger.js +131 -0
  17. package/dist/lib/pluginUtils.d.ts +222 -0
  18. package/dist/lib/pluginUtils.js +87 -0
  19. package/dist/lib/storage-manager.d.ts +10 -0
  20. package/dist/lib/storage-manager.js +17 -0
  21. package/dist/migrations/20251025T040912_init.d.ts +17 -0
  22. package/dist/migrations/20251025T040912_init.js +260 -0
  23. package/dist/migrations/20251130T150847_drop_deprecated.d.ts +13 -0
  24. package/dist/migrations/20251130T150847_drop_deprecated.js +262 -0
  25. package/dist/migrations/20251221T002125_url-mapping.d.ts +13 -0
  26. package/dist/migrations/20251221T002125_url-mapping.js +228 -0
  27. package/dist/migrator.d.ts +25 -0
  28. package/dist/migrator.js +21 -0
  29. package/dist/modules/auth/index.d.ts +419 -0
  30. package/dist/modules/auth/index.js +436 -0
  31. package/dist/modules/clear/index.d.ts +72 -0
  32. package/dist/modules/clear/index.js +52 -0
  33. package/dist/modules/config/consts.d.ts +32 -0
  34. package/dist/modules/config/consts.js +18 -0
  35. package/dist/modules/config/index.d.ts +100 -0
  36. package/dist/modules/config/index.js +224 -0
  37. package/dist/modules/config/templates/mailer.d.ts +36 -0
  38. package/dist/modules/config/templates/mailer.js +218 -0
  39. package/dist/modules/config/type-utils.d.ts +13 -0
  40. package/dist/modules/config/type-utils.js +11 -0
  41. package/dist/modules/delete/index.d.ts +141 -0
  42. package/dist/modules/delete/index.js +279 -0
  43. package/dist/modules/diffTracking/index.d.ts +188 -0
  44. package/dist/modules/diffTracking/index.js +277 -0
  45. package/dist/modules/get/index.d.ts +372 -0
  46. package/dist/modules/get/index.js +579 -0
  47. package/dist/modules/index.d.ts +883 -0
  48. package/dist/modules/index.js +37 -0
  49. package/dist/modules/init/index.d.ts +60 -0
  50. package/dist/modules/init/index.js +38 -0
  51. package/dist/modules/middleware/index.d.ts +56 -0
  52. package/dist/modules/middleware/index.js +50 -0
  53. package/dist/modules/notificationSettings/index.d.ts +57 -0
  54. package/dist/modules/notificationSettings/index.js +39 -0
  55. package/dist/modules/plugins/index.d.ts +167 -0
  56. package/dist/modules/plugins/index.js +272 -0
  57. package/dist/modules/post/index.d.ts +306 -0
  58. package/dist/modules/post/index.js +337 -0
  59. package/dist/modules/resetTokenBucket/index.d.ts +91 -0
  60. package/dist/modules/resetTokenBucket/index.js +96 -0
  61. package/dist/modules/rest_api/index.d.ts +92 -0
  62. package/dist/modules/rest_api/index.js +117 -0
  63. package/dist/modules/update/index.d.ts +184 -0
  64. package/dist/modules/update/index.js +192 -0
  65. package/dist/modules/util/collectors.d.ts +125 -0
  66. package/dist/modules/util/collectors.js +168 -0
  67. package/dist/modules/util/folderTree.d.ts +100 -0
  68. package/dist/modules/util/folderTree.js +176 -0
  69. package/dist/modules/util/generators.d.ts +83 -0
  70. package/dist/modules/util/generators.js +106 -0
  71. package/dist/modules/util/getFromNPM.d.ts +199 -0
  72. package/dist/modules/util/getFromNPM.js +106 -0
  73. package/dist/modules/util/index.d.ts +100 -0
  74. package/dist/modules/util/index.js +20 -0
  75. package/dist/modules/util/parsers.d.ts +60 -0
  76. package/dist/modules/util/parsers.js +43 -0
  77. package/dist/modules/util/slugify.d.ts +22 -0
  78. package/dist/modules/util/slugify.js +19 -0
  79. package/dist/modules/util/users.d.ts +99 -0
  80. package/dist/modules/util/users.js +78 -0
  81. package/dist/tables.d.ts +433 -0
  82. package/dist/tables.js +169 -0
  83. package/dist/types.d.ts +359 -0
  84. package/dist/types.js +10 -0
  85. package/package.json +67 -7
@@ -0,0 +1,260 @@
1
+ import {
2
+ rollbackMigration,
3
+ syncDatabaseSchema
4
+ } from "@withstudiocms/kysely/utils/migrator";
5
+ const previousSchema = [];
6
+ const schemaDefinition = [
7
+ {
8
+ name: "StudioCMSUsersTable",
9
+ columns: [
10
+ { name: "id", type: "text", primaryKey: true },
11
+ { name: "url", type: "text" },
12
+ { name: "name", type: "text", notNull: true },
13
+ { name: "email", type: "text" },
14
+ { name: "avatar", type: "text" },
15
+ { name: "username", type: "text", notNull: true },
16
+ { name: "password", type: "text" },
17
+ { name: "updatedAt", type: "text", notNull: true },
18
+ { name: "createdAt", type: "text", notNull: true, defaultSQL: "CURRENT_TIMESTAMP" },
19
+ { name: "emailVerified", type: "integer", notNull: true, default: 0 },
20
+ { name: "notifications", type: "text" }
21
+ ]
22
+ },
23
+ {
24
+ name: "StudioCMSOAuthAccounts",
25
+ columns: [
26
+ { name: "providerUserId", type: "text", notNull: true },
27
+ { name: "provider", type: "text", notNull: true },
28
+ {
29
+ name: "userId",
30
+ type: "text",
31
+ notNull: true,
32
+ references: { table: "StudioCMSUsersTable", column: "id" }
33
+ }
34
+ ]
35
+ },
36
+ {
37
+ name: "StudioCMSSessionTable",
38
+ columns: [
39
+ { name: "id", type: "text", primaryKey: true },
40
+ {
41
+ name: "userId",
42
+ type: "text",
43
+ notNull: true,
44
+ references: { table: "StudioCMSUsersTable", column: "id" }
45
+ },
46
+ { name: "expiresAt", type: "text", notNull: true }
47
+ ]
48
+ },
49
+ {
50
+ name: "StudioCMSPermissions",
51
+ columns: [
52
+ {
53
+ name: "user",
54
+ type: "text",
55
+ notNull: true,
56
+ references: { table: "StudioCMSUsersTable", column: "id" }
57
+ },
58
+ { name: "rank", type: "text", notNull: true }
59
+ ]
60
+ },
61
+ {
62
+ name: "StudioCMSAPIKeys",
63
+ columns: [
64
+ { name: "id", type: "text", primaryKey: true },
65
+ {
66
+ name: "userId",
67
+ type: "text",
68
+ notNull: true,
69
+ references: { table: "StudioCMSUsersTable", column: "id" }
70
+ },
71
+ { name: "key", type: "text", notNull: true },
72
+ { name: "creationDate", type: "text", notNull: true },
73
+ { name: "description", type: "text" }
74
+ ]
75
+ },
76
+ {
77
+ name: "StudioCMSUserResetTokens",
78
+ columns: [
79
+ { name: "id", type: "text", primaryKey: true },
80
+ {
81
+ name: "userId",
82
+ type: "text",
83
+ notNull: true,
84
+ references: { table: "StudioCMSUsersTable", column: "id" }
85
+ },
86
+ { name: "token", type: "text", notNull: true }
87
+ ]
88
+ },
89
+ {
90
+ name: "StudioCMSPageFolderStructure",
91
+ columns: [
92
+ { name: "id", type: "text", primaryKey: true },
93
+ { name: "name", type: "text", notNull: true },
94
+ { name: "parent", type: "text" }
95
+ ]
96
+ },
97
+ {
98
+ name: "StudioCMSPageData",
99
+ columns: [
100
+ { name: "id", type: "text", primaryKey: true },
101
+ { name: "package", type: "text", notNull: true },
102
+ { name: "title", type: "text", notNull: true },
103
+ { name: "description", type: "text", notNull: true },
104
+ { name: "showOnNav", type: "integer", notNull: true, default: 0 },
105
+ { name: "publishedAt", type: "text" },
106
+ { name: "updatedAt", type: "text", notNull: true },
107
+ { name: "slug", type: "text", notNull: true },
108
+ { name: "contentLang", type: "text", notNull: true },
109
+ { name: "heroImage", type: "text" },
110
+ { name: "categories", type: "text", notNull: true, default: JSON.stringify([]) },
111
+ { name: "tags", type: "text", notNull: true, default: JSON.stringify([]) },
112
+ { name: "authorId", type: "text", notNull: true },
113
+ { name: "contributorIds", type: "text", notNull: true, default: JSON.stringify([]) },
114
+ { name: "showAuthor", type: "integer", notNull: true, default: 0 },
115
+ { name: "showContributors", type: "integer", notNull: true, default: 0 },
116
+ { name: "parentFolder", type: "text" },
117
+ { name: "draft", type: "integer", notNull: true, default: 0 },
118
+ { name: "augments", type: "text", notNull: true, default: JSON.stringify([]) }
119
+ ]
120
+ },
121
+ {
122
+ name: "StudioCMSDiffTracking",
123
+ columns: [
124
+ { name: "id", type: "text", primaryKey: true },
125
+ {
126
+ name: "pageId",
127
+ type: "text",
128
+ notNull: true,
129
+ references: { table: "StudioCMSPageData", column: "id" }
130
+ },
131
+ {
132
+ name: "userId",
133
+ type: "text",
134
+ notNull: true,
135
+ references: { table: "StudioCMSUsersTable", column: "id" }
136
+ },
137
+ { name: "timestamp", type: "text", notNull: true },
138
+ { name: "pageMetaData", type: "text", notNull: true },
139
+ { name: "pageContentStart", type: "text", notNull: true },
140
+ { name: "diff", type: "text" }
141
+ ]
142
+ },
143
+ {
144
+ name: "StudioCMSPageDataTags",
145
+ columns: [
146
+ { name: "id", type: "integer", primaryKey: true },
147
+ { name: "description", type: "text", notNull: true },
148
+ { name: "name", type: "text", notNull: true },
149
+ { name: "slug", type: "text", notNull: true },
150
+ { name: "meta", type: "text", notNull: true }
151
+ ]
152
+ },
153
+ {
154
+ name: "StudioCMSPageDataCategories",
155
+ columns: [
156
+ { name: "id", type: "integer", primaryKey: true },
157
+ { name: "parent", type: "integer" },
158
+ { name: "description", type: "text", notNull: true },
159
+ { name: "name", type: "text", notNull: true },
160
+ { name: "slug", type: "text", notNull: true },
161
+ { name: "meta", type: "text", notNull: true }
162
+ ]
163
+ },
164
+ {
165
+ name: "StudioCMSPageContent",
166
+ columns: [
167
+ { name: "id", type: "text", primaryKey: true },
168
+ {
169
+ name: "contentId",
170
+ type: "text",
171
+ notNull: true,
172
+ references: { table: "StudioCMSPageData", column: "id" }
173
+ },
174
+ { name: "contentLang", type: "text", notNull: true },
175
+ { name: "content", type: "text", notNull: true }
176
+ ]
177
+ },
178
+ {
179
+ name: "StudioCMSEmailVerificationTokens",
180
+ columns: [
181
+ { name: "id", type: "text", primaryKey: true },
182
+ {
183
+ name: "userId",
184
+ type: "text",
185
+ notNull: true,
186
+ references: { table: "StudioCMSUsersTable", column: "id" }
187
+ },
188
+ { name: "token", type: "text", notNull: true },
189
+ { name: "expiresAt", type: "text", notNull: true }
190
+ ]
191
+ },
192
+ {
193
+ name: "StudioCMSPluginData",
194
+ columns: [
195
+ { name: "id", type: "text", primaryKey: true },
196
+ { name: "data", type: "text", notNull: true }
197
+ ]
198
+ },
199
+ {
200
+ name: "StudioCMSDynamicConfigSettings",
201
+ columns: [
202
+ { name: "id", type: "text", primaryKey: true },
203
+ { name: "data", type: "text", notNull: true }
204
+ ]
205
+ },
206
+ // DEPRECATED TABLES - to be removed in future migrations
207
+ {
208
+ name: "StudioCMSSiteConfig",
209
+ columns: [
210
+ { name: "id", type: "text", primaryKey: true },
211
+ { name: "title", type: "text", notNull: true },
212
+ { name: "description", type: "text", notNull: true },
213
+ { name: "defaultOgImage", type: "text" },
214
+ { name: "siteIcon", type: "text" },
215
+ { name: "loginPageBackground", type: "text", notNull: true, default: "studiocms-curves" },
216
+ { name: "loginPageCustomImage", type: "text" },
217
+ { name: "enableDiffs", type: "integer", notNull: true, default: 0 },
218
+ { name: "diffPerPage", type: "integer", notNull: true, default: 10 },
219
+ { name: "gridItems", type: "text", notNull: true, default: JSON.stringify([]) },
220
+ { name: "enableMailer", type: "integer", notNull: true, default: 0 },
221
+ { name: "hideDefaultIndex", type: "integer", notNull: true, default: 0 }
222
+ ]
223
+ },
224
+ {
225
+ name: "StudioCMSMailerConfig",
226
+ columns: [
227
+ { name: "id", type: "text", primaryKey: true },
228
+ { name: "host", type: "text", notNull: true },
229
+ { name: "port", type: "integer", notNull: true },
230
+ { name: "secure", type: "integer", notNull: true, default: 0 },
231
+ { name: "proxy", type: "text" },
232
+ { name: "auth_user", type: "text" },
233
+ { name: "auth_password", type: "text" },
234
+ { name: "tls_rejectUnauthorized", type: "integer" },
235
+ { name: "tls_servername", type: "text" },
236
+ { name: "default_sender", type: "text", notNull: true }
237
+ ]
238
+ },
239
+ {
240
+ name: "StudioCMSNotificationSettings",
241
+ columns: [
242
+ { name: "id", type: "text", primaryKey: true },
243
+ { name: "emailVerification", type: "integer", notNull: true, default: 0 },
244
+ { name: "requireAdminVerification", type: "integer", notNull: true, default: 0 },
245
+ { name: "requireEditorVerification", type: "integer", notNull: true, default: 0 },
246
+ { name: "oAuthBypassVerification", type: "integer", notNull: true, default: 0 }
247
+ ]
248
+ }
249
+ ];
250
+ async function up(db) {
251
+ await syncDatabaseSchema(db, schemaDefinition, previousSchema);
252
+ }
253
+ async function down(db) {
254
+ await rollbackMigration(db, schemaDefinition, previousSchema);
255
+ }
256
+ export {
257
+ down,
258
+ schemaDefinition,
259
+ up
260
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * - Title: Drop Deprecated Tables
3
+ * - Created: 2025-11-30
4
+ * - Author: Adam Matthiesen
5
+ * - GitHub PR: #1033
6
+ * - Description: Drop previously deprecated tables from the database schema. (re-deprecate here to be fully removed in the next migration safely)
7
+ */
8
+ /** biome-ignore-all lint/suspicious/noExplicitAny: Requirement from Kysely */
9
+ import type { Kysely } from '@withstudiocms/kysely/kysely';
10
+ import { type TableDefinition } from '@withstudiocms/kysely/utils/migrator';
11
+ export declare const schemaDefinition: TableDefinition[];
12
+ export declare function up(db: Kysely<any>): Promise<void>;
13
+ export declare function down(db: Kysely<any>): Promise<void>;
@@ -0,0 +1,262 @@
1
+ import {
2
+ rollbackMigration,
3
+ syncDatabaseSchema
4
+ } from "@withstudiocms/kysely/utils/migrator";
5
+ import { schemaDefinition as previousSchema } from "./20251025T040912_init.js";
6
+ const schemaDefinition = [
7
+ {
8
+ name: "StudioCMSUsersTable",
9
+ columns: [
10
+ { name: "id", type: "text", primaryKey: true },
11
+ { name: "url", type: "text" },
12
+ { name: "name", type: "text", notNull: true },
13
+ { name: "email", type: "text" },
14
+ { name: "avatar", type: "text" },
15
+ { name: "username", type: "text", notNull: true },
16
+ { name: "password", type: "text" },
17
+ { name: "updatedAt", type: "text", notNull: true },
18
+ { name: "createdAt", type: "text", notNull: true, defaultSQL: "CURRENT_TIMESTAMP" },
19
+ { name: "emailVerified", type: "integer", notNull: true, default: 0 },
20
+ { name: "notifications", type: "text" }
21
+ ]
22
+ },
23
+ {
24
+ name: "StudioCMSOAuthAccounts",
25
+ columns: [
26
+ { name: "providerUserId", type: "text", notNull: true },
27
+ { name: "provider", type: "text", notNull: true },
28
+ {
29
+ name: "userId",
30
+ type: "text",
31
+ notNull: true,
32
+ references: { table: "StudioCMSUsersTable", column: "id" }
33
+ }
34
+ ]
35
+ },
36
+ {
37
+ name: "StudioCMSSessionTable",
38
+ columns: [
39
+ { name: "id", type: "text", primaryKey: true },
40
+ {
41
+ name: "userId",
42
+ type: "text",
43
+ notNull: true,
44
+ references: { table: "StudioCMSUsersTable", column: "id" }
45
+ },
46
+ { name: "expiresAt", type: "text", notNull: true }
47
+ ]
48
+ },
49
+ {
50
+ name: "StudioCMSPermissions",
51
+ columns: [
52
+ {
53
+ name: "user",
54
+ type: "text",
55
+ notNull: true,
56
+ references: { table: "StudioCMSUsersTable", column: "id" }
57
+ },
58
+ { name: "rank", type: "text", notNull: true }
59
+ ]
60
+ },
61
+ {
62
+ name: "StudioCMSAPIKeys",
63
+ columns: [
64
+ { name: "id", type: "text", primaryKey: true },
65
+ {
66
+ name: "userId",
67
+ type: "text",
68
+ notNull: true,
69
+ references: { table: "StudioCMSUsersTable", column: "id" }
70
+ },
71
+ { name: "key", type: "text", notNull: true },
72
+ { name: "creationDate", type: "text", notNull: true },
73
+ { name: "description", type: "text" }
74
+ ]
75
+ },
76
+ {
77
+ name: "StudioCMSUserResetTokens",
78
+ columns: [
79
+ { name: "id", type: "text", primaryKey: true },
80
+ {
81
+ name: "userId",
82
+ type: "text",
83
+ notNull: true,
84
+ references: { table: "StudioCMSUsersTable", column: "id" }
85
+ },
86
+ { name: "token", type: "text", notNull: true }
87
+ ]
88
+ },
89
+ {
90
+ name: "StudioCMSPageFolderStructure",
91
+ columns: [
92
+ { name: "id", type: "text", primaryKey: true },
93
+ { name: "name", type: "text", notNull: true },
94
+ { name: "parent", type: "text" }
95
+ ]
96
+ },
97
+ {
98
+ name: "StudioCMSPageData",
99
+ columns: [
100
+ { name: "id", type: "text", primaryKey: true },
101
+ { name: "package", type: "text", notNull: true },
102
+ { name: "title", type: "text", notNull: true },
103
+ { name: "description", type: "text", notNull: true },
104
+ { name: "showOnNav", type: "integer", notNull: true, default: 0 },
105
+ { name: "publishedAt", type: "text" },
106
+ { name: "updatedAt", type: "text", notNull: true },
107
+ { name: "slug", type: "text", notNull: true },
108
+ { name: "contentLang", type: "text", notNull: true },
109
+ { name: "heroImage", type: "text" },
110
+ { name: "categories", type: "text", notNull: true, default: JSON.stringify([]) },
111
+ { name: "tags", type: "text", notNull: true, default: JSON.stringify([]) },
112
+ { name: "authorId", type: "text", notNull: true },
113
+ { name: "contributorIds", type: "text", notNull: true, default: JSON.stringify([]) },
114
+ { name: "showAuthor", type: "integer", notNull: true, default: 0 },
115
+ { name: "showContributors", type: "integer", notNull: true, default: 0 },
116
+ { name: "parentFolder", type: "text" },
117
+ { name: "draft", type: "integer", notNull: true, default: 0 },
118
+ { name: "augments", type: "text", notNull: true, default: JSON.stringify([]) }
119
+ ]
120
+ },
121
+ {
122
+ name: "StudioCMSDiffTracking",
123
+ columns: [
124
+ { name: "id", type: "text", primaryKey: true },
125
+ {
126
+ name: "pageId",
127
+ type: "text",
128
+ notNull: true,
129
+ references: { table: "StudioCMSPageData", column: "id" }
130
+ },
131
+ {
132
+ name: "userId",
133
+ type: "text",
134
+ notNull: true,
135
+ references: { table: "StudioCMSUsersTable", column: "id" }
136
+ },
137
+ { name: "timestamp", type: "text", notNull: true },
138
+ { name: "pageMetaData", type: "text", notNull: true },
139
+ { name: "pageContentStart", type: "text", notNull: true },
140
+ { name: "diff", type: "text" }
141
+ ]
142
+ },
143
+ {
144
+ name: "StudioCMSPageDataTags",
145
+ columns: [
146
+ { name: "id", type: "integer", primaryKey: true },
147
+ { name: "description", type: "text", notNull: true },
148
+ { name: "name", type: "text", notNull: true },
149
+ { name: "slug", type: "text", notNull: true },
150
+ { name: "meta", type: "text", notNull: true }
151
+ ]
152
+ },
153
+ {
154
+ name: "StudioCMSPageDataCategories",
155
+ columns: [
156
+ { name: "id", type: "integer", primaryKey: true },
157
+ { name: "parent", type: "integer" },
158
+ { name: "description", type: "text", notNull: true },
159
+ { name: "name", type: "text", notNull: true },
160
+ { name: "slug", type: "text", notNull: true },
161
+ { name: "meta", type: "text", notNull: true }
162
+ ]
163
+ },
164
+ {
165
+ name: "StudioCMSPageContent",
166
+ columns: [
167
+ { name: "id", type: "text", primaryKey: true },
168
+ {
169
+ name: "contentId",
170
+ type: "text",
171
+ notNull: true,
172
+ references: { table: "StudioCMSPageData", column: "id" }
173
+ },
174
+ { name: "contentLang", type: "text", notNull: true },
175
+ { name: "content", type: "text", notNull: true }
176
+ ]
177
+ },
178
+ {
179
+ name: "StudioCMSEmailVerificationTokens",
180
+ columns: [
181
+ { name: "id", type: "text", primaryKey: true },
182
+ {
183
+ name: "userId",
184
+ type: "text",
185
+ notNull: true,
186
+ references: { table: "StudioCMSUsersTable", column: "id" }
187
+ },
188
+ { name: "token", type: "text", notNull: true },
189
+ { name: "expiresAt", type: "text", notNull: true }
190
+ ]
191
+ },
192
+ {
193
+ name: "StudioCMSPluginData",
194
+ columns: [
195
+ { name: "id", type: "text", primaryKey: true },
196
+ { name: "data", type: "text", notNull: true }
197
+ ]
198
+ },
199
+ {
200
+ name: "StudioCMSDynamicConfigSettings",
201
+ columns: [
202
+ { name: "id", type: "text", primaryKey: true },
203
+ { name: "data", type: "text", notNull: true }
204
+ ]
205
+ },
206
+ {
207
+ name: "StudioCMSSiteConfig",
208
+ deprecated: true,
209
+ columns: [
210
+ { name: "id", type: "text", primaryKey: true },
211
+ { name: "title", type: "text", notNull: true },
212
+ { name: "description", type: "text", notNull: true },
213
+ { name: "defaultOgImage", type: "text" },
214
+ { name: "siteIcon", type: "text" },
215
+ { name: "loginPageBackground", type: "text", notNull: true, default: "studiocms-curves" },
216
+ { name: "loginPageCustomImage", type: "text" },
217
+ { name: "enableDiffs", type: "integer", notNull: true, default: 0 },
218
+ { name: "diffPerPage", type: "integer", notNull: true, default: 10 },
219
+ { name: "gridItems", type: "text", notNull: true, default: JSON.stringify([]) },
220
+ { name: "enableMailer", type: "integer", notNull: true, default: 0 },
221
+ { name: "hideDefaultIndex", type: "integer", notNull: true, default: 0 }
222
+ ]
223
+ },
224
+ {
225
+ name: "StudioCMSMailerConfig",
226
+ deprecated: true,
227
+ columns: [
228
+ { name: "id", type: "text", primaryKey: true },
229
+ { name: "host", type: "text", notNull: true },
230
+ { name: "port", type: "integer", notNull: true },
231
+ { name: "secure", type: "integer", notNull: true, default: 0 },
232
+ { name: "proxy", type: "text" },
233
+ { name: "auth_user", type: "text" },
234
+ { name: "auth_password", type: "text" },
235
+ { name: "tls_rejectUnauthorized", type: "integer" },
236
+ { name: "tls_servername", type: "text" },
237
+ { name: "default_sender", type: "text", notNull: true }
238
+ ]
239
+ },
240
+ {
241
+ name: "StudioCMSNotificationSettings",
242
+ deprecated: true,
243
+ columns: [
244
+ { name: "id", type: "text", primaryKey: true },
245
+ { name: "emailVerification", type: "integer", notNull: true, default: 0 },
246
+ { name: "requireAdminVerification", type: "integer", notNull: true, default: 0 },
247
+ { name: "requireEditorVerification", type: "integer", notNull: true, default: 0 },
248
+ { name: "oAuthBypassVerification", type: "integer", notNull: true, default: 0 }
249
+ ]
250
+ }
251
+ ];
252
+ async function up(db) {
253
+ await syncDatabaseSchema(db, schemaDefinition, previousSchema);
254
+ }
255
+ async function down(db) {
256
+ await rollbackMigration(db, schemaDefinition, previousSchema);
257
+ }
258
+ export {
259
+ down,
260
+ schemaDefinition,
261
+ up
262
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * - Title: URL Mapping Table Migration
3
+ * - Created: 2025-12-21
4
+ * - Author: Adam Matthiesen
5
+ * - GitHub PR: #1085
6
+ * - Description: This migration creates the URL mapping table to manage URL mappings for the StudioCMS Storage Manager.
7
+ */
8
+ /** biome-ignore-all lint/suspicious/noExplicitAny: Requirement from Kysely */
9
+ import type { Kysely } from '@withstudiocms/kysely/kysely';
10
+ import { type TableDefinition } from '@withstudiocms/kysely/utils/migrator';
11
+ export declare const schemaDefinition: TableDefinition[];
12
+ export declare function up(db: Kysely<any>): Promise<void>;
13
+ export declare function down(db: Kysely<any>): Promise<void>;