Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic copyright headers #43

Merged
merged 8 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist
dist
hapi.postgress.data
12 changes: 10 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@

module.exports = {
env: {
browser: true,
es2021: true
},
extends: 'standard-with-typescript',
plugins: ['simple-import-sort'],
plugins: [
'simple-import-sort',
'@stylistic/eslint-plugin-js',
'eslint-plugin-header'
],
overrides: [
{
files: ['*.ts', '*.tsx'],
Expand All @@ -21,7 +26,10 @@ module.exports = {
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error'
'simple-import-sort/exports': 'error',
'@stylistic/js/no-multiple-empty-lines': [2, { max: 2, maxBOF: 0 }],
'header/header': [2, 'config/header.ts']

}
}
],
Expand Down
4 changes: 4 additions & 0 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/
import type { UserConfig } from '@commitlint/types';

const Configuration: UserConfig = {
Expand Down
4 changes: 4 additions & 0 deletions config/header.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/
62 changes: 60 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"@commitlint/config-conventional": "^19.0.3",
"@commitlint/types": "^19.0.3",
"@semantic-release/git": "^10.0.1",
"@stylistic/eslint-plugin-js": "^1.7.0",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/fs-extra": "^11.0.1",
Expand All @@ -83,6 +84,7 @@
"docker-compose": "^0.24.6",
"eslint": "^8.28.0",
"eslint-config-standard-with-typescript": "^23.0.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.5.1",
"eslint-plugin-promise": "^6.1.1",
Expand Down
4 changes: 4 additions & 0 deletions src/__mocks__/axios.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/
import mockAxios from 'jest-mock-axios';
export default mockAxios;
4 changes: 4 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/
import { FumeServer } from './server';

const server = new FumeServer();
Expand Down
4 changes: 2 additions & 2 deletions src/config.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* © Copyright Outburn Ltd. 2022-2023 All Rights Reserved
* Project name: FUME
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/

import { test } from '@jest/globals';
Expand Down
15 changes: 8 additions & 7 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/**
* © Copyright Outburn Ltd. 2022-2023 All Rights Reserved
* Project name: FUME
*/
import { fhirCorePackages } from './constants';
import { fhirVersionToMinor } from './helpers/fhirFunctions/fhirVersionToMinor';
import defaultConfig from './serverConfig';
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/

import { fhirCorePackages } from './constants';
import { fhirVersionToMinor } from './helpers/fhirFunctions/fhirVersionToMinor';
import defaultConfig from './serverConfig';
import type { IAppBinding, IConfig } from './types';

const additionalBindings: Record<string, IAppBinding> = {}; // additional functions to bind when running transformations
Expand Down
8 changes: 4 additions & 4 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* © Copyright Outburn Ltd. 2022-2023 All Rights Reserved
* Project name: FUME
*/
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/

export const fhirCorePackages = {
'4.0.1': '[email protected]',
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/mapping.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* © Copyright Outburn Ltd. 2022-2023 All Rights Reserved
* Project name: FUME
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/

import type { Request, Response } from 'express';
Expand Down
24 changes: 12 additions & 12 deletions src/controllers/root.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/**
* © Copyright Outburn Ltd. 2022-2023 All Rights Reserved
* Project name: FUME
*/
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/

import type { Request, Response } from 'express';
import config from '../config';
import { getCache } from '../helpers/cache';
import { recacheFromServer } from '../helpers/conformance';
import { v2json } from '../helpers/hl7v2';
import { transform } from '../helpers/jsonataFunctions';
import { getLogger } from '../helpers/logger';
import type { Request, Response } from 'express';

import config from '../config';
import { getCache } from '../helpers/cache';
import { recacheFromServer } from '../helpers/conformance';
import { v2json } from '../helpers/hl7v2';
import { transform } from '../helpers/jsonataFunctions';
import { getLogger } from '../helpers/logger';
import { parseCsv } from '../helpers/stringFunctions';

const get = async (req: Request, res: Response) => {
Expand Down
10 changes: 7 additions & 3 deletions src/helpers/cache/cache.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { test } from '@jest/globals';

import { getCache, initCache } from './cache';
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/
import { test } from '@jest/globals';

import { getCache, initCache } from './cache';
import { SimpleCache } from './simpleCache';

class TestCache extends SimpleCache<any> {}
Expand Down
14 changes: 7 additions & 7 deletions src/helpers/cache/cache.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* © Copyright Outburn Ltd. 2022-2023 All Rights Reserved
* Project name: FUME
*/
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/

import { ICache } from '../../types';
import { ICacheClass } from '../../types/FumeServer';
import { IAppCache, IAppCacheKeys } from './cacheTypes';
import { ICache } from '../../types';
import { ICacheClass } from '../../types/FumeServer';
import { IAppCache, IAppCacheKeys } from './cacheTypes';
import { SimpleCache } from './simpleCache';

/** Global app cache instance */
Expand Down
4 changes: 4 additions & 0 deletions src/helpers/cache/cacheTypes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/
import { ICache } from '../../types';

export interface ICacheEntry {
Expand Down
4 changes: 4 additions & 0 deletions src/helpers/cache/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/
export {
getCache,
initCache,
Expand Down
4 changes: 4 additions & 0 deletions src/helpers/cache/simpleCache.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/
import { test } from '@jest/globals';

import { SimpleCache } from './simpleCache';
Expand Down
4 changes: 4 additions & 0 deletions src/helpers/cache/simpleCache.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/
import { ICache } from '../../types';

export class SimpleCache<T> implements ICache<T> {
Expand Down
16 changes: 8 additions & 8 deletions src/helpers/conformance/conformance.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* © Copyright Outburn Ltd. 2022-2023 All Rights Reserved
* Project name: FUME
*/
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/

import config from '../../config';
import { getFhirClient } from '../fhirServer';
import expressions from '../jsonataExpression';
import { getLogger } from '../logger';
import config from '../../config';
import { getFhirClient } from '../fhirServer';
import expressions from '../jsonataExpression';
import { getLogger } from '../logger';
import { getFhirPackageIndex } from './loadFhirPackageIndex';

export const getStructureDefinition = async (definitionId: string): Promise<any> => {
Expand Down
5 changes: 2 additions & 3 deletions src/helpers/conformance/getCachePath.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

/**
* © Copyright Outburn Ltd. 2022-2023 All Rights Reserved
* Project name: FUME
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/

import { test } from '@jest/globals';
Expand Down
4 changes: 4 additions & 0 deletions src/helpers/conformance/getCachePath.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/
import fs from 'fs';
import os from 'os';
import path from 'path';
Expand Down
4 changes: 4 additions & 0 deletions src/helpers/conformance/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/
import { getStructureDefinition, getTable } from './conformance';
import { getFhirPackageIndex, IFhirPackageIndex, loadFhirPackageIndex } from './loadFhirPackageIndex';
import { loadPackage, loadPackages } from './loadPackages';
Expand Down
5 changes: 2 additions & 3 deletions src/helpers/conformance/loadFhirPackageIndex.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

/**
* © Copyright Outburn Ltd. 2022-2023 All Rights Reserved
* Project name: FUME
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/

import { test } from '@jest/globals';
Expand Down
5 changes: 4 additions & 1 deletion src/helpers/conformance/loadFhirPackageIndex.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

/**
* © Copyright Outburn Ltd. 2022-2024 All Rights Reserved
* Project name: FUME-COMMUNITY
*/
import fs from 'fs-extra';
import path from 'path';

Expand Down
Loading