apify 4.0.0-beta.59 → 4.0.0-beta.60

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,7 +1,7 @@
1
1
  import type { EventManager, EventTypeName, RecordOptions, UseStateOptions } from '@crawlee/core';
2
2
  import { Dataset, KeyValueStore, RequestQueue } from '@crawlee/core';
3
3
  import type { Awaitable, Dictionary, StorageBackend } from '@crawlee/types';
4
- import type { ActorCallOptions, ActorInput, ActorStartOptions, ApifyClientOptions, RunAbortOptions, TaskCallOptions, TaskStartOptions, WebhookResource, WebhookEventType } from 'apify-client';
4
+ import type { ActorCallOptions, ActorInput, ActorStartOptions, ApifyClientOptions, RunAbortOptions, RunResurrectOptions, TaskCallOptions, TaskStartOptions, WebhookResource, WebhookEventType } from 'apify-client';
5
5
  import { ApifyClient, Run as ClientActorRun } from 'apify-client';
6
6
  import { type ACTOR_PERMISSION_LEVEL } from '@apify/consts';
7
7
  import type { RequestQueueAccessMode } from './apify_request_queue_backend.js';
@@ -228,6 +228,8 @@ export interface StartOptions extends Omit<ActorStartOptions, 'waitForFinish' |
228
228
  }
229
229
  export interface CallTaskOptions extends Omit<TaskCallOptions, 'runTimeoutSecs'>, Token, Timeout {
230
230
  }
231
+ export interface ResurrectOptions extends Omit<RunResurrectOptions, 'runTimeoutSecs'>, Token, Timeout {
232
+ }
231
233
  export interface StartTaskOptions extends Omit<TaskStartOptions, 'waitForFinish' | 'runTimeoutSecs'>, Token, Timeout {
232
234
  }
