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

[Fix] Integration Upwork Plugin #8664

Merged
merged 1 commit into from
Dec 31, 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
25 changes: 0 additions & 25 deletions packages/plugins/integration-upwork/.eslintrc.json

This file was deleted.

19 changes: 19 additions & 0 deletions packages/plugins/integration-upwork/eslint.config.js
Original file line number Diff line number Diff line change
@@ -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')
}
}
];
1 change: 0 additions & 1 deletion packages/plugins/integration-upwork/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable */
export default {
displayName: 'plugin-integration-upwork',
preset: '../../../jest.preset.js',
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
15 changes: 13 additions & 2 deletions packages/plugins/integration-upwork/src/lib/upwork.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CqrsModule } from '@nestjs/cqrs';
import { Module } from '@nestjs/common';
import { ConfigModule } from '@gauzy/config';
import {
EmployeeModule,
ExpenseCategoriesModule,
Expand Down Expand Up @@ -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 {}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 2 additions & 3 deletions packages/plugins/integration-upwork/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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": [],
Expand Down
Loading