Skip to content

Commit

Permalink
Merge pull request #4370 from activepieces/fix/lever
Browse files Browse the repository at this point in the history
fix: remove commented code in lever
  • Loading branch information
abuaboud committed Apr 6, 2024
2 parents e2c7c70 + 2fc6a66 commit 2462808
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
6 changes: 3 additions & 3 deletions packages/pieces/community/lever/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import { updateOpportunityStage } from './lib/actions/update-opportunity-stage';
import { listOpportunityForms } from './lib/actions/list-opportunity-forms';

export const LEVER_BASE_URL = 'https://api.lever.co/v1';

export const leverAuth = PieceAuth.CustomAuth({
description: 'Lever authentication requires an API key.',
required: true,
props: {
apiKey: PieceAuth.SecretText({
displayName: 'API key',
required: true,
}),
},
required: true,
});

export type LeverAuth = {
Expand All @@ -35,7 +35,7 @@ export const lever = createPiece({
},
auth: leverAuth,
authMapping: (auth) => {
const { apiKey } = auth as { apiKey: string };
const { apiKey } = auth as LeverAuth;
return {
Authorization:
'Basic ' + Buffer.from(`${apiKey}:`).toString('base64'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ export const getOpportunity = createAction({
async run({ auth, propsValue }) {
const response = await httpClient.sendRequest({
method: HttpMethod.GET,
url: `${LEVER_BASE_URL}/opportunities/${
propsValue.opportunityId
}?${decodeURIComponent(
qs.stringify({ expand: propsValue.expand }, { arrayFormat: 'repeat' })
)}`,
url: `${LEVER_BASE_URL}/opportunities/${propsValue.opportunityId
}?${decodeURIComponent(
qs.stringify({ expand: propsValue.expand }, { arrayFormat: 'repeat' })
)}`,
authentication: {
type: AuthenticationType.BASIC,
username: auth.apiKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import {
httpClient,
HttpMethod,
} from '@activepieces/pieces-common';
import qs from 'qs';

export const listOpportunityForms = createAction({
// auth: check https://www.activepieces.com/docs/developers/piece-reference/authentication,
name: 'listOpportunityForms',
displayName: 'List opportunity forms',
description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
import { LEVER_BASE_URL, LeverAuth, leverAuth } from '../..';

export const updateOpportunityStage = createAction({
// auth: check https://www.activepieces.com/docs/developers/piece-reference/authentication,
name: 'updateOpportunityStage',
displayName: 'Update opportunity stage',
description: "Change an Opportunity's current stage",
Expand Down

0 comments on commit 2462808

Please sign in to comment.