File size: 5,281 Bytes
7d0c16f 0324409 cb369af ac1c425 cb369af ac1c425 cb369af ac1c425 cb369af 0324409 cb369af 7b36b01 ac1c425 7b36b01 cb369af 0324409 ac1c425 0324409 7d0c16f ac1c425 cb369af ac1c425 cb369af 7d0c16f 0324409 cb369af 0324409 ac1c425 cb369af 0324409 cb369af 0324409 cb369af 0324409 cb369af 0324409 cb369af 7b36b01 cb369af 7b36b01 cb369af 7b36b01 cb369af 0324409 cb369af 0324409 cb369af 7b36b01 cb369af 0324409 cb369af 7b36b01 cb369af 0324409 cb369af 0324409 cb369af 7b36b01 cb369af 0324409 cb369af 7b36b01 cb369af 0324409 7d0c16f cb369af ac1c425 0324409 cb369af ac1c425 7b36b01 0324409 cb369af ac1c425 0324409 7d0c16f cb369af 7d0c16f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
{% extends "base.html.j2" %}
{% import "components.html.j2" as ui %}
{% block content %}
{# =========================
VALIDACI脫N RA脥Z REAL
========================= #}
{% if not (doc and doc is mapping) %}
<div class="alert alert-error">
<strong>Error:</strong> El documento recibido no tiene una estructura v谩lida.
</div>
{% else %}
<header class="doc-header">
<h1>
RESTlet 路
{{ doc.metadata.description
if doc.metadata and doc.metadata.description
else doc.metadata.script_type
if doc.metadata
else "Documento sin metadata" }}
</h1>
<p class="doc-header-meta">
SuiteScript {{ doc.metadata.suitescript_version if doc.metadata else "N/D" }}
</p>
<p class="muted">Documentaci贸n t茅cnica del servicio RESTlet.</p>
</header>
{% if doc.metadata %}
{{ ui.metadata_block(doc.metadata) }}
{% else %}
<p class="muted">No se proporcion贸 metadata.</p>
{% endif %}
{% if doc.summary %}
{{ ui.summary_block(doc.summary) }}
{% endif %}
{# ============================================================
ENDPOINTS
============================================================ #}
{% set endpoints = doc.endpoints if doc.endpoints and doc.endpoints is mapping else {} %}
<div class="section">
<h2>Endpoints</h2>
{% if endpoints|length == 0 %}
<p class="muted">No se definieron endpoints.</p>
{% else %}
{% for method, definition in endpoints.items() %}
<h3>{{ method|upper }}</h3>
{% if not (definition and definition is mapping) %}
<p class="muted">Definici贸n inv谩lida o no estructurada.</p>
{% else %}
{% if definition.description %}
<p>{{ definition.description }}</p>
{% endif %}
{# ---------------- INPUTS ---------------- #}
{% set inputs = definition.inputs if definition.inputs and definition.inputs is mapping else {} %}
{% if inputs|length == 0 %}
<p class="muted">No se definieron inputs.</p>
{% else %}
{% if inputs.url_params %}
{{ ui.table_block("URL params", inputs.url_params, [
{"field": "name", "title": "Nombre"},
{"field": "description", "title": "Descripci贸n"},
{"field": "type", "title": "Tipo"}
]) }}
{% endif %}
{% if inputs.query_string %}
{{ ui.table_block("Query string", inputs.query_string, [
{"field": "name", "title": "Nombre"},
{"field": "description", "title": "Descripci贸n"},
{"field": "type", "title": "Tipo"}
]) }}
{% endif %}
{% if inputs.body_fields %}
{{ ui.table_block("Body", inputs.body_fields, [
{"field": "name", "title": "Nombre"},
{"field": "description", "title": "Descripci贸n"},
{"field": "type", "title": "Tipo"}
]) }}
{% endif %}
{% endif %}
{# ---------------- L脫GICA ---------------- #}
{% if definition.logic %}
{{ ui.logic_block("L贸gica", definition.logic) }}
{% else %}
<p class="muted">No se document贸 la l贸gica.</p>
{% endif %}
{# ---------------- OPERACIONES ---------------- #}
{% if definition.record_operations %}
{{ ui.table_block("Operaciones sobre registros", definition.record_operations, [
{"field": "type", "title": "Operaci贸n"},
{"field": "recordType", "title": "Record"},
{"field": "details", "title": "Detalles"}
]) }}
{% endif %}
{# ---------------- B脷SQUEDAS ---------------- #}
{% if definition.searches %}
{{ ui.table_block("B煤squedas", definition.searches, [
{"field": "id", "title": "ID"},
{"field": "filters", "title": "Filtros"},
{"field": "columns", "title": "Columnas"}
]) }}
{% endif %}
{# ---------------- OUTPUT ---------------- #}
{% if definition.output %}
{{ ui.logic_block("Salida", definition.output) }}
{% else %}
<p class="muted">No se defini贸 salida.</p>
{% endif %}
{# ---------------- VALIDACIONES ---------------- #}
{% if definition.validations %}
{{ ui.list_block("Validaciones", definition.validations) }}
{% endif %}
{# ---------------- SIDE EFFECTS ---------------- #}
{% if definition.side_effects %}
{{ ui.list_block("Side effects", definition.side_effects) }}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
</div>
{# ================= VALIDACIONES GLOBALES ================= #}
{% if doc.validations %}
{{ ui.list_block("Validaciones globales", doc.validations) }}
{% endif %}
{# ================= ERRORES ================= #}
{% if doc.errors %}
{{ ui.table_block("Errores", doc.errors, [
{"field": "location", "title": "Ubicaci贸n"},
{"field": "description", "title": "Descripci贸n"},
{"field": "throws", "title": "Excepci贸n"}
]) }}
{% endif %}
{# ================= SIDE EFFECTS GLOBALES ================= #}
{% if doc.side_effects %}
{{ ui.list_block("Side effects globales", doc.side_effects) }}
{% endif %}
{% endif %}
{% endblock %}
|