@nest-admin/nestjs 0.11.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/LICENSE +21 -0
- package/README.md +252 -0
- package/dist/admin-ui/assets/index-AyWOamlt.js +50 -0
- package/dist/admin-ui/assets/index-AyWOamlt.js.map +1 -0
- package/dist/admin-ui/assets/index-D4Eh84eD.css +2 -0
- package/dist/admin-ui/index.html +14 -0
- package/dist/chunk-7IXLRGGQ.js +356 -0
- package/dist/chunk-7IXLRGGQ.js.map +1 -0
- package/dist/drizzle.cjs +895 -0
- package/dist/drizzle.cjs.map +1 -0
- package/dist/drizzle.d.cts +335 -0
- package/dist/drizzle.d.ts +335 -0
- package/dist/drizzle.js +756 -0
- package/dist/drizzle.js.map +1 -0
- package/dist/index.cjs +3247 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1652 -0
- package/dist/index.d.ts +1652 -0
- package/dist/index.js +2901 -0
- package/dist/index.js.map +1 -0
- package/dist/prisma.cjs +1159 -0
- package/dist/prisma.cjs.map +1 -0
- package/dist/prisma.d.cts +585 -0
- package/dist/prisma.d.ts +585 -0
- package/dist/prisma.js +995 -0
- package/dist/prisma.js.map +1 -0
- package/package.json +130 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--color-black:#000;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--leading-relaxed:1.625;--ease-out:cubic-bezier(0, 0, .2, 1);--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-body);--default-mono-font-family:var(--font-code)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}body{background-color:var(--background);color:var(--foreground);font-family:var(--font-body);-webkit-font-smoothing:antialiased;line-height:1.5}:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--ring)}table,.tabular{font-variant-numeric:tabular-nums}button:not(:disabled),summary,[role=button]:not([aria-disabled=true]),[role=option],[role=menuitem],label[for],a[href]{cursor:pointer}@media (prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}}@layer components{[data-radix-popper-content-wrapper]>*,[data-slot=select-content],[data-slot=dropdown-menu-content],[data-slot=popover-content]{animation:.12s ease-out na-drop-in}[data-state=open][data-slot=dialog-overlay],[data-state=open][data-slot=alert-overlay]{animation:.15s ease-out na-fade-in}[data-state=closed][data-slot=dialog-overlay],[data-state=closed][data-slot=alert-overlay]{animation:.12s ease-in na-fade-out}[data-slot=dialog-content][data-state=open],[data-slot=alert-content][data-state=open]{animation:.15s ease-out na-pop-in}[data-slot=dialog-content][data-state=closed],[data-slot=alert-content][data-state=closed]{animation:.12s ease-in na-pop-out}[data-slot=nav-drawer][data-state=open]{animation:.2s cubic-bezier(.32,.72,0,1) na-slide-in-left}[data-slot=nav-drawer][data-state=closed]{animation:.16s ease-in na-slide-out-left}}@layer utilities{.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.top-0{top:0}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.top-14{top:calc(var(--spacing) * 14)}.top-\[20\%\]{top:20%}.top-full{top:100%}.right-0{right:0}.right-1{right:var(--spacing)}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.left-0{left:0}.left-1\/2{left:50%}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.col-start-2{grid-column-start:2}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.-mx-2{margin-inline:calc(var(--spacing) * -2)}.my-1{margin-block:var(--spacing)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mr-1{margin-right:var(--spacing)}.mb-1{margin-bottom:var(--spacing)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.ml-auto{margin-left:auto}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-12{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-14{height:calc(var(--spacing) * 14)}.h-32{height:calc(var(--spacing) * 32)}.h-64{height:calc(var(--spacing) * 64)}.h-\[calc\(100svh-3\.5rem\)\]{height:calc(100svh - 3.5rem)}.h-full{height:100%}.h-px{height:1px}.h-svh{height:100svh}.max-h-56{max-height:calc(var(--spacing) * 56)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-80{max-height:calc(var(--spacing) * 80)}.min-h-20{min-height:calc(var(--spacing) * 20)}.min-h-svh{min-height:100svh}.w-14{width:calc(var(--spacing) * 14)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-28{width:calc(var(--spacing) * 28)}.w-36{width:calc(var(--spacing) * 36)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-60{max-width:calc(var(--spacing) * 60)}.max-w-64{max-width:calc(var(--spacing) * 64)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:0}.min-w-32{min-width:calc(var(--spacing) * 32)}.min-w-40{min-width:calc(var(--spacing) * 40)}.min-w-44{min-width:calc(var(--spacing) * 44)}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-52{min-width:calc(var(--spacing) * 52)}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-0{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.animate-pulse{animation:var(--animate-pulse)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-y-1{row-gap:var(--spacing)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[4px\]{border-radius:4px}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:calc(var(--radius) + 2px)}.rounded-md{border-radius:var(--radius)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:calc(var(--radius) + 6px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-y-0{border-block-style:var(--tw-border-style);border-block-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-0{border-left-style:var(--tw-border-style);border-left-width:0}.border-destructive\/40{border-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.border-destructive\/40{border-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.border-input{border-color:var(--input)}.border-sidebar-border{border-color:var(--sidebar-border)}.border-success\/40{border-color:var(--success)}@supports (color:color-mix(in lab, red, red)){.border-success\/40{border-color:color-mix(in oklab, var(--success) 40%, transparent)}}.border-transparent{border-color:#0000}.border-warning\/40{border-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.border-warning\/40{border-color:color-mix(in oklab, var(--warning) 40%, transparent)}}.bg-background,.bg-background\/85{background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){.bg-background\/85{background-color:color-mix(in oklab, var(--background) 85%, transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-destructive,.bg-destructive\/8{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.bg-destructive\/8{background-color:color-mix(in oklab, var(--destructive) 8%, transparent)}}.bg-muted{background-color:var(--muted)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-sidebar{background-color:var(--sidebar)}.bg-sidebar-accent{background-color:var(--sidebar-accent)}.bg-success,.bg-success\/8{background-color:var(--success)}@supports (color:color-mix(in lab, red, red)){.bg-success\/8{background-color:color-mix(in oklab, var(--success) 8%, transparent)}}.bg-transparent{background-color:#0000}.bg-warning,.bg-warning\/8{background-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.bg-warning\/8{background-color:color-mix(in oklab, var(--warning) 8%, transparent)}}.fill-muted-foreground\/25{fill:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.fill-muted-foreground\/25{fill:color-mix(in oklab, var(--muted-foreground) 25%, transparent)}}.fill-primary\/80{fill:var(--primary)}@supports (color:color-mix(in lab, red, red)){.fill-primary\/80{fill:color-mix(in oklab, var(--primary) 80%, transparent)}}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-14{padding-block:calc(var(--spacing) * 14)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-1{padding-bottom:var(--spacing)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-code)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.wrap-break-word{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-destructive-foreground{color:var(--destructive-foreground)}.text-foreground{color:var(--foreground)}.text-link{color:var(--link)}.text-muted-foreground,.text-muted-foreground\/50{color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.text-muted-foreground\/50{color:color-mix(in oklab, var(--muted-foreground) 50%, transparent)}}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-sidebar-accent-foreground{color:var(--sidebar-accent-foreground)}.text-sidebar-foreground{color:var(--sidebar-foreground)}.text-success{color:var(--success)}.text-success-foreground{color:var(--success-foreground)}.text-warning{color:var(--warning)}.text-warning-foreground{color:var(--warning-foreground)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.no-underline{text-decoration-line:none}.underline-offset-4{text-underline-offset:4px}.accent-foreground{accent-color:var(--foreground)}.accent-primary{accent-color:var(--primary)}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-offset-background{--tw-ring-offset-color:var(--background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[color\,background-color\,border-color\,box-shadow\,transform\]{transition-property:color,background-color,border-color,box-shadow,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.first\:pt-0:first-child{padding-top:0}.last\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}.last\:pb-0:last-child{padding-bottom:0}@media (hover:hover){.hover\:border-ring\/40:hover{border-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.hover\:border-ring\/40:hover{border-color:color-mix(in oklab, var(--ring) 40%, transparent)}}.hover\:bg-accent:hover{background-color:var(--accent)}.hover\:bg-destructive\/85:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-destructive\/85:hover{background-color:color-mix(in oklab, var(--destructive) 85%, transparent)}}.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab, var(--muted) 50%, transparent)}}.hover\:bg-primary\/85:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/85:hover{background-color:color-mix(in oklab, var(--primary) 85%, transparent)}}.hover\:bg-secondary\/70:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-secondary\/70:hover{background-color:color-mix(in oklab, var(--secondary) 70%, transparent)}}.hover\:bg-sidebar-accent\/60:hover{background-color:var(--sidebar-accent)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-sidebar-accent\/60:hover{background-color:color-mix(in oklab, var(--sidebar-accent) 60%, transparent)}}.hover\:bg-transparent:hover{background-color:#0000}.hover\:fill-primary:hover{fill:var(--primary)}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:text-destructive:hover{color:var(--destructive)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-link:hover{color:var(--link)}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-sm:hover{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:bg-destructive\/10:focus{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus\:bg-destructive\/10:focus{background-color:color-mix(in oklab, var(--destructive) 10%, transparent)}}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:text-destructive:focus{color:var(--destructive)}.focus-visible\:bg-accent:focus-visible{background-color:var(--accent)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:scale-\[0\.98\]:active{scale:.98}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.aria-busy\:opacity-55[aria-busy=true]{opacity:.55}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-2[aria-invalid=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.aria-invalid\:ring-destructive\/25[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.aria-invalid\:ring-destructive\/25[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 25%, transparent)}}.data-disabled\:pointer-events-none[data-disabled]{pointer-events:none}.data-disabled\:opacity-50[data-disabled]{opacity:.5}.data-placeholder\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[selected\=true\]\:bg-accent[data-selected=true]{background-color:var(--accent)}.data-\[selected\=true\]\:bg-primary\/8[data-selected=true]{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.data-\[selected\=true\]\:bg-primary\/8[data-selected=true]{background-color:color-mix(in oklab, var(--primary) 8%, transparent)}}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true]{color:var(--accent-foreground)}@media (width>=40rem){.sm\:col-span-1{grid-column:span 1/span 1}.sm\:col-span-2{grid-column:span 2/span 2}.sm\:inline{display:inline}.sm\:w-auto{width:auto}.sm\:max-w-sm{max-width:var(--container-sm)}.sm\:max-w-xs{max-width:var(--container-xs)}.sm\:flex-1{flex:1}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-\[14rem_1fr\]{grid-template-columns:14rem 1fr}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:gap-4{gap:calc(var(--spacing) * 4)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:px-4{padding-inline:calc(var(--spacing) * 4)}}@media (width>=48rem){.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:inline-flex{display:inline-flex}}@media (width>=64rem){.lg\:col-span-2{grid-column:span 2/span 2}.lg\:col-span-3{grid-column:span 3/span 3}.lg\:col-span-4{grid-column:span 4/span 4}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&_\[cmdk-group-heading\]\]\:px-3 [cmdk-group-heading]{padding-inline:calc(var(--spacing) * 3)}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-block:calc(var(--spacing) * 1.5)}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:var(--muted-foreground)}.\[\&_p\]\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:not\(\:has\(svg\)\)\]\:grid-cols-1:not(:has(svg)){grid-template-columns:repeat(1,minmax(0,1fr))}.\[\&\>span\]\:truncate>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.\[\&\>svg\]\:size-4>svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&\>svg\]\:translate-y-0\.5>svg{--tw-translate-y:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>svg\]\:text-destructive>svg{color:var(--destructive)}.\[\&\>svg\]\:text-success>svg{color:var(--success)}.\[\&\>svg\]\:text-warning>svg{color:var(--warning)}.skip-link{top:calc(var(--spacing) * 2);left:calc(var(--spacing) * 2);z-index:50;--tw-translate-y:calc(var(--spacing) * -20);translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:var(--radius);border-style:var(--tw-border-style);border-width:1px;border-color:var(--border);background-color:var(--popover);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--popover-foreground);--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));position:absolute}.skip-link:focus{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}}:root{--background:oklch(99.5% .001 255);--foreground:oklch(21% .02 258);--card:oklch(100% 0 0);--card-foreground:var(--foreground);--popover:oklch(100% 0 0);--popover-foreground:var(--foreground);--primary:oklch(48% .16 258);--primary-foreground:oklch(98.5% .002 255);--link:var(--primary);--secondary:oklch(96.8% .004 255);--secondary-foreground:oklch(28% .02 258);--muted:oklch(96.8% .004 255);--muted-foreground:oklch(53% .02 258);--accent:oklch(95.5% .008 255);--accent-foreground:oklch(28% .02 258);--destructive:oklch(52% .19 27);--destructive-foreground:oklch(98.5% .002 255);--success:oklch(50% .13 155);--success-foreground:oklch(98.5% .002 255);--warning:oklch(66% .13 75);--warning-foreground:oklch(21% .02 258);--border:oklch(90% .005 255);--input:oklch(66% .012 255);--ring:var(--primary);--sidebar:oklch(97.8% .003 255);--sidebar-foreground:var(--foreground);--sidebar-border:oklch(90% .005 255);--sidebar-accent:oklch(94% .006 255);--sidebar-accent-foreground:oklch(24% .02 258);--radius:.625rem;--font-body:ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--font-code:ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace}.dark{--background:oklch(17% .012 258);--foreground:oklch(93% .008 255);--card:oklch(21.2% .014 258);--card-foreground:var(--foreground);--popover:oklch(22.5% .015 258);--popover-foreground:var(--foreground);--primary:oklch(55% .18 262);--primary-foreground:oklch(98.5% .002 255);--link:oklch(76% .12 262);--secondary:oklch(27% .016 258);--secondary-foreground:oklch(93% .008 255);--muted:oklch(27% .016 258);--muted-foreground:oklch(72% .018 255);--accent:oklch(29% .018 258);--accent-foreground:oklch(93% .008 255);--destructive:oklch(55% .19 25);--destructive-foreground:oklch(98.5% .002 255);--success:oklch(52% .14 155);--success-foreground:oklch(98.5% .002 255);--warning:oklch(55% .14 70);--warning-foreground:oklch(98.5% .002 255);--border:oklch(30% .016 258);--input:oklch(52% .02 258);--ring:var(--primary);--sidebar:oklch(19.6% .013 258);--sidebar-foreground:var(--foreground);--sidebar-border:oklch(28% .016 258);--sidebar-accent:oklch(27% .016 258);--sidebar-accent-foreground:oklch(95% .008 255)}@keyframes na-fade-in{0%{opacity:0}}@keyframes na-fade-out{to{opacity:0}}@keyframes na-pop-in{0%{opacity:0;transform:translate(-50%,-48%)scale(.97)}}@keyframes na-pop-out{to{opacity:0;transform:translate(-50%,-48%)scale(.97)}}@keyframes na-slide-in-left{0%{transform:translate(-100%)}}@keyframes na-slide-out-left{to{transform:translate(-100%)}}@keyframes na-drop-in{0%{opacity:0;transform:scale(.96)translateY(-2px)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<meta name="robots" content="noindex" />
|
|
7
|
+
<title>Admin</title>
|
|
8
|
+
<script type="module" crossorigin src="/__nest-admin-base__/assets/index-AyWOamlt.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/__nest-admin-base__/assets/index-D4Eh84eD.css">
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="root"></div>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// ../core/dist/index.js
|
|
5
|
+
function summarise(account) {
|
|
6
|
+
return {
|
|
7
|
+
id: account.id,
|
|
8
|
+
email: account.email,
|
|
9
|
+
...account.name !== void 0 ? {
|
|
10
|
+
name: account.name
|
|
11
|
+
} : {}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
__name(summarise, "summarise");
|
|
15
|
+
var CREATED = [
|
|
16
|
+
"createdAt",
|
|
17
|
+
"created_at",
|
|
18
|
+
"created",
|
|
19
|
+
"createdOn",
|
|
20
|
+
"insertedAt",
|
|
21
|
+
"inserted_at"
|
|
22
|
+
];
|
|
23
|
+
var NOT_CREATED = [
|
|
24
|
+
"updated",
|
|
25
|
+
"modified",
|
|
26
|
+
"deleted",
|
|
27
|
+
"archived",
|
|
28
|
+
"expires",
|
|
29
|
+
"expired"
|
|
30
|
+
];
|
|
31
|
+
function isDate(field) {
|
|
32
|
+
return field.kind === "datetime" && !field.isList && !field.relation;
|
|
33
|
+
}
|
|
34
|
+
__name(isDate, "isDate");
|
|
35
|
+
function excluded(name) {
|
|
36
|
+
const lower = name.toLowerCase();
|
|
37
|
+
return NOT_CREATED.some((word) => lower.startsWith(word));
|
|
38
|
+
}
|
|
39
|
+
__name(excluded, "excluded");
|
|
40
|
+
function createdFieldFor(model) {
|
|
41
|
+
const dates = model.fields.filter(isDate);
|
|
42
|
+
for (const conventional of CREATED) {
|
|
43
|
+
const match = dates.find((field) => field.name.toLowerCase() === conventional.toLowerCase());
|
|
44
|
+
if (match) return match.name;
|
|
45
|
+
}
|
|
46
|
+
const generated = dates.filter((field) => field.isGenerated && !excluded(field.name));
|
|
47
|
+
return generated.length === 1 ? generated[0]?.name : void 0;
|
|
48
|
+
}
|
|
49
|
+
__name(createdFieldFor, "createdFieldFor");
|
|
50
|
+
var CONVENTIONAL = [
|
|
51
|
+
"name",
|
|
52
|
+
"title",
|
|
53
|
+
"label",
|
|
54
|
+
"displayName",
|
|
55
|
+
"username",
|
|
56
|
+
"email",
|
|
57
|
+
"slug"
|
|
58
|
+
];
|
|
59
|
+
function isReadable(field) {
|
|
60
|
+
return field.kind === "string" && !field.isList && !field.relation && // A generated string is a cuid or a uuid: readable characters, no meaning.
|
|
61
|
+
!field.isGenerated;
|
|
62
|
+
}
|
|
63
|
+
__name(isReadable, "isReadable");
|
|
64
|
+
function displayFieldFor(model) {
|
|
65
|
+
if (model.displayField !== void 0) return model.displayField;
|
|
66
|
+
const readable = model.fields.filter(isReadable);
|
|
67
|
+
for (const candidate of CONVENTIONAL) {
|
|
68
|
+
const match = readable.find((field) => field.name === candidate);
|
|
69
|
+
if (match) return match.name;
|
|
70
|
+
}
|
|
71
|
+
const unique = readable.find((field) => field.isUnique && !field.isId);
|
|
72
|
+
if (unique) return unique.name;
|
|
73
|
+
const plain = readable.find((field) => !field.isId);
|
|
74
|
+
if (plain) return plain.name;
|
|
75
|
+
return model.primaryKey[0] ?? model.fields[0]?.name ?? "id";
|
|
76
|
+
}
|
|
77
|
+
__name(displayFieldFor, "displayFieldFor");
|
|
78
|
+
function inverseRelationField(field, models) {
|
|
79
|
+
const relation = field.relation;
|
|
80
|
+
if (!relation?.name) return void 0;
|
|
81
|
+
const target = models.find((model) => model.name === relation.targetModel);
|
|
82
|
+
if (!target) return void 0;
|
|
83
|
+
return target.fields.find((candidate) => candidate.relation?.name === relation.name && candidate !== field);
|
|
84
|
+
}
|
|
85
|
+
__name(inverseRelationField, "inverseRelationField");
|
|
86
|
+
function relationShape(field, models) {
|
|
87
|
+
const relation = field.relation;
|
|
88
|
+
if (!relation) return void 0;
|
|
89
|
+
if (relation.cardinality === "one") return "to-one";
|
|
90
|
+
const inverse = inverseRelationField(field, models);
|
|
91
|
+
return inverse?.relation?.cardinality === "many" ? "many-to-many" : "one-to-many";
|
|
92
|
+
}
|
|
93
|
+
__name(relationShape, "relationShape");
|
|
94
|
+
function detachBlockedReason(field, models) {
|
|
95
|
+
if (relationShape(field, models) !== "one-to-many") return void 0;
|
|
96
|
+
const inverse = inverseRelationField(field, models);
|
|
97
|
+
if (!inverse?.isRequired) return void 0;
|
|
98
|
+
const target = field.relation?.targetModel ?? "the related model";
|
|
99
|
+
return `${target}.${inverse.name} is required, so a ${target} record cannot exist without one. Delete the record, or point it at something else, instead of detaching it.`;
|
|
100
|
+
}
|
|
101
|
+
__name(detachBlockedReason, "detachBlockedReason");
|
|
102
|
+
function selectModels(models, selection) {
|
|
103
|
+
if (!selection) return models;
|
|
104
|
+
const included = selection.include ? new Set(selection.include) : void 0;
|
|
105
|
+
const excluded2 = new Set(selection.exclude ?? []);
|
|
106
|
+
return models.filter((model) => (included === void 0 || included.has(model.name)) && !excluded2.has(model.name));
|
|
107
|
+
}
|
|
108
|
+
__name(selectModels, "selectModels");
|
|
109
|
+
function unknownSelectionNames(models, selection) {
|
|
110
|
+
if (!selection) return [];
|
|
111
|
+
const known = new Set(models.map((model) => model.name));
|
|
112
|
+
const referenced = [
|
|
113
|
+
...selection.include ?? [],
|
|
114
|
+
...selection.exclude ?? []
|
|
115
|
+
];
|
|
116
|
+
return [
|
|
117
|
+
...new Set(referenced.filter((name) => !known.has(name)))
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
__name(unknownSelectionNames, "unknownSelectionNames");
|
|
121
|
+
function fieldOverride(overrides, model, field) {
|
|
122
|
+
return overrides?.[model]?.fields?.[field];
|
|
123
|
+
}
|
|
124
|
+
__name(fieldOverride, "fieldOverride");
|
|
125
|
+
function isReadOnly(overrides, model, field) {
|
|
126
|
+
return field.isGenerated || fieldOverride(overrides, model, field.name)?.readOnly === true;
|
|
127
|
+
}
|
|
128
|
+
__name(isReadOnly, "isReadOnly");
|
|
129
|
+
function applyOverrides(models, overrides) {
|
|
130
|
+
if (!overrides) return models;
|
|
131
|
+
return models.map((model) => {
|
|
132
|
+
const override = overrides[model.name];
|
|
133
|
+
if (!override) return model;
|
|
134
|
+
const hidden = new Set(Object.entries(override.fields ?? {}).filter(([, field]) => field.hidden === true).map(([name]) => name));
|
|
135
|
+
const writeOnly = new Set(Object.entries(override.fields ?? {}).filter(([, field]) => field.writeOnly === true).map(([name]) => name));
|
|
136
|
+
const kept = hidden.size === 0 ? model.fields : model.fields.filter((f) => !hidden.has(f.name));
|
|
137
|
+
return {
|
|
138
|
+
...model,
|
|
139
|
+
...override.displayField !== void 0 ? {
|
|
140
|
+
displayField: override.displayField
|
|
141
|
+
} : {},
|
|
142
|
+
// Carried onto the metadata rather than looked up again later, so
|
|
143
|
+
// everything downstream - the field scope, the projection, the DTO -
|
|
144
|
+
// reads one flag instead of each re-deriving it from the configuration.
|
|
145
|
+
fields: writeOnly.size === 0 ? kept : kept.map((field) => writeOnly.has(field.name) ? {
|
|
146
|
+
...field,
|
|
147
|
+
writeOnly: true
|
|
148
|
+
} : field)
|
|
149
|
+
};
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
__name(applyOverrides, "applyOverrides");
|
|
153
|
+
function unknownOverrideNames(models, overrides) {
|
|
154
|
+
if (!overrides) return [];
|
|
155
|
+
const unknown = [];
|
|
156
|
+
for (const [modelName, override] of Object.entries(overrides)) {
|
|
157
|
+
const model = models.find((candidate) => candidate.name === modelName);
|
|
158
|
+
if (!model) {
|
|
159
|
+
unknown.push(modelName);
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
const names = new Set(model.fields.map((field) => field.name));
|
|
163
|
+
if (override.displayField !== void 0 && !names.has(override.displayField)) {
|
|
164
|
+
unknown.push(`${modelName}.${override.displayField}`);
|
|
165
|
+
}
|
|
166
|
+
for (const fieldName of Object.keys(override.fields ?? {})) {
|
|
167
|
+
if (!names.has(fieldName)) unknown.push(`${modelName}.${fieldName}`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return unknown;
|
|
171
|
+
}
|
|
172
|
+
__name(unknownOverrideNames, "unknownOverrideNames");
|
|
173
|
+
function unwritableHiddenFields(models, overrides) {
|
|
174
|
+
if (!overrides) return [];
|
|
175
|
+
const blocked = [];
|
|
176
|
+
for (const [modelName, override] of Object.entries(overrides)) {
|
|
177
|
+
const model = models.find((candidate) => candidate.name === modelName);
|
|
178
|
+
if (!model) continue;
|
|
179
|
+
for (const [fieldName, field] of Object.entries(override.fields ?? {})) {
|
|
180
|
+
if (field.hidden !== true) continue;
|
|
181
|
+
const declared = model.fields.find((candidate) => candidate.name === fieldName);
|
|
182
|
+
if (!declared) continue;
|
|
183
|
+
if (declared.isRequired && !declared.isGenerated && declared.defaultValue === void 0) {
|
|
184
|
+
blocked.push(`${modelName}.${fieldName}`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return blocked;
|
|
189
|
+
}
|
|
190
|
+
__name(unwritableHiddenFields, "unwritableHiddenFields");
|
|
191
|
+
var BRAND = /* @__PURE__ */ Symbol.for("nest-admin.error");
|
|
192
|
+
var NestAdminError = class extends Error {
|
|
193
|
+
static {
|
|
194
|
+
__name(this, "NestAdminError");
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Which error this is.
|
|
198
|
+
*
|
|
199
|
+
* Subclasses override it with a literal. The base value covers anything that
|
|
200
|
+
* extends this class without declaring one - the Prisma schema errors, for
|
|
201
|
+
* instance - which the transport layer treats as internal.
|
|
202
|
+
*/
|
|
203
|
+
kind = "unknown";
|
|
204
|
+
constructor(message, options) {
|
|
205
|
+
super(message, options);
|
|
206
|
+
this.name = new.target.name;
|
|
207
|
+
Object.defineProperty(this, BRAND, {
|
|
208
|
+
value: true,
|
|
209
|
+
enumerable: false
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
function isNestAdminError(value) {
|
|
214
|
+
return typeof value === "object" && value !== null && value[BRAND] === true;
|
|
215
|
+
}
|
|
216
|
+
__name(isNestAdminError, "isNestAdminError");
|
|
217
|
+
var ModelNotFoundError = class extends NestAdminError {
|
|
218
|
+
static {
|
|
219
|
+
__name(this, "ModelNotFoundError");
|
|
220
|
+
}
|
|
221
|
+
constructor(model, availableModels = []) {
|
|
222
|
+
const known = availableModels.length > 0 ? ` Known models: ${availableModels.join(", ")}.` : "";
|
|
223
|
+
super(`Unknown model "${model}".${known}`);
|
|
224
|
+
this.model = model;
|
|
225
|
+
this.availableModels = availableModels;
|
|
226
|
+
}
|
|
227
|
+
model;
|
|
228
|
+
availableModels;
|
|
229
|
+
kind = "model-not-found";
|
|
230
|
+
};
|
|
231
|
+
var FieldNotFoundError = class extends NestAdminError {
|
|
232
|
+
static {
|
|
233
|
+
__name(this, "FieldNotFoundError");
|
|
234
|
+
}
|
|
235
|
+
constructor(model, field, reason) {
|
|
236
|
+
super(`Unknown field "${field}" on model "${model}".${reason ? ` ${reason}` : ""}`);
|
|
237
|
+
this.model = model;
|
|
238
|
+
this.field = field;
|
|
239
|
+
}
|
|
240
|
+
model;
|
|
241
|
+
field;
|
|
242
|
+
kind = "field-not-found";
|
|
243
|
+
};
|
|
244
|
+
var RecordNotFoundError = class extends NestAdminError {
|
|
245
|
+
static {
|
|
246
|
+
__name(this, "RecordNotFoundError");
|
|
247
|
+
}
|
|
248
|
+
constructor(model, id) {
|
|
249
|
+
super(`No ${model} record found for id ${JSON.stringify(id)}.`);
|
|
250
|
+
this.model = model;
|
|
251
|
+
this.id = id;
|
|
252
|
+
}
|
|
253
|
+
model;
|
|
254
|
+
id;
|
|
255
|
+
kind = "record-not-found";
|
|
256
|
+
};
|
|
257
|
+
var InvalidQueryError = class extends NestAdminError {
|
|
258
|
+
static {
|
|
259
|
+
__name(this, "InvalidQueryError");
|
|
260
|
+
}
|
|
261
|
+
kind = "invalid-query";
|
|
262
|
+
};
|
|
263
|
+
var ValidationError = class extends NestAdminError {
|
|
264
|
+
static {
|
|
265
|
+
__name(this, "ValidationError");
|
|
266
|
+
}
|
|
267
|
+
constructor(message, fields = [], options) {
|
|
268
|
+
super(message, options);
|
|
269
|
+
this.fields = fields;
|
|
270
|
+
}
|
|
271
|
+
fields;
|
|
272
|
+
kind = "validation";
|
|
273
|
+
};
|
|
274
|
+
var ConstraintError = class extends NestAdminError {
|
|
275
|
+
static {
|
|
276
|
+
__name(this, "ConstraintError");
|
|
277
|
+
}
|
|
278
|
+
constructor(constraint, model, fields = []) {
|
|
279
|
+
super(describeConstraint(constraint, model, fields));
|
|
280
|
+
this.constraint = constraint;
|
|
281
|
+
this.model = model;
|
|
282
|
+
this.fields = fields;
|
|
283
|
+
}
|
|
284
|
+
constraint;
|
|
285
|
+
model;
|
|
286
|
+
fields;
|
|
287
|
+
kind = "constraint";
|
|
288
|
+
};
|
|
289
|
+
function describeConstraint(constraint, model, fields) {
|
|
290
|
+
const named = fields.length > 0 ? fields.join(", ") : void 0;
|
|
291
|
+
switch (constraint) {
|
|
292
|
+
case "unique":
|
|
293
|
+
return named ? `Another ${model} already has this ${named}.` : `Another ${model} already has one of these values.`;
|
|
294
|
+
case "foreign-key":
|
|
295
|
+
return named ? `The ${named} does not refer to an existing record, or the record it refers to is still in use.` : `A reference on this ${model} does not point at an existing record, or is still in use.`;
|
|
296
|
+
case "required":
|
|
297
|
+
return named ? `${named} is required.` : `A required value on this ${model} is missing.`;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
__name(describeConstraint, "describeConstraint");
|
|
301
|
+
var AdapterError = class extends NestAdminError {
|
|
302
|
+
static {
|
|
303
|
+
__name(this, "AdapterError");
|
|
304
|
+
}
|
|
305
|
+
kind = "adapter";
|
|
306
|
+
constructor(message, options) {
|
|
307
|
+
super(message, options);
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
var UnauthorizedError = class extends NestAdminError {
|
|
311
|
+
static {
|
|
312
|
+
__name(this, "UnauthorizedError");
|
|
313
|
+
}
|
|
314
|
+
kind = "unauthorized";
|
|
315
|
+
constructor(message = "Authentication is required to access the admin API.") {
|
|
316
|
+
super(message);
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
var ForbiddenError = class extends NestAdminError {
|
|
320
|
+
static {
|
|
321
|
+
__name(this, "ForbiddenError");
|
|
322
|
+
}
|
|
323
|
+
kind = "forbidden";
|
|
324
|
+
constructor(message = "You do not have permission to access the admin API.") {
|
|
325
|
+
super(message);
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
export {
|
|
330
|
+
__name,
|
|
331
|
+
summarise,
|
|
332
|
+
createdFieldFor,
|
|
333
|
+
displayFieldFor,
|
|
334
|
+
inverseRelationField,
|
|
335
|
+
relationShape,
|
|
336
|
+
detachBlockedReason,
|
|
337
|
+
selectModels,
|
|
338
|
+
unknownSelectionNames,
|
|
339
|
+
fieldOverride,
|
|
340
|
+
isReadOnly,
|
|
341
|
+
applyOverrides,
|
|
342
|
+
unknownOverrideNames,
|
|
343
|
+
unwritableHiddenFields,
|
|
344
|
+
NestAdminError,
|
|
345
|
+
isNestAdminError,
|
|
346
|
+
ModelNotFoundError,
|
|
347
|
+
FieldNotFoundError,
|
|
348
|
+
RecordNotFoundError,
|
|
349
|
+
InvalidQueryError,
|
|
350
|
+
ValidationError,
|
|
351
|
+
ConstraintError,
|
|
352
|
+
AdapterError,
|
|
353
|
+
UnauthorizedError,
|
|
354
|
+
ForbiddenError
|
|
355
|
+
};
|
|
356
|
+
//# sourceMappingURL=chunk-7IXLRGGQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../core/src/auth/account.ts","../../core/src/metadata/created-field.ts","../../core/src/metadata/display-field.ts","../../core/src/metadata/relation-shape.ts","../../core/src/config/resources.ts","../../core/src/config/overrides.ts","../../core/src/errors/errors.ts"],"sourcesContent":["/**\n * Where admin accounts live, as a contract.\n *\n * ## Why this exists at all\n *\n * Until 0.9.0 the answer to \"who may open the admin?\" was always the host\n * application's: it already had sessions, and `AdminAuth` asked it one\n * question. That is still right for a team that has an identity system, and\n * nothing about it changes.\n *\n * It is a wall for everyone else. An application with no login of its own had\n * to write a password hash, a session cookie and a form before the admin could\n * go anywhere near production - which is a strange thing to ask of a package\n * whose whole claim is that you do not build an admin.\n *\n * ## Why it is a contract rather than a table\n *\n * The same reason `OrmAdapter` is. An admin whose accounts can only live in\n * Prisma has learned about Prisma, and the second ORM would find out the hard\n * way. Everything here is plain data and promises; nothing knows what a\n * database is.\n *\n * ## These accounts are not the application's users\n *\n * Deliberately, and this is the point most worth getting right. The people who\n * administer a system are usually not rows in the table they administer, and\n * conflating the two means a customer record with a password that opens the\n * admin. The store is separate storage - a different model, or a different\n * database entirely - and the admin never reads or writes the application's\n * own users to decide who may sign in.\n */\n\n/** One account that may sign in to the admin. */\nexport interface AdminAccount {\n readonly id: string\n\n /**\n * What is typed into the login form.\n *\n * Called `email` because that is what it almost always is, and a name people\n * recognise is worth more than one that covers a case nobody has. A store is\n * free to hold usernames in it.\n */\n readonly email: string\n\n /** Shown in the interface. Falls back to the email when absent. */\n readonly name?: string | undefined\n\n /**\n * The stored password hash, in whatever form the hasher produced.\n *\n * Read by the sign-in check and by nothing else. It must never reach a\n * response, and the account the interface is told about is a projection that\n * does not include it.\n */\n readonly passwordHash: string\n\n /**\n * Suspended without being deleted.\n *\n * Distinct from removing the row: an account that has done things is worth\n * keeping for the record, and \"cannot sign in\" is not the same fact as\n * \"never existed\".\n */\n readonly disabled?: boolean | undefined\n}\n\n/**\n * The account as the interface may see it.\n *\n * A separate type rather than a comment on {@link AdminAccount}, because \"do\n * not send the hash\" is a rule that gets forgotten and a type that cannot\n * carry it does not.\n */\nexport interface AdminAccountSummary {\n readonly id: string\n readonly email: string\n readonly name?: string | undefined\n}\n\n/** Everything but the hash. The only shape that may reach a client. */\nexport function summarise(account: AdminAccount): AdminAccountSummary {\n return {\n id: account.id,\n email: account.email,\n ...(account.name !== undefined ? { name: account.name } : {}),\n }\n}\n\n/**\n * How the admin reaches its accounts.\n *\n * Read-only by design. Creating and editing accounts is the application's\n * business: it owns the storage, it knows whether that is a migration, a seed\n * script or a form somewhere else, and an admin that could mint its own\n * administrators is an escalation waiting for its first mistake.\n */\nexport interface AdminAccountStore {\n /**\n * Find an account by what was typed into the login form.\n *\n * Matching is the store's decision, and it should be case-insensitive on the\n * local part in practice: someone who registered as `Ada@example.com` will\n * type `ada@example.com` eventually.\n *\n * Returns `null` when there is none. The caller must not behave observably\n * differently for `null` than for a wrong password - see the sign-in code.\n */\n findByEmail(email: string): Promise<AdminAccount | null>\n\n /**\n * Find an account by its id, for a request that arrives with a session.\n *\n * Called on every authenticated request, so it should be cheap. It is also\n * what makes a disabled or deleted account stop working immediately rather\n * than when its session happens to expire.\n */\n findById(id: string): Promise<AdminAccount | null>\n\n /**\n * How many accounts exist.\n *\n * Used once, at startup, to say so when the answer is zero - an admin nobody\n * can sign in to is a configuration mistake that otherwise announces itself\n * as a login form that rejects everything.\n */\n count(): Promise<number>\n\n /**\n * Note that an account signed in. Optional.\n *\n * A store that does not care about this can leave it out; the sign-in path\n * does not wait for it and a failure is logged rather than surfaced, because\n * \"your login worked but we could not write down that it did\" is not\n * something the person signing in can act on.\n */\n recordLogin?(id: string): Promise<void>\n\n /**\n * What this store reads, for diagnostics. Optional.\n *\n * A model name, a table, a directory - whatever names the storage in a way a\n * person would recognise. It exists so a startup check can say something\n * useful rather than something generic: an admin that exposes its own\n * account model as an editable resource is an escalation, and a warning that\n * cannot name the model is a warning nobody acts on.\n *\n * Never used to decide anything, and never sent to a client.\n */\n readonly describes?: string\n}\n","/**\n * Which field records when a row appeared.\n *\n * A dashboard's most useful question is \"how much of this arrived recently\",\n * and answering it needs one column: the timestamp a record was created. Every\n * conventional schema has one and none of them declare it as such.\n *\n * ## Why this is a guess\n *\n * The metadata cannot tell a creation timestamp from any other generated date.\n * Prisma reports both `@default(now())` and `@updatedAt` the same way - the\n * adapter collapses them into `isGenerated`, because for *editing* they are the\n * same thing: neither is asked of a person. That is the right call for a form\n * and leaves nothing to distinguish them here.\n *\n * So this reads names, exactly as `displayFieldFor` does, and for the same\n * reason: the convention is near-universal and the alternative is a dashboard\n * that shows nothing until every application has annotated its schema.\n *\n * ## What it refuses to guess\n *\n * `updatedAt` and its variants are excluded rather than merely ranked lower. A\n * chart of \"records updated per day\" plotted under the heading \"new records\"\n * is worse than no chart: it is confidently wrong, and nothing about it looks\n * wrong. Where the convention is not followed, the answer is `undefined` and\n * the widget is simply not offered.\n */\nimport type { FieldMetadata, ModelMetadata } from './model.js'\n\n/**\n * Names that mean \"when this was created\", most conventional first.\n *\n * Snake case is included because a schema mapped onto an existing database\n * often keeps the column names it found there.\n */\nconst CREATED = ['createdAt', 'created_at', 'created', 'createdOn', 'insertedAt', 'inserted_at']\n\n/**\n * Names that must never be taken for it.\n *\n * Checked case-insensitively and by prefix, so `updatedAt`, `updated_at` and\n * `updateTime` are all excluded. Being wrong here is silent: a chart titled\n * \"new this month\" that is actually counting edits.\n */\nconst NOT_CREATED = ['updated', 'modified', 'deleted', 'archived', 'expires', 'expired']\n\nfunction isDate(field: FieldMetadata): boolean {\n return field.kind === 'datetime' && !field.isList && !field.relation\n}\n\nfunction excluded(name: string): boolean {\n const lower = name.toLowerCase()\n return NOT_CREATED.some((word) => lower.startsWith(word))\n}\n\n/**\n * The field that records when a record of this model was created, if the model\n * follows the convention.\n *\n * Order of preference:\n *\n * 1. a conventional name, most conventional first;\n * 2. the only remaining generated date on the model - a model with exactly\n * one date the database fills in has no ambiguity to resolve;\n * 3. nothing.\n *\n * The third is a real answer. A widget that cannot be built correctly is not\n * offered, which is a better outcome than one built on a column that means\n * something else.\n */\nexport function createdFieldFor(model: ModelMetadata): string | undefined {\n const dates = model.fields.filter(isDate)\n\n for (const conventional of CREATED) {\n const match = dates.find((field) => field.name.toLowerCase() === conventional.toLowerCase())\n if (match) return match.name\n }\n\n const generated = dates.filter((field) => field.isGenerated && !excluded(field.name))\n return generated.length === 1 ? generated[0]?.name : undefined\n}\n","/**\n * Which field names a record when it has to be referred to in one line.\n *\n * A relation is stored as an id, and an id is not something a person can read.\n * An admin that renders `cmtf50g710000mocjbygyfyfr` where it means \"Ada\n * Lovelace\" is technically correct and useless, so every model needs one field\n * that stands for the record.\n *\n * The rule lives in Core rather than in an adapter because it is a question\n * about a *model*, not about an ORM: the same reasoning applies whatever\n * produced the metadata. Two places need the answer and must agree on it - the\n * adapter, which selects the column when loading a relation, and the metadata\n * document, which tells the UI what to render.\n */\nimport type { FieldMetadata, ModelMetadata } from './model.js'\n\n/**\n * Conventional names for \"the human-readable one\", most specific first.\n *\n * Ordered by how strongly the name implies a label. `name` and `title` are\n * unambiguous; `email` is a real identifier people recognise; `slug` is a\n * last resort among the conventional names because it is machine-shaped, but\n * it is still readable, which an id is not.\n */\nconst CONVENTIONAL = ['name', 'title', 'label', 'displayName', 'username', 'email', 'slug']\n\n/** Could this field stand in for the record in a list or a dropdown? */\nfunction isReadable(field: FieldMetadata): boolean {\n return (\n field.kind === 'string' &&\n !field.isList &&\n !field.relation &&\n // A generated string is a cuid or a uuid: readable characters, no meaning.\n !field.isGenerated\n )\n}\n\n/**\n * Pick the field that names a record of this model.\n *\n * Order of preference:\n *\n * 1. a conventional name (`name`, `title`, ...), most specific first;\n * 2. any other unique string - unique suggests it identifies the record;\n * 3. any other plain string;\n * 4. the first primary-key field.\n *\n * The last step is the honest fallback rather than a good answer: a model with\n * nothing but an id and a timestamp has no readable field, and showing the id\n * is better than showing nothing. Adapters and applications may override the\n * result; this is the default, not a rule.\n */\nexport function displayFieldFor(model: ModelMetadata): string {\n // A declared choice wins outright. The rule below is a guess, and the\n // application knows things the schema does not.\n if (model.displayField !== undefined) return model.displayField\n\n const readable = model.fields.filter(isReadable)\n\n for (const candidate of CONVENTIONAL) {\n const match = readable.find((field) => field.name === candidate)\n if (match) return match.name\n }\n\n const unique = readable.find((field) => field.isUnique && !field.isId)\n if (unique) return unique.name\n\n const plain = readable.find((field) => !field.isId)\n if (plain) return plain.name\n\n return model.primaryKey[0] ?? model.fields[0]?.name ?? 'id'\n}\n","/**\n * Reading a to-many relation from the parent's side.\n *\n * From `User`, both `posts` (one-to-many) and `Post.tags` (many-to-many) look\n * identical: a list of related records. What differs is where the link is\n * stored, and therefore what changing it means.\n *\n * one-to-many the child owns a column. Attaching a post to a user rewrites\n * `post.authorId`, which also *detaches it from whoever had it*.\n * Detaching means clearing that column, which is impossible if\n * it is required.\n *\n * many-to-many neither side owns a column; the link lives in a join table.\n * Attaching and detaching add and remove a row there and change\n * nothing about either record.\n *\n * An interface that offers the same buttons for both is lying about one of\n * them, so the difference is resolved here, once, from metadata both adapters\n * already produce.\n */\nimport type { FieldMetadata, ModelMetadata } from './model.js'\n\nexport type RelationShape = 'to-one' | 'one-to-many' | 'many-to-many'\n\n/**\n * The field on the target model that is the other half of this relation.\n *\n * Matched by relation name, which is the only reliable pairing: two relations\n * between the same models (`author` and `reviewer`, both to `User`) are\n * otherwise indistinguishable. Returns `undefined` when the name is absent -\n * an adapter that does not supply one - or when the target is not in `models`.\n */\nexport function inverseRelationField(\n field: FieldMetadata,\n models: readonly ModelMetadata[],\n): FieldMetadata | undefined {\n const relation = field.relation\n if (!relation?.name) return undefined\n\n const target = models.find((model) => model.name === relation.targetModel)\n if (!target) return undefined\n\n return target.fields.find(\n (candidate) => candidate.relation?.name === relation.name && candidate !== field,\n )\n}\n\n/**\n * What kind of relation this is, from the side the field is declared on.\n *\n * A to-many whose other half is also a list is a many-to-many. Without an\n * inverse to look at - no relation name, or a target outside this admin - a\n * to-many is reported as `one-to-many`, the more conservative answer: it is the\n * shape whose write operations have preconditions, so treating a many-to-many\n * as one costs a refused detach rather than a corrupted record.\n */\nexport function relationShape(\n field: FieldMetadata,\n models: readonly ModelMetadata[],\n): RelationShape | undefined {\n const relation = field.relation\n if (!relation) return undefined\n if (relation.cardinality === 'one') return 'to-one'\n\n const inverse = inverseRelationField(field, models)\n return inverse?.relation?.cardinality === 'many' ? 'many-to-many' : 'one-to-many'\n}\n\n/**\n * Why a one-to-many relation cannot be detached, or `undefined` if it can.\n *\n * Detaching means clearing the child's foreign key, and a required column\n * cannot be cleared. The database would refuse it; saying so first is the\n * difference between \"you cannot remove this here, delete the record instead\"\n * and a constraint violation.\n */\nexport function detachBlockedReason(\n field: FieldMetadata,\n models: readonly ModelMetadata[],\n): string | undefined {\n if (relationShape(field, models) !== 'one-to-many') return undefined\n\n const inverse = inverseRelationField(field, models)\n if (!inverse?.isRequired) return undefined\n\n const target = field.relation?.targetModel ?? 'the related model'\n return (\n `${target}.${inverse.name} is required, so a ${target} record cannot exist ` +\n `without one. Delete the record, or point it at something else, instead of ` +\n `detaching it.`\n )\n}\n","/**\n * Which models the admin exposes at all.\n *\n * Distinct from resource authorization, and the two answer different questions.\n * A `ResourceSelection` is structural: it decides what the admin *is*, the same\n * for everyone, and a model outside it does not exist as far as the admin is\n * concerned. `AdminResourceAuth` is per-principal: the model exists, and this\n * caller may or may not act on it.\n *\n * That difference is visible in the response. An excluded model answers 404 -\n * there is no such resource - where a denied one answers 403.\n */\n\nexport interface ResourceSelection {\n /**\n * When present, only these models are exposed. Everything else is dropped,\n * including models added to the schema later - which is the point: an\n * allow-list does not quietly grow when someone edits the schema.\n */\n readonly include?: readonly string[]\n\n /**\n * Models removed from the selection, applied after `include`.\n *\n * The usual reason is a table that is not domain data: session stores,\n * migration bookkeeping, queue tables.\n */\n readonly exclude?: readonly string[]\n}\n\n/** Anything with a name - `ModelMetadata`, or a test's stand-in for one. */\ninterface Named {\n readonly name: string\n}\n\n/**\n * Apply a selection, preserving the adapter's own order.\n *\n * Order comes from the schema rather than from `include`, so that adding a name\n * to the list does not silently reshuffle the admin. Deciding the order models\n * appear in is a separate feature and is not this option's job.\n */\nexport function selectModels<T extends Named>(\n models: readonly T[],\n selection?: ResourceSelection,\n): readonly T[] {\n if (!selection) return models\n\n const included = selection.include ? new Set(selection.include) : undefined\n const excluded = new Set(selection.exclude ?? [])\n\n return models.filter(\n (model) => (included === undefined || included.has(model.name)) && !excluded.has(model.name),\n )\n}\n\n/**\n * Names in the selection that no model answers to.\n *\n * Worth reporting rather than ignoring: a typo in `exclude` leaves the model\n * exposed, which is the opposite of what was asked for and is invisible until\n * someone finds the table in the admin. A typo in `include` is louder - the\n * model simply never appears - but has the same cause.\n */\nexport function unknownSelectionNames<T extends Named>(\n models: readonly T[],\n selection?: ResourceSelection,\n): readonly string[] {\n if (!selection) return []\n\n const known = new Set(models.map((model) => model.name))\n const referenced = [...(selection.include ?? []), ...(selection.exclude ?? [])]\n\n return [...new Set(referenced.filter((name) => !known.has(name)))]\n}\n","/**\n * Per-model and per-field configuration.\n *\n * The schema says what a model *is*; this says how the admin should treat it.\n * Two different questions, so they are two different inputs - a column being a\n * string is a fact about the database, and that column being a password is a\n * fact about the application.\n *\n * The overrides divide into two kinds, and the difference matters:\n *\n * behaviour `hidden`, `readOnly`, `displayField`. Enforced. A hidden\n * field is removed from the metadata every layer reads, so it\n * cannot be filtered, sorted, written or returned - see\n * `applyOverrides`.\n *\n * behaviour `writeOnly` too - accepted on a write and stripped from\n * every read.\n *\n * presentation `label`, `widget`, `order`. Passed to the client, which is\n * free to ignore them. Nothing depends on them being honoured.\n *\n * Anything in the first group that were only presentation would be a security\n * hole with a reassuring name.\n */\nimport type { FieldMetadata, ModelMetadata } from '../metadata/model.js'\n\n/**\n * How a field should be edited, when its type does not say enough.\n *\n * A `string` column may be a sentence, a password, an address or a colour, and\n * the schema cannot tell them apart. Deliberately a closed list: a client has\n * to know how to render each one, so an open string would mean silently\n * falling back to a plain input and no way to notice.\n */\nexport type FieldWidget = 'textarea' | 'password' | 'email' | 'url' | 'color' | 'json'\n\nexport interface FieldOverride {\n /**\n * Remove the field from the admin entirely.\n *\n * **Enforced, not cosmetic.** The field is dropped from the metadata before\n * anything reads it, so it is absent from the schema document, rejected in\n * filters and sorts, refused in writes, and stripped from every response.\n * A password hash is the reason this exists.\n */\n readonly hidden?: boolean\n\n /** Show the field, refuse to write it. Generated columns are already this. */\n readonly readOnly?: boolean\n\n /**\n * Write the field, never read it back. The mirror of `readOnly`.\n *\n * **Enforced, not cosmetic.** The column is left out of the query the adapter\n * makes and out of the projection applied to the result, so it is absent from\n * a list, from a detail page and from the record a write returns - while\n * still being accepted in the write itself.\n *\n * A password is what this is for. `hidden` is the wrong tool: it refuses the\n * field in both directions, so a hidden password column can never be set.\n */\n readonly writeOnly?: boolean\n\n /** What to call it, when the column name is not what people call the thing. */\n readonly label?: string\n\n /** How to edit it. See {@link FieldWidget}. */\n readonly widget?: FieldWidget\n\n /** Where it sits among the others. Lower comes first; unset comes last. */\n readonly order?: number\n}\n\n/**\n * Icons a model may be given in the navigation.\n *\n * A closed list, for the same reason `FieldWidget` is one: the interface has to\n * know how to draw each name, so an open string would mean silently rendering\n * nothing and no way to notice. It is also a bundle decision - the icon set has\n * about fifteen hundred entries, and only the ones named here are shipped.\n *\n * Chosen to cover what an admin's resources usually are rather than to be\n * complete. A model with no icon is drawn without one, which is the default and\n * is not a lesser state: identical icons down a column are decoration, and the\n * navigation reads better with none than with thirty of the same shape.\n */\nexport type ModelIcon =\n | 'users'\n | 'user'\n | 'building'\n | 'box'\n | 'package'\n | 'tag'\n | 'shopping-cart'\n | 'credit-card'\n | 'receipt'\n | 'file-text'\n | 'folder'\n | 'image'\n | 'calendar'\n | 'clock'\n | 'mail'\n | 'message-square'\n | 'bell'\n | 'star'\n | 'map-pin'\n | 'globe'\n | 'settings'\n | 'key'\n | 'shield'\n | 'database'\n | 'table'\n | 'layers'\n | 'list'\n | 'chart-bar'\n | 'activity'\n | 'truck'\n | 'gift'\n | 'bookmark'\n | 'link'\n\nexport interface ModelOverride {\n /** What to call the model. */\n readonly label?: string\n\n /**\n * Which icon to show beside it in the navigation.\n *\n * Presentational: the client may ignore it, and nothing depends on it being\n * honoured. See {@link ModelIcon} for why the list is closed.\n */\n readonly icon?: ModelIcon\n\n /**\n * Which field names a record, overriding what would be detected.\n *\n * The detection rule guesses well on conventional schemas and has no way to\n * know that a `code` column is the one people recognise.\n */\n readonly displayField?: string\n\n /** Where the model sits in the resource list. Lower first; unset last. */\n readonly order?: number\n\n readonly fields?: Readonly<Record<string, FieldOverride>>\n}\n\nexport type ModelOverrides = Readonly<Record<string, ModelOverride>>\n\n/** The override for one field, if the application declared one. */\nexport function fieldOverride(\n overrides: ModelOverrides | undefined,\n model: string,\n field: string,\n): FieldOverride | undefined {\n return overrides?.[model]?.fields?.[field]\n}\n\n/** Is this field one the application refuses to write? */\nexport function isReadOnly(\n overrides: ModelOverrides | undefined,\n model: string,\n field: FieldMetadata,\n): boolean {\n // Generated values are read-only whatever the configuration says: they are\n // the database's to produce, and were never writable.\n return field.isGenerated || fieldOverride(overrides, model, field.name)?.readOnly === true\n}\n\n/**\n * The models as the admin should see them.\n *\n * Hidden fields are **removed** rather than marked, so that every layer\n * downstream is correct without knowing this option exists. The query parser\n * rejects a filter on a field it cannot find; the metadata mapper cannot\n * describe one; write validation refuses one. A flag would have needed each of\n * those to remember to check it.\n *\n * A declared `displayField` is carried through the same way, so the adapter and\n * the metadata document agree on it without either consulting the config.\n */\nexport function applyOverrides(\n models: readonly ModelMetadata[],\n overrides: ModelOverrides | undefined,\n): readonly ModelMetadata[] {\n if (!overrides) return models\n\n return models.map((model) => {\n const override = overrides[model.name]\n if (!override) return model\n\n const hidden = new Set(\n Object.entries(override.fields ?? {})\n .filter(([, field]) => field.hidden === true)\n .map(([name]) => name),\n )\n\n const writeOnly = new Set(\n Object.entries(override.fields ?? {})\n .filter(([, field]) => field.writeOnly === true)\n .map(([name]) => name),\n )\n\n const kept = hidden.size === 0 ? model.fields : model.fields.filter((f) => !hidden.has(f.name))\n\n return {\n ...model,\n ...(override.displayField !== undefined ? { displayField: override.displayField } : {}),\n // Carried onto the metadata rather than looked up again later, so\n // everything downstream - the field scope, the projection, the DTO -\n // reads one flag instead of each re-deriving it from the configuration.\n fields:\n writeOnly.size === 0\n ? kept\n : kept.map((field) =>\n writeOnly.has(field.name) ? { ...field, writeOnly: true } : field,\n ),\n }\n })\n}\n\n/**\n * Names in the configuration that no model or field answers to.\n *\n * Reported so a typo fails at startup. The cost of ignoring one is not\n * symmetrical: a mistyped `label` is invisible and harmless, but a mistyped\n * `passwordHash` leaves the real column exposed while the configuration looks\n * like it is protecting it.\n */\nexport function unknownOverrideNames(\n models: readonly ModelMetadata[],\n overrides: ModelOverrides | undefined,\n): readonly string[] {\n if (!overrides) return []\n\n const unknown: string[] = []\n\n for (const [modelName, override] of Object.entries(overrides)) {\n const model = models.find((candidate) => candidate.name === modelName)\n if (!model) {\n unknown.push(modelName)\n continue\n }\n\n const names = new Set(model.fields.map((field) => field.name))\n\n if (override.displayField !== undefined && !names.has(override.displayField)) {\n unknown.push(`${modelName}.${override.displayField}`)\n }\n\n for (const fieldName of Object.keys(override.fields ?? {})) {\n if (!names.has(fieldName)) unknown.push(`${modelName}.${fieldName}`)\n }\n }\n\n return unknown\n}\n\n/**\n * Hidden fields that make creating a record impossible.\n *\n * A column that is required, is not produced by the database, and has no\n * default is a value the *caller* must supply. Hiding it removes the only way\n * to supply it, so every create fails - and fails in the database, as a\n * constraint violation the admin can only report as an internal error.\n *\n * Reported at startup for that reason: the configuration is self-defeating, and\n * the symptom otherwise appears far from the cause.\n */\nexport function unwritableHiddenFields(\n models: readonly ModelMetadata[],\n overrides: ModelOverrides | undefined,\n): readonly string[] {\n if (!overrides) return []\n\n const blocked: string[] = []\n\n for (const [modelName, override] of Object.entries(overrides)) {\n const model = models.find((candidate) => candidate.name === modelName)\n if (!model) continue\n\n for (const [fieldName, field] of Object.entries(override.fields ?? {})) {\n if (field.hidden !== true) continue\n\n const declared = model.fields.find((candidate) => candidate.name === fieldName)\n if (!declared) continue\n\n if (declared.isRequired && !declared.isGenerated && declared.defaultValue === undefined) {\n blocked.push(`${modelName}.${fieldName}`)\n }\n }\n }\n\n return blocked\n}\n","/**\n * Framework error vocabulary.\n *\n * Deliberately small. These exist so that adapters raise ORM-independent\n * errors and the transport layer can map them to status codes without knowing\n * which ORM produced them. Resist growing this taxonomy - add a new type only\n * when a caller genuinely needs to branch on it.\n *\n * ## Why these are not identified with `instanceof`\n *\n * A published bundle can contain more than one copy of this module. The\n * package ships two CommonJS entrypoints and each inlines its own copy of\n * Core, so an error thrown inside the Prisma adapter is an instance of a\n * *different* `FieldNotFoundError` class than the one the exception filter\n * holds. `instanceof` compares class identity, so it answered `false` and\n * every adapter-raised error was mapped to a generic 500 - a caller who\n * mistyped a sort field got \"internal error\" instead of \"unknown field\".\n *\n * That was invisible to this repository's own tests, which resolve Core to a\n * single source module, and only appeared when the built package was installed\n * and run. So errors are identified by *value* rather than identity: a\n * `Symbol.for` brand, which duplicate copies agree on by definition, plus a\n * stable `kind` string. Neither depends on which copy created the object.\n *\n * `scripts/verify-packed-consumer.mjs` asserts the arrangement every release:\n * one shared copy in ESM, one per entrypoint in CJS. If that ever changes, the\n * count changes there first.\n *\n * @experimental Draft contract. Expected to change during MVP implementation.\n */\n\n/**\n * Cross-copy brand.\n *\n * `Symbol.for` resolves through the global symbol registry, so two copies of\n * this file agree on the key where two `Symbol()` calls would not.\n */\nconst BRAND = Symbol.for('nest-admin.error')\n\n/**\n * Stable discriminator for each error type.\n *\n * A declared string rather than the class, so it survives duplicate bundles,\n * and rather than `name`, so it survives minification.\n */\nexport type AdminErrorKind =\n | 'unauthorized'\n | 'forbidden'\n | 'model-not-found'\n | 'field-not-found'\n | 'record-not-found'\n | 'invalid-query'\n /** Application code refused the input. Its message reaches the client. */\n | 'validation'\n /** The database refused the write: unique, foreign key, or required. */\n | 'constraint'\n | 'adapter'\n /** A subclass that declared no kind of its own. Treated as internal. */\n | 'unknown'\n\n/**\n * Base error type. Every error raised by Nest Admin extends it so that the\n * NestJS integration can distinguish framework errors from application errors\n * without depending on concrete subclasses.\n */\nexport class NestAdminError extends Error {\n /**\n * Which error this is.\n *\n * Subclasses override it with a literal. The base value covers anything that\n * extends this class without declaring one - the Prisma schema errors, for\n * instance - which the transport layer treats as internal.\n */\n readonly kind: AdminErrorKind = 'unknown'\n\n constructor(message: string, options?: { cause?: unknown }) {\n super(message, options)\n this.name = new.target.name\n // Non-enumerable, so it can never reach a serialised response body.\n Object.defineProperty(this, BRAND, { value: true, enumerable: false })\n }\n}\n\n/**\n * Is this one of ours?\n *\n * Works across duplicate copies of this module, which `instanceof` does not.\n */\nexport function isNestAdminError(value: unknown): value is NestAdminError {\n return (\n typeof value === 'object' &&\n value !== null &&\n (value as Record<symbol, unknown>)[BRAND] === true\n )\n}\n\n/** The requested model is not part of the admin's resource set. */\nexport class ModelNotFoundError extends NestAdminError {\n override readonly kind = 'model-not-found' as const\n\n constructor(\n readonly model: string,\n readonly availableModels: readonly string[] = [],\n ) {\n const known = availableModels.length > 0 ? ` Known models: ${availableModels.join(', ')}.` : ''\n super(`Unknown model \"${model}\".${known}`)\n }\n}\n\n/** A referenced field does not exist on the model, or cannot be used this way. */\nexport class FieldNotFoundError extends NestAdminError {\n override readonly kind = 'field-not-found' as const\n\n constructor(\n readonly model: string,\n readonly field: string,\n reason?: string,\n ) {\n super(`Unknown field \"${field}\" on model \"${model}\".${reason ? ` ${reason}` : ''}`)\n }\n}\n\n/** No record matched the given identifier. */\nexport class RecordNotFoundError extends NestAdminError {\n override readonly kind = 'record-not-found' as const\n\n constructor(\n readonly model: string,\n readonly id: unknown,\n ) {\n super(`No ${model} record found for id ${JSON.stringify(id)}.`)\n }\n}\n\n/**\n * The query is structurally invalid - an unusable operator/field combination,\n * a malformed value, or a request the adapter cannot express.\n */\nexport class InvalidQueryError extends NestAdminError {\n override readonly kind = 'invalid-query' as const\n}\n\n/**\n * The input is not acceptable, and the caller should be told why.\n *\n * Raised by application code - a hook rejecting a value, a rule the schema\n * cannot express - rather than by the framework. It exists because such a\n * refusal has to reach the person who typed the value, and the alternatives are\n * wrong in one direction or the other: `InvalidQueryError` claims the *query*\n * was malformed, and anything unrecognised becomes a generic 500 with the\n * message withheld.\n *\n * The message **is** forwarded to the client, which is the point of it and also\n * the responsibility that comes with it: whatever goes in is published.\n *\n * Naming the fields it is about is optional and worth doing. An interface that\n * knows which input was refused can say so next to that input, where the person\n * is looking, instead of in a banner above a form they then have to re-read.\n */\nexport class ValidationError extends NestAdminError {\n override readonly kind = 'validation' as const\n\n constructor(\n message: string,\n /** The inputs this is about. Empty when it is about the record as a whole. */\n readonly fields: readonly string[] = [],\n options?: { cause?: unknown },\n ) {\n super(message, options)\n }\n}\n\n/**\n * What the database refused, and about which fields.\n *\n * The distinction that matters is between a request that is *wrong* and a\n * database that is *broken*. A duplicate email, a foreign key pointing at\n * nothing, a missing required value - these are ordinary mistakes a person\n * makes in a form, and until they were told apart from a real failure the admin\n * answered every one of them with \"an internal error occurred\".\n *\n * The message is built here, from the constraint and the field names, rather\n * than taken from the ORM. An ORM's own text carries file paths, generated\n * query fragments and the values that collided, none of which should be\n * published - which is exactly why the generic 500 existed in the first place.\n */\nexport type ConstraintKind =\n /** A value that has to be unique is not. */\n | 'unique'\n /** A reference points at a record that is not there, or is still referenced. */\n | 'foreign-key'\n /** A value the database requires was not supplied. */\n | 'required'\n\nexport class ConstraintError extends NestAdminError {\n override readonly kind = 'constraint' as const\n\n constructor(\n readonly constraint: ConstraintKind,\n readonly model: string,\n /** The columns involved. Empty when the ORM did not say. */\n readonly fields: readonly string[] = [],\n ) {\n super(describeConstraint(constraint, model, fields))\n }\n}\n\n/**\n * A sentence for the person who filled in the form.\n *\n * Written from the field names alone, so it is safe to forward. Where the ORM\n * did not name a field the wording stays true rather than guessing at one.\n */\nfunction describeConstraint(\n constraint: ConstraintKind,\n model: string,\n fields: readonly string[],\n): string {\n const named = fields.length > 0 ? fields.join(', ') : undefined\n\n switch (constraint) {\n case 'unique':\n return named\n ? `Another ${model} already has this ${named}.`\n : `Another ${model} already has one of these values.`\n\n case 'foreign-key':\n return named\n ? `The ${named} does not refer to an existing record, or the record it refers to is still in use.`\n : `A reference on this ${model} does not point at an existing record, or is still in use.`\n\n case 'required':\n return named ? `${named} is required.` : `A required value on this ${model} is missing.`\n }\n}\n\n/**\n * The underlying ORM or database failed. Always wraps the original error as\n * `cause` so the real failure is never lost.\n */\nexport class AdapterError extends NestAdminError {\n override readonly kind = 'adapter' as const\n\n constructor(message: string, options?: { cause?: unknown }) {\n super(message, options)\n }\n}\n\n/**\n * No authenticated identity was presented with the request.\n *\n * Raised by the host application's admin auth implementation, never by Core\n * itself - Core has no notion of a request, a header or a session, and must\n * not acquire one. It exists here so the transport layer can map it without\n * knowing which framework produced it.\n *\n * The default message is deliberately uninformative. An authentication failure\n * must not reveal whether a credential was absent, malformed, expired or\n * simply wrong.\n */\nexport class UnauthorizedError extends NestAdminError {\n override readonly kind = 'unauthorized' as const\n\n constructor(message = 'Authentication is required to access the admin API.') {\n super(message)\n }\n}\n\n/**\n * An identity was established, but it is not permitted to do this.\n *\n * Deliberately distinct from {@link UnauthorizedError}: collapsing the two\n * leaves a client unable to tell \"log in\" from \"you cannot do this\", and\n * pushes that guesswork into every consumer.\n */\nexport class ForbiddenError extends NestAdminError {\n override readonly kind = 'forbidden' as const\n\n constructor(message = 'You do not have permission to access the admin API.') {\n super(message)\n }\n}\n"],"mappings":";;;;AAiFO,SAAS,UAAU,SAA4C;AACpE,SAAO;IACL,IAAI,QAAQ;IACZ,OAAO,QAAQ;IACf,GAAI,QAAQ,SAAS,SAAY;MAAE,MAAM,QAAQ;IAAA,IAAS,CAAA;EAAC;AAE/D;AANgB;AC9ChB,IAAM,UAAU;EAAC;EAAa;EAAc;EAAW;EAAa;EAAc;;AASlF,IAAM,cAAc;EAAC;EAAW;EAAY;EAAW;EAAY;EAAW;;AAE9E,SAAS,OAAO,OAA+B;AAC7C,SAAO,MAAM,SAAS,cAAc,CAAC,MAAM,UAAU,CAAC,MAAM;AAC9D;AAFS;AAIT,SAAS,SAAS,MAAuB;AACvC,QAAM,QAAQ,KAAK,YAAA;AACnB,SAAO,YAAY,KAAK,CAAC,SAAS,MAA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