apify-client 2.1.0-beta.0 → 2.1.0

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/CHANGELOG.md CHANGED
@@ -1,10 +1,8 @@
1
- 2.1.0 / 2022/01/24
1
+ 2.1.0 / 2022/01/26
2
2
  ===================
3
3
  - Added `ActorEnvVarCollectionClient` and `ActorEnvVarClient`
4
-
5
- 2.0.8 / 2022/01/13
6
- ===================
7
4
  - Add export for `PaginatedList` interface.
5
+ - Experimental: Add method for request queue batch requests insert endpoint
8
6
 
9
7
  2.0.7 / 2022/01/10
10
8
  ===================
@@ -30,6 +28,16 @@
30
28
 
31
29
  2.0.1 / 2021/10/07
32
30
  ===================
31
+ - BREAKING CHANGE: Remove default export for ApifyClient.
32
+ Migration from v1.x.x to v2.x.x:
33
+ ```javascript
34
+ // v2.x.x
35
+ const { ApifyClient } = require('apify-client');
36
+
37
+ // v1.x.x
38
+ const ApifyClient = require('apify-client');
39
+
40
+ ```
33
41
  - TypeScript rewrite
34
42
  - Fix: Exposing token on ApifyClient instance
35
43
  - Changed passing token using request HTTP header instead of the request parameter for every API calls
package/README.md CHANGED
@@ -19,7 +19,7 @@ automatic retries and convenience functions that improve the experience of using
19
19
 
20
20
  ## Quick Start
21
21
  ```js
22
- const ApifyClient = require('apify-client');
22
+ const { ApifyClient } = require('apify-client');
23
23
 
24
24
  const client = new ApifyClient({
25
25
  token: 'MY-APIFY-TOKEN',
@@ -60,7 +60,7 @@ resources are created. There are two types of those clients. A client for manage
60
60
  resource and a client for a collection of resources.
61
61
 
62
62
  ```js
63
- const ApifyClient = require('apify-client');
63
+ const { ApifyClient } = require('apify-client');
64
64
  const apifyClient = new ApifyClient({ token: 'my-token' });
65
65
 
66
66
  // Collection clients do not require a parameter.
@@ -171,13 +171,13 @@ JavaScript applications. It runs both in Node.js and browser.
171
171
 
172
172
  | Param | Type | Default |
173
173
  | --- | --- | --- |
174
- | [options] | <code>object</code> | |
175
- | [options.baseUrl] | <code>string</code> | <code>&quot;https://api.apify.com&quot;</code> |
176
- | [options.maxRetries] | <code>number</code> | <code>8</code> |
177
- | [options.minDelayBetweenRetriesMillis] | <code>number</code> | <code>500</code> |
178
- | [options.requestInterceptors] | <code>Array.&lt;function()&gt;</code> | |
179
- | [options.timeoutSecs] | <code>number</code> | |
180
- | [options.token] | <code>string</code> | |
174
+ | [options] | <code>object</code> | |
175
+ | [options.baseUrl] | <code>string</code> | <code>&quot;https://api.apify.com&quot;</code> |
176
+ | [options.maxRetries] | <code>number</code> | <code>8</code> |
177
+ | [options.minDelayBetweenRetriesMillis] | <code>number</code> | <code>500</code> |
178
+ | [options.requestInterceptors] | <code>Array.&lt;function()&gt;</code> | |
179
+ | [options.timeoutSecs] | <code>number</code> | |
180
+ | [options.token] | <code>string</code> | |
181
181
 
182
182
 
183
183
  * * *
@@ -200,7 +200,7 @@ https://docs.apify.com/api/v2#/reference/actors/actor-object
200
200
 
201
201
  | Param | Type |
202
202
  | --- | --- |
203
- | id | <code>string</code> |
203
+ | id | <code>string</code> |
204
204
 
205
205
 
206
206
  * * *
@@ -214,7 +214,7 @@ https://docs.apify.com/api/v2#/reference/actor-builds/build-object
214
214
 
215
215
  | Param | Type |
216
216
  | --- | --- |
217
- | id | <code>string</code> |
217
+ | id | <code>string</code> |
218
218
 
219
219
 
220
220
  * * *
@@ -237,7 +237,7 @@ https://docs.apify.com/api/v2#/reference/datasets/dataset
237
237
 
238
238
  | Param | Type |
239
239
  | --- | --- |
240
- | id | <code>string</code> |
240
+ | id | <code>string</code> |
241
241
 
242
242
 
243
243
  * * *
@@ -260,7 +260,7 @@ https://docs.apify.com/api/v2#/reference/key-value-stores/store-object
260
260
 
261
261
  | Param | Type |
262
262
  | --- | --- |
263
- | id | <code>string</code> |
263
+ | id | <code>string</code> |
264
264
 
265
265
 
266
266
  * * *
@@ -274,7 +274,7 @@ https://docs.apify.com/api/v2#/reference/logs
274
274
 
275
275
  | Param | Type |
276
276
  | --- | --- |
277
- | buildOrRunId | <code>string</code> |
277
+ | buildOrRunId | <code>string</code> |
278
278
 
279
279
 
280
280
  * * *
@@ -297,9 +297,9 @@ https://docs.apify.com/api/v2#/reference/request-queues/queue
297
297
 
298
298
  | Param | Type |
299
299
  | --- | --- |
300
- | id | <code>string</code> |
301
- | [options] | <code>object</code> |
302
- | [options.clientKey] | <code>object</code> |
300
+ | id | <code>string</code> |
301
+ | [options] | <code>object</code> |
302
+ | [options.clientKey] | <code>object</code> |
303
303
 
304
304
 
305
305
  * * *
@@ -313,7 +313,7 @@ https://docs.apify.com/api/v2#/reference/actor-runs/run-object-and-its-storages
313
313
 
314
314
  | Param | Type |
315
315
  | --- | --- |
316
- | id | <code>string</code> |
316
+ | id | <code>string</code> |
317
317
 
318
318
 
319
319
  * * *
@@ -336,7 +336,7 @@ https://docs.apify.com/api/v2#/reference/actor-tasks/task-object
336
336
 
337
337
  | Param | Type |
338
338
  | --- | --- |
339
- | id | <code>string</code> |
339
+ | id | <code>string</code> |
340
340
 
341
341
 
342
342
  * * *
@@ -359,7 +359,7 @@ https://docs.apify.com/api/v2#/reference/schedules/schedule-object
359
359
 
360
360
  | Param | Type |
361
361
  | --- | --- |
362
- | id | <code>string</code> |
362
+ | id | <code>string</code> |
363
363
 
364
364
 
365
365
  * * *
@@ -373,7 +373,7 @@ https://docs.apify.com/api/v2#/reference/users
373
373
 
374
374
  | Param | Type |
375
375
  | --- | --- |
376
- | id | <code>string</code> |
376
+ | id | <code>string</code> |
377
377
 
378
378
 
379
379
  * * *
@@ -396,7 +396,7 @@ https://docs.apify.com/api/v2#/reference/webhooks/webhook-object
396
396
 
397
397
  | Param | Type |
398
398
  | --- | --- |
399
- | id | <code>string</code> |
399
+ | id | <code>string</code> |
400
400
 
401
401
 
402
402
  * * *
@@ -419,7 +419,7 @@ https://docs.apify.com/api/v2#/reference/webhook-dispatches/webhook-dispatch-obj
419
419
 
