diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 9ab2106..3f355cd 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -65,7 +65,7 @@ jobs: && echo "HASH_DRIVER=bcrypt" >> .env.test && echo "HOST=127.0.0.1" >> .env.test && echo "PORT=3333" >> .env.test - && echo "APP_NAME=AdonisJs" >> .env.test + && echo "APP_NAME=TethysCloud" >> .env.test && echo "APP_URL=http://${HOST}:${PORT}" >> .env.test && echo "CACHE_VIEWS=false" >> .env.test && echo "APP_KEY=pfi5N2ACN4tMJ5d8d8BPHfh3FEuvleej" >> .env.test diff --git a/app/Controllers/Http/Editor/DatasetController.ts b/app/Controllers/Http/Editor/DatasetController.ts index a7a0784..0cc1856 100644 --- a/app/Controllers/Http/Editor/DatasetController.ts +++ b/app/Controllers/Http/Editor/DatasetController.ts @@ -311,14 +311,10 @@ export default class DatasetsController { let prefix = ''; let base_domain = ''; - const datacite_environment = process.env.DATACITE_ENVIRONMENT || 'debug'; - if (datacite_environment === 'debug') { - prefix = process.env.DATACITE_TEST_PREFIX || ''; - base_domain = process.env.TEST_BASE_DOMAIN || ''; - } else if (datacite_environment === 'production') { - prefix = process.env.DATACITE_PREFIX || ''; - base_domain = process.env.BASE_DOMAIN || ''; - } + // const datacite_environment = process.env.DATACITE_ENVIRONMENT || 'debug'; + prefix = process.env.DATACITE_PREFIX || ''; + base_domain = process.env.BASE_DOMAIN || ''; + // register DOI: const doiValue = prefix + '/tethys.' + dataset.publish_id; //'10.21388/tethys.213' diff --git a/app/Library/Doi/DoiClient.ts b/app/Library/Doi/DoiClient.ts index c07844c..38a54c8 100644 --- a/app/Library/Doi/DoiClient.ts +++ b/app/Library/Doi/DoiClient.ts @@ -5,30 +5,21 @@ import DoiClientContract from 'App/Library/Doi/DoiClientContract'; import DoiClientException from 'App/Exceptions/DoiClientException'; import { StatusCodes } from 'http-status-codes'; import Logger from '@ioc:Adonis/Core/Logger'; -import axios, {AxiosResponse} from 'axios'; +import axios, { AxiosResponse } from 'axios'; export class DoiClient implements DoiClientContract { - username: string; - password: string; - serviceUrl: string; - // prefix: string; - // base_domain: string; + public username: string; + public password: string; + public serviceUrl: string; constructor() { - const datacite_environment = process.env.DATACITE_ENVIRONMENT || 'debug'; - if (datacite_environment === 'debug') { - this.username = process.env.DATACITE_TEST_USERNAME || ''; - this.password = process.env.DATACITE_TEST_PASSWORD || ''; - this.serviceUrl = process.env.DATACITE_TEST_SERVICE_URL || ''; - // this.prefix = process.env.DATACITE_TEST_PREFIX || ''; - // this.base_domain = process.env.TEST_BASE_DOMAIN || ''; - } else if (datacite_environment === 'production') { - this.username = process.env.DATACITE_USERNAME || ''; - this.password = process.env.DATACITE_PASSWORD || ''; - this.serviceUrl = process.env.DATACITE_SERVICE_URL || ''; - // this.prefix = process.env.DATACITE_PREFIX || ''; - // this.base_domain = process.env.BASE_DOMAIN || ''; - } + // const datacite_environment = process.env.DATACITE_ENVIRONMENT || 'debug'; + this.username = process.env.DATACITE_USERNAME || ''; + this.password = process.env.DATACITE_PASSWORD || ''; + this.serviceUrl = process.env.DATACITE_SERVICE_URL || ''; + // this.prefix = process.env.DATACITE_PREFIX || ''; + // this.base_domain = process.env.BASE_DOMAIN || ''; + if (this.username === '' || this.password === '' || this.serviceUrl === '') { const message = 'issing configuration settings to properly initialize DOI client'; Logger.error(message); @@ -43,13 +34,13 @@ export class DoiClient implements DoiClientContract { * @param xmlMeta * @param landingPageUrl e.g. https://www.tethys.at/dataset/1 * - * @return Promise The http response in the form of a axios response + * @return Promise> The http response in the form of a axios response */ public async registerDoi(doiValue: string, xmlMeta: string, landingPageUrl: string): Promise> { //step 1: register metadata via xml upload // state draft - let response; - let url = `${this.serviceUrl}/metadata/${doiValue}`; //https://mds.test.datacite.org/metadata/10.21388/tethys.213 + // let response; + // let url = `${this.serviceUrl}/metadata/${doiValue}`; //https://mds.test.datacite.org/metadata/10.21388/tethys.213 const auth = { username: this.username, password: this.password, @@ -58,62 +49,44 @@ export class DoiClient implements DoiClientContract { 'Content-Type': 'application/xml;charset=UTF-8', }; try { - response = await axios.put(url, xmlMeta, { - auth, - headers, - }); - } catch (error) { - const message = `request to ${url} failed with ${error.message}`; - // Handle the error, log it, or rethrow as needed - Logger.error(message); - throw new DoiClientException(StatusCodes.SERVICE_UNAVAILABLE, message); - } - // let test = response.data; // 'OK (10.21388/TETHYS.213)' + const metadataResponse = await axios.put(`${this.serviceUrl}/metadata/${doiValue}`, xmlMeta, { auth, headers }); - // Response Codes - // 201 Created: operation successful - // 401 Unauthorised: no login - // 403 Forbidden: login problem, quota exceeded - // 415 Wrong Content Type : Not including content type in the header. - // 422 Unprocessable Entity : invalid XML - if (response.status !== 201) { - const message = 'unexpected DataCite MDS response code ' + response.status; - // $this->log($message, 'err'); - throw new DoiClientException(response.status, message); - } + // Response Codes + // 201 Created: operation successful + // 401 Unauthorised: no login + // 403 Forbidden: login problem, quota exceeded + // 415 Wrong Content Type : Not including content type in the header. + // 422 Unprocessable Entity : invalid XML + // let test = metadataResponse.data; // 'OK (10.21388/TETHYS.213)' + if (metadataResponse.status !== 201) { + const message = `Unexpected DataCite MDS response code ${metadataResponse.status}`; + Logger.error(message); + throw new DoiClientException(metadataResponse.status, message); + } - // step 2: Register the DOI name - // // DOI und URL der Frontdoor des zugehörigen Dokuments übergeben: state findable - // const url2 = this.serviceUrl + "/doi/" + doiValue; - url = `${this.serviceUrl}/doi/${doiValue}`; //'https://mds.test.datacite.org/doi/10.21388/tethys.213' - headers = { - 'Content-Type': 'text/plain;charset=UTF-8', - }; - const data = `doi=${doiValue}\nurl=${landingPageUrl}`; - try { - response = await axios.put(url, data, { + const doiResponse = await axios.put(`${this.serviceUrl}/doi/${doiValue}`, `doi=${doiValue}\nurl=${landingPageUrl}`, { auth, headers, }); - // Access the response data using response.data - // Do something with the response.data + // Response Codes + // 201 Created: operation successful + // 400 Bad Request: request body must be exactly two lines: DOI and URL; wrong domain, wrong prefix; + // 401 Unauthorised: no login + // 403 Forbidden: login problem, quota exceeded + // 412 Precondition failed: metadata must be uploaded first. + if (doiResponse.status !== 201) { + const message = `Unexpected DataCite MDS response code ${doiResponse.status}`; + Logger.error(message); + throw new DoiClientException(doiResponse.status, message); + } + + return doiResponse; } catch (error) { - const message = `request to ${url} failed with ${error.message}`; + // const message = `request for registering DOI failed with ${error.message}`; // Handle the error, log it, or rethrow as needed - throw new DoiClientException(response.status, message); + Logger.error(error.message); + throw new DoiClientException(error.response.status, error.response.data); } - // Response Codes - // 201 Created: operation successful - // 400 Bad Request: request body must be exactly two lines: DOI and URL; wrong domain, wrong prefix; - // 401 Unauthorised: no login - // 403 Forbidden: login problem, quota exceeded - // 412 Precondition failed: metadata must be uploaded first. - if (response.status != 201) { - const message = 'unexpected DataCite MDS response code ' + response.status; - Logger.error(message); - throw new DoiClientException(response.status, message); - } - return response; } } diff --git a/app/Library/Utils/Index.ts b/app/Library/Utils/Index.ts index 7243b2c..9deacbd 100644 --- a/app/Library/Utils/Index.ts +++ b/app/Library/Utils/Index.ts @@ -33,15 +33,16 @@ export default { // set prefix let prefix = ''; - let base_domain = ''; - const datacite_environment = process.env.DATACITE_ENVIRONMENT || 'debug'; - if (datacite_environment === 'debug') { - prefix = process.env.DATACITE_TEST_PREFIX || ''; - base_domain = process.env.TEST_BASE_DOMAIN || ''; - } else if (datacite_environment === 'production') { - prefix = process.env.DATACITE_PREFIX || ''; - base_domain = process.env.BASE_DOMAIN || ''; - } + // let base_domain = ''; + // const datacite_environment = process.env.DATACITE_ENVIRONMENT || 'debug'; + // if (datacite_environment === 'debug') { + // prefix = process.env.DATACITE_TEST_PREFIX || ''; + // base_domain = process.env.TEST_BASE_DOMAIN || ''; + // } else if (datacite_environment === 'production') { + // prefix = process.env.DATACITE_PREFIX || ''; + // base_domain = process.env.BASE_DOMAIN || ''; + // } + prefix = process.env.DATACITE_PREFIX || ''; xsltParameter['prefix'] = prefix; const repIdentifier = 'tethys'; diff --git a/package-lock.json b/package-lock.json index 267eaaa..6b307d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -813,9 +813,9 @@ } }, "node_modules/@babel/core": { - "version": "7.23.7", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.7.tgz", - "integrity": "sha512-+UpDgowcmqe36d4NwqvKsyPMlOLNGMsfMmQ5WGCu+siCe3t3dfe9njrzGfdN4qq+bcNUt0+Vw6haRxBOycs4dw==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.9.tgz", + "integrity": "sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", @@ -823,11 +823,11 @@ "@babel/generator": "^7.23.6", "@babel/helper-compilation-targets": "^7.23.6", "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.23.7", - "@babel/parser": "^7.23.6", - "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.7", - "@babel/types": "^7.23.6", + "@babel/helpers": "^7.23.9", + "@babel/parser": "^7.23.9", + "@babel/template": "^7.23.9", + "@babel/traverse": "^7.23.9", + "@babel/types": "^7.23.9", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -916,9 +916,9 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.23.7", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.23.7.tgz", - "integrity": "sha512-xCoqR/8+BoNnXOY7RVSgv6X+o7pmT5q1d+gGcRlXYkI+9B31glE4jeejhKVpA04O1AtzOt7OSQ6VYKP5FcRl9g==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.23.9.tgz", + "integrity": "sha512-B2L9neXTIyPQoXDm+NtovPvG6VOLWnaXu3BIeVDWwdKFgG30oNa6CqVGiJPDWQwIAK49t9gnQI9c6K6RzabiKw==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", @@ -1199,14 +1199,14 @@ } }, "node_modules/@babel/helpers": { - "version": "7.23.8", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.8.tgz", - "integrity": "sha512-KDqYz4PiOWvDFrdHLPhKtCThtIcKVy6avWD2oG4GEvyQ+XDZwHD4YQd+H2vNMnq2rkdxsDkU82T+Vk8U/WXHRQ==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.9.tgz", + "integrity": "sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ==", "dev": true, "dependencies": { - "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.7", - "@babel/types": "^7.23.6" + "@babel/template": "^7.23.9", + "@babel/traverse": "^7.23.9", + "@babel/types": "^7.23.9" }, "engines": { "node": ">=6.9.0" @@ -1227,9 +1227,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", - "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz", + "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==", "bin": { "parser": "bin/babel-parser.js" }, @@ -1303,12 +1303,12 @@ } }, "node_modules/@babel/plugin-proposal-decorators": { - "version": "7.23.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.23.7.tgz", - "integrity": "sha512-b1s5JyeMvqj7d9m9KhJNHKc18gEJiSyVzVX3bwbiPalQBQpuvfPh6lA9F7Kk/dWH0TIiXRpB9yicwijY6buPng==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.23.9.tgz", + "integrity": "sha512-hJhBCb0+NnTWybvWq2WpbCYDOcflSbx0t+BYP65e5R9GVnukiDTi+on5bFkk4p7QGuv190H6KfNiV9Knf/3cZA==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.23.7", + "@babel/helper-create-class-features-plugin": "^7.23.9", "@babel/helper-plugin-utils": "^7.22.5", "@babel/plugin-syntax-decorators": "^7.23.3" }, @@ -1627,9 +1627,9 @@ } }, "node_modules/@babel/plugin-transform-async-generator-functions": { - "version": "7.23.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.23.7.tgz", - "integrity": "sha512-PdxEpL71bJp1byMG0va5gwQcXHxuEYC/BgI/e88mGTtohbZN28O5Yit0Plkkm/dBzCF/BxmbNcses1RH1T+urA==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.23.9.tgz", + "integrity": "sha512-8Q3veQEDGe14dTYuwagbRtwxQDnytyg1JFu4/HwEMETeofocrB0U0ejBJIXoeG/t2oXZ8kzCyI0ZZfbT80VFNQ==", "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", @@ -1985,9 +1985,9 @@ } }, "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.3.tgz", - "integrity": "sha512-ZxyKGTkF9xT9YJuKQRo19ewf3pXpopuYQd8cDXqNzc3mUNbOME0RKMoZxviQk74hwzfQsEe66dE92MaZbdHKNQ==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.9.tgz", + "integrity": "sha512-KDlPRM6sLo4o1FkiSlXoAa8edLXFsKKIda779fbLrvmeuc3itnjCtaO6RrtoaANsIJANj+Vk1zqbZIMhkCAHVw==", "dev": true, "dependencies": { "@babel/helper-hoist-variables": "^7.22.5", @@ -2245,16 +2245,16 @@ } }, "node_modules/@babel/plugin-transform-runtime": { - "version": "7.23.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.23.7.tgz", - "integrity": "sha512-fa0hnfmiXc9fq/weK34MUV0drz2pOL/vfKWvN7Qw127hiUPabFCUMgAbYWcchRzMJit4o5ARsK/s+5h0249pLw==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.23.9.tgz", + "integrity": "sha512-A7clW3a0aSjm3ONU9o2HAILSegJCYlEZmOhmBRReVtIpY/Z/p7yIZ+wR41Z+UipwdGuqwtID/V/dOdZXjwi9gQ==", "dev": true, "dependencies": { "@babel/helper-module-imports": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5", - "babel-plugin-polyfill-corejs2": "^0.4.7", - "babel-plugin-polyfill-corejs3": "^0.8.7", - "babel-plugin-polyfill-regenerator": "^0.5.4", + "babel-plugin-polyfill-corejs2": "^0.4.8", + "babel-plugin-polyfill-corejs3": "^0.9.0", + "babel-plugin-polyfill-regenerator": "^0.5.5", "semver": "^6.3.1" }, "engines": { @@ -2431,9 +2431,9 @@ } }, "node_modules/@babel/preset-env": { - "version": "7.23.8", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.23.8.tgz", - "integrity": "sha512-lFlpmkApLkEP6woIKprO6DO60RImpatTQKtz4sUcDjVcK8M8mQ4sZsuxaTMNOZf0sqAq/ReYW1ZBHnOQwKpLWA==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.23.9.tgz", + "integrity": "sha512-3kBGTNBBk9DQiPoXYS0g0BYlwTQYUTifqgKTjxUwEUkduRT2QOa0FPGBJ+NROQhGyYO5BuTJwGvBnqKDykac6A==", "dev": true, "dependencies": { "@babel/compat-data": "^7.23.5", @@ -2463,7 +2463,7 @@ "@babel/plugin-syntax-top-level-await": "^7.14.5", "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", "@babel/plugin-transform-arrow-functions": "^7.23.3", - "@babel/plugin-transform-async-generator-functions": "^7.23.7", + "@babel/plugin-transform-async-generator-functions": "^7.23.9", "@babel/plugin-transform-async-to-generator": "^7.23.3", "@babel/plugin-transform-block-scoped-functions": "^7.23.3", "@babel/plugin-transform-block-scoping": "^7.23.4", @@ -2485,7 +2485,7 @@ "@babel/plugin-transform-member-expression-literals": "^7.23.3", "@babel/plugin-transform-modules-amd": "^7.23.3", "@babel/plugin-transform-modules-commonjs": "^7.23.3", - "@babel/plugin-transform-modules-systemjs": "^7.23.3", + "@babel/plugin-transform-modules-systemjs": "^7.23.9", "@babel/plugin-transform-modules-umd": "^7.23.3", "@babel/plugin-transform-named-capturing-groups-regex": "^7.22.5", "@babel/plugin-transform-new-target": "^7.23.3", @@ -2511,9 +2511,9 @@ "@babel/plugin-transform-unicode-regex": "^7.23.3", "@babel/plugin-transform-unicode-sets-regex": "^7.23.3", "@babel/preset-modules": "0.1.6-no-external-plugins", - "babel-plugin-polyfill-corejs2": "^0.4.7", - "babel-plugin-polyfill-corejs3": "^0.8.7", - "babel-plugin-polyfill-regenerator": "^0.5.4", + "babel-plugin-polyfill-corejs2": "^0.4.8", + "babel-plugin-polyfill-corejs3": "^0.9.0", + "babel-plugin-polyfill-regenerator": "^0.5.5", "core-js-compat": "^3.31.0", "semver": "^6.3.1" }, @@ -2573,9 +2573,9 @@ "dev": true }, "node_modules/@babel/runtime": { - "version": "7.23.8", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.8.tgz", - "integrity": "sha512-Y7KbAP984rn1VGMbGqKmBLio9V7y5Je9GvU4rQPCPinCyNfUcToxIXl06d59URp/F3LwinvODxab5N/G6qggkw==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.9.tgz", + "integrity": "sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==", "dev": true, "dependencies": { "regenerator-runtime": "^0.14.0" @@ -2585,23 +2585,23 @@ } }, "node_modules/@babel/template": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", - "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz", + "integrity": "sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15" + "@babel/code-frame": "^7.23.5", + "@babel/parser": "^7.23.9", + "@babel/types": "^7.23.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.23.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.7.tgz", - "integrity": "sha512-tY3mM8rH9jM0YHFGyfC0/xf+SB5eKUu7HPj7/k3fpi9dAlsMc5YbQvDi0Sh2QTPXqMhyaAtzAr807TIyfQrmyg==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.9.tgz", + "integrity": "sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==", "dev": true, "dependencies": { "@babel/code-frame": "^7.23.5", @@ -2610,8 +2610,8 @@ "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.6", - "@babel/types": "^7.23.6", + "@babel/parser": "^7.23.9", + "@babel/types": "^7.23.9", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -2620,9 +2620,9 @@ } }, "node_modules/@babel/types": { - "version": "7.23.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.6.tgz", - "integrity": "sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==", + "version": "7.23.9", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz", + "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.23.4", @@ -2803,9 +2803,9 @@ } }, "node_modules/@faker-js/faker": { - "version": "8.3.1", - "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-8.3.1.tgz", - "integrity": "sha512-FdgpFxY6V6rLZE9mmIBb9hM0xpfvQOSNOLnzolzKwsE1DH+gC7lEKV1p1IbR0lAYyvYd5a4u3qWJzowUkw1bIw==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-8.4.0.tgz", + "integrity": "sha512-htW87352wzUCdX1jyUQocUcmAaFqcR/w082EC8iP/gtkF0K+aKcBp0hR5Arb7dzR8tQ1TrhE9DNa5EbJELm84w==", "funding": [ { "type": "opencollective", @@ -2872,9 +2872,9 @@ } }, "node_modules/@inertiajs/core/node_modules/axios": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.5.tgz", - "integrity": "sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", + "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", "dependencies": { "follow-redirects": "^1.15.4", "form-data": "^4.0.0", @@ -3718,9 +3718,9 @@ "dev": true }, "node_modules/@symfony/webpack-encore": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@symfony/webpack-encore/-/webpack-encore-4.5.0.tgz", - "integrity": "sha512-eGHtQc1BDDj7hS35FyIDxQdgQcgKZ5kPh9nLLUihyDE37kPav/id1PfaHoAfydqQyv4QHsXQzLfdYC7k8agFLw==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/@symfony/webpack-encore/-/webpack-encore-4.6.1.tgz", + "integrity": "sha512-JbOjy0P6P9pcbgVE3nceFnCCneRO+tbcLUkQh9rpPj/sHtFl12foSjHz6uY93ZGZGAvTyqEslie+4MlD/rUtnQ==", "dev": true, "dependencies": { "@nuxt/friendly-errors-webpack-plugin": "^2.5.1", @@ -3748,7 +3748,7 @@ "encore": "bin/encore.js" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "peerDependencies": { "@babel/core": "^7.17.0", @@ -3771,7 +3771,7 @@ "postcss": "^8.3.0", "postcss-loader": "^7.0.0", "sass": "^1.17.0", - "sass-loader": "^13.0.0", + "sass-loader": "^13.0.0 || ^14.0.0", "stylus": "^0.58.1", "stylus-loader": "^7.0.0", "ts-loader": "^9.0.0", @@ -4081,9 +4081,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.41", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.41.tgz", - "integrity": "sha512-OaJ7XLaelTgrvlZD8/aa0vvvxZdUmlCn6MtWeB7TkiKW70BQLc9XEPpDLPdbo52ZhXUCrznlWdCHWxJWtdyajA==", + "version": "4.17.42", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.42.tgz", + "integrity": "sha512-ckM3jm2bf/MfB3+spLPWYPUH573plBFwpOhqQ2WottxYV85j1HQFlxmnTq57X1yHY9awZPig06hL/cLMgNWHIQ==", "dev": true, "dependencies": { "@types/node": "*", @@ -4228,9 +4228,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.11.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.5.tgz", - "integrity": "sha512-g557vgQjUUfN76MZAN/dt1z3dzcUsimuysco0KeluHgrPdJXkP/XdAURgyO2W9fZWHRtRBiVKzKn8vyOAwlG+w==", + "version": "20.11.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.10.tgz", + "integrity": "sha512-rZEfe/hJSGYmdfX9tvcPMYeYPW2sNl50nsw4jZmRcaG0HIAb0WYEpsB05GOb53vjqpyE9GUhlDQ4jLSoB5q9kg==", "dependencies": { "undici-types": "~5.26.4" } @@ -5931,29 +5931,13 @@ } }, "node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.8.7", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.7.tgz", - "integrity": "sha512-KyDvZYxAzkC0Aj2dAPyDzi2Ym15e5JKZSK+maI7NAwSqofvuFglbSsxE7wUOvTg9oFVnHMzVzBKcqEb4PJgtOA==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.9.0.tgz", + "integrity": "sha512-7nZPG1uzK2Ymhy/NbaOWTg3uibM2BmGASS4vHS4szRZAIR8R6GwA/xAujpdrXU5iyklrimWnLWU+BLF9suPTqg==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.4.4", - "core-js-compat": "^3.33.1" - }, - "peerDependencies": { - "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" - } - }, - "node_modules/babel-plugin-polyfill-corejs3/node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.4.tgz", - "integrity": "sha512-QcJMILQCu2jm5TFPGA3lCpJJTeEP+mqeXooG/NZbg/h5FTFi6V0+99ahlRsW8/kRLyb24LZVCCiclDedhLKcBA==", - "dev": true, - "dependencies": { - "@babel/helper-compilation-targets": "^7.22.6", - "@babel/helper-plugin-utils": "^7.22.5", - "debug": "^4.1.1", - "lodash.debounce": "^4.0.8", - "resolve": "^1.14.2" + "@babel/helper-define-polyfill-provider": "^0.5.0", + "core-js-compat": "^3.34.0" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" @@ -6181,9 +6165,9 @@ } }, "node_modules/browserslist": { - "version": "4.22.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.2.tgz", - "integrity": "sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==", + "version": "4.22.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.3.tgz", + "integrity": "sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==", "dev": true, "funding": [ { @@ -6200,8 +6184,8 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001565", - "electron-to-chromium": "^1.4.601", + "caniuse-lite": "^1.0.30001580", + "electron-to-chromium": "^1.4.648", "node-releases": "^2.0.14", "update-browserslist-db": "^1.0.13" }, @@ -6384,9 +6368,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001579", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001579.tgz", - "integrity": "sha512-u5AUVkixruKHJjw/pj9wISlcMpgFWzSrczLZbrqBSxukQixmg0SJ5sZTpvaFvxU0HoQKd4yoyAogyrAz9pzJnA==", + "version": "1.0.30001581", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001581.tgz", + "integrity": "sha512-whlTkwhqV2tUmP3oYhtNfaWGYHDdS3JYFQBKXxcUR9qqPWsRhFHhoISO2Xnl/g0xyKzht9mI1LZpiNWfMzHixQ==", "dev": true, "funding": [ { @@ -7939,9 +7923,9 @@ } }, "node_modules/dotenv": { - "version": "16.3.2", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.2.tgz", - "integrity": "sha512-HTlk5nmhkm8F6JcdXvHIzaorzCoziNQT9mGxLPVXW8wJF1TiGSL60ZGB4gHWabHOaMmWmhvk2/lPHfnBiT78AQ==", + "version": "16.4.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.1.tgz", + "integrity": "sha512-CjA3y+Dr3FyFDOAMnxZEGtnW9KBR2M0JvvUtXNW+dYJL5ROWxP9DUHCwgFqpMk0OXCc0ljhaNTr2w/kutYIcHQ==", "engines": { "node": ">=12" }, @@ -8128,9 +8112,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.4.640", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.640.tgz", - "integrity": "sha512-z/6oZ/Muqk4BaE7P69bXhUhpJbUM9ZJeka43ZwxsDshKtePns4mhBlh8bU5+yrnOnz3fhG82XLzGUXazOmsWnA==", + "version": "1.4.650", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.650.tgz", + "integrity": "sha512-sYSQhJCJa4aGA1wYol5cMQgekDBlbVfTRavlGZVr3WZpDdOPcp6a6xUnFfrt8TqZhsBYYbDxJZCjGfHuGupCRQ==", "dev": true }, "node_modules/emittery": { @@ -8988,9 +8972,9 @@ } }, "node_modules/fastq": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.16.0.tgz", - "integrity": "sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.0.tgz", + "integrity": "sha512-zGygtijUMT7jnk3h26kUms3BkSDp4IfIKjmnqI2tvx6nuBfiF1UqOxbnLfzdv+apBy+53oaImsKtMw/xYbW+1w==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -12889,9 +12873,9 @@ } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.1.0.tgz", - "integrity": "sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", "dev": true, "engines": { "node": "14 || >=16.14" @@ -14812,9 +14796,9 @@ } }, "node_modules/saxon-js/node_modules/axios": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.5.tgz", - "integrity": "sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", + "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", "dependencies": { "follow-redirects": "^1.15.4", "form-data": "^4.0.0", @@ -17207,20 +17191,20 @@ } }, "node_modules/webpack": { - "version": "5.89.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.89.0.tgz", - "integrity": "sha512-qyfIC10pOr70V+jkmud8tMfajraGCZMBWJtrmuBymQKCrLTRejBI8STDp1MCyZu/QTdZSeacCQYpYNQVOzX5kw==", + "version": "5.90.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.90.0.tgz", + "integrity": "sha512-bdmyXRCXeeNIePv6R6tGPyy20aUobw4Zy8r0LUS2EWO+U+Ke/gYDgsCh7bl5rB6jPpr4r0SZa6dPxBxLooDT3w==", "dev": true, "peer": true, "dependencies": { "@types/eslint-scope": "^3.7.3", - "@types/estree": "^1.0.0", + "@types/estree": "^1.0.5", "@webassemblyjs/ast": "^1.11.5", "@webassemblyjs/wasm-edit": "^1.11.5", "@webassemblyjs/wasm-parser": "^1.11.5", "acorn": "^8.7.1", "acorn-import-assertions": "^1.9.0", - "browserslist": "^4.14.5", + "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", "enhanced-resolve": "^5.15.0", "es-module-lexer": "^1.2.1", @@ -17234,7 +17218,7 @@ "neo-async": "^2.6.2", "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.3.7", + "terser-webpack-plugin": "^5.3.10", "watchpack": "^2.4.0", "webpack-sources": "^3.2.3" }, @@ -17704,9 +17688,9 @@ } }, "node_modules/xslt3/node_modules/axios": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.5.tgz", - "integrity": "sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", + "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", "dev": true, "dependencies": { "follow-redirects": "^1.15.4", diff --git a/public/docs/PreservationPlanTethys.pdf b/public/docs/PreservationPlanTethys.pdf new file mode 100644 index 0000000..da2f0d3 Binary files /dev/null and b/public/docs/PreservationPlanTethys.pdf differ diff --git a/resources/js/Components/NavBar.vue b/resources/js/Components/NavBar.vue index 31081fe..1f43889 100644 --- a/resources/js/Components/NavBar.vue +++ b/resources/js/Components/NavBar.vue @@ -147,8 +147,8 @@ const showAbout = async () => { - - + + diff --git a/resources/js/Pages/Editor/Dataset/Doi.vue b/resources/js/Pages/Editor/Dataset/Doi.vue index 0bd6e88..412622b 100644 --- a/resources/js/Pages/Editor/Dataset/Doi.vue +++ b/resources/js/Pages/Editor/Dataset/Doi.vue @@ -10,7 +10,7 @@ import BaseButtons from '@/Components/BaseButtons.vue'; import { stardust } from '@eidellev/adonis-stardust/client'; import { mdiArrowLeftBoldOutline, mdiIdentifier } from '@mdi/js'; import FormValidationErrors from '@/Components/FormValidationErrors.vue'; -import Notification from '@/utils/toast'; +// import Notification from '@/utils/toast'; const props = defineProps({ dataset: { @@ -39,7 +39,7 @@ const errors: Ref = computed(() => { const handleSubmit = async (e) => { e.preventDefault(); - Notification.showInfo(`doi implementation is in developement. Create DOI for dataset ${props.dataset.publish_id} later on`); + // Notification.showInfo(`doi implementation is in developement. Create DOI for dataset ${props.dataset.publish_id} later on`); await router.put(stardust.route('editor.dataset.doiStore', [props.dataset.publish_id])); // await form.put(stardust.route('dataset.releaseUpdate', [props.dataset.id])); diff --git a/start/routes.ts b/start/routes.ts index 2b47f13..d02e43e 100644 --- a/start/routes.ts +++ b/start/routes.ts @@ -41,9 +41,9 @@ Route.group(() => { // Route.inertia('/about', 'App'); //old solution: -// Route.get('/', async ({ view }) => { -// return view.render('welcome'); -// }).as('dashboard2'); +Route.get('/welcome', async ({ view }) => { + return view.render('welcome'); +}).as('welcome'); Route.get('/', async ({ response }) => { return response.redirect().toRoute('apps.dashboard'); diff --git a/tests/bootstrap.ts b/tests/bootstrap.ts index bc4446a..fd602b6 100644 --- a/tests/bootstrap.ts +++ b/tests/bootstrap.ts @@ -47,7 +47,10 @@ export const reporters: Required['reporters'] = [specReporter()]; | */ export const runnerHooks: Pick, 'setup' | 'teardown'> = { - setup: [() => TestUtils.ace().loadCommands(), () => TestUtils.db().migrate()], + setup: [ + () => TestUtils.ace().loadCommands(), + () => TestUtils.db().migrate() + ], teardown: [], }; diff --git a/tests/functional/hello_world.spec.ts b/tests/functional/hello_world.spec.ts index 2fd5c27..2978df8 100644 --- a/tests/functional/hello_world.spec.ts +++ b/tests/functional/hello_world.spec.ts @@ -1,7 +1,7 @@ import { test } from '@japa/runner'; test('display welcome page', async ({ client }) => { - const response = await client.get('/'); + const response = await client.get('/welcome'); response.assertStatus(200); response.assertTextIncludes('

It Works!

');