@strapi/content-manager 5.50.0 → 5.50.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.
Files changed (190) hide show
  1. package/dist/admin/components/ComponentIcon.js.map +1 -1
  2. package/dist/admin/components/ComponentIcon.mjs.map +1 -1
  3. package/dist/admin/components/ConfigurationForm/Fields.js.map +1 -1
  4. package/dist/admin/components/ConfigurationForm/Fields.mjs.map +1 -1
  5. package/dist/admin/components/DragLayer.js.map +1 -1
  6. package/dist/admin/components/DragLayer.mjs.map +1 -1
  7. package/dist/admin/components/LeftMenu.js +66 -67
  8. package/dist/admin/components/LeftMenu.js.map +1 -1
  9. package/dist/admin/components/LeftMenu.mjs +68 -69
  10. package/dist/admin/components/LeftMenu.mjs.map +1 -1
  11. package/dist/admin/history/components/VersionInputRenderer.js +3 -3
  12. package/dist/admin/history/components/VersionInputRenderer.js.map +1 -1
  13. package/dist/admin/history/components/VersionInputRenderer.mjs +3 -3
  14. package/dist/admin/history/components/VersionInputRenderer.mjs.map +1 -1
  15. package/dist/admin/history/routes.js.map +1 -1
  16. package/dist/admin/history/routes.mjs.map +1 -1
  17. package/dist/admin/hooks/useDocumentActions.js +15 -8
  18. package/dist/admin/hooks/useDocumentActions.js.map +1 -1
  19. package/dist/admin/hooks/useDocumentActions.mjs +15 -8
  20. package/dist/admin/hooks/useDocumentActions.mjs.map +1 -1
  21. package/dist/admin/hooks/useDocumentContext.js.map +1 -1
  22. package/dist/admin/hooks/useDocumentContext.mjs.map +1 -1
  23. package/dist/admin/index.js.map +1 -1
  24. package/dist/admin/index.mjs.map +1 -1
  25. package/dist/admin/layout.js +18 -6
  26. package/dist/admin/layout.js.map +1 -1
  27. package/dist/admin/layout.mjs +18 -6
  28. package/dist/admin/layout.mjs.map +1 -1
  29. package/dist/admin/pages/ComponentConfigurationPage.js.map +1 -1
  30. package/dist/admin/pages/ComponentConfigurationPage.mjs.map +1 -1
  31. package/dist/admin/pages/EditView/components/DocumentActions.js +7 -6
  32. package/dist/admin/pages/EditView/components/DocumentActions.js.map +1 -1
  33. package/dist/admin/pages/EditView/components/DocumentActions.mjs +7 -6
  34. package/dist/admin/pages/EditView/components/DocumentActions.mjs.map +1 -1
  35. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/Blocks/List.js +6 -3
  36. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/Blocks/List.js.map +1 -1
  37. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/Blocks/List.mjs +6 -3
  38. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/Blocks/List.mjs.map +1 -1
  39. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksInput.js +1 -1
  40. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksInput.js.map +1 -1
  41. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksInput.mjs +1 -1
  42. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksInput.mjs.map +1 -1
  43. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksToolbar.js.map +1 -1
  44. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksToolbar.mjs.map +1 -1
  45. package/dist/admin/pages/EditView/components/FormInputs/Component/Initializer.js.map +1 -1
  46. package/dist/admin/pages/EditView/components/FormInputs/Component/Initializer.mjs.map +1 -1
  47. package/dist/admin/pages/EditView/components/FormInputs/Component/Input.js +1 -1
  48. package/dist/admin/pages/EditView/components/FormInputs/Component/Input.js.map +1 -1
  49. package/dist/admin/pages/EditView/components/FormInputs/Component/Input.mjs +1 -1
  50. package/dist/admin/pages/EditView/components/FormInputs/Component/Input.mjs.map +1 -1
  51. package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.js +2 -1
  52. package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.js.map +1 -1
  53. package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.mjs +2 -1
  54. package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.mjs.map +1 -1
  55. package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.js.map +1 -1
  56. package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.mjs.map +1 -1
  57. package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.js +8 -5
  58. package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.js.map +1 -1
  59. package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.mjs +8 -5
  60. package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.mjs.map +1 -1
  61. package/dist/admin/pages/EditView/components/FormInputs/UID.js +5 -4
  62. package/dist/admin/pages/EditView/components/FormInputs/UID.js.map +1 -1
  63. package/dist/admin/pages/EditView/components/FormInputs/UID.mjs +5 -4
  64. package/dist/admin/pages/EditView/components/FormInputs/UID.mjs.map +1 -1
  65. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/Editor.js.map +1 -1
  66. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/Editor.mjs.map +1 -1
  67. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/Field.js +2 -2
  68. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/Field.js.map +1 -1
  69. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/Field.mjs +2 -2
  70. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/Field.mjs.map +1 -1
  71. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/utils/utils.js.map +1 -1
  72. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/utils/utils.mjs.map +1 -1
  73. package/dist/admin/pages/EditView/components/Panels.js.map +1 -1
  74. package/dist/admin/pages/EditView/components/Panels.mjs.map +1 -1
  75. package/dist/admin/pages/EditView/utils/data.js.map +1 -1
  76. package/dist/admin/pages/EditView/utils/data.mjs.map +1 -1
  77. package/dist/admin/pages/ListConfiguration/components/Settings.js.map +1 -1
  78. package/dist/admin/pages/ListConfiguration/components/Settings.mjs.map +1 -1
  79. package/dist/admin/pages/ListConfiguration/components/SortDisplayedFields.js.map +1 -1
  80. package/dist/admin/pages/ListConfiguration/components/SortDisplayedFields.mjs.map +1 -1
  81. package/dist/admin/pages/ListView/ListViewPage.js +71 -11
  82. package/dist/admin/pages/ListView/ListViewPage.js.map +1 -1
  83. package/dist/admin/pages/ListView/ListViewPage.mjs +73 -13
  84. package/dist/admin/pages/ListView/ListViewPage.mjs.map +1 -1
  85. package/dist/admin/pages/ListView/components/BulkActions/Actions.js +2 -1
  86. package/dist/admin/pages/ListView/components/BulkActions/Actions.js.map +1 -1
  87. package/dist/admin/pages/ListView/components/BulkActions/Actions.mjs +2 -1
  88. package/dist/admin/pages/ListView/components/BulkActions/Actions.mjs.map +1 -1
  89. package/dist/admin/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.js.map +1 -1
  90. package/dist/admin/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.mjs.map +1 -1
  91. package/dist/admin/pages/ListView/components/BulkActions/PublishAction.js.map +1 -1
  92. package/dist/admin/pages/ListView/components/BulkActions/PublishAction.mjs.map +1 -1
  93. package/dist/admin/pages/ListView/components/Filters.js +5 -3
  94. package/dist/admin/pages/ListView/components/Filters.js.map +1 -1
  95. package/dist/admin/pages/ListView/components/Filters.mjs +5 -3
  96. package/dist/admin/pages/ListView/components/Filters.mjs.map +1 -1
  97. package/dist/admin/pages/ListView/components/TableActions.js +37 -0
  98. package/dist/admin/pages/ListView/components/TableActions.js.map +1 -1
  99. package/dist/admin/pages/ListView/components/TableActions.mjs +39 -2
  100. package/dist/admin/pages/ListView/components/TableActions.mjs.map +1 -1
  101. package/dist/admin/pages/ListView/components/TableCells/CellContent.js +26 -1
  102. package/dist/admin/pages/ListView/components/TableCells/CellContent.js.map +1 -1
  103. package/dist/admin/pages/ListView/components/TableCells/CellContent.mjs +26 -2
  104. package/dist/admin/pages/ListView/components/TableCells/CellContent.mjs.map +1 -1
  105. package/dist/admin/pages/ListView/components/TableCells/CellValue.js +8 -7
  106. package/dist/admin/pages/ListView/components/TableCells/CellValue.js.map +1 -1
  107. package/dist/admin/pages/ListView/components/TableCells/CellValue.mjs +8 -7
  108. package/dist/admin/pages/ListView/components/TableCells/CellValue.mjs.map +1 -1
  109. package/dist/admin/pages/ListView/components/TableCells/Components.js.map +1 -1
  110. package/dist/admin/pages/ListView/components/TableCells/Components.mjs.map +1 -1
  111. package/dist/admin/preview/pages/Preview.js +2 -0
  112. package/dist/admin/preview/pages/Preview.js.map +1 -1
  113. package/dist/admin/preview/pages/Preview.mjs +2 -0
  114. package/dist/admin/preview/pages/Preview.mjs.map +1 -1
  115. package/dist/admin/preview/routes.js.map +1 -1
  116. package/dist/admin/preview/routes.mjs.map +1 -1
  117. package/dist/admin/preview/utils/fieldUtils.js.map +1 -1
  118. package/dist/admin/preview/utils/fieldUtils.mjs.map +1 -1
  119. package/dist/admin/router.js.map +1 -1
  120. package/dist/admin/router.mjs.map +1 -1
  121. package/dist/admin/services/documents.js.map +1 -1
  122. package/dist/admin/services/documents.mjs.map +1 -1
  123. package/dist/admin/src/components/ComponentIcon.d.ts +4 -3
  124. package/dist/admin/src/components/DragLayer.d.ts +1 -1
  125. package/dist/admin/src/history/routes.d.ts +2 -2
  126. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  127. package/dist/admin/src/hooks/useDocumentActions.d.ts +17 -16
  128. package/dist/admin/src/hooks/useDocumentContext.d.ts +1 -1
  129. package/dist/admin/src/index.d.ts +1 -1
  130. package/dist/admin/src/pages/EditView/components/FormInputs/UID.d.ts +1 -1
  131. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/Editor.d.ts +1 -1
  132. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/utils/utils.d.ts +7 -1
  133. package/dist/admin/src/pages/ListView/components/TableCells/CellContent.d.ts +11 -2
  134. package/dist/admin/src/pages/ListView/components/TableCells/CellValue.d.ts +1 -1
  135. package/dist/admin/src/preview/routes.d.ts +2 -2
  136. package/dist/admin/src/preview/services/preview.d.ts +1 -1
  137. package/dist/admin/src/router.d.ts +2 -2
  138. package/dist/admin/src/services/api.d.ts +1 -1
  139. package/dist/admin/src/services/components.d.ts +2 -2
  140. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  141. package/dist/admin/src/services/documents.d.ts +19 -19
  142. package/dist/admin/src/services/homepage.d.ts +1 -1
  143. package/dist/admin/src/services/init.d.ts +1 -1
  144. package/dist/admin/src/services/relations.d.ts +2 -2
  145. package/dist/admin/src/services/uid.d.ts +3 -3
  146. package/dist/admin/src/utils/api.d.ts +2 -2
  147. package/dist/admin/src/utils/conditionalFields.d.ts +1 -0
  148. package/dist/admin/src/utils/objects.d.ts +7 -4
  149. package/dist/admin/src/utils/validation.d.ts +2 -1
  150. package/dist/admin/translations/en.json.js +1 -0
  151. package/dist/admin/translations/en.json.js.map +1 -1
  152. package/dist/admin/translations/en.json.mjs +1 -0
  153. package/dist/admin/translations/en.json.mjs.map +1 -1
  154. package/dist/admin/utils/api.js +6 -1
  155. package/dist/admin/utils/api.js.map +1 -1
  156. package/dist/admin/utils/api.mjs +6 -1
  157. package/dist/admin/utils/api.mjs.map +1 -1
  158. package/dist/admin/utils/conditionalFields.js.map +1 -1
  159. package/dist/admin/utils/conditionalFields.mjs.map +1 -1
  160. package/dist/admin/utils/objects.js +43 -13
  161. package/dist/admin/utils/objects.js.map +1 -1
  162. package/dist/admin/utils/objects.mjs +43 -13
  163. package/dist/admin/utils/objects.mjs.map +1 -1
  164. package/dist/admin/utils/validation.js.map +1 -1
  165. package/dist/admin/utils/validation.mjs.map +1 -1
  166. package/dist/server/controllers/collection-types.js +4 -1
  167. package/dist/server/controllers/collection-types.js.map +1 -1
  168. package/dist/server/controllers/collection-types.mjs +4 -1
  169. package/dist/server/controllers/collection-types.mjs.map +1 -1
  170. package/dist/server/controllers/relations.js +5 -4
  171. package/dist/server/controllers/relations.js.map +1 -1
  172. package/dist/server/controllers/relations.mjs +5 -4
  173. package/dist/server/controllers/relations.mjs.map +1 -1
  174. package/dist/server/controllers/validation/model-configuration.js +3 -1
  175. package/dist/server/controllers/validation/model-configuration.js.map +1 -1
  176. package/dist/server/controllers/validation/model-configuration.mjs +3 -1
  177. package/dist/server/controllers/validation/model-configuration.mjs.map +1 -1
  178. package/dist/server/homepage/services/homepage.js +27 -7
  179. package/dist/server/homepage/services/homepage.js.map +1 -1
  180. package/dist/server/homepage/services/homepage.mjs +27 -7
  181. package/dist/server/homepage/services/homepage.mjs.map +1 -1
  182. package/dist/server/services/permission.js +4 -3
  183. package/dist/server/services/permission.js.map +1 -1
  184. package/dist/server/services/permission.mjs +4 -3
  185. package/dist/server/services/permission.mjs.map +1 -1
  186. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  187. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  188. package/dist/server/src/homepage/services/homepage.d.ts.map +1 -1
  189. package/dist/server/src/services/permission.d.ts.map +1 -1
  190. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"documents.mjs","sources":["../../../admin/src/services/documents.ts"],"sourcesContent":["/**\n * Related to fetching the actual content of a collection type or single type.\n */\nimport { stringify } from 'qs';\n\nimport { SINGLE_TYPES } from '../constants/collections';\n\nimport { contentManagerApi } from './api';\n\nimport type {\n Clone,\n Create,\n Delete,\n Find,\n FindOne,\n BulkDelete,\n BulkPublish,\n BulkUnpublish,\n Discard,\n CountDraftRelations,\n CountManyEntriesDraftRelations,\n Publish,\n Unpublish,\n Update,\n} from '../../../shared/contracts/collection-types';\n\nconst documentApi = contentManagerApi.injectEndpoints({\n overrideExisting: true,\n endpoints: (builder) => ({\n autoCloneDocument: builder.mutation<\n Clone.Response,\n Clone.Params & {\n params?: Find.Request['query'] & Clone.Request['query'];\n }\n >({\n query: ({ model, sourceId, params }) => ({\n url: `/content-manager/collection-types/${model}/auto-clone/${sourceId}`,\n method: 'POST',\n config: {\n params,\n },\n }),\n invalidatesTags: (_result, error, { model }) => {\n if (error) {\n return [];\n }\n\n return [\n { type: 'Document', id: `${model}_LIST` },\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ];\n },\n }),\n cloneDocument: builder.mutation<\n Clone.Response,\n Clone.Params & {\n data: Clone.Request['body'];\n params?: Clone.Request['query'];\n }\n >({\n query: ({ model, sourceId, data, params }) => ({\n url: `/content-manager/collection-types/${model}/clone/${sourceId}`,\n method: 'POST',\n data,\n config: {\n params,\n },\n }),\n invalidatesTags: (_result, _error, { model }) => [\n { type: 'Document', id: `${model}_LIST` },\n { type: 'UidAvailability', id: model },\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ],\n }),\n /**\n * Creates a new collection-type document. This should ONLY be used for collection-types.\n * single-types should always be using `updateDocument` since they always exist.\n */\n createDocument: builder.mutation<\n Create.Response,\n Create.Params & {\n data: Create.Request['body'];\n params?: Create.Request['query'];\n }\n >({\n query: ({ model, data, params }) => ({\n url: `/content-manager/collection-types/${model}`,\n method: 'POST',\n data,\n config: {\n params,\n },\n }),\n invalidatesTags: (result, _error, { model }) => [\n { type: 'Document', id: `${model}_LIST` },\n 'Relations',\n { type: 'UidAvailability', id: model },\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ],\n transformResponse: (response: Create.Response, meta, arg): Create.Response => {\n /**\n * TODO v6\n * Adapt plugin:users-permissions.user to return the same response\n * shape as all other requests. The error is returned as expected.\n */\n if (!('data' in response) && arg.model === 'plugin::users-permissions.user') {\n return {\n data: response,\n meta: {\n availableStatus: [],\n availableLocales: [],\n },\n };\n }\n\n return response;\n },\n }),\n deleteDocument: builder.mutation<\n Delete.Response,\n Pick<Delete.Params, 'model'> &\n Pick<Partial<Delete.Params>, 'documentId'> & {\n collectionType: string;\n params?: Find.Request['query'];\n }\n >({\n query: ({ collectionType, model, documentId, params }) => ({\n url: `/content-manager/${collectionType}/${model}${\n collectionType !== SINGLE_TYPES && documentId ? `/${documentId}` : ''\n }`,\n method: 'DELETE',\n config: {\n params,\n },\n }),\n invalidatesTags: (_result, _error, { collectionType, model, documentId }) => [\n { type: 'Document', id: collectionType !== SINGLE_TYPES ? `${model}_LIST` : model },\n {\n type: 'Document',\n id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model,\n },\n { type: 'Document', id: `${model}_ALL_ITEMS` },\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ],\n }),\n deleteManyDocuments: builder.mutation<\n BulkDelete.Response,\n BulkDelete.Params & BulkDelete.Request['body'] & { params?: Find.Request['query'] }\n >({\n query: ({ model, params, ...body }) => ({\n url: `/content-manager/collection-types/${model}/actions/bulkDelete`,\n method: 'POST',\n data: body,\n config: {\n params,\n },\n }),\n invalidatesTags: (_res, _error, { model }) => [\n { type: 'Document', id: `${model}_LIST` },\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ],\n }),\n discardDocument: builder.mutation<\n Discard.Response,\n Pick<Discard.Params, 'model'> &\n Partial<Pick<Discard.Params, 'documentId'>> & {\n collectionType: string;\n params?: Find.Request['query'] & {\n [key: string]: any;\n };\n }\n >({\n query: ({ collectionType, model, documentId, params }) => ({\n url:\n documentId && collectionType !== SINGLE_TYPES\n ? `/content-manager/${collectionType}/${model}/${documentId}/actions/discard`\n : `/content-manager/${collectionType}/${model}/actions/discard`,\n method: 'POST',\n config: {\n params,\n },\n }),\n invalidatesTags: (_result, _error, { collectionType, model, documentId }) => {\n return [\n {\n type: 'Document',\n id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model,\n },\n { type: 'Document', id: `${model}_LIST` },\n 'Relations',\n { type: 'UidAvailability', id: model },\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ];\n },\n }),\n /**\n * Gets all documents of a collection type or single type.\n * By passing different params you can get different results e.g. only published documents or 'es' documents.\n */\n getAllDocuments: builder.query<\n Find.Response,\n Find.Params & {\n params?: Find.Request['query'] & {\n [key: string]: any;\n };\n }\n >({\n query: ({ model, params }) => ({\n url: `/content-manager/collection-types/${model}`,\n method: 'GET',\n config: {\n params: stringify(params, { encode: true }),\n },\n }),\n providesTags: (result, _error, arg) => {\n return [\n { type: 'Document', id: `ALL_LIST` },\n { type: 'Document', id: `${arg.model}_LIST` },\n ...(result?.results.map(({ documentId }) => ({\n type: 'Document' as const,\n id: `${arg.model}_${documentId}`,\n })) ?? []),\n ];\n },\n }),\n getDraftRelationCount: builder.query<\n CountDraftRelations.Response,\n {\n collectionType: string;\n model: string;\n /**\n * You don't pass the documentId if the document is a single-type\n */\n documentId?: string;\n params?: CountDraftRelations.Request['query'];\n }\n >({\n query: ({ collectionType, model, documentId, params }) => ({\n url:\n documentId && collectionType !== SINGLE_TYPES\n ? `/content-manager/${collectionType}/${model}/${documentId}/actions/countDraftRelations`\n : `/content-manager/${collectionType}/${model}/actions/countDraftRelations`,\n method: 'GET',\n config: {\n params,\n },\n }),\n }),\n /**\n * Fetches multiple documents with deep populate in a single request for bulk publish validation.\n */\n getDocumentsForValidation: builder.query<\n Find.Response['results'],\n {\n model: string;\n documentIds: string[];\n locale?: string;\n sort?: string;\n }\n >({\n query: ({ model, documentIds, locale, sort }) => ({\n url: `/content-manager/collection-types/${model}/actions/bulkFindForValidation`,\n method: 'POST',\n data: { documentIds, locale, sort },\n }),\n transformResponse: (response: { results: Find.Response['results'] }) =>\n response?.results ?? [],\n providesTags: (result, _error, { model }) =>\n result\n ? [\n ...result.map((doc) => ({\n type: 'Document' as const,\n id: `${model}_${doc.documentId}`,\n })),\n { type: 'Document', id: `${model}_LIST` },\n ]\n : [],\n }),\n getDocument: builder.query<\n FindOne.Response,\n Pick<FindOne.Params, 'model'> &\n Partial<Pick<FindOne.Params, 'documentId'>> & {\n collectionType: string;\n params?: FindOne.Request['query'];\n }\n >({\n // @ts-expect-error – TODO: fix ts error where data unknown doesn't work with response via an assertion?\n queryFn: async (\n { collectionType, model, documentId, params },\n _api,\n _extraOpts,\n baseQuery\n ) => {\n const res = await baseQuery({\n url: `/content-manager/${collectionType}/${model}${\n documentId && collectionType !== SINGLE_TYPES ? `/${documentId}` : ''\n }`,\n method: 'GET',\n config: {\n params,\n },\n });\n\n /**\n * To stop the query from locking itself in multiple retries, we intercept the error here and manage correctly.\n * This is because single-types don't have a list view and fetching them with the route `/single-types/:model`\n * never returns a list, just a single document but this won't exist if you've not made one before.\n */\n if (res.error && res.error.name === 'NotFoundError' && collectionType === SINGLE_TYPES) {\n return { data: { document: undefined }, error: undefined };\n }\n\n return res;\n },\n providesTags: (result, _error, { collectionType, model, documentId }) => {\n return [\n // we prefer the result's id because we don't fetch single-types with an ID.\n {\n type: 'Document',\n id:\n collectionType !== SINGLE_TYPES\n ? `${model}_${result && 'documentId' in result ? result.documentId : documentId}`\n : model,\n },\n // Make it easy to invalidate all individual documents queries for a model\n {\n type: 'Document',\n id: `${model}_ALL_ITEMS`,\n },\n ];\n },\n }),\n getManyDraftRelationCount: builder.query<\n CountManyEntriesDraftRelations.Response['data'],\n CountManyEntriesDraftRelations.Request['query'] & {\n model: string;\n }\n >({\n query: ({ model, ...params }) => ({\n url: `/content-manager/collection-types/${model}/actions/countManyEntriesDraftRelations`,\n method: 'GET',\n config: {\n params,\n },\n }),\n transformResponse: (response: CountManyEntriesDraftRelations.Response) => response.data,\n }),\n /**\n * This endpoint will either create or update documents at the same time as publishing.\n */\n publishDocument: builder.mutation<\n Publish.Response,\n Pick<Publish.Params, 'model'> &\n Partial<Pick<Publish.Params, 'documentId'>> & {\n collectionType: string;\n data: Publish.Request['body'];\n params?: Publish.Request['query'];\n }\n >({\n query: ({ collectionType, model, documentId, params, data }) => ({\n url:\n documentId && collectionType !== SINGLE_TYPES\n ? `/content-manager/${collectionType}/${model}/${documentId}/actions/publish`\n : `/content-manager/${collectionType}/${model}/actions/publish`,\n method: 'POST',\n data,\n config: {\n params,\n },\n }),\n invalidatesTags: (_result, _error, { collectionType, model, documentId }) => {\n return [\n {\n type: 'Document',\n id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model,\n },\n { type: 'Document', id: `${model}_LIST` },\n 'Relations',\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n {\n type: 'AILocalizationJobs',\n id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model,\n },\n ];\n },\n }),\n publishManyDocuments: builder.mutation<\n BulkPublish.Response,\n BulkPublish.Params & BulkPublish.Request['body'] & { params?: BulkPublish.Request['query'] }\n >({\n query: ({ model, params, ...body }) => ({\n url: `/content-manager/collection-types/${model}/actions/bulkPublish`,\n method: 'POST',\n data: body,\n config: {\n params,\n },\n }),\n invalidatesTags: (_res, _error, { model, documentIds }) => {\n return [\n ...documentIds.map((id) => ({ type: 'Document' as const, id: `${model}_${id}` })),\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ];\n },\n }),\n updateDocument: builder.mutation<\n Update.Response,\n Pick<Update.Params, 'model'> &\n Partial<Pick<Update.Params, 'documentId'>> & {\n collectionType: string;\n data: Update.Request['body'];\n params?: Update.Request['query'];\n }\n >({\n query: ({ collectionType, model, documentId, data, params }) => ({\n url: `/content-manager/${collectionType}/${model}${\n documentId && collectionType !== SINGLE_TYPES ? `/${documentId}` : ''\n }`,\n method: 'PUT',\n data,\n config: {\n params,\n },\n }),\n invalidatesTags: (_result, _error, { collectionType, model, documentId }) => {\n return [\n {\n type: 'Document',\n id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model,\n },\n 'Relations',\n { type: 'UidAvailability', id: model },\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n {\n type: 'AILocalizationJobs',\n id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model,\n },\n ];\n },\n async onQueryStarted({ data, ...patch }, { dispatch, queryFulfilled }) {\n // Optimistically update the cache with the new data\n const patchResult = dispatch(\n documentApi.util.updateQueryData('getDocument', patch, (draft) => {\n Object.assign(draft.data, data);\n })\n );\n try {\n await queryFulfilled;\n } catch {\n // Rollback the optimistic update if there's an error\n patchResult.undo();\n }\n },\n transformResponse: (response: Update.Response, meta, arg): Update.Response => {\n /**\n * TODO v6\n * Adapt plugin:users-permissions.user to return the same response\n * shape as all other requests. The error is returned as expected.\n */\n if (!('data' in response) && arg.model === 'plugin::users-permissions.user') {\n return {\n data: response,\n meta: {\n availableStatus: [],\n availableLocales: [],\n },\n };\n }\n\n return response;\n },\n }),\n unpublishDocument: builder.mutation<\n Unpublish.Response,\n Pick<Unpublish.Params, 'model'> &\n Partial<Pick<Unpublish.Params, 'documentId'>> & {\n collectionType: string;\n params?: Unpublish.Request['query'];\n data: Unpublish.Request['body'];\n }\n >({\n query: ({ collectionType, model, documentId, params, data }) => ({\n url:\n documentId && collectionType !== SINGLE_TYPES\n ? `/content-manager/${collectionType}/${model}/${documentId}/actions/unpublish`\n : `/content-manager/${collectionType}/${model}/actions/unpublish`,\n method: 'POST',\n data,\n config: {\n params,\n },\n }),\n invalidatesTags: (_result, _error, { collectionType, model, documentId }) => {\n return [\n {\n type: 'Document',\n id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model,\n },\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ];\n },\n }),\n unpublishManyDocuments: builder.mutation<\n BulkUnpublish.Response,\n Pick<BulkUnpublish.Params, 'model'> &\n BulkUnpublish.Request['body'] & {\n params?: BulkUnpublish.Request['query'];\n }\n >({\n query: ({ model, params, ...body }) => ({\n url: `/content-manager/collection-types/${model}/actions/bulkUnpublish`,\n method: 'POST',\n data: body,\n config: {\n params,\n },\n }),\n invalidatesTags: (_res, _error, { model, documentIds }) => [\n ...documentIds.map((id) => ({ type: 'Document' as const, id: `${model}_${id}` })),\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ],\n }),\n }),\n});\n\nconst {\n useAutoCloneDocumentMutation,\n useCloneDocumentMutation,\n useCreateDocumentMutation,\n useDeleteDocumentMutation,\n useDeleteManyDocumentsMutation,\n useDiscardDocumentMutation,\n useGetAllDocumentsQuery,\n useGetDocumentsForValidationQuery,\n useLazyGetDocumentQuery,\n useGetDocumentQuery,\n useLazyGetDraftRelationCountQuery,\n useGetManyDraftRelationCountQuery,\n usePublishDocumentMutation,\n usePublishManyDocumentsMutation,\n useUpdateDocumentMutation,\n useUnpublishDocumentMutation,\n useUnpublishManyDocumentsMutation,\n} = documentApi;\n\nexport {\n useAutoCloneDocumentMutation,\n useCloneDocumentMutation,\n useCreateDocumentMutation,\n useDeleteDocumentMutation,\n useDeleteManyDocumentsMutation,\n useDiscardDocumentMutation,\n useGetAllDocumentsQuery,\n useGetDocumentsForValidationQuery,\n useLazyGetDocumentQuery,\n useGetDocumentQuery,\n useLazyGetDraftRelationCountQuery as useGetDraftRelationCountQuery,\n useGetManyDraftRelationCountQuery,\n usePublishDocumentMutation,\n usePublishManyDocumentsMutation,\n useUpdateDocumentMutation,\n useUnpublishDocumentMutation,\n useUnpublishManyDocumentsMutation,\n};\n"],"names":["documentApi","contentManagerApi","injectEndpoints","overrideExisting","endpoints","builder","autoCloneDocument","mutation","query","model","sourceId","params","url","method","config","invalidatesTags","_result","error","type","id","cloneDocument","data","_error","createDocument","result","transformResponse","response","meta","arg","availableStatus","availableLocales","deleteDocument","collectionType","documentId","SINGLE_TYPES","deleteManyDocuments","body","_res","discardDocument","getAllDocuments","stringify","encode","providesTags","results","map","getDraftRelationCount","getDocumentsForValidation","documentIds","locale","sort","doc","getDocument","queryFn","_api","_extraOpts","baseQuery","res","name","document","undefined","getManyDraftRelationCount","publishDocument","publishManyDocuments","updateDocument","onQueryStarted","patch","dispatch","queryFulfilled","patchResult","util","updateQueryData","draft","Object","assign","undo","unpublishDocument","unpublishManyDocuments","useAutoCloneDocumentMutation","useCloneDocumentMutation","useCreateDocumentMutation","useDeleteDocumentMutation","useDeleteManyDocumentsMutation","useDiscardDocumentMutation","useGetAllDocumentsQuery","useGetDocumentsForValidationQuery","useLazyGetDocumentQuery","useGetDocumentQuery","useLazyGetDraftRelationCountQuery","useGetManyDraftRelationCountQuery","usePublishDocumentMutation","usePublishManyDocumentsMutation","useUpdateDocumentMutation","useUnpublishDocumentMutation","useUnpublishManyDocumentsMutation"],"mappings":";;;;AA0BA,MAAMA,WAAAA,GAAcC,iBAAAA,CAAkBC,eAAe,CAAC;IACpDC,gBAAAA,EAAkB,IAAA;IAClBC,SAAAA,EAAW,CAACC,WAAa;YACvBC,iBAAAA,EAAmBD,OAAAA,CAAQE,QAAQ,CAKjC;gBACAC,KAAAA,EAAO,CAAC,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,MAAM,EAAE,IAAM;AACvCC,wBAAAA,GAAAA,EAAK,CAAC,kCAAkC,EAAEH,KAAAA,CAAM,YAAY,EAAEC,QAAAA,CAAAA,CAAU;wBACxEG,MAAAA,EAAQ,MAAA;wBACRC,MAAAA,EAAQ;AACNH,4BAAAA;AACF;qBACF,CAAA;AACAI,gBAAAA,eAAAA,EAAiB,CAACC,OAAAA,EAASC,KAAAA,EAAO,EAAER,KAAK,EAAE,GAAA;AACzC,oBAAA,IAAIQ,KAAAA,EAAO;AACT,wBAAA,OAAO,EAAE;AACX,oBAAA;oBAEA,OAAO;AACL,wBAAA;4BAAEC,IAAAA,EAAM,UAAA;4BAAYC,EAAAA,EAAI,CAAA,EAAGV,KAAAA,CAAM,KAAK;AAAE,yBAAA;AACxC,wBAAA,oBAAA;AACA,wBAAA,gBAAA;AACA,wBAAA;AACD,qBAAA;AACH,gBAAA;AACF,aAAA,CAAA;YACAW,aAAAA,EAAef,OAAAA,CAAQE,QAAQ,CAM7B;gBACAC,KAAAA,EAAO,CAAC,EAAEC,KAAK,EAAEC,QAAQ,EAAEW,IAAI,EAAEV,MAAM,EAAE,IAAM;AAC7CC,wBAAAA,GAAAA,EAAK,CAAC,kCAAkC,EAAEH,KAAAA,CAAM,OAAO,EAAEC,QAAAA,CAAAA,CAAU;wBACnEG,MAAAA,EAAQ,MAAA;AACRQ,wBAAAA,IAAAA;wBACAP,MA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AACF,CAAA,CAAA;AAEA,MAAM,EACJ0D,4BAA4B,EAC5BC,wBAAwB,EACxBC,yBAAyB,EACzBC,yBAAyB,EACzBC,8BAA8B,EAC9BC,0BAA0B,EAC1BC,uBAAuB,EACvBC,iCAAiC,EACjCC,uBAAuB,EACvBC,mBAAmB,EACnBC,iCAAiC,EACjCC,iCAAiC,EACjCC,0BAA0B,EAC1BC,+BAA+B,EAC/BC,yBAAyB,EACzBC,4BAA4B,EAC5BC,iCAAiC,EAClC,GAAG7F;;;;"}
