@planet-a/affinity-node
Version:
API wrapper for the affinity.co API
116 lines (115 loc) • 9.32 kB
TypeScript
import { BaseAPIRequestFactory } from './baseapi.js';
import { Configuration } from '../configuration.js';
import { RequestContext, ResponseContext, HttpInfo } from '../http/http.js';
import { Company } from '../models/Company.js';
import { CompanyPaged } from '../models/CompanyPaged.js';
import { FieldMetadataPaged } from '../models/FieldMetadataPaged.js';
import { ListEntryPaged } from '../models/ListEntryPaged.js';
import { ListPaged } from '../models/ListPaged.js';
import { NotesNotesPaged } from '../models/NotesNotesPaged.js';
/**
* no description
*/
export declare class CompaniesApiRequestFactory extends BaseAPIRequestFactory {
/**
* Returns basic information and non-list-specific field data on the requested Company. To retrieve field data, you must use either the `fieldIds` or the `fieldTypes` parameter to specify the Fields for which you want data returned. These Field IDs and Types can be found using the GET `/v2/companies/fields` endpoint. When no `fieldIds` or `fieldTypes` are provided, Companies will be returned without any field data attached. To supply multiple `fieldIds` or `fieldTypes` parameters, generate a query string that looks like this: `?fieldIds=field-1234&fieldIds=affinity-data-location` or `?fieldTypes=enriched&fieldTypes=global`. Requires the \"Export All Organizations directory\" [permission](#section/Getting-Started/Permissions).
* Get a single Company
* @param companyId Company ID
* @param fieldIds Field IDs for which to return field data
* @param fieldTypes Field Types for which to return field data
*/
v2CompaniesCompanyIdGET(companyId: number, fieldIds?: Array<string>, fieldTypes?: Array<'enriched' | 'global' | 'relationship-intelligence'>, _options?: Configuration): Promise<RequestContext>;
/**
* Paginate through the List Entries (AKA rows) for the given Company across all Lists. Each List Entry includes field data for the Company, including list-specific field data. Each List Entry also includes metadata about its creation, i.e., when it was added to the List and by whom. Requires the \"Export data from Lists\" [permission](#section/Getting-Started/Permissions).
* Get a Company\'s List Entries
* @param companyId Company ID
* @param cursor Cursor for the next or previous page
* @param limit Number of items to include in the page
*/
v2CompaniesCompanyIdListEntriesGET(companyId: number, cursor?: string, limit?: number, _options?: Configuration): Promise<RequestContext>;
/**
* Paginate through all Lists where the given Company appears as an entry and that you have access to view. Returns basic List information for each List that contains this Company.
* Get a Company\'s Lists
* @param companyId Company ID
* @param cursor Cursor for the next or previous page
* @param limit Number of items to include in the page
*/
v2CompaniesCompanyIdListsGET(companyId: number, cursor?: string, limit?: number, _options?: Configuration): Promise<RequestContext>;
/**
* | ⚠️ This endpoint is currently in BETA | |--| Returns relevant notes for a given company which includes directly attached notes and notes attached to persons on this company. You can filter notes using the `filter` query parameter. The filter parameter is a string that you can specify conditions based on the following properties. | **Property Name** | **Description** | **Type** | **Allowed Operators** | **Examples** | |-----------------------------|-----------------------------------------------------------------|------------|--------------------------------------|---------------------------------| | `creator.id` | Filter notes by the creator of the note | `int32` | `=` | `creator.id=1` | | `createdAt` | Filter notes by when it was created | `datetime` | `>`, `<`, `>=`, `<=` | `createdAt<2025-02-04T10:48:24Z` | | `updatedAt` | Filter notes by when it was updated | `datetime` | `>`, `<`, `>=`, `<=` | `updatedAt>=2025-02-03T10:48:24Z`|
* Get Notes for a Company
* @param companyId Company\'s ID
* @param filter Filter options
* @param cursor Cursor for the next or previous page
* @param limit Number of items to include in the page
* @param totalCount Include total count of the collection in the pagination response
*/
v2CompaniesCompanyIdNotesGET(companyId: number, filter?: string, cursor?: string, limit?: number, totalCount?: boolean, _options?: Configuration): Promise<RequestContext>;
/**
* Returns metadata on non-list-specific Company Fields. Use the returned Field IDs to request field data from the GET `/v2/companies` and GET `/v2/companies/{id}` endpoints.
* Get metadata on Company Fields
* @param cursor Cursor for the next or previous page
* @param limit Number of items to include in the page
*/
v2CompaniesFieldsGET(cursor?: string, limit?: number, _options?: Configuration): Promise<RequestContext>;
/**
* Paginate through Companies in Affinity. Returns basic information and non-list-specific field data on each Company. To retrieve field data, you must use either the `fieldIds` or the `fieldTypes` parameter to specify the Fields for which you want data returned. These Field IDs and Types can be found using the GET `/v2/companies/fields` endpoint. When no `fieldIds` or `fieldTypes` are provided, Companies will be returned without any field data attached. To supply multiple `fieldIds` or `fieldTypes` parameters, generate a query string that looks like this: `?fieldIds=field-1234&fieldIds=affinity-data-location` or `?fieldTypes=enriched&fieldTypes=global`. Requires the \"Export All Organizations directory\" [permission](#section/Getting-Started/Permissions).
* Get all Companies
* @param cursor Cursor for the next or previous page
* @param limit Number of items to include in the page
* @param ids Company IDs
* @param fieldIds Field IDs for which to return field data
* @param fieldTypes Field Types for which to return field data
*/
v2CompaniesGET(cursor?: string, limit?: number, ids?: Array<number>, fieldIds?: Array<string>, fieldTypes?: Array<'enriched' | 'global' | 'relationship-intelligence'>, _options?: Configuration): Promise<RequestContext>;
}
export declare class CompaniesApiResponseProcessor {
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to v2CompaniesCompanyIdGET
* @throws ApiException if the response code was not in [200, 299]
*/
v2CompaniesCompanyIdGETWithHttpInfo(response: ResponseContext): Promise<HttpInfo<Company>>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to v2CompaniesCompanyIdListEntriesGET
* @throws ApiException if the response code was not in [200, 299]
*/
v2CompaniesCompanyIdListEntriesGETWithHttpInfo(response: ResponseContext): Promise<HttpInfo<ListEntryPaged>>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to v2CompaniesCompanyIdListsGET
* @throws ApiException if the response code was not in [200, 299]
*/
v2CompaniesCompanyIdListsGETWithHttpInfo(response: ResponseContext): Promise<HttpInfo<ListPaged>>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to v2CompaniesCompanyIdNotesGET
* @throws ApiException if the response code was not in [200, 299]
*/
v2CompaniesCompanyIdNotesGETWithHttpInfo(response: ResponseContext): Promise<HttpInfo<NotesNotesPaged>>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to v2CompaniesFieldsGET
* @throws ApiException if the response code was not in [200, 299]
*/
v2CompaniesFieldsGETWithHttpInfo(response: ResponseContext): Promise<HttpInfo<FieldMetadataPaged>>;
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to v2CompaniesGET
* @throws ApiException if the response code was not in [200, 299]
*/
v2CompaniesGETWithHttpInfo(response: ResponseContext): Promise<HttpInfo<CompanyPaged>>;
}