Skip to content
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
2 changes: 2 additions & 0 deletions .github/workflows/close-external-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ jobs:
close:
runs-on: ubuntu-latest
# OWNER / MEMBER / COLLABORATOR are trusted; everyone else gets auto-closed.
# CONTRIBUTOR means they have a merged PR here before, so they keep their PRs open.
# Bots (dependabot, AP automation) and the "keep-open" label are exempt.
# Add the "keep-open" label to a PR to reopen it for review (selective reopen, tldraw-style).
if: >
github.event_name == 'pull_request_target' &&
github.event.pull_request.author_association != 'OWNER' &&
github.event.pull_request.author_association != 'MEMBER' &&
github.event.pull_request.author_association != 'COLLABORATOR' &&
github.event.pull_request.author_association != 'CONTRIBUTOR' &&
github.event.pull_request.user.type != 'Bot' &&
!contains(github.event.pull_request.labels.*.name, 'keep-open')
steps:
Expand Down
8 changes: 4 additions & 4 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion docs/install/reference/breaking-changes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ Nothing, and no new configuration: the key is derived from a secret your instanc

Rolling back costs at most the codes issued after the deploy: the older build cannot read those, so whoever holds one asks for a fresh code. Nothing is rewritten and nothing is deleted, so no cleanup is needed either way.


## 0.87.0

### What has changed?
Expand Down
2 changes: 1 addition & 1 deletion packages/core/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@activepieces/shared",
"version": "0.150.0",
"version": "0.151.0",
"type": "commonjs",
"sideEffects": false,
"main": "./dist/src/index.js",
Expand Down
3 changes: 0 additions & 3 deletions packages/core/shared/src/lib/ee/agent/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ const DraftAgentResponse = AgentDraftFields.extend({
modelName: Nullable(z.string().max(MAX_AGENT_NAME_LENGTH)),
})

const AgentTemplate = AgentDraftFields.extend({ id: z.string() })

