@strapi/content-type-builder 5.42.1 → 5.43.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/dist/admin/components/AIChat/hooks/useAIFetch.js +1 -1
- package/dist/admin/components/AIChat/hooks/useAIFetch.js.map +1 -1
- package/dist/admin/components/AIChat/hooks/useAIFetch.mjs +2 -2
- package/dist/admin/components/AIChat/hooks/useAIFetch.mjs.map +1 -1
- package/dist/admin/translations/nl.json.js +100 -38
- package/dist/admin/translations/nl.json.js.map +1 -1
- package/dist/admin/translations/nl.json.mjs +100 -38
- package/dist/admin/translations/nl.json.mjs.map +1 -1
- package/dist/admin/translations/zh-Hans.json.js +215 -215
- package/dist/admin/translations/zh-Hans.json.mjs +215 -215
- package/dist/server/register.js +2 -3
- package/dist/server/register.js.map +1 -1
- package/dist/server/register.mjs +2 -3
- package/dist/server/register.mjs.map +1 -1
- package/dist/server/src/register.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -22,7 +22,7 @@ const CHAT_TOO_LONG_ERROR = 'Chat too long';
|
|
|
22
22
|
const strapiVersion = strapiAdmin.useAppInfo('useAIFetch', (state)=>state.strapiVersion);
|
|
23
23
|
const projectId = strapiAdmin.useAppInfo('useAIFetch', (state)=>state.projectId);
|
|
24
24
|
const userId = strapiAdmin.useAppInfo('useAIFetch-user', (state)=>state.userId);
|
|
25
|
-
const aiUsage = ee.
|
|
25
|
+
const aiUsage = ee.useGetAiUsageQuery(undefined, {
|
|
26
26
|
refetchOnMountOrArgChange: true
|
|
27
27
|
});
|
|
28
28
|
const [isPending, setIsPending] = React.useState(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAIFetch.js","sources":["../../../../../admin/src/components/AIChat/hooks/useAIFetch.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-namespace */\n\n/**\n * In charge of fetching data from Strapi AI endpoints\n */\n\nimport { useState } from 'react';\n\nimport { UIMessage, useChat } from '@ai-sdk/react';\nimport { useAppInfo } from '@strapi/admin/strapi-admin';\nimport { useGetAIUsageQuery } from '@strapi/admin/strapi-admin/ee';\nimport { DefaultChatTransport } from 'ai';\n\nimport { fetchAI, makeChatFetch, safeParseJson } from '../lib/aiClient';\nimport { STRAPI_AI_CHAT_URL, STRAPI_AI_URL } from '../lib/constants';\nimport { Attachment } from '../lib/types/attachments';\nimport { Schema } from '../lib/types/schema';\n\n/* -------------------------------------------------------------------------------------------------\n * Types\n * -----------------------------------------------------------------------------------------------*/\n/**\n * Chat title\n */\nexport namespace GenerateTitle {\n export interface Request {\n body: {\n chatId: string;\n message: string;\n };\n }\n export interface Response {\n data: {\n title: string;\n };\n error?: string;\n }\n}\n\n/**\n * Upload a project to the chat\n */\nexport namespace UploadProject {\n export interface Request {\n body: {\n chatId: string;\n name: string;\n type: 'code';\n files: {\n path: string;\n content: string;\n }[];\n };\n }\n export interface Response {\n data: Attachment;\n error?: string;\n }\n}\n\n/**\n * Send chat feedback\n */\nexport type FeedbackReasonIds =\n | 'invalid_schema'\n | 'bad_recommendation'\n | 'slow'\n | 'instructions_ignored'\n | 'being_lazy'\n | 'other';\n\nnamespace SendFeedback {\n export interface Request {\n body: {\n chatId: string;\n type: 'upvote' | 'downvote';\n feedback?: string;\n reasons?: FeedbackReasonIds[];\n messageId: string;\n messages: UIMessage[];\n schemas: Schema[];\n };\n }\n}\n\n/**\n * Upload media\n */\nexport namespace UploadMedia {\n export interface Request {\n body: {\n url: string; // base64 image\n filename: string;\n chatId: string;\n };\n }\n export interface Response {\n data: Attachment;\n error?: string;\n }\n}\n\n/**\n * Collection of API endpoints and their corresponding request/response types\n */\ntype AIEndpoints = {\n '/schemas/chat/generate-title': {\n request: GenerateTitle.Request;\n response: GenerateTitle.Response;\n };\n '/schemas/chat/attachment': {\n request: UploadProject.Request;\n response: UploadProject.Response;\n };\n '/schemas/chat/feedback': {\n request: SendFeedback.Request;\n response: void;\n };\n '/media/upload': {\n request: UploadMedia.Request;\n response: UploadMedia.Response;\n };\n};\n\n// Helper type to extract the request type for a given endpoint\ntype RequestType<T extends keyof AIEndpoints> = AIEndpoints[T]['request'];\n\n// Helper type to extract the response type for a given endpoint\ntype ResponseType<T extends keyof AIEndpoints> = AIEndpoints[T]['response'];\n\n/* -------------------------------------------------------------------------------------------------\n * Hooks\n * -----------------------------------------------------------------------------------------------*/\n\nexport const TOO_MANY_REQUESTS_ERROR = 'Too many requests';\nexport const LICENSE_LIMIT_REACHED_ERROR = 'License limit';\nexport const LICENSE_LIMIT_EXCEEDED_ERROR = 'AI credit limit exceeded';\nexport const CHAT_TOO_LONG_ERROR = 'Chat too long';\nexport const ATTACHMENT_TOO_BIG_ERROR = 'Attachment too big';\nexport const ATTACHMENT_NOT_FOUND_ERROR = 'Attachment not found';\nexport const INVALID_REQUEST_ERROR = 'Invalid request';\n\n/**\n * Base hook factory for making type-safe API calls to Strapi AI endpoints.\n * Creates a hook specific to a single endpoint.\n */\nexport const createAIFetchHook = <T extends keyof AIEndpoints>(endpoint: T) => {\n return () => {\n const strapiVersion = useAppInfo('useAIFetch', (state) => state.strapiVersion);\n const projectId = useAppInfo('useAIFetch', (state) => state.projectId);\n const userId = useAppInfo('useAIFetch-user', (state) => state.userId);\n const aiUsage = useGetAIUsageQuery(undefined, { refetchOnMountOrArgChange: true });\n\n const [isPending, setIsPending] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n /**\n * Make a type-safe API call to the specified Strapi AI endpoint with retry logic\n */\n const fetchData = async (\n options: Omit<RequestInit, 'body'> & Partial<RequestType<T>> & { formData?: FormData } = {}\n ): Promise<ResponseType<T> | null> => {\n setIsPending(true);\n setError(null);\n\n try {\n const fullUrl = `${STRAPI_AI_URL}${endpoint}`;\n const isJson = !!options.body && !options.formData;\n\n const response = await fetchAI(fullUrl, {\n method: 'POST',\n headers: isJson\n ? { 'Content-Type': 'application/json', ...(options.headers || {}) }\n : options.headers,\n body: options.formData\n ? options.formData\n : isJson\n ? JSON.stringify(options.body || {})\n : undefined,\n ctx: { strapiVersion, projectId, userId },\n });\n // refetch ai usage data on every successful request\n aiUsage.refetch();\n\n const body = await safeParseJson(response);\n\n if (!response.ok) {\n throw new Error(`Error: ${response.statusText}`);\n }\n return body as ResponseType<T>;\n } catch (err) {\n setError(err instanceof Error ? err.message : `Failed to fetch data from ${endpoint}`);\n return null;\n } finally {\n setIsPending(false);\n }\n };\n\n return {\n isPending,\n error,\n fetch: fetchData,\n };\n };\n};\n\n// Create specific hooks for each endpoint\nexport const useFetchGenerateTitle = createAIFetchHook('/schemas/chat/generate-title');\nexport const useFetchUploadProject = createAIFetchHook('/schemas/chat/attachment');\nexport const useFetchSendFeedback = createAIFetchHook('/schemas/chat/feedback');\nexport const useFetchUploadMedia = createAIFetchHook('/media/upload');\n\n/**\n * Hook wrapper for AI SDK's useChat with Strapi-specific configuration\n */\nexport const useAIChat: typeof useChat = (props) => {\n const strapiVersion = useAppInfo('useAIChat', (state) => state.strapiVersion);\n const projectId = useAppInfo('useAIFetch', (state) => state.projectId);\n const userId = useAppInfo('useAIChat-user', (state) => state.userId);\n\n const customFetch = makeChatFetch({ strapiVersion, projectId, userId });\n\n return useChat({\n ...props,\n transport: new DefaultChatTransport({\n api: STRAPI_AI_CHAT_URL,\n fetch: customFetch,\n }),\n });\n};\n"],"names":["TOO_MANY_REQUESTS_ERROR","LICENSE_LIMIT_REACHED_ERROR","LICENSE_LIMIT_EXCEEDED_ERROR","CHAT_TOO_LONG_ERROR","createAIFetchHook","endpoint","strapiVersion","useAppInfo","state","projectId","userId","aiUsage","useGetAIUsageQuery","undefined","refetchOnMountOrArgChange","isPending","setIsPending","useState","error","setError","fetchData","options","fullUrl","STRAPI_AI_URL","isJson","body","formData","response","fetchAI","method","headers","JSON","stringify","ctx","refetch","safeParseJson","ok","Error","statusText","err","message","fetch","useFetchGenerateTitle","useFetchUploadProject","useFetchSendFeedback","useFetchUploadMedia","useAIChat","props","customFetch","makeChatFetch","useChat","transport","DefaultChatTransport","api","STRA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AAAA,GAAsBzC,iBAAAA,CAAkB,eAAA;AAErD;;IAGO,MAAM0C,SAAAA,GAA4B,CAACC,KAAAA,GAAAA;AACxC,IAAA,MAAMzC,gBAAgBC,sBAAAA,CAAW,WAAA,EAAa,CAACC,KAAAA,GAAUA,MAAMF,aAAa,CAAA;AAC5E,IAAA,MAAMG,YAAYF,sBAAAA,CAAW,YAAA,EAAc,CAACC,KAAAA,GAAUA,MAAMC,SAAS,CAAA;AACrE,IAAA,MAAMC,SAASH,sBAAAA,CAAW,gBAAA,EAAkB,CAACC,KAAAA,GAAUA,MAAME,MAAM,CAAA;AAEnE,IAAA,MAAMsC,cAAcC,sBAAAA,CAAc;AAAE3C,QAAAA,aAAAA;AAAeG,QAAAA,SAAAA;AAAWC,QAAAA;AAAO,KAAA,CAAA;AAErE,IAAA,OAAOwC,aAAAA,CAAQ;AACb,QAAA,GAAGH,KAAK;AACRI,QAAAA,SAAAA,EAAW,IAAIC,uBAAAA,CAAqB;YAClCC,GAAAA,EAAKC,4BAAAA;YACLb,KAAAA,EAAOO;AACT,SAAA;AACF,KAAA,CAAA;AACF;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"useAIFetch.js","sources":["../../../../../admin/src/components/AIChat/hooks/useAIFetch.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-namespace */\n\n/**\n * In charge of fetching data from Strapi AI endpoints\n */\n\nimport { useState } from 'react';\n\nimport { UIMessage, useChat } from '@ai-sdk/react';\nimport { useAppInfo } from '@strapi/admin/strapi-admin';\nimport { useGetAiUsageQuery } from '@strapi/admin/strapi-admin/ee';\nimport { DefaultChatTransport } from 'ai';\n\nimport { fetchAI, makeChatFetch, safeParseJson } from '../lib/aiClient';\nimport { STRAPI_AI_CHAT_URL, STRAPI_AI_URL } from '../lib/constants';\nimport { Attachment } from '../lib/types/attachments';\nimport { Schema } from '../lib/types/schema';\n\n/* -------------------------------------------------------------------------------------------------\n * Types\n * -----------------------------------------------------------------------------------------------*/\n/**\n * Chat title\n */\nexport namespace GenerateTitle {\n export interface Request {\n body: {\n chatId: string;\n message: string;\n };\n }\n export interface Response {\n data: {\n title: string;\n };\n error?: string;\n }\n}\n\n/**\n * Upload a project to the chat\n */\nexport namespace UploadProject {\n export interface Request {\n body: {\n chatId: string;\n name: string;\n type: 'code';\n files: {\n path: string;\n content: string;\n }[];\n };\n }\n export interface Response {\n data: Attachment;\n error?: string;\n }\n}\n\n/**\n * Send chat feedback\n */\nexport type FeedbackReasonIds =\n | 'invalid_schema'\n | 'bad_recommendation'\n | 'slow'\n | 'instructions_ignored'\n | 'being_lazy'\n | 'other';\n\nnamespace SendFeedback {\n export interface Request {\n body: {\n chatId: string;\n type: 'upvote' | 'downvote';\n feedback?: string;\n reasons?: FeedbackReasonIds[];\n messageId: string;\n messages: UIMessage[];\n schemas: Schema[];\n };\n }\n}\n\n/**\n * Upload media\n */\nexport namespace UploadMedia {\n export interface Request {\n body: {\n url: string; // base64 image\n filename: string;\n chatId: string;\n };\n }\n export interface Response {\n data: Attachment;\n error?: string;\n }\n}\n\n/**\n * Collection of API endpoints and their corresponding request/response types\n */\ntype AIEndpoints = {\n '/schemas/chat/generate-title': {\n request: GenerateTitle.Request;\n response: GenerateTitle.Response;\n };\n '/schemas/chat/attachment': {\n request: UploadProject.Request;\n response: UploadProject.Response;\n };\n '/schemas/chat/feedback': {\n request: SendFeedback.Request;\n response: void;\n };\n '/media/upload': {\n request: UploadMedia.Request;\n response: UploadMedia.Response;\n };\n};\n\n// Helper type to extract the request type for a given endpoint\ntype RequestType<T extends keyof AIEndpoints> = AIEndpoints[T]['request'];\n\n// Helper type to extract the response type for a given endpoint\ntype ResponseType<T extends keyof AIEndpoints> = AIEndpoints[T]['response'];\n\n/* -------------------------------------------------------------------------------------------------\n * Hooks\n * -----------------------------------------------------------------------------------------------*/\n\nexport const TOO_MANY_REQUESTS_ERROR = 'Too many requests';\nexport const LICENSE_LIMIT_REACHED_ERROR = 'License limit';\nexport const LICENSE_LIMIT_EXCEEDED_ERROR = 'AI credit limit exceeded';\nexport const CHAT_TOO_LONG_ERROR = 'Chat too long';\nexport const ATTACHMENT_TOO_BIG_ERROR = 'Attachment too big';\nexport const ATTACHMENT_NOT_FOUND_ERROR = 'Attachment not found';\nexport const INVALID_REQUEST_ERROR = 'Invalid request';\n\n/**\n * Base hook factory for making type-safe API calls to Strapi AI endpoints.\n * Creates a hook specific to a single endpoint.\n */\nexport const createAIFetchHook = <T extends keyof AIEndpoints>(endpoint: T) => {\n return () => {\n const strapiVersion = useAppInfo('useAIFetch', (state) => state.strapiVersion);\n const projectId = useAppInfo('useAIFetch', (state) => state.projectId);\n const userId = useAppInfo('useAIFetch-user', (state) => state.userId);\n const aiUsage = useGetAiUsageQuery(undefined, { refetchOnMountOrArgChange: true });\n\n const [isPending, setIsPending] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n /**\n * Make a type-safe API call to the specified Strapi AI endpoint with retry logic\n */\n const fetchData = async (\n options: Omit<RequestInit, 'body'> & Partial<RequestType<T>> & { formData?: FormData } = {}\n ): Promise<ResponseType<T> | null> => {\n setIsPending(true);\n setError(null);\n\n try {\n const fullUrl = `${STRAPI_AI_URL}${endpoint}`;\n const isJson = !!options.body && !options.formData;\n\n const response = await fetchAI(fullUrl, {\n method: 'POST',\n headers: isJson\n ? { 'Content-Type': 'application/json', ...(options.headers || {}) }\n : options.headers,\n body: options.formData\n ? options.formData\n : isJson\n ? JSON.stringify(options.body || {})\n : undefined,\n ctx: { strapiVersion, projectId, userId },\n });\n // refetch ai usage data on every successful request\n aiUsage.refetch();\n\n const body = await safeParseJson(response);\n\n if (!response.ok) {\n throw new Error(`Error: ${response.statusText}`);\n }\n return body as ResponseType<T>;\n } catch (err) {\n setError(err instanceof Error ? err.message : `Failed to fetch data from ${endpoint}`);\n return null;\n } finally {\n setIsPending(false);\n }\n };\n\n return {\n isPending,\n error,\n fetch: fetchData,\n };\n };\n};\n\n// Create specific hooks for each endpoint\nexport const useFetchGenerateTitle = createAIFetchHook('/schemas/chat/generate-title');\nexport const useFetchUploadProject = createAIFetchHook('/schemas/chat/attachment');\nexport const useFetchSendFeedback = createAIFetchHook('/schemas/chat/feedback');\nexport const useFetchUploadMedia = createAIFetchHook('/media/upload');\n\n/**\n * Hook wrapper for AI SDK's useChat with Strapi-specific configuration\n */\nexport const useAIChat: typeof useChat = (props) => {\n const strapiVersion = useAppInfo('useAIChat', (state) => state.strapiVersion);\n const projectId = useAppInfo('useAIFetch', (state) => state.projectId);\n const userId = useAppInfo('useAIChat-user', (state) => state.userId);\n\n const customFetch = makeChatFetch({ strapiVersion, projectId, userId });\n\n return useChat({\n ...props,\n transport: new DefaultChatTransport({\n api: STRAPI_AI_CHAT_URL,\n fetch: customFetch,\n }),\n });\n};\n"],"names":["TOO_MANY_REQUESTS_ERROR","LICENSE_LIMIT_REACHED_ERROR","LICENSE_LIMIT_EXCEEDED_ERROR","CHAT_TOO_LONG_ERROR","createAIFetchHook","endpoint","strapiVersion","useAppInfo","state","projectId","userId","aiUsage","useGetAiUsageQuery","undefined","refetchOnMountOrArgChange","isPending","setIsPending","useState","error","setError","fetchData","options","fullUrl","STRAPI_AI_URL","isJson","body","formData","response","fetchAI","method","headers","JSON","stringify","ctx","refetch","safeParseJson","ok","Error","statusText","err","message","fetch","useFetchGenerateTitle","useFetchUploadProject","useFetchSendFeedback","useFetchUploadMedia","useAIChat","props","customFetch","makeChatFetch","useChat","transport","DefaultChatTransport","api","STRAPI_AI_CHAT_URL"],"mappings":";;;;;;;;;;AAkIA;;qGAIO,MAAMA,uBAAAA,GAA0B;AAChC,MAAMC,8BAA8B;AACpC,MAAMC,+BAA+B;AACrC,MAAMC,sBAAsB;AAKnC;;;IAIO,MAAMC,iBAAAA,GAAoB,CAA8BC,QAAAA,GAAAA;IAC7D,OAAO,IAAA;AACL,QAAA,MAAMC,gBAAgBC,sBAAAA,CAAW,YAAA,EAAc,CAACC,KAAAA,GAAUA,MAAMF,aAAa,CAAA;AAC7E,QAAA,M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A,EAAkB,CAACC,KAAAA,GAAUA,MAAME,MAAM,CAAA;AAEnE,IAAA,MAAMsC,cAAcC,sBAAAA,CAAc;AAAE3C,QAAAA,aAAAA;AAAeG,QAAAA,SAAAA;AAAWC,QAAAA;AAAO,KAAA,CAAA;AAErE,IAAA,OAAOwC,aAAAA,CAAQ;AACb,QAAA,GAAGH,KAAK;AACRI,QAAAA,SAAAA,EAAW,IAAIC,uBAAAA,CAAqB;YAClCC,GAAAA,EAAKC,4BAAAA;YACLb,KAAAA,EAAOO;AACT,SAAA;AACF,KAAA,CAAA;AACF;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { useChat } from '@ai-sdk/react';
|
|
3
3
|
import { useAppInfo } from '@strapi/admin/strapi-admin';
|
|
4
|
-
import {
|
|
4
|
+
import { useGetAiUsageQuery } from '@strapi/admin/strapi-admin/ee';
|
|
5
5
|
import { DefaultChatTransport } from 'ai';
|
|
6
6
|
import { makeChatFetch, fetchAI, safeParseJson } from '../lib/aiClient.mjs';
|
|
7
7
|
import { STRAPI_AI_CHAT_URL, STRAPI_AI_URL } from '../lib/constants.mjs';
|
|
@@ -20,7 +20,7 @@ const CHAT_TOO_LONG_ERROR = 'Chat too long';
|
|
|
20
20
|
const strapiVersion = useAppInfo('useAIFetch', (state)=>state.strapiVersion);
|
|
21
21
|
const projectId = useAppInfo('useAIFetch', (state)=>state.projectId);
|
|
22
22
|
const userId = useAppInfo('useAIFetch-user', (state)=>state.userId);
|
|
23
|
-
const aiUsage =
|
|
23
|
+
const aiUsage = useGetAiUsageQuery(undefined, {
|
|
24
24
|
refetchOnMountOrArgChange: true
|
|
25
25
|
});
|
|
26
26
|
const [isPending, setIsPending] = useState(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAIFetch.mjs","sources":["../../../../../admin/src/components/AIChat/hooks/useAIFetch.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-namespace */\n\n/**\n * In charge of fetching data from Strapi AI endpoints\n */\n\nimport { useState } from 'react';\n\nimport { UIMessage, useChat } from '@ai-sdk/react';\nimport { useAppInfo } from '@strapi/admin/strapi-admin';\nimport { useGetAIUsageQuery } from '@strapi/admin/strapi-admin/ee';\nimport { DefaultChatTransport } from 'ai';\n\nimport { fetchAI, makeChatFetch, safeParseJson } from '../lib/aiClient';\nimport { STRAPI_AI_CHAT_URL, STRAPI_AI_URL } from '../lib/constants';\nimport { Attachment } from '../lib/types/attachments';\nimport { Schema } from '../lib/types/schema';\n\n/* -------------------------------------------------------------------------------------------------\n * Types\n * -----------------------------------------------------------------------------------------------*/\n/**\n * Chat title\n */\nexport namespace GenerateTitle {\n export interface Request {\n body: {\n chatId: string;\n message: string;\n };\n }\n export interface Response {\n data: {\n title: string;\n };\n error?: string;\n }\n}\n\n/**\n * Upload a project to the chat\n */\nexport namespace UploadProject {\n export interface Request {\n body: {\n chatId: string;\n name: string;\n type: 'code';\n files: {\n path: string;\n content: string;\n }[];\n };\n }\n export interface Response {\n data: Attachment;\n error?: string;\n }\n}\n\n/**\n * Send chat feedback\n */\nexport type FeedbackReasonIds =\n | 'invalid_schema'\n | 'bad_recommendation'\n | 'slow'\n | 'instructions_ignored'\n | 'being_lazy'\n | 'other';\n\nnamespace SendFeedback {\n export interface Request {\n body: {\n chatId: string;\n type: 'upvote' | 'downvote';\n feedback?: string;\n reasons?: FeedbackReasonIds[];\n messageId: string;\n messages: UIMessage[];\n schemas: Schema[];\n };\n }\n}\n\n/**\n * Upload media\n */\nexport namespace UploadMedia {\n export interface Request {\n body: {\n url: string; // base64 image\n filename: string;\n chatId: string;\n };\n }\n export interface Response {\n data: Attachment;\n error?: string;\n }\n}\n\n/**\n * Collection of API endpoints and their corresponding request/response types\n */\ntype AIEndpoints = {\n '/schemas/chat/generate-title': {\n request: GenerateTitle.Request;\n response: GenerateTitle.Response;\n };\n '/schemas/chat/attachment': {\n request: UploadProject.Request;\n response: UploadProject.Response;\n };\n '/schemas/chat/feedback': {\n request: SendFeedback.Request;\n response: void;\n };\n '/media/upload': {\n request: UploadMedia.Request;\n response: UploadMedia.Response;\n };\n};\n\n// Helper type to extract the request type for a given endpoint\ntype RequestType<T extends keyof AIEndpoints> = AIEndpoints[T]['request'];\n\n// Helper type to extract the response type for a given endpoint\ntype ResponseType<T extends keyof AIEndpoints> = AIEndpoints[T]['response'];\n\n/* -------------------------------------------------------------------------------------------------\n * Hooks\n * -----------------------------------------------------------------------------------------------*/\n\nexport const TOO_MANY_REQUESTS_ERROR = 'Too many requests';\nexport const LICENSE_LIMIT_REACHED_ERROR = 'License limit';\nexport const LICENSE_LIMIT_EXCEEDED_ERROR = 'AI credit limit exceeded';\nexport const CHAT_TOO_LONG_ERROR = 'Chat too long';\nexport const ATTACHMENT_TOO_BIG_ERROR = 'Attachment too big';\nexport const ATTACHMENT_NOT_FOUND_ERROR = 'Attachment not found';\nexport const INVALID_REQUEST_ERROR = 'Invalid request';\n\n/**\n * Base hook factory for making type-safe API calls to Strapi AI endpoints.\n * Creates a hook specific to a single endpoint.\n */\nexport const createAIFetchHook = <T extends keyof AIEndpoints>(endpoint: T) => {\n return () => {\n const strapiVersion = useAppInfo('useAIFetch', (state) => state.strapiVersion);\n const projectId = useAppInfo('useAIFetch', (state) => state.projectId);\n const userId = useAppInfo('useAIFetch-user', (state) => state.userId);\n const aiUsage = useGetAIUsageQuery(undefined, { refetchOnMountOrArgChange: true });\n\n const [isPending, setIsPending] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n /**\n * Make a type-safe API call to the specified Strapi AI endpoint with retry logic\n */\n const fetchData = async (\n options: Omit<RequestInit, 'body'> & Partial<RequestType<T>> & { formData?: FormData } = {}\n ): Promise<ResponseType<T> | null> => {\n setIsPending(true);\n setError(null);\n\n try {\n const fullUrl = `${STRAPI_AI_URL}${endpoint}`;\n const isJson = !!options.body && !options.formData;\n\n const response = await fetchAI(fullUrl, {\n method: 'POST',\n headers: isJson\n ? { 'Content-Type': 'application/json', ...(options.headers || {}) }\n : options.headers,\n body: options.formData\n ? options.formData\n : isJson\n ? JSON.stringify(options.body || {})\n : undefined,\n ctx: { strapiVersion, projectId, userId },\n });\n // refetch ai usage data on every successful request\n aiUsage.refetch();\n\n const body = await safeParseJson(response);\n\n if (!response.ok) {\n throw new Error(`Error: ${response.statusText}`);\n }\n return body as ResponseType<T>;\n } catch (err) {\n setError(err instanceof Error ? err.message : `Failed to fetch data from ${endpoint}`);\n return null;\n } finally {\n setIsPending(false);\n }\n };\n\n return {\n isPending,\n error,\n fetch: fetchData,\n };\n };\n};\n\n// Create specific hooks for each endpoint\nexport const useFetchGenerateTitle = createAIFetchHook('/schemas/chat/generate-title');\nexport const useFetchUploadProject = createAIFetchHook('/schemas/chat/attachment');\nexport const useFetchSendFeedback = createAIFetchHook('/schemas/chat/feedback');\nexport const useFetchUploadMedia = createAIFetchHook('/media/upload');\n\n/**\n * Hook wrapper for AI SDK's useChat with Strapi-specific configuration\n */\nexport const useAIChat: typeof useChat = (props) => {\n const strapiVersion = useAppInfo('useAIChat', (state) => state.strapiVersion);\n const projectId = useAppInfo('useAIFetch', (state) => state.projectId);\n const userId = useAppInfo('useAIChat-user', (state) => state.userId);\n\n const customFetch = makeChatFetch({ strapiVersion, projectId, userId });\n\n return useChat({\n ...props,\n transport: new DefaultChatTransport({\n api: STRAPI_AI_CHAT_URL,\n fetch: customFetch,\n }),\n });\n};\n"],"names":["TOO_MANY_REQUESTS_ERROR","LICENSE_LIMIT_REACHED_ERROR","LICENSE_LIMIT_EXCEEDED_ERROR","CHAT_TOO_LONG_ERROR","createAIFetchHook","endpoint","strapiVersion","useAppInfo","state","projectId","userId","aiUsage","useGetAIUsageQuery","undefined","refetchOnMountOrArgChange","isPending","setIsPending","useState","error","setError","fetchData","options","fullUrl","STRAPI_AI_URL","isJson","body","formData","response","fetchAI","method","headers","JSON","stringify","ctx","refetch","safeParseJson","ok","Error","statusText","err","message","fetch","useFetchGenerateTitle","useFetchUploadProject","useFetchSendFeedback","useFetchUploadMedia","useAIChat","props","customFetch","makeChatFetch","useChat","transport","DefaultChatTransport","api","STRAPI_AI_CHAT_URL"],"mappings":";;;;;;;;AAkIA;;qGAIO,MAAMA,uBAAAA,GAA0B;AAChC,MAAMC,8BAA8B;AACpC,MAAMC,+BAA+B;AACrC,MAAMC,sBAAsB;AAKnC;;;IAIO,MAAMC,iBAAAA,GAAoB,CAA8BC,QAAAA,GAAAA;IAC7D,OAAO,IAAA;AACL,QAAA,MAAMC,gBAAgBC,UAAAA,CAAW,YAAA,EAAc,CAACC,KAAAA,GAAUA,MAAMF,aAAa,CAAA;AAC7E,QAAA,MAAMG,YAAYF,UAAAA,CAAW,YAAA,EAAc,CAACC,KAAAA,GAAUA,MAAMC,SAAS,CAAA;AACrE,QAAA,MAAMC,SAASH,UAAAA,CAAW,iBAAA,EAAmB,CAACC,KAAAA,GAAUA,MAAME,MAAM,CAAA;QACpE,MAAMC,OAAAA,GAAUC,mBAAmBC,SAAAA,EAAW;YAAEC,yBAAAA,EAA2B;AAAK,SAAA,CAAA;AAEhF,QAAA,MAAM,CAACC,SAAAA,EAAWC,YAAAA,CAAa,GAAGC,QAAAA,CAAS,KAAA,CAAA;AAC3C,QAAA,MAAM,CAACC,KAAAA,EAAOC,QAAAA,CAAS,GAAGF,QAAAA,CAAwB,IAAA,CAAA;AAElD;;AAEC,QACD,MAAMG,SAAAA,GAAY,OAChBC,OAAAA,GAAyF,EAAE,GAAA;YAE3FL,YAAAA,CAAa,IAAA,CAAA;YACbG,QAAAA,CAAS,IAAA,CAAA;YAET,IAAI;gBACF,MAAMG,OAAAA,GAAU,CAAA,EAAGC,aAAAA,CAAAA,EAAgBlB,QAAAA,CAAAA,CAAU;gBAC7C,MAAMmB,MAAAA,GAAS,CAAC,CAACH,OAAAA,CAAQI,IAAI,IAAI,CAACJ,QAAQK,QAAQ;gBAElD,MAAMC,QAAAA,GAAW,MAAMC,OAAAA,CAAQN,OAAAA,EAAS;o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AAA;AAChD,MAAMwC,oBAAAA,GAAuBxC,iBAAAA,CAAkB,wBAAA;AAC/C,MAAMyC,mBAAAA,GAAsBzC,iBAAAA,CAAkB,eAAA;AAErD;;IAGO,MAAM0C,SAAAA,GAA4B,CAACC,KAAAA,GAAAA;AACxC,IAAA,MAAMzC,gBAAgBC,UAAAA,CAAW,WAAA,EAAa,CAACC,KAAAA,GAAUA,MAAMF,aAAa,CAAA;AAC5E,IAAA,MAAMG,YAAYF,UAAAA,CAAW,YAAA,EAAc,CAACC,KAAAA,GAAUA,MAAMC,SAAS,CAAA;AACrE,IAAA,MAAMC,SAASH,UAAAA,CAAW,gBAAA,EAAkB,CAACC,KAAAA,GAAUA,MAAME,MAAM,CAAA;AAEnE,IAAA,MAAMsC,cAAcC,aAAAA,CAAc;AAAE3C,QAAAA,aAAAA;AAAeG,QAAAA,SAAAA;AAAWC,QAAAA;AAAO,KAAA,CAAA;AAErE,IAAA,OAAOwC,OAAAA,CAAQ;AACb,QAAA,GAAGH,KAAK;AACRI,QAAAA,SAAAA,EAAW,IAAIC,oBAAAA,CAAqB;YAClCC,GAAAA,EAAKC,kBAAAA;YACLb,KAAAA,EAAOO;AACT,SAAA;AACF,KAAA,CAAA;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"useAIFetch.mjs","sources":["../../../../../admin/src/components/AIChat/hooks/useAIFetch.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-namespace */\n\n/**\n * In charge of fetching data from Strapi AI endpoints\n */\n\nimport { useState } from 'react';\n\nimport { UIMessage, useChat } from '@ai-sdk/react';\nimport { useAppInfo } from '@strapi/admin/strapi-admin';\nimport { useGetAiUsageQuery } from '@strapi/admin/strapi-admin/ee';\nimport { DefaultChatTransport } from 'ai';\n\nimport { fetchAI, makeChatFetch, safeParseJson } from '../lib/aiClient';\nimport { STRAPI_AI_CHAT_URL, STRAPI_AI_URL } from '../lib/constants';\nimport { Attachment } from '../lib/types/attachments';\nimport { Schema } from '../lib/types/schema';\n\n/* -------------------------------------------------------------------------------------------------\n * Types\n * -----------------------------------------------------------------------------------------------*/\n/**\n * Chat title\n */\nexport namespace GenerateTitle {\n export interface Request {\n body: {\n chatId: string;\n message: string;\n };\n }\n export interface Response {\n data: {\n title: string;\n };\n error?: string;\n }\n}\n\n/**\n * Upload a project to the chat\n */\nexport namespace UploadProject {\n export interface Request {\n body: {\n chatId: string;\n name: string;\n type: 'code';\n files: {\n path: string;\n content: string;\n }[];\n };\n }\n export interface Response {\n data: Attachment;\n error?: string;\n }\n}\n\n/**\n * Send chat feedback\n */\nexport type FeedbackReasonIds =\n | 'invalid_schema'\n | 'bad_recommendation'\n | 'slow'\n | 'instructions_ignored'\n | 'being_lazy'\n | 'other';\n\nnamespace SendFeedback {\n export interface Request {\n body: {\n chatId: string;\n type: 'upvote' | 'downvote';\n feedback?: string;\n reasons?: FeedbackReasonIds[];\n messageId: string;\n messages: UIMessage[];\n schemas: Schema[];\n };\n }\n}\n\n/**\n * Upload media\n */\nexport namespace UploadMedia {\n export interface Request {\n body: {\n url: string; // base64 image\n filename: string;\n chatId: string;\n };\n }\n export interface Response {\n data: Attachment;\n error?: string;\n }\n}\n\n/**\n * Collection of API endpoints and their corresponding request/response types\n */\ntype AIEndpoints = {\n '/schemas/chat/generate-title': {\n request: GenerateTitle.Request;\n response: GenerateTitle.Response;\n };\n '/schemas/chat/attachment': {\n request: UploadProject.Request;\n response: UploadProject.Response;\n };\n '/schemas/chat/feedback': {\n request: SendFeedback.Request;\n response: void;\n };\n '/media/upload': {\n request: UploadMedia.Request;\n response: UploadMedia.Response;\n };\n};\n\n// Helper type to extract the request type for a given endpoint\ntype RequestType<T extends keyof AIEndpoints> = AIEndpoints[T]['request'];\n\n// Helper type to extract the response type for a given endpoint\ntype ResponseType<T extends keyof AIEndpoints> = AIEndpoints[T]['response'];\n\n/* -------------------------------------------------------------------------------------------------\n * Hooks\n * -----------------------------------------------------------------------------------------------*/\n\nexport const TOO_MANY_REQUESTS_ERROR = 'Too many requests';\nexport const LICENSE_LIMIT_REACHED_ERROR = 'License limit';\nexport const LICENSE_LIMIT_EXCEEDED_ERROR = 'AI credit limit exceeded';\nexport const CHAT_TOO_LONG_ERROR = 'Chat too long';\nexport const ATTACHMENT_TOO_BIG_ERROR = 'Attachment too big';\nexport const ATTACHMENT_NOT_FOUND_ERROR = 'Attachment not found';\nexport const INVALID_REQUEST_ERROR = 'Invalid request';\n\n/**\n * Base hook factory for making type-safe API calls to Strapi AI endpoints.\n * Creates a hook specific to a single endpoint.\n */\nexport const createAIFetchHook = <T extends keyof AIEndpoints>(endpoint: T) => {\n return () => {\n const strapiVersion = useAppInfo('useAIFetch', (state) => state.strapiVersion);\n const projectId = useAppInfo('useAIFetch', (state) => state.projectId);\n const userId = useAppInfo('useAIFetch-user', (state) => state.userId);\n const aiUsage = useGetAiUsageQuery(undefined, { refetchOnMountOrArgChange: true });\n\n const [isPending, setIsPending] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n /**\n * Make a type-safe API call to the specified Strapi AI endpoint with retry logic\n */\n const fetchData = async (\n options: Omit<RequestInit, 'body'> & Partial<RequestType<T>> & { formData?: FormData } = {}\n ): Promise<ResponseType<T> | null> => {\n setIsPending(true);\n setError(null);\n\n try {\n const fullUrl = `${STRAPI_AI_URL}${endpoint}`;\n const isJson = !!options.body && !options.formData;\n\n const response = await fetchAI(fullUrl, {\n method: 'POST',\n headers: isJson\n ? { 'Content-Type': 'application/json', ...(options.headers || {}) }\n : options.headers,\n body: options.formData\n ? options.formData\n : isJson\n ? JSON.stringify(options.body || {})\n : undefined,\n ctx: { strapiVersion, projectId, userId },\n });\n // refetch ai usage data on every successful request\n aiUsage.refetch();\n\n const body = await safeParseJson(response);\n\n if (!response.ok) {\n throw new Error(`Error: ${response.statusText}`);\n }\n return body as ResponseType<T>;\n } catch (err) {\n setError(err instanceof Error ? err.message : `Failed to fetch data from ${endpoint}`);\n return null;\n } finally {\n setIsPending(false);\n }\n };\n\n return {\n isPending,\n error,\n fetch: fetchData,\n };\n };\n};\n\n// Create specific hooks for each endpoint\nexport const useFetchGenerateTitle = createAIFetchHook('/schemas/chat/generate-title');\nexport const useFetchUploadProject = createAIFetchHook('/schemas/chat/attachment');\nexport const useFetchSendFeedback = createAIFetchHook('/schemas/chat/feedback');\nexport const useFetchUploadMedia = createAIFetchHook('/media/upload');\n\n/**\n * Hook wrapper for AI SDK's useChat with Strapi-specific configuration\n */\nexport const useAIChat: typeof useChat = (props) => {\n const strapiVersion = useAppInfo('useAIChat', (state) => state.strapiVersion);\n const projectId = useAppInfo('useAIFetch', (state) => state.projectId);\n const userId = useAppInfo('useAIChat-user', (state) => state.userId);\n\n const customFetch = makeChatFetch({ strapiVersion, projectId, userId });\n\n return useChat({\n ...props,\n transport: new DefaultChatTransport({\n api: STRAPI_AI_CHAT_URL,\n fetch: customFetch,\n }),\n });\n};\n"],"names":["TOO_MANY_REQUESTS_ERROR","LICENSE_LIMIT_REACHED_ERROR","LICENSE_LIMIT_EXCEEDED_ERROR","CHAT_TOO_LONG_ERROR","createAIFetchHook","endpoint","strapiVersion","useAppInfo","state","projectId","userId","aiUsage","useGetAiUsageQuery","undefined","refetchOnMountOrArgChange","isPending","setIsPending","useState","error","setError","fetchData","options","fullUrl","STRAPI_AI_URL","isJson","body","formData","response","fetchAI","method","headers","JSON","stringify","ctx","refetch","safeParseJson","ok","Error","statusText","err","message","fetch","useFetchGenerateTitle","useFetchUploadProject","useFetchSendFeedback","useFetchUploadMedia","useAIChat","props","customFetch","makeChatFetch","useChat","transport","DefaultChatTransport","api","STRAPI_AI_CHAT_URL"],"mappings":";;;;;;;;AAkIA;;qGAIO,MAAMA,uBAAAA,GAA0B;AAChC,MAAMC,8BAA8B;AACpC,MAAMC,+BAA+B;AACrC,MAAMC,sBAAsB;AAKnC;;;IAIO,MAAMC,iBAAAA,GAAoB,CAA8BC,QAAAA,GAAAA;IAC7D,OAAO,IAAA;AACL,QAAA,MAAMC,gBAAgBC,UAAAA,CAAW,YAAA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S,CAAA;AACrE,IAAA,MAAMC,SAASH,UAAAA,CAAW,gBAAA,EAAkB,CAACC,KAAAA,GAAUA,MAAME,MAAM,CAAA;AAEnE,IAAA,MAAMsC,cAAcC,aAAAA,CAAc;AAAE3C,QAAAA,aAAAA;AAAeG,QAAAA,SAAAA;AAAWC,QAAAA;AAAO,KAAA,CAAA;AAErE,IAAA,OAAOwC,OAAAA,CAAQ;AACb,QAAA,GAAGH,KAAK;AACRI,QAAAA,SAAAA,EAAW,IAAIC,oBAAAA,CAAqB;YAClCC,GAAAA,EAAKC,kBAAAA;YACLb,KAAAA,EAAOO;AACT,SAAA;AACF,KAAA,CAAA;AACF;;;;"}
|
|
@@ -5,6 +5,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var configurations = "Configuraties";
|
|
6
6
|
var from = "van";
|
|
7
7
|
var nl = {
|
|
8
|
+
"IconPicker.emptyState.label": "Geen iconen gevonden",
|
|
9
|
+
"IconPicker.icon.label": "Selecteer icoon {icon}",
|
|
10
|
+
"IconPicker.remove.button": "Knop om geselecteerd icoon te verwijderen",
|
|
11
|
+
"IconPicker.remove.tooltip": "Verwijder geselecteerd icoon",
|
|
12
|
+
"IconPicker.search.button.label": "Icoon zoekknop",
|
|
13
|
+
"IconPicker.search.clear.label": "Wis icoon zoekopdracht",
|
|
14
|
+
"IconPicker.search.placeholder.label": "Zoek een icoon",
|
|
15
|
+
"attribute.blocks": "Rijk tekst (Blocks)",
|
|
16
|
+
"attribute.blocks.description": "Een op JSON gebaseerde rijke teksteditor",
|
|
8
17
|
"attribute.boolean": "Boolean",
|
|
9
18
|
"attribute.boolean.description": "Ja of nee, 1 of 0, waar of onwaar",
|
|
10
19
|
"attribute.component": "Component",
|
|
@@ -32,8 +41,6 @@ var nl = {
|
|
|
32
41
|
"attribute.relation.description": "Verwijst naar een collectie type",
|
|
33
42
|
"attribute.richtext": "Rijk tekst",
|
|
34
43
|
"attribute.richtext.description": "Een rijk tekst-editor met opmaakopties",
|
|
35
|
-
"attribute.blocks": "Rijk tekst (Blocks)",
|
|
36
|
-
"attribute.blocks.description": "Een op JSON gebaseerde rijke teksteditor",
|
|
37
44
|
"attribute.text": "Tekst",
|
|
38
45
|
"attribute.text.description": "Kleine of lange tekst zoals een titel of beschrijving",
|
|
39
46
|
"attribute.time": "Tijd",
|
|
@@ -45,6 +52,51 @@ var nl = {
|
|
|
45
52
|
"button.component.create": "Maak een nieuw component",
|
|
46
53
|
"button.model.create": "Maak een nieuw collectie type",
|
|
47
54
|
"button.single-types.create": "Maak een nieuw enkel type",
|
|
55
|
+
"chat.attachments.menu.attach-image": "Afbeelding bijvoegen",
|
|
56
|
+
"chat.attachments.menu.import-code": "Code importeren",
|
|
57
|
+
"chat.attachments.menu.import-figma": "Importeren vanuit Figma",
|
|
58
|
+
"chat.code-upload.description": "Je app zal worden geanalyseerd door AI. Zorg ervoor dat je alle gevoelige gegevens verwijdert voor het importeren.",
|
|
59
|
+
"chat.code-upload.drop-zone": "Drop .zip bestand hier of",
|
|
60
|
+
"chat.code-upload.drop-zone-browse": "blader door bestanden",
|
|
61
|
+
"chat.code-upload.drop-zone-folder": "Sleep hier een map naartoe of",
|
|
62
|
+
"chat.code-upload.header": "Importeer Next.js app",
|
|
63
|
+
"chat.code-upload.title": "Importeer Next.js app",
|
|
64
|
+
"chat.feedback.comment.label": "Hoe kunnen we verbeteren? (optioneel)",
|
|
65
|
+
"chat.feedback.error": "Er is een fout opgetreden bij het verzenden van je feedback",
|
|
66
|
+
"chat.feedback.placeholder": "Je feedback...",
|
|
67
|
+
"chat.feedback.reason.bad_recommendation": "Slechte aanbeveling",
|
|
68
|
+
"chat.feedback.reason.being_lazy": "Onvolledig",
|
|
69
|
+
"chat.feedback.reason.instructions_ignored": "Instructies genegeerd",
|
|
70
|
+
"chat.feedback.reason.invalid_schema": "Ongeldig schema",
|
|
71
|
+
"chat.feedback.reason.other": "Anders",
|
|
72
|
+
"chat.feedback.reason.slow": "Langzaam",
|
|
73
|
+
"chat.feedback.submitted": "Bedankt voor je feedback!",
|
|
74
|
+
"chat.feedback.subtitle": "Geef aanvullende feedback op dit bericht. Selecteer alles wat van toepassing is.",
|
|
75
|
+
"chat.feedback.title": "Feedback geven",
|
|
76
|
+
"chat.figma-upload.import-button": "Importeren",
|
|
77
|
+
"chat.figma-upload.no-images": "Geen frames gevonden in het Figma-bestand.",
|
|
78
|
+
"chat.figma-upload.select-images": "Selecteer frames om te importeren",
|
|
79
|
+
"chat.figma-upload.step1-title": "Voer Figma-URL in",
|
|
80
|
+
"chat.figma-upload.step2-title": "Afbeeldingen bekijken",
|
|
81
|
+
"chat.header.default-title": "Nieuwe chat",
|
|
82
|
+
"chat.input.defaults.ctb": "Vertel me over Content-Type Builder",
|
|
83
|
+
"chat.input.defaults.generate": "Genereer product schema",
|
|
84
|
+
"chat.input.defaults.strapi": "Vertel me over Strapi",
|
|
85
|
+
"chat.input.defaults.title": "Hoe kan ik je helpen?",
|
|
86
|
+
"chat.input.placeholder": "Vraag Strapi AI...",
|
|
87
|
+
"chat.input.strapi-ai-can-make-errors": "Strapi AI kan fouten maken.",
|
|
88
|
+
"chat.input.thinking": "Strapi AI denkt na...",
|
|
89
|
+
"chat.messages.error": "Er is iets misgegaan.",
|
|
90
|
+
"chat.messages.license-limit-exceeded": "AI-tegoed overschreden.",
|
|
91
|
+
"chat.messages.license-limit-reached": "Licentielimiet bereikt, probeer het morgen opnieuw.",
|
|
92
|
+
"chat.messages.too-long-error": "Dit gesprek heeft de maximale lengte bereikt. Start een nieuw gesprek",
|
|
93
|
+
"chat.messages.too-many-requests": "Te veel verzoeken, probeer het later opnieuw.",
|
|
94
|
+
"chat.tooltips.close-chat": "Sluit chat",
|
|
95
|
+
"chat.tooltips.create-chat": "Nieuwe chat",
|
|
96
|
+
"chat.tooltips.open-chat": "Open chat",
|
|
97
|
+
"chat.tooltips.send-message": "Verzenden",
|
|
98
|
+
"chat.tooltips.stop-generation": "Stop",
|
|
99
|
+
"chat.tooltips.upload-attachments": "Bijlagen uploaden",
|
|
48
100
|
"component.repeatable": "(herhaalbaar)",
|
|
49
101
|
"components.SelectComponents.displayed-value": "{number, plural, =0 {# componenten} one {# component} other {# componenten}} geselecteerd",
|
|
50
102
|
"components.componentSelect.no-component-available": "Alle componenten zijn al toegevoegd",
|
|
@@ -61,11 +113,11 @@ var nl = {
|
|
|
61
113
|
"contentType.displayName.label": "Weergavenaam",
|
|
62
114
|
"contentType.kind.change.warning": "Je hebt zojuist het soort content type gewijzigd. De API wordt gereset (routes, controllers en services worden overschreven).",
|
|
63
115
|
"error.attributeName.reserved-name": "Deze naam kan niet worden gebruikt in je content type omdat het andere functies kan breken",
|
|
116
|
+
"error.contentType.pluralName-equals-collectionName": "Deze waarde wordt al gebruikt door een ander content type",
|
|
117
|
+
"error.contentType.pluralName-equals-singularName": "Deze waarde kan niet hetzelfde zijn als de enkelvoudige API ID van een ander content type",
|
|
64
118
|
"error.contentType.pluralName-used": "Deze waarde kan niet hetzelfde zijn als de enkelvoudige waarde",
|
|
65
|
-
"error.contentType.singularName-used": "Deze waarde kan niet hetzelfde zijn als de meervoudige waarde",
|
|
66
119
|
"error.contentType.singularName-equals-pluralName": "Deze waarde kan niet hetzelfde zijn als de meervoudige API ID van een ander content type",
|
|
67
|
-
"error.contentType.
|
|
68
|
-
"error.contentType.pluralName-equals-collectionName": "Deze waarde wordt al gebruikt door een ander content type",
|
|
120
|
+
"error.contentType.singularName-used": "Deze waarde kan niet hetzelfde zijn als de meervoudige waarde",
|
|
69
121
|
"error.contentTypeName.reserved-name": "Deze naam kan niet worden gebruikt in het project, omdat andere functionaliteiten zou kunnen breken",
|
|
70
122
|
"error.validation.enum-duplicate": "Dubbele waarden zijn niet toegestaan (alleen alfanumerieke tekens worden meegeteld)",
|
|
71
123
|
"error.validation.enum-empty-string": "Lege strings zijn niet toegestaan",
|
|
@@ -83,6 +135,27 @@ var nl = {
|
|
|
83
135
|
"form.attribute.component.option.reuse-existing.description": "Hergebruik een reeds gemaakt component om de gegevens consistent te houden voor alle Content types.",
|
|
84
136
|
"form.attribute.component.option.single": "Enkel component",
|
|
85
137
|
"form.attribute.component.option.single.description": "het beste voor het groeperen van velden zoals volledig adres, hoofdinformatie, enz",
|
|
138
|
+
"form.attribute.condition.action": "Actie",
|
|
139
|
+
"form.attribute.condition.action.hide": "Verbergen",
|
|
140
|
+
"form.attribute.condition.action.show": "Tonen",
|
|
141
|
+
"form.attribute.condition.apply": "Voorwaarde toepassen",
|
|
142
|
+
"form.attribute.condition.description": "Schakel veldinstellingen in of uit afhankelijk van de waarde van een ander boolean- of enumeratieveld.",
|
|
143
|
+
"form.attribute.condition.enum-change-warning": "De volgende velden hebben voorwaarden die afhankelijk zijn van dit veld: {fieldNames}. Het wijzigen of verwijderen van de enumeratiewaarden {values} zal deze voorwaarden verbreken. Wil je doorgaan?",
|
|
144
|
+
"form.attribute.condition.enum-change-warning-end": " zal deze voorwaarden verbreken. Wil je doorgaan?",
|
|
145
|
+
"form.attribute.condition.enum-change-warning-values": ". Het wijzigen of verwijderen van de enumeratiewaarden ",
|
|
146
|
+
"form.attribute.condition.field": "Veld",
|
|
147
|
+
"form.attribute.condition.field-change-warning": "De volgende velden hebben voorwaarden die afhankelijk zijn van dit veld: {fieldNames}. Het hernoemen ervan zal deze voorwaarden verbreken. Wil je doorgaan?",
|
|
148
|
+
"form.attribute.condition.field-change-warning-end": ". Het hernoemen ervan zal deze voorwaarden verbreken. Wil je doorgaan?",
|
|
149
|
+
"form.attribute.condition.label": "Voorwaarden",
|
|
150
|
+
"form.attribute.condition.no-fields": "Geen boolean- of enumeratievelden beschikbaar om voorwaarden op in te stellen.",
|
|
151
|
+
"form.attribute.condition.operator": "Operator",
|
|
152
|
+
"form.attribute.condition.operator.is": "is",
|
|
153
|
+
"form.attribute.condition.operator.isNot": "is niet",
|
|
154
|
+
"form.attribute.condition.then": "Dan",
|
|
155
|
+
"form.attribute.condition.title": "Voorwaarde",
|
|
156
|
+
"form.attribute.condition.value": "Waarde",
|
|
157
|
+
"form.attribute.condition.value.false": "onwaar",
|
|
158
|
+
"form.attribute.condition.value.true": "waar",
|
|
86
159
|
"form.attribute.item.customColumnName": "Aangepaste kolom namen",
|
|
87
160
|
"form.attribute.item.customColumnName.description": "Dit is handig om database kolom namen te hernoemen in een meer uitgebreid formaat voor de API responses",
|
|
88
161
|
"form.attribute.item.date.type.date": "datum (bijv.: 01/01/{currentYear})",
|
|
@@ -94,8 +167,10 @@ var nl = {
|
|
|
94
167
|
"form.attribute.item.enumeration.placeholder": "Bijv.:\nochtend\nmiddag\navond",
|
|
95
168
|
"form.attribute.item.enumeration.rules": "Waardes (één regel per waarde)",
|
|
96
169
|
"form.attribute.item.maximum": "Maximale waarde",
|
|
170
|
+
"form.attribute.item.maximumComponents": "Maximaal componenten",
|
|
97
171
|
"form.attribute.item.maximumLength": "Maximale lengte",
|
|
98
172
|
"form.attribute.item.minimum": "Minimale waarde",
|
|
173
|
+
"form.attribute.item.minimumComponents": "Minimaal componenten",
|
|
99
174
|
"form.attribute.item.minimumLength": "Minimale lengte",
|
|
100
175
|
"form.attribute.item.number.type": "Nummer formaat",
|
|
101
176
|
"form.attribute.item.number.type.biginteger": "big integer (bijv.: 123456789)",
|
|
@@ -110,8 +185,9 @@ var nl = {
|
|
|
110
185
|
"form.attribute.item.text.regex.description": "De tekst van de reguliere expressie",
|
|
111
186
|
"form.attribute.item.uniqueField": "Uniek veld",
|
|
112
187
|
"form.attribute.item.uniqueField.description": "Je kan geen item aanmaken als er een item is met gelijke inhoud",
|
|
113
|
-
"form.attribute.item.uniqueField.v5.willBeDisabled": "Op dit moment werkt het unieke veld niet goed in componenten. Als je deze functie uitschakelt, wordt het veld uitgeschakeld totdat het is opgelost.",
|
|
114
188
|
"form.attribute.item.uniqueField.v5.disabled": "Op dit moment werkt het unieke veld niet goed in componenten. Dit veld is uitgeschakeld totdat het is opgelost.",
|
|
189
|
+
"form.attribute.item.uniqueField.v5.willBeDisabled": "Op dit moment werkt het unieke veld niet goed in componenten. Als je deze functie uitschakelt, wordt het veld uitgeschakeld totdat het is opgelost.",
|
|
190
|
+
"form.attribute.item.uniqueField.v5.willBeDisabled'": "Momenteel werken unieke velden niet correct in componenten. Als je deze functie uitschakelt, wordt het veld uitgeschakeld totdat dit is opgelost.",
|
|
115
191
|
"form.attribute.media.allowed-types": "Selecteer de toegestane types media",
|
|
116
192
|
"form.attribute.media.allowed-types.option-files": "Bestanden",
|
|
117
193
|
"form.attribute.media.allowed-types.option-images": "Afbeeldingen",
|
|
@@ -132,15 +208,19 @@ var nl = {
|
|
|
132
208
|
"form.button.add.field.to.component": "Voeg een veld toe aan dit component",
|
|
133
209
|
"form.button.add.field.to.contentType": "Voeg een veld toe aan dit content type",
|
|
134
210
|
"form.button.add.field.to.singleType": "Voeg een veld toe aan dit enkel type",
|
|
211
|
+
"form.button.back": "Terug",
|
|
135
212
|
"form.button.cancel": "Annuleren",
|
|
136
213
|
"form.button.collection-type.description": "Het beste voor meerdere instanties zoals artikelen, producten, opmerkingen, enz.",
|
|
137
214
|
"form.button.collection-type.name": "Collectie Type",
|
|
138
215
|
"form.button.configure-component": "Configureer het component",
|
|
139
216
|
"form.button.configure-view": "Configureer de weergave",
|
|
217
|
+
"form.button.finish": "Voltooien",
|
|
140
218
|
"form.button.select-component": "Selecteer een component",
|
|
141
219
|
"form.button.single-type.description": "Het beste voor een enkele instantie zoals over ons, homepage, enz.",
|
|
142
220
|
"form.button.single-type.name": "Enkel Type",
|
|
221
|
+
"form.button.submit": "Verzenden",
|
|
143
222
|
from: from,
|
|
223
|
+
"media.multiple": "Meerdere",
|
|
144
224
|
"menu.section.components.name": "Componenten",
|
|
145
225
|
"menu.section.models.name": "Collectie Types",
|
|
146
226
|
"menu.section.single-types.name": "Enkel Types",
|
|
@@ -153,13 +233,16 @@ var nl = {
|
|
|
153
233
|
"modalForm.component.header-create": "Maak een component",
|
|
154
234
|
"modalForm.components.create-component.category.label": "Selecteer een categorie of voer een naam in om een nieuwe te maken",
|
|
155
235
|
"modalForm.components.icon.label": "Icoon",
|
|
236
|
+
"modalForm.custom-fields.advanced.settings.extended": "Geavanceerde instellingen",
|
|
237
|
+
"modalForm.editCategory.base.name.description": "Er is geen spatie toegestaan in de naam van een categorie",
|
|
156
238
|
"modalForm.empty.button": "Voeg Custom field toe",
|
|
157
239
|
"modalForm.empty.heading": "Er is hier nog niets",
|
|
158
240
|
"modalForm.empty.sub-heading": "Vind wat je zoekt via verschillende plugins.",
|
|
159
|
-
"modalForm.editCategory.base.name.description": "Er is geen spatie toegestaan in de naam van een categorie",
|
|
160
|
-
"modalForm.header-edit": "Bewerk {name}",
|
|
161
|
-
"modalForm.header-categories": "Categorieën",
|
|
162
241
|
"modalForm.header-back": "Terug",
|
|
242
|
+
"modalForm.header-categories": "Categorieën",
|
|
243
|
+
"modalForm.header-edit": "Bewerk {name}",
|
|
244
|
+
"modalForm.header.back": "Terug",
|
|
245
|
+
"modalForm.header.categories": "Categorieën",
|
|
163
246
|
"modalForm.singleType.header-create": "Maak een enkel type",
|
|
164
247
|
"modalForm.sub-header.addComponentToDynamicZone": "Voeg een nieuw component toe aan de dynamische zone",
|
|
165
248
|
"modalForm.sub-header.attribute.create": "Voeg een nieuw {type} veld toe",
|
|
@@ -168,13 +251,13 @@ var nl = {
|
|
|
168
251
|
"modalForm.sub-header.chooseAttribute.collectionType": "Selecteer een veld voor het collectie type",
|
|
169
252
|
"modalForm.sub-header.chooseAttribute.component": "Selecteer een veld voor het component",
|
|
170
253
|
"modalForm.sub-header.chooseAttribute.singleType": "Selecteer een veld voor het enkel type",
|
|
171
|
-
"modalForm.custom-fields.advanced.settings.extended": "Geavanceerde instellingen",
|
|
172
254
|
"modalForm.tabs.custom": "Custom",
|
|
173
255
|
"modalForm.tabs.custom.howToLink": "Hoe een Custom field toe te voegen",
|
|
174
256
|
"modalForm.tabs.default": "Standaard",
|
|
175
257
|
"modalForm.tabs.label": "Standaard en Custom type labels",
|
|
176
258
|
"modelPage.attribute.relation-polymorphic": "Relatie (polymorf)",
|
|
177
259
|
"modelPage.attribute.relationWith": "Relatie met",
|
|
260
|
+
"modelPage.attribute.with": "met",
|
|
178
261
|
"notification.error.dynamiczone-min.validation": "Je hebt ten minste één component in de dynamische zone nodig om het content type op te slaan",
|
|
179
262
|
"notification.info.autoreaload-disable": "De autoReload-functie is vereist om deze plug-in te gebruiken. Start de server met `strapi develop`",
|
|
180
263
|
"notification.info.creating.notSaved": "Sla je werk op voordat je een nieuw content type of component maakt",
|
|
@@ -188,6 +271,10 @@ var nl = {
|
|
|
188
271
|
"popUpWarning.bodyMessage.category.delete": "Weet je zeker dat je deze categorie wilt verwijderen? Alle componenten worden ook verwijderd.",
|
|
189
272
|
"popUpWarning.bodyMessage.component.delete": "Weet je zeker dat je dit component wilt verwijderen?",
|
|
190
273
|
"popUpWarning.bodyMessage.contentType.delete": "Weet je zeker dat je dit collectie type wilt verwijderen?",
|
|
274
|
+
"popUpWarning.bodyMessage.delete-attribute-with-conditions": "De volgende velden hebben voorwaarden die afhankelijk zijn van dit veld: ",
|
|
275
|
+
"popUpWarning.bodyMessage.delete-attribute-with-conditions-end": ". Weet je zeker dat je het wilt verwijderen?",
|
|
276
|
+
"popUpWarning.bodyMessage.delete-condition": "Weet je zeker dat je deze voorwaarde wilt verwijderen?",
|
|
277
|
+
"popUpWarning.discardAll.message": "Weet je zeker dat je alle wijzigingen wilt verwerpen?",
|
|
191
278
|
"popUpWarning.draft-publish.button.confirm": "Ja, uitschakelen",
|
|
192
279
|
"popUpWarning.draft-publish.message": "Als je Concept & publiceren uitschakelt, worden je concepten verwijderd.",
|
|
193
280
|
"popUpWarning.draft-publish.second-message": "Weet je zeker dat je het wilt uitschakelen?",
|
|
@@ -200,37 +287,12 @@ var nl = {
|
|
|
200
287
|
"relation.oneToOne": "heeft en behoort tot één",
|
|
201
288
|
"relation.oneWay": "heeft één",
|
|
202
289
|
"table.button.no-fields": "Voeg een nieuw veld toe",
|
|
203
|
-
"table.content.create-first-content-type.title": "Geen content types",
|
|
204
290
|
"table.content.create-first-content-type.description": "Maak collectie types, enkel types en componenten om je schema te bouwen.",
|
|
291
|
+
"table.content.create-first-content-type.import-code": "Importeren vanaf computer",
|
|
205
292
|
"table.content.create-first-content-type.start-with-prompt": "Begin met een prompt",
|
|
293
|
+
"table.content.create-first-content-type.title": "Geen content types",
|
|
206
294
|
"table.content.no-fields.collection-type": "Voeg het eerste veld toe aan dit collectie type",
|
|
207
|
-
"table.content.no-fields.component": "Voeg het eerste veld toe aan dit component"
|
|
208
|
-
"IconPicker.search.placeholder.label": "Zoek een icoon",
|
|
209
|
-
"IconPicker.search.clear.label": "Wis icoon zoekopdracht",
|
|
210
|
-
"IconPicker.search.button.label": "Icoon zoekknop",
|
|
211
|
-
"IconPicker.remove.tooltip": "Verwijder geselecteerd icoon",
|
|
212
|
-
"IconPicker.remove.button": "Knop om geselecteerd icoon te verwijderen",
|
|
213
|
-
"IconPicker.emptyState.label": "Geen iconen gevonden",
|
|
214
|
-
"IconPicker.icon.label": "Selecteer icoon {icon}",
|
|
215
|
-
"chat.tooltips.close-chat": "Sluit chat",
|
|
216
|
-
"chat.tooltips.create-chat": "Nieuwe chat",
|
|
217
|
-
"chat.tooltips.open-chat": "Open chat",
|
|
218
|
-
"chat.tooltips.send-message": "Verzenden",
|
|
219
|
-
"chat.tooltips.stop-generation": "Stop",
|
|
220
|
-
"chat.header.default-title": "Nieuwe chat",
|
|
221
|
-
"chat.input.defaults.title": "Hoe kan ik je helpen?",
|
|
222
|
-
"chat.input.defaults.generate": "Genereer product schema",
|
|
223
|
-
"chat.input.defaults.ctb": "Vertel me over Content-Type Builder",
|
|
224
|
-
"chat.input.defaults.strapi": "Vertel me over Strapi",
|
|
225
|
-
"chat.input.thinking": "Strapi AI denkt na...",
|
|
226
|
-
"chat.input.placeholder": "Vraag Strapi AI...",
|
|
227
|
-
"chat.input.strapi-ai-can-make-errors": "Strapi AI kan fouten maken.",
|
|
228
|
-
"chat.messages.error": "Er is iets misgegaan.",
|
|
229
|
-
"chat.code-upload.header": "Importeer Next.js app",
|
|
230
|
-
"chat.code-upload.title": "Importeer Next.js app",
|
|
231
|
-
"chat.code-upload.description": "Je app zal worden geanalyseerd door AI. Zorg ervoor dat je alle gevoelige gegevens verwijdert voor het importeren.",
|
|
232
|
-
"chat.code-upload.drop-zone": "Drop .zip bestand hier of",
|
|
233
|
-
"chat.code-upload.drop-zone-browse": "blader door bestanden"
|
|
295
|
+
"table.content.no-fields.component": "Voeg het eerste veld toe aan dit component"
|
|
234
296
|
};
|
|
235
297
|
|
|
236
298
|
exports.configurations = configurations;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nl.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nl.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|