apify-client 2.20.1-beta.6 → 2.20.1-beta.8

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.
Files changed (118) hide show
  1. package/dist/apify_client.d.ts +237 -25
  2. package/dist/apify_client.d.ts.map +1 -1
  3. package/dist/apify_client.js +234 -25
  4. package/dist/apify_client.js.map +1 -1
  5. package/dist/bundle.js +2042 -253
  6. package/dist/bundle.js.map +1 -1
  7. package/dist/resource_clients/actor.d.ts +322 -31
  8. package/dist/resource_clients/actor.d.ts.map +1 -1
  9. package/dist/resource_clients/actor.js +167 -19
  10. package/dist/resource_clients/actor.js.map +1 -1
  11. package/dist/resource_clients/actor_collection.d.ts +34 -3
  12. package/dist/resource_clients/actor_collection.d.ts.map +1 -1
  13. package/dist/resource_clients/actor_collection.js +34 -3
  14. package/dist/resource_clients/actor_collection.js.map +1 -1
  15. package/dist/resource_clients/actor_env_var.d.ts +34 -3
  16. package/dist/resource_clients/actor_env_var.d.ts.map +1 -1
  17. package/dist/resource_clients/actor_env_var.js +34 -3
  18. package/dist/resource_clients/actor_env_var.js.map +1 -1
  19. package/dist/resource_clients/actor_env_var_collection.d.ts +37 -3
  20. package/dist/resource_clients/actor_env_var_collection.d.ts.map +1 -1
  21. package/dist/resource_clients/actor_env_var_collection.js +37 -3
  22. package/dist/resource_clients/actor_env_var_collection.js.map +1 -1
  23. package/dist/resource_clients/actor_version.d.ts +42 -6
  24. package/dist/resource_clients/actor_version.d.ts.map +1 -1
  25. package/dist/resource_clients/actor_version.js +42 -6
  26. package/dist/resource_clients/actor_version.js.map +1 -1
  27. package/dist/resource_clients/actor_version_collection.d.ts +35 -3
  28. package/dist/resource_clients/actor_version_collection.d.ts.map +1 -1
  29. package/dist/resource_clients/actor_version_collection.js +35 -3
  30. package/dist/resource_clients/actor_version_collection.js.map +1 -1
  31. package/dist/resource_clients/build.d.ts +123 -11
  32. package/dist/resource_clients/build.d.ts.map +1 -1
  33. package/dist/resource_clients/build.js +93 -11
  34. package/dist/resource_clients/build.js.map +1 -1
  35. package/dist/resource_clients/build_collection.d.ts +27 -2
  36. package/dist/resource_clients/build_collection.d.ts.map +1 -1
  37. package/dist/resource_clients/build_collection.js +27 -2
  38. package/dist/resource_clients/build_collection.js.map +1 -1
  39. package/dist/resource_clients/dataset.d.ts +221 -15
  40. package/dist/resource_clients/dataset.d.ts.map +1 -1
  41. package/dist/resource_clients/dataset.js +185 -15
  42. package/dist/resource_clients/dataset.js.map +1 -1
  43. package/dist/resource_clients/dataset_collection.d.ts +32 -3
  44. package/dist/resource_clients/dataset_collection.d.ts.map +1 -1
  45. package/dist/resource_clients/dataset_collection.js +32 -3
  46. package/dist/resource_clients/dataset_collection.js.map +1 -1
  47. package/dist/resource_clients/key_value_store.d.ts +219 -26
  48. package/dist/resource_clients/key_value_store.d.ts.map +1 -1
  49. package/dist/resource_clients/key_value_store.js +172 -25
  50. package/dist/resource_clients/key_value_store.js.map +1 -1
  51. package/dist/resource_clients/key_value_store_collection.d.ts +32 -3
  52. package/dist/resource_clients/key_value_store_collection.d.ts.map +1 -1
  53. package/dist/resource_clients/key_value_store_collection.js +32 -3
  54. package/dist/resource_clients/key_value_store_collection.js.map +1 -1
  55. package/dist/resource_clients/log.d.ts +34 -3
  56. package/dist/resource_clients/log.d.ts.map +1 -1
  57. package/dist/resource_clients/log.js +34 -3
  58. package/dist/resource_clients/log.js.map +1 -1
  59. package/dist/resource_clients/request_queue.d.ts +290 -19
  60. package/dist/resource_clients/request_queue.d.ts.map +1 -1
  61. package/dist/resource_clients/request_queue.js +233 -19
  62. package/dist/resource_clients/request_queue.js.map +1 -1
  63. package/dist/resource_clients/request_queue_collection.d.ts +31 -3
  64. package/dist/resource_clients/request_queue_collection.d.ts.map +1 -1
  65. package/dist/resource_clients/request_queue_collection.js +31 -3
  66. package/dist/resource_clients/request_queue_collection.js.map +1 -1
  67. package/dist/resource_clients/run.d.ts +224 -27
  68. package/dist/resource_clients/run.d.ts.map +1 -1
  69. package/dist/resource_clients/run.js +200 -27
  70. package/dist/resource_clients/run.js.map +1 -1
  71. package/dist/resource_clients/run_collection.d.ts +27 -2
  72. package/dist/resource_clients/run_collection.d.ts.map +1 -1
  73. package/dist/resource_clients/run_collection.js +27 -2
  74. package/dist/resource_clients/run_collection.js.map +1 -1
  75. package/dist/resource_clients/schedule.d.ts +65 -4
  76. package/dist/resource_clients/schedule.d.ts.map +1 -1
  77. package/dist/resource_clients/schedule.js +42 -4
  78. package/dist/resource_clients/schedule.js.map +1 -1
  79. package/dist/resource_clients/schedule_collection.d.ts +35 -3
  80. package/dist/resource_clients/schedule_collection.d.ts.map +1 -1
  81. package/dist/resource_clients/schedule_collection.js +35 -3
  82. package/dist/resource_clients/schedule_collection.js.map +1 -1
  83. package/dist/resource_clients/store_collection.d.ts +26 -2
  84. package/dist/resource_clients/store_collection.d.ts.map +1 -1
  85. package/dist/resource_clients/store_collection.js +26 -2
  86. package/dist/resource_clients/store_collection.js.map +1 -1
  87. package/dist/resource_clients/task.d.ts +110 -11
  88. package/dist/resource_clients/task.d.ts.map +1 -1
  89. package/dist/resource_clients/task.js +83 -11
  90. package/dist/resource_clients/task.js.map +1 -1
  91. package/dist/resource_clients/task_collection.d.ts +35 -8
  92. package/dist/resource_clients/task_collection.d.ts.map +1 -1
  93. package/dist/resource_clients/task_collection.js +35 -8
  94. package/dist/resource_clients/task_collection.js.map +1 -1
  95. package/dist/resource_clients/user.d.ts +41 -4
  96. package/dist/resource_clients/user.d.ts.map +1 -1
  97. package/dist/resource_clients/user.js +41 -4
  98. package/dist/resource_clients/user.js.map +1 -1
  99. package/dist/resource_clients/webhook.d.ts +66 -5
  100. package/dist/resource_clients/webhook.d.ts.map +1 -1
  101. package/dist/resource_clients/webhook.js +48 -5
  102. package/dist/resource_clients/webhook.js.map +1 -1
  103. package/dist/resource_clients/webhook_collection.d.ts +34 -3
  104. package/dist/resource_clients/webhook_collection.d.ts.map +1 -1
  105. package/dist/resource_clients/webhook_collection.js +34 -3
  106. package/dist/resource_clients/webhook_collection.js.map +1 -1
  107. package/dist/resource_clients/webhook_dispatch.d.ts +22 -1
  108. package/dist/resource_clients/webhook_dispatch.d.ts.map +1 -1
  109. package/dist/resource_clients/webhook_dispatch.js +22 -1
  110. package/dist/resource_clients/webhook_dispatch.js.map +1 -1
  111. package/dist/resource_clients/webhook_dispatch_collection.d.ts +24 -2
  112. package/dist/resource_clients/webhook_dispatch_collection.d.ts.map +1 -1
  113. package/dist/resource_clients/webhook_dispatch_collection.js +24 -2
  114. package/dist/resource_clients/webhook_dispatch_collection.js.map +1 -1
  115. package/dist/utils.d.ts +42 -0
  116. package/dist/utils.d.ts.map +1 -1
  117. package/dist/utils.js.map +1 -1
  118. package/package.json +1 -1
