Skip to content
Snippets Groups Projects
Commit cbd1de5b authored by Henrik Askjer's avatar Henrik Askjer
Browse files

Merge branch 'dev' into 'prod'

Dev

See merge request spraksamlingane/beta.ordbok.uib.no!125
parents 4814ab18 ef903516
No related branches found
No related tags found
No related merge requests found
...@@ -22,10 +22,10 @@ build-dev: ...@@ -22,10 +22,10 @@ build-dev:
when: manual when: manual
- when: on_success - when: on_success
script: script:
- |- - |-
if [[ $CI_PIPELINE_SOURCE == "merge_request_event" ]]; then if [[ $CI_PIPELINE_SOURCE == "merge_request_event" ]]; then
echo "VUE_APP_RELEASE=MERGE $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME ($CI_COMMIT_SHORT_SHA)" >> .env.dev_server echo "VUE_APP_RELEASE=MERGE $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME ($CI_COMMIT_SHORT_SHA)" >> .env.dev_server
else else
echo "VUE_APP_RELEASE=BRANCH $CI_COMMIT_BRANCH ($CI_COMMIT_SHORT_SHA)" >> .env.dev_server echo "VUE_APP_RELEASE=BRANCH $CI_COMMIT_BRANCH ($CI_COMMIT_SHORT_SHA)" >> .env.dev_server
fi fi
- npm install --progress=false - npm install --progress=false
...@@ -47,7 +47,8 @@ build-prod: ...@@ -47,7 +47,8 @@ build-prod:
- echo "VUE_APP_RELEASE=$CI_COMMIT_REF_NAME" >> .env.production - echo "VUE_APP_RELEASE=$CI_COMMIT_REF_NAME" >> .env.production
- npm install --progress=false - npm install --progress=false
- npm run build -- --mode production - npm run build -- --mode production
- 'echo -e "\nAllow: /" >> dist/robots.txt' - 'echo -e "\nDisallow: /" >> dist/robots.txt'
- 'echo -e "\nAllow: /index.html" >> dist/robots.txt'
artifacts: artifacts:
expire_in: 1 week expire_in: 1 week
paths: paths:
......
This diff is collapsed.
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head><meta charset="utf-8"> <head><meta charset="utf-8">
<meta http-equiv="refresh" content="0; URL=https://ord.uib.no/" />
<style> <style>
div { div {
...@@ -49,18 +48,11 @@ p { ...@@ -49,18 +48,11 @@ p {
<div id="main"> <div id="main">
<h1>Ordbok-API</h1> <h1>Ordbok-API</h1>
<h3>Hva er dette?</h3> <h3>Hva er dette?</h3>
<p>Gjennom denne tjenesten kan man gjøre oppslag i alle ord registrert i Bokmåls- og Nynorskordboka. Man trenger en API-nøkkel for å bruke tjenesten. Denne sendes ut <p>Gjennom denne ord.uib.no kan man gjøre oppslag i alle ord registrert i Bokmåls- og Nynorskordboka. Vi tilbyr foreløpig interaktiv dokumentasjon på engelsk og en mer omfattende brukerveiledning på norsk.
etter avtale, kontakt <a href="mailto:ordbokene@uib.no">ordbokene@uib.no</a> for mer informasjon. API-et er todelt, en åpen del som kan brukes av alle som har en API-nøkkel,
og en lukket del for redigering som kun er tilgjengelig for godkjente redaktører.
</p> </p>
<h3>Hva kan du forvente av denne tjenesten?</h3>
<p>Tjenesten er foreløpig i Beta. Selv om vi etterstreber å gjøre alle endringer inkrementelle vil det kunne forekomme strukturelle endringer i denne fasen.</p>
<p>Tjenesten er overvåket innenfor vanlig arbeidstid, og vil normalt være tilgjengelig hele døgnet. Dersom tjenesten skulle bli utilgjengelig på ettermiddag eller kveld
vil dette blir løst så fort som mulig neste arbeidsdag.</p>
<div id="link-container"> <div id="link-container">
<div class="link"><a target="_blank" href ="/api/swagger-ui.html"><img src="https://unpkg.com/swagger-ui-dist@3.23.5/favicon-32x32.png"> Utforsk REST-API-en</a></div> <div class="link"> <a href="https://ord.uib.no/">Brukerveiledning</a> </div>
<div class="link"> <a href="/api/guide.html">Brukerveiledning</a> </div> <div class="link"><a target="_blank" href ="/api/swagger-ui.html"><img src="https://unpkg.com/swagger-ui-dist@3.23.5/favicon-32x32.png"> Explore the REST-API</a></div>
<div class="link"><a href="https://git.app.uib.no/spraksamlingane/api.ordbok.uib.no/-/blob/master/resources/swagger.json">Intern API</a> (velg den absolutte URLen fra menyen "servers")</div>
</div> </div>
</div> </div>
<div> </div> <div> </div>
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
window.onload = function() { window.onload = function() {
// Begin Swagger UI call region // Begin Swagger UI call region
const ui = SwaggerUIBundle({ const ui = SwaggerUIBundle({
url: "./swagger.json", url: "./swagger.yml",
dom_id: '#swagger-ui', dom_id: '#swagger-ui',
deepLinking: true, deepLinking: true,
presets: [ presets: [
......
{
"openapi": "3.0.1",
"info": {
"title": "Ordbok API",
"description": "This API is developed by the University of Bergen. Its purpose is to serve the new national dictionary website wich is under development. API keys are available upon request. No warranty.",
"version": "beta"
},
"servers": [
{
"url": "/api"
}
],
"paths": {
"/dict/{dict_id}": {
"get": {
"summary": "Dictionary metadata",
"description": "Returns metadata for a dictionary, including all entities used in article text",
"parameters": [
{
"name": "dict_id",
"in": "path",
"required": true,
"description": "Dictionary code, 'bob' for bokmål, 'nob' for nynorsk",
"schema": {
"type": "string"
},
"example": "bob"
}
],
"security": [
{
"api_key": []
}
],
"responses": {
"200": {
"description": "bla bla",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
},
"/dict/{dict_id}/article/{art_id}": {
"get": {
"summary": "Article lookup",
"description": "Returns an article with a specific numeric ID",
"parameters": [
{
"name": "dict_id",
"in": "path",
"required": true,
"description": "Dictionary code, 'bob' for bokmål, 'nob' for nynorsk",
"schema": {
"type": "string"
},
"example": "bob"
},
{
"name": "art_id",
"in": "path",
"required": true,
"description": "The numeric ID of an article",
"schema": {
"type": "integer"
},
"example": 15544
}
],
"security": [
{
"api_key": []
}
],
"responses": {
"200": {
"description": "bla bla",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
},
"/dict/{dict_id}/article/search": {
"get": {
"summary": "Search for a word",
"description": "Search for words as an article lemmas, or words occurring in certain article elements. For instance, old norse _fljúga_ will match the article for modern Norwegian verb _fly_ (meaning to fly)",
"parameters": [
{
"name": "dict_id",
"description": "Dictionary to search, 'bob' for bokmål, 'nob' for nynorsk, 'bob,nob' for both",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "q",
"description": "Query string",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"security": [
{
"api_key": []
}
],
"responses": {
"200": {
"description": "bla bla",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
},
"/dict/{dict_id}/article/suggest": {
"get": {
"summary": "Get autocomplete suggestions for a prefix",
"description": "Returns articles for words that begin with the prefix specified in query string 'q'",
"parameters": [
{
"name": "dict_id",
"description": "Dictionary to search, 'bob' for bokmål, 'nob' for nynorsk, 'bob,bob' for both",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "q",
"description": "Query string: prefix for autocomplete",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"security": [
{
"api_key": []
}
],
"responses": {
"200": {
"description": "bla bla",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
},
"securitySchemes": {
"api_key": {
"type": "apiKey",
"name": "x-api-key",
"in": "header"
}
}
}
}
openapi: 3.0.1
info:
title: Ordbok API
description: This API is developed by the University of Bergen. Its purpose is to serve the new national dictionary website wich is under development. No warranty.
version: 1.0.0
servers:
- url: https://ord.uib.no
paths:
/api/suggest:
get:
summary: Autocomplete
description: Suggests search keywords.
parameters:
- name: q
in: query
required: true
description: The search string
schema:
type: string
example: test
- name: dict
in: query
required: true
description: Dictionary code, 'bm' for bokmål, 'nn' for nynorsk, 'bm,nn' for both
schema:
type: string
example: bm,nn
- name: wc
in: query
description: "Filter by word class (part of speech tags: https://universaldependencies.org/u/pos/index.html). "
schema:
type: string
example: NOUN
- name: n
in: query
description: Number of results to return
schema:
type: integer
example: 4
- name: include
in: query
description: "Choose what types of suggestions you want to be included in the response. The parameter should be a concatenation of any of the following characters: e (exact lemma), f (full-text search), i (inflected forms), s (similar - fuzzy search)"
schema:
type: string
example: eis
- name: dform
in: query
description: "dfomr=int turns dictionary codes in the response into integers: 1 = bm, 2 = nn and 3 = bm,nn"
schema:
type: string
example: int
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
/api/articles:
get:
summary: Article search
description: Search for articles. Returns lists of article IDs.
parameters:
- name: w
in: query
required: true
description: Word (Query string)
schema:
type: string
example: test
- name: dict
in: query
required: true
description: Dictionary code, 'bm' for bokmål, 'nn' for nynorsk, 'bm,nn' for both
schema:
type: string
example: bm,nn
- name: wc
in: query
description: "Filter by word class (part of speech tags: https://universaldependencies.org/u/pos/index.html). "
schema:
type: string
example: NOUN
- name: scope
in: query
description: "Define the scope of your query. The parameter should be a concatenation of any of the following characters: e (exact lemma), f (full-text search), i (inflected forms)"
schema:
type: string
example: eif
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
/{dict}/article/{article_id}.json:
get:
summary: Article lookup
description: Returns an article with a specific numeric ID
parameters:
- name: dict
in: path
required: true
description: Dictionary code, 'bm' for bokmål, 'nn' for nynorsk, 'bm,nn' for both
schema:
type: string
example: bm,nn
- name: article_id
in: path
required: true
description: The numeric ID of an article
schema:
type: integer
example: 15544
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
\ No newline at end of file
...@@ -277,7 +277,7 @@ function navigate_to_query(self, word, keep_page) { ...@@ -277,7 +277,7 @@ function navigate_to_query(self, word, keep_page) {
} }
// Get article IDs // Get article IDs
let params = {w: query.match, dict: self.lang, scope: self.scope, meta: 'y'} let params = {w: query.match, dict: self.lang, scope: self.scope}
let offset = 0 let offset = 0
if (self.page) { if (self.page) {
offset = self.perPage * (self.page -1) offset = self.perPage * (self.page -1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment