repo_name stringlengths 1 62 | dataset stringclasses 1
value | lang stringclasses 11
values | pr_id int64 1 20.1k | owner stringlengths 2 34 | reviewer stringlengths 2 39 | diff_hunk stringlengths 15 262k | code_review_comment stringlengths 1 99.6k |
|---|---|---|---|---|---|---|---|
supaglue | github_2023 | typescript | 1,878 | supaglue-labs | tomkit | @@ -2225,41 +2225,57 @@ class HubSpotClient extends AbstractCrmRemoteClient implements MarketingAutomati
objectType: Exclude<CRMCommonObjectType, 'user'>,
paginationParams: PaginationParams
): Promise<PaginatedSupaglueRecords<ListMetadata>> {
- if (objectType !== 'contact') {
+ if (objectType !== 'co... | What do `0-1` and `0-2` mean? Can you annotate? |
supaglue | github_2023 | typescript | 1,861 | supaglue-labs | lucasmarshall | @@ -0,0 +1,50 @@
+import createClient from 'openapi-fetch';
+
+import type { paths as actions } from './gen/v2/actions';
+import type { paths as crm } from './gen/v2/crm';
+import type { paths as data } from './gen/v2/data';
+import type { paths as engagement } from './gen/v2/engagement';
+import type { paths as enrich... | These probably shouldn't be in the constructor, but rather be options that can be passed to each call to the API, since most customers will have many of their own customers with possibly multiple providers connected and it would be difficult to manage that many supaglue clients as singletons (which I imagine most would... |
supaglue | github_2023 | typescript | 1,861 | supaglue-labs | lucasmarshall | @@ -0,0 +1,50 @@
+import createClient from 'openapi-fetch';
+
+import type { paths as actions } from './gen/v2/actions';
+import type { paths as crm } from './gen/v2/crm';
+import type { paths as data } from './gen/v2/data';
+import type { paths as engagement } from './gen/v2/engagement';
+import type { paths as enrich... | Why not make this camel case so it easier to consume? |
supaglue | github_2023 | typescript | 1,873 | supaglue-labs | tomkit | @@ -2179,20 +2192,31 @@ class HubSpotClient extends AbstractCrmRemoteClient implements MarketingAutomati
throw new NotFoundError(`Could not find association schema with id ${params.associationSchemaId}`);
}
const associationCategory = associationSchema.category;
- await this.#client.crm.associations... | Should this be a bad request error? |
supaglue | github_2023 | typescript | 1,873 | supaglue-labs | lucasmarshall | @@ -2568,15 +2592,17 @@ function flattenAssociations(
return acc;
}
- // If associatedObjectType is for a custom object, it will be the fullyQualifiedName,
- // and we want to use the objectTypeId for consistency
const matchingCustomObjectSchema = associatedCustomObjectSchemas.find(
(sch... | ```suggestion
function shouldFetchAllAssociations(applicationId: string): boolean {
``` |
supaglue | github_2023 | typescript | 1,873 | supaglue-labs | lucasmarshall | @@ -712,7 +722,7 @@ class HubSpotClient extends AbstractCrmRemoteClient implements MarketingAutomati
standardObjectTypes: string[];
customObjectSchemas: HubSpotCustomSchema[];
}> {
- if (FETCH_ASSOCIATIONS_APPLICATION_IDS.includes(this.#config.applicationId)) {
+ if (doFetchAllAssociations(this.#conf... | ```suggestion
if (shouldFetchAllAssociations(this.#config.applicationId)) {
``` |
supaglue | github_2023 | typescript | 1,867 | supaglue-labs | lucasmarshall | @@ -14,12 +13,6 @@ export class PassthroughService {
request: SendPassthroughRequestRequest
): Promise<SendPassthroughRequestResponse> {
const client = await this.#remoteService.getRemoteClient(connectionId);
- // TODO I don't think this is actually working right now. Not seeing any context on successfu... | I have seen this working and actually used it for debugging. Why not try to fix it if it is no longer working? |
supaglue | github_2023 | typescript | 1,866 | supaglue-labs | tomkit | @@ -119,6 +120,81 @@ describe('contact', () => {
// expect(dbContact.rows[0].addresses).toEqual(testContact.record.addresses);
}, 120000);
+ test('PATCH association only /', async () => {
+ const response = await apiClient.post<CreateContactResponse>(
+ '/crm/v2/contacts',
+ { record... | were we waiting 30s in other places? |
supaglue | github_2023 | typescript | 1,866 | supaglue-labs | tomkit | @@ -127,6 +127,9 @@ export const fromHubSpotContactToContact_v2 = (hubspotSimplePublicObject: Record
if (associations?.company?.length) {
accountId = associations.company[0] ?? null;
}
+ if (associations?.companies?.length) {
+ accountId = associations.companies[0] ?? null; | Separate point: Should we be defining our default association id to have more provider-scoped semantics? E.g. for hubspot we would filter for primary company |
supaglue | github_2023 | typescript | 1,864 | supaglue-labs | tomkit | @@ -1952,12 +1953,24 @@ class HubSpotClient extends AbstractCrmRemoteClient implements MarketingAutomati
return HUBSPOT_STANDARD_OBJECT_TYPES as unknown as string[];
}
- public override async listCustomObjectSchemas(): Promise<SimpleCustomObjectSchema[]> {
+ public override async listCustomObjectSchemasDepr... | Can you annotate in tsdoc too:
```
/**
* @deprecated
*/ |
supaglue | github_2023 | typescript | 1,858 | supaglue-labs | tomkit | @@ -0,0 +1,230 @@
+/**
+ * Tests custom object records endpoints
+ *
+ * @group integration/crm/v2/custom_objects
+ * @jest-environment ./integration-test-environment
+ */
+
+import type {
+ CreateCustomObjectRecordResponse,
+ GetCustomObjectRecordResponse,
+ UpdateCustomObjectRecordResponse,
+} from '@supaglue/sche... | this is testing quite a bit of things: can you make the test more descriptive or annotate in the test what mutations you're making and what you're testing for? |
supaglue | github_2023 | typescript | 1,858 | supaglue-labs | tomkit | @@ -2315,7 +2315,10 @@ class HubSpotClient extends AbstractCrmRemoteClient implements MarketingAutomati
switch (code) {
case 400:
- if (message === 'one or more associations are not valid') {
+ if (
+ message === 'one or more associations are not valid' ||
+ message.include... | `startsWith` or `includes`? |
supaglue | github_2023 | others | 1,860 | supaglue-labs | lucasmarshall | @@ -13,14 +13,14 @@ OLD_VERSION=$(jq -r .version ./package.json)
VERSION=$1
# fail if not clean working directory
-# if [ -n "$(git status --porcelain)" ]; then
-# echo "Working directory not clean. Please stash all changes before running this script."
-# exit 1
-# fi | Why was this commented out and why is uncommenting it included here? |
supaglue | github_2023 | others | 1,860 | supaglue-labs | lucasmarshall | @@ -13,14 +13,14 @@ OLD_VERSION=$(jq -r .version ./package.json)
VERSION=$1
# fail if not clean working directory
-# if [ -n "$(git status --porcelain)" ]; then
-# echo "Working directory not clean. Please stash all changes before running this script."
-# exit 1
-# fi
+if [ -n "$(git status --porcelain)" ]; the... | Same as above |
supaglue | github_2023 | typescript | 1,855 | supaglue-labs | asdfryan | @@ -487,33 +487,41 @@ class ApolloClient extends AbstractEngagementRemoteClient {
{ params: { id: sequenceId } } // Duplicated in the body for some reason
);
- // NOTE: This can happen if some of the contacts have been added to the sequence already
- // as apollo's api do NOT return them as part of ... | Should this be a 400 or a 500?
If 400, we should use `BadRequestError`. If 500, we should use `InternalServerError` |
supaglue | github_2023 | typescript | 1,855 | supaglue-labs | asdfryan | @@ -487,33 +487,41 @@ class ApolloClient extends AbstractEngagementRemoteClient {
{ params: { id: sequenceId } } // Duplicated in the body for some reason
);
- // NOTE: This can happen if some of the contacts have been added to the sequence already
- // as apollo's api do NOT return them as part of ... | It's not sufficient to fetch the contact. We should also check that the contact's sequence status contains the sequence for which the request is trying to add. (and if not present, throw an error) |
supaglue | github_2023 | typescript | 1,855 | supaglue-labs | asdfryan | @@ -496,7 +496,7 @@ class ApolloClient extends AbstractEngagementRemoteClient {
contact = await this.#api.getContact({ params: { id: record.contactId } }).then((r) => r.contact);
}
if (!contact) {
- throw new Error(`Unable to find contact ${record.contactId} in Apollo`);
+ ... | Should be `NotFoundError` |
supaglue | github_2023 | typescript | 1,852 | supaglue-labs | asdfryan | @@ -29,6 +30,9 @@ const { connectionService, connectionAndSyncService, remoteService } = getDepend
export default function init(app: Router): void {
const connectionRouter = Router({ mergeParams: true });
+ connectionRouter.use(customerPathMiddleware);
+ // connectionRouter.use(pinoAndSentryContextMiddleware); | Remove? |
supaglue | github_2023 | typescript | 1,852 | supaglue-labs | asdfryan | @@ -0,0 +1,46 @@
+/**
+ * Tests connection endpoints
+ *
+ * @group integration/mgmt/v2/customers/connections
+ * @jest-environment ./integration-test-environment
+ */
+
+import type { GetConnectionResponse, GetConnectionsResponse } from '@supaglue/schemas/v2/mgmt';
+
+describe('connection', () => {
+ test(`LIST (200)... | I think the scenario this PR is detecting is the case where both the `connectionId` and `customerId` exists, but the `connectionId` does not belong to the `customerId`, right? Can we add a test case for that? |
supaglue | github_2023 | typescript | 1,843 | supaglue-labs | asdfryan | @@ -396,9 +396,7 @@ export const toSalesloftCadenceStepImportParams = (step: SequenceStepCreateParam
day,
automated: step.type === 'auto_email',
automated_settings:
- step.type === 'auto_email' && delayInMins !== 0
- ? { send_type: 'after_time_delay', delay_time:... | I think you may have to update the existing mapper unit tests |
supaglue | github_2023 | typescript | 1,843 | supaglue-labs | asdfryan | @@ -0,0 +1,101 @@
+/**
+ * Tests sequences endpoints
+ *
+ * @group integration/engagement/v2/sequences
+ * @jest-environment ./integration-test-environment
+ */
+
+import type {
+ CreateSequenceRequest,
+ CreateSequenceResponse,
+ GetSequenceResponse,
+} from '@supaglue/schemas/v2/engagement';
+
+describe('sequence... | This doesn't look quite right? It should be `sequence` -- and there should probably be additional cleanup code written in `integration-test-environment.js` |
supaglue | github_2023 | typescript | 1,843 | supaglue-labs | asdfryan | @@ -0,0 +1,177 @@
+/**
+ * Tests sequences endpoints
+ *
+ * @group integration/engagement/v2/sequences
+ * @jest-environment ./integration-test-environment
+ */
+
+import type {
+ CreateContactRequest,
+ CreateContactResponse,
+ CreateSequenceRequest,
+ CreateSequenceResponse,
+ CreateSequenceStateRequest,
+ Cre... | Does this get cleaned up at the end even if there are active contacts on it? |
supaglue | github_2023 | typescript | 1,843 | supaglue-labs | asdfryan | @@ -0,0 +1,177 @@
+/**
+ * Tests sequences endpoints
+ *
+ * @group integration/engagement/v2/sequences
+ * @jest-environment ./integration-test-environment
+ */
+
+import type {
+ CreateContactRequest,
+ CreateContactResponse,
+ CreateSequenceRequest,
+ CreateSequenceResponse,
+ CreateSequenceStateRequest,
+ Cre... | are we intentionally skipping? |
supaglue | github_2023 | typescript | 1,851 | supaglue-labs | tomkit | @@ -0,0 +1,335 @@
+/**
+ * Tests accounts endpoints
+ *
+ * @group integration/crm/v2/metadata/custom_objects
+ * @jest-environment ./integration-test-environment
+ */
+
+import type {
+ CreateCustomObjectSchemaRequest,
+ CreateCustomObjectSchemaResponse,
+ GetCustomObjectSchemaResponse,
+ ListCustomObjectSchemasRe... | nit: plural here is `...sUpdated`? |
supaglue | github_2023 | typescript | 1,839 | supaglue-labs | tomkit | @@ -490,15 +504,21 @@ DO UPDATE SET (${columnsToUpdateStr}) = (${excludedColumnsToUpdateStr})`,
// TODO: This may have performance implications. We should look into this later.
// https://github.com/supaglue-labs/supaglue/issues/497
await client.query(`INSERT INTO ${qualifiedTable} (${columns... | Thoughts on keeping this SQL interpolation mostly declaratively by making the ternary/conditional output a named function? |
supaglue | github_2023 | others | 1,820 | supaglue-labs | tomkit | @@ -71,13 +73,13 @@ import BrowserWindow from '@site/src/components/BrowserWindow';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
-To connect to your customers' HubSpot instances, you'll need to update the redirect URL to point to Supaglue and fetch the API access credentials in your [HubSpo... | Why remove the convenience link? |
supaglue | github_2023 | typescript | 1,820 | supaglue-labs | tomkit | @@ -0,0 +1,117 @@
+import React, { useState } from 'react'; | nice |
supaglue | github_2023 | others | 1,820 | supaglue-labs | asdfryan | @@ -77,44 +76,30 @@ And return a response that looks like:
## Write to the custom field
-Use Supaglue's CRM (Update Contact) API to update a Contact with a value for the custom field we just created above. The curl will look like:
-
-```curl
-curl --location --request PATCH 'https://api.supaglue.io/crm/v2/contacts... | Note: email is required when creating a new contact for hubspot |
supaglue | github_2023 | others | 1,820 | supaglue-labs | tomkit | @@ -71,13 +73,13 @@ import BrowserWindow from '@site/src/components/BrowserWindow';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
-To connect to your customers' HubSpot instances, you'll need to update the redirect URL to point to Supaglue and fetch the API access credentials in your [HubSpo... | This link still works, right? |
supaglue | github_2023 | typescript | 1,836 | supaglue-labs | tomkit | @@ -52,6 +52,9 @@ function getPauseReasonIfShouldPause(err: any): string | undefined {
if (err.cause?.failure?.message.startsWith('No entity mapping found for entity')) {
return err.cause.failure.message;
}
+ if (err.cause?.failure?.message.startsWith('Additional field mappings are not allowed')) { | Separate point: Errors we throw should be deterministic and the variable part of the message should be separate from the message |
supaglue | github_2023 | typescript | 1,821 | supaglue-labs | lucasmarshall | @@ -42,13 +45,27 @@ export default function init(app: Router): void {
req: Request<CreateSequenceStatePathParams, CreateSequenceStateResponse, CreateSequenceStateRequest>,
res: Response<CreateSequenceStateResponse>
) => {
- const responseBody = req.body.record
- ? await engagementCommonOb... | Why are we mixing `async`/`await` and `.then()` here? |
supaglue | github_2023 | typescript | 1,821 | supaglue-labs | lucasmarshall | @@ -42,13 +45,27 @@ export default function init(app: Router): void {
req: Request<CreateSequenceStatePathParams, CreateSequenceStateResponse, CreateSequenceStateRequest>,
res: Response<CreateSequenceStateResponse>
) => {
- const responseBody = req.body.record
- ? await engagementCommonOb... | Same question as above |
supaglue | github_2023 | others | 1,817 | supaglue-labs | asdfryan | @@ -0,0 +1,120 @@
+import BrowserWindow from '@site/src/components/BrowserWindow';
+import ThemedImage from '@theme/ThemedImage';
+
+# Create and write to custom fields
+
+
+
+This tutorial will go through how create a custom field on a Hubspot Contact obj... | this needs to be changed to `https://api.supaglue.io/crm/v2/metadata/properties/contact` |
supaglue | github_2023 | others | 1,817 | supaglue-labs | asdfryan | @@ -0,0 +1,120 @@
+import BrowserWindow from '@site/src/components/BrowserWindow';
+import ThemedImage from '@theme/ThemedImage';
+
+# Create and write to custom fields
+
+
+
+This tutorial will go through how create a custom field on a Hubspot Contact obj... | This link needs to be changed |
supaglue | github_2023 | others | 1,802 | supaglue-labs | tomkit | @@ -63,13 +63,13 @@ Indexes:
"salesforce_Contract_pkey" PRIMARY KEY, btree (_supaglue_application_id, _supaglue_provider_name, _supaglue_customer_id, id)
```
-Note there used to be a `_supaglue_mapped_data` jsonb column that has since been deprecated.
-
:::info
Please note that Supaglue metadata fields differ... | This is a dupe of the below |
supaglue | github_2023 | others | 1,800 | supaglue-labs | asdfryan | @@ -15,15 +15,22 @@ post:
content:
application/json:
schema:
- type: object
- properties:
- record:
- $ref: ../components/schemas/create_sequence_state.yaml
- records:
- type: array
- description: Will use the batch endp... | We should also update the descriptions / summaries for this endpoint to reflect that this can add multiple sequence states. |
supaglue | github_2023 | typescript | 1,798 | supaglue-labs | asdfryan | @@ -42,12 +42,26 @@ export default function init(app: Router): void {
req: Request<CreateSequenceStatePathParams, CreateSequenceStateResponse, CreateSequenceStateRequest>,
res: Response<CreateSequenceStateResponse>
) => {
- const id = await engagementCommonObjectService.create(
- 'sequenc... | I would rather create a separate batch create endpoint for clarity, and maintain consistency with other common APIs and REST-fulness on this endpoint.
|
supaglue | github_2023 | others | 1,798 | supaglue-labs | asdfryan | @@ -15,8 +19,11 @@ post:
properties:
record:
$ref: ../components/schemas/create_sequence_state.yaml
- required:
- - record
+ records: | This should be a `oneOf` between `record` and `records` |
supaglue | github_2023 | others | 1,798 | supaglue-labs | asdfryan | @@ -38,6 +45,11 @@ post:
$ref: ../../../common/components/schemas/errors.yaml
record:
$ref: ../../../common/components/schemas/created_model.yaml
+ records: | IMO we can just have `records` and get rid of `record` (have it return an array of size 1 in the case there's only 1). |
supaglue | github_2023 | typescript | 1,798 | supaglue-labs | asdfryan | @@ -31,36 +31,54 @@ export class EngagementCommonObjectService {
return obj;
}
- public async create<T extends EngagementCommonObjectType>(
+ public async batchCreate<T extends EngagementCommonObjectType>(
type: T,
connection: ConnectionSafeAny,
- params: EngagementCommonObjectTypeMap<T>['creat... | I don't think we should pretend to provide a batch endpoint for providers that don't have this capability.
If the first 3 succeeds than the 4th one fails, then the expected behavior is to rollback the first 3. (Or provide information in the response and/or error that tells you which ones were created) |
supaglue | github_2023 | others | 1,793 | supaglue-labs | lucasmarshall | @@ -0,0 +1,63 @@
+post: | Did we add this to svix already? |
supaglue | github_2023 | typescript | 1,793 | supaglue-labs | lucasmarshall | @@ -125,18 +125,38 @@ export class TooManyRequestsError extends HTTPError {
}
}
+export class NotModifiedError extends HTTPError {
+ code = 304;
+ problemType = 'NOT_MODIFIED';
+ constructor(message: string, cause?: Error) {
+ super(message, cause);
+ }
+}
+
+//
+// Internal errors
+//
+
+export class SGSy... | Should we make the name more general here? like `SGPauseSync` |
supaglue | github_2023 | typescript | 1,793 | supaglue-labs | lucasmarshall | @@ -0,0 +1,65 @@
+import { logger } from '@supaglue/core/lib/logger';
+import type { ConnectionService } from '@supaglue/core/services/connection_service';
+import type { NotificationService } from '@supaglue/core/services/notification_service';
+import type { WebhookService } from '@supaglue/core/services/webhook_serv... | We should emit this webhook on any pause, not just pauses due to errors. So it should be in `syncService.pauseSync` instead. |
supaglue | github_2023 | typescript | 1,793 | supaglue-labs | lucasmarshall | @@ -75,6 +78,14 @@ function createCoreDependencyContainer(): CoreDependencyContainer {
const pgPool = getPgPool(process.env.SUPAGLUE_DATABASE_URL!);
const systemSettingsService = new SystemSettingsService(prisma);
+ const sesClient = new SESv2Client({
+ region: 'us-west-2',
+ credentials: {
+ access... | Can't we just add this to the worker role and let STS take care of it? |
supaglue | github_2023 | typescript | 1,797 | supaglue-labs | tomkit | @@ -218,14 +218,32 @@ function SyncConfigDetailsPanelImpl({ syncConfigId, lekko }: SyncConfigDetailsPa
<Select
name="Destination"
disabled={isLoadingDestinations || !!syncConfig}
- onChange={setDestinationId}
+ onChange={async (value) => {
+ ... | nit: "Add new Destination" |
supaglue | github_2023 | typescript | 1,796 | supaglue-labs | tomkit | @@ -1949,9 +1954,36 @@ class HubSpotClient extends AbstractCrmRemoteClient implements MarketingAutomati
return response.results.map((object) => ({ id: object.id, name: object.name }));
}
- public override async getCustomObjectSchema(id: string): Promise<CustomObjectSchema> {
+ #isAlreadyObjectTypeId(nameOrI... | Can you add a comment here with more context about the Hubspot specific context and shape of object type id you're expecting? |
supaglue | github_2023 | typescript | 1,791 | supaglue-labs | tomkit | @@ -253,15 +269,100 @@ export default function PostgresDestinationDetailsPanel({ isLoading }: PostgresD
<Select
name="SSL Mode"
onChange={(value: string) => {
- setSslMode(value as 'disable' | 'allow' | 'prefer' | 'require');
+ setSslMode(value as PostgresC... | have we tested all of these combinations? as well as on AWS RDS? |
supaglue | github_2023 | others | 1,631 | supaglue-labs | lucasmarshall | @@ -18,9 +21,10 @@ fi
echo "Release version: ${VERSION}"
-echo "Checking out latest main branch..."
+echo "Resetting to out latest main branch..." | ```suggestion
echo "Resetting to latest main branch..."
``` |
supaglue | github_2023 | typescript | 1,777 | supaglue-labs | lucasmarshall | @@ -1213,6 +1222,86 @@ class HubSpotClient extends AbstractCrmRemoteClient implements MarketingAutomati
return await this.listPropertiesForRawObjectName(object.name);
}
+ public override async listPropertiesUnified(objectName: string): Promise<PropertyUnified[]> {
+ const objectSchema = await retryWhenRat... | Why are we using `@ts-ignore`? |
supaglue | github_2023 | typescript | 1,763 | supaglue-labs | asdfryan | @@ -234,3 +237,39 @@ export const toApolloSequenceStateCreateParams = (params: SequenceStateCreatePar
userId: params.userId,
};
};
+
+export const fromApolloEmailerCampaignToSequence = (c: ApolloEmailerCampaign): Sequence => ({ | Could you add unit tests for this? |
supaglue | github_2023 | typescript | 1,738 | supaglue-labs | tomkit | @@ -109,7 +109,7 @@ export default function init(app: Router): void {
) => {
const id = await crmCommonObjectService.upsert('account', req.customerConnection, {
record: camelcaseKeysSansCustomFields(req.body.record),
- upsertOn: camelcaseKeys(req.body.upsert_on), | Nice, bug found during testing? |
supaglue | github_2023 | typescript | 1,759 | supaglue-labs | tomkit | @@ -886,13 +886,14 @@ class HubSpotClient extends AbstractCrmRemoteClient implements MarketingAutomati
results: response.data.results.map(({ associations, ...rest }) => ({
...rest,
associations: Object.entries(associations ?? {}).reduce((acc, [associatedObjectTypeKey, { results }]) => {
+... | nit: `dedupedIds` |
supaglue | github_2023 | typescript | 1,714 | supaglue-labs | lucasmarshall | @@ -39,6 +40,17 @@ export const openapiMiddleware = (specDir: string, version = 'v2') => {
validateRequests: {
removeAdditional: true,
},
+ validateResponses: {
+ onError: (error, body, req) => {
+ logger.error(
+ {
+ error,
+ originalUrl: req.originalUrl,
... | ```suggestion
'API response validation error'
``` |
supaglue | github_2023 | typescript | 1,661 | supaglue-labs | asdfryan | @@ -185,3 +187,182 @@ export const toSalesloftSequenceStateCreateParams = (
user_id: sequenceState.userId,
};
};
+
+/**
+ * Issues:
+ * - `ownerId` does not appear to be supported by salesloft
+ */
+export const toSalesloftCadenceImportParams = (sequence: SequenceCreateParams): CadenceImport => {
+ return {
+... | I think for Salesloft, it seems like all steps with the same `day` need to be in the same `step_group`.
Could this maybe be the reason you might be seeing issues? |
supaglue | github_2023 | typescript | 1,661 | supaglue-labs | asdfryan | @@ -185,3 +187,182 @@ export const toSalesloftSequenceStateCreateParams = (
user_id: sequenceState.userId,
};
};
+
+/**
+ * Issues:
+ * - `ownerId` does not appear to be supported by salesloft
+ */
+export const toSalesloftCadenceImportParams = (sequence: SequenceCreateParams): CadenceImport => {
+ return {
+... | Might be worth adding `...sequence.customFields` here |
supaglue | github_2023 | others | 1,661 | supaglue-labs | asdfryan | @@ -12,6 +12,12 @@ properties:
enum: [team, private]
owner_id:
type: string
+ test_key: | Is this intentional? |
supaglue | github_2023 | others | 1,661 | supaglue-labs | asdfryan | @@ -12,6 +12,12 @@ properties:
enum: [team, private]
owner_id:
type: string
+ test_key:
+ type: string
+ steps: | Maybe document that this is only applicable for salesloft? |
supaglue | github_2023 | others | 1,661 | supaglue-labs | asdfryan | @@ -54,7 +57,7 @@ properties:
description: If true, this step will be sent as a reply to the previous step.
order:
type: number
- description: The step's display order within its sequence.
+ description: The step's display order within its sequence. Only applicable for Outreach when adding steps one ... | How does the ordering semantics work for Salesloft? Mind documenting that here? |
supaglue | github_2023 | typescript | 1,661 | supaglue-labs | asdfryan | @@ -1478,7 +1478,17 @@ class OutreachClient extends AbstractEngagementRemoteClient {
headers: this.getAuthHeadersForPassthroughRequest(),
}
);
- return response.data.data.id.toString();
+
+ const sequenceId = response.data.data.id.toString();
+ // Should we do this in parallel? Are there r... | Instead of this can you fail the request for Outreach if `order` is not specified? |
supaglue | github_2023 | typescript | 1,661 | supaglue-labs | asdfryan | @@ -185,3 +188,221 @@ export const toSalesloftSequenceStateCreateParams = (
user_id: sequenceState.userId,
};
};
+
+/**
+ * Issues:
+ * - `ownerId` does not appear to be supported by salesloft
+ */
+export const toSalesloftCadenceImportParams = (sequence: SequenceCreateParams): CadenceImport => {
+ return {
+... | We should document these defaults / have a way to modify them if necessary (i.e. `custom_fields` or similar) |
supaglue | github_2023 | typescript | 1,661 | supaglue-labs | asdfryan | @@ -185,3 +188,221 @@ export const toSalesloftSequenceStateCreateParams = (
user_id: sequenceState.userId,
};
};
+
+/**
+ * Issues:
+ * - `ownerId` does not appear to be supported by salesloft
+ */
+export const toSalesloftCadenceImportParams = (sequence: SequenceCreateParams): CadenceImport => {
+ return {
+... | Is this right? I think either way `template` is an object (just contains `id` if they're specifying template ID) |
supaglue | github_2023 | typescript | 1,661 | supaglue-labs | asdfryan | @@ -185,3 +188,221 @@ export const toSalesloftSequenceStateCreateParams = (
user_id: sequenceState.userId,
};
};
+
+/**
+ * Issues:
+ * - `ownerId` does not appear to be supported by salesloft
+ */
+export const toSalesloftCadenceImportParams = (sequence: SequenceCreateParams): CadenceImport => { | Do you mind adding unit tests for this? |
supaglue | github_2023 | typescript | 1,661 | supaglue-labs | asdfryan | @@ -185,3 +188,223 @@ export const toSalesloftSequenceStateCreateParams = (
user_id: sequenceState.userId,
};
};
+
+/**
+ * Issues:
+ * - `ownerId` does not appear to be supported by salesloft
+ */
+export const toSalesloftCadenceImportParams = (sequence: SequenceCreateParams): CadenceImport => {
+ return {
+... | Throw an error when it's not a multiple? |
supaglue | github_2023 | others | 1,705 | supaglue-labs | tomkit | @@ -39,3 +39,16 @@ check_checkly_checks() {
exit 1
fi
}
+
+check_github_checks() { | Can you add some comments describing what the function is doing? |
supaglue | github_2023 | others | 1,702 | supaglue-labs | tomkit | @@ -46,7 +50,7 @@ jobs:
name: Build and Push to Docker Hub
timeout-minutes: 15
runs-on:
- labels: ubuntu-8cores-32gb
+ labels: ubuntu-latest | There's still some local dependency install and execution that this workflow does itself
I think the bill here is marginal so far so I'd like to err on the side of speed |
supaglue | github_2023 | others | 1,699 | supaglue-labs | tomkit | @@ -1,7 +1,9 @@
import ThemedImage from '@theme/ThemedImage';
import BrowserWindow from '@site/src/components/BrowserWindow';
-# Standard & Custom Objects
+# Standard Objects
+
+Not every object in a remote provider is supported by Supaglue's common schema or is unifiable across providers. In addition to common obj... | I've been trying to be consistent with referring to "3rd-party providers" instead of synonyms like "remote provider" for docusaurus docs
`native, unnormalized` --> `original` |
supaglue | github_2023 | others | 1,699 | supaglue-labs | tomkit | @@ -12,17 +14,12 @@ import BrowserWindow from '@site/src/components/BrowserWindow';
}}
/>
-## Introduction
-
-**Standard Objects** and **Custom Objects** (known as **Objects**) have a 1-1 relationship between your application and Provider objects. For example, a `Contact` in Salesforce is a `salesforce_Contact` i... | Can we keep the existing header hierarchy?
`#` is used for the page title
`##` is used for titles within the page
`###` is used if we want it to show up in the index
anything beyond three `#` doesn't show up in the index
For `Configuration`, `Object names`, `Table names`, `Table schemas` we use `###` consiste... |
supaglue | github_2023 | others | 1,699 | supaglue-labs | tomkit | @@ -64,58 +61,4 @@ Indexes:
:::info
Please note that Supaglue metadata fields differ slightly between [Common Objects](../common-schemas/overview) and Objects.
-:::
-
-## Custom object | I believe we still allow custom object syncs for Salesforce? |
supaglue | github_2023 | typescript | 1,693 | supaglue-labs | lucasmarshall | @@ -801,9 +801,10 @@ export const authConfig: ConnectorAuthConfig = {
function filterForUpdatedAfter<
R extends {
- data: { updated_time?: string }[] | null;
+ data: { update_time?: string }[] | null;
}
>(response: R, updatedAfter?: Date): R {
+ console.log('xxx', updatedAfter, response); | Remove `console.log` |
supaglue | github_2023 | typescript | 1,684 | supaglue-labs | lucasmarshall | @@ -0,0 +1,16 @@
+import { configureScope } from '@sentry/node';
+import { addLogContext } from '@supaglue/core/lib/logger';
+import type { NextFunction, Request, Response } from 'express';
+
+export async function pinoContextMiddleware(req: Request, res: Response, next: NextFunction) { | We should rename it since it's not just pino context we are adding, but also sentry context. |
supaglue | github_2023 | typescript | 1,685 | supaglue-labs | tomkit | @@ -3,13 +3,25 @@ import { getSystemProperties, posthogClient } from '@supaglue/core/lib/posthog';
import type { NextFunction, Request, Response } from 'express';
function getProviderNameFromRequest(req: Request) {
- let providerName = req.headers['x-provider-name'] as string;
+ if (req.headers['x-provider-name']... | It seems like `getProviderNameFromRequest` and `getApplicationIdFromRequest` can return undefined -- when do we expect that to be the case?
Also, when do we expect the providerName to be in the query param instead of the header? Is it authenticated vs unauthenticated? Imo, we should have seperate posthog middleware ... |
supaglue | github_2023 | typescript | 1,682 | supaglue-labs | asdfryan | @@ -28,6 +28,7 @@ function onResFinished(req: Request, res: Response, err?: any) {
params: req.params,
providerName: getProviderNameFromRequest(req),
applicationId: req.supaglueApplication?.id,
+ customerId: req.customerId, | Since we're doing this already, mind also adding `applicationEnv`? |
supaglue | github_2023 | typescript | 1,677 | supaglue-labs | tomkit | @@ -1476,21 +1476,25 @@ ${modifiedAfter ? `WHERE SystemModstamp > ${modifiedAfter.toISOString()} ORDER B
case 'contact':
commonObjectRecords = response.records.map((record) => ({
...fromSalesforceContactToContact(record),
+ rawData: toMappedProperties(record, fieldMappingConfig), | Let's chat about the response interface going forward in office |
supaglue | github_2023 | typescript | 1,678 | supaglue-labs | tomkit | @@ -887,40 +867,26 @@ class HubSpotClient extends AbstractCrmRemoteClient implements MarketingAutomati
});
}
- async #fetchPageOfIncrementalRecords(
+ async #fetchPageOfSearchedRecords(
objectType: string,
propertiesToFetch: string[],
associatedStandardObjectTypes: string[],
associatedCu... | When do we use axios vs the client? |
supaglue | github_2023 | typescript | 1,678 | supaglue-labs | tomkit | @@ -1379,6 +1418,28 @@ ${modifiedAfter ? `WHERE SystemModstamp > ${modifiedAfter.toISOString()} ORDER B
return this.updateLead({ ...params.record, id: existingContactId });
}
+ public async searchLead(
+ params: LeadSearchParams,
+ fieldMappingConfig: FieldMappingConfig
+ ): Promise<PaginatedSupaglueR... | Can you add the same comment you did for Hubspot here? |
supaglue | github_2023 | typescript | 1,678 | supaglue-labs | tomkit | @@ -1317,6 +1334,28 @@ ${modifiedAfter ? `WHERE SystemModstamp > ${modifiedAfter.toISOString()} ORDER B
return this.updateContact({ ...params.record, id: existingContactId });
}
+ public async searchContact(
+ params: ContactSearchParams,
+ fieldMappingConfig: FieldMappingConfig
+ ): Promise<Paginated... | Can you add the same comment you did for Hubspot here? |
supaglue | github_2023 | others | 1,678 | supaglue-labs | tomkit | @@ -0,0 +1,56 @@
+post:
+ operationId: searchContacts
+ summary: Search contacts
+ description: |
+ Search contacts by a filter. Only supported for Salesforce and Hubspot. | I started adding a support matrix inside of the unified endpoints when we need to to track {provider, dimension} coverage, e.g. https://docs.supaglue.com/api/v2/crm/list-list-memberships |
supaglue | github_2023 | others | 1,678 | supaglue-labs | tomkit | @@ -0,0 +1,56 @@
+post:
+ operationId: searchLeads
+ summary: Search leads
+ description: |
+ Search leads by a filter. Only supported for Salesforce. | I started adding a support matrix inside of the unified endpoints when we need to to track {provider, dimension} coverage, e.g. https://docs.supaglue.com/api/v2/crm/list-list-memberships |
supaglue | github_2023 | typescript | 1,679 | supaglue-labs | asdfryan | @@ -41,7 +41,7 @@ export const fromSalesloftPersonToContact = (record: Record<string, any>): Conta
postalCode: null,
},
emailAddresses: fromSalesloftPersonToEmailAddresses(record),
- phoneNumbers: fromSalesloftPersonToPhoneNumbers(record.phone_numbers ?? []),
+ phoneNumbers: fromSalesloftPersonTo... | Thanks for the fix! Could you add / modify an existing unit test? (in `salesloft/mappers.test.ts`) |
supaglue | github_2023 | typescript | 1,679 | supaglue-labs | asdfryan | @@ -503,6 +503,10 @@ export const toOutreachProspectPhoneNumbers = (phoneNumbers?: PhoneNumber[]) =>
case 'work':
workPhones.push(phoneNumber);
break;
+ case 'primary':
+ // Defaulting to work phone for primary | `s/work/mobile` ?
Also can you add a test case for this? (and the case where we have both primary + mobile) |
supaglue | github_2023 | typescript | 1,679 | supaglue-labs | tomkit | @@ -190,6 +193,14 @@ export const toApolloContactCreateParams = (params: ContactCreateParams): Record
email: params.emailAddresses?.[0]?.emailAddress,
present_raw_address: params.address ? getRawAddressString(params.address) : undefined,
account_id: params.accountId,
+ // Apollo docs appears to not su... | 🙏 for the comments here |
supaglue | github_2023 | typescript | 1,675 | supaglue-labs | asdfryan | @@ -2094,6 +2094,7 @@ class HubSpotClient extends AbstractCrmRemoteClient implements MarketingAutomati
await this.maybeRefreshAccessToken();
const cursor = paginationParams.cursor ? decodeCursor(paginationParams.cursor) : undefined;
+ // TODO should use fieldMappingConfig here | I think we should just do this IMO. |
supaglue | github_2023 | typescript | 1,663 | supaglue-labs | tomkit | @@ -95,11 +95,10 @@ export default function init(app: Router): void {
req: Request<UpsertAccountPathParams, UpsertAccountResponse, UpsertAccountRequest>,
res: Response<UpsertAccountResponse>
) => {
- const id = await crmCommonObjectService.upsert(
- 'account',
- req.customerConnect... | it might be worth leaving a comment about this |
supaglue | github_2023 | others | 1,654 | supaglue-labs | tomkit | @@ -86,8 +86,12 @@ tags:
description: A `Customer` represents one of your customers.
- name: Connections
description: A `Connection` represents a Customer's connection to a Provider.
+ - name: ConnectionSyncConfigs | What was the change here, re-ordering it in the sidebar? |
supaglue | github_2023 | others | 1,654 | supaglue-labs | tomkit | @@ -1,3 +1,5 @@
# Passthrough API
-The platform features above help accelerate development time for integrations and aim at covering 80% of the most frequently occurring use cases, but they don't cover them all. For the remaining 20%, we expose **[Passthrough APIs](../api/v2/actions/send-passthrough-request)** that ... | Ran ^ this Grammarly:
```Supaglue's Unified API and Managed Syncs cover most of the common integration use cases, but sometimes, you need to access provider-specific endpoints for more custom use cases. For these situations, you can use our **[Passthrough APIs](../api/v2/actions/send-passthrough-request)**, which can a... |
supaglue | github_2023 | others | 1,639 | supaglue-labs | lucasmarshall | @@ -56,24 +91,31 @@
"outputMode": "errors-only"
},
"//#bundle-openapi": {
- "inputs": ["openapi/**/*.yaml"],
- "outputs": ["openapi/**/openapi.bundle.json"],
+ "inputs": [
+ "openapi/**/*.yaml"
+ ],
+ "outputs": [
+ "openapi/**/openapi.bundle.json"
+ ],
... | Why remove this? |
supaglue | github_2023 | typescript | 1,647 | supaglue-labs | tomkit | @@ -95,11 +95,15 @@ export class CrmCommonObjectService {
}
const [writer, destinationType] = await this.#destinationService.getWriterByProviderId(connection.providerId);
if (writer) {
- const record = await this.get(objectName, connection, id);
-
- const end = remoteDuration.startTimer({ opera... | I think we should throw our own error message, i.e. what we had before so it's clear it's cache invalidation, but log and pass along the remote provider error into the jsonapi "details" field (which we're doing here in the second argument) for developers |
supaglue | github_2023 | typescript | 1,647 | supaglue-labs | tomkit | @@ -269,7 +268,7 @@ export class MongoDBDestinationWriter extends BaseDestinationWriter {
);
} catch (err) {
childLogger.error({ err }, 'Error upserting common object record'); | In retrospect: we should log an error here so it's clear that the upsert is causing a cache invalidation issue |
supaglue | github_2023 | typescript | 1,647 | supaglue-labs | asdfryan | @@ -81,13 +82,17 @@ export class EngagementCommonObjectService {
// If the associated provider has a destination, do cache invalidation
const [writer, destinationType] = await this.#destinationService.getWriterByProviderId(connection.providerId);
if (writer) {
- // TODO: we should move this logic in... | Unfortunately you also need to update `create()` as well.
It'd be great to refactor this but it's up to you. |
supaglue | github_2023 | typescript | 1,641 | supaglue-labs | tomkit | @@ -446,77 +446,38 @@ const toSalesforceEmailCreateParams = (emailAddresses?: EmailAddress[]): Record<
};
};
-export const toCustomObject = (salesforceCustomObject: SalesforceCustomObject): CustomObject => {
- if (!salesforceCustomObject.fullName) {
- throw new Error(`unexpectedly, custom object missing fullN... | I know this is legacy, but are "text" and "number" enough for the customer? cc @george-xing |
supaglue | github_2023 | typescript | 1,641 | supaglue-labs | tomkit | @@ -313,14 +313,14 @@ ${modifiedAfter ? `WHERE SystemModstamp > ${modifiedAfter.toISOString()} ORDER B
}
public override async listCustomObjects(): Promise<SimpleCustomObject[]> {
- const metadata = await this.#client.metadata.list({ type: 'CustomObject' });
+ const metadata = await this.#client.describeG... | `const describedObject` or something like that since this is not longer the Metadata API? |
supaglue | github_2023 | typescript | 1,641 | supaglue-labs | tomkit | @@ -313,14 +313,14 @@ ${modifiedAfter ? `WHERE SystemModstamp > ${modifiedAfter.toISOString()} ORDER B
}
public override async listCustomObjects(): Promise<SimpleCustomObject[]> {
- const metadata = await this.#client.metadata.list({ type: 'CustomObject' });
+ const metadata = await this.#client.describeG... | It looks like `.../sobject/:objectname/describe` `fields` array in the response has `"custom": true | false` -- do we expect all custom fields to end with `__c`? |
supaglue | github_2023 | typescript | 1,641 | supaglue-labs | tomkit | @@ -561,10 +561,10 @@ ${modifiedAfter ? `WHERE SystemModstamp > ${modifiedAfter.toISOString()} ORDER B
// Salesforce doesn't actually enforce this, and will just append __c.
// However, we want to enforce this to avoid confusion when using
// the custom object name in other places.
- throw new... | `const describedObject` or something similar since no longer from Metadata API? |
supaglue | github_2023 | typescript | 1,641 | supaglue-labs | tomkit | @@ -446,77 +446,38 @@ const toSalesforceEmailCreateParams = (emailAddresses?: EmailAddress[]): Record<
};
};
-export const toCustomObject = (salesforceCustomObject: SalesforceCustomObject): CustomObject => {
- if (!salesforceCustomObject.fullName) {
- throw new Error(`unexpectedly, custom object missing fullN... | `const field` instead? `nameField` is the name of the field you're filtering on and is a boolean |
supaglue | github_2023 | typescript | 1,619 | supaglue-labs | asdfryan | @@ -1,67 +1,6 @@
-import { getDependencyContainer } from '@/dependency_container';
-import { logger } from '@supaglue/core/lib';
-import cuid from 'cuid';
-import type { Request, Response } from 'express';
import { Router } from 'express';
-const { prisma } = getDependencyContainer();
-
export default function init... | Do we no longer need this? |
supaglue | github_2023 | typescript | 1,625 | supaglue-labs | asdfryan | @@ -31,7 +31,7 @@ export default function init(app: Router): void {
const snakecasedKeysLead = toSnakecasedKeysCrmLead(lead);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { raw_data, ...rest } = snakecasedKeysLead;
- return res.status(200).send(req.query.include_raw_data... | refactor into util function? There's a bunch of places where we do this. |
supaglue | github_2023 | typescript | 1,625 | supaglue-labs | asdfryan | @@ -2017,6 +2023,102 @@ class HubSpotClient extends AbstractCrmRemoteClient implements MarketingAutomati
return params;
}
+ public override async listLists(
+ objectType: Exclude<CRMCommonObjectType, 'user'>,
+ paginationParams: PaginationParams
+ ): Promise<PaginatedResult<ListMetadata>> {
+ if (o... | I think it's better to set the `totalCount` to be undefined and make it optional in the openAPI spec? (or nullable) |
supaglue | github_2023 | typescript | 1,625 | supaglue-labs | asdfryan | @@ -1366,6 +1371,102 @@ ${modifiedAfter ? `WHERE SystemModstamp > ${modifiedAfter.toISOString()} ORDER B
return { ...fromSalesforceUserToUser(user), rawData: toMappedProperties(user, fieldMappingConfig) };
}
+ public override async listLists(
+ objectType: Exclude<CRMCommonObjectType, 'user'>,
+ pagina... | I don't think this is right? We're setting the current cursor to be the previous one? |
supaglue | github_2023 | typescript | 1,625 | supaglue-labs | asdfryan | @@ -1366,6 +1371,102 @@ ${modifiedAfter ? `WHERE SystemModstamp > ${modifiedAfter.toISOString()} ORDER B
return { ...fromSalesforceUserToUser(user), rawData: toMappedProperties(user, fieldMappingConfig) };
}
+ public override async listLists(
+ objectType: Exclude<CRMCommonObjectType, 'user'>,
+ pagina... | Same here |
supaglue | github_2023 | typescript | 1,625 | supaglue-labs | asdfryan | @@ -38,6 +38,7 @@ export const openapiMiddleware = (specDir: string, version = 'v2') => {
validateSecurity: false,
validateRequests: {
removeAdditional: true,
+ coerceTypes: true, | nice. Does this work for `read_from_cache={1|true|false|0}`? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.