Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

feat: @supaglue/sdk first release #2033

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
"@typescript-eslint/no-misused-promises": ["warn", { "checksVoidReturn": false }],
"@typescript-eslint/consistent-type-imports": "error"
},
"ignorePatterns": ["node_modules/", "dist/", "coverage/", "/packages/schemas/gen/", "/packages/core/jest.config.js", "*.openapi.gen.d.ts"]
"ignorePatterns": ["node_modules/", "dist/", "coverage/", "/packages/sdk/gen/", "/packages/core/jest.config.js", "*.openapi.gen.d.ts"]
}
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated
/packages/schemas/gen/**/* linguist-generated
/packages/sdk/gen/**/* linguist-generated
openapi/**/openapi.bundle.json linguist-generated
*.example.json linguist-generated
/docs/docs/api/**/* linguist-generated
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/api_build_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- apps/api/**
- packages/core/**
- packages/db/**
- packages/schemas/**
- packages/sdk/**
- packages/sync-workflows/**
- packages/types/**
- packages/utils/**
Expand All @@ -18,7 +18,7 @@ on:
- apps/api/**
- packages/core/**
- packages/db/**
- packages/schemas/**
- packages/sdk/**
- packages/sync-workflows/**
- packages/types/**
- packages/utils/**
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ tsconfig.*.json
cli/
*.debug.ts*
temp/

2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/packages/schemas/gen/**/*
/packages/sdk/gen/**/*
4 changes: 2 additions & 2 deletions apps/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import initRoutes from '@/routes';
import { createTerminus } from '@godaddy/terminus';
import { SGError } from '@supaglue/core/errors';
import { expressScopeMiddleware, logger } from '@supaglue/core/lib';
import type { ResponseErrors } from '@supaglue/schemas';
import type { ResponseErrors } from '@supaglue/sdk';
import cors from 'cors';
import type { NextFunction, Request, Response } from 'express';
import express from 'express';
Expand All @@ -18,7 +18,7 @@ const metricsApp = express();
const port = process.env.SUPAGLUE_API_PORT ? parseInt(process.env.SUPAGLUE_API_PORT) : 8080;

if (process.env.GLOBAL_AGENT_HTTP_PROXY) {
require('@supaglue/schemas/proxy.bootstrap');
require('@supaglue/sdk/proxy.bootstrap');
}

app.use(
Expand Down
4 changes: 2 additions & 2 deletions apps/api/integration-test-environment.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const axios = require('axios');
const { TestEnvironment } = require('jest-environment-node');
const { createSupaglueClient } = require('@supaglue/schemas');
const { createSupaglueClient } = require('@supaglue/sdk');

// For debugging
require('@supaglue/schemas/proxy.bootstrap');
require('@supaglue/sdk/proxy.bootstrap');

const toHubspotPluralObjectName = {
contact: 'contacts',
Expand Down
2 changes: 1 addition & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@godaddy/terminus": "^4.11.2",
"@supaglue/core": "workspace:*",
"@supaglue/db": "workspace:*",
"@supaglue/schemas": "workspace:*",
"@supaglue/sdk": "workspace:*",
"@supaglue/sync-workflows": "workspace:*",
"@supaglue/utils": "workspace:*",
"@temporalio/activity": "^1.8.6",
Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/actions/v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
SendPassthroughRequestPathParams,
SendPassthroughRequestRequest,
SendPassthroughRequestResponse,
} from '@supaglue/schemas/v2/actions';
} from '@supaglue/sdk/v2/actions';
import type { Request, Response } from 'express';
import { Router } from 'express';

Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/crm/v2/account.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
ListAccountsSuccessfulResponse,
UpdateAccountSuccessfulResponse,
UpsertAccountSuccessfulResponse,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';

