convex-cms 0.0.16 → 0.0.17
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/admin/dist/types/admin/src/components/ui/field.d.ts +1 -1
- package/admin/dist/types/admin/src/lib/cmsExports.d.ts +6 -6
- package/admin/dist/types/admin/src/lib/cmsExports.d.ts.map +1 -1
- package/admin/src/lib/cmsExports.ts +8 -8
- package/admin-dist/assets/index-DagpgVMo.js +104 -0
- package/admin-dist/embed/favicon.ico +0 -0
- package/admin-dist/embed/index.js +30961 -0
- package/admin-dist/embed/index.js.map +1 -0
- package/admin-dist/index.html +1 -1
- package/package.json +12 -5
- package/admin/dist/types/src/client/admin/bulk.d.ts +0 -79
- package/admin/dist/types/src/client/admin/bulk.d.ts.map +0 -1
- package/admin/dist/types/src/client/admin/contentLock.d.ts +0 -118
- package/admin/dist/types/src/client/admin/contentLock.d.ts.map +0 -1
- package/admin/dist/types/src/client/admin/contentTypes.d.ts +0 -1627
- package/admin/dist/types/src/client/admin/contentTypes.d.ts.map +0 -1
- package/admin/dist/types/src/client/admin/dashboard.d.ts +0 -16
- package/admin/dist/types/src/client/admin/dashboard.d.ts.map +0 -1
- package/admin/dist/types/src/client/admin/entries.d.ts +0 -357
- package/admin/dist/types/src/client/admin/entries.d.ts.map +0 -1
- package/admin/dist/types/src/client/admin/index.d.ts +0 -7502
- package/admin/dist/types/src/client/admin/index.d.ts.map +0 -1
- package/admin/dist/types/src/client/admin/media.d.ts +0 -1038
- package/admin/dist/types/src/client/admin/media.d.ts.map +0 -1
- package/admin/dist/types/src/client/admin/settings.d.ts +0 -50
- package/admin/dist/types/src/client/admin/settings.d.ts.map +0 -1
- package/admin/dist/types/src/client/admin/taxonomies.d.ts +0 -339
- package/admin/dist/types/src/client/admin/taxonomies.d.ts.map +0 -1
- package/admin/dist/types/src/client/admin/trash.d.ts +0 -90
- package/admin/dist/types/src/client/admin/trash.d.ts.map +0 -1
- package/admin/dist/types/src/client/admin/types.d.ts +0 -594
- package/admin/dist/types/src/client/admin/types.d.ts.map +0 -1
- package/admin/dist/types/src/client/admin/users.d.ts +0 -58
- package/admin/dist/types/src/client/admin/users.d.ts.map +0 -1
- package/admin/dist/types/src/client/admin/validators.d.ts +0 -7732
- package/admin/dist/types/src/client/admin/validators.d.ts.map +0 -1
- package/admin/dist/types/src/client/admin/versions.d.ts +0 -106
- package/admin/dist/types/src/client/admin/versions.d.ts.map +0 -1
- package/admin/dist/types/src/client/adminConfig.d.ts +0 -125
- package/admin/dist/types/src/client/adminConfig.d.ts.map +0 -1
- package/admin/dist/types/src/client/config.d.ts +0 -155
- package/admin/dist/types/src/client/config.d.ts.map +0 -1
- package/admin/dist/types/src/client/field-types.d.ts +0 -55
- package/admin/dist/types/src/client/field-types.d.ts.map +0 -1
- package/admin/dist/types/src/client/fields.d.ts +0 -70
- package/admin/dist/types/src/client/fields.d.ts.map +0 -1
- package/admin/dist/types/src/client/registry.d.ts +0 -77
- package/admin/dist/types/src/client/registry.d.ts.map +0 -1
- package/admin/dist/types/src/client/schema/defineContentType.d.ts +0 -233
- package/admin/dist/types/src/client/schema/defineContentType.d.ts.map +0 -1
- package/admin/dist/types/src/client/schema/types.d.ts +0 -540
- package/admin/dist/types/src/client/schema/types.d.ts.map +0 -1
- package/admin/dist/types/src/client/types.d.ts +0 -449
- package/admin/dist/types/src/client/types.d.ts.map +0 -1
- package/admin/dist/types/src/client/utils/toSlug.d.ts +0 -60
- package/admin/dist/types/src/client/utils/toSlug.d.ts.map +0 -1
- package/admin/dist/types/src/client/workflows.d.ts +0 -51
- package/admin/dist/types/src/client/workflows.d.ts.map +0 -1
- package/admin/dist/types/src/component/_generated/component.d.ts +0 -4813
- package/admin/dist/types/src/component/_generated/component.d.ts.map +0 -1
- package/admin/dist/types/src/component/_generated/dataModel.d.ts +0 -46
- package/admin/dist/types/src/component/_generated/dataModel.d.ts.map +0 -1
- package/admin/dist/types/src/component/_generated/server.d.ts +0 -121
- package/admin/dist/types/src/component/_generated/server.d.ts.map +0 -1
- package/admin/dist/types/src/component/contentEntryMutations.d.ts +0 -551
- package/admin/dist/types/src/component/contentEntryMutations.d.ts.map +0 -1
- package/admin/dist/types/src/component/contentLock.d.ts +0 -328
- package/admin/dist/types/src/component/contentLock.d.ts.map +0 -1
- package/admin/dist/types/src/component/contentTypeMutations.d.ts +0 -1253
- package/admin/dist/types/src/component/contentTypeMutations.d.ts.map +0 -1
- package/admin/dist/types/src/component/documentTypes.d.ts +0 -186
- package/admin/dist/types/src/component/documentTypes.d.ts.map +0 -1
- package/admin/dist/types/src/component/eventEmitter.d.ts +0 -309
- package/admin/dist/types/src/component/eventEmitter.d.ts.map +0 -1
- package/admin/dist/types/src/component/lib/errors.d.ts +0 -306
- package/admin/dist/types/src/component/lib/errors.d.ts.map +0 -1
- package/admin/dist/types/src/component/lib/metadataExtractor.d.ts +0 -245
- package/admin/dist/types/src/component/lib/metadataExtractor.d.ts.map +0 -1
- package/admin/dist/types/src/component/lib/mutationAuth.d.ts +0 -95
- package/admin/dist/types/src/component/lib/mutationAuth.d.ts.map +0 -1
- package/admin/dist/types/src/component/lib/slugGenerator.d.ts +0 -71
- package/admin/dist/types/src/component/lib/slugGenerator.d.ts.map +0 -1
- package/admin/dist/types/src/component/lib/slugUniqueness.d.ts +0 -131
- package/admin/dist/types/src/component/lib/slugUniqueness.d.ts.map +0 -1
- package/admin/dist/types/src/component/lib/softDelete.d.ts +0 -18
- package/admin/dist/types/src/component/lib/softDelete.d.ts.map +0 -1
- package/admin/dist/types/src/component/localeFields.d.ts +0 -508
- package/admin/dist/types/src/component/localeFields.d.ts.map +0 -1
- package/admin/dist/types/src/component/mediaAssetMutations.d.ts +0 -282
- package/admin/dist/types/src/component/mediaAssetMutations.d.ts.map +0 -1
- package/admin/dist/types/src/component/schema.d.ts +0 -5248
- package/admin/dist/types/src/component/schema.d.ts.map +0 -1
- package/admin/dist/types/src/component/validation.d.ts +0 -407
- package/admin/dist/types/src/component/validation.d.ts.map +0 -1
- package/admin/dist/types/src/component/validators.d.ts +0 -5722
- package/admin/dist/types/src/component/validators.d.ts.map +0 -1
- package/admin/dist/types/src/react/index.d.ts +0 -493
- package/admin/dist/types/src/react/index.d.ts.map +0 -1
- package/admin-dist/assets/index-DTgANhXL.js +0 -104
|
@@ -1,594 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Admin API Types
|
|
3
|
-
*
|
|
4
|
-
* Non-derivable types for the Admin API including options, operations, and auth context.
|
|
5
|
-
*/
|
|
6
|
-
import type { Auth, RegisteredQuery, RegisteredMutation, FunctionReference } from "convex/server";
|
|
7
|
-
/**
|
|
8
|
-
* Operation context passed to the auth callback.
|
|
9
|
-
* Expanded to cover all ~97 operations.
|
|
10
|
-
*/
|
|
11
|
-
export type AdminOperation = {
|
|
12
|
-
type: "getDashboardStats";
|
|
13
|
-
} | {
|
|
14
|
-
type: "getSettings";
|
|
15
|
-
} | {
|
|
16
|
-
type: "updateSettings";
|
|
17
|
-
} | {
|
|
18
|
-
type: "resetSettings";
|
|
19
|
-
} | {
|
|
20
|
-
type: "listCmsUsers";
|
|
21
|
-
} | {
|
|
22
|
-
type: "getCmsUser";
|
|
23
|
-
} | {
|
|
24
|
-
type: "setCmsUserRole";
|
|
25
|
-
} | {
|
|
26
|
-
type: "inviteCmsUser";
|
|
27
|
-
} | {
|
|
28
|
-
type: "removeCmsUser";
|
|
29
|
-
} | {
|
|
30
|
-
type: "listContentTypes";
|
|
31
|
-
} | {
|
|
32
|
-
type: "getContentType";
|
|
33
|
-
id?: string;
|
|
34
|
-
name?: string;
|
|
35
|
-
} | {
|
|
36
|
-
type: "createContentType";
|
|
37
|
-
} | {
|
|
38
|
-
type: "updateContentType";
|
|
39
|
-
id: string;
|
|
40
|
-
} | {
|
|
41
|
-
type: "deleteContentType";
|
|
42
|
-
id: string;
|
|
43
|
-
} | {
|
|
44
|
-
type: "syncContentTypes";
|
|
45
|
-
} | {
|
|
46
|
-
type: "checkSchemaDrift";
|
|
47
|
-
} | {
|
|
48
|
-
type: "listEntries";
|
|
49
|
-
contentTypeName?: string;
|
|
50
|
-
} | {
|
|
51
|
-
type: "getEntry";
|
|
52
|
-
id: string;
|
|
53
|
-
} | {
|
|
54
|
-
type: "createEntry";
|
|
55
|
-
contentTypeName: string;
|
|
56
|
-
} | {
|
|
57
|
-
type: "updateEntry";
|
|
58
|
-
id: string;
|
|
59
|
-
} | {
|
|
60
|
-
type: "publishEntry";
|
|
61
|
-
id: string;
|
|
62
|
-
} | {
|
|
63
|
-
type: "unpublishEntry";
|
|
64
|
-
id: string;
|
|
65
|
-
} | {
|
|
66
|
-
type: "deleteEntry";
|
|
67
|
-
id: string;
|
|
68
|
-
} | {
|
|
69
|
-
type: "duplicateEntry";
|
|
70
|
-
id: string;
|
|
71
|
-
} | {
|
|
72
|
-
type: "scheduleEntry";
|
|
73
|
-
id: string;
|
|
74
|
-
} | {
|
|
75
|
-
type: "cancelScheduledEntry";
|
|
76
|
-
id: string;
|
|
77
|
-
} | {
|
|
78
|
-
type: "getScheduledEntries";
|
|
79
|
-
} | {
|
|
80
|
-
type: "restoreEntry";
|
|
81
|
-
id: string;
|
|
82
|
-
} | {
|
|
83
|
-
type: "getEntryBySlug";
|
|
84
|
-
contentTypeName: string;
|
|
85
|
-
slug: string;
|
|
86
|
-
} | {
|
|
87
|
-
type: "getEntryBySlugAndTypeName";
|
|
88
|
-
contentTypeName: string;
|
|
89
|
-
slug: string;
|
|
90
|
-
} | {
|
|
91
|
-
type: "bulkPublish";
|
|
92
|
-
} | {
|
|
93
|
-
type: "bulkUnpublish";
|
|
94
|
-
} | {
|
|
95
|
-
type: "bulkDelete";
|
|
96
|
-
} | {
|
|
97
|
-
type: "bulkUpdate";
|
|
98
|
-
} | {
|
|
99
|
-
type: "bulkRestore";
|
|
100
|
-
} | {
|
|
101
|
-
type: "getTrashConfig";
|
|
102
|
-
} | {
|
|
103
|
-
type: "listTrash";
|
|
104
|
-
} | {
|
|
105
|
-
type: "getTrashStats";
|
|
106
|
-
} | {
|
|
107
|
-
type: "updateTrashConfig";
|
|
108
|
-
} | {
|
|
109
|
-
type: "emptyTrash";
|
|
110
|
-
} | {
|
|
111
|
-
type: "runTrashCleanup";
|
|
112
|
-
} | {
|
|
113
|
-
type: "checkContentLock";
|
|
114
|
-
id: string;
|
|
115
|
-
} | {
|
|
116
|
-
type: "listLockedContent";
|
|
117
|
-
} | {
|
|
118
|
-
type: "acquireContentLock";
|
|
119
|
-
id: string;
|
|
120
|
-
} | {
|
|
121
|
-
type: "releaseContentLock";
|
|
122
|
-
id: string;
|
|
123
|
-
} | {
|
|
124
|
-
type: "renewContentLock";
|
|
125
|
-
id: string;
|
|
126
|
-
} | {
|
|
127
|
-
type: "forceReleaseContentLock";
|
|
128
|
-
id: string;
|
|
129
|
-
} | {
|
|
130
|
-
type: "getVersionHistory";
|
|
131
|
-
entryId: string;
|
|
132
|
-
} | {
|
|
133
|
-
type: "getVersion";
|
|
134
|
-
entryId: string;
|
|
135
|
-
} | {
|
|
136
|
-
type: "compareVersions";
|
|
137
|
-
entryId: string;
|
|
138
|
-
} | {
|
|
139
|
-
type: "rollbackVersion";
|
|
140
|
-
entryId: string;
|
|
141
|
-
} | {
|
|
142
|
-
type: "listMediaAssets";
|
|
143
|
-
} | {
|
|
144
|
-
type: "getMediaAsset";
|
|
145
|
-
id: string;
|
|
146
|
-
} | {
|
|
147
|
-
type: "createMediaAsset";
|
|
148
|
-
} | {
|
|
149
|
-
type: "updateMediaAsset";
|
|
150
|
-
id: string;
|
|
151
|
-
} | {
|
|
152
|
-
type: "deleteMediaAsset";
|
|
153
|
-
id: string;
|
|
154
|
-
} | {
|
|
155
|
-
type: "restoreMediaAsset";
|
|
156
|
-
id: string;
|
|
157
|
-
} | {
|
|
158
|
-
type: "permanentDeleteMediaAsset";
|
|
159
|
-
id: string;
|
|
160
|
-
} | {
|
|
161
|
-
type: "bulkPermanentDeleteMediaAssets";
|
|
162
|
-
} | {
|
|
163
|
-
type: "moveMediaAssets";
|
|
164
|
-
} | {
|
|
165
|
-
type: "getMediaTrashCount";
|
|
166
|
-
} | {
|
|
167
|
-
type: "listMediaFolders";
|
|
168
|
-
} | {
|
|
169
|
-
type: "getMediaFolder";
|
|
170
|
-
id: string;
|
|
171
|
-
} | {
|
|
172
|
-
type: "getMediaFolderTree";
|
|
173
|
-
} | {
|
|
174
|
-
type: "createMediaFolder";
|
|
175
|
-
} | {
|
|
176
|
-
type: "updateMediaFolder";
|
|
177
|
-
id: string;
|
|
178
|
-
} | {
|
|
179
|
-
type: "moveMediaFolder";
|
|
180
|
-
id: string;
|
|
181
|
-
} | {
|
|
182
|
-
type: "deleteMediaFolder";
|
|
183
|
-
id: string;
|
|
184
|
-
} | {
|
|
185
|
-
type: "restoreMediaFolder";
|
|
186
|
-
id: string;
|
|
187
|
-
} | {
|
|
188
|
-
type: "listMediaVariants";
|
|
189
|
-
assetId: string;
|
|
190
|
-
} | {
|
|
191
|
-
type: "getMediaVariant";
|
|
192
|
-
id: string;
|
|
193
|
-
} | {
|
|
194
|
-
type: "getBestMediaVariant";
|
|
195
|
-
assetId: string;
|
|
196
|
-
} | {
|
|
197
|
-
type: "getMediaResponsiveSrcset";
|
|
198
|
-
assetId: string;
|
|
199
|
-
} | {
|
|
200
|
-
type: "getMediaVariantPresets";
|
|
201
|
-
} | {
|
|
202
|
-
type: "getMediaAssetWithVariants";
|
|
203
|
-
assetId: string;
|
|
204
|
-
} | {
|
|
205
|
-
type: "createMediaVariant";
|
|
206
|
-
} | {
|
|
207
|
-
type: "requestMediaVariantGeneration";
|
|
208
|
-
} | {
|
|
209
|
-
type: "deleteMediaVariant";
|
|
210
|
-
id: string;
|
|
211
|
-
} | {
|
|
212
|
-
type: "deleteMediaAssetVariants";
|
|
213
|
-
assetId: string;
|
|
214
|
-
} | {
|
|
215
|
-
type: "generateMediaVariantsFromPresets";
|
|
216
|
-
} | {
|
|
217
|
-
type: "restoreMediaVariant";
|
|
218
|
-
id: string;
|
|
219
|
-
} | {
|
|
220
|
-
type: "generateUploadUrl";
|
|
221
|
-
} | {
|
|
222
|
-
type: "getTaxonomy";
|
|
223
|
-
id?: string;
|
|
224
|
-
name?: string;
|
|
225
|
-
} | {
|
|
226
|
-
type: "listTaxonomies";
|
|
227
|
-
} | {
|
|
228
|
-
type: "createTaxonomy";
|
|
229
|
-
} | {
|
|
230
|
-
type: "updateTaxonomy";
|
|
231
|
-
id: string;
|
|
232
|
-
} | {
|
|
233
|
-
type: "deleteTaxonomy";
|
|
234
|
-
id: string;
|
|
235
|
-
} | {
|
|
236
|
-
type: "restoreTaxonomy";
|
|
237
|
-
id: string;
|
|
238
|
-
} | {
|
|
239
|
-
type: "getTerm";
|
|
240
|
-
id?: string;
|
|
241
|
-
} | {
|
|
242
|
-
type: "listTerms";
|
|
243
|
-
taxonomyId: string;
|
|
244
|
-
} | {
|
|
245
|
-
type: "getTermsHierarchy";
|
|
246
|
-
taxonomyId: string;
|
|
247
|
-
} | {
|
|
248
|
-
type: "suggestTerms";
|
|
249
|
-
taxonomyId: string;
|
|
250
|
-
} | {
|
|
251
|
-
type: "countTerms";
|
|
252
|
-
taxonomyId: string;
|
|
253
|
-
} | {
|
|
254
|
-
type: "createTerm";
|
|
255
|
-
taxonomyId: string;
|
|
256
|
-
} | {
|
|
257
|
-
type: "updateTerm";
|
|
258
|
-
id: string;
|
|
259
|
-
} | {
|
|
260
|
-
type: "deleteTerm";
|
|
261
|
-
id: string;
|
|
262
|
-
} | {
|
|
263
|
-
type: "restoreTerm";
|
|
264
|
-
id: string;
|
|
265
|
-
} | {
|
|
266
|
-
type: "getTermsByEntry";
|
|
267
|
-
entryId: string;
|
|
268
|
-
} | {
|
|
269
|
-
type: "getEntriesByTerm";
|
|
270
|
-
termId: string;
|
|
271
|
-
} | {
|
|
272
|
-
type: "setEntryTerms";
|
|
273
|
-
entryId: string;
|
|
274
|
-
} | {
|
|
275
|
-
type: "addTermToEntry";
|
|
276
|
-
entryId: string;
|
|
277
|
-
} | {
|
|
278
|
-
type: "removeTermFromEntry";
|
|
279
|
-
entryId: string;
|
|
280
|
-
} | {
|
|
281
|
-
type: "createTermAndAddToEntry";
|
|
282
|
-
entryId: string;
|
|
283
|
-
} | {
|
|
284
|
-
type: "getTermsByMedia";
|
|
285
|
-
mediaId: string;
|
|
286
|
-
} | {
|
|
287
|
-
type: "getMediaByTerm";
|
|
288
|
-
termId: string;
|
|
289
|
-
} | {
|
|
290
|
-
type: "setMediaTerms";
|
|
291
|
-
mediaId: string;
|
|
292
|
-
} | {
|
|
293
|
-
type: "addTermToMedia";
|
|
294
|
-
mediaId: string;
|
|
295
|
-
} | {
|
|
296
|
-
type: "removeTermFromMedia";
|
|
297
|
-
mediaId: string;
|
|
298
|
-
} | {
|
|
299
|
-
type: "createTermAndAddToMedia";
|
|
300
|
-
mediaId: string;
|
|
301
|
-
};
|
|
302
|
-
/**
|
|
303
|
-
* Feature flags for CMS functionality.
|
|
304
|
-
* Used to enable/disable features at configuration time.
|
|
305
|
-
*/
|
|
306
|
-
export interface FeatureFlagsConfig {
|
|
307
|
-
versioning?: boolean;
|
|
308
|
-
scheduling?: boolean;
|
|
309
|
-
localization?: boolean;
|
|
310
|
-
mediaManagement?: boolean;
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Options for configuring the admin API.
|
|
314
|
-
*/
|
|
315
|
-
/**
|
|
316
|
-
* Return type from the auth callback.
|
|
317
|
-
* Can be a simple user ID string, a rich profile object, or null for anonymous.
|
|
318
|
-
*/
|
|
319
|
-
export type AuthResult = string | {
|
|
320
|
-
userId: string;
|
|
321
|
-
name?: string;
|
|
322
|
-
email?: string;
|
|
323
|
-
avatarUrl?: string;
|
|
324
|
-
} | null;
|
|
325
|
-
export interface AdminApiOptions {
|
|
326
|
-
/**
|
|
327
|
-
* Optional authentication callback.
|
|
328
|
-
*
|
|
329
|
-
* Called before each operation to validate access. Should throw if
|
|
330
|
-
* unauthorized.
|
|
331
|
-
*
|
|
332
|
-
* Return either:
|
|
333
|
-
* - A user ID string (backward compatible)
|
|
334
|
-
* - A profile object `{ userId, name?, email?, avatarUrl? }` for richer user display
|
|
335
|
-
* - `null` for anonymous access
|
|
336
|
-
*
|
|
337
|
-
* When a profile object is returned, the CMS auto-registers the user with
|
|
338
|
-
* their display name and email in the Users page.
|
|
339
|
-
*
|
|
340
|
-
* @example
|
|
341
|
-
* ```typescript
|
|
342
|
-
* auth: async (ctx, operation) => {
|
|
343
|
-
* const identity = await ctx.auth.getUserIdentity();
|
|
344
|
-
* if (!identity) throw new Error("Unauthorized");
|
|
345
|
-
* return {
|
|
346
|
-
* userId: identity.subject,
|
|
347
|
-
* name: identity.name,
|
|
348
|
-
* email: identity.email,
|
|
349
|
-
* };
|
|
350
|
-
* }
|
|
351
|
-
* ```
|
|
352
|
-
*/
|
|
353
|
-
auth?: (ctx: {
|
|
354
|
-
auth: Auth;
|
|
355
|
-
db?: any;
|
|
356
|
-
}, operation: AdminOperation) => Promise<AuthResult>;
|
|
357
|
-
/**
|
|
358
|
-
* Feature flags for the CMS.
|
|
359
|
-
*
|
|
360
|
-
* Features defined here are read-only in the admin UI.
|
|
361
|
-
* Unspecified features use defaults:
|
|
362
|
-
* - versioning: true
|
|
363
|
-
* - scheduling: true
|
|
364
|
-
* - localization: false
|
|
365
|
-
* - mediaManagement: true
|
|
366
|
-
*
|
|
367
|
-
* @example
|
|
368
|
-
* ```typescript
|
|
369
|
-
* features: {
|
|
370
|
-
* versioning: true,
|
|
371
|
-
* scheduling: true,
|
|
372
|
-
* localization: false, // explicitly disabled
|
|
373
|
-
* // mediaManagement uses default (true)
|
|
374
|
-
* }
|
|
375
|
-
* ```
|
|
376
|
-
*/
|
|
377
|
-
features?: FeatureFlagsConfig;
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* Context type for checkAuth helper.
|
|
381
|
-
*/
|
|
382
|
-
export interface AuthContext {
|
|
383
|
-
auth: Auth;
|
|
384
|
-
/** Available in mutation contexts for profile lookups */
|
|
385
|
-
db?: any;
|
|
386
|
-
}
|
|
387
|
-
/**
|
|
388
|
-
* Resolved feature flags with all values defined.
|
|
389
|
-
*/
|
|
390
|
-
export interface ResolvedFeatureFlags {
|
|
391
|
-
versioning: boolean;
|
|
392
|
-
scheduling: boolean;
|
|
393
|
-
localization: boolean;
|
|
394
|
-
mediaManagement: boolean;
|
|
395
|
-
}
|
|
396
|
-
/**
|
|
397
|
-
* Base interface for any object with a slug property.
|
|
398
|
-
* This allows both ContentTypeDefinition and ContentTypeHelpers to be used.
|
|
399
|
-
*/
|
|
400
|
-
export interface HasSlug {
|
|
401
|
-
readonly slug: string;
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
* A record of content types with slugs, keyed by any string.
|
|
405
|
-
* This accepts both ContentTypeDefinition and ContentTypeHelpers.
|
|
406
|
-
*
|
|
407
|
-
* @example
|
|
408
|
-
* ```typescript
|
|
409
|
-
* // Using defineContentType directly
|
|
410
|
-
* const roadmapItem = defineContentType({ name: "Roadmap Item", ... });
|
|
411
|
-
* defineAdminAPI(component, { contentTypes: { roadmapItem } });
|
|
412
|
-
*
|
|
413
|
-
* // Using createCms().defineContent()
|
|
414
|
-
* const blogPost = cms.defineContent({ name: "Blog Post", ... });
|
|
415
|
-
* defineAdminAPI(component, { contentTypes: { blogPost } });
|
|
416
|
-
* ```
|
|
417
|
-
*/
|
|
418
|
-
export type ContentTypeHelpersSchema = Record<string, HasSlug>;
|
|
419
|
-
/**
|
|
420
|
-
* Extracts the union of all slug strings from a ContentTypeHelpersSchema.
|
|
421
|
-
*
|
|
422
|
-
* @example
|
|
423
|
-
* ```typescript
|
|
424
|
-
* const contentTypes = { blogPost, author };
|
|
425
|
-
* type Slugs = ContentTypeSlugs<typeof contentTypes>;
|
|
426
|
-
* // "blog_post" | "author"
|
|
427
|
-
* ```
|
|
428
|
-
*/
|
|
429
|
-
export type ContentTypeSlugs<T extends ContentTypeHelpersSchema> = {
|
|
430
|
-
[K in keyof T]: T[K]["slug"];
|
|
431
|
-
}[keyof T];
|
|
432
|
-
/**
|
|
433
|
-
* Options for type-safe admin API with content type inference.
|
|
434
|
-
*/
|
|
435
|
-
export interface TypedAdminApiOptions<T extends ContentTypeHelpersSchema> extends AdminApiOptions {
|
|
436
|
-
/**
|
|
437
|
-
* Content type helpers for TypeScript inference.
|
|
438
|
-
* Pass the helpers created by cms.defineContent() to enable
|
|
439
|
-
* autocomplete for contentTypeName arguments.
|
|
440
|
-
*/
|
|
441
|
-
contentTypes: T;
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* Args for listEntries query with narrowed contentTypeName.
|
|
445
|
-
*/
|
|
446
|
-
type ListEntriesArgs<TSlugs extends string> = {
|
|
447
|
-
contentTypeName?: TSlugs;
|
|
448
|
-
status?: "draft" | "published" | "archived" | "scheduled";
|
|
449
|
-
search?: string;
|
|
450
|
-
locale?: string;
|
|
451
|
-
paginationOpts: {
|
|
452
|
-
numItems: number;
|
|
453
|
-
cursor: string | null;
|
|
454
|
-
};
|
|
455
|
-
};
|
|
456
|
-
/**
|
|
457
|
-
* Args for createEntry mutation with narrowed contentTypeName.
|
|
458
|
-
*/
|
|
459
|
-
type CreateEntryArgs<TSlugs extends string> = {
|
|
460
|
-
contentTypeName: TSlugs;
|
|
461
|
-
data: unknown;
|
|
462
|
-
slug?: string;
|
|
463
|
-
status?: "draft" | "published" | "archived" | "scheduled";
|
|
464
|
-
locale?: string;
|
|
465
|
-
primaryEntryId?: string;
|
|
466
|
-
createdBy?: string;
|
|
467
|
-
};
|
|
468
|
-
/**
|
|
469
|
-
* Args for getEntryBySlug query with narrowed contentTypeName.
|
|
470
|
-
*/
|
|
471
|
-
type GetEntryBySlugArgs<TSlugs extends string> = {
|
|
472
|
-
contentTypeName: TSlugs;
|
|
473
|
-
slug: string;
|
|
474
|
-
status?: string;
|
|
475
|
-
};
|
|
476
|
-
/**
|
|
477
|
-
* Args for getScheduledEntries query with narrowed contentTypeName.
|
|
478
|
-
*/
|
|
479
|
-
type GetScheduledEntriesArgs<TSlugs extends string> = {
|
|
480
|
-
contentTypeName?: TSlugs;
|
|
481
|
-
paginationOpts: {
|
|
482
|
-
numItems: number;
|
|
483
|
-
cursor: string | null;
|
|
484
|
-
};
|
|
485
|
-
};
|
|
486
|
-
/**
|
|
487
|
-
* Common return type for paginated entry lists.
|
|
488
|
-
* Note: FunctionReference return types are unwrapped (not wrapped in Promise).
|
|
489
|
-
*/
|
|
490
|
-
type PaginatedEntriesReturn = {
|
|
491
|
-
page: Array<{
|
|
492
|
-
_id: string;
|
|
493
|
-
_creationTime: number;
|
|
494
|
-
contentTypeName: string;
|
|
495
|
-
slug: string;
|
|
496
|
-
status: string;
|
|
497
|
-
data: unknown;
|
|
498
|
-
version: number;
|
|
499
|
-
locale?: string;
|
|
500
|
-
createdBy?: string;
|
|
501
|
-
updatedBy?: string;
|
|
502
|
-
firstPublishedAt?: number;
|
|
503
|
-
lastPublishedAt?: number;
|
|
504
|
-
scheduledPublishAt?: number;
|
|
505
|
-
deletedAt?: number;
|
|
506
|
-
}>;
|
|
507
|
-
continueCursor: string | null;
|
|
508
|
-
isDone: boolean;
|
|
509
|
-
};
|
|
510
|
-
/**
|
|
511
|
-
* Single entry object type.
|
|
512
|
-
*/
|
|
513
|
-
type Entry = {
|
|
514
|
-
_id: string;
|
|
515
|
-
_creationTime: number;
|
|
516
|
-
contentTypeName: string;
|
|
517
|
-
slug: string;
|
|
518
|
-
status: string;
|
|
519
|
-
data: unknown;
|
|
520
|
-
version: number;
|
|
521
|
-
locale?: string;
|
|
522
|
-
createdBy?: string;
|
|
523
|
-
updatedBy?: string;
|
|
524
|
-
firstPublishedAt?: number;
|
|
525
|
-
lastPublishedAt?: number;
|
|
526
|
-
scheduledPublishAt?: number;
|
|
527
|
-
deletedAt?: number;
|
|
528
|
-
};
|
|
529
|
-
/**
|
|
530
|
-
* Return type for queries that might not find an entry (getBySlug, etc).
|
|
531
|
-
*/
|
|
532
|
-
type EntryOrNull = Entry | null;
|
|
533
|
-
/**
|
|
534
|
-
* Return type for mutations that always return an entry (createEntry).
|
|
535
|
-
*/
|
|
536
|
-
type EntryReturn = Entry;
|
|
537
|
-
/**
|
|
538
|
-
* Rebuilds Convex function types as explicit public RegisteredQuery /
|
|
539
|
-
* RegisteredMutation types so Convex's ApiFromModules/FilterApi utilities keep
|
|
540
|
-
* recognizing them after mapped-type transformations.
|
|
541
|
-
*/
|
|
542
|
-
type PreservePublicAdminExports<T> = T extends RegisteredQuery<any, infer Args, infer Returns> ? RegisteredQuery<"public", Args, Returns> : T extends RegisteredMutation<any, infer Args, infer Returns> ? RegisteredMutation<"public", Args, Returns> : T extends object ? {
|
|
543
|
-
[K in keyof T]: PreservePublicAdminExports<T[K]>;
|
|
544
|
-
} : T;
|
|
545
|
-
/**
|
|
546
|
-
* Narrows a single key to its typed version if it's a narrowed key.
|
|
547
|
-
* Uses RegisteredQuery/RegisteredMutation to match what FilterApi expects.
|
|
548
|
-
*/
|
|
549
|
-
type NarrowKey<K, TSlugs extends string, TOriginal> = K extends "listEntries" ? RegisteredQuery<"public", ListEntriesArgs<TSlugs>, PaginatedEntriesReturn> : K extends "createEntry" ? RegisteredMutation<"public", CreateEntryArgs<TSlugs>, EntryReturn> : K extends "getEntryBySlug" ? RegisteredQuery<"public", GetEntryBySlugArgs<TSlugs>, EntryOrNull> : K extends "getEntryBySlugAndTypeName" ? RegisteredQuery<"public", GetEntryBySlugArgs<TSlugs>, EntryOrNull> : K extends "getScheduledEntries" ? RegisteredQuery<"public", GetScheduledEntriesArgs<TSlugs>, PaginatedEntriesReturn> : PreservePublicAdminExports<TOriginal>;
|
|
550
|
-
/**
|
|
551
|
-
* Narrows entries namespace keys.
|
|
552
|
-
* Uses RegisteredQuery/RegisteredMutation to match what FilterApi expects.
|
|
553
|
-
*/
|
|
554
|
-
type NarrowEntriesKey<K, TSlugs extends string, TOriginal> = K extends "list" ? RegisteredQuery<"public", ListEntriesArgs<TSlugs>, PaginatedEntriesReturn> : K extends "create" ? RegisteredMutation<"public", CreateEntryArgs<TSlugs>, EntryReturn> : K extends "getBySlug" ? RegisteredQuery<"public", GetEntryBySlugArgs<TSlugs>, EntryOrNull> : K extends "getBySlugAndTypeName" ? RegisteredQuery<"public", GetEntryBySlugArgs<TSlugs>, EntryOrNull> : K extends "getScheduled" ? RegisteredQuery<"public", GetScheduledEntriesArgs<TSlugs>, PaginatedEntriesReturn> : PreservePublicAdminExports<TOriginal>;
|
|
555
|
-
/**
|
|
556
|
-
* Typed entries namespace using pure mapped type.
|
|
557
|
-
*/
|
|
558
|
-
type TypedEntriesNamespace<TSlugs extends string, TEntries> = {
|
|
559
|
-
[K in keyof TEntries]: NarrowEntriesKey<K, TSlugs, TEntries[K]>;
|
|
560
|
-
};
|
|
561
|
-
/**
|
|
562
|
-
* Typed admin API with content type name inference.
|
|
563
|
-
*
|
|
564
|
-
* Uses a pure mapped type (no intersections) for compatibility with
|
|
565
|
-
* Convex's FilterApi type processing.
|
|
566
|
-
*
|
|
567
|
-
* @example
|
|
568
|
-
* ```typescript
|
|
569
|
-
* const admin = defineAdminAPI(components.cms, {
|
|
570
|
-
* contentTypes: { blogPost, author }
|
|
571
|
-
* });
|
|
572
|
-
*
|
|
573
|
-
* // TypeScript provides autocomplete: "blog_post" | "author"
|
|
574
|
-
* useQuery(admin.listEntries, { contentTypeName: "blog_post", ... });
|
|
575
|
-
* ```
|
|
576
|
-
*/
|
|
577
|
-
export type TypedAdminAPI<T extends ContentTypeHelpersSchema, TBase> = {
|
|
578
|
-
[K in keyof TBase]: K extends "entries" ? TBase[K] extends object ? TypedEntriesNamespace<ContentTypeSlugs<T>, TBase[K]> : TBase[K] : NarrowKey<K, ContentTypeSlugs<T>, TBase[K]>;
|
|
579
|
-
};
|
|
580
|
-
/**
|
|
581
|
-
* Recursively converts all RegisteredQuery/RegisteredMutation types in an object
|
|
582
|
-
* to their FunctionReference equivalents for use with React hooks.
|
|
583
|
-
*
|
|
584
|
-
* This is applied to BaseAdminAPI so the exported type works directly with
|
|
585
|
-
* useQuery/useMutation without additional type assertions.
|
|
586
|
-
*
|
|
587
|
-
* Note: The ComponentPath parameter is set to `string | undefined` to match
|
|
588
|
-
* how Convex generates types for component functions.
|
|
589
|
-
*/
|
|
590
|
-
export type ToFunctionRefs<T> = T extends RegisteredQuery<infer V, infer Args, infer Returns> ? FunctionReference<"query", V, Args, Awaited<Returns>, string | undefined> : T extends RegisteredMutation<infer V, infer Args, infer Returns> ? FunctionReference<"mutation", V, Args, Awaited<Returns>, string | undefined> : T extends object ? {
|
|
591
|
-
[K in keyof T]: ToFunctionRefs<T[K]>;
|
|
592
|
-
} : T;
|
|
593
|
-
export {};
|
|
594
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/client/admin/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElG;;;GAGG;AACH,MAAM,MAAM,cAAc,GAEtB;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,GAE7B;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GACvB;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAC1B;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GAEzB;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,GACxB;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAC1B;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GAEzB;IAAE,IAAI,EAAE,kBAAkB,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI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AC;CAChE,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,wBAAwB,EAAE,KAAK,IAAI;KACpE,CAAC,IAAI,MAAM,KAAK,GAAG,CAAC,SAAS,SAAS,GACnC,KAAK,CAAC,CAAC,CAAC,SAAS,MAAM,GACrB,qBAAqB,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GACpD,KAAK,CAAC,CAAC,CAAC,GACV,SAAS,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;CAChD,CAAC;AASF;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,eAAe,CAAC,MAAM,CAAC,EAAE,MAAM,IAAI,EAAE,MAAM,OAAO,CAAC,GACzF,iBAAiB,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,GACzE,CAAC,SAAS,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,IAAI,EAAE,MAAM,OAAO,CAAC,GAC9D,iBAAiB,CAAC,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,GAC5E,CAAC,SAAS,MAAM,GACd;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACxC,CAAC,CAAC"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Admin User Operations
|
|
3
|
-
*
|
|
4
|
-
* Wraps component cmsUsers functions with auth checks.
|
|
5
|
-
* Provides user listing, role management, and invite functionality.
|
|
6
|
-
*/
|
|
7
|
-
import type { ComponentApi } from "../../component/_generated/component.js";
|
|
8
|
-
import type { AdminOperation, AuthContext } from "./types.js";
|
|
9
|
-
type CheckAuthFn = (ctx: AuthContext, operation: AdminOperation) => Promise<string | null>;
|
|
10
|
-
export declare function createUserOperations(component: ComponentApi, checkAuth: CheckAuthFn): {
|
|
11
|
-
listCmsUsers: import("convex/server").RegisteredQuery<"public", {
|
|
12
|
-
search?: string | undefined;
|
|
13
|
-
role?: string | undefined;
|
|
14
|
-
status?: "active" | "invited" | "revoked" | undefined;
|
|
15
|
-
limit?: number | undefined;
|
|
16
|
-
}, Promise<any>>;
|
|
17
|
-
getCmsUser: import("convex/server").RegisteredQuery<"public", {
|
|
18
|
-
externalUserId: string;
|
|
19
|
-
}, Promise<{
|
|
20
|
-
_creationTime: number;
|
|
21
|
-
_id: string;
|
|
22
|
-
avatarUrl?: string;
|
|
23
|
-
createdAt: number;
|
|
24
|
-
createdBy?: string;
|
|
25
|
-
displayName?: string;
|
|
26
|
-
email?: string;
|
|
27
|
-
externalUserId: string;
|
|
28
|
-
lastAccessedAt?: number;
|
|
29
|
-
role: string;
|
|
30
|
-
status: "active" | "invited" | "revoked";
|
|
31
|
-
updatedAt?: number;
|
|
32
|
-
updatedBy?: string;
|
|
33
|
-
} | null>>;
|
|
34
|
-
setCmsUserRole: import("convex/server").RegisteredMutation<"public", {
|
|
35
|
-
role: string;
|
|
36
|
-
externalUserId: string;
|
|
37
|
-
}, Promise<null>>;
|
|
38
|
-
inviteCmsUser: import("convex/server").RegisteredMutation<"public", {
|
|
39
|
-
displayName?: string | undefined;
|
|
40
|
-
role: string;
|
|
41
|
-
email: string;
|
|
42
|
-
}, Promise<string>>;
|
|
43
|
-
removeCmsUser: import("convex/server").RegisteredMutation<"public", {
|
|
44
|
-
externalUserId: string;
|
|
45
|
-
}, Promise<null>>;
|
|
46
|
-
/**
|
|
47
|
-
* Register or update the current user's CMS profile.
|
|
48
|
-
* Called by the admin UI on mount to ensure the user is registered
|
|
49
|
-
* with their display name and email.
|
|
50
|
-
*/
|
|
51
|
-
registerSelf: import("convex/server").RegisteredMutation<"public", {
|
|
52
|
-
displayName?: string | undefined;
|
|
53
|
-
email?: string | undefined;
|
|
54
|
-
avatarUrl?: string | undefined;
|
|
55
|
-
}, Promise<null>>;
|
|
56
|
-
};
|
|
57
|
-
export {};
|
|
58
|
-
//# sourceMappingURL=users.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../../../../src/client/admin/users.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9D,KAAK,WAAW,GAAG,CAAC,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAE3F,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkFpB;;;;OAIG;;;;;;EAsBN"}
|