Skip to content

Commit

Permalink
deploy: e14c3e5
Browse files Browse the repository at this point in the history
  • Loading branch information
OTA-Release-Bot committed May 22, 2024
1 parent dd2a9fc commit 8b7433b
Show file tree
Hide file tree
Showing 9 changed files with 519 additions and 28 deletions.
6 changes: 3 additions & 3 deletions jsdoc/Record.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ <h4 class="name" id="Record"><span class="type-signature"></span>new Record<span

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="recorder_record.js.html">recorder/record.js</a>, <a href="recorder_record.js.html#line1">line 1</a>
<a href="archivist_recorder_record.js.html">archivist/recorder/record.js</a>, <a href="archivist_recorder_record.js.html#line1">line 1</a>
</li></ul></dd>


Expand Down Expand Up @@ -155,13 +155,13 @@ <h4 class="name" id="Record"><span class="type-signature"></span>new Record<span
</div>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Record.html">Record</a></li></ul><h3>Global</h3><ul><li><a href="global.html#extract">extract</a></li><li><a href="global.html#fetch">fetch</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Record.html">Record</a></li></ul><h3>Global</h3><ul><li><a href="global.html#extract">extract</a></li><li><a href="global.html#fetch">fetch</a></li><li><a href="global.html#router">router</a></li></ul>
</nav>

<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a> on Wed May 22 2024 09:27:31 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a> on Wed May 22 2024 10:02:48 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: extract/index.js</title>
<title>JSDoc: Source: archivist/extract/index.js</title>

<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
Expand All @@ -17,7 +17,7 @@

<div id="main">

<h1 class="page-title">Source: extract/index.js</h1>
<h1 class="page-title">Source: archivist/extract/index.js</h1>



Expand Down Expand Up @@ -230,13 +230,13 @@ <h1 class="page-title">Source: extract/index.js</h1>
</div>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Record.html">Record</a></li></ul><h3>Global</h3><ul><li><a href="global.html#extract">extract</a></li><li><a href="global.html#fetch">fetch</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Record.html">Record</a></li></ul><h3>Global</h3><ul><li><a href="global.html#extract">extract</a></li><li><a href="global.html#fetch">fetch</a></li><li><a href="global.html#router">router</a></li></ul>
</nav>

<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a> on Wed May 22 2024 09:27:31 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a> on Wed May 22 2024 10:02:48 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: fetcher/index.js</title>
<title>JSDoc: Source: archivist/fetcher/index.js</title>

<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
Expand All @@ -17,7 +17,7 @@

<div id="main">

<h1 class="page-title">Source: fetcher/index.js</h1>
<h1 class="page-title">Source: archivist/fetcher/index.js</h1>