jest.retryTimes(3);

Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/crm/v2/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type {
UpsertAccountPathParams,
UpsertAccountRequest,
UpsertAccountResponse,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';
import type { FieldMappingConfig } from '@supaglue/types/field_mapping_config';
import { camelcaseKeysSansCustomFields } from '@supaglue/utils/camelcase';
import type { Request, Response } from 'express';
Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/crm/v2/associations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
UpsertAssociationPathParams,
UpsertAssociationRequest,
UpsertAssociationResponse,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';
import type { Request, Response } from 'express';
import { Router } from 'express';

Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/crm/v2/contact.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
UpdateContactSuccessfulResponse,
UpsertContactRequest,
UpsertContactSuccessfulResponse,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';

jest.retryTimes(3);

Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/crm/v2/contact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import type {
UpsertContactPathParams,
UpsertContactRequest,
UpsertContactResponse,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';
import type { FieldMappingConfig } from '@supaglue/types/field_mapping_config';
import { camelcaseKeys, camelcaseKeysSansCustomFields } from '@supaglue/utils/camelcase';
import type { Request, Response } from 'express';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
GetCustomObjectRecordSuccessfulResponse,
ListCustomObjectRecordsSuccessfulResponse,
UpdateCustomObjectRecordSuccessfulResponse,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';

jest.retryTimes(3);

Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/crm/v2/custom_objects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
UpdateCustomObjectRecordPathParams,
UpdateCustomObjectRecordRequest,
UpdateCustomObjectRecordResponse,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';
import type { Request, Response } from 'express';
import { Router } from 'express';

Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/crm/v2/lead.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
UpdateLeadSuccessfulResponse,
UpsertLeadRequest,
UpsertLeadSuccessfulResponse,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';

jest.retryTimes(3);

Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/crm/v2/lead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import type {
UpsertLeadPathParams,
UpsertLeadRequest,
UpsertLeadResponse,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';
import type { FieldMappingConfig } from '@supaglue/types/field_mapping_config';
import { camelcaseKeys, camelcaseKeysSansCustomFields } from '@supaglue/utils/camelcase';
import type { Request, Response } from 'express';
Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/crm/v2/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {
ListListsQueryParams,
ListListsRequest,
ListListsResponse,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';
import type {
SnakecasedKeysCrmAccount,
SnakecasedKeysCrmContact,
Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/crm/v2/metadata/associations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
ListAssociationSchemasQueryParams,
ListAssociationSchemasRequest,
ListAssociationSchemasResponse,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';
import { snakecaseKeys } from '@supaglue/utils/snakecase';
import type { Request, Response } from 'express';
import { Router } from 'express';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
GetCustomObjectSchemaSuccessfulResponse,
ListCustomObjectSchemasSuccessfulResponse,
UpdateCustomObjectSchemaPathParams,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';

describe('custom_objects', () => {
let testCustomObject: CreateCustomObjectSchemaRequest['object'];
Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/crm/v2/metadata/custom_objects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
UpdateCustomObjectSchemaPathParams,
UpdateCustomObjectSchemaRequest,
UpdateCustomObjectSchemaResponse,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';
import { camelcaseKeys } from '@supaglue/utils/camelcase';
import { snakecaseKeys } from '@supaglue/utils/snakecase';
import type { Request, Response } from 'express';
Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/crm/v2/metadata/properties/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import type {
UpdatePropertiesQueryParams,
UpdatePropertiesRequest,
UpdatePropertiesResponse,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';
import { camelcaseKeys, snakecaseKeys } from '@supaglue/utils';
import type { Request, Response } from 'express';
import { Router } from 'express';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
ListStandardObjectSchemasPathParams,
ListStandardObjectSchemasRequest,
ListStandardObjectSchemasResponse,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';
import type { Request, Response } from 'express';
import { Router } from 'express';

Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/crm/v2/opportunity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
UpdateOpportunityPathParams,
UpdateOpportunityRequest,
UpdateOpportunityResponse,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';
import type { FieldMappingConfig } from '@supaglue/types/field_mapping_config';
import { camelcaseKeysSansCustomFields } from '@supaglue/utils/camelcase';
import type { Request, Response } from 'express';
Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/crm/v2/standard_objects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
UpdateStandardObjectRecordPathParams,
UpdateStandardObjectRecordRequest,
UpdateStandardObjectRecordResponse,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';
import type { Request, Response } from 'express';
import { Router } from 'express';

Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/crm/v2/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
ListUsersQueryParams,
ListUsersRequest,
ListUsersResponse,
} from '@supaglue/schemas/v2/crm';
} from '@supaglue/sdk/v2/crm';
import type { FieldMappingConfig } from '@supaglue/types/field_mapping_config';
import type { Request, Response } from 'express';
import { Router } from 'express';
Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/data/v2/hubspot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
ListHubspotContactsQueryParams,
ListHubspotContactsRequest,
ListHubspotContactsResponse,
} from '@supaglue/schemas/v2/data';
} from '@supaglue/sdk/v2/data';
import type { NextFunction, Request, Response } from 'express';
import { Router } from 'express';

Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/data/v2/salesforce/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
ListSalesforceContactsQueryParams,
ListSalesforceContactsRequest,
ListSalesforceContactsResponse,
} from '@supaglue/schemas/v2/data';
} from '@supaglue/sdk/v2/data';
import type { NextFunction, Request, Response } from 'express';
import { Router } from 'express';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
ListAccountsSuccessfulResponse,
UpdateAccountSuccessfulResponse,
UpsertAccountSuccessfulResponse,
} from '@supaglue/schemas/v2/engagement';
} from '@supaglue/sdk/v2/engagement';

