Commit dfc3ff52 authored by Lukas Matt's avatar Lukas Matt

Remove api dir and update docs on build

parent 52217407
......@@ -2,3 +2,4 @@
_site/
public/
test/
tmp/
image: ruby:2.3
stages:
- build
- test
- deploy
variables:
JEKYLL_ENV: production
LC_ALL: C.UTF-8
before_script:
- bundle install
test:
update:api:docs:
before_script:
- curl -sL https://deb.nodesource.com/setup_10.x | bash -
- apt install -y nodejs
- npm install -g apidoc
stage: build
script:
- git clone --depth 1 https://git.feneas.org/ganggo/api.git -b master tmp
- cd tmp && apidoc -i app -o ../api
artifacts:
expire_in: "1 hour"
paths:
- api
test:jekyll:build:
stage: test
script:
- bundle exec jekyll build -d test
artifacts:
expire_in: "1 hour"
paths:
- test
dependencies:
- update:api:docs
except:
- master
pages:
......@@ -20,5 +40,7 @@ pages:
artifacts:
paths:
- public
dependencies:
- update:api:docs
only:
- master
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
define({
"name": "API Documentation",
"version": "0.0.0",
"description": "GangGo API Library",
"title": "API Documentation",
"url": "/api/v0",
"header": {
"content": "<h3><code>The API is under heavy development and documentation could differ!</code></h3>\n"
},
"footer": {
"content": ""
},
"sampleUrl": false,
"defaultVersion": "0.0.0",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2018-10-23T20:44:24.305Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
}
});
{
"name": "API Documentation",
"version": "0.0.0",
"description": "GangGo API Library",
"title": "API Documentation",
"url": "/api/v0",
"header": {
"content": "<h3><code>The API is under heavy development and documentation could differ!</code></h3>\n"
},
"footer": {
"content": ""
},
"sampleUrl": false,
"defaultVersion": "0.0.0",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2018-10-23T20:44:24.305Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
}
}
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
define({
ca: {
'Allowed values:' : 'Valors permesos:',
'Compare all with predecessor': 'Comparar tot amb versió anterior',
'compare changes to:' : 'comparar canvis amb:',
'compared to' : 'comparat amb',
'Default value:' : 'Valor per defecte:',
'Description' : 'Descripció',
'Field' : 'Camp',
'General' : 'General',
'Generated with' : 'Generat amb',
'Name' : 'Nom',
'No response values.' : 'Sense valors en la resposta.',
'optional' : 'opcional',
'Parameter' : 'Paràmetre',
'Permission:' : 'Permisos:',
'Response' : 'Resposta',
'Send' : 'Enviar',
'Send a Sample Request' : 'Enviar una petició d\'exemple',
'show up to version:' : 'mostrar versió:',
'Size range:' : 'Tamany de rang:',
'Type' : 'Tipus',
'url' : 'url'
}
});
define({
de: {
'Allowed values:' : 'Erlaubte Werte:',
'Compare all with predecessor': 'Vergleiche alle mit ihren Vorgängern',
'compare changes to:' : 'vergleiche Änderungen mit:',
'compared to' : 'verglichen mit',
'Default value:' : 'Standardwert:',
'Description' : 'Beschreibung',
'Field' : 'Feld',
'General' : 'Allgemein',
'Generated with' : 'Erstellt mit',
'Name' : 'Name',
'No response values.' : 'Keine Rückgabewerte.',
'optional' : 'optional',
'Parameter' : 'Parameter',
'Permission:' : 'Berechtigung:',
'Response' : 'Antwort',
'Send' : 'Senden',
'Send a Sample Request' : 'Eine Beispielanfrage senden',
'show up to version:' : 'zeige bis zur Version:',
'Size range:' : 'Größenbereich:',
'Type' : 'Typ',
'url' : 'url'
}
});
define({
es: {
'Allowed values:' : 'Valores permitidos:',
'Compare all with predecessor': 'Comparar todo con versión anterior',
'compare changes to:' : 'comparar cambios con:',
'compared to' : 'comparado con',
'Default value:' : 'Valor por defecto:',
'Description' : 'Descripción',
'Field' : 'Campo',
'General' : 'General',
'Generated with' : 'Generado con',
'Name' : 'Nombre',
'No response values.' : 'Sin valores en la respuesta.',
'optional' : 'opcional',
'Parameter' : 'Parámetro',
'Permission:' : 'Permisos:',
'Response' : 'Respuesta',
'Send' : 'Enviar',
'Send a Sample Request' : 'Enviar una petición de ejemplo',
'show up to version:' : 'mostrar a versión:',
'Size range:' : 'Tamaño de rango:',
'Type' : 'Tipo',
'url' : 'url'
}
});
define({
fr: {
'Allowed values:' : 'Valeurs autorisées :',
'Compare all with predecessor': 'Tout comparer avec ...',
'compare changes to:' : 'comparer les changements à :',
'compared to' : 'comparer à',
'Default value:' : 'Valeur par défaut :',
'Description' : 'Description',
'Field' : 'Champ',
'General' : 'Général',
'Generated with' : 'Généré avec',
'Name' : 'Nom',
'No response values.' : 'Aucune valeur de réponse.',
'optional' : 'optionnel',
'Parameter' : 'Paramètre',
'Permission:' : 'Permission :',
'Response' : 'Réponse',
'Send' : 'Envoyer',
'Send a Sample Request' : 'Envoyer une requête représentative',
'show up to version:' : 'Montrer à partir de la version :',
'Size range:' : 'Ordre de grandeur :',
'Type' : 'Type',
'url' : 'url'
}
});
define({
it: {
'Allowed values:' : 'Valori permessi:',
'Compare all with predecessor': 'Confronta tutto con versioni precedenti',
'compare changes to:' : 'confronta modifiche con:',
'compared to' : 'confrontato con',
'Default value:' : 'Valore predefinito:',
'Description' : 'Descrizione',
'Field' : 'Campo',
'General' : 'Generale',
'Generated with' : 'Creato con',
'Name' : 'Nome',
'No response values.' : 'Nessun valore di risposta.',
'optional' : 'opzionale',
'Parameter' : 'Parametro',
'Permission:' : 'Permessi:',
'Response' : 'Risposta',
'Send' : 'Invia',
'Send a Sample Request' : 'Invia una richiesta di esempio',
'show up to version:' : 'mostra alla versione:',
'Size range:' : 'Intervallo dimensione:',
'Type' : 'Tipo',
'url' : 'url'
}
});
define([
'./locales/ca.js',
'./locales/de.js',
'./locales/es.js',
'./locales/fr.js',
'./locales/it.js',
'./locales/nl.js',
'./locales/pl.js',
'./locales/pt_br.js',
'./locales/ro.js',
'./locales/ru.js',
'./locales/tr.js',
'./locales/vi.js',
'./locales/zh.js',
'./locales/zh_cn.js'
], function() {
var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_');
var language = langId.substr(0, 2);
var locales = {};
for (index in arguments) {
for (property in arguments[index])
locales[property] = arguments[index][property];
}
if ( ! locales['en'])
locales['en'] = {};
if ( ! locales[langId] && ! locales[language])
language = 'en';
var locale = (locales[langId] ? locales[langId] : locales[language]);
function __(text) {
var index = locale[text];
if (index === undefined)
return text;
return index;
};
function setLanguage(language) {
locale = locales[language];
}
return {
__ : __,
locales : locales,
locale : locale,
setLanguage: setLanguage
};
});
define({
nl: {
'Allowed values:' : 'Toegestane waarden:',
'Compare all with predecessor': 'Vergelijk alle met voorgaande versie',
'compare changes to:' : 'vergelijk veranderingen met:',
'compared to' : 'vergelijk met',
'Default value:' : 'Standaard waarde:',
'Description' : 'Omschrijving',
'Field' : 'Veld',
'General' : 'Algemeen',
'Generated with' : 'Gegenereerd met',
'Name' : 'Naam',
'No response values.' : 'Geen response waardes.',
'optional' : 'optioneel',
'Parameter' : 'Parameter',
'Permission:' : 'Permissie:',
'Response' : 'Antwoorden',
'Send' : 'Sturen',
'Send a Sample Request' : 'Stuur een sample aanvragen',
'show up to version:' : 'toon tot en met versie:',
'Size range:' : 'Maatbereik:',
'Type' : 'Type',
'url' : 'url'
}
});
define({
pl: {
'Allowed values:' : 'Dozwolone wartości:',
'Compare all with predecessor': 'Porównaj z poprzednimi wersjami',
'compare changes to:' : 'porównaj zmiany do:',
'compared to' : 'porównaj do:',
'Default value:' : 'Wartość domyślna:',
'Description' : 'Opis',
'Field' : 'Pole',
'General' : 'Generalnie',
'Generated with' : 'Wygenerowano z',
'Name' : 'Nazwa',
'No response values.' : 'Brak odpowiedzi.',
'optional' : 'opcjonalny',
'Parameter' : 'Parametr',
'Permission:' : 'Uprawnienia:',
'Response' : 'Odpowiedź',
'Send' : 'Wyślij',
'Send a Sample Request' : 'Wyślij przykładowe żądanie',
'show up to version:' : 'pokaż do wersji:',
'Size range:' : 'Zakres rozmiaru:',
'Type' : 'Typ',
'url' : 'url'
}
});
define({
'pt_br': {
'Allowed values:' : 'Valores permitidos:',
'Compare all with predecessor': 'Compare todos com antecessores',
'compare changes to:' : 'comparar alterações com:',
'compared to' : 'comparado com',
'Default value:' : 'Valor padrão:',
'Description' : 'Descrição',
'Field' : 'Campo',
'General' : 'Geral',
'Generated with' : 'Gerado com',
'Name' : 'Nome',
'No response values.' : 'Sem valores de resposta.',
'optional' : 'opcional',
'Parameter' : 'Parâmetro',
'Permission:' : 'Permissão:',
'Response' : 'Resposta',
'Send' : 'Enviar',
'Send a Sample Request' : 'Enviar um Exemplo de Pedido',
'show up to version:' : 'aparecer para a versão:',
'Size range:' : 'Faixa de tamanho:',
'Type' : 'Tipo',
'url' : 'url'
}
});
define({
ro: {
'Allowed values:' : 'Valori permise:',
'Compare all with predecessor': 'Compară toate cu versiunea precedentă',
'compare changes to:' : 'compară cu versiunea:',
'compared to' : 'comparat cu',
'Default value:' : 'Valoare implicită:',
'Description' : 'Descriere',
'Field' : 'Câmp',
'General' : 'General',
'Generated with' : 'Generat cu',
'Name' : 'Nume',
'No response values.' : 'Nici o valoare returnată.',
'optional' : 'opțional',
'Parameter' : 'Parametru',
'Permission:' : 'Permisiune:',
'Response' : 'Răspuns',
'Send' : 'Trimite',
'Send a Sample Request' : 'Trimite o cerere de probă',
'show up to version:' : 'arată până la versiunea:',
'Size range:' : 'Interval permis:',
'Type' : 'Tip',
'url' : 'url'
}
});
define({
ru: {
'Allowed values:' : 'Допустимые значения:',
'Compare all with predecessor': 'Сравнить с предыдущей версией',
'compare changes to:' : 'сравнить с:',
'compared to' : 'в сравнении с',
'Default value:' : 'По умолчанию:',
'Description' : 'Описание',
'Field' : 'Название',
'General' : 'Общая информация',
'Generated with' : 'Сгенерировано с помощью',
'Name' : 'Название',
'No response values.' : 'Нет значений для ответа.',
'optional' : 'необязательный',
'Parameter' : 'Параметр',
'Permission:' : 'Разрешено:',
'Response' : 'Ответ',
'Send' : 'Отправить',
'Send a Sample Request' : 'Отправить тестовый запрос',
'show up to version:' : 'показать версию:',
'Size range:' : 'Ограничения:',
'Type' : 'Тип',
'url' : 'URL'
}
});
define({
tr: {
'Allowed values:' : 'İzin verilen değerler:',
'Compare all with predecessor': 'Tümünü öncekiler ile karşılaştır',
'compare changes to:' : 'değişiklikleri karşılaştır:',
'compared to' : 'karşılaştır',
'Default value:' : 'Varsayılan değer:',
'Description' : 'Açıklama',
'Field' : 'Alan',
'General' : 'Genel',
'Generated with' : 'Oluşturan',
'Name' : 'İsim',
'No response values.' : 'Dönüş verisi yok.',
'optional' : 'opsiyonel',
'Parameter' : 'Parametre',
'Permission:' : 'İzin:',
'Response' : 'Dönüş',
'Send' : 'Gönder',
'Send a Sample Request' : 'Örnek istek gönder',
'show up to version:' : 'bu versiyona kadar göster:',
'Size range:' : 'Boyut aralığı:',
'Type' : 'Tip',
'url' : 'url'
}
});
define({
vi: {
'Allowed values:' : 'Giá trị chấp nhận:',
'Compare all with predecessor': 'So sánh với tất cả phiên bản trước',
'compare changes to:' : 'so sánh sự thay đổi với:',
'compared to' : 'so sánh với',
'Default value:' : 'Giá trị mặc định:',
'Description' : 'Chú thích',
'Field' : 'Trường dữ liệu',
'General' : 'Tổng quan',
'Generated with' : 'Được tạo bởi',
'Name' : 'Tên',
'No response values.' : 'Không có kết quả trả về.',
'optional' : 'Tùy chọn',
'Parameter' : 'Tham số',
'Permission:' : 'Quyền hạn:',
'Response' : 'Kết quả',
'Send' : 'Gửi',
'Send a Sample Request' : 'Gửi một yêu cầu mẫu',
'show up to version:' : 'hiển thị phiên bản:',
'Size range:' : 'Kích cỡ:',
'Type' : 'Kiểu',
'url' : 'liên kết'
}
});
define({
zh: {
'Allowed values​​:' : '允許值:',
'Compare all with predecessor': '預先比較所有',
'compare changes to:' : '比較變更:',
'compared to' : '對比',
'Default value:' : '默認值:',
'Description' : '描述',
'Field' : '字段',
'General' : '概括',
'Generated with' : '生成工具',
'Name' : '名稱',
'No response values​​.' : '無對應資料.',
'optional' : '選項',
'Parameter' : '參數',
'Permission:' : '允許:',
'Response' : '回應',
'Send' : '發送',
'Send a Sample Request' : '發送試用需求',
'show up to version:' : '顯示到版本:',
'Size range:' : '尺寸範圍:',
'Type' : '類型',
'url' : '網址'
}
});
define({
'zh_cn': {
'Allowed values:' : '允许值:',
'Compare all with predecessor': '与所有较早的比较',
'compare changes to:' : '将当前版本与指定版本比较:',
'compared to' : '相比于',
'Default value:' : '默认值:',
'Description' : '描述',
'Field' : '字段',
'General' : '概要',
'Generated with' : '基于',
'Name' : '名称',
'No response values.' : '无返回值.',
'optional' : '可选',
'Parameter' : '参数',
'Permission:' : '权限:',
'Response' : '返回',
'Send' : '发送',
'Send a Sample Request' : '发送示例请求',
'show up to version:' : '显示到指定版本:',
'Size range:' : '取值范围:',
'Type' : '类型',
'url' : '网址'
}
});
This diff is collapsed.
This diff is collapsed.
define([
'jquery',
'lodash'
], function($, _) {
var initDynamic = function() {
// Button send
$(".sample-request-send").off("click");
$(".sample-request-send").on("click", function(e) {
e.preventDefault();
var $root = $(this).parents("article");
var group = $root.data("group");
var name = $root.data("name");
var version = $root.data("version");
sendSampleRequest(group, name, version, $(this).data("sample-request-type"));
});
// Button clear
$(".sample-request-clear").off("click");
$(".sample-request-clear").on("click", function(e) {
e.preventDefault();
var $root = $(this).parents("article");
var group = $root.data("group");
var name = $root.data("name");
var version = $root.data("version");
clearSampleRequest(group, name, version);
});
}; // initDynamic
function sendSampleRequest(group, name, version, type)
{
var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version + '"]');
// Optional header
var header = {};
$root.find(".sample-request-header:checked").each(function(i, element) {
var group = $(element).data("sample-request-header-group-id");
$root.find("[data-sample-request-header-group=\"" + group + "\"]").each(function(i, element) {
var key = $(element).data("sample-request-header-name");
var value = element.value;
if ( ! element.optional && element.defaultValue !== '') {
value = element.defaultValue;
}
header[key] = value;
});
});
// create JSON dictionary of parameters
var param = {};
var paramType = {};
$root.find(".sample-request-param:checked").each(function(i, element) {
var group = $(element).data("sample-request-param-group-id");
$root.find("[data-sample-request-param-group=\"" + group + "\"]").not(function(){
return $(this).val() == "" && $(this).is("[data-sample-request-param-optional='true']");
}).each(function(i, element) {
var key = $(element).data("sample-request-param-name");
var value = element.value;
if ( ! element.optional && element.defaultValue !== '') {
value = element.defaultValue;
}
param[key] = value;
paramType[key] = $(element).next().text();
});
});
// grab user-inputted URL
var url = $root.find(".sample-request-url").val();
// Insert url parameter
var pattern = pathToRegexp(url, null);
var matches = pattern.exec(url);
for (var i = 1; i < matches.length; i++) {
var key = matches[i].substr(1);
if (param[key] !== undefined) {
url = url.replace(matches[i], encodeURIComponent(param[key]));
// remove URL parameters from list
delete param[key];
}
} // for
$root.find(".sample-request-response").fadeTo(250, 1);
$root.find(".sample-request-response-json").html("Loading...");
refreshScrollSpy();
_.each( param, function( val, key ) {
var t = paramType[ key ].toLowerCase();
if ( t === 'object' || t === 'array' ) {
try {
param[ key ] = JSON.parse( val );
} catch (e) {
}
}
});
// send AJAX request, catch success or error callback
var ajaxRequest = {
url : url,
headers : header,
data : param,
type : type.toUpperCase(),
success : displaySuccess,
error : displayError
};
$.ajax(ajaxRequest);
function displaySuccess(data, status, jqXHR) {
var jsonResponse;
try {
jsonResponse = JSON.parse(jqXHR.responseText);
jsonResponse = JSON.stringify(jsonResponse, null, 4);
} catch (e) {
jsonResponse = data;
}
$root.find(".sample-request-response-json").html(jsonResponse);
refreshScrollSpy();
};
function displayError(jqXHR, textStatus, error) {
var message = "Error " + jqXHR.status + ": " + error;
var jsonResponse;
try {
jsonResponse = JSON.parse(jqXHR.responseText);
jsonResponse = JSON.stringify(jsonResponse, null, 4);
} catch (e) {
jsonResponse = escape(jqXHR.responseText);
}
if (jsonResponse)
message += "<br>" + jsonResponse;
// flicker on previous error to make clear that there is a new response
if($root.find(".sample-request-response").is(":visible"))
$root.find(".sample-request-response").fadeTo(1, 0.1);
$root.find(".sample-request-response").fadeTo(250, 1);
$root.find(".sample-request-response-json").html(message);
refreshScrollSpy();
};
}
function clearSampleRequest(group, name, version)
{
var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version