1
+ {"version":3,"file":"documents.mjs","sources":["../../../admin/src/services/documents.ts"],"sourcesContent":["/**\n * Related to fetching the actual content of a collection type or single type.\n */\nimport { stringify } from 'qs';\n\nimport { SINGLE_TYPES } from '../constants/collections';\n\nimport { contentManagerApi } from './api';\n\nimport type {\n Clone,\n Create,\n Delete,\n Find,\n FindOne,\n BulkDelete,\n BulkPublish,\n BulkUnpublish,\n Discard,\n CountDraftRelations,\n CountManyEntriesDraftRelations,\n Publish,\n Unpublish,\n Update,\n} from '../../../shared/contracts/collection-types';\n\nconst documentApi = contentManagerApi.injectEndpoints({\n overrideExisting: true,\n endpoints: (builder) => ({\n autoCloneDocument: builder.mutation<\n Clone.Response,\n Clone.Params & {\n params?: Find.Request['query'] & Clone.Request['query'];\n }\n >({\n query: ({ model, sourceId, params }) => ({\n url: `/content-manager/collection-types/${model}/auto-clone/${sourceId}`,\n method: 'POST',\n config: {\n params,\n },\n }),\n invalidatesTags: (_result, error, { model }) => {\n if (error) {\n return [];\n }\n\n return [\n { type: 'Document', id: `${model}_LIST` },\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ];\n },\n }),\n cloneDocument: builder.mutation<\n Clone.Response,\n Clone.Params & {\n data: Clone.Request['body'];\n params?: Clone.Request['query'];\n }\n >({\n query: ({ model, sourceId, data, params }) => ({\n url: `/content-manager/collection-types/${model}/clone/${sourceId}`,\n method: 'POST',\n data,\n config: {\n params,\n },\n }),\n invalidatesTags: (_result, _error, { model }) => [\n { type: 'Document', id: `${model}_LIST` },\n { type: 'UidAvailability', id: model },\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ],\n }),\n /**\n * Creates a new collection-type document. This should ONLY be used for collection-types.\n * single-types should always be using `updateDocument` since they always exist.\n */\n createDocument: builder.mutation<\n Create.Response,\n Create.Params & {\n data: Create.Request['body'];\n params?: Create.Request['query'];\n }\n >({\n query: ({ model, data, params }) => ({\n url: `/content-manager/collection-types/${model}`,\n method: 'POST',\n data,\n config: {\n params,\n },\n }),\n invalidatesTags: (result, _error, { model }) => [\n { type: 'Document', id: `${model}_LIST` },\n 'Relations',\n { type: 'UidAvailability', id: model },\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ],\n transformResponse: (response: Create.Response, meta, arg): Create.Response => {\n /**\n * TODO v6\n * Adapt plugin:users-permissions.user to return the same response\n * shape as all other requests. The error is returned as expected.\n */\n if (!('data' in response) && arg.model === 'plugin::users-permissions.user') {\n return {\n data: response,\n meta: {\n availableStatus: [],\n availableLocales: [],\n },\n };\n }\n\n return response;\n },\n }),\n deleteDocument: builder.mutation<\n Delete.Response,\n Pick<Delete.Params, 'model'> &\n Pick<Partial<Delete.Params>, 'documentId'> & {\n collectionType: string;\n params?: Find.Request['query'];\n }\n >({\n query: ({ collectionType, model, documentId, params }) => ({\n url: `/content-manager/${collectionType}/${model}${\n collectionType !== SINGLE_TYPES && documentId ? `/${documentId}` : ''\n }`,\n method: 'DELETE',\n config: {\n params,\n },\n }),\n invalidatesTags: (_result, _error, { collectionType, model, documentId }) => [\n { type: 'Document', id: collectionType !== SINGLE_TYPES ? `${model}_LIST` : model },\n {\n type: 'Document',\n id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model,\n },\n { type: 'Document', id: `${model}_ALL_ITEMS` },\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ],\n }),\n deleteManyDocuments: builder.mutation<\n BulkDelete.Response,\n BulkDelete.Params & BulkDelete.Request['body'] & { params?: Find.Request['query'] }\n >({\n query: ({ model, params, ...body }) => ({\n url: `/content-manager/collection-types/${model}/actions/bulkDelete`,\n method: 'POST',\n data: body,\n config: {\n params,\n },\n }),\n invalidatesTags: (_res, _error, { model }) => [\n { type: 'Document', id: `${model}_LIST` },\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ],\n }),\n discardDocument: builder.mutation<\n Discard.Response,\n Pick<Discard.Params, 'model'> &\n Partial<Pick<Discard.Params, 'documentId'>> & {\n collectionType: string;\n params?: Find.Request['query'] & {\n [key: string]: unknown;\n };\n }\n >({\n query: ({ collectionType, model, documentId, params }) => ({\n url:\n documentId && collectionType !== SINGLE_TYPES\n ? `/content-manager/${collectionType}/${model}/${documentId}/actions/discard`\n : `/content-manager/${collectionType}/${model}/actions/discard`,\n method: 'POST',\n config: {\n params,\n },\n }),\n invalidatesTags: (_result, _error, { collectionType, model, documentId }) => {\n return [\n {\n type: 'Document',\n id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model,\n },\n { type: 'Document', id: `${model}_LIST` },\n 'Relations',\n { type: 'UidAvailability', id: model },\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ];\n },\n }),\n /**\n * Gets all documents of a collection type or single type.\n * By passing different params you can get different results e.g. only published documents or 'es' documents.\n */\n getAllDocuments: builder.query<\n Find.Response,\n Find.Params & {\n params?: Find.Request['query'] & {\n [key: string]: unknown;\n };\n }\n >({\n query: ({ model, params }) => ({\n url: `/content-manager/collection-types/${model}`,\n method: 'GET',\n config: {\n params: stringify(params, { encode: true }),\n },\n }),\n providesTags: (result, _error, arg) => {\n return [\n { type: 'Document', id: `ALL_LIST` },\n { type: 'Document', id: `${arg.model}_LIST` },\n ...(result?.results.map(({ documentId }) => ({\n type: 'Document' as const,\n id: `${arg.model}_${documentId}`,\n })) ?? []),\n ];\n },\n }),\n getDraftRelationCount: builder.query<\n CountDraftRelations.Response,\n {\n collectionType: string;\n model: string;\n /**\n * You don't pass the documentId if the document is a single-type\n */\n documentId?: string;\n params?: CountDraftRelations.Request['query'];\n }\n >({\n query: ({ collectionType, model, documentId, params }) => ({\n url:\n documentId && collectionType !== SINGLE_TYPES\n ? `/content-manager/${collectionType}/${model}/${documentId}/actions/countDraftRelations`\n : `/content-manager/${collectionType}/${model}/actions/countDraftRelations`,\n method: 'GET',\n config: {\n params,\n },\n }),\n }),\n /**\n * Fetches multiple documents with deep populate in a single request for bulk publish validation.\n */\n getDocumentsForValidation: builder.query<\n Find.Response['results'],\n {\n model: string;\n documentIds: string[];\n locale?: string;\n sort?: string;\n }\n >({\n query: ({ model, documentIds, locale, sort }) => ({\n url: `/content-manager/collection-types/${model}/actions/bulkFindForValidation`,\n method: 'POST',\n data: { documentIds, locale, sort },\n }),\n transformResponse: (response: { results: Find.Response['results'] }) =>\n response?.results ?? [],\n providesTags: (result, _error, { model }) =>\n result\n ? [\n ...result.map((doc) => ({\n type: 'Document' as const,\n id: `${model}_${doc.documentId}`,\n })),\n { type: 'Document', id: `${model}_LIST` },\n ]\n : [],\n }),\n getDocument: builder.query<\n FindOne.Response,\n Pick<FindOne.Params, 'model'> &\n Partial<Pick<FindOne.Params, 'documentId'>> & {\n collectionType: string;\n params?: FindOne.Request['query'];\n }\n >({\n // @ts-expect-error – TODO: fix ts error where data unknown doesn't work with response via an assertion?\n queryFn: async (\n { collectionType, model, documentId, params },\n _api,\n _extraOpts,\n baseQuery\n ) => {\n const res = await baseQuery({\n url: `/content-manager/${collectionType}/${model}${\n documentId && collectionType !== SINGLE_TYPES ? `/${documentId}` : ''\n }`,\n method: 'GET',\n config: {\n params,\n },\n });\n\n /**\n * To stop the query from locking itself in multiple retries, we intercept the error here and manage correctly.\n * This is because single-types don't have a list view and fetching them with the route `/single-types/:model`\n * never returns a list, just a single document but this won't exist if you've not made one before.\n */\n if (res.error && res.error.name === 'NotFoundError' && collectionType === SINGLE_TYPES) {\n return { data: { document: undefined }, error: undefined };\n }\n\n return res;\n },\n providesTags: (result, _error, { collectionType, model, documentId }) => {\n return [\n // we prefer the result's id because we don't fetch single-types with an ID.\n {\n type: 'Document',\n id:\n collectionType !== SINGLE_TYPES\n ? `${model}_${result && 'documentId' in result ? result.documentId : documentId}`\n : model,\n },\n // Make it easy to invalidate all individual documents queries for a model\n {\n type: 'Document',\n id: `${model}_ALL_ITEMS`,\n },\n ];\n },\n }),\n getManyDraftRelationCount: builder.query<\n CountManyEntriesDraftRelations.Response['data'],\n CountManyEntriesDraftRelations.Request['query'] & {\n model: string;\n }\n >({\n query: ({ model, ...params }) => ({\n url: `/content-manager/collection-types/${model}/actions/countManyEntriesDraftRelations`,\n method: 'GET',\n config: {\n params,\n },\n }),\n transformResponse: (response: CountManyEntriesDraftRelations.Response) => response.data,\n }),\n /**\n * This endpoint will either create or update documents at the same time as publishing.\n */\n publishDocument: builder.mutation<\n Publish.Response,\n Pick<Publish.Params, 'model'> &\n Partial<Pick<Publish.Params, 'documentId'>> & {\n collectionType: string;\n data: Publish.Request['body'];\n params?: Publish.Request['query'];\n }\n >({\n query: ({ collectionType, model, documentId, params, data }) => ({\n url:\n documentId && collectionType !== SINGLE_TYPES\n ? `/content-manager/${collectionType}/${model}/${documentId}/actions/publish`\n : `/content-manager/${collectionType}/${model}/actions/publish`,\n method: 'POST',\n data,\n config: {\n params,\n },\n }),\n invalidatesTags: (_result, _error, { collectionType, model, documentId }) => {\n return [\n {\n type: 'Document',\n id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model,\n },\n { type: 'Document', id: `${model}_LIST` },\n 'Relations',\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n {\n type: 'AILocalizationJobs',\n id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model,\n },\n ];\n },\n }),\n publishManyDocuments: builder.mutation<\n BulkPublish.Response,\n BulkPublish.Params & BulkPublish.Request['body'] & { params?: BulkPublish.Request['query'] }\n >({\n query: ({ model, params, ...body }) => ({\n url: `/content-manager/collection-types/${model}/actions/bulkPublish`,\n method: 'POST',\n data: body,\n config: {\n params,\n },\n }),\n invalidatesTags: (_res, _error, { model, documentIds }) => {\n return [\n ...documentIds.map((id) => ({ type: 'Document' as const, id: `${model}_${id}` })),\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ];\n },\n }),\n updateDocument: builder.mutation<\n Update.Response,\n Pick<Update.Params, 'model'> &\n Partial<Pick<Update.Params, 'documentId'>> & {\n collectionType: string;\n data: Update.Request['body'];\n params?: Update.Request['query'];\n }\n >({\n query: ({ collectionType, model, documentId, data, params }) => ({\n url: `/content-manager/${collectionType}/${model}${\n documentId && collectionType !== SINGLE_TYPES ? `/${documentId}` : ''\n }`,\n method: 'PUT',\n data,\n config: {\n params,\n },\n }),\n invalidatesTags: (_result, _error, { collectionType, model, documentId }) => {\n return [\n {\n type: 'Document',\n id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model,\n },\n 'Relations',\n { type: 'UidAvailability', id: model },\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n {\n type: 'AILocalizationJobs',\n id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model,\n },\n ];\n },\n async onQueryStarted({ data, ...patch }, { dispatch, queryFulfilled }) {\n // Optimistically update the cache with the new data\n const patchResult = dispatch(\n documentApi.util.updateQueryData('getDocument', patch, (draft) => {\n Object.assign(draft.data, data);\n })\n );\n try {\n await queryFulfilled;\n } catch {\n // Rollback the optimistic update if there's an error\n patchResult.undo();\n }\n },\n transformResponse: (response: Update.Response, meta, arg): Update.Response => {\n /**\n * TODO v6\n * Adapt plugin:users-permissions.user to return the same response\n * shape as all other requests. The error is returned as expected.\n */\n if (!('data' in response) && arg.model === 'plugin::users-permissions.user') {\n return {\n data: response,\n meta: {\n availableStatus: [],\n availableLocales: [],\n },\n };\n }\n\n return response;\n },\n }),\n unpublishDocument: builder.mutation<\n Unpublish.Response,\n Pick<Unpublish.Params, 'model'> &\n Partial<Pick<Unpublish.Params, 'documentId'>> & {\n collectionType: string;\n params?: Unpublish.Request['query'];\n data: Unpublish.Request['body'];\n }\n >({\n query: ({ collectionType, model, documentId, params, data }) => ({\n url:\n documentId && collectionType !== SINGLE_TYPES\n ? `/content-manager/${collectionType}/${model}/${documentId}/actions/unpublish`\n : `/content-manager/${collectionType}/${model}/actions/unpublish`,\n method: 'POST',\n data,\n config: {\n params,\n },\n }),\n invalidatesTags: (_result, _error, { collectionType, model, documentId }) => {\n return [\n {\n type: 'Document',\n id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model,\n },\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ];\n },\n }),\n unpublishManyDocuments: builder.mutation<\n BulkUnpublish.Response,\n Pick<BulkUnpublish.Params, 'model'> &\n BulkUnpublish.Request['body'] & {\n params?: BulkUnpublish.Request['query'];\n }\n >({\n query: ({ model, params, ...body }) => ({\n url: `/content-manager/collection-types/${model}/actions/bulkUnpublish`,\n method: 'POST',\n data: body,\n config: {\n params,\n },\n }),\n invalidatesTags: (_res, _error, { model, documentIds }) => [\n ...documentIds.map((id) => ({ type: 'Document' as const, id: `${model}_${id}` })),\n 'RecentDocumentList',\n 'CountDocuments',\n 'UpcomingReleasesList',\n ],\n }),\n }),\n});\n\nconst {\n useAutoCloneDocumentMutation,\n useCloneDocumentMutation,\n useCreateDocumentMutation,\n useDeleteDocumentMutation,\n useDeleteManyDocumentsMutation,\n useDiscardDocumentMutation,\n useGetAllDocumentsQuery,\n useGetDocumentsForValidationQuery,\n useLazyGetDocumentQuery,\n useGetDocumentQuery,\n useLazyGetDraftRelationCountQuery,\n useGetManyDraftRelationCountQuery,\n usePublishDocumentMutation,\n usePublishManyDocumentsMutation,\n useUpdateDocumentMutation,\n useUnpublishDocumentMutation,\n useUnpublishManyDocumentsMutation,\n} = documentApi;\n\nexport {\n useAutoCloneDocumentMutation,\n useCloneDocumentMutation,\n useCreateDocumentMutation,\n useDeleteDocumentMutation,\n useDeleteManyDocumentsMutation,\n useDiscardDocumentMutation,\n useGetAllDocumentsQuery,\n useGetDocumentsForValidationQuery,\n useLazyGetDocumentQuery,\n useGetDocumentQuery,\n useLazyGetDraftRelationCountQuery as useGetDraftRelationCountQuery,\n useGetManyDraftRelationCountQuery,\n usePublishDocumentMutation,\n usePublishManyDocumentsMutation,\n useUpdateDocumentMutation,\n useUnpublishDocumentMutation,\n useUnpublishManyDocumentsMutation,\n};\n"],"names":["documentApi","contentManagerApi","injectEndpoints","overrideExisting","endpoints","builder","autoCloneDocument","mutation","query","model","sourceId","params","url","method","config","invalidatesTags","_result","error","type","id","cloneDocument","data","_error","createDocument","result","transformResponse","response","meta","arg","availableStatus","availableLocales","deleteDocument","collectionType","documentId","SINGLE_TYPES","deleteManyDocuments","body","_res","discardDocument","getAllDocuments","stringify","encode","providesTags","results","map","getDraftRelationCount","getDocumentsForValidation","documentIds","locale","sort","doc","getDocument","queryFn","_api","_extraOpts","baseQuery","res","name","document","undefined","getManyDraftRelationCount","publishDocument","publishManyDocuments","updateDocument","onQueryStarted","patch","dispatch","queryFulfilled","patchResult","util","updateQueryData","draft","Object","assign","undo","unpublishDocument","unpublishManyDocuments","useAutoCloneDocumentMutation","useCloneDocumentMutation","useCreateDocumentMutation","useDeleteDocumentMutation","useDeleteManyDocumentsMutation","useDiscardDocumentMutation","useGetAllDocumentsQuery","useGetDocumentsForValidationQuery","useLazyGetDocumentQuery","useGetDocumentQuery","useLazyGetDraftRelationCountQuery","useGetManyDraftRelationCountQuery","usePublishDocumentMutation","usePublishManyDocumentsMutation","useUpdateDocumentMutation","useUnpublishDocumentMutation","useUnpublishManyDocumentsMutation"],"mappings":";;;;AA0BA,MAAMA,WAAAA,GAAcC,iBAAAA,CAAkBC,eAAe,CAAC;IACpDC,gBAAAA,EAAkB,IAAA;IAClBC,SAAAA,EAAW,CAACC,WAAa;YACvBC,iBAAAA,EAAmBD,OAAAA,CAAQE,QA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BC,iCAAiC,EAClC,GAAG7F;;;;"}
@@ -1,11 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { FlexProps } from '@strapi/design-system';
3
3
  import type { Struct } from '@strapi/types';
