diff --git a/apps/docs/src/content/docs/en/pages/devtools/azion-edge-runtime/api-reference/handlers.mdx b/apps/docs/src/content/docs/en/pages/devtools/azion-edge-runtime/api-reference/handlers.mdx index 218575f121..08e83d0b94 100644 --- a/apps/docs/src/content/docs/en/pages/devtools/azion-edge-runtime/api-reference/handlers.mdx +++ b/apps/docs/src/content/docs/en/pages/devtools/azion-edge-runtime/api-reference/handlers.mdx @@ -25,7 +25,11 @@ Under `azion dev`, `env` is the `process.env` of your machine: the whole shell e The fetch handler is the `fetch` method of the default export. Azion Runtime calls it with three arguments each time the function runs: ```javascript -async fetch(request, env, ctx) +export default { + async fetch(request, env, ctx) { + return new Response('Hello World!'); + }, +}; ``` ### Parameters @@ -47,7 +51,11 @@ The `env` parameter holds no variables in a deployed function. To read a variabl The firewall handler is the `firewall` method of the default export. A function instance on a firewall calls it in place of `fetch`: ```javascript -async firewall(request, env, ctx) +export default { + async firewall(request, env, ctx) { + ctx.continue(); + }, +}; ``` Azion CLI 4.24.0 runs Azion Bundler 1.2.0, which wraps the ES Modules `firewall` handler in `addEventListener('firewall', …)`. In a function built by Azion CLI 4.24.0 or later, `ctx` carries these methods, each bound to the firewall event: diff --git a/apps/docs/src/content/docs/en/pages/guides/account-lockout-policy/unlock-user-account-lockout-policy.mdx b/apps/docs/src/content/docs/en/pages/guides/account-lockout-policy/unlock-user-account-lockout-policy.mdx index 6a96cedaac..a152d998f0 100644 --- a/apps/docs/src/content/docs/en/pages/guides/account-lockout-policy/unlock-user-account-lockout-policy.mdx +++ b/apps/docs/src/content/docs/en/pages/guides/account-lockout-policy/unlock-user-account-lockout-policy.mdx @@ -45,10 +45,9 @@ The response is similar to this one: "results": [ { "id": 1, - ... "lockout": { "locked_at": "20240101T10:20:01", - "unlock_at": "20240102T10:20:01", + "unlock_at": "20240102T10:20:01" } } ] diff --git a/apps/docs/src/content/docs/en/pages/guides/accounts/configure-user-session-timeout.mdx b/apps/docs/src/content/docs/en/pages/guides/accounts/configure-user-session-timeout.mdx index 5f3fe557c4..7f1a21fdb4 100644 --- a/apps/docs/src/content/docs/en/pages/guides/accounts/configure-user-session-timeout.mdx +++ b/apps/docs/src/content/docs/en/pages/guides/accounts/configure-user-session-timeout.mdx @@ -47,6 +47,7 @@ The response is similar to this one: "max_idle_time": 1, "max_session_time": 5 } +} ``` `max_idle_time` sets how long an idle session lasts, and `max_session_time` how long any session lasts, both in *minutes*. @@ -85,6 +86,7 @@ The response is similar to this one: "max_idle_time": 1, "max_session_time": 5 } +} ``` The policy uses the new values for the sessions on the account. diff --git a/apps/docs/src/content/docs/en/pages/guides/marketplace/integrations/send-event-endpoint.mdx b/apps/docs/src/content/docs/en/pages/guides/marketplace/integrations/send-event-endpoint.mdx index 6ca6771f34..1d21ff0d72 100644 --- a/apps/docs/src/content/docs/en/pages/guides/marketplace/integrations/send-event-endpoint.mdx +++ b/apps/docs/src/content/docs/en/pages/guides/marketplace/integrations/send-event-endpoint.mdx @@ -226,7 +226,7 @@ When the argument file has no `http_connection_args` and no `s3_connection_args` When the function cannot connect to the HTTP endpoint or to the S3 provider, it ignores the user request. The function still creates an error log, which you can access through [Data Stream](/en/documentation/platform/data-stream/). For example, an invalid access key shows this message: -```json +```text [Send event to endpoint] S3 connection error; diff --git a/apps/docs/src/content/docs/en/pages/main-menu/reference/ai-inference/troubleshooting.mdx b/apps/docs/src/content/docs/en/pages/main-menu/reference/ai-inference/troubleshooting.mdx index 669ac14606..6713d9d327 100644 --- a/apps/docs/src/content/docs/en/pages/main-menu/reference/ai-inference/troubleshooting.mdx +++ b/apps/docs/src/content/docs/en/pages/main-menu/reference/ai-inference/troubleshooting.mdx @@ -159,11 +159,20 @@ The endpoint then returns the model response. ## The endpoint answers Missing model field or Invalid JSON -The endpoint of the AI Inference Starter Kit answers `400` with one of these bodies: +The endpoint of the AI Inference Starter Kit answers `400` with one of two bodies. For a body without the `model` field: ```json -{"error":"Missing 'model' field in request body"} -{"error":"Invalid JSON in request body"} +{ + "error": "Missing 'model' field in request body" +} +``` + +For a body that does not parse as JSON: + +```json +{ + "error": "Invalid JSON in request body" +} ``` The Function the template installs reads the model id from the `model` field of the body. A body without `model`, or a body that does not parse as JSON, stops before the model call. diff --git a/apps/docs/src/content/docs/en/pages/observe/data-stream/templates-and-payload.mdx b/apps/docs/src/content/docs/en/pages/observe/data-stream/templates-and-payload.mdx index 4e60c42270..119ecb0002 100644 --- a/apps/docs/src/content/docs/en/pages/observe/data-stream/templates-and-payload.mdx +++ b/apps/docs/src/content/docs/en/pages/observe/data-stream/templates-and-payload.mdx @@ -141,7 +141,7 @@ With the defaults, the endpoint receives NDJSON: one log line per line, with no With **Payload Log Line Separator** `\n` and **Payload Format** `$dataset`, the request body is NDJSON: -```json +```jsonl {"request_method": "GET", "host": "www.onedomain.com", "status": "200"} {"request_method": "POST", "host": "www.anotherdomain.net", "status": "200"} ``` diff --git a/apps/docs/src/content/docs/pt-br/pages/devtools/azion-edge-runtime/api-reference/handlers.mdx b/apps/docs/src/content/docs/pt-br/pages/devtools/azion-edge-runtime/api-reference/handlers.mdx index 001042e21e..3ee7a84381 100644 --- a/apps/docs/src/content/docs/pt-br/pages/devtools/azion-edge-runtime/api-reference/handlers.mdx +++ b/apps/docs/src/content/docs/pt-br/pages/devtools/azion-edge-runtime/api-reference/handlers.mdx @@ -25,7 +25,11 @@ Com `azion dev`, `env` é o `process.env` da sua máquina: todo o ambiente do sh O handler fetch é o método `fetch` do export default. O Azion Runtime o chama com três argumentos a cada execução da function: ```javascript -async fetch(request, env, ctx) +export default { + async fetch(request, env, ctx) { + return new Response('Hello World!'); + }, +}; ``` ### Parâmetros @@ -47,7 +51,11 @@ O parâmetro `env` não contém variáveis em uma function com deploy feito. Par O handler firewall é o método `firewall` do export default. Uma instância de function em um firewall o chama no lugar de `fetch`: ```javascript -async firewall(request, env, ctx) +export default { + async firewall(request, env, ctx) { + ctx.continue(); + }, +}; ``` Azion CLI 4.24.0 executa Azion Bundler 1.2.0, que envolve o handler `firewall` ES Modules em `addEventListener('firewall', …)`. Em uma function com build feito pela Azion CLI 4.24.0 ou posterior, `ctx` carrega estes métodos, cada um vinculado ao evento de firewall: diff --git a/apps/docs/src/content/docs/pt-br/pages/guias/account-lockout-policy/unlock-user-account-lockout-policy.mdx b/apps/docs/src/content/docs/pt-br/pages/guias/account-lockout-policy/unlock-user-account-lockout-policy.mdx index b1be31644a..913446a447 100644 --- a/apps/docs/src/content/docs/pt-br/pages/guias/account-lockout-policy/unlock-user-account-lockout-policy.mdx +++ b/apps/docs/src/content/docs/pt-br/pages/guias/account-lockout-policy/unlock-user-account-lockout-policy.mdx @@ -45,10 +45,9 @@ A resposta é semelhante a esta: "results": [ { "id": 1, - ... "lockout": { "locked_at": "20240101T10:20:01", - "unlock_at": "20240102T10:20:01", + "unlock_at": "20240102T10:20:01" } } ] diff --git a/apps/docs/src/content/docs/pt-br/pages/guias/contas/configurar-user-session-timeout.mdx b/apps/docs/src/content/docs/pt-br/pages/guias/contas/configurar-user-session-timeout.mdx index 67af68d891..ecd35bff41 100644 --- a/apps/docs/src/content/docs/pt-br/pages/guias/contas/configurar-user-session-timeout.mdx +++ b/apps/docs/src/content/docs/pt-br/pages/guias/contas/configurar-user-session-timeout.mdx @@ -47,6 +47,7 @@ A resposta é semelhante a esta: "max_idle_time": 1, "max_session_time": 5 } +} ``` `max_idle_time` define quanto tempo uma sessão ociosa dura, e `max_session_time`, quanto tempo qualquer sessão dura, ambos em *minutos*. @@ -85,6 +86,7 @@ A resposta é semelhante a esta: "max_idle_time": 1, "max_session_time": 5 } +} ``` A política passa a usar os novos valores para as sessões da conta. diff --git a/apps/docs/src/content/docs/pt-br/pages/guias/marketplace/integrations/send-event-endpoint.mdx b/apps/docs/src/content/docs/pt-br/pages/guias/marketplace/integrations/send-event-endpoint.mdx index 8332d5272c..44f37597de 100644 --- a/apps/docs/src/content/docs/pt-br/pages/guias/marketplace/integrations/send-event-endpoint.mdx +++ b/apps/docs/src/content/docs/pt-br/pages/guias/marketplace/integrations/send-event-endpoint.mdx @@ -226,7 +226,7 @@ Quando o arquivo de argumentos não tem `http_connection_args` nem `s3_connectio Quando a function não consegue se conectar ao endpoint HTTP ou ao provedor S3, ela ignora a requisição do usuário. A function ainda cria um log de erro, que você acessa pelo [Data Stream](/pt-br/documentacao/plataforma/data-stream/). Por exemplo, uma access key inválida mostra esta mensagem: -```json +```text [Send event to endpoint] S3 connection error; diff --git a/apps/docs/src/content/docs/pt-br/pages/menu-principal/referencia/ai-inference/solucao-de-problemas.mdx b/apps/docs/src/content/docs/pt-br/pages/menu-principal/referencia/ai-inference/solucao-de-problemas.mdx index 6a336674fc..1bb3b0bdda 100644 --- a/apps/docs/src/content/docs/pt-br/pages/menu-principal/referencia/ai-inference/solucao-de-problemas.mdx +++ b/apps/docs/src/content/docs/pt-br/pages/menu-principal/referencia/ai-inference/solucao-de-problemas.mdx @@ -159,11 +159,20 @@ O endpoint então retorna a resposta do modelo. ## O endpoint responde Missing model field ou Invalid JSON -O endpoint do AI Inference Starter Kit responde `400` com um destes corpos: +O endpoint do AI Inference Starter Kit responde `400` com um de dois corpos. Para um corpo sem o campo `model`: ```json -{"error":"Missing 'model' field in request body"} -{"error":"Invalid JSON in request body"} +{ + "error": "Missing 'model' field in request body" +} +``` + +Para um corpo que não é um JSON válido: + +```json +{ + "error": "Invalid JSON in request body" +} ``` A Function que o template instala lê o id do modelo do campo `model` do corpo. Um corpo sem `model`, ou um corpo que não é um JSON válido, para antes da chamada de modelo. diff --git a/apps/docs/src/content/docs/pt-br/pages/observe/data-stream/templates-and-payload.mdx b/apps/docs/src/content/docs/pt-br/pages/observe/data-stream/templates-and-payload.mdx index aa4cc1e8db..cb21df7f17 100644 --- a/apps/docs/src/content/docs/pt-br/pages/observe/data-stream/templates-and-payload.mdx +++ b/apps/docs/src/content/docs/pt-br/pages/observe/data-stream/templates-and-payload.mdx @@ -141,7 +141,7 @@ Com os valores padrão, o endpoint recebe NDJSON: uma linha de log por linha, se Com **Payload Log Line Separator** `\n` e **Payload Format** `$dataset`, o corpo da requisição é NDJSON: -```json +```jsonl {"request_method": "GET", "host": "www.onedomain.com", "status": "200"} {"request_method": "POST", "host": "www.anotherdomain.net", "status": "200"} ```