233
235
  export interface AbortOptions extends RunAbortOptions, Token {
@@ -494,6 +496,25 @@ export declare class Actor<Data extends Dictionary = Dictionary> {
494
496
  * @ignore
495
497
  */
496
498
  abort(runId: string, options?: AbortOptions): Promise<ClientActorRun>;
499
+ /**
500
+ * Resurrects a finished Actor run on the Apify platform using the current user account (determined by the `APIFY_TOKEN` environment variable).
501
+ *
502
+ * Only finished runs (SUCCEEDED, FAILED, ABORTED or TIMED-OUT) can be resurrected. The run goes back to the RUNNING
503
+ * status and keeps its default storages. Options you leave out keep the values of the original run.
504
+ *
505
+ * The result of the function is an {@link ActorRun} object that contains details about the Actor run.
506
+ *
507
+ * For more information about Actors, read the
508
+ * [documentation](https://docs.apify.com/actor).
509
+ *
510
+ * **Example usage:**
511
+ *
512
+ * ```js
513
+ * const run = await Actor.resurrect(runId);
514
+ * ```
515
+ * @ignore
516
+ */
517
+ resurrect(runId: string, options?: ResurrectOptions): Promise<ClientActorRun>;
497
518
  /**
498
519
  * Runs an actor task on the Apify platform using the current user account (determined by the `APIFY_TOKEN` environment variable).
499
520
  *
@@ -1097,6 +1118,24 @@ export declare class Actor<Data extends Dictionary = Dictionary> {
1097
1118
  * ```
1098
1119
  */
1099
1120
  static abort(runId: string, options?: AbortOptions): Promise<ClientActorRun>;
1121
+ /**
1122
+ * Resurrects a finished Actor run on the Apify platform using the current user account (determined by the `APIFY_TOKEN` environment variable).
1123
+ *
1124
+ * Only finished runs (SUCCEEDED, FAILED, ABORTED or TIMED-OUT) can be resurrected. The run goes back to the RUNNING
1125
+ * status and keeps its default storages. Options you leave out keep the values of the original run.
1126
+ *
1127
+ * The result of the function is an {@link ActorRun} object that contains details about the Actor run.
1128
+ *
1129
+ * For more information about Actors, read the
1130
+ * [documentation](https://docs.apify.com/actor).
1131
+ *
1132
+ * **Example usage:**
1133
+ *
1134
+ * ```js
1135
+ * const run = await Actor.resurrect(runId);
1136
+ * ```
1137
+ */
1138
+ static resurrect(runId: string, options?: ResurrectOptions): Promise<ClientActorRun>;
1100
1139
  /**
1101
1140
  * Transforms this Actor run to an Actor run of a given Actor. The system stops the current container and starts
1102
1141
  * the new container instead. All the default storages are preserved and the new input is stored under the `INPUT-METAMORPH-1` key
package/dist/actor.js CHANGED
@@ -459,6 +459,30 @@ export class Actor {
459
459
  }
460
460
  return client.run(runId).abort(rest);
461
461
  }
462
+ /**
463
+ * Resurrects a finished Actor run on the Apify platform using the current user account (determined by the `APIFY_TOKEN` environment variable).
464
+ *
465
+ * Only finished runs (SUCCEEDED, FAILED, ABORTED or TIMED-OUT) can be resurrected. The run goes back to the RUNNING
466
+ * status and keeps its default storages. Options you leave out keep the values of the original run.
467
+ *
468
+ * The result of the function is an {@link ActorRun} object that contains details about the Actor run.
469
+ *
470
+ * For more information about Actors, read the
471
+ * [documentation](https://docs.apify.com/actor).
472
+ *
473
+ * **Example usage:**
474
+ *
475
+ * ```js
476
+ * const run = await Actor.resurrect(runId);
477
+ * ```
478
+ * @ignore
479
+ */
480
+ async resurrect(runId, options = {}) {
481
+ const runTimeoutSecs = options.timeout === 'inherit' ? this.getRemainingTimeSecs() : options.timeout;
482
+ const { token, timeout: _timeout, ...rest } = options;
483
+ const client = token ? this.newClient({ token }) : this.apifyClient;
484
+ return client.run(runId).resurrect({ ...rest, runTimeoutSecs });
485
+ }
462
486
  /**
463
487
  * Runs an actor task on the Apify platform using the current user account (determined by the `APIFY_TOKEN` environment variable).
464
488
  *
@@ -1409,6 +1433,26 @@ export class Actor {
1409
1433
  static async abort(runId, options = {}) {
1410
1434
  return Actor.getDefaultInstance().abort(runId, options);
1411
1435
  }
1436
+ /**
1437
+ * Resurrects a finished Actor run on the Apify platform using the current user account (determined by the `APIFY_TOKEN` environment variable).
1438
+ *
1439
+ * Only finished runs (SUCCEEDED, FAILED, ABORTED or TIMED-OUT) can be resurrected. The run goes back to the RUNNING
1440
+ * status and keeps its default storages. Options you leave out keep the values of the original run.
1441
+ *
1442
+ * The result of the function is an {@link ActorRun} object that contains details about the Actor run.
1443
+ *
1444
+ * For more information about Actors, read the
1445
+ * [documentation](https://docs.apify.com/actor).
1446
+ *
1447
+ * **Example usage:**
1448
+ *
1449
+ * ```js
1450
+ * const run = await Actor.resurrect(runId);
1451
+ * ```
1452
+ */
1453
+ static async resurrect(runId, options = {}) {
1454
+ return Actor.getDefaultInstance().resurrect(runId, options);
1455
+ }
1412
1456
  /**
1413
1457
  * Transforms this Actor run to an Actor run of a given Actor. The system stops the current container and starts
1414
1458
  * the new container instead. All the default storages are preserved and the new input is stored under the `INPUT-METAMORPH-1` key
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apify",
3
- "version": "4.0.0-beta.59",
3
+ "version": "4.0.0-beta.60",
4
4
  "description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
5
5
  "engines": {
6
6
  "node": ">=22.13.0"