@panneau/protocol 5.0.0-alpha.31 → 5.0.0-alpha.32
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/dist/schemas/api.d.ts +1 -1
- package/dist/schemas/definition.d.ts +2 -2
- package/dist/schemas/definition.js +1 -1
- package/dist/schemas/definition.js.map +1 -1
- package/dist/schemas/index.d.ts +3 -3
- package/package.json +1 -1
- package/schema/boot.schema.json +4 -1
- package/schema/definition.schema.json +4 -1
- package/schema/openapi.json +5 -2
package/dist/schemas/api.d.ts
CHANGED
|
@@ -488,7 +488,7 @@ export declare const Session: z.ZodObject<{
|
|
|
488
488
|
email: z.ZodOptional<z.ZodString>;
|
|
489
489
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
490
490
|
abilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
491
|
-
resource: z.ZodOptional<z.ZodString
|
|
491
|
+
resource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
492
492
|
}, z.core.$loose>;
|
|
493
493
|
}, z.core.$loose>;
|
|
494
494
|
export declare const TwoFactorChallenge: z.ZodObject<{
|
|
@@ -5,7 +5,7 @@ export declare const User: z.ZodObject<{
|
|
|
5
5
|
email: z.ZodOptional<z.ZodString>;
|
|
6
6
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
7
7
|
abilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
8
|
-
resource: z.ZodOptional<z.ZodString
|
|
8
|
+
resource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
9
|
}, z.core.$loose>;
|
|
10
10
|
export declare const AuthProvider: z.ZodObject<{
|
|
11
11
|
id: z.ZodString;
|
|
@@ -810,7 +810,7 @@ export declare const Definition: z.ZodObject<{
|
|
|
810
810
|
email: z.ZodOptional<z.ZodString>;
|
|
811
811
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
812
812
|
abilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
813
|
-
resource: z.ZodOptional<z.ZodString
|
|
813
|
+
resource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
814
814
|
}, z.core.$loose>>>;
|
|
815
815
|
}, z.core.$loose>;
|
|
816
816
|
export type User = z.infer<typeof User>;
|
|
@@ -12,7 +12,7 @@ var User = z.looseObject({
|
|
|
12
12
|
email: z.string().optional(),
|
|
13
13
|
avatarUrl: z.string().optional(),
|
|
14
14
|
abilities: Abilities.optional(),
|
|
15
|
-
resource: z.string().optional().meta({ description: "The resource of users: its item with this `id` is the profile of the user. Without it, clients look for a resource `users`." })
|
|
15
|
+
resource: z.string().nullable().optional().meta({ description: "The resource of users: its item with this `id` is the profile of the user. Without it, clients look for a resource `users`. `null` when the user has no item they can edit in a resource: clients show no link to a profile." })
|
|
16
16
|
});
|
|
17
17
|
var AuthProvider = z.looseObject({
|
|
18
18
|
id: z.string().min(1),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.js","names":[],"sources":["../../src/schemas/definition.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { RESERVED_ROUTE_SEGMENTS } from '../constants';\nimport { PROTOCOL_VERSION } from '../version';\nimport { Abilities, Id } from './common';\nimport { Resource } from './resource';\nimport { DefinitionTheme } from './theme';\nimport { Widget } from './widget';\n\nexport const User = z.looseObject({\n id: Id,\n name: z.string(),\n email: z.string().optional(),\n avatarUrl: z.string().optional(),\n abilities: Abilities.optional(),\n resource: z.string().optional().meta({\n description:\n 'The resource of users: its item with this `id` is the profile of the user. Without it, clients look for a resource `users`.',\n }),\n});\n\nexport const AuthProvider = z.looseObject({\n id: z.string().min(1),\n label: z.string(),\n url: z.string().optional().meta({\n description:\n 'Where the login with this provider starts, with a full navigation. The app adds `next`, the path to come back to.',\n }),\n icon: z.string().optional(),\n});\n\nexport const AuthToken = z.looseObject({\n label: z.string().optional().meta({ description: 'Label of the field. Defaults to \"Token\".' }),\n help: z.string().optional().meta({ description: 'Help under the field: where to find it.' }),\n});\n\nexport const Auth = z.looseObject({\n mode: z.enum(['panneau', 'external']).meta({\n description: \"`panneau`: Panneau's own login pages. `external`: the site handles login.\",\n }),\n loginUrl: z\n .string()\n .nullable()\n .optional()\n .meta({ description: '`external`: where unauthenticated users are sent.' }),\n logoutUrl: z.string().nullable().optional().meta({\n description:\n \"`external`: where the browser goes to log out, the site's own logout. Without it, the app offers no logout.\",\n }),\n password: z.boolean().optional().meta({\n description:\n '`panneau`: a login with an email and a password. Defaults to true without `token`.',\n }),\n token: AuthToken.optional().meta({\n description:\n '`panneau`: a login with a single secret, such as an access token, sent as `token` to `POST /auth/login`.',\n }),\n providers: z.array(AuthProvider).optional(),\n account: z.boolean().optional().meta({\n description:\n '`panneau`: the account page of the user, on `/account`: their name and email, their password, their two-factor authentication.',\n }),\n passwordReset: z.boolean().optional().meta({\n description:\n '`panneau`: a \"Forgot your password?\" link on the login page, through `POST /auth/password/forgot` and `POST /auth/password/reset`.',\n }),\n twoFactor: z.boolean().optional().meta({\n description:\n '`panneau`: two-factor authentication, which users set up through `/account/two-factor`, and which a password login asks for with a `202`.',\n }),\n passkeys: z.boolean().optional().meta({\n description:\n '`panneau`: logins with a passkey (WebAuthn), which users add on the account page.',\n }),\n emailVerification: z.boolean().optional().meta({\n description:\n \"`panneau`: the backend refuses users whose email address isn't verified with a `403` problem of type `urn:panneau:problem:email-unverified`, and verifies it through `POST /auth/email/verification` and `POST /auth/email/verify`.\",\n }),\n});\n\nexport const MenuItem = z\n .looseObject({\n type: z.string().min(1).meta({\n description: 'Built-in: `resources`, `resource`, `page`, `link`, `separator`, `group`.',\n }),\n label: z.string().optional(),\n icon: z.string().optional(),\n resource: z.string().optional(),\n page: z.string().optional(),\n url: z.string().optional(),\n external: z.boolean().optional(),\n // The return type is written out so that declaration files keep the recursion.\n get children(): z.ZodOptional<z.ZodArray<typeof MenuItem>> {\n return z.array(MenuItem).optional();\n },\n })\n .meta({ description: 'An entry of a menu.' });\n\nexport const Page = z.looseObject({\n component: z\n .string()\n .min(1)\n .meta({ description: 'A page provided by a plugin, or a built-in page.' }),\n path: z.string().optional().meta({ description: 'Path of a custom page.' }),\n label: z.string().optional(),\n props: z.record(z.string(), z.unknown()).optional(),\n params: z\n .array(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/))\n .optional()\n .meta({\n description:\n 'Names of the path segments after the page: `[\"id\"]` makes `{basePath}/pages/{page}/{id}`. The component gets them as `params`, and route references (`{ \"route\": \"<page>\", \"params\": { \"id\": … } }`) can link to the page. A page with `params` is not in menus.',\n }),\n abilities: Abilities.optional().meta({\n description:\n 'What the current user can do with the page (decision 0046). `view: false` leaves it out of menus, and its route shows a forbidden state; `pages.home` falls back to the built-in home. Without it, the page is allowed.',\n }),\n});\n\nexport const ContextOption = z\n .looseObject({\n value: z.string().min(1),\n label: z.string(),\n description: z.string().optional(),\n })\n .meta({ description: 'A choice of a param of the context.' });\n\nexport const ContextParam = z\n .looseObject({\n name: z\n .string()\n .regex(\n new RegExp(`^(?!(?:${RESERVED_ROUTE_SEGMENTS.join('|')})$)[A-Za-z_][A-Za-z0-9_]*$`),\n )\n .meta({\n description:\n 'The name of the param, in the `Panneau-Context` header and in the client routes (`{basePath}/{name}/{value}/…`): an identifier, not a reserved first segment of the routes.',\n }),\n label: z.string(),\n required: z.boolean().optional().meta({\n description:\n 'Whether the app needs a value: without one, it shows a page to pick it in place of the page of the route.',\n }),\n fixed: z.boolean().optional().meta({\n description:\n 'The backend sets the value from the request, such as its domain: the app shows it without a picker, and leaves it out of the path and of the `Panneau-Context` header. Another value in the header is a `403` context problem. A fixed param has a `value`.',\n }),\n allLabel: z.string().optional().meta({\n description: 'An optional param: the label of no value, such as \"All clients\".',\n }),\n options: z.array(ContextOption).optional().meta({\n description:\n 'The choices, inline. Without them, the client searches them with `GET /context/{name}/options`.',\n }),\n value: z.string().min(1).nullable().optional().meta({\n description:\n 'The value the definition was built for: the one the client sent, checked, or the one the backend chose for a required param.',\n }),\n valueLabel: z\n .string()\n .nullable()\n .optional()\n .meta({ description: 'The label of `value`, for the picker.' }),\n })\n .meta({ description: 'A param of the current context (decision 0045).' });\n\nexport const DefinitionContext = z\n .looseObject({\n params: z.array(ContextParam).min(1).meta({\n description:\n 'In order: each param depends on the params before it. The params are the same whatever the values.',\n }),\n })\n .meta({\n description:\n 'The current context the user picks in the app, sent with every request in the `Panneau-Context` header (decision 0045).',\n });\n\nexport const Uploads = z.looseObject({\n mode: z.enum(['multipart', 'tus', 'presigned']).meta({\n description:\n '`multipart`: files go through `POST /media` and the requests that take them. `presigned`: the browser also sends files to storage itself, with URLs that `POST /uploads/sign` signs, then `POST /uploads/{upload}/complete` gives an upload that values reference.',\n }),\n endpoint: z.string().optional().meta({\n description:\n '`presigned`: the base URL of the upload routes, when they are not `{api.baseUrl}/uploads`.',\n }),\n maxSize: z.number().int().positive().optional(),\n});\n\nexport const Definition = z\n .looseObject({\n protocol: z.literal(PROTOCOL_VERSION),\n name: z.string(),\n locale: z\n .string()\n .min(2)\n .meta({ description: 'BCP 47 locale of the labels and messages.' }),\n locales: z\n .array(z.string().min(2))\n .min(1)\n .meta({ description: 'Locales of localized content fields.' }),\n api: z.looseObject({ baseUrl: z.string() }),\n resources: z.array(Resource),\n pages: z.record(z.string(), Page).optional(),\n menus: z.record(z.string(), z.array(MenuItem)).optional(),\n routes: z.record(z.string(), z.string()).optional().meta({\n description: 'Named paths of the frontend, for `link` actions and redirects.',\n }),\n auth: Auth.optional(),\n dashboard: z\n .looseObject({ widgets: z.array(Widget) })\n .optional()\n .meta({\n description:\n 'The widgets of the home page for the user, in order, when `pages.home` is the `dashboard` (decision 0064).',\n }),\n search: z.looseObject({ enabled: z.boolean() }).optional(),\n uploads: Uploads.optional(),\n context: DefinitionContext.optional(),\n theme: DefinitionTheme.optional(),\n user: User.nullable().optional(),\n })\n .superRefine((definition, context) => {\n const ids = new Set<string>();\n definition.resources.forEach((resource, index) => {\n if (ids.has(resource.id)) {\n context.addIssue({\n code: 'custom',\n message: `Duplicate resource id \\`${resource.id}\\`.`,\n path: ['resources', index, 'id'],\n });\n }\n ids.add(resource.id);\n });\n const names = new Set<string>();\n definition.context?.params.forEach((param, index) => {\n if (names.has(param.name)) {\n context.addIssue({\n code: 'custom',\n message: `Duplicate context param \\`${param.name}\\`.`,\n path: ['context', 'params', index, 'name'],\n });\n }\n names.add(param.name);\n if (param.fixed === true && (param.value ?? null) === null) {\n context.addIssue({\n code: 'custom',\n message: `The context param \\`${param.name}\\` is fixed without a value.`,\n path: ['context', 'params', index, 'value'],\n });\n }\n });\n })\n .meta({ description: 'Everything a frontend needs to render the admin for the current user.' });\n\nexport type User = z.infer<typeof User>;\nexport type AuthProvider = z.infer<typeof AuthProvider>;\nexport type AuthToken = z.infer<typeof AuthToken>;\nexport type Auth = z.infer<typeof Auth>;\nexport type MenuItem = z.infer<typeof MenuItem>;\nexport type Page = z.infer<typeof Page>;\nexport type ContextOption = z.infer<typeof ContextOption>;\nexport type ContextParam = z.infer<typeof ContextParam>;\nexport type DefinitionContext = z.infer<typeof DefinitionContext>;\nexport type Uploads = z.infer<typeof Uploads>;\nexport type Definition = z.infer<typeof Definition>;\n/** A definition as a backend writes it, before defaults are applied. */\nexport type DefinitionInput = z.input<typeof Definition>;\n"],"mappings":";;;;;;;;AASA,IAAa,OAAO,EAAE,YAAY;CAC9B,IAAI;CACJ,MAAM,EAAE,OAAO;CACf,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,WAAW,UAAU,SAAS;CAC9B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EACjC,aACI,8HACR,CAAC;AACL,CAAC;AAED,IAAa,eAAe,EAAE,YAAY;CACtC,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC;CACpB,OAAO,EAAE,OAAO;CAChB,KAAK,EAAE,OAAO,CAA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AU;EAC9C,IAAI,IAAI,IAAI,SAAS,EAAE,GACnB,QAAQ,SAAS;GACb,MAAM;GACN,SAAS,2BAA2B,SAAS,GAAG;GAChD,MAAM;IAAC;IAAa;IAAO;GAAI;EACnC,CAAC;EAEL,IAAI,IAAI,SAAS,EAAE;CACvB,CAAC;CACD,MAAM,wBAAQ,IAAI,IAAY;CAC9B,WAAW,SAAS,OAAO,SAAS,OAAO,UAAU;EACjD,IAAI,MAAM,IAAI,MAAM,IAAI,GACpB,QAAQ,SAAS;GACb,MAAM;GACN,SAAS,6BAA6B,MAAM,KAAK;GACjD,MAAM;IAAC;IAAW;IAAU;IAAO;GAAM;EAC7C,CAAC;EAEL,MAAM,IAAI,MAAM,IAAI;EACpB,IAAI,MAAM,UAAU,SAAS,MAAM,SAAS,UAAU,MAClD,QAAQ,SAAS;GACb,MAAM;GACN,SAAS,uBAAuB,MAAM,KAAK;GAC3C,MAAM;IAAC;IAAW;IAAU;IAAO;GAAO;EAC9C,CAAC;CAET,CAAC;AACL,CAAC,CAAC,CACD,KAAK,EAAE,aAAa,wEAAwE,CAAC"}
|
|
1
|
+
{"version":3,"file":"definition.js","names":[],"sources":["../../src/schemas/definition.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { RESERVED_ROUTE_SEGMENTS } from '../constants';\nimport { PROTOCOL_VERSION } from '../version';\nimport { Abilities, Id } from './common';\nimport { Resource } from './resource';\nimport { DefinitionTheme } from './theme';\nimport { Widget } from './widget';\n\nexport const User = z.looseObject({\n id: Id,\n name: z.string(),\n email: z.string().optional(),\n avatarUrl: z.string().optional(),\n abilities: Abilities.optional(),\n resource: z.string().nullable().optional().meta({\n description:\n 'The resource of users: its item with this `id` is the profile of the user. Without it, clients look for a resource `users`. `null` when the user has no item they can edit in a resource: clients show no link to a profile.',\n }),\n});\n\nexport const AuthProvider = z.looseObject({\n id: z.string().min(1),\n label: z.string(),\n url: z.string().optional().meta({\n description:\n 'Where the login with this provider starts, with a full navigation. The app adds `next`, the path to come back to.',\n }),\n icon: z.string().optional(),\n});\n\nexport const AuthToken = z.looseObject({\n label: z.string().optional().meta({ description: 'Label of the field. Defaults to \"Token\".' }),\n help: z.string().optional().meta({ description: 'Help under the field: where to find it.' }),\n});\n\nexport const Auth = z.looseObject({\n mode: z.enum(['panneau', 'external']).meta({\n description: \"`panneau`: Panneau's own login pages. `external`: the site handles login.\",\n }),\n loginUrl: z\n .string()\n .nullable()\n .optional()\n .meta({ description: '`external`: where unauthenticated users are sent.' }),\n logoutUrl: z.string().nullable().optional().meta({\n description:\n \"`external`: where the browser goes to log out, the site's own logout. Without it, the app offers no logout.\",\n }),\n password: z.boolean().optional().meta({\n description:\n '`panneau`: a login with an email and a password. Defaults to true without `token`.',\n }),\n token: AuthToken.optional().meta({\n description:\n '`panneau`: a login with a single secret, such as an access token, sent as `token` to `POST /auth/login`.',\n }),\n providers: z.array(AuthProvider).optional(),\n account: z.boolean().optional().meta({\n description:\n '`panneau`: the account page of the user, on `/account`: their name and email, their password, their two-factor authentication.',\n }),\n passwordReset: z.boolean().optional().meta({\n description:\n '`panneau`: a \"Forgot your password?\" link on the login page, through `POST /auth/password/forgot` and `POST /auth/password/reset`.',\n }),\n twoFactor: z.boolean().optional().meta({\n description:\n '`panneau`: two-factor authentication, which users set up through `/account/two-factor`, and which a password login asks for with a `202`.',\n }),\n passkeys: z.boolean().optional().meta({\n description:\n '`panneau`: logins with a passkey (WebAuthn), which users add on the account page.',\n }),\n emailVerification: z.boolean().optional().meta({\n description:\n \"`panneau`: the backend refuses users whose email address isn't verified with a `403` problem of type `urn:panneau:problem:email-unverified`, and verifies it through `POST /auth/email/verification` and `POST /auth/email/verify`.\",\n }),\n});\n\nexport const MenuItem = z\n .looseObject({\n type: z.string().min(1).meta({\n description: 'Built-in: `resources`, `resource`, `page`, `link`, `separator`, `group`.',\n }),\n label: z.string().optional(),\n icon: z.string().optional(),\n resource: z.string().optional(),\n page: z.string().optional(),\n url: z.string().optional(),\n external: z.boolean().optional(),\n // The return type is written out so that declaration files keep the recursion.\n get children(): z.ZodOptional<z.ZodArray<typeof MenuItem>> {\n return z.array(MenuItem).optional();\n },\n })\n .meta({ description: 'An entry of a menu.' });\n\nexport const Page = z.looseObject({\n component: z\n .string()\n .min(1)\n .meta({ description: 'A page provided by a plugin, or a built-in page.' }),\n path: z.string().optional().meta({ description: 'Path of a custom page.' }),\n label: z.string().optional(),\n props: z.record(z.string(), z.unknown()).optional(),\n params: z\n .array(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/))\n .optional()\n .meta({\n description:\n 'Names of the path segments after the page: `[\"id\"]` makes `{basePath}/pages/{page}/{id}`. The component gets them as `params`, and route references (`{ \"route\": \"<page>\", \"params\": { \"id\": … } }`) can link to the page. A page with `params` is not in menus.',\n }),\n abilities: Abilities.optional().meta({\n description:\n 'What the current user can do with the page (decision 0046). `view: false` leaves it out of menus, and its route shows a forbidden state; `pages.home` falls back to the built-in home. Without it, the page is allowed.',\n }),\n});\n\nexport const ContextOption = z\n .looseObject({\n value: z.string().min(1),\n label: z.string(),\n description: z.string().optional(),\n })\n .meta({ description: 'A choice of a param of the context.' });\n\nexport const ContextParam = z\n .looseObject({\n name: z\n .string()\n .regex(\n new RegExp(`^(?!(?:${RESERVED_ROUTE_SEGMENTS.join('|')})$)[A-Za-z_][A-Za-z0-9_]*$`),\n )\n .meta({\n description:\n 'The name of the param, in the `Panneau-Context` header and in the client routes (`{basePath}/{name}/{value}/…`): an identifier, not a reserved first segment of the routes.',\n }),\n label: z.string(),\n required: z.boolean().optional().meta({\n description:\n 'Whether the app needs a value: without one, it shows a page to pick it in place of the page of the route.',\n }),\n fixed: z.boolean().optional().meta({\n description:\n 'The backend sets the value from the request, such as its domain: the app shows it without a picker, and leaves it out of the path and of the `Panneau-Context` header. Another value in the header is a `403` context problem. A fixed param has a `value`.',\n }),\n allLabel: z.string().optional().meta({\n description: 'An optional param: the label of no value, such as \"All clients\".',\n }),\n options: z.array(ContextOption).optional().meta({\n description:\n 'The choices, inline. Without them, the client searches them with `GET /context/{name}/options`.',\n }),\n value: z.string().min(1).nullable().optional().meta({\n description:\n 'The value the definition was built for: the one the client sent, checked, or the one the backend chose for a required param.',\n }),\n valueLabel: z\n .string()\n .nullable()\n .optional()\n .meta({ description: 'The label of `value`, for the picker.' }),\n })\n .meta({ description: 'A param of the current context (decision 0045).' });\n\nexport const DefinitionContext = z\n .looseObject({\n params: z.array(ContextParam).min(1).meta({\n description:\n 'In order: each param depends on the params before it. The params are the same whatever the values.',\n }),\n })\n .meta({\n description:\n 'The current context the user picks in the app, sent with every request in the `Panneau-Context` header (decision 0045).',\n });\n\nexport const Uploads = z.looseObject({\n mode: z.enum(['multipart', 'tus', 'presigned']).meta({\n description:\n '`multipart`: files go through `POST /media` and the requests that take them. `presigned`: the browser also sends files to storage itself, with URLs that `POST /uploads/sign` signs, then `POST /uploads/{upload}/complete` gives an upload that values reference.',\n }),\n endpoint: z.string().optional().meta({\n description:\n '`presigned`: the base URL of the upload routes, when they are not `{api.baseUrl}/uploads`.',\n }),\n maxSize: z.number().int().positive().optional(),\n});\n\nexport const Definition = z\n .looseObject({\n protocol: z.literal(PROTOCOL_VERSION),\n name: z.string(),\n locale: z\n .string()\n .min(2)\n .meta({ description: 'BCP 47 locale of the labels and messages.' }),\n locales: z\n .array(z.string().min(2))\n .min(1)\n .meta({ description: 'Locales of localized content fields.' }),\n api: z.looseObject({ baseUrl: z.string() }),\n resources: z.array(Resource),\n pages: z.record(z.string(), Page).optional(),\n menus: z.record(z.string(), z.array(MenuItem)).optional(),\n routes: z.record(z.string(), z.string()).optional().meta({\n description: 'Named paths of the frontend, for `link` actions and redirects.',\n }),\n auth: Auth.optional(),\n dashboard: z\n .looseObject({ widgets: z.array(Widget) })\n .optional()\n .meta({\n description:\n 'The widgets of the home page for the user, in order, when `pages.home` is the `dashboard` (decision 0064).',\n }),\n search: z.looseObject({ enabled: z.boolean() }).optional(),\n uploads: Uploads.optional(),\n context: DefinitionContext.optional(),\n theme: DefinitionTheme.optional(),\n user: User.nullable().optional(),\n })\n .superRefine((definition, context) => {\n const ids = new Set<string>();\n definition.resources.forEach((resource, index) => {\n if (ids.has(resource.id)) {\n context.addIssue({\n code: 'custom',\n message: `Duplicate resource id \\`${resource.id}\\`.`,\n path: ['resources', index, 'id'],\n });\n }\n ids.add(resource.id);\n });\n const names = new Set<string>();\n definition.context?.params.forEach((param, index) => {\n if (names.has(param.name)) {\n context.addIssue({\n code: 'custom',\n message: `Duplicate context param \\`${param.name}\\`.`,\n path: ['context', 'params', index, 'name'],\n });\n }\n names.add(param.name);\n if (param.fixed === true && (param.value ?? null) === null) {\n context.addIssue({\n code: 'custom',\n message: `The context param \\`${param.name}\\` is fixed without a value.`,\n path: ['context', 'params', index, 'value'],\n });\n }\n });\n })\n .meta({ description: 'Everything a frontend needs to render the admin for the current user.' });\n\nexport type User = z.infer<typeof User>;\nexport type AuthProvider = z.infer<typeof AuthProvider>;\nexport type AuthToken = z.infer<typeof AuthToken>;\nexport type Auth = z.infer<typeof Auth>;\nexport type MenuItem = z.infer<typeof MenuItem>;\nexport type Page = z.infer<typeof Page>;\nexport type ContextOption = z.infer<typeof ContextOption>;\nexport type ContextParam = z.infer<typeof ContextParam>;\nexport type DefinitionContext = z.infer<typeof DefinitionContext>;\nexport type Uploads = z.infer<typeof Uploads>;\nexport type Definition = z.infer<typeof Definition>;\n/** A definition as a backend writes it, before defaults are applied. */\nexport type DefinitionInput = z.input<typeof Definition>;\n"],"mappings":";;;;;;;;AASA,IAAa,OAAO,EAAE,YAAY;CAC9B,IAAI;CACJ,MAAM,EAAE,OAAO;CACf,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,WAAW,UAAU,SAAS;CAC9B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,EAC5C,aACI,+NACR,CAAC;AACL,CAAC;AAED,IAAa,eAA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C,SAAS;AACnC,CAAC,CAAC,CACD,aAAa,YAAY,YAAY;CAClC,MAAM,sBAAM,IAAI,IAAY;CAC5B,WAAW,UAAU,SAAS,UAAU,UAAU;EAC9C,IAAI,IAAI,IAAI,SAAS,EAAE,GACnB,QAAQ,SAAS;GACb,MAAM;GACN,SAAS,2BAA2B,SAAS,GAAG;GAChD,MAAM;IAAC;IAAa;IAAO;GAAI;EACnC,CAAC;EAEL,IAAI,IAAI,SAAS,EAAE;CACvB,CAAC;CACD,MAAM,wBAAQ,IAAI,IAAY;CAC9B,WAAW,SAAS,OAAO,SAAS,OAAO,UAAU;EACjD,IAAI,MAAM,IAAI,MAAM,IAAI,GACpB,QAAQ,SAAS;GACb,MAAM;GACN,SAAS,6BAA6B,MAAM,KAAK;GACjD,MAAM;IAAC;IAAW;IAAU;IAAO;GAAM;EAC7C,CAAC;EAEL,MAAM,IAAI,MAAM,IAAI;EACpB,IAAI,MAAM,UAAU,SAAS,MAAM,SAAS,UAAU,MAClD,QAAQ,SAAS;GACb,MAAM;GACN,SAAS,uBAAuB,MAAM,KAAK;GAC3C,MAAM;IAAC;IAAW;IAAU;IAAO;GAAO;EAC9C,CAAC;CAET,CAAC;AACL,CAAC,CAAC,CACD,KAAK,EAAE,aAAa,wEAAwE,CAAC"}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1438,7 +1438,7 @@ export declare const namedSchemas: {
|
|
|
1438
1438
|
email: z.ZodOptional<z.ZodString>;
|
|
1439
1439
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
1440
1440
|
abilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
1441
|
-
resource: z.ZodOptional<z.ZodString
|
|
1441
|
+
resource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1442
1442
|
}, z.core.$loose>;
|
|
1443
1443
|
AuthProvider: z.ZodObject<{
|
|
1444
1444
|
id: z.ZodString;
|
|
@@ -2430,7 +2430,7 @@ export declare const namedSchemas: {
|
|
|
2430
2430
|
email: z.ZodOptional<z.ZodString>;
|
|
2431
2431
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
2432
2432
|
abilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
2433
|
-
resource: z.ZodOptional<z.ZodString
|
|
2433
|
+
resource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2434
2434
|
}, z.core.$loose>>>;
|
|
2435
2435
|
}, z.core.$loose>;
|
|
2436
2436
|
Item: z.ZodObject<{
|
|
@@ -2922,7 +2922,7 @@ export declare const namedSchemas: {
|
|
|
2922
2922
|
email: z.ZodOptional<z.ZodString>;
|
|
2923
2923
|
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
2924
2924
|
abilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
|
|
2925
|
-
resource: z.ZodOptional<z.ZodString
|
|
2925
|
+
resource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
2926
2926
|
}, z.core.$loose>;
|
|
2927
2927
|
}, z.core.$loose>;
|
|
2928
2928
|
TwoFactorChallenge: z.ZodObject<{
|
package/package.json
CHANGED
package/schema/boot.schema.json
CHANGED
package/schema/openapi.json
CHANGED
|
@@ -4975,8 +4975,11 @@
|
|
|
4975
4975
|
"$ref": "#/components/schemas/Abilities"
|
|
4976
4976
|
},
|
|
4977
4977
|
"resource": {
|
|
4978
|
-
"description": "The resource of users: its item with this `id` is the profile of the user. Without it, clients look for a resource `users`.",
|
|
4979
|
-
"type":
|
|
4978
|
+
"description": "The resource of users: its item with this `id` is the profile of the user. Without it, clients look for a resource `users`. `null` when the user has no item they can edit in a resource: clients show no link to a profile.",
|
|
4979
|
+
"type": [
|
|
4980
|
+
"string",
|
|
4981
|
+
"null"
|
|
4982
|
+
]
|
|
4980
4983
|
}
|
|
4981
4984
|
},
|
|
4982
4985
|
"required": [
|