@planet-a/affinity-node
Advanced tools
Comparing version 0.0.1-test.12 to 0.0.1-test.13
@@ -0,1 +1,2 @@ | ||
// TODO(@joscha): this is a mess, simplify types here whilst preserving the required paged request/response types | ||
export const createSearchIteratorFn = (searchFn, key) => { | ||
@@ -7,5 +8,3 @@ async function* searchIterator(params) { | ||
// TODO(@joscha): remove cast | ||
(page_token | ||
? { ...params, page_token } | ||
: params)); | ||
(page_token ? { ...params, page_token } : params)); | ||
// TODO(@joscha): remove cast | ||
@@ -12,0 +11,0 @@ yield response[key]; |
{ | ||
"name": "@planet-a/affinity-node", | ||
"version": "0.0.1-test.12", | ||
"version": "0.0.1-test.13", | ||
"description": "API wrapper for the affinity.co API", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
import type { PagedResponse } from './paged_response.js'; | ||
import type { PagedRequest } from './paged_request.js'; | ||
export declare const createSearchIteratorFn: <FN extends (r: PAGED_REQUEST) => Promise<PAGED_RESPONSE>, PAGED_REQUEST extends PagedRequest, PAGED_RESPONSE extends PagedResponse & Record<PAYLOAD_KEY, SINGLE_RESPONSE[]>, PAYLOAD_KEY extends string = Exclude<keyof PAGED_RESPONSE, "next_page_token"> & string, SINGLE_RESPONSE = object>(searchFn: FN, key: PAYLOAD_KEY) => (params: Omit<PAGED_REQUEST, "page_token">) => AsyncGenerator<PAGED_RESPONSE[], any, unknown>; | ||
export declare const createSearchIteratorFn: <FN extends (r: PAGED_REQUEST) => Promise<PAGED_RESPONSE>, PAGED_REQUEST extends PagedRequest, PAGED_RESPONSE extends PagedResponse & Record<PAYLOAD_KEY, SINGLE_RESPONSE[]>, PAYLOAD_KEY extends string = Exclude<keyof PAGED_RESPONSE, "next_page_token"> & string, SINGLE_RESPONSE = object>(searchFn: FN, key: PAYLOAD_KEY) => (params: Omit<Parameters<FN>[0], keyof PagedRequest> & Omit<PAGED_REQUEST, "page_token">) => AsyncGenerator<(ReturnType<FN> extends Promise<infer T> ? T : never) extends { [key in PAYLOAD_KEY]: infer T_1; } ? T_1 : never, any, unknown>; |
@@ -88,3 +88,3 @@ /// <reference types="node" /> | ||
*/ | ||
pagedIterator: (params: Omit<PagedRequest, "page_token">) => AsyncGenerator<(PagedResponse & Record<"entity_files", object[]>)[], any, unknown>; | ||
pagedIterator: (params: Omit<AllEntityFileRequest | undefined, keyof PagedRequest> & Omit<PagedRequest, "page_token">) => AsyncGenerator<EntityFile[], any, unknown>; | ||
/** | ||
@@ -91,0 +91,0 @@ * Fetches an entity with a specified `entity_file_id`. |
@@ -271,3 +271,3 @@ import type { AxiosInstance } from 'axios'; | ||
*/ | ||
searchIterator: (params: Omit<PagedRequest, "page_token">) => AsyncGenerator<(PagedResponse & Record<"organizations", object[]>)[], any, unknown>; | ||
searchIterator: (params: Omit<SearchOrganizationsRequest, keyof PagedRequest> & Omit<PagedRequest, "page_token">) => AsyncGenerator<OrganizationResponse[], any, unknown>; | ||
/** | ||
@@ -274,0 +274,0 @@ * Creates a new organization with the supplied parameters. |
@@ -197,3 +197,3 @@ import type { AxiosInstance } from 'axios'; | ||
*/ | ||
searchIterator: (params: Omit<PagedRequest, "page_token">) => AsyncGenerator<(PagedResponse & Record<"persons", object[]>)[], any, unknown>; | ||
searchIterator: (params: Omit<SearchPersonsRequest, keyof PagedRequest> & Omit<PagedRequest, "page_token">) => AsyncGenerator<PersonResponse[], any, unknown>; | ||
/** | ||
@@ -200,0 +200,0 @@ * Creates a new person with the supplied parameters. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
245316