4
- interface ComponentIconProps extends FlexProps {
4
+ type ComponentIconProps = FlexProps & {
5
5
  showBackground?: boolean;
6
6
  icon?: Struct.ContentTypeSchemaInfo['icon'];
7
- }
7
+ };
8
+ type IconComponent = React.ComponentType<Pick<React.SVGProps<SVGSVGElement>, 'height' | 'width'>>;
8
9
  declare const ComponentIcon: ({ showBackground, icon, ...props }: ComponentIconProps) => import("react/jsx-runtime").JSX.Element;
9
- declare const COMPONENT_ICONS: Record<string, React.ComponentType<any>>;
10
+ declare const COMPONENT_ICONS: Record<string, IconComponent>;
10
11
  export { ComponentIcon, COMPONENT_ICONS };
11
12
  export type { ComponentIconProps };
@@ -5,7 +5,7 @@ export interface DragLayerProps {
5
5
  /**
6
6
  * TODO: it'd be great if we could make this a union where the type infers the item.
7
7
  */
8
- item: any;
8
+ item: unknown;
9
9
  type: ReturnType<DragLayerMonitor['getItemType']>;
10
10
  }) => React.ReactNode;
11
11
  }
@@ -1,6 +1,6 @@
1
- import { type PathRouteProps } from 'react-router-dom';
1
+ import { type RouteObject } from 'react-router-dom';
2
2
  /**
3
3
  * These routes will be merged with the rest of the Content Manager routes
4
4
  */
