basecamp-client 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -38,6 +38,7 @@ type AsyncPagedIteratorOptions<TRoute extends RouteExecutor, TStatus extends num
38
38
  * }
39
39
  */
40
40
  declare function asyncPagedIterator<TRoute extends RouteExecutor, TStatus extends number = 200, TItem = DefaultItem<TRoute, TStatus>>(options: AsyncPagedIteratorOptions<TRoute, TStatus, TItem>): AsyncGenerator<TItem, void, unknown>;
41
+ declare function asyncPagedToArray<TRoute extends RouteExecutor, TStatus extends number = 200, TItem = DefaultItem<TRoute, TStatus>>(options: AsyncPagedIteratorOptions<TRoute, TStatus, TItem>): Promise<TItem[]>;
41
42
 
42
43
  type InitClientOptions = {
43
44
  bearerToken: string;
@@ -44751,4 +44752,4 @@ type GetBearerTokenOptions = {
44751
44752
  };
44752
44753
  declare function getBearerToken({ clientId, clientSecret, refreshToken, userAgent, }: GetBearerTokenOptions): Promise<string>;
44753
44754
 
44754
- export { type AsyncPagedIteratorOptions, type Client, type Contract, asyncPagedIterator, buildClient, contract, getBearerToken };
44755
+ export { type AsyncPagedIteratorOptions, type Client, type Contract, asyncPagedIterator, asyncPagedToArray, buildClient, contract, getBearerToken };
package/dist/index.d.ts CHANGED
@@ -38,6 +38,7 @@ type AsyncPagedIteratorOptions<TRoute extends RouteExecutor, TStatus extends num
38
38
  * }
39
39
  */
40
40
  declare function asyncPagedIterator<TRoute extends RouteExecutor, TStatus extends number = 200, TItem = DefaultItem<TRoute, TStatus>>(options: AsyncPagedIteratorOptions<TRoute, TStatus, TItem>): AsyncGenerator<TItem, void, unknown>;
41
+ declare function asyncPagedToArray<TRoute extends RouteExecutor, TStatus extends number = 200, TItem = DefaultItem<TRoute, TStatus>>(options: AsyncPagedIteratorOptions<TRoute, TStatus, TItem>): Promise<TItem[]>;
41
42
 
42
43
  type InitClientOptions = {
43
44
  bearerToken: string;
@@ -44751,4 +44752,4 @@ type GetBearerTokenOptions = {
44751
44752
  };
44752
44753
  declare function getBearerToken({ clientId, clientSecret, refreshToken, userAgent, }: GetBearerTokenOptions): Promise<string>;
44753
44754
 
44754
- export { type AsyncPagedIteratorOptions, type Client, type Contract, asyncPagedIterator, buildClient, contract, getBearerToken };
44755
+ export { type AsyncPagedIteratorOptions, type Client, type Contract, asyncPagedIterator, asyncPagedToArray, buildClient, contract, getBearerToken };
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
23
  asyncPagedIterator: () => asyncPagedIterator,
24
+ asyncPagedToArray: () => asyncPagedToArray,
24
25
  buildClient: () => buildClient,
25
26
  contract: () => contract,
26
27
  getBearerToken: () => getBearerToken
@@ -147,6 +148,13 @@ async function* asyncPagedIterator(options) {
147
148
  currentRequest = withPage(currentRequest, nextPage);
148
149
  }
149
150
  }
151
+ async function asyncPagedToArray(options) {
152
+ const results = [];
153
+ for await (const item of asyncPagedIterator(options)) {
154
+ results.push(item);
155
+ }
156
+ return results;
157
+ }
150
158
 
151
159
  // src/buildClient.ts
152
160
  var import_core3 = require("@ts-rest/core");
@@ -3488,6 +3496,7 @@ async function getBearerToken({
3488
3496
  // Annotate the CommonJS export names for ESM import in node:
3489
3497
  0 && (module.exports = {
3490
3498
  asyncPagedIterator,
3499
+ asyncPagedToArray,
3491
3500
  buildClient,
3492
3501
  contract,
3493
3502
  getBearerToken