diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 69a8a24..0b24d07 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -13,6 +13,8 @@ env:
HOST: ${{ secrets.HOST }}
LLAMAPARSE_API_KEY: ${{ secrets.LLAMAPARSE_API_KEY }}
LOGTAIL_KEY: ${{ secrets.LOGTAIL_KEY }}
+ POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
+ POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }}
NUM_WORKERS_PER_QUEUE: ${{ secrets.NUM_WORKERS_PER_QUEUE }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
PLAYWRIGHT_MICROSERVICE_URL: ${{ secrets.PLAYWRIGHT_MICROSERVICE_URL }}
@@ -38,7 +40,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
- node-version: '20'
+ node-version: "20"
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
@@ -55,4 +57,4 @@ jobs:
- name: Run E2E tests
run: |
npm run test:prod
- working-directory: ./apps/api
\ No newline at end of file
+ working-directory: ./apps/api
diff --git a/.github/workflows/fly.yml b/.github/workflows/fly.yml
index ddeee55..09d81af 100644
--- a/.github/workflows/fly.yml
+++ b/.github/workflows/fly.yml
@@ -13,6 +13,8 @@ env:
HOST: ${{ secrets.HOST }}
LLAMAPARSE_API_KEY: ${{ secrets.LLAMAPARSE_API_KEY }}
LOGTAIL_KEY: ${{ secrets.LOGTAIL_KEY }}
+ POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
+ POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }}
NUM_WORKERS_PER_QUEUE: ${{ secrets.NUM_WORKERS_PER_QUEUE }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
PLAYWRIGHT_MICROSERVICE_URL: ${{ secrets.PLAYWRIGHT_MICROSERVICE_URL }}
@@ -38,7 +40,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
- node-version: '20'
+ node-version: "20"
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
@@ -56,10 +58,47 @@ jobs:
run: |
npm run test:prod
working-directory: ./apps/api
+
+ pre-deploy-test-suite:
+ name: Test Suite
+ needs: pre-deploy
+ runs-on: ubuntu-latest
+ services:
+ redis:
+ image: redis
+ ports:
+ - 6379:6379
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: "20"
+ - name: Install pnpm
+ run: npm install -g pnpm
+ - name: Install dependencies
+ run: pnpm install
+ working-directory: ./apps/api
+ - name: Start the application
+ run: npm start &
+ working-directory: ./apps/api
+ id: start_app
+ - name: Start workers
+ run: npm run workers &
+ working-directory: ./apps/api
+ id: start_workers
+ - name: Install dependencies
+ run: pnpm install
+ working-directory: ./apps/test-suite
+ - name: Run E2E tests
+ run: |
+ npm run test
+ working-directory: ./apps/test-suite
+
deploy:
name: Deploy app
runs-on: ubuntu-latest
- needs: pre-deploy
+ needs: pre-deploy-test-suite
steps:
- uses: actions/checkout@v3
- name: Change directory
@@ -68,4 +107,3 @@ jobs:
- run: flyctl deploy ./apps/api --remote-only -a firecrawl-scraper-js
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
-
diff --git a/.gitignore b/.gitignore
index 9029012..12baf7b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,9 @@ dump.rdb
apps/js-sdk/node_modules/
apps/api/.env.local
+
+apps/test-suite/node_modules/
+
+
+apps/test-suite/.env
+apps/test-suite/logs
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 733c787..87d8c28 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,26 +1,26 @@
-# Contributors guide:
+# Contributors guide:
-Welcome to [Firecrawl](https://firecrawl.dev) 🔥! Here are some instructions on how to get the project locally, so you can run it on your own (and contribute)
+Welcome to [Firecrawl](https://firecrawl.dev) 🔥! Here are some instructions on how to get the project locally, so you can run it on your own (and contribute)
If you're contributing, note that the process is similar to other open source repos i.e. (fork firecrawl, make changes, run tests, PR). If you have any questions, and would like help gettin on board, reach out to hello@mendable.ai for more or submit an issue!
-
## Running the project locally
First, start by installing dependencies
+
1. node.js [instructions](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs)
2. pnpm [instructions](https://pnpm.io/installation)
-3. redis [instructions](https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/)
+3. redis [instructions](https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/)
-
-Set environment variables in a .env in the /apps/api/ directoryyou can copy over the template in .env.example.
+Set environment variables in a .env in the /apps/api/ directoryyou can copy over the template in .env.example.
To start, we wont set up authentication, or any optional sub services (pdf parsing, JS blocking support, AI features )
.env:
+
```
# ===== Required ENVS ======
-NUM_WORKERS_PER_QUEUE=8
+NUM_WORKERS_PER_QUEUE=8
PORT=3002
HOST=0.0.0.0
REDIS_URL=redis://localhost:6379
@@ -31,8 +31,8 @@ USE_DB_AUTHENTICATION=false
# ===== Optional ENVS ======
# Supabase Setup (used to support DB authentication, advanced logging, etc.)
-SUPABASE_ANON_TOKEN=
-SUPABASE_URL=
+SUPABASE_ANON_TOKEN=
+SUPABASE_URL=
SUPABASE_SERVICE_TOKEN=
# Other Optionals
@@ -43,6 +43,11 @@ BULL_AUTH_KEY= #
LOGTAIL_KEY= # Use if you're configuring basic logging with logtail
PLAYWRIGHT_MICROSERVICE_URL= # set if you'd like to run a playwright fallback
LLAMAPARSE_API_KEY= #Set if you have a llamaparse key you'd like to use to parse pdfs
+SERPER_API_KEY= #Set if you have a serper key you'd like to use as a search api
+SLACK_WEBHOOK_URL= # set if you'd like to send slack server health status messages
+POSTHOG_API_KEY= # set if you'd like to send posthog events like job logs
+POSTHOG_HOST= # set if you'd like to send posthog events like job logs
+
```
@@ -56,7 +61,7 @@ pnpm install
### Running the project
-You're going to need to open 3 terminals.
+You're going to need to open 3 terminals.
### Terminal 1 - setting up redis
@@ -69,6 +74,7 @@ redis-server
### Terminal 2 - setting up workers
Now, navigate to the apps/api/ directory and run:
+
```bash
pnpm run workers
```
@@ -77,7 +83,6 @@ This will start the workers who are responsible for processing crawl jobs.
### Terminal 3 - setting up the main server
-
To do this, navigate to the apps/api/ directory and run if you don’t have this already, install pnpm here: https://pnpm.io/installation
Next, run your server with:
@@ -91,11 +96,11 @@ Alright: now let’s send our first request.
```curl
curl -X GET http://localhost:3002/test
-```
+```
+
This should return the response Hello, world!
-
-If you’d like to test the crawl endpoint, you can run this
+If you’d like to test the crawl endpoint, you can run this
```curl
curl -X POST http://localhost:3002/v0/crawl \
@@ -103,12 +108,10 @@ curl -X POST http://localhost:3002/v0/crawl \
-d '{
"url": "https://mendable.ai"
}'
-```
-
+```
+
## Tests:
The best way to do this is run the test with `npm run test:local-no-auth` if you'd like to run the tests without authentication.
If you'd like to run the tests with authentication, run `npm run test:prod`
-
-
diff --git a/LICENSE b/LICENSE
index 9c3d8a0..0ad25db 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,201 +1,661 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
+ GNU AFFERO GENERAL PUBLIC LICENSE
+ Version 3, 19 November 2007
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
- 1. Definitions.
+ Preamble
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
+ The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
+ Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
+ A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate. Many developers of free software are heartened and
+encouraged by the resulting cooperation. However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
+ The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community. It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server. Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
+ An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals. This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
+ The precise terms and conditions for copying, distribution and
+modification follow.
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
+ TERMS AND CONDITIONS
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
+ 0. Definitions.
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
+ "This License" refers to version 3 of the GNU Affero General Public License.
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
+ 1. Source Code.
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
- END OF TERMS AND CONDITIONS
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
- APPENDIX: How to apply the Apache License to your work.
+ The Corresponding Source for a work in source code form is that
+same work.
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
+ 2. Basic Permissions.
- Copyright 2024 Firecrawl | Mendable.ai
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
- http://www.apache.org/licenses/LICENSE-2.0
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Remote Network Interaction; Use with the GNU General Public License.
+
+ Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software. This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+.
diff --git a/README.md b/README.md
index 5d0a485..3b3968f 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
# 🔥 Firecrawl
-Crawl and convert any website into LLM-ready markdown. Build by [Mendable.ai](https://mendable.ai?ref=gfirecrawl)
+Crawl and convert any website into LLM-ready markdown. Built by [Mendable.ai](https://mendable.ai?ref=gfirecrawl) and the firecrawl community.
-_This repository is currently in its early stages of development. We are in the process of merging custom modules into this mono repository. The primary objective is to enhance the accuracy of LLM responses by utilizing clean data. It is not ready for full self-host yet - we're working on it_
+_This repository is in its early development stages. We are still merging custom modules in the mono repo. It's not completely yet ready for full self-host deployment, but you can already run it locally._
## What is Firecrawl?
@@ -147,7 +147,73 @@ curl -X POST https://api.firecrawl.dev/v0/search \
}
```
-Coming soon to the Langchain and LLama Index integrations.
+### Intelligent Extraction (Beta)
+
+Used to extract structured data from scraped pages.
+
+```bash
+curl -X POST https://api.firecrawl.dev/v0/scrape \
+ -H 'Content-Type: application/json' \
+ -H 'Authorization: Bearer YOUR_API_KEY' \
+ -d '{
+ "url": "https://www.mendable.ai/",
+ "extractorOptions": {
+ "mode": "llm-extraction",
+ "extractionPrompt": "Based on the information on the page, extract the information from the schema. ",
+ "extractionSchema": {
+ "type": "object",
+ "properties": {
+ "company_mission": {
+ "type": "string"
+ },
+ "supports_sso": {
+ "type": "boolean"
+ },
+ "is_open_source": {
+ "type": "boolean"
+ },
+ "is_in_yc": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "company_mission",
+ "supports_sso",
+ "is_open_source",
+ "is_in_yc"
+ ]
+ }
+ }
+ }'
+```
+
+```json
+{
+ "success": true,
+ "data": {
+ "content": "Raw Content",
+ "metadata": {
+ "title": "Mendable",
+ "description": "Mendable allows you to easily build AI chat applications. Ingest, customize, then deploy with one line of code anywhere you want. Brought to you by SideGuide",
+ "robots": "follow, index",
+ "ogTitle": "Mendable",
+ "ogDescription": "Mendable allows you to easily build AI chat applications. Ingest, customize, then deploy with one line of code anywhere you want. Brought to you by SideGuide",
+ "ogUrl": "https://mendable.ai/",
+ "ogImage": "https://mendable.ai/mendable_new_og1.png",
+ "ogLocaleAlternate": [],
+ "ogSiteName": "Mendable",
+ "sourceURL": "https://mendable.ai/"
+ },
+ "llm_extraction": {
+ "company_mission": "Train a secure AI on your technical resources that answers customer and employee questions so your team doesn't have to",
+ "supports_sso": true,
+ "is_open_source": false,
+ "is_in_yc": true
+ }
+ }
+}
+
+```
## Using Python SDK
@@ -180,18 +246,166 @@ url = 'https://example.com'
scraped_data = app.scrape_url(url)
```
+### Extracting structured data from a URL
+
+With LLM extraction, you can easily extract structured data from any URL. We support pydanti schemas to make it easier for you too. Here is how you to use it:
+
+```python
+class ArticleSchema(BaseModel):
+ title: str
+ points: int
+ by: str
+ commentsURL: str
+
+class TopArticlesSchema(BaseModel):
+ top: List[ArticleSchema] = Field(..., max_items=5, description="Top 5 stories")
+
+data = app.scrape_url('https://news.ycombinator.com', {
+ 'extractorOptions': {
+ 'extractionSchema': TopArticlesSchema.model_json_schema(),
+ 'mode': 'llm-extraction'
+ },
+ 'pageOptions':{
+ 'onlyMainContent': True
+ }
+})
+print(data["llm_extraction"])
+```
+
### Search for a query
Performs a web search, retrieve the top results, extract data from each page, and returns their markdown.
```python
-query = 'what is mendable?'
+query = 'What is Mendable?'
search_result = app.search(query)
```
+## Using the Node SDK
+
+### Installation
+
+To install the Firecrawl Node SDK, you can use npm:
+
+```bash
+npm install @mendable/firecrawl-js
+```
+
+### Usage
+
+1. Get an API key from [firecrawl.dev](https://firecrawl.dev)
+2. Set the API key as an environment variable named `FIRECRAWL_API_KEY` or pass it as a parameter to the `FirecrawlApp` class.
+
+
+### Scraping a URL
+
+To scrape a single URL with error handling, use the `scrapeUrl` method. It takes the URL as a parameter and returns the scraped data as a dictionary.
+
+```js
+try {
+ const url = 'https://example.com';
+ const scrapedData = await app.scrapeUrl(url);
+ console.log(scrapedData);
+
+} catch (error) {
+ console.error(
+ 'Error occurred while scraping:',
+ error.message
+ );
+}
+```
+
+
+### Crawling a Website
+
+To crawl a website with error handling, use the `crawlUrl` method. It takes the starting URL and optional parameters as arguments. The `params` argument allows you to specify additional options for the crawl job, such as the maximum number of pages to crawl, allowed domains, and the output format.
+
+```js
+const crawlUrl = 'https://example.com';
+const params = {
+ crawlerOptions: {
+ excludes: ['blog/'],
+ includes: [], // leave empty for all pages
+ limit: 1000,
+ },
+ pageOptions: {
+ onlyMainContent: true
+ }
+};
+const waitUntilDone = true;
+const timeout = 5;
+const crawlResult = await app.crawlUrl(
+ crawlUrl,
+ params,
+ waitUntilDone,
+ timeout
+);
+
+```
+
+
+### Checking Crawl Status
+
+To check the status of a crawl job with error handling, use the `checkCrawlStatus` method. It takes the job ID as a parameter and returns the current status of the crawl job.
+
+```js
+const status = await app.checkCrawlStatus(jobId);
+console.log(status);
+```
+
+
+
+### Extracting structured data from a URL
+
+With LLM extraction, you can easily extract structured data from any URL. We support zod schema to make it easier for you too. Here is how you to use it:
+
+```js
+import FirecrawlApp from "@mendable/firecrawl-js";
+import { z } from "zod";
+
+const app = new FirecrawlApp({
+ apiKey: "fc-YOUR_API_KEY",
+});
+
+// Define schema to extract contents into
+const schema = z.object({
+ top: z
+ .array(
+ z.object({
+ title: z.string(),
+ points: z.number(),
+ by: z.string(),
+ commentsURL: z.string(),
+ })
+ )
+ .length(5)
+ .describe("Top 5 stories on Hacker News"),
+});
+
+const scrapeResult = await app.scrapeUrl("https://news.ycombinator.com", {
+ extractorOptions: { extractionSchema: schema },
+});
+
+console.log(scrapeResult.data["llm_extraction"]);
+```
+
+### Search for a query
+
+With the `search` method, you can search for a query in a search engine and get the top results along with the page content for each result. The method takes the query as a parameter and returns the search results.
+
+```js
+const query = 'what is mendable?';
+const searchResults = await app.search(query, {
+ pageOptions: {
+ fetchPageContent: true // Fetch the page content for each search result
+ }
+});
+
+```
+
+
## Contributing
We love contributions! Please read our [contributing guide](CONTRIBUTING.md) before submitting a pull request.
-
*It is the sole responsibility of the end users to respect websites' policies when scraping, searching and crawling with Firecrawl. Users are advised to adhere to the applicable privacy policies and terms of use of the websites prior to initiating any scraping activities. By default, Firecrawl respects the directives specified in the websites' robots.txt files when crawling. By utilizing Firecrawl, you expressly agree to comply with these conditions.*
diff --git a/apps/api/.env.example b/apps/api/.env.example
index e33c5f4..b025326 100644
--- a/apps/api/.env.example
+++ b/apps/api/.env.example
@@ -24,3 +24,6 @@ PLAYWRIGHT_MICROSERVICE_URL= # set if you'd like to run a playwright fallback
LLAMAPARSE_API_KEY= #Set if you have a llamaparse key you'd like to use to parse pdfs
SERPER_API_KEY= #Set if you have a serper key you'd like to use as a search api
SLACK_WEBHOOK_URL= # set if you'd like to send slack server health status messages
+POSTHOG_API_KEY= # set if you'd like to send posthog events like job logs
+POSTHOG_HOST= # set if you'd like to send posthog events like job logs
+
diff --git a/apps/api/fly.toml b/apps/api/fly.toml
index 4d285eb..ca619d1 100644
--- a/apps/api/fly.toml
+++ b/apps/api/fly.toml
@@ -17,11 +17,16 @@ kill_timeout = '5s'
[http_service]
internal_port = 8080
force_https = true
- auto_stop_machines = true
+ auto_stop_machines = false
auto_start_machines = true
- min_machines_running = 0
+ min_machines_running = 2
processes = ['app']
+[http_service.concurrency]
+ type = "requests"
+ hard_limit = 200
+ soft_limit = 100
+
[[services]]
protocol = 'tcp'
internal_port = 8080
@@ -38,10 +43,14 @@ kill_timeout = '5s'
[services.concurrency]
type = 'connections'
- hard_limit = 45
- soft_limit = 20
+ hard_limit = 75
+ soft_limit = 30
[[vm]]
- size = 'performance-1x'
+ size = 'performance-4x'
+ processes = ['app']
+
+
+
diff --git a/apps/api/package.json b/apps/api/package.json
index 078c6b6..a79e3dc 100644
--- a/apps/api/package.json
+++ b/apps/api/package.json
@@ -46,11 +46,12 @@
"@bull-board/api": "^5.14.2",
"@bull-board/express": "^5.8.0",
"@devil7softwares/pos": "^1.0.2",
- "@dqbd/tiktoken": "^1.0.7",
+ "@dqbd/tiktoken": "^1.0.13",
"@logtail/node": "^0.4.12",
"@nangohq/node": "^0.36.33",
"@sentry/node": "^7.48.0",
"@supabase/supabase-js": "^2.7.1",
+ "ajv": "^8.12.0",
"async": "^3.2.5",
"async-mutex": "^0.4.0",
"axios": "^1.3.4",
@@ -68,6 +69,7 @@
"gpt3-tokenizer": "^1.1.5",
"ioredis": "^5.3.2",
"joplin-turndown-plugin-gfm": "^1.0.12",
+ "json-schema-to-zod": "^2.1.0",
"keyword-extractor": "^0.0.25",
"langchain": "^0.1.25",
"languagedetect": "^2.0.0",
@@ -80,6 +82,7 @@
"openai": "^4.28.4",
"pdf-parse": "^1.1.1",
"pos": "^0.4.2",
+ "posthog-node": "^4.0.1",
"promptable": "^0.0.9",
"puppeteer": "^22.6.3",
"rate-limiter-flexible": "^2.4.2",
@@ -93,7 +96,9 @@
"unstructured-client": "^0.9.4",
"uuid": "^9.0.1",
"wordpos": "^2.1.0",
- "xml2js": "^0.6.2"
+ "xml2js": "^0.6.2",
+ "zod": "^3.23.4",
+ "zod-to-json-schema": "^3.23.0"
},
"nodemonConfig": {
"ignore": [
diff --git a/apps/api/pnpm-lock.yaml b/apps/api/pnpm-lock.yaml
index 2b61222..7873375 100644
--- a/apps/api/pnpm-lock.yaml
+++ b/apps/api/pnpm-lock.yaml
@@ -21,7 +21,7 @@ dependencies:
specifier: ^1.0.2
version: 1.0.2
'@dqbd/tiktoken':
- specifier: ^1.0.7
+ specifier: ^1.0.13
version: 1.0.13
'@logtail/node':
specifier: ^0.4.12
@@ -35,6 +35,9 @@ dependencies:
'@supabase/supabase-js':
specifier: ^2.7.1
version: 2.39.7
+ ajv:
+ specifier: ^8.12.0
+ version: 8.12.0
async:
specifier: ^3.2.5
version: 3.2.5
@@ -86,6 +89,9 @@ dependencies:
joplin-turndown-plugin-gfm:
specifier: ^1.0.12
version: 1.0.12
+ json-schema-to-zod:
+ specifier: ^2.1.0
+ version: 2.1.0
keyword-extractor:
specifier: ^0.0.25
version: 0.0.25
@@ -122,6 +128,9 @@ dependencies:
pos:
specifier: ^0.4.2
version: 0.4.2
+ posthog-node:
+ specifier: ^4.0.1
+ version: 4.0.1
promptable:
specifier: ^0.0.9
version: 0.0.9
@@ -164,6 +173,12 @@ dependencies:
xml2js:
specifier: ^0.6.2
version: 0.6.2
+ zod:
+ specifier: ^3.23.4
+ version: 3.23.4
+ zod-to-json-schema:
+ specifier: ^3.23.0
+ version: 3.23.0(zod@3.23.4)
devDependencies:
'@flydotio/dockerfile':
@@ -1200,7 +1215,7 @@ packages:
redis: 4.6.13
typesense: 1.7.2(@babel/runtime@7.24.0)
uuid: 9.0.1
- zod: 3.22.4
+ zod: 3.23.4
transitivePeerDependencies:
- encoding
dev: false
@@ -1218,8 +1233,8 @@ packages:
p-queue: 6.6.2
p-retry: 4.6.2
uuid: 9.0.1
- zod: 3.22.4
- zod-to-json-schema: 3.22.4(zod@3.22.4)
+ zod: 3.23.4
+ zod-to-json-schema: 3.23.0(zod@3.23.4)
dev: false
/@langchain/openai@0.0.18:
@@ -1229,8 +1244,8 @@ packages:
'@langchain/core': 0.1.43
js-tiktoken: 1.0.10
openai: 4.28.4
- zod: 3.22.4
- zod-to-json-schema: 3.22.4(zod@3.22.4)
+ zod: 3.23.4
+ zod-to-json-schema: 3.23.0(zod@3.23.4)
transitivePeerDependencies:
- encoding
dev: false
@@ -1811,6 +1826,15 @@ packages:
humanize-ms: 1.2.1
dev: false
+ /ajv@8.12.0:
+ resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==}
+ dependencies:
+ fast-deep-equal: 3.1.3
+ json-schema-traverse: 1.0.0
+ require-from-string: 2.0.2
+ uri-js: 4.4.1
+ dev: false
+
/ansi-escapes@4.3.2:
resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==}
engines: {node: '>=8'}
@@ -2917,6 +2941,10 @@ packages:
- supports-color
dev: false
+ /fast-deep-equal@3.1.3:
+ resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
+ dev: false
+
/fast-fifo@1.3.2:
resolution: {integrity: sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==}
dev: false
@@ -3985,6 +4013,15 @@ packages:
/json-parse-even-better-errors@2.3.1:
resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}
+ /json-schema-to-zod@2.1.0:
+ resolution: {integrity: sha512-7ishNgYY+AbIKeeHcp5xCOdJbdVwSfDx/4V2ktc16LUusCJJbz2fEKdWUmAxhKIiYzhZ9Fp4E8OsAoM/h9cOLA==}
+ hasBin: true
+ dev: false
+
+ /json-schema-traverse@1.0.0:
+ resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}
+ dev: false
+
/json5@2.2.3:
resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==}
engines: {node: '>=6'}
@@ -4209,8 +4246,8 @@ packages:
redis: 4.6.13
uuid: 9.0.1
yaml: 2.4.1
- zod: 3.22.4
- zod-to-json-schema: 3.22.4(zod@3.22.4)
+ zod: 3.23.4
+ zod-to-json-schema: 3.23.0(zod@3.23.4)
transitivePeerDependencies:
- '@aws-crypto/sha256-js'
- '@aws-sdk/client-bedrock-agent-runtime'
@@ -5034,6 +5071,16 @@ packages:
source-map-js: 1.0.2
dev: false
+ /posthog-node@4.0.1:
+ resolution: {integrity: sha512-rtqm2h22QxLGBrW2bLYzbRhliIrqgZ0k+gF0LkQ1SNdeD06YE5eilV0MxZppFSxC8TfH0+B0cWCuebEnreIDgQ==}
+ engines: {node: '>=15.0.0'}
+ dependencies:
+ axios: 1.6.7
+ rusha: 0.8.14
+ transitivePeerDependencies:
+ - debug
+ dev: false
+
/prelude-ls@1.1.2:
resolution: {integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==}
engines: {node: '>= 0.8.0'}
@@ -5069,7 +5116,7 @@ packages:
sbd: 1.0.19
typescript: 5.4.5
uuid: 9.0.1
- zod: 3.22.4
+ zod: 3.23.4
transitivePeerDependencies:
- debug
dev: false
@@ -5250,6 +5297,11 @@ packages:
resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
engines: {node: '>=0.10.0'}
+ /require-from-string@2.0.2:
+ resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
+ engines: {node: '>=0.10.0'}
+ dev: false
+
/resolve-cwd@3.0.0:
resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==}
engines: {node: '>=8'}
@@ -5291,6 +5343,10 @@ packages:
engines: {node: '>=10.0.0'}
dev: false
+ /rusha@0.8.14:
+ resolution: {integrity: sha512-cLgakCUf6PedEu15t8kbsjnwIFFR2D4RfL+W3iWFJ4iac7z4B0ZI8fxy4R3J956kAI68HclCFGL8MPoUVC3qVA==}
+ dev: false
+
/safe-buffer@5.2.1:
resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
@@ -5956,6 +6012,12 @@ packages:
picocolors: 1.0.0
dev: true
+ /uri-js@4.4.1:
+ resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
+ dependencies:
+ punycode: 2.3.1
+ dev: false
+
/urlpattern-polyfill@10.0.0:
resolution: {integrity: sha512-H/A06tKD7sS1O1X2SshBVeA5FLycRpjqiBeqGKmBwBDBy28EnRjORxTNe269KSSr5un5qyWi1iL61wLxpd+ZOg==}
dev: false
@@ -6185,14 +6247,18 @@ packages:
engines: {node: '>=10'}
dev: true
- /zod-to-json-schema@3.22.4(zod@3.22.4):
- resolution: {integrity: sha512-2Ed5dJ+n/O3cU383xSY28cuVi0BCQhF8nYqWU5paEpl7fVdqdAmiLdqLyfblbNdfOFwFfi/mqU4O1pwc60iBhQ==}
+ /zod-to-json-schema@3.23.0(zod@3.23.4):
+ resolution: {integrity: sha512-az0uJ243PxsRIa2x1WmNE/pnuA05gUq/JB8Lwe1EDCCL/Fz9MgjYQ0fPlyc2Tcv6aF2ZA7WM5TWaRZVEFaAIag==}
peerDependencies:
- zod: ^3.22.4
+ zod: ^3.23.3
dependencies:
- zod: 3.22.4
+ zod: 3.23.4
dev: false
/zod@3.22.4:
resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==}
dev: false
+
+ /zod@3.23.4:
+ resolution: {integrity: sha512-/AtWOKbBgjzEYYQRNfoGKHObgfAZag6qUJX1VbHo2PRBgS+wfWagEY2mizjfyAPcGesrJOcx/wcl0L9WnVrHFw==}
+ dev: false
diff --git a/apps/api/src/__tests__/e2e_noAuth/index.test.ts b/apps/api/src/__tests__/e2e_noAuth/index.test.ts
index 271e848..c443e71 100644
--- a/apps/api/src/__tests__/e2e_noAuth/index.test.ts
+++ b/apps/api/src/__tests__/e2e_noAuth/index.test.ts
@@ -25,6 +25,8 @@ describe("E2E Tests for API Routes with No Authentication", () => {
process.env.PLAYWRIGHT_MICROSERVICE_URL = "";
process.env.LLAMAPARSE_API_KEY = "";
process.env.TEST_API_KEY = "";
+ process.env.POSTHOG_API_KEY = "";
+ process.env.POSTHOG_HOST = "";
});
// restore original process.env
@@ -199,7 +201,8 @@ describe("E2E Tests for API Routes with No Authentication", () => {
expect(completedResponse.body.data[0]).toHaveProperty("content");
expect(completedResponse.body.data[0]).toHaveProperty("markdown");
expect(completedResponse.body.data[0]).toHaveProperty("metadata");
- expect(completedResponse.body.data[0].content).toContain("🔥 FireCrawl");
+
+
}, 60000); // 60 seconds
});
diff --git a/apps/api/src/__tests__/e2e_withAuth/index.test.ts b/apps/api/src/__tests__/e2e_withAuth/index.test.ts
index 6bf5a19..a49b169 100644
--- a/apps/api/src/__tests__/e2e_withAuth/index.test.ts
+++ b/apps/api/src/__tests__/e2e_withAuth/index.test.ts
@@ -7,322 +7,571 @@ dotenv.config();
// const TEST_URL = 'http://localhost:3002'
const TEST_URL = "http://127.0.0.1:3002";
+describe("E2E Tests for API Routes", () => {
+ beforeAll(() => {
+ process.env.USE_DB_AUTHENTICATION = "true";
+ });
- describe("E2E Tests for API Routes", () => {
- beforeAll(() => {
- process.env.USE_DB_AUTHENTICATION = "true";
+ afterAll(() => {
+ delete process.env.USE_DB_AUTHENTICATION;
+ });
+ describe("GET /", () => {
+ it("should return Hello, world! message", async () => {
+ const response = await request(TEST_URL).get("/");
+
+ expect(response.statusCode).toBe(200);
+ expect(response.text).toContain("SCRAPERS-JS: Hello, world! Fly.io");
+ });
+ });
+
+ describe("GET /test", () => {
+ it("should return Hello, world! message", async () => {
+ const response = await request(TEST_URL).get("/test");
+ expect(response.statusCode).toBe(200);
+ expect(response.text).toContain("Hello, world!");
+ });
+ });
+
+ describe("POST /v0/scrape", () => {
+ it("should require authorization", async () => {
+ const response = await request(app).post("/v0/scrape");
+ expect(response.statusCode).toBe(401);
});
- afterAll(() => {
- delete process.env.USE_DB_AUTHENTICATION;
- });
- describe("GET /", () => {
- it("should return Hello, world! message", async () => {
- const response = await request(TEST_URL).get("/");
-
- expect(response.statusCode).toBe(200);
- expect(response.text).toContain("SCRAPERS-JS: Hello, world! Fly.io");
- });
+ it("should return an error response with an invalid API key", async () => {
+ const response = await request(TEST_URL)
+ .post("/v0/scrape")
+ .set("Authorization", `Bearer invalid-api-key`)
+ .set("Content-Type", "application/json")
+ .send({ url: "https://firecrawl.dev" });
+ expect(response.statusCode).toBe(401);
});
- describe("GET /test", () => {
- it("should return Hello, world! message", async () => {
- const response = await request(TEST_URL).get("/test");
- expect(response.statusCode).toBe(200);
- expect(response.text).toContain("Hello, world!");
- });
+ it("should return an error for a blocklisted URL", async () => {
+ const blocklistedUrl = "https://facebook.com/fake-test";
+ const response = await request(TEST_URL)
+ .post("/v0/scrape")
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
+ .set("Content-Type", "application/json")
+ .send({ url: blocklistedUrl });
+ expect(response.statusCode).toBe(403);
+ expect(response.body.error).toContain(
+ "Firecrawl currently does not support social media scraping due to policy restrictions. We're actively working on building support for it."
+ );
});
- describe("POST /v0/scrape", () => {
- it("should require authorization", async () => {
- const response = await request(app).post("/v0/scrape");
- expect(response.statusCode).toBe(401);
- });
+ it("should return a successful response with a valid preview token", async () => {
+ const response = await request(TEST_URL)
+ .post("/v0/scrape")
+ .set("Authorization", `Bearer this_is_just_a_preview_token`)
+ .set("Content-Type", "application/json")
+ .send({ url: "https://firecrawl.dev" });
+ expect(response.statusCode).toBe(200);
+ }, 10000); // 10 seconds timeout
- it("should return an error response with an invalid API key", async () => {
- const response = await request(TEST_URL)
- .post("/v0/scrape")
- .set("Authorization", `Bearer invalid-api-key`)
- .set("Content-Type", "application/json")
- .send({ url: "https://firecrawl.dev" });
- expect(response.statusCode).toBe(401);
- });
+ it("should return a successful response with a valid API key", async () => {
+ const response = await request(TEST_URL)
+ .post("/v0/scrape")
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
+ .set("Content-Type", "application/json")
+ .send({ url: "https://firecrawl.dev" });
+ expect(response.statusCode).toBe(200);
+ expect(response.body).toHaveProperty("data");
+ expect(response.body.data).toHaveProperty("content");
+ expect(response.body.data).toHaveProperty("markdown");
+ expect(response.body.data).toHaveProperty("metadata");
+ expect(response.body.data).not.toHaveProperty("html");
+ expect(response.body.data.content).toContain("🔥 FireCrawl");
+ }, 30000); // 30 seconds timeout
- it("should return an error for a blocklisted URL", async () => {
- const blocklistedUrl = "https://facebook.com/fake-test";
- const response = await request(TEST_URL)
- .post("/v0/scrape")
- .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
- .set("Content-Type", "application/json")
- .send({ url: blocklistedUrl });
- expect(response.statusCode).toBe(403);
- expect(response.body.error).toContain("Firecrawl currently does not support social media scraping due to policy restrictions. We're actively working on building support for it.");
- });
+ it("should return a successful response with a valid API key and includeHtml set to true", async () => {
+ const response = await request(TEST_URL)
+ .post("/v0/scrape")
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
+ .set("Content-Type", "application/json")
+ .send({
+ url: "https://firecrawl.dev",
+ pageOptions: { includeHtml: true },
+ });
+ expect(response.statusCode).toBe(200);
+ expect(response.body).toHaveProperty("data");
+ expect(response.body.data).toHaveProperty("content");
+ expect(response.body.data).toHaveProperty("markdown");
+ expect(response.body.data).toHaveProperty("html");
+ expect(response.body.data).toHaveProperty("metadata");
+ expect(response.body.data.content).toContain("🔥 FireCrawl");
+ expect(response.body.data.markdown).toContain("🔥 FireCrawl");
+ expect(response.body.data.html).toContain(" {
+ const response = await request(TEST_URL)
+ .post('/v0/scrape')
+ .set('Authorization', `Bearer ${process.env.TEST_API_KEY}`)
+ .set('Content-Type', 'application/json')
+ .send({ url: 'https://arxiv.org/pdf/astro-ph/9301001.pdf' });
+ await new Promise((r) => setTimeout(r, 6000));
- it("should return a successful response with a valid preview token", async () => {
- const response = await request(TEST_URL)
- .post("/v0/scrape")
- .set("Authorization", `Bearer this_is_just_a_preview_token`)
- .set("Content-Type", "application/json")
- .send({ url: "https://firecrawl.dev" });
- expect(response.statusCode).toBe(200);
- }, 10000); // 10 seconds timeout
-
- it("should return a successful response with a valid API key", async () => {
- const response = await request(TEST_URL)
- .post("/v0/scrape")
- .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
- .set("Content-Type", "application/json")
- .send({ url: "https://firecrawl.dev" });
- expect(response.statusCode).toBe(200);
- expect(response.body).toHaveProperty("data");
- expect(response.body.data).toHaveProperty("content");
- expect(response.body.data).toHaveProperty("markdown");
- expect(response.body.data).toHaveProperty("metadata");
- expect(response.body.data.content).toContain("🔥 FireCrawl");
- }, 30000); // 30 seconds timeout
-
- it('should return a successful response for a valid scrape with PDF file', async () => {
- const response = await request(TEST_URL)
- .post('/v0/scrape')
- .set('Authorization', `Bearer ${process.env.TEST_API_KEY}`)
- .set('Content-Type', 'application/json')
- .send({ url: 'https://arxiv.org/pdf/astro-ph/9301001.pdf' });
- await new Promise((r) => setTimeout(r, 6000));
-
- expect(response.statusCode).toBe(200);
- expect(response.body).toHaveProperty('data');
- expect(response.body.data).toHaveProperty('content');
- expect(response.body.data).toHaveProperty('metadata');
- expect(response.body.data.content).toContain('We present spectrophotometric observations of the Broad Line Radio Galaxy');
- }, 30000); // 30 seconds
+ expect(response.statusCode).toBe(200);
+ expect(response.body).toHaveProperty('data');
+ expect(response.body.data).toHaveProperty('content');
+ expect(response.body.data).toHaveProperty('metadata');
+ expect(response.body.data.content).toContain('We present spectrophotometric observations of the Broad Line Radio Galaxy');
+ }, 30000); // 30 seconds
- it('should return a successful response for a valid scrape with PDF file without explicit .pdf extension', async () => {
- const response = await request(TEST_URL)
- .post('/v0/scrape')
- .set('Authorization', `Bearer ${process.env.TEST_API_KEY}`)
- .set('Content-Type', 'application/json')
- .send({ url: 'https://arxiv.org/pdf/astro-ph/9301001' });
- await new Promise((r) => setTimeout(r, 6000));
-
- expect(response.statusCode).toBe(200);
- expect(response.body).toHaveProperty('data');
- expect(response.body.data).toHaveProperty('content');
- expect(response.body.data).toHaveProperty('metadata');
- expect(response.body.data.content).toContain('We present spectrophotometric observations of the Broad Line Radio Galaxy');
- }, 30000); // 30 seconds
+ it('should return a successful response for a valid scrape with PDF file without explicit .pdf extension', async () => {
+ const response = await request(TEST_URL)
+ .post('/v0/scrape')
+ .set('Authorization', `Bearer ${process.env.TEST_API_KEY}`)
+ .set('Content-Type', 'application/json')
+ .send({ url: 'https://arxiv.org/pdf/astro-ph/9301001' });
+ await new Promise((r) => setTimeout(r, 6000));
+
+ expect(response.statusCode).toBe(200);
+ expect(response.body).toHaveProperty('data');
+ expect(response.body.data).toHaveProperty('content');
+ expect(response.body.data).toHaveProperty('metadata');
+ expect(response.body.data.content).toContain('We present spectrophotometric observations of the Broad Line Radio Galaxy');
+ }, 30000); // 30 seconds
+ });
+
+ describe("POST /v0/crawl", () => {
+ it("should require authorization", async () => {
+ const response = await request(TEST_URL).post("/v0/crawl");
+ expect(response.statusCode).toBe(401);
});
- describe("POST /v0/crawl", () => {
- it("should require authorization", async () => {
- const response = await request(TEST_URL).post("/v0/crawl");
- expect(response.statusCode).toBe(401);
- });
-
- it("should return an error response with an invalid API key", async () => {
- const response = await request(TEST_URL)
- .post("/v0/crawl")
- .set("Authorization", `Bearer invalid-api-key`)
- .set("Content-Type", "application/json")
- .send({ url: "https://firecrawl.dev" });
- expect(response.statusCode).toBe(401);
- });
-
- it("should return an error for a blocklisted URL", async () => {
- const blocklistedUrl = "https://twitter.com/fake-test";
- const response = await request(TEST_URL)
- .post("/v0/crawl")
- .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
- .set("Content-Type", "application/json")
- .send({ url: blocklistedUrl });
- expect(response.statusCode).toBe(403);
- expect(response.body.error).toContain("Firecrawl currently does not support social media scraping due to policy restrictions. We're actively working on building support for it.");
- });
-
- it("should return a successful response with a valid API key", async () => {
- const response = await request(TEST_URL)
- .post("/v0/crawl")
- .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
- .set("Content-Type", "application/json")
- .send({ url: "https://firecrawl.dev" });
- expect(response.statusCode).toBe(200);
- expect(response.body).toHaveProperty("jobId");
- expect(response.body.jobId).toMatch(
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/
- );
- });
-
-
- // Additional tests for insufficient credits?
+ it("should return an error response with an invalid API key", async () => {
+ const response = await request(TEST_URL)
+ .post("/v0/crawl")
+ .set("Authorization", `Bearer invalid-api-key`)
+ .set("Content-Type", "application/json")
+ .send({ url: "https://firecrawl.dev" });
+ expect(response.statusCode).toBe(401);
});
- describe("POST /v0/crawlWebsitePreview", () => {
- it("should require authorization", async () => {
- const response = await request(TEST_URL).post(
- "/v0/crawlWebsitePreview"
- );
- expect(response.statusCode).toBe(401);
- });
-
- it("should return an error response with an invalid API key", async () => {
- const response = await request(TEST_URL)
- .post("/v0/crawlWebsitePreview")
- .set("Authorization", `Bearer invalid-api-key`)
- .set("Content-Type", "application/json")
- .send({ url: "https://firecrawl.dev" });
- expect(response.statusCode).toBe(401);
- });
-
- it("should return an error for a blocklisted URL", async () => {
- const blocklistedUrl = "https://instagram.com/fake-test";
- const response = await request(TEST_URL)
- .post("/v0/crawlWebsitePreview")
- .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
- .set("Content-Type", "application/json")
- .send({ url: blocklistedUrl });
- expect(response.statusCode).toBe(403);
- expect(response.body.error).toContain("Firecrawl currently does not support social media scraping due to policy restrictions. We're actively working on building support for it.");
- });
-
- it("should return a successful response with a valid API key", async () => {
- const response = await request(TEST_URL)
- .post("/v0/crawlWebsitePreview")
- .set("Authorization", `Bearer this_is_just_a_preview_token`)
- .set("Content-Type", "application/json")
- .send({ url: "https://firecrawl.dev" });
- expect(response.statusCode).toBe(200);
- expect(response.body).toHaveProperty("jobId");
- expect(response.body.jobId).toMatch(
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/
- );
- });
+ it("should return an error for a blocklisted URL", async () => {
+ const blocklistedUrl = "https://twitter.com/fake-test";
+ const response = await request(TEST_URL)
+ .post("/v0/crawl")
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
+ .set("Content-Type", "application/json")
+ .send({ url: blocklistedUrl });
+ expect(response.statusCode).toBe(403);
+ expect(response.body.error).toContain(
+ "Firecrawl currently does not support social media scraping due to policy restrictions. We're actively working on building support for it."
+ );
});
- describe("POST /v0/search", () => {
- it("should require authorization", async () => {
- const response = await request(TEST_URL).post("/v0/search");
- expect(response.statusCode).toBe(401);
- });
-
- it("should return an error response with an invalid API key", async () => {
- const response = await request(TEST_URL)
- .post("/v0/search")
- .set("Authorization", `Bearer invalid-api-key`)
- .set("Content-Type", "application/json")
- .send({ query: "test" });
- expect(response.statusCode).toBe(401);
- });
-
-
-
- it("should return a successful response with a valid API key", async () => {
- const response = await request(TEST_URL)
- .post("/v0/search")
- .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
- .set("Content-Type", "application/json")
- .send({ query: "test" });
- expect(response.statusCode).toBe(200);
- expect(response.body).toHaveProperty("success");
- expect(response.body.success).toBe(true);
- expect(response.body).toHaveProperty("data");
- }, 30000); // 30 seconds timeout
+ it("should return a successful response with a valid API key", async () => {
+ const response = await request(TEST_URL)
+ .post("/v0/crawl")
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
+ .set("Content-Type", "application/json")
+ .send({ url: "https://firecrawl.dev" });
+ expect(response.statusCode).toBe(200);
+ expect(response.body).toHaveProperty("jobId");
+ expect(response.body.jobId).toMatch(
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/
+ );
});
- describe("GET /v0/crawl/status/:jobId", () => {
- it("should require authorization", async () => {
- const response = await request(TEST_URL).get("/v0/crawl/status/123");
- expect(response.statusCode).toBe(401);
- });
+ // Additional tests for insufficient credits?
+ });
- it("should return an error response with an invalid API key", async () => {
- const response = await request(TEST_URL)
- .get("/v0/crawl/status/123")
- .set("Authorization", `Bearer invalid-api-key`);
- expect(response.statusCode).toBe(401);
- });
+ describe("POST /v0/crawlWebsitePreview", () => {
+ it("should require authorization", async () => {
+ const response = await request(TEST_URL).post("/v0/crawlWebsitePreview");
+ expect(response.statusCode).toBe(401);
+ });
- it("should return Job not found for invalid job ID", async () => {
- const response = await request(TEST_URL)
- .get("/v0/crawl/status/invalidJobId")
- .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`);
- expect(response.statusCode).toBe(404);
- });
+ it("should return an error response with an invalid API key", async () => {
+ const response = await request(TEST_URL)
+ .post("/v0/crawlWebsitePreview")
+ .set("Authorization", `Bearer invalid-api-key`)
+ .set("Content-Type", "application/json")
+ .send({ url: "https://firecrawl.dev" });
+ expect(response.statusCode).toBe(401);
+ });
- it("should return a successful response for a valid crawl job", async () => {
- const crawlResponse = await request(TEST_URL)
- .post("/v0/crawl")
- .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
- .set("Content-Type", "application/json")
- .send({ url: "https://firecrawl.dev" });
- expect(crawlResponse.statusCode).toBe(200);
+ // it("should return an error for a blocklisted URL", async () => {
+ // const blocklistedUrl = "https://instagram.com/fake-test";
+ // const response = await request(TEST_URL)
+ // .post("/v0/crawlWebsitePreview")
+ // .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
+ // .set("Content-Type", "application/json")
+ // .send({ url: blocklistedUrl });
+ // // is returning 429 instead of 403
+ // expect(response.statusCode).toBe(403);
+ // expect(response.body.error).toContain("Firecrawl currently does not support social media scraping due to policy restrictions. We're actively working on building support for it.");
+ // });
- const response = await request(TEST_URL)
- .get(`/v0/crawl/status/${crawlResponse.body.jobId}`)
- .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`);
+ it("should return a successful response with a valid API key", async () => {
+ const response = await request(TEST_URL)
+ .post("/v0/crawlWebsitePreview")
+ .set("Authorization", `Bearer this_is_just_a_preview_token`)
+ .set("Content-Type", "application/json")
+ .send({ url: "https://firecrawl.dev" });
+ expect(response.statusCode).toBe(200);
+ expect(response.body).toHaveProperty("jobId");
+ expect(response.body.jobId).toMatch(
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/
+ );
+ });
+ });
+
+ describe("POST /v0/search", () => {
+ it("should require authorization", async () => {
+ const response = await request(TEST_URL).post("/v0/search");
+ expect(response.statusCode).toBe(401);
+ });
+
+ it("should return an error response with an invalid API key", async () => {
+ const response = await request(TEST_URL)
+ .post("/v0/search")
+ .set("Authorization", `Bearer invalid-api-key`)
+ .set("Content-Type", "application/json")
+ .send({ query: "test" });
+ expect(response.statusCode).toBe(401);
+ });
+
+ it("should return a successful response with a valid API key", async () => {
+ const response = await request(TEST_URL)
+ .post("/v0/search")
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
+ .set("Content-Type", "application/json")
+ .send({ query: "test" });
+ expect(response.statusCode).toBe(200);
+ expect(response.body).toHaveProperty("success");
+ expect(response.body.success).toBe(true);
+ expect(response.body).toHaveProperty("data");
+ }, 30000); // 30 seconds timeout
+ });
+
+ describe("GET /v0/crawl/status/:jobId", () => {
+ it("should require authorization", async () => {
+ const response = await request(TEST_URL).get("/v0/crawl/status/123");
+ expect(response.statusCode).toBe(401);
+ });
+
+ it("should return an error response with an invalid API key", async () => {
+ const response = await request(TEST_URL)
+ .get("/v0/crawl/status/123")
+ .set("Authorization", `Bearer invalid-api-key`);
+ expect(response.statusCode).toBe(401);
+ });
+
+ it("should return Job not found for invalid job ID", async () => {
+ const response = await request(TEST_URL)
+ .get("/v0/crawl/status/invalidJobId")
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`);
+ expect(response.statusCode).toBe(404);
+ });
+
+ it("should return a successful response for a valid crawl job", async () => {
+ const crawlResponse = await request(TEST_URL)
+ .post("/v0/crawl")
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
+ .set("Content-Type", "application/json")
+ .send({ url: "https://firecrawl.dev" });
+ expect(crawlResponse.statusCode).toBe(200);
+
+ const response = await request(TEST_URL)
+ .get(`/v0/crawl/status/${crawlResponse.body.jobId}`)
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`);
+ expect(response.statusCode).toBe(200);
+ expect(response.body).toHaveProperty("status");
+ expect(response.body.status).toBe("active");
+
+ // wait for 30 seconds
+ await new Promise((r) => setTimeout(r, 30000));
+
+ const completedResponse = await request(TEST_URL)
+ .get(`/v0/crawl/status/${crawlResponse.body.jobId}`)
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`);
+ expect(completedResponse.statusCode).toBe(200);
+ expect(completedResponse.body).toHaveProperty("status");
+ expect(completedResponse.body.status).toBe("completed");
+ expect(completedResponse.body).toHaveProperty("data");
+ expect(completedResponse.body.data[0]).toHaveProperty("content");
+ expect(completedResponse.body.data[0]).toHaveProperty("markdown");
+ expect(completedResponse.body.data[0]).toHaveProperty("metadata");
+ expect(completedResponse.body.data[0].content).toContain("🔥 FireCrawl");
+ }, 60000); // 60 seconds
+
+ it('should return a successful response for a valid crawl job with PDF files without explicit .pdf extension', async () => {
+ const crawlResponse = await request(TEST_URL)
+ .post('/v0/crawl')
+ .set('Authorization', `Bearer ${process.env.TEST_API_KEY}`)
+ .set('Content-Type', 'application/json')
+ .send({ url: 'https://arxiv.org/abs/astro-ph/9301001', crawlerOptions: { limit: 10, excludes: [ 'list/*', 'login', 'abs/*', 'static/*', 'about/*', 'archive/*' ] }});
+ expect(crawlResponse.statusCode).toBe(200);
+
+ const response = await request(TEST_URL)
+ .get(`/v0/crawl/status/${crawlResponse.body.jobId}`)
+ .set('Authorization', `Bearer ${process.env.TEST_API_KEY}`);
expect(response.statusCode).toBe(200);
- expect(response.body).toHaveProperty("status");
- expect(response.body.status).toBe("active");
+ expect(response.body).toHaveProperty('status');
+ expect(response.body.status).toBe('active');
// wait for 30 seconds
await new Promise((r) => setTimeout(r, 30000));
const completedResponse = await request(TEST_URL)
- .get(`/v0/crawl/status/${crawlResponse.body.jobId}`)
- .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`);
+ .get(`/v0/crawl/status/${crawlResponse.body.jobId}`)
+ .set('Authorization', `Bearer ${process.env.TEST_API_KEY}`);
+
expect(completedResponse.statusCode).toBe(200);
- expect(completedResponse.body).toHaveProperty("status");
- expect(completedResponse.body.status).toBe("completed");
- expect(completedResponse.body).toHaveProperty("data");
- expect(completedResponse.body.data[0]).toHaveProperty("content");
- expect(completedResponse.body.data[0]).toHaveProperty("markdown");
- expect(completedResponse.body.data[0]).toHaveProperty("metadata");
- expect(completedResponse.body.data[0].content).toContain(
- "🔥 FireCrawl"
+ expect(completedResponse.body).toHaveProperty('status');
+ expect(completedResponse.body.status).toBe('completed');
+ expect(completedResponse.body).toHaveProperty('data');
+ expect(completedResponse.body.data.length).toBeGreaterThan(1);
+ expect(completedResponse.body.data).toEqual(
+ expect.arrayContaining([
+ expect.objectContaining({
+ content: expect.stringContaining('asymmetries might represent, for instance, preferred source orientations to our line of sight.')
+ })
+ ])
);
- }, 60000); // 60 seconds
+ }, 60000); // 60 seconds
- it('should return a successful response for a valid crawl job with PDF files without explicit .pdf extension', async () => {
- const crawlResponse = await request(TEST_URL)
- .post('/v0/crawl')
- .set('Authorization', `Bearer ${process.env.TEST_API_KEY}`)
- .set('Content-Type', 'application/json')
- .send({ url: 'https://arxiv.org/abs/astro-ph/9301001', crawlerOptions: { limit: 10, excludes: [ 'list/*', 'login', 'abs/*', 'static/*', 'about/*', 'archive/*' ] }});
- expect(crawlResponse.statusCode).toBe(200);
-
- const response = await request(TEST_URL)
- .get(`/v0/crawl/status/${crawlResponse.body.jobId}`)
- .set('Authorization', `Bearer ${process.env.TEST_API_KEY}`);
- expect(response.statusCode).toBe(200);
- expect(response.body).toHaveProperty('status');
- expect(response.body.status).toBe('active');
-
- // wait for 30 seconds
- await new Promise((r) => setTimeout(r, 30000));
-
- const completedResponse = await request(TEST_URL)
- .get(`/v0/crawl/status/${crawlResponse.body.jobId}`)
- .set('Authorization', `Bearer ${process.env.TEST_API_KEY}`);
-
- expect(completedResponse.statusCode).toBe(200);
- expect(completedResponse.body).toHaveProperty('status');
- expect(completedResponse.body.status).toBe('completed');
- expect(completedResponse.body).toHaveProperty('data');
- expect(completedResponse.body.data.length).toBeGreaterThan(1);
- expect(completedResponse.body.data).toEqual(
- expect.arrayContaining([
- expect.objectContaining({
- content: expect.stringContaining('asymmetries might represent, for instance, preferred source orientations to our line of sight.')
- })
- ])
- );
- }, 60000); // 60 seconds
- });
+ it("should return a successful response with max depth option for a valid crawl job", async () => {
+ const crawlResponse = await request(TEST_URL)
+ .post("/v0/crawl")
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
+ .set("Content-Type", "application/json")
+ .send({
+ url: "https://www.scrapethissite.com",
+ crawlerOptions: { maxDepth: 2 },
+ });
+ expect(crawlResponse.statusCode).toBe(200);
- describe("GET /is-production", () => {
- it("should return the production status", async () => {
- const response = await request(TEST_URL).get("/is-production");
- expect(response.statusCode).toBe(200);
- expect(response.body).toHaveProperty("isProduction");
+ const response = await request(TEST_URL)
+ .get(`/v0/crawl/status/${crawlResponse.body.jobId}`)
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`);
+ expect(response.statusCode).toBe(200);
+ expect(response.body).toHaveProperty("status");
+ expect(response.body.status).toBe("active");
+ // wait for 60 seconds
+ await new Promise((r) => setTimeout(r, 60000));
+ const completedResponse = await request(TEST_URL)
+ .get(`/v0/crawl/status/${crawlResponse.body.jobId}`)
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`);
+
+ expect(completedResponse.statusCode).toBe(200);
+ expect(completedResponse.body).toHaveProperty("status");
+ expect(completedResponse.body.status).toBe("completed");
+ expect(completedResponse.body).toHaveProperty("data");
+ expect(completedResponse.body.data[0]).toHaveProperty("content");
+ expect(completedResponse.body.data[0]).toHaveProperty("markdown");
+ expect(completedResponse.body.data[0]).toHaveProperty("metadata");
+ const urls = completedResponse.body.data.map(
+ (item: any) => item.metadata?.sourceURL
+ );
+ expect(urls.length).toBeGreaterThan(1);
+
+ // Check if all URLs have a maximum depth of 1
+ urls.forEach((url) => {
+ const depth = new URL(url).pathname.split("/").filter(Boolean).length;
+ expect(depth).toBeLessThanOrEqual(1);
});
+ }, 120000);
+
+ it("should return a successful response for a valid crawl job with includeHtml set to true option", async () => {
+ const crawlResponse = await request(TEST_URL)
+ .post("/v0/crawl")
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
+ .set("Content-Type", "application/json")
+ .send({
+ url: "https://firecrawl.dev",
+ pageOptions: { includeHtml: true },
+ });
+ expect(crawlResponse.statusCode).toBe(200);
+
+ const response = await request(TEST_URL)
+ .get(`/v0/crawl/status/${crawlResponse.body.jobId}`)
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`);
+ expect(response.statusCode).toBe(200);
+ expect(response.body).toHaveProperty("status");
+ expect(response.body.status).toBe("active");
+
+ // wait for 30 seconds
+ await new Promise((r) => setTimeout(r, 30000));
+
+ const completedResponse = await request(TEST_URL)
+ .get(`/v0/crawl/status/${crawlResponse.body.jobId}`)
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`);
+
+ expect(completedResponse.statusCode).toBe(200);
+ expect(completedResponse.body).toHaveProperty("status");
+ expect(completedResponse.body.status).toBe("completed");
+ expect(completedResponse.body).toHaveProperty("data");
+ expect(completedResponse.body.data[0]).toHaveProperty("content");
+ expect(completedResponse.body.data[0]).toHaveProperty("markdown");
+ expect(completedResponse.body.data[0]).toHaveProperty("metadata");
+
+ // 120 seconds
+ expect(completedResponse.body.data[0]).toHaveProperty("html");
+ expect(completedResponse.body.data[0]).toHaveProperty("metadata");
+ expect(completedResponse.body.data[0].content).toContain("🔥 FireCrawl");
+ expect(completedResponse.body.data[0].markdown).toContain("FireCrawl");
+ expect(completedResponse.body.data[0].html).toContain(" {
+ const crawlResponse = await request(TEST_URL)
+ .post("/v0/crawl")
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
+ .set("Content-Type", "application/json")
+ .send({ url: "https://jestjs.io" });
+ expect(crawlResponse.statusCode).toBe(200);
+
+
+
+ // wait for 30 seconds
+ await new Promise((r) => setTimeout(r, 10000));
+
+ const response = await request(TEST_URL)
+ .delete(`/v0/crawl/cancel/${crawlResponse.body.jobId}`)
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`);
+ expect(response.statusCode).toBe(200);
+ expect(response.body).toHaveProperty("status");
+ expect(response.body.status).toBe("cancelled");
+
+ await new Promise((r) => setTimeout(r, 20000));
+
+ const completedResponse = await request(TEST_URL)
+ .get(`/v0/crawl/status/${crawlResponse.body.jobId}`)
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`);
+ expect(completedResponse.statusCode).toBe(200);
+ expect(completedResponse.body).toHaveProperty("status");
+ expect(completedResponse.body.status).toBe("failed");
+ expect(completedResponse.body).toHaveProperty("data");
+ expect(completedResponse.body.data).toEqual(null);
+ expect(completedResponse.body).toHaveProperty("partial_data");
+ expect(completedResponse.body.partial_data[0]).toHaveProperty("content");
+ expect(completedResponse.body.partial_data[0]).toHaveProperty("markdown");
+ expect(completedResponse.body.partial_data[0]).toHaveProperty("metadata");
+
+ }, 60000); // 60 seconds
+
+
+
+ describe("POST /v0/scrape with LLM Extraction", () => {
+ it("should extract data using LLM extraction mode", async () => {
+ const response = await request(TEST_URL)
+ .post("/v0/scrape")
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
+ .set("Content-Type", "application/json")
+ .send({
+ url: "https://mendable.ai",
+ pageOptions: {
+ onlyMainContent: true,
+ },
+ extractorOptions: {
+ mode: "llm-extraction",
+ extractionPrompt:
+ "Based on the information on the page, find what the company's mission is and whether it supports SSO, and whether it is open source",
+ extractionSchema: {
+ type: "object",
+ properties: {
+ company_mission: {
+ type: "string",
+ },
+ supports_sso: {
+ type: "boolean",
+ },
+ is_open_source: {
+ type: "boolean",
+ },
+ },
+ required: ["company_mission", "supports_sso", "is_open_source"],
+ },
+ },
+ });
+
+ // Ensure that the job was successfully created before proceeding with LLM extraction
+ expect(response.statusCode).toBe(200);
+
+ // Assuming the LLM extraction object is available in the response body under `data.llm_extraction`
+ let llmExtraction = response.body.data.llm_extraction;
+
+ // Check if the llm_extraction object has the required properties with correct types and values
+ expect(llmExtraction).toHaveProperty("company_mission");
+ expect(typeof llmExtraction.company_mission).toBe("string");
+ expect(llmExtraction).toHaveProperty("supports_sso");
+ expect(llmExtraction.supports_sso).toBe(true);
+ expect(typeof llmExtraction.supports_sso).toBe("boolean");
+ expect(llmExtraction).toHaveProperty("is_open_source");
+ expect(llmExtraction.is_open_source).toBe(false);
+ expect(typeof llmExtraction.is_open_source).toBe("boolean");
+ }, 60000); // 60 secs
+ });
+
+ // describe("POST /v0/scrape for Top 100 Companies", () => {
+ // it("should extract data for the top 100 companies", async () => {
+ // const response = await request(TEST_URL)
+ // .post("/v0/scrape")
+ // .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
+ // .set("Content-Type", "application/json")
+ // .send({
+ // url: "https://companiesmarketcap.com/",
+ // pageOptions: {
+ // onlyMainContent: true
+ // },
+ // extractorOptions: {
+ // mode: "llm-extraction",
+ // extractionPrompt: "Extract the name, market cap, price, and today's change for the top 20 companies listed on the page.",
+ // extractionSchema: {
+ // type: "object",
+ // properties: {
+ // companies: {
+ // type: "array",
+ // items: {
+ // type: "object",
+ // properties: {
+ // rank: { type: "number" },
+ // name: { type: "string" },
+ // marketCap: { type: "string" },
+ // price: { type: "string" },
+ // todayChange: { type: "string" }
+ // },
+ // required: ["rank", "name", "marketCap", "price", "todayChange"]
+ // }
+ // }
+ // },
+ // required: ["companies"]
+ // }
+ // }
+ // });
+
+ // // Print the response body to the console for debugging purposes
+ // console.log("Response companies:", response.body.data.llm_extraction.companies);
+
+ // // Check if the response has the correct structure and data types
+ // expect(response.status).toBe(200);
+ // expect(Array.isArray(response.body.data.llm_extraction.companies)).toBe(true);
+ // expect(response.body.data.llm_extraction.companies.length).toBe(40);
+
+ // // Sample check for the first company
+ // const firstCompany = response.body.data.llm_extraction.companies[0];
+ // expect(firstCompany).toHaveProperty("name");
+ // expect(typeof firstCompany.name).toBe("string");
+ // expect(firstCompany).toHaveProperty("marketCap");
+ // expect(typeof firstCompany.marketCap).toBe("string");
+ // expect(firstCompany).toHaveProperty("price");
+ // expect(typeof firstCompany.price).toBe("string");
+ // expect(firstCompany).toHaveProperty("todayChange");
+ // expect(typeof firstCompany.todayChange).toBe("string");
+ // }, 120000); // 120 secs
+ // });
+
+ describe("GET /is-production", () => {
+ it("should return the production status", async () => {
+ const response = await request(TEST_URL).get("/is-production");
+ expect(response.statusCode).toBe(200);
+ expect(response.body).toHaveProperty("isProduction");
});
});
+});
diff --git a/apps/api/src/controllers/auth.ts b/apps/api/src/controllers/auth.ts
index 2aa2297..77aa52f 100644
--- a/apps/api/src/controllers/auth.ts
+++ b/apps/api/src/controllers/auth.ts
@@ -38,7 +38,7 @@ export async function supaAuthenticateUser(
req.socket.remoteAddress) as string;
const iptoken = incomingIP + token;
await getRateLimiter(
- token === "this_is_just_a_preview_token" ? RateLimiterMode.Preview : mode
+ token === "this_is_just_a_preview_token" ? RateLimiterMode.Preview : mode, token
).consume(iptoken);
} catch (rateLimiterRes) {
console.error(rateLimiterRes);
diff --git a/apps/api/src/controllers/crawl-cancel.ts b/apps/api/src/controllers/crawl-cancel.ts
new file mode 100644
index 0000000..8e8ba31
--- /dev/null
+++ b/apps/api/src/controllers/crawl-cancel.ts
@@ -0,0 +1,62 @@
+import { Request, Response } from "express";
+import { authenticateUser } from "./auth";
+import { RateLimiterMode } from "../../src/types";
+import { addWebScraperJob } from "../../src/services/queue-jobs";
+import { getWebScraperQueue } from "../../src/services/queue-service";
+import { supabase_service } from "../../src/services/supabase";
+import { billTeam } from "../../src/services/billing/credit_billing";
+
+export async function crawlCancelController(req: Request, res: Response) {
+ try {
+ const { success, team_id, error, status } = await authenticateUser(
+ req,
+ res,
+ RateLimiterMode.CrawlStatus
+ );
+ if (!success) {
+ return res.status(status).json({ error });
+ }
+ const job = await getWebScraperQueue().getJob(req.params.jobId);
+ if (!job) {
+ return res.status(404).json({ error: "Job not found" });
+ }
+
+ // check if the job belongs to the team
+ const { data, error: supaError } = await supabase_service
+ .from("bulljobs_teams")
+ .select("*")
+ .eq("job_id", req.params.jobId)
+ .eq("team_id", team_id);
+ if (supaError) {
+ return res.status(500).json({ error: supaError.message });
+ }
+
+ if (data.length === 0) {
+ return res.status(403).json({ error: "Unauthorized" });
+ }
+ const jobState = await job.getState();
+ const { partialDocs } = await job.progress();
+
+ if (partialDocs && partialDocs.length > 0 && jobState === "active") {
+ console.log("Billing team for partial docs...");
+ // Note: the credits that we will bill them here might be lower than the actual
+ // due to promises that are not yet resolved
+ await billTeam(team_id, partialDocs.length);
+ }
+
+ try {
+ await job.moveToFailed(Error("Job cancelled by user"), true);
+ } catch (error) {
+ console.error(error);
+ }
+
+ const newJobState = await job.getState();
+
+ res.json({
+ status: newJobState === "failed" ? "cancelled" : "Cancelling...",
+ });
+ } catch (error) {
+ console.error(error);
+ return res.status(500).json({ error: error.message });
+ }
+}
diff --git a/apps/api/src/controllers/crawl-status.ts b/apps/api/src/controllers/crawl-status.ts
index 3534cd1..feda86c 100644
--- a/apps/api/src/controllers/crawl-status.ts
+++ b/apps/api/src/controllers/crawl-status.ts
@@ -19,7 +19,7 @@ export async function crawlStatusController(req: Request, res: Response) {
return res.status(404).json({ error: "Job not found" });
}
- const { current, current_url, total, current_step } = await job.progress();
+ const { current, current_url, total, current_step, partialDocs } = await job.progress();
res.json({
status: await job.getState(),
// progress: job.progress(),
@@ -28,6 +28,7 @@ export async function crawlStatusController(req: Request, res: Response) {
current_step: current_step,
total: total,
data: job.returnvalue,
+ partial_data: partialDocs ?? [],
});
} catch (error) {
console.error(error);
diff --git a/apps/api/src/controllers/crawl.ts b/apps/api/src/controllers/crawl.ts
index 3d64f7f..e53faed 100644
--- a/apps/api/src/controllers/crawl.ts
+++ b/apps/api/src/controllers/crawl.ts
@@ -6,6 +6,7 @@ import { authenticateUser } from "./auth";
import { RateLimiterMode } from "../../src/types";
import { addWebScraperJob } from "../../src/services/queue-jobs";
import { isUrlBlocked } from "../../src/scraper/WebScraper/utils/blocklist";
+import { logCrawl } from "../../src/services/logging/crawl_log";
export async function crawlController(req: Request, res: Response) {
try {
@@ -30,12 +31,17 @@ export async function crawlController(req: Request, res: Response) {
}
if (isUrlBlocked(url)) {
- return res.status(403).json({ error: "Firecrawl currently does not support social media scraping due to policy restrictions. We're actively working on building support for it." });
+ return res
+ .status(403)
+ .json({
+ error:
+ "Firecrawl currently does not support social media scraping due to policy restrictions. We're actively working on building support for it.",
+ });
}
-
+
const mode = req.body.mode ?? "crawl";
const crawlerOptions = req.body.crawlerOptions ?? {};
- const pageOptions = req.body.pageOptions ?? { onlyMainContent: false };
+ const pageOptions = req.body.pageOptions ?? { onlyMainContent: false, includeHtml: false };
if (mode === "single_urls" && !url.includes(",")) {
try {
@@ -66,6 +72,7 @@ export async function crawlController(req: Request, res: Response) {
return res.status(500).json({ error: error.message });
}
}
+
const job = await addWebScraperJob({
url: url,
mode: mode ?? "crawl", // fix for single urls not working
@@ -75,6 +82,8 @@ export async function crawlController(req: Request, res: Response) {
origin: req.body.origin ?? "api",
});
+ await logCrawl(job.id.toString(), team_id);
+
res.json({ jobId: job.id });
} catch (error) {
console.error(error);
diff --git a/apps/api/src/controllers/crawlPreview.ts b/apps/api/src/controllers/crawlPreview.ts
index 569be33..d3e9afe 100644
--- a/apps/api/src/controllers/crawlPreview.ts
+++ b/apps/api/src/controllers/crawlPreview.ts
@@ -26,7 +26,7 @@ export async function crawlPreviewController(req: Request, res: Response) {
const mode = req.body.mode ?? "crawl";
const crawlerOptions = req.body.crawlerOptions ?? {};
- const pageOptions = req.body.pageOptions ?? { onlyMainContent: false };
+ const pageOptions = req.body.pageOptions ?? { onlyMainContent: false, includeHtml: false };
const job = await addWebScraperJob({
url: url,
diff --git a/apps/api/src/controllers/keyAuth.ts b/apps/api/src/controllers/keyAuth.ts
new file mode 100644
index 0000000..351edd1
--- /dev/null
+++ b/apps/api/src/controllers/keyAuth.ts
@@ -0,0 +1,24 @@
+
+import { AuthResponse, RateLimiterMode } from "../types";
+
+import { Request, Response } from "express";
+import { authenticateUser } from "./auth";
+
+
+export const keyAuthController = async (req: Request, res: Response) => {
+ try {
+ // make sure to authenticate user first, Bearer
+ const { success, team_id, error, status } = await authenticateUser(
+ req,
+ res
+ );
+ if (!success) {
+ return res.status(status).json({ error });
+ }
+ // if success, return success: true
+ return res.status(200).json({ success: true });
+ } catch (error) {
+ return res.status(500).json({ error: error.message });
+ }
+};
+
diff --git a/apps/api/src/controllers/scrape.ts b/apps/api/src/controllers/scrape.ts
index eebdcb4..021a9d0 100644
--- a/apps/api/src/controllers/scrape.ts
+++ b/apps/api/src/controllers/scrape.ts
@@ -1,3 +1,4 @@
+import { ExtractorOptions, PageOptions } from './../lib/entities';
import { Request, Response } from "express";
import { WebScraperDataProvider } from "../scraper/WebScraper";
import { billTeam, checkTeamCredits } from "../services/billing/credit_billing";
@@ -6,12 +7,14 @@ import { RateLimiterMode } from "../types";
import { logJob } from "../services/logging/log_job";
import { Document } from "../lib/entities";
import { isUrlBlocked } from "../scraper/WebScraper/utils/blocklist"; // Import the isUrlBlocked function
+import { numTokensFromString } from '../lib/LLM-extraction/helpers';
export async function scrapeHelper(
req: Request,
team_id: string,
crawlerOptions: any,
- pageOptions: any
+ pageOptions: PageOptions,
+ extractorOptions: ExtractorOptions,
): Promise<{
success: boolean;
error?: string;
@@ -27,6 +30,7 @@ export async function scrapeHelper(
return { success: false, error: "Firecrawl currently does not support social media scraping due to policy restrictions. We're actively working on building support for it.", returnCode: 403 };
}
+
const a = new WebScraperDataProvider();
await a.setOptions({
mode: "single_urls",
@@ -35,6 +39,7 @@ export async function scrapeHelper(
...crawlerOptions,
},
pageOptions: pageOptions,
+ extractorOptions: extractorOptions,
});
const docs = await a.getDocuments(false);
@@ -46,9 +51,17 @@ export async function scrapeHelper(
return { success: true, error: "No page found", returnCode: 200 };
}
+
+ let creditsToBeBilled = filteredDocs.length;
+ const creditsPerLLMExtract = 5;
+
+ if (extractorOptions.mode === "llm-extraction"){
+ creditsToBeBilled = creditsToBeBilled + (creditsPerLLMExtract * filteredDocs.length)
+ }
+
const billingResult = await billTeam(
team_id,
- filteredDocs.length
+ creditsToBeBilled
);
if (!billingResult.success) {
return {
@@ -78,7 +91,10 @@ export async function scrapeController(req: Request, res: Response) {
return res.status(status).json({ error });
}
const crawlerOptions = req.body.crawlerOptions ?? {};
- const pageOptions = req.body.pageOptions ?? { onlyMainContent: false };
+ const pageOptions = req.body.pageOptions ?? { onlyMainContent: false, includeHtml: false };
+ const extractorOptions = req.body.extractorOptions ?? {
+ mode: "markdown"
+ }
const origin = req.body.origin ?? "api";
try {
@@ -96,10 +112,13 @@ export async function scrapeController(req: Request, res: Response) {
req,
team_id,
crawlerOptions,
- pageOptions
+ pageOptions,
+ extractorOptions,
);
const endTime = new Date().getTime();
const timeTakenInSeconds = (endTime - startTime) / 1000;
+ const numTokens = (result.data && result.data.markdown) ? numTokensFromString(result.data.markdown, "gpt-3.5-turbo") : 0;
+
logJob({
success: result.success,
message: result.error,
@@ -111,7 +130,9 @@ export async function scrapeController(req: Request, res: Response) {
url: req.body.url,
crawlerOptions: crawlerOptions,
pageOptions: pageOptions,
- origin: origin,
+ origin: origin,
+ extractor_options: extractorOptions,
+ num_tokens: numTokens,
});
return res.status(result.returnCode).json(result);
} catch (error) {
diff --git a/apps/api/src/controllers/search.ts b/apps/api/src/controllers/search.ts
index 5c2cf80..d98c08d 100644
--- a/apps/api/src/controllers/search.ts
+++ b/apps/api/src/controllers/search.ts
@@ -13,7 +13,7 @@ export async function searchHelper(
team_id: string,
crawlerOptions: any,
pageOptions: PageOptions,
- searchOptions: SearchOptions
+ searchOptions: SearchOptions,
): Promise<{
success: boolean;
error?: string;
@@ -54,10 +54,11 @@ export async function searchHelper(
// filter out social media links
+
const a = new WebScraperDataProvider();
await a.setOptions({
mode: "single_urls",
- urls: res.map((r) => r.url),
+ urls: res.map((r) => r.url).slice(0, searchOptions.limit ?? 7),
crawlerOptions: {
...crawlerOptions,
},
@@ -65,11 +66,12 @@ export async function searchHelper(
...pageOptions,
onlyMainContent: pageOptions?.onlyMainContent ?? true,
fetchPageContent: pageOptions?.fetchPageContent ?? true,
+ includeHtml: pageOptions?.includeHtml ?? false,
fallback: false,
},
});
- const docs = await a.getDocuments(true);
+ const docs = await a.getDocuments(false);
if (docs.length === 0) {
return { success: true, error: "No search results found", returnCode: 200 };
}
@@ -116,6 +118,7 @@ export async function searchController(req: Request, res: Response) {
}
const crawlerOptions = req.body.crawlerOptions ?? {};
const pageOptions = req.body.pageOptions ?? {
+ includeHtml: false,
onlyMainContent: true,
fetchPageContent: true,
fallback: false,
@@ -140,14 +143,14 @@ export async function searchController(req: Request, res: Response) {
team_id,
crawlerOptions,
pageOptions,
- searchOptions
+ searchOptions,
);
const endTime = new Date().getTime();
const timeTakenInSeconds = (endTime - startTime) / 1000;
logJob({
success: result.success,
message: result.error,
- num_docs: result.data.length,
+ num_docs: result.data ? result.data.length : 0,
docs: result.data,
time_taken: timeTakenInSeconds,
team_id: team_id,
diff --git a/apps/api/src/controllers/status.ts b/apps/api/src/controllers/status.ts
index bd1d2ea..9079787 100644
--- a/apps/api/src/controllers/status.ts
+++ b/apps/api/src/controllers/status.ts
@@ -8,7 +8,7 @@ export async function crawlJobStatusPreviewController(req: Request, res: Respons
return res.status(404).json({ error: "Job not found" });
}
- const { current, current_url, total, current_step } = await job.progress();
+ const { current, current_url, total, current_step, partialDocs } = await job.progress();
res.json({
status: await job.getState(),
// progress: job.progress(),
@@ -17,6 +17,7 @@ export async function crawlJobStatusPreviewController(req: Request, res: Respons
current_step: current_step,
total: total,
data: job.returnvalue,
+ partial_data: partialDocs ?? [],
});
} catch (error) {
console.error(error);
diff --git a/apps/api/src/lib/LLM-extraction/helpers.ts b/apps/api/src/lib/LLM-extraction/helpers.ts
new file mode 100644
index 0000000..f47a6b3
--- /dev/null
+++ b/apps/api/src/lib/LLM-extraction/helpers.ts
@@ -0,0 +1,16 @@
+import { encoding_for_model } from "@dqbd/tiktoken";
+import { TiktokenModel } from "@dqbd/tiktoken";
+
+// This function calculates the number of tokens in a text string using GPT-3.5-turbo model
+export function numTokensFromString(message: string, model: string): number {
+ const encoder = encoding_for_model(model as TiktokenModel);
+
+ // Encode the message into tokens
+ const tokens = encoder.encode(message);
+
+ // Free the encoder resources after use
+ encoder.free();
+
+ // Return the number of tokens
+ return tokens.length;
+}
diff --git a/apps/api/src/lib/LLM-extraction/index.ts b/apps/api/src/lib/LLM-extraction/index.ts
new file mode 100644
index 0000000..ea6ddfd
--- /dev/null
+++ b/apps/api/src/lib/LLM-extraction/index.ts
@@ -0,0 +1,56 @@
+import Turndown from "turndown";
+import OpenAI from "openai";
+import Ajv from "ajv";
+const ajv = new Ajv(); // Initialize AJV for JSON schema validation
+
+import { generateOpenAICompletions } from "./models";
+import { Document, ExtractorOptions } from "../entities";
+
+// Generate completion using OpenAI
+export async function generateCompletions(
+ documents: Document[],
+ extractionOptions: ExtractorOptions
+): Promise {
+ // const schema = zodToJsonSchema(options.schema)
+
+ const schema = extractionOptions.extractionSchema;
+ const prompt = extractionOptions.extractionPrompt;
+
+ const switchVariable = "openAI"; // Placholder, want to think more about how we abstract the model provider
+
+ const completions = await Promise.all(
+ documents.map(async (document: Document) => {
+ switch (switchVariable) {
+ case "openAI":
+ const llm = new OpenAI();
+ try{
+ const completionResult = await generateOpenAICompletions({
+ client: llm,
+ document: document,
+ schema: schema,
+ prompt: prompt,
+ });
+ // Validate the JSON output against the schema using AJV
+ const validate = ajv.compile(schema);
+ if (!validate(completionResult.llm_extraction)) {
+ //TODO: add Custom Error handling middleware that bubbles this up with proper Error code, etc.
+ throw new Error(
+ `JSON parsing error(s): ${validate.errors
+ ?.map((err) => err.message)
+ .join(", ")}\n\nLLM extraction did not match the extraction schema you provided. This could be because of a model hallucination, or an Error on our side. Try adjusting your prompt, and if it doesn't work reach out to support.`
+ );
+ }
+
+ return completionResult;
+ } catch (error) {
+ console.error(`Error generating completions: ${error}`);
+ throw new Error(`Error generating completions: ${error.message}`);
+ }
+ default:
+ throw new Error("Invalid client");
+ }
+ })
+ );
+
+ return completions;
+}
diff --git a/apps/api/src/lib/LLM-extraction/models.ts b/apps/api/src/lib/LLM-extraction/models.ts
new file mode 100644
index 0000000..ff805bb
--- /dev/null
+++ b/apps/api/src/lib/LLM-extraction/models.ts
@@ -0,0 +1,77 @@
+import OpenAI from "openai";
+import { Document } from "../../lib/entities";
+
+export type ScraperCompletionResult = {
+ data: any | null;
+ url: string;
+};
+
+const defaultPrompt =
+ "You are a professional web scraper. Extract the contents of the webpage";
+
+function prepareOpenAIDoc(
+ document: Document
+): OpenAI.Chat.Completions.ChatCompletionContentPart[] {
+ // Check if the markdown content exists in the document
+ if (!document.markdown) {
+ throw new Error(
+ "Markdown content is missing in the document. This is likely due to an error in the scraping process. Please try again or reach out to help@mendable.ai"
+ );
+ }
+
+ return [{ type: "text", text: document.markdown }];
+}
+
+export async function generateOpenAICompletions({
+ client,
+ model = "gpt-4-turbo",
+ document,
+ schema, //TODO - add zod dynamic type checking
+ prompt = defaultPrompt,
+ temperature,
+}: {
+ client: OpenAI;
+ model?: string;
+ document: Document;
+ schema: any; // This should be replaced with a proper Zod schema type when available
+ prompt?: string;
+ temperature?: number;
+}): Promise {
+ const openai = client as OpenAI;
+ const content = prepareOpenAIDoc(document);
+
+ const completion = await openai.chat.completions.create({
+ model,
+ messages: [
+ {
+ role: "system",
+ content: prompt,
+ },
+ { role: "user", content },
+ ],
+ tools: [
+ {
+ type: "function",
+ function: {
+ name: "extract_content",
+ description: "Extracts the content from the given webpage(s)",
+ parameters: schema,
+ },
+ },
+ ],
+ tool_choice: { "type": "function", "function": {"name": "extract_content"}},
+ temperature,
+ });
+
+ const c = completion.choices[0].message.tool_calls[0].function.arguments;
+
+ // Extract the LLM extraction content from the completion response
+ const llmExtraction = JSON.parse(c);
+
+ // Return the document with the LLM extraction content added
+ return {
+ ...document,
+ llm_extraction: llmExtraction,
+ };
+}
+
diff --git a/apps/api/src/lib/entities.ts b/apps/api/src/lib/entities.ts
index 7b46305..a387b54 100644
--- a/apps/api/src/lib/entities.ts
+++ b/apps/api/src/lib/entities.ts
@@ -7,15 +7,22 @@ export interface Progress {
[key: string]: any;
};
currentDocumentUrl?: string;
+ currentDocument?: Document;
}
export type PageOptions = {
onlyMainContent?: boolean;
+ includeHtml?: boolean;
fallback?: boolean;
fetchPageContent?: boolean;
-
};
+export type ExtractorOptions = {
+ mode: "markdown" | "llm-extraction";
+ extractionPrompt?: string;
+ extractionSchema?: Record;
+}
+
export type SearchOptions = {
limit?: number;
tbs?: string;
@@ -33,12 +40,15 @@ export type WebScraperOptions = {
includes?: string[];
excludes?: string[];
maxCrawledLinks?: number;
+ maxDepth?: number;
limit?: number;
generateImgAltText?: boolean;
replaceAllPathsWithAbsolutePaths?: boolean;
};
pageOptions?: PageOptions;
+ extractorOptions?: ExtractorOptions;
concurrentRequests?: number;
+ bullJobId?: string;
};
export interface DocumentUrl {
@@ -50,6 +60,8 @@ export class Document {
url?: string; // Used only in /search for now
content: string;
markdown?: string;
+ html?: string;
+ llm_extraction?: Record;
createdAt?: Date;
updatedAt?: Date;
type?: string;
diff --git a/apps/api/src/main/runWebScraper.ts b/apps/api/src/main/runWebScraper.ts
index 892a2a3..3c9ea88 100644
--- a/apps/api/src/main/runWebScraper.ts
+++ b/apps/api/src/main/runWebScraper.ts
@@ -10,13 +10,15 @@ export async function startWebScraperPipeline({
}: {
job: Job;
}) {
+ let partialDocs: Document[] = [];
return (await runWebScraper({
url: job.data.url,
mode: job.data.mode,
crawlerOptions: job.data.crawlerOptions,
pageOptions: job.data.pageOptions,
inProgress: (progress) => {
- job.progress(progress);
+ partialDocs.push(progress.currentDocument);
+ job.progress({...progress, partialDocs: partialDocs});
},
onSuccess: (result) => {
job.moveToCompleted(result);
@@ -25,6 +27,7 @@ export async function startWebScraperPipeline({
job.moveToFailed(error);
},
team_id: job.data.team_id,
+ bull_job_id: job.id.toString()
})) as { success: boolean; message: string; docs: Document[] };
}
export async function runWebScraper({
@@ -36,6 +39,7 @@ export async function runWebScraper({
onSuccess,
onError,
team_id,
+ bull_job_id,
}: {
url: string;
mode: "crawl" | "single_urls" | "sitemap";
@@ -45,6 +49,7 @@ export async function runWebScraper({
onSuccess: (result: any) => void;
onError: (error: any) => void;
team_id: string;
+ bull_job_id: string;
}): Promise<{
success: boolean;
message: string;
@@ -58,17 +63,19 @@ export async function runWebScraper({
urls: [url],
crawlerOptions: crawlerOptions,
pageOptions: pageOptions,
+ bullJobId: bull_job_id
});
} else {
await provider.setOptions({
mode: mode,
urls: url.split(","),
crawlerOptions: crawlerOptions,
- pageOptions: pageOptions,
+ pageOptions: pageOptions
});
}
const docs = (await provider.getDocuments(false, (progress: Progress) => {
inProgress(progress);
+
})) as Document[];
if (docs.length === 0) {
diff --git a/apps/api/src/routes/v0.ts b/apps/api/src/routes/v0.ts
index f84b974..a9a3a9b 100644
--- a/apps/api/src/routes/v0.ts
+++ b/apps/api/src/routes/v0.ts
@@ -5,6 +5,8 @@ import { scrapeController } from "../../src/controllers/scrape";
import { crawlPreviewController } from "../../src/controllers/crawlPreview";
import { crawlJobStatusPreviewController } from "../../src/controllers/status";
import { searchController } from "../../src/controllers/search";
+import { crawlCancelController } from "../../src/controllers/crawl-cancel";
+import { keyAuthController } from "../../src/controllers/keyAuth";
export const v0Router = express.Router();
@@ -12,8 +14,12 @@ v0Router.post("/v0/scrape", scrapeController);
v0Router.post("/v0/crawl", crawlController);
v0Router.post("/v0/crawlWebsitePreview", crawlPreviewController);
v0Router.get("/v0/crawl/status/:jobId", crawlStatusController);
+v0Router.delete("/v0/crawl/cancel/:jobId", crawlCancelController);
v0Router.get("/v0/checkJobStatus/:jobId", crawlJobStatusPreviewController);
+// Auth route for key based authentication
+v0Router.get("/v0/keyAuth", keyAuthController);
+
// Search routes
v0Router.post("/v0/search", searchController);
diff --git a/apps/api/src/scraper/WebScraper/crawler.ts b/apps/api/src/scraper/WebScraper/crawler.ts
index 23cb629..0248df2 100644
--- a/apps/api/src/scraper/WebScraper/crawler.ts
+++ b/apps/api/src/scraper/WebScraper/crawler.ts
@@ -13,6 +13,7 @@ export class WebCrawler {
private includes: string[];
private excludes: string[];
private maxCrawledLinks: number;
+ private maxCrawledDepth: number;
private visited: Set = new Set();
private crawledUrls: Set = new Set();
private limit: number;
@@ -27,6 +28,7 @@ export class WebCrawler {
maxCrawledLinks,
limit = 10000,
generateImgAltText = false,
+ maxCrawledDepth = 10,
}: {
initialUrl: string;
includes?: string[];
@@ -34,6 +36,7 @@ export class WebCrawler {
maxCrawledLinks?: number;
limit?: number;
generateImgAltText?: boolean;
+ maxCrawledDepth?: number;
}) {
this.initialUrl = initialUrl;
this.baseUrl = new URL(initialUrl).origin;
@@ -44,15 +47,22 @@ export class WebCrawler {
this.robots = robotsParser(this.robotsTxtUrl, "");
// Deprecated, use limit instead
this.maxCrawledLinks = maxCrawledLinks ?? limit;
+ this.maxCrawledDepth = maxCrawledDepth ?? 10;
this.generateImgAltText = generateImgAltText ?? false;
}
- private filterLinks(sitemapLinks: string[], limit: number): string[] {
+ private filterLinks(sitemapLinks: string[], limit: number, maxDepth: number): string[] {
return sitemapLinks
.filter((link) => {
const url = new URL(link);
const path = url.pathname;
+ const depth = url.pathname.split('/').length - 1;
+
+ // Check if the link exceeds the maximum depth allowed
+ if (depth > maxDepth) {
+ return false;
+ }
// Check if the link should be excluded
if (this.excludes.length > 0 && this.excludes[0] !== "") {
@@ -87,7 +97,8 @@ export class WebCrawler {
public async start(
inProgress?: (progress: Progress) => void,
concurrencyLimit: number = 5,
- limit: number = 10000
+ limit: number = 10000,
+ maxDepth: number = 10
): Promise {
// Fetch and parse robots.txt
try {
@@ -99,7 +110,7 @@ export class WebCrawler {
const sitemapLinks = await this.tryFetchSitemapLinks(this.initialUrl);
if (sitemapLinks.length > 0) {
- const filteredLinks = this.filterLinks(sitemapLinks, limit);
+ const filteredLinks = this.filterLinks(sitemapLinks, limit, maxDepth);
return filteredLinks;
}
@@ -110,13 +121,13 @@ export class WebCrawler {
);
if (
urls.length === 0 &&
- this.filterLinks([this.initialUrl], limit).length > 0
+ this.filterLinks([this.initialUrl], limit, this.maxCrawledDepth).length > 0
) {
return [this.initialUrl];
}
// make sure to run include exclude here again
- return this.filterLinks(urls, limit);
+ return this.filterLinks(urls, limit, this.maxCrawledDepth);
}
private async crawlUrls(
diff --git a/apps/api/src/scraper/WebScraper/index.ts b/apps/api/src/scraper/WebScraper/index.ts
index 750ccc5..73eda44 100644
--- a/apps/api/src/scraper/WebScraper/index.ts
+++ b/apps/api/src/scraper/WebScraper/index.ts
@@ -1,4 +1,9 @@
-import { Document, PageOptions, WebScraperOptions } from "../../lib/entities";
+import {
+ Document,
+ ExtractorOptions,
+ PageOptions,
+ WebScraperOptions,
+} from "../../lib/entities";
import { Progress } from "../../lib/entities";
import { scrapSingleUrl } from "./single_url";
import { SitemapEntry, fetchSitemapData, getLinksFromSitemap } from "./sitemap";
@@ -6,21 +11,30 @@ import { WebCrawler } from "./crawler";
import { getValue, setValue } from "../../services/redis";
import { getImageDescription } from "./utils/imageDescription";
import { fetchAndProcessPdf, isUrlAPdf } from "./utils/pdfProcessor";
-import { replaceImgPathsWithAbsolutePaths, replacePathsWithAbsolutePaths } from "./utils/replacePaths";
+import {
+ replaceImgPathsWithAbsolutePaths,
+ replacePathsWithAbsolutePaths,
+} from "./utils/replacePaths";
+import { generateCompletions } from "../../lib/LLM-extraction";
+import { getWebScraperQueue } from "../../../src/services/queue-service";
export class WebScraperDataProvider {
+ private bullJobId: string;
private urls: string[] = [""];
private mode: "single_urls" | "sitemap" | "crawl" = "single_urls";
private includes: string[];
private excludes: string[];
private maxCrawledLinks: number;
+ private maxCrawledDepth: number = 10;
private returnOnlyUrls: boolean;
private limit: number = 10000;
private concurrentRequests: number = 20;
private generateImgAltText: boolean = false;
private pageOptions?: PageOptions;
+ private extractorOptions?: ExtractorOptions;
private replaceAllPathsWithAbsolutePaths?: boolean = false;
- private generateImgAltTextModel: "gpt-4-turbo" | "claude-3-opus" = "gpt-4-turbo";
+ private generateImgAltTextModel: "gpt-4-turbo" | "claude-3-opus" =
+ "gpt-4-turbo";
authorize(): void {
throw new Error("Method not implemented.");
@@ -36,12 +50,13 @@ export class WebScraperDataProvider {
): Promise {
const totalUrls = urls.length;
let processedUrls = 0;
+
const results: (Document | null)[] = new Array(urls.length).fill(null);
for (let i = 0; i < urls.length; i += this.concurrentRequests) {
const batchUrls = urls.slice(i, i + this.concurrentRequests);
await Promise.all(
batchUrls.map(async (url, index) => {
- const result = await scrapSingleUrl(url, true, this.pageOptions);
+ const result = await scrapSingleUrl(url, this.pageOptions);
processedUrls++;
if (inProgress) {
inProgress({
@@ -49,11 +64,26 @@ export class WebScraperDataProvider {
total: totalUrls,
status: "SCRAPING",
currentDocumentUrl: url,
+ currentDocument: result,
});
}
+
results[i + index] = result;
})
);
+ try {
+ if (this.mode === "crawl" && this.bullJobId) {
+ const job = await getWebScraperQueue().getJob(this.bullJobId);
+ const jobStatus = await job.getState();
+ if (jobStatus === "failed") {
+ throw new Error(
+ "Job has failed or has been cancelled by the user. Stopping the job..."
+ );
+ }
+ }
+ } catch (error) {
+ console.error(error);
+ }
}
return results.filter((result) => result !== null) as Document[];
}
@@ -62,202 +92,158 @@ export class WebScraperDataProvider {
useCaching: boolean = false,
inProgress?: (progress: Progress) => void
): Promise {
-
+ this.validateInitialUrl();
+
+ if (!useCaching) {
+ return this.processDocumentsWithoutCache(inProgress);
+ }
+
+ return this.processDocumentsWithCache(inProgress);
+ }
+
+ private validateInitialUrl(): void {
if (this.urls[0].trim() === "") {
throw new Error("Url is required");
}
+ }
- if (!useCaching) {
- if (this.mode === "crawl") {
- const crawler = new WebCrawler({
- initialUrl: this.urls[0],
- includes: this.includes,
- excludes: this.excludes,
- maxCrawledLinks: this.maxCrawledLinks,
- limit: this.limit,
- generateImgAltText: this.generateImgAltText,
- });
- let links = await crawler.start(inProgress, 5, this.limit);
- if (this.returnOnlyUrls) {
- inProgress({
- current: links.length,
- total: links.length,
- status: "COMPLETED",
- currentDocumentUrl: this.urls[0],
- });
- return links.map((url) => ({
- content: "",
- markdown: "",
- metadata: { sourceURL: url },
- }));
- }
+ /**
+ * Process documents without cache handling each mode
+ * @param inProgress inProgress
+ * @returns documents
+ */
+ private async processDocumentsWithoutCache(
+ inProgress?: (progress: Progress) => void
+ ): Promise {
+ switch (this.mode) {
+ case "crawl":
+ return this.handleCrawlMode(inProgress);
+ case "single_urls":
+ return this.handleSingleUrlsMode(inProgress);
+ case "sitemap":
+ return this.handleSitemapMode(inProgress);
+ default:
+ return [];
+ }
+ }
- let pdfLinks = [];
- let notPdfLinks = [];
- for (let link of links) {
- if (await isUrlAPdf({ url: link })) {
- pdfLinks.push(link);
- } else {
- notPdfLinks.push(link);
- }
- }
-
- console.log("crawl", {pdfLinks})
- let pdfDocuments: Document[] = [];
- for (let pdfLink of pdfLinks) {
- const pdfContent = await fetchAndProcessPdf(pdfLink);
- pdfDocuments.push({
- content: pdfContent,
- metadata: { sourceURL: pdfLink },
- provider: "web-scraper",
- });
- }
-
- let documents = await this.convertUrlsToDocuments(notPdfLinks, inProgress);
- documents = await this.getSitemapData(this.urls[0], documents);
-
- if (this.replaceAllPathsWithAbsolutePaths) {
- documents = replacePathsWithAbsolutePaths(documents);
- } else {
- documents = replaceImgPathsWithAbsolutePaths(documents);
- }
-
- if (this.generateImgAltText) {
- documents = await this.generatesImgAltText(documents);
- }
- documents = documents.concat(pdfDocuments);
-
- // CACHING DOCUMENTS
- // - parent document
- const cachedParentDocumentString = await getValue(
- "web-scraper-cache:" + this.normalizeUrl(this.urls[0])
- );
- if (cachedParentDocumentString != null) {
- let cachedParentDocument = JSON.parse(cachedParentDocumentString);
- if (
- !cachedParentDocument.childrenLinks ||
- cachedParentDocument.childrenLinks.length < links.length - 1
- ) {
- cachedParentDocument.childrenLinks = links.filter(
- (link) => link !== this.urls[0]
- );
- await setValue(
- "web-scraper-cache:" + this.normalizeUrl(this.urls[0]),
- JSON.stringify(cachedParentDocument),
- 60 * 60 * 24 * 10
- ); // 10 days
- }
- } else {
- let parentDocument = documents.filter(
- (document) =>
- this.normalizeUrl(document.metadata.sourceURL) ===
- this.normalizeUrl(this.urls[0])
- );
- await this.setCachedDocuments(parentDocument, links);
- }
-
- await this.setCachedDocuments(
- documents.filter(
- (document) =>
- this.normalizeUrl(document.metadata.sourceURL) !==
- this.normalizeUrl(this.urls[0])
- ),
- []
- );
- documents = this.removeChildLinks(documents);
- documents = documents.splice(0, this.limit);
- return documents;
- }
-
- if (this.mode === "single_urls") {
- let pdfDocuments: Document[] = [];
- let nonPdfUrls: string[] = [];
- for (let url of this.urls) {
- if (await isUrlAPdf({ url: url })) {
- const pdfContent = await fetchAndProcessPdf(url);
- pdfDocuments.push({
- content: pdfContent,
- metadata: { sourceURL: url },
- provider: "web-scraper",
- });
- } else {
- nonPdfUrls.push(url);
- }
- }
-
- let documents = await this.convertUrlsToDocuments(
- nonPdfUrls,
- inProgress
- );
-
- if (this.replaceAllPathsWithAbsolutePaths) {
- documents = replacePathsWithAbsolutePaths(documents);
- } else {
- documents = replaceImgPathsWithAbsolutePaths(documents);
- }
-
- if (this.generateImgAltText) {
- documents = await this.generatesImgAltText(documents);
- }
- const baseUrl = new URL(this.urls[0]).origin;
- documents = await this.getSitemapData(baseUrl, documents);
- documents = documents.concat(pdfDocuments);
-
- await this.setCachedDocuments(documents);
- documents = this.removeChildLinks(documents);
- documents = documents.splice(0, this.limit);
- return documents;
- }
- if (this.mode === "sitemap") {
- let links = await getLinksFromSitemap(this.urls[0]);
-
- let pdfLinks = [];
- let nonPdfLinks = [];
- for (let link of links) {
- if (await isUrlAPdf({ url: link })) {
- pdfLinks.push(link);
- } else {
- nonPdfLinks.push(link);
- }
- }
-
- let pdfDocuments: Document[] = [];
- for (let pdfLink of pdfLinks) {
- const pdfContent = await fetchAndProcessPdf(pdfLink);
- pdfDocuments.push({
- content: pdfContent,
- metadata: { sourceURL: pdfLink },
- provider: "web-scraper",
- });
- }
-
- let documents = await this.convertUrlsToDocuments(
- nonPdfLinks.slice(0, this.limit),
- inProgress
- );
-
- documents = await this.getSitemapData(this.urls[0], documents);
-
- if (this.replaceAllPathsWithAbsolutePaths) {
- documents = replacePathsWithAbsolutePaths(documents);
- } else {
- documents = replaceImgPathsWithAbsolutePaths(documents);
- }
-
- if (this.generateImgAltText) {
- documents = await this.generatesImgAltText(documents);
- }
- documents = documents.concat(pdfDocuments);
-
- await this.setCachedDocuments(documents);
- documents = this.removeChildLinks(documents);
- documents = documents.splice(0, this.limit);
- return documents;
- }
-
- return [];
+ private async handleCrawlMode(
+ inProgress?: (progress: Progress) => void
+ ): Promise {
+ const crawler = new WebCrawler({
+ initialUrl: this.urls[0],
+ includes: this.includes,
+ excludes: this.excludes,
+ maxCrawledLinks: this.maxCrawledLinks,
+ maxCrawledDepth: this.maxCrawledDepth,
+ limit: this.limit,
+ generateImgAltText: this.generateImgAltText,
+ });
+ let links = await crawler.start(inProgress, 5, this.limit, this.maxCrawledDepth);
+ if (this.returnOnlyUrls) {
+ return this.returnOnlyUrlsResponse(links, inProgress);
}
+ let documents = await this.processLinks(links, inProgress);
+ return this.cacheAndFinalizeDocuments(documents, links);
+ }
+
+ private async handleSingleUrlsMode(
+ inProgress?: (progress: Progress) => void
+ ): Promise {
+ let documents = await this.processLinks(this.urls, inProgress);
+ return documents;
+ }
+
+ private async handleSitemapMode(
+ inProgress?: (progress: Progress) => void
+ ): Promise {
+ let links = await getLinksFromSitemap(this.urls[0]);
+ if (this.returnOnlyUrls) {
+ return this.returnOnlyUrlsResponse(links, inProgress);
+ }
+
+ let documents = await this.processLinks(links, inProgress);
+ return this.cacheAndFinalizeDocuments(documents, links);
+ }
+
+ private async returnOnlyUrlsResponse(
+ links: string[],
+ inProgress?: (progress: Progress) => void
+ ): Promise {
+ inProgress?.({
+ current: links.length,
+ total: links.length,
+ status: "COMPLETED",
+ currentDocumentUrl: this.urls[0],
+ });
+ return links.map((url) => ({
+ content: "",
+ html: this.pageOptions?.includeHtml ? "" : undefined,
+ markdown: "",
+ metadata: { sourceURL: url },
+ }));
+ }
+
+ private async processLinks(
+ links: string[],
+ inProgress?: (progress: Progress) => void
+ ): Promise {
+ let pdfLinks = links.filter((link) => link.endsWith(".pdf"));
+ let pdfDocuments = await this.fetchPdfDocuments(pdfLinks);
+ links = links.filter((link) => !link.endsWith(".pdf"));
+
+ let documents = await this.convertUrlsToDocuments(links, inProgress);
+ documents = await this.getSitemapData(this.urls[0], documents);
+ documents = this.applyPathReplacements(documents);
+ documents = await this.applyImgAltText(documents);
+
+ if (
+ this.extractorOptions.mode === "llm-extraction" &&
+ this.mode === "single_urls"
+ ) {
+ documents = await generateCompletions(documents, this.extractorOptions);
+ }
+ return documents.concat(pdfDocuments);
+ }
+
+ private async fetchPdfDocuments(pdfLinks: string[]): Promise {
+ return Promise.all(
+ pdfLinks.map(async (pdfLink) => {
+ const pdfContent = await fetchAndProcessPdf(pdfLink);
+ return {
+ content: pdfContent,
+ metadata: { sourceURL: pdfLink },
+ provider: "web-scraper",
+ };
+ })
+ );
+ }
+
+ private applyPathReplacements(documents: Document[]): Document[] {
+ return this.replaceAllPathsWithAbsolutePaths
+ ? replacePathsWithAbsolutePaths(documents)
+ : replaceImgPathsWithAbsolutePaths(documents);
+ }
+
+ private async applyImgAltText(documents: Document[]): Promise {
+ return this.generateImgAltText
+ ? this.generatesImgAltText(documents)
+ : documents;
+ }
+
+ private async cacheAndFinalizeDocuments(
+ documents: Document[],
+ links: string[]
+ ): Promise {
+ await this.setCachedDocuments(documents, links);
+ documents = this.removeChildLinks(documents);
+ return documents.splice(0, this.limit);
+ }
+
+ private async processDocumentsWithCache(
+ inProgress?: (progress: Progress) => void
+ ): Promise {
let documents = await this.getCachedDocuments(
this.urls.slice(0, this.limit)
);
@@ -266,22 +252,30 @@ export class WebScraperDataProvider {
false,
inProgress
);
- newDocuments.forEach((doc) => {
- if (
- !documents.some(
- (d) =>
- this.normalizeUrl(d.metadata.sourceURL) ===
- this.normalizeUrl(doc.metadata?.sourceURL)
- )
- ) {
- documents.push(doc);
- }
- });
+ documents = this.mergeNewDocuments(documents, newDocuments);
}
documents = this.filterDocsExcludeInclude(documents);
+ documents = this.filterDepth(documents);
documents = this.removeChildLinks(documents);
- documents = documents.splice(0, this.limit);
- return documents;
+ return documents.splice(0, this.limit);
+ }
+
+ private mergeNewDocuments(
+ existingDocuments: Document[],
+ newDocuments: Document[]
+ ): Document[] {
+ newDocuments.forEach((doc) => {
+ if (
+ !existingDocuments.some(
+ (d) =>
+ this.normalizeUrl(d.metadata.sourceURL) ===
+ this.normalizeUrl(doc.metadata?.sourceURL)
+ )
+ ) {
+ existingDocuments.push(doc);
+ }
+ });
+ return existingDocuments;
}
private filterDocsExcludeInclude(documents: Document[]): Document[] {
@@ -358,7 +352,7 @@ export class WebScraperDataProvider {
documents.push(cachedDocument);
// get children documents
- for (const childUrl of cachedDocument.childrenLinks) {
+ for (const childUrl of cachedDocument.childrenLinks || []) {
const normalizedChildUrl = this.normalizeUrl(childUrl);
const childCachedDocumentString = await getValue(
"web-scraper-cache:" + normalizedChildUrl
@@ -386,20 +380,22 @@ export class WebScraperDataProvider {
throw new Error("Urls are required");
}
+ this.bullJobId = options.bullJobId;
this.urls = options.urls;
this.mode = options.mode;
this.concurrentRequests = options.concurrentRequests ?? 20;
this.includes = options.crawlerOptions?.includes ?? [];
this.excludes = options.crawlerOptions?.excludes ?? [];
this.maxCrawledLinks = options.crawlerOptions?.maxCrawledLinks ?? 1000;
+ this.maxCrawledDepth = options.crawlerOptions?.maxDepth ?? 10;
this.returnOnlyUrls = options.crawlerOptions?.returnOnlyUrls ?? false;
this.limit = options.crawlerOptions?.limit ?? 10000;
this.generateImgAltText =
options.crawlerOptions?.generateImgAltText ?? false;
- this.pageOptions = options.pageOptions ?? { onlyMainContent: false };
- this.replaceAllPathsWithAbsolutePaths =
- options.crawlerOptions?.replaceAllPathsWithAbsolutePaths ?? false;
-
+ this.pageOptions = options.pageOptions ?? { onlyMainContent: false, includeHtml: false };
+ this.extractorOptions = options.extractorOptions ?? {mode: "markdown"}
+ this.replaceAllPathsWithAbsolutePaths = options.crawlerOptions?.replaceAllPathsWithAbsolutePaths ?? false;
+
//! @nicolas, for some reason this was being injected and breakign everything. Don't have time to find source of the issue so adding this check
this.excludes = this.excludes.filter((item) => item !== "");
@@ -469,8 +465,9 @@ export class WebScraperDataProvider {
altText = await getImageDescription(
imageUrl,
backText,
- frontText
- , this.generateImgAltTextModel);
+ frontText,
+ this.generateImgAltTextModel
+ );
}
document.content = document.content.replace(
@@ -484,4 +481,12 @@ export class WebScraperDataProvider {
return documents;
};
+
+ filterDepth(documents: Document[]): Document[] {
+ return documents.filter((document) => {
+ const url = new URL(document.metadata.sourceURL);
+ const path = url.pathname;
+ return path.split("/").length <= this.maxCrawledDepth;
+ });
+ }
}
diff --git a/apps/api/src/scraper/WebScraper/single_url.ts b/apps/api/src/scraper/WebScraper/single_url.ts
index ff73e95..c43ea40 100644
--- a/apps/api/src/scraper/WebScraper/single_url.ts
+++ b/apps/api/src/scraper/WebScraper/single_url.ts
@@ -21,7 +21,7 @@ export async function generateRequestParams(
};
try {
- const urlKey = new URL(url).hostname;
+ const urlKey = new URL(url).hostname.replace(/^www\./, "");
if (urlSpecificParams.hasOwnProperty(urlKey)) {
return { ...defaultParams, ...urlSpecificParams[urlKey] };
} else {
@@ -57,7 +57,7 @@ export async function scrapWithScrapingBee(
wait_browser,
timeout
);
-
+
const response = await client.get(clientParams);
if (response.status !== 200 && response.status !== 404) {
@@ -77,12 +77,15 @@ export async function scrapWithScrapingBee(
export async function scrapWithPlaywright(url: string): Promise {
try {
+ const reqParams = await generateRequestParams(url);
+ const wait_playwright = reqParams["params"]?.wait ?? 0;
+
const response = await fetch(process.env.PLAYWRIGHT_MICROSERVICE_URL, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
- body: JSON.stringify({ url: url }),
+ body: JSON.stringify({ url: url, wait: wait_playwright }),
});
if (!response.ok) {
@@ -103,10 +106,8 @@ export async function scrapWithPlaywright(url: string): Promise {
export async function scrapSingleUrl(
urlToScrap: string,
- toMarkdown: boolean = true,
- pageOptions: PageOptions = { onlyMainContent: true }
+ pageOptions: PageOptions = { onlyMainContent: true, includeHtml: false }
): Promise {
- console.log(`Scraping URL: ${urlToScrap}`);
urlToScrap = urlToScrap.trim();
const removeUnwantedElements = (html: string, pageOptions: PageOptions) => {
@@ -170,58 +171,57 @@ export async function scrapSingleUrl(
}
break;
}
+
+ //* TODO: add an optional to return markdown or structured/extracted content
let cleanedHtml = removeUnwantedElements(text, pageOptions);
return [await parseMarkdown(cleanedHtml), text];
};
-
try {
- // TODO: comment this out once we're ready to merge firecrawl-scraper into the mono-repo
- // let [text, html] = await attemptScraping(urlToScrap, 'firecrawl-scraper');
- // if (!text || text.length < 100) {
- // console.log("Falling back to scraping bee load");
- // [text, html] = await attemptScraping(urlToScrap, 'scrapingBeeLoad');
- // }
-
- let [text, html] = await attemptScraping(urlToScrap, "scrapingBee");
- // Basically means that it is using /search endpoint
- if (pageOptions.fallback === false) {
- const soup = cheerio.load(html);
- const metadata = extractMetadata(soup, urlToScrap);
- return {
- url: urlToScrap,
- content: text,
- markdown: text,
- metadata: { ...metadata, sourceURL: urlToScrap },
- } as Document;
+ let [text, html] = ["", ""];
+ let urlKey = urlToScrap;
+ try {
+ urlKey = new URL(urlToScrap).hostname.replace(/^www\./, "");
+ } catch (error) {
+ console.error(`Invalid URL key, trying: ${urlToScrap}`);
}
- if (!text || text.length < 100) {
- console.log("Falling back to playwright");
- [text, html] = await attemptScraping(urlToScrap, "playwright");
+ const defaultScraper = urlSpecificParams[urlKey]?.defaultScraper ?? "";
+ const scrapersInOrder = defaultScraper
+ ? [
+ defaultScraper,
+ "scrapingBee",
+ "playwright",
+ "scrapingBeeLoad",
+ "fetch",
+ ]
+ : ["scrapingBee", "playwright", "scrapingBeeLoad", "fetch"];
+
+ for (const scraper of scrapersInOrder) {
+ [text, html] = await attemptScraping(urlToScrap, scraper);
+ if (text && text.length >= 100) break;
+ console.log(`Falling back to ${scraper}`);
}
- if (!text || text.length < 100) {
- console.log("Falling back to scraping bee load");
- [text, html] = await attemptScraping(urlToScrap, "scrapingBeeLoad");
- }
- if (!text || text.length < 100) {
- console.log("Falling back to fetch");
- [text, html] = await attemptScraping(urlToScrap, "fetch");
+ if (!text) {
+ throw new Error(`All scraping methods failed for URL: ${urlToScrap}`);
}
const soup = cheerio.load(html);
const metadata = extractMetadata(soup, urlToScrap);
-
- return {
+ const document: Document = {
content: text,
markdown: text,
+ html: pageOptions.includeHtml ? html : undefined,
metadata: { ...metadata, sourceURL: urlToScrap },
- } as Document;
+ };
+
+ return document;
} catch (error) {
console.error(`Error: ${error} - Failed to fetch URL: ${urlToScrap}`);
return {
content: "",
markdown: "",
+ html: "",
metadata: { sourceURL: urlToScrap },
} as Document;
}
diff --git a/apps/api/src/scraper/WebScraper/utils/custom/website_params.ts b/apps/api/src/scraper/WebScraper/utils/custom/website_params.ts
index dd9f20e..5f8be9f 100644
--- a/apps/api/src/scraper/WebScraper/utils/custom/website_params.ts
+++ b/apps/api/src/scraper/WebScraper/utils/custom/website_params.ts
@@ -22,9 +22,92 @@ export const urlSpecificParams = {
},
},
"support.greenpay.me":{
+ defaultScraper: "playwright",
params: {
wait_browser: "networkidle2",
block_resources: false,
+ wait: 2000,
+
+ },
+ headers: {
+ "User-Agent":
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
+ "sec-fetch-site": "same-origin",
+ "sec-fetch-mode": "cors",
+ "sec-fetch-dest": "empty",
+ referer: "https://www.google.com/",
+ "accept-language": "en-US,en;q=0.9",
+ "accept-encoding": "gzip, deflate, br",
+ accept:
+ "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
+ },
+ },
+ "docs.pdw.co":{
+ defaultScraper: "playwright",
+ params: {
+ wait_browser: "networkidle2",
+ block_resources: false,
+ wait: 3000,
+ },
+ headers: {
+ "User-Agent":
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
+ "sec-fetch-site": "same-origin",
+ "sec-fetch-mode": "cors",
+ "sec-fetch-dest": "empty",
+ referer: "https://www.google.com/",
+ "accept-language": "en-US,en;q=0.9",
+ "accept-encoding": "gzip, deflate, br",
+ accept:
+ "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
+ },
+ },
+ "ycombinator.com":{
+ defaultScraper: "playwright",
+ params: {
+ wait_browser: "networkidle2",
+ block_resources: false,
+ wait: 3000,
+ },
+ headers: {
+ "User-Agent":
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
+ "sec-fetch-site": "same-origin",
+ "sec-fetch-mode": "cors",
+ "sec-fetch-dest": "empty",
+ referer: "https://www.google.com/",
+ "accept-language": "en-US,en;q=0.9",
+ "accept-encoding": "gzip, deflate, br",
+ accept:
+ "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
+ },
+ },
+ "developers.notion.com":{
+ defaultScraper: "playwright",
+ params: {
+ wait_browser: "networkidle2",
+ block_resources: false,
+ wait: 2000,
+ },
+ headers: {
+ "User-Agent":
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
+ "sec-fetch-site": "same-origin",
+ "sec-fetch-mode": "cors",
+ "sec-fetch-dest": "empty",
+ referer: "https://www.google.com/",
+ "accept-language": "en-US,en;q=0.9",
+ "accept-encoding": "gzip, deflate, br",
+ accept:
+ "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
+ },
+ },
+ "docs2.hubitat.com":{
+ defaultScraper: "playwright",
+ params: {
+ wait_browser: "networkidle2",
+ block_resources: false,
+ wait: 2000,
},
headers: {
"User-Agent":
diff --git a/apps/api/src/services/billing/credit_billing.ts b/apps/api/src/services/billing/credit_billing.ts
index 37db664..892530c 100644
--- a/apps/api/src/services/billing/credit_billing.ts
+++ b/apps/api/src/services/billing/credit_billing.ts
@@ -212,20 +212,26 @@ export async function supaCheckTeamCredits(team_id: string, credits: number) {
return { success: true, message: "Sufficient credits available" };
}
- // Calculate the total credits used by the team within the current billing period
- const { data: creditUsages, error: creditUsageError } = await supabase_service
- .from("credit_usage")
- .select("credits_used")
- .eq("subscription_id", subscription.id)
- .gte("created_at", subscription.current_period_start)
- .lte("created_at", subscription.current_period_end);
+ let totalCreditsUsed = 0;
+ try {
+ const { data: creditUsages, error: creditUsageError } = await supabase_service
+ .rpc("get_credit_usage_2", {
+ sub_id: subscription.id,
+ start_time: subscription.current_period_start,
+ end_time: subscription.current_period_end
+ });
- if (creditUsageError) {
- throw new Error(`Failed to retrieve credit usage for subscription_id: ${subscription.id}`);
+ if (creditUsageError) {
+ console.error("Error calculating credit usage:", creditUsageError);
+ }
+
+ if (creditUsages && creditUsages.length > 0) {
+ totalCreditsUsed = creditUsages[0].total_credits_used;
+ console.log("Total Credits Used:", totalCreditsUsed);
+ }
+ } catch (error) {
+ console.error("Error calculating credit usage:", error);
}
-
- const totalCreditsUsed = creditUsages.reduce((acc, usage) => acc + usage.credits_used, 0);
-
// Adjust total credits used by subtracting coupon value
const adjustedCreditsUsed = Math.max(0, totalCreditsUsed - couponCredits);
diff --git a/apps/api/src/services/logging/crawl_log.ts b/apps/api/src/services/logging/crawl_log.ts
new file mode 100644
index 0000000..76a0607
--- /dev/null
+++ b/apps/api/src/services/logging/crawl_log.ts
@@ -0,0 +1,17 @@
+import { supabase_service } from "../supabase";
+import "dotenv/config";
+
+export async function logCrawl(job_id: string, team_id: string) {
+ try {
+ const { data, error } = await supabase_service
+ .from("bulljobs_teams")
+ .insert([
+ {
+ job_id: job_id,
+ team_id: team_id,
+ },
+ ]);
+ } catch (error) {
+ console.error("Error logging crawl job:\n", error);
+ }
+}
diff --git a/apps/api/src/services/logging/log_job.ts b/apps/api/src/services/logging/log_job.ts
index 639b3a8..83e0bf3 100644
--- a/apps/api/src/services/logging/log_job.ts
+++ b/apps/api/src/services/logging/log_job.ts
@@ -1,5 +1,7 @@
+import { ExtractorOptions } from './../../lib/entities';
import { supabase_service } from "../supabase";
import { FirecrawlJob } from "../../types";
+import { posthog } from "../posthog";
import "dotenv/config";
export async function logJob(job: FirecrawlJob) {
@@ -8,6 +10,7 @@ export async function logJob(job: FirecrawlJob) {
if (process.env.ENV !== "production") {
return;
}
+
const { data, error } = await supabase_service
.from("firecrawl_jobs")
.insert([
@@ -23,8 +26,31 @@ export async function logJob(job: FirecrawlJob) {
crawler_options: job.crawlerOptions,
page_options: job.pageOptions,
origin: job.origin,
+ extractor_options: job.extractor_options,
+ num_tokens: job.num_tokens
},
]);
+
+ if (process.env.POSTHOG_API_KEY) {
+ posthog.capture({
+ distinctId: job.team_id === "preview" ? null : job.team_id,
+ event: "job-logged",
+ properties: {
+ success: job.success,
+ message: job.message,
+ num_docs: job.num_docs,
+ time_taken: job.time_taken,
+ team_id: job.team_id === "preview" ? null : job.team_id,
+ mode: job.mode,
+ url: job.url,
+ crawler_options: job.crawlerOptions,
+ page_options: job.pageOptions,
+ origin: job.origin,
+ extractor_options: job.extractor_options,
+ num_tokens: job.num_tokens
+ },
+ });
+ }
if (error) {
console.error("Error logging job:\n", error);
}
diff --git a/apps/api/src/services/posthog.ts b/apps/api/src/services/posthog.ts
new file mode 100644
index 0000000..5ec16e2
--- /dev/null
+++ b/apps/api/src/services/posthog.ts
@@ -0,0 +1,26 @@
+import { PostHog } from 'posthog-node';
+import "dotenv/config";
+
+export default function PostHogClient() {
+ const posthogClient = new PostHog(process.env.POSTHOG_API_KEY, {
+ host: process.env.POSTHOG_HOST,
+ flushAt: 1,
+ flushInterval: 0
+ });
+ return posthogClient;
+}
+
+class MockPostHog {
+ capture() {}
+}
+
+// Using the actual PostHog class if POSTHOG_API_KEY exists, otherwise using the mock class
+// Additionally, print a warning to the terminal if POSTHOG_API_KEY is not provided
+export const posthog = process.env.POSTHOG_API_KEY
+ ? PostHogClient()
+ : (() => {
+ console.warn(
+ "POSTHOG_API_KEY is not provided - your events will not be logged. Using MockPostHog as a fallback. See posthog.ts for more."
+ );
+ return new MockPostHog();
+ })();
\ No newline at end of file
diff --git a/apps/api/src/services/rate-limiter.ts b/apps/api/src/services/rate-limiter.ts
index b1ee562..5bc9acb 100644
--- a/apps/api/src/services/rate-limiter.ts
+++ b/apps/api/src/services/rate-limiter.ts
@@ -40,6 +40,13 @@ export const crawlStatusRateLimiter = new RateLimiterRedis({
duration: 60, // Duration in seconds
});
+export const testSuiteRateLimiter = new RateLimiterRedis({
+ storeClient: redisClient,
+ keyPrefix: "middleware",
+ points: 1000,
+ duration: 60, // Duration in seconds
+});
+
export function crawlRateLimit(plan: string){
if(plan === "standard"){
@@ -69,7 +76,11 @@ export function crawlRateLimit(plan: string){
-export function getRateLimiter(mode: RateLimiterMode){
+export function getRateLimiter(mode: RateLimiterMode, token: string){
+ // Special test suite case. TODO: Change this later.
+ if(token.includes("5089cefa58")){
+ return testSuiteRateLimiter;
+ }
switch(mode) {
case RateLimiterMode.Preview:
return previewRateLimiter;
diff --git a/apps/api/src/types.ts b/apps/api/src/types.ts
index c65140c..b9b5463 100644
--- a/apps/api/src/types.ts
+++ b/apps/api/src/types.ts
@@ -1,3 +1,5 @@
+import { ExtractorOptions } from "./lib/entities";
+
export interface CrawlResult {
source: string;
content: string;
@@ -37,6 +39,8 @@ export interface FirecrawlJob {
crawlerOptions?: any;
pageOptions?: any;
origin: string;
+ extractor_options?: ExtractorOptions,
+ num_tokens?: number,
}
export enum RateLimiterMode {
diff --git a/apps/js-sdk/example.js b/apps/js-sdk/example.js
index 7077b4c..5f81192 100644
--- a/apps/js-sdk/example.js
+++ b/apps/js-sdk/example.js
@@ -1,7 +1,13 @@
import FirecrawlApp from '@mendable/firecrawl-js';
+import { z } from "zod";
-const app = new FirecrawlApp({apiKey: "YOUR_API_KEY"});
+const app = new FirecrawlApp({apiKey: "fc-YOUR_API_KEY"});
+// Scrape a website:
+const scrapeResult = await app.scrapeUrl('firecrawl.dev');
+console.log(scrapeResult.data.content)
+
+// Crawl a website:
const crawlResult = await app.crawlUrl('mendable.ai', {crawlerOptions: {excludes: ['blog/*'], limit: 5}}, false);
console.log(crawlResult)
@@ -17,4 +23,61 @@ while (true) {
await new Promise(resolve => setTimeout(resolve, 1000)); // wait 1 second
}
-console.log(job.data[0].content);
\ No newline at end of file
+console.log(job.data[0].content);
+
+// Search for a query:
+const query = 'what is mendable?'
+const searchResult = await app.search(query)
+console.log(searchResult)
+
+// LLM Extraction:
+// Define schema to extract contents into using zod schema
+const zodSchema = z.object({
+ top: z
+ .array(
+ z.object({
+ title: z.string(),
+ points: z.number(),
+ by: z.string(),
+ commentsURL: z.string(),
+ })
+ )
+ .length(5)
+ .describe("Top 5 stories on Hacker News"),
+});
+
+let llmExtractionResult = await app.scrapeUrl("https://news.ycombinator.com", {
+ extractorOptions: { extractionSchema: zodSchema },
+});
+
+console.log(llmExtractionResult.data.llm_extraction);
+
+// Define schema to extract contents into using json schema
+const jsonSchema = {
+ "type": "object",
+ "properties": {
+ "top": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "title": {"type": "string"},
+ "points": {"type": "number"},
+ "by": {"type": "string"},
+ "commentsURL": {"type": "string"}
+ },
+ "required": ["title", "points", "by", "commentsURL"]
+ },
+ "minItems": 5,
+ "maxItems": 5,
+ "description": "Top 5 stories on Hacker News"
+ }
+ },
+ "required": ["top"]
+}
+
+llmExtractionResult = await app.scrapeUrl("https://news.ycombinator.com", {
+ extractorOptions: { extractionSchema: jsonSchema },
+});
+
+console.log(llmExtractionResult.data.llm_extraction);
\ No newline at end of file
diff --git a/apps/js-sdk/example.ts b/apps/js-sdk/example.ts
new file mode 100644
index 0000000..9fa823a
--- /dev/null
+++ b/apps/js-sdk/example.ts
@@ -0,0 +1,83 @@
+import FirecrawlApp, { JobStatusResponse } from '@mendable/firecrawl-js';
+import { z } from "zod";
+
+const app = new FirecrawlApp({apiKey: "fc-YOUR_API_KEY"});
+
+// Scrape a website:
+const scrapeResult = await app.scrapeUrl('firecrawl.dev');
+console.log(scrapeResult.data.content)
+
+// Crawl a website:
+const crawlResult = await app.crawlUrl('mendable.ai', {crawlerOptions: {excludes: ['blog/*'], limit: 5}}, false);
+console.log(crawlResult)
+
+const jobId: string = await crawlResult['jobId'];
+console.log(jobId);
+
+let job: JobStatusResponse;
+while (true) {
+ job = await app.checkCrawlStatus(jobId);
+ if (job.status === 'completed') {
+ break;
+ }
+ await new Promise(resolve => setTimeout(resolve, 1000)); // wait 1 second
+}
+
+console.log(job.data[0].content);
+
+// Search for a query:
+const query = 'what is mendable?'
+const searchResult = await app.search(query)
+console.log(searchResult)
+
+// LLM Extraction:
+// Define schema to extract contents into using zod schema
+const zodSchema = z.object({
+ top: z
+ .array(
+ z.object({
+ title: z.string(),
+ points: z.number(),
+ by: z.string(),
+ commentsURL: z.string(),
+ })
+ )
+ .length(5)
+ .describe("Top 5 stories on Hacker News"),
+});
+
+let llmExtractionResult = await app.scrapeUrl("https://news.ycombinator.com", {
+ extractorOptions: { extractionSchema: zodSchema },
+});
+
+console.log(llmExtractionResult.data.llm_extraction);
+
+// Define schema to extract contents into using json schema
+const jsonSchema = {
+ "type": "object",
+ "properties": {
+ "top": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "title": {"type": "string"},
+ "points": {"type": "number"},
+ "by": {"type": "string"},
+ "commentsURL": {"type": "string"}
+ },
+ "required": ["title", "points", "by", "commentsURL"]
+ },
+ "minItems": 5,
+ "maxItems": 5,
+ "description": "Top 5 stories on Hacker News"
+ }
+ },
+ "required": ["top"]
+}
+
+llmExtractionResult = await app.scrapeUrl("https://news.ycombinator.com", {
+ extractorOptions: { extractionSchema: jsonSchema },
+});
+
+console.log(llmExtractionResult.data.llm_extraction);
\ No newline at end of file
diff --git a/apps/js-sdk/firecrawl/README.md b/apps/js-sdk/firecrawl/README.md
index 3f92c32..085e865 100644
--- a/apps/js-sdk/firecrawl/README.md
+++ b/apps/js-sdk/firecrawl/README.md
@@ -77,6 +77,42 @@ To scrape a single URL with error handling, use the `scrapeUrl` method. It takes
scrapeExample();
```
+### Extracting structured data from a URL
+
+With LLM extraction, you can easily extract structured data from any URL. We support zod schemas to make it easier for you too. Here is how you to use it:
+
+```js
+import { z } from "zod";
+
+const zodSchema = z.object({
+ top: z
+ .array(
+ z.object({
+ title: z.string(),
+ points: z.number(),
+ by: z.string(),
+ commentsURL: z.string(),
+ })
+ )
+ .length(5)
+ .describe("Top 5 stories on Hacker News"),
+});
+
+let llmExtractionResult = await app.scrapeUrl("https://news.ycombinator.com", {
+ extractorOptions: { extractionSchema: zodSchema },
+});
+
+console.log(llmExtractionResult.data.llm_extraction);
+```
+
+### Search for a query
+
+Used to search the web, get the most relevant results, scrap each page and return the markdown.
+
+```js
+query = 'what is mendable?'
+searchResult = app.search(query)
+```
### Crawling a Website
diff --git a/apps/js-sdk/firecrawl/build/index.js b/apps/js-sdk/firecrawl/build/index.js
index 9d8237b..6e0f367 100644
--- a/apps/js-sdk/firecrawl/build/index.js
+++ b/apps/js-sdk/firecrawl/build/index.js
@@ -7,9 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
-import axios from 'axios';
-import dotenv from 'dotenv';
-dotenv.config();
+import axios from "axios";
+import { z } from "zod";
+import { zodToJsonSchema } from "zod-to-json-schema";
/**
* Main class for interacting with the Firecrawl API.
*/
@@ -19,9 +19,9 @@ export default class FirecrawlApp {
* @param {FirecrawlAppConfig} config - Configuration options for the FirecrawlApp instance.
*/
constructor({ apiKey = null }) {
- this.apiKey = apiKey || process.env.FIRECRAWL_API_KEY || '';
+ this.apiKey = apiKey || "";
if (!this.apiKey) {
- throw new Error('No API key provided');
+ throw new Error("No API key provided");
}
}
/**
@@ -32,16 +32,22 @@ export default class FirecrawlApp {
*/
scrapeUrl(url_1) {
return __awaiter(this, arguments, void 0, function* (url, params = null) {
+ var _a;
const headers = {
- 'Content-Type': 'application/json',
- 'Authorization': `Bearer ${this.apiKey}`,
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${this.apiKey}`,
};
- let jsonData = { url };
- if (params) {
- jsonData = Object.assign(Object.assign({}, jsonData), params);
+ let jsonData = Object.assign({ url }, params);
+ if ((_a = params === null || params === void 0 ? void 0 : params.extractorOptions) === null || _a === void 0 ? void 0 : _a.extractionSchema) {
+ let schema = params.extractorOptions.extractionSchema;
+ // Check if schema is an instance of ZodSchema to correctly identify Zod schemas
+ if (schema instanceof z.ZodSchema) {
+ schema = zodToJsonSchema(schema);
+ }
+ jsonData = Object.assign(Object.assign({}, jsonData), { extractorOptions: Object.assign(Object.assign({}, params.extractorOptions), { extractionSchema: schema, mode: params.extractorOptions.mode || "llm-extraction" }) });
}
try {
- const response = yield axios.post('https://api.firecrawl.dev/v0/scrape', jsonData, { headers });
+ const response = yield axios.post("https://api.firecrawl.dev/v0/scrape", jsonData, { headers });
if (response.status === 200) {
const responseData = response.data;
if (responseData.success) {
@@ -52,13 +58,13 @@ export default class FirecrawlApp {
}
}
else {
- this.handleError(response, 'scrape URL');
+ this.handleError(response, "scrape URL");
}
}
catch (error) {
throw new Error(error.message);
}
- return { success: false, error: 'Internal server error.' };
+ return { success: false, error: "Internal server error." };
});
}
/**
@@ -70,15 +76,15 @@ export default class FirecrawlApp {
search(query_1) {
return __awaiter(this, arguments, void 0, function* (query, params = null) {
const headers = {
- 'Content-Type': 'application/json',
- 'Authorization': `Bearer ${this.apiKey}`,
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${this.apiKey}`,
};
let jsonData = { query };
if (params) {
jsonData = Object.assign(Object.assign({}, jsonData), params);
}
try {
- const response = yield axios.post('https://api.firecrawl.dev/v0/search', jsonData, { headers });
+ const response = yield axios.post("https://api.firecrawl.dev/v0/search", jsonData, { headers });
if (response.status === 200) {
const responseData = response.data;
if (responseData.success) {
@@ -89,13 +95,13 @@ export default class FirecrawlApp {
}
}
else {
- this.handleError(response, 'search');
+ this.handleError(response, "search");
}
}
catch (error) {
throw new Error(error.message);
}
- return { success: false, error: 'Internal server error.' };
+ return { success: false, error: "Internal server error." };
});
}
/**
@@ -114,7 +120,7 @@ export default class FirecrawlApp {
jsonData = Object.assign(Object.assign({}, jsonData), params);
}
try {
- const response = yield this.postRequest('https://api.firecrawl.dev/v0/crawl', jsonData, headers);
+ const response = yield this.postRequest("https://api.firecrawl.dev/v0/crawl", jsonData, headers);
if (response.status === 200) {
const jobId = response.data.jobId;
if (waitUntilDone) {
@@ -125,14 +131,14 @@ export default class FirecrawlApp {
}
}
else {
- this.handleError(response, 'start crawl job');
+ this.handleError(response, "start crawl job");
}
}
catch (error) {
console.log(error);
throw new Error(error.message);
}
- return { success: false, error: 'Internal server error.' };
+ return { success: false, error: "Internal server error." };
});
}
/**
@@ -149,13 +155,17 @@ export default class FirecrawlApp {
return response.data;
}
else {
- this.handleError(response, 'check crawl status');
+ this.handleError(response, "check crawl status");
}
}
catch (error) {
throw new Error(error.message);
}
- return { success: false, status: 'unknown', error: 'Internal server error.' };
+ return {
+ success: false,
+ status: "unknown",
+ error: "Internal server error.",
+ };
});
}
/**
@@ -164,8 +174,8 @@ export default class FirecrawlApp {
*/
prepareHeaders() {
return {
- 'Content-Type': 'application/json',
- 'Authorization': `Bearer ${this.apiKey}`,
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${this.apiKey}`,
};
}
/**
@@ -200,26 +210,26 @@ export default class FirecrawlApp {
const statusResponse = yield this.getRequest(`https://api.firecrawl.dev/v0/crawl/status/${jobId}`, headers);
if (statusResponse.status === 200) {
const statusData = statusResponse.data;
- if (statusData.status === 'completed') {
- if ('data' in statusData) {
+ if (statusData.status === "completed") {
+ if ("data" in statusData) {
return statusData.data;
}
else {
- throw new Error('Crawl job completed but no data was returned');
+ throw new Error("Crawl job completed but no data was returned");
}
}
- else if (['active', 'paused', 'pending', 'queued'].includes(statusData.status)) {
+ else if (["active", "paused", "pending", "queued"].includes(statusData.status)) {
if (timeout < 2) {
timeout = 2;
}
- yield new Promise(resolve => setTimeout(resolve, timeout * 1000)); // Wait for the specified timeout before checking again
+ yield new Promise((resolve) => setTimeout(resolve, timeout * 1000)); // Wait for the specified timeout before checking again
}
else {
throw new Error(`Crawl job failed or was stopped. Status: ${statusData.status}`);
}
}
else {
- this.handleError(statusResponse, 'check crawl status');
+ this.handleError(statusResponse, "check crawl status");
}
}
});
@@ -231,7 +241,7 @@ export default class FirecrawlApp {
*/
handleError(response, action) {
if ([402, 409, 500].includes(response.status)) {
- const errorMessage = response.data.error || 'Unknown error occurred';
+ const errorMessage = response.data.error || "Unknown error occurred";
throw new Error(`Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}`);
}
else {
diff --git a/apps/js-sdk/firecrawl/package-lock.json b/apps/js-sdk/firecrawl/package-lock.json
index 9811597..6b085be 100644
--- a/apps/js-sdk/firecrawl/package-lock.json
+++ b/apps/js-sdk/firecrawl/package-lock.json
@@ -1,15 +1,17 @@
{
"name": "@mendable/firecrawl-js",
- "version": "0.0.13",
+ "version": "0.0.17-beta.8",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@mendable/firecrawl-js",
- "version": "0.0.13",
+ "version": "0.0.17-beta.8",
"license": "MIT",
"dependencies": {
- "axios": "^1.6.8"
+ "axios": "^1.6.8",
+ "zod": "^3.23.8",
+ "zod-to-json-schema": "^3.23.0"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
@@ -3766,6 +3768,22 @@
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
+ },
+ "node_modules/zod": {
+ "version": "3.23.8",
+ "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz",
+ "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==",
+ "funding": {
+ "url": "https://github.com/sponsors/colinhacks"
+ }
+ },
+ "node_modules/zod-to-json-schema": {
+ "version": "3.23.0",
+ "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.23.0.tgz",
+ "integrity": "sha512-az0uJ243PxsRIa2x1WmNE/pnuA05gUq/JB8Lwe1EDCCL/Fz9MgjYQ0fPlyc2Tcv6aF2ZA7WM5TWaRZVEFaAIag==",
+ "peerDependencies": {
+ "zod": "^3.23.3"
+ }
}
}
}
diff --git a/apps/js-sdk/firecrawl/package.json b/apps/js-sdk/firecrawl/package.json
index a8275f7..9e1948a 100644
--- a/apps/js-sdk/firecrawl/package.json
+++ b/apps/js-sdk/firecrawl/package.json
@@ -1,6 +1,6 @@
{
"name": "@mendable/firecrawl-js",
- "version": "0.0.16",
+ "version": "0.0.20",
"description": "JavaScript SDK for Firecrawl API",
"main": "build/index.js",
"types": "types/index.d.ts",
@@ -8,6 +8,7 @@
"scripts": {
"build": "tsc",
"publish": "npm run build && npm publish --access public",
+ "publish-beta": "npm run build && npm publish --access public --tag beta",
"test": "jest src/**/*.test.ts"
},
"repository": {
@@ -17,7 +18,9 @@
"author": "Mendable.ai",
"license": "MIT",
"dependencies": {
- "axios": "^1.6.8"
+ "axios": "^1.6.8",
+ "zod": "^3.23.8",
+ "zod-to-json-schema": "^3.23.0"
},
"bugs": {
"url": "https://github.com/mendableai/firecrawl/issues"
diff --git a/apps/js-sdk/firecrawl/src/index.ts b/apps/js-sdk/firecrawl/src/index.ts
index aea15f8..0319c74 100644
--- a/apps/js-sdk/firecrawl/src/index.ts
+++ b/apps/js-sdk/firecrawl/src/index.ts
@@ -1,5 +1,6 @@
-import axios, { AxiosResponse, AxiosRequestHeaders } from 'axios';
-
+import axios, { AxiosResponse, AxiosRequestHeaders } from "axios";
+import { z } from "zod";
+import { zodToJsonSchema } from "zod-to-json-schema";
/**
* Configuration interface for FirecrawlApp.
*/
@@ -12,6 +13,11 @@ export interface FirecrawlAppConfig {
*/
export interface Params {
[key: string]: any;
+ extractorOptions?: {
+ extractionSchema: z.ZodSchema | any;
+ mode?: "llm-extraction";
+ extractionPrompt?: string;
+ };
}
/**
@@ -63,9 +69,9 @@ export default class FirecrawlApp {
* @param {FirecrawlAppConfig} config - Configuration options for the FirecrawlApp instance.
*/
constructor({ apiKey = null }: FirecrawlAppConfig) {
- this.apiKey = apiKey || '';
+ this.apiKey = apiKey || "";
if (!this.apiKey) {
- throw new Error('No API key provided');
+ throw new Error("No API key provided");
}
}
@@ -75,31 +81,50 @@ export default class FirecrawlApp {
* @param {Params | null} params - Additional parameters for the scrape request.
* @returns {Promise} The response from the scrape operation.
*/
- async scrapeUrl(url: string, params: Params | null = null): Promise {
+ async scrapeUrl(
+ url: string,
+ params: Params | null = null
+ ): Promise {
const headers: AxiosRequestHeaders = {
- 'Content-Type': 'application/json',
- 'Authorization': `Bearer ${this.apiKey}`,
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${this.apiKey}`,
} as AxiosRequestHeaders;
- let jsonData: Params = { url };
- if (params) {
- jsonData = { ...jsonData, ...params };
+ let jsonData: Params = { url, ...params };
+ if (params?.extractorOptions?.extractionSchema) {
+ let schema = params.extractorOptions.extractionSchema;
+ // Check if schema is an instance of ZodSchema to correctly identify Zod schemas
+ if (schema instanceof z.ZodSchema) {
+ schema = zodToJsonSchema(schema);
+ }
+ jsonData = {
+ ...jsonData,
+ extractorOptions: {
+ ...params.extractorOptions,
+ extractionSchema: schema,
+ mode: params.extractorOptions.mode || "llm-extraction",
+ },
+ };
}
try {
- const response: AxiosResponse = await axios.post('https://api.firecrawl.dev/v0/scrape', jsonData, { headers });
+ const response: AxiosResponse = await axios.post(
+ "https://api.firecrawl.dev/v0/scrape",
+ jsonData,
+ { headers }
+ );
if (response.status === 200) {
const responseData = response.data;
if (responseData.success) {
- return responseData;
+ return responseData;
} else {
throw new Error(`Failed to scrape URL. Error: ${responseData.error}`);
}
} else {
- this.handleError(response, 'scrape URL');
+ this.handleError(response, "scrape URL");
}
} catch (error: any) {
throw new Error(error.message);
}
- return { success: false, error: 'Internal server error.' };
+ return { success: false, error: "Internal server error." };
}
/**
@@ -108,31 +133,38 @@ export default class FirecrawlApp {
* @param {Params | null} params - Additional parameters for the search request.
* @returns {Promise} The response from the search operation.
*/
- async search(query: string, params: Params | null = null): Promise {
+ async search(
+ query: string,
+ params: Params | null = null
+ ): Promise {
const headers: AxiosRequestHeaders = {
- 'Content-Type': 'application/json',
- 'Authorization': `Bearer ${this.apiKey}`,
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${this.apiKey}`,
} as AxiosRequestHeaders;
let jsonData: Params = { query };
if (params) {
jsonData = { ...jsonData, ...params };
}
try {
- const response: AxiosResponse = await axios.post('https://api.firecrawl.dev/v0/search', jsonData, { headers });
+ const response: AxiosResponse = await axios.post(
+ "https://api.firecrawl.dev/v0/search",
+ jsonData,
+ { headers }
+ );
if (response.status === 200) {
const responseData = response.data;
if (responseData.success) {
- return responseData;
+ return responseData;
} else {
throw new Error(`Failed to search. Error: ${responseData.error}`);
}
} else {
- this.handleError(response, 'search');
+ this.handleError(response, "search");
}
} catch (error: any) {
throw new Error(error.message);
}
- return { success: false, error: 'Internal server error.' };
+ return { success: false, error: "Internal server error." };
}
/**
@@ -143,14 +175,23 @@ export default class FirecrawlApp {
* @param {number} timeout - Timeout in seconds for job status checks.
* @returns {Promise} The response from the crawl operation.
*/
- async crawlUrl(url: string, params: Params | null = null, waitUntilDone: boolean = true, timeout: number = 2): Promise {
+ async crawlUrl(
+ url: string,
+ params: Params | null = null,
+ waitUntilDone: boolean = true,
+ timeout: number = 2
+ ): Promise {
const headers = this.prepareHeaders();
let jsonData: Params = { url };
if (params) {
jsonData = { ...jsonData, ...params };
}
try {
- const response: AxiosResponse = await this.postRequest('https://api.firecrawl.dev/v0/crawl', jsonData, headers);
+ const response: AxiosResponse = await this.postRequest(
+ "https://api.firecrawl.dev/v0/crawl",
+ jsonData,
+ headers
+ );
if (response.status === 200) {
const jobId: string = response.data.jobId;
if (waitUntilDone) {
@@ -159,13 +200,13 @@ export default class FirecrawlApp {
return { success: true, jobId };
}
} else {
- this.handleError(response, 'start crawl job');
+ this.handleError(response, "start crawl job");
}
} catch (error: any) {
- console.log(error)
+ console.log(error);
throw new Error(error.message);
}
- return { success: false, error: 'Internal server error.' };
+ return { success: false, error: "Internal server error." };
}
/**
@@ -176,16 +217,23 @@ export default class FirecrawlApp {
async checkCrawlStatus(jobId: string): Promise {
const headers: AxiosRequestHeaders = this.prepareHeaders();
try {
- const response: AxiosResponse = await this.getRequest(`https://api.firecrawl.dev/v0/crawl/status/${jobId}`, headers);
+ const response: AxiosResponse = await this.getRequest(
+ `https://api.firecrawl.dev/v0/crawl/status/${jobId}`,
+ headers
+ );
if (response.status === 200) {
return response.data;
} else {
- this.handleError(response, 'check crawl status');
+ this.handleError(response, "check crawl status");
}
} catch (error: any) {
throw new Error(error.message);
}
- return { success: false, status: 'unknown', error: 'Internal server error.' };
+ return {
+ success: false,
+ status: "unknown",
+ error: "Internal server error.",
+ };
}
/**
@@ -194,8 +242,8 @@ export default class FirecrawlApp {
*/
prepareHeaders(): AxiosRequestHeaders {
return {
- 'Content-Type': 'application/json',
- 'Authorization': `Bearer ${this.apiKey}`,
+ "Content-Type": "application/json",
+ Authorization: `Bearer ${this.apiKey}`,
} as AxiosRequestHeaders;
}
@@ -206,7 +254,11 @@ export default class FirecrawlApp {
* @param {AxiosRequestHeaders} headers - The headers for the request.
* @returns {Promise} The response from the POST request.
*/
- postRequest(url: string, data: Params, headers: AxiosRequestHeaders): Promise {
+ postRequest(
+ url: string,
+ data: Params,
+ headers: AxiosRequestHeaders
+ ): Promise {
return axios.post(url, data, { headers });
}
@@ -216,7 +268,10 @@ export default class FirecrawlApp {
* @param {AxiosRequestHeaders} headers - The headers for the request.
* @returns {Promise} The response from the GET request.
*/
- getRequest(url: string, headers: AxiosRequestHeaders): Promise {
+ getRequest(
+ url: string,
+ headers: AxiosRequestHeaders
+ ): Promise {
return axios.get(url, { headers });
}
@@ -227,27 +282,38 @@ export default class FirecrawlApp {
* @param {number} timeout - Timeout in seconds for job status checks.
* @returns {Promise} The final job status or data.
*/
- async monitorJobStatus(jobId: string, headers: AxiosRequestHeaders, timeout: number): Promise {
+ async monitorJobStatus(
+ jobId: string,
+ headers: AxiosRequestHeaders,
+ timeout: number
+ ): Promise {
while (true) {
- const statusResponse: AxiosResponse = await this.getRequest(`https://api.firecrawl.dev/v0/crawl/status/${jobId}`, headers);
+ const statusResponse: AxiosResponse = await this.getRequest(
+ `https://api.firecrawl.dev/v0/crawl/status/${jobId}`,
+ headers
+ );
if (statusResponse.status === 200) {
const statusData = statusResponse.data;
- if (statusData.status === 'completed') {
- if ('data' in statusData) {
+ if (statusData.status === "completed") {
+ if ("data" in statusData) {
return statusData.data;
} else {
- throw new Error('Crawl job completed but no data was returned');
+ throw new Error("Crawl job completed but no data was returned");
}
- } else if (['active', 'paused', 'pending', 'queued'].includes(statusData.status)) {
+ } else if (
+ ["active", "paused", "pending", "queued"].includes(statusData.status)
+ ) {
if (timeout < 2) {
timeout = 2;
}
- await new Promise(resolve => setTimeout(resolve, timeout * 1000)); // Wait for the specified timeout before checking again
+ await new Promise((resolve) => setTimeout(resolve, timeout * 1000)); // Wait for the specified timeout before checking again
} else {
- throw new Error(`Crawl job failed or was stopped. Status: ${statusData.status}`);
+ throw new Error(
+ `Crawl job failed or was stopped. Status: ${statusData.status}`
+ );
}
} else {
- this.handleError(statusResponse, 'check crawl status');
+ this.handleError(statusResponse, "check crawl status");
}
}
}
@@ -259,10 +325,15 @@ export default class FirecrawlApp {
*/
handleError(response: AxiosResponse, action: string): void {
if ([402, 409, 500].includes(response.status)) {
- const errorMessage: string = response.data.error || 'Unknown error occurred';
- throw new Error(`Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}`);
+ const errorMessage: string =
+ response.data.error || "Unknown error occurred";
+ throw new Error(
+ `Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}`
+ );
} else {
- throw new Error(`Unexpected error occurred while trying to ${action}. Status code: ${response.status}`);
+ throw new Error(
+ `Unexpected error occurred while trying to ${action}. Status code: ${response.status}`
+ );
}
}
}
diff --git a/apps/js-sdk/firecrawl/types/index.d.ts b/apps/js-sdk/firecrawl/types/index.d.ts
index 7f79d64..40d95c4 100644
--- a/apps/js-sdk/firecrawl/types/index.d.ts
+++ b/apps/js-sdk/firecrawl/types/index.d.ts
@@ -1,4 +1,5 @@
-import { AxiosResponse, AxiosRequestHeaders } from 'axios';
+import { AxiosResponse, AxiosRequestHeaders } from "axios";
+import { z } from "zod";
/**
* Configuration interface for FirecrawlApp.
*/
@@ -10,6 +11,11 @@ export interface FirecrawlAppConfig {
*/
export interface Params {
[key: string]: any;
+ extractorOptions?: {
+ extractionSchema: z.ZodSchema | any;
+ mode?: "llm-extraction";
+ extractionPrompt?: string;
+ };
}
/**
* Response interface for scraping operations.
diff --git a/apps/js-sdk/package-lock.json b/apps/js-sdk/package-lock.json
index 363f301..4d26319 100644
--- a/apps/js-sdk/package-lock.json
+++ b/apps/js-sdk/package-lock.json
@@ -9,19 +9,480 @@
"version": "1.0.0",
"license": "ISC",
"dependencies": {
- "@mendable/firecrawl-js": "^0.0.15",
- "axios": "^1.6.8"
+ "@mendable/firecrawl-js": "^0.0.19",
+ "axios": "^1.6.8",
+ "ts-node": "^10.9.2",
+ "typescript": "^5.4.5",
+ "zod": "^3.23.8"
+ },
+ "devDependencies": {
+ "tsx": "^4.9.3"
+ }
+ },
+ "node_modules/@cspotcode/source-map-support": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
+ "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
+ "dependencies": {
+ "@jridgewell/trace-mapping": "0.3.9"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz",
+ "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz",
+ "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz",
+ "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz",
+ "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz",
+ "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz",
+ "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz",
+ "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz",
+ "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz",
+ "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz",
+ "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz",
+ "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz",
+ "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz",
+ "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz",
+ "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz",
+ "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz",
+ "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz",
+ "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz",
+ "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz",
+ "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz",
+ "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz",
+ "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz",
+ "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz",
+ "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.4.15",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
+ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg=="
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.9",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
+ "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.0.3",
+ "@jridgewell/sourcemap-codec": "^1.4.10"
}
},
"node_modules/@mendable/firecrawl-js": {
- "version": "0.0.15",
- "resolved": "https://registry.npmjs.org/@mendable/firecrawl-js/-/firecrawl-js-0.0.15.tgz",
- "integrity": "sha512-e3iCCrLIiEh+jEDerGV9Uhdkn8ymo+sG+k3osCwPg51xW1xUdAnmlcHrcJoR43RvKXdvD/lqoxg8odUEsqyH+w==",
+ "version": "0.0.19",
+ "resolved": "https://registry.npmjs.org/@mendable/firecrawl-js/-/firecrawl-js-0.0.19.tgz",
+ "integrity": "sha512-u9BDVIN/bftDztxLlE2cf02Nz0si3+Vmy9cANDFHj/iriT3guzI8ITBk4uC81CyRmPzNyXrW6hSAG90g9ol4cA==",
"dependencies": {
"axios": "^1.6.8",
- "dotenv": "^16.4.5"
+ "zod": "^3.23.8",
+ "zod-to-json-schema": "^3.23.0"
}
},
+ "node_modules/@tsconfig/node10": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz",
+ "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw=="
+ },
+ "node_modules/@tsconfig/node12": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz",
+ "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag=="
+ },
+ "node_modules/@tsconfig/node14": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz",
+ "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow=="
+ },
+ "node_modules/@tsconfig/node16": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz",
+ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA=="
+ },
+ "node_modules/@types/node": {
+ "version": "20.12.11",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.11.tgz",
+ "integrity": "sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==",
+ "peer": true,
+ "dependencies": {
+ "undici-types": "~5.26.4"
+ }
+ },
+ "node_modules/acorn": {
+ "version": "8.11.3",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
+ "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/acorn-walk": {
+ "version": "8.3.2",
+ "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz",
+ "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==",
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/arg": {
+ "version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
+ "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA=="
+ },
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
@@ -48,6 +509,11 @@
"node": ">= 0.8"
}
},
+ "node_modules/create-require": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz",
+ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ=="
+ },
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
@@ -56,15 +522,50 @@
"node": ">=0.4.0"
}
},
- "node_modules/dotenv": {
- "version": "16.4.5",
- "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz",
- "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==",
+ "node_modules/diff": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
+ "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
+ "engines": {
+ "node": ">=0.3.1"
+ }
+ },
+ "node_modules/esbuild": {
+ "version": "0.20.2",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz",
+ "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==",
+ "dev": true,
+ "hasInstallScript": true,
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
"engines": {
"node": ">=12"
},
- "funding": {
- "url": "https://dotenvx.com"
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.20.2",
+ "@esbuild/android-arm": "0.20.2",
+ "@esbuild/android-arm64": "0.20.2",
+ "@esbuild/android-x64": "0.20.2",
+ "@esbuild/darwin-arm64": "0.20.2",
+ "@esbuild/darwin-x64": "0.20.2",
+ "@esbuild/freebsd-arm64": "0.20.2",
+ "@esbuild/freebsd-x64": "0.20.2",
+ "@esbuild/linux-arm": "0.20.2",
+ "@esbuild/linux-arm64": "0.20.2",
+ "@esbuild/linux-ia32": "0.20.2",
+ "@esbuild/linux-loong64": "0.20.2",
+ "@esbuild/linux-mips64el": "0.20.2",
+ "@esbuild/linux-ppc64": "0.20.2",
+ "@esbuild/linux-riscv64": "0.20.2",
+ "@esbuild/linux-s390x": "0.20.2",
+ "@esbuild/linux-x64": "0.20.2",
+ "@esbuild/netbsd-x64": "0.20.2",
+ "@esbuild/openbsd-x64": "0.20.2",
+ "@esbuild/sunos-x64": "0.20.2",
+ "@esbuild/win32-arm64": "0.20.2",
+ "@esbuild/win32-ia32": "0.20.2",
+ "@esbuild/win32-x64": "0.20.2"
}
},
"node_modules/follow-redirects": {
@@ -99,6 +600,37 @@
"node": ">= 6"
}
},
+ "node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
+ "node_modules/get-tsconfig": {
+ "version": "4.7.4",
+ "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.4.tgz",
+ "integrity": "sha512-ofbkKj+0pjXjhejr007J/fLf+sW+8H7K5GCm+msC8q3IpvgjobpyPqSRFemNyIMxklC0zeJpi7VDFna19FacvQ==",
+ "dev": true,
+ "dependencies": {
+ "resolve-pkg-maps": "^1.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
+ }
+ },
+ "node_modules/make-error": {
+ "version": "1.3.6",
+ "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
+ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw=="
+ },
"node_modules/mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
@@ -122,6 +654,123 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
+ },
+ "node_modules/resolve-pkg-maps": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
+ "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
+ "dev": true,
+ "funding": {
+ "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
+ }
+ },
+ "node_modules/ts-node": {
+ "version": "10.9.2",
+ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz",
+ "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==",
+ "dependencies": {
+ "@cspotcode/source-map-support": "^0.8.0",
+ "@tsconfig/node10": "^1.0.7",
+ "@tsconfig/node12": "^1.0.7",
+ "@tsconfig/node14": "^1.0.0",
+ "@tsconfig/node16": "^1.0.2",
+ "acorn": "^8.4.1",
+ "acorn-walk": "^8.1.1",
+ "arg": "^4.1.0",
+ "create-require": "^1.1.0",
+ "diff": "^4.0.1",
+ "make-error": "^1.1.1",
+ "v8-compile-cache-lib": "^3.0.1",
+ "yn": "3.1.1"
+ },
+ "bin": {
+ "ts-node": "dist/bin.js",
+ "ts-node-cwd": "dist/bin-cwd.js",
+ "ts-node-esm": "dist/bin-esm.js",
+ "ts-node-script": "dist/bin-script.js",
+ "ts-node-transpile-only": "dist/bin-transpile.js",
+ "ts-script": "dist/bin-script-deprecated.js"
+ },
+ "peerDependencies": {
+ "@swc/core": ">=1.2.50",
+ "@swc/wasm": ">=1.2.50",
+ "@types/node": "*",
+ "typescript": ">=2.7"
+ },
+ "peerDependenciesMeta": {
+ "@swc/core": {
+ "optional": true
+ },
+ "@swc/wasm": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/tsx": {
+ "version": "4.9.3",
+ "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.9.3.tgz",
+ "integrity": "sha512-czVbetlILiyJZI5zGlj2kw9vFiSeyra9liPD4nG+Thh4pKTi0AmMEQ8zdV/L2xbIVKrIqif4sUNrsMAOksx9Zg==",
+ "dev": true,
+ "dependencies": {
+ "esbuild": "~0.20.2",
+ "get-tsconfig": "^4.7.3"
+ },
+ "bin": {
+ "tsx": "dist/cli.mjs"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.3"
+ }
+ },
+ "node_modules/typescript": {
+ "version": "5.4.5",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
+ "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/undici-types": {
+ "version": "5.26.5",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
+ "peer": true
+ },
+ "node_modules/v8-compile-cache-lib": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz",
+ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg=="
+ },
+ "node_modules/yn": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
+ "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/zod": {
+ "version": "3.23.8",
+ "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz",
+ "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==",
+ "funding": {
+ "url": "https://github.com/sponsors/colinhacks"
+ }
+ },
+ "node_modules/zod-to-json-schema": {
+ "version": "3.23.0",
+ "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.23.0.tgz",
+ "integrity": "sha512-az0uJ243PxsRIa2x1WmNE/pnuA05gUq/JB8Lwe1EDCCL/Fz9MgjYQ0fPlyc2Tcv6aF2ZA7WM5TWaRZVEFaAIag==",
+ "peerDependencies": {
+ "zod": "^3.23.3"
+ }
}
}
}
diff --git a/apps/js-sdk/package.json b/apps/js-sdk/package.json
index 563e1e3..0e93fe3 100644
--- a/apps/js-sdk/package.json
+++ b/apps/js-sdk/package.json
@@ -11,7 +11,13 @@
"author": "",
"license": "ISC",
"dependencies": {
- "@mendable/firecrawl-js": "^0.0.15",
- "axios": "^1.6.8"
+ "@mendable/firecrawl-js": "^0.0.19",
+ "axios": "^1.6.8",
+ "ts-node": "^10.9.2",
+ "typescript": "^5.4.5",
+ "zod": "^3.23.8"
+ },
+ "devDependencies": {
+ "tsx": "^4.9.3"
}
}
diff --git a/apps/js-sdk/test.ts b/apps/js-sdk/test.ts
new file mode 100644
index 0000000..5419c2d
--- /dev/null
+++ b/apps/js-sdk/test.ts
@@ -0,0 +1,28 @@
+import FirecrawlApp from "@mendable/firecrawl-js";
+import { z } from "zod";
+
+async function a() {
+ const app = new FirecrawlApp({
+ apiKey: "fc-YOUR_API_KEY",
+ });
+
+ // Define schema to extract contents into
+ const schema = z.object({
+ top: z
+ .array(
+ z.object({
+ title: z.string(),
+ points: z.number(),
+ by: z.string(),
+ commentsURL: z.string(),
+ })
+ )
+ .length(5)
+ .describe("Top 5 stories on Hacker News"),
+ });
+ const scrapeResult = await app.scrapeUrl("https://firecrawl.dev", {
+ extractorOptions: { extractionSchema: schema },
+ });
+ console.log(scrapeResult.data["llm_extraction"]);
+}
+a();
diff --git a/apps/js-sdk/tsconfig.json b/apps/js-sdk/tsconfig.json
new file mode 100644
index 0000000..affe0ed
--- /dev/null
+++ b/apps/js-sdk/tsconfig.json
@@ -0,0 +1,72 @@
+{
+ "compilerOptions": {
+ /* Visit https://aka.ms/tsconfig.json to read more about this file */
+
+ /* Basic Options */
+ // "incremental": true, /* Enable incremental compilation */
+ "target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
+ "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
+ // "lib": [], /* Specify library files to be included in the compilation. */
+ // "allowJs": true, /* Allow javascript files to be compiled. */
+ // "checkJs": true, /* Report errors in .js files. */
+ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
+ "declaration": true /* Generates corresponding '.d.ts' file. */,
+ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
+ // "sourceMap": true, /* Generates corresponding '.map' file. */
+ // "outFile": "./", /* Concatenate and emit output to single file. */
+ "outDir": "./build" /* Redirect output structure to the directory. */,
+ // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
+ // "composite": true, /* Enable project compilation */
+ // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
+ // "removeComments": true, /* Do not emit comments to output. */
+ // "noEmit": true, /* Do not emit outputs. */
+ // "importHelpers": true, /* Import emit helpers from 'tslib'. */
+ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
+ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
+
+ /* Strict Type-Checking Options */
+ "strict": false /* Enable all strict type-checking options. */,
+ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
+ // "strictNullChecks": true, /* Enable strict null checks. */
+ // "strictFunctionTypes": true, /* Enable strict checking of function types. */
+ // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
+ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
+ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
+ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
+
+ /* Additional Checks */
+ // "noUnusedLocals": true, /* Report errors on unused locals. */
+ // "noUnusedParameters": true, /* Report errors on unused parameters. */
+ // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
+ // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
+
+ /* Module Resolution Options */
+ // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
+ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
+ // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
+ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
+ // "typeRoots": [], /* List of folders to include type definitions from. */
+ // "types": [], /* Type declaration files to be included in compilation. */
+ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
+ "resolveJsonModule": true,
+ "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
+ // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
+
+ /* Source Map Options */
+ // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
+ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
+ // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
+
+ /* Experimental Options */
+ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
+ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
+
+ /* Advanced Options */
+ "skipLibCheck": true /* Skip type checking of declaration files. */,
+ "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
+ },
+ "include": ["src", "test.ts"],
+ "exclude": ["node_modules", "**/__tests__/*"]
+}
diff --git a/apps/playwright-service/main.py b/apps/playwright-service/main.py
index 7a6e620..c28bc63 100644
--- a/apps/playwright-service/main.py
+++ b/apps/playwright-service/main.py
@@ -5,9 +5,9 @@ from pydantic import BaseModel
app = FastAPI()
-
class UrlModel(BaseModel):
url: str
+ wait: int = None
browser: Browser = None
@@ -29,7 +29,9 @@ async def shutdown_event():
async def root(body: UrlModel):
context = await browser.new_context()
page = await context.new_page()
- await page.goto(body.url)
+ await page.goto(body.url, timeout=15000) # Set max timeout to 15s
+ if body.wait: # Check if wait parameter is provided in the request body
+ await page.wait_for_timeout(body.wait) # Convert seconds to milliseconds for playwright
page_content = await page.content()
await context.close()
json_compatible_item_data = {"content": page_content}
diff --git a/apps/python-sdk/README.md b/apps/python-sdk/README.md
index 02ad307..38ca843 100644
--- a/apps/python-sdk/README.md
+++ b/apps/python-sdk/README.md
@@ -46,6 +46,31 @@ To scrape a single URL, use the `scrape_url` method. It takes the URL as a param
url = 'https://example.com'
scraped_data = app.scrape_url(url)
```
+### Extracting structured data from a URL
+
+With LLM extraction, you can easily extract structured data from any URL. We support pydantic schemas to make it easier for you too. Here is how you to use it:
+
+```python
+class ArticleSchema(BaseModel):
+ title: str
+ points: int
+ by: str
+ commentsURL: str
+
+class TopArticlesSchema(BaseModel):
+ top: List[ArticleSchema] = Field(..., max_items=5, description="Top 5 stories")
+
+data = app.scrape_url('https://news.ycombinator.com', {
+ 'extractorOptions': {
+ 'extractionSchema': TopArticlesSchema.model_json_schema(),
+ 'mode': 'llm-extraction'
+ },
+ 'pageOptions':{
+ 'onlyMainContent': True
+ }
+})
+print(data["llm_extraction"])
+```
### Search for a query
diff --git a/apps/python-sdk/build/lib/firecrawl/firecrawl.py b/apps/python-sdk/build/lib/firecrawl/firecrawl.py
index ef3eb53..701810c 100644
--- a/apps/python-sdk/build/lib/firecrawl/firecrawl.py
+++ b/apps/python-sdk/build/lib/firecrawl/firecrawl.py
@@ -1,5 +1,7 @@
import os
+from typing import Any, Dict, Optional
import requests
+import time
class FirecrawlApp:
def __init__(self, api_key=None):
@@ -7,26 +9,45 @@ class FirecrawlApp:
if self.api_key is None:
raise ValueError('No API key provided')
- def scrape_url(self, url, params=None):
+
+
+ def scrape_url(self, url: str, params: Optional[Dict[str, Any]] = None) -> Any:
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {self.api_key}'
}
- json_data = {'url': url}
+ # Prepare the base scrape parameters with the URL
+ scrape_params = {'url': url}
+
+ # If there are additional params, process them
if params:
- json_data.update(params)
+ # Initialize extractorOptions if present
+ extractor_options = params.get('extractorOptions', {})
+ # Check and convert the extractionSchema if it's a Pydantic model
+ if 'extractionSchema' in extractor_options:
+ if hasattr(extractor_options['extractionSchema'], 'schema'):
+ extractor_options['extractionSchema'] = extractor_options['extractionSchema'].schema()
+ # Ensure 'mode' is set, defaulting to 'llm-extraction' if not explicitly provided
+ extractor_options['mode'] = extractor_options.get('mode', 'llm-extraction')
+ # Update the scrape_params with the processed extractorOptions
+ scrape_params['extractorOptions'] = extractor_options
+
+ # Include any other params directly at the top level of scrape_params
+ for key, value in params.items():
+ if key != 'extractorOptions':
+ scrape_params[key] = value
+ # Make the POST request with the prepared headers and JSON data
response = requests.post(
'https://api.firecrawl.dev/v0/scrape',
headers=headers,
- json=json_data
+ json=scrape_params
)
if response.status_code == 200:
response = response.json()
- if response['success'] == True:
+ if response['success']:
return response['data']
else:
raise Exception(f'Failed to scrape URL. Error: {response["error"]}')
-
elif response.status_code in [402, 409, 500]:
error_message = response.json().get('error', 'Unknown error occurred')
raise Exception(f'Failed to scrape URL. Status code: {response.status_code}. Error: {error_message}')
@@ -88,11 +109,23 @@ class FirecrawlApp:
'Authorization': f'Bearer {self.api_key}'
}
- def _post_request(self, url, data, headers):
- return requests.post(url, headers=headers, json=data)
+ def _post_request(self, url, data, headers, retries=3, backoff_factor=0.5):
+ for attempt in range(retries):
+ response = requests.post(url, headers=headers, json=data)
+ if response.status_code == 502:
+ time.sleep(backoff_factor * (2 ** attempt))
+ else:
+ return response
+ return response
- def _get_request(self, url, headers):
- return requests.get(url, headers=headers)
+ def _get_request(self, url, headers, retries=3, backoff_factor=0.5):
+ for attempt in range(retries):
+ response = requests.get(url, headers=headers)
+ if response.status_code == 502:
+ time.sleep(backoff_factor * (2 ** attempt))
+ else:
+ return response
+ return response
def _monitor_job_status(self, job_id, headers, timeout):
import time
diff --git a/apps/python-sdk/dist/firecrawl-py-0.0.6.tar.gz b/apps/python-sdk/dist/firecrawl-py-0.0.6.tar.gz
deleted file mode 100644
index c1b4206..0000000
Binary files a/apps/python-sdk/dist/firecrawl-py-0.0.6.tar.gz and /dev/null differ
diff --git a/apps/python-sdk/dist/firecrawl-py-0.0.8.tar.gz b/apps/python-sdk/dist/firecrawl-py-0.0.8.tar.gz
new file mode 100644
index 0000000..b18dde5
Binary files /dev/null and b/apps/python-sdk/dist/firecrawl-py-0.0.8.tar.gz differ
diff --git a/apps/python-sdk/dist/firecrawl_py-0.0.6-py3-none-any.whl b/apps/python-sdk/dist/firecrawl_py-0.0.6-py3-none-any.whl
deleted file mode 100644
index 5aba561..0000000
Binary files a/apps/python-sdk/dist/firecrawl_py-0.0.6-py3-none-any.whl and /dev/null differ
diff --git a/apps/python-sdk/dist/firecrawl_py-0.0.8-py3-none-any.whl b/apps/python-sdk/dist/firecrawl_py-0.0.8-py3-none-any.whl
new file mode 100644
index 0000000..f71cb8e
Binary files /dev/null and b/apps/python-sdk/dist/firecrawl_py-0.0.8-py3-none-any.whl differ
diff --git a/apps/python-sdk/example.py b/apps/python-sdk/example.py
index b178400..d83be6d 100644
--- a/apps/python-sdk/example.py
+++ b/apps/python-sdk/example.py
@@ -1,13 +1,73 @@
from firecrawl import FirecrawlApp
+app = FirecrawlApp(api_key="fc-YOUR_API_KEY")
-app = FirecrawlApp(api_key="YOUR_API_KEY")
+# Scrape a website:
+scrape_result = app.scrape_url('firecrawl.dev')
+print(scrape_result['markdown'])
+# Crawl a website:
crawl_result = app.crawl_url('mendable.ai', {'crawlerOptions': {'excludes': ['blog/*']}})
-print(crawl_result[0]['markdown'])
+print(crawl_result)
-job_id = crawl_result['jobId']
-print(job_id)
+# LLM Extraction:
+# Define schema to extract contents into using pydantic
+from pydantic import BaseModel, Field
+from typing import List
-status = app.check_crawl_status(job_id)
-print(status)
+class ArticleSchema(BaseModel):
+ title: str
+ points: int
+ by: str
+ commentsURL: str
+
+class TopArticlesSchema(BaseModel):
+ top: List[ArticleSchema] = Field(..., max_items=5, description="Top 5 stories")
+
+llm_extraction_result = app.scrape_url('https://news.ycombinator.com', {
+ 'extractorOptions': {
+ 'extractionSchema': TopArticlesSchema.model_json_schema(),
+ 'mode': 'llm-extraction'
+ },
+ 'pageOptions':{
+ 'onlyMainContent': True
+ }
+})
+
+print(llm_extraction_result['llm_extraction'])
+
+# Define schema to extract contents into using json schema
+json_schema = {
+ "type": "object",
+ "properties": {
+ "top": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "title": {"type": "string"},
+ "points": {"type": "number"},
+ "by": {"type": "string"},
+ "commentsURL": {"type": "string"}
+ },
+ "required": ["title", "points", "by", "commentsURL"]
+ },
+ "minItems": 5,
+ "maxItems": 5,
+ "description": "Top 5 stories on Hacker News"
+ }
+ },
+ "required": ["top"]
+}
+
+llm_extraction_result = app.scrape_url('https://news.ycombinator.com', {
+ 'extractorOptions': {
+ 'extractionSchema': json_schema,
+ 'mode': 'llm-extraction'
+ },
+ 'pageOptions':{
+ 'onlyMainContent': True
+ }
+})
+
+print(llm_extraction_result['llm_extraction'])
\ No newline at end of file
diff --git a/apps/python-sdk/firecrawl/firecrawl.py b/apps/python-sdk/firecrawl/firecrawl.py
index 441b940..701810c 100644
--- a/apps/python-sdk/firecrawl/firecrawl.py
+++ b/apps/python-sdk/firecrawl/firecrawl.py
@@ -1,4 +1,5 @@
import os
+from typing import Any, Dict, Optional
import requests
import time
@@ -8,26 +9,45 @@ class FirecrawlApp:
if self.api_key is None:
raise ValueError('No API key provided')
- def scrape_url(self, url, params=None):
+
+
+ def scrape_url(self, url: str, params: Optional[Dict[str, Any]] = None) -> Any:
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {self.api_key}'
}
- json_data = {'url': url}
+ # Prepare the base scrape parameters with the URL
+ scrape_params = {'url': url}
+
+ # If there are additional params, process them
if params:
- json_data.update(params)
+ # Initialize extractorOptions if present
+ extractor_options = params.get('extractorOptions', {})
+ # Check and convert the extractionSchema if it's a Pydantic model
+ if 'extractionSchema' in extractor_options:
+ if hasattr(extractor_options['extractionSchema'], 'schema'):
+ extractor_options['extractionSchema'] = extractor_options['extractionSchema'].schema()
+ # Ensure 'mode' is set, defaulting to 'llm-extraction' if not explicitly provided
+ extractor_options['mode'] = extractor_options.get('mode', 'llm-extraction')
+ # Update the scrape_params with the processed extractorOptions
+ scrape_params['extractorOptions'] = extractor_options
+
+ # Include any other params directly at the top level of scrape_params
+ for key, value in params.items():
+ if key != 'extractorOptions':
+ scrape_params[key] = value
+ # Make the POST request with the prepared headers and JSON data
response = requests.post(
'https://api.firecrawl.dev/v0/scrape',
headers=headers,
- json=json_data
+ json=scrape_params
)
if response.status_code == 200:
response = response.json()
- if response['success'] == True:
+ if response['success']:
return response['data']
else:
raise Exception(f'Failed to scrape URL. Error: {response["error"]}')
-
elif response.status_code in [402, 409, 500]:
error_message = response.json().get('error', 'Unknown error occurred')
raise Exception(f'Failed to scrape URL. Status code: {response.status_code}. Error: {error_message}')
diff --git a/apps/python-sdk/firecrawl_py.egg-info/PKG-INFO b/apps/python-sdk/firecrawl_py.egg-info/PKG-INFO
index 61589c2..e54fda5 100644
--- a/apps/python-sdk/firecrawl_py.egg-info/PKG-INFO
+++ b/apps/python-sdk/firecrawl_py.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: firecrawl-py
-Version: 0.0.6
+Version: 0.0.8
Summary: Python SDK for Firecrawl API
Home-page: https://github.com/mendableai/firecrawl
Author: Mendable.ai
diff --git a/apps/python-sdk/setup.py b/apps/python-sdk/setup.py
index a3589e3..78a4d84 100644
--- a/apps/python-sdk/setup.py
+++ b/apps/python-sdk/setup.py
@@ -2,12 +2,12 @@ from setuptools import setup, find_packages
setup(
name='firecrawl-py',
- version='0.0.6',
+ version='0.0.8',
url='https://github.com/mendableai/firecrawl',
author='Mendable.ai',
author_email='nick@mendable.ai',
description='Python SDK for Firecrawl API',
- packages=find_packages(),
+ packages=find_packages(),
install_requires=[
'requests',
],
diff --git a/apps/test-suite/.env.example b/apps/test-suite/.env.example
new file mode 100644
index 0000000..67f0368
--- /dev/null
+++ b/apps/test-suite/.env.example
@@ -0,0 +1,5 @@
+OPENAI_API_KEY=
+TEST_API_KEY=
+TEST_URL=http://localhost:3002
+ANTHROPIC_API_KEY=
+ENV=
\ No newline at end of file
diff --git a/apps/test-suite/README.md b/apps/test-suite/README.md
new file mode 100644
index 0000000..450a0e3
--- /dev/null
+++ b/apps/test-suite/README.md
@@ -0,0 +1,43 @@
+# Test Suite for Firecrawl
+
+This document provides an overview of the test suite for the Firecrawl project. It includes instructions on how to run the tests and interpret the results.
+
+## Overview
+
+The test suite is designed to ensure the reliability and performance of the Firecrawl system. It includes a series of automated tests that check various functionalities and performance metrics.
+
+## Running the Tests
+
+To run the tests, navigate to the `test-suite` directory and execute the following command:
+
+```bash
+npm install
+npx playwright install
+npm run test
+```
+
+## Test Results
+
+The tests are designed to cover various aspects of the system, including:
+
+- Crawling accuracy
+- Response time
+- Error handling
+
+### Example Test Case
+
+- **Test Name**: Accuracy Test
+- **Description**: This test checks the accuracy of the scraping mechanism with 100 pages and a fuzzy threshold of 0.8.
+- **Expected Result**: Accuracy >= 0.9
+- **Received Result**: Accuracy between 0.2 and 0.3
+
+## Troubleshooting
+
+If you encounter any failures or unexpected results, please check the following:
+- Ensure your network connection is stable.
+- Verify that all dependencies are correctly installed.
+- Review the error logs for any specific error messages.
+
+## Contributing
+
+Contributions to the test suite are welcome. Please refer to the project's main [CONTRIBUTING.md](../CONTRIBUTING.md) file for guidelines on how to contribute.
\ No newline at end of file
diff --git a/apps/test-suite/data/websites.json b/apps/test-suite/data/websites.json
new file mode 100644
index 0000000..9fc705c
--- /dev/null
+++ b/apps/test-suite/data/websites.json
@@ -0,0 +1,118 @@
+[
+ {
+ "website": "https://www.anthropic.com/claude",
+ "prompt": "Does this website contain pricing information?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://mendable.ai/pricing",
+ "prompt": "Does this website contain pricing information?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://openai.com/news",
+ "prompt": "Does this website contain a list of research news?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://agentops.ai",
+ "prompt": "Does this website contain a code snippets?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://ycombinator.com/companies",
+ "prompt": "Does this website contain a list bigger than 5 of ycombinator companies?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://firecrawl.dev",
+ "prompt": "Does this website contain a list bigger than 5 of ycombinator companies?",
+ "expected_output": "no"
+ },
+ {
+ "website": "https://en.wikipedia.org/wiki/T._N._Seshan",
+ "prompt": "Does this website talk about Seshan's career?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://mendable.ai/blog",
+ "prompt": "Does this website contain multiple blog articles?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://www.framer.com/pricing",
+ "prompt": "Is there an enterprise pricing option?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://fly.io/docs/gpus/gpu-quickstart",
+ "prompt": "Is there a fly deploy command on this page?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://news.ycombinator.com/",
+ "prompt": "Does this website contain a list of articles in a table markdown format?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://www.vellum.ai/llm-leaderboard",
+ "prompt": "Does this website contain a model comparison table?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://www.bigbadtoystore.com",
+ "prompt": "are there more than 3 toys in the new arrivals section?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://www.instructables.com",
+ "prompt": "Does the site offer more than 5 links about circuits?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://www.powells.com",
+ "prompt": "is there at least 10 books webpage links?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://www.royalacademy.org.uk",
+ "prompt": "is there information on upcoming art exhibitions?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://www.eastbaytimes.com",
+ "prompt": "Is there a Trending Nationally section that lists articles?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://www.manchestereveningnews.co.uk",
+ "prompt": "is the content focused on Manchester sports news?",
+ "expected_output": "no"
+ },
+ {
+ "website": "https://physicsworld.com",
+ "prompt": "does the site provide at least 15 updates on the latest physics research?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://richmondconfidential.org",
+ "prompt": "does the page contains more than 4 articles?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://www.techinasia.com",
+ "prompt": "is there at least 10 articles of the startup scene in Asia?",
+ "expected_output": "yes",
+ "notes": "The website has a paywall and bot detectors."
+ },
+ {
+ "website": "https://www.boardgamegeek.com",
+ "prompt": "are there more than 5 board game news?",
+ "expected_output": "yes"
+ },
+ {
+ "website": "https://www.mountainproject.com",
+ "prompt": "Are there more than 3 climbing guides for Arizona?",
+ "expected_output": "yes"
+ }
+]
diff --git a/apps/test-suite/index.test.ts b/apps/test-suite/index.test.ts
new file mode 100644
index 0000000..8d6c31f
--- /dev/null
+++ b/apps/test-suite/index.test.ts
@@ -0,0 +1,189 @@
+import request from "supertest";
+import dotenv from "dotenv";
+import Anthropic from "@anthropic-ai/sdk";
+import { numTokensFromString } from "./utils/tokens";
+import OpenAI from "openai";
+import { WebsiteScrapeError } from "./utils/types";
+import { logErrors } from "./utils/log";
+
+const websitesData = require("./data/websites.json");
+import "dotenv/config";
+
+const fs = require('fs');
+
+dotenv.config();
+
+interface WebsiteData {
+ website: string;
+ prompt: string;
+ expected_output: string;
+}
+
+const TEST_URL = "http://127.0.0.1:3002";
+
+
+describe("Scraping/Crawling Checkup (E2E)", () => {
+ beforeAll(() => {
+ if (!process.env.TEST_API_KEY) {
+ throw new Error("TEST_API_KEY is not set");
+ }
+ if (!process.env.OPENAI_API_KEY) {
+ throw new Error("OPENAI_API_KEY is not set");
+ }
+ });
+
+ describe("Scraping website tests with a dataset", () => {
+ it("Should scrape the website and prompt it against OpenAI", async () => {
+ let passedTests = 0;
+ const batchSize = 15; // Adjusted to comply with the rate limit of 15 per minute
+ const batchPromises = [];
+ let totalTokens = 0;
+
+ const startTime = new Date().getTime();
+ const date = new Date();
+ const logsDir = `logs/${date.getMonth() + 1}-${date.getDate()}-${date.getFullYear()}`;
+
+ let errorLogFileName = `${logsDir}/run.log_${new Date().toTimeString().split(' ')[0]}`;
+ const errorLog: WebsiteScrapeError[] = [];
+
+ for (let i = 0; i < websitesData.length; i += batchSize) {
+ // Introducing delay to respect the rate limit of 15 requests per minute
+ await new Promise(resolve => setTimeout(resolve, 10000));
+
+ const batch = websitesData.slice(i, i + batchSize);
+ const batchPromise = Promise.all(
+ batch.map(async (websiteData: WebsiteData) => {
+ try {
+ const scrapedContent = await request(TEST_URL || "")
+ .post("/v0/scrape")
+ .set("Content-Type", "application/json")
+ .set("Authorization", `Bearer ${process.env.TEST_API_KEY}`)
+ .send({ url: websiteData.website, pageOptions: { onlyMainContent: true } });
+
+ if (scrapedContent.statusCode !== 200) {
+ console.error(`Failed to scrape ${websiteData.website} ${scrapedContent.statusCode}`);
+ errorLog.push({
+ website: websiteData.website,
+ prompt: websiteData.prompt,
+ expected_output: websiteData.expected_output,
+ actual_output: "",
+ error: `Failed to scrape website. ${scrapedContent.statusCode} ${scrapedContent.body.error}`
+ });
+ return null;
+ }
+
+ const anthropic = new Anthropic({
+ apiKey: process.env.ANTHROPIC_API_KEY,
+ });
+
+ const openai = new OpenAI({
+ apiKey: process.env.OPENAI_API_KEY,
+ });
+
+ const prompt = `Based on this markdown extracted from a website html page, ${websiteData.prompt} Just say 'yes' or 'no' to the question.\nWebsite markdown: ${scrapedContent.body.data.markdown}\n`;
+
+ let msg = null;
+ const maxRetries = 3;
+ let attempts = 0;
+ while (!msg && attempts < maxRetries) {
+ try {
+ msg = await openai.chat.completions.create({
+ model: "gpt-4-turbo",
+ max_tokens: 100,
+ temperature: 0,
+ messages: [
+ {
+ role: "user",
+ content: prompt
+ },
+ ],
+ });
+ } catch (error) {
+ console.error(`Attempt ${attempts + 1}: Failed to prompt for ${websiteData.website}, error: ${error}`);
+ attempts++;
+ if (attempts < maxRetries) {
+ console.log(`Retrying... Attempt ${attempts + 1}`);
+ await new Promise(resolve => setTimeout(resolve, 2000)); // Wait for 2 seconds before retrying
+ }
+ }
+ }
+
+ if (!msg) {
+ console.error(`Failed to prompt for ${websiteData.website} after ${maxRetries} attempts`);
+ errorLog.push({
+ website: websiteData.website,
+ prompt: websiteData.prompt,
+ expected_output: websiteData.expected_output,
+ actual_output: "",
+ error: "Failed to prompt... model error."
+ });
+ return null;
+ }
+
+ const actualOutput = (msg.choices[0].message.content ?? "").toLowerCase()
+ const expectedOutput = websiteData.expected_output.toLowerCase();
+
+ const numTokens = numTokensFromString(prompt,"gpt-4") + numTokensFromString(actualOutput,"gpt-4");
+
+ totalTokens += numTokens;
+ if (actualOutput.includes(expectedOutput)) {
+ passedTests++;
+ } else {
+ console.error(
+ `This website failed the test: ${websiteData.website}`
+ );
+ console.error(`Actual output: ${actualOutput}`);
+ errorLog.push({
+ website: websiteData.website,
+ prompt: websiteData.prompt,
+ expected_output: websiteData.expected_output,
+ actual_output: actualOutput,
+ error: "Output mismatch"
+ });
+ }
+
+ return {
+ website: websiteData.website,
+ prompt: websiteData.prompt,
+ expectedOutput,
+ actualOutput,
+ };
+ } catch (error) {
+ console.error(
+ `Error processing ${websiteData.website}: ${error}`
+ );
+ errorLog.push({
+ website: websiteData.website,
+ prompt: websiteData.prompt,
+ expected_output: websiteData.expected_output,
+ actual_output: "",
+ error: `Error processing ${websiteData.website}: ${error}`
+ });
+ return null;
+ }
+ })
+ );
+ batchPromises.push(batchPromise);
+ }
+
+ (await Promise.all(batchPromises)).flat();
+ const score = (passedTests / websitesData.length) * 100;
+ const endTime = new Date().getTime();
+ const timeTaken = (endTime - startTime) / 1000;
+ console.log(`Score: ${score}%`);
+ console.log(`Total tokens: ${totalTokens}`);
+
+ await logErrors(errorLog, timeTaken, totalTokens, score, websitesData.length);
+
+ if (process.env.ENV === "local" && errorLog.length > 0) {
+ if (!fs.existsSync(logsDir)){
+ fs.mkdirSync(logsDir, { recursive: true });
+ }
+ fs.writeFileSync(errorLogFileName, JSON.stringify(errorLog, null, 2));
+ }
+
+
+ expect(score).toBeGreaterThanOrEqual(75);
+ }, 350000); // 150 seconds timeout
+ });
+});
diff --git a/apps/test-suite/jest.config.js b/apps/test-suite/jest.config.js
new file mode 100644
index 0000000..c099257
--- /dev/null
+++ b/apps/test-suite/jest.config.js
@@ -0,0 +1,5 @@
+module.exports = {
+ preset: "ts-jest",
+ testEnvironment: "node",
+ setupFiles: ["./jest.setup.js"],
+};
diff --git a/apps/test-suite/jest.setup.js b/apps/test-suite/jest.setup.js
new file mode 100644
index 0000000..e69de29
diff --git a/apps/test-suite/package.json b/apps/test-suite/package.json
new file mode 100644
index 0000000..74ab7a6
--- /dev/null
+++ b/apps/test-suite/package.json
@@ -0,0 +1,26 @@
+{
+ "name": "test-suite",
+ "version": "1.0.0",
+ "description": "",
+ "scripts": {
+ "test": "npx jest --detectOpenHandles --forceExit --openHandlesTimeout=120000 --watchAll=false"
+ },
+ "author": "",
+ "license": "ISC",
+ "dependencies": {
+ "@anthropic-ai/sdk": "^0.20.8",
+ "@dqbd/tiktoken": "^1.0.14",
+ "@supabase/supabase-js": "^2.43.1",
+ "dotenv": "^16.4.5",
+ "jest": "^29.7.0",
+ "openai": "^4.40.2",
+ "playwright": "^1.43.1",
+ "supertest": "^7.0.0",
+ "ts-jest": "^29.1.2"
+ },
+ "devDependencies": {
+ "@types/jest": "^29.5.12",
+ "@types/supertest": "^6.0.2",
+ "typescript": "^5.4.5"
+ }
+}
diff --git a/apps/test-suite/pnpm-lock.yaml b/apps/test-suite/pnpm-lock.yaml
new file mode 100644
index 0000000..0a69477
--- /dev/null
+++ b/apps/test-suite/pnpm-lock.yaml
@@ -0,0 +1,2746 @@
+lockfileVersion: '6.0'
+
+settings:
+ autoInstallPeers: true
+ excludeLinksFromLockfile: false
+
+dependencies:
+ '@anthropic-ai/sdk':
+ specifier: ^0.20.8
+ version: 0.20.8
+ '@dqbd/tiktoken':
+ specifier: ^1.0.14
+ version: 1.0.14
+ '@supabase/supabase-js':
+ specifier: ^2.43.1
+ version: 2.43.1
+ dotenv:
+ specifier: ^16.4.5
+ version: 16.4.5
+ jest:
+ specifier: ^29.7.0
+ version: 29.7.0
+ openai:
+ specifier: ^4.40.2
+ version: 4.40.2
+ playwright:
+ specifier: ^1.43.1
+ version: 1.43.1
+ supertest:
+ specifier: ^7.0.0
+ version: 7.0.0
+ ts-jest:
+ specifier: ^29.1.2
+ version: 29.1.2(@babel/core@7.24.5)(jest@29.7.0)(typescript@5.4.5)
+
+devDependencies:
+ '@types/jest':
+ specifier: ^29.5.12
+ version: 29.5.12
+ '@types/supertest':
+ specifier: ^6.0.2
+ version: 6.0.2
+ typescript:
+ specifier: ^5.4.5
+ version: 5.4.5
+
+packages:
+
+ /@ampproject/remapping@2.3.0:
+ resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==}
+ engines: {node: '>=6.0.0'}
+ dependencies:
+ '@jridgewell/gen-mapping': 0.3.5
+ '@jridgewell/trace-mapping': 0.3.25
+ dev: false
+
+ /@anthropic-ai/sdk@0.20.8:
+ resolution: {integrity: sha512-dTMDrWYIFyoSr9P0b/gT2Nu1scBuEq4LU9SGX901ktP4aQxs2jiSWq6A80pRmVxyjFl3ngFvcOmVVrP0NHNhOg==}
+ dependencies:
+ '@types/node': 18.19.31
+ '@types/node-fetch': 2.6.11
+ abort-controller: 3.0.0
+ agentkeepalive: 4.5.0
+ form-data-encoder: 1.7.2
+ formdata-node: 4.4.1
+ node-fetch: 2.7.0
+ web-streams-polyfill: 3.3.3
+ transitivePeerDependencies:
+ - encoding
+ dev: false
+
+ /@babel/code-frame@7.24.2:
+ resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/highlight': 7.24.5
+ picocolors: 1.0.0
+
+ /@babel/compat-data@7.24.4:
+ resolution: {integrity: sha512-vg8Gih2MLK+kOkHJp4gBEIkyaIi00jgWot2D9QOmmfLC8jINSOzmCLta6Bvz/JSBCqnegV0L80jhxkol5GWNfQ==}
+ engines: {node: '>=6.9.0'}
+ dev: false
+
+ /@babel/core@7.24.5:
+ resolution: {integrity: sha512-tVQRucExLQ02Boi4vdPp49svNGcfL2GhdTCT9aldhXgCJVAI21EtRfBettiuLUwce/7r6bFdgs6JFkcdTiFttA==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@ampproject/remapping': 2.3.0
+ '@babel/code-frame': 7.24.2
+ '@babel/generator': 7.24.5
+ '@babel/helper-compilation-targets': 7.23.6
+ '@babel/helper-module-transforms': 7.24.5(@babel/core@7.24.5)
+ '@babel/helpers': 7.24.5
+ '@babel/parser': 7.24.5
+ '@babel/template': 7.24.0
+ '@babel/traverse': 7.24.5
+ '@babel/types': 7.24.5
+ convert-source-map: 2.0.0
+ debug: 4.3.4
+ gensync: 1.0.0-beta.2
+ json5: 2.2.3
+ semver: 6.3.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /@babel/generator@7.24.5:
+ resolution: {integrity: sha512-x32i4hEXvr+iI0NEoEfDKzlemF8AmtOP8CcrRaEcpzysWuoEb1KknpcvMsHKPONoKZiDuItklgWhB18xEhr9PA==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/types': 7.24.5
+ '@jridgewell/gen-mapping': 0.3.5
+ '@jridgewell/trace-mapping': 0.3.25
+ jsesc: 2.5.2
+ dev: false
+
+ /@babel/helper-compilation-targets@7.23.6:
+ resolution: {integrity: sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/compat-data': 7.24.4
+ '@babel/helper-validator-option': 7.23.5
+ browserslist: 4.23.0
+ lru-cache: 5.1.1
+ semver: 6.3.1
+ dev: false
+
+ /@babel/helper-environment-visitor@7.22.20:
+ resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==}
+ engines: {node: '>=6.9.0'}
+ dev: false
+
+ /@babel/helper-function-name@7.23.0:
+ resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/template': 7.24.0
+ '@babel/types': 7.24.5
+ dev: false
+
+ /@babel/helper-hoist-variables@7.22.5:
+ resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/types': 7.24.5
+ dev: false
+
+ /@babel/helper-module-imports@7.24.3:
+ resolution: {integrity: sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/types': 7.24.5
+ dev: false
+
+ /@babel/helper-module-transforms@7.24.5(@babel/core@7.24.5):
+ resolution: {integrity: sha512-9GxeY8c2d2mdQUP1Dye0ks3VDyIMS98kt/llQ2nUId8IsWqTF0l1LkSX0/uP7l7MCDrzXS009Hyhe2gzTiGW8A==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/helper-environment-visitor': 7.22.20
+ '@babel/helper-module-imports': 7.24.3
+ '@babel/helper-simple-access': 7.24.5
+ '@babel/helper-split-export-declaration': 7.24.5
+ '@babel/helper-validator-identifier': 7.24.5
+ dev: false
+
+ /@babel/helper-plugin-utils@7.24.5:
+ resolution: {integrity: sha512-xjNLDopRzW2o6ba0gKbkZq5YWEBaK3PCyTOY1K2P/O07LGMhMqlMXPxwN4S5/RhWuCobT8z0jrlKGlYmeR1OhQ==}
+ engines: {node: '>=6.9.0'}
+ dev: false
+
+ /@babel/helper-simple-access@7.24.5:
+ resolution: {integrity: sha512-uH3Hmf5q5n7n8mz7arjUlDOCbttY/DW4DYhE6FUsjKJ/oYC1kQQUvwEQWxRwUpX9qQKRXeqLwWxrqilMrf32sQ==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/types': 7.24.5
+ dev: false
+
+ /@babel/helper-split-export-declaration@7.24.5:
+ resolution: {integrity: sha512-5CHncttXohrHk8GWOFCcCl4oRD9fKosWlIRgWm4ql9VYioKm52Mk2xsmoohvm7f3JoiLSM5ZgJuRaf5QZZYd3Q==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/types': 7.24.5
+ dev: false
+
+ /@babel/helper-string-parser@7.24.1:
+ resolution: {integrity: sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==}
+ engines: {node: '>=6.9.0'}
+ dev: false
+
+ /@babel/helper-validator-identifier@7.24.5:
+ resolution: {integrity: sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA==}
+ engines: {node: '>=6.9.0'}
+
+ /@babel/helper-validator-option@7.23.5:
+ resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==}
+ engines: {node: '>=6.9.0'}
+ dev: false
+
+ /@babel/helpers@7.24.5:
+ resolution: {integrity: sha512-CiQmBMMpMQHwM5m01YnrM6imUG1ebgYJ+fAIW4FZe6m4qHTPaRHti+R8cggAwkdz4oXhtO4/K9JWlh+8hIfR2Q==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/template': 7.24.0
+ '@babel/traverse': 7.24.5
+ '@babel/types': 7.24.5
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /@babel/highlight@7.24.5:
+ resolution: {integrity: sha512-8lLmua6AVh/8SLJRRVD6V8p73Hir9w5mJrhE+IPpILG31KKlI9iz5zmBYKcWPS59qSfgP9RaSBQSHHE81WKuEw==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/helper-validator-identifier': 7.24.5
+ chalk: 2.4.2
+ js-tokens: 4.0.0
+ picocolors: 1.0.0
+
+ /@babel/parser@7.24.5:
+ resolution: {integrity: sha512-EOv5IK8arwh3LI47dz1b0tKUb/1uhHAnHJOrjgtQMIpu1uXd9mlFrJg9IUgGUgZ41Ch0K8REPTYpO7B76b4vJg==}
+ engines: {node: '>=6.0.0'}
+ hasBin: true
+ dependencies:
+ '@babel/types': 7.24.5
+ dev: false
+
+ /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.24.5):
+ resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/helper-plugin-utils': 7.24.5
+ dev: false
+
+ /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.24.5):
+ resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/helper-plugin-utils': 7.24.5
+ dev: false
+
+ /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.24.5):
+ resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/helper-plugin-utils': 7.24.5
+ dev: false
+
+ /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.24.5):
+ resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/helper-plugin-utils': 7.24.5
+ dev: false
+
+ /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.24.5):
+ resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/helper-plugin-utils': 7.24.5
+ dev: false
+
+ /@babel/plugin-syntax-jsx@7.24.1(@babel/core@7.24.5):
+ resolution: {integrity: sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/helper-plugin-utils': 7.24.5
+ dev: false
+
+ /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.24.5):
+ resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/helper-plugin-utils': 7.24.5
+ dev: false
+
+ /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.5):
+ resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/helper-plugin-utils': 7.24.5
+ dev: false
+
+ /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.24.5):
+ resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/helper-plugin-utils': 7.24.5
+ dev: false
+
+ /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.24.5):
+ resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/helper-plugin-utils': 7.24.5
+ dev: false
+
+ /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.24.5):
+ resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/helper-plugin-utils': 7.24.5
+ dev: false
+
+ /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.5):
+ resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/helper-plugin-utils': 7.24.5
+ dev: false
+
+ /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.24.5):
+ resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/helper-plugin-utils': 7.24.5
+ dev: false
+
+ /@babel/plugin-syntax-typescript@7.24.1(@babel/core@7.24.5):
+ resolution: {integrity: sha512-Yhnmvy5HZEnHUty6i++gcfH1/l68AHnItFHnaCv6hn9dNh0hQvvQJsxpi4BMBFN5DLeHBuucT/0DgzXif/OyRw==}
+ engines: {node: '>=6.9.0'}
+ peerDependencies:
+ '@babel/core': ^7.0.0-0
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/helper-plugin-utils': 7.24.5
+ dev: false
+
+ /@babel/template@7.24.0:
+ resolution: {integrity: sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/code-frame': 7.24.2
+ '@babel/parser': 7.24.5
+ '@babel/types': 7.24.5
+ dev: false
+
+ /@babel/traverse@7.24.5:
+ resolution: {integrity: sha512-7aaBLeDQ4zYcUFDUD41lJc1fG8+5IU9DaNSJAgal866FGvmD5EbWQgnEC6kO1gGLsX0esNkfnJSndbTXA3r7UA==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/code-frame': 7.24.2
+ '@babel/generator': 7.24.5
+ '@babel/helper-environment-visitor': 7.22.20
+ '@babel/helper-function-name': 7.23.0
+ '@babel/helper-hoist-variables': 7.22.5
+ '@babel/helper-split-export-declaration': 7.24.5
+ '@babel/parser': 7.24.5
+ '@babel/types': 7.24.5
+ debug: 4.3.4
+ globals: 11.12.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /@babel/types@7.24.5:
+ resolution: {integrity: sha512-6mQNsaLeXTw0nxYUYu+NSa4Hx4BlF1x1x8/PMFbiR+GBSr+2DkECc69b8hgy2frEodNcvPffeH8YfWd3LI6jhQ==}
+ engines: {node: '>=6.9.0'}
+ dependencies:
+ '@babel/helper-string-parser': 7.24.1
+ '@babel/helper-validator-identifier': 7.24.5
+ to-fast-properties: 2.0.0
+ dev: false
+
+ /@bcoe/v8-coverage@0.2.3:
+ resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
+ dev: false
+
+ /@dqbd/tiktoken@1.0.14:
+ resolution: {integrity: sha512-R+Z1cVYOc8ZoDls6T2YhlUYrwKyuZoRJsSK3vN7iWWjBJ1xoX7e5BhUkEh5n6cXuMWQVUTHLlSDpnyv0Ye7xxw==}
+ dev: false
+
+ /@istanbuljs/load-nyc-config@1.1.0:
+ resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==}
+ engines: {node: '>=8'}
+ dependencies:
+ camelcase: 5.3.1
+ find-up: 4.1.0
+ get-package-type: 0.1.0
+ js-yaml: 3.14.1
+ resolve-from: 5.0.0
+ dev: false
+
+ /@istanbuljs/schema@0.1.3:
+ resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==}
+ engines: {node: '>=8'}
+ dev: false
+
+ /@jest/console@29.7.0:
+ resolution: {integrity: sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/types': 29.6.3
+ '@types/node': 18.19.31
+ chalk: 4.1.2
+ jest-message-util: 29.7.0
+ jest-util: 29.7.0
+ slash: 3.0.0
+ dev: false
+
+ /@jest/core@29.7.0:
+ resolution: {integrity: sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ peerDependencies:
+ node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
+ peerDependenciesMeta:
+ node-notifier:
+ optional: true
+ dependencies:
+ '@jest/console': 29.7.0
+ '@jest/reporters': 29.7.0
+ '@jest/test-result': 29.7.0
+ '@jest/transform': 29.7.0
+ '@jest/types': 29.6.3
+ '@types/node': 18.19.31
+ ansi-escapes: 4.3.2
+ chalk: 4.1.2
+ ci-info: 3.9.0
+ exit: 0.1.2
+ graceful-fs: 4.2.11
+ jest-changed-files: 29.7.0
+ jest-config: 29.7.0(@types/node@18.19.31)
+ jest-haste-map: 29.7.0
+ jest-message-util: 29.7.0
+ jest-regex-util: 29.6.3
+ jest-resolve: 29.7.0
+ jest-resolve-dependencies: 29.7.0
+ jest-runner: 29.7.0
+ jest-runtime: 29.7.0
+ jest-snapshot: 29.7.0
+ jest-util: 29.7.0
+ jest-validate: 29.7.0
+ jest-watcher: 29.7.0
+ micromatch: 4.0.5
+ pretty-format: 29.7.0
+ slash: 3.0.0
+ strip-ansi: 6.0.1
+ transitivePeerDependencies:
+ - babel-plugin-macros
+ - supports-color
+ - ts-node
+ dev: false
+
+ /@jest/environment@29.7.0:
+ resolution: {integrity: sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/fake-timers': 29.7.0
+ '@jest/types': 29.6.3
+ '@types/node': 18.19.31
+ jest-mock: 29.7.0
+ dev: false
+
+ /@jest/expect-utils@29.7.0:
+ resolution: {integrity: sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ jest-get-type: 29.6.3
+
+ /@jest/expect@29.7.0:
+ resolution: {integrity: sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ expect: 29.7.0
+ jest-snapshot: 29.7.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /@jest/fake-timers@29.7.0:
+ resolution: {integrity: sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/types': 29.6.3
+ '@sinonjs/fake-timers': 10.3.0
+ '@types/node': 18.19.31
+ jest-message-util: 29.7.0
+ jest-mock: 29.7.0
+ jest-util: 29.7.0
+ dev: false
+
+ /@jest/globals@29.7.0:
+ resolution: {integrity: sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/environment': 29.7.0
+ '@jest/expect': 29.7.0
+ '@jest/types': 29.6.3
+ jest-mock: 29.7.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /@jest/reporters@29.7.0:
+ resolution: {integrity: sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ peerDependencies:
+ node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
+ peerDependenciesMeta:
+ node-notifier:
+ optional: true
+ dependencies:
+ '@bcoe/v8-coverage': 0.2.3
+ '@jest/console': 29.7.0
+ '@jest/test-result': 29.7.0
+ '@jest/transform': 29.7.0
+ '@jest/types': 29.6.3
+ '@jridgewell/trace-mapping': 0.3.25
+ '@types/node': 18.19.31
+ chalk: 4.1.2
+ collect-v8-coverage: 1.0.2
+ exit: 0.1.2
+ glob: 7.2.3
+ graceful-fs: 4.2.11
+ istanbul-lib-coverage: 3.2.2
+ istanbul-lib-instrument: 6.0.2
+ istanbul-lib-report: 3.0.1
+ istanbul-lib-source-maps: 4.0.1
+ istanbul-reports: 3.1.7
+ jest-message-util: 29.7.0
+ jest-util: 29.7.0
+ jest-worker: 29.7.0
+ slash: 3.0.0
+ string-length: 4.0.2
+ strip-ansi: 6.0.1
+ v8-to-istanbul: 9.2.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /@jest/schemas@29.6.3:
+ resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@sinclair/typebox': 0.27.8
+
+ /@jest/source-map@29.6.3:
+ resolution: {integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jridgewell/trace-mapping': 0.3.25
+ callsites: 3.1.0
+ graceful-fs: 4.2.11
+ dev: false
+
+ /@jest/test-result@29.7.0:
+ resolution: {integrity: sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/console': 29.7.0
+ '@jest/types': 29.6.3
+ '@types/istanbul-lib-coverage': 2.0.6
+ collect-v8-coverage: 1.0.2
+ dev: false
+
+ /@jest/test-sequencer@29.7.0:
+ resolution: {integrity: sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/test-result': 29.7.0
+ graceful-fs: 4.2.11
+ jest-haste-map: 29.7.0
+ slash: 3.0.0
+ dev: false
+
+ /@jest/transform@29.7.0:
+ resolution: {integrity: sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@babel/core': 7.24.5
+ '@jest/types': 29.6.3
+ '@jridgewell/trace-mapping': 0.3.25
+ babel-plugin-istanbul: 6.1.1
+ chalk: 4.1.2
+ convert-source-map: 2.0.0
+ fast-json-stable-stringify: 2.1.0
+ graceful-fs: 4.2.11
+ jest-haste-map: 29.7.0
+ jest-regex-util: 29.6.3
+ jest-util: 29.7.0
+ micromatch: 4.0.5
+ pirates: 4.0.6
+ slash: 3.0.0
+ write-file-atomic: 4.0.2
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /@jest/types@29.6.3:
+ resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/schemas': 29.6.3
+ '@types/istanbul-lib-coverage': 2.0.6
+ '@types/istanbul-reports': 3.0.4
+ '@types/node': 18.19.31
+ '@types/yargs': 17.0.32
+ chalk: 4.1.2
+
+ /@jridgewell/gen-mapping@0.3.5:
+ resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==}
+ engines: {node: '>=6.0.0'}
+ dependencies:
+ '@jridgewell/set-array': 1.2.1
+ '@jridgewell/sourcemap-codec': 1.4.15
+ '@jridgewell/trace-mapping': 0.3.25
+ dev: false
+
+ /@jridgewell/resolve-uri@3.1.2:
+ resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==}
+ engines: {node: '>=6.0.0'}
+ dev: false
+
+ /@jridgewell/set-array@1.2.1:
+ resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==}
+ engines: {node: '>=6.0.0'}
+ dev: false
+
+ /@jridgewell/sourcemap-codec@1.4.15:
+ resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==}
+ dev: false
+
+ /@jridgewell/trace-mapping@0.3.25:
+ resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==}
+ dependencies:
+ '@jridgewell/resolve-uri': 3.1.2
+ '@jridgewell/sourcemap-codec': 1.4.15
+ dev: false
+
+ /@sinclair/typebox@0.27.8:
+ resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==}
+
+ /@sinonjs/commons@3.0.1:
+ resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==}
+ dependencies:
+ type-detect: 4.0.8
+ dev: false
+
+ /@sinonjs/fake-timers@10.3.0:
+ resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==}
+ dependencies:
+ '@sinonjs/commons': 3.0.1
+ dev: false
+
+ /@supabase/auth-js@2.64.2:
+ resolution: {integrity: sha512-s+lkHEdGiczDrzXJ1YWt2y3bxRi+qIUnXcgkpLSrId7yjBeaXBFygNjTaoZLG02KNcYwbuZ9qkEIqmj2hF7svw==}
+ dependencies:
+ '@supabase/node-fetch': 2.6.15
+ dev: false
+
+ /@supabase/functions-js@2.3.1:
+ resolution: {integrity: sha512-QyzNle/rVzlOi4BbVqxLSH828VdGY1RElqGFAj+XeVypj6+PVtMlD21G8SDnsPQDtlqqTtoGRgdMlQZih5hTuw==}
+ dependencies:
+ '@supabase/node-fetch': 2.6.15
+ dev: false
+
+ /@supabase/node-fetch@2.6.15:
+ resolution: {integrity: sha512-1ibVeYUacxWYi9i0cf5efil6adJ9WRyZBLivgjs+AUpewx1F3xPi7gLgaASI2SmIQxPoCEjAsLAzKPgMJVgOUQ==}
+ engines: {node: 4.x || >=6.0.0}
+ dependencies:
+ whatwg-url: 5.0.0
+ dev: false
+
+ /@supabase/postgrest-js@1.15.2:
+ resolution: {integrity: sha512-9/7pUmXExvGuEK1yZhVYXPZnLEkDTwxgMQHXLrN5BwPZZm4iUCL1YEyep/Z2lIZah8d8M433mVAUEGsihUj5KQ==}
+ dependencies:
+ '@supabase/node-fetch': 2.6.15
+ dev: false
+
+ /@supabase/realtime-js@2.9.5:
+ resolution: {integrity: sha512-TEHlGwNGGmKPdeMtca1lFTYCedrhTAv3nZVoSjrKQ+wkMmaERuCe57zkC5KSWFzLYkb5FVHW8Hrr+PX1DDwplQ==}
+ dependencies:
+ '@supabase/node-fetch': 2.6.15
+ '@types/phoenix': 1.6.4
+ '@types/ws': 8.5.10
+ ws: 8.17.0
+ transitivePeerDependencies:
+ - bufferutil
+ - utf-8-validate
+ dev: false
+
+ /@supabase/storage-js@2.5.5:
+ resolution: {integrity: sha512-OpLoDRjFwClwc2cjTJZG8XviTiQH4Ik8sCiMK5v7et0MDu2QlXjCAW3ljxJB5+z/KazdMOTnySi+hysxWUPu3w==}
+ dependencies:
+ '@supabase/node-fetch': 2.6.15
+ dev: false
+
+ /@supabase/supabase-js@2.43.1:
+ resolution: {integrity: sha512-A+RV50mWNtyKo6M0u4G6AOqEifQD+MoOjZcpRkPMPpEAFgMsc2dt3kBlBlR/MgZizWQgUKhsvrwKk0efc8g6Ug==}
+ dependencies:
+ '@supabase/auth-js': 2.64.2
+ '@supabase/functions-js': 2.3.1
+ '@supabase/node-fetch': 2.6.15
+ '@supabase/postgrest-js': 1.15.2
+ '@supabase/realtime-js': 2.9.5
+ '@supabase/storage-js': 2.5.5
+ transitivePeerDependencies:
+ - bufferutil
+ - utf-8-validate
+ dev: false
+
+ /@types/babel__core@7.20.5:
+ resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==}
+ dependencies:
+ '@babel/parser': 7.24.5
+ '@babel/types': 7.24.5
+ '@types/babel__generator': 7.6.8
+ '@types/babel__template': 7.4.4
+ '@types/babel__traverse': 7.20.5
+ dev: false
+
+ /@types/babel__generator@7.6.8:
+ resolution: {integrity: sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==}
+ dependencies:
+ '@babel/types': 7.24.5
+ dev: false
+
+ /@types/babel__template@7.4.4:
+ resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==}
+ dependencies:
+ '@babel/parser': 7.24.5
+ '@babel/types': 7.24.5
+ dev: false
+
+ /@types/babel__traverse@7.20.5:
+ resolution: {integrity: sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==}
+ dependencies:
+ '@babel/types': 7.24.5
+ dev: false
+
+ /@types/cookiejar@2.1.5:
+ resolution: {integrity: sha512-he+DHOWReW0nghN24E1WUqM0efK4kI9oTqDm6XmK8ZPe2djZ90BSNdGnIyCLzCPw7/pogPlGbzI2wHGGmi4O/Q==}
+ dev: true
+
+ /@types/graceful-fs@4.1.9:
+ resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==}
+ dependencies:
+ '@types/node': 18.19.31
+ dev: false
+
+ /@types/istanbul-lib-coverage@2.0.6:
+ resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==}
+
+ /@types/istanbul-lib-report@3.0.3:
+ resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==}
+ dependencies:
+ '@types/istanbul-lib-coverage': 2.0.6
+
+ /@types/istanbul-reports@3.0.4:
+ resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==}
+ dependencies:
+ '@types/istanbul-lib-report': 3.0.3
+
+ /@types/jest@29.5.12:
+ resolution: {integrity: sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==}
+ dependencies:
+ expect: 29.7.0
+ pretty-format: 29.7.0
+ dev: true
+
+ /@types/methods@1.1.4:
+ resolution: {integrity: sha512-ymXWVrDiCxTBE3+RIrrP533E70eA+9qu7zdWoHuOmGujkYtzf4HQF96b8nwHLqhuf4ykX61IGRIB38CC6/sImQ==}
+ dev: true
+
+ /@types/node-fetch@2.6.11:
+ resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==}
+ dependencies:
+ '@types/node': 18.19.31
+ form-data: 4.0.0
+ dev: false
+
+ /@types/node@18.19.31:
+ resolution: {integrity: sha512-ArgCD39YpyyrtFKIqMDvjz79jto5fcI/SVUs2HwB+f0dAzq68yqOdyaSivLiLugSziTpNXLQrVb7RZFmdZzbhA==}
+ dependencies:
+ undici-types: 5.26.5
+
+ /@types/phoenix@1.6.4:
+ resolution: {integrity: sha512-B34A7uot1Cv0XtaHRYDATltAdKx0BvVKNgYNqE4WjtPUa4VQJM7kxeXcVKaH+KS+kCmZ+6w+QaUdcljiheiBJA==}
+ dev: false
+
+ /@types/stack-utils@2.0.3:
+ resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==}
+
+ /@types/superagent@8.1.6:
+ resolution: {integrity: sha512-yzBOv+6meEHSzV2NThYYOA6RtqvPr3Hbob9ZLp3i07SH27CrYVfm8CrF7ydTmidtelsFiKx2I4gZAiAOamGgvQ==}
+ dependencies:
+ '@types/cookiejar': 2.1.5
+ '@types/methods': 1.1.4
+ '@types/node': 18.19.31
+ dev: true
+
+ /@types/supertest@6.0.2:
+ resolution: {integrity: sha512-137ypx2lk/wTQbW6An6safu9hXmajAifU/s7szAHLN/FeIm5w7yR0Wkl9fdJMRSHwOn4HLAI0DaB2TOORuhPDg==}
+ dependencies:
+ '@types/methods': 1.1.4
+ '@types/superagent': 8.1.6
+ dev: true
+
+ /@types/ws@8.5.10:
+ resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==}
+ dependencies:
+ '@types/node': 18.19.31
+ dev: false
+
+ /@types/yargs-parser@21.0.3:
+ resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==}
+
+ /@types/yargs@17.0.32:
+ resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==}
+ dependencies:
+ '@types/yargs-parser': 21.0.3
+
+ /abort-controller@3.0.0:
+ resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==}
+ engines: {node: '>=6.5'}
+ dependencies:
+ event-target-shim: 5.0.1
+ dev: false
+
+ /agentkeepalive@4.5.0:
+ resolution: {integrity: sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==}
+ engines: {node: '>= 8.0.0'}
+ dependencies:
+ humanize-ms: 1.2.1
+ dev: false
+
+ /ansi-escapes@4.3.2:
+ resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==}
+ engines: {node: '>=8'}
+ dependencies:
+ type-fest: 0.21.3
+ dev: false
+
+ /ansi-regex@5.0.1:
+ resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
+ engines: {node: '>=8'}
+ dev: false
+
+ /ansi-styles@3.2.1:
+ resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==}
+ engines: {node: '>=4'}
+ dependencies:
+ color-convert: 1.9.3
+
+ /ansi-styles@4.3.0:
+ resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
+ engines: {node: '>=8'}
+ dependencies:
+ color-convert: 2.0.1
+
+ /ansi-styles@5.2.0:
+ resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==}
+ engines: {node: '>=10'}
+
+ /anymatch@3.1.3:
+ resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==}
+ engines: {node: '>= 8'}
+ dependencies:
+ normalize-path: 3.0.0
+ picomatch: 2.3.1
+ dev: false
+
+ /argparse@1.0.10:
+ resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==}
+ dependencies:
+ sprintf-js: 1.0.3
+ dev: false
+
+ /asap@2.0.6:
+ resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==}
+ dev: false
+
+ /asynckit@0.4.0:
+ resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
+ dev: false
+
+ /babel-jest@29.7.0(@babel/core@7.24.5):
+ resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ peerDependencies:
+ '@babel/core': ^7.8.0
+ dependencies:
+ '@babel/core': 7.24.5
+ '@jest/transform': 29.7.0
+ '@types/babel__core': 7.20.5
+ babel-plugin-istanbul: 6.1.1
+ babel-preset-jest: 29.6.3(@babel/core@7.24.5)
+ chalk: 4.1.2
+ graceful-fs: 4.2.11
+ slash: 3.0.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /babel-plugin-istanbul@6.1.1:
+ resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==}
+ engines: {node: '>=8'}
+ dependencies:
+ '@babel/helper-plugin-utils': 7.24.5
+ '@istanbuljs/load-nyc-config': 1.1.0
+ '@istanbuljs/schema': 0.1.3
+ istanbul-lib-instrument: 5.2.1
+ test-exclude: 6.0.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /babel-plugin-jest-hoist@29.6.3:
+ resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@babel/template': 7.24.0
+ '@babel/types': 7.24.5
+ '@types/babel__core': 7.20.5
+ '@types/babel__traverse': 7.20.5
+ dev: false
+
+ /babel-preset-current-node-syntax@1.0.1(@babel/core@7.24.5):
+ resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.5)
+ '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.24.5)
+ '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.24.5)
+ '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.24.5)
+ '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.5)
+ '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.5)
+ '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.5)
+ '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.5)
+ '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.5)
+ '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.5)
+ '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.5)
+ '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.24.5)
+ dev: false
+
+ /babel-preset-jest@29.6.3(@babel/core@7.24.5):
+ resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ peerDependencies:
+ '@babel/core': ^7.0.0
+ dependencies:
+ '@babel/core': 7.24.5
+ babel-plugin-jest-hoist: 29.6.3
+ babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.5)
+ dev: false
+
+ /balanced-match@1.0.2:
+ resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
+ dev: false
+
+ /brace-expansion@1.1.11:
+ resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}
+ dependencies:
+ balanced-match: 1.0.2
+ concat-map: 0.0.1
+ dev: false
+
+ /braces@3.0.2:
+ resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==}
+ engines: {node: '>=8'}
+ dependencies:
+ fill-range: 7.0.1
+
+ /browserslist@4.23.0:
+ resolution: {integrity: sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==}
+ engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
+ hasBin: true
+ dependencies:
+ caniuse-lite: 1.0.30001615
+ electron-to-chromium: 1.4.754
+ node-releases: 2.0.14
+ update-browserslist-db: 1.0.14(browserslist@4.23.0)
+ dev: false
+
+ /bs-logger@0.2.6:
+ resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==}
+ engines: {node: '>= 6'}
+ dependencies:
+ fast-json-stable-stringify: 2.1.0
+ dev: false
+
+ /bser@2.1.1:
+ resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==}
+ dependencies:
+ node-int64: 0.4.0
+ dev: false
+
+ /buffer-from@1.1.2:
+ resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
+ dev: false
+
+ /call-bind@1.0.7:
+ resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ es-define-property: 1.0.0
+ es-errors: 1.3.0
+ function-bind: 1.1.2
+ get-intrinsic: 1.2.4
+ set-function-length: 1.2.2
+ dev: false
+
+ /callsites@3.1.0:
+ resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
+ engines: {node: '>=6'}
+ dev: false
+
+ /camelcase@5.3.1:
+ resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==}
+ engines: {node: '>=6'}
+ dev: false
+
+ /camelcase@6.3.0:
+ resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==}
+ engines: {node: '>=10'}
+ dev: false
+
+ /caniuse-lite@1.0.30001615:
+ resolution: {integrity: sha512-1IpazM5G3r38meiae0bHRnPhz+CBQ3ZLqbQMtrg+AsTPKAXgW38JNsXkyZ+v8waCsDmPq87lmfun5Q2AGysNEQ==}
+ dev: false
+
+ /chalk@2.4.2:
+ resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==}
+ engines: {node: '>=4'}
+ dependencies:
+ ansi-styles: 3.2.1
+ escape-string-regexp: 1.0.5
+ supports-color: 5.5.0
+
+ /chalk@4.1.2:
+ resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
+ engines: {node: '>=10'}
+ dependencies:
+ ansi-styles: 4.3.0
+ supports-color: 7.2.0
+
+ /char-regex@1.0.2:
+ resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==}
+ engines: {node: '>=10'}
+ dev: false
+
+ /ci-info@3.9.0:
+ resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==}
+ engines: {node: '>=8'}
+
+ /cjs-module-lexer@1.3.1:
+ resolution: {integrity: sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q==}
+ dev: false
+
+ /cliui@8.0.1:
+ resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
+ engines: {node: '>=12'}
+ dependencies:
+ string-width: 4.2.3
+ strip-ansi: 6.0.1
+ wrap-ansi: 7.0.0
+ dev: false
+
+ /co@4.6.0:
+ resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==}
+ engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'}
+ dev: false
+
+ /collect-v8-coverage@1.0.2:
+ resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==}
+ dev: false
+
+ /color-convert@1.9.3:
+ resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==}
+ dependencies:
+ color-name: 1.1.3
+
+ /color-convert@2.0.1:
+ resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
+ engines: {node: '>=7.0.0'}
+ dependencies:
+ color-name: 1.1.4
+
+ /color-name@1.1.3:
+ resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==}
+
+ /color-name@1.1.4:
+ resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
+
+ /combined-stream@1.0.8:
+ resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
+ engines: {node: '>= 0.8'}
+ dependencies:
+ delayed-stream: 1.0.0
+ dev: false
+
+ /component-emitter@1.3.1:
+ resolution: {integrity: sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==}
+ dev: false
+
+ /concat-map@0.0.1:
+ resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
+ dev: false
+
+ /convert-source-map@2.0.0:
+ resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}
+ dev: false
+
+ /cookiejar@2.1.4:
+ resolution: {integrity: sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==}
+ dev: false
+
+ /create-jest@29.7.0:
+ resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ hasBin: true
+ dependencies:
+ '@jest/types': 29.6.3
+ chalk: 4.1.2
+ exit: 0.1.2
+ graceful-fs: 4.2.11
+ jest-config: 29.7.0(@types/node@18.19.31)
+ jest-util: 29.7.0
+ prompts: 2.4.2
+ transitivePeerDependencies:
+ - '@types/node'
+ - babel-plugin-macros
+ - supports-color
+ - ts-node
+ dev: false
+
+ /cross-spawn@7.0.3:
+ resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==}
+ engines: {node: '>= 8'}
+ dependencies:
+ path-key: 3.1.1
+ shebang-command: 2.0.0
+ which: 2.0.2
+ dev: false
+
+ /debug@4.3.4:
+ resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
+ engines: {node: '>=6.0'}
+ peerDependencies:
+ supports-color: '*'
+ peerDependenciesMeta:
+ supports-color:
+ optional: true
+ dependencies:
+ ms: 2.1.2
+ dev: false
+
+ /dedent@1.5.3:
+ resolution: {integrity: sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ==}
+ peerDependencies:
+ babel-plugin-macros: ^3.1.0
+ peerDependenciesMeta:
+ babel-plugin-macros:
+ optional: true
+ dev: false
+
+ /deepmerge@4.3.1:
+ resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==}
+ engines: {node: '>=0.10.0'}
+ dev: false
+
+ /define-data-property@1.1.4:
+ resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ es-define-property: 1.0.0
+ es-errors: 1.3.0
+ gopd: 1.0.1
+ dev: false
+
+ /delayed-stream@1.0.0:
+ resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
+ engines: {node: '>=0.4.0'}
+ dev: false
+
+ /detect-newline@3.1.0:
+ resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==}
+ engines: {node: '>=8'}
+ dev: false
+
+ /dezalgo@1.0.4:
+ resolution: {integrity: sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==}
+ dependencies:
+ asap: 2.0.6
+ wrappy: 1.0.2
+ dev: false
+
+ /diff-sequences@29.6.3:
+ resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+
+ /dotenv@16.4.5:
+ resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==}
+ engines: {node: '>=12'}
+ dev: false
+
+ /electron-to-chromium@1.4.754:
+ resolution: {integrity: sha512-7Kr5jUdns5rL/M9wFFmMZAgFDuL2YOnanFH4OI4iFzUqyh3XOL7nAGbSlSMZdzKMIyyTpNSbqZsWG9odwLeKvA==}
+ dev: false
+
+ /emittery@0.13.1:
+ resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==}
+ engines: {node: '>=12'}
+ dev: false
+
+ /emoji-regex@8.0.0:
+ resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
+ dev: false
+
+ /error-ex@1.3.2:
+ resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==}
+ dependencies:
+ is-arrayish: 0.2.1
+ dev: false
+
+ /es-define-property@1.0.0:
+ resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ get-intrinsic: 1.2.4
+ dev: false
+
+ /es-errors@1.3.0:
+ resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==}
+ engines: {node: '>= 0.4'}
+ dev: false
+
+ /escalade@3.1.2:
+ resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==}
+ engines: {node: '>=6'}
+ dev: false
+
+ /escape-string-regexp@1.0.5:
+ resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==}
+ engines: {node: '>=0.8.0'}
+
+ /escape-string-regexp@2.0.0:
+ resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==}
+ engines: {node: '>=8'}
+
+ /esprima@4.0.1:
+ resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}
+ engines: {node: '>=4'}
+ hasBin: true
+ dev: false
+
+ /event-target-shim@5.0.1:
+ resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==}
+ engines: {node: '>=6'}
+ dev: false
+
+ /execa@5.1.1:
+ resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==}
+ engines: {node: '>=10'}
+ dependencies:
+ cross-spawn: 7.0.3
+ get-stream: 6.0.1
+ human-signals: 2.1.0
+ is-stream: 2.0.1
+ merge-stream: 2.0.0
+ npm-run-path: 4.0.1
+ onetime: 5.1.2
+ signal-exit: 3.0.7
+ strip-final-newline: 2.0.0
+ dev: false
+
+ /exit@0.1.2:
+ resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==}
+ engines: {node: '>= 0.8.0'}
+ dev: false
+
+ /expect@29.7.0:
+ resolution: {integrity: sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/expect-utils': 29.7.0
+ jest-get-type: 29.6.3
+ jest-matcher-utils: 29.7.0
+ jest-message-util: 29.7.0
+ jest-util: 29.7.0
+
+ /fast-json-stable-stringify@2.1.0:
+ resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
+ dev: false
+
+ /fast-safe-stringify@2.1.1:
+ resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==}
+ dev: false
+
+ /fb-watchman@2.0.2:
+ resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==}
+ dependencies:
+ bser: 2.1.1
+ dev: false
+
+ /fill-range@7.0.1:
+ resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}
+ engines: {node: '>=8'}
+ dependencies:
+ to-regex-range: 5.0.1
+
+ /find-up@4.1.0:
+ resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==}
+ engines: {node: '>=8'}
+ dependencies:
+ locate-path: 5.0.0
+ path-exists: 4.0.0
+ dev: false
+
+ /form-data-encoder@1.7.2:
+ resolution: {integrity: sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==}
+ dev: false
+
+ /form-data@4.0.0:
+ resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==}
+ engines: {node: '>= 6'}
+ dependencies:
+ asynckit: 0.4.0
+ combined-stream: 1.0.8
+ mime-types: 2.1.35
+ dev: false
+
+ /formdata-node@4.4.1:
+ resolution: {integrity: sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==}
+ engines: {node: '>= 12.20'}
+ dependencies:
+ node-domexception: 1.0.0
+ web-streams-polyfill: 4.0.0-beta.3
+ dev: false
+
+ /formidable@3.5.1:
+ resolution: {integrity: sha512-WJWKelbRHN41m5dumb0/k8TeAx7Id/y3a+Z7QfhxP/htI9Js5zYaEDtG8uMgG0vM0lOlqnmjE99/kfpOYi/0Og==}
+ dependencies:
+ dezalgo: 1.0.4
+ hexoid: 1.0.0
+ once: 1.4.0
+ dev: false
+
+ /fs.realpath@1.0.0:
+ resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
+ dev: false
+
+ /fsevents@2.3.2:
+ resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
+ engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
+ os: [darwin]
+ requiresBuild: true
+ dev: false
+ optional: true
+
+ /function-bind@1.1.2:
+ resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}
+ dev: false
+
+ /gensync@1.0.0-beta.2:
+ resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}
+ engines: {node: '>=6.9.0'}
+ dev: false
+
+ /get-caller-file@2.0.5:
+ resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
+ engines: {node: 6.* || 8.* || >= 10.*}
+ dev: false
+
+ /get-intrinsic@1.2.4:
+ resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ es-errors: 1.3.0
+ function-bind: 1.1.2
+ has-proto: 1.0.3
+ has-symbols: 1.0.3
+ hasown: 2.0.2
+ dev: false
+
+ /get-package-type@0.1.0:
+ resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==}
+ engines: {node: '>=8.0.0'}
+ dev: false
+
+ /get-stream@6.0.1:
+ resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==}
+ engines: {node: '>=10'}
+ dev: false
+
+ /glob@7.2.3:
+ resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
+ dependencies:
+ fs.realpath: 1.0.0
+ inflight: 1.0.6
+ inherits: 2.0.4
+ minimatch: 3.1.2
+ once: 1.4.0
+ path-is-absolute: 1.0.1
+ dev: false
+
+ /globals@11.12.0:
+ resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==}
+ engines: {node: '>=4'}
+ dev: false
+
+ /gopd@1.0.1:
+ resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==}
+ dependencies:
+ get-intrinsic: 1.2.4
+ dev: false
+
+ /graceful-fs@4.2.11:
+ resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
+
+ /has-flag@3.0.0:
+ resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==}
+ engines: {node: '>=4'}
+
+ /has-flag@4.0.0:
+ resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
+ engines: {node: '>=8'}
+
+ /has-property-descriptors@1.0.2:
+ resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==}
+ dependencies:
+ es-define-property: 1.0.0
+ dev: false
+
+ /has-proto@1.0.3:
+ resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==}
+ engines: {node: '>= 0.4'}
+ dev: false
+
+ /has-symbols@1.0.3:
+ resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==}
+ engines: {node: '>= 0.4'}
+ dev: false
+
+ /hasown@2.0.2:
+ resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ function-bind: 1.1.2
+ dev: false
+
+ /hexoid@1.0.0:
+ resolution: {integrity: sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==}
+ engines: {node: '>=8'}
+ dev: false
+
+ /html-escaper@2.0.2:
+ resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==}
+ dev: false
+
+ /human-signals@2.1.0:
+ resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==}
+ engines: {node: '>=10.17.0'}
+ dev: false
+
+ /humanize-ms@1.2.1:
+ resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==}
+ dependencies:
+ ms: 2.1.2
+ dev: false
+
+ /import-local@3.1.0:
+ resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==}
+ engines: {node: '>=8'}
+ hasBin: true
+ dependencies:
+ pkg-dir: 4.2.0
+ resolve-cwd: 3.0.0
+ dev: false
+
+ /imurmurhash@0.1.4:
+ resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==}
+ engines: {node: '>=0.8.19'}
+ dev: false
+
+ /inflight@1.0.6:
+ resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
+ dependencies:
+ once: 1.4.0
+ wrappy: 1.0.2
+ dev: false
+
+ /inherits@2.0.4:
+ resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
+ dev: false
+
+ /is-arrayish@0.2.1:
+ resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==}
+ dev: false
+
+ /is-core-module@2.13.1:
+ resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==}
+ dependencies:
+ hasown: 2.0.2
+ dev: false
+
+ /is-fullwidth-code-point@3.0.0:
+ resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
+ engines: {node: '>=8'}
+ dev: false
+
+ /is-generator-fn@2.1.0:
+ resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==}
+ engines: {node: '>=6'}
+ dev: false
+
+ /is-number@7.0.0:
+ resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
+ engines: {node: '>=0.12.0'}
+
+ /is-stream@2.0.1:
+ resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==}
+ engines: {node: '>=8'}
+ dev: false
+
+ /isexe@2.0.0:
+ resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
+ dev: false
+
+ /istanbul-lib-coverage@3.2.2:
+ resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==}
+ engines: {node: '>=8'}
+ dev: false
+
+ /istanbul-lib-instrument@5.2.1:
+ resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==}
+ engines: {node: '>=8'}
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/parser': 7.24.5
+ '@istanbuljs/schema': 0.1.3
+ istanbul-lib-coverage: 3.2.2
+ semver: 6.3.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /istanbul-lib-instrument@6.0.2:
+ resolution: {integrity: sha512-1WUsZ9R1lA0HtBSohTkm39WTPlNKSJ5iFk7UwqXkBLoHQT+hfqPsfsTDVuZdKGaBwn7din9bS7SsnoAr943hvw==}
+ engines: {node: '>=10'}
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/parser': 7.24.5
+ '@istanbuljs/schema': 0.1.3
+ istanbul-lib-coverage: 3.2.2
+ semver: 7.6.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /istanbul-lib-report@3.0.1:
+ resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==}
+ engines: {node: '>=10'}
+ dependencies:
+ istanbul-lib-coverage: 3.2.2
+ make-dir: 4.0.0
+ supports-color: 7.2.0
+ dev: false
+
+ /istanbul-lib-source-maps@4.0.1:
+ resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==}
+ engines: {node: '>=10'}
+ dependencies:
+ debug: 4.3.4
+ istanbul-lib-coverage: 3.2.2
+ source-map: 0.6.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /istanbul-reports@3.1.7:
+ resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==}
+ engines: {node: '>=8'}
+ dependencies:
+ html-escaper: 2.0.2
+ istanbul-lib-report: 3.0.1
+ dev: false
+
+ /jest-changed-files@29.7.0:
+ resolution: {integrity: sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ execa: 5.1.1
+ jest-util: 29.7.0
+ p-limit: 3.1.0
+ dev: false
+
+ /jest-circus@29.7.0:
+ resolution: {integrity: sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/environment': 29.7.0
+ '@jest/expect': 29.7.0
+ '@jest/test-result': 29.7.0
+ '@jest/types': 29.6.3
+ '@types/node': 18.19.31
+ chalk: 4.1.2
+ co: 4.6.0
+ dedent: 1.5.3
+ is-generator-fn: 2.1.0
+ jest-each: 29.7.0
+ jest-matcher-utils: 29.7.0
+ jest-message-util: 29.7.0
+ jest-runtime: 29.7.0
+ jest-snapshot: 29.7.0
+ jest-util: 29.7.0
+ p-limit: 3.1.0
+ pretty-format: 29.7.0
+ pure-rand: 6.1.0
+ slash: 3.0.0
+ stack-utils: 2.0.6
+ transitivePeerDependencies:
+ - babel-plugin-macros
+ - supports-color
+ dev: false
+
+ /jest-cli@29.7.0:
+ resolution: {integrity: sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ hasBin: true
+ peerDependencies:
+ node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
+ peerDependenciesMeta:
+ node-notifier:
+ optional: true
+ dependencies:
+ '@jest/core': 29.7.0
+ '@jest/test-result': 29.7.0
+ '@jest/types': 29.6.3
+ chalk: 4.1.2
+ create-jest: 29.7.0
+ exit: 0.1.2
+ import-local: 3.1.0
+ jest-config: 29.7.0(@types/node@18.19.31)
+ jest-util: 29.7.0
+ jest-validate: 29.7.0
+ yargs: 17.7.2
+ transitivePeerDependencies:
+ - '@types/node'
+ - babel-plugin-macros
+ - supports-color
+ - ts-node
+ dev: false
+
+ /jest-config@29.7.0(@types/node@18.19.31):
+ resolution: {integrity: sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ peerDependencies:
+ '@types/node': '*'
+ ts-node: '>=9.0.0'
+ peerDependenciesMeta:
+ '@types/node':
+ optional: true
+ ts-node:
+ optional: true
+ dependencies:
+ '@babel/core': 7.24.5
+ '@jest/test-sequencer': 29.7.0
+ '@jest/types': 29.6.3
+ '@types/node': 18.19.31
+ babel-jest: 29.7.0(@babel/core@7.24.5)
+ chalk: 4.1.2
+ ci-info: 3.9.0
+ deepmerge: 4.3.1
+ glob: 7.2.3
+ graceful-fs: 4.2.11
+ jest-circus: 29.7.0
+ jest-environment-node: 29.7.0
+ jest-get-type: 29.6.3
+ jest-regex-util: 29.6.3
+ jest-resolve: 29.7.0
+ jest-runner: 29.7.0
+ jest-util: 29.7.0
+ jest-validate: 29.7.0
+ micromatch: 4.0.5
+ parse-json: 5.2.0
+ pretty-format: 29.7.0
+ slash: 3.0.0
+ strip-json-comments: 3.1.1
+ transitivePeerDependencies:
+ - babel-plugin-macros
+ - supports-color
+ dev: false
+
+ /jest-diff@29.7.0:
+ resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ chalk: 4.1.2
+ diff-sequences: 29.6.3
+ jest-get-type: 29.6.3
+ pretty-format: 29.7.0
+
+ /jest-docblock@29.7.0:
+ resolution: {integrity: sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ detect-newline: 3.1.0
+ dev: false
+
+ /jest-each@29.7.0:
+ resolution: {integrity: sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/types': 29.6.3
+ chalk: 4.1.2
+ jest-get-type: 29.6.3
+ jest-util: 29.7.0
+ pretty-format: 29.7.0
+ dev: false
+
+ /jest-environment-node@29.7.0:
+ resolution: {integrity: sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/environment': 29.7.0
+ '@jest/fake-timers': 29.7.0
+ '@jest/types': 29.6.3
+ '@types/node': 18.19.31
+ jest-mock: 29.7.0
+ jest-util: 29.7.0
+ dev: false
+
+ /jest-get-type@29.6.3:
+ resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+
+ /jest-haste-map@29.7.0:
+ resolution: {integrity: sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/types': 29.6.3
+ '@types/graceful-fs': 4.1.9
+ '@types/node': 18.19.31
+ anymatch: 3.1.3
+ fb-watchman: 2.0.2
+ graceful-fs: 4.2.11
+ jest-regex-util: 29.6.3
+ jest-util: 29.7.0
+ jest-worker: 29.7.0
+ micromatch: 4.0.5
+ walker: 1.0.8
+ optionalDependencies:
+ fsevents: 2.3.2
+ dev: false
+
+ /jest-leak-detector@29.7.0:
+ resolution: {integrity: sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ jest-get-type: 29.6.3
+ pretty-format: 29.7.0
+ dev: false
+
+ /jest-matcher-utils@29.7.0:
+ resolution: {integrity: sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ chalk: 4.1.2
+ jest-diff: 29.7.0
+ jest-get-type: 29.6.3
+ pretty-format: 29.7.0
+
+ /jest-message-util@29.7.0:
+ resolution: {integrity: sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@babel/code-frame': 7.24.2
+ '@jest/types': 29.6.3
+ '@types/stack-utils': 2.0.3
+ chalk: 4.1.2
+ graceful-fs: 4.2.11
+ micromatch: 4.0.5
+ pretty-format: 29.7.0
+ slash: 3.0.0
+ stack-utils: 2.0.6
+
+ /jest-mock@29.7.0:
+ resolution: {integrity: sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/types': 29.6.3
+ '@types/node': 18.19.31
+ jest-util: 29.7.0
+ dev: false
+
+ /jest-pnp-resolver@1.2.3(jest-resolve@29.7.0):
+ resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==}
+ engines: {node: '>=6'}
+ peerDependencies:
+ jest-resolve: '*'
+ peerDependenciesMeta:
+ jest-resolve:
+ optional: true
+ dependencies:
+ jest-resolve: 29.7.0
+ dev: false
+
+ /jest-regex-util@29.6.3:
+ resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dev: false
+
+ /jest-resolve-dependencies@29.7.0:
+ resolution: {integrity: sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ jest-regex-util: 29.6.3
+ jest-snapshot: 29.7.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /jest-resolve@29.7.0:
+ resolution: {integrity: sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ chalk: 4.1.2
+ graceful-fs: 4.2.11
+ jest-haste-map: 29.7.0
+ jest-pnp-resolver: 1.2.3(jest-resolve@29.7.0)
+ jest-util: 29.7.0
+ jest-validate: 29.7.0
+ resolve: 1.22.8
+ resolve.exports: 2.0.2
+ slash: 3.0.0
+ dev: false
+
+ /jest-runner@29.7.0:
+ resolution: {integrity: sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/console': 29.7.0
+ '@jest/environment': 29.7.0
+ '@jest/test-result': 29.7.0
+ '@jest/transform': 29.7.0
+ '@jest/types': 29.6.3
+ '@types/node': 18.19.31
+ chalk: 4.1.2
+ emittery: 0.13.1
+ graceful-fs: 4.2.11
+ jest-docblock: 29.7.0
+ jest-environment-node: 29.7.0
+ jest-haste-map: 29.7.0
+ jest-leak-detector: 29.7.0
+ jest-message-util: 29.7.0
+ jest-resolve: 29.7.0
+ jest-runtime: 29.7.0
+ jest-util: 29.7.0
+ jest-watcher: 29.7.0
+ jest-worker: 29.7.0
+ p-limit: 3.1.0
+ source-map-support: 0.5.13
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /jest-runtime@29.7.0:
+ resolution: {integrity: sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/environment': 29.7.0
+ '@jest/fake-timers': 29.7.0
+ '@jest/globals': 29.7.0
+ '@jest/source-map': 29.6.3
+ '@jest/test-result': 29.7.0
+ '@jest/transform': 29.7.0
+ '@jest/types': 29.6.3
+ '@types/node': 18.19.31
+ chalk: 4.1.2
+ cjs-module-lexer: 1.3.1
+ collect-v8-coverage: 1.0.2
+ glob: 7.2.3
+ graceful-fs: 4.2.11
+ jest-haste-map: 29.7.0
+ jest-message-util: 29.7.0
+ jest-mock: 29.7.0
+ jest-regex-util: 29.6.3
+ jest-resolve: 29.7.0
+ jest-snapshot: 29.7.0
+ jest-util: 29.7.0
+ slash: 3.0.0
+ strip-bom: 4.0.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /jest-snapshot@29.7.0:
+ resolution: {integrity: sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@babel/core': 7.24.5
+ '@babel/generator': 7.24.5
+ '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.5)
+ '@babel/plugin-syntax-typescript': 7.24.1(@babel/core@7.24.5)
+ '@babel/types': 7.24.5
+ '@jest/expect-utils': 29.7.0
+ '@jest/transform': 29.7.0
+ '@jest/types': 29.6.3
+ babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.5)
+ chalk: 4.1.2
+ expect: 29.7.0
+ graceful-fs: 4.2.11
+ jest-diff: 29.7.0
+ jest-get-type: 29.6.3
+ jest-matcher-utils: 29.7.0
+ jest-message-util: 29.7.0
+ jest-util: 29.7.0
+ natural-compare: 1.4.0
+ pretty-format: 29.7.0
+ semver: 7.6.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /jest-util@29.7.0:
+ resolution: {integrity: sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/types': 29.6.3
+ '@types/node': 18.19.31
+ chalk: 4.1.2
+ ci-info: 3.9.0
+ graceful-fs: 4.2.11
+ picomatch: 2.3.1
+
+ /jest-validate@29.7.0:
+ resolution: {integrity: sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/types': 29.6.3
+ camelcase: 6.3.0
+ chalk: 4.1.2
+ jest-get-type: 29.6.3
+ leven: 3.1.0
+ pretty-format: 29.7.0
+ dev: false
+
+ /jest-watcher@29.7.0:
+ resolution: {integrity: sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/test-result': 29.7.0
+ '@jest/types': 29.6.3
+ '@types/node': 18.19.31
+ ansi-escapes: 4.3.2
+ chalk: 4.1.2
+ emittery: 0.13.1
+ jest-util: 29.7.0
+ string-length: 4.0.2
+ dev: false
+
+ /jest-worker@29.7.0:
+ resolution: {integrity: sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@types/node': 18.19.31
+ jest-util: 29.7.0
+ merge-stream: 2.0.0
+ supports-color: 8.1.1
+ dev: false
+
+ /jest@29.7.0:
+ resolution: {integrity: sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ hasBin: true
+ peerDependencies:
+ node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0
+ peerDependenciesMeta:
+ node-notifier:
+ optional: true
+ dependencies:
+ '@jest/core': 29.7.0
+ '@jest/types': 29.6.3
+ import-local: 3.1.0
+ jest-cli: 29.7.0
+ transitivePeerDependencies:
+ - '@types/node'
+ - babel-plugin-macros
+ - supports-color
+ - ts-node
+ dev: false
+
+ /js-tokens@4.0.0:
+ resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
+
+ /js-yaml@3.14.1:
+ resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==}
+ hasBin: true
+ dependencies:
+ argparse: 1.0.10
+ esprima: 4.0.1
+ dev: false
+
+ /jsesc@2.5.2:
+ resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==}
+ engines: {node: '>=4'}
+ hasBin: true
+ dev: false
+
+ /json-parse-even-better-errors@2.3.1:
+ resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}
+ dev: false
+
+ /json5@2.2.3:
+ resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==}
+ engines: {node: '>=6'}
+ hasBin: true
+ dev: false
+
+ /kleur@3.0.3:
+ resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==}
+ engines: {node: '>=6'}
+ dev: false
+
+ /leven@3.1.0:
+ resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==}
+ engines: {node: '>=6'}
+ dev: false
+
+ /lines-and-columns@1.2.4:
+ resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}
+ dev: false
+
+ /locate-path@5.0.0:
+ resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==}
+ engines: {node: '>=8'}
+ dependencies:
+ p-locate: 4.1.0
+ dev: false
+
+ /lodash.memoize@4.1.2:
+ resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==}
+ dev: false
+
+ /lru-cache@5.1.1:
+ resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}
+ dependencies:
+ yallist: 3.1.1
+ dev: false
+
+ /lru-cache@6.0.0:
+ resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
+ engines: {node: '>=10'}
+ dependencies:
+ yallist: 4.0.0
+ dev: false
+
+ /make-dir@4.0.0:
+ resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==}
+ engines: {node: '>=10'}
+ dependencies:
+ semver: 7.6.0
+ dev: false
+
+ /make-error@1.3.6:
+ resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==}
+ dev: false
+
+ /makeerror@1.0.12:
+ resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==}
+ dependencies:
+ tmpl: 1.0.5
+ dev: false
+
+ /merge-stream@2.0.0:
+ resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==}
+ dev: false
+
+ /methods@1.1.2:
+ resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==}
+ engines: {node: '>= 0.6'}
+ dev: false
+
+ /micromatch@4.0.5:
+ resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==}
+ engines: {node: '>=8.6'}
+ dependencies:
+ braces: 3.0.2
+ picomatch: 2.3.1
+
+ /mime-db@1.52.0:
+ resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
+ engines: {node: '>= 0.6'}
+ dev: false
+
+ /mime-types@2.1.35:
+ resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
+ engines: {node: '>= 0.6'}
+ dependencies:
+ mime-db: 1.52.0
+ dev: false
+
+ /mime@2.6.0:
+ resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==}
+ engines: {node: '>=4.0.0'}
+ hasBin: true
+ dev: false
+
+ /mimic-fn@2.1.0:
+ resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==}
+ engines: {node: '>=6'}
+ dev: false
+
+ /minimatch@3.1.2:
+ resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
+ dependencies:
+ brace-expansion: 1.1.11
+ dev: false
+
+ /ms@2.1.2:
+ resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
+ dev: false
+
+ /natural-compare@1.4.0:
+ resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
+ dev: false
+
+ /node-domexception@1.0.0:
+ resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==}
+ engines: {node: '>=10.5.0'}
+ dev: false
+
+ /node-fetch@2.7.0:
+ resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
+ engines: {node: 4.x || >=6.0.0}
+ peerDependencies:
+ encoding: ^0.1.0
+ peerDependenciesMeta:
+ encoding:
+ optional: true
+ dependencies:
+ whatwg-url: 5.0.0
+ dev: false
+
+ /node-int64@0.4.0:
+ resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==}
+ dev: false
+
+ /node-releases@2.0.14:
+ resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==}
+ dev: false
+
+ /normalize-path@3.0.0:
+ resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}
+ engines: {node: '>=0.10.0'}
+ dev: false
+
+ /npm-run-path@4.0.1:
+ resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==}
+ engines: {node: '>=8'}
+ dependencies:
+ path-key: 3.1.1
+ dev: false
+
+ /object-inspect@1.13.1:
+ resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==}
+ dev: false
+
+ /once@1.4.0:
+ resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
+ dependencies:
+ wrappy: 1.0.2
+ dev: false
+
+ /onetime@5.1.2:
+ resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==}
+ engines: {node: '>=6'}
+ dependencies:
+ mimic-fn: 2.1.0
+ dev: false
+
+ /openai@4.40.2:
+ resolution: {integrity: sha512-r9AIaYQNHw8HGJpnny6Rcu/0moGUVqvpv0wTJfP0hKlk8ja5DVUMUCdPWEVfg7lxQMC+wIh+Qjp3onDIhVBemA==}
+ hasBin: true
+ dependencies:
+ '@types/node': 18.19.31
+ '@types/node-fetch': 2.6.11
+ abort-controller: 3.0.0
+ agentkeepalive: 4.5.0
+ form-data-encoder: 1.7.2
+ formdata-node: 4.4.1
+ node-fetch: 2.7.0
+ web-streams-polyfill: 3.3.3
+ transitivePeerDependencies:
+ - encoding
+ dev: false
+
+ /p-limit@2.3.0:
+ resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}
+ engines: {node: '>=6'}
+ dependencies:
+ p-try: 2.2.0
+ dev: false
+
+ /p-limit@3.1.0:
+ resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==}
+ engines: {node: '>=10'}
+ dependencies:
+ yocto-queue: 0.1.0
+ dev: false
+
+ /p-locate@4.1.0:
+ resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==}
+ engines: {node: '>=8'}
+ dependencies:
+ p-limit: 2.3.0
+ dev: false
+
+ /p-try@2.2.0:
+ resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==}
+ engines: {node: '>=6'}
+ dev: false
+
+ /parse-json@5.2.0:
+ resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==}
+ engines: {node: '>=8'}
+ dependencies:
+ '@babel/code-frame': 7.24.2
+ error-ex: 1.3.2
+ json-parse-even-better-errors: 2.3.1
+ lines-and-columns: 1.2.4
+ dev: false
+
+ /path-exists@4.0.0:
+ resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
+ engines: {node: '>=8'}
+ dev: false
+
+ /path-is-absolute@1.0.1:
+ resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
+ engines: {node: '>=0.10.0'}
+ dev: false
+
+ /path-key@3.1.1:
+ resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
+ engines: {node: '>=8'}
+ dev: false
+
+ /path-parse@1.0.7:
+ resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
+ dev: false
+
+ /picocolors@1.0.0:
+ resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
+
+ /picomatch@2.3.1:
+ resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
+ engines: {node: '>=8.6'}
+
+ /pirates@4.0.6:
+ resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==}
+ engines: {node: '>= 6'}
+ dev: false
+
+ /pkg-dir@4.2.0:
+ resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==}
+ engines: {node: '>=8'}
+ dependencies:
+ find-up: 4.1.0
+ dev: false
+
+ /playwright-core@1.43.1:
+ resolution: {integrity: sha512-EI36Mto2Vrx6VF7rm708qSnesVQKbxEWvPrfA1IPY6HgczBplDx7ENtx+K2n4kJ41sLLkuGfmb0ZLSSXlDhqPg==}
+ engines: {node: '>=16'}
+ hasBin: true
+ dev: false
+
+ /playwright@1.43.1:
+ resolution: {integrity: sha512-V7SoH0ai2kNt1Md9E3Gwas5B9m8KR2GVvwZnAI6Pg0m3sh7UvgiYhRrhsziCmqMJNouPckiOhk8T+9bSAK0VIA==}
+ engines: {node: '>=16'}
+ hasBin: true
+ dependencies:
+ playwright-core: 1.43.1
+ optionalDependencies:
+ fsevents: 2.3.2
+ dev: false
+
+ /pretty-format@29.7.0:
+ resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==}
+ engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
+ dependencies:
+ '@jest/schemas': 29.6.3
+ ansi-styles: 5.2.0
+ react-is: 18.3.1
+
+ /prompts@2.4.2:
+ resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==}
+ engines: {node: '>= 6'}
+ dependencies:
+ kleur: 3.0.3
+ sisteransi: 1.0.5
+ dev: false
+
+ /pure-rand@6.1.0:
+ resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==}
+ dev: false
+
+ /qs@6.12.1:
+ resolution: {integrity: sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ==}
+ engines: {node: '>=0.6'}
+ dependencies:
+ side-channel: 1.0.6
+ dev: false
+
+ /react-is@18.3.1:
+ resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==}
+
+ /require-directory@2.1.1:
+ resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
+ engines: {node: '>=0.10.0'}
+ dev: false
+
+ /resolve-cwd@3.0.0:
+ resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==}
+ engines: {node: '>=8'}
+ dependencies:
+ resolve-from: 5.0.0
+ dev: false
+
+ /resolve-from@5.0.0:
+ resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==}
+ engines: {node: '>=8'}
+ dev: false
+
+ /resolve.exports@2.0.2:
+ resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==}
+ engines: {node: '>=10'}
+ dev: false
+
+ /resolve@1.22.8:
+ resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==}
+ hasBin: true
+ dependencies:
+ is-core-module: 2.13.1
+ path-parse: 1.0.7
+ supports-preserve-symlinks-flag: 1.0.0
+ dev: false
+
+ /semver@6.3.1:
+ resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==}
+ hasBin: true
+ dev: false
+
+ /semver@7.6.0:
+ resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==}
+ engines: {node: '>=10'}
+ hasBin: true
+ dependencies:
+ lru-cache: 6.0.0
+ dev: false
+
+ /set-function-length@1.2.2:
+ resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ define-data-property: 1.1.4
+ es-errors: 1.3.0
+ function-bind: 1.1.2
+ get-intrinsic: 1.2.4
+ gopd: 1.0.1
+ has-property-descriptors: 1.0.2
+ dev: false
+
+ /shebang-command@2.0.0:
+ resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
+ engines: {node: '>=8'}
+ dependencies:
+ shebang-regex: 3.0.0
+ dev: false
+
+ /shebang-regex@3.0.0:
+ resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
+ engines: {node: '>=8'}
+ dev: false
+
+ /side-channel@1.0.6:
+ resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==}
+ engines: {node: '>= 0.4'}
+ dependencies:
+ call-bind: 1.0.7
+ es-errors: 1.3.0
+ get-intrinsic: 1.2.4
+ object-inspect: 1.13.1
+ dev: false
+
+ /signal-exit@3.0.7:
+ resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
+ dev: false
+
+ /sisteransi@1.0.5:
+ resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==}
+ dev: false
+
+ /slash@3.0.0:
+ resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
+ engines: {node: '>=8'}
+
+ /source-map-support@0.5.13:
+ resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==}
+ dependencies:
+ buffer-from: 1.1.2
+ source-map: 0.6.1
+ dev: false
+
+ /source-map@0.6.1:
+ resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
+ engines: {node: '>=0.10.0'}
+ dev: false
+
+ /sprintf-js@1.0.3:
+ resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==}
+ dev: false
+
+ /stack-utils@2.0.6:
+ resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==}
+ engines: {node: '>=10'}
+ dependencies:
+ escape-string-regexp: 2.0.0
+
+ /string-length@4.0.2:
+ resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==}
+ engines: {node: '>=10'}
+ dependencies:
+ char-regex: 1.0.2
+ strip-ansi: 6.0.1
+ dev: false
+
+ /string-width@4.2.3:
+ resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
+ engines: {node: '>=8'}
+ dependencies:
+ emoji-regex: 8.0.0
+ is-fullwidth-code-point: 3.0.0
+ strip-ansi: 6.0.1
+ dev: false
+
+ /strip-ansi@6.0.1:
+ resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
+ engines: {node: '>=8'}
+ dependencies:
+ ansi-regex: 5.0.1
+ dev: false
+
+ /strip-bom@4.0.0:
+ resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==}
+ engines: {node: '>=8'}
+ dev: false
+
+ /strip-final-newline@2.0.0:
+ resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==}
+ engines: {node: '>=6'}
+ dev: false
+
+ /strip-json-comments@3.1.1:
+ resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}
+ engines: {node: '>=8'}
+ dev: false
+
+ /superagent@9.0.2:
+ resolution: {integrity: sha512-xuW7dzkUpcJq7QnhOsnNUgtYp3xRwpt2F7abdRYIpCsAt0hhUqia0EdxyXZQQpNmGtsCzYHryaKSV3q3GJnq7w==}
+ engines: {node: '>=14.18.0'}
+ dependencies:
+ component-emitter: 1.3.1
+ cookiejar: 2.1.4
+ debug: 4.3.4
+ fast-safe-stringify: 2.1.1
+ form-data: 4.0.0
+ formidable: 3.5.1
+ methods: 1.1.2
+ mime: 2.6.0
+ qs: 6.12.1
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /supertest@7.0.0:
+ resolution: {integrity: sha512-qlsr7fIC0lSddmA3tzojvzubYxvlGtzumcdHgPwbFWMISQwL22MhM2Y3LNt+6w9Yyx7559VW5ab70dgphm8qQA==}
+ engines: {node: '>=14.18.0'}
+ dependencies:
+ methods: 1.1.2
+ superagent: 9.0.2
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /supports-color@5.5.0:
+ resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}
+ engines: {node: '>=4'}
+ dependencies:
+ has-flag: 3.0.0
+
+ /supports-color@7.2.0:
+ resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
+ engines: {node: '>=8'}
+ dependencies:
+ has-flag: 4.0.0
+
+ /supports-color@8.1.1:
+ resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==}
+ engines: {node: '>=10'}
+ dependencies:
+ has-flag: 4.0.0
+ dev: false
+
+ /supports-preserve-symlinks-flag@1.0.0:
+ resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
+ engines: {node: '>= 0.4'}
+ dev: false
+
+ /test-exclude@6.0.0:
+ resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==}
+ engines: {node: '>=8'}
+ dependencies:
+ '@istanbuljs/schema': 0.1.3
+ glob: 7.2.3
+ minimatch: 3.1.2
+ dev: false
+
+ /tmpl@1.0.5:
+ resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==}
+ dev: false
+
+ /to-fast-properties@2.0.0:
+ resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==}
+ engines: {node: '>=4'}
+ dev: false
+
+ /to-regex-range@5.0.1:
+ resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
+ engines: {node: '>=8.0'}
+ dependencies:
+ is-number: 7.0.0
+
+ /tr46@0.0.3:
+ resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
+ dev: false
+
+ /ts-jest@29.1.2(@babel/core@7.24.5)(jest@29.7.0)(typescript@5.4.5):
+ resolution: {integrity: sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==}
+ engines: {node: ^16.10.0 || ^18.0.0 || >=20.0.0}
+ hasBin: true
+ peerDependencies:
+ '@babel/core': '>=7.0.0-beta.0 <8'
+ '@jest/types': ^29.0.0
+ babel-jest: ^29.0.0
+ esbuild: '*'
+ jest: ^29.0.0
+ typescript: '>=4.3 <6'
+ peerDependenciesMeta:
+ '@babel/core':
+ optional: true
+ '@jest/types':
+ optional: true
+ babel-jest:
+ optional: true
+ esbuild:
+ optional: true
+ dependencies:
+ '@babel/core': 7.24.5
+ bs-logger: 0.2.6
+ fast-json-stable-stringify: 2.1.0
+ jest: 29.7.0
+ jest-util: 29.7.0
+ json5: 2.2.3
+ lodash.memoize: 4.1.2
+ make-error: 1.3.6
+ semver: 7.6.0
+ typescript: 5.4.5
+ yargs-parser: 21.1.1
+ dev: false
+
+ /type-detect@4.0.8:
+ resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==}
+ engines: {node: '>=4'}
+ dev: false
+
+ /type-fest@0.21.3:
+ resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==}
+ engines: {node: '>=10'}
+ dev: false
+
+ /typescript@5.4.5:
+ resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==}
+ engines: {node: '>=14.17'}
+ hasBin: true
+
+ /undici-types@5.26.5:
+ resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
+
+ /update-browserslist-db@1.0.14(browserslist@4.23.0):
+ resolution: {integrity: sha512-JixKH8GR2pWYshIPUg/NujK3JO7JiqEEUiNArE86NQyrgUuZeTlZQN3xuS/yiV5Kb48ev9K6RqNkaJjXsdg7Jw==}
+ hasBin: true
+ peerDependencies:
+ browserslist: '>= 4.21.0'
+ dependencies:
+ browserslist: 4.23.0
+ escalade: 3.1.2
+ picocolors: 1.0.0
+ dev: false
+
+ /v8-to-istanbul@9.2.0:
+ resolution: {integrity: sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==}
+ engines: {node: '>=10.12.0'}
+ dependencies:
+ '@jridgewell/trace-mapping': 0.3.25
+ '@types/istanbul-lib-coverage': 2.0.6
+ convert-source-map: 2.0.0
+ dev: false
+
+ /walker@1.0.8:
+ resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==}
+ dependencies:
+ makeerror: 1.0.12
+ dev: false
+
+ /web-streams-polyfill@3.3.3:
+ resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==}
+ engines: {node: '>= 8'}
+ dev: false
+
+ /web-streams-polyfill@4.0.0-beta.3:
+ resolution: {integrity: sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==}
+ engines: {node: '>= 14'}
+ dev: false
+
+ /webidl-conversions@3.0.1:
+ resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
+ dev: false
+
+ /whatwg-url@5.0.0:
+ resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
+ dependencies:
+ tr46: 0.0.3
+ webidl-conversions: 3.0.1
+ dev: false
+
+ /which@2.0.2:
+ resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
+ engines: {node: '>= 8'}
+ hasBin: true
+ dependencies:
+ isexe: 2.0.0
+ dev: false
+
+ /wrap-ansi@7.0.0:
+ resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
+ engines: {node: '>=10'}
+ dependencies:
+ ansi-styles: 4.3.0
+ string-width: 4.2.3
+ strip-ansi: 6.0.1
+ dev: false
+
+ /wrappy@1.0.2:
+ resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
+ dev: false
+
+ /write-file-atomic@4.0.2:
+ resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==}
+ engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
+ dependencies:
+ imurmurhash: 0.1.4
+ signal-exit: 3.0.7
+ dev: false
+
+ /ws@8.17.0:
+ resolution: {integrity: sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==}
+ engines: {node: '>=10.0.0'}
+ peerDependencies:
+ bufferutil: ^4.0.1
+ utf-8-validate: '>=5.0.2'
+ peerDependenciesMeta:
+ bufferutil:
+ optional: true
+ utf-8-validate:
+ optional: true
+ dev: false
+
+ /y18n@5.0.8:
+ resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
+ engines: {node: '>=10'}
+ dev: false
+
+ /yallist@3.1.1:
+ resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}
+ dev: false
+
+ /yallist@4.0.0:
+ resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
+ dev: false
+
+ /yargs-parser@21.1.1:
+ resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
+ engines: {node: '>=12'}
+ dev: false
+
+ /yargs@17.7.2:
+ resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
+ engines: {node: '>=12'}
+ dependencies:
+ cliui: 8.0.1
+ escalade: 3.1.2
+ get-caller-file: 2.0.5
+ require-directory: 2.1.1
+ string-width: 4.2.3
+ y18n: 5.0.8
+ yargs-parser: 21.1.1
+ dev: false
+
+ /yocto-queue@0.1.0:
+ resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
+ engines: {node: '>=10'}
+ dev: false
diff --git a/apps/test-suite/tsconfig.json b/apps/test-suite/tsconfig.json
new file mode 100644
index 0000000..e075f97
--- /dev/null
+++ b/apps/test-suite/tsconfig.json
@@ -0,0 +1,109 @@
+{
+ "compilerOptions": {
+ /* Visit https://aka.ms/tsconfig to read more about this file */
+
+ /* Projects */
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
+
+ /* Language and Environment */
+ "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
+ // "jsx": "preserve", /* Specify what JSX code is generated. */
+ // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
+
+ /* Modules */
+ "module": "commonjs", /* Specify what module code is generated. */
+ // "rootDir": "./", /* Specify the root folder within your source files. */
+ // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
+ // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
+ // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
+ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
+ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
+ // "resolveJsonModule": true, /* Enable importing .json files. */
+ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
+ // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */
+
+ /* JavaScript Support */
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
+
+ /* Emit */
+ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
+ // "outDir": "./", /* Specify an output folder for all emitted files. */
+ // "removeComments": true, /* Disable emitting comments. */
+ // "noEmit": true, /* Disable emitting files from a compilation. */
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
+ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
+ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
+
+ /* Interop Constraints */
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
+ // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
+
+ /* Type Checking */
+ "strict": true, /* Enable all strict type-checking options. */
+ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
+ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
+ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
+ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
+ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
+ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
+
+ /* Completeness */
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
+ }
+}
diff --git a/apps/test-suite/utils/log.ts b/apps/test-suite/utils/log.ts
new file mode 100644
index 0000000..b029bf7
--- /dev/null
+++ b/apps/test-suite/utils/log.ts
@@ -0,0 +1,10 @@
+import { supabase_service } from "./supabase";
+import { WebsiteScrapeError } from "./types";
+
+export async function logErrors(dataError: WebsiteScrapeError[], time_taken: number, num_tokens:number, score: number, num_pages_tested: number,) {
+ try {
+ await supabase_service.from("test_suite_logs").insert([{log:dataError, time_taken, num_tokens, score, num_pages_tested, is_error: dataError.length > 0}]);
+ } catch (error) {
+ console.error(`Error logging to supabase: ${error}`);
+ }
+}
diff --git a/apps/test-suite/utils/misc.ts b/apps/test-suite/utils/misc.ts
new file mode 100644
index 0000000..57e2cfd
--- /dev/null
+++ b/apps/test-suite/utils/misc.ts
@@ -0,0 +1,47 @@
+const getRandomLinksFromContent = async (options: {
+ content: string;
+ excludes: string[];
+ limit: number;
+ }): Promise => {
+ const regex = /(?<=\()https:\/\/(.*?)(?=\))/g;
+ const links = options.content.match(regex);
+ const filteredLinks = links
+ ? links.filter(
+ (link) => !options.excludes.some((exclude) => link.includes(exclude))
+ )
+ : [];
+ const uniqueLinks = [...new Set(filteredLinks)]; // Ensure all links are unique
+ const randomLinks = [];
+ while (randomLinks.length < options.limit && uniqueLinks.length > 0) {
+ const randomIndex = Math.floor(Math.random() * uniqueLinks.length);
+ randomLinks.push(uniqueLinks.splice(randomIndex, 1)[0]);
+ }
+ return randomLinks;
+ };
+
+ function fuzzyContains(options: {
+ largeText: string;
+ queryText: string;
+ threshold?: number;
+ }): boolean {
+ // Normalize texts: lowercasing and removing non-alphanumeric characters
+ const normalize = (text: string) =>
+ text.toLowerCase().replace(/[^a-z0-9]+/g, " ");
+
+ const normalizedLargeText = normalize(options.largeText);
+ const normalizedQueryText = normalize(options.queryText);
+
+ // Split the query into words
+ const queryWords = normalizedQueryText.split(/\s+/);
+
+ // Count how many query words are in the large text
+ const matchCount = queryWords.reduce((count, word) => {
+ return count + (normalizedLargeText.includes(word) ? 1 : 0);
+ }, 0);
+
+ // Calculate the percentage of words matched
+ const matchPercentage = matchCount / queryWords.length;
+
+ // Check if the match percentage meets or exceeds the threshold
+ return matchPercentage >= (options.threshold || 0.8);
+ }
\ No newline at end of file
diff --git a/apps/test-suite/utils/supabase.ts b/apps/test-suite/utils/supabase.ts
new file mode 100644
index 0000000..aa19a8c
--- /dev/null
+++ b/apps/test-suite/utils/supabase.ts
@@ -0,0 +1,56 @@
+import { createClient, SupabaseClient } from "@supabase/supabase-js";
+import "dotenv/config";
+// SupabaseService class initializes the Supabase client conditionally based on environment variables.
+class SupabaseService {
+ private client: SupabaseClient | null = null;
+
+ constructor() {
+ const supabaseUrl = process.env.SUPABASE_URL;
+ const supabaseServiceToken = process.env.SUPABASE_SERVICE_TOKEN;
+ // Only initialize the Supabase client if both URL and Service Token are provided.
+ if (process.env.USE_DB_AUTHENTICATION === "false") {
+ // Warn the user that Authentication is disabled by setting the client to null
+ console.warn(
+ "\x1b[33mAuthentication is disabled. Supabase client will not be initialized.\x1b[0m"
+ );
+ this.client = null;
+ } else if (!supabaseUrl || !supabaseServiceToken) {
+ console.error(
+ "\x1b[31mSupabase environment variables aren't configured correctly. Supabase client will not be initialized. Fix ENV configuration or disable DB authentication with USE_DB_AUTHENTICATION env variable\x1b[0m"
+ );
+ } else {
+ this.client = createClient(supabaseUrl, supabaseServiceToken);
+ }
+ }
+
+ // Provides access to the initialized Supabase client, if available.
+ getClient(): SupabaseClient | null {
+ return this.client;
+ }
+}
+
+// Using a Proxy to handle dynamic access to the Supabase client or service methods.
+// This approach ensures that if Supabase is not configured, any attempt to use it will result in a clear error.
+export const supabase_service: SupabaseClient = new Proxy(
+ new SupabaseService(),
+ {
+ get: function (target, prop, receiver) {
+ const client = target.getClient();
+ // If the Supabase client is not initialized, intercept property access to provide meaningful error feedback.
+ if (client === null) {
+ console.error(
+ "Attempted to access Supabase client when it's not configured."
+ );
+ return () => {
+ throw new Error("Supabase client is not configured.");
+ };
+ }
+ // Direct access to SupabaseService properties takes precedence.
+ if (prop in target) {
+ return Reflect.get(target, prop, receiver);
+ }
+ // Otherwise, delegate access to the Supabase client.
+ return Reflect.get(client, prop, receiver);
+ },
+ }
+) as unknown as SupabaseClient;
diff --git a/apps/test-suite/utils/tokens.ts b/apps/test-suite/utils/tokens.ts
new file mode 100644
index 0000000..f47a6b3
--- /dev/null
+++ b/apps/test-suite/utils/tokens.ts
@@ -0,0 +1,16 @@
+import { encoding_for_model } from "@dqbd/tiktoken";
+import { TiktokenModel } from "@dqbd/tiktoken";
+
+// This function calculates the number of tokens in a text string using GPT-3.5-turbo model
+export function numTokensFromString(message: string, model: string): number {
+ const encoder = encoding_for_model(model as TiktokenModel);
+
+ // Encode the message into tokens
+ const tokens = encoder.encode(message);
+
+ // Free the encoder resources after use
+ encoder.free();
+
+ // Return the number of tokens
+ return tokens.length;
+}
diff --git a/apps/test-suite/utils/types.ts b/apps/test-suite/utils/types.ts
new file mode 100644
index 0000000..dced48d
--- /dev/null
+++ b/apps/test-suite/utils/types.ts
@@ -0,0 +1,7 @@
+export interface WebsiteScrapeError {
+ website: string;
+ prompt: string;
+ expected_output: string;
+ actual_output: string;
+ error: string;
+}
diff --git a/tutorials/contradiction-testing-using-llms.mdx b/tutorials/contradiction-testing-using-llms.mdx
index e2a4d73..6a9590a 100644
--- a/tutorials/contradiction-testing-using-llms.mdx
+++ b/tutorials/contradiction-testing-using-llms.mdx
@@ -1,4 +1,4 @@
-# Build an agent that check your website for contradictions
+# Build an agent that checks your website for contradictions
Learn how to use Firecrawl and Claude to scrape your website's data and look for contradictions and inconsistencies in a few lines of code. When you are shipping fast, data is bound to get stale, with FireCrawl and LLMs you can make sure your public web data is always consistent! We will be using Opus's huge 200k context window and Firecrawl's parellization, making this process accurate and fast.