@@ -5,6 +5,29 @@ const tslib_1 = require("tslib");
5
5
  const ow_1 = tslib_1.__importDefault(require("ow"));
6
6
  const resource_client_1 = require("../base/resource_client");
7
7
  const utils_1 = require("../utils");
8
+ /**
9
+ * Client for managing a specific Schedule.
10
+ *
11
+ * Schedules are used to automatically start Actors or tasks at specified times. This client provides
12
+ * methods to get, update, and delete schedules, as well as retrieve schedule logs.
13
+ *
14
+ * @example
15
+ * ```javascript
16
+ * const client = new ApifyClient({ token: 'my-token' });
17
+ * const scheduleClient = client.schedule('my-schedule-id');
18
+ *
19
+ * // Get schedule details
20
+ * const schedule = await scheduleClient.get();
21
+ *
22
+ * // Update schedule
23
+ * await scheduleClient.update({
24
+ * cronExpression: '0 12 * * *',
25
+ * isEnabled: true
26
+ * });
27
+ * ```
28
+ *
29
+ * @see https://docs.apify.com/platform/schedules
30
+ */
8
31
  class ScheduleClient extends resource_client_1.ResourceClient {
9
32
  /**
10
33
  * @hidden
@@ -16,26 +39,38 @@ class ScheduleClient extends resource_client_1.ResourceClient {
16
39
  });
17
40
  }
18
41
  /**
19
- * https://docs.apify.com/api/v2#/reference/schedules/schedule-object/get-schedule
42
+ * Retrieves the schedule.
43
+ *
44
+ * @returns The schedule object, or `undefined` if it does not exist.
45
+ * @see https://docs.apify.com/api/v2/schedule-get
20
46
  */
21
47
  async get() {
22
48
  return this._get();
23
49
  }
24
50
  /**
25
- * https://docs.apify.com/api/v2#/reference/schedules/schedule-object/update-schedule
51
+ * Updates the schedule with the specified fields.
52
+ *
53
+ * @param newFields - Fields to update.
54
+ * @returns The updated schedule object.
55
+ * @see https://docs.apify.com/api/v2/schedule-put
26
56
  */
27
57
  async update(newFields) {
28
58
  (0, ow_1.default)(newFields, ow_1.default.object);
29
59
  return this._update(newFields);
30
60
  }
31
61
  /**
32
- * https://docs.apify.com/api/v2#/reference/schedules/schedule-object/delete-schedule
62
+ * Deletes the schedule.
63
+ *
64
+ * @see https://docs.apify.com/api/v2/schedule-delete
33
65
  */
34
66
  async delete() {
35
67
  return this._delete();
36
68
  }
37
69
  /**
38
- * https://docs.apify.com/api/v2#/reference/schedules/schedule-log/get-schedule-log
70
+ * Retrieves the schedule's log.
71
+ *
72
+ * @returns The schedule log as a string, or `undefined` if it does not exist.
73
+ * @see https://docs.apify.com/api/v2/schedule-log-get
39
74
  */
40
75
  async getLog() {
41
76
  const requestOpts = {
@@ -54,6 +89,9 @@ class ScheduleClient extends resource_client_1.ResourceClient {
54
89
  }
55
90
  }
56
91
  exports.ScheduleClient = ScheduleClient;
92
+ /**
93
+ * Types of actions that can be scheduled.
94
+ */
57
95
  var ScheduleActions;
58
96
  (function (ScheduleActions) {
59
97
  ScheduleActions["RunActor"] = "RUN_ACTOR";
@@ -1 +1 @@
1
- {"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../src/resource_clients/schedule.ts"],"names":[],"mappings":";;;;AAAA,oDAAoB;AAIpB,6DAAyD;AAIzD,oCAAkF;AAElF,MAAa,cAAe,SAAQ,gCAAc;IAC9C;;OAEG;IACH,YAAY,OAAoC;QAC5C,KAAK,CAAC;YACF,YAAY,EAAE,WAAW;YACzB,GAAG,OAAO;SACb,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,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ceCollectionClient } from '../base/resource_collection_client';
3
3
  import type { PaginatedIterator, PaginationOptions } from '../utils';
4
4
  import type { Schedule, ScheduleCreateOrUpdateData } from './schedule';
5
+ /**
6
+ * Client for managing the collection of Schedules in your account.
7
+ *
8
+ * Schedules are used to automatically start Actors or tasks at specified times.
9
+ * This client provides methods to list and create schedules.
10
+ *
11
+ * @example
12
+ * ```javascript
13
+ * const client = new ApifyClient({ token: 'my-token' });
14
+ * const schedulesClient = client.schedules();
15
+ *
16
+ * // List all schedules
17
+ * const { items } = await schedulesClient.list();
18
+ *
19
+ * // Create a new schedule
20
+ * const newSchedule = await schedulesClient.create({
21
+ * actorId: 'my-actor-id',
22
+ * cronExpression: '0 9 * * *',
23
+ * isEnabled: true
24
+ * });
25
+ * ```
26
+ *
27
+ * @see https://docs.apify.com/platform/schedules
28
+ */
5
29
  export declare class ScheduleCollectionClient extends ResourceCollectionClient {
6
30
  /**
7
31
  * @hidden
8
32
  */
9
33
  constructor(options: ApiClientSubResourceOptions);
10
34
  /**
11
- * https://docs.apify.com/api/v2#/reference/schedules/schedules-collection/get-list-of-schedules
35
+ * Lists all schedules.
12
36
  *
13
37
  * Awaiting the return value (as you would with a Promise) will result in a single API call. The amount of fetched
14
38
  * items in a single API call is limited.
15
39
  * ```javascript
16
40
  * const paginatedList = await client.list(options);
17
- *```
41
+ * ```
18
42
  *
19
43
  * Asynchronous iteration is also supported. This will fetch additional pages if needed until all items are
20
44
  * retrieved.
@@ -22,10 +46,18 @@ export declare class ScheduleCollectionClient extends ResourceCollectionClient {
22
46
  * ```javascript
23
47
  * for await (const singleItem of client.list(options)) {...}
24
48
  * ```
49
+ *
50
+ * @param options - Pagination and sorting options.
51
+ * @returns A paginated iterator of schedules.
52
+ * @see https://docs.apify.com/api/v2/schedules-get
25
53
  */
26
54
  list(options?: ScheduleCollectionListOptions): PaginatedIterator<Schedule>;
27
55
  /**
28
- * https://docs.apify.com/api/v2#/reference/schedules/schedules-collection/create-schedule
56
+ * Creates a new schedule.
57
+ *
58
+ * @param schedule - The schedule data.
59
+ * @returns The created schedule object.
60
+ * @see https://docs.apify.com/api/v2/schedules-post
29
61
  */
30
62
  create(schedule?: ScheduleCreateOrUpdateData): Promise<Schedule>;
31
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"schedule_collection.d.ts","sourceRoot":"","sources":["../../src/resource_clients/schedule_collection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAEvE,qBAAa,wBAAyB,SAAQ,wBAAwB;IAClE;;OAEG;gBACS,OAAO,EAAE,2BAA2B;IAOhD;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,OAAO,GAAE,6BAAkC,GAAG,iBAAiB,CAAC,QAAQ,CAAC;IAa9E;;OAEG;IACG,MAAM,CAAC,QAAQ,CAAC,EAAE,0BAA0B,GAAG,OAAO,CAAC,QAAQ,CAAC;CAKzE;AAED,MAAM,WAAW,6BAA8B,SAAQ,iBAAiB;IACpE,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB"}
1
+ {"version":3,"file":"schedule_collection.d.ts","sourceRoot":"","sources":["../../src/resource_clients/schedule_collection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,wBAAyB,SAAQ,wBAAwB;IAClE;;OAEG;gBACS,OAAO,EAAE,2BAA2B;IAOhD;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,CAAC,OAAO,GAAE,6BAAkC,GAAG,iBAAiB,CAAC,QAAQ,CAAC;IAa9E;;;;;;OAMG;IACG,MAAM,CAAC,QAAQ,CAAC,EAAE,0BAA0B,GAAG,OAAO,CAAC,QAAQ,CAAC;CAKzE;AAED,MAAM,WAAW,6BAA8B,SAAQ,iBAAiB;IACpE,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB"}
@@ -4,6 +4,30 @@ exports.ScheduleCollectionClient = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ow_1 = tslib_1.__importDefault(require("ow"));
6
6
  const resource_collection_client_1 = require("../base/resource_collection_client");
7
+ /**
8
+ * Client for managing the collection of Schedules in your account.
9
+ *
10
+ * Schedules are used to automatically start Actors or tasks at specified times.
11
+ * This client provides methods to list and create schedules.
12
+ *
13
+ * @example
14
+ * ```javascript
15
+ * const client = new ApifyClient({ token: 'my-token' });
16
+ * const schedulesClient = client.schedules();
17
+ *
18
+ * // List all schedules
19
+ * const { items } = await schedulesClient.list();
20
+ *
21
+ * // Create a new schedule
22
+ * const newSchedule = await schedulesClient.create({
23
+ * actorId: 'my-actor-id',
24
+ * cronExpression: '0 9 * * *',
25
+ * isEnabled: true
26
+ * });
27
+ * ```
28
+ *
29
+ * @see https://docs.apify.com/platform/schedules
30
+ */
7
31
  class ScheduleCollectionClient extends resource_collection_client_1.ResourceCollectionClient {
8
32
  /**
9
33
  * @hidden
@@ -15,13 +39,13 @@ class ScheduleCollectionClient extends resource_collection_client_1.ResourceColl
15
39
  });
16
40
  }
17
41
  /**
18
- * https://docs.apify.com/api/v2#/reference/schedules/schedules-collection/get-list-of-schedules
42
+ * Lists all schedules.
19
43
  *
20
44
  * Awaiting the return value (as you would with a Promise) will result in a single API call. The amount of fetched
21
45
  * items in a single API call is limited.
22
46
  * ```javascript
23
47
  * const paginatedList = await client.list(options);
24
- *```
48
+ * ```
25
49
  *
26
50
  * Asynchronous iteration is also supported. This will fetch additional pages if needed until all items are
27
51
  * retrieved.
@@ -29,6 +53,10 @@ class ScheduleCollectionClient extends resource_collection_client_1.ResourceColl
29
53
  * ```javascript
30
54
  * for await (const singleItem of client.list(options)) {...}
31
55
  * ```
56
+ *
57
+ * @param options - Pagination and sorting options.
58
+ * @returns A paginated iterator of schedules.
59
+ * @see https://docs.apify.com/api/v2/schedules-get
32
60
  */
33
61
  list(options = {}) {
34
62
  (0, ow_1.default)(options, ow_1.default.object.exactShape({
@@ -39,7 +67,11 @@ class ScheduleCollectionClient extends resource_collection_client_1.ResourceColl
39
67
  return this._listPaginated(options);
40
68
  }
41
69
  /**
42
- * https://docs.apify.com/api/v2#/reference/schedules/schedules-collection/create-schedule
70
+ * Creates a new schedule.
71
+ *
72
+ * @param schedule - The schedule data.
73
+ * @returns The created schedule object.
74
+ * @see https://docs.apify.com/api/v2/schedules-post
43
75
  */
44
76
  async create(schedule) {
45
77
  (0, ow_1.default)(schedule, ow_1.default.optional.object);
@@ -1 +1 @@
1
- {"version":3,"file":"schedule_collection.js","sourceRoot":"","sources":["../../src/resource_clients/schedule_collection.ts"],"names":[],"mappings":";;;;AAAA,oDAAoB;AAGpB,mFAA8E;AAI9E,MAAa,wBAAyB,SAAQ,qDAAwB;IAClE;;OAEG;IACH,YAAY,OAAoC;QAC5C,KAAK,CAAC;YACF,YAAY,EAAE,WAAW;YACzB,GAAG,OAAO;SACb,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,UAAyC,EAAE;QAC5C,IAAA,YAAE,EACE,OAAO,EACP,YAAE,CAAC,MAAM,CAAC,UAAU,CAAC;YACjB,KAAK,EAAE,YAAE,CAAC,QAAQ,CAAC,MAAM;YACzB,MAAM,EAAE,YAAE,CAAC,QAAQ,CAAC,MAAM;YAC1B,IA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ClC,CAAC;CACJ;AAxDD,4DAwDC"}
@@ -2,19 +2,39 @@ import type { ApiClientSubResourceOptions } from '../base/api_client';
2
2
  import { ResourceCollectionClient } from '../base/resource_collection_client';
3
3
  import type { PaginatedIterator, PaginationOptions } from '../utils';
4
4
  import type { ActorStats } from './actor';
5
+ /**
6
+ * Client for browsing Actors in the Apify Store.
7
+ *
8
+ * The Apify Store contains publicly available Actors that can be used by anyone.
9
+ * This client provides methods to search and list Actors from the Store.
10
+ *
11
+ * @example
12
+ * ```javascript
13
+ * const client = new ApifyClient();
14
+ * const storeClient = client.store();
15
+ *
16
+ * // Search for Actors in the Store
17
+ * const { items } = await storeClient.list({ search: 'web scraper' });
18
+ *
19
+ * // Get details about a specific Store Actor
20
+ * const actor = await storeClient.list({ username: 'apify', actorName: 'web-scraper' });
21
+ * ```
22
+ *
23
+ * @see https://docs.apify.com/platform/actors/publishing
24
+ */
5
25
  export declare class StoreCollectionClient extends ResourceCollectionClient {
6
26
  /**
7
27
  * @hidden
8
28
  */
9
29
  constructor(options: ApiClientSubResourceOptions);
10
30
  /**
11
- * https://docs.apify.com/api/v2/#/reference/store/store-actors-collection/get-list-of-actors-in-store
31
+ * Lists Actors from the Apify Store.
12
32
  *
13
33
  * Awaiting the return value (as you would with a Promise) will result in a single API call. The amount of fetched
14
34
  * items in a single API call is limited.
15
35
  * ```javascript
16
36
  * const paginatedList = await client.list(options);
17
- *```
37
+ * ```
18
38
  *
19
39
  * Asynchronous iteration is also supported. This will fetch additional pages if needed until all items are
20
40
  * retrieved.
@@ -22,6 +42,10 @@ export declare class StoreCollectionClient extends ResourceCollectionClient {
22
42
  * ```javascript
23
43
  * for await (const singleItem of client.list(options)) {...}
24
44
  * ```
45
+ *
46
+ * @param options - Search and pagination options.
47
+ * @returns A paginated iterator of store Actors.
48
+ * @see https://docs.apify.com/api/v2/store-actors-get
25
49
  */
26
50
  list(options?: StoreCollectionListOptions): PaginatedIterator<ActorStoreList>;
27
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"store_collection.d.ts","sourceRoot":"","sources":["../../src/resource_clients/store_collection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,qBAAa,qBAAsB,SAAQ,wBAAwB;IAC/D;;OAEG;gBACS,OAAO,EAAE,2BAA2B;IAOhD;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,OAAO,GAAE,0BAA+B,GAAG,iBAAiB,CAAC,cAAc,CAAC;CAgBpF;AAED,MAAM,WAAW,WAAW;IACxB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;IAClB,kBAAkB,EAAE,WAAW,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,0BAA2B,SAAQ,iBAAiB;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB"}
1
+ {"version":3,"file":"store_collection.d.ts","sourceRoot":"","sources":["../../src/resource_clients/store_collection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,qBAAsB,SAAQ,wBAAwB;IAC/D;;OAEG;gBACS,OAAO,EAAE,2BAA2B;IAOhD;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,CAAC,OAAO,GAAE,0BAA+B,GAAG,iBAAiB,CAAC,cAAc,CAAC;CAgBpF;AAED,MAAM,WAAW,WAAW;IACxB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;IAClB,kBAAkB,EAAE,WAAW,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,0BAA2B,SAAQ,iBAAiB;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB"}
@@ -4,6 +4,26 @@ exports.StoreCollectionClient = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ow_1 = tslib_1.__importDefault(require("ow"));
6
6
  const resource_collection_client_1 = require("../base/resource_collection_client");
7
+ /**
8
+ * Client for browsing Actors in the Apify Store.
9
+ *
10
+ * The Apify Store contains publicly available Actors that can be used by anyone.
11
+ * This client provides methods to search and list Actors from the Store.
12
+ *
13
+ * @example
14
+ * ```javascript
15
+ * const client = new ApifyClient();
16
+ * const storeClient = client.store();
17
+ *
18
+ * // Search for Actors in the Store
19
+ * const { items } = await storeClient.list({ search: 'web scraper' });
20
+ *
21
+ * // Get details about a specific Store Actor
22
+ * const actor = await storeClient.list({ username: 'apify', actorName: 'web-scraper' });
23
+ * ```
24
+ *
25
+ * @see https://docs.apify.com/platform/actors/publishing
26
+ */
7
27
  class StoreCollectionClient extends resource_collection_client_1.ResourceCollectionClient {
8
28
  /**
9
29
  * @hidden
@@ -15,13 +35,13 @@ class StoreCollectionClient extends resource_collection_client_1.ResourceCollect
15
35
  });
16
36
  }
17
37
  /**
18
- * https://docs.apify.com/api/v2/#/reference/store/store-actors-collection/get-list-of-actors-in-store
38
+ * Lists Actors from the Apify Store.
19
39
  *
20
40
  * Awaiting the return value (as you would with a Promise) will result in a single API call. The amount of fetched
21
41
  * items in a single API call is limited.
22
42
  * ```javascript
23
43
  * const paginatedList = await client.list(options);
24
- *```
44
+ * ```
25
45
  *
26
46
  * Asynchronous iteration is also supported. This will fetch additional pages if needed until all items are
27
47
  * retrieved.
@@ -29,6 +49,10 @@ class StoreCollectionClient extends resource_collection_client_1.ResourceCollect
29
49
  * ```javascript
30
50
  * for await (const singleItem of client.list(options)) {...}
31
51
  * ```
52
+ *
53
+ * @param options - Search and pagination options.
54
+ * @returns A paginated iterator of store Actors.
55
+ * @see https://docs.apify.com/api/v2/store-actors-get
32
56
  */
33
57
  list(options = {}) {
34
58
  (0, ow_1.default)(options, ow_1.default.object.exactShape({
@@ -1 +1 @@
1
- {"version":3,"file":"store_collection.js","sourceRoot":"","sources":["../../src/resource_clients/store_collection.ts"],"names":[],"mappings":";;;;AAAA,oDAAoB;AAGpB,mFAA8E;AAI9E,MAAa,q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M,EAAE,YAAE,CAAC,QAAQ,CAAC,MAAM;YAC1B,MAAM,EAAE,YAAE,CAAC,QAAQ,CAAC,MAAM;YAC1B,MAAM,EAAE,YAAE,CAAC,QAAQ,CAAC,MAAM;YAC1B,QAAQ,EAAE,YAAE,CAAC,QAAQ,CAAC,MAAM;YAC5B,QAAQ,EAAE,YAAE,CAAC,QAAQ,CAAC,MAAM;YAC5B,YAAY,EAAE,YAAE,CAAC,QAAQ,CAAC,MAAM;SACnC,CAAC,CACL,CAAC;QAEF,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;CACJ;AA/CD,sDA+CC"}
@@ -6,55 +6,133 @@ import type { ActorRun, ActorStandby, ActorStartOptions } from './actor';
6
6
  import { RunClient } from './run';
7
7
  import { RunCollectionClient } from './run_collection';
8
8
  import { WebhookCollectionClient } from './webhook_collection';
9
+ /**
10
+ * Client for managing a specific Actor task.
11
+ *
12
+ * Tasks are pre-configured Actor runs with saved input and options. This client provides methods
13
+ * to start, call, update, and delete tasks, as well as manage their runs and webhooks.
14
+ *
15
+ * @example
16
+ * ```javascript
17
+ * const client = new ApifyClient({ token: 'my-token' });
18
+ * const taskClient = client.task('my-task-id');
19
+ *
20
+ * // Start a task
21
+ * const run = await taskClient.start();
22
+ *
23
+ * // Call a task and wait for it to finish
24
+ * const finishedRun = await taskClient.call();
25
+ * ```
26
+ *
27
+ * @see https://docs.apify.com/platform/actors/running/tasks
28
+ */
9
29
  export declare class TaskClient extends ResourceClient {
10
30
  /**
11
31
  * @hidden
12
32
  */
13
33
  constructor(options: ApiClientSubResourceOptions);
14
34
  /**
15
- * https://docs.apify.com/api/v2#/reference/actor-tasks/task-object/get-task
35
+ * Retrieves the Actor task.
36
+ *
37
+ * @returns The task object, or `undefined` if it does not exist.
38
+ * @see https://docs.apify.com/api/v2/actor-task-get
16
39
  */
17
40
  get(): Promise<Task | undefined>;
18
41
  /**
19
- * https://docs.apify.com/api/v2#/reference/actor-tasks/task-object/update-task
42
+ * Updates the task with the specified fields.
43
+ *
44
+ * @param newFields - Fields to update.
45
+ * @returns The updated task object.
46
+ * @see https://docs.apify.com/api/v2/actor-task-put
20
47
  */
21
48
  update(newFields: TaskUpdateData): Promise<Task>;
22
49
  /**
23
- * https://docs.apify.com/api/v2#/reference/actor-tasks/task-object/delete-task
50
+ * Deletes the Task.
51
+ *
52
+ * @see https://docs.apify.com/api/v2/actor-task-delete
24
53
  */
25
54
  delete(): Promise<void>;
26
55
  /**
27
- * Starts a task and immediately returns the Run object.
28
- * https://docs.apify.com/api/v2#/reference/actor-tasks/run-collection/run-task
56
+ * Starts an Actor task and immediately returns the Run object.
57
+ *
58
+ * @param input - Input overrides for the task. If not provided, the task's saved input is used.
59
+ * @param options - Run options.
60
+ * @param options.build - Tag or number of the Actor build to run (e.g., `'beta'` or `'1.2.345'`).
61
+ * @param options.memory - Memory in megabytes allocated for the run.
62
+ * @param options.timeout - Timeout for the run in seconds. Zero means no timeout.
63
+ * @param options.waitForFinish - Maximum time to wait (in seconds, max 60s) for the run to finish before returning.
64
+ * @param options.webhooks - Webhooks to trigger for specific Actor run events.
65
+ * @param options.maxItems - Maximum number of dataset items (for pay-per-result Actors).
66
+ * @param options.maxTotalChargeUsd - Maximum cost in USD (for pay-per-event Actors).
67
+ * @param options.restartOnError - Whether to restart the run on error.
68
+ * @returns The Actor Run object.
69
+ * @see https://docs.apify.com/api/v2/actor-task-runs-post
29
70
  */
30
71
  start(input?: Dictionary, options?: TaskStartOptions): Promise<ActorRun>;
31
72
  /**
32
73
  * Starts a task and waits for it to finish before returning the Run object.
33
74
  * It waits indefinitely, unless the `waitSecs` option is provided.
34
- * https://docs.apify.com/api/v2#/reference/actor-tasks/run-collection/run-task
75
+ *
76
+ * @param input - Input overrides for the task. If not provided, the task's saved input is used.
77
+ * @param options - Run and wait options.
78
+ * @param options.build - Tag or number of the Actor build to run.
79
+ * @param options.memory - Memory in megabytes allocated for the run.
80
+ * @param options.timeout - Timeout for the run in seconds.
81
+ * @param options.waitSecs - Maximum time to wait for the run to finish, in seconds. If omitted, waits indefinitely.
82
+ * @param options.webhooks - Webhooks to trigger for specific Actor run events.
83
+ * @param options.maxItems - Maximum number of dataset items (for pay-per-result Actors).
84
+ * @param options.maxTotalChargeUsd - Maximum cost in USD (for pay-per-event Actors).
85
+ * @param options.restartOnError - Whether to restart the run on error.
86
+ * @returns The Actor run object.
87
+ * @see https://docs.apify.com/api/v2/actor-task-runs-post
35
88
  */
36
89
  call(input?: Dictionary, options?: TaskCallOptions): Promise<ActorRun>;
37
90
  /**
38
- * https://docs.apify.com/api/v2#/reference/actor-tasks/task-input-object/get-task-input
91
+ * Retrieves the Actor task's input object.
92
+ *
93
+ * @returns The Task's input, or `undefined` if it does not exist.
94
+ * @see https://docs.apify.com/api/v2/actor-task-input-get
39
95
  */
40
96
  getInput(): Promise<Dictionary | Dictionary[] | undefined>;
41
97
  /**
42
- * https://docs.apify.com/api/v2#/reference/actor-tasks/task-input-object/update-task-input
98
+ * Updates the Actor task's input object.
99
+ *
100
+ * @param newFields - New input data for the task.
101
+ * @returns The updated task input.
102
+ * @see https://docs.apify.com/api/v2/actor-task-input-put
43
103
  */
44
104
  updateInput(newFields: Dictionary | Dictionary[]): Promise<Dictionary | Dictionary[]>;
45
105
  /**
46
- * https://docs.apify.com/api/v2#/reference/actor-tasks/last-run-object-and-its-storages
106
+ * Returns a client for the last run of this task.
107
+ *
108
+ * @param options - Filter options for the last run.
109
+ * @param options.status - Filter by run status (e.g., `'SUCCEEDED'`, `'FAILED'`, `'RUNNING'`).
110
+ * @param options.origin - Filter by run origin (e.g., `'WEB'`, `'API'`, `'SCHEDULE'`).
111
+ * @returns A client for the last run.
112
+ * @see https://docs.apify.com/api/v2/actor-task-runs-last-get
47
113
  */
48
114
  lastRun(options?: TaskLastRunOptions): RunClient;
49
115
  /**
50
- * https://docs.apify.com/api/v2#/reference/actor-tasks/run-collection
116
+ * Returns a client for the Runs of this Task.
117
+ *
118
+ * @returns A client for the task's runs.
119
+ * @see https://docs.apify.com/api/v2/actor-task-runs-get
51
120
  */
52
121
  runs(): RunCollectionClient;
53
122
  /**
54
- * https://docs.apify.com/api/v2#/reference/actor-tasks/webhook-collection
123
+ * Returns a client for the Webhooks of this Task.
124
+ *
125
+ * @returns A client for the task's webhooks.
126
+ * @see https://docs.apify.com/api/v2/actor-task-webhooks-get
55
127
  */
56
128
  webhooks(): WebhookCollectionClient;
57
129
  }
130
+ /**
131
+ * Represents an Actor task.
132
+ *
133
+ * Tasks are saved Actor configurations with input and settings that can be executed
134
+ * repeatedly without having to specify the full input each time.
135
+ */
58
136
  export interface Task {
59
137
  id: string;
60
138
  userId: string;
@@ -70,20 +148,41 @@ export interface Task {
70
148
  input?: Dictionary | Dictionary[];
71
149
  actorStandby?: Partial<ActorStandby>;
72
150
  }
151
+ /**
152
+ * Statistics about Actor task usage.
153
+ */
73
154
  export interface TaskStats {
74
155
  totalRuns: number;
75
156
  }
157
+ /**
158
+ * Configuration options for an Actor task.
159
+ */
76
160
  export interface TaskOptions {
77
161
  build?: string;
78
162
  timeoutSecs?: number;
79
163
  memoryMbytes?: number;
80
164
  restartOnError?: boolean;
81
165
  }
166
+ /**
167
+ * Fields that can be updated when modifying a Task.
168
+ */
82
169
  export type TaskUpdateData = Partial<Pick<Task, 'name' | 'title' | 'description' | 'options' | 'input' | 'actorStandby'>>;
170
+ /**
171
+ * Options for filtering the last run of a Task.
172
+ */
83
173
  export interface TaskLastRunOptions {
84
174
  status?: keyof typeof ACT_JOB_STATUSES;
85
175
  }
176
+ /**
177
+ * Options for starting a Task.
178
+ *
179
+ * Similar to {@link ActorStartOptions} but without contentType (Task input is predefined)
180
+ * and forcePermissionLevel.
181
+ */
86
182
  export type TaskStartOptions = Omit<ActorStartOptions, 'contentType' | 'forcePermissionLevel'>;
183
+ /**
184
+ * Options for calling a Task and waiting for it to finish.
185
+ */
87
186
  export interface TaskCallOptions extends Omit<TaskStartOptions, 'waitForFinish'> {
88
187
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