@withstudiocms/sdk 0.0.0-beta.0 → 0.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +21 -0
- package/dist/cache.d.ts +109 -0
- package/dist/cache.js +94 -0
- package/dist/consts.d.ts +28 -0
- package/dist/consts.js +26 -0
- package/dist/context.d.ts +188 -0
- package/dist/context.js +33 -0
- package/dist/index.d.ts +1136 -0
- package/dist/index.js +24 -0
- package/dist/lib/diff.d.ts +39 -0
- package/dist/lib/diff.js +29 -0
- package/dist/lib/logger.d.ts +31 -0
- package/dist/lib/logger.js +131 -0
- package/dist/lib/pluginUtils.d.ts +221 -0
- package/dist/lib/pluginUtils.js +80 -0
- package/dist/modules/auth/index.d.ts +463 -0
- package/dist/modules/auth/index.js +412 -0
- package/dist/modules/clear/index.d.ts +72 -0
- package/dist/modules/clear/index.js +52 -0
- package/dist/modules/config/consts.d.ts +32 -0
- package/dist/modules/config/consts.js +18 -0
- package/dist/modules/config/index.d.ts +100 -0
- package/dist/modules/config/index.js +205 -0
- package/dist/modules/config/templates/mailer.d.ts +36 -0
- package/dist/modules/config/templates/mailer.js +218 -0
- package/dist/modules/config/type-utils.d.ts +13 -0
- package/dist/modules/config/type-utils.js +11 -0
- package/dist/modules/delete/index.d.ts +140 -0
- package/dist/modules/delete/index.js +274 -0
- package/dist/modules/diffTracking/index.d.ts +188 -0
- package/dist/modules/diffTracking/index.js +276 -0
- package/dist/modules/get/index.d.ts +272 -0
- package/dist/modules/get/index.js +466 -0
- package/dist/modules/index.d.ts +1003 -0
- package/dist/modules/index.js +37 -0
- package/dist/modules/init/index.d.ts +60 -0
- package/dist/modules/init/index.js +38 -0
- package/dist/modules/middleware/index.d.ts +56 -0
- package/dist/modules/middleware/index.js +50 -0
- package/dist/modules/notificationSettings/index.d.ts +57 -0
- package/dist/modules/notificationSettings/index.js +39 -0
- package/dist/modules/plugins/index.d.ts +166 -0
- package/dist/modules/plugins/index.js +261 -0
- package/dist/modules/post/index.d.ts +305 -0
- package/dist/modules/post/index.js +305 -0
- package/dist/modules/resetTokenBucket/index.d.ts +91 -0
- package/dist/modules/resetTokenBucket/index.js +93 -0
- package/dist/modules/rest_api/index.d.ts +92 -0
- package/dist/modules/rest_api/index.js +113 -0
- package/dist/modules/update/index.d.ts +184 -0
- package/dist/modules/update/index.js +174 -0
- package/dist/modules/util/collectors.d.ts +261 -0
- package/dist/modules/util/collectors.js +141 -0
- package/dist/modules/util/folderTree.d.ts +100 -0
- package/dist/modules/util/folderTree.js +176 -0
- package/dist/modules/util/generators.d.ts +83 -0
- package/dist/modules/util/generators.js +106 -0
- package/dist/modules/util/getFromNPM.d.ts +191 -0
- package/dist/modules/util/getFromNPM.js +100 -0
- package/dist/modules/util/index.d.ts +236 -0
- package/dist/modules/util/index.js +20 -0
- package/dist/modules/util/parsers.d.ts +60 -0
- package/dist/modules/util/parsers.js +43 -0
- package/dist/modules/util/slugify.d.ts +22 -0
- package/dist/modules/util/slugify.js +19 -0
- package/dist/modules/util/users.d.ts +99 -0
- package/dist/modules/util/users.js +78 -0
- package/dist/types.d.ts +360 -0
- package/dist/types.js +10 -0
- package/package.json +55 -7
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1136 @@
|
|
|
1
|
+
import { Deepmerge, Effect, Layer } from '@withstudiocms/effect';
|
|
2
|
+
import CacheService from './cache.js';
|
|
3
|
+
import { DBClientLive, type SDKContext } from './context.js';
|
|
4
|
+
export * from './context.js';
|
|
5
|
+
/**
|
|
6
|
+
* SDK Dependencies Layer
|
|
7
|
+
*/
|
|
8
|
+
export declare const SDKBaseDependencies: Layer.Layer<CacheService | Deepmerge, import("effect/ConfigError").ConfigError, import("./context.js").CacheStores>;
|
|
9
|
+
/**
|
|
10
|
+
* Extracts an Effect type without its requirements.
|
|
11
|
+
*
|
|
12
|
+
* @typeParam E - The Effect type to extract from.
|
|
13
|
+
*/
|
|
14
|
+
export type ExtractEffectWithoutRequirements<E> = E extends Effect.Effect<infer A, infer E2, infer _R> ? Effect.Effect<A, E2, never> : never;
|
|
15
|
+
/**
|
|
16
|
+
* StudioCMS SDK Core Layer
|
|
17
|
+
*/
|
|
18
|
+
export declare const StudioCMSSDKCore: Effect.Effect<{
|
|
19
|
+
AUTH: {
|
|
20
|
+
verifyEmail: {
|
|
21
|
+
get: (input: string) => Effect.Effect<{
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly userId: string;
|
|
24
|
+
readonly token: string;
|
|
25
|
+
readonly expiresAt: Date;
|
|
26
|
+
} | undefined, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
27
|
+
create: (userId: string) => Effect.Effect<{
|
|
28
|
+
readonly id: string;
|
|
29
|
+
readonly userId: string;
|
|
30
|
+
readonly token: string;
|
|
31
|
+
readonly expiresAt: Date;
|
|
32
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/generators.js").GeneratorError, never>;
|
|
33
|
+
delete: (input: string) => Effect.Effect<import("kysely").DeleteResult, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
34
|
+
};
|
|
35
|
+
oAuth: {
|
|
36
|
+
create: (input: {
|
|
37
|
+
readonly providerUserId: string;
|
|
38
|
+
readonly provider: string;
|
|
39
|
+
readonly userId: string;
|
|
40
|
+
}) => Effect.Effect<{
|
|
41
|
+
readonly providerUserId: string;
|
|
42
|
+
readonly provider: string;
|
|
43
|
+
readonly userId: string;
|
|
44
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
45
|
+
delete: (input: {
|
|
46
|
+
readonly userId: string;
|
|
47
|
+
readonly provider: string;
|
|
48
|
+
}) => import("./types.js").AuthDeletionResponse;
|
|
49
|
+
searchByProviderId: (input: {
|
|
50
|
+
readonly providerUserId: string;
|
|
51
|
+
readonly userId: string;
|
|
52
|
+
}) => Effect.Effect<{
|
|
53
|
+
readonly providerUserId: string;
|
|
54
|
+
readonly provider: string;
|
|
55
|
+
readonly userId: string;
|
|
56
|
+
} | undefined, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
57
|
+
searchProvidersForId: (input: {
|
|
58
|
+
readonly userId: string;
|
|
59
|
+
readonly providerId: string;
|
|
60
|
+
}) => Effect.Effect<{
|
|
61
|
+
readonly providerUserId: string;
|
|
62
|
+
readonly provider: string;
|
|
63
|
+
readonly userId: string;
|
|
64
|
+
} | undefined, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
65
|
+
};
|
|
66
|
+
permission: {
|
|
67
|
+
currentStatus: (input: string) => Effect.Effect<{
|
|
68
|
+
readonly user: string;
|
|
69
|
+
readonly rank: "owner" | "admin" | "editor" | "visitor" | "unknown";
|
|
70
|
+
} | undefined, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
71
|
+
};
|
|
72
|
+
session: {
|
|
73
|
+
create: (input: {
|
|
74
|
+
readonly id: string;
|
|
75
|
+
readonly userId: string;
|
|
76
|
+
readonly expiresAt: string;
|
|
77
|
+
}) => Effect.Effect<{
|
|
78
|
+
readonly id: string;
|
|
79
|
+
readonly userId: string;
|
|
80
|
+
readonly expiresAt: Date;
|
|
81
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
82
|
+
getById: (input: string) => Effect.Effect<{
|
|
83
|
+
readonly id: string;
|
|
84
|
+
readonly userId: string;
|
|
85
|
+
readonly expiresAt: Date;
|
|
86
|
+
} | undefined, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
87
|
+
sessionWithUser: (sessionId: string) => Effect.Effect<{
|
|
88
|
+
session: {
|
|
89
|
+
readonly id: string;
|
|
90
|
+
readonly userId: string;
|
|
91
|
+
readonly expiresAt: Date;
|
|
92
|
+
};
|
|
93
|
+
user: {
|
|
94
|
+
readonly name: string;
|
|
95
|
+
readonly id: string;
|
|
96
|
+
readonly url: string | null | undefined;
|
|
97
|
+
readonly email: string | null | undefined;
|
|
98
|
+
readonly avatar: string | null | undefined;
|
|
99
|
+
readonly username: string;
|
|
100
|
+
readonly password: string | null | undefined;
|
|
101
|
+
readonly updatedAt: Date;
|
|
102
|
+
readonly createdAt: Date;
|
|
103
|
+
readonly emailVerified: boolean;
|
|
104
|
+
readonly notifications: string | null | undefined;
|
|
105
|
+
};
|
|
106
|
+
} | undefined, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
107
|
+
delete: (input: string) => import("./types.js").AuthDeletionResponse;
|
|
108
|
+
update: (input: {
|
|
109
|
+
readonly id: string;
|
|
110
|
+
readonly newDate: {
|
|
111
|
+
toString: {};
|
|
112
|
+
toDateString: {};
|
|
113
|
+
toTimeString: {};
|
|
114
|
+
toLocaleString: {};
|
|
115
|
+
toLocaleDateString: {};
|
|
116
|
+
toLocaleTimeString: {};
|
|
117
|
+
valueOf: {};
|
|
118
|
+
getTime: {};
|
|
119
|
+
getFullYear: {};
|
|
120
|
+
getUTCFullYear: {};
|
|
121
|
+
getMonth: {};
|
|
122
|
+
getUTCMonth: {};
|
|
123
|
+
getDate: {};
|
|
124
|
+
getUTCDate: {};
|
|
125
|
+
getDay: {};
|
|
126
|
+
getUTCDay: {};
|
|
127
|
+
getHours: {};
|
|
128
|
+
getUTCHours: {};
|
|
129
|
+
getMinutes: {};
|
|
130
|
+
getUTCMinutes: {};
|
|
131
|
+
getSeconds: {};
|
|
132
|
+
getUTCSeconds: {};
|
|
133
|
+
getMilliseconds: {};
|
|
134
|
+
getUTCMilliseconds: {};
|
|
135
|
+
getTimezoneOffset: {};
|
|
136
|
+
setTime: {};
|
|
137
|
+
setMilliseconds: {};
|
|
138
|
+
setUTCMilliseconds: {};
|
|
139
|
+
setSeconds: {};
|
|
140
|
+
setUTCSeconds: {};
|
|
141
|
+
setMinutes: {};
|
|
142
|
+
setUTCMinutes: {};
|
|
143
|
+
setHours: {};
|
|
144
|
+
setUTCHours: {};
|
|
145
|
+
setDate: {};
|
|
146
|
+
setUTCDate: {};
|
|
147
|
+
setMonth: {};
|
|
148
|
+
setUTCMonth: {};
|
|
149
|
+
setFullYear: {};
|
|
150
|
+
setUTCFullYear: {};
|
|
151
|
+
toUTCString: {};
|
|
152
|
+
toISOString: {};
|
|
153
|
+
toJSON: {};
|
|
154
|
+
getVarDate: {};
|
|
155
|
+
[Symbol.toPrimitive]: {};
|
|
156
|
+
};
|
|
157
|
+
}) => Effect.Effect<{
|
|
158
|
+
readonly id: string;
|
|
159
|
+
readonly userId: string;
|
|
160
|
+
readonly expiresAt: Date;
|
|
161
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
162
|
+
};
|
|
163
|
+
user: {
|
|
164
|
+
create: (userData: {
|
|
165
|
+
readonly name: string;
|
|
166
|
+
readonly id: string;
|
|
167
|
+
readonly url: string | null | undefined;
|
|
168
|
+
readonly email: string | null | undefined;
|
|
169
|
+
readonly avatar: string | null | undefined;
|
|
170
|
+
readonly username: string;
|
|
171
|
+
readonly password: string | null | undefined;
|
|
172
|
+
readonly updatedAt: string;
|
|
173
|
+
readonly createdAt: string | undefined;
|
|
174
|
+
readonly emailVerified: boolean;
|
|
175
|
+
readonly notifications: string | null | undefined;
|
|
176
|
+
}, rank: "owner" | "admin" | "editor" | "visitor" | "unknown") => Effect.Effect<{
|
|
177
|
+
readonly name: string;
|
|
178
|
+
readonly id: string;
|
|
179
|
+
readonly url: string | null | undefined;
|
|
180
|
+
readonly email: string | null | undefined;
|
|
181
|
+
readonly avatar: string | null | undefined;
|
|
182
|
+
readonly username: string;
|
|
183
|
+
readonly password: string | null | undefined;
|
|
184
|
+
readonly updatedAt: Date;
|
|
185
|
+
readonly createdAt: Date;
|
|
186
|
+
readonly emailVerified: boolean;
|
|
187
|
+
readonly notifications: string | null | undefined;
|
|
188
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
189
|
+
update: (input: {
|
|
190
|
+
readonly userId: string;
|
|
191
|
+
readonly userData: {
|
|
192
|
+
readonly url?: string | null | undefined;
|
|
193
|
+
readonly email?: string | null | undefined;
|
|
194
|
+
readonly avatar?: string | null | undefined;
|
|
195
|
+
readonly password?: string | null | undefined;
|
|
196
|
+
readonly notifications?: string | null | undefined;
|
|
197
|
+
readonly name: string;
|
|
198
|
+
readonly id: string;
|
|
199
|
+
readonly username: string;
|
|
200
|
+
readonly updatedAt: string;
|
|
201
|
+
readonly emailVerified: boolean;
|
|
202
|
+
};
|
|
203
|
+
}) => Effect.Effect<{
|
|
204
|
+
readonly name: string;
|
|
205
|
+
readonly id: string;
|
|
206
|
+
readonly url: string | null | undefined;
|
|
207
|
+
readonly email: string | null | undefined;
|
|
208
|
+
readonly avatar: string | null | undefined;
|
|
209
|
+
readonly username: string;
|
|
210
|
+
readonly password: string | null | undefined;
|
|
211
|
+
readonly updatedAt: Date;
|
|
212
|
+
readonly createdAt: Date;
|
|
213
|
+
readonly emailVerified: boolean;
|
|
214
|
+
readonly notifications: string | null | undefined;
|
|
215
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
216
|
+
searchUsersForUsernameOrEmail: (username?: string | undefined, email?: string | undefined) => Effect.Effect<{
|
|
217
|
+
usernameSearch: {
|
|
218
|
+
readonly name: string;
|
|
219
|
+
readonly id: string;
|
|
220
|
+
readonly url: string | null | undefined;
|
|
221
|
+
readonly email: string | null | undefined;
|
|
222
|
+
readonly avatar: string | null | undefined;
|
|
223
|
+
readonly username: string;
|
|
224
|
+
readonly password: string | null | undefined;
|
|
225
|
+
readonly updatedAt: Date;
|
|
226
|
+
readonly createdAt: Date;
|
|
227
|
+
readonly emailVerified: boolean;
|
|
228
|
+
readonly notifications: string | null | undefined;
|
|
229
|
+
}[];
|
|
230
|
+
emailSearch: {
|
|
231
|
+
readonly name: string;
|
|
232
|
+
readonly id: string;
|
|
233
|
+
readonly url: string | null | undefined;
|
|
234
|
+
readonly email: string | null | undefined;
|
|
235
|
+
readonly avatar: string | null | undefined;
|
|
236
|
+
readonly username: string;
|
|
237
|
+
readonly password: string | null | undefined;
|
|
238
|
+
readonly updatedAt: Date;
|
|
239
|
+
readonly createdAt: Date;
|
|
240
|
+
readonly emailVerified: boolean;
|
|
241
|
+
readonly notifications: string | null | undefined;
|
|
242
|
+
}[];
|
|
243
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
244
|
+
ghost: {
|
|
245
|
+
verifyExists: () => Effect.Effect<boolean, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
246
|
+
create: () => Effect.Effect<{
|
|
247
|
+
readonly name: string;
|
|
248
|
+
readonly id: string;
|
|
249
|
+
readonly url: string | null | undefined;
|
|
250
|
+
readonly email: string | null | undefined;
|
|
251
|
+
readonly avatar: string | null | undefined;
|
|
252
|
+
readonly username: string;
|
|
253
|
+
readonly password: string | null | undefined;
|
|
254
|
+
readonly updatedAt: Date;
|
|
255
|
+
readonly createdAt: Date;
|
|
256
|
+
readonly emailVerified: boolean;
|
|
257
|
+
readonly notifications: string | null | undefined;
|
|
258
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
259
|
+
get: () => Effect.Effect<{
|
|
260
|
+
readonly name: string;
|
|
261
|
+
readonly id: string;
|
|
262
|
+
readonly url: string | null | undefined;
|
|
263
|
+
readonly email: string | null | undefined;
|
|
264
|
+
readonly avatar: string | null | undefined;
|
|
265
|
+
readonly username: string;
|
|
266
|
+
readonly password: string | null | undefined;
|
|
267
|
+
readonly updatedAt: Date;
|
|
268
|
+
readonly createdAt: Date;
|
|
269
|
+
readonly emailVerified: boolean;
|
|
270
|
+
readonly notifications: string | null | undefined;
|
|
271
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
CLEAR: {
|
|
276
|
+
page: {
|
|
277
|
+
byId: (id: string) => Effect.Effect<void, never, never>;
|
|
278
|
+
};
|
|
279
|
+
pages: Effect.Effect<void, never, never>;
|
|
280
|
+
latestVersion: Effect.Effect<void, never, never>;
|
|
281
|
+
folderTree: Effect.Effect<void, never, never>;
|
|
282
|
+
folderList: Effect.Effect<void, never, never>;
|
|
283
|
+
};
|
|
284
|
+
CONFIG: {
|
|
285
|
+
siteConfig: {
|
|
286
|
+
get: () => Effect.Effect<import("./types.js").DynamicConfigEntry<import("./types.js").StudioCMSSiteConfig> | undefined, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
287
|
+
update: (data: import("./types.js").ConfigFinal<import("./types.js").StudioCMSSiteConfig>) => Effect.Effect<import("./types.js").DynamicConfigEntry<import("./types.js").StudioCMSSiteConfig>, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
288
|
+
init: (data: import("./types.js").ConfigFinal<import("./types.js").StudioCMSSiteConfig>) => Effect.Effect<import("./types.js").DynamicConfigEntry<import("./types.js").StudioCMSSiteConfig>, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
289
|
+
};
|
|
290
|
+
mailerConfig: {
|
|
291
|
+
get: () => Effect.Effect<import("./types.js").DynamicConfigEntry<import("./types.js").StudioCMSMailerConfig> | undefined, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
292
|
+
update: (data: import("./types.js").ConfigFinal<import("./types.js").StudioCMSMailerConfig>) => Effect.Effect<import("./types.js").DynamicConfigEntry<import("./types.js").StudioCMSMailerConfig>, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
293
|
+
init: (data: import("./types.js").ConfigFinal<import("./types.js").StudioCMSMailerConfig>) => Effect.Effect<import("./types.js").DynamicConfigEntry<import("./types.js").StudioCMSMailerConfig>, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
294
|
+
};
|
|
295
|
+
notificationConfig: {
|
|
296
|
+
get: () => Effect.Effect<import("./types.js").DynamicConfigEntry<import("./types.js").StudioCMSNotificationSettings> | undefined, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
297
|
+
update: (data: import("./types.js").ConfigFinal<import("./types.js").StudioCMSNotificationSettings>) => Effect.Effect<import("./types.js").DynamicConfigEntry<import("./types.js").StudioCMSNotificationSettings>, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
298
|
+
init: (data: import("./types.js").ConfigFinal<import("./types.js").StudioCMSNotificationSettings>) => Effect.Effect<import("./types.js").DynamicConfigEntry<import("./types.js").StudioCMSNotificationSettings>, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
299
|
+
};
|
|
300
|
+
templateConfig: {
|
|
301
|
+
get: () => Effect.Effect<import("./types.js").DynamicConfigEntry<import("./types.js").StudioCMSTemplateConfig> | undefined, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
302
|
+
update: (data: import("./types.js").ConfigFinal<import("./types.js").StudioCMSTemplateConfig>) => Effect.Effect<import("./types.js").DynamicConfigEntry<import("./types.js").StudioCMSTemplateConfig>, Error, never>;
|
|
303
|
+
init: (data: import("./types.js").ConfigFinal<import("./types.js").StudioCMSTemplateConfig>) => Effect.Effect<import("./types.js").DynamicConfigEntry<import("./types.js").StudioCMSTemplateConfig>, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
DELETE: {
|
|
307
|
+
page: (id: string) => Effect.Effect<{
|
|
308
|
+
status: "success" | "error";
|
|
309
|
+
message: string;
|
|
310
|
+
}, never, never>;
|
|
311
|
+
pageContent: (id: string) => Effect.Effect<{
|
|
312
|
+
status: "success" | "error";
|
|
313
|
+
message: string;
|
|
314
|
+
}, never, never>;
|
|
315
|
+
pageContentLang: (id: string, lang: string) => Effect.Effect<{
|
|
316
|
+
status: "success" | "error";
|
|
317
|
+
message: string;
|
|
318
|
+
}, never, never>;
|
|
319
|
+
tags: (id: number) => Effect.Effect<{
|
|
320
|
+
status: "success" | "error";
|
|
321
|
+
message: string;
|
|
322
|
+
}, never, never>;
|
|
323
|
+
categories: (id: number) => Effect.Effect<{
|
|
324
|
+
status: "success" | "error";
|
|
325
|
+
message: string;
|
|
326
|
+
}, never, never>;
|
|
327
|
+
permissions: (userId: string) => Effect.Effect<{
|
|
328
|
+
status: "success" | "error";
|
|
329
|
+
message: string;
|
|
330
|
+
}, never, never>;
|
|
331
|
+
diffTracking: (id: string) => Effect.Effect<{
|
|
332
|
+
status: "success" | "error";
|
|
333
|
+
message: string;
|
|
334
|
+
}, never, never>;
|
|
335
|
+
folder: (folderId: string) => Effect.Effect<{
|
|
336
|
+
status: "success" | "error";
|
|
337
|
+
message: string;
|
|
338
|
+
}, never, never>;
|
|
339
|
+
user: (userId: string) => Effect.Effect<{
|
|
340
|
+
status: "success" | "error";
|
|
341
|
+
message: string;
|
|
342
|
+
}, never, never>;
|
|
343
|
+
};
|
|
344
|
+
diffTracking: {
|
|
345
|
+
insert: (userId: string, pageId: string, data: {
|
|
346
|
+
content: {
|
|
347
|
+
start: string;
|
|
348
|
+
end: string;
|
|
349
|
+
};
|
|
350
|
+
metaData: {
|
|
351
|
+
start: Partial<import("./types.js").tsPageDataSelect>;
|
|
352
|
+
end: Partial<import("./types.js").tsPageDataSelect>;
|
|
353
|
+
};
|
|
354
|
+
}, diffLength: number) => Effect.Effect<import("./types.js").diffReturn, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/parsers.js").ParsersError | import("./lib/diff.js").DiffError, never>;
|
|
355
|
+
clear: (input: string) => Effect.Effect<import("kysely").DeleteResult[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
356
|
+
get: {
|
|
357
|
+
byPageId: {
|
|
358
|
+
all: (pageId: string) => Effect.Effect<import("./types.js").diffReturn[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/parsers.js").ParsersError, never>;
|
|
359
|
+
latest: (pageId: string, count: number) => Effect.Effect<import("./types.js").diffReturn[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/parsers.js").ParsersError, never>;
|
|
360
|
+
};
|
|
361
|
+
byUserId: {
|
|
362
|
+
all: (userId: string) => Effect.Effect<import("./types.js").diffReturn[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/parsers.js").ParsersError, never>;
|
|
363
|
+
latest: (userId: string, count: number) => Effect.Effect<import("./types.js").diffReturn[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/parsers.js").ParsersError, never>;
|
|
364
|
+
};
|
|
365
|
+
single: (diffId: string) => Effect.Effect<import("./types.js").diffReturn | undefined, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/parsers.js").ParsersError, never>;
|
|
366
|
+
};
|
|
367
|
+
revertToDiff: (id: string, type: "data" | "content" | "both") => Effect.Effect<import("./types.js").diffReturn, import("effect/ParseResult").ParseError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/parsers.js").ParsersError | import("./modules/diffTracking/index.js").DiffTrackingError, never>;
|
|
368
|
+
utils: {
|
|
369
|
+
getMetaDataDifferences: <T extends Record<string, unknown>>(obj1: T, obj2: T) => Effect.Effect<{
|
|
370
|
+
label: string;
|
|
371
|
+
previous: unknown;
|
|
372
|
+
current: unknown;
|
|
373
|
+
}[], never, never>;
|
|
374
|
+
getDiffHTML: (diff: string, options?: import("diff2html").Diff2HtmlConfig | undefined) => Effect.Effect<string, import("./lib/diff.js").DiffError, never>;
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
GET: {
|
|
378
|
+
permissionsLists: {
|
|
379
|
+
owners: () => Effect.Effect<import("./types.js").SingleRank[], import("./modules/util/users.js").UsersError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
380
|
+
admins: () => Effect.Effect<import("./types.js").SingleRank[], import("./modules/util/users.js").UsersError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
381
|
+
editors: () => Effect.Effect<import("./types.js").SingleRank[], import("./modules/util/users.js").UsersError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
382
|
+
visitors: () => Effect.Effect<import("./types.js").SingleRank[], import("./modules/util/users.js").UsersError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
383
|
+
all: () => Effect.Effect<import("./types.js").CombinedRank[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/users.js").UsersError, never>;
|
|
384
|
+
};
|
|
385
|
+
users: {
|
|
386
|
+
all: () => Effect.Effect<import("./types.js").CombinedUserData[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
387
|
+
byId: (userId: string) => Effect.Effect<import("./types.js").CombinedUserData | undefined, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
388
|
+
byUsername: (username: string) => Effect.Effect<import("./types.js").CombinedUserData | undefined, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
389
|
+
byEmail: (email: string) => Effect.Effect<import("./types.js").CombinedUserData | undefined, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
390
|
+
};
|
|
391
|
+
folder: (folderId: string) => Effect.Effect<{
|
|
392
|
+
readonly name: string;
|
|
393
|
+
readonly id: string;
|
|
394
|
+
readonly parent: string | null | undefined;
|
|
395
|
+
} | undefined, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
396
|
+
folderTree: () => Effect.Effect<import("./types.js").FolderNode[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/folderTree.js").FolderTreeError, never>;
|
|
397
|
+
folderList: () => Effect.Effect<import("./types.js").FolderListItem[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
398
|
+
siteConfig: () => Effect.Effect<import("./types.js").DynamicConfigEntry<import("./types.js").StudioCMSSiteConfig> | undefined, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
399
|
+
latestVersion: () => Effect.Effect<{
|
|
400
|
+
version: string;
|
|
401
|
+
lastCacheUpdate: Date;
|
|
402
|
+
}, import("effect/Cause").UnknownException | Error | import("effect/ParseResult").ParseError, never>;
|
|
403
|
+
pages: {
|
|
404
|
+
(includeDrafts?: boolean, hideDefaultIndex?: boolean, metaOnly?: false, paginate?: import("./modules/get/index.js").PaginateInput): Effect.Effect<import("./types.js").CombinedPageData[], import("effect/ParseResult").ParseError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/folderTree.js").FolderTreeError | import("./modules/util/collectors.js").CollectorError | import("./modules/get/index.js").PaginateError, never>;
|
|
405
|
+
(includeDrafts?: boolean, hideDefaultIndex?: boolean, metaOnly?: true, paginate?: import("./modules/get/index.js").PaginateInput): Effect.Effect<import("./types.js").MetaOnlyPageData[], import("effect/ParseResult").ParseError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/folderTree.js").FolderTreeError | import("./modules/util/collectors.js").CollectorError | import("./modules/get/index.js").PaginateError, never>;
|
|
406
|
+
};
|
|
407
|
+
page: {
|
|
408
|
+
byId: {
|
|
409
|
+
(id: string): Effect.Effect<import("./types.js").CombinedPageData | undefined, import("effect/ParseResult").ParseError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/folderTree.js").FolderTreeError | import("./modules/util/collectors.js").CollectorError | import("./modules/get/index.js").PaginateError, never>;
|
|
410
|
+
(id: string, metaOnly?: boolean): Effect.Effect<import("./types.js").MetaOnlyPageData | undefined, import("effect/ParseResult").ParseError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/folderTree.js").FolderTreeError | import("./modules/util/collectors.js").CollectorError | import("./modules/get/index.js").PaginateError, never>;
|
|
411
|
+
};
|
|
412
|
+
bySlug: {
|
|
413
|
+
(slug: string): Effect.Effect<import("./types.js").CombinedPageData | undefined, import("effect/ParseResult").ParseError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/folderTree.js").FolderTreeError | import("./modules/util/collectors.js").CollectorError | import("./modules/get/index.js").PaginateError, never>;
|
|
414
|
+
(slug: string, metaOnly?: boolean): Effect.Effect<import("./types.js").MetaOnlyPageData | undefined, import("effect/ParseResult").ParseError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/folderTree.js").FolderTreeError | import("./modules/util/collectors.js").CollectorError | import("./modules/get/index.js").PaginateError, never>;
|
|
415
|
+
};
|
|
416
|
+
};
|
|
417
|
+
packagePages: {
|
|
418
|
+
(packageName: string): Effect.Effect<import("./types.js").CombinedPageData[], import("effect/ParseResult").ParseError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/folderTree.js").FolderTreeError | import("./modules/util/collectors.js").CollectorError | import("./modules/get/index.js").PaginateError, never>;
|
|
419
|
+
(packageName: string, metaOnly?: boolean): Effect.Effect<import("./types.js").MetaOnlyPageData[], import("effect/ParseResult").ParseError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/folderTree.js").FolderTreeError | import("./modules/util/collectors.js").CollectorError | import("./modules/get/index.js").PaginateError, never>;
|
|
420
|
+
};
|
|
421
|
+
folderPages: {
|
|
422
|
+
(idOrName: string, includeDrafts?: boolean, hideDefaultIndex?: boolean, metaOnly?: false, paginate?: import("./modules/get/index.js").PaginateInput): Effect.Effect<import("./types.js").CombinedPageData[], import("effect/ParseResult").ParseError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/folderTree.js").FolderTreeError | import("./modules/util/collectors.js").CollectorError | import("./modules/get/index.js").PaginateError, never>;
|
|
423
|
+
(idOrName: string, includeDrafts?: boolean, hideDefaultIndex?: boolean, metaOnly?: true, paginate?: import("./modules/get/index.js").PaginateInput): Effect.Effect<import("./types.js").MetaOnlyPageData[], import("effect/ParseResult").ParseError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/folderTree.js").FolderTreeError | import("./modules/util/collectors.js").CollectorError | import("./modules/get/index.js").PaginateError, never>;
|
|
424
|
+
};
|
|
425
|
+
pageFolderTree: (hideDefaultIndex?: boolean) => Effect.Effect<import("./types.js").FolderNode[], import("effect/ParseResult").ParseError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").QueryParseError | import("@withstudiocms/kysely/core/errors").QueryError | import("@withstudiocms/kysely/core/errors").NotFoundError | import("./modules/util/folderTree.js").FolderTreeError | import("./modules/util/collectors.js").CollectorError | import("./modules/get/index.js").PaginateError, never>;
|
|
426
|
+
};
|
|
427
|
+
INIT: {
|
|
428
|
+
siteConfig: (data: import("./types.js").ConfigFinal<import("./types.js").StudioCMSSiteConfig>) => Effect.Effect<import("./types.js").DynamicConfigEntry<import("./types.js").StudioCMSSiteConfig>, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
429
|
+
ghostUser: () => Effect.Effect<{
|
|
430
|
+
readonly name: string;
|
|
431
|
+
readonly id: string;
|
|
432
|
+
readonly url: string | null | undefined;
|
|
433
|
+
readonly email: string | null | undefined;
|
|
434
|
+
readonly avatar: string | null | undefined;
|
|
435
|
+
readonly username: string;
|
|
436
|
+
readonly password: string | null | undefined;
|
|
437
|
+
readonly updatedAt: Date;
|
|
438
|
+
readonly createdAt: Date;
|
|
439
|
+
readonly emailVerified: boolean;
|
|
440
|
+
readonly notifications: string | null | undefined;
|
|
441
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
442
|
+
};
|
|
443
|
+
MIDDLEWARES: {
|
|
444
|
+
verifyCache: () => Effect.Effect<void, import("effect/ParseResult").ParseError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").QueryParseError | import("@withstudiocms/kysely/core/errors").QueryError | import("@withstudiocms/kysely/core/errors").NotFoundError | import("./modules/util/folderTree.js").FolderTreeError | import("./modules/util/collectors.js").CollectorError | import("./modules/get/index.js").PaginateError, never>;
|
|
445
|
+
};
|
|
446
|
+
notificationSettings: {
|
|
447
|
+
site: {
|
|
448
|
+
get: () => Effect.Effect<import("./types.js").DynamicConfigEntry<import("./types.js").StudioCMSNotificationSettings>, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
449
|
+
update: (settings: Omit<import("./types.js").StudioCMSNotificationSettings, "_config_version">) => Effect.Effect<import("./types.js").DynamicConfigEntry<import("./types.js").StudioCMSNotificationSettings>, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
450
|
+
};
|
|
451
|
+
};
|
|
452
|
+
PLUGINS: {
|
|
453
|
+
usePluginData: {
|
|
454
|
+
<T extends import("effect/Schema").Struct<import("effect/Schema").Struct.Fields> | object, R extends object = T extends import("effect/Schema").Struct<any> ? import("./types.js").RecursiveSimplifyMutable<T["Type"]> : T>(pluginId: string, opts?: import("./types.js").UsePluginDataOptsBase<T>): {
|
|
455
|
+
getEntries: (filter?: (data: import("./types.js").PluginDataEntry<R>[]) => import("./types.js").PluginDataEntry<R>[]) => Effect.Effect<import("./types.js").PluginDataEntry<R>[], Error, never>;
|
|
456
|
+
getEntry: (id: string) => {
|
|
457
|
+
generatedId: () => Effect.Effect<string, never, never>;
|
|
458
|
+
select: () => Effect.Effect<import("./types.js").PluginDataEntry<R> | undefined, Error, never>;
|
|
459
|
+
insert: (data: R) => Effect.Effect<import("./types.js").PluginDataEntry<R>, Error, never>;
|
|
460
|
+
update: (data: R) => Effect.Effect<import("./types.js").PluginDataEntry<R>, Error, never>;
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
<T extends import("effect/Schema").Struct<import("effect/Schema").Struct.Fields> | object, R extends object = T extends import("effect/Schema").Struct<any> ? import("./types.js").RecursiveSimplifyMutable<T["Type"]> : T>(pluginId: string, opts?: import("./types.js").UsePluginDataOpts<T>): {
|
|
464
|
+
generatedId: () => Effect.Effect<string, never, never>;
|
|
465
|
+
select: () => Effect.Effect<import("./types.js").PluginDataEntry<R> | undefined, Error, never>;
|
|
466
|
+
insert: (data: R) => Effect.Effect<import("./types.js").PluginDataEntry<R>, Error, never>;
|
|
467
|
+
update: (data: R) => Effect.Effect<import("./types.js").PluginDataEntry<R>, Error, never>;
|
|
468
|
+
};
|
|
469
|
+
};
|
|
470
|
+
initPluginDataCache: (BATCH_SIZE?: number | undefined) => Effect.Effect<void, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
471
|
+
clearPluginDataCache: () => Effect.Effect<void, never, never>;
|
|
472
|
+
InferType: {
|
|
473
|
+
new <S extends import("effect/Schema").Struct<any>, R = import("./types.js").RecursiveSimplifyMutable<S["Type"]>>(schema: S): {
|
|
474
|
+
readonly _Schema: S;
|
|
475
|
+
readonly $UsePluginData: S;
|
|
476
|
+
readonly $Insert: R;
|
|
477
|
+
};
|
|
478
|
+
};
|
|
479
|
+
};
|
|
480
|
+
POST: {
|
|
481
|
+
databaseEntry: {
|
|
482
|
+
pages: (pageData: import("./modules/post/index.js").OptionalId<string, {
|
|
483
|
+
readonly tags: string;
|
|
484
|
+
readonly id: string;
|
|
485
|
+
readonly description: string;
|
|
486
|
+
readonly slug: string;
|
|
487
|
+
readonly contentLang: string;
|
|
488
|
+
readonly updatedAt: string;
|
|
489
|
+
readonly package: string;
|
|
490
|
+
readonly title: string;
|
|
491
|
+
readonly showOnNav: boolean;
|
|
492
|
+
readonly publishedAt: string;
|
|
493
|
+
readonly heroImage: string | null | undefined;
|
|
494
|
+
readonly categories: string;
|
|
495
|
+
readonly authorId: string;
|
|
496
|
+
readonly contributorIds: string;
|
|
497
|
+
readonly showAuthor: boolean;
|
|
498
|
+
readonly showContributors: boolean;
|
|
499
|
+
readonly parentFolder: string | null | undefined;
|
|
500
|
+
readonly draft: boolean;
|
|
501
|
+
readonly augments: string;
|
|
502
|
+
}>, pageContent: import("./types.js").CombinedInsertContent) => Effect.Effect<{
|
|
503
|
+
pageData: {
|
|
504
|
+
readonly id: string;
|
|
505
|
+
};
|
|
506
|
+
pageContent: {
|
|
507
|
+
readonly id: string;
|
|
508
|
+
};
|
|
509
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
510
|
+
pageContent: (input: {
|
|
511
|
+
readonly id: string;
|
|
512
|
+
readonly contentId: string;
|
|
513
|
+
readonly contentLang: string;
|
|
514
|
+
readonly content: string;
|
|
515
|
+
}) => Effect.Effect<{
|
|
516
|
+
readonly id: string;
|
|
517
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
518
|
+
tags: (tag: import("./modules/post/index.js").OptionalId<number, {
|
|
519
|
+
readonly name: string;
|
|
520
|
+
readonly id: number;
|
|
521
|
+
readonly description: string;
|
|
522
|
+
readonly slug: string;
|
|
523
|
+
readonly meta: string;
|
|
524
|
+
}>) => Effect.Effect<{
|
|
525
|
+
readonly id: number;
|
|
526
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/generators.js").GeneratorError, never>;
|
|
527
|
+
categories: (category: import("./modules/post/index.js").OptionalId<number, {
|
|
528
|
+
readonly name: string;
|
|
529
|
+
readonly id: number;
|
|
530
|
+
readonly parent: number | null | undefined;
|
|
531
|
+
readonly description: string;
|
|
532
|
+
readonly slug: string;
|
|
533
|
+
readonly meta: string;
|
|
534
|
+
}>) => Effect.Effect<{
|
|
535
|
+
readonly id: number;
|
|
536
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/generators.js").GeneratorError, never>;
|
|
537
|
+
permissions: (userId: string, rank: "owner" | "admin" | "editor" | "visitor" | "unknown") => Effect.Effect<{
|
|
538
|
+
readonly user: string;
|
|
539
|
+
readonly rank: "owner" | "admin" | "editor" | "visitor" | "unknown";
|
|
540
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
541
|
+
diffTracking: (data: import("./modules/post/index.js").OptionalId<string, {
|
|
542
|
+
readonly id: string;
|
|
543
|
+
readonly userId: string;
|
|
544
|
+
readonly pageMetaData: string;
|
|
545
|
+
readonly pageId: string;
|
|
546
|
+
readonly timestamp: string | undefined;
|
|
547
|
+
readonly pageContentStart: string;
|
|
548
|
+
readonly diff: string | null | undefined;
|
|
549
|
+
}>) => Effect.Effect<{
|
|
550
|
+
readonly id: string;
|
|
551
|
+
readonly userId: string;
|
|
552
|
+
readonly pageMetaData: {
|
|
553
|
+
readonly [x: string]: unknown;
|
|
554
|
+
};
|
|
555
|
+
readonly pageId: string;
|
|
556
|
+
readonly timestamp: Date;
|
|
557
|
+
readonly pageContentStart: string;
|
|
558
|
+
readonly diff: string | null | undefined;
|
|
559
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
560
|
+
folder: (data: import("./modules/post/index.js").OptionalId<string, {
|
|
561
|
+
readonly name: string;
|
|
562
|
+
readonly id: string;
|
|
563
|
+
readonly parent: string | null | undefined;
|
|
564
|
+
}>) => Effect.Effect<{
|
|
565
|
+
readonly name: string;
|
|
566
|
+
readonly id: string;
|
|
567
|
+
readonly parent: string | null | undefined;
|
|
568
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
569
|
+
};
|
|
570
|
+
databaseEntries: {
|
|
571
|
+
tags: (tags: import("./modules/post/index.js").OptionalId<number, {
|
|
572
|
+
readonly name: string;
|
|
573
|
+
readonly id: number;
|
|
574
|
+
readonly description: string;
|
|
575
|
+
readonly slug: string;
|
|
576
|
+
readonly meta: string;
|
|
577
|
+
}>[]) => Effect.Effect<{
|
|
578
|
+
readonly id: number;
|
|
579
|
+
}[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/generators.js").GeneratorError, never>;
|
|
580
|
+
categories: (categories: import("./modules/post/index.js").OptionalId<number, {
|
|
581
|
+
readonly name: string;
|
|
582
|
+
readonly id: number;
|
|
583
|
+
readonly parent: number | null | undefined;
|
|
584
|
+
readonly description: string;
|
|
585
|
+
readonly slug: string;
|
|
586
|
+
readonly meta: string;
|
|
587
|
+
}>[]) => Effect.Effect<{
|
|
588
|
+
readonly id: number;
|
|
589
|
+
}[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/generators.js").GeneratorError, never>;
|
|
590
|
+
permissions: (permissions: {
|
|
591
|
+
userId: string;
|
|
592
|
+
rank: "owner" | "admin" | "editor" | "visitor" | "unknown";
|
|
593
|
+
}[]) => Effect.Effect<{
|
|
594
|
+
readonly user: string;
|
|
595
|
+
readonly rank: "owner" | "admin" | "editor" | "visitor" | "unknown";
|
|
596
|
+
}[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
597
|
+
pages: (pages: import("./modules/post/index.js").MultiPageInsert) => Effect.Effect<{
|
|
598
|
+
pageData: {
|
|
599
|
+
readonly id: string;
|
|
600
|
+
};
|
|
601
|
+
pageContent: {
|
|
602
|
+
readonly id: string;
|
|
603
|
+
};
|
|
604
|
+
}[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
605
|
+
};
|
|
606
|
+
folder: (data: import("./modules/post/index.js").OptionalId<string, {
|
|
607
|
+
readonly name: string;
|
|
608
|
+
readonly id: string;
|
|
609
|
+
readonly parent: string | null | undefined;
|
|
610
|
+
}>) => Effect.Effect<{
|
|
611
|
+
readonly name: string;
|
|
612
|
+
readonly id: string;
|
|
613
|
+
readonly parent: string | null | undefined;
|
|
614
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/folderTree.js").FolderTreeError, never>;
|
|
615
|
+
page: (args_0: {
|
|
616
|
+
pageData: import("./modules/post/index.js").OptionalId<string, typeof import("@withstudiocms/kysely").StudioCMSPageData["Insert"]["Type"]>;
|
|
617
|
+
pageContent: import("./types.js").CombinedInsertContent;
|
|
618
|
+
}) => Effect.Effect<import("./types.js").CombinedPageData | undefined, import("effect/ParseResult").ParseError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").QueryParseError | import("@withstudiocms/kysely/core/errors").QueryError | import("@withstudiocms/kysely/core/errors").NotFoundError | import("./modules/util/folderTree.js").FolderTreeError | import("./modules/util/collectors.js").CollectorError | import("./modules/get/index.js").PaginateError, never>;
|
|
619
|
+
};
|
|
620
|
+
resetTokenBucket: {
|
|
621
|
+
new: (userId: string) => Effect.Effect<{
|
|
622
|
+
readonly id: string;
|
|
623
|
+
readonly userId: string;
|
|
624
|
+
readonly token: string;
|
|
625
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/generators.js").GeneratorError, never>;
|
|
626
|
+
delete: (input: string) => Effect.Effect<import("kysely").DeleteResult[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
627
|
+
check: (token: string) => Effect.Effect<boolean, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/generators.js").GeneratorError, never>;
|
|
628
|
+
};
|
|
629
|
+
REST_API: {
|
|
630
|
+
tokens: {
|
|
631
|
+
get: (input: string) => Effect.Effect<readonly {
|
|
632
|
+
readonly key: string;
|
|
633
|
+
readonly id: string;
|
|
634
|
+
readonly description: string | null | undefined;
|
|
635
|
+
readonly userId: string;
|
|
636
|
+
readonly creationDate: Date;
|
|
637
|
+
}[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
638
|
+
new: (userId: string, description: string) => Effect.Effect<{
|
|
639
|
+
readonly key: string;
|
|
640
|
+
readonly id: string;
|
|
641
|
+
readonly description: string | null | undefined;
|
|
642
|
+
readonly userId: string;
|
|
643
|
+
readonly creationDate: Date;
|
|
644
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/generators.js").GeneratorError, never>;
|
|
645
|
+
delete: (input: {
|
|
646
|
+
readonly userId: string;
|
|
647
|
+
readonly tokenId: string;
|
|
648
|
+
}) => Effect.Effect<import("kysely").DeleteResult[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
649
|
+
verify: (key: string) => Effect.Effect<false | {
|
|
650
|
+
userId: string;
|
|
651
|
+
key: string;
|
|
652
|
+
rank: "owner" | "admin" | "editor" | "visitor" | "unknown";
|
|
653
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
654
|
+
};
|
|
655
|
+
};
|
|
656
|
+
UPDATE: {
|
|
657
|
+
pageContent: (input: {
|
|
658
|
+
readonly id: string;
|
|
659
|
+
readonly contentId: string;
|
|
660
|
+
readonly contentLang: string;
|
|
661
|
+
readonly content: string;
|
|
662
|
+
}) => Effect.Effect<{
|
|
663
|
+
readonly id: string;
|
|
664
|
+
readonly contentId: string;
|
|
665
|
+
readonly contentLang: string;
|
|
666
|
+
readonly content: string;
|
|
667
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
668
|
+
tags: (input: {
|
|
669
|
+
readonly name: string;
|
|
670
|
+
readonly id: number;
|
|
671
|
+
readonly description: string;
|
|
672
|
+
readonly slug: string;
|
|
673
|
+
readonly meta: string;
|
|
674
|
+
}) => Effect.Effect<{
|
|
675
|
+
readonly name: string;
|
|
676
|
+
readonly id: number;
|
|
677
|
+
readonly description: string;
|
|
678
|
+
readonly slug: string;
|
|
679
|
+
readonly meta: {
|
|
680
|
+
readonly [x: string]: unknown;
|
|
681
|
+
};
|
|
682
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
683
|
+
categories: (input: {
|
|
684
|
+
readonly parent?: number | null | undefined;
|
|
685
|
+
readonly name: string;
|
|
686
|
+
readonly id: number;
|
|
687
|
+
readonly description: string;
|
|
688
|
+
readonly slug: string;
|
|
689
|
+
readonly meta: string;
|
|
690
|
+
}) => Effect.Effect<{
|
|
691
|
+
readonly name: string;
|
|
692
|
+
readonly id: number;
|
|
693
|
+
readonly parent: number | null | undefined;
|
|
694
|
+
readonly description: string;
|
|
695
|
+
readonly slug: string;
|
|
696
|
+
readonly meta: {
|
|
697
|
+
readonly [x: string]: unknown;
|
|
698
|
+
};
|
|
699
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
700
|
+
permissions: (input: {
|
|
701
|
+
readonly user: string;
|
|
702
|
+
readonly rank: "owner" | "admin" | "editor" | "visitor" | "unknown";
|
|
703
|
+
}) => Effect.Effect<{
|
|
704
|
+
readonly user: string;
|
|
705
|
+
readonly rank: "owner" | "admin" | "editor" | "visitor" | "unknown";
|
|
706
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
707
|
+
folderTree: Effect.Effect<import("./types.js").FolderNode[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/folderTree.js").FolderTreeError, never>;
|
|
708
|
+
folderList: Effect.Effect<import("./types.js").FolderListItem[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
709
|
+
folder: (data: {
|
|
710
|
+
readonly name: string;
|
|
711
|
+
readonly id: string;
|
|
712
|
+
readonly parent: string | null | undefined;
|
|
713
|
+
}) => Effect.Effect<{
|
|
714
|
+
readonly name: string;
|
|
715
|
+
readonly id: string;
|
|
716
|
+
readonly parent: string | null | undefined;
|
|
717
|
+
}, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/folderTree.js").FolderTreeError, never>;
|
|
718
|
+
latestVersion: () => Effect.Effect<{
|
|
719
|
+
version: string;
|
|
720
|
+
lastCacheUpdate: Date;
|
|
721
|
+
}, import("effect/Cause").UnknownException | Error | import("effect/ParseResult").ParseError, never>;
|
|
722
|
+
siteConfig: (data: import("./types.js").ConfigFinal<import("./types.js").StudioCMSSiteConfig>) => Effect.Effect<import("./types.js").DynamicConfigEntry<import("./types.js").StudioCMSSiteConfig>, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
723
|
+
page: {
|
|
724
|
+
byId: (pageId: string, data: {
|
|
725
|
+
pageData: {
|
|
726
|
+
readonly tags: string;
|
|
727
|
+
readonly id: string;
|
|
728
|
+
readonly description: string;
|
|
729
|
+
readonly slug: string;
|
|
730
|
+
readonly contentLang: string;
|
|
731
|
+
readonly updatedAt: string;
|
|
732
|
+
readonly package: string;
|
|
733
|
+
readonly title: string;
|
|
734
|
+
readonly showOnNav: boolean;
|
|
735
|
+
readonly publishedAt: string;
|
|
736
|
+
readonly heroImage: string | null | undefined;
|
|
737
|
+
readonly categories: string;
|
|
738
|
+
readonly authorId: string;
|
|
739
|
+
readonly contributorIds: string;
|
|
740
|
+
readonly showAuthor: boolean;
|
|
741
|
+
readonly showContributors: boolean;
|
|
742
|
+
readonly parentFolder: string | null | undefined;
|
|
743
|
+
readonly draft: boolean;
|
|
744
|
+
readonly augments: string;
|
|
745
|
+
};
|
|
746
|
+
pageContent: {
|
|
747
|
+
readonly id: string;
|
|
748
|
+
readonly contentId: string;
|
|
749
|
+
readonly contentLang: string;
|
|
750
|
+
readonly content: string;
|
|
751
|
+
};
|
|
752
|
+
}) => Effect.Effect<import("./types.js").CombinedPageData | undefined, import("effect/ParseResult").ParseError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").QueryParseError | import("@withstudiocms/kysely/core/errors").QueryError | import("@withstudiocms/kysely/core/errors").NotFoundError | import("./modules/util/folderTree.js").FolderTreeError | import("./modules/util/collectors.js").CollectorError | import("./modules/get/index.js").PaginateError, never>;
|
|
753
|
+
bySlug: (slug: string, data: {
|
|
754
|
+
pageData: {
|
|
755
|
+
readonly tags: string;
|
|
756
|
+
readonly id: string;
|
|
757
|
+
readonly description: string;
|
|
758
|
+
readonly slug: string;
|
|
759
|
+
readonly contentLang: string;
|
|
760
|
+
readonly updatedAt: string;
|
|
761
|
+
readonly package: string;
|
|
762
|
+
readonly title: string;
|
|
763
|
+
readonly showOnNav: boolean;
|
|
764
|
+
readonly publishedAt: string;
|
|
765
|
+
readonly heroImage: string | null | undefined;
|
|
766
|
+
readonly categories: string;
|
|
767
|
+
readonly authorId: string;
|
|
768
|
+
readonly contributorIds: string;
|
|
769
|
+
readonly showAuthor: boolean;
|
|
770
|
+
readonly showContributors: boolean;
|
|
771
|
+
readonly parentFolder: string | null | undefined;
|
|
772
|
+
readonly draft: boolean;
|
|
773
|
+
readonly augments: string;
|
|
774
|
+
};
|
|
775
|
+
pageContent: {
|
|
776
|
+
readonly id: string;
|
|
777
|
+
readonly contentId: string;
|
|
778
|
+
readonly contentLang: string;
|
|
779
|
+
readonly content: string;
|
|
780
|
+
};
|
|
781
|
+
}) => Effect.Effect<import("./types.js").CombinedPageData | undefined, import("effect/ParseResult").ParseError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/folderTree.js").FolderTreeError | import("./modules/util/collectors.js").CollectorError | import("./modules/get/index.js").PaginateError, never>;
|
|
782
|
+
};
|
|
783
|
+
};
|
|
784
|
+
UTIL: {
|
|
785
|
+
Collectors: {
|
|
786
|
+
collectCategories: (input: {
|
|
787
|
+
readonly [x: number]: number;
|
|
788
|
+
readonly length: number;
|
|
789
|
+
toString: {};
|
|
790
|
+
toLocaleString: {};
|
|
791
|
+
concat: {};
|
|
792
|
+
join: {};
|
|
793
|
+
slice: {};
|
|
794
|
+
indexOf: {};
|
|
795
|
+
lastIndexOf: {};
|
|
796
|
+
every: {};
|
|
797
|
+
some: {};
|
|
798
|
+
forEach: {};
|
|
799
|
+
map: {};
|
|
800
|
+
filter: {};
|
|
801
|
+
reduce: {};
|
|
802
|
+
reduceRight: {};
|
|
803
|
+
find: {};
|
|
804
|
+
findIndex: {};
|
|
805
|
+
entries: {};
|
|
806
|
+
keys: {};
|
|
807
|
+
values: {};
|
|
808
|
+
includes: {};
|
|
809
|
+
flatMap: {};
|
|
810
|
+
flat: {};
|
|
811
|
+
at: {};
|
|
812
|
+
findLast: {};
|
|
813
|
+
findLastIndex: {};
|
|
814
|
+
toReversed: {};
|
|
815
|
+
toSorted: {};
|
|
816
|
+
toSpliced: {};
|
|
817
|
+
with: {};
|
|
818
|
+
[Symbol.iterator]: {};
|
|
819
|
+
readonly [Symbol.unscopables]: {
|
|
820
|
+
readonly [x: number]: boolean | undefined;
|
|
821
|
+
readonly length?: boolean | undefined;
|
|
822
|
+
toString?: boolean | undefined;
|
|
823
|
+
toLocaleString?: boolean | undefined;
|
|
824
|
+
concat?: boolean | undefined;
|
|
825
|
+
join?: boolean | undefined;
|
|
826
|
+
slice?: boolean | undefined;
|
|
827
|
+
indexOf?: boolean | undefined;
|
|
828
|
+
lastIndexOf?: boolean | undefined;
|
|
829
|
+
every?: boolean | undefined;
|
|
830
|
+
some?: boolean | undefined;
|
|
831
|
+
forEach?: boolean | undefined;
|
|
832
|
+
map?: boolean | undefined;
|
|
833
|
+
filter?: boolean | undefined;
|
|
834
|
+
reduce?: boolean | undefined;
|
|
835
|
+
reduceRight?: boolean | undefined;
|
|
836
|
+
find?: boolean | undefined;
|
|
837
|
+
findIndex?: boolean | undefined;
|
|
838
|
+
entries?: boolean | undefined;
|
|
839
|
+
keys?: boolean | undefined;
|
|
840
|
+
values?: boolean | undefined;
|
|
841
|
+
includes?: boolean | undefined;
|
|
842
|
+
flatMap?: boolean | undefined;
|
|
843
|
+
flat?: boolean | undefined;
|
|
844
|
+
at?: boolean | undefined;
|
|
845
|
+
findLast?: boolean | undefined;
|
|
846
|
+
findLastIndex?: boolean | undefined;
|
|
847
|
+
toReversed?: boolean | undefined;
|
|
848
|
+
toSorted?: boolean | undefined;
|
|
849
|
+
toSpliced?: boolean | undefined;
|
|
850
|
+
with?: boolean | undefined;
|
|
851
|
+
[Symbol.iterator]?: boolean | undefined;
|
|
852
|
+
readonly [Symbol.unscopables]?: boolean | undefined;
|
|
853
|
+
};
|
|
854
|
+
}) => Effect.Effect<readonly {
|
|
855
|
+
readonly name: string;
|
|
856
|
+
readonly id: number;
|
|
857
|
+
readonly parent: number | null | undefined;
|
|
858
|
+
readonly description: string;
|
|
859
|
+
readonly slug: string;
|
|
860
|
+
readonly meta: {
|
|
861
|
+
readonly [x: string]: unknown;
|
|
862
|
+
};
|
|
863
|
+
}[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
864
|
+
collectTags: (input: {
|
|
865
|
+
readonly [x: number]: number;
|
|
866
|
+
readonly length: number;
|
|
867
|
+
toString: {};
|
|
868
|
+
toLocaleString: {};
|
|
869
|
+
concat: {};
|
|
870
|
+
join: {};
|
|
871
|
+
slice: {};
|
|
872
|
+
indexOf: {};
|
|
873
|
+
lastIndexOf: {};
|
|
874
|
+
every: {};
|
|
875
|
+
some: {};
|
|
876
|
+
forEach: {};
|
|
877
|
+
map: {};
|
|
878
|
+
filter: {};
|
|
879
|
+
reduce: {};
|
|
880
|
+
reduceRight: {};
|
|
881
|
+
find: {};
|
|
882
|
+
findIndex: {};
|
|
883
|
+
entries: {};
|
|
884
|
+
keys: {};
|
|
885
|
+
values: {};
|
|
886
|
+
includes: {};
|
|
887
|
+
flatMap: {};
|
|
888
|
+
flat: {};
|
|
889
|
+
at: {};
|
|
890
|
+
findLast: {};
|
|
891
|
+
findLastIndex: {};
|
|
892
|
+
toReversed: {};
|
|
893
|
+
toSorted: {};
|
|
894
|
+
toSpliced: {};
|
|
895
|
+
with: {};
|
|
896
|
+
[Symbol.iterator]: {};
|
|
897
|
+
readonly [Symbol.unscopables]: {
|
|
898
|
+
readonly [x: number]: boolean | undefined;
|
|
899
|
+
readonly length?: boolean | undefined;
|
|
900
|
+
toString?: boolean | undefined;
|
|
901
|
+
toLocaleString?: boolean | undefined;
|
|
902
|
+
concat?: boolean | undefined;
|
|
903
|
+
join?: boolean | undefined;
|
|
904
|
+
slice?: boolean | undefined;
|
|
905
|
+
indexOf?: boolean | undefined;
|
|
906
|
+
lastIndexOf?: boolean | undefined;
|
|
907
|
+
every?: boolean | undefined;
|
|
908
|
+
some?: boolean | undefined;
|
|
909
|
+
forEach?: boolean | undefined;
|
|
910
|
+
map?: boolean | undefined;
|
|
911
|
+
filter?: boolean | undefined;
|
|
912
|
+
reduce?: boolean | undefined;
|
|
913
|
+
reduceRight?: boolean | undefined;
|
|
914
|
+
find?: boolean | undefined;
|
|
915
|
+
findIndex?: boolean | undefined;
|
|
916
|
+
entries?: boolean | undefined;
|
|
917
|
+
keys?: boolean | undefined;
|
|
918
|
+
values?: boolean | undefined;
|
|
919
|
+
includes?: boolean | undefined;
|
|
920
|
+
flatMap?: boolean | undefined;
|
|
921
|
+
flat?: boolean | undefined;
|
|
922
|
+
at?: boolean | undefined;
|
|
923
|
+
findLast?: boolean | undefined;
|
|
924
|
+
findLastIndex?: boolean | undefined;
|
|
925
|
+
toReversed?: boolean | undefined;
|
|
926
|
+
toSorted?: boolean | undefined;
|
|
927
|
+
toSpliced?: boolean | undefined;
|
|
928
|
+
with?: boolean | undefined;
|
|
929
|
+
[Symbol.iterator]?: boolean | undefined;
|
|
930
|
+
readonly [Symbol.unscopables]?: boolean | undefined;
|
|
931
|
+
};
|
|
932
|
+
}) => Effect.Effect<readonly {
|
|
933
|
+
readonly name: string;
|
|
934
|
+
readonly id: number;
|
|
935
|
+
readonly description: string;
|
|
936
|
+
readonly slug: string;
|
|
937
|
+
readonly meta: {
|
|
938
|
+
readonly [x: string]: unknown;
|
|
939
|
+
};
|
|
940
|
+
}[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
941
|
+
collectPageData: {
|
|
942
|
+
(page: import("./types.js").tsPageDataSelect, tree: import("./types.js").FolderNode[]): Effect.Effect<import("./types.js").CombinedPageData, import("./modules/util/collectors.js").CollectorError | import("./modules/util/folderTree.js").FolderTreeError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("effect/ParseResult").ParseError, never>;
|
|
943
|
+
(page: import("./types.js").tsPageDataSelect, tree: import("./types.js").FolderNode[], metaOnly: boolean): Effect.Effect<import("./types.js").MetaOnlyPageData, import("./modules/util/collectors.js").CollectorError | import("./modules/util/folderTree.js").FolderTreeError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("effect/ParseResult").ParseError, never>;
|
|
944
|
+
};
|
|
945
|
+
collectUserData: (user: {
|
|
946
|
+
readonly name: string;
|
|
947
|
+
readonly id: string;
|
|
948
|
+
readonly url: string | null | undefined;
|
|
949
|
+
readonly email: string | null | undefined;
|
|
950
|
+
readonly avatar: string | null | undefined;
|
|
951
|
+
readonly username: string;
|
|
952
|
+
readonly password: string | null | undefined;
|
|
953
|
+
readonly updatedAt: Date;
|
|
954
|
+
readonly createdAt: Date;
|
|
955
|
+
readonly emailVerified: boolean;
|
|
956
|
+
readonly notifications: string | null | undefined;
|
|
957
|
+
}) => Effect.Effect<import("./types.js").CombinedUserData, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
958
|
+
};
|
|
959
|
+
FolderTree: {
|
|
960
|
+
generateFolderTree: (folders: readonly {
|
|
961
|
+
readonly name: string;
|
|
962
|
+
readonly id: string;
|
|
963
|
+
readonly parent: string | null | undefined;
|
|
964
|
+
}[]) => Effect.Effect<import("./types.js").FolderNode[], import("./modules/util/folderTree.js").FolderTreeError, never>;
|
|
965
|
+
getFullPath: (tree: import("./types.js").FolderNode[], path: string[]) => Effect.Effect<string[], import("./modules/util/folderTree.js").FolderTreeError, never>;
|
|
966
|
+
findNodeByPath: (tree: import("./types.js").FolderNode[], path: string[]) => Effect.Effect<import("./types.js").FolderNode | null, import("./modules/util/folderTree.js").FolderTreeError, never>;
|
|
967
|
+
findNodesAlongPath: (tree: import("./types.js").FolderNode[], path: string[]) => Effect.Effect<import("./types.js").FolderNode[], import("./modules/util/folderTree.js").FolderTreeError, never>;
|
|
968
|
+
findNodesAlongPathToId: (tree: import("./types.js").FolderNode[], id: string) => Effect.Effect<import("./types.js").FolderNode[], import("./modules/util/folderTree.js").FolderTreeError, never>;
|
|
969
|
+
findNodeById: (tree: import("./types.js").FolderNode[], id: string) => Effect.Effect<import("./types.js").FolderNode | null, import("./modules/util/folderTree.js").FolderTreeError, never>;
|
|
970
|
+
addPageToFolderTree: (tree: import("./types.js").FolderNode[], folderId: string, newPage: import("./types.js").FolderNode) => Effect.Effect<import("./types.js").FolderNode[], import("./modules/util/folderTree.js").FolderTreeError, never>;
|
|
971
|
+
buildFolderTree: Effect.Effect<import("./types.js").FolderNode[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./modules/util/folderTree.js").FolderTreeError, never>;
|
|
972
|
+
getAvailableFolders: Effect.Effect<import("./types.js").FolderListItem[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
973
|
+
};
|
|
974
|
+
Generators: {
|
|
975
|
+
generateRandomIDNumber: (length: number) => Effect.Effect<number, import("./modules/util/generators.js").GeneratorError, never>;
|
|
976
|
+
generateRandomPassword: (length: number) => Effect.Effect<string, import("./modules/util/generators.js").GeneratorError, never>;
|
|
977
|
+
generateToken: (userId: string, noExpire?: boolean | undefined) => Effect.Effect<string, import("./modules/util/generators.js").GeneratorError, never>;
|
|
978
|
+
testToken: (token: string) => Effect.Effect<import("./types.js").JwtVerificationResult, import("./modules/util/generators.js").GeneratorError, never>;
|
|
979
|
+
};
|
|
980
|
+
GetFromNPM: {
|
|
981
|
+
getVersion: (pkg: string, ver?: string | undefined) => Effect.Effect<{
|
|
982
|
+
version: string;
|
|
983
|
+
lastCacheUpdate: Date;
|
|
984
|
+
}, import("effect/Cause").UnknownException | Error | import("effect/ParseResult").ParseError, never>;
|
|
985
|
+
getDataFromNPM: (pkg: string, ver?: string | undefined) => Effect.Effect<import("./modules/util/getFromNPM.js").NpmRegistryResponseSchema, import("effect/Cause").UnknownException | Error | import("effect/ParseResult").ParseError, never>;
|
|
986
|
+
};
|
|
987
|
+
Parsers: {
|
|
988
|
+
parseIdNumberArray: (ids: unknown) => Effect.Effect<readonly number[], import("effect/ParseResult").ParseError, never>;
|
|
989
|
+
parseIdStringArray: (ids: unknown) => Effect.Effect<readonly string[], import("effect/ParseResult").ParseError, never>;
|
|
990
|
+
fixDiff: <T extends import("./types.js").diffItem | import("./types.js").diffItem[]>(items: T) => Effect.Effect<import("./types.js").DiffReturnType<T>, import("./modules/util/parsers.js").ParsersError, never>;
|
|
991
|
+
};
|
|
992
|
+
Users: {
|
|
993
|
+
verifyRank: (users: readonly {
|
|
994
|
+
readonly name: string;
|
|
995
|
+
readonly id: string;
|
|
996
|
+
readonly url: string | null | undefined;
|
|
997
|
+
readonly email: string | null | undefined;
|
|
998
|
+
readonly avatar: string | null | undefined;
|
|
999
|
+
readonly username: string;
|
|
1000
|
+
readonly password: string | null | undefined;
|
|
1001
|
+
readonly updatedAt: Date;
|
|
1002
|
+
readonly createdAt: Date;
|
|
1003
|
+
readonly emailVerified: boolean;
|
|
1004
|
+
readonly notifications: string | null | undefined;
|
|
1005
|
+
}[], permissions: readonly {
|
|
1006
|
+
readonly user: string;
|
|
1007
|
+
readonly rank: "owner" | "admin" | "editor" | "visitor" | "unknown";
|
|
1008
|
+
}[], rank: string) => Effect.Effect<import("./types.js").SingleRank[], import("./modules/util/users.js").UsersError, never>;
|
|
1009
|
+
combineRanks: (rank: string, users: import("./types.js").SingleRank[]) => Effect.Effect<import("./types.js").CombinedRank[], import("./modules/util/users.js").UsersError, never>;
|
|
1010
|
+
clearUserReferences: (userId: string) => Effect.Effect<boolean, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").QueryError | import("@withstudiocms/kysely/core/errors").NotFoundError, never>;
|
|
1011
|
+
};
|
|
1012
|
+
};
|
|
1013
|
+
dbService: import("@withstudiocms/kysely").DBClientInterface<{
|
|
1014
|
+
readonly StudioCMSUsersTable: {
|
|
1015
|
+
readonly id: string;
|
|
1016
|
+
readonly url: string | null | undefined;
|
|
1017
|
+
readonly name: string;
|
|
1018
|
+
readonly email: string | null | undefined;
|
|
1019
|
+
readonly avatar: string | null | undefined;
|
|
1020
|
+
readonly username: string;
|
|
1021
|
+
readonly password: string | null | undefined;
|
|
1022
|
+
readonly updatedAt: import("kysely").ColumnType<string, string, string>;
|
|
1023
|
+
readonly createdAt: import("kysely").ColumnType<string, string | undefined, never>;
|
|
1024
|
+
readonly emailVerified: number;
|
|
1025
|
+
readonly notifications: string | null | undefined;
|
|
1026
|
+
};
|
|
1027
|
+
readonly StudioCMSOAuthAccounts: {
|
|
1028
|
+
readonly providerUserId: string;
|
|
1029
|
+
readonly provider: string;
|
|
1030
|
+
readonly userId: string;
|
|
1031
|
+
};
|
|
1032
|
+
readonly StudioCMSSessionTable: {
|
|
1033
|
+
readonly id: string;
|
|
1034
|
+
readonly userId: string;
|
|
1035
|
+
readonly expiresAt: import("kysely").ColumnType<string, string, string>;
|
|
1036
|
+
};
|
|
1037
|
+
readonly StudioCMSAPIKeys: {
|
|
1038
|
+
readonly id: string;
|
|
1039
|
+
readonly userId: string;
|
|
1040
|
+
readonly key: string;
|
|
1041
|
+
readonly creationDate: import("kysely").ColumnType<string, string | undefined, never>;
|
|
1042
|
+
readonly description: string | null | undefined;
|
|
1043
|
+
};
|
|
1044
|
+
readonly StudioCMSUserResetTokens: {
|
|
1045
|
+
readonly id: string;
|
|
1046
|
+
readonly userId: string;
|
|
1047
|
+
readonly token: string;
|
|
1048
|
+
};
|
|
1049
|
+
readonly StudioCMSPermissions: {
|
|
1050
|
+
readonly user: string;
|
|
1051
|
+
readonly rank: "owner" | "admin" | "editor" | "visitor" | "unknown";
|
|
1052
|
+
};
|
|
1053
|
+
readonly StudioCMSPageFolderStructure: {
|
|
1054
|
+
readonly id: string;
|
|
1055
|
+
readonly name: string;
|
|
1056
|
+
readonly parent: string | null | undefined;
|
|
1057
|
+
};
|
|
1058
|
+
readonly StudioCMSPageData: {
|
|
1059
|
+
readonly id: string;
|
|
1060
|
+
readonly updatedAt: import("kysely").ColumnType<string, string, string>;
|
|
1061
|
+
readonly description: string;
|
|
1062
|
+
readonly package: string;
|
|
1063
|
+
readonly title: string;
|
|
1064
|
+
readonly showOnNav: number;
|
|
1065
|
+
readonly publishedAt: import("kysely").ColumnType<string, string, string>;
|
|
1066
|
+
readonly slug: string;
|
|
1067
|
+
readonly contentLang: string;
|
|
1068
|
+
readonly heroImage: string | null | undefined;
|
|
1069
|
+
readonly categories: import("kysely").ColumnType<string, string, string>;
|
|
1070
|
+
readonly tags: import("kysely").ColumnType<string, string, string>;
|
|
1071
|
+
readonly authorId: string;
|
|
1072
|
+
readonly contributorIds: import("kysely").ColumnType<string, string, string>;
|
|
1073
|
+
readonly showAuthor: number;
|
|
1074
|
+
readonly showContributors: number;
|
|
1075
|
+
readonly parentFolder: string | null | undefined;
|
|
1076
|
+
readonly draft: number;
|
|
1077
|
+
readonly augments: import("kysely").ColumnType<string, string, string>;
|
|
1078
|
+
};
|
|
1079
|
+
readonly StudioCMSDiffTracking: {
|
|
1080
|
+
readonly id: string;
|
|
1081
|
+
readonly userId: string;
|
|
1082
|
+
readonly pageId: string;
|
|
1083
|
+
readonly timestamp: import("kysely").ColumnType<string, string | undefined, never>;
|
|
1084
|
+
readonly pageMetaData: import("kysely").ColumnType<string, string, string>;
|
|
1085
|
+
readonly pageContentStart: string;
|
|
1086
|
+
readonly diff: string | null | undefined;
|
|
1087
|
+
};
|
|
1088
|
+
readonly StudioCMSPageDataTags: {
|
|
1089
|
+
readonly id: number;
|
|
1090
|
+
readonly name: string;
|
|
1091
|
+
readonly description: string;
|
|
1092
|
+
readonly slug: string;
|
|
1093
|
+
readonly meta: import("kysely").ColumnType<string, string, string>;
|
|
1094
|
+
};
|
|
1095
|
+
readonly StudioCMSPageDataCategories: {
|
|
1096
|
+
readonly id: number;
|
|
1097
|
+
readonly name: string;
|
|
1098
|
+
readonly description: string;
|
|
1099
|
+
readonly parent: number | null | undefined;
|
|
1100
|
+
readonly slug: string;
|
|
1101
|
+
readonly meta: import("kysely").ColumnType<string, string, string>;
|
|
1102
|
+
};
|
|
1103
|
+
readonly StudioCMSPageContent: {
|
|
1104
|
+
readonly id: string;
|
|
1105
|
+
readonly contentLang: string;
|
|
1106
|
+
readonly contentId: string;
|
|
1107
|
+
readonly content: string;
|
|
1108
|
+
};
|
|
1109
|
+
readonly StudioCMSEmailVerificationTokens: {
|
|
1110
|
+
readonly id: string;
|
|
1111
|
+
readonly userId: string;
|
|
1112
|
+
readonly expiresAt: import("kysely").ColumnType<string, string, string>;
|
|
1113
|
+
readonly token: string;
|
|
1114
|
+
};
|
|
1115
|
+
readonly StudioCMSPluginData: {
|
|
1116
|
+
readonly id: string;
|
|
1117
|
+
readonly data: import("kysely").ColumnType<string, string, string>;
|
|
1118
|
+
};
|
|
1119
|
+
readonly StudioCMSDynamicConfigSettings: {
|
|
1120
|
+
readonly id: string;
|
|
1121
|
+
readonly data: import("kysely").ColumnType<string, string, string>;
|
|
1122
|
+
};
|
|
1123
|
+
}>;
|
|
1124
|
+
cache: CacheService;
|
|
1125
|
+
}, import("effect/ConfigError").ConfigError, DBClientLive | import("./context.js").SDKDefaults | import("./context.js").CacheStores>;
|
|
1126
|
+
/**
|
|
1127
|
+
* Type representing the live StudioCMS SDK Core Effect without requirements.
|
|
1128
|
+
*/
|
|
1129
|
+
export type SDKCoreLive = ExtractEffectWithoutRequirements<typeof StudioCMSSDKCore>;
|
|
1130
|
+
/**
|
|
1131
|
+
* Provides a live Effect for the StudioCMS SDK Core using the given SDK context.
|
|
1132
|
+
*
|
|
1133
|
+
* @param context - The SDK context containing the database client and default options.
|
|
1134
|
+
* @returns A Effect that provides the StudioCMS SDK Core.
|
|
1135
|
+
*/
|
|
1136
|
+
export declare const makeStudioCMSSDKCoreLive: (context: SDKContext) => SDKCoreLive;
|