420
420
  | Param | Type |
421
421
  | --- | --- |
422
- | id | <code>string</code> |
422
+ | id | <code>string</code> |
423
423
 
424
424
 
425
425
  * * *
@@ -481,12 +481,12 @@ https://docs.apify.com/api/v2#/reference/actors/build-collection/build-actor
481
481
 
482
482
  | Param | Type |
483
483
  | --- | --- |
484
- | versionNumber | <code>string</code> |
485
- | [options] | <code>object</code> |
486
- | [options.betaPackages] | <code>boolean</code> |
487
- | [options.tag] | <code>string</code> |
488
- | [options.useCache] | <code>boolean</code> |
489
- | [options.waitForFinish] | <code>number</code> |
484
+ | versionNumber | <code>string</code> |
485
+ | [options] | <code>object</code> |
486
+ | [options.betaPackages] | <code>boolean</code> |
487
+ | [options.tag] | <code>string</code> |
488
+ | [options.useCache] | <code>boolean</code> |
489
+ | [options.waitForFinish] | <code>number</code> |
490
490
 
491
491
 
492
492
  * * *
@@ -511,14 +511,14 @@ https://docs.apify.com/api/v2#/reference/actors/run-collection/run-actor
511
511
 
512
512
  | Param | Type |
513
513
  | --- | --- |
514
- | [input] | <code>\*</code> |
515
- | [options] | <code>object</code> |
516
- | [options.build] | <code>string</code> |
517
- | [options.contentType] | <code>string</code> |
518
- | [options.memory] | <code>number</code> |
519
- | [options.timeout] | <code>number</code> |
520
- | [options.waitSecs] | <code>number</code> |
521
- | [options.webhooks] | <code>Array.&lt;object&gt;</code> |
514
+ | [input] | <code>\*</code> |
515
+ | [options] | <code>object</code> |
516
+ | [options.build] | <code>string</code> |
517
+ | [options.contentType] | <code>string</code> |
518
+ | [options.memory] | <code>number</code> |
519
+ | [options.timeout] | <code>number</code> |
520
+ | [options.waitSecs] | <code>number</code> |
521
+ | [options.webhooks] | <code>Array.&lt;object&gt;</code> |
522
522
 
523
523
 
524
524
  * * *
@@ -550,8 +550,8 @@ https://docs.apify.com/api/v2#/reference/actors/last-run-object-and-its-storages
550
550
 
551
551
  | Param | Type |
552
552
  | --- | --- |
553
- | [options] | <code>object</code> |
554
- | [options.status] | <code>string</code> |
553
+ | [options] | <code>object</code> |
554
+ | [options.status] | <code>string</code> |
555
555
 
556
556
 
557
557
  * * *
@@ -575,14 +575,14 @@ https://docs.apify.com/api/v2#/reference/actors/run-collection/run-actor
575
575
 
576
576
  | Param | Type |
577
577
  | --- | --- |
578
- | [input] | <code>\*</code> |
579
- | [options] | <code>object</code> |
580
- | [options.build] | <code>string</code> |
581
- | [options.contentType] | <code>string</code> |
582
- | [options.memory] | <code>number</code> |
583
- | [options.timeout] | <code>number</code> |
584
- | [options.waitForFinish] | <code>number</code> |
585
- | [options.webhooks] | <code>Array.&lt;object&gt;</code> |
578
+ | [input] | <code>\*</code> |
579
+ | [options] | <code>object</code> |
580
+ | [options.build] | <code>string</code> |
581
+ | [options.contentType] | <code>string</code> |
582
+ | [options.memory] | <code>number</code> |
583
+ | [options.timeout] | <code>number</code> |
584
+ | [options.waitForFinish] | <code>number</code> |
585
+ | [options.webhooks] | <code>Array.&lt;object&gt;</code> |
586
586
 
587
587
 
588
588
  * * *
@@ -596,7 +596,7 @@ https://docs.apify.com/api/v2#/reference/actors/actor-object/update-actor
596
596
 
597
597
  | Param | Type |
598
598
  | --- | --- |
599
- | newFields | <code>object</code> |
599
+ | newFields | <code>object</code> |
600
600
 
601
601
 
602
602
  * * *
@@ -610,7 +610,7 @@ https://docs.apify.com/api/v2#/reference/actors/version-object
610
610
 
611
611
  | Param | Type |
612
612
  | --- | --- |
613
- | versionNumber | <code>string</code> |
613
+ | versionNumber | <code>string</code> |
614
614
 
615
615
 
616
616
  * * *
@@ -654,7 +654,7 @@ https://docs.apify.com/api/v2#/reference/actors/actor-collection/create-actor
654
654
 
655
655
  | Param | Type |
656
656
  | --- | --- |
657
- | [actor] | <code>object</code> |
657
+ | [actor] | <code>object</code> |
658
658
 
659
659
 
660
660
  * * *
@@ -668,11 +668,11 @@ https://docs.apify.com/api/v2#/reference/actors/actor-collection/get-list-of-act
668
668
 
669
669
  | Param | Type |
670
670
  | --- | --- |
671
- | [options] | <code>object</code> |
672
- | [options.my] | <code>boolean</code> |
673
- | [options.limit] | <code>number</code> |
674
- | [options.offset] | <code>number</code> |
675
- | [options.desc] | <code>boolean</code> |
671
+ | [options] | <code>object</code> |
672
+ | [options.my] | <code>boolean</code> |
673
+ | [options.limit] | <code>number</code> |
674
+ | [options.offset] | <code>number</code> |
675
+ | [options.desc] | <code>boolean</code> |
676
676
 
677
677
 
678
678
  * * *
@@ -717,7 +717,7 @@ https://docs.apify.com/api/v2#/reference/actors/version-object/update-version
717
717
 
718
718
  | Param | Type |
719
719
  | --- | --- |
720
- | newFields | <code>object</code> |
720
+ | newFields | <code>object</code> |
721
721
 
722
722
 
723
723
  * * *
@@ -743,7 +743,7 @@ https://docs.apify.com/api/v2#/reference/actors/version-collection/create-versio
743
743
 
744
744
  | Param | Type |
745
745
  | --- | --- |
746
- | [actorVersion] | <code>object</code> |
746
+ | [actorVersion] | <code>object</code> |
747
747
 
748
748
 
749
749
  * * *
@@ -757,10 +757,10 @@ https://docs.apify.com/api/v2#/reference/actors/version-collection/get-list-of-v
757
757
 
758
758
  | Param | Type |
759
759
  | --- | --- |
760
- | [options] | <code>object</code> |
761
- | [options.limit] | <code>number</code> |
762
- | [options.offset] | <code>number</code> |
763
- | [options.desc] | <code>boolean</code> |
760
+ | [options] | <code>object</code> |
761
+ | [options.limit] | <code>number</code> |
762
+ | [options.offset] | <code>number</code> |
763
+ | [options.desc] | <code>boolean</code> |
764
764
 
765
765
 
766
766
  * * *
@@ -796,8 +796,8 @@ https://docs.apify.com/api/v2#/reference/actor-builds/build-object/get-build
796
796
 
797
797
  | Param | Type |
798
798
  | --- | --- |
799
- | [options] | <code>object</code> |
800
- | [options.waitForFinish] | <code>number</code> |
799
+ | [options] | <code>object</code> |
800
+ | [options.waitForFinish] | <code>number</code> |
801
801
 
