@clement_lores/adminjs 7.8.17 → 7.8.18
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/lib/frontend/assets/scripts/app-bundle.development.js +38842 -0
- package/package.json +2 -2
- package/types/spec/backend/helpers/helper-stub.d.ts +0 -21
- package/types/spec/backend/helpers/resource-stub.d.ts +0 -15
- package/types/src/adminjs-options.interface.d.ts +0 -453
- package/types/src/adminjs.d.ts +0 -125
- package/types/src/adminjs.spec.d.ts +0 -1
- package/types/src/backend/actions/action.interface.d.ts +0 -619
- package/types/src/backend/actions/bulk-delete/bulk-delete-action.d.ts +0 -11
- package/types/src/backend/actions/bulk-delete/bulk-delete-action.spec.d.ts +0 -1
- package/types/src/backend/actions/delete/delete-action.d.ts +0 -12
- package/types/src/backend/actions/delete/delete-action.spec.d.ts +0 -1
- package/types/src/backend/actions/edit/edit-action.d.ts +0 -14
- package/types/src/backend/actions/index.d.ts +0 -12
- package/types/src/backend/actions/list/list-action.d.ts +0 -33
- package/types/src/backend/actions/new/new-action.d.ts +0 -12
- package/types/src/backend/actions/search/search-action.d.ts +0 -25
- package/types/src/backend/actions/show/show-action.d.ts +0 -12
- package/types/src/backend/adapters/database/base-database.d.ts +0 -28
- package/types/src/backend/adapters/database/index.d.ts +0 -1
- package/types/src/backend/adapters/index.d.ts +0 -4
- package/types/src/backend/adapters/property/base-property.d.ts +0 -112
- package/types/src/backend/adapters/property/index.d.ts +0 -2
- package/types/src/backend/adapters/record/base-record.d.ts +0 -183
- package/types/src/backend/adapters/record/base-record.spec.d.ts +0 -1
- package/types/src/backend/adapters/record/index.d.ts +0 -2
- package/types/src/backend/adapters/record/params.type.d.ts +0 -10
- package/types/src/backend/adapters/resource/base-resource.d.ts +0 -204
- package/types/src/backend/adapters/resource/base-resource.spec.d.ts +0 -1
- package/types/src/backend/adapters/resource/index.d.ts +0 -2
- package/types/src/backend/adapters/resource/supported-databases.type.d.ts +0 -1
- package/types/src/backend/bundler/app.bundler.d.ts +0 -3
- package/types/src/backend/bundler/components.bundler.d.ts +0 -3
- package/types/src/backend/bundler/generate-user-component-entry.d.ts +0 -16
- package/types/src/backend/bundler/globals.bundler.d.ts +0 -3
- package/types/src/backend/bundler/index.d.ts +0 -6
- package/types/src/backend/bundler/utils/asset-bundler.d.ts +0 -32
- package/types/src/backend/bundler/utils/constants.d.ts +0 -4
- package/types/src/backend/controllers/api-controller.d.ts +0 -131
- package/types/src/backend/controllers/app-controller.d.ts +0 -16
- package/types/src/backend/controllers/index.d.ts +0 -2
- package/types/src/backend/decorators/action/action-decorator.d.ts +0 -130
- package/types/src/backend/decorators/action/action-decorator.spec.d.ts +0 -1
- package/types/src/backend/decorators/action/index.d.ts +0 -1
- package/types/src/backend/decorators/index.d.ts +0 -3
- package/types/src/backend/decorators/property/index.d.ts +0 -3
- package/types/src/backend/decorators/property/property-decorator.d.ts +0 -164
- package/types/src/backend/decorators/property/property-decorator.spec.d.ts +0 -1
- package/types/src/backend/decorators/property/property-options.interface.d.ts +0 -137
- package/types/src/backend/decorators/property/utils/index.d.ts +0 -1
- package/types/src/backend/decorators/property/utils/override-from-options.d.ts +0 -4
- package/types/src/backend/decorators/property/utils/override-from-options.spec.d.ts +0 -1
- package/types/src/backend/decorators/resource/index.d.ts +0 -2
- package/types/src/backend/decorators/resource/resource-decorator.d.ts +0 -149
- package/types/src/backend/decorators/resource/resource-decorator.spec.d.ts +0 -1
- package/types/src/backend/decorators/resource/resource-options.interface.d.ts +0 -134
- package/types/src/backend/decorators/resource/utils/decorate-actions.d.ts +0 -16
- package/types/src/backend/decorators/resource/utils/decorate-properties.d.ts +0 -15
- package/types/src/backend/decorators/resource/utils/decorate-properties.spec.d.ts +0 -1
- package/types/src/backend/decorators/resource/utils/find-sub-property.d.ts +0 -12
- package/types/src/backend/decorators/resource/utils/flat-sub-properties.d.ts +0 -14
- package/types/src/backend/decorators/resource/utils/get-navigation.d.ts +0 -10
- package/types/src/backend/decorators/resource/utils/get-navigation.spec.d.ts +0 -1
- package/types/src/backend/decorators/resource/utils/get-property-by-key.d.ts +0 -3
- package/types/src/backend/decorators/resource/utils/index.d.ts +0 -6
- package/types/src/backend/index.d.ts +0 -6
- package/types/src/backend/services/action-error-handler/action-error-handler.d.ts +0 -8
- package/types/src/backend/services/action-error-handler/action-error-handler.spec.d.ts +0 -1
- package/types/src/backend/services/action-error-handler/index.d.ts +0 -1
- package/types/src/backend/services/index.d.ts +0 -2
- package/types/src/backend/services/sort-setter/index.d.ts +0 -1
- package/types/src/backend/services/sort-setter/sort-setter.d.ts +0 -27
- package/types/src/backend/utils/auth/base-auth-provider.d.ts +0 -63
- package/types/src/backend/utils/auth/default-auth-provider.d.ts +0 -12
- package/types/src/backend/utils/auth/index.d.ts +0 -2
- package/types/src/backend/utils/build-feature/build-feature.d.ts +0 -40
- package/types/src/backend/utils/build-feature/build-feature.spec.d.ts +0 -1
- package/types/src/backend/utils/build-feature/index.d.ts +0 -1
- package/types/src/backend/utils/component-loader.d.ts +0 -15
- package/types/src/backend/utils/errors/app-error.d.ts +0 -35
- package/types/src/backend/utils/errors/configuration-error.d.ts +0 -14
- package/types/src/backend/utils/errors/forbidden-error.d.ts +0 -26
- package/types/src/backend/utils/errors/index.d.ts +0 -7
- package/types/src/backend/utils/errors/not-found-error.d.ts +0 -27
- package/types/src/backend/utils/errors/not-implemented-error.d.ts +0 -13
- package/types/src/backend/utils/errors/record-error.d.ts +0 -17
- package/types/src/backend/utils/errors/validation-error.d.ts +0 -34
- package/types/src/backend/utils/filter/filter.d.ts +0 -66
- package/types/src/backend/utils/filter/index.d.ts +0 -1
- package/types/src/backend/utils/index.d.ts +0 -13
- package/types/src/backend/utils/layout-element-parser/index.d.ts +0 -1
- package/types/src/backend/utils/layout-element-parser/layout-element-parser.d.ts +0 -82
- package/types/src/backend/utils/layout-element-parser/layout-element-parser.spec.d.ts +0 -1
- package/types/src/backend/utils/options-parser/index.d.ts +0 -1
- package/types/src/backend/utils/options-parser/options-parser.d.ts +0 -10
- package/types/src/backend/utils/populator/index.d.ts +0 -2
- package/types/src/backend/utils/populator/populate-property.d.ts +0 -13
- package/types/src/backend/utils/populator/populate-property.spec.d.ts +0 -1
- package/types/src/backend/utils/populator/populator.d.ts +0 -10
- package/types/src/backend/utils/populator/populator.spec.d.ts +0 -1
- package/types/src/backend/utils/request-parser/index.d.ts +0 -1
- package/types/src/backend/utils/request-parser/request-parser.d.ts +0 -14
- package/types/src/backend/utils/request-parser/request-parser.spec.d.ts +0 -1
- package/types/src/backend/utils/resources-factory/index.d.ts +0 -1
- package/types/src/backend/utils/resources-factory/resources-factory.d.ts +0 -57
- package/types/src/backend/utils/router/index.d.ts +0 -1
- package/types/src/backend/utils/router/router.d.ts +0 -24
- package/types/src/backend/utils/router/router.spec.d.ts +0 -1
- package/types/src/backend/utils/uploaded-file.type.d.ts +0 -25
- package/types/src/backend/utils/view-helpers/index.d.ts +0 -1
- package/types/src/backend/utils/view-helpers/view-helpers.d.ts +0 -184
- package/types/src/backend/utils/view-helpers/view-helpers.spec.d.ts +0 -1
- package/types/src/constants.d.ts +0 -7
- package/types/src/core-scripts.interface.d.ts +0 -41
- package/types/src/current-admin.interface.d.ts +0 -42
- package/types/src/frontend/components/actions/action.props.d.ts +0 -29
- package/types/src/frontend/components/actions/bulk-delete.d.ts +0 -15
- package/types/src/frontend/components/actions/edit.d.ts +0 -7
- package/types/src/frontend/components/actions/index.d.ts +0 -31
- package/types/src/frontend/components/actions/list.d.ts +0 -7
- package/types/src/frontend/components/actions/new.d.ts +0 -7
- package/types/src/frontend/components/actions/show.d.ts +0 -14
- package/types/src/frontend/components/actions/utils/append-force-refresh.d.ts +0 -13
- package/types/src/frontend/components/actions/utils/append-force-refresh.spec.d.ts +0 -1
- package/types/src/frontend/components/actions/utils/index.d.ts +0 -1
- package/types/src/frontend/components/actions/utils/layout-element-renderer.d.ts +0 -12
- package/types/src/frontend/components/app/action-button/action-button.d.ts +0 -40
- package/types/src/frontend/components/app/action-button/index.d.ts +0 -1
- package/types/src/frontend/components/app/action-header/action-header-props.d.ts +0 -24
- package/types/src/frontend/components/app/action-header/action-header.d.ts +0 -19
- package/types/src/frontend/components/app/action-header/actions-to-button-group.d.ts +0 -12
- package/types/src/frontend/components/app/action-header/actions-to-button-group.spec.d.ts +0 -1
- package/types/src/frontend/components/app/action-header/index.d.ts +0 -2
- package/types/src/frontend/components/app/action-header/styled-back-button.d.ts +0 -9
- package/types/src/frontend/components/app/admin-modal.d.ts +0 -3
- package/types/src/frontend/components/app/app-loader.d.ts +0 -2
- package/types/src/frontend/components/app/auth-background-component.d.ts +0 -6
- package/types/src/frontend/components/app/base-action-component.d.ts +0 -52
- package/types/src/frontend/components/app/breadcrumbs.d.ts +0 -30
- package/types/src/frontend/components/app/default-dashboard.d.ts +0 -4
- package/types/src/frontend/components/app/drawer-portal.d.ts +0 -35
- package/types/src/frontend/components/app/error-boundary.d.ts +0 -10
- package/types/src/frontend/components/app/error-message.d.ts +0 -36
- package/types/src/frontend/components/app/filter-drawer.d.ts +0 -10
- package/types/src/frontend/components/app/footer.d.ts +0 -6
- package/types/src/frontend/components/app/index.d.ts +0 -21
- package/types/src/frontend/components/app/language-select/index.d.ts +0 -1
- package/types/src/frontend/components/app/language-select/language-select.d.ts +0 -3
- package/types/src/frontend/components/app/logged-in.d.ts +0 -13
- package/types/src/frontend/components/app/notice.d.ts +0 -33
- package/types/src/frontend/components/app/records-table/index.d.ts +0 -6
- package/types/src/frontend/components/app/records-table/no-records.d.ts +0 -11
- package/types/src/frontend/components/app/records-table/property-header.d.ts +0 -23
- package/types/src/frontend/components/app/records-table/property-header.spec.d.ts +0 -2
- package/types/src/frontend/components/app/records-table/record-in-list.d.ts +0 -16
- package/types/src/frontend/components/app/records-table/records-table-header.d.ts +0 -81
- package/types/src/frontend/components/app/records-table/records-table-header.spec.d.ts +0 -2
- package/types/src/frontend/components/app/records-table/records-table.d.ts +0 -53
- package/types/src/frontend/components/app/records-table/records-table.spec.d.ts +0 -3
- package/types/src/frontend/components/app/records-table/selected-records.d.ts +0 -11
- package/types/src/frontend/components/app/records-table/utils/display.d.ts +0 -1
- package/types/src/frontend/components/app/records-table/utils/get-bulk-actions-from-records.d.ts +0 -3
- package/types/src/frontend/components/app/records-table/utils/get-bulk-actions-from-records.spec.d.ts +0 -2
- package/types/src/frontend/components/app/sidebar/index.d.ts +0 -3
- package/types/src/frontend/components/app/sidebar/sidebar-branding.d.ts +0 -12
- package/types/src/frontend/components/app/sidebar/sidebar-footer.d.ts +0 -7
- package/types/src/frontend/components/app/sidebar/sidebar-pages.d.ts +0 -11
- package/types/src/frontend/components/app/sidebar/sidebar-resource-section.d.ts +0 -29
- package/types/src/frontend/components/app/sidebar/sidebar.d.ts +0 -11
- package/types/src/frontend/components/app/sort-link.d.ts +0 -9
- package/types/src/frontend/components/app/top-bar.d.ts +0 -9
- package/types/src/frontend/components/app/utils/discord-logo-svg.d.ts +0 -4
- package/types/src/frontend/components/app/utils/rocket-svg.d.ts +0 -4
- package/types/src/frontend/components/app/version.d.ts +0 -10
- package/types/src/frontend/components/application.d.ts +0 -6
- package/types/src/frontend/components/index.d.ts +0 -6
- package/types/src/frontend/components/login/index.d.ts +0 -10
- package/types/src/frontend/components/property-type/array/add-new-item-translation.d.ts +0 -9
- package/types/src/frontend/components/property-type/array/convert-to-sub-property.d.ts +0 -14
- package/types/src/frontend/components/property-type/array/edit.d.ts +0 -6
- package/types/src/frontend/components/property-type/array/edit.spec.d.ts +0 -4
- package/types/src/frontend/components/property-type/array/index.d.ts +0 -4
- package/types/src/frontend/components/property-type/array/list.d.ts +0 -6
- package/types/src/frontend/components/property-type/array/remove-sub-property.d.ts +0 -15
- package/types/src/frontend/components/property-type/array/remove-sub-property.spec.d.ts +0 -1
- package/types/src/frontend/components/property-type/array/show.d.ts +0 -11
- package/types/src/frontend/components/property-type/base-property-component.d.ts +0 -12
- package/types/src/frontend/components/property-type/base-property-props.d.ts +0 -160
- package/types/src/frontend/components/property-type/boolean/boolean-property-value.d.ts +0 -6
- package/types/src/frontend/components/property-type/boolean/edit.d.ts +0 -9
- package/types/src/frontend/components/property-type/boolean/filter.d.ts +0 -10
- package/types/src/frontend/components/property-type/boolean/index.d.ts +0 -5
- package/types/src/frontend/components/property-type/boolean/list.d.ts +0 -6
- package/types/src/frontend/components/property-type/boolean/map-value.d.ts +0 -2
- package/types/src/frontend/components/property-type/boolean/show.d.ts +0 -6
- package/types/src/frontend/components/property-type/clean-property-component.d.ts +0 -12
- package/types/src/frontend/components/property-type/currency/currency-input-wrapper.d.ts +0 -12
- package/types/src/frontend/components/property-type/currency/edit.d.ts +0 -9
- package/types/src/frontend/components/property-type/currency/filter.d.ts +0 -9
- package/types/src/frontend/components/property-type/currency/format-value.d.ts +0 -2
- package/types/src/frontend/components/property-type/currency/index.d.ts +0 -5
- package/types/src/frontend/components/property-type/currency/list.d.ts +0 -6
- package/types/src/frontend/components/property-type/currency/show.d.ts +0 -9
- package/types/src/frontend/components/property-type/datetime/edit.d.ts +0 -9
- package/types/src/frontend/components/property-type/datetime/filter.d.ts +0 -10
- package/types/src/frontend/components/property-type/datetime/index.d.ts +0 -5
- package/types/src/frontend/components/property-type/datetime/list.d.ts +0 -6
- package/types/src/frontend/components/property-type/datetime/map-value.d.ts +0 -3
- package/types/src/frontend/components/property-type/datetime/show.d.ts +0 -6
- package/types/src/frontend/components/property-type/datetime/strip-time-from-iso.d.ts +0 -1
- package/types/src/frontend/components/property-type/default-type/default-property-value.d.ts +0 -6
- package/types/src/frontend/components/property-type/default-type/edit.d.ts +0 -9
- package/types/src/frontend/components/property-type/default-type/filter.d.ts +0 -10
- package/types/src/frontend/components/property-type/default-type/index.d.ts +0 -5
- package/types/src/frontend/components/property-type/default-type/list.d.ts +0 -6
- package/types/src/frontend/components/property-type/default-type/show.d.ts +0 -6
- package/types/src/frontend/components/property-type/default-type/show.spec.d.ts +0 -3
- package/types/src/frontend/components/property-type/index.d.ts +0 -16
- package/types/src/frontend/components/property-type/key-value/edit.d.ts +0 -15
- package/types/src/frontend/components/property-type/key-value/index.d.ts +0 -3
- package/types/src/frontend/components/property-type/key-value/show.d.ts +0 -8
- package/types/src/frontend/components/property-type/mixed/convert-to-sub-property.d.ts +0 -2
- package/types/src/frontend/components/property-type/mixed/edit.d.ts +0 -14
- package/types/src/frontend/components/property-type/mixed/index.d.ts +0 -4
- package/types/src/frontend/components/property-type/mixed/list.d.ts +0 -16
- package/types/src/frontend/components/property-type/mixed/show.d.ts +0 -9
- package/types/src/frontend/components/property-type/password/edit.d.ts +0 -9
- package/types/src/frontend/components/property-type/password/index.d.ts +0 -2
- package/types/src/frontend/components/property-type/phone/edit.d.ts +0 -9
- package/types/src/frontend/components/property-type/phone/filter.d.ts +0 -10
- package/types/src/frontend/components/property-type/phone/index.d.ts +0 -5
- package/types/src/frontend/components/property-type/phone/list.d.ts +0 -6
- package/types/src/frontend/components/property-type/phone/show.d.ts +0 -6
- package/types/src/frontend/components/property-type/record-property-is-equal.d.ts +0 -8
- package/types/src/frontend/components/property-type/reference/edit.d.ts +0 -10
- package/types/src/frontend/components/property-type/reference/filter.d.ts +0 -10
- package/types/src/frontend/components/property-type/reference/index.d.ts +0 -5
- package/types/src/frontend/components/property-type/reference/list.d.ts +0 -6
- package/types/src/frontend/components/property-type/reference/reference-value.d.ts +0 -7
- package/types/src/frontend/components/property-type/reference/show.d.ts +0 -6
- package/types/src/frontend/components/property-type/richtext/edit.d.ts +0 -9
- package/types/src/frontend/components/property-type/richtext/index.d.ts +0 -4
- package/types/src/frontend/components/property-type/richtext/list.d.ts +0 -6
- package/types/src/frontend/components/property-type/richtext/show.d.ts +0 -9
- package/types/src/frontend/components/property-type/textarea/edit.d.ts +0 -9
- package/types/src/frontend/components/property-type/textarea/index.d.ts +0 -3
- package/types/src/frontend/components/property-type/textarea/show.d.ts +0 -6
- package/types/src/frontend/components/property-type/utils/index.d.ts +0 -2
- package/types/src/frontend/components/property-type/utils/property-description/index.d.ts +0 -1
- package/types/src/frontend/components/property-type/utils/property-description/property-description.d.ts +0 -9
- package/types/src/frontend/components/property-type/utils/property-label/index.d.ts +0 -1
- package/types/src/frontend/components/property-type/utils/property-label/property-label.d.ts +0 -12
- package/types/src/frontend/components/routes/bulk-action.d.ts +0 -5
- package/types/src/frontend/components/routes/dashboard.d.ts +0 -28
- package/types/src/frontend/components/routes/index.d.ts +0 -6
- package/types/src/frontend/components/routes/page.d.ts +0 -5
- package/types/src/frontend/components/routes/record-action.d.ts +0 -5
- package/types/src/frontend/components/routes/record-action.spec.d.ts +0 -1
- package/types/src/frontend/components/routes/resource-action.d.ts +0 -11
- package/types/src/frontend/components/routes/resource.d.ts +0 -11
- package/types/src/frontend/components/routes/utils/should-action-re-fetch-data.d.ts +0 -13
- package/types/src/frontend/components/routes/utils/wrapper.d.ts +0 -3
- package/types/src/frontend/components/spec/action-json.factory.d.ts +0 -1
- package/types/src/frontend/components/spec/factory.d.ts +0 -7
- package/types/src/frontend/components/spec/initialize-translations.d.ts +0 -1
- package/types/src/frontend/components/spec/page-json.factory.d.ts +0 -1
- package/types/src/frontend/components/spec/property-json.factory.d.ts +0 -1
- package/types/src/frontend/components/spec/record-json.factory.d.ts +0 -1
- package/types/src/frontend/components/spec/resource-json.factory.d.ts +0 -1
- package/types/src/frontend/components/spec/test-context-provider.d.ts +0 -7
- package/types/src/frontend/hoc/allow-override.d.ts +0 -17
- package/types/src/frontend/hoc/index.d.ts +0 -3
- package/types/src/frontend/hoc/with-no-ssr.d.ts +0 -10
- package/types/src/frontend/hoc/with-notice.d.ts +0 -38
- package/types/src/frontend/hooks/index.d.ts +0 -14
- package/types/src/frontend/hooks/use-action/index.d.ts +0 -3
- package/types/src/frontend/hooks/use-action/use-action-response-handler.d.ts +0 -3
- package/types/src/frontend/hooks/use-action/use-action.d.ts +0 -15
- package/types/src/frontend/hooks/use-action/use-action.types.d.ts +0 -30
- package/types/src/frontend/hooks/use-current-admin.d.ts +0 -39
- package/types/src/frontend/hooks/use-filter-drawer.d.ts +0 -7
- package/types/src/frontend/hooks/use-history-listen.d.ts +0 -2
- package/types/src/frontend/hooks/use-local-storage/index.d.ts +0 -2
- package/types/src/frontend/hooks/use-local-storage/use-local-storage-result.type.d.ts +0 -16
- package/types/src/frontend/hooks/use-local-storage/use-local-storage.d.ts +0 -15
- package/types/src/frontend/hooks/use-modal.d.ts +0 -2
- package/types/src/frontend/hooks/use-navigation-resources.d.ts +0 -4
- package/types/src/frontend/hooks/use-notice.d.ts +0 -29
- package/types/src/frontend/hooks/use-query-params.d.ts +0 -35
- package/types/src/frontend/hooks/use-record/filter-record.d.ts +0 -4
- package/types/src/frontend/hooks/use-record/filter-record.spec.d.ts +0 -1
- package/types/src/frontend/hooks/use-record/index.d.ts +0 -6
- package/types/src/frontend/hooks/use-record/is-entire-record-given.d.ts +0 -3
- package/types/src/frontend/hooks/use-record/merge-record-response.d.ts +0 -14
- package/types/src/frontend/hooks/use-record/params-to-form-data.d.ts +0 -17
- package/types/src/frontend/hooks/use-record/params-to-form-data.spec.d.ts +0 -1
- package/types/src/frontend/hooks/use-record/update-record.d.ts +0 -29
- package/types/src/frontend/hooks/use-record/update-record.spec.d.ts +0 -1
- package/types/src/frontend/hooks/use-record/use-record.d.ts +0 -15
- package/types/src/frontend/hooks/use-record/use-record.type.d.ts +0 -92
- package/types/src/frontend/hooks/use-records/index.d.ts +0 -2
- package/types/src/frontend/hooks/use-records/use-records-result.type.d.ts +0 -29
- package/types/src/frontend/hooks/use-records/use-records.d.ts +0 -14
- package/types/src/frontend/hooks/use-resource/index.d.ts +0 -1
- package/types/src/frontend/hooks/use-resource/use-resource.d.ts +0 -11
- package/types/src/frontend/hooks/use-selected-records/index.d.ts +0 -2
- package/types/src/frontend/hooks/use-selected-records/use-selected-records-result.type.d.ts +0 -17
- package/types/src/frontend/hooks/use-selected-records/use-selected-records.d.ts +0 -14
- package/types/src/frontend/hooks/use-translation.d.ts +0 -51
- package/types/src/frontend/index.d.ts +0 -6
- package/types/src/frontend/interfaces/action/action-has-component.d.ts +0 -3
- package/types/src/frontend/interfaces/action/action-href.d.ts +0 -3
- package/types/src/frontend/interfaces/action/action-json.interface.d.ts +0 -84
- package/types/src/frontend/interfaces/action/build-action-api-call-trigger.d.ts +0 -12
- package/types/src/frontend/interfaces/action/build-action-click-handler.d.ts +0 -16
- package/types/src/frontend/interfaces/action/build-action-test-id.d.ts +0 -2
- package/types/src/frontend/interfaces/action/call-action-api.d.ts +0 -5
- package/types/src/frontend/interfaces/action/index.d.ts +0 -10
- package/types/src/frontend/interfaces/action/is-bulk-action.d.ts +0 -4
- package/types/src/frontend/interfaces/action/is-record-action.d.ts +0 -4
- package/types/src/frontend/interfaces/action/is-resource-action.d.ts +0 -3
- package/types/src/frontend/interfaces/index.d.ts +0 -7
- package/types/src/frontend/interfaces/modal.interface.d.ts +0 -19
- package/types/src/frontend/interfaces/noticeMessage.interface.d.ts +0 -14
- package/types/src/frontend/interfaces/page-json.interface.d.ts +0 -19
- package/types/src/frontend/interfaces/property-json/index.d.ts +0 -1
- package/types/src/frontend/interfaces/property-json/property-json.interface.d.ts +0 -157
- package/types/src/frontend/interfaces/record-json.interface.d.ts +0 -51
- package/types/src/frontend/interfaces/resource-json.interface.d.ts +0 -71
- package/types/src/frontend/layout-template.d.ts +0 -14
- package/types/src/frontend/layout-template.spec.d.ts +0 -1
- package/types/src/frontend/login-template.d.ts +0 -8
- package/types/src/frontend/login-template.spec.d.ts +0 -1
- package/types/src/frontend/store/actions/add-notice.d.ts +0 -8
- package/types/src/frontend/store/actions/drop-notice.d.ts +0 -8
- package/types/src/frontend/store/actions/filter-drawer.d.ts +0 -11
- package/types/src/frontend/store/actions/index.d.ts +0 -16
- package/types/src/frontend/store/actions/initialize-assets.d.ts +0 -7
- package/types/src/frontend/store/actions/initialize-branding.d.ts +0 -7
- package/types/src/frontend/store/actions/initialize-dashboard.d.ts +0 -7
- package/types/src/frontend/store/actions/initialize-locale.d.ts +0 -7
- package/types/src/frontend/store/actions/initialize-pages.d.ts +0 -7
- package/types/src/frontend/store/actions/initialize-paths.d.ts +0 -7
- package/types/src/frontend/store/actions/initialize-resources.d.ts +0 -7
- package/types/src/frontend/store/actions/initialize-theme.d.ts +0 -7
- package/types/src/frontend/store/actions/initialize-versions.d.ts +0 -7
- package/types/src/frontend/store/actions/modal.d.ts +0 -5
- package/types/src/frontend/store/actions/route-changed.d.ts +0 -9
- package/types/src/frontend/store/actions/set-current-admin.d.ts +0 -7
- package/types/src/frontend/store/actions/set-drawer-preroute.d.ts +0 -11
- package/types/src/frontend/store/actions/set-notice-progress.d.ts +0 -10
- package/types/src/frontend/store/index.d.ts +0 -5
- package/types/src/frontend/store/initialize-store.d.ts +0 -6
- package/types/src/frontend/store/reducers/assetsReducer.d.ts +0 -5
- package/types/src/frontend/store/reducers/brandingReducer.d.ts +0 -5
- package/types/src/frontend/store/reducers/dashboardReducer.d.ts +0 -7
- package/types/src/frontend/store/reducers/drawerReducer.d.ts +0 -10
- package/types/src/frontend/store/reducers/filterDrawerReducer.d.ts +0 -7
- package/types/src/frontend/store/reducers/index.d.ts +0 -15
- package/types/src/frontend/store/reducers/localesReducer.d.ts +0 -6
- package/types/src/frontend/store/reducers/modalReducer.d.ts +0 -10
- package/types/src/frontend/store/reducers/noticesReducer.d.ts +0 -12
- package/types/src/frontend/store/reducers/pagesReducer.d.ts +0 -6
- package/types/src/frontend/store/reducers/pathsReducer.d.ts +0 -10
- package/types/src/frontend/store/reducers/resourcesReducer.d.ts +0 -6
- package/types/src/frontend/store/reducers/routerReducer.d.ts +0 -22
- package/types/src/frontend/store/reducers/sessionReducer.d.ts +0 -6
- package/types/src/frontend/store/reducers/themeReducer.d.ts +0 -8
- package/types/src/frontend/store/reducers/versionsReducer.d.ts +0 -5
- package/types/src/frontend/store/store.d.ts +0 -21
- package/types/src/frontend/store/utils/pages-to-store.d.ts +0 -3
- package/types/src/frontend/utils/adminjs.i18n.d.ts +0 -11
- package/types/src/frontend/utils/api-client.d.ts +0 -130
- package/types/src/frontend/utils/data-css-name.d.ts +0 -3
- package/types/src/frontend/utils/index.d.ts +0 -3
- package/types/src/frontend/utils/overridable-component.d.ts +0 -11
- package/types/src/index.d.ts +0 -9
- package/types/src/locale/config.d.ts +0 -87
- package/types/src/locale/default-config.d.ts +0 -5
- package/types/src/locale/index.d.ts +0 -4
- package/types/src/utils/error-type.enum.d.ts +0 -10
- package/types/src/utils/file-resolver.d.ts +0 -6
- package/types/src/utils/flat/constants.d.ts +0 -2
- package/types/src/utils/flat/filter-out-params.d.ts +0 -10
- package/types/src/utils/flat/filter-out-params.spec.d.ts +0 -1
- package/types/src/utils/flat/flat-module.d.ts +0 -28
- package/types/src/utils/flat/flat.types.d.ts +0 -36
- package/types/src/utils/flat/get.d.ts +0 -13
- package/types/src/utils/flat/get.spec.d.ts +0 -1
- package/types/src/utils/flat/index.d.ts +0 -2
- package/types/src/utils/flat/merge.d.ts +0 -11
- package/types/src/utils/flat/merge.spec.d.ts +0 -1
- package/types/src/utils/flat/path-parts.type.d.ts +0 -1
- package/types/src/utils/flat/path-to-parts.d.ts +0 -22
- package/types/src/utils/flat/property-key-regex.d.ts +0 -2
- package/types/src/utils/flat/remove-path.d.ts +0 -10
- package/types/src/utils/flat/remove-path.spec.d.ts +0 -1
- package/types/src/utils/flat/select-params.d.ts +0 -11
- package/types/src/utils/flat/select-params.spec.d.ts +0 -1
- package/types/src/utils/flat/set.d.ts +0 -11
- package/types/src/utils/flat/set.spec.d.ts +0 -1
- package/types/src/utils/index.d.ts +0 -4
- package/types/src/utils/param-converter/constants.d.ts +0 -2
- package/types/src/utils/param-converter/convert-nested-param.d.ts +0 -3
- package/types/src/utils/param-converter/convert-nested-param.spec.d.ts +0 -1
- package/types/src/utils/param-converter/convert-param.d.ts +0 -2
- package/types/src/utils/param-converter/convert-param.spec.d.ts +0 -1
- package/types/src/utils/param-converter/index.d.ts +0 -1
- package/types/src/utils/param-converter/param-converter-module.d.ts +0 -11
- package/types/src/utils/param-converter/prepare-params.d.ts +0 -3
- package/types/src/utils/param-converter/validate-param.d.ts +0 -8
- package/types/src/utils/slash/index.d.ts +0 -1
- package/types/src/utils/theme-bundler.d.ts +0 -2
- package/types/src/utils/translate-functions.factory.d.ts +0 -142
- package/types/vendor-types/global.d.ts +0 -15
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Action, ActionResponse } from '../action.interface.js';
|
|
2
|
-
import { RecordJSON } from '../../../frontend/interfaces/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* @implements Action
|
|
5
|
-
* @category Actions
|
|
6
|
-
* @module ListAction
|
|
7
|
-
* @description
|
|
8
|
-
* Returns selected Records in a list form
|
|
9
|
-
* @private
|
|
10
|
-
*/
|
|
11
|
-
export declare const ListAction: Action<ListActionResponse>;
|
|
12
|
-
export default ListAction;
|
|
13
|
-
/**
|
|
14
|
-
* Response returned by List action
|
|
15
|
-
* @memberof module:ListAction
|
|
16
|
-
* @alias ListAction
|
|
17
|
-
*/
|
|
18
|
-
export type ListActionResponse = ActionResponse & {
|
|
19
|
-
/**
|
|
20
|
-
* Paginated collection of records
|
|
21
|
-
*/
|
|
22
|
-
records: Array<RecordJSON>;
|
|
23
|
-
/**
|
|
24
|
-
* Pagination metadata
|
|
25
|
-
*/
|
|
26
|
-
meta: {
|
|
27
|
-
page: number;
|
|
28
|
-
perPage: number;
|
|
29
|
-
direction: 'asc' | 'desc';
|
|
30
|
-
sortBy: string;
|
|
31
|
-
total: number;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Action, RecordActionResponse } from '../action.interface.js';
|
|
2
|
-
/**
|
|
3
|
-
* @implements Action
|
|
4
|
-
* @category Actions
|
|
5
|
-
* @module NewAction
|
|
6
|
-
* @description
|
|
7
|
-
* Shows form for creating a new record
|
|
8
|
-
* Uses {@link NewAction} component to render form
|
|
9
|
-
* @private
|
|
10
|
-
*/
|
|
11
|
-
export declare const NewAction: Action<RecordActionResponse>;
|
|
12
|
-
export default NewAction;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Action, ActionResponse } from '../action.interface.js';
|
|
2
|
-
import { RecordJSON } from '../../../frontend/interfaces/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* @implements Action
|
|
5
|
-
* @category Actions
|
|
6
|
-
* @module SearchAction
|
|
7
|
-
* @description
|
|
8
|
-
* Used to search particular record based on "title" property. It is used by
|
|
9
|
-
* select fields with autocomplete.
|
|
10
|
-
* Uses {@link ShowAction} component to render form
|
|
11
|
-
* @private
|
|
12
|
-
*/
|
|
13
|
-
export declare const SearchAction: Action<SearchActionResponse>;
|
|
14
|
-
export default SearchAction;
|
|
15
|
-
/**
|
|
16
|
-
* Response of a [Search]{@link ApiController#search} action in the API
|
|
17
|
-
* @memberof module:SearchAction
|
|
18
|
-
* @alias SearchResponse
|
|
19
|
-
*/
|
|
20
|
-
export type SearchActionResponse = ActionResponse & {
|
|
21
|
-
/**
|
|
22
|
-
* List of records
|
|
23
|
-
*/
|
|
24
|
-
records: Array<RecordJSON>;
|
|
25
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Action, RecordActionResponse } from '../action.interface.js';
|
|
2
|
-
/**
|
|
3
|
-
* @implements Action
|
|
4
|
-
* @category Actions
|
|
5
|
-
* @module ShowAction
|
|
6
|
-
* @description
|
|
7
|
-
* Returns selected Record
|
|
8
|
-
* Uses {@link ShowAction} component to render form
|
|
9
|
-
* @private
|
|
10
|
-
*/
|
|
11
|
-
export declare const ShowAction: Action<RecordActionResponse>;
|
|
12
|
-
export default ShowAction;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import BaseResource from '../resource/base-resource.js';
|
|
2
|
-
/**
|
|
3
|
-
* Representation of an ORM database in AdminJS
|
|
4
|
-
* @category Base
|
|
5
|
-
*
|
|
6
|
-
* @mermaid
|
|
7
|
-
* graph LR
|
|
8
|
-
* A[BaseDatabase] -->|has many| B(BaseResource)
|
|
9
|
-
* B --> |has many|C(BaseRecord)
|
|
10
|
-
* B --> |has many|D(BaseProperty)
|
|
11
|
-
*/
|
|
12
|
-
declare class BaseDatabase {
|
|
13
|
-
constructor(database: any);
|
|
14
|
-
/**
|
|
15
|
-
* Checks if given adapter supports database provided by user
|
|
16
|
-
*
|
|
17
|
-
* @param {any} database database provided in AdminJSOptions#databases array
|
|
18
|
-
* @return {Boolean} if given adapter supports this database - returns true
|
|
19
|
-
*/
|
|
20
|
-
static isAdapterFor(database: any): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* returns array of all resources (collections/tables) in the database
|
|
23
|
-
*
|
|
24
|
-
* @return {BaseResource[]}
|
|
25
|
-
*/
|
|
26
|
-
resources(): Array<BaseResource>;
|
|
27
|
-
}
|
|
28
|
-
export default BaseDatabase;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as BaseDatabase } from './base-database.js';
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
export type PropertyType = 'string' | 'float' | 'number' | 'boolean' | 'date' | 'datetime' | 'mixed' | 'reference' | 'key-value' | 'richtext' | 'textarea' | 'password' | 'currency' | 'phone' | 'uuid';
|
|
2
|
-
type BasePropertyAttrs = {
|
|
3
|
-
path: string;
|
|
4
|
-
type?: PropertyType;
|
|
5
|
-
isId?: boolean;
|
|
6
|
-
isSortable?: boolean;
|
|
7
|
-
position?: number;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Represents Resource Property
|
|
11
|
-
* @category Base
|
|
12
|
-
*/
|
|
13
|
-
declare class BaseProperty {
|
|
14
|
-
private _path;
|
|
15
|
-
private _type;
|
|
16
|
-
private _isId;
|
|
17
|
-
private _isSortable;
|
|
18
|
-
private _position;
|
|
19
|
-
/**
|
|
20
|
-
* @param {object} options
|
|
21
|
-
* @param {string} options.path property path: usually it its key but when
|
|
22
|
-
* property is for an object the path can be
|
|
23
|
-
* divided to parts by dots: i.e.
|
|
24
|
-
* 'address.street'
|
|
25
|
-
* @param {PropertyType} [options.type='string']
|
|
26
|
-
* @param {boolean} [options.isId=false] true when field should be treated as an ID
|
|
27
|
-
* @param {boolean} [options.isSortable=true] if property should be sortable
|
|
28
|
-
*/
|
|
29
|
-
constructor({ path, type, isId, isSortable, position, }: BasePropertyAttrs);
|
|
30
|
-
/**
|
|
31
|
-
* Name of the property
|
|
32
|
-
* @return {string} name of the property
|
|
33
|
-
*/
|
|
34
|
-
name(): string;
|
|
35
|
-
path(): string;
|
|
36
|
-
position(): number;
|
|
37
|
-
/**
|
|
38
|
-
* Return type of a property
|
|
39
|
-
* @return {PropertyType}
|
|
40
|
-
*/
|
|
41
|
-
type(): PropertyType;
|
|
42
|
-
/**
|
|
43
|
-
* Return true if given property should be treated as a Record Title.
|
|
44
|
-
*
|
|
45
|
-
* @return {boolean}
|
|
46
|
-
*/
|
|
47
|
-
isTitle(): boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Indicates if given property should be visible
|
|
50
|
-
*
|
|
51
|
-
* @return {Boolean}
|
|
52
|
-
*/
|
|
53
|
-
isVisible(): boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Indicates if value of given property can be updated
|
|
56
|
-
*
|
|
57
|
-
* @return {boolean}
|
|
58
|
-
*/
|
|
59
|
-
isEditable(): boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Returns true if given property is a uniq key in a table/collection
|
|
62
|
-
*
|
|
63
|
-
* @return {boolean}
|
|
64
|
-
*/
|
|
65
|
-
isId(): boolean;
|
|
66
|
-
/**
|
|
67
|
-
* If property is a reference to a record of different resource
|
|
68
|
-
* it should contain {@link BaseResource.id} of this resource.
|
|
69
|
-
*
|
|
70
|
-
* When property is responsible for the field: 'user_id' in SQL database
|
|
71
|
-
* reference should be the name of the Resource which it refers to: `Users`
|
|
72
|
-
*/
|
|
73
|
-
reference(): string | null;
|
|
74
|
-
/**
|
|
75
|
-
* Returns all available values which field can accept. It is used in case of
|
|
76
|
-
* enums
|
|
77
|
-
*
|
|
78
|
-
* @return {Array<String> | null} array of all available values or null when field
|
|
79
|
-
* is not an enum.
|
|
80
|
-
*/
|
|
81
|
-
availableValues(): Array<string> | null;
|
|
82
|
-
/**
|
|
83
|
-
* Returns true when given property is an array
|
|
84
|
-
*
|
|
85
|
-
* @return {boolean}
|
|
86
|
-
*/
|
|
87
|
-
isArray(): boolean;
|
|
88
|
-
/**
|
|
89
|
-
* Returns true when given property has draggable elements.
|
|
90
|
-
* Only usable for array properties.
|
|
91
|
-
*
|
|
92
|
-
* @return {boolean}
|
|
93
|
-
*/
|
|
94
|
-
isDraggable(): boolean;
|
|
95
|
-
/**
|
|
96
|
-
* In case of `mixed` type returns all nested properties.
|
|
97
|
-
*
|
|
98
|
-
* @return {Array<BaseProperty>} sub properties
|
|
99
|
-
*/
|
|
100
|
-
subProperties(): Array<BaseProperty>;
|
|
101
|
-
/**
|
|
102
|
-
* Indicates if given property can be sorted
|
|
103
|
-
*
|
|
104
|
-
* @return {boolean}
|
|
105
|
-
*/
|
|
106
|
-
isSortable(): boolean;
|
|
107
|
-
/**
|
|
108
|
-
* Indicates if given property is required
|
|
109
|
-
*/
|
|
110
|
-
isRequired(): boolean;
|
|
111
|
-
}
|
|
112
|
-
export default BaseProperty;
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { GetOptions } from '../../../utils/flat/index.js';
|
|
2
|
-
import { ParamsType } from './params.type.js';
|
|
3
|
-
import BaseResource from '../resource/base-resource.js';
|
|
4
|
-
import { PropertyErrors } from '../../utils/errors/validation-error.js';
|
|
5
|
-
import RecordError from '../../utils/errors/record-error.js';
|
|
6
|
-
import { RecordJSON } from '../../../frontend/interfaces/index.js';
|
|
7
|
-
import { CurrentAdmin } from '../../../current-admin.interface.js';
|
|
8
|
-
import { ActionContext } from '../../actions/index.js';
|
|
9
|
-
/**
|
|
10
|
-
* Representation of an particular ORM/ODM Record in given Resource in AdminJS
|
|
11
|
-
*
|
|
12
|
-
* @category Base
|
|
13
|
-
*/
|
|
14
|
-
declare class BaseRecord {
|
|
15
|
-
/**
|
|
16
|
-
* Resource to which record belongs
|
|
17
|
-
*/
|
|
18
|
-
resource: BaseResource;
|
|
19
|
-
/**
|
|
20
|
-
* Actual record data stored as a flatten object. You shouldn't access them directly - always
|
|
21
|
-
* with {@link BaseRecord#get} and {@link BaseRecord#set} property.
|
|
22
|
-
*/
|
|
23
|
-
params: ParamsType;
|
|
24
|
-
/**
|
|
25
|
-
* Object containing any base/overall validation error messages:
|
|
26
|
-
* this.baseError = { message: 'errorMessage' }
|
|
27
|
-
*/
|
|
28
|
-
baseError: RecordError | null;
|
|
29
|
-
/**
|
|
30
|
-
* Object containing all validation errors: this.errors[path] = { message: 'errorMessage' }
|
|
31
|
-
*/
|
|
32
|
-
errors: PropertyErrors;
|
|
33
|
-
/**
|
|
34
|
-
* Object containing all populated relations.
|
|
35
|
-
*/
|
|
36
|
-
populated: {
|
|
37
|
-
[key: string]: BaseRecord;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* @param {ParamsType} params all resource data. I.e. field values
|
|
41
|
-
* @param {BaseResource} resource resource to which given record belongs
|
|
42
|
-
*/
|
|
43
|
-
constructor(params: ParamsType, resource: BaseResource);
|
|
44
|
-
/**
|
|
45
|
-
* Returns value for given field.
|
|
46
|
-
* @param {string} path path (name) for given field: i.e. 'email' or 'authentication.email'
|
|
47
|
-
* if email is nested within the authentication object in the data
|
|
48
|
-
* store
|
|
49
|
-
* @return {any} value for given field
|
|
50
|
-
* @deprecated in favour of {@link BaseRecord#get} and {@link BaseRecord#set} methods
|
|
51
|
-
*/
|
|
52
|
-
param(path: string): any;
|
|
53
|
-
/**
|
|
54
|
-
* Returns unflatten (regular) value for given field. So if you have in the params following
|
|
55
|
-
* structure:
|
|
56
|
-
* ```javascript
|
|
57
|
-
* params = {
|
|
58
|
-
* genre.0: 'male',
|
|
59
|
-
* genre.1: 'female',
|
|
60
|
-
* }
|
|
61
|
-
* ```
|
|
62
|
-
*
|
|
63
|
-
* for `get('genre')` function will return ['male', 'female']
|
|
64
|
-
*
|
|
65
|
-
* @param {string} [propertyPath] path for the property. If not set function returns an entire
|
|
66
|
-
* unflatten object
|
|
67
|
-
* @param {GetOptions} [options]
|
|
68
|
-
* @return {any} unflatten data under given path
|
|
69
|
-
* @new in version 3.3
|
|
70
|
-
*/
|
|
71
|
-
get(propertyPath?: string, options?: GetOptions): any;
|
|
72
|
-
/**
|
|
73
|
-
* Sets given value under the propertyPath. Value is flatten and all previous values under this
|
|
74
|
-
* path are replaced. When value is `undefined` function just clears the old values
|
|
75
|
-
*
|
|
76
|
-
* @param {string} propertyPath
|
|
77
|
-
* @param {any} value
|
|
78
|
-
* @returns an entire, updated, params object
|
|
79
|
-
* @new in version 3.3
|
|
80
|
-
*/
|
|
81
|
-
set(propertyPath: string, value: any): any;
|
|
82
|
-
/**
|
|
83
|
-
* Returns object containing all params keys starting with prefix
|
|
84
|
-
*
|
|
85
|
-
* @param {string} prefix
|
|
86
|
-
*
|
|
87
|
-
* @return {object | undefined}
|
|
88
|
-
* @deprecated in favour of {@link selectParams}
|
|
89
|
-
*/
|
|
90
|
-
namespaceParams(prefix: string): Record<string, any> | void;
|
|
91
|
-
/**
|
|
92
|
-
* Returns object containing all params keys starting with prefix
|
|
93
|
-
*
|
|
94
|
-
* @param {string} prefix
|
|
95
|
-
* @param {GetOptions} [options]
|
|
96
|
-
*
|
|
97
|
-
* @return {object | undefined}
|
|
98
|
-
* @new in version 3.3
|
|
99
|
-
*/
|
|
100
|
-
selectParams(prefix: string, options?: GetOptions): Record<string, any> | void;
|
|
101
|
-
/**
|
|
102
|
-
* Updates given Record in the data store. Practically it invokes
|
|
103
|
-
* {@link BaseResource.update} method.
|
|
104
|
-
*
|
|
105
|
-
* When validation error occurs it stores that to {@link BaseResource.errors}
|
|
106
|
-
*
|
|
107
|
-
* @param {object} params all field with values which has to be updated
|
|
108
|
-
* @param {ActionContext} [context]
|
|
109
|
-
* @return {Promise<BaseRecord>} given record (this)
|
|
110
|
-
*/
|
|
111
|
-
update(params: any, context?: ActionContext): Promise<BaseRecord>;
|
|
112
|
-
/**
|
|
113
|
-
* Saves the record in the database. When record already exists - it updates, otherwise
|
|
114
|
-
* it creates new one.
|
|
115
|
-
*
|
|
116
|
-
* Practically it invokes
|
|
117
|
-
* {@link BaseResource#create} or {@link BaseResource#update} methods.
|
|
118
|
-
*
|
|
119
|
-
* When validation error occurs it stores that to {@link BaseResource#errors}
|
|
120
|
-
* @param {ActionContext} [context]
|
|
121
|
-
* @return {Promise<BaseRecord>} given record (this)
|
|
122
|
-
*/
|
|
123
|
-
save(context?: ActionContext): Promise<BaseRecord>;
|
|
124
|
-
/**
|
|
125
|
-
* Creates the record in the database
|
|
126
|
-
*
|
|
127
|
-
* Practically it invokes
|
|
128
|
-
* {@link BaseResource#create}.
|
|
129
|
-
*
|
|
130
|
-
* When validation error occurs it stores that to {@link BaseResource#errors}
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* @return {Promise<BaseRecord>} given record (this)
|
|
134
|
-
* @param {ActionContext} [context]
|
|
135
|
-
*/
|
|
136
|
-
create(context?: ActionContext): Promise<BaseRecord>;
|
|
137
|
-
/**
|
|
138
|
-
* Returns uniq id of the Record.
|
|
139
|
-
* @return {string | number} id of the Record
|
|
140
|
-
*/
|
|
141
|
-
id(): string;
|
|
142
|
-
/**
|
|
143
|
-
* Returns title of the record. Usually title is an value for fields like: email, topic,
|
|
144
|
-
* title etc.
|
|
145
|
-
*
|
|
146
|
-
* Title will be shown in the breadcrumbs for example.
|
|
147
|
-
*
|
|
148
|
-
* @return {string} title of the record
|
|
149
|
-
*/
|
|
150
|
-
title(): string;
|
|
151
|
-
/**
|
|
152
|
-
* Return state of validation for given record
|
|
153
|
-
* @return {boolean} if record is valid or not.
|
|
154
|
-
*/
|
|
155
|
-
isValid(): boolean;
|
|
156
|
-
/**
|
|
157
|
-
* Returns error message for given property path (name)
|
|
158
|
-
* @param {string} path (name) of property which we want to check if is valid
|
|
159
|
-
* @return {RecordError | null} validation message of null
|
|
160
|
-
*/
|
|
161
|
-
error(path: string): RecordError | null;
|
|
162
|
-
/**
|
|
163
|
-
* Populate record relations
|
|
164
|
-
*
|
|
165
|
-
* @param {string} propertyPath name of the property which should be populated
|
|
166
|
-
* @param {BaseRecord | null} [record] record to which property relates. If record is null
|
|
167
|
-
* or undefined - function clears the previous value
|
|
168
|
-
*/
|
|
169
|
-
populate(propertyPath: string, record?: BaseRecord | null): void;
|
|
170
|
-
/**
|
|
171
|
-
* Returns JSON representation of an record
|
|
172
|
-
* @param {CurrentAdmin} [currentAdmin]
|
|
173
|
-
* @return {RecordJSON}
|
|
174
|
-
*/
|
|
175
|
-
toJSON(currentAdmin?: CurrentAdmin): RecordJSON;
|
|
176
|
-
/**
|
|
177
|
-
* Stores incoming payloadData in record params
|
|
178
|
-
*
|
|
179
|
-
* @param {object} [payloadData]
|
|
180
|
-
*/
|
|
181
|
-
storeParams(payloadData?: object): void;
|
|
182
|
-
}
|
|
183
|
-
export default BaseRecord;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @alias ParamsTypeValue
|
|
3
|
-
* @memberof BaseRecord
|
|
4
|
-
*/
|
|
5
|
-
export type ParamsTypeValue = string | number | boolean | null | undefined | [] | Record<string, unknown> | File;
|
|
6
|
-
/**
|
|
7
|
-
* @alias ParamsType
|
|
8
|
-
* @memberof BaseRecord
|
|
9
|
-
*/
|
|
10
|
-
export type ParamsType = Record<string, any>;
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import { SupportedDatabasesType } from './supported-databases.type.js';
|
|
2
|
-
import { BaseProperty, BaseRecord, ParamsType } from '../index.js';
|
|
3
|
-
import { Filter } from '../../utils/index.js';
|
|
4
|
-
import { ResourceOptions, ResourceDecorator } from '../../decorators/index.js';
|
|
5
|
-
import AdminJS from '../../../adminjs.js';
|
|
6
|
-
import { ActionContext } from '../../actions/index.js';
|
|
7
|
-
/**
|
|
8
|
-
* Representation of a ORM Resource in AdminJS. Visually resource is a list item in the sidebar.
|
|
9
|
-
* Each resource has many records and many properties.
|
|
10
|
-
*
|
|
11
|
-
* Analogy is REST resource.
|
|
12
|
-
*
|
|
13
|
-
* It is an __abstract class__ and all database adapters should implement extend it implement
|
|
14
|
-
* following methods:
|
|
15
|
-
*
|
|
16
|
-
* - (static) {@link BaseResource.isAdapterFor isAdapterFor()}
|
|
17
|
-
* - {@link BaseResource#databaseName databaseName()}
|
|
18
|
-
* - {@link BaseResource#name name()}
|
|
19
|
-
* - {@link BaseResource#id id()}
|
|
20
|
-
* - {@link BaseResource#properties properties()}
|
|
21
|
-
* - {@link BaseResource#property property()}
|
|
22
|
-
* - {@link BaseResource#count count()}
|
|
23
|
-
* - {@link BaseResource#find find()}
|
|
24
|
-
* - {@link BaseResource#findOne findOne()}
|
|
25
|
-
* - {@link BaseResource#findMany findMany()}
|
|
26
|
-
* - {@link BaseResource#create create()}
|
|
27
|
-
* - {@link BaseResource#update update()}
|
|
28
|
-
* - {@link BaseResource#delete delete()}
|
|
29
|
-
* @category Base
|
|
30
|
-
* @abstract
|
|
31
|
-
* @hideconstructor
|
|
32
|
-
*/
|
|
33
|
-
declare class BaseResource {
|
|
34
|
-
_decorated: ResourceDecorator | null;
|
|
35
|
-
/**
|
|
36
|
-
* Checks if given adapter supports resource provided by the user.
|
|
37
|
-
* This function has to be implemented only if you want to create your custom
|
|
38
|
-
* database adapter.
|
|
39
|
-
*
|
|
40
|
-
* For one time Admin Resource creation - it is not needed.
|
|
41
|
-
*
|
|
42
|
-
* @param {any} rawResource resource provided in AdminJSOptions#resources array
|
|
43
|
-
* @return {Boolean} if given adapter supports this resource - returns true
|
|
44
|
-
* @abstract
|
|
45
|
-
*/
|
|
46
|
-
static isAdapterFor(rawResource: any): boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Creates given resource based on the raw resource object
|
|
49
|
-
*
|
|
50
|
-
* @param {Object} [resource]
|
|
51
|
-
*/
|
|
52
|
-
constructor(resource?: any);
|
|
53
|
-
/**
|
|
54
|
-
* The name of the database to which resource belongs. When resource is
|
|
55
|
-
* a mongoose model it should be database name of the mongo database.
|
|
56
|
-
*
|
|
57
|
-
* Visually, by default, all resources are nested in sidebar under their database names.
|
|
58
|
-
* @return {String} database name
|
|
59
|
-
* @abstract
|
|
60
|
-
*/
|
|
61
|
-
databaseName(): string;
|
|
62
|
-
/**
|
|
63
|
-
* Returns type of the database. It is used to compute sidebar icon for
|
|
64
|
-
* given resource. Default: 'database'
|
|
65
|
-
* @return {String}
|
|
66
|
-
*/
|
|
67
|
-
databaseType(): SupportedDatabasesType | string;
|
|
68
|
-
/**
|
|
69
|
-
* Each resource has to have uniq id which will be put to an URL of AdminJS routes.
|
|
70
|
-
* For instance in {@link Router} path for the `new` form is `/resources/{resourceId}/new`
|
|
71
|
-
* @return {String} uniq resource id
|
|
72
|
-
* @abstract
|
|
73
|
-
*/
|
|
74
|
-
id(): string;
|
|
75
|
-
/**
|
|
76
|
-
* returns array of all properties which belongs to resource
|
|
77
|
-
* @return {BaseProperty[]}
|
|
78
|
-
* @abstract
|
|
79
|
-
*/
|
|
80
|
-
properties(): Array<BaseProperty>;
|
|
81
|
-
/**
|
|
82
|
-
* returns property object for given field
|
|
83
|
-
* @param {String} path path/name of the property. Take a look at
|
|
84
|
-
* {@link BaseProperty} to learn more about
|
|
85
|
-
* property paths.
|
|
86
|
-
* @return {BaseProperty | null}
|
|
87
|
-
* @abstract
|
|
88
|
-
*/
|
|
89
|
-
property(path: string): BaseProperty | null;
|
|
90
|
-
/**
|
|
91
|
-
* Returns number of elements for given resource by including filters
|
|
92
|
-
* @param {Filter} filter represents what data should be included
|
|
93
|
-
* @param {ActionContext} [context]
|
|
94
|
-
* @return {Promise<Number>}
|
|
95
|
-
* @abstract
|
|
96
|
-
*/
|
|
97
|
-
count(filter: Filter, context?: ActionContext): Promise<number>;
|
|
98
|
-
/**
|
|
99
|
-
* Returns actual records for given resource
|
|
100
|
-
*
|
|
101
|
-
* @param {Filter} filter what data should be included
|
|
102
|
-
* @param {Object} options
|
|
103
|
-
* @param {Number} [options.limit] how many records should be taken
|
|
104
|
-
* @param {Number} [options.offset] offset
|
|
105
|
-
* @param {Object} [options.sort] sort
|
|
106
|
-
* @param {Number} [options.sort.sortBy] sortable field
|
|
107
|
-
* @param {Number} [options.sort.direction] either asc or desc
|
|
108
|
-
* @param {ActionContext} [context]
|
|
109
|
-
* @return {Promise<BaseRecord[]>} list of records
|
|
110
|
-
* @abstract
|
|
111
|
-
* @example
|
|
112
|
-
* // filters example
|
|
113
|
-
* {
|
|
114
|
-
* name: 'Tom',
|
|
115
|
-
* createdAt: { from: '2019-01-01', to: '2019-01-18' }
|
|
116
|
-
* }
|
|
117
|
-
*/
|
|
118
|
-
find(filter: Filter, options: {
|
|
119
|
-
limit?: number;
|
|
120
|
-
offset?: number;
|
|
121
|
-
sort?: {
|
|
122
|
-
sortBy?: string;
|
|
123
|
-
direction?: 'asc' | 'desc';
|
|
124
|
-
};
|
|
125
|
-
}, context?: ActionContext): Promise<Array<BaseRecord>>;
|
|
126
|
-
/**
|
|
127
|
-
* Finds one Record in the Resource by its id
|
|
128
|
-
*
|
|
129
|
-
* @param {String} id uniq id of the Resource Record
|
|
130
|
-
* @param {ActionContext} [context]
|
|
131
|
-
* @return {Promise<BaseRecord> | null} record
|
|
132
|
-
* @abstract
|
|
133
|
-
*/
|
|
134
|
-
findOne(id: string, context?: ActionContext): Promise<BaseRecord | null>;
|
|
135
|
-
/**
|
|
136
|
-
* Finds many records based on the resource ids
|
|
137
|
-
*
|
|
138
|
-
* @param {Array<string>} ids list of ids to find
|
|
139
|
-
* @param {ActionContext} [context]
|
|
140
|
-
*
|
|
141
|
-
* @return {Promise<Array<BaseRecord>>} records
|
|
142
|
-
*/
|
|
143
|
-
findMany(ids: Array<string | number>, context?: ActionContext): Promise<Array<BaseRecord>>;
|
|
144
|
-
/**
|
|
145
|
-
* Builds new Record of given Resource.
|
|
146
|
-
*
|
|
147
|
-
* Each Record is an representation of the resource item. Before it can be saved,
|
|
148
|
-
* it has to be instantiated.
|
|
149
|
-
*
|
|
150
|
-
* This function has to be implemented if you want to create new records.
|
|
151
|
-
*
|
|
152
|
-
* @param {Record<string, any>} params
|
|
153
|
-
* @return {BaseRecord}
|
|
154
|
-
*/
|
|
155
|
-
build(params: Record<string, any>): BaseRecord;
|
|
156
|
-
/**
|
|
157
|
-
* Creates new record
|
|
158
|
-
*
|
|
159
|
-
* @param {Record<string, any>} params
|
|
160
|
-
* @param {ActionContext} [context]
|
|
161
|
-
* @return {Promise<Object>} created record converted to raw Object which
|
|
162
|
-
* can be used to initiate new {@link BaseRecord} instance
|
|
163
|
-
* @throws {ValidationError} If there are validation errors it should be thrown
|
|
164
|
-
* @abstract
|
|
165
|
-
*/
|
|
166
|
-
create(params: Record<string, any>, context?: ActionContext): Promise<ParamsType>;
|
|
167
|
-
/**
|
|
168
|
-
* Updates the record.
|
|
169
|
-
*
|
|
170
|
-
* @param {String} id uniq id of the Resource Record
|
|
171
|
-
* @param {Record<string, any>} params
|
|
172
|
-
* @param {ActionContext} [context]
|
|
173
|
-
* @return {Promise<Object>} created record converted to raw Object which
|
|
174
|
-
* can be used to initiate new {@link BaseRecord} instance
|
|
175
|
-
* @throws {ValidationError} If there are validation errors it should be thrown
|
|
176
|
-
* @abstract
|
|
177
|
-
*/
|
|
178
|
-
update(id: string, params: Record<string, any>, context?: ActionContext): Promise<ParamsType>;
|
|
179
|
-
/**
|
|
180
|
-
* Delete given record by id
|
|
181
|
-
*
|
|
182
|
-
* @param {String | Number} id id of the Record
|
|
183
|
-
* @param {ActionContext} [context]
|
|
184
|
-
* @throws {ValidationError} If there are validation errors it should be thrown
|
|
185
|
-
* @abstract
|
|
186
|
-
*/
|
|
187
|
-
delete(id: string, context?: ActionContext): Promise<void>;
|
|
188
|
-
/**
|
|
189
|
-
* Assigns given decorator to the Resource. Than it will be available under
|
|
190
|
-
* resource.decorate() method
|
|
191
|
-
*
|
|
192
|
-
* @param {BaseDecorator} Decorator
|
|
193
|
-
* @param {AdminJS} admin current instance of AdminJS
|
|
194
|
-
* @param {ResourceOptions} [options]
|
|
195
|
-
* @private
|
|
196
|
-
*/
|
|
197
|
-
assignDecorator(admin: AdminJS, options?: ResourceOptions): void;
|
|
198
|
-
/**
|
|
199
|
-
* Gets decorator object for given resource
|
|
200
|
-
* @return {BaseDecorator | null}
|
|
201
|
-
*/
|
|
202
|
-
decorate(): ResourceDecorator;
|
|
203
|
-
}
|
|
204
|
-
export default BaseResource;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type SupportedDatabasesType = 'MySQL' | 'MariaDB' | 'Postgres' | 'CockroachDB' | 'SQLite' | 'MicrosoftSQLServer' | 'Oracle' | 'SAPHana' | 'MongoDB' | 'other';
|