describe('account', () => {
let testAccount: CreateAccountRequest['record'];
Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/engagement/v2/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import type {
UpsertAccountPathParams,
UpsertAccountRequest,
UpsertAccountResponse,
} from '@supaglue/schemas/v2/engagement';
} from '@supaglue/sdk/v2/engagement';
import { camelcaseKeysSansCustomFields } from '@supaglue/utils/camelcase';
import type { Request, Response } from 'express';
import { Router } from 'express';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
ListContactsSuccessfulResponse,
SearchContactsSuccessfulResponse,
UpdateContactSuccessfulResponse,
} from '@supaglue/schemas/v2/engagement';
} from '@supaglue/sdk/v2/engagement';

jest.retryTimes(3);

Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/engagement/v2/contact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import type {
UpdateContactQueryParams,
UpdateContactRequest,
UpdateContactResponse,
} from '@supaglue/schemas/v2/engagement';
} from '@supaglue/sdk/v2/engagement';
import { camelcaseKeysSansCustomFields } from '@supaglue/utils/camelcase';
import type { Request, Response } from 'express';
import { Router } from 'express';
Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/engagement/v2/mailbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {
ListMailboxesQueryParams,
ListMailboxesRequest,
ListMailboxesResponse,
} from '@supaglue/schemas/v2/engagement';
} from '@supaglue/sdk/v2/engagement';
import type { Request, Response } from 'express';
import { Router } from 'express';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
ListSequencesSuccessfulResponse,
SearchSequenceStatesRequest,
SearchSequenceStatesSuccessfulResponse,
} from '@supaglue/schemas/v2/engagement';
} from '@supaglue/sdk/v2/engagement';

jest.retryTimes(3);

Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/engagement/v2/sequence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
ListSequencesQueryParams,
ListSequencesRequest,
ListSequencesResponse,
} from '@supaglue/schemas/v2/engagement';
} from '@supaglue/sdk/v2/engagement';
import { camelcaseKeysSansCustomFields } from '@supaglue/utils';
import type { Request, Response } from 'express';
import { Router } from 'express';
Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/engagement/v2/sequence_state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import type {
SearchSequenceStatesQueryParams,
SearchSequenceStatesRequest,
SearchSequenceStatesResponse,
} from '@supaglue/schemas/v2/engagement';
} from '@supaglue/sdk/v2/engagement';
import { camelcaseKeys, camelcaseKeysSansCustomFields } from '@supaglue/utils/camelcase';
import type { Request, Response } from 'express';
import { Router } from 'express';
Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/engagement/v2/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {
ListUsersQueryParams,
ListUsersRequest,
ListUsersResponse,
} from '@supaglue/schemas/v2/engagement';
} from '@supaglue/sdk/v2/engagement';
import type { Request, Response } from 'express';
import { Router } from 'express';

Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/enrichment/v2/person.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
EnrichPersonQueryParams,
EnrichPersonRequest,
EnrichPersonResponse,
} from '@supaglue/schemas/v2/enrichment';
} from '@supaglue/sdk/v2/enrichment';
import { snakecaseKeys } from '@supaglue/utils';
import type { Request, Response } from 'express';
import { Router } from 'express';
Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/internal/customer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
UpsertCustomerPathParams,
UpsertCustomerRequest,
UpsertCustomerResponse,
} from '@supaglue/schemas/v2/mgmt';
} from '@supaglue/sdk/v2/mgmt';
import { camelcaseKeys } from '@supaglue/utils/camelcase';
import { snakecaseKeys } from '@supaglue/utils/snakecase';
import type { Request, Response } from 'express';
Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/internal/destination/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
UpdateDestinationPathParams,
UpdateDestinationRequest,
UpdateDestinationResponse,
} from '@supaglue/schemas/v2/mgmt';
} from '@supaglue/sdk/v2/mgmt';
import { camelcaseKeys } from '@supaglue/utils/camelcase';
import { snakecaseKeys } from '@supaglue/utils/snakecase';
import type { Request, Response } from 'express';
Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/internal/provider/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
UpdateProviderPathParams,
UpdateProviderRequest,
UpdateProviderResponse,
} from '@supaglue/schemas/v2/mgmt';
} from '@supaglue/sdk/v2/mgmt';
import type { ProviderCreateParams, ProviderUpdateParams } from '@supaglue/types';
import { camelcaseKeys } from '@supaglue/utils/camelcase';
import { snakecaseKeys } from '@supaglue/utils/snakecase';
Expand Down
2 changes: 1 addition & 1 deletion apps/api/routes/marketing-automation/v2/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
SubmitFormQueryParams,
SubmitFormRequest,
SubmitFormResponse,
} from '@supaglue/schemas/v2/marketing-automation';
} from '@supaglue/sdk/v2/marketing-automation';
import { snakecaseKeys } from '@supaglue/utils';
import type { Request, Response } from 'express';
import { Router } from 'express';
Expand Down
Loading
Loading