Skip to content

Commit

Permalink
Merge pull request #540 from HubSpot/feature/updateCrmDiscoveries
Browse files Browse the repository at this point in the history
Update CRM Companies, Contacts and Deals discoveries
  • Loading branch information
ksvirkou-hubspot authored Sep 13, 2024
2 parents 9b04378 + 6af58ac commit 3536425
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/discovery/crm/companies/CompaniesDiscovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
BatchApi,
Configuration,
createConfiguration,
PublicObjectApi,
MergeApi,
RequestContext,
ResponseContext,
SearchApi,
Expand All @@ -19,7 +19,7 @@ import { getAll } from '../../../services/getAll'
export default class CompaniesDiscovery {
public basicApi: BasicApi
public batchApi: BatchApi
public publicObjectApi: PublicObjectApi
public mergeApi: MergeApi
public searchApi: SearchApi

constructor(config: IConfiguration) {
Expand All @@ -35,7 +35,7 @@ export default class CompaniesDiscovery {

this.basicApi = ApiDecoratorService.getInstance().apply<BasicApi>(new BasicApi(configuration))
this.batchApi = ApiDecoratorService.getInstance().apply<BatchApi>(new BatchApi(configuration))
this.publicObjectApi = ApiDecoratorService.getInstance().apply<PublicObjectApi>(new PublicObjectApi(configuration))
this.mergeApi = ApiDecoratorService.getInstance().apply<MergeApi>(new MergeApi(configuration))
this.searchApi = ApiDecoratorService.getInstance().apply<SearchApi>(new SearchApi(configuration))
}

Expand Down
6 changes: 3 additions & 3 deletions src/discovery/crm/contacts/ContactsDiscovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Configuration,
createConfiguration,
GDPRApi,
PublicObjectApi,
MergeApi,
RequestContext,
ResponseContext,
SearchApi,
Expand All @@ -21,7 +21,7 @@ export default class ContactsDiscovery {
public basicApi: BasicApi
public batchApi: BatchApi
public gdprApi: GDPRApi
public publicObjectApi: PublicObjectApi
public mergeApi: MergeApi
public searchApi: SearchApi

constructor(config: IConfiguration) {
Expand All @@ -38,7 +38,7 @@ export default class ContactsDiscovery {
this.basicApi = ApiDecoratorService.getInstance().apply<BasicApi>(new BasicApi(configuration))
this.batchApi = ApiDecoratorService.getInstance().apply<BatchApi>(new BatchApi(configuration))
this.gdprApi = ApiDecoratorService.getInstance().apply<GDPRApi>(new GDPRApi(configuration))
this.publicObjectApi = ApiDecoratorService.getInstance().apply<PublicObjectApi>(new PublicObjectApi(configuration))
this.mergeApi = ApiDecoratorService.getInstance().apply<MergeApi>(new MergeApi(configuration))
this.searchApi = ApiDecoratorService.getInstance().apply<SearchApi>(new SearchApi(configuration))
}

Expand Down
6 changes: 3 additions & 3 deletions src/discovery/crm/deals/DealsDiscovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
BatchApi,
Configuration,
createConfiguration,
PublicObjectApi,
MergeApi,
RequestContext,
ResponseContext,
SearchApi,
Expand All @@ -19,7 +19,7 @@ import { getAll } from '../../../services/getAll'
export default class DealsDiscovery {
public basicApi: BasicApi
public batchApi: BatchApi
public publicObjectApi: PublicObjectApi
public mergeApi: MergeApi
public searchApi: SearchApi

constructor(config: IConfiguration) {
Expand All @@ -35,7 +35,7 @@ export default class DealsDiscovery {

this.basicApi = ApiDecoratorService.getInstance().apply<BasicApi>(new BasicApi(configuration))
this.batchApi = ApiDecoratorService.getInstance().apply<BatchApi>(new BatchApi(configuration))
this.publicObjectApi = ApiDecoratorService.getInstance().apply<PublicObjectApi>(new PublicObjectApi(configuration))
this.mergeApi = ApiDecoratorService.getInstance().apply<MergeApi>(new MergeApi(configuration))
this.searchApi = ApiDecoratorService.getInstance().apply<SearchApi>(new SearchApi(configuration))
}

Expand Down
6 changes: 3 additions & 3 deletions test/spec/crm/companies/companies.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BasicApi, BatchApi, PublicObjectApi, SearchApi } from '../../../../codegen/crm/companies/index'
import { BasicApi, BatchApi, MergeApi, SearchApi } from '../../../../codegen/crm/companies/index'
import { Client } from '../../../../index'

describe('api client', () => {
Expand All @@ -8,8 +8,8 @@ describe('api client', () => {
expect(BasicApi.name).toBe(client.basicApi.constructor.name)
expect(client.hasOwnProperty('batchApi')).toBeTruthy()
expect(BatchApi.name).toBe(client.batchApi.constructor.name)
expect(client.hasOwnProperty('publicObjectApi')).toBeTruthy()
expect(PublicObjectApi.name).toBe(client.publicObjectApi.constructor.name)
expect(client.hasOwnProperty('mergeApi')).toBeTruthy()
expect(MergeApi.name).toBe(client.mergeApi.constructor.name)
expect(client.hasOwnProperty('searchApi')).toBeTruthy()
expect(SearchApi.name).toBe(client.searchApi.constructor.name)
})
Expand Down
8 changes: 7 additions & 1 deletion test/spec/crm/contacts/contacts.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { BasicApi, BatchApi, GDPRApi, MergeApi, SearchApi } from '../../../../codegen/crm/contacts/index'
import { Client } from '../../../../index'

describe('api client', () => {
it('is discoverable', () => {
const client = new Client().crm.contacts
expect(client.hasOwnProperty('basicApi')).toBeTruthy()
expect(BasicApi.name).toBe(client.basicApi.constructor.name)
expect(client.hasOwnProperty('batchApi')).toBeTruthy()
expect(BatchApi.name).toBe(client.batchApi.constructor.name)
expect(client.hasOwnProperty('gdprApi')).toBeTruthy()
expect(client.hasOwnProperty('publicObjectApi')).toBeTruthy()
expect(GDPRApi.name).toBe(client.gdprApi.constructor.name)
expect(client.hasOwnProperty('mergeApi')).toBeTruthy()
expect(MergeApi.name).toBe(client.mergeApi.constructor.name)
expect(client.hasOwnProperty('searchApi')).toBeTruthy()
expect(SearchApi.name).toBe(client.searchApi.constructor.name)
})
})
6 changes: 3 additions & 3 deletions test/spec/crm/deals/deals.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BasicApi, BatchApi, PublicObjectApi, SearchApi } from '../../../../codegen/crm/deals/index'
import { BasicApi, BatchApi, MergeApi, SearchApi } from '../../../../codegen/crm/deals/index'
import { Client } from '../../../../index'

describe('api client', () => {
Expand All @@ -8,8 +8,8 @@ describe('api client', () => {
expect(BasicApi.name).toBe(client.basicApi.constructor.name)
expect(client.hasOwnProperty('batchApi')).toBeTruthy()
expect(BatchApi.name).toBe(client.batchApi.constructor.name)
expect(client.hasOwnProperty('publicObjectApi')).toBeTruthy()
expect(PublicObjectApi.name).toBe(client.publicObjectApi.constructor.name)
expect(client.hasOwnProperty('mergeApi')).toBeTruthy()
expect(MergeApi.name).toBe(client.mergeApi.constructor.name)
expect(client.hasOwnProperty('searchApi')).toBeTruthy()
expect(SearchApi.name).toBe(client.searchApi.constructor.name)
})
Expand Down

0 comments on commit 3536425

Please sign in to comment.