From a98027a2d75a72f805ea64f870ec9191fe45f121 Mon Sep 17 00:00:00 2001 From: "Rahul R." Date: Tue, 31 Dec 2024 17:58:34 +0530 Subject: [PATCH] chore: regenerate @gauzy/plugin-integration-upwork library --- .../plugins/integration-upwork/.eslintrc.json | 25 ------------------- .../integration-upwork/eslint.config.js | 19 ++++++++++++++ .../plugins/integration-upwork/jest.config.ts | 1 - .../src/lib/integration-upwork.plugin.ts | 25 ++++++++++++++++--- .../src/lib/upwork-job.service.ts | 2 -- .../src/lib/upwork-offers.service.ts | 2 -- .../src/lib/upwork.module.ts | 15 +++++++++-- .../src/lib/upwork.service.ts | 2 +- .../plugins/integration-upwork/tsconfig.json | 5 ++-- 9 files changed, 57 insertions(+), 39 deletions(-) delete mode 100644 packages/plugins/integration-upwork/.eslintrc.json create mode 100644 packages/plugins/integration-upwork/eslint.config.js diff --git a/packages/plugins/integration-upwork/.eslintrc.json b/packages/plugins/integration-upwork/.eslintrc.json deleted file mode 100644 index fb3030b0742..00000000000 --- a/packages/plugins/integration-upwork/.eslintrc.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "extends": ["../../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.ts", "*.tsx"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.json"], - "parser": "jsonc-eslint-parser", - "rules": { - "@nx/dependency-checks": "error" - } - } - ] -} diff --git a/packages/plugins/integration-upwork/eslint.config.js b/packages/plugins/integration-upwork/eslint.config.js new file mode 100644 index 00000000000..ba4f5d8daad --- /dev/null +++ b/packages/plugins/integration-upwork/eslint.config.js @@ -0,0 +1,19 @@ +const baseConfig = require('../../../.eslintrc.json'); + +module.exports = [ + ...baseConfig, + { + files: ['**/*.json'], + rules: { + '@nx/dependency-checks': [ + 'error', + { + ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'] + } + ] + }, + languageOptions: { + parser: require('jsonc-eslint-parser') + } + } +]; diff --git a/packages/plugins/integration-upwork/jest.config.ts b/packages/plugins/integration-upwork/jest.config.ts index bccab586709..a1ee794cb97 100644 --- a/packages/plugins/integration-upwork/jest.config.ts +++ b/packages/plugins/integration-upwork/jest.config.ts @@ -1,4 +1,3 @@ -/* eslint-disable */ export default { displayName: 'plugin-integration-upwork', preset: '../../../jest.preset.js', diff --git a/packages/plugins/integration-upwork/src/lib/integration-upwork.plugin.ts b/packages/plugins/integration-upwork/src/lib/integration-upwork.plugin.ts index 1de873d05f7..ba4dd5cbbe5 100644 --- a/packages/plugins/integration-upwork/src/lib/integration-upwork.plugin.ts +++ b/packages/plugins/integration-upwork/src/lib/integration-upwork.plugin.ts @@ -1,16 +1,35 @@ import * as chalk from 'chalk'; +import { ApplicationPluginConfig } from '@gauzy/common'; import { GauzyCorePlugin as Plugin, IOnPluginBootstrap, IOnPluginDestroy } from '@gauzy/plugin'; import { UpworkModule } from './upwork.module'; @Plugin({ - imports: [UpworkModule] + /** + * An array of modules that will be imported and registered with the plugin. + */ + imports: [UpworkModule], + /** + * An array of Entity classes. The plugin (or ORM) will + * register these entities for use within the application. + */ + entities: [], + /** + * A callback that receives the main plugin configuration object and allows + * custom modifications before returning the final configuration. + * + * @param {ApplicationPluginConfig} config - The initial plugin configuration object. + * @returns {ApplicationPluginConfig} - The modified plugin configuration object. + * + * In this example, we're adding a custom relation field (`proposals`) to the `Tag` entity. + */ + configuration: (config: ApplicationPluginConfig) => { + return config; + } }) export class IntegrationUpworkPlugin implements IOnPluginBootstrap, IOnPluginDestroy { // We disable by default additional logging for each event to avoid cluttering the logs private logEnabled = true; - constructor() {} - /** * Called when the plugin is being initialized. */ diff --git a/packages/plugins/integration-upwork/src/lib/upwork-job.service.ts b/packages/plugins/integration-upwork/src/lib/upwork-job.service.ts index 4ce1a0910d9..871fa8bec97 100644 --- a/packages/plugins/integration-upwork/src/lib/upwork-job.service.ts +++ b/packages/plugins/integration-upwork/src/lib/upwork-job.service.ts @@ -5,8 +5,6 @@ import { IUpworkApiConfig } from '@gauzy/contracts'; @Injectable() export class UpworkJobService { - constructor() {} - /* * Get job by key * This call returns the complete job object by job key. It's only available for users with `manage_recruiting` permissions within the team that the job is posted in. diff --git a/packages/plugins/integration-upwork/src/lib/upwork-offers.service.ts b/packages/plugins/integration-upwork/src/lib/upwork-offers.service.ts index 6b9b7886c06..3595793ad35 100644 --- a/packages/plugins/integration-upwork/src/lib/upwork-offers.service.ts +++ b/packages/plugins/integration-upwork/src/lib/upwork-offers.service.ts @@ -6,8 +6,6 @@ import { IUpworkApiConfig, IUpworkProposalStatusEnum, IUpworkOfferStatusEnum } f @Injectable() export class UpworkOffersService { - constructor() {} - /** * List freelancer’s offers * This call retrieves a list of offers received by a freelancer. diff --git a/packages/plugins/integration-upwork/src/lib/upwork.module.ts b/packages/plugins/integration-upwork/src/lib/upwork.module.ts index ece8e76934e..cbe2f40be2f 100644 --- a/packages/plugins/integration-upwork/src/lib/upwork.module.ts +++ b/packages/plugins/integration-upwork/src/lib/upwork.module.ts @@ -1,5 +1,6 @@ import { CqrsModule } from '@nestjs/cqrs'; import { Module } from '@nestjs/common'; +import { ConfigModule } from '@gauzy/config'; import { EmployeeModule, ExpenseCategoriesModule, @@ -38,9 +39,19 @@ import { UpworkController } from './upwork.controller'; TimeSlotModule, UserModule, ProposalModule, + ConfigModule, CqrsModule ], - controllers: [UpworkAuthorizationController, UpworkController], - providers: [UpworkJobService, UpworkOffersService, UpworkReportService, UpworkTransactionService, UpworkService] + controllers: [ + UpworkAuthorizationController, + UpworkController + ], + providers: [ + UpworkJobService, + UpworkOffersService, + UpworkReportService, + UpworkTransactionService, + UpworkService + ] }) export class UpworkModule {} diff --git a/packages/plugins/integration-upwork/src/lib/upwork.service.ts b/packages/plugins/integration-upwork/src/lib/upwork.service.ts index b63b220cceb..381f2c13b4b 100644 --- a/packages/plugins/integration-upwork/src/lib/upwork.service.ts +++ b/packages/plugins/integration-upwork/src/lib/upwork.service.ts @@ -9,8 +9,8 @@ import { Auth } from 'upwork-api/lib/routers/auth.js'; import { Users } from 'upwork-api/lib/routers/organization/users.js'; import { pluck, map, sortBy } from 'underscore'; import * as moment from 'moment'; -import { environment } from '@gauzy/config'; import { isEmpty, isNotEmpty, isObject } from '@gauzy/common'; +import { environment } from '@gauzy/config'; import { IAccessTokenSecretPair, IAccessToken, diff --git a/packages/plugins/integration-upwork/tsconfig.json b/packages/plugins/integration-upwork/tsconfig.json index 3f13a7802c5..2d92716e86e 100644 --- a/packages/plugins/integration-upwork/tsconfig.json +++ b/packages/plugins/integration-upwork/tsconfig.json @@ -1,13 +1,12 @@ { "extends": "../../../tsconfig.json", "compilerOptions": { - "module": "commonjs", "forceConsistentCasingInFileNames": true, "strict": false, "noImplicitOverride": false, - "noPropertyAccessFromIndexSignature": false, "noImplicitReturns": false, - "noFallthroughCasesInSwitch": false + "noFallthroughCasesInSwitch": false, + "noPropertyAccessFromIndexSignature": false }, "files": [], "include": [],