5
- declare const routes: PathRouteProps[];
5
+ declare const routes: RouteObject[];
6
6
  export { routes };
@@ -8,5 +8,5 @@ declare const useGetHistoryVersionsQuery: import("@reduxjs/toolkit/dist/query/re
8
8
  contentType: import("@strapi/types/dist/uid").ContentType;
9
9
  documentId?: Data.ID;
10
10
  locale?: string;
11
- } & Partial<Pick<import("../../../../shared/contracts/history-versions").Pagination, "page" | "pageSize">>, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", GetHistoryVersions.Response, "adminApi">>, useRestoreVersionMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query").MutationDefinition<RestoreVersion, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", RestoreHistoryVersion.Response, "adminApi">>;
11
+ } & Partial<Pick<import("../../../../shared/contracts/history-versions").Pagination, "page" | "pageSize">>, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError | import("@reduxjs/toolkit").SerializedError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", GetHistoryVersions.Response, "adminApi">>, useRestoreVersionMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query").MutationDefinition<RestoreVersion, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError | import("@reduxjs/toolkit").SerializedError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", RestoreHistoryVersion.Response, "adminApi">>;
12
12
  export { useGetHistoryVersionsQuery, useRestoreVersionMutation };
@@ -4,18 +4,19 @@ import { BaseQueryError } from '../utils/api';
4
4
  import type { Document } from './useDocument';
