Skip to content

Commit

Permalink
feat(salesforce): add custom API call action
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamSelene committed Dec 2, 2024
1 parent 52f5ab5 commit 2fe14a4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/pieces/community/salesforce/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "@activepieces/piece-salesforce",
"version": "0.1.8"
}
"version": "0.1.9"
}
19 changes: 18 additions & 1 deletion packages/pieces/community/salesforce/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
PieceAuth,
Property,
createPiece,
OAuth2PropertyValue,
} from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/shared';
import { createNewObject } from './lib/action/create-new-object';
Expand All @@ -11,6 +12,8 @@ import { upsertByExternalId } from './lib/action/upsert-by-external-id';
import { upsertByExternalIdBulk } from './lib/action/upsert-by-external-id-bulk';
import { newRecord } from './lib/trigger/new-record';
import { newOrUpdatedRecord } from './lib/trigger/new-updated-record';
import { createCustomApiCallAction } from '@activepieces/pieces-common';
import { ntfyAuth } from '@activepieces/piece-ntfy';

export const salesforceAuth = PieceAuth.OAuth2({
props: {
Expand Down Expand Up @@ -47,7 +50,14 @@ export const salesforce = createPiece({

minimumSupportedRelease: '0.30.0',
logoUrl: 'https://cdn.activepieces.com/pieces/salesforce.png',
authors: ["HKudria","tanoggy","landonmoir","kishanprmr","khaledmashaly","abuaboud"],
authors: [
'HKudria',
'tanoggy',
'landonmoir',
'kishanprmr',
'khaledmashaly',
'abuaboud',
],
categories: [PieceCategory.SALES_AND_CRM],
auth: salesforceAuth,
actions: [
Expand All @@ -56,6 +66,13 @@ export const salesforce = createPiece({
UpdateObjectById,
upsertByExternalId,
upsertByExternalIdBulk,
createCustomApiCallAction({
baseUrl: (auth) => (auth as OAuth2PropertyValue).data['instance_url'],
auth: salesforceAuth,
authMapping: async (auth) => ({
Authorization: `Bearer ${(auth as OAuth2PropertyValue).access_token}`,
}),
}),
],
triggers: [newRecord, newOrUpdatedRecord],
});

0 comments on commit 2fe14a4

Please sign in to comment.