@crawlee/memory-storage 3.0.0-beta.8 → 3.0.1-beta.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.
Files changed (43) hide show
  1. package/README.md +75 -133
  2. package/cache-helpers.d.ts +2 -1
  3. package/cache-helpers.d.ts.map +1 -1
  4. package/cache-helpers.js +30 -8
  5. package/cache-helpers.js.map +1 -1
  6. package/memory-storage.d.ts +2 -2
  7. package/memory-storage.d.ts.map +1 -1
  8. package/memory-storage.js +11 -2
  9. package/memory-storage.js.map +1 -1
  10. package/package.json +10 -10
  11. package/resource-clients/common/base-client.d.ts +1 -1
  12. package/resource-clients/common/base-client.d.ts.map +1 -1
  13. package/resource-clients/dataset-collection.d.ts +1 -1
  14. package/resource-clients/dataset-collection.d.ts.map +1 -1
  15. package/resource-clients/dataset.d.ts +2 -2
  16. package/resource-clients/dataset.d.ts.map +1 -1
  17. package/resource-clients/dataset.js +1 -1
  18. package/resource-clients/dataset.js.map +1 -1
  19. package/resource-clients/key-value-store-collection.d.ts +1 -1
  20. package/resource-clients/key-value-store-collection.d.ts.map +1 -1
  21. package/resource-clients/key-value-store.d.ts +1 -1
  22. package/resource-clients/key-value-store.d.ts.map +1 -1
  23. package/resource-clients/request-queue-collection.d.ts +1 -1
  24. package/resource-clients/request-queue-collection.d.ts.map +1 -1
  25. package/resource-clients/request-queue.d.ts +2 -2
  26. package/resource-clients/request-queue.d.ts.map +1 -1
  27. package/resource-clients/request-queue.js +14 -7
  28. package/resource-clients/request-queue.js.map +1 -1
  29. package/tsconfig.build.tsbuildinfo +1 -1
  30. package/utils.d.ts +15 -4
  31. package/utils.d.ts.map +1 -1
  32. package/workers/file-storage-worker-emulator.d.ts +1 -0
  33. package/workers/file-storage-worker-emulator.d.ts.map +1 -1
  34. package/workers/file-storage-worker-emulator.js +1 -0
  35. package/workers/file-storage-worker-emulator.js.map +1 -1
  36. package/workers/instance.d.ts +1 -1
  37. package/workers/instance.d.ts.map +1 -1
  38. package/workers/instance.js +1 -0
  39. package/workers/instance.js.map +1 -1
  40. package/workers/worker-utils.d.ts +1 -1
  41. package/workers/worker-utils.d.ts.map +1 -1
  42. package/workers/worker-utils.js +19 -2
  43. package/workers/worker-utils.js.map +1 -1
package/README.md CHANGED
@@ -1,183 +1,139 @@
1
- # Crawlee: The scalable web crawling and scraping library for JavaScript
1
+ <h1 align="center">
2
+ <a href="https://crawlee.dev">
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/apify/crawlee/master/website/static/img/crawlee-dark.svg?sanitize=true">
5
+ <img alt="Crawlee" src="https://raw.githubusercontent.com/apify/crawlee/master/website/static/img/crawlee-light.svg?sanitize=true" width="500">
6
+ </picture>
7
+ </a>
8
+ <br>
9
+ <small>The scalable web crawling and scraping library for JavaScript</small>
10
+ </h1>
2
11
 
3
- <!-- Mirror this part to src/index.js -->
12
+ <p align=center>
13
+ <a href="https://www.npmjs.com/package/@crawlee/core" rel="nofollow"><img src="https://img.shields.io/npm/v/@crawlee/core.svg" alt="NPM latest version" data-canonical-src="https://img.shields.io/npm/v/@crawlee/core/next.svg" style="max-width: 100%;"></a>
14
+ <a href="https://www.npmjs.com/package/@crawlee/core" rel="nofollow"><img src="https://img.shields.io/npm/dm/@crawlee/core.svg" alt="Downloads" data-canonical-src="https://img.shields.io/npm/dm/@crawlee/core.svg" style="max-width: 100%;"></a>
15
+ <a href="https://discord.gg/jyEM2PRvMU" rel="nofollow"><img src="https://img.shields.io/discord/801163717915574323?label=discord" alt="Chat on discord" data-canonical-src="https://img.shields.io/discord/801163717915574323?label=discord" style="max-width: 100%;"></a>
16
+ <a href="https://github.com/apify/crawlee/actions/workflows/test-and-release.yml"><img src="https://github.com/apify/crawlee/actions/workflows/test-and-release.yml/badge.svg?branch=master" alt="Build Status" style="max-width: 100%;"></a>
17
+ </p>
4
18
 
