Skip to content

Commit 12e5ef8

Browse files
committed
refactor!: remove the unused list options of versions() and envVars()
The Actor version and environment variable list endpoints accept no query parameters, so `ActorVersionCollectionClient.list()` and `ActorEnvVarCollectionClient.list()` now take no arguments. The option types deprecated in v2.21.0 (#800) are gone. BREAKING CHANGE: `ActorVersionCollectionListOptions` and `ActorEnvVarCollectionListOptions` are removed, and both `list()` methods take no arguments. Passing `offset`, `limit` or `desc` never had an effect, so drop the argument. Closes #799
1 parent 5d11119 commit 12e5ef8

4 files changed

Lines changed: 10 additions & 39 deletions

File tree

docs/04_upgrading/upgrading_v3.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,7 @@ Two return types change as a result of describing what the endpoints really retu
166166

167167
- <ApiLink to="class/ScheduleClient#getLog">`ScheduleClient.getLog()`</ApiLink> was typed as a `string`, even though the endpoint returns the log as a list of entries. It's now typed as <ApiLink to="interface/ScheduleInvoked">`ScheduleInvoked[]`</ApiLink>, each entry carrying `message`, `level` and `createdAt`.
168168
- <ApiLink to="interface/TaskPublicConfig">`TaskPublicConfig`</ApiLink> now follows the specification: `publishedAt` is optional and read-only, and `categorization`, which the specification doesn't describe, is gone from the type.
169+
170+
## `versions().list()` and `envVars().list()` take no options
171+
172+
<ApiLink to="class/ActorVersionCollectionClient#list">`ActorVersionCollectionClient.list()`</ApiLink> and <ApiLink to="class/ActorEnvVarCollectionClient#list">`ActorEnvVarCollectionClient.list()`</ApiLink> now take no arguments. The two endpoints behind them have never accepted `offset`, `limit` or `desc`, so passing them had no effect. The `ActorVersionCollectionListOptions` and `ActorEnvVarCollectionListOptions` types that declared those options, deprecated since v2.21.0, are gone from the package. A call that passed an options object no longer compiles. Drop the argument and the call returns the same items as before.

docs/public-api/apify-client.api.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,7 @@ export class ActorEnvVarClient extends ResourceClient {
193193
export class ActorEnvVarCollectionClient extends ResourceCollectionClient {
194194
constructor(options: ApiClientSubResourceOptions);
195195
create(actorEnvVar: ActorEnvironmentVariable): Promise<ActorEnvironmentVariable>;
196-
list(_options?: ActorEnvVarCollectionListOptions): Promise<ActorEnvVarListResult> & AsyncIterable<ActorEnvironmentVariable>;
197-
}
198-
199-
// @public @deprecated (undocumented)
200-
export interface ActorEnvVarCollectionListOptions extends PaginationOptions {
201-
// (undocumented)
202-
desc?: boolean;
196+
list(): Promise<ActorEnvVarListResult> & AsyncIterable<ActorEnvironmentVariable>;
203197
}
204198

205199
// @public
@@ -428,13 +422,7 @@ interface ActorVersionClientNarrowings {
428422
export class ActorVersionCollectionClient extends ResourceCollectionClient {
429423
constructor(options: ApiClientSubResourceOptions);
430424
create(actorVersion: ActorVersion): Promise<FinalActorVersion>;
431-
list(_options?: ActorVersionCollectionListOptions): Promise<ActorVersionListResult> & AsyncIterable<FinalActorVersion>;
432-
}
433-
434-
// @public @deprecated (undocumented)
435-
export interface ActorVersionCollectionListOptions extends PaginationOptions {
436-
// (undocumented)
437-
desc?: boolean;
425+
list(): Promise<ActorVersionListResult> & AsyncIterable<FinalActorVersion>;
438426
}
439427

440428
// @public

src/resource_clients/actor_env_var_collection.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { ApiClientSubResourceOptions } from '../base/api_client.js';
22
import { ResourceCollectionClient } from '../base/resource_collection_client.js';
3-
import type { PaginatedList, PaginationOptions } from '../utils.js';
3+
import type { PaginatedList } from '../utils.js';
44
import * as schemas from '../schemas.js';
55
import { anyObjectSchema, parseArgument } from '../utils.js';
66
import type { ActorEnvironmentVariable } from './actor_version.js';
@@ -64,9 +64,7 @@ export class ActorEnvVarCollectionClient extends ResourceCollectionClient {
6464
* @returns A paginated iterator of environment variables.
6565
* @see https://docs.apify.com/api/v2/act-version-env-vars-get
6666
*/
67-
list(
68-
_options: ActorEnvVarCollectionListOptions = {},
69-
): Promise<ActorEnvVarListResult> & AsyncIterable<ActorEnvironmentVariable> {
67+
list(): Promise<ActorEnvVarListResult> & AsyncIterable<ActorEnvironmentVariable> {
7068
return this._listPaginated(schemas.ListOfEnvVars());
7169
}
7270

@@ -83,15 +81,6 @@ export class ActorEnvVarCollectionClient extends ResourceCollectionClient {
8381
}
8482
}
8583

86-
/**
87-
* @deprecated No options are used in the current API implementation.
88-
* https://github.com/apify/apify-client-js/issues/799
89-
* @since Added in 2.1.0
90-
*/
91-
export interface ActorEnvVarCollectionListOptions extends PaginationOptions {
92-
desc?: boolean;
93-
}
94-
9584
/**
9685
* @since Added in 2.1.0
9786
*/

src/resource_clients/actor_version_collection.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { ApiClientSubResourceOptions } from '../base/api_client.js';
22
import { ResourceCollectionClient } from '../base/resource_collection_client.js';
3-
import type { PaginatedList, PaginationOptions } from '../utils.js';
3+
import type { PaginatedList } from '../utils.js';
44
import * as schemas from '../schemas.js';
55
import { anyObjectSchema, parseArgument } from '../utils.js';
66
import type { ActorVersion, FinalActorVersion } from './actor_version.js';
@@ -61,9 +61,7 @@ export class ActorVersionCollectionClient extends ResourceCollectionClient {
6161
* @returns A paginated iterator of Actor versions.
6262
* @see https://docs.apify.com/api/v2/act-versions-get
6363
*/
64-
list(
65-
_options: ActorVersionCollectionListOptions = {},
66-
): Promise<ActorVersionListResult> & AsyncIterable<FinalActorVersion> {
64+
list(): Promise<ActorVersionListResult> & AsyncIterable<FinalActorVersion> {
6765
return this._listPaginated(schemas.ListOfVersions());
6866
}
6967

@@ -81,12 +79,4 @@ export class ActorVersionCollectionClient extends ResourceCollectionClient {
8179
}
8280
}
8381

84-
/**
85-
* @deprecated No options are used in the current API implementation.
86-
* https://github.com/apify/apify-client-js/issues/799
87-
*/
88-
export interface ActorVersionCollectionListOptions extends PaginationOptions {
89-
desc?: boolean;
90-
}
91-
9282
export type ActorVersionListResult = Pick<PaginatedList<FinalActorVersion>, 'total' | 'items'>;

0 commit comments

Comments
 (0)