@withstudiocms/sdk 0.1.0-beta.1 → 0.1.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/dist/consts.d.ts +10 -1
- package/dist/consts.js +12 -3
- package/dist/context.d.ts +36 -16
- package/dist/context.js +8 -1
- package/dist/errors.d.ts +9 -0
- package/dist/errors.js +6 -0
- package/dist/index.d.ts +341 -453
- package/dist/lib/pluginUtils.d.ts +4 -3
- package/dist/lib/pluginUtils.js +17 -10
- package/dist/lib/storage-manager.d.ts +10 -0
- package/dist/lib/storage-manager.js +17 -0
- package/dist/migrations/20251025T040912_init.d.ts +17 -0
- package/dist/migrations/20251025T040912_init.js +260 -0
- package/dist/migrations/20251130T150847_drop_deprecated.d.ts +13 -0
- package/dist/migrations/20251130T150847_drop_deprecated.js +262 -0
- package/dist/migrations/20251221T002125_url-mapping.d.ts +13 -0
- package/dist/migrations/20251221T002125_url-mapping.js +228 -0
- package/dist/migrator.d.ts +25 -0
- package/dist/migrator.js +21 -0
- package/dist/modules/auth/index.d.ts +60 -104
- package/dist/modules/auth/index.js +33 -9
- package/dist/modules/config/index.d.ts +5 -5
- package/dist/modules/config/index.js +26 -7
- package/dist/modules/delete/index.d.ts +2 -1
- package/dist/modules/delete/index.js +7 -2
- package/dist/modules/diffTracking/index.d.ts +8 -8
- package/dist/modules/diffTracking/index.js +7 -6
- package/dist/modules/get/index.d.ts +116 -16
- package/dist/modules/get/index.js +135 -22
- package/dist/modules/index.d.ts +326 -446
- package/dist/modules/init/index.d.ts +9 -9
- package/dist/modules/middleware/index.d.ts +2 -2
- package/dist/modules/notificationSettings/index.d.ts +3 -3
- package/dist/modules/plugins/index.d.ts +9 -8
- package/dist/modules/plugins/index.js +17 -6
- package/dist/modules/post/index.d.ts +29 -28
- package/dist/modules/post/index.js +47 -15
- package/dist/modules/resetTokenBucket/index.d.ts +1 -1
- package/dist/modules/resetTokenBucket/index.js +5 -2
- package/dist/modules/rest_api/index.d.ts +8 -8
- package/dist/modules/rest_api/index.js +7 -3
- package/dist/modules/update/index.d.ts +25 -25
- package/dist/modules/update/index.js +28 -10
- package/dist/modules/util/collectors.d.ts +14 -150
- package/dist/modules/util/collectors.js +41 -14
- package/dist/modules/util/folderTree.d.ts +4 -4
- package/dist/modules/util/folderTree.js +1 -1
- package/dist/modules/util/getFromNPM.d.ts +13 -5
- package/dist/modules/util/getFromNPM.js +8 -2
- package/dist/modules/util/index.d.ts +30 -166
- package/dist/modules/util/users.d.ts +7 -7
- package/dist/tables.d.ts +433 -0
- package/dist/tables.js +169 -0
- package/dist/types.d.ts +6 -7
- package/package.json +17 -5
|
@@ -6,184 +6,48 @@ import { Effect } from '@withstudiocms/effect';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare const SDKUtilModule: Effect.Effect<{
|
|
8
8
|
Collectors: {
|
|
9
|
-
collectCategories: (input: {
|
|
10
|
-
readonly [x: number]: number;
|
|
11
|
-
readonly length: number;
|
|
12
|
-
toString: {};
|
|
13
|
-
toLocaleString: {};
|
|
14
|
-
concat: {};
|
|
15
|
-
join: {};
|
|
16
|
-
slice: {};
|
|
17
|
-
indexOf: {};
|
|
18
|
-
lastIndexOf: {};
|
|
19
|
-
every: {};
|
|
20
|
-
some: {};
|
|
21
|
-
forEach: {};
|
|
22
|
-
map: {};
|
|
23
|
-
filter: {};
|
|
24
|
-
reduce: {};
|
|
25
|
-
reduceRight: {};
|
|
26
|
-
find: {};
|
|
27
|
-
findIndex: {};
|
|
28
|
-
entries: {};
|
|
29
|
-
keys: {};
|
|
30
|
-
values: {};
|
|
31
|
-
includes: {};
|
|
32
|
-
flatMap: {};
|
|
33
|
-
flat: {};
|
|
34
|
-
at: {};
|
|
35
|
-
findLast: {};
|
|
36
|
-
findLastIndex: {};
|
|
37
|
-
toReversed: {};
|
|
38
|
-
toSorted: {};
|
|
39
|
-
toSpliced: {};
|
|
40
|
-
with: {};
|
|
41
|
-
[Symbol.iterator]: {};
|
|
42
|
-
readonly [Symbol.unscopables]: {
|
|
43
|
-
readonly [x: number]: boolean | undefined;
|
|
44
|
-
readonly length?: boolean | undefined;
|
|
45
|
-
toString?: boolean | undefined;
|
|
46
|
-
toLocaleString?: boolean | undefined;
|
|
47
|
-
concat?: boolean | undefined;
|
|
48
|
-
join?: boolean | undefined;
|
|
49
|
-
slice?: boolean | undefined;
|
|
50
|
-
indexOf?: boolean | undefined;
|
|
51
|
-
lastIndexOf?: boolean | undefined;
|
|
52
|
-
every?: boolean | undefined;
|
|
53
|
-
some?: boolean | undefined;
|
|
54
|
-
forEach?: boolean | undefined;
|
|
55
|
-
map?: boolean | undefined;
|
|
56
|
-
filter?: boolean | undefined;
|
|
57
|
-
reduce?: boolean | undefined;
|
|
58
|
-
reduceRight?: boolean | undefined;
|
|
59
|
-
find?: boolean | undefined;
|
|
60
|
-
findIndex?: boolean | undefined;
|
|
61
|
-
entries?: boolean | undefined;
|
|
62
|
-
keys?: boolean | undefined;
|
|
63
|
-
values?: boolean | undefined;
|
|
64
|
-
includes?: boolean | undefined;
|
|
65
|
-
flatMap?: boolean | undefined;
|
|
66
|
-
flat?: boolean | undefined;
|
|
67
|
-
at?: boolean | undefined;
|
|
68
|
-
findLast?: boolean | undefined;
|
|
69
|
-
findLastIndex?: boolean | undefined;
|
|
70
|
-
toReversed?: boolean | undefined;
|
|
71
|
-
toSorted?: boolean | undefined;
|
|
72
|
-
toSpliced?: boolean | undefined;
|
|
73
|
-
with?: boolean | undefined;
|
|
74
|
-
[Symbol.iterator]?: boolean | undefined;
|
|
75
|
-
readonly [Symbol.unscopables]?: boolean | undefined;
|
|
76
|
-
};
|
|
77
|
-
}) => Effect.Effect<readonly {
|
|
78
|
-
readonly name: string;
|
|
9
|
+
collectCategories: (input: readonly number[]) => Effect.Effect<readonly {
|
|
79
10
|
readonly id: number;
|
|
80
|
-
readonly
|
|
11
|
+
readonly name: string;
|
|
81
12
|
readonly description: string;
|
|
13
|
+
readonly parent?: number | null | undefined;
|
|
82
14
|
readonly slug: string;
|
|
83
15
|
readonly meta: {
|
|
84
16
|
readonly [x: string]: unknown;
|
|
85
17
|
};
|
|
86
|
-
}[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
87
|
-
collectTags: (input: {
|
|
88
|
-
readonly [x: number]: number;
|
|
89
|
-
readonly length: number;
|
|
90
|
-
toString: {};
|
|
91
|
-
toLocaleString: {};
|
|
92
|
-
concat: {};
|
|
93
|
-
join: {};
|
|
94
|
-
slice: {};
|
|
95
|
-
indexOf: {};
|
|
96
|
-
lastIndexOf: {};
|
|
97
|
-
every: {};
|
|
98
|
-
some: {};
|
|
99
|
-
forEach: {};
|
|
100
|
-
map: {};
|
|
101
|
-
filter: {};
|
|
102
|
-
reduce: {};
|
|
103
|
-
reduceRight: {};
|
|
104
|
-
find: {};
|
|
105
|
-
findIndex: {};
|
|
106
|
-
entries: {};
|
|
107
|
-
keys: {};
|
|
108
|
-
values: {};
|
|
109
|
-
includes: {};
|
|
110
|
-
flatMap: {};
|
|
111
|
-
flat: {};
|
|
112
|
-
at: {};
|
|
113
|
-
findLast: {};
|
|
114
|
-
findLastIndex: {};
|
|
115
|
-
toReversed: {};
|
|
116
|
-
toSorted: {};
|
|
117
|
-
toSpliced: {};
|
|
118
|
-
with: {};
|
|
119
|
-
[Symbol.iterator]: {};
|
|
120
|
-
readonly [Symbol.unscopables]: {
|
|
121
|
-
readonly [x: number]: boolean | undefined;
|
|
122
|
-
readonly length?: boolean | undefined;
|
|
123
|
-
toString?: boolean | undefined;
|
|
124
|
-
toLocaleString?: boolean | undefined;
|
|
125
|
-
concat?: boolean | undefined;
|
|
126
|
-
join?: boolean | undefined;
|
|
127
|
-
slice?: boolean | undefined;
|
|
128
|
-
indexOf?: boolean | undefined;
|
|
129
|
-
lastIndexOf?: boolean | undefined;
|
|
130
|
-
every?: boolean | undefined;
|
|
131
|
-
some?: boolean | undefined;
|
|
132
|
-
forEach?: boolean | undefined;
|
|
133
|
-
map?: boolean | undefined;
|
|
134
|
-
filter?: boolean | undefined;
|
|
135
|
-
reduce?: boolean | undefined;
|
|
136
|
-
reduceRight?: boolean | undefined;
|
|
137
|
-
find?: boolean | undefined;
|
|
138
|
-
findIndex?: boolean | undefined;
|
|
139
|
-
entries?: boolean | undefined;
|
|
140
|
-
keys?: boolean | undefined;
|
|
141
|
-
values?: boolean | undefined;
|
|
142
|
-
includes?: boolean | undefined;
|
|
143
|
-
flatMap?: boolean | undefined;
|
|
144
|
-
flat?: boolean | undefined;
|
|
145
|
-
at?: boolean | undefined;
|
|
146
|
-
findLast?: boolean | undefined;
|
|
147
|
-
findLastIndex?: boolean | undefined;
|
|
148
|
-
toReversed?: boolean | undefined;
|
|
149
|
-
toSorted?: boolean | undefined;
|
|
150
|
-
toSpliced?: boolean | undefined;
|
|
151
|
-
with?: boolean | undefined;
|
|
152
|
-
[Symbol.iterator]?: boolean | undefined;
|
|
153
|
-
readonly [Symbol.unscopables]?: boolean | undefined;
|
|
154
|
-
};
|
|
155
|
-
}) => Effect.Effect<readonly {
|
|
156
|
-
readonly name: string;
|
|
18
|
+
}[], import("@withstudiocms/kysely/client").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
19
|
+
collectTags: (input: readonly number[]) => Effect.Effect<readonly {
|
|
157
20
|
readonly id: number;
|
|
21
|
+
readonly name: string;
|
|
158
22
|
readonly description: string;
|
|
159
23
|
readonly slug: string;
|
|
160
24
|
readonly meta: {
|
|
161
25
|
readonly [x: string]: unknown;
|
|
162
26
|
};
|
|
163
|
-
}[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
27
|
+
}[], import("@withstudiocms/kysely/client").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
164
28
|
collectPageData: {
|
|
165
|
-
(page: import("../../types.js").tsPageDataSelect, tree: import("../../types.js").FolderNode[]): Effect.Effect<import("../../types.js").CombinedPageData, import("./collectors.js").CollectorError | import("./folderTree.js").FolderTreeError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("effect/ParseResult").ParseError, never>;
|
|
166
|
-
(page: import("../../types.js").tsPageDataSelect, tree: import("../../types.js").FolderNode[], metaOnly: boolean): Effect.Effect<import("../../types.js").MetaOnlyPageData, import("./collectors.js").CollectorError | import("./folderTree.js").FolderTreeError | import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("effect/ParseResult").ParseError, never>;
|
|
29
|
+
(page: import("../../types.js").tsPageDataSelect, tree: import("../../types.js").FolderNode[]): Effect.Effect<import("../../types.js").CombinedPageData, import("./collectors.js").CollectorError | import("./folderTree.js").FolderTreeError | import("@withstudiocms/kysely/client").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("effect/ParseResult").ParseError, never>;
|
|
30
|
+
(page: import("../../types.js").tsPageDataSelect, tree: import("../../types.js").FolderNode[], metaOnly: boolean): Effect.Effect<import("../../types.js").MetaOnlyPageData, import("./collectors.js").CollectorError | import("./folderTree.js").FolderTreeError | import("@withstudiocms/kysely/client").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("effect/ParseResult").ParseError, never>;
|
|
167
31
|
};
|
|
168
32
|
collectUserData: (user: {
|
|
169
|
-
readonly name: string;
|
|
170
33
|
readonly id: string;
|
|
171
|
-
readonly url
|
|
172
|
-
readonly
|
|
173
|
-
readonly
|
|
34
|
+
readonly url?: string | null | undefined;
|
|
35
|
+
readonly name: string;
|
|
36
|
+
readonly email?: string | null | undefined;
|
|
37
|
+
readonly avatar?: string | null | undefined;
|
|
174
38
|
readonly username: string;
|
|
175
|
-
readonly password
|
|
39
|
+
readonly password?: string | null | undefined;
|
|
176
40
|
readonly updatedAt: Date;
|
|
177
41
|
readonly createdAt: Date;
|
|
178
42
|
readonly emailVerified: boolean;
|
|
179
|
-
readonly notifications
|
|
180
|
-
}) => Effect.Effect<import("../../types.js").CombinedUserData, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
43
|
+
readonly notifications?: string | null | undefined;
|
|
44
|
+
}) => Effect.Effect<import("../../types.js").CombinedUserData, import("@withstudiocms/kysely/client").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
181
45
|
};
|
|
182
46
|
FolderTree: {
|
|
183
47
|
generateFolderTree: (folders: readonly {
|
|
184
|
-
readonly name: string;
|
|
185
48
|
readonly id: string;
|
|
186
|
-
readonly
|
|
49
|
+
readonly name: string;
|
|
50
|
+
readonly parent?: string | null | undefined;
|
|
187
51
|
}[]) => Effect.Effect<import("../../types.js").FolderNode[], import("./folderTree.js").FolderTreeError, never>;
|
|
188
52
|
getFullPath: (tree: import("../../types.js").FolderNode[], path: string[]) => Effect.Effect<string[], import("./folderTree.js").FolderTreeError, never>;
|
|
189
53
|
findNodeByPath: (tree: import("../../types.js").FolderNode[], path: string[]) => Effect.Effect<import("../../types.js").FolderNode | null, import("./folderTree.js").FolderTreeError, never>;
|
|
@@ -191,8 +55,8 @@ export declare const SDKUtilModule: Effect.Effect<{
|
|
|
191
55
|
findNodesAlongPathToId: (tree: import("../../types.js").FolderNode[], id: string) => Effect.Effect<import("../../types.js").FolderNode[], import("./folderTree.js").FolderTreeError, never>;
|
|
192
56
|
findNodeById: (tree: import("../../types.js").FolderNode[], id: string) => Effect.Effect<import("../../types.js").FolderNode | null, import("./folderTree.js").FolderTreeError, never>;
|
|
193
57
|
addPageToFolderTree: (tree: import("../../types.js").FolderNode[], folderId: string, newPage: import("../../types.js").FolderNode) => Effect.Effect<import("../../types.js").FolderNode[], import("./folderTree.js").FolderTreeError, never>;
|
|
194
|
-
buildFolderTree: Effect.Effect<import("../../types.js").FolderNode[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./folderTree.js").FolderTreeError, never>;
|
|
195
|
-
getAvailableFolders: Effect.Effect<import("../../types.js").FolderListItem[], import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
58
|
+
buildFolderTree: Effect.Effect<import("../../types.js").FolderNode[], import("@withstudiocms/kysely/client").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError | import("./folderTree.js").FolderTreeError, never>;
|
|
59
|
+
getAvailableFolders: Effect.Effect<import("../../types.js").FolderListItem[], import("@withstudiocms/kysely/client").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").DatabaseError, never>;
|
|
196
60
|
};
|
|
197
61
|
Generators: {
|
|
198
62
|
generateRandomIDNumber: (length: number) => Effect.Effect<number, import("./generators.js").GeneratorError, never>;
|
|
@@ -204,8 +68,8 @@ export declare const SDKUtilModule: Effect.Effect<{
|
|
|
204
68
|
getVersion: (pkg: string, ver?: string | undefined) => Effect.Effect<{
|
|
205
69
|
version: string;
|
|
206
70
|
lastCacheUpdate: Date;
|
|
207
|
-
}, import("effect/Cause").UnknownException |
|
|
208
|
-
getDataFromNPM: (pkg: string, ver?: string | undefined) => Effect.Effect<import("./getFromNPM.js").NpmRegistryResponseSchema, import("effect/Cause").UnknownException |
|
|
71
|
+
}, import("effect/Cause").UnknownException | import("effect/ParseResult").ParseError | import("./getFromNPM.js").GetFromNPMError, never>;
|
|
72
|
+
getDataFromNPM: (pkg: string, ver?: string | undefined) => Effect.Effect<import("./getFromNPM.js").NpmRegistryResponseSchema, import("effect/Cause").UnknownException | import("effect/ParseResult").ParseError | import("./getFromNPM.js").GetFromNPMError, never>;
|
|
209
73
|
};
|
|
210
74
|
Parsers: {
|
|
211
75
|
parseIdNumberArray: (ids: unknown) => Effect.Effect<readonly number[], import("effect/ParseResult").ParseError, never>;
|
|
@@ -214,23 +78,23 @@ export declare const SDKUtilModule: Effect.Effect<{
|
|
|
214
78
|
};
|
|
215
79
|
Users: {
|
|
216
80
|
verifyRank: (users: readonly {
|
|
217
|
-
readonly name: string;
|
|
218
81
|
readonly id: string;
|
|
219
|
-
readonly url
|
|
220
|
-
readonly
|
|
221
|
-
readonly
|
|
82
|
+
readonly url?: string | null | undefined;
|
|
83
|
+
readonly name: string;
|
|
84
|
+
readonly email?: string | null | undefined;
|
|
85
|
+
readonly avatar?: string | null | undefined;
|
|
222
86
|
readonly username: string;
|
|
223
|
-
readonly password
|
|
87
|
+
readonly password?: string | null | undefined;
|
|
224
88
|
readonly updatedAt: Date;
|
|
225
89
|
readonly createdAt: Date;
|
|
226
90
|
readonly emailVerified: boolean;
|
|
227
|
-
readonly notifications
|
|
91
|
+
readonly notifications?: string | null | undefined;
|
|
228
92
|
}[], permissions: readonly {
|
|
229
93
|
readonly user: string;
|
|
230
94
|
readonly rank: "owner" | "admin" | "editor" | "visitor" | "unknown";
|
|
231
95
|
}[], rank: string) => Effect.Effect<import("../../types.js").SingleRank[], import("./users.js").UsersError, never>;
|
|
232
96
|
combineRanks: (rank: string, users: import("../../types.js").SingleRank[]) => Effect.Effect<import("../../types.js").CombinedRank[], import("./users.js").UsersError, never>;
|
|
233
|
-
clearUserReferences: (userId: string) => Effect.Effect<boolean, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").QueryError | import("@withstudiocms/kysely/core/errors").NotFoundError, never>;
|
|
97
|
+
clearUserReferences: (userId: string) => Effect.Effect<boolean, import("@withstudiocms/kysely/client").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").QueryError | import("@withstudiocms/kysely/core/errors").NotFoundError, never>;
|
|
234
98
|
};
|
|
235
|
-
}, import("effect/ConfigError").ConfigError, import("../../context.js").DBClientLive | import("../../context.js").SDKDefaults | import("../../cache.js").CacheService>;
|
|
99
|
+
}, import("effect/ConfigError").ConfigError, import("../../context.js").DBClientLive | import("../../context.js").SDKDefaults | import("../../context.js").StorageManagerResolver | import("../../cache.js").CacheService>;
|
|
236
100
|
export default SDKUtilModule;
|
|
@@ -78,22 +78,22 @@ export declare const useUsersError: <T>(_try: () => T) => Effect.Effect<T, Users
|
|
|
78
78
|
*/
|
|
79
79
|
export declare const SDKUsers: Effect.Effect<{
|
|
80
80
|
verifyRank: (users: readonly {
|
|
81
|
-
readonly name: string;
|
|
82
81
|
readonly id: string;
|
|
83
|
-
readonly url
|
|
84
|
-
readonly
|
|
85
|
-
readonly
|
|
82
|
+
readonly url?: string | null | undefined;
|
|
83
|
+
readonly name: string;
|
|
84
|
+
readonly email?: string | null | undefined;
|
|
85
|
+
readonly avatar?: string | null | undefined;
|
|
86
86
|
readonly username: string;
|
|
87
|
-
readonly password
|
|
87
|
+
readonly password?: string | null | undefined;
|
|
88
88
|
readonly updatedAt: Date;
|
|
89
89
|
readonly createdAt: Date;
|
|
90
90
|
readonly emailVerified: boolean;
|
|
91
|
-
readonly notifications
|
|
91
|
+
readonly notifications?: string | null | undefined;
|
|
92
92
|
}[], permissions: readonly {
|
|
93
93
|
readonly user: string;
|
|
94
94
|
readonly rank: "owner" | "admin" | "editor" | "visitor" | "unknown";
|
|
95
95
|
}[], rank: string) => Effect.Effect<SingleRank[], UsersError, never>;
|
|
96
96
|
combineRanks: (rank: string, users: SingleRank[]) => Effect.Effect<CombinedRank[], UsersError, never>;
|
|
97
|
-
clearUserReferences: (userId: string) => Effect.Effect<boolean, import("@withstudiocms/kysely").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").QueryError | import("@withstudiocms/kysely/core/errors").NotFoundError, never>;
|
|
97
|
+
clearUserReferences: (userId: string) => Effect.Effect<boolean, import("@withstudiocms/kysely/client").DBCallbackFailure | import("@withstudiocms/kysely/core/errors").QueryError | import("@withstudiocms/kysely/core/errors").NotFoundError, never>;
|
|
98
98
|
}, never, DBClientLive | SDKDefaults>;
|
|
99
99
|
export {};
|