5
5
  import type { AutoClone, Clone, Create, Delete, BulkDelete, Discard, FindOne, Publish, BulkPublish, Update, Unpublish, BulkUnpublish } from '../../../shared/contracts/collection-types';
6
6
  type OperationResponse<TResponse extends {
7
- data: any;
8
- meta?: any;
9
- error?: any;
7
+ data: unknown;
8
+ meta?: unknown;
9
+ error?: unknown;
10
10
  }> = Pick<TResponse, 'data'> | Pick<TResponse, 'data' | 'meta'> | {
11
11
  error: BaseQueryError | SerializedError;
12
12
  };
13
13
  type BulkOperationResponse<TResponse extends {
14
- data: any;
15
- error?: any;
14
+ data: unknown;
15
+ error?: unknown;
16
16
  }> = Pick<TResponse, 'data'> | {
17
17
  error: BaseQueryError | SerializedError;
18
18
  };
19
+ type QueryParams = Record<string, unknown>;
19
20
  type UseDocumentActions = (fromPreview?: boolean, fromRelationModal?: boolean) => {
20
21
  /**
21
22
  * @description Attempts to clone a document based on the provided sourceId.
@@ -31,13 +32,13 @@ type UseDocumentActions = (fromPreview?: boolean, fromRelationModal?: boolean) =
31
32
  clone: (args: {
32
33
  model: string;
33
34
  documentId: string;
34
- params?: object;
35
+ params?: QueryParams;
35
36
  }, document: Omit<Document, 'id'>, trackerProperty?: Extract<TrackingEvent, {
36
37
  name: 'willCreateEntry' | 'didCreateEntry' | 'didNotCreateEntry';
37
38
  }>['properties']) => Promise<OperationResponse<Clone.Response>>;
38
39
  create: (args: {
39
40
  model: string;
40
- params?: object;
41
+ params?: QueryParams;
41
42
  }, document: Omit<Document, 'id'>, trackerProperty?: Extract<TrackingEvent, {
42
43
  name: 'willCreateEntry' | 'didCreateEntry' | 'didNotCreateEntry';
43
44
  }>['properties']) => Promise<OperationResponse<Create.Response>>;
@@ -45,43 +46,43 @@ type UseDocumentActions = (fromPreview?: boolean, fromRelationModal?: boolean) =
45
46
  collectionType: string;
46
47
  model: string;
47
48
  documentId?: string;
48
- params?: object;
49
+ params?: QueryParams;
49
50
  }, trackerProperty?: Extract<TrackingEvent, {
50
51
  name: 'willDeleteEntry' | 'didDeleteEntry' | 'didNotDeleteEntry';
51
52
  }>['properties']) => Promise<OperationResponse<Delete.Response>>;
52
53
  deleteMany: (args: {
53
54
  model: string;
54
55
  documentIds: string[];
55
- params?: object;
56
+ params?: QueryParams;
56
57
  }) => Promise<BulkOperationResponse<BulkDelete.Response>>;
57
58
  discard: (args: {
58
59
  collectionType: string;
59
60
  model: string;
60
61
  documentId?: string;
61
- params?: object;
62
+ params?: QueryParams;
62
63
  }) => Promise<OperationResponse<Discard.Response>>;
63
64
  getDocument: (args: {
64
65
  collectionType: string;
65
66
  model: string;
66
67
  documentId?: string;
67
- params?: object;
68
+ params?: QueryParams;
68
69
  }) => Promise<FindOne.Response | undefined>;
69
70
  publish: (args: {
70
71
  collectionType: string;
71
72
  model: string;
72
73
  documentId?: string;
73
- params?: object;
74
+ params?: QueryParams;
74
75
  }, document: Partial<Document>) => Promise<OperationResponse<Publish.Response>>;
75
76
  publishMany: (args: {
76
77
  model: string;
77
78
  documentIds: string[];
78
- params?: object;
79
+ params?: QueryParams;
79
80
  }) => Promise<BulkOperationResponse<BulkPublish.Response>>;
80
81
  update: (args: {
81
82
  collectionType: string;
82
83
  model: string;
83
84
  documentId?: string;
84
- params?: object;
85
+ params?: QueryParams;
85
86
  }, document: Partial<Document>, trackerProperty?: Extract<TrackingEvent, {
86
87
  name: 'willEditEntry' | 'didEditEntry' | 'didNotEditEntry';
87
88
  }>['properties']) => Promise<OperationResponse<Update.Response>>;
@@ -89,12 +90,12 @@ type UseDocumentActions = (fromPreview?: boolean, fromRelationModal?: boolean) =
89
90
  collectionType: string;
90
91
  model: string;
91
92
  documentId?: string;
92
- params?: object;
93
+ params?: QueryParams;
93
94
  }, discardDraft?: boolean) => Promise<OperationResponse<Unpublish.Response>>;
94
95
  unpublishMany: (args: {
95
96
  model: string;
96
97
  documentIds: string[];
97
- params?: object;
98
+ params?: QueryParams;
98
99
  }) => Promise<BulkOperationResponse<BulkUnpublish.Response>>;
99
100
  };
100
101
  /**
@@ -19,7 +19,7 @@ interface DocumentMeta {
19
19
  * Query params object
20
20
  * i.e. { locale: 'fr' }
21
21
  */
22
- params?: Record<string, string | string[] | null>;
22
+ params?: Record<string, unknown>;
23
23
  }
