apify 3.7.3-beta.9 → 4.0.0-beta.13

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/actor.d.ts CHANGED
@@ -1,11 +1,12 @@
1
- import type { ConfigurationOptions, EventManager, EventTypeName, RecordOptions, UseStateOptions } from '@crawlee/core';
1
+ import type { EventManager, EventTypeName, RecordOptions, UseStateOptions } from '@crawlee/core';
2
2
  import { Dataset, RequestQueue } from '@crawlee/core';
3
3
  import type { Awaitable, Dictionary, SetStatusMessageOptions, StorageClient } from '@crawlee/types';
4
- import type { ActorCallOptions, ActorStartOptions, ApifyClient, ApifyClientOptions, RunAbortOptions, TaskCallOptions, Webhook, WebhookEventType } from 'apify-client';
5
- import { ActorRun as ClientActorRun } from 'apify-client';
4
+ import type { ActorCallOptions, ActorStartOptions, ApifyClientOptions, RunAbortOptions, TaskCallOptions, Webhook, WebhookEventType } from 'apify-client';
5
+ import { ActorRun as ClientActorRun, ApifyClient } from 'apify-client';
6
6
  import { type ACTOR_PERMISSION_LEVEL } from '@apify/consts';
7
7
  import type { ChargeOptions, ChargeResult } from './charging.js';
8
8
  import { ChargingManager } from './charging.js';
9
+ import type { ConfigurationOptions } from './configuration.js';
9
10
  import { Configuration } from './configuration.js';
10
11
  import { KeyValueStore } from './key_value_store.js';
11
12
  import type { ProxyConfigurationOptions } from './proxy_configuration.js';
@@ -26,6 +27,20 @@ export interface InitOptions {
26
27
  */
27
28
  gracefulShutdownDelayMillis?: number;
28
29
  }
30
+ /**
31
+ * Options accepted by the {@link Actor} constructor. Either pass field-level
32
+ * overrides (`token`, `inputKey`, …) — which the Actor turns into a fresh
33
+ * {@link Configuration} — or pass a pre-built `configuration` instance. When
34
+ * both are present, `configuration` wins and the field-level overrides are
35
+ * ignored.
36
+ */
37
+ export type ActorOptions = ConfigurationOptions & {
38
+ /**
39
+ * Pre-built {@link Configuration} instance the Actor should use. Takes
40
+ * precedence over any field-level overrides also passed in `options`.
41
+ */
42
+ configuration?: Configuration;
43
+ };
29
44
  export interface ExitOptions {
30
45
  /** Exit with given status message */
31
46
  statusMessage?: string;
@@ -328,7 +343,7 @@ export declare class Actor<Data extends Dictionary = Dictionary> {
328
343
  * @internal
329
344
  */
330
345
  purgedStorageAliases: Set<string>;
331
- constructor(options?: ConfigurationOptions);
346
+ constructor(options?: ActorOptions);
332
347
  /**
333
348
  * Runs the main user function that performs the job of the Actor
334
349
  * and terminates the process when the user function finishes.