Expand Down Expand Up @@ -52,9 +52,9 @@ <h1 class="page-title">Source: fetcher/index.js</h1>
export default async function fetch({
url, executeClientScripts, cssSelectors,
config: {
navigationTimeout = config.get('fetcher.navigationTimeout'),
language = config.get('fetcher.language'),
waitForElementsTimeout = config.get('fetcher.waitForElementsTimeout'),
navigationTimeout = config.get('@opentermsarchive/engine.fetcher.navigationTimeout'),
language = config.get('@opentermsarchive/engine.fetcher.language'),
waitForElementsTimeout = config.get('@opentermsarchive/engine.fetcher.waitForElementsTimeout'),
} = {},
}) {
try {
Expand All @@ -77,13 +77,13 @@ <h1 class="page-title">Source: fetcher/index.js</h1>
</div>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Record.html">Record</a></li></ul><h3>Global</h3><ul><li><a href="global.html#extract">extract</a></li><li><a href="global.html#fetch">fetch</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Record.html">Record</a></li></ul><h3>Global</h3><ul><li><a href="global.html#extract">extract</a></li><li><a href="global.html#fetch">fetch</a></li><li><a href="global.html#router">router</a></li></ul>
</nav>

<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a> on Wed May 22 2024 09:27:31 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a> on Wed May 22 2024 10:02:48 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: recorder/record.js</title>
<title>JSDoc: Source: archivist/recorder/record.js</title>

<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
Expand All @@ -17,7 +17,7 @@

<div id="main">

<h1 class="page-title">Source: recorder/record.js</h1>
<h1 class="page-title">Source: archivist/recorder/record.js</h1>



Expand Down Expand Up @@ -82,13 +82,13 @@ <h1 class="page-title">Source: recorder/record.js</h1>
</div>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Record.html">Record</a></li></ul><h3>Global</h3><ul><li><a href="global.html#extract">extract</a></li><li><a href="global.html#fetch">fetch</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Record.html">Record</a></li></ul><h3>Global</h3><ul><li><a href="global.html#extract">extract</a></li><li><a href="global.html#fetch">fetch</a></li><li><a href="global.html#router">router</a></li></ul>
</nav>

<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a> on Wed May 22 2024 09:27:31 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a> on Wed May 22 2024 10:02:48 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: recorder/repositories/interface.js</title>
<title>JSDoc: Source: archivist/recorder/repositories/interface.js</title>

<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
Expand All @@ -17,7 +17,7 @@

<div id="main">

<h1 class="page-title">Source: recorder/repositories/interface.js</h1>
<h1 class="page-title">Source: archivist/recorder/repositories/interface.js</h1>



Expand Down Expand Up @@ -163,13 +163,13 @@ <h1 class="page-title">Source: recorder/repositories/interface.js</h1>
</div>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Record.html">Record</a></li></ul><h3>Global</h3><ul><li><a href="global.html#extract">extract</a></li><li><a href="global.html#fetch">fetch</a></li></ul>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Record.html">Record</a></li></ul><h3>Global</h3><ul><li><a href="global.html#extract">extract</a></li><li><a href="global.html#fetch">fetch</a></li><li><a href="global.html#router">router</a></li></ul>
</nav>

<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a> on Wed May 22 2024 09:27:31 GMT+0000 (Coordinated Universal Time)
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a> on Wed May 22 2024 10:02:48 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
Expand Down
210 changes: 210 additions & 0 deletions jsdoc/collection-api_routes_services.js.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Source: collection-api/routes/services.js</title>

<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

<h1 class="page-title">Source: collection-api/routes/services.js</h1>






<section>
<article>
<pre class="prettyprint source linenums"><code>import express from 'express';

import * as Services from '../../archivist/services/index.js';

const services = await Services.load();

/**
* @swagger
* tags:
* name: Services
* description: Services API
* components:
* schemas:
* Service:
* type: object
* description: Definition of a service and the agreements its provider sets forth. While the information is the same, the format differs from the JSON declaration files that are designed for readability by contributors.
* properties:
* id:
* type: string
* description: The ID of the service.
* name:
* type: string
* description: The name of the service.
* terms:
* type: array
* description: Information that enables tracking the content of agreements defined by the service provider.
* items:
* type: object
* properties:
* type:
* type: string
* description: The type of terms.
* sourceDocuments:
* type: array
* items:
* type: object
* properties:
* location:
* type: string
* format: uri
* description: The URL of the source document.
* executeClientScripts:
* type: boolean
* description: Whether client-side scripts should be executed.
* contentSelectors:
* type: string
* description: The CSS selectors for selecting significant content.
* insignificantContentSelectors:
* type: string
* description: The CSS selectors for selecting insignificant content.
* filters:
* type: array
* description: The names of filters to apply to the content.
* items:
* type: string
*/
const router = express.Router();

/**
* @swagger
* /services:
* get:
* summary: Enumerate all services.
* tags: [Services]
* produces:
* - application/json
* responses:
* 200:
* description: A JSON array of all services.
* content:
* application/json:
* schema:
* type: array
* items:
* type: object
* properties:
* id:
* type: string
* description: The ID of the service.
* name:
* type: string
* description: The name of the service.
* terms:
* type: array
* description: The declared terms types for this service.
* items:
* type: object
* properties:
* type:
* type: string
* description: The type of terms.
*/
router.get('/services', (req, res) => {
res.status(200).json(Object.values(services).map(service => ({
id: service.id,
name: service.name,
terms: service.getTermsTypes().map(type => ({ type })),
})));
});

/**
* @swagger
* /service/{serviceId}:
* get:
* summary: Retrieve the declaration of a specific service through its ID.
* tags: [Services]
* produces:
* - application/json
* parameters:
* - in: path
* name: serviceId
* description: The ID of the service.
* schema:
* type: string
* required: true
* examples:
* service-1:
* value: service-1
* summary: Simple service ID
* service-2:
* value: Service 2!
* summary: Service ID with spaces and special characters
* responses:
* 200:
* description: The full JSON declaration of the service with the given ID.
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/Service'
* 404:
* description: No service matching the provided ID is found.
*/
router.get('/service/:serviceId', (req, res) => {
const matchedServiceID = Object.keys(services).find(key => key.toLowerCase() === req.params.serviceId?.toLowerCase());
const service = services[matchedServiceID];

if (!service) {
res.status(404).send('Service not found');

return;
}

res.status(200).json({
id: service.id,
name: service.name,
terms: service.getTerms().map(terms => ({
type: terms.type,
sourceDocuments: terms.sourceDocuments.map(({ location, contentSelectors, insignificantContentSelectors, filters, executeClientScripts }) => ({
location,
contentSelectors,
insignificantContentSelectors,
executeClientScripts,
filters: filters?.map(filter => filter.name),
})),
})),
});
});

export default router;
</code></pre>
</article>
</section>




</div>

<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Record.html">Record</a></li></ul><h3>Global</h3><ul><li><a href="global.html#extract">extract</a></li><li><a href="global.html#fetch">fetch</a></li><li><a href="global.html#router">router</a></li></ul>
</nav>

<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.0</a> on Wed May 22 2024 10:02:48 GMT+0000 (Coordinated Universal Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>
Loading

0 comments on commit 8b7433b

Please sign in to comment.