const DraftAgentRequest = z.object({
projectId: ApId,
Expand All @@ -127,7 +126,6 @@ export {
AgentConfig,
AgentIcon,
AgentVisibility,
AgentTemplate,
CreateAgentRequest,
DEFAULT_AGENT_MAX_STEPS,
DraftAgentRequest,
Expand All @@ -151,7 +149,6 @@ export {
export type Agent = z.infer<typeof Agent>
export type AgentSummary = z.infer<typeof AgentSummary>
export type AgentConfig = z.infer<typeof AgentConfig>
export type AgentTemplate = z.infer<typeof AgentTemplate>
export type CreateAgentRequest = z.infer<typeof CreateAgentRequest>
export type DraftAgentRequest = z.infer<typeof DraftAgentRequest>
export type AgentDraftFields = z.infer<typeof AgentDraftFields>
Expand Down
2 changes: 1 addition & 1 deletion packages/pieces/community/hubspot/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-hubspot",
"version": "0.8.10",
"version": "0.9.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/pieces/community/hubspot/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createCustomApiCallAction } from '@activepieces/pieces-common';
import { OAuth2PropertyValue, PieceAuth, createPiece } from '@activepieces/pieces-framework';
import { createPiece } from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/pieces-framework';
import { hubSpotListsAddContactAction } from './lib/actions/add-contact-to-list-action';
import { newCompanyTrigger } from './lib/triggers/new-company';
Expand Down Expand Up @@ -69,12 +69,12 @@ import { createBlogPostAction } from './lib/actions/create-blog-post';
import { createPageAction } from './lib/actions/create-page';
import { getPageAction } from './lib/actions/get-page';
import { deletePageAction } from './lib/actions/delete-page';
import { hubspotAuth } from './lib/auth';
import { getHubspotAccessToken, hubspotAuth } from './lib/auth';

export const hubspot = createPiece({
displayName: 'HubSpot',
description: 'Powerful CRM that offers tools for sales, customer service, and marketing automation.',
minimumSupportedRelease: '0.5.0',
minimumSupportedRelease: '0.86.4',
logoUrl: 'https://cdn.activepieces.com/pieces/hubspot.png',
authors: ['Salem-Alaa', 'kishanprmr', 'MoShizzle', 'khaledmashaly', 'abuaboud'],
categories: [PieceCategory.SALES_AND_CRM],
Expand Down Expand Up @@ -128,7 +128,7 @@ export const hubspot = createPiece({
baseUrl: () => 'https://api.hubapi.com',
auth: hubspotAuth,
authMapping: async (auth) => ({
Authorization: `Bearer ${(auth).access_token}`,
Authorization: `Bearer ${getHubspotAccessToken(auth)}`,
}),
}),
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { staticListsDropdown } from '../common/props';
import { createAction, Property } from '@activepieces/pieces-framework';
import { hubspotAuth } from '../auth';
import { getHubspotAccessToken, hubspotAuth } from '../auth';
import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';

export const hubSpotListsAddContactAction = createAction({
Expand Down Expand Up @@ -30,7 +30,7 @@ export const hubSpotListsAddContactAction = createAction({
},
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: context.auth.access_token,
token: getHubspotAccessToken(context.auth),
},
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hubspotAuth } from '../auth';
import { getHubspotAccessToken, hubspotAuth } from '../auth';
import { createAction, Property } from "@activepieces/pieces-framework";
import { workflowIdDropdown } from "../common/props";
import { AuthenticationType, httpClient, HttpMethod } from "@activepieces/pieces-common";
Expand Down Expand Up @@ -28,7 +28,7 @@ export const addContactToWorkflowAction = createAction({
url: `https://api.hubapi.com/automation/v2/workflows/${workflowId}/enrollments/contacts/${contactEmail}`,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: context.auth.access_token,
token: getHubspotAccessToken(context.auth),
},
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hubspotAuth } from '../auth';
import { getHubspotAccessToken, hubspotAuth } from '../auth';
import { createAction, Property } from '@activepieces/pieces-framework';
import {
fromObjectTypeAssociationDropdown,
Expand Down Expand Up @@ -49,7 +49,7 @@ export const createAssociationsAction = createAction({
async run(context) {
const { fromObjectId, fromObjectType, toObjectType, associationType } = context.propsValue;

const client = new Client({ accessToken: context.auth.access_token });
const client = new Client({ accessToken: getHubspotAccessToken(context.auth) });

if(context.propsValue.toObjectIds === undefined) {
throw new Error('Please provide To Object IDs');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
import { hubspotAuth } from '../auth';
import { getHubspotAccessToken, hubspotAuth } from '../auth';
import { createAction, Property } from '@activepieces/pieces-framework';
import { blogAuthorDropdown, blogUrlDropdown } from '../common/props';
import { createBlogPostOutputSchema } from '../output-schemas';
Expand Down Expand Up @@ -62,7 +62,7 @@ export const createBlogPostAction = createAction({
const createdPost = await httpClient.sendRequest<Record<string, any>>({
method: HttpMethod.POST,
url: 'https://api.hubapi.com/content/api/v2/blog-posts',
authentication: { type: AuthenticationType.BEARER_TOKEN, token: context.auth.access_token },
authentication: { type: AuthenticationType.BEARER_TOKEN, token: getHubspotAccessToken(context.auth) },
body: {
blog_author_id: authorId,
content_group_id: contentGroupId,
Expand All @@ -80,7 +80,7 @@ export const createBlogPostAction = createAction({
await httpClient.sendRequest({
method: HttpMethod.POST,
url: `https://api.hubapi.com/content/api/v2/blog-posts/${createdPost.body['id']}/publish-action`,
authentication: { type: AuthenticationType.BEARER_TOKEN, token: context.auth.access_token },
authentication: { type: AuthenticationType.BEARER_TOKEN, token: getHubspotAccessToken(context.auth) },
body: {
action: 'schedule-publish',
},
Expand All @@ -90,7 +90,7 @@ export const createBlogPostAction = createAction({
const postDetails = await httpClient.sendRequest({
method: HttpMethod.GET,
url: `https://api.hubapi.com/content/api/v2/blog-posts/${createdPost.body['id']}`,
authentication: { type: AuthenticationType.BEARER_TOKEN, token: context.auth.access_token },
authentication: { type: AuthenticationType.BEARER_TOKEN, token: getHubspotAccessToken(context.auth) },
});

return postDetails.body
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hubspotAuth } from '../auth';
import { getHubspotAccessToken, hubspotAuth } from '../auth';
import { createAction, Property } from '@activepieces/pieces-framework';
import { getDefaultPropertiesForObject, standardObjectDynamicProperties, standardObjectPropertiesDropdown} from '../common/props';
import { OBJECT_TYPE } from '../common/constants';
Expand Down Expand Up @@ -43,7 +43,7 @@ export const createCompanyAction = createAction({
companyProperties[key] = Array.isArray(value) ? value.join(';') : value;
});

const client = new Client({ accessToken: context.auth.access_token });
const client = new Client({ accessToken: getHubspotAccessToken(context.auth) });

const createdCompany = await client.crm.companies.basicApi.create({
properties: companyProperties,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hubspotAuth } from '../auth';
import { getHubspotAccessToken, hubspotAuth } from '../auth';
import { createAction, Property } from '@activepieces/pieces-framework';

import { MarkdownVariant } from '@activepieces/pieces-framework';
Expand Down Expand Up @@ -44,7 +44,7 @@ export const createContactAction = createAction({
contactProperties[key] = Array.isArray(value) ? value.join(';') : value;
});

const client = new Client({ accessToken: context.auth.access_token });
const client = new Client({ accessToken: getHubspotAccessToken(context.auth) });

const createdContact = await client.crm.contacts.basicApi.create({
properties: contactProperties,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { MarkdownVariant } from '@activepieces/pieces-framework';
import { hubspotAuth } from '../auth';
import { getHubspotAccessToken, hubspotAuth } from '../auth';
import {
customObjectDropdown,
customObjectDynamicProperties,
Expand Down Expand Up @@ -61,7 +61,7 @@ export const createCustomObjectAction = createAction({
customObjectProperties[key] = Array.isArray(value) ? value.join(';') : value;
});

const client = new Client({ accessToken: context.auth.access_token });
const client = new Client({ accessToken: getHubspotAccessToken(context.auth) });

const createdCustomObject = await client.crm.objects.basicApi.create(customObjectType, {
properties: customObjectProperties,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hubspotAuth } from '../auth';
import { getHubspotAccessToken, hubspotAuth } from '../auth';

import { Property, createAction } from '@activepieces/pieces-framework';

Expand Down Expand Up @@ -75,7 +75,7 @@ export const createDealAction = createAction({
dealProperties[key] = Array.isArray(value) ? value.join(';') : value;
});

const client = new Client({ accessToken: context.auth.access_token });
const client = new Client({ accessToken: getHubspotAccessToken(context.auth) });

const createdDeal = await client.crm.deals.basicApi.create({
properties: dealProperties,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hubspotAuth } from '../auth';
import { getHubspotAccessToken, hubspotAuth } from '../auth';
import { createAction, Property } from '@activepieces/pieces-framework';
import {
getDefaultPropertiesForObject,
Expand Down Expand Up @@ -58,7 +58,7 @@ export const createLineItemAction = createAction({
lineItemProperties[key] = Array.isArray(value) ? value.join(';') : value;
});

const client = new Client({ accessToken: context.auth.access_token });
const client = new Client({ accessToken: getHubspotAccessToken(context.auth) });

const createdLineItem = await client.crm.lineItems.basicApi.create({
associations: [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hubspotAuth } from '../auth';
import { getHubspotAccessToken, hubspotAuth } from '../auth';
import { createAction, Property } from '@activepieces/pieces-framework';

import { Client } from '@hubspot/api-client';
Expand Down Expand Up @@ -36,7 +36,7 @@ export const createOrUpdateContactAction = createAction({
contactProperties[key] = Array.isArray(value) ? value.join(';') : value;
});

const client = new Client({ accessToken: context.auth.access_token });
const client = new Client({ accessToken: getHubspotAccessToken(context.auth) });

const searchResponse = await client.crm.contacts.searchApi.doSearch({
limit: 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
import { hubspotAuth } from '../auth';
import { getHubspotAccessToken, hubspotAuth } from '../auth';
import { createAction, Property } from '@activepieces/pieces-framework';
import { pageType } from '../common/props';
import { pageOutputSchema } from '../output-schemas';
Expand Down Expand Up @@ -90,7 +90,7 @@ export const createPageAction = createAction({
url,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: context.auth.access_token,
token: getHubspotAccessToken(context.auth),
},
body: {
htmlTitle: pageTitle,
Expand All @@ -110,7 +110,7 @@ export const createPageAction = createAction({
url: `https://api.hubapi.com/content/api/v2/pages/${createdPage.body.id}/publish-action`,
authentication: {
type: AuthenticationType.BEARER_TOKEN,
token: context.auth.access_token,
token: getHubspotAccessToken(context.auth),
},
body: { action: 'schedule-publish' },
});
Expand All @@ -119,7 +119,7 @@ export const createPageAction = createAction({
const pageDetails = await httpClient.sendRequest({
method: HttpMethod.GET,
url: `${url}/${createdPage.body.id}`,
authentication: { type: AuthenticationType.BEARER_TOKEN, token: context.auth.access_token },
authentication: { type: AuthenticationType.BEARER_TOKEN, token: getHubspotAccessToken(context.auth) },
});

return pageDetails.body;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hubspotAuth } from '../auth';
import { getHubspotAccessToken, hubspotAuth } from '../auth';
import { createAction, Property } from '@activepieces/pieces-framework';
import {
getDefaultPropertiesForObject,
Expand Down Expand Up @@ -51,7 +51,7 @@ export const createProductAction = createAction({
productProperties[key] = Array.isArray(value) ? value.join(';') : value;
});

const client = new Client({ accessToken: context.auth.access_token });
const client = new Client({ accessToken: getHubspotAccessToken(context.auth) });

const createdProduct = await client.crm.products.basicApi.create({
properties: productProperties,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createAction, Property } from '@activepieces/pieces-framework';
import { Client } from '@hubspot/api-client';

import { MarkdownVariant } from '@activepieces/pieces-framework';
import { hubspotAuth } from '../auth';
import { getHubspotAccessToken, hubspotAuth } from '../auth';
import { getDefaultPropertiesForObject, pipelineDropdown, pipelineStageDropdown, standardObjectDynamicProperties, standardObjectPropertiesDropdown } from '../common/props';
import { OBJECT_TYPE } from '../common/constants';
import { crmObjectOutputSchema } from '../output-schemas';
Expand Down Expand Up @@ -73,7 +73,7 @@ export const createTicketAction = createAction({
ticketProperties[key] = Array.isArray(value) ? value.join(';') : value;
});

const client = new Client({ accessToken: context.auth.access_token });
const client = new Client({ accessToken: getHubspotAccessToken(context.auth) });

const createdTicket = await client.crm.tickets.basicApi.create({
properties: ticketProperties,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hubspotAuth } from '../auth';
import { getHubspotAccessToken, hubspotAuth } from '../auth';
import { createAction, Property } from '@activepieces/pieces-framework';
import { Client } from '@hubspot/api-client';
import { pageType } from '../common/props';
Expand All @@ -21,7 +21,7 @@ export const deletePageAction = createAction({
},
async run(context) {
const { pageId, pageType } = context.propsValue;
const client = new Client({ accessToken: context.auth.access_token });
const client = new Client({ accessToken: getHubspotAccessToken(context.auth) });

if (pageType === 'site_page') {
return await client.cms.pages.sitePagesApi.archive(pageId);
Expand Down
Loading
Loading