mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-03-20 05:32:14 +00:00
Compare commits
2 Commits
81-automat
...
183-use-ne
| Author | SHA1 | Date | |
|---|---|---|---|
|
33181941ba
|
|||
|
7e779b738e
|
@@ -22,7 +22,7 @@ const config = {
|
||||
'plugin:unicorn/recommended',
|
||||
'prettier',
|
||||
],
|
||||
plugins: ['eslint-plugin-unicorn', 'eslint-plugin-jsdoc', 'header'],
|
||||
plugins: ['eslint-plugin-unicorn', 'eslint-plugin-jsdoc'],
|
||||
settings: {
|
||||
jsdoc: {
|
||||
mode: 'typescript',
|
||||
@@ -36,7 +36,6 @@ const config = {
|
||||
'unicorn/prefer-node-protocol': 'off',
|
||||
'unicorn/no-process-exit': 'off',
|
||||
'unicorn/no-array-reduce': 'off',
|
||||
'unicorn/prefer-event-target': 'off',
|
||||
'unicorn/prevent-abbreviations': [
|
||||
'error',
|
||||
{
|
||||
@@ -78,27 +77,6 @@ const config = {
|
||||
},
|
||||
],
|
||||
|
||||
'header/header': [
|
||||
2,
|
||||
'block',
|
||||
[
|
||||
'',
|
||||
' * Copyright (C) 2023 StApps',
|
||||
' * This program is free software: you can redistribute it and/or modify it',
|
||||
' * under the terms of the GNU General Public License as published by the Free',
|
||||
' * Software Foundation, version 3.',
|
||||
' *',
|
||||
' * This program is distributed in the hope that it will be useful, but WITHOUT',
|
||||
' * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or',
|
||||
' * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for',
|
||||
' * more details.',
|
||||
' *',
|
||||
' * You should have received a copy of the GNU General Public License along with',
|
||||
' * this program. If not, see <https://www.gnu.org/licenses/>.',
|
||||
' ',
|
||||
],
|
||||
],
|
||||
|
||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
|
||||
14
configuration/eslint-config/licenses/GPL-3.0-only.txt
Normal file
14
configuration/eslint-config/licenses/GPL-3.0-only.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
Copyright (C) {{year}} {{author}}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
@@ -22,13 +22,11 @@
|
||||
"typescript": "5.4.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "5.60.1",
|
||||
"@typescript-eslint/parser": "5.60.1",
|
||||
"eslint": "8.43.0",
|
||||
"eslint-config-prettier": "8.8.0",
|
||||
"eslint-plugin-jsdoc": "46.4.2",
|
||||
"eslint-plugin-prettier": "4.2.1",
|
||||
"eslint-plugin-unicorn": "47.0.0",
|
||||
"eslint-plugin-header": "3.1.1"
|
||||
"@typescript-eslint/eslint-plugin": "7.2.0",
|
||||
"@typescript-eslint/parser": "7.2.0",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"eslint-plugin-jsdoc": "48.2.1",
|
||||
"eslint-plugin-unicorn": "51.0.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,31 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"alwaysStrict": true,
|
||||
"allowJs": true,
|
||||
"allowUnreachableCode": false,
|
||||
"checkJs": true,
|
||||
"declaration": true,
|
||||
"esModuleInterop": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"skipLibCheck": true,
|
||||
"downlevelIteration": true,
|
||||
"explainFiles": true,
|
||||
"inlineSourceMap": true,
|
||||
"isolatedModules": true,
|
||||
"lib": [
|
||||
"ES2022",
|
||||
"DOM"
|
||||
],
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"noErrorTruncation": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"isolatedModules": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"resolveJsonModule": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitOverride": true,
|
||||
"noImplicitReturns": true,
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": false,
|
||||
"outDir": "../../../lib/",
|
||||
"noPropertyAccessFromIndexSignature": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"lib": [
|
||||
"ES2022",
|
||||
"DOM"
|
||||
@@ -33,7 +37,6 @@
|
||||
"transpileOnly": true
|
||||
},
|
||||
"exclude": [
|
||||
"../../../app.js",
|
||||
"../../../lib/"
|
||||
"../../../lib/"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -48,16 +48,16 @@ const program = new Command()
|
||||
const options = program.opts();
|
||||
|
||||
// create an instance of the PluginClient
|
||||
const pluginClient = new PluginClient(new HttpClient(), options.backendUrl);
|
||||
const pluginClient = new PluginClient(new HttpClient(), options['backendUrl']);
|
||||
|
||||
// create an instance of your plugin
|
||||
const plugin = new MinimalPlugin(
|
||||
// tslint:disable-next-line:no-magic-numbers
|
||||
Number.parseInt(options.port, 10),
|
||||
options.pluginName,
|
||||
options.url,
|
||||
`/${options.routeName}`,
|
||||
options.backendUrl,
|
||||
Number.parseInt(options['port'], 10),
|
||||
options['pluginName'],
|
||||
options['url'],
|
||||
`/${options['routeName']}`,
|
||||
options['backendUrl'],
|
||||
new Converter(path.resolve(__dirname, '..', 'src', 'plugin', 'protocol')), // an instance of the converter. Required
|
||||
// because your requests and response schemas are defined in the plugin. The path should lead to your request and
|
||||
// response interfaces
|
||||
@@ -69,7 +69,7 @@ const plugin = new MinimalPlugin(
|
||||
pluginClient
|
||||
.registerPlugin(plugin)
|
||||
.then(() => {
|
||||
Logger.ok(`Successfully registered plugin '${options.pluginName}' on /${options.routeName} .`);
|
||||
Logger.ok(`Successfully registered plugin '${options['pluginName']}' on /${options['routeName']} .`);
|
||||
})
|
||||
// eslint-disable-next-line unicorn/prefer-top-level-await
|
||||
.catch((error: Error) => {
|
||||
@@ -81,7 +81,9 @@ for (const signal of [`exit`, `SIGINT`, `SIGUSR1`, `SIGUSR2`, `SIGTERM`]) {
|
||||
pluginClient
|
||||
.unregisterPlugin(plugin)
|
||||
.then(() => {
|
||||
Logger.ok(`Successfully unregistered plugin '${options.pluginName}' from /${options.routeName} .`);
|
||||
Logger.ok(
|
||||
`Successfully unregistered plugin '${options['pluginName']}' from /${options['routeName']} .`,
|
||||
);
|
||||
})
|
||||
.catch((error: Error) => {
|
||||
throw error;
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
src/app/_helpers/data
|
||||
node_modules
|
||||
src/index.html
|
||||
|
||||
@@ -1,43 +1,76 @@
|
||||
{
|
||||
"root": true,
|
||||
"ignorePatterns": ["projects/**/*"],
|
||||
"extends": ["@openstapps/eslint-config"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2020,
|
||||
"sourceType": "module",
|
||||
"project": ["tsconfig.json", "tsconfig.spec.json", "cypress/tsconfig.json"],
|
||||
"createDefaultProgram": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@angular-eslint/recommended",
|
||||
"plugin:@angular-eslint/template/process-inline-templates"
|
||||
"plugin:@angular-eslint/template/process-inline-templates",
|
||||
"plugin:jsdoc/recommended",
|
||||
"plugin:unicorn/recommended",
|
||||
"prettier"
|
||||
],
|
||||
"plugins": ["eslint-plugin-unicorn", "eslint-plugin-jsdoc"],
|
||||
"settings": {
|
||||
"jsdoc": {
|
||||
"mode": "typescript"
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"@angular-eslint/use-lifecycle-interface": "error",
|
||||
"no-console": "off"
|
||||
"unicorn/filename-case": "error",
|
||||
"unicorn/no-array-reduce": "off",
|
||||
"unicorn/no-array-callback-reference": "off",
|
||||
"unicorn/no-await-expression-member": "off",
|
||||
"unicorn/prefer-object-from-entries": "off",
|
||||
"unicorn/prefer-node-protocol": "off",
|
||||
"unicorn/no-process-exit": "off",
|
||||
"unicorn/prefer-event-target": "off",
|
||||
"unicorn/prevent-abbreviations": [
|
||||
"warn",
|
||||
{
|
||||
"replacements": {
|
||||
"ref": false,
|
||||
"i": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"unicorn/no-nested-ternary": "off",
|
||||
"unicorn/better-regex": "off",
|
||||
"unicorn/no-non-null-assertion": "off",
|
||||
"unicorn/consistent-function-scoping": ["error", {"checkArrowFunctions": false}],
|
||||
"jsdoc/no-types": "error",
|
||||
"jsdoc/require-param": "off",
|
||||
"jsdoc/require-param-description": "error",
|
||||
"jsdoc/check-param-names": "error",
|
||||
"jsdoc/require-returns": "off",
|
||||
"jsdoc/require-param-type": "off",
|
||||
"jsdoc/require-returns-type": "off",
|
||||
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"args": "after-used",
|
||||
"argsIgnorePattern": "^_"
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/lines-between-class-members": ["error", "always"],
|
||||
"@typescript-eslint/no-explicit-any": "error",
|
||||
"@angular-eslint/use-lifecycle-interface": "error"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"plugins": ["header"],
|
||||
"extends": ["plugin:@angular-eslint/template/recommended", "prettier"],
|
||||
"rules": {
|
||||
"header/header": [
|
||||
2,
|
||||
"block-html",
|
||||
[
|
||||
"~ Copyright (C) 2023 StApps",
|
||||
" ~ This program is free software: you can redistribute it and/or modify it",
|
||||
" ~ under the terms of the GNU General Public License as published by the Free",
|
||||
" ~ Software Foundation, version 3.",
|
||||
" ~",
|
||||
" ~ This program is distributed in the hope that it will be useful, but WITHOUT",
|
||||
" ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or",
|
||||
" ~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for",
|
||||
" ~ more details.",
|
||||
" ~",
|
||||
" ~ You should have received a copy of the GNU General Public License along with",
|
||||
" ~ this program. If not, see <https://www.gnu.org/licenses/>."
|
||||
]
|
||||
]
|
||||
}
|
||||
"extends": ["plugin:@angular-eslint/template/recommended", "prettier"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -12,8 +12,9 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/** @type {import('./scripts/icon-config').IconConfig} */
|
||||
/**
|
||||
* @type {import('./scripts/icon-config').IconConfig}
|
||||
*/
|
||||
const config = {
|
||||
inputPath: 'node_modules/material-symbols/material-symbols-rounded.woff2',
|
||||
outputPath: 'src/assets/icons.min.woff2',
|
||||
|
||||
@@ -138,7 +138,6 @@
|
||||
"@ionic/angular-toolkit": "11.0.1",
|
||||
"@ionic/cli": "7.2.0",
|
||||
"@openstapps/prettier-config": "workspace:*",
|
||||
"@openstapps/eslint-config": "workspace:*",
|
||||
"@openstapps/tsconfig": "workspace:*",
|
||||
"@types/fontkit": "2.0.7",
|
||||
"@types/geojson": "1.0.6",
|
||||
@@ -155,6 +154,11 @@
|
||||
"@typescript-eslint/parser": "7.2.0",
|
||||
"cordova-res": "0.15.4",
|
||||
"cypress": "13.7.0",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-plugin-jsdoc": "48.2.1",
|
||||
"eslint-plugin-prettier": "5.1.3",
|
||||
"eslint-plugin-unicorn": "51.0.1",
|
||||
"fast-deep-equal": "3.1.3",
|
||||
"fontkit": "2.0.2",
|
||||
"glob": "10.3.10",
|
||||
"http-server": "14.1.1",
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
"outDir": "./dist/out-tsc",
|
||||
"declaration": false,
|
||||
"isolatedModules": false,
|
||||
"checkJs": false,
|
||||
"allowJs": false,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strictPropertyInitialization": false,
|
||||
"downlevelIteration": true,
|
||||
"importHelpers": true,
|
||||
@@ -20,3 +19,6 @@
|
||||
},
|
||||
"exclude": ["**/*.spec.ts"]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -43,10 +43,5 @@
|
||||
"turbo-ignore": "1.10.16",
|
||||
"typedoc": "0.25.12",
|
||||
"typescript": "5.4.2"
|
||||
},
|
||||
"pnpm": {
|
||||
"patchedDependencies": {
|
||||
"eslint-plugin-header@3.1.1": "patches/eslint-plugin-header@3.1.1.patch"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
10
packages/api-plugin/environment.d.ts
vendored
Normal file
10
packages/api-plugin/environment.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
declare global {
|
||||
namespace NodeJS {
|
||||
interface ProcessEnv {
|
||||
NODE_ENV?: string;
|
||||
PORT?: string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
@@ -175,13 +175,11 @@ export abstract class Plugin {
|
||||
// tslint:disable-next-line:no-floating-promises
|
||||
Logger.error(`${bind} requires elevated privileges`);
|
||||
process.exit(1);
|
||||
break;
|
||||
}
|
||||
case 'EADDRINUSE': {
|
||||
// tslint:disable-next-line:no-floating-promises
|
||||
Logger.error(`${bind} is already in use`);
|
||||
process.exit(1);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
throw error;
|
||||
|
||||
@@ -128,8 +128,8 @@ export class Client {
|
||||
size: 1,
|
||||
});
|
||||
|
||||
if (response.data.length === 1 && response.data[0].uid === uid) {
|
||||
return response.data[0];
|
||||
if (response.data.length === 1 && response.data[0]!.uid === uid) {
|
||||
return response.data[0]!;
|
||||
}
|
||||
|
||||
throw new SCInternalServerErrorResponse(new SCNotFoundErrorResponse(true), true);
|
||||
@@ -220,11 +220,11 @@ export class Client {
|
||||
for (const key of Object.keys(multiSearchRequest)) {
|
||||
const searchRequest = multiSearchRequest[key];
|
||||
|
||||
if (searchRequest.size === undefined) {
|
||||
if (searchRequest?.size === undefined) {
|
||||
preFlightRequest[key] = {
|
||||
...searchRequest,
|
||||
};
|
||||
preFlightRequest[key].size = 0;
|
||||
preFlightRequest[key]!.size = 0;
|
||||
preFlightNecessary = true;
|
||||
}
|
||||
}
|
||||
@@ -245,8 +245,8 @@ export class Client {
|
||||
);
|
||||
|
||||
// set size for multi search requests that were in pre flight request
|
||||
for (const key of Object.keys(preFlightRequest)) {
|
||||
returnMultiSearchRequest[key].size = preFlightResponse[key].pagination.total;
|
||||
for (const key in preFlightRequest) {
|
||||
returnMultiSearchRequest[key]!.size = preFlightResponse[key]!.pagination.total;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ export class ConnectorClient extends Client {
|
||||
const thingSource = source === undefined ? 'stapps-api' : source;
|
||||
|
||||
// request a new bulk
|
||||
const bulk = await this.bulk(things[0].type, thingSource, timeout);
|
||||
const bulk = await this.bulk(things[0]!.type, thingSource, timeout);
|
||||
|
||||
// add items to the bulk - 5 concurrently
|
||||
await Promise.all(
|
||||
|
||||
@@ -33,7 +33,7 @@ export class ApiError extends Error {
|
||||
/**
|
||||
* Add additional data to the output of the error
|
||||
*/
|
||||
toString(): string {
|
||||
override toString(): string {
|
||||
let string_ = super.toString();
|
||||
|
||||
// add additional data
|
||||
|
||||
@@ -20,7 +20,7 @@ export function groupBy<T>(collection: T[], group: (item: T) => string | undefin
|
||||
return collection.reduce((accumulator: Record<string, T[]>, item) => {
|
||||
const key = group(item) ?? '';
|
||||
accumulator[key] = accumulator[key] ?? [];
|
||||
accumulator[key].push(item);
|
||||
accumulator[key]!.push(item);
|
||||
return accumulator;
|
||||
}, {});
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export function shuffle<T>(array: T[]): T[] {
|
||||
const out = [];
|
||||
|
||||
while (copy.length > 0) {
|
||||
out.push(copy.splice(Math.floor(Math.random() * copy.length), 1)[0]);
|
||||
out.push(copy.splice(Math.floor(Math.random() * copy.length), 1)[0]!);
|
||||
}
|
||||
|
||||
return out;
|
||||
|
||||
@@ -17,5 +17,5 @@
|
||||
* Zip two arrays together.
|
||||
*/
|
||||
export function zip<T, U>(a: T[], b: U[]): [T, U][] {
|
||||
return a.map((_, i) => [a[i], b[i]]);
|
||||
return a.map((_, i) => [a[i]!, b[i]!]);
|
||||
}
|
||||
|
||||
@@ -60,11 +60,11 @@ commander
|
||||
|
||||
// get information about routes
|
||||
const routes = await gatherRouteInformation(sourcePath);
|
||||
routes.sort((a, b) => a.route.urlPath.localeCompare(b.route.urlPath));
|
||||
routes.sort((a, b) => a.route['urlPath'].localeCompare(b.route['urlPath']));
|
||||
|
||||
// change url path parameters to openapi notation
|
||||
for (const routeWithMetaInformation of routes) {
|
||||
routeWithMetaInformation.route.urlPath = routeWithMetaInformation.route.urlPath.replaceAll(
|
||||
routeWithMetaInformation.route['urlPath'] = routeWithMetaInformation.route['urlPath'].replaceAll(
|
||||
/:\w+/g,
|
||||
(match: string) => `{${match.replace(':', '')}}`,
|
||||
);
|
||||
@@ -72,7 +72,7 @@ commander
|
||||
|
||||
// keep openapi tags for routes that actually share url fragments
|
||||
let tagsToKeep = routes.map(routeWithMetaInformation =>
|
||||
capitalize(routeWithMetaInformation.route.urlPath.split('/')[1]),
|
||||
capitalize(routeWithMetaInformation.route['urlPath'].split('/')[1]),
|
||||
);
|
||||
tagsToKeep = tagsToKeep.filter(
|
||||
(element, i, array) => array.indexOf(element) === i && array.lastIndexOf(element) !== i,
|
||||
@@ -83,9 +83,9 @@ commander
|
||||
|
||||
// generate documentation for all routes
|
||||
for (const routeWithMetaInformation of routes) {
|
||||
routeWithMetaInformation.tags = [capitalize(routeWithMetaInformation.route.urlPath.split('/')[1])];
|
||||
routeWithMetaInformation.tags = [capitalize(routeWithMetaInformation.route['urlPath'].split('/')[1])];
|
||||
|
||||
output.paths[routeWithMetaInformation.route.urlPath] = generateOpenAPIForRoute(
|
||||
output.paths[routeWithMetaInformation.route['urlPath']] = generateOpenAPIForRoute(
|
||||
routeWithMetaInformation,
|
||||
path.relative(relativeOutDirectoryPath, outDirectorySchemasPath),
|
||||
tagsToKeep,
|
||||
@@ -165,7 +165,7 @@ commander
|
||||
continue;
|
||||
}
|
||||
|
||||
unexpected = unexpected || errorsPerFile[file].some(error => !error.expected);
|
||||
unexpected = unexpected || errorsPerFile[file]?.some(error => !error.expected) || false;
|
||||
}
|
||||
|
||||
if (relativeReportPath !== undefined) {
|
||||
|
||||
@@ -48,7 +48,7 @@ export async function gatherRouteInformation(path: string): Promise<RouteWithMet
|
||||
// instantiate all errors
|
||||
instantiatedRoute.errors = await Promise.all(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
instantiatedRoute.errorNames.map(async (error: any) =>
|
||||
instantiatedRoute['errorNames'].map(async (error: any) =>
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
Object.assign((await project.instantiateDefinitionByName(error.name)) as object, {
|
||||
name: error.name,
|
||||
@@ -57,10 +57,10 @@ export async function gatherRouteInformation(path: string): Promise<RouteWithMet
|
||||
);
|
||||
instantiatedRoute.responseBodyDescription =
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
||||
project.definitions[instantiatedRoute.responseBodyName]?.comment?.shortSummary!;
|
||||
project.definitions[instantiatedRoute['responseBodyName']]?.comment?.shortSummary!;
|
||||
instantiatedRoute.requestBodyDescription =
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
||||
project.definitions[instantiatedRoute.requestBodyName]?.comment?.shortSummary!;
|
||||
project.definitions[instantiatedRoute['requestBodyName']]?.comment?.shortSummary!;
|
||||
|
||||
return {
|
||||
description: {
|
||||
@@ -89,7 +89,7 @@ export function generateOpenAPIForRoute(
|
||||
const route = routeWithInfo.route;
|
||||
const openapiPath: OpenAPIV3.PathItemObject = {};
|
||||
|
||||
openapiPath[route.method.toLowerCase() as OpenAPIV3.HttpMethods] = {
|
||||
openapiPath[route['method'].toLowerCase() as OpenAPIV3.HttpMethods] = {
|
||||
summary: capitalize(routeWithInfo.description.shortText?.replace(/(Route to |Route for )/gim, '')),
|
||||
description: routeWithInfo.description.text,
|
||||
requestBody: {
|
||||
@@ -97,7 +97,7 @@ export function generateOpenAPIForRoute(
|
||||
content: {
|
||||
'application/json': {
|
||||
schema: {
|
||||
$ref: path.join(outDirectorySchemasPath, `${route.requestBodyName}.json`),
|
||||
$ref: path.join(outDirectorySchemasPath, `${route['requestBodyName']}.json`),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -117,19 +117,21 @@ export function generateOpenAPIForRoute(
|
||||
tags: routeWithInfo.tags?.filter(value => tagsToKeep.includes(value)),
|
||||
};
|
||||
|
||||
openapiPath[route.method.toLowerCase() as OpenAPIV3.HttpMethods]!.responses![route.statusCodeSuccess] = {
|
||||
openapiPath[route['method'].toLowerCase() as OpenAPIV3.HttpMethods]!.responses![
|
||||
route['statusCodeSuccess']
|
||||
] = {
|
||||
description: route.responseBodyDescription,
|
||||
content: {
|
||||
'application/json': {
|
||||
schema: {
|
||||
$ref: path.join(outDirectorySchemasPath, `${route.responseBodyName}.json`),
|
||||
$ref: path.join(outDirectorySchemasPath, `${route['responseBodyName']}.json`),
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
for (const error of route.errors) {
|
||||
openapiPath[route.method.toLowerCase() as OpenAPIV3.HttpMethods]!.responses![error.statusCode] = {
|
||||
openapiPath[route['method'].toLowerCase() as OpenAPIV3.HttpMethods]!.responses![error.statusCode] = {
|
||||
description:
|
||||
error.message ?? capitalize(error.name.replaceAll(/([A-Z][a-z])/g, ' $1').replace('SC ', '')),
|
||||
content: {
|
||||
@@ -142,8 +144,8 @@ export function generateOpenAPIForRoute(
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof route.obligatoryParameters === 'object') {
|
||||
for (const [parameter, schemaDefinition] of Object.entries(route.obligatoryParameters)) {
|
||||
if (typeof route['obligatoryParameters'] === 'object') {
|
||||
for (const [parameter, schemaDefinition] of Object.entries(route['obligatoryParameters'])) {
|
||||
const openapiParameter: OpenAPIV3.ParameterObject = {
|
||||
in: 'path',
|
||||
name: parameter,
|
||||
@@ -153,7 +155,7 @@ export function generateOpenAPIForRoute(
|
||||
$ref: `schema/SCSearchResponse.json#/definitions/${schemaDefinition}`,
|
||||
},
|
||||
};
|
||||
openapiPath[route.method.toLowerCase() as OpenAPIV3.HttpMethods]?.parameters?.push(openapiParameter);
|
||||
openapiPath[route['method'].toLowerCase() as OpenAPIV3.HttpMethods]?.parameters?.push(openapiParameter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ function createPlantUMLCodeForClass(config: UMLConfig, readerClass: LightweightC
|
||||
if (config.showProperties && readerClass.properties) {
|
||||
for (const key in readerClass.properties) {
|
||||
const property = readerClass.properties[key];
|
||||
if (property.optional && !config.showOptionalProperties) {
|
||||
if (property?.optional && !config.showOptionalProperties) {
|
||||
// don't show optional attributes
|
||||
continue;
|
||||
}
|
||||
@@ -202,7 +202,7 @@ function createPlantUMLCodeForClass(config: UMLConfig, readerClass: LightweightC
|
||||
// don't show inherited properties
|
||||
continue;
|
||||
}*/
|
||||
model += `\n\t${createPropertyLine(property)}`;
|
||||
model += `\n\t${createPropertyLine(property!)}`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,13 +213,13 @@ function createPlantUMLCodeForClass(config: UMLConfig, readerClass: LightweightC
|
||||
if (readerClass.properties) {
|
||||
for (const key in readerClass.properties) {
|
||||
const property = readerClass.properties[key];
|
||||
const types: string[] = getReferenceTypes(property.type);
|
||||
const types: string[] = getReferenceTypes(property!.type);
|
||||
for (const type of types) {
|
||||
if (config.showAssociations) {
|
||||
/*if (property.inherited && !config.showInheritedProperties) {
|
||||
continue;
|
||||
}*/
|
||||
model += `${readerClass.name} -up-> ${type} : ${property.name} >\n`;
|
||||
model += `${readerClass.name} -up-> ${type} : ${property!.name} >\n`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ export class Validator {
|
||||
}
|
||||
|
||||
// schema will be cached
|
||||
return this.ajvValidateWrapper(this.schemas[schema], instance);
|
||||
return this.ajvValidateWrapper(this.schemas[schema]!, instance);
|
||||
}
|
||||
|
||||
return this.ajvValidateWrapper(schema, instance);
|
||||
@@ -147,7 +147,7 @@ function fromAjvResult(
|
||||
const error: ValidationError = {
|
||||
dataPath: ajvError.instancePath,
|
||||
instance: instance,
|
||||
message: betterErrorObject?.[index]?.error ?? ajvError.message,
|
||||
message: betterErrorObject?.[index]?.error ?? ajvError.message!,
|
||||
name: ajvError.keyword,
|
||||
schemaPath: ajvError.schemaPath,
|
||||
suggestion: betterErrorObject?.[index]?.suggestion,
|
||||
@@ -223,7 +223,7 @@ export async function validateFiles(
|
||||
}
|
||||
|
||||
// add error to list of errors
|
||||
errors[testFileName].push({
|
||||
errors[testFileName]?.push({
|
||||
...error,
|
||||
expected,
|
||||
});
|
||||
@@ -234,7 +234,7 @@ export async function validateFiles(
|
||||
for (const error of expectedErrors) {
|
||||
await Logger.error(`Extraneous expected error '${error}' in ${testFile}.`);
|
||||
|
||||
errors[testFileName].push({
|
||||
errors[testFileName]?.push({
|
||||
dataPath: 'undefined',
|
||||
expected: false,
|
||||
instance: undefined,
|
||||
@@ -279,7 +279,7 @@ export async function writeReport(reportPath: PathLike, errors: ExpectedValidati
|
||||
|
||||
let fileOutput = '';
|
||||
|
||||
for (const [index, error] of errors[fileName].entries()) {
|
||||
for (const [index, error] of errors[fileName]!.entries()) {
|
||||
fileOutput += mustache.render(errorTemplate, {
|
||||
idx: index + 1,
|
||||
instance: JSON.stringify(error.instance, undefined, 2),
|
||||
|
||||
@@ -102,14 +102,14 @@ export function isSearchResponse(something: unknown): something is SCSearchRespo
|
||||
const somethingObject = something as {[key: string]: {[key: string]: string}};
|
||||
|
||||
return (
|
||||
Array.isArray(somethingObject.data) &&
|
||||
Array.isArray(somethingObject.facets) &&
|
||||
somethingObject.pagination !== undefined &&
|
||||
typeof somethingObject.pagination.count === 'number' &&
|
||||
typeof somethingObject.pagination.offset === 'number' &&
|
||||
typeof somethingObject.pagination.total === 'number' &&
|
||||
somethingObject.stats !== undefined &&
|
||||
typeof somethingObject.stats.time === 'number'
|
||||
Array.isArray(somethingObject['data']) &&
|
||||
Array.isArray(somethingObject['facets']) &&
|
||||
somethingObject['pagination'] !== undefined &&
|
||||
typeof somethingObject['pagination']['count'] === 'number' &&
|
||||
typeof somethingObject['pagination']['offset'] === 'number' &&
|
||||
typeof somethingObject['pagination']['total'] === 'number' &&
|
||||
somethingObject['stats'] !== undefined &&
|
||||
typeof somethingObject['stats']['time'] === 'number'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ export class SCAcademicDegreeMeta extends SCThingMeta implements SCMetaTranslati
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldTranslations.de,
|
||||
academicDegree: 'Abschlussgrad',
|
||||
@@ -73,7 +73,7 @@ export class SCAcademicDegreeMeta extends SCThingMeta implements SCMetaTranslati
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldValueTranslations.de,
|
||||
},
|
||||
|
||||
@@ -67,7 +67,7 @@ export class SCAcademicTermWithoutReferencesMeta extends SCThingMeta implements
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldTranslations.de,
|
||||
acronym: 'Akronym',
|
||||
@@ -89,7 +89,7 @@ export class SCAcademicTermWithoutReferencesMeta extends SCThingMeta implements
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldValueTranslations.de,
|
||||
},
|
||||
|
||||
@@ -124,7 +124,7 @@ export class SCCreativeWorkMeta extends SCThingMeta implements SCMetaTranslation
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldTranslations.de,
|
||||
name: 'Titel',
|
||||
@@ -162,7 +162,7 @@ export class SCCreativeWorkMeta extends SCThingMeta implements SCMetaTranslation
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldValueTranslations.de,
|
||||
},
|
||||
|
||||
@@ -79,7 +79,7 @@ export class SCEventMeta extends SCThingMeta implements SCMetaTranslations<SCEve
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldTranslations.de,
|
||||
academicTerms: 'Semester',
|
||||
@@ -105,7 +105,7 @@ export class SCEventMeta extends SCThingMeta implements SCMetaTranslations<SCEve
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldValueTranslations.de,
|
||||
},
|
||||
|
||||
@@ -134,7 +134,7 @@ export class SCPlaceWithoutReferencesMeta
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldTranslations.de,
|
||||
address: 'Adresse',
|
||||
@@ -152,7 +152,7 @@ export class SCPlaceWithoutReferencesMeta
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldValueTranslations.de,
|
||||
},
|
||||
|
||||
@@ -30,7 +30,7 @@ export class SCThingInPlaceMeta extends SCThingMeta implements SCMetaTranslation
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldTranslations.de,
|
||||
inPlace: 'Ort',
|
||||
@@ -44,7 +44,7 @@ export class SCThingInPlaceMeta extends SCThingMeta implements SCMetaTranslation
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldValueTranslations.de,
|
||||
},
|
||||
|
||||
@@ -48,7 +48,7 @@ export class SCThingThatAcceptsPaymentsWithoutReferencesMeta
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldTranslations.de,
|
||||
paymentsAccepted: 'Bezahlmethoden',
|
||||
@@ -62,7 +62,7 @@ export class SCThingThatAcceptsPaymentsWithoutReferencesMeta
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldValueTranslations.de,
|
||||
paymentsAccepted: {
|
||||
|
||||
@@ -119,7 +119,7 @@ export class SCAcademicEventMeta extends SCThingMeta implements SCMetaTranslatio
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCEventMeta().fieldTranslations.de,
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
@@ -143,7 +143,7 @@ export class SCAcademicEventMeta extends SCThingMeta implements SCMetaTranslatio
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCEventMeta().fieldValueTranslations.de,
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
|
||||
@@ -119,7 +119,7 @@ export class SCArticleMeta extends SCThingMeta implements SCMetaTranslations<SCA
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCCreativeWorkMeta().fieldTranslations.de,
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
@@ -147,7 +147,7 @@ export class SCArticleMeta extends SCThingMeta implements SCMetaTranslations<SCA
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCCreativeWorkMeta().fieldValueTranslations.de,
|
||||
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldValueTranslations.de,
|
||||
|
||||
@@ -120,7 +120,7 @@ export class SCAssessmentMeta extends SCThingMeta implements SCMetaTranslations<
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
SCAssessmentCategories,
|
||||
@@ -152,7 +152,7 @@ export class SCAssessmentMeta extends SCThingMeta implements SCMetaTranslations<
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
SCAssessmentCategories,
|
||||
|
||||
@@ -131,7 +131,7 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations<SCBook
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCCreativeWorkMeta().fieldTranslations.de,
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
@@ -159,7 +159,7 @@ export class SCBookMeta extends SCThingMeta implements SCMetaTranslations<SCBook
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCCreativeWorkMeta().fieldValueTranslations.de,
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
|
||||
@@ -95,7 +95,7 @@ export class SCBuildingMeta extends SCThingMeta implements SCMetaTranslations<SC
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
SCBuildingCategories,
|
||||
@@ -117,7 +117,7 @@ export class SCBuildingMeta extends SCThingMeta implements SCMetaTranslations<SC
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
SCBuildingCategories,
|
||||
|
||||
@@ -85,7 +85,7 @@ export class SCCatalogMeta extends SCThingMeta implements SCMetaTranslations<SCC
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
SCCatalogCategories,
|
||||
@@ -111,7 +111,7 @@ export class SCCatalogMeta extends SCThingMeta implements SCMetaTranslations<SCC
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
SCCatalogCategories,
|
||||
|
||||
@@ -80,7 +80,7 @@ export type SCCertificationCategories =
|
||||
| 'rainforest protection';
|
||||
|
||||
export class SCCertificationMeta extends SCThingMeta implements SCMetaTranslations<SCCertification> {
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldTranslations.de,
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
@@ -101,7 +101,7 @@ export class SCCertificationMeta extends SCThingMeta implements SCMetaTranslatio
|
||||
},
|
||||
};
|
||||
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldValueTranslations.de,
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
|
||||
@@ -83,7 +83,7 @@ export class SCContactPointMeta extends SCThingMeta implements SCMetaTranslation
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldTranslations.de,
|
||||
areaServed: 'Arbeitsraum',
|
||||
@@ -107,7 +107,7 @@ export class SCContactPointMeta extends SCThingMeta implements SCMetaTranslation
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldValueTranslations.de,
|
||||
type: 'Kontaktinformation',
|
||||
|
||||
@@ -112,7 +112,7 @@ export class SCCourseOfStudyMeta extends SCThingMeta implements SCMetaTranslatio
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCAcademicDegreeMeta().fieldTranslations.de,
|
||||
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.de,
|
||||
@@ -138,7 +138,7 @@ export class SCCourseOfStudyMeta extends SCThingMeta implements SCMetaTranslatio
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCAcademicDegreeMeta().fieldValueTranslations.de,
|
||||
modes: {
|
||||
|
||||
@@ -112,7 +112,7 @@ export class SCDateSeriesMeta extends SCThingMeta implements SCMetaTranslations<
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingInPlaceMeta().fieldTranslations.de,
|
||||
...new SCThingThatCanBeOfferedMeta<SCSportCoursePriceGroup>().fieldTranslations.de,
|
||||
@@ -138,7 +138,7 @@ export class SCDateSeriesMeta extends SCThingMeta implements SCMetaTranslations<
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingInPlaceMeta().fieldValueTranslations.de,
|
||||
...new SCThingThatCanBeOfferedMeta<SCSportCoursePriceGroup>().fieldValueTranslations.de,
|
||||
|
||||
@@ -66,7 +66,7 @@ export class SCDiffMeta extends SCThingMeta implements SCMetaTranslations<SCDiff
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldTranslations.de,
|
||||
action: 'Aktion',
|
||||
@@ -86,7 +86,7 @@ export class SCDiffMeta extends SCThingMeta implements SCMetaTranslations<SCDiff
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldValueTranslations.de,
|
||||
action: {
|
||||
|
||||
@@ -205,7 +205,7 @@ export class SCDishMeta extends SCThingMeta implements SCMetaTranslations<SCDish
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
SCDishCategories,
|
||||
@@ -237,7 +237,7 @@ export class SCDishMeta extends SCThingMeta implements SCMetaTranslations<SCDish
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
SCDishCategories,
|
||||
|
||||
@@ -107,7 +107,7 @@ export class SCFloorMeta extends SCThingMeta implements SCMetaTranslations<SCFlo
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingInPlaceMeta().fieldTranslations.de,
|
||||
floorName: 'Etagenbezeichnung',
|
||||
@@ -123,7 +123,7 @@ export class SCFloorMeta extends SCThingMeta implements SCMetaTranslations<SCFlo
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingInPlaceMeta().fieldValueTranslations.de,
|
||||
type: 'Etage',
|
||||
|
||||
@@ -66,7 +66,7 @@ export class SCIdCardMeta extends SCThingMeta implements SCMetaTranslations<SCId
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldTranslations.de,
|
||||
validity: 'Gültigkeit',
|
||||
@@ -80,7 +80,7 @@ export class SCIdCardMeta extends SCThingMeta implements SCMetaTranslations<SCId
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldValueTranslations.de,
|
||||
type: 'Ausweis',
|
||||
|
||||
@@ -54,7 +54,7 @@ export interface SCJobPosting
|
||||
}
|
||||
|
||||
export class SCJobPostingMeta extends SCThingMeta {
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldTranslations.de,
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta().fieldTranslations.de,
|
||||
@@ -67,7 +67,7 @@ export class SCJobPostingMeta extends SCThingMeta {
|
||||
},
|
||||
};
|
||||
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldValueTranslations.de,
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta().fieldValueTranslations.de,
|
||||
|
||||
@@ -122,7 +122,7 @@ export class SCMessageMeta extends SCThingMeta implements SCMetaTranslations<SCM
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCCreativeWorkMeta().fieldTranslations.de,
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
@@ -152,7 +152,7 @@ export class SCMessageMeta extends SCThingMeta implements SCMetaTranslations<SCM
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCCreativeWorkMeta().fieldValueTranslations.de,
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
|
||||
@@ -51,7 +51,7 @@ export class SCOrganizationMeta extends SCThingMeta implements SCMetaTranslation
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingInPlaceMeta().fieldTranslations.de,
|
||||
contactPoints: 'Kontaktinformationen',
|
||||
@@ -65,7 +65,7 @@ export class SCOrganizationMeta extends SCThingMeta implements SCMetaTranslation
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingInPlaceMeta().fieldValueTranslations.de,
|
||||
type: 'Einrichtung',
|
||||
|
||||
@@ -103,7 +103,7 @@ export class SCPeriodicalMeta extends SCThingMeta implements SCMetaTranslations<
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCCreativeWorkMeta().fieldTranslations.de,
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
@@ -129,7 +129,7 @@ export class SCPeriodicalMeta extends SCThingMeta implements SCMetaTranslations<
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCCreativeWorkMeta().fieldValueTranslations.de,
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
|
||||
@@ -154,7 +154,7 @@ export class SCPersonMeta extends SCThingMeta implements SCMetaTranslations<SCPe
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldTranslations.de,
|
||||
additionalName: 'Zusatzname',
|
||||
@@ -197,7 +197,7 @@ export class SCPersonMeta extends SCThingMeta implements SCMetaTranslations<SCPe
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldValueTranslations.de,
|
||||
gender: {
|
||||
|
||||
@@ -82,7 +82,7 @@ export class SCPointOfInterestMeta extends SCThingMeta implements SCMetaTranslat
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
SCPointOfInterestCategories,
|
||||
@@ -104,7 +104,7 @@ export class SCPointOfInterestMeta extends SCThingMeta implements SCMetaTranslat
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
SCPointOfInterestCategories,
|
||||
|
||||
@@ -70,7 +70,7 @@ export class SCPublicationEventMeta extends SCThingMeta implements SCMetaTransla
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCEventMeta().fieldTranslations.de,
|
||||
locations: 'Erscheinungsorte',
|
||||
@@ -86,7 +86,7 @@ export class SCPublicationEventMeta extends SCThingMeta implements SCMetaTransla
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCEventMeta().fieldValueTranslations.de,
|
||||
type: 'Veröffentlichung',
|
||||
|
||||
@@ -130,7 +130,7 @@ export class SCRoomMeta extends SCThingMeta implements SCMetaTranslations<SCRoom
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCPlaceWithoutReferencesMeta().fieldTranslations.de,
|
||||
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta().fieldTranslations.de,
|
||||
@@ -156,7 +156,7 @@ export class SCRoomMeta extends SCThingMeta implements SCMetaTranslations<SCRoom
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCPlaceWithoutReferencesMeta().fieldValueTranslations.de,
|
||||
...new SCThingThatAcceptsPaymentsWithoutReferencesMeta().fieldValueTranslations.de,
|
||||
|
||||
@@ -57,7 +57,7 @@ export class SCSemesterMeta extends SCThingMeta implements SCMetaTranslations<SC
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCAcademicTermWithoutReferencesMeta().fieldTranslations.de,
|
||||
acronym: 'Abkürzung',
|
||||
@@ -79,7 +79,7 @@ export class SCSemesterMeta extends SCThingMeta implements SCMetaTranslations<SC
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCAcademicTermWithoutReferencesMeta().fieldValueTranslations.de,
|
||||
type: 'Semester',
|
||||
|
||||
@@ -121,7 +121,7 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations<SCS
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
SCSettingCategories,
|
||||
@@ -149,7 +149,7 @@ export class SCSettingMeta extends SCThingMeta implements SCMetaTranslations<SCS
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<
|
||||
SCSettingCategories,
|
||||
|
||||
@@ -45,7 +45,7 @@ export class SCSportCourseMeta extends SCThingMeta implements SCMetaTranslations
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCEventMeta().fieldTranslations.de,
|
||||
},
|
||||
@@ -57,7 +57,7 @@ export class SCSportCourseMeta extends SCThingMeta implements SCMetaTranslations
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCEventMeta().fieldValueTranslations.de,
|
||||
type: 'Sportkurs',
|
||||
|
||||
@@ -140,7 +140,7 @@ export class SCStudyModuleMeta extends SCThingMeta implements SCMetaTranslations
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldTranslations.de,
|
||||
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.de,
|
||||
@@ -172,7 +172,7 @@ export class SCStudyModuleMeta extends SCThingMeta implements SCMetaTranslations
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldValueTranslations.de,
|
||||
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldValueTranslations.de,
|
||||
|
||||
@@ -62,7 +62,7 @@ export class SCTicketMeta extends SCThingMeta implements SCMetaTranslations<SCTi
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingInPlaceMeta().fieldTranslations.de,
|
||||
approxWaitingTime: 'ungefähre Wartezeit',
|
||||
@@ -80,7 +80,7 @@ export class SCTicketMeta extends SCThingMeta implements SCMetaTranslations<SCTi
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingInPlaceMeta().fieldValueTranslations.de,
|
||||
type: 'Ticket',
|
||||
|
||||
@@ -86,7 +86,7 @@ export class SCToDoMeta extends SCThingMeta implements SCMetaTranslations<SCToDo
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<string, SCThingWithCategoriesSpecificValues>()
|
||||
.fieldTranslations.de,
|
||||
@@ -106,7 +106,7 @@ export class SCToDoMeta extends SCThingMeta implements SCMetaTranslations<SCToDo
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingWithCategoriesWithoutReferencesMeta<string, SCThingWithCategoriesSpecificValues>()
|
||||
.fieldValueTranslations.de,
|
||||
|
||||
@@ -56,7 +56,7 @@ export class SCTourMeta extends SCThingMeta implements SCMetaTranslations<SCTour
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldTranslations.de,
|
||||
init: 'Initiales Skript',
|
||||
@@ -72,7 +72,7 @@ export class SCTourMeta extends SCThingMeta implements SCMetaTranslations<SCTour
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCThingMeta().fieldValueTranslations.de,
|
||||
type: 'Tour',
|
||||
|
||||
@@ -164,7 +164,7 @@ export class SCVideoMeta extends SCThingMeta implements SCMetaTranslations<SCVid
|
||||
/**
|
||||
* Translations of fields
|
||||
*/
|
||||
fieldTranslations = {
|
||||
override fieldTranslations = {
|
||||
de: {
|
||||
...new SCCreativeWorkMeta().fieldTranslations.de,
|
||||
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldTranslations.de,
|
||||
@@ -190,7 +190,7 @@ export class SCVideoMeta extends SCThingMeta implements SCMetaTranslations<SCVid
|
||||
/**
|
||||
* Translations of values of fields
|
||||
*/
|
||||
fieldValueTranslations = {
|
||||
override fieldValueTranslations = {
|
||||
de: {
|
||||
...new SCCreativeWorkMeta().fieldValueTranslations.de,
|
||||
...new SCThingThatCanBeOfferedMeta<SCAcademicPriceGroup>().fieldValueTranslations.de,
|
||||
|
||||
@@ -76,7 +76,7 @@ export class SCThingTranslator {
|
||||
this.metaClasses = SCClasses;
|
||||
|
||||
// Initalize all meta classes once
|
||||
if (typeof (this.metaClasses as any)[Object.keys(this.metaClasses)[0]] === 'function') {
|
||||
if (typeof (this.metaClasses as any)[Object.keys(this.metaClasses)[0]!] === 'function') {
|
||||
for (const metaClass of Object.keys(this.metaClasses)) {
|
||||
(this.metaClasses as any)[metaClass] = new (SCClasses as any)[metaClass]();
|
||||
}
|
||||
|
||||
@@ -149,8 +149,8 @@ class LightweightDefinitionBuilder {
|
||||
indexSignature.type,
|
||||
),
|
||||
indexSignatureType: this.lightweightTypeFromType(
|
||||
this.typeChecker.getTypeFromTypeNode(indexSignature.parameters[0].type!),
|
||||
indexSignature.parameters[0].type!,
|
||||
this.typeChecker.getTypeFromTypeNode(indexSignature.parameters[0]?.type!),
|
||||
indexSignature.parameters[0]?.type!,
|
||||
),
|
||||
}),
|
||||
),
|
||||
@@ -253,6 +253,6 @@ class LightweightDefinitionBuilder {
|
||||
* Same as conversion, but generates a simple list of all definitions.
|
||||
*/
|
||||
convertToList(): LightweightDefinition[] {
|
||||
return Object.values(this.convert()).flatMap(it => it.values);
|
||||
return Object.values(this.convert()).flatMap(it => it['values']!);
|
||||
}
|
||||
}
|
||||
|
||||
9
packages/gitlab-api/environment.d.ts
vendored
Normal file
9
packages/gitlab-api/environment.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
declare global {
|
||||
namespace NodeJS {
|
||||
interface ProcessEnv {
|
||||
GITLAB_PRIVATE_TOKEN?: string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
24
packages/logger/environment.d.ts
vendored
Normal file
24
packages/logger/environment.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
declare global {
|
||||
namespace NodeJS {
|
||||
interface ProcessEnv {
|
||||
/**
|
||||
* If set to true, invalid smtp configs will not throw an error
|
||||
*/
|
||||
ALLOW_NO_TRANSPORT?: 'true' | string;
|
||||
SMTP_AUTH_USER?: string;
|
||||
SMTP_AUTH_PASSWORD?: string;
|
||||
SMTP_SENDER_MAIL?: string;
|
||||
SMTP_SENDER_NAME?: string;
|
||||
SMTP_HOST?: string;
|
||||
SMTP_PORT?: string;
|
||||
SMTP_CC?: string;
|
||||
SMTP_RECIPIENTS?: string;
|
||||
SMTP_SECURE?: 'true' | string;
|
||||
STAPPS_LOG_LEVEL?: string;
|
||||
STAPPS_EXIT_LEVEL?: string;
|
||||
NODE_ENV?: string;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
@@ -1,41 +0,0 @@
|
||||
diff --git a/lib/rules/header.js b/lib/rules/header.js
|
||||
index 3504b6fc59b780674e652ad1ca944cb3577b8fed..d86dc0b490845c22f54ae83dbc52efcf448e628b 100644
|
||||
--- a/lib/rules/header.js
|
||||
+++ b/lib/rules/header.js
|
||||
@@ -27,6 +27,9 @@ function excludeShebangs(comments) {
|
||||
// check if they are at the start of the file since that is already checked by
|
||||
// hasHeader().
|
||||
function getLeadingComments(context, node) {
|
||||
+ if (!node.body) {
|
||||
+ return context.getSourceCode().ast.comments;
|
||||
+ }
|
||||
var all = excludeShebangs(context.getSourceCode().getAllComments(node.body.length ? node.body[0] : node));
|
||||
if (all[0].type.toLowerCase() === "block") {
|
||||
return [all[0]];
|
||||
@@ -44,6 +47,8 @@ function genCommentBody(commentType, textArray, eol, numNewlines) {
|
||||
var eols = eol.repeat(numNewlines);
|
||||
if (commentType === "block") {
|
||||
return "/*" + textArray.join(eol) + "*/" + eols;
|
||||
+ } else if (commentType === "block-html") {
|
||||
+ return "<!--\n " + textArray.join(eol) + "\n -->" + eols;
|
||||
} else {
|
||||
return "//" + textArray.join(eol + "//") + eols;
|
||||
}
|
||||
@@ -103,7 +108,7 @@ function hasHeader(src) {
|
||||
src = src.slice(m.index + m[0].length);
|
||||
}
|
||||
}
|
||||
- return src.substr(0, 2) === "/*" || src.substr(0, 2) === "//";
|
||||
+ return src.substr(0, 2) === "/*" || src.substr(0, 2) === "//" || src.substr(0, 4) === "<!--";
|
||||
}
|
||||
|
||||
function matchesLineEndings(src, num) {
|
||||
@@ -180,7 +185,7 @@ module.exports = {
|
||||
message: "missing header",
|
||||
fix: canFix ? genPrependFixer(commentType, node, fixLines, eol, numNewlines) : null
|
||||
});
|
||||
- } else if (leadingComments[0].type.toLowerCase() !== commentType) {
|
||||
+ } else if (leadingComments[0].type.toLowerCase() !== commentType.replace(/-html$/, '')) {
|
||||
context.report({
|
||||
loc: node.loc,
|
||||
message: "header should be a {{commentType}} comment",
|
||||
5
pnpm-lock.yaml
generated
5
pnpm-lock.yaml
generated
@@ -4,11 +4,6 @@ settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
patchedDependencies:
|
||||
eslint-plugin-header@3.1.1:
|
||||
hash: pgohhqwij7scbwihbawhnhtg3i
|
||||
path: patches/eslint-plugin-header@3.1.1.patch
|
||||
|
||||
importers:
|
||||
|
||||
.:
|
||||
|
||||
Reference in New Issue
Block a user