diff --git a/frontend/package.json b/frontend/package.json index a23d391c..e4dae955 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -20,7 +20,7 @@ "fast-deep-equal": "^3.1.3", "firebase": "^10.7.1", "next": "14.0.4", - "next-intl": "^3.4.1", + "next-intl": "^3.4.2", "persist-and-sync": "^1.2.1", "react": "18.2.0", "react-bootstrap-icons": "^1.10.3", @@ -45,7 +45,7 @@ "@types/react": "18.2.47", "@types/react-dom": "18.2.18", "@types/react-syntax-highlighter": "^15.5.11", - "@types/validator": "^13.11.7", + "@types/validator": "^13.11.8", "@vitejs/plugin-react": "^4.2.1", "autoprefixer": "^10.4.16", "daisyui": "^4.5.0", diff --git a/frontend/src/app/[locale]/projects/[projectId]/applications/[applicationId]/configs/[promptConfigId]/page.tsx b/frontend/src/app/[locale]/projects/[projectId]/applications/[applicationId]/configs/[promptConfigId]/page.tsx index 46d2138d..f016beab 100644 --- a/frontend/src/app/[locale]/projects/[projectId]/applications/[applicationId]/configs/[promptConfigId]/page.tsx +++ b/frontend/src/app/[locale]/projects/[projectId]/applications/[applicationId]/configs/[promptConfigId]/page.tsx @@ -106,6 +106,7 @@ export default function PromptConfiguration({ )), diff --git a/frontend/src/components/projects/[projectId]/applications/[applicationId]/configs/[configId]/prompt-config-code-snippet.spec.tsx b/frontend/src/components/projects/[projectId]/applications/[applicationId]/configs/[configId]/prompt-config-code-snippet.spec.tsx index 7f2c68c0..25b866aa 100644 --- a/frontend/src/components/projects/[projectId]/applications/[applicationId]/configs/[configId]/prompt-config-code-snippet.spec.tsx +++ b/frontend/src/components/projects/[projectId]/applications/[applicationId]/configs/[configId]/prompt-config-code-snippet.spec.tsx @@ -17,6 +17,7 @@ describe('PromptConfigCodeSnippet', () => { , ); const defaultFrameworkTab = screen.getByTestId('tab-Android'); @@ -32,6 +33,7 @@ describe('PromptConfigCodeSnippet', () => { , ); const snippet = screen.getByTestId(`code-snippet-${language}`); @@ -47,6 +49,7 @@ describe('PromptConfigCodeSnippet', () => { , ); const snippet = screen.getByTestId(`code-snippet-${language}`); @@ -61,6 +64,7 @@ describe('PromptConfigCodeSnippet', () => { , ); const copyButtonKotlin = screen.getByTestId( @@ -83,6 +87,7 @@ describe('PromptConfigCodeSnippet', () => { , ); const docsButton = screen.getByTestId( @@ -98,6 +103,7 @@ describe('PromptConfigCodeSnippet', () => { , ); const createAPIKeyButton = screen.getByTestId( @@ -113,6 +119,7 @@ describe('PromptConfigCodeSnippet', () => { , ); const iosTab = screen.getByTestId('tab-iOS'); @@ -128,6 +135,7 @@ describe('PromptConfigCodeSnippet', () => { , ); diff --git a/frontend/src/components/projects/[projectId]/applications/[applicationId]/configs/[configId]/prompt-config-code-snippet.tsx b/frontend/src/components/projects/[projectId]/applications/[applicationId]/configs/[configId]/prompt-config-code-snippet.tsx index b98db281..e2e0f934 100644 --- a/frontend/src/components/projects/[projectId]/applications/[applicationId]/configs/[configId]/prompt-config-code-snippet.tsx +++ b/frontend/src/components/projects/[projectId]/applications/[applicationId]/configs/[configId]/prompt-config-code-snippet.tsx @@ -1,19 +1,36 @@ import { useTranslations } from 'next-intl'; -import { Fragment, memo, useState } from 'react'; +import { Fragment, memo, useMemo, useState } from 'react'; import { Github } from 'react-bootstrap-icons'; import { CodeSnippet } from '@/components/code-snippet'; import { useAnalytics } from '@/hooks/use-analytics'; +interface ReplacerMap { + invokeReplacer: ( + value: string, + expectedTemplateVariables: string[], + ) => string; + parametersReplacer: ( + value: string, + expectedTemplateVariables: string[], + ) => string; +} + interface FrameworkTab { docs: string; framework: string; isActive: boolean; language: supportedLanguages; + replacers: ReplacerMap; } - type supportedLanguages = 'kotlin' | 'dart' | 'swift'; +const apiKey = ''; +const configId = ''; +const functionInvoke = ''; +const functionParameters = ''; +const input = ''; + /* * Kotlin * */ @@ -28,29 +45,27 @@ const kotlinInstallationSnippet = `dependencies { const kotlinInitSnippet = `import ai.basemind.client.BaseMindClient val client = BaseMindClient.getInstance( - "') +val client = BaseMindClient.getInstance('${apiKey}') `; -const kotlinRequestSnippet = `fun handlePromptRequest(userInput: String): String { - val map = mapOf("userInput" to userInput) - val response = client.requestPrompt(map) +const kotlinRequestSnippet = `fun handlePromptRequest(${functionParameters}): String { + val response = client.requestPrompt(templateVariables) return response.content } -val prompt = handlePromptRequest("Hello World!") +val prompt = handlePromptRequest(${functionInvoke}) `; -const kotlinStreamSnippet = `fun handlePromptStream(userInput: String): MutableList { - val map = mapOf("userInput" to userInput) - val response = client.requestStream(map) +const kotlinStreamSnippet = `fun handlePromptStream(${functionParameters}): MutableList { + val response = client.requestStream(templateVariables) val chunks: MutableList = mutableListOf() response.collect { chunk -> chunks.add(chunk.content) } @@ -58,9 +73,28 @@ const kotlinStreamSnippet = `fun handlePromptStream(userInput: String): MutableL return chunks } -val chunks = handlePromptStream("Hello World!") +val chunks = handlePromptStream(${functionInvoke}) `; +const kotlinPlaceholderReplacers: ReplacerMap = { + invokeReplacer: (value: string, expectedTemplateVariables: string[]) => + value.replace( + functionInvoke, + expectedTemplateVariables.length + ? `mapOf(\n${expectedTemplateVariables + .map((v) => `\t"${v}" to "${input}"`) + .join(', \n')}\n)` + : '', + ), + parametersReplacer: (value: string, expectedTemplateVariables: string[]) => + value.replace( + functionParameters, + expectedTemplateVariables.length + ? 'templateVariables: Map' + : '', + ), +}; + /* * Swift * */ @@ -81,26 +115,24 @@ targets: [ const swiftInitSnippet = `import BaseMindClient let client = BaseMindClient( - apiKey: "", - options: ClientOptions(promptConfigId: "CONFIG_ID"), + apiKey: "${apiKey}", + options: ClientOptions(promptConfigId: "${configId}"), )`; const swiftDefaultInitSnippet = `import BaseMindClient -let client = BaseMindClient(apiKey: "")`; +let client = BaseMindClient(apiKey: "${apiKey}")`; -const swiftRequestSnippet = `func handlePromptRequest(userInput: String) async throws -> String { - let templateVariables = ["userInput": userInput] +const swiftRequestSnippet = `func handlePromptRequest(${functionParameters}) async throws -> String { let response = try client.requestPrompt(templateVariables) return response.content } -let prompt = try await handlePromptRequest("Hello World!") +let prompt = try await handlePromptRequest(${functionInvoke}) `; -const swiftStreamSnippet = `func handlePromptStream(userInput: String) async throws -> [String] { - let templateVariables = ["userInput": userInput] +const swiftStreamSnippet = `func handlePromptStream(${functionParameters}) async throws -> [String] { let stream = try client.requestStream(templateVariables) var chunks: [String] = [] @@ -111,9 +143,29 @@ const swiftStreamSnippet = `func handlePromptStream(userInput: String) async thr return chunks } -let chunks = try await handlePromptStream("Hello World!") +let chunks = try await handlePromptStream(${functionInvoke}) `; +const swiftPlaceholderReplacers: ReplacerMap = { + invokeReplacer: (value: string, expectedTemplateVariables: string[]) => + value.replace( + functionInvoke, + expectedTemplateVariables.length + ? `[ +${expectedTemplateVariables + .map((v) => `\t"${v}": "${input}"`) + .join(', \n')},\n]` + : '', + ), + parametersReplacer: (value: string, expectedTemplateVariables: string[]) => + value.replace( + functionParameters, + expectedTemplateVariables.length + ? 'templateVariables: [String: String]' + : '', + ), +}; + /* * Dart * */ @@ -129,35 +181,51 @@ const dartInstallationSnippet = `flutter pub add basemind const dartInitSnippet = `import 'package:basemind/client.dart'; final client = BaseMindClient( - '', - "CONFIG_ID", + '${apiKey}', + "${configId}", );`; const dartDefaultInitSnippet = `import 'package:basemind/client.dart'; import * as url from 'url'; -final client = BaseMindClient('');`; +final client = BaseMindClient('${apiKey}');`; -const dartRequestSnippet = `Future handlePromptRequest(String userInput) async { - final templateVariables = {'userInput': userInput}; +const dartRequestSnippet = `Future handlePromptRequest(${functionParameters}) async { final response = await client.requestPrompt(templateVariables); return response.content; } -final prompt = await handlePromptRequest('Hello World!'); +final prompt = await handlePromptRequest(${functionInvoke}); `; -const dartStreamSnippet = `handlePromptStream(String userInput,) { - final stream = client.requestStream({'userInput': userInput}); +const dartStreamSnippet = `handlePromptStream(${functionParameters}) { + final stream = client.requestStream(templateVariables); stream.listen((response) { print(response.content); }); } -handlePromptStream('Hello World!'); +handlePromptStream(${functionInvoke}); `; +const dartPlaceholderReplacers: ReplacerMap = { + invokeReplacer: (value: string, expectedTemplateVariables: string[]) => + value.replace( + functionInvoke, + expectedTemplateVariables.length + ? `{ +${expectedTemplateVariables.map((v) => `\t'${v}': '${input}'`).join(',\n')},\n}` + : '', + ), + parametersReplacer: (value: string, expectedTemplateVariables: string[]) => + value.replace( + functionParameters, + expectedTemplateVariables.length + ? 'Map templateVariables' + : '', + ), +}; // --- const tabs: FrameworkTab[] = [ @@ -166,13 +234,21 @@ const tabs: FrameworkTab[] = [ framework: 'Android', isActive: true, language: 'kotlin', + replacers: kotlinPlaceholderReplacers, + }, + { + docs: swiftDocs, + framework: 'iOS', + isActive: true, + language: 'swift', + replacers: swiftPlaceholderReplacers, }, - { docs: swiftDocs, framework: 'iOS', isActive: true, language: 'swift' }, { docs: dartDocs, framework: 'Flutter', isActive: true, language: 'dart', + replacers: dartPlaceholderReplacers, }, ]; @@ -195,10 +271,7 @@ const importSnippetMap: Record< codeText={ isDefault ? dartDefaultInitSnippet - : dartInitSnippet.replaceAll( - 'CONFIG_ID', - promptConfigId, - ) + : dartInitSnippet.replaceAll(configId, promptConfigId) } language="dart" allowCopy={true} @@ -217,10 +290,7 @@ const importSnippetMap: Record< codeText={ isDefault ? kotlinDefaultInitSnippet - : kotlinInitSnippet.replaceAll( - 'CONFIG_ID', - promptConfigId, - ) + : kotlinInitSnippet.replaceAll(configId, promptConfigId) } language="kotlin" allowCopy={true} @@ -239,10 +309,7 @@ const importSnippetMap: Record< codeText={ isDefault ? swiftDefaultInitSnippet - : swiftInitSnippet.replaceAll( - 'CONFIG_ID', - promptConfigId, - ) + : swiftInitSnippet.replaceAll(configId, promptConfigId) } language="swift" allowCopy={true} @@ -275,48 +342,58 @@ const installationSnippetMap: Record = { )), }; -const promptRequestSnippetMap: Record = { - dart: memo(() => ( +const promptRequestSnippetMap: Record< + supportedLanguages, + React.FC<{ + replacer: (value: string) => string; + }> +> = { + dart: memo(({ replacer }) => ( )), - kotlin: memo(() => ( + kotlin: memo(({ replacer }) => ( )), - swift: memo(() => ( + swift: memo(({ replacer }) => ( )), }; -const promptStreamSnippetMap: Record = { - dart: memo(() => ( +const promptStreamSnippetMap: Record< + supportedLanguages, + React.FC<{ + replacer: (value: string) => string; + }> +> = { + dart: memo(({ replacer }) => ( )), - kotlin: memo(() => ( + kotlin: memo(({ replacer }) => ( )), - swift: memo(() => ( + swift: memo(({ replacer }) => ( @@ -326,7 +403,9 @@ const promptStreamSnippetMap: Record = { export function PromptConfigCodeSnippet({ isDefaultConfig, promptConfigId, + expectedVariables, }: { + expectedVariables: string[]; isDefaultConfig: boolean; promptConfigId: string; }) { @@ -347,127 +426,144 @@ export function PromptConfigCodeSnippet({ }; }; - return ( - <> -

{t('implement')}

-
- {tabs.map((tab) => { - const InstallationSnippet = - installationSnippetMap[tab.language]; - const ImportSnippet = importSnippetMap[tab.language]; - const RequestSnippet = - promptRequestSnippetMap[tab.language]; - const StreamSnippet = promptStreamSnippetMap[tab.language]; - - return ( - - +
+
+ -
-
- -
-
-
- - 1 - - + + {t('documentation')} + + +
+
+
+ + 1 + + - {t( - `${tab.language}InstallationText`, - )} - -
- + > + {t( + `${tab.language}InstallationText`, + )} +
-
-
- - 2 - - +
+ + 2 + + - {t('importText')} - -
- + > + {t('importText')} +
-
-
- - 3 - - +
+ + 3 + + - {t('usageRequestText')} - -
- + > + {t('usageRequestText')} +
-
-
- - 4 - - +
+ + 4 + + - {t('usageStreamText')} - -
- + > + {t('usageStreamText')} +
+
- - ); - })} +
+ + ); + }), + [expectedVariables, initialized, selectedFramework], + ); + + return ( + <> +

{t('implement')}

+
+ {mappedTabs}
); diff --git a/go.sum b/go.sum index 70c89561..3a1ac98f 100644 --- a/go.sum +++ b/go.sum @@ -1065,8 +1065,6 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/redis/go-redis/v9 v9.0.0-rc.4/go.mod h1:Vo3EsyWnicKnSKCA7HhgnvnyA74wOA69Cd2Meli5mmA= -github.com/redis/go-redis/v9 v9.3.1 h1:KqdY8U+3X6z+iACvumCNxnoluToB+9Me+TvyFa21Mds= -github.com/redis/go-redis/v9 v9.3.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= github.com/redis/go-redis/v9 v9.4.0 h1:Yzoz33UZw9I/mFhx4MNrB6Fk+XHO1VukNcCa1+lwyKk= github.com/redis/go-redis/v9 v9.4.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= @@ -1087,8 +1085,6 @@ github.com/sendgrid/rest v2.6.9+incompatible h1:1EyIcsNdn9KIisLW50MKwmSRSK+ekuei github.com/sendgrid/rest v2.6.9+incompatible/go.mod h1:kXX7q3jZtJXK5c5qK83bSGMdV6tsOE70KbHoqJls4lE= github.com/sendgrid/sendgrid-go v3.14.0+incompatible h1:KDSasSTktAqMJCYClHVE94Fcif2i7P7wzISv1sU6DUA= github.com/sendgrid/sendgrid-go v3.14.0+incompatible/go.mod h1:QRQt+LX/NmgVEvmdRw0VT/QgUn499+iza2FnDca9fg8= -github.com/sethvargo/go-envconfig v0.9.0 h1:Q6FQ6hVEeTECULvkJZakq3dZMeBQ3JUpcKMfPQbKMDE= -github.com/sethvargo/go-envconfig v0.9.0/go.mod h1:Iz1Gy1Sf3T64TQlJSvee81qDhf7YIlt8GMUX6yyNFs0= github.com/sethvargo/go-envconfig v1.0.0 h1:1C66wzy4QrROf5ew4KdVw942CQDa55qmlYmw9FZxZdU= github.com/sethvargo/go-envconfig v1.0.0/go.mod h1:Lzc75ghUn5ucmcRGIdGQ33DKJrcjk4kihFYgSTBmjIc= github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4= @@ -1203,8 +1199,6 @@ golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1334,8 +1328,6 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1368,8 +1360,6 @@ golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= -golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= -golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1821,16 +1811,12 @@ google.golang.org/genproto v0.0.0-20230403163135-c38d8f061ccd/go.mod h1:UUQDJDOl google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= google.golang.org/genproto v0.0.0-20230525234025-438c736192d0/go.mod h1:9ExIQyXL5hZrHzQceCwuSYwZZ5QZBazOcprJ5rgs3lY= google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= -google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg= -google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917/go.mod h1:pZqR+glSb11aJ+JQcczCvgf47+duRuzNSKqE8YAQnV0= google.golang.org/genproto v0.0.0-20240108191215-35c7eff3a6b1 h1:/IWabOtPziuXTEtI1KYCpM6Ss7vaAkeMxk+uXV/xvZs= google.golang.org/genproto v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k= google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM= -google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0= google.golang.org/genproto/googleapis/api v0.0.0-20240108191215-35c7eff3a6b1 h1:OPXtXn7fNMaXwO3JvOmF1QyTc00jsSFFz1vXXBOdCDo= google.golang.org/genproto/googleapis/api v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:B5xPO//w8qmBDjGReYLpR6UJPnkldGkCSMoH/2vxJeg= google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:ylj+BE99M198VPbBh6A8d9n3w8fChvyLK3wwBOjXBFA= @@ -1838,8 +1824,6 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a/go. google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= google.golang.org/genproto/googleapis/rpc v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU= google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 h1:gphdwh0npgs8elJ4T6J+DQJHPVF7RsuJHCfwztUb4J4= google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= diff --git a/package.json b/package.json index 6f7002c3..e10463d0 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "@protobuf-ts/runtime": "^2.9.3", "@protobuf-ts/runtime-rpc": "^2.9.3", "@tool-belt/eslint-config": "^5.0.4", - "@types/node": "20.10.7", + "@types/node": "20.10.8", "@types/webpack": "^5.28.5", "@types/webpack-node-externals": "^3.0.4", "@typescript-eslint/eslint-plugin": "^6.18.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 307951cd..fcde7d1b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,8 +32,8 @@ importers: specifier: ^5.0.4 version: 5.0.4(@typescript-eslint/eslint-plugin@6.18.1)(@typescript-eslint/parser@6.18.1)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0)(prettier@3.1.1)(typescript@5.3.3) '@types/node': - specifier: 20.10.7 - version: 20.10.7 + specifier: 20.10.8 + version: 20.10.8 '@types/webpack': specifier: ^5.28.5 version: 5.28.5(webpack-cli@5.1.4) @@ -90,7 +90,7 @@ importers: version: 9.5.1(typescript@5.3.3)(webpack@5.89.0) ts-node: specifier: ^10.9.2 - version: 10.9.2(@types/node@20.10.7)(typescript@5.3.3) + version: 10.9.2(@types/node@20.10.8)(typescript@5.3.3) tsconfig-paths-webpack-plugin: specifier: ^4.1.0 version: 4.1.0 @@ -102,7 +102,7 @@ importers: version: 4.2.3(typescript@5.3.3) vitest: specifier: ^1.1.3 - version: 1.1.3(@types/node@20.10.7) + version: 1.1.3(@types/node@20.10.8) vitest-mock-extended: specifier: ^1.3.1 version: 1.3.1(typescript@5.3.3)(vitest@1.1.3) @@ -149,8 +149,8 @@ importers: specifier: 14.0.4 version: 14.0.4(@babel/core@7.23.7)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.7) next-intl: - specifier: ^3.4.1 - version: 3.4.1(next@14.0.4)(react@18.2.0) + specifier: ^3.4.2 + version: 3.4.2(next@14.0.4)(react@18.2.0) persist-and-sync: specifier: ^1.2.1 version: 1.2.1(zustand@4.4.7) @@ -219,8 +219,8 @@ importers: specifier: ^15.5.11 version: 15.5.11 '@types/validator': - specifier: ^13.11.7 - version: 13.11.7 + specifier: ^13.11.8 + version: 13.11.8 '@vitejs/plugin-react': specifier: ^4.2.1 version: 4.2.1(vite@5.0.11) @@ -3096,7 +3096,7 @@ packages: engines: { node: ^8.13.0 || >=10.10.0 } dependencies: '@grpc/proto-loader': 0.7.10 - '@types/node': 20.10.7 + '@types/node': 20.10.8 /@grpc/proto-loader@0.7.10: resolution: @@ -5758,7 +5758,7 @@ packages: dom-accessibility-api: 0.6.3 lodash: 4.17.21 redent: 3.0.0 - vitest: 1.1.3(@types/node@20.10.7) + vitest: 1.1.3(@types/node@20.10.8) dev: true /@testing-library/react@14.1.2(react-dom@18.2.0)(react@18.2.0): @@ -5802,7 +5802,7 @@ packages: eslint-plugin-markdown: 3.0.1(eslint@8.56.0) eslint-plugin-n: 16.5.0(eslint@8.56.0) eslint-plugin-optimize-regex: 1.2.1 - eslint-plugin-prettier: 5.1.2(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.1.1) + eslint-plugin-prettier: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.1.1) eslint-plugin-promise: 6.1.1(eslint@8.56.0) eslint-plugin-react: 7.33.2(eslint@8.56.0) eslint-plugin-react-hooks: 4.6.0(eslint@8.56.0) @@ -5984,23 +5984,23 @@ packages: integrity: sha512-PPpPK6F9ALFTn59Ka3BaL+qGuipRfxNE8qVgkp0bVixeiR2c2/L+IVOiBdu9JhhT22sWnQEp6YyHGI2b2+CMcA==, } dependencies: - '@types/node': 18.19.5 + '@types/node': 18.19.6 form-data: 4.0.0 dev: false - /@types/node@18.19.5: + /@types/node@18.19.6: resolution: { - integrity: sha512-22MG6T02Hos2JWfa1o5jsIByn+bc5iOt1IS4xyg6OG68Bu+wMonVZzdrgCw693++rpLE9RUT/Bx15BeDzO0j+g==, + integrity: sha512-X36s5CXMrrJOs2lQCdDF68apW4Rfx9ixYMawlepwmE4Anezv/AV2LSpKD1Ub8DAc+urp5bk0BGZ6NtmBitfnsg==, } dependencies: undici-types: 5.26.5 dev: false - /@types/node@20.10.7: + /@types/node@20.10.8: resolution: { - integrity: sha512-fRbIKb8C/Y2lXxB5eVMj4IU7xpdox0Lh8bUPEdtLysaylsml1hOOx1+STloRs/B9nf7C6kPRmmg/V7aQW7usNg==, + integrity: sha512-f8nQs3cLxbAFc00vEU59yf9UyGUftkPaLGfvbVOIDdx2i1b8epBqj2aNGyP19fiyXWvlmZ7qC1XLjAzw/OKIeA==, } dependencies: undici-types: 5.26.5 @@ -6011,7 +6011,7 @@ packages: integrity: sha512-vjKuaQOLUA5EY2zkUmWG1ipXbKt9Wd+H/0SiIuHVeH4cHtt6509iRUGH9ZR0iqgUrtj3BrP9KqoTuV3ZCbQcYA==, } dependencies: - '@types/node': 20.10.7 + '@types/node': 20.10.8 dev: true /@types/normalize-package-data@2.4.4: @@ -6074,10 +6074,10 @@ packages: integrity: sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==, } - /@types/validator@13.11.7: + /@types/validator@13.11.8: resolution: { - integrity: sha512-q0JomTsJ2I5Mv7dhHhQLGjMvX0JJm5dyZ1DXQySIUzU1UlwzB8bt+R6+LODUbz0UDIOvEzGc28tk27gBJw2N8Q==, + integrity: sha512-c/hzNDBh7eRF+KbCf+OoZxKbnkpaK/cKp9iLQWqB7muXtM+MtL9SUUH8vCFcLn6dH1Qm05jiexK0ofWY7TfOhQ==, } dev: true @@ -6087,7 +6087,7 @@ packages: integrity: sha512-8Z3/edqxE3RRlOJwKSgOFxLZRt/i1qFlv/Bi308ZUKo9jh8oGngd9r8GR0ZNKW5AEJq8QNQE3b17CwghTjQ0Uw==, } dependencies: - '@types/node': 20.10.7 + '@types/node': 20.10.8 webpack: 5.89.0(webpack-cli@5.1.4) transitivePeerDependencies: - '@swc/core' @@ -6102,7 +6102,7 @@ packages: integrity: sha512-wR87cgvxj3p6D0Crt1r5avwqffqPXUkNlnQ1mjU93G7gCuFjufZR4I6j8cz5g1F1tTYpfOOFvly+cmIQwL9wvw==, } dependencies: - '@types/node': 20.10.7 + '@types/node': 20.10.8 tapable: 2.2.1 webpack: 5.89.0(webpack-cli@5.1.4) transitivePeerDependencies: @@ -6396,7 +6396,7 @@ packages: '@babel/plugin-transform-react-jsx-source': 7.23.3(@babel/core@7.23.7) '@types/babel__core': 7.20.5 react-refresh: 0.14.0 - vite: 5.0.11(@types/node@20.10.7)(sass@1.69.7) + vite: 5.0.11(@types/node@20.10.8)(sass@1.69.7) transitivePeerDependencies: - supports-color dev: true @@ -6422,7 +6422,7 @@ packages: std-env: 3.7.0 test-exclude: 6.0.0 v8-to-istanbul: 9.2.0 - vitest: 1.1.3(@types/node@20.10.7) + vitest: 1.1.3(@types/node@20.10.8) transitivePeerDependencies: - supports-color dev: true @@ -7232,7 +7232,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001576 - electron-to-chromium: 1.4.625 + electron-to-chromium: 1.4.626 node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.22.2) @@ -8133,10 +8133,10 @@ packages: } dev: true - /electron-to-chromium@1.4.625: + /electron-to-chromium@1.4.626: resolution: { - integrity: sha512-DENMhh3MFgaPDoXWrVIqSPInQoLImywfCwrSmVl3cf9QHzoZSiutHwGaB/Ql3VkqcQV30rzgdM+BjKqBAJxo5Q==, + integrity: sha512-f7/be56VjRRQk+Ric6PmIrEtPcIqsn3tElyAu9Sh6egha2VLJ82qwkcOdcnT06W+Pb6RUulV1ckzrGbKzVcTHg==, } /emoji-regex@8.0.0: @@ -8234,7 +8234,7 @@ packages: object.assign: 4.1.5 regexp.prototype.flags: 1.5.1 safe-array-concat: 1.0.1 - safe-regex-test: 1.0.0 + safe-regex-test: 1.0.1 string.prototype.trim: 1.2.8 string.prototype.trimend: 1.0.7 string.prototype.trimstart: 1.0.7 @@ -8619,10 +8619,10 @@ packages: regexp-tree: 0.1.27 dev: true - /eslint-plugin-prettier@5.1.2(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.1.1): + /eslint-plugin-prettier@5.1.3(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.1.1): resolution: { - integrity: sha512-dhlpWc9vOwohcWmClFcA+HjlvUpuyynYs0Rf+L/P6/0iQE6vlHW9l5bkfzN62/Stm9fbq8ku46qzde76T1xlSg==, + integrity: sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==, } engines: { node: ^14.18.0 || >=16.0.0 } peerDependencies: @@ -8835,7 +8835,7 @@ packages: '@typescript-eslint/eslint-plugin': 6.18.1(@typescript-eslint/parser@6.18.1)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/utils': 6.18.1(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 - vitest: 1.1.3(@types/node@20.10.7) + vitest: 1.1.3(@types/node@20.10.8) transitivePeerDependencies: - supports-color - typescript @@ -10367,7 +10367,7 @@ packages: } engines: { node: '>= 10.13.0' } dependencies: - '@types/node': 20.10.7 + '@types/node': 20.10.8 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true @@ -11093,10 +11093,10 @@ packages: '@segment/isodate': 1.0.3 dev: false - /next-intl@3.4.1(next@14.0.4)(react@18.2.0): + /next-intl@3.4.2(next@14.0.4)(react@18.2.0): resolution: { - integrity: sha512-z8gY7uCe1cDHpH3rAD4uxZ5qEvt0WZX4bdKu7km2COPUIEXAXF1puwNAbtTC8b5clWGd87QwBy1+VS7ZElyU8g==, + integrity: sha512-DHAMtXfuItIGeNv5pUYqwHRWBmyL47dyuS1BDoG1dRUq+drcV5xk8eygD0n7xicD8yYUhgGcLMhNajEwRwpWNQ==, } peerDependencies: next: ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0 @@ -11106,7 +11106,7 @@ packages: negotiator: 0.6.3 next: 14.0.4(@babel/core@7.23.7)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.7) react: 18.2.0 - use-intl: 3.4.1(react@18.2.0) + use-intl: 3.4.2(react@18.2.0) dev: false /next@14.0.4(@babel/core@7.23.7)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.7): @@ -11440,7 +11440,7 @@ packages: } hasBin: true dependencies: - '@types/node': 18.19.5 + '@types/node': 18.19.6 '@types/node-fetch': 2.6.10 abort-controller: 3.0.0 agentkeepalive: 4.5.0 @@ -11826,7 +11826,7 @@ packages: dependencies: lilconfig: 3.0.0 postcss: 8.4.33 - ts-node: 10.9.2(@types/node@20.10.7)(typescript@5.3.3) + ts-node: 10.9.2(@types/node@20.10.8)(typescript@5.3.3) yaml: 2.3.4 dev: true @@ -12025,7 +12025,7 @@ packages: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 20.10.7 + '@types/node': 20.10.8 long: 5.2.3 /psl@1.9.0: @@ -12574,11 +12574,12 @@ packages: integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==, } - /safe-regex-test@1.0.0: + /safe-regex-test@1.0.1: resolution: { - integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==, + integrity: sha512-Y5NejJTTliTyY4H7sipGqY+RX5P87i3F7c4Rcepy72nq+mNLhIsD0W4c7kEmduMDQCSqtPsXPlSTsFhh2LQv+g==, } + engines: { node: '>= 0.4' } dependencies: call-bind: 1.0.5 get-intrinsic: 1.2.2 @@ -13511,7 +13512,7 @@ packages: webpack: 5.89.0(webpack-cli@5.1.4) dev: true - /ts-node@10.9.2(@types/node@20.10.7)(typescript@5.3.3): + /ts-node@10.9.2(@types/node@20.10.8)(typescript@5.3.3): resolution: { integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==, @@ -13533,7 +13534,7 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.10.7 + '@types/node': 20.10.8 acorn: 8.11.3 acorn-walk: 8.3.1 arg: 4.1.3 @@ -13887,10 +13888,10 @@ packages: requires-port: 1.0.0 dev: true - /use-intl@3.4.1(react@18.2.0): + /use-intl@3.4.2(react@18.2.0): resolution: { - integrity: sha512-Z2SWvtFXXytpKCTMeyNX6Un8HC8mmu1RxYIHOwI01rMSy6mGBFaO9T1a/0xDL1CLNLP4NzHdzRNsuhDcrw2/VQ==, + integrity: sha512-+9xUu01CqkxV0fqMXmxi08gUNCcWGSDFmSHiMSzodRXWGBPFeXcnhQXQ5UOGoCUQygW6vH+dntyXTKtb4hefYw==, } peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -13955,7 +13956,7 @@ packages: engines: { node: '>= 0.10' } dev: false - /vite-node@1.1.3(@types/node@20.10.7): + /vite-node@1.1.3(@types/node@20.10.8): resolution: { integrity: sha512-BLSO72YAkIUuNrOx+8uznYICJfTEbvBAmWClY3hpath5+h1mbPS5OMn42lrTxXuyCazVyZoDkSRnju78GiVCqA==, @@ -13967,7 +13968,7 @@ packages: debug: 4.3.4 pathe: 1.1.1 picocolors: 1.0.0 - vite: 5.0.11(@types/node@20.10.7)(sass@1.69.7) + vite: 5.0.11(@types/node@20.10.8)(sass@1.69.7) transitivePeerDependencies: - '@types/node' - less @@ -13989,7 +13990,7 @@ packages: dependencies: magic-string: 0.30.5 svgo: 3.2.0 - vite: 5.0.11(@types/node@20.10.7)(sass@1.69.7) + vite: 5.0.11(@types/node@20.10.8)(sass@1.69.7) xml2js: 0.6.2 dev: true @@ -14012,7 +14013,7 @@ packages: - typescript dev: true - /vite@5.0.11(@types/node@20.10.7)(sass@1.69.7): + /vite@5.0.11(@types/node@20.10.8)(sass@1.69.7): resolution: { integrity: sha512-XBMnDjZcNAw/G1gEiskiM1v6yzM4GE5aMGvhWTlHAYYhxb7S3/V1s3m2LDHa8Vh6yIWYYB0iJwsEaS523c4oYA==, @@ -14043,7 +14044,7 @@ packages: terser: optional: true dependencies: - '@types/node': 20.10.7 + '@types/node': 20.10.8 esbuild: 0.19.11 postcss: 8.4.33 rollup: 4.9.4 @@ -14063,10 +14064,10 @@ packages: dependencies: ts-essentials: 9.4.1(typescript@5.3.3) typescript: 5.3.3 - vitest: 1.1.3(@types/node@20.10.7) + vitest: 1.1.3(@types/node@20.10.8) dev: true - /vitest@1.1.3(@types/node@20.10.7): + /vitest@1.1.3(@types/node@20.10.8): resolution: { integrity: sha512-2l8om1NOkiA90/Y207PsEvJLYygddsOyr81wLQ20Ra8IlLKbyQncWsGZjnbkyG2KwwuTXLQjEPOJuxGMG8qJBQ==, @@ -14094,7 +14095,7 @@ packages: jsdom: optional: true dependencies: - '@types/node': 20.10.7 + '@types/node': 20.10.8 '@vitest/expect': 1.1.3 '@vitest/runner': 1.1.3 '@vitest/snapshot': 1.1.3 @@ -14113,8 +14114,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.5.1 tinypool: 0.8.1 - vite: 5.0.11(@types/node@20.10.7)(sass@1.69.7) - vite-node: 1.1.3(@types/node@20.10.7) + vite: 5.0.11(@types/node@20.10.8)(sass@1.69.7) + vite-node: 1.1.3(@types/node@20.10.8) why-is-node-running: 2.2.2 transitivePeerDependencies: - less