@nixxie-cms/core 1.0.0
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/CHANGELOG.md +3158 -0
- package/LICENSE +21 -0
- package/README.md +6 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-id-field-view.cjs.d.ts +2 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-id-field-view.cjs.js +244 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-id-field-view.esm.js +235 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view/package.json +4 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/next-config/package.json +4 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-App.cjs.d.ts +2 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-App.cjs.js +59 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-App.esm.js +55 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/package.json +4 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-CreateItemPage.cjs.d.ts +2 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-CreateItemPage.cjs.js +116 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-CreateItemPage.esm.js +112 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/package.json +4 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-HomePage.cjs.d.ts +2 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-HomePage.cjs.js +336 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-HomePage.esm.js +332 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/package.json +4 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-ItemPage.cjs.d.ts +2 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-ItemPage.cjs.js +463 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-ItemPage.esm.js +455 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/package.json +4 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-ListPage.cjs.d.ts +2 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-ListPage.cjs.js +1195 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-ListPage.esm.js +1187 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/package.json +4 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-NoAccessPage.cjs.d.ts +2 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-NoAccessPage.cjs.js +40 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-admin-ui-pages-NoAccessPage.esm.js +35 -0
- package/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/package.json +4 -0
- package/___internal-do-not-use-will-break-in-patch/artifacts/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-artifacts.cjs.d.ts +2 -0
- package/___internal-do-not-use-will-break-in-patch/artifacts/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-artifacts.cjs.js +51 -0
- package/___internal-do-not-use-will-break-in-patch/artifacts/dist/nixxie-cms-core-___internal-do-not-use-will-break-in-patch-artifacts.esm.js +38 -0
- package/___internal-do-not-use-will-break-in-patch/artifacts/package.json +4 -0
- package/access/dist/nixxie-cms-core-access.cjs.d.ts +2 -0
- package/access/dist/nixxie-cms-core-access.cjs.js +26 -0
- package/access/dist/nixxie-cms-core-access.esm.js +19 -0
- package/access/package.json +4 -0
- package/admin-ui/apollo/dist/nixxie-cms-core-admin-ui-apollo.cjs.d.ts +2 -0
- package/admin-ui/apollo/dist/nixxie-cms-core-admin-ui-apollo.cjs.js +87 -0
- package/admin-ui/apollo/dist/nixxie-cms-core-admin-ui-apollo.esm.js +2 -0
- package/admin-ui/apollo/package.json +4 -0
- package/admin-ui/components/dist/nixxie-cms-core-admin-ui-components.cjs.d.ts +2 -0
- package/admin-ui/components/dist/nixxie-cms-core-admin-ui-components.cjs.js +77 -0
- package/admin-ui/components/dist/nixxie-cms-core-admin-ui-components.esm.js +58 -0
- package/admin-ui/components/package.json +4 -0
- package/admin-ui/context/dist/nixxie-cms-core-admin-ui-context.cjs.d.ts +2 -0
- package/admin-ui/context/dist/nixxie-cms-core-admin-ui-context.cjs.js +35 -0
- package/admin-ui/context/dist/nixxie-cms-core-admin-ui-context.esm.js +23 -0
- package/admin-ui/context/package.json +4 -0
- package/admin-ui/image/dist/nixxie-cms-core-admin-ui-image.cjs.d.ts +3 -0
- package/admin-ui/image/dist/nixxie-cms-core-admin-ui-image.cjs.js +18 -0
- package/admin-ui/image/dist/nixxie-cms-core-admin-ui-image.esm.js +2 -0
- package/admin-ui/image/package.json +4 -0
- package/admin-ui/router/dist/nixxie-cms-core-admin-ui-router.cjs.d.ts +2 -0
- package/admin-ui/router/dist/nixxie-cms-core-admin-ui-router.cjs.js +34 -0
- package/admin-ui/router/dist/nixxie-cms-core-admin-ui-router.esm.js +12 -0
- package/admin-ui/router/package.json +4 -0
- package/admin-ui/utils/dist/nixxie-cms-core-admin-ui-utils.cjs.d.ts +2 -0
- package/admin-ui/utils/dist/nixxie-cms-core-admin-ui-utils.cjs.js +45 -0
- package/admin-ui/utils/dist/nixxie-cms-core-admin-ui-utils.esm.js +22 -0
- package/admin-ui/utils/package.json +4 -0
- package/bin/cli.js +3 -0
- package/context/dist/nixxie-cms-core-context.cjs.d.ts +2 -0
- package/context/dist/nixxie-cms-core-context.cjs.js +31 -0
- package/context/dist/nixxie-cms-core-context.esm.js +23 -0
- package/context/package.json +4 -0
- package/dist/CreateItemDialog-33335548.esm.js +55 -0
- package/dist/CreateItemDialog-56cf59b7.cjs.js +57 -0
- package/dist/Errors-575adfa3.cjs.js +147 -0
- package/dist/Errors-bf24759e.esm.js +143 -0
- package/dist/Field-47f85161.esm.js +278 -0
- package/dist/Field-ed8d7627.cjs.js +287 -0
- package/dist/Fields-956d9a14.esm.js +203 -0
- package/dist/Fields-e2c28056.cjs.js +206 -0
- package/dist/GraphQLErrorNotice-cd74180d.cjs.js +57 -0
- package/dist/GraphQLErrorNotice-d9f0931b.esm.js +55 -0
- package/dist/NullableFieldWrapper-6ea48af3.esm.js +71 -0
- package/dist/NullableFieldWrapper-daa0a080.cjs.js +74 -0
- package/dist/PageContainer-27c27f10.cjs.js +1144 -0
- package/dist/PageContainer-7db73317.esm.js +1129 -0
- package/dist/actionData-64d4c37a.esm.js +28 -0
- package/dist/actionData-7858738d.cjs.js +32 -0
- package/dist/admin-meta-14c60fec.esm.js +210 -0
- package/dist/admin-meta-18d0c276.cjs.js +217 -0
- package/dist/admin-meta-graphql-6f7f5331.esm.js +142 -0
- package/dist/admin-meta-graphql-c8f926e9.cjs.js +144 -0
- package/dist/common-1a350e11.cjs.js +324 -0
- package/dist/common-29fc82e6.esm.js +315 -0
- package/dist/context-3132c3ed.esm.js +419 -0
- package/dist/context-e7a45152.cjs.js +432 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view.d.ts +6 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view.d.ts.map +1 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/index.d.ts +10 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/index.d.ts.map +1 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/index.d.ts +6 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/index.d.ts.map +1 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/index.d.ts +2 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/index.d.ts.map +1 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/index.d.ts +6 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/index.d.ts.map +1 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.d.ts +12 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.d.ts.map +1 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/index.d.ts +7 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/index.d.ts.map +1 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/artifacts.d.ts +6 -0
- package/dist/declarations/src/___internal-do-not-use-will-break-in-patch/artifacts.d.ts.map +1 -0
- package/dist/declarations/src/access.d.ts +12 -0
- package/dist/declarations/src/access.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/apollo.d.ts +8 -0
- package/dist/declarations/src/admin-ui/apollo.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/CellContainer.d.ts +5 -0
- package/dist/declarations/src/admin-ui/components/CellContainer.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/CreateItemDialog.d.ts +5 -0
- package/dist/declarations/src/admin-ui/components/CreateItemDialog.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/Errors.d.ts +28 -0
- package/dist/declarations/src/admin-ui/components/Errors.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/GraphQLErrorNotice.d.ts +6 -0
- package/dist/declarations/src/admin-ui/components/GraphQLErrorNotice.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/InlineCode.d.ts +3 -0
- package/dist/declarations/src/admin-ui/components/InlineCode.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/Logo.d.ts +2 -0
- package/dist/declarations/src/admin-ui/components/Logo.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/Navigation.d.ts +22 -0
- package/dist/declarations/src/admin-ui/components/Navigation.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/NullableFieldWrapper.d.ts +33 -0
- package/dist/declarations/src/admin-ui/components/NullableFieldWrapper.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/PageContainer.d.ts +10 -0
- package/dist/declarations/src/admin-ui/components/PageContainer.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/components/index.d.ts +11 -0
- package/dist/declarations/src/admin-ui/components/index.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/context.d.ts +50 -0
- package/dist/declarations/src/admin-ui/context.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/image.d.ts +3 -0
- package/dist/declarations/src/admin-ui/image.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/router.d.ts +15 -0
- package/dist/declarations/src/admin-ui/router.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/utils/Fields.d.ts +16 -0
- package/dist/declarations/src/admin-ui/utils/Fields.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/utils/filters.d.ts +10 -0
- package/dist/declarations/src/admin-ui/utils/filters.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/utils/index.d.ts +8 -0
- package/dist/declarations/src/admin-ui/utils/index.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/utils/useCreateItem.d.ts +24 -0
- package/dist/declarations/src/admin-ui/utils/useCreateItem.d.ts.map +1 -0
- package/dist/declarations/src/admin-ui/utils/utils.d.ts +8 -0
- package/dist/declarations/src/admin-ui/utils/utils.d.ts.map +1 -0
- package/dist/declarations/src/artifacts.d.ts +14 -0
- package/dist/declarations/src/artifacts.d.ts.map +1 -0
- package/dist/declarations/src/context.d.ts +2 -0
- package/dist/declarations/src/context.d.ts.map +1 -0
- package/dist/declarations/src/fields/filters/enum-filter.d.ts +27 -0
- package/dist/declarations/src/fields/filters/enum-filter.d.ts.map +1 -0
- package/dist/declarations/src/fields/filters/index.d.ts +2 -0
- package/dist/declarations/src/fields/filters/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/filters/internal.d.ts +21 -0
- package/dist/declarations/src/fields/filters/internal.d.ts.map +1 -0
- package/dist/declarations/src/fields/filters/providers/mysql.d.ts +182 -0
- package/dist/declarations/src/fields/filters/providers/mysql.d.ts.map +1 -0
- package/dist/declarations/src/fields/filters/providers/postgresql.d.ts +182 -0
- package/dist/declarations/src/fields/filters/providers/postgresql.d.ts.map +1 -0
- package/dist/declarations/src/fields/filters/providers/sqlite.d.ts +179 -0
- package/dist/declarations/src/fields/filters/providers/sqlite.d.ts.map +1 -0
- package/dist/declarations/src/fields/index.d.ts +35 -0
- package/dist/declarations/src/fields/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/bigInt/index.d.ts +20 -0
- package/dist/declarations/src/fields/types/bigInt/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/bigInt/views/index.d.ts +24 -0
- package/dist/declarations/src/fields/types/bigInt/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/bytes/index.d.ts +70 -0
- package/dist/declarations/src/fields/types/bytes/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/bytes/views/index.d.ts +24 -0
- package/dist/declarations/src/fields/types/bytes/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/calendarDay/index.d.ts +15 -0
- package/dist/declarations/src/fields/types/calendarDay/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/calendarDay/views/index.d.ts +18 -0
- package/dist/declarations/src/fields/types/calendarDay/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/checkbox/index.d.ts +11 -0
- package/dist/declarations/src/fields/types/checkbox/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/checkbox/views/index.d.ts +9 -0
- package/dist/declarations/src/fields/types/checkbox/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/decimal/index.d.ts +20 -0
- package/dist/declarations/src/fields/types/decimal/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/decimal/views/index.d.ts +22 -0
- package/dist/declarations/src/fields/types/decimal/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/file/index.d.ts +34 -0
- package/dist/declarations/src/fields/types/file/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/file/views/Field.d.ts +17 -0
- package/dist/declarations/src/fields/types/file/views/Field.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/file/views/index.d.ts +29 -0
- package/dist/declarations/src/fields/types/file/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/float/index.d.ts +18 -0
- package/dist/declarations/src/fields/types/float/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/float/views/index.d.ts +22 -0
- package/dist/declarations/src/fields/types/float/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/image/index.d.ts +34 -0
- package/dist/declarations/src/fields/types/image/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/image/utils.d.ts +2 -0
- package/dist/declarations/src/fields/types/image/utils.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/image/views/Field.d.ts +4 -0
- package/dist/declarations/src/fields/types/image/views/Field.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/image/views/index.d.ts +49 -0
- package/dist/declarations/src/fields/types/image/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/integer/index.d.ts +20 -0
- package/dist/declarations/src/fields/types/integer/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/integer/views/index.d.ts +23 -0
- package/dist/declarations/src/fields/types/integer/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/json/index.d.ts +25 -0
- package/dist/declarations/src/fields/types/json/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/json/views/index.d.ts +9 -0
- package/dist/declarations/src/fields/types/json/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/multiselect/index.d.ts +50 -0
- package/dist/declarations/src/fields/types/multiselect/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/multiselect/views/index.d.ts +26 -0
- package/dist/declarations/src/fields/types/multiselect/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/password/index.d.ts +49 -0
- package/dist/declarations/src/fields/types/password/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/password/views/index.d.ts +47 -0
- package/dist/declarations/src/fields/types/password/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/relationship/index.d.ts +113 -0
- package/dist/declarations/src/fields/types/relationship/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/relationship/views/ComboboxMany.d.ts +26 -0
- package/dist/declarations/src/fields/types/relationship/views/ComboboxMany.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/relationship/views/ComboboxSingle.d.ts +24 -0
- package/dist/declarations/src/fields/types/relationship/views/ComboboxSingle.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/relationship/views/index.d.ts +27 -0
- package/dist/declarations/src/fields/types/relationship/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/relationship/views/types.d.ts +39 -0
- package/dist/declarations/src/fields/types/relationship/views/types.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/select/index.d.ts +42 -0
- package/dist/declarations/src/fields/types/select/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/select/views/index.d.ts +32 -0
- package/dist/declarations/src/fields/types/select/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/text/index.d.ts +58 -0
- package/dist/declarations/src/fields/types/text/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/text/views/index.d.ts +36 -0
- package/dist/declarations/src/fields/types/text/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/timestamp/index.d.ts +19 -0
- package/dist/declarations/src/fields/types/timestamp/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/timestamp/views/index.d.ts +14 -0
- package/dist/declarations/src/fields/types/timestamp/views/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/timestamp/views/utils.d.ts +14 -0
- package/dist/declarations/src/fields/types/timestamp/views/utils.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/virtual/index.d.ts +40 -0
- package/dist/declarations/src/fields/types/virtual/index.d.ts.map +1 -0
- package/dist/declarations/src/fields/types/virtual/views/index.d.ts +7 -0
- package/dist/declarations/src/fields/types/virtual/views/index.d.ts.map +1 -0
- package/dist/declarations/src/graphql-ts.d.ts +5 -0
- package/dist/declarations/src/graphql-ts.d.ts.map +1 -0
- package/dist/declarations/src/helpers.d.ts +121 -0
- package/dist/declarations/src/helpers.d.ts.map +1 -0
- package/dist/declarations/src/index.d.ts +6 -0
- package/dist/declarations/src/index.d.ts.map +1 -0
- package/dist/declarations/src/lib/admin-meta.d.ts +71 -0
- package/dist/declarations/src/lib/admin-meta.d.ts.map +1 -0
- package/dist/declarations/src/lib/core/access-control.d.ts +39 -0
- package/dist/declarations/src/lib/core/access-control.d.ts.map +1 -0
- package/dist/declarations/src/lib/core/initialise-lists.d.ts +131 -0
- package/dist/declarations/src/lib/core/initialise-lists.d.ts.map +1 -0
- package/dist/declarations/src/lib/core/resolve-relationships.d.ts +30 -0
- package/dist/declarations/src/lib/core/resolve-relationships.d.ts.map +1 -0
- package/dist/declarations/src/lib/core/where-inputs.d.ts +15 -0
- package/dist/declarations/src/lib/core/where-inputs.d.ts.map +1 -0
- package/dist/declarations/src/lib/express.d.ts +10 -0
- package/dist/declarations/src/lib/express.d.ts.map +1 -0
- package/dist/declarations/src/lib/migrations.d.ts +13 -0
- package/dist/declarations/src/lib/migrations.d.ts.map +1 -0
- package/dist/declarations/src/lib/system.d.ts +35 -0
- package/dist/declarations/src/lib/system.d.ts.map +1 -0
- package/dist/declarations/src/schema.d.ts +40 -0
- package/dist/declarations/src/schema.d.ts.map +1 -0
- package/dist/declarations/src/scripts/cli.d.ts +11 -0
- package/dist/declarations/src/scripts/cli.d.ts.map +1 -0
- package/dist/declarations/src/scripts/index.d.ts +2 -0
- package/dist/declarations/src/scripts/index.d.ts.map +1 -0
- package/dist/declarations/src/scripts/utils.d.ts +7 -0
- package/dist/declarations/src/scripts/utils.d.ts.map +1 -0
- package/dist/declarations/src/session.d.ts +86 -0
- package/dist/declarations/src/session.d.ts.map +1 -0
- package/dist/declarations/src/testing.d.ts +2 -0
- package/dist/declarations/src/testing.d.ts.map +1 -0
- package/dist/declarations/src/types/admin-meta.d.ts +190 -0
- package/dist/declarations/src/types/admin-meta.d.ts.map +1 -0
- package/dist/declarations/src/types/config/access-control.d.ts +108 -0
- package/dist/declarations/src/types/config/access-control.d.ts.map +1 -0
- package/dist/declarations/src/types/config/fields.d.ts +67 -0
- package/dist/declarations/src/types/config/fields.d.ts.map +1 -0
- package/dist/declarations/src/types/config/hooks.d.ts +441 -0
- package/dist/declarations/src/types/config/hooks.d.ts.map +1 -0
- package/dist/declarations/src/types/config/index.d.ts +283 -0
- package/dist/declarations/src/types/config/index.d.ts.map +1 -0
- package/dist/declarations/src/types/config/lists.d.ts +430 -0
- package/dist/declarations/src/types/config/lists.d.ts.map +1 -0
- package/dist/declarations/src/types/context.d.ts +458 -0
- package/dist/declarations/src/types/context.d.ts.map +1 -0
- package/dist/declarations/src/types/core.d.ts +9 -0
- package/dist/declarations/src/types/core.d.ts.map +1 -0
- package/dist/declarations/src/types/index.d.ts +9 -0
- package/dist/declarations/src/types/index.d.ts.map +1 -0
- package/dist/declarations/src/types/next-fields.d.ts +308 -0
- package/dist/declarations/src/types/next-fields.d.ts.map +1 -0
- package/dist/declarations/src/types/prisma.d.ts +13 -0
- package/dist/declarations/src/types/prisma.d.ts.map +1 -0
- package/dist/declarations/src/types/schema/g.d.ts +7 -0
- package/dist/declarations/src/types/schema/g.d.ts.map +1 -0
- package/dist/declarations/src/types/schema/gWithContext.d.ts +12 -0
- package/dist/declarations/src/types/schema/gWithContext.d.ts.map +1 -0
- package/dist/declarations/src/types/schema/index.d.ts +4 -0
- package/dist/declarations/src/types/schema/index.d.ts.map +1 -0
- package/dist/declarations/src/types/schema/legacy-alias.d.ts +28 -0
- package/dist/declarations/src/types/schema/scalars.d.ts +22 -0
- package/dist/declarations/src/types/schema/scalars.d.ts.map +1 -0
- package/dist/declarations/src/types/session.d.ts +28 -0
- package/dist/declarations/src/types/session.d.ts.map +1 -0
- package/dist/declarations/src/types/type-info.d.ts +35 -0
- package/dist/declarations/src/types/type-info.d.ts.map +1 -0
- package/dist/declarations/src/types/utils.d.ts +78 -0
- package/dist/declarations/src/types/utils.d.ts.map +1 -0
- package/dist/declarations/types/dist/nixxie-cms-core-types.cjs.d.ts +2 -0
- package/dist/express-6743b918.esm.js +476 -0
- package/dist/express-e9ed9a7d.cjs.js +495 -0
- package/dist/filters-8c8616f9.esm.js +89 -0
- package/dist/filters-b3e5eb50.cjs.js +96 -0
- package/dist/index-24b78415.esm.js +419 -0
- package/dist/index-ac01583b.cjs.js +425 -0
- package/dist/migrations-996e66a0.esm.js +76 -0
- package/dist/migrations-ab2e0fd4.cjs.js +78 -0
- package/dist/next-fields-49c025ef.cjs.js +251 -0
- package/dist/next-fields-9bf04ed8.esm.js +241 -0
- package/dist/nixxie-cms-core.cjs.d.ts +2 -0
- package/dist/nixxie-cms-core.cjs.js +522 -0
- package/dist/nixxie-cms-core.esm.js +504 -0
- package/dist/non-null-graphql-17b83ddc.cjs.js +72 -0
- package/dist/non-null-graphql-5315718c.esm.js +67 -0
- package/dist/pick-5fe45878.cjs.js +71 -0
- package/dist/pick-b7ef3115.esm.js +68 -0
- package/dist/resolve-hooks-17aafd37.esm.js +2026 -0
- package/dist/resolve-hooks-66fe8a8e.cjs.js +2043 -0
- package/dist/system-48c5f6df.cjs.js +4283 -0
- package/dist/system-dfec2f0a.esm.js +4273 -0
- package/dist/useCreateItem-1be4987e.cjs.js +160 -0
- package/dist/useCreateItem-1f94d252.esm.js +157 -0
- package/dist/useFilter-0b5a1ee6.esm.js +118 -0
- package/dist/useFilter-1a4e6900.cjs.js +120 -0
- package/dist/utils-0cc426c8.esm.js +19 -0
- package/dist/utils-1b632a8f.cjs.js +21 -0
- package/dist/utils-230cddb1.cjs.js +150 -0
- package/dist/utils-5e1d4d28.esm.js +138 -0
- package/dist/utils-b031e11c.cjs.js +49 -0
- package/dist/utils-e74e3527.cjs.js +87 -0
- package/dist/utils-ef2cd0f4.esm.js +80 -0
- package/dist/utils-f9556354.esm.js +41 -0
- package/fields/dist/nixxie-cms-core-fields.cjs.d.ts +2 -0
- package/fields/dist/nixxie-cms-core-fields.cjs.js +1808 -0
- package/fields/dist/nixxie-cms-core-fields.esm.js +1785 -0
- package/fields/package.json +4 -0
- package/fields/types/bigInt/views/dist/nixxie-cms-core-fields-types-bigInt-views.cjs.d.ts +2 -0
- package/fields/types/bigInt/views/dist/nixxie-cms-core-fields-types-bigInt-views.cjs.js +258 -0
- package/fields/types/bigInt/views/dist/nixxie-cms-core-fields-types-bigInt-views.esm.js +253 -0
- package/fields/types/bigInt/views/package.json +4 -0
- package/fields/types/bytes/dist/nixxie-cms-core-fields-types-bytes.cjs.d.ts +2 -0
- package/fields/types/bytes/dist/nixxie-cms-core-fields-types-bytes.cjs.js +221 -0
- package/fields/types/bytes/dist/nixxie-cms-core-fields-types-bytes.esm.js +216 -0
- package/fields/types/bytes/package.json +4 -0
- package/fields/types/bytes/views/dist/nixxie-cms-core-fields-types-bytes-views.cjs.d.ts +2 -0
- package/fields/types/bytes/views/dist/nixxie-cms-core-fields-types-bytes-views.cjs.js +239 -0
- package/fields/types/bytes/views/dist/nixxie-cms-core-fields-types-bytes-views.esm.js +234 -0
- package/fields/types/bytes/views/package.json +4 -0
- package/fields/types/calendarDay/views/dist/nixxie-cms-core-fields-types-calendarDay-views.cjs.d.ts +2 -0
- package/fields/types/calendarDay/views/dist/nixxie-cms-core-fields-types-calendarDay-views.cjs.js +147 -0
- package/fields/types/calendarDay/views/dist/nixxie-cms-core-fields-types-calendarDay-views.esm.js +141 -0
- package/fields/types/calendarDay/views/package.json +4 -0
- package/fields/types/checkbox/views/dist/nixxie-cms-core-fields-types-checkbox-views.cjs.d.ts +2 -0
- package/fields/types/checkbox/views/dist/nixxie-cms-core-fields-types-checkbox-views.cjs.js +126 -0
- package/fields/types/checkbox/views/dist/nixxie-cms-core-fields-types-checkbox-views.esm.js +120 -0
- package/fields/types/checkbox/views/package.json +4 -0
- package/fields/types/decimal/views/dist/nixxie-cms-core-fields-types-decimal-views.cjs.d.ts +2 -0
- package/fields/types/decimal/views/dist/nixxie-cms-core-fields-types-decimal-views.cjs.js +248 -0
- package/fields/types/decimal/views/dist/nixxie-cms-core-fields-types-decimal-views.esm.js +239 -0
- package/fields/types/decimal/views/package.json +4 -0
- package/fields/types/file/utils/package.json +4 -0
- package/fields/types/file/views/dist/nixxie-cms-core-fields-types-file-views.cjs.d.ts +2 -0
- package/fields/types/file/views/dist/nixxie-cms-core-fields-types-file-views.cjs.js +86 -0
- package/fields/types/file/views/dist/nixxie-cms-core-fields-types-file-views.esm.js +81 -0
- package/fields/types/file/views/package.json +4 -0
- package/fields/types/float/views/dist/nixxie-cms-core-fields-types-float-views.cjs.d.ts +2 -0
- package/fields/types/float/views/dist/nixxie-cms-core-fields-types-float-views.cjs.js +237 -0
- package/fields/types/float/views/dist/nixxie-cms-core-fields-types-float-views.esm.js +232 -0
- package/fields/types/float/views/package.json +4 -0
- package/fields/types/image/utils/dist/nixxie-cms-core-fields-types-image-utils.cjs.d.ts +2 -0
- package/fields/types/image/utils/dist/nixxie-cms-core-fields-types-image-utils.cjs.js +7 -0
- package/fields/types/image/utils/dist/nixxie-cms-core-fields-types-image-utils.esm.js +3 -0
- package/fields/types/image/utils/package.json +4 -0
- package/fields/types/image/views/dist/nixxie-cms-core-fields-types-image-views.cjs.d.ts +2 -0
- package/fields/types/image/views/dist/nixxie-cms-core-fields-types-image-views.cjs.js +361 -0
- package/fields/types/image/views/dist/nixxie-cms-core-fields-types-image-views.esm.js +354 -0
- package/fields/types/image/views/package.json +4 -0
- package/fields/types/integer/views/dist/nixxie-cms-core-fields-types-integer-views.cjs.d.ts +2 -0
- package/fields/types/integer/views/dist/nixxie-cms-core-fields-types-integer-views.cjs.js +254 -0
- package/fields/types/integer/views/dist/nixxie-cms-core-fields-types-integer-views.esm.js +249 -0
- package/fields/types/integer/views/package.json +4 -0
- package/fields/types/json/views/dist/nixxie-cms-core-fields-types-json-views.cjs.d.ts +2 -0
- package/fields/types/json/views/dist/nixxie-cms-core-fields-types-json-views.cjs.js +83 -0
- package/fields/types/json/views/dist/nixxie-cms-core-fields-types-json-views.esm.js +77 -0
- package/fields/types/json/views/package.json +4 -0
- package/fields/types/multiselect/views/dist/nixxie-cms-core-fields-types-multiselect-views.cjs.d.ts +2 -0
- package/fields/types/multiselect/views/dist/nixxie-cms-core-fields-types-multiselect-views.cjs.js +147 -0
- package/fields/types/multiselect/views/dist/nixxie-cms-core-fields-types-multiselect-views.esm.js +141 -0
- package/fields/types/multiselect/views/package.json +4 -0
- package/fields/types/password/dist/nixxie-cms-core-fields-types-password.cjs.d.ts +2 -0
- package/fields/types/password/dist/nixxie-cms-core-fields-types-password.cjs.js +206 -0
- package/fields/types/password/dist/nixxie-cms-core-fields-types-password.esm.js +196 -0
- package/fields/types/password/package.json +4 -0
- package/fields/types/password/views/dist/nixxie-cms-core-fields-types-password-views.cjs.d.ts +2 -0
- package/fields/types/password/views/dist/nixxie-cms-core-fields-types-password-views.cjs.js +330 -0
- package/fields/types/password/views/dist/nixxie-cms-core-fields-types-password-views.esm.js +320 -0
- package/fields/types/password/views/package.json +4 -0
- package/fields/types/relationship/views/RelationshipSelect/package.json +4 -0
- package/fields/types/relationship/views/dist/nixxie-cms-core-fields-types-relationship-views.cjs.d.ts +2 -0
- package/fields/types/relationship/views/dist/nixxie-cms-core-fields-types-relationship-views.cjs.js +1213 -0
- package/fields/types/relationship/views/dist/nixxie-cms-core-fields-types-relationship-views.esm.js +1201 -0
- package/fields/types/relationship/views/package.json +4 -0
- package/fields/types/select/views/dist/nixxie-cms-core-fields-types-select-views.cjs.d.ts +2 -0
- package/fields/types/select/views/dist/nixxie-cms-core-fields-types-select-views.cjs.js +422 -0
- package/fields/types/select/views/dist/nixxie-cms-core-fields-types-select-views.esm.js +416 -0
- package/fields/types/select/views/package.json +4 -0
- package/fields/types/text/views/dist/nixxie-cms-core-fields-types-text-views.cjs.d.ts +2 -0
- package/fields/types/text/views/dist/nixxie-cms-core-fields-types-text-views.cjs.js +316 -0
- package/fields/types/text/views/dist/nixxie-cms-core-fields-types-text-views.esm.js +311 -0
- package/fields/types/text/views/package.json +4 -0
- package/fields/types/timestamp/views/dist/nixxie-cms-core-fields-types-timestamp-views.cjs.d.ts +2 -0
- package/fields/types/timestamp/views/dist/nixxie-cms-core-fields-types-timestamp-views.cjs.js +285 -0
- package/fields/types/timestamp/views/dist/nixxie-cms-core-fields-types-timestamp-views.esm.js +279 -0
- package/fields/types/timestamp/views/package.json +4 -0
- package/fields/types/virtual/views/dist/nixxie-cms-core-fields-types-virtual-views.cjs.d.ts +2 -0
- package/fields/types/virtual/views/dist/nixxie-cms-core-fields-types-virtual-views.cjs.js +54 -0
- package/fields/types/virtual/views/dist/nixxie-cms-core-fields-types-virtual-views.esm.js +48 -0
- package/fields/types/virtual/views/package.json +4 -0
- package/graphql-ts/dist/nixxie-cms-core-graphql-ts.cjs.d.ts +2 -0
- package/graphql-ts/dist/nixxie-cms-core-graphql-ts.cjs.js +45 -0
- package/graphql-ts/dist/nixxie-cms-core-graphql-ts.esm.js +2 -0
- package/graphql-ts/package.json +4 -0
- package/package.json +339 -0
- package/schema/package.json +4 -0
- package/scripts/cli/dist/nixxie-cms-core-scripts-cli.cjs.d.ts +2 -0
- package/scripts/cli/dist/nixxie-cms-core-scripts-cli.cjs.js +1607 -0
- package/scripts/cli/dist/nixxie-cms-core-scripts-cli.esm.js +1586 -0
- package/scripts/cli/package.json +4 -0
- package/scripts/dist/nixxie-cms-core-scripts.cjs.d.ts +2 -0
- package/scripts/dist/nixxie-cms-core-scripts.cjs.js +73 -0
- package/scripts/dist/nixxie-cms-core-scripts.esm.js +71 -0
- package/scripts/package.json +4 -0
- package/session/dist/nixxie-cms-core-session.cjs.d.ts +2 -0
- package/session/dist/nixxie-cms-core-session.cjs.js +157 -0
- package/session/dist/nixxie-cms-core-session.esm.js +129 -0
- package/session/package.json +4 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/id-field-view.tsx +167 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/App/index.tsx +22 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/CreateItemPage/index.tsx +71 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/HomePage/index.tsx +333 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/common.tsx +358 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ItemPage/index.tsx +483 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/FilterAdd.tsx +221 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/PaginationControls.tsx +170 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/Tag.tsx +72 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/ListPage/index.tsx +1006 -0
- package/src/___internal-do-not-use-will-break-in-patch/admin-ui/pages/NoAccessPage/index.tsx +24 -0
- package/src/___internal-do-not-use-will-break-in-patch/artifacts.ts +5 -0
- package/src/access.ts +25 -0
- package/src/admin-ui/admin-meta-graphql.ts +168 -0
- package/src/admin-ui/apollo.tsx +35 -0
- package/src/admin-ui/components/CellContainer.tsx +6 -0
- package/src/admin-ui/components/CommandPalette.tsx +431 -0
- package/src/admin-ui/components/Container.tsx +14 -0
- package/src/admin-ui/components/CreateButtonLink.tsx +46 -0
- package/src/admin-ui/components/CreateItemDialog.tsx +56 -0
- package/src/admin-ui/components/EmptyState.tsx +52 -0
- package/src/admin-ui/components/Errors.tsx +130 -0
- package/src/admin-ui/components/GraphQLErrorNotice.tsx +78 -0
- package/src/admin-ui/components/InlineCode.tsx +17 -0
- package/src/admin-ui/components/Logo.tsx +70 -0
- package/src/admin-ui/components/Navigation.tsx +385 -0
- package/src/admin-ui/components/NullableFieldWrapper.tsx +72 -0
- package/src/admin-ui/components/PageContainer.tsx +310 -0
- package/src/admin-ui/components/WelcomeDialog.tsx +119 -0
- package/src/admin-ui/components/index.ts +23 -0
- package/src/admin-ui/context.tsx +338 -0
- package/src/admin-ui/image.tsx +2 -0
- package/src/admin-ui/index.tsx +1 -0
- package/src/admin-ui/router.tsx +24 -0
- package/src/admin-ui/system/generateAdminUI.ts +155 -0
- package/src/admin-ui/system/index.ts +1 -0
- package/src/admin-ui/templates/app.ts +60 -0
- package/src/admin-ui/templates/create-item.ts +5 -0
- package/src/admin-ui/templates/home.ts +2 -0
- package/src/admin-ui/templates/index.ts +53 -0
- package/src/admin-ui/templates/item.tsx +5 -0
- package/src/admin-ui/templates/list.tsx +5 -0
- package/src/admin-ui/templates/next-config.ts +16 -0
- package/src/admin-ui/templates/no-access.ts +7 -0
- package/src/admin-ui/utils/Fields.tsx +241 -0
- package/src/admin-ui/utils/actionData.ts +36 -0
- package/src/admin-ui/utils/filters.ts +148 -0
- package/src/admin-ui/utils/index.ts +10 -0
- package/src/admin-ui/utils/pick.ts +12 -0
- package/src/admin-ui/utils/useCreateItem.ts +171 -0
- package/src/admin-ui/utils/usePreventNavigation.tsx +31 -0
- package/src/admin-ui/utils/utils.tsx +127 -0
- package/src/artifacts.ts +110 -0
- package/src/context.ts +1 -0
- package/src/fields/filters/enum-filter.ts +77 -0
- package/src/fields/filters/index.ts +1 -0
- package/src/fields/filters/internal.ts +89 -0
- package/src/fields/filters/providers/mysql.ts +450 -0
- package/src/fields/filters/providers/postgresql.ts +448 -0
- package/src/fields/filters/providers/sqlite.ts +442 -0
- package/src/fields/index.ts +34 -0
- package/src/fields/non-null-graphql.ts +115 -0
- package/src/fields/resolve-hooks.ts +61 -0
- package/src/fields/types/bigInt/index.ts +181 -0
- package/src/fields/types/bigInt/views/index.tsx +254 -0
- package/src/fields/types/bytes/index.ts +275 -0
- package/src/fields/types/bytes/views/index.tsx +190 -0
- package/src/fields/types/calendarDay/index.ts +194 -0
- package/src/fields/types/calendarDay/views/index.tsx +144 -0
- package/src/fields/types/checkbox/index.ts +76 -0
- package/src/fields/types/checkbox/views/index.tsx +97 -0
- package/src/fields/types/decimal/index.ts +182 -0
- package/src/fields/types/decimal/views/index.tsx +215 -0
- package/src/fields/types/file/index.ts +168 -0
- package/src/fields/types/file/views/Field.tsx +300 -0
- package/src/fields/types/file/views/index.tsx +74 -0
- package/src/fields/types/float/index.ts +133 -0
- package/src/fields/types/float/views/index.tsx +215 -0
- package/src/fields/types/image/index.ts +244 -0
- package/src/fields/types/image/internal-utils.ts +58 -0
- package/src/fields/types/image/utils.ts +1 -0
- package/src/fields/types/image/views/Field.tsx +295 -0
- package/src/fields/types/image/views/index.tsx +92 -0
- package/src/fields/types/integer/index.ts +156 -0
- package/src/fields/types/integer/views/index.tsx +255 -0
- package/src/fields/types/json/index.ts +77 -0
- package/src/fields/types/json/views/index.tsx +76 -0
- package/src/fields/types/multiselect/index.ts +212 -0
- package/src/fields/types/multiselect/views/index.tsx +151 -0
- package/src/fields/types/password/index.ts +241 -0
- package/src/fields/types/password/views/index.tsx +342 -0
- package/src/fields/types/relationship/index.ts +381 -0
- package/src/fields/types/relationship/views/ComboboxMany.tsx +110 -0
- package/src/fields/types/relationship/views/ComboboxSingle.tsx +115 -0
- package/src/fields/types/relationship/views/ContextualActions.tsx +139 -0
- package/src/fields/types/relationship/views/RelationshipTable.tsx +190 -0
- package/src/fields/types/relationship/views/index.tsx +492 -0
- package/src/fields/types/relationship/views/types.ts +46 -0
- package/src/fields/types/relationship/views/useApolloQuery.ts +185 -0
- package/src/fields/types/relationship/views/useFilter.tsx +109 -0
- package/src/fields/types/select/index.ts +226 -0
- package/src/fields/types/select/views/SegmentedControl.tsx +83 -0
- package/src/fields/types/select/views/index.tsx +318 -0
- package/src/fields/types/text/index.ts +207 -0
- package/src/fields/types/text/views/index.tsx +273 -0
- package/src/fields/types/timestamp/index.ts +116 -0
- package/src/fields/types/timestamp/views/__tests__/index.tsx +68 -0
- package/src/fields/types/timestamp/views/__tests__/utils.tsx +16 -0
- package/src/fields/types/timestamp/views/index.tsx +262 -0
- package/src/fields/types/timestamp/views/utils.ts +22 -0
- package/src/fields/types/virtual/index.ts +108 -0
- package/src/fields/types/virtual/views/index.tsx +53 -0
- package/src/graphql-ts.ts +32 -0
- package/src/helpers.ts +316 -0
- package/src/index.ts +20 -0
- package/src/lib/admin-meta-graphql.ts +407 -0
- package/src/lib/admin-meta.ts +369 -0
- package/src/lib/coerceAndValidateForGraphQLInput.ts +29 -0
- package/src/lib/context/api.ts +99 -0
- package/src/lib/context/createContext.ts +161 -0
- package/src/lib/context/graphql.ts +300 -0
- package/src/lib/core/access-control.ts +434 -0
- package/src/lib/core/field-assertions.ts +118 -0
- package/src/lib/core/filter-order-access.ts +48 -0
- package/src/lib/core/graphql-errors.ts +76 -0
- package/src/lib/core/hooks.ts +111 -0
- package/src/lib/core/initialise-lists.ts +1097 -0
- package/src/lib/core/mutations/index.ts +917 -0
- package/src/lib/core/mutations/nested-mutation-many-input-resolvers.ts +145 -0
- package/src/lib/core/mutations/nested-mutation-one-input-resolvers.ts +71 -0
- package/src/lib/core/prisma-schema-printer.ts +256 -0
- package/src/lib/core/queries/index.ts +66 -0
- package/src/lib/core/queries/output-field.ts +178 -0
- package/src/lib/core/queries/resolvers.ts +258 -0
- package/src/lib/core/resolve-relationships.ts +303 -0
- package/src/lib/core/utils.ts +56 -0
- package/src/lib/core/where-inputs.ts +130 -0
- package/src/lib/express.ts +109 -0
- package/src/lib/graphql.ts +83 -0
- package/src/lib/id-field.ts +214 -0
- package/src/lib/middleware.ts +68 -0
- package/src/lib/migrations.ts +90 -0
- package/src/lib/otel.ts +43 -0
- package/src/lib/prompts.ts +29 -0
- package/src/lib/system.ts +207 -0
- package/src/lib/telemetry.ts +342 -0
- package/src/lib/typescript-schema-printer.ts +227 -0
- package/src/lib/utils.ts +21 -0
- package/src/pkg-dir.ts +6 -0
- package/src/schema.ts +233 -0
- package/src/scripts/build.ts +64 -0
- package/src/scripts/cli.ts +124 -0
- package/src/scripts/dev.ts +452 -0
- package/src/scripts/esbuild.ts +120 -0
- package/src/scripts/index.ts +20 -0
- package/src/scripts/migrate.ts +214 -0
- package/src/scripts/prisma.ts +49 -0
- package/src/scripts/start.ts +76 -0
- package/src/scripts/telemetry.ts +37 -0
- package/src/scripts/utils.ts +22 -0
- package/src/session.ts +168 -0
- package/src/testing.ts +23 -0
- package/src/types/admin-meta.ts +218 -0
- package/src/types/config/access-control.ts +186 -0
- package/src/types/config/fields.ts +96 -0
- package/src/types/config/hooks.ts +529 -0
- package/src/types/config/index.ts +333 -0
- package/src/types/config/lists.ts +565 -0
- package/src/types/context.ts +530 -0
- package/src/types/core.ts +16 -0
- package/src/types/index.ts +8 -0
- package/src/types/next-fields.ts +499 -0
- package/src/types/prisma.ts +16 -0
- package/src/types/schema/g.ts +5 -0
- package/src/types/schema/gWithContext.ts +20 -0
- package/src/types/schema/index.ts +4 -0
- package/src/types/schema/legacy-alias.d.ts +28 -0
- package/src/types/schema/legacy-alias.js +1 -0
- package/src/types/schema/scalars.ts +220 -0
- package/src/types/session.ts +26 -0
- package/src/types/telemetry.ts +51 -0
- package/src/types/type-info.ts +38 -0
- package/src/types/type-tests.ts +21 -0
- package/src/types/utils.ts +108 -0
- package/static/admin-error.html +53 -0
- package/static/dev-loading.html +146 -0
- package/static/favicon.ico +0 -0
- package/static/favicon.svg +4 -0
- package/system/package.json +4 -0
- package/testing/dist/nixxie-cms-core-testing.cjs.d.ts +2 -0
- package/testing/dist/nixxie-cms-core-testing.cjs.js +29 -0
- package/testing/dist/nixxie-cms-core-testing.esm.js +21 -0
- package/testing/package.json +4 -0
- package/tests/conditional-filters.test.ts +326 -0
- package/tests/telemetry.test.ts +361 -0
- package/tsconfig.json +20 -0
- package/types/dist/nixxie-cms-core-types.cjs.d.ts +2 -0
- package/types/dist/nixxie-cms-core-types.cjs.js +29 -0
- package/types/dist/nixxie-cms-core-types.esm.js +9 -0
- package/types/package.json +4 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import type { SimpleFieldTypeInfo } from '../../../types'
|
|
2
|
+
import {
|
|
3
|
+
type BaseListTypeInfo,
|
|
4
|
+
type CommonFieldConfig,
|
|
5
|
+
type FieldTypeFunc,
|
|
6
|
+
fieldType,
|
|
7
|
+
orderDirectionEnum,
|
|
8
|
+
} from '../../../types'
|
|
9
|
+
import { g } from '../../..'
|
|
10
|
+
import { filters } from '../../filters'
|
|
11
|
+
import { resolveDbNullable, makeValidateHook, defaultIsRequired } from '../../non-null-graphql'
|
|
12
|
+
import type { controller } from './views'
|
|
13
|
+
|
|
14
|
+
export type BigIntFieldConfig<ListTypeInfo extends BaseListTypeInfo> = CommonFieldConfig<
|
|
15
|
+
ListTypeInfo,
|
|
16
|
+
SimpleFieldTypeInfo<'BigInt'>
|
|
17
|
+
> & {
|
|
18
|
+
isIndexed?: boolean | 'unique'
|
|
19
|
+
defaultValue?: bigint | null | { kind: 'autoincrement' }
|
|
20
|
+
validation?: {
|
|
21
|
+
isRequired?: boolean
|
|
22
|
+
min?: bigint
|
|
23
|
+
max?: bigint
|
|
24
|
+
}
|
|
25
|
+
db?: {
|
|
26
|
+
isNullable?: boolean
|
|
27
|
+
map?: string
|
|
28
|
+
extendPrismaSchema?: (field: string) => string
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// for a signed 64-bit integer
|
|
33
|
+
const MAX_INT = 9223372036854775807n
|
|
34
|
+
const MIN_INT = -9223372036854775808n
|
|
35
|
+
|
|
36
|
+
// TODO: https://github.com/Nixxie/keystatic/blob/main/design-system/pkg/src/number-field/NumberField.tsx
|
|
37
|
+
export function bigInt<ListTypeInfo extends BaseListTypeInfo>(
|
|
38
|
+
config: BigIntFieldConfig<ListTypeInfo> = {}
|
|
39
|
+
): FieldTypeFunc<ListTypeInfo> {
|
|
40
|
+
const { defaultValue: defaultValue_ = null, isIndexed, validation = {} } = config
|
|
41
|
+
|
|
42
|
+
const { isRequired = false, min, max } = validation
|
|
43
|
+
const defaultValue =
|
|
44
|
+
typeof defaultValue_ === 'bigint' ? defaultValue_ : (defaultValue_?.kind ?? null)
|
|
45
|
+
|
|
46
|
+
return meta => {
|
|
47
|
+
if (defaultValue === 'autoincrement') {
|
|
48
|
+
if (meta.provider === 'sqlite' || meta.provider === 'mysql') {
|
|
49
|
+
throw new Error(
|
|
50
|
+
`${meta.listKey}.${meta.fieldKey} specifies defaultValue: { kind: 'autoincrement' }, this is not supported on ${meta.provider}`
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
const isNullable = resolveDbNullable(validation, config.db)
|
|
54
|
+
if (isNullable !== false) {
|
|
55
|
+
throw new Error(
|
|
56
|
+
`${meta.listKey}.${meta.fieldKey} specifies defaultValue: { kind: 'autoincrement' } but doesn't specify db.isNullable: false.\n` +
|
|
57
|
+
`Having nullable autoincrements on Prisma currently incorrectly creates a non-nullable column so it is not allowed.\n` +
|
|
58
|
+
`https://github.com/prisma/prisma/issues/8663`
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
if (isRequired) {
|
|
62
|
+
throw new Error(
|
|
63
|
+
`${meta.listKey}.${meta.fieldKey} defaultValue: { kind: 'autoincrement' } conflicts with validation.isRequired: true`
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (
|
|
68
|
+
// TODO: prefer typescript only?
|
|
69
|
+
defaultValue !== null &&
|
|
70
|
+
defaultValue !== 'autoincrement' &&
|
|
71
|
+
typeof defaultValue !== 'bigint'
|
|
72
|
+
) {
|
|
73
|
+
throw new Error(
|
|
74
|
+
`${meta.listKey}.${meta.fieldKey} specifies a default value of: ${defaultValue} but it must be a valid finite number`
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
if (min !== undefined && !Number.isInteger(min)) {
|
|
78
|
+
throw new Error(
|
|
79
|
+
`${meta.listKey}.${meta.fieldKey} specifies validation.min: ${min} but it must be an integer`
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
if (max !== undefined && !Number.isInteger(max)) {
|
|
83
|
+
throw new Error(
|
|
84
|
+
`${meta.listKey}.${meta.fieldKey} specifies validation.max: ${max} but it must be an integer`
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
if (min !== undefined && (min > MAX_INT || min < MIN_INT)) {
|
|
88
|
+
throw new Error(
|
|
89
|
+
`${meta.listKey}.${meta.fieldKey} specifies validation.min: ${min} which is outside of the range of a 64-bit signed integer`
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
if (max !== undefined && (max > MAX_INT || max < MIN_INT)) {
|
|
93
|
+
throw new Error(
|
|
94
|
+
`${meta.listKey}.${meta.fieldKey} specifies validation.max: ${max} which is outside of the range of a 64-bit signed integer`
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
if (min !== undefined && max !== undefined && min > max) {
|
|
98
|
+
throw new Error(
|
|
99
|
+
`${meta.listKey}.${meta.fieldKey} specifies a validation.max that is less than the validation.min, and therefore has no valid options`
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const hasAdditionalValidation = min !== undefined || max !== undefined
|
|
104
|
+
const { mode, validate } = makeValidateHook(
|
|
105
|
+
meta,
|
|
106
|
+
config,
|
|
107
|
+
hasAdditionalValidation
|
|
108
|
+
? ({ resolvedData, operation, addValidationError }) => {
|
|
109
|
+
if (operation === 'delete') return
|
|
110
|
+
|
|
111
|
+
const value = resolvedData[meta.fieldKey]
|
|
112
|
+
if (typeof value === 'number') {
|
|
113
|
+
if (min !== undefined && value < min) {
|
|
114
|
+
addValidationError(`value must be greater than or equal to ${min}`)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (max !== undefined && value > max) {
|
|
118
|
+
addValidationError(`value must be less than or equal to ${max}`)
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
: undefined
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
return fieldType({
|
|
126
|
+
kind: 'scalar',
|
|
127
|
+
mode,
|
|
128
|
+
scalar: 'BigInt',
|
|
129
|
+
index: isIndexed === true ? 'index' : isIndexed || undefined,
|
|
130
|
+
default:
|
|
131
|
+
typeof defaultValue === 'bigint'
|
|
132
|
+
? { kind: 'literal', value: defaultValue }
|
|
133
|
+
: defaultValue === 'autoincrement'
|
|
134
|
+
? { kind: 'autoincrement' }
|
|
135
|
+
: undefined,
|
|
136
|
+
map: config.db?.map,
|
|
137
|
+
extendPrismaSchema: config.db?.extendPrismaSchema,
|
|
138
|
+
})({
|
|
139
|
+
...config,
|
|
140
|
+
...defaultIsRequired(config, isRequired),
|
|
141
|
+
hooks: {
|
|
142
|
+
...config.hooks,
|
|
143
|
+
validate,
|
|
144
|
+
},
|
|
145
|
+
input: {
|
|
146
|
+
uniqueWhere: isIndexed === 'unique' ? { arg: g.arg({ type: g.BigInt }) } : undefined,
|
|
147
|
+
where: {
|
|
148
|
+
arg: g.arg({ type: filters[meta.provider].BigInt[mode] }),
|
|
149
|
+
resolve: mode === 'optional' ? filters.resolveCommon : undefined,
|
|
150
|
+
},
|
|
151
|
+
create: {
|
|
152
|
+
arg: g.arg({
|
|
153
|
+
type: g.BigInt,
|
|
154
|
+
defaultValue: typeof defaultValue === 'bigint' ? defaultValue : undefined,
|
|
155
|
+
}),
|
|
156
|
+
resolve(value) {
|
|
157
|
+
if (value === undefined) {
|
|
158
|
+
if (defaultValue === 'autoincrement') return null
|
|
159
|
+
return defaultValue
|
|
160
|
+
}
|
|
161
|
+
return value
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
update: { arg: g.arg({ type: g.BigInt }) },
|
|
165
|
+
orderBy: { arg: g.arg({ type: orderDirectionEnum }) },
|
|
166
|
+
},
|
|
167
|
+
output: g.field({ type: g.BigInt }),
|
|
168
|
+
__ksTelemetryFieldTypeName: '@nixxie-cms/bigInt',
|
|
169
|
+
views: '@nixxie-cms/core/fields/types/bigInt/views',
|
|
170
|
+
getAdminMeta(): Parameters<typeof controller>[0]['fieldMeta'] {
|
|
171
|
+
return {
|
|
172
|
+
validation: {
|
|
173
|
+
min: min?.toString() ?? `${MIN_INT}`,
|
|
174
|
+
max: max?.toString() ?? `${MAX_INT}`,
|
|
175
|
+
},
|
|
176
|
+
defaultValue: typeof defaultValue === 'bigint' ? defaultValue.toString() : defaultValue,
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
})
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import { ContextualHelp } from '@keystar/ui/contextual-help'
|
|
4
|
+
import { Content } from '@keystar/ui/slots'
|
|
5
|
+
import { TextField } from '@keystar/ui/text-field'
|
|
6
|
+
import { Heading, Text } from '@keystar/ui/typography'
|
|
7
|
+
|
|
8
|
+
import type { SimpleFieldTypeInfo } from '../../../../types'
|
|
9
|
+
import type { FieldController, FieldControllerConfig, FieldProps } from '../../../../types'
|
|
10
|
+
import { entriesTyped } from '../../../../lib/core/utils'
|
|
11
|
+
|
|
12
|
+
const TYPE_OPERATOR_MAP = {
|
|
13
|
+
equals: '=',
|
|
14
|
+
not: '≠',
|
|
15
|
+
gt: '>',
|
|
16
|
+
lt: '<',
|
|
17
|
+
gte: '≥',
|
|
18
|
+
lte: '≤',
|
|
19
|
+
} as const
|
|
20
|
+
|
|
21
|
+
type Value =
|
|
22
|
+
| { kind: 'create'; value: string | null }
|
|
23
|
+
| { kind: 'update'; initial: string | null; value: string | null }
|
|
24
|
+
|
|
25
|
+
type Validation = {
|
|
26
|
+
min: string
|
|
27
|
+
max: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function validate_(
|
|
31
|
+
value: Value,
|
|
32
|
+
validation: Validation,
|
|
33
|
+
isRequired: boolean,
|
|
34
|
+
label: string,
|
|
35
|
+
hasAutoIncrementDefault: boolean
|
|
36
|
+
): string | undefined {
|
|
37
|
+
const { value: input, kind } = value
|
|
38
|
+
if (kind === 'create' && hasAutoIncrementDefault && input === null) return
|
|
39
|
+
if (kind === 'update' && value.initial === null && input === null) return
|
|
40
|
+
if (isRequired && input === null) return `${label} is required`
|
|
41
|
+
if (typeof input !== 'string') return
|
|
42
|
+
try {
|
|
43
|
+
const v = BigInt(input)
|
|
44
|
+
if (validation.min !== undefined && v < BigInt(validation.min))
|
|
45
|
+
return `${label} must be greater than or equal to ${validation.min}`
|
|
46
|
+
if (validation.max !== undefined && v > BigInt(validation.max))
|
|
47
|
+
return `${label} must be less than or equal to ${validation.max}`
|
|
48
|
+
} catch (e: any) {
|
|
49
|
+
return `${label} is not a valid BigInt`
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function controller(
|
|
54
|
+
config: FieldControllerConfig<{
|
|
55
|
+
validation: Validation
|
|
56
|
+
defaultValue: string | null | 'autoincrement'
|
|
57
|
+
}>
|
|
58
|
+
): FieldController<Value, string | null, SimpleFieldTypeInfo<'BigInt'>['inputs']['where']> & {
|
|
59
|
+
validation: Validation
|
|
60
|
+
hasAutoIncrementDefault: boolean
|
|
61
|
+
} {
|
|
62
|
+
const validate = (value: Value, opts: { isRequired: boolean }) => {
|
|
63
|
+
return validate_(
|
|
64
|
+
value,
|
|
65
|
+
config.fieldMeta.validation,
|
|
66
|
+
opts.isRequired,
|
|
67
|
+
config.label,
|
|
68
|
+
config.fieldMeta.defaultValue === 'autoincrement'
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return {
|
|
73
|
+
fieldKey: config.fieldKey,
|
|
74
|
+
label: config.label,
|
|
75
|
+
description: config.description,
|
|
76
|
+
validation: config.fieldMeta.validation,
|
|
77
|
+
defaultValue: {
|
|
78
|
+
kind: 'create',
|
|
79
|
+
value:
|
|
80
|
+
config.fieldMeta.defaultValue === 'autoincrement' ? null : config.fieldMeta.defaultValue,
|
|
81
|
+
},
|
|
82
|
+
deserialize: data => ({
|
|
83
|
+
kind: 'update',
|
|
84
|
+
value: data[config.fieldKey],
|
|
85
|
+
initial: data[config.fieldKey],
|
|
86
|
+
}),
|
|
87
|
+
serialize: value => ({ [config.fieldKey]: value.value }),
|
|
88
|
+
graphqlSelection: config.fieldKey,
|
|
89
|
+
filter: {
|
|
90
|
+
Filter(props) {
|
|
91
|
+
const {
|
|
92
|
+
autoFocus,
|
|
93
|
+
context,
|
|
94
|
+
forceValidation,
|
|
95
|
+
typeLabel,
|
|
96
|
+
onChange,
|
|
97
|
+
type,
|
|
98
|
+
value,
|
|
99
|
+
...otherProps
|
|
100
|
+
} = props
|
|
101
|
+
const [isDirty, setDirty] = useState(false)
|
|
102
|
+
if (type === 'empty' || type === 'not_empty') return null
|
|
103
|
+
|
|
104
|
+
const labelProps =
|
|
105
|
+
context === 'add' ? { label: config.label, description: typeLabel } : { label: typeLabel }
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<TextField
|
|
109
|
+
{...otherProps}
|
|
110
|
+
{...labelProps}
|
|
111
|
+
autoFocus={autoFocus}
|
|
112
|
+
errorMessage={
|
|
113
|
+
(forceValidation || isDirty) &&
|
|
114
|
+
!validate({ kind: 'update', initial: null, value }, { isRequired: true })
|
|
115
|
+
? 'Required'
|
|
116
|
+
: null
|
|
117
|
+
}
|
|
118
|
+
inputMode="numeric"
|
|
119
|
+
width="auto"
|
|
120
|
+
onBlur={() => setDirty(true)}
|
|
121
|
+
onChange={x => onChange?.(x === '' ? null : x)}
|
|
122
|
+
value={value ?? ''}
|
|
123
|
+
/>
|
|
124
|
+
)
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
graphql: ({ type, value }) => {
|
|
128
|
+
if (type === 'empty') return { [config.fieldKey]: { equals: null } }
|
|
129
|
+
if (type === 'not_empty') return { [config.fieldKey]: { not: { equals: null } } }
|
|
130
|
+
if (type === 'not') return { [config.fieldKey]: { not: { equals: value } } }
|
|
131
|
+
return { [config.fieldKey]: { [type]: value } }
|
|
132
|
+
},
|
|
133
|
+
parseGraphQL: value => {
|
|
134
|
+
return entriesTyped(value).flatMap(([type, value]) => {
|
|
135
|
+
if (type === 'equals' && value === null) {
|
|
136
|
+
return [{ type: 'empty', value: null }]
|
|
137
|
+
}
|
|
138
|
+
if (!value) return []
|
|
139
|
+
if (type === 'equals') return { type: 'equals', value: value as unknown as string }
|
|
140
|
+
if (type === 'not') {
|
|
141
|
+
if (value?.equals === null) return { type: 'not_empty', value: null }
|
|
142
|
+
return { type: 'not', value: value.equals as unknown as string }
|
|
143
|
+
}
|
|
144
|
+
if (type === 'gt' || type === 'gte' || type === 'lt' || type === 'lte') {
|
|
145
|
+
return { type, value: value as unknown as string }
|
|
146
|
+
}
|
|
147
|
+
return []
|
|
148
|
+
})
|
|
149
|
+
},
|
|
150
|
+
Label({ label, type, value }) {
|
|
151
|
+
if (type === 'empty' || type === 'not_empty') return label.toLocaleLowerCase()
|
|
152
|
+
const operator = TYPE_OPERATOR_MAP[type as keyof typeof TYPE_OPERATOR_MAP]
|
|
153
|
+
return `${operator} ${value}`
|
|
154
|
+
},
|
|
155
|
+
types: {
|
|
156
|
+
equals: {
|
|
157
|
+
label: 'Is exactly',
|
|
158
|
+
initialValue: null,
|
|
159
|
+
},
|
|
160
|
+
not: {
|
|
161
|
+
label: 'Is not exactly',
|
|
162
|
+
initialValue: null,
|
|
163
|
+
},
|
|
164
|
+
gt: {
|
|
165
|
+
label: 'Is greater than',
|
|
166
|
+
initialValue: null,
|
|
167
|
+
},
|
|
168
|
+
lt: {
|
|
169
|
+
label: 'Is less than',
|
|
170
|
+
initialValue: null,
|
|
171
|
+
},
|
|
172
|
+
gte: {
|
|
173
|
+
label: 'Is greater than or equal to',
|
|
174
|
+
initialValue: null,
|
|
175
|
+
},
|
|
176
|
+
lte: {
|
|
177
|
+
label: 'Is less than or equal to',
|
|
178
|
+
initialValue: null,
|
|
179
|
+
},
|
|
180
|
+
empty: {
|
|
181
|
+
label: 'Is empty',
|
|
182
|
+
initialValue: null,
|
|
183
|
+
},
|
|
184
|
+
not_empty: {
|
|
185
|
+
label: 'Is not empty',
|
|
186
|
+
initialValue: null,
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
hasAutoIncrementDefault: config.fieldMeta.defaultValue === 'autoincrement',
|
|
192
|
+
validate: (value, opts) => validate(value, opts) === undefined,
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export function Field({
|
|
197
|
+
field,
|
|
198
|
+
value,
|
|
199
|
+
onChange,
|
|
200
|
+
autoFocus,
|
|
201
|
+
forceValidation,
|
|
202
|
+
isRequired,
|
|
203
|
+
}: FieldProps<typeof controller>) {
|
|
204
|
+
const [isDirty, setDirty] = useState(false)
|
|
205
|
+
const isReadOnly = !onChange || field.hasAutoIncrementDefault
|
|
206
|
+
|
|
207
|
+
if (field.hasAutoIncrementDefault && value.kind === 'create') {
|
|
208
|
+
return (
|
|
209
|
+
<TextField
|
|
210
|
+
autoFocus={autoFocus}
|
|
211
|
+
description={field.description}
|
|
212
|
+
label={field.label}
|
|
213
|
+
isReadOnly
|
|
214
|
+
defaultValue="--"
|
|
215
|
+
contextualHelp={
|
|
216
|
+
<ContextualHelp>
|
|
217
|
+
<Heading>Auto increment</Heading>
|
|
218
|
+
<Content>
|
|
219
|
+
<Text>
|
|
220
|
+
This field is set to auto increment. It will default to the next available number.
|
|
221
|
+
</Text>
|
|
222
|
+
</Content>
|
|
223
|
+
</ContextualHelp>
|
|
224
|
+
}
|
|
225
|
+
/>
|
|
226
|
+
)
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const validate = (value: Value) => {
|
|
230
|
+
return validate_(
|
|
231
|
+
value,
|
|
232
|
+
field.validation,
|
|
233
|
+
isRequired,
|
|
234
|
+
field.label,
|
|
235
|
+
field.hasAutoIncrementDefault
|
|
236
|
+
)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return (
|
|
240
|
+
<TextField
|
|
241
|
+
autoFocus={autoFocus}
|
|
242
|
+
description={field.description}
|
|
243
|
+
label={field.label}
|
|
244
|
+
errorMessage={(forceValidation || isDirty) && validate(value)}
|
|
245
|
+
isReadOnly={isReadOnly}
|
|
246
|
+
isRequired={isRequired}
|
|
247
|
+
inputMode="numeric"
|
|
248
|
+
width="alias.singleLineWidth"
|
|
249
|
+
onBlur={() => setDirty(true)}
|
|
250
|
+
onChange={x => onChange?.({ ...value, value: x === '' ? null : x })}
|
|
251
|
+
value={value.value ?? ''}
|
|
252
|
+
/>
|
|
253
|
+
)
|
|
254
|
+
}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type BaseListTypeInfo,
|
|
3
|
+
type CommonFieldConfig,
|
|
4
|
+
type FieldTypeFunc,
|
|
5
|
+
fieldType,
|
|
6
|
+
orderDirectionEnum,
|
|
7
|
+
} from '../../../types'
|
|
8
|
+
import { g } from '../../..'
|
|
9
|
+
import { makeValidateHook, defaultIsRequired } from '../../non-null-graphql'
|
|
10
|
+
import { weakMemoize } from '../../../lib/core/utils'
|
|
11
|
+
import { GraphQLError } from 'graphql'
|
|
12
|
+
import type {
|
|
13
|
+
GArg,
|
|
14
|
+
GInputObjectType,
|
|
15
|
+
GList,
|
|
16
|
+
GNonNull,
|
|
17
|
+
GScalarType,
|
|
18
|
+
InferValueFromInputType,
|
|
19
|
+
} from '@graphql-ts/schema'
|
|
20
|
+
|
|
21
|
+
export type FieldTypeInfo = {
|
|
22
|
+
item: Uint8Array | null
|
|
23
|
+
inputs: {
|
|
24
|
+
create: Uint8Array | null | undefined
|
|
25
|
+
update: Uint8Array | null | undefined
|
|
26
|
+
where: InferValueFromInputType<BytesFilterType> | undefined
|
|
27
|
+
uniqueWhere: Uint8Array | null | undefined
|
|
28
|
+
orderBy: undefined
|
|
29
|
+
}
|
|
30
|
+
prisma: {
|
|
31
|
+
create: Uint8Array | null | undefined
|
|
32
|
+
update: Uint8Array | null | undefined
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type BytesFieldConfig<ListTypeInfo extends BaseListTypeInfo> = CommonFieldConfig<
|
|
37
|
+
ListTypeInfo,
|
|
38
|
+
FieldTypeInfo
|
|
39
|
+
> & {
|
|
40
|
+
isIndexed?: boolean | 'unique'
|
|
41
|
+
graphql?: {
|
|
42
|
+
scalar?: GScalarType<Uint8Array, string>
|
|
43
|
+
}
|
|
44
|
+
validation?: {
|
|
45
|
+
/**
|
|
46
|
+
* Makes the field disallow null values. It does not constrain the length of the value.
|
|
47
|
+
*/
|
|
48
|
+
isRequired?: boolean
|
|
49
|
+
/**
|
|
50
|
+
* Specifies the minimum and maximum length of the value in _bytes_. It does _not_ represent the length in the encoded form.
|
|
51
|
+
*/
|
|
52
|
+
length?: { min?: number; max?: number }
|
|
53
|
+
}
|
|
54
|
+
defaultValue?: Uint8Array | null
|
|
55
|
+
db?: {
|
|
56
|
+
isNullable?: boolean
|
|
57
|
+
map?: string
|
|
58
|
+
extendPrismaSchema?: (field: string) => string
|
|
59
|
+
/**
|
|
60
|
+
* The underlying database type.
|
|
61
|
+
* Only some of the types are supported on PostgreSQL and MySQL.
|
|
62
|
+
* The native type is not customisable on SQLite.
|
|
63
|
+
* See Prisma's documentation for more information about the supported types.
|
|
64
|
+
*
|
|
65
|
+
* https://www.prisma.io/docs/orm/reference/prisma-schema-reference#bytes
|
|
66
|
+
*/
|
|
67
|
+
nativeType?: string
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type TextFieldMeta = {
|
|
72
|
+
isNullable: boolean
|
|
73
|
+
defaultValue: string | null
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function bytes<ListTypeInfo extends BaseListTypeInfo>(
|
|
77
|
+
config: BytesFieldConfig<ListTypeInfo> = {}
|
|
78
|
+
): FieldTypeFunc<ListTypeInfo> {
|
|
79
|
+
const { defaultValue = null, isIndexed, validation = {} } = config
|
|
80
|
+
|
|
81
|
+
const scalar = config.graphql?.scalar ?? g.Hex
|
|
82
|
+
|
|
83
|
+
config.db ??= {}
|
|
84
|
+
|
|
85
|
+
const isRequired = validation.isRequired ?? false
|
|
86
|
+
const min = validation.isRequired ? (validation.length?.min ?? 1) : validation.length?.min
|
|
87
|
+
const max = validation.length?.max
|
|
88
|
+
|
|
89
|
+
return meta => {
|
|
90
|
+
{
|
|
91
|
+
const serializedExample = scalar.serialize(new Uint8Array([0]))
|
|
92
|
+
if (typeof serializedExample !== 'string') {
|
|
93
|
+
throw new Error(
|
|
94
|
+
`The GraphQL scalar type specified for ${meta.listKey}.${meta.fieldKey} must serialize Uint8Arrays to strings`
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (min !== undefined && (!Number.isInteger(min) || min < 0)) {
|
|
99
|
+
throw new Error(
|
|
100
|
+
`${meta.listKey}.${meta.fieldKey} specifies validation.length.min: ${min} but it must be a positive integer`
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
if (max !== undefined && (!Number.isInteger(max) || max < 0)) {
|
|
104
|
+
throw new Error(
|
|
105
|
+
`${meta.listKey}.${meta.fieldKey} specifies validation.length.max: ${max} but it must be a positive integer`
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
if (min !== undefined && max !== undefined && min > max) {
|
|
109
|
+
throw new Error(
|
|
110
|
+
`${meta.listKey}.${meta.fieldKey} specifies a validation.length.max that is less than the validation.length.min, and therefore has no valid options`
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const hasAdditionalValidation = min !== undefined || max !== undefined
|
|
115
|
+
const { mode, validate } = makeValidateHook(
|
|
116
|
+
meta,
|
|
117
|
+
config,
|
|
118
|
+
hasAdditionalValidation
|
|
119
|
+
? ({ resolvedData, operation, addValidationError }) => {
|
|
120
|
+
if (operation === 'delete') return
|
|
121
|
+
|
|
122
|
+
const value: Uint8Array | null | undefined = resolvedData[meta.fieldKey]
|
|
123
|
+
if (value != null) {
|
|
124
|
+
if (min !== undefined && value.length < min) {
|
|
125
|
+
if (min === 1) {
|
|
126
|
+
addValidationError(`value must not be empty`)
|
|
127
|
+
} else {
|
|
128
|
+
addValidationError(`value must be at least ${min} bytes long`)
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (max !== undefined && value.length > max) {
|
|
132
|
+
addValidationError(`value must be no longer than ${max} bytes`)
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
: undefined
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
let clientSideDefaultValue = null
|
|
140
|
+
if (defaultValue !== null) {
|
|
141
|
+
clientSideDefaultValue = scalar.serialize(defaultValue)
|
|
142
|
+
if (typeof clientSideDefaultValue !== 'string') {
|
|
143
|
+
throw new Error(
|
|
144
|
+
`The GraphQL scalar type specified for ${meta.listKey}.${meta.fieldKey} must serialize Uint8Arrays to strings`
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
} else if (mode === 'required') {
|
|
148
|
+
clientSideDefaultValue = scalar.serialize(new Uint8Array(0))
|
|
149
|
+
if (typeof clientSideDefaultValue !== 'string') {
|
|
150
|
+
throw new Error(
|
|
151
|
+
`The GraphQL scalar type specified for ${meta.listKey}.${meta.fieldKey} must serialize Uint8Arrays to strings`
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return fieldType({
|
|
157
|
+
kind: 'scalar',
|
|
158
|
+
mode,
|
|
159
|
+
scalar: 'Bytes',
|
|
160
|
+
default: defaultValue === null ? undefined : { kind: 'literal', value: defaultValue },
|
|
161
|
+
index: isIndexed === true ? 'index' : isIndexed || undefined,
|
|
162
|
+
map: config.db?.map,
|
|
163
|
+
nativeType: config.db?.nativeType,
|
|
164
|
+
extendPrismaSchema: config.db?.extendPrismaSchema,
|
|
165
|
+
})({
|
|
166
|
+
...config,
|
|
167
|
+
...defaultIsRequired(config, isRequired),
|
|
168
|
+
hooks: {
|
|
169
|
+
...config.hooks,
|
|
170
|
+
validate,
|
|
171
|
+
},
|
|
172
|
+
input: {
|
|
173
|
+
uniqueWhere: isIndexed === 'unique' ? { arg: g.arg({ type: scalar }) } : undefined,
|
|
174
|
+
where: {
|
|
175
|
+
arg: g.arg({
|
|
176
|
+
type: mode === 'optional' ? getNullableFilterType(scalar) : getFilterType(scalar),
|
|
177
|
+
}),
|
|
178
|
+
},
|
|
179
|
+
create: {
|
|
180
|
+
arg: g.arg({
|
|
181
|
+
type: scalar,
|
|
182
|
+
}),
|
|
183
|
+
resolve(val) {
|
|
184
|
+
if (val !== undefined) return val
|
|
185
|
+
return defaultValue ?? null
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
update: { arg: g.arg({ type: scalar }) },
|
|
189
|
+
orderBy: { arg: g.arg({ type: orderDirectionEnum }) },
|
|
190
|
+
},
|
|
191
|
+
output: g.field({ type: scalar }),
|
|
192
|
+
__ksTelemetryFieldTypeName: '@nixxie-cms/bytes',
|
|
193
|
+
views: '@nixxie-cms/core/fields/types/bytes/views',
|
|
194
|
+
getAdminMeta(): TextFieldMeta {
|
|
195
|
+
return {
|
|
196
|
+
defaultValue: clientSideDefaultValue,
|
|
197
|
+
isNullable: mode === 'optional',
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
})
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
type BytesFilterType = GInputObjectType<{
|
|
205
|
+
equals?: GArg<GScalarType<Uint8Array, string>>
|
|
206
|
+
in?: GArg<GList<GNonNull<GScalarType<Uint8Array, string>>>>
|
|
207
|
+
notIn?: GArg<GList<GNonNull<GScalarType<Uint8Array, string>>>>
|
|
208
|
+
not?: GArg<BytesFilterType>
|
|
209
|
+
}>
|
|
210
|
+
|
|
211
|
+
// the weakMemoizes are important so reusing the same scalar type for multiple `bytes` fields uses the same (===) filter type
|
|
212
|
+
// rather than a duplicate one which would cause an error about two types with the same name
|
|
213
|
+
const getFilterType = weakMemoize((scalar: GScalarType<Uint8Array, string>) => {
|
|
214
|
+
const filter: BytesFilterType = g.inputObject({
|
|
215
|
+
name: `${scalar.name}Filter`,
|
|
216
|
+
fields: () => ({
|
|
217
|
+
equals: g.arg({ type: scalar }),
|
|
218
|
+
in: g.arg({ type: g.list(g.nonNull(scalar)) }),
|
|
219
|
+
notIn: g.arg({ type: g.list(g.nonNull(scalar)) }),
|
|
220
|
+
not: g.arg({ type: filter }),
|
|
221
|
+
}),
|
|
222
|
+
})
|
|
223
|
+
return filter
|
|
224
|
+
})
|
|
225
|
+
|
|
226
|
+
const getNullableFilterType = weakMemoize((scalar: GScalarType<Uint8Array, string>) => {
|
|
227
|
+
const filter: BytesFilterType = g.inputObject({
|
|
228
|
+
name: `${scalar.name}NullableFilter`,
|
|
229
|
+
fields: () => ({
|
|
230
|
+
equals: g.arg({ type: scalar }),
|
|
231
|
+
in: g.arg({ type: g.list(g.nonNull(scalar)) }),
|
|
232
|
+
notIn: g.arg({ type: g.list(g.nonNull(scalar)) }),
|
|
233
|
+
not: g.arg({ type: filter }),
|
|
234
|
+
}),
|
|
235
|
+
})
|
|
236
|
+
return filter
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
export function bytesScalar(opts: {
|
|
240
|
+
name: string
|
|
241
|
+
serialize: (value: Uint8Array) => string
|
|
242
|
+
parse: (value: string) => Uint8Array
|
|
243
|
+
description?: string
|
|
244
|
+
specifiedByURL?: string
|
|
245
|
+
}) {
|
|
246
|
+
return g.scalar<Uint8Array, string>({
|
|
247
|
+
name: opts.name,
|
|
248
|
+
description: opts.description,
|
|
249
|
+
specifiedByURL: opts.specifiedByURL,
|
|
250
|
+
parseLiteral(value) {
|
|
251
|
+
if (value.kind !== 'StringValue') {
|
|
252
|
+
throw new GraphQLError(`${opts.name} only accepts values as strings`)
|
|
253
|
+
}
|
|
254
|
+
return opts.parse(value.value)
|
|
255
|
+
},
|
|
256
|
+
parseValue(value) {
|
|
257
|
+
// so that when you're doing a mutation in a resolver, you can just pass in a Uint8Array directly
|
|
258
|
+
if (value instanceof Uint8Array) {
|
|
259
|
+
// duplicate it though to avoid any weirdness with the array being mutated
|
|
260
|
+
// + ensuring that if you pass in a Buffer, resolvers receive a normal Uint8Array
|
|
261
|
+
return Uint8Array.from(value)
|
|
262
|
+
}
|
|
263
|
+
if (typeof value !== 'string') {
|
|
264
|
+
throw new GraphQLError(`${opts.name} only accepts values as strings`)
|
|
265
|
+
}
|
|
266
|
+
return opts.parse(value)
|
|
267
|
+
},
|
|
268
|
+
serialize(value) {
|
|
269
|
+
if (!(value instanceof Uint8Array)) {
|
|
270
|
+
throw new GraphQLError(`unexpected value provided to ${opts.name} scalar: ${value}`)
|
|
271
|
+
}
|
|
272
|
+
return opts.serialize(value)
|
|
273
|
+
},
|
|
274
|
+
})
|
|
275
|
+
}
|