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,625
supaglue-labs
asdfryan
@@ -35,7 +35,7 @@ export default function init(app: Router): void { req: Request<ListAccountsPathParams, ListAccountsResponse, ListAccountsRequest, ListAccountsQueryParams>, res: Response<ListAccountsResponse> ) => { - if (req.query?.read_from_cache?.toString() !== 'true') { + if (req.query...
Nit: `!req.query?.read_from_cache`
supaglue
github_2023
typescript
1,625
supaglue-labs
asdfryan
@@ -50,7 +50,7 @@ export default function init(app: Router): void { pagination, records: records.map((record) => ({ ...record, - raw_data: req.query.include_raw_data === 'true' ? record.raw_data : undefined, + raw_data: req.query?.include_raw_data === true ? record.raw_dat...
same here `req.query?.include_raw_data ? ...`
supaglue
github_2023
others
1,623
supaglue-labs
tomkit
@@ -56,7 +57,12 @@ properties: description: The step's display order within its sequence. type: type: string - enum: [auto, manual] + enum: [auto_email, manual_email, call, task, linkedin_send_message] + description: | + The type of the sequence state. Note: `linkedin_send_message`` is undocu...
nit: extra backtick
supaglue
github_2023
others
1,623
supaglue-labs
tomkit
@@ -8,6 +8,7 @@ properties: example: "2023-01-01" description: The date this step will activate; only applicable to date-based sequences. template:
nit: any examples
supaglue
github_2023
typescript
1,618
supaglue-labs
lucasmarshall
@@ -0,0 +1,67 @@ +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...
Why backfill at all if we aren't actually going to be backfilling the correct order?
supaglue
github_2023
typescript
1,618
supaglue-labs
lucasmarshall
@@ -106,6 +106,12 @@ async function run() { activityInbound: [(ctx) => new ActivityLogInterceptor(ctx)], workflowModules: [`${__dirname}/interceptors/workflow_log_interceptor`], }), + bundlerOptions: { + webpackConfigHook(config) { + config.target = 'node'; + return config; + ...
We should keep an eye out if this causes any issues. I'm not expecting any, but it _is_ a fundamental change to the webpack config.
supaglue
github_2023
typescript
1,618
supaglue-labs
lucasmarshall
@@ -1,4 +1,5 @@ import type { Sync } from '@supaglue/types/sync'; +import { default as cuid } from 'cuid';
Can't this just be: ```suggestion import cuid from 'cuid'; ```
supaglue
github_2023
typescript
1,620
supaglue-labs
tomkit
@@ -649,6 +655,17 @@ class HubSpotClient extends AbstractCrmRemoteClient implements MarketingAutomati return { standardObjectTypes, customObjectSchemas }; } + async #getAssociatedObjectTypesForObjectTypeFeatureFlagged(fromObjectTypeId: string): Promise<{ + standardObjectTypes: string[]; + customObjectS...
does this do the right thing in TS? i just tried: ``` > 'a' in ['a', 'b'] false ``` --> ``` FETCH_ASSOCIATIONS_APPLICATION_IDS.includes(this.#config.applicationId) ```
supaglue
github_2023
typescript
1,620
supaglue-labs
tomkit
@@ -99,6 +99,11 @@ import { const HUBSPOT_RECORD_LIMIT = 100; const HUBSPOT_SEARCH_RESULTS_LIMIT = 10000; +// TODO move this to lekko +const FETCH_ASSOCIATIONS_APPLICATION_IDS = [ + '9773053e-a13f-4249-b641-301a51952708', // kloze
pls remove comment (customer name)
supaglue
github_2023
typescript
1,620
supaglue-labs
asdfryan
@@ -1207,7 +1222,7 @@ class HubSpotClient extends AbstractCrmRemoteClient implements MarketingAutomati public async getAccount(id: string, fieldMappingConfig: FieldMappingConfig): Promise<Account> { const properties = await this.getCommonObjectPropertyIdsToFetch('company'); const { standardObjectTypes: ass...
Hmm this doesn't make sense to me. Shouldn't this be `company`?
supaglue
github_2023
typescript
1,620
supaglue-labs
asdfryan
@@ -1577,7 +1592,7 @@ class HubSpotClient extends AbstractCrmRemoteClient implements MarketingAutomati public async getContact(id: string, fieldMappingConfig: FieldMappingConfig): Promise<Contact> { const properties = await this.getCommonObjectPropertyIdsToFetch('contact'); const { standardObjectTypes: ass...
This should be `contact`?
supaglue
github_2023
others
1,587
supaglue-labs
albertyfwu
@@ -39,6 +41,16 @@ N/A N/A +## Other limitations + +Date: 9/14/2023 + +Apollo has a few hard limitations with its API: + +- You cannot sync more than 10,000 records per Object type. +- You cannot sync more than 10,000 records per hour.
do we want to mention that this depends on free/paid/custom?
supaglue
github_2023
others
1,587
supaglue-labs
albertyfwu
@@ -13,43 +13,58 @@ description: '' Supaglue uses the HubSpot V3 API. -| Feature | Available | -| ------------------------------------ | ------------------------------------------------- | -| Authentication (`oauth2`) | Yes ...
should this be `until a relevant object`, since there are 2 candidate objects?
supaglue
github_2023
others
1,587
supaglue-labs
albertyfwu
@@ -13,43 +13,58 @@ description: '' Supaglue uses the HubSpot V3 API. -| Feature | Available | -| ------------------------------------ | ------------------------------------------------- | -| Authentication (`oauth2`) | Yes ...
hubspot api only allows listing all users, so we list all users. however, we do a client-side filtering so that only newly-updated users are emitted to the destination. We did this for two reasons: 1. Reduce load on destination 2. Respect invariants and function names where consumers expect the stream to only cont...
supaglue
github_2023
typescript
1,611
supaglue-labs
albertyfwu
@@ -204,14 +204,13 @@ WHEN MATCHED THEN UPDATE SET ${columnsToUpdate.map((col) => `${col} = temp.${col -- Delete from ${qualifiedTable} UPDATE ${qualifiedTable} as table SET is_deleted = TRUE - WHERE NOT EXISTS ( + WHERE table._supaglue_application_id = '${applicationId}' + ...
shouldn't this be `WHERE temp.id = table.id`?
supaglue
github_2023
typescript
1,611
supaglue-labs
albertyfwu
@@ -218,6 +218,9 @@ export class SupaglueDestinationWriter extends BaseDestinationWriter { await client.query( `CREATE TEMP TABLE ${dedupedTempTable} AS SELECT * FROM ${tempTable} ORDER BY _supaglue_id ASC, _supaglue_last_modified_at DESC` ); + await client.query( + `CREATE INDEX IF N...
should be `_supaglue_id`
supaglue
github_2023
typescript
1,595
supaglue-labs
albertyfwu
@@ -46,3 +46,7 @@ const snakecasedKeysMapperByCommonObjectType: { user: toSnakecasedKeysEngagementUser, }, }; + +export const shouldDeleteRecords = (isFullSync: boolean, providerName: ProviderName): boolean => { + return isFullSync && providerName !== 'apollo';
should we document this?
supaglue
github_2023
typescript
1,584
supaglue-labs
albertyfwu
@@ -18,7 +18,7 @@ const { syncObjectRecords, syncEntityRecords } = proxyActivities<ReturnType<type const { getSync, updateSyncState, clearSyncArgsForNextRun, logSyncStart, logSyncFinish, getEntity } = proxyActivities< ReturnType<typeof createActivities> >({ - startToCloseTimeout: '10 second', + startToCloseTimeo...
Why does 10->12 seconds fix issues? What's the root cause of timeouts we are encountering?
supaglue
github_2023
typescript
1,579
supaglue-labs
albertyfwu
@@ -65,6 +73,11 @@ export class EngagementCommonObjectService { const res = await remoteClient.updateCommonObjectRecord(type, params); end(); + const shouldCacheInvalidate = await this.#shouldPerformCacheInvalidation(connection, type);
optional: seems like we can abstract out the entire cache invalidation code, and not just `shouldPerformCacheInvalidation`
supaglue
github_2023
typescript
1,576
supaglue-labs
tomkit
@@ -225,7 +225,7 @@ export default function BigQDestinationDetailsPanel({ isLoading }: BigQueryDesti size="small" label="Dataset" variant="outlined" - helperText="This is the dataset where tables will be written into (it must already exist)." + helperText="Th...
`You can override this dataset per connection via the API later.` --> `Use the Management ConnectionSyncConfigs API to override this.`
supaglue
github_2023
typescript
1,570
supaglue-labs
asdfryan
@@ -1,4 +1,8 @@ export type Property = { id: string; label: string; + + // this is passed back directly from the provider + // we do not have our own enum mapping here + type?: string;
Where are we providing the types for common objects?
supaglue
github_2023
typescript
1,565
supaglue-labs
albertyfwu
@@ -134,13 +135,15 @@ export class ConnectionService { return fromConnectionModelToConnectionSafe(connections[0]); } - public async getSafeByProviderNameAndApplicationId( + public async getSafeByCustomerIdProviderNameAndApplicationId( + externalCustomerId: string, providerName: string, applicat...
don't need this; it's in customerId
supaglue
github_2023
typescript
1,561
supaglue-labs
albertyfwu
@@ -165,6 +165,15 @@ function SyncConfigDetailsPanelImpl({ syncConfigId, lekko }: SyncConfigDetailsPa const commonObjectsSupported = selectedProvider?.category !== 'no_category' && selectedDestination?.type !== 'supaglue'; + const getCommonObjecOptions = (category: ProviderCategory) => {
typo: Objec
supaglue
github_2023
others
1,558
supaglue-labs
tomkit
@@ -27,8 +27,9 @@ Supaglue uses the Outreach v2 API. - Users - Contacts -- Sequences ([*] soft delete supported) +- Sequences - Sequence States +- Sequence Steps (Actions API create only)
`Actions API` --> `Unified API`
supaglue
github_2023
others
1,558
supaglue-labs
tomkit
@@ -41,6 +42,33 @@ N/A ## Provider setup -:::info -This is under construction. -::: +The fastest way to get started with Outreach is to use Supaglue's managed app option (which is enabled by default). This allows Supaglue to automatically configure and manage the OAuth connection between your Outreach and Supaglue...
`If you want to use your own Outreach App with Supaglue` --> `If you want to use your own Outreach App with Supaglue (recommended for production environments)`
supaglue
github_2023
others
1,558
supaglue-labs
tomkit
@@ -41,6 +42,33 @@ N/A ## Provider setup -:::info -This is under construction. -::: +The fastest way to get started with Outreach is to use Supaglue's managed app option (which is enabled by default). This allows Supaglue to automatically configure and manage the OAuth connection between your Outreach and Supaglue...
`Copy the`
supaglue
github_2023
others
1,558
supaglue-labs
tomkit
@@ -41,6 +42,33 @@ N/A ## Provider setup -:::info -This is under construction. -::: +The fastest way to get started with Outreach is to use Supaglue's managed app option (which is enabled by default). This allows Supaglue to automatically configure and manage the OAuth connection between your Outreach and Supaglue...
Can you use backticks here
supaglue
github_2023
typescript
1,539
supaglue-labs
tomkit
@@ -415,6 +445,81 @@ class HubSpotClient extends AbstractCrmRemoteClient { this.#config = config; } + private getHubId(): number { + const { instanceUrl } = this.#config; + const hubId = instanceUrl.split('/').pop(); + if (!hubId) { + throw new Error(`Could not determine hub id from instance ur...
can you also name these to be associated with Marketing Automation (like we do below with remote client?)
supaglue
github_2023
typescript
1,537
supaglue-labs
asdfryan
@@ -0,0 +1,59 @@ +import type { HubspotCompany, HubspotContact } from '@/types/hubspot'; +import type { SupaglueRecord } from '@supaglue/core/lib'; + +export const toHubspotCompany = (record: SupaglueRecord): HubspotCompany => {
How are you doing associations?
supaglue
github_2023
others
1,521
supaglue-labs
albertyfwu
@@ -28,10 +28,14 @@ servers: paths: '/accounts': $ref: paths/accounts.yaml + '/accounts/upsert':
i thought we want to follow convention that non-REST-ful things are prefixed with `_`
supaglue
github_2023
typescript
1,512
supaglue-labs
asdfryan
@@ -753,20 +770,24 @@ class HubSpotClient extends AbstractCrmRemoteClient { ...response.data, results: response.data.results.map(({ associations, ...rest }) => ({ ...rest, - associations: Object.entries(associations ?? {}).reduce((acc, [associatedObjectType, { results }]) => { - ...
Are we going to do this for all the other object types too? (i.e. common objects, entities, custom objects etc)
supaglue
github_2023
typescript
1,510
supaglue-labs
lucasmarshall
@@ -11,6 +11,12 @@ export class NotImplementedError extends SGError { } } +export class CacheInvalidationError extends SGError {
This will still be a 500. Is that what we want?
supaglue
github_2023
typescript
1,502
supaglue-labs
lucasmarshall
@@ -273,13 +279,17 @@ class MsDynamics365Sales extends AbstractCrmRemoteClient { } } - public override async getUserId(): Promise<string | undefined> { + public override async getUserIdAndDetails(): Promise<RemoteUserIdAndDetails> { await this.maybeRefreshAccessToken(); const { accessToken } = thi...
Just leave this key out of the object.
supaglue
github_2023
typescript
1,494
supaglue-labs
albertyfwu
@@ -0,0 +1,318 @@ +import type { + CommonObjectType, + CommonObjectTypeForCategory, + CommonObjectTypeMapForCategory, + ConnectionSafeAny, + FullEntityRecord, + MappedListedObjectRecord, + ProviderCategory, + ProviderName, + StandardFullObjectRecord, +} from '@supaglue/types'; +import { slugifyForTableName } f...
why don't we create partition on `(application_id, provider_name, customer_id)`?
supaglue
github_2023
typescript
1,494
supaglue-labs
albertyfwu
@@ -0,0 +1,318 @@ +import type { + CommonObjectType, + CommonObjectTypeForCategory, + CommonObjectTypeMapForCategory, + ConnectionSafeAny, + FullEntityRecord, + MappedListedObjectRecord, + ProviderCategory, + ProviderName, + StandardFullObjectRecord, +} from '@supaglue/types'; +import { slugifyForTableName } f...
Is this sufficient? What other characters are disallowed by postgres? Shouldn't we reduce to that set?
supaglue
github_2023
typescript
1,494
supaglue-labs
albertyfwu
@@ -0,0 +1,318 @@ +import type { + CommonObjectType, + CommonObjectTypeForCategory, + CommonObjectTypeMapForCategory, + ConnectionSafeAny, + FullEntityRecord, + MappedListedObjectRecord, + ProviderCategory, + ProviderName, + StandardFullObjectRecord, +} from '@supaglue/types'; +import { slugifyForTableName } f...
Shouldn't we not use quotes here?
supaglue
github_2023
typescript
1,494
supaglue-labs
albertyfwu
@@ -0,0 +1,318 @@ +import type { + CommonObjectType, + CommonObjectTypeForCategory, + CommonObjectTypeMapForCategory, + ConnectionSafeAny, + FullEntityRecord, + MappedListedObjectRecord, + ProviderCategory, + ProviderName, + StandardFullObjectRecord, +} from '@supaglue/types'; +import { slugifyForTableName } f...
one could argue that we don't need to have application_id, provider_name here because we are putting it in the schema / table names, but this is fine too.
supaglue
github_2023
typescript
1,494
supaglue-labs
albertyfwu
@@ -0,0 +1,318 @@ +import type { + CommonObjectType, + CommonObjectTypeForCategory, + CommonObjectTypeMapForCategory, + ConnectionSafeAny, + FullEntityRecord, + MappedListedObjectRecord, + ProviderCategory, + ProviderName, + StandardFullObjectRecord, +} from '@supaglue/types'; +import { slugifyForTableName } f...
is partition efficient if the partition key is not what the primary key is?
supaglue
github_2023
others
1,491
supaglue-labs
asdfryan
@@ -0,0 +1,23 @@ +type: object +properties: + name:
Can you come up with realistic examples for these? I feel it makes our docs better.
supaglue
github_2023
others
1,490
supaglue-labs
albertyfwu
@@ -26,8 +26,12 @@ tags: paths: '/salesforce/contact':
should this be pluralized too?
supaglue
github_2023
others
1,478
supaglue-labs
lucasmarshall
@@ -11,6 +11,28 @@ example: schema: public user: myuser oneOf: + - type: object + title: supaglue + properties: + id: + type: string + example: d455d20b-f6dc-4bc3-ab14-b4f21c4b4835 + application_id: + type: string + example: 726fb798-d854-4c59-9a23-57e3e2f73eae + ...
Should we allow a name? I think that we probably should set one of our own?
supaglue
github_2023
typescript
1,474
supaglue-labs
albertyfwu
@@ -66,8 +66,8 @@ export const fromSalesforceAccountToAccount = (record: Record<string, any>): Acc street2: null, city: record.BillingCity ?? null, state: record.BillingState ?? null, - postalCode: record.postalCode ?? null, - country: record.country ?? null, + ...
hm, is `postalCode` and `country` useful for anything?
supaglue
github_2023
others
1,462
supaglue-labs
lucasmarshall
@@ -3,3 +3,4 @@ yarn turbo run lint-staged "--filter=[HEAD^1]" yarn turbo run generate "--filter=!salesforce-pub-sub" +yarn turbo run test "--filter=@supaglue/core"
Actually, we should probably change some of this.
supaglue
github_2023
typescript
1,462
supaglue-labs
albertyfwu
@@ -258,17 +258,20 @@ export const fromSalesforceLeadToLead = ( // TODO: support associated fields convertedAccountId: record.ConvertedAccountId ?? null, convertedContactId: record.ConvertedContactId ?? null, - addresses: [ - { - street1: record.Street ?? null, - street2: null, - ...
what if the user wants to explicitly set `PostalCode` to empty string?
supaglue
github_2023
typescript
1,461
supaglue-labs
albertyfwu
@@ -0,0 +1,5 @@ +import slugify from 'slugify'; + +export function slugifyForTableName(value: string): string { + return slugify(value, { replacement: '_', lower: true, strict: true });
does `replacement` replace spaces with `_`? we currently force entity names to be `A-Za-z0-9_`, so i don't think spaces can be present. Anyways, the lowercasing looks good to me.
supaglue
github_2023
typescript
1,460
supaglue-labs
albertyfwu
@@ -39,6 +39,13 @@ if (sentryEnabled) { scope.setUser({ id: data.orgId as string }); }, + beforeSend(event) { + if (event.request?.headers) { + delete event.request.headers['X-Api-Key'];
Is this case sensitive?
supaglue
github_2023
typescript
1,445
supaglue-labs
albertyfwu
@@ -89,15 +89,19 @@ export async function runObjectSync({ syncId, connectionId, category }: RunObjec errorMessage, }); } else { + const { + entity: { name: entityName }, + } = await getEntity({ entityId: sync.entityId });
@lucasmarshall after deploying to prod we should make sure to kill any workflows that get stuck here, since there will be a non-determinism issue in temporal with the new activity call here
supaglue
github_2023
typescript
1,445
supaglue-labs
albertyfwu
@@ -50,17 +51,19 @@ export function createMaybeSendSyncFinishWebhook({ result: status === 'SYNC_SUCCESS' ? 'SUCCESS' : 'ERROR',
for the payload above, won't this send the `runId` as `id`? Could that be misinterpreted as `syncId` instead of `syncrunId`?
supaglue
github_2023
others
1,445
supaglue-labs
albertyfwu
@@ -35,9 +40,58 @@ post: example: 7bfcc74d-c98b-49de-8e8f-3dc7a17273f6 provider_name: $ref: '../components/schemas/objects/provider_name.yaml' - history_id: + result: + type: string + enum: + ...
should we return `run_id` to make it clear that this is for the run and not the sync?
supaglue
github_2023
typescript
1,450
supaglue-labs
albertyfwu
@@ -60,14 +62,19 @@ export const fromHubSpotCompanyToAccount = ({ ] : []; + let numberOfEmployees = properties.numberofemployees ? parseInt(properties.numberofemployees) : null;
what if we just reject the request altogether?
supaglue
github_2023
others
1,431
supaglue-labs
tomkit
@@ -27,9 +27,15 @@ Configure webhook notifications via the Management Portal by navigating to **Set ## Event types - `sync.complete` -- `connection.created` - -You can retrieve the event type in the request payload from the key `x-event-type`. +- `connection.create` +- `connection.delete` +- `field_mapping.create` ...
In the API Reference docs, I started a migration of `Field Mappings` --> `Schema Mappings` because field mappings can be ambiguous between the data model Objects and Entities. To help scope those two concepts, can we scope both of them to their data model? For example: `data_model:objects.field_mapping.update` ...
supaglue
github_2023
others
1,431
supaglue-labs
tomkit
@@ -0,0 +1,52 @@ +post: + summary: Customer connection deleted + description: Notification of the deletion of a connection for a customer + operationId: connectionDeleted + x-event-type: connection.deleted + tags: + - Webhook Events + requestBody: + content: + application/json: + example: + ...
deleted
supaglue
github_2023
typescript
1,431
supaglue-labs
tomkit
@@ -396,10 +396,10 @@ export class ConnectionAndSyncService { } finally { const { credentials: _, ...paramsWithoutCredentials } = params; await this.#webhookService.sendMessage( - 'connection.create', + 'connection.created', { ...snakecaseKeys(paramsWithoutCredentials), result:...
should these be `...-created`
supaglue
github_2023
others
1,431
supaglue-labs
tomkit
@@ -17,6 +18,9 @@ post: schema: type: object properties: + webhook_event_type: + type: string + example: connection.create
`created`
supaglue
github_2023
others
1,431
supaglue-labs
tomkit
@@ -0,0 +1,52 @@ +post: + summary: Customer connection deleted + description: Notification of the deletion of a connection for a customer + operationId: connectionDeleted + x-event-type: connection.deleted + tags: + - Webhook Events + requestBody: + content: + application/json: + example: + ...
`deleted`
supaglue
github_2023
others
1,433
supaglue-labs
lucasmarshall
@@ -7,6 +7,14 @@ sidebar_position: 4 You can configure Supaglue to fire webhooks to your application for important events. These webhooks don't contain Provider data but are used to notify your application or trigger related workflows. +Supaglue uses [Svix](https://svix.com) as its webhooks platform. They provide ...
```suggestion - [rate limiting](https://docs.svix.com/rate-limit): 1000 QPS (user configurable) ```
supaglue
github_2023
others
1,433
supaglue-labs
lucasmarshall
@@ -27,14 +35,24 @@ Configure webhook notifications via the Management Portal by navigating to **Set ## Event types - `sync.complete` -- `connection.created` - -You can retrieve the event type in the request payload from the key `x-event-type`. +- `connection.create`
```suggestion - `connection.created` ```
supaglue
github_2023
typescript
1,421
supaglue-labs
albertyfwu
@@ -55,7 +55,7 @@ export class EntityService { } public async list(applicationId: string): Promise<Entity[]> { - const entitys = await this.#prisma.entity.findMany({ where: { applicationId } }); + const entitys = await this.#prisma.entity.findMany({ where: { applicationId }, orderBy: { name: 'asc' } });
if we're not paginating, this isn't necessary, no?
supaglue
github_2023
typescript
1,421
supaglue-labs
albertyfwu
@@ -54,7 +54,7 @@ export class SchemaService { } public async list(applicationId: string): Promise<Schema[]> { - const schemas = await this.#prisma.schema.findMany({ where: { applicationId } }); + const schemas = await this.#prisma.schema.findMany({ where: { applicationId }, orderBy: { name: 'asc' } });
if we're not paginating, this isn't necessary, no?
supaglue
github_2023
typescript
1,421
supaglue-labs
albertyfwu
@@ -32,6 +32,9 @@ export class CustomerService { where: { applicationId, }, + orderBy: {
if we're not paginating, this isn't necessary, no?
supaglue
github_2023
typescript
1,421
supaglue-labs
albertyfwu
@@ -57,7 +57,7 @@ export class ApplicationService { // TODO: paginate public async list(orgId: string): Promise<Application[]> { - const applications = await this.#prisma.application.findMany({ where: { orgId } }); + const applications = await this.#prisma.application.findMany({ where: { orgId }, orderBy:...
if we're not paginating, this isn't necessary, no?
supaglue
github_2023
typescript
1,405
supaglue-labs
albertyfwu
@@ -89,7 +89,12 @@ class ApolloClient extends AbstractEngagementRemoteClient { return await super.sendPassthroughRequest({ ...request, query: { ...request.query, api_key: this.#apiKey } }); } if (request.method === 'POST' || request.method === 'PATCH' || request.method === 'PUT') { - const bodyJso...
do we actually need to call `JSON.parse()`? does axios not handle it correctly otherwise? also, i don't think we want to do that, because it's possible that certain APIs aren't expecting JSON payloads. What if the body is literally supposed to be a string?
supaglue
github_2023
javascript
1,394
supaglue-labs
albertyfwu
@@ -99,6 +99,11 @@ const sidebars = { label: 'Managed authentication', type: 'doc', }, + { + id: 'platform/magic-link',
should this be nested in managed auth?
supaglue
github_2023
typescript
1,395
supaglue-labs
albertyfwu
@@ -370,6 +370,9 @@ class ApolloClient extends AbstractEngagementRemoteClient { headers: this.#headers, } ); + if (response.data.contacts.length === 0) {
actually, does apollo return any kind of error message in the response? if so, we should use that
supaglue
github_2023
typescript
1,388
supaglue-labs
lucasmarshall
@@ -253,9 +265,54 @@ const ApiKeyCard = ({ linkId, providerName, returnUrl }: ApiKeyCardProps) => { ); }; -function capitalizeString(str: string): string { - if (!str) { - return str; +const MsDynamics365Card = ({ applicationId, customerId, linkId, providerName, returnUrl }: Oauth2RedirectPageProps) => { + c...
We probably should strip any trailing `'/'` from `instanceUrl`
supaglue
github_2023
others
1,387
supaglue-labs
tomkit
@@ -3,93 +3,110 @@ import ThemedImage from '@theme/ThemedImage'; # Entities <ThemedImage -alt="common schema" -width="50%" -sources={{ - light: '/img/entity-diagram.png', - dark: '/img/entity-diagram.png', - }} + alt="common schema" + width="50%" + sources={{ + light: '/img/entity-diagram.png', +...
nit: To not confuse with "Common Schema" (even if it's lower case): thoughts on using "normalized schema" throughout our docs?
supaglue
github_2023
others
1,387
supaglue-labs
tomkit
@@ -3,93 +3,110 @@ import ThemedImage from '@theme/ThemedImage'; # Entities <ThemedImage -alt="common schema" -width="50%" -sources={{ - light: '/img/entity-diagram.png', - dark: '/img/entity-diagram.png', - }} + alt="common schema" + width="50%" + sources={{ + light: '/img/entity-diagram.png', +...
For consistency, can we also add a Comparison section to the other data models pages?
supaglue
github_2023
others
1,387
supaglue-labs
tomkit
@@ -3,93 +3,110 @@ import ThemedImage from '@theme/ThemedImage'; # Entities <ThemedImage -alt="common schema" -width="50%" -sources={{ - light: '/img/entity-diagram.png', - dark: '/img/entity-diagram.png', - }} + alt="common schema" + width="50%" + sources={{ + light: '/img/entity-diagram.png', +...
Can we call `ContactOrLead` something more anchored on the developer's application? E.g., `ApollaContact`, `ApplicationContact`, ...
supaglue
github_2023
typescript
1,381
supaglue-labs
tomkit
@@ -94,10 +94,10 @@ export default function Home() { }, { field: 'link', - headerName: 'Embed Link',
Do we still allow users to create Embedded Links somewhere?
supaglue
github_2023
typescript
1,384
supaglue-labs
asdfryan
@@ -36,11 +32,12 @@ const cloudMiddleware = authMiddleware({ return NextResponse.redirect(signInUrl); } - // redirect them to organization selection page - if (userId && !orgId && request.nextUrl.pathname !== '/switch-organization') { - const orgSwitcher = new URL('/switch-organization', reques...
I don't this is quite right? `!orgId` means clerk did not pass back an orgId (i.e. they don't have an active org) not that they don't have an org.
supaglue
github_2023
typescript
1,384
supaglue-labs
lucasmarshall
@@ -8,9 +10,28 @@ export const getServerSideProps: GetServerSideProps = async () => { }; export default function CreateOrganizationPage() { + const router = useRouter(); + const { switcher } = router.query; return ( <div className="m-auto"> - <CreateOrganization afterCreateOrganizationUrl="/" /> + ...
```suggestion <OrganizationSwitcher afterSwitchOrganizationUrl="/" hidePersonal={true} /> ```
supaglue
github_2023
others
1,375
supaglue-labs
albertyfwu
@@ -0,0 +1,51 @@ +get: + operationId: getMagicLinks + tags: + - Magic Links + security: + - x-api-key: [] + summary: List magic links + description: >- + Get a list of magic links + responses: + '200': + description: Magic Links + content: + application/json: + schema: + ...
@tomkit i think we're not using this example style anymore, correct?
supaglue
github_2023
others
1,376
supaglue-labs
asdfryan
@@ -1,15 +1,16 @@ -# this example lives here b/c of the oneOf issue -example: - id: 0a292508-d254-4929-98d3-dc23416efff8 - application_id: e52286c9-3038-4fa2-a2b8-3ec9759d20cb - name: My Postgres Destination - type: postgres - config: - host: production-db-new.cluster-cdhnnutnlctj.us-west-2.rds.amazonaws.com - ...
@tomkit is this okay?
supaglue
github_2023
others
1,372
supaglue-labs
tomkit
@@ -0,0 +1,43 @@ +oneOf:
Can you add one full example here
supaglue
github_2023
others
1,372
supaglue-labs
tomkit
@@ -0,0 +1,34 @@ +oneOf:
Can you add one full example here
supaglue
github_2023
others
1,372
supaglue-labs
tomkit
@@ -0,0 +1,17 @@ +type: object +properties: + id: + type: string + custom_object_id: + type: string + data: + type: object + properties:
can you add an example here
supaglue
github_2023
others
1,372
supaglue-labs
tomkit
@@ -0,0 +1,72 @@ +get: + operationId: getCustomObjectRecord + summary: Get Custom Object record + tags: + - ObjectRecords + security: + - x-api-key: [] + responses: + 200: + description: Custom object record + content: + application/json: + schema: + $ref: ../../compon...
Can we omit `examples: Example: value:` going forward and just use schema examples
supaglue
github_2023
others
1,372
supaglue-labs
tomkit
@@ -1,9 +1,9 @@ type: object properties: - name: + suggested_name: type: string example: ticket - description: In Salesforce, this must end with `__c`. + description: The name you'd like to use for the custom object. For some providers, like Salesforce, we might mutate the name, like append `__c`.
Can we enumerate the known ones today (Salesforce, Hubspot)
supaglue
github_2023
typescript
1,293
supaglue-labs
asdfryan
@@ -245,6 +247,13 @@ class SalesforceClient extends AbstractCrmRemoteClient { }); } + public override async listObjects(): Promise<StandardOrCustomObject[]> { + return SALESFORCE_OBJECTS.map((object) => ({
We need to actually query Salesforce I think
supaglue
github_2023
others
1,364
supaglue-labs
lucasmarshall
@@ -0,0 +1,22 @@ +--- +sidebar_custom_props: + icon: /img/connector_icons/linear.svg + category: 'Ticketing' +description: '' +--- + +# Linear + +## Overview + +| Feature | Available | +| ----------------------- | --------- | +| Authentication (Oauth2) | Yes | +| Managed syncs | Yes ...
This is a little confusing. Some people may read that `admin` is required, but it shouldn't be, right?
supaglue
github_2023
typescript
1,364
supaglue-labs
lucasmarshall
@@ -0,0 +1,119 @@ +import { LinearClient as NativeLinearClient, LinearDocument } from '@linear/sdk'; +import type { ConnectionUnsafe, ListedObjectRecord, NoCategoryProvider, Provider } from '@supaglue/types'; +import type { FieldsToFetch } from '@supaglue/types/fields_to_fetch'; +import { Readable } from 'stream'; +imp...
Does this expire and need regular renewal? If so, can we implement that like we do in the other remotes?
supaglue
github_2023
typescript
1,349
supaglue-labs
albertyfwu
@@ -369,6 +372,15 @@ export class ConnectionAndSyncService { errored = true; throw e; } finally { + const { credentials: _, ...paramsWithoutCredentials } = params; + await this.#webhookService.sendMessage(
how important it is to have guaranteed webhooks? if it's critical, it's still possible for this webhook to not fire, since we can crash before this point, or this call fails on first try
supaglue
github_2023
others
1,349
supaglue-labs
albertyfwu
@@ -234,6 +246,17 @@ components: $ref: ../../common/components/parameters/header/x-provider-name.yaml x-customer-id: $ref: ../../common/components/parameters/header/x-customer-id.yaml -webhooks: - webhook: - $ref: ./webhooks/webhook.yaml +x-webhooks: &x-webhooks
can you include this explanation as a comment in the code?
supaglue
github_2023
others
1,349
supaglue-labs
albertyfwu
@@ -0,0 +1,41 @@ +post: + summary: Salesforce record created (beta) + description: |- + When a record is created in a customer's Salesforce (beta) + + This feature is in private beta in Supaglue Cloud. Please [register](https://m8ndtm64l4g.typeform.com/to/ovOUDxGj) if you'd like early access. + operationId: sa...
should we use snakecase to be consistent, or is this intentional to pass along CDC events as-is?
supaglue
github_2023
others
1,349
supaglue-labs
albertyfwu
@@ -0,0 +1,34 @@ +post: + summary: Salesforce record deleted (beta) + description: |- + When a record is deleted from a customer's Salesforce (beta) + + This feature is in private beta in Supaglue Cloud. Please [register](https://m8ndtm64l4g.typeform.com/to/ovOUDxGj) if you'd like early access. + operationId: ...
should we use snakecase to be consistent?
supaglue
github_2023
others
1,349
supaglue-labs
albertyfwu
@@ -0,0 +1,41 @@ +post: + summary: Salesforce record undeleted (beta) + description: |- + When a record is undeleted in a customer's Salesforce (beta) + + This feature is in private beta in Supaglue Cloud. Please [register](https://m8ndtm64l4g.typeform.com/to/ovOUDxGj) if you'd like early access. + operationId...
should we use snakecase to be consistent?
supaglue
github_2023
others
1,349
supaglue-labs
albertyfwu
@@ -0,0 +1,64 @@ +post: + summary: Salesforce record updated (beta) + description: |- + When a record is updated in a customer's Salesforce (beta) + + This feature is in private beta in Supaglue Cloud. Please [register](https://m8ndtm64l4g.typeform.com/to/ovOUDxGj) if you'd like early access. + operationId: sa...
should we use snakecase to be consistent?
supaglue
github_2023
others
1,349
supaglue-labs
albertyfwu
@@ -0,0 +1,64 @@ +post: + summary: Salesforce record updated (beta) + description: |- + When a record is updated in a customer's Salesforce (beta) + + This feature is in private beta in Supaglue Cloud. Please [register](https://m8ndtm64l4g.typeform.com/to/ovOUDxGj) if you'd like early access. + operationId: sa...
should we use snakecase to be consistent?
supaglue
github_2023
others
1,334
supaglue-labs
tomkit
@@ -16,18 +18,16 @@ sources={{ }} /> -Supaglue offers several platform features to support a diverse range of integrations. - ## Authentication -Underlying everything is **[Managed Authentication](./managed-auth)**. We let your customers authenticate with various Providers using different authentication strate...
typo
supaglue
github_2023
others
1,334
supaglue-labs
tomkit
@@ -1,10 +1,11 @@ --- description: '' + --- # Managed syncs (reads) -Managed Syncs lets you sync data from your customers’ third-party Provider directly into your own application database or data warehouse. +Managed syncs lets you sync data from your customers’ third-party provider directly into your own applic...
nit: in terms of platform concepts, I've been using PascalCase, to be clear since there are some ambiguities for some of our concepts like Custom Objects vs provider custom objects, etc.
supaglue
github_2023
others
1,330
supaglue-labs
albertyfwu
@@ -1,34 +1,44 @@ openapi: 3.0.3 info: version: 0.12.12 - title: Supaglue Entity Actions API + title: Supaglue Actions API contact: name: Supaglue description: | #### Introduction - Welcome to the Supaglue Entity Actions API documentation. You can use this API to perform CRUD on Entity recor...
nice catch
supaglue
github_2023
typescript
1,315
supaglue-labs
lucasmarshall
@@ -249,6 +249,7 @@ export class MongoDBDestinationWriter extends BaseDestinationWriter { _supaglue_emitted_at: record.emittedAt, _supaglue_is_deleted: record.isDeleted, _supaglue_raw_data: record.rawData, + _supaglue_mapped_data: record.mappedData,
We also need to switch the normalized data to using this, right?
supaglue
github_2023
typescript
1,315
supaglue-labs
lucasmarshall
@@ -229,13 +229,15 @@ export class MongoDBDestinationWriter extends BaseDestinationWriter { inputStream, new Transform({ objectMode: true, - transform: (record: NormalizedRawRecord, encoding, callback) => { + transform: (record: ObjectRecord, encoding, callback) => { // n...
```suggestion ```
supaglue
github_2023
typescript
1,319
supaglue-labs
lucasmarshall
@@ -46,21 +49,41 @@ type GongClientConfig = { clientSecret: string; }; +type GongAccessKeySecretClientConfig = { + type: 'access_key_secret'; + accessKey: string; + accessKeySecret: string; +}; + class GongClient extends AbstractEngagementRemoteClient { readonly #config: GongClientConfig; public const...
Not sure we need this. According to https://app.gong.io/settings/api/documentation#overview : > Base URL for all API calls is https://api.gong.io/
supaglue
github_2023
typescript
1,300
supaglue-labs
albertyfwu
@@ -13,6 +14,7 @@ export type MergedEntityFieldMapping = { entityField: string; mappedField?: string; from?: 'developer' | 'customer'; + isAdditional: boolean;
technically this should can only be `true` if `from`: is `customer`, so the type can be stricter, but this is OK for now
supaglue
github_2023
typescript
1,288
supaglue-labs
asdfryan
@@ -1,13 +1,17 @@ import type { StandardOrCustomObject } from './standard_or_custom_object'; -type From = { - from: 'developer' | 'customer'; -}; - export type MergedEntityMapping = { entityId: string; - object?: StandardOrCustomObject & From; - fieldMappings?: (EntityFieldMapping & From)[]; + object?: Stand...
Could you also add the `entityName` here?
supaglue
github_2023
typescript
1,288
supaglue-labs
asdfryan
@@ -1,13 +1,18 @@ import type { StandardOrCustomObject } from './standard_or_custom_object'; -type From = { - from: 'developer' | 'customer'; -}; - export type MergedEntityMapping = { entityId: string; - object?: StandardOrCustomObject & From; - fieldMappings?: (EntityFieldMapping & From)[]; + entityName: st...
Shouldn't this be optional? It's optional in the openAPI spec
supaglue
github_2023
others
1,285
supaglue-labs
lucasmarshall
@@ -73,7 +84,7 @@ export const IntegrationCard = ({ icon, provider, description, to }) => ( ### Embedded links in UI components -Embedded Links can be used in any UI components in your frontend application. For example, below are two cards that can be used to connect to Salesforce and HubSpot: +USe Embedded Links ...
```suggestion Use Embedded Links in any UI components in your frontend application. For example, the two cards below are cards that your customer can click to connect to Salesforce and HubSpot: ```
supaglue
github_2023
others
1,285
supaglue-labs
lucasmarshall
@@ -9,11 +9,22 @@ import TabItem from '@theme/TabItem'; # Managed authentication +<ThemedImage + alt="managed auth" + width="50%" + sources={{ + light: '/img/managed-auth-diagram.png', + dark: '/img/managed-auth-diagram.png', + }} +/> + Supaglue securely manages connections between your application and ...
```suggestion An embedded link is a URL that initiates an authentication flow in your customer's third-party provider to install your developer app. Once installed, a connection is created in Supaglue, allowing you to read from and write to your customers' SaaS provider. Embedded links allow customers to connect their...
supaglue
github_2023
others
1,285
supaglue-labs
lucasmarshall
@@ -45,7 +56,7 @@ http://localhost:8080/oauth/connect?applicationId={APPLICATION_ID}&customerId={C | `customerId` | The unique identifier for a customer in your application ...
```suggestion | `loginUrl` | The Oauth2 hostname for authorize and token endpoints.<br/> Use this for Salesforce sandbox accounts. The value should be `https://test.salesforce.com` for that use case.<br/> <b>NOTE:</b> this should be uriEncoded | No | `...