24
24
  interface DocumentContextValue {
25
25
  currentDocumentMeta: DocumentMeta;
@@ -1,7 +1,7 @@
1
1
  import type { StrapiApp } from '@strapi/admin/strapi-admin';
2
2
  import 'prismjs';
3
3
  declare const _default: {
4
- register(app: any): void;
4
+ register(app: StrapiApp): void;
5
5
  bootstrap(app: StrapiApp): void;
6
6
  registerTrads({ locales }: {
7
7
  locales: string[];
@@ -5,6 +5,6 @@ interface UIDInputProps extends Omit<InputProps, 'type'> {
5
5
  attribute?: Pick<Schema.Attribute.UIDProperties, 'regex'>;
6
6
  type: Schema.Attribute.TypeOf<Schema.Attribute.UID>;
7
7
  }
8
- declare const MemoizedUIDInput: React.MemoExoticComponent<React.ForwardRefExoticComponent<UIDInputProps & React.RefAttributes<any>>>;
8
+ declare const MemoizedUIDInput: React.MemoExoticComponent<React.ForwardRefExoticComponent<UIDInputProps & React.RefAttributes<HTMLInputElement>>>;
9
9
  export { MemoizedUIDInput as UIDInput };
10
10
  export type { UIDInputProps };
@@ -6,7 +6,7 @@ interface EditorApi {
6
6
  focus: () => void;
7
7
  scrollIntoView: (args?: Parameters<HTMLElement['scrollIntoView']>[0]) => void;
8
8
  }
9
- interface EditorProps extends Omit<FieldValue, 'initialValue'>, Omit<InputProps, 'type' | 'label'> {
9
+ interface EditorProps extends Omit<FieldValue<string>, 'initialValue'>, Omit<InputProps, 'type' | 'label'> {
10
10
  editorRef: React.MutableRefObject<EditorFromTextArea>;
11
11
  isPreviewMode?: boolean;
12
12
  isExpandMode?: boolean;
@@ -12,5 +12,11 @@ export declare const insertListOrTitle: (markdown: string) => string;
12
12
  export declare const markdownHandler: (editor: MutableRefObject<CodeMirror.EditorFromTextArea>, markdownType: string) => void;
13
13
  export declare const listHandler: (editor: MutableRefObject<CodeMirror.EditorFromTextArea>, listType: string) => void;
14
14
  export declare const titleHandler: (editor: MutableRefObject<CodeMirror.EditorFromTextArea>, titleType: string) => void;
15
- export declare const insertFile: (editor: MutableRefObject<CodeMirror.EditorFromTextArea>, files: any[]) => void;
15
+ type FileToInsert = {
16
+ alt: string;
17
+ url: string;
18
+ mime: string;
19
+ };
20
+ export declare const insertFile: (editor: MutableRefObject<CodeMirror.EditorFromTextArea>, files: FileToInsert[]) => void;
16
21
  export declare const quoteAndCodeHandler: (editor: MutableRefObject<CodeMirror.EditorFromTextArea>, markdownType: string) => void;
22
+ export {};
@@ -1,9 +1,18 @@
1
1
  import type { ListFieldLayout } from '../../../../hooks/useDocumentLayout';
2
2
  import type { Schema, Data } from '@strapi/types';
3
+ import type { To } from 'react-router-dom';
3
4
  interface CellContentProps extends Omit<ListFieldLayout, 'cellFormatter'> {
4
5
  content: Schema.Attribute.Value<Schema.Attribute.AnyAttribute>;
5
6
  rowId: Data.ID;
7
+ /**
8
+ * When set, the cell renders its value as a navigational link to the entry.
9
+ * Used for the primary (first scalar) column so users can open an entry in a
10
+ * new tab via right-click / cmd+click / middle-click, while a plain click
11
+ * still navigates within the SPA. Only passed for non-interactive cell types.
12
+ */
13
+ linkTo?: To;
6
14
  }
7
- declare const CellContent: ({ content, mainField, attribute, rowId, name }: CellContentProps) => import("react/jsx-runtime").JSX.Element;
8
- export { CellContent };
15
+ declare const CellContent: ({ content, mainField, attribute, rowId, name, linkTo }: CellContentProps) => import("react/jsx-runtime").JSX.Element;
16
+ declare const hasContent: (content: CellContentProps["content"], mainField: CellContentProps["mainField"], attribute: CellContentProps["attribute"]) => boolean;
17
+ export { CellContent, hasContent };
9
18
  export type { CellContentProps };
@@ -2,7 +2,7 @@ import type { Schema } from '@strapi/types';
2
2
  interface CellValueProps {
3
3
  isIdColumn?: boolean;
4
4
  type: Schema.Attribute.Kind | 'custom';
5
- value: any;
5
+ value: unknown;
6
6
  }
7
7
  declare const CellValue: ({ isIdColumn, type, value }: CellValueProps) => string;
8
8
  export { CellValue };
@@ -1,3 +1,3 @@
1
- import type { PathRouteProps } from 'react-router-dom';
2
- declare const routes: PathRouteProps[];
1
+ import type { RouteObject } from 'react-router-dom';
2
+ declare const routes: RouteObject[];
3
3
  export { routes };
@@ -1,3 +1,3 @@
1
1
  import { GetPreviewUrl } from '../../../../shared/contracts/preview';
2
- declare const useGetPreviewUrlQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<GetPreviewUrl.Request, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", GetPreviewUrl.Response, "adminApi">>;
2
+ declare const useGetPreviewUrlQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<GetPreviewUrl.Request, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError | import("@reduxjs/toolkit").SerializedError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", GetPreviewUrl.Response, "adminApi">>;
3
3
  export { useGetPreviewUrlQuery };
@@ -1,5 +1,5 @@
1
- import { PathRouteProps } from 'react-router-dom';
1
+ import { RouteObject } from 'react-router-dom';
2
2
  declare const CLONE_PATH = "/content-manager/:collectionType/:slug/clone/:origin";
3
3
  declare const LIST_PATH = "/content-manager/collection-types/:slug";
4
- declare const routes: PathRouteProps[];
4
+ declare const routes: RouteObject[];
5
5
  export { routes, CLONE_PATH, LIST_PATH };
@@ -1,2 +1,2 @@
1
- declare const contentManagerApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, import("@reduxjs/toolkit/dist/query/endpointDefinitions").UpdateDefinitions<{}, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", never>, "adminApi", "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", typeof import("@reduxjs/toolkit/query").coreModuleName | typeof import("@reduxjs/toolkit/dist/query/react").reactHooksModuleName>;
1
+ declare const contentManagerApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError | import("@reduxjs/toolkit").SerializedError, {}, {}>, import("@reduxjs/toolkit/dist/query/endpointDefinitions").UpdateDefinitions<{}, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", never>, "adminApi", "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", typeof import("@reduxjs/toolkit/query").coreModuleName | typeof import("@reduxjs/toolkit/dist/query/react").reactHooksModuleName>;
2
2
  export { contentManagerApi };
@@ -1,5 +1,5 @@
1
- declare const useGetComponentConfigurationQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<string, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", {
1
+ declare const useGetComponentConfigurationQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<string, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError | import("@reduxjs/toolkit").SerializedError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", {
2
2
  component: import("../../../shared/contracts/components").ComponentConfiguration;
3
3
  components: Record<string, import("../../../shared/contracts/components").ComponentConfiguration>;
4
- }, "adminApi">>, useUpdateComponentConfigurationMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query").MutationDefinition<any, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", import("../../../shared/contracts/components").ComponentConfiguration, "adminApi">>;
4
+ }, "adminApi">>, useUpdateComponentConfigurationMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query").MutationDefinition<any, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError | import("@reduxjs/toolkit").SerializedError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", import("../../../shared/contracts/components").ComponentConfiguration, "adminApi">>;
5
5
  export { useGetComponentConfigurationQuery, useUpdateComponentConfigurationMutation };
@@ -1,7 +1,7 @@
1
- declare const useGetContentTypeConfigurationQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<string, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", {
1
+ declare const useGetContentTypeConfigurationQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<string, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError | import("@reduxjs/toolkit").SerializedError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", {
2
2
  contentType: import("../../../shared/contracts/content-types").Configuration;
3
3
  components: Record<string, import("../../../shared/contracts/components").ComponentConfiguration>;
4
- }, "adminApi">>, useGetAllContentTypeSettingsQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<void, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", {
4
+ }, "adminApi">>, useGetAllContentTypeSettingsQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<void, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError | import("@reduxjs/toolkit").SerializedError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", {
5
5
  uid: string;
6
6
  settings: import("../../../shared/contracts/content-types").Settings;
7
7
  }[], "adminApi">>, useUpdateContentTypeConfigurationMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query").MutationDefinition<{
@@ -10,7 +10,7 @@ declare const useGetContentTypeConfigurationQuery: import("@reduxjs/toolkit/dist
10
10
  settings: import("../../../shared/contracts/content-types").Settings;
11
11
  } & {
12
12
  uid: string;
13
- }, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", {
13
+ }, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError | import("@reduxjs/toolkit").SerializedError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability" | "RecentDocumentList" | "CountDocuments" | "UpcomingReleasesList" | "AILocalizationJobs", {
14
14
  contentType: import("../../../shared/contracts/content-types").Configuration;
15
15
  components: Record<string, import("../../../shared/contracts/components").ComponentConfiguration>;
16
16
  }, "adminApi">>;