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,551 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Content Entry Mutation Functions
|
|
3
|
-
*
|
|
4
|
-
* Provides mutation functions for creating, updating, and deleting content entries.
|
|
5
|
-
* Content entries are instances of content types that hold the actual content data.
|
|
6
|
-
*
|
|
7
|
-
* Content Lifecycle:
|
|
8
|
-
* 1. Content starts as "draft" status by default
|
|
9
|
-
* 2. Draft content can be edited freely without affecting any published version
|
|
10
|
-
* 3. Publishing changes status to "published" and records publish timestamps
|
|
11
|
-
* 4. Unpublishing reverts status to "draft" for further editing
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Mutation to create a new content entry.
|
|
15
|
-
*
|
|
16
|
-
* Content entries are created with "draft" status by default. This allows
|
|
17
|
-
* content to be edited and refined before being published to the live site.
|
|
18
|
-
*
|
|
19
|
-
* The mutation will:
|
|
20
|
-
* 1. Validate that the content type exists
|
|
21
|
-
* 2. Generate a slug from the title field (or use provided slug)
|
|
22
|
-
* 3. Ensure the slug is unique within the content type
|
|
23
|
-
* 4. Create the entry with draft status (unless specified otherwise)
|
|
24
|
-
*
|
|
25
|
-
* @param contentTypeName - The name of the content type this entry belongs to (e.g., "blog_post")
|
|
26
|
-
* @param data - The content data (validated against content type schema at runtime)
|
|
27
|
-
* @param slug - Optional custom slug (auto-generated from title if not provided)
|
|
28
|
-
* @param locale - Optional locale code for localized content
|
|
29
|
-
* @param primaryEntryId - Reference to primary entry if this is a localized variant
|
|
30
|
-
* @param status - Initial status (defaults to "draft")
|
|
31
|
-
* @param createdBy - Optional user ID for audit trail
|
|
32
|
-
*
|
|
33
|
-
* @returns The created content entry
|
|
34
|
-
*
|
|
35
|
-
* @throws Error if the content type does not exist
|
|
36
|
-
* @throws Error if the content type is not active
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```typescript
|
|
40
|
-
* // Create a new blog post (starts as draft)
|
|
41
|
-
* const post = await ctx.runMutation(api.contentEntryMutations.createEntry, {
|
|
42
|
-
* contentTypeName: "blog_post",
|
|
43
|
-
* data: {
|
|
44
|
-
* title: "My First Post",
|
|
45
|
-
* content: "<p>Hello world!</p>",
|
|
46
|
-
* },
|
|
47
|
-
* createdBy: currentUserId,
|
|
48
|
-
* });
|
|
49
|
-
*
|
|
50
|
-
* // Create with explicit status
|
|
51
|
-
* const scheduledPost = await ctx.runMutation(api.contentEntryMutations.createEntry, {
|
|
52
|
-
* contentTypeName: "blog_post",
|
|
53
|
-
* data: { title: "Scheduled Post" },
|
|
54
|
-
* status: "scheduled",
|
|
55
|
-
* scheduledPublishAt: Date.now() + 86400000, // Tomorrow
|
|
56
|
-
* });
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
export declare const createEntry: import("convex/server").RegisteredMutation<"public", {
|
|
60
|
-
status?: string | undefined;
|
|
61
|
-
createdBy?: string | undefined;
|
|
62
|
-
slug?: string | undefined;
|
|
63
|
-
locale?: string | undefined;
|
|
64
|
-
_auth?: {
|
|
65
|
-
resourceOwnerId?: string | undefined;
|
|
66
|
-
role: string | null;
|
|
67
|
-
userId: string;
|
|
68
|
-
} | undefined;
|
|
69
|
-
primaryEntryId?: import("convex/values").GenericId<"contentEntries"> | undefined;
|
|
70
|
-
scheduledPublishAt?: number | undefined;
|
|
71
|
-
data: any;
|
|
72
|
-
contentTypeName: string;
|
|
73
|
-
}, Promise<{
|
|
74
|
-
_id: import("convex/values").GenericId<"contentEntries">;
|
|
75
|
-
_creationTime: number;
|
|
76
|
-
updatedBy?: string | undefined;
|
|
77
|
-
createdBy?: string | undefined;
|
|
78
|
-
locale?: string | undefined;
|
|
79
|
-
primaryEntryId?: import("convex/values").GenericId<"contentEntries"> | undefined;
|
|
80
|
-
scheduledPublishAt?: number | undefined;
|
|
81
|
-
lockedBy?: string | undefined;
|
|
82
|
-
deletedAt?: number | undefined;
|
|
83
|
-
searchText?: string | undefined;
|
|
84
|
-
firstPublishedAt?: number | undefined;
|
|
85
|
-
lastPublishedAt?: number | undefined;
|
|
86
|
-
lockExpiresAt?: number | undefined;
|
|
87
|
-
data: any;
|
|
88
|
-
status: string;
|
|
89
|
-
contentTypeName: string;
|
|
90
|
-
slug: string;
|
|
91
|
-
version: number;
|
|
92
|
-
}>>;
|
|
93
|
-
/**
|
|
94
|
-
* Mutation to update an existing content entry.
|
|
95
|
-
*
|
|
96
|
-
* Re-validates content against the type schema, optionally regenerates slug,
|
|
97
|
-
* and updates the modification timestamp. Updates are allowed regardless of status:
|
|
98
|
-
* - Draft entries: All fields can be updated freely
|
|
99
|
-
* - Published entries: Updates create a new "working draft" that doesn't
|
|
100
|
-
* affect the live version until republished
|
|
101
|
-
* - Scheduled entries: Updates modify the scheduled content
|
|
102
|
-
*
|
|
103
|
-
* Key behaviors:
|
|
104
|
-
* 1. **Content Validation**: When data is provided, it's merged with existing data
|
|
105
|
-
* and validated against the content type schema. Invalid data throws an error.
|
|
106
|
-
* 2. **Slug Handling**: Explicit slug takes precedence. If `regenerateSlug` is true
|
|
107
|
-
* and data is updated, the slug is regenerated from the slugField value.
|
|
108
|
-
* 3. **Search Text**: Automatically regenerated from searchable fields when data changes.
|
|
109
|
-
* 4. **Version Tracking**: Version number is incremented on every update.
|
|
110
|
-
*
|
|
111
|
-
* @param id - The content entry ID to update
|
|
112
|
-
* @param slug - Optional new slug (uniqueness will be validated)
|
|
113
|
-
* @param data - Optional new content data (merged with existing, then validated)
|
|
114
|
-
* @param status - Optional new status
|
|
115
|
-
* @param scheduledPublishAt - Optional scheduled publish time (for "scheduled" status)
|
|
116
|
-
* @param updatedBy - Optional user ID for audit trail
|
|
117
|
-
* @param regenerateSlug - If true, regenerates slug from slugField when data is updated
|
|
118
|
-
*
|
|
119
|
-
* @returns The updated content entry
|
|
120
|
-
*
|
|
121
|
-
* @throws Error if the entry does not exist
|
|
122
|
-
* @throws Error if the entry has been deleted
|
|
123
|
-
* @throws Error if the content type has been deleted
|
|
124
|
-
* @throws Error if content validation fails
|
|
125
|
-
* @throws Error if the new slug is not unique
|
|
126
|
-
*
|
|
127
|
-
* @example
|
|
128
|
-
* ```typescript
|
|
129
|
-
* // Update content data (validates against schema)
|
|
130
|
-
* await ctx.runMutation(api.contentEntryMutations.updateEntry, {
|
|
131
|
-
* id: entryId,
|
|
132
|
-
* data: { title: "Updated Title", content: "<p>New content</p>" },
|
|
133
|
-
* updatedBy: currentUserId,
|
|
134
|
-
* });
|
|
135
|
-
*
|
|
136
|
-
* // Change slug explicitly
|
|
137
|
-
* await ctx.runMutation(api.contentEntryMutations.updateEntry, {
|
|
138
|
-
* id: entryId,
|
|
139
|
-
* slug: "new-url-slug",
|
|
140
|
-
* });
|
|
141
|
-
*
|
|
142
|
-
* // Update title and regenerate slug from it
|
|
143
|
-
* await ctx.runMutation(api.contentEntryMutations.updateEntry, {
|
|
144
|
-
* id: entryId,
|
|
145
|
-
* data: { title: "My New Blog Post Title" },
|
|
146
|
-
* regenerateSlug: true,
|
|
147
|
-
* updatedBy: currentUserId,
|
|
148
|
-
* });
|
|
149
|
-
* ```
|
|
150
|
-
*/
|
|
151
|
-
export declare const updateEntry: import("convex/server").RegisteredMutation<"public", {
|
|
152
|
-
updatedBy?: string | undefined;
|
|
153
|
-
data?: any;
|
|
154
|
-
status?: string | undefined;
|
|
155
|
-
slug?: string | undefined;
|
|
156
|
-
_auth?: {
|
|
157
|
-
resourceOwnerId?: string | undefined;
|
|
158
|
-
role: string | null;
|
|
159
|
-
userId: string;
|
|
160
|
-
} | undefined;
|
|
161
|
-
scheduledPublishAt?: number | undefined;
|
|
162
|
-
regenerateSlug?: boolean | undefined;
|
|
163
|
-
id: import("convex/values").GenericId<"contentEntries">;
|
|
164
|
-
}, Promise<{
|
|
165
|
-
_id: import("convex/values").GenericId<"contentEntries">;
|
|
166
|
-
_creationTime: number;
|
|
167
|
-
updatedBy?: string | undefined;
|
|
168
|
-
createdBy?: string | undefined;
|
|
169
|
-
locale?: string | undefined;
|
|
170
|
-
primaryEntryId?: import("convex/values").GenericId<"contentEntries"> | undefined;
|
|
171
|
-
scheduledPublishAt?: number | undefined;
|
|
172
|
-
lockedBy?: string | undefined;
|
|
173
|
-
deletedAt?: number | undefined;
|
|
174
|
-
searchText?: string | undefined;
|
|
175
|
-
firstPublishedAt?: number | undefined;
|
|
176
|
-
lastPublishedAt?: number | undefined;
|
|
177
|
-
lockExpiresAt?: number | undefined;
|
|
178
|
-
data: any;
|
|
179
|
-
status: string;
|
|
180
|
-
contentTypeName: string;
|
|
181
|
-
slug: string;
|
|
182
|
-
version: number;
|
|
183
|
-
}>>;
|
|
184
|
-
/**
|
|
185
|
-
* Mutation to publish a content entry.
|
|
186
|
-
*
|
|
187
|
-
* Publishing transitions an entry from "draft" (or "scheduled") to "published"
|
|
188
|
-
* status, making it visible on the live site.
|
|
189
|
-
*
|
|
190
|
-
* When publishing:
|
|
191
|
-
* - Status is set to "published"
|
|
192
|
-
* - firstPublishedAt is set if this is the first publication
|
|
193
|
-
* - lastPublishedAt is updated to current timestamp
|
|
194
|
-
* - Version is incremented
|
|
195
|
-
* - A version snapshot can be created (if versioning is enabled)
|
|
196
|
-
*
|
|
197
|
-
* @param id - The content entry ID to publish
|
|
198
|
-
* @param changeDescription - Optional description of changes (for version history)
|
|
199
|
-
* @param updatedBy - Optional user ID for audit trail
|
|
200
|
-
*
|
|
201
|
-
* @returns The published content entry
|
|
202
|
-
*
|
|
203
|
-
* @throws Error if the entry does not exist
|
|
204
|
-
* @throws Error if the entry has been deleted
|
|
205
|
-
* @throws Error if the entry is already published
|
|
206
|
-
*
|
|
207
|
-
* @example
|
|
208
|
-
* ```typescript
|
|
209
|
-
* const published = await ctx.runMutation(api.contentEntryMutations.publishEntry, {
|
|
210
|
-
* id: entryId,
|
|
211
|
-
* changeDescription: "Initial publication",
|
|
212
|
-
* updatedBy: currentUserId,
|
|
213
|
-
* });
|
|
214
|
-
* ```
|
|
215
|
-
*/
|
|
216
|
-
export declare const publishEntry: import("convex/server").RegisteredMutation<"public", {
|
|
217
|
-
changeDescription?: string | undefined;
|
|
218
|
-
updatedBy?: string | undefined;
|
|
219
|
-
_auth?: {
|
|
220
|
-
resourceOwnerId?: string | undefined;
|
|
221
|
-
role: string | null;
|
|
222
|
-
userId: string;
|
|
223
|
-
} | undefined;
|
|
224
|
-
id: import("convex/values").GenericId<"contentEntries">;
|
|
225
|
-
}, Promise<{
|
|
226
|
-
_id: import("convex/values").GenericId<"contentEntries">;
|
|
227
|
-
_creationTime: number;
|
|
228
|
-
updatedBy?: string | undefined;
|
|
229
|
-
createdBy?: string | undefined;
|
|
230
|
-
locale?: string | undefined;
|
|
231
|
-
primaryEntryId?: import("convex/values").GenericId<"contentEntries"> | undefined;
|
|
232
|
-
scheduledPublishAt?: number | undefined;
|
|
233
|
-
lockedBy?: string | undefined;
|
|
234
|
-
deletedAt?: number | undefined;
|
|
235
|
-
searchText?: string | undefined;
|
|
236
|
-
firstPublishedAt?: number | undefined;
|
|
237
|
-
lastPublishedAt?: number | undefined;
|
|
238
|
-
lockExpiresAt?: number | undefined;
|
|
239
|
-
data: any;
|
|
240
|
-
status: string;
|
|
241
|
-
contentTypeName: string;
|
|
242
|
-
slug: string;
|
|
243
|
-
version: number;
|
|
244
|
-
}>>;
|
|
245
|
-
/**
|
|
246
|
-
* Mutation to unpublish a content entry (revert to draft).
|
|
247
|
-
*
|
|
248
|
-
* Unpublishing transitions an entry from "published" back to "draft" status,
|
|
249
|
-
* removing it from the live site while preserving all content for further editing.
|
|
250
|
-
*
|
|
251
|
-
* This is useful for:
|
|
252
|
-
* - Taking content offline temporarily
|
|
253
|
-
* - Making significant changes before republishing
|
|
254
|
-
* - Seasonal content that needs to be hidden
|
|
255
|
-
*
|
|
256
|
-
* @param id - The content entry ID to unpublish
|
|
257
|
-
* @param updatedBy - Optional user ID for audit trail
|
|
258
|
-
*
|
|
259
|
-
* @returns The unpublished content entry (now in draft status)
|
|
260
|
-
*
|
|
261
|
-
* @throws Error if the entry does not exist
|
|
262
|
-
* @throws Error if the entry has been deleted
|
|
263
|
-
* @throws Error if the entry is not currently published
|
|
264
|
-
*
|
|
265
|
-
* @example
|
|
266
|
-
* ```typescript
|
|
267
|
-
* const draft = await ctx.runMutation(api.contentEntryMutations.unpublishEntry, {
|
|
268
|
-
* id: entryId,
|
|
269
|
-
* updatedBy: currentUserId,
|
|
270
|
-
* });
|
|
271
|
-
* console.log(draft.status); // "draft"
|
|
272
|
-
* ```
|
|
273
|
-
*/
|
|
274
|
-
export declare const unpublishEntry: import("convex/server").RegisteredMutation<"public", {
|
|
275
|
-
updatedBy?: string | undefined;
|
|
276
|
-
_auth?: {
|
|
277
|
-
resourceOwnerId?: string | undefined;
|
|
278
|
-
role: string | null;
|
|
279
|
-
userId: string;
|
|
280
|
-
} | undefined;
|
|
281
|
-
id: import("convex/values").GenericId<"contentEntries">;
|
|
282
|
-
}, Promise<{
|
|
283
|
-
_id: import("convex/values").GenericId<"contentEntries">;
|
|
284
|
-
_creationTime: number;
|
|
285
|
-
updatedBy?: string | undefined;
|
|
286
|
-
createdBy?: string | undefined;
|
|
287
|
-
locale?: string | undefined;
|
|
288
|
-
primaryEntryId?: import("convex/values").GenericId<"contentEntries"> | undefined;
|
|
289
|
-
scheduledPublishAt?: number | undefined;
|
|
290
|
-
lockedBy?: string | undefined;
|
|
291
|
-
deletedAt?: number | undefined;
|
|
292
|
-
searchText?: string | undefined;
|
|
293
|
-
firstPublishedAt?: number | undefined;
|
|
294
|
-
lastPublishedAt?: number | undefined;
|
|
295
|
-
lockExpiresAt?: number | undefined;
|
|
296
|
-
data: any;
|
|
297
|
-
status: string;
|
|
298
|
-
contentTypeName: string;
|
|
299
|
-
slug: string;
|
|
300
|
-
version: number;
|
|
301
|
-
}>>;
|
|
302
|
-
/**
|
|
303
|
-
* Result type for delete operations.
|
|
304
|
-
* Returns the deleted entry with updated deletedAt timestamp.
|
|
305
|
-
*/
|
|
306
|
-
export declare const deleteResultDoc: import("convex/values").VObject<{
|
|
307
|
-
updatedBy?: string | undefined;
|
|
308
|
-
createdBy?: string | undefined;
|
|
309
|
-
locale?: string | undefined;
|
|
310
|
-
primaryEntryId?: import("convex/values").GenericId<"contentEntries"> | undefined;
|
|
311
|
-
scheduledPublishAt?: number | undefined;
|
|
312
|
-
lockedBy?: string | undefined;
|
|
313
|
-
deletedAt?: number | undefined;
|
|
314
|
-
searchText?: string | undefined;
|
|
315
|
-
firstPublishedAt?: number | undefined;
|
|
316
|
-
lastPublishedAt?: number | undefined;
|
|
317
|
-
lockExpiresAt?: number | undefined;
|
|
318
|
-
deletedVersionsCount?: number | undefined;
|
|
319
|
-
data: any;
|
|
320
|
-
status: string;
|
|
321
|
-
contentTypeName: string;
|
|
322
|
-
slug: string;
|
|
323
|
-
_creationTime: number;
|
|
324
|
-
version: number;
|
|
325
|
-
_id: import("convex/values").GenericId<"contentEntries">;
|
|
326
|
-
}, {
|
|
327
|
-
/** Number of associated versions that were cleaned up */
|
|
328
|
-
deletedVersionsCount: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
329
|
-
contentTypeName: import("convex/values").VString<string, "required">;
|
|
330
|
-
slug: import("convex/values").VString<string, "required">;
|
|
331
|
-
status: import("convex/values").VString<string, "required">;
|
|
332
|
-
data: import("convex/values").VAny<any, "required", string>;
|
|
333
|
-
locale: import("convex/values").VString<string | undefined, "optional">;
|
|
334
|
-
primaryEntryId: import("convex/values").VId<import("convex/values").GenericId<"contentEntries"> | undefined, "optional">;
|
|
335
|
-
version: import("convex/values").VFloat64<number, "required">;
|
|
336
|
-
scheduledPublishAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
337
|
-
firstPublishedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
338
|
-
lastPublishedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
339
|
-
lockedBy: import("convex/values").VString<string | undefined, "optional">;
|
|
340
|
-
lockExpiresAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
341
|
-
deletedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
342
|
-
createdBy: import("convex/values").VString<string | undefined, "optional">;
|
|
343
|
-
updatedBy: import("convex/values").VString<string | undefined, "optional">;
|
|
344
|
-
searchText: import("convex/values").VString<string | undefined, "optional">;
|
|
345
|
-
_id: import("convex/values").VId<import("convex/values").GenericId<"contentEntries">, "required">;
|
|
346
|
-
_creationTime: import("convex/values").VFloat64<number, "required">;
|
|
347
|
-
}, "required", "updatedBy" | "data" | "status" | "createdBy" | "contentTypeName" | "slug" | "locale" | "primaryEntryId" | "scheduledPublishAt" | "lockedBy" | "_creationTime" | "deletedAt" | "searchText" | "version" | "firstPublishedAt" | "lastPublishedAt" | "lockExpiresAt" | `data.${string}` | "_id" | "deletedVersionsCount">;
|
|
348
|
-
/**
|
|
349
|
-
* Mutation to delete a content entry.
|
|
350
|
-
*
|
|
351
|
-
* By default, performs a soft delete by setting the `deletedAt` timestamp.
|
|
352
|
-
* This allows the entry to be recovered later if needed.
|
|
353
|
-
*
|
|
354
|
-
* When `hardDelete` is true, permanently removes the entry and all
|
|
355
|
-
* associated version snapshots from the database.
|
|
356
|
-
*
|
|
357
|
-
* @param id - The content entry ID to delete
|
|
358
|
-
* @param deletedBy - Optional user ID for audit trail
|
|
359
|
-
* @param hardDelete - If true, permanently deletes entry and versions (default: false)
|
|
360
|
-
*
|
|
361
|
-
* @returns The deleted content entry (with deletedAt set for soft deletes)
|
|
362
|
-
*
|
|
363
|
-
* @throws Error if the entry does not exist
|
|
364
|
-
* @throws Error if the entry has already been deleted (for soft deletes)
|
|
365
|
-
*
|
|
366
|
-
* @example
|
|
367
|
-
* ```typescript
|
|
368
|
-
* // Soft delete (default) - entry can be recovered
|
|
369
|
-
* const deleted = await ctx.runMutation(api.contentEntryMutations.deleteEntry, {
|
|
370
|
-
* id: entryId,
|
|
371
|
-
* deletedBy: currentUserId,
|
|
372
|
-
* });
|
|
373
|
-
*
|
|
374
|
-
* // Hard delete - permanently removes entry and all versions
|
|
375
|
-
* await ctx.runMutation(api.contentEntryMutations.deleteEntry, {
|
|
376
|
-
* id: entryId,
|
|
377
|
-
* deletedBy: currentUserId,
|
|
378
|
-
* hardDelete: true,
|
|
379
|
-
* });
|
|
380
|
-
* ```
|
|
381
|
-
*/
|
|
382
|
-
export declare const deleteEntry: import("convex/server").RegisteredMutation<"public", {
|
|
383
|
-
deletedBy?: string | undefined;
|
|
384
|
-
hardDelete?: boolean | undefined;
|
|
385
|
-
_auth?: {
|
|
386
|
-
resourceOwnerId?: string | undefined;
|
|
387
|
-
role: string | null;
|
|
388
|
-
userId: string;
|
|
389
|
-
} | undefined;
|
|
390
|
-
id: import("convex/values").GenericId<"contentEntries">;
|
|
391
|
-
}, Promise<{
|
|
392
|
-
deletedAt: number;
|
|
393
|
-
updatedBy: string | undefined;
|
|
394
|
-
deletedVersionsCount: number;
|
|
395
|
-
_id: import("convex/values").GenericId<"contentEntries">;
|
|
396
|
-
_creationTime: number;
|
|
397
|
-
createdBy?: string | undefined;
|
|
398
|
-
locale?: string | undefined;
|
|
399
|
-
primaryEntryId?: import("convex/values").GenericId<"contentEntries"> | undefined;
|
|
400
|
-
scheduledPublishAt?: number | undefined;
|
|
401
|
-
lockedBy?: string | undefined;
|
|
402
|
-
searchText?: string | undefined;
|
|
403
|
-
firstPublishedAt?: number | undefined;
|
|
404
|
-
lastPublishedAt?: number | undefined;
|
|
405
|
-
lockExpiresAt?: number | undefined;
|
|
406
|
-
data: any;
|
|
407
|
-
status: string;
|
|
408
|
-
contentTypeName: string;
|
|
409
|
-
slug: string;
|
|
410
|
-
version: number;
|
|
411
|
-
}>>;
|
|
412
|
-
/**
|
|
413
|
-
* Mutation to restore a soft-deleted content entry.
|
|
414
|
-
*
|
|
415
|
-
* Removes the `deletedAt` timestamp from the entry, making it active again.
|
|
416
|
-
* Only works for soft-deleted entries; hard-deleted entries cannot be recovered.
|
|
417
|
-
*
|
|
418
|
-
* @param id - The content entry ID to restore
|
|
419
|
-
* @param restoredBy - Optional user ID for audit trail
|
|
420
|
-
*
|
|
421
|
-
* @returns The restored content entry
|
|
422
|
-
*
|
|
423
|
-
* @throws Error if the entry does not exist
|
|
424
|
-
* @throws Error if the entry is not soft-deleted
|
|
425
|
-
*
|
|
426
|
-
* @example
|
|
427
|
-
* ```typescript
|
|
428
|
-
* const restored = await ctx.runMutation(api.contentEntryMutations.restoreEntry, {
|
|
429
|
-
* id: entryId,
|
|
430
|
-
* restoredBy: currentUserId,
|
|
431
|
-
* });
|
|
432
|
-
* ```
|
|
433
|
-
*/
|
|
434
|
-
export declare const restoreEntry: import("convex/server").RegisteredMutation<"public", {
|
|
435
|
-
restoredBy?: string | undefined;
|
|
436
|
-
_auth?: {
|
|
437
|
-
resourceOwnerId?: string | undefined;
|
|
438
|
-
role: string | null;
|
|
439
|
-
userId: string;
|
|
440
|
-
} | undefined;
|
|
441
|
-
id: import("convex/values").GenericId<"contentEntries">;
|
|
442
|
-
}, Promise<{
|
|
443
|
-
deletedAt: undefined;
|
|
444
|
-
updatedBy: string | undefined;
|
|
445
|
-
_id: import("convex/values").GenericId<"contentEntries">;
|
|
446
|
-
_creationTime: number;
|
|
447
|
-
createdBy?: string | undefined;
|
|
448
|
-
locale?: string | undefined;
|
|
449
|
-
primaryEntryId?: import("convex/values").GenericId<"contentEntries"> | undefined;
|
|
450
|
-
scheduledPublishAt?: number | undefined;
|
|
451
|
-
lockedBy?: string | undefined;
|
|
452
|
-
searchText?: string | undefined;
|
|
453
|
-
firstPublishedAt?: number | undefined;
|
|
454
|
-
lastPublishedAt?: number | undefined;
|
|
455
|
-
lockExpiresAt?: number | undefined;
|
|
456
|
-
data: any;
|
|
457
|
-
status: string;
|
|
458
|
-
contentTypeName: string;
|
|
459
|
-
slug: string;
|
|
460
|
-
version: number;
|
|
461
|
-
}>>;
|
|
462
|
-
/**
|
|
463
|
-
* Mutation to duplicate (clone) an existing content entry.
|
|
464
|
-
*
|
|
465
|
-
* Creates a new content entry with the same data as the source entry,
|
|
466
|
-
* but with a new unique slug. The duplicated entry is always created
|
|
467
|
-
* as a draft, regardless of the source entry's status.
|
|
468
|
-
*
|
|
469
|
-
* This is useful for:
|
|
470
|
-
* - Content templating workflows (copy a template to create new content)
|
|
471
|
-
* - Creating localized variants of content
|
|
472
|
-
* - Quick duplication of similar content pieces
|
|
473
|
-
*
|
|
474
|
-
* Key behaviors:
|
|
475
|
-
* 1. **Data Cloning**: All content data is deep-copied to the new entry
|
|
476
|
-
* 2. **Media References**: By default, media references (IDs) are copied,
|
|
477
|
-
* pointing to the same media assets. Set `copyMediaReferences: false`
|
|
478
|
-
* to clear media fields in the duplicate.
|
|
479
|
-
* 3. **Slug Generation**: A new unique slug is generated from the source
|
|
480
|
-
* entry's slug (e.g., "my-post" → "my-post-1") unless a custom slug
|
|
481
|
-
* is provided.
|
|
482
|
-
* 4. **Status Reset**: The duplicate always starts as "draft" with version 1
|
|
483
|
-
* 5. **Timestamps Reset**: Publishing timestamps are cleared in the duplicate
|
|
484
|
-
*
|
|
485
|
-
* @param sourceEntryId - The ID of the content entry to duplicate
|
|
486
|
-
* @param slug - Optional custom slug (auto-generated if not provided)
|
|
487
|
-
* @param copyMediaReferences - Whether to copy media IDs (default: true)
|
|
488
|
-
* @param locale - Optional locale for the duplicated entry
|
|
489
|
-
* @param createdBy - Optional user ID for audit trail
|
|
490
|
-
*
|
|
491
|
-
* @returns The newly created duplicate content entry
|
|
492
|
-
*
|
|
493
|
-
* @throws Error if the source entry does not exist
|
|
494
|
-
* @throws Error if the source entry has been deleted
|
|
495
|
-
* @throws Error if the content type does not exist or is not active
|
|
496
|
-
*
|
|
497
|
-
* @example
|
|
498
|
-
* ```typescript
|
|
499
|
-
* // Simple duplication (keeps all media references)
|
|
500
|
-
* const duplicate = await ctx.runMutation(api.contentEntryMutations.duplicateEntry, {
|
|
501
|
-
* sourceEntryId: originalPostId,
|
|
502
|
-
* createdBy: currentUserId,
|
|
503
|
-
* });
|
|
504
|
-
*
|
|
505
|
-
* // Duplicate with custom slug
|
|
506
|
-
* const duplicate = await ctx.runMutation(api.contentEntryMutations.duplicateEntry, {
|
|
507
|
-
* sourceEntryId: templateId,
|
|
508
|
-
* slug: "new-post-from-template",
|
|
509
|
-
* createdBy: currentUserId,
|
|
510
|
-
* });
|
|
511
|
-
*
|
|
512
|
-
* // Duplicate without media references (for a fresh start)
|
|
513
|
-
* const duplicate = await ctx.runMutation(api.contentEntryMutations.duplicateEntry, {
|
|
514
|
-
* sourceEntryId: originalPostId,
|
|
515
|
-
* copyMediaReferences: false,
|
|
516
|
-
* createdBy: currentUserId,
|
|
517
|
-
* });
|
|
518
|
-
* ```
|
|
519
|
-
*/
|
|
520
|
-
export declare const duplicateEntry: import("convex/server").RegisteredMutation<"public", {
|
|
521
|
-
createdBy?: string | undefined;
|
|
522
|
-
slug?: string | undefined;
|
|
523
|
-
locale?: string | undefined;
|
|
524
|
-
_auth?: {
|
|
525
|
-
resourceOwnerId?: string | undefined;
|
|
526
|
-
role: string | null;
|
|
527
|
-
userId: string;
|
|
528
|
-
} | undefined;
|
|
529
|
-
copyMediaReferences?: boolean | undefined;
|
|
530
|
-
sourceEntryId: import("convex/values").GenericId<"contentEntries">;
|
|
531
|
-
}, Promise<{
|
|
532
|
-
_id: import("convex/values").GenericId<"contentEntries">;
|
|
533
|
-
_creationTime: number;
|
|
534
|
-
updatedBy?: string | undefined;
|
|
535
|
-
createdBy?: string | undefined;
|
|
536
|
-
locale?: string | undefined;
|
|
537
|
-
primaryEntryId?: import("convex/values").GenericId<"contentEntries"> | undefined;
|
|
538
|
-
scheduledPublishAt?: number | undefined;
|
|
539
|
-
lockedBy?: string | undefined;
|
|
540
|
-
deletedAt?: number | undefined;
|
|
541
|
-
searchText?: string | undefined;
|
|
542
|
-
firstPublishedAt?: number | undefined;
|
|
543
|
-
lastPublishedAt?: number | undefined;
|
|
544
|
-
lockExpiresAt?: number | undefined;
|
|
545
|
-
data: any;
|
|
546
|
-
status: string;
|
|
547
|
-
contentTypeName: string;
|
|
548
|
-
slug: string;
|
|
549
|
-
version: number;
|
|
550
|
-
}>>;
|
|
551
|
-
//# sourceMappingURL=contentEntryMutations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contentEntryMutations.d.ts","sourceRoot":"","sources":["../../../../../src/component/contentEntryMutations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAgDH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwItB,CAAC;AAMH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmNtB,CAAC;AAMH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwFvB,CAAC;AAMH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DzB,CAAC;AAMH;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;IAE3B,yDAAyD;;;;;;;;;;;;;;;;;;;;sUAExD,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuGtB,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DvB,CAAC;AAMH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqKzB,CAAC"}
|