feat(api): automate adding copyright header

This commit is contained in:
yassinedorbozgithub 2024-10-19 12:16:49 +01:00
parent 45e3352577
commit 516737ac4b
6 changed files with 48 additions and 1 deletions

View File

@ -5,7 +5,7 @@ module.exports = {
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin', 'import'],
plugins: ['@typescript-eslint/eslint-plugin', 'import', 'license-header'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
@ -71,5 +71,19 @@ module.exports = {
},
},
],
'license-header/header': [
'error',
[
'/*',
' * Copyright © ' +
new Date().getFullYear() +
' Hexastack. All rights reserved.',
' *',
' * Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:',
' * 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.',
' * 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software\'s "About" section, documentation, and README file).',
' */',
],
],
},
};

View File

@ -1,3 +1,11 @@
/*
* Copyright © 2024 Hexastack. All rights reserved.
*
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
*/
export interface SubscriberContext {
vars?: { [key: string]: any };
}

View File

@ -1,3 +1,11 @@
/*
* Copyright © 2024 Hexastack. All rights reserved.
*
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
*/
import { type OnEventOptions } from '@nestjs/event-emitter/dist/interfaces';
import type { Document, HydratedDocument, Query, TFilterQuery } from 'mongoose';
import { type Socket } from 'socket.io';

View File

@ -1,3 +1,11 @@
/*
* Copyright © 2024 Hexastack. All rights reserved.
*
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
*/
import { BaseBlockPlugin } from './base-block-plugin';
import { BaseEventPlugin } from './base-event-plugin';
import { BasePlugin } from './base-plugin.service';

View File

@ -1,3 +1,11 @@
/*
* Copyright © 2024 Hexastack. All rights reserved.
*
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
*/
export const buildURL = (baseUrl: string, relativePath: string): string => {
try {
return new URL(relativePath).toString();

View File

@ -5,6 +5,7 @@
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
*/
import crypto from 'crypto';
/**