@@ -98,25 +98,66 @@ export const UpdateSkuComponentOperationSchema = z.object({
9898 sku : z . string ( ) ,
9999} ) ;
100100
101- export const PublishItemOperationSchema = z . object ( {
102- _ref : RefSchema . optional ( ) ,
103- intent : z . literal ( 'item/publish' ) ,
104- language : z . string ( ) . min ( 1 ) ,
105- includeDescendants : z . boolean ( ) . optional ( ) ,
106- itemId : IdSchema . optional ( ) ,
107- resourceIdentifier : ResourceIdentifierSchema . optional ( ) ,
108- } ) ;
101+ export const PublishItemOperationSchema = z
102+ . object ( {
103+ _ref : RefSchema . optional ( ) ,
104+ intent : z . literal ( 'item/publish' ) ,
105+ language : z . string ( ) . min ( 1 ) ,
106+ includeDescendants : z . boolean ( ) . optional ( ) ,
107+ itemId : IdSchema . optional ( ) ,
108+ resourceIdentifier : ResourceIdentifierSchema . optional ( ) ,
109+ } )
110+ . superRefine ( checkResourceIdentifierOrId ) ;
109111
110112export const UnPublishItemOperationSchema = PublishItemOperationSchema . omit ( { intent : true } ) . extend ( {
111113 intent : z . literal ( 'item/unpublish' ) ,
112114} ) ;
113115
114- export const DeleteItemOperationSchema = z . object ( {
115- _ref : RefSchema . optional ( ) ,
116- intent : z . literal ( 'item/delete' ) ,
117- itemId : IdSchema . optional ( ) ,
118- resourceIdentifier : ResourceIdentifierSchema . optional ( ) ,
119- } ) ;
116+ export const DeleteItemOperationSchema = z
117+ . object ( {
118+ _ref : RefSchema . optional ( ) ,
119+ intent : z . literal ( 'item/delete' ) ,
120+ itemId : IdSchema . optional ( ) ,
121+ resourceIdentifier : ResourceIdentifierSchema . optional ( ) ,
122+ } )
123+ . superRefine ( checkResourceIdentifierOrId ) ;
124+
125+ export const AddItemTreeNodeShortcutsOperationSchema = z
126+ . object ( {
127+ _ref : RefSchema . optional ( ) ,
128+ intent : z . literal ( 'item/paths/addShortcuts' ) ,
129+ itemId : IdSchema . optional ( ) ,
130+ resourceIdentifier : ResourceIdentifierSchema . optional ( ) ,
131+ shortcuts : z . array (
132+ z . object ( {
133+ parentId : IdSchema ,
134+ position : z . number ( ) . int ( ) . min ( 0 ) . optional ( ) ,
135+ } ) ,
136+ ) ,
137+ } )
138+ . superRefine ( checkResourceIdentifierOrId ) ;
139+
140+ export const AddItemTreeNodeAliasesOperationSchema = z
141+ . object ( {
142+ _ref : RefSchema . optional ( ) ,
143+ intent : z . literal ( 'item/paths/addAliases' ) ,
144+ itemId : IdSchema . optional ( ) ,
145+ resourceIdentifier : ResourceIdentifierSchema . optional ( ) ,
146+ language : z . string ( ) . min ( 1 ) ,
147+ paths : z . array ( z . string ( ) . min ( 1 ) ) ,
148+ } )
149+ . superRefine ( checkResourceIdentifierOrId ) ;
150+
151+ export const AddItemTreeNodeHistoryOperationSchema = z
152+ . object ( {
153+ _ref : RefSchema . optional ( ) ,
154+ intent : z . literal ( 'item/paths/addHistory' ) ,
155+ itemId : IdSchema . optional ( ) ,
156+ resourceIdentifier : ResourceIdentifierSchema . optional ( ) ,
157+ language : z . string ( ) . min ( 1 ) ,
158+ paths : z . array ( z . string ( ) . min ( 1 ) ) ,
159+ } )
160+ . superRefine ( checkResourceIdentifierOrId ) ;
120161
121162export type UpdateItemComponentOperation = z . infer < typeof UpdateItemComponentOperationSchema > ;
122163export type UpdateSkuComponentOperation = z . infer < typeof UpdateSkuComponentOperationSchema > ;
@@ -135,3 +176,7 @@ export type UpsertFolderOperation = z.infer<typeof UpsertFolderOperationSchema>;
135176export type CreateProductOperation = z . infer < typeof CreateProductOperationSchema > ;
136177export type UpdateProductOperation = z . infer < typeof UpdateProductOperationSchema > ;
137178export type UpsertProductOperation = z . infer < typeof UpsertProductOperationSchema > ;
179+
180+ export type AddItemTreeNodeShortcutsOperation = z . infer < typeof AddItemTreeNodeShortcutsOperationSchema > ;
181+ export type AddItemTreeNodeAliasesOperation = z . infer < typeof AddItemTreeNodeAliasesOperationSchema > ;
182+ export type AddItemTreeNodeHistoryOperation = z . infer < typeof AddItemTreeNodeHistoryOperationSchema > ;
0 commit comments