5
- [![NPM dev version](https://img.shields.io/npm/v/@crawlee/core/next.svg)](https://www.npmjs.com/package/@crawlee/core)
6
- [![Downloads](https://img.shields.io/npm/dm/@crawlee/core.svg)](https://www.npmjs.com/package/@crawlee/core)
7
- [![Chat on discord](https://img.shields.io/discord/801163717915574323?label=discord)](https://discord.gg/jyEM2PRvMU)
8
- [![Build Status](https://github.com/apify/apify-ts/actions/workflows/test-and-release.yml/badge.svg?branch=master)](https://github.com/apify/apify-ts/actions/workflows/test-and-release.yml)
19
+ >👉👉👉 Crawlee is the successor to [Apify SDK](https://sdk.apify.com). 🎉 Fully rewritten in **TypeScript** for a better developer experience, and with even more powerful anti-blocking features. The interface is almost the same as Apify SDK so upgrading is a breeze. Read [the upgrading guide](https://crawlee.dev/docs/upgrading/upgrading-to-v3) to learn about the changes. 👈👈👈
9
20
 
10
- Apify SDK simplifies the development of web crawlers, scrapers, data extractors and web automation jobs.
11
- It provides tools to manage and automatically scale a pool of headless browsers,
12
- to maintain queues of URLs to crawl, store crawling results to a local filesystem or into the cloud,
13
- rotate proxies and much more.
14
- The SDK is available as the [`apify`](https://www.npmjs.com/package/apify) NPM package.
15
- It can be used either stand-alone in your own applications
16
- or in [actors](https://docs.apify.com/actor)
17
- running on the [Apify Cloud](https://apify.com/).
21
+ Crawlee simplifies the development of web crawlers, scrapers, data extractors and web automation jobs. It provides tools to manage and automatically scale a pool of headless browsers, to maintain queues of URLs to crawl, store crawling results to a local filesystem or into the cloud, rotate proxies and much more. Crawlee is available as the [`crawlee`](https://www.npmjs.com/package/crawlee) NPM package. It can be used either stand-alone in your own applications or in [actors](https://docs.apify.com/actor) running on the [Apify Cloud](https://apify.com/).
18
22
 
19
- **View full documentation, guides and examples on the [Apify SDK project website](https://sdk.apify.com)**
23
+ **View full documentation, guides and examples on the [Crawlee project website](https://crawlee.dev)**
20
24
 
21
- > Would you like to work with us on Apify SDK or similar projects? [We are hiring!](https://apify.com/jobs#senior-node.js-engineer)
25
+ > Would you like to work with us on Crawlee or similar projects? [We are hiring!](https://apify.com/jobs#senior-node.js-engineer)
22
26
 
23
27
  ## Motivation
24
28
 
25
- Thanks to tools like [Playwright](https://github.com/microsoft/playwright), [Puppeteer](https://github.com/puppeteer/puppeteer) or
26
- [Cheerio](https://www.npmjs.com/package/cheerio), it is easy to write Node.js code to extract data from web pages. But
27
- eventually things will get complicated. For example, when you try to:
29
+ Thanks to tools like [Playwright](https://github.com/microsoft/playwright), [Puppeteer](https://github.com/puppeteer/puppeteer) or [Cheerio](https://www.npmjs.com/package/cheerio), it is easy to write Node.js code to extract data from web pages. But eventually things will get complicated. For example, when you try to:
28
30
 
29
31
  - Perform a deep crawl of an entire website using a persistent queue of URLs.
30
32
  - Run your scraping code on a list of 100k URLs in a CSV file, without losing any data when your code crashes.
31
33
  - Rotate proxies to hide your browser origin and keep user-like sessions.
32
34
  - Disable browser fingerprinting protections used by websites.
33
35
 
34
- Python has [Scrapy](https://scrapy.org/) for these tasks, but there was no such library for **JavaScript, the language of
35
- the web**. The use of JavaScript is natural, since the same language is used to write the scripts as well as the data extraction code running in a
36
- browser.
36
+ Python has [Scrapy](https://scrapy.org/) for these tasks, but there was no such library for **JavaScript, the language of the web**. The use of JavaScript is natural, since the same language is used to write the scripts as well as the data extraction code running in a browser.
37
37
 
38
- The goal of the Apify SDK is to fill this gap and provide a toolbox for generic web scraping, crawling and automation tasks in JavaScript. So don't
39
- reinvent the wheel every time you need data from the web, and focus on writing code specific to the target website, rather than developing
40
- commonalities.
38
+ The goal of Crawlee is to fill this gap and provide a toolbox for generic web scraping, crawling and automation tasks in JavaScript. So don't reinvent the wheel every time you need data from the web, and focus on writing code specific to the target website, rather than developing commonalities.
41
39
 
42
40
  ## Overview
43
41
 
44
- The Apify SDK is available as the [`apify`](https://www.npmjs.com/package/apify) NPM package and it provides the following tools:
42
+ Crawlee is available as the [`crawlee`](https://www.npmjs.com/package/crawlee) NPM package and is also available via `@crawlee/*` packages. It provides the following tools:
45
43
 
46
- - [`CheerioCrawler`](https://sdk.apify.com/docs/api/cheerio-crawler) - Enables the parallel crawling of a large
47
- number of web pages using the [cheerio](https://www.npmjs.com/package/cheerio) HTML parser. This is the most
48
- efficient web crawler, but it does not work on websites that require JavaScript.
44
+ - [`CheerioCrawler`](https://crawlee.dev/api/cheerio-crawler/class/CheerioCrawler) - Enables the parallel crawling of a large number of web pages using the [cheerio](https://www.npmjs.com/package/cheerio) HTML parser. This is the most efficient web crawler, but it does not work on websites that require JavaScript. Available also under `@crawlee/cheerio` package.
49
45
 
50
- - [`PuppeteerCrawler`](https://sdk.apify.com/docs/api/puppeteer-crawler) - Enables the parallel crawling of
51
- a large number of web pages using the headless Chrome browser and [Puppeteer](https://github.com/puppeteer/puppeteer).
52
- The pool of Chrome browsers is automatically scaled up and down based on available system resources.
46
+ - [`PuppeteerCrawler`](https://crawlee.dev/api/puppeteer-crawler/class/PuppeteerCrawler) - Enables the parallel crawling of a large number of web pages using the headless Chrome browser and [Puppeteer](https://github.com/puppeteer/puppeteer). The pool of Chrome browsers is automatically scaled up and down based on available system resources. Available also under `@crawlee/puppeteer` package.
53
47
 
54
- - [`PlaywrightCrawler`](https://sdk.apify.com/docs/api/playwright-crawler) - Unlike `PuppeteerCrawler`
55
- you can use [Playwright](https://github.com/microsoft/playwright) to manage almost any headless browser.
56
- It also provides a cleaner and more mature interface while keeping the ease of use and advanced features.
48
+ - [`PlaywrightCrawler`](https://crawlee.dev/api/playwright-crawler/class/PlaywrightCrawler) - Unlike `PuppeteerCrawler` you can use [Playwright](https://github.com/microsoft/playwright) to manage almost any headless browser. It also provides a cleaner and more mature interface while keeping the ease of use and advanced features. Available also under `@crawlee/playwright` package.
57
49
 
58
- - [`BasicCrawler`](https://sdk.apify.com/docs/api/basic-crawler) - Provides a simple framework for the parallel
59
- crawling of web pages whose URLs are fed either from a static list or from a dynamic queue of URLs. This class
60
- serves as a base for the more specialized crawlers above.
50
+ - [`BasicCrawler`](https://crawlee.dev/api/basic-crawler/class/BasicCrawler) - Provides a simple framework for the parallel crawling of web pages whose URLs are fed either from a static list or from a dynamic queue of URLs. This class serves as a base for the more specialized crawlers above. Available also under `@crawlee/basic` package.
61
51
 
62
- - [`RequestList`](https://sdk.apify.com/docs/api/request-list) - Represents a list of URLs to crawl.
63
- The URLs can be passed in code or in a text file hosted on the web. The list persists its state so that crawling
64
- can resume when the Node.js process restarts.
52
+ - [`RequestList`](https://crawlee.dev/api/core/class/RequestList) - Represents a list of URLs to crawl. The URLs can be passed in code or in a text file hosted on the web. The list persists its state so that crawling can resume when the Node.js process restarts. Available also under `@crawlee/core` package.
65
53
 
66
- - [`RequestQueue`](https://sdk.apify.com/docs/api/request-queue) - Represents a queue of URLs to crawl,
67
- which is stored either on a local filesystem or in the [Apify Cloud](https://apify.com). The queue is used
68
- for deep crawling of websites, where you start with several URLs and then recursively follow links to other pages.
69
- The data structure supports both breadth-first and depth-first crawling orders.
54
+ - [`RequestQueue`](https://crawlee.dev/api/core/class/RequestQueue) - Represents a queue of URLs to crawl, which is stored either in memory, on a local filesystem, or in the [Apify Cloud](https://apify.com). The queue is used for deep crawling of websites, where you start with several URLs and then recursively follow links to other pages. The data structure supports both breadth-first and depth-first crawling orders. Available also under `@crawlee/core` package.
70
55
 
71
- - [`Dataset`](https://sdk.apify.com/docs/api/dataset) - Provides a store for structured data and enables their export
72
- to formats like JSON, JSONL, CSV, XML, Excel or HTML. The data is stored on a local filesystem or in the Apify Cloud.
73
- Datasets are useful for storing and sharing large tabular crawling results, such as a list of products or real estate offers.
56
+ - [`Dataset`](https://crawlee.dev/api/core/class/Dataset) - Provides a store for structured data and enables their export to formats like JSON, JSONL, CSV, XML, Excel or HTML. The data is stored on a local filesystem or in the Apify Cloud. Datasets are useful for storing and sharing large tabular crawling results, such as a list of products or real estate offers. Available also under `@crawlee/core` package.
74
57
 
75
- - [`KeyValueStore`](https://sdk.apify.com/docs/api/key-value-store) - A simple key-value store for arbitrary data
76
- records or files, along with their MIME content type. It is ideal for saving screenshots of web pages, PDFs
77
- or to persist the state of your crawlers. The data is stored on a local filesystem or in the Apify Cloud.
58
+ - [`KeyValueStore`](https://crawlee.dev/api/core/class/KeyValueStore) - A simple key-value store for arbitrary data records or files, along with their MIME content type. It is ideal for saving screenshots of web pages, PDFs or to persist the state of your crawlers. The data is stored on a local filesystem or in the Apify Cloud. Available also under `@crawlee/core` package.
78
59
 
79
- - [`AutoscaledPool`](https://sdk.apify.com/docs/api/autoscaled-pool) - Runs asynchronous background tasks,
80
- while automatically adjusting the concurrency based on free system memory and CPU usage. This is useful for running
81
- web scraping tasks at the maximum capacity of the system.
60
+ - [`AutoscaledPool`](https://crawlee.dev/api/core/class/AutoscaledPool) - Runs asynchronous background tasks, while automatically adjusting the concurrency based on free system memory and CPU usage. This is useful for running web scraping tasks at the maximum capacity of the system. Available also under `@crawlee/core` package.
82
61
 
83
- - [`Browser Utils`](https://sdk.apify.com/docs/api/puppeteer) - Provides several helper functions useful
84
- for web scraping. For example, to inject jQuery into web pages or to hide browser origin.
85
-
86
- Additionally, the package provides various helper functions to simplify running your code on the Apify Cloud and thus
87
- take advantage of its pool of proxies, job scheduler, data storage, etc.
88
- For more information, see the [Apify SDK Programmer's Reference](https://sdk.apify.com).
62
+ Additionally, the package provides various helper functions to simplify running your code on the Apify Cloud and thus take advantage of its pool of proxies, job scheduler, data storage, etc. For more information, see the [Crawlee Programmer's Reference](https://crawlee.dev).
89
63
 
90
64
  ## Quick Start
91
65
 
92
- This short tutorial will set you up to start using Apify SDK in a minute or two.
93
- If you want to learn more, proceed to the [Getting Started](https://sdk.apify.com/docs/guides/getting-started)
94
- tutorial that will take you step by step through creating your first scraper.
66
+ This short tutorial will set you up to start using Crawlee in a minute or two. If you want to learn more, proceed to the [Getting Started](https://crawlee.dev/docs/guides/getting-started) tutorial that will take you step by step through creating your first scraper.
95
67
 
96
68
  ### Local stand-alone usage
97
69
 
98
- Apify SDK requires [Node.js](https://nodejs.org/en/) 15.10 or later.
99
- Add Apify SDK to any Node.js project by running:
70
+ Crawlee requires [Node.js](https://nodejs.org/en/) 16 or later. Add Crawlee to any Node.js project by running:
100
71
 
101
72
  ```bash
102
- npm install apify playwright
73
+ npm install crawlee playwright
103
74
  ```
104
75
 
105
- > Neither `playwright` nor `puppeteer` are bundled with the SDK to reduce install size and allow greater
106
- > flexibility. That's why we install it with NPM. You can choose one, both, or neither.
76
+ > Neither `playwright` nor `puppeteer` are bundled with Crawlee to reduce install size and allow greater flexibility. That's why we install it with NPM. You can choose one, both, or neither.
107
77
 
108
- Run the following example to perform a recursive crawl of a website using Playwright. For more examples showcasing various features of the Apify SDK,
109
- [see the Examples section of the documentation](https://sdk.apify.com/docs/examples/crawl-multiple-urls).
78
+ Run the following example to perform a recursive crawl of a website using Playwright. For more examples showcasing various features of Crawlee, [see the Examples section of the documentation](https://crawlee.dev/docs/examples/crawl-multiple-urls).
110
79
 
111
80
  ```javascript
112
- const Apify = require('apify');
113
-
114
- // Apify.main is a helper function, you don't need to use it.
115
- Apify.main(async () => {
116
- const requestQueue = await Apify.openRequestQueue();
117
- // Choose the first URL to open.
118
- await requestQueue.addRequest({ url: 'https://www.iana.org/' });
119
-
120
- const crawler = new Apify.PlaywrightCrawler({
121
- requestQueue,
122
- handlePageFunction: async ({ request, page }) => {
123
- // Extract HTML title of the page.
124
- const title = await page.title();
125
- console.log(`Title of ${request.url}: ${title}`);
126
-
127
- // Add URLs that match the provided pattern.
128
- await Apify.utils.enqueueLinks({
129
- page,
130
- requestQueue,
131
- pseudoUrls: ['https://www.iana.org/[.*]'],
132
- });
133
- },
134
- });
135
-
136
- await crawler.run();
81
+ import { PlaywrightCrawler, Dataset } from 'crawlee';
82
+
83
+ const crawler = new PlaywrightCrawler();
84
+
85
+ crawler.router.addDefaultHandler(async ({ request, page, enqueueLinks }) => {
86
+ const title = await page.title();
87
+ console.log(`Title of ${request.loadedUrl} is '${title}'`);
88
+
89
+ // save some results
90
+ await Dataset.pushData({ title, url: request.loadedUrl });
91
+
92
+ // enqueue all links targeting the same hostname
93
+ await enqueueLinks();
137
94
  });
95
+
96
+ await crawler.run(['https://www.iana.org/']);
138
97
  ```
139
98
 
140
- When you run the example, you should see Apify SDK automating a Chrome browser.
99
+ When you run the example, you should see Crawlee automating a Chrome browser.
141
100
 
142
- ![Chrome Scrape](https://sdk.apify.com/img/chrome_scrape.gif)
101
+ ![Chrome Scrape](https://crawlee.dev/img/chrome_scrape.gif)
143
102
 
144
- By default, Apify SDK stores data to `./apify_storage` in the current working directory. You can override this behavior by setting either the
145
- `APIFY_LOCAL_STORAGE_DIR` or `APIFY_TOKEN` environment variable. For details, see [Environment variables](https://sdk.apify.com/docs/guides/environment-variables), [Request storage](https://sdk.apify.com/docs/guides/request-storage) and [Result storage](https://sdk.apify.com/docs/guides/result-storage).
103
+ By default, Crawlee stores data to `./storage` in the current working directory. You can override this directory via `CRAWLEE_STORAGE_DIR` env var. For details, see [Environment variables](https://crawlee.dev/docs/guides/environment-variables), [Request storage](https://crawlee.dev/docs/guides/request-storage) and [Result storage](https://crawlee.dev/docs/guides/result-storage).
146
104
 
147
- ### Local usage with Apify command-line interface (CLI)
105
+ ### Local usage with Crawlee command-line interface (CLI)
148
106
 
149
- To avoid the need to set the environment variables manually, to create a boilerplate of your project, and to enable pushing and running your code on
150
- the [Apify platform](https://sdk.apify.com/docs/guides/apify-platform), you can use the [Apify command-line interface (CLI)](https://github.com/apify/apify-cli) tool.
107
+ To create a boilerplate of your project we can use the [Crawlee command-line interface (CLI)](https://github.com/apify/apify-cli) tool.
151
108
 
152
- Install the CLI by running:
109
+ Let's create a boilerplate of your new web crawling project by running:
153
110
 
154
111
  ```bash
155
- npm -g install apify-cli
112
+ npx crawlee create my-hello-world
156
113
  ```
157
114
 
158
- Now create a boilerplate of your new web crawling project by running:
115
+ The CLI will prompt you to select a project boilerplate template - just pick "Hello world". The tool will create a directory called `my-hello-world` with a Node.js project files. You can run the project as follows:
159
116
 
160
117
  ```bash
161
- apify create my-hello-world
118
+ cd my-hello-world
119
+ npx crawlee run
162
120
  ```
163
121
 
164
- The CLI will prompt you to select a project boilerplate template - just pick "Hello world". The tool will create a directory called `my-hello-world`
165
- with a Node.js project files. You can run the project as follows:
122
+ By default, the crawling data will be stored in a local directory at `./storage`. For example, the input JSON file for the actor is expected to be in the default key-value store in `./storage/key_value_stores/default/INPUT.json`.
166
123
 
167
- ```bash
168
- cd my-hello-world
169
- apify run
170
- ```
124
+ ### Usage on the Apify platform
171
125
 
172
- By default, the crawling data will be stored in a local directory at `./apify_storage`. For example, the input JSON file for the actor is expected to
173
- be in the default key-value store in `./apify_storage/key_value_stores/default/INPUT.json`.
126
+ Now if we want to run our new crawler on Apify Platform, we first need to download the `apify-cli` and login with our token:
174
127
 
175
- Now you can easily deploy your code to the Apify platform by running:
128
+ > We could also use the Apify CLI to generate a new project, which can be better suited if we want to run it on the Apify Platform.
176
129
 
177
130
  ```bash
131
+ npm i -g apify-cli
178
132
  apify login
179
133
  ```
180
134
 
135
+ Finally, we can easily deploy our code to the Apify platform by running:
136
+
181
137
  ```bash
182
138
  apify push
183
139
  ```
@@ -185,32 +141,18 @@ apify push
185
141
  Your script will be uploaded to the Apify platform and built there so that it can be run. For more information, view the
186
142
  [Apify Actor](https://docs.apify.com/cli) documentation.
187
143
 
188
- ### Usage on the Apify platform
189
-
190
- You can also develop your web scraping project in an online code editor directly on the [Apify platform](https://sdk.apify.com/docs/guides/apify-platform).
191
- You'll need to have an Apify Account. Go to [Actors](https://console.apify.com/actors), page in the Apify Console, click <i>Create new</i>
192
- and then go to the <i>Source</i> tab and start writing your code or paste one of the examples from the Examples section.
144
+ You can also develop your web scraping project in an online code editor directly on the [Apify platform](https://crawlee.dev/docs/guides/apify-platform). You'll need to have an Apify Account. Go to [Actors](https://console.apify.com/actors), page in the Apify Console, click <i>Create new</i> and then go to the <i>Source</i> tab and start writing your code or paste one of the examples from the Examples section.
193
145
 
194
146
  For more information, view the [Apify actors quick start guide](https://docs.apify.com/actor/quick-start).
195
147
 
196
148
  ## Support
197
149
 
198
- If you find any bug or issue with the Apify SDK, please [submit an issue on GitHub](https://github.com/apify/apify-js/issues).
199
- For questions, you can ask on [Stack Overflow](https://stackoverflow.com/questions/tagged/apify) or contact support@apify.com
150
+ If you find any bug or issue with Crawlee, please [submit an issue on GitHub](https://github.com/apify/crawlee/issues). For questions, you can ask on [Stack Overflow](https://stackoverflow.com/questions/tagged/apify) or contact support@apify.com
200
151
 
201
152
  ## Contributing
202
153
 
203
- Your code contributions are welcome and you'll be praised to eternity!
204
- If you have any ideas for improvements, either submit an issue or create a pull request.
205
- For contribution guidelines and the code of conduct,
206
- see [CONTRIBUTING.md](https://github.com/apify/apify-js/blob/master/CONTRIBUTING.md).
154
+ Your code contributions are welcome, and you'll be praised to eternity! If you have any ideas for improvements, either submit an issue or create a pull request. For contribution guidelines and the code of conduct, see [CONTRIBUTING.md](https://github.com/apify/crawlee/blob/master/CONTRIBUTING.md).
207
155
 
208
156
  ## License
209
157
 
210
- This project is licensed under the Apache License 2.0 -
211
- see the [LICENSE.md](https://github.com/apify/apify-js/blob/master/LICENSE.md) file for details.
212
-
213
- ## Acknowledgments
214
-
215
- Many thanks to [Chema Balsas](https://www.npmjs.com/~jbalsas) for giving up the `apify` package name
216
- on NPM and renaming his project to [jsdocify](https://www.npmjs.com/package/jsdocify).
158
+ This project is licensed under the Apache License 2.0 - see the [LICENSE.md](https://github.com/apify/crawlee/blob/master/LICENSE.md) file for details.
@@ -1,5 +1,6 @@
1
+ import type * as storage from '@crawlee/types';
1
2
  import type { MemoryStorage } from './memory-storage';
2
- export declare function findOrCacheDatasetByPossibleId(client: MemoryStorage, entryNameOrId: string): Promise<DatasetClient<import("packages/utils/dist").Dictionary<any>> | undefined>;
3
+ export declare function findOrCacheDatasetByPossibleId(client: MemoryStorage, entryNameOrId: string): Promise<DatasetClient<storage.Dictionary<any>> | undefined>;
3
4
  export declare function findOrCacheKeyValueStoreByPossibleId(client: MemoryStorage, entryNameOrId: string): Promise<KeyValueStoreClient | undefined>;
4
5
  export declare function findRequestQueueByPossibleId(client: MemoryStorage, entryNameOrId: string): Promise<RequestQueueClient | undefined>;
5
6
  import { DatasetClient } from './resource-clients/dataset';
@@ -1 +1 @@
1
- {"version":3,"file":"cache-helpers.d.ts","sourceRoot":"","sources":["../src/cache-helpers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAItD,wBAAsB,8BAA8B,CAAC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qFAyFhG;AAED,wBAAsB,oCAAoC,CAAC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4CAgHtG;AAED,wBAAsB,4BAA4B,CAAC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,2CAuF9F;AAGD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAqB,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAAmB,kBAAkB,EAAE,MAAM,kCAAkC,CAAC"}
1
+ {"version":3,"file":"cache-helpers.d.ts","sourceRoot":"","sources":["../src/cache-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAM/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKtD,wBAAsB,8BAA8B,CAAC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,+DAyFhG;AAED,wBAAsB,oCAAoC,CAAC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4CAsItG;AAED,wBAAsB,4BAA4B,CAAC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,2CAsF9F;AAGD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC"}
package/cache-helpers.js CHANGED
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const promises_1 = require("node:fs/promises");
6
6
  const node_path_1 = require("node:path");
7
7
  const mime_types_1 = tslib_1.__importDefault(require("mime-types"));
8
+ const utils_1 = require("./utils");
8
9
  const uuidRegex = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i;
9
10
  async function findOrCacheDatasetByPossibleId(client, entryNameOrId) {
10
11
  // First check memory cache
@@ -125,14 +126,36 @@ async function findOrCacheKeyValueStoreByPossibleId(client, entryNameOrId) {
125
126
  continue;
126
127
  }
127
128
  const fileContent = await (0, promises_1.readFile)((0, node_path_1.resolve)(keyValueStoreDir, entry.name));
128
- const contentType = mime_types_1.default.contentType(entry.name);
129
+ const fileExtension = (0, node_path_1.extname)(entry.name);
130
+ const contentType = mime_types_1.default.contentType(entry.name) || 'text/plain';
129
131
  const extension = mime_types_1.default.extension(contentType);
130
132
  let finalFileContent = fileContent;
131
- if (contentType.includes('application/json') || contentType.includes('text/plain')) {
133
+ if (!fileExtension) {
134
+ utils_1.memoryStorageLog.warning([
135
+ `Key-value entry "${entry.name}" for store ${entryNameOrId} does not have a file extension, assuming it as text.`,
136
+ 'If you want to have correct interpretation of the file, you should add a file extension to the entry.',
137
+ ].join('\n'));
138
+ finalFileContent = fileContent.toString('utf8');
139
+ }
140
+ else if (contentType.includes('application/json')) {
141
+ const stringifiedJson = fileContent.toString('utf8');
142
+ try {
143
+ // Try parsing the JSON ahead of time (not ideal but solves invalid files being loaded into stores)
144
+ JSON.parse(stringifiedJson);
145
+ finalFileContent = stringifiedJson;
146
+ }
147
+ catch {
148
+ utils_1.memoryStorageLog.warning(`Key-value entry "${entry.name}" for store ${entryNameOrId} has invalid JSON content and will be ignored from the store.`);
149
+ continue;
150
+ }
151
+ }
152
+ else if (contentType.includes('text/plain')) {
132
153
  finalFileContent = fileContent.toString('utf8');
133
154
  }
134
155
  const nameSplit = entry.name.split('.');
135
- nameSplit.pop();
156
+ if (fileExtension) {
157
+ nameSplit.pop();
158
+ }
136
159
  const key = nameSplit.join('.');
137
160
  const newRecord = {
138
161
  key,
@@ -194,7 +217,7 @@ async function findRequestQueueByPossibleId(client, entryNameOrId) {
194
217
  let modifiedAt = new Date();
195
218
  let pendingRequestCount = 0;
196
219
  let handledRequestCount = 0;
197
- let entries = [];
220
+ const entries = [];
198
221
  for await (const entry of directoryEntries) {
199
222
  if (entry.isFile()) {
200
223
  switch (entry.name) {
@@ -210,11 +233,10 @@ async function findRequestQueueByPossibleId(client, entryNameOrId) {
210
233
  handledRequestCount = metadata.handledRequestCount;
211
234
  break;
212
235
  }
213
- case 'entries.json': {
214
- entries = JSON.parse(await (0, promises_1.readFile)((0, node_path_1.resolve)(requestQueueDir, entry.name), 'utf8'));
215
- break;
236
+ default: {
237
+ const request = JSON.parse(await (0, promises_1.readFile)((0, node_path_1.resolve)(requestQueueDir, entry.name), 'utf8'));
238
+ entries.push(request);
216
239
  }
217
- default:
218
240
  }
219
241
  }
220
242
  }
@@ -1 +1 @@
1
- {"version":3,"file":"cache-helpers.js","sourceRoot":"","sources":["../src/cache-helpers.ts"],"names":[],"mappings":";;;;AACA,+CAA6D;AAC7D,yCAAoC;AACpC,oEAAmC;AAGnC,MAAM,SAAS,GAAG,+DAA+D,CAAC;AAE3E,KAAK,UAAU,8BAA8B,CAAC,MAAqB,EAAE,aAAqB;IAC7F,2BAA2B;IAC3B,MAAM,KAAK,GAAG,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,aAAa,IAAI,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC;IAEpJ,IAAI,KAAK,EAAE;QACP,OAAO,KAAK,CAAC;KAChB;IAED,MAAM,UAAU,GAAG,IAAA,mBAAO,EAAC,MAAM,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;IAEpE,IAAI;QACA,4BAA4B;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CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;iBACzB;aACJ;SACJ;KACJ;IAED,IAAI,EAAE,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,EAAE;QACxC,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAE7C,IAAI,MAAM,EAAE;YACR,EAAE,GAAG,aAAa,CAAC;SACtB;aAAM;YACH,IAAI,GAAG,aAAa,CAAC;SACxB;KACJ;IAED,MAAM,SAAS,GAAG,IAAI,kCAAkB,CAAC;QACrC,oBAAoB,EAAE,MAAM,CAAC,sBAAsB;QACnD,MAAM;QACN,EAAE;QACF,IAAI;KACP,CAAC,CAAC;IAEH,uBAAuB;IACvB,SAAS,CAAC,UAAU,GAAG,UAAU,CAAC;IAClC,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC;IAChC,SAAS,CAAC,UAAU,GAAG,UAAU,CAAC;IAClC,SAAS,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IACpD,SAAS,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IAEpD,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;QACzB,wCAAwC;QACxC,SAAS,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;KAC9C;IAED,MAAM,CAAC,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,SAAS,CAAC;AACrB,CAAC;AAtFD,oEAsFC;AAED,qDAAqD;AACrD,wDAA2D;AAC3D,wEAAyE;AACzE,oEAAsE"}
@@ -1,12 +1,12 @@
1
1
  import type * as storage from '@crawlee/types';
2
- import { Dictionary } from '@crawlee/utils';
2
+ import type { Dictionary } from '@crawlee/types';
3
3
  import { DatasetClient } from './resource-clients/dataset';
4
4
  import { KeyValueStoreClient } from './resource-clients/key-value-store';
5
5
  import { RequestQueueClient } from './resource-clients/request-queue';
6
6
  export interface MemoryStorageOptions {
7
7
  /**
8
8
  * Path to directory where the data will also be saved.
9
- * @default process.env.CRAWLEE_STORAGE_DIR ?? './memory_storage'
9
+ * @default process.env.CRAWLEE_STORAGE_DIR ?? './storage'
10
10
  */
11
11
  localDataDirectory?: string;
12
12
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"memory-storage.d.ts","sourceRoot":"","sources":["../src/memory-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAK5C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAItE,MAAM,WAAW,oBAAoB;IACjC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,qBAAa,aAAc,YAAW,OAAO,CAAC,aAAa;IACvD,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAEhC,QAAQ,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,CAAM;IAC3D,QAAQ,CAAC,qBAAqB,EAAE,aAAa,EAAE,CAAM;IACrD,QAAQ,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,CAAM;gBAE7C,OAAO,GAAE,oBAAyB;IAe9C,QAAQ,IAAI,OAAO,CAAC,uBAAuB;IAO3C,OAAO,CAAC,IAAI,SAAS,UAAU,GAAG,UAAU,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CA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AoB,EAAE,kBAAkB,EAAE,CAAM;gBAE7C,OAAO,GAAE,oBAAyB;IA0B9C,QAAQ,IAAI,OAAO,CAAC,uBAAuB;IAO3C,OAAO,CAAC,IAAI,SAAS,UAAU,GAAG,UAAU,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC;IAMtF,cAAc,IAAI,OAAO,CAAC,6BAA6B;IAOvD,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB;IAMtD,aAAa,IAAI,OAAO,CAAC,4BAA4B;IAOrD,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,OAAO,CAAC,mBAAwB,GAAG,OAAO,CAAC,kBAAkB;IAU/F;;;;;OAKG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAWd,WAAW;CAkB5B"}
package/memory-storage.js CHANGED
@@ -66,7 +66,16 @@ class MemoryStorage {
66
66
  localDataDirectory: shapeshift_1.s.string.optional,
67
67
  writeMetadata: shapeshift_1.s.boolean.optional,
68
68
  }).parse(options);
69
- this.localDataDirectory = options.localDataDirectory ?? process.env.CRAWLEE_STORAGE_DIR ?? './memory_storage';
69
+ // v3.0.0 used `crawlee_storage` as the default, we changed this in v3.0.1 to just `storage`,
70
+ // this function handles it without making BC breaks - it respects existing `crawlee_storage`
71
+ // directories, and uses the `storage` only if it's not there.
72
+ const defaultStorageDir = () => {
73
+ if ((0, fs_extra_1.pathExistsSync)((0, node_path_1.resolve)('./crawlee_storage'))) {
74
+ return './crawlee_storage';
75
+ }
76
+ return './storage';
77
+ };
78
+ this.localDataDirectory = options.localDataDirectory ?? process.env.CRAWLEE_STORAGE_DIR ?? defaultStorageDir();
70
79
  this.datasetsDirectory = (0, node_path_1.resolve)(this.localDataDirectory, 'datasets');
71
80
  this.keyValueStoresDirectory = (0, node_path_1.resolve)(this.localDataDirectory, 'key_value_stores');
72
81
  this.requestQueuesDirectory = (0, node_path_1.resolve)(this.localDataDirectory, 'request_queues');
@@ -122,7 +131,7 @@ class MemoryStorage {
122
131
  await this.removeFiles(defaultRequestQueuePath);
123
132
  }
124
133
  async removeFiles(folder) {
125
- const storagePathExists = await (0, fs_extra_1.pathExists)(folder);
134
+ const storagePathExists = (0, fs_extra_1.pathExistsSync)(folder);
126
135
  if (storagePathExists) {
127
136
  const direntNames = await (0, promises_1.readdir)(folder);
128
137
  const deletePromises = [];
@@ -1 +1 @@
1
- {"version":3,"file":"memory-storage.js","sourceRoot":"","sources":["../src/memory-storage.ts"],"names":[],"mappings":";;;AAEA,qDAAyC;AACzC,uCAAsC;AACtC,+CAA+C;AAC/C,yCAA0C;AAC1C,wDAA2D;AAC3D,8EAAgF;AAChF,wEAAyE;AACzE,8FAA8F;AAC9F,oEAAsE;AACtE,0FAA2F;AAC3F,iDAAwD;AAexD,MAAa,aAAa;IAWtB,YAAY,UAAgC,EAAE;QAV9C;;;;;WAAoC;QACpC;;;;;WAAmC;QACnC;;;;;WAAyC;QACzC;;;;;WAAwC;QACxC;;;;;WAAgC;QAEhC;;;;mBAAwD,EAAE;WAAC;QAC3D;;;;mBAAkD,EAAE;WAAC;QACrD;;;;mBAAsD,EAAE;WAAC;QAGrD,cAAC,CAAC,MAAM,CAAC;YACL,kBAAkB,EAAE,cAAC,CAAC,MAAM,CAAC,QAAQ;YACrC,aAAa,EAAE,cAAC,CAAC,OAAO,CAAC,QAAQ;SACpC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAElB,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,kBAAkB,CAAC;QAC9G,IAAI,CAAC,iBAAiB,GAAG,IAAA,mBAAO,EAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;QACtE,IAAI,CAAC,uBAAuB,GAAG,IAAA,mBAAO,EAAC,IAAI,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,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CAAC,WAAW,CAAC,MAAc;QACpC,MAAM,iBAAiB,GAAG,IAAA,yBAAc,EAAC,MAAM,CAAC,CAAC;QAEjD,IAAI,iBAAiB,EAAE;YACnB,MAAM,WAAW,GAAG,MAAM,IAAA,kBAAO,EAAC,MAAM,CAAC,CAAC;YAC1C,MAAM,cAAc,GAAG,EAAE,CAAC;YAE1B,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;gBAClC,MAAM,QAAQ,GAAG,IAAA,gBAAI,EAAC,MAAM,EAAE,UAAU,CAAC,CAAC;gBAE1C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;oBAC1B,cAAc,CAAC,IAAI,CAAC,IAAA,aAAE,EAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;iBACvE;aACJ;YAED,MAAM,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;SACrC;IACL,CAAC;CACJ;AAnHD,sCAmHC"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@crawlee/memory-storage",
3
- "version": "3.0.0-beta.8",
3
+ "version": "3.0.1-beta.0",
4
4
  "description": "A simple in-memory storage implementation of the Apify API",
5
5
  "engines": {
6
6
  "node": ">= 16"
7
7
  },
8
- "main": "index.js",
9
- "module": "index.mjs",
10
- "types": "index.d.ts",
8
+ "main": "./index.js",
9
+ "module": "./index.mjs",
10
+ "types": "./index.d.ts",
11
11
  "exports": {
12
12
  ".": {
13
13
  "import": "./index.mjs",
@@ -32,12 +32,12 @@
32
32
  "license": "Apache-2.0",
33
33
  "repository": {
34
34
  "type": "git",
35
- "url": "git+https://github.com/apify/apify-js"
35
+ "url": "git+https://github.com/apify/crawlee"
36
36
  },
37
37
  "bugs": {
38
- "url": "https://github.com/apify/apify-js/issues"
38
+ "url": "https://github.com/apify/crawlee/issues"
39
39
  },
40
- "homepage": "https://sdk.apify.com/",
40
+ "homepage": "https://crawlee.dev",
41
41
  "scripts": {
42
42
  "build": "npm run clean && npm run compile && npm run copy",
43
43
  "clean": "rimraf ./dist",
@@ -48,9 +48,9 @@
48
48
  "access": "public"
49
49
  },
50
50
  "dependencies": {
51
- "@apify/log": "^1.2.3",
52
- "@crawlee/types": "^3.0.0-beta.8",
53
- "@crawlee/utils": "^3.0.0-beta.8",
51
+ "@apify/log": "^2.0.0",
52
+ "@crawlee/types": "^3.0.1-beta.0",
53
+ "@crawlee/utils": "^3.0.1-beta.0",
54
54
  "@sapphire/shapeshift": "^3.0.0",
55
55
  "content-type": "^1.0.4",
56
56
  "fs-extra": "^10.1.0",
@@ -1,4 +1,4 @@
1
- import { StorageTypes } from '../../consts';
1
+ import type { StorageTypes } from '../../consts';
2
2
  export declare class BaseClient {
3
3
  id: string;
4
4
  constructor(id: string);
@@ -1 +1 @@
1
- {"version":3,"file":"base-client.d.ts","sourceRoot":"","sources":["../../../src/resource-clients/common/base-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,qBAAa,UAAU;IACnB,EAAE,EAAE,MAAM,CAAC;gBAEC,EAAE,EAAE,MAAM;IAItB,SAAS,CAAC,kBAAkB,CAAC,UAAU,EAAE,YAAY,GAAG,KAAK;IAI7D,SAAS,CAAC,qBAAqB,CAAC,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK;CAGnG"}
1
+ {"version":3,"file":"base-client.d.ts","sourceRoot":"","sources":["../../../src/resource-clients/common/base-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,qBAAa,UAAU;IACnB,EAAE,EAAE,MAAM,CAAC;gBAEC,EAAE,EAAE,MAAM;IAItB,SAAS,CAAC,kBAAkB,CAAC,UAAU,EAAE,YAAY,GAAG,KAAK;IAI7D,SAAS,CAAC,qBAAqB,CAAC,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK;CAGnG"}
@@ -1,5 +1,5 @@
1
1
  import type * as storage from '@crawlee/types';
2
- import { MemoryStorage } from '../index';
2
+ import type { MemoryStorage } from '../index';
3
3
  export interface DatasetCollectionClientOptions {
4
4
  baseStorageDirectory: string;
5
5
  client: MemoryStorage;
@@ -1 +1 @@
1
- {"version":3,"file":"dataset-collection.d.ts","sourceRoot":"","sources":["../../src/resource-clients/dataset-collection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAI/C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAIzC,MAAM,WAAW,8BAA8B;IAC3C,oBAAoB,EAAE,MAAM,CAAC;IAC7B,MAAM,EAAE,aAAa,CAAC;CACzB;AAED,qBAAa,uBAAwB,YAAW,OAAO,CAAC,uBAAuB;IAC3E,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;gBAE3B,EAAE,oBAAoB,EAAE,MAAM,EAAE,EAAE,8BAA8B;IAKtE,IAAI,IAAI,UAAU,CAAC,OAAO,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAa3D,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;CA4BjE"}
1
+ {"version":3,"file":"dataset-collection.d.ts","sourceRoot":"","sources":["../../src/resource-clients/dataset-collection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAI/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAI9C,MAAM,WAAW,8BAA8B;IAC3C,oBAAoB,EAAE,MAAM,CAAC;IAC7B,MAAM,EAAE,aAAa,CAAC;CACzB;AAED,qBAAa,uBAAwB,YAAW,OAAO,CAAC,uBAAuB;IAC3E,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;gBAE3B,EAAE,oBAAoB,EAAE,MAAM,EAAE,EAAE,8BAA8B;IAKtE,IAAI,IAAI,UAAU,CAAC,OAAO,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAa3D,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;CA4BjE"}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import type * as storage from '@crawlee/types';
3
- import { Dictionary } from '@crawlee/utils';
4
- import { MemoryStorage } from '../index';
3
+ import type { Dictionary } from '@crawlee/types';
4
+ import type { MemoryStorage } from '../index';
5
5
  import { BaseClient } from './common/base-client';
6
6
  export interface DatasetClientOptions {
7
7
  id?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"dataset.d.ts","sourceRoot":"","sources":["../../src/resource-clients/dataset.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAM5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAgBlD,MAAM,WAAW,oBAAoB;IACjC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB,EAAE,MAAM,CAAC;IAC7B,MAAM,EAAE,aAAa,CAAC;CACzB;AAED,qBAAa,aAAa,CAAC,IAAI,SAAS,UAAU,GAAG,UAAU,CAAE,SAAQ,UAAW,YAAW,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC;IACtH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,OAAc;IACvB,UAAU,OAAc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