Skip to content

Commit 29b3fc0

Browse files
Merging pull request #18308
* feat(apify): Show list of built tags in actor run action * feat(apify): Allow selecting actor search source for run Actor action and change how Actor or task name is displayed * feat(apif): Remove wait for finish prop in run Actor action * fix(apify): Fix PR issues * fix(apif): Fix PR issues * fix(scrape-single-url): return the only dataset item after the run is finished (#3) * fix(scrape-single-url): return the only dataset item after the run is finished * fix(scrape-single-url): version up * fix(scrape-single-url): version up * fix(scrape-single-url): version up * fix(scrape-single-url): introduce a job status constant, expand a list of terminal statuses to stop the loop * fix(scrape-single-url): import constants from package, decrease delay in between calls * Migrate to use Apify client (#6) * feat(apify): Replace Axios with Apify client * fix(general): adding custom headers to client()=> preserve whole config to be passed to Axios later * feat(general): add linter script * fix(apify-get-dataset-items): a function for getting items and parsing of a result * fix(apify-run-actor): working sync and async, dynamic input schema injection, KVS output retrieval tested only string * fix(general): change maxResults for limit as an input field * fix(run-task-sync): move items retrieval to the component, add waitSecs determined by input or plan to prevent blunt timeout error, have the item retrieval logic be connected to run status, clean return value * fix(apify-scrape-single-url): incorporate timeouts, rework the whole API interaction logic * fix(apify-set-key-value-store-record): detection of content type, fixed API interaction * fix(apify-scrape-single-url): remove waiting timeout, return only dataset item, remove extra input fields connected to WCC run * fix(apify-run-actor): success message * fix(apify-run-task-synchronously): remove waiting for run to finish timeout * fix(app): remove paidPlan input filed config --------- Co-authored-by: Matyas Cimbulka <[email protected]> * fix(apify-get-dataset-items) 6: change input parameters (#8) * chore(apify): Bump component versions * chore: Sync upstream repo (#9) * feat(apify): Prefill values from the input schema (#7) * Revert "chore: Sync upstream repo (#9)" This reverts commit cd804ba. * Revert "chore(apify): Bump component versions" This reverts commit 6040822 which for some reason bumped version of the wrong components. * fix(apify): Fix build tag * fix(apify): Address issues in run task synchronously action * feat(apify): Add default crawler type to scrape single url * fix(apify): Address issues from PR * chore(apify): Change component versions * fix(apify): Fix run Actor action * fix(apify): Fix run get dataset items action * fix(apify): Fix typos for PR --------- Co-authored-by: Oleksandra Valko <[email protected]>
1 parent f00257b commit 29b3fc0

File tree

12 files changed

+1364
-903
lines changed

12 files changed

+1364
-903
lines changed

components/apify/actions/get-dataset-items/get-dataset-items.mjs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "apify-get-dataset-items",
66
name: "Get Dataset Items",
77
description: "Returns data stored in a dataset. [See the documentation](https://docs.apify.com/api/v2/dataset-items-get)",
8-
version: "0.0.3",
8+
version: "0.0.4",
99
type: "action",
1010
props: {
1111
apify,
@@ -33,48 +33,46 @@ export default {
3333
"omit",
3434
],
3535
},
36-
flatten: {
36+
offset: {
3737
propDefinition: [
3838
apify,
39-
"flatten",
39+
"offset",
4040
],
4141
},
42-
maxResults: {
42+
limit: {
4343
propDefinition: [
4444
apify,
45-
"maxResults",
45+
"limit",
4646
],
4747
},
4848
},
4949
async run({ $ }) {
5050
const params = {
5151
limit: LIMIT,
52-
offset: 0,
52+
offset: this.offset,
5353
clean: this.clean,
54-
fields: this.fields && this.fields.join(),
55-
omit: this.omit && this.omit.join(),
56-
flatten: this.flatten && this.flatten.join(),
54+
fields: this.fields,
55+
omit: this.omit,
5756
};
5857

5958
const results = [];
6059
let total;
6160

6261
do {
63-
const items = await this.apify.listDatasetItems({
64-
$,
62+
const { items } = await this.apify.listDatasetItems({
6563
datasetId: this.datasetId,
6664
params,
6765
});
6866
results.push(...items);
69-
if (results.length >= this.maxResults) {
67+
if (results.length >= this.limit) {
7068
break;
7169
}
7270
total = items?.length;
7371
params.offset += LIMIT;
7472
} while (total);
7573

76-
if (results.length > this.maxResults) {
77-
results.length = this.maxResults;
74+
if (results.length > this.limit) {
75+
results.length = this.limit;
7876
}
7977

8078
if (results.length > 0) {

0 commit comments

Comments
 (0)