802
802
 
803
803
  * * *
@@ -841,10 +841,10 @@ https://docs.apify.com/api/v2#/reference/actors/build-collection/get-list-of-bui
841
841
 
842
842
  | Param | Type |
843
843
  | --- | --- |
844
- | [options] | <code>object</code> |
845
- | [options.limit] | <code>number</code> |
846
- | [options.offset] | <code>number</code> |
847
- | [options.desc] | <code>boolean</code> |
844
+ | [options] | <code>object</code> |
845
+ | [options.limit] | <code>number</code> |
846
+ | [options.offset] | <code>number</code> |
847
+ | [options.desc] | <code>boolean</code> |
848
848
 
849
849
 
850
850
  * * *
@@ -924,16 +924,16 @@ https://docs.apify.com/api/v2#/reference/datasets/item-collection/get-items
924
924
 
925
925
  | Param | Type |
926
926
  | --- | --- |
927
- | [options] | <code>object</code> |
928
- | [options.clean] | <code>boolean</code> |
929
- | [options.desc] | <code>boolean</code> |
930
- | [options.fields] | <code>Array.&lt;string&gt;</code> |
931
- | [options.omit] | <code>Array.&lt;string&gt;</code> |
932
- | [options.limit] | <code>number</code> |
933
- | [options.offset] | <code>number</code> |
934
- | [options.skipEmpty] | <code>boolean</code> |
935
- | [options.skipHidden] | <code>boolean</code> |
936
- | [options.unwind] | <code>string</code> |
927
+ | [options] | <code>object</code> |
928
+ | [options.clean] | <code>boolean</code> |
929
+ | [options.desc] | <code>boolean</code> |
930
+ | [options.fields] | <code>Array.&lt;string&gt;</code> |
931
+ | [options.omit] | <code>Array.&lt;string&gt;</code> |
932
+ | [options.limit] | <code>number</code> |
933
+ | [options.offset] | <code>number</code> |
934
+ | [options.skipEmpty] | <code>boolean</code> |
935
+ | [options.skipHidden] | <code>boolean</code> |
936
+ | [options.unwind] | <code>string</code> |
937
937
 
938
938
 
939
939
  * * *
@@ -947,7 +947,7 @@ https://docs.apify.com/api/v2#/reference/datasets/item-collection/put-items
947
947
 
948
948
  | Param | Type |
949
949
  | --- | --- |
950
- | items | <code>object</code> \| <code>string</code> \| <code>Array.&lt;(object\|string)&gt;</code> |
950
+ | items | <code>object</code> \| <code>string</code> \| <code>Array.&lt;(object\|string)&gt;</code> |
951
951
 
952
952
 
953
953
  * * *
@@ -961,7 +961,7 @@ https://docs.apify.com/api/v2#/reference/datasets/dataset/update-dataset
961
961
 
962
962
  | Param | Type |
963
963
  | --- | --- |
964
- | newFields | <code>object</code> |
964
+ | newFields | <code>object</code> |
965
965
 
966
966
 
967
967
  * * *
@@ -987,7 +987,7 @@ https://docs.apify.com/api/v2#/reference/datasets/dataset-collection/create-data
987
987
 
988
988
  | Param | Type |
989
989
  | --- | --- |
990
- | [name] | <code>string</code> |
990
+ | [name] | <code>string</code> |
991
991
 
992
992
 
993
993
  * * *
@@ -1001,11 +1001,11 @@ https://docs.apify.com/api/v2#/reference/datasets/dataset-collection/get-list-of
1001
1001
 
1002
1002
  | Param | Type |
1003
1003
  | --- | --- |
1004
- | [options] | <code>object</code> |
1005
- | [options.unnamed] | <code>boolean</code> |
1006
- | [options.limit] | <code>number</code> |
1007
- | [options.offset] | <code>number</code> |
1008
- | [options.desc] | <code>boolean</code> |
1004
+ | [options] | <code>object</code> |
1005
+ | [options.unnamed] | <code>boolean</code> |
1006
+ | [options.limit] | <code>number</code> |
1007
+ | [options.offset] | <code>number</code> |
1008
+ | [options.desc] | <code>boolean</code> |
1009
1009
 
1010
1010
 
1011
1011
  * * *
@@ -1045,7 +1045,7 @@ https://docs.apify.com/api/v2#/reference/key-value-stores/record/delete-record
1045
1045
 
1046
1046
  | Param | Type |
1047
1047
  | --- | --- |
1048
- | key | <code>string</code> |
1048
+ | key | <code>string</code> |
1049
1049
 
1050
1050
 
1051
1051
  * * *
@@ -1074,10 +1074,10 @@ https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record
1074
1074
 
1075
1075
  | Param | Type |
1076
1076
  | --- | --- |
1077
- | key | <code>string</code> |
1078
- | [options] | <code>object</code> |
1079
- | [options.buffer] | <code>boolean</code> |
1080
- | [options.stream] | <code>boolean</code> |
1077
+ | key | <code>string</code> |
1078
+ | [options] | <code>object</code> |
1079
+ | [options.buffer] | <code>boolean</code> |
1080
+ | [options.stream] | <code>boolean</code> |
1081
1081
 
1082
1082
 
1083
1083
  * * *
@@ -1091,9 +1091,9 @@ https://docs.apify.com/api/v2#/reference/key-value-stores/key-collection/get-lis
1091
1091
 
1092
1092
  | Param | Type |
1093
1093
  | --- | --- |
1094
- | [options] | <code>object</code> |
1095
- | [options.limit] | <code>object</code> |
1096
- | [options.exclusiveStartKey] | <code>string</code> |
1094
+ | [options] | <code>object</code> |
1095
+ | [options.limit] | <code>object</code> |
1096
+ | [options.exclusiveStartKey] | <code>string</code> |
1097
1097
 
1098
1098
 
1099
1099
  * * *
@@ -1107,7 +1107,7 @@ https://docs.apify.com/api/v2#/reference/key-value-stores/record/put-record
1107
1107
 
1108
1108
  | Param | Type |
1109
1109
  | --- | --- |
