@planet-a/affinity-node
Version:
API wrapper for the affinity.co API
868 lines • 98.1 kB
JavaScript
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 metadata about the current user.
* Get current user
*/
getV2AuthWhoamiWithHttpInfo(_options) {
let _config = this.configuration;
let allMiddleware = [];
if (_options && _options.middleware) {
const middlewareMergeStrategy = _options.middlewareMergeStrategy || 'replace'; // default to replace behavior
// call-time middleware provided
const calltimeMiddleware = _options.middleware;
switch (middlewareMergeStrategy) {
case 'append':
allMiddleware = this.configuration.middleware.concat(calltimeMiddleware);
break;
case 'prepend':
allMiddleware = calltimeMiddleware.concat(this.configuration.middleware);
break;
case 'replace':
allMiddleware = calltimeMiddleware;
break;
default:
throw new Error(`unrecognized middleware merge strategy '${middlewareMergeStrategy}'`);
}
}
if (_options) {
_config = {
baseServer: _options.baseServer || this.configuration.baseServer,
httpApi: _options.httpApi || this.configuration.httpApi,
authMethods: _options.authMethods || this.configuration.authMethods,
middleware: allMiddleware || this.configuration.middleware
};
}
const requestContextPromise = this.requestFactory.getV2AuthWhoami(_config);
// build promise chain
let middlewarePreObservable = from(requestContextPromise);
for (const middleware of allMiddleware) {
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx)));
}
return middlewarePreObservable.pipe(mergeMap((ctx) => this.configuration.httpApi.send(ctx))).
pipe(mergeMap((response) => {
let middlewarePostObservable = of(response);
for (const middleware of allMiddleware.reverse()) {
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp)));
}
return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.getV2AuthWhoamiWithHttpInfo(rsp)));
}));
}
/**
* Returns metadata about the current user.
* Get current user
*/
getV2AuthWhoami(_options) {
return this.getV2AuthWhoamiWithHttpInfo(_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();
}
/**
* 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
*/
getV2CompaniesWithHttpInfo(cursor, limit, ids, fieldIds, fieldTypes, _options) {
let _config = this.configuration;
let allMiddleware = [];
if (_options && _options.middleware) {
const middlewareMergeStrategy = _options.middlewareMergeStrategy || 'replace'; // default to replace behavior
// call-time middleware provided
const calltimeMiddleware = _options.middleware;
switch (middlewareMergeStrategy) {
case 'append':
allMiddleware = this.configuration.middleware.concat(calltimeMiddleware);
break;
case 'prepend':
allMiddleware = calltimeMiddleware.concat(this.configuration.middleware);
break;
case 'replace':
allMiddleware = calltimeMiddleware;
break;
default:
throw new Error(`unrecognized middleware merge strategy '${middlewareMergeStrategy}'`);
}
}
if (_options) {
_config = {
baseServer: _options.baseServer || this.configuration.baseServer,
httpApi: _options.httpApi || this.configuration.httpApi,
authMethods: _options.authMethods || this.configuration.authMethods,
middleware: allMiddleware || this.configuration.middleware
};
}
const requestContextPromise = this.requestFactory.getV2Companies(cursor, limit, ids, fieldIds, fieldTypes, _config);
// build promise chain
let middlewarePreObservable = from(requestContextPromise);
for (const middleware of allMiddleware) {
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx)));
}
return middlewarePreObservable.pipe(mergeMap((ctx) => this.configuration.httpApi.send(ctx))).
pipe(mergeMap((response) => {
let middlewarePostObservable = of(response);
for (const middleware of allMiddleware.reverse()) {
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp)));
}
return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.getV2CompaniesWithHttpInfo(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
*/
getV2Companies(cursor, limit, ids, fieldIds, fieldTypes, _options) {
return this.getV2CompaniesWithHttpInfo(cursor, limit, ids, fieldIds, fieldTypes, _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
*/
getV2CompaniesFieldsWithHttpInfo(cursor, limit, _options) {
let _config = this.configuration;
let allMiddleware = [];
if (_options && _options.middleware) {
const middlewareMergeStrategy = _options.middlewareMergeStrategy || 'replace'; // default to replace behavior
// call-time middleware provided
const calltimeMiddleware = _options.middleware;
switch (middlewareMergeStrategy) {
case 'append':
allMiddleware = this.configuration.middleware.concat(calltimeMiddleware);
break;
case 'prepend':
allMiddleware = calltimeMiddleware.concat(this.configuration.middleware);
break;
case 'replace':
allMiddleware = calltimeMiddleware;
break;
default:
throw new Error(`unrecognized middleware merge strategy '${middlewareMergeStrategy}'`);
}
}
if (_options) {
_config = {
baseServer: _options.baseServer || this.configuration.baseServer,
httpApi: _options.httpApi || this.configuration.httpApi,
authMethods: _options.authMethods || this.configuration.authMethods,
middleware: allMiddleware || this.configuration.middleware
};
}
const requestContextPromise = this.requestFactory.getV2CompaniesFields(cursor, limit, _config);
// build promise chain
let middlewarePreObservable = from(requestContextPromise);
for (const middleware of allMiddleware) {
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx)));
}
return middlewarePreObservable.pipe(mergeMap((ctx) => this.configuration.httpApi.send(ctx))).
pipe(mergeMap((response) => {
let middlewarePostObservable = of(response);
for (const middleware of allMiddleware.reverse()) {
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp)));
}
return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.getV2CompaniesFieldsWithHttpInfo(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
*/
getV2CompaniesFields(cursor, limit, _options) {
return this.getV2CompaniesFieldsWithHttpInfo(cursor, limit, _options).pipe(map((apiResponse) => apiResponse.data));
}
/**
* 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 id Company ID
* @param [fieldIds] Field IDs for which to return field data
* @param [fieldTypes] Field Types for which to return field data
*/
getV2CompaniesIdWithHttpInfo(id, fieldIds, fieldTypes, _options) {
let _config = this.configuration;
let allMiddleware = [];
if (_options && _options.middleware) {
const middlewareMergeStrategy = _options.middlewareMergeStrategy || 'replace'; // default to replace behavior
// call-time middleware provided
const calltimeMiddleware = _options.middleware;
switch (middlewareMergeStrategy) {
case 'append':
allMiddleware = this.configuration.middleware.concat(calltimeMiddleware);
break;
case 'prepend':
allMiddleware = calltimeMiddleware.concat(this.configuration.middleware);
break;
case 'replace':
allMiddleware = calltimeMiddleware;
break;
default:
throw new Error(`unrecognized middleware merge strategy '${middlewareMergeStrategy}'`);
}
}
if (_options) {
_config = {
baseServer: _options.baseServer || this.configuration.baseServer,
httpApi: _options.httpApi || this.configuration.httpApi,
authMethods: _options.authMethods || this.configuration.authMethods,
middleware: allMiddleware || this.configuration.middleware
};
}
const requestContextPromise = this.requestFactory.getV2CompaniesId(id, fieldIds, fieldTypes, _config);
// build promise chain
let middlewarePreObservable = from(requestContextPromise);
for (const middleware of allMiddleware) {
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx)));
}
return middlewarePreObservable.pipe(mergeMap((ctx) => this.configuration.httpApi.send(ctx))).
pipe(mergeMap((response) => {
let middlewarePostObservable = of(response);
for (const middleware of allMiddleware.reverse()) {
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp)));
}
return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.getV2CompaniesIdWithHttpInfo(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 id Company ID
* @param [fieldIds] Field IDs for which to return field data
* @param [fieldTypes] Field Types for which to return field data
*/
getV2CompaniesId(id, fieldIds, fieldTypes, _options) {
return this.getV2CompaniesIdWithHttpInfo(id, 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 id Company ID
* @param [cursor] Cursor for the next or previous page
* @param [limit] Number of items to include in the page
*/
getV2CompaniesIdListEntriesWithHttpInfo(id, cursor, limit, _options) {
let _config = this.configuration;
let allMiddleware = [];
if (_options && _options.middleware) {
const middlewareMergeStrategy = _options.middlewareMergeStrategy || 'replace'; // default to replace behavior
// call-time middleware provided
const calltimeMiddleware = _options.middleware;
switch (middlewareMergeStrategy) {
case 'append':
allMiddleware = this.configuration.middleware.concat(calltimeMiddleware);
break;
case 'prepend':
allMiddleware = calltimeMiddleware.concat(this.configuration.middleware);
break;
case 'replace':
allMiddleware = calltimeMiddleware;
break;
default:
throw new Error(`unrecognized middleware merge strategy '${middlewareMergeStrategy}'`);
}
}
if (_options) {
_config = {
baseServer: _options.baseServer || this.configuration.baseServer,
httpApi: _options.httpApi || this.configuration.httpApi,
authMethods: _options.authMethods || this.configuration.authMethods,
middleware: allMiddleware || this.configuration.middleware
};
}
const requestContextPromise = this.requestFactory.getV2CompaniesIdListEntries(id, cursor, limit, _config);
// build promise chain
let middlewarePreObservable = from(requestContextPromise);
for (const middleware of allMiddleware) {
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx)));
}
return middlewarePreObservable.pipe(mergeMap((ctx) => this.configuration.httpApi.send(ctx))).
pipe(mergeMap((response) => {
let middlewarePostObservable = of(response);
for (const middleware of allMiddleware.reverse()) {
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp)));
}
return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.getV2CompaniesIdListEntriesWithHttpInfo(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 id Company ID
* @param [cursor] Cursor for the next or previous page
* @param [limit] Number of items to include in the page
*/
getV2CompaniesIdListEntries(id, cursor, limit, _options) {
return this.getV2CompaniesIdListEntriesWithHttpInfo(id, cursor, limit, _options).pipe(map((apiResponse) => apiResponse.data));
}
/**
* Returns metadata for all the Lists on which the given Company appears.
* Get a Company\'s Lists
* @param id Company ID
* @param [cursor] Cursor for the next or previous page
* @param [limit] Number of items to include in the page
*/
getV2CompaniesIdListsWithHttpInfo(id, cursor, limit, _options) {
let _config = this.configuration;
let allMiddleware = [];
if (_options && _options.middleware) {
const middlewareMergeStrategy = _options.middlewareMergeStrategy || 'replace'; // default to replace behavior
// call-time middleware provided
const calltimeMiddleware = _options.middleware;
switch (middlewareMergeStrategy) {
case 'append':
allMiddleware = this.configuration.middleware.concat(calltimeMiddleware);
break;
case 'prepend':
allMiddleware = calltimeMiddleware.concat(this.configuration.middleware);
break;
case 'replace':
allMiddleware = calltimeMiddleware;
break;
default:
throw new Error(`unrecognized middleware merge strategy '${middlewareMergeStrategy}'`);
}
}
if (_options) {
_config = {
baseServer: _options.baseServer || this.configuration.baseServer,
httpApi: _options.httpApi || this.configuration.httpApi,
authMethods: _options.authMethods || this.configuration.authMethods,
middleware: allMiddleware || this.configuration.middleware
};
}
const requestContextPromise = this.requestFactory.getV2CompaniesIdLists(id, cursor, limit, _config);
// build promise chain
let middlewarePreObservable = from(requestContextPromise);
for (const middleware of allMiddleware) {
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx)));
}
return middlewarePreObservable.pipe(mergeMap((ctx) => this.configuration.httpApi.send(ctx))).
pipe(mergeMap((response) => {
let middlewarePostObservable = of(response);
for (const middleware of allMiddleware.reverse()) {
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp)));
}
return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.getV2CompaniesIdListsWithHttpInfo(rsp)));
}));
}
/**
* Returns metadata for all the Lists on which the given Company appears.
* Get a Company\'s Lists
* @param id Company ID
* @param [cursor] Cursor for the next or previous page
* @param [limit] Number of items to include in the page
*/
getV2CompaniesIdLists(id, cursor, limit, _options) {
return this.getV2CompaniesIdListsWithHttpInfo(id, cursor, limit, _options).pipe(map((apiResponse) => apiResponse.data));
}
}
import { ListsApiRequestFactory, ListsApiResponseProcessor } from "../apis/ListsApi.js";
export class ObservableListsApi {
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 ListsApiRequestFactory(configuration);
this.responseProcessor = responseProcessor || new ListsApiResponseProcessor();
}
/**
* Returns metadata on the Saved Views on a List.
* Get metadata on Saved Views
* @param listId List ID
* @param [cursor] Cursor for the next or previous page
* @param [limit] Number of items to include in the page
*/
getV2ListsListidSavedViewsWithHttpInfo(listId, cursor, limit, _options) {
let _config = this.configuration;
let allMiddleware = [];
if (_options && _options.middleware) {
const middlewareMergeStrategy = _options.middlewareMergeStrategy || 'replace'; // default to replace behavior
// call-time middleware provided
const calltimeMiddleware = _options.middleware;
switch (middlewareMergeStrategy) {
case 'append':
allMiddleware = this.configuration.middleware.concat(calltimeMiddleware);
break;
case 'prepend':
allMiddleware = calltimeMiddleware.concat(this.configuration.middleware);
break;
case 'replace':
allMiddleware = calltimeMiddleware;
break;
default:
throw new Error(`unrecognized middleware merge strategy '${middlewareMergeStrategy}'`);
}
}
if (_options) {
_config = {
baseServer: _options.baseServer || this.configuration.baseServer,
httpApi: _options.httpApi || this.configuration.httpApi,
authMethods: _options.authMethods || this.configuration.authMethods,
middleware: allMiddleware || this.configuration.middleware
};
}
const requestContextPromise = this.requestFactory.getV2ListsListidSavedViews(listId, cursor, limit, _config);
// build promise chain
let middlewarePreObservable = from(requestContextPromise);
for (const middleware of allMiddleware) {
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx)));
}
return middlewarePreObservable.pipe(mergeMap((ctx) => this.configuration.httpApi.send(ctx))).
pipe(mergeMap((response) => {
let middlewarePostObservable = of(response);
for (const middleware of allMiddleware.reverse()) {
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp)));
}
return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.getV2ListsListidSavedViewsWithHttpInfo(rsp)));
}));
}
/**
* Returns metadata on the Saved Views on a List.
* Get metadata on Saved Views
* @param listId List ID
* @param [cursor] Cursor for the next or previous page
* @param [limit] Number of items to include in the page
*/
getV2ListsListidSavedViews(listId, cursor, limit, _options) {
return this.getV2ListsListidSavedViewsWithHttpInfo(listId, cursor, limit, _options).pipe(map((apiResponse) => apiResponse.data));
}
/**
* Returns metadata on a single Saved View.
* Get metadata on a single Saved View
* @param listId List ID
* @param viewId Saved view ID
*/
getV2ListsListidSavedViewsViewidWithHttpInfo(listId, viewId, _options) {
let _config = this.configuration;
let allMiddleware = [];
if (_options && _options.middleware) {
const middlewareMergeStrategy = _options.middlewareMergeStrategy || 'replace'; // default to replace behavior
// call-time middleware provided
const calltimeMiddleware = _options.middleware;
switch (middlewareMergeStrategy) {
case 'append':
allMiddleware = this.configuration.middleware.concat(calltimeMiddleware);
break;
case 'prepend':
allMiddleware = calltimeMiddleware.concat(this.configuration.middleware);
break;
case 'replace':
allMiddleware = calltimeMiddleware;
break;
default:
throw new Error(`unrecognized middleware merge strategy '${middlewareMergeStrategy}'`);
}
}
if (_options) {
_config = {
baseServer: _options.baseServer || this.configuration.baseServer,
httpApi: _options.httpApi || this.configuration.httpApi,
authMethods: _options.authMethods || this.configuration.authMethods,
middleware: allMiddleware || this.configuration.middleware
};
}
const requestContextPromise = this.requestFactory.getV2ListsListidSavedViewsViewid(listId, viewId, _config);
// build promise chain
let middlewarePreObservable = from(requestContextPromise);
for (const middleware of allMiddleware) {
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx)));
}
return middlewarePreObservable.pipe(mergeMap((ctx) => this.configuration.httpApi.send(ctx))).
pipe(mergeMap((response) => {
let middlewarePostObservable = of(response);
for (const middleware of allMiddleware.reverse()) {
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp)));
}
return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.getV2ListsListidSavedViewsViewidWithHttpInfo(rsp)));
}));
}
/**
* Returns metadata on a single Saved View.
* Get metadata on a single Saved View
* @param listId List ID
* @param viewId Saved view ID
*/
getV2ListsListidSavedViewsViewid(listId, viewId, _options) {
return this.getV2ListsListidSavedViewsViewidWithHttpInfo(listId, viewId, _options).pipe(map((apiResponse) => apiResponse.data));
}
/**
* Paginate through the List Entries (AKA rows) on a given Saved View. Use this endpoint when you need to filter entities or only want **some** field data to be returned: This endpoint respects the filters set on a Saved View via web app, and only returns field data corresponding to the columns that have been pulled into the Saved View via web app. Though this endpoint respects the Saved View\'s filters and column/Field selection, it does not yet preserve sort order. This endpoint also only supports **sheet-type Saved Views**, and not board- or dashboard-type Saved Views. See the [Data Model](#section/Data-Model) section for more information about Saved Views. Requires the \"Export data from Lists\" [permission](#section/Getting-Started/Permissions).
* Get all List Entries on a Saved View
* @param listId List ID
* @param viewId Saved view ID
* @param [cursor] Cursor for the next or previous page
* @param [limit] Number of items to include in the page
*/
getV2ListsListidSavedViewsViewidListEntriesWithHttpInfo(listId, viewId, cursor, limit, _options) {
let _config = this.configuration;
let allMiddleware = [];
if (_options && _options.middleware) {
const middlewareMergeStrategy = _options.middlewareMergeStrategy || 'replace'; // default to replace behavior
// call-time middleware provided
const calltimeMiddleware = _options.middleware;
switch (middlewareMergeStrategy) {
case 'append':
allMiddleware = this.configuration.middleware.concat(calltimeMiddleware);
break;
case 'prepend':
allMiddleware = calltimeMiddleware.concat(this.configuration.middleware);
break;
case 'replace':
allMiddleware = calltimeMiddleware;
break;
default:
throw new Error(`unrecognized middleware merge strategy '${middlewareMergeStrategy}'`);
}
}
if (_options) {
_config = {
baseServer: _options.baseServer || this.configuration.baseServer,
httpApi: _options.httpApi || this.configuration.httpApi,
authMethods: _options.authMethods || this.configuration.authMethods,
middleware: allMiddleware || this.configuration.middleware
};
}
const requestContextPromise = this.requestFactory.getV2ListsListidSavedViewsViewidListEntries(listId, viewId, cursor, limit, _config);
// build promise chain
let middlewarePreObservable = from(requestContextPromise);
for (const middleware of allMiddleware) {
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx)));
}
return middlewarePreObservable.pipe(mergeMap((ctx) => this.configuration.httpApi.send(ctx))).
pipe(mergeMap((response) => {
let middlewarePostObservable = of(response);
for (const middleware of allMiddleware.reverse()) {
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp)));
}
return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.getV2ListsListidSavedViewsViewidListEntriesWithHttpInfo(rsp)));
}));
}
/**
* Paginate through the List Entries (AKA rows) on a given Saved View. Use this endpoint when you need to filter entities or only want **some** field data to be returned: This endpoint respects the filters set on a Saved View via web app, and only returns field data corresponding to the columns that have been pulled into the Saved View via web app. Though this endpoint respects the Saved View\'s filters and column/Field selection, it does not yet preserve sort order. This endpoint also only supports **sheet-type Saved Views**, and not board- or dashboard-type Saved Views. See the [Data Model](#section/Data-Model) section for more information about Saved Views. Requires the \"Export data from Lists\" [permission](#section/Getting-Started/Permissions).
* Get all List Entries on a Saved View
* @param listId List ID
* @param viewId Saved view ID
* @param [cursor] Cursor for the next or previous page
* @param [limit] Number of items to include in the page
*/
getV2ListsListidSavedViewsViewidListEntries(listId, viewId, cursor, limit, _options) {
return this.getV2ListsListidSavedViewsViewidListEntriesWithHttpInfo(listId, viewId, cursor, limit, _options).pipe(map((apiResponse) => apiResponse.data));
}
/**
* Returns metadata on Lists.
* Get metadata on all Lists
* @param [cursor] Cursor for the next or previous page
* @param [limit] Number of items to include in the page
*/
v2ListsGETWithHttpInfo(cursor, limit, _options) {
let _config = this.configuration;
let allMiddleware = [];
if (_options && _options.middleware) {
const middlewareMergeStrategy = _options.middlewareMergeStrategy || 'replace'; // default to replace behavior
// call-time middleware provided
const calltimeMiddleware = _options.middleware;
switch (middlewareMergeStrategy) {
case 'append':
allMiddleware = this.configuration.middleware.concat(calltimeMiddleware);
break;
case 'prepend':
allMiddleware = calltimeMiddleware.concat(this.configuration.middleware);
break;
case 'replace':
allMiddleware = calltimeMiddleware;
break;
default:
throw new Error(`unrecognized middleware merge strategy '${middlewareMergeStrategy}'`);
}
}
if (_options) {
_config = {
baseServer: _options.baseServer || this.configuration.baseServer,
httpApi: _options.httpApi || this.configuration.httpApi,
authMethods: _options.authMethods || this.configuration.authMethods,
middleware: allMiddleware || this.configuration.middleware
};
}
const requestContextPromise = this.requestFactory.v2ListsGET(cursor, limit, _config);
// build promise chain
let middlewarePreObservable = from(requestContextPromise);
for (const middleware of allMiddleware) {
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx)));
}
return middlewarePreObservable.pipe(mergeMap((ctx) => this.configuration.httpApi.send(ctx))).
pipe(mergeMap((response) => {
let middlewarePostObservable = of(response);
for (const middleware of allMiddleware.reverse()) {
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp)));
}
return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2ListsGETWithHttpInfo(rsp)));
}));
}
/**
* Returns metadata on Lists.
* Get metadata on all Lists
* @param [cursor] Cursor for the next or previous page
* @param [limit] Number of items to include in the page
*/
v2ListsGET(cursor, limit, _options) {
return this.v2ListsGETWithHttpInfo(cursor, limit, _options).pipe(map((apiResponse) => apiResponse.data));
}
/**
* Returns metadata on the Fields available on a single List. Use the returned Field IDs to request field data from the GET `/v2/lists/{listId}/list-entries` endpoint.
* Get metadata on a single List\'s Fields
* @param listId List ID
* @param [cursor] Cursor for the next or previous page
* @param [limit] Number of items to include in the page
*/
v2ListsListIdFieldsGETWithHttpInfo(listId, cursor, limit, _options) {
let _config = this.configuration;
let allMiddleware = [];
if (_options && _options.middleware) {
const middlewareMergeStrategy = _options.middlewareMergeStrategy || 'replace'; // default to replace behavior
// call-time middleware provided
const calltimeMiddleware = _options.middleware;
switch (middlewareMergeStrategy) {
case 'append':
allMiddleware = this.configuration.middleware.concat(calltimeMiddleware);
break;
case 'prepend':
allMiddleware = calltimeMiddleware.concat(this.configuration.middleware);
break;
case 'replace':
allMiddleware = calltimeMiddleware;
break;
default:
throw new Error(`unrecognized middleware merge strategy '${middlewareMergeStrategy}'`);
}
}
if (_options) {
_config = {
baseServer: _options.baseServer || this.configuration.baseServer,
httpApi: _options.httpApi || this.configuration.httpApi,
authMethods: _options.authMethods || this.configuration.authMethods,
middleware: allMiddleware || this.configuration.middleware
};
}
const requestContextPromise = this.requestFactory.v2ListsListIdFieldsGET(listId, cursor, limit, _config);
// build promise chain
let middlewarePreObservable = from(requestContextPromise);
for (const middleware of allMiddleware) {
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx)));
}
return middlewarePreObservable.pipe(mergeMap((ctx) => this.configuration.httpApi.send(ctx))).
pipe(mergeMap((response) => {
let middlewarePostObservable = of(response);
for (const middleware of allMiddleware.reverse()) {
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp)));
}
return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2ListsListIdFieldsGETWithHttpInfo(rsp)));
}));
}
/**
* Returns metadata on the Fields available on a single List. Use the returned Field IDs to request field data from the GET `/v2/lists/{listId}/list-entries` endpoint.
* Get metadata on a single List\'s Fields
* @param listId List ID
* @param [cursor] Cursor for the next or previous page
* @param [limit] Number of items to include in the page
*/
v2ListsListIdFieldsGET(listId, cursor, limit, _options) {
return this.v2ListsListIdFieldsGETWithHttpInfo(listId, cursor, limit, _options).pipe(map((apiResponse) => apiResponse.data));
}
/**
* Returns metadata on a single List.
* Get metadata on a single List
* @param listId List ID
*/
v2ListsListIdGETWithHttpInfo(listId, _options) {
let _config = this.configuration;
let allMiddleware = [];
if (_options && _options.middleware) {
const middlewareMergeStrategy = _options.middlewareMergeStrategy || 'replace'; // default to replace behavior
// call-time middleware provided
const calltimeMiddleware = _options.middleware;
switch (middlewareMergeStrategy) {
case 'append':
allMiddleware = this.configuration.middleware.concat(calltimeMiddleware);
break;
case 'prepend':
allMiddleware = calltimeMiddleware.concat(this.configuration.middleware);
break;
case 'replace':
allMiddleware = calltimeMiddleware;
break;
default:
throw new Error(`unrecognized middleware merge strategy '${middlewareMergeStrategy}'`);
}
}
if (_options) {
_config = {
baseServer: _options.baseServer || this.configuration.baseServer,
httpApi: _options.httpApi || this.configuration.httpApi,
authMethods: _options.authMethods || this.configuration.authMethods,
middleware: allMiddleware || this.configuration.middleware
};
}
const requestContextPromise = this.requestFactory.v2ListsListIdGET(listId, _config);
// build promise chain
let middlewarePreObservable = from(requestContextPromise);
for (const middleware of allMiddleware) {
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx)));
}
return middlewarePreObservable.pipe(mergeMap((ctx) => this.configuration.httpApi.send(ctx))).
pipe(mergeMap((response) => {
let middlewarePostObservable = of(response);
for (const middleware of allMiddleware.reverse()) {
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp)));
}
return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2ListsListIdGETWithHttpInfo(rsp)));
}));
}
/**
* Returns metadata on a single List.
* Get metadata on a single List
* @param listId List ID
*/
v2ListsListIdGET(listId, _options) {
return this.v2ListsListIdGETWithHttpInfo(listId, _options).pipe(map((apiResponse) => apiResponse.data));
}
/**
* Paginate through the List Entries (AKA rows) on a given List. Returns basic information and field data, including list-specific field data, on each Company, Person, or Opportunity on the List. List Entries also include metadata about their creation, i.e., when they were added to the List and by whom. 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/lists/{listId}/fields` endpoint. When no `fieldIds` or `fieldTypes` are provided, List Entries 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 data from Lists\" [permission](#section/Getting-Started/Permissions).
* Get all List Entries on a List
* @param listId List ID
* @param [cursor] Cursor for the next or previous page
* @param [limit] Number of items to include in the page
* @param [fieldIds] Field IDs for which to return field data
* @param [fieldTypes] Field Types for which to return field data
*/
v2ListsListIdListEntriesGETWithHttpInfo(listId, cursor, limit, fieldIds, fieldTypes, _options) {
let _config = this.configuration;
let allMiddleware = [];
if (_options && _options.middleware) {
const middlewareMergeStrategy = _options.middlewareMergeStrategy || 'replace'; // default to replace behavior
// call-time middleware provided
const calltimeMiddleware = _options.middleware;
switch (middlewareMergeStrategy) {
case 'append':
allMiddleware = this.configuration.middleware.concat(calltimeMiddleware);
break;
case 'prepend':
allMiddleware = calltimeMiddleware.concat(this.configuration.middleware);
break;
case 'replace':
allMiddleware = calltimeMiddleware;
break;
default:
throw new Error(`unrecognized middleware merge strategy '${middlewareMergeStrategy}'`);
}
}
if (_options) {
_config = {
baseServer: _options.baseServer || this.configuration.baseServer,
httpApi: _options.httpApi || this.configuration.httpApi,
authMethods: _options.authMethods || this.configuration.authMethods,
middleware: allMiddleware || this.configuration.middleware
};
}
const requestContextPromise = this.requestFactory.v2ListsListIdListEntriesGET(listId, cursor, limit, fieldIds, fieldTypes, _config);
// build promise chain
let middlewarePreObservable = from(requestContextPromise);
for (const middleware of allMiddleware) {
middlewarePreObservable = middlewarePreObservable.pipe(mergeMap((ctx) => middleware.pre(ctx)));
}
return middlewarePreObservable.pipe(mergeMap((ctx) => this.configuration.httpApi.send(ctx))).
pipe(mergeMap((response) => {
let middlewarePostObservable = of(response);
for (const middleware of allMiddleware.reverse()) {
middlewarePostObservable = middlewarePostObservable.pipe(mergeMap((rsp) => middleware.post(rsp)));
}
return middlewarePostObservable.pipe(map((rsp) => this.responseProcessor.v2ListsListIdListEntriesGETWithHttpInfo(rsp)));
}));
}
/**
* Paginate through the List Entries (AKA rows) on a given List. Returns basic information and field data, including list-specific field data, on each Company, Person, or Opportunity on the List. List Entries also include metadata about their creation, i.e., when they were added to the List and by whom. 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/lists/{listId}/fields` endpoint. When no `fieldIds` or `fieldTypes` are provided, List Entries 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 data from Lists\" [permission](#section/Getting-Started/Permissions).
* Get all List Entries on a List
* @param listId List ID
* @param [cursor] Cursor for the next or previous page
* @param [limit] Number of items to include in the page
* @param [fieldIds] Field IDs for which to return field data
* @param [fieldTypes] Field Types for which to return field data
*/
v2ListsListIdListEntriesGET(listId, cursor, limit, fieldIds, fieldTypes, _options) {
return this.v2ListsListIdListEntriesGETWithHttpInfo(listId, cursor, limit, fieldIds, fieldTypes, _options).pipe(map((apiResponse) => apiResponse.data));
}
/**
* | ⚠️ This endpoint is currently in BETA | |--| Returns a single field value on a list entry. Requires the \"Export data from Lists\" [permission](#section/Gett