UNPKG

@planet-a/affinity-node

Version:
624 lines 154 kB
import { mergeConfiguration } from '../configuration.js'; import { of, from } from '../rxjsStub.js'; import { mergeMap, map } from '../rxjsStub.js'; import { AuthApiRequestFactory, AuthApiResponseProcessor } from "../apis/AuthApi.js"; export class ObservableAuthApi { constructor(configuration, requestFactory, responseProcessor) { Object.defineProperty(this, "requestFactory", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "responseProcessor", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "configuration", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.configuration = configuration; this.requestFactory = requestFactory || new AuthApiRequestFactory(configuration); this.responseProcessor = responseProcessor || new AuthApiResponseProcessor(); } /** * Returns information about the authenticated user, their current organization, and API key permissions. Use this endpoint to verify your authentication and understand your available API access levels. * Get current user */ v2AuthWhoamiGETWithHttpInfo(_options) { const _config = mergeConfiguration(this.configuration, _options); const requestContextPromise = this.requestFactory.v2AuthWhoamiGET(_config); // build promise chain let middlewarePreObservable = from(requestContextPromise); for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx))); } return middlewarePreObservable.pipe(mergeMap((ctx) => _config.httpApi.send(ctx))). pipe(mergeMap((response) => { let middlewarePostObservable = of(response); for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp))); } return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2AuthWhoamiGETWithHttpInfo(rsp))); })); } /** * Returns information about the authenticated user, their current organization, and API key permissions. Use this endpoint to verify your authentication and understand your available API access levels. * Get current user */ v2AuthWhoamiGET(_options) { return this.v2AuthWhoamiGETWithHttpInfo(_options).pipe(map((apiResponse) => apiResponse.data)); } } import { CallsApiRequestFactory, CallsApiResponseProcessor } from "../apis/CallsApi.js"; export class ObservableCallsApi { constructor(configuration, requestFactory, responseProcessor) { Object.defineProperty(this, "requestFactory", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "responseProcessor", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "configuration", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.configuration = configuration; this.requestFactory = requestFactory || new CallsApiRequestFactory(configuration); this.responseProcessor = responseProcessor || new CallsApiResponseProcessor(); } /** * Paginate through all calls in Affinity. Returns basic information about the call interaction and its participants. Will only return calls that the current authenticated user has permission to see. You can filter calls 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** | |-----------------------------|-----------------------------------------------------------------|------------|--------------------------------------|----------------------------------| | `id` | Unique identifier for Calls | `int64` | `=` | `id=1` | | `startTime` | Start time of when the Call was held | `datetime` | `>`, `<`, `>=`, `<=` | `sentAt>2025-01-01T01:00:00Z` | | `createdAt` | When the Call was created in Affinity | `datetime` | `>`, `<`, `>=`, `<=` | `createdAt<2025-01-01T01:00:00Z` | | `updatedAt` | When the Call was updated in Affinity | `datetime` | `>`, `<`, `>=`, `<=` | `updatedAt>=2025-01-01T01:00:00Z`| * Get metadata on all Calls * @param [cursor] Cursor for the next or previous page * @param [limit] Number of items to include in the page * @param [filter] Filter options */ v2CallsGETWithHttpInfo(cursor, limit, filter, _options) { const _config = mergeConfiguration(this.configuration, _options); const requestContextPromise = this.requestFactory.v2CallsGET(cursor, limit, filter, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx))); } return middlewarePreObservable.pipe(mergeMap((ctx) => _config.httpApi.send(ctx))). pipe(mergeMap((response) => { let middlewarePostObservable = of(response); for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp))); } return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2CallsGETWithHttpInfo(rsp))); })); } /** * Paginate through all calls in Affinity. Returns basic information about the call interaction and its participants. Will only return calls that the current authenticated user has permission to see. You can filter calls 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** | |-----------------------------|-----------------------------------------------------------------|------------|--------------------------------------|----------------------------------| | `id` | Unique identifier for Calls | `int64` | `=` | `id=1` | | `startTime` | Start time of when the Call was held | `datetime` | `>`, `<`, `>=`, `<=` | `sentAt>2025-01-01T01:00:00Z` | | `createdAt` | When the Call was created in Affinity | `datetime` | `>`, `<`, `>=`, `<=` | `createdAt<2025-01-01T01:00:00Z` | | `updatedAt` | When the Call was updated in Affinity | `datetime` | `>`, `<`, `>=`, `<=` | `updatedAt>=2025-01-01T01:00:00Z`| * Get metadata on all Calls * @param [cursor] Cursor for the next or previous page * @param [limit] Number of items to include in the page * @param [filter] Filter options */ v2CallsGET(cursor, limit, filter, _options) { return this.v2CallsGETWithHttpInfo(cursor, limit, filter, _options).pipe(map((apiResponse) => apiResponse.data)); } } import { ChatMessagesApiRequestFactory, ChatMessagesApiResponseProcessor } from "../apis/ChatMessagesApi.js"; export class ObservableChatMessagesApi { constructor(configuration, requestFactory, responseProcessor) { Object.defineProperty(this, "requestFactory", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "responseProcessor", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "configuration", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.configuration = configuration; this.requestFactory = requestFactory || new ChatMessagesApiRequestFactory(configuration); this.responseProcessor = responseProcessor || new ChatMessagesApiResponseProcessor(); } /** * Paginate through all chat messages in Affinity. Returns basic information about the chat message interaction and its participants. Will only return chat messages that the current authenticated user has permission to see. You can filter chat messages 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** | |-----------------------------|-----------------------------------------------------------------|------------|--------------------------------------|----------------------------------| | `id` | Unique identifier for Chat Messages | `int64` | `=` | `id=1` | | `sentAt` | When the Chat Message was sent at | `datetime` | `>`, `<`, `>=`, `<=` | `sentAt>2025-01-01T01:00:00Z` | | `createdAt` | When the Chat Message was created in Affinity | `datetime` | `>`, `<`, `>=`, `<=` | `createdAt<2025-01-01T01:00:00Z` | | `updatedAt` | When the Chat Message was updated in Affinity | `datetime` | `>`, `<`, `>=`, `<=` | `updatedAt>=2025-01-01T01:00:00Z`| * Get metadata on all Chat Messages * @param [cursor] Cursor for the next or previous page * @param [limit] Number of items to include in the page * @param [filter] Filter options */ v2ChatMessagesGETWithHttpInfo(cursor, limit, filter, _options) { const _config = mergeConfiguration(this.configuration, _options); const requestContextPromise = this.requestFactory.v2ChatMessagesGET(cursor, limit, filter, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx))); } return middlewarePreObservable.pipe(mergeMap((ctx) => _config.httpApi.send(ctx))). pipe(mergeMap((response) => { let middlewarePostObservable = of(response); for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp))); } return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2ChatMessagesGETWithHttpInfo(rsp))); })); } /** * Paginate through all chat messages in Affinity. Returns basic information about the chat message interaction and its participants. Will only return chat messages that the current authenticated user has permission to see. You can filter chat messages 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** | |-----------------------------|-----------------------------------------------------------------|------------|--------------------------------------|----------------------------------| | `id` | Unique identifier for Chat Messages | `int64` | `=` | `id=1` | | `sentAt` | When the Chat Message was sent at | `datetime` | `>`, `<`, `>=`, `<=` | `sentAt>2025-01-01T01:00:00Z` | | `createdAt` | When the Chat Message was created in Affinity | `datetime` | `>`, `<`, `>=`, `<=` | `createdAt<2025-01-01T01:00:00Z` | | `updatedAt` | When the Chat Message was updated in Affinity | `datetime` | `>`, `<`, `>=`, `<=` | `updatedAt>=2025-01-01T01:00:00Z`| * Get metadata on all Chat Messages * @param [cursor] Cursor for the next or previous page * @param [limit] Number of items to include in the page * @param [filter] Filter options */ v2ChatMessagesGET(cursor, limit, filter, _options) { return this.v2ChatMessagesGETWithHttpInfo(cursor, limit, filter, _options).pipe(map((apiResponse) => apiResponse.data)); } } import { CompaniesApiRequestFactory, CompaniesApiResponseProcessor } from "../apis/CompaniesApi.js"; export class ObservableCompaniesApi { constructor(configuration, requestFactory, responseProcessor) { Object.defineProperty(this, "requestFactory", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "responseProcessor", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "configuration", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.configuration = configuration; this.requestFactory = requestFactory || new CompaniesApiRequestFactory(configuration); this.responseProcessor = responseProcessor || new CompaniesApiResponseProcessor(); } /** * 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 */ v2CompaniesCompanyIdGETWithHttpInfo(companyId, fieldIds, fieldTypes, _options) { const _config = mergeConfiguration(this.configuration, _options); const requestContextPromise = this.requestFactory.v2CompaniesCompanyIdGET(companyId, fieldIds, fieldTypes, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx))); } return middlewarePreObservable.pipe(mergeMap((ctx) => _config.httpApi.send(ctx))). pipe(mergeMap((response) => { let middlewarePostObservable = of(response); for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp))); } return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2CompaniesCompanyIdGETWithHttpInfo(rsp))); })); } /** * 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, fieldIds, fieldTypes, _options) { return this.v2CompaniesCompanyIdGETWithHttpInfo(companyId, fieldIds, fieldTypes, _options).pipe(map((apiResponse) => apiResponse.data)); } /** * 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 */ v2CompaniesCompanyIdListEntriesGETWithHttpInfo(companyId, cursor, limit, _options) { const _config = mergeConfiguration(this.configuration, _options); const requestContextPromise = this.requestFactory.v2CompaniesCompanyIdListEntriesGET(companyId, cursor, limit, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx))); } return middlewarePreObservable.pipe(mergeMap((ctx) => _config.httpApi.send(ctx))). pipe(mergeMap((response) => { let middlewarePostObservable = of(response); for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp))); } return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2CompaniesCompanyIdListEntriesGETWithHttpInfo(rsp))); })); } /** * 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, cursor, limit, _options) { return this.v2CompaniesCompanyIdListEntriesGETWithHttpInfo(companyId, cursor, limit, _options).pipe(map((apiResponse) => apiResponse.data)); } /** * 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 */ v2CompaniesCompanyIdListsGETWithHttpInfo(companyId, cursor, limit, _options) { const _config = mergeConfiguration(this.configuration, _options); const requestContextPromise = this.requestFactory.v2CompaniesCompanyIdListsGET(companyId, cursor, limit, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx))); } return middlewarePreObservable.pipe(mergeMap((ctx) => _config.httpApi.send(ctx))). pipe(mergeMap((response) => { let middlewarePostObservable = of(response); for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp))); } return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2CompaniesCompanyIdListsGETWithHttpInfo(rsp))); })); } /** * 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, cursor, limit, _options) { return this.v2CompaniesCompanyIdListsGETWithHttpInfo(companyId, cursor, limit, _options).pipe(map((apiResponse) => apiResponse.data)); } /** * | ⚠️ 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\&#39;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 */ v2CompaniesCompanyIdNotesGETWithHttpInfo(companyId, filter, cursor, limit, totalCount, _options) { const _config = mergeConfiguration(this.configuration, _options); const requestContextPromise = this.requestFactory.v2CompaniesCompanyIdNotesGET(companyId, filter, cursor, limit, totalCount, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx))); } return middlewarePreObservable.pipe(mergeMap((ctx) => _config.httpApi.send(ctx))). pipe(mergeMap((response) => { let middlewarePostObservable = of(response); for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp))); } return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2CompaniesCompanyIdNotesGETWithHttpInfo(rsp))); })); } /** * | ⚠️ 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\&#39;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, filter, cursor, limit, totalCount, _options) { return this.v2CompaniesCompanyIdNotesGETWithHttpInfo(companyId, filter, cursor, limit, totalCount, _options).pipe(map((apiResponse) => apiResponse.data)); } /** * 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 */ v2CompaniesFieldsGETWithHttpInfo(cursor, limit, _options) { const _config = mergeConfiguration(this.configuration, _options); const requestContextPromise = this.requestFactory.v2CompaniesFieldsGET(cursor, limit, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx))); } return middlewarePreObservable.pipe(mergeMap((ctx) => _config.httpApi.send(ctx))). pipe(mergeMap((response) => { let middlewarePostObservable = of(response); for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp))); } return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2CompaniesFieldsGETWithHttpInfo(rsp))); })); } /** * 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, limit, _options) { return this.v2CompaniesFieldsGETWithHttpInfo(cursor, limit, _options).pipe(map((apiResponse) => apiResponse.data)); } /** * 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 */ v2CompaniesGETWithHttpInfo(cursor, limit, ids, fieldIds, fieldTypes, _options) { const _config = mergeConfiguration(this.configuration, _options); const requestContextPromise = this.requestFactory.v2CompaniesGET(cursor, limit, ids, fieldIds, fieldTypes, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx))); } return middlewarePreObservable.pipe(mergeMap((ctx) => _config.httpApi.send(ctx))). pipe(mergeMap((response) => { let middlewarePostObservable = of(response); for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp))); } return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2CompaniesGETWithHttpInfo(rsp))); })); } /** * 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, limit, ids, fieldIds, fieldTypes, _options) { return this.v2CompaniesGETWithHttpInfo(cursor, limit, ids, fieldIds, fieldTypes, _options).pipe(map((apiResponse) => apiResponse.data)); } } import { CompanyMergesApiRequestFactory, CompanyMergesApiResponseProcessor } from "../apis/CompanyMergesApi.js"; export class ObservableCompanyMergesApi { constructor(configuration, requestFactory, responseProcessor) { Object.defineProperty(this, "requestFactory", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "responseProcessor", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "configuration", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.configuration = configuration; this.requestFactory = requestFactory || new CompanyMergesApiRequestFactory(configuration); this.responseProcessor = responseProcessor || new CompanyMergesApiResponseProcessor(); } /** * Retrieve paginated company merges for the organization. Returns all company merges initiated by users in your organization, including their current status, the companies involved, and merge details. You can filter company merges using the `filter` query parameter. The filter parameter is a string that you can specify conditions based on the following properties: | Property | Type | Operators | Values | Examples | |----------|------|-----------|--------|----------| | `status` | `enum` | `=` | `in-progress`, `success`, `failed` | `status=failed` | | `taskId` | `string` | `=` | | `taskId=789e0123-e45b-67c8-d901-234567890123` | Company merges are returned in reverse chronological order (most recent first). Requires the \"Manage duplicates\" [permission](#section/Getting-Started/Permissions) and organization admin role. * Get All Company Merges * @param [cursor] Cursor for the next or previous page * @param [limit] Number of items to include in the page * @param [filter] Filter company merges using Affinity Filtering Language */ v2CompanyMergesGETWithHttpInfo(cursor, limit, filter, _options) { const _config = mergeConfiguration(this.configuration, _options); const requestContextPromise = this.requestFactory.v2CompanyMergesGET(cursor, limit, filter, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx))); } return middlewarePreObservable.pipe(mergeMap((ctx) => _config.httpApi.send(ctx))). pipe(mergeMap((response) => { let middlewarePostObservable = of(response); for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp))); } return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2CompanyMergesGETWithHttpInfo(rsp))); })); } /** * Retrieve paginated company merges for the organization. Returns all company merges initiated by users in your organization, including their current status, the companies involved, and merge details. You can filter company merges using the `filter` query parameter. The filter parameter is a string that you can specify conditions based on the following properties: | Property | Type | Operators | Values | Examples | |----------|------|-----------|--------|----------| | `status` | `enum` | `=` | `in-progress`, `success`, `failed` | `status=failed` | | `taskId` | `string` | `=` | | `taskId=789e0123-e45b-67c8-d901-234567890123` | Company merges are returned in reverse chronological order (most recent first). Requires the \"Manage duplicates\" [permission](#section/Getting-Started/Permissions) and organization admin role. * Get All Company Merges * @param [cursor] Cursor for the next or previous page * @param [limit] Number of items to include in the page * @param [filter] Filter company merges using Affinity Filtering Language */ v2CompanyMergesGET(cursor, limit, filter, _options) { return this.v2CompanyMergesGETWithHttpInfo(cursor, limit, filter, _options).pipe(map((apiResponse) => apiResponse.data)); } /** * Retrieve the status and details of a specific company merge. Returns information about the company merge including its current status, the companies involved, timestamps, and any error information if the merge failed. The `mergeId` can be obtained from the response of the [Get All Company Merges](#tag/companyMerges/operation/v2_company-merges__GET) endpoint, or by filtering company merges by task ID using `/v2/company-merges?filter=taskId={taskId}` after initiating a merge. Requires the \"Manage duplicates\" [permission](#section/Getting-Started/Permissions) and organization admin role. * Get Company Merge * @param mergeId Company merge ID */ v2CompanyMergesMergeIdGETWithHttpInfo(mergeId, _options) { const _config = mergeConfiguration(this.configuration, _options); const requestContextPromise = this.requestFactory.v2CompanyMergesMergeIdGET(mergeId, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx))); } return middlewarePreObservable.pipe(mergeMap((ctx) => _config.httpApi.send(ctx))). pipe(mergeMap((response) => { let middlewarePostObservable = of(response); for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp))); } return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2CompanyMergesMergeIdGETWithHttpInfo(rsp))); })); } /** * Retrieve the status and details of a specific company merge. Returns information about the company merge including its current status, the companies involved, timestamps, and any error information if the merge failed. The `mergeId` can be obtained from the response of the [Get All Company Merges](#tag/companyMerges/operation/v2_company-merges__GET) endpoint, or by filtering company merges by task ID using `/v2/company-merges?filter=taskId={taskId}` after initiating a merge. Requires the \"Manage duplicates\" [permission](#section/Getting-Started/Permissions) and organization admin role. * Get Company Merge * @param mergeId Company merge ID */ v2CompanyMergesMergeIdGET(mergeId, _options) { return this.v2CompanyMergesMergeIdGETWithHttpInfo(mergeId, _options).pipe(map((apiResponse) => apiResponse.data)); } /** * Initiate a company merge to combine a duplicate company profile into a primary company profile. This is an asynchronous process that will merge all data from the duplicate company into the primary company. Once the merge is initiated, you can track its progress using the returned [task URL](#tag/companyMerges/operation/v2_tasks_company-merges_taskId__GET). Requires the \"Manage duplicates\" [permission](#section/Getting-Started/Permissions) and organization admin role. * Initiate Company Merge * @param companyMergeRequest */ v2CompanyMergesPOSTWithHttpInfo(companyMergeRequest, _options) { const _config = mergeConfiguration(this.configuration, _options); const requestContextPromise = this.requestFactory.v2CompanyMergesPOST(companyMergeRequest, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx))); } return middlewarePreObservable.pipe(mergeMap((ctx) => _config.httpApi.send(ctx))). pipe(mergeMap((response) => { let middlewarePostObservable = of(response); for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp))); } return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2CompanyMergesPOSTWithHttpInfo(rsp))); })); } /** * Initiate a company merge to combine a duplicate company profile into a primary company profile. This is an asynchronous process that will merge all data from the duplicate company into the primary company. Once the merge is initiated, you can track its progress using the returned [task URL](#tag/companyMerges/operation/v2_tasks_company-merges_taskId__GET). Requires the \"Manage duplicates\" [permission](#section/Getting-Started/Permissions) and organization admin role. * Initiate Company Merge * @param companyMergeRequest */ v2CompanyMergesPOST(companyMergeRequest, _options) { return this.v2CompanyMergesPOSTWithHttpInfo(companyMergeRequest, _options).pipe(map((apiResponse) => apiResponse.data)); } /** * Retrieve paginated company merge tasks for the organization. Returns all merge tasks initiated by users in your organization, including their current status, the companies involved, and task details. You can filter tasks using the `filter` query parameter. The filter parameter is a string that you can specify conditions based on the following properties: | Property | Type | Operators | Values | Examples | |----------|------|-----------|--------|----------| | `status` | `enum` | `=` | `in-progress`, `success`, `failed` | `status=failed` | Tasks are returned in reverse chronological order (most recent first). Requires the \"Manage duplicates\" [permission](#section/Getting-Started/Permissions) and organization admin role. * Get All Company Merge Tasks * @param [cursor] Cursor for the next or previous page * @param [limit] Number of items to include in the page * @param [filter] Filter tasks using Affinity Filtering Language */ v2TasksCompanyMergesGETWithHttpInfo(cursor, limit, filter, _options) { const _config = mergeConfiguration(this.configuration, _options); const requestContextPromise = this.requestFactory.v2TasksCompanyMergesGET(cursor, limit, filter, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx))); } return middlewarePreObservable.pipe(mergeMap((ctx) => _config.httpApi.send(ctx))). pipe(mergeMap((response) => { let middlewarePostObservable = of(response); for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp))); } return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2TasksCompanyMergesGETWithHttpInfo(rsp))); })); } /** * Retrieve paginated company merge tasks for the organization. Returns all merge tasks initiated by users in your organization, including their current status, the companies involved, and task details. You can filter tasks using the `filter` query parameter. The filter parameter is a string that you can specify conditions based on the following properties: | Property | Type | Operators | Values | Examples | |----------|------|-----------|--------|----------| | `status` | `enum` | `=` | `in-progress`, `success`, `failed` | `status=failed` | Tasks are returned in reverse chronological order (most recent first). Requires the \"Manage duplicates\" [permission](#section/Getting-Started/Permissions) and organization admin role. * Get All Company Merge Tasks * @param [cursor] Cursor for the next or previous page * @param [limit] Number of items to include in the page * @param [filter] Filter tasks using Affinity Filtering Language */ v2TasksCompanyMergesGET(cursor, limit, filter, _options) { return this.v2TasksCompanyMergesGETWithHttpInfo(cursor, limit, filter, _options).pipe(map((apiResponse) => apiResponse.data)); } /** * Retrieve the status and details of a specific task for company merges. Returns information about the company merges for a specific task including its overall status, number of merges in-progress, completed, and failed. Detailed information about individual merges for this task can be found by querying: `/v2/company-merges?filter=taskId={taskId}` See [Company Merges](#tag/companyMerges/operation/v2_company-merges__GET) for more details. Task statuses: - `in-progress`: The merge task is currently being processed. - `success`: The merge task completed successfully. - `failed`: The merge task failed. Requires the \"Manage duplicates\" [permission](#section/Getting-Started/Permissions) and organization admin role. * Get Company Merge Task * @param taskId Company merge task ID */ v2TasksCompanyMergesTaskIdGETWithHttpInfo(taskId, _options) { const _config = mergeConfiguration(this.configuration, _options); const requestContextPromise = this.requestFactory.v2TasksCompanyMergesTaskIdGET(taskId, _config); // build promise chain let middlewarePreObservable = from(requestContextPromise); for (const middleware of _config.middleware) { middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx))); } return middlewarePreObservable.pipe(mergeMap((ctx) => _config.httpApi.send(ctx))). pipe(mergeMap((response) => { let middlewarePostObservable = of(response); for (const middleware of _config.middleware.reverse()) { middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp))); } return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2TasksCompanyMergesTaskIdGETWithHttpInfo(rsp))); })); } /** * Retrieve the status and details of a specific task for company merges. Returns information about the company merges for a specific task including its overall status, number of merges in-progress, completed, and failed. Detailed information about individual merges for this task can be found by querying: `/v2/company-merges?filter=taskId={taskId}` See [Company Merges](#tag/companyMerges/operation/v2_company-merges__GET) for more details. Task statuses: - `in-progress`: The merge task is currently being processed. - `success`: The merge task completed successfully. - `failed`: The merge task failed. Requires the \"Manage duplicates\" [permission](#section/Getting-Started/Permissions) and organization admin role. * Get Company Merge Task * @param taskId Company merge task ID */ v2TasksCompanyMergesTaskIdGET(taskId, _options) { return this.v2TasksCompanyMergesTaskIdGETWithHttpInfo(taskId, _options).pipe(map((apiResponse) => apiResponse.data)); } } import { EmailsApiRequestFactory, EmailsApiResponseProcessor } from "../apis/EmailsApi.js"; export class ObservableEmailsApi { constructor(configuration, requestFactory, responseProcessor) { Object.defineProperty(this, "requestFactory", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "responseProcessor", { enumerable: true, configurable: true, writable: true, value: void 0 }); Object.defineProperty(this, "configuration", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.configuration = configuration; this.requestFactory = requestFactory || new EmailsApiRequestFactory(configuration); this.responseProcessor = responseProcessor || new EmailsApiResponseProcessor(); } /** * Paginate through all emails in Affinity. Returns basic information about the email interaction and its participants. Will only return emails or subject lines that the current authenticated user has permission to see. You can filter emails 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**