1110
- | record | [<code>KeyValueStoreRecord</code>](#KeyValueStoreRecord) |
1110
+ | record | [<code>KeyValueStoreRecord</code>](#KeyValueStoreRecord) |
1111
1111
 
1112
1112
 
1113
1113
  * * *
@@ -1121,7 +1121,7 @@ https://docs.apify.com/api/v2#/reference/key-value-stores/store-object/update-st
1121
1121
 
1122
1122
  | Param | Type |
1123
1123
  | --- | --- |
1124
- | newFields | <code>object</code> |
1124
+ | newFields | <code>object</code> |
1125
1125
 
1126
1126
 
1127
1127
  * * *
@@ -1147,7 +1147,7 @@ https://docs.apify.com/api/v2#/reference/key-value-stores/store-collection/creat
1147
1147
 
1148
1148
  | Param | Type |
1149
1149
  | --- | --- |
1150
- | [name] | <code>string</code> |
1150
+ | [name] | <code>string</code> |
1151
1151
 
1152
1152
 
1153
1153
  * * *
@@ -1161,11 +1161,11 @@ https://docs.apify.com/api/v2#/reference/key-value-stores/store-collection/get-l
1161
1161
 
1162
1162
  | Param | Type |
1163
1163
  | --- | --- |
1164
- | [options] | <code>object</code> |
1165
- | [options.unnamed] | <code>boolean</code> |
1166
- | [options.limit] | <code>number</code> |
1167
- | [options.offset] | <code>number</code> |
1168
- | [options.desc] | <code>boolean</code> |
1164
+ | [options] | <code>object</code> |
1165
+ | [options.unnamed] | <code>boolean</code> |
1166
+ | [options.limit] | <code>number</code> |
1167
+ | [options.offset] | <code>number</code> |
1168
+ | [options.desc] | <code>boolean</code> |
1169
1169
 
1170
1170
 
1171
1171
  * * *
@@ -1178,9 +1178,9 @@ https://docs.apify.com/api/v2#/reference/key-value-stores/store-collection/get-l
1178
1178
 
1179
1179
  | Name | Type |
1180
1180
  | --- | --- |
1181
- | key | <code>string</code> |
1182
- | value | <code>null</code> \| <code>string</code> \| <code>number</code> \| <code>object</code> |
1183
- | [contentType] | <code>string</code> |
1181
+ | key | <code>string</code> |
1182
+ | value | <code>null</code> \| <code>string</code> \| <code>number</code> \| <code>object</code> |
1183
+ | [contentType] | <code>string</code> |
1184
1184
 
1185
1185
 
1186
1186
  * * *
@@ -1260,9 +1260,9 @@ https://docs.apify.com/api/v2#/reference/request-queues/request-collection/add-r
1260
1260
 
1261
1261
  | Param | Type |
1262
1262
  | --- | --- |
1263
- | request | <code>object</code> |
1264
- | [options] | <code>object</code> |
1265
- | [options.forefront] | <code>boolean</code> |
1263
+ | request | <code>object</code> |
1264
+ | [options] | <code>object</code> |
1265
+ | [options.forefront] | <code>boolean</code> |
1266
1266
 
1267
1267
 
1268
1268
  * * *
@@ -1283,7 +1283,7 @@ https://docs.apify.com/api/v2#/reference/request-queues/queue/delete-request-que
1283
1283
 
1284
1284
  | Param | Type |
1285
1285
  | --- | --- |
1286
- | id | <code>string</code> |
1286
+ | id | <code>string</code> |
1287
1287
 
1288
1288
 
1289
1289
  * * *
@@ -1306,7 +1306,7 @@ https://docs.apify.com/api/v2#/reference/request-queues/request/get-request
1306
1306
 
1307
1307
  | Param | Type |
1308
1308
  | --- | --- |
1309
- | id | <code>string</code> |
1309
+ | id | <code>string</code> |
1310
1310
 
1311
1311
 
1312
1312
  * * *
@@ -1320,8 +1320,8 @@ https://docs.apify.com/api/v2#/reference/request-queues/queue-head/get-head
1320
1320
 
1321
1321
  | Param | Type |
1322
1322
  | --- | --- |
1323
- | [options] | <code>object</code> |
1324
- | [options.limit] | <code>number</code> |
1323
+ | [options] | <code>object</code> |
1324
+ | [options.limit] | <code>number</code> |
1325
1325
 
1326
1326
 
1327
1327
  * * *
@@ -1335,7 +1335,7 @@ https://docs.apify.com/api/v2#/reference/request-queues/queue/update-request-que
1335
1335
 
1336
1336
  | Param | Type |
1337
1337
  | --- | --- |
1338
- | newFields | <code>object</code> |
1338
+ | newFields | <code>object</code> |
1339
1339
 
1340
1340
 
1341
1341
  * * *
@@ -1349,9 +1349,9 @@ https://docs.apify.com/api/v2#/reference/request-queues/request/update-request
1349
1349
 
1350
1350
  | Param | Type |
1351
1351
  | --- | --- |
1352
- | request | <code>object</code> |
1353
- | [options] | <code>object</code> |
1354
- | [options.forefront] | <code>boolean</code> |
1352
+ | request | <code>object</code> |
1353
+ | [options] | <code>object</code> |
1354
+ | [options.forefront] | <code>boolean</code> |
1355
1355
 
1356
1356
 
1357
1357
  * * *
@@ -1377,7 +1377,7 @@ https://docs.apify.com/api/v2#/reference/request-queues/queue-collection/create-
1377
1377
 
1378
1378
  | Param | Type |
1379
1379
  | --- | --- |
1380
- | [name] | <code>string</code> |
1380
+ | [name] | <code>string</code> |
1381
1381
 
1382
1382
 
1383
1383
  * * *
@@ -1391,11 +1391,11 @@ https://docs.apify.com/api/v2#/reference/request-queues/queue-collection/get-lis
1391
1391
 
1392
1392
  | Param | Type |
1393
1393
  | --- | --- |
1394
- | [options] | <code>object</code> |
1395
- | [options.unnamed] | <code>boolean</code> |
1396
- | [options.limit] | <code>number</code> |
1397
- | [options.offset] | <code>number</code> |
1398
- | [options.desc] | <code>boolean</code> |
1394
+ | [options] | <code>object</code> |
1395
+ | [options.unnamed] | <code>boolean</code> |
1396
+ | [options.limit] | <code>number</code> |
1397
+ | [options.offset] | <code>number</code> |
1398
+ | [options.desc] | <code>boolean</code> |
1399
1399
 
1400
1400
 
1401
1401
  * * *
@@ -1449,8 +1449,8 @@ https://docs.apify.com/api/v2#/reference/actor-runs/run-object/get-run
1449
1449
 
1450
1450
  | Param | Type |
1451
1451
  | --- | --- |
1452
- | [options] | <code>object</code> |
1453
- | [options.waitForFinish] | <code>number</code> |
1452
+ | [options] | <code>object</code> |
1453
+ | [options.waitForFinish] | <code>number</code> |
1454
1454
 
1455
1455
 
1456
1456
  * * *
@@ -1488,11 +1488,11 @@ https://docs.apify.com/api/v2#/reference/actor-runs/metamorph-run/metamorph-run
1488
1488
 
1489
1489
  | Param | Type |
1490
1490
  | --- | --- |
1491
- | targetActorId | <code>string</code> |
1492
- | [input] | <code>\*</code> |
1493
- | [options] | <code>object</code> |
1494
- | [options.contentType] | <code>object</code> |
1495
- | [options.build] | <code>object</code> |
1491
+ | targetActorId | <code>string</code> |
1492
+ | [input] | <code>\*</code> |
1493
+ | [options] | <code>object</code> |
1494
+ | [options.contentType] | <code>object</code> |
1495
+ | [options.build] | <code>object</code> |
1496
1496
 
1497
1497
 
1498
1498
  * * *
@@ -1518,10 +1518,10 @@ https://docs.apify.com/api/v2#/reference/actor-runs/resurrect-run/resurrect-run
1518
1518
 
1519
1519
  | Param | Type |
1520
1520
  | --- | --- |
1521
- | [options] | <code>object</code> |
1522
- | [options.build] | <code>string</code> |
1523
- | [options.memory] | <code>number</code> |
1524
- | [options.timeout] | <code>number</code> |
1521
+ | [options] | <code>object</code> |
1522
+ | [options.build] | <code>string</code> |
1523
+ | [options.memory] | <code>number</code> |
1524
+ | [options.timeout] | <code>number</code> |
1525
1525
 
1526
1526
 
1527
1527
  * * *
@@ -1566,11 +1566,11 @@ https://docs.apify.com/api/v2#/reference/actors/run-collection/get-list-of-runs
1566
1566
 
1567
1567
  | Param | Type |
1568
1568
  | --- | --- |
1569
- | [options] | <code>object</code> |
1570
- | [options.limit] | <code>number</code> |
1571
- | [options.offset] | <code>number</code> |
1572
- | [options.desc] | <code>boolean</code> |
1573
- | [options.status] | <code>boolean</code> |
1569
+ | [options] | <code>object</code> |
1570
+ | [options.limit] | <code>number</code> |
1571
+ | [options.offset] | <code>number</code> |
1572
+ | [options.desc] | <code>boolean</code> |
1573
+ | [options.status] | <code>boolean</code> |
1574
1574
 
1575
1575
 
1576
1576
  * * *
@@ -1625,7 +1625,7 @@ https://docs.apify.com/api/v2#/reference/schedules/schedule-object/update-schedu
1625
1625
 
1626
1626
  | Param | Type |
1627
1627
  | --- | --- |
1628
- | newFields | <code>object</code> |
1628
+ | newFields | <code>object</code> |
1629
1629
 
1630
1630
 
1631
1631
  * * *
@@ -1651,7 +1651,7 @@ https://docs.apify.com/api/v2#/reference/schedules/schedules-collection/create-s
1651
1651
 
1652
1652
  | Param | Type |
1653
1653
  | --- | --- |
1654
- | [schedule] | <code>object</code> |
1654
+ | [schedule] | <code>object</code> |
1655
1655
 
1656
1656
 
1657
1657
  * * *
@@ -1665,10 +1665,10 @@ https://docs.apify.com/api/v2#/reference/schedules/schedules-collection/get-list
1665
1665
 
1666
1666
  | Param | Type |
1667
1667
  | --- | --- |
1668
- | [options] | <code>object</code> |
1669
- | [options.limit] | <code>number</code> |
1670
- | [options.offset] | <code>number</code> |
1671
- | [options.desc] | <code>boolean</code> |
1668
+ | [options] | <code>object</code> |
1669
+ | [options.limit] | <code>number</code> |
1670
+ | [options.offset] | <code>number</code> |
1671
+ | [options.desc] | <code>boolean</code> |
1672
1672
 
1673
1673
 
1674
1674
  * * *
@@ -1704,13 +1704,13 @@ https://docs.apify.com/api/v2#/reference/actor-tasks/run-collection/run-task
1704
1704
 
1705
1705
  | Param | Type |
1706
1706
  | --- | --- |
1707
- | [input] | <code>object</code> |
1708
- | [options] | <code>object</code> |
1709
- | [options.build] | <code>string</code> |
1710
- | [options.memory] | <code>number</code> |
1711
- | [options.timeout] | <code>number</code> |
1712
- | [options.waitSecs] | <code>number</code> |
1713
- | [options.webhooks] | <code>Array.&lt;object&gt;</code> |
1707
+ | [input] | <code>object</code> |
1708
+ | [options] | <code>object</code> |
1709
+ | [options.build] | <code>string</code> |
1710
+ | [options.memory] | <code>number</code> |
1711
+ | [options.timeout] | <code>number</code> |
1712
+ | [options.waitSecs] | <code>number</code> |
1713
+ | [options.webhooks] | <code>Array.&lt;object&gt;</code> |
1714
1714
 
1715
1715
 
1716
1716
  * * *
@@ -1751,8 +1751,8 @@ https://docs.apify.com/api/v2#/reference/actor-tasks/last-run-object-and-its-sto
1751
1751
 
1752
1752
  | Param | Type |
1753
1753
  | --- | --- |
1754
- | options | <code>object</code> |
1755
- | options.status | <code>string</code> |
1754
+ | options | <code>object</code> |
1755
+ | options.status | <code>string</code> |
1756
1756
 
1757
1757
 
1758
1758
  * * *
@@ -1776,13 +1776,13 @@ https://docs.apify.com/api/v2#/reference/actor-tasks/run-collection/run-task
1776
1776
 
1777
1777
  | Param | Type |
1778
1778
  | --- | --- |
1779
- | [input] | <code>object</code> |
1780
- | [options] | <code>object</code> |
1781
- | [options.build] | <code>string</code> |
1782
- | [options.memory] | <code>number</code> |
1783
- | [options.timeout] | <code>number</code> |
1784
- | [options.waitForFinish] | <code>number</code> |
1785
- | [options.webhooks] | <code>Array.&lt;object&gt;</code> |
1779
+ | [input] | <code>object</code> |
1780
+ | [options] | <code>object</code> |
1781
+ | [options.build] | <code>string</code> |
1782
+ | [options.memory] | <code>number</code> |
1783
+ | [options.timeout] | <code>number</code> |
1784
+ | [options.waitForFinish] | <code>number</code> |
1785
+ | [options.webhooks] | <code>Array.&lt;object&gt;</code> |
1786
1786
 
1787
1787
 
1788
1788
  * * *
@@ -1796,7 +1796,7 @@ https://docs.apify.com/api/v2#/reference/actor-tasks/task-object/update-task
1796
1796
 
1797
1797
  | Param | Type |
1798
1798
  | --- | --- |
1799
- | newFields | <code>object</code> |
1799
+ | newFields | <code>object</code> |
1800
1800
 
1801
1801
 
1802
1802
  * * *
@@ -1840,7 +1840,7 @@ https://docs.apify.com/api/v2#/reference/actor-tasks/task-collection/create-task
1840
1840
 
1841
1841
  | Param | Type |
1842
1842
  | --- | --- |
1843
- | [task] | <code>object</code> |
1843
+ | [task] | <code>object</code> |
1844
1844
 
1845
1845
 
1846
1846
  * * *
@@ -1854,10 +1854,10 @@ https://docs.apify.com/api/v2#/reference/actor-tasks/task-collection/get-list-of
1854
1854
 
1855
1855
  | Param | Type |
1856
1856
  | --- | --- |
1857
- | [options] | <code>object</code> |
1858
- | [options.limit] | <code>number</code> |
1859
- | [options.offset] | <code>number</code> |
1860
- | [options.desc] | <code>boolean</code> |
1857
+ | [options] | <code>object</code> |
1858
+ | [options.limit] | <code>number</code> |
1859
+ | [options.offset] | <code>number</code> |
1860
+ | [options.desc] | <code>boolean</code> |
1861
1861
 
1862
1862
 
1863
1863
  * * *
@@ -1930,7 +1930,7 @@ https://docs.apify.com/api/v2#/reference/webhooks/webhook-object/update-webhook
1930
1930
 
1931
1931
  | Param | Type |
1932
1932
  | --- | --- |
1933
- | newFields | <code>object</code> |
1933
+ | newFields | <code>object</code> |
1934
1934
 
1935
1935
 
1936
1936
  * * *
@@ -1956,7 +1956,7 @@ https://docs.apify.com/api/v2#/reference/webhooks/webhook-collection/create-webh
1956
1956
 
1957
1957
  | Param | Type |
1958
1958
  | --- | --- |
1959
- | [webhook] | <code>object</code> |
1959
+ | [webhook] | <code>object</code> |
1960
1960
 
1961
1961
 
1962
1962
  * * *
@@ -1970,10 +1970,10 @@ https://docs.apify.com/api/v2#/reference/webhooks/webhook-collection/get-list-of
1970
1970
 
1971
1971
  | Param | Type |
1972
1972
  | --- | --- |
1973
- | [options] | <code>object</code> |
1974
- | [options.limit] | <code>number</code> |
1975
- | [options.offset] | <code>number</code> |
1976
- | [options.desc] | <code>boolean</code> |
1973
+ | [options] | <code>object</code> |
1974
+ | [options.limit] | <code>number</code> |
1975
+ | [options.offset] | <code>number</code> |
1976
+ | [options.desc] | <code>boolean</code> |
1977
1977
 
1978
1978
 
1979
1979
  * * *
@@ -2010,10 +2010,10 @@ https://docs.apify.com/api/v2#/reference/webhook-dispatches/webhook-dispatches-c
2010
2010
 
2011
2011
  | Param | Type |
2012
2012
  | --- | --- |
2013
- | [options] | <code>object</code> |
2014
- | [options.limit] | <code>number</code> |
2015
- | [options.offset] | <code>number</code> |
2016
- | [options.desc] | <code>boolean</code> |
2013
+ | [options] | <code>object</code> |
2014
+ | [options.limit] | <code>number</code> |
2015
+ | [options.offset] | <code>number</code> |
2016
+ | [options.desc] | <code>boolean</code> |
2017
2017
 
2018
2018
 
2019
2019
  * * *
@@ -26,6 +26,15 @@ export declare class RequestQueueClient extends ResourceClient {
26
26
  * https://docs.apify.com/api/v2#/reference/request-queues/request-collection/add-request
27
27
  */
28
28
  addRequest(request: Omit<RequestQueueClientRequestSchema, 'id'>, options?: RequestQueueClientAddRequestOptions): Promise<RequestQueueClientAddRequestResult>;
29
+ protected _batchAddRequestsWithRetries(requests: Omit<RequestQueueClientRequestSchema, 'id'>[], options?: RequestQueueClientBatchAddRequestOptions): Promise<RequestQueueClientBatchAddRequestsResult>;
30
+ /**
31
+ * Writes multiple requests to request queue concurrently in batches.
32
+ * THIS METHOD IS EXPERIMENTAL AND NOT INTENDED FOR PRODUCTION USE.
33
+ *
34
+ * @private
35
+ * @experimental
36
+ */
37
+ batchAddRequests(requests: Omit<RequestQueueClientRequestSchema, 'id'>[], options?: RequestQueueClientBatchAddRequestOptions): Promise<RequestQueueClientBatchAddRequestsResult>;
29
38
  /**
30
39
  * https://docs.apify.com/api/v2#/reference/request-queues/request/get-request
31
40
  */
@@ -84,6 +93,9 @@ export interface RequestQueueClientListItem {
84
93
  export interface RequestQueueClientAddRequestOptions {
85
94
  forefront?: boolean;
86
95
  }
96
+ export interface RequestQueueClientBatchAddRequestOptions {
97
+ forefront?: boolean;
98
+ }
87
99
  export interface RequestQueueClientRequestSchema {
88
100
  id: string;
89
101
  uniqueKey: string;
@@ -103,6 +115,22 @@ export interface RequestQueueClientAddRequestResult {
103
115
  wasAlreadyPresent: boolean;
104
116
  wasAlreadyHandled: boolean;
105
117
  }
118
+ interface ProcessedRequest {
119
+ uniqueKey: string;
120
+ requestId: string;
121
+ wasAlreadyPresent: boolean;
122
+ wasAlreadyHandled: boolean;
123
+ }
124
+ interface UnprocessedRequest {
125
+ uniqueKey: string;
126
+ url: string;
127
+ method?: AllowedHttpMethods;
128
+ }
129
+ export interface RequestQueueClientBatchAddRequestsResult {
130
+ processedRequests: ProcessedRequest[];
131
+ unprocessedRequests: UnprocessedRequest[];
132
+ }
106
133
  export declare type RequestQueueClientGetRequestResult = Omit<RequestQueueClientListItem, 'retryCount'>;
107
134
  export declare type AllowedHttpMethods = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'TRACE' | 'OPTIONS' | 'CONNECT' | 'PATCH';
135
+ export {};
108
136
  //# sourceMappingURL=request_queue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"request_queue.d.ts","sourceRoot":"","sources":["../../src/resource_clients/request_queue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AASzD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,cAAc;IAClD,OAAO,CAAC,SAAS,CAAC,CAAS;gBAEf,OAAO,EAAE,2BAA2B,EAAE,WAAW,GAAE,uBAA4B;IAS3F;;OAEG;IACG,GAAG,IAAI,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAI9C;;OAEG;IACG,MAAM,CAAC,SAAS,EAAE,+BAA+B,GAAG,OAAO,CAAC,YAAY,CAAC;IAM/E;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAI7B;;OAEG;IACG,QAAQ,CAAC,OAAO,GAAE,iCAAsC,GAAG,OAAO,CAAC,gCAAgC,CAAC;IAiB1G;;OAEG;IACG,UAAU,CACZ,OAAO,EAAE,IAAI,CAAC,+BAA+B,EAAE,IAAI,CAAC,EACpD,OAAO,GAAE,mCAAwC,GAClD,OAAO,CAAC,kCAAkC,CAAC;IAsB9C;;OAEG;IACG,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kCAAkC,GAAG,SAAS,CAAC;IAiBrF;;OAEG;IACG,aAAa,CACf,OAAO,EAAE,+BAA+B,EACxC,OAAO,GAAE,mCAAwC,GAClD,OAAO,CAAC,kCAAkC,CAAC;IAsBxC,aA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,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAA"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RequestQueueClient = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const log_1 = (0, tslib_1.__importDefault)(require("@apify/log"));
5
6
  const ow_1 = (0, tslib_1.__importDefault)(require("ow"));
6
7
  const resource_client_1 = require("../base/resource_client");
7
8
  const utils_1 = require("../utils");
@@ -79,6 +80,95 @@ class RequestQueueClient extends resource_client_1.ResourceClient {
79
80
  });
80
81
  return (0, utils_1.cast)((0, utils_1.parseDateFields)((0, utils_1.pluckData)(response.data)));
81
82
  }
83
+ async _batchAddRequestsWithRetries(requests, options = {}) {
84
+ // Keep track of the requests that remain to be processed (in parameter format)
85
+ let remainingRequests = requests;
86
+ // Keep track of the requests that have been processed (in api format)
87
+ const processedRequests = [];
88
+ // The requests we have not been able to process in the last call
89
+ // ie. those we have not been able to process at all
90
+ let unprocessedRequests = [];
91
+ // TODO: Do not use `maxRetries` from http client, but rather a separate value
92
+ for (let i = 0; i < 1 + this.httpClient.maxRetries; i++) {
93
+ try {
94
+ const response = await this.httpClient.call({
95
+ url: this._url('requests/batch'),
96
+ method: 'POST',
97
+ data: remainingRequests,
98
+ params: this._params({
99
+ forefront: options.forefront,
100
+ clientKey: this.clientKey,
101
+ }),
102
+ });
103
+ const data = response.data.data;
104
+ processedRequests.push(...data.processedRequests);
105
+ unprocessedRequests = data.unprocessedRequests;
106
+ // Get unique keys of all requests processed so far
107
+ const processedRequestsUniqueKeys = processedRequests.map(({ uniqueKey }) => uniqueKey);
108
+ // Requests remaining to be processed are the all that remain
109
+ remainingRequests = requests.filter(({ uniqueKey }) => !processedRequestsUniqueKeys.includes(uniqueKey));
110
+ // Stop if all requests have been processed
111
+ if (remainingRequests.length === 0) {
112
+ break;
113
+ }
114
+ }
115
+ catch (err) {
116
+ log_1.default.exception(err, 'Request batch insert failed');
117
+ // When something fails and http client does not retry, the remaining requests are treated as unprocessed.
118
+ // This ensures that this method does not throw and keeps the signature.
119
+ const processedRequestsUniqueKeys = processedRequests.map(({ uniqueKey }) => uniqueKey);
120
+ unprocessedRequests = requests
121
+ .filter(({ uniqueKey }) => !processedRequestsUniqueKeys.includes(uniqueKey))
122
+ .map(({ method, uniqueKey, url }) => ({ method, uniqueKey, url }));
123
+ break;
124
+ }
125
+ // Sleep for some time before trying again
126
+ // TODO: Do not use delay from client, but rather a separate value
127
+ await new Promise((resolve) => setTimeout(resolve, this.httpClient.minDelayBetweenRetriesMillis));
128
+ }
129
+ const result = { processedRequests, unprocessedRequests };
130
+ return (0, utils_1.cast)((0, utils_1.parseDateFields)(result));
131
+ }
132
+ /**
133
+ * Writes multiple requests to request queue concurrently in batches.
134
+ * THIS METHOD IS EXPERIMENTAL AND NOT INTENDED FOR PRODUCTION USE.
135
+ *
136
+ * @private
137
+ * @experimental
138
+ */
139
+ async batchAddRequests(requests, options = {}) {
140
+ (0, ow_1.default)(requests, ow_1.default.array.ofType(ow_1.default.object.partialShape({
141
+ id: ow_1.default.undefined,
142
+ })).minLength(1));
143
+ (0, ow_1.default)(options, ow_1.default.object.exactShape({
144
+ forefront: ow_1.default.optional.boolean,
145
+ }));
146
+ // The number of 50 parallel requests seemed optimal, if it was higher it did not seem to bring any extra value.
147
+ const maxParallelRequests = 50;
148
+ const operationsInProgress = [];
149
+ const individualResults = [];
150
+ // Send up to `maxParallelRequests` requests at once, wait for all of them to finish and repeat
151
+ for (let i = 0; i < requests.length; i += 25) {
152
+ const requestsInBatch = requests.slice(i, i + 25);
153
+ operationsInProgress.push(this._batchAddRequestsWithRetries(requestsInBatch, options));
154
+ if (operationsInProgress.length === maxParallelRequests) {
155
+ individualResults.push(...(await Promise.all(operationsInProgress)));
156
+ operationsInProgress.splice(0, operationsInProgress.length);
157
+ }
158
+ }
159
+ // Get results from remaining operations
160
+ individualResults.push(...(await Promise.all(operationsInProgress)));
161
+ // Combine individual results together
162
+ const result = {
163
+ processedRequests: [],
164
+ unprocessedRequests: [],
165
+ };
166
+ individualResults.forEach(({ processedRequests, unprocessedRequests }) => {
167
+ result.processedRequests.push(...processedRequests);
168
+ result.unprocessedRequests.push(...unprocessedRequests);
169
+ });
170
+ return result;
171
+ }
82
172
  /**
83
173
  * https://docs.apify.com/api/v2#/reference/request-queues/request/get-request
84
174
  */
@@ -1 +1 @@
1
- {"version":3,"file":"request_queue.js","sourceRoot":"","sources":["../../src/resource_clients/request_queue.ts"],"names":[],"mappings":";;;;AAAA,yDAAoB;AAGpB,6DAAyD;AAEzD,oCAKkB;AAElB;;GAEG;AACH,MAAa,kBAAmB,SAAQ,gCAAc;IAGlD,YAAY,OAAoC,EAAE,cAAuC,EAAE;QACvF,KAAK,CAAC;YACF,YAAY,EAAE,gBAAgB;YAC9B,GAAG,OAAO;SACb,CAAC,CAAC;QANP;;;;;WAA2B;QAQvB,IAAI,CAAC,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,SAA0C;QACnD,IAAA,YAAE,EAAC,SAAS,EAAE,YAAE,CAAC,MAAM,CAAC,CAAC;QAEzB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,UAA6C,EAAE;QAC1D,IAAA,YAAE,EAAC,OAAO,EAAE,YAAE,CAAC,MAAM,CAAC,UAAU,CAAC;YAC7B,KAAK,EAAE,YAAE,CAAC,QAAQ,CAAC,MAAM;SAC5B,CAAC,CAAC,CAAC;QAEJ,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAA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C,CAAC,CAAC,CAAC;QAEJ,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YACxC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,OAAO,CAAC,EAAE,EAAE,CAAC;YACxC,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC;gBACjB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,SAAS,EAAE,IAAI,CAAC,SAAS;aAC5B,CAAC;SACL,CAAC,CAAC;QAEH,OAAO,IAAA,YAAI,EAAC,IAAA,uBAAe,EAAC,IAAA,iBAAS,EAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,EAAU;QAC1B,IAAA,YAAE,EAAC,EAAE,EAAE,YAAE,CAAC,MAAM,CAAC,CAAC;QAElB,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YACvB,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;YAChC,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC;gBACjB,SAAS,EAAE,IAAI,CAAC,SAAS;aAC5B,CAAC;SACL,CAAC,CAAC;IACP,CAAC;CACJ;AAzPD,gDAyPC"}
package/package.json CHANGED
@@ -1,109 +1,109 @@
1
1
  {
2
- "name": "apify-client",
3
- "version": "2.1.0-beta.0",
4
- "description": "Apify API client for JavaScript",
5
- "main": "dist/index.js",
6
- "module": "dist/index.mjs",
7
- "types": "dist/index.d.ts",
8
- "exports": {
9
- "./package.json": "./package.json",
10
- ".": {
11
- "import": "./dist/index.mjs",
12
- "require": "./dist/index.js"
13
- }
14
- },
15
- "keywords": [
16
- "apify",
17
- "api",
18
- "apifier",
19
- "crawler",
20
- "scraper"
21
- ],
22
- "author": {
23
- "name": "Apify",
24
- "email": "support@apify.com",
25
- "url": "https://apify.com"
26
- },
27
- "contributors": [
28
- "Jan Curn <jan@apify.com>",
29
- "Marek Trunkát <marek@apify.com>",
30
- "Ondra Urban <ondra@apify.com>",
31
- "Jakub Drobník <jakub.drobnik@apify.com>"
32
- ],
33
- "license": "Apache-2.0",
34
- "repository": {
35
- "type": "git",
36
- "url": "git+https://github.com/apifytech/apify-client-js"
37
- },
38
- "bugs": {
39
- "url": "https://github.com/apifytech/apify-client-js/issues"
40
- },
41
- "homepage": "https://apify.com/docs/sdk/apify-client-js/latest",
42
- "files": [
43
- "dist",
44
- "!dist/*.tsbuildinfo",
45
- "!dist/bundle.js"
46
- ],
47
- "scripts": {
48
- "build": "run-s clean build:node build:browser",
49
- "postbuild": "gen-esm-wrapper dist/index.js dist/index.mjs",
50
- "prepublishOnly": "(test $CI || (echo \"Publishing is reserved to CI!\"; exit 1))",
51
- "clean": "rimraf dist",
52
- "test": "npm run build && jest",
53
- "lint": "eslint src test --ext js,jsx,mjs,ts",
54
- "lint:fix": "eslint src test --ext js,jsx,mjs,ts --fix",
55
- "build:node": "tsc",
56
- "build:browser": "webpack",
57
- "build-docs": "npm run build-toc && node docs/build_docs.js",
58
- "build-toc": "markdown-toc docs/README.hbs -i"
59
- },
60
- "dependencies": {
61
- "@apify/consts": "^1.4.0",
62
- "@apify/log": "^1.1.1",
63
- "agentkeepalive": "^4.1.4",
64
- "async-retry": "^1.3.1",
65
- "axios": "^0.21.1",
66
- "content-type": "^1.0.4",
67
- "ow": "^0.27.0"
68
- },
69
- "devDependencies": {
70
- "@apify/eslint-config-ts": "^0.1.4",
71
- "@apify/tsconfig": "^0.1.0",
72
- "@babel/cli": "^7.14.8",
73
- "@babel/core": "^7.15.0",
74
- "@babel/preset-env": "^7.15.0",
75
- "@babel/register": "^7.15.3",
76
- "@types/async-retry": "^1.4.3",
77
- "@types/content-type": "^1.1.5",
78
- "@types/express": "^4.17.13",
79
- "@types/fs-extra": "^9.0.12",
80
- "@types/jest": "^27.0.1",
81
- "@types/node": "^16.6.1",
82
- "@typescript-eslint/eslint-plugin": "^4.29.1",
83
- "@typescript-eslint/parser": "^4.29.1",
84
- "apify": "^2.0.2",
85
- "babel-loader": "^8.2.2",
86
- "body-parser": "^1.19.0",
87
- "compression": "^1.7.4",
88
- "eslint": "^7.32.0",
89
- "express": "^4.17.1",
90
- "fs-extra": "^10.0.0",
91
- "gen-esm-wrapper": "^1.1.2",
92
- "jest": "^27.0.6",
93
- "jest-circus": "^27.0.6",
94
- "jsdoc-to-markdown": "^7.0.1",
95
- "markdown-toc": "^1.2.0",
96
- "morgan": "^1.10.0",
97
- "npm-run-all": "^4.1.5",
98
- "process": "^0.11.10",
99
- "puppeteer": "^10.2.0",
100
- "rimraf": "^3.0.2",
101
- "terser-webpack-plugin": "^5.1.4",
102
- "ts-jest": "^27.0.4",
103
- "ts-loader": "^9.2.5",
104
- "ts-node": "^10.2.0",
105
- "typescript": "^4.3.5",
106
- "webpack": "^5.50.0",
107
- "webpack-cli": "^4.7.2"
108
- }
2
+ "name": "apify-client",
3
+ "version": "2.1.0",
4
+ "description": "Apify API client for JavaScript",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ "./package.json": "./package.json",
10
+ ".": {
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ }
14
+ },
15
+ "keywords": [
16
+ "apify",
17
+ "api",
18
+ "apifier",
19
+ "crawler",
20
+ "scraper"
21
+ ],
22
+ "author": {
23
+ "name": "Apify",
24
+ "email": "support@apify.com",
25
+ "url": "https://apify.com"
26
+ },
27
+ "contributors": [
28
+ "Jan Curn <jan@apify.com>",
29
+ "Marek Trunkát <marek@apify.com>",
30
+ "Ondra Urban <ondra@apify.com>",
31
+ "Jakub Drobník <jakub.drobnik@apify.com>"
32
+ ],
33
+ "license": "Apache-2.0",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/apifytech/apify-client-js"
37
+ },
38
+ "bugs": {
39
+ "url": "https://github.com/apifytech/apify-client-js/issues"
40
+ },
41
+ "homepage": "https://apify.com/docs/sdk/apify-client-js/latest",
42
+ "files": [
43
+ "dist",
44
+ "!dist/*.tsbuildinfo",
45
+ "!dist/bundle.js"
46
+ ],
47
+ "scripts": {
48
+ "build": "run-s clean build:node build:browser",
49
+ "postbuild": "gen-esm-wrapper dist/index.js dist/index.mjs",
50
+ "prepublishOnly": "(test $CI || (echo \"Publishing is reserved to CI!\"; exit 1))",
51
+ "clean": "rimraf dist",
52
+ "test": "npm run build && jest",
53
+ "lint": "eslint src test --ext js,jsx,mjs,ts",
54
+ "lint:fix": "eslint src test --ext js,jsx,mjs,ts --fix",
55
+ "build:node": "tsc",
56
+ "build:browser": "webpack",
57
+ "build-docs": "npm run build-toc && node docs/build_docs.js",
58
+ "build-toc": "markdown-toc docs/README.hbs -i"
59
+ },
60
+ "dependencies": {
61
+ "@apify/consts": "^1.4.0",
62
+ "@apify/log": "^1.1.1",
63
+ "agentkeepalive": "^4.1.4",
64
+ "async-retry": "^1.3.1",
65
+ "axios": "^0.21.1",
66
+ "content-type": "^1.0.4",
67
+ "ow": "^0.27.0"
68
+ },
69
+ "devDependencies": {
70
+ "@apify/eslint-config-ts": "^0.1.4",
71
+ "@apify/tsconfig": "^0.1.0",
72
+ "@babel/cli": "^7.14.8",
73
+ "@babel/core": "^7.15.0",
74
+ "@babel/preset-env": "^7.15.0",
75
+ "@babel/register": "^7.15.3",
76
+ "@types/async-retry": "^1.4.3",
77
+ "@types/content-type": "^1.1.5",
78
+ "@types/express": "^4.17.13",
79
+ "@types/fs-extra": "^9.0.12",
80
+ "@types/jest": "^27.0.1",
81
+ "@types/node": "^16.6.1",
82
+ "@typescript-eslint/eslint-plugin": "^4.29.1",
83
+ "@typescript-eslint/parser": "^4.29.1",
84
+ "apify": "^2.0.2",
85
+ "babel-loader": "^8.2.2",
86
+ "body-parser": "^1.19.0",
87
+ "compression": "^1.7.4",
88
+ "eslint": "^7.32.0",
89
+ "express": "^4.17.1",
90
+ "fs-extra": "^10.0.0",
91
+ "gen-esm-wrapper": "^1.1.2",
92
+ "jest": "^27.0.6",
93
+ "jest-circus": "^27.0.6",
94
+ "jsdoc-to-markdown": "^7.0.1",
95
+ "markdown-toc": "^1.2.0",
96
+ "morgan": "^1.10.0",
97
+ "npm-run-all": "^4.1.5",
98
+ "process": "^0.11.10",
99
+ "puppeteer": "^10.2.0",
100
+ "rimraf": "^3.0.2",
101
+ "terser-webpack-plugin": "^5.1.4",
102
+ "ts-jest": "^27.0.4",
103
+ "ts-loader": "^9.2.5",
104
+ "ts-node": "^10.2.0",
105
+ "typescript": "^4.3.5",
106
+ "webpack": "^5.50.0",
107
+ "webpack-cli": "^4.7.2"
108
+ }
109
109
  }